@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
|
@@ -2,7 +2,7 @@ import { type WebFetchConfig, type BackgroundAgentStore, type CheckpointStore, t
|
|
|
2
2
|
import type { Logger } from "../observability/logger.js";
|
|
3
3
|
import { type SubagentExtraToolSet } from "./builtin-tools.js";
|
|
4
4
|
import { type RepoReadClient } from "./repo-tools.js";
|
|
5
|
-
import { type LoadedSkill } from "./skills.js";
|
|
5
|
+
import { type LoadedSkill, type ScenarioSkillEntry } from "./skills.js";
|
|
6
6
|
import { type ScenarioHands } from "./hands-lane.js";
|
|
7
7
|
import type { DelegationRootWitness } from "../delegated-session-owner.js";
|
|
8
8
|
/**
|
|
@@ -28,7 +28,7 @@ export interface ScenarioBundle {
|
|
|
28
28
|
*/
|
|
29
29
|
hands: ScenarioHands;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* [ref]:本场景从 roster 里**真卸载**的工具名(`TaskSpec.excludeTools`:per-scenario 的 roster 移除,schema 不进 `tools[]`;不是策略 deny)。缺席 = 不卸。
|
|
32
32
|
* 经 {@link buildExcludeToolsSeat} 与调用方自己的 `excludeTools` 取并后写进 `TaskSpec`(HTTP 腿与 run-local 腿同一只写点)—— 场景只能多卸,调用方也只能多卸。
|
|
33
33
|
* 与 `hands` 正交:`hands: "none"` 是整只手不挂(scan / code-review),本键是挂手之后卸掉其中一部分(cowork 卸编码类工具、留文件读)。
|
|
34
34
|
*/
|
|
@@ -83,7 +83,7 @@ export interface ScenarioContext {
|
|
|
83
83
|
*/
|
|
84
84
|
sessionId?: string;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* [ref] / [ref]:**委派树根的见证**(停驻挂点的属主来源)—— 根会话 id + 调用方判断那一刻读到的根行住客(`delegated-session-owner.ts` 的 `DelegationRootWitness`)。
|
|
87
87
|
* 由**每一个**接了停驻挂点的取用方显式交出(一条读法,没有回落):请求腿 = 本请求经鉴权解析的会话与受理时那一读(`boot/resolve-spec.ts`);`/decide` 赎回面 = 行上的
|
|
88
88
|
* `rootSessionId` 与赎回腿 claim 前后两读的那一位住客(`parked-revive-surface.ts`,交不交座都交)。它**只**喂停驻挂点,不挂任何会话级设施(那是 {@link sessionId} 的事,
|
|
89
89
|
* 判据是「这只 bundle 是不是在那只会话上取用的」,与属主来源是两个独立判据)。缺席 = 没有根可交(boot 期探针、run-local、行上没有根)⇒ 律给哨兵。
|
|
@@ -104,7 +104,7 @@ export interface ScenarioDeps {
|
|
|
104
104
|
* could exfil via an arbitrary public URL; the SSRF floor only blocks internal). Single-user TOC keeps WebFetch. */
|
|
105
105
|
requirePrincipal?: boolean;
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* [ref]:这台部署的执行车道**有没有手**(`laneWiresExecutionEnv`;`REMOTE_EXEC` 未设 = `in-process` = 没有)。场景详情读面据它与场景自己的 `hands` 表态一起答
|
|
108
108
|
* 「这个场景的 run 有没有工作区」({@link runHasWorkspace}),进而给出附件可受理供给集。**缺席按没有手读**(宁少说不多说:不广告一个会撞 400 的 `path`)。
|
|
109
109
|
*/
|
|
110
110
|
handsLane?: boolean;
|
|
@@ -123,7 +123,7 @@ export interface ScenarioDeps {
|
|
|
123
123
|
* execute-time late-bound via ctx.taskId → TaskEnvRegistry, so ONE spec serves every spawn) cannot ride the
|
|
124
124
|
* ASSEMBLY-time static `subagent.tools` pool; core evaluates the factory at each spawn and merges its product into the
|
|
125
125
|
* pool, then it goes through core's `resolveToolSubset` whitelist like any other tool (agent-def allowTools/denyTools
|
|
126
|
-
* still govern — no extra gate needed on our side). A SET, not a bare factory (core 7.46.0
|
|
126
|
+
* still govern — no extra gate needed on our side). A SET, not a bare factory (core 7.46.0 [ref]): its `tools` are both
|
|
127
127
|
* what a spawn can be handed and the roster the delegation tool declares (`extraToolNames`), so the factory cannot hand
|
|
128
128
|
* out a tool the roster does not name. Absent ⇒ the delegation tool injects `Now` alone.
|
|
129
129
|
*/
|
|
@@ -152,7 +152,7 @@ export interface ScenarioDeps {
|
|
|
152
152
|
*/
|
|
153
153
|
checkpointStore?: CheckpointStore;
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
155
|
+
* [ref]:比 core 挂点多一个参数 —— `root` = **委派树根的见证,由取用这只 bundle 的调用方交出**({@link ScenarioContext.delegationRoot};缺席 = 没有根可交)。
|
|
156
156
|
* core 的挂点只给子代 id,停驻写下 / 定夺的宿主行属主却要按委派继承律取委派树根的属主;场景工厂把见证绑进交给 core 的那只闭包,同一棵树里任何深度的后台子代
|
|
157
157
|
* 停驻都经它(子代沿用父的委派工具实例)。
|
|
158
158
|
*/
|
|
@@ -217,12 +217,18 @@ export interface ScenarioDetail {
|
|
|
217
217
|
/** 机读原因键;仅 `available:false` 时在场(缺席=没有理由)。消费方按键分支,禁匹配英文文案。 */
|
|
218
218
|
unavailableReason?: ScenarioUnavailableReason;
|
|
219
219
|
/**
|
|
220
|
-
*
|
|
220
|
+
* [ref]:**这个场景在本部署上受理的附件供给**(顶层能力位 `userAttachments.supplies` 的子集,保持席位序;键恒在场,不是 `null`)。
|
|
221
221
|
* 顶层能力位说的是引擎席位**能承载**的三种供给(常量);`path` 读的是这一 run 的工作区,只有「场景挂手 ∧ 部署的执行车道有手」的 run 才有
|
|
222
222
|
* (判官 {@link runHasWorkspace}),其余整条 `path` 条目由引擎 prepare 拒 `config.user_attachment_invalid` —— 宿主发之前读这一格,不靠撞 400。
|
|
223
223
|
* `content_text` / `content_image` 与工作区无关,恒在。
|
|
224
224
|
*/
|
|
225
225
|
attachmentSupplies: UserAttachmentSupplyWord[];
|
|
226
|
+
/**
|
|
227
|
+
* [ref]:**这个场景交进每一个 run 的部署技能**(本部署技能目录 + 配置源交来的;不含请求体自带的 `skills`)—— 名字 / 描述 / 来处,不带正文。
|
|
228
|
+
* 与工厂交进 `TaskSpec` 的那一份是**同一只过滤**(技能范围 + `skills.ts` 的 `skillsInScope`)的两个投影:同一组、同一个序。名字就是 `userInvokedSkills` 点名用的串。
|
|
229
|
+
* 键恒在场;没有技能 ⇒ `[]`。
|
|
230
|
+
*/
|
|
231
|
+
skills: ScenarioSkillEntry[];
|
|
226
232
|
}
|
|
227
233
|
/** 引擎附件席位的供给词(`USER_ATTACHMENT_SEAT.supplies` 的成员;取型,不手抄)。 */
|
|
228
234
|
export type UserAttachmentSupplyWord = (typeof USER_ATTACHMENT_SEAT)["supplies"][number];
|
|
@@ -249,14 +255,26 @@ export declare const BUILTIN_SCENARIO_HANDS: {
|
|
|
249
255
|
readonly scan: "none";
|
|
250
256
|
readonly cowork: "full";
|
|
251
257
|
};
|
|
258
|
+
/**
|
|
259
|
+
* [ref]:内建场景的**技能范围**(技能 `scenarios` 标签按哪个名字匹配)—— **全仓唯一声明处**:各场景工厂交进 `TaskSpec` 的技能与场景卡上的技能清单都按这张表取范围,
|
|
260
|
+
* 再过同一只过滤(`skills.ts` 的 `skillsInScope`),两边因此恒为同一组技能。按 {@link BuiltinScenarioName} 键控 ⇒ 加 / 删一个内建场景而这里没跟 = 编译红。
|
|
261
|
+
* `code` 的范围是 `default`:它与 default 共用一只工厂(工具 / 技能面恒等由构造保证),打了 `scenarios: code` 的技能不进 code 的 run。center 场景的范围是它自己的名字。
|
|
262
|
+
*/
|
|
263
|
+
export declare const BUILTIN_SCENARIO_SKILL_SCOPE: {
|
|
264
|
+
readonly code: "default";
|
|
265
|
+
readonly default: "default";
|
|
266
|
+
readonly "code-review": "code-review";
|
|
267
|
+
readonly scan: "scan";
|
|
268
|
+
readonly cowork: "cowork";
|
|
269
|
+
};
|
|
252
270
|
/**
|
|
253
271
|
* `branded` = 这台部署是不是品牌部署 —— 部署座挂品牌行读的同一只判官(`brand-identity.ts` `isBrandedDeployment`)交进来;没有默认值:每个调用点说出这件事实。
|
|
254
272
|
* 品牌部署上,品牌行 `when.binding` 那张表里的场景(`BRAND_IDENTITY_SCENARIOS`)的 `promptSummary` 点名 Sema 产品身份 —— 读面说的就是模型收到的。
|
|
255
273
|
*/
|
|
256
|
-
export declare function builtinScenarioDetails(scenarios: Record<string, Scenario>, deps: Pick<ScenarioDeps, "repoClient" | "handsLane">, branded: boolean): Record<string, ScenarioDetail>;
|
|
274
|
+
export declare function builtinScenarioDetails(scenarios: Record<string, Scenario>, deps: Pick<ScenarioDeps, "repoClient" | "handsLane" | "skills">, branded: boolean): Record<string, ScenarioDetail>;
|
|
257
275
|
/** center 条目详情(有效性判定与 centerScenarios 完全同款:无效条目既不进 overlay 也不进详情——
|
|
258
276
|
* 保证约定①「详情显示的来源=运行实际用的定义」永不错位)。 */
|
|
259
|
-
export declare function centerScenarioDetails(specs: CenterScenarioSpec[] | undefined, builtinNames: string[], deps: Pick<ScenarioDeps, "repoClient" | "handsLane">): Record<string, ScenarioDetail>;
|
|
277
|
+
export declare function centerScenarioDetails(specs: CenterScenarioSpec[] | undefined, builtinNames: string[], deps: Pick<ScenarioDeps, "repoClient" | "handsLane" | "skills">): Record<string, ScenarioDetail>;
|
|
260
278
|
export interface CenterScenarioSpec {
|
|
261
279
|
name: string;
|
|
262
280
|
toolset: string;
|
|
@@ -300,7 +318,7 @@ export declare function centerScenarios(deps: ScenarioDeps, specs: CenterScenari
|
|
|
300
318
|
* Personalization seam: merge the caller's own skills AFTER the scenario's, with
|
|
301
319
|
* SCENARIO-WINS on a name clash — the scenario / center skills own the name (they are the deployment's baseline
|
|
302
320
|
* wording, not an enforcement face: permissions / write gates / hooks do not ride on skills, and a caller may
|
|
303
|
-
* unload the whole set with `disableSkills`,
|
|
321
|
+
* unload the whole set with `disableSkills`, [ref]); user content never shadows them. Duplicate names within the user list keep the first. Clashes are logged for audit
|
|
304
322
|
* (silent drops would make "my skill didn't fire" undebuggable). Input is already shape/size-validated
|
|
305
323
|
* by the HTTP layer (validateUserSkills); this stays pure merge policy.
|
|
306
324
|
*/
|
|
@@ -4,7 +4,7 @@ import { createSubagentExtraTools, extraToolsErrorFields, nowTool } from "./buil
|
|
|
4
4
|
import { parseRepo, repoToolsFor } from "./repo-tools.js";
|
|
5
5
|
import { NOW_TOOL_NAME, REPO_PULL_DIFF_TOOL_NAME, REPO_READ_FILE_TOOL_NAME, REPO_TREE_TOOL_NAME } from "./host-tool-names.js";
|
|
6
6
|
import { createWebSearchBackend, judgeRequestWebSearch } from "../plugins/web-search.js";
|
|
7
|
-
import { skillsForScenario } from "./skills.js";
|
|
7
|
+
import { scenarioSkillEntries, skillsForScenario } from "./skills.js";
|
|
8
8
|
import { OFFICE_EXCLUDED_TOOL_NAMES, runHasWorkspace } from "./hands-lane.js";
|
|
9
9
|
import { BRAND_IDENTITY_SCENARIOS } from "./brand-identity.js";
|
|
10
10
|
export function buildPromptSeats(scenarioName, prompt, callerSystemPrompt) {
|
|
@@ -69,7 +69,7 @@ export function buildScenarios(deps) {
|
|
|
69
69
|
}).filter((t) => t.name !== WEB_FETCH_TOOL_NAME || deps.requirePrincipal !== true),
|
|
70
70
|
],
|
|
71
71
|
hands: BUILTIN_SCENARIO_HANDS.default,
|
|
72
|
-
skills: skillsForScenario(deps.skills,
|
|
72
|
+
skills: skillsForScenario(deps.skills, BUILTIN_SCENARIO_SKILL_SCOPE.default),
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
return {
|
|
@@ -77,6 +77,7 @@ export function buildScenarios(deps) {
|
|
|
77
77
|
code: (req, principal, ctx) => ({
|
|
78
78
|
...defaultScenario(req, principal, ctx),
|
|
79
79
|
hands: BUILTIN_SCENARIO_HANDS.code,
|
|
80
|
+
skills: skillsForScenario(deps.skills, BUILTIN_SCENARIO_SKILL_SCOPE.code),
|
|
80
81
|
prompt: { role: "code" },
|
|
81
82
|
}),
|
|
82
83
|
"code-review": (req) => codeReview(deps, req),
|
|
@@ -88,13 +89,13 @@ export function buildScenarios(deps) {
|
|
|
88
89
|
return {
|
|
89
90
|
tools: [...repoToolsFor(repoClient, parseRepo(req.repo)), nowTool()],
|
|
90
91
|
hands: BUILTIN_SCENARIO_HANDS.scan,
|
|
91
|
-
skills: skillsForScenario(deps.skills,
|
|
92
|
+
skills: skillsForScenario(deps.skills, BUILTIN_SCENARIO_SKILL_SCOPE.scan),
|
|
92
93
|
};
|
|
93
94
|
},
|
|
94
95
|
cowork: (req, principal, ctx) => ({
|
|
95
96
|
...defaultScenario(req, principal, ctx),
|
|
96
97
|
hands: BUILTIN_SCENARIO_HANDS.cowork,
|
|
97
|
-
skills: skillsForScenario(deps.skills,
|
|
98
|
+
skills: skillsForScenario(deps.skills, BUILTIN_SCENARIO_SKILL_SCOPE.cowork),
|
|
98
99
|
excludeTools: OFFICE_EXCLUDED_TOOL_NAMES,
|
|
99
100
|
prompt: { role: "cowork" },
|
|
100
101
|
}),
|
|
@@ -124,6 +125,13 @@ export const BUILTIN_SCENARIO_HANDS = {
|
|
|
124
125
|
scan: "none",
|
|
125
126
|
cowork: "full",
|
|
126
127
|
};
|
|
128
|
+
export const BUILTIN_SCENARIO_SKILL_SCOPE = {
|
|
129
|
+
code: "default",
|
|
130
|
+
default: "default",
|
|
131
|
+
"code-review": "code-review",
|
|
132
|
+
scan: "scan",
|
|
133
|
+
cowork: "cowork",
|
|
134
|
+
};
|
|
127
135
|
export function builtinScenarioDetails(scenarios, deps, branded) {
|
|
128
136
|
const probe = (name, req, principal, fallback) => {
|
|
129
137
|
try {
|
|
@@ -138,6 +146,7 @@ export function builtinScenarioDetails(scenarios, deps, branded) {
|
|
|
138
146
|
name, source: "builtin", builtin: true, summary, toolset, tools, promptSummary, enabled: true,
|
|
139
147
|
...availabilityFields(deps, toolset),
|
|
140
148
|
attachmentSupplies: attachmentSuppliesFor(BUILTIN_SCENARIO_HANDS[name], deps.handsLane === true),
|
|
149
|
+
skills: scenarioSkillEntries(deps.skills, BUILTIN_SCENARIO_SKILL_SCOPE[name]),
|
|
141
150
|
});
|
|
142
151
|
const brandedScenario = (name) => branded && BRAND_IDENTITY_SCENARIOS.includes(name);
|
|
143
152
|
const details = {
|
|
@@ -170,6 +179,7 @@ export function centerScenarioDetails(specs, builtinNames, deps) {
|
|
|
170
179
|
enabled: true,
|
|
171
180
|
...availabilityFields(deps, spec.toolset),
|
|
172
181
|
attachmentSupplies: attachmentSuppliesFor(toolset.hands, deps.handsLane === true),
|
|
182
|
+
skills: scenarioSkillEntries(deps.skills, spec.name),
|
|
173
183
|
};
|
|
174
184
|
}
|
|
175
185
|
return out;
|
|
@@ -244,7 +254,7 @@ function codeReview(deps, req) {
|
|
|
244
254
|
}
|
|
245
255
|
const coords = parseRepo(req.repo);
|
|
246
256
|
const repoTools = repoToolsFor(repoClient, coords);
|
|
247
|
-
const skills = skillsForScenario(deps.skills, "code-review");
|
|
257
|
+
const skills = skillsForScenario(deps.skills, BUILTIN_SCENARIO_SKILL_SCOPE["code-review"]);
|
|
248
258
|
const hands = BUILTIN_SCENARIO_HANDS["code-review"];
|
|
249
259
|
return { tools: [...repoTools, nowTool()], hands, skills, prompt: { roleText: REVIEWER_ROLE_TEXT } };
|
|
250
260
|
}
|
|
@@ -53,7 +53,7 @@ export declare function sendUserFileTool(deps: {
|
|
|
53
53
|
* posture (their denyTools sets predate this tool, so core's resolveToolSubset would let it through). `ctx.agentType`
|
|
54
54
|
* carries the spawned definition's name (core subagent.js); membership in core's builtin catalog ⇒ inject nothing.
|
|
55
55
|
*
|
|
56
|
-
* 🔴
|
|
56
|
+
* 🔴 [ref](7.116.0):修前这里还有一道 **F1 部署策略预判** —— 部署审批面(`APPROVAL_DENY` / `REQUIRE` / `NEVER_AUTO`)点名 SendUserFile 就一只都
|
|
57
57
|
* 不注入,前提是「subRunner 不带策略、core 的子代不继承父的 toolPolicy」(core 1.287 时的事实)。core 自 7.40.1 起顶层 run 解析后的调用方策略
|
|
58
58
|
* (`spec.toolPolicy ?? deps.toolPolicy`)与它冻结的审批席经继承链(`InheritedGate.parentConstraints`)判子代的注入工具:deny ⇒ 零执行;ask ⇒ 顶层
|
|
59
59
|
* 审批席被问一次;无审批席 ⇒ 拒(core 7.41.0 钉)。本仓在真实装配上亲跑十格(spec / deps 两槽 × deny / ask 允 / ask 拒 / 无审批席 / 耐久车道无活席,
|
|
@@ -36,8 +36,16 @@ export interface LoadedSkill {
|
|
|
36
36
|
spec: SkillSpec;
|
|
37
37
|
/** Scenarios this skill applies to; empty = global (every scenario). */
|
|
38
38
|
scenarios: string[];
|
|
39
|
+
/**
|
|
40
|
+
* [ref] —— 这只技能的**来处**,由铸它的那条装载腿写下(唯一写点;之后谁都不改写,只投影):`factory` = 本部署的技能目录(`SKILLS_DIR`,{@link loadDeploymentSkills});
|
|
41
|
+
* `center` = 本部署的配置源交来的(中心 / 本地 `config.d` 的技能清单 `applySkillsManifest`,或配置声明的插件 `applyCenterPlugins`)。配置源按名盖掉出厂同名技能 ⇒ 盖上来的那只是 `center`。
|
|
42
|
+
* 场景卡的技能清单原样投这一位(`GET /v1/capabilities/scenarios/:name` 的 `skills[].source`)。
|
|
43
|
+
*/
|
|
44
|
+
source: SkillSource;
|
|
39
45
|
}
|
|
40
|
-
/**
|
|
46
|
+
/** 技能来处的闭集(见 {@link LoadedSkill.source})。 */
|
|
47
|
+
export type SkillSource = "factory" | "center";
|
|
48
|
+
/** 加载 lane 的事实:来处(`source`,必填)与信任级。`confineTo` 缺席(受控 lane:烤制进镜像的 skills 目录)= 维持既有语义,symlink 照跟
|
|
41
49
|
* ——那个便利是有意的(`foo.md -> 共享文件`)。`confineTo` 在场(**不可信 lane**:第三方 git checkout,
|
|
42
50
|
* 见 center-plugins 的 plugin 装载)= 每个被读条目 realpath 后必须仍在该根之内,逃逸即抛。
|
|
43
51
|
* 🔴 为什么信任级必须是**参数**而不是注释里的假设:本函数的头注原写着「skills dir 全受控」,而
|
|
@@ -45,12 +53,13 @@ export interface LoadedSkill {
|
|
|
45
53
|
* 于是 checkout 里某个 skill 条目(`任意 .md -> /宿主/任意文件`)会被读进 spec.files 进入提示词。resolvePluginSkillsRoot
|
|
46
54
|
* 只 realpath 守了 skills **根**,根下逐条目没守。 */
|
|
47
55
|
export interface LoadSkillsOptions {
|
|
56
|
+
/** [ref]:这条装载腿铸出的技能的来处({@link LoadedSkill.source})—— **必填**:装载器自己判断不了它读的是哪一种目录,由调用的那条腿说出这件事实。 */
|
|
57
|
+
source: SkillSource;
|
|
48
58
|
/** 不可信 lane 的约束根(通常=clone root)。缺席=受控 lane,不做逐条目约束。 */
|
|
49
59
|
confineTo?: string;
|
|
50
60
|
/**
|
|
51
|
-
*
|
|
52
|
-
* (`SkillSpec.baseDir`);假/缺席 ⇒ **不带**。判据的单一属主 = `
|
|
53
|
-
* {@link import("../task-cwd.js").toolsRunOnThisHost}(调用方按它算,别在这里第二次判 lane)。
|
|
61
|
+
* [ref] —— 「**工具跑的那台机器**的盘就是本进程这台盘吗」。真 ⇒ 目录形态技能带上自己的目录
|
|
62
|
+
* (`SkillSpec.baseDir`);假/缺席 ⇒ **不带**。判据的单一属主 = 部署形表行 `toolsOnThisHost`(`deployment-shape.ts`;调用方按它算,别在这里第二次判 lane)。
|
|
54
63
|
*
|
|
55
64
|
* 🔴 **缺席 = 不带**,是**故意的 fail-closed 方向**:带了一条工具那边不存在的路径,伤是「模型按它去
|
|
56
65
|
* 读、扑空,顺带看到本机目录布局」;不带的伤只是少一条线索(附件本来就随 invoke 全文内联投递,
|
|
@@ -64,13 +73,13 @@ export interface LoadSkillsOptions {
|
|
|
64
73
|
* `/a/root` 前缀。目标不存在 ⇒ realpath 抛 ENOENT,同样是拒绝(悬空链接不该被读)。
|
|
65
74
|
* `label` = 错误文本里的对象名(center-plugins 用它约束 manifest 本体,报错不该指成 skill entry)。 */
|
|
66
75
|
export declare function assertConfined(p: string, rootReal: string, label?: string): void;
|
|
67
|
-
export declare function loadSkills(dir: string, opts
|
|
76
|
+
export declare function loadSkills(dir: string, opts: LoadSkillsOptions): LoadedSkill[];
|
|
68
77
|
/**
|
|
69
|
-
*
|
|
70
|
-
* 各写一遍 `loadSkills(config.skillsDir, { toolsShareThisFilesystem:
|
|
78
|
+
* [ref] —— **出厂技能**的装载腿(`SKILLS_DIR` 自扫)。stage-07 与 run-local 两处装配点**都调这一只**:改前两处
|
|
79
|
+
* 各写一遍 `loadSkills(config.skillsDir, { toolsShareThisFilesystem: <车道判据>(config) })`,测试只能
|
|
71
80
|
* 直传布尔去证 `loadSkills`(`baked-skills.test.ts`),证不到「config → 装配腿 → baseDir」这一段;收成一只
|
|
72
|
-
* 之后,联合格从 config 走到 `baseDir`(`test/capabilities-http.test.ts`
|
|
73
|
-
*
|
|
81
|
+
* 之后,联合格从 config 走到 `baseDir`(`test/capabilities-http.test.ts` [ref] 段)证的就是两处装配点本人。
|
|
82
|
+
* 判据属主:部署形表行 `toolsOnThisHost`([ref];[ref] 起 in-process ⇒ 假 ⇒ 目录形技能不带 `baseDir`)。
|
|
74
83
|
*/
|
|
75
84
|
export declare function loadDeploymentSkills(config: {
|
|
76
85
|
readonly skillsDir: string;
|
|
@@ -78,9 +87,19 @@ export declare function loadDeploymentSkills(config: {
|
|
|
78
87
|
readonly provider: RemoteExecProvider;
|
|
79
88
|
} | undefined;
|
|
80
89
|
}, logger?: Logger): LoadedSkill[];
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
/** 一个技能范围交进 `TaskSpec` 的技能(场景工厂的 `skills`)。范围从哪来见 `scenarios.ts` 的 `BUILTIN_SCENARIO_SKILL_SCOPE`(center 场景 = 它自己的名字)。 */
|
|
91
|
+
export declare function skillsForScenario(loaded: readonly LoadedSkill[], scope: string): SkillSpec[];
|
|
92
|
+
/**
|
|
93
|
+
* [ref] —— 场景卡技能清单的一条(`GET /v1/capabilities/scenarios/:name` 的 `skills[]`):名字 / 描述 / 来处,**不带正文**,也不带技能上的两只工具清单
|
|
94
|
+
* (`allowedTools` / `disallowedTools`)。名字就是提交体 `userInvokedSkills` 点名时用的那个串。
|
|
95
|
+
*/
|
|
96
|
+
export interface ScenarioSkillEntry {
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly description: string;
|
|
99
|
+
readonly source: SkillSource;
|
|
100
|
+
}
|
|
101
|
+
/** 一个技能范围的卡上清单 —— 与 {@link skillsForScenario} 同一只过滤、同一个序,只是投影不同。 */
|
|
102
|
+
export declare function scenarioSkillEntries(loaded: readonly LoadedSkill[], scope: string): ScenarioSkillEntry[];
|
|
84
103
|
/** {@link parseFrontmatter} 的三种读数(闭集):`absent` = 第一行不是围栏,没有 frontmatter(正当的全局技能)· `block` = 围栏收好了的块 · `unclosed` = 第一行是围栏而块没收好(读不了 —— 调用方拒载)。 */
|
|
85
104
|
export type FrontmatterRead = {
|
|
86
105
|
readonly kind: "absent";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
2
2
|
import { join, resolve, sep } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "../deployment-shape.js";
|
|
4
4
|
import { createLogger } from "../observability/logger.js";
|
|
5
5
|
export function assertConfined(p, rootReal, label = "skill entry") {
|
|
6
6
|
let real;
|
|
@@ -15,7 +15,7 @@ export function assertConfined(p, rootReal, label = "skill entry") {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
export function loadSkills(dir, opts) {
|
|
18
|
-
const logger = opts
|
|
18
|
+
const logger = opts.logger ?? createLogger("warn");
|
|
19
19
|
let entries;
|
|
20
20
|
try {
|
|
21
21
|
entries = readdirSync(dir, { withFileTypes: true });
|
|
@@ -25,15 +25,15 @@ export function loadSkills(dir, opts) {
|
|
|
25
25
|
}
|
|
26
26
|
const out = [];
|
|
27
27
|
const seen = new Map();
|
|
28
|
-
const push = (skill,
|
|
28
|
+
const push = (skill, file) => {
|
|
29
29
|
const prior = seen.get(skill.spec.name);
|
|
30
30
|
if (prior !== undefined) {
|
|
31
|
-
throw new Error(`duplicate skill name "${skill.spec.name}": ${prior} vs ${
|
|
31
|
+
throw new Error(`duplicate skill name "${skill.spec.name}": ${prior} vs ${file}`);
|
|
32
32
|
}
|
|
33
|
-
seen.set(skill.spec.name,
|
|
33
|
+
seen.set(skill.spec.name, file);
|
|
34
34
|
out.push(skill);
|
|
35
35
|
};
|
|
36
|
-
const confineRoot = opts
|
|
36
|
+
const confineRoot = opts.confineTo !== undefined ? realpathSync(opts.confineTo) : undefined;
|
|
37
37
|
const isFileLike = (entry, p) => entry.isFile() || (entry.isSymbolicLink() && statSync(p).isFile());
|
|
38
38
|
const isDirLike = (entry, p) => entry.isDirectory() || (entry.isSymbolicLink() && statSync(p).isDirectory());
|
|
39
39
|
for (const entry of entries.slice().sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))) {
|
|
@@ -43,10 +43,10 @@ export function loadSkills(dir, opts) {
|
|
|
43
43
|
if (confineRoot !== undefined)
|
|
44
44
|
assertConfined(join(dir, entry.name), confineRoot);
|
|
45
45
|
const raw = readFileSync(join(dir, entry.name), "utf8");
|
|
46
|
-
const
|
|
47
|
-
const parsed = parseSkill(raw, entry.name.replace(/\.md$/, ""), source, logger);
|
|
46
|
+
const file = join(dir, entry.name);
|
|
47
|
+
const parsed = parseSkill(raw, entry.name.replace(/\.md$/, ""), file, opts.source, logger);
|
|
48
48
|
if (parsed !== undefined)
|
|
49
|
-
push(parsed,
|
|
49
|
+
push(parsed, file);
|
|
50
50
|
}
|
|
51
51
|
else if (isDirLike(entry, join(dir, entry.name))) {
|
|
52
52
|
const skillDir = join(dir, entry.name);
|
|
@@ -61,13 +61,13 @@ export function loadSkills(dir, opts) {
|
|
|
61
61
|
}
|
|
62
62
|
if (confineRoot !== undefined)
|
|
63
63
|
assertConfined(join(skillDir, "SKILL.md"), confineRoot);
|
|
64
|
-
const skill = parseSkill(raw, entry.name, join(skillDir, "SKILL.md"), logger);
|
|
64
|
+
const skill = parseSkill(raw, entry.name, join(skillDir, "SKILL.md"), opts.source, logger);
|
|
65
65
|
if (skill === undefined)
|
|
66
66
|
continue;
|
|
67
67
|
const files = collectAttachments(skillDir, "", confineRoot);
|
|
68
68
|
if (files.length > 0)
|
|
69
69
|
skill.spec.files = files;
|
|
70
|
-
if (opts
|
|
70
|
+
if (opts.toolsShareThisFilesystem === true)
|
|
71
71
|
skill.spec.baseDir = resolve(skillDir);
|
|
72
72
|
push(skill, join(skillDir, "SKILL.md"));
|
|
73
73
|
}
|
|
@@ -75,7 +75,7 @@ export function loadSkills(dir, opts) {
|
|
|
75
75
|
return out;
|
|
76
76
|
}
|
|
77
77
|
export function loadDeploymentSkills(config, logger) {
|
|
78
|
-
return loadSkills(config.skillsDir, { toolsShareThisFilesystem:
|
|
78
|
+
return loadSkills(config.skillsDir, { source: "factory", toolsShareThisFilesystem: DEPLOYMENT_SHAPE_PREDICATES.toolsOnThisHost.holds(config), ...(logger !== undefined ? { logger } : {}) });
|
|
79
79
|
}
|
|
80
80
|
function collectAttachments(skillDir, rel, confineRoot) {
|
|
81
81
|
const files = [];
|
|
@@ -100,12 +100,12 @@ function collectAttachments(skillDir, rel, confineRoot) {
|
|
|
100
100
|
}
|
|
101
101
|
return files;
|
|
102
102
|
}
|
|
103
|
-
function parseSkill(raw, fallbackName,
|
|
103
|
+
function parseSkill(raw, fallbackName, file, origin, logger) {
|
|
104
104
|
const fm = parseFrontmatter(raw);
|
|
105
105
|
if (fm.kind === "unclosed") {
|
|
106
106
|
logger.warn("skill_refused", {
|
|
107
107
|
skill: fallbackName,
|
|
108
|
-
source,
|
|
108
|
+
source: file,
|
|
109
109
|
reason: "frontmatter_unclosed",
|
|
110
110
|
note: "the file opens a frontmatter fence (`---`) that is never closed, so its `scenarios` restriction cannot be read — this skill is NOT loaded (it is not demoted to a global skill); close the fence or remove the opening line",
|
|
111
111
|
});
|
|
@@ -119,10 +119,16 @@ function parseSkill(raw, fallbackName, source, logger) {
|
|
|
119
119
|
.split(",")
|
|
120
120
|
.map((s) => s.trim())
|
|
121
121
|
.filter(Boolean);
|
|
122
|
-
return { spec: { name, description, content: body.trim() }, scenarios };
|
|
122
|
+
return { spec: { name, description, content: body.trim() }, scenarios, source: origin };
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
return loaded.filter((k) => k.scenarios.length === 0 || k.scenarios.includes(
|
|
124
|
+
function skillsInScope(loaded, scope) {
|
|
125
|
+
return loaded.filter((k) => k.scenarios.length === 0 || k.scenarios.includes(scope));
|
|
126
|
+
}
|
|
127
|
+
export function skillsForScenario(loaded, scope) {
|
|
128
|
+
return skillsInScope(loaded, scope).map((k) => k.spec);
|
|
129
|
+
}
|
|
130
|
+
export function scenarioSkillEntries(loaded, scope) {
|
|
131
|
+
return skillsInScope(loaded, scope).map((k) => ({ name: k.spec.name, description: k.spec.description, source: k.source }));
|
|
126
132
|
}
|
|
127
133
|
const FRONTMATTER_OPENS_RE = /^---[ \t]*\r?(?:\n|$)/;
|
|
128
134
|
const FRONTMATTER_BLOCK_RE = /^---[ \t]*\r?\n(?:---[ \t]*\r?(?:\n|$)|([\s\S]*?)\r?\n---[ \t]*\r?(?:\n|$))([\s\S]*)$/;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* 🔴 该判断在 core 5.40.0 / 7.15.0 上**逐字仍成立**(亲验):两次收窄动的都是「候选集是谁」,而
|
|
20
20
|
* Agent / Task 四件是 **caller spec 工具**,收窄后照样在候选池里 —— 不开 auto 的理由没有被消解。
|
|
21
21
|
* 我方**从不接线**这个座:全树零 `RunnerDeps.deferMode` 赋值(web-admin 曾有同形近名 `deferModelPlane`,
|
|
22
|
-
* 与本轴无关,已于
|
|
22
|
+
* 与本轴无关,已于 [ref] 波 0 退役)。机器钉见 test/tool-defer.test.ts 的 [ref] 件⑤ 格 —— 这条「零接线」正是本仓
|
|
23
23
|
* 在两个 core 世代之间行为逐字不变的**全部**依据,所以它值一根钉而不只是一句注。
|
|
24
24
|
* - per-tool `ToolSpec.defer:true` 是本 helper 施加的那一位。**7.15.0 起它是一次「进候选集」的声明,
|
|
25
25
|
* 不再是「一定占位」的保证** —— 长尾集单独一只(下面实测 ≈842 字符)远在阈值之下,于是这根旋钮在
|
|
@@ -23,6 +23,7 @@ import type { ServiceConfig } from "./config.js";
|
|
|
23
23
|
import type { OwnerAwareSessionStore } from "./security.js";
|
|
24
24
|
import type { ServiceFileHistoryStore } from "./plugins/store-backend.js";
|
|
25
25
|
import { resolveStreamApprovalGate, type ApprovalFrameFamily } from "./tool-approval.js";
|
|
26
|
+
import { type SyncBlobHistoryStore } from "./session-sync.js";
|
|
26
27
|
import { type WorkspaceSyncCapability } from "./workspace-space.js";
|
|
27
28
|
import type { WorkspaceCacheCapability } from "./workspace-cache.js";
|
|
28
29
|
/** why 闭集:词 → 给运维看的一句义(诊断 / 测试读它;wire 上的拒句由各门自写)。 */
|
|
@@ -31,14 +32,13 @@ export declare const CAPABILITY_FACT_WHY: {
|
|
|
31
32
|
readonly subagent_registry_absent: "the sub-agent steer registry is not wired";
|
|
32
33
|
readonly subagent_output_face_absent: "the background sub-agent output face is not wired";
|
|
33
34
|
readonly task_handle_faces_absent: "the background task-handle output/stop faces are not wired";
|
|
34
|
-
readonly
|
|
35
|
+
readonly session_head_face_absent: "the session store has no by-id head read (sessionStorage.headOf — owner, occupant and leaf of a session row in one read)";
|
|
35
36
|
readonly checkpoint_store_absent: "no durable checkpoint store is wired (DURABLE_APPROVAL)";
|
|
36
37
|
readonly session_audit_absent: "no session audit view is wired (needs a durable session store)";
|
|
37
38
|
readonly session_watch_absent: "the session watch registry is not wired";
|
|
38
|
-
readonly session_leaf_face_absent: "the session store has no leaf-read face (sessionStorage.getLeafId)";
|
|
39
39
|
readonly session_lister_absent: "no session enumerator is wired (session store or run store listSessions)";
|
|
40
40
|
readonly session_fork_face_absent: "the session store has no fork face";
|
|
41
|
-
readonly session_row_faces_absent: "the session store has no session-row faces (
|
|
41
|
+
readonly session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf / patchSessionMeta)";
|
|
42
42
|
readonly session_purge_absent: "no session purge coordinator is wired";
|
|
43
43
|
readonly session_policy_store_absent: "no session policy store is wired";
|
|
44
44
|
readonly store_backend_absent: "no store backend is wired (DB_BACKEND=memory, multi-tenant bare boot, or half-configured SQL)";
|
|
@@ -121,48 +121,50 @@ export declare function taskHandles(d: Pick<Deps, "runStore" | "taskHandleOutput
|
|
|
121
121
|
output: Store<"taskHandleOutput">;
|
|
122
122
|
stop: Store<"taskHandleStop">;
|
|
123
123
|
}>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
/** 会话店按 id 读一行的唯一读口在场(core `headOf`:属主 / 住客 / 叶子一次读;「有没有」与 `session-incarnation.ts` 的 `headReadOf` 同判)。 */
|
|
125
|
+
type HeadReadingSessionStore = WithMethods<OwnerAwareSessionStore, "headOf">;
|
|
126
|
+
/** 会话属主面在场(入站 owner 门的地基;缺它,带会话的门一律 fail-closed)。属主 = `headOf(id)?.owner`。 */
|
|
127
|
+
export declare function sessionOwnership(d: Pick<Deps, "sessionStorage">): Fact<"session_head_face_absent", {
|
|
128
|
+
sessionStorage: HeadReadingSessionStore;
|
|
128
129
|
}>;
|
|
129
|
-
export declare function mcpReconnect(d: Pick<Deps, "runStore" | "sessionStorage">): Fact<"run_store_absent" | "
|
|
130
|
+
export declare function mcpReconnect(d: Pick<Deps, "runStore" | "sessionStorage">): Fact<"run_store_absent" | "session_head_face_absent", {
|
|
130
131
|
runStore: Store<"runStore">;
|
|
131
|
-
sessionStorage:
|
|
132
|
+
sessionStorage: HeadReadingSessionStore;
|
|
132
133
|
}>;
|
|
133
134
|
export declare function sessionAuditView(d: Pick<Deps, "sessionAudit">): Fact<"session_audit_absent", {
|
|
134
135
|
sessionAudit: Store<"sessionAudit">;
|
|
135
136
|
}>;
|
|
136
|
-
|
|
137
|
+
/** 会话 SSE(watch 注册表 ∧ 头读:属主门与叶子都是 `headOf` 的投影)。 */
|
|
138
|
+
export declare function sessionEventStream(d: Pick<Deps, "sessionWatch" | "sessionStorage">): Fact<"session_watch_absent" | "session_head_face_absent", {
|
|
137
139
|
watch: Store<"sessionWatch">;
|
|
138
|
-
sessionStorage:
|
|
140
|
+
sessionStorage: HeadReadingSessionStore;
|
|
139
141
|
}>;
|
|
140
142
|
type SessionLister = NonNullable<OwnerAwareSessionStore["listSessions"]>;
|
|
141
143
|
/** 会话枚举面:session 店的 `listSessions`,否则老形 run 店聚合。见证 = 已绑好宿主的那一只。 */
|
|
142
144
|
export declare function sessionList(d: Pick<Deps, "sessionStorage" | "runStore">): Fact<"session_lister_absent", {
|
|
143
145
|
lister: SessionLister;
|
|
144
146
|
}>;
|
|
145
|
-
export declare function sessionFork(d: Pick<Deps, "sessionStorage">): Fact<"session_fork_face_absent" | "
|
|
146
|
-
sessionStorage: WithMethods<OwnerAwareSessionStore, "
|
|
147
|
+
export declare function sessionFork(d: Pick<Deps, "sessionStorage">): Fact<"session_fork_face_absent" | "session_head_face_absent", {
|
|
148
|
+
sessionStorage: WithMethods<OwnerAwareSessionStore, "headOf" | "fork">;
|
|
147
149
|
}>;
|
|
148
|
-
/** 会话行可写位(`PATCH /v1/sessions/:id`)
|
|
149
|
-
* 三只 durable 店(SQL 双生 / local)都带;内存 dev
|
|
150
|
+
/** 会话行可写位(`PATCH /v1/sessions/:id`):会话店的头读(属主 + 化身一次读 —— 门判属主、写与读回按化身条件)∧ 行写口(写后按同一住客读回)。
|
|
151
|
+
* 三只 durable 店(SQL 双生 / local)都带;内存 dev 店没有行写口 ⇒ 501。
|
|
150
152
|
* 本面**没有**独立能力位(契约附录 B.2c 登记):老 worker 对这一动词答 405,本事实为假的部署答 501。 */
|
|
151
153
|
export declare function sessionPatch(d: Pick<Deps, "sessionStorage">): Fact<"session_row_faces_absent", {
|
|
152
|
-
sessionStorage: WithMethods<OwnerAwareSessionStore, "
|
|
154
|
+
sessionStorage: WithMethods<OwnerAwareSessionStore, "headOf" | "patchSessionMeta">;
|
|
153
155
|
}>;
|
|
154
|
-
export declare function sessionDelete(d: Pick<Deps, "purgeSession" | "sessionStorage">): Fact<"session_purge_absent" | "
|
|
156
|
+
export declare function sessionDelete(d: Pick<Deps, "purgeSession" | "sessionStorage">): Fact<"session_purge_absent" | "session_head_face_absent", {
|
|
155
157
|
purge: Store<"purgeSession">;
|
|
156
|
-
sessionStorage:
|
|
158
|
+
sessionStorage: HeadReadingSessionStore;
|
|
157
159
|
}>;
|
|
158
|
-
export declare function sessionPolicy(d: Pick<Deps, "sessionPolicyStore" | "sessionStorage">): Fact<"session_policy_store_absent" | "
|
|
160
|
+
export declare function sessionPolicy(d: Pick<Deps, "sessionPolicyStore" | "sessionStorage">): Fact<"session_policy_store_absent" | "session_head_face_absent", {
|
|
159
161
|
policyStore: Store<"sessionPolicyStore">;
|
|
160
|
-
sessionStorage:
|
|
162
|
+
sessionStorage: HeadReadingSessionStore;
|
|
161
163
|
}>;
|
|
162
|
-
type SyncSessionStore = WithMethods<OwnerAwareSessionStore, "exportEntries" | "exportEntriesStream" | "beginImportStaging" | "
|
|
164
|
+
type SyncSessionStore = WithMethods<OwnerAwareSessionStore, "exportEntries" | "exportEntriesStream" | "beginImportStaging" | "headOf" | "sessionSummaryOf" | "patchSessionMeta">;
|
|
163
165
|
type SessionSyncWhy = "store_backend_absent" | "file_history_store_absent" | "session_export_absent" | "session_import_staging_absent" | "session_row_faces_absent" | "policy_purge_absent";
|
|
164
166
|
/** 会话对等同步的**对话半族**(manifest / entries / plan / import 两相):后端 ∧ 文件历史店 ∧ 导出两面 ∧ staged 导入面 ∧
|
|
165
|
-
* 会话行三口(
|
|
167
|
+
* 会话行三口(门读头 `headOf` —— 属主 + 化身一次读,属主判门、化身给 identical 短路腿;manifest 带 `title` / `pinned`;导入经唯一写口按导入落定的
|
|
166
168
|
* 那一位住客重放它们)∧ policy 店能清(overwrite-dst 的 commit 要擦目的端旧 policy 行)。
|
|
167
169
|
* 文件历史的 blob 搬运是另一只事实。 */
|
|
168
170
|
export declare function sessionSync(d: Pick<Deps, "backend" | "sessionStorage" | "fileHistoryStore" | "sessionPolicyStore">): Fact<SessionSyncWhy, {
|
|
@@ -170,13 +172,8 @@ export declare function sessionSync(d: Pick<Deps, "backend" | "sessionStorage" |
|
|
|
170
172
|
sessionStorage: SyncSessionStore;
|
|
171
173
|
historyStore: ServiceFileHistoryStore;
|
|
172
174
|
}>;
|
|
173
|
-
/** blob
|
|
174
|
-
|
|
175
|
-
readonly syncBlobFaces: true;
|
|
176
|
-
} & {
|
|
177
|
-
[P in "putBlob" | "getBlob"]-?: NonNullable<ServiceFileHistoryStore[P]>;
|
|
178
|
-
};
|
|
179
|
-
/** 会话同步的**文件历史半族**:对话半族 ∧ 文件历史店有 blob 搬运面(只有 SQL 两只店有)。 */
|
|
175
|
+
/** 会话同步的**文件历史半族**:对话半族 ∧ 文件历史店有 blob 搬运面(只有 SQL 两只店有)。「店有没有 blob 两面」只在 `syncBlobFacesOf` 判一次(marker 门,不做名字探测),
|
|
176
|
+
* blob 取值口 `blobGetterOf` 读的是同一只 —— 本事实为真 ⟺ 取值口通到 `historyStore.getBlob`。 */
|
|
180
177
|
export declare function sessionSyncFileHistory(d: Pick<Deps, "backend" | "sessionStorage" | "fileHistoryStore" | "sessionPolicyStore">): Fact<SessionSyncWhy | "sync_blob_faces_absent", {
|
|
181
178
|
historyStore: SyncBlobHistoryStore;
|
|
182
179
|
}>;
|
|
@@ -205,7 +202,7 @@ export declare function streamApproval(d: Pick<Deps, "toolApproval" | "config" |
|
|
|
205
202
|
* 读根授权(「Yes, and add directory」)这台部署**受理不受理** —— `GET /v1/capabilities` 的 `approvalReadRootGrant` 位,与
|
|
206
203
|
* `POST /v1/tool-approvals/:id/respond` 对应答体 `readRootGrant` 的受理门**读同一只**(位说不受理而口照收,就是「位说 X、行为不是 X」)。
|
|
207
204
|
*
|
|
208
|
-
* 判据 =
|
|
205
|
+
* 判据 = 部署形表行 `callerOwnsWorkerDisk`(手在本 worker 盘上 ∧ 单主;与调用方附加目录同一条信任边界):授权把一个**宿主目录**加进本 run 的读目录,
|
|
209
206
|
* 只有「这台机器一个可信主人」的姿态才有这个授权的语义;多租户与云上 / 容器车道的读面另有归宿(沙箱内的读面档位见 `READ_FACE`)。
|
|
210
207
|
* 消费方的选项可见条件是**合取**:卡上有 `readRootCandidate`(逐卡位,引擎铸)∧ 本位为真。位缺席 = 老 server(不受理)。
|
|
211
208
|
* 没有别的端点按本位判可用与否 —— 它只管应答体里的这一键。
|
|
@@ -220,7 +217,7 @@ export declare function readRootGrant(d: Pick<Deps, "config">): Fact<"read_root_
|
|
|
220
217
|
* · 活卡协调器缺席 ⇒ `[]`(没有审批卡可呈)。
|
|
221
218
|
* 对 why 闭集穷举:`streamApproval` 的拒因多一个 ⇒ 这里编译红,逼着给新拒因定族。三条执行腿选族读的是同一只判据的 `active`,
|
|
222
219
|
* 与本映射的「在场 ⇒ 呈卡族」是同一条规则(真腿对拍钉在 `test/stream-approval-on-e2e.test.ts`)。没有端点按它拒:它是消费方分派帧族的读点,`streamApproval` 的词义不变。
|
|
223
|
-
*
|
|
220
|
+
* [ref]:它也是壳**声明**的依据 —— 一条 run 只在 `settings.approvalFrameFamilies` 含本位那一个族时有活审批通道(三条腿判的是同一只映射
|
|
224
221
|
* `presentedApprovalFrameFamily`);不含 ⇒ 这条腿不呈卡,问当场交无人值守政策口。本位的值不因声明而变。
|
|
225
222
|
*/
|
|
226
223
|
export declare function approvalFrameFamilies(stream: ReturnType<typeof streamApproval>): readonly ApprovalFrameFamily[];
|
|
@@ -341,7 +338,7 @@ export declare function workflowsJournal(d: Pick<Deps, "workflowRunStore" | "wor
|
|
|
341
338
|
* `workspace-space.ts`;`persist` 缺省 `space`,`off` = 每轮新建)。**唯一读法**:能力位 `workspaceSync` 投影它的见证,k8s 适配器工厂(`boot/execution-env.ts`)把同一份
|
|
342
339
|
* 见证交给适配器(适配器自己不再解析策略)。`persist: "off"` 仍是 available(存储在、没开 —— 缺省或运维显式 off)—— 与缺席不同义。
|
|
343
340
|
*
|
|
344
|
-
* **为何只读配置仍恒真**:`space` 的空间按会话住客分区、按 run 店的一行提交 —— 住客只有一只按 id 读(会话店的 `
|
|
341
|
+
* **为何只读配置仍恒真**:`space` 的空间按会话住客分区、按 run 店的一行提交 —— 住客只有一只按 id 读(会话店的 `headOf`,
|
|
345
342
|
* 会话行上的那一格),行住在存储后端里。缺一的组合在起服时就被拒(`boot/execution-env.ts` 的 `assertWorkspaceSpaceReadable`,装配第 5 段,
|
|
346
343
|
* 读的正是本事实的见证)⇒ 凡是起得来、报 `space` 的部署都读得出住客、写得下行,本事实不需要运行期依赖(再加一位 = 同一前提两处判)。
|
|
347
344
|
* 剩下的「这条 run 读不到住客」是逐 run 的读失败(适配器的 `unavailable` 臂,响亮一行),不是部署形。
|