dsh-chief 1.2.0 → 1.3.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/CHANGELOG.md +51 -0
- package/README.en.md +28 -13
- package/README.md +27 -12
- package/api-routes.js +1274 -0
- package/archive-cabinets.js +766 -0
- package/archive-core.js +761 -0
- package/archive-dossiers.js +1185 -0
- package/archive-precipitated.js +428 -0
- package/archives.js +63 -2991
- package/auto-continue.js +11 -1
- package/board-actions.js +1879 -0
- package/board-schema.js +580 -0
- package/board-store.js +392 -0
- package/chief-approvals.js +841 -0
- package/chief-archives.js +905 -0
- package/chief-commands.js +2513 -0
- package/chief-compaction.js +591 -0
- package/chief-executor.js +859 -153
- package/chief-models.js +578 -0
- package/chief-network.js +720 -0
- package/chief-review.js +1064 -0
- package/chief-state.js +1777 -0
- package/chief-view.js +553 -0
- package/chief.js +94 -7492
- package/client.js +11959 -10923
- package/digest.js +8 -8
- package/index.js +154 -6095
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/model-tools.js +755 -0
- package/package.json +48 -17
- package/runtime-hooks.js +629 -0
- package/subagent-runtime.js +1399 -0
package/auto-continue.js
CHANGED
|
@@ -230,6 +230,7 @@ export function createAutoContinueEngine(options = {}) {
|
|
|
230
230
|
getAgent,
|
|
231
231
|
createMessage = null,
|
|
232
232
|
isChiefStopped = () => false,
|
|
233
|
+
canAutoContinue = null,
|
|
233
234
|
resolveRootSessionId = (sid) => sid,
|
|
234
235
|
onLog = () => {},
|
|
235
236
|
baseDelayMs = 1500,
|
|
@@ -309,7 +310,7 @@ export function createAutoContinueEngine(options = {}) {
|
|
|
309
310
|
return Math.round(baseDelayMs * Math.pow(2, exp))
|
|
310
311
|
}
|
|
311
312
|
|
|
312
|
-
async function fire(sessionId, trigger, { detail = '' } = {}) {
|
|
313
|
+
async function fire(sessionId, trigger, { detail = '', bypassGate = false } = {}) {
|
|
313
314
|
const st = getSessionState(sessionId)
|
|
314
315
|
if (!st) return { ok: false, skipped: 'invalid-session' }
|
|
315
316
|
st.timer = null
|
|
@@ -321,6 +322,15 @@ export function createAutoContinueEngine(options = {}) {
|
|
|
321
322
|
return { ok: false, skipped: 'chief-stopped' }
|
|
322
323
|
}
|
|
323
324
|
|
|
325
|
+
if (!bypassGate && typeof canAutoContinue === 'function') {
|
|
326
|
+
const verdict = await Promise.resolve(canAutoContinue({ sessionId, rootId, trigger, detail }))
|
|
327
|
+
if (verdict && verdict.allowed === false) {
|
|
328
|
+
st.stats.skippedStopped += 1
|
|
329
|
+
if (verdict.logMessage) onLog(sessionId, verdict.logMessage)
|
|
330
|
+
return { ok: false, skipped: verdict.skipped || 'permission-mode', approvalId: verdict.approvalId }
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
324
334
|
if (st.consecutive >= maxConsecutive) {
|
|
325
335
|
onLog(sessionId, `已达连续自动续跑上限(${maxConsecutive} 次),等待人工确认或成功回合恢复`)
|
|
326
336
|
return { ok: false, skipped: 'max-consecutive' }
|