import { type SessionEntry } from '@earendil-works/pi-coding-agent'; import type { BrokerSnapshot } from './broker-protocol.js'; /** customType of the persisted tree entry that ROOTS each post-yield cycle. * Data payload: `{ cycle, fromLeaf }` — `cycle` is the node's cycle counter at * relaunch, `fromLeaf` the previous cycle's leaf entry id. */ export declare const CRTR_CYCLE_CUSTOM_TYPE = "crtr-cycle"; /** customType of the SYNTHETIC divider message spliced between cycles in * snapshot rendering. Never persisted to the session file. */ export declare const CRTR_CYCLE_DIVIDER_CUSTOM_TYPE = "crtr-cycle-divider"; type SnapshotMessage = BrokerSnapshot['messages'][number]; /** The structural slice of pi's SessionManager cycle rendering needs. The * broker's fake-engine test fixture implements only `buildSessionContext`, so * the tree accessors are optional — absent ⇒ single-cycle behavior. */ export interface CycleSessionManagerLike { buildSessionContext(): { messages: SnapshotMessage[]; }; getEntries?(): SessionEntry[]; /** Walk from `fromId` (default: the current leaf) to its root; returns the * path root-first. */ getBranch?(fromId?: string): SessionEntry[]; } /** The full multi-cycle message history for display: prior cycles (oldest * first, each closed by a divider), then the live cycle's context. Falls back * to plain `buildSessionContext()` when the session has no cycle markers, when * the manager lacks tree accessors (fake engine), or when the current leaf was * tree-navigated back into a pre-yield branch (pi's active-branch semantics * then apply unchanged). */ export declare function cycleAwareMessages(sm: CycleSessionManagerLike): SnapshotMessage[]; export {};