dsh-remote-plugin 0.8.7 → 0.8.8

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 (39) hide show
  1. package/apk/dsh-remote.apk +0 -0
  2. package/gateway.cjs +134 -54
  3. package/index.mjs +32 -1
  4. package/package.json +1 -1
  5. package/public/activity.js +144 -49
  6. package/public/admin.html +33 -32
  7. package/public/admin.js +2 -1
  8. package/public/app.js +139 -51
  9. package/public/build.json +2 -2
  10. package/public/desktop/desktop.html +83 -74
  11. package/public/desktop/desktop.js +39 -26
  12. package/public/diagnostics.js +30 -4
  13. package/public/e2ee-transport.js +154 -7
  14. package/public/history.js +15 -2
  15. package/public/index.html +93 -76
  16. package/public/operations.js +22 -9
  17. package/public/plugin.html +27 -26
  18. package/public/skins/blue-fish/preview.html +3 -3
  19. package/public/skins/bocchi/preview.html +5 -5
  20. package/public/skins/kita/preview.html +6 -6
  21. package/public/skins/nijika/preview.html +6 -6
  22. package/public/skins/penguin/preview.html +3 -3
  23. package/public/skins/penguin-logistics/cargo.svg +4 -0
  24. package/public/skins/penguin-logistics/console.svg +4 -0
  25. package/public/skins/penguin-logistics/mark.svg +4 -0
  26. package/public/skins/penguin-logistics/radio.svg +4 -0
  27. package/public/skins/penguin-logistics/skin.css +292 -0
  28. package/public/skins/penguin-logistics/standing.png +0 -0
  29. package/public/skins/ryo/preview.html +6 -6
  30. package/public/slash-suggestions.css +43 -0
  31. package/public/slash-suggestions.js +184 -0
  32. package/public/subagents.css +2 -0
  33. package/public/subagents.js +31 -10
  34. package/public/theme-vars.css +37 -2
  35. package/public/theme.js +4 -2
  36. package/public/update.json +8 -8
  37. package/public/version.json +1 -1
  38. package/public/workflow.css +17 -9
  39. package/public/workflow.js +7 -3
@@ -0,0 +1,43 @@
1
+ .slash-suggestions {
2
+ position: absolute;
3
+ z-index: 5;
4
+ bottom: calc(100% + 6px);
5
+ inset-inline-start: 0;
6
+ width: min(100%, 28rem);
7
+ max-height: min(16rem, 35vh);
8
+ overflow-y: auto;
9
+ overscroll-behavior: contain;
10
+ box-sizing: border-box;
11
+ padding: 4px;
12
+ border: 1px solid var(--dsr-line);
13
+ border-radius: 12px;
14
+ background: var(--dsr-panel);
15
+ box-shadow: 0 8px 24px var(--dsr-shadow);
16
+ }
17
+ .slash-suggestions[hidden] { display: none; }
18
+ .slash-suggestions > button {
19
+ display: grid;
20
+ width: 100%;
21
+ grid-template-columns: minmax(0, 1fr) auto;
22
+ align-items: center;
23
+ column-gap: 10px;
24
+ min-height: 44px;
25
+ padding: 7px 10px;
26
+ border: 0;
27
+ border-radius: 8px;
28
+ background: transparent;
29
+ color: var(--dsr-text);
30
+ font: inherit;
31
+ text-align: start;
32
+ cursor: pointer;
33
+ }
34
+ .slash-suggestions > button:hover,
35
+ .slash-suggestions > button[aria-selected="true"] { background: var(--dsr-accent-soft); }
36
+ .slash-suggestion-title,
37
+ .slash-suggestion-description { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
38
+ .slash-suggestion-title { font-size: 13px; font-weight: 600; }
39
+ .slash-suggestion-kind,
40
+ .slash-suggestion-description { color: var(--dsr-muted); font-size: 12px; }
41
+ .slash-suggestion-description { grid-column: 1 / -1; }
42
+ .composer-wrap.fs .slash-suggestions { top: 44px; bottom: auto; }
43
+ .ds-composer-input { position: relative; display: flex; }
@@ -0,0 +1,184 @@
1
+ ;(function (root) {
2
+ 'use strict'
3
+
4
+ let closeMenu
5
+ let openPanel
6
+
7
+ function mount({ input, context, readSkills, t, panel, chipClass, chipAttribute }) {
8
+ const menu = document.createElement('div')
9
+ menu.id = input.id + '-suggestions'
10
+ menu.className = 'slash-suggestions'
11
+ menu.hidden = true
12
+ menu.setAttribute('role', 'listbox')
13
+ input.setAttribute('aria-autocomplete', 'list')
14
+ input.setAttribute('aria-controls', menu.id)
15
+ input.parentElement.prepend(menu)
16
+
17
+ let catalog = null, matches = [], selected = null
18
+ const query = () => /^[ \t]*\/([a-z0-9_-]*)$/i.exec(input.value)?.[1]?.toLowerCase()
19
+
20
+ function readCommands(scope) {
21
+ const path = '/remote/api/command?sessionId=' + encodeURIComponent(scope.sessionId)
22
+ return fetch(scope.url(path), { headers: scope.headers, signal: AbortSignal.timeout(5000) })
23
+ .then(response => response.ok ? response.json() : null)
24
+ .then(result => Array.isArray(result?.commands) ? result.commands : null)
25
+ }
26
+
27
+ const named = item => typeof item?.name === 'string' && /^[a-z0-9][a-z0-9_-]{0,199}$/.test(item.name)
28
+ let panelRequest = 0
29
+ const shortcuts = panel ? [...panel.querySelectorAll(`[${chipAttribute}]`)] : []
30
+ openPanel = async () => {
31
+ if (!panel) return
32
+ const request = ++panelRequest
33
+ const scope = context()
34
+ panel.replaceChildren(...shortcuts)
35
+ if (!scope) return
36
+ try {
37
+ const commands = await readCommands(scope)
38
+ if (request !== panelRequest || !scope.valid() || !commands) return
39
+ const entries = new Map(shortcuts.map(chip => [chip.getAttribute(chipAttribute).slice(1), chip]))
40
+ const names = new Set()
41
+ const chips = []
42
+ for (const item of commands) {
43
+ if (!named(item) || item.name === 'permission' || names.has(item.name)) continue
44
+ names.add(item.name)
45
+ const chip = entries.get(item.name) || document.createElement('button')
46
+ if (!entries.has(item.name)) {
47
+ chip.type = 'button'
48
+ chip.className = chipClass
49
+ chip.setAttribute(chipAttribute, '/' + item.name)
50
+ chip.textContent = '/' + item.name + (item.description ? ' ' + item.description : '')
51
+ }
52
+ chips.push(chip)
53
+ }
54
+ panel.replaceChildren(...chips)
55
+ } catch { /* Keep shortcuts available on gateways without a command directory. */ }
56
+ }
57
+
58
+ function close() {
59
+ const visible = !menu.hidden
60
+ catalog = null
61
+ matches = []
62
+ selected = null
63
+ menu.hidden = true
64
+ menu.replaceChildren()
65
+ input.removeAttribute('aria-activedescendant')
66
+ return visible
67
+ }
68
+ closeMenu = close
69
+
70
+ function highlight() {
71
+ const index = matches.findIndex(item => item.name === selected)
72
+ for (const [i, option] of [...menu.children].entries()) {
73
+ option.setAttribute('aria-selected', String(index === i))
74
+ }
75
+ const option = menu.children[index]
76
+ if (option) {
77
+ input.setAttribute('aria-activedescendant', option.id)
78
+ option.scrollIntoView({ block: 'nearest' })
79
+ } else input.removeAttribute('aria-activedescendant')
80
+ }
81
+
82
+ function render() {
83
+ const prefix = query()
84
+ if (prefix === undefined || !catalog?.valid() || document.activeElement !== input) {
85
+ close()
86
+ return
87
+ }
88
+ const names = new Map()
89
+ for (const item of [...catalog.commands, ...catalog.skills]) {
90
+ if (!named(item)) continue
91
+ if (!names.has(item.name) && item.name.startsWith(prefix)) names.set(item.name, item)
92
+ }
93
+ matches = [...names.values()]
94
+ menu.setAttribute('aria-label', t('slash.suggestions'))
95
+ menu.replaceChildren(...matches.map((item, index) => {
96
+ const option = document.createElement('button')
97
+ option.type = 'button'
98
+ option.tabIndex = -1
99
+ option.id = menu.id + '-' + index
100
+ option.dataset.index = index
101
+ option.setAttribute('role', 'option')
102
+ const title = document.createElement('span')
103
+ title.className = 'slash-suggestion-title'
104
+ title.textContent = '/' + item.name + (item.hint ? ' ' + item.hint : '')
105
+ const kind = document.createElement('span')
106
+ kind.className = 'slash-suggestion-kind'
107
+ kind.textContent = t(item.kind === 'skill' ? 'slash.skill' : 'slash.command')
108
+ option.append(title, kind)
109
+ if (item.description) {
110
+ const description = document.createElement('span')
111
+ description.className = 'slash-suggestion-description'
112
+ description.textContent = item.description
113
+ option.append(description)
114
+ }
115
+ return option
116
+ }))
117
+ menu.hidden = !matches.length
118
+ highlight()
119
+ }
120
+
121
+ function refresh(event) {
122
+ if (event.isComposing) return close()
123
+ if (query() === undefined) return close()
124
+ if (!catalog?.valid()) {
125
+ const scope = context()
126
+ if (!scope) return close()
127
+ const pending = { ...scope, commands: [], skills: [] }
128
+ catalog = pending
129
+ function receive(kind, rows) {
130
+ if (catalog !== pending) return
131
+ pending[kind] = Array.isArray(rows) ? rows.map(item => ({
132
+ ...item, kind: kind === 'skills' ? 'skill' : 'command',
133
+ })) : []
134
+ render()
135
+ }
136
+ void readCommands(scope).then(rows => receive('commands', rows)).catch(() => {})
137
+ void readSkills(scope.sessionId).then(result => receive('skills', result?.skills)).catch(() => {})
138
+ }
139
+ selected = null
140
+ render()
141
+ }
142
+
143
+ function choose(item) {
144
+ if (!item || !catalog?.valid() || query() === undefined) return close()
145
+ close()
146
+ input.value = '/' + item.name + ' '
147
+ input.focus()
148
+ input.setSelectionRange(input.value.length, input.value.length)
149
+ input.dispatchEvent(new Event('input', { bubbles: true }))
150
+ }
151
+
152
+ input.addEventListener('input', refresh)
153
+ input.addEventListener('compositionend', refresh)
154
+ input.addEventListener('focus', refresh)
155
+ input.addEventListener('blur', close)
156
+ menu.addEventListener('mousedown', event => event.preventDefault())
157
+ menu.addEventListener('click', event => {
158
+ const option = event.target.closest('[data-index]')
159
+ if (option) choose(matches[Number(option.dataset.index)])
160
+ })
161
+ input.addEventListener('keydown', event => {
162
+ if (event.isComposing || event.defaultPrevented || !catalog) return
163
+ if (event.key === 'Escape') {
164
+ event.preventDefault()
165
+ event.stopPropagation()
166
+ close()
167
+ return
168
+ }
169
+ if (menu.hidden || !catalog.valid() || query() === undefined || event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) return
170
+ const index = matches.findIndex(item => item.name === selected)
171
+ if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
172
+ event.preventDefault()
173
+ const next = event.key === 'ArrowDown' ? index + 1 : index < 0 ? matches.length - 1 : index - 1
174
+ selected = matches[(next + matches.length) % matches.length].name
175
+ highlight()
176
+ } else if (event.key === 'Tab' || (event.key === 'Enter' && index >= 0)) {
177
+ event.preventDefault()
178
+ choose(matches[Math.max(0, index)])
179
+ }
180
+ })
181
+ }
182
+
183
+ root.DshSlashSuggestions = { mount, close: () => closeMenu?.(), openPanel: () => openPanel?.() }
184
+ })(window)
@@ -36,6 +36,8 @@
36
36
  .subtree-detail{position:sticky;top:0;min-width:0;padding:21px;border:1px solid var(--dsr-line);border-radius:16px;background:var(--dsr-panel)}
37
37
  .subtree-eyebrow{font-size:11px;color:var(--dsr-muted);letter-spacing:.06em}.subtree-detail h3{font-size:18px;line-height:1.4;margin:9px 0 12px;overflow-wrap:anywhere}
38
38
  .subtree-detail-badges{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:20px}.subtree-kind{font-size:11px;color:var(--dsr-muted)}
39
+ .subtree-agent-name{font-size:11px;color:var(--dsr-muted);overflow-wrap:anywhere}
40
+ .subtree-badge[data-activity="completed"]{color:var(--dsr-success)}
39
41
  .subtree-field-label{margin-top:16px;font-size:11px;color:var(--dsr-muted)}.subtree-path{font-size:12px;line-height:1.7;margin:5px 0 0;overflow-wrap:anywhere}
40
42
  .subtree-id{display:block;font-size:11px;line-height:1.6;margin-top:6px;padding:8px;border-radius:7px;background:var(--dsr-code-bg);overflow-wrap:anywhere;user-select:text}
41
43
  .subtree-parent{max-width:100%;min-width:44px;min-height:44px;text-align:start;overflow-wrap:anywhere;padding:4px 0;border:0;background:transparent;color:var(--dsr-accent-strong)!important;font-size:12px!important}
@@ -26,32 +26,35 @@
26
26
  return ({ unsupported: text('当前版本无法识别此任务类型', 'This task type is not supported by the current version'), unavailable: text('记录暂时无法读取,可刷新重试', 'Record unavailable. Refresh to try again'), corrupt: text('任务信息不一致,暂不能打开', 'Task information is inconsistent. This record cannot be opened'), cycle: text('目录关系重复或形成循环', 'The catalog contains a repeated or circular relationship') })[reason] || text('此目录项暂时不可用', 'This catalog entry is unavailable')
27
27
  }
28
28
  function status(entry, diagnostic) {
29
- const value = diagnostic ? 'diagnostic' : ['running', 'waiting', 'inactive'].includes(entry.activity) ? entry.activity : 'unknown'
30
- const el = node('span', diagnostic ? text('目录异常', 'Catalog issue') : activityLabel(value), 'subtree-badge')
29
+ const value = diagnostic ? 'diagnostic' : entry.activity === 'inactive' && entry.completed === true ? 'completed' : ['running', 'waiting', 'inactive'].includes(entry.activity) ? entry.activity : 'unknown'
30
+ const el = node('span', diagnostic ? text('目录异常', 'Catalog issue') : value === 'completed' ? text('已完成', 'Completed') : activityLabel(value), 'subtree-badge')
31
31
  el.dataset.activity = value
32
32
  return el
33
33
  }
34
34
  function model(v) {
35
35
  const rootItem = { key: 'root', id: v.id, label: v.options.title || v.id, parent: null, depth: 0, entry: { activity: v.options.activity }, children: [] }
36
36
  const byKey = new Map([['root', rootItem]])
37
- let count = 0, running = 0, issues = 0, limited = false
37
+ let count = 0, running = 0, completed = 0, issues = 0, limited = false
38
38
  function visit(parent, ancestors) {
39
39
  const cached = v.cache.get(parent.id)
40
40
  for (const entry of cached?.value?.entries || []) {
41
41
  if (byKey.size > 300) { limited = true; break }
42
- const diagnostic = entry.kind === 'diagnostic' || !entry.id || ancestors.has(entry.id)
43
- const item = { key: parent.key + '/' + (entry.id ? encodeURIComponent(entry.id) : 'unknown-' + parent.children.length), id: entry.id || '', label: entry.label || entry.id?.slice(0, 12) || text('异常条目', 'Catalog issue'), entry, parent, depth: parent.depth + 1, diagnostic, reason: ancestors.has(entry.id) ? 'cycle' : entry.reason, children: [] }
42
+ const duplicate = !!entry.id && parent.children.some(item => item.id === entry.id)
43
+ const diagnostic = entry.kind === 'diagnostic' || !entry.id || ancestors.has(entry.id) || duplicate
44
+ const segment = entry.id && !duplicate ? encodeURIComponent(entry.id) : 'issue:' + parent.children.length
45
+ const item = { key: parent.key + '/' + segment, id: entry.id || '', label: entry.label || entry.name || entry.id?.slice(0, 12) || text('异常条目', 'Catalog issue'), entry, parent, depth: parent.depth + 1, diagnostic, reason: duplicate || ancestors.has(entry.id) ? 'cycle' : entry.reason, children: [] }
44
46
  byKey.set(item.key, item); parent.children.push(item)
45
47
  if (diagnostic) issues++
46
48
  else {
47
49
  count++; if (entry.activity === 'running') running++
50
+ if (entry.activity === 'inactive' && entry.completed === true) completed++
48
51
  if (item.depth < 16) visit(item, new Set([...ancestors, item.id]))
49
52
  else if (entry.hasChildren !== false) limited = true
50
53
  }
51
54
  }
52
55
  }
53
56
  visit(rootItem, new Set([v.id]))
54
- return { rootItem, byKey, count, running, issues, limited }
57
+ return { rootItem, byKey, count, running, completed, issues, limited }
55
58
  }
56
59
  async function read(v, id, force = false) {
57
60
  if (!valid(v)) return
@@ -126,11 +129,17 @@
126
129
  }, 'subtree-parent subtree-back-to-tree', 'back-to-tree'))
127
130
  box.append(node('div', text('节点详情', 'Node details'), 'subtree-eyebrow'))
128
131
  const title = v.detailTitle = node('h3', item.label); title.tabIndex = -1; box.append(title)
132
+ if (item.entry.name && item.entry.name !== item.label) box.append(node('code', item.entry.name, 'subtree-agent-name'))
129
133
  if (outsideFilter) box.append(node('p', text('此选中节点不在当前筛选结果中。', 'This selected node is outside the current filter.'), 'subtree-note'))
130
134
  const badges = node('div', undefined, 'subtree-detail-badges')
131
135
  if (item.key === 'root') badges.append(node('span', text('当前会话', 'Current session'), 'subtree-kind'))
132
136
  else badges.append(node('span', item.diagnostic ? text('不可打开', 'Unavailable') : modeLabel(item.entry.mode), 'subtree-kind'))
133
137
  badges.append(status(item.entry, item.diagnostic)); box.append(badges)
138
+ if (Number.isFinite(item.entry.durationMs) && item.entry.durationMs >= 0) {
139
+ const seconds = Math.floor(item.entry.durationMs / 1000)
140
+ const duration = seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m ${seconds % 60}s`
141
+ box.append(node('p', text('运行时长 ', 'Run time ') + duration, 'subtree-note'))
142
+ }
134
143
  const path = []; for (let p = item; p; p = p.parent) path.unshift(p.label)
135
144
  box.append(node('div', text('所在分支', 'Branch'), 'subtree-field-label'), node('p', path.join(' › '), 'subtree-path'))
136
145
  if (item.parent) {
@@ -153,7 +162,15 @@
153
162
  }, 'subtree-action subtree-primary', 'open:' + item.key))
154
163
  const parentCatalog = item.parent && v.cache.get(item.parent.id)?.value
155
164
  if (item.entry.mode === 'continuable' && item.entry.activity === 'running' && parentCatalog?.parentAvailable !== false) {
156
- actions.append(button(text('中断任务', 'Interrupt task'), () => { if (valid(v)) void v.options.interrupt(item.id, item.parent.id) }, 'subtree-action subtree-danger', 'interrupt:' + item.key))
165
+ const interrupt = button(text('中断任务', 'Interrupt task'), async () => {
166
+ if (!valid(v) || v.stopping.has(item.id)) return
167
+ v.stopping.add(item.id); paint(v)
168
+ try {
169
+ if (await v.options.interrupt(item.id, item.parent.id)) await read(v, item.parent.id, true)
170
+ } finally { v.stopping.delete(item.id); if (valid(v)) paint(v) }
171
+ }, 'subtree-action subtree-danger', 'interrupt:' + item.key)
172
+ interrupt.disabled = v.stopping.has(item.id)
173
+ actions.append(interrupt)
157
174
  }
158
175
  box.append(actions, node('p', item.parent ? text('打开记录后,返回会进入它的直接父会话。', 'From a record, Back opens its direct parent session.') : text('选择树中的子代理,查看任务详情。', 'Select a subagent in the tree to inspect its details.'), 'subtree-note'))
159
176
  }
@@ -163,7 +180,7 @@
163
180
  const m = model(v), query = v.query.trim().toLocaleLowerCase(), filtering = !!query || v.filter !== 'all'
164
181
  const matches = new Set()
165
182
  function match(item) {
166
- const own = (!query || `${item.label} ${item.id}`.toLocaleLowerCase().includes(query)) && (v.filter === 'all' || (v.filter === 'diagnostic' ? item.diagnostic : !item.diagnostic && item.entry.activity === 'running'))
183
+ const own = (!query || `${item.label} ${item.entry.name || ''} ${item.id}`.toLocaleLowerCase().includes(query)) && (v.filter === 'all' || (v.filter === 'diagnostic' ? item.diagnostic : !item.diagnostic && item.entry.activity === 'running'))
167
184
  const descendant = item.children.map(match).some(Boolean)
168
185
  if (own || descendant) matches.add(item.key)
169
186
  return own || descendant
@@ -173,7 +190,10 @@
173
190
  v.collapseButton.disabled = filtering
174
191
  v.collapseButton.title = filtering ? text('清除筛选后可收起分支', 'Clear filters to collapse branches') : ''
175
192
  for (const [key, b] of v.filters) b.setAttribute('aria-pressed', String(key === v.filter))
176
- const labels = [text(`已读取 ${m.count} 个子代理`, `${m.count} subagents loaded`), text(`${m.running} 个运行中`, `${m.running} running`), text(`${m.issues} 个目录异常`, `${m.issues} catalog issues`)]
193
+ const labels = [text(`已读取 ${m.count} 个子代理`, `${m.count} subagents loaded`)]
194
+ if (m.running) labels.push(text(`${m.running} 个运行中`, `${m.running} running`))
195
+ if (m.completed) labels.push(text(`${m.completed} 个已完成`, `${m.completed} completed`))
196
+ if (m.issues) labels.push(text(`${m.issues} 个目录异常`, `${m.issues} catalog issues`))
177
197
  if (v.summarySignature !== labels.join('|')) {
178
198
  v.summarySignature = labels.join('|'); v.summary.replaceChildren()
179
199
  for (const label of labels) v.summary.append(node('span', label))
@@ -210,6 +230,7 @@
210
230
  card.setAttribute('aria-pressed', String(item.key === v.selected)); card.title = item.id
211
231
  const head = node('span', undefined, 'subtree-node-head'); head.append(node('strong', item.label), status(item.entry, item.diagnostic))
212
232
  const meta = node('span', undefined, 'subtree-node-meta')
233
+ if (item.entry.name && item.entry.name !== item.label) meta.append(node('code', item.entry.name, 'subtree-agent-name'))
213
234
  meta.append(node('span', item.key === 'root' ? text('当前会话 · 树的起点', 'Current session · Tree root') : item.diagnostic ? reasonLabel(item.reason) : modeLabel(item.entry.mode)))
214
235
  if (item.depth >= 4) meta.append(node('span', text(`第 ${item.depth} 层`, `Level ${item.depth}`), 'subtree-depth'))
215
236
  if (!item.diagnostic && cached?.value && item.children.length) meta.append(node('span', text(`${item.children.length} 个下级条目`, `${item.children.length} child entries`)))
@@ -263,7 +284,7 @@
263
284
  if (!view || view.id !== options.sessionId || !view.options.valid()) {
264
285
  if (view) memories.set(view.id, view.expanded)
265
286
  if (memories.size > 20) memories.delete(memories.keys().next().value)
266
- view = { id: options.sessionId, options, expanded: memories.get(options.sessionId) || new Set([options.sessionId]), cache: new Map(), paused: false, query: '', filter: 'all', selected: 'root' }; shell(view)
287
+ view = { id: options.sessionId, options, expanded: memories.get(options.sessionId) || new Set([options.sessionId]), cache: new Map(), stopping: new Set(), paused: false, query: '', filter: 'all', selected: 'root' }; shell(view)
267
288
  }
268
289
  view.options = options; view.paused = false; target.append(view.el); paint(view)
269
290
  const cached = view.cache.get(view.id)
@@ -1,5 +1,5 @@
1
- /* DSH Remote · 移动优先 · 十二皮肤(默认深空/深色落日/亮色易北爱乐厅/中性草原孤塔/黑曜白/亮色蓝色大肥鱼/亮色企鹅女管白昼/深色企鹅女管极夜/亮色波奇酱/亮色伊地知虹夏/亮色山田凉/亮色喜多郁代)
2
- * 统一 --dsr-* 变量; 主题由 <html data-theme="default|dark|light|neutral|mono|fish|penguin|penguin-night|bocchi|nijika|ryo|kita"> 驱动, theme.js 持久化。
1
+ /* DSH Remote · 移动优先
2
+ * 统一 --dsr-* 变量。主题由 html[data-theme] 驱动,theme.js 持久化。
3
3
  * 红绿色弱友好原则: 状态语义色之外, 品牌色使用蓝/青 + 橙/紫系, 避免红绿配对。
4
4
  * 角色皮肤(蓝色大肥鱼/企鹅女管)另有独立皮肤包 public/skins/<name>/skin.css, 只含配色与装饰, 不改布局。 */
5
5
 
@@ -812,6 +812,41 @@ html[data-theme="bocchi"] {
812
812
  color-scheme: light;
813
813
  }
814
814
 
815
+ /* 企鹅物流:夜蓝货站与琥珀信号灯。 */
816
+ html[data-theme="penguin-logistics"] {
817
+ color-scheme: dark;
818
+ --dsr-bg: #12161B;
819
+ --dsr-bg-2: #161D24;
820
+ --dsr-panel: #1D252E;
821
+ --dsr-panel-2: #28343F;
822
+ --dsr-line: #3C4B59;
823
+ --dsr-divider: #A0B9CB30;
824
+ --dsr-text: #F5F1EB;
825
+ --dsr-muted: #B6C3D5;
826
+ --dsr-text-disabled: #8190A5;
827
+ --dsr-accent: #E9B66F;
828
+ --dsr-on-accent: #1C130A;
829
+ --dsr-accent-strong: #F5C78B;
830
+ --dsr-accent-soft: #E9B66F22;
831
+ --dsr-accent-line: #E9B66F70;
832
+ --dsr-accent-2: #8BC0D0;
833
+ --dsr-accent-2-strong: #BDE3EC;
834
+ --dsr-accent-2-soft: #8BC0D020;
835
+ --dsr-accent-2-line: #8BC0D070;
836
+ --dsr-brand-a: #E9B66F;
837
+ --dsr-brand-b: #8BC0D0;
838
+ --dsr-head-bg: #161D24;
839
+ --dsr-nav-bg: #1D252E;
840
+ --dsr-nav-muted: #B6C3D5;
841
+ --dsr-nav-active: #F5C78B;
842
+ --dsr-composer-bg: #1D252E;
843
+ --dsr-head-running-bg: linear-gradient(90deg, #161D24, #263C47, #315463, #263C47, #161D24);
844
+ --dsr-head-running-line: #8BC0D070;
845
+ --dsr-head-interrupted-bg: linear-gradient(90deg, #161D24, #3D2529, #682F32, #3D2529, #161D24);
846
+ --dsr-head-interrupted-line: #FF8F6B85;
847
+ --dsr-glow: #E9B66F50;
848
+ }
849
+
815
850
  /* 结束乐队 · 伊地知虹夏:暖金鼓点,独立亮色主题。 */
816
851
  html[data-theme="nijika"] {
817
852
  --dsr-neutral-0: #FFFFFF;
package/public/theme.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /* DSH Remote 皮肤系统 · 零依赖
2
- * 十二套皮肤: html[data-theme] = default(默认深空) | dark(落日) | light(易北爱乐厅) | neutral(草原孤塔) | mono(黑曜白) | fish(蓝色大肥鱼) | penguin(企鹅女管·白昼) | penguin-night(企鹅女管·极夜) | bocchi(波奇酱) | nijika(伊地知虹夏) | ryo(山田凉) | kita(喜多郁代)
2
+ * 皮肤通过 html[data-theme] 应用。
3
3
  * 优先级: localStorage dshTheme > 蓝色大肥鱼(默认)
4
4
  * set() 写入用户显式选择; applyCurrent() 只应用,不覆盖已有选择。 */
5
5
  'use strict'
6
6
  ;(function () {
7
7
  const KEY = 'dshTheme'
8
8
  const DEFAULT = 'fish'
9
- const VALID = ['default', 'dark', 'light', 'neutral', 'mono', 'fish', 'penguin', 'penguin-night', 'bocchi', 'nijika', 'ryo', 'kita']
9
+ const VALID = ['default', 'dark', 'light', 'neutral', 'mono', 'fish', 'penguin', 'penguin-night', 'bocchi', 'nijika', 'ryo', 'kita', 'penguin-logistics']
10
10
  const mq = window.matchMedia('(prefers-color-scheme: light)')
11
11
  const store = {
12
12
  get(k) { try { return localStorage.getItem(k) } catch { return null } },
@@ -59,10 +59,12 @@
59
59
  const GROUPS = [
60
60
  { id: 'basic', zh: '基础配色', en: 'Essentials', themes: ['default', 'dark', 'light', 'neutral', 'mono'] },
61
61
  { id: 'fish', zh: '蓝色大肥鱼', en: 'Blue Fat Fish', themes: ['fish'] },
62
+ { id: 'arknights', zh: '明日方舟', en: 'Arknights', themes: ['penguin-logistics'] },
62
63
  { id: 'endfield', zh: '明日方舟:终末地', en: 'Arknights: Endfield', themes: ['penguin', 'penguin-night'] },
63
64
  { id: 'bocchi', zh: '孤独摇滚!', en: 'BOCCHI THE ROCK!', themes: ['bocchi', 'nijika', 'ryo', 'kita'] }
64
65
  ]
65
66
  const ART = {
67
+ 'penguin-logistics': 'penguin-logistics/standing.png',
66
68
  fish: 'blue-fish/mascot.png', penguin: 'penguin/mascot.png', 'penguin-night': 'penguin/mascot.png',
67
69
  bocchi: 'bocchi/stand.png', nijika: 'nijika/stand.png', ryo: 'ryo/stand.png', kita: 'kita/stand.png'
68
70
  }
@@ -1,10 +1,14 @@
1
1
  {
2
- "version": "0.8.7",
2
+ "version": "0.8.8",
3
3
  "apkUrl": "dsh-remote.apk",
4
- "sha256": "263b328311bdc357c9431534568b62636fb37a439ca9db1932d07e7547c41633",
5
- "releasedAt": "2026-11-10T07:29:04.130Z",
6
- "notes": "新增主机与手机的公网中转配对引导;修复部分移动网络下实时连接和轮询失败;改进连接切换时的发送状态提示、Android 图片保存及全屏界面。",
4
+ "sha256": "7e95c10ec00567e539f2d89e4f56595f94a9024eabd18192edea0f9aacddf485",
5
+ "releasedAt": "2026-11-14T15:12:16.035Z",
6
+ "notes": "新增《明日方舟》企鹅物流皮肤,支持背景立绘、半透明会话卡与货运纹理。手机和桌面输入框支持斜杠指令与技能补全,改进工具活动、子代理与用时展示。修复 Android 公网加密中转下的发送、回执、历史与客户端更新,并增强 DSH 点号及斜杠 RPC 兼容性和大响应传输完整性。",
7
7
  "history": [
8
+ {
9
+ "version": "0.8.8",
10
+ "notes": "新增《明日方舟》企鹅物流皮肤,支持背景立绘、半透明会话卡与货运纹理。手机和桌面输入框支持斜杠指令与技能补全,改进工具活动、子代理与用时展示。修复 Android 公网加密中转下的发送、回执、历史与客户端更新,并增强 DSH 点号及斜杠 RPC 兼容性和大响应传输完整性。"
11
+ },
8
12
  {
9
13
  "version": "0.8.7",
10
14
  "notes": "新增主机与手机的公网中转配对引导;修复部分移动网络下实时连接和轮询失败;改进连接切换时的发送状态提示、Android 图片保存及全屏界面。"
@@ -40,10 +44,6 @@
40
44
  {
41
45
  "version": "0.7.6",
42
46
  "notes": "修复长提问占满会话导致无法回答,支持点击摘要卡片并在独立滚动弹窗中选择;补齐 Android 后台审批与提问通知、请求去重及会话跳转;支持普通相对路径聊天文件下载,并反馈系统下载完成或失败原因。"
43
- },
44
- {
45
- "version": "0.7.4",
46
- "notes": "修复 Windows Desktop 进程核验拖慢健康检查和管理页的问题:后台缓存并合并探测,测速与首页检测使用存活检查,控制操作仍实时核验身份。修复管理代理超时误报认证失败、操作进度参数丢失、状态轮询竞态及禁用后仍探测 Desktop 崩溃日志。修复桌面对话切换时消息发错会话、压缩状态串会话、归档关闭新会话、服务器切换串用 WS 票据、同源会话导出认证、Desktop 管理页网关地址以及不同本地 IP 同号端口误判。同步修复手机端共享的票据、命令与导出逻辑。继续修复连接切换后旧模型、审批、队列和压缩状态残留,测速覆盖手动选择,新建会话跳错服务器,目标编辑串会话,以及工作台绑定和模型密钥保存串服务器。桌面发送失败保留草稿并避免重复提交。优化实时历史插入、事件列表刷新和子代理查询,修复桌面实时消息被误判无变化;连接切换可立即开始新轮询,旧结果不会覆盖新状态。加强弱网传输:历史与前端资源按需 gzip 压缩、ETag 缓存验证,双通道独立长轮询避免互相阻塞,弱网模式减少历史分页并延长只读等待;Android 后台支持 gzip。修复桌面首次连接依赖系统 prompt 的问题。Android 已完成构建,尚未手机真机验收;本次不提供 HarmonyOS HAP。"
47
47
  }
48
48
  ]
49
49
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.8.7"
2
+ "version": "0.8.8"
3
3
  }
@@ -176,25 +176,33 @@ body.workflow-v8.in-session .history { padding-bottom:calc(var(--composer-height
176
176
  .activity-body { margin-left:26px; margin-right:6px; }
177
177
  }
178
178
  @media(prefers-reduced-motion:reduce) { .activity-state i { animation:none; } .activity-state i::after { display:none; } }
179
- /* 回合内的工具与思考合并成一行;不用卡片,靠缩进表示归属,保持轻量。 */
180
- .chat-activity-group { box-sizing:border-box; width:100%; max-width:780px; margin:2px 0; padding-left:10px; border:0; background:transparent; }
179
+ /* 每段过程保留在回复前,完成的回合由上方耗时开关控制。 */
180
+ .chat-activity-turn { color:var(--dsr-muted); font-size:12px; }
181
+ .chat-activity-turn > summary { display:flex; align-items:center; flex-wrap:wrap; gap:2px 8px; width:fit-content; max-width:100%; min-height:34px; padding:3px 7px; cursor:pointer; list-style:none; border-radius:7px; }
182
+ .chat-activity-turn > summary::-webkit-details-marker { display:none; }
183
+ .chat-activity-turn > summary:hover { background:var(--dsr-panel); }
184
+ .chat-activity-turn > summary:focus-visible { outline:2px solid var(--dsr-accent); outline-offset:2px; }
185
+ .chat-activity-turn > summary > .activity-chevron { flex:none; margin-inline:1px 4px; }
186
+ .chat-activity-turn[open] > summary > .activity-chevron { transform:rotate(45deg); }
187
+ .activity-turn-title { color:var(--dsr-text); font-weight:550; white-space:nowrap; }
188
+ .activity-turn-facts,.activity-turn-time { font-variant-numeric:tabular-nums; }
189
+ .activity-turn-time { padding-inline:6px; border-radius:5px; background:var(--dsr-bg-2); white-space:nowrap; }
190
+ .history-entry[hidden] { display:none!important; }
191
+ .activity-nested-tools { padding-inline-start:10px; border-inline-start:1px solid var(--dsr-divider); }
192
+ .chat-activity-group { box-sizing:border-box; width:100%; max-width:780px; margin:2px 0; border:0; background:transparent; }
181
193
  .chat-activity-group > summary { display:flex; align-items:center; gap:8px; min-height:36px; padding:0 8px 0 6px; box-sizing:border-box; list-style:none; cursor:pointer; color:var(--dsr-muted); font-size:12.5px; line-height:1.5; user-select:none; border-radius:10px; }
182
194
  .chat-activity-group > summary::-webkit-details-marker { display:none; }
183
195
  .chat-activity-group > summary:focus-visible { outline:2px solid var(--dsr-accent); outline-offset:2px; }
184
196
  .chat-activity-group > summary:hover { color:var(--dsr-text); background:var(--dsr-panel); }
185
197
  .chat-activity-group .activity-group-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
186
- .chat-activity-group .activity-group-live { display:inline-flex; align-items:center; flex:none; gap:6px; font-size:11px; color:var(--dsr-accent-strong); }
187
- .chat-activity-group .activity-group-live i { width:6px; height:6px; position:relative; border-radius:50%; background:currentColor; box-shadow:0 0 8px currentColor; animation:activity-pulse 1.6s ease-in-out infinite; }
188
- .chat-activity-group .activity-group-live i::after { content:''; position:absolute; inset:-4px; border-radius:50%; border:1px solid currentColor; opacity:0; animation:activity-ring 1.9s ease-out infinite; }
189
198
  /* 运行中只提亮文字与光点,不加边框或底色块。 */
190
199
  .chat-activity-group.is-running > summary { color:var(--dsr-accent-strong); }
191
200
  .chat-activity-group.is-error > summary { color:var(--dsr-warning); }
192
- .chat-activity-group .activity-chevron { margin-left:auto; }
201
+ .chat-activity-group > summary > .activity-chevron { margin:0 4px 0 1px; flex:none; }
193
202
  .chat-activity-group[open] > summary { color:var(--dsr-text); }
194
- .chat-activity-group[open] .activity-chevron { transform:rotate(45deg); }
195
- .chat-activity-group .activity-group-body { padding:0 0 4px 6px; }
203
+ .chat-activity-group[open] > summary > .activity-chevron { transform:rotate(45deg); }
204
+ .chat-activity-group .activity-group-body { max-height:min(52vh,380px); overflow:auto; overscroll-behavior:contain; margin-inline-start:11px; padding:0 8px 4px 12px; border-inline-start:1px solid var(--dsr-divider); }
196
205
  .chat-activity-group .activity-group-body .chat-activity { margin:2px 0; }
197
- @media (prefers-reduced-motion:reduce) { .chat-activity-group .activity-group-live i { animation:none; } .chat-activity-group .activity-group-live i::after { display:none; } }
198
206
  /* Secondary pages use the same title, surface and control rhythm as More. */
199
207
  .workflow-v8 .workflow-subpage { box-sizing:border-box; width:100%; max-width:760px; margin-inline:auto; padding:0 0 24px; border:0; border-radius:0; background:transparent; gap:0; }
200
208
  .workflow-subpage-head { padding:8px 0 24px; }
@@ -76,7 +76,9 @@
76
76
  item.append(element('strong','',row.method),element('code','',row.id),
77
77
  element('span','workflow-muted',remote
78
78
  ? label('结果待确认(来自其他连接,切回后可查询)','Unconfirmed (from another connection; switch back to check)')
79
- : label('结果待确认,不会自动重复提交','Unconfirmed; never automatically submitted again')))
79
+ : row.receiptMissing
80
+ ? label('网关找不到回执。请核对会话后结束跟踪。','The gateway has no receipt. Check the conversation before ending tracking.')
81
+ : label('结果待确认,不会自动重复提交','Unconfirmed; never automatically submitted again')))
80
82
  if(remote&&row.origin)item.append(element('p','workflow-muted',row.origin))
81
83
  if(!remote){
82
84
  const check=button('查询结果','Check result',async()=>{
@@ -84,7 +86,10 @@
84
86
  try {
85
87
  const value=await root.DshOperations.check(row.id)
86
88
  if(!sheet.open||target!==operationList)return
87
- item.append(element('p','',value?label('当前状态:','Status: ')+value.phase:label('暂时无法确认,请核对会话。','Unable to confirm. Check the conversation.')))
89
+ const status = value?.receiptMissing
90
+ ? label('网关找不到回执,请核对会话。','The gateway has no receipt. Check the conversation.')
91
+ : value ? label('当前状态:','Status: ')+value.phase : label('暂时无法确认,请核对会话。','Unable to confirm. Check the conversation.')
92
+ item.append(element('p','',status))
88
93
  if(value?.phase==='complete'){config.refresh();config.recover?.(row,value);check.remove()}
89
94
  }catch{item.append(element('p','',label('网络不可达,可稍后查询。','Network unavailable. Check later.')))}
90
95
  finally{check.disabled=false}
@@ -248,7 +253,6 @@
248
253
  button('导出会话','Export conversation',()=>{actions.close();void config.command('/export')}),
249
254
  button('压缩上下文','Compact context',()=>{actions.close();void config.command('/compact')}))
250
255
  }
251
- for(const el of document.querySelectorAll('[data-cmd="/compact"],[data-cmd="/export"],[data-ds-cmd="/compact"],[data-ds-cmd="/export"]'))el.remove()
252
256
  }
253
257
  function setupSecondaryPages() {
254
258
  const definitions={