use bcode_ipc::{
ActivateWorkflowRevisionRequest, ApplyWorkflowDraftEditsRequest, ApplyWorkflowPackageRequest,
ApplyWorkflowSourceRequest, ArtifactId, ClientRuntimeContext, ComposerDraftScope,
CreateAuthoredWorkflowRequest, CreateWorkflowPresetRequest, DeleteWorkflowPresetRequest,
DiscardWorkflowDraftRequest, ExportWorkflowRevisionRequest, ForkWorkflowDraftRequest,
ImportWorkflowDraftRequest, ImportWorkflowRequest, ImportWorkflowRevisionRequest,
PreviewWorkflowImportRequest, PromptPlacement, PublishAndStartWorkflowRequest,
PublishWorkflowDraftRequest, PublishWorkflowPackageRequest, Request, ServerStopMode,
SessionBulkMigrationStartRequest, SessionCompatibilityInventoryRequest,
SetAuthoredWorkflowArchivedRequest, StartAuthoredWorkflowRequest,
StartWorkflowPackageExportRequest, UpdateWorkflowDraftRequest, UpdateWorkflowPresetRequest,
WorkflowComputationControl, WorkflowDefinitionRegistrationRequest,
WorkflowPackageComputationRequest, WorkflowPackagePreviewRequest, WorkflowRunBindingLookup,
WorkflowRunControlAction, WorkflowRunStartRequest, WorkflowSourceComputationRequest,
WorkflowSourcePreviewRequest, WorkflowStartRequest, WorkflowTemplateInstantiationRequest,
WorkflowTemplateStartRequest, WorktreeCreateRequest, WorktreeListRequest,
WorktreeRemoveRequest,
};
use bcode_ralph_models::{
RalphApproveRequest, RalphCancelRequest, RalphLifecycleRequest, RalphListIterationsRequest,
RalphListRunsRequest, RalphResumeRequest, RalphRunRequest, RalphRunStatusRequest,
RalphStatusRequest,
};
use bcode_session_models::{
ProjectionWindowRequest, SessionHistoryAroundQuery, SessionHistoryQuery, SessionId,
SessionInspectionQuery, SessionOpenOperationId, WorkId,
};
use bcode_skill_models::SkillId;
use std::path::PathBuf;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SessionLifecycleRequest {
Hello {
client_name: String,
runtime_context: Option<ClientRuntimeContext>,
daemon_namespace: String,
artifact_id: Option<ArtifactId>,
build_fingerprint: String,
state_location_id: Option<String>,
},
UpdateClientRuntimeContext {
runtime_context: Option<ClientRuntimeContext>,
},
Ping,
IngestClientMetrics {
batch: bcode_metrics::ClientMetricBatch,
},
ServerStatus {
working_directory: Option<PathBuf>,
},
ModelCatalogDiagnostics,
ServerStop {
mode: ServerStopMode,
},
ReleaseSessionOwnership {
session_id: SessionId,
},
SetComposerDraft {
scope: ComposerDraftScope,
text: String,
},
ComposerDraft {
scope: ComposerDraftScope,
},
CreateSession {
name: Option<String>,
working_directory: PathBuf,
},
CreateChildSession {
request: bcode_session_models::SessionChildCreateRequest,
},
SessionSummary {
session_id: SessionId,
},
WorkflowActivityPage {
request: bcode_workflow_view_models::WorkflowActivityPageRequest,
},
WorkflowActivityClose {
scan_id: String,
},
SessionProgressSnapshot {
session_id: SessionId,
},
SessionActivity {
session_id: SessionId,
query: bcode_session_models::SessionActivityQuery,
},
ReconcileSessionChildren {
parent_id: SessionId,
apply: bool,
},
SessionChildren {
query: bcode_session_models::SessionChildQuery,
},
ListSessions {
working_directory: PathBuf,
},
ListSessionsWithScope {
scope: bcode_session_models::SessionDiscoveryScope,
},
ListSessionsPageWithScope {
scope: bcode_session_models::SessionDiscoveryScope,
query: bcode_session_models::SessionCatalogQuery,
cursor: Option<bcode_session_models::SessionCatalogCursor>,
limit: usize,
},
SubscribeCatalogUpdates,
ChangeSessionWorkingDirectory {
session_id: SessionId,
working_directory: PathBuf,
},
ListWorktrees(WorktreeListRequest),
WorktreeCreateStart {
operation_id: String,
request: WorktreeCreateRequest,
},
WorktreeCreateStatus {
operation_id: String,
},
WorktreeCreateWait {
operation_id: String,
after_revision: u64,
timeout_ms: u64,
},
RemoveWorktree(WorktreeRemoveRequest),
RalphStatus(RalphStatusRequest),
RunRalphLoop(RalphRunRequest),
ApproveRalphRun(RalphApproveRequest),
CancelRalphLoop(RalphCancelRequest),
ListRalphRuns(Box<RalphListRunsRequest>),
ListRalphIterations(Box<RalphListIterationsRequest>),
ResumeRalphRun(RalphResumeRequest),
RalphRunStatus(RalphRunStatusRequest),
RecordRalphLifecycle(RalphLifecycleRequest),
RenameSession {
session_id: SessionId,
name: Option<String>,
},
DeleteSession {
session_id: SessionId,
},
PrepareContextGeneration(bcode_session_models::PrepareContextGeneration),
SessionWorkingDocument(bcode_session_models::SessionWorkingDocumentRequest),
ReadSessionTraceBlob(bcode_session_models::ReadSessionTraceBlobRequest),
ReadSessionArtifact {
session_id: SessionId,
artifact_id: String,
reference_key: String,
offset: u64,
length: u32,
},
InvocationInput {
session_id: SessionId,
input: bcode_tool::ToolInvocationInput,
},
GenerateSessionMilestone {
session_id: SessionId,
},
SessionMilestones {
session_id: SessionId,
query: bcode_session_models::SessionMilestoneQuery,
},
SessionDerivationSnapshot {
session_id: SessionId,
},
SessionDerivationPrompts {
session_id: SessionId,
query: bcode_session_models::SessionDerivationPromptQuery,
},
DeriveSession {
request: Box<bcode_session_models::SessionDerivationRequest>,
},
SessionDerivationStatus {
operation_id: bcode_session_models::SessionDerivationOperationId,
},
CancelSessionDerivation {
operation_id: bcode_session_models::SessionDerivationOperationId,
},
SessionHistory {
session_id: SessionId,
},
RepriceSession {
session_id: SessionId,
range: bcode_session_models::SessionCostRange,
catalog: Box<bcode_model_catalog_models::CatalogDocument>,
},
UsageCatalog {
after: Option<SessionId>,
},
UsageReport {
query: bcode_usage_models::UsageQuery,
},
SessionUsage {
session_id: SessionId,
query: bcode_session_models::SessionUsageQuery,
},
UsageCollect {
session_id: SessionId,
query: bcode_session_models::SessionUsageQuery,
},
SessionAdmission {
session_id: SessionId,
apply: bool,
},
SessionCompress {
request: bcode_session_models::StorageCompressionRequest,
},
SessionStorageUsage {
session_id: SessionId,
entry_budget: u32,
},
SessionHistoryPage {
session_id: SessionId,
query: SessionHistoryQuery,
},
SessionProjectionHistoryPage {
session_id: SessionId,
request: Box<bcode_session_models::ProjectionWindowRequest>,
},
SessionHistoryAround {
session_id: SessionId,
query: SessionHistoryAroundQuery,
},
SessionCategorization {
session_id: SessionId,
},
SessionInspection {
session_id: SessionId,
query: SessionInspectionQuery,
},
SessionCompatibilityInventory {
request: SessionCompatibilityInventoryRequest,
},
SessionBulkMigrationStart {
request: SessionBulkMigrationStartRequest,
},
SessionBulkMigrationStatus {
operation_id: String,
},
SessionBulkMigrationWait {
operation_id: String,
after_revision: u64,
timeout_ms: u64,
},
SessionBulkMigrationCancel {
operation_id: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SessionSearchAttachRequest {
SessionSearch {
request: bcode_session_search::SessionSearchRequest,
policy: bcode_session_search::SessionSearchPlanPolicy,
routes: Vec<bcode_session_search::SessionSearchContentRoute>,
hydrate: bool,
},
SessionSearchProviders,
SessionSearchExplain {
request: bcode_session_search::SessionSearchRequest,
policy: bcode_session_search::SessionSearchPlanPolicy,
routes: Vec<bcode_session_search::SessionSearchContentRoute>,
},
SessionSearchPurge {
provider_id: String,
confirmation: String,
},
SessionSearchRebuild {
provider_id: String,
confirmation: String,
},
SessionSearchCompleteBackfillStart {
request: bcode_session_search::CompleteSessionSearchBackfillRequest,
},
SessionSearchBackfillStart {
request: bcode_session_search::BackfillSessionSearchRequest,
},
SessionSearchBackfillStatus {
operation_id: String,
},
SessionSearchBackfillWait {
operation_id: String,
after_revision: u64,
timeout_ms: u64,
},
SessionSearchBackfillCancel {
operation_id: String,
},
SessionSearchBackfill {
request: bcode_session_search::BackfillSessionSearchRequest,
},
PrepareSessionOpen {
session_id: SessionId,
},
WaitSessionOpenProgress {
session_id: SessionId,
operation_id: SessionOpenOperationId,
after_revision: u64,
timeout_ms: u64,
},
AttachSession {
session_id: SessionId,
},
AttachSessionRecent {
session_id: SessionId,
limit: usize,
},
AttachSessionProjectionWindow {
session_id: SessionId,
request: ProjectionWindowRequest,
},
ImportExternalSession {
source_id: String,
external_session_id: String,
working_directory: Option<PathBuf>,
},
RefreshSessionCatalog {
working_directory: Option<PathBuf>,
sources: Option<Vec<String>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SessionTurnRequest {
SendUserMessage {
session_id: SessionId,
text: String,
},
SendUserMessageWithPlacement {
session_id: SessionId,
text: String,
placement: PromptPlacement,
},
SendUserMessageWithExecution {
session_id: SessionId,
text: String,
placement: PromptPlacement,
execution: bcode_session_models::TurnExecutionOptions,
},
SubmitPrompt {
session_id: SessionId,
submission_id: bcode_session_models::SubmissionId,
text: String,
placement: bcode_session_models::SubmissionPlacement,
admission: bcode_session_models::TurnAdmissionMetadata,
require_active_turn: bool,
},
GetSubmission {
session_id: SessionId,
submission_id: bcode_session_models::SubmissionId,
},
PendingSubmissions {
session_id: SessionId,
after: Option<u64>,
limit: u32,
},
SubmissionQueueStatus {
session_id: SessionId,
},
PrepareSubmissionResume {
session_id: SessionId,
submission_id: bcode_session_models::SubmissionId,
expected_accepted_sequence: u64,
},
ResumeSubmission {
session_id: SessionId,
confirmation: bcode_session_models::SubmissionResumeConfirmation,
operation_id: String,
},
CancelPendingSubmission {
session_id: SessionId,
submission_id: bcode_session_models::SubmissionId,
expected_accepted_sequence: u64,
operation_id: String,
},
SubmitTurn {
session_id: SessionId,
text: String,
admission: bcode_session_models::TurnAdmissionMetadata,
},
InvokeSkill {
session_id: SessionId,
skill_id: SkillId,
arguments: String,
display_text: String,
},
InvokeSkillWithExecution {
session_id: SessionId,
skill_id: SkillId,
arguments: String,
display_text: String,
execution: bcode_session_models::TurnExecutionOptions,
},
CancelSessionTurn {
session_id: SessionId,
expected_turn_id: Option<String>,
clear_queue: bool,
},
CancelRuntimeWork {
session_id: SessionId,
work_id: WorkId,
},
ApplyWorkflowSource(ApplyWorkflowSourceRequest),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum WorkflowMutationRequest {
CreateAuthoredWorkflow(CreateAuthoredWorkflowRequest),
CancelWorkflowComputation { operation_id: String },
ResetIncompatibleWorkflowStore {
confirm: String,
},
ApplyWorkflowDraftEdits(ApplyWorkflowDraftEditsRequest),
UpdateWorkflowDraft(UpdateWorkflowDraftRequest),
PublishWorkflowDraft(PublishWorkflowDraftRequest),
PublishAndStartWorkflow(Box<PublishAndStartWorkflowRequest>),
ActivateWorkflowRevision(ActivateWorkflowRevisionRequest),
SetAuthoredWorkflowArchived(SetAuthoredWorkflowArchivedRequest),
DiscardWorkflowDraft(DiscardWorkflowDraftRequest),
ForkWorkflowDraft(ForkWorkflowDraftRequest),
CreateWorkflowPreset(CreateWorkflowPresetRequest),
UpdateWorkflowPreset(UpdateWorkflowPresetRequest),
DeleteWorkflowPreset(DeleteWorkflowPresetRequest),
ExportWorkflowRevision(ExportWorkflowRevisionRequest),
PreviewWorkflowImport(PreviewWorkflowImportRequest),
ImportWorkflow(ImportWorkflowRequest),
ImportWorkflowDraft(ImportWorkflowDraftRequest),
ImportWorkflowRevision(ImportWorkflowRevisionRequest),
StartAuthoredWorkflow(StartAuthoredWorkflowRequest),
StartWorkflowPackageExport(StartWorkflowPackageExportRequest),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum WorkflowAuthoringRequest {
ListAuthoredWorkflows {
cursor: Option<bcode_workflow::WorkflowAuthoringListCursor>,
limit: usize,
},
GetAuthoredWorkflow { workflow_id: String },
InspectAuthoredWorkflow { workflow_id: String, limit: usize },
ListWorkflowDrafts {
workflow_id: String,
cursor: Option<bcode_workflow::WorkflowAuthoringListCursor>,
limit: usize,
},
GetWorkflowDraft {
workflow_id: String,
draft_id: String,
},
ListWorkflowRevisions {
workflow_id: String,
cursor: Option<bcode_workflow::WorkflowRevisionListCursor>,
limit: usize,
},
GetWorkflowRevision { workflow_id: String, revision: u64 },
InspectWorkflowRevisionRequirements { workflow_id: String, revision: u64 },
ListWorkflowPresets {
workflow_id: String,
cursor: Option<bcode_workflow::WorkflowAuthoringListCursor>,
limit: usize,
},
GetWorkflowPreset {
workflow_id: String,
preset_id: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum WorkflowDefinitionRequest {
WorkflowAuthoringCatalog,
CancelWorkflowDiscovery {
token: String,
},
WorkflowLaunchCatalog(bcode_workflow::WorkflowLaunchCatalogRequest),
WorkflowLaunchDetail(bcode_workflow::WorkflowLaunchDetailRequest),
GetWorkflowPackagePublication {
package_id: String,
},
ApplyWorkflowPackage(ApplyWorkflowPackageRequest),
PublishWorkflowPackage(PublishWorkflowPackageRequest),
ValidateWorkflowPackage(WorkflowPackageComputationRequest),
PreviewWorkflowPackage(WorkflowPackagePreviewRequest),
ValidateWorkflowSource(WorkflowSourceComputationRequest),
PreviewWorkflowSource(WorkflowSourcePreviewRequest),
ValidateWorkflowAuthoring {
document: bcode_workflow::WorkflowAuthoringDocument,
control: WorkflowComputationControl,
},
PreviewWorkflowCompilation {
document: bcode_workflow::WorkflowAuthoringDocument,
configuration: Option<serde_json::Value>,
control: WorkflowComputationControl,
},
InspectWorkflowTemplates {
limit: usize,
},
InspectWorkflowTemplate {
owner_plugin_id: String,
template_id: String,
template_version: u32,
},
ListWorkflowTemplates {
limit: usize,
},
DescribeWorkflowTemplate {
owner_plugin_id: String,
template_id: String,
template_version: u32,
},
InstantiateWorkflowTemplate(WorkflowTemplateInstantiationRequest),
StartWorkflowTemplate(WorkflowTemplateStartRequest),
RegisterWorkflowDefinition(WorkflowDefinitionRegistrationRequest),
StartWorkflow(WorkflowStartRequest),
WorkflowContinuationSource {
run_id: String,
},
ContinueWorkflow(bcode_workflow::WorkflowContinuationRequest),
RequestWorkflowReplacement(bcode_workflow::WorkflowReplacementRequest),
StartWorkflowRun(WorkflowRunStartRequest),
ListWorkflowDefinitions {
limit: usize,
},
DescribeWorkflowDefinition {
definition_id: String,
version: u32,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RuntimeAndModelRequest {
WorkflowDelegationPreflight {
plugin_id: String,
},
AcceptWorkflowRunGraphPublication {
request: bcode_workflow::WorkflowRunGraphEditBatch,
},
PublishWorkflowRunGraphEdit {
request: bcode_workflow::WorkflowRunGraphEditBatch,
},
StageWorkflowRunGraphEdit {
request: bcode_workflow::WorkflowRunGraphEditBatch,
},
InspectWorkflowRunGraph {
request: bcode_ipc::WorkflowRunGraphPageRequest,
},
InspectWorkflowRun {
run_id: String,
limit: usize,
},
WorkflowIdentityCatalog {
request: bcode_workflow_view_models::WorkflowIdentityCatalogRequest,
},
WorkflowSchedulingPage {
request: bcode_workflow::WorkflowSchedulingPageRequest,
},
WorkflowRunView {
run_id: String,
limit: usize,
},
WorkflowCatalogView {
request: bcode_workflow_view_models::WorkflowCatalogRequest,
},
WorkflowRunStatus {
run_id: String,
},
AssociatedWorkflowRun {
key: WorkflowRunBindingLookup,
},
InspectAssociatedWorkflowRun {
key: WorkflowRunBindingLookup,
limit: usize,
},
ControlWorkflowRun {
run_id: String,
action: WorkflowRunControlAction,
},
ControlAssociatedWorkflowRun {
key: WorkflowRunBindingLookup,
action: WorkflowRunControlAction,
},
ListWorkflowRuns {
limit: usize,
},
ListWorkflowDiagnosticArtifacts {
run_id: String,
dispatch_identity: String,
},
ReadWorkflowDiagnosticArtifact(bcode_workflow::WorkflowDiagnosticArtifactRequest),
WorkflowRunOutputs {
run_id: String,
limit: usize,
},
CancelWorkflowRun {
run_id: String,
},
ReconcileOrphanedWorkflowRuns {
apply: bool,
limit: usize,
},
PauseWorkflowRun {
run_id: String,
},
ResumeWorkflowRun {
run_id: String,
},
DoctorWorkflowRun {
run_id: String,
limit: usize,
},
RepairWorkflowAttempt {
dispatch_identity: String,
resolution: bcode_workflow_store::RepairResolution,
},
RetryWorkflowNode {
run_id: String,
node_id: String,
activation_id: String,
failed_attempt: u32,
},
ListWorkflowWaits {
run_id: String,
limit: usize,
},
ProvideWorkflowInput {
run_id: String,
node_id: String,
activation_id: String,
value: serde_json::Value,
},
ResolveWorkflowApproval {
run_id: String,
node_id: String,
activation_id: String,
approved: bool,
},
ListWorkflowMutationApprovalsAll {
limit: usize,
},
ListWorkflowMutationApprovals {
run_id: String,
limit: usize,
},
ResolveWorkflowMutationApproval {
approval_id: String,
decision: bcode_workflow::WorkflowMutationApprovalDecision,
},
WorkflowAttemptHistory {
run_id: String,
cursor: Option<bcode_workflow_store::AttemptCursor>,
limit: usize,
},
WorkflowCommittedHistory {
query: bcode_workflow::WorkflowCommittedHistoryQuery,
},
WorkflowLifecycleHistory {
query: bcode_workflow::WorkflowLifecycleHistoryQuery,
},
WorkflowInventory {
query: bcode_workflow::WorkflowInventoryQuery,
},
WorkflowSemanticHistory {
query: bcode_workflow::WorkflowSemanticHistoryQuery,
},
WorkflowObservations {
run_id: String,
after_sequence: Option<u64>,
through_sequence: Option<u64>,
limit: usize,
},
WorkflowEventHistory {
run_id: String,
after_sequence: Option<u64>,
limit: usize,
},
WorkflowLiveEventCatchUp {
after_sequence: u64,
limit: usize,
},
SubscribeWorkflowRuns,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CoreRuntimeRequest {
RuntimeWorkObservations {
session_id: SessionId,
after: Option<WorkId>,
limit: usize,
},
ListRuntimeWork {
session_id: SessionId,
},
RuntimeWorkHistory {
session_id: SessionId,
limit: usize,
},
SubscribeRuntimeWork {
session_id: SessionId,
},
CompactSession {
session_id: SessionId,
},
SetSessionModel {
session_id: SessionId,
provider_plugin_id: Option<String>,
model_id: String,
},
SetSessionReasoning {
session_id: SessionId,
effort: Option<String>,
summary: Option<String>,
},
AppendPresentationNote {
session_id: SessionId,
source_id: String,
note_id: String,
text: String,
format: bcode_command::CommandTextFormat,
},
SessionModelStatus {
session_id: SessionId,
},
DefaultModelStatus,
SessionModelList {
provider_plugin_id: Option<String>,
},
CheckModels {
check_id: String,
session_id: Option<SessionId>,
provider_plugin_id: Option<String>,
model_ids: Vec<String>,
timeout_seconds: u64,
allow_provider_requests: bool,
},
CancelModelCheck {
check_id: String,
},
SessionModelListForSession {
session_id: SessionId,
provider_plugin_id: Option<String>,
},
JudgementSetup,
JudgementSetupValidate {
selection_json: String,
},
SelectOptionalContext {
request_json: String,
},
TurnJudgementObservation {
session_id: SessionId,
turn_id: String,
},
OptionalJudge {
request_json: String,
},
JudgementVerify {
selection_json: String,
},
Judge {
provider_plugin_id: String,
auth_profile: String,
request_json: String,
},
AuthPoolList,
SetAuthPoolPreference {
pool: String,
profile: Option<String>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PermissionInteractionRequest {
ListPermissions,
ResolvePermission {
permission_id: String,
approved: bool,
remember: bool,
},
ResolvePermissionBatch {
batch_id: String,
approved: bool,
},
ListPendingToolExchanges,
ResolveToolExchange {
exchange_id: String,
resolution_json: serde_json::Value,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AgentSkillPluginRequest {
ListAgents,
ListSkills,
DescribeSkill {
skill_id: SkillId,
},
ActivateSkill {
session_id: SessionId,
skill_id: SkillId,
},
DeactivateSkill {
session_id: SessionId,
skill_id: SkillId,
},
ActiveSkills {
session_id: SessionId,
},
AgentPolicyStatus,
SetSessionAgent {
session_id: SessionId,
agent_id: String,
},
AddPermissionRule {
agent_id: String,
category: String,
pattern: String,
action: String,
},
ListPluginServices,
ListPluginContributions,
InvokePluginServiceContextual {
context: bcode_ipc::PluginServiceContext,
plugin_id: String,
interface_id: String,
operation: String,
payload: Vec<u8>,
},
CancelPluginServiceInvocation {
invocation_id: String,
},
InvokePluginService {
plugin_id: String,
interface_id: String,
operation: String,
payload: Vec<u8>,
},
CallPluginService {
interface_id: String,
operation: String,
payload: Vec<u8>,
},
PublishPluginEvent {
topic: String,
payload: Vec<u8>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RoutedRequest {
SessionLifecycle(Box<SessionLifecycleRequest>),
SessionSearchAttach(SessionSearchAttachRequest),
SessionTurn(SessionTurnRequest),
WorkflowMutation(Box<WorkflowMutationRequest>),
WorkflowAuthoring(WorkflowAuthoringRequest),
WorkflowDefinition(Box<WorkflowDefinitionRequest>),
RuntimeAndModel(Box<RuntimeAndModelRequest>),
CoreRuntime(Box<CoreRuntimeRequest>),
PermissionInteraction(PermissionInteractionRequest),
AgentSkillPlugin(AgentSkillPluginRequest),
}
impl RoutedRequest {
#[must_use]
#[allow(clippy::too_many_lines)]
pub fn from_request(request: Request) -> Self {
match request {
Request::Hello {
client_name,
runtime_context,
daemon_namespace,
artifact_id,
build_fingerprint,
state_location_id,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::Hello {
client_name,
runtime_context,
daemon_namespace,
artifact_id,
build_fingerprint,
state_location_id,
})),
Request::Ping => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::Ping)),
Request::ServerStatus { working_directory } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ServerStatus {
working_directory,
}))
}
Request::ServerStop { mode } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ServerStop { mode }))
}
Request::CreateSession {
name,
working_directory,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::CreateSession {
name,
working_directory,
})),
Request::CreateChildSession { request } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::CreateChildSession {
request,
}))
}
Request::SessionSummary { session_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionSummary {
session_id,
}))
}
Request::WorkflowActivityPage { request } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::WorkflowActivityPage {
request,
}))
}
Request::WorkflowActivityClose { scan_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::WorkflowActivityClose {
scan_id,
}))
}
Request::SessionProgressSnapshot { session_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionProgressSnapshot {
session_id,
}))
}
Request::SessionActivity { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionActivity {
session_id,
query,
}))
}
Request::ReconcileSessionChildren { parent_id, apply } => Self::SessionLifecycle(
Box::new(SessionLifecycleRequest::ReconcileSessionChildren { parent_id, apply }),
),
Request::SessionChildren { query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionChildren { query }))
}
Request::ListSessionsWithScope { scope } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ListSessionsWithScope {
scope,
}))
}
Request::ListSessionsPageWithScope {
scope,
query,
cursor,
limit,
} => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::ListSessionsPageWithScope {
scope,
query,
cursor,
limit,
},
)),
Request::ListSessions { working_directory } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ListSessions {
working_directory,
}))
}
Request::RenameSession { session_id, name } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::RenameSession {
session_id,
name,
}))
}
Request::DeleteSession { session_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::DeleteSession {
session_id,
}))
}
Request::SessionHistory { session_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionHistory {
session_id,
}))
}
Request::RepriceSession {
session_id,
range,
catalog,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::RepriceSession {
session_id,
range,
catalog,
})),
Request::UsageCatalog { after } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::UsageCatalog { after }))
}
Request::UsageReport { query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::UsageReport { query }))
}
Request::SessionUsage { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionUsage {
session_id,
query,
}))
}
Request::UsageCollect { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::UsageCollect {
session_id,
query,
}))
}
Request::SessionAdmission { session_id, apply } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionAdmission {
session_id,
apply,
}))
}
Request::SessionCompress { request } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionCompress {
request,
}))
}
Request::SessionStorageUsage {
session_id,
entry_budget,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionStorageUsage {
session_id,
entry_budget,
})),
Request::SessionHistoryPage { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionHistoryPage {
session_id,
query,
}))
}
Request::SessionProjectionHistoryPage {
session_id,
request,
} => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::SessionProjectionHistoryPage {
session_id,
request,
},
)),
Request::AttachSession { session_id } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::AttachSession { session_id })
}
Request::AttachSessionRecent { session_id, limit } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::AttachSessionRecent {
session_id,
limit,
})
}
Request::SendUserMessage { session_id, text } => {
Self::SessionTurn(SessionTurnRequest::SendUserMessage { session_id, text })
}
Request::SendUserMessageWithPlacement {
session_id,
text,
placement,
} => Self::SessionTurn(SessionTurnRequest::SendUserMessageWithPlacement {
session_id,
text,
placement,
}),
Request::SendUserMessageWithExecution {
session_id,
text,
placement,
execution,
} => Self::SessionTurn(SessionTurnRequest::SendUserMessageWithExecution {
session_id,
text,
placement,
execution,
}),
Request::SubmitPrompt {
session_id,
submission_id,
text,
placement,
admission,
require_active_turn,
} => Self::SessionTurn(SessionTurnRequest::SubmitPrompt {
session_id,
submission_id,
text,
placement,
admission,
require_active_turn,
}),
Request::SubmissionQueueStatus { session_id } => {
Self::SessionTurn(SessionTurnRequest::SubmissionQueueStatus { session_id })
}
Request::PrepareSubmissionResume {
session_id,
submission_id,
expected_accepted_sequence,
} => Self::SessionTurn(SessionTurnRequest::PrepareSubmissionResume {
session_id,
submission_id,
expected_accepted_sequence,
}),
Request::ResumeSubmission {
session_id,
confirmation,
operation_id,
} => Self::SessionTurn(SessionTurnRequest::ResumeSubmission {
session_id,
confirmation,
operation_id,
}),
Request::CancelPendingSubmission {
session_id,
submission_id,
expected_accepted_sequence,
operation_id,
} => Self::SessionTurn(SessionTurnRequest::CancelPendingSubmission {
session_id,
submission_id,
expected_accepted_sequence,
operation_id,
}),
Request::PendingSubmissions {
session_id,
after,
limit,
} => Self::SessionTurn(SessionTurnRequest::PendingSubmissions {
session_id,
after,
limit,
}),
Request::GetSubmission {
session_id,
submission_id,
} => Self::SessionTurn(SessionTurnRequest::GetSubmission {
session_id,
submission_id,
}),
Request::SubmitTurn {
session_id,
text,
admission,
} => Self::SessionTurn(SessionTurnRequest::SubmitTurn {
session_id,
text,
admission,
}),
Request::InvokeSkill {
session_id,
skill_id,
arguments,
display_text,
} => Self::SessionTurn(SessionTurnRequest::InvokeSkill {
session_id,
skill_id,
arguments,
display_text,
}),
Request::InvokeSkillWithExecution {
session_id,
skill_id,
arguments,
display_text,
execution,
} => Self::SessionTurn(SessionTurnRequest::InvokeSkillWithExecution {
session_id,
skill_id,
arguments,
display_text,
execution,
}),
Request::CancelSessionTurn {
session_id,
expected_turn_id,
clear_queue,
} => Self::SessionTurn(SessionTurnRequest::CancelSessionTurn {
session_id,
expected_turn_id,
clear_queue,
}),
Request::CancelRuntimeWork {
session_id,
work_id,
} => Self::SessionTurn(SessionTurnRequest::CancelRuntimeWork {
session_id,
work_id,
}),
Request::CreateAuthoredWorkflow(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::CreateAuthoredWorkflow(payload),
)),
Request::ApplyWorkflowSource(payload) => {
Self::SessionTurn(SessionTurnRequest::ApplyWorkflowSource(payload))
}
Request::CancelWorkflowComputation { operation_id } => Self::WorkflowMutation(
Box::new(WorkflowMutationRequest::CancelWorkflowComputation { operation_id }),
),
Request::ResetIncompatibleWorkflowStore { confirm } => Self::WorkflowMutation(
Box::new(WorkflowMutationRequest::ResetIncompatibleWorkflowStore { confirm }),
),
Request::ApplyWorkflowDraftEdits(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::ApplyWorkflowDraftEdits(payload),
)),
Request::UpdateWorkflowDraft(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::UpdateWorkflowDraft(payload),
)),
Request::PublishWorkflowDraft(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::PublishWorkflowDraft(payload),
)),
Request::PublishAndStartWorkflow(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::PublishAndStartWorkflow(payload),
)),
Request::ActivateWorkflowRevision(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::ActivateWorkflowRevision(payload),
)),
Request::SetAuthoredWorkflowArchived(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::SetAuthoredWorkflowArchived(payload),
)),
Request::DiscardWorkflowDraft(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::DiscardWorkflowDraft(payload),
)),
Request::ForkWorkflowDraft(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::ForkWorkflowDraft(payload),
)),
Request::CreateWorkflowPreset(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::CreateWorkflowPreset(payload),
)),
Request::UpdateWorkflowPreset(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::UpdateWorkflowPreset(payload),
)),
Request::DeleteWorkflowPreset(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::DeleteWorkflowPreset(payload),
)),
Request::ExportWorkflowRevision(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::ExportWorkflowRevision(payload),
)),
Request::PreviewWorkflowImport(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::PreviewWorkflowImport(payload),
)),
Request::ImportWorkflow(payload) => {
Self::WorkflowMutation(Box::new(WorkflowMutationRequest::ImportWorkflow(payload)))
}
Request::ImportWorkflowDraft(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::ImportWorkflowDraft(payload),
)),
Request::ImportWorkflowRevision(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::ImportWorkflowRevision(payload),
)),
Request::StartAuthoredWorkflow(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::StartAuthoredWorkflow(payload),
)),
Request::StartWorkflowPackageExport(payload) => Self::WorkflowMutation(Box::new(
WorkflowMutationRequest::StartWorkflowPackageExport(payload),
)),
Request::ListAuthoredWorkflows { cursor, limit } => {
Self::WorkflowAuthoring(WorkflowAuthoringRequest::ListAuthoredWorkflows {
cursor,
limit,
})
}
Request::GetAuthoredWorkflow { workflow_id } => {
Self::WorkflowAuthoring(WorkflowAuthoringRequest::GetAuthoredWorkflow {
workflow_id,
})
}
Request::InspectAuthoredWorkflow { workflow_id, limit } => {
Self::WorkflowAuthoring(WorkflowAuthoringRequest::InspectAuthoredWorkflow {
workflow_id,
limit,
})
}
Request::ListWorkflowDrafts {
workflow_id,
cursor,
limit,
} => Self::WorkflowAuthoring(WorkflowAuthoringRequest::ListWorkflowDrafts {
workflow_id,
cursor,
limit,
}),
Request::GetWorkflowDraft {
workflow_id,
draft_id,
} => Self::WorkflowAuthoring(WorkflowAuthoringRequest::GetWorkflowDraft {
workflow_id,
draft_id,
}),
Request::ListWorkflowRevisions {
workflow_id,
cursor,
limit,
} => Self::WorkflowAuthoring(WorkflowAuthoringRequest::ListWorkflowRevisions {
workflow_id,
cursor,
limit,
}),
Request::GetWorkflowRevision {
workflow_id,
revision,
} => Self::WorkflowAuthoring(WorkflowAuthoringRequest::GetWorkflowRevision {
workflow_id,
revision,
}),
Request::InspectWorkflowRevisionRequirements {
workflow_id,
revision,
} => Self::WorkflowAuthoring(
WorkflowAuthoringRequest::InspectWorkflowRevisionRequirements {
workflow_id,
revision,
},
),
Request::ListWorkflowPresets {
workflow_id,
cursor,
limit,
} => Self::WorkflowAuthoring(WorkflowAuthoringRequest::ListWorkflowPresets {
workflow_id,
cursor,
limit,
}),
Request::GetWorkflowPreset {
workflow_id,
preset_id,
} => Self::WorkflowAuthoring(WorkflowAuthoringRequest::GetWorkflowPreset {
workflow_id,
preset_id,
}),
Request::WorkflowAuthoringCatalog => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::WorkflowAuthoringCatalog,
)),
Request::CancelWorkflowDiscovery { token } => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::CancelWorkflowDiscovery { token },
)),
Request::WorkflowLaunchCatalog(request) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::WorkflowLaunchCatalog(request),
)),
Request::WorkflowLaunchDetail(request) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::WorkflowLaunchDetail(request),
)),
Request::GetWorkflowPackagePublication { package_id } => Self::WorkflowDefinition(
Box::new(WorkflowDefinitionRequest::GetWorkflowPackagePublication { package_id }),
),
Request::ApplyWorkflowPackage(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ApplyWorkflowPackage(payload),
)),
Request::PublishWorkflowPackage(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::PublishWorkflowPackage(payload),
)),
Request::ValidateWorkflowPackage(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ValidateWorkflowPackage(payload),
)),
Request::PreviewWorkflowPackage(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::PreviewWorkflowPackage(payload),
)),
Request::ValidateWorkflowSource(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ValidateWorkflowSource(payload),
)),
Request::PreviewWorkflowSource(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::PreviewWorkflowSource(payload),
)),
Request::ValidateWorkflowAuthoring { document, control } => {
Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ValidateWorkflowAuthoring { document, control },
))
}
Request::PreviewWorkflowCompilation {
document,
configuration,
control,
} => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::PreviewWorkflowCompilation {
document,
configuration,
control,
},
)),
Request::InspectWorkflowTemplates { limit } => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::InspectWorkflowTemplates { limit },
)),
Request::InspectWorkflowTemplate {
owner_plugin_id,
template_id,
template_version,
} => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::InspectWorkflowTemplate {
owner_plugin_id,
template_id,
template_version,
},
)),
Request::ListWorkflowTemplates { limit } => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ListWorkflowTemplates { limit },
)),
Request::DescribeWorkflowTemplate {
owner_plugin_id,
template_id,
template_version,
} => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::DescribeWorkflowTemplate {
owner_plugin_id,
template_id,
template_version,
},
)),
Request::InstantiateWorkflowTemplate(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::InstantiateWorkflowTemplate(payload),
)),
Request::StartWorkflowTemplate(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::StartWorkflowTemplate(payload),
)),
Request::RegisterWorkflowDefinition(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::RegisterWorkflowDefinition(payload),
)),
Request::WorkflowContinuationSource { run_id } => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::WorkflowContinuationSource { run_id },
)),
Request::ContinueWorkflow(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ContinueWorkflow(payload),
)),
Request::StartWorkflow(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::StartWorkflow(payload),
)),
Request::RequestWorkflowReplacement(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::RequestWorkflowReplacement(payload),
)),
Request::StartWorkflowRun(payload) => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::StartWorkflowRun(payload),
)),
Request::ListWorkflowDefinitions { limit } => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::ListWorkflowDefinitions { limit },
)),
Request::DescribeWorkflowDefinition {
definition_id,
version,
} => Self::WorkflowDefinition(Box::new(
WorkflowDefinitionRequest::DescribeWorkflowDefinition {
definition_id,
version,
},
)),
Request::WorkflowDelegationPreflight { plugin_id } => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::WorkflowDelegationPreflight { plugin_id },
)),
Request::AcceptWorkflowRunGraphPublication { request } => Self::RuntimeAndModel(
Box::new(RuntimeAndModelRequest::AcceptWorkflowRunGraphPublication { request }),
),
Request::PublishWorkflowRunGraphEdit { request } => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::PublishWorkflowRunGraphEdit { request },
)),
Request::StageWorkflowRunGraphEdit { request } => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::StageWorkflowRunGraphEdit { request },
)),
Request::InspectWorkflowRunGraph { request } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::InspectWorkflowRunGraph {
request,
}))
}
Request::InspectWorkflowRun { run_id, limit } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::InspectWorkflowRun {
run_id,
limit,
}))
}
Request::WorkflowIdentityCatalog { request } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowIdentityCatalog {
request,
}))
}
Request::WorkflowSchedulingPage { request } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowSchedulingPage {
request,
}))
}
Request::WorkflowRunView { run_id, limit } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowRunView {
run_id,
limit,
}))
}
Request::WorkflowCatalogView { request } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowCatalogView {
request,
}))
}
Request::WorkflowRunStatus { run_id } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowRunStatus {
run_id,
}))
}
Request::AssociatedWorkflowRun { key } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::AssociatedWorkflowRun {
key,
}))
}
Request::InspectAssociatedWorkflowRun { key, limit } => Self::RuntimeAndModel(
Box::new(RuntimeAndModelRequest::InspectAssociatedWorkflowRun { key, limit }),
),
Request::ControlWorkflowRun { run_id, action } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::ControlWorkflowRun {
run_id,
action,
}))
}
Request::ControlAssociatedWorkflowRun { key, action } => Self::RuntimeAndModel(
Box::new(RuntimeAndModelRequest::ControlAssociatedWorkflowRun { key, action }),
),
Request::ListWorkflowRuns { limit } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::ListWorkflowRuns { limit }))
}
Request::ListWorkflowDiagnosticArtifacts {
run_id,
dispatch_identity,
} => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::ListWorkflowDiagnosticArtifacts {
run_id,
dispatch_identity,
},
)),
Request::ReadWorkflowDiagnosticArtifact { request } => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::ReadWorkflowDiagnosticArtifact(request),
)),
Request::WorkflowRunOutputs { run_id, limit } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowRunOutputs {
run_id,
limit,
}))
}
Request::DoctorWorkflowRun { run_id, limit } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::DoctorWorkflowRun {
run_id,
limit,
}))
}
Request::RepairWorkflowAttempt {
dispatch_identity,
resolution,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::RepairWorkflowAttempt {
dispatch_identity,
resolution,
})),
Request::RetryWorkflowNode {
run_id,
node_id,
activation_id,
failed_attempt,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::RetryWorkflowNode {
run_id,
node_id,
activation_id,
failed_attempt,
})),
Request::CancelWorkflowRun { run_id } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::CancelWorkflowRun {
run_id,
}))
}
Request::ReconcileOrphanedWorkflowRuns { apply, limit } => Self::RuntimeAndModel(
Box::new(RuntimeAndModelRequest::ReconcileOrphanedWorkflowRuns { apply, limit }),
),
Request::PauseWorkflowRun { run_id } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::PauseWorkflowRun {
run_id,
}))
}
Request::ResumeWorkflowRun { run_id } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::ResumeWorkflowRun {
run_id,
}))
}
Request::ListWorkflowWaits { run_id, limit } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::ListWorkflowWaits {
run_id,
limit,
}))
}
Request::ProvideWorkflowInput {
run_id,
node_id,
activation_id,
value,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::ProvideWorkflowInput {
run_id,
node_id,
activation_id,
value,
})),
Request::ResolveWorkflowApproval {
run_id,
node_id,
activation_id,
approved,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::ResolveWorkflowApproval {
run_id,
node_id,
activation_id,
approved,
})),
Request::ListWorkflowMutationApprovalsAll { limit } => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::ListWorkflowMutationApprovalsAll { limit },
)),
Request::ListWorkflowMutationApprovals { run_id, limit } => Self::RuntimeAndModel(
Box::new(RuntimeAndModelRequest::ListWorkflowMutationApprovals { run_id, limit }),
),
Request::ResolveWorkflowMutationApproval {
approval_id,
decision,
} => Self::RuntimeAndModel(Box::new(
RuntimeAndModelRequest::ResolveWorkflowMutationApproval {
approval_id,
decision,
},
)),
Request::WorkflowAttemptHistory {
run_id,
cursor,
limit,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowAttemptHistory {
run_id,
cursor,
limit,
})),
Request::WorkflowCommittedHistory { query } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowCommittedHistory {
query,
}))
}
Request::WorkflowLifecycleHistory { query } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowLifecycleHistory {
query,
}))
}
Request::WorkflowInventory { query } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowInventory {
query,
}))
}
Request::WorkflowSemanticHistory { query } => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowSemanticHistory {
query,
}))
}
Request::WorkflowObservations {
run_id,
after_sequence,
through_sequence,
limit,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowObservations {
run_id,
after_sequence,
through_sequence,
limit,
})),
Request::WorkflowEventHistory {
run_id,
after_sequence,
limit,
} => Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowEventHistory {
run_id,
after_sequence,
limit,
})),
Request::WorkflowLiveEventCatchUp {
after_sequence,
limit,
} => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::WorkflowLiveEventCatchUp {
after_sequence,
limit,
}))
}
Request::CompactSession { session_id } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::CompactSession { session_id }))
}
Request::SetSessionModel {
session_id,
provider_plugin_id,
model_id,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::SetSessionModel {
session_id,
provider_plugin_id,
model_id,
})),
Request::SetSessionReasoning {
session_id,
effort,
summary,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::SetSessionReasoning {
session_id,
effort,
summary,
})),
Request::SessionModelStatus { session_id } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::SessionModelStatus {
session_id,
}))
}
Request::DefaultModelStatus => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::DefaultModelStatus))
}
Request::CheckModels {
check_id,
session_id,
provider_plugin_id,
model_ids,
timeout_seconds,
allow_provider_requests,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::CheckModels {
check_id,
session_id,
provider_plugin_id,
model_ids,
timeout_seconds,
allow_provider_requests,
})),
Request::CancelModelCheck { check_id } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::CancelModelCheck { check_id }))
}
Request::SessionModelListForSession {
session_id,
provider_plugin_id,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::SessionModelListForSession {
session_id,
provider_plugin_id,
})),
Request::SessionModelList { provider_plugin_id } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::SessionModelList {
provider_plugin_id,
}))
}
Request::JudgementSetup => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::JudgementSetup))
}
Request::JudgementSetupValidate { selection_json } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::JudgementSetupValidate {
selection_json,
}))
}
Request::SelectOptionalContext { request_json } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::SelectOptionalContext {
request_json,
}))
}
Request::TurnJudgementObservation {
session_id,
turn_id,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::TurnJudgementObservation {
session_id,
turn_id,
})),
Request::OptionalJudge { request_json } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::OptionalJudge { request_json }))
}
Request::JudgementVerify { selection_json } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::JudgementVerify {
selection_json,
}))
}
Request::Judge {
provider_plugin_id,
auth_profile,
request_json,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::Judge {
provider_plugin_id,
auth_profile,
request_json,
})),
Request::ListAgents => Self::AgentSkillPlugin(AgentSkillPluginRequest::ListAgents),
Request::ListSkills => Self::AgentSkillPlugin(AgentSkillPluginRequest::ListSkills),
Request::DescribeSkill { skill_id } => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::DescribeSkill { skill_id })
}
Request::ActivateSkill {
session_id,
skill_id,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::ActivateSkill {
session_id,
skill_id,
}),
Request::DeactivateSkill {
session_id,
skill_id,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::DeactivateSkill {
session_id,
skill_id,
}),
Request::ActiveSkills { session_id } => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::ActiveSkills { session_id })
}
Request::AgentPolicyStatus => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::AgentPolicyStatus)
}
Request::SetSessionAgent {
session_id,
agent_id,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::SetSessionAgent {
session_id,
agent_id,
}),
Request::SessionHistoryAround { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionHistoryAround {
session_id,
query,
}))
}
Request::ListPermissions => {
Self::PermissionInteraction(PermissionInteractionRequest::ListPermissions)
}
Request::ResolvePermission {
permission_id,
approved,
remember,
} => Self::PermissionInteraction(PermissionInteractionRequest::ResolvePermission {
permission_id,
approved,
remember,
}),
Request::AddPermissionRule {
agent_id,
category,
pattern,
action,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::AddPermissionRule {
agent_id,
category,
pattern,
action,
}),
Request::ListPluginServices => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::ListPluginServices)
}
Request::ListPluginContributions => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::ListPluginContributions)
}
Request::InvokePluginServiceContextual {
context,
plugin_id,
interface_id,
operation,
payload,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::InvokePluginServiceContextual {
context,
plugin_id,
interface_id,
operation,
payload,
}),
Request::CancelPluginServiceInvocation { invocation_id } => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::CancelPluginServiceInvocation {
invocation_id,
})
}
Request::InvokePluginService {
plugin_id,
interface_id,
operation,
payload,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::InvokePluginService {
plugin_id,
interface_id,
operation,
payload,
}),
Request::CallPluginService {
interface_id,
operation,
payload,
} => Self::AgentSkillPlugin(AgentSkillPluginRequest::CallPluginService {
interface_id,
operation,
payload,
}),
Request::PublishPluginEvent { topic, payload } => {
Self::AgentSkillPlugin(AgentSkillPluginRequest::PublishPluginEvent {
topic,
payload,
})
}
Request::UpdateClientRuntimeContext { runtime_context } => Self::SessionLifecycle(
Box::new(SessionLifecycleRequest::UpdateClientRuntimeContext { runtime_context }),
),
Request::ChangeSessionWorkingDirectory {
session_id,
working_directory,
} => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::ChangeSessionWorkingDirectory {
session_id,
working_directory,
},
)),
Request::ListWorktrees(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ListWorktrees(payload)))
}
Request::WorktreeCreateStart {
operation_id,
request,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::WorktreeCreateStart {
operation_id,
request,
})),
Request::WorktreeCreateStatus { operation_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::WorktreeCreateStatus {
operation_id,
}))
}
Request::WorktreeCreateWait {
operation_id,
after_revision,
timeout_ms,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::WorktreeCreateWait {
operation_id,
after_revision,
timeout_ms,
})),
Request::RemoveWorktree(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::RemoveWorktree(payload)))
}
Request::RalphStatus(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::RalphStatus(payload)))
}
Request::RunRalphLoop(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::RunRalphLoop(payload)))
}
Request::CancelRalphLoop(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::CancelRalphLoop(payload)))
}
Request::ListRalphRuns(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ListRalphRuns(payload)))
}
Request::ListRalphIterations(payload) => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::ListRalphIterations(payload),
)),
Request::ResumeRalphRun(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ResumeRalphRun(payload)))
}
Request::ApproveRalphRun(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ApproveRalphRun(payload)))
}
Request::RalphRunStatus(payload) => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::RalphRunStatus(payload)))
}
Request::RecordRalphLifecycle(payload) => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::RecordRalphLifecycle(payload),
)),
Request::PrepareSessionOpen { session_id } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::PrepareSessionOpen {
session_id,
})
}
Request::WaitSessionOpenProgress {
session_id,
operation_id,
after_revision,
timeout_ms,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::WaitSessionOpenProgress {
session_id,
operation_id,
after_revision,
timeout_ms,
}),
Request::ImportExternalSession {
source_id,
external_session_id,
working_directory,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::ImportExternalSession {
source_id,
external_session_id,
working_directory,
}),
Request::GenerateSessionMilestone { session_id } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::GenerateSessionMilestone { session_id },
)),
Request::SessionMilestones { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionMilestones {
session_id,
query,
}))
}
Request::SessionDerivationSnapshot { session_id } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::SessionDerivationSnapshot { session_id },
)),
Request::SessionDerivationPrompts { session_id, query } => Self::SessionLifecycle(
Box::new(SessionLifecycleRequest::SessionDerivationPrompts { session_id, query }),
),
Request::DeriveSession { request } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::DeriveSession { request }))
}
Request::SessionDerivationStatus { operation_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionDerivationStatus {
operation_id,
}))
}
Request::CancelSessionDerivation { operation_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::CancelSessionDerivation {
operation_id,
}))
}
Request::RefreshSessionCatalog {
working_directory,
sources,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::RefreshSessionCatalog {
working_directory,
sources,
}),
Request::RuntimeWorkObservations {
session_id,
after,
limit,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::RuntimeWorkObservations {
session_id,
after,
limit,
})),
Request::ListRuntimeWork { session_id } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::ListRuntimeWork { session_id }))
}
Request::RuntimeWorkHistory { session_id, limit } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::RuntimeWorkHistory {
session_id,
limit,
}))
}
Request::SubscribeRuntimeWork { session_id } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::SubscribeRuntimeWork {
session_id,
}))
}
Request::SubscribeWorkflowRuns => {
Self::RuntimeAndModel(Box::new(RuntimeAndModelRequest::SubscribeWorkflowRuns))
}
Request::SubscribeCatalogUpdates => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SubscribeCatalogUpdates))
}
Request::AttachSessionProjectionWindow {
session_id,
request,
} => Self::SessionSearchAttach(
SessionSearchAttachRequest::AttachSessionProjectionWindow {
session_id,
request,
},
),
Request::SetComposerDraft { scope, text } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SetComposerDraft {
scope,
text,
}))
}
Request::ComposerDraft { scope } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ComposerDraft { scope }))
}
Request::ListPendingToolExchanges => {
Self::PermissionInteraction(PermissionInteractionRequest::ListPendingToolExchanges)
}
Request::ResolveToolExchange {
exchange_id,
resolution_json,
} => Self::PermissionInteraction(PermissionInteractionRequest::ResolveToolExchange {
exchange_id,
resolution_json,
}),
Request::ModelCatalogDiagnostics => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ModelCatalogDiagnostics))
}
Request::PrepareContextGeneration { request } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::PrepareContextGeneration(request),
)),
Request::SessionWorkingDocument { request } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::SessionWorkingDocument(request),
)),
Request::ReadSessionTraceBlob { request } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::ReadSessionTraceBlob(request),
)),
Request::ReadSessionArtifact {
session_id,
artifact_id,
reference_key,
offset,
length,
} => Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ReadSessionArtifact {
session_id,
artifact_id,
reference_key,
offset,
length,
})),
Request::InvocationInput { session_id, input } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::InvocationInput {
session_id,
input,
}))
}
Request::ResolvePermissionBatch { batch_id, approved } => {
Self::PermissionInteraction(PermissionInteractionRequest::ResolvePermissionBatch {
batch_id,
approved,
})
}
Request::IngestClientMetrics { batch } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::IngestClientMetrics {
batch,
}))
}
Request::AuthPoolList => Self::CoreRuntime(Box::new(CoreRuntimeRequest::AuthPoolList)),
Request::SetAuthPoolPreference { pool, profile } => {
Self::CoreRuntime(Box::new(CoreRuntimeRequest::SetAuthPoolPreference {
pool,
profile,
}))
}
Request::ReleaseSessionOwnership { session_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::ReleaseSessionOwnership {
session_id,
}))
}
Request::SessionCategorization { session_id } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionCategorization {
session_id,
}))
}
Request::SessionInspection { session_id, query } => {
Self::SessionLifecycle(Box::new(SessionLifecycleRequest::SessionInspection {
session_id,
query,
}))
}
Request::SessionSearch {
request,
policy,
routes,
hydrate,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearch {
request,
policy,
routes,
hydrate,
}),
Request::SessionSearchProviders => {
Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchProviders)
}
Request::SessionSearchExplain {
request,
policy,
routes,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchExplain {
request,
policy,
routes,
}),
Request::SessionSearchPurge {
provider_id,
confirmation,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchPurge {
provider_id,
confirmation,
}),
Request::SessionSearchRebuild {
provider_id,
confirmation,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchRebuild {
provider_id,
confirmation,
}),
Request::SessionSearchCompleteBackfillStart { request } => Self::SessionSearchAttach(
SessionSearchAttachRequest::SessionSearchCompleteBackfillStart { request },
),
Request::SessionSearchBackfillStart { request } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchBackfillStart {
request,
})
}
Request::SessionSearchBackfillStatus { operation_id } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchBackfillStatus {
operation_id,
})
}
Request::SessionSearchBackfillWait {
operation_id,
after_revision,
timeout_ms,
} => Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchBackfillWait {
operation_id,
after_revision,
timeout_ms,
}),
Request::SessionSearchBackfillCancel { operation_id } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchBackfillCancel {
operation_id,
})
}
Request::SessionSearchBackfill { request } => {
Self::SessionSearchAttach(SessionSearchAttachRequest::SessionSearchBackfill {
request,
})
}
Request::SessionCompatibilityInventory { request } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::SessionCompatibilityInventory { request },
)),
Request::SessionBulkMigrationStart { request } => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::SessionBulkMigrationStart { request },
)),
Request::SessionBulkMigrationStatus { operation_id } => Self::SessionLifecycle(
Box::new(SessionLifecycleRequest::SessionBulkMigrationStatus { operation_id }),
),
Request::SessionBulkMigrationWait {
operation_id,
after_revision,
timeout_ms,
} => Self::SessionLifecycle(Box::new(
SessionLifecycleRequest::SessionBulkMigrationWait {
operation_id,
after_revision,
timeout_ms,
},
)),
Request::SessionBulkMigrationCancel { operation_id } => Self::SessionLifecycle(
Box::new(SessionLifecycleRequest::SessionBulkMigrationCancel { operation_id }),
),
Request::AppendPresentationNote {
session_id,
source_id,
note_id,
text,
format,
} => Self::CoreRuntime(Box::new(CoreRuntimeRequest::AppendPresentationNote {
session_id,
source_id,
note_id,
text,
format,
})),
}
}
}