import type { AdaptivePlanner } from '../core/adaptive-planner.js'; import type { SubagentTask } from '../acp/protocol.js'; import type { RuntimeEventBus } from './events/index.js'; import type { RuntimeStore } from './store/index.js'; import type { FeatureFlagManager } from './feature-flags/index.js'; import type { AgentInput } from '../tools/agent/schema.js'; import type { AgentRecord } from '../tools/agent/manager.js'; import type { AcpConnection } from './store/domains/acp.js'; import type { UiRemoteSnapshot } from './ui-read-models.js'; import type { RemoteRunnerRegistry } from './remote/index.js'; import type { RemoteExecutionArtifact, RemoteRunnerContract, RemoteRunnerPool, RemoteSessionBundle } from './remote/types.js'; import type { AutomationJob, AutomationRun, CreateAutomationJobInput, AutomationManager } from '../automation/index.js'; import type { CancellationRequest, CancellationResult, CrossSessionTaskRef, SessionTaskGraphSnapshot, TaskHandoffRecord } from '../sessions/orchestration/index.js'; import type { DismissPlanResult, ExecutionPlan, PlanItem } from '../core/execution-plan.js'; import type { DomainVerbosity } from './notifications/types.js'; import type { HITLMode, HITLModeDefinition } from '../state/mode-manager.js'; export interface ShellAgentManagerService { spawn(input: AgentInput): AgentRecord; cancel(agentId: string): boolean; cancelGraph(graphId: string): string[]; cancelSubtree(rootAgentId: string): string[]; clear(): void; exportState(): AgentRecord[]; importState(records: AgentRecord[]): void; } export interface ShellAcpManagerService { spawn(task: SubagentTask): Promise; cancel(agentId: string): Promise; } export interface ShellAutomationManagerService { start(): Promise; listJobs(): AutomationJob[]; createJob(input: CreateAutomationJobInput): Promise; removeJob(id: string): Promise; setEnabled(id: string, enabled: boolean): Promise; runNow(id: string): Promise; } export type ShellAutomationManagerRuntimeService = ShellAutomationManagerService & AutomationManager; export interface ShellModeManagerService { getHITLMode(): HITLMode; getHITLPreset(): HITLModeDefinition; listHITLPresets(): HITLModeDefinition[]; setHITLMode(mode: HITLMode): void; setDomainVerbosity(domain: string, verbosity: DomainVerbosity): void; getDomainOverrides(): Record; } export interface ShellPlanManagerService { getActive(sessionId?: string): ExecutionPlan | null; getSummary(plan: ExecutionPlan): string; list(): ExecutionPlan[]; toMarkdown(plan: ExecutionPlan): string; create(title: string, items: Omit[], sessionId?: string): ExecutionPlan; save(plan: ExecutionPlan): void; /** Archive the active plan. See ExecutionPlanManager.dismiss. */ dismiss(sessionId?: string): DismissPlanResult; } export interface ShellSessionOrchestrationService { linkTask(ref: CrossSessionTaskRef, dependsOn?: { sessionId: string; taskId: string; }): { ok: boolean; error?: string; }; initiateHandoff(taskRef: { sessionId: string; taskId: string; }, fromSessionId: string, toSessionId: string, reason?: string): { ok: boolean; error?: string; handoffId?: string; }; snapshot(): SessionTaskGraphSnapshot; getDependencies(sessionId: string, taskId: string): CrossSessionTaskRef[]; getDependents(sessionId: string, taskId: string): CrossSessionTaskRef[]; getHandoffs(): TaskHandoffRecord[]; cancel(request: CancellationRequest): CancellationResult; } export interface RemoteCommandService { listActiveConnections(): readonly AcpConnection[]; getSnapshot(): UiRemoteSnapshot; listPools(): readonly RemoteRunnerPool[]; getPool(id: string): RemoteRunnerPool | null; createPool(input: { id: string; label: string; }): RemoteRunnerPool; assignRunnerToPool(poolId: string, runnerId: string): RemoteRunnerPool | null; removeRunnerFromPool(poolId: string, runnerId: string): RemoteRunnerPool | null; listContracts(): readonly RemoteRunnerContract[]; getContract(runnerId: string): RemoteRunnerContract | null; registerContract(contract: RemoteRunnerContract): RemoteRunnerContract; upsertContractForAgent(runnerId: string): RemoteRunnerContract | null; listArtifacts(): readonly RemoteExecutionArtifact[]; getArtifact(artifactId: string): RemoteExecutionArtifact | null; buildReviewSummary(artifactId: string): string | null; exportArtifact(artifactId: string, path?: string): Promise<{ artifact: RemoteExecutionArtifact; path: string; } | null>; exportArtifactForAgent(agentId: string, path?: string): Promise<{ artifact: RemoteExecutionArtifact; path: string; } | null>; importArtifact(path: string): Promise; exportSessionBundle(path: string): Promise<{ bundle: RemoteSessionBundle; path: string; }>; importSessionBundle(path: string): Promise; } export type PlanRuntimeService = (subcommand: string, args: string[]) => { readonly output: string; readonly ok: boolean; }; export interface CommandOpsShellServices { agentManager?: ShellAgentManagerService | undefined; acpManager?: ShellAcpManagerService | undefined; automationManager?: ShellAutomationManagerRuntimeService | undefined; modeManager?: ShellModeManagerService | undefined; planManager?: ShellPlanManagerService | undefined; adaptivePlanner?: unknown | undefined; sessionOrchestration?: ShellSessionOrchestrationService | undefined; remoteRuntime?: RemoteCommandService | undefined; planRuntime?: PlanRuntimeService | undefined; } export interface CreateShellOpsServicesOptions extends CommandOpsShellServices { } export declare function createShellOpsServices(options: CreateShellOpsServicesOptions): CommandOpsShellServices; export declare function createShellRemoteCommandService(options: { readonly readModels: import('./ui-read-models.js').UiReadModels; readonly remoteRunnerRegistry?: RemoteRunnerRegistry | undefined; readonly runtimeStore: RuntimeStore; }): RemoteCommandService | undefined; export declare function createShellPlanRuntime(options: { readonly adaptivePlanner?: AdaptivePlanner | undefined; readonly runtimeBus?: RuntimeEventBus | undefined; readonly featureFlags?: Pick | null | undefined; }): PlanRuntimeService | undefined; //# sourceMappingURL=shell-command-ops.d.ts.map