/** * Workspace-ledger integration shared by every TUI session entry path. * * A Session header's cwd is only a membership prerequisite. Web grouping is * owned by the durable WorkspaceRegistry account, so a newly created Session * must be attached after `agents.create()` succeeds. Resuming also attaches * idempotently, which migrates sessions written by older TUI versions. * * @module @chatcode/cco-tui/workspace */ import type { Context } from '@deepseek-ai/cordis'; import type { SessionId } from '@deepseek-ai/dsh-session'; declare module '@deepseek-ai/cordis' { interface Events { /** Committed workspace projection refreshed from shared storage. * @mode emit */ 'workspace/refreshed'(): void; } } /** Durable session organization shared with the Web client. */ export interface WorkspaceSessionState { readonly workspaces: readonly { readonly cwd: string; readonly label: string; readonly sessionIds: readonly string[]; }[]; readonly pinnedIds: readonly string[]; readonly archivedIds: readonly string[]; readonly deletedIds?: readonly string[]; } export declare function readWorkspaceSessionState(ctx: Context): WorkspaceSessionState | undefined; /** Older standalone hosts have no refresh operation; the shared host refreshes before opening the picker. */ export declare function refreshWorkspaceSessionState(ctx: Context): Promise; /** Subscribe to committed grouping changes without introducing filesystem access in the UI. */ export declare function subscribeWorkspaceSessionState(ctx: Context, listener: () => void): () => void; export declare function setWorkspaceSessionPinned(ctx: Context, sessionId: SessionId, pinned: boolean): Promise; export declare function archiveWorkspaceSession(ctx: Context, sessionId: SessionId): Promise; /** * Find or create the Workspace for `cwd`, then durably account `sessionId`. * * The service is optional for bare/custom compositions. Returning `false` * lets those deployments retain their pre-workspace behavior; the shipped * profile mounts the same storage/workspace stack as Web and therefore always * takes the durable attach path. */ export declare function attachSessionToWorkspace(ctx: Context, cwd: string, sessionId: SessionId): Promise; /** Shared Host owns preview, archival preconditions, writer exclusion and cleanup. */ export declare function previewWorkspaceSessionDeletion(ctx: Context, id: SessionId): Promise; /** No filesystem fallback: an older standalone Host cannot permanently delete history. */ export declare function deleteWorkspaceSession(ctx: Context, id: SessionId, expectedIds: readonly string[]): Promise; export declare function unarchiveWorkspaceSession(ctx: Context, id: SessionId): Promise; //# sourceMappingURL=workspace.d.ts.map