@co0ontty/wand 4.93.0 → 4.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -30
- package/dist/ai-text-runner.d.ts +2 -10
- package/dist/ai-text-runner.js +13 -74
- package/dist/build-info.json +3 -3
- package/dist/cli.js +47 -9
- package/dist/config.d.ts +2 -3
- package/dist/config.js +26 -5
- package/dist/core-status-cli.d.ts +1 -1
- package/dist/core-status-cli.js +3 -1
- package/dist/daemon-connection.d.ts +10 -0
- package/dist/daemon-connection.js +28 -0
- package/dist/diagnostic-logs.d.ts +10 -0
- package/dist/diagnostic-logs.js +121 -0
- package/dist/employee-text.js +1 -3
- package/dist/git-quick-commit.d.ts +1 -1
- package/dist/git-quick-commit.js +2 -9
- package/dist/layout-tree.d.ts +3 -1
- package/dist/layout-tree.js +8 -0
- package/dist/local-model-process.js +20 -0
- package/dist/local-model-setup.js +5 -3
- package/dist/managed-temp.d.ts +32 -0
- package/dist/managed-temp.js +176 -0
- package/dist/middleware/api-scope.js +1 -0
- package/dist/models/shared.d.ts +0 -6
- package/dist/models/shared.js +0 -12
- package/dist/models/thinking.d.ts +0 -2
- package/dist/models/thinking.js +0 -2
- package/dist/models.d.ts +0 -1
- package/dist/models.js +3 -11
- package/dist/native-session-title.d.ts +1 -1
- package/dist/native-session-title.js +1 -1
- package/dist/pi-model-discovery.js +5 -17
- package/dist/pi-resource-recommendation.d.ts +1 -1
- package/dist/pi-resource-recommendation.js +129 -42
- package/dist/process-manager-native-history.js +1 -6
- package/dist/process-manager.d.ts +0 -1
- package/dist/process-manager.js +5 -18
- package/dist/provider-catalog.d.ts +1 -2
- package/dist/provider-catalog.js +1 -6
- package/dist/provider-cli-updater.js +1 -9
- package/dist/provider-history-scanner.d.ts +0 -3
- package/dist/provider-history-scanner.js +0 -26
- package/dist/render-daemon-client.js +6 -29
- package/dist/render-structured-client.js +2 -7
- package/dist/retention.js +1 -6
- package/dist/run-command.d.ts +5 -0
- package/dist/run-command.js +14 -1
- package/dist/server-session-lifecycle-routes.js +1 -1
- package/dist/server-storage-cleanup-routes.d.ts +3 -0
- package/dist/server-storage-cleanup-routes.js +19 -0
- package/dist/server-workspace-routes.d.ts +4 -1
- package/dist/server-workspace-routes.js +75 -9
- package/dist/server.js +21 -16
- package/dist/service-command-privilege.d.ts +17 -0
- package/dist/service-command-privilege.js +55 -0
- package/dist/service-manager/index.d.ts +3 -0
- package/dist/service-manager/index.js +3 -0
- package/dist/service-manager/launchd.d.ts +1 -0
- package/dist/service-manager/launchd.js +15 -0
- package/dist/service-manager/systemd.d.ts +1 -0
- package/dist/service-manager/systemd.js +11 -0
- package/dist/session-ai-context.js +17 -6
- package/dist/session-completion-state.d.ts +2 -0
- package/dist/session-completion-state.js +6 -2
- package/dist/session-logger.js +7 -1
- package/dist/session-model.d.ts +4 -0
- package/dist/session-model.js +13 -4
- package/dist/session-registry.d.ts +1 -1
- package/dist/session-registry.js +0 -3
- package/dist/silicon-employee-draft.js +0 -1
- package/dist/speech-service.js +18 -8
- package/dist/storage/mappers.js +6 -10
- package/dist/storage/migrations.js +14 -0
- package/dist/storage/uploads-repository.d.ts +36 -0
- package/dist/storage/uploads-repository.js +98 -0
- package/dist/storage-cleanup.d.ts +50 -0
- package/dist/storage-cleanup.js +344 -0
- package/dist/storage.d.ts +3 -1
- package/dist/storage.js +4 -0
- package/dist/structured-failure.d.ts +2 -0
- package/dist/structured-failure.js +9 -0
- package/dist/structured-grok-adapter.js +4 -4
- package/dist/structured-opencode-adapter.js +4 -9
- package/dist/structured-provider-common.d.ts +1 -2
- package/dist/structured-provider-common.js +3 -6
- package/dist/structured-session-manager-replay.js +2 -6
- package/dist/structured-session-manager.d.ts +1 -2
- package/dist/structured-session-manager.js +32 -25
- package/dist/task-organize-contract.d.ts +41 -0
- package/dist/task-organize-contract.js +4 -0
- package/dist/task-title-organize-service.d.ts +21 -0
- package/dist/task-title-organize-service.js +168 -0
- package/dist/task-title-organize.d.ts +77 -0
- package/dist/task-title-organize.js +346 -0
- package/dist/terminal-daemon-client.js +10 -48
- package/dist/time-utils.d.ts +2 -0
- package/dist/time-utils.js +7 -0
- package/dist/tui/attach.js +6 -5
- package/dist/tui/commands.d.ts +4 -1
- package/dist/tui/commands.js +36 -25
- package/dist/tui/index.js +2 -2
- package/dist/tui/service-actions.js +5 -4
- package/dist/tui/service-command.d.ts +6 -0
- package/dist/tui/service-command.js +40 -0
- package/dist/tui/service-panel.js +9 -8
- package/dist/types.d.ts +4 -4
- package/dist/upload-reference-guard.d.ts +4 -0
- package/dist/upload-reference-guard.js +29 -0
- package/dist/upload-routes.d.ts +4 -0
- package/dist/upload-routes.js +121 -21
- package/dist/user-profile.d.ts +1 -1
- package/dist/user-profile.js +8 -3
- package/dist/web-ui/content/ai-teams.js +9 -9
- package/dist/web-ui/content/module-manifest.json +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chat-render-EODYMQF6.js → 0051bd3d55f10ab7/chat-render-RY2I2CF3.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-ZTEQSXPA.js → 0051bd3d55f10ab7/chunk-2F6J2MKX.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-A33YPCY6.js → 0051bd3d55f10ab7/chunk-7AFM245W.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-QNUWUMKW.js → 0051bd3d55f10ab7/chunk-MHX2QXIS.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-WGADUEIT.js → 0051bd3d55f10ab7/chunk-RAAPETNH.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-I3UYDQLS.js → 0051bd3d55f10ab7/chunk-RXKBHYUR.js} +2 -2
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-3TCUG766.js → 0051bd3d55f10ab7/chunk-U4EDP4TI.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-HK7RBU3M.js → 0051bd3d55f10ab7/chunk-WHXQR7JT.js} +1 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/employee-card-NV34TZIH.js +1 -0
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-2PU6TV2I.js → 0051bd3d55f10ab7/host-2IVIZ2YC.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-BPYNMKFC.js → 0051bd3d55f10ab7/host-AZXNFCRW.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-HZIKPWYY.js → 0051bd3d55f10ab7/host-EPEQX22R.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-YELXZID4.js → 0051bd3d55f10ab7/host-FZYIMOLC.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-OGD6AWHL.js → 0051bd3d55f10ab7/host-G6GL4SNL.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-E3SCPOIU.js → 0051bd3d55f10ab7/host-PEILC5NU.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-OWD32FZ3.js → 0051bd3d55f10ab7/host-PHHNGVNL.js} +2 -2
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-CXDAFMXX.js → 0051bd3d55f10ab7/host-Q524TMSR.js} +1 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-RO5MB6RB.js +69 -0
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-J5XRAQFP.js → 0051bd3d55f10ab7/host-WOQRK6NG.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-HKXE2DOT.js → 0051bd3d55f10ab7/host-XNIR3NTJ.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/host-4E4H4JZJ.js → 0051bd3d55f10ab7/host-XRVOIEP6.js} +1 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-ZDKOQEMS.js +1 -0
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-bridge-PMQZRG5G.js +1 -0
- package/dist/web-ui/content/modules/{2548dbe0d0783577/library-bridge-Y3Y24CPQ.js → 0051bd3d55f10ab7/library-bridge-DTMQIHVJ.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/page-GQBUU7T7.js → 0051bd3d55f10ab7/page-PY4JUL4W.js} +1 -1
- package/dist/web-ui/content/modules/{2548dbe0d0783577/panel-PG662OC5.js → 0051bd3d55f10ab7/panel-BBQFC55Q.js} +1 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/runtime.js +974 -0
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/task-board-host-PXZSWBBG.js +2 -0
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/workspace-agent-picker-DJSECSY6.js +1 -0
- package/dist/web-ui/content/modules/{2548dbe0d0783577/workspace-window-HV4T3WKR.js → 0051bd3d55f10ab7/workspace-window-MNMKSOBG.js} +1 -1
- package/dist/web-ui/content/styles.css +1 -1
- package/dist/web-ui/embedded-assets.d.ts +27 -27
- package/dist/web-ui/embedded-assets.js +4 -4
- package/dist/web-ui/provider-identity.d.ts +4 -5
- package/dist/web-ui/provider-identity.js +4 -10
- package/dist/web-ui/react/workspaces/sidebar-manage.d.ts +39 -0
- package/dist/web-ui/react/workspaces/sidebar-manage.js +149 -0
- package/dist/web-ui/react/workspaces/types.d.ts +408 -0
- package/dist/web-ui/react/workspaces/types.js +16 -0
- package/dist/web-ui/session-activity.js +1 -1
- package/package.json +2 -2
- package/dist/structured-gemini-adapter.d.ts +0 -40
- package/dist/structured-gemini-adapter.js +0 -208
- package/dist/web-ui/content/modules/2548dbe0d0783577/chunk-XGVT4ZWT.js +0 -1
- package/dist/web-ui/content/modules/2548dbe0d0783577/employee-card-LJ3TX72B.js +0 -1
- package/dist/web-ui/content/modules/2548dbe0d0783577/host-ITV2QZ4A.js +0 -1
- package/dist/web-ui/content/modules/2548dbe0d0783577/host-XNWC7KPR.js +0 -69
- package/dist/web-ui/content/modules/2548dbe0d0783577/host-bridge-G5HEVADT.js +0 -1
- package/dist/web-ui/content/modules/2548dbe0d0783577/runtime.js +0 -946
- package/dist/web-ui/content/modules/2548dbe0d0783577/task-board-host-RAN2Z2KR.js +0 -2
- package/dist/web-ui/content/modules/2548dbe0d0783577/workspace-agent-picker-FXLH6N5K.js +0 -1
- /package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-YX475LXO.js → 0051bd3d55f10ab7/chunk-6C6A2RHG.js} +0 -0
- /package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-NP35GDQ3.js → 0051bd3d55f10ab7/chunk-ECWYA3U5.js} +0 -0
- /package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-47EVOSJS.js → 0051bd3d55f10ab7/chunk-T35D57FW.js} +0 -0
- /package/dist/web-ui/content/modules/{2548dbe0d0783577 → 0051bd3d55f10ab7}/chunk-YOXXNXOX.js +0 -0
- /package/dist/web-ui/content/modules/{2548dbe0d0783577/chunk-C3K34WJD.js → 0051bd3d55f10ab7/chunk-YQJ6XYV7.js} +0 -0
- /package/dist/web-ui/content/modules/{2548dbe0d0783577/host-J6HBDK4A.js → 0051bd3d55f10ab7/host-2AQAIUNO.js} +0 -0
- /package/dist/web-ui/content/modules/{2548dbe0d0783577 → 0051bd3d55f10ab7}/sha256-ANXV72UC.js +0 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import type { ProviderId } from "../../provider-identity.js";
|
|
2
|
+
import { WAND_AGENT_TOOL_ID } from "../../provider-identity.js";
|
|
3
|
+
export type WorkspaceProvider = ProviderId;
|
|
4
|
+
/**
|
|
5
|
+
* 能在任务窗口里跑起来的一项:CLI 工具、Wand Agent(进程内 SDK)或裸 Shell。
|
|
6
|
+
* Wand Agent 与 Pi 共用 pi provider,但在 UI 上是两个可选项,所以用选项 id 当 target。
|
|
7
|
+
*/
|
|
8
|
+
export type WorkspaceSessionTarget = WorkspaceProvider | "shell" | typeof WAND_AGENT_TOOL_ID;
|
|
9
|
+
/**
|
|
10
|
+
* target → provider。Wand Agent 也用 pi provider 开会话,只是引擎是进程内 SDK。
|
|
11
|
+
* Shell 没有 provider,返回空串。
|
|
12
|
+
*/
|
|
13
|
+
export declare function workspaceTargetProvider(target: WorkspaceSessionTarget): WorkspaceProvider | "";
|
|
14
|
+
/** target → 执行引擎;只有 Wand Agent 走 SDK,其余都是 CLI。 */
|
|
15
|
+
export declare function workspaceTargetEngine(target: WorkspaceSessionTarget): "cli" | "sdk" | undefined;
|
|
16
|
+
/** Agent 窗口的运行形态;空白终端固定为 PTY。 */
|
|
17
|
+
export type WorkspaceSessionKind = "structured" | "pty";
|
|
18
|
+
/**
|
|
19
|
+
* picker「AI 团队」分组的一项(§5.1 修正 B8)。
|
|
20
|
+
* 团队不进 WorkspaceSessionTarget 联合:它是并列的独立选择态,`teamId` 空串表示
|
|
21
|
+
* 这一次起的是会话,非空表示直接开工;提交链路按「会话 or 团队」分叉。
|
|
22
|
+
*/
|
|
23
|
+
export interface WorkspaceTeamOption {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
/** 分组项第二行的说明:成员数与擅长什么。 */
|
|
27
|
+
detail: string;
|
|
28
|
+
}
|
|
29
|
+
export type PaneTab = {
|
|
30
|
+
id: string;
|
|
31
|
+
kind: "session";
|
|
32
|
+
sessionId: string;
|
|
33
|
+
} | {
|
|
34
|
+
id: string;
|
|
35
|
+
kind: "editor";
|
|
36
|
+
path: string;
|
|
37
|
+
} | {
|
|
38
|
+
id: string;
|
|
39
|
+
kind: "preview";
|
|
40
|
+
path: string;
|
|
41
|
+
};
|
|
42
|
+
export type LayoutNode = {
|
|
43
|
+
type: "pane";
|
|
44
|
+
tabs: PaneTab[];
|
|
45
|
+
active: number;
|
|
46
|
+
} | {
|
|
47
|
+
type: "split";
|
|
48
|
+
dir: "h" | "v";
|
|
49
|
+
ratio: number;
|
|
50
|
+
children: [LayoutNode, LayoutNode];
|
|
51
|
+
};
|
|
52
|
+
/** 顶部的一个工作窗口 Tab;其内部可以是单终端,也可以是一棵分屏树。 */
|
|
53
|
+
export interface WorkWindowLayout {
|
|
54
|
+
id: string;
|
|
55
|
+
layout: LayoutNode;
|
|
56
|
+
/** 当前接受窗口级操作(移动、标题)的终端/内容标签。 */
|
|
57
|
+
activeTabId?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 任务级窗口集合。顶部 Tab 只映射这里的 windows;终端进入另一个窗口后,
|
|
61
|
+
* 来源 window 会被移除,终端本身成为目标 window 分屏树里的一个 pane。
|
|
62
|
+
*/
|
|
63
|
+
export interface TaskWindowLayout {
|
|
64
|
+
type: "windows";
|
|
65
|
+
windows: WorkWindowLayout[];
|
|
66
|
+
activeWindowId: string | null;
|
|
67
|
+
}
|
|
68
|
+
export interface Workspace {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
cwd: string;
|
|
72
|
+
kind?: "project" | "global";
|
|
73
|
+
defaultProvider?: WorkspaceProvider;
|
|
74
|
+
layout: LayoutNode | null;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
lastOpenedAt: string | null;
|
|
77
|
+
/** Number of task-owned worktrees currently registered under this project. */
|
|
78
|
+
worktreeCount?: number;
|
|
79
|
+
/** Number of sessions bound to this project (including task-owned ones). */
|
|
80
|
+
sessionCount?: number;
|
|
81
|
+
}
|
|
82
|
+
/** GET /api/workspaces/:id 额外带回该项目下的会话列表。 */
|
|
83
|
+
export interface WorkspaceSessionSummary {
|
|
84
|
+
id: string;
|
|
85
|
+
/** 实际运行引擎的只读投影,不把 Wand Agent 冒充 Pi CLI。 */
|
|
86
|
+
engine?: "core" | "cli";
|
|
87
|
+
provider?: WorkspaceProvider;
|
|
88
|
+
sessionKind?: string;
|
|
89
|
+
runner?: string;
|
|
90
|
+
command?: string;
|
|
91
|
+
title?: string;
|
|
92
|
+
titleGenerating?: boolean;
|
|
93
|
+
status?: string;
|
|
94
|
+
completionRevision?: number;
|
|
95
|
+
viewedCompletionRevision?: number;
|
|
96
|
+
cwd?: string;
|
|
97
|
+
startedAt?: string;
|
|
98
|
+
workspaceTaskId?: string;
|
|
99
|
+
ptyBusy?: boolean;
|
|
100
|
+
/** 空白终端中仍有前台命令;不是 provider 的生成回合。 */
|
|
101
|
+
ptyCommandRunning?: boolean;
|
|
102
|
+
/** 已归档:从正常列表收起,进「已归档」区,可恢复;归档 7 天后由保留期清理。 */
|
|
103
|
+
archived?: boolean;
|
|
104
|
+
archivedAt?: string | null;
|
|
105
|
+
providerCliActive?: boolean;
|
|
106
|
+
providerCliExitCode?: number | null;
|
|
107
|
+
inFlight?: boolean;
|
|
108
|
+
canArchive?: boolean;
|
|
109
|
+
employeeId?: string;
|
|
110
|
+
employeeName?: string;
|
|
111
|
+
employeeAvatar?: string;
|
|
112
|
+
/** 这条会话是 AI 团队的群聊 relay 会话;服务端 join ai_team_runs 后带上入口信息。 */
|
|
113
|
+
teamChat?: WorkspaceSessionTeamChat;
|
|
114
|
+
/** 这条会话是 AI 团队派发出来的成员工作会话;服务端 join ai_team_steps 后带上这一步的身份。 */
|
|
115
|
+
teamStep?: WorkspaceSessionTeamStep;
|
|
116
|
+
}
|
|
117
|
+
/** 群聊标记的数据来源:ai_team_runs 中该 chat_session_id 最近一次运行(服务端 AiTeamRunChatMarker)。 */
|
|
118
|
+
export interface WorkspaceSessionTeamChat {
|
|
119
|
+
teamId: string;
|
|
120
|
+
runId: string;
|
|
121
|
+
teamName: string;
|
|
122
|
+
chatTitle?: string;
|
|
123
|
+
memberCount: number;
|
|
124
|
+
}
|
|
125
|
+
/** 成员步骤标记的数据来源:ai_team_steps.session_id(服务端 AiTeamStepSessionMarker)。 */
|
|
126
|
+
export interface WorkspaceSessionTeamStep {
|
|
127
|
+
runId: string;
|
|
128
|
+
stepId: string;
|
|
129
|
+
/** leader = 负责人自己的回合,work = 派给成员干活的会话。 */
|
|
130
|
+
kind: string;
|
|
131
|
+
/** 这一步的任务标题,列表拿它当短标题,不等 CLI 生成会话名。 */
|
|
132
|
+
title: string;
|
|
133
|
+
memberId: string;
|
|
134
|
+
memberName: string;
|
|
135
|
+
teamName: string;
|
|
136
|
+
stepStatus: string;
|
|
137
|
+
runStatus: string;
|
|
138
|
+
/** 运行已进入终态:这一步的会话算历史,默认折起来、可以清空。 */
|
|
139
|
+
runFinished: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface WorkspaceDetail extends Workspace {
|
|
142
|
+
sessions: WorkspaceSessionSummary[];
|
|
143
|
+
}
|
|
144
|
+
type WorkspaceTaskStatus = "active" | "done";
|
|
145
|
+
/** 任务所属 worktree 信息;非 git 目录时为 null(退化为直接在项目目录运行)。 */
|
|
146
|
+
interface WorkspaceTaskWorktree {
|
|
147
|
+
branch: string;
|
|
148
|
+
path: string;
|
|
149
|
+
baseRef?: string;
|
|
150
|
+
repoRoot?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface WorkspaceTask {
|
|
153
|
+
canArchive?: boolean;
|
|
154
|
+
id: string;
|
|
155
|
+
workspaceId: string;
|
|
156
|
+
name: string;
|
|
157
|
+
worktree: WorkspaceTaskWorktree | null;
|
|
158
|
+
cwd?: string;
|
|
159
|
+
/** 归属里程碑(全局列表);null = 未归入。建任务时同步到看板卡片。 */
|
|
160
|
+
milestoneId?: string | null;
|
|
161
|
+
layout: TaskWindowLayout | null;
|
|
162
|
+
status: WorkspaceTaskStatus;
|
|
163
|
+
archived?: boolean;
|
|
164
|
+
createdAt: string;
|
|
165
|
+
lastOpenedAt: string | null;
|
|
166
|
+
layoutRevision?: number;
|
|
167
|
+
}
|
|
168
|
+
/** POST/GET 任务路由的返回:在 WorkspaceTask 基础上带回运行期派生字段。 */
|
|
169
|
+
export interface WorkspaceTaskDetail extends WorkspaceTask {
|
|
170
|
+
/** 任务实际运行目录(worktree 路径,或非 git 时回退到项目目录)。 */
|
|
171
|
+
cwd: string;
|
|
172
|
+
/** 是否隔离(有独立 worktree)。 */
|
|
173
|
+
isolated: boolean;
|
|
174
|
+
/** 非 git / 基线缺失时的降级提示。 */
|
|
175
|
+
worktreeError?: string;
|
|
176
|
+
/** 该任务下已绑定的会话。 */
|
|
177
|
+
sessions: WorkspaceSessionSummary[];
|
|
178
|
+
}
|
|
179
|
+
/** GET /api/tasks 聚合行:任务 + 运行期派生字段;目录信息在 TaskDirectoryGroup 上。 */
|
|
180
|
+
export type TaskSummary = WorkspaceTaskDetail & {
|
|
181
|
+
/** 使用 maxSessions 截断时的真实会话总数(未截断时等于 sessions.length)。 */
|
|
182
|
+
totalSessions?: number;
|
|
183
|
+
/** 已归档的会话:不进正常列表,在任务下单独收起,可恢复。 */
|
|
184
|
+
archivedSessions?: WorkspaceSessionSummary[];
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* GET /api/tasks 返回的目录组:任务一级容器的分组维度。
|
|
188
|
+
* 未绑定任务的会话以 standaloneSessions 归入所在目录(synthetic 组表示该
|
|
189
|
+
* 目录没有项目实体,仅用于展示,不能在其中建任务)。
|
|
190
|
+
*/
|
|
191
|
+
export interface TaskDirectoryGroup {
|
|
192
|
+
workspaceId: string;
|
|
193
|
+
workspaceName: string;
|
|
194
|
+
workspaceCwd: string;
|
|
195
|
+
/** Folder birth time. New folders sort first; opening never changes this. */
|
|
196
|
+
createdAt?: string;
|
|
197
|
+
synthetic?: boolean;
|
|
198
|
+
/** Hidden global workspace that holds standalone tasks. */
|
|
199
|
+
global?: boolean;
|
|
200
|
+
tasks: TaskSummary[];
|
|
201
|
+
standaloneSessions: WorkspaceSessionSummary[];
|
|
202
|
+
/** 该目录下未绑定任务的已归档会话。 */
|
|
203
|
+
archivedSessions?: WorkspaceSessionSummary[];
|
|
204
|
+
}
|
|
205
|
+
export type WorkspaceWorktreeState = "ready" | "dirty" | "conflict" | "empty" | "unavailable";
|
|
206
|
+
interface WorkspaceWorktreeCommit {
|
|
207
|
+
hash: string;
|
|
208
|
+
shortHash: string;
|
|
209
|
+
subject: string;
|
|
210
|
+
}
|
|
211
|
+
export interface WorkspaceWorktreeReview {
|
|
212
|
+
taskId: string;
|
|
213
|
+
taskName: string;
|
|
214
|
+
taskStatus: WorkspaceTaskStatus;
|
|
215
|
+
branch: string;
|
|
216
|
+
path: string;
|
|
217
|
+
baseRef: string;
|
|
218
|
+
state: WorkspaceWorktreeState;
|
|
219
|
+
actionable: boolean;
|
|
220
|
+
reason: string;
|
|
221
|
+
aheadCount: number;
|
|
222
|
+
hasUncommittedChanges: boolean;
|
|
223
|
+
hasConflicts: boolean;
|
|
224
|
+
commits: readonly WorkspaceWorktreeCommit[];
|
|
225
|
+
}
|
|
226
|
+
export interface WorkspaceWorktreeOverview {
|
|
227
|
+
workspaceId: string;
|
|
228
|
+
repoRoot: string;
|
|
229
|
+
targetBranch: string;
|
|
230
|
+
worktrees: readonly WorkspaceWorktreeReview[];
|
|
231
|
+
}
|
|
232
|
+
export interface CreateWorkspaceTaskRequest {
|
|
233
|
+
name?: string;
|
|
234
|
+
/** 首个会话的提示词:任务留空名时用它总结标题,并同步到看板卡片描述。 */
|
|
235
|
+
description?: string;
|
|
236
|
+
baseRef?: string;
|
|
237
|
+
/** Optional directory override, used by standalone tasks that mount a folder. */
|
|
238
|
+
cwd?: string;
|
|
239
|
+
/** 显式 false 时跳过独立 worktree,会话直接跑在项目目录;缺省为 true。 */
|
|
240
|
+
worktree?: boolean;
|
|
241
|
+
/** 里程碑 id;null / 缺省表示不归入里程碑。 */
|
|
242
|
+
milestoneId?: string | null;
|
|
243
|
+
}
|
|
244
|
+
export interface CreateStandaloneTaskRequest {
|
|
245
|
+
name?: string;
|
|
246
|
+
/** 首个会话的提示词:任务留空名时用它总结标题,并同步到看板卡片描述。 */
|
|
247
|
+
description?: string;
|
|
248
|
+
cwd?: string;
|
|
249
|
+
worktree?: boolean;
|
|
250
|
+
/** 里程碑 id;null / 缺省表示不归入里程碑。 */
|
|
251
|
+
milestoneId?: string | null;
|
|
252
|
+
}
|
|
253
|
+
export interface UpdateWorkspaceTaskRequest {
|
|
254
|
+
name?: string;
|
|
255
|
+
status?: WorkspaceTaskStatus;
|
|
256
|
+
milestoneId?: string | null;
|
|
257
|
+
}
|
|
258
|
+
export interface CreateWorkspaceRequest {
|
|
259
|
+
name: string;
|
|
260
|
+
cwd: string;
|
|
261
|
+
defaultProvider?: WorkspaceProvider;
|
|
262
|
+
}
|
|
263
|
+
export interface UpdateWorkspaceRequest {
|
|
264
|
+
name?: string;
|
|
265
|
+
cwd?: string;
|
|
266
|
+
defaultProvider?: WorkspaceProvider | null;
|
|
267
|
+
}
|
|
268
|
+
export interface RecentPath {
|
|
269
|
+
path: string;
|
|
270
|
+
name: string;
|
|
271
|
+
}
|
|
272
|
+
export interface NewProjectDefaults {
|
|
273
|
+
defaultProvider: WorkspaceProvider;
|
|
274
|
+
/** 默认执行引擎;只对 pi 有意义(`sdk` = Wand Agent)。 */
|
|
275
|
+
defaultEngine?: "cli" | "sdk";
|
|
276
|
+
defaultCwd: string;
|
|
277
|
+
defaultSessionKind: WorkspaceSessionKind;
|
|
278
|
+
defaultTaskWorktree: boolean;
|
|
279
|
+
recentPaths: RecentPath[];
|
|
280
|
+
}
|
|
281
|
+
export interface WorkspacesRepository {
|
|
282
|
+
list(): Promise<Workspace[]>;
|
|
283
|
+
/** 目录分组的任务聚合列表(GET /api/tasks),供侧栏「任务」视图一次拉全。 */
|
|
284
|
+
listTaskGroups(revision?: string): Promise<{
|
|
285
|
+
groups: TaskDirectoryGroup[];
|
|
286
|
+
revision?: string;
|
|
287
|
+
unchanged: boolean;
|
|
288
|
+
}>;
|
|
289
|
+
get(id: string): Promise<WorkspaceDetail>;
|
|
290
|
+
create(request: CreateWorkspaceRequest): Promise<Workspace>;
|
|
291
|
+
update(id: string, patch: UpdateWorkspaceRequest): Promise<Workspace>;
|
|
292
|
+
remove(id: string, cascade?: boolean): Promise<void>;
|
|
293
|
+
saveLayout(id: string, layout: LayoutNode | null): Promise<LayoutNode | null>;
|
|
294
|
+
/**
|
|
295
|
+
* 重命名目录(工作区显示名)。服务端会同时同步项目名,
|
|
296
|
+
* 保证任务列表 / 项目列表 / 原生客户端显示同一个名字。
|
|
297
|
+
*/
|
|
298
|
+
renameDirectory(cwd: string, name: string | null): Promise<void>;
|
|
299
|
+
listTasks(workspaceId: string): Promise<WorkspaceTask[]>;
|
|
300
|
+
createTask(workspaceId: string, request: CreateWorkspaceTaskRequest): Promise<WorkspaceTaskDetail>;
|
|
301
|
+
createStandaloneTask(request: CreateStandaloneTaskRequest): Promise<WorkspaceTaskDetail>;
|
|
302
|
+
getTask(taskId: string): Promise<WorkspaceTaskDetail>;
|
|
303
|
+
updateTask(taskId: string, patch: UpdateWorkspaceTaskRequest): Promise<WorkspaceTask>;
|
|
304
|
+
deleteTask(taskId: string, cascade?: boolean): Promise<void>;
|
|
305
|
+
/** 归档任务:保留终端与 worktree,仅从侧栏隐藏并移入看板归档。 */
|
|
306
|
+
archiveTask(taskId: string): Promise<WorkspaceTask>;
|
|
307
|
+
/** 归档会停止会话、保留 session id;恢复时用这个 ID 续上。 */
|
|
308
|
+
archiveSession(sessionId: string, archived: boolean): Promise<void>;
|
|
309
|
+
/** 批量归档 / 恢复会话。 */
|
|
310
|
+
batchArchiveSessions(sessionIds: readonly string[], archived: boolean): Promise<void>;
|
|
311
|
+
saveTaskLayout(taskId: string, layout: TaskWindowLayout | null, layoutRevision?: number): Promise<{
|
|
312
|
+
layout: TaskWindowLayout | null;
|
|
313
|
+
layoutRevision?: number;
|
|
314
|
+
}>;
|
|
315
|
+
/** Project-level review data used by the multi-worktree merge Agent launcher. */
|
|
316
|
+
listWorktrees(workspaceId: string, options?: {
|
|
317
|
+
signal?: AbortSignal;
|
|
318
|
+
}): Promise<WorkspaceWorktreeOverview>;
|
|
319
|
+
/** 关闭工作窗口 / 终端时批量结束并删除其底层会话。 */
|
|
320
|
+
deleteSessions(sessionIds: readonly string[]): Promise<void>;
|
|
321
|
+
}
|
|
322
|
+
/** 打开任务时传给宿主的载荷:足够启动一个绑定到该任务的会话。 */
|
|
323
|
+
export interface OpenWorkspaceTaskPayload {
|
|
324
|
+
workspaceId: string;
|
|
325
|
+
workspaceName: string;
|
|
326
|
+
taskId: string;
|
|
327
|
+
taskName: string;
|
|
328
|
+
cwd: string;
|
|
329
|
+
provider?: WorkspaceProvider;
|
|
330
|
+
/**
|
|
331
|
+
* 恢复这个任务的标签布局时优先选中的会话(侧栏 / 通知点了哪一个就恢复哪一个)。
|
|
332
|
+
* 不传时沿用旧行为:当前选中 → 布局里存的活跃标签 → 第一个会话。
|
|
333
|
+
*/
|
|
334
|
+
preferredSessionId?: string;
|
|
335
|
+
}
|
|
336
|
+
/** 标签栏「+ 新建会话」时传给宿主:在同一任务 worktree 内再起一个绑定会话。 */
|
|
337
|
+
export interface NewTaskSessionPayload {
|
|
338
|
+
workspaceId: string;
|
|
339
|
+
/** 缺省表示这次不绑定任务:会话落在所在目录的「未分组任务」里。 */
|
|
340
|
+
taskId?: string;
|
|
341
|
+
cwd: string;
|
|
342
|
+
target: WorkspaceSessionTarget;
|
|
343
|
+
kind?: WorkspaceSessionKind;
|
|
344
|
+
prompt?: string;
|
|
345
|
+
/** 启动会话时使用的模型 id;空串表示跟随服务端默认。 */
|
|
346
|
+
model?: string;
|
|
347
|
+
/** Structured-only employee identity; the server resolves its ordered CLI candidates. */
|
|
348
|
+
employeeId?: string;
|
|
349
|
+
}
|
|
350
|
+
interface StartWorkspaceMergeAgentPayload {
|
|
351
|
+
workspaceId: string;
|
|
352
|
+
cwd: string;
|
|
353
|
+
provider?: WorkspaceProvider;
|
|
354
|
+
/** 角色与规则:走会话的系统提示,不拼进 prompt。 */
|
|
355
|
+
systemPrompt: string;
|
|
356
|
+
prompt: string;
|
|
357
|
+
}
|
|
358
|
+
export interface TaskLayoutSaveOptions {
|
|
359
|
+
/** Reconciliation/restoration is not a new user edit after a failed save. */
|
|
360
|
+
automatic?: boolean;
|
|
361
|
+
}
|
|
362
|
+
export interface WorkspacesRuntimeAdapter {
|
|
363
|
+
/** 对话框打开/关闭的副作用钩子(关其它覆盖层等)。 */
|
|
364
|
+
onOpen(): void;
|
|
365
|
+
onClose(): void;
|
|
366
|
+
/** 当前有效工作目录,作为新建项目目录的默认值。 */
|
|
367
|
+
effectiveCwd(): string;
|
|
368
|
+
/** 项目创建成功后:设为活动工作空间(打开工作空间窗口)。 */
|
|
369
|
+
openWorkspace(workspace: Workspace): void;
|
|
370
|
+
/** 关闭当前工作空间 / 任务上下文。 */
|
|
371
|
+
closeWorkspace(): void;
|
|
372
|
+
/** 删除任务 / 项目后立即刷新会话列表,清掉已删除会话的选中态。 */
|
|
373
|
+
refreshSessions(): void | Promise<unknown>;
|
|
374
|
+
/** 选中并打开一个已有会话(项目里的独立会话与会话列表共用同一条记录)。 */
|
|
375
|
+
selectSession(sessionId: string): void;
|
|
376
|
+
/**
|
|
377
|
+
* 点击任务:只恢复任务上下文与已有会话;空任务保持欢迎页。
|
|
378
|
+
* 返回 Promise 时表示详情恢复完成;调用方若紧接着要在该任务里建会话,
|
|
379
|
+
* 必须先 await,避免恢复流程用旧快照覆盖新会话的选中态。
|
|
380
|
+
*/
|
|
381
|
+
openTask(payload: OpenWorkspaceTaskPayload): void | Promise<void>;
|
|
382
|
+
/** 标签栏「+」:在该任务 worktree 再起一个绑定会话;taskId 缺省时起未分组会话。 */
|
|
383
|
+
newTaskSession(payload: NewTaskSessionPayload): void | Promise<unknown>;
|
|
384
|
+
/**
|
|
385
|
+
* 某个 CLI 工具「上次用过的模型」;新建任务 / 工作窗口用它预选模型。
|
|
386
|
+
* 与输入框 composer 的按 provider 记忆同源,空串表示还没选过。
|
|
387
|
+
*/
|
|
388
|
+
modelPreference(provider: WorkspaceProvider): string;
|
|
389
|
+
/** 用户在创建时选了模型:写回按 provider 的记忆,下一次默认沿用。 */
|
|
390
|
+
rememberModelPreference(provider: WorkspaceProvider, model: string): void;
|
|
391
|
+
/** Start one managed Agent at the project checkout to merge selected task worktrees. */
|
|
392
|
+
startWorktreeMergeAgent(payload: StartWorkspaceMergeAgentPayload): void | Promise<unknown>;
|
|
393
|
+
/** 工作窗口 / 分屏布局变更后回写持久化 + 更新活动上下文。 */
|
|
394
|
+
saveTaskLayout(layout: TaskWindowLayout | null, options?: TaskLayoutSaveOptions): void | Promise<unknown>;
|
|
395
|
+
/** 确认并关闭底层会话;取消或失败时返回 false,调用方不得移除布局。 */
|
|
396
|
+
closeTaskSessions(sessionIds: readonly string[], scope: "window" | "terminal"): Promise<boolean>;
|
|
397
|
+
/** 在指定容器内为某会话挂一个池终端实例(分屏窗格内容)。幂等。 */
|
|
398
|
+
mountSessionTerminal(sessionId: string, container: HTMLElement): boolean;
|
|
399
|
+
/** 释放某会话的池终端实例(窗格卸载 / 标签关闭)。 */
|
|
400
|
+
unmountSessionTerminal(sessionId: string): void;
|
|
401
|
+
/** 读取 / 更新单个池终端的独立缩放比例。 */
|
|
402
|
+
getSessionTerminalScale(sessionId: string): number;
|
|
403
|
+
setSessionTerminalScale(sessionId: string, scale: number): number;
|
|
404
|
+
/** 释放全部池终端(退出工作空间窗口)。 */
|
|
405
|
+
disposeAllSessionTerminals(): void;
|
|
406
|
+
toast(message: string, tone?: "info" | "success" | "warning" | "danger"): void;
|
|
407
|
+
}
|
|
408
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// 工作空间(项目)前端类型。镜像 src/types.ts 的 Workspace/LayoutNode/PaneTab,
|
|
2
|
+
// provider 联合沿用浏览器层共享的 provider-identity(不把服务端 types 拉进浏览器 bundle)。
|
|
3
|
+
import { WAND_AGENT_TOOL_ID } from "../../provider-identity.js";
|
|
4
|
+
/**
|
|
5
|
+
* target → provider。Wand Agent 也用 pi provider 开会话,只是引擎是进程内 SDK。
|
|
6
|
+
* Shell 没有 provider,返回空串。
|
|
7
|
+
*/
|
|
8
|
+
export function workspaceTargetProvider(target) {
|
|
9
|
+
if (target === "shell")
|
|
10
|
+
return "";
|
|
11
|
+
return target === WAND_AGENT_TOOL_ID ? "pi" : target;
|
|
12
|
+
}
|
|
13
|
+
/** target → 执行引擎;只有 Wand Agent 走 SDK,其余都是 CLI。 */
|
|
14
|
+
export function workspaceTargetEngine(target) {
|
|
15
|
+
return target === WAND_AGENT_TOOL_ID ? "sdk" : undefined;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const PROVIDER_CLI_IDS = new Set(["claude", "codex", "opencode", "grok", "qoder", "pi"
|
|
1
|
+
const PROVIDER_CLI_IDS = new Set(["claude", "codex", "opencode", "grok", "qoder", "pi"]);
|
|
2
2
|
function isStructured(session) {
|
|
3
3
|
return session.sessionKind === "structured" || session.runner === "claude-cli-print";
|
|
4
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@co0ontty/wand",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.94.0",
|
|
4
4
|
"description": "A web console for Claude Code, Codex, OpenCode, and other local CLI tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dev": "node scripts/check-node-version.js && node scripts/bundle-tailwind.js && node scripts/bundle-xterm.js && node scripts/bundle-qrcode.js && node scripts/bundle-browser.js --development && npm run generate:web-assets && tsx src/cli.ts web",
|
|
39
39
|
"check": "node src/deployment-lock.ts --run-project -- npm run check:body",
|
|
40
40
|
"check:body": "node scripts/check-node-version.js && node scripts/bundle-tailwind.js && node scripts/bundle-xterm.js && node scripts/bundle-qrcode.js && node scripts/bundle-browser.js && npm run generate:web-assets && tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p tsconfig.react.json",
|
|
41
|
-
"test": "node scripts/check-node-version.js && node
|
|
41
|
+
"test": "node scripts/check-node-version.js && node scripts/run-tests.js",
|
|
42
42
|
"check:bundle-budget": "node scripts/check-node-version.js && node scripts/check-bundle-budget.js",
|
|
43
43
|
"sync:brand-assets": "node scripts/sync-brand-assets.js",
|
|
44
44
|
"check:brand-assets": "node scripts/sync-brand-assets.js --check",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import type { StructuredExecHost } from "./structured-exec-host.js";
|
|
3
|
-
import type { StructuredRunnerAdapter, StructuredRunnerContext, StructuredRunnerExecution, StructuredRunnerObserver, StructuredRunnerTurnState } from "./structured-runner.js";
|
|
4
|
-
import type { SessionSnapshot } from "./types.js";
|
|
5
|
-
export type GeminiTurnState = StructuredRunnerTurnState;
|
|
6
|
-
/**
|
|
7
|
-
* Gemini CLI 的会话写在 `~/.gemini/tmp/<project_hash>/chats/`。ID 找不回来时 headless
|
|
8
|
-
* 会以 42 退出并打印下面这句,识别出来才能丢掉失效的 resume ID 重开一轮
|
|
9
|
-
* (与 Claude / Pi 的同类兜底一致)。
|
|
10
|
-
*/
|
|
11
|
-
export declare function isMissingGeminiSession(error: string | null | undefined): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* approval mode 映射。结构化 runner 没有权限桥,`default` 下需要确认的工具调用会被
|
|
14
|
-
* 直接拒绝;`yolo` 才是能连续干活的那一档。
|
|
15
|
-
*/
|
|
16
|
-
export declare function geminiApprovalMode(session: SessionSnapshot): "default" | "auto_edit" | "yolo";
|
|
17
|
-
/**
|
|
18
|
-
* `-p ""` 只把 CLI 钉在 headless 模式,真正的 prompt 走 stdin(Gemini CLI 把 stdin
|
|
19
|
-
* 内容与 `-p` 内容用空行拼接,`-p` 为空时只剩 stdin)。这样长消息不撞 argv 上限,
|
|
20
|
-
* 也不会出现在 `ps` 里。
|
|
21
|
-
*
|
|
22
|
-
* `--skip-trust` 必须带:headless 模式下 Gemini CLI 会检查工作区信任状态,未信任的
|
|
23
|
-
* 目录会直接以 55 退出,并把 `--approval-mode` 降级成 `default`。Wand 是在用户自己
|
|
24
|
-
* 选定的工作目录里代表用户启动这个 CLI,与其它 provider 的 auto-approve 语义一致。
|
|
25
|
-
*/
|
|
26
|
-
export declare function buildGeminiArgs(session: SessionSnapshot): string[];
|
|
27
|
-
export declare function geminiToolName(name: string): string;
|
|
28
|
-
/**
|
|
29
|
-
* Apply one Gemini CLI `--output-format stream-json` event.
|
|
30
|
-
*
|
|
31
|
-
* assistant `message` 事件带 `delta: true`,每个 chunk 是增量而不是快照,所以文本是
|
|
32
|
-
* 追加而不是替换。tool_use / tool_result 由 CLI 直接按 tool_id 配对,不需要 upsert。
|
|
33
|
-
*/
|
|
34
|
-
export declare function applyGeminiEvent(state: GeminiTurnState, event: Record<string, unknown>): string | null;
|
|
35
|
-
export declare class GeminiRunner implements StructuredRunnerAdapter {
|
|
36
|
-
private readonly spawnProcess;
|
|
37
|
-
private readonly execHost?;
|
|
38
|
-
constructor(spawnProcess?: typeof spawn, execHost?: StructuredExecHost | undefined);
|
|
39
|
-
start(context: StructuredRunnerContext, observer: StructuredRunnerObserver): StructuredRunnerExecution;
|
|
40
|
-
}
|