@sema-agent/server 6.8.0 → 7.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.
- package/dist/boot/org-memory.d.ts +36 -0
- package/dist/boot/org-memory.js +76 -0
- package/dist/boot/resolve-spec.d.ts +6 -0
- package/dist/boot/resolve-spec.js +41 -11
- package/dist/boot/runner-deps.d.ts +6 -2
- package/dist/boot/runner-deps.js +11 -2
- package/dist/config-center/http-client.d.ts +1 -0
- package/dist/config-center/http-client.js +38 -14
- package/dist/config-types.d.ts +16 -1
- package/dist/config.js +18 -1
- package/dist/fleet/fleet-bus.d.ts +9 -0
- package/dist/fleet/fleet-bus.js +10 -0
- package/dist/http/routes/tasks.js +11 -3
- package/dist/http/server.js +8 -5
- package/dist/main.js +6 -1
- package/dist/memory-scope.d.ts +10 -1
- package/dist/memory-scope.js +22 -2
- package/dist/org-memory-admission.d.ts +96 -0
- package/dist/org-memory-admission.js +224 -0
- package/dist/question.d.ts +5 -0
- package/dist/question.js +7 -0
- package/dist/runs.d.ts +7 -0
- package/dist/runs.js +17 -3
- package/dist/runtime-governance.d.ts +14 -6
- package/dist/runtime-governance.js +27 -6
- package/dist/task-settings.d.ts +10 -8
- package/dist/task-settings.js +7 -19
- package/package.json +4 -4
package/dist/task-settings.js
CHANGED
|
@@ -426,18 +426,16 @@ export function deriveSettingsPolicy(settings, gate, workflowGate) {
|
|
|
426
426
|
return { toolPolicy: compose(createWorkflowPlanDenyPolicy()), handsReadOnly: true, enablePlanMode: true };
|
|
427
427
|
case "acceptEdits": {
|
|
428
428
|
const p = compose(fsWriteGate(true), createWorkflowAskPolicy(workflowGate?.isExempt));
|
|
429
|
-
return
|
|
429
|
+
return p ? { toolPolicy: p } : {};
|
|
430
430
|
}
|
|
431
431
|
case "default":
|
|
432
432
|
case "auto": {
|
|
433
433
|
// (historical note kept: the pre-[816] impl fell through to base-only here — with no gate to attach,
|
|
434
434
|
// acceptEdits-as-loosen could not be honored. The [820] factory inverts the frame: default now ADDS an ask
|
|
435
435
|
// gate and acceptEdits ADDS a narrower one, both tighten-safe under the deny-wins fold.)
|
|
436
|
-
// [1557]
|
|
437
|
-
// gate on the SAME "CC manual" modes — closes the "echo > file bypasses the write gate" hole (cli[1555]②)
|
|
438
|
-
// when the deployment explicitly opts in (config MANUAL_MODE_SHELL_GATE).
|
|
436
|
+
// ([1557]§四 的 shellGate 便车已随 #153 搬 governance 层——见 FsWriteGateWiring 尾注。)
|
|
439
437
|
const p = compose(fsWriteGate(false), createWorkflowAskPolicy(workflowGate?.isExempt));
|
|
440
|
-
return
|
|
438
|
+
return p ? { toolPolicy: p } : {};
|
|
441
439
|
}
|
|
442
440
|
case "bypassPermissions":
|
|
443
441
|
case undefined:
|
|
@@ -454,27 +452,17 @@ export function deriveSettingsPolicy(settings, gate, workflowGate) {
|
|
|
454
452
|
*
|
|
455
453
|
* Returns `base` untouched when the parsed settings project nothing onto the spec.
|
|
456
454
|
*/
|
|
457
|
-
// [1557]
|
|
458
|
-
//
|
|
459
|
-
// handsReadOnly, which ORs). Red-first repro: tightenTaskSpec({shellGate:"always"}, {shellGate:"classify"})
|
|
460
|
-
// throws — so a deployment that layers autonomy=ask (→"always") UNDER this opt-in (→"classify") would 422
|
|
461
|
-
// EVERY request on that mode. Mirrors core's own SHELL_GATE_RANK (tighten-task-spec.js) — only pass the
|
|
462
|
-
// override through when it would not be a downgrade; otherwise the baseline already covers it (tightenTaskSpec's
|
|
463
|
-
// base-only branch keeps `base.shellGate` unchanged either way — omitting is behaviorally identical, never a
|
|
464
|
-
// silent weakening, just avoids the throw).
|
|
465
|
-
const SHELL_GATE_RANK = { off: 0, classify: 1, always: 2 };
|
|
455
|
+
// ([1557]§四 的 SHELL_GATE_RANK 副本与 shellGateSafe 守卫已随 #153 搬 runtime-governance ——
|
|
456
|
+
// settings 折叠不再触碰 TaskSpec.shellGate,base 上 governance 层施加的值原样透传。)
|
|
466
457
|
export function applyTaskSettings(base, settings, gate, workflowGate) {
|
|
467
|
-
const { toolPolicy, handsReadOnly, enablePlanMode
|
|
468
|
-
const shellGateSafe = shellGate !== undefined && SHELL_GATE_RANK[shellGate] >= SHELL_GATE_RANK[base.shellGate ?? "off"] ? shellGate : undefined;
|
|
458
|
+
const { toolPolicy, handsReadOnly, enablePlanMode } = deriveSettingsPolicy(settings, gate, workflowGate);
|
|
469
459
|
let next = base;
|
|
470
|
-
if (toolPolicy !== undefined || handsReadOnly !== undefined
|
|
460
|
+
if (toolPolicy !== undefined || handsReadOnly !== undefined) {
|
|
471
461
|
const overrides = {};
|
|
472
462
|
if (toolPolicy !== undefined)
|
|
473
463
|
overrides.toolPolicy = toolPolicy;
|
|
474
464
|
if (handsReadOnly !== undefined)
|
|
475
465
|
overrides.handsReadOnly = handsReadOnly;
|
|
476
|
-
if (shellGateSafe !== undefined)
|
|
477
|
-
overrides.shellGate = shellGateSafe; // [1557]§四 opt-in; rank-guarded above
|
|
478
466
|
next = tightenTaskSpec(next, overrides); // deny-wins compose + THROWS on loosen (fail-loud)
|
|
479
467
|
}
|
|
480
468
|
// R4: enablePlanMode (mount present_plan) is ADDITIVE — it widens NOTHING (a read-only plan workflow), so it rides
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@sema-agent/core": "^5.
|
|
58
|
-
"@sema-agent/registry-core": "^0.
|
|
57
|
+
"@sema-agent/core": "^5.13.0",
|
|
58
|
+
"@sema-agent/registry-core": "^0.16.0",
|
|
59
59
|
"e2b": "^2.28.0",
|
|
60
60
|
"libsodium-wrappers": "^0.8.4",
|
|
61
61
|
"mysql2": "^3.22.4",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"sharp": "^0.35.3"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@sema-agent/sdk": "^6.
|
|
71
|
+
"@sema-agent/sdk": "^6.6.0",
|
|
72
72
|
"@types/libsodium-wrappers": "^0.7.14",
|
|
73
73
|
"@types/node": "22.10.2",
|
|
74
74
|
"@types/pg": "^8.20.0",
|