dsh-plugin-teamflow 0.1.8 → 0.2.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.
package/lib/store.mjs CHANGED
@@ -106,19 +106,39 @@ function serializeJournal(journal) {
106
106
  status: journal.status,
107
107
  requirement: journal.requirement,
108
108
  options: journal.options,
109
+ engine: journal.engine || null,
109
110
  workspace: journal.workspace || null,
110
111
  workspacePath: journal.workspacePath || null,
111
112
  ownerSession: journal.ownerSession || null,
112
113
  product: journal.product || null,
114
+ locale: journal.locale || null,
113
115
  sanity: journal.sanity || null,
114
116
  blueprint: journal.blueprint || null,
115
117
  reqId: journal.reqId || null,
116
118
  runDocs: journal.runDocs || null,
119
+ branch: journal.branch || null,
120
+ mergeStatus: journal.mergeStatus || null,
117
121
  taskId: journal.taskId || null,
118
122
  taskMap: journal.taskMap || {},
119
123
  agentsStarted: journal.agentsStarted || 0,
120
124
  humanIntervention: journal.humanIntervention === true,
125
+ /** E 方案(2026-09-15):本轮验收是「已知问题」只读模式(QA 打回超限后补跑)——report 据此给
126
+ * 「结论被强制为需人工裁定、不要据此合回」的显式提示(持久化:重启/resume 后仍可判)。 */
127
+ knownIssuesAcceptance: journal.knownIssuesAcceptance === true,
121
128
  cancelled: journal.cancelled === true,
129
+ /** 取消来源(ui=界面按钮/人工,tool=模型工具,unknown=历史 run):主线程据此判断「谁停的」。 */
130
+ cancelSource: journal.cancelSource || null,
131
+ cancelRequestedAt: journal.cancelRequestedAt || null,
132
+ /** 需求澄清闸门(2026-09-16 Phase 1):分诊裁决(intent/blockers)+ PRD 假设段 + 澄清答复。
133
+ * 裁决是 shadow 埋点(Phase 2 定闸门强度的数据源);假设段是「agent 替你决定了什么」的可见化。 */
134
+ triage: journal.triage || null,
135
+ assumptions: journal.assumptions || null,
136
+ hostResearch: journal.hostResearch === true,
137
+ hostContract: journal.hostContract || null,
138
+ installEnv: journal.installEnv || null,
139
+ requirementSupplement: journal.requirementSupplement || null,
140
+ /** 外部供应商故障标记(限流/无额度/上游故障/超时):run 落可续跑中断态时置位,汇报据此讲清「非交付缺陷」。 */
141
+ externalFailure: journal.externalFailure === true,
122
142
  interrupted: journal.interrupted === true,
123
143
  interruptedAt: journal.interruptedAt || null,
124
144
  supersededBy: journal.supersededBy || null,
@@ -130,6 +150,9 @@ function serializeJournal(journal) {
130
150
  label: s.label,
131
151
  phase: s.phase,
132
152
  taskKey: s.taskKey || null,
153
+ taskIds: Array.isArray(s.taskIds) && s.taskIds.length ? s.taskIds : null,
154
+ provider: s.provider || null,
155
+ model: s.model || null,
133
156
  status: s.status,
134
157
  outcome: s.outcome || null,
135
158
  childId: s.childId || null,
@@ -138,6 +161,9 @@ function serializeJournal(journal) {
138
161
  usage: s.usage || null,
139
162
  handoff: clip(s.handoff || "", 2e3),
140
163
  summary: clip(s.summary || "", 3e3),
164
+ guardReason: s.guardReason || null,
165
+ guardOutcome: s.guardOutcome || null,
166
+ envUnavailable: s.envUnavailable || null,
141
167
  output: clip(s.output || s.summary || "", STAGE_OUTPUT_CLIP),
142
168
  verifyEvidence: s.verifyEvidence ? clip(s.verifyEvidence, 8e3) : null
143
169
  })),
@@ -145,6 +171,27 @@ function serializeJournal(journal) {
145
171
  t: l.t,
146
172
  level: l.level,
147
173
  message: clip(l.message, 500)
174
+ })),
175
+ qaRounds: (journal.qaRounds || []).slice(-12).map((r) => ({
176
+ round: r.round,
177
+ seq: r.seq,
178
+ blocking: r.blocking,
179
+ p3: r.p3,
180
+ defects: Array.isArray(r.defects) ? r.defects.slice(0, 20).map((d) => ({
181
+ id: clip(d.id, 40),
182
+ sev: d.sev,
183
+ module: clip(d.module, 60),
184
+ fp: clip(d.fp, 200)
185
+ })) : [],
186
+ withCheck: r.withCheck,
187
+ withCriterion: r.withCriterion,
188
+ qaCalls: r.qaCalls,
189
+ fixCalls: r.fixCalls,
190
+ gate: r.gate,
191
+ newFps: r.newFps,
192
+ repeats: r.repeats,
193
+ resolved: r.resolved,
194
+ outcome: r.outcome
148
195
  }))
149
196
  };
150
197
  }
@@ -161,17 +208,41 @@ function writeText(file, text) {
161
208
  return false;
162
209
  }
163
210
  }
164
- /** 工作区下日志落点:<工作区>/logs/teamflow/<runId>.log(存在 workspacePath 时才落)。 */
165
- function runLogFile(journal) {
211
+ /** 工作区内暂存目录段(与 host/constants.TF_LOG_DIR 同址;store 是独立 entry、刻意不引 host 代码,一致性由 test/runlogs.test.js 守门)。 */
212
+ const STAGING_SEGMENTS = ["logs", "teamflow"];
213
+ /** 归档用的工作区槽位:优先 journal.workspace,缺失/兜底时按 workspacePath 派生(与 backlog 同键)。 */
214
+ function logWorkspaceKey(journal) {
215
+ const w = journal && typeof journal.workspace === "string" ? journal.workspace.trim() : "";
216
+ if (w && w !== "default") return w;
217
+ const p = journal ? journal.workspacePath : null;
218
+ return p ? slugPath(p) : null;
219
+ }
220
+ /** 归档根(工作区级):`$DSH_HOME/teamflow/<workspace>/logs/`(每个 run 一个子目录)。 */
221
+ function logsArchiveRoot(journal) {
222
+ const key = logWorkspaceKey(journal);
223
+ return key ? join(teamflowRoot(), key, "logs") : null;
224
+ }
225
+ /** 归档落点(run 级目录):`$DSH_HOME/teamflow/<workspace>/logs/<runId>/`(与 journal/backlog 同槽位)。 */
226
+ function runLogArchiveDir(journal) {
227
+ const root = logsArchiveRoot(journal);
228
+ return root ? join(root, journal.id) : null;
229
+ }
230
+ /** 工作区内暂存落点(子代理写、run 结束归档后删除):`<workspacePath>/logs/teamflow/<runId>/`。 */
231
+ function runLogStagingDir(journal) {
166
232
  if (!journal.workspacePath) return null;
167
- return join(journal.workspacePath, "logs", "teamflow", `${journal.id}.log`);
233
+ return join(journal.workspacePath, ...STAGING_SEGMENTS, journal.id);
234
+ }
235
+ /** host 事件日志落点:`<归档 run 目录>/run.log`(run 期间即写终态位置,无需搬运)。 */
236
+ function runLogFile(journal) {
237
+ const dir = runLogArchiveDir(journal);
238
+ return dir ? join(dir, "run.log") : null;
168
239
  }
169
- /** 把运行事件日志聚合写到 <工作区>/logs/teamflow/<runId>.loglogs 收口,防止污染宿主)。 */
240
+ /** 把运行事件日志聚合写到 `$DSH_HOME/teamflow/<workspace>/logs/<runId>/run.log`(logs 离开用户项目)。 */
170
241
  function persistRunLog(journal) {
171
242
  const file = runLogFile(journal);
172
243
  if (!file) return false;
173
244
  const lines = [
174
- `# TeamFlow 运行日志(${journal.name})`,
245
+ journal.locale === "en" ? `# TeamFlow run log (${journal.name})` : `# TeamFlow 运行日志(${journal.name})`,
175
246
  `runId=${journal.id}`,
176
247
  `workspace=${journal.workspacePath || ""}`,
177
248
  `product=${journal.product || ""}`,
@@ -255,4 +326,4 @@ function loadJournals() {
255
326
  return out;
256
327
  }
257
328
  //#endregion
258
- export { STAGE_OUTPUT_CLIP, dshHome, fileFor, journalFile, loadJournals, persistJournal, persistRunLog, productDir, readJson, readJsonAny, runLogFile, runsDir, serializeJournal, slugPath, teamflowRoot, workspaceDir, writeJson, writeText };
329
+ export { STAGE_OUTPUT_CLIP, dshHome, fileFor, journalFile, loadJournals, logsArchiveRoot, persistJournal, persistRunLog, productDir, readJson, readJsonAny, runLogArchiveDir, runLogFile, runLogStagingDir, runsDir, serializeJournal, slugPath, teamflowRoot, workspaceDir, writeJson, writeText };
package/package.json CHANGED
@@ -1,134 +1,134 @@
1
- {
2
- "name": "dsh-plugin-teamflow",
3
- "version": "0.1.8",
4
- "description": "TeamFlow 团队研发流水线(TypeScript):需求→PRD→设计→架构→技术方案→并行开发→QA→验收;backlog 持久化 + 断点续跑 + 完成汇报 + 防假交付;Web 团队工作台(conversation.view tab + 拖拽看板)",
5
- "type": "module",
6
- "main": "./lib/host.mjs",
7
- "exports": {
8
- ".": "./lib/host.mjs",
9
- "./host": "./lib/host.mjs",
10
- "./client": "./lib/client.js",
11
- "./store": "./lib/store.mjs",
12
- "./descriptors": "./lib/descriptors.mjs",
13
- "./package.json": "./package.json"
14
- },
15
- "engines": {
16
- "node": ">=22.18",
17
- "dsh": ">=0.1.5-rc.2 <0.2.0"
18
- },
19
- "dsh": {
20
- "manifestVersion": 1,
21
- "bundle": {
22
- "patch": "./cordis.patch.yml"
23
- },
24
- "client": {
25
- "platform": "web",
26
- "inject": [
27
- "@deepseek-ai/dsh-client-locale",
28
- "@deepseek-ai/dsh-client-modules",
29
- "@deepseek-ai/dsh-client-ui-conversation",
30
- "@deepseek-ai/dsh-client-ui-layout",
31
- "@deepseek-ai/dsh-client-ui-sidebar",
32
- "@deepseek-ai/dsh-client-ui-sidebar-right"
33
- ],
34
- "immediately": false
35
- }
36
- },
37
- "scripts": {
38
- "bundle": "tsdown && tsdown -c tsdown.host.config.ts",
39
- "bundle:host": "tsdown -c tsdown.host.config.ts",
40
- "bundle:client": "tsdown",
41
- "watch": "tsdown --watch",
42
- "deploy": "node deploy.mjs",
43
- "typecheck": "tsc --noEmit",
44
- "test": "node test/smoke.js && node test/verdict.test.js && node test/stages.test.js && node test/journal.test.js && node test/diagnostic.test.js && node test/evidence.test.js && node test/metering.test.js && node test/gitignore.test.js && node test/product-scope.test.js && node test/prompt-contract.test.js && node test/conformance.test.js",
45
- "prepublishOnly": "npx tsdown && npx tsdown -c tsdown.host.config.ts && node test/smoke.js && node test/verdict.test.js && node test/stages.test.js && node test/journal.test.js && node test/diagnostic.test.js && node test/evidence.test.js && node test/metering.test.js && node test/gitignore.test.js && node test/product-scope.test.js && node test/prompt-contract.test.js && node test/conformance.test.js"
46
- },
47
- "files": [
48
- "lib",
49
- "cordis.patch.yml",
50
- "README.md",
51
- "README.en.md",
52
- "CHANGELOG.md"
53
- ],
54
- "keywords": [
55
- "dsh",
56
- "deepseek-harness",
57
- "plugin",
58
- "teamflow",
59
- "multi-agent",
60
- "pipeline",
61
- "agent-team",
62
- "llm-agent",
63
- "kanban",
64
- "coding-agent"
65
- ],
66
- "dependencies": {},
67
- "devDependencies": {
68
- "@types/node": "^26.2.0",
69
- "@types/react": "^18.3.31",
70
- "tsdown": "^0.22.2",
71
- "typescript": "^6.0.3"
72
- },
73
- "peerDependencies": {
74
- "react": "^18.2.0",
75
- "@deepseek-ai/dsh-base": "*",
76
- "@deepseek-ai/dsh-client-locale": "*",
77
- "@deepseek-ai/dsh-client-modules": "*",
78
- "@deepseek-ai/dsh-client-ui-conversation": "*",
79
- "@deepseek-ai/dsh-client-ui-layout": "*",
80
- "@deepseek-ai/dsh-client-ui-sidebar": "*",
81
- "@deepseek-ai/dsh-client-ui-sidebar-right": "*",
82
- "@deepseek-ai/dsh-llm": "*",
83
- "@deepseek-ai/dsh-tools": "*",
84
- "@deepseek-ai/dsh-typert-protocol": "*",
85
- "@deepseek-ai/dsh-util-workspace-path": "*"
86
- },
87
- "peerDependenciesMeta": {
88
- "@deepseek-ai/dsh-base": {
89
- "optional": true
90
- },
91
- "@deepseek-ai/dsh-client-locale": {
92
- "optional": true
93
- },
94
- "@deepseek-ai/dsh-client-modules": {
95
- "optional": true
96
- },
97
- "@deepseek-ai/dsh-client-ui-conversation": {
98
- "optional": true
99
- },
100
- "@deepseek-ai/dsh-client-ui-layout": {
101
- "optional": true
102
- },
103
- "@deepseek-ai/dsh-client-ui-sidebar": {
104
- "optional": true
105
- },
106
- "@deepseek-ai/dsh-client-ui-sidebar-right": {
107
- "optional": true
108
- },
109
- "@deepseek-ai/dsh-llm": {
110
- "optional": true
111
- },
112
- "@deepseek-ai/dsh-tools": {
113
- "optional": true
114
- },
115
- "@deepseek-ai/dsh-typert-protocol": {
116
- "optional": true
117
- },
118
- "@deepseek-ai/dsh-util-workspace-path": {
119
- "optional": true
120
- },
121
- "react": {
122
- "optional": true
123
- }
124
- },
125
- "license": "MIT",
126
- "repository": {
127
- "type": "git",
128
- "url": "https://github.com/MichaelShii/dsh-plugin-teamflow.git"
129
- },
130
- "homepage": "https://github.com/MichaelShii/dsh-plugin-teamflow",
131
- "bugs": {
132
- "url": "https://github.com/MichaelShii/dsh-plugin-teamflow/issues"
133
- }
134
- }
1
+ {
2
+ "name": "dsh-plugin-teamflow",
3
+ "version": "0.2.0",
4
+ "description": "TeamFlow 团队研发流水线(TypeScript):需求→PRD→设计→架构→技术方案→并行开发→QA→验收;backlog 持久化 + 断点续跑 + 完成汇报 + 防假交付;Web 团队工作台(conversation.view tab + 拖拽看板)",
5
+ "type": "module",
6
+ "main": "./lib/host.mjs",
7
+ "exports": {
8
+ ".": "./lib/host.mjs",
9
+ "./host": "./lib/host.mjs",
10
+ "./client": "./lib/client.js",
11
+ "./store": "./lib/store.mjs",
12
+ "./descriptors": "./lib/descriptors.mjs",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "engines": {
16
+ "node": ">=22.18",
17
+ "dsh": ">=0.1.7-alpha.1 <0.2.0"
18
+ },
19
+ "dsh": {
20
+ "manifestVersion": 1,
21
+ "bundle": {
22
+ "patch": "./cordis.patch.yml"
23
+ },
24
+ "client": {
25
+ "platform": "web",
26
+ "inject": [
27
+ "@deepseek-ai/dsh-client-locale",
28
+ "@deepseek-ai/dsh-client-modules",
29
+ "@deepseek-ai/dsh-client-ui-conversation",
30
+ "@deepseek-ai/dsh-client-ui-layout",
31
+ "@deepseek-ai/dsh-client-ui-sidebar",
32
+ "@deepseek-ai/dsh-client-ui-sidebar-right"
33
+ ],
34
+ "immediately": false
35
+ }
36
+ },
37
+ "scripts": {
38
+ "bundle": "tsdown && tsdown -c tsdown.host.config.ts",
39
+ "bundle:host": "tsdown -c tsdown.host.config.ts",
40
+ "bundle:client": "tsdown",
41
+ "watch": "tsdown --watch",
42
+ "deploy": "node deploy.mjs",
43
+ "typecheck": "tsc --noEmit",
44
+ "test": "node test/smoke.js && node test/locale.test.js && node test/verdict.test.js && node test/stages.test.js && node test/journal.test.js && node test/runlogs.test.js && node test/cancel.test.js && node test/diagnostic.test.js && node test/evidence.test.js && node test/metering.test.js && node test/gitignore.test.js && node test/commit-path.test.js && node test/product-scope.test.js && node test/state.test.js && node test/dev-task-id.test.js && node test/triage-gate.test.js && node test/instruction-budget.test.js && node test/prompt-contract.test.js && node test/conformance.test.js && node test/changelog.test.js && node test/client-host-api.test.js",
45
+ "prepublishOnly": "npx tsdown && npx tsdown -c tsdown.host.config.ts && node test/smoke.js && node test/locale.test.js && node test/verdict.test.js && node test/stages.test.js && node test/journal.test.js && node test/runlogs.test.js && node test/cancel.test.js && node test/diagnostic.test.js && node test/evidence.test.js && node test/metering.test.js && node test/gitignore.test.js && node test/commit-path.test.js && node test/product-scope.test.js && node test/state.test.js && node test/dev-task-id.test.js && node test/triage-gate.test.js && node test/instruction-budget.test.js && node test/prompt-contract.test.js && node test/conformance.test.js && node test/changelog.test.js && node test/client-host-api.test.js"
46
+ },
47
+ "files": [
48
+ "lib",
49
+ "cordis.patch.yml",
50
+ "README.md",
51
+ "README.en.md",
52
+ "CHANGELOG.md"
53
+ ],
54
+ "keywords": [
55
+ "dsh",
56
+ "deepseek-harness",
57
+ "plugin",
58
+ "teamflow",
59
+ "multi-agent",
60
+ "pipeline",
61
+ "agent-team",
62
+ "llm-agent",
63
+ "kanban",
64
+ "coding-agent"
65
+ ],
66
+ "dependencies": {},
67
+ "devDependencies": {
68
+ "@types/node": "^26.2.0",
69
+ "@types/react": "^18.3.31",
70
+ "tsdown": "^0.22.2",
71
+ "typescript": "^6.0.3"
72
+ },
73
+ "peerDependencies": {
74
+ "react": "^18.2.0",
75
+ "@deepseek-ai/dsh-base": "*",
76
+ "@deepseek-ai/dsh-client-locale": "*",
77
+ "@deepseek-ai/dsh-client-modules": "*",
78
+ "@deepseek-ai/dsh-client-ui-conversation": "*",
79
+ "@deepseek-ai/dsh-client-ui-layout": "*",
80
+ "@deepseek-ai/dsh-client-ui-sidebar": "*",
81
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "*",
82
+ "@deepseek-ai/dsh-llm": "*",
83
+ "@deepseek-ai/dsh-tools": "*",
84
+ "@deepseek-ai/dsh-typert-protocol": "*",
85
+ "@deepseek-ai/dsh-util-workspace-path": "*"
86
+ },
87
+ "peerDependenciesMeta": {
88
+ "@deepseek-ai/dsh-base": {
89
+ "optional": true
90
+ },
91
+ "@deepseek-ai/dsh-client-locale": {
92
+ "optional": true
93
+ },
94
+ "@deepseek-ai/dsh-client-modules": {
95
+ "optional": true
96
+ },
97
+ "@deepseek-ai/dsh-client-ui-conversation": {
98
+ "optional": true
99
+ },
100
+ "@deepseek-ai/dsh-client-ui-layout": {
101
+ "optional": true
102
+ },
103
+ "@deepseek-ai/dsh-client-ui-sidebar": {
104
+ "optional": true
105
+ },
106
+ "@deepseek-ai/dsh-client-ui-sidebar-right": {
107
+ "optional": true
108
+ },
109
+ "@deepseek-ai/dsh-llm": {
110
+ "optional": true
111
+ },
112
+ "@deepseek-ai/dsh-tools": {
113
+ "optional": true
114
+ },
115
+ "@deepseek-ai/dsh-typert-protocol": {
116
+ "optional": true
117
+ },
118
+ "@deepseek-ai/dsh-util-workspace-path": {
119
+ "optional": true
120
+ },
121
+ "react": {
122
+ "optional": true
123
+ }
124
+ },
125
+ "license": "MIT",
126
+ "repository": {
127
+ "type": "git",
128
+ "url": "https://github.com/MichaelShii/dsh-plugin-teamflow.git"
129
+ },
130
+ "homepage": "https://github.com/MichaelShii/dsh-plugin-teamflow",
131
+ "bugs": {
132
+ "url": "https://github.com/MichaelShii/dsh-plugin-teamflow/issues"
133
+ }
134
+ }