@sema-agent/server 7.134.0 → 7.136.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 +197 -1
- package/USAGE.md +147 -42
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +122 -154
- package/dist/approval-card.js +50 -51
- package/dist/approval-content-kind.d.ts +23 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +35 -6
- package/dist/auth-bridge.js +20 -3
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +36 -29
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +7 -4
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +1 -1
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stage-07-capability-layer.d.ts +1 -1
- package/dist/boot/stage-08-reapers.d.ts +1 -1
- package/dist/boot/stage-09-leader.d.ts +1 -1
- package/dist/boot/stage-10-http-server.d.ts +1 -1
- package/dist/boot/stores.js +4 -4
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +15 -27
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/brain.js +12 -3
- package/dist/budget.d.ts +7 -7
- package/dist/budget.js +4 -0
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +11 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +29 -32
- package/dist/capability-facts.js +17 -21
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +22 -8
- package/dist/center-credential.js +18 -3
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-catalog.js +12 -10
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +5 -5
- package/dist/config-invariants.js +11 -2
- package/dist/config-lkg.d.ts +1 -39
- package/dist/config-lkg.js +1 -83
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +95 -87
- package/dist/config.d.ts +26 -24
- package/dist/config.js +38 -18
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +25 -11
- package/dist/file-history-disclosure.js +25 -14
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +45 -14
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +23 -19
- package/dist/fleet-lease.js +31 -23
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +58 -31
- package/dist/hooks/hook-runner.js +37 -19
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +62 -17
- package/dist/http/checkpoint-ctx.js +78 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +9 -9
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +9 -23
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -7
- package/dist/http/routes/approvals-assistant.js +101 -26
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +23 -11
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +97 -46
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +43 -53
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +33 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +17 -13
- package/dist/observability/fail-open.js +17 -13
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -18
- package/dist/parked-decide.js +31 -11
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +5 -4
- package/dist/peer-directory.js +6 -6
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -15
- package/dist/plugins/approval-ask-store-sql.js +21 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +130 -0
- package/dist/plugins/checkpoint-index-columns.js +90 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +71 -69
- package/dist/plugins/checkpoint-store-sql.js +109 -127
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +15 -7
- package/dist/plugins/file-history-store-sql.js +55 -36
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +7 -7
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +73 -54
- package/dist/plugins/one-time-migrations.js +131 -134
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +26 -13
- package/dist/plugins/remote-env-k8s.js +24 -7
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +40 -1
- package/dist/plugins/sql-errors.js +49 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +8 -0
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +10 -3
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +20 -5
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +6 -1
- package/dist/request-key-closure.js +5 -2
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-caps-resolver.js +1 -1
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +17 -12
- package/dist/sandbox-pkg-source.js +14 -9
- package/dist/sealed-key.d.ts +22 -3
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +65 -37
- package/dist/session-incarnation.js +30 -12
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +61 -6
- package/dist/session-sync.js +55 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +52 -79
- package/dist/task-a2a.js +224 -62
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +13 -17
- package/dist/task-mcp.js +29 -49
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +166 -207
- package/dist/tool-approval.js +61 -61
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +13 -8
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +69 -67
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +61 -31
- package/dist/trace/redact.js +394 -153
- package/dist/trace/self-minted-wire.d.ts +302 -14
- package/dist/trace/self-minted-wire.js +87 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +16 -3
- package/dist/url-refusal.js +15 -2
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +32 -3
- package/dist/workspace-space.js +26 -0
- package/dist/write-protection.d.ts +2 -2
- package/package.json +5 -3
- package/scripts/drain-check-local.mjs +4 -2
- package/scripts/drain-check.mysql.sql +6 -2
- package/scripts/drain-check.pg.sql +6 -2
- package/skills/loop.md +1 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
package/dist/task-mcp.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { mcpInjectionDroppedNotice, mcpStartupTimeoutMs, readToolFaces, resolveComplianceDenies } from "@sema-agent/core";
|
|
2
|
-
import { MCP_CONTENT_ORIGINS, describeBadContentOrigin,
|
|
3
|
-
import { HttpError
|
|
2
|
+
import { MCP_CONTENT_ORIGINS, describeBadContentOrigin, describeNotStringArray, describeValueShape, findUrlCredential, isContentOriginWord, isStringArray, isUsableWireName, readRequestMcpTransport, stripControlAndBidi, } from "@sema-agent/settings-schema";
|
|
3
|
+
import { HttpError } from "./security.js";
|
|
4
4
|
import { GOVERNANCE_HTTP_STATUS } from "./governance-http-status.js";
|
|
5
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
5
6
|
import { MCP_SOURCE_LABEL_MAX, isMcpSourceLabel, readMcpSourceLabel } from "./mcp-source-label.js";
|
|
6
7
|
import { describeMcpAssertionHeaderNotAString, describeMcpIdentityHeadersConflict, mcpIdentityHeadersIssue, noteMcpAssertionHeaderIgnored, noteMcpAssertionHeaderNotSent, specWithholdsMcpAssertionHeader, toCoreMcpServerSpec } from "./mcp-assertion-header.js";
|
|
7
8
|
import { MAX_KEY_ECHO, echoKeyName, keyClosureClause, scanKeyClosure } from "./request-key-closure.js";
|
|
8
9
|
import { readRequestToolAxes } from "./request-tool-axes.js";
|
|
10
|
+
import { urlCredentialHeaderExit, urlCredentialRefusalReason } from "./url-credential-refusal.js";
|
|
11
|
+
import { MALFORMED_NAME, declarationFieldRefusal, declarationNameIssue, declaredName, judgeDeclarationKeys, requestDeclarationRefusal, throwDeclarationRefusal, } from "./request-declaration-refusal.js";
|
|
9
12
|
export const MAX_REQUEST_MCP_SERVERS = 32;
|
|
10
13
|
export const MAX_REQUEST_MCP_DROP_NAMES = MAX_REQUEST_MCP_SERVERS;
|
|
11
14
|
export const MCP_SERVER_ENTRY_KEYS = ["allowTools", "contentOrigin", "elicitation", "name", "source", "startupTimeoutMs", "toolAxes", "toolFaces", "transport"];
|
|
@@ -16,7 +19,7 @@ export function mcpInjectionHonored(config) {
|
|
|
16
19
|
return false;
|
|
17
20
|
if (config.compliancePosture !== undefined && resolveComplianceDenies(config.compliancePosture).has("mcp_servers"))
|
|
18
21
|
return false;
|
|
19
|
-
return config
|
|
22
|
+
return !DEPLOYMENT_SHAPE_PREDICATES.multiTenant.holds(config);
|
|
20
23
|
}
|
|
21
24
|
function isRecord(v) {
|
|
22
25
|
return v !== null && typeof v === "object" && !Array.isArray(v);
|
|
@@ -25,12 +28,6 @@ function isElicitationFlag(v) {
|
|
|
25
28
|
return typeof v === "boolean";
|
|
26
29
|
}
|
|
27
30
|
const bad = (field) => ({ ok: false, field });
|
|
28
|
-
const MALFORMED_NAME = "<malformed>";
|
|
29
|
-
function declaredName(e) {
|
|
30
|
-
return e && typeof e === "object" && typeof e.name === "string" && e.name !== ""
|
|
31
|
-
? String(e.name)
|
|
32
|
-
: MALFORMED_NAME;
|
|
33
|
-
}
|
|
34
31
|
function normalizeServer(e, noteBadOrigin, storedToolAxes) {
|
|
35
32
|
if (!e || typeof e !== "object")
|
|
36
33
|
return bad("entry");
|
|
@@ -131,32 +128,21 @@ function requestEntryIdentityRefusal(entry, at) {
|
|
|
131
128
|
return { errorCode: "request.body_shape", message: describeMcpIdentityHeadersConflict(echoKeyName("", declaredName(entry))) };
|
|
132
129
|
const transport = entry.transport;
|
|
133
130
|
const value = isRecord(transport) ? transport.assertionHeader : undefined;
|
|
134
|
-
return
|
|
131
|
+
return declarationFieldRefusal(MCP_SEAT, entry, at, { path: "transport.assertionHeader", reason: describeMcpAssertionHeaderNotAString(value) });
|
|
135
132
|
}
|
|
136
133
|
export function requestMcpDeclarationRefusal(list) {
|
|
137
|
-
|
|
138
|
-
return undefined;
|
|
139
|
-
if (!Array.isArray(list))
|
|
140
|
-
return listRefusal(`mcpServers is ${describeValueShape(list)}, not an array of MCP server declarations`);
|
|
141
|
-
if (list.length > MAX_REQUEST_MCP_SERVERS)
|
|
142
|
-
return listRefusal(`mcpServers carries ${list.length} declarations, above this deployment's ceiling of ${MAX_REQUEST_MCP_SERVERS}`);
|
|
143
|
-
for (let i = 0; i < list.length; i++) {
|
|
144
|
-
const refusal = requestEntryRefusal(list[i], `mcpServers[${i}]`);
|
|
145
|
-
if (refusal !== undefined)
|
|
146
|
-
return refusal;
|
|
147
|
-
}
|
|
148
|
-
return undefined;
|
|
134
|
+
return requestDeclarationRefusal(MCP_SEAT, list, requestEntryRefusal);
|
|
149
135
|
}
|
|
150
136
|
export function assertRequestMcpEntries(bodyMcp) {
|
|
151
|
-
|
|
152
|
-
if (refusal !== undefined)
|
|
153
|
-
throw createCodedHttpError(400, refusal.errorCode, refusal.message, refusal.unknownKeys === undefined ? undefined : { unknownKeys: [...refusal.unknownKeys] });
|
|
154
|
-
}
|
|
155
|
-
const LIST_REFUSAL_TAIL = "The request is refused rather than acting on part of the list: declarations that silently did not apply would read as in effect to whoever sent them. " +
|
|
156
|
-
"Fix the list (an empty list declares none).";
|
|
157
|
-
function listRefusal(head) {
|
|
158
|
-
return { errorCode: "request.field_invalid", message: `${head}. ${LIST_REFUSAL_TAIL}` };
|
|
137
|
+
throwDeclarationRefusal(requestMcpDeclarationRefusal(bodyMcp));
|
|
159
138
|
}
|
|
139
|
+
const MCP_SEAT = {
|
|
140
|
+
list: "mcpServers",
|
|
141
|
+
cap: MAX_REQUEST_MCP_SERVERS,
|
|
142
|
+
subject: "server",
|
|
143
|
+
declaration: "an MCP server declaration",
|
|
144
|
+
declarations: "MCP server declarations",
|
|
145
|
+
};
|
|
160
146
|
const ENTRY_KEY_SET = new Set(MCP_SERVER_ENTRY_KEYS);
|
|
161
147
|
const STDIO_TRANSPORT_KEY_SET = new Set(STDIO_MCP_TRANSPORT_KEYS);
|
|
162
148
|
const HTTP_TRANSPORT_KEY_SET = new Set(HTTP_MCP_TRANSPORT_KEYS);
|
|
@@ -172,6 +158,12 @@ function entryUnknownKeys(entry, at) {
|
|
|
172
158
|
}
|
|
173
159
|
return buckets.unknown.sort();
|
|
174
160
|
}
|
|
161
|
+
function transportUrlCredentialIssue(url) {
|
|
162
|
+
const found = findUrlCredential(url);
|
|
163
|
+
if (found === undefined)
|
|
164
|
+
return undefined;
|
|
165
|
+
return { path: "transport.url", reason: urlCredentialRefusalReason(found, urlCredentialHeaderExit("transport.headers")), credential: found };
|
|
166
|
+
}
|
|
175
167
|
const ENTRY_KEY_JUDGES = {
|
|
176
168
|
allowTools: (o) => o.allowTools === undefined || isStringArray(o.allowTools)
|
|
177
169
|
? undefined
|
|
@@ -184,7 +176,7 @@ const ENTRY_KEY_JUDGES = {
|
|
|
184
176
|
` (omit the key for the default: this server's tools classify as external content)`,
|
|
185
177
|
},
|
|
186
178
|
elicitation: (o) => (o.elicitation === undefined || isElicitationFlag(o.elicitation) ? undefined : { path: "elicitation", reason: `must be a boolean — got ${describeValueShape(o.elicitation)}` }),
|
|
187
|
-
name:
|
|
179
|
+
name: declarationNameIssue,
|
|
188
180
|
source: (o) => o.source === undefined || isMcpSourceLabel(o.source)
|
|
189
181
|
? undefined
|
|
190
182
|
: { path: "source", reason: `must be a non-empty string of at most ${MCP_SOURCE_LABEL_MAX} characters (a display label) — got ${describeValueShape(o.source)}` },
|
|
@@ -211,21 +203,14 @@ const ENTRY_KEY_JUDGES = {
|
|
|
211
203
|
},
|
|
212
204
|
transport: (o) => {
|
|
213
205
|
const read = readRequestMcpTransport(o.transport);
|
|
214
|
-
|
|
206
|
+
if (!read.ok)
|
|
207
|
+
return read.issue;
|
|
208
|
+
if (read.lost[0] !== undefined)
|
|
209
|
+
return read.lost[0];
|
|
210
|
+
return read.transport.kind === "http" ? transportUrlCredentialIssue(read.transport.url) : undefined;
|
|
215
211
|
},
|
|
216
212
|
};
|
|
217
|
-
const ENTRY_REFUSAL_TAIL = "The request is refused rather than mounting the server without it: a declaration that silently did not apply would leave the server running differently from what you declared. " +
|
|
218
|
-
"Fix the entry (an optional key may also be omitted).";
|
|
219
|
-
function entryFieldRefusal(entry, at, issue) {
|
|
220
|
-
const server = echoKeyName("", declaredName(entry));
|
|
221
|
-
return {
|
|
222
|
-
errorCode: "request.field_invalid",
|
|
223
|
-
message: `${at}.${issue.path} (server "${server}") is not a usable declaration — ${stripControlAndBidi(issue.reason)}. ${ENTRY_REFUSAL_TAIL}`,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
213
|
function requestEntryRefusal(entry, at) {
|
|
227
|
-
if (!isRecord(entry))
|
|
228
|
-
return listRefusal(`${at} is ${describeValueShape(entry)}, not an MCP server declaration (an object)`);
|
|
229
214
|
const unknownKeys = entryUnknownKeys(entry, at);
|
|
230
215
|
if (unknownKeys.length > 0) {
|
|
231
216
|
return {
|
|
@@ -239,12 +224,7 @@ function requestEntryRefusal(entry, at) {
|
|
|
239
224
|
const identity = requestEntryIdentityRefusal(entry, at);
|
|
240
225
|
if (identity !== undefined)
|
|
241
226
|
return identity;
|
|
242
|
-
|
|
243
|
-
const issue = ENTRY_KEY_JUDGES[key](entry);
|
|
244
|
-
if (issue !== undefined)
|
|
245
|
-
return entryFieldRefusal(entry, at, issue);
|
|
246
|
-
}
|
|
247
|
-
return undefined;
|
|
227
|
+
return judgeDeclarationKeys(MCP_SEAT, entry, at, MCP_SERVER_ENTRY_KEYS, ENTRY_KEY_JUDGES);
|
|
248
228
|
}
|
|
249
229
|
export function deploymentClosedMcpNames(baseline, reservedNames) {
|
|
250
230
|
return new Set([...(baseline ?? []).map((s) => s.name), ...reservedNames]);
|
package/dist/task-settings.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ import { type TightenOnlySeatValues } from "./tighten-only-seats.js";
|
|
|
59
59
|
* `?permissionMode=` 查询串三处同读)。本仓不持有第二份词表,也不持有「收 / 不收」的表态:判据 = core 的 `isPermissionMode`,型 = core 的
|
|
60
60
|
* `PermissionMode`,wire 句子里的词表只从这里取词({@link PERMISSION_MODE_WORDS})。core 加一个词 ⇒ 请求面自动收它、原样过境,本仓没有
|
|
61
61
|
* 按词分的臂要补;core 删 / 改名一个词 ⇒ 本仓按名写出它的地方(`PLAN_APPROVE_PERMISSION_MODES_AFTER` 等)编译红。
|
|
62
|
-
* 生效模式原样过境 `TaskSpec.permissionMode`(
|
|
62
|
+
* 生效模式原样过境 `TaskSpec.permissionMode`([ref]):引擎自己解释模式 —— 含 `dontAsk`(CC 的「自动拒」档:凡是要问的一律由模式拒,零卡,
|
|
63
63
|
* 门记录 `deniedBy:"mode"`)与 acceptEdits 的免问写域(引擎的写根:任务根 + `additionalDirectories` + 宣告的可写目录),本仓不另写判。
|
|
64
64
|
*/
|
|
65
65
|
/** 请求面闭集的 wire 文案形(`"a" | "b" | …`,core 序)—— 三处 400(顶层 / bundle / 查询串)的句子从这里取词,不再各抄一份。 */
|
|
@@ -82,7 +82,7 @@ export declare function coercePermissionMode(raw: unknown): PermissionMode | und
|
|
|
82
82
|
* 上面的宽读只是本函数外再包一层折叠;词表只有 core 的 `PERMISSION_MODES`(判据 `isPermissionMode`)。 */
|
|
83
83
|
export declare function coercePermissionModeStrict(raw: unknown): PermissionMode | undefined;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* [ref] —— 一份**被批准的计划**之后,这条会话继续用的 permission mode(`plan_review` 决裁体的
|
|
86
86
|
* `permissionModeAfter`)。core 的契约句是 `present-plan-tool.js`:「If the plan is approved, the run
|
|
87
87
|
* continues (and any read-only restriction is lifted)」—— 而 core 顶层 resume 把宿主的续跑配置**整体**
|
|
88
88
|
* 展开成新一段 spec、读的是那段 spec 上的模式词(`TaskSpec.permissionMode`),所以「松开」这件事的属主在
|
|
@@ -99,7 +99,7 @@ export declare function coercePermissionModeStrict(raw: unknown): PermissionMode
|
|
|
99
99
|
export declare const PLAN_APPROVE_PERMISSION_MODES_AFTER: readonly ["default", "acceptEdits"];
|
|
100
100
|
/** {@link PLAN_APPROVE_PERMISSION_MODES_AFTER} 的类型形(值表单点,类型从值派生 —— 两处各写一份就会漂)。 */
|
|
101
101
|
export type PlanApprovePermissionModeAfter = (typeof PLAN_APPROVE_PERMISSION_MODES_AFTER)[number];
|
|
102
|
-
/**
|
|
102
|
+
/** [ref] 值闭集判据(wire 门用)。**宽臂一个都没有**:词表外的值 400 响亮拒 —— 这一位选的是批准之后
|
|
103
103
|
* 模型有没有手,把一个拼错的词折成任何一档都是安全轴上的静默降级([ref]「无静默 fail-open」)。 */
|
|
104
104
|
export declare function isPlanApprovePermissionModeAfter(raw: unknown): raw is PlanApprovePermissionModeAfter;
|
|
105
105
|
/**
|
|
@@ -130,7 +130,7 @@ export declare function stampEntryPermissionMode<B extends {
|
|
|
130
130
|
readonly entry: EntryPermissionMode;
|
|
131
131
|
};
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* [ref] —— **一条已持久化的提交体的生效 permission mode**,单点。
|
|
134
134
|
*
|
|
135
135
|
* 它只是把 {@link effectivePermissionMode} 与「拿哪一份 settings 去问」这**一对**绑在一起:后者是
|
|
136
136
|
* `parseTaskSettings(body.settings)`(resume 重放共用的宽容解析层)。两处各写一遍这一对,就会在
|
|
@@ -161,7 +161,7 @@ export declare function effectivePermissionMode(body: {
|
|
|
161
161
|
permissionMode?: unknown;
|
|
162
162
|
}, settings: ParsedTaskSettings | undefined): PermissionMode | undefined;
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
164
|
+
* [ref] —— [ref] 技能清单预算两旋钮的**值域谓词**(一对具名单铸点)。
|
|
165
165
|
*
|
|
166
166
|
* 两层同问这一只:FRESH 提交面的 400 门(`http/server.ts`)问「合不合法」,RESUME 宽容层
|
|
167
167
|
* ({@link parseTaskSettings})问「收不收下」—— 这两句话在这两个键上是**同一个问题的正反面**
|
|
@@ -204,7 +204,7 @@ export interface ParsedTaskSettings {
|
|
|
204
204
|
/** `settings.env` → per-task shell env. core deliberately keeps NO
|
|
205
205
|
* `TaskSpec.env` (an untrusted caller must not swap the sandbox — [ref] §7 Q4); per-session shell env rides
|
|
206
206
|
* the TRUSTED `executionEnvFactory` seam (`shellEnv`) instead. [ref] "env = capability axis": HONORED only on
|
|
207
|
-
* the single-user host
|
|
207
|
+
* the lanes of deployment-shape row `callerCwd` (single-user host, or device), IGNORED on any cloud/multi-tenant lane. Parsed here; gated at apply. */
|
|
208
208
|
shellEnv?: Record<string, string>;
|
|
209
209
|
/** L2 ultracode preset ([ref]): a CC-parity `settings.ultracode` boolean that EXPANDS to the two existing
|
|
210
210
|
* orthogonal axes — `thinking:"max"` (the reasoning axis) + `selfOrchestration:true` (the orchestration axis,
|
|
@@ -221,7 +221,7 @@ export interface ParsedTaskSettings {
|
|
|
221
221
|
skillListingBudgetFraction?: number;
|
|
222
222
|
/** 同族第二键:每条技能描述在清单里的字符帽(正整数;CC 默认 1536)。超出由引擎**截断**,不是拒。 */
|
|
223
223
|
skillListingMaxDescChars?: number;
|
|
224
|
-
/**
|
|
224
|
+
/** [ref] —— 「只收紧」座位族(`tighten-only-seats.ts` 的四座:读拒模式 / 写保护名的加法 / 合规额外禁项 / 永不自动放行名单)的归一值,**一个键**而不是四个散字段:
|
|
225
225
|
* wire 位置由座位表说(三座在 `settings` 顶层,`neverAuto` 在 `settings.permissions`),解析后与位置无关。空数组 ≡ 缺席(不铸键)。
|
|
226
226
|
* 去处:三座经 {@link applyTaskSettings} 落 core 任务层席;`neverAuto` 经 {@link deriveSettingsPolicy} 落请求叶策略。 */
|
|
227
227
|
tightenOnly?: TightenOnlySeatValues;
|
|
@@ -282,14 +282,14 @@ export interface SettingsPermissionBucketIssue {
|
|
|
282
282
|
export declare function settingsPermissionBucketIssue(perms: unknown): SettingsPermissionBucketIssue | null;
|
|
283
283
|
/** 本 service 真正**消费**的 `settings` 顶层键 —— 闭集。每一个都有消费点:
|
|
284
284
|
* `env`/`hooks`/`model`/`outputStyle`/`permissions`/`ultracode` 与两个 `skillListing*` 在
|
|
285
|
-
* {@link parseTaskSettings};`webSearch` 在 `capabilities/scenarios.ts`(判决 `judgeRequestWebSearch`,单用户闸;形错在受理面 400,
|
|
285
|
+
* {@link parseTaskSettings};`webSearch` 在 `capabilities/scenarios.ts`(判决 `judgeRequestWebSearch`,单用户闸;形错在受理面 400,[ref])。
|
|
286
286
|
* 加键必须同时加消费点,否则就是往闭集里塞一个新的静默丢。
|
|
287
287
|
*
|
|
288
|
-
* 🔴 `readDenyPatterns` / `writeProtectedExtra` / `complianceAdditionalDenies` 与 `permissions.neverAuto`(
|
|
288
|
+
* 🔴 `readDenyPatterns` / `writeProtectedExtra` / `complianceAdditionalDenies` 与 `permissions.neverAuto`([ref])= **「只收紧」座位族**:消费点 = `tighten-only-seats.ts`
|
|
289
289
|
* 的座位表(位置、条目律、去处都由那张表说),读入在 {@link parseTaskSettings},投影在 {@link applyTaskSettings} / {@link deriveSettingsPolicy}。这四个键不是 CC settings 键
|
|
290
290
|
* (sdk 的 `SemaSettings` 尚未声明 —— 对账门 `test/task-settings-sdk-key-parity.test.ts` 的「server 先于 sdk」登记表记着它们)。
|
|
291
291
|
*
|
|
292
|
-
* 🔴 `approvalFrameFamilies`(
|
|
292
|
+
* 🔴 `approvalFrameFamilies`([ref])= 这条 run 的客户端**声明**渲染得了哪些审批开卡帧族 —— 不进引擎,不是 CC settings 键。消费点 = 三条执行腿的审批装配
|
|
293
293
|
* (`tool-approval.ts` 的唯一读者 `declaredApprovalFrameFamilies` → `resolveApprovalLeg`),判官 `approvalFrameFamiliesIssue`(fresh 受理 400 与宽容读者同一只)。
|
|
294
294
|
* `parseTaskSettings` 刻意不读它(它管的是落到 `TaskSpec` 的设置)。sdk 型面待声明(对账门的「server 先于 sdk」登记表记着)。
|
|
295
295
|
*
|
|
@@ -303,7 +303,7 @@ export declare const TASK_SETTINGS_PERMISSION_KEYS: readonly ["allow", "ask", "d
|
|
|
303
303
|
/** CC/SDK 合约里合法、本 service **不接线**的顶层键。词表外的 CC 键落 `unknown` —— 两列都是 400,标签只影响
|
|
304
304
|
* 文案,不影响判决。前三个的出处 = `@sema-agent/sdk` `SemaSettings` 尾注逐字点名的 deferred CC 键。
|
|
305
305
|
*
|
|
306
|
-
* 🔴 `crossSessionInbound` / `dialogExpiry`(
|
|
306
|
+
* 🔴 `crossSessionInbound` / `dialogExpiry`([ref])为什么在**这一列**而不是受理列:它们是**每会话**的
|
|
307
307
|
* 保护型设置(`refuse` = 本会话退出入站跨会话车道),而引擎只给了**部署级**座位(一个 Runner 单例,
|
|
308
308
|
* getter 无会话上下文)。受理它们只能做到「解析 + 记一行运维日志」——调用方拿到 202、以为自己的
|
|
309
309
|
* opt-out 生效了,而实际没有任何 per-session 生效点。**在保护型配置上,「受理但不执行」比「响亮拒」
|
|
@@ -329,8 +329,20 @@ export declare const TASK_SETTINGS_UNSUPPORTED_PERMISSION_KEYS: readonly ["addit
|
|
|
329
329
|
*/
|
|
330
330
|
export declare function taskSettingsKeyIssue(raw: unknown): KeyClosureIssue | null;
|
|
331
331
|
/**
|
|
332
|
-
*
|
|
333
|
-
*
|
|
332
|
+
* FRESH 提交面 `settings.hooks` 子树的键闭集裁决 —— 键闭集门的**第三个实例**(类与另两个实例见 `request-key-closure.ts` 头注;判决、机器面、文案骨架同一只):
|
|
333
|
+
* 一只匹配组 / 一个条目上**读者不携带**的键 ⇒ 返回拒体(调用方 400 `request.body_shape`);全部携带 ⇒ `null`。
|
|
334
|
+
*
|
|
335
|
+
* 词表 = **读者自己的答案**:`config` 是同一份 `raw` 经 {@link parseHooksConfig} 受理的产物,一只组 / 一个条目受理的键 = 可跑形在同一坐标上那只对象的键
|
|
336
|
+
* (契约分类器携带的字段 + 本仓 wire 键:组的 `source`、command 条目的 `plugin` / `args`)。本函数不另立键表 —— 契约给某一型加字段、分类器开始携带它,这里随之受理;
|
|
337
|
+
* 受理 ⇒ 分类器答 `loaded` ⇒ 组与条目的下标与原值逐位对齐。值为 `undefined` 的键与缺席同读(读者同一口径)。坐标经 {@link hooksCoordinate}(契约包出门形 + 回显口径;凭据形键段不原样回显)。
|
|
338
|
+
*
|
|
339
|
+
* 判据边界(与另两个实例同):只判**键名**(值形归读者);拒只在 FRESH 提交面 —— 续跑重放走 {@link parseTaskSettings},读者照旧剥掉它不携带的键,存量体按受理时的读法重放(4xx 打在重放腿上会砖死停驻任务)。
|
|
340
|
+
* 为什么必须拒:一只被剥掉的键对调用方读作「生效了」—— 守卫条目上的 `onFailure: "block"` 被剥掉,守卫起不来时照放行;`plugin` / `args` 写在 http 条目上被剥掉,写的人以为插件上下文在。
|
|
341
|
+
*/
|
|
342
|
+
export declare function hooksKeyIssue(raw: unknown, config: RunnableHooksConfig): KeyClosureIssue | null;
|
|
343
|
+
/**
|
|
344
|
+
* 🔒 **`settings.hooks` 会不会被采纳** —— 全仓**唯一**的属主([ref],主会话裁):hook 命令跑在 WORKER HOST([ref] class ② 能力授予),所以只有单主部署
|
|
345
|
+
* (部署形表行 `multiTenant` 不成立,与 scheduler / backgroundShell / lspHost / MCP 注入同一姿势)采纳;多租户车道收到 hooks **整只忽略**(`task_hooks_ignored`),绝不执行。
|
|
334
346
|
* 三处读它,谁也不许内联 `requirePrincipal`(各写各的 = 迟早漂):
|
|
335
347
|
* · `boot/resolve-spec.ts` —— 装配:不采纳 ⇒ 不铸 `TaskSpec.mods` 的 `settings.hooks` 注册 + 一条 `task_hooks_ignored`;
|
|
336
348
|
* · `http/routes/capabilities.ts` —— 能力位 `taskSettings.hooks`(「says yes ⟺ route works」);
|
|
@@ -381,29 +393,29 @@ export interface WorkflowGateWiring {
|
|
|
381
393
|
*/
|
|
382
394
|
export interface FsWriteGateWiring {
|
|
383
395
|
/**
|
|
384
|
-
* 🔴
|
|
396
|
+
* 🔴 [ref] / codex r1 [high](验真后修)—— **权限规则**的路径基(core `PathRuleBases.root`),**只在真任务根已知时**在场。
|
|
385
397
|
*
|
|
386
398
|
* host 腿上「这条 session 还没登记工作目录」时,`resolve-spec` 的路径裁决 env 落在一个**永不创建的哨兵目录**上
|
|
387
399
|
* (`fs-write-gate-unrooted`,治理层守卫集的 cwd)。那对守卫是 fail-SAFE 的(相对目标在哨兵下解析不出真身);但规则编译器按**词法**匹配、
|
|
388
400
|
* 不问目录存不存在 ⇒ 把哨兵当根递进来,`deny Edit(src/**)` 会编译成功、指向一个谁也不会写的目录,对真实工作区的
|
|
389
401
|
* `<工作区>/src/secret.ts` 判 allow —— 一条亲手写下的收紧规则**静默失效**。所以哨兵从不被声明成基。
|
|
390
402
|
*
|
|
391
|
-
* 缺席 ⇒ 不声明根 ⇒ 需要该基的拼法(`Edit(src/**)` / `Edit(/etc/**)`)锚在**装入这只策略的那条腿**的真根(core 7.46.0
|
|
403
|
+
* 缺席 ⇒ 不声明根 ⇒ 需要该基的拼法(`Edit(src/**)` / `Edit(/etc/**)`)锚在**装入这只策略的那条腿**的真根(core 7.46.0 [ref] 车 B:
|
|
392
404
|
* 锚装一次、在被装入处;`unsupported.path_base` 只剩「声明了一个用不了的基」)。修前(core ≤7.45)缺席 ⇒ 整表拒(→ 422):沙箱车道上
|
|
393
405
|
* 相对 / `/x` 形规则恒 422。绝对形(`//abs`)不需要基;`~/` 形见下一字段。
|
|
394
406
|
*/
|
|
395
407
|
taskRoot?: string;
|
|
396
408
|
/**
|
|
397
|
-
* 🔴
|
|
409
|
+
* 🔴 [ref] / codex r2 [high](验真后修)—— **执行环境的 home**(core `PathRuleBases.home`,`~/…` 形的基)。
|
|
398
410
|
*
|
|
399
|
-
* 🔴 **
|
|
411
|
+
* 🔴 **[ref]④ 起本字段在远端车道上也可以有值**:四只远端 adapter 此前一个都不声明 `ExecutionEnv.homeDir`,
|
|
400
412
|
* 而本字段那时只在 `remoteExec` 整个缺席时才铸 —— 于是**每一条远端部署的 `~/` 规则都恒 422**(接入审计
|
|
401
413
|
* M13)。修法不是放松下面那道门,而是让部署**真的知道** home:`execution-lane-caps.ts` 的
|
|
402
414
|
* `executionLaneHomeDir` 是唯一属主,`boot/execution-env.ts` 把它递给 adapter 的 `homeDir` 座、
|
|
403
415
|
* `boot/resolve-spec.ts` / `boot/parked-revive-gate.ts` 把**同一个值**递成本字段。两处同源是承重的:
|
|
404
416
|
* 各算一份就会出现「422 门放行而引擎判 unreadable」或反过来。
|
|
405
417
|
*
|
|
406
|
-
* 🔴 **
|
|
418
|
+
* 🔴 **[ref]⑦ 改真话**(亲读 core 7.12.0 `dist/core/permission-rule-model.js` /
|
|
407
419
|
* 的 `resolvePathPattern`,推翻本注此前的两句):
|
|
408
420
|
* · core 对缺席的 `home` **不**回落 `os.homedir()` —— `resolvePathPattern` 走
|
|
409
421
|
* `lexicalNormalAbsolutePathOf(baseValueOf("home", bases) ?? "")`,base 缺席 ⇒ `undefined` ⇒ 直接回
|
package/dist/task-settings.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { combinePolicies, parseRuleText, resolveReasoningProfile, rankOf, isThinkingLevel, RUN_WORKFLOW_TOOL_NAME, PERMISSION_MODES, isPermissionMode, ruleToolGrammarOf, } from "@sema-agent/core";
|
|
2
2
|
import { judgeUnmatchableToolNames } from "./config.js";
|
|
3
|
+
import { NAME_TABLE_BEHAVIOR } from "./namespaced-rule-name.js";
|
|
3
4
|
import { entryProblem } from "./entry-problems.js";
|
|
4
5
|
import { MAX_PERMISSION_RULES_PER_LIST, createRuleListPolicy } from "./permission-rule-list.js";
|
|
5
6
|
import { allowLayerEntryCountIssue, describeAllowLayerOverCap, ruleEntryListShapeOk } from "./rule-entry-list.js";
|
|
6
7
|
import { limitRefusal } from "./limit-refusal.js";
|
|
7
8
|
import { tightenGoverned } from "./governance-overrides.js";
|
|
8
9
|
import { MAX_KEY_ECHO, keyClosureClause, scanKeyClosure } from "./request-key-closure.js";
|
|
9
|
-
import { parseHooksConfig } from "./hooks/hook-runner.js";
|
|
10
|
+
import { hooksCoordinate, parseHooksConfig } from "./hooks/hook-runner.js";
|
|
10
11
|
import { heldRuleName } from "./tool-rule-names.js";
|
|
11
12
|
import { entryPermissionMode } from "./runtime-governance.js";
|
|
12
13
|
import { policyAskStandingAnswerFacts, standingAnswerDurablyRecordable } from "./tool-approval.js";
|
|
13
14
|
import { createRequestNeverAutoPolicy } from "./approval.js";
|
|
14
15
|
import { readTightenOnlySeats, tightenOnlySeatField, tightenOnlySpecSeats } from "./tighten-only-seats.js";
|
|
16
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
15
17
|
export const PERMISSION_MODE_WORDS = PERMISSION_MODES.map((m) => `"${m}"`).join(" | ");
|
|
16
18
|
export function coercePermissionMode(raw) {
|
|
17
19
|
const strict = coercePermissionModeStrict(raw);
|
|
@@ -191,8 +193,36 @@ export function taskSettingsKeyIssue(raw) {
|
|
|
191
193
|
unsupportedKeys: unsupported.slice(0, MAX_KEY_ECHO),
|
|
192
194
|
};
|
|
193
195
|
}
|
|
196
|
+
export function hooksKeyIssue(raw, config) {
|
|
197
|
+
const unknown = [];
|
|
198
|
+
const member = (node, key) => node !== null && typeof node === "object" && Object.hasOwn(node, key) ? node[key] : undefined;
|
|
199
|
+
const scan = (rawNode, carried, at) => {
|
|
200
|
+
if (rawNode === null || typeof rawNode !== "object" || Array.isArray(rawNode))
|
|
201
|
+
return;
|
|
202
|
+
for (const [key, value] of Object.entries(rawNode))
|
|
203
|
+
if (value !== undefined && !Object.hasOwn(carried, key))
|
|
204
|
+
unknown.push(hooksCoordinate([...at, key]));
|
|
205
|
+
};
|
|
206
|
+
for (const [event, groups] of Object.entries(config)) {
|
|
207
|
+
for (const [groupIndex, group] of (groups ?? []).entries()) {
|
|
208
|
+
const rawGroup = member(member(raw, event), groupIndex);
|
|
209
|
+
scan(rawGroup, group, ["hooks", event, groupIndex]);
|
|
210
|
+
for (const [entryIndex, entry] of group.hooks.entries())
|
|
211
|
+
scan(member(member(rawGroup, "hooks"), entryIndex), entry, ["hooks", event, groupIndex, "hooks", entryIndex]);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (unknown.length === 0)
|
|
215
|
+
return null;
|
|
216
|
+
unknown.sort();
|
|
217
|
+
const label = "unknown (not read on that matcher group or hook entry by this server — a misspelling, a key of another entry type (plugin / args are read on command entries only), or a hook key this server does not run)";
|
|
218
|
+
return {
|
|
219
|
+
message: `settings.hooks: unrecognized key(s) — refused rather than dropped, because a dropped key reads as "in effect" to the caller. ${keyClosureClause(unknown, label)}.`,
|
|
220
|
+
unknownKeys: unknown.slice(0, MAX_KEY_ECHO),
|
|
221
|
+
unsupportedKeys: [],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
194
224
|
export function taskHooksHonored(config) {
|
|
195
|
-
return config
|
|
225
|
+
return !DEPLOYMENT_SHAPE_PREDICATES.multiTenant.holds(config);
|
|
196
226
|
}
|
|
197
227
|
function tightenOnlySeatDeferredName(name) {
|
|
198
228
|
return tightenOnlySeatField(name).replace(/^settings\./, "");
|
|
@@ -384,7 +414,7 @@ export function deriveSettingsPolicy(settings, bases) {
|
|
|
384
414
|
}
|
|
385
415
|
export function neverAutoNamesRefusal(names) {
|
|
386
416
|
const field = tightenOnlySeatField("neverAuto");
|
|
387
|
-
const judged = judgeUnmatchableToolNames(field.replace(/^settings\./, ""), names, { consumer: "tool-name-table", behavior:
|
|
417
|
+
const judged = judgeUnmatchableToolNames(field.replace(/^settings\./, ""), names, { consumer: "tool-name-table", behavior: NAME_TABLE_BEHAVIOR });
|
|
388
418
|
if (judged === undefined)
|
|
389
419
|
return undefined;
|
|
390
420
|
return { message: judged.message, problems: judged.bad.map((b) => entryProblem(SETTINGS_RULE_REFUSAL_CODE, field, b.name, b.reason)) };
|
package/dist/task-workflow.d.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow super-set unlock — map the per-task `body.selfOrchestration` intent onto
|
|
3
|
-
* `TaskSpec.selfOrchestration`, the gate that mounts core's LLM-authored `run_workflow` engine (the workflow.ts
|
|
4
|
-
* agent/parallel/pipeline orchestrator). Same shape as the rank-1 roster gap: the engine (core run_workflow +
|
|
5
|
-
* workflow.ts) is BUILT, but nothing mapped a body field to the per-task spec flag, so it was unreachable over HTTP
|
|
6
|
-
* (capabilities advertised `workflows:true` but the LLM could never call run_workflow).
|
|
7
|
-
*
|
|
8
|
-
* Gating:
|
|
9
|
-
* - DEPLOYMENT: `selfOrchestrationEnabled` must be on (the workflowScriptRunner + stores are wired). Otherwise a set
|
|
10
|
-
* flag is a harmless no-op (core fail-closes run_workflow without the sandbox runner), so it's dropped for clarity.
|
|
11
|
-
* - MULTI-TENANT: honored ONLY when a per-principal entitlement RESOLVER is wired (`hasEntitlementResolver`). 🔴 core's
|
|
12
|
-
* `allowWorkflows` (RuntimeCaps) is TIGHTEN-ONLY — a resolver can only DENY; `undefined` = NO restriction, so the
|
|
13
|
-
* deployment capability governs. Therefore WITHOUT a resolver the engine would mount run_workflow UNGATED for every
|
|
14
|
-
* tenant. So we fail-closed here (defense-in-depth: a misconfigured multi-tenant deployment with no entitlement
|
|
15
|
-
* source must NOT leak the LLM-authored workflow engine). WITH a resolver, core enforces `allowWorkflows`
|
|
16
|
-
* per-principal (deny → fail-closed). Single-user (owns its own worker) honors directly. Three-gate: engine-can ∧
|
|
17
|
-
* center-may(allowWorkflows) ∧ shell-show.
|
|
18
|
-
*
|
|
19
|
-
* 🔴 [ref](2026-09-03):fail-closed 的**方向**从来是对的,错的是它**没人说**。多租户 + 无 entitlement 源
|
|
20
|
-
* 的部署上,这条腿把 `body.selfOrchestration:true`(以及 `settings.ultracode` 展开出来的同一个意图)静默
|
|
21
|
-
* 折成 `undefined`,而 `/v1/capabilities` 照报 `workflows:true` ⇒ 「壳显示支持、引擎按普通 run 跑」。修法
|
|
22
|
-
* 是把部署级半场抽成下面的 {@link selfOrchestrationDenial}(能力位与准入**同一只**谓词),提交面在拒因
|
|
23
|
-
* 在场时**响亮**拒(`routes` 的 501 `capability.self_orchestration_required`),不再静默折。
|
|
24
|
-
*/
|
|
25
1
|
export declare function selfOrchestrationFromBody(body: {
|
|
26
2
|
selfOrchestration?: unknown;
|
|
27
3
|
}, config: SelfOrchestrationGateConfig, hasEntitlementResolver: boolean): true | undefined;
|
package/dist/task-workflow.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
1
2
|
export function selfOrchestrationFromBody(body, config, hasEntitlementResolver) {
|
|
2
3
|
if (body.selfOrchestration !== true || config.selfOrchestrationEnabled !== true)
|
|
3
4
|
return undefined;
|
|
@@ -15,7 +16,7 @@ export function enableForkFromBody(body, config, hasEntitlementResolver) {
|
|
|
15
16
|
return false;
|
|
16
17
|
if (body.enableFork === false)
|
|
17
18
|
return false;
|
|
18
|
-
if (config
|
|
19
|
+
if (!DEPLOYMENT_SHAPE_PREDICATES.multiTenant.holds(config))
|
|
19
20
|
return true;
|
|
20
21
|
return hasEntitlementResolver;
|
|
21
22
|
}
|
package/dist/terminal.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ import { terminalProjection, type PausedCause, type TaskStatus, type TerminalCau
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function failureCodeOf(terminal: TerminalCause): string | undefined;
|
|
33
33
|
/**
|
|
34
|
-
* 本仓**对外机器码**的词法(
|
|
34
|
+
* 本仓**对外机器码**的词法([ref])。附录 A 那张表、core 的点名族(`limits.*` / `config.*` /
|
|
35
35
|
* `resume_at.*` / `output.*` / brain 扁平码)、工具层自注册码 —— 全体成员都是这一形:**小写**的
|
|
36
36
|
* `a-z0-9_`,用 `.` 分族。门 {@link OUTWARD_CODE_SHAPE} 在 `test/terminal-store-error-fold.test.ts`
|
|
37
37
|
* 里对**目录里真有的每一个码**断言这条词法(判据由 catalog 机器派生,不是手抄的一张清单)。
|
|
@@ -40,7 +40,7 @@ export declare const OUTWARD_CODE_SHAPE: RegExp;
|
|
|
40
40
|
/** 域外失败码的**唯一**落点(附录外的新码;原码进日志与 message,不丢)。 */
|
|
41
41
|
export declare const STORE_ERROR_CODE = "internal.store_error";
|
|
42
42
|
/**
|
|
43
|
-
* 一个失败码要上 wire 之前的**归一**(
|
|
43
|
+
* 一个失败码要上 wire 之前的**归一**([ref])。在词法内 ⇒ 原样;词法外 ⇒ {@link STORE_ERROR_CODE}。
|
|
44
44
|
*
|
|
45
45
|
* ── 病(test T-47,三库一致)────────────────────────────────────────────────────────────────────
|
|
46
46
|
* 本仓的 SQL 店把**驱动原生错误**原样抛回引擎,而 core 的 `errorCodeOf` 沿 `err.code`/`cause` 链取
|
|
@@ -63,7 +63,7 @@ export declare function outwardFailureCode(code: string): string;
|
|
|
63
63
|
/**
|
|
64
64
|
* **一条结果离开引擎、进入本仓(可重放账本 / run 行 / wire)的唯一封口** —— 两件事,一个出口:
|
|
65
65
|
* ①摘掉**耐久恢复能力凭据**(`CheckpointToken`);②把**域外的失败码**折成本仓的 `internal.store_error`
|
|
66
|
-
* ({@link outwardFailureCode},
|
|
66
|
+
* ({@link outwardFailureCode},[ref])。
|
|
67
67
|
*
|
|
68
68
|
* 🔴 为什么两件事合在一只函数里而不是并列两只(7.92.2 改名 `stripResumeToken` → `sealResultForExit`):
|
|
69
69
|
* 它们是**同一个出口上的同一件事** —— 「这条结果可以见人了吗」。并列两只 = 六个结算点各自要记得调两次,
|
|
@@ -92,12 +92,12 @@ export declare function sealResultForExit<T extends {
|
|
|
92
92
|
terminal: TerminalCause;
|
|
93
93
|
}>(result: T): T;
|
|
94
94
|
/**
|
|
95
|
-
* **投影出口的唯一属主**(
|
|
95
|
+
* **投影出口的唯一属主**([ref])—— core 的 `terminalProjection` + 对外码归一,一次。
|
|
96
96
|
*
|
|
97
97
|
* `docs/ASSISTANT-WIRE-CONTRACT.md` §5.0 说清了终局有**两张脸**:①结果**本身**(`done.result` / 200 体 /
|
|
98
98
|
* `GET /v1/runs/:id → result`,零投影)与②**五词投影**(run 行的 `status` / `error_code` 列、fleet 终态词、
|
|
99
99
|
* 决策腿 200 体的三格平面词)。两张脸各有一个属主:①是 {@link sealResultForExit},②就是本函数。
|
|
100
|
-
* **两个属主都折码**,否则同一次失败在两张脸上说两个不同的码 —— 而缺的那一张正是
|
|
100
|
+
* **两个属主都折码**,否则同一次失败在两张脸上说两个不同的码 —— 而缺的那一张正是 [ref] 修前仍在泄漏的
|
|
101
101
|
* 那条路(codex 对抗复审本轮 [medium],亲读证实:决策腿的 200 体从**未封口的** result 投影 `errorCode`,
|
|
102
102
|
* 于是驱动原生码照旧上 wire,尽管同一段代码落库那份已经折过)。
|
|
103
103
|
*
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* · **请求面没有放宽臂**:列表只能加行;送空、送别的行,部署的表一行不少。
|
|
17
17
|
* · **条目律借引擎的判官**(同一批 env 腿读的那几只:`compileReadDeny` / `resolveWriteProtectedTable` / `COMPLIANCE_CAPABILITIES`),宿主不自造第二份校验语义;读拒条目的元素文法 env / 中心 / 请求三腿同读
|
|
18
18
|
* `read-deny-entry.ts` 的那一只。受理面在 prepare 之前把坏形响亮拒掉(400),不让它变成 200 之后才失败的一跑。
|
|
19
|
-
* · 受理判据一处({@link tightenOnlySeatIssue}):不是数组 / 超帽 / 坏项 ⇒ 400 `request.field_invalid` + 机读位(`field` / `reason` / `count`+`cap` | `index`),与
|
|
19
|
+
* · 受理判据一处({@link tightenOnlySeatIssue}):不是数组 / 超帽 / 坏项 ⇒ 400 `request.field_invalid` + 机读位(`field` / `reason` / `count`+`cap` | `index`),与 [ref] 三桶同形。
|
|
20
20
|
* fresh 受理口、`resolveSpec`(两腿)、存体重放预判三处调这一只。
|
|
21
21
|
* · 座位表是闭集:加一座 = 加一行(`TIGHTEN_ONLY_SEAT_NAMES` 与表互为编译期穷举;`wire` 位置必须落在 `task-settings.ts` 的受理列里 —— 下面的编译期门)。
|
|
22
22
|
*
|
|
@@ -93,13 +93,14 @@ interface SeatRow<E> {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
96
|
+
* 读拒模式的请求侧星号界:**一颗 `*` 算一颗**(调用方写下的每一颗都计,不按「连续的一串」计;整段 `**` / `id_rsa*` / `*.pem` / `*secret*` / `*_*_key` / `a**b` 都在内)。
|
|
97
|
+
*
|
|
98
|
+
* ⚠️ 这条界当初的理由(引擎把每一颗 `*` 编成一个 `[^/]*`,一段里 k 颗星对长度 n 的段是 n 的 k 次方级回溯)自引擎 7.55.0 起**不成立**:段匹配是 `*` glob,
|
|
99
|
+
* 没有从模式铸出来的表达式,代价至多是模式长度与段长的乘积、与星的个数和排布无关。所以界今天是**受理面的口径**(请求是不可信的写者),不再对应引擎里的某个成本 ——
|
|
100
|
+
* 拒句与契约都不再给「引擎回溯」这个理由。界本身退不退是放宽方向的另一件事,不在这里。
|
|
99
101
|
*/
|
|
100
102
|
export declare const MAX_READ_DENY_STARS_PER_SEGMENT = 2;
|
|
101
|
-
/** 整张 `readDenyPatterns` 列表的 `*`
|
|
102
|
-
* 不是上界:16 颗的整表(8 条各 2 颗)对对手形的 4000 字段本机实测约 1 s、万字段约 5–6 s;段长的那一维只能在引擎里收(线性时间匹配或路径段长度上限,已向引擎请托)。 */
|
|
103
|
+
/** 整张 `readDenyPatterns` 列表的 `*` 总预算(同一条受理口径,理由见 {@link MAX_READ_DENY_STARS_PER_SEGMENT}:星的个数不再对应引擎里的成本;条数与单条长度才是还在的两个成本维度)。 */
|
|
103
104
|
export declare const MAX_READ_DENY_STARS_TOTAL = 16;
|
|
104
105
|
/** 每座条数的缺省上限 —— 与 `settings.permissions` 三桶同一只帽(编译口的整表帽;超了响亮拒,不截)。读拒模式另有更紧的一只({@link MAX_READ_DENY_ENTRIES}),每座的帽写在座位表那一行。 */
|
|
105
106
|
export declare const MAX_TIGHTEN_ONLY_SEAT_ENTRIES = 1000;
|
|
@@ -54,7 +54,7 @@ export const TIGHTEN_ONLY_SEATS = {
|
|
|
54
54
|
}
|
|
55
55
|
const stars = maxStarsPerSegment(read.entry.pattern);
|
|
56
56
|
if (stars > MAX_READ_DENY_STARS_PER_SEGMENT) {
|
|
57
|
-
return { ok: false, after: ` has a path segment with ${stars} "*" wildcards — at most ${MAX_READ_DENY_STARS_PER_SEGMENT} per segment are accepted in a request, each "*" counted
|
|
57
|
+
return { ok: false, after: ` has a path segment with ${stars} "*" wildcards — at most ${MAX_READ_DENY_STARS_PER_SEGMENT} per segment are accepted in a request, each "*" counted; merge them, or ask the operator to put the row in READ_DENY_PATTERNS` };
|
|
58
58
|
}
|
|
59
59
|
return { ok: true, value: read.entry };
|
|
60
60
|
},
|