@sema-agent/server 7.147.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 +1039 -24
- package/README.md +20 -7
- package/README.zh-CN.md +14 -8
- package/USAGE.md +380 -163
- package/deploy/sema-up/README.md +16 -5
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +20 -4
- package/deploy/sema-up/chart/values.yaml +3 -2
- package/deploy/sema-up/cluster-up.sh +74 -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/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/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 +14 -39
- 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 +13 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +21 -0
- 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 +28 -30
- 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 +13 -11
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +15 -7
- 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 +5 -2
- 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/deployment-mods.d.ts +1 -1
- package/dist/boot/execution-env.d.ts +17 -7
- package/dist/boot/execution-env.js +37 -31
- package/dist/boot/exit-boundary.d.ts +2 -2
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +17 -15
- package/dist/boot/memory-consolidation.d.ts +37 -29
- package/dist/boot/memory-consolidation.js +11 -5
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.js +2 -2
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +19 -16
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +55 -67
- package/dist/boot/retention-lane.d.ts +4 -4
- 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 +16 -7
- package/dist/boot/session-faces.js +114 -94
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.js +9 -1
- package/dist/boot/stage-02-web-admin-pull.d.ts +1 -0
- package/dist/boot/stage-02-web-admin-pull.js +6 -1
- package/dist/boot/stage-03-store-backend.d.ts +3 -0
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +2 -0
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +7 -3
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +10 -12
- package/dist/boot/stage-06-runners.js +23 -15
- package/dist/boot/stage-07-capability-layer.d.ts +11 -8
- package/dist/boot/stage-07-capability-layer.js +5 -3
- package/dist/boot/stage-08-reapers.d.ts +11 -8
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +12 -15
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +12 -15
- package/dist/boot/stage-10-http-server.js +7 -4
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +3 -0
- package/dist/boot/stores.js +21 -10
- 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 +55 -35
- 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 +7 -1
- package/dist/capabilities/center-plugins.js +32 -10
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +2 -2
- package/dist/capabilities/composite-members.js +2 -2
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +6 -15
- package/dist/capabilities/scenarios.js +11 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +38 -11
- package/dist/capability-facts.js +47 -8
- 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 +7 -3
- package/dist/config-catalog.d.ts +16 -1
- package/dist/config-catalog.js +62 -56
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +42 -3
- package/dist/config-invariants.js +69 -5
- package/dist/config-lkg.d.ts +23 -1
- package/dist/config-lkg.js +17 -3
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -110
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +26 -17
- package/dist/config.d.ts +8 -16
- package/dist/config.js +113 -47
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +30 -4
- package/dist/deployment-shape.js +7 -0
- 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.js +2 -1
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-lane-caps.d.ts +5 -18
- package/dist/execution-lane-caps.js +0 -22
- package/dist/execution-placement.d.ts +58 -18
- package/dist/execution-placement.js +41 -2
- 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.js +1 -0
- 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 +3 -3
- 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 +23 -3
- package/dist/history-anchor.js +24 -4
- 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/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +67 -57
- package/dist/hooks/hook-runner.js +260 -186
- 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 +3 -3
- package/dist/http/approval-sweeps.js +54 -30
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claimed-run.d.ts +4 -3
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +76 -30
- package/dist/http/durable-run-leg.d.ts +3 -3
- package/dist/http/durable-run-leg.js +17 -12
- package/dist/http/execution-context.d.ts +17 -43
- package/dist/http/execution-context.js +7 -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 +4 -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 +1 -1
- package/dist/http/memory-store-refusal-reply.js +3 -0
- package/dist/http/owner-access.d.ts +391 -67
- package/dist/http/owner-access.js +371 -35
- package/dist/http/principal-gate.d.ts +24 -81
- package/dist/http/principal-gate.js +24 -68
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +9 -13
- 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 +21 -18
- package/dist/http/resume-legs.js +189 -129
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/route-ctx.d.ts +25 -32
- 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 +70 -65
- 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 +15 -18
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +4 -4
- 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 +2 -0
- 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 +10 -19
- 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 +1 -1
- package/dist/http/routes/projects.js +3 -2
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +20 -5
- 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 +146 -231
- 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 +21 -20
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.js +87 -124
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +136 -120
- 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 +39 -40
- package/dist/http/server.js +36 -11
- 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 +12 -0
- package/dist/http/stored-body-replay.js +2 -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 +4 -3
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- 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-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-scope.d.ts +29 -2
- package/dist/memory-scope.js +64 -15
- package/dist/memory-store-refusal.d.ts +5 -2
- package/dist/memory-sync-client.d.ts +3 -2
- package/dist/memory-sync-client.js +6 -3
- package/dist/model-compat.d.ts +17 -8
- package/dist/model-compat.js +6 -2
- 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 +35 -16
- package/dist/model-entry-refusal.js +40 -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 +23 -14
- package/dist/namespaced-rule-name.js +8 -11
- 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 +58 -38
- package/dist/observability/fail-open.js +60 -38
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.js +3 -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/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-completion-inbox.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.js +3 -2
- package/dist/org-delivery-gate.d.ts +5 -4
- package/dist/org-delivery-gate.js +7 -6
- 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 +67 -5
- package/dist/parked-decide.js +127 -5
- 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 +18 -7
- package/dist/plugins/approval-ask-store-file.js +37 -14
- package/dist/plugins/approval-ask-store-memory.d.ts +12 -4
- package/dist/plugins/approval-ask-store-memory.js +24 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +39 -20
- package/dist/plugins/approval-ask-store-sql.js +41 -10
- 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 +2 -0
- package/dist/plugins/blob-backend.js +9 -6
- package/dist/plugins/caching-session-store.d.ts +13 -1
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +32 -5
- package/dist/plugins/checkpoint-index-columns.js +36 -1
- package/dist/plugins/checkpoint-store-face.d.ts +83 -10
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.js +1 -0
- 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/file-run-store.d.ts +63 -23
- package/dist/plugins/file-run-store.js +138 -83
- 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 +2 -2
- 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 +58 -23
- package/dist/plugins/local-checkpoint-store.js +195 -76
- package/dist/plugins/local-data-dir-modes-m39.js +2 -1
- 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 +4 -2
- package/dist/plugins/local-engine-high-water.js +4 -1
- package/dist/plugins/local-session-store.d.ts +358 -125
- package/dist/plugins/local-session-store.js +824 -251
- 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 +18 -1
- package/dist/plugins/local-task-attachment-store.js +22 -1
- package/dist/plugins/memory-embedder.js +9 -7
- package/dist/plugins/memory-engine-pg.d.ts +3 -2
- package/dist/plugins/memory-engine-pg.js +14 -5
- package/dist/plugins/memory-engine-sql-apply.d.ts +8 -4
- package/dist/plugins/memory-engine-sql-apply.js +6 -8
- package/dist/plugins/memory-engine-tidb.d.ts +4 -2
- package/dist/plugins/memory-engine-tidb.js +11 -2
- 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 +186 -45
- package/dist/plugins/one-time-migrations.js +442 -119
- package/dist/plugins/org-delivery-quota-store.js +2 -1
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- 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 +1 -31
- package/dist/plugins/pg-pool.js +16 -7
- package/dist/plugins/remote-env-e2b.d.ts +7 -25
- package/dist/plugins/remote-env-e2b.js +34 -25
- package/dist/plugins/remote-env-host.d.ts +2 -9
- package/dist/plugins/remote-env-host.js +34 -22
- package/dist/plugins/remote-env-k8s.d.ts +40 -45
- package/dist/plugins/remote-env-k8s.js +107 -58
- package/dist/plugins/remote-env-local-docker.d.ts +148 -14
- package/dist/plugins/remote-env-local-docker.js +367 -72
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/retention-deployment.d.ts +49 -17
- package/dist/plugins/retention-deployment.js +39 -8
- 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 -9
- package/dist/plugins/schema-consistency.js +212 -11
- 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 +9 -0
- package/dist/plugins/schema-ensure-legs.js +1 -1
- 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 +27 -3
- package/dist/plugins/session-ext-table.js +19 -6
- package/dist/plugins/session-fork.d.ts +15 -1
- 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 +12 -0
- package/dist/plugins/session-row-sql.js +3 -3
- 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 +38 -12
- package/dist/plugins/session-store-sql.js +130 -30
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/shared-memory-store-sql.d.ts +0 -69
- package/dist/plugins/shared-memory-store-sql.js +2 -1
- 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/sql-driver.d.ts +1 -1
- package/dist/plugins/sql-driver.js +2 -1
- package/dist/plugins/sql-errors.d.ts +32 -5
- package/dist/plugins/sql-errors.js +55 -7
- 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 +84 -15
- package/dist/plugins/store-backend.js +186 -55
- package/dist/plugins/store-contracts.d.ts +90 -30
- package/dist/plugins/store-contracts.js +22 -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 +15 -3
- package/dist/plugins/task-attachment-store.js +22 -9
- package/dist/plugins/tidb-pool.js +23 -8
- 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/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/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 +5 -3
- package/dist/rules-consent.js +1 -0
- 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 +92 -80
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +26 -15
- package/dist/runs.js +39 -27
- package/dist/runtime-caps-resolver.d.ts +21 -6
- package/dist/runtime-caps-resolver.js +17 -4
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -5
- package/dist/sealed-key-layout.js +5 -0
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +115 -27
- package/dist/security.d.ts +128 -158
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +25 -0
- package/dist/server-secret-env.d.ts +21 -5
- package/dist/server-secret-env.js +14 -4
- 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 +5 -5
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +52 -5
- 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 +0 -71
- package/dist/session-resident-background.js +4 -3
- package/dist/session-row.d.ts +2 -1
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-posture.d.ts +136 -20
- package/dist/store-posture.js +188 -3
- package/dist/stored-request-hooks-m20.js +2 -2
- 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/checkpoint-store-sql.d.ts +33 -28
- package/dist/stores-sql/checkpoint-store-sql.js +75 -44
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/stores-sql/pg-session-storage.d.ts +7 -5
- package/dist/stores-sql/pg-session-storage.js +54 -46
- package/dist/stores-sql/retention-store-sql.d.ts +87 -19
- package/dist/stores-sql/retention-store-sql.js +92 -27
- package/dist/stores-sql/session-policy-store-sql.d.ts +32 -10
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +12 -6
- package/dist/stores-sql/tidb-session-storage.d.ts +4 -4
- package/dist/stores-sql/tidb-session-storage.js +13 -8
- package/dist/stores-sql/tidb-session-store.d.ts +36 -17
- package/dist/stores-sql/tidb-session-store.js +69 -39
- package/dist/stores-sql/windowed-session-storage.d.ts +5 -0
- package/dist/stores-sql/windowed-session-storage.js +9 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +1 -1
- package/dist/task-a2a.js +3 -3
- package/dist/task-cwd.d.ts +20 -0
- package/dist/task-cwd.js +8 -0
- package/dist/task-mcp.d.ts +1 -1
- package/dist/task-mcp.js +3 -3
- package/dist/task-settings.d.ts +14 -10
- package/dist/task-settings.js +18 -7
- package/dist/terminal.d.ts +25 -43
- package/dist/terminal.js +31 -11
- package/dist/tool-approval.d.ts +131 -129
- package/dist/tool-approval.js +189 -193
- package/dist/trace/core-keyset-guard.d.ts +13 -6
- package/dist/trace/core-vocab-wire.d.ts +95 -0
- package/dist/trace/core-vocab-wire.js +15 -0
- package/dist/trace/exit-seat.d.ts +30 -4
- package/dist/trace/exit-seat.js +40 -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 +55 -42
- package/dist/trace/project.js +52 -19
- package/dist/trace/redact.d.ts +123 -27
- package/dist/trace/redact.js +880 -260
- package/dist/trace/self-minted-wire.d.ts +487 -19
- package/dist/trace/self-minted-wire.js +172 -23
- package/dist/trace/wire-projection-faces.d.ts +5 -6
- package/dist/trace/wire-projection-faces.js +2 -2
- 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 +13 -16
- 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/center-request.d.ts +2 -2
- package/dist/web-admin-client/center-request.js +15 -15
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -1
- 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/http-client.d.ts +1 -1
- package/dist/web-admin-client/http-client.js +23 -4
- 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 +8 -4
- package/dist/web-admin-client/skills-mcp.d.ts +2 -2
- package/dist/web-admin-client/types.d.ts +1 -2
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/package.json +6 -3
- package/scripts/drain-check-local.mjs +118 -147
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- 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
|
@@ -67,10 +67,9 @@ type WiringSectionExcluded = (typeof import("./wire-projection-faces.js").WIRE_P
|
|
|
67
67
|
type _GuardWiringSections = AssertAllKeysHandled<Exclude<keyof WiringManifest, WiringSectionProjected | WiringSectionExcluded>>;
|
|
68
68
|
type _GuardWiringSectionsReverse = AssertAllKeysHandled<Exclude<WiringSectionProjected | WiringSectionExcluded, keyof WiringManifest>>;
|
|
69
69
|
type WiringSection<K extends keyof WiringManifest> = NonNullable<WiringManifest[K]>;
|
|
70
|
-
type WiringLegHandled = "kind";
|
|
71
|
-
type
|
|
72
|
-
type
|
|
73
|
-
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">>>;
|
|
74
73
|
type WiringModRowKeys = WiringSection<"mods">[number] extends infer R ? (R extends unknown ? keyof R : never) : never;
|
|
75
74
|
type WiringModRowHandled = "name" | "seat" | "tier" | "provenance" | "events" | "observe" | "skipped" | "refusedBy" | "reason";
|
|
76
75
|
type _GuardWiringModRow = AssertAllKeysHandled<Exclude<WiringModRowKeys, WiringModRowHandled>>;
|
|
@@ -218,8 +217,8 @@ type _GuardPromptManifestKeysReverse = AssertAllKeysHandled<{
|
|
|
218
217
|
type _GuardPromptManifestKeysNonEmpty = AssertAllKeysHandled<{
|
|
219
218
|
[L in keyof ManifestCore]: [ManifestDeclared<ManifestFaces, L>] extends [never] ? L : never;
|
|
220
219
|
}[keyof ManifestCore]>;
|
|
221
|
-
type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "boundGrantAbsence" | "checkpointId" | "rowVerdict";
|
|
222
|
-
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";
|
|
223
222
|
type _GuardInboxSummary = AssertAllKeysHandled<Exclude<keyof CheckpointSummary, SummaryProjected | SummaryExcluded>>;
|
|
224
223
|
type _GuardInboxSummaryReverse = AssertAllKeysHandled<Exclude<SummaryProjected | SummaryExcluded, keyof CheckpointSummary>>;
|
|
225
224
|
type ParkArmKeys = keyof Extract<PendingAction, {
|
|
@@ -483,6 +482,10 @@ type _GuardWorkflowRunStats = AssertAllKeysHandled<Exclude<keyof WorkflowRun["st
|
|
|
483
482
|
type _GuardWorkflowRunStatsReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_DISPOSITIONS"]>, keyof WorkflowRun["stats"]>>;
|
|
484
483
|
type _GuardWorkflowRunStatsNested = AssertAllKeysHandled<Exclude<keyof WorkflowRun["stats"]["nested"], TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_NESTED_DISPOSITIONS"]>>>;
|
|
485
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"]>>>;
|
|
486
489
|
type ReadRootCandidateProjected = "dir" | "clearsThisAsk" | "covers";
|
|
487
490
|
type _GuardReadRootCandidate = AssertAllKeysHandled<Exclude<keyof ReadRootGrantCandidate, ReadRootCandidateProjected>>;
|
|
488
491
|
type _GuardReadRootCandidateReverse = AssertAllKeysHandled<Exclude<ReadRootCandidateProjected, keyof ReadRootGrantCandidate>>;
|
|
@@ -649,6 +652,10 @@ export type CoreKeysetGuards = [
|
|
|
649
652
|
_GuardWorkflowRunStatsReverse,
|
|
650
653
|
_GuardWorkflowRunStatsNested,
|
|
651
654
|
_GuardWorkflowRunStatsNestedReverse,
|
|
655
|
+
_GuardWorkflowBudgetOvershoot,
|
|
656
|
+
_GuardWorkflowBudgetOvershootReverse,
|
|
657
|
+
_GuardWorkflowTimeoutInterruption,
|
|
658
|
+
_GuardWorkflowTimeoutInterruptionReverse,
|
|
652
659
|
_GuardReadRootCandidate,
|
|
653
660
|
_GuardReadRootCandidateReverse,
|
|
654
661
|
_GuardRiskAxes,
|
|
@@ -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
|
|
@@ -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,11 @@ 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` 装不装得下由条目编码座按字节预算终判
|
|
26
33
|
* (`orchestration/workflow-completion-inbox.ts` 的 `encodeInboxBody`,预算 = 最窄后端的 `payload` 列容量,超 ⇒ 最小形 + `payloadTruncated`)。
|
|
27
34
|
* · `inbox-frame-text`:`task_notification` 补投帧(停驻收件、下一次开流 drain)上会话箱车道的自由文本位 —— 三只载体的 `crossSessionMessage.fromName` /
|
|
28
35
|
* `.body`、`crossSessionNotice.text` 与侧记 `_sema_provenance.peerMeta.notice` 的 `recipient` / `target` / `detail` / `dropReason`(别的会话写的或引擎嵌着
|
|
@@ -42,6 +49,10 @@ export type SafeText = string & {
|
|
|
42
49
|
* `refused[].path` / `failed[].path`;源头是模型交的路径参数)—— 不设界(截过的路径就不是那个文件了,消费方要拿它去对文件),原样出门。
|
|
43
50
|
* · `rewind-ledger-reason`:同一口台账上的拒因 / 故障句(`refused[].reason` / `failed[].reason` / `error.message`;引擎与文件历史店写的、可能带着抛出物原文)——
|
|
44
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`;带调用栈的多行);不设界、不整形(多行照旧),原样出门。
|
|
45
56
|
*/
|
|
46
57
|
declare const EXIT_SEATS: {
|
|
47
58
|
readonly "trace-frame-text": {
|
|
@@ -83,9 +94,10 @@ declare const EXIT_SEATS: {
|
|
|
83
94
|
readonly "peer-declaration-sentence": {
|
|
84
95
|
readonly scope: "free-text";
|
|
85
96
|
};
|
|
86
|
-
readonly "
|
|
97
|
+
readonly "completion-diagnostics-text": {
|
|
87
98
|
readonly scope: "free-text";
|
|
88
99
|
readonly maxChars: 4000;
|
|
100
|
+
readonly hostLeaks: true;
|
|
89
101
|
};
|
|
90
102
|
readonly "inbox-frame-text": {
|
|
91
103
|
readonly scope: "free-text";
|
|
@@ -109,6 +121,13 @@ declare const EXIT_SEATS: {
|
|
|
109
121
|
readonly scope: "free-text";
|
|
110
122
|
readonly maxChars: 500;
|
|
111
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
|
+
};
|
|
112
131
|
};
|
|
113
132
|
export type ExitSeat = keyof typeof EXIT_SEATS;
|
|
114
133
|
/** 设了界的座名。 */
|
|
@@ -119,6 +138,13 @@ export type BoundedExitSeat = {
|
|
|
119
138
|
}[ExitSeat];
|
|
120
139
|
/** 一行的界(码元;含截断记号)—— 界的唯一属主是座表,站点要用这个数(显示预算、文档钉)就读它,不另抄一份。 */
|
|
121
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;
|
|
122
148
|
/**
|
|
123
149
|
* 出口座:`seat` 是座表的一行,`text` 是要出门的自由文本。返回的 {@link SafeText} 就是这个出口该写出去的字节。
|
|
124
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,13 +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 },
|
|
18
19
|
"inbox-frame-text": { scope: "free-text", maxChars: 4000 },
|
|
19
20
|
"boot-refusal-line": { scope: "free-text", maxChars: 512, emit: "log-line" },
|
|
20
21
|
"peer-inbound-card-text": { scope: "free-text" },
|
|
21
22
|
"workflow-recovery-summary": { scope: "diagnostic" },
|
|
22
23
|
"rewind-ledger-path": { scope: "free-text" },
|
|
23
24
|
"rewind-ledger-reason": { scope: "free-text", maxChars: 500 },
|
|
25
|
+
"log-record": { scope: "free-text", json: true },
|
|
26
|
+
"log-text": { scope: "free-text" },
|
|
24
27
|
};
|
|
25
28
|
export function seatMaxChars(seat) {
|
|
26
29
|
return EXIT_SEATS[seat].maxChars;
|
|
@@ -34,19 +37,9 @@ for (const [name, row] of SEAT_ROWS) {
|
|
|
34
37
|
throw new Error(`exit seat "${name}": a row with an emission form must declare maxChars (the cut mark counts inside the bound)`);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
function mergeSpans(spans) {
|
|
38
|
-
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);
|
|
39
|
-
const out = [];
|
|
40
|
-
for (const { s } of order) {
|
|
41
|
-
const last = out[out.length - 1];
|
|
42
|
-
if (last === undefined || s.start > last.end)
|
|
43
|
-
out.push(s);
|
|
44
|
-
else if (s.end > last.end)
|
|
45
|
-
out[out.length - 1] = { start: last.start, end: s.end, repl: last.repl };
|
|
46
|
-
}
|
|
47
|
-
return out;
|
|
48
|
-
}
|
|
49
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));
|
|
50
43
|
function safeCutPoint(gap, cut) {
|
|
51
44
|
const hi = gap.charCodeAt(cut - 1);
|
|
52
45
|
if (cut > 0 && hi >= 0xd800 && hi <= 0xdbff && (gap.charCodeAt(cut) & 0xfc00) === 0xdc00)
|
|
@@ -58,21 +51,23 @@ function safeCutPoint(gap, cut) {
|
|
|
58
51
|
if (m !== null && open + m[0].length > cut)
|
|
59
52
|
cut = open;
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const parts = [];
|
|
66
|
-
let at = 0;
|
|
67
|
-
for (const g of groups) {
|
|
68
|
-
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;
|
|
69
58
|
break;
|
|
70
|
-
|
|
71
|
-
at = g.end;
|
|
59
|
+
}
|
|
72
60
|
}
|
|
73
|
-
|
|
74
|
-
|
|
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 }));
|
|
75
69
|
}
|
|
70
|
+
const cutPlain = (gap, room) => gap.slice(0, safeCutPoint(gap, room));
|
|
76
71
|
function emitAs(form, text) {
|
|
77
72
|
switch (form) {
|
|
78
73
|
case "log-line":
|
|
@@ -90,9 +85,15 @@ function emitAs(form, text) {
|
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
87
|
const layoutOf = (row) => (row.emit === undefined ? "multi-line" : "single-line");
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
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
|
+
}
|
|
96
97
|
function boundRow(out, row, cutUpstream) {
|
|
97
98
|
if (row.maxChars === undefined)
|
|
98
99
|
return out;
|
|
@@ -110,13 +111,12 @@ export function seatText(seat, text) {
|
|
|
110
111
|
let out;
|
|
111
112
|
try {
|
|
112
113
|
const layout = layoutOf(row);
|
|
113
|
-
const
|
|
114
|
+
const geometry = row.maxChars === undefined ? undefined : scanGeometryOf(row.maxChars);
|
|
114
115
|
let windowEnd;
|
|
115
116
|
let regionEnd;
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
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));
|
|
120
120
|
if (end < text.length) {
|
|
121
121
|
windowEnd = end;
|
|
122
122
|
regionEnd = region;
|
|
@@ -128,9 +128,13 @@ export function seatText(seat, text) {
|
|
|
128
128
|
else {
|
|
129
129
|
const emitUntil = regionEnd;
|
|
130
130
|
const extent = windowEnd === undefined || regionEnd === undefined ? WHOLE_EXTENT : { kind: "head", emitEnd: regionEnd };
|
|
131
|
-
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);
|
|
132
134
|
out = boundRow(row.emit === undefined ? rendered : emitAs(row.emit, rendered), row, windowEnd !== undefined);
|
|
133
135
|
}
|
|
136
|
+
if (row.json === true && out !== text)
|
|
137
|
+
JSON.parse(out);
|
|
134
138
|
}
|
|
135
139
|
catch (err) {
|
|
136
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type EventIdentity, type SegmentEndFields } from "./project.js";
|
|
2
2
|
/**
|
|
3
3
|
* 本帧是不是模型文本的段界。**四条消费腿共用这一只**:账本投影 switch(`trace/ledger-sink.ts`)、
|
|
4
4
|
* 顶层 live 流与转发子代腿(`http/routes/tasks.ts`)、子代 tail 面(`fleet/subagent-tail-bus.ts`)。
|
|
@@ -14,7 +14,7 @@ export type ReasoningEndFrame = SegmentEndFields & {
|
|
|
14
14
|
};
|
|
15
15
|
/** 登记册**读到的全部字段**,逐个写出来(不是 `Record<string, unknown>`):`TaskEvent` 与转发腿的原始帧
|
|
16
16
|
* 都结构性满足它,于是调用点一个宽断言都不必写;将来有人想读第八个键,得先在这里加一行。
|
|
17
|
-
* `type` 而不是 `interface`(与 `
|
|
17
|
+
* `type` 而不是 `interface`(与 `EventIdentity` 同一条理由):`text_end` 的铸点收 `Record<string, unknown>`,别名才进得去。 */
|
|
18
18
|
export type ModelStreamEvent = {
|
|
19
19
|
type?: string;
|
|
20
20
|
delta?: unknown;
|
|
@@ -32,7 +32,7 @@ export interface ModelStreamIdent {
|
|
|
32
32
|
bgAgentId?: string;
|
|
33
33
|
}
|
|
34
34
|
/** live 面模型文本的帧(本登记册铸的全部四种):两族的逐块帧与各自的段末帧。 */
|
|
35
|
-
export type LiveModelTextFrame = (
|
|
35
|
+
export type LiveModelTextFrame = (EventIdentity & {
|
|
36
36
|
type: "text_delta" | "reasoning_delta";
|
|
37
37
|
delta: string;
|
|
38
38
|
}) | (SegmentEndFields & {
|
|
@@ -63,8 +63,8 @@ export type LiveModelTextFrame = (LiveEventIdentity & {
|
|
|
63
63
|
* ## 帧数与身份(消费端看得见的三件事)
|
|
64
64
|
* · 引擎的每一块 delta 仍恰好一帧、同一枚 `eventId`、原序(`delta` 可以是 `""`:那一块的字节还在窗里)—— 续流游标与 E18 的首块句柄不动;
|
|
65
65
|
* · 段末还在窗里的字节在段末帧**之前**一帧放出(同一族的逐块帧,带流身份三键、**不带** `eventId` ⇒ 不发 `id:` 行:它不是引擎的内容帧);
|
|
66
|
-
* ·
|
|
67
|
-
* 盖住它的跨度还在判定(未收尾的栅栏 / 引号 / JSON 串值 …)⇒ 判定或段末。
|
|
66
|
+
* · 延迟:一个字节在盖住它的判定都不再读到文本末尾之后的下一次重扫时出门(脱敏器的读口闭集定交出点;重扫节律在流式口里)—— 没有开着的判定 ⇒ 到的那一块就出;
|
|
67
|
+
* 盖住它的跨度还在判定(未收尾的栅栏 / 引号 / JSON 串值 …)、凭据词头写在末尾附近 ⇒ 判定或段末。
|
|
68
68
|
*
|
|
69
69
|
* ## 段界(与账本腿同一只谓词)
|
|
70
70
|
* 两族都只在本流的段界词({@link isModelSegmentBoundary})与腿终局 / 子代终态({@link LiveModelText.cut})收段;引擎的 `text_end` 是块的交付点(上一节),不收段。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
2
2
|
import { errorKindOf } from "../observability/err-text.js";
|
|
3
|
-
import { OVERSIZED_REDACTION_PLACEHOLDER } from "
|
|
4
|
-
import {
|
|
3
|
+
import { OVERSIZED_REDACTION_PLACEHOLDER } from "./exit-seat.js";
|
|
4
|
+
import { identityFields, reasoningEndEventData, textEndEventData } from "./project.js";
|
|
5
5
|
import { dropProjectedFace } from "./projection-drop.js";
|
|
6
6
|
import { createRedactionStream } from "./redact.js";
|
|
7
7
|
const BOUNDARY = new Set([
|
|
@@ -93,7 +93,7 @@ export function createLiveModelText() {
|
|
|
93
93
|
const out = [];
|
|
94
94
|
const rest = remainderOf(family, s);
|
|
95
95
|
if (rest !== "")
|
|
96
|
-
out.push({ type: deltaType(family), delta: rest, ...
|
|
96
|
+
out.push({ type: deltaType(family), delta: rest, ...identityFields(s.ident) });
|
|
97
97
|
if (family === "reasoning") {
|
|
98
98
|
const data = reasoningEndEventData({ ...s.ident, eventId: s.segmentEventId, content: s.text.fed });
|
|
99
99
|
if (data !== null)
|
|
@@ -127,7 +127,7 @@ export function createLiveModelText() {
|
|
|
127
127
|
}
|
|
128
128
|
if (!deliver)
|
|
129
129
|
return [];
|
|
130
|
-
return [{ type: deltaType(family), delta: s === undefined ? "" : release(s), ...
|
|
130
|
+
return [{ type: deltaType(family), delta: s === undefined ? "" : release(s), ...identityFields(ev) }];
|
|
131
131
|
};
|
|
132
132
|
return {
|
|
133
133
|
onEvent: (ev, deliver = true) => {
|
|
@@ -157,7 +157,7 @@ export function createLiveModelText() {
|
|
|
157
157
|
if (deliver) {
|
|
158
158
|
const rest = deliverBlock(s);
|
|
159
159
|
if (rest !== "" && endOnly === undefined)
|
|
160
|
-
out.push({ type: "text_delta", delta: rest, ...
|
|
160
|
+
out.push({ type: "text_delta", delta: rest, ...identityFields(s.ident) });
|
|
161
161
|
}
|
|
162
162
|
closeBlock(s);
|
|
163
163
|
}
|