import type { CapabilityEffect, JsonValue } from "./types.js"; export declare const METABOLIC_BINDING_VERSION: "1.0"; export declare const METABOLIC_EXECUTION_RECEIPT_VERSION: "1.0"; export type BinderDiscoveryMode = "automatic" | "explicit" | "derived"; export type MetabolicAuthority = { complete: boolean; effects: readonly CapabilityEffect[]; note?: string; }; /** * Stable 1.x substrate binding envelope. * * A binding is not merely a locator. It is the point where a generalized * substrate adapter commits to the exact artifact it intends to execute and * preserves the authority/evidence state that justified the binding. */ export type MetabolicBinding = { bindingVersion: typeof METABOLIC_BINDING_VERSION; binderId: string; substrate: string; locator: string; immutableArtifact: string; createdAt: string; authority: MetabolicAuthority; evidence: readonly string[]; metadata?: Record; }; export type BinderExecutionContext = { approved?: boolean; signal?: AbortSignal; }; /** Low-level result returned by a binder implementation. */ export type BinderExecutionPayload = { status: "succeeded" | "failed"; output?: JsonValue; upstreamReceipt?: JsonValue; isolation?: string; metadata?: Record; }; /** Stable 1.x receipt emitted by the registry around every attempted binder execution. */ export type MetabolicExecutionReceipt = { receiptVersion: typeof METABOLIC_EXECUTION_RECEIPT_VERSION; binderId: string; substrate: string; locator: string; immutableArtifact: string; status: "succeeded" | "failed"; startedAt: string; endedAt: string; authority: { complete: boolean; effects: readonly CapabilityEffect[]; }; evidence: readonly string[]; isolation?: string; upstreamReceipt?: JsonValue; metadata?: Record; error?: string; }; export type BinderExecution = { status: "succeeded" | "failed"; output?: JsonValue; receipt: MetabolicExecutionReceipt; }; export declare function validateMetabolicBinding(value: unknown, expected?: Pick, "id" | "substrate">): string[]; export declare function assertMetabolicBinding(value: unknown, expected?: Pick, "id" | "substrate">): asserts value is MetabolicBinding; /** * A binder generalizes adaptation by execution substrate instead of by project. * * Capability 1.x treats this interface as a public extension contract. A binder * MUST bind an immutable artifact before execution and MUST preserve unknown * authority rather than guessing it away. The registry validates both rules. */ export interface MetabolicBinder { readonly id: string; readonly substrate: string; readonly discovery: BinderDiscoveryMode; readonly description: string; bind(request: Request): Promise; execute?(binding: Binding, input: unknown, context?: BinderExecutionContext): Promise; } export declare class MetabolicBinderRegistry { private readonly binders; register(binder: MetabolicBinder): this; get(id: string): MetabolicBinder; forSubstrate(substrate: string): readonly MetabolicBinder[]; list(): readonly { id: string; substrate: string; discovery: BinderDiscoveryMode; description: string; executable: boolean; }[]; bind(id: string, request: Request): Promise; execute(id: string, binding: Binding, input: unknown, context?: BinderExecutionContext): Promise; } //# sourceMappingURL=binders.d.ts.map