@sema-agent/server 7.145.0 → 7.147.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 +876 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +374 -99
- package/deploy/facts/CHANGES.json +25 -0
- package/deploy/facts/README.md +57 -0
- package/deploy/facts/lanes.json +61 -0
- package/deploy/facts/lanes.schema.json +57 -0
- package/deploy/facts/sandbox-rbac.json +113 -0
- package/deploy/facts/sandbox-rbac.schema.json +74 -0
- package/deploy/facts/sealed-key.json +9 -0
- package/deploy/facts/sealed-key.schema.json +52 -0
- package/deploy/sema-up/README.md +2 -2
- package/deploy/sema-up/chart/templates/_helpers.tpl +41 -0
- package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +47 -7
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +9 -4
- package/deploy/sema-up/chart/templates/server.yaml +9 -4
- package/deploy/sema-up/chart/values.yaml +8 -1
- package/deploy/sema-up/cluster-up.sh +2 -1
- package/deploy/sema-up/lib/flagshape.sh +4 -0
- package/deploy/sema-up/lib/lanes.json +2 -5
- package/deploy/sema-up/sema-up.sh +12 -9
- package/deploy/sema-up/stack/compose.yaml +5 -4
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +34 -17
- package/dist/adoption/import-limits.d.ts +6 -0
- package/dist/adoption/import-limits.js +7 -0
- package/dist/adoption/import.d.ts +62 -0
- package/dist/adoption/import.js +107 -0
- package/dist/adoption/wire.d.ts +52 -0
- package/dist/adoption/wire.js +9 -0
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +7 -16
- package/dist/approval-card.js +0 -4
- package/dist/approval-gate-currency.d.ts +1 -1
- package/dist/approval-gate-currency.js +1 -1
- package/dist/approval-reconciler.d.ts +1 -1
- package/dist/approval.d.ts +3 -3
- package/dist/audit.js +2 -2
- package/dist/bench/s1/live-deps.js +3 -1
- package/dist/boot/crash-last.js +2 -1
- package/dist/boot/deployment-mods.d.ts +11 -1
- package/dist/boot/deployment-mods.js +15 -2
- package/dist/boot/device-lane.js +7 -5
- package/dist/boot/engine-lease.d.ts +195 -22
- package/dist/boot/engine-lease.js +146 -20
- package/dist/boot/execution-env.d.ts +5 -0
- package/dist/boot/execution-env.js +57 -33
- package/dist/boot/execution-lane.d.ts +37 -9
- package/dist/boot/execution-lane.js +74 -20
- package/dist/boot/exit-boundary.d.ts +50 -0
- package/dist/boot/exit-boundary.js +32 -0
- package/dist/boot/exit-last.d.ts +20 -4
- package/dist/boot/exit-last.js +23 -5
- package/dist/boot/governance-seams.d.ts +2 -2
- package/dist/boot/governance-seams.js +1 -0
- package/dist/boot/leader.js +1 -1
- package/dist/boot/memory-boundary.d.ts +11 -11
- package/dist/boot/memory-boundary.js +3 -3
- package/dist/boot/memory-consolidation.d.ts +42 -41
- package/dist/boot/memory-consolidation.js +26 -28
- package/dist/boot/org-memory.js +3 -2
- package/dist/boot/parked-revive-gate.d.ts +1 -1
- package/dist/boot/parked-revive-gate.js +1 -1
- package/dist/boot/reapers.d.ts +12 -4
- package/dist/boot/reapers.js +40 -16
- package/dist/boot/resolve-spec.d.ts +2 -0
- package/dist/boot/resolve-spec.js +126 -123
- package/dist/boot/retention-lane.d.ts +4 -42
- package/dist/boot/runner-deps.js +1 -1
- package/dist/boot/session-faces.d.ts +1 -0
- package/dist/boot/session-faces.js +11 -3
- package/dist/boot/shutdown.js +27 -9
- package/dist/boot/stage-01-config.d.ts +1 -1
- package/dist/boot/stage-01-config.js +7 -3
- package/dist/boot/stage-02-web-admin-pull.d.ts +1 -1
- package/dist/boot/stage-02-web-admin-pull.js +10 -8
- package/dist/boot/stage-03-store-backend.d.ts +2 -1
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-04-stores.d.ts +2 -1
- package/dist/boot/stage-05-execution-env.d.ts +4 -1
- package/dist/boot/stage-05-execution-env.js +6 -6
- package/dist/boot/stage-06-runners.d.ts +5 -2
- package/dist/boot/stage-06-runners.js +12 -13
- package/dist/boot/stage-07-capability-layer.d.ts +5 -2
- package/dist/boot/stage-07-capability-layer.js +7 -7
- package/dist/boot/stage-08-reapers.d.ts +5 -2
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +6 -2
- package/dist/boot/stage-10-http-server.d.ts +6 -2
- package/dist/boot/stage-10-http-server.js +5 -3
- package/dist/boot/stores.d.ts +10 -0
- package/dist/boot/stores.js +53 -26
- package/dist/boot/web-admin.js +3 -3
- package/dist/boot/workflow-orchestration.d.ts +1 -1
- package/dist/boot/workflow-orchestration.js +2 -1
- package/dist/capabilities/center-plugins.d.ts +2 -0
- package/dist/capabilities/center-plugins.js +6 -2
- package/dist/capabilities/composite-members.d.ts +4 -1
- package/dist/capabilities/composite-members.js +4 -1
- package/dist/capabilities/execution-lane.d.ts +7 -7
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +1 -1
- package/dist/capabilities/scenarios.d.ts +34 -20
- package/dist/capabilities/scenarios.js +13 -9
- package/dist/capabilities/settings-contract.d.ts +29 -0
- package/dist/capabilities/settings-contract.js +14 -0
- package/dist/capabilities/skills.d.ts +5 -5
- package/dist/capability-facts.d.ts +56 -1
- package/dist/capability-facts.js +59 -8
- package/dist/center-credential-renewer.js +3 -2
- package/dist/checkpoint-ctx-seal-m28.d.ts +1 -1
- package/dist/config-catalog.js +19 -9
- package/dist/config-invariants.d.ts +18 -3
- package/dist/config-invariants.js +36 -19
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-lkg.js +5 -6
- package/dist/config-provider.d.ts +2 -2
- package/dist/config-provider.js +2 -0
- package/dist/config-types.d.ts +228 -185
- package/dist/config.d.ts +74 -6
- package/dist/config.js +146 -64
- package/dist/degenerate-instrument.js +1 -1
- package/dist/deleted-session-ids.d.ts +19 -0
- package/dist/deleted-session-ids.js +26 -0
- package/dist/deploy-facts.d.ts +155 -0
- package/dist/deploy-facts.js +95 -0
- package/dist/deployment-shape.d.ts +21 -12
- package/dist/deployment-shape.js +24 -6
- package/dist/device-ws-hub.d.ts +48 -3
- package/dist/device-ws-hub.js +48 -2
- package/dist/env-facts.d.ts +7 -5
- package/dist/env-facts.js +10 -6
- package/dist/error-code-family.d.ts +35 -0
- package/dist/error-code-family.js +26 -0
- package/dist/execution-config-root.d.ts +5 -5
- package/dist/execution-config-root.js +5 -5
- package/dist/execution-env-purpose.d.ts +14 -0
- package/dist/execution-env-purpose.js +29 -0
- package/dist/execution-lane-caps.d.ts +49 -86
- package/dist/execution-lane-caps.js +52 -62
- package/dist/execution-placement.d.ts +18 -2
- package/dist/execution-placement.js +19 -0
- package/dist/file-history-disclosure.d.ts +2 -2
- package/dist/fleet/drain-entry.d.ts +46 -3
- package/dist/fleet/drain-entry.js +6 -0
- package/dist/fleet/fleet-bus.d.ts +2 -1
- package/dist/fleet/serving-lease.js +3 -4
- package/dist/history-anchor.d.ts +22 -0
- package/dist/history-anchor.js +14 -0
- package/dist/hooks/branch-transcript.d.ts +1 -1
- package/dist/hooks/branch-transcript.js +1 -0
- package/dist/hooks/classic-stations.d.ts +25 -8
- package/dist/hooks/classic-stations.js +29 -3
- package/dist/hooks/command-spawn.d.ts +1 -4
- package/dist/hooks/command-spawn.js +0 -11
- package/dist/hooks/hook-runner.d.ts +85 -24
- package/dist/hooks/hook-runner.js +326 -109
- package/dist/hooks/hook-source.d.ts +14 -2
- package/dist/hooks/hook-source.js +8 -0
- package/dist/http/active-run-conflict.d.ts +1 -1
- package/dist/http/active-run-conflict.js +1 -1
- package/dist/http/admission.js +11 -1
- package/dist/http/approval-sweeps.d.ts +2 -5
- package/dist/http/approval-sweeps.js +3 -2
- package/dist/http/checkpoint-ctx.d.ts +76 -71
- package/dist/http/checkpoint-ctx.js +40 -40
- package/dist/http/claim-latency.d.ts +10 -0
- package/dist/http/claim-latency.js +12 -0
- package/dist/http/dispatch.js +19 -3
- package/dist/http/durable-run-leg.d.ts +5 -0
- package/dist/http/durable-run-leg.js +3 -1
- package/dist/http/execution-context.d.ts +7 -1
- package/dist/http/execution-context.js +13 -0
- package/dist/http/health-self-report.d.ts +6 -2
- package/dist/http/health-self-report.js +3 -2
- package/dist/http/memory-compliance-failure-reply.d.ts +2 -2
- package/dist/http/memory-compliance-failure-reply.js +5 -15
- package/dist/http/memory-control-plane-corrupt-reply.d.ts +25 -0
- package/dist/http/memory-control-plane-corrupt-reply.js +19 -0
- package/dist/http/memory-store-refusal-reply.d.ts +3 -3
- package/dist/http/memory-store-refusal-reply.js +3 -0
- package/dist/http/owner-access.d.ts +11 -0
- package/dist/http/owner-access.js +7 -4
- package/dist/http/principal-gate.d.ts +28 -16
- package/dist/http/principal-gate.js +10 -19
- package/dist/http/request-guards.d.ts +2 -2
- package/dist/http/request-guards.js +5 -5
- package/dist/http/resume-legs.d.ts +29 -10
- package/dist/http/resume-legs.js +94 -56
- package/dist/http/rewind-files-reply.d.ts +34 -0
- package/dist/http/rewind-files-reply.js +36 -0
- package/dist/http/route-ctx.d.ts +43 -26
- package/dist/http/route-table.js +4 -0
- package/dist/http/routes/adoption.d.ts +11 -0
- package/dist/http/routes/adoption.js +80 -6
- package/dist/http/routes/agents-roster.js +1 -0
- package/dist/http/routes/approvals-assistant.js +7 -26
- package/dist/http/routes/background.js +1 -0
- package/dist/http/routes/capabilities.js +12 -3
- package/dist/http/routes/devices.js +1 -1
- package/dist/http/routes/diagnostics.d.ts +9 -14
- package/dist/http/routes/diagnostics.js +10 -20
- package/dist/http/routes/engine.d.ts +31 -0
- package/dist/http/routes/engine.js +81 -0
- package/dist/http/routes/memory-bundle.js +3 -0
- package/dist/http/routes/memory-consolidation.js +3 -5
- package/dist/http/routes/memory-origin.d.ts +2 -2
- package/dist/http/routes/memory-origin.js +2 -4
- package/dist/http/routes/memory-policy.js +5 -1
- package/dist/http/routes/notify-wake.js +2 -1
- package/dist/http/routes/observability.js +3 -6
- package/dist/http/routes/projects.d.ts +70 -0
- package/dist/http/routes/projects.js +86 -0
- package/dist/http/routes/rules.js +30 -2
- package/dist/http/routes/runs.js +15 -11
- package/dist/http/routes/session-sync.js +39 -35
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions.d.ts +7 -1
- package/dist/http/routes/sessions.js +108 -2
- package/dist/http/routes/tasks.js +32 -8
- package/dist/http/routes/trace-usage.js +1 -1
- package/dist/http/run-concurrency-cap.d.ts +86 -0
- package/dist/http/run-concurrency-cap.js +54 -0
- package/dist/http/server.d.ts +31 -14
- package/dist/http/server.js +29 -3
- package/dist/http/stored-body-replay.d.ts +12 -7
- package/dist/http/stored-body-replay.js +28 -5
- package/dist/http/wire-types.d.ts +27 -13
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/instruction-source-notice.d.ts +1 -1
- package/dist/json-body-limit.d.ts +8 -0
- package/dist/json-body-limit.js +2 -0
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/local-data-root.d.ts +2 -2
- package/dist/memory-embedder-reembed.d.ts +38 -0
- package/dist/memory-embedder-reembed.js +20 -0
- package/dist/memory-incident-sink.d.ts +0 -28
- package/dist/memory-incident-sink.js +5 -0
- package/dist/memory-operator-faces.d.ts +9 -4
- package/dist/memory-scope-stores.d.ts +9 -7
- package/dist/memory-scope-stores.js +3 -14
- package/dist/memory-scope.d.ts +38 -2
- package/dist/memory-scope.js +33 -2
- package/dist/memory-store-refusal.d.ts +17 -4
- package/dist/memory-store-refusal.js +1 -1
- package/dist/memory-sync-client.d.ts +2 -0
- package/dist/memory-sync-client.js +13 -11
- package/dist/memory-sync.js +1 -1
- package/dist/model-compat.d.ts +35 -21
- package/dist/model-compat.js +49 -21
- package/dist/model-entry-refusal.d.ts +11 -1
- package/dist/model-entry-refusal.js +7 -0
- package/dist/namespaced-rule-name.d.ts +18 -1
- package/dist/namespaced-rule-name.js +12 -0
- package/dist/net-address.d.ts +53 -0
- package/dist/net-address.js +111 -0
- package/dist/observability/fail-open.d.ts +29 -17
- package/dist/observability/fail-open.js +29 -17
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +2 -0
- package/dist/observability/secret-env-scrub.d.ts +30 -4
- package/dist/observability/secret-env-scrub.js +15 -3
- package/dist/orchestration/workflow-agent-session-index.d.ts +7 -12
- package/dist/orchestration/workflow-agent-session-index.js +1 -6
- package/dist/orchestration/workflow-completion-inbox.d.ts +26 -6
- package/dist/orchestration/workflow-completion-inbox.js +63 -45
- package/dist/orchestration/workflow-notify-journal.js +2 -3
- package/dist/org-delivery-gate.js +1 -1
- package/dist/org-memory-admission.d.ts +5 -2
- package/dist/org-memory-admission.js +25 -10
- package/dist/parked-decide.d.ts +33 -26
- package/dist/parked-decide.js +36 -44
- package/dist/peer-directory.d.ts +6 -12
- package/dist/peer-directory.js +5 -1
- package/dist/plugins/approval-ask-store-file.d.ts +10 -2
- package/dist/plugins/approval-ask-store-file.js +37 -4
- package/dist/plugins/approval-ask-store-memory.d.ts +5 -3
- package/dist/plugins/approval-ask-store-memory.js +11 -2
- package/dist/plugins/approval-ask-store-sql.d.ts +3 -0
- package/dist/plugins/approval-ask-store-sql.js +3 -1
- package/dist/plugins/blob-backend.d.ts +38 -195
- package/dist/plugins/blob-backend.js +33 -229
- package/dist/plugins/caching-session-store.d.ts +12 -5
- package/dist/plugins/caching-session-store.js +3 -0
- package/dist/plugins/checkpoint-index-columns.d.ts +1 -1
- package/dist/plugins/checkpoint-index-columns.js +3 -2
- package/dist/plugins/checkpoint-store-face.d.ts +426 -0
- package/dist/plugins/checkpoint-store-face.js +152 -0
- package/dist/plugins/device-store-sql.d.ts +2 -2
- package/dist/plugins/device-store-sql.js +5 -10
- package/dist/plugins/execution-lane-rename-m40.d.ts +20 -0
- package/dist/plugins/execution-lane-rename-m40.js +10 -0
- package/dist/plugins/execution-placement-sql.d.ts +63 -88
- package/dist/plugins/execution-placement-sql.js +94 -54
- package/dist/plugins/file-run-store.d.ts +26 -18
- package/dist/plugins/file-run-store.js +64 -75
- package/dist/plugins/fork-routing-session-store.d.ts +6 -2
- package/dist/plugins/fork-routing-session-store.js +2 -2
- package/dist/plugins/imported-layer-root-retirement.d.ts +22 -11
- package/dist/plugins/imported-layer-root-retirement.js +4 -8
- package/dist/plugins/inbox-payload-column.d.ts +14 -0
- package/dist/plugins/inbox-payload-column.js +13 -0
- package/dist/plugins/local-checkpoint-store.d.ts +7 -2
- package/dist/plugins/local-checkpoint-store.js +13 -8
- package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
- package/dist/plugins/local-data-dir-modes-m39.js +182 -0
- package/dist/plugins/local-engine-high-water.d.ts +11 -0
- package/dist/plugins/local-engine-high-water.js +59 -0
- package/dist/plugins/local-session-store.d.ts +119 -30
- package/dist/plugins/local-session-store.js +156 -53
- package/dist/plugins/local-task-attachment-store.d.ts +2 -0
- package/dist/plugins/local-task-attachment-store.js +10 -11
- package/dist/plugins/memory-embedder-fingerprint.d.ts +33 -10
- package/dist/plugins/memory-embedder-fingerprint.js +52 -12
- package/dist/plugins/memory-embedder.d.ts +1 -1
- package/dist/plugins/memory-embedder.js +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +30 -6
- package/dist/plugins/memory-engine-pg.js +96 -214
- package/dist/plugins/memory-engine-sql-apply.d.ts +130 -0
- package/dist/plugins/memory-engine-sql-apply.js +358 -0
- package/dist/plugins/memory-engine-tidb.d.ts +38 -9
- package/dist/plugins/memory-engine-tidb.js +99 -230
- package/dist/plugins/memory-key-guards.d.ts +1 -1
- package/dist/plugins/memory-origin-law.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +169 -83
- package/dist/plugins/one-time-migrations.js +295 -235
- package/dist/plugins/owner-only-file-mode.d.ts +29 -0
- package/dist/plugins/owner-only-file-mode.js +141 -0
- package/dist/plugins/permission-rule-store-file.d.ts +17 -3
- package/dist/plugins/permission-rule-store-file.js +20 -1
- package/dist/plugins/pg-pool.d.ts +2 -1
- package/dist/plugins/pg-pool.js +12 -5
- package/dist/plugins/release-version.d.ts +20 -0
- package/dist/plugins/release-version.js +28 -0
- package/dist/plugins/remote-env-adb.d.ts +20 -4
- package/dist/plugins/remote-env-adb.js +39 -11
- package/dist/plugins/remote-env-e2b.d.ts +12 -3
- package/dist/plugins/remote-env-e2b.js +6 -4
- package/dist/plugins/remote-env-host.d.ts +9 -1
- package/dist/plugins/remote-env-host.js +6 -5
- package/dist/plugins/remote-env-k8s.d.ts +5 -2
- package/dist/plugins/remote-env-k8s.js +15 -4
- package/dist/plugins/remote-env-local-docker.d.ts +4 -1
- package/dist/plugins/remote-env-local-docker.js +3 -3
- package/dist/plugins/remote-env-ssh.d.ts +8 -2
- package/dist/plugins/remote-env-ssh.js +26 -24
- package/dist/plugins/remote-shell.d.ts +59 -30
- package/dist/plugins/remote-shell.js +175 -62
- package/dist/plugins/retention-declaration.d.ts +37 -0
- package/dist/plugins/retention-declaration.js +9 -0
- package/dist/plugins/retention-deployment.d.ts +126 -0
- package/dist/plugins/retention-deployment.js +88 -0
- package/dist/plugins/retention-lane-store-sql.d.ts +74 -4
- package/dist/plugins/retention-lane-store-sql.js +103 -1
- package/dist/plugins/retention-sql.d.ts +29 -0
- package/dist/plugins/retention-sql.js +8 -0
- package/dist/plugins/run-store-sql.js +2 -2
- package/dist/plugins/schema-consistency.d.ts +0 -6
- package/dist/plugins/schema-consistency.js +1 -2
- package/dist/plugins/schema-ensure-legs.d.ts +1 -1
- package/dist/plugins/schema-ensure-legs.js +13 -3
- package/dist/plugins/session-ext-table.d.ts +74 -0
- package/dist/plugins/session-ext-table.js +121 -0
- package/dist/plugins/session-fork.d.ts +31 -9
- package/dist/plugins/session-fork.js +3 -2
- package/dist/plugins/session-placement.d.ts +4 -2
- package/dist/plugins/session-row-sql.d.ts +8 -7
- package/dist/plugins/session-row-sql.js +15 -7
- package/dist/plugins/session-store-sql.d.ts +131 -0
- package/dist/plugins/session-store-sql.js +298 -0
- package/dist/plugins/session-workspace-cell.d.ts +2 -2
- package/dist/plugins/session-workspace-cell.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +10 -0
- package/dist/plugins/shared-memory-store-sql.js +13 -13
- package/dist/plugins/snapshot-bucket-presence.js +1 -1
- package/dist/plugins/sql-driver.d.ts +23 -7
- package/dist/plugins/sql-driver.js +41 -8
- package/dist/plugins/sql-errors.d.ts +5 -2
- package/dist/plugins/sql-errors.js +4 -0
- package/dist/plugins/sql-json-column.d.ts +5 -1
- package/dist/plugins/store-backend.d.ts +46 -16
- package/dist/plugins/store-backend.js +192 -69
- package/dist/plugins/store-contracts.d.ts +10 -13
- package/dist/plugins/store-contracts.js +1 -9
- package/dist/plugins/store-sweep.d.ts +63 -0
- package/dist/plugins/store-sweep.js +48 -0
- package/dist/plugins/task-attachment-store.d.ts +6 -8
- package/dist/plugins/task-attachment-store.js +15 -10
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/text-column-capacity.d.ts +21 -0
- package/dist/plugins/text-column-capacity.js +5 -0
- package/dist/plugins/tidb-pool.d.ts +3 -2
- package/dist/plugins/tidb-pool.js +20 -32
- package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
- package/dist/prompt-screen.d.ts +6 -9
- package/dist/prompt-screen.js +2 -5
- package/dist/read-face-posture.d.ts +6 -6
- package/dist/read-face-posture.js +2 -2
- package/dist/request-value-closure.d.ts +5 -5
- package/dist/request-value-closure.js +1 -1
- package/dist/rules-consent.d.ts +48 -27
- package/dist/rules-consent.js +147 -23
- package/dist/run-cancel-context.d.ts +4 -1
- package/dist/run-cancel-context.js +2 -1
- package/dist/run-local.js +17 -13
- package/dist/runs.d.ts +48 -30
- package/dist/runs.js +27 -17
- package/dist/runtime-caps-resolver.d.ts +15 -8
- package/dist/runtime-caps-resolver.js +14 -10
- package/dist/sandbox-egress-policy.js +6 -11
- package/dist/sandbox-rbac-rules.d.ts +88 -0
- package/dist/sandbox-rbac-rules.js +80 -0
- package/dist/sealed-key-layout.d.ts +16 -0
- package/dist/sealed-key-layout.js +3 -0
- package/dist/sealed-key.js +8 -6
- package/dist/security.d.ts +43 -9
- package/dist/security.js +9 -2
- package/dist/sema-config-dir.js +2 -2
- package/dist/server-secret-env.d.ts +2 -0
- package/dist/service-version.d.ts +2 -1
- package/dist/service-version.js +2 -2
- package/dist/session-error-wire.d.ts +1 -1
- package/dist/session-incarnation.d.ts +8 -5
- package/dist/session-notify-door.d.ts +5 -3
- package/dist/session-resident-background.d.ts +110 -0
- package/dist/session-resident-background.js +88 -0
- package/dist/session-row.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +53 -14
- package/dist/session-sync-kernel.js +70 -1
- package/dist/session-sync.d.ts +5 -3
- package/dist/session-workspace.d.ts +12 -2
- package/dist/session-workspace.js +6 -0
- package/dist/sighup-idle.d.ts +9 -7
- package/dist/sighup-idle.js +4 -5
- package/dist/spec-fields.d.ts +16 -0
- package/dist/spec-fields.js +7 -0
- package/dist/store-posture.d.ts +2 -1
- package/dist/stored-request-env-credentials-m38.d.ts +3 -0
- package/dist/stored-request-env-credentials-m38.js +8 -0
- package/dist/stored-request-hooks-m20.d.ts +3 -2
- package/dist/stored-request-hooks-m20.js +19 -14
- package/dist/stored-request-prompt-profile-m30.d.ts +1 -1
- package/dist/stores-sql/blob-index-sql.d.ts +148 -0
- package/dist/stores-sql/blob-index-sql.js +154 -0
- package/dist/{plugins → stores-sql}/checkpoint-store-sql.d.ts +14 -428
- package/dist/{plugins → stores-sql}/checkpoint-store-sql.js +43 -220
- package/dist/{plugins → stores-sql}/file-history-store-sql.d.ts +23 -11
- package/dist/{plugins → stores-sql}/file-history-store-sql.js +23 -18
- package/dist/{plugins → stores-sql}/mailbox-store-sql.d.ts +2 -2
- package/dist/{plugins → stores-sql}/mailbox-store-sql.js +4 -4
- package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +27 -67
- package/dist/{plugins → stores-sql}/pg-session-storage.js +82 -207
- package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +123 -217
- package/dist/{plugins → stores-sql}/retention-store-sql.js +66 -190
- package/dist/{plugins → stores-sql}/roster-store-sql.d.ts +2 -2
- package/dist/{plugins → stores-sql}/roster-store-sql.js +1 -1
- package/dist/{plugins → stores-sql}/session-event-payload.d.ts +1 -1
- package/dist/{plugins → stores-sql}/session-event-payload.js +1 -1
- package/dist/stores-sql/session-policy-store-sql.d.ts +1 -1
- package/dist/stores-sql/session-write-hooks.d.ts +59 -0
- package/dist/stores-sql/session-write-hooks.js +2 -0
- package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +10 -11
- package/dist/{plugins → stores-sql}/tidb-session-storage.js +10 -21
- package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +35 -112
- package/dist/{plugins → stores-sql}/tidb-session-store.js +73 -169
- package/dist/{plugins → stores-sql}/tool-result-store-sql.d.ts +3 -3
- package/dist/{plugins → stores-sql}/tool-result-store-sql.js +6 -6
- package/dist/stores-sql/windowed-session-storage.d.ts +56 -0
- package/dist/stores-sql/windowed-session-storage.js +61 -0
- package/dist/{plugins → stores-sql}/workflow-journal-store-sql.d.ts +7 -12
- package/dist/{plugins → stores-sql}/workflow-journal-store-sql.js +3 -8
- package/dist/task-a2a.d.ts +7 -1
- package/dist/task-a2a.js +15 -14
- package/dist/task-cwd.d.ts +11 -3
- package/dist/task-cwd.js +17 -1
- package/dist/task-mcp.d.ts +10 -2
- package/dist/task-mcp.js +13 -16
- package/dist/task-settings.d.ts +68 -8
- package/dist/task-settings.js +63 -6
- package/dist/tool-approval.d.ts +23 -10
- package/dist/tool-approval.js +10 -6
- package/dist/trace/core-keyset-guard.d.ts +17 -10
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +4 -0
- package/dist/trace/exit-seat.d.ts +29 -1
- package/dist/trace/exit-seat.js +4 -0
- package/dist/trace/project.d.ts +33 -16
- package/dist/trace/project.js +21 -9
- package/dist/trace/redact.d.ts +13 -2
- package/dist/trace/redact.js +347 -78
- package/dist/trace/self-minted-wire.d.ts +587 -16
- package/dist/trace/self-minted-wire.js +215 -9
- package/dist/trace/sema-provenance.d.ts +45 -41
- package/dist/trace/sema-provenance.js +81 -10
- package/dist/trace/task-notification-facets.d.ts +70 -2
- package/dist/trace/task-notification-facets.js +71 -1
- package/dist/trace/wire-projection-faces.d.ts +39 -3
- package/dist/trace/wire-projection-faces.js +27 -2
- package/dist/unread-request-members.d.ts +66 -0
- package/dist/unread-request-members.js +41 -0
- package/dist/usage-analytics.d.ts +4 -0
- package/dist/user-input-ledger.d.ts +2 -2
- package/dist/web-admin-client/apply-effective.js +22 -26
- package/dist/web-admin-client/candidate-gate.d.ts +35 -3
- package/dist/web-admin-client/candidate-gate.js +53 -5
- package/dist/web-admin-client/center-request.d.ts +4 -1
- package/dist/web-admin-client/center-request.js +2 -1
- package/dist/web-admin-client/effective-keys.js +0 -1
- package/dist/web-admin-client/facade.d.ts +1 -1
- package/dist/web-admin-client/http-client.d.ts +1 -0
- package/dist/web-admin-client/http-client.js +17 -9
- package/dist/web-admin-client/restart-signal.js +5 -2
- package/dist/web-admin-client/skills-mcp.d.ts +20 -6
- package/dist/web-admin-client/skills-mcp.js +26 -21
- package/dist/web-admin-client/types.d.ts +34 -49
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +2 -2
- package/package.json +22 -13
- package/scripts/drain-check-local.mjs +8 -55
- package/scripts/drain-check.mysql.sql +3 -40
- package/scripts/drain-check.pg.sql +3 -40
- package/skills/update-config.md +1 -1
- package/wire-changes/server@7.146.0.json +3221 -0
- package/wire-changes/server@7.147.0.json +813 -0
- package/dist/approval-batch-census.d.ts +0 -27
- package/dist/approval-batch-census.js +0 -27
|
@@ -22,12 +22,26 @@ export type SafeText = string & {
|
|
|
22
22
|
* 进请求面 400 拒句、续跑重放的丢弃行与重读行、名册的跳过行,以及能力读面 `GET /v1/capabilities/mcp` 上引擎整集拒(两台撞同一工具命名空间前缀)的拒句 —— 读者是调用方与运维,句子已是一行;不设界(拒句要说全判官的话),原样出门。
|
|
23
23
|
* · `inbox-diagnostics-text`:`workflow_complete` 补投帧上的诊断教学文本(`diagnostics`)—— 引擎在 workflow 完成通知上铸的「读哪里 / 怎么续跑」文本,入会话收件时洗一次,
|
|
24
24
|
* 店里(`payload` 列)只放出门安全的字节,drain 逐字带出。洗法与 live `task_notification.diagnostics` 同一个 scope(`free-text`);
|
|
25
|
-
* 这一行比 `trace-frame-text` 多一条界(4000 码元,与同族条目的文本位同额)
|
|
25
|
+
* 这一行比 `trace-frame-text` 多一条界(4000 码元,与同族条目的文本位同额),原样出门:逐成员的粗截;整条 `payload` 装不装得下由条目编码座按字节预算终判
|
|
26
|
+
* (`orchestration/workflow-completion-inbox.ts` 的 `encodeInboxBody`,预算 = 最窄后端的 `payload` 列容量,超 ⇒ 最小形 + `payloadTruncated`)。
|
|
27
|
+
* · `inbox-frame-text`:`task_notification` 补投帧(停驻收件、下一次开流 drain)上会话箱车道的自由文本位 —— 三只载体的 `crossSessionMessage.fromName` /
|
|
28
|
+
* `.body`、`crossSessionNotice.text` 与侧记 `_sema_provenance.peerMeta.notice` 的 `recipient` / `target` / `detail` / `dropReason`(别的会话写的或引擎嵌着
|
|
29
|
+
* 别的会话文本渲的句子);入会话收件时经与 live 腿同一只判据(`task-notification-facets.ts` / `sema-provenance.ts`)洗一次,店里(`payload` 列)只放
|
|
30
|
+
* 出门安全的字节,drain 逐字带出。scope 与 live 的 `trace-frame-text` 同(`free-text`),多一条界(4000 码元,与同族条目既有文本位 `result` /
|
|
31
|
+
* `agentMessage.body` 同额),原样出门。这条界是**逐成员**的粗截:多枚文本位相加、JSON 转义放大(控制字符一枚 6 字节)后的总和由条目编码座按
|
|
32
|
+
* 整条字节预算终判(`encodeInboxBody`;同上行),本行只挡一枚文本独自变长。
|
|
26
33
|
* · `boot-refusal-line`:起服拒启的一行拒句 —— 部署座装配的拒句(`mods-declaration.ts`:声明的席名、包名、读包者 / 引擎准入交回的话);它经进程级 fatal 出口原样多行进 stderr,
|
|
27
34
|
* 所以必须在这里先压成一行(一句拒因里的换行会在运维的终端里伪造出第二条日志行);界 512 码元(含截断记号)。
|
|
35
|
+
* · `workflow-recovery-summary`:workflow 完成通知在崩溃恢复路径上由 run 行的错误文本合成的摘要(`summary`;`orchestration/workflow-notify-journal.ts` 的 `recoverySummary`)——
|
|
36
|
+
* 诊断面,脱敏器的诊断档(`diagnostic`:自由文本档全员 + 诊断值位臂,凭据名 / 方案词后面的值不设强度门);不设界、原样出门:摘要的界与主机身份两形(整条 URL / 绝对路径)
|
|
37
|
+
* 是摘要自己的形(它镜像引擎 live 摘要的那一形),在座之后施加,不是凭据判定。
|
|
28
38
|
* · `peer-inbound-card-text`:运维审批队列 `peer_inbound` 行(`GET /v1/approvals` 的 `pending[]` 与 `/v1/approvals/stream` 的 `pending` 帧)上被扣跨会话来信的
|
|
29
39
|
* 存储正文(`content`,core 的规范存储形 `[summary] message`)与发信方显示名(`fromName`)—— 别的会话写的自由文本,读者是收信方本人;不设界(core 存的那一份就是
|
|
30
40
|
* 收信方要审的全文,截了就审不全),原样出门(JSON 串值,消费方自己渲染)。
|
|
41
|
+
* · `rewind-ledger-path`:run 外回退口(`POST /v1/sessions/:id/rewind-files`)200 体上被跟踪文件的路径(台账与预览的 `filesChanged` / `identicalSkipped` /
|
|
42
|
+
* `refused[].path` / `failed[].path`;源头是模型交的路径参数)—— 不设界(截过的路径就不是那个文件了,消费方要拿它去对文件),原样出门。
|
|
43
|
+
* · `rewind-ledger-reason`:同一口台账上的拒因 / 故障句(`refused[].reason` / `failed[].reason` / `error.message`;引擎与文件历史店写的、可能带着抛出物原文)——
|
|
44
|
+
* 界 500 码元,原样出门(JSON 串值,消费方自己渲染)。
|
|
31
45
|
*/
|
|
32
46
|
declare const EXIT_SEATS: {
|
|
33
47
|
readonly "trace-frame-text": {
|
|
@@ -73,6 +87,10 @@ declare const EXIT_SEATS: {
|
|
|
73
87
|
readonly scope: "free-text";
|
|
74
88
|
readonly maxChars: 4000;
|
|
75
89
|
};
|
|
90
|
+
readonly "inbox-frame-text": {
|
|
91
|
+
readonly scope: "free-text";
|
|
92
|
+
readonly maxChars: 4000;
|
|
93
|
+
};
|
|
76
94
|
readonly "boot-refusal-line": {
|
|
77
95
|
readonly scope: "free-text";
|
|
78
96
|
readonly maxChars: 512;
|
|
@@ -81,6 +99,16 @@ declare const EXIT_SEATS: {
|
|
|
81
99
|
readonly "peer-inbound-card-text": {
|
|
82
100
|
readonly scope: "free-text";
|
|
83
101
|
};
|
|
102
|
+
readonly "workflow-recovery-summary": {
|
|
103
|
+
readonly scope: "diagnostic";
|
|
104
|
+
};
|
|
105
|
+
readonly "rewind-ledger-path": {
|
|
106
|
+
readonly scope: "free-text";
|
|
107
|
+
};
|
|
108
|
+
readonly "rewind-ledger-reason": {
|
|
109
|
+
readonly scope: "free-text";
|
|
110
|
+
readonly maxChars: 500;
|
|
111
|
+
};
|
|
84
112
|
};
|
|
85
113
|
export type ExitSeat = keyof typeof EXIT_SEATS;
|
|
86
114
|
/** 设了界的座名。 */
|
package/dist/trace/exit-seat.js
CHANGED
|
@@ -15,8 +15,12 @@ const EXIT_SEATS = {
|
|
|
15
15
|
"mcp-remote-text": { scope: "free-text", maxChars: 200 },
|
|
16
16
|
"peer-declaration-sentence": { scope: "free-text" },
|
|
17
17
|
"inbox-diagnostics-text": { scope: "free-text", maxChars: 4000 },
|
|
18
|
+
"inbox-frame-text": { scope: "free-text", maxChars: 4000 },
|
|
18
19
|
"boot-refusal-line": { scope: "free-text", maxChars: 512, emit: "log-line" },
|
|
19
20
|
"peer-inbound-card-text": { scope: "free-text" },
|
|
21
|
+
"workflow-recovery-summary": { scope: "diagnostic" },
|
|
22
|
+
"rewind-ledger-path": { scope: "free-text" },
|
|
23
|
+
"rewind-ledger-reason": { scope: "free-text", maxChars: 500 },
|
|
20
24
|
};
|
|
21
25
|
export function seatMaxChars(seat) {
|
|
22
26
|
return EXIT_SEATS[seat].maxChars;
|
package/dist/trace/project.d.ts
CHANGED
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import type { GateOutcome, McpDelivered, TaskResult, SystemInjectionPriority } from "@sema-agent/core";
|
|
27
27
|
import type { RunEvent, RunRecord } from "../plugins/store-contracts.js";
|
|
28
|
-
import type { ModelUsageDelta, ModelUsageTracker,
|
|
29
|
-
import type { RunCompanionRecord } from "../observability/prompt-manifest.js";
|
|
28
|
+
import type { ModelUsageDelta, ModelUsageTracker, PromptManifestTracker } from "../budget.js";
|
|
30
29
|
import { type SafeText } from "./exit-seat.js";
|
|
31
|
-
import { type
|
|
30
|
+
import { type SemaProvenanceWire } from "./sema-provenance.js";
|
|
31
|
+
import { type CrossSessionMessageWire, type CrossSessionNoticeWire } from "./task-notification-facets.js";
|
|
32
32
|
import { type ExtensionRequesterFace, type ToolInputRewriteFace } from "./extension-call-face.js";
|
|
33
33
|
import type { LedgerEventType, ParkLedgerEventType } from "./ledger-events.js";
|
|
34
34
|
import type { InstructionsSegment } from "../instruction-selection.js";
|
|
@@ -47,15 +47,23 @@ type GetEventsFn = (taskId: string, afterSeq: number) => Promise<RunEvent[]>;
|
|
|
47
47
|
* apart rows written under the current component semantics from older rows (pre-dating this label) when it
|
|
48
48
|
* sums across a run's whole event log. */
|
|
49
49
|
export declare function appendModelUsageDelta(append: AppendFn, modelUsage: ModelUsageTracker | undefined, taskId: string): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
/** 一条腿在 run 级清单 / 伴随记录队列上的那一席(产物带方法 ⇒ `create*`)。 */
|
|
51
|
+
export interface PromptManifestSeat {
|
|
52
|
+
/** 把这条腿已排队的清单行与伴随记录(按发射序)落进**这条腿的**账本写口;无待落 ⇒ 零 I/O(一次 Map 读),所以腿可以在每一帧之前调。 */
|
|
53
|
+
drain(append: AppendFn): Promise<void>;
|
|
54
|
+
/** 收摊:只在本席仍持租约时注销并丢弃未排空的记录(B-3 窗:一条快的兄弟续跑腿可能已经以同一 taskId 重新登记,那一席归它)。幂等。 */
|
|
55
|
+
release(): void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* **写账本的腿登记 run 级清单 / 伴随记录队列的唯一一只登记器**(`prompt_assembled` / `config_assembled` / `cross_boundary_taint` 三种行同一只队列)。
|
|
59
|
+
*
|
|
60
|
+
* 一条律:**有账本的腿就有这一席** —— bg 首跑(`runs.ts`)、续跑两径(`http/resume-legs.ts`)、同步流腿(`http/routes/tasks.ts`,有 durable run 行即有账本)
|
|
61
|
+
* 都经这一只:建席 = 登记(tracer 的 `record` / `recordCompanion` 只收已登记的顶层 run,子代永不登记)、`drain` = 落本腿账本、`release` = 带租约收摊。
|
|
62
|
+
* 腿只决定**在哪几拍排空**(每一帧之前 / 终局行之前),不再各写一份「登记 → 排空 → 租约清」—— 7.147.0 之前同步流腿漏了这一席,
|
|
63
|
+
* 它的账本因此一行清单 / 伴随记录都没有。非流式 `POST /v1/tasks` 结构上没有账本(契约 KL),没有这一席。
|
|
64
|
+
* `tracker` 缺席(部署没接)⇒ 席是空操作。
|
|
65
|
+
*/
|
|
66
|
+
export declare function createPromptManifestSeat(tracker: PromptManifestTracker | undefined, taskId: string): PromptManifestSeat;
|
|
59
67
|
/** E8: at a TERMINAL done — flush the final delta, then SUM all `model_usage` events (every process leg) into the
|
|
60
68
|
* result's `stats.modelUsage` echo. Returns the result unchanged when no usage was tracked (shell soft-degrades). */
|
|
61
69
|
export declare function attachModelUsage<T extends TaskResult>(result: T, ctx: {
|
|
@@ -538,9 +546,12 @@ export declare function taskNotificationEventData(ev: {
|
|
|
538
546
|
body: string;
|
|
539
547
|
};
|
|
540
548
|
/** 同批:typed 归因侧记(wire 键;core 契约「a host projects it, the model never sees it」)。成员逐个挑取,
|
|
541
|
-
* `kind`
|
|
542
|
-
|
|
543
|
-
|
|
549
|
+
* `kind` 过闭集、`peerMeta` 逐成员(`trace/sema-provenance.ts` 单点,park 半场同一判据;入参按 `unknown` 收、判过形才成 typed)。 */
|
|
550
|
+
_sema_provenance?: unknown;
|
|
551
|
+
/** [ref]:会话箱车道的三只载体 —— 判据单点在 `trace/task-notification-facets.ts`(与 park 半场同一只;入参按 `unknown` 收)。 */
|
|
552
|
+
crossSessionMessage?: unknown;
|
|
553
|
+
crossSessionNotice?: unknown;
|
|
554
|
+
inboxNotice?: unknown;
|
|
544
555
|
/** core 7.30.0 [ref] S1 / [ref] / [ref]([ref]):委派终态帧三枚 facet + 重供两键 —— 判据单点在
|
|
545
556
|
* `trace/task-notification-facets.ts`(与 park 半场同一只;入参按 `unknown` 收、判过形才成 typed)。 */
|
|
546
557
|
spawnName?: string;
|
|
@@ -580,6 +591,9 @@ export declare function taskNotificationEventData(ev: {
|
|
|
580
591
|
from: string;
|
|
581
592
|
body: SafeText;
|
|
582
593
|
};
|
|
594
|
+
_sema_provenance?: SemaProvenanceWire;
|
|
595
|
+
crossSessionMessage?: CrossSessionMessageWire;
|
|
596
|
+
crossSessionNotice?: CrossSessionNoticeWire;
|
|
583
597
|
}>;
|
|
584
598
|
/** The `compacted` payload — EXPLICIT WHITELIST shared by all three legs (bg runs.ts + resume append + the sync
|
|
585
599
|
* live SSE frame; the 1.72 task_progress lesson: never `{...ev}`). trigger/tokensBefore (MF-18) verbatim;
|
|
@@ -1166,7 +1180,10 @@ export declare function contextUsageEventData(ev: {
|
|
|
1166
1180
|
* trace SSE `GET /v1/tasks/:id/stream` 上是 `cross-boundary-taint` 帧,按存下的行原样交出)。帧只在**执行于目标设备的树**上发(武装腿 prepare / 续跑腿 resume 各一帧,离目标读第一次放进树时 observed 一帧),
|
|
1167
1181
|
* 宿主车道零帧 ⇒ 本行在宿主车道上永不出现。纯元数据(core 逐字「Metadata only」):树的污染位(`taint`,core `CROSS_BOUNDARY_TAINT_BITS` 的子集)、
|
|
1168
1182
|
* 树是否受治理(`governed`)、阶段(`phase`)、腿的 `runId`,observed 时那一只调用(`toolName` / `toolCallId`)。
|
|
1169
|
-
* 信封(`kind` / `version` / `taskId` / `ts`)
|
|
1183
|
+
* 信封(`kind` / `version` / `taskId` / `ts`)不上行:账本行自带 seq / ts(`RunEvent`),行种类由账本行名说;`taskId` 不上行,是因为落进来的帧都是已登记的顶层 run 发的 ——
|
|
1184
|
+
* 落账处 `PromptManifestTracker.recordCompanion` 只收已登记的 `taskId`(与清单行同一只登记门;`createPromptManifestSeat` 建席即登记,子代永不登记),行落进的就是这条 `taskId` 自己的账本,
|
|
1185
|
+
* 所以根腿发的帧它就是 run;委派子代腿发的帧 `taskId` 是**子代腿自己的 id**(不是根 run)、未登记 ⇒ 落账处不收,这类帧今天落不进根 run 的账本
|
|
1186
|
+
* (契约 §4a-cbt「读法」的限定;根归属候引擎给帧加根地址键)。登记表 `cross_boundary_taint` 行(`trace/wire-projection-faces.ts`)是同一句读法。
|
|
1170
1187
|
* 值:`taint` 交一份数组副本(只收串);`toolName` / `toolCallId` 在场才铸。词按开集串过境(属主是引擎的闭集;本仓不判词表)。
|
|
1171
1188
|
*/
|
|
1172
1189
|
export declare function crossBoundaryTaintEventData(ev: {
|
package/dist/trace/project.js
CHANGED
|
@@ -7,8 +7,8 @@ import { seatText } from "./exit-seat.js";
|
|
|
7
7
|
import { sanitizeWireText } from "./engine-notice-wire.js";
|
|
8
8
|
import { projectToolOutput, projectToolStructured } from "./tool-output-media.js";
|
|
9
9
|
import { injectionTierOrAbsent } from "./injection-tier.js";
|
|
10
|
-
import {
|
|
11
|
-
import { resupplyFields, terminalFrameFacetFields } from "./task-notification-facets.js";
|
|
10
|
+
import { semaProvenanceFields } from "./sema-provenance.js";
|
|
11
|
+
import { resupplyFields, sessionBoxCarrierFields, terminalFrameFacetFields } from "./task-notification-facets.js";
|
|
12
12
|
import { dropProjectedFace } from "./projection-drop.js";
|
|
13
13
|
import { extensionAnswererOf, extensionRequesterOf, toolInputRewriteOf } from "./extension-call-face.js";
|
|
14
14
|
import { projectByTable } from "./projection-table.js";
|
|
@@ -23,7 +23,7 @@ export async function appendModelUsageDelta(append, modelUsage, taskId) {
|
|
|
23
23
|
await append("model_usage", { usage: tagged });
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
async function appendPromptManifest(append, tracker, taskId) {
|
|
27
27
|
const records = tracker?.drain(taskId);
|
|
28
28
|
if (records)
|
|
29
29
|
for (const m of records)
|
|
@@ -33,6 +33,13 @@ export async function appendPromptManifest(append, tracker, taskId) {
|
|
|
33
33
|
for (const c of companions)
|
|
34
34
|
await append(c.type, c.data);
|
|
35
35
|
}
|
|
36
|
+
export function createPromptManifestSeat(tracker, taskId) {
|
|
37
|
+
const lease = tracker?.register(taskId) ?? 0;
|
|
38
|
+
return {
|
|
39
|
+
drain: (append) => appendPromptManifest(append, tracker, taskId),
|
|
40
|
+
release: () => tracker?.clear(taskId, lease),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
36
43
|
export async function attachModelUsage(result, ctx) {
|
|
37
44
|
if (!ctx.modelUsage)
|
|
38
45
|
return result;
|
|
@@ -174,6 +181,15 @@ function screenedGateOrThrow(v) {
|
|
|
174
181
|
...(d.askClass === undefined ? {} : { askClass: d.askClass }),
|
|
175
182
|
...(d.classes === undefined ? {} : { classes: [...d.classes] }),
|
|
176
183
|
...(d.extension === undefined ? {} : { extension: seatText("trace-frame-text", d.extension) }),
|
|
184
|
+
...(d.echoed === undefined
|
|
185
|
+
? {}
|
|
186
|
+
: {
|
|
187
|
+
echoed: d.echoed.map((e) => ({
|
|
188
|
+
kind: e.kind,
|
|
189
|
+
value: seatText("trace-frame-text", e.value),
|
|
190
|
+
...(e.canonical === undefined ? {} : { canonical: seatText("trace-frame-text", e.canonical) }),
|
|
191
|
+
})),
|
|
192
|
+
}),
|
|
177
193
|
}
|
|
178
194
|
: { kind: "allowed", ...(classifier === undefined ? {} : { classifier }), ...(released === undefined ? {} : { released }), ...(clearedBy === undefined ? {} : { clearedBy }) },
|
|
179
195
|
...(settlement === undefined ? {} : { settlement }),
|
|
@@ -389,14 +405,10 @@ export function taskNotificationEventData(ev) {
|
|
|
389
405
|
...(n.output_file !== undefined ? { output_file: seatText("trace-frame-text", n.output_file) } : {}),
|
|
390
406
|
...(n.usage !== undefined ? { usage: n.usage } : {}),
|
|
391
407
|
...(n.agentMessage !== undefined ? { agentMessage: { from: n.agentMessage.from, body: seatText("trace-frame-text", n.agentMessage.body) } } : {}),
|
|
392
|
-
...(
|
|
393
|
-
if (n._sema_provenance === undefined)
|
|
394
|
-
return {};
|
|
395
|
-
const p = semaProvenanceOrAbsent(n._sema_provenance);
|
|
396
|
-
return p !== undefined ? { _sema_provenance: p } : {};
|
|
397
|
-
})(),
|
|
408
|
+
...semaProvenanceFields(n, "trace-frame-text"),
|
|
398
409
|
...terminalFrameFacetFields(n),
|
|
399
410
|
...resupplyFields(n),
|
|
411
|
+
...sessionBoxCarrierFields(n, "trace-frame-text"),
|
|
400
412
|
...(() => {
|
|
401
413
|
const tier = injectionTierOrAbsent(ev.priority);
|
|
402
414
|
return tier !== undefined ? { priority: tier } : {};
|
package/dist/trace/redact.d.ts
CHANGED
|
@@ -57,9 +57,15 @@ export declare function resetArmPoolBudgetForTest(): void;
|
|
|
57
57
|
* 锚在每一份视图里都被摧毁。把结构锚臂一并踢出本档,270 形读数**零差**。留着它们是因为「谁的判别力依赖
|
|
58
58
|
* 自由文本语法」这条**判据**上它们本就不该被排除(踢掉是另一条理由),不是因为它们在这里还起作用。
|
|
59
59
|
*
|
|
60
|
+
* · `"diagnostic"`:诊断面 —— 由错误文本合成、给人读的失败句(workflow 恢复摘要)。多遮一个字只是一句诊断少一截,少遮一个字是凭据明文,
|
|
61
|
+
* 所以这一档 = 自由文本档**全员** + 只在这一档在场的**诊断值位臂**({@link collectDiagnosticValueSpans}:凭据名 / `Basic`·`Bearer` 方案词后面的值,
|
|
62
|
+
* 不设强度门)。它是诊断面的那一读归进同一只脱敏器的落点:读的是同一张名表、同一个候选池、同一条并集律,出口经出口座的诊断行。
|
|
63
|
+
*
|
|
60
64
|
* 闭集:加一个档而不在 {@link armPool} 的档表里处置 ⇒ **编译**红。
|
|
61
65
|
*/
|
|
62
|
-
type RedactionScope = "free-text" | "bounded-unit";
|
|
66
|
+
type RedactionScope = "free-text" | "bounded-unit" | "diagnostic";
|
|
67
|
+
/** 🧪 值词表里 `type-name` 一列的词(增补纪律钉读:每个类型名在基线门 c 组都有一格语料)。 */
|
|
68
|
+
export declare function lineKeyTypeNamesForTest(): readonly string[];
|
|
63
69
|
/** 本模块会写进文本的全部替换 token(`«…»` 字面),从三张表现算 —— 表改这里自动跟,不另抄一份。
|
|
64
70
|
* 🔴 **[ref] v2 修复轮起它只剩一个语义:闭形闭集的加载期校验**。运行期「这一段是不是一枚记号」已经由
|
|
65
71
|
* 记号行的闭**形**一处答完({@link tokenUnits} / {@link tokenEnd}),按闭**集**再认一遍的
|
|
@@ -93,6 +99,9 @@ export declare function unitCountsWithinForTest(table: ReadonlyArray<readonly [n
|
|
|
93
99
|
/** 🧪 结构读数(与 {@link ppkScanBytesForTest} 同一条技法):本扫描器读过的单元数,线性钉用。 */
|
|
94
100
|
export declare function anchoredScanUnitsForTest(): number;
|
|
95
101
|
export declare function resetAnchoredScanUnitsForTest(): void;
|
|
102
|
+
/** 🧪 结构读数(与 {@link anchoredScanUnitsForTest} 同一条技法):诊断值位扫描器读过的单元数(向右读的值 / 空白单元 + 向左走的空白 / 名字码元),线性钉用。 */
|
|
103
|
+
export declare function diagnosticScanUnitsForTest(): number;
|
|
104
|
+
export declare function resetDiagnosticScanUnitsForTest(): void;
|
|
96
105
|
/** 测试可见([ref] 真值表的两半):结构段里**表行只作声明、实现是手写扫描器**的臂 —— 声明正则的**新拷贝**
|
|
97
106
|
* (`lastIndex` 不与模块内那一枚共享)+ 扫描器在一份原文上产的候选跨度 `[起, 止)`。臂名是闭集 ⇒ 穷尽 `switch`
|
|
98
107
|
* (少一个 `case` = 缺返回 = 编译红)。 */
|
|
@@ -229,11 +238,13 @@ export declare function redactSecretsWithArms(text: string, opts?: {
|
|
|
229
238
|
* 同一只 {@link runRedaction}、同一遍扫描,交出池算好的 `kept` 跨度映回**原文**之后的那一份([ref] 那一份;坐标在原文上,
|
|
230
239
|
* 与产物同一套 —— [ref] 起;此前在剥后视图上),
|
|
231
240
|
* 不是第二只脱敏器、不改任何判据、不喂观察者(`observe:false`,与影子重扫同口);`opts.json` 与 {@link redactSecrets} 的同名选项
|
|
232
|
-
* 逐字同义(JSON 模式,`redactedPreview` 走的那一条)
|
|
241
|
+
* 逐字同义(JSON 模式,`redactedPreview` 走的那一条);`opts.scope` = 档(缺省自由文本档;`"diagnostic"` = 诊断档,生产入口是出口座的诊断行 `workflow-recovery-summary`,
|
|
242
|
+
* 基线门的诊断档按它跑 —— 座不收 JSON 模式,a 组的 json 份经这里量同一个档)。生产代码不调用它:
|
|
233
243
|
* 问「有没有凭据形」的消费方走 {@link redactSecretsWithArms}。
|
|
234
244
|
*/
|
|
235
245
|
export declare function redactionSpansForTest(text: string, opts?: {
|
|
236
246
|
json?: boolean;
|
|
247
|
+
scope?: "free-text" | "diagnostic";
|
|
237
248
|
}): {
|
|
238
249
|
text: string;
|
|
239
250
|
spans: ReadonlyArray<{
|