import type { LineageNode, SessionEvent, SessionEventType, SessionSummary, WorkspaceSessionListEvent } from "@opengeni/sdk"; import { type PendingApproval } from "../../approvals.js"; /** * Every event that opens or closes a question or an approval. A sub-session's * newest page of these is enough to rebuild what it waits on, exactly as its * own page projects it from the full log. */ export declare const DESCENDANT_REQUEST_EVENT_TYPES: SessionEventType[]; /** Newest request events read per waiting sub-session. */ export declare const DESCENDANT_REQUEST_EVENT_LIMIT = 20; /** * A sub-session that waits on a person: blocked on a question, an approval or * another human step. The rail's `awaitsPerson` (a session the runtime could * not start is Stuck, not waiting on the person), minus archived sessions, * which the parent page does not offer to act on. */ export declare function awaitsPersonInTree(session: SessionSummary): boolean; /** * A sub-session resuming from an approval decided on the parent's card, whose * other approvals of the same pause stay decidable: its card stays up instead * of vanishing until the sub-session pauses again. */ export declare function resumingFromDecision(session: SessionSummary, resuming: ReadonlySet): boolean; /** * Every descendant that waits on the person, the longest-waiting first, with * those still resuming from a decision made here (`resuming`). */ export declare function waitingDescendants(nodes: readonly LineageNode[], resuming?: ReadonlySet): SessionSummary[]; /** The ids of every session in a lineage tree. */ export declare function lineageSessionIds(nodes: readonly LineageNode[]): Set; /** Whether a descendant is running, and so may spawn or start waiting. */ export declare function descendantsRunning(nodes: readonly LineageNode[]): boolean; /** * Whether a workspace session-list hint can change what this tree waits on: * a full reconciliation, or a change to one of the descendants (`ids`). */ export declare function hintTouchesTree(hint: Pick | null | undefined, ids: ReadonlySet): boolean; /** * The call id of a tool call this session's agent made to answer a * sub-session (`session_human_input_respond`) or steer it onto new work * (`session_steer`), directly or through `tool_invoke`. Null otherwise. */ export declare function subSessionResponseCallId(event: SessionEvent): string | null; /** Every call in a feed that answers or steers a sub-session, by call id. */ export declare function subSessionResponseCallIds(events: readonly SessionEvent[]): Set; /** * The output of one of those calls: the call has run, so the sub-session's * open waits may have closed and the card must re-read what still waits. * Outputs carry only the call id, so they are matched to their created event. */ export declare function isSubSessionResponseOutput(event: SessionEvent, callIds: ReadonlySet): boolean; export type DescendantRequestActivity = { /** Approvals still awaiting a decision, as the sub-session's page shows them. */ approvals: PendingApproval[]; /** Where the open approvals were raised, to open the sub-session there. */ approvalSequence: number | null; /** Where each question was asked, by request id. */ requestSequences: ReadonlyMap; }; /** * Rebuild what a sub-session waits on from its newest request events (any * order). Uses the same approval projection as the sub-session's own page, so * a decided approval never reappears as a live one. */ export declare function descendantRequestActivity(events: readonly SessionEvent[]): DescendantRequestActivity; /** The collapsed stack's one line. */ export declare function subSessionsNeedYouLabel(count: number): string;