@wwwfz/dsh-agent-bridge 0.0.0-stage → 0.8.2
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 +183 -2
- package/cordis.patch.yml +4 -0
- package/package.json +38 -4
- package/src/assets.js +348 -0
- package/src/catalog.js +605 -0
- package/src/client.js +310 -0
- package/src/config.js +88 -0
- package/src/export.js +12 -0
- package/src/index.js +136 -0
- package/src/project-archive.js +145 -0
- package/src/projects.js +980 -0
- package/src/session-import.js +93 -0
- package/src/watch.js +309 -0
- package/web/Geist-OFL.txt +93 -0
- package/web/agent-icons/NOTICE.md +19 -0
- package/web/agent-icons/antigravity.svg +76 -0
- package/web/agent-icons/claude.svg +3 -0
- package/web/agent-icons/codex.png +0 -0
- package/web/agent-icons/copilot.svg +1 -0
- package/web/agent-icons/dsh.svg +58 -0
- package/web/agent-icons/gemini.png +0 -0
- package/web/agent-icons/licenses/copilot.txt +21 -0
- package/web/agent-icons/licenses/dsh.txt +21 -0
- package/web/agent-icons/licenses/gemini.txt +202 -0
- package/web/agent-icons/licenses/opencode.txt +21 -0
- package/web/agent-icons/licenses/qoder-notice.txt +18 -0
- package/web/agent-icons/licenses/qoder.txt +22 -0
- package/web/agent-icons/licenses/qwen.txt +203 -0
- package/web/agent-icons/opencode.png +0 -0
- package/web/agent-icons/qoder.svg +4 -0
- package/web/agent-icons/qwen.svg +5 -0
- package/web/agent-icons/trae.png +0 -0
- package/web/agent-icons/workbuddy.svg +29 -0
- package/web/geist-latin-wght-normal.woff2 +0 -0
- package/web/panel.css +502 -0
- package/web/panel.html +246 -0
- package/web/panel.js +1559 -0
- package/web/project-context.js +25 -0
package/web/panel.html
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN" data-theme="blue">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="bridge-nonce" content="__DSH_BRIDGE_NONCE__">
|
|
7
|
+
<title>Agent 接续</title>
|
|
8
|
+
<link rel="stylesheet" href="./panel.css">
|
|
9
|
+
<script type="module" src="./panel.js"></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<svg class="icon-defs" width="0" height="0" aria-hidden="true" focusable="false">
|
|
13
|
+
<symbol id="icon-bridge" viewBox="0 0 24 24"><path d="M4 8V5h5m-5 7v7h5m6-14h5v7m-5 7h5v-3M9 12h7m-3-3 3 3-3 3"/></symbol>
|
|
14
|
+
<symbol id="icon-folder" viewBox="0 0 24 24"><path d="M3 17.5V6a2 2 0 0 1 2-2h4.5l2 2H19a2 2 0 0 1 2 2v9.5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M3 9h18"/></symbol>
|
|
15
|
+
<symbol id="icon-search" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4 4"/></symbol>
|
|
16
|
+
<symbol id="icon-filter" viewBox="0 0 24 24"><path d="M4 6h16M7 12h10m-7 6h4"/></symbol>
|
|
17
|
+
<symbol id="icon-refresh" viewBox="0 0 24 24"><path d="M20 7v5h-5M4 17v-5h5M5.7 8a7 7 0 0 1 11.7-2l2.6 4M4 14l2.6 4A7 7 0 0 0 18.3 16"/></symbol>
|
|
18
|
+
<symbol id="icon-download" viewBox="0 0 24 24"><path d="M12 3v12m-4-4 4 4 4-4M4 16v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"/></symbol>
|
|
19
|
+
<symbol id="icon-memory" viewBox="0 0 24 24"><rect x="5" y="3" width="14" height="18" rx="2"/><path d="M9 8h6m-6 4h6m-6 4h3"/></symbol>
|
|
20
|
+
<symbol id="icon-skill" viewBox="0 0 24 24"><path d="m13 2-8 12h6l-1 8 9-12h-6l1-8Z"/></symbol>
|
|
21
|
+
<symbol id="icon-history" viewBox="0 0 24 24"><path d="M3 10a9 9 0 1 1 2 8m-2-8V5m0 5h5m4-3v5l3 2"/></symbol>
|
|
22
|
+
<symbol id="icon-copy" viewBox="0 0 24 24"><rect x="8" y="8" width="12" height="12" rx="2"/><path d="M16 4H6a2 2 0 0 0-2 2v10"/></symbol>
|
|
23
|
+
<symbol id="icon-close" viewBox="0 0 24 24"><path d="m6 6 12 12M18 6 6 18"/></symbol>
|
|
24
|
+
<symbol id="icon-arrow" viewBox="0 0 24 24"><path d="M4 12h15m-6-6 6 6-6 6"/></symbol>
|
|
25
|
+
<symbol id="icon-chevron" viewBox="0 0 24 24"><path d="m9 6 6 6-6 6"/></symbol>
|
|
26
|
+
<symbol id="icon-chevron-down" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></symbol>
|
|
27
|
+
<symbol id="icon-layers" viewBox="0 0 24 24"><path d="m12 3 9 5-9 5-9-5 9-5Zm-9 9 9 5 9-5m-18 4 9 5 9-5"/></symbol>
|
|
28
|
+
<symbol id="icon-check" viewBox="0 0 24 24"><path d="m5 12 4 4L19 6"/></symbol>
|
|
29
|
+
<symbol id="icon-project-manage" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8 12 3 3 5-6"/></symbol>
|
|
30
|
+
<symbol id="icon-archive" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="5" rx="1.5"/><path d="M5 9v9a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9m-9 4h4"/></symbol>
|
|
31
|
+
<symbol id="icon-restore" viewBox="0 0 24 24"><path d="M4 11a8 8 0 1 1 2 6M4 11V5m0 6h6"/></symbol>
|
|
32
|
+
<symbol id="icon-pin" viewBox="0 0 24 24"><path d="M16 4H8m7 0v5l3 4v2H6v-2l3-4V4m3 11v6"/></symbol>
|
|
33
|
+
<symbol id="icon-unpin" viewBox="0 0 24 24"><path d="M16 4H8m7 0v5l3 4v1M9 9l-3 4v2h9m-3 0v6M3 3l18 18"/></symbol>
|
|
34
|
+
</svg>
|
|
35
|
+
|
|
36
|
+
<main class="app">
|
|
37
|
+
<header class="topbar">
|
|
38
|
+
<div class="brand">
|
|
39
|
+
<span class="brand-mark"><svg class="icon" aria-hidden="true"><use href="#icon-bridge"/></svg></span>
|
|
40
|
+
<h1>Agent 接续</h1>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="toolbar">
|
|
43
|
+
<p class="live-status"><span id="live-state" data-state="loading">正在连接实时扫描</span><time id="last-scan" hidden></time></p>
|
|
44
|
+
<div class="toolbar-actions">
|
|
45
|
+
<div class="theme-picker" role="group" aria-label="主题">
|
|
46
|
+
<button class="theme-option" data-theme-choice="blue" type="button" aria-pressed="true" title="蓝色主题"><span class="theme-swatch" aria-hidden="true"></span><span class="sr-only">蓝色</span></button>
|
|
47
|
+
<button class="theme-option" data-theme-choice="white" type="button" aria-pressed="false" title="白色主题"><span class="theme-swatch" aria-hidden="true"></span><span class="sr-only">白色</span></button>
|
|
48
|
+
<button class="theme-option" data-theme-choice="black" type="button" aria-pressed="false" title="黑色主题"><span class="theme-swatch" aria-hidden="true"></span><span class="sr-only">黑色</span></button>
|
|
49
|
+
</div>
|
|
50
|
+
<button class="secondary" id="native-export" type="button"><svg class="icon button-icon" aria-hidden="true"><use href="#icon-download"/></svg>导出 DSH 会话</button>
|
|
51
|
+
<button class="secondary icon-button" id="refresh" type="button" aria-label="刷新来源" title="刷新来源"><svg class="icon button-icon" aria-hidden="true"><use href="#icon-refresh"/></svg></button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</header>
|
|
55
|
+
<p id="status" class="status" role="status"></p>
|
|
56
|
+
|
|
57
|
+
<div class="workspace">
|
|
58
|
+
<aside class="projects" aria-label="项目">
|
|
59
|
+
<div class="list-heading">
|
|
60
|
+
<h2>项目</h2>
|
|
61
|
+
<div class="project-list-actions">
|
|
62
|
+
<span id="project-count"></span>
|
|
63
|
+
<button id="project-manage" class="secondary project-manage" type="button" aria-pressed="false" aria-controls="project-bulk project-list"><svg class="icon" aria-hidden="true"><use href="#icon-project-manage"/></svg>整理</button>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="project-controls">
|
|
67
|
+
<div class="field">
|
|
68
|
+
<svg class="icon field-icon" aria-hidden="true"><use href="#icon-search"/></svg>
|
|
69
|
+
<label class="sr-only" for="project-search">搜索项目</label>
|
|
70
|
+
<input id="project-search" type="search" placeholder="搜索项目或路径" autocomplete="off">
|
|
71
|
+
<kbd class="key-hint" aria-hidden="true">/</kbd>
|
|
72
|
+
<button class="clear-search icon-button" id="clear-project-search" type="button" aria-label="清除项目搜索" hidden><svg class="icon" aria-hidden="true"><use href="#icon-close"/></svg></button>
|
|
73
|
+
</div>
|
|
74
|
+
<div id="agent-picker" class="agent-picker">
|
|
75
|
+
<button id="agent-filter" class="agent-trigger" type="button" aria-haspopup="listbox" aria-expanded="false" aria-controls="agent-options" aria-label="筛选 Agent,当前为全部 Agent">
|
|
76
|
+
<span id="agent-trigger-mark" class="agent-trigger-mark"><svg class="icon" aria-hidden="true"><use href="#icon-filter"/></svg></span>
|
|
77
|
+
<span id="agent-trigger-label" class="agent-trigger-label">全部 Agent</span>
|
|
78
|
+
<svg class="icon select-chevron" aria-hidden="true"><use href="#icon-chevron-down"/></svg>
|
|
79
|
+
</button>
|
|
80
|
+
<div id="agent-popover" class="agent-popover" hidden>
|
|
81
|
+
<div id="agent-options" class="agent-options" role="listbox" aria-label="Agent 来源" tabindex="-1"></div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="project-filters" aria-label="项目状态">
|
|
85
|
+
<button class="filter-button" data-project-state="all" type="button" aria-pressed="true">全部</button>
|
|
86
|
+
<button class="filter-button" data-project-state="online" type="button" aria-pressed="false">可接续</button>
|
|
87
|
+
<button class="filter-button" data-project-state="offline" type="button" aria-pressed="false">离线</button>
|
|
88
|
+
<button class="filter-button" data-project-state="archived" type="button" aria-pressed="false">已归档</button>
|
|
89
|
+
</div>
|
|
90
|
+
<div id="project-bulk" class="project-bulk" hidden>
|
|
91
|
+
<label class="project-bulk-select"><input id="project-select-visible" type="checkbox">全选当前结果</label>
|
|
92
|
+
<button id="project-bulk-action" class="secondary project-bulk-action" type="button" disabled>归档所选</button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div id="project-feedback" class="project-feedback" hidden>
|
|
96
|
+
<p id="project-feedback-text" role="status" aria-live="polite"></p>
|
|
97
|
+
<button id="project-undo" class="secondary project-undo" type="button" hidden>撤销</button>
|
|
98
|
+
</div>
|
|
99
|
+
<div id="project-list" class="project-list"></div>
|
|
100
|
+
<details class="sources">
|
|
101
|
+
<summary><svg class="icon" aria-hidden="true"><use href="#icon-layers"/></svg><span id="sources-heading">本机来源</span><svg class="icon source-chevron" aria-hidden="true"><use href="#icon-chevron"/></svg></summary>
|
|
102
|
+
<div id="sources-list"></div>
|
|
103
|
+
</details>
|
|
104
|
+
</aside>
|
|
105
|
+
|
|
106
|
+
<section class="detail" aria-label="项目资料">
|
|
107
|
+
<div id="empty" class="empty" role="status">正在读取本机项目…</div>
|
|
108
|
+
<div id="project-detail" hidden>
|
|
109
|
+
<header class="project-heading">
|
|
110
|
+
<div class="project-identity">
|
|
111
|
+
<span class="project-mark"><svg class="icon" aria-hidden="true"><use href="#icon-folder"/></svg></span>
|
|
112
|
+
<div class="project-title-block">
|
|
113
|
+
<h2 id="project-name" tabindex="-1"></h2>
|
|
114
|
+
<div id="project-meta" class="chips"></div>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="project-detail-actions">
|
|
117
|
+
<button id="project-pin" class="secondary project-pin" type="button" aria-pressed="false">
|
|
118
|
+
<svg class="icon" aria-hidden="true"><use id="project-pin-icon" href="#icon-pin"/></svg>
|
|
119
|
+
<span id="project-pin-label">置顶</span>
|
|
120
|
+
</button>
|
|
121
|
+
<button id="project-archive-action" class="secondary project-archive-action" type="button">
|
|
122
|
+
<svg class="icon" aria-hidden="true"><use id="project-archive-action-icon" href="#icon-archive"/></svg>
|
|
123
|
+
<span id="project-archive-action-label">归档</span>
|
|
124
|
+
</button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="project-location">
|
|
128
|
+
<code id="project-path"></code>
|
|
129
|
+
<button id="copy-path" class="path-copy icon-button" type="button" aria-label="复制工作目录" title="复制工作目录"><svg class="icon" aria-hidden="true"><use href="#icon-copy"/></svg></button>
|
|
130
|
+
</div>
|
|
131
|
+
</header>
|
|
132
|
+
<section class="continue-panel" aria-labelledby="continue-heading">
|
|
133
|
+
<header class="continue-heading">
|
|
134
|
+
<span class="continue-mark"><svg class="icon" aria-hidden="true"><use href="#icon-history"/></svg></span>
|
|
135
|
+
<div>
|
|
136
|
+
<h3 id="continue-heading" tabindex="-1">继续旧对话</h3>
|
|
137
|
+
<p>选一条对话,把历史消息迁入 DSH 继续聊。</p>
|
|
138
|
+
</div>
|
|
139
|
+
</header>
|
|
140
|
+
<p id="recent-status" class="recent-status" role="status"></p>
|
|
141
|
+
<ul id="recent-conversations" class="conversation-list" aria-label="最近对话"></ul>
|
|
142
|
+
<button id="browse-history" class="text-action" type="button" hidden>
|
|
143
|
+
<span id="browse-history-label">查看全部对话</span><svg class="icon" aria-hidden="true"><use href="#icon-arrow"/></svg>
|
|
144
|
+
</button>
|
|
145
|
+
</section>
|
|
146
|
+
<details id="draft-workflow" class="draft-workflow">
|
|
147
|
+
<summary class="disclosure draft-summary">
|
|
148
|
+
<span class="disclosure-mark"><svg class="icon" aria-hidden="true"><use href="#icon-memory"/></svg></span>
|
|
149
|
+
<span class="draft-title">用项目资料开新对话</span>
|
|
150
|
+
<svg class="icon disclosure-chevron" aria-hidden="true"><use href="#icon-chevron"/></svg>
|
|
151
|
+
</summary>
|
|
152
|
+
<div class="draft-body">
|
|
153
|
+
<div class="draft-intro">
|
|
154
|
+
<p>选几份有用的资料,生成可编辑的草稿。</p>
|
|
155
|
+
<div class="field asset-search-field">
|
|
156
|
+
<svg class="icon field-icon" aria-hidden="true"><use href="#icon-search"/></svg>
|
|
157
|
+
<label class="sr-only" for="asset-search">搜索项目和全局资料</label>
|
|
158
|
+
<input id="asset-search" type="search" placeholder="搜索资料" autocomplete="off">
|
|
159
|
+
<button class="clear-search icon-button" id="clear-asset-search" type="button" aria-label="清除资料搜索" hidden><svg class="icon" aria-hidden="true"><use href="#icon-close"/></svg></button>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
<div id="project-materials" class="asset-list"></div>
|
|
163
|
+
<details id="global-library" class="global-library" hidden>
|
|
164
|
+
<summary class="disclosure">
|
|
165
|
+
<svg class="icon" aria-hidden="true"><use href="#icon-layers"/></svg>
|
|
166
|
+
<span class="disclosure-title">全局资料库</span>
|
|
167
|
+
<span id="global-count" class="disclosure-count"></span>
|
|
168
|
+
<svg class="icon disclosure-chevron" aria-hidden="true"><use href="#icon-chevron"/></svg>
|
|
169
|
+
</summary>
|
|
170
|
+
<p class="global-note">这些资料跨项目使用,按需选择。</p>
|
|
171
|
+
<div id="global-materials" class="asset-list"></div>
|
|
172
|
+
</details>
|
|
173
|
+
<p id="selection-feedback" class="selection-feedback" role="status"></p>
|
|
174
|
+
<div class="draft-actions">
|
|
175
|
+
<details id="handoff" class="handoff">
|
|
176
|
+
<summary class="disclosure">
|
|
177
|
+
<svg class="icon" aria-hidden="true"><use href="#icon-bridge"/></svg>
|
|
178
|
+
<span id="selection-summary" class="disclosure-title" aria-live="polite">接续清单</span>
|
|
179
|
+
<span id="selection-global" class="disclosure-count" hidden></span>
|
|
180
|
+
<svg class="icon disclosure-chevron" aria-hidden="true"><use href="#icon-chevron"/></svg>
|
|
181
|
+
</summary>
|
|
182
|
+
<div id="queue-list" class="queue-list"></div>
|
|
183
|
+
<label id="history-option" class="history" hidden>
|
|
184
|
+
<input type="checkbox" id="history">
|
|
185
|
+
<span id="history-label">带入近期对话摘录</span>
|
|
186
|
+
</label>
|
|
187
|
+
</details>
|
|
188
|
+
<button id="preview" class="primary" type="button" disabled>预览草稿<svg class="icon button-icon" aria-hidden="true"><use href="#icon-arrow"/></svg></button>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</details>
|
|
192
|
+
</div>
|
|
193
|
+
</section>
|
|
194
|
+
</div>
|
|
195
|
+
</main>
|
|
196
|
+
|
|
197
|
+
<dialog id="dialog" aria-labelledby="dialog-title">
|
|
198
|
+
<div class="dialog-inner">
|
|
199
|
+
<header class="dialog-heading">
|
|
200
|
+
<span id="dialog-mark" class="project-mark"><svg class="icon" aria-hidden="true"><use href="#icon-bridge"/></svg></span>
|
|
201
|
+
<div>
|
|
202
|
+
<h2 id="dialog-title"></h2>
|
|
203
|
+
<p id="dialog-note" class="muted"></p>
|
|
204
|
+
</div>
|
|
205
|
+
<button id="dialog-close" class="secondary icon-button" type="button" aria-label="关闭" title="关闭"><svg class="icon" aria-hidden="true"><use href="#icon-close"/></svg></button>
|
|
206
|
+
</header>
|
|
207
|
+
<div class="dialog-content">
|
|
208
|
+
<div id="history-choice" class="history-choice" hidden>
|
|
209
|
+
<div class="field">
|
|
210
|
+
<svg class="icon field-icon" aria-hidden="true"><use href="#icon-search"/></svg>
|
|
211
|
+
<label class="sr-only" for="history-search">搜索来源对话</label>
|
|
212
|
+
<input id="history-search" type="search" placeholder="搜对话标题或 Agent" autocomplete="off">
|
|
213
|
+
<button class="clear-search icon-button" id="clear-history-search" type="button" aria-label="清除对话搜索" hidden><svg class="icon" aria-hidden="true"><use href="#icon-close"/></svg></button>
|
|
214
|
+
</div>
|
|
215
|
+
<p id="history-empty" class="recent-status" role="status"></p>
|
|
216
|
+
<ul id="history-results" class="conversation-list" aria-label="来源对话"></ul>
|
|
217
|
+
<button id="history-more" class="secondary" type="button" hidden>显示更多</button>
|
|
218
|
+
</div>
|
|
219
|
+
<div id="history-back" class="history-back" hidden>
|
|
220
|
+
<button id="history-back-button" class="text-action" type="button">
|
|
221
|
+
<svg class="icon" aria-hidden="true"><use href="#icon-chevron"/></svg>返回对话列表
|
|
222
|
+
</button>
|
|
223
|
+
</div>
|
|
224
|
+
<div id="dialog-text" class="dialog-text" tabindex="0"></div>
|
|
225
|
+
<div id="session-choice" class="session-choice" hidden>
|
|
226
|
+
<label for="session-select">选择要导出的 DSH 会话</label>
|
|
227
|
+
<select id="session-select"></select>
|
|
228
|
+
<p id="session-path" class="muted"></p>
|
|
229
|
+
</div>
|
|
230
|
+
<p id="dialog-status" role="status"></p>
|
|
231
|
+
<details id="export-output" class="export-output" hidden>
|
|
232
|
+
<summary>查看或复制 Markdown</summary>
|
|
233
|
+
<pre id="export-text" tabindex="0"></pre>
|
|
234
|
+
</details>
|
|
235
|
+
</div>
|
|
236
|
+
<footer class="dialog-actions">
|
|
237
|
+
<a id="export-download" class="secondary" download hidden><svg class="icon button-icon" aria-hidden="true"><use href="#icon-download"/></svg>下载 Markdown</a>
|
|
238
|
+
<button id="export" class="secondary" type="button" hidden><svg class="icon button-icon" aria-hidden="true"><use href="#icon-download"/></svg>导出 Markdown</button>
|
|
239
|
+
<button id="recover-draft" class="secondary" type="button" hidden>打开已创建的会话</button>
|
|
240
|
+
<button id="history-import" class="primary" type="button" hidden><span id="history-import-label">迁入并继续</span><svg class="icon button-icon" aria-hidden="true"><use href="#icon-arrow"/></svg></button>
|
|
241
|
+
<button id="import" class="primary" type="button" hidden>打开新对话<svg class="icon button-icon" aria-hidden="true"><use href="#icon-arrow"/></svg></button>
|
|
242
|
+
</footer>
|
|
243
|
+
</div>
|
|
244
|
+
</dialog>
|
|
245
|
+
</body>
|
|
246
|
+
</html>
|