@sema-agent/server 2.0.1 → 3.0.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 +74 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +391 -0
- package/dist/boot/config-center.js +7 -0
- package/dist/capabilities/scenarios.d.ts +5 -3
- package/dist/capabilities/scenarios.js +5 -3
- package/dist/config-center/apply-effective.js +4 -3
- package/dist/config-lkg.d.ts +2 -1
- package/dist/config-lkg.js +2 -1
- package/dist/config-types.d.ts +7 -5
- package/dist/config.d.ts +16 -11
- package/dist/config.js +30 -33
- package/dist/hooks/hook-llm.js +9 -0
- package/dist/http/routes/approvals-assistant.js +1 -1
- package/dist/http/routes/attachments.js +2 -2
- package/dist/http/routes/memory-policy.js +3 -3
- package/dist/http/routes/runs.js +1 -1
- package/dist/http/routes/session-sync.js +2 -2
- package/dist/http/routes/sessions.js +2 -2
- package/dist/http/routes/tasks.js +2 -2
- package/dist/http/routes/trace-usage.js +2 -2
- package/dist/http/routes/workflows.js +3 -1
- package/dist/http/server.d.ts +1 -1
- package/dist/http/server.js +25 -5
- package/dist/http/sse-log.js +1 -1
- package/dist/main.js +1 -1
- package/dist/model-select.d.ts +1 -1
- package/dist/model-select.js +1 -1
- package/dist/plugins/checkpoint-store-sql.d.ts +13 -5
- package/dist/plugins/checkpoint-store-sql.js +10 -3
- package/dist/plugins/local-checkpoint-store.js +8 -2
- package/dist/plugins/remote-env-host.d.ts +2 -1
- package/dist/run-local.js +2 -1
- package/dist/session-titler.d.ts +3 -1
- package/dist/session-titler.js +2 -2
- package/dist/trace/project.js +4 -1
- package/package.json +5 -3
|
@@ -43,7 +43,8 @@ export interface HostEnvConfig {
|
|
|
43
43
|
* reports `supported:false` → INERT (no scheduler tools). Injected at boot only on the single-user host lane. */
|
|
44
44
|
scheduler?: SchedulerCapability;
|
|
45
45
|
/** design/103 background shell: `false` → INERT (multi-tenant host lane gate). Default (undefined) = on for the
|
|
46
|
-
* single-user TOC host lane. `HOST_BG_ENABLED=false` is an additional global kill switch(旧名
|
|
46
|
+
* single-user TOC host lane. `HOST_BG_ENABLED=false` is an additional global kill switch(🪦 旧名
|
|
47
|
+
* `HOST_BG_DISABLED` 自 server 3.0.0 起是 fail-loud 墓碑:设了即拒启并指路新名,不再被读取)。 */
|
|
47
48
|
backgroundShell?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, SchedulerCapability, BackgroundShellCapability {
|
package/dist/run-local.js
CHANGED
|
@@ -291,7 +291,8 @@ export async function runLocal(argv, deps = {}) {
|
|
|
291
291
|
// TOC local LSP (core 1.190): run-local IS the pure-local host lane, so mount core's `NodeLspManager` (local
|
|
292
292
|
// child_process language servers over stdio, CC `services/lsp` parity) on the host lane. Default ON (degrades
|
|
293
293
|
// gracefully to grep/read if a server binary is absent); `LSP_HOST_ENABLED=false` opts out (design/158 B4 split
|
|
294
|
-
// this lane off `LSP_ENABLED
|
|
294
|
+
// this lane off `LSP_ENABLED`; 🪦 server 3.0.0 起 `LSP_ENABLED=false` 是 fail-loud 墓碑,拒启指路新名,
|
|
295
|
+
// 不再是可用的 opt-out)。`requirePrincipal !== true`
|
|
295
296
|
// keeps it uniform with main.ts (a no-op here — run-local is single-user — but never relies on that). Both runners.
|
|
296
297
|
const lspManager = hostRx && config.lspHostEnabled && config.requirePrincipal !== true ? new NodeLspManager({ log: (event, fields) => logger.info(event, fields) }) : undefined;
|
|
297
298
|
// Long-term memory (design/138 S1): run-local IS the single-user lane, so the file-based memory ENGINE is
|
package/dist/session-titler.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface SessionTitlerDeps {
|
|
|
29
29
|
llm(opts: {
|
|
30
30
|
prompt: string;
|
|
31
31
|
timeoutMs: number;
|
|
32
|
+
model?: string;
|
|
32
33
|
}): Promise<{
|
|
33
34
|
ok: true;
|
|
34
35
|
text: string;
|
|
@@ -47,7 +48,8 @@ export interface SessionTitlerDeps {
|
|
|
47
48
|
}
|
|
48
49
|
export interface SessionTitler {
|
|
49
50
|
/** Fire-and-forget: maybe generate + persist a title for this session. Never throws, never blocks the caller. */
|
|
50
|
-
|
|
51
|
+
/** `model`([1992]②)= 本 turn 真实驱动的模型——带上则标题 hook 同链路,不再裸落 env 缺省。 */
|
|
52
|
+
maybeTitle(sessionId: string, objective: string, model?: string): void;
|
|
51
53
|
}
|
|
52
54
|
export declare const TITLE_MAX_CHARS = 80;
|
|
53
55
|
/** Single line, control chars stripped, hard cap; surrounding quotes (a common LLM tic) trimmed. */
|
package/dist/session-titler.js
CHANGED
|
@@ -65,7 +65,7 @@ export function createSessionTitler(deps) {
|
|
|
65
65
|
deps.logger?.warn?.("session_title_failed", { ...meta, note: "同 cause 后续降为 debug 级" });
|
|
66
66
|
};
|
|
67
67
|
return {
|
|
68
|
-
maybeTitle(sessionId, objective) {
|
|
68
|
+
maybeTitle(sessionId, objective, model) {
|
|
69
69
|
if (!sessionId || !objective.trim())
|
|
70
70
|
return;
|
|
71
71
|
if (seen.has(sessionId))
|
|
@@ -93,7 +93,7 @@ export function createSessionTitler(deps) {
|
|
|
93
93
|
deps.metrics?.inc("session_title_total", { outcome: "already_titled" });
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
const r = await deps.llm({ prompt: buildTitlePrompt(objective), timeoutMs: LLM_TIMEOUT_MS });
|
|
96
|
+
const r = await deps.llm({ prompt: buildTitlePrompt(objective), timeoutMs: LLM_TIMEOUT_MS, model });
|
|
97
97
|
if (!r.ok) {
|
|
98
98
|
deps.metrics?.inc("session_title_total", { outcome: "llm_failed" });
|
|
99
99
|
logFailure(sessionId, r.error);
|
package/dist/trace/project.js
CHANGED
|
@@ -510,7 +510,10 @@ export function mapTraceEvent(type, seq, data) {
|
|
|
510
510
|
case "failed":
|
|
511
511
|
// BL-13: redact at the read boundary too (defense-in-depth) — covers any errorMessage that reached the
|
|
512
512
|
// log un-redacted via another write path; idempotent on the BL-12-redacted catch-path message.
|
|
513
|
-
|
|
513
|
+
// A1/A6/B(复审 2026-07-29):error 帧统一为 `{ type:"error", errorCode, message }` —— 与 sse-log /
|
|
514
|
+
// approvals 的帧同形。这一处是 3.0.0 摘 legacy `code` 键时的漏网:帧在 src/trace/ 铸,而当时的门只扫
|
|
515
|
+
// src/http/,于是"SSE error 帧机器键统一为 errorCode"的公开声明与 wire 上跑的东西不一致(门是绿的)。
|
|
516
|
+
return { event: "error", data: { type: "error", errorCode: "WORKER_DOWN", message: redactSecrets(String(data.errorMessage ?? "run failed")) } };
|
|
514
517
|
default:
|
|
515
518
|
return null; // compacted etc. — not a client trace event
|
|
516
519
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.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",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"!dist/run-local-linux-x64",
|
|
24
24
|
"!dist/run-local-darwin-arm64",
|
|
25
25
|
"skills",
|
|
26
|
-
"deploy/sema-up"
|
|
26
|
+
"deploy/sema-up",
|
|
27
|
+
"USAGE.md",
|
|
28
|
+
"MIGRATION.md"
|
|
27
29
|
],
|
|
28
30
|
"bin": {
|
|
29
31
|
"run-local": "dist/run-local.js",
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
"build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
|
|
52
54
|
},
|
|
53
55
|
"dependencies": {
|
|
54
|
-
"@sema-agent/core": "^2.
|
|
56
|
+
"@sema-agent/core": "^2.1.0",
|
|
55
57
|
"@sema-agent/registry-core": "^0.10.21",
|
|
56
58
|
"e2b": "^2.28.0",
|
|
57
59
|
"libsodium-wrappers": "^0.8.4",
|