@wwwfz/dsh-agent-bridge 0.8.3 → 0.10.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.
Files changed (45) hide show
  1. package/README.md +132 -194
  2. package/THIRD_PARTY_NOTICES.md +67 -0
  3. package/cordis.patch.yml +4 -4
  4. package/package.json +40 -40
  5. package/src/assets.js +405 -348
  6. package/src/catalog.js +999 -605
  7. package/src/client.js +883 -4
  8. package/src/config.js +88 -88
  9. package/src/conversation-readers.js +198 -0
  10. package/src/conversation-store.js +583 -0
  11. package/src/export.js +273 -12
  12. package/src/index.js +282 -136
  13. package/src/native-transcript.js +217 -0
  14. package/src/project-archive.js +145 -145
  15. package/src/projects.js +1837 -980
  16. package/src/session-import.js +138 -93
  17. package/src/session-trace.js +121 -0
  18. package/src/skill-handoff.js +1327 -0
  19. package/src/skill-package.js +417 -0
  20. package/src/skill-provider.js +249 -0
  21. package/src/watch.js +319 -309
  22. package/web/Geist-OFL.txt +93 -93
  23. package/web/agent-icons/NOTICE.md +19 -19
  24. package/web/agent-icons/antigravity.svg +76 -76
  25. package/web/agent-icons/claude.svg +3 -3
  26. package/web/agent-icons/dsh.svg +58 -58
  27. package/web/agent-icons/licenses/copilot.txt +21 -21
  28. package/web/agent-icons/licenses/dsh.txt +21 -21
  29. package/web/agent-icons/licenses/gemini.txt +201 -201
  30. package/web/agent-icons/licenses/opencode.txt +21 -21
  31. package/web/agent-icons/licenses/qoder-notice.txt +18 -18
  32. package/web/agent-icons/licenses/qoder.txt +22 -22
  33. package/web/agent-icons/licenses/qwen.txt +202 -202
  34. package/web/agent-icons/qoder.svg +4 -4
  35. package/web/agent-icons/qwen.svg +5 -5
  36. package/web/agent-icons/workbuddy.svg +29 -29
  37. package/web/inline-process.css +22 -0
  38. package/web/markdown.js +225 -0
  39. package/web/panel.css +168 -151
  40. package/web/panel.html +82 -43
  41. package/web/panel.js +1316 -93
  42. package/web/project-context.js +25 -25
  43. package/web/reader.css +259 -0
  44. package/web/vendor/markdown-it-LICENSE.txt +156 -0
  45. package/web/vendor/markdown-it.mjs +3064 -0
package/web/panel.html CHANGED
@@ -1,11 +1,12 @@
1
1
  <!doctype html>
2
- <html lang="zh-CN" data-theme="blue">
2
+ <html lang="zh-CN" class="bridge-ui" data-theme="white">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="bridge-nonce" content="__DSH_BRIDGE_NONCE__">
7
7
  <title>Agent 接续</title>
8
8
  <link rel="stylesheet" href="./panel.css">
9
+ <link rel="stylesheet" href="./reader.css">
9
10
  <script type="module" src="./panel.js"></script>
10
11
  </head>
11
12
  <body>
@@ -42,11 +43,13 @@
42
43
  <div class="toolbar">
43
44
  <p class="live-status"><span id="live-state" data-state="loading">正在连接实时扫描</span><time id="last-scan" hidden></time></p>
44
45
  <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>
46
+ <label class="theme-picker">
47
+ <span class="sr-only">界面外观</span>
48
+ <select id="appearance" aria-label="界面外观">
49
+ <optgroup label="浅色"><option value="white">纸白</option><option value="mist">雾蓝</option></optgroup>
50
+ <optgroup label="深色"><option value="blue">夜蓝</option><option value="black">深灰</option></optgroup>
51
+ </select>
52
+ </label>
50
53
  <button class="secondary" id="native-export" type="button"><svg class="icon button-icon" aria-hidden="true"><use href="#icon-download"/></svg>导出 DSH 会话</button>
51
54
  <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
55
  </div>
@@ -60,47 +63,50 @@
60
63
  <h2>项目</h2>
61
64
  <div class="project-list-actions">
62
65
  <span id="project-count"></span>
66
+ <button id="project-switch" class="secondary" type="button" aria-expanded="false" aria-controls="project-browser">切换项目</button>
63
67
  <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
68
  </div>
65
69
  </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>
70
+ <div id="project-browser">
71
+ <div class="project-controls">
72
+ <div class="field">
73
+ <svg class="icon field-icon" aria-hidden="true"><use href="#icon-search"/></svg>
74
+ <label class="sr-only" for="project-search">搜索项目</label>
75
+ <input id="project-search" type="search" placeholder="搜索项目或路径" autocomplete="off">
76
+ <kbd class="key-hint" aria-hidden="true">/</kbd>
77
+ <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>
78
+ </div>
79
+ <div id="agent-picker" class="agent-picker">
80
+ <button id="agent-filter" class="agent-trigger" type="button" aria-haspopup="listbox" aria-expanded="false" aria-controls="agent-options" aria-label="筛选 Agent,当前为全部 Agent">
81
+ <span id="agent-trigger-mark" class="agent-trigger-mark"><svg class="icon" aria-hidden="true"><use href="#icon-filter"/></svg></span>
82
+ <span id="agent-trigger-label" class="agent-trigger-label">全部 Agent</span>
83
+ <svg class="icon select-chevron" aria-hidden="true"><use href="#icon-chevron-down"/></svg>
84
+ </button>
85
+ <div id="agent-popover" class="agent-popover" hidden>
86
+ <div id="agent-options" class="agent-options" role="listbox" aria-label="Agent 来源" tabindex="-1"></div>
87
+ </div>
88
+ </div>
89
+ <div class="project-filters" aria-label="项目状态">
90
+ <button class="filter-button" data-project-state="all" type="button" aria-pressed="true">全部</button>
91
+ <button class="filter-button" data-project-state="online" type="button" aria-pressed="false">可接续</button>
92
+ <button class="filter-button" data-project-state="offline" type="button" aria-pressed="false">离线</button>
93
+ <button class="filter-button" data-project-state="archived" type="button" aria-pressed="false">已归档</button>
94
+ </div>
95
+ <div id="project-bulk" class="project-bulk" hidden>
96
+ <label class="project-bulk-select"><input id="project-select-visible" type="checkbox">全选当前结果</label>
97
+ <button id="project-bulk-action" class="secondary project-bulk-action" type="button" disabled>归档所选</button>
82
98
  </div>
83
99
  </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>
100
+ <div id="project-feedback" class="project-feedback" hidden>
101
+ <p id="project-feedback-text" role="status" aria-live="polite"></p>
102
+ <button id="project-undo" class="secondary project-undo" type="button" hidden>撤销</button>
93
103
  </div>
104
+ <div id="project-list" class="project-list"></div>
105
+ <details class="sources">
106
+ <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>
107
+ <div id="sources-list"></div>
108
+ </details>
94
109
  </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
110
  </aside>
105
111
 
106
112
  <section class="detail" aria-label="项目资料">
@@ -108,7 +114,6 @@
108
114
  <div id="project-detail" hidden>
109
115
  <header class="project-heading">
110
116
  <div class="project-identity">
111
- <span class="project-mark"><svg class="icon" aria-hidden="true"><use href="#icon-folder"/></svg></span>
112
117
  <div class="project-title-block">
113
118
  <h2 id="project-name" tabindex="-1"></h2>
114
119
  <div id="project-meta" class="chips"></div>
@@ -126,6 +131,7 @@
126
131
  </div>
127
132
  <div class="project-location">
128
133
  <code id="project-path"></code>
134
+ <button id="open-path" class="path-open" type="button" aria-label="在 DSH 中打开工作目录" title="在 DSH 中打开工作目录"><svg class="icon" aria-hidden="true"><use href="#icon-folder"/></svg><span>打开</span></button>
129
135
  <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
136
  </div>
131
137
  </header>
@@ -134,7 +140,6 @@
134
140
  <span class="continue-mark"><svg class="icon" aria-hidden="true"><use href="#icon-history"/></svg></span>
135
141
  <div>
136
142
  <h3 id="continue-heading" tabindex="-1">继续旧对话</h3>
137
- <p>选一条对话,把历史消息迁入 DSH 继续聊。</p>
138
143
  </div>
139
144
  </header>
140
145
  <p id="recent-status" class="recent-status" role="status"></p>
@@ -215,6 +220,10 @@
215
220
  <p id="history-empty" class="recent-status" role="status"></p>
216
221
  <ul id="history-results" class="conversation-list" aria-label="来源对话"></ul>
217
222
  <button id="history-more" class="secondary" type="button" hidden>显示更多</button>
223
+ <details id="history-unavailable" class="source-archive" hidden>
224
+ <summary id="history-unavailable-count"></summary>
225
+ <ul id="history-unavailable-results"></ul>
226
+ </details>
218
227
  </div>
219
228
  <div id="history-back" class="history-back" hidden>
220
229
  <button id="history-back-button" class="text-action" type="button">
@@ -226,6 +235,7 @@
226
235
  <label for="session-select">选择要导出的 DSH 会话</label>
227
236
  <select id="session-select"></select>
228
237
  <p id="session-path" class="muted"></p>
238
+ <div id="session-source-record"></div>
229
239
  </div>
230
240
  <p id="dialog-status" role="status"></p>
231
241
  <details id="export-output" class="export-output" hidden>
@@ -234,13 +244,42 @@
234
244
  </details>
235
245
  </div>
236
246
  <footer class="dialog-actions">
247
+ <label id="export-trace-option" class="export-trace-option" hidden>
248
+ <input type="checkbox" id="export-trace">
249
+ <span>附带来源记录(工具名与结果摘录)</span>
250
+ </label>
237
251
  <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>
252
+ <button id="export" class="secondary" type="button" hidden><svg class="icon button-icon" aria-hidden="true"><use href="#icon-download"/></svg>导出本机版</button>
253
+ <button id="export-share" class="secondary" type="button" hidden><svg class="icon button-icon" aria-hidden="true"><use href="#icon-download"/></svg>导出分享版</button>
239
254
  <button id="recover-draft" class="secondary" type="button" hidden>打开已创建的会话</button>
255
+ <button id="skill-undo" class="secondary" type="button" hidden>恢复上一版</button>
256
+ <button id="skill-deactivate" class="secondary" type="button" hidden>停用技能</button>
257
+ <button id="skill-apply" class="primary" type="button" hidden><span id="skill-apply-label">启用技能</span><svg class="icon button-icon" aria-hidden="true"><use href="#icon-arrow"/></svg></button>
240
258
  <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
259
  <button id="import" class="primary" type="button" hidden>打开新对话<svg class="icon button-icon" aria-hidden="true"><use href="#icon-arrow"/></svg></button>
242
260
  </footer>
243
261
  </div>
244
262
  </dialog>
263
+
264
+ <dialog id="activate-dialog" aria-labelledby="activate-title">
265
+ <div class="dialog-inner">
266
+ <header class="dialog-heading">
267
+ <span class="project-mark"><svg class="icon" aria-hidden="true"><use href="#icon-skill"/></svg></span>
268
+ <div>
269
+ <h2 id="activate-title">确认启用技能</h2>
270
+ <p id="activate-note" class="muted">核对来源、项目范围和脚本后再继续。</p>
271
+ </div>
272
+ <button id="activate-close" class="secondary icon-button" type="button" aria-label="关闭" title="关闭"><svg class="icon" aria-hidden="true"><use href="#icon-close"/></svg></button>
273
+ </header>
274
+ <div class="dialog-content">
275
+ <div id="activate-body" class="dialog-text" data-format="handoff" tabindex="0"></div>
276
+ <p id="activate-status" role="status"></p>
277
+ </div>
278
+ <footer class="dialog-actions">
279
+ <button id="activate-text" class="secondary" type="button">仅文字继续</button>
280
+ <button id="activate-confirm" class="primary" type="button">确认启用并继续<svg class="icon button-icon" aria-hidden="true"><use href="#icon-arrow"/></svg></button>
281
+ </footer>
282
+ </div>
283
+ </dialog>
245
284
  </body>
246
285
  </html>