dsh-workplan 3.0.0 → 3.0.2
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/CHANGELOG.md +51 -0
- package/README.en.md +20 -18
- package/README.md +33 -19
- package/README.zh.md +15 -19
- package/client.js +36 -67
- package/docs/cc/ADV-FSP-FUNCTIONAL-SPEC.md +16 -3
- package/docs/cc/ADV-TDS-TOE-DESIGN.md +3 -3
- package/docs/cc/AGD-OPS-SECURE-OPERATION.md +3 -7
- package/docs/cc/AVA-VULNERABILITY-ANALYSIS.md +19 -0
- package/docs/cc/SECURITY-TARGET.md +6 -6
- package/docs/collaboration.md +17 -16
- package/lib/approval-gate.js +144 -0
- package/lib/client.js +36 -67
- package/lib/criterion.js +22 -27
- package/lib/host.js +178 -40
- package/lib/llm-rules.js +2 -2
- package/lib/plan.js +176 -85
- package/lib/runtime.js +756 -829
- package/lib/watchdog.js +3 -0
- package/package.json +3 -2
- package/src/approval-gate.ts +168 -0
- package/src/client.ts +36 -67
- package/src/criterion.ts +22 -23
- package/src/host.ts +185 -40
- package/src/llm-rules.ts +2 -2
- package/src/plan.ts +166 -83
- package/src/runtime.ts +643 -693
- package/src/watchdog.ts +7 -0
package/src/watchdog.ts
CHANGED
|
@@ -164,6 +164,11 @@ export function createProgressWatchdog(input: {
|
|
|
164
164
|
idleMs: number
|
|
165
165
|
hardMs: number
|
|
166
166
|
makeError: (reason: Exclude<TimeoutReason, null>) => Error
|
|
167
|
+
/**
|
|
168
|
+
* 是否执行时间上限。缺省 false:只观测进度与回执,不预警、不拒绝、不中止。
|
|
169
|
+
* 仅供独立历史测试显式传 true 复现旧工具语义;部门负责人/专家生产路径不得启用。
|
|
170
|
+
*/
|
|
171
|
+
enforceTimeouts?: boolean
|
|
167
172
|
pollMs?: number
|
|
168
173
|
onProgress?: (info: { now: number; seq: number; elapsedMs: number }) => void
|
|
169
174
|
onApproachingDeadline?: (info: ApproachingDeadlineInfo) => void
|
|
@@ -171,6 +176,7 @@ export function createProgressWatchdog(input: {
|
|
|
171
176
|
now?: () => number
|
|
172
177
|
}): ProgressWatchdog {
|
|
173
178
|
const clock = input.now ?? (() => Date.now())
|
|
179
|
+
const enforceTimeouts = input.enforceTimeouts === true
|
|
174
180
|
const pollMs = Math.max(10, Math.floor(input.pollMs ?? 2000))
|
|
175
181
|
const startedAt = clock()
|
|
176
182
|
let lastProgress = startedAt
|
|
@@ -254,6 +260,7 @@ export function createProgressWatchdog(input: {
|
|
|
254
260
|
}
|
|
255
261
|
}
|
|
256
262
|
}
|
|
263
|
+
if (!enforceTimeouts) return
|
|
257
264
|
warnApproachingDeadline(now)
|
|
258
265
|
const reason = pickTimeoutReason({
|
|
259
266
|
now,
|