@sanqianx/claude-ai-workbench 0.13.2 → 0.13.4
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/LICENSE +201 -201
- package/README.md +156 -156
- package/apps/agent-terminal/app.css +652 -613
- package/apps/agent-terminal/app.js +143 -67
- package/apps/agent-terminal/conversation-composer.js +44 -0
- package/apps/agent-terminal/index.html +172 -170
- package/apps/agent-terminal/panel-host-proof.html +152 -152
- package/apps/agent-terminal/panel-proof-content.html +41 -41
- package/apps/agent-terminal/right-workspace-dock.css +189 -159
- package/apps/agent-terminal/right-workspace-dock.js +652 -521
- package/apps/agent-terminal/user-question-card.js +68 -0
- package/apps/ai-profile-settings-host/index.html +25 -25
- package/apps/ai-profile-settings-host/page.css +1 -1
- package/apps/ai-profile-settings-host/page.js +113 -113
- package/apps/minimal-test-host/README.md +15 -15
- package/apps/minimal-test-host/host.css +2 -2
- package/apps/minimal-test-host/host.js +35 -35
- package/apps/minimal-test-host/index.html +58 -58
- package/apps/minimal-test-host/optional-mock/fault-injection.js +15 -15
- package/docs/sdk/FILE_LAYOUT.md +31 -31
- package/docs/sdk/INTEGRATION.md +126 -126
- package/docs/sdk/README.md +21 -21
- package/docs/sdk/SESSION_EVENTS.md +15 -13
- package/docs/sdk/openapi.yaml +16 -1
- package/package.json +1 -1
- package/packages/client/README.md +29 -29
- package/packages/client/index.d.ts +122 -122
- package/packages/client/index.js +260 -260
- package/packages/client/package.json +2 -2
- package/packages/contracts/README.md +9 -9
- package/packages/contracts/index.d.ts +519 -517
- package/packages/contracts/index.js +312 -312
- package/packages/contracts/package.json +1 -1
- package/packages/core/README.md +8 -8
- package/packages/core/index.d.ts +76 -76
- package/packages/core/index.js +222 -222
- package/packages/core/package.json +2 -2
- package/packages/server/README.md +17 -17
- package/packages/server/bin/agent-terminal-server.js +42 -42
- package/packages/server/bin/claude-workbench.js +225 -225
- package/packages/server/index.d.ts +171 -171
- package/packages/server/index.js +230 -230
- package/packages/server/lib/agent-discovery.js +133 -133
- package/packages/server/lib/agent-registry.js +143 -143
- package/packages/server/lib/agent-spawn-env.js +17 -17
- package/packages/server/lib/attachment-store.js +78 -78
- package/packages/server/lib/bridges/app-server-bridge.js +373 -373
- package/packages/server/lib/bridges/opencode-server-bridge.js +506 -506
- package/packages/server/lib/capture-settings-store.js +35 -35
- package/packages/server/lib/claude-history-recovery.js +87 -87
- package/packages/server/lib/cli-session-recovery.js +28 -28
- package/packages/server/lib/context-resolver.js +55 -55
- package/packages/server/lib/conversation-capture.js +51 -51
- package/packages/server/lib/delegation-phase-store.js +357 -357
- package/packages/server/lib/delegation-store.js +474 -468
- package/packages/server/lib/diagnostics.js +32 -32
- package/packages/server/lib/drivers/cli-json-runner.js +974 -974
- package/packages/server/lib/drivers/codex-driver.js +1461 -1442
- package/packages/server/lib/drivers/opencode-driver.js +1554 -1554
- package/packages/server/lib/drivers/zcode-driver.js +1250 -1250
- package/packages/server/lib/drivers/zcode-profile-runtime.js +71 -71
- package/packages/server/lib/event-stream.js +138 -138
- package/packages/server/lib/folder-picker.js +623 -623
- package/packages/server/lib/http-handler.js +339 -339
- package/packages/server/lib/json-file.js +26 -26
- package/packages/server/lib/knowledge-context.js +33 -33
- package/packages/server/lib/model-detection.js +295 -295
- package/packages/server/lib/parent-context.js +44 -0
- package/packages/server/lib/profile-store.js +283 -283
- package/packages/server/lib/project-store.js +102 -102
- package/packages/server/lib/runtime-loader.js +120 -120
- package/packages/server/lib/session-archive-store.js +53 -53
- package/packages/server/lib/session-history.js +612 -612
- package/packages/server/lib/system-doctor.js +125 -125
- package/packages/server/lib/ui-preferences-store.js +48 -48
- package/packages/server/lib/user-questions.js +67 -0
- package/packages/server/lib/workbench-service.js +1696 -1675
- package/packages/server/package.json +2 -2
- package/packages/ui/README.md +30 -30
- package/packages/ui/ai-profile-settings.d.ts +45 -45
- package/packages/ui/ai-profile-settings.js +283 -283
- package/packages/ui/claude-terminal.d.ts +31 -31
- package/packages/ui/claude-terminal.js +343 -343
- package/packages/ui/index.d.ts +18 -18
- package/packages/ui/index.js +51 -51
- package/packages/ui/package.json +2 -2
- package/packages/ui/theme.css +13 -13
- package/src/assets/claude-prompts.json +21 -21
- package/src/backend/http/ai-profile-routes.js +61 -61
- package/src/backend/http/claude-routes.js +170 -170
- package/src/backend/http/node-helpers.js +45 -45
- package/src/backend/index.js +21 -21
- package/src/backend/lib/ai-adapter.js +144 -144
- package/src/backend/lib/ai-profile-store.js +259 -259
- package/src/backend/lib/ai-vendor-presets.js +83 -83
- package/src/backend/lib/ai-workspace.js +140 -140
- package/src/backend/lib/automation-config.js +253 -253
- package/src/backend/lib/claude-cli-runner.js +2408 -2392
- package/src/backend/lib/data-dir.js +169 -169
- package/src/backend/lib/llm-client.js +176 -176
- package/src/backend/lib/model-context-windows.js +82 -82
- package/src/backend/lib/native-task-control.js +217 -217
- package/src/backend/lib/native-task-history-index.js +475 -475
- package/src/backend/lib/native-task-history-reader.js +526 -526
- package/src/backend/lib/native-task-messages.js +457 -457
- package/src/backend/lib/native-task-registry.js +325 -325
- package/src/backend/lib/native-task-runtime.js +242 -242
- package/src/backend/lib/native-task-trace.js +440 -440
- package/src/backend/lib/native-task-transcript.js +393 -393
- package/src/backend/lib/prompt-registry.js +166 -166
- package/src/backend/lib/runtime-config.js +121 -121
- package/src/backend/lib/sdk-session-stream.js +143 -143
- package/src/backend/lib/sdk-turn-stream.js +16 -16
- package/src/backend/lib/store-scope.js +131 -131
- package/src/backend/lib/task-identity.js +104 -104
- package/src/backend/lib/task-state-projection.js +58 -58
- package/src/index.js +7 -7
- package/src/sdk-wave-a.ts +1 -1
- package/src/sdk-wave-b.ts +1 -1
- package/src/sdk-wave-c.ts +1 -1
- package/src/sdk-wave-d.ts +1 -1
- package/src/sdk-wave-e.ts +1 -1
|
@@ -1,170 +1,172 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<title>Agent Terminal</title>
|
|
7
|
-
<link rel="stylesheet" href="./app.css">
|
|
8
|
-
<link rel="stylesheet" href="./right-workspace-dock.css">
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
|
|
12
|
-
<!-- ============ 终端视图 ============ -->
|
|
13
|
-
<div id="view-terminal" class="view active" inert aria-busy="true">
|
|
14
|
-
<aside class="sidebar">
|
|
15
|
-
<div class="brand"><h1><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m5 8 4 4-4 4"/><path d="M13 16h6"/></svg>Agent Terminal</h1><span class="ver" id="app-version"></span></div>
|
|
16
|
-
<button class="new-session" id="btn-new-session"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg><span>新会话</span></button>
|
|
17
|
-
<div class="session-scroll">
|
|
18
|
-
<div class="group-label">项目</div>
|
|
19
|
-
<div id="project-list"></div>
|
|
20
|
-
<button class="add-proj" id="btn-add-proj"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg><span>添加项目</span></button>
|
|
21
|
-
<button class="arch-toggle" id="arch-toggle" type="button" aria-expanded="true">
|
|
22
|
-
<span class="toggle-caret" id="arch-caret"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span>
|
|
23
|
-
<span>已归档</span>
|
|
24
|
-
<span class="arch-count" id="arch-count" hidden></span>
|
|
25
|
-
</button>
|
|
26
|
-
<div class="arch-list" id="arch-list"><div class="proj-empty" id="arch-empty">暂无归档会话</div></div>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="sidebar-foot">
|
|
29
|
-
<span class="dot" id="agent-dot"></span>
|
|
30
|
-
<span style="flex:1" id="agent-summary">扫描中…</span>
|
|
31
|
-
<button class="ghost" id="open-settings" title="设置"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M19 12a7 7 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 0 0-2-1.2L14 3h-4l-.5 2.6a7 7 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7 7 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7 7 0 0 0 2 1.2L10 21h4l.5-2.6a7 7 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6c.06-.4.1-.8.1-1.2z"/></svg></button>
|
|
32
|
-
</div>
|
|
33
|
-
</aside>
|
|
34
|
-
|
|
35
|
-
<div class="main">
|
|
36
|
-
<div class="top-strip">
|
|
37
|
-
<span class="t" id="session-title">正在加载工作台…</span>
|
|
38
|
-
<span class="session-provider" id="session-provider"></span>
|
|
39
|
-
<span class="st" id="session-status" hidden><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l1.9 5.8L20 12l-6.1 3.2L12 21l-1.9-5.8L4 12l6.1-3.2z"/></svg><span id="session-status-text"></span></span>
|
|
40
|
-
<span style="flex:1"></span>
|
|
41
|
-
<button class="ghost" id="btn-dock-toggle" title="任务面板(原生后台任务)" aria-expanded="false" aria-controls="right-dock" hidden><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v14H4z" fill="none" stroke="currentColor" stroke-width="2"/><path d="M15 5v14" stroke="currentColor" stroke-width="2"/></svg><span class="rd-toggle-count" hidden></span></button>
|
|
42
|
-
<button class="ghost" id="btn-top-settings" title="设置(模型供应商)"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.01a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h.01a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.01a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg></button>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<div class="stream" id="stream" tabindex="0" aria-label="会话记录">
|
|
46
|
-
<div class="history-bar" id="history-bar" hidden>
|
|
47
|
-
<button class="linklike" id="history-more" type="button">加载更早记录</button>
|
|
48
|
-
<span id="history-status" role="status"></span>
|
|
49
|
-
</div>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
<div class="empty-hint" id="empty-hint">
|
|
53
|
-
<div class="big"><span class="hint-wrap"><span class="hint-art"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m5 8 4 4-4 4"/><path d="M13 16h6"/></svg></span><span class="hint-spark"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l1.9 5.8L20 12l-6.1 3.2L12 21l-1.9-5.8L4 12l6.1-3.2z"/></svg></span></span></div>
|
|
54
|
-
<p class="standalone-hint">从左侧选择一个项目,或 <button class="linklike" id="hint-add-proj">添加项目</button> 开始。<br>
|
|
55
|
-
新会话将使用底部选中的 Agent 与模型。</p>
|
|
56
|
-
<p class="embedded-hint">输入当前项目的任务,开始新会话。<br>相关知识会在发送前检索,并在右侧显示来源。</p>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<button class="jump-latest" id="jump-latest" title="回到底部" hidden><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14"/><path d="m19 12-7 7-7-7"/></svg><span>回到底部</span></button>
|
|
62
|
-
|
|
63
|
-
<div class="composer-wrap">
|
|
64
|
-
<div class="composer" id="composer">
|
|
65
|
-
<textarea id="chat-input" placeholder="给当前会话发送消息" rows="1"></textarea>
|
|
66
|
-
<div class="cmdrow">
|
|
67
|
-
<button class="bar-btn plus" id="btn-attach" title="添加图片或文本文件(txt、md、json、csv;文本每件最多 512KB)"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button>
|
|
68
|
-
<input type="file" id="file-input" accept="image/jpeg,image/png,image/gif,image/webp,.txt,.md,.json,.csv" multiple hidden>
|
|
69
|
-
<span class="anchor">
|
|
70
|
-
<button class="bar-btn mode" id="btn-mode" title="权限模式"><span class="shield"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/></svg></span> <span id="mode-label">默认防护</span> <span class="chev"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span></button>
|
|
71
|
-
<div class="pop from-left" id="pop-mode" hidden></div>
|
|
72
|
-
</span>
|
|
73
|
-
<span class="cmd-spacer"></span>
|
|
74
|
-
<span class="anchor">
|
|
75
|
-
<button class="bar-btn" id="btn-ctx" title="上下文用量" hidden><span id="ctx-label"></span></button>
|
|
76
|
-
<div class="pop from-right ctx-pop" id="pop-ctx" hidden></div>
|
|
77
|
-
</span>
|
|
78
|
-
<span class="anchor model-anchor">
|
|
79
|
-
<button class="bar-btn" id="btn-model" title="选择供应商与模型"><span id="model-label">Agent 自身登录 · 默认模型</span> <span class="chev"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span></button>
|
|
80
|
-
<div class="pop from-right" id="pop-model" hidden></div>
|
|
81
|
-
</span>
|
|
82
|
-
<span class="anchor" id="effort-anchor" hidden>
|
|
83
|
-
<button class="bar-btn" id="btn-effort" title="推理力度"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15l3.5-3.5"/><path d="M20.5 14a9 9 0 1 0-17 0"/></svg><span id="effort-label">高</span> <span class="chev"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span></button>
|
|
84
|
-
<div class="pop from-right" id="pop-effort" hidden></div>
|
|
85
|
-
</span>
|
|
86
|
-
<button class="send" id="btn-send" title="发送"><span class="up"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg></span></button>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<aside class="right-dock" id="right-dock" hidden aria-label="
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<!-- ============ 设置视图 ============ -->
|
|
96
|
-
<div id="view-settings" class="view" inert>
|
|
97
|
-
<div class="settings-wrap">
|
|
98
|
-
<nav class="settings-nav">
|
|
99
|
-
<button class="ghost settings-back" id="settings-back"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 12H4"/><path d="m11 5-7 7 7 7"/></svg><span>返回</span></button>
|
|
100
|
-
<strong>设置</strong>
|
|
101
|
-
<button class="stab active" data-s="providers">模型供应商</button>
|
|
102
|
-
<button class="stab" data-s="agents">Agent 发现</button>
|
|
103
|
-
<button class="stab" data-s="capture">会话捕获</button>
|
|
104
|
-
<button class="stab" data-s="about">关于</button>
|
|
105
|
-
</nav>
|
|
106
|
-
<div class="settings-body">
|
|
107
|
-
<div class="spanel active" id="s-providers">
|
|
108
|
-
<h2>模型供应商</h2>
|
|
109
|
-
<p class="sub">一家供应商配置一次,Claude Code、Codex 与 OpenCode 共用。填写两种 API 端点及对应模型名,API Key 单独加密存储。</p>
|
|
110
|
-
<div class="prov-cols">
|
|
111
|
-
<aside class="mgmt-side">
|
|
112
|
-
<div class="mgmt-group">自定义供应商</div>
|
|
113
|
-
<div id="provider-list"></div>
|
|
114
|
-
<button class="mgmt-item" id="mgmt-add"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg><span class="grow">添加供应商</span></button>
|
|
115
|
-
</aside>
|
|
116
|
-
<div class="mgmt-detail" id="provider-detail"><div class="empty-models">选择或添加一个供应商。</div></div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
<div class="spanel" id="s-agents">
|
|
120
|
-
<h2>Agent 发现</h2>
|
|
121
|
-
<p class="sub">自动扫描本机可用的 Agent 程序;不可用或未接入的会如实标注。</p>
|
|
122
|
-
<div id="agent-cards"></div>
|
|
123
|
-
<button class="ghost" id="btn-rescan"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/></svg><span>重新扫描</span></button>
|
|
124
|
-
</div>
|
|
125
|
-
<div class="spanel" id="s-capture">
|
|
126
|
-
<h2>会话捕获</h2>
|
|
127
|
-
<p class="sub">默认关闭:终端是内部 AI 运行时,你在这里与 AI 的对话不会进入开发对话记录(知识库的会话浏览)。开启后,此后新建的终端对话会像 CLI 工具对话一样被留档;已存在的会话不受影响。</p>
|
|
128
|
-
<label style="display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px">
|
|
129
|
-
<input type="checkbox" id="capture-toggle">
|
|
130
|
-
<span>记录终端对话到开发对话记录</span>
|
|
131
|
-
</label>
|
|
132
|
-
<p class="sub" id="capture-note" style="margin-top:10px"></p>
|
|
133
|
-
</div>
|
|
134
|
-
<div class="spanel" id="s-about">
|
|
135
|
-
<h2>关于</h2>
|
|
136
|
-
<p class="sub" id="about-text"></p>
|
|
137
|
-
<div class="auth-note">本页面由 Agent Terminal 服务直接托管,与 API 同版本发布;宿主可通过 iframe 嵌入本页(UI 与服务同版本,天然消灭版本漂移)。</div>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
<!-- ============ 添加项目弹窗 ============ -->
|
|
144
|
-
<div class="modal" id="modal-add-proj">
|
|
145
|
-
<div class="modal-box">
|
|
146
|
-
<h3>添加项目</h3>
|
|
147
|
-
<p class="sub">手动添加项目:填写本地文件夹的绝对路径作为工作区根目录(点「添加项目」通常直接弹出系统文件夹选择器,无需手填)。</p>
|
|
148
|
-
<div class="f"><label>本地文件夹(绝对路径)</label>
|
|
149
|
-
<div class="path-row">
|
|
150
|
-
<input class="fin" id="np-path" placeholder="D:\path\to\project" spellcheck="false">
|
|
151
|
-
<button type="button" class="ghost browse" id="np-browse" title="打开系统文件夹选择器">浏览…</button>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
<div class="f"><label>项目名称</label><input class="fin" id="np-name" placeholder="自动使用文件夹名"></div>
|
|
155
|
-
<div class="form-error" id="np-error" hidden></div>
|
|
156
|
-
<div class="modal-actions">
|
|
157
|
-
<button class="ghost" id="np-cancel">取消</button>
|
|
158
|
-
<button class="cta" id="np-confirm" disabled>添加项目</button>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
|
|
163
|
-
<div class="toast-host" id="toast" aria-live="polite"></div>
|
|
164
|
-
|
|
165
|
-
<script src="../packages/client/index.js"></script>
|
|
166
|
-
<script src="./right-dock-panel-registry.js"></script>
|
|
167
|
-
<script src="./
|
|
168
|
-
<script src="./
|
|
169
|
-
|
|
170
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Agent Terminal</title>
|
|
7
|
+
<link rel="stylesheet" href="./app.css">
|
|
8
|
+
<link rel="stylesheet" href="./right-workspace-dock.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
|
|
12
|
+
<!-- ============ 终端视图 ============ -->
|
|
13
|
+
<div id="view-terminal" class="view active" inert aria-busy="true">
|
|
14
|
+
<aside class="sidebar">
|
|
15
|
+
<div class="brand"><h1><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m5 8 4 4-4 4"/><path d="M13 16h6"/></svg>Agent Terminal</h1><span class="ver" id="app-version"></span></div>
|
|
16
|
+
<button class="new-session" id="btn-new-session"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg><span>新会话</span></button>
|
|
17
|
+
<div class="session-scroll">
|
|
18
|
+
<div class="group-label">项目</div>
|
|
19
|
+
<div id="project-list"></div>
|
|
20
|
+
<button class="add-proj" id="btn-add-proj"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg><span>添加项目</span></button>
|
|
21
|
+
<button class="arch-toggle" id="arch-toggle" type="button" aria-expanded="true">
|
|
22
|
+
<span class="toggle-caret" id="arch-caret"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span>
|
|
23
|
+
<span>已归档</span>
|
|
24
|
+
<span class="arch-count" id="arch-count" hidden></span>
|
|
25
|
+
</button>
|
|
26
|
+
<div class="arch-list" id="arch-list"><div class="proj-empty" id="arch-empty">暂无归档会话</div></div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="sidebar-foot">
|
|
29
|
+
<span class="dot" id="agent-dot"></span>
|
|
30
|
+
<span style="flex:1" id="agent-summary">扫描中…</span>
|
|
31
|
+
<button class="ghost" id="open-settings" title="设置"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M19 12a7 7 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 0 0-2-1.2L14 3h-4l-.5 2.6a7 7 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7 7 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7 7 0 0 0 2 1.2L10 21h4l.5-2.6a7 7 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6c.06-.4.1-.8.1-1.2z"/></svg></button>
|
|
32
|
+
</div>
|
|
33
|
+
</aside>
|
|
34
|
+
|
|
35
|
+
<div class="main">
|
|
36
|
+
<div class="top-strip">
|
|
37
|
+
<span class="t" id="session-title">正在加载工作台…</span>
|
|
38
|
+
<span class="session-provider" id="session-provider"></span>
|
|
39
|
+
<span class="st" id="session-status" hidden><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l1.9 5.8L20 12l-6.1 3.2L12 21l-1.9-5.8L4 12l6.1-3.2z"/></svg><span id="session-status-text"></span></span>
|
|
40
|
+
<span style="flex:1"></span>
|
|
41
|
+
<button class="ghost" id="btn-dock-toggle" title="任务面板(原生后台任务)" aria-expanded="false" aria-controls="right-dock" hidden><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v14H4z" fill="none" stroke="currentColor" stroke-width="2"/><path d="M15 5v14" stroke="currentColor" stroke-width="2"/></svg><span class="rd-toggle-count" hidden></span></button>
|
|
42
|
+
<button class="ghost" id="btn-top-settings" title="设置(模型供应商)"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.01a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h.01a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.01a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg></button>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="stream" id="stream" tabindex="0" aria-label="会话记录">
|
|
46
|
+
<div class="history-bar" id="history-bar" hidden>
|
|
47
|
+
<button class="linklike" id="history-more" type="button">加载更早记录</button>
|
|
48
|
+
<span id="history-status" role="status"></span>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="col" id="stream-col">
|
|
51
|
+
<section class="background-tasks" id="background-tasks" aria-label="子代理任务" hidden></section>
|
|
52
|
+
<div class="empty-hint" id="empty-hint">
|
|
53
|
+
<div class="big"><span class="hint-wrap"><span class="hint-art"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m5 8 4 4-4 4"/><path d="M13 16h6"/></svg></span><span class="hint-spark"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l1.9 5.8L20 12l-6.1 3.2L12 21l-1.9-5.8L4 12l6.1-3.2z"/></svg></span></span></div>
|
|
54
|
+
<p class="standalone-hint">从左侧选择一个项目,或 <button class="linklike" id="hint-add-proj">添加项目</button> 开始。<br>
|
|
55
|
+
新会话将使用底部选中的 Agent 与模型。</p>
|
|
56
|
+
<p class="embedded-hint">输入当前项目的任务,开始新会话。<br>相关知识会在发送前检索,并在右侧显示来源。</p>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<button class="jump-latest" id="jump-latest" title="回到底部" hidden><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14"/><path d="m19 12-7 7-7-7"/></svg><span>回到底部</span></button>
|
|
62
|
+
|
|
63
|
+
<div class="composer-wrap">
|
|
64
|
+
<div class="composer" id="composer">
|
|
65
|
+
<textarea id="chat-input" placeholder="给当前会话发送消息" rows="1"></textarea>
|
|
66
|
+
<div class="cmdrow">
|
|
67
|
+
<button class="bar-btn plus" id="btn-attach" title="添加图片或文本文件(txt、md、json、csv;文本每件最多 512KB)"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button>
|
|
68
|
+
<input type="file" id="file-input" accept="image/jpeg,image/png,image/gif,image/webp,.txt,.md,.json,.csv" multiple hidden>
|
|
69
|
+
<span class="anchor">
|
|
70
|
+
<button class="bar-btn mode" id="btn-mode" title="权限模式"><span class="shield"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/></svg></span> <span id="mode-label">默认防护</span> <span class="chev"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span></button>
|
|
71
|
+
<div class="pop from-left" id="pop-mode" hidden></div>
|
|
72
|
+
</span>
|
|
73
|
+
<span class="cmd-spacer"></span>
|
|
74
|
+
<span class="anchor">
|
|
75
|
+
<button class="bar-btn" id="btn-ctx" title="上下文用量" hidden><span id="ctx-label"></span></button>
|
|
76
|
+
<div class="pop from-right ctx-pop" id="pop-ctx" hidden></div>
|
|
77
|
+
</span>
|
|
78
|
+
<span class="anchor model-anchor">
|
|
79
|
+
<button class="bar-btn" id="btn-model" title="选择供应商与模型"><span id="model-label">Agent 自身登录 · 默认模型</span> <span class="chev"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span></button>
|
|
80
|
+
<div class="pop from-right" id="pop-model" hidden></div>
|
|
81
|
+
</span>
|
|
82
|
+
<span class="anchor" id="effort-anchor" hidden>
|
|
83
|
+
<button class="bar-btn" id="btn-effort" title="推理力度"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15l3.5-3.5"/><path d="M20.5 14a9 9 0 1 0-17 0"/></svg><span id="effort-label">高</span> <span class="chev"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></span></button>
|
|
84
|
+
<div class="pop from-right" id="pop-effort" hidden></div>
|
|
85
|
+
</span>
|
|
86
|
+
<button class="send" id="btn-send" title="发送"><span class="up"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg></span></button>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<aside class="right-dock" id="right-dock" hidden aria-label="任务与参考资料"></aside>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<!-- ============ 设置视图 ============ -->
|
|
96
|
+
<div id="view-settings" class="view" inert>
|
|
97
|
+
<div class="settings-wrap">
|
|
98
|
+
<nav class="settings-nav">
|
|
99
|
+
<button class="ghost settings-back" id="settings-back"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 12H4"/><path d="m11 5-7 7 7 7"/></svg><span>返回</span></button>
|
|
100
|
+
<strong>设置</strong>
|
|
101
|
+
<button class="stab active" data-s="providers">模型供应商</button>
|
|
102
|
+
<button class="stab" data-s="agents">Agent 发现</button>
|
|
103
|
+
<button class="stab" data-s="capture">会话捕获</button>
|
|
104
|
+
<button class="stab" data-s="about">关于</button>
|
|
105
|
+
</nav>
|
|
106
|
+
<div class="settings-body">
|
|
107
|
+
<div class="spanel active" id="s-providers">
|
|
108
|
+
<h2>模型供应商</h2>
|
|
109
|
+
<p class="sub">一家供应商配置一次,Claude Code、Codex 与 OpenCode 共用。填写两种 API 端点及对应模型名,API Key 单独加密存储。</p>
|
|
110
|
+
<div class="prov-cols">
|
|
111
|
+
<aside class="mgmt-side">
|
|
112
|
+
<div class="mgmt-group">自定义供应商</div>
|
|
113
|
+
<div id="provider-list"></div>
|
|
114
|
+
<button class="mgmt-item" id="mgmt-add"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg><span class="grow">添加供应商</span></button>
|
|
115
|
+
</aside>
|
|
116
|
+
<div class="mgmt-detail" id="provider-detail"><div class="empty-models">选择或添加一个供应商。</div></div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="spanel" id="s-agents">
|
|
120
|
+
<h2>Agent 发现</h2>
|
|
121
|
+
<p class="sub">自动扫描本机可用的 Agent 程序;不可用或未接入的会如实标注。</p>
|
|
122
|
+
<div id="agent-cards"></div>
|
|
123
|
+
<button class="ghost" id="btn-rescan"><svg class="ics" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/></svg><span>重新扫描</span></button>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="spanel" id="s-capture">
|
|
126
|
+
<h2>会话捕获</h2>
|
|
127
|
+
<p class="sub">默认关闭:终端是内部 AI 运行时,你在这里与 AI 的对话不会进入开发对话记录(知识库的会话浏览)。开启后,此后新建的终端对话会像 CLI 工具对话一样被留档;已存在的会话不受影响。</p>
|
|
128
|
+
<label style="display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px">
|
|
129
|
+
<input type="checkbox" id="capture-toggle">
|
|
130
|
+
<span>记录终端对话到开发对话记录</span>
|
|
131
|
+
</label>
|
|
132
|
+
<p class="sub" id="capture-note" style="margin-top:10px"></p>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="spanel" id="s-about">
|
|
135
|
+
<h2>关于</h2>
|
|
136
|
+
<p class="sub" id="about-text"></p>
|
|
137
|
+
<div class="auth-note">本页面由 Agent Terminal 服务直接托管,与 API 同版本发布;宿主可通过 iframe 嵌入本页(UI 与服务同版本,天然消灭版本漂移)。</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<!-- ============ 添加项目弹窗 ============ -->
|
|
144
|
+
<div class="modal" id="modal-add-proj">
|
|
145
|
+
<div class="modal-box">
|
|
146
|
+
<h3>添加项目</h3>
|
|
147
|
+
<p class="sub">手动添加项目:填写本地文件夹的绝对路径作为工作区根目录(点「添加项目」通常直接弹出系统文件夹选择器,无需手填)。</p>
|
|
148
|
+
<div class="f"><label>本地文件夹(绝对路径)</label>
|
|
149
|
+
<div class="path-row">
|
|
150
|
+
<input class="fin" id="np-path" placeholder="D:\path\to\project" spellcheck="false">
|
|
151
|
+
<button type="button" class="ghost browse" id="np-browse" title="打开系统文件夹选择器">浏览…</button>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="f"><label>项目名称</label><input class="fin" id="np-name" placeholder="自动使用文件夹名"></div>
|
|
155
|
+
<div class="form-error" id="np-error" hidden></div>
|
|
156
|
+
<div class="modal-actions">
|
|
157
|
+
<button class="ghost" id="np-cancel">取消</button>
|
|
158
|
+
<button class="cta" id="np-confirm" disabled>添加项目</button>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="toast-host" id="toast" aria-live="polite"></div>
|
|
164
|
+
|
|
165
|
+
<script src="../packages/client/index.js"></script>
|
|
166
|
+
<script src="./right-dock-panel-registry.js"></script>
|
|
167
|
+
<script src="./conversation-composer.js"></script>
|
|
168
|
+
<script src="./user-question-card.js"></script>
|
|
169
|
+
<script src="./right-workspace-dock.js"></script>
|
|
170
|
+
<script src="./app.js"></script>
|
|
171
|
+
</body>
|
|
172
|
+
</html>
|