/** * The durable form of the adopted control root: one `defineDomain` spec over a * single KV table, plus the seam the plugin installs over the open handle. * * The declaration is inert — importing this module touches no medium and * registers no service; only `ctx.storageDomain.open(executionBindingRootsDomain)` * in the plugin's `apply` materializes it. The record value IS the adopted * harness root; the key is the `(sessionId, cwd)` identity pair computed by * `keyOf` in the sibling module, so the in-process overlay and the durable * table never spell a key differently. * * The seam degrades: before an install every read is absent and every write is * a resolved no-op, which leaves the sibling module answering exactly as it did * with no durable channel at all. */ import { type Domain } from '@deepseek-ai/dsh-storage-domain'; /** * Domain and table names must match the host's `UNIT_NAME_RE` * (`/^[a-z][a-z0-9_]*$/`) — `defineDomain` throws at module load otherwise. */ export declare const executionBindingRootsDomain: { name: string; version: number; tables: { roots: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec; }; }; /** The durable surface the seam reads and writes — one open domain's table. */ export interface ExecutionBindingRootStore { /** Synchronous read of one `keyOf` key; the domain table serves it from memory. */ get(key: string): string | undefined; /** Durable write, resolved after the backend acknowledged it. */ put(key: string, value: string): Promise; /** Durable delete, resolved after the backend acknowledged it. */ delete(key: string): Promise; } /** * Whether a seam is installed. The receipt path reads this to say ONCE, at the * first adoption that finds no facility, that the receipt is per-process. */ export declare function executionBindingRootStoreInstalled(): boolean; /** * Claim one activation's pending `open` and return the token that owns it: the * plugin's inject child raises it before awaiting `open`, and only that token * releases it again — on completion, refusal, or the child's disposal. * * shortcut: an `open` that never settles on a fiber that is never disposed * keeps its activation in flight forever, so the generic no-seam warning stays * silent for it; upgrade by bounding the `open` itself (a timeout that closes * the late handle) if a supported host is observed to leak one that way. */ export declare function beginExecutionBindingRootStoreOpening(): number; /** Release ONE activation's pending `open`; another activation's `open` stays in flight. */ export declare function endExecutionBindingRootStoreOpening(token: number): void; /** Whether at least one activation's `open` is still in flight (see {@link beginExecutionBindingRootStoreOpening}). */ export declare function executionBindingRootStoreOpening(): boolean; /** Register the replay `installExecutionBindingRootStore` runs (module-load wiring in the sibling). */ export declare function registerExecutionBindingRootReplay(replay: () => void): void; /** Logger label for the durable seam (dsh logger naming: `/`). */ export declare const EXECUTION_BINDING_ROOTS_LOGGER = "mstar/execution-binding-roots"; /** Module-level warning sink — bound by `apply` to `ctx.logger(EXECUTION_BINDING_ROOTS_LOGGER)` (module-sink pattern). */ export type ExecutionBindingRootsLogSink = (message: string) => void; /** * Bind the module warning sink (the entry `apply` binds it to * `ctx.logger(EXECUTION_BINDING_ROOTS_LOGGER)`). Returns the PRIOR sink so a * caller can restore it (the package's module-sink pattern). */ export declare function setExecutionBindingRootsLogger(sink: ExecutionBindingRootsLogSink): ExecutionBindingRootsLogSink; /** * Log one contained warning through the bound sink. Never-throws invariant: the * whole sink call is inside the guard, so neither the default console write nor * a throwing bound sink can re-enter the caller. The message carries no label: * the sink owns it — the default console sink prefixes it, while the bound * `ctx.logger(EXECUTION_BINDING_ROOTS_LOGGER)` scope already labels it. */ export declare function warnExecutionBindingRoots(message: string): void; /** * Install the durable reader/writer and return its disposer. One seam per * process: a second install replaces the first, and a disposer restores the * seam that was installed before it (tests boot several apps in one process). * Installing never drops an in-process receipt this host already holds: it * replays them into the new store, so an adoption made before the seam existed * becomes durable here. The in-flight-`open` state belongs to the activation * that raised it ({@link beginExecutionBindingRootStoreOpening}), so installing * leaves another activation's pending `open` alone. */ export declare function installExecutionBindingRootStore(store: ExecutionBindingRootStore): () => void; /** Wrap one open domain handle in the store shape; a store failure is contained like any other. */ export declare function executionBindingRootStoreOf(domain: Domain): ExecutionBindingRootStore; /** The durable root recorded for one `keyOf` key: absent with no seam, no record, or a failed read. */ export declare function durableExecutionBindingRootOf(key: string): string | undefined; /** * Queue the durable record for one `keyOf` key. Never rejects: a failed write * is logged with its cause and the caller's in-process receipt still answers. */ export declare function putDurableExecutionBindingRoot(key: string, harnessRoot: string): Promise; /** * Queue the durable delete for one `keyOf` key. Never rejects: a failed delete * is logged with its cause and the caller's synchronous tombstone still hides * the cleared root. */ export declare function deleteDurableExecutionBindingRoot(key: string): Promise;