@sema-agent/server 7.124.0 → 7.125.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 +138 -0
- package/USAGE.md +46 -8
- package/dist/audit.d.ts +27 -5
- package/dist/audit.js +42 -8
- package/dist/boot/execution-env.d.ts +33 -1
- package/dist/boot/execution-env.js +31 -2
- package/dist/boot/resolve-spec.js +4 -3
- package/dist/boot/session-faces.d.ts +14 -1
- package/dist/boot/session-faces.js +6 -5
- package/dist/boot/stage-02-web-admin-pull.js +5 -1
- package/dist/boot/stage-05-execution-env.js +6 -2
- package/dist/boot/stage-09-leader.d.ts +1 -1
- package/dist/boot/stage-10-http-server.d.ts +1 -1
- package/dist/boot/web-admin.js +130 -140
- package/dist/capabilities/center-wiring.d.ts +2 -1
- package/dist/capabilities/composite-members.d.ts +1 -0
- package/dist/capabilities/composite-members.js +1 -0
- package/dist/capability-facts.d.ts +28 -3
- package/dist/capability-facts.js +20 -0
- package/dist/config-catalog.js +4 -1
- package/dist/config-d-migration.js +2 -1
- package/dist/config-lkg.d.ts +4 -1
- package/dist/config-lkg.js +16 -12
- package/dist/config-provider.d.ts +4 -1
- package/dist/config-provider.js +1 -0
- package/dist/config-types.d.ts +10 -3
- package/dist/config.js +44 -14
- package/dist/env-facts.d.ts +2 -2
- package/dist/env-facts.js +3 -2
- package/dist/fleet/fleet-bus.d.ts +24 -12
- package/dist/fleet/fleet-bus.js +4 -1
- package/dist/fleet/workspace-snapshot-residual.d.ts +10 -0
- package/dist/fleet/workspace-snapshot-residual.js +35 -0
- package/dist/hooks/hook-runner.d.ts +15 -27
- package/dist/hooks/hook-runner.js +19 -59
- package/dist/http/active-run-conflict.d.ts +3 -0
- package/dist/http/active-run-conflict.js +3 -0
- package/dist/http/admission.js +7 -7
- package/dist/http/approval-sweeps.js +2 -4
- package/dist/http/device-placement.js +1 -0
- package/dist/http/dispatch.js +1 -1
- package/dist/http/durable-run-leg.d.ts +20 -6
- package/dist/http/durable-run-leg.js +4 -4
- package/dist/http/idempotency.d.ts +83 -38
- package/dist/http/idempotency.js +38 -13
- package/dist/http/request-guards.d.ts +18 -0
- package/dist/http/request-guards.js +12 -3
- package/dist/http/resume-legs.js +7 -1
- package/dist/http/route-ctx.d.ts +3 -3
- package/dist/http/route-ctx.js +1 -1
- package/dist/http/routes/a2a-serve.js +27 -11
- package/dist/http/routes/capabilities.js +1 -0
- package/dist/http/routes/fleet.js +2 -0
- package/dist/http/routes/images.js +2 -2
- package/dist/http/routes/leader.d.ts +4 -0
- package/dist/http/routes/leader.js +13 -3
- package/dist/http/routes/observability.js +2 -0
- package/dist/http/routes/runs.d.ts +6 -2
- package/dist/http/routes/runs.js +71 -101
- package/dist/http/routes/session-sync.d.ts +3 -0
- package/dist/http/routes/session-sync.js +30 -1
- package/dist/http/routes/sessions-list.d.ts +11 -0
- package/dist/http/routes/sessions-list.js +6 -6
- package/dist/http/routes/sessions.d.ts +6 -1
- package/dist/http/routes/sessions.js +41 -10
- package/dist/http/routes/tasks.js +63 -21
- package/dist/http/run-read-face.d.ts +26 -0
- package/dist/http/run-read-face.js +67 -0
- package/dist/http/server.d.ts +4 -4
- package/dist/http/server.js +1 -2
- package/dist/http/submit-replay.d.ts +40 -0
- package/dist/http/submit-replay.js +22 -0
- package/dist/leader/endpoint.d.ts +10 -5
- package/dist/leader/endpoint.js +27 -5
- package/dist/observability/cost-quota.d.ts +51 -7
- package/dist/observability/cost-quota.js +35 -17
- package/dist/observability/fail-open.d.ts +1 -1
- package/dist/observability/fail-open.js +1 -1
- package/dist/observability/run-terminal.d.ts +5 -9
- package/dist/observability/run-terminal.js +2 -7
- package/dist/plugins/approval-ask-store-sql.js +1 -1
- package/dist/plugins/caching-session-store.d.ts +7 -2
- package/dist/plugins/caching-session-store.js +6 -0
- package/dist/plugins/device-store-sql.js +1 -1
- package/dist/plugins/ensure-index.js +22 -0
- package/dist/plugins/file-run-store.d.ts +24 -14
- package/dist/plugins/file-run-store.js +52 -12
- package/dist/plugins/leader-run-store-sql.d.ts +1 -11
- package/dist/plugins/leader-run-store-sql.js +1 -5
- package/dist/plugins/local-session-store.d.ts +35 -6
- package/dist/plugins/local-session-store.js +87 -18
- package/dist/plugins/memory-run-store.d.ts +13 -12
- package/dist/plugins/memory-run-store.js +25 -0
- package/dist/plugins/one-time-migrations.js +1 -1
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-cost-quota.js +2 -5
- package/dist/plugins/pg-pool.js +3 -0
- package/dist/plugins/pg-session-storage.d.ts +11 -1
- package/dist/plugins/pg-session-storage.js +44 -8
- package/dist/plugins/remote-env-k8s.d.ts +127 -12
- package/dist/plugins/remote-env-k8s.js +270 -27
- package/dist/plugins/run-store-sql.d.ts +26 -12
- package/dist/plugins/run-store-sql.js +50 -25
- package/dist/plugins/schema-consistency.d.ts +1 -13
- package/dist/plugins/schema-consistency.js +1 -41
- package/dist/plugins/schema-indexes.js +1 -0
- package/dist/plugins/schema-live-columns.d.ts +20 -0
- package/dist/plugins/schema-live-columns.js +42 -0
- package/dist/plugins/store-contracts.d.ts +40 -2
- package/dist/plugins/tidb-cost-quota.d.ts +1 -1
- package/dist/plugins/tidb-cost-quota.js +2 -5
- package/dist/plugins/tidb-pool.js +14 -3
- package/dist/plugins/tidb-session-store.d.ts +22 -2
- package/dist/plugins/tidb-session-store.js +33 -6
- package/dist/plugins/write-behind-counter.d.ts +12 -5
- package/dist/plugins/write-behind-counter.js +14 -7
- package/dist/prompts-domain-validate.js +3 -2
- package/dist/rules-consent.d.ts +2 -2
- package/dist/rules-consent.js +2 -2
- package/dist/run-local.js +31 -23
- package/dist/runs.d.ts +9 -0
- package/dist/runs.js +8 -0
- package/dist/runtime-governance.d.ts +3 -3
- package/dist/runtime-governance.js +2 -4
- package/dist/security.d.ts +19 -2
- package/dist/session-row.d.ts +53 -0
- package/dist/session-row.js +47 -0
- package/dist/session-sync.d.ts +6 -0
- package/dist/session-sync.js +5 -1
- package/dist/session-titler.d.ts +9 -5
- package/dist/session-titler.js +3 -1
- package/dist/spec-fields.js +2 -2
- package/dist/task-cwd.d.ts +0 -20
- package/dist/task-cwd.js +2 -10
- package/dist/tool-approval.d.ts +5 -7
- package/dist/trace/redact.d.ts +23 -50
- package/dist/trace/redact.js +58 -18
- package/dist/trace/self-minted-wire.d.ts +25 -13
- package/dist/trace/self-minted-wire.js +9 -4
- package/dist/web-admin-client/apply-effective.d.ts +10 -12
- package/dist/web-admin-client/apply-effective.js +2 -3
- package/dist/web-admin-client/candidate-gate.d.ts +69 -0
- package/dist/web-admin-client/candidate-gate.js +27 -0
- package/dist/web-admin-client/http-client.d.ts +2 -1
- package/dist/web-admin-client/http-client.js +2 -1
- package/dist/web-admin-client/pull-state.d.ts +6 -4
- package/dist/web-admin-client/read-warnings.d.ts +29 -5
- package/dist/web-admin-client/read-warnings.js +24 -4
- package/dist/web-admin-client/stage-limits.js +4 -1
- package/dist/workspace-space.d.ts +41 -0
- package/dist/workspace-space.js +5 -0
- package/package.json +3 -3
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
*
|
|
13
13
|
* **归族判据**(下游两个消费者:候选门 = 非空 ⇒ 这棵树整拒、保 LKG;逐条丢弃面 = 响亮点名、其余照用):每一种告警都是
|
|
14
14
|
* 「写了没生效」,按**失效的颗粒**分:丢的是**一条条目**(`entry-dropped`)⇒ `scope:"entry"` —— 这条条目单独不在,同域其余条目照用,
|
|
15
|
-
* 候选**不**因它整拒;丢的是一个域 / 一组键 /
|
|
15
|
+
* 候选**不**因它整拒;丢的是一个域 / 一组键 / 一份**读的**域文件 ⇒ `scope:"domain"` —— 候选门错误。`config.d` 里**读腿根本不读**的文件
|
|
16
|
+
* (`unread-config-file`:名字不是域,或是域但不便携 —— `workers.json` / `hosts.json` / 任意非域 `*.json`)⇒ `scope:"unread"` —— 不是
|
|
17
|
+
* 「读的域判形失败」,候选判官只收读腿读的域;它与逐条丢弃同一「点名不判拒」律(调用方一份文件一行 `config_unread_file`,其余照用)。(settings-schema 11 起读路径上零抬升臂:
|
|
16
18
|
* 此前「值已被收编接受」的两种告警 `hosts-grandfathered` / `legacy-governance-lifted` 随抬升臂一起退役,旧形由一次性迁移改写,
|
|
17
19
|
* 读侧遇旧形一律拒 —— 没有「不入诊断面」的那一族了。)
|
|
18
20
|
*
|
|
@@ -24,7 +26,8 @@
|
|
|
24
26
|
*/
|
|
25
27
|
import { z } from "zod";
|
|
26
28
|
import { type DroppedEntryIdentity, type DroppedEntryReasonCode, type EffectiveReadWarning } from "@sema-agent/settings-schema";
|
|
27
|
-
/** 折叠产物:`scope` 决定消费方做什么 —— `"domain"` 进候选门(`domainErrors`),`"entry"` 进逐条丢弃面(`droppedEntries`)
|
|
29
|
+
/** 折叠产物:`scope` 决定消费方做什么 —— `"domain"` 进候选门(`domainErrors`),`"entry"` 进逐条丢弃面(`droppedEntries`),
|
|
30
|
+
* `"unread"` 进读腿不读的文件面(`unreadFiles`;点名不判拒)。 */
|
|
28
31
|
export type FoldedReadWarning = {
|
|
29
32
|
readonly scope: "domain";
|
|
30
33
|
readonly domain: string;
|
|
@@ -35,7 +38,17 @@ export type FoldedReadWarning = {
|
|
|
35
38
|
readonly entry: string;
|
|
36
39
|
readonly error: string;
|
|
37
40
|
readonly reasonCode: DroppedEntryReasonCode;
|
|
41
|
+
} | ({
|
|
42
|
+
readonly scope: "unread";
|
|
43
|
+
} & UnreadConfigFile);
|
|
44
|
+
/** `config.d` 里读腿不读的一份文件(本地读腿才有;`why` / `domain` 是契约告警的原值)。 */
|
|
45
|
+
export type UnreadConfigFile = {
|
|
46
|
+
readonly file: string;
|
|
47
|
+
readonly why: "not-a-domain" | "non-portable-domain";
|
|
48
|
+
readonly domain?: string;
|
|
38
49
|
};
|
|
50
|
+
/** `config_unread_file` 一行的体(纯数据;起服 / 刷新 / 迟到起服与 `run-local` 同一体):`dir` = 本地读腿的配置根。 */
|
|
51
|
+
export declare function buildUnreadConfigFileFields(f: UnreadConfigFile, dir: string | undefined): Record<string, unknown>;
|
|
39
52
|
/** 逐条丢弃面的一行(两条读腿的 `droppedEntries` 同形,`config_entry_dropped` 日志行读它):`entry` = 被丢那条的出门形坐标(`models.1`),
|
|
40
53
|
* `error` = 哪些字段、为什么(人读),`reasonCode` = 为什么丢的**闭集词**(S-1295:settings-schema 铸、原样过境 —— 目录行的
|
|
41
54
|
* `GET /v1/models.droppedEntries[].reasonCode` 就是这同一个词,取自同一次折叠的同一行)。 */
|
|
@@ -60,13 +73,23 @@ export declare function describeSchemaIssueFields(error: unknown): string[];
|
|
|
60
73
|
/** 契约句子里**值**的位置在本仓诊断面上的写法(一个洞,不回显值;句子的固定词 —— 迁移指路、词表出路、字段名 —— 原样)。 */
|
|
61
74
|
export declare const SCHEMA_OPERAND_HOLE = "\u00ABvalue\u00BB";
|
|
62
75
|
/**
|
|
63
|
-
* 整域失效(`domain-defaulted`)的诊断文案:逐条 issue `坐标: 句子`,句子读 {@link issueSentenceOf}(与逐条丢弃面同一只)
|
|
64
|
-
* 操作数换成 {@link SCHEMA_OPERAND_HOLE}
|
|
76
|
+
* 整域失效(`domain-defaulted`)的诊断文案:逐条 issue `坐标: 句子`,句子读 {@link issueSentenceOf}(与逐条丢弃面同一只):custom issue 的结构化句子重铸、
|
|
77
|
+
* 操作数换成 {@link SCHEMA_OPERAND_HOLE};zod 内建码(含墓碑字段的 `invalid_type`)读 message 原样。读不出 issues 形 ⇒ 退回 {@link errorText}。
|
|
65
78
|
* 为什么不直接用 `error.message`:zod 4 的 message 是整份 issues 的 JSON —— 本地腿出口的引号段指纹(`redactConfigError`)会把它从第一个
|
|
66
79
|
* 引号到最后一个引号整段吞掉,契约拒句里点名的迁移 id(「旧形读写两面响亮拒、拒句点名迁移 id」)就到不了运维眼前。
|
|
67
80
|
*/
|
|
68
81
|
export declare function describeDomainIssues(error: unknown): string;
|
|
69
|
-
/** 一条读告警 → 它的诊断面(每一种都进:见文件头「归族判据」)。 */
|
|
82
|
+
/** 一条读告警 → 它的诊断面(每一种都进:见文件头「归族判据」)。按 kind 的重载只是让调用方拿到窄型(`unread` 一面没有 `error` 句)。 */
|
|
83
|
+
export declare function foldEffectiveReadWarning(w: Extract<EffectiveReadWarning, {
|
|
84
|
+
kind: "unread-config-file";
|
|
85
|
+
}>): Extract<FoldedReadWarning, {
|
|
86
|
+
scope: "unread";
|
|
87
|
+
}>;
|
|
88
|
+
export declare function foldEffectiveReadWarning(w: Exclude<EffectiveReadWarning, {
|
|
89
|
+
kind: "unread-config-file";
|
|
90
|
+
}>): Exclude<FoldedReadWarning, {
|
|
91
|
+
scope: "unread";
|
|
92
|
+
}>;
|
|
70
93
|
export declare function foldEffectiveReadWarning(w: EffectiveReadWarning): FoldedReadWarning;
|
|
71
94
|
/**
|
|
72
95
|
* 🔴 S-712 / S-1295 —— **被丢目录条目的载体行**(载体 = `EffectiveConfig.models.droppedCatalogEntries`,读腿铸,随 effective 走 —— 盘上 LKG
|
|
@@ -114,6 +137,7 @@ export declare function splitFoldedReadWarnings(warnings: readonly EffectiveRead
|
|
|
114
137
|
}>;
|
|
115
138
|
droppedEntries: DroppedConfigEntry[];
|
|
116
139
|
droppedCatalogEntries: DroppedCatalogEntry[];
|
|
140
|
+
unreadFiles: UnreadConfigFile[];
|
|
117
141
|
};
|
|
118
142
|
/** 把本次读交出的目录载体挂上 effective 的模型域(两腿同一只;空 ⇒ 不挂键)。 */
|
|
119
143
|
export declare function withDroppedCatalogEntries<E extends {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { DROPPED_ENTRY_REASON_CODES, formatConfigPath, isDisclosableIdentity, renderQuotedSentence, } from "@sema-agent/settings-schema";
|
|
3
|
+
export function buildUnreadConfigFileFields(f, dir) {
|
|
4
|
+
return {
|
|
5
|
+
...(dir !== undefined ? { dir } : {}),
|
|
6
|
+
file: f.file,
|
|
7
|
+
why: f.why,
|
|
8
|
+
...(f.domain !== undefined ? { domain: f.domain } : {}),
|
|
9
|
+
note: "config.d holds a file the local read never reads (not a domain, or a domain that is not portable) — it is not applied and does not block the candidate; move it out of config.d if it is stray",
|
|
10
|
+
};
|
|
11
|
+
}
|
|
3
12
|
export function describeSchemaIssues(error) {
|
|
4
13
|
const issues = schemaIssuesOf(error);
|
|
5
14
|
if (issues === undefined)
|
|
@@ -13,8 +22,13 @@ function issueCoordinateOf(raw) {
|
|
|
13
22
|
return Array.isArray(p) && p.length > 0 ? formatConfigPath(p) : undefined;
|
|
14
23
|
}
|
|
15
24
|
function issueSentenceOf(raw) {
|
|
16
|
-
const
|
|
17
|
-
|
|
25
|
+
const issue = typeof raw === "object" && raw !== null ? raw : {};
|
|
26
|
+
if (issue.code === "custom")
|
|
27
|
+
return contractSentenceOf(raw) ?? sentencelessCustomIssue(issueCoordinateOf(raw));
|
|
28
|
+
return typeof issue.message === "string" ? issue.message : "(unreadable issue)";
|
|
29
|
+
}
|
|
30
|
+
function sentencelessCustomIssue(at) {
|
|
31
|
+
return `(issue code "custom" at ${at ?? "(entry)"} carries no contract sentence — its message is withheld)`;
|
|
18
32
|
}
|
|
19
33
|
function contractSentenceOf(raw) {
|
|
20
34
|
const params = (typeof raw === "object" && raw !== null ? raw.params : undefined);
|
|
@@ -74,7 +88,7 @@ export function foldEffectiveReadWarning(w) {
|
|
|
74
88
|
case "unknown-keys-carried":
|
|
75
89
|
return { scope: "domain", domain: w.domain, error: keyList("unknown keys carried to consumer (spelling?): ", w.keys, w.truncatedFrom) };
|
|
76
90
|
case "unread-config-file":
|
|
77
|
-
return { scope: "
|
|
91
|
+
return { scope: "unread", file: w.file, why: w.why, ...(w.domain !== undefined ? { domain: w.domain } : {}) };
|
|
78
92
|
default: {
|
|
79
93
|
const never = w;
|
|
80
94
|
throw new Error(`unhandled EffectiveReadWarning kind: ${JSON.stringify(never)}`);
|
|
@@ -109,6 +123,7 @@ export function splitFoldedReadWarnings(warnings) {
|
|
|
109
123
|
const domainErrors = [];
|
|
110
124
|
const droppedEntries = [];
|
|
111
125
|
const droppedCatalogEntries = [];
|
|
126
|
+
const unreadFiles = [];
|
|
112
127
|
for (const w of warnings) {
|
|
113
128
|
const f = foldEffectiveReadWarning(w);
|
|
114
129
|
switch (f.scope) {
|
|
@@ -124,13 +139,18 @@ export function splitFoldedReadWarnings(warnings) {
|
|
|
124
139
|
}
|
|
125
140
|
break;
|
|
126
141
|
}
|
|
142
|
+
case "unread": {
|
|
143
|
+
const { scope: _scope, ...file } = f;
|
|
144
|
+
unreadFiles.push(file);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
127
147
|
default: {
|
|
128
148
|
const never = f;
|
|
129
149
|
throw new Error(`unhandled folded read-warning scope: ${JSON.stringify(never)}`);
|
|
130
150
|
}
|
|
131
151
|
}
|
|
132
152
|
}
|
|
133
|
-
return { domainErrors, droppedEntries, droppedCatalogEntries };
|
|
153
|
+
return { domainErrors, droppedEntries, droppedCatalogEntries, unreadFiles };
|
|
134
154
|
}
|
|
135
155
|
export function withDroppedCatalogEntries(effective, rows) {
|
|
136
156
|
if (rows.length === 0 || effective.models === undefined)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LIMITS_HTTP_FLOORS } from "../config.js";
|
|
2
2
|
import { checkCrossInvariants } from "../config-invariants.js";
|
|
3
|
+
import { COST_QUOTA_WINDOW_SEC_RANGE, costQuotaWindowSecInRange } from "../observability/cost-quota.js";
|
|
3
4
|
import { BATCH1_LIMIT_KEYS, DEFERRED_LIMIT_KEYS } from "./hot-keys-registry.js";
|
|
4
5
|
const INFRA_RATE_KEYS = ["toolCallMicroUsd", "sandboxSecMicroUsd", "egressGbMicroUsd"];
|
|
5
6
|
const okNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
@@ -8,7 +9,9 @@ const positive = (key, v) => okNum(v) && v > 0 ? { ok: true, value: v } : { ok:
|
|
|
8
9
|
const VALIDATORS = {
|
|
9
10
|
rateLimitPerMin: (v) => atLeast("rateLimitPerMin", v, 0),
|
|
10
11
|
maxPrincipalCostUsd: (v) => atLeast("maxPrincipalCostUsd", v, 0),
|
|
11
|
-
costQuotaWindowSec: (v) =>
|
|
12
|
+
costQuotaWindowSec: (v) => okNum(v) && costQuotaWindowSecInRange(v)
|
|
13
|
+
? { ok: true, value: v }
|
|
14
|
+
: { ok: false, reason: `costQuotaWindowSec must be a finite number in [${COST_QUOTA_WINDOW_SEC_RANGE.min}, ${COST_QUOTA_WINDOW_SEC_RANGE.max}] (seconds)` },
|
|
12
15
|
maxTaskCostUsd: (v) => atLeast("maxTaskCostUsd", v, 0),
|
|
13
16
|
maxTaskTokens: (v) => atLeast("maxTaskTokens", v, 0),
|
|
14
17
|
infraCostRates: (v, baseline) => {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace persistence by **space** (k8s lane) — the closed word set, the defaults, the retention domain and
|
|
3
|
+
* the policy shape (pure leaf: no value imports, so `config.ts`, the capability fact and the adapter in `plugins/` can
|
|
4
|
+
* all import it without a load cycle). The effective policy has ONE reading: the capability fact `workspaceSpace`
|
|
5
|
+
* (`src/capability-facts.ts`).
|
|
6
|
+
*
|
|
7
|
+
* The law (one fact, one seat): a k8s pod's `/workspace` is durable across runs as an object-store "space" owned by the
|
|
8
|
+
* session's OCCUPANT (its incarnation, `session-incarnation.ts`) — `<keyPrefix>/<incarnation>/space/<snapshotId>.tar.gz`
|
|
9
|
+
* plus one small `<keyPrefix>/<incarnation>/space/latest` pointer whose body is the newest snapshotId (the durable-suspend
|
|
10
|
+
* archives of parked runs stay flat under `<keyPrefix>/<sessionId>/` and are never pruned; why each lane has the partition
|
|
11
|
+
* it has: `plugins/remote-env-k8s.ts`, `K8sEnvConfig`). `connect()` restores the pointer's snapshot through the adapter's one
|
|
12
|
+
* tar download (shared with `resumeVM`); `destroy()` snapshots through its one tar upload (shared with `suspendVM`),
|
|
13
|
+
* moves the pointer, then keeps the newest `keep` snapshots inside `space/`. No index table: the bucket is the only record.
|
|
14
|
+
*
|
|
15
|
+
* Facility dependence: without a snapshot store (`s3Snapshot`) there is nothing to persist into — the fact is
|
|
16
|
+
* unavailable and the lane behaves exactly as before (fresh pod, empty `/workspace` every run).
|
|
17
|
+
*/
|
|
18
|
+
/** `WORKSPACE_PERSIST` closed set. `space` = the k8s workspace persists per space (the session occupant); `off` = a fresh
|
|
19
|
+
* workspace every run. */
|
|
20
|
+
export declare const WORKSPACE_PERSIST_WORDS: readonly ["space", "off"];
|
|
21
|
+
export type WorkspacePersist = (typeof WORKSPACE_PERSIST_WORDS)[number];
|
|
22
|
+
/**
|
|
23
|
+
* Default `off` — persistence is opt-in. Why: the run-end commit's ordering against the NEXT run rests on an object-store
|
|
24
|
+
* marker the commit itself writes, and that PUT can land after the engine's teardown bound; then the next run restores the
|
|
25
|
+
* previous-but-one snapshot and its own commit later overwrites the late one (the preceding run's changes are lost). That
|
|
26
|
+
* window closes only with a commit fence held in server-side durable state, written before the session's active-run slot
|
|
27
|
+
* is released; until then a deployment turns persistence on knowing the window (USAGE §9.3b).
|
|
28
|
+
*/
|
|
29
|
+
export declare const WORKSPACE_PERSIST_DEFAULT: WorkspacePersist;
|
|
30
|
+
/** `WORKSPACE_SNAPSHOT_KEEP` — snapshots kept per space key (closed integer domain; out of domain refuses boot). */
|
|
31
|
+
export declare const WORKSPACE_SNAPSHOT_KEEP_DEFAULT = 3;
|
|
32
|
+
export declare const WORKSPACE_SNAPSHOT_KEEP_RANGE: {
|
|
33
|
+
readonly min: 1;
|
|
34
|
+
readonly max: 50;
|
|
35
|
+
};
|
|
36
|
+
/** The effective space policy — the `workspaceSpace` fact's witness and the value of `GET /v1/capabilities.workspaceSync`. */
|
|
37
|
+
export interface WorkspaceSyncCapability {
|
|
38
|
+
persist: WorkspacePersist;
|
|
39
|
+
keep: number;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=workspace-space.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const WORKSPACE_PERSIST_WORDS = ["space", "off"];
|
|
2
|
+
export const WORKSPACE_PERSIST_DEFAULT = "off";
|
|
3
|
+
export const WORKSPACE_SNAPSHOT_KEEP_DEFAULT = 3;
|
|
4
|
+
export const WORKSPACE_SNAPSHOT_KEEP_RANGE = { min: 1, max: 50 };
|
|
5
|
+
//# sourceMappingURL=workspace-space.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.125.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@sema-agent/core": "7.48.0",
|
|
68
|
-
"@sema-agent/settings-schema": "11.
|
|
68
|
+
"@sema-agent/settings-schema": "11.3.0",
|
|
69
69
|
"e2b": "^2.28.0",
|
|
70
70
|
"libsodium-wrappers": "^0.8.4",
|
|
71
71
|
"mysql2": "^3.22.4",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"sharp": "^0.35.3"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@sema-agent/sdk": "
|
|
83
|
+
"@sema-agent/sdk": "20.0.0",
|
|
84
84
|
"@types/libsodium-wrappers": "^0.7.14",
|
|
85
85
|
"@types/node": "22.10.2",
|
|
86
86
|
"@types/pg": "^8.20.0",
|