/** * Canonical Runtime Protocol for PD Runtime v2. * * Source: PD Runtime Protocol SPEC v1, Sections 5-10, 10A * Source: PD Runtime-Agnostic Architecture v2, Sections 8-9 * * This is the core decoupling layer between PD logic and external runtimes. * All adapters must implement PDRuntimeAdapter. */ import { type Static } from '@sinclair/typebox'; export declare const RuntimeKindSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"openclaw">, import("@sinclair/typebox").TLiteral<"openclaw-cli">, import("@sinclair/typebox").TLiteral<"openclaw-history">, import("@sinclair/typebox").TLiteral<"claude-cli">, import("@sinclair/typebox").TLiteral<"codex-cli">, import("@sinclair/typebox").TLiteral<"gemini-cli">, import("@sinclair/typebox").TLiteral<"local-worker">, import("@sinclair/typebox").TLiteral<"test-double">, import("@sinclair/typebox").TLiteral<"pi-ai">, import("@sinclair/typebox").TLiteral<"pi-ai-l2">]>; export type RuntimeKind = Static; export declare const RuntimeCapabilitiesSchema: import("@sinclair/typebox").TObject<{ supportsStructuredJsonOutput: import("@sinclair/typebox").TBoolean; supportsToolUse: import("@sinclair/typebox").TBoolean; supportsWorkingDirectory: import("@sinclair/typebox").TBoolean; supportsModelSelection: import("@sinclair/typebox").TBoolean; supportsLongRunningSessions: import("@sinclair/typebox").TBoolean; supportsCancellation: import("@sinclair/typebox").TBoolean; supportsArtifactWriteBack: import("@sinclair/typebox").TBoolean; supportsConcurrentRuns: import("@sinclair/typebox").TBoolean; supportsStreaming: import("@sinclair/typebox").TBoolean; /** ISO timestamp when these capabilities were last probed. */ capabilitiesValidUntil: import("@sinclair/typebox").TOptional; /** Dynamic capabilities that may vary per session or invocation. */ dynamicCapabilities: import("@sinclair/typebox").TOptional>; modelOptions: import("@sinclair/typebox").TOptional>; }>>; }>; export type RuntimeCapabilities = Static; export declare const RuntimeHealthSchema: import("@sinclair/typebox").TObject<{ /** Runtime is fully operational. */ healthy: import("@sinclair/typebox").TBoolean; /** Runtime is usable but degraded; prefer alternatives. */ degraded: import("@sinclair/typebox").TBoolean; /** Human-readable warning messages. */ warnings: import("@sinclair/typebox").TArray; /** ISO timestamp of last health check. */ lastCheckedAt: import("@sinclair/typebox").TString; }>; export type RuntimeHealth = Static; export declare const RunHandleSchema: import("@sinclair/typebox").TObject<{ runId: import("@sinclair/typebox").TString; runtimeKind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"openclaw">, import("@sinclair/typebox").TLiteral<"openclaw-cli">, import("@sinclair/typebox").TLiteral<"openclaw-history">, import("@sinclair/typebox").TLiteral<"claude-cli">, import("@sinclair/typebox").TLiteral<"codex-cli">, import("@sinclair/typebox").TLiteral<"gemini-cli">, import("@sinclair/typebox").TLiteral<"local-worker">, import("@sinclair/typebox").TLiteral<"test-double">, import("@sinclair/typebox").TLiteral<"pi-ai">, import("@sinclair/typebox").TLiteral<"pi-ai-l2">]>; startedAt: import("@sinclair/typebox").TString; }>; export type RunHandle = Static; export declare const RunExecutionStatusSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"queued">, import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"succeeded">, import("@sinclair/typebox").TLiteral<"failed">, import("@sinclair/typebox").TLiteral<"timed_out">, import("@sinclair/typebox").TLiteral<"cancelled">]>; export type RunExecutionStatus = Static; export declare const RunStatusSchema: import("@sinclair/typebox").TObject<{ runId: import("@sinclair/typebox").TString; status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"queued">, import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"succeeded">, import("@sinclair/typebox").TLiteral<"failed">, import("@sinclair/typebox").TLiteral<"timed_out">, import("@sinclair/typebox").TLiteral<"cancelled">]>; startedAt: import("@sinclair/typebox").TOptional; endedAt: import("@sinclair/typebox").TOptional; reason: import("@sinclair/typebox").TOptional; }>; export type RunStatus = Static; /** * Full run record used by SqliteRunStore. * Extends RunHandle with task linkage, attempt tracking, and payload fields. */ export declare const RunRecordSchema: import("@sinclair/typebox").TObject<{ runId: import("@sinclair/typebox").TString; runtimeKind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"openclaw">, import("@sinclair/typebox").TLiteral<"openclaw-cli">, import("@sinclair/typebox").TLiteral<"openclaw-history">, import("@sinclair/typebox").TLiteral<"claude-cli">, import("@sinclair/typebox").TLiteral<"codex-cli">, import("@sinclair/typebox").TLiteral<"gemini-cli">, import("@sinclair/typebox").TLiteral<"local-worker">, import("@sinclair/typebox").TLiteral<"test-double">, import("@sinclair/typebox").TLiteral<"pi-ai">, import("@sinclair/typebox").TLiteral<"pi-ai-l2">]>; startedAt: import("@sinclair/typebox").TString; taskId: import("@sinclair/typebox").TString; attemptNumber: import("@sinclair/typebox").TInteger; executionStatus: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"queued">, import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"succeeded">, import("@sinclair/typebox").TLiteral<"failed">, import("@sinclair/typebox").TLiteral<"timed_out">, import("@sinclair/typebox").TLiteral<"cancelled">]>; endedAt: import("@sinclair/typebox").TOptional; reason: import("@sinclair/typebox").TOptional; outputRef: import("@sinclair/typebox").TOptional; createdAt: import("@sinclair/typebox").TString; updatedAt: import("@sinclair/typebox").TString; inputPayload: import("@sinclair/typebox").TOptional; outputPayload: import("@sinclair/typebox").TOptional; errorCategory: import("@sinclair/typebox").TOptional, import("@sinclair/typebox").TLiteral<"capability_missing">, import("@sinclair/typebox").TLiteral<"input_invalid">, import("@sinclair/typebox").TLiteral<"lease_conflict">, import("@sinclair/typebox").TLiteral<"lease_expired">, import("@sinclair/typebox").TLiteral<"execution_failed">, import("@sinclair/typebox").TLiteral<"rate_limit">, import("@sinclair/typebox").TLiteral<"timeout">, import("@sinclair/typebox").TLiteral<"cancelled">, import("@sinclair/typebox").TLiteral<"output_invalid">, import("@sinclair/typebox").TLiteral<"artifact_commit_failed">, import("@sinclair/typebox").TLiteral<"max_attempts_exceeded">, import("@sinclair/typebox").TLiteral<"context_assembly_failed">, import("@sinclair/typebox").TLiteral<"history_not_found">, import("@sinclair/typebox").TLiteral<"trajectory_ambiguous">, import("@sinclair/typebox").TLiteral<"storage_unavailable">, import("@sinclair/typebox").TLiteral<"workspace_invalid">, import("@sinclair/typebox").TLiteral<"workspace_dirty">, import("@sinclair/typebox").TLiteral<"query_invalid">]>>; }>; export type RunRecord = Static; export declare const ContextItemSchema: import("@sinclair/typebox").TObject<{ role: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"system">, import("@sinclair/typebox").TLiteral<"tool">]>; content: import("@sinclair/typebox").TString; }>; export type ContextItem = Static; export declare const AgentSpecRefSchema: import("@sinclair/typebox").TObject<{ agentId: import("@sinclair/typebox").TString; schemaVersion: import("@sinclair/typebox").TString; }>; export type AgentSpecRef = Static; export declare const WorkflowRefSchema: import("@sinclair/typebox").TObject<{ workflowId: import("@sinclair/typebox").TString; }>; export type WorkflowRef = Static; export declare const TaskRefSchema: import("@sinclair/typebox").TObject<{ taskId: import("@sinclair/typebox").TString; }>; export type TaskRef = Static; export declare const StartRunInputSchema: import("@sinclair/typebox").TObject<{ agentSpec: import("@sinclair/typebox").TObject<{ agentId: import("@sinclair/typebox").TString; schemaVersion: import("@sinclair/typebox").TString; }>; workflowRef: import("@sinclair/typebox").TOptional>; taskRef: import("@sinclair/typebox").TOptional>; inputPayload: import("@sinclair/typebox").TUnknown; contextItems: import("@sinclair/typebox").TArray, import("@sinclair/typebox").TLiteral<"system">, import("@sinclair/typebox").TLiteral<"tool">]>; content: import("@sinclair/typebox").TString; }>>; outputSchemaRef: import("@sinclair/typebox").TOptional; artifactContractRef: import("@sinclair/typebox").TOptional; timeoutMs: import("@sinclair/typebox").TNumber; idempotencyKey: import("@sinclair/typebox").TOptional; preferredModel: import("@sinclair/typebox").TOptional; preferredRuntimeProfile: import("@sinclair/typebox").TOptional; /** * PRI-633: base-layer system prompt (agent role + protocol instructions) * produced by the run's prompt builder. Adapters own the placement: pi-ai * paths send it as Context/agentContext.systemPrompt (with the profile's * configured systemPrompt appended after it); the OpenClaw CLI adapter folds * it back into the message file so the host's own system prompt is never * touched (DPB-07). Optional — absent means the run carries no base layer. */ systemPrompt: import("@sinclair/typebox").TOptional; }>; export type StartRunInput = Static; export declare const StructuredRunOutputSchema: import("@sinclair/typebox").TObject<{ runId: import("@sinclair/typebox").TString; payload: import("@sinclair/typebox").TUnknown; }>; export type StructuredRunOutput = Static; export declare const RuntimeArtifactRefSchema: import("@sinclair/typebox").TObject<{ artifactType: import("@sinclair/typebox").TString; ref: import("@sinclair/typebox").TString; }>; export type RuntimeArtifactRef = Static; /** * The canonical runtime adapter interface. * * Every supported runtime (OpenClaw, Codex CLI, Gemini CLI, etc.) * must implement this interface. * * Adapters MUST NOT: * - commit PD artifacts directly into PD stores * - mutate task status directly * - leak host-specific state into PD core */ export interface PDRuntimeAdapter { /** Identify which runtime this adapter wraps. */ kind(): RuntimeKind; /** Probe the runtime's current capabilities. */ getCapabilities(): Promise; /** Re-probe capabilities (optional, for runtimes with dynamic capabilities). */ refreshCapabilities?(): Promise; /** Check runtime health. */ healthCheck(): Promise; /** Start a new run. */ startRun(input: StartRunInput): Promise; /** Poll the status of an existing run. */ pollRun(runId: string): Promise; /** Cancel a running execution. */ cancelRun(runId: string): Promise; /** Fetch structured output from a completed run. */ fetchOutput(runId: string): Promise; /** Fetch artifact references produced by a run. */ fetchArtifacts(runId: string): Promise; /** Append additional context to an in-progress run (optional). */ appendContext?(runId: string, items: ContextItem[]): Promise; } //# sourceMappingURL=runtime-protocol.d.ts.map