@sema-agent/server 7.134.0 → 7.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +197 -1
- package/USAGE.md +147 -42
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +122 -154
- package/dist/approval-card.js +50 -51
- package/dist/approval-content-kind.d.ts +23 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +35 -6
- package/dist/auth-bridge.js +20 -3
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +36 -29
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +7 -4
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +1 -1
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stage-07-capability-layer.d.ts +1 -1
- package/dist/boot/stage-08-reapers.d.ts +1 -1
- package/dist/boot/stage-09-leader.d.ts +1 -1
- package/dist/boot/stage-10-http-server.d.ts +1 -1
- package/dist/boot/stores.js +4 -4
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +15 -27
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/brain.js +12 -3
- package/dist/budget.d.ts +7 -7
- package/dist/budget.js +4 -0
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +11 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +29 -32
- package/dist/capability-facts.js +17 -21
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +22 -8
- package/dist/center-credential.js +18 -3
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-catalog.js +12 -10
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +5 -5
- package/dist/config-invariants.js +11 -2
- package/dist/config-lkg.d.ts +1 -39
- package/dist/config-lkg.js +1 -83
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +95 -87
- package/dist/config.d.ts +26 -24
- package/dist/config.js +38 -18
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +25 -11
- package/dist/file-history-disclosure.js +25 -14
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +45 -14
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +23 -19
- package/dist/fleet-lease.js +31 -23
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +58 -31
- package/dist/hooks/hook-runner.js +37 -19
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +62 -17
- package/dist/http/checkpoint-ctx.js +78 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +9 -9
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +9 -23
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -7
- package/dist/http/routes/approvals-assistant.js +101 -26
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +23 -11
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +97 -46
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +43 -53
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +33 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +17 -13
- package/dist/observability/fail-open.js +17 -13
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -18
- package/dist/parked-decide.js +31 -11
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +5 -4
- package/dist/peer-directory.js +6 -6
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -15
- package/dist/plugins/approval-ask-store-sql.js +21 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +130 -0
- package/dist/plugins/checkpoint-index-columns.js +90 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +71 -69
- package/dist/plugins/checkpoint-store-sql.js +109 -127
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +15 -7
- package/dist/plugins/file-history-store-sql.js +55 -36
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +7 -7
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +73 -54
- package/dist/plugins/one-time-migrations.js +131 -134
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +26 -13
- package/dist/plugins/remote-env-k8s.js +24 -7
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +40 -1
- package/dist/plugins/sql-errors.js +49 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +8 -0
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +10 -3
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +20 -5
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +6 -1
- package/dist/request-key-closure.js +5 -2
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-caps-resolver.js +1 -1
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +17 -12
- package/dist/sandbox-pkg-source.js +14 -9
- package/dist/sealed-key.d.ts +22 -3
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +65 -37
- package/dist/session-incarnation.js +30 -12
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +61 -6
- package/dist/session-sync.js +55 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +52 -79
- package/dist/task-a2a.js +224 -62
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +13 -17
- package/dist/task-mcp.js +29 -49
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +166 -207
- package/dist/tool-approval.js +61 -61
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +13 -8
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +69 -67
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +61 -31
- package/dist/trace/redact.js +394 -153
- package/dist/trace/self-minted-wire.d.ts +302 -14
- package/dist/trace/self-minted-wire.js +87 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +16 -3
- package/dist/url-refusal.js +15 -2
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +32 -3
- package/dist/workspace-space.js +26 -0
- package/dist/write-protection.d.ts +2 -2
- package/package.json +5 -3
- package/scripts/drain-check-local.mjs +4 -2
- package/scripts/drain-check.mysql.sql +6 -2
- package/scripts/drain-check.pg.sql +6 -2
- package/skills/loop.md +1 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 此前是这条轴上的唯一入口:一个用 web-admin 管理整片 worker 的组织,想统一收紧 READ 面只能逐机改 env。本模块把
|
|
6
6
|
* `EffectiveConfig.readFace`(见 types.ts {@link CenterReadFace})投影到同样的四个 `ServiceConfig` 键上。
|
|
7
7
|
*
|
|
8
|
-
* ── 生效时机:**逐席由引擎答**(
|
|
8
|
+
* ── 生效时机:**逐席由引擎答**([ref] 起 face;[ref] / core 7.51.0 起四席全热)──────────────────────────
|
|
9
9
|
* 哪些席能热换,不是本仓的意见:`KEY_MAP` 每行的 `cfgKey` 就是 core 的席名,能不能热换由 core 的 `isSwappableDepSeat` 亲答
|
|
10
10
|
* ({@link CENTER_READ_FACE_LIVE_KEYS})。本模块按这**一个**判据分相({@link CenterReadFaceApply}):
|
|
11
11
|
* · `boot` 相 —— 四键全落(Runner 还没建,每一席都还会 bake);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* 轴上最危险的谎(读面说收紧了、执行面没有)。
|
|
16
16
|
* 落配、`applied` 日志、换席候选、重启片的指纹读的是**同一个**判据 —— core 把某席移进 / 移出闭集,四处自动一起走
|
|
17
17
|
* (core 7.51.0 把读拒三席移了进去,而 live 相的落配当时是一句手写的「deny 三键只在 boot 相落」,与另三处的派生读法分家:
|
|
18
|
-
* 重启片说「热了」、落配说「不落」,组织收紧读拒规则 ⇒ 既不生效也不要求重启。
|
|
18
|
+
* 重启片说「热了」、落配说「不落」,组织收紧读拒规则 ⇒ 既不生效也不要求重启。[ref] 收成一个判据)。
|
|
19
19
|
*
|
|
20
20
|
* ── 三条规则,每条都有失败方向的论证 ──────────────────────────────────────────────────────────
|
|
21
21
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* 此前「值已被收编接受」的两种告警 `hosts-grandfathered` / `legacy-governance-lifted` 随抬升臂一起退役,旧形由一次性迁移改写,
|
|
19
19
|
* 读侧遇旧形一律拒 —— 没有「不入诊断面」的那一族了。)
|
|
20
20
|
*
|
|
21
|
-
* 🔴
|
|
21
|
+
* 🔴 [ref] ②(2026-09-24,凭据轴):此前 `entry-dropped` 归「候选门错误」(settings-schema 2.0.0 提货时的归族),于是
|
|
22
22
|
* schema 的**逐条容错**在本仓的 refresh / 迟到 boot 两条腿上被**还原成整份拒** —— 目录里一条 `contextWindow:"abc"`
|
|
23
23
|
* 就让整份目录停在上一代;而上一代若还是 env(boot 拉取失败 / 超窗且无 LKG),env 模型就一直服务、env 钥匙一直被送到
|
|
24
24
|
* 网关缺省端点(红先实测:`config_candidate_rejected` + env 模型继续服务)。粒度对了规则反而更少:颗粒是条目的失效
|
|
@@ -86,7 +86,7 @@ export declare function buildUnreadConfigKeyFields(k: UnreadConfigKey, dir: stri
|
|
|
86
86
|
/** `config_unread_file` 一行的体(纯数据;起服 / 刷新 / 迟到起服与 `run-local` 同一体):`dir` = 本地读腿的配置根。 */
|
|
87
87
|
export declare function buildUnreadConfigFileFields(f: UnreadConfigFile, dir: string | undefined): Record<string, unknown>;
|
|
88
88
|
/** 逐条丢弃面的一行(两条读腿的 `droppedEntries` 同形,`config_entry_dropped` 日志行读它):`entry` = 被丢那条的出门形坐标(`models.1`),
|
|
89
|
-
* `error` = 哪些字段、为什么(人读),`reasonCode` = 为什么丢的**闭集词**(
|
|
89
|
+
* `error` = 哪些字段、为什么(人读),`reasonCode` = 为什么丢的**闭集词**([ref]:settings-schema 铸、原样过境 —— 目录行的
|
|
90
90
|
* `GET /v1/models.droppedEntries[].reasonCode` 就是这同一个词,取自同一次折叠的同一行)。 */
|
|
91
91
|
export type DroppedConfigEntry = {
|
|
92
92
|
readonly domain: string;
|
|
@@ -133,14 +133,14 @@ export declare function foldEffectiveReadWarning(w: Exclude<EffectiveReadWarning
|
|
|
133
133
|
}>;
|
|
134
134
|
export declare function foldEffectiveReadWarning(w: EffectiveReadWarning, leg: ReadWarningLeg): FoldedReadWarning;
|
|
135
135
|
/**
|
|
136
|
-
* 🔴
|
|
136
|
+
* 🔴 [ref] / [ref] —— **被丢目录条目的载体行**(载体 = `EffectiveConfig.models.droppedCatalogEntries`,读腿铸,随 effective 走 —— 盘上 LKG
|
|
137
137
|
* 从同一个对象落盘,重启从 LKG 起服时它还在)。形的**唯一定义**(型由它推出;判据按它判盘上来的行)。
|
|
138
138
|
*
|
|
139
139
|
* **规则一条:读腿把 schema 逐条丢掉的每一条目录条目(`models` 域的 `["models", <下标>]`)记一行,写入时不挑;每个读者读自己要的那一部分。**
|
|
140
140
|
* · 墓碑判据(`model-entry-refusal.ts` `judgeCatalogEntries`)—— 有名(`identity.name`)且未停用(`identity.enabled !== false`)的行;
|
|
141
141
|
* · `GET /v1/models` 的 `droppedEntries`({@link buildDroppedEntriesWire})—— 每一行的下标、闭集词与可披露身份;
|
|
142
142
|
* · `config_entry_dropped` 日志行读的是这一行由之而来的那条折叠行({@link DroppedConfigEntry},同一次折叠、同一个词)。
|
|
143
|
-
* (修前
|
|
143
|
+
* (修前 [ref] 的载体 `droppedIdentities` 在写入时只收「有名且启用」的行 —— 那是墓碑读者的筛子,装在了写入处;同一件事于是没有
|
|
144
144
|
* 第二个读者可用。筛子回到读者那里,载体就只剩「记下发生了什么」这一条律。)
|
|
145
145
|
*
|
|
146
146
|
* 🔐 不含值:`identity` 取告警自带的身份(settings-schema 只铸可披露的标识符 —— 秘密形 / 非标识符的串 ⇒ 该键缺席,三键都没有 ⇒ 整个缺席);
|
|
@@ -191,7 +191,7 @@ export interface DroppedEntryWireRow {
|
|
|
191
191
|
readonly identity?: DroppedEntryIdentity;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
-
*
|
|
194
|
+
* [ref] —— 本代目录的被丢条目(`config.droppedCatalogEntries`)→ `GET /v1/models` 的 `droppedEntries`。纯投影,**唯一**出口。
|
|
195
195
|
* · 词:settings-schema 的闭集原样过境({@link reasonCodeForWire} 穷举:包加词 / 删词 ⇒ 本仓编译红,逼一次「这个词能不能上 wire」的显式决定);
|
|
196
196
|
* · 身份:`name` / `id` 在出口再问一次包的 `isDisclosableIdentity`(唯一判据,import 不复制)—— 载体可能来自被手改的盘上 LKG,读腿铸的身份
|
|
197
197
|
* 本来就过了同一只判据;不可披露 ⇒ 该键不出门(不打码:打过码的串不再是身份);`enabled` 是布尔照带;三键都不剩 ⇒ `identity` 缺席;
|
|
@@ -5,7 +5,7 @@ export type RestartSlice = "skills" | "mcp" | "a2a" | "scenarios" | "degrade-rou
|
|
|
5
5
|
* slices cannot see them, because they are configured from env (`ServiceConfig`), not from the center's
|
|
6
6
|
* EffectiveConfig. Absent/empty = that lane is off ⇒ its slice is inert (null on both sides). */
|
|
7
7
|
export interface RestartSliceCtx {
|
|
8
|
-
/**
|
|
8
|
+
/** [ref]:反应式降级壳的两侧读数 —— `baked` = createBrain 组壳那一刻焊进去的目标路由指纹,`current` = 同一只
|
|
9
9
|
* 指纹函数(brain.ts `degradeRouteFingerprint`)对本拍活配置再读一次(`baked` 的出处见 brain.ts `createBrainAssembly`)。
|
|
10
10
|
* 缺席 = 调用方没有递席(单元调用)⇒ `degrade-route` 片恒不签;车道没开 / 没焊壳在席内表达为两侧同为 null。
|
|
11
11
|
* (此前的 `reactiveDegradeTo` 位只剩「阀门开着」一义,已并进本席 —— 一位不留两义。) */
|
|
@@ -24,7 +24,7 @@ export interface RestartSliceCtx {
|
|
|
24
24
|
* 新增/改址/域整体出现或消失仍签(新 mount / 改址只能 restart 才生效)。缺席/false = 旧语义照签
|
|
25
25
|
* (fail-closed:没接席的部署里删除向没人承接,restart 是它唯一的生效路径)。 */
|
|
26
26
|
mcpRevocationLive?: boolean;
|
|
27
|
-
/**
|
|
27
|
+
/** [ref] 波 0(过渡;**波 1 转热后删**)+ 车PI 修复轮 ⑥:记忆整理**阀门判决**的两侧读数(一只 watch,读法见
|
|
28
28
|
* boot/memory-consolidation.ts `createConsolidationValveWatch`)—— `baked` = boot 判决的投影,`current` = 拿本拍活配置
|
|
29
29
|
* 重判一次的投影;投影 = 开着 ⇒ `{ valve: "on", seat: 整理座指纹 }`、关着 ⇒ `{ valve: "off" }`。判决翻了(派生开 ↔ 关)或
|
|
30
30
|
* 开着而座漂了 ⇒ 两侧不等 ⇒ 签。缺席 = 判决不随目录变(显式 off,或结构上跑不起来的派生关)⇒ 恒不签。 */
|
|
@@ -32,12 +32,12 @@ export interface RestartSliceCtx {
|
|
|
32
32
|
readonly baked: unknown;
|
|
33
33
|
readonly current: unknown;
|
|
34
34
|
};
|
|
35
|
-
/**
|
|
35
|
+
/** [ref] 波 0(codex r1 [medium]):插件 host 白名单(env `PLUGINS_ALLOW_HOSTS`,boot 常量)—— 白名单外的声明
|
|
36
36
|
* 装载器整条跳过,它们的变化不是重启理由。生产 `restartCtx` 恒传 `config.pluginsAllowHosts`;缺席(单元调用)
|
|
37
37
|
* = 装载器的出厂名单 `DEFAULT_PLUGIN_ALLOW_HOSTS`。 */
|
|
38
38
|
pluginsAllowHosts?: readonly string[];
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
40
|
+
/** [ref](车OG):本引擎发布的重启信号。形的唯一定义是 settings-schema 6.1.0 `RestartSignal`(`{ reasons, version, since }`,在场即信号,
|
|
41
41
|
* 不夹 `restartRequired` 布尔;本地手写的那份接口已删),这里只把 `reasons` 收窄到本文件的闭集 {@link RestartSlice} —— 写口
|
|
42
42
|
* (`boot/web-admin.ts` `publishRestart`)按它收,拼错 / 已退役的词编译红(opus 对抗腿 #2:直接用上游型时 `reasons` 是
|
|
43
43
|
* `string[]`,闭集的编译期判据丢了)。`/health.restart` 与 fleet 心跳 `restart` 两个出口交 web-admin 同一只 `restartState()`
|
|
@@ -52,7 +52,7 @@ export type EngineRestartSignal = RestartSignal & {
|
|
|
52
52
|
* fields:
|
|
53
53
|
* - `cost`'s VALUES — refreshed by `mutateInPlace(pricing, buildPricing(config.models))`, and core prefers
|
|
54
54
|
* `deps.pricing[model.id]` over the (possibly frozen) `Model.cost`, so a pure re-pricing
|
|
55
|
-
* needs neither a swap nor a restart. 🔴
|
|
55
|
+
* needs neither a swap nor a restart. 🔴 [ref]:its PRESENCE is subtracted no longer —
|
|
56
56
|
* a roster row WITHOUT `cost` now mints no `cost` key (unpriced) and therefore no pricing
|
|
57
57
|
* row, and core's fallback is literally `deps.pricing?.[id] ?? modelCostToPricing(model.cost)`
|
|
58
58
|
* (core 7.13.0 run-settle-and-teardown.js and three siblings) — so a FROZEN generation
|
|
@@ -67,7 +67,7 @@ export type EngineRestartSignal = RestartSignal & {
|
|
|
67
67
|
* so the failure mode of drift is a spurious restart, never a silently missed one.
|
|
68
68
|
*
|
|
69
69
|
* Shared by BOTH frozen-entry consumers — the `modelPlaneChanged` swap gate (over catalog entries) and brain.ts
|
|
70
|
-
* `degradeRouteFingerprint` (over the Model the reactive-degrade shell welded,
|
|
70
|
+
* `degradeRouteFingerprint` (over the Model the reactive-degrade shell welded, [ref]) — so "which fields are hot"
|
|
71
71
|
* is answered once. (复审 2026-07-29 留档:the since-retired `models-tiers` slice had
|
|
72
72
|
* kept all three, so on a tiers-active deployment a pure re-pricing / weight tweak / serializer writing
|
|
73
73
|
* `enabled:true` rolling-restarted the fleet.) For the swap gate a subtracted field means "no swap needed": the
|
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
import { type A2aServerSpec, type McpServerSpec } from "@sema-agent/core";
|
|
1
|
+
import { type A2aServerSpec, type McpServerSpec, type SkillSpec } from "@sema-agent/core";
|
|
2
2
|
import type { CenterMcp, ScopedA2aPeer } from "../config-types.js";
|
|
3
3
|
import type { Logger } from "../observability/logger.js";
|
|
4
4
|
import type { LoadedSkill } from "../capabilities/skills.js";
|
|
5
5
|
import type { ConfigProvider } from "../config-provider.js";
|
|
6
6
|
import type { CenterA2aPeer, CenterMcpServer, CenterSkillManifest } from "./types.js";
|
|
7
7
|
/**
|
|
8
|
-
* 技能正文的来源 = **拉到这份清单的配置源自己**(
|
|
8
|
+
* 技能正文的来源 = **拉到这份清单的配置源自己**([ref]):`fetchSkillContent(contentHash)` 按 hash 答正文 —— 远程 = 中心内容端点
|
|
9
9
|
* (传输自验 hash;未知 hash ⇒ `undefined`),本地 = config.d 里内联的正文(与清单同一种容错读);`skillBodyCacheDir` = 这只配置源
|
|
10
10
|
* 声明的正文盘缓存目录(远程且开着 LKG 才有;本地恒缺席 —— 正文本就在这块盘上)。本函数不知道、也不问是哪一种。
|
|
11
11
|
*/
|
|
12
12
|
export type SkillBodySource = Pick<ConfigProvider, "fetchSkillContent" | "skillBodyCacheDir">;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* 技能两只工具名单(`allowedTools` / `disallowedTools`)的**唯一承运口**([ref]):配置源交来的名单 → 引擎 `SkillSpec` 上的同名两键。**缺席 ⇒ 键不出现**(不物化成 `undefined`、不填 `[]`);
|
|
15
|
+
* **在场 ⇒ 整只数组原样**(含 `[]`;不去重、不排序、不判拼写 —— settings-schema 14.4.0 的读法一句话,判官在引擎:`allowedTools` 是 allow 规则来源、`disallowedTools` 拒侧读成空的条目让
|
|
16
|
+
* 那次激活 fail-closed)。数组复制一份:规格上的数组是引擎规格自己的,不与配置源手里的 manifest / 本地店对象共享。
|
|
17
|
+
*
|
|
18
|
+
* 本函数住在技能域的读口旁,三个读者共用 —— 本地腿 CLOSED 投影(`config-provider.ts` 的 `mapToServiceEffective`)、manifest → 规格的铸点({@link applySkillsManifest})、
|
|
19
|
+
* 已装技能 ↔ manifest 的投影一致判据({@link installedSkillMatchesManifest}):三处各写一份键表就是下一次同形丢位([ref] 族)。契约再加一个技能键时的看守不在这里,
|
|
20
|
+
* 在 `test/skill-tool-lists-carry.test.ts` 的键处置表(按 `keyof SkillSpec` 铸型)与 `test/settings-schema-consumption-gates.test.ts` 门 4(叶路径由契约形状派生)。
|
|
21
|
+
*/
|
|
22
|
+
export declare function skillToolListsOf(source: {
|
|
23
|
+
readonly allowedTools?: readonly string[];
|
|
24
|
+
readonly disallowedTools?: readonly string[];
|
|
25
|
+
}): Pick<SkillSpec, "allowedTools" | "disallowedTools">;
|
|
26
|
+
/**
|
|
27
|
+
* 一只**已装**技能的运行期投影与配置源 manifest 条目一致吗(启动期 LKG 复核用:同名出厂技能在中心正文拉取失败后留任,名 / 正文 hash / 描述 / 场景可能碰巧相同,
|
|
28
|
+
* 运行期投影却不同 —— 此时进程跑着旧规格,必须算「未装上」)。判据 = {@link applySkillsManifest} 铸 {@link LoadedSkill} 时从 manifest 取的**全部**运行期成员:名、正文(按 hash)、
|
|
29
|
+
* 描述、场景集合(与顺序无关)、两只工具名单(逐条,{@link skillToolListsOf} 的承运形)。铸点多取一位,这里同拍多比一位 —— 两处放在一起就是为了不再漂。
|
|
30
|
+
*/
|
|
31
|
+
export declare function installedSkillMatchesManifest(installed: LoadedSkill, m: CenterSkillManifest): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 启动期复核:manifest 里**要求已装上**的条目哪些没装上(见 {@link installedSkillMatchesManifest} 的判据)。「要求已装上」的集合与 {@link applySkillsManifest} 铸点是同一条规则:
|
|
34
|
+
* `enabled:false` 的不参与;**同名多条后者赢**(铸点对重名发一行 `web_admin_skill_duplicate_name` 并以最后一条为准)—— 前面被盖掉的重名条目不是『没装上』,
|
|
35
|
+
* 否则一份只在名单上有差的重名发布(合法解析、零告警)会让每次起服都发一次 skills 重启信号。后者装不上(正文缺席 / 读失败)而前者留任 ⇒ 后者算没装上。
|
|
36
|
+
*/
|
|
37
|
+
export declare function skillManifestEntriesNotInstalled(installed: readonly LoadedSkill[], entries: readonly CenterSkillManifest[]): CenterSkillManifest[];
|
|
38
|
+
/**
|
|
39
|
+
* The skills domain's ONE read port ([ref]; [ref]-sibling B1; `web-admin docs/MCP-SKILLS.md`). Load order =
|
|
15
40
|
* `loadSkills(SKILLS_DIR)` baseline → the config source's skills (web-admin center OR local `config.d` — same manifest
|
|
16
41
|
* shape, same code path) overlaid BY NAME (config wins on a clash → can override a built-in; guarded center-side by
|
|
17
42
|
* publisher RBAC + the publish gate). `enabled:false` is skipped and never fetched. Bodies come from `bodies` by content
|
|
@@ -4,6 +4,34 @@ import { readMcpToolAxes, readToolFaces } from "@sema-agent/core";
|
|
|
4
4
|
import { MCP_CONTENT_ORIGINS, describeBadContentOrigin, describeBadWireName, isContentOriginWord, isUsableWireName } from "@sema-agent/settings-schema";
|
|
5
5
|
import { noteMcpAssertionHeaderNotSent, sentMcpAssertionHeaderMember, withholdsMcpAssertionHeader } from "../mcp-assertion-header.js";
|
|
6
6
|
import { SHA256_HEX_RE } from "../digest-form.js";
|
|
7
|
+
export function skillToolListsOf(source) {
|
|
8
|
+
return {
|
|
9
|
+
...(source.allowedTools !== undefined ? { allowedTools: [...source.allowedTools] } : {}),
|
|
10
|
+
...(source.disallowedTools !== undefined ? { disallowedTools: [...source.disallowedTools] } : {}),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function sameToolList(a, b) {
|
|
14
|
+
if (a === undefined || b === undefined)
|
|
15
|
+
return a === b;
|
|
16
|
+
return a.length === b.length && a.every((entry, i) => entry === b[i]);
|
|
17
|
+
}
|
|
18
|
+
export function installedSkillMatchesManifest(installed, m) {
|
|
19
|
+
const canonScenarios = (a) => [...(a ?? [])].sort().join("\u0000");
|
|
20
|
+
const lists = skillToolListsOf(m);
|
|
21
|
+
return (installed.spec.name === m.name &&
|
|
22
|
+
skillContentHash(installed.spec.content) === m.contentHash &&
|
|
23
|
+
installed.spec.description === m.description &&
|
|
24
|
+
canonScenarios(installed.scenarios) === canonScenarios(m.scenarios) &&
|
|
25
|
+
sameToolList(installed.spec.allowedTools, lists.allowedTools) &&
|
|
26
|
+
sameToolList(installed.spec.disallowedTools, lists.disallowedTools));
|
|
27
|
+
}
|
|
28
|
+
export function skillManifestEntriesNotInstalled(installed, entries) {
|
|
29
|
+
const winners = new Map();
|
|
30
|
+
for (const m of entries)
|
|
31
|
+
if (m.enabled !== false)
|
|
32
|
+
winners.set(m.name, m);
|
|
33
|
+
return [...winners.values()].filter((m) => !installed.some((sk) => installedSkillMatchesManifest(sk, m)));
|
|
34
|
+
}
|
|
7
35
|
function skillBodyPresent(body) {
|
|
8
36
|
return body !== undefined && body !== "";
|
|
9
37
|
}
|
|
@@ -63,7 +91,7 @@ export async function applySkillsManifest(baseline, manifest, bodies, logger) {
|
|
|
63
91
|
}
|
|
64
92
|
contentCache.set(m.contentHash, content);
|
|
65
93
|
const overrodeBuiltin = byName.has(m.name);
|
|
66
|
-
byName.set(m.name, { spec: { name: m.name, description: m.description, content }, scenarios: m.scenarios ?? [] });
|
|
94
|
+
byName.set(m.name, { spec: { name: m.name, description: m.description, content, ...skillToolListsOf(m) }, scenarios: m.scenarios ?? [], source: "center" });
|
|
67
95
|
logger?.info("web_admin_skill", { name: m.name, hash: m.contentHash, scenarios: m.scenarios, overrodeBuiltin });
|
|
68
96
|
}
|
|
69
97
|
catch (err) {
|
|
@@ -48,7 +48,7 @@ export interface CenterModel {
|
|
|
48
48
|
* 此后记账,不回算窗口内历史(registry types.d.ts 同句契约)。 */
|
|
49
49
|
quotaWeight?: number;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* [ref](settings-schema 1.10.0 `ModelEntry.compat`)—— 这条目录条目对 **openai-completions 线路**的
|
|
52
52
|
* 兼容声明,上 core `Model.compat`(`OpenAICompletionsCompat` 五键)。真需求 = vLLM / Qwen 类**缺省开
|
|
53
53
|
* 思考**的网关:关思考只能靠 `thinkingFormat: "qwen-chat-template"`(`chat_template_kwargs.
|
|
54
54
|
* enable_thinking=false`),而 `extraBody` 穿不过引擎的 OpenAI 保留键表。
|
|
@@ -82,9 +82,9 @@ export interface CenterModel {
|
|
|
82
82
|
* the missing leg made every promptGuidance pilot a false control). */
|
|
83
83
|
promptGuidance?: string[];
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* [ref](7.108.0)—— 这条条目发给供应商的**附加请求头**(部署 ↔ 供应商的契约;今天只有 `anthropic-beta`),上 core 的 per-model
|
|
86
86
|
* 头座 `Model.headers`。类型是 `unknown` 而不是那个结构,理由与 {@link CenterModel.compat} 逐字同:本类型是承载形,判据(闭集白名单 +
|
|
87
|
-
* 线路 + 值形)与坏形处置的单一属主是 `model-entry-headers.ts`(执法点 =
|
|
87
|
+
* 线路 + 值形)与坏形处置的单一属主是 `model-entry-headers.ts`(执法点 = [ref] 逐条判据,判不过 ⇒ 条目不可用)。
|
|
88
88
|
* ⚠️ 两条读腿今天**剥掉**它(settings-schema 6.3.0 `ModelEntry` 无此键;候裁加字段):今天到得了这里的只有绕过读腿的输入。
|
|
89
89
|
*/
|
|
90
90
|
headers?: unknown;
|
|
@@ -102,6 +102,13 @@ export interface CenterSkillManifest {
|
|
|
102
102
|
scenarios: string[];
|
|
103
103
|
contentHash: string;
|
|
104
104
|
enabled?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* 技能自带的两只工具名单(settings-schema 14.4.0 `SkillSpec.allowedTools?` / `disallowedTools?`,与引擎 `SkillSpec` 同名同形)。**缺席 ⇒ 键不出现;在场 ⇒ 整只数组原样
|
|
107
|
+
* 交给引擎**(逐条按作者所写:不去重 / 不排序 / 不判拼写;`[]` 与缺席是两种承运形,读成什么由引擎定)。本仓只承载,不判 —— 判官是引擎(拒侧读成空的条目 fail-closed)。
|
|
108
|
+
* 承运单点 = {@link skillToolListsOf}(`skills-mcp.ts`):本地腿投影与 manifest → 引擎规格的铸点读同一只。
|
|
109
|
+
*/
|
|
110
|
+
allowedTools?: string[];
|
|
111
|
+
disallowedTools?: string[];
|
|
105
112
|
}
|
|
106
113
|
/** MCP server registry entry. `envRefs`/`headerRefs` are env-NAME refs (target-key → ENV_NAME), NOT secrets. */
|
|
107
114
|
export interface CenterMcpServer {
|
|
@@ -137,7 +144,7 @@ export interface CenterMcpServer {
|
|
|
137
144
|
* 自动翻红逼销账。
|
|
138
145
|
*/
|
|
139
146
|
contentOrigin?: ToolContentOrigin;
|
|
140
|
-
/**
|
|
147
|
+
/** [ref] / [ref]:声明方自述的分组标签(开集,非空 ≤80;settings-schema 1.7.0 `McpServerSpec.source`)——上 core
|
|
141
148
|
* `McpServerSpec.source`,由 `wiring_manifest.mcp[].source` 逐字回显。显示用,不进信任轴。 */
|
|
142
149
|
source?: string;
|
|
143
150
|
/**
|
|
@@ -152,13 +159,13 @@ export interface CenterMcpServer {
|
|
|
152
159
|
*/
|
|
153
160
|
toolFaces?: unknown;
|
|
154
161
|
/**
|
|
155
|
-
*
|
|
162
|
+
* [ref](settings-schema 12.2.x `McpServerSpec.toolAxes`,解析透明 `z.unknown()`)—— 部署侧为这台 server 的**每只工具**声明的
|
|
156
163
|
* 风险轴(`effect` / `egress` / `irreversibility`),键 = server 的**原始(未加命名空间)**工具名,上 core
|
|
157
164
|
* `McpServerSpec.toolAxes`。
|
|
158
165
|
*
|
|
159
166
|
* 🔴 类型是 `unknown` 而不是那个结构,**刻意的**(与 {@link CenterMcpServer.toolFaces} 逐字同姿):本类型是两条部署腿的**承载形**
|
|
160
167
|
* (本地 config.d 经 `z.unknown()` 解析透明地过来、远端 /effective 是直读 JSON),形判与投影的单一属主是**引擎**根导出的
|
|
161
|
-
* `readMcpToolAxes`(core 7.51.2
|
|
168
|
+
* `readMcpToolAxes`(core 7.51.2 [ref];`resolveMcpServers` 在铸 spec 那一刻调它;产出的型是引擎的 `McpServerSpec["toolAxes"]`;本仓自铸的那一只
|
|
162
169
|
* 7.129.0 退役)。坏形 ⇒ 整条 server 不进 + 一行 `web_admin_mcp_tool_axes_invalid`。
|
|
163
170
|
* (同批解析透明键 `authForm` / `entryKind` 的语义归连接器,本层仍只承载。)
|
|
164
171
|
*/
|
|
@@ -290,7 +297,7 @@ export interface EffectiveConfig {
|
|
|
290
297
|
atMention?: unknown;
|
|
291
298
|
tierGroups?: unknown;
|
|
292
299
|
activeTierGroup?: string;
|
|
293
|
-
/** 🔴
|
|
300
|
+
/** 🔴 [ref] / [ref] —— **本仓读腿铸的**载体(不是 wire 键:中心在模型域里写同名键会被 schema 当未知键剥掉并进候选门):这次读
|
|
294
301
|
* 被 schema 逐条丢掉的**每一条**目录条目一行(下标 + settings-schema 闭集词 `reasonCode` + 告警自带的 `identity` + 字段诊断;形与律见
|
|
295
302
|
* `read-warnings.ts` {@link DroppedCatalogEntry})。读者各取所需:模型面 stage 把有名且启用的行铸成 `config.model_entry_invalid` 墓碑
|
|
296
303
|
* (不变量 `refused-names-not-minted` 据此判增广),每一行与 `models` 同 commit 进 `config.droppedCatalogEntries`(`GET /v1/models.droppedEntries` 的源)。
|
|
@@ -353,7 +360,7 @@ export interface EffectiveConfig {
|
|
|
353
360
|
/** settings-schema 0.6 起治理三件(autonomy/commandPolicy/approvalRequire)的**唯一**承运域(0.7.1 撤
|
|
354
361
|
* runtime 位双写镜像;顺序契约当年已走完:消费端先切、center 再撤)。键集与 schema `GovernanceConfig.shape`
|
|
355
362
|
* 逐字相等([ref] 件3 对账门钉)。消费:autonomy/commandPolicy 逐请求热(`stageRuntimeHot`,boot+refresh);
|
|
356
|
-
* approvalRequire 自
|
|
363
|
+
* approvalRequire 自 [ref] 波 2 起同样热(`stageApprovalGate`,boot+refresh 双腿,有自己的拒绝臂)。
|
|
357
364
|
* 同一 presence 规则(undefined = 不管 → 回 env 基线,非粘)。 */
|
|
358
365
|
governance?: {
|
|
359
366
|
autonomy?: Autonomy;
|
|
@@ -379,7 +386,7 @@ export interface EffectiveConfig {
|
|
|
379
386
|
* ruling riding the caps view. `required=false` / ruling absent = no enforcement (legacy). `allowedLanes` is
|
|
380
387
|
* an OPEN value domain (adding one is never BREAKING; consumers tolerate unknown names). Known lane names:
|
|
381
388
|
* `host`/`e2b`/`k8s`/`ssh`/`adb`/`local-docker`/`device` (the REMOTE_EXEC providers) **plus `in-process`**
|
|
382
|
-
* — the REMOTE_EXEC-unset fleet posture (
|
|
389
|
+
* — the REMOTE_EXEC-unset fleet posture ([ref]: previously "OA/review-style workers", a scenario family retired in 5.0.0; named distinctly from the explicit
|
|
383
390
|
* `host` lane on purpose). ⚠️ Admins writing `required=true` policies must include `in-process` when such
|
|
384
391
|
* workers should stay admittable — center UI/doc 词表待补齐。
|
|
385
392
|
*
|
|
@@ -63,6 +63,33 @@ export interface WorkspaceSpacePolicy {
|
|
|
63
63
|
export interface WorkspaceSyncCapability extends WorkspaceSpacePolicy {
|
|
64
64
|
timeoutMs: number;
|
|
65
65
|
}
|
|
66
|
+
/** `WORKSPACE_SNAPSHOT_PREFIX` unset ⇒ this prefix (the first segment of every snapshot object key of both lanes). */
|
|
67
|
+
export declare const WORKSPACE_SNAPSHOT_PREFIX_DEFAULT = "kata";
|
|
68
|
+
/**
|
|
69
|
+
* The ONE form of a snapshot-key segment — the partition (incarnation / session id), the snapshot id, the object name and each segment of
|
|
70
|
+
* the key prefix all pass it before a key is signed: it starts with a letter or digit, then letters, digits, `.`, `_`, `-`. No `/`, no `..`,
|
|
71
|
+
* no empty segment, no character a key could be rewritten or traversed by.
|
|
72
|
+
*/
|
|
73
|
+
export declare const SNAPSHOT_KEY_SEGMENT: RegExp;
|
|
74
|
+
/** The refusal code of a `WORKSPACE_SNAPSHOT_PREFIX` outside the closed form (the `config.*` family; fatal-exit prints it). */
|
|
75
|
+
export declare const WORKSPACE_SNAPSHOT_PREFIX_INVALID = "config.workspace_snapshot_prefix_invalid";
|
|
76
|
+
/**
|
|
77
|
+
* Why a snapshot key prefix is outside the closed form (`undefined` = inside): a prefix is a `/`-separated path of {@link SNAPSHOT_KEY_SEGMENT}s —
|
|
78
|
+
* one segment (`kata`, the form every release has accepted) or several (`libA/ws`, so one bucket can be partitioned by owner). Answers the
|
|
79
|
+
* first bad segment (1-based) and why. The ONE judge: the config loader refuses boot with it, the adapter refuses to sign a key with it.
|
|
80
|
+
*/
|
|
81
|
+
export declare function snapshotKeyPrefixProblem(prefix: string): {
|
|
82
|
+
readonly segment: number;
|
|
83
|
+
readonly of: number;
|
|
84
|
+
readonly value: string;
|
|
85
|
+
readonly why: string;
|
|
86
|
+
} | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* `WORKSPACE_SNAPSHOT_PREFIX` — the key prefix of both lanes' snapshot objects (`<prefix>/<incarnation>/space/…`, `<prefix>/<sessionId>/…`): a
|
|
89
|
+
* `/`-separated path of plain segments, one or more (`kata`, `libA/ws`). Unset / empty ⇒ `undefined` (the adapter's default
|
|
90
|
+
* {@link WORKSPACE_SNAPSHOT_PREFIX_DEFAULT} holds). A bad value refuses boot naming the first bad segment — the value is a path, never a secret, so it is echoed.
|
|
91
|
+
*/
|
|
92
|
+
export declare function parseWorkspaceSnapshotPrefix(raw: string | undefined): string | undefined;
|
|
66
93
|
/** The refusal code of a `WORKSPACE_SNAPSHOT_EXCLUDE` item outside the closed form (the `config.*` family; fatal-exit prints it). */
|
|
67
94
|
export declare const WORKSPACE_SNAPSHOT_EXCLUDE_INVALID = "config.workspace_snapshot_exclude_invalid";
|
|
68
95
|
/**
|
|
@@ -90,9 +117,11 @@ export interface EndedSpace {
|
|
|
90
117
|
readonly sessionId: string;
|
|
91
118
|
readonly spaceKey: string;
|
|
92
119
|
}
|
|
93
|
-
/** The closed word set of `workspace_cache_reclaim_failed.reason` —
|
|
94
|
-
*
|
|
95
|
-
|
|
120
|
+
/** The closed word set of `workspace_cache_reclaim_failed.reason` — said by the ONE reclaim seat (`plugins/remote-env-k8s.ts`). The
|
|
121
|
+
* session-delete coordinator's third word (`occupant_unreadable`, a second read of the deleted session's occupant that could fail on its own)
|
|
122
|
+
* is retired: the coordinator takes the space key from the same head read its owner fence judges (`boot/session-faces.ts`), so there is
|
|
123
|
+
* no second read to fail — a head read that throws fails the delete itself (retried to convergence). */
|
|
124
|
+
export type CacheReclaimReason = "delete_failed" | "budget";
|
|
96
125
|
/**
|
|
97
126
|
* The ONE reclaim seat for an ended space — called where a space ENDS: the session-delete coordinator (`boot/session-faces.ts` `purgeSession`)
|
|
98
127
|
* and the managed-retention sweep after it deletes session trees (`boot/retention-lane.ts`); neither writes a reclaim of its own. It reclaims
|
package/dist/workspace-space.js
CHANGED
|
@@ -9,6 +9,32 @@ export const WORKSPACE_SNAPSHOT_TIMEOUT_MS_RANGE = { min: 30_000, max: 3_600_000
|
|
|
9
9
|
export function workspaceSnapshotTimeoutOf(lane) {
|
|
10
10
|
return lane.workspaceSnapshotTimeoutMs ?? WORKSPACE_SNAPSHOT_TIMEOUT_MS_DEFAULT;
|
|
11
11
|
}
|
|
12
|
+
export const WORKSPACE_SNAPSHOT_PREFIX_DEFAULT = "kata";
|
|
13
|
+
export const SNAPSHOT_KEY_SEGMENT = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
14
|
+
export const WORKSPACE_SNAPSHOT_PREFIX_INVALID = "config.workspace_snapshot_prefix_invalid";
|
|
15
|
+
export function snapshotKeyPrefixProblem(prefix) {
|
|
16
|
+
const segments = prefix.split("/");
|
|
17
|
+
for (const [i, value] of segments.entries()) {
|
|
18
|
+
if (SNAPSHOT_KEY_SEGMENT.test(value))
|
|
19
|
+
continue;
|
|
20
|
+
const why = value === ""
|
|
21
|
+
? "empty (a leading, trailing or doubled /)"
|
|
22
|
+
: value === "." || value === ".."
|
|
23
|
+
? "a . / .. segment (it would walk out of its own prefix)"
|
|
24
|
+
: "not a plain key segment (it must start with a letter or digit and hold only letters, digits, . _ -)";
|
|
25
|
+
return { segment: i + 1, of: segments.length, value, why };
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
export function parseWorkspaceSnapshotPrefix(raw) {
|
|
30
|
+
if (raw === undefined || raw === "")
|
|
31
|
+
return undefined;
|
|
32
|
+
const bad = snapshotKeyPrefixProblem(raw);
|
|
33
|
+
if (bad === undefined)
|
|
34
|
+
return raw;
|
|
35
|
+
throw Object.assign(new Error(`env WORKSPACE_SNAPSHOT_PREFIX: segment #${bad.segment} of ${bad.of} (${JSON.stringify(bad.value)}) is ${bad.why} — the prefix is a "/"-separated path of plain key segments ` +
|
|
36
|
+
"(each starts with a letter or digit, then letters, digits, . _ -; e.g. WORKSPACE_SNAPSHOT_PREFIX=kata or libA/ws); refusing to start rather than sign snapshot keys under a prefix that does not say what it means"), { code: WORKSPACE_SNAPSHOT_PREFIX_INVALID });
|
|
37
|
+
}
|
|
12
38
|
export const WORKSPACE_SNAPSHOT_EXCLUDE_INVALID = "config.workspace_snapshot_exclude_invalid";
|
|
13
39
|
export function parseWorkspaceSnapshotExclude(raw) {
|
|
14
40
|
if (raw === undefined || raw.trim() === "")
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] —— **写保护表**(core `RunnerDeps.writeProtectedPaths` 座)的姿态推导点(形制照
|
|
3
3
|
* `memory-posture.ts` / `sql-engine-posture.ts`:一次推导,两个读面)。
|
|
4
4
|
*
|
|
5
|
-
* ## 病(
|
|
5
|
+
* ## 病([ref] F2 的根)
|
|
6
6
|
*
|
|
7
7
|
* core 的写保护表是**字面名表**(CC `DANGEROUS_FILES` / `DANGEROUS_DIRECTORIES` /
|
|
8
8
|
* `DANGEROUS_DIRECTORY_PATHS` 三形对位):一次落在表行上的可定路径写(Write/Edit/NotebookEdit)会把
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.136.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"scripts/drain-check.pg.sql",
|
|
38
38
|
"deploy/sema-up",
|
|
39
39
|
"docs/DEVICE-EXECUTOR-PROTOCOL.md",
|
|
40
|
+
"wire-changes/",
|
|
40
41
|
"USAGE.md",
|
|
41
42
|
"MIGRATION.md"
|
|
42
43
|
],
|
|
@@ -68,8 +69,8 @@
|
|
|
68
69
|
"build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
|
|
69
70
|
},
|
|
70
71
|
"dependencies": {
|
|
71
|
-
"@sema-agent/core": "7.
|
|
72
|
-
"@sema-agent/settings-schema": "14.
|
|
72
|
+
"@sema-agent/core": "7.55.0",
|
|
73
|
+
"@sema-agent/settings-schema": "14.5.0",
|
|
73
74
|
"e2b": "^2.28.0",
|
|
74
75
|
"libsodium-wrappers": "^0.8.4",
|
|
75
76
|
"mysql2": "^3.22.4",
|
|
@@ -92,6 +93,7 @@
|
|
|
92
93
|
"@types/ws": "^8.18.1",
|
|
93
94
|
"ajv": "^8.20.0",
|
|
94
95
|
"ajv-formats": "^3.0.1",
|
|
96
|
+
"core-mixed-version-reader": "npm:@sema-agent/core@7.54.1",
|
|
95
97
|
"tsx": "4.19.2",
|
|
96
98
|
"typescript": "5.7.2",
|
|
97
99
|
"vitest": "^4.1.8",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* `dist/orchestration/workflow-agent-session-index.js` 取 —— 本脚本只按 runId 折叠;读不出的行计入 `corrupt`(rc 2:读不出的那一行可能正是点名某张待批卡的那一份);
|
|
32
32
|
* 窗与删码:本判据是一次性迁移 M9 的读侧半场 —— 窗口与删码清单见引擎启动期一次性迁移登记表(one-time-migrations)M9 一行,随 M9 一起删;这里不写第二份窗。
|
|
33
33
|
* · `parked-tool-lists`(升级到 7.132.0 前)/ `own-tool-lists-rollback`(从 7.132.0 回滚前):停驻行记下的工具名清单 / 7.52 写下的 `ownToolLists`(判据与出路见判据表那两条的注);
|
|
34
|
-
* · `sealed-credentials-rollback`(从 7.134.0
|
|
34
|
+
* · `sealed-credentials-rollback`(从 7.134.0 回滚前;从 7.135.0 / 7.136.0 回滚到上一版前同用):续跑上下文的凭据位上带封签的 pending 行(7.133.x 读不懂封签,续跑时把这些位当没有;判据与出路见判据表那一条的注);
|
|
35
35
|
* · `retired-mode-seed`(换钉 7.113.0 前,core 7.39.0 删掉退役 mode-seed 的一次性迁移):pending 行的 `state.inheritedGate` 仍带退役成员;
|
|
36
36
|
* · `permissions-allow-list`(换钉 7.117.0 前,本服务把 `settings.permissions.allow` 整份交给引擎的 allow 层):pending 行所在会话的续跑上下文
|
|
37
37
|
* (`checkpoint-ctx/*.json` 的信封 `{ sessionId, updatedAt, ctx }`)里,`ctx.body.settings.permissions.allow` 是非空数组,且 `ctx.permissionsAllowReading` 不是 `"allow_layer"`
|
|
@@ -464,7 +464,9 @@ export const DRAIN_CRITERIA = [
|
|
|
464
464
|
judge: (row) => (isObject(row.state) && Object.hasOwn(/** @type {Record<string, unknown>} */ (row.state), "ownToolLists") ? "" : undefined),
|
|
465
465
|
},
|
|
466
466
|
{
|
|
467
|
-
// 从 7.134.0 回滚到 7.133.x 之前:pending 行所在会话的续跑上下文里,提交体的凭据位(MCP / A2A 请求头与 env、settings.env、settings.webSearch.apiKey、http hook
|
|
467
|
+
// 从 7.134.0 回滚到 7.133.x 之前:pending 行所在会话的续跑上下文里,提交体的凭据位(MCP / A2A 请求头与 env、settings.env、settings.webSearch.apiKey、http hook 请求头;7.135.0 起另有 command hook 的插件选项)
|
|
468
|
+
// (从 7.135.0 回滚到 7.134.x 之前同用本判据:7.134.x 不认插件选项上的封签,续跑时那份 hooks 整只不采纳;本判据数任何凭据位上的封签,这一类在候选里)
|
|
469
|
+
// (从 7.136.0 回滚到 7.135.x 之前同用本判据:7.136.0 起子进程的命令行 —— MCP stdio 传输与 command hook 条目的 command / args —— 也封成封签,带它们的行盖第 3 代,7.135.x 整行拒续跑;这一类在候选里)
|
|
468
470
|
// 上带封签 —— 7.134.0 封好才落盘,7.133.x 读不懂封签、续跑时把这些位当作没有(无凭据照跑、不报错)。出路:回滚前把它们决掉或取消(随包 `MIGRATION.md` 7.134.0 节)。
|
|
469
471
|
// 判据函数是服务里那一只(`sealedCredentialFieldOf`,经编译产物 `dist/http/checkpoint-ctx.js` 取;走法与封口 / 开口 / 一次性迁移同一只),本脚本不写第二份;
|
|
470
472
|
// 命中行点名第一处凭据位(`field=`,键名;值从不出来);读不懂的 ctx 档 / 索引账本行计入 `corrupt`(rc 2)。
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
-- workflow-park-holder 换钉 7.118.0 之前 / 从 7.118.0 回滚到 7.117.x 之前:此刻待批、且子会话被 workflow park 索引点名的卡(workflow 子代卡;见该段注)。
|
|
18
18
|
-- parked-tool-lists 升级到 7.132.0 之前:停驻行记着子代工具天花板 / 冻结的父约束链 / Skill 卡的清单绑定(7.52 在认领前按规范拼写读它们)的**候选**(见该段注)。
|
|
19
19
|
-- own-tool-lists-rollback 从 7.132.0 回滚到 7.131.x 之前:7.132.0 停驻、带 state.ownToolLists 的行(7.131.x 读不了)。
|
|
20
|
-
-- sealed-credentials-rollback 从 7.134.0 回滚到 7.133.x 之前:停驻、续跑上下文里提交体的凭据位上带封签的行(7.133.x 读不懂封签,续跑时把这些位当没有)的**候选**(见该段注)。
|
|
20
|
+
-- sealed-credentials-rollback 从 7.134.0 回滚到 7.133.x(或从 7.135.0 回滚到 7.134.x、从 7.136.0 回滚到 7.135.x)之前:停驻、续跑上下文里提交体的凭据位上带封签的行(7.133.x 读不懂封签,续跑时把这些位当没有)的**候选**(见该段注)。
|
|
21
21
|
-- permissions-allow-list 换钉 7.117.0 之前:停驻、提交体 settings.permissions.allow 是非空数组且读法记号不是当前的 "allow_layer"(无记号 = 名单时代;"statement" = 表态时代)。
|
|
22
22
|
-- retired-mode-seed 换钉 7.113.0 之前:检查点的 inheritedGate 里仍带退役 mode-seed 成员。
|
|
23
23
|
|
|
@@ -117,10 +117,14 @@ WHERE k.status = 'pending'
|
|
|
117
117
|
AND JSON_CONTAINS_PATH(k.checkpoint, 'one', '$.state.ownToolLists');
|
|
118
118
|
|
|
119
119
|
-- drain-check:sealed-credentials-rollback:mysql —— 期望 hit_rows = 0;每一行 = 一条**候选**:从 7.134.0 回滚到 7.133.x 后续跑会丢掉请求凭据的停驻行。
|
|
120
|
-
-- 在**回滚之前**、对 7.134.0 的数据跑:7.134.0 把续跑上下文里提交体的凭据位(MCP / A2A 请求头与 env、settings.env、settings.webSearch.apiKey、http hook
|
|
120
|
+
-- 在**回滚之前**、对 7.134.0 的数据跑:7.134.0 把续跑上下文里提交体的凭据位(MCP / A2A 请求头与 env、settings.env、settings.webSearch.apiKey、http hook 请求头;7.135.0 起另有 command hook 的插件选项)
|
|
121
121
|
-- 封成封签(对象,格式词 "checkpoint-ctx-sealedbox-v1")才落盘;7.133.x 读不懂封签,续跑时把这些位当作没有(无凭据照跑、不报错)。出路:回滚前把它们决掉或取消(见随包 MIGRATION.md 7.134.0 节)。
|
|
122
122
|
-- 读哪一份续跑上下文:与续跑腿同(连接形与 permissions-allow-list 段逐字同,理由见该段注)。SQL 不走凭据位闭集 ⇒ 数的是**真超集**:提交体里任何一处有一个
|
|
123
123
|
-- JSON 串值恰为这个格式词即数(封签只落在凭据位上;体里别处恰好写着这个词的串值也会被数到 —— 多数,不漏)。本地脚本同名判据走服务里那一只凭据位走法(精确)。
|
|
124
|
+
-- 从 7.135.0 回滚到 7.134.x 之前同用本判据:7.135.0 起 command hook 条目的插件选项(settings.hooks.<事件>[].hooks[].plugin.options)也封成封签,7.134.x 不认这一位,
|
|
125
|
+
-- 续跑时那份 hooks 整只不采纳(其中的守卫不再拦)。本判据数任何凭据位上带封签的行,所以这一类也在候选里(超集)。
|
|
126
|
+
-- 从 7.136.0 回滚到 7.135.x 之前同用本判据:7.136.0 起子进程的命令行(MCP stdio 传输与 command hook 条目的 command / args)也封成封签,带它们的行
|
|
127
|
+
-- 盖第 3 代读法记号,7.135.x 对这样的行整行拒续跑(409 conflict.checkpoint_ctx_unsealable)。这一类同样在候选里(超集)。
|
|
124
128
|
SELECT 'sealed-credentials-rollback' AS criterion, COUNT(*) AS hit_rows,
|
|
125
129
|
COALESCE(GROUP_CONCAT(k.session_id ORDER BY k.created_at_ms DESC SEPARATOR ','), '') AS sessions
|
|
126
130
|
FROM checkpoint k
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
-- workflow-park-holder 换钉 7.118.0 之前 / 从 7.118.0 回滚到 7.117.x 之前:此刻待批、且子会话被 workflow park 索引点名的卡(workflow 子代卡;见该段注)。
|
|
17
17
|
-- parked-tool-lists 升级到 7.132.0 之前:停驻行记着子代工具天花板 / 冻结的父约束链 / Skill 卡的清单绑定(7.52 在认领前按规范拼写读它们)的**候选**(见该段注)。
|
|
18
18
|
-- own-tool-lists-rollback 从 7.132.0 回滚到 7.131.x 之前:7.132.0 停驻、带 state.ownToolLists 的行(7.131.x 读不了)。
|
|
19
|
-
-- sealed-credentials-rollback 从 7.134.0 回滚到 7.133.x 之前:停驻、续跑上下文里提交体的凭据位上带封签的行(7.133.x 读不懂封签,续跑时把这些位当没有)的**候选**(见该段注)。
|
|
19
|
+
-- sealed-credentials-rollback 从 7.134.0 回滚到 7.133.x(或从 7.135.0 回滚到 7.134.x、从 7.136.0 回滚到 7.135.x)之前:停驻、续跑上下文里提交体的凭据位上带封签的行(7.133.x 读不懂封签,续跑时把这些位当没有)的**候选**(见该段注)。
|
|
20
20
|
-- permissions-allow-list 换钉 7.117.0 之前:停驻、提交体 settings.permissions.allow 是非空数组且读法记号不是当前的 "allow_layer"(无记号 = 名单时代;"statement" = 表态时代)。
|
|
21
21
|
-- retired-mode-seed 换钉 7.113.0 之前:检查点的 inheritedGate 里仍带退役 mode-seed 成员。
|
|
22
22
|
|
|
@@ -125,10 +125,14 @@ WHERE k.status = 'pending'
|
|
|
125
125
|
AND (k.checkpoint -> 'state') ? 'ownToolLists';
|
|
126
126
|
|
|
127
127
|
-- drain-check:sealed-credentials-rollback:pg —— 期望 hit_rows = 0;每一行 = 一条**候选**:从 7.134.0 回滚到 7.133.x 后续跑会丢掉请求凭据的停驻行。
|
|
128
|
-
-- 在**回滚之前**、对 7.134.0 的数据跑:7.134.0 把续跑上下文里提交体的凭据位(MCP / A2A 请求头与 env、settings.env、settings.webSearch.apiKey、http hook
|
|
128
|
+
-- 在**回滚之前**、对 7.134.0 的数据跑:7.134.0 把续跑上下文里提交体的凭据位(MCP / A2A 请求头与 env、settings.env、settings.webSearch.apiKey、http hook 请求头;7.135.0 起另有 command hook 的插件选项)
|
|
129
129
|
-- 封成封签(对象,格式词 "checkpoint-ctx-sealedbox-v1")才落盘;7.133.x 读不懂封签,续跑时把这些位当作没有(无凭据照跑、不报错)。出路:回滚前把它们决掉或取消(见随包 MIGRATION.md 7.134.0 节)。
|
|
130
130
|
-- 读哪一份续跑上下文:与续跑腿同(连接形与 permissions-allow-list 段逐字同,理由见该段注)。SQL 不走凭据位闭集 ⇒ 数的是**真超集**:提交体里任何一处有一个
|
|
131
131
|
-- JSON 串值恰为这个格式词即数(封签只落在凭据位上;体里别处恰好写着这个词的串值也会被数到 —— 多数,不漏)。本地脚本同名判据走服务里那一只凭据位走法(精确)。
|
|
132
|
+
-- 从 7.135.0 回滚到 7.134.x 之前同用本判据:7.135.0 起 command hook 条目的插件选项(settings.hooks.<事件>[].hooks[].plugin.options)也封成封签,7.134.x 不认这一位,
|
|
133
|
+
-- 续跑时那份 hooks 整只不采纳(其中的守卫不再拦)。本判据数任何凭据位上带封签的行,所以这一类也在候选里(超集)。
|
|
134
|
+
-- 从 7.136.0 回滚到 7.135.x 之前同用本判据:7.136.0 起子进程的命令行(MCP stdio 传输与 command hook 条目的 command / args)也封成封签,带它们的行
|
|
135
|
+
-- 盖第 3 代读法记号,7.135.x 对这样的行整行拒续跑(409 conflict.checkpoint_ctx_unsealable)。这一类同样在候选里(超集)。
|
|
132
136
|
SELECT 'sealed-credentials-rollback' AS criterion, count(*) AS hit_rows,
|
|
133
137
|
coalesce(string_agg(k.session_id, ',' ORDER BY k.created_at_ms DESC), '') AS sessions
|
|
134
138
|
FROM checkpoint k
|
package/skills/loop.md
CHANGED
|
@@ -35,7 +35,7 @@ Then briefly confirm what's scheduled (id, human cadence, how to cancel with `Cr
|
|
|
35
35
|
With no interval, run one iteration of the task now, then call `ScheduleWakeup` to schedule when you resume:
|
|
36
36
|
|
|
37
37
|
- `delaySeconds`: how long to sleep (runtime clamps to [60, 3600]).
|
|
38
|
-
- `reason`: one short, specific sentence ("watching CI run
|
|
38
|
+
- `reason`: one short, specific sentence ("watching the release-branch CI run" beats "waiting") — shown to the user and telemetry.
|
|
39
39
|
- `prompt`: the same /loop input verbatim, so the next firing re-enters this skill and continues the loop. For an autonomous loop with no user prompt, pass the literal sentinel `<<autonomous-loop-dynamic>>` (never the CronCreate-mode `<<autonomous-loop>>` sentinel — ScheduleWakeup always uses the `-dynamic` variant).
|
|
40
40
|
- To END the loop: call `ScheduleWakeup` with `stop: true` and omit every other field — the loop ends immediately and no further wakeups fire.
|
|
41
41
|
|
package/skills/schedule.md
CHANGED
|
@@ -13,7 +13,7 @@ Parameters:
|
|
|
13
13
|
|
|
14
14
|
- `prompt` (string, required): fully self-contained instructions for the future task. It runs unattended — inline every path, id, and acceptance criterion it needs; never reference "the file we discussed".
|
|
15
15
|
- `schedule` (union, required) — pick the kind by intent:
|
|
16
|
-
- Recurring: `{ "kind": "cron", "expr": "M H DoM Mon DoW" }` — standard 5-field cron in the user's LOCAL timezone
|
|
16
|
+
- Recurring: `{ "kind": "cron", "expr": "M H DoM Mon DoW" }` — standard 5-field cron in the user's LOCAL timezone. There is no seconds field: a 6-field expression is rejected ("its leading seconds field is not supported — the resident scheduler fires on 5-field cron, so one minute is the finest granularity available."), so drop the leading field and retry. `"0 9 * * *"` means 9am local; no timezone conversion needed.
|
|
17
17
|
- One-shot at a wall-clock time: `{ "kind": "at", "atMs": <epoch ms> }`.
|
|
18
18
|
- One-shot after a delay: `{ "kind": "delay", "delaySec": <seconds> }`.
|
|
19
19
|
- `label` (string, optional): short name. Also the dedup key — creating again with the same schedule+label upserts (idempotent), so use a stable label when updating a task instead of piling up duplicates.
|