@sema-agent/server 7.150.0 → 7.152.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 +451 -0
- package/README.md +15 -3
- package/README.zh-CN.md +10 -2
- package/USAGE.md +144 -87
- package/deploy/sema-up/README.md +11 -4
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +5 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +15 -16
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -3
- package/deploy/sema-up/chart/templates/server.yaml +5 -3
- package/deploy/sema-up/chart/values-full-single.yaml +3 -1
- package/deploy/sema-up/chart/values.yaml +8 -1
- package/deploy/sema-up/cluster-up.sh +7 -6
- package/deploy/sema-up/kube-up.sh +6 -6
- package/deploy/sema-up/lib/flagshape.sh +36 -8
- package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
- package/deploy/sema-up/lib/helm-values-kube.py +2 -0
- package/deploy/sema-up/machines.example.yaml +3 -1
- package/deploy/sema-up/sema-up.sh +22 -16
- package/dist/adoption/import.js +3 -3
- package/dist/approval-ask-audit-store.d.ts +1 -1
- package/dist/approval-ask-machine.d.ts +4 -10
- package/dist/approval-ask-retention.d.ts +1 -1
- package/dist/approval-card.d.ts +12 -14
- package/dist/approval-gate-currency.d.ts +9 -9
- package/dist/approval-gate-currency.js +3 -4
- package/dist/approval-hmac.d.ts +17 -1
- package/dist/approval-hmac.js +7 -1
- package/dist/approval-queue-kind.d.ts +1 -1
- package/dist/approval.d.ts +2 -2
- package/dist/approval.js +2 -2
- package/dist/auth-bridge.d.ts +20 -0
- package/dist/auth-bridge.js +9 -0
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.d.ts +4 -2
- package/dist/bind-host.d.ts +3 -6
- package/dist/bind-host.js +4 -7
- package/dist/boot/budget-tracing.js +1 -1
- package/dist/boot/coordinators.d.ts +1 -1
- package/dist/boot/coordinators.js +9 -10
- package/dist/boot/device-lane.js +2 -0
- package/dist/boot/engine-lease.d.ts +5 -0
- package/dist/boot/engine-lease.js +1 -0
- package/dist/boot/execution-env.d.ts +9 -14
- package/dist/boot/execution-env.js +85 -22
- package/dist/boot/execution-lane.js +32 -5
- package/dist/boot/late-binds.d.ts +8 -4
- package/dist/boot/late-binds.js +7 -1
- package/dist/boot/leader.d.ts +31 -30
- package/dist/boot/leader.js +38 -28
- package/dist/boot/leg-path-adjudication.d.ts +40 -0
- package/dist/boot/leg-path-adjudication.js +18 -0
- package/dist/boot/memory-consolidation.d.ts +3 -2
- package/dist/boot/memory-consolidation.js +6 -6
- package/dist/boot/parked-revive-gate.js +3 -15
- package/dist/boot/reapers.d.ts +6 -1
- package/dist/boot/reapers.js +13 -2
- package/dist/boot/resolve-spec.d.ts +3 -3
- package/dist/boot/resolve-spec.js +43 -48
- package/dist/boot/runner-deps.d.ts +46 -35
- package/dist/boot/runner-deps.js +94 -91
- package/dist/boot/session-age-out.d.ts +36 -0
- package/dist/boot/session-age-out.js +101 -0
- package/dist/boot/session-faces.d.ts +5 -14
- package/dist/boot/session-faces.js +9 -5
- package/dist/boot/shutdown.d.ts +6 -0
- package/dist/boot/shutdown.js +10 -4
- package/dist/boot/stage-01-config.js +2 -0
- package/dist/boot/stage-02-web-admin-pull.js +4 -5
- package/dist/boot/stage-05-execution-env.d.ts +5 -3
- package/dist/boot/stage-05-execution-env.js +3 -2
- package/dist/boot/stage-06-runners.d.ts +9 -4
- package/dist/boot/stage-06-runners.js +24 -9
- package/dist/boot/stage-07-capability-layer.d.ts +8 -4
- package/dist/boot/stage-07-capability-layer.js +3 -2
- package/dist/boot/stage-08-reapers.d.ts +8 -4
- package/dist/boot/stage-08-reapers.js +4 -2
- package/dist/boot/stage-09-leader.d.ts +12 -5
- package/dist/boot/stage-09-leader.js +14 -5
- package/dist/boot/stage-10-http-server.d.ts +19 -5
- package/dist/boot/stage-10-http-server.js +14 -21
- package/dist/boot/stores.js +7 -4
- package/dist/boot/web-admin.js +5 -8
- package/dist/boot/workflow-orchestration.d.ts +7 -2
- package/dist/boot/workflow-orchestration.js +24 -7
- package/dist/bounded-rotation.d.ts +29 -0
- package/dist/bounded-rotation.js +24 -0
- package/dist/capabilities/approvals-push.d.ts +3 -3
- package/dist/capabilities/scenarios.d.ts +28 -13
- package/dist/capabilities/scenarios.js +2 -2
- package/dist/capability-facts.d.ts +43 -32
- package/dist/capability-facts.js +45 -51
- package/dist/card-rule-offers.d.ts +32 -0
- package/dist/card-rule-offers.js +130 -0
- package/dist/center-credential.d.ts +25 -6
- package/dist/center-credential.js +25 -5
- package/dist/config-catalog.d.ts +26 -7
- package/dist/config-catalog.js +26 -22
- package/dist/config-dir-trust.js +4 -2
- package/dist/config-invariants.d.ts +20 -8
- package/dist/config-invariants.js +55 -12
- package/dist/config-lkg.d.ts +5 -19
- package/dist/config-lkg.js +8 -62
- package/dist/config-provider.d.ts +1 -1
- package/dist/config-root-migration.d.ts +2 -2
- package/dist/config-types.d.ts +38 -42
- package/dist/config.d.ts +58 -7
- package/dist/config.js +90 -40
- package/dist/control-socket.d.ts +51 -0
- package/dist/control-socket.js +115 -0
- package/dist/deployment-governance.d.ts +2 -1
- package/dist/deployment-shape.d.ts +9 -1
- package/dist/deployment-shape.js +2 -1
- package/dist/device-protocol.d.ts +5 -4
- package/dist/device-protocol.js +1 -1
- package/dist/device-ws-hub.d.ts +7 -0
- package/dist/device-ws-hub.js +10 -3
- package/dist/device-ws-protocol.d.ts +63 -10
- package/dist/device-ws-protocol.js +56 -25
- package/dist/elicitation.js +2 -2
- package/dist/engine-identity.d.ts +19 -7
- package/dist/engine-identity.js +10 -2
- package/dist/entry-mode-clamp-notice.d.ts +2 -1
- package/dist/entry-problems.d.ts +40 -3
- package/dist/entry-problems.js +3 -1
- package/dist/execution-env-refusal.d.ts +29 -0
- package/dist/execution-env-refusal.js +8 -0
- package/dist/execution-lane-caps.d.ts +3 -1
- package/dist/field-conflict.d.ts +1 -1
- package/dist/file-history-capture.d.ts +11 -4
- package/dist/file-history-capture.js +9 -6
- package/dist/file-history-disclosure.d.ts +7 -5
- package/dist/file-history-disclosure.js +7 -5
- package/dist/fleet/drain-entry.d.ts +4 -0
- package/dist/fleet/engine-signal.d.ts +12 -29
- package/dist/fleet/engine-signal.js +1 -7
- package/dist/fleet-client.js +2 -5
- package/dist/gate-settlement.d.ts +1 -8
- package/dist/gate-settlement.js +0 -4
- package/dist/history-anchor.js +1 -1
- package/dist/hitl-delivery.d.ts +2 -3
- package/dist/hitl-delivery.js +0 -2
- package/dist/hooks/hook-llm.js +4 -2
- package/dist/hooks/hook-runner.d.ts +3 -2
- package/dist/hooks/hook-runner.js +18 -3
- package/dist/host-decision.d.ts +11 -11
- package/dist/host-lsp-manager.d.ts +2 -2
- package/dist/http/active-run-conflict.d.ts +35 -2
- package/dist/http/active-run-conflict.js +48 -19
- package/dist/http/admission.js +17 -2
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +10 -7
- package/dist/http/checkpoint-ctx.d.ts +4 -0
- package/dist/http/checkpoint-ctx.js +2 -0
- package/dist/http/dispatch.d.ts +8 -3
- package/dist/http/dispatch.js +59 -32
- package/dist/http/durable-run-leg.js +16 -17
- package/dist/http/health-reader.d.ts +16 -9
- package/dist/http/health-reader.js +2 -1
- package/dist/http/health-self-report.d.ts +9 -1
- package/dist/http/health-self-report.js +3 -1
- package/dist/http/owner-access.d.ts +33 -14
- package/dist/http/owner-access.js +40 -10
- package/dist/http/principal-gate.d.ts +49 -21
- package/dist/http/principal-gate.js +61 -11
- package/dist/http/request-channel.d.ts +23 -0
- package/dist/http/request-channel.js +9 -0
- package/dist/http/request-guards.js +17 -2
- package/dist/http/resume-ctx-read.js +42 -3
- package/dist/http/resume-legs.d.ts +4 -3
- package/dist/http/resume-legs.js +367 -117
- package/dist/http/route-ctx.d.ts +91 -15
- package/dist/http/route-ctx.js +17 -0
- package/dist/http/route-table.d.ts +5 -1
- package/dist/http/route-table.js +4 -0
- package/dist/http/routes/admin-config-refresh.js +3 -3
- package/dist/http/routes/admin-drain.d.ts +3 -0
- package/dist/http/routes/admin-drain.js +7 -7
- package/dist/http/routes/admin-memory-optout.d.ts +1 -1
- package/dist/http/routes/admin-memory-optout.js +3 -3
- package/dist/http/routes/adoption.js +3 -5
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +2 -1
- package/dist/http/routes/approvals-assistant.js +99 -51
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/capabilities.d.ts +4 -0
- package/dist/http/routes/capabilities.js +38 -10
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.js +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/diagnostics.js +19 -7
- package/dist/http/routes/fleet.js +10 -8
- package/dist/http/routes/images.js +10 -10
- package/dist/http/routes/memory-bundle.js +3 -3
- package/dist/http/routes/memory-compliance.js +3 -3
- package/dist/http/routes/memory-consolidation.js +2 -2
- package/dist/http/routes/memory-origin.js +3 -3
- package/dist/http/routes/memory-policy.js +2 -2
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/projects.d.ts +3 -2
- package/dist/http/routes/projects.js +4 -5
- package/dist/http/routes/retention-ops.js +3 -3
- package/dist/http/routes/rules.js +5 -5
- package/dist/http/routes/run-permission-mode.d.ts +2 -1
- package/dist/http/routes/run-permission-mode.js +2 -2
- package/dist/http/routes/runs.d.ts +4 -9
- package/dist/http/routes/runs.js +171 -65
- package/dist/http/routes/session-sync.d.ts +22 -9
- package/dist/http/routes/session-sync.js +204 -107
- package/dist/http/routes/sessions-list.js +13 -7
- package/dist/http/routes/sessions.js +30 -15
- package/dist/http/routes/tasks.js +46 -41
- package/dist/http/routes/trace-usage.js +2 -2
- package/dist/http/routes/workflows.js +1 -1
- package/dist/http/server.d.ts +30 -30
- package/dist/http/server.js +16 -4
- package/dist/http/submit-ctx.d.ts +1 -1
- package/dist/http/submit-ctx.js +7 -4
- package/dist/http/wire-types.d.ts +14 -4
- package/dist/human-facing-args.d.ts +33 -0
- package/dist/human-facing-args.js +33 -0
- package/dist/identity-source.d.ts +20 -3
- package/dist/identity-source.js +14 -0
- package/dist/index.d.ts +5 -1
- package/dist/k8s-api-credentials.d.ts +29 -0
- package/dist/k8s-api-credentials.js +25 -0
- package/dist/lane-home-probe.d.ts +3 -7
- package/dist/lane-home-probe.js +2 -2
- package/dist/leader/diffup.d.ts +19 -0
- package/dist/leader/diffup.js +7 -0
- package/dist/leader/leader.d.ts +116 -11
- package/dist/leader/leader.js +69 -5
- package/dist/leader/repair-wire.js +2 -2
- package/dist/leader/run-entry.d.ts +2 -1
- package/dist/leader/run-entry.js +1 -1
- package/dist/leader/wire.d.ts +42 -132
- package/dist/leader/wire.js +81 -67
- package/dist/leg-facts.d.ts +13 -5
- package/dist/leg-facts.js +2 -1
- package/dist/memory-scope.d.ts +23 -11
- package/dist/memory-scope.js +18 -6
- package/dist/memory-sync-client.d.ts +30 -2
- package/dist/memory-sync-client.js +16 -9
- package/dist/model-entry-headers.d.ts +9 -10
- package/dist/model-entry-headers.js +0 -4
- package/dist/model-entry-refusal.d.ts +7 -4
- package/dist/model-entry-refusal.js +11 -5
- package/dist/model-plane-face.d.ts +1 -1
- package/dist/model-plane-face.js +3 -1
- package/dist/model-route-endpoint.d.ts +13 -7
- package/dist/model-route-endpoint.js +14 -11
- package/dist/model-select.d.ts +22 -0
- package/dist/model-select.js +9 -0
- package/dist/model-unreachable-notice.d.ts +11 -0
- package/dist/model-unreachable-notice.js +4 -4
- package/dist/object-store-buckets.d.ts +640 -6
- package/dist/object-store-buckets.js +166 -0
- package/dist/observability/err-text.d.ts +7 -0
- package/dist/observability/err-text.js +5 -0
- package/dist/observability/fail-open.d.ts +25 -17
- package/dist/observability/fail-open.js +25 -17
- package/dist/observability/logger.js +3 -1
- package/dist/observability/metrics.js +1 -0
- package/dist/operator-roster.d.ts +68 -0
- package/dist/operator-roster.js +32 -0
- package/dist/orchestration/workflow-notify-journal.d.ts +18 -1
- package/dist/orchestration/workflow-notify-journal.js +12 -1
- package/dist/orchestration/workflow-park-decision.d.ts +70 -18
- package/dist/orchestration/workflow-park-decision.js +49 -10
- package/dist/orchestration/workflow-park-holder.d.ts +65 -0
- package/dist/orchestration/workflow-park-holder.js +98 -0
- package/dist/orchestration/workflow-record-fence.d.ts +36 -0
- package/dist/orchestration/workflow-record-fence.js +42 -0
- package/dist/outbound-dispatcher.d.ts +71 -8
- package/dist/outbound-dispatcher.js +48 -7
- package/dist/owner-faces.d.ts +2 -2
- package/dist/parked-decide.d.ts +106 -55
- package/dist/parked-decide.js +153 -117
- package/dist/peer-directory.d.ts +2 -2
- package/dist/peer-inbound-face.d.ts +2 -6
- package/dist/peer-inbound-face.js +0 -3
- package/dist/permission-mode-admission.d.ts +74 -5
- package/dist/permission-mode-admission.js +56 -3
- package/dist/plugins/adoption-log-sql.d.ts +3 -1
- package/dist/plugins/adoption-log-sql.js +7 -1
- package/dist/plugins/approval-ask-store-file.d.ts +14 -2
- package/dist/plugins/approval-ask-store-file.js +11 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +10 -1
- package/dist/plugins/approval-ask-store-memory.js +35 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +69 -4
- package/dist/plugins/approval-ask-store-sql.js +45 -5
- package/dist/plugins/approval-exemption-store.js +3 -0
- package/dist/plugins/approval-nonce-store.js +2 -0
- package/dist/plugins/blob-backend.d.ts +83 -7
- package/dist/plugins/blob-backend.js +57 -6
- package/dist/plugins/breaker-state-sql.js +2 -0
- package/dist/plugins/caching-session-store.d.ts +9 -15
- package/dist/plugins/caching-session-store.js +6 -0
- package/dist/plugins/checkpoint-index-columns.d.ts +20 -16
- package/dist/plugins/checkpoint-index-columns.js +3 -6
- package/dist/plugins/checkpoint-store-face.d.ts +119 -61
- package/dist/plugins/checkpoint-store-face.js +134 -55
- package/dist/plugins/device-store-sql.js +6 -0
- package/dist/plugins/error-origin.d.ts +18 -0
- package/dist/plugins/error-origin.js +10 -0
- package/dist/plugins/execution-placement-sql.js +6 -6
- package/dist/plugins/image-bake-store-sql.js +6 -0
- package/dist/plugins/image-index-sql.js +4 -0
- package/dist/plugins/landed-attendants.d.ts +212 -0
- package/dist/plugins/landed-attendants.js +161 -0
- package/dist/plugins/leader-run-store-sql.js +4 -0
- package/dist/plugins/local-checkpoint-store.d.ts +13 -3
- package/dist/plugins/local-checkpoint-store.js +38 -49
- package/dist/plugins/local-session-live-reference.d.ts +40 -0
- package/dist/plugins/local-session-live-reference.js +39 -0
- package/dist/plugins/local-session-store.d.ts +71 -33
- package/dist/plugins/local-session-store.js +129 -27
- package/dist/plugins/memory-engine-pg.js +4 -0
- package/dist/plugins/memory-engine-sql-apply.js +5 -2
- package/dist/plugins/memory-engine-tidb.js +4 -0
- package/dist/plugins/memory-optout-grant-store-sql.js +4 -0
- package/dist/plugins/memory-sync-store-pg.js +5 -0
- package/dist/plugins/memory-sync-store-tidb.js +5 -0
- package/dist/plugins/one-time-migrations.d.ts +104 -80
- package/dist/plugins/one-time-migrations.js +226 -132
- package/dist/plugins/org-delivery-quota-store.js +4 -1
- package/dist/plugins/outcome-ledger-sql.js +2 -0
- package/dist/plugins/permission-rule-store-sql.js +11 -4
- package/dist/plugins/pg-cost-quota.js +4 -0
- package/dist/plugins/pg-pool.js +35 -10
- package/dist/plugins/pg-rate-limiter.js +2 -0
- package/dist/plugins/posix-shell-fs.d.ts +6 -1
- package/dist/plugins/posix-shell-fs.js +4 -1
- package/dist/plugins/remote-env-adb.d.ts +19 -15
- package/dist/plugins/remote-env-adb.js +41 -15
- package/dist/plugins/remote-env-connect-seat.d.ts +105 -0
- package/dist/plugins/remote-env-connect-seat.js +72 -0
- package/dist/plugins/remote-env-device.d.ts +22 -5
- package/dist/plugins/remote-env-device.js +106 -8
- package/dist/plugins/remote-env-e2b.d.ts +15 -6
- package/dist/plugins/remote-env-e2b.js +42 -32
- package/dist/plugins/remote-env-file-error.js +6 -2
- package/dist/plugins/remote-env-host.d.ts +46 -10
- package/dist/plugins/remote-env-host.js +124 -52
- package/dist/plugins/remote-env-k8s.d.ts +109 -41
- package/dist/plugins/remote-env-k8s.js +160 -54
- package/dist/plugins/remote-env-local-docker.d.ts +13 -8
- package/dist/plugins/remote-env-local-docker.js +34 -41
- package/dist/plugins/remote-env-ssh.d.ts +18 -12
- package/dist/plugins/remote-env-ssh.js +60 -59
- package/dist/plugins/remote-shell.d.ts +98 -1
- package/dist/plugins/remote-shell.js +218 -0
- package/dist/plugins/replica-registration.d.ts +1 -1
- package/dist/plugins/replica-registration.js +1 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +11 -2
- package/dist/plugins/resume-anchor-store-sql.js +12 -5
- package/dist/plugins/retention-lane-store-sql.js +4 -0
- package/dist/plugins/retention-sql.d.ts +20 -2
- package/dist/plugins/retention-sql.js +11 -0
- package/dist/plugins/run-store-sql.d.ts +21 -2
- package/dist/plugins/run-store-sql.js +31 -7
- package/dist/plugins/s3-presign.d.ts +23 -0
- package/dist/plugins/s3-presign.js +37 -3
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +1 -1
- package/dist/plugins/scenario-prefix-switch-m42.js +2 -2
- package/dist/plugins/scheduler-support.d.ts +2 -2
- package/dist/plugins/scheduler-support.js +0 -3
- package/dist/plugins/schema-consistency.d.ts +4 -2
- package/dist/plugins/schema-consistency.js +19 -2
- package/dist/plugins/schema-indexes.js +2 -0
- package/dist/plugins/send-file-ledger.d.ts +2 -2
- package/dist/plugins/send-file-ledger.js +5 -2
- package/dist/plugins/send-user-file.d.ts +3 -4
- package/dist/plugins/send-user-file.js +56 -52
- package/dist/plugins/serving-requirement.d.ts +26 -7
- package/dist/plugins/serving-requirement.js +11 -4
- package/dist/plugins/session-birth.d.ts +6 -2
- package/dist/plugins/session-blob-claim-token.d.ts +15 -0
- package/dist/plugins/session-blob-claim-token.js +20 -0
- package/dist/plugins/session-blob-namespace.d.ts +46 -0
- package/dist/plugins/session-blob-namespace.js +116 -0
- package/dist/plugins/session-capture-record-store-sql.js +2 -0
- package/dist/plugins/session-ext-table.d.ts +14 -1
- package/dist/plugins/session-ext-table.js +5 -1
- package/dist/plugins/session-row-sql.d.ts +49 -2
- package/dist/plugins/session-row-sql.js +56 -13
- package/dist/plugins/session-store-sql.d.ts +34 -18
- package/dist/plugins/session-store-sql.js +98 -17
- package/dist/plugins/shared-memory-store-sql.d.ts +1 -0
- package/dist/plugins/shared-memory-store-sql.js +6 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +25 -2
- package/dist/plugins/snapshot-bucket-presence.js +8 -2
- package/dist/plugins/sql-driver.d.ts +2 -1
- package/dist/plugins/sql-driver.js +18 -3
- package/dist/plugins/sql-errors.d.ts +11 -6
- package/dist/plugins/sql-errors.js +5 -6
- package/dist/plugins/sql-json-column.d.ts +1 -1
- package/dist/plugins/stop-then-start-sentence.d.ts +10 -4
- package/dist/plugins/stop-then-start-sentence.js +14 -10
- package/dist/plugins/stop-then-start.d.ts +109 -0
- package/dist/plugins/stop-then-start.js +104 -0
- package/dist/plugins/store-backend.d.ts +84 -15
- package/dist/plugins/store-backend.js +236 -72
- package/dist/plugins/store-boundary.d.ts +57 -0
- package/dist/plugins/store-boundary.js +139 -0
- package/dist/plugins/store-contracts.d.ts +17 -0
- package/dist/plugins/store-fault-sentence-m53.d.ts +7 -0
- package/dist/plugins/store-fault-sentence-m53.js +25 -0
- package/dist/plugins/store-fault.d.ts +26 -7
- package/dist/plugins/store-fault.js +18 -2
- package/dist/plugins/task-attachment-store.d.ts +2 -1
- package/dist/plugins/task-attachment-store.js +14 -1
- package/dist/plugins/task-list-store-sql.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.js +10 -8
- package/dist/plugins/tidb-cost-quota.js +4 -0
- package/dist/plugins/tidb-pool.js +21 -25
- package/dist/plugins/tidb-rate-limiter.js +4 -0
- package/dist/plugins/user-input-ledger-sql.js +4 -0
- package/dist/plugins/workflow-run-store-sql.d.ts +28 -10
- package/dist/plugins/workflow-run-store-sql.js +64 -4
- package/dist/plugins/workspace-custody.d.ts +4 -3
- package/dist/plugins/workspace-fill.d.ts +4 -7
- package/dist/plugins/workspace-fill.js +2 -1
- package/dist/plugins/write-behind-counter.js +5 -0
- package/dist/project-context.d.ts +0 -2
- package/dist/project-context.js +4 -8
- package/dist/project-registry.d.ts +46 -0
- package/dist/project-registry.js +44 -0
- package/dist/question.d.ts +2 -1
- package/dist/question.js +5 -13
- package/dist/request-form.d.ts +6 -1
- package/dist/request-form.js +4 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +4 -0
- package/dist/request-value-closure.js +10 -0
- package/dist/rule-issue-reading.d.ts +1 -1
- package/dist/rules-consent.d.ts +1 -1
- package/dist/run-acceptance.d.ts +3 -2
- package/dist/run-acceptance.js +4 -6
- package/dist/run-local.js +9 -9
- package/dist/runs.d.ts +54 -16
- package/dist/runs.js +67 -13
- package/dist/runtime-governance.d.ts +5 -4
- package/dist/security.d.ts +30 -32
- package/dist/security.js +41 -7
- package/dist/sema-config-dir.d.ts +2 -1
- package/dist/server-secret-env.d.ts +12 -10
- package/dist/server-secret-env.js +24 -15
- package/dist/session-bindings.d.ts +82 -0
- package/dist/session-bindings.js +18 -0
- package/dist/session-children-retire.d.ts +2 -2
- package/dist/session-children-retire.js +2 -6
- package/dist/session-deletion.d.ts +16 -1
- package/dist/session-error-wire.d.ts +3 -3
- package/dist/session-error-wire.js +3 -3
- package/dist/session-incarnation.d.ts +10 -0
- package/dist/session-incarnation.js +10 -1
- package/dist/session-kind.d.ts +57 -0
- package/dist/session-kind.js +22 -0
- package/dist/session-row.d.ts +21 -1
- package/dist/session-row.js +7 -1
- package/dist/session-sync-kernel.d.ts +24 -14
- package/dist/session-sync-kernel.js +3 -6
- package/dist/session-sync.d.ts +25 -103
- package/dist/session-sync.js +14 -76
- package/dist/session-titler.d.ts +10 -3
- package/dist/session-titler.js +19 -6
- package/dist/ssh-host-key.d.ts +5 -0
- package/dist/ssh-host-key.js +3 -0
- package/dist/stores-sql/blob-index-sql.d.ts +30 -9
- package/dist/stores-sql/blob-index-sql.js +40 -21
- package/dist/stores-sql/checkpoint-store-sql.d.ts +54 -27
- package/dist/stores-sql/checkpoint-store-sql.js +70 -146
- package/dist/stores-sql/file-history-store-sql.d.ts +113 -15
- package/dist/stores-sql/file-history-store-sql.js +205 -95
- package/dist/stores-sql/pg-session-storage.d.ts +34 -7
- package/dist/stores-sql/pg-session-storage.js +37 -13
- package/dist/stores-sql/retention-store-sql.d.ts +1 -9
- package/dist/stores-sql/retention-store-sql.js +5 -19
- package/dist/stores-sql/session-policy-store-sql.d.ts +30 -7
- package/dist/stores-sql/session-policy-store-sql.js +61 -44
- package/dist/stores-sql/session-write-hooks.d.ts +11 -0
- package/dist/stores-sql/tidb-session-store.d.ts +58 -7
- package/dist/stores-sql/tidb-session-store.js +37 -13
- package/dist/submission-exit.d.ts +3 -2
- package/dist/submission-exit.js +9 -1
- package/dist/task-cwd.d.ts +2 -2
- package/dist/task-settings.d.ts +7 -5
- package/dist/task-settings.js +3 -3
- package/dist/terminal.d.ts +33 -2
- package/dist/terminal.js +139 -9
- package/dist/tool-approval.d.ts +465 -507
- package/dist/tool-approval.js +606 -1222
- package/dist/trace/core-keyset-guard.d.ts +1 -1
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/project.d.ts +2 -3
- package/dist/trace/redact.js +3 -2
- package/dist/trace/self-minted-wire.d.ts +571 -178
- package/dist/trace/self-minted-wire.js +189 -56
- package/dist/web-admin-client/apply-effective.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.js +1 -1
- package/dist/web-admin-client/types.d.ts +1 -1
- package/dist/workspace-space.d.ts +10 -4
- package/dist/workspace-space.js +4 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +79 -28
- package/package.json +7 -3
- package/scripts/embed-minimal.mjs +3 -3
- package/wire-changes/server@7.151.0.json +762 -0
- package/wire-changes/server@7.152.0.json +900 -0
- package/dist/config-d-migration.d.ts +0 -37
- package/dist/config-d-migration.js +0 -60
- package/dist/http/session-inherit-env.d.ts +0 -36
- package/dist/http/session-inherit-env.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workspace persistence by **space** (k8s lane) — the closed word set, the defaults, the retention domain and
|
|
3
|
-
* the policy shape (pure leaf:
|
|
4
|
-
* in `plugins/` can all import it without a load cycle). The effective policy has ONE reading: the capability fact `workspaceSpace`
|
|
3
|
+
* the policy shape (pure leaf: its only value imports are a node builtin and the object-store name leaf `object-store-buckets.ts`, itself
|
|
4
|
+
* import-free — so `config.ts`, the capability fact, the boot bucket check and the adapter in `plugins/` can all import it without a load cycle). The effective policy has ONE reading: the capability fact `workspaceSpace`
|
|
5
5
|
* (`src/capability-facts.ts`).
|
|
6
6
|
*
|
|
7
7
|
* The law (one fact, one seat): a k8s pod's `/workspace` is durable across runs as an object-store "space" owned by the
|
|
@@ -63,8 +63,14 @@ export interface WorkspaceSpacePolicy {
|
|
|
63
63
|
export interface WorkspaceSyncCapability extends WorkspaceSpacePolicy {
|
|
64
64
|
timeoutMs: number;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
67
|
-
|
|
66
|
+
/**
|
|
67
|
+
* The key prefix of a k8s snapshot store — the ONE reading of `WORKSPACE_SNAPSHOT_PREFIX` (unset ⇒ `WORKSPACE_SNAPSHOT_PREFIX_DEFAULT`): the adapter
|
|
68
|
+
* signs every snapshot key under it, and the boot bucket check lists under it (`<prefix>/`), so the check asks for the same prefix the adapter writes —
|
|
69
|
+
* a credential whose listing is granted by prefix answers the check exactly as it answers the adapter. Its form is judged by {@link snapshotKeyPrefixProblem}.
|
|
70
|
+
*/
|
|
71
|
+
export declare function workspaceSnapshotPrefixOf(store: {
|
|
72
|
+
readonly keyPrefix?: string;
|
|
73
|
+
} | undefined): string;
|
|
68
74
|
/**
|
|
69
75
|
* The ONE form of a snapshot-key segment — the partition (incarnation / session id), the snapshot id, the object name and each segment of
|
|
70
76
|
* the key prefix all pass it before a key is signed: it starts with a letter or digit, then letters, digits, `.`, `_`, `-`. No `/`, no `..`,
|
package/dist/workspace-space.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { WORKSPACE_SNAPSHOT_PREFIX_DEFAULT } from "./object-store-buckets.js";
|
|
2
3
|
export const K8S_WORKSPACE_MOUNT_DEFAULT = "/workspace";
|
|
3
4
|
export const WORKSPACE_PERSIST_WORDS = ["space", "off"];
|
|
4
5
|
export const WORKSPACE_PERSIST_DEFAULT = "space";
|
|
@@ -9,7 +10,9 @@ export const WORKSPACE_SNAPSHOT_TIMEOUT_MS_RANGE = { min: 30_000, max: 3_600_000
|
|
|
9
10
|
export function workspaceSnapshotTimeoutOf(lane) {
|
|
10
11
|
return lane.workspaceSnapshotTimeoutMs ?? WORKSPACE_SNAPSHOT_TIMEOUT_MS_DEFAULT;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
+
export function workspaceSnapshotPrefixOf(store) {
|
|
14
|
+
return store?.keyPrefix ?? WORKSPACE_SNAPSHOT_PREFIX_DEFAULT;
|
|
15
|
+
}
|
|
13
16
|
export const SNAPSHOT_KEY_SEGMENT = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
14
17
|
export const WORKSPACE_SNAPSHOT_PREFIX_INVALID = "config.workspace_snapshot_prefix_invalid";
|
|
15
18
|
export function snapshotKeyPrefixProblem(prefix) {
|
|
@@ -152,8 +152,9 @@ pre-auth frame closes the connection outright.
|
|
|
152
152
|
|
|
153
153
|
**Which revision to declare.** `challenge.protocolVersion` is the highest protocol revision this server speaks
|
|
154
154
|
(`DEVICE_MIN_PROTOCOL_VERSION` is the lowest it accepts, §2.1). Put the highest revision *you* implement that is
|
|
155
|
-
not above `challenge.protocolVersion` into `hello.protocolVersion` — the same integer you sign (§1.3) —
|
|
156
|
-
only the
|
|
155
|
+
not above `challenge.protocolVersion` into `hello.protocolVersion` — the same integer you sign (§1.3) — declare in
|
|
156
|
+
`supports` only the instruction kinds of that revision, and emit only the `errorCode` words of that revision (the revision
|
|
157
|
+
table in §2.1). Nothing is renegotiated after `hello`:
|
|
157
158
|
the revision you declared is the contract for the whole connection. If the highest revision you implement is below
|
|
158
159
|
`DEVICE_MIN_PROTOCOL_VERSION`, the server answers `helloReject: protocol_version_unsupported` (§1.4).
|
|
159
160
|
Revisions are cumulative on the executor's side: an executor that implements revision *N* implements every revision
|
|
@@ -249,7 +250,7 @@ sign exactly these bytes with the device's Ed25519 private key.
|
|
|
249
250
|
|
|
250
251
|
| Code | Meaning | What the executor should do |
|
|
251
252
|
|---|---|---|
|
|
252
|
-
| `auth_failed` | deliberately ambiguous: unknown device id, malformed id, malformed epoch, bad signature,
|
|
253
|
+
| `auth_failed` | deliberately ambiguous: unknown device id, malformed id, malformed epoch, bad signature, the server's device registry was unreachable, or — on a deployment that confines service principals — the device's owner is currently named in the operator roster's drain-only tier (a tier whose identity counts only on the drain endpoint, so it may not use the device lane; the device registration and the key stay valid) | do **not** hammer: back off exponentially, and never delete the key on `auth_failed` alone. If it never clears, the enrollment may be gone — re-enroll — unless the owner is confined as described: registering again under that identity is refused with `403 auth.principal_confined`, and the cure is on the operator's side. The server will not tell you which of these it was (anti-enumeration); the confinement cause is judged after the signature verifies, so only the holder of the device key can ever meet it. It is not terminal: when the owner is back in the ordinary tier (the deployment's roster is read at process start), the next reconnect succeeds, and the code set and the revision are unchanged |
|
|
253
254
|
| `revoked` | this device has been revoked. Terminal | stop reconnecting, delete the private key, ask the user to re-enroll (it yields a new `deviceId`) |
|
|
254
255
|
| `protocol_version_unsupported` | your `protocolVersion` is outside the range this server accepts; the frame carries `minProtocolVersion` and a one-line `message` that names your revision, the range and — below the floor — the change at the floor revision (§2.1) | upgrade the executor (`message` is fit to show as is). Never retry-with-a-different-version in a loop |
|
|
255
256
|
| `draining` | this replica is shutting down or upgrading and takes no new connections | reconnect with backoff; a replacement replica will accept you |
|
|
@@ -345,7 +346,7 @@ base64 inside JSON fields.
|
|
|
345
346
|
| Constant | Value | Meaning |
|
|
346
347
|
|---|---|---|
|
|
347
348
|
| `DEVICE_WS_PATH` | `/v1/device/ws` | the upgrade path (prefer the `wsPath` from `/v1/capabilities`) |
|
|
348
|
-
| `DEVICE_PROTOCOL_VERSION` | `
|
|
349
|
+
| `DEVICE_PROTOCOL_VERSION` | `6` | the protocol revision this server speaks (the highest it accepts) |
|
|
349
350
|
| `DEVICE_MIN_PROTOCOL_VERSION` | `5` | the lowest revision it accepts (the revision table says why); below it (or above the highest), a loud `helloReject` — never a silent downgrade |
|
|
350
351
|
| `DEVICE_HELLO_DOMAIN_TAG` | `sema.device.hello.v1` | the handshake signature domain tag (§1.3) |
|
|
351
352
|
|
|
@@ -366,36 +367,43 @@ cap. An instruction whose frame would be over it is refused before dispatch (you
|
|
|
366
367
|
chunks are sliced so that a chunk frame, base64 and envelope included, fits. You can therefore cap the frames you
|
|
367
368
|
accept at `maxFrameBytes`.
|
|
368
369
|
|
|
369
|
-
#### Protocol revisions
|
|
370
|
+
#### Protocol revisions: the `errorCode` set and the instruction kinds
|
|
370
371
|
|
|
371
372
|
The protocol revision is the only thing an executor can read *before* it sends `hello` (the `challenge` frame
|
|
372
373
|
carries it), so everything you must know to be correct on this server is a function of the revision, not a
|
|
373
|
-
separate list: the set of `errorCode` words the server accepts from you,
|
|
374
|
-
The table gives, per revision, the words **added**
|
|
375
|
-
at revision *N* is the union of
|
|
374
|
+
separate list: the set of `errorCode` words the server accepts from you, the set of instruction kinds it may send you,
|
|
375
|
+
and what the frames it sends you mean. The table gives, per revision, the words **added** to each set at that revision
|
|
376
|
+
and any other change made at it; a set at revision *N* is the union of its column's rows up to *N*, and the full sets at
|
|
377
|
+
the current revision are the §3.3 table (`errorCode`) and the §3.1 table (instruction kinds, in this order).
|
|
376
378
|
|
|
377
379
|
<!-- closed-set: DEVICE_OUTCOME_ERROR_CODES_BY_REVISION -->
|
|
378
380
|
|
|
379
|
-
| Revision | `errorCode` words added at this revision | Other change at this revision |
|
|
380
|
-
|
|
381
|
-
| `1` | `aborted`, `already_exists`, `auth_failed`, `callback_error`, `invalid`, `is_directory`, `not_directory`, `not_found`, `not_supported`, `outcome_unknown`, `permission_denied`, `precondition_failed`, `shell_unavailable`, `spawn_error`, `suspended`, `target_unavailable`, `timeout`, `transport_lost`, `unknown` | — |
|
|
382
|
-
| `2` | `liveness_no_output` | — |
|
|
383
|
-
| `3` | `name_too_long` | — |
|
|
384
|
-
| `4` | `symlink_loop` | — |
|
|
385
|
-
| `5` | — | every path an instruction carries (`args.path`, `args.paths`, `cwd`) arrives **unfolded** (since server 7.150.0): absolute as written, or anchored at the session's working directory, with `.` / `..` / empty segments kept — the server anchors and never folds. Resolve it as your filesystem does and judge containment on where it resolves (§3.1, §6 item 6). An executor written for revision 4 or below expects folded paths, so this is also the lowest revision the server accepts |
|
|
381
|
+
| Revision | `errorCode` words added at this revision | Instruction kinds added at this revision | Other change at this revision |
|
|
382
|
+
|---|---|---|---|
|
|
383
|
+
| `1` | `aborted`, `already_exists`, `auth_failed`, `callback_error`, `invalid`, `is_directory`, `not_directory`, `not_found`, `not_supported`, `outcome_unknown`, `permission_denied`, `precondition_failed`, `shell_unavailable`, `spawn_error`, `suspended`, `target_unavailable`, `timeout`, `transport_lost`, `unknown` | `exec`, `execStream`, `readTextFile`, `readTextLines`, `readBinaryFile`, `writeFile`, `writeFileExclusive`, `writeFileGuarded`, `appendFile`, `fileInfo`, `listDir`, `canonicalPath`, `exists`, `readLink`, `createDir`, `remove`, `createTempDir`, `createTempFile`, `statBatch` | — |
|
|
384
|
+
| `2` | `liveness_no_output` | — | — |
|
|
385
|
+
| `3` | `name_too_long` | — | — |
|
|
386
|
+
| `4` | `symlink_loop` | — | — |
|
|
387
|
+
| `5` | — | — | every path an instruction carries (`args.path`, `args.paths`, `cwd`) arrives **unfolded** (since server 7.150.0): absolute as written, or anchored at the session's working directory, with `.` / `..` / empty segments kept — the server anchors and never folds. Resolve it as your filesystem does and judge containment on where it resolves (§3.1, §6 item 6). An executor written for revision 4 or below expects folded paths, so this is also the lowest revision the server accepts |
|
|
388
|
+
| `6` | — | `openBound` | — |
|
|
386
389
|
|
|
387
390
|
Rules: adding a frame or a field is additive and does not raise the revision. Every other change
|
|
388
|
-
raises `DEVICE_PROTOCOL_VERSION` and adds a row here — a word added to
|
|
389
|
-
|
|
390
|
-
|
|
391
|
+
raises `DEVICE_PROTOCOL_VERSION` and adds a row here — a word added to either closed set of the instruction exchange:
|
|
392
|
+
an `errorCode` word the server *accepts from you* (second column) or an instruction kind the server *sends you*
|
|
393
|
+
(third column) — or a **semantic change**, a change in what a frame the server sends you means (fourth column):
|
|
394
|
+
a semantic change raises the revision. A released row never changes. The server sends a kind only on a connection
|
|
395
|
+
whose declared revision is at or above the row that added it, and only if that connection's `supports` declares it
|
|
396
|
+
(§3.2): a kind above your revision is never sent to you, so an executor written for the older revision still honors
|
|
397
|
+
the newer one and the lowest accepted revision stays where it was (revision 6 added `openBound`; a revision-5 executor
|
|
398
|
+
never receives it). When an executor written for
|
|
391
399
|
an older revision cannot honor the change, the same release raises `DEVICE_MIN_PROTOCOL_VERSION` to the new
|
|
392
400
|
revision, so such an executor is refused once at `hello` (§1.4) instead of failing call by call.
|
|
393
|
-
Declare a revision as §1.2 says and
|
|
401
|
+
Declare a revision as §1.2 says and use only the words of that revision: an executor
|
|
394
402
|
that declared revision 1 never sends `liveness_no_output` (the server does not police this per connection — it
|
|
395
403
|
decodes every connection against the current revision's full set — but a word above your declared revision is outside
|
|
396
|
-
your contract)
|
|
397
|
-
`DEVICE_OUTCOME_ERROR_CODES_BY_REVISION`
|
|
398
|
-
`@sema-agent/server/device-protocol`.
|
|
404
|
+
your contract), and a kind above your declared revision in `supports` is ignored like a word the server does not know.
|
|
405
|
+
The same sets are importable: `DEVICE_OUTCOME_ERROR_CODES_BY_REVISION` / `deviceOutcomeErrorCodesAt(revision)` and
|
|
406
|
+
`DEVICE_INSTRUCTION_KINDS_BY_REVISION` / `deviceInstructionKindsAt(revision)` from `@sema-agent/server/device-protocol`.
|
|
399
407
|
|
|
400
408
|
### 2.2 Device → server frames
|
|
401
409
|
|
|
@@ -532,6 +540,7 @@ entry can be asked again as written.
|
|
|
532
540
|
| `createTempDir` | `{ prefix? }` | `{ok:true, kind:"write", canonicalPath}` | the created directory's path **is** the receipt |
|
|
533
541
|
| `createTempFile` | `{ prefix?, suffix? }` | `{ok:true, kind:"write", canonicalPath}` | same |
|
|
534
542
|
| `statBatch` | `{ paths: string[] }` | `{ok:true, kind:"stat", …}` | declared but **not dispatched today** (see §8) |
|
|
543
|
+
| `openBound` | `{ path, op, identity?, kind?, max? }` | per `op`: `open` / `size` / `list` ⇒ `{ok:true, kind:"stat", …}`, `readBytes` ⇒ `{ok:true, kind:"read"}` | **optional face**, revision 6 — a bound read: the object judged is the object read (§3.7) |
|
|
535
544
|
|
|
536
545
|
The server checks the outcome *kind* against the instruction kind. Answering an `execStream` with
|
|
537
546
|
`{ok:true, kind:"void"}` — a perfectly well-formed frame — is refused as a protocol violation and the
|
|
@@ -540,22 +549,26 @@ outcome are always accepted.
|
|
|
540
549
|
|
|
541
550
|
### 3.2 Declaring what you implement: `hello.supports`
|
|
542
551
|
|
|
543
|
-
`supports` is a plain `string[]` of instruction kinds. The server intersects it with
|
|
544
|
-
**a kind you do not declare is never dispatched to you**, and a call that needs it fails loudly with
|
|
545
|
-
`not_supported` instead of silently doing something else. A kind the server does not recognize
|
|
546
|
-
ignored (that is how a newer executor talks to an older server without breaking it).
|
|
552
|
+
`supports` is a plain `string[]` of instruction kinds. The server intersects it with the kinds of the revision you declared
|
|
553
|
+
(§2.1); **a kind you do not declare is never dispatched to you**, and a call that needs it fails loudly with
|
|
554
|
+
`not_supported` instead of silently doing something else. A kind the server does not recognize — or one above the
|
|
555
|
+
revision you declared — is simply ignored (that is how a newer executor talks to an older server without breaking it).
|
|
547
556
|
|
|
548
|
-
|
|
557
|
+
Four faces are **presence-typed**, which is a stronger statement than "optional":
|
|
549
558
|
|
|
550
559
|
- `writeFileExclusive` — atomic create-if-absent
|
|
551
560
|
- `writeFileGuarded` — verify-and-write in one atomic step
|
|
552
561
|
- `readLink` — read a symlink target
|
|
562
|
+
- `openBound` — a bound read (§3.7): every answer is about the object that was opened and checked
|
|
553
563
|
|
|
554
564
|
The engine decides *at environment-construction time* whether these exist, and when they do not it
|
|
555
565
|
degrades honestly (an advisory check instead of an atomic one). **Therefore: absence is absence. Never
|
|
556
566
|
emulate a guarded or exclusive write with a two-step "check then write".** A two-step emulation reopens
|
|
557
567
|
exactly the race the atomic primitive exists to close, while wearing the face of an atomic operation —
|
|
558
|
-
which is worse than not having it, because nothing downstream can tell.
|
|
568
|
+
which is worse than not having it, because nothing downstream can tell. The same holds for `openBound`:
|
|
569
|
+
**never emulate it with `fileInfo` + `readBinaryFile`** (two path reads cannot tell that the bytes came from the
|
|
570
|
+
object that was judged); without it, the engine simply does not bind a read on this device (a path attachment is
|
|
571
|
+
accepted and reported `not_attached`).
|
|
559
572
|
|
|
560
573
|
Two more consequences you must design for:
|
|
561
574
|
|
|
@@ -712,8 +725,45 @@ side**. Verifying with `stat` and then writing is exactly the emulation that is
|
|
|
712
725
|
- `readLink` — optional but strongly recommended: it is the fourth governance read, and its absence makes
|
|
713
726
|
symlink adjudication coarser.
|
|
714
727
|
- `writeFileExclusive`, `writeFileGuarded` — optional; implement them only if you can do them atomically.
|
|
728
|
+
- `openBound` — optional (revision 6); without it a path attachment on this device is accepted but not attached (§3.7).
|
|
715
729
|
- `statBatch` — safe to omit today.
|
|
716
730
|
|
|
731
|
+
|
|
732
|
+
### 3.7 `openBound` and its four answers
|
|
733
|
+
|
|
734
|
+
`openBound` is a revision-6 kind: the server sends it only on a connection whose `hello.protocolVersion` is 6 or above
|
|
735
|
+
**and** whose `supports` declares it. On a revision-5 connection the face is absent, exactly as if you had not declared
|
|
736
|
+
it (the engine does not bind a read; a path attachment is reported `not_attached`).
|
|
737
|
+
|
|
738
|
+
The protocol has no handle that lives across instructions, so the engine's bound-read object is answered one
|
|
739
|
+
instruction per answer. Every `openBound` instruction is a **complete rebinding**: open `path` locally (do not
|
|
740
|
+
follow a final symbolic link), ask the kernel **once, through that open**, which path the opened object now has and
|
|
741
|
+
what it is, answer **through that same open**, then close it. Never read the path a second time to answer.
|
|
742
|
+
|
|
743
|
+
<!-- closed-set: DEVICE_BOUND_READ_OPS -->
|
|
744
|
+
|
|
745
|
+
| `op` | Carries | Answer with | Refuse with |
|
|
746
|
+
|---|---|---|---|
|
|
747
|
+
| `open` | `path` | `{ok:true, kind:"stat", identity, info}` — `identity` = the opened object's `<device>:<inode>`; `info.kind` is `file` or `dir` | `precondition_failed` (the final component is a link, or the opened object is not at `path`); `invalid` (neither a regular file nor a directory) |
|
|
748
|
+
| `size` | `path`, `identity`, `kind` | `{ok:true, kind:"stat", info}` — `info.size` = the current size | `precondition_failed` when the object opened now is not `identity` / `kind` or not at `path` |
|
|
749
|
+
| `readBytes` | `path`, `identity`, `kind`, `max` | `{ok:true, kind:"read"}`, the bytes as `data` chunks | as `size`, plus `invalid` when the file is over `max` bytes when the read starts (read nothing) |
|
|
750
|
+
| `list` | `path`, `identity`, `kind` | `{ok:true, kind:"stat", entries}` — the opened directory's direct children, links not followed; the server reads only each entry's leaf name | as `size` |
|
|
751
|
+
|
|
752
|
+
Rules:
|
|
753
|
+
|
|
754
|
+
- **One observation per answer.** The check that the opened object is at `path` must be a single observation of
|
|
755
|
+
that open (Linux: `readlink("/proc/self/fd/<fd>")`; macOS: an open with `O_NOFOLLOW_ANY` refuses a link on any
|
|
756
|
+
component, so the open itself is the observation). Separate `fstat` / `lstat` / `realpath` calls are three
|
|
757
|
+
observations that a directory swapped in and out between them gets through. If your platform cannot give one
|
|
758
|
+
observation, answer `not_supported` — the engine reads that as "this face is absent here".
|
|
759
|
+
- **Identity and kind both.** For `size` / `readBytes` / `list`, the object you opened must equal both `identity`
|
|
760
|
+
and `kind` from the `open` answer, else `precondition_failed`. Two opens whose identities are equal do not prove
|
|
761
|
+
they opened one object after an inode number was reused; that residue is accepted by the engine's contract.
|
|
762
|
+
- **Bounded.** An open can block (a FIFO swapped in under the path); the whole answer must finish within the
|
|
763
|
+
instruction's `timeoutMs` and your executor must not leave the blocked open behind.
|
|
764
|
+
- **No privilege above the session's own commands.** Open as the same user that runs the session's `exec`.
|
|
765
|
+
- Error codes are the words of your declared revision (§2.1); nothing new is needed.
|
|
766
|
+
|
|
717
767
|
---
|
|
718
768
|
|
|
719
769
|
## 4. Streaming execution
|
|
@@ -1055,6 +1105,7 @@ These two are a real distinction to the caller: `not_started` is safely retryabl
|
|
|
1055
1105
|
|
|
1056
1106
|
- [ ] `readLink` (recommended soon after — it is the fourth governance read)
|
|
1057
1107
|
- [ ] `writeFileExclusive`, `writeFileGuarded` — declare only when atomic (§3.2)
|
|
1108
|
+
- [ ] `openBound` — declare only with one observation per answer, and only when you declare revision 6 or above (§3.7)
|
|
1058
1109
|
- [ ] `statBatch` — not dispatched today
|
|
1059
1110
|
|
|
1060
1111
|
**Process shape (recommended)**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.152.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"types": "./dist/model-route-env.d.ts",
|
|
26
26
|
"default": "./dist/model-route-env.js"
|
|
27
27
|
},
|
|
28
|
+
"./object-store-buckets": {
|
|
29
|
+
"types": "./dist/object-store-buckets.d.ts",
|
|
30
|
+
"default": "./dist/object-store-buckets.js"
|
|
31
|
+
},
|
|
28
32
|
"./package.json": "./package.json",
|
|
29
33
|
"./deploy/sema-up/lanes.json": "./deploy/sema-up/lib/lanes.json",
|
|
30
34
|
"./deploy/facts/CHANGES.json": "./deploy/facts/CHANGES.json",
|
|
@@ -83,8 +87,8 @@
|
|
|
83
87
|
},
|
|
84
88
|
"dependencies": {
|
|
85
89
|
"@modelcontextprotocol/server": "2.4.0",
|
|
86
|
-
"@sema-agent/core": "7.66.
|
|
87
|
-
"@sema-agent/settings-schema": "
|
|
90
|
+
"@sema-agent/core": "7.66.1",
|
|
91
|
+
"@sema-agent/settings-schema": "26.0.0",
|
|
88
92
|
"e2b": "2.36.0",
|
|
89
93
|
"libsodium-wrappers": "0.8.4",
|
|
90
94
|
"mysql2": "3.22.6",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// and a clean-up that did not happen is `failed step=cleanup` — neither is ever reported as a refusal of the omitted seat.
|
|
11
11
|
//
|
|
12
12
|
// The assembly order is the README "Library embedding" chain: `declareServerWithheldEnv()` → `loadConfig()` → `composeExecutionLane(config, ctx)` →
|
|
13
|
-
// `judgeServedModelRoute(config, { envTableIsPlaceholder })` (the route judge, once after the config-source apply; `loadConfig()` does not judge routes) →
|
|
13
|
+
// `judgeServedModelRoute(config, { envTableIsPlaceholder, webAdminIsConfigSource })` (the route judge, once after the config-source apply; `loadConfig()` does not judge routes) →
|
|
14
14
|
// the nine required `createHttpServer` seats (the type `ServiceCoreDeps`) → `createHttpServer(deps)`. It imports the package root `@sema-agent/server` and the
|
|
15
15
|
// engine package `@sema-agent/core` (the server's pinned dependency, owner of the `Runner` class), never a path inside `dist/`.
|
|
16
16
|
// The service it assembles runs on the host lane against a throwaway local data root and listens on a kernel-assigned loopback port; it takes no task,
|
|
@@ -84,8 +84,8 @@ try {
|
|
|
84
84
|
const logger = createLogger("error");
|
|
85
85
|
const config = await composeExecutionLane(loadConfig(), { configSource: undefined, localRoot: dataRoot, logger, entry: HTTP_SERVICE_LANE_ENTRY });
|
|
86
86
|
// The route judge runs after the config-source apply, never inside `loadConfig()`: a model row with no endpoint would otherwise travel to the first model call.
|
|
87
|
-
// No center here ⇒ the env table is the served table, not a placeholder awaiting a catalog.
|
|
88
|
-
const routeGap = judgeServedModelRoute(config, { envTableIsPlaceholder: false });
|
|
87
|
+
// No center here ⇒ the env table is the served table, not a placeholder awaiting a catalog; and no web-admin config source either (`configSource: undefined` above).
|
|
88
|
+
const routeGap = judgeServedModelRoute(config, { envTableIsPlaceholder: false, webAdminIsConfigSource: false });
|
|
89
89
|
if (routeGap !== undefined) throw new Error(routeGap.reason);
|
|
90
90
|
|
|
91
91
|
// ── seats: peerDesk, deploymentMods (package root: createPeerDesk; `[]` = no mods) ────────────────────────────────────────────────────────
|