dsh-agent-team-playbook 1.30.2 → 1.31.1

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 (3) hide show
  1. package/README.md +2 -1
  2. package/client.js +235 -136
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -114,7 +114,8 @@ dsh plugin --profile web add dsh-agent-team-playbook
114
114
  2. **设置 → 协作规程** 面板:
115
115
 
116
116
  - 显示当前工作区是否已安装、有无同名冲突
117
- - 点「**安装到工作区**」:无冲突直接装;**有冲突会直接弹出处理对话框**(不用先执行命令)
117
+ - 点 chip 弹出**下拉菜单**(与「标准模式」同款材质):安装到工作区 / 覆盖式安装 / 检查冲突… / 复制命令
118
+ - 冲突面板:**限高可滚动**(`max-height: min(60vh,520px)`),逐项点「覆盖 / 备份 / 改名…」后**该行立即消失**,全部定案后自动执行一条 `/atp apply`;也可「全部覆盖 / 全部备份」一键定案
118
119
  - 打开面板时若已存在冲突,也会**自动弹一次**
119
120
  - 对话框每项可选 **覆盖 / 备份 / 改名**,底部「应用」
120
121
  - 应用时会执行一条 `/atp apply …` 命令(与手动输入**等价**,会在会话里留下审计记录),因此插件**不新增任何写文件接口**
package/client.js CHANGED
@@ -34,30 +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; }
37
+ /* heroOptions 原生是 margin-left:auto(靠右);把我们的入口拉回左对齐,紧跟「标准模式」后面 */
38
+ div:has(> .atp-wrap){ margin-left: 0 !important; }
39
+ /* 菜单项悬停由 React 状态处理,这里只兜底原生按钮默认样式 */
40
+ .agent-team-playbook-menu button{ all: unset; }
61
41
  `
62
42
  const CHIP_STYLE_ID = 'agent-team-playbook/chip.css'
63
43
 
@@ -190,134 +170,197 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
190
170
  }
191
171
  }
192
172
 
193
- /** 单个冲突的选择行:覆盖 / 备份 / 改名 + 名字输入。 */
194
- function ChoiceRow({ index, conflict, choice, onChoose, renameEnabled, onRename }) {
195
- const btn = (action, text) => {
196
- const active = choice?.action === action
197
- const props = { key: action, onClick: () => onChoose(index, action) }
198
- if (typeof Button === 'function') return h(Button, { ...props, variant: active ? 'primary' : 'outline' }, text)
199
- return h('button', { ...props, type: 'button', style: { fontWeight: active ? 700 : 400 } }, text)
200
- }
201
- const children = [
202
- h('div', { key: 'label', style: { wordBreak: 'break-all', marginBottom: 4 } }, `${index + 1}. ${conflict.rel}`),
203
- h('div', { key: 'reason', style: { opacity: 0.6, fontSize: 12, marginBottom: 6 } }, conflict.reason),
204
- h('div', { key: 'btns', style: { display: 'flex', gap: 6, flexWrap: 'wrap' } },
205
- btn('overwrite', '覆盖'),
206
- btn('backup', '备份'),
207
- renameEnabled ? btn('rename', '改名…') : null),
208
- ]
209
- if (choice?.action === 'rename') {
210
- children.push(
211
- h('div', { key: 'rename', style: { marginTop: 6 } },
212
- h('input', {
213
- value: choice.name ?? '',
214
- placeholder: '新名字(如 team-docs / AGENTS.team.md)',
215
- onChange: (e) => onRename(index, e.target.value),
216
- style: { width: '100%', padding: '6px 8px', borderRadius: 6, border: '1px solid rgba(127,127,127,0.4)', background: 'transparent', color: 'inherit' },
217
- }),
218
- h('div', { style: { opacity: 0.55, fontSize: 12, marginTop: 4 } }, '整份改名:同一类(核心/分册)只需填一次'),
219
- ),
220
- )
173
+ /**
174
+ * 单个冲突行(紧凑一行):文件名 + 三个小按钮;改名时就地展开输入。
175
+ */
176
+ function ChoiceRow({ index, conflict, onDecide }) {
177
+ const [renaming, setRenaming] = React.useState(false)
178
+ const [name, setName] = React.useState('')
179
+
180
+ const pill = (text, onClick, key) => h('button', {
181
+ key,
182
+ type: 'button',
183
+ style: S.pill,
184
+ onClick,
185
+ }, text)
186
+
187
+ if (renaming) {
188
+ return h('div', { style: { ...S.row, flexWrap: 'wrap' } },
189
+ h('div', { style: { width: '100%', ...S.muted, marginBottom: 4 } },
190
+ `${index + 1}. ${shortName(conflict.rel)} —— 新名字:`),
191
+ h('input', {
192
+ value: name,
193
+ placeholder: 'team-docs 或 AGENTS.team.md',
194
+ onChange: (e) => setName(e.target.value),
195
+ 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 },
196
+ }),
197
+ pill('确定', () => {
198
+ const clean = String(name).trim()
199
+ if (clean !== '') onDecide(index, 'rename', clean)
200
+ }, 'ok'),
201
+ pill('取消', () => setRenaming(false), 'no'))
221
202
  }
222
- return h('div', { key: `row${index}`, style: { padding: '8px 0', borderTop: index === 0 ? 'none' : '1px solid rgba(127,127,127,0.18)' } }, children)
203
+
204
+ return h('div', { style: S.row },
205
+ h('div', { style: S.fileName, title: conflict.rel },
206
+ h('span', { style: { opacity: 0.5, marginRight: 6 } }, `${index + 1}.`),
207
+ shortName(conflict.rel)),
208
+ h('div', { style: S.actions },
209
+ pill('覆盖', () => onDecide(index, 'overwrite'), 'ow'),
210
+ pill('备份', () => onDecide(index, 'backup'), 'bk'),
211
+ pill('改名', () => setRenaming(true), 'rn')))
223
212
  }
224
213
 
225
- /** 冲突处理弹窗(挂在 shell.overlay 上,关闭时渲染 null)。 */
214
+ /**
215
+ * 冲突处理面板:限高滚动;点一项即定案、该行消失;全部定案后自动执行。
216
+ */
226
217
  function ResolveDialog() {
227
218
  const state = useStore()
228
- const [choices, setChoices] = React.useState([])
219
+ const decidedRef = React.useRef(new Map())
220
+ const [decidedCount, setDecidedCount] = React.useState(0)
229
221
  const [error, setError] = React.useState('')
222
+ const runningRef = React.useRef(false)
230
223
 
231
224
  React.useEffect(() => {
232
225
  if (!state.open) return
226
+ decidedRef.current = new Map()
227
+ setDecidedCount(0)
233
228
  setError('')
234
- setChoices((state.conflicts ?? []).map(() => ({ action: 'overwrite' })))
229
+ runningRef.current = false
235
230
  }, [state.open, state.conflicts])
236
231
 
237
232
  if (!state.open) return null
238
233
 
239
- const isCoreRel = (rel) => rel === 'AGENTS.md'
240
- const onChoose = (i, action) => {
241
- setChoices((prev) => {
242
- const next = [...prev]
243
- next[i] = { ...(next[i] ?? {}), action }
244
- return next
245
- })
246
- }
247
- const onRename = (i, name) => {
248
- setChoices((prev) => {
249
- const next = [...prev]
250
- next[i] = { ...(next[i] ?? {}), action: 'rename', name }
251
- // 同一单元(核心/分册)共享同一个改名值
252
- const unit = isCoreRel((state.conflicts ?? [])[i]?.rel ?? '')
253
- next.forEach((c, j) => {
254
- if (j !== i && isCoreRel((state.conflicts ?? [])[j]?.rel ?? '') === unit) next[j] = { ...(next[j] ?? {}), name }
255
- })
256
- return next
257
- })
258
- }
234
+ const conflicts = state.conflicts ?? []
259
235
 
260
- const apply = async () => {
261
- const conflicts = state.conflicts ?? []
262
- const missing = choices.findIndex((c, i) => c?.action === 'rename' && !String(c.name ?? '').trim())
263
- if (missing >= 0) {
264
- setError(`第 ${missing + 1} 项选了改名但没填名字`)
265
- return
266
- }
267
- if (!state.sessionId || typeof state.execute !== 'function') {
268
- setError('拿不到当前会话,无法执行;请改用 /atp apply 命令')
269
- return
270
- }
236
+ const maybeApply = async () => {
237
+ if (runningRef.current) return
238
+ if (decidedRef.current.size < conflicts.length) return
239
+ runningRef.current = true
271
240
  try {
272
- writeStore({ busy: true })
273
- const line = buildApplySpec(choices)
241
+ const choices = conflicts.map((c, i) => decidedRef.current.get(i) ?? { action: 'overwrite' })
242
+ const coreName = choices.find((c, i) => c.action === 'rename' && conflicts[i].rel === 'AGENTS.md')?.name
243
+ const docsName = choices.find((c, i) => c.action === 'rename' && conflicts[i].rel !== 'AGENTS.md')?.name
244
+ const normalized = conflicts.map((c, i) => {
245
+ const d = choices[i]
246
+ if (d.action !== 'rename') return d
247
+ return { action: 'rename', name: c.rel === 'AGENTS.md' ? coreName : docsName }
248
+ })
249
+ if (normalized.some((c) => c.action === 'rename' && !String(c.name ?? '').trim())) {
250
+ setError('改名项缺少名字')
251
+ runningRef.current = false
252
+ return
253
+ }
254
+ const line = buildApplySpec(normalized)
274
255
  const result = await state.execute(state.sessionId, line)
275
256
  if (result && result.ok === false) throw new Error(result?.error?.message ?? '命令执行失败')
276
- writeStore({ open: false, busy: false, message: `已执行:${line}` })
257
+ writeStore({ open: false })
277
258
  if (typeof state.afterApply === 'function') await state.afterApply()
278
259
  } catch (e) {
279
260
  setError(String(e?.message ?? e))
280
- writeStore({ busy: false })
261
+ runningRef.current = false
281
262
  }
282
263
  }
283
264
 
265
+ const decide = (index, action, name) => {
266
+ decidedRef.current.set(index, { action, name })
267
+ setDecidedCount(decidedRef.current.size)
268
+ void maybeApply()
269
+ }
270
+
271
+ const decideAll = (action) => {
272
+ conflicts.forEach((_, i) => {
273
+ if (!decidedRef.current.has(i)) decidedRef.current.set(i, { action })
274
+ })
275
+ setDecidedCount(decidedRef.current.size)
276
+ void maybeApply()
277
+ }
278
+
279
+ const remaining = conflicts.length - decidedCount
280
+ const rows = conflicts
281
+ .map((conflict, index) => ({ conflict, index }))
282
+ .filter(({ index }) => !decidedRef.current.has(index))
283
+ .map(({ conflict, index }) => h(ChoiceRow, { key: `c${index}`, index, conflict, onDecide: decide }))
284
+
284
285
  const footer = h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end' } },
285
286
  typeof Button === 'function'
286
287
  ? h(Button, { variant: 'outline', onClick: () => writeStore({ open: false }) }, '取消')
287
- : h('button', { type: 'button', onClick: () => writeStore({ open: false }) }, '取消'),
288
- typeof Button === 'function'
289
- ? h(Button, { variant: 'primary', disabled: state.busy, onClick: () => void apply() }, state.busy ? '执行中…' : '应用')
290
- : h('button', { type: 'button', disabled: state.busy, onClick: () => void apply() }, '应用'),
291
- )
288
+ : h('button', { type: 'button', style: S.pill, onClick: () => writeStore({ open: false }) }, '取消'))
292
289
 
293
290
  const body = [
294
- h('div', { key: 'cwd', style: { opacity: 0.65, fontSize: 12, marginBottom: 10, wordBreak: 'break-all' } }, state.cwd),
295
- ...(state.conflicts ?? []).map((conflict, i) =>
296
- h(ChoiceRow, {
297
- key: `c${i}`,
298
- index: i,
299
- conflict,
300
- choice: choices[i],
301
- onChoose,
302
- renameEnabled: true,
303
- onRename,
304
- })),
305
- error ? h('div', { key: 'err', style: { color: 'var(--dsh-danger, #c0563b)', marginTop: 10 } }, error) : null,
306
- h('div', { key: 'hint', style: { opacity: 0.55, fontSize: 12, marginTop: 12 } },
307
- '点"应用"会执行一条 /atp apply 命令(与手动输入等价,可在会话里看到审计记录)。'),
291
+ h('div', { key: 'bar', style: S.toolbar },
292
+ h('span', { style: S.muted }, `还剩 ${remaining} 项`),
293
+ h('button', { type: 'button', style: S.pill, onClick: () => decideAll('overwrite') }, '全部覆盖'),
294
+ h('button', { type: 'button', style: S.pill, onClick: () => decideAll('backup') }, '全部备份')),
295
+ h('div', { key: 'list', style: S.dialogBody },
296
+ rows.length > 0 ? rows : h('div', { style: S.muted }, '已全部决定,正在执行…')),
297
+ error ? h('div', { key: 'err', style: { color: 'var(--dsw-alias-label-danger, #e06c5a)', marginTop: 8, fontSize: 12 } }, error) : null,
298
+ h('div', { key: 'hint', style: { ...S.muted, marginTop: 8, lineHeight: 1.4 } },
299
+ '点一项即定案,全部决定后自动执行一条 /atp apply。'),
308
300
  ].filter(Boolean)
309
301
 
310
302
  if (typeof Modal !== 'function') {
311
- return h('div', { style: { position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.5)', zIndex: 9999, padding: 20, overflow: 'auto' } },
312
- h('div', { style: { background: 'var(--dsh-surface, #1b1b1b)', padding: 16, borderRadius: 10 } }, body, footer))
303
+ return h('div', { style: { position: 'fixed', inset: 0, background: 'rgba(0,0,0,.55)', zIndex: 2147483001, padding: 16, display: 'flex', alignItems: 'center', justifyContent: 'center' } },
304
+ h('div', { style: { background: 'var(--dsw-specific-menu, #1c1c1c)', padding: 14, borderRadius: 12, width: '100%', maxWidth: 460 } }, body, footer))
313
305
  }
314
- return h(Modal, { open: true, onClose: () => writeStore({ open: false }), title: '处理同名内容', closeLabel: '取消', footer }, body)
306
+ return h(Modal, { open: true, onClose: () => writeStore({ open: false }), title: `处理同名内容(${remaining})`, closeLabel: '取消', footer }, body)
315
307
  }
316
308
 
317
- /** 首页 chip 行入口:和「音乐制作 / 标准模式」并排。 */
309
+ /** 内联样式汇总(不依赖 <style> 注入,避免被覆盖或未生效)。 */
310
+ const S = {
311
+ wrap: { position: 'relative', display: 'inline-flex', alignItems: 'center' },
312
+ chip: {
313
+ display: 'inline-flex', alignItems: 'center', gap: 4, height: 28, padding: '0 8px',
314
+ border: 0, borderRadius: 'var(--dsw-radius-sm, 8px)', background: 'none',
315
+ color: 'var(--dsw-alias-label-primary, inherit)', font: 'inherit', fontSize: 13,
316
+ fontWeight: 500, lineHeight: '20px', cursor: 'pointer', whiteSpace: 'nowrap',
317
+ },
318
+ menu: {
319
+ position: 'absolute', top: 'calc(100% + 6px)', left: 0, zIndex: 2147483000,
320
+ minWidth: 196, maxWidth: 280, padding: 4, display: 'flex', flexDirection: 'column', gap: 2,
321
+ borderRadius: 'var(--dsw-radius-md, 10px)',
322
+ boxShadow: 'var(--dsw-elevation-panel, 0 8px 24px rgba(0,0,0,.32))',
323
+ background: 'var(--dsw-specific-menu, rgba(38,38,38,.99))',
324
+ backdropFilter: 'var(--dsw-menu-backdrop-filter, blur(12px))',
325
+ textAlign: 'left',
326
+ },
327
+ menuItem: {
328
+ display: 'block', width: '100%', minHeight: 32, padding: '0 10px', border: 0,
329
+ borderRadius: 'var(--dsw-radius-sm, 8px)', background: 'none', color: 'inherit',
330
+ font: 'inherit', fontSize: 13, textAlign: 'left', cursor: 'pointer', lineHeight: '32px',
331
+ },
332
+ menuHint: { padding: '2px 10px 6px', fontSize: 11, opacity: 0.55, lineHeight: 1.4 },
333
+ dialogBody: { maxHeight: 'min(42vh, 340px)', overflowY: 'auto', overscrollBehavior: 'contain', paddingRight: 2 },
334
+ toolbar: { display: 'flex', alignItems: 'center', gap: 6, margin: '0 0 8px', flexWrap: 'wrap' },
335
+ row: {
336
+ display: 'flex', alignItems: 'center', gap: 8, padding: '6px 0',
337
+ borderTop: '1px solid rgba(127,127,127,.16)',
338
+ },
339
+ fileName: { flex: '1 1 auto', minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', fontSize: 13 },
340
+ actions: { flex: 'none', display: 'flex', gap: 4 },
341
+ pill: {
342
+ minHeight: 24, padding: '0 8px', borderRadius: 'var(--dsw-radius-sm, 8px)',
343
+ border: '1px solid rgba(127,127,127,.32)', background: 'none', color: 'inherit',
344
+ font: 'inherit', fontSize: 12, cursor: 'pointer', lineHeight: '22px', whiteSpace: 'nowrap',
345
+ },
346
+ muted: { fontSize: 12, opacity: 0.6 },
347
+ }
348
+
349
+ /** 路径只显示文件名,完整路径放 title,行高才压得住。 */
350
+ function shortName(rel) {
351
+ const parts = String(rel).split('/')
352
+ return parts[parts.length - 1]
353
+ }
354
+
355
+ /**
356
+ * 首页 chip + 下拉菜单(内联样式,确保生效)。
357
+ */
318
358
  function HeroEntry() {
319
359
  const [badge, setBadge] = React.useState('')
360
+ const [open, setOpen] = React.useState(false)
320
361
  const [busy, setBusy] = React.useState(false)
362
+ const [hover, setHover] = React.useState('')
363
+ const wrapRef = React.useRef(null)
321
364
 
322
365
  React.useEffect(() => {
323
366
  let alive = true
@@ -328,7 +371,7 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
328
371
  const n = data?.conflicts?.length ?? 0
329
372
  if (alive && n > 0) setBadge(` · ${n}`)
330
373
  } catch {
331
- /* 静默:首页 chip 不该因为检测失败而打扰 */
374
+ /* 静默 */
332
375
  }
333
376
  })()
334
377
  return () => {
@@ -336,28 +379,83 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
336
379
  }
337
380
  }, [])
338
381
 
339
- const onClick = async () => {
382
+ React.useEffect(() => {
383
+ if (!open) return
384
+ const onDown = (event) => {
385
+ const node = wrapRef.current
386
+ if (node !== null && node.contains(event.target)) return
387
+ setOpen(false)
388
+ }
389
+ document.addEventListener('pointerdown', onDown, true)
390
+ return () => document.removeEventListener('pointerdown', onDown, true)
391
+ }, [open])
392
+
393
+ const run = async (fn) => {
394
+ setOpen(false)
340
395
  if (busy) return
341
396
  setBusy(true)
342
397
  try {
343
- await detectThenInstall(HeroEntry.ctx, undefined)
398
+ await fn()
344
399
  } finally {
345
400
  setBusy(false)
346
401
  }
347
402
  }
348
403
 
349
- const label = busy ? '协作规程…' : `协作规程${badge}`
404
+ const items = [
405
+ { key: 'install', label: '安装到工作区', onSelect: () => detectThenInstall(HeroEntry.ctx, undefined) },
406
+ {
407
+ key: 'force',
408
+ label: '覆盖式安装',
409
+ onSelect: async () => {
410
+ const { sessionId } = currentSession(HeroEntry.ctx)
411
+ await remoteExecute(HeroEntry.ctx, sessionId, '/atp install force')
412
+ },
413
+ },
414
+ { key: 'check', label: '检查冲突…', onSelect: () => detectThenInstall(HeroEntry.ctx, undefined) },
415
+ {
416
+ key: 'copy',
417
+ label: '复制 /atp install',
418
+ onSelect: async () => {
419
+ try {
420
+ await navigator.clipboard.writeText('/atp install')
421
+ } catch {
422
+ /* 剪贴板不可用时忽略 */
423
+ }
424
+ },
425
+ },
426
+ ]
427
+
350
428
  const Icon = primitives?.IconChecklistOutlineRegular
351
- // 结构照抄原生 chip:button + 16px 图标 + 文本(无边框、透明底、hover 才出底色)
352
- return h('button', {
353
- type: 'button',
354
- className: 'atp-chip',
355
- disabled: busy,
356
- 'aria-label': '多智能体协作规程',
357
- onClick: () => void onClick(),
358
- },
359
- Icon !== undefined ? h(Icon, { className: 'atp-chip-glyph', size: 16 }) : null,
360
- h('span', { className: 'atp-chip-label' }, label))
429
+ const label = busy ? '协作规程…' : `协作规程${badge}`
430
+
431
+ return h('div', { style: S.wrap, ref: wrapRef },
432
+ h('button', {
433
+ type: 'button',
434
+ style: { ...S.chip, background: open ? 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.16))' : 'none' },
435
+ disabled: busy,
436
+ 'aria-label': '多智能体协作规程',
437
+ 'aria-haspopup': 'menu',
438
+ 'aria-expanded': open,
439
+ onClick: () => setOpen((v) => !v),
440
+ },
441
+ Icon !== undefined ? h(Icon, { size: 16, style: { flex: 'none' } }) : null,
442
+ h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis' } }, label),
443
+ h('span', { style: { fontSize: 10, opacity: 0.7 } }, '▾')),
444
+
445
+ open
446
+ ? h('div', { style: S.menu, role: 'menu' },
447
+ ...items.map((item) =>
448
+ h('button', {
449
+ key: item.key,
450
+ type: 'button',
451
+ role: 'menuitem',
452
+ style: { ...S.menuItem, background: hover === item.key ? 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.18))' : 'none' },
453
+ onMouseEnter: () => setHover(item.key),
454
+ onMouseLeave: () => setHover(''),
455
+ onClick: () => void run(item.onSelect),
456
+ }, item.label)),
457
+ h('div', { style: S.menuHint }, '覆盖式安装会先把原件暂存,失败可回滚'))
458
+ : null)
361
459
  }
362
460
 
363
461
  function Panel() {
@@ -426,15 +524,16 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
426
524
  )
427
525
  if (conflicts.length > 0) {
428
526
  children.push(
429
- h('div', { key: 'conf', style: { marginTop: 8, marginBottom: 4, color: 'var(--dsh-warning, #b8862b)' } },
430
- `检测到 ${conflicts.length} 处同名内容(不会被自动覆盖):`),
527
+ h('div', { key: 'conf', style: { marginTop: 8, marginBottom: 4, color: 'var(--dsw-alias-label-warning, #b8862b)' } },
528
+ `${conflicts.length} 处同名内容(不会被自动覆盖)`),
431
529
  )
432
- conflicts.forEach((c, i) => {
433
- children.push(
434
- h('div', { key: `c${i}`, style: { paddingLeft: 12, margin: '2px 0' } },
435
- `${i + 1}. ${c.rel} — ${c.reason}`),
436
- )
437
- })
530
+ // 只列前 5 条,其余收进一行,避免面板被长列表撑开
531
+ children.push(...conflicts.slice(0, 5).map((c, i) =>
532
+ h('div', { key: `c${i}`, style: { paddingLeft: 4, margin: '1px 0', ...S.muted, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, title: c.rel },
533
+ `${i + 1}. ${shortName(c.rel)}`)))
534
+ if (conflicts.length > 5) {
535
+ children.push(h('div', { key: 'more', style: { paddingLeft: 4, ...S.muted } }, `…另有 ${conflicts.length - 5} 项,点「逐项处理冲突…」查看全部`))
536
+ }
438
537
  children.push(
439
538
  h('div', { key: 'resolve', style: { marginTop: 8 } },
440
539
  typeof Button === 'function'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agent-team-playbook",
3
- "version": "1.30.2",
3
+ "version": "1.31.1",
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",