export declare const executorPackage = "@runx/executor"; import type { ArtifactEnvelope } from "../../artifacts/src/index.js"; import type { ValidatedSkill } from "../../parser/src/index.js"; export declare const CONTROL_SCHEMA_REFS: { readonly output_contract: "https://runx.ai/spec/output-contract.schema.json"; readonly agent_context_envelope: "https://runx.ai/spec/agent-context-envelope.schema.json"; readonly agent_work_request: "https://runx.ai/spec/agent-work-request.schema.json"; readonly question: "https://runx.ai/spec/question.schema.json"; readonly approval_gate: "https://runx.ai/spec/approval-gate.schema.json"; readonly resolution_request: "https://runx.ai/spec/resolution-request.schema.json"; readonly resolution_response: "https://runx.ai/spec/resolution-response.schema.json"; readonly adapter_invoke_result: "https://runx.ai/spec/adapter-invoke-result.schema.json"; readonly credential_envelope: "https://runx.ai/spec/credential-envelope.schema.json"; }; export type OutputContractEntry = "string" | "number" | "integer" | "boolean" | "array" | "object" | "null" | Readonly>; export type OutputContract = Readonly>; export interface AgentContextProvenance { readonly input: string; readonly output: string; readonly from_step?: string; readonly artifact_id?: string; readonly receipt_id?: string; } export interface AgentContextEnvelope { readonly run_id: string; readonly step_id?: string; readonly skill: string; readonly instructions: string; readonly inputs: Readonly>; readonly allowed_tools: readonly string[]; readonly current_context: readonly ArtifactEnvelope[]; readonly historical_context: readonly ArtifactEnvelope[]; readonly provenance: readonly AgentContextProvenance[]; readonly expected_outputs?: OutputContract; readonly trust_boundary: string; } export interface AgentWorkRequest { readonly id: string; readonly source_type: "agent" | "agent-step"; readonly agent?: string; readonly task?: string; readonly envelope: AgentContextEnvelope; } export interface Question { readonly id: string; readonly prompt: string; readonly description?: string; readonly required: boolean; readonly type: string; } export interface ApprovalGate { readonly id: string; readonly reason: string; readonly type?: string; readonly summary?: Readonly>; } export interface InputResolutionRequest { readonly id: string; readonly kind: "input"; readonly questions: readonly Question[]; } export interface ApprovalResolutionRequest { readonly id: string; readonly kind: "approval"; readonly gate: ApprovalGate; } export interface CognitiveResolutionRequest { readonly id: string; readonly kind: "cognitive_work"; readonly work: AgentWorkRequest; } export type ResolutionRequest = InputResolutionRequest | ApprovalResolutionRequest | CognitiveResolutionRequest; export interface ResolutionResponse { readonly actor: "human" | "agent"; readonly payload: unknown; } export interface AdapterInvokeRequest { readonly skillName?: string; readonly skillBody?: string; readonly allowedTools?: readonly string[]; readonly source: ValidatedSkill["source"]; readonly inputs: Readonly>; readonly resolvedInputs?: Readonly>; readonly skillDirectory: string; readonly env?: NodeJS.ProcessEnv; readonly credential?: CredentialEnvelope; readonly signal?: AbortSignal; readonly runId?: string; readonly stepId?: string; readonly currentContext?: readonly ArtifactEnvelope[]; readonly historicalContext?: readonly ArtifactEnvelope[]; readonly contextProvenance?: readonly AgentContextProvenance[]; } export type AdapterInvokeResult = { readonly status: "success" | "failure"; readonly stdout: string; readonly stderr: string; readonly exitCode: number | null; readonly signal: NodeJS.Signals | null; readonly durationMs: number; readonly errorMessage?: string; readonly metadata?: Readonly>; } | { readonly status: "needs_resolution"; readonly stdout: string; readonly stderr: string; readonly exitCode: null; readonly signal: null; readonly durationMs: number; readonly request: ResolutionRequest; readonly errorMessage?: string; readonly metadata?: Readonly>; }; export interface SkillAdapter { readonly type: string; readonly invoke: (request: AdapterInvokeRequest) => Promise; } export interface CredentialEnvelope { readonly kind: "runx.credential-envelope.v1"; readonly grant_id: string; readonly provider: string; readonly connection_id: string; readonly scopes: readonly string[]; readonly material_ref: string; } export interface ExecuteSkillOptions { readonly skill: ValidatedSkill; readonly inputs: Readonly>; readonly resolvedInputs?: Readonly>; readonly skillDirectory: string; readonly adapters: readonly SkillAdapter[]; readonly env?: NodeJS.ProcessEnv; readonly credential?: CredentialEnvelope; readonly signal?: AbortSignal; readonly allowedTools?: readonly string[]; readonly runId?: string; readonly stepId?: string; readonly currentContext?: readonly ArtifactEnvelope[]; readonly historicalContext?: readonly ArtifactEnvelope[]; readonly contextProvenance?: readonly AgentContextProvenance[]; } export declare function executeSkill(options: ExecuteSkillOptions): Promise; export declare function validateOutputContract(value: unknown, label?: string): OutputContract | undefined; export declare function validateAgentContextEnvelope(value: unknown, label?: string): AgentContextEnvelope; export declare function validateAgentWorkRequest(value: unknown, label?: string): AgentWorkRequest; export declare function validateQuestion(value: unknown, label?: string): Question; export declare function validateApprovalGate(value: unknown, label?: string): ApprovalGate; export declare function validateResolutionRequest(value: unknown, label?: string): ResolutionRequest; export declare function validateResolutionResponse(value: unknown, request?: ResolutionRequest, label?: string): ResolutionResponse; export declare function validateAdapterInvokeResult(value: unknown, label?: string): AdapterInvokeResult; export declare function validateCredentialEnvelope(value: unknown, label?: string): CredentialEnvelope;