dsh-chief 1.6.0 → 1.7.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 +31 -0
- package/README.en.md +277 -123
- package/README.md +283 -129
- package/api-routes.js +193 -2
- package/board-actions.js +1452 -2060
- package/board-handoff.js +709 -0
- package/board-schema.js +35 -2
- package/chief-approvals.js +6 -2
- package/chief-commands.js +1884 -3486
- package/chief-executor.js +6 -1
- package/chief-network.js +1098 -869
- package/chief-review.js +193 -3
- package/chief-state.js +1996 -3078
- package/chief-view.js +7 -4
- package/client.js +12237 -8021
- package/command-helpers.js +568 -0
- package/command-ops.js +1226 -0
- package/digest.js +25 -3
- package/index.js +6 -0
- package/locale/en.json +4 -4
- package/locale/zh.json +4 -4
- package/model-tools.js +40 -2
- package/network-harness.js +1047 -0
- package/package.json +8 -2
- package/runtime-hooks.js +69 -2
- package/safety/guard-walls.js +5 -0
- package/safety/invariant-guards.js +125 -6
- package/safety/tool-gate.js +2 -0
- package/state-media.js +173 -0
- package/state-schema.js +1505 -0
- package/subagent-runtime.js +57 -3
package/chief-executor.js
CHANGED
|
@@ -521,6 +521,7 @@ export async function executeChiefToolCall(deps, call, execCtx = {}) {
|
|
|
521
521
|
const rootId = String(execCtx.rootId || '')
|
|
522
522
|
const board = execCtx.board || {}
|
|
523
523
|
const readOnlyToolsOnly = Boolean(execCtx.readOnlyToolsOnly)
|
|
524
|
+
const safetyGuardEnabled = execCtx.safetyGuardEnabled !== false
|
|
524
525
|
const approvedOnce = Boolean(execCtx.approvedOnce)
|
|
525
526
|
const capabilityScope = execCtx.capabilityScope || null
|
|
526
527
|
|
|
@@ -563,7 +564,7 @@ export async function executeChiefToolCall(deps, call, execCtx = {}) {
|
|
|
563
564
|
const resolvedAbsTarget = rawTargetPath ? path.resolve(cwd, rawTargetPath) : ''
|
|
564
565
|
const rawCommand = tool === 'run_command' ? String(args.command || args.cmd || '').trim() : ''
|
|
565
566
|
|
|
566
|
-
// Stage 3:
|
|
567
|
+
// Stage 3: 安全卫兵硬性规则(优先于任何权限等级、策略插件与逐项批准;受人类可控 safetyGuardEnabled 开关控制)
|
|
567
568
|
const guardRes = evaluateSafetyGuardHardRules({
|
|
568
569
|
tool,
|
|
569
570
|
opClass,
|
|
@@ -572,6 +573,7 @@ export async function executeChiefToolCall(deps, call, execCtx = {}) {
|
|
|
572
573
|
args,
|
|
573
574
|
cwd,
|
|
574
575
|
board,
|
|
576
|
+
safetyGuardEnabled,
|
|
575
577
|
})
|
|
576
578
|
if (guardRes.blocked) {
|
|
577
579
|
writeAudit({
|
|
@@ -1093,6 +1095,7 @@ export async function runChiefAgenticLoop(deps, {
|
|
|
1093
1095
|
board = null,
|
|
1094
1096
|
maxSteps = 4,
|
|
1095
1097
|
readOnlyToolsOnly = false,
|
|
1098
|
+
safetyGuardEnabled = true,
|
|
1096
1099
|
disableTools = false,
|
|
1097
1100
|
lazyDeferWorkspaceWritesToLead = false,
|
|
1098
1101
|
callLlmFn,
|
|
@@ -1182,6 +1185,7 @@ export async function runChiefAgenticLoop(deps, {
|
|
|
1182
1185
|
args: (c && c.args && typeof c.args === 'object') ? c.args : {},
|
|
1183
1186
|
cwd,
|
|
1184
1187
|
board,
|
|
1188
|
+
safetyGuardEnabled,
|
|
1185
1189
|
})
|
|
1186
1190
|
if (!preDef || preDef.decision !== 'deny') {
|
|
1187
1191
|
if (typeof recordAuditFn === 'function') {
|
|
@@ -1222,6 +1226,7 @@ export async function runChiefAgenticLoop(deps, {
|
|
|
1222
1226
|
policyPlugins,
|
|
1223
1227
|
board,
|
|
1224
1228
|
readOnlyToolsOnly,
|
|
1229
|
+
safetyGuardEnabled,
|
|
1225
1230
|
upsertArchiveFn,
|
|
1226
1231
|
compactNowFn,
|
|
1227
1232
|
queueApprovalFn,
|