dsh-agent-team-playbook 1.31.0 → 1.31.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.
Files changed (2) hide show
  1. package/client.js +168 -176
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -34,83 +34,10 @@ window.__ModuleLoader__.load({
34
34
  * 这样和「音乐制作 / 标准模式」在同一行时视觉一致。
35
35
  */
36
36
  const CHIP_CSS = `
37
- .atp-chip{
38
- border-radius: var(--dsw-radius-sm, 8px);
39
- max-width: min(100%, 360px);
40
- min-height: 28px;
41
- color: var(--dsw-alias-label-primary, inherit);
42
- cursor: pointer;
43
- background: 0 0;
44
- border: none;
45
- align-items: center;
46
- gap: 4px;
47
- padding: 0 8px;
48
- font: inherit;
49
- font-size: 13px;
50
- font-weight: 500;
51
- line-height: 20px;
52
- display: inline-flex;
53
- }
54
- .atp-chip[aria-expanded="true"]{ background: var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.14)); }
55
- @media (hover:hover){ .atp-chip:not(:disabled):hover{ background: var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.14)); } }
56
- .atp-chip:disabled{ cursor: default; opacity: .6; }
57
- .atp-chip .atp-chip-label{ text-overflow: ellipsis; white-space: nowrap; min-width: 0; overflow: hidden; }
58
- .atp-chip .atp-chip-glyph{ flex: none; color: var(--dsw-alias-label-primary, inherit); }
59
- /* heroOptions 容器原生是 margin-left:auto(靠右);把我们那行拉回左对齐,紧跟「标准模式」后面 */
60
- div:has(> .atp-chip){ margin-left: 0 !important; }
61
-
62
- /* chip 包裹层:给下拉菜单做定位基准 */
63
- .atp-wrap{ position: relative; display: inline-flex; }
64
-
65
- /* 下拉菜单:沿用原生菜单的材质变量 */
66
- .atp-menu{
67
- position: absolute;
68
- top: calc(100% + 6px);
69
- left: 0;
70
- z-index: 60;
71
- min-width: 200px;
72
- padding: 4px;
73
- border-radius: var(--dsw-radius-md, 10px);
74
- box-shadow: var(--dsw-elevation-panel, 0 8px 24px rgba(0,0,0,.32));
75
- background: var(--dsw-specific-menu, rgba(40,40,40,.98));
76
- backdrop-filter: var(--dsw-menu-backdrop-filter, blur(12px));
77
- }
78
- .atp-menu-item{
79
- width: 100%;
80
- min-height: 32px;
81
- padding: 0 10px;
82
- border: 0;
83
- border-radius: var(--dsw-radius-sm, 8px);
84
- background: none;
85
- color: var(--dsw-alias-label-primary, inherit);
86
- font: inherit;
87
- font-size: 13px;
88
- text-align: left;
89
- display: flex;
90
- align-items: center;
91
- gap: 8px;
92
- cursor: pointer;
93
- }
94
- .atp-menu-item:hover{ background: var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.16)); }
95
- .atp-menu-item[data-danger="true"]{ color: var(--dsw-alias-label-danger, #e06c5a); }
96
- .atp-menu-hint{ padding: 6px 10px; font-size: 12px; opacity: .6; }
97
-
98
- /* 冲突面板:限高 + 内部滚动,避免撑满整屏 */
99
- .atp-conflict-body{
100
- max-height: min(60vh, 520px);
101
- overflow-y: auto;
102
- overscroll-behavior: contain;
103
- padding-right: 4px;
104
- }
105
- .atp-conflict-row{ display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(127,127,127,.18); }
106
- .atp-conflict-row:first-child{ border-top: none; }
107
- .atp-conflict-path{ flex: 1 1 auto; min-width: 0; word-break: break-all; font-size: 13px; }
108
- .atp-conflict-actions{ flex: none; display: flex; gap: 6px; flex-wrap: wrap; }
109
- .atp-pill{ min-height: 26px; padding: 0 8px; border-radius: var(--dsw-radius-sm, 8px); border: 1px solid rgba(127,127,127,.35);
110
- background: none; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
111
- .atp-pill:hover{ background: var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.16)); }
112
- .atp-toolbar{ display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
113
- .atp-muted{ opacity: .6; font-size: 12px; }
37
+ /* heroOptions 原生是 margin-left:auto(靠右);把我们的入口拉回左对齐,紧跟「标准模式」后面 */
38
+ div:has(> .atp-wrap){ margin-left: 0 !important; }
39
+ /* 菜单项悬停由 React 状态处理,这里只兜底原生按钮默认样式 */
40
+ .agent-team-playbook-menu button{ all: unset; }
114
41
  `
115
42
  const CHIP_STYLE_ID = 'agent-team-playbook/chip.css'
116
43
 
@@ -189,9 +116,26 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
189
116
  )
190
117
  }
191
118
 
192
- function LinkButton({ onClick, children }) {
193
- if (typeof Button === 'function') return h(Button, { onClick, variant: 'secondary' }, children)
194
- return h('button', { type: 'button', onClick }, children)
119
+ /** 文字链式按钮(无边框),hover 出淡底;primary 用主色加粗。 */
120
+ function LinkButton({ onClick, children, primary = false }) {
121
+ const [hover, setHover] = React.useState(false)
122
+ return h('button', {
123
+ type: 'button',
124
+ style: {
125
+ border: 0,
126
+ borderRadius: 6,
127
+ background: hover ? 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.18))' : 'none',
128
+ color: primary ? 'var(--dsw-alias-label-primary, inherit)' : 'var(--dsw-alias-label-secondary, #98a2b3)',
129
+ font: 'inherit',
130
+ fontSize: 13,
131
+ fontWeight: primary ? 600 : 400,
132
+ padding: '4px 8px',
133
+ cursor: 'pointer',
134
+ },
135
+ onMouseEnter: () => setHover(true),
136
+ onMouseLeave: () => setHover(false),
137
+ onClick,
138
+ }, children)
195
139
  }
196
140
 
197
141
  /** 解析"当前会话"的 cwd 与 sessionId(客户端 sessions 快照)。 */
@@ -244,42 +188,53 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
244
188
  }
245
189
 
246
190
  /**
247
- * 单个冲突行:点「覆盖 / 备份」立即定案(该行随即消失);
248
- * 点「改名…」展开名字输入,确认后定案。
191
+ * 单个冲突行(紧凑一行):文件名 + 三个小按钮;改名时就地展开输入。
249
192
  */
250
193
  function ChoiceRow({ index, conflict, onDecide }) {
251
194
  const [renaming, setRenaming] = React.useState(false)
252
195
  const [name, setName] = React.useState('')
253
196
 
254
- const pill = (text, onClick, key) => h('button', { key, type: 'button', className: 'atp-pill', onClick }, text)
255
-
256
- return h('div', { className: 'atp-conflict-row' },
257
- h('div', { className: 'atp-conflict-path' },
258
- h('div', null, `${index + 1}. ${conflict.rel}`),
259
- h('div', { className: 'atp-muted' }, conflict.reason),
260
- renaming
261
- ? h('div', { style: { display: 'flex', gap: 6, marginTop: 6 } },
262
- h('input', {
263
- value: name,
264
- placeholder: '新名字,如 team-docs / AGENTS.team.md',
265
- onChange: (e) => setName(e.target.value),
266
- style: { flex: '1 1 auto', minWidth: 0, height: 26, padding: '0 8px', borderRadius: 6, border: '1px solid rgba(127,127,127,.4)', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: 12 },
267
- }),
268
- pill('确定', () => {
269
- const clean = String(name).trim()
270
- if (clean !== '') onDecide(index, 'rename', clean)
271
- }, 'ok'),
272
- pill('取消', () => setRenaming(false), 'cancel'))
273
- : null),
274
- h('div', { className: 'atp-conflict-actions' },
197
+ const [hoverKey, setHoverKey] = React.useState('')
198
+ const pill = (text, onClick, key) => h('button', {
199
+ key,
200
+ type: 'button',
201
+ style: { ...S.pill, ...(hoverKey === key ? S.pillHover : null) },
202
+ onMouseEnter: () => setHoverKey(key),
203
+ onMouseLeave: () => setHoverKey(''),
204
+ onClick,
205
+ }, text)
206
+
207
+ if (renaming) {
208
+ return h('div', { style: { ...S.row, flexWrap: 'wrap' } },
209
+ h('div', { style: { width: '100%', ...S.muted, marginBottom: 4 } },
210
+ `${index + 1}. ${shortName(conflict.rel)} —— 新名字:`),
211
+ h('input', {
212
+ value: name,
213
+ placeholder: 'team-docs 或 AGENTS.team.md',
214
+ onChange: (e) => setName(e.target.value),
215
+ style: { flex: '1 1 120px', minWidth: 0, height: 26, padding: '0 8px', borderRadius: 6, border: '1px solid rgba(127,127,127,.35)', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: 12 },
216
+ }),
217
+ pill('确定', () => {
218
+ const clean = String(name).trim()
219
+ if (clean !== '') onDecide(index, 'rename', clean)
220
+ }, 'ok'),
221
+ pill('取消', () => setRenaming(false), 'no'))
222
+ }
223
+
224
+ return h('div', { style: S.row },
225
+ h('div', { style: S.fileName, title: conflict.rel },
226
+ h('span', { style: { opacity: 0.5, marginRight: 6 } }, `${index + 1}.`),
227
+ shortName(conflict.rel)),
228
+ h('div', { style: S.actions },
275
229
  pill('覆盖', () => onDecide(index, 'overwrite'), 'ow'),
230
+ h('span', { key: 's1', style: S.sep }, '·'),
276
231
  pill('备份', () => onDecide(index, 'backup'), 'bk'),
277
- renaming ? null : pill('改名…', () => setRenaming(true), 'rn')))
232
+ h('span', { key: 's2', style: S.sep }, '·'),
233
+ pill('改名', () => setRenaming(true), 'rn')))
278
234
  }
279
235
 
280
236
  /**
281
- * 冲突处理面板:限高可滚动;逐项点击即定案、该行消失;
282
- * 全部定案后自动合成一条 /atp apply 执行。
237
+ * 冲突处理面板:限高滚动;点一项即定案、该行消失;全部定案后自动执行。
283
238
  */
284
239
  function ResolveDialog() {
285
240
  const state = useStore()
@@ -300,30 +255,12 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
300
255
 
301
256
  const conflicts = state.conflicts ?? []
302
257
 
303
- const decide = (index, action, name) => {
304
- decidedRef.current.set(index, { action, name })
305
- setDecidedCount(decidedRef.current.size)
306
- void maybeApply()
307
- }
308
-
309
- const decideAll = (action) => {
310
- conflicts.forEach((_, i) => {
311
- if (!decidedRef.current.has(i)) decidedRef.current.set(i, { action })
312
- })
313
- setDecidedCount(decidedRef.current.size)
314
- void maybeApply()
315
- }
316
-
317
258
  const maybeApply = async () => {
318
259
  if (runningRef.current) return
319
260
  if (decidedRef.current.size < conflicts.length) return
320
261
  runningRef.current = true
321
262
  try {
322
- // 同一单元(核心/分册)共享改名值
323
- const choices = conflicts.map((c, i) => {
324
- const d = decidedRef.current.get(i) ?? { action: 'overwrite' }
325
- return d
326
- })
263
+ const choices = conflicts.map((c, i) => decidedRef.current.get(i) ?? { action: 'overwrite' })
327
264
  const coreName = choices.find((c, i) => c.action === 'rename' && conflicts[i].rel === 'AGENTS.md')?.name
328
265
  const docsName = choices.find((c, i) => c.action === 'rename' && conflicts[i].rel !== 'AGENTS.md')?.name
329
266
  const normalized = conflicts.map((c, i) => {
@@ -347,6 +284,21 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
347
284
  }
348
285
  }
349
286
 
287
+ const decide = (index, action, name) => {
288
+ decidedRef.current.set(index, { action, name })
289
+ setDecidedCount(decidedRef.current.size)
290
+ void maybeApply()
291
+ }
292
+
293
+ const decideAll = (action) => {
294
+ conflicts.forEach((_, i) => {
295
+ if (!decidedRef.current.has(i)) decidedRef.current.set(i, { action })
296
+ })
297
+ setDecidedCount(decidedRef.current.size)
298
+ void maybeApply()
299
+ }
300
+
301
+ const remaining = conflicts.length - decidedCount
350
302
  const rows = conflicts
351
303
  .map((conflict, index) => ({ conflict, index }))
352
304
  .filter(({ index }) => !decidedRef.current.has(index))
@@ -355,36 +307,84 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
355
307
  const footer = h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end' } },
356
308
  typeof Button === 'function'
357
309
  ? h(Button, { variant: 'outline', onClick: () => writeStore({ open: false }) }, '取消')
358
- : h('button', { type: 'button', onClick: () => writeStore({ open: false }) }, '取消'))
310
+ : h('button', { type: 'button', style: S.pill, onClick: () => writeStore({ open: false }) }, '取消'))
359
311
 
360
312
  const body = [
361
- h('div', { key: 'cwd', className: 'atp-muted', style: { marginBottom: 8, wordBreak: 'break-all' } }, state.cwd),
362
- h('div', { key: 'bar', className: 'atp-toolbar' },
363
- h('span', { className: 'atp-muted' }, `还剩 ${conflicts.length - decidedCount} 项`),
364
- h('button', { type: 'button', className: 'atp-pill', onClick: () => decideAll('overwrite') }, '全部覆盖'),
365
- h('button', { type: 'button', className: 'atp-pill', onClick: () => decideAll('backup') }, '全部备份')),
366
- h('div', { key: 'list', className: 'atp-conflict-body' }, rows.length > 0 ? rows : h('div', { className: 'atp-muted' }, '已全部决定,正在执行…')),
367
- error ? h('div', { key: 'err', style: { color: 'var(--dsh-alias-label-danger, #e06c5a)', marginTop: 8 } }, error) : null,
368
- h('div', { key: 'hint', className: 'atp-muted', style: { marginTop: 8 } },
369
- '每点一项即定案;全部决定后自动执行一条 /atp apply 命令(与手打等价,可在会话里看到)。'),
313
+ h('div', { key: 'bar', style: S.toolbar },
314
+ h('span', { style: S.muted }, `还剩 ${remaining} 项`),
315
+ h('button', { type: 'button', style: { ...S.pill, color: 'var(--dsw-alias-label-primary, inherit)' }, onClick: () => decideAll('overwrite') }, '全部覆盖'),
316
+ h('button', { type: 'button', style: { ...S.pill, color: 'var(--dsw-alias-label-primary, inherit)' }, onClick: () => decideAll('backup') }, '全部备份')),
317
+ h('div', { key: 'list', style: S.dialogBody },
318
+ rows.length > 0 ? rows : h('div', { style: S.muted }, '已全部决定,正在执行…')),
319
+ error ? h('div', { key: 'err', style: { color: 'var(--dsw-alias-label-danger, #e06c5a)', marginTop: 8, fontSize: 12 } }, error) : null,
320
+ h('div', { key: 'hint', style: { ...S.muted, marginTop: 8, lineHeight: 1.4 } },
321
+ '点一项即定案,全部决定后自动执行一条 /atp apply。'),
370
322
  ].filter(Boolean)
371
323
 
372
324
  if (typeof Modal !== 'function') {
373
- return h('div', { style: { position: 'fixed', inset: 0, background: 'rgba(0,0,0,.5)', zIndex: 9999, padding: 16, overflow: 'auto' } },
374
- h('div', { style: { background: 'var(--dsw-specific-menu, #1b1b1b)', padding: 16, borderRadius: 10, maxHeight: '80vh' } }, body, footer))
325
+ return h('div', { style: { position: 'fixed', inset: 0, background: 'rgba(0,0,0,.55)', zIndex: 2147483001, padding: 16, display: 'flex', alignItems: 'center', justifyContent: 'center' } },
326
+ h('div', { style: { background: 'var(--dsw-specific-menu, #1c1c1c)', padding: 14, borderRadius: 12, width: '100%', maxWidth: 460 } }, body, footer))
375
327
  }
376
- return h(Modal, { open: true, onClose: () => writeStore({ open: false }), title: '处理同名内容', closeLabel: '取消', footer }, body)
328
+ return h(Modal, { open: true, onClose: () => writeStore({ open: false }), title: `处理同名内容(${remaining})`, closeLabel: '取消', footer }, body)
377
329
  }
378
330
 
331
+ /** 内联样式汇总(不依赖 <style> 注入,避免被覆盖或未生效)。 */
332
+ const S = {
333
+ wrap: { position: 'relative', display: 'inline-flex', alignItems: 'center' },
334
+ chip: {
335
+ display: 'inline-flex', alignItems: 'center', gap: 4, height: 28, padding: '0 8px',
336
+ border: 0, borderRadius: 'var(--dsw-radius-sm, 8px)', background: 'none',
337
+ color: 'var(--dsw-alias-label-primary, inherit)', font: 'inherit', fontSize: 13,
338
+ fontWeight: 500, lineHeight: '20px', cursor: 'pointer', whiteSpace: 'nowrap',
339
+ },
340
+ menu: {
341
+ position: 'absolute', top: 'calc(100% + 6px)', left: 0, zIndex: 2147483000,
342
+ minWidth: 196, maxWidth: 280, padding: 4, display: 'flex', flexDirection: 'column', gap: 2,
343
+ borderRadius: 'var(--dsw-radius-md, 10px)',
344
+ boxShadow: 'var(--dsw-elevation-panel, 0 8px 24px rgba(0,0,0,.32))',
345
+ background: 'var(--dsw-specific-menu, rgba(38,38,38,.99))',
346
+ backdropFilter: 'var(--dsw-menu-backdrop-filter, blur(12px))',
347
+ textAlign: 'left',
348
+ },
349
+ menuItem: {
350
+ display: 'block', width: '100%', minHeight: 32, padding: '0 10px', border: 0,
351
+ borderRadius: 'var(--dsw-radius-sm, 8px)', background: 'none', color: 'inherit',
352
+ font: 'inherit', fontSize: 13, textAlign: 'left', cursor: 'pointer', lineHeight: '32px',
353
+ },
354
+ menuHint: { padding: '2px 10px 6px', fontSize: 11, opacity: 0.55, lineHeight: 1.4 },
355
+ dialogBody: { maxHeight: 'min(42vh, 340px)', overflowY: 'auto', overscrollBehavior: 'contain', paddingRight: 2 },
356
+ toolbar: { display: 'flex', alignItems: 'center', gap: 6, margin: '0 0 8px', flexWrap: 'wrap' },
357
+ row: {
358
+ display: 'flex', alignItems: 'center', gap: 8, padding: '6px 0',
359
+ borderTop: '1px solid rgba(127,127,127,.16)',
360
+ },
361
+ fileName: { flex: '1 1 auto', minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', fontSize: 13 },
362
+ actions: { flex: 'none', display: 'flex', gap: 4 },
363
+ // 极简文字操作:默认只是灰色小字,悬停才出淡底(无边框、无灰块)
364
+ pill: {
365
+ minHeight: 22, padding: '0 6px', borderRadius: 6, border: 0, background: 'none',
366
+ color: 'var(--dsw-alias-label-secondary, #98a2b3)', font: 'inherit', fontSize: 12,
367
+ cursor: 'pointer', lineHeight: '22px', whiteSpace: 'nowrap',
368
+ },
369
+ pillHover: { background: 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.18))', color: 'var(--dsw-alias-label-primary, inherit)' },
370
+ sep: { opacity: 0.28, fontSize: 12, userSelect: 'none' },
371
+ muted: { fontSize: 12, opacity: 0.6 },
372
+ }
373
+
374
+ /** 路径只显示文件名,完整路径放 title,行高才压得住。 */
375
+ function shortName(rel) {
376
+ const parts = String(rel).split('/')
377
+ return parts[parts.length - 1]
378
+ }
379
379
 
380
380
  /**
381
- * 首页 chip + 下拉菜单(菜单样式沿用原生菜单材质变量)。
382
- * 菜单项:安装 / 覆盖式安装 / 检查冲突 / 复制命令。
381
+ * 首页 chip + 下拉菜单(内联样式,确保生效)。
383
382
  */
384
383
  function HeroEntry() {
385
384
  const [badge, setBadge] = React.useState('')
386
385
  const [open, setOpen] = React.useState(false)
387
386
  const [busy, setBusy] = React.useState(false)
387
+ const [hover, setHover] = React.useState('')
388
388
  const wrapRef = React.useRef(null)
389
389
 
390
390
  React.useEffect(() => {
@@ -396,7 +396,7 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
396
396
  const n = data?.conflicts?.length ?? 0
397
397
  if (alive && n > 0) setBadge(` · ${n}`)
398
398
  } catch {
399
- /* 静默:chip 不该因为检测失败而打扰 */
399
+ /* 静默 */
400
400
  }
401
401
  })()
402
402
  return () => {
@@ -404,16 +404,15 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
404
404
  }
405
405
  }, [])
406
406
 
407
- // 点外部关闭
408
407
  React.useEffect(() => {
409
408
  if (!open) return
410
- const onPointerDown = (event) => {
409
+ const onDown = (event) => {
411
410
  const node = wrapRef.current
412
411
  if (node !== null && node.contains(event.target)) return
413
412
  setOpen(false)
414
413
  }
415
- document.addEventListener('pointerdown', onPointerDown, true)
416
- return () => document.removeEventListener('pointerdown', onPointerDown, true)
414
+ document.addEventListener('pointerdown', onDown, true)
415
+ return () => document.removeEventListener('pointerdown', onDown, true)
417
416
  }, [open])
418
417
 
419
418
  const run = async (fn) => {
@@ -428,25 +427,16 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
428
427
  }
429
428
 
430
429
  const items = [
431
- {
432
- key: 'install',
433
- label: '安装到工作区',
434
- onSelect: () => detectThenInstall(HeroEntry.ctx, undefined),
435
- },
430
+ { key: 'install', label: '安装到工作区', onSelect: () => detectThenInstall(HeroEntry.ctx, undefined) },
436
431
  {
437
432
  key: 'force',
438
433
  label: '覆盖式安装',
439
- danger: true,
440
434
  onSelect: async () => {
441
435
  const { sessionId } = currentSession(HeroEntry.ctx)
442
436
  await remoteExecute(HeroEntry.ctx, sessionId, '/atp install force')
443
437
  },
444
438
  },
445
- {
446
- key: 'check',
447
- label: '检查冲突…',
448
- onSelect: () => detectThenInstall(HeroEntry.ctx, undefined),
449
- },
439
+ { key: 'check', label: '检查冲突…', onSelect: () => detectThenInstall(HeroEntry.ctx, undefined) },
450
440
  {
451
441
  key: 'copy',
452
442
  label: '复制 /atp install',
@@ -454,7 +444,7 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
454
444
  try {
455
445
  await navigator.clipboard.writeText('/atp install')
456
446
  } catch {
457
- /* 剪贴板不可用就算了 */
447
+ /* 剪贴板不可用时忽略 */
458
448
  }
459
449
  },
460
450
  },
@@ -463,32 +453,33 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
463
453
  const Icon = primitives?.IconChecklistOutlineRegular
464
454
  const label = busy ? '协作规程…' : `协作规程${badge}`
465
455
 
466
- return h('div', { className: 'atp-wrap', ref: wrapRef },
456
+ return h('div', { style: S.wrap, ref: wrapRef },
467
457
  h('button', {
468
458
  type: 'button',
469
- className: 'atp-chip',
459
+ style: { ...S.chip, background: open ? 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.16))' : 'none' },
470
460
  disabled: busy,
471
461
  'aria-label': '多智能体协作规程',
472
- 'aria-expanded': open,
473
462
  'aria-haspopup': 'menu',
463
+ 'aria-expanded': open,
474
464
  onClick: () => setOpen((v) => !v),
475
465
  },
476
- Icon !== undefined ? h(Icon, { className: 'atp-chip-glyph', size: 16 }) : null,
477
- h('span', { className: 'atp-chip-label' }, label),
478
- h('span', { className: 'atp-chip-glyph', style: { fontSize: 10 } }, '▾')),
466
+ Icon !== undefined ? h(Icon, { size: 16, style: { flex: 'none' } }) : null,
467
+ h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis' } }, label),
468
+ h('span', { style: { fontSize: 10, opacity: 0.7 } }, '▾')),
479
469
 
480
470
  open
481
- ? h('div', { className: 'atp-menu', role: 'menu' },
471
+ ? h('div', { style: S.menu, role: 'menu' },
482
472
  ...items.map((item) =>
483
473
  h('button', {
484
474
  key: item.key,
485
475
  type: 'button',
486
476
  role: 'menuitem',
487
- className: 'atp-menu-item',
488
- 'data-danger': item.danger === true ? 'true' : undefined,
477
+ style: { ...S.menuItem, background: hover === item.key ? 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.18))' : 'none' },
478
+ onMouseEnter: () => setHover(item.key),
479
+ onMouseLeave: () => setHover(''),
489
480
  onClick: () => void run(item.onSelect),
490
481
  }, item.label)),
491
- h('div', { className: 'atp-menu-hint' }, '覆盖式安装会先把你的原件暂存,失败可回滚'))
482
+ h('div', { style: S.menuHint }, '覆盖式安装会先把原件暂存,失败可回滚'))
492
483
  : null)
493
484
  }
494
485
 
@@ -558,15 +549,16 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
558
549
  )
559
550
  if (conflicts.length > 0) {
560
551
  children.push(
561
- h('div', { key: 'conf', style: { marginTop: 8, marginBottom: 4, color: 'var(--dsh-warning, #b8862b)' } },
562
- `检测到 ${conflicts.length} 处同名内容(不会被自动覆盖):`),
552
+ h('div', { key: 'conf', style: { marginTop: 8, marginBottom: 4, color: 'var(--dsw-alias-label-warning, #b8862b)' } },
553
+ `${conflicts.length} 处同名内容(不会被自动覆盖)`),
563
554
  )
564
- conflicts.forEach((c, i) => {
565
- children.push(
566
- h('div', { key: `c${i}`, style: { paddingLeft: 12, margin: '2px 0' } },
567
- `${i + 1}. ${c.rel} — ${c.reason}`),
568
- )
569
- })
555
+ // 只列前 5 条,其余收进一行,避免面板被长列表撑开
556
+ children.push(...conflicts.slice(0, 5).map((c, i) =>
557
+ h('div', { key: `c${i}`, style: { paddingLeft: 4, margin: '1px 0', ...S.muted, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, title: c.rel },
558
+ `${i + 1}. ${shortName(c.rel)}`)))
559
+ if (conflicts.length > 5) {
560
+ children.push(h('div', { key: 'more', style: { paddingLeft: 4, ...S.muted } }, `…另有 ${conflicts.length - 5} 项,点「逐项处理冲突…」查看全部`))
561
+ }
570
562
  children.push(
571
563
  h('div', { key: 'resolve', style: { marginTop: 8 } },
572
564
  typeof Button === 'function'
@@ -602,7 +594,7 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
602
594
 
603
595
  children.push(
604
596
  h('div', { key: 'actions', style: { marginTop: 10, display: 'flex', gap: 8, flexWrap: 'wrap' } },
605
- h(LinkButton, { onClick: () => void install() }, '安装到工作区'),
597
+ h(LinkButton, { onClick: () => void install(), primary: true }, '安装到工作区'),
606
598
  h(LinkButton, { onClick: () => void refresh() }, '重新检测'),
607
599
  h(LinkButton, { onClick: () => void copy('/atp install') }, copied === '/atp install' ? '已复制 ✓' : '复制 /atp install')),
608
600
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agent-team-playbook",
3
- "version": "1.31.0",
3
+ "version": "1.31.2",
4
4
  "description": "DeepSeek Harness plugin that brings an executable multi-agent collaboration workflow (charter, triage tiers, six-stage pipeline, audit gates, experience library): a read-only /agent-team command plus a collision-aware installer for the documents.",
5
5
  "type": "module",
6
6
  "license": "MIT",