dsh-agent-team-playbook 1.31.0 → 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.
- package/client.js +139 -172
- 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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
|
@@ -244,42 +171,48 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
244
171
|
}
|
|
245
172
|
|
|
246
173
|
/**
|
|
247
|
-
*
|
|
248
|
-
* 点「改名…」展开名字输入,确认后定案。
|
|
174
|
+
* 单个冲突行(紧凑一行):文件名 + 三个小按钮;改名时就地展开输入。
|
|
249
175
|
*/
|
|
250
176
|
function ChoiceRow({ index, conflict, onDecide }) {
|
|
251
177
|
const [renaming, setRenaming] = React.useState(false)
|
|
252
178
|
const [name, setName] = React.useState('')
|
|
253
179
|
|
|
254
|
-
const pill = (text, onClick, key) => h('button', {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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'))
|
|
202
|
+
}
|
|
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 },
|
|
275
209
|
pill('覆盖', () => onDecide(index, 'overwrite'), 'ow'),
|
|
276
210
|
pill('备份', () => onDecide(index, 'backup'), 'bk'),
|
|
277
|
-
|
|
211
|
+
pill('改名', () => setRenaming(true), 'rn')))
|
|
278
212
|
}
|
|
279
213
|
|
|
280
214
|
/**
|
|
281
|
-
*
|
|
282
|
-
* 全部定案后自动合成一条 /atp apply 执行。
|
|
215
|
+
* 冲突处理面板:限高滚动;点一项即定案、该行消失;全部定案后自动执行。
|
|
283
216
|
*/
|
|
284
217
|
function ResolveDialog() {
|
|
285
218
|
const state = useStore()
|
|
@@ -300,30 +233,12 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
300
233
|
|
|
301
234
|
const conflicts = state.conflicts ?? []
|
|
302
235
|
|
|
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
236
|
const maybeApply = async () => {
|
|
318
237
|
if (runningRef.current) return
|
|
319
238
|
if (decidedRef.current.size < conflicts.length) return
|
|
320
239
|
runningRef.current = true
|
|
321
240
|
try {
|
|
322
|
-
|
|
323
|
-
const choices = conflicts.map((c, i) => {
|
|
324
|
-
const d = decidedRef.current.get(i) ?? { action: 'overwrite' }
|
|
325
|
-
return d
|
|
326
|
-
})
|
|
241
|
+
const choices = conflicts.map((c, i) => decidedRef.current.get(i) ?? { action: 'overwrite' })
|
|
327
242
|
const coreName = choices.find((c, i) => c.action === 'rename' && conflicts[i].rel === 'AGENTS.md')?.name
|
|
328
243
|
const docsName = choices.find((c, i) => c.action === 'rename' && conflicts[i].rel !== 'AGENTS.md')?.name
|
|
329
244
|
const normalized = conflicts.map((c, i) => {
|
|
@@ -347,6 +262,21 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
347
262
|
}
|
|
348
263
|
}
|
|
349
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
|
|
350
280
|
const rows = conflicts
|
|
351
281
|
.map((conflict, index) => ({ conflict, index }))
|
|
352
282
|
.filter(({ index }) => !decidedRef.current.has(index))
|
|
@@ -355,36 +285,81 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
355
285
|
const footer = h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end' } },
|
|
356
286
|
typeof Button === 'function'
|
|
357
287
|
? h(Button, { variant: 'outline', onClick: () => writeStore({ open: false }) }, '取消')
|
|
358
|
-
: h('button', { type: 'button', onClick: () => writeStore({ open: false }) }, '取消'))
|
|
288
|
+
: h('button', { type: 'button', style: S.pill, onClick: () => writeStore({ open: false }) }, '取消'))
|
|
359
289
|
|
|
360
290
|
const body = [
|
|
361
|
-
h('div', { key: '
|
|
362
|
-
|
|
363
|
-
h('
|
|
364
|
-
h('button', { type: 'button',
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
error ? h('div', { key: 'err', style: { color: 'var(--
|
|
368
|
-
h('div', { key: 'hint',
|
|
369
|
-
'
|
|
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。'),
|
|
370
300
|
].filter(Boolean)
|
|
371
301
|
|
|
372
302
|
if (typeof Modal !== 'function') {
|
|
373
|
-
return h('div', { style: { position: 'fixed', inset: 0, background: 'rgba(0,0,0,.
|
|
374
|
-
h('div', { style: { background: 'var(--dsw-specific-menu, #
|
|
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))
|
|
375
305
|
}
|
|
376
|
-
return h(Modal, { open: true, onClose: () => writeStore({ open: false }), title:
|
|
306
|
+
return h(Modal, { open: true, onClose: () => writeStore({ open: false }), title: `处理同名内容(${remaining})`, closeLabel: '取消', footer }, body)
|
|
377
307
|
}
|
|
378
308
|
|
|
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
|
+
}
|
|
379
354
|
|
|
380
355
|
/**
|
|
381
|
-
* 首页 chip +
|
|
382
|
-
* 菜单项:安装 / 覆盖式安装 / 检查冲突 / 复制命令。
|
|
356
|
+
* 首页 chip + 下拉菜单(内联样式,确保生效)。
|
|
383
357
|
*/
|
|
384
358
|
function HeroEntry() {
|
|
385
359
|
const [badge, setBadge] = React.useState('')
|
|
386
360
|
const [open, setOpen] = React.useState(false)
|
|
387
361
|
const [busy, setBusy] = React.useState(false)
|
|
362
|
+
const [hover, setHover] = React.useState('')
|
|
388
363
|
const wrapRef = React.useRef(null)
|
|
389
364
|
|
|
390
365
|
React.useEffect(() => {
|
|
@@ -396,7 +371,7 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
396
371
|
const n = data?.conflicts?.length ?? 0
|
|
397
372
|
if (alive && n > 0) setBadge(` · ${n}`)
|
|
398
373
|
} catch {
|
|
399
|
-
/*
|
|
374
|
+
/* 静默 */
|
|
400
375
|
}
|
|
401
376
|
})()
|
|
402
377
|
return () => {
|
|
@@ -404,16 +379,15 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
404
379
|
}
|
|
405
380
|
}, [])
|
|
406
381
|
|
|
407
|
-
// 点外部关闭
|
|
408
382
|
React.useEffect(() => {
|
|
409
383
|
if (!open) return
|
|
410
|
-
const
|
|
384
|
+
const onDown = (event) => {
|
|
411
385
|
const node = wrapRef.current
|
|
412
386
|
if (node !== null && node.contains(event.target)) return
|
|
413
387
|
setOpen(false)
|
|
414
388
|
}
|
|
415
|
-
document.addEventListener('pointerdown',
|
|
416
|
-
return () => document.removeEventListener('pointerdown',
|
|
389
|
+
document.addEventListener('pointerdown', onDown, true)
|
|
390
|
+
return () => document.removeEventListener('pointerdown', onDown, true)
|
|
417
391
|
}, [open])
|
|
418
392
|
|
|
419
393
|
const run = async (fn) => {
|
|
@@ -428,25 +402,16 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
428
402
|
}
|
|
429
403
|
|
|
430
404
|
const items = [
|
|
431
|
-
{
|
|
432
|
-
key: 'install',
|
|
433
|
-
label: '安装到工作区',
|
|
434
|
-
onSelect: () => detectThenInstall(HeroEntry.ctx, undefined),
|
|
435
|
-
},
|
|
405
|
+
{ key: 'install', label: '安装到工作区', onSelect: () => detectThenInstall(HeroEntry.ctx, undefined) },
|
|
436
406
|
{
|
|
437
407
|
key: 'force',
|
|
438
408
|
label: '覆盖式安装',
|
|
439
|
-
danger: true,
|
|
440
409
|
onSelect: async () => {
|
|
441
410
|
const { sessionId } = currentSession(HeroEntry.ctx)
|
|
442
411
|
await remoteExecute(HeroEntry.ctx, sessionId, '/atp install force')
|
|
443
412
|
},
|
|
444
413
|
},
|
|
445
|
-
{
|
|
446
|
-
key: 'check',
|
|
447
|
-
label: '检查冲突…',
|
|
448
|
-
onSelect: () => detectThenInstall(HeroEntry.ctx, undefined),
|
|
449
|
-
},
|
|
414
|
+
{ key: 'check', label: '检查冲突…', onSelect: () => detectThenInstall(HeroEntry.ctx, undefined) },
|
|
450
415
|
{
|
|
451
416
|
key: 'copy',
|
|
452
417
|
label: '复制 /atp install',
|
|
@@ -454,7 +419,7 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
454
419
|
try {
|
|
455
420
|
await navigator.clipboard.writeText('/atp install')
|
|
456
421
|
} catch {
|
|
457
|
-
/*
|
|
422
|
+
/* 剪贴板不可用时忽略 */
|
|
458
423
|
}
|
|
459
424
|
},
|
|
460
425
|
},
|
|
@@ -463,32 +428,33 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
463
428
|
const Icon = primitives?.IconChecklistOutlineRegular
|
|
464
429
|
const label = busy ? '协作规程…' : `协作规程${badge}`
|
|
465
430
|
|
|
466
|
-
return h('div', {
|
|
431
|
+
return h('div', { style: S.wrap, ref: wrapRef },
|
|
467
432
|
h('button', {
|
|
468
433
|
type: 'button',
|
|
469
|
-
|
|
434
|
+
style: { ...S.chip, background: open ? 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.16))' : 'none' },
|
|
470
435
|
disabled: busy,
|
|
471
436
|
'aria-label': '多智能体协作规程',
|
|
472
|
-
'aria-expanded': open,
|
|
473
437
|
'aria-haspopup': 'menu',
|
|
438
|
+
'aria-expanded': open,
|
|
474
439
|
onClick: () => setOpen((v) => !v),
|
|
475
440
|
},
|
|
476
|
-
Icon !== undefined ? h(Icon, {
|
|
477
|
-
h('span', {
|
|
478
|
-
h('span', {
|
|
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 } }, '▾')),
|
|
479
444
|
|
|
480
445
|
open
|
|
481
|
-
? h('div', {
|
|
446
|
+
? h('div', { style: S.menu, role: 'menu' },
|
|
482
447
|
...items.map((item) =>
|
|
483
448
|
h('button', {
|
|
484
449
|
key: item.key,
|
|
485
450
|
type: 'button',
|
|
486
451
|
role: 'menuitem',
|
|
487
|
-
|
|
488
|
-
|
|
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(''),
|
|
489
455
|
onClick: () => void run(item.onSelect),
|
|
490
456
|
}, item.label)),
|
|
491
|
-
h('div', {
|
|
457
|
+
h('div', { style: S.menuHint }, '覆盖式安装会先把原件暂存,失败可回滚'))
|
|
492
458
|
: null)
|
|
493
459
|
}
|
|
494
460
|
|
|
@@ -558,15 +524,16 @@ div:has(> .atp-chip){ margin-left: 0 !important; }
|
|
|
558
524
|
)
|
|
559
525
|
if (conflicts.length > 0) {
|
|
560
526
|
children.push(
|
|
561
|
-
h('div', { key: 'conf', style: { marginTop: 8, marginBottom: 4, color: 'var(--
|
|
562
|
-
|
|
527
|
+
h('div', { key: 'conf', style: { marginTop: 8, marginBottom: 4, color: 'var(--dsw-alias-label-warning, #b8862b)' } },
|
|
528
|
+
`${conflicts.length} 处同名内容(不会被自动覆盖)`),
|
|
563
529
|
)
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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
|
+
}
|
|
570
537
|
children.push(
|
|
571
538
|
h('div', { key: 'resolve', style: { marginTop: 8 } },
|
|
572
539
|
typeof Button === 'function'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agent-team-playbook",
|
|
3
|
-
"version": "1.31.
|
|
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",
|