@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
42 lines • 2.38 kB
TypeScript
/**
* The call key a session persists and a compact peer reads (RULING-126/127, senpi#5374), minted by the producer:
* - `blk:<messageId>:<contentIndex>` for a toolCall block. `messageId` is the message's recovery id when the session
* has one, so the host's calls table derives the same key from the block's address with nothing on the wire.
* - `exe:<uuid>` for a bridge-started call (its execution started before its block streamed), minted with that start
* and carried to the host out of band, so the first key the call carries stays its key when the block joins.
* The host mints `<sessionEpoch>:<sequence>.<k>` only for a call with no backing block (a nested call).
*/
export declare function blockCallKey(messageId: string, contentIndex: number): string;
/** The key a bridge-started call's `tool_execution_start` carries out of band: never a field of the record. */
export declare function executionCallKey(record: object): string | undefined;
/** A copy of a record on its way to the host keeps the original's execution key (`carryRecovery`). */
export declare function carryExecutionCallKey(from: object, to: object): void;
interface ProducedEvent {
readonly type: string;
readonly message?: {
readonly role?: unknown;
readonly content?: unknown;
};
readonly toolCallId?: unknown;
readonly parentToolCallId?: unknown;
}
/**
* The bridge-started calls of the open assistant message (RULING-127 (b)), matched to blocks the way the host's calls
* table joins them: a top-level `tool_execution_start` first joins the oldest block of its id still waiting for a start;
* with none, it is bridge-started and mints its call's key with the start. A block then joins the oldest bridge-started
* call of its id, whether it streams or appears only in the terminal, and the message persists that key on the block,
* so persisted == live in either order of block and start, and for an id the message reuses.
*/
export declare class BridgedCallKeys {
private open;
private seen;
private waiting;
private bridged;
private keyed;
observe(event: ProducedEvent): void;
/** The ended message's bridge-started calls, content index to key; each message takes them once, at its persistence. */
take(): ReadonlyMap<number, string>;
private block;
}
export {};
//# sourceMappingURL=session-call-keys.d.ts.map