@sema-agent/server 7.133.0 → 7.135.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 +221 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/USAGE.md +222 -36
- package/deploy/sema-up/README.md +16 -0
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +15 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +129 -0
- package/deploy/sema-up/chart/templates/sealed-key.yaml +24 -0
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +14 -0
- package/deploy/sema-up/chart/templates/server.yaml +14 -0
- package/deploy/sema-up/chart/values-full-single.yaml +5 -1
- package/deploy/sema-up/chart/values.yaml +34 -0
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +25 -25
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +66 -154
- package/dist/approval-card.js +33 -52
- package/dist/approval-content-kind.d.ts +26 -6
- package/dist/approval-content-kind.js +23 -3
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +91 -0
- package/dist/approval-gate-currency.js +120 -0
- 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 +14 -8
- package/dist/approval.js +35 -16
- package/dist/auth-bridge.d.ts +1 -1
- 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/coordinators.d.ts +7 -2
- package/dist/boot/coordinators.js +8 -5
- 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 +2 -0
- package/dist/boot/leader.js +2 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/read-deny-anchor-audit.js +2 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +28 -24
- package/dist/boot/runner-deps.d.ts +29 -16
- package/dist/boot/runner-deps.js +12 -2
- 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-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +4 -3
- package/dist/boot/stage-06-runners.js +15 -4
- package/dist/boot/stage-07-capability-layer.d.ts +2 -1
- package/dist/boot/stage-08-reapers.d.ts +2 -1
- package/dist/boot/stage-09-leader.d.ts +2 -1
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -1
- package/dist/boot/stage-10-http-server.js +2 -1
- package/dist/boot/stores.d.ts +8 -0
- package/dist/boot/stores.js +10 -13
- package/dist/boot/web-admin.d.ts +21 -15
- package/dist/boot/web-admin.js +16 -12
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- package/dist/budget.js +5 -1
- package/dist/caller-text-echo.d.ts +2 -0
- package/dist/caller-text-echo.js +2 -1
- package/dist/canonical-json.d.ts +2 -41
- package/dist/canonical-json.js +2 -13
- 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 +2 -2
- package/dist/capabilities/composite-members.js +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 +10 -7
- package/dist/capabilities/mcp-probe.js +2 -2
- 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 +27 -24
- package/dist/capability-facts.js +18 -20
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- package/dist/checkpoint-ctx-seal-m28.d.ts +42 -0
- package/dist/checkpoint-ctx-seal-m28.js +19 -0
- 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-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- 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/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/field-conflict.d.ts +2 -1
- package/dist/field-conflict.js +1 -0
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +50 -9
- package/dist/file-history-disclosure.js +8 -13
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +26 -14
- package/dist/fleet/fleet-bus.js +6 -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 +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +38 -20
- 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 +28 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +5 -2
- package/dist/http/checkpoint-ctx.d.ts +183 -2
- package/dist/http/checkpoint-ctx.js +197 -2
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +3 -3
- package/dist/http/durable-run-leg.js +7 -5
- package/dist/http/idempotency.d.ts +4 -4
- package/dist/http/idempotency.js +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 +39 -13
- package/dist/http/principal-gate.js +30 -6
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/refusal-body.d.ts +12 -0
- package/dist/http/refusal-body.js +11 -0
- package/dist/http/request-guards.d.ts +4 -13
- package/dist/http/request-guards.js +4 -17
- package/dist/http/resume-ctx-read.d.ts +53 -6
- package/dist/http/resume-ctx-read.js +26 -3
- package/dist/http/resume-legs.d.ts +5 -4
- package/dist/http/resume-legs.js +47 -29
- package/dist/http/route-ctx.d.ts +29 -38
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +5 -5
- package/dist/http/routes/approvals-assistant.js +91 -17
- 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 +6 -6
- package/dist/http/routes/diagnostics.js +1 -1
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +5 -4
- 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/memory-origin.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/rules.js +4 -4
- package/dist/http/routes/runs.js +44 -11
- package/dist/http/routes/session-sync.d.ts +3 -2
- package/dist/http/routes/session-sync.js +109 -62
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions-list.js +4 -5
- package/dist/http/routes/sessions.js +34 -48
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/tasks.js +21 -16
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/trace-usage.js +7 -9
- 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 +39 -33
- package/dist/http/server.js +5 -2
- 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.d.ts +4 -3
- package/dist/http/submit-ctx.js +19 -3
- 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 +35 -24
- package/dist/index.d.ts +2 -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 +9 -5
- package/dist/leader/wire.js +8 -7
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/main.js +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-origin-fence.js +2 -2
- 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-compat.d.ts +1 -1
- 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-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/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 +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/prompt-manifest.d.ts +19 -8
- package/dist/observability/prompt-manifest.js +9 -8
- 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/observability/tool-trace.js +8 -9
- 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/orchestration/workflow-park-decision.d.ts +1 -1
- package/dist/orchestration/workflow-park-decision.js +1 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -20
- package/dist/parked-decide.js +8 -5
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +3 -25
- package/dist/permission-rule-vocab.js +0 -13
- 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 +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/approval-payload-fingerprint.d.ts +14 -6
- package/dist/plugins/approval-payload-fingerprint.js +1 -1
- 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/caching-session-store.d.ts +24 -33
- package/dist/plugins/caching-session-store.js +8 -19
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +66 -67
- package/dist/plugins/checkpoint-store-sql.js +100 -103
- 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 +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- 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 +23 -12
- package/dist/plugins/local-checkpoint-store.js +29 -4
- package/dist/plugins/local-session-store.d.ts +44 -45
- package/dist/plugins/local-session-store.js +42 -52
- package/dist/plugins/local-session-window.d.ts +12 -6
- package/dist/plugins/local-session-window.js +1 -17
- 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 +76 -39
- package/dist/plugins/one-time-migrations.js +127 -34
- 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 +16 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +74 -31
- 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 +9 -21
- package/dist/plugins/pg-session-storage.js +51 -42
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +22 -14
- package/dist/plugins/remote-env-device.js +28 -16
- 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 +8 -8
- 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/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.d.ts +11 -0
- package/dist/plugins/session-ownership.js +11 -0
- package/dist/plugins/session-placement.d.ts +12 -14
- package/dist/plugins/session-placement.js +2 -15
- 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/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -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/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 +9 -2
- package/dist/plugins/tidb-session-store.d.ts +17 -27
- package/dist/plugins/tidb-session-store.js +52 -42
- 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 +19 -4
- 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-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-tool-axes.d.ts +12 -0
- package/dist/request-tool-axes.js +20 -0
- 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/run-local.js +1 -0
- package/dist/runs.d.ts +15 -12
- package/dist/runs.js +19 -4
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +34 -2
- package/dist/sealed-key.js +55 -1
- package/dist/security.d.ts +31 -32
- 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 +19 -12
- package/dist/session-error-wire.js +4 -1
- package/dist/session-incarnation.d.ts +52 -35
- package/dist/session-incarnation.js +23 -8
- 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-sync-kernel.d.ts +38 -11
- package/dist/session-sync-kernel.js +10 -0
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -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 +3 -1
- package/dist/task-a2a.js +38 -5
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +14 -10
- package/dist/task-mcp.js +39 -12
- package/dist/task-settings.d.ts +34 -18
- package/dist/task-settings.js +34 -4
- 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 +273 -228
- package/dist/tool-approval.js +125 -47
- package/dist/tool-rule-names.d.ts +7 -1
- package/dist/trace/core-keyset-guard.d.ts +15 -9
- 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 +40 -1
- package/dist/trace/exit-seat.js +46 -14
- package/dist/trace/ledger-events.d.ts +6 -4
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +65 -46
- package/dist/trace/project.js +49 -5
- package/dist/trace/redact.d.ts +44 -27
- package/dist/trace/redact.js +343 -73
- package/dist/trace/self-minted-wire.d.ts +39 -14
- package/dist/trace/self-minted-wire.js +9 -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 +9 -3
- package/dist/trace/wire-projection-faces.js +7 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- 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 +29 -4
- package/dist/web-admin-client/skills-mcp.js +31 -4
- package/dist/web-admin-client/types.d.ts +17 -10
- package/dist/workspace-space.d.ts +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +35 -2
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/skills/loop.md +1 -1
- package/dist/mcp-tool-faces.d.ts +0 -69
- package/dist/mcp-tool-faces.js +0 -104
- package/dist/orchestration/workflow-journal-entry.js +0 -27
|
@@ -11,11 +11,13 @@ import { MAX_HOOK_NOTICE_TEXT_CHARS, boundedNoticeText } from "../fleet/fleet-bu
|
|
|
11
11
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
12
12
|
import { LIMIT_REASONS } from "../limit-refusal.js";
|
|
13
13
|
import { clipDataText, echoCallerText } from "../caller-text-echo.js";
|
|
14
|
+
import { seatText } from "../trace/exit-seat.js";
|
|
14
15
|
import { redactSecrets, buildDisplaySafeUrl } from "../trace/redact.js";
|
|
15
|
-
import {
|
|
16
|
+
import { canonicalJsonStringify } from "@sema-agent/core";
|
|
16
17
|
import { ccPromptSystemFor, wrapCondition, parseCcVerdict, CC_EVALUATOR_MAX_OUTPUT_TOKENS } from "./cc-stop-prompt.js";
|
|
17
18
|
import { ccAgentHookSystemFor } from "./cc-agent-hook-prompt.js";
|
|
18
19
|
import { renderBranchTranscript } from "./branch-transcript.js";
|
|
20
|
+
import { buildRequestUrlCredentialRefusal, findUrlCredential, urlCredentialHeaderExit } from "../url-credential.js";
|
|
19
21
|
import { HOOK_PHASES, HOOK_SOURCE_VOCABULARY_SENTENCE, hookPhaseOf, readHookGroupSource } from "./hook-source.js";
|
|
20
22
|
import { commandLineChars, composeHookEnvLayer, hookPluginChars, planCommandSpawn, readHookArgs, readHookPlugin } from "./command-spawn.js";
|
|
21
23
|
export const MAX_HOOK_ENTRIES_PER_EVENT = 32;
|
|
@@ -102,9 +104,7 @@ export const MAX_MATCHER_EVAL_CHARS = MAX_HOOK_COMMAND_CHARS;
|
|
|
102
104
|
export const ADMISSION_MATCHER_BUDGET = { budgetMs: 1_000, totalMs: 5_000 };
|
|
103
105
|
export const MATCHER_ECHO_CHARS = 200;
|
|
104
106
|
export const IF_ECHO_CHARS = 200;
|
|
105
|
-
const
|
|
106
|
-
const LOG_ERROR_ECHO_CHARS = 300;
|
|
107
|
-
const LOG_MESSAGE_ECHO_CHARS = 500;
|
|
107
|
+
const BLANKED_HEADER_ECHO_CHARS = 200;
|
|
108
108
|
const MATCHER_UNJUDGED_TAG = "server.hooks.matcher-unjudged";
|
|
109
109
|
function matcherReadsWireToolName(event) {
|
|
110
110
|
return HOOK_EVENT_OWNER[event] === "engine" && HOOK_EVENT_MATCHER_FIELD[event] === "tool_name";
|
|
@@ -331,6 +331,24 @@ export function hooksMatcherIssue(config, depth, budget = {}) {
|
|
|
331
331
|
}
|
|
332
332
|
return undefined;
|
|
333
333
|
}
|
|
334
|
+
export function hooksUrlCredentialIssue(config) {
|
|
335
|
+
for (const [event, groups] of Object.entries(config)) {
|
|
336
|
+
for (const [groupIndex, group] of (groups ?? []).entries()) {
|
|
337
|
+
for (const [entryIndex, entry] of group.hooks.entries()) {
|
|
338
|
+
if (entry.type !== "http")
|
|
339
|
+
continue;
|
|
340
|
+
const credential = findUrlCredential(entry.url);
|
|
341
|
+
if (credential !== undefined)
|
|
342
|
+
return { event, groupIndex, entryIndex, credential };
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return undefined;
|
|
347
|
+
}
|
|
348
|
+
export function buildHooksUrlCredentialRefusal(issue) {
|
|
349
|
+
const entry = `settings.hooks.${issue.event}[${issue.groupIndex}].hooks[${issue.entryIndex}]`;
|
|
350
|
+
return buildRequestUrlCredentialRefusal(`${entry}.url`, issue.credential, urlCredentialHeaderExit(`${entry}.headers`));
|
|
351
|
+
}
|
|
334
352
|
const HOOKS_PIECE_MEANING = {
|
|
335
353
|
"hooks-not-object": "`hooks` must be an object keyed by hook event name",
|
|
336
354
|
"unknown-event": "not a hook event name",
|
|
@@ -504,10 +522,10 @@ const MAX_LLM_ENTRIES_PER_EVENT = 4;
|
|
|
504
522
|
const DEFAULT_PROMPT_HOOK_TIMEOUT_SECONDS = 30;
|
|
505
523
|
const DEFAULT_AGENT_HOOK_TIMEOUT_SECONDS = 120;
|
|
506
524
|
function logHookCommandFailed(ctx, event, run) {
|
|
507
|
-
ctx.logger.warn("hook_command_failed", { event, code: run.code, stderr:
|
|
525
|
+
ctx.logger.warn("hook_command_failed", { event, code: run.code, stderr: seatText("operator-log-error", run.stderr) });
|
|
508
526
|
}
|
|
509
527
|
function logHookSystemMessage(ctx, event, message) {
|
|
510
|
-
ctx.logger.info("hook_system_message", { event, message:
|
|
528
|
+
ctx.logger.info("hook_system_message", { event, message: seatText("operator-log-message", message) });
|
|
511
529
|
}
|
|
512
530
|
function hookDisplayName(entry) {
|
|
513
531
|
if (typeof entry.statusMessage === "string" && entry.statusMessage.length > 0)
|
|
@@ -536,7 +554,7 @@ function emitHookNotice(ctx, n) {
|
|
|
536
554
|
}
|
|
537
555
|
catch (e) {
|
|
538
556
|
recordFailOpen("server.hooks.notice-sink-threw", `kind=${n.kind} event=${n.event}`);
|
|
539
|
-
ctx.logger.warn("hook_notice_sink_threw", { kind: n.kind, event: n.event, error:
|
|
557
|
+
ctx.logger.warn("hook_notice_sink_threw", { kind: n.kind, event: n.event, error: seatText("operator-log-text", String(e)) });
|
|
540
558
|
}
|
|
541
559
|
}
|
|
542
560
|
function noteHookFailure(ctx, args) {
|
|
@@ -557,7 +575,7 @@ function noteHookFailure(ctx, args) {
|
|
|
557
575
|
}
|
|
558
576
|
function noteMatcherOverBudget(ctx, args) {
|
|
559
577
|
const budgetMs = ADMISSION_MATCHER_BUDGET.budgetMs;
|
|
560
|
-
const shown = (text) =>
|
|
578
|
+
const shown = (text) => seatText("operator-log-text", text);
|
|
561
579
|
const expression = shown(args.expression);
|
|
562
580
|
const value = shown(args.value);
|
|
563
581
|
ctx.logger.warn("hook_matcher_over_budget", { event: args.event, scope: args.scope, expression, value, budgetMs, selected: true });
|
|
@@ -879,7 +897,7 @@ async function fireAsyncCommandHook(entry, payload, ctx, event, halt) {
|
|
|
879
897
|
}
|
|
880
898
|
child.on("error", (e) => {
|
|
881
899
|
clearTimeout(timer);
|
|
882
|
-
ctx.logger.warn("hook_async_failed", { event, reason: "spawn_failed", error:
|
|
900
|
+
ctx.logger.warn("hook_async_failed", { event, reason: "spawn_failed", error: seatText("operator-log-error", String(e)) });
|
|
883
901
|
noteHookFailure(ctx, { event, entry, reason: "spawn_failed", stderr: String(e), toolName: toolNameOf(payload) });
|
|
884
902
|
});
|
|
885
903
|
child.on("close", (code) => {
|
|
@@ -902,14 +920,14 @@ async function fireAsyncCommandHook(entry, payload, ctx, event, halt) {
|
|
|
902
920
|
ctx.logger.info("hook_async_rewake_delivered", { event, chars: text.length });
|
|
903
921
|
else
|
|
904
922
|
ctx.logger.warn("hook_async_rewake_dropped", { event, reason: "no_live_stream" });
|
|
905
|
-
}, (e) => ctx.logger.warn("hook_async_rewake_dropped", { event, reason: "wake_failed", error:
|
|
923
|
+
}, (e) => ctx.logger.warn("hook_async_rewake_dropped", { event, reason: "wake_failed", error: seatText("operator-log-text", String(e)) }));
|
|
906
924
|
});
|
|
907
925
|
child.stdin?.on("error", () => { });
|
|
908
926
|
child.stdin?.end(`${JSON.stringify(boundedToolInputPayload(payload))}\n`);
|
|
909
927
|
child.unref();
|
|
910
928
|
}
|
|
911
929
|
catch (e) {
|
|
912
|
-
ctx.logger.warn("hook_async_failed", { event, reason: "spawn_failed", error:
|
|
930
|
+
ctx.logger.warn("hook_async_failed", { event, reason: "spawn_failed", error: seatText("operator-log-error", String(e)) });
|
|
913
931
|
noteHookFailure(ctx, { event, entry, reason: "spawn_failed", stderr: String(e), toolName: toolNameOf(payload) });
|
|
914
932
|
}
|
|
915
933
|
}
|
|
@@ -996,7 +1014,7 @@ async function runHttpHook(entry, payload, ctx, event) {
|
|
|
996
1014
|
blankedCount: interpolated.blanked.length,
|
|
997
1015
|
blanked: interpolated.blanked
|
|
998
1016
|
.slice(0, MAX_BLANKED_REFERENCES_LOGGED)
|
|
999
|
-
.map(({ header, name, reason }) => ({ header: echoCallerText(header, { maxChars:
|
|
1017
|
+
.map(({ header, name, reason }) => ({ header: echoCallerText(header, { maxChars: BLANKED_HEADER_ECHO_CHARS }), name: echoCallerText(name, { maxChars: BLANKED_HEADER_ECHO_CHARS }), reason })),
|
|
1000
1018
|
});
|
|
1001
1019
|
}
|
|
1002
1020
|
const headers = { "content-type": "application/json", ...interpolated.headers };
|
|
@@ -1034,7 +1052,7 @@ async function runHttpHook(entry, payload, ctx, event) {
|
|
|
1034
1052
|
if (trimmed === "")
|
|
1035
1053
|
return { code: 0, stdout: "{}", stderr: "", timedOut: false };
|
|
1036
1054
|
if (!parseHookStdout(body)) {
|
|
1037
|
-
ctx.logger.warn("hook_http_non_json_response", { url: buildDisplaySafeUrl(entry.url), preview:
|
|
1055
|
+
ctx.logger.warn("hook_http_non_json_response", { url: buildDisplaySafeUrl(entry.url), preview: seatText("operator-log-text", trimmed) });
|
|
1038
1056
|
noteHookFailure(ctx, {
|
|
1039
1057
|
event: eventOfPayload(payload),
|
|
1040
1058
|
entry,
|
|
@@ -1086,7 +1104,7 @@ function readHookStdout(ran, event, ctx, payload, ledger) {
|
|
|
1086
1104
|
return out;
|
|
1087
1105
|
const t = run.stdout.trim();
|
|
1088
1106
|
if (t.startsWith("{") || t.startsWith("[")) {
|
|
1089
|
-
ctx.logger.warn("hook_bad_json_output", { event, type: entry.type, preview:
|
|
1107
|
+
ctx.logger.warn("hook_bad_json_output", { event, type: entry.type, preview: seatText("operator-log-text", t) });
|
|
1090
1108
|
noteHookFailure(ctx, { event, entry, reason: "bad_json", exitCode: run.code, stderr: run.stderr, toolName: toolNameOf(payload) });
|
|
1091
1109
|
ledger.unrun(ran.source, entry, "bad_json");
|
|
1092
1110
|
}
|
|
@@ -1193,7 +1211,7 @@ async function runMatchingEntries(event, groups, matchValue, payload, ctx, onceF
|
|
|
1193
1211
|
return { kind: "halted" };
|
|
1194
1212
|
}
|
|
1195
1213
|
if (run.spawnError) {
|
|
1196
|
-
ctx.logger.warn(entry.type === "http" ? "hook_http_request_failed" : entry.type === "prompt" || entry.type === "agent" ? "hook_llm_failed" : "hook_command_spawn_failed", { event, type: entry.type, error:
|
|
1214
|
+
ctx.logger.warn(entry.type === "http" ? "hook_http_request_failed" : entry.type === "prompt" || entry.type === "agent" ? "hook_llm_failed" : "hook_command_spawn_failed", { event, type: entry.type, error: seatText("operator-log-error", run.spawnError) });
|
|
1197
1215
|
if (!run.noticed)
|
|
1198
1216
|
noteHookFailure(ctx, { event, entry, reason: "spawn_failed", exitCode: run.code, stderr: run.spawnError, ...(toolName !== undefined ? { toolName } : {}) });
|
|
1199
1217
|
return { kind: "unrun", reason: "spawn_failed" };
|
|
@@ -1393,7 +1411,7 @@ export function createSettingsHooksRegistration(config, ctx, budgetMs) {
|
|
|
1393
1411
|
}
|
|
1394
1412
|
if (decision === "allow" || decision === undefined) {
|
|
1395
1413
|
const proposed = h.updatedInput !== null && typeof h.updatedInput === "object" ? h.updatedInput : undefined;
|
|
1396
|
-
const proposesRewrite = proposed !== undefined &&
|
|
1414
|
+
const proposesRewrite = proposed !== undefined && canonicalJsonStringify(proposed) !== canonicalJsonStringify(groupInput);
|
|
1397
1415
|
if (ran.distrust !== undefined && hookPhaseOf(ran.source) === "unmanaged" && (decision === "allow" || proposesRewrite)) {
|
|
1398
1416
|
noteVerdictUntrusted(ctx, { event: "PreToolUse", reason: ran.distrust, entry, source: ran.source, toolName });
|
|
1399
1417
|
}
|
|
@@ -1411,7 +1429,7 @@ export function createSettingsHooksRegistration(config, ctx, budgetMs) {
|
|
|
1411
1429
|
unknownDecision = true;
|
|
1412
1430
|
ctx.logger.warn("hook_permission_decision_unknown", {
|
|
1413
1431
|
event: "PreToolUse",
|
|
1414
|
-
decision:
|
|
1432
|
+
decision: seatText("operator-log-text", typeof decision === "string" ? decision : typeof decision),
|
|
1415
1433
|
tool: toolName,
|
|
1416
1434
|
effect: "hook ruling not honored (closed word set is allow|deny|ask); this call falls back to the engine gate",
|
|
1417
1435
|
});
|
|
@@ -1675,7 +1693,7 @@ export function createSettingsHooksRegistration(config, ctx, budgetMs) {
|
|
|
1675
1693
|
branch = await sctx.getBranch?.();
|
|
1676
1694
|
}
|
|
1677
1695
|
catch (e) {
|
|
1678
|
-
ctx.logger.warn("hook_stop_branch_failed", { error:
|
|
1696
|
+
ctx.logger.warn("hook_stop_branch_failed", { error: seatText("operator-log-error", e instanceof Error ? e.message : String(e)) });
|
|
1679
1697
|
}
|
|
1680
1698
|
const rendered = renderBranchTranscript(branch);
|
|
1681
1699
|
if (rendered.sufficient) {
|
|
@@ -1718,7 +1736,7 @@ export function createSettingsHooksRegistration(config, ctx, budgetMs) {
|
|
|
1718
1736
|
if (v.ok)
|
|
1719
1737
|
continue;
|
|
1720
1738
|
if (v.impossible) {
|
|
1721
|
-
ctx.logger.warn("hook_stop_condition_impossible", { event: "Stop", reason:
|
|
1739
|
+
ctx.logger.warn("hook_stop_condition_impossible", { event: "Stop", reason: seatText("operator-log-message", v.reason?.trim() ?? "") });
|
|
1722
1740
|
continue;
|
|
1723
1741
|
}
|
|
1724
1742
|
if (block === undefined)
|
|
@@ -1728,7 +1746,7 @@ export function createSettingsHooksRegistration(config, ctx, budgetMs) {
|
|
|
1728
1746
|
const out = llmExtra && entry.type === "prompt" ? parseHookStdout(run.stdout) : readHookStdout(ran, "Stop", ctx, payload, ledger);
|
|
1729
1747
|
if (!out) {
|
|
1730
1748
|
if (llmExtra && entry.type === "prompt") {
|
|
1731
|
-
ctx.logger.warn("hook_llm_unparsed_verdict", { event: "Stop", head:
|
|
1749
|
+
ctx.logger.warn("hook_llm_unparsed_verdict", { event: "Stop", head: seatText("operator-log-text", run.stdout.trim()) });
|
|
1732
1750
|
emitHookNotice(ctx, { kind: "hook_decision_unavailable", event: "Stop", reason: "unparsed" });
|
|
1733
1751
|
ledger.unrun(ran.source, entry, "bad_json", "the prompt hook's answer could not be read as a verdict");
|
|
1734
1752
|
}
|
package/dist/host-decision.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { type AskOutcome, type HostDecider, type PermissionResult, type ResumeOu
|
|
|
44
44
|
* 这个事实铸(`human_refused` / `approval_window_expired` / `policy_refused`)。core 若改这一格的词表,
|
|
45
45
|
* 读它的每一处编译期先红。
|
|
46
46
|
*
|
|
47
|
-
* 🔴 **
|
|
47
|
+
* 🔴 **[ref]:为什么这一格住在本叶子模块**(此前是 `tool-approval.ts` 的模块私有型):来源位随决议
|
|
48
48
|
* **落持久行**之后,店(`src/plugins/approval-ask-store-sql.ts` 的 `AskRow.settledBy` /
|
|
49
49
|
* `DecideAskInput.settledBy`)与协调器都要说同一个型 —— 而店不能反向依赖协调器。本模块只依赖
|
|
50
50
|
* `@sema-agent/core`,与同住的 {@link HostDecision}(耐久腿的同位事实)恰好是一对:一条决议的来源
|
|
@@ -54,7 +54,7 @@ export type HostSettledBy = NonNullable<Extract<AskOutcome, {
|
|
|
54
54
|
allow: boolean;
|
|
55
55
|
}>["settledBy"]>;
|
|
56
56
|
/** 直接取 core `ResumeOutcome` policy_ask 臂的 `hostDecision` 型 —— 本仓不复述那几个词(第二铸点)。它的 `decidedBy` 就是 core 的 `HostDecider`
|
|
57
|
-
* (core 7.45.0
|
|
57
|
+
* (core 7.45.0 [ref]:三个型位读同一只闭集)。**谁结束了这次等待**的闭集只有 core 包根那一只(`HOST_DECIDERS` / `HostDecider` / `isHostDecider`)。 */
|
|
58
58
|
export type HostDecision = Extract<ResumeOutcome, {
|
|
59
59
|
gate: "policy_ask";
|
|
60
60
|
}>["hostDecision"];
|
|
@@ -72,14 +72,14 @@ export type HostDecision = Extract<ResumeOutcome, {
|
|
|
72
72
|
* · `plan_review` 不读这只键:引擎的 plan_review 结局形没有决定者位(core 的结局规整会把别的键整只重建掉),收下它就是
|
|
73
73
|
* 一句「已记」的空话。那一门照兄弟门字段那一族拒(`approvals-assistant.ts` 的回决门族派生),候 core 给座。
|
|
74
74
|
*
|
|
75
|
-
* 词表的来源:core 包根的 `HOST_DECIDERS` / `HostDecider` / `isHostDecider`(core 7.45.0
|
|
75
|
+
* 词表的来源:core 包根的 `HOST_DECIDERS` / `HostDecider` / `isHostDecider`(core 7.45.0 [ref];此前包根只有型,本仓手写一只闭集常量 + 两道
|
|
76
76
|
* 编译门双向咬它 —— 那份手抄随本版退役)。wire 闭集 = 那只词表去掉扫的那一个词,运行期值与型都从它派生,没有第二份词表。
|
|
77
77
|
*/
|
|
78
78
|
/** 只有本服务自己的截止扫说得出的那一个词 —— core 词表里唯一不上 wire 的成员(`satisfies`:core 改名 / 退役它 ⇒ 这里编译红)。 */
|
|
79
79
|
declare const SWEEP_ONLY_DECIDER = "sla_timeout";
|
|
80
80
|
/** wire 上的出处词(决定体 `decidedBy` 的值域)= core 闭集去掉扫的那一个。 */
|
|
81
81
|
export type ApprovalDecidedBy = Exclude<HostDecider, typeof SWEEP_ONLY_DECIDER>;
|
|
82
|
-
/** wire 闭集的运行期值:core `HOST_DECIDERS`(
|
|
82
|
+
/** wire 闭集的运行期值:core `HOST_DECIDERS`([ref])去掉扫的那一个,顺序随 core。core 加一个词 ⇒ 它在这里自动在场(决定口的门照收;两只座的映射
|
|
83
83
|
* {@link liveSettledBy} 的穷举 `switch` 编译红,由人裁它在同步座上怎么落)。 */
|
|
84
84
|
export declare const APPROVAL_DECIDED_BY: readonly ApprovalDecidedBy[];
|
|
85
85
|
/** 闭集外的拒句(三条决定口同一句;码按各口既有约定,见 {@link readDecidedBy})。成员表派生自 {@link APPROVAL_DECIDED_BY}(词表一个来源;今天字节与 7.118.0 同)。 */
|
|
@@ -141,7 +141,7 @@ export declare function readDecidedBy(raw: unknown, directDoorActive: boolean):
|
|
|
141
141
|
*/
|
|
142
142
|
export declare function liveSettledBy(decidedBy: ApprovalDecidedBy): Extract<HostSettledBy, "policy"> | undefined;
|
|
143
143
|
/**
|
|
144
|
-
* 引擎自己的那一条例外:**一张要人的卡不归策略答** —— 判官是 core 的 `policyCannotAnswer(question, decidedBy)`(
|
|
144
|
+
* 引擎自己的那一条例外:**一张要人的卡不归策略答** —— 判官是 core 的 `policyCannotAnswer(question, decidedBy)`([ref] 包根导出;引擎的续跑入口、
|
|
145
145
|
* 执行带与同步座读同一条)。本仓**只在自己的副作用先于引擎落地的两条口**上于裁决之前问它(live `/respond`:会话放行 / 常驻规则 / 一条按 approve
|
|
146
146
|
* 回放的 DECIDED 行;耐久 ask 账:一条宣称 approve 的 DECIDED 行),并且只问**放行**那一向(与引擎续跑入口同:拒永远答得了)。耐久 `/decide` 不判:
|
|
147
147
|
* 引擎在 CAS 之前就拒(`checkpoint.invalid_outcome`,卡留 pending),本口的副作用全在引擎受理之后 —— 在那里再问一次就是第二个判官。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref](core 7.30.1 [ref] 提货)—— **宿主车道本地语言服务器**的唯一构造点。
|
|
3
3
|
*
|
|
4
|
-
* ## 病(DEBTS
|
|
4
|
+
* ## 病(DEBTS [ref] 同轴的第二条,7.99.0 修复验证 opus 腿普查带出)
|
|
5
5
|
* core 的 `NodeLspManager` 默认 spawn(`defaultLspSpawn`)在 7.30.1 之前**不带 env** ⇒ 语言服务器整份继承本进程的
|
|
6
6
|
* `process.env`,脑钥 / 仓库令牌 / 本仓自己的凭据键全在里面,而语言服务器会执行仓里的代码(构建脚本、插件、
|
|
7
7
|
* 工作区配置)。7.30.1 起 core 默认改成 `scrubSecretEnv(process.env)`(按键名**形状**剥),并开了
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* 本仓唯一组合 `hostSubprocessEnv` 的结果 —— 引擎 `inheritedHostEnv("scrub")` ∪ 点名放回)。
|
|
10
10
|
*
|
|
11
11
|
* ## 规则(一句)
|
|
12
|
-
* 语言服务器子进程的 env = 引擎 `inheritedHostEnv("scrub")`(形状剥 ∪ 本进程起服声明的自有凭据名)∪ 部署方点名放回的键(
|
|
12
|
+
* 语言服务器子进程的 env = 引擎 `inheritedHostEnv("scrub")`(形状剥 ∪ 本进程起服声明的自有凭据名)∪ 部署方点名放回的键([ref],见下节;缺省空名单)——
|
|
13
13
|
* 剥除与模型可驱动的 host shell(`inheritEnv:"scrub"`)
|
|
14
14
|
* 和 project-memory 的 git 子进程**同一只函数**:目录 `type:"secret"` 键按名剥 ∘ core 形状规则按形剥。只交 core 的默认
|
|
15
|
-
* 会漏掉形状规则认不出的本仓凭据键(当时是 `OTEL_EXPORTER_OTLP_HEADERS`,core 7.33.7
|
|
15
|
+
* 会漏掉形状规则认不出的本仓凭据键(当时是 `OTEL_EXPORTER_OTLP_HEADERS`,core 7.33.7 [ref] 起 core 按名剥它;今天只剩名单型旋钮三只),那正是 [ref] 当初的病形。
|
|
16
16
|
* 剥掉了什么经既有观测面留痕(site = `server.lsp.spawn-env`,每 site×key 一次披露 + 逐次计数)—— core 那侧
|
|
17
17
|
* 刻意不报(无收集器,KL),本仓这一格补上。
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* env 在**构造时**取一次快照(boot / run-local 起腿时),而不是 core 默认那样每次 spawn 现取:`NodeLspManagerOptions.env`
|
|
21
21
|
* 是一份静态记录。本仓的 `process.env` 是 boot 期输入(热配置走 web-admin,不改 `process.env`),两者在本仓部署上同值。
|
|
22
22
|
*
|
|
23
|
-
* ## 点名放行(
|
|
23
|
+
* ## 点名放行([ref],`LSP_ENV_ALLOW`)
|
|
24
24
|
* 剥除会连语言服务器自己的真实依赖一起剥掉(`.npmrc` 的 `${NPM_TOKEN}` 插值、rust-analyzer `cargo metadata` 私有 registry 的
|
|
25
25
|
* `CARGO_REGISTRIES_<名>_TOKEN` —— 形状规则按名判,分不出「给语言服务器用的令牌」与「编排器的令牌」)。出路 = 部署方点名:
|
|
26
26
|
* env = 引擎 `inheritedHostEnv("scrub")` 之上把 `config.lspEnvAllow` 点到的键经 `allowlistedEnv`(与沙箱三腿
|
package/dist/hosted-posture.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] / [ref](车LT,7.95.0)→ [ref] / B-10(车NB,7.99.0)—— **「这台部署是不是托管 / 多租」的单一铸点**。
|
|
3
3
|
*
|
|
4
4
|
* ## 为什么是一处
|
|
5
5
|
*
|
|
@@ -11,14 +11,12 @@
|
|
|
11
11
|
* ⚠️ 这句话此前在本仓被抄成「`boot/resolve-spec.ts` 阶段④ 的 `partitions` 字面量」——`src/` 里**没有**
|
|
12
12
|
* 那个字面量(全仓 `partitions` 的 src 命中全是注释;尺子:同目录 `config` 3721 命中)。手抄的**坐标**
|
|
13
13
|
* 比手抄的值更难发现烂掉,[ref] 的第一排查点就是它;
|
|
14
|
-
* ·
|
|
15
|
-
* (
|
|
16
|
-
* · `settings.hooks` —— `task-settings.ts` 的 `taskHooksHonored`(唯一属主;resolve-spec 装配 / 受理面 / 能力位三处同调)
|
|
17
|
-
* `
|
|
18
|
-
* · `additionalDirectories` / `additionalReadDirectories` ——
|
|
19
|
-
*
|
|
20
|
-
* · `settings.env` / `cwd` —— `cwdHonored ‖ deviceCwdHonored`,而
|
|
21
|
-
* **`deviceCwdHonored` 这一臂里没有 `requirePrincipal` 项**(`task-cwd.ts`:device 车道上那条路径落在
|
|
14
|
+
* · 能力授予面的赦免挂在「单主」上 —— 但**三条面读的是部署形表(`deployment-shape.ts`)里三个不同的行**
|
|
15
|
+
* (异源复核实测,别照「它们都一样」写;[ref] 起三行并排在一张表里,轴列即差异):
|
|
16
|
+
* · `settings.hooks` —— `task-settings.ts` 的 `taskHooksHonored`(唯一属主;resolve-spec 装配 / 受理面 / 能力位三处同调)= 表行
|
|
17
|
+
* `multiTenant` 的反面 ⇒ 采纳,否则忽略(**不看车道**,任何 `REMOTE_EXEC` 都一样);
|
|
18
|
+
* · `additionalDirectories` / `additionalReadDirectories` —— 表行 `callerOwnsWorkerDisk`(手在本 worker 盘上 ∧ 单主 = 今天只有 host);
|
|
19
|
+
* · `settings.env` / `cwd` —— 表行 `callerCwd`(读能力表 `callerCwd` 位:host 单主才开,**device 不读租户**:那条路径落在
|
|
22
20
|
* **发起者自己的设备**上,归属由 `device_session` 绑定行验过 ⇒ 跨租户面结构性不存在)。
|
|
23
21
|
*
|
|
24
22
|
* ⇒ 先把这个判定位铸成**一处**,再让各条腿都读它(clay 裁定③,2026-09-22):**不许各自加特判**——
|
|
@@ -36,7 +34,7 @@
|
|
|
36
34
|
* ⇒ 签发方配置是**身份验签轴**(谁的 JWT 算数),不是租户轴(这台机器有几个主人)。「受控于控制面」
|
|
37
35
|
* (`SEMA_WEB_ADMIN_*`,含 worker 名)同理是 fleet 管理轴,本判据同样不读。
|
|
38
36
|
*
|
|
39
|
-
* 随两臂一起删掉的(按类删干净,规则集变小):
|
|
37
|
+
* 随两臂一起删掉的(按类删干净,规则集变小):[ref] 腿①「托管 ∧ 未开 `REQUIRE_PRINCIPAL` ⇒ 拒启」
|
|
40
38
|
* (判据只剩读 `requirePrincipal` 的那一臂之后,那条合取恒假 ⇒ 结构上不可达)及其跨键不变量行;
|
|
41
39
|
* `run-local.ts` 为那两臂清 env 的清除口。
|
|
42
40
|
*
|
|
@@ -85,7 +83,7 @@ export interface HostedPostureFacts {
|
|
|
85
83
|
readonly evidence: readonly HostedEvidence[];
|
|
86
84
|
}
|
|
87
85
|
/**
|
|
88
|
-
* 判定位的**唯一**铸点(纯数据 ⇒ `build*`)。托管 ⇔ `
|
|
86
|
+
* 判定位的**唯一**铸点(纯数据 ⇒ `build*`)。托管 ⇔ 部署形表行 `multiTenant`(= 运维声明 `REQUIRE_PRINCIPAL=true`,[ref] ①)。
|
|
89
87
|
*
|
|
90
88
|
* `evidence` 仍是数组(按词表顺序收**全部**命中):拒因逐字点它们,运维才知道改哪儿;词表是闭集,
|
|
91
89
|
* 形状不随词数变。
|
|
@@ -99,7 +97,19 @@ export declare function hostedEvidenceNote(e: HostedEvidence): string;
|
|
|
99
97
|
export type TaskWriteFaceInput = TaskHostPostureScope & Readonly<Pick<ServiceConfigFlat, "taskWriteFaceEscalation">>;
|
|
100
98
|
/** 任务层宿主姿态声明被拒时的 wire 子码(附录 A 的 `request.` 族)。 */
|
|
101
99
|
export declare const HOST_POSTURE_REFUSED_CODE = "request.host_posture_refused";
|
|
102
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* **射程判据** —— 这台部署认不认「任务层替它声明的宿主姿态」?
|
|
102
|
+
*
|
|
103
|
+
* 两条腿读它,都是**真的开门**的声明 ⇒ 都响亮拒(同码 {@link HOST_POSTURE_REFUSED_CODE}、同状态 422):
|
|
104
|
+
* · 腿② 写容纳面(bypassPermissions 开的写面)—— {@link taskWriteFaceRefusal};
|
|
105
|
+
* · 腿④ [ref] host shell 继承整份用户环境(`inheritEnv:"all"`)—— {@link taskInheritEnvRefusal}。
|
|
106
|
+
* [ref] 前还有腿③(`approverPosture`,忽略 + 留声),随那个请求键一起退役。射程只铸在这一处,同族声明读同一只。
|
|
107
|
+
*
|
|
108
|
+
* 🔴 **device 车道不适用(clay 裁定③ 2026-09-22)**:device 车道上 host 闸防的那个跨租户宿主穿越**结构性不存在**
|
|
109
|
+
* (路径落在**发起者自己的设备**上,归属由 `device_session` 绑定行 + 准入链的 owner 谓词验过),叠加 clay [ref]
|
|
110
|
+
* 「device 零额外审批」⇒ 在那条车道上拿租户声明当判据就是**用错轴**。与 `settings.env` / `cwd` 两键在那条车道上的既有臂同源同形。
|
|
111
|
+
* [ref] 起射程判据 = 部署形表行 `taskHostPostureDeclarations`(device 车道 ∨ 单主;轴列 lane + principal);下面是它读的键集(托管证据 + 车道)。
|
|
112
|
+
*/
|
|
103
113
|
export type TaskHostPostureScope = HostedPostureInput & Readonly<Pick<ServiceConfigFlat, "remoteExec">>;
|
|
104
114
|
/**
|
|
105
115
|
* **腿②** —— 这条请求要掀开写围栏,这台部署给不给?返回拒因;`undefined` = 放行。
|
|
@@ -109,7 +119,7 @@ export type TaskHostPostureScope = HostedPostureInput & Readonly<Pick<ServiceCon
|
|
|
109
119
|
* governance 的 `overrides.writeFace="roots"` 去压——实测 core 的 `tightenTaskSpec` 在
|
|
110
120
|
* base `open` × override `roots` 上**静默**取 `roots`(该函数零回调形参 ⇒ 没有留痕通道)。
|
|
111
121
|
*
|
|
112
|
-
* 🔴 **射程(含 device 车道那条对位臂)
|
|
122
|
+
* 🔴 **射程(含 device 车道那条对位臂)在部署形表行 `taskHostPostureDeclarations` 上** ——
|
|
113
123
|
* 两条腿同射程、不同处置,射程只有一处答案。
|
|
114
124
|
*/
|
|
115
125
|
export declare function taskWriteFaceRefusal(c: TaskWriteFaceInput): string | undefined;
|
package/dist/hosted-posture.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TASK_WRITE_FACE_ESCALATIONS } from "./config-types.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
3
3
|
export const HOSTED_EVIDENCE_WORDS = ["require-principal"];
|
|
4
4
|
export function buildHostedPosture(c) {
|
|
5
5
|
const evidence = [];
|
|
6
|
-
if (c
|
|
6
|
+
if (DEPLOYMENT_SHAPE_PREDICATES.multiTenant.holds(c))
|
|
7
7
|
evidence.push("require-principal");
|
|
8
8
|
return { hosted: evidence.length > 0, evidence };
|
|
9
9
|
}
|
|
@@ -17,11 +17,6 @@ function hostedBecause(facts) {
|
|
|
17
17
|
return facts.evidence.map(hostedEvidenceNote).join("; ");
|
|
18
18
|
}
|
|
19
19
|
export const HOST_POSTURE_REFUSED_CODE = "request.host_posture_refused";
|
|
20
|
-
function hostPostureDeclarationsHonored(c) {
|
|
21
|
-
if (deviceCwdHonored(c))
|
|
22
|
-
return true;
|
|
23
|
-
return !buildHostedPosture(c).hosted;
|
|
24
|
-
}
|
|
25
20
|
export function taskWriteFaceRefusal(c) {
|
|
26
21
|
switch (c.taskWriteFaceEscalation) {
|
|
27
22
|
case "allow":
|
|
@@ -39,7 +34,7 @@ export function taskWriteFaceRefusal(c) {
|
|
|
39
34
|
`Set TASK_WRITE_FACE_ESCALATION to one of ${TASK_WRITE_FACE_ESCALATIONS.join(" | ")}, or unset it to let the deployment posture decide.`);
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
|
-
if (
|
|
37
|
+
if (DEPLOYMENT_SHAPE_PREDICATES.taskHostPostureDeclarations.holds(c))
|
|
43
38
|
return undefined;
|
|
44
39
|
const facts = buildHostedPosture(c);
|
|
45
40
|
return (`permissionMode:"bypassPermissions" opens the WRITE containment face (the engine's bypassPermissions mode writes outside the write roots) — the run could write outside the task root. ` +
|
|
@@ -47,7 +42,7 @@ export function taskWriteFaceRefusal(c) {
|
|
|
47
42
|
`Set TASK_WRITE_FACE_ESCALATION=allow if the DEPLOYMENT permits the task layer to open it, or omit permissionMode:"bypassPermissions".`);
|
|
48
43
|
}
|
|
49
44
|
export function taskInheritEnvRefusal(c) {
|
|
50
|
-
if (
|
|
45
|
+
if (DEPLOYMENT_SHAPE_PREDICATES.taskHostPostureDeclarations.holds(c))
|
|
51
46
|
return undefined;
|
|
52
47
|
const facts = buildHostedPosture(c);
|
|
53
48
|
return (`inheritEnv:"all" hands the model-driven host shell this machine's WHOLE environment (credential-shaped variables included — the host lane scrubs them by default). ` +
|
package/dist/http/admission.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 提交准入(
|
|
2
|
+
* 提交准入([ref] 切片:`http/server.ts` 的 `prepareSpec` 与它的模块级校验词表逐字搬家,正文一字未改)。
|
|
3
3
|
* 读体 → 验型 → 授权 → 建 spec 的**唯一**一条链;tasks / runs / A2A 三个提交面共用它(抄一份 = 抄一份会漂的 400)。
|
|
4
4
|
* ctx 字段 3 只(`deps` / `readJson` / `runnerFor`),机器算(closure-free-vars)与手抄一致。
|
|
5
5
|
*/
|
|
@@ -59,7 +59,7 @@ export interface UserSkillsRefusal {
|
|
|
59
59
|
readonly facts?: LimitFacts;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* core 7.41.0
|
|
62
|
+
* core 7.41.0 [ref] —— 顶层技能带 `manifest` 的拒因句(单铸点)。出路只点本服务上**真存在**的旋钮:技能的两只清单
|
|
63
63
|
* (`allowedTools` / `disallowedTools`)、圈工具 = deny 规则(请求 `settings.permissions.deny` / 运维 `APPROVAL_DENY`)或子代定义的
|
|
64
64
|
* `agents[].allowTools`、圈写路径 = 会话规则 `allowDirs`(`PUT /v1/sessions/:id/policy`)。
|
|
65
65
|
*/
|
package/dist/http/admission.js
CHANGED
|
@@ -2,15 +2,16 @@ import { APPROVAL_REACH, MCP_IMAGE_MAX_BASE64, isApprovalReach, isPermissionMode
|
|
|
2
2
|
import { isAtMentionable, matchCatalogModel, refusedCatalogEntry, selectableCatalog } from "../model-select.js";
|
|
3
3
|
import { echoModelRef, modelUnavailableMessage } from "../model-entry-refusal.js";
|
|
4
4
|
import { HttpError, sessionIdShapeIssue } from "../security.js";
|
|
5
|
-
import { MAX_SETTINGS_OUTPUT_STYLE_CHARS, MAX_SETTINGS_ENV_VARS, MAX_SETTINGS_ENV_KEY_CHARS, MAX_SETTINGS_ENV_VALUE_CHARS, PERMISSION_MODE_WORDS, parseTaskSettings, settingsPermissionBucketIssue, skillListingBudgetFractionOk, skillListingMaxDescOk, stampEntryPermissionMode, taskHooksHonored, taskSettingsKeyIssue } from "../task-settings.js";
|
|
5
|
+
import { MAX_SETTINGS_OUTPUT_STYLE_CHARS, MAX_SETTINGS_ENV_VARS, MAX_SETTINGS_ENV_KEY_CHARS, MAX_SETTINGS_ENV_VALUE_CHARS, PERMISSION_MODE_WORDS, parseTaskSettings, settingsPermissionBucketIssue, skillListingBudgetFractionOk, skillListingMaxDescOk, hooksKeyIssue, stampEntryPermissionMode, taskHooksHonored, taskSettingsKeyIssue } from "../task-settings.js";
|
|
6
6
|
import { tightenOnlySeatIssue } from "../tighten-only-seats.js";
|
|
7
|
+
import { approvalFrameFamiliesIssue } from "../tool-approval.js";
|
|
7
8
|
import { buildEntryModeClampNotice } from "../entry-mode-clamp-notice.js";
|
|
8
9
|
import { autonomyModeFloor } from "../runtime-governance.js";
|
|
9
10
|
import { taskBodyKeyIssue } from "../request-key-closure.js";
|
|
10
11
|
import { FILE_HISTORY_DISABLED_NO_RESTORE, fileHistoryRestoreConflict, fileHistoryRestoreKeysInBody, inheritEnvFieldIssue, singleMemberOffFieldIssue } from "../request-value-closure.js";
|
|
11
12
|
import * as facts from "../capability-facts.js";
|
|
12
|
-
import { buildHooksRefusal, parseHooksConfig, hooksMatcherIssue } from "../hooks/hook-runner.js";
|
|
13
|
-
import {
|
|
13
|
+
import { buildHooksRefusal, buildHooksUrlCredentialRefusal, parseHooksConfig, hooksMatcherIssue, hooksUrlCredentialIssue } from "../hooks/hook-runner.js";
|
|
14
|
+
import { judgeFreshRequestWebSearch } from "../plugins/web-search.js";
|
|
14
15
|
import { normalizeApproachNotice, skillToolListOk, unknownTaskAgentModelRef, validateTaskAgents } from "../spec-fields.js";
|
|
15
16
|
import { allowSelectorWarningsOf, skillToolListsOverCap } from "../rule-entry-list.js";
|
|
16
17
|
import { limitFacts, limitRefusal } from "../limit-refusal.js";
|
|
@@ -251,6 +252,13 @@ export function createAdmission(ctx) {
|
|
|
251
252
|
return null;
|
|
252
253
|
}
|
|
253
254
|
}
|
|
255
|
+
{
|
|
256
|
+
const familiesIssue = approvalFrameFamiliesIssue(st);
|
|
257
|
+
if (familiesIssue) {
|
|
258
|
+
sendError(res, 400, "request.field_invalid", familiesIssue.message, familiesIssue.fields);
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
254
262
|
const envRaw = st.env;
|
|
255
263
|
if (envRaw !== undefined && envRaw !== null) {
|
|
256
264
|
if (typeof envRaw !== "object" || Array.isArray(envRaw)) {
|
|
@@ -292,6 +300,21 @@ export function createAdmission(ctx) {
|
|
|
292
300
|
sendError(res, 400, "request.field_invalid", refusal.message, { field: refusal.field, detail: refusal.detail });
|
|
293
301
|
return null;
|
|
294
302
|
}
|
|
303
|
+
{
|
|
304
|
+
const hooksKeys = hooksKeyIssue(st.hooks, hooksParsed.config);
|
|
305
|
+
if (hooksKeys) {
|
|
306
|
+
sendError(res, 400, "request.body_shape", hooksKeys.message, { unknownKeys: hooksKeys.unknownKeys, unsupportedKeys: hooksKeys.unsupportedKeys });
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
{
|
|
311
|
+
const hookUrl = hooksUrlCredentialIssue(hooksParsed.config);
|
|
312
|
+
if (hookUrl !== undefined) {
|
|
313
|
+
const refusal = buildHooksUrlCredentialRefusal(hookUrl);
|
|
314
|
+
sendError(res, 400, "request.field_invalid", refusal.message, refusal.facts);
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
295
318
|
const toolMatcher = hooksMatcherIssue(hooksParsed.config, taskHooksHonored(deps.config) ? "regex" : "literal");
|
|
296
319
|
if (toolMatcher !== undefined) {
|
|
297
320
|
const refusal = buildHooksRefusal(toolMatcher);
|
|
@@ -300,9 +323,9 @@ export function createAdmission(ctx) {
|
|
|
300
323
|
}
|
|
301
324
|
}
|
|
302
325
|
{
|
|
303
|
-
const webSearchVerdict =
|
|
326
|
+
const webSearchVerdict = judgeFreshRequestWebSearch(st.webSearch);
|
|
304
327
|
if (webSearchVerdict.kind === "malformed") {
|
|
305
|
-
sendError(res, 400, "request.field_invalid", webSearchVerdict.issue);
|
|
328
|
+
sendError(res, 400, "request.field_invalid", webSearchVerdict.issue, webSearchVerdict.facts);
|
|
306
329
|
return null;
|
|
307
330
|
}
|
|
308
331
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 审批扫腿(
|
|
2
|
+
* 审批扫腿([ref] 切片:`http/server.ts` 5196–5488 逐字搬家,正文一字未改)——两条不经 HTTP 路由的赎回口:
|
|
3
3
|
* ①`denyExpiredApprovals`([ref] D-D,SLA 到期的 deny-sweep,main.ts 的 reaper 按拍调);
|
|
4
4
|
* ②`redeemParkedAsk`([ref],live 回决腿的 PARKED 赎回席,装配层接进协调器的晚绑座)。
|
|
5
5
|
* 两者都走 resume 家族的 `resumeCheckpoint`,所以它们的属主是「谁在无 HTTP 请求的情况下替人做决定」这件事,
|
|
@@ -3,7 +3,8 @@ const errText = (e) => redactHead(e instanceof Error ? e.message : String(e), 20
|
|
|
3
3
|
import { findParkOrigin } from "../parked-decide.js";
|
|
4
4
|
import { decodeCheckpointScope } from "../security.js";
|
|
5
5
|
import { hostDecisionFacts } from "../host-decision.js";
|
|
6
|
-
import {
|
|
6
|
+
import {} from "../tool-approval.js";
|
|
7
|
+
import { APPROVAL_GATE_KINDS } from "../approval-content-kind.js";
|
|
7
8
|
import { createWallClockJumpGuard } from "../wall-clock-jump-guard.js";
|
|
8
9
|
import { gatedPrincipal, hasServiceAuth } from "./principal-gate.js";
|
|
9
10
|
import { costQuotaRefusalOf } from "./request-guards.js";
|
|
@@ -104,9 +105,11 @@ export function createApprovalSweeps(ctx) {
|
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
107
|
const storedBodyUnservable = async (sessionId) => {
|
|
107
|
-
const read = await readResumeCtx(cs.getCtx(sessionId));
|
|
108
|
+
const read = await readResumeCtx(cs.getCtx(sessionId), { sessionId, opener: deps.checkpointCtxSealing });
|
|
108
109
|
if (read.kind === "corrupt")
|
|
109
110
|
return undefined;
|
|
111
|
+
if (read.kind === "unsealable")
|
|
112
|
+
return undefined;
|
|
110
113
|
if (read.kind === "absent")
|
|
111
114
|
return undefined;
|
|
112
115
|
return storedBodyReplayRefusal(read.ctx, deps.config);
|