import { SessionSummary, WorkspaceSummary } from "../../types/hub.mjs"; import { AttachPhase } from "./sessionSummary.mjs"; import { SessionSetupActionContribution, WebPluginSessionOption, WebTemplateRail, WebTemplateRailPendingSetup, WebTemplateRailSession, WebTemplateRailWorkspace } from "@agimon-ai/po-core/web"; //#region src/web/lib/sessionRailModel.d.ts /** Sessions recorded without a workspace are grouped under this id. */ export declare const LEGACY_WORKSPACE_ID = "legacy-workspace"; /** One home target per computer, not one global coordinator flag for a merged rail. */ export declare function coordinatorHostTargets(workspaces: readonly WebTemplateRailWorkspace[], defaultHost: string | undefined, labels: Readonly>): NonNullable; /** Why a new bot in this workspace, or in Home without one, cannot act as coordinator; undefined when it can. */ export declare function botCoordinatorBlocked(target: { workspaceId?: string; hostId?: string; }, workspacesById: Readonly>, summaries: readonly SessionSummary[]): string | undefined; /** * The rail order the 1-9 shortcuts index. A workflow step comes and goes with its step, so it takes * no digit and never shifts the digits of the sessions around it. */ export declare function railShortcutOrder(order: readonly string[], byId: Readonly; }>>): string[]; export interface RailSessionInput { summary: SessionSummary; attach: AttachPhase; canInteract?: boolean; } /** A restart the rail asked for: in flight, or failed with a reason. */ export interface RailRestartState { restarting: boolean; error?: string; } export interface SessionRailModelInput { /** Rail order across every workspace; positions become the 1-9 ordinals. */ order: readonly string[]; byId: Readonly>; activeId: string | null; workspaceOrder: readonly string[]; workspacesById: Readonly>; /** Sessions rendered under a parent, each mapped to the row it renders under. */ nested: ReadonlyMap; /** When the status copy is read; a card's `clock` keeps it current after that. */ now: number; restarts: Readonly>; /** Loaded profile avatars by session id. */ avatarUrls: Readonly>; } export declare function workspaceName(workspace: Pick): string; type PendingSetup = NonNullable[number]; /** The installed package that claims a pending setup, from the session setup action fills' data. */ export declare function sessionSetupActionFor(contributions: readonly unknown[], setup: PendingSetup): SessionSetupActionContribution | undefined; /** The status and recovery copy for a setup-only child reservation. */ export declare function pendingSetupView(setup: PendingSetup): WebTemplateRailPendingSetup; /** One session's status copy and clock as its card shows them, for a surface that reads only that session. */ export declare function railSessionStatus({ summary, attach }: RailSessionInput, now: number): Pick; /** * Live sessions on one computer (`hostId`, undefined for the page's own, which is the default host when the page has * only a remote one) but `excludeId`, in rail order: the sessions a global server method of that computer can reach. */ export declare function liveSessionOptions(sessions: { order: readonly string[]; byId: Readonly>; }, workspaces: Readonly>, excludeId: string | null, hostId: string | undefined, now: number): WebPluginSessionOption[]; /** * What the Activity face holds for the person: each pending approval, plus background work * that needs them (such as a failed workflow) while the agent itself is idle. */ export declare function activityWaitingCount(summary: SessionSummary | undefined): number; /** Everything waiting on the person in one session: the Activity count plus an open question. */ export declare function sessionWaitingCount(summary: SessionSummary): number; /** Headerless session scopes first, ordinary workspaces in host order, and legacy sessions last. */ export declare function buildRailWorkspaces(input: SessionRailModelInput): WebTemplateRailWorkspace[]; /** * `next` with every session and workspace from `previous` whose content did not * change kept as the same object, so a memoized card renders again only when * its own session moved rather than on every push to any session. */ export declare function reuseRailWorkspaces(previous: readonly WebTemplateRailWorkspace[], next: readonly WebTemplateRailWorkspace[]): WebTemplateRailWorkspace[]; /** Shared web/native destination policy. The server remains the authority at submission. */ export declare function sessionMoveTarget(summary: SessionSummary, workspacesById: Readonly>, workspaceOrder: readonly string[]): WebTemplateRailSession['move']; //#endregion export {}; //# sourceMappingURL=sessionRailModel.d.mts.map