UNPKG

@code-yeongyu/senpi

Version:

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

26 lines • 2.06 kB
import type { RouterContext } from "./session-router-context.ts"; import type { RpcSessionEntry } from "./session-registry-types.ts"; /** * Writes the record entry of a retained session under `sessionPath`, stamped with this host instance, and drops * the entry it was recorded under before when the session has since moved to another transcript (senpi#6190). * `resident` stamps the writing process: the session is open here. A park writes it unstamped. `live` records that the * session was loaded when this host let it go (senpi#7020): every resident stamp is, and so is a handoff or clean-stop * park; an idle-sweep park and an unload are not. */ export declare function recordRetainedSession(host: RouterContext, retained: RpcSessionEntry, sessionPath: string, resident: boolean, live?: boolean): Promise<void>; /** * Brings the record in line with a session this host just opened or attached: a retained session is * recorded as resident here, so a restart reopens it; a non-retained open by path supersedes any * earlier park of that path, whose entry is cleared so no later start reopens a second copy * (MEDIUM-1, senpi#3282 review). Runs only after the open succeeded, so a failed open keeps the entry. */ export declare function syncRetainedRecord(host: RouterContext, sessionId: string, requestedPath: string | undefined): Promise<void>; /** * Called after every record a session publishes: a retained session whose transcript was switched (`new_session`, * `switch_session`, a fork) moves its record entry to the new file at once, so a crash restores the transcript the * session is on, never the one it left. A string compare until the path actually moves. */ export declare function followRetainedRecord(host: RouterContext, sessionId: string): void; /** An explicit close or reclaim ends the session for good: drop every key its record was written under. */ export declare function clearRetainedRecord(host: RouterContext, entry: RpcSessionEntry | undefined): Promise<void>; //# sourceMappingURL=session-router-residency.d.ts.map