gaza/src/workspace.ts
Ubuntu 1748d2d66a 启动跨平台桌面客户端项目
Co-authored-by: multica-agent <github@multica.ai>
2026-08-03 18:41:38 +00:00

58 lines
1.5 KiB
TypeScript

export type ConnectionState = "CONNECTED" | "DEGRADED" | "RECONNECTING";
export interface OperationTab {
id: string;
project: string;
session: string;
title: string;
running?: boolean;
}
export interface TeamserverWorkspace {
id: string;
name: string;
shortName: string;
connection: ConnectionState;
unread: number;
activeProject: string;
activeTabId: string;
tabs: OperationTab[];
}
export const initialWorkspaces: TeamserverWorkspace[] = [
{
id: "atlas",
name: "Atlas Teamserver",
shortName: "AT",
connection: "CONNECTED",
unread: 2,
activeProject: "Northwind",
activeTabId: "nw-sessions",
tabs: [
{ id: "nw-sessions", project: "Northwind", session: "All sessions", title: "Sessions" },
{ id: "nw-042", project: "Northwind", session: "NW-042", title: "Session Overview" },
{ id: "or-audit", project: "Orchid", session: "Project", title: "Audit", running: true },
],
},
{
id: "ember",
name: "Ember Lab",
shortName: "EL",
connection: "DEGRADED",
unread: 5,
activeProject: "Sandbox",
activeTabId: "sb-events",
tabs: [
{ id: "sb-events", project: "Sandbox", session: "Project", title: "Events" },
{ id: "sb-107", project: "Sandbox", session: "SB-107", title: "Task Output", running: true },
],
},
];
export function selectWorkspace(
workspaces: TeamserverWorkspace[],
workspaceId: string,
): TeamserverWorkspace | undefined {
return workspaces.find(({ id }) => id === workspaceId);
}