dsh-agent-team-playbook 1.28.0 → 1.29.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 (3) hide show
  1. package/README.md +3 -1
  2. package/client.js +36 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -111,7 +111,9 @@ dsh plugin --profile web add dsh-agent-team-playbook
111
111
  **Web / 桌面端还会多一个设置面板**(设置 → 协作规程):
112
112
 
113
113
  - 显示当前工作区是否已安装、有无同名冲突
114
- - 有冲突时点「**逐项处理冲突…**」弹出对话框:每项可选 **覆盖 / 备份 / 改名**,底部「应用」
114
+ - 点「**安装到工作区**」:无冲突直接装;**有冲突会直接弹出处理对话框**(不用先执行命令)
115
+ - 打开面板时若已存在冲突,也会**自动弹一次**
116
+ - 对话框每项可选 **覆盖 / 备份 / 改名**,底部「应用」
115
117
  - 应用时会执行一条 `/atp apply …` 命令(与手动输入**等价**,会在会话里留下审计记录),因此插件**不新增任何写文件接口**
116
118
  - 也可以只复制建议命令,自己粘贴执行
117
119
 
package/client.js CHANGED
@@ -43,6 +43,7 @@ window.__ModuleLoader__.load({
43
43
  store.listeners.add(fn)
44
44
  return () => store.listeners.delete(fn)
45
45
  }
46
+ let autoOpened = ''
46
47
  const useStore = () => {
47
48
  const [snap, setSnap] = React.useState(readStore)
48
49
  React.useEffect(() => subscribeStore(() => setSnap(readStore())), [])
@@ -251,6 +252,20 @@ window.__ModuleLoader__.load({
251
252
  void refresh()
252
253
  }, [refresh])
253
254
 
255
+ // 首次进入且已有冲突 → 自动弹一次;同一组冲突只自动弹一次
256
+ useEffect(() => {
257
+ if (state.phase !== 'ready') return
258
+ const found = state.data?.conflicts ?? []
259
+ if (found.length === 0) return
260
+ const fingerprint = `${state.cwd ?? ''}|${found.map((c) => c.rel).join(',')}`
261
+ if (autoOpened === fingerprint) return
262
+ autoOpened = fingerprint
263
+ const ctx = Panel.ctx
264
+ const { sessionId, cwd } = currentSession(ctx)
265
+ const execute = async (sid, line) => ctx?.remote?.commands?.execute?.(sid, line, [])
266
+ writeStore({ open: true, conflicts: found, cwd: cwd ?? '', sessionId: sessionId ?? '', execute, afterApply: refresh })
267
+ }, [state, refresh])
268
+
254
269
  const conflicts = state.phase === 'ready' ? state.data?.conflicts ?? [] : []
255
270
 
256
271
  const suggestion = useMemo(() => {
@@ -320,8 +335,28 @@ window.__ModuleLoader__.load({
320
335
  }
321
336
  }
322
337
 
338
+ // 安装:无冲突直接装;有冲突**直接弹窗**(等价于"install 后自动弹 UI")
339
+ const install = useCallback(async () => {
340
+ const ctx = Panel.ctx
341
+ const { sessionId, cwd } = currentSession(ctx)
342
+ const execute = (line) => ctx?.remote?.commands?.execute?.(sessionId, line, [])
343
+ try {
344
+ const data = await fetchStatus(cwd)
345
+ const found = data?.conflicts ?? []
346
+ if (found.length > 0) {
347
+ writeStore({ open: true, conflicts: found, cwd: cwd ?? '', sessionId: sessionId ?? '', execute, afterApply: refresh })
348
+ return
349
+ }
350
+ await execute('/atp install')
351
+ await refresh()
352
+ } catch (error) {
353
+ setState({ phase: 'error', message: String(error?.message ?? error) })
354
+ }
355
+ }, [refresh])
356
+
323
357
  children.push(
324
- h('div', { key: 'actions', style: { marginTop: 10, display: 'flex', gap: 8 } },
358
+ h('div', { key: 'actions', style: { marginTop: 10, display: 'flex', gap: 8, flexWrap: 'wrap' } },
359
+ h(LinkButton, { onClick: () => void install() }, '安装到工作区'),
325
360
  h(LinkButton, { onClick: () => void refresh() }, '重新检测'),
326
361
  h(LinkButton, { onClick: () => void copy('/atp install') }, copied === '/atp install' ? '已复制 ✓' : '复制 /atp install')),
327
362
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agent-team-playbook",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
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",