@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ToolResultProvenance, ToolResultStore, ToolResultSlice, ToolResultDeletionReport } from "@sema-agent/core";
|
|
2
2
|
import type { Pool as MySqlPool } from "mysql2/promise";
|
|
3
3
|
import type { Pool as PgPool, PoolClient as PgPoolClient } from "pg";
|
|
4
|
-
import { type SqlDriver, type SqlDialect } from "
|
|
4
|
+
import { type SqlDriver, type SqlDialect } from "../plugins/sql-driver.js";
|
|
5
5
|
import type { RetentionDeclaration } from "@sema-agent/core";
|
|
6
|
-
import { type IndexSpec } from "
|
|
6
|
+
import { type IndexSpec } from "../plugins/ensure-index.js";
|
|
7
7
|
/** PG schema for the tool_result table — the PG translation of tidb-pool.ts's tool_result DDL
|
|
8
8
|
* (LONGTEXT→TEXT, DATETIME(3)→TIMESTAMPTZ(3), inline KEY→separate CREATE INDEX). Disjoint from other stores'
|
|
9
9
|
* tables, so a self-contained ensureSchema is safe (central pg-pool aggregation is done separately). */
|
|
@@ -31,7 +31,7 @@ export declare function assertToolResultProvenanceSchema(query: (sql: string) =>
|
|
|
31
31
|
export declare class SqlToolResultStore implements ToolResultStore {
|
|
32
32
|
protected readonly db: SqlDriver;
|
|
33
33
|
/** 托管留存声明 = 装配交给它的词(后端按扫车道开不开给;不给 ⇒ `"none"`)。读法与「为什么 SQL 店答 managed 而三方法的实现体在
|
|
34
|
-
* `retention-store-sql.ts`」逐字见 {@link MANAGED_RETENTION}(扫车道开着时本店的 `tool_result` 行由那只聚合店按期清:随会话树删 + 孤儿腿)。 */
|
|
34
|
+
* `retention-store-sql.ts`」逐字见 `plugins/retention-declaration.ts` 的 {@link MANAGED_RETENTION}(扫车道开着时本店的 `tool_result` 行由那只聚合店按期清:随会话树删 + 孤儿腿)。 */
|
|
35
35
|
readonly retention: RetentionDeclaration;
|
|
36
36
|
constructor(db: SqlDriver, opts?: {
|
|
37
37
|
readonly retention?: RetentionDeclaration;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MAX_MINTED_TOOL_RESULT_REF_CHARS, assertSafeToolResultRef, assertToolResultProvenanceMatch, normalizeToolResultProvenance } from "@sema-agent/core";
|
|
2
|
-
import { pgSanitizeText } from "
|
|
3
|
-
import { mysqlDriver, pgDriver } from "
|
|
4
|
-
import { MANAGED_RETENTION, UNMANAGED_RETENTION } from "
|
|
5
|
-
import { ensureIndexes } from "
|
|
6
|
-
import { describeProbedTableDrift, schemaWaysOut } from "
|
|
7
|
-
import { isMissingColumnError } from "
|
|
2
|
+
import { pgSanitizeText } from "../plugins/pg-safe-json.js";
|
|
3
|
+
import { mysqlDriver, pgDriver } from "../plugins/sql-driver.js";
|
|
4
|
+
import { MANAGED_RETENTION, UNMANAGED_RETENTION } from "../plugins/retention-declaration.js";
|
|
5
|
+
import { ensureIndexes } from "../plugins/ensure-index.js";
|
|
6
|
+
import { describeProbedTableDrift, schemaWaysOut } from "../plugins/schema-drift-sentence.js";
|
|
7
|
+
import { isMissingColumnError } from "../plugins/sql-errors.js";
|
|
8
8
|
export const PG_TOOL_RESULT_SCHEMA = [
|
|
9
9
|
`CREATE TABLE IF NOT EXISTS tool_result (
|
|
10
10
|
ref VARCHAR(518) COLLATE "C" NOT NULL,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 两只 SQL 会话存储(`tidb-session-storage.ts` / `pg-session-storage.ts`)共用的**窗口视图** —— 一次唤醒读出的有界日志 `[floor .. leaf]`。
|
|
3
|
+
*
|
|
4
|
+
* ## 组合,不继承
|
|
5
|
+
* 会话树的读法(按 id 取、按类型找、标签、到根的路径、叶子、日志标记、地板、回放丢失)只有引擎那一份:本类把唤醒读出的窗口交给引擎的
|
|
6
|
+
* `InMemorySessionStorage`(组合),每个读都转给它;方言孪生只说两件 SQL 的事 —— 一笔写怎么落库({@link persist}),地板之下按 id 回读一条
|
|
7
|
+
* ({@link readBelowFloor})。不再 `extends` 引擎的存储基类:方言店继承引擎的店基类造第二份店,是依赖方向门 R5′ 拒的形。
|
|
8
|
+
*
|
|
9
|
+
* ## 写序
|
|
10
|
+
* 先落库(方言孪生在自己的事务里按叶子 CAS),落成才记进窗口 —— 与引擎存储「先判后记」同序;落库被拒(CAS 输)时窗口一个字节不动。
|
|
11
|
+
* 记进窗口走引擎存储的追加口(不带期望叶:CAS 已在库里判过,窗口只是跟上那一笔)。
|
|
12
|
+
*
|
|
13
|
+
* ## 叶子是行说的那一格
|
|
14
|
+
* 叶子 = 库里那一格(`session_meta.leaf_id`,引擎存储契约里「后端说出的头」),不是窗口末条之后的叶子(fork 拷整份日志带着别的分支时两者不同)。
|
|
15
|
+
* 窗口(引擎的存储)从条目推叶子、不收后端说的头 ⇒ 叶子由本类自己持有:唤醒时取行上那一格(它不在窗口里 ⇒ `corrupt_session`,与引擎存储基类同一判、同一句),
|
|
16
|
+
* 之后每落一笔前进到「这一笔之后的叶子」(与库里同一事务写下的值同一读法)。窗口里那只按条目推出的叶子不被读。
|
|
17
|
+
*/
|
|
18
|
+
import { InMemorySessionStorage, type SessionLogMark, type SessionMetadata, type SessionStorage, type SessionTreeEntry, type SessionWriteOptions } from "@sema-agent/core";
|
|
19
|
+
export declare abstract class WindowedSessionStorage implements SessionStorage {
|
|
20
|
+
/** 唤醒读出的窗口(引擎的存储;叶子以外的每个读都是它的读)。 */
|
|
21
|
+
private readonly view;
|
|
22
|
+
/** 叶子(头注「叶子是行说的那一格」)。 */
|
|
23
|
+
private leaf;
|
|
24
|
+
/**
|
|
25
|
+
* `entries` = 窗口(按 `seq` 升序);`statedLeafId` = 行上那一格叶子;`floorEntryId` = 窗口的地板(没有压缩 ⇒ `null`,整条日志都在窗口里)。
|
|
26
|
+
* 地板不在窗口里 ⇒ 引擎存储拒 `corrupt_session`;行上的叶子不在窗口里 ⇒ 本类拒 `corrupt_session`(引擎存储基类的同一判、同一句)。
|
|
27
|
+
*/
|
|
28
|
+
protected constructor(metadata: SessionMetadata, entries: SessionTreeEntry[], statedLeafId: string | null, floorEntryId: string | null);
|
|
29
|
+
/** 一笔写落库(方言孪生的事务:叶子 CAS + 追加事件)。抛 ⇒ 窗口不记。 */
|
|
30
|
+
protected abstract persist(entry: SessionTreeEntry, opts?: SessionWriteOptions): Promise<void>;
|
|
31
|
+
/** 地板之下按 id 回读一条(窗口里没有的;标签目标等)。没有 ⇒ `undefined`。 */
|
|
32
|
+
protected abstract readBelowFloor(id: string): Promise<SessionTreeEntry | undefined>;
|
|
33
|
+
getMetadata(): Promise<SessionMetadata>;
|
|
34
|
+
getLeafId(): Promise<string | null>;
|
|
35
|
+
createEntryId(): Promise<string>;
|
|
36
|
+
findEntries<TType extends SessionTreeEntry["type"]>(type: TType): Promise<Array<Extract<SessionTreeEntry, {
|
|
37
|
+
type: TType;
|
|
38
|
+
}>>>;
|
|
39
|
+
getLabel(id: string): Promise<string | undefined>;
|
|
40
|
+
getPathToRoot(leafId: string | null): Promise<SessionTreeEntry[]>;
|
|
41
|
+
getEntries(): Promise<SessionTreeEntry[]>;
|
|
42
|
+
/** 窗口的地板(没有压缩 ⇒ `null`)。 */
|
|
43
|
+
getFloorId(): string | null;
|
|
44
|
+
/** SQL 唤醒没有回放可丢(行是逐条读的):恒 `undefined`,经引擎存储原样答。 */
|
|
45
|
+
getReplayLoss(): ReturnType<InMemorySessionStorage["getReplayLoss"]>;
|
|
46
|
+
/** 窗口此刻的日志标记(同步读;引擎存储的读法)。 */
|
|
47
|
+
logMarkNow(): SessionLogMark;
|
|
48
|
+
/** 窗口里没有的 id(地板之下)回落到库。 */
|
|
49
|
+
getEntry(id: string): Promise<SessionTreeEntry | undefined>;
|
|
50
|
+
appendEntry(entry: SessionTreeEntry, opts?: SessionWriteOptions): Promise<void>;
|
|
51
|
+
/** 落成的一笔记进窗口,叶子前进到这一笔之后的叶子。 */
|
|
52
|
+
private record;
|
|
53
|
+
/** 叶子移动本身是一条落库的 `leaf` 条目,父 = 当前叶子(引擎存储的同一形:目标不在窗口里 ⇒ `not_found`,id 由引擎的铸法给)。 */
|
|
54
|
+
setLeafId(leafId: string | null, opts?: SessionWriteOptions): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=windowed-session-storage.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InMemorySessionStorage, SessionError, leafIdAfterEntry } from "@sema-agent/core";
|
|
2
|
+
export class WindowedSessionStorage {
|
|
3
|
+
view;
|
|
4
|
+
leaf;
|
|
5
|
+
constructor(metadata, entries, statedLeafId, floorEntryId) {
|
|
6
|
+
this.view = new InMemorySessionStorage({ metadata, entries, floorEntryId });
|
|
7
|
+
if (statedLeafId !== null && !entries.some((e) => e.id === statedLeafId)) {
|
|
8
|
+
throw new SessionError("corrupt_session", `Entry ${statedLeafId} not found — the log's leaf names an entry the log does not hold`);
|
|
9
|
+
}
|
|
10
|
+
this.leaf = statedLeafId;
|
|
11
|
+
}
|
|
12
|
+
getMetadata() {
|
|
13
|
+
return this.view.getMetadata();
|
|
14
|
+
}
|
|
15
|
+
async getLeafId() {
|
|
16
|
+
return this.leaf;
|
|
17
|
+
}
|
|
18
|
+
createEntryId() {
|
|
19
|
+
return this.view.createEntryId();
|
|
20
|
+
}
|
|
21
|
+
findEntries(type) {
|
|
22
|
+
return this.view.findEntries(type);
|
|
23
|
+
}
|
|
24
|
+
getLabel(id) {
|
|
25
|
+
return this.view.getLabel(id);
|
|
26
|
+
}
|
|
27
|
+
getPathToRoot(leafId) {
|
|
28
|
+
return this.view.getPathToRoot(leafId);
|
|
29
|
+
}
|
|
30
|
+
getEntries() {
|
|
31
|
+
return this.view.getEntries();
|
|
32
|
+
}
|
|
33
|
+
getFloorId() {
|
|
34
|
+
return this.view.getFloorId();
|
|
35
|
+
}
|
|
36
|
+
getReplayLoss() {
|
|
37
|
+
return this.view.getReplayLoss();
|
|
38
|
+
}
|
|
39
|
+
logMarkNow() {
|
|
40
|
+
return this.view.logMarkNow();
|
|
41
|
+
}
|
|
42
|
+
async getEntry(id) {
|
|
43
|
+
return (await this.view.getEntry(id)) ?? (await this.readBelowFloor(id));
|
|
44
|
+
}
|
|
45
|
+
async appendEntry(entry, opts) {
|
|
46
|
+
await this.persist(entry, opts);
|
|
47
|
+
await this.record(entry);
|
|
48
|
+
}
|
|
49
|
+
async record(entry) {
|
|
50
|
+
await this.view.appendEntry(entry);
|
|
51
|
+
this.leaf = leafIdAfterEntry(entry);
|
|
52
|
+
}
|
|
53
|
+
async setLeafId(leafId, opts) {
|
|
54
|
+
if (leafId !== null && (await this.view.getEntry(leafId)) === undefined)
|
|
55
|
+
throw new SessionError("not_found", `Entry ${leafId} not found`);
|
|
56
|
+
const leafEntry = { type: "leaf", id: await this.view.createEntryId(), parentId: this.leaf, timestamp: new Date().toISOString(), targetId: leafId };
|
|
57
|
+
await this.persist(leafEntry, opts);
|
|
58
|
+
await this.record(leafEntry);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=windowed-session-storage.js.map
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* {@link import("@sema-agent/core").InMemoryWorkflowJournalStore} (single-replica, lost on crash); this is the
|
|
9
9
|
* byte-match durable twin so a workflow survives a replica crash and RESUMES (replay the longest unchanged
|
|
10
10
|
* PREFIX of recorded `ctx.agent` results, run only the first changed/new call + everything after it live). The
|
|
11
|
-
* journal is LOAD-BEARING (unlike the best-effort {@link import("
|
|
11
|
+
* journal is LOAD-BEARING (unlike the best-effort {@link import("../plugins/run-store-sql.js")} observation layer):
|
|
12
12
|
* append/load failures MUST throw — a silently-dropped entry would silently re-run already-done work.
|
|
13
13
|
*
|
|
14
14
|
* Schema = two tables (DDL in tidb-pool.ts / pg-pool.ts ensureSchema), the SQL normal form of core's per-run
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* `run_id = ? AND scope = ?`.
|
|
37
37
|
* Why the owner record's incarnation is in the row's PRIMARY KEY (one rule: **a row belongs to the owner record that
|
|
38
38
|
* wrote it — readable only through it, overwritable only by a write made through it**): a write can outlive the owner
|
|
39
|
-
* record it was judged against —
|
|
39
|
+
* record it was judged against — the GC sweep racing an append, an append stalled between its two
|
|
40
40
|
* statements. Keyed and joined on run_id alone, (a) a leftover row would be adopted by the next claim of that run_id by
|
|
41
41
|
* ANY scope, and (b) on PostgreSQL READ COMMITTED a stale guarded write whose SELECT still saw the old record would, via
|
|
42
42
|
* the ON CONFLICT arm (which updates a row its snapshot never saw, without re-checking the source), overwrite the NEW
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
import type { Pool as MySqlPool } from "mysql2/promise";
|
|
78
78
|
import type { Pool as PgPool } from "pg";
|
|
79
79
|
import { type WorkflowJournalEntry, type WorkflowJournalStore } from "@sema-agent/core";
|
|
80
|
-
import { type SqlDriver } from "
|
|
80
|
+
import { type SqlDriver } from "../plugins/sql-driver.js";
|
|
81
81
|
/** Dual-dialect durable WorkflowJournalStore. See the file header for the dialect-delta ledger. */
|
|
82
82
|
/** [ref] 租约旋钮。TTL 只是**崩溃兜底**(engine 终态 finally 显式释放;[ref]/[ref] 两层分工:
|
|
83
83
|
* engine 崩了没释放 ⇒ 陈旧 claim 可被接管)。
|
|
@@ -137,11 +137,6 @@ export declare class SqlWorkflowJournalStore implements WorkflowJournalStore {
|
|
|
137
137
|
private oversizeCellOf;
|
|
138
138
|
/** 读面的**唯一**行读法(`loadPage` 的块读与超门行的单条读共用):序数 ≥ `from` 的至多 `limit` 行,字节超 `inlineBytes` 的行 `resultJson` 为 null(只回 `resultBytes`)。 */
|
|
139
139
|
private readRows;
|
|
140
|
-
/** GC — purge ALL journal entries for a run (every incarnation), then its owner row ([ref]). Scoped by run_id alone;
|
|
141
|
-
* idempotent (returns the journal rows removed). Mirrors the resume-anchor store's deleteBySession. An append racing the
|
|
142
|
-
* two DELETEs can leave a row behind without its owner record; it is keyed by the dead incarnation — readable and
|
|
143
|
-
* overwritable by no one (file header) — and the GC sweep removes it by age. */
|
|
144
|
-
deleteByRun(runId: string): Promise<number>;
|
|
145
140
|
/** [ref] / WF2([ref] core 拍板 a 形,签名逐字)—— cross-replica resume admission lease。
|
|
146
141
|
*
|
|
147
142
|
* 语义(bake-store `idem_key UNIQUE` 先例):PK (source_run_id, scope) 上的原子赢或观察。四步,每步
|
|
@@ -165,10 +160,10 @@ export declare class SqlWorkflowJournalStore implements WorkflowJournalStore {
|
|
|
165
160
|
newRunId: string;
|
|
166
161
|
scope: string;
|
|
167
162
|
}): Promise<void>;
|
|
168
|
-
/** GC — time-based sweep: purge journal entries older than `maxAgeMs` (created_at_ms < now - maxAgeMs).
|
|
169
|
-
*
|
|
170
|
-
* — wired into the service reaper
|
|
171
|
-
* bound. A resume of a journal older than the retention window simply re-runs live (resume is an optimization).
|
|
163
|
+
/** GC — time-based sweep: purge journal entries older than `maxAgeMs` (created_at_ms < now - maxAgeMs). This is the
|
|
164
|
+
* journal's ONE delete path (the engine's contract has no per-run delete; its File store's was retired in core 7.61.0,
|
|
165
|
+
* and this store's went with it) — wired into the service reaper, it is what keeps the heaviest table
|
|
166
|
+
* (TaskResult-bearing) from growing without bound. A resume of a journal older than the retention window simply re-runs live (resume is an optimization).
|
|
172
167
|
* Idempotent; returns the journal rows purged.
|
|
173
168
|
*
|
|
174
169
|
* [ref]: the same cutoff then purges owner rows whose OWN clock (`appended_at_ms`, pushed by every append of the
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { callKeyOrdinal } from "@sema-agent/core";
|
|
2
2
|
import { assertJournalEntryFits } from "@sema-agent/core";
|
|
3
|
-
import { journalEntryOfCell, journalRowPayloadOf } from "
|
|
3
|
+
import { journalEntryOfCell, journalRowPayloadOf } from "../plugins/workflow-journal-payload.js";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
|
-
import { mysqlDriver, pgDriver } from "
|
|
6
|
-
import { jsonColumnText, jsonColumnTextExpr } from "
|
|
5
|
+
import { mysqlDriver, pgDriver } from "../plugins/sql-driver.js";
|
|
6
|
+
import { jsonColumnText, jsonColumnTextExpr } from "../plugins/sql-json-column.js";
|
|
7
7
|
const DEFAULT_RESUME_CLAIM_TTL_MS = 60 * 60 * 1000;
|
|
8
8
|
const INT_MIN = -2147483648;
|
|
9
9
|
const INT_MAX = 2147483647;
|
|
@@ -75,11 +75,6 @@ export class SqlWorkflowJournalStore {
|
|
|
75
75
|
const { rows } = await this.db.query(this.q(`SELECT ordinal, call_key, CASE WHEN LENGTH(result) > ? THEN NULL ELSE ${jsonColumnTextExpr("mysql", "result")} END AS result_json, LENGTH(result) AS result_bytes FROM workflow_journal JOIN workflow_journal_owner USING (run_id, incarnation) WHERE run_id = ? AND scope = ? AND ordinal >= ? ORDER BY ordinal ASC LIMIT ?`, `SELECT ordinal, call_key, CASE WHEN OCTET_LENGTH(result) > $3 THEN NULL ELSE ${jsonColumnTextExpr("pg", "result")} END AS result_json, OCTET_LENGTH(result) AS result_bytes FROM workflow_journal JOIN workflow_journal_owner USING (run_id, incarnation) WHERE run_id = $1 AND scope = $2 AND ordinal >= $4 ORDER BY ordinal ASC LIMIT $5`), params);
|
|
76
76
|
return rows.map((r) => ({ ordinal: Number(r.ordinal), callKey: String(r.call_key), resultJson: r.result_json === null ? null : String(r.result_json), resultBytes: Number(r.result_bytes) }));
|
|
77
77
|
}
|
|
78
|
-
async deleteByRun(runId) {
|
|
79
|
-
const res = await this.db.query(this.q("DELETE FROM workflow_journal WHERE run_id = ?", "DELETE FROM workflow_journal WHERE run_id = $1"), [runId]);
|
|
80
|
-
await this.db.query(this.q("DELETE FROM workflow_journal_owner WHERE run_id = ?", "DELETE FROM workflow_journal_owner WHERE run_id = $1"), [runId]);
|
|
81
|
-
return res.affected;
|
|
82
|
-
}
|
|
83
78
|
async resumeClaim(input) {
|
|
84
79
|
const now = Date.now();
|
|
85
80
|
const ins = await this.db.query(this.q("INSERT IGNORE INTO workflow_resume_claim (source_run_id, scope, new_run_id, claimed_at_ms) VALUES (?, ?, ?, ?)", "INSERT INTO workflow_resume_claim (source_run_id, scope, new_run_id, claimed_at_ms) VALUES ($1, $2, $3, $4) ON CONFLICT (source_run_id, scope) DO NOTHING"), [input.sourceRunId, input.scope, input.newRunId, now]);
|
package/dist/task-a2a.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare const A2A_PEER_DISPOSITION: {
|
|
|
57
57
|
readonly toolAxes: "engine";
|
|
58
58
|
};
|
|
59
59
|
/** 请求体 `a2aPeers[i]` 的键闭集 = 处置表的键(书写序即判序)。 */
|
|
60
|
-
export declare const A2A_PEER_ENTRY_KEYS: readonly ("name" | "headers" | "url" | "
|
|
60
|
+
export declare const A2A_PEER_ENTRY_KEYS: readonly ("name" | "headers" | "url" | "cardUrl" | "principalHeader" | "allowSkills" | "toolAxes")[];
|
|
61
61
|
/**
|
|
62
62
|
* **请求入口的一次读**(`boot/resolve-spec.ts` 在腿首铸一份,受理门与读器——续跑重放腿只有读器——都吃这一份):`body.a2aPeers` 若是数组,返回同形数组
|
|
63
63
|
* (每个对象条目换成它的 {@link PeerSnapshot};非对象条目原样;长度保真 —— 界外的条数仍是受理门撞帽拒与读器丢弃留声的依据,只快照界内的条目);不是数组(缺席 / `null` / 别的形)原样返回。
|
|
@@ -80,6 +80,12 @@ export declare function validateRequestA2a(raw: unknown): {
|
|
|
80
80
|
ok: A2aDraft[];
|
|
81
81
|
dropped: A2aInjectionDrop[];
|
|
82
82
|
} | null;
|
|
83
|
+
/**
|
|
84
|
+
* 一份请求的 `a2aPeers` 里,读器挂得上、`headers` 却剔掉了成员的那些坐标(`a2aPeers[<下标>].headers.__proto__`:成员名过回显清洗,只会是读器的保留名,不带值、不带调用方写的对端名)——
|
|
85
|
+
* 「请求成员读不出」那一只判据(`unread-request-members.ts`)的 A2A 一座。读器与挂载同一只({@link normalizeA2aPeer},续跑重放腿的读法;新提交腿上同一形由判官表 400)。
|
|
86
|
+
* 挂不上的对端不算(整条不进,有自己的留声)。`storedToolAxes` = 续跑重放腿递的 M19 重读座。不是数组 ⇒ 空。
|
|
87
|
+
*/
|
|
88
|
+
export declare function requestA2aHeadersUnread(raw: unknown, storedToolAxes?: StoredToolAxesRereadM19): string[];
|
|
83
89
|
/**
|
|
84
90
|
* 请求体 `a2aPeers`「这份声明能不能原样用」的回答者(与 MCP 的 `requestMcpDeclarationRefusal` 同一副骨架、同一个拒形):
|
|
85
91
|
* ① **列表**:在场却不是数组 / 超过 {@link MAX_REQUEST_A2A_PEERS} 条(撞帽机读位一组键)/ 某一条不是对象 ⇒ `400 request.field_invalid`;
|
package/dist/task-a2a.js
CHANGED
|
@@ -244,21 +244,18 @@ export function validateRequestA2a(raw) {
|
|
|
244
244
|
}
|
|
245
245
|
function validateRequestA2aEntries(raw, leg, storedToolAxes) {
|
|
246
246
|
if (raw === undefined || raw === null)
|
|
247
|
-
return { ok: [], dropped: [], toolAxesReread: []
|
|
247
|
+
return { ok: [], dropped: [], toolAxesReread: [] };
|
|
248
248
|
if (!Array.isArray(raw))
|
|
249
249
|
return null;
|
|
250
250
|
const ok = [];
|
|
251
251
|
const dropped = [];
|
|
252
252
|
const toolAxesReread = [];
|
|
253
|
-
const headersLost = [];
|
|
254
253
|
for (const [i, e] of raw.slice(0, MAX_REQUEST_A2A_PEERS).entries()) {
|
|
255
254
|
const read = normalizeA2aPeer(e, leg, `${A2A_SEAT.list}[${i}]`, storedToolAxes);
|
|
256
255
|
if (read.draft !== null) {
|
|
257
256
|
ok.push(read.draft);
|
|
258
257
|
if (read.toolAxesReread !== undefined)
|
|
259
258
|
toolAxesReread.push({ peer: read.draft.spec.name, sentence: read.toolAxesReread });
|
|
260
|
-
if (read.headersLost !== undefined)
|
|
261
|
-
headersLost.push({ peer: read.draft.spec.name, lost: read.headersLost });
|
|
262
259
|
}
|
|
263
260
|
else
|
|
264
261
|
dropped.push({ peer: declaredName(e).slice(0, 128), ...read.because });
|
|
@@ -266,7 +263,20 @@ function validateRequestA2aEntries(raw, leg, storedToolAxes) {
|
|
|
266
263
|
if (raw.length > MAX_REQUEST_A2A_PEERS) {
|
|
267
264
|
dropped.push({ peer: `(+${raw.length - MAX_REQUEST_A2A_PEERS} over cap of ${MAX_REQUEST_A2A_PEERS})`, ...declarationOverCapFacts(A2A_SEAT, raw.length) });
|
|
268
265
|
}
|
|
269
|
-
return { ok, dropped, toolAxesReread
|
|
266
|
+
return { ok, dropped, toolAxesReread };
|
|
267
|
+
}
|
|
268
|
+
export function requestA2aHeadersUnread(raw, storedToolAxes) {
|
|
269
|
+
if (!Array.isArray(raw))
|
|
270
|
+
return [];
|
|
271
|
+
const out = [];
|
|
272
|
+
for (const [i, e] of raw.slice(0, MAX_REQUEST_A2A_PEERS).entries()) {
|
|
273
|
+
const at = `${A2A_SEAT.list}[${i}]`;
|
|
274
|
+
const read = normalizeA2aPeer(e, "resume", at, storedToolAxes);
|
|
275
|
+
if (read.draft !== null)
|
|
276
|
+
for (const member of read.headersLost ?? [])
|
|
277
|
+
out.push(`${at}.${member}`);
|
|
278
|
+
}
|
|
279
|
+
return out;
|
|
270
280
|
}
|
|
271
281
|
function requestA2aPeerRefusal(entry, at) {
|
|
272
282
|
const snapshot = snapshotPeer(entry, false);
|
|
@@ -323,15 +333,6 @@ export function resolveRequestA2a(baseline, bodyA2a, config, desk, lease, logger
|
|
|
323
333
|
note: "this replayed request was stored before the upgrade and the peer's toolAxes declaration does not pass the engine's reader; while one-time migration M19 is open it is read the way the pre-upgrade reader reads it (members that do not fit are dropped) and the peer stays mounted — once the window closes the same request leaves this peer unmounted",
|
|
324
334
|
});
|
|
325
335
|
}
|
|
326
|
-
for (const h of v.headersLost) {
|
|
327
|
-
if (baselineNames.has(h.peer))
|
|
328
|
-
continue;
|
|
329
|
-
logger?.warn("a2a_peer_headers_members_dropped", {
|
|
330
|
-
peer: h.peer,
|
|
331
|
-
lost: h.lost,
|
|
332
|
-
note: "this replayed request carries a headers member named \"__proto__\" for this peer (the engine refuses that name); the peer stays mounted with every other header as written, the named member left out. A new submission with the same peer leaves it unmounted",
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
336
|
return merged;
|
|
336
337
|
}
|
|
337
338
|
//# sourceMappingURL=task-a2a.js.map
|
package/dist/task-cwd.d.ts
CHANGED
|
@@ -32,9 +32,9 @@ export declare function dirCoversPath(dir: string, target: string): boolean;
|
|
|
32
32
|
* 刻意的单写者惯用法,不是疏漏:在消费端补第二道闸 = 把一条不变量拆给两个属主(同族消费者
|
|
33
33
|
* {@link effectiveHostWorkspace} 形状完全相同)。机器背书 = test/task-cwd.test.ts 的 [ref] 两格。
|
|
34
34
|
* 2. 🔴 **前瞻/防御臂,本仓当前装配下零命中**([ref],2026-08-19 合并重扫 partial,存活断言):
|
|
35
|
-
*
|
|
36
|
-
* 服务一个真部署形,其实到不了 —— 该 lane
|
|
37
|
-
*
|
|
35
|
+
* 无手(`none`)单用户 lane(部署形表行 `noHandsSingleUser`)取引擎自身 `process.cwd()`。它读起来像在
|
|
36
|
+
* 服务一个真部署形,其实到不了 —— 该 lane 声明没有执行环境 ⇒ boot/execution-env.ts 的工厂臂全
|
|
37
|
+
* 不命中、执行环境座也不给 ⇒ `handsEnabled=false` ⇒ 不挂 Bash ⇒ 未知工具在 agent-loop 走
|
|
38
38
|
* `tool.not_found`(**不进审批座**)⇒ 无 `ruleOffers` ⇒ 本函数在规则车道上根本不被调用;同 lane
|
|
39
39
|
* 第 1 臂也因写侧闸只在 `callerCwd` 下开而恒空。危害口径按 refuter **降级**:死枝 ≡ 落第 3 臂
|
|
40
40
|
* `undefined` ≡ core global 缺省 ≡ [ref] 修前行为,**今天零用户可见伤害**,不是「恒不命中」类缺陷。
|
|
@@ -102,4 +102,12 @@ export declare function effectiveHostWorkspace(sessionCwd: string | undefined, c
|
|
|
102
102
|
isolation?: string;
|
|
103
103
|
parentCwd?: string;
|
|
104
104
|
}): string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* run 外回退口问「host 工厂这一次会落在一只**实在的**目录上吗」:根 = {@link effectiveHostWorkspace}(引擎 run 外环境请求的上下文归约成 `{}` ⇒ 就是登记的 cwd),
|
|
107
|
+
* 且它此刻是盘上的一只目录 ⇒ 交回它;没有根,或那只目录**不在**(`ENOENT` / `ENOTDIR`,或在但不是目录)⇒ `undefined`(调用方答 409:根不可知)。
|
|
108
|
+
* 「看不到」不是「不在」:其余 errno(`EACCES` / `ELOOP` / `EIO`)原样抛 —— 路由未分类 500 + 运维 warn,与 `memory-store-refusal.ts` 的解析故障同读法;
|
|
109
|
+
* 把它读成 409 会把一只权限 / 环路故障遮成「用户把目录移走了」。三态读法同 `project-identity.ts` 的 statFact。
|
|
110
|
+
* 只读不建:工厂对一只消失的 cwd 会 `mkdir -p` 把它建回来(那是 run 的读法),回退不许替用户把移走的目录建回来再往里写。
|
|
111
|
+
*/
|
|
112
|
+
export declare function presentHostWorkspaceOf(sessionCwd: string | undefined): Promise<string | undefined>;
|
|
105
113
|
//# sourceMappingURL=task-cwd.d.ts.map
|
package/dist/task-cwd.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { stat } from "node:fs/promises";
|
|
3
|
+
import { errorCodeOf } from "./observability/err-text.js";
|
|
2
4
|
import { isAbsoluteHostPath } from "@sema-agent/settings-schema";
|
|
3
5
|
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
4
6
|
export function normalizeAbsolutePathLexically(p) {
|
|
@@ -11,7 +13,7 @@ export function dirCoversPath(dir, target) {
|
|
|
11
13
|
return p === root || p.startsWith(root.endsWith("/") ? root : `${root}/`);
|
|
12
14
|
}
|
|
13
15
|
export function cardRuleScopeRoot(registeredCwd, config, cwd = process.cwd) {
|
|
14
|
-
const raw = registeredCwd ?? (DEPLOYMENT_SHAPE_PREDICATES.
|
|
16
|
+
const raw = registeredCwd ?? (DEPLOYMENT_SHAPE_PREDICATES.noHandsSingleUser.holds(config) ? cwd() : undefined);
|
|
15
17
|
return raw === undefined ? undefined : path.resolve(raw);
|
|
16
18
|
}
|
|
17
19
|
export function satisfiedByProcessCwd(requested, realpath, cwd = process.cwd) {
|
|
@@ -44,4 +46,18 @@ export function parseAdditionalDirectories(raw) {
|
|
|
44
46
|
export function effectiveHostWorkspace(sessionCwd, ctx) {
|
|
45
47
|
return sessionCwd ?? (ctx.isolation !== "worktree" ? ctx.parentCwd : undefined);
|
|
46
48
|
}
|
|
49
|
+
export async function presentHostWorkspaceOf(sessionCwd) {
|
|
50
|
+
const root = effectiveHostWorkspace(sessionCwd, {});
|
|
51
|
+
if (root === undefined)
|
|
52
|
+
return undefined;
|
|
53
|
+
try {
|
|
54
|
+
return (await stat(root)).isDirectory() ? root : undefined;
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
const code = errorCodeOf(err);
|
|
58
|
+
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
59
|
+
throw err;
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
47
63
|
//# sourceMappingURL=task-cwd.js.map
|
package/dist/task-mcp.d.ts
CHANGED
|
@@ -121,6 +121,14 @@ type ValidatedRequestMcp = {
|
|
|
121
121
|
value: string;
|
|
122
122
|
}>;
|
|
123
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* 一份请求的 `mcpServers` 里,读器挂得上、transport 却有几处不交给引擎的那些坐标(`mcpServers[<下标>].transport.headers` / `….env.__proto__` 一类:只有键路径,
|
|
126
|
+
* 成员名只会是读器的保留名,不带值、不带调用方写的 server 名)—— 「请求成员读不出」那一只判据(`unread-request-members.ts`)的 MCP 一座。
|
|
127
|
+
* 读器与挂载同一只({@link normalizeServer},契约包 `readRequestMcpTransport` 报的 `lost`);挂不上的条目(硬坏形)不算 —— 它们整条不挂、有自己的通告;
|
|
128
|
+
* 名字在 `closed`(部署占住的名字,{@link deploymentClosedMcpNames})里的条目也不算 —— 合并时输给部署(`name_reserved_by_deployment`),它的 transport 一处都不会交给引擎。
|
|
129
|
+
* `storedToolAxes` = 续跑重放腿递的 M19 重读座(同一只条目在挂载时也经它判挂不挂得上)。不是数组 ⇒ 空(整只忽略那一臂,不是本判据的事)。
|
|
130
|
+
*/
|
|
131
|
+
export declare function requestMcpTransportUnread(raw: unknown, closed: ReadonlySet<string>, storedToolAxes?: StoredToolAxesRereadM19): string[];
|
|
124
132
|
/**
|
|
125
133
|
* [ref] 件C §4.3 —— **同步**拒面:部署锁了 `mcp` 而请求仍带 `mcpServers` ⇒ 400 `config.locked_key`。
|
|
126
134
|
*
|
|
@@ -181,8 +189,8 @@ export declare function requestMcpDeclarationRefusal(list: unknown): Declaration
|
|
|
181
189
|
* 重放腿走读器({@link normalizeServer} / {@link classifyRequestMcp}),处置:整只不是数组 ⇒ 整只忽略 + 运维 warn `mcp_injection_ignored`;条目不是对象 / 坏硬键
|
|
182
190
|
* (`name` / `transport` 硬字段 / `allowTools` / `toolAxes` / `toolFaces`)⇒ 这一条 server 整条不进 + 运维 warn `mcp_injection_dropped` + 用户面通告 `mcp.injection_dropped` 点名 `field`
|
|
183
191
|
* (`toolAxes` 在一次性迁移 M19 的窗开着时先按升级前读法重读一次,过了就挂,见读器的注);超上限的尾项 ⇒ `over_cap` 点名;坏软键(`contentOrigin` / `elicitation` / `source`)
|
|
184
|
-
* 与词表外的键 ⇒ 丢键、server 照挂(`contentOrigin` 另有 `mcp_content_class_dropped` 留声);`transport`
|
|
185
|
-
*
|
|
192
|
+
* 与词表外的键 ⇒ 丢键、server 照挂(`contentOrigin` 另有 `mcp_content_class_dropped` 留声);`transport` 软字段有几处读器不交(`env` / `headers` 不是纯数据的串记录、其中名叫 `__proto__` 的成员、
|
|
193
|
+
* `args` / `principalHeader` 坏形)⇒ 这份请求不重放(「请求成员读不出」那一只判据,`unread-request-members.ts`,经 {@link requestMcpTransportUnread} 读这一座;续跑腿折 409)。
|
|
186
194
|
*/
|
|
187
195
|
export declare function assertRequestMcpEntries(bodyMcp: unknown): void;
|
|
188
196
|
/** 一次发送从一份声明里带出的头:件头(调用方原样写的名 → 值,由对端座按原字节作答)与身份头名(引擎按主体写值)。 */
|
package/dist/task-mcp.js
CHANGED
|
@@ -93,22 +93,31 @@ function validateRequestMcpEntries(raw, storedToolAxes) {
|
|
|
93
93
|
const dropped = [];
|
|
94
94
|
const badContentOrigin = [];
|
|
95
95
|
const toolAxesReread = [];
|
|
96
|
-
const transportLost = [];
|
|
97
96
|
for (const e of raw.slice(0, MAX_REQUEST_MCP_SERVERS)) {
|
|
98
97
|
const v = normalizeServer(e, (server, value) => badContentOrigin.push({ server, value: describeBadContentOrigin(value) }), storedToolAxes);
|
|
99
98
|
if (v.ok) {
|
|
100
99
|
ok.push(v.spec);
|
|
101
100
|
if (v.toolAxesReread !== undefined)
|
|
102
101
|
toolAxesReread.push({ server: v.spec.name, sentence: v.toolAxesReread });
|
|
103
|
-
if (v.transportLost.length > 0)
|
|
104
|
-
transportLost.push({ server: v.spec.name, lost: v.transportLost.map((i) => i.path) });
|
|
105
102
|
}
|
|
106
103
|
else
|
|
107
104
|
dropped.push({ server: declaredName(e), reason: "malformed_entry", field: v.field });
|
|
108
105
|
}
|
|
109
106
|
for (const e of raw.slice(MAX_REQUEST_MCP_SERVERS, MAX_REQUEST_MCP_SERVERS + MAX_REQUEST_MCP_DROP_NAMES))
|
|
110
107
|
dropped.push({ server: declaredName(e), reason: "over_cap" });
|
|
111
|
-
return { ok, dropped, droppedTotal: Math.max(0, raw.length - ok.length), badContentOrigin, toolAxesReread
|
|
108
|
+
return { ok, dropped, droppedTotal: Math.max(0, raw.length - ok.length), badContentOrigin, toolAxesReread };
|
|
109
|
+
}
|
|
110
|
+
export function requestMcpTransportUnread(raw, closed, storedToolAxes) {
|
|
111
|
+
if (!Array.isArray(raw))
|
|
112
|
+
return [];
|
|
113
|
+
const out = [];
|
|
114
|
+
for (const [i, e] of raw.slice(0, MAX_REQUEST_MCP_SERVERS).entries()) {
|
|
115
|
+
const v = normalizeServer(e, () => undefined, storedToolAxes);
|
|
116
|
+
if (v.ok && !closed.has(v.spec.name))
|
|
117
|
+
for (const issue of v.transportLost)
|
|
118
|
+
out.push(`mcpServers[${i}].${issue.path}`);
|
|
119
|
+
}
|
|
120
|
+
return out;
|
|
112
121
|
}
|
|
113
122
|
export function assertRequestMcpUnlocked(bodyMcp, lockedKeys) {
|
|
114
123
|
if (!lockedKeys.has("mcp"))
|
|
@@ -324,18 +333,6 @@ function classifyHonored(baseline, entries, config, desk, lease, logger, storedT
|
|
|
324
333
|
note: "this replayed request was stored before the upgrade and its toolAxes declaration does not pass the engine's reader; while one-time migration M19 is open it is read the way the pre-upgrade server read it (members that did not fit are dropped, a declaration that is not an object counts as none) and the server stays mounted — once the window closes the same request leaves this server unmounted",
|
|
325
334
|
});
|
|
326
335
|
}
|
|
327
|
-
for (const t of v.transportLost) {
|
|
328
|
-
if (!mounted.has(t.server))
|
|
329
|
-
continue;
|
|
330
|
-
logger?.warn("mcp_transport_members_dropped", {
|
|
331
|
-
server: t.server,
|
|
332
|
-
lost: t.lost.slice(0, MAX_KEY_ECHO),
|
|
333
|
-
...(t.lost.length > MAX_KEY_ECHO ? { lostTotal: t.lost.length } : {}),
|
|
334
|
-
note: "this replayed request carries parts of this server's transport declaration that cannot be handed to the engine — an env / headers record that is not a plain object of string values (left out whole, as the pre-upgrade server read it), " +
|
|
335
|
-
"a member named \"__proto__\" in env / headers (only that member is left out: the engine refuses the name), args that are not a list of strings, a principalHeader that is not a string; " +
|
|
336
|
-
"the server mounts with the rest. A new submission with the same entry is refused (400)",
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
336
|
return {
|
|
340
337
|
mcp: mergeRequestMcp(baseline, v.ok.map(toMcpDraft), reservedNames, desk, lease),
|
|
341
338
|
drops: [...v.dropped, ...blocked.map((server) => ({ server, reason: "name_reserved_by_deployment" }))],
|