@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
|
@@ -77,6 +77,12 @@ export interface TaskRequestBody {
|
|
|
77
77
|
* 只在非缺省风格时声明。值形的属主是引擎(`{ name, turnReminder? }` 恰两键、`name` 非空且 ≤ `OUTPUT_STYLE_NAME_MAX`、`turnReminder` 在场即非空串):
|
|
78
78
|
* 本服务**不另判**,坏值在 prepare 被引擎拒 `config.output_style_invalid`(不会被静默忽略)。能力位 `outputStyle`。 */
|
|
79
79
|
outputStyle?: TaskSpec["outputStyle"];
|
|
80
|
+
/** 7.135.0(core 7.55.0):这一条 run 不读部署的项目上下文(引擎 `TaskSpec.projectMemory`,唯一的词 `"disabled"`):带这个词的腿引擎不调
|
|
81
|
+
* `RunnerDeps.loadProjectMemory` —— 项目层、声明的指令文件、它们喂的那几处一并缺席(引擎自己的 git 状态车道、记忆引擎、技能 / hooks / MCP 不受影响)。
|
|
82
|
+
* 原样投给引擎;拼写门与 `fileHistory` 同一张单成员关断词表(`request-value-closure.ts`:别的值 fresh 400 `request.field_invalid`、续跑重放同判),
|
|
83
|
+
* 引擎读到的恒是这一个词;子代随父继承(引擎的夹紧表)。
|
|
84
|
+
* 本服务自铸的 `wiring_manifest.instructions` 段在这样的腿上缺席(loader 没被调就没有陈述)。能力位 `projectMemory`。 */
|
|
85
|
+
projectMemory?: TaskSpec["projectMemory"];
|
|
80
86
|
/** Explicit model selection (CLI `/model` picker + `run --model <ref>`). An INTENT by catalog
|
|
81
87
|
* name (e.g. "deepseek-pro") — resolveSpec gates it against the SAME allow-list as an inline `@name` mention
|
|
82
88
|
* (config.models keys), so it picks WHICH configured model but can never inject one. Wins over an inline
|
|
@@ -112,7 +118,7 @@ export interface TaskRequestBody {
|
|
|
112
118
|
* content in the user's OWN principal-isolated task (self-harm surface, not privilege widening);
|
|
113
119
|
* scenario/center skills remain the only trusted layer.
|
|
114
120
|
*
|
|
115
|
-
* 🔴 **类型 = core 的 `SkillSpec` 本体,不是它的手抄子集**(
|
|
121
|
+
* 🔴 **类型 = core 的 `SkillSpec` 本体,不是它的手抄子集**([ref]):这里曾写死
|
|
116
122
|
* `{ name; description; content }` —— core 闭集六位里的三位,而 `manifest` / `files` / `baseDir`
|
|
117
123
|
* 三位在运行期一直是**收的**(受理门 `validateUserSkills` 不判未知键,`mergeUserSkills` 原样透传到
|
|
118
124
|
* `TaskSpec.skills`)。一份会漂的手抄 = 声明面比真受理面**窄**,SDK 消费方按声明写代码就以为发不了,
|
|
@@ -199,13 +205,13 @@ export interface TaskRequestBody {
|
|
|
199
205
|
* value is the same handle as `resumeAt` (the prompt's taskId); the service resolves it → the entry id. Honored ONLY
|
|
200
206
|
* when `resumeAt` is ABSENT (the two modes are mutually exclusive). Requires the anchor map + a FileHistoryStore. */
|
|
201
207
|
rewindFilesTo?: string;
|
|
202
|
-
/**
|
|
208
|
+
/** [ref](core 7.31.0 [ref] `TaskSpec.fileHistory`)—— 请求级的**文件历史关断词**,唯一词 `"disabled"`(core 的拼法,
|
|
203
209
|
* 与 `checkpointStore` 同;没有 `"enabled"` —— 缺席就是「部署说了算」的唯一形,声明只能单向收紧)。`"disabled"` ⇒
|
|
204
210
|
* 这条 run 零历史店调用:编辑照常落盘,但不做首次触碰备份、不铸回合边界、不做 fork 携带;委派出去的子代继承
|
|
205
211
|
* (core `ParentSpecSeat` 从本位铸,本仓零接线)。`wiring_manifest.fileHistory` 报 `"disabled"`。
|
|
206
212
|
* 同一个提交里再要还原(`restoreFiles` / `rewindFilesTo` / 退役 `rewindFiles`)= 体内矛盾 ⇒ **受理时** 400
|
|
207
213
|
* `request.field_conflict`(`request-value-closure.ts` 的 `FILE_HISTORY_DISABLED_NO_RESTORE`):立门时 core 的 `rewind.capture_disabled`
|
|
208
|
-
* 落在会话按 `resumeAt` 分叉之后、拒后不回滚,所以本层在副作用之前拒(
|
|
214
|
+
* 落在会话按 `resumeAt` 分叉之后、拒后不回滚,所以本层在副作用之前拒([ref] / core 7.35.0 [ref] 起 core 在分叉**之前**拒,
|
|
209
215
|
* 本层 400 照旧有效)。续跑腿不过这道门。
|
|
210
216
|
* ⚠️ 拼写门**两腿同判、响亮拒**:fresh 400 `request.field_invalid`;resume 重放同判(与 `memoryCapture` / `memory`
|
|
211
217
|
* 同一张单成员闭集表,`request-value-closure.ts` 的 `singleMemberOffFieldIssue`)。
|
|
@@ -240,7 +246,7 @@ export interface TaskRequestBody {
|
|
|
240
246
|
* core 默认开列表注入的通道)与三个 deadline opt-out 在类型面失踪。agentListing/skillsListing 是
|
|
241
247
|
* boolean 透传(core DEFAULT-ON,explicit false 才关);budgetUsd/mcpInstructions 只认 literal true;
|
|
242
248
|
* limits 三个 opt-out 只认 literal false(normalizer 同判)。 */
|
|
243
|
-
/** core 7.39.0
|
|
249
|
+
/** core 7.39.0 [ref]:`planModeReminder` 退役(硬破坏,零别名)—— 提交即 400 点名退役;plan 姿态由引擎从 `permissionMode:"plan"` 自己陈述。 */
|
|
244
250
|
attachments?: {
|
|
245
251
|
todoReminder?: boolean;
|
|
246
252
|
todoReminderMode?: "baseline" | "off";
|
|
@@ -261,7 +267,7 @@ export interface TaskRequestBody {
|
|
|
261
267
|
forwardSubagentEvents?: boolean;
|
|
262
268
|
/** G3([ref] 壳侧承诺③/[ref]③):壳供 per-session scratchpad 路径(壳 vendored getScratchpadDir 的
|
|
263
269
|
* 约定路径)。接受后优先于 server 自算,同源喂 envFacts.scratchpadDir 宣告(core 据它开根围栏的洞,
|
|
264
|
-
*
|
|
270
|
+
* [ref] 起是唯一写者,引擎的模式门也据它免问)—— 壳提示词与引擎的写根指同一个目录。验收 fail-closed(单用户 +
|
|
265
271
|
* host-semantics lane + 绝对路径/深度/长度门,规则在 env-facts.acceptShellScratchpadDir),拒收形
|
|
266
272
|
* warn 后回落自算——「没到货引擎忽略 = 无害 additive」的对偶:异形键忽略,任务照跑。 */
|
|
267
273
|
scratchpadDir?: string;
|
|
@@ -288,7 +294,7 @@ export interface TaskRequestBody {
|
|
|
288
294
|
* it takes the same single-user gate as backgroundShell/hooks (multi-tenant warns + ignores; advertised via
|
|
289
295
|
* capabilities.retainBackgroundProcesses). Boolean fail-loud at submit; only `true` rides the spec. */
|
|
290
296
|
retainBackgroundProcesses?: boolean;
|
|
291
|
-
/**
|
|
297
|
+
/** [ref](core 7.8.0 [ref] `TaskSpec.excludeAllTools`,cli [ref] / 板 [ref]): **整只工具面卸载**
|
|
292
298
|
* —— 调用方工具、脚手架、手、MCP、skills 一个都不挂,模型这一 run 里没有任何工具可调、终局是纯文本。
|
|
293
299
|
*
|
|
294
300
|
* 🔴 **与 {@link excludeTools} 是两种语义,刻意不折叠**:`"*"` 是一个合法的调用方工具名,所以「卸全部」
|
|
@@ -300,7 +306,7 @@ export interface TaskRequestBody {
|
|
|
300
306
|
* 探测:本键在不在受理面由**键闭集**自己回答 —— 没接线的 server 版本对它 400 `request.body_shape`
|
|
301
307
|
* 并逐字列名,所以**不加能力位**(一个键一条探测路,不长第二条)。 */
|
|
302
308
|
excludeAllTools?: boolean;
|
|
303
|
-
/**
|
|
309
|
+
/** [ref](cli [ref] 请托;CC 2.1.280 `--disable-slash-commands`「Disable all skills」,cli280.js:240760 整张命令表置空):
|
|
304
310
|
* **这一发一只技能都不装** —— 场景出厂技能(启动期烤入 + 中心下发)、调用方 `skills`、子代定义的 `agents[].skills`
|
|
305
311
|
* 一个都不进 `TaskSpec`。`true` ⇒ `TaskSpec.skills = []`(core 对空表:零 `<skills>` 块、`Skill` 工具不挂);
|
|
306
312
|
* `false` / 缺席 = 技能照旧。值形门与 {@link excludeAllTools} **同一只**(非 boolean ⇒ 400 `request.field_invalid`);
|
|
@@ -308,10 +314,11 @@ export interface TaskRequestBody {
|
|
|
308
314
|
* 续跑重放逐字重放存量体 ⇒ 同一只写点同判(坏形 defensive:只认 literal `true`)。无租户门(收窄,不跨租户)。
|
|
309
315
|
* 探测位 `GET /v1/capabilities` 的 `disableSkills`(与本键同一个词)。 */
|
|
310
316
|
disableSkills?: boolean;
|
|
311
|
-
/** core 7.41.0
|
|
317
|
+
/** core 7.41.0 [ref] —— **人用名字点过的技能**(壳从人敲的 `/name` 解析出来的,按 `SkillSpec.name`),原样交给 core 的
|
|
312
318
|
* `TaskSpec.userInvokedSkills`:这些技能的 `allowedTools` / `disallowedTools` 开跑即生效,不出 `Skill` 卡(人自己点的名就是那句表态),
|
|
313
319
|
* 只管这一次 run(steer 不终止它,下一次 run 不带)。每个名字必须是这一 run 装着的技能(场景出厂 ∪ 本请求 `skills`),否则引擎
|
|
314
|
-
* 拒启 `config.user_invoked_skill_unknown`(同步腿 400)
|
|
320
|
+
* 拒启 `config.user_invoked_skill_unknown`(同步腿 400)。场景出厂那一半的名字从场景卡读(`GET /v1/capabilities/scenarios/:name` 的 `skills[].name`,
|
|
321
|
+
* 能力位 `scenarioSkills`;[ref])—— 拒句里的名字是引擎的散文,不是契约。值形:非空串数组(受理门 400 `request.field_invalid`);续跑重放逐字重放存量体,
|
|
315
322
|
* 坏形不挂键。不投递技能正文(正文照旧由 `Skill` 工具 / 调用方负责)。 */
|
|
316
323
|
userInvokedSkills?: string[];
|
|
317
324
|
/** [ref]② (core 1.314 工具面控制批): roster 真卸载清单(schema 不上 wire,manifest 收窄)。wire 工具名;
|
|
@@ -319,7 +326,7 @@ export interface TaskRequestBody {
|
|
|
319
326
|
* 读成空的条目(退役拼法 `bash`、大小写孪生 `BASH`、任何工具名都不可能有的拼法、`*`)7.131.0 起受理口 400 `config.tool_face_control` 并点名现名
|
|
320
327
|
* (拒侧读成空 = 放行,不照跑);读得出的名字与真未知名(拼写合法、没有近似也没有退役对应)照收。 */
|
|
321
328
|
excludeTools?: string[];
|
|
322
|
-
/**
|
|
329
|
+
/** [ref](core 7.49.0 [ref],[ref]):引擎的**可用性选择器** —— 这一 run 只用列出的工具(wire 名、别名、`Tool(content)` 整只、
|
|
323
330
|
* `mcp__srv` / `mcp__srv__*` / 工具段通配;`"*"` = 本层不设名单;`[]` = 什么都不给)。宿主**原样透传**进 `TaskSpec.allowTools`:
|
|
324
331
|
* 不算补集、不过滤、不与 `settings.permissions.allow`(免问)混词;真未知名(拼写合法、没有近似也没有退役对应:懒挂载的合法形)照跑(原样保留,今天什么都不准,之后挂上同名工具即生效;引擎告知运维一次),
|
|
325
332
|
* 任何工具名都不可能有的拼法由引擎开跑前拒(`config.tool_face_control`,同步腿 400);7.131.0 起受理口另拒近似名(大小写孪生 `BASH`:想放的什么也没放 = 静默收窄,句子点名现名);
|
|
@@ -381,7 +388,7 @@ export interface TaskRequestBody {
|
|
|
381
388
|
* 记忆面暗的部署(引擎未接线 / 多租户)上本键随 `memory` 整体缺席而无处落 —— 那里本就零采集。
|
|
382
389
|
* Rides the persisted body onto resume legs(与 memoryWrite 同姿势)。 */
|
|
383
390
|
memoryCapture?: "off";
|
|
384
|
-
/** core [ref] r5 §5 W3(server
|
|
391
|
+
/** core [ref] r5 §5 W3(server [ref]):**请求级「记忆整面关」声明** —— `"off"` = 这一次运行**不挂记忆面**
|
|
385
392
|
* (没有 `# Memory` 段/索引/三只记忆工具/写准入)。单成员闭集,**没有** `"on"`(缺席就是记忆照常挂的唯一形;
|
|
386
393
|
* 声明只能单向收紧)。透传为 `TaskSpec.memory.enabled:false` —— ⚠️ **保留事实,不折成整键缺席**:core 的
|
|
387
394
|
* 终局观测面把「有 spec 但被关」读作 `reason:"disabled"`、把「没有 spec」读作 `reason:"no-spec"`,审计上
|
|
@@ -402,10 +409,10 @@ export interface TaskRequestBody {
|
|
|
402
409
|
* 记忆面暗的部署(引擎未接线 / 多租户)上 `memory` 整键本就缺席,本声明无处落也无事可关。
|
|
403
410
|
* Rides the persisted body onto resume legs(与 `memoryWrite` 同姿势)。
|
|
404
411
|
* ✅ **子代地板自 core 7.22.0 到货,本仓零接线**:core 的 `parentSpecSeatOf` 从**这条 run 自己的**
|
|
405
|
-
* `spec.memory.enabled === false`
|
|
406
|
-
*
|
|
412
|
+
* `spec.memory.enabled === false` 铸座位的 `memory: { enabled: false }`(core 7.54.0 起是夹表座的一行;此前叫 `memoryOff`,已退役),
|
|
413
|
+
* `applyParentSpecSeat` 按表**夹**到子代上(改写成 `{ …子代自己的 scopes, enabled:false }`,永不删键;子代的 `enabled:true` 抬不起)⇒ 父关 ⇒ 子代 / 孙代 /
|
|
407
414
|
* workflow 子 spec / 跨 run 唤醒与保留 resume 一律无记忆面。🚧 **tier-3 耐久复活不带**(core 已记残余)。
|
|
408
|
-
* 链路的机器锚:`test/memory-off-request.test.ts` ⑥ 段(
|
|
415
|
+
* 链路的机器锚:`test/memory-off-request.test.ts` ⑥ 段(经 core 包根 `parentSpecSeatOf` / `applyParentSpecSeat` 读铸与施)。 */
|
|
409
416
|
memory?: "off";
|
|
410
417
|
/** 142-S4 projectId 线程化([ref] §2):这个 run 归属的项目(center 登记簿键,generic lowercase
|
|
411
418
|
* UUID — core S1 `resolveProjectId` marker 或 S3 无仓 mint 的产物;客户端只透传,零铸造权威)。是「哪个
|
|
@@ -419,15 +426,15 @@ export interface TaskRequestBody {
|
|
|
419
426
|
projectId?: string;
|
|
420
427
|
/** [#40 / TOC cwd seam, SDK 0.0.36] The TOC client's launch directory — the agent's HOST execution-env workspace
|
|
421
428
|
* runs HERE (CC-parity: `sema` in a project dir operates on THAT project). An ABSOLUTE host path. 🔒 honored ONLY
|
|
422
|
-
* on the single-user `host` lane (
|
|
429
|
+
* on the single-user `host` lane or the `device` lane (deployment-shape row `callerCwd`); IGNORED on cloud/container lanes + multi-tenant host
|
|
423
430
|
* (a caller can't point a shared/cloud worker at an arbitrary host path). Validated absolute (prepareSpec 400s a
|
|
424
431
|
* relative cwd — it would silently resolve against the SERVICE process cwd). */
|
|
425
432
|
cwd?: string;
|
|
426
433
|
/**
|
|
427
|
-
*
|
|
434
|
+
* [ref](7.106.0,core [ref] [ref] ②)—— 模型驱动的 host shell **继承多少用户环境**,由调用方按请求声明。
|
|
428
435
|
* 闭集两词(词表外 ⇒ 400 `request.field_invalid`,两腿同判,判据属主 `request-value-closure.ts` 的 `inheritEnvFieldIssue`):
|
|
429
436
|
* · `"all"` —— 整份用户环境**减本服务自有凭据名**(配置目录 secret 名 / 名单型旋钮名 / 模型条目 `apiKeyEnv`,起服向引擎声明一次,判在引擎;7.129.0 起,CC 交互形);只在**单用户**部署兑现,射程 = 写容纳面那一只
|
|
430
|
-
* `
|
|
437
|
+
* 部署形表行 `taskHostPostureDeclarations`(`deployment-shape.ts`)⇒ 托管部署(`REQUIRE_PRINCIPAL=true`)响亮拒
|
|
431
438
|
* 422 `request.host_posture_refused`;
|
|
432
439
|
* · `"scrub"` —— 缺省清洗(剥凭据形变量),**任何车道、任何部署**都受理(它就是缺省;7.106.0 合并复审 X7)。
|
|
433
440
|
* **缺席 = 缺省清洗**:不带键的请求把本会话的绑定清掉(不继承上一条请求的声明 —— 这一位是「本条请求要什么」,
|
|
@@ -439,7 +446,7 @@ export interface TaskRequestBody {
|
|
|
439
446
|
*/
|
|
440
447
|
inheritEnv?: "all" | "scrub";
|
|
441
448
|
/**
|
|
442
|
-
*
|
|
449
|
+
* [ref](device lane 首绑写协议,design `device-executor-lane-v2` §4.3.2)—— 这条**根会话**要执行在
|
|
443
450
|
* 哪台已注册的员工设备上(`POST /v1/devices/enroll` 返回的 `dev_<ulid>`)。
|
|
444
451
|
*
|
|
445
452
|
* 与 {@link cwd} **同级同信任姿势**:调用方供给、server 闸裁 —— 它不是身份,身份恒取验证过的
|
|
@@ -455,7 +462,7 @@ export interface TaskRequestBody {
|
|
|
455
462
|
deviceId?: string;
|
|
456
463
|
/** [ref] (CC `--add-dir`, core `TaskSpec.additionalDirectories`): extra host dirs the FILE tools may reach
|
|
457
464
|
* beyond the containment root. 🔒 Gated exactly like `cwd`/`shellEnv` — honored ONLY on the single-user host
|
|
458
|
-
* lane (
|
|
465
|
+
* lane (deployment-shape row `callerOwnsWorkerDisk`); off that lane `boot/resolve-spec.ts` drops them with a loud
|
|
459
466
|
* `task_additional_directories_ignored` (never silently). SHAPE is fail-loud at submit (absolute host paths,
|
|
460
467
|
* no `..` segments, ≤ MAX_ADDITIONAL_DIRS entries) — separate from whether the lane honors them.
|
|
461
468
|
* `additionalReadDirectories` (core 5.11.0) is the same door with a READ-only semantic: it widens the read
|
|
@@ -490,7 +497,7 @@ export interface TaskRequestBody {
|
|
|
490
497
|
* NOT mirrored here — a hand-written second shape on this interface would be the classic mirror-drift form.
|
|
491
498
|
* Per-key ownership is split, not single: `parseTaskSettings` (src/task-settings.ts) defensively owns the
|
|
492
499
|
* shared settings keys on every path, while `settings.webSearch` has its OWN judge (plugins/web-search.ts
|
|
493
|
-
* `judgeRequestWebSearch`,
|
|
500
|
+
* `judgeRequestWebSearch`, [ref]): a malformed block — including a missing or unknown `provider` — 400s on submit
|
|
494
501
|
* on every lane, and only the single-user
|
|
495
502
|
* scenario lane honors a well-formed one (capabilities/scenarios.ts — the multi-tenant lane ignores it by design;
|
|
496
503
|
* a malformed block replayed on resume mounts no WebSearch for that call — never a substitute destination — with a
|
|
@@ -526,7 +533,7 @@ export interface TaskRequestBody {
|
|
|
526
533
|
* (完整论证见 `task-mcp.ts` 的 `assertRequestMcpEntries` 顶注)。部署面的正门是 center 下发的
|
|
527
534
|
* `CenterMcpServer.contentOrigin`。
|
|
528
535
|
*
|
|
529
|
-
*
|
|
536
|
+
* [ref]:`transport.kind:"http"` 的条目可选 `assertionHeader`(托管连接器断言头的**头名**,契约包 settings-schema ≥12.2.0 同键)。
|
|
530
537
|
* 与 `principalHeader` **互斥**:同设 ⇒ 新提交腿同步 400 `request.body_shape`(拒句与契约包解析期那一句逐字相同);值不是字符串 ⇒ 400
|
|
531
538
|
* `request.field_invalid`。耐久 resume 腿不拒(重放存量 body),也**不摘 server**(摘了,park 在它工具审批上的任务批准后撞 `resume.tool_unavailable`
|
|
532
539
|
* 且每次重试重放同一份 body):降级到升级前的读法 —— server 照挂、`principalHeader` 胜、`assertionHeader` 不生效,一行 warn `mcp_assertion_header_ignored`。
|
|
@@ -572,6 +579,10 @@ export type DecideBinding = {
|
|
|
572
579
|
boundInputHash?: string;
|
|
573
580
|
/** [ref] edit: operator-corrected tool args, applied by core AFTER the binding check, on approve only. */
|
|
574
581
|
updatedInput?: unknown;
|
|
582
|
+
/** core 7.54.0: the words the approving person wrote on the card ("and tell the agent what to do next"). The decide door admits
|
|
583
|
+
* the key only on a person's `approve` (a `deny` or a policy decide with it is a 400 `request.field_conflict`), and the outcome
|
|
584
|
+
* mints carry it verbatim when present — the engine owns what counts as written (blank = nothing) and judges it again pre-CAS. */
|
|
585
|
+
feedback?: string;
|
|
575
586
|
};
|
|
576
587
|
/** [ref]([ref]④→[ref] 坐标轮换判定):409 `approval_stale` 拒体上的 additive 机读指路 ——
|
|
577
588
|
* **本会话当前 pending** 的 D-1 回显坐标,让持旧坐标的壳一跳重定位(免重拉列表)。
|
|
@@ -586,7 +597,7 @@ export type ApprovalStaleCurrentPending = {
|
|
|
586
597
|
/** 当前 pending 的 server 铸 `boundInputHash`(行上有才带;逐字回显,壳不重算)。 */
|
|
587
598
|
boundInputHash?: string;
|
|
588
599
|
};
|
|
589
|
-
/**
|
|
600
|
+
/** [ref] —— `wiring_manifest` **起手接线回执**在 wire 上的值形。
|
|
590
601
|
*
|
|
591
602
|
* 🔴 **从投影器的返回型派生,不手抄键**:键表的唯一属主是 `trace/project.ts` 的
|
|
592
603
|
* {@link wiringManifestFaceEventData}(它自己又把 `tools` 段的判形属主让给 core 的 typebox schema)。
|
|
@@ -596,11 +607,11 @@ export type ApprovalStaleCurrentPending = {
|
|
|
596
607
|
* `unknown`,产物按段 present-iff 铸)。所以这一行**不**声称「wire 上的每一段都有静态型」;它声称的是
|
|
597
608
|
* 「这一键的值恒等于那只投影器的产物」,而那正是消费端唯一需要的那句话。段级判据的属主在 core。 */
|
|
598
609
|
export type WiringManifestReceipt = ReturnType<typeof wiringManifestFaceEventData>;
|
|
599
|
-
/**
|
|
610
|
+
/** [ref] —— `POST /v1/tasks`(**非流式**)200 体的值形(不含下方 {@link SyncSubmitExtraKeys}),**从铸点返回型派生**:
|
|
600
611
|
* 「封口脱敏后的引擎结果」,park 时再叠 poll 回执三键 `{taskId, sessionId, status}`。键表的唯一属主是
|
|
601
612
|
* `http/sync-submit-body.ts` 的 `buildSyncSubmitBody`(结果的键集属主是 core `TaskResult`),这里不手抄一张。 */
|
|
602
613
|
export type SyncSubmitBody = ReturnType<typeof buildSyncSubmitBody>;
|
|
603
|
-
/**
|
|
614
|
+
/** [ref] —— `POST /v1/tasks`(**非流式**)200 体在 {@link SyncSubmitBody}(引擎结果 / park 回执)之外带的**附加键**。
|
|
604
615
|
*
|
|
605
616
|
* 两键都是 **additive + present-iff**,同一只装饰点铸(`routes/tasks.ts` 的 `withSyncSubmitKeys`),
|
|
606
617
|
* 所以三处 200 出口(终局 / suspended / needs_review)与幂等重放腿自动同形:
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { ensureTiDBTaskListSchema, ensurePgTaskListSchema } from "./plugins/task
|
|
|
23
23
|
export { createAuthorizer, principalFrom, HttpError, type AuthContext, type OwnerAwareSessionStore, } from "./security.js";
|
|
24
24
|
export { memoryScopeFor, memoryEngineBackendFor } from "./memory-scope.js";
|
|
25
25
|
export type { TaskRequestBody } from "./http/wire-types.js";
|
|
26
|
+
export { ensureCheckpointCtxSealing } from "./sealed-key.js";
|
|
27
|
+
export type { CheckpointCtxSealing } from "./http/checkpoint-ctx.js";
|
|
26
28
|
export { createHttpServer, type ServiceDeps, type RequestAuth, type FlatServiceDeps, type ServiceDepGroups, type ServiceCoreDeps, type ServiceStoreDeps, type ServiceCoordinatorDeps, type ServiceSeamDeps, type ServiceObservabilityDeps, type ServiceGovernanceDeps, type ServiceDeploymentDeps, type ServiceKnobDeps, } from "./http/server.js";
|
|
27
29
|
export { createSideQueryLane, type KeyResolver, type SideQueryLane, type SideQueryLaneCtx } from "./boot/side-query-lane.js";
|
|
28
30
|
export { createKeyResolver, resolveModelApiKey, type ModelKeyRef } from "./key-resolver.js";
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { createTaskListLane, taskListKeyFor, MAX_TASK_LIST_SESSIONS } from "./bo
|
|
|
20
20
|
export { ensureTiDBTaskListSchema, ensurePgTaskListSchema } from "./plugins/task-list-store-sql.js";
|
|
21
21
|
export { createAuthorizer, principalFrom, HttpError, } from "./security.js";
|
|
22
22
|
export { memoryScopeFor, memoryEngineBackendFor } from "./memory-scope.js";
|
|
23
|
+
export { ensureCheckpointCtxSealing } from "./sealed-key.js";
|
|
23
24
|
export { createHttpServer, } from "./http/server.js";
|
|
24
25
|
export { createSideQueryLane } from "./boot/side-query-lane.js";
|
|
25
26
|
export { createKeyResolver, resolveModelApiKey } from "./key-resolver.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] —— 项目指令文件**换源**通告(`engine_notice` 码 `instructions.source_changed`)的唯一铸点与基线属主口。
|
|
3
3
|
*
|
|
4
4
|
* ## 这件事为什么归本仓
|
|
5
5
|
* 选哪一份指令文件是**部署的内容半场**(`project-memory.ts` 的 `INSTRUCTION_FILE_CHAIN`;core 的 `loadProjectMemory`
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* 这条 run 的账本)。向 core 要 ctx 加 runId 已登记为未闭环项。
|
|
30
30
|
*/
|
|
31
31
|
import type { EngineNotice, EngineNoticeCode } from "@sema-agent/core";
|
|
32
|
-
/** 码常量型 = core 码册(
|
|
32
|
+
/** 码常量型 = core 码册([ref] 入册:受众 user、铸者 `NOTICE_MINTER` = `"server"`)。 */
|
|
33
33
|
export declare const INSTRUCTION_SOURCE_CHANGED: EngineNoticeCode;
|
|
34
34
|
/** 基线读数。`recorded: false` = 这个会话还没有任何 run 记过基线(首 run ⇒ 只写不发);`source: null` = 记过,且那一次
|
|
35
35
|
* 没有项目指令文件被选中。两态必须可判别:把「没记过」读成「记过没有」会让新会话首 run 发一帧 `null → CLAUDE.md`。 */
|
package/dist/key-resolver.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Model } from "@sema-agent/core";
|
|
2
|
-
/** 托管密钥解不开的三个成因(**托管**失败;密文形错归
|
|
2
|
+
/** 托管密钥解不开的三个成因(**托管**失败;密文形错归 [ref] `config.model_entry_invalid`,旧词 `unsupported_alg` 已随之退役)。 */
|
|
3
3
|
export type SealedCustodyPoisonReason = "sealed_decrypt_failed" | "stale_ciphertext" | "no_key_store";
|
|
4
4
|
/** 毒丸成因全集(闭集;拒句按它穷举)。 */
|
|
5
5
|
export type ModelKeyPoisonReason = SealedCustodyPoisonReason | "env_missing";
|
|
@@ -62,7 +62,7 @@ export declare class ModelKeyPoisonedError extends Error {
|
|
|
62
62
|
* A model absent from BOTH maps returns `undefined`, so core falls back to the brain's construction-time
|
|
63
63
|
* gateway key — that is the operator's choice (the entry declared no key of its own). A model that DECLARED
|
|
64
64
|
* a key it cannot get (poisoned sealed key, or an `apiKeyEnv` whose variable is missing / empty in this
|
|
65
|
-
* process) THROWS {@link ModelKeyPoisonedError} — never `undefined` (
|
|
65
|
+
* process) THROWS {@link ModelKeyPoisonedError} — never `undefined` ([ref]). When no per-model keys are
|
|
66
66
|
* configured at all this returns `undefined`, leaving the spec field unset so core's default path is
|
|
67
67
|
* byte-for-byte unchanged.
|
|
68
68
|
*
|
|
@@ -97,7 +97,7 @@ export declare function modelKeyPoisonOf(modelName: string, modelApiKeyEnv: Reco
|
|
|
97
97
|
* 被当成"没配 key"。链只有一条,重复实现就会长出这种半条链的偏差,故此处抽出同步内核共用。
|
|
98
98
|
*
|
|
99
99
|
* `undefined` = this model DECLARED no per-model key ⇒ the CALLER's gateway/default credential applies (the
|
|
100
|
-
* additive contract). A declared env reference whose variable is missing or empty throws (
|
|
100
|
+
* additive contract). A declared env reference whose variable is missing or empty throws ([ref]; 7.105.0 and
|
|
101
101
|
* earlier answered `undefined` there — the silent gateway fallback this family removes).
|
|
102
102
|
*/
|
|
103
103
|
export declare function resolveModelApiKey(modelName: string, modelApiKeyEnv: Record<string, string>, env?: NodeJS.ProcessEnv, modelApiKeys?: Record<string, string | SealedCustodyPoison>): string | undefined;
|
|
@@ -73,7 +73,7 @@ export interface LaneHomeSeatOptions {
|
|
|
73
73
|
*/
|
|
74
74
|
export interface LaneHomeConfig {
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* [ref]④ / core [ref] —— 运维声明的执行环境 **home 目录**(绝对路径,本环境自己的命名空间里;`REMOTE_EXEC_HOME_DIR`)。`~/…` 形权限规则(`Edit(~/.ssh/**)`)对**跑在本 env 里的调用**
|
|
77
77
|
* 就以它为基。值由 `boot/execution-env.ts` 从**唯一属主** `execution-lane-caps.ts` 的 `executionLaneHomeDir` 递进来;adapter 不自算(两处各算一份 = 422 门与引擎对同一条规则给相反答案)。
|
|
78
78
|
* 缺席 ⇒ 不声明:车道建环境时自己问执行环境的 `$HOME`({@link LaneHomeSeat});实测也缺席 ⇒ 本 env 的 `homeDir` 座缺席,core 对 `~/` 规则判 `unreadable`
|
|
79
79
|
* (fail-closed 的 ask),绝不回落引擎进程自己的 home(那在远端腿上是另一个用户的另一个目录 —— 静默守错目录正是 [ref] 的病)。
|
package/dist/leader/diffout.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface PullDiffOptions {
|
|
|
25
25
|
/** Fail-on-truncation cap (bytes). Default 5 MiB. */
|
|
26
26
|
maxBytes?: number;
|
|
27
27
|
signal?: AbortSignal;
|
|
28
|
-
/** Idle read timeout (E2B
|
|
28
|
+
/** Idle read timeout (E2B [ref] — never hang on an unreachable sandbox). Default 30s. */
|
|
29
29
|
readTimeoutMs?: number;
|
|
30
30
|
}
|
|
31
31
|
export type PullDiffResult = {
|
package/dist/leader/diffup.d.ts
CHANGED
|
@@ -28,11 +28,11 @@ export declare function buildUploadScript(p: {
|
|
|
28
28
|
/** The objective suffix that makes the upload the worker's last task step (no URL through the model). */
|
|
29
29
|
export declare function uploadStepSuffix(workDir: string): string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* [ref] —— the INCREMENTAL upload loop's lifetime protocol (single writer; the wire only runs its two verbs).
|
|
32
32
|
*
|
|
33
33
|
* While a worker env lives, a background loop re-runs the staged upload script every {@link UPLOAD_LOOP_PERIOD_SEC}
|
|
34
34
|
* seconds, so the worker's fixed diff key tracks its latest COMMITTED progress and salvage survives an env hard-crash
|
|
35
|
-
* (#16 tail: run 019eca71's "4 commits vaporized"). The loop must NOT outlive the env: the pre-
|
|
35
|
+
* (#16 tail: run 019eca71's "4 commits vaporized"). The loop must NOT outlive the env: the pre-[ref] form
|
|
36
36
|
* (`nohup sh -c 'while true; …' &`) relied on "the pod dies, the loop dies", which holds only where the env IS a
|
|
37
37
|
* pod — on an env whose shell is the host's (`RemoteHostExecutionEnv`, core `NodeExecutionEnv`) teardown does not
|
|
38
38
|
* reap detached processes (by contract), and the loop became a ppid-1 orphan (254 of them on one box, 2026-10-01).
|
|
@@ -73,7 +73,7 @@ export declare function createLeaderEndpoint(runLeader: (body: LeaderRequestBody
|
|
|
73
73
|
requiredFields?: readonly string[];
|
|
74
74
|
/** [ref] 车4 件1:durable 登记表。缺席 ⇒ 显式的单副本内存降级臂(见文件头注)。 */
|
|
75
75
|
store?: LeaderRunStore;
|
|
76
|
-
/**
|
|
76
|
+
/** [ref] RH-3:「这个调用方读得到这一行 leader run 吗」—— 属主存取器的判官形(`http/owner-access.ts` 的 `createLeaderRunVisibility`,boot 装一次)。
|
|
77
77
|
* 必填:本模块不自判属主(修前手抄 `owner == null || owner === requester`,缺 [ref] C8 窄互认臂而注称 mirrors runOwnerOk),读面与幂等重放同读它。 */
|
|
78
78
|
ownerVisible: (principal: string | null | undefined, owner: string | null | undefined) => boolean;
|
|
79
79
|
}): LeaderEndpoint;
|
package/dist/leader/fanout.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface WorkerReport {
|
|
|
51
51
|
checkpointGate?: CheckpointGate;
|
|
52
52
|
/** [ref] Slice 6: the worker's terminal failure code (e.g. `limits.max_cost_exceeded` on an
|
|
53
53
|
* exhausted resume, `limits.max_turns_exceeded` — core 5.8.0 码名轴) — surfaced for /v1/leader observability.
|
|
54
|
-
*
|
|
54
|
+
* [ref]:源从 `TaskResult.errorCode` 换成因由 `failed` 臂的 `code`(本报告面的键名与形不变)。 */
|
|
55
55
|
errorCode?: string;
|
|
56
56
|
/** LEADER-REPAIRLOOP-INTEGRATION §10.6 (THE push chokepoint): the `runRepairLoop` terminal a single-agent
|
|
57
57
|
* worker resolved to, when the repair loop ran on this worker (LEADER_REPAIR_LOOP on). It MUST ride on the
|
package/dist/leader/leader.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { type UnattendedLegSpec } from "../unattended-permission-mode.js";
|
|
|
24
24
|
* the cause is `failed` with no nested park), `signal.aborted`, or `maxSlices` (a belt; core's ledger
|
|
25
25
|
* fail-fast + per-task suspend-loop cap are the primary bounds). Returns the final result.
|
|
26
26
|
*
|
|
27
|
-
* 🔴
|
|
27
|
+
* 🔴 [ref](core 7.6.0 D-8):判据从「两个平面键合读」(`checkpointToken` 在场 ∧ `checkpointGate.kind`)
|
|
28
28
|
* 换成**一条因由**({@link pausedCauseOf}) —— 这条循环从一开始就刻意**不按 status 判**(顶注原话:
|
|
29
29
|
* 「the verify wrapper may surface a suspend as failed-with-token」),因为嵌套边界会把 park 报成 failed;
|
|
30
30
|
* 现在那件事是形状:两条路径同一个读法,而 token 与 gate 在同一个 `PausedCause` 上,不可能只有一半。
|
|
@@ -131,7 +131,7 @@ export interface LeaderDeps {
|
|
|
131
131
|
* reaction runs. (The suspended reaction itself — cancel the others, exempt the suspended worker, surface
|
|
132
132
|
* its token — is unconditional, not gated here.)
|
|
133
133
|
*
|
|
134
|
-
* 🔴
|
|
134
|
+
* 🔴 [ref] / clay [ref] ④(7.83.0):**merge-conflict 不再是一条 replan 臂**。worker 分支合不上 ⇒ 不起
|
|
135
135
|
* collapse 模型,`conflict` 段(分支 + 冲突文件)交给**用户**,见 {@link LeaderResult.conflict}。 */
|
|
136
136
|
replan?: {
|
|
137
137
|
/** Fan-out budget (USD, sum of worker costs). Exceeded → stop fan-out, collapse to single (C5). */
|
|
@@ -180,14 +180,14 @@ export interface LeaderResult {
|
|
|
180
180
|
/** Set when planning/provisioning failed before fan-out. */
|
|
181
181
|
error?: string;
|
|
182
182
|
/** Replan-lite ([ref] §6): which trigger won arbitration + what was done.
|
|
183
|
-
* 🔴
|
|
183
|
+
* 🔴 [ref] / [ref] ④(7.83.0):闭集删掉 `"merge-conflict"`(硬 breaking,零别名——消费方的 tsc 红即通知)。 */
|
|
184
184
|
replan?: {
|
|
185
185
|
trigger: "suspended" | "budget" | "verify-fail" | "worker-failed";
|
|
186
186
|
redispatched?: string[];
|
|
187
187
|
collapsed?: string;
|
|
188
188
|
};
|
|
189
189
|
/**
|
|
190
|
-
* 🔴
|
|
190
|
+
* 🔴 [ref] / clay [ref] ④(7.83.0)——**合不上 = 交给用户**(对齐 CC 形)。merge 的 `phase:"apply"` 冲突
|
|
191
191
|
* 不再起 collapse 模型:`ok=false` + 本段,用户拿 `workers[].branch` + `files` 自己 `git merge` / cherry-pick
|
|
192
192
|
* (worker 分支本就留在集成沙箱 / 远端)。run 状态走既有第三终局 `needs_human`(endpoint 的状态映射),不加
|
|
193
193
|
* 新状态词。**缺席何义** = 这一趟没有冲突,或对面是老 server。
|
package/dist/leader/merge.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 1. pull each worker's patch OUT of its container (M2 `pullDiff` — no creds go in).
|
|
6
6
|
* 2. provision an EPHEMERAL no-net/no-creds integration sandbox (base pre-provisioned by the dep).
|
|
7
7
|
* 3. `git apply --3way` each patch in sequence (conflict ⇒ TERMINAL: capture `.rej` + the conflict PATH list and
|
|
8
|
-
* hand them to the USER as {@link MergeConflict} —
|
|
8
|
+
* hand them to the USER as {@link MergeConflict} — [ref] / clay [ref] ④; council#3's quarantine unchanged).
|
|
9
9
|
* 4. run the full test suite IN the sandbox (the gate; untrusted diff never touches the control plane — [26]§16).
|
|
10
10
|
* 5. green → the **Coordinator** (trusted control plane, holds creds — NOT the sandbox, council#1) takes the
|
|
11
11
|
* integrated patch and pushes with CAS `--force-with-lease=<ref>:<baseSha>` (push race → retry — council#2).
|
|
@@ -58,7 +58,7 @@ export interface IntegrationRepair {
|
|
|
58
58
|
}>;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* [ref] / clay [ref] ④ — **合不上 = 交给用户**(对齐 CC 形)。`git apply --3way` 冲突时的产出:冲突**路径**
|
|
62
62
|
* (不含内容)+ 哪几只 worker 的补丁已经进树,由 leader 铸成 `LeaderResult.conflict` 段交到用户手上。
|
|
63
63
|
* 本段刻意**只有路径与身份**,不把任何 worker 的 diff 交给模型。CC 对照(2.1.280 语料):`conflict resolution` 零命中,
|
|
64
64
|
* `collapse` 的 169 处命中里没有一处与「把并行 worker 收成一个」相关(UI 折叠 / context collapse 一类);teammates 各一个
|
|
@@ -202,7 +202,7 @@ export declare function mergeBranches(reports: WorkerReport[], baseSha: string,
|
|
|
202
202
|
* 所以一个真叫 `__PROBE_FAIL_grep` 的文件到达时是 `./__PROBE_FAIL_grep`,不与标记二义;把剥 `./` 挪到前面就静默破功。 */
|
|
203
203
|
export declare const PROBE_FAIL_PREFIX = "__PROBE_FAIL_";
|
|
204
204
|
/**
|
|
205
|
-
*
|
|
205
|
+
* [ref] / [ref] ④ — 把 `grep -rIl` + `find` 的输出变成**冲突路径清单**(给用户,不含内容)。
|
|
206
206
|
* 逐行:去掉 `./` 前缀、剥掉 `.rej` 后缀(`pkg/a.ts.rej` 与 `pkg/a.ts` 是同一处冲突的两种痕迹)、去重、
|
|
207
207
|
* 按 {@link CONFLICT_FILES_MAX} 封顶并**交回是否截断**(F5:静默封顶会让用户把 200 当成全部)。两条命令合成
|
|
208
208
|
* 一次 exec,所以 stdout 里两族路径混在一起 —— 本函数是它唯一的解释者。任一半探测失败 ⇒ 那一半打出
|
|
@@ -83,7 +83,7 @@ export interface RepairWireCfg {
|
|
|
83
83
|
verifierModelId: string;
|
|
84
84
|
};
|
|
85
85
|
/** Per-attempt observability callback. */
|
|
86
|
-
/**
|
|
86
|
+
/** [ref](core 7.6.0 D-8):键名随 core 从 `terminal` 改成 `repairTerminal` —— `terminal` 这个名字在
|
|
87
87
|
* `TaskResult` 上已经归**运行终局因由**所有,修复循环的判词与它同名会是两个不同东西共用一个名字
|
|
88
88
|
* (本仓 status/kind 同名词混淆病族)。 */
|
|
89
89
|
onAttempt?: (info: {
|
package/dist/leader/wire.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Brain, type Model, type ModelRoles, type ModelPricing, type TaskSpec, type ExecutionEnvFactory, type RemoteExecutionEnv, type ToolResultStore, type SessionStore, type ExecutionEnv, type RunnerDeps } from "@sema-agent/core";
|
|
2
2
|
import type { Autonomy } from "../runtime-governance.js";
|
|
3
|
+
import { type CheckpointCtxSealer } from "../http/checkpoint-ctx.js";
|
|
3
4
|
import type { CheckpointStoreFull } from "../plugins/store-backend.js";
|
|
4
5
|
import { type LeaderDeps, type LeaderResult } from "./leader.js";
|
|
5
6
|
import { type DeploymentPostureSeats } from "../boot/runner-deps.js";
|
|
@@ -7,6 +8,9 @@ import type { LeaderRequestBody } from "./endpoint.js";
|
|
|
7
8
|
/** leader worker 的 durable 审批座(`LeaderWireConfig.durable` 函数席每次产出的一份)。 */
|
|
8
9
|
export interface LeaderDurableSeat {
|
|
9
10
|
readonly checkpointStore: CheckpointStoreFull;
|
|
11
|
+
/** [ref]:写 worker 续跑上下文的封口(`ServiceDeps.checkpointCtxSealing` 同一只;规则属主 `http/checkpoint-ctx.ts` 末段「凭据位密封」)。
|
|
12
|
+
* worker 的续跑体只有入口词 + 子任务 objective、不带凭据位 ⇒ 实际不封任何值,但写 ctx 的每一笔都经同一只封口(没有不封的第二种写法)。 */
|
|
13
|
+
readonly ctxSealer: CheckpointCtxSealer | undefined;
|
|
10
14
|
readonly requireApproval: string[];
|
|
11
15
|
readonly deny?: string[];
|
|
12
16
|
readonly ttlMs?: number;
|
|
@@ -25,7 +29,7 @@ export interface LeaderWireConfig {
|
|
|
25
29
|
* (checkpoint + paused env) instead of failing — the trigger replan-lite C4 arbitrates on. Mirrors main.ts's
|
|
26
30
|
* per-task durable wiring; ctx is seeded at provision so the surfaced token is resumable on the single-agent path.
|
|
27
31
|
*
|
|
28
|
-
* 🔴 **函数席,不是快照**(
|
|
32
|
+
* 🔴 **函数席,不是快照**([ref] 波 2 ①;先例 = 下方 `deploymentPosture` 的 [ref] 函数席):审批名单
|
|
29
33
|
* (`governance.approvalRequire`)自本批起在进程内会被中心热换。boot 期取一次值会把这条腿钉在起服那一刻的名单上
|
|
30
34
|
* —— 起服时名单为空 ⇒ 整块缺席、之后加进来的工具在 leader worker 上**永远**不被门住(fail-OPEN)。
|
|
31
35
|
* `provisionWorker` 每只 worker 调一次(同一只 worker 的 toolPolicy / resource 停车 / ctx 保温读同一份);
|
|
@@ -56,8 +60,8 @@ export interface LeaderWireConfig {
|
|
|
56
60
|
* 修前(≤7.53)这五只 Runner 一席都没有:运维写的 READ_DENY_PATTERNS / MEMORY_DELEGATION_EVIDENCE 等对
|
|
57
61
|
* leader 编排的 planner / worker / repair / conflict 四类任务**静默不生效**(core 内建 deny 表仍在)。
|
|
58
62
|
*
|
|
59
|
-
* 🔴 **是 provider 不是快照**(
|
|
60
|
-
* **逐调用现构**的,而
|
|
63
|
+
* 🔴 **是 provider 不是快照**([ref] 追加,codex 对抗复审 r1 [high] 验真后修):本车道的 Runner 是
|
|
64
|
+
* **逐调用现构**的,而 [ref] 起 `config.readFace` 在进程内**会变**(center 下发的 read face 转成了
|
|
61
65
|
* `Runner.swapDeps` 热换席)。boot 期取一次值再五处复用,等于让 leader 车道永远停在起服那一刻的 READ
|
|
62
66
|
* 姿态:读面(`/v1/capabilities`、`/v1/diagnostics/wiring`)报新档、`restart.reasons` 也不再要求重启,
|
|
63
67
|
* 而**新建的 leader Runner 仍在旧档上跑** —— 组织把 `open` 收紧成 `roots` 之后这条腿还在 open,方向是
|
|
@@ -167,7 +171,7 @@ export interface LeaderWireConfig {
|
|
|
167
171
|
/** The env surface wire needs (both the E2B and k8s adapters implement core's RemoteExecutionEnv). */
|
|
168
172
|
type WireEnv = Pick<RemoteExecutionEnv, "exec" | "writeFile">;
|
|
169
173
|
/**
|
|
170
|
-
* [ref] —— leader 自铸沙盒的**回收闸**(集成沙盒 / repair-loop grader 各一只;判据本身
|
|
174
|
+
* [ref] —— leader 自铸沙盒的**回收闸**(集成沙盒 / repair-loop grader 各一只;判据本身 [ref] 起抽成下方
|
|
171
175
|
* {@link assertLeaderOwnedEnvReapable},worker 腿同判)。
|
|
172
176
|
*
|
|
173
177
|
* core 契约:`ExecutionEnv` 基面**没有** `destroy`;只有实现了 `RemoteExecutionEnv` 的适配器才有
|
|
@@ -277,7 +281,7 @@ export declare const LEADER_PUSH_LOCAL_TIMEOUT_MS = 30000;
|
|
|
277
281
|
* plan→provision→fan-out→merge 管线单测(那条管线需要真 brain + E2B/k8s env)。行为与抽出前逐字相同,
|
|
278
282
|
* 唯一新增是六条 execFileSync 各自的 `timeout`。
|
|
279
283
|
*
|
|
280
|
-
* 7.103.0(
|
|
284
|
+
* 7.103.0([ref] 残余):六条 git 子进程的 env 一律 = `gitSubprocessEnv({ isolateConfig: false })` + `LC_ALL=C`(修前:
|
|
281
285
|
* `{ ...process.env, LC_ALL: "C" }`,两条 `git config` 连 env 都不交 ⇒ 整份服务 env 进 git 与它拉起的 helper / hook)。
|
|
282
286
|
* **不隔离宿主 git 配置**(读后定):写凭据是控制面宿主的(「Coordinator's creds」,`durableRemote` 由受信调用方给出,
|
|
283
287
|
* 代码里从不带凭据),而宿主侧能供凭据的形 —— 全局配置里的 credential helper(自带存储)/ `url.<…>.insteadOf` 改写 /
|
package/dist/leader/wire.js
CHANGED
|
@@ -274,9 +274,10 @@ export function createLeaderRunner(cfg) {
|
|
|
274
274
|
const provisionWorker = async (sub) => {
|
|
275
275
|
const sessionId = `leader-${sub.workerId}-${Date.now()}`;
|
|
276
276
|
const durable = cfg.durable?.();
|
|
277
|
-
const
|
|
277
|
+
const resumeBody = { ...entry, objective: sub.spec.objective };
|
|
278
|
+
const storedResumeCtx = durable !== undefined ? buildCheckpointCtx({ body: resumeBody, unattendedLeg: true, writerVersion: serviceVersion() }, durable.ctxSealer, sessionId) : undefined;
|
|
278
279
|
let durableSpec = {};
|
|
279
|
-
if (durable) {
|
|
280
|
+
if (durable && storedResumeCtx !== undefined) {
|
|
280
281
|
const d = durable;
|
|
281
282
|
durableSpec = {
|
|
282
283
|
toolPolicy: combinePolicies(createDurableQuestionPolicy(), createDurableAskPolicy({ requireApproval: d.requireApproval, ...(d.deny ? { deny: d.deny } : {}), ...(d.autoBudget ? { autoBudget: d.autoBudget } : {}), ...(d.neverAuto ? { neverAuto: d.neverAuto } : {}) })),
|
|
@@ -284,7 +285,7 @@ export function createLeaderRunner(cfg) {
|
|
|
284
285
|
durableApproval: { scope: "_leader", ...(d.ttlMs ? { ttlMs: d.ttlMs } : {}) },
|
|
285
286
|
onQuestion: QUESTION_AWAITS_RESUME,
|
|
286
287
|
};
|
|
287
|
-
await d.checkpointStore.putCtx(sessionId,
|
|
288
|
+
await d.checkpointStore.putCtx(sessionId, storedResumeCtx).catch((e) => {
|
|
288
289
|
cfg.logger?.warn?.("leader_putctx_failed", { workerId: sub.workerId, err: redactHead(e instanceof Error ? e.message : String(e), 2000) });
|
|
289
290
|
});
|
|
290
291
|
}
|
|
@@ -313,13 +314,13 @@ export function createLeaderRunner(cfg) {
|
|
|
313
314
|
}
|
|
314
315
|
const keepCtxWarm = (runner) => {
|
|
315
316
|
const d = durable;
|
|
316
|
-
if (!d)
|
|
317
|
+
if (!d || storedResumeCtx === undefined)
|
|
317
318
|
return runner;
|
|
318
319
|
const orig = runner.runTaskStream.bind(runner);
|
|
319
320
|
runner.runTaskStream = (spec, resume) => {
|
|
320
321
|
const stream = orig(spec, resume);
|
|
321
322
|
const iv = setInterval(() => {
|
|
322
|
-
void d.checkpointStore.putCtx(sessionId,
|
|
323
|
+
void d.checkpointStore.putCtx(sessionId, storedResumeCtx).catch(() => { });
|
|
323
324
|
}, 45_000);
|
|
324
325
|
iv.unref?.();
|
|
325
326
|
void stream.result().then(() => clearInterval(iv), () => clearInterval(iv));
|
|
@@ -359,7 +360,7 @@ export function createLeaderRunner(cfg) {
|
|
|
359
360
|
},
|
|
360
361
|
})),
|
|
361
362
|
fetchDiff: () => fetchUploadedDiff(getUrl),
|
|
362
|
-
spec: withLeaderLeg({ ...workerLimits, ...sub.spec, ...durableSpec, ...resourceSpec, ...principalSpec(), objective: `${sub.spec.objective}${uploadStepSuffix(W)}` },
|
|
363
|
+
spec: withLeaderLeg({ ...workerLimits, ...sub.spec, ...durableSpec, ...resourceSpec, ...principalSpec(), objective: `${sub.spec.objective}${uploadStepSuffix(W)}` }, resumeBody),
|
|
363
364
|
};
|
|
364
365
|
}
|
|
365
366
|
if (!cfg.e2bApiKey)
|
|
@@ -374,7 +375,7 @@ export function createLeaderRunner(cfg) {
|
|
|
374
375
|
runner: keepCtxWarm(new Runner({ brain: cfg.brain, models: cfg.models, roles: cfg.roles, pricing: cfg.pricing, ...onNoticeSeat, ...governanceSeat, ...deploymentPostureSeat(), ...tracerSeat, ...usageWindowSeat, ...promptSourceSeat, ...onErrorSeat, ...(cfg.toolResultStore ? { toolResultStore: cfg.toolResultStore } : {}), ...(cfg.sessionStore ? { sessionStore: cfg.sessionStore } : {}), executionEnv: env })),
|
|
375
376
|
diffEnv: env,
|
|
376
377
|
destroy: () => env.destroy().then(() => { }),
|
|
377
|
-
spec: withLeaderLeg({ ...workerLimits, ...sub.spec, ...durableSpec, ...resourceSpec, ...principalSpec() },
|
|
378
|
+
spec: withLeaderLeg({ ...workerLimits, ...sub.spec, ...durableSpec, ...resourceSpec, ...principalSpec() }, resumeBody),
|
|
378
379
|
};
|
|
379
380
|
};
|
|
380
381
|
const provisionIntegrationSandbox = async () => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export declare function redactListEntry(entry: string): string;
|
|
6
6
|
/**
|
|
7
7
|
* **人读句里条目的唯一写法** —— 本仓把规则条目 / 工具名原串写进任何一句给人读的话(拒句、起服拒启行)一律调这一只:引擎的条目写者
|
|
8
|
-
* `renderListEntry`(core 7.46.0
|
|
8
|
+
* `renderListEntry`(core 7.46.0 [ref] 包根导出:JSON 串形带引号,看不见 / 印成空白的字符写成 `\uXXXX`,超长截断)—— 与引擎自己的通告句同一个渲染;
|
|
9
9
|
* 判定拿原串。
|
|
10
10
|
* 🔴 凭据先认、再渲染:渲染把看不见的字符写成 ASCII 转义,之后的脱敏器就认不出夹着零宽字符的凭据 ⇒ 原串上认出凭据时渲染它的脱敏值;
|
|
11
11
|
* 没有凭据的条目渲染**原串**(格式字符留给渲染器写成 `\uXXXX` —— 人要看得见它,不能先被脱敏器剥掉)。
|
package/dist/lsp-evict.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* doesn't retain one heavy language server (jdtls = a whole JVM) per (task × language) until process shutdown.
|
|
7
7
|
* `evict` is best-effort + idempotent + fire-and-forget so it NEVER blocks or breaks teardown; the server dies async
|
|
8
8
|
* while the dir is rm'd (rooted there, it just sees ENOENT). Only the ephemeral lane is wrapped by the caller — the
|
|
9
|
-
*
|
|
9
|
+
* caller-cwd (deployment-shape row `callerCwd`) persistent-project path keeps its warm server (stable root, reused across turns = CC-parity, no leak).
|
|
10
10
|
*
|
|
11
11
|
* Structural param types (no `ExecutionEnv`/`NodeLspManager` import): a non-evicting manager (e2b/k8s bridge) or an
|
|
12
12
|
* env without a string `cwd` / callable `destroy` is returned UNWRAPPED (probe-guarded), so this is a safe no-op
|
package/dist/main.js
CHANGED
|
@@ -17,7 +17,7 @@ async function main() {
|
|
|
17
17
|
const s04 = await runStage04(s03);
|
|
18
18
|
const s05 = await runStage05(s04);
|
|
19
19
|
await settleHostLaneShell(s05.config, s05.logger);
|
|
20
|
-
const s06 = runStage06(s05);
|
|
20
|
+
const s06 = await runStage06(s05);
|
|
21
21
|
const s07 = await runStage07(s06);
|
|
22
22
|
const s08 = runStage08(s07);
|
|
23
23
|
const s09 = runStage09(s08);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 受理 = 字符串才收;互斥 = 同设即拒;投影 = 铸 spec 时不投(见下)。
|
|
10
10
|
* 同一条规则、两处执行者(契约包解析期 / 请求面受理期);判据 {@link mcpIdentityHeadersIssue} 与互斥拒句
|
|
11
11
|
* {@link describeMcpIdentityHeadersConflict} 对契约包的原判官**逐字**对齐 —— 不是靠这句注释,而是
|
|
12
|
-
* `test/task-mcp.test.ts` 的
|
|
12
|
+
* `test/task-mcp.test.ts` 的 [ref] 组把两边对拍(格子差分 + 拒句逐字相等),契约包改一个字那一组当场红。
|
|
13
13
|
*
|
|
14
14
|
* ## 后果按腿分(判据同一只,后果不同 —— 本仓成文的 `opts.leg` 姿势)
|
|
15
15
|
* · **fresh 提交腿**:判出问题 ⇒ 同步 400(同设 `request.body_shape`;值不是字符串 `request.field_invalid`)。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EngineNotice, EngineNoticeCode } from "@sema-agent/core";
|
|
2
|
-
/** 码常量型 = core 码册(
|
|
2
|
+
/** 码常量型 = core 码册([ref] 入册:受众 operator、铸者 `NOTICE_MINTER` = `"server"`;不上会话流,只落转发体的运维日志)。 */
|
|
3
3
|
export declare const MEMORY_LAYER_LOCKED_LEGACY: EngineNoticeCode;
|
|
4
4
|
/** 探测读数:锁住的层名(排序)+ 看不全的目录条数。挂载面不存在(新数据根)⇒ 两者皆空。 */
|
|
5
5
|
export interface LockedLegacyLayerProbe {
|
|
@@ -233,7 +233,7 @@ export interface SessionMemoryStatusFace {
|
|
|
233
233
|
*
|
|
234
234
|
* `captureRecordStore` = [ref]② 的 SQL 载体(main.ts 单实例,与 Runner/其余引擎同源 —— 全站同批注入律,
|
|
235
235
|
* 机器钉 capture-optout-lane ②):`captureOptedOut` / `optOutSource` 两键经它读,多副本部署上答的才是
|
|
236
|
-
* 跨副本的真记录。
|
|
236
|
+
* 跨副本的真记录。[ref] 起 local 车道在引擎接线时也供(core 文件三腿,同一只控制面,单机字节不变);缺席 ⇒ 记忆面暗。
|
|
237
237
|
*
|
|
238
238
|
* 面**不抛**(core 契约:sessionMemoryStatus never throws —— 每个事实源各自 catch 折缺席键);
|
|
239
239
|
* 不接 onIncident:这条只读路径上今天零 sink 站点,而且缺席键本身就是它的披露形。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { committedOriginOf } from "@sema-agent/core";
|
|
3
|
-
import {
|
|
3
|
+
import { canonicalJsonStringify } from "@sema-agent/core";
|
|
4
4
|
export const ORIGIN_AWARE_QUERY = "originAware";
|
|
5
5
|
export function readOriginAware(params) {
|
|
6
6
|
return params.get(ORIGIN_AWARE_QUERY) === "1";
|
|
@@ -47,7 +47,7 @@ export function buildOriginFencedBundle(bundle, originAware) {
|
|
|
47
47
|
integrity: {
|
|
48
48
|
entryCount: kept.length,
|
|
49
49
|
revs: Object.fromEntries(kept.map((e) => [e.id, e.rev])),
|
|
50
|
-
sectionHashes: { ...bundle.integrity.sectionHashes, entries: sha256Line(
|
|
50
|
+
sectionHashes: { ...bundle.integrity.sectionHashes, entries: sha256Line(canonicalJsonStringify(kept)) },
|
|
51
51
|
},
|
|
52
52
|
withheldOriginTagged: withheld,
|
|
53
53
|
};
|