@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
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* 本模块的定界不变:并列的那一侧开着哪几档,是那张表自己的缺省说了算。core 的 `config.read_face_deployment_clamped`
|
|
37
37
|
* (只读挂载钳制)同样不受本件影响。
|
|
38
38
|
*/
|
|
39
|
-
import { type
|
|
39
|
+
import { type ExecutionLane, type LaneReadFaceDefault } from "./execution-lane-caps.js";
|
|
40
40
|
import { type PostureSource } from "./posture-source.js";
|
|
41
41
|
/**
|
|
42
42
|
* 档位来源的闭集词表 —— **[ref] 起转 `posture-source.ts` 的共享件**(本模块只是给这一档取个本地名字,
|
|
@@ -63,14 +63,14 @@ export declare function readFaceDefaultFor(input: {
|
|
|
63
63
|
export interface ReadFaceDeploymentSeat {
|
|
64
64
|
readFace?: "open" | "roots" | undefined;
|
|
65
65
|
readFaceSource: ReadFaceSource;
|
|
66
|
-
remoteExec
|
|
67
|
-
readonly provider:
|
|
68
|
-
}
|
|
66
|
+
readonly remoteExec: {
|
|
67
|
+
readonly provider: ExecutionLane;
|
|
68
|
+
};
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* 把**派生的**读面缺省按这台部署**最终生效的车道**落到配置上(显式 env / center 发布的值与来源原样不动)。返回值 = 这一次有没有改动。
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* 一个调用点:执行车道合成步,在判点(最终车道来自显式声明)通过之后 —— 车道到那一步才定形(local 形 `config.d/remote-exec.json` 也能声明),
|
|
73
|
+
* 合成前的 raw 配置上车道可以缺席,派生不在那里做(否则会把缺席折成某条车道的缺省)。
|
|
74
74
|
* 幂等:同一份配置再调一次不改。值与来源**同一处写**(`readFace` 缺席 ⟺ 来源 `engine-default`)。
|
|
75
75
|
*/
|
|
76
76
|
export declare function settleDerivedReadFace(seat: ReadFaceDeploymentSeat, singleUserTurnkey: boolean): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LANE_OPEN_READ_FACE_CAUTION,
|
|
1
|
+
import { LANE_OPEN_READ_FACE_CAUTION, laneReadFaceDefault } from "./execution-lane-caps.js";
|
|
2
2
|
import { POSTURE_SOURCE_WORDS, postureSourceNote } from "./posture-source.js";
|
|
3
3
|
export const READ_FACE_SOURCE_WORDS = POSTURE_SOURCE_WORDS;
|
|
4
4
|
function readFaceForPosture(singleUserTurnkey) {
|
|
@@ -21,7 +21,7 @@ function isDerivedSource(source) {
|
|
|
21
21
|
export function settleDerivedReadFace(seat, singleUserTurnkey) {
|
|
22
22
|
if (!isDerivedSource(seat.readFaceSource))
|
|
23
23
|
return false;
|
|
24
|
-
const next = readFaceDefaultFor({ laneDefault: laneReadFaceDefault(
|
|
24
|
+
const next = readFaceDefaultFor({ laneDefault: laneReadFaceDefault(seat.remoteExec.provider), singleUserTurnkey });
|
|
25
25
|
if (next.readFace === seat.readFace && next.readFaceSource === seat.readFaceSource)
|
|
26
26
|
return false;
|
|
27
27
|
if (next.readFace === undefined)
|
|
@@ -6,11 +6,16 @@
|
|
|
6
6
|
* ① **列表**:在场却不是数组 / 超过挂载上限 / 某一条不是对象 ⇒ `400 request.field_invalid`(整份拒而不是挂前 N 条 / 摘掉读不出的那条:一份被悄悄截短的声明,在发送方那里读起来是「生效了」);
|
|
7
7
|
* 超上限用撞帽的唯一铸点({@link limitRefusal}),拒体带机读位一组键(`field` · `reason:"over_cap"` · `count` · `cap`);
|
|
8
8
|
* ② **键名**:条目层的词表外键 ⇒ `400 request.body_shape` + `unknownKeys`(句子由各座自己写 —— 受理键表与嵌套层是座位自己的事);
|
|
9
|
-
* ③ **键值**:每个受理键一只判官 ⇒ `400 request.field_invalid`,句子 `<坐标>.<键路径> (
|
|
9
|
+
* ③ **键值**:每个受理键一只判官 ⇒ `400 request.field_invalid`,句子 `<坐标>.<键路径>[ (<条目指认>)] is not a usable declaration — <判官原因句>. …`(条目指认由座位给:有申报名的座位 `(server "<名>")`,没有名字的座位不带),不回显值;
|
|
10
10
|
* 判官答「URL 带凭据」时拒体另带机读位 `field` / `reason`({@link urlCredentialFacts})。
|
|
11
11
|
* 第一处坏形即答:先列表、后条目;条目里先键名、后键值。各座只写**自己的**两件事:受理键表 + 键值判官表(以及它自己的词表外键句)。拒形、句尾、撞帽句不在座位文件里手拼 ——
|
|
12
12
|
* 两份手拼的拒形迟早分岔(`a2aPeers` 上线时就是缺了这一整套,坏形换回 200 + 运维 warn,调用方以为声明生效了)。
|
|
13
13
|
*
|
|
14
|
+
* ## 机读位(`request.field_invalid` 的每一只拒都带)
|
|
15
|
+
* 列表级与条目级的 `request.field_invalid` 拒体恒带 `field`(体内坐标:列表键 / `<列表>[i]` / `<列表>[i].<键路径>`),条目级(含条目不是对象)另带 `index`(条目在列表里的下标);撞帽那一形仍是撞帽的一组键,
|
|
16
|
+
* URL 带凭据那一形在 `field` / `reason` 之外同带 `index`。机读位只在这里铸:判官({@link DeclarationKeyJudge})只交原因,`field` 由原因的键路径铸、`index` 由骨架的循环铸 —— 座位与判官不手拼坐标。
|
|
17
|
+
* `request.body_shape` 的词表外键拒另有自己的机读位(`unknownKeys`,全坐标),不在这一组。
|
|
18
|
+
*
|
|
14
19
|
* ## 射程
|
|
15
20
|
* 纯值域、与租户车道无关;只在 fresh 提交腿上问(`boot/resolve-spec.ts` 的 `opts.leg`):重放存量 body 的腿走宽容读器,一个 4xx 打在 resume 上会永久砖死一条 parked 任务。
|
|
16
21
|
*/
|
|
@@ -19,26 +24,44 @@ import { type LimitFacts } from "./limit-refusal.js";
|
|
|
19
24
|
import { type UrlCredentialFacts } from "./url-credential-refusal.js";
|
|
20
25
|
/** 一座声明列表的名字与上限、以及拒句里要用的称呼(座位的常量,铸点只读)。 */
|
|
21
26
|
export interface DeclarationSeat {
|
|
22
|
-
/** 请求体里这张列表的键,也是机读坐标的根(`mcpServers` | `a2aPeers`)。 */
|
|
27
|
+
/** 请求体里这张列表的键,也是机读坐标的根(`mcpServers` | `a2aPeers` | `images`)。 */
|
|
23
28
|
readonly list: string;
|
|
24
29
|
/** 挂载上限(条数;超过 ⇒ 撞帽拒)。 */
|
|
25
30
|
readonly cap: number;
|
|
26
|
-
/**
|
|
27
|
-
readonly
|
|
31
|
+
/** 条目级拒句里条目的指认(带前导空格,接在坐标后):有申报名的座位 = ` (server "<名>")`;坐标本身唯一的座位(没有名字的条目)= 空串。 */
|
|
32
|
+
readonly identify: (entry: Record<string, unknown>) => string;
|
|
33
|
+
/** 条目级拒句的收尾句:说清「为什么整份请求被拒、而不是照坏条目办」与出路。 */
|
|
34
|
+
readonly entryTail: string;
|
|
28
35
|
/** 「一条声明」的整称(`an MCP server declaration`)。 */
|
|
29
36
|
readonly declaration: string;
|
|
30
37
|
/** 「多条声明」的整称(`MCP server declarations`)。 */
|
|
31
38
|
readonly declarations: string;
|
|
32
39
|
}
|
|
40
|
+
/** 有申报名、挂在一个外部服务上的座位(`mcpServers` · `a2aPeers`)的座位常量:指认 = ` (<subject> "<名>")`,收尾句说「不挂就跑偏」。`subject` = 一条声明所声明的东西(`server` | `peer`)。 */
|
|
41
|
+
export declare function createMountSeat(o: {
|
|
42
|
+
readonly list: string;
|
|
43
|
+
readonly cap: number;
|
|
44
|
+
readonly subject: string;
|
|
45
|
+
readonly declaration: string;
|
|
46
|
+
readonly declarations: string;
|
|
47
|
+
}): DeclarationSeat;
|
|
33
48
|
/** 一次拒绝:码 + 句 + 词表外的键名表(只在闭集那一形上在场)+ 机读位(撞帽 / URL 带凭据两形上在场)。受理口(同步 400)与探测口(`POST …/probe`)原样转述同一份。 */
|
|
34
49
|
export interface DeclarationRefusal {
|
|
35
50
|
readonly errorCode: "request.body_shape" | "request.field_invalid";
|
|
36
51
|
readonly message: string;
|
|
37
52
|
/** 词表外的键,全路径形(已清洗 + 截长 + 排序 + 封顶)。 */
|
|
38
53
|
readonly unknownKeys?: readonly string[];
|
|
39
|
-
/**
|
|
40
|
-
readonly facts?:
|
|
54
|
+
/** 机读位:撞帽 = `field` · `reason:"over_cap"` · `count` · `cap`;URL 带凭据 = `field` · `reason`(判官的拒因词)· `index`;其余 `request.field_invalid` = `field`(条目级另带 `index`)。 */
|
|
55
|
+
readonly facts?: DeclarationEntryFacts | LimitFacts;
|
|
41
56
|
}
|
|
57
|
+
/** 条目判官(座位的 `judgeEntry` · 键值判官表)交回的拒:机读位只会是条目级的那一组({@link DeclarationEntryFacts}),撞帽那一形只由骨架的列表级铸 —— 所以补 `index` 的函数收窄到这一型,不靠运行期猜。 */
|
|
58
|
+
export type EntryRefusal = Omit<DeclarationRefusal, "facts"> & {
|
|
59
|
+
readonly facts?: DeclarationEntryFacts;
|
|
60
|
+
};
|
|
61
|
+
/** 列表级 / 条目级 `request.field_invalid` 拒的机读位:`field` 恒在;`index` = 条目级才有(条目在列表里的下标);URL 带凭据那一形另带判官的拒因词 `reason`。 */
|
|
62
|
+
export type DeclarationEntryFacts = (Pick<UrlCredentialFacts, "field"> | UrlCredentialFacts) & {
|
|
63
|
+
readonly index?: number;
|
|
64
|
+
};
|
|
42
65
|
/** 一处键值坏形:键路径(相对条目)+ 判官的原因句;答「URL 带凭据」时另带判官的答案(⇒ 拒体带机读位)。 */
|
|
43
66
|
export interface DeclarationKeyIssue {
|
|
44
67
|
readonly path: string;
|
|
@@ -55,8 +78,8 @@ export declare function declaredName(e: unknown): string;
|
|
|
55
78
|
export declare function declarationNameIssue(entry: Record<string, unknown>): DeclarationKeyIssue | undefined;
|
|
56
79
|
/** 列表级拒句的收尾句:说清「为什么整份被拒、而不是只按读得出的那部分办」与出路(空列表 = 什么都不声明)。 */
|
|
57
80
|
export declare const LIST_REFUSAL_TAIL: string;
|
|
58
|
-
/** 列表级的一处坏形 → 拒(码恒 `request.field_invalid`)。`head`
|
|
59
|
-
export declare function declarationListRefusal(head: string):
|
|
81
|
+
/** 列表级的一处坏形 → 拒(码恒 `request.field_invalid`,体带 `field`)。`head` 只说位置与形的**种类**,不回显值;`field` = 坏形所在的体内坐标(列表键 / `<列表>[i]`)。 */
|
|
82
|
+
export declare function declarationListRefusal(head: string, field: string): EntryRefusal;
|
|
60
83
|
/**
|
|
61
84
|
* 一处键值坏形**怎么被说出来**:体内坐标(`<条目坐标>.<键路径>`)+ 判官的原因句(只剥控制与双向字符,不回显值)。受理口的拒句与读器的丢弃因(请求腿运维 warn 的 `field` / `reason`)读**这一只** ——
|
|
62
85
|
* 原因只来自判官表,组句只在这里(两边各写一份,迟早分岔)。
|
|
@@ -78,17 +101,17 @@ export declare function declarationOverCapFacts(seat: DeclarationSeat, count: nu
|
|
|
78
101
|
* 「什么算对象」只在这里判。
|
|
79
102
|
*/
|
|
80
103
|
export declare function declarationEntryNotObject(seat: DeclarationSeat, entry: unknown, at: string): string | undefined;
|
|
81
|
-
/** 一处键值坏形 →
|
|
82
|
-
export declare function declarationFieldRefusal(seat: DeclarationSeat, entry: Record<string, unknown>, at: string, issue: DeclarationKeyIssue):
|
|
104
|
+
/** 一处键值坏形 → 拒。**所有键同一个形**;条目指认由座位给({@link DeclarationSeat.identify}),坐标与原因句由 {@link declarationIssueFacts} 铸,机读位 `field`(判官答 URL 带凭据时另带 `reason`)与句子点名同一个坐标。 */
|
|
105
|
+
export declare function declarationFieldRefusal(seat: DeclarationSeat, entry: Record<string, unknown>, at: string, issue: DeclarationKeyIssue): EntryRefusal;
|
|
83
106
|
/** 一条条目的键值判官表按受理键序问一遍,第一处坏形即返回。 */
|
|
84
107
|
export declare function judgeDeclarationKeys<K extends string, E extends Record<string, unknown>>(seat: DeclarationSeat, entry: E, at: string, keys: readonly K[], judges: {
|
|
85
108
|
readonly [P in K]: DeclarationKeyJudge<E>;
|
|
86
|
-
}):
|
|
109
|
+
}): EntryRefusal | undefined;
|
|
87
110
|
/**
|
|
88
111
|
* 一张声明列表「能不能原样用」的回答者骨架:列表级(缺席 / `null` ⇒ 没声明;不是数组 / 超上限 / 条目不是对象)在这里,条目级交座位的 `judgeEntry`(词表外的键 → 键值)。
|
|
89
112
|
* `undefined` = 能原样用(或没声明;各门自己定缺席的意思)。
|
|
90
113
|
*/
|
|
91
|
-
export declare function requestDeclarationRefusal(seat: DeclarationSeat, list: unknown, judgeEntry: (entry: Record<string, unknown>, at: string) =>
|
|
114
|
+
export declare function requestDeclarationRefusal(seat: DeclarationSeat, list: unknown, judgeEntry: (entry: Record<string, unknown>, at: string) => EntryRefusal | undefined): DeclarationRefusal | undefined;
|
|
92
115
|
/** 受理口的转述:有答案 ⇒ 同步 400(码 / 句 / `unknownKeys` / 机读位原样);没有 ⇒ 什么也不做。 */
|
|
93
116
|
export declare function throwDeclarationRefusal(refusal: DeclarationRefusal | undefined): void;
|
|
94
117
|
//# sourceMappingURL=request-declaration-refusal.d.ts.map
|
|
@@ -3,6 +3,16 @@ import { createCodedHttpError } from "./security.js";
|
|
|
3
3
|
import { limitRefusal } from "./limit-refusal.js";
|
|
4
4
|
import { echoKeyName } from "./request-key-closure.js";
|
|
5
5
|
import { urlCredentialFacts } from "./url-credential-refusal.js";
|
|
6
|
+
export function createMountSeat(o) {
|
|
7
|
+
return {
|
|
8
|
+
list: o.list,
|
|
9
|
+
cap: o.cap,
|
|
10
|
+
identify: (entry) => ` (${o.subject} "${echoKeyName("", declaredName(entry))}")`,
|
|
11
|
+
entryTail: mountedEntryTail(o.subject),
|
|
12
|
+
declaration: o.declaration,
|
|
13
|
+
declarations: o.declarations,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
6
16
|
export const MALFORMED_NAME = "<malformed>";
|
|
7
17
|
export function declaredName(e) {
|
|
8
18
|
return e && typeof e === "object" && typeof e.name === "string" && e.name !== ""
|
|
@@ -14,10 +24,10 @@ export function declarationNameIssue(entry) {
|
|
|
14
24
|
}
|
|
15
25
|
export const LIST_REFUSAL_TAIL = "The request is refused rather than acting on part of the list: declarations that silently did not apply would read as in effect to whoever sent them. " +
|
|
16
26
|
"Fix the list (an empty list declares none).";
|
|
17
|
-
export function declarationListRefusal(head) {
|
|
18
|
-
return { errorCode: "request.field_invalid", message: `${head}. ${LIST_REFUSAL_TAIL}
|
|
27
|
+
export function declarationListRefusal(head, field) {
|
|
28
|
+
return { errorCode: "request.field_invalid", message: `${head}. ${LIST_REFUSAL_TAIL}`, facts: { field } };
|
|
19
29
|
}
|
|
20
|
-
function
|
|
30
|
+
function mountedEntryTail(subject) {
|
|
21
31
|
return (`The request is refused rather than mounting the ${subject} without it: a declaration that silently did not apply would leave the ${subject} running differently from what you declared. ` +
|
|
22
32
|
"Fix the entry (an optional key may also be omitted).");
|
|
23
33
|
}
|
|
@@ -32,14 +42,16 @@ export function declarationEntryNotObject(seat, entry, at) {
|
|
|
32
42
|
return entry === null || typeof entry !== "object" || Array.isArray(entry) ? `${at} is ${describeValueShape(entry)}, not ${seat.declaration} (an object)` : undefined;
|
|
33
43
|
}
|
|
34
44
|
export function declarationFieldRefusal(seat, entry, at, issue) {
|
|
35
|
-
const name = echoKeyName("", declaredName(entry));
|
|
36
45
|
const { field, reason } = declarationIssueFacts(at, issue);
|
|
37
46
|
return {
|
|
38
47
|
errorCode: "request.field_invalid",
|
|
39
|
-
message: `${field}
|
|
40
|
-
|
|
48
|
+
message: `${field}${seat.identify(entry)} is not a usable declaration — ${reason}. ${seat.entryTail}`,
|
|
49
|
+
facts: issue.credential === undefined ? { field } : urlCredentialFacts(field, issue.credential),
|
|
41
50
|
};
|
|
42
51
|
}
|
|
52
|
+
function withEntryIndex(refusal, index) {
|
|
53
|
+
return refusal.errorCode === "request.field_invalid" && refusal.facts !== undefined ? { ...refusal, facts: { ...refusal.facts, index } } : refusal;
|
|
54
|
+
}
|
|
43
55
|
export function judgeDeclarationKeys(seat, entry, at, keys, judges) {
|
|
44
56
|
for (const key of keys) {
|
|
45
57
|
const issue = judges[key](entry, at);
|
|
@@ -52,7 +64,7 @@ export function requestDeclarationRefusal(seat, list, judgeEntry) {
|
|
|
52
64
|
if (list === undefined || list === null)
|
|
53
65
|
return undefined;
|
|
54
66
|
if (!Array.isArray(list))
|
|
55
|
-
return declarationListRefusal(`${seat.list} is ${describeValueShape(list)}, not an array of ${seat.declarations}
|
|
67
|
+
return declarationListRefusal(`${seat.list} is ${describeValueShape(list)}, not an array of ${seat.declarations}`, seat.list);
|
|
56
68
|
if (list.length > seat.cap) {
|
|
57
69
|
const capped = limitRefusal(seat.list, "entries", list.length, seat.cap, { tail: LIST_REFUSAL_TAIL });
|
|
58
70
|
return { errorCode: "request.field_invalid", message: capped.message, facts: capped.facts };
|
|
@@ -62,10 +74,10 @@ export function requestDeclarationRefusal(seat, list, judgeEntry) {
|
|
|
62
74
|
const at = `${seat.list}[${i}]`;
|
|
63
75
|
const notObject = declarationEntryNotObject(seat, entry, at);
|
|
64
76
|
if (notObject !== undefined)
|
|
65
|
-
return declarationListRefusal(notObject);
|
|
77
|
+
return withEntryIndex(declarationListRefusal(notObject, at), i);
|
|
66
78
|
const refusal = judgeEntry(entry, at);
|
|
67
79
|
if (refusal !== undefined)
|
|
68
|
-
return refusal;
|
|
80
|
+
return withEntryIndex(refusal, i);
|
|
69
81
|
}
|
|
70
82
|
return undefined;
|
|
71
83
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **请求形的拒** —— 一条律:门先于铸。
|
|
3
|
+
*
|
|
4
|
+
* 一次提交里,判据只读**请求本身**(体 · 头里验过的主体 · 到达的腿)与**进程期不变的部署配置**(车道、主体姿态、运维旋钮 —— 不是热应用的模型面)就答得出的拒,
|
|
5
|
+
* 在授权器铸下任何会话行之前答(受理漏斗 `http/admission.ts` 调 {@link assertRequestFormBeforeMint}):会话店零写、撤回出口零次,壳的 `--resume` 清单里不会出现这次提交。
|
|
6
|
+
* 铸点之后剩下的拒,判据都要读状态 —— 会话行与它的放置、店里的内容、装配器自己装配的事实(锁集、数据根、店的接线)、热应用的模型面、主体的中心裁定、在飞状态、引擎 ——
|
|
7
|
+
* 由提交出口(`submission-exit.ts`)在终局应答之前条件撤回收场。两类不交,也没有第三类。
|
|
8
|
+
*
|
|
9
|
+
* 分类的单位是**拒绝点**(一处拒与守着它的判据),只看判据的输入,不看它今天住在哪一段。本文件的判官在铸点之前答过,装配器(`boot/resolve-spec.ts`)对同一只判官的复判读同一份输入
|
|
10
|
+
* (受理门交给装配器的那一份体 · 同一只 `ServiceConfig` 的不变字段 · 按请求记忆化的主体),答同一个结论 —— 那一读是续跑重放腿与直调嵌入方的门(它们不经受理漏斗),
|
|
11
|
+
* 在 HTTP 新提交腿上恒不拒。
|
|
12
|
+
*
|
|
13
|
+
* 句与码的唯一属主是各判官;本文件把装配器里原先内联的几只判(`inheritEnv` 的车道与射程、工具名清单读成空、附件句柄形、写容纳面、镜像档 × 车道)收成导出函数,
|
|
14
|
+
* 装配器与受理门同调;规则表的那一判与存量体重放预判共用一只组合(`http/stored-body-replay.ts` 的 `ruleTablesRefusalWithoutTaskRoot`)。
|
|
15
|
+
*/
|
|
16
|
+
import type { IncomingMessage } from "node:http";
|
|
17
|
+
import { type TaskHostPostureScope, type TaskWriteFaceInput } from "./hosted-posture.js";
|
|
18
|
+
import { type ToolListSide } from "./rule-entry-list.js";
|
|
19
|
+
import { type Scenario } from "./owner-brands.js";
|
|
20
|
+
import type { PermissionMode } from "@sema-agent/core";
|
|
21
|
+
import type { ServiceConfig } from "./config-types.js";
|
|
22
|
+
import type { TaskRequestBody } from "./http/wire-types.js";
|
|
23
|
+
/**
|
|
24
|
+
* 一次提交请求的场景名从哪来(唯一读法):带场景头 ⇒ 头就是本请求的场景(分区与工具面同一个场景);体再给一个不同的 ⇒ 400 `scenario_conflict`
|
|
25
|
+
* (只在提交腿:读面没有体)。没带头 ⇒ 体原样(缺席 ⇒ 门走指派链)。
|
|
26
|
+
*/
|
|
27
|
+
export declare function scenarioRequestedBy(headerScenario: Scenario | undefined, bodyScenario: unknown): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* `inheritEnv:"all"` 的车道与射程两判(值形判在 `request-value-closure.ts` 的 `inheritEnvFieldIssue`,先于本函数):只有 host 车道消费这一位 ⇒ 别的车道 400 + 机读位
|
|
30
|
+
* `reason: lane_not_host`;射程读写容纳面那一只谓词(`hosted-posture.ts` 腿④)⇒ 托管 422 `request.host_posture_refused`。`"scrub"` 是缺省,任何车道受理。
|
|
31
|
+
*/
|
|
32
|
+
export declare function assertInheritEnvServed(body: {
|
|
33
|
+
readonly inheritEnv?: unknown;
|
|
34
|
+
}, config: TaskHostPostureScope): void;
|
|
35
|
+
/** 工具名清单里读成空的条目 ⇒ 400(判与句的属主 = `rule-entry-list.ts` `inertToolListEntryOf`;`sides` 缺省 = 两个方向都判,续跑腿只判限制方向)。 */
|
|
36
|
+
export declare function assertToolListsReadable(body: unknown, sides?: readonly ToolListSide[]): void;
|
|
37
|
+
/** 体 `attachmentIds` 的形:在场就必须是至多 16 只、每只 1–64 字符的串(只判形;句柄在不在、绑不绑得上读附件店,在装配器的绑定核)。 */
|
|
38
|
+
export declare function assertAttachmentIdsShape(raw: unknown): void;
|
|
39
|
+
/** 任务层「掀开写围栏」的模式词 × 部署天花板(判据与拒因属主 `hosted-posture.ts`)⇒ 422 `request.host_posture_refused`。 */
|
|
40
|
+
export declare function assertWriteFaceAdmitted(mode: PermissionMode | undefined, config: TaskWriteFaceInput): void;
|
|
41
|
+
/**
|
|
42
|
+
* 体点名的每任务镜像档 × 本部署的执行车道:车道不是 k8s ⇒ 501 `capability.k8s_lane_required`(这台部署接不了每任务镜像,换部署形态才行)。
|
|
43
|
+
* 装配器判的是**生效**的那一档(体给的 ∨ 会话绑定的);体给了档时会话绑定不读 ⇒ 这一判只读请求与车道,受理门在铸点之前判体那一档。
|
|
44
|
+
*/
|
|
45
|
+
export declare function assertImageProfileLane(profile: string | undefined, config: TaskHostPostureScope): void;
|
|
46
|
+
/** 体上的每任务镜像档(非空串;形在受理门的值形门判过 —— 与装配器同一读法)。 */
|
|
47
|
+
export declare function bodyImageProfileOf(body: {
|
|
48
|
+
readonly sandboxImageProfile?: unknown;
|
|
49
|
+
}): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* **新提交的请求形判,铸点之前一次答完**(受理漏斗在值形门之后、授权器之前调;抛 `HttpError`,与装配器的同名判同句同码)。
|
|
52
|
+
* `body` = 受理门盖过入口模式章的那一份(装配器拿到的就是它)。序 = 装配器里这些判的序(一份体同时撞上两只时,先答的与修前同一只):
|
|
53
|
+
* 主体(场景头的三判)→ MCP 条目 → `inheritEnv` 车道 / 射程 → 工具名清单 → A2A 条目(超 32 条整份拒)→ `images` → 场景头 × 体 → `attachmentIds` 形 → 写容纳面 →
|
|
54
|
+
* 规则表里不靠任务根的拒(三桶 → `neverAuto`)→ 体点名的镜像档 × 车道。
|
|
55
|
+
* 不在这里的:装配器自己装配的事实(运维锁集、数据根、店的接线)、热应用的模型面(目录 / 名单 / 拒因表)、会话 / 店 / 中心 / 在飞 / 引擎 —— 那些判在铸点之后,拒走条件撤回。
|
|
56
|
+
*/
|
|
57
|
+
export declare function assertRequestFormBeforeMint(body: TaskRequestBody, req: IncomingMessage, config: ServiceConfig): void;
|
|
58
|
+
//# sourceMappingURL=request-form.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { effectivePermissionMode, parseTaskSettings } from "./task-settings.js";
|
|
2
|
+
import { HOST_POSTURE_REFUSED_CODE, permissionModeWriteFaceRefusal, taskInheritEnvRefusal } from "./hosted-posture.js";
|
|
3
|
+
import { HttpError, createCodedHttpError, verifiedSubject } from "./security.js";
|
|
4
|
+
import { inheritEnvFacts } from "./request-value-closure.js";
|
|
5
|
+
import { inertToolListEntryOf } from "./rule-entry-list.js";
|
|
6
|
+
import { ruleTablesRefusalWithoutTaskRoot } from "./http/stored-body-replay.js";
|
|
7
|
+
import { assertRequestMcpEntries } from "./task-mcp.js";
|
|
8
|
+
import { assertRequestA2aEntries, snapshotRequestA2a } from "./task-a2a.js";
|
|
9
|
+
import { assertRequestImages } from "./request-images.js";
|
|
10
|
+
import { partsOf } from "./owner-brands.js";
|
|
11
|
+
export function scenarioRequestedBy(headerScenario, bodyScenario) {
|
|
12
|
+
if (headerScenario === undefined)
|
|
13
|
+
return bodyScenario;
|
|
14
|
+
if (bodyScenario !== undefined && bodyScenario !== headerScenario) {
|
|
15
|
+
throw createCodedHttpError(400, "scenario_conflict", `the request body names scenario ${JSON.stringify(String(bodyScenario))} but the x-agent-scenario header names ${JSON.stringify(headerScenario)} — send one scenario (the header alone selects both the partition and the scenario)`);
|
|
16
|
+
}
|
|
17
|
+
return headerScenario;
|
|
18
|
+
}
|
|
19
|
+
export function assertInheritEnvServed(body, config) {
|
|
20
|
+
if (body.inheritEnv !== "all")
|
|
21
|
+
return;
|
|
22
|
+
const lane = config.remoteExec.provider;
|
|
23
|
+
if (lane !== "host") {
|
|
24
|
+
throw new HttpError(400, `inheritEnv:"all" applies to the host lane only (this deployment runs ${lane}) — only the host lane builds the model-driven shell's environment from this machine's own, so the declaration has no effect here; omit it (or send "scrub", the default, which every lane accepts)`, { code: "request.field_invalid", extra: inheritEnvFacts("lane_not_host") });
|
|
25
|
+
}
|
|
26
|
+
const why = taskInheritEnvRefusal(config);
|
|
27
|
+
if (why !== undefined)
|
|
28
|
+
throw new HttpError(422, why, { code: HOST_POSTURE_REFUSED_CODE });
|
|
29
|
+
}
|
|
30
|
+
export function assertToolListsReadable(body, sides) {
|
|
31
|
+
const inert = inertToolListEntryOf(body, sides);
|
|
32
|
+
if (inert !== undefined)
|
|
33
|
+
throw new HttpError(400, inert.message, { code: inert.code, ...(inert.extra !== undefined ? { extra: { ...inert.extra } } : {}) });
|
|
34
|
+
}
|
|
35
|
+
export function assertAttachmentIdsShape(raw) {
|
|
36
|
+
if (raw === undefined)
|
|
37
|
+
return;
|
|
38
|
+
if (!Array.isArray(raw) || !raw.every((x) => typeof x === "string" && x.length > 0 && x.length <= 64)) {
|
|
39
|
+
throw new HttpError(400, "`attachmentIds` must be an array of attachment ids (strings)");
|
|
40
|
+
}
|
|
41
|
+
if (raw.length > 16)
|
|
42
|
+
throw new HttpError(400, "`attachmentIds` exceeds the per-task limit (16)");
|
|
43
|
+
}
|
|
44
|
+
export function assertWriteFaceAdmitted(mode, config) {
|
|
45
|
+
const why = permissionModeWriteFaceRefusal(mode, config);
|
|
46
|
+
if (why !== undefined)
|
|
47
|
+
throw new HttpError(422, why, { code: HOST_POSTURE_REFUSED_CODE });
|
|
48
|
+
}
|
|
49
|
+
export function assertImageProfileLane(profile, config) {
|
|
50
|
+
if (profile !== undefined && config.remoteExec.provider !== "k8s") {
|
|
51
|
+
throw createCodedHttpError(501, "capability.k8s_lane_required", "sandboxImageProfile is only supported on the k8s sandbox backend");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function bodyImageProfileOf(body) {
|
|
55
|
+
return typeof body.sandboxImageProfile === "string" && body.sandboxImageProfile.length > 0 ? body.sandboxImageProfile : undefined;
|
|
56
|
+
}
|
|
57
|
+
export function assertRequestFormBeforeMint(body, req, config) {
|
|
58
|
+
const subject = verifiedSubject(req, config);
|
|
59
|
+
assertRequestMcpEntries(body.mcpServers);
|
|
60
|
+
assertInheritEnvServed(body, config);
|
|
61
|
+
assertToolListsReadable(body);
|
|
62
|
+
assertRequestA2aEntries(snapshotRequestA2a(body.a2aPeers, { reread: false }));
|
|
63
|
+
assertRequestImages(body.images);
|
|
64
|
+
scenarioRequestedBy(subject === undefined ? undefined : partsOf(subject).scenario, body.scenario);
|
|
65
|
+
assertAttachmentIdsShape(body.attachmentIds);
|
|
66
|
+
assertWriteFaceAdmitted(effectivePermissionMode(body, parseTaskSettings(body.settings).settings), config);
|
|
67
|
+
const ruleTables = ruleTablesRefusalWithoutTaskRoot(body, config);
|
|
68
|
+
if (ruleTables !== undefined)
|
|
69
|
+
throw new HttpError(422, ruleTables.message, { code: ruleTables.code, ...(ruleTables.extra !== undefined ? { extra: { ...ruleTables.extra } } : {}) });
|
|
70
|
+
assertImageProfileLane(bodyImageProfileOf(body), config);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=request-form.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { type UrlCredentialRefusal } from "./url-credential-refusal.js";
|
|
1
|
+
import { type UrlCredentialFacts, type UrlCredentialRefusal } from "./url-credential-refusal.js";
|
|
2
|
+
/** 本座的拒:URL 凭据座的整句 + 机读位,机读位另带 `index`(条目在 `images` 里的下标)—— 与 `request-declaration-refusal.ts` 骨架上条目级拒的 `index` 同一个键、同一个意思,一份 `images` 的所有条目级拒同形。 */
|
|
3
|
+
export interface ImageUrlRefusal extends UrlCredentialRefusal {
|
|
4
|
+
readonly facts: UrlCredentialFacts & {
|
|
5
|
+
readonly index: number;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
2
8
|
/** 请求体 `images` 的 URL 座:任一条目的串值 `url` 带凭据 ⇒ 拒(整句 + 机读位),列表序第一处即答;没有 ⇒ `undefined`。`images` 不是数组 / 缺席 ⇒ `undefined`(形归受理口别的门)。 */
|
|
3
|
-
export declare function requestImageUrlRefusal(images: unknown):
|
|
9
|
+
export declare function requestImageUrlRefusal(images: unknown): ImageUrlRefusal | undefined;
|
|
4
10
|
/** fresh 提交腿的 `images` URL 门:{@link requestImageUrlRefusal} 有答案 ⇒ 同步 400(码 / 句 / 机读位原样)。 */
|
|
5
11
|
export declare function assertRequestImageUrls(bodyImages: unknown): void;
|
|
6
12
|
//# sourceMappingURL=request-image-urls.d.ts.map
|
|
@@ -15,7 +15,8 @@ export function requestImageUrlRefusal(images) {
|
|
|
15
15
|
if (found === undefined)
|
|
16
16
|
continue;
|
|
17
17
|
const at = `images[${i}]`;
|
|
18
|
-
|
|
18
|
+
const refusal = buildRequestUrlCredentialRefusal(`${at}.url`, found, inlineImageExit(at));
|
|
19
|
+
return { message: refusal.message, facts: { ...refusal.facts, index: i } };
|
|
19
20
|
}
|
|
20
21
|
return undefined;
|
|
21
22
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type DeclarationRefusal } from "./request-declaration-refusal.js";
|
|
2
|
+
/** 一次提交最多带几张图(条数帽;受理口的 `413 request.payload_too_large` 与本座骨架的撞帽拒读这一个数)。 */
|
|
3
|
+
export declare const MAX_IMAGES_PER_REQUEST = 20;
|
|
4
|
+
/** 内联字节臂的受理键(书写序即判序)。两道编译格对引擎的 `ImageInput`:引擎长出 / 退役一个键而本表没跟 ⇒ 红。 */
|
|
5
|
+
export declare const IMAGE_INLINE_KEYS: readonly ["data", "mimeType"];
|
|
6
|
+
/** URL 臂的受理键。同上两道编译格。 */
|
|
7
|
+
export declare const IMAGE_URL_KEYS: readonly ["url"];
|
|
8
|
+
/** 请求体 `images`「这份声明能不能原样交给引擎」的回答者(骨架同形):`undefined` = 能(或缺席 / `null` = 没带图)。 */
|
|
9
|
+
export declare function requestImagesRefusal(images: unknown): DeclarationRefusal | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* fresh 提交腿的 `images` 门(`boot/resolve-spec.ts`):先形(骨架的拒,码 / 句 / `unknownKeys` / 机读位原样),后 URL 凭据座({@link assertRequestImageUrls})。
|
|
12
|
+
* 形坏的 `images` 走不到凭据座 —— 凭据座读的是形已判过的条目。
|
|
13
|
+
*/
|
|
14
|
+
export declare function assertRequestImages(bodyImages: unknown): void;
|
|
15
|
+
/**
|
|
16
|
+
* 一条图片的内联字节(`data` 是串才有;条目不是对象 / 没有 `data` / 不是串 ⇒ `undefined`)。受理口的内联字节帽读它,**不自己摸条目**:帽排在形判之前,条目可能是 `null`。
|
|
17
|
+
* 条目形坏不是帽的事 —— 形判在后头答。
|
|
18
|
+
*/
|
|
19
|
+
export declare function inlineImageData(image: unknown): string | undefined;
|
|
20
|
+
//# sourceMappingURL=request-images.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describeValueShape } from "@sema-agent/settings-schema";
|
|
2
|
+
import { assertRequestImageUrls } from "./request-image-urls.js";
|
|
3
|
+
import { MAX_KEY_ECHO, keyClosureClause, scanKeyNames } from "./request-key-closure.js";
|
|
4
|
+
import { judgeDeclarationKeys, requestDeclarationRefusal, throwDeclarationRefusal } from "./request-declaration-refusal.js";
|
|
5
|
+
export const MAX_IMAGES_PER_REQUEST = 20;
|
|
6
|
+
export const IMAGE_INLINE_KEYS = ["data", "mimeType"];
|
|
7
|
+
export const IMAGE_URL_KEYS = ["url"];
|
|
8
|
+
const IMAGES_SEAT = {
|
|
9
|
+
list: "images",
|
|
10
|
+
cap: MAX_IMAGES_PER_REQUEST,
|
|
11
|
+
identify: () => "",
|
|
12
|
+
entryTail: "The request is refused rather than handing the engine an image it cannot read: an image that silently did not apply would leave the model answering without what you attached. " +
|
|
13
|
+
"Fix the entry (an image is either { data, mimeType } or { url }).",
|
|
14
|
+
declaration: "an image entry",
|
|
15
|
+
declarations: "image entries",
|
|
16
|
+
};
|
|
17
|
+
function mustBeString(key, what) {
|
|
18
|
+
return (entry) => (typeof entry[key] === "string" ? undefined : { path: key, reason: `must be a string (${what}) — got ${describeValueShape(entry[key])}` });
|
|
19
|
+
}
|
|
20
|
+
const INLINE_KEY_JUDGES = {
|
|
21
|
+
data: mustBeString("data", "the base64-encoded image bytes"),
|
|
22
|
+
mimeType: mustBeString("mimeType", 'an image MIME type such as "image/png"'),
|
|
23
|
+
};
|
|
24
|
+
const URL_KEY_JUDGES = {
|
|
25
|
+
url: mustBeString("url", "the URL the engine fetches the image from"),
|
|
26
|
+
};
|
|
27
|
+
const INLINE_KEY_SET = new Set(IMAGE_INLINE_KEYS);
|
|
28
|
+
const URL_KEY_SET = new Set(IMAGE_URL_KEYS);
|
|
29
|
+
const NO_TOLERATED_KEYS = new Set();
|
|
30
|
+
function imageEntryRefusal(entry, at) {
|
|
31
|
+
const urlArm = "url" in entry;
|
|
32
|
+
const buckets = { unknown: [], unsupported: [] };
|
|
33
|
+
scanKeyNames(Object.keys(entry), `${at}.`, urlArm ? URL_KEY_SET : INLINE_KEY_SET, NO_TOLERATED_KEYS, buckets);
|
|
34
|
+
if (buckets.unknown.length > 0) {
|
|
35
|
+
const unknownKeys = buckets.unknown.sort();
|
|
36
|
+
return {
|
|
37
|
+
errorCode: "request.body_shape",
|
|
38
|
+
message: `body: unrecognized key(s) on an image entry — refused rather than dropped, because a dropped key reads as "in effect" to the caller. ` +
|
|
39
|
+
`${keyClosureClause(unknownKeys, `unknown (not a key of the ${urlArm ? "url" : "inline-bytes"} form — check the spelling; an image is either { data, mimeType } or { url }, never both)`)}. ` +
|
|
40
|
+
`Accepted: ${[...(urlArm ? IMAGE_URL_KEYS : IMAGE_INLINE_KEYS)].join(",")}`,
|
|
41
|
+
unknownKeys: unknownKeys.slice(0, MAX_KEY_ECHO),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return urlArm ? judgeDeclarationKeys(IMAGES_SEAT, entry, at, IMAGE_URL_KEYS, URL_KEY_JUDGES) : judgeDeclarationKeys(IMAGES_SEAT, entry, at, IMAGE_INLINE_KEYS, INLINE_KEY_JUDGES);
|
|
45
|
+
}
|
|
46
|
+
export function requestImagesRefusal(images) {
|
|
47
|
+
return requestDeclarationRefusal(IMAGES_SEAT, images, imageEntryRefusal);
|
|
48
|
+
}
|
|
49
|
+
export function assertRequestImages(bodyImages) {
|
|
50
|
+
throwDeclarationRefusal(requestImagesRefusal(bodyImages));
|
|
51
|
+
assertRequestImageUrls(bodyImages);
|
|
52
|
+
}
|
|
53
|
+
export function inlineImageData(image) {
|
|
54
|
+
if (image === null || typeof image !== "object")
|
|
55
|
+
return undefined;
|
|
56
|
+
const data = image.data;
|
|
57
|
+
return typeof data === "string" ? data : undefined;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=request-images.js.map
|
|
@@ -46,7 +46,6 @@ export type NamedKeysOf<T> = {
|
|
|
46
46
|
export declare function taskBodyKeyIssue(raw: unknown): KeyClosureIssue | null;
|
|
47
47
|
declare const RUN_STEER_BODY_KEYS: readonly ["mode", "priority", "text"];
|
|
48
48
|
declare const CONTENT_STEER_BODY_KEYS: readonly ["content"];
|
|
49
|
-
declare const INTERRUPT_STEER_BODY_KEYS: readonly ["text"];
|
|
50
49
|
/** `POST /v1/runs/:id/steer` 的体形(键 = 受理集,值形由路由逐键判)。 */
|
|
51
50
|
export type RunSteerBody = {
|
|
52
51
|
readonly [K in (typeof RUN_STEER_BODY_KEYS)[number]]?: unknown;
|
|
@@ -55,14 +54,14 @@ export type RunSteerBody = {
|
|
|
55
54
|
export type ContentSteerBody = {
|
|
56
55
|
readonly [K in (typeof CONTENT_STEER_BODY_KEYS)[number]]?: unknown;
|
|
57
56
|
};
|
|
58
|
-
/**
|
|
59
|
-
export type
|
|
60
|
-
readonly [K in (typeof INTERRUPT_STEER_BODY_KEYS)[number]]?: unknown;
|
|
61
|
-
};
|
|
62
|
-
/** 送话口的体形(闭集;词外是编译错)。`interrupt` = `POST /v1/runs/:id/interrupt` 整扇门(bare 与带 `text` 两形同一张受理集)。 */
|
|
63
|
-
export type SteerBodyForm = "run" | "content" | "interrupt";
|
|
57
|
+
/** 送话口的体形(闭集;词外是编译错)。 */
|
|
58
|
+
export type SteerBodyForm = "run" | "content";
|
|
64
59
|
/** 送话口的顶层键裁决(各形同一只;`form` 选受理集)。 */
|
|
65
60
|
export declare function steerBodyKeyIssue(raw: unknown, form: SteerBodyForm): KeyClosureIssue | null;
|
|
61
|
+
/** halt 门的拒句(定长;对每一种非空体同一句)。 */
|
|
62
|
+
export declare const HALT_BODY_REFUSAL: string;
|
|
63
|
+
/** halt 门的体判:空体(`undefined` / `null` / 零键对象)⇒ `null`;其余 ⇒ 拒体(键全进 `unknownKeys`,封顶同 {@link MAX_KEY_ECHO})。 */
|
|
64
|
+
export declare function haltBodyIssue(raw: unknown): KeyClosureIssue | null;
|
|
66
65
|
declare const PRINCIPAL_INBOX_BODY_KEYS: readonly ["to", "content", "urgent"];
|
|
67
66
|
/** 受理口的体形(键 = 受理集,值形由路由逐键判)。 */
|
|
68
67
|
export type PrincipalInboxBody = {
|
|
@@ -68,11 +68,9 @@ export function taskBodyKeyIssue(raw) {
|
|
|
68
68
|
}
|
|
69
69
|
const RUN_STEER_BODY_KEYS = ["mode", "priority", "text"];
|
|
70
70
|
const CONTENT_STEER_BODY_KEYS = ["content"];
|
|
71
|
-
const INTERRUPT_STEER_BODY_KEYS = ["text"];
|
|
72
71
|
const STEER_DOORS = {
|
|
73
72
|
run: { accepted: new Set(RUN_STEER_BODY_KEYS), door: "a steer-request" },
|
|
74
73
|
content: { accepted: new Set(CONTENT_STEER_BODY_KEYS), door: "a steer-request" },
|
|
75
|
-
interrupt: { accepted: new Set(INTERRUPT_STEER_BODY_KEYS), door: "an interrupt-request" },
|
|
76
74
|
};
|
|
77
75
|
const STEER_UNSUPPORTED = {
|
|
78
76
|
keys: new Set([...UNSUPPORTED_BODY_KEYS, ...OBJECTIVE_ONLY_BODY_KEYS]),
|
|
@@ -81,6 +79,21 @@ const STEER_UNSUPPORTED = {
|
|
|
81
79
|
export function steerBodyKeyIssue(raw, form) {
|
|
82
80
|
return closedBodyKeyIssue(raw, STEER_DOORS[form].accepted, STEER_UNSUPPORTED, STEER_DOORS[form].door);
|
|
83
81
|
}
|
|
82
|
+
export const HALT_BODY_REFUSAL = "body must be empty (no body, {} or null): this door is halt — it cuts the in-flight turn and stops the run at that boundary — and takes no fields; " +
|
|
83
|
+
'to send the run a message, POST /v1/runs/:id/steer with priority:"now" (it cuts the in-flight turn first, then the run continues with that message)';
|
|
84
|
+
const NO_FIELDS = new Set();
|
|
85
|
+
export function haltBodyIssue(raw) {
|
|
86
|
+
if (raw === null || raw === undefined)
|
|
87
|
+
return null;
|
|
88
|
+
if (typeof raw !== "object" || Array.isArray(raw))
|
|
89
|
+
return { message: HALT_BODY_REFUSAL, unknownKeys: [], unsupportedKeys: [] };
|
|
90
|
+
const buckets = { unknown: [], unsupported: [] };
|
|
91
|
+
scanKeyClosure(raw, "", NO_FIELDS, NO_FIELDS, buckets);
|
|
92
|
+
if (buckets.unknown.length === 0)
|
|
93
|
+
return null;
|
|
94
|
+
buckets.unknown.sort();
|
|
95
|
+
return { message: HALT_BODY_REFUSAL, unknownKeys: buckets.unknown.slice(0, MAX_KEY_ECHO), unsupportedKeys: [] };
|
|
96
|
+
}
|
|
84
97
|
const PRINCIPAL_INBOX_BODY_KEYS = ["to", "content", "urgent"];
|
|
85
98
|
const PRINCIPAL_INBOX_UNSUPPORTED = { keys: new Set(), label: "unsupported" };
|
|
86
99
|
export function principalInboxBodyKeyIssue(raw) {
|
|
@@ -119,17 +119,17 @@ export type TaskInheritEnv = (typeof INHERIT_ENV_WORDS)[number];
|
|
|
119
119
|
export declare const INHERIT_ENV_VALUE_MESSAGE: string;
|
|
120
120
|
/**
|
|
121
121
|
* `inheritEnv` 的 `request.field_invalid` 400 的机读 `reason`([ref];闭集,**一种拒因一个词**,读者穷举读)—— 拒体另带 `field: "inheritEnv"` 与它,
|
|
122
|
-
* 壳靠这两位认「这条 400 真是 `inheritEnv`
|
|
122
|
+
* 壳靠这两位认「这条 400 真是 `inheritEnv` 的」,不猜句子。同一个键的**两类** 400(值形 / 车道)是一类,词表一张:
|
|
123
123
|
* · `unknown_word` —— 值形:是字符串,但不在受理词表(`"ALL"` · `"everything"` · `""`);
|
|
124
124
|
* · `not_a_string` —— 值形:根本不是字符串(名单形 `string[]` · 布尔 · 数字 · `null` · 对象);
|
|
125
|
-
* · `lane_not_host` —— `"all"` 落在非 host 车道(只有 host 工厂消费这一位,别的车道没有消费点)
|
|
126
|
-
*
|
|
127
|
-
*
|
|
125
|
+
* · `lane_not_host` —— `"all"` 落在非 host 车道(只有 host 工厂消费这一位,别的车道没有消费点)。
|
|
126
|
+
* 前两词的判官是 {@link inheritEnvFieldIssue}(只看体);`lane_not_host` 的判官在 `boot/resolve-spec.ts`(要读部署事实,两腿同过)。
|
|
127
|
+
* 没有「无会话」一词:绑定按会话键控,而一次提交的根会话由 authorizer 必填席解析、经执行上下文交进装配器(根恒在),不存在「部署不接 authorizer」的形。
|
|
128
128
|
* 不在这组的:`422 request.host_posture_refused`(托管部署不兑现 `"all"`)—— 那不是这个键的值写错,而是部署姿态拒,码与写容纳面那条腿共用,按 `errorCode` 认(契约 §18)。
|
|
129
129
|
* 加一种拒因 ⇒ 这里加一个词(并在判官处给它一个分支);词与因一一对应,没有一因两词、也没有一词两因。
|
|
130
130
|
* 词的铸点只有 {@link inheritEnvFacts} 一处:受理门与 resolveSpec 只经它出机读位,不手拼 `field` / `reason`。
|
|
131
131
|
*/
|
|
132
|
-
export declare const INHERIT_ENV_REFUSAL_REASONS: readonly ["unknown_word", "not_a_string", "lane_not_host"
|
|
132
|
+
export declare const INHERIT_ENV_REFUSAL_REASONS: readonly ["unknown_word", "not_a_string", "lane_not_host"];
|
|
133
133
|
export type InheritEnvRefusalReason = (typeof INHERIT_ENV_REFUSAL_REASONS)[number];
|
|
134
134
|
/** 拒体上的机读位(加性键:直接当 `request.field_invalid` 的附加键用;型别名而不是接口 —— 要能直接当 `Record<string, unknown>` 用)。 */
|
|
135
135
|
export type InheritEnvFacts = {
|
|
@@ -35,7 +35,7 @@ export const INHERIT_ENV_WORDS = ["all", "scrub"];
|
|
|
35
35
|
export const INHERIT_ENV_VALUE_MESSAGE = `inheritEnv must be one of ${INHERIT_ENV_WORDS.map((w) => JSON.stringify(w)).join(" | ")} when present ` +
|
|
36
36
|
`("all" = the model-driven host shell inherits this machine's whole environment except this deployment's own credentials (its configuration directory's secret-typed names), honored only on a single-user host-lane deployment; ` +
|
|
37
37
|
`"scrub" = the default scrub of credential-shaped variables, accepted on every lane; absent = "scrub") — a name list is not a request value`;
|
|
38
|
-
export const INHERIT_ENV_REFUSAL_REASONS = ["unknown_word", "not_a_string", "lane_not_host"
|
|
38
|
+
export const INHERIT_ENV_REFUSAL_REASONS = ["unknown_word", "not_a_string", "lane_not_host"];
|
|
39
39
|
export function inheritEnvFacts(reason) {
|
|
40
40
|
return { field: "inheritEnv", reason };
|
|
41
41
|
}
|
|
@@ -5,28 +5,19 @@
|
|
|
5
5
|
* task opts in, a budget/turns/walltime limit OR a scheduler preempt durably SUSPENDS the task (resumable via
|
|
6
6
|
* `POST /v1/assistant/tasks/:id/resume`) instead of FAILING; absent ⇒ a limit still FAILS.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* (Cross review wtyc7ist3 HIGH finding: without this, enabling RESOURCE_SUSPEND leaks a suspended VM + checkpoint on every
|
|
16
|
-
* cascade task that hits a resource limit.) The arm is the judge's session cell seen from the opt-in side: the day the engine
|
|
17
|
-
* lets a rung's pause land on a session the host's resume chain reaches (core [ref]), the judge's answer flips and this arm goes.
|
|
18
|
-
* Every other task — a verify task included — opts in alike. A verify task's implementation leg and fix rounds run on the
|
|
19
|
-
* run's own session, so the judge lifts their pause into a park of the run row (resumable through
|
|
20
|
-
* `POST /v1/assistant/tasks/:id/resume`); the verifier's own leg is built by the engine without an opt-in, so a limit there
|
|
21
|
-
* still fails that leg.
|
|
8
|
+
* Every task opts in alike — plain, verify and cascade. A limit hit inside a composition comes back to the host as a nested
|
|
9
|
+
* pause (`failed.nestedPause`, core `mapNestedSuspend`), which the host-boundary judge (`atHostBoundary`, src/terminal.ts) lifts
|
|
10
|
+
* into a park of the run row: the card is filed under the run's session (`checkpoint.host_session_id` — a verify task's
|
|
11
|
+
* implementation leg and fix rounds run on that session; a cascade rung's card records its composition leg, whose host
|
|
12
|
+
* session is the run's), so `POST /v1/assistant/tasks/:id/resume` finds it from the run and continues it through the same
|
|
13
|
+
* composition entry the run was submitted with (`resumeWithVerification` / `resumeCascade`). The verifier's own leg is built by
|
|
14
|
+
* the engine without an opt-in, so a limit there still fails that leg.
|
|
22
15
|
*/
|
|
23
16
|
export declare function resourceSuspendOptIn(opts: {
|
|
24
17
|
/** `RESOURCE_SUSPEND=true` (the worker-level switch). */
|
|
25
18
|
enabled: boolean;
|
|
26
19
|
/** `RESOURCE_SUSPEND_TTL_SEC` — 0 ⇒ core default (30d) by omitting `ttlMs`. */
|
|
27
20
|
ttlSec: number;
|
|
28
|
-
/** This task requested the cascade ladder (`body.cascade === true`). */
|
|
29
|
-
isCascade: boolean;
|
|
30
21
|
/** Multi-tenant isolation key — the SAME key durableApproval uses (the principal; "_" when auth is off). */
|
|
31
22
|
scope: string;
|
|
32
23
|
/** [ref] S-3:`RESOURCE_SUSPEND_TOTAL_TOKENS`(跨片 token 总额)。0/缺省 ⇒ 不铸键。 */
|
package/dist/resource-suspend.js
CHANGED