/** * Remote Mission Executor (2.14.0). * * A `MissionExecutor` whose child executes on a remote target while the * Bucephalus control plane keeps the durable authority. It is structurally the * same contract as `ProcessMissionExecutor` (launch → handle → awaitResult → * MissionResult), but the harness is a remote transport instead of local * `child_process.spawn`. * * Invariants: * - A raw remote exit 0 without verification is PARTIAL, never SUCCEEDED. * - Duplicate launch of one execution identity is rejected (idempotency). * - Transport close without a terminal frame is never success. * - Remote result is an observation; the durable coordinator accepts/rejects * the terminal commit under the existing execution fence. */ import type { MissionExecutor, MissionLaunchOptions } from "../mission-domain/mission-executor.js"; import { type MissionHandle } from "../mission-domain/mission-handle.js"; import type { MissionRequest } from "../mission-domain/mission-request.js"; import { type MissionResult } from "../mission-domain/mission-result.js"; import type { ProcessMissionVerifier } from "../mission-domain/process-mission-executor.js"; import type { RemoteExecutionTarget } from "./remote-target-types.js"; import type { RemoteChildLaunch, RemoteCommandRunner, RemoteExecutionTransport, RemoteTransportEvent } from "./remote-transport.js"; export interface RemoteMissionExecutorOptions { executorId?: string; target: RemoteExecutionTarget; transport: RemoteExecutionTransport & RemoteCommandRunner; /** * Concrete remote child launch for this mission's resume. The closure is * built by the caller (worker/resume path) and captures the resume prompt + * child session id, exactly like `ProcessMissionExecutor.buildLaunch`. The * resolved remote dirs are supplied so the launch can point `--session-dir` * and the working directory at the execution-scoped workspace. */ buildRemoteLaunch: (input: { request: MissionRequest; workspaceDir: string; agentDir: string; sessionDir: string; }) => RemoteChildLaunch; /** Initial workspace files to materialise on the target (remote-relative). */ workspaceFiles?: (request: MissionRequest) => { path: string; content: string; }[]; /** Materialised remote models.json content (ephemeral protected config). */ modelsJson: string; /** Child session identity + file content to materialise on the target. */ childSessionId?: string; sessionFileContent?: string; /** Absolute remote temp root for the execution-scoped workspace. */ remoteTempRoot: string; /** Remote-relative files to hash before/after (location proof). */ evidenceFiles?: string[]; /** Optional verifier override (defaults to remote acceptance-criteria). */ verifier?: ProcessMissionVerifier; /** * Optional shared-inference admission wiring. When set, the remote child * routes its shared-resource inference through the central scheduler via a * reverse tunnel that lives exactly as long as this execution's SSH session. * `tokenIssuer` is called with the concrete executionId so the token is * execution-scoped (never persisted, never placed in argv). */ admission?: { localPort: number; remotePort: number; tokenIssuer: (executionId: string) => { token: string; } | Promise<{ token: string; }>; }; executionIdFactory?: (request: MissionRequest) => string; launchIdFactory?: () => string; timeoutMs?: number; heartbeatMs?: number; now?: () => number; /** Observer for actual remote execution and retry events; excludes polling. */ eventObserver?: (event: RemoteTransportEvent) => void; } export declare class RemoteMissionExecutor implements MissionExecutor { readonly executorId: string; private readonly _target; private readonly _transport; private readonly _buildRemoteLaunch; private readonly _workspaceFiles?; private readonly _modelsJson; private readonly _childSessionId?; private readonly _sessionFileContent?; private readonly _remoteTempRoot; private readonly _evidenceFiles?; private readonly _verifier?; private readonly _admission?; private readonly _executionIdFactory; private readonly _launchIdFactory; private readonly _timeoutMs?; private readonly _heartbeatMs?; private readonly _now; private readonly _eventObserver?; private readonly _active; private readonly _launchedIds; constructor(options: RemoteMissionExecutorOptions); launch(request: MissionRequest, options?: MissionLaunchOptions): Promise; awaitResult(handle: MissionHandle): Promise; cancel(handle: MissionHandle, reason?: string): Promise; private _cancelActive; private _emitEvent; private _diagnostics; private _failureFromTransport; private _classify; } //# sourceMappingURL=remote-mission-executor.d.ts.map