/** * Executor Registry — domain-facing persistence port (2.10.0). * * Pure types + validation only. No filesystem, process, provider, or scheduler * machinery. A future scheduler/worker daemon consumes this same port without * needing the local file implementation. * * Authority model: * - The registry records what executors exist and what runtimes are alive. * - Capability/resource fields are advertisements and observations, never * authorization grants and never assignments. */ import { type ExecutorCapabilities, type ExecutorDefinition, type ExecutorRecord } from "./executor-registry-types.js"; export declare const EXECUTOR_REGISTRY_SCHEMA_VERSION: 1; export type ExecutorRegisterResult = { status: "created"; } | { status: "idempotent"; record: ExecutorRecord; } | { status: "conflict"; error: string; }; export type ExecutorLoadResult = { status: "ok"; record: ExecutorRecord; } | { status: "missing"; } | { status: "corrupt"; executorId: string; diagnostic: string; }; /** A store-level atomic read-modify-write mutation (sync callback). */ export type ExecutorMutation = { kind: "write"; next: ExecutorRecord; value: T; } | { kind: "noop"; value: T; }; export type ExecutorMutateResult = { status: "ok"; value: T; } | { status: "missing"; } | { status: "corrupt"; executorId: string; diagnostic: string; }; /** * Canonical executor registry persistence port. Implementations must be * crash-conscious (atomic record replacement, schema validation on load, * deterministic corrupt handling) and must never fabricate a healthy executor. */ export interface ExecutorRegistryStore { readonly storeId: string; register(record: ExecutorRecord): Promise; load(executorId: string): Promise; listExecutors(): Promise; mutate(executorId: string, mutation: (current: ExecutorRecord) => ExecutorMutation): Promise>; } /** Structural equality of two stable executor definitions. */ export declare function executorDefinitionsEqual(a: ExecutorDefinition, b: ExecutorDefinition): boolean; export type ExecutorRecordParseResult = { ok: true; record: ExecutorRecord; } | { ok: false; diagnostic: string; }; /** * Validate an untrusted persisted value into an ExecutorRecord. Corruption is * surfaced structurally (`ok: false`), never silently dropped or fabricated. */ export declare function parseExecutorRecord(value: unknown): ExecutorRecordParseResult; export interface CreateExecutorRecordInput { executorId: string; displayName?: string; labels?: string[]; configuredCapabilities?: ExecutorCapabilities; remoteTargetId?: string; now?: number; } /** Build an initial registered record (no runtime, epoch 0, not retired). */ export declare function createExecutorRecord(input: CreateExecutorRecordInput): ExecutorRecord; //# sourceMappingURL=executor-registry-store.d.ts.map