/** * Idempotent admission: the submitRun service. * * Every input that must not change between attempts is frozen into the * admission record under one stable run_id: tenant, skill id + version, * canonical bundle digest, runtime-image digest, input digest, and the policy * + limits the run executes under. A duplicate submission — same * Idempotency-Key, or the same (tenant, skill, version, bundle digest, input * digest) tuple — returns the existing run instead of minting a second one. */ import type { ImageProfileRegistry } from "./image-profile.js"; import type { RunExecutionStore } from "./storage.js"; import { type FrozenAdmission, type RunLimits, type RunPolicy, type RuntimeName, type PureExecutionContract } from "./types.js"; export interface SubmitRunInput { tenantId: string; skillId: string; skillVersion: string; /** Canonical sha256 of the skill bundle. */ bundleDigest: string; input: unknown; idempotencyKey: string; runtime: RuntimeName; /** system_deps declared by the skill manifest. */ systemDeps?: string[]; policy?: Partial; limits?: Partial; executionContract?: PureExecutionContract; } export interface SubmitRunResult { run: FrozenAdmission; created: boolean; } export declare const DEFAULT_RUN_POLICY: RunPolicy; export declare const DEFAULT_RUN_LIMITS: RunLimits; export interface SubmitRunService { submit(input: SubmitRunInput): Promise; } export interface SubmitRunServiceOptions { store: RunExecutionStore; imageProfiles: ImageProfileRegistry; now?: () => Date; } export declare function createSubmitRunService(options: SubmitRunServiceOptions): SubmitRunService; /** Canonical digest of a run input: stable serialization, sha256. */ export declare function digestInput(input: unknown): string;