Files
dsh-telegram-channel/lib/catalog.d.ts
T
owoandCursor 3566df945b fix: warn when /sessions falls back to live-only list (v0.3.3)
Phone showed 2 sessions because apiProxy catalog failed (pre-0.3.2 inject bug) and live-agent fallback hid cold Web sessions. Surface that mode explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 20:22:20 +08:00

33 lines
1.3 KiB
TypeScript

import type { Context } from '@deepseek-ai/cordis';
import type { Agent } from '@deepseek-ai/dsh-agent';
export interface WorkspaceRow {
id: string;
title: string;
path: string;
sessionIds: string[];
}
export interface SessionRow {
sessionId: string;
title: string;
cwd?: string;
blank: boolean;
running: boolean;
origin?: string;
updatedAt: number;
}
export interface CatalogSnapshot {
workspaces: WorkspaceRow[];
sessionsById: Map<string, SessionRow>;
archivedIds: Set<string>;
/** true when loaded from apiProxy (Web-aligned); false for live-agent fallback. */
complete: boolean;
}
/** Load workspaces + sessions aligned with Web UI (via apiProxy when available). */
export declare function loadCatalog(ctx: Context): Promise<CatalogSnapshot | undefined>;
/** Sessions visible under one workspace (Web-like filters). */
export declare function visibleSessionsForWorkspace(catalog: CatalogSnapshot, workspace: WorkspaceRow): SessionRow[];
export declare function workspacesWithVisibleSessions(catalog: CatalogSnapshot): WorkspaceRow[];
export declare function truncateButton(text: string, max?: number): string;
/** Fallback when apiProxy is unavailable: group live agents by cwd. */
export declare function catalogFromLiveAgents(agents: Agent[], ctx?: Context): CatalogSnapshot;