import type { BashOperations } from "@earendil-works/pi-coding-agent"; import type { FabricShellJobHandle, FabricShellJobInfo, FabricShellJobStore } from "../core/shell-jobs.js"; import type { FabricBashMiddlewareV1 } from "../protocol.js"; import type { JevFabricListedJob } from "./client.js"; import type { JevFabricRequirement, JevFabricResolution } from "./resolve.js"; export interface DurableShellSettings { /** Empty or "auto": the user's install outside the workspace, then the bundled package. */ binary: string; /** Empty: JEV_FABRIC_HOME, else `/.jev-fabric-native`. */ home: string; timeoutMs: number; } export interface DurableShellBridgeOptions { cwd: string; agentDir: string; ownerId: string | undefined; settings: () => DurableShellSettings; /** The active cooperative bash middleware, re-read on every use. */ middleware: () => FabricBashMiddlewareV1 | undefined; /** * Prepares a completion notify for one task (mints its single-use mesh * grant) and returns the launch-script wrapper; absent without a mesh. */ notify?: ((request: DurableNotifyRequest) => Promise<(command: string) => string>) | undefined; } export interface DurableNotifyRequest { topic: string; kind?: string | undefined; taskId: string; description?: string | undefined; } /** jev-fabric's own `start` ceiling. */ export declare const JEV_FABRIC_START_MAX_MS: number; /** * jev-fabric rejects storage paths with symlink components (macOS `/var`, * `/tmp`), so canonicalize the deepest existing ancestor and keep the rest. */ export declare const resolveJevFabricHome: (settings: DurableShellSettings, cwd: string) => string; /** * Durable shell tasks through an external jev-fabric store. The client, * registry and operations load at first durable use, never at session start. * Processes belong to the store, so session shutdown detaches them; the owning * session reattaches its own tasks on the next request after a restart. */ export declare class DurableShellBridge { #private; readonly jobs: FabricShellJobStore; readonly options: DurableShellBridgeOptions; constructor(jobs: FabricShellJobStore, options: DurableShellBridgeOptions); get home(): string; /** * The binary for a feature, chosen once per setting and requirement. A failed * resolution is not remembered, so installing jev-fabric takes effect at once. */ resolve(requirement: JevFabricRequirement): Promise; static assertSupported(): void; /** Operations for a new durable job, recorded for re-adoption once started. */ launch(job: FabricShellJobHandle, options: { shellPath?: string | undefined; label?: string | undefined; filtered: boolean; command: string; cwd: string; ownerId: string | undefined; notify?: { topic: string; kind?: string | undefined; } | undefined; }): Promise; /** Reattaches this session's durable tasks after a restart; memoized. */ resume(): Promise; /** jev-fabric jobs in this store that no task of this session tracks. */ external(): Promise<{ home: string; jobs: JevFabricListedJob[]; truncated: boolean; }>; /** Attaches an existing jev-fabric job (for example, one another harness started) to this session. */ adopt(jobId: string, description?: string): Promise; } //# sourceMappingURL=bridge.d.ts.map