@sema-agent/server 7.139.0 → 7.141.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 +471 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +94 -26
- package/dist/adoption/runner.js +1 -1
- package/dist/adoption/sql.js +1 -1
- package/dist/approval-batch-census.d.ts +27 -0
- package/dist/approval-batch-census.js +27 -0
- package/dist/approval-card.d.ts +37 -22
- package/dist/approval-card.js +6 -3
- package/dist/approval.d.ts +15 -0
- package/dist/approval.js +10 -0
- package/dist/audit.d.ts +4 -2
- package/dist/audit.js +2 -2
- package/dist/bench/s1/live-deps.js +3 -2
- package/dist/bench/s1/row.d.ts +5 -2
- package/dist/bench/s1/row.js +2 -22
- package/dist/boot/adoption.js +1 -1
- package/dist/boot/device-lane.d.ts +11 -0
- package/dist/boot/device-lane.js +16 -0
- package/dist/boot/engine-lease.d.ts +24 -3
- package/dist/boot/engine-lease.js +9 -2
- package/dist/boot/execution-env.js +18 -12
- package/dist/boot/execution-lane.d.ts +8 -0
- package/dist/boot/execution-lane.js +6 -1
- package/dist/boot/memory-boundary.d.ts +16 -53
- package/dist/boot/memory-boundary.js +10 -20
- package/dist/boot/memory-consolidation.d.ts +16 -12
- package/dist/boot/memory-consolidation.js +24 -13
- package/dist/boot/reapers.d.ts +2 -2
- package/dist/boot/resolve-spec.d.ts +3 -5
- package/dist/boot/resolve-spec.js +9 -8
- package/dist/boot/runner-deps.d.ts +3 -3
- package/dist/boot/runner-deps.js +1 -0
- package/dist/boot/session-faces.d.ts +1 -1
- package/dist/boot/session-faces.js +4 -3
- package/dist/boot/shutdown.js +5 -0
- package/dist/boot/stage-03-store-backend.d.ts +2 -6
- package/dist/boot/stage-03-store-backend.js +2 -3
- package/dist/boot/stage-04-stores.d.ts +2 -6
- package/dist/boot/stage-04-stores.js +5 -5
- package/dist/boot/stage-05-execution-env.d.ts +2 -6
- package/dist/boot/stage-05-execution-env.js +3 -1
- package/dist/boot/stage-06-runners.d.ts +2 -8
- package/dist/boot/stage-06-runners.js +3 -3
- package/dist/boot/stage-07-capability-layer.d.ts +2 -7
- package/dist/boot/stage-07-capability-layer.js +8 -10
- package/dist/boot/stage-08-reapers.d.ts +2 -7
- package/dist/boot/stage-09-leader.d.ts +2 -7
- package/dist/boot/stage-10-http-server.d.ts +2 -7
- package/dist/boot/stage-10-http-server.js +6 -4
- package/dist/boot/stores.d.ts +3 -6
- package/dist/boot/stores.js +37 -44
- package/dist/boot/task-list-lane.d.ts +1 -1
- package/dist/boot/task-list-lane.js +1 -1
- package/dist/boot/web-admin.js +36 -9
- package/dist/capabilities/execution-lane.d.ts +2 -2
- package/dist/capabilities/scenarios.d.ts +1 -1
- package/dist/capability-facts.d.ts +9 -0
- package/dist/capability-facts.js +9 -0
- package/dist/card-void.d.ts +38 -0
- package/dist/card-void.js +23 -0
- package/dist/config-catalog.js +12 -8
- package/dist/config-provider.d.ts +18 -17
- package/dist/config-provider.js +28 -36
- package/dist/config-types.d.ts +36 -9
- package/dist/config.js +56 -46
- package/dist/delegated-session-owner.d.ts +23 -20
- package/dist/delegated-session-owner.js +2 -2
- package/dist/deployment-shape.d.ts +9 -8
- package/dist/deployment-shape.js +4 -4
- package/dist/device-store.d.ts +7 -0
- package/dist/device-store.js +3 -0
- package/dist/execution-config-root.d.ts +22 -0
- package/dist/execution-config-root.js +35 -0
- package/dist/execution-lane-caps.d.ts +145 -107
- package/dist/execution-lane-caps.js +144 -83
- package/dist/execution-placement.d.ts +3 -0
- package/dist/execution-placement.js +7 -0
- package/dist/fleet/drain-entry.d.ts +3 -0
- package/dist/hosted-posture.d.ts +8 -0
- package/dist/hosted-posture.js +4 -0
- package/dist/http/admission.js +3 -3
- package/dist/http/caller-trust.d.ts +3 -2
- package/dist/http/caller-trust.js +2 -1
- package/dist/http/dispatch.js +4 -0
- package/dist/http/live-frame.d.ts +24 -0
- package/dist/http/live-frame.js +16 -0
- package/dist/http/memory-compliance-failure-reply.d.ts +3 -1
- package/dist/http/memory-compliance-failure-reply.js +5 -0
- package/dist/http/memory-layer-reply.d.ts +30 -0
- package/dist/http/memory-layer-reply.js +24 -0
- package/dist/http/resume-legs.js +49 -35
- package/dist/http/retired-service-deps.d.ts +1 -1
- package/dist/http/retired-service-deps.js +1 -1
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/adoption.js +1 -1
- package/dist/http/routes/approvals-assistant.js +1 -0
- package/dist/http/routes/capabilities.js +5 -4
- package/dist/http/routes/diagnostics.d.ts +0 -19
- package/dist/http/routes/diagnostics.js +16 -2
- package/dist/http/routes/memory-bundle.d.ts +2 -2
- package/dist/http/routes/memory-bundle.js +4 -1
- package/dist/http/routes/memory-compliance.js +9 -2
- package/dist/http/routes/memory-consolidation.js +12 -1
- package/dist/http/routes/memory-origin.js +14 -2
- package/dist/http/routes/memory-policy.js +7 -2
- package/dist/http/routes/run-permission-mode.d.ts +75 -0
- package/dist/http/routes/run-permission-mode.js +170 -0
- package/dist/http/routes/session-sync.d.ts +3 -6
- package/dist/http/routes/session-sync.js +7 -2
- package/dist/http/routes/sessions.js +33 -15
- package/dist/http/routes/tasks.js +67 -68
- package/dist/http/run-read-face.js +3 -3
- package/dist/http/send.d.ts +1 -1
- package/dist/http/send.js +2 -2
- package/dist/http/server.d.ts +14 -27
- package/dist/http/server.js +2 -2
- package/dist/http/sse-log.d.ts +3 -8
- package/dist/http/stored-body-replay.d.ts +3 -3
- package/dist/http/stored-body-replay.js +3 -1
- package/dist/identity-source.d.ts +1 -1
- package/dist/identity-source.js +1 -1
- package/dist/instruction-source-notice.d.ts +7 -0
- package/dist/instruction-source-notice.js +6 -6
- package/dist/lane-home-probe.d.ts +68 -42
- package/dist/lane-home-probe.js +53 -30
- package/dist/leader/wire.js +5 -4
- package/dist/mcp-assertion-header.d.ts +4 -0
- package/dist/mcp-assertion-header.js +5 -0
- package/dist/memory-bundle-engine.d.ts +16 -9
- package/dist/memory-bundle-engine.js +29 -6
- package/dist/memory-operator-faces.d.ts +85 -30
- package/dist/memory-operator-faces.js +136 -30
- package/dist/memory-posture.d.ts +1 -1
- package/dist/memory-project-layer.d.ts +3 -21
- package/dist/memory-project-layer.js +11 -8
- package/dist/memory-scope-stores.d.ts +73 -0
- package/dist/memory-scope-stores.js +86 -0
- package/dist/memory-scope.d.ts +33 -9
- package/dist/memory-scope.js +17 -5
- package/dist/memory-sync-client.d.ts +34 -9
- package/dist/memory-sync-client.js +108 -28
- package/dist/observability/fail-open.d.ts +30 -2
- package/dist/observability/fail-open.js +30 -2
- package/dist/observability/metrics.js +0 -1
- package/dist/observability/run-terminal.d.ts +6 -2
- package/dist/observability/run-terminal.js +25 -26
- package/dist/observability/secret-env-scrub.d.ts +20 -1
- package/dist/observability/secret-env-scrub.js +14 -0
- package/dist/orchestration/workflow-completion-inbox.d.ts +5 -2
- package/dist/orchestration/workflow-completion-inbox.js +13 -5
- package/dist/orchestration/workflow-notify-journal.d.ts +5 -3
- package/dist/orchestration/workflow-notify-journal.js +2 -1
- package/dist/permission-mode-admission.d.ts +68 -0
- package/dist/permission-mode-admission.js +23 -0
- package/dist/permission-rule-list.d.ts +55 -6
- package/dist/permission-rule-list.js +52 -5
- package/dist/plugins/adoption-log-sql.js +4 -4
- package/dist/plugins/approval-ask-store-sql.js +14 -14
- package/dist/plugins/approval-nonce-store.js +4 -4
- package/dist/plugins/blob-backend.d.ts +4 -4
- package/dist/plugins/blob-backend.js +7 -7
- package/dist/plugins/breaker-state-sql.js +2 -2
- package/dist/plugins/caching-session-store.d.ts +6 -0
- package/dist/plugins/caching-session-store.js +3 -0
- package/dist/plugins/checkpoint-index-columns.js +2 -2
- package/dist/plugins/checkpoint-store-sql.d.ts +65 -17
- package/dist/plugins/checkpoint-store-sql.js +90 -19
- package/dist/plugins/device-store-sql.d.ts +5 -2
- package/dist/plugins/device-store-sql.js +23 -20
- package/dist/plugins/ensure-index.d.ts +1 -2
- package/dist/plugins/execution-placement-sql.d.ts +19 -9
- package/dist/plugins/execution-placement-sql.js +20 -9
- package/dist/plugins/file-history-store-sql.d.ts +2 -2
- package/dist/plugins/file-history-store-sql.js +4 -4
- package/dist/plugins/file-run-store.d.ts +2 -2
- package/dist/plugins/file-run-store.js +1 -1
- package/dist/plugins/fork-routing-session-store.d.ts +10 -32
- package/dist/plugins/fork-routing-session-store.js +2 -61
- package/dist/plugins/image-bake-store-sql.js +9 -9
- package/dist/plugins/image-index-sql.js +11 -11
- package/dist/plugins/k8s-exec-protocol.d.ts +4 -1
- package/dist/plugins/k8s-exec-protocol.js +6 -1
- package/dist/plugins/leader-run-store-sql.js +4 -4
- package/dist/plugins/local-checkpoint-store.d.ts +10 -1
- package/dist/plugins/local-checkpoint-store.js +22 -0
- package/dist/plugins/local-session-store.d.ts +227 -35
- package/dist/plugins/local-session-store.js +518 -37
- package/dist/plugins/local-session-window.d.ts +17 -3
- package/dist/plugins/local-session-window.js +7 -13
- package/dist/plugins/mailbox-store-sql.d.ts +2 -1
- package/dist/plugins/mailbox-store-sql.js +4 -4
- package/dist/plugins/memory-engine-tidb.js +5 -5
- package/dist/plugins/memory-optout-grant-store-sql.js +1 -1
- package/dist/plugins/memory-run-store.d.ts +2 -2
- package/dist/plugins/memory-run-store.js +1 -1
- package/dist/plugins/memory-sync-store-tidb.js +3 -3
- package/dist/plugins/one-time-migrations.d.ts +52 -11
- package/dist/plugins/one-time-migrations.js +101 -39
- package/dist/plugins/org-delivery-quota-store.js +2 -2
- package/dist/plugins/outcome-ledger-sql.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -4
- package/dist/plugins/permission-rule-store-sql.js +16 -16
- package/dist/plugins/pg-pool.js +3 -2
- package/dist/plugins/pg-session-storage.d.ts +2 -0
- package/dist/plugins/pg-session-storage.js +3 -2
- package/dist/plugins/remote-env-adb.d.ts +7 -24
- package/dist/plugins/remote-env-adb.js +22 -5
- package/dist/plugins/remote-env-device.d.ts +2 -28
- package/dist/plugins/remote-env-device.js +2 -1
- package/dist/plugins/remote-env-e2b.d.ts +40 -27
- package/dist/plugins/remote-env-e2b.js +180 -20
- package/dist/plugins/remote-env-file-error.d.ts +1 -1
- package/dist/plugins/remote-env-file-error.js +8 -2
- package/dist/plugins/remote-env-host.d.ts +19 -35
- package/dist/plugins/remote-env-host.js +26 -3
- package/dist/plugins/remote-env-k8s.d.ts +22 -14
- package/dist/plugins/remote-env-k8s.js +150 -26
- package/dist/plugins/remote-env-local-docker.d.ts +27 -24
- package/dist/plugins/remote-env-local-docker.js +91 -24
- package/dist/plugins/remote-env-ssh.d.ts +4 -24
- package/dist/plugins/remote-env-ssh.js +4 -3
- package/dist/plugins/resume-anchor-store-sql.js +2 -2
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.js +2 -2
- package/dist/plugins/retention-store-sql.d.ts +1 -1
- package/dist/plugins/retention-store-sql.js +6 -6
- package/dist/plugins/run-store-sql.d.ts +3 -3
- package/dist/plugins/run-store-sql.js +19 -18
- package/dist/plugins/sandbox-read-floor.d.ts +273 -0
- package/dist/plugins/sandbox-read-floor.js +608 -0
- package/dist/plugins/schema-consistency.d.ts +6 -6
- package/dist/plugins/schema-consistency.js +1 -1
- package/dist/plugins/schema-ensure-legs.d.ts +2 -3
- package/dist/plugins/schema-ensure-legs.js +2 -2
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.js +1 -1
- package/dist/plugins/session-ownership.d.ts +2 -1
- package/dist/plugins/session-placement.d.ts +17 -4
- package/dist/plugins/session-placement.js +2 -1
- package/dist/plugins/session-rules-column.d.ts +1 -1
- package/dist/plugins/session-rules-column.js +1 -1
- package/dist/plugins/session-store.d.ts +18 -20
- package/dist/plugins/session-store.js +4 -12
- package/dist/plugins/session-workspace-cell.d.ts +1 -1
- package/dist/plugins/session-workspace-cell.js +1 -1
- package/dist/plugins/shared-memory-store-sql.js +2 -2
- package/dist/plugins/sql-driver.d.ts +10 -5
- package/dist/plugins/sql-driver.js +6 -6
- package/dist/plugins/sql-errors.js +1 -1
- package/dist/plugins/store-backend.d.ts +35 -6
- package/dist/plugins/store-backend.js +27 -10
- package/dist/plugins/store-contracts.d.ts +9 -2
- package/dist/plugins/task-list-store-sql.js +11 -11
- package/dist/plugins/tidb-pool.js +7 -6
- package/dist/plugins/tidb-session-storage.js +4 -4
- package/dist/plugins/tidb-session-store.d.ts +4 -1
- package/dist/plugins/tidb-session-store.js +16 -15
- package/dist/plugins/tool-result-store-sql.d.ts +2 -2
- package/dist/plugins/tool-result-store-sql.js +3 -3
- package/dist/plugins/user-input-ledger-sql.js +2 -2
- package/dist/plugins/workflow-journal-store-sql.js +5 -5
- package/dist/plugins/workflow-run-store-sql.js +19 -19
- package/dist/plugins/write-behind-counter.d.ts +2 -3
- package/dist/plugins/write-behind-counter.js +5 -5
- package/dist/resource-suspend.d.ts +14 -12
- package/dist/resource-suspend.js +1 -1
- package/dist/resource-window.d.ts +4 -3
- package/dist/run-cancel-context.d.ts +34 -0
- package/dist/run-cancel-context.js +7 -0
- package/dist/run-local.js +14 -19
- package/dist/runs.d.ts +47 -16
- package/dist/runs.js +112 -113
- package/dist/security.d.ts +2 -2
- package/dist/server-secret-env.d.ts +2 -1
- package/dist/server-secret-env.js +2 -4
- package/dist/session-error-wire.d.ts +22 -4
- package/dist/session-error-wire.js +16 -0
- package/dist/session-incarnation.d.ts +10 -4
- package/dist/session-incarnation.js +1 -1
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +42 -1
- package/dist/session-sync-kernel.js +17 -0
- package/dist/session-sync.js +16 -4
- package/dist/sql-engine-coordinates.d.ts +49 -0
- package/dist/sql-engine-coordinates.js +27 -0
- package/dist/sql-engine-posture.d.ts +1 -1
- package/dist/sql-engine-posture.js +1 -1
- package/dist/standing-answer-grant.d.ts +31 -2
- package/dist/standing-answer-grant.js +14 -2
- package/dist/store-posture.d.ts +1 -1
- package/dist/{plugins → stores-sql}/background-agent-store-sql.d.ts +2 -2
- package/dist/{plugins → stores-sql}/background-agent-store-sql.js +8 -8
- package/dist/{plugins → stores-sql}/session-policy-store-sql.d.ts +7 -5
- package/dist/{plugins → stores-sql}/session-policy-store-sql.js +12 -12
- package/dist/{plugins → stores-sql}/usage-window-store-sql.d.ts +1 -1
- package/dist/{plugins → stores-sql}/usage-window-store-sql.js +3 -3
- package/dist/task-a2a.d.ts +1 -1
- package/dist/task-a2a.js +5 -6
- package/dist/task-mcp.d.ts +21 -8
- package/dist/task-mcp.js +17 -9
- package/dist/task-settings.d.ts +52 -25
- package/dist/task-settings.js +91 -28
- package/dist/terminal.d.ts +103 -19
- package/dist/terminal.js +72 -20
- package/dist/trace/core-keyset-guard.d.ts +79 -2
- package/dist/trace/exit-seat.d.ts +7 -0
- package/dist/trace/exit-seat.js +1 -0
- package/dist/trace/model-segment.d.ts +2 -2
- package/dist/trace/redact.d.ts +3 -1
- package/dist/trace/redact.js +395 -110
- package/dist/trace/self-minted-wire.d.ts +226 -2
- package/dist/trace/self-minted-wire.js +79 -0
- package/dist/verifier-pause-card.d.ts +8 -0
- package/dist/verifier-pause-card.js +19 -0
- package/dist/web-admin-client/apply-effective.d.ts +5 -7
- package/dist/web-admin-client/apply-effective.js +2 -2
- package/dist/web-admin-client/candidate-gate.d.ts +11 -7
- package/dist/web-admin-client/candidate-gate.js +1 -1
- package/dist/web-admin-client/http-client.d.ts +5 -4
- package/dist/web-admin-client/http-client.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +7 -17
- package/dist/web-admin-client/read-warnings.js +5 -9
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +3 -2
- package/package.json +2 -2
- package/wire-changes/server@7.140.0.json +184 -0
- package/wire-changes/server@7.141.0.json +367 -0
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { type DroppedConfigEntry, type
|
|
1
|
+
import { type DroppedConfigEntry, type UnreadConfigFile, type UnreadConfigKey } from "./web-admin-client/read-warnings.js";
|
|
2
2
|
import { FileConfigStore } from "@sema-agent/settings-schema/node";
|
|
3
|
-
import { type EffectiveConfig as AgentConfigEffective, type EffectiveReadWarning } from "@sema-agent/settings-schema";
|
|
3
|
+
import { type ConfigDocumentRefusal, type EffectiveConfig as AgentConfigEffective, type EffectiveReadWarning } from "@sema-agent/settings-schema";
|
|
4
4
|
import { fetchEffective as remoteFetchEffective, fetchSkillContent as remoteFetchSkillContent, type EffectiveConfig } from "./web-admin-client/facade.js";
|
|
5
5
|
import type { CenterEndpoint } from "./web-admin-client/center-request.js";
|
|
6
6
|
import type { ConfigProviderWord } from "./config-types.js";
|
|
7
7
|
/** Result of a `fetchEffective` — EXACTLY the web-admin's return: the effective config + its etag, or
|
|
8
8
|
* `null` for "unchanged" (remote 304; local: the version matched the caller's prior etag).
|
|
9
|
-
* `domainErrors
|
|
10
|
-
*
|
|
11
|
-
* per-domain warn 点名坏域。gate 域(governance/rosters/…)坏文件 tolerant 仍 throw(READ 容错不放宽
|
|
12
|
-
* gate fail-loud,registry-core 半场精化)——那条路走既有的整包 catch。 */
|
|
9
|
+
* `domainErrors`:某个**读得出**的域判形失败(schema 坏形 / 拼错键 / 悬空引用;那个域已按契约的域档位落缺省或被逐条判过)—— 候选判官以
|
|
10
|
+
* `domain_invalid` 整拒;缺席 = 没有。读不出的**文档**不在这里(见 `refusedDocuments`)。 */
|
|
13
11
|
/** 壳写在 `config.d/models.json` 条目上的装饰键(`sema*`)自 settings-schema 1.5.0 起是**声明过的扩展命名空间**
|
|
14
12
|
* (`EXTENSION_NAMESPACES`):schema 照旧 strip、但不再报「未知键」,所以本函数收到的每一个未知键都是拼错/越界 ⇒ 候选门错误。
|
|
15
13
|
* 此前把这类键当「通知」放行的整套下游机制(域豁免/键路径闭集/满额特判/单独的通知面)已全部撤回——意图在声明处说,消费方不猜。 */
|
|
16
|
-
/** `readWarnings
|
|
14
|
+
/** `readWarnings`:契约读侧告警流的**原值**(未折叠;远程腿 = `readEffectiveWire` 的告警回调,本地腿 = 单读口交成数据的 `warnings`),两条读腿同键同义 —— 读者是一致性门的读腿适配器(它要逐条对契约语料的
|
|
17
15
|
* 告警多重集,折叠后的诊断面带不回 `kind` / 坐标段)。恒在场(空数组 = 这次读零告警),不用缺席表达「没有」
|
|
18
16
|
* ——缺席/空两形并存就是又一处二义。
|
|
19
17
|
* 🔐 原流的 `error` 未经 {@link redactConfigError}(那道脱敏挂在真正进日志流的 `domainErrors` 产出边界上),
|
|
@@ -25,9 +23,10 @@ import type { ConfigProviderWord } from "./config-types.js";
|
|
|
25
23
|
* `effective.models.droppedCatalogEntries`(`GET /v1/models.droppedEntries` 的源,与 `models` 同世代)。 */
|
|
26
24
|
/** `unreadFiles`:`config.d` 里读腿根本不读的文件(不是域 / 不是便携域)—— **不**进候选门(不是读的域判形失败),调用方一份一行
|
|
27
25
|
* `config_unread_file` 点名、其余照用;缺席 = 没有(本地读腿才会有)。 */
|
|
28
|
-
/** `
|
|
29
|
-
*
|
|
30
|
-
* (
|
|
26
|
+
/** `refusedDocuments`:被拒文档 —— 契约的类型 `ConfigDocumentRefusal`(`{ document, reason, error }`,墓碑另带 `migration`;`reason` 是契约闭集
|
|
27
|
+
* `CONFIG_DOCUMENT_REFUSAL_REASONS`:`empty` / `invalid_json` / `not_object` / `io` / `too_deep` 文件层,`retired_domain` 墓碑)。读腿不抛,交成发现,候选判官以发现自带的词整拒这份候选
|
|
28
|
+
* (与域判形失败同一条回落链、同一行拒判);缺席 = 没有。远端腿:wire 上只有墓碑一种,那一键不进 effective、其余域照读、版本照读;本地腿:契约的单读口
|
|
29
|
+
* `FileConfigStore.read()` 交 `refused` ⇒ 被拒文档 = 那一读的拒单原样,什么域内容都没装配 —— 候选是空的 effective(被整拒,不会被应用),版本 = 那一读的契约版本(按文档内容寻址)。 */
|
|
31
30
|
/** `unreadKeys`:本地读腿读了那份文件、却结构上不读其中一键(`prompts.json` 的 `workers`)—— 同 `unreadFiles`,不进候选门,调用方一键一行 `config_unread_key`。 */
|
|
32
31
|
export type FetchEffectiveResult = {
|
|
33
32
|
effective: EffectiveConfig;
|
|
@@ -39,7 +38,7 @@ export type FetchEffectiveResult = {
|
|
|
39
38
|
droppedEntries?: DroppedConfigEntry[];
|
|
40
39
|
unreadFiles?: UnreadConfigFile[];
|
|
41
40
|
unreadKeys?: UnreadConfigKey[];
|
|
42
|
-
|
|
41
|
+
refusedDocuments?: ConfigDocumentRefusal[];
|
|
43
42
|
readWarnings: readonly EffectiveReadWarning[];
|
|
44
43
|
credentialIdentity?: string;
|
|
45
44
|
} | null;
|
|
@@ -154,21 +153,23 @@ export declare class RemoteConfigProvider implements ConfigProvider {
|
|
|
154
153
|
fetchSkillContent(contentHash: string): Promise<string | undefined>;
|
|
155
154
|
}
|
|
156
155
|
/**
|
|
157
|
-
* LocalConfigProvider — reads the SAME config contract from disk via `FileConfigStore
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* version as the etag (so the caller's "skip re-apply
|
|
156
|
+
* LocalConfigProvider — reads the SAME config contract from disk via `FileConfigStore`'s one read port `read()`:
|
|
157
|
+
* either the registry `EffectiveConfig` (all domains, defaults filled) with its content version, or the refusal
|
|
158
|
+
* list of the documents the file layer refused, with the version of that same read. We map the effective config down
|
|
159
|
+
* to the service-local `EffectiveConfig` shape and surface the version as the etag (so the caller's "skip re-apply
|
|
160
|
+
* if etag unchanged" works locally too).
|
|
161
161
|
*/
|
|
162
|
+
/** 本地读腿对契约文件店只有一种读法 —— 单读口 `read()`(一次读整棵 `config.d`,交一个结局)。注入缝(测试)按这一形给;严读 / 容错档位不在这条腿的类型里。 */
|
|
163
|
+
export type LocalConfigReader = Pick<FileConfigStore, "read">;
|
|
162
164
|
export declare class LocalConfigProvider implements ConfigProvider {
|
|
163
165
|
#private;
|
|
164
166
|
readonly kind: "local";
|
|
165
167
|
/** 本地配置源不留正文盘缓存:正文就内联在 config.d 里(同一块盘),缓存它是第二份真源。 */
|
|
166
168
|
readonly skillBodyCacheDir: undefined;
|
|
167
|
-
private readonly store;
|
|
168
169
|
/** [ref]b 可观测性:config_loaded 日志要能回答「到底读的哪个目录」——复验实录:只设 LOCAL_DATA_ROOT 时
|
|
169
170
|
* config.d 静默读不到且 0 模型无告警(CONFIG_LOCAL_DIR 才是本 lane 的选目录旋钮)。 */
|
|
170
171
|
readonly root: string;
|
|
171
|
-
constructor(root: string, store?:
|
|
172
|
+
constructor(root: string, store?: LocalConfigReader, trust?: {
|
|
172
173
|
readonly declaredOwnerUid: number | undefined;
|
|
173
174
|
});
|
|
174
175
|
fetchEffective(etag: string | undefined): Promise<FetchEffectiveResult>;
|
package/dist/config-provider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readMcpSourceLabel } from "./mcp-source-label.js";
|
|
2
2
|
import { createHmac, randomBytes } from "node:crypto";
|
|
3
|
-
import {
|
|
3
|
+
import { splitFoldedReadWarnings, withDroppedCatalogEntries } from "./web-admin-client/read-warnings.js";
|
|
4
4
|
import { FileConfigStore } from "@sema-agent/settings-schema/node";
|
|
5
5
|
import { assertLocalConfigDirTrusted } from "./config-dir-trust.js";
|
|
6
6
|
import { danglingRefs, emptyEffective, findSkillContent, promptArtifactFor, renderRefIssue, skillContentHash, } from "@sema-agent/settings-schema";
|
|
@@ -25,7 +25,9 @@ export function redactConfigError(text) {
|
|
|
25
25
|
export function fingerprintConfigOperand(operand) {
|
|
26
26
|
return `#${createHmac("sha256", OPERAND_FINGERPRINT_KEY).update(operand).digest("hex").slice(0, 8)}`;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const redactContractSentence = (text) => redactSecrets(text);
|
|
29
|
+
const redactDroppedEntry = (d) => ({ ...d, error: redactContractSentence(d.error) });
|
|
30
|
+
const redactRefusedDocument = (d) => ({ ...d, error: redactContractSentence(d.error) });
|
|
29
31
|
export const BOOT_FETCH_DEFERRED = Symbol("boot-fetch-deferred");
|
|
30
32
|
export function raceBootFetch(fetch, budgetMs) {
|
|
31
33
|
if (budgetMs <= 0)
|
|
@@ -50,12 +52,13 @@ export class RemoteConfigProvider {
|
|
|
50
52
|
async fetchEffective(etag) {
|
|
51
53
|
const fn = this.deps.fetchEffective ?? remoteFetchEffective;
|
|
52
54
|
const r = await fn(this.cc, etag, undefined, this.cc.worker);
|
|
53
|
-
if (r === null || (r.domainErrors === undefined && r.droppedEntries === undefined))
|
|
55
|
+
if (r === null || (r.domainErrors === undefined && r.droppedEntries === undefined && r.refusedDocuments === undefined))
|
|
54
56
|
return r;
|
|
55
57
|
return {
|
|
56
58
|
...r,
|
|
57
59
|
...(r.domainErrors !== undefined ? { domainErrors: r.domainErrors.map((de) => ({ domain: de.domain, error: redactConfigError(de.error) })) } : {}),
|
|
58
60
|
...(r.droppedEntries !== undefined ? { droppedEntries: r.droppedEntries.map(redactDroppedEntry) } : {}),
|
|
61
|
+
...(r.refusedDocuments !== undefined ? { refusedDocuments: r.refusedDocuments.map(redactRefusedDocument) } : {}),
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
async fetchSkillContent(contentHash) {
|
|
@@ -74,43 +77,31 @@ export class LocalConfigProvider {
|
|
|
74
77
|
kind = "local";
|
|
75
78
|
skillBodyCacheDir = undefined;
|
|
76
79
|
#servedSkills = { skills: [] };
|
|
77
|
-
store;
|
|
78
80
|
root;
|
|
79
|
-
#
|
|
81
|
+
#store;
|
|
80
82
|
#declaredOwnerUid;
|
|
81
83
|
constructor(root, store, trust = { declaredOwnerUid: undefined }) {
|
|
82
84
|
this.root = root;
|
|
83
|
-
this.#
|
|
84
|
-
this.store = store ?? new FileConfigStore(root);
|
|
85
|
+
this.#store = store ?? new FileConfigStore(root);
|
|
85
86
|
this.#declaredOwnerUid = trust.declaredOwnerUid;
|
|
86
87
|
}
|
|
87
88
|
async fetchEffective(etag) {
|
|
88
89
|
await assertLocalConfigDirTrusted({ root: this.root, declaredOwnerUid: this.#declaredOwnerUid });
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
new FileConfigStore(this.root, {
|
|
92
|
-
onWarning: (w) => {
|
|
93
|
-
readWarnings.push(w);
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
let read;
|
|
97
|
-
let retired;
|
|
98
|
-
try {
|
|
99
|
-
read = await store.getEffective({ tolerant: true });
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
retired = retiredDomainFindingOf(e);
|
|
103
|
-
if (retired === undefined)
|
|
104
|
-
throw e;
|
|
105
|
-
const version = await store.getVersion().catch(() => {
|
|
106
|
-
throw e;
|
|
107
|
-
});
|
|
108
|
-
read = { effective: { ...emptyEffective(), version }, domainErrors: [] };
|
|
109
|
-
}
|
|
110
|
-
const { effective: eff, domainErrors } = read;
|
|
111
|
-
const tag = String(eff.version);
|
|
90
|
+
const read = await this.#store.read();
|
|
91
|
+
const tag = String(read.kind === "refused" ? read.version : read.effective.version);
|
|
112
92
|
if (etag !== undefined && etag === tag)
|
|
113
93
|
return null;
|
|
94
|
+
const readWarnings = [...read.warnings];
|
|
95
|
+
const folded = splitFoldedReadWarnings(readWarnings, "local");
|
|
96
|
+
const faces = read.kind === "refused" ? refusedFaces(read) : this.#effectiveFaces(read.effective, folded);
|
|
97
|
+
return {
|
|
98
|
+
...faces,
|
|
99
|
+
etag: tag,
|
|
100
|
+
readWarnings,
|
|
101
|
+
...(folded.unreadFiles.length > 0 ? { unreadFiles: folded.unreadFiles } : {}),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
#effectiveFaces(eff, folded) {
|
|
114
105
|
const refErrors = [];
|
|
115
106
|
const byReferrer = new Map();
|
|
116
107
|
for (const issue of danglingRefs(eff)) {
|
|
@@ -120,27 +111,28 @@ export class LocalConfigProvider {
|
|
|
120
111
|
}
|
|
121
112
|
for (const [domain, rows] of byReferrer)
|
|
122
113
|
refErrors.push({ domain, error: rows.join("; ") });
|
|
123
|
-
const folded = splitFoldedReadWarnings(readWarnings, "local");
|
|
124
114
|
const parseErrors = folded.domainErrors.map((w) => ({ domain: w.domain, error: redactConfigError(w.error) }));
|
|
125
115
|
const droppedEntries = folded.droppedEntries.map(redactDroppedEntry);
|
|
126
|
-
const errors = [...
|
|
116
|
+
const errors = [...parseErrors, ...refErrors];
|
|
127
117
|
this.#servedSkills = eff.skills;
|
|
128
118
|
const unreadKeys = localUnreadPromptKeys(eff.prompts);
|
|
129
119
|
return {
|
|
130
120
|
effective: withDroppedCatalogEntries(mapToServiceEffective(eff, eff.version), folded.droppedCatalogEntries),
|
|
131
|
-
etag: tag,
|
|
132
|
-
readWarnings,
|
|
133
121
|
...(errors.length > 0 ? { domainErrors: errors } : {}),
|
|
134
122
|
...(droppedEntries.length > 0 ? { droppedEntries } : {}),
|
|
135
|
-
...(folded.unreadFiles.length > 0 ? { unreadFiles: folded.unreadFiles } : {}),
|
|
136
123
|
...(unreadKeys.length > 0 ? { unreadKeys } : {}),
|
|
137
|
-
...(retired !== undefined ? { retiredDomains: [retired] } : {}),
|
|
138
124
|
};
|
|
139
125
|
}
|
|
140
126
|
async fetchSkillContent(contentHash) {
|
|
141
127
|
return findSkillContent(this.#servedSkills, contentHash);
|
|
142
128
|
}
|
|
143
129
|
}
|
|
130
|
+
function refusedFaces(read) {
|
|
131
|
+
return {
|
|
132
|
+
effective: mapToServiceEffective({ ...emptyEffective(), version: read.version }, read.version),
|
|
133
|
+
refusedDocuments: read.refusals.map(redactRefusedDocument),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
144
136
|
function localUnreadPromptKeys(prompts) {
|
|
145
137
|
const names = prompts?.workers === undefined ? [] : Object.keys(prompts.workers);
|
|
146
138
|
return names.length === 0 ? [] : [{ file: "prompts.json", domain: "prompts", key: "workers", names }];
|
package/dist/config-types.d.ts
CHANGED
|
@@ -150,6 +150,17 @@ export declare const FIRST_BYTE_TIMEOUT_BOUNDS: {
|
|
|
150
150
|
readonly minMs: 0;
|
|
151
151
|
readonly maxMs: 2147483647;
|
|
152
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* device 车道的设备入口声明(`DEVICE_RELAY_URL` 的两种合法值;值文法与字面 `none` 归契约包 `deviceRelayFlaws` / `DEVICE_RELAY_NONE`;字段注见 `remoteExec` device 臂的 `relay`):
|
|
155
|
+
* 中继地址,或字面 `none` = 没有中继、设备拨本引擎自己的地址。「没写」不是第三种值 —— 车道表 device 行的必需键,缺席 / 空白在配置期就被车道必需 env 门拒
|
|
156
|
+
* (缺席曾被读成直拨,撤声明时把已绑设备困在一个拨不到的入口上)。
|
|
157
|
+
*/
|
|
158
|
+
export type DeviceRelayDeclaration = {
|
|
159
|
+
readonly kind: "url";
|
|
160
|
+
readonly url: string;
|
|
161
|
+
} | {
|
|
162
|
+
readonly kind: "none";
|
|
163
|
+
};
|
|
153
164
|
/**
|
|
154
165
|
* 整数合法域(闭区间)的**一种说法**:device 车道的数值旋钮(`DEVICE_RECONNECT_GRACE_MS` / `DEVICE_MAX_INFLIGHT_PER_DEVICE` /
|
|
155
166
|
* `DEVICE_DELIVERY_TIMEOUT_MS` / `DEVICE_EXEC_TIMEOUT_MS`)、汇聚端创建时对 helloAck 六个数值位的校验、协议文档与配置目录的合法域句,
|
|
@@ -722,7 +733,7 @@ export interface ServiceConfigFlat {
|
|
|
722
733
|
* 引擎却仍可能把别处落进记忆根的字节收进这次会话的账。
|
|
723
734
|
* ⚠️ **这一层的射程 = file 记忆引擎**(`MEMORY_ENGINE_BACKEND` 未设的默认单机形):受限视图是
|
|
724
735
|
* `FileMemoryEngineBackend.restrictedAdoptionView` 的实装,而 `engine.materialize` 取它走的是
|
|
725
|
-
* `?? this.backend` 的**可选** seam。我方 pg/
|
|
736
|
+
* `?? this.backend` 的**可选** seam。我方 pg/mysql 两只记忆后端没有实装、也不需要——它们的读侧走库,
|
|
726
737
|
* 盘上目录只是每任务的投影工作区,没有「读磁盘即收编」这条通道。`false` 在 DB 后端上仍照常买到
|
|
727
738
|
* 披露 / 写门 / 零收编 harvest 三件(引擎级,与后端无关)。
|
|
728
739
|
*
|
|
@@ -741,7 +752,7 @@ export interface ServiceConfigFlat {
|
|
|
741
752
|
* undefined=纯本地现状零变化)/`MEMORY_SYNC_TOKEN`(Bearer)/`MEMORY_SYNC_SCOPE`(可选,缺省 =
|
|
742
753
|
* memoryScope 本身**仅当它已是 v2 typed key**;非 typed 键 ⇒ 拒启,[ref] —— 旧 formatUserScope 派生臂铸出的是本部署
|
|
743
754
|
* 从不写的层,见 loadConfig)。半配置 fail-loud
|
|
744
|
-
* (memoryEngineBackend 同款姿势);DB backend(pg/
|
|
755
|
+
* (memoryEngineBackend 同款姿势);DB backend(pg/mysql)配了这些键=boot throw(中心侧自己就是
|
|
745
756
|
* 同步权威,不该再跑 client 腿)。 */
|
|
746
757
|
memorySync?: {
|
|
747
758
|
url: string;
|
|
@@ -766,7 +777,7 @@ export interface ServiceConfigFlat {
|
|
|
766
777
|
* 不匹配的行只是悄悄退回词面档),只会让「向量面开着」这句话变成谎。所以坏 DIM(非正整数)在
|
|
767
778
|
* boot 期拒;运行期真维度不符(模型换了 / 端点指错)由 embedder 自己抛,绝不截断补零。
|
|
768
779
|
*
|
|
769
|
-
* ⚠️ 后端门:只有 `MEMORY_ENGINE_BACKEND=pg` 收这几键 ——
|
|
780
|
+
* ⚠️ 后端门:只有 `MEMORY_ENGINE_BACKEND=pg` 收这几键 —— mysql 记忆后端 v1 无向量档(传 embedder
|
|
770
781
|
* 它自己就 fail-loud 拒),file 引擎压根没有 embedder 接缝。配错后端 = 拒启点名。 */
|
|
771
782
|
memoryEmbedder?: MemoryEmbedderConfig;
|
|
772
783
|
/** [ref] 件A(clay 三裁 [ref]):org 记忆准入模式。`enforce`(默认)=判决即结果;`audit`=判决
|
|
@@ -891,7 +902,9 @@ export interface ServiceConfigFlat {
|
|
|
891
902
|
* 跑在哪个用户的 home 下」)。显式声明**恒赢**;缺席时只有 home 属于车道本身的那几条车道有答案
|
|
892
903
|
* (host/in-process = `os.homedir()`、e2b = 平台固定用户),k8s/local-docker(镜像属性)、
|
|
893
904
|
* ssh(目标机登录用户)、adb/device 一律缺席 ⇒ `~/` 规则在下单时被 422 响亮拒。
|
|
894
|
-
*
|
|
905
|
+
* 声明与出厂答案都只是**主张**:读得出家目录的车道(device 之外的六条)在每只执行环境开起来时拿环境里命令看到的 `$HOME` 证它,
|
|
906
|
+
* 不一致 / 读不出 ⇒ 那只环境不开(拒句点名两值与改法);device 读不了 ⇒ 声明即座,起服披露「来自声明、未实测」。
|
|
907
|
+
* 派生与逐车道理由的**单一属主** = `execution-lane-caps.ts` 的 `executionLaneHomeDir` / `buildLaneHomeClaim`。
|
|
895
908
|
* 非绝对路径 ⇒ **拒启**([ref] A 档;core 侧同判为 `config.execution_env_home_dir_invalid`)。
|
|
896
909
|
*/
|
|
897
910
|
remoteExecHomeDir?: string;
|
|
@@ -1025,11 +1038,14 @@ export interface ServiceConfigFlat {
|
|
|
1025
1038
|
* 域 = `[1, 86400]` 的十进制正整数,坏值**拒启**([ref] A 档;解析器 `parseDeviceEnrollTokenTtlEnv`)。
|
|
1026
1039
|
* 缺席 ⇒ 签发点的属主默认 900(不在 config 层抄第二份默认,与本族其余旋钮同姿势)。 */
|
|
1027
1040
|
enrollTokenTtlSec?: number;
|
|
1028
|
-
/** `DEVICE_RELAY_URL` =
|
|
1029
|
-
* `
|
|
1041
|
+
/** `DEVICE_RELAY_URL` = 设备入口的运维声明,**必填**(缺席 / 空串 ⇒ 配置期拒起;解析器 `parseDeviceRelayUrlEnv`):
|
|
1042
|
+
* `{ kind: "url" }` = 设备连不到本引擎自己的地址(引擎在中继 / 网关之后)时该拨的那一个 ws(s) URL,**逐字**上能力面 `deviceExecutor.relayUrl`
|
|
1043
|
+
* (唯一消费点 `http/routes/capabilities.ts`);`{ kind: "none" }`(字面 `none`)= 没有中继,设备按本引擎地址 + `deviceExecutor.wsPath` 拨号,能力面不带 `relayUrl`。
|
|
1044
|
+
* 必填的理由:「设备拨哪里」只有运维知道;缺席曾被读成「直拨」,于是撤掉中继声明而根会话行上还有设备绑定时,设备改拨引擎地址(入口已收窄则拨不到)、
|
|
1045
|
+
* 绑定却留在格上 —— 缺席与「声明了直拨」是两件事,只有后者放行。`none` ∧ 有绑定 ⇒ 起服 warn 点名绑定数(`boot/device-lane.ts`)。
|
|
1030
1046
|
* **不派生**:`FLEET_ADVERTISE_ADDRESS` 是对中心公告的地址(内网 pod IP / 容器别名),受众不是用户机器上的设备;从它拼出来的入口对设备多半不可达。
|
|
1031
|
-
* 形门 = ws / wss 绝对地址,无 userinfo / query / fragment、不带凭据形(值逐字上能力面)
|
|
1032
|
-
|
|
1047
|
+
* URL 形门 = ws / wss 绝对地址,无 userinfo / query / fragment、不带凭据形(值逐字上能力面),坏值**拒启**。 */
|
|
1048
|
+
relay: DeviceRelayDeclaration;
|
|
1033
1049
|
/** `DEVICE_SUPERSEDE`(默认 `stale_only`)= 同 deviceId 二连的顶替策略(§5.2)。 */
|
|
1034
1050
|
supersede?: "stale_only" | "deny";
|
|
1035
1051
|
} | {
|
|
@@ -2118,6 +2134,17 @@ export interface ServiceConfigFlat {
|
|
|
2118
2134
|
* `READ_DENY_BUILTIN_EXCLUDE`=逗号分隔;不在表里的行名 / 空串**启动期响亮拒**。
|
|
2119
2135
|
* 🔴 不变量(判据帖 G5b):删内建**绝不**削弱任务自己显式声明的 deny —— 那是另一层(additions)。 */
|
|
2120
2136
|
readDenyBuiltinExclude?: readonly string[];
|
|
2137
|
+
/** 部署**要不要求**读拒表的字节地板(`READ_DENY_FLOOR_REQUIRED`,布尔,缺省 false)—— 交引擎 `RunnerDeps.readDenyFloorRequired`
|
|
2138
|
+
* (部署姿态座席族的一席,唯一取值点 `buildDeploymentPostureSeats`)。判官是引擎:一个 run 的读拒表有行、而它的执行环境块
|
|
2139
|
+
* `keepsReadFloor` 不为真时 —— true ⇒ 准备期拒(`config.read_deny_floor_unkept`,一个命令都不起;同步腿 409);false ⇒ run 照跑,
|
|
2140
|
+
* 每 run 一条 operator 通告同码(递归读照读表里的文件,通告不是保护)。出厂读拒档(credentials / agent-config)在岗时每条带手 run 的表都有行;
|
|
2141
|
+
* 本仓七车道的块今天都不守地板 ⇒ 设 true 的部署上带手 run 一律拒起(起服 warn `read_deny_floor_required_unkept` 先说)。
|
|
2142
|
+
* **仅 deployment 席**:TaskSpec 上没有同名键,任务无法放宽自己的部署。 */
|
|
2143
|
+
readDenyFloorRequired: boolean;
|
|
2144
|
+
/** `SANDBOX_READ_FLOOR`(闭集 `keep | off`,缺省 `keep`;闭集 / 缺省 / 派生的属主 `execution-lane-caps.ts`):沙箱三车道(e2b / k8s / local-docker)守不守读拒表的
|
|
2145
|
+
* 字节地板 = 沙箱读地板模块服务这条车道 ∧ 本键不是 `off`。车道块 `keepsReadFloor`(`capabilitiesFor`)与适配器手里的模块同读这一只判据;别的车道上本键无作用
|
|
2146
|
+
* (那些环境约束不了进程,恒不守)。部署级一键、不挂车道臂:`config.d/remote-exec.json` 换出的车道同样读它。 */
|
|
2147
|
+
sandboxReadFloor: import("./execution-lane-caps.js").SandboxReadFloorKnob;
|
|
2121
2148
|
/** core 7.46.0 [ref]:部署**声明**的配置根(`SEMA_CONFIG_DIR`,绝对路径;起服的供给动作建出目录,能不能用由引擎判)—— 交引擎 `RunnerDeps.agentConfigDir`
|
|
2122
2149
|
* 与守卫集 `createSensitivePathPolicy` 的同名入参:内建读拒表里以 `.sema` 开头的行在这个根下同样拒,写进根下要问一次。缺席 = 没声明
|
|
2123
2150
|
* ⇒ 引擎读字面 `~/.sema`(与 LKG / skill 缓存 / scheduler 店的缺省落点同一处)。读法单一属主 `sema-config-dir.ts`。 */
|
|
@@ -2301,7 +2328,7 @@ export type ServiceMemoryConfig = Pick<ServiceConfigFlat, "memoryEngineEnabled"
|
|
|
2301
2328
|
* config 这一层它只是一句声明。 */
|
|
2302
2329
|
export type ServiceAuthConfig = Pick<ServiceConfigFlat, "authToken" | "authTokens" | "allowUnauthedWrites" | "corsOrigins" | "principalHeader" | "requirePrincipal" | "autonomy" | "commandPolicy" | "compliancePosture" | "lockedConfigKeys" | "configCatalogEnabled" | "retentionPolicy" | "retentionSweep" | "operatorPrincipals" | "operatorSingleUser" | "principalJwtPubkeys" | "principalJwtIss" | "principalJwtAud" | "authBridgeIssuer" | "principalJwtMaxTtlSec" | "bindHost" | "bindHostSource">;
|
|
2303
2330
|
/** 组:orchestration(编排 + 执行车道 + 沙箱面 + workflow/后台 agent 存留)。 */
|
|
2304
|
-
export type ServiceOrchestrationConfig = Pick<ServiceConfigFlat, "remoteExec" | "remoteExecHomeDir" | "requireExecutionLane" | "worktreeIsolation" | "leaderEnabled" | "leaderFanoutEnabled" | "routerEnabled" | "selfOrchestrationEnabled" | "selfOrchestrationModels" | "selfOrchestrationWorkerIsolation" | "forkEnabled" | "experimentalObserverAgents" | "schedulerEnabled" | "schedulerSessionWakeup" | "schedulerSessionLifetime" | "schedulerStorePath" | "planModeEnabled" | "hooksTimeoutMs" | "workflowRunStoreBackend" | "workflowOrphanGraceMs" | "workflowJournalRetentionMs" | "workflowRunRetentionMs" | "usageWindows" | "workflowAgentsReadOnly" | "workflowSizeGuideline" | "backgroundAgentRetentionMs" | "backgroundAgentStaleRunningMs" | "backgroundAgentParkClaimStaleMs" | "delegationEntryCaps" | "rosterRetentionMs" | "leaderRunStaleMs" | "scratchpadSweepTtlMs" | "sandboxPkgSource" | "sandboxPkgSourceCustom" | "sessionAutoTitle" | "sessionAutoTitleSource" | "selectEnvironmentTool" | "envFactsEnabled" | "toolDeferLongtail" | "lspEnabled" | "lspHostEnabled" | "lspEnvAllow" | "imageBakes" | "readFace" | "readFaceSource" | "taskWriteFaceEscalation" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "agentConfigDir" | "configLkgPath" | "configLkgEnabled">;
|
|
2331
|
+
export type ServiceOrchestrationConfig = Pick<ServiceConfigFlat, "remoteExec" | "remoteExecHomeDir" | "requireExecutionLane" | "worktreeIsolation" | "leaderEnabled" | "leaderFanoutEnabled" | "routerEnabled" | "selfOrchestrationEnabled" | "selfOrchestrationModels" | "selfOrchestrationWorkerIsolation" | "forkEnabled" | "experimentalObserverAgents" | "schedulerEnabled" | "schedulerSessionWakeup" | "schedulerSessionLifetime" | "schedulerStorePath" | "planModeEnabled" | "hooksTimeoutMs" | "workflowRunStoreBackend" | "workflowOrphanGraceMs" | "workflowJournalRetentionMs" | "workflowRunRetentionMs" | "usageWindows" | "workflowAgentsReadOnly" | "workflowSizeGuideline" | "backgroundAgentRetentionMs" | "backgroundAgentStaleRunningMs" | "backgroundAgentParkClaimStaleMs" | "delegationEntryCaps" | "rosterRetentionMs" | "leaderRunStaleMs" | "scratchpadSweepTtlMs" | "sandboxPkgSource" | "sandboxPkgSourceCustom" | "sessionAutoTitle" | "sessionAutoTitleSource" | "selectEnvironmentTool" | "envFactsEnabled" | "toolDeferLongtail" | "lspEnabled" | "lspHostEnabled" | "lspEnvAllow" | "imageBakes" | "readFace" | "readFaceSource" | "taskWriteFaceEscalation" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "readDenyFloorRequired" | "sandboxReadFloor" | "agentConfigDir" | "configLkgPath" | "configLkgEnabled">;
|
|
2305
2332
|
/** 组:limitsHttp(HTTP 面 + 各类上限/配额/回收窗)。 */
|
|
2306
2333
|
export type ServiceLimitsHttpConfig = Pick<ServiceConfigFlat, "port" | "attachmentOrphanGraceMs" | "workspaceFileMaxBytes" | "attachmentMaxBytes" | "attachmentMimeAllowlist" | "attachmentUnboundTtlMs" | "infraCostRates" | "drainGraceMs" | "drainSecondSignalMinGapMs" | "sighupIdleGraceMs" | "parentPid" | "engineAutoExit" | "engineLingerMs" | "engineOrphanLingerMs" | "rateLimitPerMin" | "maxTaskCostUsd" | "maxTaskTokens" | "maxPrincipalCostUsd" | "costQuotaWindowSec" | "reapIntervalSec" | "runStaleSec" | "toolResultTtlSec">;
|
|
2307
2334
|
/** 组:observability(可观测)。 */
|
package/dist/config.js
CHANGED
|
@@ -36,7 +36,8 @@ import { laneLivenessOf } from "./exec-bounds.js";
|
|
|
36
36
|
import { SANDBOX_IPV6_DEFAULT, SANDBOX_IPV6_WORDS } from "./sandbox-egress-policy.js";
|
|
37
37
|
import { WORKSPACE_CACHE_DEFAULT, WORKSPACE_CACHE_MOUNT_DEFAULT, WORKSPACE_CACHE_MOUNT_RESERVED, WORKSPACE_CACHE_SIZE_DEFAULT, WORKSPACE_CACHE_WORDS, isK8sQuantity, mountsOverlap, reservedMountCollision } from "./workspace-cache.js";
|
|
38
38
|
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
39
|
-
import {
|
|
39
|
+
import { sandboxForwardedEnvOf } from "./execution-config-root.js";
|
|
40
|
+
import { SANDBOX_READ_FLOOR_DEFAULT, SANDBOX_READ_FLOOR_WORDS, executionLaneOf, executionLaneRequiredRefusal, laneMissingEnv, readDeclaredLaneTable } from "./execution-lane-caps.js";
|
|
40
41
|
import { MEMORY_ENGINE_BACKENDS, SESSION_BACKENDS, STORE_BACKENDS } from "@sema-agent/settings-schema/execution-lanes";
|
|
41
42
|
import { AUTONOMY_MODES } from "./runtime-governance.js";
|
|
42
43
|
import { MAX_NAMED_INERT_ENTRIES, allowLayerEntryCountIssue, describeInertRuleEntries, inertRuleEntriesOf, inertRuleEntryGuidance, ruleEntryListShapeOk } from "./rule-entry-list.js";
|
|
@@ -45,7 +46,7 @@ import { createCenterCredentialSource, readCenterCredentialDeclaration } from ".
|
|
|
45
46
|
import { parseCenterCredentialRenewLeadMs } from "./center-credential-renewer.js";
|
|
46
47
|
import { modelProviderRefusal } from "./model-provider.js";
|
|
47
48
|
import { modelRouteUrlRefusal } from "./model-route-url.js";
|
|
48
|
-
import { httpUrlFlaws } from "@sema-agent/settings-schema";
|
|
49
|
+
import { DEVICE_RELAY_NONE, DEVICE_RELAY_RULE, deviceRelayFlaws, httpUrlFlaws } from "@sema-agent/settings-schema";
|
|
49
50
|
import { buildHttpUrlRefusal, buildRefusalShownUrl } from "./url-refusal.js";
|
|
50
51
|
import { customPkgSourceFromEnv } from "./sandbox-pkg-source.js";
|
|
51
52
|
import { anthropicCredentialRefusal, csvOf, declaredCredential, envLaneTable, mintedCheapId, readModelRouteEnv } from "./model-route-gap.js";
|
|
@@ -57,6 +58,7 @@ import { allowlistedEnv } from "./server-secret-env.js";
|
|
|
57
58
|
import { ENV_NAME_ALLOWLIST_KNOBS, ENV_NAME_ALLOWLIST_KNOB_NAMES, describeAllowlistPostures } from "./env-name-allowlist-knobs.js";
|
|
58
59
|
import { APPROVAL_ASK_RETENTION_DEFAULT_MS, APPROVAL_ASK_RETENTION_FLOOR_MS } from "./approval-ask-retention.js";
|
|
59
60
|
import { parseModsDeclaration } from "./mods-declaration.js";
|
|
61
|
+
import { buildDeclaredEngineWithoutCoordinatesRefusal, missingSqlCoordinateKeys } from "./sql-engine-coordinates.js";
|
|
60
62
|
export { RETENTION_MODES, MEMORY_CONSOLIDATION_MIN_INTERVAL_SEC } from "./config-types.js";
|
|
61
63
|
function csv(name) {
|
|
62
64
|
return csvOf(process.env[name]);
|
|
@@ -378,17 +380,16 @@ function credentialLawRewriteOf(href) {
|
|
|
378
380
|
const scanned = redactSecrets(href);
|
|
379
381
|
return scanned === href ? undefined : scanned;
|
|
380
382
|
}
|
|
381
|
-
function parseDeviceRelayUrlEnv() {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
const flaws =
|
|
383
|
+
function parseDeviceRelayUrlEnv(raw) {
|
|
384
|
+
if (raw === undefined) {
|
|
385
|
+
throw new Error("internal: the device lane was assembled without DEVICE_RELAY_URL — the lane's required-env gate must refuse this first (the settings-schema lane table lists DEVICE_RELAY_URL as required for device)");
|
|
386
|
+
}
|
|
387
|
+
if (raw === DEVICE_RELAY_NONE)
|
|
388
|
+
return { kind: "none" };
|
|
389
|
+
const flaws = deviceRelayFlaws(raw);
|
|
388
390
|
if (flaws.length > 0) {
|
|
389
|
-
throw new Error(`env DEVICE_RELAY_URL
|
|
390
|
-
`
|
|
391
|
-
`Leave it unset when devices reach this engine at its own address — they then dial it at deviceExecutor.wsPath.`);
|
|
391
|
+
throw new Error(`env DEVICE_RELAY_URL ${DEVICE_RELAY_RULE} — found: ${flaws.join(", ")}; got ${JSON.stringify(buildRefusalShownUrl(raw))}. ` +
|
|
392
|
+
`A URL has no room for credentials (devices authenticate by signature). Set it to "${DEVICE_RELAY_NONE}" when devices reach this engine at its own address — they then dial it at deviceExecutor.wsPath.`);
|
|
392
393
|
}
|
|
393
394
|
const href = new URL(raw).href;
|
|
394
395
|
const credentialScan = credentialLawRewriteOf(href);
|
|
@@ -396,7 +397,26 @@ function parseDeviceRelayUrlEnv() {
|
|
|
396
397
|
throw new Error(`env DEVICE_RELAY_URL carries something the credential-redaction law recognizes (${credentialScan}) — it is published verbatim on GET /v1/capabilities (deviceExecutor.relayUrl), ` +
|
|
397
398
|
`so it must not carry a token-shaped path segment; keep it to ws(s)://host[:port][/path] (devices authenticate by signature, not by the URL).`);
|
|
398
399
|
}
|
|
399
|
-
return raw;
|
|
400
|
+
return { kind: "url", url: raw };
|
|
401
|
+
}
|
|
402
|
+
function declaredExecutionLane(raw) {
|
|
403
|
+
if (raw === undefined || raw === "")
|
|
404
|
+
return undefined;
|
|
405
|
+
const table = readDeclaredLaneTable(raw);
|
|
406
|
+
if ("refusal" in table)
|
|
407
|
+
throw new Error(table.refusal);
|
|
408
|
+
const [lane, ...rest] = table.lanes;
|
|
409
|
+
if (rest.length > 0) {
|
|
410
|
+
throw new Error(`REMOTE_EXEC="${raw}" declares ${table.lanes.length} execution lanes (${table.lanes.join(", ")}; the first is the default) — this engine wires exactly one execution lane per process, ` +
|
|
411
|
+
`so ${rest.join(", ")} would never run anything while the deployment declares ${rest.length === 1 ? "it" : "them"}. ` +
|
|
412
|
+
`Refusing to start rather than serving "${lane}" alone: declare one lane per engine (REMOTE_EXEC=${lane}) and run a separate engine for each further lane.`);
|
|
413
|
+
}
|
|
414
|
+
const missing = laneMissingEnv(lane, process.env);
|
|
415
|
+
if (missing.length > 0) {
|
|
416
|
+
throw new Error(`REMOTE_EXEC=${lane} but required env ${missing.join(", ")} ${missing.length === 1 ? "is" : "are"} unset, empty or whitespace-only — it counts as absent: ` +
|
|
417
|
+
`refusing to start rather than silently downgrading to the host/in-process lane (#157; set ${missing.length === 1 ? "it" : "them"}, or unset REMOTE_EXEC if you meant no sandbox lane).`);
|
|
418
|
+
}
|
|
419
|
+
return lane;
|
|
400
420
|
}
|
|
401
421
|
function parseDevicePreAuthPerRemoteEnv() {
|
|
402
422
|
const raw = process.env.DEVICE_MAX_PREAUTH_PER_REMOTE;
|
|
@@ -515,17 +535,16 @@ const OWN_CREDENTIAL_HANDOFF = {
|
|
|
515
535
|
"sandbox-grant": { where: "a sandbox list puts the named variable, as written, into a sandbox the model can read", whom: "the sandbox" },
|
|
516
536
|
};
|
|
517
537
|
function ownCredentialNameProblem(name, channel) {
|
|
518
|
-
|
|
519
|
-
if (engine === undefined)
|
|
538
|
+
if (inheritEnvPolicyProblem([name]) === undefined)
|
|
520
539
|
return undefined;
|
|
521
540
|
const { where, whom } = OWN_CREDENTIAL_HANDOFF[channel];
|
|
522
|
-
return `this deployment's own credential — ${where}; give ${whom} a credential of its own (another name and another value) and list that name instead (the engine refuses it on any allow list
|
|
541
|
+
return `this deployment's own credential — ${where}; give ${whom} a credential of its own (another name and another value) and list that name instead (the engine refuses it on any allow list)`;
|
|
523
542
|
}
|
|
524
543
|
const NAMES_IN_FORCE = {
|
|
525
544
|
LSP_ENV_ALLOW: (c) => c.lspEnvAllow,
|
|
526
|
-
E2B_SANDBOX_ENV: (c) => (c.remoteExec?.provider === "e2b" ? Object.keys(c
|
|
527
|
-
K8S_SANDBOX_ENV: (c) => (c.remoteExec?.provider === "k8s" ? Object.keys(c
|
|
528
|
-
DOCKER_SANDBOX_ENV: (c) => (c.remoteExec?.provider === "local-docker" ? Object.keys(c
|
|
545
|
+
E2B_SANDBOX_ENV: (c) => (c.remoteExec?.provider === "e2b" ? Object.keys(sandboxForwardedEnvOf(c)) : []),
|
|
546
|
+
K8S_SANDBOX_ENV: (c) => (c.remoteExec?.provider === "k8s" ? Object.keys(sandboxForwardedEnvOf(c)) : []),
|
|
547
|
+
DOCKER_SANDBOX_ENV: (c) => (c.remoteExec?.provider === "local-docker" ? Object.keys(sandboxForwardedEnvOf(c)) : []),
|
|
529
548
|
};
|
|
530
549
|
const SERVER_ENV_NAME_ALLOWLIST_KNOBS = Object.keys(NAMES_IN_FORCE);
|
|
531
550
|
export function sandboxEnvNamesInForce(seats) {
|
|
@@ -889,11 +908,14 @@ function parseStoreDomain(ctx) {
|
|
|
889
908
|
},
|
|
890
909
|
});
|
|
891
910
|
}
|
|
892
|
-
const
|
|
893
|
-
const sessionBackendRaw = enumEnv("SESSION_BACKEND",
|
|
911
|
+
const declaredSqlEngine = dbBackendSet && (dbBackend === "mysql" || dbBackend === "pg") ? dbBackend : undefined;
|
|
912
|
+
const sessionBackendRaw = enumEnv("SESSION_BACKEND", declaredSqlEngine !== undefined ? "mysql" : "memory", SESSION_BACKENDS);
|
|
894
913
|
const sessionBackend = sessionBackendRaw === "mysql" ? "tidb" : sessionBackendRaw;
|
|
895
914
|
const localDataRoot = resolveLocalDataRoot(process.env, homedir());
|
|
896
915
|
const dbHostSet = dbBackend === "pg" ? !!process.env.PG_HOST : !!process.env.MYSQL_HOST;
|
|
916
|
+
if (declaredSqlEngine !== undefined && !dbHostSet) {
|
|
917
|
+
throw new Error(buildDeclaredEngineWithoutCoordinatesRefusal(declaredSqlEngine, missingSqlCoordinateKeys(declaredSqlEngine, process.env)));
|
|
918
|
+
}
|
|
897
919
|
const needsTidb = sessionBackend === "tidb" || (sessionBackend === "auto" && dbHostSet);
|
|
898
920
|
const needsDb = needsTidb;
|
|
899
921
|
const sqlCoordinateKeys = [...(process.env.MYSQL_HOST ? ["MYSQL_HOST"] : []), ...(process.env.PG_HOST ? ["PG_HOST"] : [])];
|
|
@@ -1631,7 +1653,7 @@ function parseMemoryEmbedder(ctx) {
|
|
|
1631
1653
|
throw new Error(`MEMORY_EMBEDDER_DIM="${dimRaw}" must be a positive integer (the embedding dimension, e.g. 1024). A wrong dimension writes wrong-length vectors into the memory embedding column, which neither the DB nor retrieval reports — the vector plane just silently degrades to the lexical floor (#228).`);
|
|
1632
1654
|
}
|
|
1633
1655
|
if (ctx.memoryEngineBackend !== "pg") {
|
|
1634
|
-
throw new Error(`MEMORY_EMBEDDER_* is set but MEMORY_ENGINE_BACKEND=${ctx.memoryEngineBackend} — the vector plane exists only on the pg memory backend (the
|
|
1656
|
+
throw new Error(`MEMORY_EMBEDDER_* is set but MEMORY_ENGINE_BACKEND=${ctx.memoryEngineBackend} — the vector plane exists only on the pg memory backend (the mysql backend is lexical-only in v1 and refuses an embedder; the file engine has no embedder seam). Set MEMORY_ENGINE_BACKEND=pg, or unset MEMORY_EMBEDDER_*.`);
|
|
1635
1657
|
}
|
|
1636
1658
|
if (!ctx.memoryEngineEnabled) {
|
|
1637
1659
|
throw new Error("MEMORY_EMBEDDER_* is set but MEMORY_ENGINE=off — the memory engine is not wired at all, so the embedder would never be called; unset one of the two (#228)");
|
|
@@ -1915,21 +1937,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
1915
1937
|
return boolEnv("LSP_HOST_ENABLED", true);
|
|
1916
1938
|
})();
|
|
1917
1939
|
const lspEnvAllow = parseEnvNameAllowlist("LSP_ENV_ALLOW", singleUserTurnkey) ?? [];
|
|
1918
|
-
|
|
1919
|
-
const lane = process.env.REMOTE_EXEC;
|
|
1920
|
-
if (lane !== undefined && lane !== "") {
|
|
1921
|
-
const word = REMOTE_EXEC_PROVIDER_WORDS.find((w) => w === lane);
|
|
1922
|
-
if (word === undefined) {
|
|
1923
|
-
throw new Error(`REMOTE_EXEC="${lane}" is not an execution lane — valid: ${REMOTE_EXEC_PROVIDER_WORDS.join(" | ")}. ` +
|
|
1924
|
-
`An unrecognized value used to fall through to the host/in-process lane silently; refusing to start instead (#157).`);
|
|
1925
|
-
}
|
|
1926
|
-
const missing = laneMissingEnv(word, process.env);
|
|
1927
|
-
if (missing.length > 0) {
|
|
1928
|
-
throw new Error(`REMOTE_EXEC=${lane} but required env ${missing.join(", ")} ${missing.length === 1 ? "is" : "are"} unset, empty or whitespace-only — it counts as absent: ` +
|
|
1929
|
-
`refusing to start rather than silently downgrading to the host/in-process lane (#157; set ${missing.length === 1 ? "it" : "them"}, or unset REMOTE_EXEC if you meant no sandbox lane).`);
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1940
|
+
const declaredLane = declaredExecutionLane(process.env.REMOTE_EXEC);
|
|
1933
1941
|
const readFaceFacts = process.env.READ_FACE !== undefined
|
|
1934
1942
|
? { readFace: enumEnv("READ_FACE", "roots", ["open", "roots"]), readFaceSource: "env" }
|
|
1935
1943
|
: { readFaceSource: "engine-default" };
|
|
@@ -1944,6 +1952,8 @@ function parseOrchestrationDomain(ctx) {
|
|
|
1944
1952
|
assertReadDenyBuiltinsResolvable(tiers, exclude);
|
|
1945
1953
|
return { ...(tiers !== undefined ? { readDenyBuiltinTiers: tiers } : {}), ...(exclude !== undefined ? { readDenyBuiltinExclude: exclude } : {}) };
|
|
1946
1954
|
})(),
|
|
1955
|
+
readDenyFloorRequired: boolEnv("READ_DENY_FLOOR_REQUIRED", false),
|
|
1956
|
+
sandboxReadFloor: enumEnv("SANDBOX_READ_FLOOR", SANDBOX_READ_FLOOR_DEFAULT, SANDBOX_READ_FLOOR_WORDS),
|
|
1947
1957
|
...((dir) => (dir !== undefined ? { agentConfigDir: dir } : {}))(declaredSemaConfigDir()),
|
|
1948
1958
|
...((p) => (p !== undefined ? { configLkgPath: p } : {}))(lkgPathOverrideOf(process.env.CONFIG_LKG_PATH)),
|
|
1949
1959
|
configLkgEnabled: boolEnv("CONFIG_LKG_ENABLED", true),
|
|
@@ -1959,7 +1969,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
1959
1969
|
}
|
|
1960
1970
|
return raw;
|
|
1961
1971
|
})()),
|
|
1962
|
-
remoteExec:
|
|
1972
|
+
remoteExec: declaredLane === "e2b" && process.env.E2B_API_KEY
|
|
1963
1973
|
? {
|
|
1964
1974
|
provider: "e2b",
|
|
1965
1975
|
apiKey: process.env.E2B_API_KEY,
|
|
@@ -1972,7 +1982,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
1972
1982
|
orphanReclaim: boolEnv("E2B_ORPHAN_RECLAIM", true),
|
|
1973
1983
|
}
|
|
1974
1984
|
:
|
|
1975
|
-
|
|
1985
|
+
declaredLane === "k8s" && process.env.K8S_SANDBOX_IMAGE && process.env.K8S_NAMESPACE
|
|
1976
1986
|
? {
|
|
1977
1987
|
provider: "k8s",
|
|
1978
1988
|
image: process.env.K8S_SANDBOX_IMAGE,
|
|
@@ -1994,7 +2004,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
1994
2004
|
...((c) => (c !== undefined ? { workspaceCache: c } : {}))(k8sWorkspaceCache()),
|
|
1995
2005
|
}
|
|
1996
2006
|
:
|
|
1997
|
-
|
|
2007
|
+
declaredLane === "ssh" && process.env.SSH_HOST && process.env.SSH_USER && process.env.SSH_PRIVATE_KEY
|
|
1998
2008
|
? {
|
|
1999
2009
|
provider: "ssh",
|
|
2000
2010
|
host: process.env.SSH_HOST,
|
|
@@ -2005,7 +2015,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
2005
2015
|
...((hk) => (hk !== undefined ? { hostKey: hk } : {}))(parseSshHostKeyEnv()),
|
|
2006
2016
|
}
|
|
2007
2017
|
:
|
|
2008
|
-
|
|
2018
|
+
declaredLane === "adb" && process.env.ADB_SERIAL
|
|
2009
2019
|
? {
|
|
2010
2020
|
provider: "adb",
|
|
2011
2021
|
serial: process.env.ADB_SERIAL,
|
|
@@ -2013,14 +2023,14 @@ function parseOrchestrationDomain(ctx) {
|
|
|
2013
2023
|
...(process.env.ADB_MOUNT_PATH ? { mountPath: process.env.ADB_MOUNT_PATH } : {}),
|
|
2014
2024
|
}
|
|
2015
2025
|
:
|
|
2016
|
-
|
|
2026
|
+
declaredLane === "host"
|
|
2017
2027
|
? {
|
|
2018
2028
|
provider: "host",
|
|
2019
2029
|
...(process.env.HOST_WORKSPACE_BASE ? { workspaceBase: process.env.HOST_WORKSPACE_BASE } : {}),
|
|
2020
2030
|
...((n) => (n !== undefined ? { commandTimeoutMs: n } : {}))(optNumEnvStrict("HOST_COMMAND_TIMEOUT_MS")),
|
|
2021
2031
|
}
|
|
2022
2032
|
:
|
|
2023
|
-
|
|
2033
|
+
declaredLane === "local-docker" && process.env.DOCKER_IMAGE
|
|
2024
2034
|
? {
|
|
2025
2035
|
provider: "local-docker",
|
|
2026
2036
|
image: process.env.DOCKER_IMAGE,
|
|
@@ -2038,7 +2048,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
2038
2048
|
...((names) => (names !== undefined ? { env: allowlistedEnv(names, process.env) } : {}))(parseEnvNameAllowlist("DOCKER_SANDBOX_ENV", singleUserTurnkey)),
|
|
2039
2049
|
}
|
|
2040
2050
|
:
|
|
2041
|
-
|
|
2051
|
+
declaredLane === "device"
|
|
2042
2052
|
? {
|
|
2043
2053
|
provider: "device",
|
|
2044
2054
|
...((n) => (n !== undefined ? { deliveryTimeoutMs: n } : {}))(parseDeviceBoundedIntEnv("DEVICE_DELIVERY_TIMEOUT_MS", process.env.DEVICE_DELIVERY_TIMEOUT_MS, DEVICE_DELIVERY_TIMEOUT_BOUNDS)),
|
|
@@ -2047,7 +2057,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
2047
2057
|
...((n) => (n !== undefined ? { maxInflightPerDevice: n } : {}))(parseDeviceBoundedIntEnv("DEVICE_MAX_INFLIGHT_PER_DEVICE", process.env.DEVICE_MAX_INFLIGHT_PER_DEVICE, DEVICE_HELLO_ACK_BOUNDS.maxInflight)),
|
|
2048
2058
|
...((n) => (n !== undefined ? { maxPreAuthPerRemote: n } : {}))(parseDevicePreAuthPerRemoteEnv()),
|
|
2049
2059
|
...((n) => (n !== undefined ? { enrollTokenTtlSec: n } : {}))(parseDeviceEnrollTokenTtlEnv()),
|
|
2050
|
-
|
|
2060
|
+
relay: parseDeviceRelayUrlEnv(process.env.DEVICE_RELAY_URL),
|
|
2051
2061
|
...(process.env.DEVICE_SUPERSEDE ? { supersede: enumEnv("DEVICE_SUPERSEDE", "stale_only", ["stale_only", "deny"]) } : {}),
|
|
2052
2062
|
}
|
|
2053
2063
|
:
|
|
@@ -2471,7 +2481,7 @@ const ORCHESTRATION_GROUP_KEYS = [
|
|
|
2471
2481
|
"workflowSizeGuideline", "backgroundAgentRetentionMs", "backgroundAgentStaleRunningMs",
|
|
2472
2482
|
"backgroundAgentParkClaimStaleMs", "delegationEntryCaps", "rosterRetentionMs", "leaderRunStaleMs", "scratchpadSweepTtlMs", "sandboxPkgSource", "sandboxPkgSourceCustom",
|
|
2473
2483
|
"sessionAutoTitle", "sessionAutoTitleSource", "selectEnvironmentTool", "envFactsEnabled", "toolDeferLongtail", "lspEnabled", "lspHostEnabled", "lspEnvAllow",
|
|
2474
|
-
"imageBakes", "readFace", "readFaceSource", "taskWriteFaceEscalation", "readDenyPatterns", "readDenyBuiltinTiers", "readDenyBuiltinExclude",
|
|
2484
|
+
"imageBakes", "readFace", "readFaceSource", "taskWriteFaceEscalation", "readDenyPatterns", "readDenyBuiltinTiers", "readDenyBuiltinExclude", "readDenyFloorRequired", "sandboxReadFloor",
|
|
2475
2485
|
"agentConfigDir", "configLkgPath", "configLkgEnabled",
|
|
2476
2486
|
];
|
|
2477
2487
|
const LIMITS_HTTP_GROUP_KEYS = [
|