@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
55 lines • 2.81 kB
TypeScript
import type { FrozenCalls } from "./compact-call-model.ts";
import type { CompactComponentRoots } from "./compact-component-roots.ts";
import type { CompactContentIndex, FrozenIndex } from "./compact-content-index.ts";
import type { CompactContentStore } from "./compact-content-store.ts";
import type { FrozenComponents } from "./compact-current-components.ts";
import type { FrozenSeededBlock } from "./compact-seeded-block.ts";
import type { SeededFields } from "./compact-seeded-draft.ts";
import { type CompactMessageView, type FrozenBlock } from "./compact-text-view.ts";
import type { CompactPersistence } from "./compact-transition.ts";
import type { ValueRef } from "./compact-values.ts";
export interface MessageRoot {
readonly messageId: string;
readonly blocks?: ValueRef | undefined;
/** Public message fields (assistant content lives in `blocks`); absent for block-only messages. */
readonly fields?: SeededFields;
readonly correlation?: SeededFields;
}
export interface SettledRow extends MessageRoot {
readonly persistence: CompactPersistence;
}
export interface FrozenCompactState {
readonly sequence: number;
readonly active: ValueRef | undefined;
readonly settled: FrozenIndex;
readonly components: FrozenComponents;
readonly calls: FrozenCalls;
}
interface Components {
readonly store: CompactContentStore;
readonly settled: CompactContentIndex<SettledRow>;
readonly blockRoots: CompactComponentRoots<FrozenBlock>;
readonly messageRoots: CompactComponentRoots<MessageRoot>;
}
export interface ActiveBlockView {
readonly contentIndex: number;
readonly text: string;
readonly phase: FrozenSeededBlock["phase"] | undefined;
/** The public block at the cut; absent for a block that has no seed. */
readonly block: Readonly<Record<string, unknown>> | undefined;
}
/** One live message at a cut: its public fields and the current value of every block it names (R3.C6.4). */
export interface ActiveMessageView {
readonly messageId: string;
readonly fields: Readonly<Record<string, unknown>> | undefined;
readonly blocks: readonly ActiveBlockView[];
}
/** The live messages of a cut, read for a legacy view; never the settled history. Called under the cut's lease. */
export declare function readActiveMessages(frozen: FrozenCompactState, components: Pick<Components, "store" | "blockRoots" | "messageRoots">, valid: () => void): Promise<ActiveMessageView[]>;
/** Whole-view compatibility assembly, called only while the owner holds its cut operation lease. */
export declare function readCompactState(frozen: FrozenCompactState, components: Components, valid: () => void): Promise<{
sequence: number;
messages: CompactMessageView[];
}>;
export {};
//# sourceMappingURL=compact-state-view.d.ts.map