@joekytc/dsh-swarm 0.1.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 (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +504 -0
  3. package/README.zh-CN.md +452 -0
  4. package/client/BoardCard.tsx +41 -0
  5. package/client/ConnectionBanner.tsx +16 -0
  6. package/client/KanbanBoard.tsx +168 -0
  7. package/client/KanbanTab.tsx +26 -0
  8. package/client/RenameModal.tsx +38 -0
  9. package/client/TaskDrawer.tsx +212 -0
  10. package/client/WorkflowRail.tsx +175 -0
  11. package/client/board-store.ts +196 -0
  12. package/client/css.d.ts +4 -0
  13. package/client/index.ts +31 -0
  14. package/client/kanban.css +653 -0
  15. package/client/useKanbanBoard.ts +7 -0
  16. package/client/workflow-model.ts +229 -0
  17. package/cordis.patch.yml +88 -0
  18. package/lib/client.js +1205 -0
  19. package/lib/config.d.ts +46 -0
  20. package/lib/config.js +43 -0
  21. package/lib/dispatcher/agent-runner.d.ts +23 -0
  22. package/lib/dispatcher/agent-runner.js +429 -0
  23. package/lib/dispatcher/chain-auditor.d.ts +47 -0
  24. package/lib/dispatcher/chain-auditor.js +194 -0
  25. package/lib/dispatcher/dispatcher.d.ts +50 -0
  26. package/lib/dispatcher/dispatcher.js +280 -0
  27. package/lib/dispatcher/event-waker.d.ts +13 -0
  28. package/lib/dispatcher/event-waker.js +24 -0
  29. package/lib/dispatcher/git-credentials.d.ts +33 -0
  30. package/lib/dispatcher/git-credentials.js +78 -0
  31. package/lib/dispatcher/merge-gate.d.ts +28 -0
  32. package/lib/dispatcher/merge-gate.js +74 -0
  33. package/lib/dispatcher/model-candidates.d.ts +13 -0
  34. package/lib/dispatcher/model-candidates.js +31 -0
  35. package/lib/dispatcher/session-events.d.ts +28 -0
  36. package/lib/dispatcher/session-events.js +33 -0
  37. package/lib/dispatcher/target-repo.d.ts +15 -0
  38. package/lib/dispatcher/target-repo.js +42 -0
  39. package/lib/dispatcher/v-orchestrator.d.ts +74 -0
  40. package/lib/dispatcher/v-orchestrator.js +452 -0
  41. package/lib/dispatcher/watchdog.d.ts +15 -0
  42. package/lib/dispatcher/watchdog.js +30 -0
  43. package/lib/dispatcher/workspace-attach.d.ts +40 -0
  44. package/lib/dispatcher/workspace-attach.js +112 -0
  45. package/lib/domain/delivery-contract.d.ts +18 -0
  46. package/lib/domain/delivery-contract.js +80 -0
  47. package/lib/domain/delivery-evidence.d.ts +12 -0
  48. package/lib/domain/delivery-evidence.js +41 -0
  49. package/lib/domain/event-store.d.ts +20 -0
  50. package/lib/domain/event-store.js +53 -0
  51. package/lib/domain/kanban-service.d.ts +94 -0
  52. package/lib/domain/kanban-service.js +430 -0
  53. package/lib/domain/permissions.d.ts +7 -0
  54. package/lib/domain/permissions.js +54 -0
  55. package/lib/domain/planning-checklist.d.ts +22 -0
  56. package/lib/domain/planning-checklist.js +81 -0
  57. package/lib/domain/prefetch-manifest.d.ts +21 -0
  58. package/lib/domain/prefetch-manifest.js +73 -0
  59. package/lib/domain/projection.d.ts +3 -0
  60. package/lib/domain/projection.js +165 -0
  61. package/lib/domain/review-evidence.d.ts +13 -0
  62. package/lib/domain/review-evidence.js +76 -0
  63. package/lib/domain/state-machine.d.ts +4 -0
  64. package/lib/domain/state-machine.js +32 -0
  65. package/lib/domain/task-parents.d.ts +17 -0
  66. package/lib/domain/task-parents.js +39 -0
  67. package/lib/domain/tdd-classify.d.ts +5 -0
  68. package/lib/domain/tdd-classify.js +20 -0
  69. package/lib/domain/types.d.ts +142 -0
  70. package/lib/domain/types.js +2 -0
  71. package/lib/index.d.ts +5 -0
  72. package/lib/index.js +56 -0
  73. package/lib/roles/preset-installer.d.ts +8 -0
  74. package/lib/roles/preset-installer.js +53 -0
  75. package/lib/roles/toolsets.d.ts +62 -0
  76. package/lib/roles/toolsets.js +332 -0
  77. package/lib/roles/wiki-worker.d.ts +20 -0
  78. package/lib/roles/wiki-worker.js +44 -0
  79. package/lib/routes/kanban-http.d.ts +6 -0
  80. package/lib/routes/kanban-http.js +159 -0
  81. package/lib/routes/kanban-sse.d.ts +8 -0
  82. package/lib/routes/kanban-sse.js +58 -0
  83. package/lib/routes/planning-driver.d.ts +16 -0
  84. package/lib/routes/planning-driver.js +52 -0
  85. package/lib/routes/prefix-router.d.ts +29 -0
  86. package/lib/routes/prefix-router.js +28 -0
  87. package/lib/services/kanban-provider.d.ts +16 -0
  88. package/lib/services/kanban-provider.js +14 -0
  89. package/lib/tools/kanban-tools.d.ts +11 -0
  90. package/lib/tools/kanban-tools.js +169 -0
  91. package/lib/tools/main-session-tools.d.ts +20 -0
  92. package/lib/tools/main-session-tools.js +170 -0
  93. package/lib/tools/planning-tools.d.ts +32 -0
  94. package/lib/tools/planning-tools.js +102 -0
  95. package/lib/tools/prefetch-tools.d.ts +5 -0
  96. package/lib/tools/prefetch-tools.js +59 -0
  97. package/lib/tools/spec-card-tools.d.ts +4 -0
  98. package/lib/tools/spec-card-tools.js +75 -0
  99. package/lib/tools/wiki-tools.d.ts +4 -0
  100. package/lib/tools/wiki-tools.js +57 -0
  101. package/lib/wiki/kb-linkage.d.ts +9 -0
  102. package/lib/wiki/kb-linkage.js +87 -0
  103. package/lib/wiki/page-path.d.ts +6 -0
  104. package/lib/wiki/page-path.js +28 -0
  105. package/lib/wiki/wiki-vault-client.d.ts +28 -0
  106. package/lib/wiki/wiki-vault-client.js +48 -0
  107. package/package.json +83 -0
  108. package/personas/kanban-d/agent.cordis.yml +157 -0
  109. package/personas/kanban-d/preset.yml +2 -0
  110. package/personas/kanban-dt/agent.cordis.yml +71 -0
  111. package/personas/kanban-dt/preset.yml +2 -0
  112. package/personas/kanban-p/agent.cordis.yml +66 -0
  113. package/personas/kanban-p/preset.yml +2 -0
  114. package/personas/kanban-pt/agent.cordis.yml +47 -0
  115. package/personas/kanban-pt/preset.yml +2 -0
  116. package/personas/kanban-v/agent.cordis.yml +47 -0
  117. package/personas/kanban-v/preset.yml +2 -0
  118. package/personas/kanban-w/agent.cordis.yml +47 -0
  119. package/personas/kanban-w/preset.yml +2 -0
  120. package/personas/persona-d.md +26 -0
  121. package/personas/persona-dt.md +18 -0
  122. package/personas/persona-p.md +13 -0
  123. package/personas/persona-pt.md +13 -0
  124. package/personas/persona-v.md +18 -0
  125. package/personas/persona-w.md +12 -0
@@ -0,0 +1,28 @@
1
+ // src/wiki/page-path.ts
2
+ // Q3&5:KB 页面路径统一规则(单一来源)。三份文档:
3
+ // 需求清单 projects/checklists/<slug>-<ts>.md (planning_checklist_save,代码强制)
4
+ // 实施计划/结果 projects/ch_<id>/t_<id>.md (W2/W3 wiki_write,工具边界强制)
5
+ // DT 评审页 projects/ch_<id>/review/<name>.md (DT wiki_write,工具边界强制)
6
+ import { WikiError } from './wiki-vault-client.js';
7
+ export const CHECKLIST_PAGE_PREFIX = 'projects/checklists/';
8
+ /** 白名单:wiki_write 只允许写这三类命名空间(杜绝 LLM 自造路径/拼错层级)。id 段宽松匹配(兼容真实 nid 两段式 ch_1_xxx 与测试单段 ch_1)。 */
9
+ const KB_PAGE_PATH_RE = /^projects\/(?:checklists\/|ch_[0-9a-z_]+\/(?:t_[0-9a-z_]+\.md|review\/))/;
10
+ /** 从需求名(回退 problem)派生 URL 安全 slug:ASCII 化、空格/特殊字符→-、限长 40;全非 ASCII(如中文)兜底 'req'。 */
11
+ export function buildChecklistSlug(name) {
12
+ const slug = name
13
+ .trim()
14
+ .toLowerCase()
15
+ .replace(/[^a-z0-9]+/g, '-')
16
+ .replace(/^-+|-+$/g, '')
17
+ .slice(0, 40);
18
+ return slug || 'req';
19
+ }
20
+ export function isAllowedWikiPagePath(pagePath) {
21
+ return KB_PAGE_PATH_RE.test(pagePath);
22
+ }
23
+ /** 工具边界硬校验:不符白名单直接抛 kb-rejected(wiki_write 用)。 */
24
+ export function assertAllowedWikiPagePath(pagePath) {
25
+ if (!isAllowedWikiPagePath(pagePath)) {
26
+ throw new WikiError('kb-rejected', undefined, `page path outside allowed namespaces (projects/checklists/, projects/ch_*/t_*.md, projects/ch_*/review/): ${pagePath}`);
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ export declare class WikiError extends Error {
2
+ readonly code: 'kb-unreachable' | 'kb-rejected';
3
+ readonly status?: number;
4
+ constructor(code: 'kb-unreachable' | 'kb-rejected', status?: number, message?: string);
5
+ }
6
+ export interface WikiSearchResult {
7
+ path: string;
8
+ title: string;
9
+ score: number;
10
+ }
11
+ export declare class WikiVaultClient {
12
+ private readonly cfg;
13
+ constructor(cfg: {
14
+ baseUrl: string;
15
+ pagePrefix: string;
16
+ });
17
+ /** P2:暴露 baseUrl getter(下游 WikiWorker 拼 kb_url 用),不挖私有字段。 */
18
+ get baseUrl(): string;
19
+ private request;
20
+ search(q: string): Promise<WikiSearchResult[]>;
21
+ read(pagePath: string): Promise<{
22
+ path: string;
23
+ rawMd: string;
24
+ }>;
25
+ write(pagePath: string, content: string): Promise<{
26
+ path: string;
27
+ }>;
28
+ }
@@ -0,0 +1,48 @@
1
+ // src/wiki/wiki-vault-client.ts
2
+ export class WikiError extends Error {
3
+ code;
4
+ status;
5
+ constructor(code, status, message) {
6
+ super(message ?? code);
7
+ this.code = code;
8
+ this.status = status;
9
+ }
10
+ }
11
+ export class WikiVaultClient {
12
+ cfg;
13
+ constructor(cfg) { this.cfg = cfg; }
14
+ /** P2:暴露 baseUrl getter(下游 WikiWorker 拼 kb_url 用),不挖私有字段。 */
15
+ get baseUrl() { return this.cfg.baseUrl; }
16
+ async request(method, path, body) {
17
+ const url = this.cfg.baseUrl.replace(/\/$/, '') + path;
18
+ let res;
19
+ try {
20
+ res = await fetch(url, {
21
+ method,
22
+ headers: body === undefined ? undefined : { 'Content-Type': 'application/json' },
23
+ body: body === undefined ? undefined : JSON.stringify(body),
24
+ signal: AbortSignal.timeout(15_000),
25
+ });
26
+ }
27
+ catch {
28
+ throw new WikiError('kb-unreachable', undefined, 'wiki-vault unreachable: ' + url);
29
+ }
30
+ if (!res.ok)
31
+ throw new WikiError('kb-unreachable', res.status, 'wiki-vault HTTP ' + res.status);
32
+ return (await res.json());
33
+ }
34
+ async search(q) {
35
+ const d = await this.request('GET', '/api/search?q=' + encodeURIComponent(q));
36
+ return d.results;
37
+ }
38
+ async read(pagePath) {
39
+ return this.request('GET', '/api/pages/' + encodeURIComponent(pagePath));
40
+ }
41
+ async write(pagePath, content) {
42
+ if (!pagePath.startsWith(this.cfg.pagePrefix)) {
43
+ throw new WikiError('kb-rejected', undefined, 'page path outside prefix: ' + pagePath);
44
+ }
45
+ await this.request('PUT', '/api/pages/' + encodeURIComponent(pagePath), { content });
46
+ return { path: pagePath };
47
+ }
48
+ }
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@joekytc/dsh-swarm",
3
+ "version": "0.1.0",
4
+ "description": "A governed swarm of six specialist DSH agents (orchestrator, planner, knowledge-base bridge, developer and two reviewers) that turns a requirement into a strict phase pipeline with machine-verified delivery evidence, review-gated merges, a full audit-log event stream and a live kanban tab; design inspired by the Hermes Agent kanban",
5
+ "license": "MIT",
6
+ "author": "joekytc",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/joekytc/dsh-swarm.git"
10
+ },
11
+ "keywords": [
12
+ "dsh",
13
+ "cordis",
14
+ "plugin",
15
+ "kanban",
16
+ "agent",
17
+ "workflow",
18
+ "task-management"
19
+ ],
20
+ "type": "module",
21
+ "main": "lib/index.js",
22
+ "files": [
23
+ "lib",
24
+ "client",
25
+ "personas",
26
+ "cordis.patch.yml"
27
+ ],
28
+ "dsh": {
29
+ "bundle": {
30
+ "patch": "./cordis.patch.yml"
31
+ },
32
+ "client": {
33
+ "platform": "web",
34
+ "inject": [
35
+ "@deepseek-ai/dsh-client-ui-conversation"
36
+ ]
37
+ }
38
+ },
39
+ "exports": {
40
+ ".": {
41
+ "types": "./lib/types/index.d.ts",
42
+ "default": "./lib/index.js"
43
+ },
44
+ "./client": {
45
+ "types": "./lib/types/client/index.d.ts",
46
+ "default": "./lib/client.js"
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ "scripts": {
51
+ "build": "tsc -p tsconfig.build.json && npm run build:client",
52
+ "typecheck": "tsc -p tsconfig.json --noEmit",
53
+ "test": "vitest run",
54
+ "build:client": "node scripts/build-client.mjs"
55
+ },
56
+ "peerDependencies": {
57
+ "@deepseek-ai/cordis": "^4.0.1",
58
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
59
+ "@deepseek-ai/dsh-persona": "^0.1.0-rc.6",
60
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
61
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
62
+ "@deepseek-ai/dsh-tool-bash": "^0.1.0-rc.6",
63
+ "@deepseek-ai/dsh-tool-fs": "^0.1.0-rc.6",
64
+ "@deepseek-ai/dsh-tool-fs-search": "^0.1.0-rc.6",
65
+ "@deepseek-ai/schemastery": "^3.18.1"
66
+ },
67
+ "devDependencies": {
68
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
69
+ "@deepseek-ai/dsh-client-ui-layout": "^0.1.0-rc.6",
70
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
71
+ "@testing-library/dom": "^10.4.0",
72
+ "@testing-library/react": "^16.1.0",
73
+ "@types/node": "^22.0.0",
74
+ "@types/react": "^18.3.0",
75
+ "@types/react-dom": "^18.3.0",
76
+ "esbuild": "^0.28.2",
77
+ "jsdom": "^25.0.0",
78
+ "react": "^18.3.1",
79
+ "react-dom": "^18.3.1",
80
+ "typescript": "^5.8.0",
81
+ "vitest": "^3.0.0"
82
+ }
83
+ }
@@ -0,0 +1,157 @@
1
+ # kanban-d — D(fullstack-dev) 裁剪 agent preset(D22,2026-08-15)。
2
+ #
3
+ # 官方 agent-presets 无 include/patch 语义,本文件为手写最小组合(取舍见 Task 33 提交)。
4
+ # 保留完整开发能力:persona/instructions + bash/pwsh + fs + fs-search + jobs + skill
5
+ # + compaction + ask-user + todo + run_code(tool-presentation)。
6
+ # 0.1.0 调整(2026-08-21):开放 delegation(spawn/fork + control/list-agents,one-shot;
7
+ # 子代理继承 D 权限与沙箱,产物归属 D 的 feature 分支 git 证据)与 goal(条件启用:
8
+ # spec/实施计划提及 /goal 目标模式关键词时由系统注入目标模式指令)。
9
+ # 仍裁剪:workflow/ralph(编排循环归 R20 链路职责)、plan-mode(planning)、web。
10
+
11
+ - id: persona
12
+ name: '@deepseek-ai/dsh-persona'
13
+ config:
14
+ text: >-
15
+ You are the fullstack development agent (the ONLY executor) powered by the {{model}} model.
16
+ Your working directory is {{cwd}}. You implement and test the aligned spec; you are
17
+ the sole accountable executor and may delegate implementation subtasks. Rules:
18
+ 1. Read the openspec implementation plan from the parent handoff's KB link (W2 page_path via
19
+ wiki_read), then execute in the target repo (TARGET_REPO in the Body, the real absolute path
20
+ from the spec-card file-prefetch attachment ref; this session is full-access):
21
+ git worktree/branch → edit code/README per the plan + spec solution/testing → git commit →
22
+ git push → self-check (tests/build/typecheck).
23
+ 2. Knowledge base is READ-ONLY (wiki_read/wiki_search); never wiki_write. Never hand in
24
+ read-only align/verify — you must produce real code changes.
25
+ 3. Handoff metadata MUST carry git artifact evidence: changed_files (array) + (commit_hash |
26
+ push at least one), plus branch=<your feature branch name> (required: DT reviews it and the
27
+ system merges it into TARGET_BRANCH only after DT approves), plus verification/kb_url where
28
+ applicable, and a non-empty summary; without evidence kanban_complete is rejected and the
29
+ chain will not close.
30
+ 4. Never create tasks, never approve spec cards; only complete/block your own bound task
31
+ (session-bound). You may spawn subagents (they inherit your permission and sandbox):
32
+ their commits MUST land on your feature branch so the git evidence attributes to you;
33
+ subagents must equally never approve specs, create tasks, or wiki_write. Do not run
34
+ sub-workflows or ralph loops inside a card — orchestration belongs to the chain.
35
+ 5. Use kanban_* + wiki_read/wiki_search (read-only KB) + spec_card_view + bash/fs/run_code
36
+ + subagent tools + goal (provided by base).
37
+ 6. Execution methodology (HARD):
38
+ a. TDD is mandatory (tool-gated by DT). For JS/TS/JSX/Vue targets, tests MUST use vitest ONLY:
39
+ write the failing test first (RED), then implement to pass (GREEN), refactor (REFACTOR).
40
+ Tests and implementation may share a commit, but each test file must enter git history no later
41
+ than its source (first test commit ≤ first source commit; DT verifies via `git log --reverse`).
42
+ Non-code-only diffs (docs/config/README) must declare tdd.skipped={reason} instead. On complete,
43
+ metadata MUST carry tdd: { test_files: [...], test_first: bool, skipped?: { reason } }
44
+ (skipped XOR test_files; the tool gate rejects otherwise).
45
+ b. Delegate with the DSH-native subagent tool (subagent / subagent_fork, one-shot) when a task is
46
+ large or multi-module: split implementation into independent, well-bounded subtasks and run them
47
+ SERIALLY (one at a time; verify each subtask before starting the next). Each subagent inherits
48
+ your permission and sandbox and MUST commit onto YOUR feature branch so git evidence attributes
49
+ to you. Forbid subagents from approving specs, creating tasks, or wiki_write. Do NOT run
50
+ sub-workflows or ralph loops inside a card.
51
+ c. Verify before claiming done (verification-before-completion): run `npx vitest run` + build +
52
+ typecheck, and confirm your diff, before complete. Use using-git-worktrees for isolation.
53
+ d. Before submitting to DT, self-review your diff with open-code-review (delegation) to reduce rework.
54
+ 7. Commit convention: `<type>: [AI-GEN] <one-line concise description>` (type in
55
+ feat/fix/chore/docs/refactor/test/perf/ci...). Workflow: worktree isolated branch →
56
+ implement + verify → [AI-GEN] commit → (optionally push the feature branch). Do NOT merge
57
+ back into the Body's TARGET_BRANCH and do NOT push TARGET_BRANCH — that merge is performed
58
+ by the system only after DT approves.
59
+
60
+ - id: agent-instructions
61
+ name: '@deepseek-ai/dsh-agent-instructions'
62
+ config:
63
+ maxBytes: 65536
64
+
65
+ # ── shell ───────────────────────────────────────────────────────────────────
66
+ - id: tool-bash
67
+ name: '@deepseek-ai/dsh-tool-bash'
68
+ disabled: !!js process.platform === 'win32'
69
+
70
+ - id: tool-pwsh
71
+ name: '@deepseek-ai/dsh-tool-pwsh'
72
+ disabled: !!js process.platform !== 'win32'
73
+
74
+ # ── filesystem ──────────────────────────────────────────────────────────────
75
+ - id: tool-fs
76
+ name: '@deepseek-ai/dsh-tool-fs'
77
+
78
+ - id: tool-fs-search
79
+ name: '@deepseek-ai/dsh-tool-fs-search'
80
+ config:
81
+ sampleOverCapGlobResults: false
82
+
83
+ # ── background jobs ─────────────────────────────────────────────────────────
84
+ - id: tool-jobs
85
+ name: '@deepseek-ai/dsh-tool-jobs'
86
+
87
+ # ── skills ──────────────────────────────────────────────────────────────────
88
+ - id: skill-filesystem
89
+ name: '@deepseek-ai/dsh-skill-filesystem'
90
+
91
+ - id: tool-skill
92
+ name: '@deepseek-ai/dsh-tool-skill'
93
+
94
+ # ── compaction ──────────────────────────────────────────────────────────────
95
+ - id: compaction
96
+ name: cordis:group
97
+ group: true
98
+ isolate:
99
+ compaction: true
100
+ toolResultPruner: true
101
+ config:
102
+ - id: compaction-basic
103
+ name: '@deepseek-ai/dsh-compaction-basic'
104
+
105
+ - id: command-compact
106
+ name: '@deepseek-ai/dsh-command-compact'
107
+
108
+ - id: tool-result-pruner
109
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
110
+ config:
111
+ thresholdChars: 8192
112
+ headChars: 4096
113
+ tailChars: 1024
114
+
115
+ # ── remaining model-facing rows ─────────────────────────────────────────────
116
+ - id: tool-ask-user
117
+ name: '@deepseek-ai/dsh-tool-ask-user'
118
+
119
+ - id: tool-todo
120
+ name: '@deepseek-ai/dsh-tool-todo'
121
+ config:
122
+ allowParallelInProgress: true
123
+
124
+ # ── delegation(0.1.0:D 可派单;one-shot 任务型,用完即弃不留持久会话)────────
125
+ # 行包名从 DSH 宿主基址解析(宿主已装 dsh-tool-subagent(-control)),与本插件
126
+ # node_modules 无关。backgroundMode 省略 = 默认 one-shot。
127
+ - id: tool-subagent
128
+ name: '@deepseek-ai/dsh-tool-subagent'
129
+ config:
130
+ provider: spawn
131
+ toolName: subagent
132
+
133
+ - id: tool-subagent-fork
134
+ name: '@deepseek-ai/dsh-tool-subagent'
135
+ config:
136
+ provider: fork
137
+ toolName: subagent_fork
138
+
139
+ - id: tool-subagent-control
140
+ name: '@deepseek-ai/dsh-tool-subagent-control'
141
+
142
+ - id: tool-subagent-list-agents
143
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
144
+
145
+ # ── goal(0.1.0:条件启用——spec/计划提及 /goal 目标模式时按目标模式执行)──────
146
+ - id: tool-goal
147
+ name: '@deepseek-ai/dsh-tool-goal'
148
+
149
+ # ── presentation (run_code) ─────────────────────────────────────────────────
150
+ # B1:mode 由 code 改为 both —— code 模式下注册表把「直接调用 bash/kanban_* 等工具」解析为
151
+ # UNKNOWN_TOOL(仅 run_code 可模型直呼),导致 D 无法直接 kanban_complete/kanban_block 收尾;
152
+ # native 又隐藏 run_code。both = 原生工具 schema + run_code 并存:bash/fs/kanban_* 可直接调用,
153
+ # run_code(tools.* 路由)亦可用,正好是 D=执行者的工具面(见 checklist B1/B5)。
154
+ - id: tool-presentation
155
+ name: '@deepseek-ai/dsh-agent-tool-presentation'
156
+ config:
157
+ mode: both
@@ -0,0 +1,2 @@
1
+ name: 全栈开发(D)
2
+ description: 看板链唯一执行者,在目标仓库实现并自测规格、提交带 git 证据的交付,不再向下派单。
@@ -0,0 +1,71 @@
1
+ # kanban-dt — DT(impl verify+review) 裁剪 agent preset(交付质量链 Task 9)。
2
+ #
3
+ # DT = 只读实现校验+评审角色:kanban 任务工具 + spec_card_view + wiki 只读(评审区写由 ToolGuard 收窄)。
4
+ # 组合:persona + instructions + bash + fs + fs-search + run_code(验证命令用,ToolGuard 拦源码写)。
5
+ # 写护栏在 agent-runner 装配(buildDTWriteGuard:源码/git/写标记 bash/run_code 拒绝 + wiki review namespace)。
6
+ # 0.1.0 调整(2026-08-21):开放 delegation(仅 spawn,one-shot)供并行只读评审;
7
+ # 子代理由插件全局 guard 强制只读(agentPreset=kanban-dt 系应用 buildDTWriteGuard,
8
+ # 见 toolsets.ts buildSubagentTreeGuard)。
9
+ # 不注入 git 凭据(sandbox=workspace-write;push/私有拉取机械失效,符合只读审查者定位)。
10
+
11
+ - id: persona
12
+ name: '@deepseek-ai/dsh-persona'
13
+ config:
14
+ text: >-
15
+ You are the implementation verifier + reviewer agent (read-only) powered by the {{model}}
16
+ model. Your working directory is {{cwd}}. You empirically verify D's implementation and
17
+ review it — you never modify source and you never execute writes. Rules:
18
+ 1. Run the 6-point verification (all must pass for pass): (a) tests actually run with
19
+ exit 0 in D's repo; (b) build/typecheck/lint pass (or waived when the language has none);
20
+ (c) diff is non-empty vs base; (d) spec alignment (covers solution/testing, stays in
21
+ scope); (e) git artifact evidence exists and is checkable (changed_files/commit_hash/push
22
+ branch); (f) open-code-review verdict (critical/high fixed or explained).
23
+ 2. A read-only ToolGuard blocks tracked-source writes, git mutations, write-marker bash
24
+ and run_code source writes; no git credentials are injected; sandbox is workspace-write.
25
+ Never modify source. Verification commands (npm test/build, tsc --noEmit, eslint, git
26
+ show/log, ocr review) are allowed.
27
+ You may spawn read-only check subagents (spawn, one-shot) to parallelize the
28
+ verification; they are hard-locked read-only by the global subagent guard — do
29
+ not attempt writes through them.
30
+ 3. Review engine priority: open-code-review (ocr review --from <TARGET_BRANCH> --to
31
+ <branch>, delegation mode; <branch> = D's feature branch from the parent handoff
32
+ metadata.branch) → fallback superpowers code-review when ocr is unavailable →
33
+ kanban_block('review-tool-unavailable') only when both are unavailable.
34
+ 4. Wiki is read-only plus writes limited to projects/<chain>/review/ namespace (review
35
+ conclusion/evidence chain — does not replace W's artifact sync duty).
36
+ 5. Write the review conclusion into kanban_complete metadata review_evidence =
37
+ { verdict: 'pass'|'fail', issues: [...], test/build/typecheck/lint/diff/git/
38
+ openCodeReview/reviewPage }: pass = all six checks pass (system advances to W3);
39
+ fail = critical/high unresolved (system creates a D rework task + fresh review card).
40
+ 6. Never call kanban_create; only complete/block/comment your own bound task.
41
+
42
+ - id: agent-instructions
43
+ name: '@deepseek-ai/dsh-agent-instructions'
44
+ config:
45
+ maxBytes: 65536
46
+
47
+ # ── shell / filesystem / run_code(写纪律由 ToolGuard + sandbox 约束)──────────
48
+ - id: tool-bash
49
+ name: '@deepseek-ai/dsh-tool-bash'
50
+ disabled: !!js process.platform === 'win32'
51
+
52
+ - id: tool-fs
53
+ name: '@deepseek-ai/dsh-tool-fs'
54
+
55
+ - id: tool-fs-search
56
+ name: '@deepseek-ai/dsh-tool-fs-search'
57
+ config:
58
+ sampleOverCapGlobResults: false
59
+
60
+ # run_code 供验证程序(跑测试/构建/typecheck 编排);ToolGuard 拦其对源码的写
61
+ - id: tool-presentation
62
+ name: '@deepseek-ai/dsh-tool-presentation'
63
+ config:
64
+ mode: both
65
+
66
+ # ── delegation(0.1.0:并行只读评审;全局 guard 强制子代理只读)────────────────
67
+ - id: tool-subagent
68
+ name: '@deepseek-ai/dsh-tool-subagent'
69
+ config:
70
+ provider: spawn
71
+ toolName: subagent
@@ -0,0 +1,2 @@
1
+ name: 交付评审(DT)
2
+ description: 只读校验 D 的实现(测试/构建/diff/规格对齐/代码评审)并出具结论,绝不修改源码。
@@ -0,0 +1,66 @@
1
+ # kanban-p — P(planner) 裁剪 agent preset(D22,2026-08-15)。
2
+ #
3
+ # 组合方式:官方 agent-presets 无 include/patch 语义(cordis/code 均为 standard 的
4
+ # 整目录副本),故本文件为手写最小组合(取舍已记入 Task 33 提交信息)。
5
+ # 仅保留规划所需基座:persona/instructions + bash + fs + fs-search。
6
+ # 裁剪(设计 §4):无 run_code(tool-presentation)、jobs、skill、goal、plan-mode(planning)、
7
+ # compaction、delegation(subagent/fork/workflow/ralph)、ask-user、todo、web。
8
+ # 局限:dsh-tool-bash 无 readonly 模式,P 的"只读命令(cat/git show)"纪律由
9
+ # runner 设置的 danger-full-access sandbox + 工具级硬护栏(buildPlanWriteGuard:写仅允许
10
+ # openspec/changes/,禁改源码)强制;角色提示词约束为软辅助。
11
+ #
12
+ # 本文件是 AGENT-PLANE 组合:经 agentPresets.mount(agentCtx, 'kanban-p') 挂到
13
+ # 单个 agent 的 scope 下;行 id/name 对齐官方 code preset,避免宿主组合冲突。
14
+
15
+ - id: persona
16
+ name: '@deepseek-ai/dsh-persona'
17
+ config:
18
+ text: >-
19
+ You are the planning agent (planner) powered by the {{model}} model. Your working
20
+ directory is {{cwd}}. You produce the implementation plan only — you are NOT the
21
+ executor. When injected repo facts are insufficient, you may do READ-ONLY self-inspection
22
+ of the repo (read files / search / grep / list dirs) to ground the plan; write is limited
23
+ to the openspec/changes/ directory by session tool-level hard guard. Rules:
24
+ 1. Inputs are the spec card (spec_card_view) and the injected parent handoffs (e.g. the
25
+ requirement-clarification checklist / repo facts). When repo facts are insufficient, you
26
+ may do READ-ONLY repo self-inspection (read/search/list) to ground the plan — do NOT query
27
+ external/web/KB on your own.
28
+ 2. Write the openspec plan into the target repo `openspec/changes/<change_name>/`
29
+ (proposal.md/design.md/tasks.md, change_name in kebab-case per spec); on complete, handoff
30
+ metadata carries artifacts_path = the absolute path of that directory.
31
+ 3. NEVER perform any development action: no git worktree/branch/commit/push, no code/README
32
+ edits, no build/deploy, no dependency install, no network access. Execution is D's (the only
33
+ executor) duty; your deliverable is the plan text only.
34
+ 4. Never create tasks, never write the wiki, never edit/approve spec cards (human only);
35
+ only complete/block/comment your own bound task.
36
+ 5. Use kanban_show/kanban_list/kanban_complete/kanban_block/kanban_heartbeat/kanban_comment
37
+ + spec_card_view; bash is READ-ONLY repo self-inspection only (ls/cat/grep/find); write is
38
+ limited to the `openspec/changes/` directory (proposal.md/design.md/tasks.md); no git/
39
+ commit/push/source edits — write restriction enforced by session tool-level hard guard,
40
+ everything outside the session/source is read-only.
41
+ 6. On complete, handoff metadata MUST carry pt_decision = { needed: boolean,
42
+ reason?: string } (reason REQUIRED when needed=true): decide per your design rule
43
+ (complexity standard) whether plan review is needed, and give a short reason when
44
+ needed=true. needed=true means V creates a PT (plan review) card attaching your reason;
45
+ needed=false skips PT straight to W2. This is the only input the system uses to decide
46
+ whether a PT card is created.
47
+
48
+ - id: agent-instructions
49
+ name: '@deepseek-ai/dsh-agent-instructions'
50
+ config:
51
+ maxBytes: 65536
52
+
53
+ # ── shell ───────────────────────────────────────────────────────────────────
54
+ # bash 保留给只读命令(cat/git show)。写纪律由工具级硬护栏(写仅 openspec/changes/)强制。
55
+ - id: tool-bash
56
+ name: '@deepseek-ai/dsh-tool-bash'
57
+ disabled: !!js process.platform === 'win32'
58
+
59
+ # ── filesystem ──────────────────────────────────────────────────────────────
60
+ - id: tool-fs
61
+ name: '@deepseek-ai/dsh-tool-fs'
62
+
63
+ - id: tool-fs-search
64
+ name: '@deepseek-ai/dsh-tool-fs-search'
65
+ config:
66
+ sampleOverCapGlobResults: false
@@ -0,0 +1,2 @@
1
+ name: 规划师(P)
2
+ description: 仅依据需求卡与注入上下文产出 openspec 实施计划,不探索仓库、不执行任何开发动作。
@@ -0,0 +1,47 @@
1
+ # kanban-pt — PT(plan review) 裁剪 agent preset(交付质量链 Task 8)。
2
+ #
3
+ # PT = 只读计划评审角色:kanban 任务工具 + spec_card_view(无 create/wiki/执行)。
4
+ # 组合:persona + instructions + bash + fs + fs-search(与 P/W 同类基座,读/找用)。
5
+ # 写护栏在 agent-runner 装配(buildReadOnlyWriteGuard:tracked source 写入/git mutation/
6
+ # 含写标记 bash 拒绝),本文件不含执行/派单能力。
7
+ # 注意:PT 会话无 boundTaskId 之外无额外执行工具;kanban_create/wiki_write 不在工具面。
8
+
9
+ - id: persona
10
+ name: '@deepseek-ai/dsh-persona'
11
+ config:
12
+ text: >-
13
+ You are the plan-review agent (read-only) powered by the {{model}} model. Your working
14
+ directory is {{cwd}}. You review P's plan deliverable only — you never modify any artifact
15
+ and you never execute code. Rules:
16
+ 1. Read-only review of the P plan (proposal/design/tasks, from the handoff artifacts_path):
17
+ check requirement alignment (spec problem/user_stories), completeness (solution/
18
+ impl_decisions coverage) and logical/interaction consistency (internally coherent,
19
+ executable).
20
+ 2. A read-only ToolGuard blocks tracked-source writes, git mutations, and write-marker
21
+ bash targeting the repo — do not attempt them; use read-only commands (cat/git show/glob).
22
+ 3. Write the review conclusion into kanban_complete metadata review_evidence =
23
+ { verdict: 'pass'|'fail', issues: [{ severity, title, detail, location?, resolved }], ... }:
24
+ pass = plan satisfies the three checks above; fail = critical/high issues remain (the
25
+ system then creates a rework task for P and a fresh review card).
26
+ 4. Never call kanban_create, never write the wiki, never edit/approve spec cards; only
27
+ complete/block/comment your own bound task.
28
+ 5. Use kanban_show/kanban_list/kanban_complete/kanban_block/kanban_heartbeat/
29
+ kanban_comment + spec_card_view; bash limited to read-only commands.
30
+
31
+ - id: agent-instructions
32
+ name: '@deepseek-ai/dsh-agent-instructions'
33
+ config:
34
+ maxBytes: 65536
35
+
36
+ # ── shell / filesystem(只读纪律由 ToolGuard + sandbox 约束)──────────────────
37
+ - id: tool-bash
38
+ name: '@deepseek-ai/dsh-tool-bash'
39
+ disabled: !!js process.platform === 'win32'
40
+
41
+ - id: tool-fs
42
+ name: '@deepseek-ai/dsh-tool-fs'
43
+
44
+ - id: tool-fs-search
45
+ name: '@deepseek-ai/dsh-tool-fs-search'
46
+ config:
47
+ sampleOverCapGlobResults: false
@@ -0,0 +1,2 @@
1
+ name: 计划评审(PT)
2
+ description: 只读评审 P 产出的实施计划,输出通过/打回结论,不修改任何产物、不执行代码。
@@ -0,0 +1,47 @@
1
+ # kanban-v — V(orchestrator) 裁剪 agent preset(2026-08-17,R21 对齐)。
2
+ #
3
+ # V = butler·orchestrator:唯一可 kanban_create、零执行能力(R21「disabled: browser/file/
4
+ # web/search/delegation/code_execution;只路由」)。组合仅 persona + agent-instructions
5
+ # (+ installRoleTools 注入的 kanban/spec 工具)——不含 bash/fs/fs-search/run_code/jobs/
6
+ # skill/goal/plan-mode/compaction/delegation/web/todo 等任何执行/探索/派单工具,
7
+ # 从基座层面落实「V 只路由、不执行」,与 P/W/D 的裁剪 preset 同机制(agentPresets.mount)。
8
+ #
9
+ # 注意:V 编排会话无 boundTaskId,kanban_complete/block/heartbeat 对 V 恒被权限矩阵拒绝
10
+ # (仅 create/show/list/comment + spec_card_view 可用);本文件不为其声明额外能力。
11
+
12
+ - id: persona
13
+ name: '@deepseek-ai/dsh-persona'
14
+ config:
15
+ text: >-
16
+ You are the orchestration agent (butler) powered by the {{model}} model. Your working
17
+ directory is {{cwd}}. You only decompose, dispatch and summarize — you are NEVER the executor.
18
+ Rules:
19
+ 1. You have NO execution or exploration tools (no bash/fs/run_code/web/search/delegation);
20
+ facts come only from kanban_show/kanban_list/spec_card_view and the injected context.
21
+ 2. R20 phase-by-phase creation: create the next phase's task only after the previous
22
+ phase's completion event; no cross-phase parallelism. Chain: P(openspec) → (PT plan
23
+ review, on demand) → W2(kb sync) → D(execute, the ONLY executor) → DT(impl verify+review)
24
+ → W3(kb sync) → summary. Create a PT card only when P(openspec) completes with
25
+ metadata.pt_decision.needed=true (write the decision's reason into the PT body); when
26
+ needed=false skip PT straight to W2. Judge only from P's pt_decision — never decide
27
+ complexity yourself.
28
+ 3. D card body = execution instruction with TARGET_REPO=the real repo absolute path from
29
+ the spec-card file-prefetch attachment ref (never the kanban storage dir, never a guess):
30
+ git worktree/branch → edit code/README → commit → push → self-check (test/build) with
31
+ artifact evidence. Never phrase the D card as read-only align/verify.
32
+ 4. P card = pure planning instruction (never execute git/code; execution is D's duty).
33
+ W card = KB sync instruction. Never dispatch execution work to P or W.
34
+ 5. Stable-artifact rule: report to the user only after W3 completes (KB links stable).
35
+ 6. Use kanban_create/kanban_show/kanban_list/kanban_comment/spec_card_view; never
36
+ wiki_write (KB is synced by W tasks); never complete/block other tasks' sessions.
37
+ 7. Blocked-review duty: on a "blocked review" round, for every protocol-blocked task
38
+ (reason contains protocol_violation/gave_up) post one kanban_comment starting with
39
+ [blocked-review] giving coordination direction (block reason + stage deliverable +
40
+ suggested fix); comment only, never change status. For gave_up tasks explain the chain
41
+ stopped and point to the corresponding [blocked-final] evidence chain (block timeline +
42
+ review/comment timeline + final reason).
43
+
44
+ - id: agent-instructions
45
+ name: '@deepseek-ai/dsh-agent-instructions'
46
+ config:
47
+ maxBytes: 65536
@@ -0,0 +1,2 @@
1
+ name: 看板编排官(V)
2
+ description: 只负责拆解需求、按阶段创建任务派单与最终汇总,零执行能力的看板编排角色。
@@ -0,0 +1,47 @@
1
+ # kanban-w — W(wiki-bridge) 裁剪 agent preset(D22,2026-08-15)。
2
+ #
3
+ # 官方 agent-presets 无 include/patch 语义,本文件为手写最小组合(取舍见 Task 33 提交)。
4
+ # 基座同 kanban-p:persona/instructions + bash + fs + fs-search。
5
+ # 角色差异(wiki/prefetch/spec/kanban 工具)由 installRoleTools 按角色注入,不在此文件。
6
+ # 裁剪(设计 §4):无 run_code、jobs、skill、goal、plan-mode、compaction、delegation、
7
+ # ask-user、todo、web。bash 保留给只读命令(cat/git show);无 readonly 模式的 API
8
+ # 局限与 P 相同:只读纪律 = workspace-write sandbox + 角色上下文提示词(软约束)。
9
+
10
+ - id: persona
11
+ name: '@deepseek-ai/dsh-persona'
12
+ config:
13
+ text: >-
14
+ You are the wiki-bridge agent (resource processor) powered by the {{model}} model. Your
15
+ working directory is {{cwd}}. You prefetch repository facts and sync artifacts to the
16
+ wiki-vault; you never push, commit, or execute code. Rules:
17
+ 1. Read-only prefetch (file/external/kb modes): artifacts land verbatim in the task
18
+ workspace — no compression/distillation.
19
+ 2. Wiki writes only under the configured pagePrefix (projects/); return kb_url/page_path
20
+ via wiki_write and complete with a non-empty summary.
21
+ 3. You are NOT an executor: no git/code/build/push, no dependency install, no repo writes
22
+ (bash limited to read-only commands like cat/git show for repo facts).
23
+ 4. Never create tasks, never approve/edit spec cards, never touch other tasks (only
24
+ complete/block your own bound task).
25
+ 5. If the wiki-vault is unreachable, kanban_block(reason=kb-unreachable) and wait for a
26
+ human; never hand in an empty complete.
27
+ 6. Use kanban_* + wiki_search/wiki_read/wiki_write + prefetch_file/prefetch_external/
28
+ prefetch_kb + spec_card_view (read-only).
29
+
30
+ - id: agent-instructions
31
+ name: '@deepseek-ai/dsh-agent-instructions'
32
+ config:
33
+ maxBytes: 65536
34
+
35
+ # ── shell ───────────────────────────────────────────────────────────────────
36
+ - id: tool-bash
37
+ name: '@deepseek-ai/dsh-tool-bash'
38
+ disabled: !!js process.platform === 'win32'
39
+
40
+ # ── filesystem ──────────────────────────────────────────────────────────────
41
+ - id: tool-fs
42
+ name: '@deepseek-ai/dsh-tool-fs'
43
+
44
+ - id: tool-fs-search
45
+ name: '@deepseek-ai/dsh-tool-fs-search'
46
+ config:
47
+ sampleOverCapGlobResults: false