@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,12 +2,13 @@ import { once } from "node:events";
|
|
|
2
2
|
import { randomBytes, createHash } from "node:crypto";
|
|
3
3
|
import { sessionLogDigest, sessionLogDigestsComparable, StreamingImportValidator, validateFileHistoryExport } from "@sema-agent/core";
|
|
4
4
|
import { StringDecoder } from "node:string_decoder";
|
|
5
|
-
import { exportSessionManifest, fileHistoryImportFace, replayFileHistory, replayPolicyRecords, wipeSessionAttendants } from "../../session-sync.js";
|
|
5
|
+
import { FileHistoryUnreadableError, blobGetterOf, exportSessionManifest, exportedFileHistory, fileHistoryImportFace, replayFileHistory, replayPolicyRecords, wipeSessionAttendants } from "../../session-sync.js";
|
|
6
6
|
import * as facts from "../../capability-facts.js";
|
|
7
7
|
import { classifySyncRelationshipByIds, SyncConflictError } from "../../session-sync-kernel.js";
|
|
8
8
|
import { isUuidShape, legacyUnownedSessionOk, sessionOwnerCellOf } from "../../security.js";
|
|
9
9
|
import { sendJson, sendError, sendSessionError, sendSessionPolicyError, logRequestError, msg } from "../send.js";
|
|
10
10
|
import { buildDisplaySafeUrl } from "../../trace/redact.js";
|
|
11
|
+
import { storeFaultClassOf } from "../../plugins/store-fault.js";
|
|
11
12
|
import { fleetViewOf, gatedPrincipal, explicitOperatorOk, sendUnauthorized, sessionCallerOf } from "../principal-gate.js";
|
|
12
13
|
const SYNC_BLOB_MAX_BYTES = 64 * 1024 * 1024;
|
|
13
14
|
const SYNC_NDJSON_LINE_MAX_BYTES = 8 * 1024 * 1024;
|
|
@@ -16,6 +17,7 @@ import { SHA256_HEX_RE } from "../../digest-form.js";
|
|
|
16
17
|
import { assertNever, SESSION_NOT_FOUND_MESSAGE } from "../route-ctx.js";
|
|
17
18
|
import { readSessionRulesRecords, describeSessionRulesRecordProblem } from "../../session-policy-wire.js";
|
|
18
19
|
import { readSessionPinned, readSessionTitle } from "../../session-row.js";
|
|
20
|
+
import { sessionFaceOfHead } from "../../session-incarnation.js";
|
|
19
21
|
export function createSessionSyncLocal() {
|
|
20
22
|
const pendingStagings = new Map();
|
|
21
23
|
const importLeases = new Map();
|
|
@@ -55,8 +57,8 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
55
57
|
return;
|
|
56
58
|
}
|
|
57
59
|
const judgeSessionGate = async () => {
|
|
58
|
-
const face = await sessionStorage.
|
|
59
|
-
const mayTouch = face !== undefined && (scope.fleetWide || face.owner === scope.gateOwner || legacyUnownedSessionOk(deps.config
|
|
60
|
+
const face = sessionFaceOfHead(sessionId, await sessionStorage.headOf(sessionId));
|
|
61
|
+
const mayTouch = face !== undefined && (scope.fleetWide || face.owner === scope.gateOwner || legacyUnownedSessionOk(deps.config, sessionCallerOf(req, deps), await sessionOwnerCellOf(sessionStorage, sessionId, face.owner)));
|
|
60
62
|
return { face, mayPull: mayTouch, mayPush: face === undefined || mayTouch };
|
|
61
63
|
};
|
|
62
64
|
const gate = await judgeSessionGate();
|
|
@@ -82,6 +84,11 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
82
84
|
return true;
|
|
83
85
|
return face !== undefined && (await sessionStorage.patchSessionMeta(sessionId, row, face)) !== undefined;
|
|
84
86
|
};
|
|
87
|
+
const canReplayHistory = fileHistoryImportFace(historyStore) !== undefined;
|
|
88
|
+
const replayHistory = async (envelope, allowReplace) => {
|
|
89
|
+
const r = await replayFileHistory(historyStore, sessionId, envelope, blobGetterOf(historyStore), { allowReplace });
|
|
90
|
+
return r.ok ? undefined : r;
|
|
91
|
+
};
|
|
85
92
|
if (match.decl.id === "session-sync-manifest") {
|
|
86
93
|
if (!pullGateOk())
|
|
87
94
|
return;
|
|
@@ -90,7 +97,7 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
90
97
|
out = await exportSessionManifest(sessionId, backend, historyStore);
|
|
91
98
|
}
|
|
92
99
|
catch (e) {
|
|
93
|
-
if (sendSessionPolicyError(res, e))
|
|
100
|
+
if (sendSessionPolicyError(res, e) || sendPullUnreadable(req, res, deps.logger, e))
|
|
94
101
|
return;
|
|
95
102
|
throw e;
|
|
96
103
|
}
|
|
@@ -114,7 +121,15 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
114
121
|
}
|
|
115
122
|
afterSeq = n;
|
|
116
123
|
}
|
|
117
|
-
|
|
124
|
+
let it;
|
|
125
|
+
try {
|
|
126
|
+
it = await sessionStorage.exportEntriesStream(sessionId, afterSeq === undefined ? undefined : { afterSeq });
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
if (sendPullUnreadable(req, res, deps.logger, e))
|
|
130
|
+
return;
|
|
131
|
+
throw e;
|
|
132
|
+
}
|
|
118
133
|
if (it === null) {
|
|
119
134
|
sendSessionAbsent();
|
|
120
135
|
return;
|
|
@@ -156,13 +171,29 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
156
171
|
return;
|
|
157
172
|
}
|
|
158
173
|
const fs = blobs.historyStore;
|
|
159
|
-
|
|
160
|
-
|
|
174
|
+
let envelope;
|
|
175
|
+
try {
|
|
176
|
+
envelope = await exportedFileHistory(fs, sessionId);
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
if (sendPullUnreadable(req, res, deps.logger, e))
|
|
180
|
+
return;
|
|
181
|
+
throw e;
|
|
182
|
+
}
|
|
183
|
+
const referenced = envelope !== null && envelope.tracked.some((t) => t.versions.some((v) => v.blobHash === hash));
|
|
161
184
|
if (!referenced) {
|
|
162
185
|
sendError(res, 404, "not_found.blob", "blob not found");
|
|
163
186
|
return;
|
|
164
187
|
}
|
|
165
|
-
|
|
188
|
+
let bytes;
|
|
189
|
+
try {
|
|
190
|
+
bytes = await fs.getBlob(hash);
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
if (sendPullUnreadable(req, res, deps.logger, e))
|
|
194
|
+
return;
|
|
195
|
+
throw e;
|
|
196
|
+
}
|
|
166
197
|
if (!bytes) {
|
|
167
198
|
sendError(res, 404, "not_found.blob", "blob not found");
|
|
168
199
|
return;
|
|
@@ -275,6 +306,17 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
275
306
|
sendError(res, 409, "conflict", "sync conflict", { relation: relA });
|
|
276
307
|
return;
|
|
277
308
|
}
|
|
309
|
+
if (fileHistory !== null) {
|
|
310
|
+
const distinct = new Set();
|
|
311
|
+
for (const t of fileHistory.tracked)
|
|
312
|
+
for (const v of t.versions)
|
|
313
|
+
if (v.blobHash !== null)
|
|
314
|
+
distinct.add(v.blobHash);
|
|
315
|
+
if (await firstMissingBlob(facts.sessionSyncFileHistory(deps), [...distinct]) !== undefined) {
|
|
316
|
+
sendMissingBlob(res);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
278
320
|
let payloadVerified = false;
|
|
279
321
|
let digestSaysDiffer = false;
|
|
280
322
|
if (relA.relation === "identical" && srcLogDigest !== undefined) {
|
|
@@ -290,8 +332,7 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
290
332
|
digestSaysDiffer = true;
|
|
291
333
|
}
|
|
292
334
|
if (relA.relation === "identical" && !digestSaysDiffer) {
|
|
293
|
-
|
|
294
|
-
if (fileHistory !== null && blobFaces.available && fileHistoryImportFace(blobFaces.historyStore)) {
|
|
335
|
+
if (fileHistory !== null && canReplayHistory) {
|
|
295
336
|
if (resolution === "overwrite-dst") {
|
|
296
337
|
const activeNow = await deps.runStore?.getActiveTaskId(sessionId);
|
|
297
338
|
if (activeNow) {
|
|
@@ -299,11 +340,9 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
299
340
|
return;
|
|
300
341
|
}
|
|
301
342
|
}
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
if (!r.ok) {
|
|
306
|
-
sendError(res, 422, failCode, `file history import failed (${r.error.code})`);
|
|
343
|
+
const failed = await replayHistory(fileHistory, resolution === "overwrite-dst");
|
|
344
|
+
if (failed !== undefined) {
|
|
345
|
+
sendFileHistoryReplayFailure(res, failed);
|
|
307
346
|
return;
|
|
308
347
|
}
|
|
309
348
|
}
|
|
@@ -356,31 +395,6 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
356
395
|
return;
|
|
357
396
|
}
|
|
358
397
|
}
|
|
359
|
-
const fss = historyStore;
|
|
360
|
-
if (fileHistory !== null && fileHistoryImportFace(fss) !== undefined) {
|
|
361
|
-
const distinct = new Set();
|
|
362
|
-
for (const t of fileHistory.tracked)
|
|
363
|
-
for (const v of t.versions)
|
|
364
|
-
if (v.blobHash !== null)
|
|
365
|
-
distinct.add(v.blobHash);
|
|
366
|
-
const all = [...distinct];
|
|
367
|
-
if (typeof fss.hasBlobs === "function") {
|
|
368
|
-
const present = await fss.hasBlobs(all);
|
|
369
|
-
const missing = all.find((h) => !present.has(h));
|
|
370
|
-
if (missing !== undefined) {
|
|
371
|
-
sendError(res, 422, "missing_blob", "missing blob; PUT all referenced blobs before import");
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
else if (typeof fss.getBlob === "function") {
|
|
376
|
-
for (const hash of all) {
|
|
377
|
-
if (!(await fss.getBlob(hash))) {
|
|
378
|
-
sendError(res, 422, "missing_blob", "missing blob; PUT all referenced blobs before import");
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
398
|
const importingPrincipal = scope.fleetWide ? (owner ?? null) : scope.gateOwner;
|
|
385
399
|
const operatorOk = explicitOperatorOk(gatedPrincipal(req, deps.config), deps.config);
|
|
386
400
|
const token = randomBytes(8).toString("hex");
|
|
@@ -409,7 +423,6 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
409
423
|
sendError(res, 404, "not_found.staging", "staging not found");
|
|
410
424
|
return;
|
|
411
425
|
}
|
|
412
|
-
const getBlob = (h) => historyStore.getBlob ? historyStore.getBlob(h) : Promise.resolve(undefined);
|
|
413
426
|
const validator = new StreamingImportValidator();
|
|
414
427
|
let lineBuf = "";
|
|
415
428
|
let pendingBatch = [];
|
|
@@ -515,11 +528,10 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
515
528
|
if (pending.resolution === "overwrite-dst" && (committed.relation === "fork" || committed.relation === "stale")) {
|
|
516
529
|
await wipeSessionAttendants({ fileHistoryStore: historyStore, sessionPolicyStore: deps.sessionPolicyStore, resumeAnchorStore: deps.resumeAnchorStore }, sessionId);
|
|
517
530
|
}
|
|
518
|
-
if (pending.fileHistory !== null &&
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
sendError(res, 422, failCode, `file history import failed (${r.error.code})`);
|
|
531
|
+
if (pending.fileHistory !== null && canReplayHistory) {
|
|
532
|
+
const failed = await replayHistory(pending.fileHistory, pending.resolution === "overwrite-dst");
|
|
533
|
+
if (failed !== undefined) {
|
|
534
|
+
sendFileHistoryReplayFailure(res, failed);
|
|
523
535
|
cleanupStaging(stagingId);
|
|
524
536
|
return;
|
|
525
537
|
}
|
|
@@ -574,6 +586,45 @@ export async function handleSessionSync(req, res, match, ctx) {
|
|
|
574
586
|
}
|
|
575
587
|
}
|
|
576
588
|
}
|
|
589
|
+
function sendPullUnreadable(req, res, logger, e) {
|
|
590
|
+
if (e instanceof FileHistoryUnreadableError) {
|
|
591
|
+
const permanence = e.failure.permanence;
|
|
592
|
+
const advice = permanence === "transient" ? "the history store judged the fault transient: retry later" : permanence === "terminal" ? "the history store judged the fault permanent: retrying will not help until the store is repaired" : "the history store did not judge whether retrying can help";
|
|
593
|
+
sendError(res, 503, "state.file_history_unreadable", `this session's file history cannot be read whole (${e.failure.code}), so nothing was exported — ${advice}`, permanence === undefined ? undefined : { permanence });
|
|
594
|
+
return true;
|
|
595
|
+
}
|
|
596
|
+
if (storeFaultClassOf(e) !== "connection")
|
|
597
|
+
return false;
|
|
598
|
+
logRequestError(logger, req, e);
|
|
599
|
+
sendError(res, 503, "state.file_history_unreadable", "this session's stored state could not be read right now (the store connection failed), so nothing was exported — retry later", { permanence: "transient" });
|
|
600
|
+
return true;
|
|
601
|
+
}
|
|
602
|
+
function sendMissingBlob(res) {
|
|
603
|
+
sendError(res, 422, "missing_blob", "missing blob; PUT all referenced blobs before import");
|
|
604
|
+
}
|
|
605
|
+
function sendFileHistoryReplayFailure(res, failure) {
|
|
606
|
+
if (failure.missingBlob !== undefined) {
|
|
607
|
+
sendMissingBlob(res);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
const { code, permanence } = failure.error;
|
|
611
|
+
sendError(res, 422, code, `file history import failed (${code})`, permanence === undefined ? undefined : { permanence });
|
|
612
|
+
}
|
|
613
|
+
async function firstMissingBlob(blobFaces, referenced) {
|
|
614
|
+
if (referenced.length === 0)
|
|
615
|
+
return undefined;
|
|
616
|
+
if (!blobFaces.available)
|
|
617
|
+
return referenced[0];
|
|
618
|
+
const store = blobFaces.historyStore;
|
|
619
|
+
if (typeof store.hasBlobs === "function") {
|
|
620
|
+
const present = await store.hasBlobs([...referenced]);
|
|
621
|
+
return referenced.find((h) => !present.has(h));
|
|
622
|
+
}
|
|
623
|
+
for (const hash of referenced)
|
|
624
|
+
if (!(await store.getBlob(hash)))
|
|
625
|
+
return hash;
|
|
626
|
+
return undefined;
|
|
627
|
+
}
|
|
577
628
|
function sendSessionSyncUnavailable(res, why) {
|
|
578
629
|
switch (why) {
|
|
579
630
|
case "store_backend_absent":
|
|
@@ -20,7 +20,7 @@ export async function handleSessionsList(req, res, match, ctx) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const lister = listing.lister;
|
|
23
|
-
const includeUnowned = !fleetWide && legacyUnownedAmnestyOpen(deps.config
|
|
23
|
+
const includeUnowned = !fleetWide && legacyUnownedAmnestyOpen(deps.config, gateOwner);
|
|
24
24
|
await handleSessionList(res, lister, new URLSearchParams(match.search), gateOwner, includeUnowned);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -10,6 +10,7 @@ import { MAX_SETTINGS_OUTPUT_STYLE_CHARS, MAX_SETTINGS_ENV_VARS, MAX_SETTINGS_EN
|
|
|
10
10
|
import { readWritableSessionPermissionRules } from "../../session-policy-wire.js";
|
|
11
11
|
import { sendJson, sendError, sendSessionError, sendSessionPolicyError, sseHeaders, httpErrorBody } from "../send.js";
|
|
12
12
|
import { fleetViewOf, gatedPrincipal, explicitOperatorOk, sessionCallerOf, sessionOwnerReadable, sendPrincipalRefusal, sendUnauthorized } from "../principal-gate.js";
|
|
13
|
+
import { headReadOf, leafOfAdmittedHead, sessionFaceOfHead } from "../../session-incarnation.js";
|
|
13
14
|
import { runRowReadableOnSessionFace } from "../owner-access.js";
|
|
14
15
|
import { assertNever, SESSION_NOT_FOUND_MESSAGE } from "../route-ctx.js";
|
|
15
16
|
import * as facts from "../../capability-facts.js";
|
|
@@ -73,9 +74,9 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
73
74
|
const { deps } = ctx;
|
|
74
75
|
const { readJson, safeDecode, sessionOwnerOk } = ctx.helpers;
|
|
75
76
|
const readOwnedSessionView = async (sessionAudit, sessionId, readOpts) => {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const owner = await
|
|
77
|
+
const headOf = headReadOf(deps.sessionStorage);
|
|
78
|
+
if (headOf !== undefined) {
|
|
79
|
+
const owner = (await headOf(sessionId))?.owner;
|
|
79
80
|
if (owner === undefined) {
|
|
80
81
|
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
81
82
|
return undefined;
|
|
@@ -88,7 +89,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
88
89
|
audit = await sessionAudit(sessionId, readOpts);
|
|
89
90
|
}
|
|
90
91
|
catch (e) {
|
|
91
|
-
if (
|
|
92
|
+
if (headOf !== undefined)
|
|
92
93
|
throw e;
|
|
93
94
|
throw new Error(`session view read failed before ownership could be established: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
94
95
|
}
|
|
@@ -168,9 +169,11 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
168
169
|
if (mcpStatusCache.size > 1024)
|
|
169
170
|
mcpStatusCache.clear();
|
|
170
171
|
const panel = (async () => {
|
|
171
|
-
const
|
|
172
|
+
const stopDial = new AbortController();
|
|
173
|
+
const matP = materializeMcpTools(specs, principal, undefined, undefined, undefined, deps.mcpRevocations, undefined, undefined, undefined, stopDial.signal);
|
|
172
174
|
const mat = await raceDeadline(matP, MCP_DIAL_DEADLINE_MS).catch(() => null);
|
|
173
175
|
if (!mat) {
|
|
176
|
+
stopDial.abort();
|
|
174
177
|
void matP.then((m) => m?.dispose().catch(() => undefined)).catch(() => undefined);
|
|
175
178
|
return { servers: [], asOf: new Date().toISOString(), degraded: true };
|
|
176
179
|
}
|
|
@@ -187,7 +190,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
187
190
|
};
|
|
188
191
|
}
|
|
189
192
|
finally {
|
|
190
|
-
|
|
193
|
+
void mat.dispose().catch(() => undefined);
|
|
191
194
|
}
|
|
192
195
|
})();
|
|
193
196
|
mcpStatusCache.set(cacheKey, { at: Date.now(), panel });
|
|
@@ -252,9 +255,8 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
252
255
|
}
|
|
253
256
|
{
|
|
254
257
|
if (match.decl.id === "session-head") {
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
if (!getLeafId || !ownerOf) {
|
|
258
|
+
const headOf = headReadOf(deps.sessionStorage);
|
|
259
|
+
if (!headOf) {
|
|
258
260
|
sendError(res, 501, "capability.session_store_required", "session head probe requires a durable session store (DB_BACKEND=mysql|pg|local)");
|
|
259
261
|
return;
|
|
260
262
|
}
|
|
@@ -263,30 +265,14 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
263
265
|
sendError(res, 400, "request.path_malformed", "session id segment is not valid percent-encoding");
|
|
264
266
|
return;
|
|
265
267
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
const head = await getHead(headSession);
|
|
271
|
-
if (head === undefined) {
|
|
272
|
-
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
owner = head.owner;
|
|
276
|
-
if (!sessionOwnerOk(req, res, await sessionOwnerCellOf(deps.sessionStorage, headSession, owner ?? null)))
|
|
277
|
-
return;
|
|
278
|
-
leafId = head.leafId;
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
owner = await ownerOf(headSession);
|
|
282
|
-
if (owner === undefined) {
|
|
283
|
-
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (!sessionOwnerOk(req, res, await sessionOwnerCellOf(deps.sessionStorage, headSession, owner ?? null)))
|
|
287
|
-
return;
|
|
288
|
-
leafId = await getLeafId(headSession);
|
|
268
|
+
const head = await headOf(headSession);
|
|
269
|
+
if (head === undefined) {
|
|
270
|
+
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
271
|
+
return;
|
|
289
272
|
}
|
|
273
|
+
if (!sessionOwnerOk(req, res, await sessionOwnerCellOf(deps.sessionStorage, headSession, head.owner)))
|
|
274
|
+
return;
|
|
275
|
+
const leafId = leafOfAdmittedHead(head);
|
|
290
276
|
const etag = `"${leafId ?? "empty"}"`;
|
|
291
277
|
if (req.headers["if-none-match"] === etag) {
|
|
292
278
|
res.writeHead(304, { etag }).end();
|
|
@@ -304,7 +290,8 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
304
290
|
sendError(res, 501, "capability.session_store_required", "session events require a durable session store (DB_BACKEND=mysql|pg|local)");
|
|
305
291
|
return;
|
|
306
292
|
}
|
|
307
|
-
const
|
|
293
|
+
const readHead = (id) => evFact.sessionStorage.headOf(id);
|
|
294
|
+
const readOwner = async (id) => (await readHead(id))?.owner;
|
|
308
295
|
const watch = evFact.watch;
|
|
309
296
|
const evSession = safeDecode(match.params.sessionId);
|
|
310
297
|
if (evSession === null) {
|
|
@@ -340,13 +327,13 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
340
327
|
return;
|
|
341
328
|
}
|
|
342
329
|
sse.sseOwnerLookups++;
|
|
343
|
-
const
|
|
344
|
-
void
|
|
330
|
+
const admissionP = readHead(evSession).then(async (head) => (head === undefined ? undefined : { head, cell: await sessionOwnerCellOf(evFact.sessionStorage, evSession, head.owner) }));
|
|
331
|
+
void admissionP.catch(() => undefined).then(() => { sse.sseOwnerLookups--; });
|
|
345
332
|
let stallTimer;
|
|
346
|
-
let
|
|
333
|
+
let admission;
|
|
347
334
|
try {
|
|
348
|
-
|
|
349
|
-
|
|
335
|
+
admission = await Promise.race([
|
|
336
|
+
admissionP,
|
|
350
337
|
new Promise((r) => { stallTimer = setTimeout(() => r("__stall__"), stallBound); stallTimer.unref?.(); }),
|
|
351
338
|
]);
|
|
352
339
|
}
|
|
@@ -356,22 +343,23 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
356
343
|
}
|
|
357
344
|
if (closed)
|
|
358
345
|
return;
|
|
359
|
-
if (
|
|
346
|
+
if (admission === "__stall__") {
|
|
360
347
|
cleanup();
|
|
361
348
|
res.setHeader("retry-after", "5");
|
|
362
349
|
sendError(res, 503, "state.sse_owner_lookup_stalled", "session-events owner lookup stalled — retry");
|
|
363
350
|
return;
|
|
364
351
|
}
|
|
365
|
-
if (
|
|
352
|
+
if (admission === undefined) {
|
|
366
353
|
cleanup();
|
|
367
354
|
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
368
355
|
return;
|
|
369
356
|
}
|
|
370
|
-
if (!sessionOwnerOk(req, res, cell)) {
|
|
357
|
+
if (!sessionOwnerOk(req, res, admission.cell)) {
|
|
371
358
|
cleanup();
|
|
372
359
|
return;
|
|
373
360
|
}
|
|
374
|
-
|
|
361
|
+
leafOfAdmittedHead(admission.head);
|
|
362
|
+
const owner = admission.cell.owner;
|
|
375
363
|
const q = new URLSearchParams(match.search);
|
|
376
364
|
const lastLeafId = q.get("lastLeafId");
|
|
377
365
|
let first = true;
|
|
@@ -470,7 +458,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
470
458
|
}
|
|
471
459
|
ownerCheckPending = true;
|
|
472
460
|
ownerCheckStartedAt = Date.now();
|
|
473
|
-
void
|
|
461
|
+
void readOwner(evSession).then((o) => {
|
|
474
462
|
ownerCheckPending = false;
|
|
475
463
|
if (!closed && o !== owner)
|
|
476
464
|
onEnd();
|
|
@@ -670,13 +658,15 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
670
658
|
}
|
|
671
659
|
const store = rowFact.sessionStorage;
|
|
672
660
|
const sessionId = match.params.sessionId;
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
661
|
+
const head = await store.headOf(sessionId);
|
|
662
|
+
if (head === undefined) {
|
|
675
663
|
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
676
664
|
return;
|
|
677
665
|
}
|
|
666
|
+
const face = sessionFaceOfHead(sessionId, head);
|
|
678
667
|
if (!sessionOwnerOk(req, res, await sessionOwnerCellOf(store, sessionId, face.owner)))
|
|
679
668
|
return;
|
|
669
|
+
leafOfAdmittedHead(head);
|
|
680
670
|
const read = readSessionRowPatch(await readJson(req));
|
|
681
671
|
if ("problem" in read) {
|
|
682
672
|
sendError(res, 400, read.problem.code, read.problem.message);
|
|
@@ -698,7 +688,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
698
688
|
return;
|
|
699
689
|
}
|
|
700
690
|
const fork = forkFact.sessionStorage.fork.bind(forkFact.sessionStorage);
|
|
701
|
-
const
|
|
691
|
+
const readOwner = async (id) => (await forkFact.sessionStorage.headOf(id))?.owner;
|
|
702
692
|
const scope = fleetViewOf(req, deps, "write");
|
|
703
693
|
if (!scope.fleetWide && scope.gateOwner === null) {
|
|
704
694
|
sendUnauthorized(res, "identity");
|
|
@@ -709,12 +699,12 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
709
699
|
sendError(res, 400, "request.id_invalid", "invalid session id (must be a canonical uuid)");
|
|
710
700
|
return;
|
|
711
701
|
}
|
|
712
|
-
const owner = await
|
|
702
|
+
const owner = await readOwner(sourceId);
|
|
713
703
|
if (owner === undefined) {
|
|
714
704
|
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
715
705
|
return;
|
|
716
706
|
}
|
|
717
|
-
if (!scope.fleetWide && owner !== scope.gateOwner && !legacyUnownedSessionOk(deps.config
|
|
707
|
+
if (!scope.fleetWide && owner !== scope.gateOwner && !legacyUnownedSessionOk(deps.config, sessionCallerOf(req, deps), await sessionOwnerCellOf(forkFact.sessionStorage, sourceId, owner))) {
|
|
718
708
|
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
719
709
|
return;
|
|
720
710
|
}
|
|
@@ -736,7 +726,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
736
726
|
return;
|
|
737
727
|
}
|
|
738
728
|
const purge = deleteFact.purge;
|
|
739
|
-
const
|
|
729
|
+
const readOwner = async (id) => (await deleteFact.sessionStorage.headOf(id))?.owner;
|
|
740
730
|
const scope = fleetViewOf(req, deps, "write");
|
|
741
731
|
if (!scope.fleetWide && scope.gateOwner === null) {
|
|
742
732
|
sendUnauthorized(res, "identity");
|
|
@@ -747,12 +737,12 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
747
737
|
sendError(res, 400, "request.id_invalid", "invalid session id (must be a canonical uuid)");
|
|
748
738
|
return;
|
|
749
739
|
}
|
|
750
|
-
const owner = await
|
|
740
|
+
const owner = await readOwner(sessionId);
|
|
751
741
|
if (owner === undefined) {
|
|
752
742
|
sendJson(res, 200, { deleted: false });
|
|
753
743
|
return;
|
|
754
744
|
}
|
|
755
|
-
if (!scope.fleetWide && owner !== scope.gateOwner && !legacyUnownedSessionOk(deps.config
|
|
745
|
+
if (!scope.fleetWide && owner !== scope.gateOwner && !legacyUnownedSessionOk(deps.config, sessionCallerOf(req, deps), await sessionOwnerCellOf(deleteFact.sessionStorage, sessionId, owner))) {
|
|
756
746
|
sendJson(res, 200, { deleted: false });
|
|
757
747
|
return;
|
|
758
748
|
}
|
|
@@ -782,7 +772,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
782
772
|
return;
|
|
783
773
|
}
|
|
784
774
|
const store = policyFact.policyStore;
|
|
785
|
-
const
|
|
775
|
+
const readOwner = async (id) => (await policyFact.sessionStorage.headOf(id))?.owner;
|
|
786
776
|
const principal = gatedPrincipal(req, deps.config);
|
|
787
777
|
if (deps.config.requirePrincipal && principal === undefined) {
|
|
788
778
|
sendUnauthorized(res, "identity");
|
|
@@ -793,7 +783,7 @@ export async function handleSessions(req, res, match, ctx) {
|
|
|
793
783
|
sendError(res, 400, "request.id_invalid", "invalid session id (must be a canonical uuid)");
|
|
794
784
|
return;
|
|
795
785
|
}
|
|
796
|
-
const owner = await
|
|
786
|
+
const owner = await readOwner(sessionId);
|
|
797
787
|
if (owner === undefined) {
|
|
798
788
|
sendError(res, 404, "not_found.session", SESSION_NOT_FOUND_MESSAGE);
|
|
799
789
|
return;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* · `runSyncSubmitLeg` —— 同步腿(原 128 行匿名体);
|
|
13
13
|
* · 同步腿内 `verifyLeg` / `cascadeLeg` / `plainLeg` —— 三条模型驱动腿,判别顺序与短路语义逐字不变。
|
|
14
14
|
* 提名**只改名字不改行为**:闭包捕获的自由变量、语句顺序、settle/registry 生命周期注释全部随代码原样迁移。
|
|
15
|
-
* (
|
|
15
|
+
* ([ref] 起「这次是不是被 server 中止、为什么」读每腿自己的中止句柄 `RunAbort`,不再有按 taskId 键控的
|
|
16
16
|
* `cancelledViaVerb` 旁表与它「身份守卫内先取后删」的取值时点。)
|
|
17
17
|
*
|
|
18
18
|
* 与 runs 域共用 `ctx.legs.prepareSpec`(读体/校验/建 spec 的同一条前段)。
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* ⚠️ 三块都跑在全局 service-credential 门**之前**(与 /metrics 同款待遇)——只读 traceToken 单凭据的调用方
|
|
8
8
|
* (registry 中继的姿势)在全局门会被 401,挂门后=门内 traceToken 支持成死代码(1.148 a2 实机抓获)。
|
|
9
|
-
*
|
|
9
|
+
* [ref](7.105.0):门前不等于不设防 —— 本域坐在读路谓词段,先过 `dispatch.ts` 的 `readCredentialOk`
|
|
10
10
|
* (部署配了 service 凭据时要「service token / traceToken / 已验 principal」之一),块内这几道门在它之后。
|
|
11
11
|
* 因此本域在 `handle()` 里的位置就是契约的一部分:必须留在鉴权门上方,顺序不可与其他域对调。本域零可变状态。
|
|
12
12
|
*/
|
|
@@ -175,6 +175,9 @@ export declare const WORKFLOW_RUN_DISPOSITIONS: {
|
|
|
175
175
|
readonly id: "forward";
|
|
176
176
|
readonly scope: "forward";
|
|
177
177
|
readonly status: "forward";
|
|
178
|
+
readonly parked: {
|
|
179
|
+
readonly mint: (run: WorkflowRun) => true | undefined;
|
|
180
|
+
};
|
|
178
181
|
readonly name: {
|
|
179
182
|
readonly redact: "redactSecrets";
|
|
180
183
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { persistedPlaneOf } from "../../terminal.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { getWorkflowRun, subscribeWorkflow, deriveAgentDisplayStatus, callKeyOrdinal } from "@sema-agent/core";
|
|
3
|
+
import { getWorkflowRun, subscribeWorkflow, deriveAgentDisplayStatus, callKeyOrdinal, runParkedOf, JOURNAL_INCOMPATIBLE_ERROR_CODE, WorkflowJournalIncompatibleError } from "@sema-agent/core";
|
|
4
4
|
import { redactSteerIn, STEER_IN_MAX_CHARS, STEER_IN_MAX_REQUEST_CHARS } from "../../orchestration/workflow-agent-steer.js";
|
|
5
|
-
import {
|
|
6
|
-
import { decodeJsonColumn } from "../../plugins/sql-json-column.js";
|
|
5
|
+
import { journalEntryOfCell, journalEntryPayload, journalRowPayloadOf } from "../../plugins/workflow-journal-payload.js";
|
|
7
6
|
import { redactSecrets } from "../../trace/redact.js";
|
|
8
7
|
import { createHash } from "node:crypto";
|
|
9
8
|
import { redactHead } from "../../observability/run-terminal.js";
|
|
@@ -72,8 +71,8 @@ export async function handleWorkflows(req, res, match, ctx) {
|
|
|
72
71
|
if (journalStore === undefined)
|
|
73
72
|
throw new Error("workflow-journal reached without the workflowsJournal journal witness");
|
|
74
73
|
const jq = new URLSearchParams(match.search);
|
|
75
|
-
const jLimit = Math.min(50, Math.max(1, Number(jq.get("limit") ?? 20) || 20));
|
|
76
|
-
const jOffset = Math.max(0, Number(jq.get("offset") ?? 0) || 0);
|
|
74
|
+
const jLimit = Math.min(50, Math.max(1, Math.trunc(Number(jq.get("limit") ?? 20)) || 20));
|
|
75
|
+
const jOffset = Math.max(0, Math.trunc(Number(jq.get("offset") ?? 0)) || 0);
|
|
77
76
|
const MAX_ROW_BYTES = 64 * 1024;
|
|
78
77
|
const firstLine = (t) => (t ? redactHead(t.split("\n")[0], 300) : undefined);
|
|
79
78
|
const MAX_RESULT_CHARS = 2000;
|
|
@@ -114,31 +113,34 @@ export async function handleWorkflows(req, res, match, ctx) {
|
|
|
114
113
|
};
|
|
115
114
|
const js = journalStore;
|
|
116
115
|
let projected;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const { payload, parked } = journalEntryPayload(
|
|
116
|
+
try {
|
|
117
|
+
if (js.loadPage) {
|
|
118
|
+
const page = await js.loadPage(wfId, scope, { offset: jOffset, limit: jLimit, maxResultBytes: MAX_ROW_BYTES });
|
|
119
|
+
projected = page.map((row) => {
|
|
120
|
+
if (row.resultJson === null) {
|
|
121
|
+
return oversizeStub(row.callKey, row.resultBytes);
|
|
122
|
+
}
|
|
123
|
+
const { payload, parked } = journalEntryPayload(journalEntryOfCell(wfId, row.callKey, row.resultJson, `workflow_journal.result for entry ${row.callKey}`));
|
|
125
124
|
return projectEntry(row.callKey, payload, parked);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const entries = await journalStore.load(wfId, scope);
|
|
129
|
+
projected = entries
|
|
130
|
+
.sort((a, b) => callKeyOrdinal(a.callKey) - callKeyOrdinal(b.callKey))
|
|
131
|
+
.slice(jOffset, jOffset + jLimit)
|
|
132
|
+
.map((en) => {
|
|
133
|
+
const { payload, parked } = journalEntryPayload(en);
|
|
134
|
+
const bytes = Buffer.byteLength(journalRowPayloadOf(en));
|
|
135
|
+
return bytes > MAX_ROW_BYTES ? oversizeStub(en.callKey, bytes) : projectEntry(en.callKey, payload, parked);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
131
138
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.map((en) => {
|
|
138
|
-
const { payload, parked } = journalEntryPayload(en);
|
|
139
|
-
const bytes = Buffer.byteLength(journalRowPayloadOf(en));
|
|
140
|
-
return bytes > MAX_ROW_BYTES ? oversizeStub(en.callKey, bytes) : projectEntry(en.callKey, payload, parked);
|
|
141
|
-
});
|
|
139
|
+
catch (e) {
|
|
140
|
+
if (!(e instanceof WorkflowJournalIncompatibleError))
|
|
141
|
+
throw e;
|
|
142
|
+
sendError(res, 500, JOURNAL_INCOMPATIBLE_ERROR_CODE, `this run's journal holds a record the engine cannot read (entry #${e.ordinal}): the journal cannot be listed or resumed until that record is repaired from a kept copy — do not delete it (a missing entry makes a resume run that step again)`, { ordinal: e.ordinal });
|
|
143
|
+
return;
|
|
142
144
|
}
|
|
143
145
|
sendJson(res, 200, { runId: wfId, entries: projected, ...(projected.length === jLimit ? { nextOffset: jOffset + jLimit } : {}) });
|
|
144
146
|
return;
|
|
@@ -366,6 +368,7 @@ export const WORKFLOW_RUN_DISPOSITIONS = {
|
|
|
366
368
|
id: "forward",
|
|
367
369
|
scope: "forward",
|
|
368
370
|
status: "forward",
|
|
371
|
+
parked: { mint: (run) => (runParkedOf({ status: run.status, agents: [...rowsOf(run.agents)] }) ? true : undefined) },
|
|
369
372
|
name: { redact: "redactSecrets" },
|
|
370
373
|
description: { redact: "redactSecrets" },
|
|
371
374
|
stats: { nested: WORKFLOW_RUN_STATS_DISPOSITIONS },
|