@sema-agent/server 7.146.0 → 7.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +1423 -24
- package/README.md +21 -8
- package/README.zh-CN.md +15 -9
- package/USAGE.md +537 -216
- package/deploy/facts/lanes.json +7 -0
- package/deploy/sema-up/README.md +18 -7
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +42 -4
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -4
- package/deploy/sema-up/chart/templates/server.yaml +5 -4
- package/deploy/sema-up/chart/values.yaml +4 -3
- package/deploy/sema-up/cluster-up.sh +75 -176
- package/deploy/sema-up/kube-up.sh +29 -49
- package/deploy/sema-up/lib/chart-run.sh +23 -0
- package/deploy/sema-up/lib/dataroot.sh +3 -3
- package/deploy/sema-up/lib/flagshape.sh +4 -0
- package/deploy/sema-up/lib/health.sh +62 -13
- package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
- package/deploy/sema-up/lib/helm-values-kube.py +35 -0
- package/deploy/sema-up/lib/lanes.json +2 -5
- package/deploy/sema-up/lib/regcred.py +8 -0
- package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
- package/deploy/sema-up/lib/remote/image-import.sh +6 -0
- package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
- package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
- package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
- package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
- package/deploy/sema-up/lib/render-stack.py +17 -0
- package/deploy/sema-up/lib/shell-text.sh +87 -0
- package/deploy/sema-up/lib/usage-flags.txt +10 -0
- package/deploy/sema-up/lib/usage-head.txt +1 -0
- package/deploy/sema-up/lib/usage-tail.txt +13 -0
- package/deploy/sema-up/preflight.sh +10 -8
- package/deploy/sema-up/sema-up.sh +26 -48
- package/deploy/sema-up/smoke.sh +7 -6
- package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
- package/deploy/sema-up/stack/compose.yaml +18 -5
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +25 -3
- package/dist/adoption/plan.d.ts +24 -0
- package/dist/adoption/plan.js +53 -1
- package/dist/adoption/runner.d.ts +10 -1
- package/dist/adoption/runner.js +36 -16
- package/dist/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +32 -34
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +16 -14
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +17 -9
- package/dist/auth-bridge.d.ts +0 -14
- package/dist/auth-bridge.js +0 -7
- package/dist/auto-mode-face.d.ts +10 -7
- package/dist/auto-mode-face.js +7 -4
- package/dist/background-agent-name.d.ts +19 -1
- package/dist/background-agent-name.js +12 -2
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.js +9 -6
- package/dist/bench/s1/arms.js +6 -5
- package/dist/bench/s1/live-deps.js +8 -3
- package/dist/bench/s1/run-firm.js +6 -5
- package/dist/bind-host.d.ts +25 -0
- package/dist/bind-host.js +25 -0
- package/dist/boot/adoption.d.ts +3 -0
- package/dist/boot/adoption.js +1 -0
- package/dist/boot/crash-last.js +2 -1
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/device-lane.js +5 -5
- package/dist/boot/engine-lease.d.ts +12 -11
- package/dist/boot/execution-env.d.ts +19 -8
- package/dist/boot/execution-env.js +80 -62
- package/dist/boot/execution-lane.d.ts +37 -9
- package/dist/boot/execution-lane.js +74 -20
- package/dist/boot/exit-boundary.d.ts +3 -3
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/exit-last.js +2 -1
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/governance-seams.d.ts +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +18 -16
- package/dist/boot/memory-boundary.d.ts +11 -11
- package/dist/boot/memory-boundary.js +3 -3
- package/dist/boot/memory-consolidation.d.ts +50 -53
- package/dist/boot/memory-consolidation.js +11 -18
- package/dist/boot/org-memory.js +4 -3
- package/dist/boot/parked-revive-gate.d.ts +1 -1
- package/dist/boot/parked-revive-gate.js +3 -3
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +20 -17
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +133 -165
- package/dist/boot/retention-lane.d.ts +7 -45
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +11 -4
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +17 -7
- package/dist/boot/session-faces.js +122 -96
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -1
- package/dist/boot/stage-01-config.js +14 -2
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -1
- package/dist/boot/stage-02-web-admin-pull.js +15 -8
- package/dist/boot/stage-03-store-backend.d.ts +4 -1
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -1
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +9 -5
- package/dist/boot/stage-05-execution-env.js +5 -5
- package/dist/boot/stage-06-runners.d.ts +13 -15
- package/dist/boot/stage-06-runners.js +24 -18
- package/dist/boot/stage-07-capability-layer.d.ts +14 -11
- package/dist/boot/stage-07-capability-layer.js +9 -12
- package/dist/boot/stage-08-reapers.d.ts +14 -11
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +16 -18
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +16 -18
- package/dist/boot/stage-10-http-server.js +9 -5
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +12 -0
- package/dist/boot/stores.js +39 -17
- package/dist/boot/task-list-lane.d.ts +4 -4
- package/dist/boot/web-admin.d.ts +4 -2
- package/dist/boot/web-admin.js +58 -38
- package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
- package/dist/boot-reclaim.d.ts +3 -1
- package/dist/boot-reclaim.js +1 -1
- package/dist/brain.d.ts +7 -18
- package/dist/brain.js +5 -17
- package/dist/budget.js +6 -6
- package/dist/capabilities/center-plugins.d.ts +9 -1
- package/dist/capabilities/center-plugins.js +37 -11
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +3 -2
- package/dist/capabilities/composite-members.js +3 -2
- 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/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +38 -33
- package/dist/capabilities/scenarios.js +24 -25
- package/dist/capabilities/settings-contract.d.ts +29 -0
- package/dist/capabilities/settings-contract.js +14 -0
- package/dist/capabilities/skills.d.ts +6 -6
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +69 -4
- package/dist/capability-facts.js +77 -5
- package/dist/card-void.d.ts +4 -4
- package/dist/card-void.js +1 -1
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +10 -5
- package/dist/config-catalog.d.ts +16 -1
- package/dist/config-catalog.js +68 -61
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +58 -4
- package/dist/config-invariants.js +104 -23
- package/dist/config-lkg.d.ts +24 -2
- package/dist/config-lkg.js +22 -9
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -108
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +215 -202
- package/dist/config.d.ts +69 -14
- package/dist/config.js +188 -96
- package/dist/degenerate-instrument.js +1 -1
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deploy-facts.js +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +51 -16
- package/dist/deployment-shape.js +31 -6
- package/dist/egress-redirect.d.ts +25 -7
- package/dist/egress-redirect.js +20 -2
- package/dist/elicitation.d.ts +6 -5
- package/dist/elicitation.js +23 -22
- package/dist/engine-identity.d.ts +28 -0
- package/dist/engine-identity.js +10 -0
- package/dist/entry-problems.d.ts +5 -7
- package/dist/entry-problems.js +1 -1
- package/dist/env-facts.d.ts +7 -5
- package/dist/env-facts.js +12 -7
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -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 +53 -103
- package/dist/execution-lane-caps.js +51 -83
- package/dist/execution-placement.d.ts +65 -9
- package/dist/execution-placement.js +58 -0
- package/dist/field-conflict.d.ts +7 -11
- package/dist/field-conflict.js +3 -3
- package/dist/file-history-capture.d.ts +3 -3
- package/dist/file-history-disclosure.d.ts +2 -2
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/drain-entry.d.ts +17 -10
- package/dist/fleet/drain-entry.js +1 -1
- package/dist/fleet/fleet-bus.d.ts +21 -3
- package/dist/fleet/fleet-bus.js +35 -25
- package/dist/fleet/fleet-reconciler.js +2 -2
- package/dist/fleet/serving-lease.js +6 -7
- package/dist/fleet-client.js +3 -3
- package/dist/fleet-lease.d.ts +0 -1
- package/dist/fleet-lease.js +4 -5
- package/dist/history-anchor.d.ts +42 -0
- package/dist/history-anchor.js +34 -0
- package/dist/hitl-delivery.d.ts +90 -0
- package/dist/hitl-delivery.js +98 -0
- package/dist/hooks/classic-stations.d.ts +8 -11
- package/dist/hooks/classic-stations.js +0 -7
- package/dist/hooks/command-spawn.d.ts +1 -4
- package/dist/hooks/command-spawn.js +0 -11
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +119 -65
- package/dist/hooks/hook-runner.js +415 -217
- package/dist/host-lsp-manager.d.ts +22 -8
- package/dist/host-lsp-manager.js +4 -1
- package/dist/http/active-run-conflict.d.ts +2 -43
- package/dist/http/active-run-conflict.js +3 -7
- package/dist/http/admission.d.ts +4 -18
- package/dist/http/admission.js +75 -78
- package/dist/http/approval-sweeps.d.ts +5 -8
- package/dist/http/approval-sweeps.js +55 -30
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/checkpoint-ctx.d.ts +17 -0
- package/dist/http/checkpoint-ctx.js +6 -0
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claim-latency.d.ts +10 -0
- package/dist/http/claim-latency.js +12 -0
- package/dist/http/claimed-run.d.ts +4 -3
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +77 -31
- package/dist/http/durable-run-leg.d.ts +3 -3
- package/dist/http/durable-run-leg.js +18 -12
- package/dist/http/execution-context.d.ts +18 -42
- package/dist/http/execution-context.js +11 -5
- package/dist/http/health-reader.d.ts +36 -0
- package/dist/http/health-reader.js +21 -0
- package/dist/http/health-self-report.d.ts +9 -9
- package/dist/http/health-self-report.js +4 -4
- package/dist/http/idempotency.d.ts +9 -5
- package/dist/http/idempotency.js +4 -4
- package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
- package/dist/http/memory-compliance-failure-reply.js +7 -2
- package/dist/http/memory-face-fault-reply.d.ts +67 -0
- package/dist/http/memory-face-fault-reply.js +71 -0
- package/dist/http/memory-store-refusal-reply.d.ts +3 -3
- package/dist/http/memory-store-refusal-reply.js +6 -0
- package/dist/http/owner-access.d.ts +391 -56
- package/dist/http/owner-access.js +372 -33
- package/dist/http/principal-gate.d.ts +26 -94
- package/dist/http/principal-gate.js +24 -81
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +10 -14
- package/dist/http/request-guards.js +34 -68
- package/dist/http/resume-composition.d.ts +37 -0
- package/dist/http/resume-composition.js +18 -0
- package/dist/http/resume-ctx-read.d.ts +35 -12
- package/dist/http/resume-ctx-read.js +25 -6
- package/dist/http/resume-legs.d.ts +24 -24
- package/dist/http/resume-legs.js +260 -171
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- 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 +56 -47
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +58 -37
- package/dist/http/routes/admin-config-refresh.js +2 -2
- package/dist/http/routes/admin-drain.js +2 -2
- package/dist/http/routes/admin-memory-optout.js +4 -3
- package/dist/http/routes/adoption.d.ts +3 -0
- package/dist/http/routes/adoption.js +17 -10
- package/dist/http/routes/agents-roster.js +13 -7
- package/dist/http/routes/approvals-assistant.js +73 -88
- package/dist/http/routes/attachments.js +2 -2
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +9 -17
- package/dist/http/routes/capabilities.js +23 -20
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +5 -5
- package/dist/http/routes/diagnostics.d.ts +27 -3
- package/dist/http/routes/diagnostics.js +27 -21
- package/dist/http/routes/engine.js +2 -2
- package/dist/http/routes/fleet.js +5 -3
- package/dist/http/routes/images.js +10 -6
- package/dist/http/routes/leader.d.ts +7 -2
- package/dist/http/routes/leader.js +12 -3
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +7 -15
- package/dist/http/routes/memory-bundle.js +4 -7
- package/dist/http/routes/memory-compliance.js +4 -4
- package/dist/http/routes/memory-consolidation.js +6 -9
- package/dist/http/routes/memory-origin.d.ts +3 -1
- package/dist/http/routes/memory-origin.js +7 -8
- package/dist/http/routes/memory-policy.js +17 -12
- package/dist/http/routes/notify-wake.js +12 -20
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +1 -1
- package/dist/http/routes/principal-inbox.js +2 -2
- package/dist/http/routes/projects.d.ts +70 -0
- package/dist/http/routes/projects.js +87 -0
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +50 -7
- package/dist/http/routes/run-memory-capture.d.ts +2 -2
- package/dist/http/routes/run-memory-capture.js +6 -12
- package/dist/http/routes/run-permission-mode.d.ts +2 -2
- package/dist/http/routes/run-permission-mode.js +10 -17
- package/dist/http/routes/runs.js +148 -233
- package/dist/http/routes/session-memory-sync.d.ts +2 -2
- package/dist/http/routes/session-memory-sync.js +7 -13
- package/dist/http/routes/session-sync.d.ts +4 -2
- package/dist/http/routes/session-sync.js +48 -30
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.d.ts +7 -1
- package/dist/http/routes/sessions.js +177 -112
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +144 -122
- package/dist/http/routes/trace-usage.d.ts +0 -12
- package/dist/http/routes/trace-usage.js +40 -46
- package/dist/http/routes/workflows.d.ts +39 -4
- package/dist/http/routes/workflows.js +42 -14
- package/dist/http/run-concurrency-cap.d.ts +20 -12
- package/dist/http/run-concurrency-cap.js +39 -26
- package/dist/http/run-read-face.d.ts +3 -5
- package/dist/http/run-read-face.js +8 -13
- package/dist/http/send.d.ts +12 -3
- package/dist/http/send.js +42 -6
- package/dist/http/server.d.ts +63 -50
- package/dist/http/server.js +52 -16
- package/dist/http/sse-log.d.ts +17 -10
- package/dist/http/sse-log.js +7 -7
- package/dist/http/stored-body-replay.d.ts +17 -3
- package/dist/http/stored-body-replay.js +11 -2
- package/dist/http/submit-ctx.d.ts +16 -8
- package/dist/http/submit-ctx.js +6 -2
- package/dist/http/submit-replay.d.ts +19 -6
- package/dist/http/submit-replay.js +18 -6
- package/dist/http/sync-submit-body.d.ts +3 -4
- package/dist/http/sync-submit-body.js +4 -5
- package/dist/http/wire-types.d.ts +23 -13
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/instruction-source-notice.d.ts +1 -1
- package/dist/key-resolver.d.ts +32 -0
- package/dist/key-resolver.js +23 -9
- package/dist/leader/diffup.js +2 -1
- package/dist/leader/endpoint.d.ts +26 -5
- package/dist/leader/endpoint.js +154 -14
- package/dist/leader/fanout.d.ts +3 -0
- package/dist/leader/fanout.js +78 -63
- package/dist/leader/leader.d.ts +16 -0
- package/dist/leader/leader.js +43 -3
- package/dist/leader/merge.d.ts +9 -1
- package/dist/leader/merge.js +16 -1
- package/dist/leader/repair-wire.js +1 -1
- package/dist/leader/wire.d.ts +36 -3
- package/dist/leader/wire.js +59 -18
- package/dist/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/memory-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 +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-scope.d.ts +31 -4
- package/dist/memory-scope.js +65 -16
- package/dist/memory-store-refusal.d.ts +20 -4
- package/dist/memory-store-refusal.js +1 -1
- package/dist/memory-sync-client.d.ts +5 -2
- package/dist/memory-sync-client.js +19 -14
- package/dist/memory-sync.js +1 -1
- package/dist/model-compat.d.ts +51 -28
- package/dist/model-compat.js +55 -23
- package/dist/model-context-window.d.ts +18 -0
- package/dist/model-context-window.js +2 -0
- package/dist/model-entry-headers.d.ts +46 -4
- package/dist/model-entry-headers.js +2 -2
- package/dist/model-entry-refusal.d.ts +46 -17
- package/dist/model-entry-refusal.js +47 -27
- package/dist/model-plane-face.d.ts +19 -11
- package/dist/model-plane-face.js +9 -1
- package/dist/model-plane-probe.d.ts +2 -0
- package/dist/model-plane-probe.js +17 -0
- package/dist/model-provider.d.ts +3 -3
- package/dist/model-route-endpoint.d.ts +9 -5
- package/dist/model-route-endpoint.js +29 -7
- package/dist/model-select.d.ts +16 -0
- package/dist/model-select.js +4 -0
- package/dist/mountinfo.d.ts +37 -0
- package/dist/mountinfo.js +47 -0
- package/dist/namespaced-rule-name.d.ts +28 -2
- package/dist/namespaced-rule-name.js +10 -1
- package/dist/net-address.d.ts +1 -1
- package/dist/observability/corrupt-read-seat.d.ts +4 -4
- package/dist/observability/corrupt-read-seat.js +5 -3
- package/dist/observability/fail-open.d.ts +75 -47
- package/dist/observability/fail-open.js +77 -47
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +5 -4
- package/dist/observability/otel-exporter.js +2 -1
- package/dist/observability/principal-context.d.ts +14 -7
- package/dist/observability/principal-context.js +8 -3
- package/dist/observability/run-terminal.d.ts +7 -1
- package/dist/observability/run-terminal.js +5 -2
- package/dist/observability/secret-env-scrub.d.ts +30 -4
- package/dist/observability/secret-env-scrub.js +15 -3
- package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
- package/dist/orchestration/hardened-vm-runner.js +11 -5
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
- package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
- package/dist/orchestration/hardened-vm-worker.js +2 -1
- package/dist/orchestration/workflow-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 +29 -9
- package/dist/orchestration/workflow-completion-inbox.js +65 -46
- package/dist/org-delivery-gate.d.ts +5 -4
- package/dist/org-delivery-gate.js +7 -6
- package/dist/org-memory-admission.d.ts +5 -2
- package/dist/org-memory-admission.js +25 -10
- package/dist/outbound-dispatcher.d.ts +1 -1
- package/dist/outbound-dispatcher.js +6 -12
- package/dist/owner-brands.d.ts +81 -0
- package/dist/owner-brands.js +42 -0
- package/dist/owner-faces.d.ts +531 -0
- package/dist/owner-faces.js +126 -0
- package/dist/parked-decide.d.ts +100 -31
- package/dist/parked-decide.js +162 -48
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +6 -8
- package/dist/peer-directory.js +3 -2
- package/dist/permission-rule-vocab.d.ts +53 -8
- package/dist/permission-rule-vocab.js +30 -2
- package/dist/plugins/adoption-log-sql.d.ts +0 -22
- package/dist/plugins/adoption-log-sql.js +5 -3
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
- package/dist/plugins/approval-ask-store-file.d.ts +28 -9
- package/dist/plugins/approval-ask-store-file.js +74 -18
- package/dist/plugins/approval-ask-store-memory.d.ts +17 -7
- package/dist/plugins/approval-ask-store-memory.js +35 -12
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -20
- package/dist/plugins/approval-ask-store-sql.js +44 -11
- package/dist/plugins/approval-exemption-skill-m46.d.ts +20 -0
- package/dist/plugins/approval-exemption-skill-m46.js +25 -0
- package/dist/plugins/approval-exemption-store.d.ts +6 -1
- package/dist/plugins/approval-exemption-store.js +14 -0
- package/dist/plugins/approval-nonce-store.d.ts +39 -12
- package/dist/plugins/approval-nonce-store.js +72 -23
- package/dist/plugins/blob-backend.d.ts +40 -195
- package/dist/plugins/blob-backend.js +41 -234
- package/dist/plugins/caching-session-store.d.ts +22 -5
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +33 -6
- package/dist/plugins/checkpoint-index-columns.js +39 -3
- package/dist/plugins/checkpoint-store-face.d.ts +84 -11
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.d.ts +2 -2
- package/dist/plugins/device-store-sql.js +6 -10
- package/dist/plugins/ensure-index.d.ts +13 -1
- package/dist/plugins/ensure-index.js +154 -21
- package/dist/plugins/ensure-schema-lock-policy.d.ts +0 -15
- package/dist/plugins/ensure-schema-lock-policy.js +3 -2
- package/dist/plugins/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 +89 -35
- package/dist/plugins/file-run-store.js +197 -142
- package/dist/plugins/host-platform.d.ts +24 -3
- package/dist/plugins/host-platform.js +15 -1
- package/dist/plugins/image-bake-store-sql.js +2 -0
- package/dist/plugins/imported-layer-root-retirement.d.ts +19 -10
- 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/k8s-pod-reaper.d.ts +1 -3
- package/dist/plugins/k8s-pod-reaper.js +0 -1
- package/dist/plugins/leader-run-store-sql.d.ts +22 -0
- package/dist/plugins/leader-run-store-sql.js +34 -4
- package/dist/plugins/local-checkpoint-store.d.ts +63 -23
- package/dist/plugins/local-checkpoint-store.js +204 -81
- package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
- package/dist/plugins/local-data-dir-modes-m39.js +183 -0
- package/dist/plugins/local-docker-capacity.d.ts +93 -0
- package/dist/plugins/local-docker-capacity.js +194 -0
- package/dist/plugins/local-docker-reaper.d.ts +92 -0
- package/dist/plugins/local-docker-reaper.js +102 -0
- package/dist/plugins/local-engine-high-water.d.ts +13 -0
- package/dist/plugins/local-engine-high-water.js +62 -0
- package/dist/plugins/local-session-store.d.ts +442 -143
- package/dist/plugins/local-session-store.js +941 -289
- package/dist/plugins/local-session-window.d.ts +3 -2
- package/dist/plugins/local-session-window.js +3 -2
- package/dist/plugins/local-sidecar-quarantine.js +3 -2
- package/dist/plugins/local-task-attachment-store.d.ts +20 -1
- package/dist/plugins/local-task-attachment-store.js +32 -12
- 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 +11 -9
- package/dist/plugins/memory-engine-pg.d.ts +7 -5
- package/dist/plugins/memory-engine-pg.js +18 -9
- package/dist/plugins/memory-engine-sql-apply.d.ts +21 -8
- package/dist/plugins/memory-engine-sql-apply.js +7 -9
- package/dist/plugins/memory-engine-tidb.d.ts +12 -7
- package/dist/plugins/memory-engine-tidb.js +18 -10
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
- package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
- package/dist/plugins/memory-run-store.d.ts +39 -27
- package/dist/plugins/memory-run-store.js +72 -70
- package/dist/plugins/one-time-migration-marker.d.ts +10 -0
- package/dist/plugins/one-time-migration-marker.js +7 -0
- package/dist/plugins/one-time-migrations.d.ts +325 -74
- package/dist/plugins/one-time-migrations.js +705 -230
- package/dist/plugins/org-delivery-quota-store.js +2 -1
- 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 +11 -11
- package/dist/plugins/permission-rule-store-file.js +14 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -63
- package/dist/plugins/permission-rule-store-sql.js +6 -86
- package/dist/plugins/pg-pool.d.ts +3 -32
- package/dist/plugins/pg-pool.js +27 -11
- 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 +19 -28
- package/dist/plugins/remote-env-e2b.js +40 -29
- package/dist/plugins/remote-env-host.d.ts +11 -10
- package/dist/plugins/remote-env-host.js +40 -27
- package/dist/plugins/remote-env-k8s.d.ts +45 -47
- package/dist/plugins/remote-env-k8s.js +122 -62
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +370 -75
- package/dist/plugins/remote-env-ssh.d.ts +8 -2
- package/dist/plugins/remote-env-ssh.js +26 -24
- package/dist/plugins/remote-scratchpad.js +4 -0
- 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 +158 -0
- package/dist/plugins/retention-deployment.js +119 -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-preview-m45.d.ts +11 -0
- package/dist/plugins/run-preview-m45.js +19 -0
- package/dist/plugins/run-store-sql.d.ts +56 -68
- package/dist/plugins/run-store-sql.js +127 -116
- package/dist/plugins/s3-answer.d.ts +2 -1
- package/dist/plugins/sandbox-reaper.d.ts +26 -0
- package/dist/plugins/sandbox-reaper.js +2 -0
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +54 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +55 -0
- package/dist/plugins/scheduler-support.d.ts +16 -1
- package/dist/plugins/scheduler-support.js +22 -2
- package/dist/plugins/schema-consistency.d.ts +42 -15
- package/dist/plugins/schema-consistency.js +213 -13
- package/dist/plugins/schema-drift-sentence.d.ts +4 -1
- package/dist/plugins/schema-drift-sentence.js +4 -4
- package/dist/plugins/schema-ensure-legs.d.ts +10 -1
- package/dist/plugins/schema-ensure-legs.js +12 -2
- package/dist/plugins/schema-indexes.js +3 -0
- package/dist/plugins/schema-live-columns.d.ts +14 -5
- package/dist/plugins/schema-live-columns.js +10 -10
- package/dist/plugins/send-user-file.js +2 -1
- package/dist/plugins/session-birth.d.ts +37 -0
- package/dist/plugins/session-birth.js +38 -0
- package/dist/plugins/session-epoch-anchor.d.ts +40 -12
- package/dist/plugins/session-epoch-anchor.js +33 -11
- package/dist/plugins/session-ext-table.d.ts +98 -0
- package/dist/plugins/session-ext-table.js +134 -0
- package/dist/plugins/session-fork.d.ts +16 -2
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +22 -16
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +20 -7
- package/dist/plugins/session-row-sql.js +16 -8
- package/dist/plugins/session-run-rollup.d.ts +29 -0
- package/dist/plugins/session-run-rollup.js +40 -0
- package/dist/plugins/session-store-sql.d.ts +157 -0
- package/dist/plugins/session-store-sql.js +398 -0
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -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 -69
- package/dist/plugins/shared-memory-store-sql.js +15 -14
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +20 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +3 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/snapshot-bucket-presence.js +1 -1
- package/dist/plugins/sql-driver.d.ts +24 -8
- package/dist/plugins/sql-driver.js +43 -9
- package/dist/plugins/sql-errors.d.ts +35 -5
- package/dist/plugins/sql-errors.js +55 -3
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/store-backend.d.ts +114 -18
- package/dist/plugins/store-backend.js +340 -87
- package/dist/plugins/store-contracts.d.ts +97 -30
- package/dist/plugins/store-contracts.js +23 -1
- package/dist/plugins/store-fault.d.ts +28 -2
- package/dist/plugins/store-fault.js +20 -2
- package/dist/plugins/task-attachment-store.d.ts +21 -11
- package/dist/plugins/task-attachment-store.js +37 -19
- 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 +42 -39
- package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
- package/dist/plugins/web-search.js +5 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
- package/dist/plugins/workflow-run-store-sql.js +11 -5
- package/dist/principal-jwt.d.ts +4 -4
- package/dist/principal-jwt.js +20 -5
- package/dist/principal-shape.d.ts +41 -0
- package/dist/principal-shape.js +19 -0
- package/dist/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-face-posture.d.ts +6 -6
- package/dist/read-face-posture.js +2 -2
- package/dist/request-declaration-refusal.d.ts +35 -12
- package/dist/request-declaration-refusal.js +21 -9
- package/dist/request-form.d.ts +58 -0
- package/dist/request-form.js +72 -0
- package/dist/request-image-urls.d.ts +8 -2
- package/dist/request-image-urls.js +2 -1
- package/dist/request-images.d.ts +20 -0
- package/dist/request-images.js +59 -0
- package/dist/request-key-closure.d.ts +6 -7
- package/dist/request-key-closure.js +15 -2
- package/dist/request-value-closure.d.ts +5 -5
- package/dist/request-value-closure.js +1 -1
- package/dist/resource-suspend.d.ts +7 -16
- package/dist/resource-suspend.js +1 -1
- package/dist/retired-name-host-notice.d.ts +21 -0
- package/dist/retired-name-host-notice.js +12 -0
- package/dist/rule-entry-list.d.ts +2 -2
- package/dist/rule-entry-list.js +3 -4
- package/dist/rule-issue-reading.d.ts +58 -0
- package/dist/rule-issue-reading.js +14 -0
- package/dist/rules-consent.d.ts +46 -16
- package/dist/rules-consent.js +102 -53
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +109 -93
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +73 -44
- package/dist/runs.js +65 -43
- package/dist/runtime-caps-resolver.d.ts +36 -14
- package/dist/runtime-caps-resolver.js +31 -14
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -6
- package/dist/sealed-key-layout.js +5 -1
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +116 -26
- package/dist/security.d.ts +133 -161
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +27 -2
- package/dist/server-secret-env.d.ts +23 -5
- package/dist/server-secret-env.js +14 -4
- package/dist/service-version.d.ts +2 -1
- package/dist/service-version.js +2 -2
- package/dist/session-children-retire.d.ts +7 -5
- package/dist/session-children-retire.js +7 -2
- package/dist/session-deletion.d.ts +88 -0
- package/dist/session-deletion.js +8 -0
- package/dist/session-erase.d.ts +145 -0
- package/dist/session-erase.js +115 -0
- package/dist/session-error-wire.d.ts +6 -6
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +60 -10
- package/dist/session-incarnation.js +19 -2
- package/dist/session-policy-wire.d.ts +6 -3
- package/dist/session-policy-wire.js +11 -1
- package/dist/session-resident-background.d.ts +29 -47
- package/dist/session-resident-background.js +77 -8
- package/dist/session-row.d.ts +3 -2
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-sync-kernel.d.ts +1 -1
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +11 -2
- package/dist/session-workspace.js +5 -0
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-posture.d.ts +138 -21
- package/dist/store-posture.js +188 -3
- package/dist/stored-request-hooks-m20.d.ts +3 -2
- package/dist/stored-request-hooks-m20.js +21 -16
- package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
- package/dist/stores-sql/background-agent-store-sql.js +73 -20
- package/dist/stores-sql/blob-index-sql.d.ts +148 -0
- package/dist/stores-sql/blob-index-sql.js +154 -0
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +86 -71
- 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/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +30 -81
- package/dist/{plugins → stores-sql}/pg-session-storage.js +123 -244
- package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +197 -223
- package/dist/{plugins → stores-sql}/retention-store-sql.js +148 -207
- 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 +33 -11
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +65 -0
- package/dist/stores-sql/session-write-hooks.js +2 -0
- package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +14 -15
- package/dist/{plugins → stores-sql}/tidb-session-storage.js +22 -28
- package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +67 -138
- package/dist/{plugins → stores-sql}/tidb-session-store.js +130 -200
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +1 -1
- package/dist/stores-sql/windowed-session-storage.d.ts +61 -0
- package/dist/stores-sql/windowed-session-storage.js +70 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +7 -1
- package/dist/task-a2a.js +18 -17
- package/dist/task-cwd.d.ts +31 -3
- package/dist/task-cwd.js +25 -1
- package/dist/task-mcp.d.ts +11 -3
- package/dist/task-mcp.js +16 -19
- package/dist/task-settings.d.ts +23 -14
- package/dist/task-settings.js +35 -13
- package/dist/terminal.d.ts +25 -43
- package/dist/terminal.js +31 -11
- package/dist/tool-approval.d.ts +152 -137
- package/dist/tool-approval.js +199 -199
- package/dist/trace/core-keyset-guard.d.ts +22 -9
- package/dist/trace/core-vocab-wire.d.ts +95 -0
- package/dist/trace/core-vocab-wire.js +15 -0
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/exit-seat.d.ts +52 -4
- package/dist/trace/exit-seat.js +43 -36
- package/dist/trace/extension-call-face.d.ts +3 -2
- package/dist/trace/extension-call-face.js +3 -1
- package/dist/trace/ledger-events.d.ts +4 -7
- package/dist/trace/ledger-sink.d.ts +1 -30
- package/dist/trace/ledger-sink.js +0 -11
- package/dist/trace/model-segment.d.ts +5 -5
- package/dist/trace/model-segment.js +5 -5
- package/dist/trace/project.d.ts +88 -58
- package/dist/trace/project.js +64 -28
- package/dist/trace/redact.d.ts +124 -28
- package/dist/trace/redact.js +936 -328
- package/dist/trace/self-minted-wire.d.ts +750 -29
- package/dist/trace/self-minted-wire.js +262 -25
- 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 +43 -8
- package/dist/trace/wire-projection-faces.js +28 -3
- package/dist/unread-request-members.d.ts +66 -0
- package/dist/unread-request-members.js +41 -0
- package/dist/upstream-body.d.ts +23 -0
- package/dist/upstream-body.js +16 -0
- package/dist/url-refusal.d.ts +3 -3
- package/dist/url-refusal.js +11 -4
- package/dist/user-authored-text.d.ts +1 -1
- package/dist/user-input-ledger.d.ts +7 -8
- package/dist/user-input-ledger.js +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +6 -3
- package/dist/web-admin-client/apply-effective.js +33 -40
- package/dist/web-admin-client/apply-ledger.d.ts +16 -7
- package/dist/web-admin-client/apply-ledger.js +5 -2
- package/dist/web-admin-client/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 +6 -3
- package/dist/web-admin-client/center-request.js +17 -16
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -2
- package/dist/web-admin-client/entry-metadata.d.ts +8 -0
- package/dist/web-admin-client/entry-metadata.js +13 -0
- package/dist/web-admin-client/facade.d.ts +1 -1
- package/dist/web-admin-client/http-client.d.ts +2 -1
- package/dist/web-admin-client/http-client.js +40 -13
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/mcp-revocation.js +2 -1
- package/dist/web-admin-client/read-warnings.d.ts +1 -0
- package/dist/web-admin-client/read-warnings.js +1 -0
- package/dist/web-admin-client/restart-signal.js +13 -6
- package/dist/web-admin-client/skills-mcp.d.ts +22 -8
- package/dist/web-admin-client/skills-mcp.js +26 -21
- package/dist/web-admin-client/types.d.ts +35 -51
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/package.json +16 -12
- package/scripts/drain-check-local.mjs +118 -173
- package/scripts/drain-check.mysql.sql +20 -16
- package/scripts/drain-check.pg.sql +20 -16
- package/wire-changes/server@7.147.0.json +813 -0
- package/wire-changes/server@7.148.0.json +1517 -0
- package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
- package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
- package/dist/http/memory-layer-reply.d.ts +0 -30
- package/dist/http/memory-layer-reply.js +0 -24
- package/dist/lsp/e2b-bridge.d.ts +0 -57
- package/dist/lsp/e2b-bridge.js +0 -139
- package/dist/lsp/e2b-manager.d.ts +0 -93
- package/dist/lsp/e2b-manager.js +0 -178
- package/dist/lsp/lsp-frames.d.ts +0 -14
- package/dist/lsp/lsp-frames.js +0 -25
- package/dist/lsp/manager.d.ts +0 -129
- package/dist/lsp/manager.js +0 -127
- package/dist/lsp/types.d.ts +0 -12
- package/dist/lsp/types.js +0 -2
- package/dist/lsp/ws-transport.d.ts +0 -40
- package/dist/lsp/ws-transport.js +0 -210
|
@@ -25,8 +25,9 @@ export declare function buildMemorySyncEnabledFields(peer: string, scope: string
|
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* fetch transport(core `MemorySyncTransport` 的部署实现)。`peer` = {@link memorySyncPeerOf}(`url`)(建时铸一次;拒的地址在这里抛,一个请求都不发),
|
|
28
|
-
* `post` 打 `${peer}${path}`(core 传来的 path 以 `/` 开头);`token` 走 Authorization: Bearer(与中心侧
|
|
29
|
-
* 非 2xx throw(status +
|
|
28
|
+
* `post` 打 `${peer}${path}`(core 传来的 path 以 `/` 开头);`token` 走 Authorization: Bearer(与中心侧 gatedSubject 的 verified-principal 门对齐)。
|
|
29
|
+
* 非 2xx throw(status + 体长 —— 体的字节不进报错句,与配置中心拉取同一条律:摘录在座前切会把跨界的令牌切成脱敏器认不出的前缀,座后切又会因前面的凭据被压短而
|
|
30
|
+
* 越过原来的源界、带出词表不认的形;对端是本服务的 `MEMORY_SYNC_SERVE`,拒因在对端自己的运维行);2xx 返回解码后的 JSON(解码经上游读口,不是 JSON ⇒ 句子只带体长;形状校验在 core
|
|
30
31
|
* parseMemorySyncResponse,职责不重复)。`timeoutMs`(缺省 60s,AbortSignal.timeout)是活性保护:fire-and-forget 轮挂死会把 inflight 节流永久卡住
|
|
31
32
|
* (undici 默认 headers 超时 300s 太钝)。
|
|
32
33
|
*/
|
|
@@ -40,6 +41,8 @@ export declare function createMemorySyncTransport(opts: {
|
|
|
40
41
|
/** 一层的游标文件路径:引擎根 `memoryEngineDir`(= `RunnerDeps.memoryEngineDir` 的那一个值)下 `sync-cursors/<scope 摘要>.json`。一层一只,不随对端变、不随店变。
|
|
41
42
|
* 落在子目录里:与更早的根下一层文件名 `sync-cursor-<peer>.json` 的空间不相交。 */
|
|
42
43
|
export declare function memorySyncCursorPath(memoryEngineDir: string, scope: string): string;
|
|
44
|
+
/** 全部游标文件的父目录 `<引擎根>/sync-cursors`(游标路径与一次性迁移 M39 的名册同读这一只;缺省 File 记忆引擎根 = 数据根 ⇒ `<数据根>/sync-cursors`)。 */
|
|
45
|
+
export declare function memorySyncCursorDirFor(memoryEngineDir: string): string;
|
|
43
46
|
/**
|
|
44
47
|
* ⑦ 停驻层的出路(闭集;今天唯一成员)。`delete_cursor` = 删掉这一层的游标文件,下一轮从空基线重收敛。读面 `memorySync.parked[].wayOut` 与运维行同读这只词;
|
|
45
48
|
* 加一个词 ⇒ {@link wayOutSentence} 的穷尽 switch 编译红(句子先写好,词才上得了 wire)。
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { createHash
|
|
2
|
-
import {
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile, readdir, rename, rmdir, stat } from "node:fs/promises";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
|
-
import { carriesCredential, syncMemoryScope, } from "@sema-agent/core";
|
|
4
|
+
import { carriesCredential, ensureDir, syncMemoryScope, } from "@sema-agent/core";
|
|
5
5
|
import { replicationCovers } from "./memory-scope.js";
|
|
6
6
|
import { parseProjectLayerKey } from "./project-layer-key.js";
|
|
7
|
+
import { atomicWriteFileAsync } from "./plugins/owner-only-file-mode.js";
|
|
7
8
|
import { ONE_TIME_MIGRATIONS, migrationWindowOpen } from "./plugins/one-time-migrations.js";
|
|
8
9
|
import { buildMemorySyncIdentityBootRefusal, readMemorySyncIdentity } from "./memory-sync-identity.js";
|
|
9
10
|
import { buildDisplaySafeUrl } from "./trace/redact.js";
|
|
11
|
+
import { createEgressFetch } from "./egress-redirect.js";
|
|
10
12
|
import { errorText } from "./observability/err-text.js";
|
|
13
|
+
import { buildBodyWithheldNote, parseUpstreamJson } from "./upstream-body.js";
|
|
11
14
|
export function memorySyncPeerOf(url) {
|
|
12
15
|
const r = readMemorySyncIdentity(url);
|
|
13
16
|
if ("flaw" in r) {
|
|
@@ -21,7 +24,8 @@ export function buildMemorySyncEnabledFields(peer, scope, cursorPath) {
|
|
|
21
24
|
}
|
|
22
25
|
export function createMemorySyncTransport(opts) {
|
|
23
26
|
const peer = memorySyncPeerOf(opts.url);
|
|
24
|
-
const
|
|
27
|
+
const injected = opts.fetchImpl;
|
|
28
|
+
const fetchImpl = createEgressFetch("declare the final address as MEMORY_SYNC_URL", injected === undefined ? undefined : (input, init) => injected(typeof input === "string" ? input : input instanceof URL ? input.href : input.url, init ?? {}));
|
|
25
29
|
const timeoutMs = opts.timeoutMs ?? 60_000;
|
|
26
30
|
return Object.freeze({
|
|
27
31
|
peer,
|
|
@@ -34,8 +38,8 @@ export function createMemorySyncTransport(opts) {
|
|
|
34
38
|
});
|
|
35
39
|
const text = await res.text();
|
|
36
40
|
if (!res.ok)
|
|
37
|
-
throw new Error(`memory sync POST ${path}: HTTP ${res.status} ${text
|
|
38
|
-
return
|
|
41
|
+
throw new Error(`memory sync POST ${path}: HTTP ${res.status} ${buildBodyWithheldNote(text)}`);
|
|
42
|
+
return parseUpstreamJson(text);
|
|
39
43
|
},
|
|
40
44
|
});
|
|
41
45
|
}
|
|
@@ -44,7 +48,10 @@ function scopeDigest(scope) {
|
|
|
44
48
|
return createHash("sha256").update(scope, "utf8").digest("hex").slice(0, 32);
|
|
45
49
|
}
|
|
46
50
|
export function memorySyncCursorPath(memoryEngineDir, scope) {
|
|
47
|
-
return join(memoryEngineDir,
|
|
51
|
+
return join(memorySyncCursorDirFor(memoryEngineDir), `${scopeDigest(scope)}.json`);
|
|
52
|
+
}
|
|
53
|
+
export function memorySyncCursorDirFor(memoryEngineDir) {
|
|
54
|
+
return join(memoryEngineDir, SYNC_CURSOR_DIR);
|
|
48
55
|
}
|
|
49
56
|
const CURSOR_AXES = { scope: true, peer: true, store: true, incarnation: true };
|
|
50
57
|
const CURSOR_FOUND = { absent: true, other: true };
|
|
@@ -142,10 +149,8 @@ async function loadLayerBaseline(path, scope) {
|
|
|
142
149
|
return { kind: "cursor", cursor };
|
|
143
150
|
}
|
|
144
151
|
async function saveCursor(path, cursor) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
await writeFile(tmp, JSON.stringify(cursor), "utf8");
|
|
148
|
-
await rename(tmp, path);
|
|
152
|
+
ensureDir(dirname(path));
|
|
153
|
+
await atomicWriteFileAsync(path, JSON.stringify(cursor), { durability: "best-effort" });
|
|
149
154
|
}
|
|
150
155
|
const LEGACY_PEER_SEGMENT = "central";
|
|
151
156
|
const LEGACY_ROOT_CURSOR_FILE = "sync-cursor-central.json";
|
|
@@ -191,7 +196,7 @@ export async function relocateSyncCursorsM31(memoryEngineDir, log, opts) {
|
|
|
191
196
|
log.warn("memory_sync_cursor_not_relocated", { path: from, to, note: "this layer already has a cursor at its path, so the file written by an earlier version stays where it is and no round reads it; delete it" });
|
|
192
197
|
return;
|
|
193
198
|
}
|
|
194
|
-
|
|
199
|
+
ensureDir(dirname(to));
|
|
195
200
|
try {
|
|
196
201
|
await rename(from, to);
|
|
197
202
|
}
|
|
@@ -203,7 +208,7 @@ export async function relocateSyncCursorsM31(memoryEngineDir, log, opts) {
|
|
|
203
208
|
moved += 1;
|
|
204
209
|
log.info("memory_sync_cursor_relocated", { from, to });
|
|
205
210
|
};
|
|
206
|
-
const legacyDir = join(memoryEngineDir,
|
|
211
|
+
const legacyDir = join(memorySyncCursorDirFor(memoryEngineDir), LEGACY_PEER_SEGMENT);
|
|
207
212
|
let names = [];
|
|
208
213
|
try {
|
|
209
214
|
names = await readdir(legacyDir);
|
|
@@ -214,7 +219,7 @@ export async function relocateSyncCursorsM31(memoryEngineDir, log, opts) {
|
|
|
214
219
|
}
|
|
215
220
|
for (const name of [...names].sort()) {
|
|
216
221
|
if (/^[0-9a-f]{32}\.json$/.test(name))
|
|
217
|
-
await move(join(legacyDir, name), join(memoryEngineDir,
|
|
222
|
+
await move(join(legacyDir, name), join(memorySyncCursorDirFor(memoryEngineDir), name));
|
|
218
223
|
}
|
|
219
224
|
if (names.length > 0) {
|
|
220
225
|
try {
|
package/dist/memory-sync.js
CHANGED
|
@@ -219,7 +219,7 @@ export async function performMemorySync(backend, sync, scope, req, now = Date.no
|
|
|
219
219
|
const patches = [
|
|
220
220
|
...plan.pull.map((e) => {
|
|
221
221
|
const base = req.baseRevs[e.id];
|
|
222
|
-
return base !== undefined ? { op: "update", id: e.id, entry: e, baseRev: base } : { op: "add", id: e.id, entry: e };
|
|
222
|
+
return base !== undefined ? { op: "update", id: e.id, entry: e, baseRev: base } : { op: "add", id: e.id, entry: e, guard: "absent" };
|
|
223
223
|
}),
|
|
224
224
|
...plan.deleteLocal.map((d) => ({ op: "delete", id: d.id, baseRev: d.baseRev })),
|
|
225
225
|
];
|
package/dist/model-compat.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `Model.compat` ——
|
|
3
|
-
*
|
|
2
|
+
* `Model.compat` —— 一只模型对**它那条线路**的兼容声明(声明面 settings-schema 1.10.0 `ModelEntry.compat`,契约包解析透明、形归本服务):
|
|
3
|
+
* openai-completions 条目读 core `OpenAICompletionsCompat`,anthropic-messages 条目读 core `AnthropicMessagesCompat`(**按线路读**,
|
|
4
|
+
* 线路 = 条目的 `api`:core 的 `Model.compat` 按 `TApi` 分型,契约 `ModelEntry` 强制 `provider:"anthropic"` ⟺ `api:"anthropic-messages"`)。
|
|
5
|
+
* 本模块是**两条腿共用的唯一判据点 + 唯一铸点**,
|
|
4
6
|
* 与 `toolFaces` 的读法(引擎根导出的 `readToolFaces`,`task-mcp.ts` / `skills-mcp.ts` 两腿同问)同一个「判据单点、多腿一致」的形。
|
|
5
7
|
*
|
|
6
8
|
* ## 它治的病(1.10.0 CHANGELOG + core 型面顶注双向亲读)
|
|
@@ -11,10 +13,10 @@
|
|
|
11
13
|
* 真需求 = vLLM / Qwen 类**缺省开思考**的网关:关思考只能靠 `chat_template_kwargs.enable_thinking=false`
|
|
12
14
|
* (`thinkingFormat: "qwen-chat-template"`),否则 auto 档每一轮都白烧一段思考。
|
|
13
15
|
*
|
|
14
|
-
* ##
|
|
15
|
-
* `
|
|
16
|
-
* `COMPAT_KEY_READERS` 是 `{ [K in keyof Required<
|
|
17
|
-
* core
|
|
16
|
+
* ## 对表全部**从 core 的型面铸**,本仓一个词都不枚举
|
|
17
|
+
* `THINKING_TIER_TABLE` / `MODEL_THINKING_LEVEL_TABLE` / `THINKING_FORMAT_TABLE` / `MAX_TOKENS_FIELD_TABLE` / `THINKING_MODE_TABLE` 都是 `Record<闭集词, true>`,
|
|
18
|
+
* `COMPAT_KEY_READERS` 是 `{ [A in 线路]: { [K in keyof Required<Model<A>["compat"]>]: 读器 } }` 的**映射型**(线路 = 契约 `ModelEntry.api` 的闭集):
|
|
19
|
+
* core 加词/删词、加键/删键,或契约加一条线路,表当场 tsc 红(`MODEL_DEGRADE_ON` 的 `Set<DegradeReason>` 同款纪律)。
|
|
18
20
|
* 映射型这一步是刻意的 —— 只钉「键集相等」会留下一个洞:core 加一键、有人把它补进白名单却忘了写读器,
|
|
19
21
|
* 于是这个键被**允许但不读** = 静默丢。读器与键集是**同一张表**,那个洞在结构上不存在。
|
|
20
22
|
*
|
|
@@ -27,20 +29,35 @@
|
|
|
27
29
|
* 反方向(整只模型不进)的代价则不成比例:一个拼错的 `thinkingFormat` 会让这只模型从目录里消失,
|
|
28
30
|
* 用户面直接是 `request.unknown_reference`。
|
|
29
31
|
*
|
|
30
|
-
*
|
|
32
|
+
* 判形**整只判**(每条线路内):任一键不合 —— 含写了另一条线路的键 —— ⇒ 整只声明不收(和 `toolFaces` 每只工具「applied whole or not at all」
|
|
31
33
|
* 同律)。留下好的那几键 = 让运维以为整条声明生效了,而实际发出去的请求是半张脸。
|
|
32
34
|
*/
|
|
33
|
-
import type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export type
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
import { type Model } from "@sema-agent/core";
|
|
36
|
+
import type { ModelEntry } from "@sema-agent/settings-schema";
|
|
37
|
+
/** 目录条目的线路闭集 = 契约 `ModelEntry.api`(契约加一条线路 ⇒ 读器表缺一行 ⇒ tsc 红)。 */
|
|
38
|
+
export type CatalogApi = ModelEntry["api"];
|
|
39
|
+
/** 一条线路的 compat 型 —— core 的 index 没有按名导出它们,从 `Model` 的**型面**取(`Model<TApi>` 的 `compat` 按 api 分叉)。这不是抄一份结构,是引用同一个型。 */
|
|
40
|
+
export type CompatOf<A extends CatalogApi> = NonNullable<Model<A>["compat"]>;
|
|
41
|
+
/** core `OpenAICompletionsCompat`。 */
|
|
42
|
+
export type OpenAICompletionsCompat = CompatOf<"openai-completions">;
|
|
43
|
+
/** core `AnthropicMessagesCompat`。 */
|
|
44
|
+
export type AnthropicMessagesCompat = CompatOf<"anthropic-messages">;
|
|
45
|
+
/** 六档思考**梯**(core `ThinkingLevel`:一个端点吃得下哪几档的 effort 梯子)。型取自梯子座本身 —— `compat.reasoningEffortLevels`
|
|
46
|
+
* (anthropic 线路的 `effortLevels` 同型)—— 而不是模型缺省档座:core 7.66.0 [ref] HB-1 起两座分家,缺省档多一档 `off`,梯子仍是六档
|
|
47
|
+
* (`off` 永远不是梯子上的一级)。`MODEL_REASONING_EFFORT_LEVELS` / `compat.reasoningEffortLevels` / `compat.effortLevels` 共用**这一张**表;
|
|
48
|
+
* 上游加一档而这里不补 ⇒ 编译红([ref] 件⑤ 起的锁步姿势)。 */
|
|
49
|
+
export type ThinkingTier = NonNullable<OpenAICompletionsCompat["reasoningEffortLevels"]>[number];
|
|
50
|
+
/** 六档梯闭集(有序:低→高,取自上表的书写序),梯子两根旋钮的拒因文案与读器的单一真源。 */
|
|
51
|
+
export declare const THINKING_LEVELS: readonly ThinkingTier[];
|
|
52
|
+
export declare const isThinkingTier: (w: unknown) => w is ThinkingTier;
|
|
53
|
+
/** 模型**缺省档**(core `ModelThinkingLevel` = `off` + 六档;`Model.defaultThinking` 的型):请求与角色都没点档时这只模型的请求走哪一档,
|
|
54
|
+
* `off` = 缺省关(引擎发线路上的显式关),**不是**「没有缺省」—— 没有缺省 = 不铸键(core 7.66.0 [ref])。表 = 梯子六档 + `off`(展开同一张梯表,不写第二份);
|
|
55
|
+
* core 给缺省档座加 / 删一词而这里不跟 ⇒ 编译红。 */
|
|
40
56
|
export type ModelThinkingLevel = NonNullable<Model["defaultThinking"]>;
|
|
41
|
-
/**
|
|
42
|
-
export declare const
|
|
43
|
-
|
|
57
|
+
/** 七档缺省闭集(六档梯在前、`off` 在末,取自上表的书写序):`MODEL_DEFAULT_THINKING` 的目录 `enumValues` 与拒因文案的单一真源。 */
|
|
58
|
+
export declare const MODEL_THINKING_LEVELS: readonly ModelThinkingLevel[];
|
|
59
|
+
/** 七档判词 = core 包根的 `isThinkingLevel`(引擎自己判这七档的那一只;上表只留作有序列表与编译期锁步,不另写第二只判词)。 */
|
|
60
|
+
export declare const isModelThinkingLevel: (w: unknown) => w is ModelThinkingLevel;
|
|
44
61
|
/** `thinkingFormat` 七词闭集(core:openai / openrouter / deepseek / together / zai / qwen / qwen-chat-template)。 */
|
|
45
62
|
export type ModelThinkingFormat = NonNullable<OpenAICompletionsCompat["thinkingFormat"]>;
|
|
46
63
|
export declare const THINKING_FORMATS: readonly ModelThinkingFormat[];
|
|
@@ -48,34 +65,40 @@ export declare const isThinkingFormat: (w: unknown) => w is ModelThinkingFormat;
|
|
|
48
65
|
/** `maxTokensField` 两词闭集(缺席 ⇒ core 按模型 id 推断,见 `inferMaxTokensField`)。 */
|
|
49
66
|
export type ModelMaxTokensField = NonNullable<OpenAICompletionsCompat["maxTokensField"]>;
|
|
50
67
|
export declare const MAX_TOKENS_FIELDS: readonly ModelMaxTokensField[];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export declare const
|
|
68
|
+
/** anthropic 线路 `thinkingMode` 两词闭集(core:`budget` = `thinking:{type:"enabled",budget_tokens}`;`adaptive` = `thinking:{type:"adaptive"}`、无 budget、关不掉)。 */
|
|
69
|
+
export type AnthropicThinkingMode = NonNullable<AnthropicMessagesCompat["thinkingMode"]>;
|
|
70
|
+
export declare const ANTHROPIC_THINKING_MODES: readonly AnthropicThinkingMode[];
|
|
71
|
+
type CompatKey<A extends CatalogApi> = keyof Required<CompatOf<A>>;
|
|
72
|
+
/** 每条线路的键闭集(书写序取自上表),未知键拒因文案与铸点遍历的单一真源。 */
|
|
73
|
+
export declare const MODEL_COMPAT_KEYS: {
|
|
74
|
+
readonly [A in CatalogApi]: readonly CompatKey<A>[];
|
|
75
|
+
};
|
|
54
76
|
/**
|
|
55
77
|
* 一条目录条目的 `compat` 判形结果:
|
|
56
78
|
* · `{ ok: true, compat }` —— 合形(`compat` 缺席 = 这条条目没有声明,或声明了一个**空**对象:
|
|
57
79
|
* 两者对 core 同义,都不铸键);
|
|
58
80
|
* · `{ ok: false, issue }` —— 判不出形,调用方**整只丢**这条声明并留一句 warn(见模块头注)。
|
|
59
|
-
* `issue`
|
|
81
|
+
* `issue` 只带线路、键名与哪一段不合,**不带值** —— 与 `source` / `toolFaces` 同一条留痕纪律。
|
|
60
82
|
*/
|
|
61
|
-
export type ModelCompatRead = {
|
|
83
|
+
export type ModelCompatRead<A extends CatalogApi> = {
|
|
62
84
|
ok: true;
|
|
63
|
-
compat?:
|
|
85
|
+
compat?: CompatOf<A>;
|
|
64
86
|
} | {
|
|
65
87
|
ok: false;
|
|
66
88
|
issue: string;
|
|
67
89
|
};
|
|
68
|
-
/** 从任一腿的原始条目里读出 `compat`
|
|
69
|
-
export declare function readModelCompat(v: unknown): ModelCompatRead
|
|
90
|
+
/** 从任一腿的原始条目里读出 `compat`(按条目的线路)—— **本地 config.d 腿与 center 腿共用的唯一判据点**。 */
|
|
91
|
+
export declare function readModelCompat<A extends CatalogApi>(api: A, v: unknown): ModelCompatRead<A>;
|
|
70
92
|
/**
|
|
71
|
-
* `Model.compat` 的**唯一铸点**(env
|
|
93
|
+
* `Model.compat` 的**唯一铸点**(env 腿与目录腿都经这里;按线路)。层序 = 优先级,**前层逐键赢、后层补缺席**
|
|
72
94
|
* (BL-8:目录条目声明 ?? env 缺省 —— 不是整只替换,否则一条只写了 `thinkingFormat` 的目录条目会把
|
|
73
95
|
* 部署级的 `MODEL_REASONING_EFFORT_LEVELS` 静默吃掉,正是 `contextWindow`/`maxTokens` 那一族的老病)。
|
|
96
|
+
* 层必须是同一条线路的声明(调用方只把同线路的 env 缺省叠进来 —— 见 `toModel`)。
|
|
74
97
|
*
|
|
75
98
|
* 归一两条(两腿因此对同一个空值给出同一个下场):值 `undefined` = 这一层没声明这一键;
|
|
76
|
-
* `reasoningEffortLevels`
|
|
99
|
+
* 数组值为**空表** = 没声明这一键(`reasoningEffortLevels` / `effortLevels`;env 腿的空 CSV 与目录腿的 `[]` 同义)。
|
|
77
100
|
* 全空 ⇒ 回 `undefined` = **不铸这个键**(缺席 = core 走自己的推断 = 今日行为)。
|
|
78
101
|
*/
|
|
79
|
-
export declare function buildModelCompat(...layers: ReadonlyArray<
|
|
102
|
+
export declare function buildModelCompat<A extends CatalogApi>(api: A, ...layers: ReadonlyArray<CompatOf<A> | undefined>): CompatOf<A> | undefined;
|
|
80
103
|
export {};
|
|
81
104
|
//# sourceMappingURL=model-compat.d.ts.map
|
package/dist/model-compat.js
CHANGED
|
@@ -1,52 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { isThinkingLevel } from "@sema-agent/core";
|
|
2
|
+
const THINKING_TIER_TABLE = { minimal: true, low: true, medium: true, high: true, xhigh: true, max: true };
|
|
3
|
+
export const THINKING_LEVELS = Object.keys(THINKING_TIER_TABLE);
|
|
3
4
|
export const isThinkingTier = (w) => typeof w === "string" && THINKING_LEVELS.includes(w);
|
|
5
|
+
const MODEL_THINKING_LEVEL_TABLE = { ...THINKING_TIER_TABLE, off: true };
|
|
6
|
+
export const MODEL_THINKING_LEVELS = Object.keys(MODEL_THINKING_LEVEL_TABLE);
|
|
7
|
+
export const isModelThinkingLevel = (w) => isThinkingLevel(w);
|
|
4
8
|
const THINKING_FORMAT_TABLE = { openai: true, openrouter: true, deepseek: true, together: true, zai: true, qwen: true, "qwen-chat-template": true };
|
|
5
9
|
export const THINKING_FORMATS = Object.keys(THINKING_FORMAT_TABLE);
|
|
6
10
|
export const isThinkingFormat = (w) => typeof w === "string" && THINKING_FORMATS.includes(w);
|
|
7
11
|
const MAX_TOKENS_FIELD_TABLE = { max_tokens: true, max_completion_tokens: true };
|
|
8
12
|
export const MAX_TOKENS_FIELDS = Object.keys(MAX_TOKENS_FIELD_TABLE);
|
|
13
|
+
const THINKING_MODE_TABLE = { budget: true, adaptive: true };
|
|
14
|
+
export const ANTHROPIC_THINKING_MODES = Object.keys(THINKING_MODE_TABLE);
|
|
15
|
+
const readBoolean = (v) => (typeof v === "boolean" ? v : undefined);
|
|
16
|
+
const readLadder = (v) => (Array.isArray(v) && v.every(isThinkingTier) ? v : undefined);
|
|
9
17
|
const COMPAT_KEY_READERS = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
"openai-completions": {
|
|
19
|
+
supportsReasoningEffort: readBoolean,
|
|
20
|
+
requiresReasoningContentOnAssistantMessages: readBoolean,
|
|
21
|
+
maxTokensField: (v) => (typeof v === "string" && MAX_TOKENS_FIELDS.includes(v) ? v : undefined),
|
|
22
|
+
thinkingFormat: (v) => (isThinkingFormat(v) ? v : undefined),
|
|
23
|
+
reasoningEffortLevels: readLadder,
|
|
24
|
+
},
|
|
25
|
+
"anthropic-messages": {
|
|
26
|
+
thinkingMode: (v) => (typeof v === "string" && ANTHROPIC_THINKING_MODES.includes(v) ? v : undefined),
|
|
27
|
+
effortLevels: readLadder,
|
|
28
|
+
supportsTemperature: readBoolean,
|
|
29
|
+
contextManagement: readBoolean,
|
|
30
|
+
interleavedThinking: readBoolean,
|
|
31
|
+
},
|
|
15
32
|
};
|
|
16
|
-
export const MODEL_COMPAT_KEYS =
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
export const MODEL_COMPAT_KEYS = {
|
|
34
|
+
"openai-completions": Object.keys(COMPAT_KEY_READERS["openai-completions"]),
|
|
35
|
+
"anthropic-messages": Object.keys(COMPAT_KEY_READERS["anthropic-messages"]),
|
|
36
|
+
};
|
|
37
|
+
const isKeyOf = (table, k) => Object.hasOwn(table, k);
|
|
38
|
+
export function readModelCompat(api, v) {
|
|
19
39
|
if (v === undefined)
|
|
20
40
|
return { ok: true };
|
|
21
41
|
if (v === null || typeof v !== "object" || Array.isArray(v))
|
|
22
42
|
return { ok: false, issue: `compat is ${v === null ? "null" : Array.isArray(v) ? "an array" : typeof v}, not an object of wire-compat keys` };
|
|
43
|
+
return COMPAT_LEGS[api].read(v);
|
|
44
|
+
}
|
|
45
|
+
function readCompatWith(api, readers, v) {
|
|
23
46
|
const out = {};
|
|
24
47
|
for (const [k, raw] of Object.entries(v)) {
|
|
25
|
-
if (!
|
|
26
|
-
return { ok: false, issue: `unknown key ${JSON.stringify(k)} (valid: ${
|
|
27
|
-
const read =
|
|
48
|
+
if (!isKeyOf(readers, k))
|
|
49
|
+
return { ok: false, issue: `unknown key ${JSON.stringify(k)} for an ${api} entry (valid: ${Object.keys(readers).join(" | ")})` };
|
|
50
|
+
const read = readers[k](raw);
|
|
28
51
|
if (read === undefined)
|
|
29
|
-
return { ok: false, issue: `key ${JSON.stringify(k)} does not fit the wire-compat shape` };
|
|
52
|
+
return { ok: false, issue: `key ${JSON.stringify(k)} does not fit the ${api} wire-compat shape` };
|
|
30
53
|
out[k] = read;
|
|
31
54
|
}
|
|
32
55
|
return Object.keys(out).length > 0 ? { ok: true, compat: out } : { ok: true };
|
|
33
56
|
}
|
|
34
|
-
export function buildModelCompat(...layers) {
|
|
57
|
+
export function buildModelCompat(api, ...layers) {
|
|
58
|
+
return COMPAT_LEGS[api].build(layers);
|
|
59
|
+
}
|
|
60
|
+
const declaresKey = (v) => v !== undefined && !(Array.isArray(v) && v.length === 0);
|
|
61
|
+
function buildCompatWith(keys, layers) {
|
|
35
62
|
const out = {};
|
|
36
63
|
for (const layer of layers) {
|
|
37
64
|
if (layer === undefined)
|
|
38
65
|
continue;
|
|
39
|
-
for (const k of
|
|
40
|
-
if (k
|
|
66
|
+
for (const k of keys) {
|
|
67
|
+
if (Object.hasOwn(out, k) || !declaresKey(layer[k]))
|
|
41
68
|
continue;
|
|
42
|
-
|
|
43
|
-
if (v === undefined)
|
|
44
|
-
continue;
|
|
45
|
-
if (k === "reasoningEffortLevels" && Array.isArray(v) && v.length === 0)
|
|
46
|
-
continue;
|
|
47
|
-
out[k] = v;
|
|
69
|
+
out[k] = layer[k];
|
|
48
70
|
}
|
|
49
71
|
}
|
|
50
72
|
return Object.keys(out).length > 0 ? out : undefined;
|
|
51
73
|
}
|
|
74
|
+
const COMPAT_LEGS = {
|
|
75
|
+
"openai-completions": {
|
|
76
|
+
read: (v) => readCompatWith("openai-completions", COMPAT_KEY_READERS["openai-completions"], v),
|
|
77
|
+
build: (layers) => buildCompatWith(MODEL_COMPAT_KEYS["openai-completions"], layers),
|
|
78
|
+
},
|
|
79
|
+
"anthropic-messages": {
|
|
80
|
+
read: (v) => readCompatWith("anthropic-messages", COMPAT_KEY_READERS["anthropic-messages"], v),
|
|
81
|
+
build: (layers) => buildCompatWith(MODEL_COMPAT_KEYS["anthropic-messages"], layers),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
52
84
|
//# sourceMappingURL=model-compat.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The window this server ASSUMES for a model whose context window nobody declared — ONE spelling of the number.
|
|
3
|
+
*
|
|
4
|
+
* Three readers fall back to it and nothing else may carry a copy: the env leg (`config.ts`: `MODEL_CONTEXT_WINDOW` unset ⇒ this value,
|
|
5
|
+
* and the `MODEL_MAX_TOKENS` default `min(32000, window)` reads the SAME resolved window), the center leg (`web-admin-client/apply-effective.ts`:
|
|
6
|
+
* `entry.contextWindow ?? env model's window ?? this value`) and the config catalog's default note (`config-catalog.ts`). A literal copied
|
|
7
|
+
* into any of them is a second source that drifts the day the assumption changes — a center roster would then assume one window while
|
|
8
|
+
* the env model assumes another, and the operator-facing default note would name a third.
|
|
9
|
+
*
|
|
10
|
+
* This is a conservative CEILING GUESS, not a measurement: the engine needs a window to size its compaction trigger and the tool-schema
|
|
11
|
+
* defer threshold, and an undeclared window must never be read optimistically — so every model that reaches the engine carries SOME window,
|
|
12
|
+
* declared or this one (a catalog entry may omit `contextWindow`; the readers above fill it). Whether the value is conservative for a
|
|
13
|
+
* given model is a per-model question this constant does not answer.
|
|
14
|
+
*
|
|
15
|
+
* Pure leaf: no imports.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ASSUMED_CONTEXT_WINDOW = 262144;
|
|
18
|
+
//# sourceMappingURL=model-context-window.d.ts.map
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [ref](7.108.0;cli [ref] [ref],server [ref] ② 认领)—— 模型目录条目 `headers`:**部署 ↔ 供应商**的附加请求头。
|
|
3
|
+
* 本模块是它的**唯一判据点**(白名单 + 形)与**唯一铸点**(铸进 core `Model.headers` 的那张袋)。
|
|
4
|
+
*
|
|
5
|
+
* ## 病
|
|
6
|
+
* core 的三只一方 brain 早有附加头的座(构造项 `headers` 与 per-model 的 `Model.headers`,三只 adapter 都按
|
|
7
|
+
* `mergeHeaders(model.headers, config.headers, options.headers)` 合并;anthropic 腿再把 `anthropic-beta` 与它自己的 beta
|
|
8
|
+
* 按 core [ref] 的读并合并律并成一个头),本仓零读点 ⇒ 壳的 `--betas` / `ANTHROPIC_BETAS`(开 1M 上下文等 beta)进不了引擎发出的请求。
|
|
9
|
+
*
|
|
10
|
+
* ## 座位:per-model(`Model.headers`),不是 per-route(brain 构造项 `headers`)
|
|
11
|
+
* 目录条目是**一只模型**的声明;brain 构造项的那个袋是**整条路由**共享的(一台部署一只 anthropic brain,所有 anthropic 条目都走它)——
|
|
12
|
+
* 放在那里会把一条条目的 beta 发给同路由的每一只模型。core 的 per-model 座就是为这件事开的(`Model.headers`,core 型面注:
|
|
13
|
+
* 「Cannot override auth / content-type / version」—— 鉴权头与结构头在合并之后由 brain 硬锁)。
|
|
14
|
+
*
|
|
15
|
+
* ## 白名单:闭集,每个名字带「读它的线路」({@link CATALOG_ENTRY_HEADER_LANES})
|
|
16
|
+
* · 名字闭集 —— 表外一律拒。这不是洁癖,是**凭据轴**:`Model.headers` 上的 `authorization` / `x-api-key` 会被 core 的配对法读成
|
|
17
|
+
* per-model 凭据(「构造即配对」,off-root 也放行),等于在托管钥匙(`sealedApiKey` / `apiKeyEnv`)之外开一条明文凭据的路;
|
|
18
|
+
* 路由 / 追踪类头同理是部署的事,要一条一条想清楚再进表。
|
|
19
|
+
* · 只认**规范拼写**(小写):HTTP 头名大小写不敏感,两种拼法并存 = 同一只袋里两个写者;`Anthropic-Beta` 按表外拒(拒句给出规范拼写)。
|
|
20
|
+
* · 名字带线路:`anthropic-beta` 只有 Anthropic Messages 线路读(`api: "anthropic-messages"`)。声明在不读它的条目上 ⇒ 拒 ——
|
|
21
|
+
* 否则运维以为开了 1M 上下文、请求发出去什么都没变(一个只声明不生效的旋钮,正是本仓 `model_compat_dropped` 那一族立案的病)。
|
|
22
|
+
* · 值:可见 ASCII(首尾非空白,中间可有空格),≤ {@link MAX_HEADER_VALUE_CHARS} —— CR / LF / NUL 这类会让传输层在每次请求时才抛的值
|
|
23
|
+
* 在配置期就拒;值**逐字**透传(不改大小写、不去重 —— 合并是 core 的事)。
|
|
24
|
+
*
|
|
25
|
+
* ## 坏声明的方向:条目整条不可用(`config.model_entry_invalid`),不是「丢头、条目照常」
|
|
26
|
+
* 与 `compat` 的降级通道刻意分歧:本座一半是凭据轴(表外名字里有鉴权头),另一半是「运维以为生效了」—— 丢头照常服务正是修前的病形。
|
|
27
|
+
* 执法点 = [ref] 的逐条判据 `judgeCatalogEntry`(同一个码、同一条 warn、同一条「显式选中它 ⇒ `request.model_unavailable`」的路),
|
|
28
|
+
* 其余条目照常服务。拒因与 warn **只回显名字**(过 {@link displayHeaderName}),从不回显值。
|
|
29
|
+
*
|
|
30
|
+
* ## 两条读腿今天到不了这里(候裁「settings-schema `ModelEntry` 加 `headers`」,[ref] 字段归 server 自持)
|
|
31
|
+
* settings-schema 6.3.0 的 `ModelEntry` 没有这个键 ⇒ 远端 `readEffectiveWire` 与本地 `FileConfigStore` 都 strip 它(并报未知键)。
|
|
32
|
+
* 本模块服务的输入今天只有绕过读腿的那几条(盘上 LKG / 手写 effective);字段进 schema 之日,`config-provider.ts` 的本地投影加一行即通,
|
|
33
|
+
* `test/catalog-entry-headers.test.ts` 的 🚧 [ref]-schema 两格翻红逼销账。**词表不在 schema 里另抄一份**:schema 的那个键应当是
|
|
34
|
+
* 承载形(与 `compat` 同一种 parse-transparent + 自由形安全判),判据仍是本模块这一处 —— 或者整张表搬进 schema、本仓 import;
|
|
35
|
+
* 二选一候裁,不许两处各有一份。
|
|
36
|
+
*
|
|
37
|
+
* 依赖纪律:叶(只 type-import core、值引 `trace/redact.ts` 的名字回显尺)。
|
|
38
|
+
*/
|
|
39
|
+
import type { Model } from "@sema-agent/core";
|
|
40
|
+
/** 条目的线路词(core `Model["api"]`,不手抄)。 */
|
|
41
|
+
type ModelApi = Model["api"];
|
|
1
42
|
/**
|
|
2
43
|
* 白名单 = 名字 → 读它的线路(闭集;**加一个名字 = 加一行并写明哪条线路读它、为什么是部署的事**)。
|
|
3
44
|
* `anthropic-beta`:Anthropic Messages 的 beta 开关(逗号分隔的 beta 名;core anthropic 腿会把自己的 beta 并进同一个头)。
|
|
@@ -28,17 +69,18 @@ export type CatalogEntryHeadersVerdict = {
|
|
|
28
69
|
readonly issue: string;
|
|
29
70
|
};
|
|
30
71
|
/**
|
|
31
|
-
* **唯一判据**:条目的 `headers`
|
|
32
|
-
*
|
|
72
|
+
* **唯一判据**:条目的 `headers`(`unknown`:承载形,不信类型)+ 条目的线路词(`api`)—— 两者都取判官那一次 settings-schema 解析的读数
|
|
73
|
+
* (缺席的 `api` 即 schema 的缺省),判据与铸点读同一只值,见 `judgeCatalogEntry`。
|
|
33
74
|
* 整只判:任一名字 / 值不合 ⇒ 整只不收(留下好的那几个 = 让运维以为整袋生效了)。坏字段逐个列出(`headers.<名>`)。
|
|
34
75
|
*/
|
|
35
|
-
export declare function readCatalogEntryHeaders(raw: unknown, api:
|
|
76
|
+
export declare function readCatalogEntryHeaders(raw: unknown, api: ModelApi): CatalogEntryHeadersVerdict;
|
|
36
77
|
/**
|
|
37
78
|
* **唯一铸点**(`toModel` 调):判过的袋 → `Model.headers` 的键。缺席 ⇒ 不铸键(一个 `undefined` 值的键也不铸:
|
|
38
79
|
* 缺席只有一种拼法)。判不过 ⇒ **抛**:到这里的条目已经过 [ref] 逐条判据(判不过的进 `modelRefusals`、到不了 `toModel`),
|
|
39
80
|
* 抛 = 两处判据分叉了,stage 整候选拒、响亮,不静默丢头。
|
|
40
81
|
*/
|
|
41
|
-
export declare function buildModelHeadersKey(entryName: string, raw: unknown, api:
|
|
82
|
+
export declare function buildModelHeadersKey(entryName: string, raw: unknown, api: ModelApi): {
|
|
42
83
|
headers?: Record<string, string>;
|
|
43
84
|
};
|
|
85
|
+
export {};
|
|
44
86
|
//# sourceMappingURL=model-entry-headers.d.ts.map
|
|
@@ -35,9 +35,9 @@ export function readCatalogEntryHeaders(raw, api) {
|
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
37
|
const lanes = CATALOG_ENTRY_HEADER_LANES[name];
|
|
38
|
-
if (
|
|
38
|
+
if (!lanes.includes(api)) {
|
|
39
39
|
fields.push(field);
|
|
40
|
-
issues.push(`${field}: only read on the ${lanes.join(" / ")} lane — this entry
|
|
40
|
+
issues.push(`${field}: only read on the ${lanes.join(" / ")} lane — this entry is api "${api}", where the header would be sent and do nothing`);
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
if (typeof value !== "string" || value.length > MAX_HEADER_VALUE_CHARS || !HEADER_VALUE_SHAPE.test(value)) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type ModelEntryRefusalCode, type ModelPlaneRefusalCode, type ModelRefusalsSignal } from "@sema-agent/settings-schema";
|
|
1
|
+
import { ModelEntry, type ModelEntryRefusalCode, type ModelPlaneRefusalCode, type ModelRefusalsSignal } from "@sema-agent/settings-schema";
|
|
2
2
|
import { type DroppedCatalogEntry } from "./web-admin-client/read-warnings.js";
|
|
3
3
|
import { type ModelTableLeg } from "./model-select.js";
|
|
4
|
+
import type { CandidateRejectionNote } from "./web-admin-client/candidate-gate.js";
|
|
4
5
|
/**
|
|
5
6
|
* 条目拒因码 → 本仓铸它的成因 —— **以码为键**([ref]):码闭集的属主是 settings-schema(`MODEL_ENTRY_REFUSAL_CODES`,6.2.0 起;此前本仓
|
|
6
7
|
* 自持一份同名码表,撞名已消灭、零别名)。那边加一个条目码 ⇒ 本表缺键 ⇒ 本仓 tsc 红(只拿 `satisfies` 约束码值证明的是「子集」,
|
|
@@ -40,31 +41,38 @@ export interface CatalogEntryVerdictCtx {
|
|
|
40
41
|
/** anthropic 路由装上了没有(= `config.anthropic` 在场,`createBrain` 同判)。 */
|
|
41
42
|
readonly anthropicRouteMounted: boolean;
|
|
42
43
|
}
|
|
43
|
-
/**
|
|
44
|
+
/** 条目的承载形最小读面(`CenterModel` 与本地投影都结构满足)。判据只从 settings-schema 的那一次解析读条目;承载形上只读拒因的键
|
|
45
|
+
* (`name`)与形判不过时拒因句要的身份(`id` / `provider`,按 `typeof` 读,不信这张型)。 */
|
|
44
46
|
export interface CatalogEntryLike {
|
|
45
47
|
readonly name: string;
|
|
46
48
|
readonly id: string;
|
|
47
49
|
readonly provider: string;
|
|
48
|
-
/** [ref]:线路词(`headers` 的线路判据读它;原值,不信这张型)。 */
|
|
49
|
-
readonly api?: unknown;
|
|
50
|
-
/** [ref]:供应商附加头的承载形(`unknown`:判据在 `model-entry-headers.ts`,不信这张型)。 */
|
|
51
|
-
readonly headers?: unknown;
|
|
52
|
-
/** 引擎已退役的每模型引导句(core 7.56.0 [ref];settings-schema 的 `ModelEntry` 仍收它)—— 只读在场与否,见 {@link judgeCatalogEntry}。 */
|
|
53
|
-
readonly promptGuidance?: unknown;
|
|
54
50
|
}
|
|
51
|
+
/** 一条条目的判决:可用 ⇒ 判官那一次 settings-schema 解析读出的条目(**铸点只从它铸 Model** —— 判与铸读同一只值);不可用 ⇒ 拒因。 */
|
|
52
|
+
export type CatalogEntryVerdict = {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
readonly entry: ModelEntry;
|
|
55
|
+
} | {
|
|
56
|
+
readonly ok: false;
|
|
57
|
+
readonly refusal: ModelEntryRefusal;
|
|
58
|
+
};
|
|
55
59
|
/**
|
|
56
|
-
* **逐条判据**:`
|
|
60
|
+
* **逐条判据**:`ok` = 本部署能完整服务它(连同判出它的那一份读数)。判序即语义:先形(不合形的条目谈不上走哪条腿),再腿。
|
|
57
61
|
* 形分两段、同一个码(`config.model_entry_invalid`):settings-schema 的 `ModelEntry`,再是 [ref] 的 `headers`(白名单 + 线路 + 值形,
|
|
58
62
|
* 判据单属主 `model-entry-headers.ts`;settings-schema 6.3.0 的 `ModelEntry` 还没有这个键 —— 候裁加字段,届时词表不另抄)。
|
|
59
63
|
*
|
|
60
|
-
* 形判的属主是 settings-schema 的 `ModelEntry`(两条读腿用的就是它)——
|
|
61
|
-
*
|
|
62
|
-
*
|
|
64
|
+
* 形判的属主是 settings-schema 的 `ModelEntry`(两条读腿用的就是它)—— 本仓不手抄任何一条字段规则;这里在第二道边界(绕过读腿的
|
|
65
|
+
* 输入)上**再问一次同一个属主**:不过 ⇒ 一条带码的拒因;过 ⇒ 它的输出就是这条条目**唯一的读数**,其后的每一判与铸点都读它。
|
|
66
|
+
*
|
|
67
|
+
* **一种读法**:两条读腿交来的条目本就是这份输出;绕过读腿的输入(盘上被手改的 LKG、手写 effective、夹具)在这里得到同一份 ——
|
|
68
|
+
* schema 补的缺省(`api` / `tier` / `provider` / `quotaWeight` …)随这一次读法进 Model,不存在「判按缺省、铸按原值」的第二读法
|
|
69
|
+
* (修前:缺 `api` 的条目形判放行、铸点按原值读 ⇒ 整只候选 stage 抛;缺 `tier` 的条目铸出无 `params.tier` 的 Model,按档位选的缺省选不中 ⇒ 模型面整组拒)。
|
|
63
70
|
*/
|
|
64
|
-
export declare function judgeCatalogEntry(m: CatalogEntryLike, ctx: CatalogEntryVerdictCtx):
|
|
71
|
+
export declare function judgeCatalogEntry(m: CatalogEntryLike, ctx: CatalogEntryVerdictCtx): CatalogEntryVerdict;
|
|
65
72
|
/** 一批已启用条目的判决:可用的(保序)、不可用的(按 catalog name)、被丢目录条目的载体行(形对的,保序),以及形不对的载体行(坐标)。 */
|
|
66
|
-
export interface CatalogEntriesVerdict
|
|
67
|
-
|
|
73
|
+
export interface CatalogEntriesVerdict {
|
|
74
|
+
/** 可用条目判官那一次 schema 解析的读数(保序)—— 模型面 stage 只从这里铸 Model(承载形不再被读)。 */
|
|
75
|
+
readonly usable: readonly ModelEntry[];
|
|
68
76
|
/** 键 = catalog name(**每一个**名,含秘密形 / 空串 / `__proto__`:引擎自己的判决保持完整 —— [ref] 不变量与选择面的「让出」都读它;
|
|
69
77
|
* 名筛只在出口,见 {@link buildModelRefusalsSignal})。键以自有数据属性写入(`__proto__` 不走原型 setter)。 */
|
|
70
78
|
readonly refused: Readonly<Record<string, ModelEntryRefusal>>;
|
|
@@ -75,6 +83,12 @@ export interface CatalogEntriesVerdict<M extends CatalogEntryLike> {
|
|
|
75
83
|
/** [ref]:载体里形对的行(保序)—— 模型面 stage 把它与 `models` 同 commit 进 `config.droppedCatalogEntries`(`GET /v1/models.droppedEntries`
|
|
76
84
|
* 的源):载体只在这里被判形、被读一次,墓碑与 wire 读的是同一批行。 */
|
|
77
85
|
readonly dropped: readonly DroppedCatalogEntry[];
|
|
86
|
+
/**
|
|
87
|
+
* **这份候选管不管模型面** —— 唯一判决位(铸在这里一次;模型面 stage 的捷径、dry-run 的 `wouldOverrideModels`、世代账的模型面结局都读它,
|
|
88
|
+
* 墓碑判据与它读同一个行谓词 {@link droppedRowEnabled})。管 ⇔ 有一条启用条目(幸存的,或被读腿丢掉的 —— 有名无名都算),或载体形不对
|
|
89
|
+
* (改过的行原本代表谁说不清,按「管」判、随后组拒,fail-closed)。不管 ⇒ 上一代 / env 继续服务,不是拒。
|
|
90
|
+
*/
|
|
91
|
+
readonly manages: boolean;
|
|
78
92
|
}
|
|
79
93
|
/**
|
|
80
94
|
* 批量形(模型面 stage 与 dry-run 共用这一只 —— 报数与真 apply 永不撕裂)。
|
|
@@ -89,7 +103,7 @@ export interface CatalogEntriesVerdict<M extends CatalogEntryLike> {
|
|
|
89
103
|
* 秘密形或非标识符,被扣下的名字无从被铸出;代价只是显式点它的请求拿到「未知模型」而不是 `request.model_unavailable`。
|
|
90
104
|
* 与一条可用 / 已判不可用条目同名时不覆盖(可用条目仍可用;同名撞车由不变量 `refused-names-not-minted` 响亮拒)。
|
|
91
105
|
*/
|
|
92
|
-
export declare function judgeCatalogEntries
|
|
106
|
+
export declare function judgeCatalogEntries(enabled: readonly CatalogEntryLike[], ctx: CatalogEntryVerdictCtx, dropped?: unknown): CatalogEntriesVerdict;
|
|
93
107
|
/** [ref]:一次 apply 对「最新交到手的那份候选目录」的模型拒因判决(纯数据;`ApplyReport.modelRefusals`)。 */
|
|
94
108
|
export interface ModelRefusalVerdict {
|
|
95
109
|
/** 那份候选的逐条判决(键 = catalog name,**完整**,未过名筛 —— 名筛在出口 {@link buildModelRefusalsSignal})。 */
|
|
@@ -132,10 +146,23 @@ export declare function echoModelRef(ref: string): string;
|
|
|
132
146
|
* 别名段(`(catalog entry …)`)的判断读原形:ref 与条目名逐字相同 ⇒ 不带,不因回显截短而误判成「另有条目」。
|
|
133
147
|
*/
|
|
134
148
|
export declare function modelUnavailableMessage(field: string, requested: string, name: string, r: ModelEntryRefusal): string;
|
|
135
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* 一次**用户选择**(显式 ref / `@name` / `compactionModel`)落在 `models.atMention` 许可之外时的拒因句 —— HTTP `request.model_not_allowed` 的 `error`
|
|
151
|
+
* 与 run-local 的 stderr 同一句(与 {@link modelUnavailableMessage} 同一种铸法:`field` = 调用方的通道名,`requested` = 原形,本函数回显时过 {@link echoModelRef};
|
|
152
|
+
* `resolved` = 选择归一到的目录名,即这次真会跑的那只)。
|
|
153
|
+
*/
|
|
154
|
+
export declare function modelNotAllowedMessage(field: string, requested: string, resolved: string): string;
|
|
155
|
+
/** 缺省模型不变量读的切面(`ServiceConfig` 与 `CrossInvariantView` 都结构满足;可选成员缺席 = 没有被拒的候选)。 */
|
|
136
156
|
export interface DefaultModelView {
|
|
137
157
|
readonly models: Readonly<Record<string, unknown>>;
|
|
138
158
|
readonly modelRefusals: Readonly<Record<string, ModelEntryRefusal>>;
|
|
159
|
+
/**
|
|
160
|
+
* [ref] ① —— **为何这张 env 表上没有目录**:候选判官整拒了最近一份候选(一个域都没应用),于是回落 env。值是判官交出的拒因列(`rejected.errors`,与 `config_candidate_rejected`
|
|
161
|
+
* 行体的 `errors` 同一份事实)经 `buildCandidateRejectionNotes` 投成的纯数据 —— 每个被拒文档一格:文档名 · 拒码 · 原因类词 · 文档路径(本地读腿)。**不含 `error` 原文**:
|
|
162
|
+
* 契约 / 读腿的原句可能点名链接指向的目标路径等操作数,只留在 warn 行(那里已过产出边界脱敏);句子函数不读日志、不读原句、不自铸第二份。
|
|
163
|
+
* 缺席 / 空 = 没有被拒的候选(纯 env 部署、候选被收下、dry-run)⇒ 拒因句逐字不变。只有 `env` 腿的句子读它(`catalog` 腿说的是目录候选自己没有缺省,与候选被整拒无关)。
|
|
164
|
+
*/
|
|
165
|
+
readonly candidateRejectionNotes?: readonly CandidateRejectionNote[];
|
|
139
166
|
}
|
|
140
167
|
/**
|
|
141
168
|
* 🔴 [ref] —— **这张模型表有没有一只缺省模型**(`models.default`)。`undefined` = 有。
|
|
@@ -146,6 +173,8 @@ export interface DefaultModelView {
|
|
|
146
173
|
*
|
|
147
174
|
* 拒因一句:码 + 这条腿上**真实**的出路 + 若目录在场但每条都不可用,点名它们与各自的码。env 腿句首保留 `MODEL_ID is required`
|
|
148
175
|
* 这个既有的可 grep 片段(壳与运维脚本认它);目录腿不提 `MODEL_ID`(见 {@link ModelTableLeg})。
|
|
176
|
+
* env 腿若是因「候选被判官整拒」才回落到这张表({@link DefaultModelView.candidateRejectionNotes}),同一行再追加「回落原因」:被拒的文档名 + 拒码 + 原因类词 + 文档路径 ——
|
|
177
|
+
* 不带配置值、不带链接指向的目标路径、不抄任何 `error` 原文;只追加,句首的 grep 锚不动,没有被拒候选时整句逐字不变。
|
|
149
178
|
*/
|
|
150
179
|
export declare function defaultModelRefusal(view: DefaultModelView, leg: ModelTableLeg): string | undefined;
|
|
151
180
|
/** 一个被铸出的被拒名字:`name` = 被拒条目的名字,`target` = 增广把它指向的那条条目,`via` = 它是以什么身份被铸出的。 */
|