@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
|
@@ -156,6 +156,16 @@ export const SELF_MINTED_WIRE = {
|
|
|
156
156
|
http: { attr: "-", since: "7.141.0" },
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
|
+
settingsContractHookEntryType: {
|
|
160
|
+
at: "GET /v1/capabilities settingsContract.hookEntryFields",
|
|
161
|
+
members: {
|
|
162
|
+
command: { attr: "-", since: "7.147.0" },
|
|
163
|
+
prompt: { attr: "-", since: "7.147.0" },
|
|
164
|
+
agent: { attr: "-", since: "7.147.0" },
|
|
165
|
+
http: { attr: "-", since: "7.147.0" },
|
|
166
|
+
mcp_tool: { attr: "-", since: "7.147.0" },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
159
169
|
credentialPlaneSandboxGitState: {
|
|
160
170
|
at: "GET /v1/capabilities credentialPlane.sandboxGit.state",
|
|
161
171
|
members: {
|
|
@@ -191,6 +201,15 @@ export const SELF_MINTED_WIRE = {
|
|
|
191
201
|
direct_door_jwt: { attr: "-", since: "7.121.0" },
|
|
192
202
|
},
|
|
193
203
|
},
|
|
204
|
+
healthAuthKey: {
|
|
205
|
+
at: "GET /health auth",
|
|
206
|
+
members: {
|
|
207
|
+
required: { attr: "always", since: "7.121.0" },
|
|
208
|
+
kinds: { attr: "always", since: "7.121.0" },
|
|
209
|
+
identityAttach: { attr: "always", since: "7.121.0" },
|
|
210
|
+
serviceTokenActsForDeployment: { attr: "always (boolean: service credential configured ∧ SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT)", since: "7.146.0" },
|
|
211
|
+
},
|
|
212
|
+
},
|
|
194
213
|
healthIdentityAttach: {
|
|
195
214
|
at: "GET /health auth.identityAttach",
|
|
196
215
|
members: {
|
|
@@ -234,17 +253,88 @@ export const SELF_MINTED_WIRE = {
|
|
|
234
253
|
deploymentPackages: { attr: "present-iff deployment mod packages loaded at boot", since: "7.138.0" },
|
|
235
254
|
},
|
|
236
255
|
},
|
|
256
|
+
healthInflightBreakdownKey: {
|
|
257
|
+
at: "GET /health inflightBreakdown",
|
|
258
|
+
members: {
|
|
259
|
+
http: { attr: "always within inflightBreakdown", since: "7.146.0" },
|
|
260
|
+
leader: { attr: "always within inflightBreakdown", since: "7.146.0" },
|
|
261
|
+
backgroundAgents: { attr: "always within inflightBreakdown", since: "7.147.0" },
|
|
262
|
+
sessionResident: { attr: "always within inflightBreakdown", since: "7.146.0" },
|
|
263
|
+
},
|
|
264
|
+
},
|
|
237
265
|
healthEngineLeaseKey: {
|
|
238
266
|
at: "GET /health engineLease",
|
|
239
267
|
members: {
|
|
240
268
|
lingerMs: { attr: "present-iff engine lease leg armed and observing", since: "7.141.0" },
|
|
241
269
|
tickMs: { attr: "present-iff engine lease leg armed and observing", since: "7.141.0" },
|
|
270
|
+
firstAttach: { attr: "present-iff engineLease present and the owned window is finite", since: "7.146.0" },
|
|
271
|
+
lane: { attr: "always within engineLease", since: "7.146.0" },
|
|
272
|
+
handover: { attr: "present-iff lane is handover", since: "7.146.0" },
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
healthEngineLeaseFirstAttachKey: {
|
|
276
|
+
at: "GET /health engineLease.firstAttach",
|
|
277
|
+
members: {
|
|
278
|
+
windowMs: { attr: "always within firstAttach", since: "7.146.0" },
|
|
279
|
+
since: { attr: "always within firstAttach (epoch ms)", since: "7.146.0" },
|
|
280
|
+
attachedAt: { attr: "epoch ms, null until the first non-probe request", since: "7.146.0" },
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
healthEngineLeaseHandoverKey: {
|
|
284
|
+
at: "GET /health engineLease.handover",
|
|
285
|
+
members: {
|
|
286
|
+
since: { attr: "always within handover (epoch ms)", since: "7.146.0" },
|
|
287
|
+
reason: { attr: "always within handover", since: "7.146.0" },
|
|
288
|
+
lingerMs: { attr: "always within handover", since: "7.146.0" },
|
|
289
|
+
backgroundShells: { attr: "always within handover (running shell rows the exit boundary would hard-kill now)", since: "7.146.0" },
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
engineLane: {
|
|
293
|
+
at: "engine lease lane(/health engineLease.lane · POST /v1/engine/handover|attach lane · exit-last.json lane)",
|
|
294
|
+
members: {
|
|
295
|
+
handover: { attr: "-", since: "7.146.0" },
|
|
296
|
+
orphan: { attr: "-", since: "7.146.0" },
|
|
297
|
+
awaitingFirstAttach: { attr: "-", since: "7.146.0" },
|
|
298
|
+
owned: { attr: "-", since: "7.146.0" },
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
engineHandoverReason: {
|
|
302
|
+
at: "POST /v1/engine/handover reason · /health engineLease.handover.reason",
|
|
303
|
+
members: {
|
|
304
|
+
background_exit: { attr: "-", since: "7.146.0" },
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
engineHandoverReplyKey: {
|
|
308
|
+
at: "POST /v1/engine/handover 200 体键(<键> → 在场律)",
|
|
309
|
+
members: {
|
|
310
|
+
lane: { attr: "always (handover)", since: "7.146.0" },
|
|
311
|
+
since: { attr: "always (epoch ms; the same value on a repeated handover)", since: "7.146.0" },
|
|
312
|
+
lingerMs: { attr: "always", since: "7.146.0" },
|
|
313
|
+
backgroundShells: { attr: "always", since: "7.146.0" },
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
engineAttachReplyKey: {
|
|
317
|
+
at: "POST /v1/engine/attach 200 体键(<键> → 在场律)",
|
|
318
|
+
members: {
|
|
319
|
+
lane: { attr: "always", since: "7.146.0" },
|
|
320
|
+
handedOverForMs: { attr: "present-iff this attach cleared a handover", since: "7.146.0" },
|
|
242
321
|
},
|
|
243
322
|
},
|
|
244
323
|
modelsRowKey: {
|
|
245
324
|
at: "GET /v1/models models[] 行键(<键> → 在场律)",
|
|
246
325
|
members: {
|
|
247
326
|
supportsThinkingOff: { attr: "always", since: "7.138.0" },
|
|
327
|
+
thinkingLevelMap: { attr: "present-iff declared", since: "7.147.0" },
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
modelsRowAnthropicCompatKey: {
|
|
331
|
+
at: "GET /v1/models models[].compat 键(anthropic-messages 行;<键> → 在场律)",
|
|
332
|
+
members: {
|
|
333
|
+
thinkingMode: { attr: "present-iff declared", since: "7.147.0" },
|
|
334
|
+
effortLevels: { attr: "present-iff declared non-empty", since: "7.147.0" },
|
|
335
|
+
supportsTemperature: { attr: "present-iff declared", since: "7.147.0" },
|
|
336
|
+
contextManagement: { attr: "present-iff declared", since: "7.147.0" },
|
|
337
|
+
interleavedThinking: { attr: "present-iff declared", since: "7.147.0" },
|
|
248
338
|
},
|
|
249
339
|
},
|
|
250
340
|
sessionBackgroundRowKey: {
|
|
@@ -260,12 +350,55 @@ export const SELF_MINTED_WIRE = {
|
|
|
260
350
|
unreadable: { attr: "present-iff the session head's leaf cannot be read (the file backend: the archive header is corrupt / truncated, or the archive cannot be read); the SQL backends never carry it; PATCH answers 500 for such a session before writing, so its 200 / 409 rows never carry it", since: "7.142.0" },
|
|
261
351
|
},
|
|
262
352
|
},
|
|
353
|
+
projectRowKey: {
|
|
354
|
+
at: "GET /v1/projects projects[] 行键 = GET /v1/projects/:id 200 体(<键> → 在场律)",
|
|
355
|
+
members: {
|
|
356
|
+
id: { attr: "always", since: "7.147.0" },
|
|
357
|
+
displayName: { attr: "always", since: "7.147.0" },
|
|
358
|
+
goal: { attr: "present-iff registered", since: "7.147.0" },
|
|
359
|
+
contextItems: { attr: "present-iff registered", since: "7.147.0" },
|
|
360
|
+
gitRemotes: { attr: "always", since: "7.147.0" },
|
|
361
|
+
defaultScopes: { attr: "always", since: "7.147.0" },
|
|
362
|
+
notes: { attr: "present-iff registered", since: "7.147.0" },
|
|
363
|
+
icon: { attr: "present-iff registered", since: "7.147.0" },
|
|
364
|
+
color: { attr: "present-iff registered", since: "7.147.0" },
|
|
365
|
+
registeredBy: { attr: "always", since: "7.147.0" },
|
|
366
|
+
registeredAt: { attr: "always", since: "7.147.0" },
|
|
367
|
+
archivedAt: { attr: "present-iff archived", since: "7.147.0" },
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
projectsListBodyKey: {
|
|
371
|
+
at: "GET /v1/projects 200 体顶层键(<键> → 在场律)",
|
|
372
|
+
members: {
|
|
373
|
+
projects: { attr: "always", since: "7.147.0" },
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
sessionViewKey: {
|
|
377
|
+
at: "GET /v1/sessions/:id 体顶层键(本版新出现;<键> → 在场律)",
|
|
378
|
+
members: {
|
|
379
|
+
projectId: { attr: "present-iff the session row's last own workspace_changed frame carried a project", since: "7.147.0" },
|
|
380
|
+
},
|
|
381
|
+
},
|
|
263
382
|
sessionsListRowUnreadableKey: {
|
|
264
383
|
at: "GET /v1/sessions sessions[].unreadable 键(<键> → 在场律)",
|
|
265
384
|
members: {
|
|
266
385
|
errorCode: { attr: "always; the errorCode GET /v1/sessions/:id answers for the same session (corrupt_session | internal.error today)", since: "7.142.0" },
|
|
267
386
|
},
|
|
268
387
|
},
|
|
388
|
+
inboxPayloadTruncatedFrame: {
|
|
389
|
+
at: "停驻补投帧(下一次开流 drain)键(<帧>#<键> → 在场律)",
|
|
390
|
+
members: {
|
|
391
|
+
"task_notification#payloadTruncated": { attr: "present-iff the parked entry's payload exceeded the inbox byte budget (minimal form)", since: "7.147.0" },
|
|
392
|
+
"workflow_complete#payloadTruncated": { attr: "present-iff the parked entry's payload exceeded the inbox byte budget (minimal form)", since: "7.147.0" },
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
inboxPayloadTruncatedKey: {
|
|
396
|
+
at: "停驻补投帧 payloadTruncated 的键",
|
|
397
|
+
members: {
|
|
398
|
+
droppedKeys: { attr: "always", since: "7.147.0" },
|
|
399
|
+
bytes: { attr: "always", since: "7.147.0" },
|
|
400
|
+
},
|
|
401
|
+
},
|
|
269
402
|
toolEndGateDispositionKey: {
|
|
270
403
|
at: "tool_end gate.disposition 键(<臂>#<键> → 在场律)",
|
|
271
404
|
members: {
|
|
@@ -353,13 +486,25 @@ export const SELF_MINTED_WIRE = {
|
|
|
353
486
|
not_object: { attr: "-", since: "7.133.0" },
|
|
354
487
|
},
|
|
355
488
|
},
|
|
489
|
+
rateExceededReason: {
|
|
490
|
+
at: "429 limit.rate_exceeded reason(在飞 run 并发帽;其余产地不带 reason)",
|
|
491
|
+
members: {
|
|
492
|
+
run_concurrency_cap: { attr: "-", since: "7.146.0" },
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
settingsEnvCredentialMatch: {
|
|
496
|
+
at: "400 request.env_credential_refused entries[].match(settings.env 里被判成凭据的条目;续跑口 409 resume_blocked_by_policy 同一组机读位)",
|
|
497
|
+
members: {
|
|
498
|
+
name: { attr: "-", since: "7.146.0" },
|
|
499
|
+
value_shape: { attr: "-", since: "7.146.0" },
|
|
500
|
+
},
|
|
501
|
+
},
|
|
356
502
|
inheritEnvRefusalReason: {
|
|
357
|
-
at: "400 request.field_invalid reason(inheritEnv 的值形 /
|
|
503
|
+
at: "400 request.field_invalid reason(inheritEnv 的值形 / 车道两类拒;另带 field: \"inheritEnv\")",
|
|
358
504
|
members: {
|
|
359
505
|
unknown_word: { attr: "-", since: "7.137.0" },
|
|
360
506
|
not_a_string: { attr: "-", since: "7.137.0" },
|
|
361
507
|
lane_not_host: { attr: "-", since: "7.137.0" },
|
|
362
|
-
no_authorizer_session: { attr: "-", since: "7.137.0" },
|
|
363
508
|
},
|
|
364
509
|
},
|
|
365
510
|
projectBundleInvalidReason: {
|
|
@@ -607,6 +752,7 @@ export const SELF_MINTED_WIRE = {
|
|
|
607
752
|
"POST /v1/sessions/:id/fork#stamped_archive(DB_BACKEND=local;源存档仍带更早版本写下的属主戳;零写;体 conflict.session_archive_stamped + 带戳存档的固定句)": { attr: 409, since: "7.144.0" },
|
|
608
753
|
"POST /v1/sessions/:id/sync/import/:stagingId/entries#stamped_archive(DB_BACKEND=local;提交落在仍带属主戳的存档上,改日志的各形推送同答;行净零写;体 conflict.session_archive_stamped + 带戳存档的固定句)": { attr: 409, since: "7.144.0" },
|
|
609
754
|
"POST /v1/sessions/:id/sync/import#stamped_archive(DB_BACKEND=local;第一阶段按 id 分类出 fork / stale 且没带同意,目的端存档仍带属主戳;不开暂存、不拿租约、不写存档;体 conflict.session_archive_stamped + 带戳存档的固定句,不带 relation)": { attr: 409, since: "7.145.0" },
|
|
755
|
+
"POST /v1/sessions/:id/sync/plan#stamped_archive(DB_BACKEND=local;干跑按 id 分类出 fork / stale,目的端存档仍带属主戳;此刻读,不开暂存、不拿租约、不写存档;体 conflict.session_archive_stamped + 带戳存档的固定句,不带 relation)": { attr: 409, since: "7.147.0" },
|
|
610
756
|
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#images_url_credential(新提交;体 request.field_invalid + field images[i].url + reason url_userinfo|url_credential_param)": { attr: 400, since: "7.136.0" },
|
|
611
757
|
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#a2aPeers_malformed(新提交;列表不是数组 / 条目不是对象 / 键值判不出形;体 request.field_invalid)": { attr: 400, since: "7.136.0" },
|
|
612
758
|
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#a2aPeers_unknown_key(新提交;词表外的键;体 request.body_shape + unknownKeys)": { attr: 400, since: "7.136.0" },
|
|
@@ -664,7 +810,18 @@ export const SELF_MINTED_WIRE = {
|
|
|
664
810
|
"GET /v1/capabilities/mcp#engine_name_collision(中心声明两台归一后同挂一个工具命名空间前缀,引擎在任何传输被触碰之前整集拒;体 config.mcp_server_name_collision + 引擎原句;与同步提交腿同一张码 → 状态表)": { attr: 409, since: "7.143.0" },
|
|
665
811
|
"POST /v1/tasks#engine_name_collision(同步腿;同一份声明集被引擎整集拒;零工作的拒;体 config.mcp_server_name_collision)": { attr: 409, since: "7.143.0" },
|
|
666
812
|
"POST /v1/rules/local-import/prepare#tightening_write_failed(一条收下的 deny / ask 写不进店;这一批的放行扣下、没有票;体 state.rule_write_failed + committed,同 POST /v1/rules)": { attr: 503, since: "7.143.0" },
|
|
667
|
-
"POST /v1/rules/cc-import/
|
|
813
|
+
"POST /v1/rules/cc-import/prepare|POST /v1/rules/local-import/prepare#record_store_refused(审批记录店建这次导入的记录失败,引擎答店拒臂;没有票、没有放行落店 —— local-import 这一批收下的 deny / ask 可能已当场落店;体 state.rule_write_failed + committed;重发同一请求即重铸)": { attr: 503, since: "7.147.0" },
|
|
814
|
+
"POST /v1/rules/cc-import/redeem#member_refused(兑付走完、引擎的完整成员表里有被拒的成员;体 = 回执 { members, rev },那几行 outcome refused(引擎答 committed no;7.145.0 为 indeterminate + store_refused)+ reason = 引擎拒因码(RuleRefusalCode)+ detail 引擎原话;票用掉,同票再兑 404)": { attr: 200, since: "7.145.0" },
|
|
815
|
+
"POST /v1/rules/cc-import/redeem|POST /v1/rules/local-import/redeem#member_outcome_unknown(兑付走完、引擎的完整成员表里有一员答 committed unknown:写抛 / 读回读不出 / 记 dot 的 CAS 或 dot 分配失败;不落定,认领放回;体 state.rule_import_retry + retryAfterSec;同票重来即重走)": { attr: 503, since: "7.146.0" },
|
|
816
|
+
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#settings.env 带凭据条目(名字是本引擎的凭据变量 / 值是秘密形;新提交;体 request.env_credential_refused + field settings.env + entries[{ key, match }],值不回显)": { attr: 400, since: "7.146.0" },
|
|
817
|
+
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#sessionId 是本进程删过的会话 id、根会话行上的住客不是删前属主(新提交;授权口登记之后、执行上下文解析器步 ①;体 conflict.session_id_retired,不回显 id / 属主)": { attr: 409, since: "7.146.0" },
|
|
818
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#根会话 id 是本进程删过的会话 id、行上的住客不是删前属主(续跑家族 / 停驻赎回 / 工作流决断后的宿主新轮;认领之前,卡仍待决;体 resume_blocked_by_policy + blockedBy conflict.session_id_retired + retriable)": { attr: 409, since: "7.146.0" },
|
|
819
|
+
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#scenario_assignment_unavailable(新提交;部署接了配置中心、请求带主体,而中心答不出这位主体的场景裁定:不可达 / 超时 / 答复读不出 / 指派两键形不对或只发一键;点名与不点名同拒;零 run;体 state.scenario_assignment_unavailable + permanence: transient,无 detail)": { attr: 503, since: "7.147.0" },
|
|
820
|
+
"GET /v1/capabilities/mcp|/v1/sessions/:id/a2a#scenario_assignment_unavailable(与提交腿同一只场景门;缺席与点名的场景名同拒;整面;体同上)": { attr: 503, since: "7.147.0" },
|
|
821
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#scenario_assignment_unavailable(续跑家族经装配的那几条;认领之前,卡仍待决;不折 resume_blocked_by_policy;体 state.scenario_assignment_unavailable + permanence: transient + retriable)": { attr: 503, since: "7.147.0" },
|
|
822
|
+
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#settings.env 有成员不是帽内的串(新提交;只在采纳 env 的车道上:单用户 host / device,或采纳请求体 hooks 且请求带着 hooks;零 run;体 request.field_invalid + field settings.env,句子点名坐标、不回显值)": { attr: 400, since: "7.147.0" },
|
|
823
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#stored_unread_members(续跑将要跑的那一份体 —— 存量体,重述键在场时盖过重述之后 —— 里有本版读者读不出、而本部署本会采纳的成员:settings.hooks / settings.env / 其余 settings 延后键 / mcpServers[i].transport / a2aPeers[i].headers;认领之前,卡仍待决;体 resume_blocked_by_policy + blockedBy request.field_invalid + field + retriable)": { attr: 409, since: "7.147.0" },
|
|
824
|
+
"POST /v1/runs/:id/steer#stored_unread_members(run 已终态、铸唤醒卡之前;同一只判;不铸卡;体 resume_blocked_by_policy + blockedBy request.field_invalid + field,不带 retriable)": { attr: 409, since: "7.147.0" },
|
|
668
825
|
},
|
|
669
826
|
},
|
|
670
827
|
ruleImportReceiptKey: {
|
|
@@ -673,17 +830,14 @@ export const SELF_MINTED_WIRE = {
|
|
|
673
830
|
members: { attr: "always", since: "7.145.0" },
|
|
674
831
|
rev: { attr: "always", since: "7.145.0" },
|
|
675
832
|
},
|
|
676
|
-
retired: {
|
|
677
|
-
"result(≤7.144.0 的 cc-import 回执:{ members: <引擎 RedeemedBatchMember 原形行:candidateIndex / behavior / rule / scope 对象 / status / alreadyRedeemed / dot>, rev })": { attr: "always", since: "7.46.0", until: "7.145.0" },
|
|
678
|
-
},
|
|
679
833
|
},
|
|
680
834
|
ruleImportReceiptMemberKey: {
|
|
681
835
|
at: "POST /v1/rules/cc-import/redeem 200 回执 members[] 行键(<键> → 在场律;与 POST /v1/rules/local-import/redeem 同形)",
|
|
682
836
|
members: {
|
|
683
837
|
key: { attr: "always; { behavior, rule, scope } — scope is the GET /v1/rules discriminated string (global | project:<root>)", since: "7.145.0" },
|
|
684
|
-
outcome: { attr: "always; persisted | no-op |
|
|
685
|
-
reason: { attr: "present-iff outcome indeterminate; store_refused", since: "7.145.0" },
|
|
686
|
-
detail: { attr: "present-iff outcome indeterminate; the engine's refusal sentence verbatim", since: "7.145.0" },
|
|
838
|
+
outcome: { attr: "always; persisted | no-op | refused (engine refusal, committed no) | indeterminate (engine refusal, committed unknown; 7.145.0 minted every engine refusal as indeterminate)", since: "7.145.0" },
|
|
839
|
+
reason: { attr: "present-iff outcome refused | indeterminate; the engine's RuleRefusalCode verbatim (7.145.0: the one word store_refused)", since: "7.145.0" },
|
|
840
|
+
detail: { attr: "present-iff outcome refused | indeterminate; the engine's refusal sentence verbatim", since: "7.145.0" },
|
|
687
841
|
},
|
|
688
842
|
},
|
|
689
843
|
memoryLayerSeatKey: {
|
|
@@ -699,6 +853,8 @@ export const SELF_MINTED_WIRE = {
|
|
|
699
853
|
at: "GET /v1/sessions/:id/memory-status 200 体顶层键(<键> → 在场律)",
|
|
700
854
|
members: {
|
|
701
855
|
memorySync: { attr: "present-iff this deployment runs a memory sync leg;{parked:[{scope,wayOut}]} in sync order;parked:[] ⇔ no layer parked;deployment fact (same for every session, ?scope= not applied)", since: "7.141.0" },
|
|
856
|
+
writeHome: { attr: "present-iff the engine answered it ∧ the single-user host lane (the capability bit projectContext's range predicate: hosted / sandbox / device / no-hands lanes ⇒ absent);the engine's absolute directory, byte for byte;with ?scope= that store's engine answer;without ?scope= the session-level home the engine chose across the stores (the newest store's own home;absent while any store's reading is unreadable, on a same-instant tie, or when no store names one)", since: "7.146.0" },
|
|
857
|
+
planes: { attr: "present-iff no ?scope= ∧ the single-user host lane (same predicate as writeHome);[{plane:\"project\"|\"personal\", writeHome?}] one row per store in the engine's store order, each row the engine's own answer for that store (writeHome verbatim, absent when that store names none);the rows' other keys are not on the wire", since: "7.146.0" },
|
|
702
858
|
},
|
|
703
859
|
},
|
|
704
860
|
memorySyncWayOut: {
|
|
@@ -732,6 +888,48 @@ export const SELF_MINTED_WIRE = {
|
|
|
732
888
|
"409 conflict.session_memory_unobserved#reason": { attr: "always;closed set sessionMemoryUnobservedReason, judged in read order (no settled run → the latest settled run's observation gives no read set: empty observation or memory not mounted → no leaf);the message is a function of reason", since: "7.143.0" },
|
|
733
889
|
},
|
|
734
890
|
},
|
|
891
|
+
sessionRewindFilesWire: {
|
|
892
|
+
at: "POST /v1/sessions/:id/rewind-files(<面>#<键> → 读法 / 在场律)",
|
|
893
|
+
members: {
|
|
894
|
+
"body#to": { attr: "required;a rewind handle this server minted (a prompt's taskId or a message's eventId), 1..255 chars;translated by the same anchor reader as the submit body's rewindFilesTo;unknown ⇒ 404 rewind_files_to.unknown_event", since: "7.147.0" },
|
|
895
|
+
"body#dryRun": { attr: "optional boolean;true ⇒ preview only, no file written;any other key ⇒ 400 request.body_shape", since: "7.147.0" },
|
|
896
|
+
"body#acceptPartialRestore": { attr: "not accepted ⇒ 400 request.body_shape (the engine's out-of-run rewind has no partial-restore policy; a partial restore answers 200 with restore.outcome partial)", since: "7.147.0" },
|
|
897
|
+
"200#dryRun": { attr: "always;the engine RewindFilesResult discriminant verbatim", since: "7.147.0" },
|
|
898
|
+
"200#preview": { attr: "present-iff dryRun true;engine FileHistoryDiffStats verbatim, or null when the store gives no stats (null is not zero stats)", since: "7.147.0" },
|
|
899
|
+
"200#restore": { attr: "present-iff dryRun false;engine restore ledger (outcome complete | partial, filesChanged, identicalSkipped, refused[], failed[], modeNotPreserved?, error?), path and reason leaves redacted;error = { errorCode, message, permanence? } (the engine member code is spelled errorCode on the wire)", since: "7.147.0" },
|
|
900
|
+
"409 conflict.session_active_run#activeTaskId": { attr: "always on this face;the run holding the session's durable claim (the message names it too)", since: "7.147.0" },
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
adoptionImportOutcome: {
|
|
904
|
+
at: "POST /v1/adoption/:id/sessions 200 results[].outcome",
|
|
905
|
+
members: {
|
|
906
|
+
imported: { attr: "-", since: "7.146.0" },
|
|
907
|
+
already_imported: { attr: "-", since: "7.146.0" },
|
|
908
|
+
rejected: { attr: "-", since: "7.146.0" },
|
|
909
|
+
},
|
|
910
|
+
},
|
|
911
|
+
adoptionImportRejectCode: {
|
|
912
|
+
at: "POST /v1/adoption/:id/sessions 200 results[].code(present-iff outcome rejected)",
|
|
913
|
+
members: {
|
|
914
|
+
too_large: { attr: "count = the envelope's JSON byte length;cap = maxSessionBytes at the time", since: "7.146.0" },
|
|
915
|
+
invalid_envelope: { attr: "detail = a fixed sentence (envelope shape, or which import invariant failed);clientSessionId present-iff readable", since: "7.146.0" },
|
|
916
|
+
duplicate_client_session_id: { attr: "an earlier element of the same batch used this clientSessionId (whatever its own outcome)", since: "7.146.0" },
|
|
917
|
+
},
|
|
918
|
+
},
|
|
919
|
+
adoptionImportWire: {
|
|
920
|
+
at: "POST /v1/adoption/:id/sessions(<面>#<键> → 读法 / 在场律)",
|
|
921
|
+
members: {
|
|
922
|
+
"body#sessions": { attr: "required;the only key;array of envelopes;length > adoptionImport.maxSessions ⇒ 400 request.field_invalid (field sessions, reason over_cap)", since: "7.146.0" },
|
|
923
|
+
"body.sessions[]#clientSessionId": { attr: "required;string 1-255 chars;idempotency key with the adoption id", since: "7.146.0" },
|
|
924
|
+
"body.sessions[]#entries": { attr: "required;array of session entries oldest first;the only other key (any extra key ⇒ that element invalid_envelope)", since: "7.146.0" },
|
|
925
|
+
"200#results": { attr: "always;one per element, same order", since: "7.146.0" },
|
|
926
|
+
"200.results[]#clientSessionId": { attr: "always except invalid_envelope on an unreadable envelope", since: "7.146.0" },
|
|
927
|
+
"200.results[]#sessionId": { attr: "present-iff imported | already_imported;the cloud session id derived from (adoptionId, clientSessionId)", since: "7.146.0" },
|
|
928
|
+
"200.results[]#count": { attr: "present-iff code too_large", since: "7.146.0" },
|
|
929
|
+
"200.results[]#cap": { attr: "present-iff code too_large", since: "7.146.0" },
|
|
930
|
+
"200.results[]#detail": { attr: "present-iff code invalid_envelope", since: "7.146.0" },
|
|
931
|
+
},
|
|
932
|
+
},
|
|
735
933
|
centralMemorySyncWire: {
|
|
736
934
|
at: "POST /v2/memory/sync/:scope(<面>#<键> → 读法 / 在场律)",
|
|
737
935
|
members: {
|
|
@@ -761,6 +959,8 @@ export const SELF_MINTED_WIRE = {
|
|
|
761
959
|
refusalSentenceForm: {
|
|
762
960
|
at: "拒体 message 的句型(<码>#<座> → 句型骨架;码 / 状态 / 机读位不变)",
|
|
763
961
|
members: {
|
|
962
|
+
"401 auth.unauthorized#operator(/metrics* · GET /v1/tasks/source-summary)": { attr: "… send the deployment's service token … without a principal header where this deployment lets its service token act for the deployment itself (GET /health reports it as auth.serviceTokenActsForDeployment; …), or a read-only token this endpoint accepts (…)", since: "7.146.0" },
|
|
963
|
+
"422 invalid_entries#row_contract(会话同步推送第二阶段;收编批量导入同句进逐元素 detail)": { attr: "malformed entry (id and parentId must be strings of 1-64 characters, type a string of 1-32 characters)", since: "7.146.0" },
|
|
764
964
|
"409 decide.row_unrevivable#no_root_anchor": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
|
|
765
965
|
"400 request.field_invalid#mcpServers.over_cap(受理口 · POST /v1/capabilities/mcp/probe 同句)": { attr: "head: <field> has <count> entries — at most <cap> are accepted", since: "7.136.0" },
|
|
766
966
|
"400 request.field_invalid#a2aPeers.over_cap": { attr: "tail: 声明列表拒绝骨架的句尾(与 mcpServers 共用 request-declaration-refusal)", since: "7.136.0" },
|
|
@@ -797,6 +997,8 @@ export const SELF_MINTED_WIRE = {
|
|
|
797
997
|
"409 conflict.session_memory_unobserved#run_result_missing|run_result_unobserved": { attr: "the latest settled run in this session has no memory observation on record, and an earlier run is never read in its place — run another task in this session (…), then sync", since: "7.143.0" },
|
|
798
998
|
"409 conflict.session_memory_unobserved#memory_not_mounted": { attr: "memory was configured for the latest settled run in this session but did not mount, so which memory this session reads is unknown, and an earlier run is never read in its place — run another task in this session (…), then sync", since: "7.143.0" },
|
|
799
999
|
"409 conflict.session_memory_unobserved#no_leaf": { attr: "this session has no transcript yet, so there is no revision to sync from — run a task in it (…), then sync", since: "7.143.0" },
|
|
1000
|
+
"400 request.field_invalid#unread_request_members(新提交:settings.env 有成员不是帽内的串;嵌入方直调装配时四座同句)": { attr: "this request carries a member|members this server version's readers cannot take as written, on a deployment that would apply it|them: <坐标,至多 8 处>[ (and <n> more)] — running it would silently leave that member|those members out (a hook that guards a tool, an MCP server's credentials); submit it again with this member|these members in the current form", since: "7.147.0" },
|
|
1001
|
+
"409 resume_blocked_by_policy#unread_members(续跑四门 · steer 铸唤醒卡之前)": { attr: "resume blocked by an admission policy change: <同上一句>", since: "7.147.0" },
|
|
800
1002
|
},
|
|
801
1003
|
},
|
|
802
1004
|
decisionBodyKey: {
|
|
@@ -866,6 +1068,8 @@ export const SELF_MINTED_WIRE = {
|
|
|
866
1068
|
members: {
|
|
867
1069
|
SEALED_KEY_DIR: { attr: "store", since: "7.136.0" },
|
|
868
1070
|
MEMORY_SYNC_SERVE_IDENTITY: { attr: "memory", since: "7.142.0" },
|
|
1071
|
+
DEVICE_TRUSTED_PROXY_CIDRS: { attr: "orchestration", since: "7.146.0" },
|
|
1072
|
+
SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT: { attr: "auth", since: "7.146.0" },
|
|
869
1073
|
},
|
|
870
1074
|
},
|
|
871
1075
|
deviceProtocolRevision: {
|
|
@@ -953,6 +1157,8 @@ export const SELF_MINTED_WIRE = {
|
|
|
953
1157
|
"SSE text_delta#delta(文字段的状态跨文字块)": { attr: "segment-scoped-redactor-state;text_end=block-delivery-not-segment-close;block-end-as-ended-vs-whole-differs=live-as-ended+ledger-whole+hold-diverged+1", since: "7.144.0" },
|
|
954
1158
|
"SSE text_end#content(接在同段前缀之后判)": { attr: "engine-block-content;judged-after-segment-prefix", since: "7.144.0" },
|
|
955
1159
|
"GET /v1/runs/:id/events#text.text(段文本含只有 text_end 的块)": { attr: "segment-text=block-texts-concat;end-only-block=text_end.content", since: "7.144.0" },
|
|
1160
|
+
"POST /v1/approvals/:sessionId/decide|/v1/assistant/tasks/:id/plan_review|/v1/assistant/tasks/:id/resume|/v1/sessions/:id/wake#errorCode(引擎拒 checkpoint.invalid_outcome)": { attr: "decision-cause⇒cause-code;row-own(reason)|no-cause⇒checkpoint.invalid_outcome", since: "7.147.0" },
|
|
1161
|
+
"POST /v1/approvals/:sessionId/decide#errorCode(这一行自己的拒:读行臂 / 门型守卫之前)": { attr: "rowVerdict.code+reason+retriable:true(engine-judge;before-gate)", since: "7.147.0" },
|
|
956
1162
|
},
|
|
957
1163
|
},
|
|
958
1164
|
};
|
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* [ref](a)(core 7.2.0 / [ref] 片6 d1):`task_notification` 帧上 `_sema_provenance` typed 归因侧记的
|
|
3
|
-
*
|
|
4
|
-
* (`orchestration/workflow-completion-inbox.ts` 的 `taskNotificationInboxEntry`)
|
|
2
|
+
* [ref](a)(core 7.2.0 / [ref] 片6 d1)· [ref](会话箱车道三 lane 同批翻):`task_notification` 帧上 `_sema_provenance` typed 归因侧记的
|
|
3
|
+
* **单点**投影判据 —— live 三腿(`trace/project.ts` 的 `taskNotificationEventData`)与 park 半场
|
|
4
|
+
* (`orchestration/workflow-completion-inbox.ts` 的 `taskNotificationInboxEntry`)共用,两腿同判(park 腿的 drain 直接 spread extras 成帧、
|
|
5
|
+
* 不再经 project.ts,判据必须在入库前做,而且只能有一份)。一只 wire 键一个判据文件:同帧三只会话箱载体在 `task-notification-facets.ts`。
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* (
|
|
7
|
+
* 规则与那三只载体同一条:逐成员挑(绝不 spread)、在场才带、**在场却读不出 ⇒ 整键丢并计一次**(`dropProjectedFace`,NP-5)、缺席不计;
|
|
8
|
+
* 身份 / 地址 / 闭集词 / 计数 / 时刻逐字,展示 / 自由文本成员经出口座(座由腿给:{@link FrameTextSeat})。
|
|
9
|
+
* · `kind` —— **闭集**:wire 上只许出现 core 词表里的 lane 词。两向锚([ref]/[ref] 同纪律):`satisfies` 保「表内无词表外的词」(core 删 / 改词
|
|
10
|
+
* ⇒ 编译红),穷举断言保「词表无表外的词」(core 加 lane ⇒ 编译红 —— 新词必须由人处置:它是渲染判别键,静默透传一个未知 lane 等于替 core 声明一种
|
|
11
|
+
* 渲染形)。运行期词表外的值(上游漂了 / 载荷被改过)⇒ 整键丢并计一次,消费端退回老形卡;同帧载体不受牵连(它们是渲染判别,不是 lane 词)。
|
|
12
|
+
* · `from` / `taskId` / `seq` 必需,`agentType` 可选(本 mount 的 agent_message lane 恒缺席,在场即逐字)。
|
|
13
|
+
* · `peerMeta` —— 两种箱记录 lane 上 store 记录的 typed peer 元数据(core:「the store record's typed peer metadata, verbatim (authority; a notice
|
|
14
|
+
* frame's `peerMeta.notice` is the typed notice, its carrier holds only the rendered line)」)。逐成员:`fromSession` / `fromRoot` / `fromScope`
|
|
15
|
+
* 身份 / 寻址串逐字;`fromMode` / `kind` 闭集取 core 导出的 `MAILBOX_PEER_FROM_MODES` / `MAILBOX_PEER_RECORD_KINDS`(不手抄,[ref]);`urgent` 布尔;
|
|
16
|
+
* `notice` 见下。**`senderKey` / `gateReceiptId` / `occupant` / `fromOccupant` 不读不投**(登记在 `wire-projection-faces.ts` 的
|
|
17
|
+
* `task_notification_peer_meta` 行,一条律:凭据 / 身份令牌类 —— 准入闸的发信方键、跨主体投递闸的回执号、收发两方会话的化身令牌;
|
|
18
|
+
* 与顶层 `peer.senderKey` 同律,安全轴 fail-closed)。
|
|
19
|
+
* · `peerMeta.notice` —— 回执 / idle 通告的 typed 正体:`state` 必需、**开集串逐字**(core 型 `string`;新词原样过境,kind↔state 的配对是 drain 的判,
|
|
20
|
+
* 本服务不复判);`refSeq` / `finishedAt` 非负有限数(与 core 存储校验同界);`recipient` / `target`(展示标签)、`detail`(目标会话的那一行)、
|
|
21
|
+
* `dropReason` 是别处来的文本 ⇒ 经座。
|
|
22
|
+
* 不跨成员判(哪个 lane 带 `peerMeta`、哪个 lane 配哪只载体):那是产生者的律,core 在铸点守;本服务只判每个成员自己的形。
|
|
12
23
|
*/
|
|
13
|
-
import type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
taskId: string;
|
|
39
|
-
seq: number;
|
|
40
|
-
agentType?: string;
|
|
41
|
-
}
|
|
42
|
-
/** 逐成员挑取(绝不 spread —— core 给侧记加成员时必须经 keyset 门处置,见 `trace/core-keyset-guard.ts` ①);
|
|
43
|
-
* 返回 undefined = 闭集外 / 形不合 ⇒ 调用方丢整键。`agentType` 缺席不编(本 mount 恒缺席,在场即透传)。 */
|
|
44
|
-
export declare function semaProvenanceOrAbsent(p: SemaProvenanceInput): SemaProvenance | undefined;
|
|
24
|
+
import { type MailboxPeerMeta, type MailboxPeerNoticeMeta, type SemaProvenance } from "@sema-agent/core";
|
|
25
|
+
import { type SafeText } from "./exit-seat.js";
|
|
26
|
+
import { type FaceExcluded, type FrameTextSeat } from "./task-notification-facets.js";
|
|
27
|
+
/** wire 放行的 lane 词 = core 词表全员(会话箱车道三词自 [ref] 起与 `agent_message` 同簿;不再有「有意不放行」的第二簿)。 */
|
|
28
|
+
export declare const SEMA_PROVENANCE_KINDS: readonly ["agent_message", "cross_session_message", "cross_session_notice", "inbox_notice"];
|
|
29
|
+
type NoticeText = "recipient" | "dropReason" | "detail" | "target";
|
|
30
|
+
/** `peerMeta.notice` 的 wire 形:core 型减登记表排除;展示 / 自由文本成员是出口座铸的 {@link SafeText}。 */
|
|
31
|
+
export type PeerNoticeWire = Omit<MailboxPeerNoticeMeta, NoticeText | FaceExcluded<"task_notification_peer_notice">> & {
|
|
32
|
+
[K in Exclude<NoticeText, FaceExcluded<"task_notification_peer_notice">>]?: SafeText;
|
|
33
|
+
};
|
|
34
|
+
/** `peerMeta` 的 wire 形:core 型减登记表排除(`senderKey` / `gateReceiptId` / `occupant` / `fromOccupant`)。 */
|
|
35
|
+
export type PeerMetaWire = Omit<MailboxPeerMeta, "notice" | FaceExcluded<"task_notification_peer_meta">> & {
|
|
36
|
+
notice?: PeerNoticeWire;
|
|
37
|
+
};
|
|
38
|
+
/** 侧记的 wire 形:core 型减登记表排除(今天零排除)。 */
|
|
39
|
+
export type SemaProvenanceWire = Omit<SemaProvenance, "peerMeta" | FaceExcluded<"task_notification_provenance">> & {
|
|
40
|
+
peerMeta?: PeerMetaWire;
|
|
41
|
+
};
|
|
42
|
+
/** `_sema_provenance` 这一只键(在场才铸;读不出 ⇒ 整键丢并计一次)。两腿入参的形不是 core 类型:运行期载荷先当 `unknown` 收、判过形才成 typed。 */
|
|
43
|
+
export declare function semaProvenanceFields(n: {
|
|
44
|
+
_sema_provenance?: unknown;
|
|
45
|
+
}, seat: FrameTextSeat): {
|
|
46
|
+
_sema_provenance?: SemaProvenanceWire;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
45
49
|
//# sourceMappingURL=sema-provenance.d.ts.map
|
|
@@ -1,14 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { MAILBOX_PEER_FROM_MODES, MAILBOX_PEER_RECORD_KINDS } from "@sema-agent/core";
|
|
2
|
+
import { seatText } from "./exit-seat.js";
|
|
3
|
+
import { dropProjectedFace } from "./projection-drop.js";
|
|
4
|
+
import { isPlainObject, isString, memberOf, optional, settle } from "./task-notification-facets.js";
|
|
5
|
+
export const SEMA_PROVENANCE_KINDS = ["agent_message", "cross_session_message", "cross_session_notice", "inbox_notice"];
|
|
3
6
|
const _semaProvenanceExhaustive = true;
|
|
4
7
|
void _semaProvenanceExhaustive;
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const isKind = memberOf(SEMA_PROVENANCE_KINDS);
|
|
9
|
+
const optString = optional(isString);
|
|
10
|
+
const optFromMode = optional(memberOf(MAILBOX_PEER_FROM_MODES));
|
|
11
|
+
const optRecordKind = optional(memberOf(MAILBOX_PEER_RECORD_KINDS));
|
|
12
|
+
const optBoolean = optional((v) => typeof v === "boolean");
|
|
13
|
+
const optInstant = optional((v) => typeof v === "number" && Number.isFinite(v) && v >= 0);
|
|
14
|
+
export function semaProvenanceFields(n, seat) {
|
|
15
|
+
if (n._sema_provenance === undefined)
|
|
16
|
+
return {};
|
|
17
|
+
const p = settle(provenanceOf(n._sema_provenance, seat), (why) => dropProjectedFace("task_notification._sema_provenance " + why));
|
|
18
|
+
return p !== undefined ? { _sema_provenance: p } : {};
|
|
19
|
+
}
|
|
20
|
+
function provenanceOf(raw, seat) {
|
|
21
|
+
if (!isPlainObject(raw))
|
|
22
|
+
return { why: "is not a plain-data record" };
|
|
23
|
+
const { kind, from, taskId, seq, agentType, peerMeta } = raw;
|
|
24
|
+
if (!isKind(kind))
|
|
25
|
+
return { why: "kind is outside the core lane vocabulary" };
|
|
26
|
+
if (!isString(from) || !isString(taskId) || typeof seq !== "number")
|
|
27
|
+
return { why: "is missing a string from / taskId or a number seq" };
|
|
28
|
+
if (!optString(agentType))
|
|
29
|
+
return { why: "agentType is present but not a string" };
|
|
30
|
+
const meta = peerMeta === undefined ? undefined : peerMetaOf(peerMeta, seat);
|
|
31
|
+
if (meta !== undefined && "why" in meta)
|
|
32
|
+
return { why: `peerMeta ${meta.why}` };
|
|
33
|
+
return { wire: { kind, from, taskId, seq, ...(agentType !== undefined ? { agentType } : {}), ...(meta !== undefined ? { peerMeta: meta.wire } : {}) } };
|
|
34
|
+
}
|
|
35
|
+
function peerMetaOf(raw, seat) {
|
|
36
|
+
if (!isPlainObject(raw))
|
|
37
|
+
return { why: "is not a plain-data record" };
|
|
38
|
+
const { fromSession, fromRoot, fromMode, kind, fromScope, notice, urgent } = raw;
|
|
39
|
+
if (!optString(fromSession) || !optString(fromRoot) || !optString(fromScope)) {
|
|
40
|
+
return { why: "has a present fromSession / fromRoot / fromScope that is not a string" };
|
|
41
|
+
}
|
|
42
|
+
if (!optFromMode(fromMode))
|
|
43
|
+
return { why: "fromMode is outside core MAILBOX_PEER_FROM_MODES" };
|
|
44
|
+
if (!optRecordKind(kind))
|
|
45
|
+
return { why: "kind is outside core MAILBOX_PEER_RECORD_KINDS" };
|
|
46
|
+
if (!optBoolean(urgent))
|
|
47
|
+
return { why: "urgent is present but not a boolean" };
|
|
48
|
+
const typed = notice === undefined ? undefined : noticeOf(notice, seat);
|
|
49
|
+
if (typed !== undefined && "why" in typed)
|
|
50
|
+
return { why: `notice ${typed.why}` };
|
|
51
|
+
return {
|
|
52
|
+
wire: {
|
|
53
|
+
...(fromSession !== undefined ? { fromSession } : {}),
|
|
54
|
+
...(fromRoot !== undefined ? { fromRoot } : {}),
|
|
55
|
+
...(fromMode !== undefined ? { fromMode } : {}),
|
|
56
|
+
...(kind !== undefined ? { kind } : {}),
|
|
57
|
+
...(fromScope !== undefined ? { fromScope } : {}),
|
|
58
|
+
...(typed !== undefined ? { notice: typed.wire } : {}),
|
|
59
|
+
...(urgent !== undefined ? { urgent } : {}),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function noticeOf(raw, seat) {
|
|
64
|
+
if (!isPlainObject(raw))
|
|
65
|
+
return { why: "is not a plain-data record" };
|
|
66
|
+
const { state, refSeq, recipient, dropReason, finishedAt, detail, target } = raw;
|
|
67
|
+
if (!isString(state))
|
|
68
|
+
return { why: "is missing a string state" };
|
|
69
|
+
if (!optInstant(refSeq) || !optInstant(finishedAt))
|
|
70
|
+
return { why: "has a present refSeq / finishedAt that is not a non-negative finite number" };
|
|
71
|
+
if (!optString(recipient) || !optString(dropReason) || !optString(detail) || !optString(target))
|
|
72
|
+
return { why: "has a present recipient / dropReason / detail / target that is not a string" };
|
|
73
|
+
return {
|
|
74
|
+
wire: {
|
|
75
|
+
state,
|
|
76
|
+
...(refSeq !== undefined ? { refSeq } : {}),
|
|
77
|
+
...(recipient !== undefined ? { recipient: seatText(seat, recipient) } : {}),
|
|
78
|
+
...(dropReason !== undefined ? { dropReason: seatText(seat, dropReason) } : {}),
|
|
79
|
+
...(finishedAt !== undefined ? { finishedAt } : {}),
|
|
80
|
+
...(detail !== undefined ? { detail: seatText(seat, detail) } : {}),
|
|
81
|
+
...(target !== undefined ? { target: seatText(seat, target) } : {}),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
13
84
|
}
|
|
14
85
|
//# sourceMappingURL=sema-provenance.js.map
|