UNPKG

@code-yeongyu/senpi

Version:

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

97 lines • 5.17 kB
import { CompactActiveMessages } from "./compact-active-messages.ts"; import { type CallFold } from "./compact-call-fold.ts"; import { type CompactColdFlow } from "./compact-cold-flows.ts"; import type { CompactColdOperation } from "./compact-cold-operations.ts"; import type { CompactContentStore } from "./compact-content-store.ts"; import { type FrozenCompactState } from "./compact-state-view.ts"; import { type CompactTransition } from "./compact-transition.ts"; export type { CompactSessionStateOptions } from "./compact-state-storage.ts"; /** Work on the cut's store under its lease (S09 catalog); `valid` re-checks the cut after every await. */ export type CutStorageUse<T> = (store: CompactContentStore, valid: () => void) => Promise<T>; /** Synchronous acceptance; cuts and settlement transfer persistent component roots (senpi#4272). */ export declare class CompactSessionState extends CompactActiveMessages { private frozenTailBytes; private readonly cuts; private readonly components; private readonly calls; get acceptedSequence(): number; /** Open broadcast questions right now, for synchronous status reads (R3.C6.4). */ get openBroadcastDialogs(): number; /** * `sequence` is the acceptance lane's own sequence for this unit (one numbering with the lane, RULING-26); * `turnId` is the lane-minted turn the unit belongs to, consumed by the calls component (RULING-13 Q6). */ accept(t: CompactTransition, sequence?: number, turnId?: string | null): number; /** A call record at its lane step; `changed` is false when the record is ignored and takes no sequence (Q9). */ acceptCall(record: object, sequence: number, turnId: string | null, callKey?: string): CallFold; /** The outstanding call whose block this is: the call a `toolcall_*` update streams (RULING-123), by the table's index. */ callOwning(messageId: string, contentIndex: number): import("./compact-call-model.ts").OutstandingCall | undefined; applyCold(t: CompactColdOperation): Promise<import("./compact-cold-operations.ts").CompactColdOutcome>; /** One ordered cold unit per flow: its operations run back to back after acceptance, each with its outcome. */ applyColdFlow(flow: CompactColdFlow): Promise<readonly import("./compact-cold-operations.ts").CompactColdOutcome[]>; freeze(): FrozenCompactState; release(frozen: FrozenCompactState): void; /** Whole-view compatibility assembly; persistent nodes and text ranges are read separately. */ read(frozen: FrozenCompactState): Promise<{ sequence: number; messages: import("./compact-text-view.ts").CompactMessageView[]; }>; /** The live messages at the cut with the current value of every block (R3.C6.4), never the settled history. */ readActive(frozen: FrozenCompactState): Promise<import("./compact-state-view.ts").ActiveMessageView[]>; /** Run state, lifecycle and open dialogs at the cut (RULING-26 Q4). */ readComponents(frozen: FrozenCompactState): Promise<{ runState: import("./compact-current-components.ts").CompactRunState; lifecycle: unknown; dialogs: import("./compact-current-components.ts").CompactDialog[]; dialogCounts: { readonly broadcast: number; readonly targeted: number; }; }>; /** The outstanding calls at the cut (R3.C3), raw text resolved from the slots the calls own. */ readCalls(frozen: FrozenCompactState): Promise<import("./compact-call-view.ts").CallsView>; cutStorage<T>(frozen: FrozenCompactState, use: CutStorageUse<T>): Promise<T>; private get roots(); private callScope; private cutLease; /** Every read runs under the cut's operation lease and re-checks it with the store at each step. */ private under; storageStatus(): { structuredBytes: { readonly resident: number; readonly spilled: number; readonly pinned: number; }; residentPayloadBytes: number; pendingIoCopyBytes: number; pinnedOnlyBytes: number; spilledLiveBytes: number; spillBytesWritten: number; reclaimDebtBytes: number; spillFailureRetainedBytes: number; spillHalted: boolean; failures: readonly import("./compact-storage-io.ts").CompactStorageFailure[]; overrideSlots: number; deletionMasks: number; deletionMaskBytes: number; basePages: number; baseRows: number; residentIndexNodes: number; allocatedIndexNodes: number; residentPages: number; peakResidentPages: number; residentTailBytes: number; frozenTailBytes: number; hotWitnessBytes: number; residentComponentNodes: number; residentComponentIndexBytes: number; residentTextNodes: number; residentTextIndexBytes: number; }; idle(): Promise<void>; retire(): Promise<void>; private start; /** A start installs initial slots once; a terminal wins whole, and the outer end settles it as pending. */ private acceptMessage; } //# sourceMappingURL=compact-session-state.d.ts.map