export declare const runnerLocalPackage = "@runx/runner-local"; export * from "./skill-install.js"; import { type AdapterInvokeResult, type ApprovalGate, type CredentialEnvelope, type ResolutionRequest, type ResolutionResponse, type SkillAdapter } from "../../executor/src/index.js"; import { type ChainDefinition, type ValidatedSkill } from "../../parser/src/index.js"; import { type ChainScopeGrant, type LocalAdmissionGrant } from "../../policy/src/index.js"; import { type ExecutionSemantics, type GovernedDisposition, type LocalChainReceipt, type LocalReceipt, type LocalSkillReceipt, type OutcomeState, type ReceiptVerification, type ReceiptInputContext, type ReceiptOutcome, type ReceiptSurfaceRef } from "../../receipts/src/index.js"; import { type SequentialChainState, type SingleStepState } from "../../state-machine/src/index.js"; export interface ApprovalDecision { readonly gate: ApprovalGate; readonly approved: boolean; } export interface ExecutionEvent { readonly type: "skill_loaded" | "inputs_resolved" | "auth_resolved" | "resolution_requested" | "resolution_resolved" | "admitted" | "executing" | "step_started" | "step_waiting_resolution" | "step_completed" | "warning" | "completed"; readonly message: string; readonly data?: unknown; } export interface Caller { readonly resolve: (request: ResolutionRequest) => Promise; readonly report: (event: ExecutionEvent) => void | Promise; } export interface RunLocalSkillOptions { readonly skillPath: string; readonly inputs?: Readonly>; readonly answersPath?: string; readonly caller: Caller; readonly env?: NodeJS.ProcessEnv; readonly receiptDir?: string; readonly runxHome?: string; readonly parentReceipt?: string; readonly contextFrom?: readonly string[]; readonly adapters?: readonly SkillAdapter[]; readonly allowedSourceTypes?: readonly string[]; readonly runner?: string; readonly memoryDir?: string; readonly authResolver?: AuthResolver; readonly receiptMetadata?: Readonly>; readonly resumeFromRunId?: string; readonly executionSemantics?: ExecutionSemantics; } export interface AuthResolver { readonly resolveGrants: (request: AuthGrantRequest) => Promise; readonly resolveCredential: (request: AuthCredentialRequest) => Promise; } export interface AuthGrantRequest { readonly skill: ValidatedSkill; readonly inputs: Readonly>; } export interface AuthGrantResolution { readonly grants: readonly LocalAdmissionGrant[]; } export interface AuthCredentialRequest extends AuthGrantRequest { readonly grants: readonly LocalAdmissionGrant[]; } export interface AuthCredentialResolution { readonly credential?: CredentialEnvelope; readonly receiptMetadata?: Readonly>; } export type RunLocalSkillResult = { readonly status: "needs_resolution"; readonly skill: ValidatedSkill; readonly skillPath: string; readonly inputs: Readonly>; readonly runId: string; readonly requests: readonly ResolutionRequest[]; readonly stepIds?: readonly string[]; readonly stepLabels?: readonly string[]; } | { readonly status: "policy_denied"; readonly skill: ValidatedSkill; readonly reasons: readonly string[]; readonly approval?: ApprovalDecision; readonly receipt?: LocalSkillReceipt; } | { readonly status: "success" | "failure"; readonly skill: ValidatedSkill; readonly inputs: Readonly>; readonly execution: AdapterInvokeResult; readonly state: SingleStepState; readonly receipt: LocalReceipt; }; export interface RunLocalChainOptions { readonly chainPath?: string; readonly chain?: ChainDefinition; readonly chainDirectory?: string; readonly inputs?: Readonly>; readonly caller: Caller; readonly env?: NodeJS.ProcessEnv; readonly receiptDir?: string; readonly runxHome?: string; readonly adapters?: readonly SkillAdapter[]; readonly allowedSourceTypes?: readonly string[]; readonly authResolver?: AuthResolver; readonly chainGrant?: ChainScopeGrant; readonly runId?: string; readonly skillEnvironment?: { readonly name: string; readonly body: string; }; readonly resumeFromRunId?: string; readonly executionSemantics?: ExecutionSemantics; } export interface ChainStepRun { readonly stepId: string; readonly skill: string; readonly skillPath: string; readonly runner?: string; readonly attempt: number; readonly status: "success" | "failure"; readonly receiptId?: string; readonly stdout: string; readonly stderr: string; readonly parentReceipt?: string; readonly fanoutGroup?: string; readonly retry?: RetryReceiptContext; readonly contextFrom: readonly { readonly input: string; readonly fromStep: string; readonly output: string; readonly receiptId?: string; }[]; readonly governance?: ChainStepGovernance; readonly artifactIds?: readonly string[]; readonly disposition?: GovernedDisposition; readonly inputContext?: ReceiptInputContext; readonly outcomeState?: OutcomeState; readonly outcome?: ReceiptOutcome; readonly surfaceRefs?: readonly ReceiptSurfaceRef[]; readonly evidenceRefs?: readonly ReceiptSurfaceRef[]; } interface ChainStepGovernance { readonly scopeAdmission: { readonly status: "allow" | "deny"; readonly requestedScopes: readonly string[]; readonly grantedScopes: readonly string[]; readonly grantId?: string; readonly reasons?: readonly string[]; }; } interface RetryReceiptContext { readonly attempt: number; readonly maxAttempts: number; readonly ruleFired: string; readonly idempotencyKeyHash?: string; } export type RunLocalChainResult = { readonly status: "needs_resolution"; readonly chain: ChainDefinition; readonly skillPath: string; readonly stepIds: readonly string[]; readonly requests: readonly ResolutionRequest[]; readonly skill: ValidatedSkill; readonly state: SequentialChainState; readonly runId: string; readonly stepLabels?: readonly string[]; } | { readonly status: "policy_denied"; readonly chain: ChainDefinition; readonly stepId: string; readonly skill: ValidatedSkill; readonly reasons: readonly string[]; readonly state: SequentialChainState; readonly receipt?: LocalChainReceipt; } | { readonly status: "success" | "failure"; readonly chain: ChainDefinition; readonly state: SequentialChainState; readonly steps: readonly ChainStepRun[]; readonly receipt: LocalChainReceipt; readonly output: string; readonly errorMessage?: string; }; export interface InspectLocalChainOptions { readonly chainId: string; readonly receiptDir?: string; readonly runxHome?: string; readonly env?: NodeJS.ProcessEnv; } export interface InspectLocalReceiptOptions { readonly receiptId: string; readonly receiptDir?: string; readonly runxHome?: string; readonly env?: NodeJS.ProcessEnv; } export interface InspectLocalReceiptResult { readonly receipt: LocalReceipt; readonly verification: ReceiptVerification; readonly summary: LocalReceiptSummary; } export interface ListLocalHistoryOptions { readonly receiptDir?: string; readonly runxHome?: string; readonly env?: NodeJS.ProcessEnv; readonly limit?: number; readonly query?: string; } export interface ListLocalHistoryResult { readonly receipts: readonly LocalReceiptSummary[]; } export interface LocalReceiptSummary { readonly id: string; readonly kind: LocalReceipt["kind"]; readonly status: LocalReceipt["status"]; readonly verification: ReceiptVerification; readonly name: string; readonly sourceType?: string; readonly startedAt?: string; readonly completedAt?: string; } export interface InspectLocalChainResult { readonly receipt: LocalChainReceipt; readonly verification: ReceiptVerification; readonly summary: { readonly id: string; readonly name: string; readonly status: "success" | "failure"; readonly verification: ReceiptVerification; readonly steps: readonly { readonly id: string; readonly attempt: number; readonly status: "success" | "failure"; readonly receiptId?: string; readonly fanoutGroup?: string; }[]; readonly syncPoints: readonly { readonly groupId: string; readonly decision: "proceed" | "halt" | "pause" | "escalate"; readonly ruleFired: string; readonly reason: string; }[]; }; } export declare function createCallerAgentStepAdapter(caller: Caller): SkillAdapter; export declare function createCallerAgentAdapter(caller: Caller): SkillAdapter; export declare function createCallerApprovalAdapter(caller: Caller): SkillAdapter; export declare function runLocalSkill(options: RunLocalSkillOptions): Promise; export declare function runLocalChain(options: RunLocalChainOptions): Promise; export declare function inspectLocalChain(options: InspectLocalChainOptions): Promise; export declare function inspectLocalReceipt(options: InspectLocalReceiptOptions): Promise; export declare function listLocalHistory(options?: ListLocalHistoryOptions): Promise;