@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
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import type { TaskNotificationPayload, SemaProvenance, BackgroundChildEvent, RosterEntry, AskRequest, CheckpointSummary, PendingAction, TaskEvent, TraceEvent, MailboxMessage, MailboxAppendMessage, TaskSpec, TaskResult, SideQueryResult, WiringManifest, PermissionModeReceipt, GateOutcome, GateDisposition, Settlement, PausedCause, TerminalCause, CheckpointGate, CheckpointToken, VerificationResult, CascadeRunResult, WorkflowRun, ReadRootGrantCandidate, McpReconnectResult, McpServerStatus, NodeLspManagerOptions, RunnerDeps, SessionMemoryStatus, DeploymentSessionMemoryStatus, PromptManifestIdentity, PromptIdentityLayers, PromptManifestSelectors, PromptManifestSection, PromptChainLink, SupersededOverlay, ToolDisclosureManifest } from "@sema-agent/core";
|
|
21
21
|
import type { ToolApprovalFrame } from "../tool-approval.js";
|
|
22
22
|
import type { TableCoreKeys } from "./projection-table.js";
|
|
23
|
+
import type { ProjectRegistration } from "@sema-agent/settings-schema";
|
|
23
24
|
import type { PauseSeat } from "../terminal.js";
|
|
24
25
|
/** 编译期断言:T 必须收敛到 never(有残余键 = tsc 红)。
|
|
25
26
|
* 🔴 **导出**([ref] U1/U2):本仓「词表闭集,未处置成员=编译红」的钉法只许有**一个**形 ——
|
|
@@ -27,12 +28,12 @@ import type { PauseSeat } from "../terminal.js";
|
|
|
27
28
|
* `type X<T extends never> = T`(抄一份就是第二个写者,两处哪天分岔谁都发现不了)。
|
|
28
29
|
* 本文件只有类型、不产 JS,所以被 `import type` 引用不新增任何运行期边。 */
|
|
29
30
|
export type AssertAllKeysHandled<T extends never> = T;
|
|
30
|
-
type NotificationProjected = "task_id" | "task_type" | "toolUseId" | "status" | "summary" | "result" | "output_file" | "usage" | "sessionId" | "seq" | "lines" | "stoppedBy" | "source" | "exitCode" | "partial" | "diagnostics" | "recentSteps" | "editedFiles" | "resumable" | "completionId" | "error" | "errorCode" | "apiFailure" | "agentMessage" | "_sema_provenance" | "spawnName" | "handback" | "compaction" | "resupplied" | "attempt";
|
|
31
|
+
type NotificationProjected = "task_id" | "task_type" | "toolUseId" | "status" | "summary" | "result" | "output_file" | "usage" | "sessionId" | "seq" | "lines" | "stoppedBy" | "source" | "exitCode" | "partial" | "diagnostics" | "recentSteps" | "editedFiles" | "resumable" | "completionId" | "error" | "errorCode" | "apiFailure" | "agentMessage" | "_sema_provenance" | "spawnName" | "handback" | "compaction" | "resupplied" | "attempt" | "crossSessionMessage" | "crossSessionNotice" | "inboxNotice";
|
|
31
32
|
type NotificationExcluded = (typeof import("./wire-projection-faces.js").WIRE_PROJECTION_FACES)["task_notification"]["excluded"][number];
|
|
32
33
|
type _GuardNotification = AssertAllKeysHandled<Exclude<keyof TaskNotificationPayload, NotificationProjected | NotificationExcluded>>;
|
|
33
34
|
type _GuardNotificationReverse = AssertAllKeysHandled<Exclude<NotificationProjected | NotificationExcluded, keyof TaskNotificationPayload>>;
|
|
34
|
-
type ProvenanceProjected = "kind" | "from" | "taskId" | "seq" | "agentType";
|
|
35
|
-
type ProvenanceExcluded = "
|
|
35
|
+
type ProvenanceProjected = "kind" | "from" | "taskId" | "seq" | "agentType" | "peerMeta";
|
|
36
|
+
type ProvenanceExcluded = (typeof import("./wire-projection-faces.js").WIRE_PROJECTION_FACES)["task_notification_provenance"]["excluded"][number];
|
|
36
37
|
type _GuardProvenance = AssertAllKeysHandled<Exclude<keyof SemaProvenance, ProvenanceProjected | ProvenanceExcluded>>;
|
|
37
38
|
type _GuardProvenanceReverse = AssertAllKeysHandled<Exclude<ProvenanceProjected | ProvenanceExcluded, keyof SemaProvenance>>;
|
|
38
39
|
type AgentMessageProjected = "from" | "body";
|
|
@@ -66,10 +67,9 @@ type WiringSectionExcluded = (typeof import("./wire-projection-faces.js").WIRE_P
|
|
|
66
67
|
type _GuardWiringSections = AssertAllKeysHandled<Exclude<keyof WiringManifest, WiringSectionProjected | WiringSectionExcluded>>;
|
|
67
68
|
type _GuardWiringSectionsReverse = AssertAllKeysHandled<Exclude<WiringSectionProjected | WiringSectionExcluded, keyof WiringManifest>>;
|
|
68
69
|
type WiringSection<K extends keyof WiringManifest> = NonNullable<WiringManifest[K]>;
|
|
69
|
-
type WiringLegHandled = "kind";
|
|
70
|
-
type
|
|
71
|
-
type
|
|
72
|
-
type _GuardWiringLegReverse = AssertAllKeysHandled<Exclude<WiringLegHandled | WiringLegExcluded, keyof WiringSection<"leg">>>;
|
|
70
|
+
type WiringLegHandled = "kind" | "runOrigin";
|
|
71
|
+
type _GuardWiringLeg = AssertAllKeysHandled<Exclude<keyof WiringSection<"leg">, WiringLegHandled>>;
|
|
72
|
+
type _GuardWiringLegReverse = AssertAllKeysHandled<Exclude<WiringLegHandled, keyof WiringSection<"leg">>>;
|
|
73
73
|
type WiringModRowKeys = WiringSection<"mods">[number] extends infer R ? (R extends unknown ? keyof R : never) : never;
|
|
74
74
|
type WiringModRowHandled = "name" | "seat" | "tier" | "provenance" | "events" | "observe" | "skipped" | "refusedBy" | "reason";
|
|
75
75
|
type _GuardWiringModRow = AssertAllKeysHandled<Exclude<WiringModRowKeys, WiringModRowHandled>>;
|
|
@@ -217,8 +217,8 @@ type _GuardPromptManifestKeysReverse = AssertAllKeysHandled<{
|
|
|
217
217
|
type _GuardPromptManifestKeysNonEmpty = AssertAllKeysHandled<{
|
|
218
218
|
[L in keyof ManifestCore]: [ManifestDeclared<ManifestFaces, L>] extends [never] ? L : never;
|
|
219
219
|
}[keyof ManifestCore]>;
|
|
220
|
-
type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "boundGrantAbsence" | "checkpointId" | "rowVerdict";
|
|
221
|
-
type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceSessionId" | "agentId" | "approvalCard" | "restoreMode" | "previewWithheld" | "authoredBy" | "
|
|
220
|
+
type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "boundGrantAbsence" | "checkpointId" | "runOrigin" | "rowVerdict";
|
|
221
|
+
type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceSessionId" | "agentId" | "approvalCard" | "restoreMode" | "previewWithheld" | "authoredBy" | "requestedByCallId";
|
|
222
222
|
type _GuardInboxSummary = AssertAllKeysHandled<Exclude<keyof CheckpointSummary, SummaryProjected | SummaryExcluded>>;
|
|
223
223
|
type _GuardInboxSummaryReverse = AssertAllKeysHandled<Exclude<SummaryProjected | SummaryExcluded, keyof CheckpointSummary>>;
|
|
224
224
|
type ParkArmKeys = keyof Extract<PendingAction, {
|
|
@@ -482,6 +482,10 @@ type _GuardWorkflowRunStats = AssertAllKeysHandled<Exclude<keyof WorkflowRun["st
|
|
|
482
482
|
type _GuardWorkflowRunStatsReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_DISPOSITIONS"]>, keyof WorkflowRun["stats"]>>;
|
|
483
483
|
type _GuardWorkflowRunStatsNested = AssertAllKeysHandled<Exclude<keyof WorkflowRun["stats"]["nested"], TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_NESTED_DISPOSITIONS"]>>>;
|
|
484
484
|
type _GuardWorkflowRunStatsNestedReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_NESTED_DISPOSITIONS"]>, keyof WorkflowRun["stats"]["nested"]>>;
|
|
485
|
+
type _GuardWorkflowBudgetOvershoot = AssertAllKeysHandled<Exclude<keyof NonNullable<WorkflowRun["budgetOvershoot"]>, TableCoreKeys<WorkflowTables["WORKFLOW_BUDGET_OVERSHOOT_DISPOSITIONS"]>>>;
|
|
486
|
+
type _GuardWorkflowBudgetOvershootReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_BUDGET_OVERSHOOT_DISPOSITIONS"]>, keyof NonNullable<WorkflowRun["budgetOvershoot"]>>>;
|
|
487
|
+
type _GuardWorkflowTimeoutInterruption = AssertAllKeysHandled<Exclude<keyof NonNullable<WorkflowRun["timeoutInterruption"]>, TableCoreKeys<WorkflowTables["WORKFLOW_TIMEOUT_INTERRUPTION_DISPOSITIONS"]>>>;
|
|
488
|
+
type _GuardWorkflowTimeoutInterruptionReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_TIMEOUT_INTERRUPTION_DISPOSITIONS"]>, keyof NonNullable<WorkflowRun["timeoutInterruption"]>>>;
|
|
485
489
|
type ReadRootCandidateProjected = "dir" | "clearsThisAsk" | "covers";
|
|
486
490
|
type _GuardReadRootCandidate = AssertAllKeysHandled<Exclude<keyof ReadRootGrantCandidate, ReadRootCandidateProjected>>;
|
|
487
491
|
type _GuardReadRootCandidateReverse = AssertAllKeysHandled<Exclude<ReadRootCandidateProjected, keyof ReadRootGrantCandidate>>;
|
|
@@ -522,6 +526,9 @@ type WorkspaceChangedArm = Extract<TaskEvent, {
|
|
|
522
526
|
}>;
|
|
523
527
|
type _GuardSessionWorkspace = AssertAllKeysHandled<Exclude<keyof WorkspaceChangedArm, TableCoreKeys<SessionWorkspaceTables["SESSION_WORKSPACE_DISPOSITIONS"]>>>;
|
|
524
528
|
type _GuardSessionWorkspaceReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<SessionWorkspaceTables["SESSION_WORKSPACE_DISPOSITIONS"]>, keyof WorkspaceChangedArm>>;
|
|
529
|
+
type ProjectRegistryTables = typeof import("../http/routes/projects.js");
|
|
530
|
+
type _GuardProjectRow = AssertAllKeysHandled<Exclude<keyof ProjectRegistration, TableCoreKeys<ProjectRegistryTables["PROJECT_ROW_DISPOSITIONS"]>>>;
|
|
531
|
+
type _GuardProjectRowReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<ProjectRegistryTables["PROJECT_ROW_DISPOSITIONS"]>, keyof ProjectRegistration>>;
|
|
525
532
|
export type CoreKeysetGuards = [
|
|
526
533
|
_GuardNotification,
|
|
527
534
|
_GuardTerminalArm,
|
|
@@ -645,6 +652,10 @@ export type CoreKeysetGuards = [
|
|
|
645
652
|
_GuardWorkflowRunStatsReverse,
|
|
646
653
|
_GuardWorkflowRunStatsNested,
|
|
647
654
|
_GuardWorkflowRunStatsNestedReverse,
|
|
655
|
+
_GuardWorkflowBudgetOvershoot,
|
|
656
|
+
_GuardWorkflowBudgetOvershootReverse,
|
|
657
|
+
_GuardWorkflowTimeoutInterruption,
|
|
658
|
+
_GuardWorkflowTimeoutInterruptionReverse,
|
|
648
659
|
_GuardReadRootCandidate,
|
|
649
660
|
_GuardReadRootCandidateReverse,
|
|
650
661
|
_GuardRiskAxes,
|
|
@@ -668,6 +679,8 @@ export type CoreKeysetGuards = [
|
|
|
668
679
|
_GuardLedgerRunnerDepsReverse,
|
|
669
680
|
_GuardSessionWorkspace,
|
|
670
681
|
_GuardSessionWorkspaceReverse,
|
|
682
|
+
_GuardProjectRow,
|
|
683
|
+
_GuardProjectRowReverse,
|
|
671
684
|
_GuardTokenSeats,
|
|
672
685
|
_GuardTokenSeatsReverse,
|
|
673
686
|
_GuardGateSeats,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **本服务输出面逐字过境的 core 词表的登记处** —— wire 变更机器清单(`scripts/wire-changes-server.mjs`)的第五类源。
|
|
3
|
+
*
|
|
4
|
+
* ## 它治的病
|
|
5
|
+
* 有些 wire 值不是本服务铸的,也不是投影面表登记的键:本服务在自己的座上用 core 的闭集常量校验一个值、原样放上 wire
|
|
6
|
+
* (审批卡 `card_json` 的卡词 `approvalCard`、续跑起跑失败体的 `cause` …)。core 给这些常量加一个词,本服务的输出闭集就随之放宽 ——
|
|
7
|
+
* 对卡词写穷举 `switch` 的消费方会编译红;而清单的其余四类源(契约附录 / 面表 / 自铸登记表 / core 新键)都看不见这一层,清单零条。
|
|
8
|
+
*
|
|
9
|
+
* ## 一个事实一个来源
|
|
10
|
+
* **词只住在 core**:本表不抄任何一个词,只登记「哪只 core 词表逐字上了本服务的 wire、自哪一版起」。生成器从 core 随包的逐版清单
|
|
11
|
+
* (`node_modules/@sema-agent/core/wire-changes/core@<ver>.json` 的 `closedSetMembers`)读区间 (上一 tag 的钉, 本版的钉] 里这只词表的净增删,
|
|
12
|
+
* 记进本服务清单的 `added` / `removed` 与 `closedSetMembers`(集名 `coreVocab.<词表>`)。本表自身的增删按成员记(集名 `coreVocab`)。
|
|
13
|
+
*
|
|
14
|
+
* ## 表的形(一只词表一行)
|
|
15
|
+
* · 键 —— core 闭集的名字,与 core 清单 `closedSetMembers[].set` 同一拼写(= core 导出的运行期常量名);
|
|
16
|
+
* · `at` —— 它在本服务 wire 上的坐标(人读);
|
|
17
|
+
* · `site` —— 本服务按它校验 / 放行的那只模块(读点);
|
|
18
|
+
* · `since` —— 本服务 wire 上开始逐字带这只词表的版本(= 该常量首次出现在 `site` 模块里的那个 tag)。
|
|
19
|
+
*
|
|
20
|
+
* ## 绑定(派生,不手抄)
|
|
21
|
+
* `test/wire-changes-server.test.ts`「core 词表逐字过境」组:每个键都是 core 导出的字符串数组常量;每只 `site` 模块从 core 引入的
|
|
22
|
+
* 字符串数组常量 ≡ 本表 `site` 为它的那几行(两个方向:读点多引一只词表而本表没跟 ⇒ 红;本表多登一只读点不引的 ⇒ 红)。
|
|
23
|
+
* 经 core 谓词(`isAskOrigin` 一类)而不是常量读的词表、帧投影里随 core 型过境的值,不在本表的射程里(清单的已知缺口,见设计稿)。
|
|
24
|
+
*
|
|
25
|
+
* ⚠️ 纯数据:零 import(生成器在历史 ref 上把本文件转译求值)。
|
|
26
|
+
*/
|
|
27
|
+
/** 一只逐字过境的 core 词表的登记。 */
|
|
28
|
+
export interface CoreVocabWireEntry {
|
|
29
|
+
readonly at: string;
|
|
30
|
+
readonly site: string;
|
|
31
|
+
readonly since: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const CORE_VOCAB_WIRE: {
|
|
34
|
+
readonly ALLOW_RULE_MEMBERS: {
|
|
35
|
+
readonly at: "approval_request card(card_json)allow 层披露记录的 member";
|
|
36
|
+
readonly site: "src/approval-card.ts";
|
|
37
|
+
readonly since: "7.117.0";
|
|
38
|
+
};
|
|
39
|
+
readonly ASK_EVIDENCE_ABSENCE_VALUES: {
|
|
40
|
+
readonly at: "approval_request card(card_json)规则证据的 orgRevisionAbsent / orgRuleAbsent / personalRuleDotsAbsent";
|
|
41
|
+
readonly site: "src/approval-card.ts";
|
|
42
|
+
readonly since: "7.23.0";
|
|
43
|
+
};
|
|
44
|
+
readonly BOUND_GRANT_ABSENCES: {
|
|
45
|
+
readonly at: "approval_request 帧活面事实 boundGrantAbsence";
|
|
46
|
+
readonly site: "src/approval-card.ts";
|
|
47
|
+
readonly since: "7.129.0";
|
|
48
|
+
};
|
|
49
|
+
readonly DENIAL_LIMIT_BOUNDS: {
|
|
50
|
+
readonly at: "approval_request card(card_json)denialLimitFallback.limit";
|
|
51
|
+
readonly site: "src/approval-card.ts";
|
|
52
|
+
readonly since: "7.135.0";
|
|
53
|
+
};
|
|
54
|
+
readonly HOOK_QUESTION_CAUSES: {
|
|
55
|
+
readonly at: "approval_request card(card_json)问因 { by: hook }.cause";
|
|
56
|
+
readonly site: "src/approval-card.ts";
|
|
57
|
+
readonly since: "7.143.0";
|
|
58
|
+
};
|
|
59
|
+
readonly PERSISTED_RULE_MATCHES: {
|
|
60
|
+
readonly at: "approval_request card(card_json)ruleOffers[].match";
|
|
61
|
+
readonly site: "src/approval-card.ts";
|
|
62
|
+
readonly since: "7.57.0";
|
|
63
|
+
};
|
|
64
|
+
readonly RESUME_STARTUP_CAUSES: {
|
|
65
|
+
readonly at: "422 parked_resume.startup_failed 体 cause";
|
|
66
|
+
readonly site: "src/approval-card.ts";
|
|
67
|
+
readonly since: "7.129.0";
|
|
68
|
+
};
|
|
69
|
+
readonly RULE_OFFERS_ABSENCES: {
|
|
70
|
+
readonly at: "approval_request card(card_json)ruleOffersAbsence";
|
|
71
|
+
readonly site: "src/approval-card.ts";
|
|
72
|
+
readonly since: "7.129.0";
|
|
73
|
+
};
|
|
74
|
+
readonly RULE_OFFER_KINDS: {
|
|
75
|
+
readonly at: "approval_request card(card_json)ruleOffers[].kind";
|
|
76
|
+
readonly site: "src/approval-card.ts";
|
|
77
|
+
readonly since: "7.135.0";
|
|
78
|
+
};
|
|
79
|
+
readonly STEER_REPLAY_FACETS: {
|
|
80
|
+
readonly at: "409 steering.duplicate_input_id 体 differs[]";
|
|
81
|
+
readonly site: "src/approval-card.ts";
|
|
82
|
+
readonly since: "7.118.0";
|
|
83
|
+
};
|
|
84
|
+
readonly TOOL_APPROVAL_CARDS: {
|
|
85
|
+
readonly at: "approval_request card(card_json)approvalCard · 帧活面事实 approvalCard";
|
|
86
|
+
readonly site: "src/approval-card.ts";
|
|
87
|
+
readonly since: "7.136.0";
|
|
88
|
+
};
|
|
89
|
+
readonly UNCOVERED_SEGMENT_REASONS: {
|
|
90
|
+
readonly at: "approval_request card(card_json)ruleOffers[].uncoveredDetail[].reason";
|
|
91
|
+
readonly site: "src/approval-card.ts";
|
|
92
|
+
readonly since: "7.57.0";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=core-vocab-wire.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const CORE_VOCAB_WIRE = {
|
|
2
|
+
ALLOW_RULE_MEMBERS: { at: "approval_request card(card_json)allow 层披露记录的 member", site: "src/approval-card.ts", since: "7.117.0" },
|
|
3
|
+
ASK_EVIDENCE_ABSENCE_VALUES: { at: "approval_request card(card_json)规则证据的 orgRevisionAbsent / orgRuleAbsent / personalRuleDotsAbsent", site: "src/approval-card.ts", since: "7.23.0" },
|
|
4
|
+
BOUND_GRANT_ABSENCES: { at: "approval_request 帧活面事实 boundGrantAbsence", site: "src/approval-card.ts", since: "7.129.0" },
|
|
5
|
+
DENIAL_LIMIT_BOUNDS: { at: "approval_request card(card_json)denialLimitFallback.limit", site: "src/approval-card.ts", since: "7.135.0" },
|
|
6
|
+
HOOK_QUESTION_CAUSES: { at: "approval_request card(card_json)问因 { by: hook }.cause", site: "src/approval-card.ts", since: "7.143.0" },
|
|
7
|
+
PERSISTED_RULE_MATCHES: { at: "approval_request card(card_json)ruleOffers[].match", site: "src/approval-card.ts", since: "7.57.0" },
|
|
8
|
+
RESUME_STARTUP_CAUSES: { at: "422 parked_resume.startup_failed 体 cause", site: "src/approval-card.ts", since: "7.129.0" },
|
|
9
|
+
RULE_OFFERS_ABSENCES: { at: "approval_request card(card_json)ruleOffersAbsence", site: "src/approval-card.ts", since: "7.129.0" },
|
|
10
|
+
RULE_OFFER_KINDS: { at: "approval_request card(card_json)ruleOffers[].kind", site: "src/approval-card.ts", since: "7.135.0" },
|
|
11
|
+
STEER_REPLAY_FACETS: { at: "409 steering.duplicate_input_id 体 differs[]", site: "src/approval-card.ts", since: "7.118.0" },
|
|
12
|
+
TOOL_APPROVAL_CARDS: { at: "approval_request card(card_json)approvalCard · 帧活面事实 approvalCard", site: "src/approval-card.ts", since: "7.136.0" },
|
|
13
|
+
UNCOVERED_SEGMENT_REASONS: { at: "approval_request card(card_json)ruleOffers[].uncoveredDetail[].reason", site: "src/approval-card.ts", since: "7.57.0" },
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=core-vocab-wire.js.map
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* 同文件 G1 e2e 的全码扇出夹具、以及契约文档附录 D.3 那张表(含**小节标题里的码数** —— 那道门本批
|
|
17
17
|
* 刚立,立完就在下一次加码时自己咬住了)。
|
|
18
18
|
*/
|
|
19
|
-
export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.lineage_rerooted", "server.model_unreachable", "permission.entry_mode_clamped", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored", "route.credential_origin_mismatch", "mods.registration_refused", "config.session_rules_earlier_grammar", "advisor.not_attached", "inherit_env.names_withheld", "model.capability_downgraded", "context.media_removed", "mcp.authorization_required", "classifier.seat_rate_limited", "context.tool_schema_removed", "memory.harvest_refused", "memory.harvest_conflict"];
|
|
19
|
+
export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.lineage_rerooted", "server.model_unreachable", "permission.entry_mode_clamped", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored", "route.credential_origin_mismatch", "mods.registration_refused", "config.session_rules_earlier_grammar", "advisor.not_attached", "inherit_env.names_withheld", "model.capability_downgraded", "context.media_removed", "mcp.authorization_required", "classifier.seat_rate_limited", "context.tool_schema_removed", "memory.harvest_refused", "memory.harvest_conflict", "config.legacy_tool_name"];
|
|
20
20
|
export type EngineNoticeWireCode = (typeof ENGINE_NOTICE_WIRE_CODES)[number];
|
|
21
21
|
/** 白名单谓词(单点):路由与门都读这一个,不许第二处手抄码串。 */
|
|
22
22
|
export declare function isEngineNoticeWireCode(code: string): code is EngineNoticeWireCode;
|
|
@@ -53,6 +53,7 @@ export const ENGINE_NOTICE_WIRE_CODES = [
|
|
|
53
53
|
"context.tool_schema_removed",
|
|
54
54
|
"memory.harvest_refused",
|
|
55
55
|
"memory.harvest_conflict",
|
|
56
|
+
"config.legacy_tool_name",
|
|
56
57
|
];
|
|
57
58
|
const WIRE_CODES = new Set(ENGINE_NOTICE_WIRE_CODES);
|
|
58
59
|
export function isEngineNoticeWireCode(code) {
|
|
@@ -116,6 +117,7 @@ export const RULE_TEXT_DETAIL_FIELDS = {
|
|
|
116
117
|
"permission.allowed_tool_not_granted": { array: "entries", field: "entry" },
|
|
117
118
|
"permission.rule_row_dropped": { array: "rows", field: "rule" },
|
|
118
119
|
"config.session_rules_earlier_grammar": { array: "entries", field: "entry" },
|
|
120
|
+
"config.legacy_tool_name": { array: "entries", field: "entry" },
|
|
119
121
|
};
|
|
120
122
|
export function redactNoticeMessage(message) {
|
|
121
123
|
return redactSecrets(String(message));
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 「脱敏器抛 ⇒ 占位」的那一枚登记占位(**唯一属主在这里**:座的抛律用它,`observability/run-terminal.ts` 的终态 / 模型文本座与 `trace/model-segment.ts` 的活面放行窗
|
|
3
|
+
* 读同一枚)。属主住在座上而不在 run-terminal:日志出口接缝经座过筛,run-terminal 的模块图里有经接缝写日志的模块 —— 占位放在那边就是一个环。
|
|
4
|
+
*/
|
|
5
|
+
export declare const OVERSIZED_REDACTION_PLACEHOLDER = "\u00ABredacted:oversized\u00BB";
|
|
1
6
|
/** 品牌键:模块私有的 `unique symbol` —— 别处写不出这个键,于是写不出一个 `SafeText` 字面量;断言伪造由普查门在语法树上拦。 */
|
|
2
7
|
declare const SAFE_TEXT: unique symbol;
|
|
3
8
|
/** 经出口座的文本。是 `string` 的子型:读者零改;写进出口位只能用 {@link seatText} 铸的值。 */
|
|
@@ -20,9 +25,18 @@ export type SafeText = string & {
|
|
|
20
25
|
* 引擎放过的形照抹);界 200 码元,原样出门(JSON 串值,消费方自己渲染)。
|
|
21
26
|
* · `peer-declaration-sentence`:引擎判官对一份 MCP / A2A 对端声明说的句子(`toolAxes` / `toolFaces` / `sessionMetaKey` / 启动界的原因句,逐字带着声明方写的工具名、键名),
|
|
22
27
|
* 进请求面 400 拒句、续跑重放的丢弃行与重读行、名册的跳过行,以及能力读面 `GET /v1/capabilities/mcp` 上引擎整集拒(两台撞同一工具命名空间前缀)的拒句 —— 读者是调用方与运维,句子已是一行;不设界(拒句要说全判官的话),原样出门。
|
|
23
|
-
* · `
|
|
24
|
-
*
|
|
25
|
-
*
|
|
28
|
+
* · `completion-diagnostics-text`:一次 workflow 完成通知上的诊断教学文本(`diagnostics`)—— 引擎在完成通知上铸的「读哪里 / 怎么续跑」文本(含部署上的 journal 坐标:路径或 URL),
|
|
29
|
+
* **两张脸同读这一行**:live `task_notification` 帧(`trace/project.ts` 的 `taskNotificationEventData`,停驻补投的 `task_notification` 帧与账本行同一只)与 `workflow_complete` 补投帧
|
|
30
|
+
* (入会话收件时洗一次,店里 `payload` 列只放出门安全的字节,drain 逐字带出)。引擎在两条腿上给的不是同一份:sink 腿递未抹的原值、notifier 腿递「人类读者」档抹过的 ——
|
|
31
|
+
* 所以读者档在**这一行**上声明(`hostLeaks`),不靠哪条腿的上游记得抹:同一段输入,两张脸逐字节相等。洗法其余同 `trace-frame-text`(scope `free-text`);
|
|
32
|
+
* 这一行多一条界(4000 码元,与同族条目的文本位同额),原样出门:逐成员的粗截;整条 `payload` 装不装得下由条目编码座按字节预算终判
|
|
33
|
+
* (`orchestration/workflow-completion-inbox.ts` 的 `encodeInboxBody`,预算 = 最窄后端的 `payload` 列容量,超 ⇒ 最小形 + `payloadTruncated`)。
|
|
34
|
+
* · `inbox-frame-text`:`task_notification` 补投帧(停驻收件、下一次开流 drain)上会话箱车道的自由文本位 —— 三只载体的 `crossSessionMessage.fromName` /
|
|
35
|
+
* `.body`、`crossSessionNotice.text` 与侧记 `_sema_provenance.peerMeta.notice` 的 `recipient` / `target` / `detail` / `dropReason`(别的会话写的或引擎嵌着
|
|
36
|
+
* 别的会话文本渲的句子);入会话收件时经与 live 腿同一只判据(`task-notification-facets.ts` / `sema-provenance.ts`)洗一次,店里(`payload` 列)只放
|
|
37
|
+
* 出门安全的字节,drain 逐字带出。scope 与 live 的 `trace-frame-text` 同(`free-text`),多一条界(4000 码元,与同族条目既有文本位 `result` /
|
|
38
|
+
* `agentMessage.body` 同额),原样出门。这条界是**逐成员**的粗截:多枚文本位相加、JSON 转义放大(控制字符一枚 6 字节)后的总和由条目编码座按
|
|
39
|
+
* 整条字节预算终判(`encodeInboxBody`;同上行),本行只挡一枚文本独自变长。
|
|
26
40
|
* · `boot-refusal-line`:起服拒启的一行拒句 —— 部署座装配的拒句(`mods-declaration.ts`:声明的席名、包名、读包者 / 引擎准入交回的话);它经进程级 fatal 出口原样多行进 stderr,
|
|
27
41
|
* 所以必须在这里先压成一行(一句拒因里的换行会在运维的终端里伪造出第二条日志行);界 512 码元(含截断记号)。
|
|
28
42
|
* · `workflow-recovery-summary`:workflow 完成通知在崩溃恢复路径上由 run 行的错误文本合成的摘要(`summary`;`orchestration/workflow-notify-journal.ts` 的 `recoverySummary`)——
|
|
@@ -31,6 +45,14 @@ export type SafeText = string & {
|
|
|
31
45
|
* · `peer-inbound-card-text`:运维审批队列 `peer_inbound` 行(`GET /v1/approvals` 的 `pending[]` 与 `/v1/approvals/stream` 的 `pending` 帧)上被扣跨会话来信的
|
|
32
46
|
* 存储正文(`content`,core 的规范存储形 `[summary] message`)与发信方显示名(`fromName`)—— 别的会话写的自由文本,读者是收信方本人;不设界(core 存的那一份就是
|
|
33
47
|
* 收信方要审的全文,截了就审不全),原样出门(JSON 串值,消费方自己渲染)。
|
|
48
|
+
* · `rewind-ledger-path`:run 外回退口(`POST /v1/sessions/:id/rewind-files`)200 体上被跟踪文件的路径(台账与预览的 `filesChanged` / `identicalSkipped` /
|
|
49
|
+
* `refused[].path` / `failed[].path`;源头是模型交的路径参数)—— 不设界(截过的路径就不是那个文件了,消费方要拿它去对文件),原样出门。
|
|
50
|
+
* · `rewind-ledger-reason`:同一口台账上的拒因 / 故障句(`refused[].reason` / `failed[].reason` / `error.message`;引擎与文件历史店写的、可能带着抛出物原文)——
|
|
51
|
+
* 界 500 码元,原样出门(JSON 串值,消费方自己渲染)。
|
|
52
|
+
* · `log-record`:日志出口接缝(`observability/logger.ts`)写出的**整条**结构化日志行 —— `{ ts, level, msg, ...fields }` 的 `JSON.stringify` 产物,进程 stdout / stderr 的诊断字节
|
|
53
|
+
* (写出点不判:字段里混进来的凭据形 —— 被拒的目录条目名、上游回显、错误消息里的令牌 —— 在这一行上统一挡);脱敏器按 JSON 读法读(`json`),不设界(日志行的长短是写出点的事),
|
|
54
|
+
* 原样出门。遮过的产物不再是一条 JSON ⇒ 按座的抛律换占位(见模块头注「抛」);占位不是一条 JSON ⇒ 接缝扣下这一行(固定字节的扣下句),见接缝头注。
|
|
55
|
+
* · `log-text`:日志出口接缝写出的一段诊断散文(与 `console.*` 同一种格式化,`util.format`;带调用栈的多行);不设界、不整形(多行照旧),原样出门。
|
|
34
56
|
*/
|
|
35
57
|
declare const EXIT_SEATS: {
|
|
36
58
|
readonly "trace-frame-text": {
|
|
@@ -72,7 +94,12 @@ declare const EXIT_SEATS: {
|
|
|
72
94
|
readonly "peer-declaration-sentence": {
|
|
73
95
|
readonly scope: "free-text";
|
|
74
96
|
};
|
|
75
|
-
readonly "
|
|
97
|
+
readonly "completion-diagnostics-text": {
|
|
98
|
+
readonly scope: "free-text";
|
|
99
|
+
readonly maxChars: 4000;
|
|
100
|
+
readonly hostLeaks: true;
|
|
101
|
+
};
|
|
102
|
+
readonly "inbox-frame-text": {
|
|
76
103
|
readonly scope: "free-text";
|
|
77
104
|
readonly maxChars: 4000;
|
|
78
105
|
};
|
|
@@ -87,6 +114,20 @@ declare const EXIT_SEATS: {
|
|
|
87
114
|
readonly "workflow-recovery-summary": {
|
|
88
115
|
readonly scope: "diagnostic";
|
|
89
116
|
};
|
|
117
|
+
readonly "rewind-ledger-path": {
|
|
118
|
+
readonly scope: "free-text";
|
|
119
|
+
};
|
|
120
|
+
readonly "rewind-ledger-reason": {
|
|
121
|
+
readonly scope: "free-text";
|
|
122
|
+
readonly maxChars: 500;
|
|
123
|
+
};
|
|
124
|
+
readonly "log-record": {
|
|
125
|
+
readonly scope: "free-text";
|
|
126
|
+
readonly json: true;
|
|
127
|
+
};
|
|
128
|
+
readonly "log-text": {
|
|
129
|
+
readonly scope: "free-text";
|
|
130
|
+
};
|
|
90
131
|
};
|
|
91
132
|
export type ExitSeat = keyof typeof EXIT_SEATS;
|
|
92
133
|
/** 设了界的座名。 */
|
|
@@ -97,6 +138,13 @@ export type BoundedExitSeat = {
|
|
|
97
138
|
}[ExitSeat];
|
|
98
139
|
/** 一行的界(码元;含截断记号)—— 界的唯一属主是座表,站点要用这个数(显示预算、文档钉)就读它,不另抄一份。 */
|
|
99
140
|
export declare function seatMaxChars(seat: BoundedExitSeat): number;
|
|
141
|
+
type ScanGeometry = {
|
|
142
|
+
readonly region: number;
|
|
143
|
+
readonly margin: number;
|
|
144
|
+
readonly window: number;
|
|
145
|
+
};
|
|
146
|
+
/** 一个有界行的扫描窗几何(读法单元):出门区、余量、窗 = 出门区 + 余量。窗的几何只有这里一处答 —— 站点 / 测试要这几个数就读它,不另抄。 */
|
|
147
|
+
export declare function seatScanGeometry(seat: BoundedExitSeat): ScanGeometry;
|
|
100
148
|
/**
|
|
101
149
|
* 出口座:`seat` 是座表的一行,`text` 是要出门的自由文本。返回的 {@link SafeText} 就是这个出口该写出去的字节。
|
|
102
150
|
* 表外的座名(只有绕过类型才到得了)⇒ 抛 —— 那是调用方的编程错,不是脱敏失败,不吞成占位。
|
package/dist/trace/exit-seat.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { stripControlAndBidi } from "@sema-agent/settings-schema";
|
|
2
|
+
import { REDACTION_MARKS, redactHostLeaks } from "@sema-agent/core";
|
|
2
3
|
import { CALLER_TEXT_CUT_MARK } from "../caller-text-echo.js";
|
|
3
4
|
import { errorKindOf } from "../observability/err-text.js";
|
|
4
5
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
6
|
+
import { MAX_RECOGNITION_SPAN, mergeRedactionSpans, proposeRedactionSpans, readingHeadEnd, REDACTION_TOKEN_RE_SRC, renderRedactionSpans, WHOLE_EXTENT } from "./redact.js";
|
|
7
|
+
export const OVERSIZED_REDACTION_PLACEHOLDER = "«redacted:oversized»";
|
|
7
8
|
const EXIT_SEATS = {
|
|
8
9
|
"trace-frame-text": { scope: "free-text" },
|
|
9
10
|
"trace-frame-line": { scope: "free-text", maxChars: 300 },
|
|
@@ -14,10 +15,15 @@ const EXIT_SEATS = {
|
|
|
14
15
|
"session-title": { scope: "free-text", maxChars: 80, emit: "title-line" },
|
|
15
16
|
"mcp-remote-text": { scope: "free-text", maxChars: 200 },
|
|
16
17
|
"peer-declaration-sentence": { scope: "free-text" },
|
|
17
|
-
"
|
|
18
|
+
"completion-diagnostics-text": { scope: "free-text", maxChars: 4000, hostLeaks: true },
|
|
19
|
+
"inbox-frame-text": { scope: "free-text", maxChars: 4000 },
|
|
18
20
|
"boot-refusal-line": { scope: "free-text", maxChars: 512, emit: "log-line" },
|
|
19
21
|
"peer-inbound-card-text": { scope: "free-text" },
|
|
20
22
|
"workflow-recovery-summary": { scope: "diagnostic" },
|
|
23
|
+
"rewind-ledger-path": { scope: "free-text" },
|
|
24
|
+
"rewind-ledger-reason": { scope: "free-text", maxChars: 500 },
|
|
25
|
+
"log-record": { scope: "free-text", json: true },
|
|
26
|
+
"log-text": { scope: "free-text" },
|
|
21
27
|
};
|
|
22
28
|
export function seatMaxChars(seat) {
|
|
23
29
|
return EXIT_SEATS[seat].maxChars;
|
|
@@ -31,19 +37,9 @@ for (const [name, row] of SEAT_ROWS) {
|
|
|
31
37
|
throw new Error(`exit seat "${name}": a row with an emission form must declare maxChars (the cut mark counts inside the bound)`);
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
|
-
function mergeSpans(spans) {
|
|
35
|
-
const order = spans.map((s, i) => ({ s, i })).sort((a, b) => a.s.start - b.s.start || b.s.end - a.s.end || a.i - b.i);
|
|
36
|
-
const out = [];
|
|
37
|
-
for (const { s } of order) {
|
|
38
|
-
const last = out[out.length - 1];
|
|
39
|
-
if (last === undefined || s.start > last.end)
|
|
40
|
-
out.push(s);
|
|
41
|
-
else if (s.end > last.end)
|
|
42
|
-
out[out.length - 1] = { start: last.start, end: s.end, repl: last.repl };
|
|
43
|
-
}
|
|
44
|
-
return out;
|
|
45
|
-
}
|
|
46
40
|
const TOKEN_AT = new RegExp(REDACTION_TOKEN_RE_SRC, "y");
|
|
41
|
+
const ENGINE_MARKS = Object.values(REDACTION_MARKS);
|
|
42
|
+
const ENGINE_MARK_MAX = Math.max(...ENGINE_MARKS.map((m) => m.length));
|
|
47
43
|
function safeCutPoint(gap, cut) {
|
|
48
44
|
const hi = gap.charCodeAt(cut - 1);
|
|
49
45
|
if (cut > 0 && hi >= 0xd800 && hi <= 0xdbff && (gap.charCodeAt(cut) & 0xfc00) === 0xdc00)
|
|
@@ -55,21 +51,23 @@ function safeCutPoint(gap, cut) {
|
|
|
55
51
|
if (m !== null && open + m[0].length > cut)
|
|
56
52
|
cut = open;
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const parts = [];
|
|
63
|
-
let at = 0;
|
|
64
|
-
for (const g of groups) {
|
|
65
|
-
if (g.start >= until)
|
|
54
|
+
for (let at = gap.lastIndexOf("[", cut - 1); at !== -1 && at > cut - ENGINE_MARK_MAX; at = at === 0 ? -1 : gap.lastIndexOf("[", at - 1)) {
|
|
55
|
+
const mark = ENGINE_MARKS.find((m) => gap.startsWith(m, at));
|
|
56
|
+
if (mark !== undefined && at + mark.length > cut) {
|
|
57
|
+
cut = at;
|
|
66
58
|
break;
|
|
67
|
-
|
|
68
|
-
at = g.end;
|
|
59
|
+
}
|
|
69
60
|
}
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
return cut;
|
|
62
|
+
}
|
|
63
|
+
function hostLeakSpans(text) {
|
|
64
|
+
const report = { findings: [] };
|
|
65
|
+
redactHostLeaks(text, report);
|
|
66
|
+
return report.findings
|
|
67
|
+
.filter((f) => f.marker === REDACTION_MARKS.url || f.marker === REDACTION_MARKS.path)
|
|
68
|
+
.map((f) => ({ start: f.span[0], end: f.span[1], repl: f.marker }));
|
|
72
69
|
}
|
|
70
|
+
const cutPlain = (gap, room) => gap.slice(0, safeCutPoint(gap, room));
|
|
73
71
|
function emitAs(form, text) {
|
|
74
72
|
switch (form) {
|
|
75
73
|
case "log-line":
|
|
@@ -87,9 +85,15 @@ function emitAs(form, text) {
|
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
87
|
const layoutOf = (row) => (row.emit === undefined ? "multi-line" : "single-line");
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
88
|
+
const SCAN_REGION_FLOOR = 2048;
|
|
89
|
+
const SCAN_REGION_PER_BOUND = 4;
|
|
90
|
+
const scanGeometryOf = (maxChars) => {
|
|
91
|
+
const region = Math.max(SCAN_REGION_FLOOR, maxChars * SCAN_REGION_PER_BOUND);
|
|
92
|
+
return { region, margin: MAX_RECOGNITION_SPAN, window: region + MAX_RECOGNITION_SPAN };
|
|
93
|
+
};
|
|
94
|
+
export function seatScanGeometry(seat) {
|
|
95
|
+
return scanGeometryOf(EXIT_SEATS[seat].maxChars);
|
|
96
|
+
}
|
|
93
97
|
function boundRow(out, row, cutUpstream) {
|
|
94
98
|
if (row.maxChars === undefined)
|
|
95
99
|
return out;
|
|
@@ -107,13 +111,12 @@ export function seatText(seat, text) {
|
|
|
107
111
|
let out;
|
|
108
112
|
try {
|
|
109
113
|
const layout = layoutOf(row);
|
|
110
|
-
const
|
|
114
|
+
const geometry = row.maxChars === undefined ? undefined : scanGeometryOf(row.maxChars);
|
|
111
115
|
let windowEnd;
|
|
112
116
|
let regionEnd;
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
const end = safeCutPoint(text, readingHeadEnd(text, layout, scanWindow - half, region));
|
|
117
|
+
if (geometry !== undefined && text.length > geometry.window) {
|
|
118
|
+
const region = safeCutPoint(text, readingHeadEnd(text, layout, geometry.region));
|
|
119
|
+
const end = safeCutPoint(text, readingHeadEnd(text, layout, geometry.margin, region));
|
|
117
120
|
if (end < text.length) {
|
|
118
121
|
windowEnd = end;
|
|
119
122
|
regionEnd = region;
|
|
@@ -125,9 +128,13 @@ export function seatText(seat, text) {
|
|
|
125
128
|
else {
|
|
126
129
|
const emitUntil = regionEnd;
|
|
127
130
|
const extent = windowEnd === undefined || regionEnd === undefined ? WHOLE_EXTENT : { kind: "head", emitEnd: regionEnd };
|
|
128
|
-
const
|
|
131
|
+
const proposals = proposeRedactionSpans(head, row.scope, layout, extent, row.json === true);
|
|
132
|
+
const groups = row.hostLeaks === true ? mergeRedactionSpans([...proposals, ...hostLeakSpans(head)]) : proposals;
|
|
133
|
+
const rendered = renderRedactionSpans(head, groups, 0, emitUntil ?? head.length);
|
|
129
134
|
out = boundRow(row.emit === undefined ? rendered : emitAs(row.emit, rendered), row, windowEnd !== undefined);
|
|
130
135
|
}
|
|
136
|
+
if (row.json === true && out !== text)
|
|
137
|
+
JSON.parse(out);
|
|
131
138
|
}
|
|
132
139
|
catch (err) {
|
|
133
140
|
recordFailOpen("server.run-terminal.redact-threw", `seat=${seat} len=${typeof text === "string" ? text.length : -1} err=${errorKindOf(err)}`);
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
import type { ExtensionRequester, RewriteAuthor } from "@sema-agent/core";
|
|
20
20
|
/** wire 上的发起者位 = 引擎的 `ExtensionRequester` 同形(`name` 已过出口纪律);引擎加一类发起者 ⇒ 这里的形随之,读法下面一处判。 */
|
|
21
21
|
export type ExtensionRequesterFace = Readonly<ExtensionRequester>;
|
|
22
|
-
/** `requestedBy`
|
|
23
|
-
|
|
22
|
+
/** 扩展发起者形(`ExtensionRequester`)的投影 —— `requestedBy`(调用的发起者)与 `declinedBy`(core 7.66.0:拒了这只附件的扩展)同一只读法(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。
|
|
23
|
+
* `where` 进留痕句(哪一面:`tool_start` / `tool_end` / `tool_approval` / 读腿 / `human_input.attachments`);`field` 让留痕句点对字段名(判据一只,丢弃句按字段各写一句字面量)。 */
|
|
24
|
+
export declare function extensionRequesterOf(v: unknown, where: string, field?: "requestedBy" | "declinedBy"): ExtensionRequesterFace | undefined;
|
|
24
25
|
/** `answeredBy` 的投影(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。 */
|
|
25
26
|
export declare function extensionAnswererOf(v: unknown, where: string): string | undefined;
|
|
26
27
|
/** wire 上的改写记录 = 引擎的 `ToolInputRewrite` 同形(扩展项的 `name` 已过出口纪律、`input` 已脱敏)。 */
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { sanitizeWireText } from "./engine-notice-wire.js";
|
|
2
2
|
import { dropProjectedFace } from "./projection-drop.js";
|
|
3
|
-
export function extensionRequesterOf(v, where) {
|
|
3
|
+
export function extensionRequesterOf(v, where, field = "requestedBy") {
|
|
4
4
|
if (v === undefined)
|
|
5
5
|
return undefined;
|
|
6
6
|
if (typeof v === "object" && v !== null && "kind" in v && "name" in v && v.kind === "extension" && typeof v.name === "string" && v.name !== "")
|
|
7
7
|
return { kind: "extension", name: sanitizeWireText(v.name) };
|
|
8
|
+
if (field === "declinedBy")
|
|
9
|
+
return dropProjectedFace("human_input.declinedBy is not { kind: extension, name: <non-empty string> } on " + where);
|
|
8
10
|
return dropProjectedFace("extension_call.requestedBy is not { kind: extension, name: <non-empty string> } on " + where);
|
|
9
11
|
}
|
|
10
12
|
export function extensionAnswererOf(v, where) {
|
|
@@ -55,18 +55,15 @@ export type LedgerEventType = "reasoning" | "text" | "tool_start" | "tool_end" |
|
|
|
55
55
|
| "suspended" | "needs_review" | "done" | "failed" | "suggestions" | "model_usage" | "prompt_assembled" | "config_assembled"
|
|
56
56
|
/** core 7.54.0 [ref] O9b S1:`permission.cross_boundary_taint` 帧的耐久行(伴随记录,与 `config_assembled` 同一只队列、同一批 drain 点;只在执行于目标设备的树上有)。 */
|
|
57
57
|
| "cross_boundary_taint" | "file_link"
|
|
58
|
-
/** 人在环三族的 open/close 帧对(
|
|
58
|
+
/** 人在环三族的 open/close 帧对(投递 = 本腿那一只人在环传输,先落本账本再写直写面;`hitl-delivery.ts`)。 */
|
|
59
59
|
| "elicitation" | "elicitation_complete" | "question" | "question_complete" | "tool_approval" | "tool_approval_complete"
|
|
60
60
|
/** [ref] §4.3 呈卡族的开卡帧与单卡消卡帧(与上面两只 tool_approval 帧同一条投递面;一条腿只发其中一族,
|
|
61
61
|
* bg / resume 两条 durable 腿恒是呈卡腿 ⇒ 它们的账本自 7.133.0 起只有本族)。 */
|
|
62
62
|
| "approval_request" | "approval_complete"
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* `emitRevoke`,durable 腿的那只钩子自己就是账本写口。sync 腿维持 live-only(行为零变,
|
|
68
|
-
* `routes/tasks.ts` 装配点注)。重放语义:同一账本里卡帧(`approval_request`)在前、撤帧在后,
|
|
69
|
-
* 全量重读恒同序 ⇒ 幂等诚实;不投影成 trace 2.3 帧(`LEDGER_TYPES_NOT_PROJECTED` 登记)。
|
|
64
|
+
* 批级撤卡帧:与呈卡帧同一只腿传输(`hitl-delivery.ts`:先本 run 账本、再直写),seq 由腿自己的账本链步分配 ——
|
|
65
|
+
* 三条腿(sync 腿有 durable run 行时)都落行。重放语义:账本里的序 = 入链序(陈旧快照的窄窗里撤帧可先于它点名的卡行),
|
|
66
|
+
* 全量重读恒同序,消费方按 `askIds` 幂等应用;不投影成 trace 2.3 帧(`LEDGER_TYPES_NOT_PROJECTED` 登记)。
|
|
70
67
|
*/
|
|
71
68
|
| "approval_revoke"
|
|
72
69
|
/** 异步 workflow 完成的入箱 drain(`emitPendingWorkflowCompletions` 两个字面型之一)。 */
|
|
@@ -21,7 +21,7 @@ import { type LedgerEventType, type ParkLedgerEventType } from "./ledger-events.
|
|
|
21
21
|
* persisted tree; it is never a ledger row).
|
|
22
22
|
*/
|
|
23
23
|
export interface LedgerSink {
|
|
24
|
-
/** Seq-stamped raw append — for a leg's out-of-band rows (
|
|
24
|
+
/** Seq-stamped raw append — for a leg's out-of-band rows (the HITL transport's ledger sink, model_usage deltas,
|
|
25
25
|
* suggestions, `failed`) that must share this run's single seq counter. Redaction is the CALLER's duty on
|
|
26
26
|
* this raw door (every existing site already redacts); the typed doors below redact internally. */
|
|
27
27
|
append(type: LedgerEventType, data: unknown): Promise<void>;
|
|
@@ -104,35 +104,6 @@ export declare function createSerialLedgerAppend(appendEvent: (seq: number, type
|
|
|
104
104
|
* 返回 `.catch` 用的处理器(产物是函数 ⇒ `create*`)。
|
|
105
105
|
*/
|
|
106
106
|
export declare function createForwardAppendFailedNote(type: string): (err: unknown) => void;
|
|
107
|
-
/**
|
|
108
|
-
* 人在环帧(`question` / `question_complete`、`elicitation` / `elicitation_complete`)的**账本孪生投递口**。
|
|
109
|
-
*
|
|
110
|
-
* 一条律:**凡进 run 流的 HITL 帧都有账本孪生;腿只决定「还要不要同时直写 socket」**。后台腿没有 live 面,
|
|
111
|
-
* 它的投递口就是账本追加本身(`runs.ts`);同步流腿有 live SSE,走本函数 —— 同一只帧对象先落账、再按需直写,
|
|
112
|
-
* 于是两条腿对同一只帧的落法只差「直写要不要」,不差「账本有没有」。
|
|
113
|
-
*
|
|
114
|
-
* 顺序与失败语义(与后台腿同一条):
|
|
115
|
-
* · **先账本后直写**。账本落不下 ⇒ 本次投递**失败**(抛),帧不上 socket —— 一只没有孪生的帧不许单独露面
|
|
116
|
-
* (否则壳看见一张重载就丢的卡)。调用方(协调器)按「开帧投递失败」处理:这一问结算 `unavailable`、记一次既有的
|
|
117
|
-
* P-DEBT 留痕;消卡帧则落「面包屑丢失」的 F 类留痕。
|
|
118
|
-
* · **seq 不自造**:孪生走 `sink.append` —— 本腿账本唯一的那条串行链(与 text / tool / done 行同一个计数器)。
|
|
119
|
-
* · **直写口已不可达**(客户端离开,而 run 因 detach 继续)⇒ 账本孪生即送达,不再触碰那条已死的连接
|
|
120
|
-
* (不抛、也不记「丢帧」—— 帧没丢,在账本里)。
|
|
121
|
-
* · **本腿没有账本**(无 durable run 行的部署:`sink` 缺席)⇒ 直写就是全部投递,死流姿态由 `writeLive` 自己带
|
|
122
|
-
* (question 抛、elicitation 静默记账),字节逐字同孪生落地之前。
|
|
123
|
-
*
|
|
124
|
-
* 命名(CLAUDE.md 工厂命名律):`create*` —— 返回的是捕获了两个口的闭包,不是纯数据。
|
|
125
|
-
*/
|
|
126
|
-
export declare function createLedgerTwinEmit<F extends {
|
|
127
|
-
type: LedgerEventType;
|
|
128
|
-
}>(opts: {
|
|
129
|
-
/** 本腿的账本(sync 腿 = 有 durable run 行才有;缺席 ⇒ 无孪生可落)。只用 `append`:seq 由它那条链铸。 */
|
|
130
|
-
sink: Pick<LedgerSink, "append"> | undefined;
|
|
131
|
-
/** 本腿的直写口(sync 腿 = 一个具名 SSE 事件)。 */
|
|
132
|
-
writeLive: (frame: F) => void;
|
|
133
|
-
/** 直写面此刻可达吗 —— 与协调器问「这条腿还够得着人吗」的是**同一只**谓词(`QuestionRunContext.deliverable`)。 */
|
|
134
|
-
liveReachable: () => boolean;
|
|
135
|
-
}): (frame: F) => Promise<void>;
|
|
136
107
|
export declare function createLedgerSink(opts: {
|
|
137
108
|
/** The seq-stamped durable append — typically `(seq, type, data) => runStore.appendEvent(taskId, seq, type, data)`. */
|
|
138
109
|
appendEvent: (seq: number, type: LedgerEventType, data: unknown) => Promise<void>;
|
|
@@ -17,17 +17,6 @@ export function createSerialLedgerAppend(appendEvent, startSeq) {
|
|
|
17
17
|
export function createForwardAppendFailedNote(type) {
|
|
18
18
|
return (err) => recordFailOpen("server.ledger.forward-append-failed", `type=${type} err=${err instanceof Error ? err.message : String(err)}`);
|
|
19
19
|
}
|
|
20
|
-
export function createLedgerTwinEmit(opts) {
|
|
21
|
-
return async (frame) => {
|
|
22
|
-
if (opts.sink !== undefined) {
|
|
23
|
-
const { type, ...data } = frame;
|
|
24
|
-
await opts.sink.append(type, data);
|
|
25
|
-
if (!opts.liveReachable())
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
opts.writeLive(frame);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
20
|
export function createLedgerSink(opts) {
|
|
32
21
|
const keys = opts.notifiedKeys ?? new NotifiedKeys();
|
|
33
22
|
let seq = 0;
|