import type { AdaptivePlanner } from '@pellux/goodvibes-sdk/platform/core/adaptive-planner';
import type { SubagentTask } from '@pellux/goodvibes-sdk/platform/acp/protocol';
import type { RuntimeEventBus } from './events/index.js';
import type { RuntimeStore } from './store/index.js';
import type { AgentInput } from '@pellux/goodvibes-sdk/platform/tools/agent/schema';
import type { AgentRecord } from '../tools/agent/manager.js';
import type { AcpConnection } from '@pellux/goodvibes-sdk/platform/runtime/store/domains/acp';
import type { UiRemoteSnapshot } from './ui-read-models.js';
import type { RemoteRunnerRegistry } from './remote/index.js';
import type { RemoteExecutionArtifact, RemoteRunnerContract, RemoteRunnerPool, RemoteSessionBundle } from '@pellux/goodvibes-sdk/platform/runtime/remote/types';
import type { AutomationJob, AutomationRun, CreateAutomationJobInput, AutomationManager } from '../automation/index.js';
import type { CancellationRequest, CancellationResult, CrossSessionTaskRef, SessionTaskGraphSnapshot, TaskHandoffRecord } from '@pellux/goodvibes-sdk/platform/sessions/orchestration/index';
import type { ExecutionPlan, PlanItem } from '@pellux/goodvibes-sdk/platform/core/execution-plan';
import type { DomainVerbosity } from '@pellux/goodvibes-sdk/platform/runtime/notifications/types';
import type { HITLMode, HITLModeDefinition } from '@pellux/goodvibes-sdk/platform/state/mode-manager';
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<string>;
    cancel(agentId: string): Promise<void>;
}
export interface ShellAutomationManagerService {
    start(): Promise<void>;
    listJobs(): AutomationJob[];
    createJob(input: CreateAutomationJobInput): Promise<AutomationJob>;
    removeJob(id: string): Promise<boolean>;
    setEnabled(id: string, enabled: boolean): Promise<AutomationJob | null>;
    runNow(id: string): Promise<AutomationRun>;
}
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<string, DomainVerbosity>;
}
export interface ShellPlanManagerService {
    getActive(sessionId?: string): ExecutionPlan | null;
    getSummary(plan: ExecutionPlan): string;
    list(): ExecutionPlan[];
    toMarkdown(plan: ExecutionPlan): string;
    create(title: string, items: Omit<PlanItem, 'id' | 'status'>[], sessionId?: string): ExecutionPlan;
    save(plan: ExecutionPlan): void;
}
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<RemoteExecutionArtifact>;
    exportSessionBundle(path: string): Promise<{
        bundle: RemoteSessionBundle;
        path: string;
    }>;
    importSessionBundle(path: string): Promise<RemoteSessionBundle>;
}
export type PlanRuntimeService = (subcommand: string, args: string[]) => {
    readonly output: string;
    readonly ok: boolean;
};
export interface CommandOpsShellServices {
    agentManager?: ShellAgentManagerService;
    acpManager?: ShellAcpManagerService;
    automationManager?: ShellAutomationManagerRuntimeService;
    modeManager?: ShellModeManagerService;
    planManager?: ShellPlanManagerService;
    adaptivePlanner?: unknown;
    sessionOrchestration?: ShellSessionOrchestrationService;
    remoteRuntime?: RemoteCommandService;
    planRuntime?: PlanRuntimeService;
}
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;
    readonly runtimeStore: RuntimeStore;
}): RemoteCommandService | undefined;
export declare function createShellPlanRuntime(options: {
    readonly adaptivePlanner?: AdaptivePlanner;
    readonly runtimeBus?: RuntimeEventBus;
}): PlanRuntimeService | undefined;
//# sourceMappingURL=shell-command-ops.d.ts.map