import type { RuntimeDriverName, RuntimeEvent, RuntimeOptions, RuntimeSessionId, TranscriptChunk } from "@pi-claude-code-agent/runtime"; import { ClaudeRuntimeIntercomBridge } from "./bridge.js"; import type { AskResult, AttachPeerInput, BridgeOptions, BridgePeer, InterruptPeerResult, LaunchPeerInput, WaitForCompletionOptions } from "./types.js"; import type { RuntimeStatus } from "@pi-claude-code-agent/runtime"; export declare const PI_CA_LEASH_STATE_DIR_NAME = ".pi-ca-leash"; export declare function piCaLeashStateDir(cwd?: string): string; export declare function piCaLeashRuntimeStorageDir(cwd?: string): string; export declare function piCaLeashBridgeStorageDir(cwd?: string): string; export interface ManagedPeerApiOptions extends Pick { cwd?: string; bridge?: ClaudeRuntimeIntercomBridge; defaultDriver?: RuntimeDriverName; /** * Optional overrides for the embedded Runtime's construction. Merged on top * of the defaults derived from `cwd` and `defaultDriver`. Use this to inject * a custom driver/resolver (e.g. tests with a fake driver) without exposing * the Runtime instance. */ runtimeOptions?: Omit & { storageDir?: string; defaultDriver?: RuntimeDriverName; }; } export declare class PiCaLeashManagedPeerApi { readonly bridge: ClaudeRuntimeIntercomBridge; constructor(options?: ManagedPeerApiOptions); launchPeer(input: LaunchPeerInput): Promise; attachPeer(input: AttachPeerInput): Promise; listPeers(): Promise; status(name: string): Promise; statusBySessionId(sessionId: RuntimeSessionId): Promise; events(sessionId: RuntimeSessionId, cursor?: number): Promise; subscribe(listener: (event: RuntimeEvent) => void, sessionId?: RuntimeSessionId): () => void; /** * Event-driven wait for a session to reach a terminal state, with * staleness + hard-ceiling backstops. Driver-aware defaults are picked * from the session's runtime driver. See `ClaudeRuntimeIntercomBridge.waitForCompletion`. */ waitForCompletion(sessionId: RuntimeSessionId, opts?: WaitForCompletionOptions): Promise; reconcilePeers(): Promise; send(name: string, message: Parameters[1], options?: Parameters[2]): Promise; ask(name: string, message: Parameters[1]): Promise; reply(name: string, message: Parameters[1]): Promise; interrupt(name: string): Promise; interruptWithResult(name: string): Promise; stop(name: string): Promise; close(): Promise; }