@sema-agent/server 7.146.0 → 7.148.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/MIGRATION.md +1423 -24
- package/README.md +21 -8
- package/README.zh-CN.md +15 -9
- package/USAGE.md +537 -216
- package/deploy/facts/lanes.json +7 -0
- package/deploy/sema-up/README.md +18 -7
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +42 -4
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -4
- package/deploy/sema-up/chart/templates/server.yaml +5 -4
- package/deploy/sema-up/chart/values.yaml +4 -3
- package/deploy/sema-up/cluster-up.sh +75 -176
- package/deploy/sema-up/kube-up.sh +29 -49
- package/deploy/sema-up/lib/chart-run.sh +23 -0
- package/deploy/sema-up/lib/dataroot.sh +3 -3
- package/deploy/sema-up/lib/flagshape.sh +4 -0
- package/deploy/sema-up/lib/health.sh +62 -13
- package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
- package/deploy/sema-up/lib/helm-values-kube.py +35 -0
- package/deploy/sema-up/lib/lanes.json +2 -5
- package/deploy/sema-up/lib/regcred.py +8 -0
- package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
- package/deploy/sema-up/lib/remote/image-import.sh +6 -0
- package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
- package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
- package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
- package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
- package/deploy/sema-up/lib/render-stack.py +17 -0
- package/deploy/sema-up/lib/shell-text.sh +87 -0
- package/deploy/sema-up/lib/usage-flags.txt +10 -0
- package/deploy/sema-up/lib/usage-head.txt +1 -0
- package/deploy/sema-up/lib/usage-tail.txt +13 -0
- package/deploy/sema-up/preflight.sh +10 -8
- package/deploy/sema-up/sema-up.sh +26 -48
- package/deploy/sema-up/smoke.sh +7 -6
- package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
- package/deploy/sema-up/stack/compose.yaml +18 -5
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +25 -3
- package/dist/adoption/plan.d.ts +24 -0
- package/dist/adoption/plan.js +53 -1
- package/dist/adoption/runner.d.ts +10 -1
- package/dist/adoption/runner.js +36 -16
- package/dist/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +32 -34
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +16 -14
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +17 -9
- package/dist/auth-bridge.d.ts +0 -14
- package/dist/auth-bridge.js +0 -7
- package/dist/auto-mode-face.d.ts +10 -7
- package/dist/auto-mode-face.js +7 -4
- package/dist/background-agent-name.d.ts +19 -1
- package/dist/background-agent-name.js +12 -2
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.js +9 -6
- package/dist/bench/s1/arms.js +6 -5
- package/dist/bench/s1/live-deps.js +8 -3
- package/dist/bench/s1/run-firm.js +6 -5
- package/dist/bind-host.d.ts +25 -0
- package/dist/bind-host.js +25 -0
- package/dist/boot/adoption.d.ts +3 -0
- package/dist/boot/adoption.js +1 -0
- package/dist/boot/crash-last.js +2 -1
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/device-lane.js +5 -5
- package/dist/boot/engine-lease.d.ts +12 -11
- package/dist/boot/execution-env.d.ts +19 -8
- package/dist/boot/execution-env.js +80 -62
- package/dist/boot/execution-lane.d.ts +37 -9
- package/dist/boot/execution-lane.js +74 -20
- package/dist/boot/exit-boundary.d.ts +3 -3
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/exit-last.js +2 -1
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/governance-seams.d.ts +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +18 -16
- package/dist/boot/memory-boundary.d.ts +11 -11
- package/dist/boot/memory-boundary.js +3 -3
- package/dist/boot/memory-consolidation.d.ts +50 -53
- package/dist/boot/memory-consolidation.js +11 -18
- package/dist/boot/org-memory.js +4 -3
- package/dist/boot/parked-revive-gate.d.ts +1 -1
- package/dist/boot/parked-revive-gate.js +3 -3
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +20 -17
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +133 -165
- package/dist/boot/retention-lane.d.ts +7 -45
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +11 -4
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +17 -7
- package/dist/boot/session-faces.js +122 -96
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -1
- package/dist/boot/stage-01-config.js +14 -2
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -1
- package/dist/boot/stage-02-web-admin-pull.js +15 -8
- package/dist/boot/stage-03-store-backend.d.ts +4 -1
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -1
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +9 -5
- package/dist/boot/stage-05-execution-env.js +5 -5
- package/dist/boot/stage-06-runners.d.ts +13 -15
- package/dist/boot/stage-06-runners.js +24 -18
- package/dist/boot/stage-07-capability-layer.d.ts +14 -11
- package/dist/boot/stage-07-capability-layer.js +9 -12
- package/dist/boot/stage-08-reapers.d.ts +14 -11
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +16 -18
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +16 -18
- package/dist/boot/stage-10-http-server.js +9 -5
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +12 -0
- package/dist/boot/stores.js +39 -17
- package/dist/boot/task-list-lane.d.ts +4 -4
- package/dist/boot/web-admin.d.ts +4 -2
- package/dist/boot/web-admin.js +58 -38
- package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
- package/dist/boot-reclaim.d.ts +3 -1
- package/dist/boot-reclaim.js +1 -1
- package/dist/brain.d.ts +7 -18
- package/dist/brain.js +5 -17
- package/dist/budget.js +6 -6
- package/dist/capabilities/center-plugins.d.ts +9 -1
- package/dist/capabilities/center-plugins.js +37 -11
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +3 -2
- package/dist/capabilities/composite-members.js +3 -2
- package/dist/capabilities/execution-lane.d.ts +7 -7
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +1 -1
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +38 -33
- package/dist/capabilities/scenarios.js +24 -25
- package/dist/capabilities/settings-contract.d.ts +29 -0
- package/dist/capabilities/settings-contract.js +14 -0
- package/dist/capabilities/skills.d.ts +6 -6
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +69 -4
- package/dist/capability-facts.js +77 -5
- package/dist/card-void.d.ts +4 -4
- package/dist/card-void.js +1 -1
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +10 -5
- package/dist/config-catalog.d.ts +16 -1
- package/dist/config-catalog.js +68 -61
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +58 -4
- package/dist/config-invariants.js +104 -23
- package/dist/config-lkg.d.ts +24 -2
- package/dist/config-lkg.js +22 -9
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -108
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +215 -202
- package/dist/config.d.ts +69 -14
- package/dist/config.js +188 -96
- package/dist/degenerate-instrument.js +1 -1
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deploy-facts.js +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +51 -16
- package/dist/deployment-shape.js +31 -6
- package/dist/egress-redirect.d.ts +25 -7
- package/dist/egress-redirect.js +20 -2
- package/dist/elicitation.d.ts +6 -5
- package/dist/elicitation.js +23 -22
- package/dist/engine-identity.d.ts +28 -0
- package/dist/engine-identity.js +10 -0
- package/dist/entry-problems.d.ts +5 -7
- package/dist/entry-problems.js +1 -1
- package/dist/env-facts.d.ts +7 -5
- package/dist/env-facts.js +12 -7
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-config-root.d.ts +5 -5
- package/dist/execution-config-root.js +5 -5
- package/dist/execution-env-purpose.d.ts +14 -0
- package/dist/execution-env-purpose.js +29 -0
- package/dist/execution-lane-caps.d.ts +53 -103
- package/dist/execution-lane-caps.js +51 -83
- package/dist/execution-placement.d.ts +65 -9
- package/dist/execution-placement.js +58 -0
- package/dist/field-conflict.d.ts +7 -11
- package/dist/field-conflict.js +3 -3
- package/dist/file-history-capture.d.ts +3 -3
- package/dist/file-history-disclosure.d.ts +2 -2
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/drain-entry.d.ts +17 -10
- package/dist/fleet/drain-entry.js +1 -1
- package/dist/fleet/fleet-bus.d.ts +21 -3
- package/dist/fleet/fleet-bus.js +35 -25
- package/dist/fleet/fleet-reconciler.js +2 -2
- package/dist/fleet/serving-lease.js +6 -7
- package/dist/fleet-client.js +3 -3
- package/dist/fleet-lease.d.ts +0 -1
- package/dist/fleet-lease.js +4 -5
- package/dist/history-anchor.d.ts +42 -0
- package/dist/history-anchor.js +34 -0
- package/dist/hitl-delivery.d.ts +90 -0
- package/dist/hitl-delivery.js +98 -0
- package/dist/hooks/classic-stations.d.ts +8 -11
- package/dist/hooks/classic-stations.js +0 -7
- package/dist/hooks/command-spawn.d.ts +1 -4
- package/dist/hooks/command-spawn.js +0 -11
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +119 -65
- package/dist/hooks/hook-runner.js +415 -217
- package/dist/host-lsp-manager.d.ts +22 -8
- package/dist/host-lsp-manager.js +4 -1
- package/dist/http/active-run-conflict.d.ts +2 -43
- package/dist/http/active-run-conflict.js +3 -7
- package/dist/http/admission.d.ts +4 -18
- package/dist/http/admission.js +75 -78
- package/dist/http/approval-sweeps.d.ts +5 -8
- package/dist/http/approval-sweeps.js +55 -30
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/checkpoint-ctx.d.ts +17 -0
- package/dist/http/checkpoint-ctx.js +6 -0
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claim-latency.d.ts +10 -0
- package/dist/http/claim-latency.js +12 -0
- package/dist/http/claimed-run.d.ts +4 -3
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +77 -31
- package/dist/http/durable-run-leg.d.ts +3 -3
- package/dist/http/durable-run-leg.js +18 -12
- package/dist/http/execution-context.d.ts +18 -42
- package/dist/http/execution-context.js +11 -5
- package/dist/http/health-reader.d.ts +36 -0
- package/dist/http/health-reader.js +21 -0
- package/dist/http/health-self-report.d.ts +9 -9
- package/dist/http/health-self-report.js +4 -4
- package/dist/http/idempotency.d.ts +9 -5
- package/dist/http/idempotency.js +4 -4
- package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
- package/dist/http/memory-compliance-failure-reply.js +7 -2
- package/dist/http/memory-face-fault-reply.d.ts +67 -0
- package/dist/http/memory-face-fault-reply.js +71 -0
- package/dist/http/memory-store-refusal-reply.d.ts +3 -3
- package/dist/http/memory-store-refusal-reply.js +6 -0
- package/dist/http/owner-access.d.ts +391 -56
- package/dist/http/owner-access.js +372 -33
- package/dist/http/principal-gate.d.ts +26 -94
- package/dist/http/principal-gate.js +24 -81
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +10 -14
- package/dist/http/request-guards.js +34 -68
- package/dist/http/resume-composition.d.ts +37 -0
- package/dist/http/resume-composition.js +18 -0
- package/dist/http/resume-ctx-read.d.ts +35 -12
- package/dist/http/resume-ctx-read.js +25 -6
- package/dist/http/resume-legs.d.ts +24 -24
- package/dist/http/resume-legs.js +260 -171
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/rewind-files-reply.d.ts +34 -0
- package/dist/http/rewind-files-reply.js +36 -0
- package/dist/http/route-ctx.d.ts +56 -47
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +58 -37
- package/dist/http/routes/admin-config-refresh.js +2 -2
- package/dist/http/routes/admin-drain.js +2 -2
- package/dist/http/routes/admin-memory-optout.js +4 -3
- package/dist/http/routes/adoption.d.ts +3 -0
- package/dist/http/routes/adoption.js +17 -10
- package/dist/http/routes/agents-roster.js +13 -7
- package/dist/http/routes/approvals-assistant.js +73 -88
- package/dist/http/routes/attachments.js +2 -2
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +9 -17
- package/dist/http/routes/capabilities.js +23 -20
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +5 -5
- package/dist/http/routes/diagnostics.d.ts +27 -3
- package/dist/http/routes/diagnostics.js +27 -21
- package/dist/http/routes/engine.js +2 -2
- package/dist/http/routes/fleet.js +5 -3
- package/dist/http/routes/images.js +10 -6
- package/dist/http/routes/leader.d.ts +7 -2
- package/dist/http/routes/leader.js +12 -3
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +7 -15
- package/dist/http/routes/memory-bundle.js +4 -7
- package/dist/http/routes/memory-compliance.js +4 -4
- package/dist/http/routes/memory-consolidation.js +6 -9
- package/dist/http/routes/memory-origin.d.ts +3 -1
- package/dist/http/routes/memory-origin.js +7 -8
- package/dist/http/routes/memory-policy.js +17 -12
- package/dist/http/routes/notify-wake.js +12 -20
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +1 -1
- package/dist/http/routes/principal-inbox.js +2 -2
- package/dist/http/routes/projects.d.ts +70 -0
- package/dist/http/routes/projects.js +87 -0
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +50 -7
- package/dist/http/routes/run-memory-capture.d.ts +2 -2
- package/dist/http/routes/run-memory-capture.js +6 -12
- package/dist/http/routes/run-permission-mode.d.ts +2 -2
- package/dist/http/routes/run-permission-mode.js +10 -17
- package/dist/http/routes/runs.js +148 -233
- package/dist/http/routes/session-memory-sync.d.ts +2 -2
- package/dist/http/routes/session-memory-sync.js +7 -13
- package/dist/http/routes/session-sync.d.ts +4 -2
- package/dist/http/routes/session-sync.js +48 -30
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.d.ts +7 -1
- package/dist/http/routes/sessions.js +177 -112
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +144 -122
- package/dist/http/routes/trace-usage.d.ts +0 -12
- package/dist/http/routes/trace-usage.js +40 -46
- package/dist/http/routes/workflows.d.ts +39 -4
- package/dist/http/routes/workflows.js +42 -14
- package/dist/http/run-concurrency-cap.d.ts +20 -12
- package/dist/http/run-concurrency-cap.js +39 -26
- package/dist/http/run-read-face.d.ts +3 -5
- package/dist/http/run-read-face.js +8 -13
- package/dist/http/send.d.ts +12 -3
- package/dist/http/send.js +42 -6
- package/dist/http/server.d.ts +63 -50
- package/dist/http/server.js +52 -16
- package/dist/http/sse-log.d.ts +17 -10
- package/dist/http/sse-log.js +7 -7
- package/dist/http/stored-body-replay.d.ts +17 -3
- package/dist/http/stored-body-replay.js +11 -2
- package/dist/http/submit-ctx.d.ts +16 -8
- package/dist/http/submit-ctx.js +6 -2
- package/dist/http/submit-replay.d.ts +19 -6
- package/dist/http/submit-replay.js +18 -6
- package/dist/http/sync-submit-body.d.ts +3 -4
- package/dist/http/sync-submit-body.js +4 -5
- package/dist/http/wire-types.d.ts +23 -13
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/instruction-source-notice.d.ts +1 -1
- package/dist/key-resolver.d.ts +32 -0
- package/dist/key-resolver.js +23 -9
- package/dist/leader/diffup.js +2 -1
- package/dist/leader/endpoint.d.ts +26 -5
- package/dist/leader/endpoint.js +154 -14
- package/dist/leader/fanout.d.ts +3 -0
- package/dist/leader/fanout.js +78 -63
- package/dist/leader/leader.d.ts +16 -0
- package/dist/leader/leader.js +43 -3
- package/dist/leader/merge.d.ts +9 -1
- package/dist/leader/merge.js +16 -1
- package/dist/leader/repair-wire.js +1 -1
- package/dist/leader/wire.d.ts +36 -3
- package/dist/leader/wire.js +59 -18
- package/dist/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/memory-embedder-reembed.d.ts +38 -0
- package/dist/memory-embedder-reembed.js +20 -0
- package/dist/memory-incident-sink.d.ts +0 -28
- package/dist/memory-incident-sink.js +5 -0
- package/dist/memory-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-scope.d.ts +31 -4
- package/dist/memory-scope.js +65 -16
- package/dist/memory-store-refusal.d.ts +20 -4
- package/dist/memory-store-refusal.js +1 -1
- package/dist/memory-sync-client.d.ts +5 -2
- package/dist/memory-sync-client.js +19 -14
- package/dist/memory-sync.js +1 -1
- package/dist/model-compat.d.ts +51 -28
- package/dist/model-compat.js +55 -23
- package/dist/model-context-window.d.ts +18 -0
- package/dist/model-context-window.js +2 -0
- package/dist/model-entry-headers.d.ts +46 -4
- package/dist/model-entry-headers.js +2 -2
- package/dist/model-entry-refusal.d.ts +46 -17
- package/dist/model-entry-refusal.js +47 -27
- package/dist/model-plane-face.d.ts +19 -11
- package/dist/model-plane-face.js +9 -1
- package/dist/model-plane-probe.d.ts +2 -0
- package/dist/model-plane-probe.js +17 -0
- package/dist/model-provider.d.ts +3 -3
- package/dist/model-route-endpoint.d.ts +9 -5
- package/dist/model-route-endpoint.js +29 -7
- package/dist/model-select.d.ts +16 -0
- package/dist/model-select.js +4 -0
- package/dist/mountinfo.d.ts +37 -0
- package/dist/mountinfo.js +47 -0
- package/dist/namespaced-rule-name.d.ts +28 -2
- package/dist/namespaced-rule-name.js +10 -1
- package/dist/net-address.d.ts +1 -1
- package/dist/observability/corrupt-read-seat.d.ts +4 -4
- package/dist/observability/corrupt-read-seat.js +5 -3
- package/dist/observability/fail-open.d.ts +75 -47
- package/dist/observability/fail-open.js +77 -47
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +5 -4
- package/dist/observability/otel-exporter.js +2 -1
- package/dist/observability/principal-context.d.ts +14 -7
- package/dist/observability/principal-context.js +8 -3
- package/dist/observability/run-terminal.d.ts +7 -1
- package/dist/observability/run-terminal.js +5 -2
- package/dist/observability/secret-env-scrub.d.ts +30 -4
- package/dist/observability/secret-env-scrub.js +15 -3
- package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
- package/dist/orchestration/hardened-vm-runner.js +11 -5
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
- package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
- package/dist/orchestration/hardened-vm-worker.js +2 -1
- package/dist/orchestration/workflow-agent-session-index.d.ts +7 -12
- package/dist/orchestration/workflow-agent-session-index.js +1 -6
- package/dist/orchestration/workflow-completion-inbox.d.ts +29 -9
- package/dist/orchestration/workflow-completion-inbox.js +65 -46
- package/dist/org-delivery-gate.d.ts +5 -4
- package/dist/org-delivery-gate.js +7 -6
- package/dist/org-memory-admission.d.ts +5 -2
- package/dist/org-memory-admission.js +25 -10
- package/dist/outbound-dispatcher.d.ts +1 -1
- package/dist/outbound-dispatcher.js +6 -12
- package/dist/owner-brands.d.ts +81 -0
- package/dist/owner-brands.js +42 -0
- package/dist/owner-faces.d.ts +531 -0
- package/dist/owner-faces.js +126 -0
- package/dist/parked-decide.d.ts +100 -31
- package/dist/parked-decide.js +162 -48
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +6 -8
- package/dist/peer-directory.js +3 -2
- package/dist/permission-rule-vocab.d.ts +53 -8
- package/dist/permission-rule-vocab.js +30 -2
- package/dist/plugins/adoption-log-sql.d.ts +0 -22
- package/dist/plugins/adoption-log-sql.js +5 -3
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
- package/dist/plugins/approval-ask-store-file.d.ts +28 -9
- package/dist/plugins/approval-ask-store-file.js +74 -18
- package/dist/plugins/approval-ask-store-memory.d.ts +17 -7
- package/dist/plugins/approval-ask-store-memory.js +35 -12
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -20
- package/dist/plugins/approval-ask-store-sql.js +44 -11
- package/dist/plugins/approval-exemption-skill-m46.d.ts +20 -0
- package/dist/plugins/approval-exemption-skill-m46.js +25 -0
- package/dist/plugins/approval-exemption-store.d.ts +6 -1
- package/dist/plugins/approval-exemption-store.js +14 -0
- package/dist/plugins/approval-nonce-store.d.ts +39 -12
- package/dist/plugins/approval-nonce-store.js +72 -23
- package/dist/plugins/blob-backend.d.ts +40 -195
- package/dist/plugins/blob-backend.js +41 -234
- package/dist/plugins/caching-session-store.d.ts +22 -5
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +33 -6
- package/dist/plugins/checkpoint-index-columns.js +39 -3
- package/dist/plugins/checkpoint-store-face.d.ts +84 -11
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.d.ts +2 -2
- package/dist/plugins/device-store-sql.js +6 -10
- package/dist/plugins/ensure-index.d.ts +13 -1
- package/dist/plugins/ensure-index.js +154 -21
- package/dist/plugins/ensure-schema-lock-policy.d.ts +0 -15
- package/dist/plugins/ensure-schema-lock-policy.js +3 -2
- package/dist/plugins/execution-lane-rename-m40.d.ts +20 -0
- package/dist/plugins/execution-lane-rename-m40.js +10 -0
- package/dist/plugins/execution-placement-sql.d.ts +63 -88
- package/dist/plugins/execution-placement-sql.js +94 -54
- package/dist/plugins/file-run-store.d.ts +89 -35
- package/dist/plugins/file-run-store.js +197 -142
- package/dist/plugins/host-platform.d.ts +24 -3
- package/dist/plugins/host-platform.js +15 -1
- package/dist/plugins/image-bake-store-sql.js +2 -0
- package/dist/plugins/imported-layer-root-retirement.d.ts +19 -10
- package/dist/plugins/imported-layer-root-retirement.js +4 -8
- package/dist/plugins/inbox-payload-column.d.ts +14 -0
- package/dist/plugins/inbox-payload-column.js +13 -0
- package/dist/plugins/k8s-pod-reaper.d.ts +1 -3
- package/dist/plugins/k8s-pod-reaper.js +0 -1
- package/dist/plugins/leader-run-store-sql.d.ts +22 -0
- package/dist/plugins/leader-run-store-sql.js +34 -4
- package/dist/plugins/local-checkpoint-store.d.ts +63 -23
- package/dist/plugins/local-checkpoint-store.js +204 -81
- package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
- package/dist/plugins/local-data-dir-modes-m39.js +183 -0
- package/dist/plugins/local-docker-capacity.d.ts +93 -0
- package/dist/plugins/local-docker-capacity.js +194 -0
- package/dist/plugins/local-docker-reaper.d.ts +92 -0
- package/dist/plugins/local-docker-reaper.js +102 -0
- package/dist/plugins/local-engine-high-water.d.ts +13 -0
- package/dist/plugins/local-engine-high-water.js +62 -0
- package/dist/plugins/local-session-store.d.ts +442 -143
- package/dist/plugins/local-session-store.js +941 -289
- package/dist/plugins/local-session-window.d.ts +3 -2
- package/dist/plugins/local-session-window.js +3 -2
- package/dist/plugins/local-sidecar-quarantine.js +3 -2
- package/dist/plugins/local-task-attachment-store.d.ts +20 -1
- package/dist/plugins/local-task-attachment-store.js +32 -12
- package/dist/plugins/memory-embedder-fingerprint.d.ts +33 -10
- package/dist/plugins/memory-embedder-fingerprint.js +52 -12
- package/dist/plugins/memory-embedder.d.ts +1 -1
- package/dist/plugins/memory-embedder.js +11 -9
- package/dist/plugins/memory-engine-pg.d.ts +7 -5
- package/dist/plugins/memory-engine-pg.js +18 -9
- package/dist/plugins/memory-engine-sql-apply.d.ts +21 -8
- package/dist/plugins/memory-engine-sql-apply.js +7 -9
- package/dist/plugins/memory-engine-tidb.d.ts +12 -7
- package/dist/plugins/memory-engine-tidb.js +18 -10
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
- package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
- package/dist/plugins/memory-run-store.d.ts +39 -27
- package/dist/plugins/memory-run-store.js +72 -70
- package/dist/plugins/one-time-migration-marker.d.ts +10 -0
- package/dist/plugins/one-time-migration-marker.js +7 -0
- package/dist/plugins/one-time-migrations.d.ts +325 -74
- package/dist/plugins/one-time-migrations.js +705 -230
- package/dist/plugins/org-delivery-quota-store.js +2 -1
- package/dist/plugins/owner-only-file-mode.d.ts +29 -0
- package/dist/plugins/owner-only-file-mode.js +141 -0
- package/dist/plugins/permission-rule-store-file.d.ts +11 -11
- package/dist/plugins/permission-rule-store-file.js +14 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -63
- package/dist/plugins/permission-rule-store-sql.js +6 -86
- package/dist/plugins/pg-pool.d.ts +3 -32
- package/dist/plugins/pg-pool.js +27 -11
- package/dist/plugins/release-version.d.ts +20 -0
- package/dist/plugins/release-version.js +28 -0
- package/dist/plugins/remote-env-adb.d.ts +20 -4
- package/dist/plugins/remote-env-adb.js +39 -11
- package/dist/plugins/remote-env-e2b.d.ts +19 -28
- package/dist/plugins/remote-env-e2b.js +40 -29
- package/dist/plugins/remote-env-host.d.ts +11 -10
- package/dist/plugins/remote-env-host.js +40 -27
- package/dist/plugins/remote-env-k8s.d.ts +45 -47
- package/dist/plugins/remote-env-k8s.js +122 -62
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +370 -75
- package/dist/plugins/remote-env-ssh.d.ts +8 -2
- package/dist/plugins/remote-env-ssh.js +26 -24
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/remote-shell.d.ts +59 -30
- package/dist/plugins/remote-shell.js +175 -62
- package/dist/plugins/retention-declaration.d.ts +37 -0
- package/dist/plugins/retention-declaration.js +9 -0
- package/dist/plugins/retention-deployment.d.ts +158 -0
- package/dist/plugins/retention-deployment.js +119 -0
- package/dist/plugins/retention-lane-store-sql.d.ts +74 -4
- package/dist/plugins/retention-lane-store-sql.js +103 -1
- package/dist/plugins/retention-sql.d.ts +29 -0
- package/dist/plugins/retention-sql.js +8 -0
- package/dist/plugins/run-preview-m45.d.ts +11 -0
- package/dist/plugins/run-preview-m45.js +19 -0
- package/dist/plugins/run-store-sql.d.ts +56 -68
- package/dist/plugins/run-store-sql.js +127 -116
- package/dist/plugins/s3-answer.d.ts +2 -1
- package/dist/plugins/sandbox-reaper.d.ts +26 -0
- package/dist/plugins/sandbox-reaper.js +2 -0
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +54 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +55 -0
- package/dist/plugins/scheduler-support.d.ts +16 -1
- package/dist/plugins/scheduler-support.js +22 -2
- package/dist/plugins/schema-consistency.d.ts +42 -15
- package/dist/plugins/schema-consistency.js +213 -13
- package/dist/plugins/schema-drift-sentence.d.ts +4 -1
- package/dist/plugins/schema-drift-sentence.js +4 -4
- package/dist/plugins/schema-ensure-legs.d.ts +10 -1
- package/dist/plugins/schema-ensure-legs.js +12 -2
- package/dist/plugins/schema-indexes.js +3 -0
- package/dist/plugins/schema-live-columns.d.ts +14 -5
- package/dist/plugins/schema-live-columns.js +10 -10
- package/dist/plugins/send-user-file.js +2 -1
- package/dist/plugins/session-birth.d.ts +37 -0
- package/dist/plugins/session-birth.js +38 -0
- package/dist/plugins/session-epoch-anchor.d.ts +40 -12
- package/dist/plugins/session-epoch-anchor.js +33 -11
- package/dist/plugins/session-ext-table.d.ts +98 -0
- package/dist/plugins/session-ext-table.js +134 -0
- package/dist/plugins/session-fork.d.ts +16 -2
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +22 -16
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +20 -7
- package/dist/plugins/session-row-sql.js +16 -8
- package/dist/plugins/session-run-rollup.d.ts +29 -0
- package/dist/plugins/session-run-rollup.js +40 -0
- package/dist/plugins/session-store-sql.d.ts +157 -0
- package/dist/plugins/session-store-sql.js +398 -0
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/session-workspace-cell.d.ts +2 -2
- package/dist/plugins/session-workspace-cell.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +10 -69
- package/dist/plugins/shared-memory-store-sql.js +15 -14
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +20 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +3 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/snapshot-bucket-presence.js +1 -1
- package/dist/plugins/sql-driver.d.ts +24 -8
- package/dist/plugins/sql-driver.js +43 -9
- package/dist/plugins/sql-errors.d.ts +35 -5
- package/dist/plugins/sql-errors.js +55 -3
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/store-backend.d.ts +114 -18
- package/dist/plugins/store-backend.js +340 -87
- package/dist/plugins/store-contracts.d.ts +97 -30
- package/dist/plugins/store-contracts.js +23 -1
- package/dist/plugins/store-fault.d.ts +28 -2
- package/dist/plugins/store-fault.js +20 -2
- package/dist/plugins/task-attachment-store.d.ts +21 -11
- package/dist/plugins/task-attachment-store.js +37 -19
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/text-column-capacity.d.ts +21 -0
- package/dist/plugins/text-column-capacity.js +5 -0
- package/dist/plugins/tidb-pool.d.ts +3 -2
- package/dist/plugins/tidb-pool.js +42 -39
- package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
- package/dist/plugins/web-search.js +5 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
- package/dist/plugins/workflow-run-store-sql.js +11 -5
- package/dist/principal-jwt.d.ts +4 -4
- package/dist/principal-jwt.js +20 -5
- package/dist/principal-shape.d.ts +41 -0
- package/dist/principal-shape.js +19 -0
- package/dist/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-face-posture.d.ts +6 -6
- package/dist/read-face-posture.js +2 -2
- package/dist/request-declaration-refusal.d.ts +35 -12
- package/dist/request-declaration-refusal.js +21 -9
- package/dist/request-form.d.ts +58 -0
- package/dist/request-form.js +72 -0
- package/dist/request-image-urls.d.ts +8 -2
- package/dist/request-image-urls.js +2 -1
- package/dist/request-images.d.ts +20 -0
- package/dist/request-images.js +59 -0
- package/dist/request-key-closure.d.ts +6 -7
- package/dist/request-key-closure.js +15 -2
- package/dist/request-value-closure.d.ts +5 -5
- package/dist/request-value-closure.js +1 -1
- package/dist/resource-suspend.d.ts +7 -16
- package/dist/resource-suspend.js +1 -1
- package/dist/retired-name-host-notice.d.ts +21 -0
- package/dist/retired-name-host-notice.js +12 -0
- package/dist/rule-entry-list.d.ts +2 -2
- package/dist/rule-entry-list.js +3 -4
- package/dist/rule-issue-reading.d.ts +58 -0
- package/dist/rule-issue-reading.js +14 -0
- package/dist/rules-consent.d.ts +46 -16
- package/dist/rules-consent.js +102 -53
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +109 -93
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +73 -44
- package/dist/runs.js +65 -43
- package/dist/runtime-caps-resolver.d.ts +36 -14
- package/dist/runtime-caps-resolver.js +31 -14
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -6
- package/dist/sealed-key-layout.js +5 -1
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +116 -26
- package/dist/security.d.ts +133 -161
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +27 -2
- package/dist/server-secret-env.d.ts +23 -5
- package/dist/server-secret-env.js +14 -4
- package/dist/service-version.d.ts +2 -1
- package/dist/service-version.js +2 -2
- package/dist/session-children-retire.d.ts +7 -5
- package/dist/session-children-retire.js +7 -2
- package/dist/session-deletion.d.ts +88 -0
- package/dist/session-deletion.js +8 -0
- package/dist/session-erase.d.ts +145 -0
- package/dist/session-erase.js +115 -0
- package/dist/session-error-wire.d.ts +6 -6
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +60 -10
- package/dist/session-incarnation.js +19 -2
- package/dist/session-policy-wire.d.ts +6 -3
- package/dist/session-policy-wire.js +11 -1
- package/dist/session-resident-background.d.ts +29 -47
- package/dist/session-resident-background.js +77 -8
- package/dist/session-row.d.ts +3 -2
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-sync-kernel.d.ts +1 -1
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +11 -2
- package/dist/session-workspace.js +5 -0
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-posture.d.ts +138 -21
- package/dist/store-posture.js +188 -3
- package/dist/stored-request-hooks-m20.d.ts +3 -2
- package/dist/stored-request-hooks-m20.js +21 -16
- package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
- package/dist/stores-sql/background-agent-store-sql.js +73 -20
- package/dist/stores-sql/blob-index-sql.d.ts +148 -0
- package/dist/stores-sql/blob-index-sql.js +154 -0
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +86 -71
- package/dist/{plugins → stores-sql}/file-history-store-sql.d.ts +23 -11
- package/dist/{plugins → stores-sql}/file-history-store-sql.js +23 -18
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +30 -81
- package/dist/{plugins → stores-sql}/pg-session-storage.js +123 -244
- package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +197 -223
- package/dist/{plugins → stores-sql}/retention-store-sql.js +148 -207
- package/dist/{plugins → stores-sql}/session-event-payload.d.ts +1 -1
- package/dist/{plugins → stores-sql}/session-event-payload.js +1 -1
- package/dist/stores-sql/session-policy-store-sql.d.ts +33 -11
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +65 -0
- package/dist/stores-sql/session-write-hooks.js +2 -0
- package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +14 -15
- package/dist/{plugins → stores-sql}/tidb-session-storage.js +22 -28
- package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +67 -138
- package/dist/{plugins → stores-sql}/tidb-session-store.js +130 -200
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +1 -1
- package/dist/stores-sql/windowed-session-storage.d.ts +61 -0
- package/dist/stores-sql/windowed-session-storage.js +70 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +7 -1
- package/dist/task-a2a.js +18 -17
- package/dist/task-cwd.d.ts +31 -3
- package/dist/task-cwd.js +25 -1
- package/dist/task-mcp.d.ts +11 -3
- package/dist/task-mcp.js +16 -19
- package/dist/task-settings.d.ts +23 -14
- package/dist/task-settings.js +35 -13
- package/dist/terminal.d.ts +25 -43
- package/dist/terminal.js +31 -11
- package/dist/tool-approval.d.ts +152 -137
- package/dist/tool-approval.js +199 -199
- package/dist/trace/core-keyset-guard.d.ts +22 -9
- package/dist/trace/core-vocab-wire.d.ts +95 -0
- package/dist/trace/core-vocab-wire.js +15 -0
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/exit-seat.d.ts +52 -4
- package/dist/trace/exit-seat.js +43 -36
- package/dist/trace/extension-call-face.d.ts +3 -2
- package/dist/trace/extension-call-face.js +3 -1
- package/dist/trace/ledger-events.d.ts +4 -7
- package/dist/trace/ledger-sink.d.ts +1 -30
- package/dist/trace/ledger-sink.js +0 -11
- package/dist/trace/model-segment.d.ts +5 -5
- package/dist/trace/model-segment.js +5 -5
- package/dist/trace/project.d.ts +88 -58
- package/dist/trace/project.js +64 -28
- package/dist/trace/redact.d.ts +124 -28
- package/dist/trace/redact.js +936 -328
- package/dist/trace/self-minted-wire.d.ts +750 -29
- package/dist/trace/self-minted-wire.js +262 -25
- package/dist/trace/sema-provenance.d.ts +45 -41
- package/dist/trace/sema-provenance.js +81 -10
- package/dist/trace/task-notification-facets.d.ts +70 -2
- package/dist/trace/task-notification-facets.js +71 -1
- package/dist/trace/wire-projection-faces.d.ts +43 -8
- package/dist/trace/wire-projection-faces.js +28 -3
- package/dist/unread-request-members.d.ts +66 -0
- package/dist/unread-request-members.js +41 -0
- package/dist/upstream-body.d.ts +23 -0
- package/dist/upstream-body.js +16 -0
- package/dist/url-refusal.d.ts +3 -3
- package/dist/url-refusal.js +11 -4
- package/dist/user-authored-text.d.ts +1 -1
- package/dist/user-input-ledger.d.ts +7 -8
- package/dist/user-input-ledger.js +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +6 -3
- package/dist/web-admin-client/apply-effective.js +33 -40
- package/dist/web-admin-client/apply-ledger.d.ts +16 -7
- package/dist/web-admin-client/apply-ledger.js +5 -2
- package/dist/web-admin-client/candidate-gate.d.ts +35 -3
- package/dist/web-admin-client/candidate-gate.js +53 -5
- package/dist/web-admin-client/center-request.d.ts +6 -3
- package/dist/web-admin-client/center-request.js +17 -16
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -2
- package/dist/web-admin-client/entry-metadata.d.ts +8 -0
- package/dist/web-admin-client/entry-metadata.js +13 -0
- package/dist/web-admin-client/facade.d.ts +1 -1
- package/dist/web-admin-client/http-client.d.ts +2 -1
- package/dist/web-admin-client/http-client.js +40 -13
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/mcp-revocation.js +2 -1
- package/dist/web-admin-client/read-warnings.d.ts +1 -0
- package/dist/web-admin-client/read-warnings.js +1 -0
- package/dist/web-admin-client/restart-signal.js +13 -6
- package/dist/web-admin-client/skills-mcp.d.ts +22 -8
- package/dist/web-admin-client/skills-mcp.js +26 -21
- package/dist/web-admin-client/types.d.ts +35 -51
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/package.json +16 -12
- package/scripts/drain-check-local.mjs +118 -173
- package/scripts/drain-check.mysql.sql +20 -16
- package/scripts/drain-check.pg.sql +20 -16
- package/wire-changes/server@7.147.0.json +813 -0
- package/wire-changes/server@7.148.0.json +1517 -0
- package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
- package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
- package/dist/http/memory-layer-reply.d.ts +0 -30
- package/dist/http/memory-layer-reply.js +0 -24
- package/dist/lsp/e2b-bridge.d.ts +0 -57
- package/dist/lsp/e2b-bridge.js +0 -139
- package/dist/lsp/e2b-manager.d.ts +0 -93
- package/dist/lsp/e2b-manager.js +0 -178
- package/dist/lsp/lsp-frames.d.ts +0 -14
- package/dist/lsp/lsp-frames.js +0 -25
- package/dist/lsp/manager.d.ts +0 -129
- package/dist/lsp/manager.js +0 -127
- package/dist/lsp/types.d.ts +0 -12
- package/dist/lsp/types.js +0 -2
- package/dist/lsp/ws-transport.d.ts +0 -40
- package/dist/lsp/ws-transport.js +0 -210
|
@@ -107,8 +107,18 @@ export function sessionPolicyErrorSentence(e) {
|
|
|
107
107
|
throw new Error(`SessionPolicyError inert_entry without the entry reader's detail: ${e.message}`);
|
|
108
108
|
return describeInertEntry(e.detail);
|
|
109
109
|
}
|
|
110
|
+
const SHAPE_REFUSAL_FACT_KEYS = ["field", "got"];
|
|
111
|
+
const ENTRY_REFUSAL_FACT_KEYS = ["field", "entry", "reason", "verdict", "guidance", "currentName", "ambiguous", "valueType"];
|
|
110
112
|
export function sessionPolicyErrorFacts(e) {
|
|
111
|
-
|
|
113
|
+
if (!isSessionRulesRefusal(e) || e.detail === undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
const detail = { ...e.detail };
|
|
116
|
+
const keys = e.code === "invalid_shape" ? SHAPE_REFUSAL_FACT_KEYS : ENTRY_REFUSAL_FACT_KEYS;
|
|
117
|
+
const facts = {};
|
|
118
|
+
for (const key of keys)
|
|
119
|
+
if (detail[key] !== undefined)
|
|
120
|
+
facts[key] = detail[key];
|
|
121
|
+
return facts;
|
|
112
122
|
}
|
|
113
123
|
export function sessionPolicyErrorHttp(code) {
|
|
114
124
|
switch (code) {
|
|
@@ -1,57 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `/health.inflight` 计法表第四类 —— **会话驻留的后台 shell / monitor**。
|
|
3
|
-
*
|
|
4
|
-
* ## 病
|
|
5
|
-
* 引擎在飞数原先只数 HTTP 腿与 leader 腿。模型在会话里起的后台 shell / monitor(`run_in_background`)活过起它的那一条腿 —— 腿一收,它在这份数里是 0:
|
|
6
|
-
* 读 `/health` 判「这台引擎是否空闲」的外部判官看不见它们,只好另拼一条谓词 —— 同一个事实两个读法。
|
|
7
|
-
*
|
|
8
|
-
* ## 两个事实(本文件只产总数里的第三项 `sessionResident`)
|
|
9
|
-
* `/health.inflight`(总数,{@link inflightTotal})= 引擎此刻托管着多少活 = `http + leader + sessionResident`,可观测事实;
|
|
10
|
-
* `drainState.blockingInflight`(阻断集,{@link blockingInflightOf})= 还有没有必须等完的活 = `http + leader`,排空 / 孤儿窗 / 附着租约自退 / SIGHUP 空闲窗判停读它。
|
|
11
|
-
* 本文件产出的 `sessionResident` **只进总数、不进阻断集**:驻留 shell 不是一条腿,等它没有意义;一只不退出的 shell(`while true`)若阻断,崩溃孤儿引擎就永生。
|
|
12
|
-
* 窗到 / 排空完成,退出边界的后台收割收掉它们,retain 行按 retain 既有语义活过受控退。
|
|
13
|
-
*
|
|
14
|
-
* ## 读法(本文件是唯一属主)
|
|
15
|
-
* 行集 = core `TaskRegistry.liveTasks(access)` 的投影:`type ∈ {background_bash, monitor}` ∧ `status === "running"` ∧ `sessionScoped` ∧ 非 retain
|
|
16
|
-
* ({@link isSessionResidentShellRow})。
|
|
17
|
-
* · **选座 `liveTasks`,不读 `list()`**:`list()` 是显示投影,硬帽 500 行(core 注:resolution must NEVER ride the display-capped list());
|
|
18
|
-
* 进程级的在飞总数是外部判官判「引擎是否空闲」的依据,不能骑显示帽 —— 超过 500 行时 `list()` 会静默少数,方向恰是「以为空闲」。`liveTasks` 无显示帽。
|
|
19
|
-
* · **retain 行不计**:显式 retain 的行是「交付的活服务」,按 core 契约活过引擎的受控退(退出边界对它 `retained_skipped`),
|
|
20
|
-
* 不是「引擎托管着、会随它收掉」的活 —— 报它,判官会把一个本就该活过引擎的服务读成引擎的负载。
|
|
21
|
-
* · **只数 shell 与 monitor**:后台 agent / workflow 行属计法表的别的类,不在这一类里。
|
|
22
|
-
* · **非会话驻留行不数**:挂在 run 腿上的后台行(`sessionScoped` 为假)随腿登记在 HTTP 腿项里,数它是第二次。
|
|
23
|
-
*
|
|
24
|
-
* ## 枚举源
|
|
25
|
-
* core 的 `canAccess` 要求访问元组带 `scope`(缺 scope 一律拒),`list` / `liveTasks` 因此只读「调用方可达行」,没有进程总数的读口(core 不立新 getter)。
|
|
26
|
-
* 进程级的数要由本仓自己枚举「本进程有哪些会话」:枚举源 = **围栏表**(`boot/execution-env.ts` 的 `SessionScopedRegistries.sessionOwners`):
|
|
27
|
-
* 每次提交经 resolve-spec 写一笔(会话 id → 属主),删会话的 E21 级联清一笔,LRU 有界。scope 轴 = {@link sessionChildrenScope}(会话属主 `?? "default"`,
|
|
28
|
-
* 删除门 / 换绑门 / 结清口 / 会话后台读面同一个取法,不另取)。
|
|
29
|
-
*
|
|
30
|
-
* ## 读到的边界(成文,不静默)
|
|
31
|
-
* · 围栏表是 LRU(上界 4096 会话):被挤出表的会话,它的驻留行在这里不可见 —— 回到改前的读数(不是新的错),不会多数;
|
|
32
|
-
* · 不经 resolve-spec 的内部车道(服务为自己起的 run)不写围栏表,它们起的会话驻留行同样不可见;
|
|
33
|
-
* · 删会话的级联在 `dropSessionScoped` 之后、后台收割之前失败(会话行因此没删)时,围栏表已先清:该会话还在跑的驻留行在下一次提交重新围栏之前不可见
|
|
34
|
-
* (同样回到改前的读数;修法是把 `dropSession` 的「清秘密」与「忘身份」拆开,属围栏表的属主,不在本读法里);
|
|
35
|
-
* · 每次读是 O(围栏表会话数 × 注册表行数)(`liveTasks` 逐会话走一遍注册表);表的上界 4096、注册表行数小,量级是毫秒。
|
|
36
|
-
*
|
|
37
|
-
* ## 读不出 ⇒ 非空闲(响亮,不替成 0)
|
|
38
|
-
* 本函数在 `/health` 应答和崩溃遗言(uncaught 处理器里读总数)里被调,**不许抛**(崩溃遗言里一次抛会吞掉遗言本身)。判停路径(排空 / 租约 / SIGHUP)读阻断集,
|
|
39
|
-
* 不求值本函数。某个会话的 `liveTasks` 读失败 ⇒ 该会话按 **1 只在跑**计(读不出 ⇒ 非空闲:判官宁可当有活)并经 `onUnreadable` 报出 ——
|
|
40
|
-
* 调用方必须给报口(装配层一会话一行 `session_resident_background_unreadable`),不存在静默的 0。
|
|
41
|
-
*/
|
|
42
1
|
import { type TaskListRow, type TaskRegistry } from "@sema-agent/core";
|
|
2
|
+
import type { InflightBreakdown } from "./fleet/drain-entry.js";
|
|
43
3
|
/** 枚举源的形:会话 id → 会话属主(`null` = 匿名)。`Map` 满足它。 */
|
|
44
4
|
export type SessionOwners = Iterable<readonly [sessionId: string, owner: string | null]>;
|
|
45
|
-
/**
|
|
46
|
-
export
|
|
5
|
+
/** 本文件交出的两项(键名属主 = {@link InflightBreakdown})。 */
|
|
6
|
+
export type SessionResidentCounts = Pick<InflightBreakdown, "backgroundAgents" | "sessionResident">;
|
|
7
|
+
/** 一行落在哪一项。 */
|
|
8
|
+
export type SessionResidentTerm = keyof SessionResidentCounts;
|
|
9
|
+
/**
|
|
10
|
+
* 行判:唯一写处(计数与单测同读)。`undefined` = 这一行不进在飞(理由见文件头的表)。闭集外的行类型 / 状态 ⇒ **抛**(由 {@link countSessionResidentBackground}
|
|
11
|
+
* 按「读不出」收:该会话计 1、报出)—— 不静默读成「不计」。
|
|
12
|
+
*/
|
|
13
|
+
export declare function sessionResidentTermOf(row: TaskListRow): SessionResidentTerm | undefined;
|
|
47
14
|
/** 一个会话的驻留行读失败的报口(由调用方给出:装配层记运维行)。 */
|
|
48
15
|
export type UnreadableSessionReport = (sessionId: string, err: unknown) => void;
|
|
16
|
+
/** 一次停滞收割的结局:收掉了 `count` 行(> 0 才报)/ 收割本身抛了。闭集,装配层按 `kind` 穷举。 */
|
|
17
|
+
export type StallReapOutcome = {
|
|
18
|
+
readonly kind: "reaped";
|
|
19
|
+
readonly count: number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "failed";
|
|
22
|
+
readonly err: unknown;
|
|
23
|
+
};
|
|
24
|
+
/** 停滞收割的策略:窗(ms,`BG_AGENT_STALL_MS`)与报口。读口必给 —— 没有「不收割」的读法。 */
|
|
25
|
+
export interface StallReapPolicy {
|
|
26
|
+
readonly stallMs: number;
|
|
27
|
+
readonly report: (outcome: StallReapOutcome) => void;
|
|
28
|
+
}
|
|
49
29
|
/**
|
|
50
|
-
*
|
|
51
|
-
* `
|
|
30
|
+
* 本进程里会话驻留的、仍在跑的后台行,按项计数(一次走查交出两项)。**先收尸再数活**:走查之前按 `stall` 收一次停滞的后台子代理(文件头「停滞收割」)。
|
|
31
|
+
* `registry` 缺省 = 进程级单例;参数只供测试换桩(只用到 `reapStaleSessionBackgroundAgents` 与 `liveTasks`)。
|
|
32
|
+
* `onUnreadable` 必给:读失败的会话按 1 只在跑的后台子代理计并经它报出(文件头「读不出 ⇒ 非空闲」)。读法与边界见文件头。
|
|
52
33
|
*/
|
|
53
34
|
export declare function countSessionResidentBackground(sessions: SessionOwners, opts: {
|
|
54
|
-
readonly registry?: Pick<TaskRegistry, "liveTasks">;
|
|
35
|
+
readonly registry?: Pick<TaskRegistry, "reapStaleSessionBackgroundAgents" | "liveTasks">;
|
|
55
36
|
readonly onUnreadable: UnreadableSessionReport;
|
|
56
|
-
|
|
37
|
+
readonly stall: StallReapPolicy;
|
|
38
|
+
}): SessionResidentCounts;
|
|
57
39
|
//# sourceMappingURL=session-resident-background.d.ts.map
|
|
@@ -1,20 +1,89 @@
|
|
|
1
|
+
import { writeLogText } from "./observability/logger.js";
|
|
1
2
|
import { defaultTaskRegistry } from "@sema-agent/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { sessionTenantScope } from "./session-children-retire.js";
|
|
4
|
+
function liveStatus(status) {
|
|
5
|
+
switch (status) {
|
|
6
|
+
case "pending":
|
|
7
|
+
case "running":
|
|
8
|
+
return true;
|
|
9
|
+
case "parked":
|
|
10
|
+
case "completed":
|
|
11
|
+
case "failed":
|
|
12
|
+
case "killed":
|
|
13
|
+
case "cancelled":
|
|
14
|
+
return false;
|
|
15
|
+
default: {
|
|
16
|
+
const unhandled = status;
|
|
17
|
+
throw new Error(`session-resident background: unknown task status ${String(unhandled)}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function sessionResidentTermOf(row) {
|
|
22
|
+
if (!row.sessionScoped)
|
|
23
|
+
return undefined;
|
|
24
|
+
switch (row.type) {
|
|
25
|
+
case "background_agent":
|
|
26
|
+
return liveStatus(row.status) ? "backgroundAgents" : undefined;
|
|
27
|
+
case "background_bash":
|
|
28
|
+
case "monitor":
|
|
29
|
+
return liveStatus(row.status) && row.retained !== true ? "sessionResident" : undefined;
|
|
30
|
+
case "workflow":
|
|
31
|
+
return undefined;
|
|
32
|
+
default: {
|
|
33
|
+
const unhandled = row.type;
|
|
34
|
+
throw new Error(`session-resident background: unknown task type ${String(unhandled)}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
5
37
|
}
|
|
6
38
|
export function countSessionResidentBackground(sessions, opts) {
|
|
7
39
|
const registry = opts.registry ?? defaultTaskRegistry;
|
|
8
|
-
|
|
40
|
+
reapStalled(registry, opts.stall);
|
|
41
|
+
let backgroundAgents = 0;
|
|
42
|
+
let sessionResident = 0;
|
|
43
|
+
const counted = new Set();
|
|
9
44
|
for (const [sessionId, owner] of sessions) {
|
|
10
45
|
try {
|
|
11
|
-
|
|
46
|
+
const fresh = [];
|
|
47
|
+
for (const row of registry.liveTasks({ owner: sessionId, sessionId, scope: sessionTenantScope(owner) })) {
|
|
48
|
+
const term = sessionResidentTermOf(row);
|
|
49
|
+
if (term !== undefined && !counted.has(row.task_id))
|
|
50
|
+
fresh.push([row.task_id, term]);
|
|
51
|
+
}
|
|
52
|
+
for (const [taskId, term] of fresh) {
|
|
53
|
+
if (counted.has(taskId))
|
|
54
|
+
continue;
|
|
55
|
+
counted.add(taskId);
|
|
56
|
+
if (term === "backgroundAgents")
|
|
57
|
+
backgroundAgents += 1;
|
|
58
|
+
else
|
|
59
|
+
sessionResident += 1;
|
|
60
|
+
}
|
|
12
61
|
}
|
|
13
62
|
catch (err) {
|
|
14
|
-
|
|
15
|
-
opts.onUnreadable(sessionId, err);
|
|
63
|
+
backgroundAgents += 1;
|
|
64
|
+
reportSafely(["session_resident_background_unreadable_report_threw", sessionId], () => opts.onUnreadable(sessionId, err));
|
|
16
65
|
}
|
|
17
66
|
}
|
|
18
|
-
return
|
|
67
|
+
return { backgroundAgents, sessionResident };
|
|
68
|
+
}
|
|
69
|
+
function reapStalled(registry, stall) {
|
|
70
|
+
let count;
|
|
71
|
+
try {
|
|
72
|
+
count = registry.reapStaleSessionBackgroundAgents(stall.stallMs);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
reportSafely(["background_agent_stall_report_threw"], () => stall.report({ kind: "failed", err }));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (count > 0)
|
|
79
|
+
reportSafely(["background_agent_stall_report_threw"], () => stall.report({ kind: "reaped", count }));
|
|
80
|
+
}
|
|
81
|
+
function reportSafely(fallbackLine, report) {
|
|
82
|
+
try {
|
|
83
|
+
report();
|
|
84
|
+
}
|
|
85
|
+
catch (reportErr) {
|
|
86
|
+
writeLogText("stderr", ...fallbackLine, reportErr);
|
|
87
|
+
}
|
|
19
88
|
}
|
|
20
89
|
//# sourceMappingURL=session-resident-background.js.map
|
package/dist/session-row.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface SessionRowTagInput {
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function sessionRowTagOf(row: SessionRowTagInput): string;
|
|
32
32
|
/**
|
|
33
|
-
* 列表行上的 `rowTag` 键(present-iff 这一行可被条件写 = 店有行写口 ∧ 行上有化身)
|
|
33
|
+
* 列表行上的 `rowTag` 键(present-iff 这一行可被条件写 = 店有行写口 ∧ 行上有化身):local 店与 SQL 合成店(两方言一只)的列表行映射都经它,化身那一格由调用方经
|
|
34
34
|
* `incarnationFromCell(…, "absent")` 解码好交进来(`undefined` = 行上没有令牌 ⇒ 键缺席,不铸)。
|
|
35
35
|
*/
|
|
36
36
|
export declare function sessionRowTagKey(row: {
|
|
@@ -56,7 +56,8 @@ export interface ReplaySessionRowWrite {
|
|
|
56
56
|
export type SessionRowWrite = ClientSessionRowWrite | ReplaySessionRowWrite;
|
|
57
57
|
/**
|
|
58
58
|
* 写原语的结局(闭集四员):`written` / `changed` 带提交(回滚)之后另读的那一行(列表行投影,含新 `rowTag`);`mirror`(客户端写在只读镜像上)/
|
|
59
|
-
* `absent`(行期望不中 / 没有行 /
|
|
59
|
+
* `absent`(行期望不中 / 没有行 / 委派分区行:锁下拒,一个字节没写;或应答行复核已不是判过的那一位住客:判官答 `changed`、回滚之后换人 = 零写,答 `write`、已提交之后换人〔SQL 后端才有这一窗〕= 写已落,
|
|
60
|
+
* 随旧行的外键级联删掉,或留在已换主的行上 —— 三分见 `plugins/session-row-sql.ts` 头注「结局 `absent` 的三种去向」)。
|
|
60
61
|
*/
|
|
61
62
|
export type SessionRowWriteOutcome<Row> = {
|
|
62
63
|
readonly kind: "written";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔴 **会话规则的引擎席**(场景子命名空间):会话规则桶的键 = (会话号, **会话属主**)—— 会话号定分区,会话行的属主是那一格分区的主体
|
|
3
|
+
* (路由 `GET/PUT /v1/sessions/:id/policy` 按会话属主写,`http/routes/sessions.ts`)。引擎读写会话规则时交的是 `spec.principal` = **人**
|
|
4
|
+
* (引擎交界的身份格,`engine-identity.ts`):带场景的会话,人 ≠ 属主,原样查 = 落到另一只桶(运维在 health 会话上 PUT 的 deny 对引擎不存在 = 安全轴放宽)。
|
|
5
|
+
*
|
|
6
|
+
* 律(一句):引擎交来的人恰是这只会话属主背后的人 ⇒ 键换成会话属主;否则原样(与今天逐字节同 —— 没带场景的会话属主与人字节相同,两种读法同一个键)。
|
|
7
|
+
* 属主只经会话店的头读一处(`headOf(id)?.owner`,会话行是属主的唯一事实);读不到头(会话不在 / 店不交头读)⇒ 原样。读写两腿与祖先会话的规则读同经这一只席。
|
|
8
|
+
*/
|
|
9
|
+
import type { SessionPolicyStore } from "@sema-agent/core";
|
|
10
|
+
import type { HeadRead } from "./session-incarnation.js";
|
|
11
|
+
export declare function createEngineSessionRulesSeat(store: SessionPolicyStore, headOf: HeadRead | undefined): SessionPolicyStore;
|
|
12
|
+
//# sourceMappingURL=session-rules-seat.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { personOf } from "./owner-brands.js";
|
|
2
|
+
import { recoveredSubject } from "./owner-faces.js";
|
|
3
|
+
export function createEngineSessionRulesSeat(store, headOf) {
|
|
4
|
+
const keyFor = async (sessionId, principal) => {
|
|
5
|
+
if (principal === undefined || headOf === undefined)
|
|
6
|
+
return principal;
|
|
7
|
+
const owner = (await headOf(sessionId))?.owner;
|
|
8
|
+
if (owner === undefined || owner === null)
|
|
9
|
+
return principal;
|
|
10
|
+
return personOf(recoveredSubject(owner)) === principal ? owner : principal;
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
getRules: async (sessionId, principal) => store.getRules(sessionId, await keyFor(sessionId, principal)),
|
|
14
|
+
putRules: async (sessionId, principal, rules, opts) => store.putRules(sessionId, await keyFor(sessionId, principal), rules, opts),
|
|
15
|
+
...(store.listBySession !== undefined ? { listBySession: store.listBySession.bind(store) } : {}),
|
|
16
|
+
...(store.deleteBySession !== undefined ? { deleteBySession: store.deleteBySession.bind(store) } : {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=session-rules-seat.js.map
|
|
@@ -115,7 +115,7 @@ export declare const STAGED_LOG_BATCH = 500;
|
|
|
115
115
|
/**
|
|
116
116
|
* The ROW contract a staged entry must meet before it is batched — what the stores need to persist it, not a session-tree invariant
|
|
117
117
|
* (those are core's): the SQL stores' `session_event` columns `entry_id` / `parent_id` are `VARCHAR(64)` and `type` is `VARCHAR(32) NOT NULL`
|
|
118
|
-
* (`plugins/tidb-pool.ts` and `
|
|
118
|
+
* (`plugins/tidb-pool.ts` and `stores-sql/pg-session-storage.ts`, the DDL both staged appends write into; both dialects count characters, not
|
|
119
119
|
* UTF-16 units). An entry outside it used to reach the staging write and fail there as a store fault (5xx) — a client's bad data read as an
|
|
120
120
|
* infrastructure failure. The local store holds the same contract (one gate for all stores: a log that cannot sync to SQL is refused at the door).
|
|
121
121
|
*/
|
package/dist/session-titler.d.ts
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
* "Has it a title?" is read from the column on every submit (one point read) — the process keeps NO "already titled"
|
|
12
12
|
* memo, because such a memo would be a second answer to that question that a clear turns stale. Generation = one
|
|
13
13
|
* cheap-model one-liner via the deployment's hookLlm face (summarize role → MODEL_CHEAP_ID when configured, else the
|
|
14
|
-
* main model; bounded + timed out)
|
|
14
|
+
* main model; bounded + timed out), asked at the LOWEST REASONING SEAT (`reasoningSeat: "lowest"`: a one-line title is
|
|
15
|
+
* not worth a thinking pass — thinking off where the model's wire can spell it, `low` where it cannot; the keys come from
|
|
16
|
+
* core's one dialect table and the output cap is sized for the answer plus that tier's thinking, both owned by the llm face).
|
|
15
17
|
*
|
|
16
18
|
* WRITE-AFTER NOTICE: the title that lands is announced to the run that triggered it — `maybeTitle`'s `onTitled` hands the
|
|
17
19
|
* seat (`run-acceptance.ts`) the one `session_titled` frame (`session-titled-frame.ts`, contract §4a-ttl) built from the
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
* session; the store's IS NULL guard closes the cross-replica race (double generation costs one extra cheap
|
|
25
27
|
* call at worst, and exactly one title lands).
|
|
26
28
|
*/
|
|
27
|
-
import type {
|
|
29
|
+
import type { HookLlmCall } from "./hooks/hook-runner.js";
|
|
28
30
|
import { type SessionTitledFrame } from "./session-titled-frame.js";
|
|
29
31
|
export interface SessionTitlerDeps {
|
|
30
32
|
/** Write-once store leg (SQL twins / local sidecar). Resolves false when a title already existed. */
|
|
@@ -35,19 +37,9 @@ export interface SessionTitlerDeps {
|
|
|
35
37
|
* and if still absent, release the seen slot so the NEXT submit retries (never a permanently-untitled
|
|
36
38
|
* session via a swallowed early UPDATE-0). Local lane has no row-existence dimension → never "none". */
|
|
37
39
|
probeTitle(sessionId: string): Promise<"none" | "untitled" | "titled">;
|
|
38
|
-
/** The deployment's cheap one-shot LLM face (main.ts hookLlm — summarize role default).
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
timeoutMs: number;
|
|
42
|
-
model?: string;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
ok: true;
|
|
45
|
-
text: string;
|
|
46
|
-
} | {
|
|
47
|
-
ok: false;
|
|
48
|
-
error: string;
|
|
49
|
-
code?: HookLlmFailureCode;
|
|
50
|
-
}>;
|
|
40
|
+
/** The deployment's cheap one-shot LLM face (main.ts hookLlm — summarize role default). The face's own type, not a
|
|
41
|
+
* second spelling of it: the titler declares its reasoning seat (`reasoningSeat`) on this call and the face honors it. */
|
|
42
|
+
llm: HookLlmCall;
|
|
51
43
|
logger?: {
|
|
52
44
|
debug?(msg: string, meta?: unknown): void;
|
|
53
45
|
info?(msg: string, meta?: unknown): void;
|
package/dist/session-titler.js
CHANGED
|
@@ -79,7 +79,7 @@ export function createSessionTitler(deps) {
|
|
|
79
79
|
deps.metrics?.inc("session_title_total", { outcome: "already_titled" });
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
const r = await deps.llm({ prompt: buildTitlePrompt(objective), timeoutMs: LLM_TIMEOUT_MS, model });
|
|
82
|
+
const r = await deps.llm({ prompt: buildTitlePrompt(objective), timeoutMs: LLM_TIMEOUT_MS, model, reasoningSeat: "lowest" });
|
|
83
83
|
if (!r.ok) {
|
|
84
84
|
deps.metrics?.inc("session_title_total", { outcome: "llm_failed" });
|
|
85
85
|
logFailure(sessionId, r.error, r.code);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* · **判官只有引擎一只**:每条腿起点一帧 `workspace_changed`(`cwd` / `root` / `entered?` / `project?` / `remote`),之后每变一帧;
|
|
7
7
|
* 这条腿属于哪个项目由引擎对检出的 `.sema/project` 记号判一次(带了 `TaskSpec.projectId` 就必须等于记号,
|
|
8
8
|
* 否则整腿拒 `config.project_identity_mismatch`;没有记号时声明就是身份)。本仓**不判**项目、不读记号。
|
|
9
|
-
* · **会话行只存一格**:`workspace` = 该会话上一条腿**自己的**最后一帧(SQL `
|
|
9
|
+
* · **会话行只存一格**:`workspace` = 该会话上一条腿**自己的**最后一帧(SQL `session_ext.workspace`;local 店
|
|
10
10
|
* `session-workspaces.json` 那一格)。成员由 {@link SESSION_WORKSPACE_DISPOSITIONS} 一张表定(引擎给帧加成员 ⇒ 表 tsc 红,
|
|
11
11
|
* 门在 `trace/core-keyset-guard.ts` ⑰ 读同一张表)。**唯一写者** = 腿的记录座 {@link createSessionWorkspaceRecorder}
|
|
12
12
|
* (持流的四条腿逐帧喂同一只;委派子代转上来的帧 —— 带 `parentToolCallId` / `sourceTaskId` / `bgAgentId` —— 不是这条腿的位置,不认)。
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
* `TaskSpec.memory.projectKey`,按 git 仓库(origin 远端 / 本机路径)键控,与 `.sema/project` 记号无关;引擎 7.58.0 自己也写明
|
|
28
28
|
* 「只声明的身份不改记忆的键」。两者是否该合成一个身份,是另一张设计票。
|
|
29
29
|
* · 多租户记忆分区(`proj:<租户>/<projectId>`)与登记簿种子读的是**这次提交**的 `projectId`(按提交挑盘,修前即如此),不读行。
|
|
30
|
-
* ·
|
|
30
|
+
* · 行上的项目还有一位读者:会话视图 `GET /v1/sessions/:id` 体顶层的 `projectId`(唯一读口 {@link readSessionProjectId},与视图的 `agent` 同一次视图读)。
|
|
31
|
+
* `root` / `cwd` / `entered` / `remote` 今天只存不读;fork 出的新会话从「没有记录」起(项目声明按引擎契约每腿都带,fork 的首腿由调用方带上)。
|
|
31
32
|
* · **只回结果的腿(verify / cascade,含续跑的 verify 臂)不记行**:引擎在组合入口里自己排空内层腿的流,宿主手里没有流,而引擎给组合入口开的
|
|
32
33
|
* 帧座(`onStatusEvent` / `onWiringManifest`)没有这一帧 ⇒ 这条腿的位置与项目到不了行,行停在更早一条腿的那一帧(没有记号的检出里,
|
|
33
34
|
* 下一条不带 `projectId` 的提交续声明的是那一帧声明过的项目)。本仓不替引擎铸「这条腿站在哪里」;要引擎为组合入口开这一帧的座。
|
|
@@ -111,6 +112,14 @@ export interface SessionWorkspaceRecorder {
|
|
|
111
112
|
* 这条腿的关键路径上,池饿死时这条腿本来就停;上界归部署(`DB_QUERY_TIMEOUT_MS`、MySQL 池的排队上界)。local 后端的写不经池。
|
|
112
113
|
*/
|
|
113
114
|
export declare function createSessionWorkspaceRecorder(store: SessionWorkspaceStore | undefined, witness: DelegationRootWitness | undefined): SessionWorkspaceRecorder;
|
|
115
|
+
/**
|
|
116
|
+
* 会话视图的 `projectId` —— **唯一读口**:行上最后一帧的 `project.id`(引擎对这只会话最后一条自己的腿的项目判决,记号判的与声明的同读;
|
|
117
|
+
* 「哪一种」不上 wire)。店没有这一面 / 没有记录 / 那一帧没有项目 ⇒ `undefined`(调用方不铸键)。两种读不出分两臂,与续声明那一读(`legProjectIdOf`)同读:
|
|
118
|
+
* · 店读抛(库连接 / 超时)⇒ 原样上抛 —— 视图读响亮失败(与 `agent` 同律:缺键读作「这台 server 没有说」,不把一次故障说成这句话);
|
|
119
|
+
* · 存下的那一格读不懂(被带外改坏)⇒ 店的同一只解码读作没有记录并计一次(F 类 `server.session-workspace.record-degraded`,`op=read`)⇒ 键缺席;
|
|
120
|
+
* 这只会话的下一条记帧的腿整格重写。
|
|
121
|
+
*/
|
|
122
|
+
export declare function readSessionProjectId(store: SessionWorkspaceStore | undefined, sessionId: string): Promise<string | undefined>;
|
|
114
123
|
/**
|
|
115
124
|
* **这条腿交给引擎的 `TaskSpec.projectId`**(唯一铸点;见文件头第三句)。`submitted` = 这次提交自己带的、已过形状门且折成小写的值
|
|
116
125
|
* (新提交:鉴权口的 `resolvedProjectId`;续跑:持久化体的同一个键)。它在场就不读行。行读失败(库抖)原样上抛 —— 读不到「这只会话的项目」
|
|
@@ -52,6 +52,11 @@ export function createSessionWorkspaceRecorder(store, witness) {
|
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
+
export async function readSessionProjectId(store, sessionId) {
|
|
56
|
+
if (store === undefined)
|
|
57
|
+
return undefined;
|
|
58
|
+
return (await store.readSessionWorkspace(sessionId))?.project?.id;
|
|
59
|
+
}
|
|
55
60
|
export async function legProjectIdOf(submitted, store, sessionId) {
|
|
56
61
|
if (submitted !== undefined)
|
|
57
62
|
return submitted;
|
package/dist/sighup-idle.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SIGHUP(壳窗口关闭打到整个进程组)≠「没人在用这只引擎」:共享引擎形态(同 config 多壳会话,引擎按
|
|
5
5
|
* T11 防孤儿拍骑在首壳进程组里)下 peer 会话还活着——无条件 drain 会把 peer mid-turn 斩掉(499)且窗内
|
|
6
6
|
* 新提交 503。这里改为:SIGHUP 不翻 draining(peer 零感知),armed 一只空闲窗——工作谓词连续 idleGraceMs
|
|
7
|
-
* 为假才 shutdown,任何工作重置窗口(谓词的在飞格读阻断集 `drainState.blockingInflight` = `http + leader`;会话驻留的后台 shell / monitor
|
|
7
|
+
* 为假才 shutdown,任何工作重置窗口(谓词的在飞格读阻断集 `drainState.blockingInflight` = `http + leader + backgroundAgents`;会话驻留的后台 shell / monitor
|
|
8
8
|
* 在 `/health.inflight` 总数里、不阻断)。真孤儿(最后一窗关掉)
|
|
9
9
|
* 有界自灭=T11 保留;第二个 SIGHUP 升级 escalate(既有 drain 路径,操作员硬梯子)。
|
|
10
10
|
*
|
package/dist/spec-fields.d.ts
CHANGED
|
@@ -78,12 +78,60 @@ export declare const MAX_TASK_AGENTS = 32;
|
|
|
78
78
|
* `ruleEntryListShapeOk`):引擎直接 `for (const entry of list)` —— 一个裸字符串 `"Bash"` 会被逐字符迭代成 `B` / `a` / `s` / `h` 四条
|
|
79
79
|
* (deny 侧 = 意图静默落空,安全轴上的放宽方向)。条目的**文法与名字**是引擎的读法:允侧读不出的条目(`*` / 写路径 / 域名 / 退役名 …)引擎在开跑时发
|
|
80
80
|
* `permission.allowed_tool_not_granted`(受众 = 用户);拒侧读成空的条目(文法或名字层)在 `resolveSpec` 拒(提交 400 / 续跑 409,`rule-entry-list.ts` 的
|
|
81
|
-
* `inertToolListEntryOf`,判据 = 引擎的条目读法;同一只函数也拒请求的工具名选择器清单里的近似名 /
|
|
81
|
+
* `inertToolListEntryOf`,判据 = 引擎的条目读法;同一只函数也拒请求的工具名选择器清单里的近似名 / 有后继的退役名;限制侧**没有后继**的退役名 core 7.66.0 起不拒,引擎保留这一行并发 `config.legacy_tool_name`)。
|
|
82
82
|
* **条数帽**是全部工具名清单的同一只判(`rule-entry-list.ts` 的 `skillToolListsOverCap`;句子与机读位 `field` 点体内坐标 `skills[1].allowedTools` /
|
|
83
83
|
* `agents[0].skills[2].disallowedTools`):顶层 `validateUserSkills` 与子代 {@link validateTaskAgents} 两道门都逐条先形、后帽(与 7.131.0 的拒点与判序同);
|
|
84
84
|
* 拒点 `resolveSpec` 两腿同经的 `inertToolListEntryOf` 先过同一只判;无长度帽([ref])。
|
|
85
85
|
*/
|
|
86
86
|
export declare const skillToolListOk: (v: unknown) => v is readonly string[];
|
|
87
|
+
/**
|
|
88
|
+
* = core `SKILL_CONTENT_MAX_CHARS`(1 MiB 加载门;core 1.293 起 invoke 全文零截断、超 1 MiB 整拒;常量在 `dist/core/runner/synthetic-tools.js`,
|
|
89
|
+
* 未从 core 包根导出,故钉本地孪生 + 本出处注记)。两道技能门(顶层 `body.skills[i]` 与子代 `agents[a].skills[j]`)读这**一只**:同值两名就是第二个会漂的域。
|
|
90
|
+
* 🔴 这是技能面**唯一**剩下的尺寸门,而且它不是超集帽:引擎在装配期对超 1 MiB 的技能本就整拒,门上先答只是把同一个判决搬到调用方看得懂的地方
|
|
91
|
+
* ([ref] 退役的三条帽 —— 条数 / description / name 长度 —— 都没有这个性质)。
|
|
92
|
+
*/
|
|
93
|
+
export declare const MAX_SKILL_CONTENT_CHARS = 1048576;
|
|
94
|
+
/**
|
|
95
|
+
* 请求面技能上**有名而不收**的键:每只一句句尾,两道门同字节(拒句 = 体内坐标 + 句尾)。本表只给**话**;键在不在由 {@link namedRefusalOf} 答。
|
|
96
|
+
* · `manifest` —— core 7.41.0 [ref] 退役(硬破坏,零别名);出路只点本服务上真存在的旋钮:两只清单、deny 规则 / 子代 `allowTools`、会话规则 `allowDirs`。
|
|
97
|
+
* 任何值都拒(`null` / 空对象同样是「我带了 manifest」),不翻译成 `allowedTools`(那是放宽方向);
|
|
98
|
+
* · `mods` —— core 7.56.0 [ref] 的技能座扩展注册(带 `register` 函数的代码对象),不是请求数据(JSON 带不过函数);任何值都拒。
|
|
99
|
+
*/
|
|
100
|
+
export declare const SKILL_NAMED_REFUSALS: {
|
|
101
|
+
readonly manifest: "was retired in core 7.41.0 — a skill's tools are its allowedTools / disallowedTools now (an allow-rule and a deny-rule source for the run the skill is activated in, never a fence); move manifest.allowTools to allowedTools. To fence tools use deny rules (settings.permissions.deny) or a delegated agent's allowTools; to fence write paths use the session rules' allowDirs";
|
|
102
|
+
readonly mods: "is not a request key — skill registrations are code the deployment mounts, not request data (this server does not compile skill hooks: GET /v1/capabilities answers mods.skill_seat: false)";
|
|
103
|
+
};
|
|
104
|
+
/** 一键的撞帽读数(形对、只是超了帽;量纲 / 送来的量 / 帽)。形错不是撞帽 —— 那一形只有句子。 */
|
|
105
|
+
interface SkillFieldLimit {
|
|
106
|
+
readonly measure: LimitMeasure;
|
|
107
|
+
readonly count: number;
|
|
108
|
+
readonly cap: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 一条技能的问题 —— **数据,不带坐标**:`key` = 出问题的那一键(缺席 = 这条技能本身不是对象)、`words` = 这一键的话(句尾)、撞帽另带读数。
|
|
112
|
+
* 坐标由调用方给({@link skillRefusalAt} 一处铸句子与机读位),所以两道门的句尾逐字节同。
|
|
113
|
+
*/
|
|
114
|
+
export interface SkillItemIssue {
|
|
115
|
+
readonly key?: string;
|
|
116
|
+
readonly words: string;
|
|
117
|
+
readonly limit?: SkillFieldLimit;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* **一条技能的唯一判官**(顶层 `validateUserSkills` 与子代 {@link taskAgentIssue} 都只调它):合形 ⇒ `null`;否则第一处问题({@link SkillItemIssue})。
|
|
121
|
+
* 判序:不是对象 ⇒ 整条;点名拒的两只({@link namedRefusalOf})→ 键序逐键过闭集(未知键);再按键表序判必填与形(撞帽的形对键带读数)。
|
|
122
|
+
* 键判断用 `Object.hasOwn`:`in` 走原型链,JSON 里的 "toString" / "constructor" 键会被误判成白名单字段(与 {@link taskAgentIssue} 同一条教训)。
|
|
123
|
+
* 调用方写的键名过唯一回显口径(有界、剥控制 / 双向字符)再进句子与坐标。
|
|
124
|
+
*/
|
|
125
|
+
export declare function skillItemIssue(skill: unknown): SkillItemIssue | null;
|
|
126
|
+
/** 一条技能的拒(两道门同形):句子 = `<坐标> <这一键的话>`;机读位 `field` = 那一键的体内坐标,撞帽另带 `reason` / `count` / `cap`。 */
|
|
127
|
+
export interface SkillItemRefusal {
|
|
128
|
+
readonly message: string;
|
|
129
|
+
readonly facts: {
|
|
130
|
+
readonly field: string;
|
|
131
|
+
} | LimitFacts;
|
|
132
|
+
}
|
|
133
|
+
/** 把 {@link skillItemIssue} 的问题铸成坐标 `at`(`skills[0]` / `agents[1].skills[2]`)上的拒 —— 句子与机读位的唯一铸点。 */
|
|
134
|
+
export declare function skillRefusalAt(at: string, issue: SkillItemIssue): SkillItemRefusal;
|
|
87
135
|
/**
|
|
88
136
|
* 一条子代定义的裁决:`message` = 一句可 400 的英文(不带下标,调用方加);撞帽时另带 `limit`(`rel` = 相对这条定义的坐标 `allowTools[3]` / `name`),
|
|
89
137
|
* 句子是撞帽的头一句(`agent.allowTools[3] has 129 characters — at most 128 are accepted`:撞了哪一条帽、送来多少、帽多少),
|
|
@@ -97,11 +145,16 @@ export interface TaskAgentIssue {
|
|
|
97
145
|
readonly count: number;
|
|
98
146
|
readonly cap: number;
|
|
99
147
|
};
|
|
148
|
+
/** 问题在这条定义的第 `index` 条技能上(技能判官的问题,不带坐标)—— {@link validateTaskAgents} 以体内坐标 `agents[i].skills[index]` 铸拒({@link skillRefusalAt})。 */
|
|
149
|
+
readonly skill?: {
|
|
150
|
+
readonly index: number;
|
|
151
|
+
readonly issue: SkillItemIssue;
|
|
152
|
+
};
|
|
100
153
|
}
|
|
101
|
-
/** 提交体 `agents` 的拒:句子(带下标)+
|
|
154
|
+
/** 提交体 `agents` 的拒:句子(带下标)+ 机读位(撞帽:`field` / `reason` / `count` / `cap`,`limit-refusal.ts` 一处铸;技能那一层的每一只拒带 `field`,{@link skillRefusalAt})。 */
|
|
102
155
|
export interface TaskAgentsRefusal {
|
|
103
156
|
readonly message: string;
|
|
104
|
-
readonly facts?:
|
|
157
|
+
readonly facts?: SkillItemRefusal["facts"];
|
|
105
158
|
}
|
|
106
159
|
/** [ref] 单条 agent 定义的形状裁决:null=合法;否则一句可 400 的英文错误(不带索引,调用方自己加)。
|
|
107
160
|
* 白名单外键 fail-loud —— 与 resilience/limits 的「容忍未知键」相反:agents 是能力定义,静默丢字段 =
|
|
@@ -262,4 +315,5 @@ export declare function normalizeApproachNotice(raw: unknown): false | {
|
|
|
262
315
|
* 全空 ⇒ undefined(spec 不挂 limits 键,byte-compat)。
|
|
263
316
|
*/
|
|
264
317
|
export declare function resolveTaskLimits(bodyLimits: unknown, caps: TaskLimitCaps, envTimeoutSec: number, requirePrincipal: boolean | undefined, warn?: (event: string, fields: Record<string, unknown>) => void): TaskSpec["limits"];
|
|
318
|
+
export {};
|
|
265
319
|
//# sourceMappingURL=spec-fields.d.ts.map
|