@sema-agent/server 7.104.0 → 7.106.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 +114 -0
- package/USAGE.md +193 -52
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +2 -0
- package/deploy/sema-up/cluster-up.sh +15 -2
- package/deploy/sema-up/kube-up.sh +8 -3
- package/deploy/sema-up/lib/flagshape.sh +29 -0
- package/deploy/sema-up/lib/parse-machines.py +4 -1
- package/deploy/sema-up/sema-up.sh +11 -9
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +3 -1
- package/dist/approval-card.d.ts +1 -1
- package/dist/approval.d.ts +6 -1
- package/dist/approval.js +4 -4
- package/dist/auth-bridge.d.ts +14 -0
- package/dist/auth-bridge.js +7 -0
- package/dist/auto-mode-face.d.ts +49 -40
- package/dist/auto-mode-face.js +6 -68
- package/dist/bench/s1/live-deps.d.ts +9 -2
- package/dist/bench/s1/live-deps.js +13 -8
- package/dist/boot/budget-tracing.js +3 -2
- package/dist/boot/config-center.d.ts +4 -0
- package/dist/boot/config-center.js +95 -37
- package/dist/boot/coordinators.d.ts +1 -0
- package/dist/boot/coordinators.js +3 -1
- package/dist/boot/device-lane.d.ts +2 -1
- package/dist/boot/execution-env.d.ts +11 -0
- package/dist/boot/execution-env.js +30 -6
- package/dist/boot/execution-lane.js +2 -3
- package/dist/boot/leader.d.ts +2 -1
- package/dist/boot/leader.js +2 -0
- package/dist/boot/parked-revive-gate.d.ts +10 -7
- package/dist/boot/parked-revive-gate.js +4 -11
- package/dist/boot/resolve-spec.d.ts +1 -4
- package/dist/boot/resolve-spec.js +44 -21
- package/dist/boot/runner-deps.d.ts +5 -8
- package/dist/boot/runner-deps.js +5 -10
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-03-store-backend.d.ts +1 -1
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +2 -1
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +3 -2
- package/dist/boot/stage-06-runners.js +2 -5
- package/dist/boot/stage-07-capability-layer.d.ts +2 -2
- package/dist/boot/stage-07-capability-layer.js +1 -2
- package/dist/boot/stage-08-reapers.d.ts +2 -2
- package/dist/boot/stage-09-leader.d.ts +2 -2
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -2
- package/dist/boot/stage-10-http-server.js +11 -7
- package/dist/boot/stores.d.ts +1 -1
- package/dist/boot/stores.js +6 -4
- package/dist/brain.d.ts +24 -2
- package/dist/brain.js +29 -10
- package/dist/budget.js +3 -0
- package/dist/capabilities/center-wiring.d.ts +64 -0
- package/dist/capabilities/center-wiring.js +24 -0
- package/dist/capabilities/composite-members.d.ts +89 -0
- package/dist/capabilities/composite-members.js +20 -0
- package/dist/capabilities/execution-lane.d.ts +3 -0
- package/dist/capabilities/execution-lane.js +5 -2
- package/dist/config-catalog.d.ts +30 -5
- package/dist/config-catalog.js +75 -26
- package/dist/config-center/apply-effective.d.ts +1 -1
- package/dist/config-center/apply-effective.js +7 -8
- package/dist/config-center/apply-ledger.d.ts +17 -0
- package/dist/config-center/apply-ledger.js +5 -0
- package/dist/config-center/center-request.d.ts +17 -0
- package/dist/config-center/center-request.js +4 -0
- package/dist/config-center/pull-state.d.ts +29 -0
- package/dist/config-center/pull-state.js +2 -0
- package/dist/config-types.d.ts +41 -14
- package/dist/config-types.js +1 -0
- package/dist/config.d.ts +50 -2
- package/dist/config.js +111 -23
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/deployment-governance.d.ts +12 -1
- package/dist/deployment-governance.js +2 -0
- package/dist/execution-lane-caps.d.ts +30 -2
- package/dist/execution-lane-caps.js +12 -0
- package/dist/file-history-disclosure.d.ts +7 -31
- package/dist/file-history-disclosure.js +12 -0
- package/dist/fleet/fleet-bus.d.ts +5 -1
- package/dist/fleet-client.d.ts +18 -13
- package/dist/fleet-client.js +32 -22
- package/dist/fleet-lease.d.ts +72 -47
- package/dist/fleet-lease.js +66 -14
- package/dist/governance-http-status.d.ts +0 -1
- package/dist/governance-http-status.js +0 -1
- package/dist/hosted-posture.d.ts +6 -17
- package/dist/hosted-posture.js +11 -6
- package/dist/http/admission.d.ts +1 -1
- package/dist/http/admission.js +14 -9
- package/dist/http/approval-sweeps.js +13 -1
- package/dist/http/dispatch.d.ts +18 -0
- package/dist/http/dispatch.js +18 -5
- package/dist/http/durable-run-leg.js +2 -0
- package/dist/http/request-guards.d.ts +25 -0
- package/dist/http/request-guards.js +25 -5
- package/dist/http/resume-legs.d.ts +1 -1
- package/dist/http/resume-legs.js +19 -11
- package/dist/http/route-ctx.d.ts +9 -0
- package/dist/http/route-table.d.ts +15 -4
- package/dist/http/route-table.js +6 -5
- package/dist/http/routes/approvals-assistant.js +0 -1
- package/dist/http/routes/capabilities.js +12 -11
- package/dist/http/routes/config-catalog.js +2 -1
- package/dist/http/routes/diagnostics.js +2 -0
- package/dist/http/routes/fleet.d.ts +3 -2
- package/dist/http/routes/images.js +0 -1
- package/dist/http/routes/runs.js +2 -8
- package/dist/http/routes/session-sync.js +6 -1
- package/dist/http/routes/sessions.js +5 -2
- package/dist/http/routes/side-query.js +8 -1
- package/dist/http/routes/tasks.js +4 -1
- package/dist/http/routes/trace-usage.d.ts +2 -0
- package/dist/http/routes/trace-usage.js +4 -9
- package/dist/http/server.d.ts +29 -8
- package/dist/http/server.js +4 -1
- package/dist/http/session-inherit-env.d.ts +37 -0
- package/dist/http/session-inherit-env.js +6 -0
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +12 -9
- package/dist/http/sse-log.js +1 -8
- package/dist/http/wire-types.d.ts +19 -28
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/key-resolver.d.ts +74 -19
- package/dist/key-resolver.js +65 -7
- package/dist/leader/leader.d.ts +6 -0
- package/dist/leader/leader.js +2 -1
- package/dist/leader/repair-wire.js +2 -1
- package/dist/leader/wire.d.ts +9 -1
- package/dist/leader/wire.js +10 -6
- package/dist/observability/fail-open.d.ts +9 -1
- package/dist/observability/fail-open.js +9 -1
- package/dist/observability/metrics.js +3 -1
- package/dist/observability/permission-rule-events.d.ts +1 -1
- package/dist/observability/permission-rule-events.js +1 -1
- package/dist/observability/run-terminal.d.ts +82 -9
- package/dist/observability/run-terminal.js +112 -9
- package/dist/observability/secret-env-scrub.js +1 -1
- package/dist/observability/tool-trace.d.ts +2 -0
- package/dist/operator-ask.d.ts +29 -1
- package/dist/operator-ask.js +6 -0
- package/dist/parked-decide.d.ts +14 -1
- package/dist/parked-decide.js +8 -1
- package/dist/plugins/image-bake-store-sql.d.ts +0 -2
- package/dist/plugins/image-bake-store-sql.js +0 -5
- package/dist/plugins/retention-store-sql.js +1 -0
- package/dist/plugins/run-store-sql.d.ts +3 -2
- package/dist/plugins/schema-indexes.js +1 -0
- package/dist/plugins/session-policy-store-sql.d.ts +38 -7
- package/dist/plugins/session-policy-store-sql.js +73 -18
- package/dist/plugins/sql-driver.d.ts +1 -1
- package/dist/plugins/store-backend.d.ts +17 -6
- package/dist/plugins/store-backend.js +16 -5
- package/dist/plugins/tidb-pool.js +5 -4
- package/dist/read-face-posture.d.ts +25 -4
- package/dist/read-face-posture.js +9 -0
- package/dist/request-key-closure.js +2 -2
- package/dist/request-value-closure.d.ts +17 -5
- package/dist/request-value-closure.js +12 -0
- package/dist/router/route-orchestration.d.ts +11 -0
- package/dist/router/route-orchestration.js +7 -6
- package/dist/rules-consent.js +0 -11
- package/dist/run-local.js +4 -2
- package/dist/runs.d.ts +2 -1
- package/dist/runs.js +4 -4
- package/dist/runtime-caps-resolver.d.ts +4 -10
- package/dist/runtime-governance.d.ts +8 -11
- package/dist/runtime-governance.js +10 -41
- package/dist/sealed-key.d.ts +0 -40
- package/dist/sealed-key.js +0 -20
- package/dist/server-secret-env.d.ts +11 -12
- package/dist/session-policy-wire.d.ts +100 -12
- package/dist/session-policy-wire.js +71 -8
- package/dist/session-titler.d.ts +11 -0
- package/dist/session-titler.js +6 -2
- package/dist/sql-engine-posture.d.ts +2 -2
- package/dist/store-posture.d.ts +53 -0
- package/dist/store-posture.js +32 -0
- package/dist/task-settings.d.ts +34 -45
- package/dist/task-settings.js +46 -25
- package/dist/tool-approval.d.ts +51 -22
- package/dist/tool-approval.js +44 -8
- package/dist/tool-declaration-http-status.d.ts +12 -0
- package/dist/tool-declaration-http-status.js +12 -0
- package/dist/trace/core-keyset-guard.d.ts +7 -7
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +5 -0
- package/dist/trace/project.d.ts +13 -7
- package/dist/trace/project.js +54 -6
- package/dist/trace/redact.d.ts +7 -0
- package/dist/trace/redact.js +153 -61
- package/dist/trace/wire-projection-faces.d.ts +1 -1
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +110 -0
- package/dist/unattended-permission-mode.js +65 -0
- package/package.json +3 -3
- package/dist/boot/session-shell-gate-registry.d.ts +0 -39
- package/dist/boot/session-shell-gate-registry.js +0 -21
- package/dist/plugins/memory-session-policy-store.d.ts +0 -46
- package/dist/plugins/memory-session-policy-store.js +0 -52
- package/dist/roster-bound-http-status.d.ts +0 -6
- package/dist/roster-bound-http-status.js +0 -6
package/dist/config-catalog.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CROSS_SESSION_INBOUND_SETTINGS, CROSS_SESSION_DIALOG_EXPIRY_VALUES } from "@sema-agent/core";
|
|
2
|
-
import { CENTER_CREDENTIAL_ENV } from "@sema-agent/settings-schema";
|
|
1
|
+
import { CROSS_SESSION_INBOUND_SETTINGS, CROSS_SESSION_DIALOG_EXPIRY_VALUES, PERMISSION_MODES } from "@sema-agent/core";
|
|
2
|
+
import { CENTER_CREDENTIAL_ENV, DOMAIN_SCHEMAS } from "@sema-agent/settings-schema";
|
|
3
3
|
import { CENTER_CREDENTIAL_RENEW_LEAD_DEFAULT_MS, CENTER_CREDENTIAL_RENEW_LEAD_MAX_MS, CENTER_CREDENTIAL_RENEW_LEAD_MIN_MS } from "./center-credential-renewer.js";
|
|
4
4
|
import { THINKING_FORMATS } from "./model-compat.js";
|
|
5
|
-
import { AUTO_MODE_CLASSIFIER_TIMEOUT_BOUNDS, CONFIG_PROVIDER_WORDS, DRAIN_SECOND_SIGNAL_MIN_GAP_BOUNDS, DRAIN_SECOND_SIGNAL_MIN_GAP_DEFAULT_MS, FIRST_BYTE_TIMEOUT_BOUNDS, RESILIENCE_DEFAULTS, TASK_WRITE_FACE_ESCALATIONS } from "./config-types.js";
|
|
5
|
+
import { AUTO_MODE_CLASSIFIER_TIMEOUT_BOUNDS, CONFIG_PROVIDER_WORDS, DB_BACKEND_WORDS, DRAIN_SECOND_SIGNAL_MIN_GAP_BOUNDS, DRAIN_SECOND_SIGNAL_MIN_GAP_DEFAULT_MS, FIRST_BYTE_TIMEOUT_BOUNDS, RESILIENCE_DEFAULTS, TASK_WRITE_FACE_ESCALATIONS } from "./config-types.js";
|
|
6
6
|
import { webSearchProviderFromEnv, WEB_SEARCH_PROVIDERS } from "./plugins/web-search.js";
|
|
7
|
+
import { UNATTENDED_PERMISSION_MODE_DEFAULT } from "./unattended-permission-mode.js";
|
|
7
8
|
import { AUTONOMY_MODES } from "./runtime-governance.js";
|
|
8
9
|
import { REMOTE_EXEC_PROVIDER_WORDS } from "./execution-lane-caps.js";
|
|
9
|
-
import { CENTER_READ_FACE_LIVE_KEYS } from "./config-center/read-face.js";
|
|
10
10
|
import { MODEL_PROVIDER_WORDS } from "./model-provider.js";
|
|
11
11
|
import { buildDisplaySafeUrl } from "./trace/redact.js";
|
|
12
12
|
import { describeAllowlistPostures } from "./env-name-allowlist-knobs.js";
|
|
@@ -35,14 +35,6 @@ const cLimits = (path, over = {}) => ({
|
|
|
35
35
|
});
|
|
36
36
|
const cGov = (path, over = {}) => ({ domain: "governance", path, centerKey: path, precedence: "center-wins", timing: "hot", ...over });
|
|
37
37
|
const cModels = (path) => ({ domain: "models", path, centerKey: "models", precedence: "center-wins", timing: "hot" });
|
|
38
|
-
const cRead = (path, centerKey, over = {}) => ({
|
|
39
|
-
domain: "readFace",
|
|
40
|
-
path,
|
|
41
|
-
centerKey,
|
|
42
|
-
precedence: "env-wins",
|
|
43
|
-
...(CENTER_READ_FACE_LIVE_KEYS.has(path) ? { timing: "hot" } : { timing: "restart", restartSlice: "read-face" }),
|
|
44
|
-
...over,
|
|
45
|
-
});
|
|
46
38
|
const SEC = ["security"];
|
|
47
39
|
const BILL = ["billing"];
|
|
48
40
|
const DATA = ["data"];
|
|
@@ -108,7 +100,7 @@ export const CONFIG_CATALOG = [
|
|
|
108
100
|
r("COST_QUOTA_WINDOW_SEC", "limitsHttp", "number", "per-principal 成本配额窗长(秒);SQL 腿窗长进桶主键 ⇒ center 腿显式 deferred(重启生效)", { staticDefault: "86400", danger: BILL, configKey: "costQuotaWindowSec", center: cLimits("costQuotaWindowSec", { timing: "restart", restartReason: "cost-quota-window" }) }),
|
|
109
101
|
r("CROSS_SESSION_DIALOG_EXPIRY", "approval", "enum", "held 跨会话消息等待人审的期限(CC settings 键名 dialogExpiry;未设=不铸键,引擎自落缺省 5m;词表外拒启)", { danger: SEC, enumValues: [...CROSS_SESSION_DIALOG_EXPIRY_VALUES], configKey: "crossSessionDialogExpiry", derivedDefaultNote: "缺席 ⇒ 不铸键,core 自缺省 5m", resolve: (c) => c.crossSessionDialogExpiry ?? null }),
|
|
110
102
|
r("CROSS_SESSION_INBOUND", "approval", "enum", "入站跨会话消息的部署/组织层治理(CC settings 键名 crossSessionInbound 的 managed 层;未设=本层不表态≠ next-turn;词表外拒启)", { danger: SEC, enumValues: [...CROSS_SESSION_INBOUND_SETTINGS], configKey: "crossSessionInbound", derivedDefaultNote: "缺席 ⇒ managed 层不设,由其余层与 mode-parity 决定", resolve: (c) => c.crossSessionInbound ?? null }),
|
|
111
|
-
r("DB_BACKEND", "store", "enum", "store 后端引擎选择(mysql 兼容/pg/本机文件店/纯内存)", { enumValues:
|
|
103
|
+
r("DB_BACKEND", "store", "enum", "store 后端引擎选择(mysql 兼容/pg/本机文件店/纯内存)", { enumValues: DB_BACKEND_WORDS, danger: DATA, derivedDefaultNote: "裸 boot ⇒ local(多租户裸 boot ⇒ memory + notice);有 SQL 信号 ⇒ mysql", configKey: "dbBackend", resolve: (c) => c.dbBackend }),
|
|
112
104
|
r("DB_QUERY_TIMEOUT_MS", "store", "number", "per-query DB 超时(ms;坏值回默认姿态+warn,绝不 NaN 进 driver)", { derivedDefaultNote: "缺席 ⇒ 池级不设/计数族 30s(按引擎)", configKey: "dbQueryTimeoutMs" }),
|
|
113
105
|
r("DEFAULT_SCENARIO", "integrations", "string", "出厂缺省场景(编码产品出厂态;通用中性 persona 用 default 显式选回)", { staticDefault: "code", configKey: "defaultScenario" }),
|
|
114
106
|
r("DELEGATION_MAX_CONCURRENT", "orchestration", "number", "委派入口并发帽", { derivedDefaultNote: "缺席 ⇒ 不铸键,core 自缺省(CC parity 20)" }),
|
|
@@ -153,7 +145,8 @@ export const CONFIG_CATALOG = [
|
|
|
153
145
|
r("EXPERIMENTAL_OBSERVER_AGENTS", "orchestration", "boolean", "observer 开闸线(实验面 ship-dark;多租户只认 center caps,env 被忽略)", { staticDefault: "false", configKey: "experimentalObserverAgents" }),
|
|
154
146
|
r("FILE_HISTORY_CAPTURE", "store", "boolean", "文件历史**捕获**总开关(三条车道同义)。关 = 不再捕获任何改动文件的首次快照(落 core 的部署捕获位 `RunnerDeps.fileHistoryCapture: \"off\"`,能力词 `fileHistoryCapture` 翻 off);S-724(7.104.0)起**只关捕获**:历史店照接,已存历史照常 restoreFiles / rewindFilesTo / 2c session-sync。关掉 ≠ 删掉:已捕获的历史不被批量删除,仍按会话删除与留存规则清理 —— 要清存量走 DELETE 会话或留存旋钮;没有「整库历史不可用」的旋钮", { staticDefault: "true", danger: DATA, configKey: "fileHistoryCapture" }),
|
|
155
147
|
r("FILE_HISTORY_RETENTION_KEEP", "store", "number", "per-file rewind 历史的保留上限(与 core FileStorageBackend 同域键形,三条车道一套语义)", { danger: DATA, derivedDefaultNote: "缺席 ⇒ core 缺省 100" }),
|
|
156
|
-
r("FLEET_ADVERTISE_ADDRESS", "integrations", "url", "fleet 面向 center 公告的本 worker 可达地址(
|
|
148
|
+
r("FLEET_ADVERTISE_ADDRESS", "integrations", "url", "fleet 面向 center 公告的本 worker 可达地址(中心车道配齐 + 本键 ⇒ 公告环;坏形拒启。用量环不看本键,S-866 ④)"),
|
|
149
|
+
r("FLEET_LEASE_FAIL_CLOSED", "integrations", "boolean", "租约连接级失败(中心鉴权拒 / 凭证不可读 / 不可达 / 5xx / 超时 / 坏体)时计费入口拒 503 fleet.lease_unavailable(true)还是放行(false);409 not-lease 与耗尽 429 不受它管;词表外拒启", { danger: SEC, derivedDefaultNote: "缺席 ⇒ 按部署姿态派生:REQUIRE_PRINCIPAL=true ⇒ true(多租:额度是安全轴);单用户 ⇒ false(AP 姿态)。显式值压过派生。生效值见 caps centerWiring.failMode", configKey: "fleetLeaseFailClosed" }),
|
|
157
150
|
r("FORK_ENABLED", "orchestration", "boolean", "CC /fork(core Fork 工具)装配开关", { derivedDefaultNote: "posture 三态:缺席 = 单用户 ⇒ on / 多租户 ⇒ off(per-principal entitlement 另判)", configKey: "forkEnabled" }),
|
|
158
151
|
r("GATEWAY_MAX_RETRIES", "modelPlane", "number", "openai 兼容腿每次调用重试上限", { derivedDefaultNote: "缺席 ⇒ 不传引擎,引擎默认当家" }),
|
|
159
152
|
r("GIT_API_BASEURL", "integrations", "url", "repo 工具的 Git host API base", { configKey: "gitApiBaseUrl" }),
|
|
@@ -219,7 +212,7 @@ export const CONFIG_CATALOG = [
|
|
|
219
212
|
r("LSP_ENABLED", "orchestration", "boolean", "LSP 沙箱腿 opt-in(需烤好的 LSP 模板;host 腿另有 LSP_HOST_ENABLED)", { staticDefault: "false", configKey: "lspEnabled" }),
|
|
220
213
|
r("LSP_ENV_ALLOW", "orchestration", "secret", `host 腿语言服务器子进程 env 的点名放行名单(点到的键从服务 env 原样放回、部署方显式承担;没点到的照剥;与 host shell inheritEnv:[names] 同一只谓词;形错 / 点名任一只名单型旋钮(含自己)拒启且不回显值;本进程环境里没有的名按序号 warn、不放行、不回显;多租户姿态(忽略时起服 warn 一次):${describeAllowlistPostures()};原文按凭据类对待:只回在场位、不进任何子进程,生效名单见起服披露行 allowed)`, { danger: SEC, derivedDefaultNote: "缺席 / 空串 ⇒ 空名单 = 全剥(7.100.0 行为)" }),
|
|
221
214
|
r("LSP_HOST_ENABLED", "orchestration", "boolean", "LSP host 腿开关(本机 language server,优雅降级)", { staticDefault: "true", configKey: "lspHostEnabled" }),
|
|
222
|
-
r("MANUAL_MODE_SHELL_GATE", "approval", "enum", "手动模式 shell 门收紧腿(off=no-op 非放松 ——
|
|
215
|
+
r("MANUAL_MODE_SHELL_GATE", "approval", "enum", "手动模式 shell 门收紧腿(off=no-op 非放松 —— 本键只有收紧半场;拼错拒启;S-877 起 classify 退役 = 拒启指路)", { danger: SEC, enumValues: ["always", "off"], echoWords: ["always"], resolve: (c) => c.manualModeShellGate ?? null, derivedDefaultNote: "off/未设 ⇒ 本键不贡献任何东西(归一成键缺席)⇒ 回显 null;真姿态只有 always 一个(core 7.34.0 起形状档在每一种模式下都装,classify 不再是运维选的档)" }),
|
|
223
216
|
r("MAX_PRINCIPAL_COST_USD", "limitsHttp", "number", "per-principal 窗内成本天花板(0=关)", { staticDefault: "0", danger: BILL, configKey: "maxPrincipalCostUsd", center: cLimits("maxPrincipalCostUsd") }),
|
|
224
217
|
r("MAX_TASK_COST_USD", "limitsHttp", "number", "单任务成本天花板(0=关)", { staticDefault: "0", danger: BILL, configKey: "maxTaskCostUsd", center: cLimits("maxTaskCostUsd") }),
|
|
225
218
|
r("MAX_TASK_TOKENS", "limitsHttp", "number", "单任务 token 天花板(per-slice 窗;0=关)", { staticDefault: "0", danger: BILL, configKey: "maxTaskTokens", center: cLimits("maxTaskTokens") }),
|
|
@@ -287,8 +280,8 @@ export const CONFIG_CATALOG = [
|
|
|
287
280
|
r("MODEL_COST_OUTPUT", "modelPlane", "number", "主模型 output 单价", { derivedDefaultNote: "四键全缺席 ⇒ 未定价(不铸 cost 键,成本读面缺席);任一设 ⇒ 四键在场,未设的按 0 显式", danger: BILL, resolve: (c) => c.model.cost?.output ?? null, center: cModels("models[].cost.output") }),
|
|
288
281
|
r("MODEL_DEFAULT_THINKING", "modelPlane", "enum", "主模型默认思考档(llm-core ThinkingLevel;off=不设模型级默认;未知词拒启)", { enumValues: ["minimal", "low", "medium", "high", "xhigh", "max", "off"], echoWords: ["minimal", "low", "medium", "high", "xhigh", "max"], derivedDefaultNote: "缺席/off ⇒ 不铸 defaultThinking(逐任务档由 spec>role 决定)", resolve: (c) => c.model.defaultThinking ?? null }),
|
|
289
282
|
r("MODEL_DEGRADE_AT_COST_FRACTION", "modelPlane", "number", "预算降级触发比(spent/budget;>1=实际别降级)", { staticDefault: "0.7", danger: BILL }),
|
|
290
|
-
r("MODEL_DEGRADE_ON", "modelPlane", "csv", "反应式降级触发词表(core DegradeReason 全集;拼错拒启)
|
|
291
|
-
r("MODEL_DEGRADE_REACTIVE", "modelPlane", "boolean", "反应式降级开关(degrade-route 重启片只在它开时活)
|
|
283
|
+
r("MODEL_DEGRADE_ON", "modelPlane", "csv", "反应式降级触发词表(core DegradeReason 全集;拼错拒启)。中心 models 域没有 degrade 成员,降级词表由 env 持有"),
|
|
284
|
+
r("MODEL_DEGRADE_REACTIVE", "modelPlane", "boolean", "反应式降级开关(degrade-route 重启片只在它开时活)。中心 models 域没有 degrade 成员,开关由 env 持有", { staticDefault: "false" }),
|
|
292
285
|
r("MODEL_DEGRADE_TO", "modelPlane", "string", "降级目标模型(设了=开降级;外部网关名不必在目录)", { danger: BILL }),
|
|
293
286
|
r("MODEL_DEGRADE_TO_VISION", "modelPlane", "boolean", "降级目标的 vision 声明(false ⇒ 带图任务丢降级不丢图)", { staticDefault: "false" }),
|
|
294
287
|
r("MODEL_EXTRA_BODY", "modelPlane", "opaque", "生成参数直通 JSON(top_k/logit_bias 等;必须静态 —— 前缀缓存键序)", { danger: SEC }),
|
|
@@ -337,7 +330,7 @@ export const CONFIG_CATALOG = [
|
|
|
337
330
|
r("OTEL_EXPORTER_OTLP_HEADERS", "observability", "secret", "OTLP 出口头(k=v CSV;常载鉴权头 ⇒ 按凭据处置)", { danger: SEC }),
|
|
338
331
|
r("OTEL_EXPORT_INTERVAL_MS", "observability", "number", "OTLP 批报周期(ms)", { staticDefault: "15000" }),
|
|
339
332
|
r("OTEL_SERVICE_NAME", "observability", "string", "OTLP service.name", { staticDefault: "sema-server" }),
|
|
340
|
-
r("PERMISSIONS_DISABLE_AUTO_MODE", "approval", "boolean", "auto 模式本地 org deny(CC/center/settings 键名 permissions.disableAutoMode 的 env 腿;tighten-only:每 principal caps.autoMode 折 false,center 授予翻不回;未设=不动 caps;词表外拒启)", { staticDefault: "false", danger: SEC, configKey: "permissionsDisableAutoMode"
|
|
333
|
+
r("PERMISSIONS_DISABLE_AUTO_MODE", "approval", "boolean", "auto 模式本地 org deny(CC/center/settings 键名 permissions.disableAutoMode 的 env 腿;tighten-only:每 principal caps.autoMode 折 false,center 授予翻不回;未设=不动 caps;词表外拒启)", { staticDefault: "false", danger: SEC, configKey: "permissionsDisableAutoMode" }),
|
|
341
334
|
r("PERMISSION_RULES_ENABLED", "approval", "boolean", "持久化权限规则车道总开关(撤销面已建 ⇒ 默认 ON)", { staticDefault: "true", danger: SEC, configKey: "permissionRulesEnabled" }),
|
|
342
335
|
r("PG_DATABASE", "store", "string", "PostgreSQL 库名", { danger: DATA }),
|
|
343
336
|
r("PG_HOST", "store", "string", "PostgreSQL 主机(在场即算 SQL 信号)", { danger: DATA }),
|
|
@@ -358,10 +351,10 @@ export const CONFIG_CATALOG = [
|
|
|
358
351
|
r("QUESTION_MAX_TOTAL_PER_RUN", "approval", "number", "AskUserQuestion 每 run 总量帽", { derivedDefaultNote: "缺席 ⇒ 出厂窗 20" }),
|
|
359
352
|
r("QUESTION_TTL_MS", "approval", "number", "AskUserQuestion 无人应答释放窗(ms)", { derivedDefaultNote: "缺席 ⇒ 出厂窗 300000" }),
|
|
360
353
|
r("RATE_LIMIT_RPM", "limitsHttp", "number", "计费提交每分钟限流(0=关)", { staticDefault: "0", danger: BILL, configKey: "rateLimitPerMin", center: cLimits("rateLimitPerMin") }),
|
|
361
|
-
r("READ_DENY_BUILTIN_EXCLUDE", "orchestration", "csv", "按行名删内建 deny 条目(档位之后生效;绝不削任务显式 deny)", { danger: SEC, configKey: "readDenyBuiltinExclude"
|
|
362
|
-
r("READ_DENY_BUILTIN_TIERS", "orchestration", "csv", "内建 deny 表档位选择(闭集五档 credentials/shell-history/browser/wallet/agent-config;none=显式空姿态)", { danger: SEC, derivedDefaultNote: "
|
|
363
|
-
r("READ_DENY_PATTERNS", "orchestration", "csv", "READ 面额外 deny pattern 表", { danger: SEC, configKey: "readDenyPatterns"
|
|
364
|
-
r("READ_FACE", "orchestration", "enum", "READ 容纳面档位(env 逐键恒赢 center —— 部署主权表达)", { enumValues: ["open", "roots"], danger: SEC, derivedDefaultNote: "缺席 ⇒ 按 posture 派生(S-167):单用户 turnkey(REQUIRE_PRINCIPAL 未设)铸 open;多租户不铸键、core 默认 roots。生效来源见 GET /v1/diagnostics/wiring 的 readFace.source 四词", configKey: "readFace"
|
|
354
|
+
r("READ_DENY_BUILTIN_EXCLUDE", "orchestration", "csv", "按行名删内建 deny 条目(档位之后生效;绝不削任务显式 deny)", { danger: SEC, configKey: "readDenyBuiltinExclude" }),
|
|
355
|
+
r("READ_DENY_BUILTIN_TIERS", "orchestration", "csv", "内建 deny 表档位选择(闭集五档 credentials/shell-history/browser/wallet/agent-config;none=显式空姿态)", { danger: SEC, derivedDefaultNote: "缺席 ⇒ 出厂两档在岗 **credentials,agent-config**(core 7.34.0 R-2 起;7.22.0–7.33.x 曾为 OFF)。要全关显式写 none;要全五档显式写 credentials,shell-history,browser,wallet,agent-config;空值拒启(手滑与显式意图不许同形)", configKey: "readDenyBuiltinTiers" }),
|
|
356
|
+
r("READ_DENY_PATTERNS", "orchestration", "csv", "READ 面额外 deny pattern 表", { danger: SEC, configKey: "readDenyPatterns" }),
|
|
357
|
+
r("READ_FACE", "orchestration", "enum", "READ 容纳面档位(env 逐键恒赢 center —— 部署主权表达)", { enumValues: ["open", "roots"], danger: SEC, derivedDefaultNote: "缺席 ⇒ 按 posture 派生(S-167):单用户 turnkey(REQUIRE_PRINCIPAL 未设)铸 open;多租户不铸键、core 默认 roots。生效来源见 GET /v1/diagnostics/wiring 的 readFace.source 四词", configKey: "readFace" }),
|
|
365
358
|
r("REAP_INTERVAL_SEC", "limitsHttp", "number", "reaper 周期(秒)", { staticDefault: "60", configKey: "reapIntervalSec" }),
|
|
366
359
|
r("REAP_RUN_STALE_SEC", "limitsHttp", "number", "run 活性判陈旧阈(秒)", { staticDefault: "120", configKey: "runStaleSec", center: cLimits("runStaleSec") }),
|
|
367
360
|
r("REMOTE_EXEC", "orchestration", "enum", "执行车道选择(点名而配不齐/认不出 ⇒ 拒启,绝不静默降级到 host/stub)", { enumValues: REMOTE_EXEC_PROVIDER_WORDS, danger: SEC, derivedDefaultNote: "缺席:CONFIG_PROVIDER=local ⇒ host;其余 ⇒ 进程内 stub(手带整族不挂;残余名册看活体 wiring_manifest 里 mountedBy=hands 的条目数,不按工具名点。想让这一形拒启见 REQUIRE_EXECUTION_LANE)", configKey: "remoteExec", resolve: (c) => c.remoteExec?.provider ?? null }),
|
|
@@ -461,6 +454,7 @@ export const CONFIG_CATALOG = [
|
|
|
461
454
|
r("TRACE_THINKING", "observability", "boolean", "思考轨迹入 durable 事件日志(敏感部署可关;落盘前脱敏)", { staticDefault: "true", danger: DATA, configKey: "traceThinking" }),
|
|
462
455
|
r("TRACE_TOKEN", "observability", "secret", "Task Trace API 只读令牌(fleet 拉轨迹,不授任务/配置权)", { danger: SEC }),
|
|
463
456
|
r("UNATTENDED_APPROVAL_POLICY", "approval", "enum", "无人能答的治理 ask 终局(park=durable 等人;deny=当场拒 —— 自声明无人值守)", { enumValues: ["park", "deny"], staticDefault: "park", danger: SEC, configKey: "unattendedApprovalPolicy" }),
|
|
457
|
+
r("UNATTENDED_PERMISSION_MODE", "approval", "enum", "无人值守腿(leader worker / leader 修复腿 / run-local:本仓自铸 spec、无调用方可表态、无审批席)的权限模式;写面恒 roots(不随 bypassPermissions 开放);词表外拒启", { enumValues: [...PERMISSION_MODES], staticDefault: UNATTENDED_PERMISSION_MODE_DEFAULT, danger: SEC, configKey: "unattendedPermissionMode" }),
|
|
464
458
|
r("UNREACHED_ASK_TTL_MS", "approval", "number", "零活流铸造的 ask 悬挂窗(ms;[60s,24h] 拒启带界)", { staticDefault: "3600000" }),
|
|
465
459
|
r("USAGE_WINDOWS", "orchestration", "opaque", "部署级治理窗(JSON 数组;滑动窗内跨任务 token/$ 预算,key=principal)", { danger: BILL }),
|
|
466
460
|
r("WEB_SEARCH_API_KEY", "orchestration", "secret", "web search 后端 API 凭据(brave/tavily)", { danger: [...SEC, ...BILL] }),
|
|
@@ -488,6 +482,62 @@ export const CONFIG_CATALOG = [
|
|
|
488
482
|
r("WRITE_PROTECTED_EXTRA", "approval", "csv", "写保护名表的**加法**(逗号裸名或 JSON [{name,kind}];组合 [...core 缺省表, …];空值拒启)", { danger: SEC, derivedDefaultNote: "缺席 ⇒ 不铸座,core 缺省表(51 行)在岗" }),
|
|
489
483
|
r("WRITE_PROTECTED_TABLE_REPLACE", "approval", "json", "写保护名表的**整表替换**(JSON 数组;[]=显式无表;boot 期 loud 列出被丢的缺省行)", { danger: SEC, derivedDefaultNote: "缺席 ⇒ 不铸座,core 缺省表在岗;与 WRITE_PROTECTED_EXTRA 同写 ⇒ 拒启" }),
|
|
490
484
|
];
|
|
485
|
+
export function assertCenterSeatsResolvable(specs) {
|
|
486
|
+
const bad = [];
|
|
487
|
+
for (const spec of specs) {
|
|
488
|
+
const seat = spec.center;
|
|
489
|
+
if (seat === undefined)
|
|
490
|
+
continue;
|
|
491
|
+
const schema = Object.hasOwn(DOMAIN_SCHEMAS, seat.domain) ? Reflect.get(DOMAIN_SCHEMAS, seat.domain) : undefined;
|
|
492
|
+
if (schema === undefined)
|
|
493
|
+
bad.push(`${spec.name}: center domain "${seat.domain}" is not a settings-schema domain`);
|
|
494
|
+
else if (!zodPathResolves(schema, seat.path))
|
|
495
|
+
bad.push(`${spec.name}: the settings-schema "${seat.domain}" domain has no member at path "${seat.path}"`);
|
|
496
|
+
}
|
|
497
|
+
if (bad.length > 0) {
|
|
498
|
+
throw new Error(`config catalog claims center seats the settings-schema contract does not have — the center cannot publish them, so the catalog must not advertise a center write lane for them (delete the seat, or add the member to the contract first): ${bad.join("; ")}`);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function zodMember(node, key) {
|
|
502
|
+
return typeof node === "object" && node !== null && key in node ? Reflect.get(node, key) : undefined;
|
|
503
|
+
}
|
|
504
|
+
function unwrapZodNode(node) {
|
|
505
|
+
let cur = node;
|
|
506
|
+
for (let depth = 0; depth < 32; depth++) {
|
|
507
|
+
const def = zodMember(cur, "_def");
|
|
508
|
+
const inner = zodMember(def, "innerType") ?? zodMember(def, "schema");
|
|
509
|
+
if (inner !== undefined) {
|
|
510
|
+
cur = inner;
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
const getter = zodMember(def, "getter");
|
|
514
|
+
if (typeof getter === "function") {
|
|
515
|
+
cur = Reflect.apply(getter, def, []);
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
return cur;
|
|
519
|
+
}
|
|
520
|
+
return cur;
|
|
521
|
+
}
|
|
522
|
+
function zodPathResolves(schema, path) {
|
|
523
|
+
let cur = unwrapZodNode(schema);
|
|
524
|
+
for (const segment of path.split(".")) {
|
|
525
|
+
const intoArray = segment.endsWith("[]");
|
|
526
|
+
const name = intoArray ? segment.slice(0, -2) : segment;
|
|
527
|
+
const shape = zodMember(cur, "shape");
|
|
528
|
+
if (typeof shape !== "object" || shape === null || !Object.hasOwn(shape, name))
|
|
529
|
+
return false;
|
|
530
|
+
cur = unwrapZodNode(Reflect.get(shape, name));
|
|
531
|
+
if (intoArray) {
|
|
532
|
+
const def = zodMember(cur, "_def");
|
|
533
|
+
if (zodMember(def, "typeName") !== "ZodArray")
|
|
534
|
+
return false;
|
|
535
|
+
cur = unwrapZodNode(zodMember(def, "type"));
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
assertCenterSeatsResolvable(CONFIG_CATALOG);
|
|
491
541
|
function primitiveConfigValue(config, key) {
|
|
492
542
|
const v = Reflect.get(config, key);
|
|
493
543
|
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean")
|
|
@@ -535,7 +585,7 @@ function valueClassOf(type) {
|
|
|
535
585
|
return "plain";
|
|
536
586
|
}
|
|
537
587
|
export function buildConfigCatalog(inputs) {
|
|
538
|
-
const { config, env, boot, knobs, centerDomains, centerManagedKeys } = inputs;
|
|
588
|
+
const { config, env, boot, knobs, centerDomains, centerManagedKeys, retired } = inputs;
|
|
539
589
|
const knobByName = new Map(knobs.map((k) => [k.name, k]));
|
|
540
590
|
const rows = [...CONFIG_CATALOG]
|
|
541
591
|
.sort((a, b) => (a.name < b.name ? -1 : 1))
|
|
@@ -545,7 +595,6 @@ export function buildConfigCatalog(inputs) {
|
|
|
545
595
|
const valueClass = valueClassOf(spec.type);
|
|
546
596
|
const knob = valueClass === "plain" ? knobByName.get(spec.name) : undefined;
|
|
547
597
|
const seat = spec.center;
|
|
548
|
-
const domainExists = seat !== undefined && centerDomains.includes(seat.domain);
|
|
549
598
|
const managedNow = seat !== undefined && (centerManagedKeys?.has(seat.centerKey) ?? false);
|
|
550
599
|
const centerTiming = seat?.timing;
|
|
551
600
|
const centerRestartSlice = seat?.restartSlice;
|
|
@@ -571,7 +620,7 @@ export function buildConfigCatalog(inputs) {
|
|
|
571
620
|
domain: spec.domain,
|
|
572
621
|
type: spec.type,
|
|
573
622
|
semantics: spec.semantics,
|
|
574
|
-
writeLanes: seat !== undefined
|
|
623
|
+
writeLanes: seat !== undefined ? ["env", "center"] : ["env"],
|
|
575
624
|
effectiveLane,
|
|
576
625
|
envHeld,
|
|
577
626
|
envTiming: spec.envTiming ?? "deploy",
|
|
@@ -590,7 +639,6 @@ export function buildConfigCatalog(inputs) {
|
|
|
590
639
|
timing: centerTiming,
|
|
591
640
|
...(centerRestartSlice !== undefined ? { restartSlice: centerRestartSlice } : {}),
|
|
592
641
|
...(seat.restartReason !== undefined ? { restartReason: seat.restartReason } : {}),
|
|
593
|
-
domainExists,
|
|
594
642
|
managedNow,
|
|
595
643
|
effectiveNow: centerEffective,
|
|
596
644
|
},
|
|
@@ -614,6 +662,7 @@ export function buildConfigCatalog(inputs) {
|
|
|
614
662
|
centerManaged: rows.filter((x) => x.center?.managedNow === true).length,
|
|
615
663
|
},
|
|
616
664
|
rows,
|
|
665
|
+
retired,
|
|
617
666
|
};
|
|
618
667
|
}
|
|
619
668
|
//# sourceMappingURL=config-catalog.js.map
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { Model } from "@sema-agent/core";
|
|
9
9
|
import type { ServiceConfig } from "../config-types.js";
|
|
10
|
-
import {
|
|
10
|
+
import type { SealedKeyOpener } from "../sealed-key.js";
|
|
11
11
|
import type { Logger } from "../observability/logger.js";
|
|
12
12
|
import type { EffectiveConfig } from "./types.js";
|
|
13
13
|
import { type ModelRefusalVerdict } from "../model-entry-refusal.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveActiveTiers } from "@sema-agent/settings-schema";
|
|
2
|
-
import {
|
|
2
|
+
import { modelKeyPoison } from "../key-resolver.js";
|
|
3
3
|
import { applyAutoCompactWindow, buildModelCostKey, findUnmatchableToolNames, formatUnmatchableToolNames, parseAutonomy } from "../config.js";
|
|
4
4
|
import { buildModelCompat, readModelCompat } from "../model-compat.js";
|
|
5
5
|
import { validateCommandRules } from "../runtime-governance.js";
|
|
@@ -267,11 +267,11 @@ function stageModelPlane(config, eff, logger, sealedKeys) {
|
|
|
267
267
|
const s = m.sealedApiKey;
|
|
268
268
|
if (!sealedKeys) {
|
|
269
269
|
logger?.warn("sema_registry_model_sealed_key_no_store", { model: m.name, publicKeyId: s.publicKeyId, hint: "no sealed-key store on this host (boot custody init failed or lane unwired) — key POISONED: tasks on this model fail loud (no apiKeyEnv fallback, no gateway fallback)" });
|
|
270
|
-
modelApiKeys[m.name] =
|
|
270
|
+
modelApiKeys[m.name] = modelKeyPoison({ source: "sealed", reason: "no_key_store", publicKeyId: s.publicKeyId });
|
|
271
271
|
}
|
|
272
272
|
else if (!sealedKeys.has(s.publicKeyId)) {
|
|
273
273
|
logger?.warn("sema_registry_model_sealed_key_no_private_key", { model: m.name, publicKeyId: s.publicKeyId, held: sealedKeys.ids(), hint: "ciphertext targets a private key this host doesn't hold (rotated away / other host) — key POISONED: tasks on this model fail loud until the operator re-pastes the key in the web UI (it seals against the newest registered public key)" });
|
|
274
|
-
modelApiKeys[m.name] =
|
|
274
|
+
modelApiKeys[m.name] = modelKeyPoison({ source: "sealed", reason: "stale_ciphertext", publicKeyId: s.publicKeyId });
|
|
275
275
|
}
|
|
276
276
|
else {
|
|
277
277
|
try {
|
|
@@ -279,15 +279,14 @@ function stageModelPlane(config, eff, logger, sealedKeys) {
|
|
|
279
279
|
}
|
|
280
280
|
catch (err) {
|
|
281
281
|
logger?.warn("sema_registry_model_sealed_key_open_failed", { model: m.name, publicKeyId: s.publicKeyId, err: String(err), hint: "corrupt/foreign ciphertext — key POISONED: tasks on this model fail loud (no apiKeyEnv fallback, no gateway fallback)" });
|
|
282
|
-
modelApiKeys[m.name] =
|
|
282
|
+
modelApiKeys[m.name] = modelKeyPoison({ source: "sealed", reason: "sealed_decrypt_failed", publicKeyId: s.publicKeyId, errKind: err instanceof Error ? err.name : "unknown" });
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
else if (m.apiKeyEnv) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
logger?.warn("sema_registry_model_key_env_missing", { model: m.name, apiKeyEnv: m.apiKeyEnv, hint: "env var not set in this service — model falls back to the gateway key" });
|
|
287
|
+
modelApiKeyEnv[m.name] = m.apiKeyEnv;
|
|
288
|
+
if (!process.env[m.apiKeyEnv])
|
|
289
|
+
logger?.warn("sema_registry_model_key_env_missing", { model: m.name, apiKeyEnv: m.apiKeyEnv, hint: `env var ${m.apiKeyEnv} not set (or empty) in this service — key POISONED: tasks on this model fail loud naming ${m.apiKeyEnv} (no gateway fallback) until it is set; or drop apiKeyEnv from the entry to use the gateway key on purpose` });
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
292
|
const quotaWeights = {};
|
|
@@ -33,6 +33,23 @@
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const CONFIG_APPLY_GROUPS: readonly ["limitsHttp", "approvalGate", "modelPlane"];
|
|
35
35
|
export type ConfigApplyGroup = (typeof CONFIG_APPLY_GROUPS)[number];
|
|
36
|
+
/**
|
|
37
|
+
* S-810(车QU codex r1 [high] F1,验真后修)—— 一组在**热腿**被整组拒之后,新进程在 **boot 腿**上对同一候选重判会怎样。每组一格的闭集
|
|
38
|
+
* (`satisfies Record<ConfigApplyGroup, …>`:加一组 ⇒ 这里编译红,不许静默落进某一格)。部分应用的拍据此决定能不能发重启信号
|
|
39
|
+
* (`boot/config-center.ts` 的 `signalRestart`):
|
|
40
|
+
* · `"refuses-group"` —— boot 腿同一判据、同样整组拒,其余组照落 ⇒ 重启收敛(新进程的 boot 快照就是这份候选,同一差异不再签)。
|
|
41
|
+
* `limitsHttp`:`stageLimits` 不分腿。
|
|
42
|
+
* · `"may-refuse-boot"` —— boot 腿的结局取决于那一刻的部署事实,可能整个进程起不来 ⇒ 照信号重启不保证收敛(可能把一台还在服务的
|
|
43
|
+
* 实例重启成起不来),信号扣下(= 7.105.0 部分应用拍的姿态),差异照写一条 warn。
|
|
44
|
+
* `approvalGate`:boot 腿**不判**「门意图可服务」(店还没建,`apply-effective.ts` `unserviceableOnLeg`),装配完由 stage-07 对整份
|
|
45
|
+
* config 判同一只 `gateIntentUnserviceableReason` ⇒ 拒启;坏形那一臂 boot 腿同样整组拒(会收敛),但组拒记账不带成因码 —— 按组保守。
|
|
46
|
+
* `modelPlane`:boot 腿组拒后回落 LKG / env 的模型面,两者都没有缺省模型的部署在 stage-02 `default-model-resolvable` 拒启。
|
|
47
|
+
*/
|
|
48
|
+
export declare const BOOT_REJUDGE_OF_REFUSED_GROUP: {
|
|
49
|
+
readonly limitsHttp: "refuses-group";
|
|
50
|
+
readonly approvalGate: "may-refuse-boot";
|
|
51
|
+
readonly modelPlane: "may-refuse-boot";
|
|
52
|
+
};
|
|
36
53
|
/** 一组的收敛状态(读面形对所有组相同)。 */
|
|
37
54
|
export interface ConfigApplyGroupState {
|
|
38
55
|
/** 本组最后一次**真的落地**的源版本(身份标)。 */
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export const CONFIG_APPLY_GROUPS = ["limitsHttp", "approvalGate", "modelPlane"];
|
|
2
|
+
export const BOOT_REJUDGE_OF_REFUSED_GROUP = {
|
|
3
|
+
limitsHttp: "refuses-group",
|
|
4
|
+
approvalGate: "may-refuse-boot",
|
|
5
|
+
modelPlane: "may-refuse-boot",
|
|
6
|
+
};
|
|
2
7
|
export function refusedGroups(report) {
|
|
3
8
|
return CONFIG_APPLY_GROUPS.flatMap((group) => {
|
|
4
9
|
const r = report.groups[group].rejected;
|
|
@@ -10,6 +10,23 @@ export interface CenterEndpoint {
|
|
|
10
10
|
readonly baseUrl: string;
|
|
11
11
|
readonly credential: CenterCredentialSource;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* S-866 ④ —— 「中心车道配齐」的**唯一**谓词:基址 ∧ **声明了**凭证(S-651:按声明,不按此刻读不读得出)∧ worker。
|
|
15
|
+
*
|
|
16
|
+
* 三处同调、不许各抄一份门:租约管理器(`fleet-lease.ts` `createFleetLeaseFromEnv`)、fleet 客户端的用量环
|
|
17
|
+
* (`fleet-client.ts` `startFleetClientFromEnv`)、用量累加器(`boot/budget-tracing.ts`)。公告环另要一件可达性声明
|
|
18
|
+
* `FLEET_ADVERTISE_ADDRESS` —— 那是公告环自己的第四件,不在本谓词里:用量是出站上报,与「中心能不能打到我」无关
|
|
19
|
+
* (7.105.0 及以前累加器与用量环都挂在公告地址上,不公告的引擎于是从不报用量,租约的已耗量只剩中心自己的估计)。
|
|
20
|
+
*/
|
|
21
|
+
export declare function centerLaneConfigured<C extends {
|
|
22
|
+
readonly configCenter?: (CenterEndpoint & {
|
|
23
|
+
readonly worker?: string | undefined;
|
|
24
|
+
}) | undefined;
|
|
25
|
+
}>(cfg: C): cfg is C & {
|
|
26
|
+
readonly configCenter: NonNullable<C["configCenter"]> & {
|
|
27
|
+
readonly worker: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
13
30
|
/** 中心路由闭集。 */
|
|
14
31
|
export type CenterRoute = {
|
|
15
32
|
readonly kind: "effective";
|
|
@@ -10,6 +10,10 @@ export const SETTINGS_SCHEMA_MAJOR = (() => {
|
|
|
10
10
|
throw new Error(`cannot derive ${SCHEMA_MAJOR_HEADER}: @sema-agent/settings-schema package.json has version ${JSON.stringify(version)}`);
|
|
11
11
|
return m[1];
|
|
12
12
|
})();
|
|
13
|
+
export function centerLaneConfigured(cfg) {
|
|
14
|
+
const cc = cfg.configCenter;
|
|
15
|
+
return cc !== undefined && cc.baseUrl !== "" && cc.credential.declared && cc.worker !== undefined && cc.worker !== "";
|
|
16
|
+
}
|
|
13
17
|
export function pullViewQuery(view) {
|
|
14
18
|
const parts = [];
|
|
15
19
|
if (view.principal !== undefined)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* S-866 ②(设计稿 v1.1 §2②)—— 「这台引擎**此刻**是不是真的接着中心」的两件读数:最近一次实拉的结局(`lastPull`)与生效修订号
|
|
3
|
+
* (`effectiveRevision`)。属主 = config-center 运行时(`boot/config-center.ts` 的 `centerPullState()`);读者 = caps `centerWiring`。
|
|
4
|
+
*
|
|
5
|
+
* 纯叶(零值 import):词表与读面形住这里,运行时与读面两侧都从这里取型,不各写一份。
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 最近一次**实拉**的结局 —— 新状态,运行时只此一枚。闭集:
|
|
9
|
+
* · `none` —— 本进程还没有一次中心实拉落地(LKG 起服 / env 兜底起服 / 拉取还在飞 / 配置源是本地目录 `CONFIG_PROVIDER=local`);
|
|
10
|
+
* · `ok` —— 最近一拍拉取 + 处理完成(boot 实拉、迟到 boot 到货、refresh 拍任一;304 与被候选门整拒的拍也算:中心答了);
|
|
11
|
+
* · `failed` —— 最近一个 refresh 拍抛了(中心超时 / 不可达 / 读不了 / 应用抛错 —— 与 `POST /v1/admin/config/refresh` 的 `"failed"` 同一判)。
|
|
12
|
+
*/
|
|
13
|
+
export declare const CENTER_PULL_STATES: readonly ["none", "ok", "failed"];
|
|
14
|
+
export type CenterPullState = (typeof CENTER_PULL_STATES)[number];
|
|
15
|
+
/** `centerPullState()` 的产物(纯数据)。 */
|
|
16
|
+
export interface CenterPullView {
|
|
17
|
+
readonly lastPull: CenterPullState;
|
|
18
|
+
/**
|
|
19
|
+
* 生效修订号 —— 与 `/health.configAppliedVersion` **同一只** ledger 视图取值(同一事实的第三个面:`/health` 与
|
|
20
|
+
* `GET /v1/diagnostics/wiring` 是运维面,caps 是调用方面);`updatedAt` 取最近一份整套落地的候选(`latestEffective`)的
|
|
21
|
+
* `updatedAt`。`null` = 还没有一代真落地,或 ledger 的已应用代与整套落地的那一代对不上(部分应用窗 / boot 带域错的候选)——
|
|
22
|
+
* 给不出一对同代的 `{version, updatedAt}` 就不拼一对(拼出来的是两代各取一半)。
|
|
23
|
+
*/
|
|
24
|
+
readonly effectiveRevision: {
|
|
25
|
+
readonly version: number;
|
|
26
|
+
readonly updatedAt: string;
|
|
27
|
+
} | null;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=pull-state.d.ts.map
|
package/dist/config-types.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* see test/module-cycle-gate.test.ts header on verbatimModuleSyntax). */
|
|
8
8
|
import type { ReadFaceSource } from "./read-face-posture.js";
|
|
9
9
|
import type { PostureSource } from "./posture-source.js";
|
|
10
|
-
import type {
|
|
10
|
+
import type { SealedCustodyPoison } from "./key-resolver.js";
|
|
11
11
|
import type { ModelEntryRefusal } from "./model-entry-refusal.js";
|
|
12
|
-
import type { A2aServerSpec, CompliancePosture, CrossSessionDialogExpiry, CrossSessionInboundSetting, FileHistoryRetentionPolicy, LockedKey, McpServerSpec, Model, ModelRoles, RetentionPolicy, WriteProtectedEntry } from "@sema-agent/core";
|
|
12
|
+
import type { PermissionMode, A2aServerSpec, CompliancePosture, CrossSessionDialogExpiry, CrossSessionInboundSetting, FileHistoryRetentionPolicy, LockedKey, McpServerSpec, Model, ModelRoles, RetentionPolicy, ShellGateDoctrine, WriteProtectedEntry } from "@sema-agent/core";
|
|
13
13
|
import type { ApprovalHmacKey, PrincipalJwtKey } from "./auth-keys.js";
|
|
14
14
|
import type { ElicitationThrottle } from "./elicitation.js";
|
|
15
15
|
import type { QuestionThrottle } from "./question.js";
|
|
@@ -54,6 +54,13 @@ export type RetentionMode = (typeof RETENTION_MODES)[number];
|
|
|
54
54
|
*/
|
|
55
55
|
export declare const CONFIG_PROVIDER_WORDS: readonly ["local", "remote"];
|
|
56
56
|
export type ConfigProviderWord = (typeof CONFIG_PROVIDER_WORDS)[number];
|
|
57
|
+
/**
|
|
58
|
+
* S-866 ① —— `DB_BACKEND` 的闭集词表(**一处**:`config.ts` 的枚举解析、配置目录的 enum 行、caps `store.declared` / `store.backend`
|
|
59
|
+
* 三处共读;S-2 设计稿 v1 写的契约包 `STORE_ENGINES` 不存在,搬进契约包是 [ref] A-5 的另票)。`mysql` = 任一 MySQL 协议服务器
|
|
60
|
+
* (MySQL / TiDB / MariaDB);`local` = 本机文件店;`memory` = 纯内存(显式 opt-out,或多租裸 boot 的缺省)。
|
|
61
|
+
*/
|
|
62
|
+
export declare const DB_BACKEND_WORDS: readonly ["mysql", "pg", "local", "memory"];
|
|
63
|
+
export type DbBackendWord = (typeof DB_BACKEND_WORDS)[number];
|
|
57
64
|
/** [ref] §3/§4 —— sweep lane 的节律与灰度档(语义与三问见 {@link ServiceConfigFlat.retentionSweep})。 */
|
|
58
65
|
export interface RetentionSweepConfig {
|
|
59
66
|
/** `audit-only` = 照跑照判、只记 `audit_only` 行,**不调任何破坏性方法**;`enforce` = 真删。默认前者。 */
|
|
@@ -548,8 +555,9 @@ export interface ServiceConfigFlat {
|
|
|
548
555
|
* 🔴 只活在内存 —— 绝不落日志/盘/任何序列化面。互斥语义(registry-core 契约):模型带 sealedApiKey
|
|
549
556
|
* ⇒ 它的 apiKeyEnv 引用不采(sealed 压过 env-NAME,解封失败也不回落——fail-loud 见 applyEffective)。
|
|
550
557
|
* Env path: empty;populated ONLY by applyEffective(重赋值;keyResolver 随 boot/refresh 重建)。 */
|
|
551
|
-
/** 值=解封明文
|
|
552
|
-
|
|
558
|
+
/** 值=解封明文 或托管来源的毒丸(`SealedCustodyPoison`,解封失败标记;key-resolver 对其任务级 throw,恒不落 gateway key 兜底)。
|
|
559
|
+
* env 来源的毒丸(S-896 `env_missing`)不进这张表:key 链在取值时按 `modelApiKeyEnv` 现判。 */
|
|
560
|
+
modelApiKeys: Record<string, string | SealedCustodyPoison>;
|
|
553
561
|
/**
|
|
554
562
|
* S-704 —— **已发布但本部署不可用**的目录条目:catalog NAME → 拒因(`model-entry-refusal.ts` 的闭集码
|
|
555
563
|
* `config.model_no_brain` / `config.model_entry_invalid` + 上游 id + 一句出路,不含任何值)。
|
|
@@ -842,9 +850,10 @@ export interface ServiceConfigFlat {
|
|
|
842
850
|
* 今天「能用」。缺省翻面留到下一个 major,翻之前生态有一版时间适配。托管清单推荐开
|
|
843
851
|
* (`docs/DEPLOY-PREREQS.md`)。
|
|
844
852
|
* 运维读面(2026-09-22 主会话验收订正:车原写「`GET /v1/diagnostics/wiring` 的 `executionLane.requireExecutionLane`」,
|
|
845
|
-
*
|
|
853
|
+
* 而该端点当时**没有** `executionLane` 段、`src/` 零投影 —— 一句没兑现的承诺,按 [ref] 不信 JSDoc 只信实现行的纪律改写):
|
|
846
854
|
* boot 期 `exec_lane_selected` 一行(`config.ts` 装配尾,带 `lane` / `source`)+ `GET /v1/config/catalog` 的目录行。
|
|
847
855
|
* 本键的**有效值今天没有运行期读面**;要出就随 S-602 的执行座三态在一处铸,不在这里单独长一位。
|
|
856
|
+
* (S-281 起诊断面**有了** `executionLane` 段,但它就是能力面那一只投影 `{provider, toolsOnThisHost, isolated?}`,**不带**本键。)
|
|
848
857
|
*/
|
|
849
858
|
requireExecutionLane: boolean;
|
|
850
859
|
remoteExec?: {
|
|
@@ -904,6 +913,7 @@ export interface ServiceConfigFlat {
|
|
|
904
913
|
provider: "host";
|
|
905
914
|
workspaceBase?: string;
|
|
906
915
|
commandTimeoutMs?: number;
|
|
916
|
+
singleMachineDefault?: true;
|
|
907
917
|
} | {
|
|
908
918
|
provider: "device";
|
|
909
919
|
/** `DEVICE_DELIVERY_TIMEOUT_MS`(默认 10s)= 等在途槽的上限;到期 = `device.busy`(§5.5)。 */
|
|
@@ -992,7 +1002,7 @@ export interface ServiceConfigFlat {
|
|
|
992
1002
|
* MYSQL_* replacement named (see RETIRED_ENVS in config.ts). `mysql` reads MYSQL_* coords only.
|
|
993
1003
|
* TiDB itself stays fully supported (any MySQL-protocol engine works — memory no longer needs a VECTOR
|
|
994
1004
|
* column since [ref] moved it onto the file engine). Env: DB_BACKEND. */
|
|
995
|
-
dbBackend:
|
|
1005
|
+
dbBackend: DbBackendWord;
|
|
996
1006
|
/** clay 拍(2026-07-27):operator 是否显式设了 DB_BACKEND。main.ts 的降级判据——**默认推导**的
|
|
997
1007
|
* local(裸 boot)在 mkdir/ensure 失败时降级 memory + warn + gauge(auto-DB 不可达先例);
|
|
998
1008
|
* **显式** DB_BACKEND=local 失败仍 fail-loud(operator 要了 durable,静默丢=丢数据)。 */
|
|
@@ -1623,8 +1633,12 @@ export interface ServiceConfigFlat {
|
|
|
1623
1633
|
* Absent/unset = `undefined` = **zero behavior change** (this is a tighten-ONLY opt-in, never a
|
|
1624
1634
|
* default — a deployment must explicitly choose it); `"always"` = CC-strict parity (every Bash asks). Any
|
|
1625
1635
|
* other value (incl. `"off"`) is treated as unset — this knob has no "off" value to opt BACK OUT with once a
|
|
1626
|
-
* session's baseline already tightened elsewhere (tightenTaskSpec would reject that as a loosen anyway).
|
|
1627
|
-
|
|
1636
|
+
* session's baseline already tightened elsewhere (tightenTaskSpec would reject that as a loosen anyway).
|
|
1637
|
+
* 🔴 **S-877(core 7.34.0 [ref])起值域 = core `ShellGateDoctrine` 本尊(只剩 `"always"`)**:`"classify"` 退役 ——
|
|
1638
|
+
* 引擎把形状档装在**每一种模式**的全权 shell 上(不再是一个运维选的档),它当年**额外**买到的那一半(bypass 请求下
|
|
1639
|
+
* shell 照问)没有忠实的继任值(引擎按模式放行 bypass 下的普通 ask)⇒ 配 `classify` 的部署 **boot 拒启**并指路
|
|
1640
|
+
* (`config.ts` 的解析臂),不静默当成 no-op(那是安全轴上的静默放松)。上面几段关于 `"classify"` 的语义是历史记录。 */
|
|
1641
|
+
manualModeShellGate?: ShellGateDoctrine;
|
|
1628
1642
|
/** [ref] ③(黑板 [ref]/[ref],core [ref] 合修)—— CC `permissions.disableAutoMode` 的本地镜像
|
|
1629
1643
|
* (`PERMISSIONS_DISABLE_AUTO_MODE`,布尔词表旋钮,opt-in 缺省 false):本部署对**每个** principal 把
|
|
1630
1644
|
* `RuntimeCaps.autoMode` 折成 `false` = org deny 位(core [ref] 三态谓词 `runtimeCaps?.autoMode !== false`
|
|
@@ -1906,6 +1920,13 @@ export interface ServiceConfigFlat {
|
|
|
1906
1920
|
* 把批关掉(同腿后续的卡人批不动)、把兄弟连坐成 VOID(裸 `false` = 人拒)。
|
|
1907
1921
|
*/
|
|
1908
1922
|
unattendedApprovalPolicy: UnattendedApprovalPolicy;
|
|
1923
|
+
/**
|
|
1924
|
+
* S-877 候裁 15 → B(`UNATTENDED_PERMISSION_MODE`)—— 本仓**自铸** spec、无调用方可表态、无审批席的腿(leader worker / leader 修复腿 /
|
|
1925
|
+
* run-local)的 `TaskSpec.permissionMode`。闭集 = core `PERMISSION_MODES`,缺省 `bypassPermissions`(写门 / 形状层 = 7.105.0;写保护经 `createUnattendedWriteProtectionPolicy` 从问改拒;其余六类释放 = 宽化,候裁 18 D),坏值拒启。
|
|
1926
|
+
* 规则 / 三问 / 写面 / 射程外**一处成文** = `src/unattended-permission-mode.ts` 模块头注;唯一读函数 `unattendedPermissionMode(config)`。
|
|
1927
|
+
* 纯部署级:不读任何客户端表态、不参与托管姿态(这些腿不是请求)。
|
|
1928
|
+
*/
|
|
1929
|
+
unattendedPermissionMode: PermissionMode;
|
|
1909
1930
|
/** [ref]① (clay A 案 = workflow 权限全面 CC parity): workflow 子 agent 的默认权限基线与主 LLM 同权(base `{}`)。
|
|
1910
1931
|
* 安全论证:主 LLM 与子 agent 同 root 同信任域,主 LLM 本就能写这棵树([ref] ask 门照管),单独钳子 agent 的
|
|
1911
1932
|
* 安全增益≈0(只防绕路不防直路的门不是边界);实测产品代价=[ref]A 死锁。`WORKFLOW_AGENTS_READONLY=true` =
|
|
@@ -1959,10 +1980,10 @@ export interface ServiceConfigFlat {
|
|
|
1959
1980
|
* 行名的是**文件**不是配置**目录**(`.sema`/`.claude` 底下还住着 agents/skills/hooks 与记忆库 —— 模型
|
|
1960
1981
|
* 当作日常材料读写的东西);同族工具的 token **存储**(`.credentials.json`/`.codex/auth.json` …)归
|
|
1961
1982
|
* `credentials` 档,不归本档 ⇒ 为排查 agent 配置而关掉本档的部署,凭证行照样拦着。
|
|
1962
|
-
* 🔴 **缺席 = 不铸 ⇒
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1965
|
-
*
|
|
1983
|
+
* 🔴 **缺席 = 不铸 ⇒ core 的出厂缺省 `READ_DENY_DEFAULT_TIERS` = `credentials` + 家目录锚定的 `agent-config`**
|
|
1984
|
+
* (core 7.34.0 R-2 起在岗;7.22.0–7.33.x 是空选择 = OFF,7.21.x 及以前是「除 shell-history 外全开」—— 7.106.0 合并复审 X10-L2
|
|
1985
|
+
* 把这句陈旧的「缺席 = OFF」改真)。显式 `none` = 空姿态(什么都不拒);要更多档**显式写下**(例 `credentials,browser,wallet,agent-config`)。
|
|
1986
|
+
* 本仓**不复制上游缺省**:这里只记「不铸」,解析归引擎。
|
|
1966
1987
|
* **仅 deployment 席**:TaskSpec 上没有同名键,
|
|
1967
1988
|
* 任务/受治脚本无法据此放宽自己的部署(core 侧的设计,与本仓「部署级旋钮无条件施加」同向)。 */
|
|
1968
1989
|
readDenyBuiltinTiers?: readonly string[];
|
|
@@ -2066,6 +2087,12 @@ export interface ServiceConfigFlat {
|
|
|
2066
2087
|
dryRun: boolean;
|
|
2067
2088
|
worker?: string;
|
|
2068
2089
|
};
|
|
2090
|
+
/** S-866 ③(E-2):租约**连接级**失败(中心 401 / 403 / 400、凭证文件不可读;不可达 / 5xx / 超时 / 坏体)时的姿态 ——
|
|
2091
|
+
* `true` ⇒ 计费入口答 503 `fleet.lease_unavailable`(`Retry-After` 5s);`false` ⇒ 照旧放行(AP 姿态,warn + 计数)。
|
|
2092
|
+
* `FLEET_LEASE_FAIL_CLOSED`(布尔词表,词表外拒启);**缺席随部署姿态派生**:`REQUIRE_PRINCIPAL=true` ⇒ `true`,单用户 ⇒ `false`;
|
|
2093
|
+
* 显式值压过派生(部署级旋钮无条件,与 `READ_FACE` 缺省按 posture 派生 S-167 同形)。只在装了租约管理器的部署上有意义
|
|
2094
|
+
* (`lease:"absent"` 的部署不参与);生效值上 caps `centerWiring.failMode`。 */
|
|
2095
|
+
fleetLeaseFailClosed: boolean;
|
|
2069
2096
|
/** S-698(design-325 §2):中心凭证**续签提前量**(ms)—— `SEMA_REGISTRY_TOKEN_FILE` 指向人的登录会话信封
|
|
2070
2097
|
* (`kind:"user-session"`)时,访问令牌离到期 ≤ 本值即由引擎续签并原子改写同一文件(`center-credential-renewer.ts`)。
|
|
2071
2098
|
* 缺省 5 min;`0` = 关续签、只读信封(壳负责续);其余必须是整数毫秒且落在 `CENTER_CREDENTIAL_RENEW_LEAD_MIN_MS`(一次续签请求的
|
|
@@ -2086,7 +2113,7 @@ export type ServiceStoreConfig = Pick<ServiceConfigFlat, "sessionBackend" | "ses
|
|
|
2086
2113
|
export type ServiceModelPlaneConfig = Pick<ServiceConfigFlat, "gatewayBaseUrl" | "gatewayApiKey" | "gatewayFallbackUrls" | "gatewayMaxRetries" | "anthropic" | "resilience" | "model" | "envModel" | "models" | "modelApiKeyEnv" | "modelApiKeys" | "modelRefusals" | "modelQuotaWeights" | "tiers" | "projects" | "roles" | "atModelAllowlist" | "cascadeLadder" | "degrade">;
|
|
2087
2114
|
/** 组:approval(审批 / HITL 门)。`directDoorActive` 无 env 解析腿(装配层三域合取的产物),但语义上
|
|
2088
2115
|
* 就是本组的门状态,故进组;`parseApprovalDomain` 的返回类型相应是 `Omit<…, "directDoorActive">`。 */
|
|
2089
|
-
export type ServiceApprovalConfig = Pick<ServiceConfigFlat, "approvalRequire" | "approvalDeny" | "approvalTimeoutSec" | "approvalAutoBudget" | "approvalNeverAuto" | "approvalHmacKeys" | "durableApproval" | "durableApprovalSource" | "streamAskWindowMsSource" | "directApprovalDoor" | "directDoorActive" | "resourceSuspend" | "resourceSuspendTtlSec" | "resourceSuspendTotalTokens" | "resourceSuspendTotalBudgetUsd" | "resourceSuspendMaxSlices" | "askQuestionEnabled" | "questionThrottle" | "toolApprovalEnabled" | "permissionRulesEnabled" | "permissionRulesEnabledExplicit" | "streamAskWindowMarginMs" | "streamApproval" | "unattendedApprovalPolicy" | "mcpElicitation" | "sensitiveWritePatterns" | "writeProtectedPaths" | "manualModeShellGate" | "permissionsDisableAutoMode" | "autoModeClassifierFallback" | "autoModeClassifierTimeoutMs" | "crossSessionInbound" | "crossSessionDialogExpiry">;
|
|
2116
|
+
export type ServiceApprovalConfig = Pick<ServiceConfigFlat, "approvalRequire" | "approvalDeny" | "approvalTimeoutSec" | "approvalAutoBudget" | "approvalNeverAuto" | "approvalHmacKeys" | "durableApproval" | "durableApprovalSource" | "streamAskWindowMsSource" | "directApprovalDoor" | "directDoorActive" | "resourceSuspend" | "resourceSuspendTtlSec" | "resourceSuspendTotalTokens" | "resourceSuspendTotalBudgetUsd" | "resourceSuspendMaxSlices" | "askQuestionEnabled" | "questionThrottle" | "toolApprovalEnabled" | "permissionRulesEnabled" | "permissionRulesEnabledExplicit" | "streamAskWindowMarginMs" | "streamApproval" | "unattendedApprovalPolicy" | "unattendedPermissionMode" | "mcpElicitation" | "sensitiveWritePatterns" | "writeProtectedPaths" | "manualModeShellGate" | "permissionsDisableAutoMode" | "autoModeClassifierFallback" | "autoModeClassifierTimeoutMs" | "crossSessionInbound" | "crossSessionDialogExpiry">;
|
|
2090
2117
|
/** 组:memory(记忆面 + TOC 同步腿)。 */
|
|
2091
2118
|
export type ServiceMemoryConfig = Pick<ServiceConfigFlat, "memoryEngineEnabled" | "memoryEngineDir" | "memoryEngineRemoteLaneAllowed" | "memoryEngineBackend" | "memoryScope" | "memoryPersistenceCapable" | "memorySync" | "memoryEmbedder" | "memoryOrgAdmissionMode" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "memoryConsolidationDriver" | "memoryOrgDirectoryJson" | "memoryOrgGrantTtlMs" | "memoryOrgUnavailableBackoffMs" | "projectMemoryEnabled" | "syncImportLeaseStaleSec">;
|
|
2092
2119
|
/** 组:auth(鉴权 / 身份 / 治理棒)。`commandPolicy` 只有 sema-registry 腿(无 env 标量形),故 env 解析
|
|
@@ -2103,7 +2130,7 @@ export type ServiceLimitsHttpConfig = Pick<ServiceConfigFlat, "port" | "attachme
|
|
|
2103
2130
|
/** 组:observability(可观测)。 */
|
|
2104
2131
|
export type ServiceObservabilityConfig = Pick<ServiceConfigFlat, "metricsToken" | "traceToken" | "toolTrace" | "traceThinking" | "logLevel" | "otel">;
|
|
2105
2132
|
/** 组:integrations(外部集成)。`mcpServers` / `a2aPeers` 由 sema-registry 适配器填(无 env 腿),归本组。 */
|
|
2106
|
-
export type ServiceIntegrationsConfig = Pick<ServiceConfigFlat, "pluginsAllowHosts" | "mcpServers" | "a2aPeers" | "a2aServe" | "configBootFetchBudgetMs" | "gitApiBaseUrl" | "gitApiToken" | "gitApiKind" | "defaultScenario" | "skillsDir" | "centerCredentialRenewLeadMs" | "configCenter" | "configProvider" | "configLocalDir">;
|
|
2133
|
+
export type ServiceIntegrationsConfig = Pick<ServiceConfigFlat, "pluginsAllowHosts" | "mcpServers" | "a2aPeers" | "a2aServe" | "configBootFetchBudgetMs" | "gitApiBaseUrl" | "gitApiToken" | "gitApiKind" | "defaultScenario" | "skillsDir" | "centerCredentialRenewLeadMs" | "configCenter" | "fleetLeaseFailClosed" | "configProvider" | "configLocalDir">;
|
|
2107
2134
|
/** 九个组槽。每组恒在场(`loadConfig` / `attachConfigGroups` 装好才交出配置),故不可选——新代码写
|
|
2108
2135
|
* `config.modelPlane.model` 不需要 `?.`(可选组会把 `Model` 污染成 `Model | undefined`)。 */
|
|
2109
2136
|
export interface ServiceConfigGroups {
|
package/dist/config-types.js
CHANGED
|
@@ -2,6 +2,7 @@ import { DRAIN_GRACE_FLOOR_MS } from "@sema-agent/settings-schema/fleet";
|
|
|
2
2
|
export const TASK_WRITE_FACE_ESCALATIONS = ["allow", "refuse"];
|
|
3
3
|
export const RETENTION_MODES = ["audit-only", "enforce"];
|
|
4
4
|
export const CONFIG_PROVIDER_WORDS = ["local", "remote"];
|
|
5
|
+
export const DB_BACKEND_WORDS = ["mysql", "pg", "local", "memory"];
|
|
5
6
|
export const MEMORY_CONSOLIDATION_MIN_INTERVAL_SEC = 300;
|
|
6
7
|
export const MAX_TIMER_DELAY_MS = 2_147_483_647;
|
|
7
8
|
export const AUTO_MODE_CLASSIFIER_TIMEOUT_BOUNDS = { minMs: 1_000, maxMs: MAX_TIMER_DELAY_MS };
|