@sema-agent/server 7.133.0 → 7.135.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 +221 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/USAGE.md +222 -36
- package/deploy/sema-up/README.md +16 -0
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +15 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +129 -0
- package/deploy/sema-up/chart/templates/sealed-key.yaml +24 -0
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +14 -0
- package/deploy/sema-up/chart/templates/server.yaml +14 -0
- package/deploy/sema-up/chart/values-full-single.yaml +5 -1
- package/deploy/sema-up/chart/values.yaml +34 -0
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +25 -25
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +66 -154
- package/dist/approval-card.js +33 -52
- package/dist/approval-content-kind.d.ts +26 -6
- package/dist/approval-content-kind.js +23 -3
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +91 -0
- package/dist/approval-gate-currency.js +120 -0
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +14 -8
- package/dist/approval.js +35 -16
- package/dist/auth-bridge.d.ts +1 -1
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/coordinators.d.ts +7 -2
- package/dist/boot/coordinators.js +8 -5
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +2 -0
- package/dist/boot/leader.js +2 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/read-deny-anchor-audit.js +2 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +28 -24
- package/dist/boot/runner-deps.d.ts +29 -16
- package/dist/boot/runner-deps.js +12 -2
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +4 -3
- package/dist/boot/stage-06-runners.js +15 -4
- package/dist/boot/stage-07-capability-layer.d.ts +2 -1
- package/dist/boot/stage-08-reapers.d.ts +2 -1
- package/dist/boot/stage-09-leader.d.ts +2 -1
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -1
- package/dist/boot/stage-10-http-server.js +2 -1
- package/dist/boot/stores.d.ts +8 -0
- package/dist/boot/stores.js +10 -13
- package/dist/boot/web-admin.d.ts +21 -15
- package/dist/boot/web-admin.js +16 -12
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- package/dist/budget.js +5 -1
- package/dist/caller-text-echo.d.ts +2 -0
- package/dist/caller-text-echo.js +2 -1
- package/dist/canonical-json.d.ts +2 -41
- package/dist/canonical-json.js +2 -13
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +2 -2
- package/dist/capabilities/composite-members.js +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +10 -7
- package/dist/capabilities/mcp-probe.js +2 -2
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +27 -24
- package/dist/capability-facts.js +18 -20
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- package/dist/checkpoint-ctx-seal-m28.d.ts +42 -0
- package/dist/checkpoint-ctx-seal-m28.js +19 -0
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/field-conflict.d.ts +2 -1
- package/dist/field-conflict.js +1 -0
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +50 -9
- package/dist/file-history-disclosure.js +8 -13
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +26 -14
- package/dist/fleet/fleet-bus.js +6 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +38 -20
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +28 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +5 -2
- package/dist/http/checkpoint-ctx.d.ts +183 -2
- package/dist/http/checkpoint-ctx.js +197 -2
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +3 -3
- package/dist/http/durable-run-leg.js +7 -5
- package/dist/http/idempotency.d.ts +4 -4
- package/dist/http/idempotency.js +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +39 -13
- package/dist/http/principal-gate.js +30 -6
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/refusal-body.d.ts +12 -0
- package/dist/http/refusal-body.js +11 -0
- package/dist/http/request-guards.d.ts +4 -13
- package/dist/http/request-guards.js +4 -17
- package/dist/http/resume-ctx-read.d.ts +53 -6
- package/dist/http/resume-ctx-read.js +26 -3
- package/dist/http/resume-legs.d.ts +5 -4
- package/dist/http/resume-legs.js +47 -29
- package/dist/http/route-ctx.d.ts +29 -38
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +5 -5
- package/dist/http/routes/approvals-assistant.js +91 -17
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +6 -6
- package/dist/http/routes/diagnostics.js +1 -1
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +5 -4
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/memory-origin.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/rules.js +4 -4
- package/dist/http/routes/runs.js +44 -11
- package/dist/http/routes/session-sync.d.ts +3 -2
- package/dist/http/routes/session-sync.js +109 -62
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions-list.js +4 -5
- package/dist/http/routes/sessions.js +34 -48
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/tasks.js +21 -16
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/trace-usage.js +7 -9
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +39 -33
- package/dist/http/server.js +5 -2
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.d.ts +4 -3
- package/dist/http/submit-ctx.js +19 -3
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +35 -24
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +9 -5
- package/dist/leader/wire.js +8 -7
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-origin-fence.js +2 -2
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-compat.d.ts +1 -1
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/prompt-manifest.d.ts +19 -8
- package/dist/observability/prompt-manifest.js +9 -8
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/observability/tool-trace.js +8 -9
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/orchestration/workflow-park-decision.d.ts +1 -1
- package/dist/orchestration/workflow-park-decision.js +1 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -20
- package/dist/parked-decide.js +8 -5
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +3 -25
- package/dist/permission-rule-vocab.js +0 -13
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/approval-payload-fingerprint.d.ts +14 -6
- package/dist/plugins/approval-payload-fingerprint.js +1 -1
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/caching-session-store.d.ts +24 -33
- package/dist/plugins/caching-session-store.js +8 -19
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +66 -67
- package/dist/plugins/checkpoint-store-sql.js +100 -103
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +23 -12
- package/dist/plugins/local-checkpoint-store.js +29 -4
- package/dist/plugins/local-session-store.d.ts +44 -45
- package/dist/plugins/local-session-store.js +42 -52
- package/dist/plugins/local-session-window.d.ts +12 -6
- package/dist/plugins/local-session-window.js +1 -17
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +76 -39
- package/dist/plugins/one-time-migrations.js +127 -34
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +16 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +74 -31
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +9 -21
- package/dist/plugins/pg-session-storage.js +51 -42
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +22 -14
- package/dist/plugins/remote-env-device.js +28 -16
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +8 -8
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.d.ts +11 -0
- package/dist/plugins/session-ownership.js +11 -0
- package/dist/plugins/session-placement.d.ts +12 -14
- package/dist/plugins/session-placement.js +2 -15
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +9 -2
- package/dist/plugins/tidb-session-store.d.ts +17 -27
- package/dist/plugins/tidb-session-store.js +52 -42
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +19 -4
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-tool-axes.d.ts +12 -0
- package/dist/request-tool-axes.js +20 -0
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/run-local.js +1 -0
- package/dist/runs.d.ts +15 -12
- package/dist/runs.js +19 -4
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +34 -2
- package/dist/sealed-key.js +55 -1
- package/dist/security.d.ts +31 -32
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +19 -12
- package/dist/session-error-wire.js +4 -1
- package/dist/session-incarnation.d.ts +52 -35
- package/dist/session-incarnation.js +23 -8
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +38 -11
- package/dist/session-sync-kernel.js +10 -0
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +3 -1
- package/dist/task-a2a.js +38 -5
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +14 -10
- package/dist/task-mcp.js +39 -12
- package/dist/task-settings.d.ts +34 -18
- package/dist/task-settings.js +34 -4
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +273 -228
- package/dist/tool-approval.js +125 -47
- package/dist/tool-rule-names.d.ts +7 -1
- package/dist/trace/core-keyset-guard.d.ts +15 -9
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +40 -1
- package/dist/trace/exit-seat.js +46 -14
- package/dist/trace/ledger-events.d.ts +6 -4
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +65 -46
- package/dist/trace/project.js +49 -5
- package/dist/trace/redact.d.ts +44 -27
- package/dist/trace/redact.js +343 -73
- package/dist/trace/self-minted-wire.d.ts +39 -14
- package/dist/trace/self-minted-wire.js +9 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +9 -3
- package/dist/trace/wire-projection-faces.js +7 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +29 -4
- package/dist/web-admin-client/skills-mcp.js +31 -4
- package/dist/web-admin-client/types.d.ts +17 -10
- package/dist/workspace-space.d.ts +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +35 -2
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/skills/loop.md +1 -1
- package/dist/mcp-tool-faces.d.ts +0 -69
- package/dist/mcp-tool-faces.js +0 -104
- package/dist/orchestration/workflow-journal-entry.js +0 -27
package/dist/trace/exit-seat.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { stripControlAndBidi } from "@sema-agent/settings-schema";
|
|
2
|
+
import { CALLER_TEXT_CUT_MARK } from "../caller-text-echo.js";
|
|
1
3
|
import { errorKindOf } from "../observability/err-text.js";
|
|
2
4
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
3
5
|
import { OVERSIZED_REDACTION_PLACEHOLDER } from "../observability/run-terminal.js";
|
|
@@ -5,12 +7,23 @@ import { proposeRedactionSpans, REDACTION_TOKEN_RE_SRC } from "./redact.js";
|
|
|
5
7
|
const EXIT_SEATS = {
|
|
6
8
|
"trace-frame-text": { scope: "free-text" },
|
|
7
9
|
"trace-frame-line": { scope: "free-text", maxChars: 300 },
|
|
10
|
+
"operator-log-text": { scope: "free-text", maxChars: 200, emit: "log-line" },
|
|
11
|
+
"operator-log-arg": { scope: "free-text", maxChars: 120, emit: "log-line" },
|
|
12
|
+
"operator-log-error": { scope: "free-text", maxChars: 300, emit: "log-line" },
|
|
13
|
+
"operator-log-message": { scope: "free-text", maxChars: 500, emit: "log-line" },
|
|
14
|
+
"session-title": { scope: "free-text", maxChars: 80, emit: "title-line" },
|
|
8
15
|
};
|
|
16
|
+
export function seatMaxChars(seat) {
|
|
17
|
+
return EXIT_SEATS[seat].maxChars;
|
|
18
|
+
}
|
|
9
19
|
const SEAT_ROWS = new Map(Object.entries(EXIT_SEATS));
|
|
10
20
|
for (const [name, row] of SEAT_ROWS) {
|
|
11
21
|
if (row.maxChars !== undefined && row.maxChars < OVERSIZED_REDACTION_PLACEHOLDER.length) {
|
|
12
22
|
throw new Error(`exit seat "${name}": maxChars ${row.maxChars} cannot hold the failure placeholder (${OVERSIZED_REDACTION_PLACEHOLDER.length} code units)`);
|
|
13
23
|
}
|
|
24
|
+
if (row.emit !== undefined && row.maxChars === undefined) {
|
|
25
|
+
throw new Error(`exit seat "${name}": a row with an emission form must declare maxChars (the cut mark counts inside the bound)`);
|
|
26
|
+
}
|
|
14
27
|
}
|
|
15
28
|
function mergeSpans(spans) {
|
|
16
29
|
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,33 +52,52 @@ function cutPlain(gap, room) {
|
|
|
39
52
|
}
|
|
40
53
|
return gap.slice(0, cut);
|
|
41
54
|
}
|
|
42
|
-
function renderOnce(text, groups
|
|
55
|
+
function renderOnce(text, groups) {
|
|
43
56
|
const parts = [];
|
|
44
|
-
let len = 0;
|
|
45
57
|
let at = 0;
|
|
46
58
|
for (const g of groups) {
|
|
47
|
-
|
|
48
|
-
if (maxChars !== undefined && len + gap.length > maxChars)
|
|
49
|
-
return parts.join("") + cutPlain(gap, maxChars - len);
|
|
50
|
-
parts.push(gap);
|
|
51
|
-
len += gap.length;
|
|
52
|
-
if (maxChars !== undefined && len + g.repl.length > maxChars)
|
|
53
|
-
return parts.join("");
|
|
54
|
-
parts.push(g.repl);
|
|
55
|
-
len += g.repl.length;
|
|
59
|
+
parts.push(text.slice(at, g.start), g.repl);
|
|
56
60
|
at = g.end;
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
parts.push(maxChars === undefined || len + tail.length <= maxChars ? tail : cutPlain(tail, maxChars - len));
|
|
62
|
+
parts.push(text.slice(at));
|
|
60
63
|
return parts.join("");
|
|
61
64
|
}
|
|
65
|
+
function emitAs(form, text) {
|
|
66
|
+
switch (form) {
|
|
67
|
+
case "log-line":
|
|
68
|
+
return stripControlAndBidi(text);
|
|
69
|
+
case "title-line":
|
|
70
|
+
return stripControlAndBidi(text.replace(/[\r\n]+/g, " "))
|
|
71
|
+
.trim()
|
|
72
|
+
.replace(/^["'「『]+/, "")
|
|
73
|
+
.replace(/["'」』]+$/, "")
|
|
74
|
+
.trim();
|
|
75
|
+
default: {
|
|
76
|
+
const unhandled = form;
|
|
77
|
+
throw new Error(`exit seat: unhandled emission form ${String(unhandled)}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const layoutOf = (row) => (row.emit === undefined ? "multi-line" : "single-line");
|
|
82
|
+
function boundRow(out, row) {
|
|
83
|
+
if (row.maxChars === undefined || out.length <= row.maxChars)
|
|
84
|
+
return out;
|
|
85
|
+
if (row.emit === undefined)
|
|
86
|
+
return cutPlain(out, row.maxChars);
|
|
87
|
+
return cutPlain(out, row.maxChars - CALLER_TEXT_CUT_MARK.length) + CALLER_TEXT_CUT_MARK;
|
|
88
|
+
}
|
|
62
89
|
export function seatText(seat, text) {
|
|
63
90
|
const row = SEAT_ROWS.get(seat);
|
|
64
91
|
if (row === undefined)
|
|
65
92
|
throw new Error(`exit seat: ${JSON.stringify(seat)} is not a row of the seat table`);
|
|
66
93
|
let out;
|
|
67
94
|
try {
|
|
68
|
-
|
|
95
|
+
if (row.emit !== undefined && emitAs(row.emit, text) === "")
|
|
96
|
+
out = "";
|
|
97
|
+
else {
|
|
98
|
+
const rendered = renderOnce(text, mergeSpans(proposeRedactionSpans(text, row.scope, layoutOf(row))));
|
|
99
|
+
out = boundRow(row.emit === undefined ? rendered : emitAs(row.emit, rendered), row);
|
|
100
|
+
}
|
|
69
101
|
}
|
|
70
102
|
catch (err) {
|
|
71
103
|
recordFailOpen("server.run-terminal.redact-threw", `seat=${seat} len=${typeof text === "string" ? text.length : -1} err=${errorKindOf(err)}`);
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
* · **腿自己的带外行**:park/终局/失败/建议/用量/装配自证(不来自流事件)。
|
|
33
33
|
*/
|
|
34
34
|
export type LedgerEventType = "reasoning" | "text" | "tool_start" | "tool_end" | "status" | "context_usage" | "compacted" | "diagnostics" | "steering_injected" | "compaction_outcome"
|
|
35
|
-
/**
|
|
35
|
+
/** [ref](core 7.53.0 [ref]):压缩 pass 的开始帧(`{ trigger, pass, startedAt }`;结束帧带同一个 `pass`)。原样落账,两条 durable 腿同源。 */
|
|
36
36
|
| "compaction_started" | "workspace_changed" | "wiring_manifest"
|
|
37
|
-
/**
|
|
37
|
+
/** [ref](7.71.0):运行期名册变更(core 7.8.0 [ref] ⑪)。**快照语义**——`delta.roster` 是整只
|
|
38
38
|
* 变更后名册,消费端收到即整只替换,所以回放不需要任何合并;它的耐久面因此不是 `wiring_manifest.tools`
|
|
39
39
|
* 的重复,而是那份开腿快照**之后**的每一次改动(修前两条 durable 腿零 case ⇒ 回放只见开头一版)。 */
|
|
40
40
|
| "tool_roster_delta"
|
|
@@ -52,7 +52,9 @@ export type LedgerEventType = "reasoning" | "text" | "tool_start" | "tool_end" |
|
|
|
52
52
|
| "task_started" | "task_progress" | "task_notification" | "turn_end"
|
|
53
53
|
/** park 行名**两个**(`appendParked(kind)` 逐字取自 `result.status`)—— 运行期闭集见
|
|
54
54
|
* {@link PARK_LEDGER_EVENT_TYPES}(本联合是它的类型面,两者由下方的双向断言锁步)。 */
|
|
55
|
-
| "suspended" | "needs_review" | "done" | "failed" | "suggestions" | "model_usage" | "prompt_assembled" | "config_assembled"
|
|
55
|
+
| "suspended" | "needs_review" | "done" | "failed" | "suggestions" | "model_usage" | "prompt_assembled" | "config_assembled"
|
|
56
|
+
/** core 7.54.0 [ref] O9b S1:`permission.cross_boundary_taint` 帧的耐久行(伴随记录,与 `config_assembled` 同一只队列、同一批 drain 点;只在执行于目标设备的树上有)。 */
|
|
57
|
+
| "cross_boundary_taint" | "file_link"
|
|
56
58
|
/** 人在环三族的 open/close 帧对(投递面 = 本腿的 durable events tail)。 */
|
|
57
59
|
| "elicitation" | "elicitation_complete" | "question" | "question_complete" | "tool_approval" | "tool_approval_complete"
|
|
58
60
|
/** [ref] §4.3 呈卡族的开卡帧与单卡消卡帧(与上面两只 tool_approval 帧同一条投递面;一条腿只发其中一族,
|
|
@@ -93,7 +95,7 @@ export type LedgerEventType = "reasoning" | "text" | "tool_start" | "tool_end" |
|
|
|
93
95
|
export declare const PARK_LEDGER_EVENT_TYPES: readonly ["suspended", "needs_review"];
|
|
94
96
|
export type ParkLedgerEventType = (typeof PARK_LEDGER_EVENT_TYPES)[number];
|
|
95
97
|
/**
|
|
96
|
-
* 🔴 **模型自由文本行名的运行时闭集**(
|
|
98
|
+
* 🔴 **模型自由文本行名的运行时闭集**([ref] / [ref])—— 与 {@link PARK_LEDGER_EVENT_TYPES} 同一条理由、
|
|
97
99
|
* 同一种锁步形。
|
|
98
100
|
*
|
|
99
101
|
* 这两行(`text` = 模型写给用户的文本,`reasoning` = 同一支笔的 CoT)是账本上**唯二**逐字携带模型散文的型,
|
|
@@ -152,7 +152,7 @@ export declare function createLedgerSink(opts: {
|
|
|
152
152
|
* 各传自己看得见的那个词(位①=流事件 `ev.type`,位②=账本行 `type`);拿不到类型的打点方
|
|
153
153
|
* (core 的 onActivity 第五席、resume 腿手动打点)省参,`kind` 诚实缺席(见 turn-activity.ts)。 */
|
|
154
154
|
onActivity?: (kind?: string, statusData?: Record<string, unknown>) => void;
|
|
155
|
-
/**
|
|
155
|
+
/** [ref]:这条腿的 `wiring_manifest.instructions` 段(腿的 `InstructionSelectionLeg.segment`)。**必填**:账本行与 live 帧是
|
|
156
156
|
* 同一条腿的两个载体,段必须来自同一只腿;在投帧那一刻读(core 推帧之前已 await 过 loader)。返回 `undefined` ⇒ 段缺席。 */
|
|
157
157
|
instructionsSegment: () => InstructionsSegment | undefined;
|
|
158
158
|
}): LedgerSink;
|
|
@@ -7,7 +7,7 @@ import { type SegmentEndFields } from "./project.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function isModelSegmentBoundary(type: string): boolean;
|
|
9
9
|
/** live 面的段末帧(`type` 即事件名;其余键由 `reasoningEndEventData` 白名单铸出)。
|
|
10
|
-
* 形是**声明**出来的、不是 `Record<string, unknown>`(
|
|
10
|
+
* 形是**声明**出来的、不是 `Record<string, unknown>`([ref] 门①):`eventId` 是本帧的续流游标,
|
|
11
11
|
* 型必须说得出口 —— live 腿的 `id:` 行取的正是它。 */
|
|
12
12
|
export type ReasoningEndFrame = SegmentEndFields & {
|
|
13
13
|
type: "reasoning_end";
|
|
@@ -54,7 +54,7 @@ export interface ReasoningSegments {
|
|
|
54
54
|
/**
|
|
55
55
|
* 一段推理的**段末事件 id** —— 唯一铸点,live 段末帧与账本 `reasoning` 行共用这一只。
|
|
56
56
|
*
|
|
57
|
-
* 🔴 **为什么段末帧不能沿用任何一块 delta 的 `eventId`**(
|
|
57
|
+
* 🔴 **为什么段末帧不能沿用任何一块 delta 的 `eventId`**([ref]):SSE 的 `id:` 行是**续流游标**,
|
|
58
58
|
* 「每帧唯一」就是它的定义(消费端据它做**整帧幂等**:见过的 id 整帧丢);而本仓 live 腿的 `id:` 行
|
|
59
59
|
* 恰恰取自载荷的 `eventId`(`http/routes/tasks.ts` 的 `sseData`)。沿用段内某一块的锚 ⇒ 段末帧与那一块
|
|
60
60
|
* delta 顶着同一枚游标,消费端把**权威段**当重放帧丢弃 —— 本帧存在的唯一理由(整段脱敏后的权威副本)
|
|
@@ -74,7 +74,7 @@ export interface ReasoningSegments {
|
|
|
74
74
|
export declare function reasoningSegmentEventId(anchor: unknown): string | undefined;
|
|
75
75
|
/** 一块 `reasoning_delta` 对段的**贡献字节** —— 非空串才算。账本腿与三条 live 腿共用这一只:空/坏形
|
|
76
76
|
* 增量一个字节都不贡献,既不开段也不参与闩锚 ⇒ 两面结构上不可能把锚闩在不同的帧上(`reasoning_end`
|
|
77
|
-
* 与账本 `reasoning` 行的正文早就逐字节相等,身份面随
|
|
77
|
+
* 与账本 `reasoning` 行的正文早就逐字节相等,身份面随 [ref] 收进同一条规则)。 */
|
|
78
78
|
export declare function reasoningDeltaBytes(ev: {
|
|
79
79
|
delta?: unknown;
|
|
80
80
|
}): string | undefined;
|
package/dist/trace/project.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* old session-join `toolOutput` hook is gone, there's a real source now); `eventId`/`parentToolCallId` (§E2) ride
|
|
13
13
|
* each content event, additive / tolerate-absent.
|
|
14
14
|
*
|
|
15
|
-
* 🔴 **本族 `*EventData` 构造器的入参型不是白名单**(
|
|
15
|
+
* 🔴 **本族 `*EventData` 构造器的入参型不是白名单**([ref] 起,别再照旧读法维护它)。
|
|
16
16
|
* 每只构造器的形参型是**这条投影的本地入参形**,故意比 core 的分支型松:三条腿里有两条(durable 账本 /
|
|
17
17
|
* resume 回放)手里只有磁盘上的 `Record<string, unknown>`,窄值型在那里结构上不成立,所以 `unknown` +
|
|
18
18
|
* 内部逐层窄化是**有意**的,不是欠账;核过的 core 键在场性由投影体自己的条件展开臂决定。
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import type { GateOutcome, McpDelivered, TaskResult, SystemInjectionPriority } from "@sema-agent/core";
|
|
27
27
|
import type { RunEvent, RunRecord } from "../plugins/store-contracts.js";
|
|
28
28
|
import type { ModelUsageDelta, ModelUsageTracker, PromptManifestRecord } from "../budget.js";
|
|
29
|
+
import type { RunCompanionRecord } from "../observability/prompt-manifest.js";
|
|
29
30
|
import { type SafeText } from "./exit-seat.js";
|
|
30
31
|
import { type SemaProvenanceInput } from "./sema-provenance.js";
|
|
31
32
|
import type { LedgerEventType } from "./ledger-events.js";
|
|
@@ -51,7 +52,7 @@ export declare function appendModelUsageDelta(append: AppendFn, modelUsage: Mode
|
|
|
51
52
|
* (one Map.get), so callers fire it liberally. */
|
|
52
53
|
export declare function appendPromptManifest(append: AppendFn, tracker: {
|
|
53
54
|
drain(taskId: string): PromptManifestRecord[] | undefined;
|
|
54
|
-
|
|
55
|
+
drainCompanions?(taskId: string): RunCompanionRecord[] | undefined;
|
|
55
56
|
} | undefined, taskId: string): Promise<void>;
|
|
56
57
|
/** E8: at a TERMINAL done — flush the final delta, then SUM all `model_usage` events (every process leg) into the
|
|
57
58
|
* result's `stats.modelUsage` echo. Returns the result unchanged when no usage was tracked (shell soft-degrades). */
|
|
@@ -124,7 +125,7 @@ export type TraceBlock = {
|
|
|
124
125
|
readonly [member: string]: unknown;
|
|
125
126
|
};
|
|
126
127
|
/**
|
|
127
|
-
* 🔴 **模型自由文本账本行(`text` / `reasoning`)的唯一载荷铸点**(
|
|
128
|
+
* 🔴 **模型自由文本账本行(`text` / `reasoning`)的唯一载荷铸点**([ref] / [ref],7.75.1)。
|
|
128
129
|
*
|
|
129
130
|
* ## 为什么是一只函数,而不是两处各写一句
|
|
130
131
|
* 这两行的载荷此前由**两条腿各自手拼**:`trace/ledger-sink.ts` 的 turn flush 与 `http/server.ts` 的
|
|
@@ -159,11 +160,11 @@ export declare function toolStartEventData(ev: {
|
|
|
159
160
|
parentToolCallId?: string;
|
|
160
161
|
}): Record<string, unknown>;
|
|
161
162
|
/**
|
|
162
|
-
* 🔴 **筛子是一只总函数**(
|
|
163
|
+
* 🔴 **筛子是一只总函数**([ref],codex 对抗复审 r1 [medium] 亲核复现后修)—— 上面纪律②许诺的
|
|
163
164
|
* 「坏形 ⇒ report + withhold,**不抛**」此前是靠**逐条枚举**坏形兑现的,枚举不到的那些照样抛:
|
|
164
165
|
* `projectSettlement` 对 `note` / `who.approver` 先 `redactSecrets` 再截断,而 `redactSecrets` 会在
|
|
165
|
-
* 病态输入上爆回溯栈(`RangeError`:≥2^23 单段那一形已由
|
|
166
|
-
* PEM 栅栏臂的标签交替循环由
|
|
166
|
+
* 病态输入上爆回溯栈(`RangeError`:≥2^23 单段那一形已由 [ref] 的 `atLeast` 铸点闭掉,JSON 秘密字段臂的转义对循环与
|
|
167
|
+
* PEM 栅栏臂的标签交替循环由 [ref] 换成手写扫描器闭掉 —— 已知形全部闭掉,本段写的是「当时为什么要总函数化」),
|
|
167
168
|
* 两条叶各能抛一次。总函数化照留:它兑现的是「坏字节一律 withhold」这条**结构**,不依赖脱敏器今天抛不抛。
|
|
168
169
|
*
|
|
169
170
|
* 抛出去的代价按腿算,而且一条比一条重:写腿落账那处的 `.catch` 看不到**同步**投影期的异常;读腿上它
|
|
@@ -178,7 +179,7 @@ export declare function toolStartEventData(ev: {
|
|
|
178
179
|
*/
|
|
179
180
|
export declare function screenedGate(v: unknown): GateOutcome | undefined;
|
|
180
181
|
/**
|
|
181
|
-
* 🔴 **账本裸回放面的读腿一步**(
|
|
182
|
+
* 🔴 **账本裸回放面的读腿一步**([ref])—— `GET /v1/runs/:id/events`(`http/routes/runs.ts` 的
|
|
182
183
|
* `formatEvent`)对每一行走这一口,把行上的 `GateOutcome` 交给**同一只** {@link screenedGate}。
|
|
183
184
|
*
|
|
184
185
|
* ## 它补的是哪一格
|
|
@@ -196,7 +197,7 @@ export declare function screenedGate(v: unknown): GateOutcome | undefined;
|
|
|
196
197
|
* ## 读腿与写腿现在是**同一只**筛(零双读)
|
|
197
198
|
* 7.72.0–7.73.0 期间读腿多一步「认本服务上一版写下的退役词旧拼法」(`unresolvable` → `ancestor_marked`),
|
|
198
199
|
* 那是一条**长期双读臂**:同一份字节在写腿与读腿上有两种理解,而且没有到期日。7.74.0 把它换成**一次性
|
|
199
|
-
* 迁移**(启动期把存量字节原地改名;窗关后已删码)。
|
|
200
|
+
* 迁移**(启动期把存量字节原地改名;窗关后已删码)。[ref](core 7.51.0 [ref])起这只筛是 core `screenGateOutcome(g)` 缺省的**档案读法**
|
|
200
201
|
* (每个闭集 = 今日成员 ∪ core `RETIRED_MEMBERS`),读腿与写腿同走它:残留旧拼法的字节(local 车道引擎 File 店里不可改写的已决行)
|
|
201
202
|
* **整条读回、原词上帧、计数 0**(档案词是当年合法铸下的事实,不是缺陷,不改写成今天的词);整条 withhold + 计数的只有真缺陷
|
|
202
203
|
* (集外且不在退役表的词、破不变量、形坏)。读法只有一种。
|
|
@@ -210,12 +211,12 @@ export declare function screenedGate(v: unknown): GateOutcome | undefined;
|
|
|
210
211
|
export declare function screenedStoredEventData(type: string, data: unknown): unknown;
|
|
211
212
|
/** `text_end` 段末帧的**唯一**铸点(三腿共用:top stream / 转发子代腿 / 子代 tail 面)。content = 段权威全文 ⇒ 与
|
|
212
213
|
* durable 面(`result` / 账本 `text` 行)同一只 {@link redactModelText}(认出才改写、抛则占位、不设上限)。
|
|
213
|
-
* 此前三处各自逐字透传 —— 同一份文本毫秒后在 `done.result.result` 上已脱,live 面却在凭据生成瞬间明文(
|
|
214
|
-
* `text_delta` 仍逐字:跨 chunk 的凭据无法就地判;clay [ref] ②(2026-09-18)裁定**维持逐字成文**(
|
|
214
|
+
* 此前三处各自逐字透传 —— 同一份文本毫秒后在 `done.result.result` 上已脱,live 面却在凭据生成瞬间明文([ref])。
|
|
215
|
+
* `text_delta` 仍逐字:跨 chunk 的凭据无法就地判;clay [ref] ②(2026-09-18)裁定**维持逐字成文**([ref] U-3 关票),
|
|
215
216
|
* 权威段 `text_end.content` 已脱敏、消费端段末整段替换即得脱敏读法。
|
|
216
217
|
* 坏形(content 非串/空串)⇒ null(丢帧,不铸「权威空段」:core 契约明言空段不发本帧,消费端收到空段会清掉已攒 delta)。
|
|
217
218
|
* 身份**四键**随行(live 现状带全四键,消费端可能已依赖);值经 {@link identityKey} —— 非空 string 才上 wire
|
|
218
|
-
* (
|
|
219
|
+
* ([ref] 起不再逐字透传:坏形身份键会在 live 写口上铸出假游标)。 */
|
|
219
220
|
export declare function textEndEventData(ev: Record<string, unknown>): SegmentEndFields | null;
|
|
220
221
|
/**
|
|
221
222
|
* live 面的**身份四键**(core `TaskEventIdentity` 全集)—— 一个属主,两处共用({@link segmentEndFields}
|
|
@@ -223,7 +224,7 @@ export declare function textEndEventData(ev: Record<string, unknown>): SegmentEn
|
|
|
223
224
|
* **只剩键集**:那边两键(durable builder 对另两键的既定排除),这边四键(live 现状,消费端已依赖);
|
|
224
225
|
* **值判据是同一条** —— 两只都问 {@link identityKey}(非空 `string` 才上 wire,绝不强转)。
|
|
225
226
|
*
|
|
226
|
-
* 🔴 **型必须说得出口**(
|
|
227
|
+
* 🔴 **型必须说得出口**([ref]):`eventId` 是 live 腿 SSE `id:` 行的**唯一**来源,而 `id:` 行是续流游标
|
|
227
228
|
* ——一个连值的型都说不出的键不许铸成游标。非串/空串 ⇒ 键缺席(与「无锚不发 `id:` 行」同一条纪律:
|
|
228
229
|
* 不可锚的位置绝不伪装成可锚)。转发子代腿的帧是 UNTRUSTED RAW(§E1),这一道同时是它的形判门。
|
|
229
230
|
*
|
|
@@ -308,12 +309,12 @@ export declare function toolEndEventData(ev: {
|
|
|
308
309
|
* 真源是 `tool_end`(core 明写 `elapsedTimeSeconds` **不等于** `tool_end` 的 duration)。
|
|
309
310
|
*
|
|
310
311
|
* ## 信任划线
|
|
311
|
-
* · `toolCallId` / `toolName` —— 调用 id(🔴
|
|
312
|
+
* · `toolCallId` / `toolName` —— 调用 id(🔴 [ref] 订正:出身是**服务商**在 tool_use / tool_calls 里给的,引擎缺席时自铸兜底、越界时折叠 ——
|
|
312
313
|
* 此前写「引擎铸」不实)与名册里的工具名(与 `tool_start` 逐字同源)⇒ verbatim。调用 id 这一族的形状在**全部面的共同入口**一次施加 ——
|
|
313
|
-
* core 7.36.0(
|
|
314
|
-
* 恒是在形的引擎 id(残余两条
|
|
314
|
+
* core 7.36.0([ref])brain 建调用那一行的准入(在形原样 / 越界单射折叠,原字节只在转录 `ToolCall.wireId`),一方 brain 新铸的调用在逐帧面上
|
|
315
|
+
* 恒是在形的引擎 id(残余两条 [ref]:≤7.106.0 写下的存量行 resume 出来的帧是服务商原串逐字;宿主 Brain 不准入 KL-1207-a —— 详见
|
|
315
316
|
* run-terminal `admitProviderEcho` 顶注);
|
|
316
|
-
* 本仓不设第二道闸(见 run-terminal `admitProviderEcho` 顶注;
|
|
317
|
+
* 本仓不设第二道闸(见 run-terminal `admitProviderEcho` 顶注;[ref] 关)。
|
|
317
318
|
* · `elapsedTimeSeconds` —— 引擎铸的整秒,单调、一 call 一个原点 ⇒ 有限数才铸键。
|
|
318
319
|
* · `output` —— 🔴 **UNTRUSTED RAW**,core 逐字「exactly as `tool_end.output`: process output that may
|
|
319
320
|
* carry secrets, paths or PII; core bounds only its SIZE, and a consumer MUST redact before persisting
|
|
@@ -489,7 +490,7 @@ export declare function taskNotificationEventData(ev: {
|
|
|
489
490
|
* `kind` 过闭集(`trace/sema-provenance.ts` 单点,park 半场同一判据);`agentType` 本 mount 恒缺席(工具无
|
|
490
491
|
* agent-type 席),在场即透传(fleet spawn 帧按 taskId 可 join 时上游给)。 */
|
|
491
492
|
_sema_provenance?: SemaProvenanceInput;
|
|
492
|
-
/** core 7.30.0 [ref] S1 /
|
|
493
|
+
/** core 7.30.0 [ref] S1 / [ref] / [ref]([ref]):委派终态帧三枚 facet + 重供两键 —— 判据单点在
|
|
493
494
|
* `trace/task-notification-facets.ts`(与 park 半场同一只;入参按 `unknown` 收、判过形才成 typed)。 */
|
|
494
495
|
spawnName?: string;
|
|
495
496
|
handback?: string;
|
|
@@ -593,7 +594,7 @@ export declare function compactionOutcomeEventData(ev: {
|
|
|
593
594
|
reason?: SafeText;
|
|
594
595
|
}>;
|
|
595
596
|
/**
|
|
596
|
-
* `compaction_started`(
|
|
597
|
+
* `compaction_started`([ref],core 7.53.0 [ref])—— 一次压缩 pass 在提交点(触发闸过了、切点在、`preCompact` 没拦)宣告开始,先于摘要调用:
|
|
597
598
|
* 一次在供应方重试表里等很久的摘要(core 实测 503 × 11、173 s)从此在流上不是静默的。**原样投影**:`{ trigger, pass, startedAt }` + 身份两键,
|
|
598
599
|
* 不自铸相位、不铸 run / session id(那是流的,不是帧的键)。三键都是引擎铸的闭形值:`trigger` 闭集词(`auto` / `manual` / `forced`,与结束帧同一张词表)、
|
|
599
600
|
* `pass` 不透明 id(结束这次 pass 的那一帧 —— `compacted` 或 `compaction_outcome` —— 带同一个 `pass`)、`startedAt` 引擎时钟 epoch 毫秒 ⇒ 不脱敏、逐字;
|
|
@@ -693,7 +694,7 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
693
694
|
* 两词:core 只看合成后的 caps deny 位,本仓分得出这个 false 是 center 下发的还是本地 env 写的)。
|
|
694
695
|
* ⚠️ **`settings_denied` 不折进 `denied`,它折进 `no_intent`**(codex 车BO r1 [medium] 验真后纠):
|
|
695
696
|
* settings 层的 kill-switch 折的是**模式**(`effectivePermissionMode`:auto → default),于是 resolve-spec
|
|
696
|
-
* 阶段④ 写的 `TaskSpec.permissionMode` 是 `"default"`(
|
|
697
|
+
* 阶段④ 写的 `TaskSpec.permissionMode` 是 `"default"`([ref] 前是「不写意图座 `autoModeRequested`」)⇒ core 的武装谓词第一项就落空;
|
|
697
698
|
* 而本地 env 腿折的是 **caps**(`applyLocalAutoModeDeny`),模式照写 `"auto"` ⇒ core 才报 `denied`(并按 `operator_deny` 折 default、发
|
|
698
699
|
* `config.permission_mode_unavailable`)。两条腿在 manifest 上
|
|
699
700
|
* **分不开**,要分辨得读 `/v1/capabilities`。对照表与保鲜钉在 `test/wiring-manifest-projection.test.ts`
|
|
@@ -705,7 +706,7 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
705
706
|
* 抛)。账本回放/第三方 producer 送来的矛盾对若原样上 wire,按 `armed` 读与按 `reason` 读的消费端会得到
|
|
706
707
|
* **相反**的答案 —— 这条轴上(@cli `sema doctor permissions` 正读它)两个答案比没答案更坏 ⇒ 整段不铸。
|
|
707
708
|
* 这不是改语义:它与本函数「畸形值一律按缺席」是同一条规则,而这条不变量是 core 自己写的段内契约。
|
|
708
|
-
* · `mcp[]`(`WiringManifestMcpEntry[]`;core 7.5.0 [ref],
|
|
709
|
+
* · `mcp[]`(`WiringManifestMcpEntry[]`;core 7.5.0 [ref],[ref] 提货件)—— **裁:租户可见,逐条目挑键,
|
|
709
710
|
* `error` 一格不投**。
|
|
710
711
|
* ① **同主体同受众**:它是 per-leg 的读面「我这条腿申报的每台 MCP 服务器,连上了没有、挂了是哪一类、
|
|
711
712
|
* 挂上来几个工具」。同一主体(调用方自己的 run)、同一条轴上,本仓早已把**更粗**的同类事实投给
|
|
@@ -729,7 +730,7 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
729
730
|
* (「connection state is a fact about this leg's attempt, not about the assembly」)。
|
|
730
731
|
* ⚠️ 空数组 ≠ 缺席:core 顶注逐字「an empty array is "this leg declared no servers", absence is an older
|
|
731
732
|
* mint or an external derivation」⇒ 空数组照铸,别折成缺席。
|
|
732
|
-
* 🔴 **⑤ `liveness`(core 7.24.3 [ref] /
|
|
733
|
+
* 🔴 **⑤ `liveness`(core 7.24.3 [ref] / [ref] 提货件)—— 裁:租户可见,整条记录投,逐键挑**。
|
|
733
734
|
* `{state, observedAt, errorCode?}` = 引擎**最后一次观察**到的「这台还够得着吗」。受众判据与同行
|
|
734
735
|
* 其余键**同一条**(同主体同受众、引擎派生的闭形值、非 governance 侧信道 —— 它同样不进
|
|
735
736
|
* `configFingerprint`),所以这一格不需要新的裁定,只需要新的**读法**。
|
|
@@ -746,17 +747,17 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
746
747
|
* 而经过本投影后**判形没过也落缺席**(词出闭集 / `observedAt` 非有限数 / 整只不是对象)。
|
|
747
748
|
* ⇒ 对消费端,缺席只能读成「**没有可用的观察记录**」,**不许**据它反推这条腿拨没拨过号。
|
|
748
749
|
* · `writeProtection`(`{ targetView: "spelling-only" | "target" }`;core 7.20.1 [ref] / clay [ref] 丙,
|
|
749
|
-
*
|
|
750
|
+
* [ref] 提货件)—— **裁:租户可见,逐字透传**。它是 per-leg 的读面:「这条腿的写保护判官,拿到的是
|
|
750
751
|
* 哪一种目标读法」——`"target"` = 判官握着执行环境,拼法没命中时会在**解析后的真目标**上再判一次;
|
|
751
752
|
* `"spelling-only"` = 没有环境,拼法就是全部判决,只经别名/软链够到受保护行的写被清掉。
|
|
752
753
|
* ① **同主体同受众**:同一条腿、调用方自己的 run。而且这件事对该调用方**本就行为可观测** —— 在无手
|
|
753
|
-
* 车道上用一只声明了 `pathTarget` 写面的 MCP 工具对别名写一次就看得见(
|
|
754
|
+
* 车道上用一只声明了 `pathTarget` 写面的 MCP 工具对别名写一次就看得见([ref] 亲核可达)。剥掉它
|
|
754
755
|
* 并不收走任何能力,只收走那句诚实的标签,等于把 [ref] 刚刚消灭的**静默**在租户半场原样重建。
|
|
755
756
|
* ② **值的形**:core 的**两词闭集**,判据走 core 导出的 `WRITE_PROTECTION_TARGET_VIEWS` 常量(不抄
|
|
756
757
|
* 词表 —— 与 `delivered` 的 `MCP_DELIVERY_VERDICTS` 同一条);引擎派生、非用户内容 ⇒ 不脱敏、逐字。
|
|
757
758
|
* ③ 🔴 **最小披露仍然成立**:本键只答「判官有哪一种读法」,**从不**答「判官握着哪些路径」——
|
|
758
759
|
* 名表逐行内容(`rows` / `source` / `droppedDefaultRows`)照旧只在 operator 面
|
|
759
|
-
* (`GET /v1/diagnostics/wiring` 的 `writeProtection` 键,
|
|
760
|
+
* (`GET /v1/diagnostics/wiring` 的 `writeProtection` 键,[ref]),租户面照旧只有
|
|
760
761
|
* `/v1/capabilities.writeProtection.{armed, rows, replaced}` 三项计数。两者语义不同、同名不同物:
|
|
761
762
|
* 诊断面那一格是**本 server 装配的名表**(boot 产物),本段是**core 判官的自报读法**(per-leg)。
|
|
762
763
|
* ④ **不是 governance 侧信道**:它是「这条腿接没接手」的函数,与 lockedConfig/compliance/
|
|
@@ -765,7 +766,7 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
765
766
|
* ⚠️ **缺席 = 第三态**:core 的段是 **present-iff 编译出了判官**,`writeProtectedPaths: []` 的部署
|
|
766
767
|
* 整段缺席。缺席**绝不**折成 `"spelling-only"`(那是「判官在、但只认拼法」,完全不同的一件事),
|
|
767
768
|
* 也不铸 `writeProtection: {}`。词出闭集同样**不**折进缺席,走 `dropProjectedFace` 留痕(见那里)。
|
|
768
|
-
* · `autoConsolidation`(`{ onRecommendation: true }`;core 7.21.0 [ref],
|
|
769
|
+
* · `autoConsolidation`(`{ onRecommendation: true }`;core 7.21.0 [ref],[ref] 提货件)—— **裁:operator
|
|
769
770
|
* 受众,租户面剥**,所以它**不在本构造器里**,在 {@link wiringManifestOperatorEventData}。四条判据逐字在
|
|
770
771
|
* `core-keyset-guard.ts` ⑥b 的 `WiringSectionExcluded` 那一行(与 `governance` / `configFingerprint`
|
|
771
772
|
* 同表同处,免得同一条裁定有两个写者)。一句话:它是**出口事实**(武装 = 每个建议任务之后整库记忆自动
|
|
@@ -773,15 +774,15 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
773
774
|
* 并且它对调用方**本就不可观测**(整理跑在终端 harvest 之后、fire-and-forget、宿主侧),剥掉它不收走
|
|
774
775
|
* 任何能力 —— 这正是 `writeProtection` 判据①**不成立**的那一格。
|
|
775
776
|
* ⚠️ **缺席 = 未武装**(core present-iff),不折 `false`、不读「未知」。
|
|
776
|
-
* 🔴 **
|
|
777
|
+
* 🔴 **[ref](7.85.0)起本条要连着 `core-keyset-guard.ts` ⑥b 判据②的补句读**:同一个事实在会话面
|
|
777
778
|
* (`GET /v1/sessions/:id/memory-status` 的 `autoConsolidationArmed`)是可读的,而这一段仍然剥 ——
|
|
778
779
|
* 「一个事实一张脸」,两处同源、唯一读点。裁定正文在那一处,这里不抄第二份。
|
|
779
|
-
* · `readDeny`(`{ builtinTiers: readonly string[] }`;core 7.22.0 [ref],
|
|
780
|
+
* · `readDeny`(`{ builtinTiers: readonly string[] }`;core 7.22.0 [ref],[ref] 提货件)—— **裁:operator
|
|
780
781
|
* 受众,租户面剥**,所以它**不在本构造器里**,在 {@link wiringManifestOperatorEventData}。四条判据逐字在
|
|
781
782
|
* `core-keyset-guard.ts` ⑥b 的 `WiringSectionExcluded` 那一行(与 `governance` / `configFingerprint` /
|
|
782
783
|
* `autoConsolidation` 同表同处,免得同一条裁定有两个写者)。一句话:它答的是**这台部署选了哪几档内置
|
|
783
784
|
* 敏感路径 deny 表**——一条部署治理面的**选择**,与 `writeProtection` 那种「这条腿手里有什么设施」的
|
|
784
|
-
* 自述不同族;而且它是本仓 env `READ_DENY_BUILTIN_TIERS` 的生效读出口,名表面归 operator(
|
|
785
|
+
* 自述不同族;而且它是本仓 env `READ_DENY_BUILTIN_TIERS` 的生效读出口,名表面归 operator([ref])。
|
|
785
786
|
* ⚠️ **缺席 = 没有内置行判这条腿**(core present-iff:实质激活至少一行才铸),**不是**「没有读被 deny
|
|
786
787
|
* 判」—— 部署自己的 `readDenyPatterns` 刻意不上报(模式文本是部署材料,不是枚举)。**空数组永不发出**
|
|
787
788
|
* (「关」与「开到什么都不判」是同一个事实)⇒ 收到空数组按**坏 producer** 处置并留痕,见那里。
|
|
@@ -792,10 +793,10 @@ export declare function workspaceChangedEventData(ev: {
|
|
|
792
793
|
* `core-keyset-guard.ts` ⑥b —— 那才是「core 加了段/加了成员」的可靠红点,两道并用缺一不可。
|
|
793
794
|
*/
|
|
794
795
|
/**
|
|
795
|
-
* 🔴 **`wiring_manifest.mcp[]` 一行上 wire 的形 —— 全仓唯一属主**(
|
|
796
|
+
* 🔴 **`wiring_manifest.mcp[]` 一行上 wire 的形 —— 全仓唯一属主**([ref] 从 {@link wiringManifestEventData}
|
|
796
797
|
* 的内联 IIFE **逐字**提出来,零行为变化;既有钉在 `test/wiring-manifest-projection.test.ts`)。
|
|
797
798
|
*
|
|
798
|
-
* 为什么必须是一只具名函数:
|
|
799
|
+
* 为什么必须是一只具名函数:[ref] 又开了两条读面(`GET /v1/capabilities/mcp` /
|
|
799
800
|
* `POST /v1/capabilities/mcp/probe`),它们发的是**同一种**行。留在内联里,那两条面只能各自再挑一遍键
|
|
800
801
|
* —— 而契约 §G.7 第 3 条(`error` 远端原话**有意不投**,理由是「再脱一遍就是同一语义面的第二个写者」)
|
|
801
802
|
* 这种**裁定**一旦有两个实现,下一个人只会改到其中一个。
|
|
@@ -821,7 +822,7 @@ export declare function projectWiringManifestMcpRows(mcpIn: unknown): Array<Reco
|
|
|
821
822
|
* `tool_end` 之前),`delta.fromDigest` = 消费端手上那份名册的 digest。7.66.0 写下的「前瞻接线」披露随本版
|
|
822
823
|
* 退役:本臂现在会真的触发,消费端可以依赖它了。
|
|
823
824
|
*
|
|
824
|
-
* 🔴 **三腿共用本构造器(
|
|
825
|
+
* 🔴 **三腿共用本构造器([ref],7.71.0)**:live 腿(`routes/tasks.ts`)+ 两条 durable 腿
|
|
825
826
|
* (`trace/ledger-sink.ts` 的 `onEvent` / `http/server.ts` 的 resume switch)。返回 `undefined` 的那一格在
|
|
826
827
|
* 三腿上是同一件事 ——**整帧不发 / 整帧不落账**,绝不半张名册上 wire 或落库。落账的正当性(旧裁定
|
|
827
828
|
* 「不落账」为何在 7.71.0 撤销)逐字记在 `core-keyset-guard.ts` ⑪ 段。
|
|
@@ -832,12 +833,14 @@ export declare function toolRosterDeltaEventData(ev: {
|
|
|
832
833
|
parentToolCallId?: unknown;
|
|
833
834
|
}): Record<string, unknown> | undefined;
|
|
834
835
|
/**
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
* 选择规则),所以不从 `ev` 读:每条投帧的腿把**自己那只** `InstructionSelectionLeg.segment()` 递进来。必传而不是可选 ——
|
|
838
|
-
* 漏递的腿当场 tsc 红,而不是静默投出一个「缺席」(缺席在 wire 上是一句话:「这条腿没有关于指令文件的陈述」)。
|
|
839
|
-
* `undefined` ⇒ 段缺席;`{ selected: [] }` ⇒ 显式空(走了链、没选中)。登记:`wire-projection-faces.ts` 租户行 `minted`。
|
|
836
|
+
* `wiring_manifest.sessionRules` 段的**处置表**(core 7.55.0 [ref];[ref] 起新面写表 —— 门 `core-keyset-guard.ts` ⑥b 读 `TableCoreKeys`,core 给段加成员 ⇒ tsc 红,
|
|
837
|
+
* 先判受众再写进表)。唯一一位 `childrenReadLive` 是布尔才出门(读法拒 ⇒ 表的丢弃口计一次)。裁定 = 两个出口都投(理由在 ⑥b 段注)。
|
|
840
838
|
*/
|
|
839
|
+
export declare const WIRING_SESSION_RULES_DISPOSITIONS: {
|
|
840
|
+
readonly childrenReadLive: {
|
|
841
|
+
readonly forward: (raw: unknown) => raw is boolean;
|
|
842
|
+
};
|
|
843
|
+
};
|
|
841
844
|
export declare function wiringManifestEventData(ev: {
|
|
842
845
|
manifest?: unknown;
|
|
843
846
|
eventId?: unknown;
|
|
@@ -864,7 +867,7 @@ export declare function wiringManifestEventData(ev: {
|
|
|
864
867
|
* governance **逐键挑**(禁 `{...governance}`):core 往这个段里加第五键时必须由人显式处置,而不是顺着
|
|
865
868
|
* spread 裸上线 —— 这个段的每一键都是部署治理面,新键的默认待遇必须是「不发」。
|
|
866
869
|
*
|
|
867
|
-
* `autoConsolidation`(core 7.21.0 [ref],
|
|
870
|
+
* `autoConsolidation`(core 7.21.0 [ref],[ref])与 governance 同规:租户面剥、本面发(裁定四条判据在
|
|
868
871
|
* `core-keyset-guard.ts` ⑥b `WiringSectionExcluded`)。**present-iff 武装**:
|
|
869
872
|
* · 整段缺席 ⇒ **未武装**,不铸键、不计数(正面事实,不是「未知」,更不是 `{onRecommendation:false}`);
|
|
870
873
|
* · 在场且 `onRecommendation === true` ⇒ 逐字铸出(core 的在场形只有这一个,构造期门已拒掉「武装但跑不起来」);
|
|
@@ -880,7 +883,7 @@ export declare function wiringManifestOperatorEventData(ev: {
|
|
|
880
883
|
parentToolCallId?: unknown;
|
|
881
884
|
}, instructions: InstructionsSegment | undefined): Record<string, unknown>;
|
|
882
885
|
/**
|
|
883
|
-
* `wiring_manifest` 的**唯一分叉点**(
|
|
886
|
+
* `wiring_manifest` 的**唯一分叉点**([ref])—— 两条知道调用方身份的 live 消费腿共用它:
|
|
884
887
|
* `/v1/tasks/stream` 的 SSE 帧,与 `POST /v1/tasks`(非流式)200 体里的 `wiringManifest` 起手回执。
|
|
885
888
|
*
|
|
886
889
|
* 🔴 **为什么是一只函数,而不是两处 `cond ? operator : tenant`**:那个三元判的是「这份产物给谁看」——
|
|
@@ -996,7 +999,7 @@ export declare function compactedEventData(ev: {
|
|
|
996
999
|
* 的数、post 恒是结构和 + 固定提示词开销,两者的差混坐标,实测在普通 run 上是负数)。本仓的处置因此
|
|
997
1000
|
* 是**三条都逐字透传、一条都不合成**:谁要画上下文表就读 `freedTokens`,读不到就渲染 unknown。 */
|
|
998
1001
|
freedTokens?: number;
|
|
999
|
-
/** core 7.30.0
|
|
1002
|
+
/** core 7.30.0 [ref]([ref]):这一次压缩**摘要掉**了几条之前已交给模型的跨会话消息(在场 iff ≥1)。 */
|
|
1000
1003
|
summarizedCrossSessionMessages?: number;
|
|
1001
1004
|
durationMs?: number;
|
|
1002
1005
|
phaseDurations?: {
|
|
@@ -1005,7 +1008,7 @@ export declare function compactedEventData(ev: {
|
|
|
1005
1008
|
persistMs?: number;
|
|
1006
1009
|
ptlRetries?: number;
|
|
1007
1010
|
};
|
|
1008
|
-
/**
|
|
1011
|
+
/** [ref](core 7.53.0 [ref]):这次落地的压缩 pass 的 id —— 与它的 `compaction_started` 帧同一个值(引擎在每次落地上都设;型上可选)。逐字。 */
|
|
1009
1012
|
pass?: string;
|
|
1010
1013
|
}): FrameData<{
|
|
1011
1014
|
attachedFiles?: Array<{
|
|
@@ -1026,7 +1029,7 @@ export interface TraceTurn {
|
|
|
1026
1029
|
* cache-MISS 分量(命名取自 core `uncachedInputTokensOf`),只在能确认自己踩在新契约帧上时才发
|
|
1027
1030
|
* (见 {@link toContractTokens})。
|
|
1028
1031
|
*
|
|
1029
|
-
* 🔴 **
|
|
1032
|
+
* 🔴 **[ref]⑥:五个子键**全部按同族 OMIT 契约走 —— 引擎那一侧报了才铸,没报就**缺席**,恒不折 `0`。
|
|
1030
1033
|
* `in`/`out` 此前是必填座、缺一键时写 `?? 0`:读端拿到的 `in:0` 与「这一轮真的零输入」逐字节同形,
|
|
1031
1034
|
* 于是一次 usage 半缺(某些 provider 只回 output 侧)在面板上显示成一个可核对的真数字。
|
|
1032
1035
|
* 0 是一个数,未知不是 —— 两者同形正是本仓 `boundCallId`/`gateKind`/`approvalCard` 一族一直在防的事。
|
|
@@ -1076,13 +1079,29 @@ export declare function contextUsageEventData(ev: {
|
|
|
1076
1079
|
* (`ledger-sink.ts`)、resume 腿(`resume-legs.ts`)。live 臂此前是一份**手抄**的键集,于是 core 7.29.0 加的
|
|
1077
1080
|
* `responseModel` 在 durable 面由这里补上以后,live 面仍会被那份手抄静默剥掉 —— 同一帧两条腿两套键集。
|
|
1078
1081
|
*
|
|
1079
|
-
* `responseModel`(core 7.29.0
|
|
1082
|
+
* `responseModel`(core 7.29.0 [ref]):**供应商自己**报的、回答这一 turn 的模型名,**只在**它 ≠ 请求所带 id
|
|
1080
1083
|
* 时在场。缺席 = 「报了同名」或「没报」,**一个读法**(请求 id 读 `TaskResult.model`)。值是供应商铸的名字
|
|
1081
|
-
* (与 `apiFailure.requestId` 同类:不是模型写的自由文本)⇒ 🔴 **
|
|
1082
|
-
* ({@link admitProviderEcho}:长度 1–128 的可见 ASCII 原样,越界 ⇒ 不铸键 + 计数,与 core
|
|
1084
|
+
* (与 `apiFailure.requestId` 同类:不是模型写的自由文本)⇒ 🔴 **[ref] 起过 provider 回声的形状闸**
|
|
1085
|
+
* ({@link admitProviderEcho}:长度 1–128 的可见 ASCII 原样,越界 ⇒ 不铸键 + 计数,与 core [ref] 源头闸同一条;不过脱敏器),
|
|
1083
1086
|
* 与结果面的孪生 `TaskResult.responseModel` 同一只闸 —— 同一个名字在两张脸上不许两种待遇。非串 / 空串同样不铸键(空串在
|
|
1084
1087
|
* 那条谓词的长度下界之外;core 的读律 `providerReportedModel` 对空串也答「没报」)。
|
|
1085
1088
|
*/
|
|
1089
|
+
/**
|
|
1090
|
+
* 🔴 core 7.54.0 [ref] O9b S1 —— 设备车道发射闸的 `permission.cross_boundary_taint` 帧 → 耐久行 `cross_boundary_taint`(`GET /v1/runs/:id/events` 账本回放同名交出;
|
|
1091
|
+
* trace SSE `GET /v1/tasks/:id/stream` 上是 `cross-boundary-taint` 帧,按存下的行原样交出)。帧只在**执行于目标设备的树**上发(武装腿 prepare / 续跑腿 resume 各一帧,离目标读第一次放进树时 observed 一帧),
|
|
1092
|
+
* 宿主车道零帧 ⇒ 本行在宿主车道上永不出现。纯元数据(core 逐字「Metadata only」):树的污染位(`taint`,core `CROSS_BOUNDARY_TAINT_BITS` 的子集)、
|
|
1093
|
+
* 树是否受治理(`governed`)、阶段(`phase`)、腿的 `runId`,observed 时那一只调用(`toolName` / `toolCallId`)。
|
|
1094
|
+
* 信封(`kind` / `version` / `taskId` / `ts`)不上行:行自带 seq / ts,run 就是 taskId(与清单行同一条律;登记表 `cross_boundary_taint` 行)。
|
|
1095
|
+
* 值:`taint` 交一份数组副本(只收串);`toolName` / `toolCallId` 在场才铸。词按开集串过境(属主是引擎的闭集;本仓不判词表)。
|
|
1096
|
+
*/
|
|
1097
|
+
export declare function crossBoundaryTaintEventData(ev: {
|
|
1098
|
+
runId?: unknown;
|
|
1099
|
+
phase?: unknown;
|
|
1100
|
+
taint?: unknown;
|
|
1101
|
+
governed?: unknown;
|
|
1102
|
+
toolName?: unknown;
|
|
1103
|
+
toolCallId?: unknown;
|
|
1104
|
+
}): Record<string, unknown>;
|
|
1086
1105
|
export declare function turnEndEventData(ev: {
|
|
1087
1106
|
usage?: unknown;
|
|
1088
1107
|
usageMissing?: true;
|
|
@@ -1101,7 +1120,7 @@ export declare function turnEndEventData(ev: {
|
|
|
1101
1120
|
* `in` 落回旧值,读端零伤)。`uncachedIn` 只在**能确认自己踩在新契约帧上**(`totalInputTokens` 在场)时
|
|
1102
1121
|
* 才发——旧帧的 `inputTokens` 是族依赖的旧语义,标成「uncachedIn(cache-MISS)」会是谎言。
|
|
1103
1122
|
*
|
|
1104
|
-
* 🔴
|
|
1123
|
+
* 🔴 [ref]⑥:**一条规则管五个子键** —— 源侧在场就铸、缺席就不铸,没有 `?? 0`。此前 `in`/`out` 两座
|
|
1105
1124
|
* 各带一个默认 0,于是 usage 半缺(provider 只回 output 侧)被投影成 `in:0` = 一个看起来可核对的真
|
|
1106
1125
|
* 数字;`uncachedIn`/`cacheRead`/`cacheWrite` 三键从第一天起就是缺席制,`in`/`out` 只是漏进了默认值。
|
|
1107
1126
|
* 早退分支语义不变:输入两键(择一)与 `outputTokens` 全缺 ⇒ 整只 `tokens` 缺席(不铸空对象)。
|
|
@@ -1109,7 +1128,7 @@ export declare function turnEndEventData(ev: {
|
|
|
1109
1128
|
* 🔴 **7.74.0 / core 7.17.0([ref]):`usageMissing` 是本投影的输入,不只是事件面的一枚标。**引擎自该版起
|
|
1110
1129
|
* 在「这一轮 provider 没回 usage 帧」时也**恒发** `turn_end.usage` —— 内容是六个 0 的占位对象,旁边挂
|
|
1111
1130
|
* `usageMissing: true`。只看 usage 会把「未测量」投成一只全 0 对象,与「真的零用量」在
|
|
1112
|
-
* `GET /v1/tasks/:id/turns` 与 trace SSE 的 `turn` 事件上逐字节同形 —— 正是
|
|
1131
|
+
* `GET /v1/tasks/:id/turns` 与 trace SSE 的 `turn` 事件上逐字节同形 —— 正是 [ref]⑥「0 是一个数,未知不是」
|
|
1113
1132
|
* 要消灭的那一形。契约里「未知 = `tokens` 整只缺席」早就是唯一读法 ⇒ 标在场就**不铸**(与 7.73.1 及以前的
|
|
1114
1133
|
* wire 读数逐字节相同),不按「六个 0」的值形猜、也不给 `TraceTurn.tokens` 加第二枚「未知」座(同一事实两种
|
|
1115
1134
|
* 拼法)。标的域是 core 的 `true | 缺席`(永不 `false`)⇒ 严判 `=== true`,别的值不是标。 */
|
package/dist/trace/project.js
CHANGED
|
@@ -10,6 +10,7 @@ import { injectionTierOrAbsent } from "./injection-tier.js";
|
|
|
10
10
|
import { semaProvenanceOrAbsent } from "./sema-provenance.js";
|
|
11
11
|
import { resupplyFields, terminalFrameFacetFields } from "./task-notification-facets.js";
|
|
12
12
|
import { dropProjectedFace } from "./projection-drop.js";
|
|
13
|
+
import { projectByTable } from "./projection-table.js";
|
|
13
14
|
export async function appendModelUsageDelta(append, modelUsage, taskId) {
|
|
14
15
|
const delta = modelUsage?.drain(taskId);
|
|
15
16
|
if (delta) {
|
|
@@ -24,10 +25,10 @@ export async function appendPromptManifest(append, tracker, taskId) {
|
|
|
24
25
|
if (records)
|
|
25
26
|
for (const m of records)
|
|
26
27
|
await append("prompt_assembled", m);
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
for (const
|
|
30
|
-
await append(
|
|
28
|
+
const companions = tracker?.drainCompanions?.(taskId);
|
|
29
|
+
if (companions)
|
|
30
|
+
for (const c of companions)
|
|
31
|
+
await append(c.type, c.data);
|
|
31
32
|
}
|
|
32
33
|
export async function attachModelUsage(result, ctx) {
|
|
33
34
|
if (!ctx.modelUsage)
|
|
@@ -145,6 +146,15 @@ function screenedGateOrThrow(v) {
|
|
|
145
146
|
...(rel.mandate === undefined ? {} : { mandate: rel.mandate }),
|
|
146
147
|
...(rel.reason === undefined ? {} : { reason: rel.reason }),
|
|
147
148
|
};
|
|
149
|
+
const clr = d.kind === "allowed" ? d.clearedBy : undefined;
|
|
150
|
+
const clearedBy = clr === undefined
|
|
151
|
+
? undefined
|
|
152
|
+
: {
|
|
153
|
+
member: clr.member,
|
|
154
|
+
entries: clr.entries.map((e) => seatText("trace-frame-text", e)),
|
|
155
|
+
...(clr.omitted === undefined ? {} : { omitted: clr.omitted }),
|
|
156
|
+
...(clr.positions === undefined ? {} : { positions: [...clr.positions] }),
|
|
157
|
+
};
|
|
148
158
|
return {
|
|
149
159
|
disposition: d.kind === "denied"
|
|
150
160
|
? {
|
|
@@ -156,7 +166,7 @@ function screenedGateOrThrow(v) {
|
|
|
156
166
|
...(d.askClass === undefined ? {} : { askClass: d.askClass }),
|
|
157
167
|
...(d.classes === undefined ? {} : { classes: [...d.classes] }),
|
|
158
168
|
}
|
|
159
|
-
: { kind: "allowed", ...(classifier === undefined ? {} : { classifier }), ...(released === undefined ? {} : { released }) },
|
|
169
|
+
: { kind: "allowed", ...(classifier === undefined ? {} : { classifier }), ...(released === undefined ? {} : { released }), ...(clearedBy === undefined ? {} : { clearedBy }) },
|
|
160
170
|
...(settlement === undefined ? {} : { settlement }),
|
|
161
171
|
...(g.origin === undefined ? {} : { origin: g.origin }),
|
|
162
172
|
};
|
|
@@ -447,6 +457,9 @@ export function toolRosterDeltaEventData(ev) {
|
|
|
447
457
|
}
|
|
448
458
|
return { delta: ev.delta, ...identityFields(ev) };
|
|
449
459
|
}
|
|
460
|
+
export const WIRING_SESSION_RULES_DISPOSITIONS = {
|
|
461
|
+
childrenReadLive: { forward: (raw) => typeof raw === "boolean" },
|
|
462
|
+
};
|
|
450
463
|
export function wiringManifestEventData(ev, instructions) {
|
|
451
464
|
const str = (v) => (typeof v === "string" && v.length > 0 ? v : undefined);
|
|
452
465
|
const bool = (v) => (typeof v === "boolean" ? v : undefined);
|
|
@@ -641,12 +654,31 @@ export function wiringManifestEventData(ev, instructions) {
|
|
|
641
654
|
return dropProjectedFace("wiring_manifest.permissionMode is not a receipt shape (effective a non-empty string, requested / foldedBy absent or non-empty strings)");
|
|
642
655
|
return { ...(requested !== undefined ? { requested } : {}), effective, ...(foldedBy !== undefined ? { foldedBy } : {}) };
|
|
643
656
|
})();
|
|
657
|
+
const sessionRules = (() => {
|
|
658
|
+
if (m.sessionRules === undefined)
|
|
659
|
+
return undefined;
|
|
660
|
+
const seg = sec(m.sessionRules);
|
|
661
|
+
if (seg === undefined || seg.childrenReadLive === undefined)
|
|
662
|
+
return dropProjectedFace("wiring_manifest.sessionRules is not { childrenReadLive: boolean }");
|
|
663
|
+
const out = projectByTable("wiring_manifest.sessionRules", WIRING_SESSION_RULES_DISPOSITIONS, seg, undefined);
|
|
664
|
+
return out.childrenReadLive === undefined ? undefined : out;
|
|
665
|
+
})();
|
|
666
|
+
const projectMemory = (() => {
|
|
667
|
+
if (m.projectMemory === undefined)
|
|
668
|
+
return undefined;
|
|
669
|
+
const word = str(m.projectMemory);
|
|
670
|
+
if (word === undefined)
|
|
671
|
+
return dropProjectedFace("wiring_manifest.projectMemory is not a non-empty string");
|
|
672
|
+
return word;
|
|
673
|
+
})();
|
|
644
674
|
return {
|
|
645
675
|
...(num(m.schemaVersion) !== undefined ? { schemaVersion: m.schemaVersion } : {}),
|
|
646
676
|
...(str(legIn.kind) !== undefined ? { leg: { kind: legIn.kind } } : {}),
|
|
647
677
|
...(teamRole !== undefined ? { teamRole } : {}),
|
|
648
678
|
...(fileHistory !== undefined ? { fileHistory } : {}),
|
|
649
679
|
...(permissionMode !== undefined ? { permissionMode } : {}),
|
|
680
|
+
...(sessionRules !== undefined ? { sessionRules } : {}),
|
|
681
|
+
...(projectMemory !== undefined ? { projectMemory } : {}),
|
|
650
682
|
...(ask !== undefined ? { ask } : {}),
|
|
651
683
|
...(question !== undefined ? { question } : {}),
|
|
652
684
|
...(str(interactionIn.posture) !== undefined ? { interaction: { posture: interactionIn.posture } } : {}),
|
|
@@ -846,6 +878,16 @@ function contextUsageSectionsField(sections) {
|
|
|
846
878
|
}
|
|
847
879
|
return out.length > 0 ? { sections: out } : {};
|
|
848
880
|
}
|
|
881
|
+
export function crossBoundaryTaintEventData(ev) {
|
|
882
|
+
return {
|
|
883
|
+
...(typeof ev.runId === "string" ? { runId: ev.runId } : {}),
|
|
884
|
+
...(typeof ev.phase === "string" ? { phase: ev.phase } : {}),
|
|
885
|
+
...(Array.isArray(ev.taint) ? { taint: ev.taint.filter((b) => typeof b === "string") } : {}),
|
|
886
|
+
...(typeof ev.governed === "boolean" ? { governed: ev.governed } : {}),
|
|
887
|
+
...(typeof ev.toolName === "string" ? { toolName: ev.toolName } : {}),
|
|
888
|
+
...(typeof ev.toolCallId === "string" ? { toolCallId: ev.toolCallId } : {}),
|
|
889
|
+
};
|
|
890
|
+
}
|
|
849
891
|
export function turnEndEventData(ev) {
|
|
850
892
|
return {
|
|
851
893
|
...(ev.usage ? { usage: ev.usage } : {}),
|
|
@@ -1004,6 +1046,8 @@ function mapTraceEventInner(type, seq, data) {
|
|
|
1004
1046
|
}
|
|
1005
1047
|
case "prompt_assembled":
|
|
1006
1048
|
return { event: "prompt-assembled", data: { seq, ...data } };
|
|
1049
|
+
case "cross_boundary_taint":
|
|
1050
|
+
return { event: "cross-boundary-taint", data: { seq, ...data } };
|
|
1007
1051
|
case "done":
|
|
1008
1052
|
return { event: "done", data: { seq } };
|
|
1009
1053
|
case "suspended":
|