dsh-remote-plugin 0.8.7 → 0.9.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 (70) hide show
  1. package/README.en.md +16 -5
  2. package/README.md +15 -4
  3. package/apk/dsh-remote.apk +0 -0
  4. package/gateway.cjs +659 -130
  5. package/index.mjs +33 -1
  6. package/package.json +8 -3
  7. package/public/activity.js +196 -52
  8. package/public/admin.html +34 -32
  9. package/public/admin.js +11 -2
  10. package/public/app.js +1341 -223
  11. package/public/bc-integration.css +81 -0
  12. package/public/build.json +2 -2
  13. package/public/composer-tools.css +184 -0
  14. package/public/composer-tools.js +888 -0
  15. package/public/desktop/desktop.html +104 -76
  16. package/public/desktop/desktop.js +668 -101
  17. package/public/diagnostics.js +30 -4
  18. package/public/e2ee-transport.js +154 -7
  19. package/public/file-inbox.js +77 -18
  20. package/public/genui.css +10 -0
  21. package/public/genui.js +22 -4
  22. package/public/history.js +15 -2
  23. package/public/host-queue.js +232 -0
  24. package/public/host-schedule.js +301 -0
  25. package/public/host-state.css +19 -0
  26. package/public/index.html +347 -140
  27. package/public/md.js +21 -1
  28. package/public/network.js +33 -1
  29. package/public/onboarding.js +3 -3
  30. package/public/operations.js +26 -12
  31. package/public/plan-review.css +297 -0
  32. package/public/plan-review.js +621 -0
  33. package/public/plugin.html +29 -27
  34. package/public/relay-autopair.js +25 -10
  35. package/public/relay-settings.css +11 -0
  36. package/public/relay-settings.js +350 -28
  37. package/public/session-management.css +61 -0
  38. package/public/session-management.js +742 -0
  39. package/public/session-search.css +137 -0
  40. package/public/session-search.js +977 -0
  41. package/public/skins/blue-fish/preview.html +3 -3
  42. package/public/skins/bocchi/preview.html +5 -5
  43. package/public/skins/kita/preview.html +6 -6
  44. package/public/skins/miku/SOURCES.json +10 -0
  45. package/public/skins/miku/chibi.png +0 -0
  46. package/public/skins/miku/preview.html +33 -0
  47. package/public/skins/miku/skin.css +82 -0
  48. package/public/skins/nijika/preview.html +6 -6
  49. package/public/skins/penguin/preview.html +3 -3
  50. package/public/skins/penguin-logistics/cargo.svg +4 -0
  51. package/public/skins/penguin-logistics/console.svg +4 -0
  52. package/public/skins/penguin-logistics/mark.svg +4 -0
  53. package/public/skins/penguin-logistics/radio.svg +4 -0
  54. package/public/skins/penguin-logistics/skin.css +292 -0
  55. package/public/skins/penguin-logistics/standing.png +0 -0
  56. package/public/skins/ryo/preview.html +6 -6
  57. package/public/slash-suggestions.css +43 -0
  58. package/public/slash-suggestions.js +196 -0
  59. package/public/sponsor-entry.js +11 -3
  60. package/public/styles.css +141 -21
  61. package/public/subagents.css +7 -0
  62. package/public/subagents.js +83 -10
  63. package/public/theme-vars.css +102 -3
  64. package/public/theme.js +7 -4
  65. package/public/turn-diff.css +323 -0
  66. package/public/turn-diff.js +778 -0
  67. package/public/update.json +12 -12
  68. package/public/version.json +1 -1
  69. package/public/workflow.css +322 -43
  70. package/public/workflow.js +148 -44
package/public/md.js CHANGED
@@ -56,10 +56,30 @@
56
56
  const local = /^(?:[A-Za-z]:[\\/]|\\\\|\/|\.{1,2}[\\/]|[^:\s]+[\\/])/.test(target)
57
57
  || /^[^:\s]+\.(?:png|jpe?g|gif|webp|bmp|svg|avif)$/i.test(target)
58
58
  if (!local) return null
59
+ return localImageHtml(target, label)
60
+ }
61
+
62
+ function localImageHtml(target, label) {
59
63
  return '<button type="button" class="chat-image is-loading" data-chat-image data-chat-image-path="' + escapeHtml(target) +
60
64
  '" data-chat-image-alt="' + label + '" aria-label="' + label + '"><span class="chat-image-status">' + label + '</span></button>'
61
65
  }
62
66
 
67
+ function genuiImageHtml(target, alt, options) {
68
+ if (!options?.fileLinks || Array.isArray(options.imageHosts) || typeof target !== 'string') return null
69
+ if (/^\/(?:api|fs)\/file\?/.test(target)) {
70
+ const query = new URLSearchParams(target.slice(target.indexOf('?') + 1))
71
+ target = query.size === 1 ? query.get('path') || '' : ''
72
+ }
73
+ if (/^file:/i.test(target)) target = files?.pathOf?.(target) || ''
74
+ // Use the existing authenticated file-image path for this session, including
75
+ // URLs from the host's file picker. Never fetch a model-provided URL directly.
76
+ if (target.length > 4096 || /[\x00-\x1f?#]/.test(target) || !/\.(?:png|jpe?g|gif|webp|bmp|avif)$/i.test(target)) return null
77
+ const drive = /^[A-Za-z]:[\\/]/.test(target)
78
+ const localPath = !/^[\\/]{2}/.test(target) && (target.startsWith('/') || files?.relativePath?.(target))
79
+ if (!drive && !localPath) return null
80
+ return localImageHtml(target, escapeHtml(alt || imageLabel))
81
+ }
82
+
63
83
  function inline(s, fileLinks, imageHosts) {
64
84
  // Pull images out before inline emphasis/link rules so alt text and URLs stay intact.
65
85
  const images = []
@@ -306,7 +326,7 @@
306
326
  if (options?.richContent !== false && genui && part.closed && code.length <= 200000) {
307
327
  try {
308
328
  if (/^(?:dsh-ui|json dsh-ui|dsh-ui json)$/.test(language)) {
309
- out += genui.render(JSON.parse(code)); continue
329
+ out += genui.render(JSON.parse(code), { image: (src, alt) => genuiImageHtml(src, alt, options) }); continue
310
330
  }
311
331
  if (language === 'html' || language === 'htm') {
312
332
  out += genui.html(code) + '<details><summary>HTML / 源码</summary>' + codeHtml(code, options, language) + '</details>'; continue
package/public/network.js CHANGED
@@ -22,6 +22,38 @@
22
22
  const job=Promise.resolve().then(read).finally(()=>{if(sharedReads.get(key)===job)sharedReads.delete(key)})
23
23
  sharedReads.set(key,job);return job
24
24
  }
25
+ // Public health covers reachability. Automatic selection also needs proof
26
+ // that the gateway accepts this saved credential.
27
+ async function probeGateway(base, { headers, onHealth } = {}) {
28
+ const url = String(base || '').replace(/\/+$/, '')
29
+ if (!url || (headers && !headers.authorization)) return Infinity
30
+ try {
31
+ return await readWithDeadline(async signal => {
32
+ const started = root.performance.now()
33
+ const response = await root.fetch(url + '/health?probe=live&t=' + Date.now(), { signal, cache: 'no-store' })
34
+ if (!response.ok) return Infinity
35
+ const health = await response.json().catch(() => null)
36
+ if (signal.aborted) return Infinity
37
+ if (health && typeof health === 'object') onHealth?.(health)
38
+ const latency = Math.round(root.performance.now() - started)
39
+ if (!headers) return latency
40
+ const options = { headers, signal, cache: 'no-store', redirect: 'error' }
41
+ const auth = await root.fetch(url + '/diagnostics', options)
42
+ if (auth.ok) {
43
+ const result = await auth.json().catch(() => null)
44
+ if (result?.schema === 1 && typeof result.gateway?.version === 'string') return latency
45
+ } else if (![404, 405, 501].includes(auth.status)) {
46
+ return Infinity
47
+ }
48
+ // Older gateways still authenticate the read-only event poll.
49
+ const legacy = await root.fetch(url + '/api/events.poll?kind=host&wait=0', options)
50
+ void legacy.body?.cancel().catch(() => {})
51
+ return legacy.ok && /^application\/json\b/i.test(legacy.headers.get('content-type') || '') ? latency : Infinity
52
+ }, 3500)
53
+ } catch {
54
+ return Infinity
55
+ }
56
+ }
25
57
  function mode(){try{return ['auto','weak','normal'].includes(root.localStorage.getItem('dshNetworkModeV1'))?root.localStorage.getItem('dshNetworkModeV1'):'auto'}catch{return 'auto'}}
26
58
  function profile(){
27
59
  const selected=mode(),connection=root.navigator?.connection
@@ -94,7 +126,7 @@
94
126
  if(streamTitle)streamTitle.textContent=english?'No streaming on weak networks':'弱网时关闭流式输出'
95
127
  if(streamDetail)streamDetail.textContent=english?'Show only finished messages and tool results on weak networks; live thinking and calls that have not returned stay hidden.':'弱网下只显示已完成的消息和工具结果,隐藏流式思考和尚未返回的工具调用;标准网络不受影响。'
96
128
  }
97
- const api={profile,setMode,PollLoop,shareRead,readWithDeadline,observeLatency:ms=>{if(Number.isFinite(ms))measuredLatency=ms},preferences,streamTrimmed}
129
+ const api={profile,setMode,PollLoop,shareRead,readWithDeadline,probeGateway,observeLatency:ms=>{if(Number.isFinite(ms))measuredLatency=ms},preferences,streamTrimmed}
98
130
  if(typeof module!=='undefined'&&module.exports)module.exports=api
99
131
  else{root.DshNetwork=api;root.document.addEventListener('DOMContentLoaded',()=>{preferences();new MutationObserver(preferences).observe(root.document.documentElement,{attributes:true,attributeFilter:['lang']})})}
100
132
  })(typeof window==='undefined'?globalThis:window)
@@ -11,7 +11,7 @@
11
11
  ['在电脑的 DSH 中安装 Remote 插件,打开插件里的连接向导。手机选择“扫码连接”,扫描连接码;下载 APK 的二维码用于安装,不能拿来配对。', 'Install Remote in DSH on the computer and open its connection wizard. Scan the connection QR on the phone; the APK download QR installs the app and does not pair it.'],
12
12
  ['同一 Wi-Fi 下可用局域网地址。离开家后需要可达的中转或组网地址;手机里的 localhost 指向手机自己。', 'Use the LAN address on the same Wi-Fi. Away from home, use a reachable relay or private-network address. On a phone, localhost means the phone itself.'],
13
13
  ['连接码含访问凭证,请不要公开截图。“主机与连接”可以重新扫码或修改地址。', 'Connection QR codes contain credentials. Keep them private. Hosts and connections lets you scan again or edit addresses.']
14
- ], action: ['打开主机与连接', 'Open hosts and connections'], target: '#workflow-connection' },
14
+ ], action: ['打开主机与连接', 'Open hosts and connections'], target: '#conn-badge' },
15
15
  { id: 'session', title: ['选择工作区,打开一段对话', 'Choose a workspace and open a conversation'],
16
16
  body: ['工作区是电脑上的项目目录;会话是在这个目录里进行的一段对话。可以打开已有会话,也可以新建。', 'A workspace is a project folder on the computer. A conversation works in that folder. Open an existing conversation or create one.'],
17
17
  tips: [
@@ -214,7 +214,7 @@
214
214
  restart.querySelector('.setting-desc').textContent = done
215
215
  ? text('重新查看连接、对话与常见操作', 'Revisit connection, chat and common actions')
216
216
  : text('按步骤熟悉连接、对话与常见操作', 'Learn connection, chat and common actions step by step')
217
- entry.hidden = done
217
+ entry.hidden = done || (progress.status === 'new' && !!live.hasSessions)
218
218
  return
219
219
  }
220
220
  entry.hidden = true
@@ -239,7 +239,7 @@
239
239
  card = el('section', 'onboarding-coach'); card.id = 'onboarding-coach'; card.tabIndex = -1
240
240
  card.setAttribute('aria-labelledby', 'onboarding-title'); card.hidden = true
241
241
  entry = button('', () => start(), 'onboarding-entry'); entry.id = 'onboarding-entry'
242
- entry.append(el('strong'), el('span')); $('view-home').prepend(entry)
242
+ entry.append(el('strong'), el('span')); $('view-home').append(entry)
243
243
  restart = button('', () => start(true), 'workflow-setting-link onboarding-restart'); restart.id = 'onboarding-restart'
244
244
  const mark = el('span', 'workflow-setting-icon onboarding-restart-icon'); mark.setAttribute('aria-hidden', 'true')
245
245
  const copy = el('span', 'onboarding-restart-copy'); copy.append(el('span', 'setting-name'), el('span', 'setting-desc'))
@@ -1,9 +1,10 @@
1
1
  /* Durable write receipts. POST once, recover using GET only; zero dependencies. */
2
2
  ;(function(root) {
3
3
  'use strict'
4
- const methods = new Set(['session.fork','session.create','session.prompt','session.updateQueue','session.selectModel',
4
+ const hostStateWrites = new Set(['session.updateQueue','schedule.create','schedule.edit','schedule.run'])
5
+ const methods = new Set(['session.fork','session.create','session.prompt','session.selectModel',
5
6
  'session.rename','session.cancel','workspace.create','workspace.archiveSession',
6
- 'goal.edit','goal.pause','goal.resume','goal.complete','goal.clear'])
7
+ 'goal.edit','goal.pause','goal.resume','goal.complete','goal.clear','session.continue',...hostStateWrites])
7
8
  const pending = new Map()
8
9
  const storageKey = 'dshRemoteOperationReceiptsV1'
9
10
  // Scope of the connection the UI is currently showing. Receipts from another
@@ -52,18 +53,27 @@
52
53
  return scope
53
54
  }
54
55
  const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
55
- function unknown(id) {
56
- const error = new Error((root.I18N?.lang === 'en' ? 'Result unconfirmed. The operation may already have been applied. Check before trying again. Operation: ' : '结果未确认,操作可能已生效。请先核对会话,再决定是否重试。操作编号:') + id)
57
- error.operationId = id; error.operationPending = true
56
+ function unknown(id, receiptMissing = false) {
57
+ const en = root.I18N?.lang === 'en'
58
+ const message = receiptMissing
59
+ ? (en ? 'The gateway has no receipt for this operation. Check the conversation, then use Check receipts to finish tracking before resending. Operation: '
60
+ : '网关找不到这笔操作的回执。请先核对会话,再到「查看回执」结束跟踪,然后重新提交。操作编号:')
61
+ : (en ? 'Result unconfirmed. The operation may already have been applied. Check before trying again. Operation: '
62
+ : '结果未确认,操作可能已生效。请先核对会话,再决定是否重试。操作编号:')
63
+ const error = new Error(message + id)
64
+ error.operationId = id; error.operationPending = true; error.receiptMissing = receiptMissing
58
65
  return error
59
66
  }
67
+ const isMissingReceipt = (response, body) => response.status === 404 && body?.error === 'operation-not-found'
60
68
  async function execute(config) {
61
69
  const scope=await restore(config),intent=await digest(JSON.stringify([config.method,config.payload]))
62
70
  if(!config.valid())throw unknown('connection-changed')
63
71
  const existing=[...pending.values()].find(row=>row.scope===scope&&row.intent===intent)
64
72
  const id = existing?.id || newId(), createdAt = Date.now()
73
+ if (existing?.inFlight) throw unknown(id)
65
74
  const entry = existing || { id, scope, intent, method: config.method, sessionId: config.payload.sessionId || '', origin: originOf(config), createdAt, phase: 'running', config }
66
75
  if (!entry.origin) entry.origin = originOf(config)
76
+ entry.inFlight = true
67
77
  pending.set(id, entry)
68
78
  persist()
69
79
  const statusUrl = config.url('/api/operations?id=' + encodeURIComponent(id))
@@ -76,7 +86,7 @@
76
86
  if (!config.valid()) throw unknown(id)
77
87
  if (response.status >= 400) {
78
88
  if (response.status >= 500) throw unknown(id)
79
- if (method === 'GET' && response.status === 404) throw unknown(id)
89
+ if (method === 'GET' && response.status === 404) throw unknown(id, isMissingReceipt(response, value))
80
90
  const error = new Error(value.error || ('HTTP ' + response.status)); error.rpcRejected = true; throw error
81
91
  }
82
92
  return value
@@ -84,7 +94,7 @@
84
94
  let status
85
95
  try {
86
96
  try { status = existing ? await request('GET') : await request('POST', { method: config.method, payload: config.payload }) }
87
- catch (error) { if (error.message === 'AUTH' || error.rpcRejected || !config.valid()) throw error }
97
+ catch (error) { if (error.message === 'AUTH' || error.rpcRejected || (existing && error.receiptMissing) || !config.valid()) throw error }
88
98
  for (let attempt = 0; config.valid() && Date.now() - createdAt < 90000; attempt++) {
89
99
  if (status?.phase === 'complete' || status?.phase === 'rejected') {
90
100
  entry.phase = status.phase; forget(id)
@@ -93,14 +103,16 @@
93
103
  if (status?.phase === 'unknown') { entry.phase = 'unknown'; throw unknown(id) }
94
104
  await sleep(Math.min(3000, 400 + attempt * 250))
95
105
  try { status = await request('GET') }
96
- catch (error) { if (error.message === 'AUTH' || error.rpcRejected) throw error }
106
+ catch (error) { if (error.message === 'AUTH' || error.rpcRejected || (existing && error.receiptMissing)) throw error }
97
107
  }
98
108
  throw unknown(id)
99
109
  } catch (error) {
100
110
  if (error.rpcRejected || error.message === 'AUTH') forget(id)
101
- else entry.phase = 'unknown'
111
+ else { entry.phase = 'unknown'; entry.receiptMissing = error.receiptMissing === true }
102
112
  persist()
103
113
  throw error
114
+ } finally {
115
+ entry.inFlight = false
104
116
  }
105
117
  }
106
118
  async function check(id) {
@@ -111,13 +123,15 @@
111
123
  if (!entry.config.valid()) return null
112
124
  const value = await response.json()
113
125
  if (!entry.config.valid()) return null
126
+ if (isMissingReceipt(response, value)) return { receiptMissing: true }
114
127
  if (response.ok) { entry.phase = value.phase; if (['complete','rejected'].includes(value.phase)) forget(id) }
115
128
  return response.ok ? value : null
116
129
  }
117
130
  function pendingRows() {
118
131
  const rows = new Map()
119
132
  for (const row of pending.values()) rows.set(row.id, { id: row.id, method: row.method, sessionId: row.sessionId,
120
- createdAt: row.createdAt, phase: row.phase, origin: row.origin || '', current: !!(row.config && row.config.valid()) })
133
+ createdAt: row.createdAt, phase: row.phase, origin: row.origin || '', receiptMissing: row.receiptMissing === true,
134
+ current: !!(row.config && row.config.valid()) })
121
135
  // Receipts persisted for another address/token are still shown, as unknown.
122
136
  // They cannot be queried until the user switches back to that connection,
123
137
  // but hiding them would let an ambiguous write disappear from the UI.
@@ -128,10 +142,10 @@
128
142
  }
129
143
  return [...rows.values()].filter(row => row.current || row.phase === 'unknown')
130
144
  }
131
- const api = { supports: method => methods.has(method), execute, check, restore,
145
+ const api = { supports: method => methods.has(method), requiresReceipt: method => method === 'session.continue' || hostStateWrites.has(method), execute, check, restore,
132
146
  dismiss: id => {
133
147
  const row = pending.get(id) || saved().find(value => value.id === id)
134
- if (!row || (row.phase && row.phase !== 'unknown')) return false
148
+ if (!row || row.inFlight || (row.phase && row.phase !== 'unknown')) return false
135
149
  forget(id)
136
150
  return true
137
151
  },
@@ -0,0 +1,297 @@
1
+ /* Plan mode chip, plan-review card and read-only plan history.
2
+ * Prefix: .dr-plan-* — loaded by both the mobile Web/Android page and desktop Web. */
3
+
4
+ .dr-plan {
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 10px;
8
+ margin: 10px 0;
9
+ color: var(--dsr-text, #1d2635);
10
+ font-size: 13px;
11
+ line-height: 1.45;
12
+ }
13
+
14
+ .dr-plan-status {
15
+ display: flex;
16
+ align-items: center;
17
+ flex-wrap: wrap;
18
+ gap: 8px;
19
+ padding: 8px 10px;
20
+ border: 1px solid var(--dsr-line, #d9dde5);
21
+ border-radius: 12px;
22
+ background: var(--dsr-panel, #fff);
23
+ }
24
+
25
+ .dr-plan-badge {
26
+ display: inline-flex;
27
+ align-items: center;
28
+ padding: 2px 8px;
29
+ border-radius: 999px;
30
+ font-size: 11px;
31
+ font-weight: 700;
32
+ letter-spacing: .04em;
33
+ color: var(--dsr-on-accent, #fff);
34
+ background: var(--dsr-muted, #687386);
35
+ }
36
+
37
+ .dr-plan-status--active .dr-plan-badge,
38
+ .dr-plan-status--entering .dr-plan-badge,
39
+ .dr-plan-status--leaving .dr-plan-badge {
40
+ background: var(--dsr-accent, #3979d6);
41
+ }
42
+
43
+ .dr-plan-status--review {
44
+ border-color: var(--dsr-warning-line, rgba(150, 90, 11, .35));
45
+ background: var(--dsr-warning-soft, rgba(185, 106, 14, .12));
46
+ }
47
+
48
+ .dr-plan-status--review .dr-plan-badge {
49
+ background: var(--dsr-warning, #965a0b);
50
+ }
51
+
52
+ .dr-plan-status--unsupported,
53
+ .dr-plan-status--unavailable {
54
+ color: var(--dsr-muted, #687386);
55
+ border-style: dashed;
56
+ }
57
+
58
+ .dr-plan-status--readonly,
59
+ .dr-plan-status--disconnected {
60
+ border-color: var(--dsr-error-line, rgba(183, 66, 63, .35));
61
+ }
62
+
63
+ .dr-plan-status-copy {
64
+ font-weight: 600;
65
+ }
66
+
67
+ .dr-plan-status-hint {
68
+ flex: 1 1 100%;
69
+ color: var(--dsr-muted, #687386);
70
+ font-size: 12px;
71
+ }
72
+
73
+ .dr-plan-status-review {
74
+ color: var(--dsr-warning, #965a0b);
75
+ font-size: 12px;
76
+ font-weight: 600;
77
+ }
78
+
79
+ .dr-plan-btn {
80
+ appearance: none;
81
+ border: 1px solid var(--dsr-accent-line, rgba(23, 107, 135, .35));
82
+ border-radius: 10px;
83
+ padding: 5px 10px;
84
+ font: inherit;
85
+ font-weight: 600;
86
+ color: var(--dsr-accent, #176b87);
87
+ background: var(--dsr-panel, #fff);
88
+ cursor: pointer;
89
+ }
90
+
91
+ .dr-plan-btn:disabled {
92
+ opacity: .55;
93
+ cursor: default;
94
+ }
95
+
96
+ .dr-plan-btn--approve {
97
+ color: var(--dsr-on-accent, #fff);
98
+ background: var(--dsr-accent, #176b87);
99
+ border-color: var(--dsr-accent, #176b87);
100
+ }
101
+
102
+ .dr-plan-btn--keep {
103
+ color: var(--dsr-warning, #965a0b);
104
+ border-color: var(--dsr-warning-line, rgba(150, 90, 11, .35));
105
+ }
106
+
107
+ .dr-plan-option {
108
+ margin-left: 6px;
109
+ padding: 0 6px;
110
+ border-radius: 6px;
111
+ font-size: 11px;
112
+ font-weight: 500;
113
+ opacity: .8;
114
+ background: var(--dsr-accent-soft, rgba(23, 107, 135, .10));
115
+ }
116
+
117
+ .dr-plan-btn--approve .dr-plan-option {
118
+ background: rgba(255, 255, 255, .18);
119
+ }
120
+
121
+ .dr-plan-notice {
122
+ margin: 0;
123
+ padding: 7px 10px;
124
+ border-radius: 10px;
125
+ border: 1px solid var(--dsr-line, #d9dde5);
126
+ background: var(--dsr-panel, #fff);
127
+ font-size: 12px;
128
+ }
129
+
130
+ .dr-plan-notice--ok { border-color: var(--dsr-success-line, rgba(35, 122, 70, .35)); color: var(--dsr-success, #237a46); }
131
+ .dr-plan-notice--err { border-color: var(--dsr-error-line, rgba(183, 66, 63, .35)); color: var(--dsr-error, #b7423f); }
132
+ .dr-plan-notice--info { color: var(--dsr-muted, #687386); }
133
+
134
+ .dr-plan-review {
135
+ padding: 10px;
136
+ border: 1px solid var(--dsr-warning-line, rgba(150, 90, 11, .35));
137
+ border-radius: 14px;
138
+ background: var(--dsr-panel, #fff);
139
+ }
140
+
141
+ .dr-plan-review-head {
142
+ display: flex;
143
+ align-items: center;
144
+ justify-content: space-between;
145
+ gap: 8px;
146
+ }
147
+
148
+ .dr-plan-review-strip {
149
+ font-size: 11px;
150
+ font-weight: 700;
151
+ letter-spacing: .06em;
152
+ text-transform: uppercase;
153
+ color: var(--dsr-warning, #965a0b);
154
+ }
155
+
156
+ .dr-plan-review-state {
157
+ padding: 1px 8px;
158
+ border-radius: 999px;
159
+ font-size: 11px;
160
+ color: var(--dsr-warning, #965a0b);
161
+ background: var(--dsr-warning-soft, rgba(185, 106, 14, .12));
162
+ }
163
+
164
+ .dr-plan-review-title {
165
+ margin: 6px 0 2px;
166
+ font-size: 15px;
167
+ font-weight: 700;
168
+ }
169
+
170
+ .dr-plan-review-summary {
171
+ margin: 0 0 6px;
172
+ color: var(--dsr-muted, #687386);
173
+ }
174
+
175
+ .dr-plan-doc {
176
+ margin: 6px 0;
177
+ border: 1px solid var(--dsr-line, #d9dde5);
178
+ border-radius: 10px;
179
+ background: var(--dsr-code-bg, rgba(0, 0, 0, .04));
180
+ }
181
+
182
+ .dr-plan-doc summary {
183
+ padding: 6px 9px;
184
+ font-size: 12px;
185
+ font-weight: 600;
186
+ cursor: pointer;
187
+ }
188
+
189
+ .dr-plan-doc pre {
190
+ margin: 0;
191
+ max-height: 50vh;
192
+ overflow: auto;
193
+ padding: 8px 9px;
194
+ font-size: 12px;
195
+ line-height: 1.5;
196
+ white-space: pre-wrap;
197
+ overflow-wrap: anywhere;
198
+ }
199
+
200
+ .dr-plan-hint {
201
+ margin: 6px 0;
202
+ color: var(--dsr-muted, #687386);
203
+ font-size: 12px;
204
+ }
205
+
206
+ .dr-plan-review-actions {
207
+ display: flex;
208
+ flex-wrap: wrap;
209
+ gap: 8px;
210
+ margin-top: 8px;
211
+ }
212
+
213
+ .dr-plan-feedback {
214
+ display: flex;
215
+ flex-direction: column;
216
+ gap: 4px;
217
+ margin-top: 8px;
218
+ font-size: 12px;
219
+ color: var(--dsr-muted, #687386);
220
+ }
221
+
222
+ .dr-plan-feedback textarea {
223
+ width: 100%;
224
+ box-sizing: border-box;
225
+ resize: vertical;
226
+ padding: 7px 9px;
227
+ border: 1px solid var(--dsr-line, #d9dde5);
228
+ border-radius: 10px;
229
+ font: inherit;
230
+ color: inherit;
231
+ background: var(--dsr-panel, #fff);
232
+ }
233
+
234
+ .dr-plan-review-note {
235
+ margin: 8px 0 0;
236
+ font-size: 11px;
237
+ color: var(--dsr-muted, #687386);
238
+ }
239
+
240
+ .dr-plan-review-status:empty { display: none; }
241
+
242
+ .dr-plan-history {
243
+ display: flex;
244
+ flex-direction: column;
245
+ gap: 8px;
246
+ padding-top: 4px;
247
+ border-top: 1px dashed var(--dsr-line, #d9dde5);
248
+ }
249
+
250
+ .dr-plan-history-head {
251
+ margin: 6px 0 0;
252
+ font-size: 12px;
253
+ font-weight: 700;
254
+ color: var(--dsr-muted, #687386);
255
+ }
256
+
257
+ .dr-plan-history-item {
258
+ padding: 8px 10px;
259
+ border: 1px solid var(--dsr-line, #d9dde5);
260
+ border-radius: 12px;
261
+ background: var(--dsr-panel, #fff);
262
+ }
263
+
264
+ .dr-plan-history-top {
265
+ display: flex;
266
+ align-items: center;
267
+ justify-content: space-between;
268
+ gap: 8px;
269
+ }
270
+
271
+ .dr-plan-history-title {
272
+ font-weight: 600;
273
+ overflow: hidden;
274
+ text-overflow: ellipsis;
275
+ white-space: nowrap;
276
+ }
277
+
278
+ .dr-plan-history-badge {
279
+ flex: 0 0 auto;
280
+ padding: 1px 8px;
281
+ border-radius: 999px;
282
+ font-size: 11px;
283
+ color: var(--dsr-muted, #687386);
284
+ background: var(--dsr-code-bg, rgba(0, 0, 0, .06));
285
+ }
286
+
287
+ .dr-plan-history-meta {
288
+ margin-top: 2px;
289
+ font-size: 12px;
290
+ color: var(--dsr-muted, #687386);
291
+ }
292
+
293
+ @media (max-width: 560px) {
294
+ .dr-plan-status { padding: 7px 8px; }
295
+ .dr-plan-review-actions { flex-direction: column; }
296
+ .dr-plan-review-actions .dr-plan-btn { width: 100%; }
297
+ }