UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

26 lines • 1.28 kB
import type { ExtensionAPI, ExtensionContext } from "../../types.ts"; import type { HookTrustState, ParsedHookConfig } from "./types.ts"; /** * Background work usually clears its wake source and wakes the session in the same * completion handler, in either order. A drained live set therefore waits this long for * the wake turn before Stop reports the session quiet; a turn that starts first cancels it. */ export declare const STOP_DRAIN_GRACE_MS = 2000; export type StopLifecycleDeps = { readonly refreshState: (ctx: ExtensionContext) => { readonly parsed: ParsedHookConfig; readonly trust: HookTrustState; }; }; export type StopLifecycle = { readonly resetTurn: () => void; }; /** * Dispatches the Stop hook when the session actually stops. A turn that ends while a * background wake source is live (subagent task, DAG run, terminal monitor, background bash * session, detached eval cell, loop-guard hold) has handed the session to work that wakes it * again, so its Stop waits: the wake turn's own end reports it, or the drain does when the * work clears without waking the session. */ export declare function registerStopLifecycle(pi: ExtensionAPI, deps: StopLifecycleDeps): StopLifecycle; //# sourceMappingURL=stop-lifecycle.d.ts.map