@sema-agent/client-core 0.23.1 → 0.24.1
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/README.md +2 -2
- package/dist/agentsWireCaps.d.ts +2 -2
- package/dist/agentsWireCaps.js +2 -2
- package/dist/detachWire.d.ts +3 -1
- package/dist/engineWireSdk.d.ts +4 -3
- package/dist/engineWireSdk.js +3 -2
- package/dist/engineWireTarget.d.ts +2 -1
- package/dist/engineWireTarget.js +4 -3
- package/dist/liveInitToolFace.d.ts +1 -1
- package/dist/liveInitToolFace.js +1 -1
- package/dist/workflowClient.d.ts +3 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Renamed from **`@sema-agent/wire-cc-adapter`** (0.1.x, deprecated — see *Migra
|
|
|
23
23
|
|
|
24
24
|
## Scope
|
|
25
25
|
|
|
26
|
-
**Version:** 0.
|
|
26
|
+
**Version:** 0.24.1
|
|
27
27
|
|
|
28
28
|
- **Today** — the adapter seam, the whole `adapt()` pipeline (all 14 A-layer arms plus the
|
|
29
29
|
B/D/E tool-card layers), the notification/caps/model families, the adapter kernel (stream driver
|
|
@@ -53,7 +53,7 @@ Renamed from **`@sema-agent/wire-cc-adapter`** (0.1.x, deprecated — see *Migra
|
|
|
53
53
|
`SseIdleError`, `probeHealth`, `APIError` and `TaskStopConflictError` are imported as values in
|
|
54
54
|
five modules, and the browser bundle really bundles the SDK through (the portability guard would
|
|
55
55
|
exit 3 rather than quietly mark it external).
|
|
56
|
-
- The declared floor is `>=6.
|
|
56
|
+
- The declared floor is `>=6.11.0`, and it is *witnessed*: the guard checks that an actually
|
|
57
57
|
installed SDK at that line still exports every value-level symbol this package imports and still
|
|
58
58
|
declares `TaskStats.costMicroUsd` (the key `costOrNull` reads). A floor nobody ever ran is a
|
|
59
59
|
promise, not a contract.
|
package/dist/agentsWireCaps.d.ts
CHANGED
|
@@ -76,8 +76,8 @@ export declare function projectAgentsForWire(defs: readonly AgentDefLike[], deps
|
|
|
76
76
|
* 解析 —— SDK 对这些统一抛错,catch 归一)⇒ 调用层 fail-soft 照发(旧 server 静默剥字段
|
|
77
77
|
* 无害;引擎真死 stream 自己 fail-loud)。
|
|
78
78
|
* 等价性:3s 预算改经 client timeoutMs;maxRetries=0 单发(否则 503 会按 SDK 缺省重试,探测预算
|
|
79
|
-
* 语义变形)
|
|
80
|
-
*
|
|
79
|
+
* 语义变形)。principal 头:SDK 6.11 起值检查删头——缺席不发(与原手抄同义;F-011 停发后
|
|
80
|
+
* 单机形恒缺席,owner-null)。
|
|
81
81
|
*/
|
|
82
82
|
export declare function engineSupportsTaskAgents(baseUrl: string, opts?: EngineProbeOpts): Promise<boolean | undefined>;
|
|
83
83
|
export type WireConfig = {
|
package/dist/agentsWireCaps.js
CHANGED
|
@@ -195,8 +195,8 @@ export function projectAgentsForWire(defs, deps) {
|
|
|
195
195
|
* 解析 —— SDK 对这些统一抛错,catch 归一)⇒ 调用层 fail-soft 照发(旧 server 静默剥字段
|
|
196
196
|
* 无害;引擎真死 stream 自己 fail-loud)。
|
|
197
197
|
* 等价性:3s 预算改经 client timeoutMs;maxRetries=0 单发(否则 503 会按 SDK 缺省重试,探测预算
|
|
198
|
-
* 语义变形)
|
|
199
|
-
*
|
|
198
|
+
* 语义变形)。principal 头:SDK 6.11 起值检查删头——缺席不发(与原手抄同义;F-011 停发后
|
|
199
|
+
* 单机形恒缺席,owner-null)。
|
|
200
200
|
*/
|
|
201
201
|
export async function engineSupportsTaskAgents(baseUrl, opts) {
|
|
202
202
|
const client = makeEngineWireClient({
|
package/dist/detachWire.d.ts
CHANGED
|
@@ -137,7 +137,9 @@ export interface DetachCancelArm {
|
|
|
137
137
|
authToken: string | {
|
|
138
138
|
mode: 'loopback-unauthed';
|
|
139
139
|
};
|
|
140
|
-
principal
|
|
140
|
+
/** SDK Principal。缺席(undefined)=消费方不发 x-agent-principal 头(owner-null 单机形)——
|
|
141
|
+
* 与 SDK 6.11 Transport 的值检查删头语义一致;绝不在此铸哨兵值。 */
|
|
142
|
+
principal: string | undefined;
|
|
141
143
|
/** Reads the durable taskId early-captured off the X-Task-Id response header; null before capture. */
|
|
142
144
|
getTaskId: () => string | null;
|
|
143
145
|
}
|
package/dist/engineWireSdk.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* fail-closed worker 都是 401,对 owner-gated 路由都是 owner 不匹配,行为面等价。
|
|
18
18
|
*
|
|
19
19
|
* 缺省 maxRetries=0:raw fetch 原语义是单发不重试(探针有自己的预算窗;fire-and-forget 不该静默
|
|
20
|
-
* 翻倍打点)。要 SDK 缺省重试的调用方显式传。principal
|
|
20
|
+
* 翻倍打点)。要 SDK 缺省重试的调用方显式传。principal 缺席=不发头(F-011 停发,replEntry live 车道
|
|
21
21
|
* 同款)——SDK Transport 恒 stamp x-agent-principal(principal-first 宪法);旧 raw fetch 在缺
|
|
22
22
|
* principal 时省略该头,迁移后恒出示,对 requirePrincipal 部署是 fail-open 改善,已记账。
|
|
23
23
|
*/
|
|
@@ -69,8 +69,9 @@ export type EngineWireClientConfig = {
|
|
|
69
69
|
baseUrl: string;
|
|
70
70
|
/** 真 token 串;缺省经 wireAuthTokenFor 三态解析(loopback-unauthed / 'anon')。 */
|
|
71
71
|
token?: string;
|
|
72
|
-
/**
|
|
73
|
-
|
|
72
|
+
/** 缺席/undefined=不发 x-agent-principal 头(owner-null;F-011 停发,replEntry live 车道同闸口
|
|
73
|
+
* 语义;显式 `| undefined` 让 EngineWireTarget.principal 直传合法——exactOptionalPropertyTypes)。 */
|
|
74
|
+
principal?: string | undefined;
|
|
74
75
|
/** 每次请求的超时预算(SDK 缺省 60s)。 */
|
|
75
76
|
timeoutMs?: number;
|
|
76
77
|
/** 缺省 0(raw fetch 单发语义);要 SDK 重试的调用方显式传。 */
|
package/dist/engineWireSdk.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* fail-closed worker 都是 401,对 owner-gated 路由都是 owner 不匹配,行为面等价。
|
|
18
18
|
*
|
|
19
19
|
* 缺省 maxRetries=0:raw fetch 原语义是单发不重试(探针有自己的预算窗;fire-and-forget 不该静默
|
|
20
|
-
* 翻倍打点)。要 SDK 缺省重试的调用方显式传。principal
|
|
20
|
+
* 翻倍打点)。要 SDK 缺省重试的调用方显式传。principal 缺席=不发头(F-011 停发,replEntry live 车道
|
|
21
21
|
* 同款)——SDK Transport 恒 stamp x-agent-principal(principal-first 宪法);旧 raw fetch 在缺
|
|
22
22
|
* principal 时省略该头,迁移后恒出示,对 requirePrincipal 部署是 fail-open 改善,已记账。
|
|
23
23
|
*/
|
|
@@ -75,7 +75,8 @@ export function makeEngineWireClient(cfg) {
|
|
|
75
75
|
return new AgentClient({
|
|
76
76
|
baseUrl: cfg.baseUrl,
|
|
77
77
|
authToken: resolveWireAuth(cfg.baseUrl, cfg.token),
|
|
78
|
-
|
|
78
|
+
// F-011 停发:缺席/空串=不给键(SDK 6.11 缺席=不发 x-agent-principal 头,owner-null)。
|
|
79
|
+
...(cfg.principal !== undefined && cfg.principal !== '' ? { principal: cfg.principal } : {}),
|
|
79
80
|
...(cfg.timeoutMs !== undefined ? { timeoutMs: cfg.timeoutMs } : {}),
|
|
80
81
|
maxRetries: cfg.maxRetries ?? 0,
|
|
81
82
|
...(cfg.fetchImpl ? { fetch: cfg.fetchImpl } : {}),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface EngineWireTarget {
|
|
2
2
|
baseUrl: string;
|
|
3
3
|
token?: string;
|
|
4
|
-
principal
|
|
4
|
+
/** 缺席=不发 x-agent-principal 头(owner-null,F-011 停发);显式装配/env 值恒赢。 */
|
|
5
|
+
principal?: string;
|
|
5
6
|
}
|
|
6
7
|
/** 装/卸引擎 wire 目标。传 null 卸回 env 派生。返回还原函数。 */
|
|
7
8
|
export declare function installEngineWireTarget(t: EngineWireTarget | null): () => void;
|
package/dist/engineWireTarget.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ⇄ B6 批搬迁(2026-07-27,设计稿 §3 B6):子代 wire 族里**逐字重复**的 `wireConfig()`
|
|
3
|
-
* (SEMA_LIVE_BASEURL / SEMA_LIVE_TOKEN / SEMA_LIVE_PRINCIPAL
|
|
3
|
+
* (SEMA_LIVE_BASEURL / SEMA_LIVE_TOKEN / SEMA_LIVE_PRINCIPAL 三读;principal 缺席=不发头,F-011 停发)
|
|
4
4
|
* 收成一份。
|
|
5
5
|
*
|
|
6
6
|
* 🔴 收编前的事实(壳 HEAD 2aa1d3e 实测,`grep -rln 'function wireConfig' src/sema/`):
|
|
@@ -56,9 +56,10 @@ export function engineWireTargetFor(sessionKey) {
|
|
|
56
56
|
return {
|
|
57
57
|
baseUrl,
|
|
58
58
|
// principal must match the run's owner (stamped by the live stream) — the owner-gated routes answer
|
|
59
|
-
// 404 for non-owners (no existence oracle)
|
|
59
|
+
// 404 for non-owners (no existence oracle). F-011 停发([3279]):缺席=不发头,owner-null 两侧
|
|
60
|
+
// 对齐(server 7.8.1 读写面窄互认盖存量);显式 SEMA_LIVE_PRINCIPAL 恒赢,绝不铸哨兵值。
|
|
60
61
|
...(env.SEMA_LIVE_TOKEN ? { token: env.SEMA_LIVE_TOKEN } : {}),
|
|
61
|
-
principal: env.SEMA_LIVE_PRINCIPAL
|
|
62
|
+
...(env.SEMA_LIVE_PRINCIPAL ? { principal: env.SEMA_LIVE_PRINCIPAL } : {}),
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
/** 诊断开关(壳侧 `process.env.SEMA_DEBUG` 的等价读;本包零 process)。 */
|
|
@@ -78,7 +78,7 @@ export declare function _resetLiveInitToolFaceForTest(): void;
|
|
|
78
78
|
* 同 wire 同 encodeURIComponent)→ { tools(场景附加段), toolset }。fail-soft:任何失败(网络/404/
|
|
79
79
|
* 形状不符/超时)返回 null,调用层回退缺省词表。等价性记账:超时经 client timeoutMs(缺省 2s 同预算,
|
|
80
80
|
* maxRetries=0 单发同原语义);ScenarioDetail 类型面之外仍保留逐字段运行时校验(引擎回什么不轻信)。
|
|
81
|
-
*
|
|
81
|
+
* principal 头:SDK 6.11 起值检查删头(缺席不发;F-011 停发后单机形恒缺席)——原手抄在无 principal
|
|
82
82
|
* 时省略该头;principal-first 宪法姿势,对 requirePrincipal 部署是 fail-open 改善。 */
|
|
83
83
|
export declare function probeScenarioTools(baseUrl: string, scenario: string, opts?: EngineProbeOpts): Promise<{
|
|
84
84
|
tools: string[];
|
package/dist/liveInitToolFace.js
CHANGED
|
@@ -126,7 +126,7 @@ export function _resetLiveInitToolFaceForTest() {
|
|
|
126
126
|
* 同 wire 同 encodeURIComponent)→ { tools(场景附加段), toolset }。fail-soft:任何失败(网络/404/
|
|
127
127
|
* 形状不符/超时)返回 null,调用层回退缺省词表。等价性记账:超时经 client timeoutMs(缺省 2s 同预算,
|
|
128
128
|
* maxRetries=0 单发同原语义);ScenarioDetail 类型面之外仍保留逐字段运行时校验(引擎回什么不轻信)。
|
|
129
|
-
*
|
|
129
|
+
* principal 头:SDK 6.11 起值检查删头(缺席不发;F-011 停发后单机形恒缺席)——原手抄在无 principal
|
|
130
130
|
* 时省略该头;principal-first 宪法姿势,对 requirePrincipal 部署是 fail-open 改善。 */
|
|
131
131
|
export async function probeScenarioTools(baseUrl, scenario, opts) {
|
|
132
132
|
const client = makeEngineWireClient({
|
package/dist/workflowClient.d.ts
CHANGED
|
@@ -41,8 +41,9 @@ export interface LiveWorkflowController {
|
|
|
41
41
|
export interface LiveWorkflowConfig {
|
|
42
42
|
baseUrl: string;
|
|
43
43
|
authToken: string;
|
|
44
|
-
/** SDK Principal
|
|
45
|
-
|
|
44
|
+
/** SDK Principal(workflows are owner-scoped by principal)。缺席=不发 x-agent-principal 头
|
|
45
|
+
* (owner-null,F-011 停发;两侧同缺席仍对齐)。 */
|
|
46
|
+
principal: string | undefined;
|
|
46
47
|
/** explicit workflow run id; when absent the source picks the first RUNNING run from list() (else the first). */
|
|
47
48
|
workflowId?: string;
|
|
48
49
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "Client-side session runtime shared by every sema human client (TUI / web / desktop): sema wire frames (AgentEvent) -> CC session vocabulary (SDKMessage) with dual-plane output (transcript/chrome), deterministic transcript ids, lane discipline as a type, and the notification/dedup ledgers. Every CC-skin shape is collected here so the wire itself stays neutral. Blackboard [1832] design axioms; [1651]/[1652]/[1653] signed seam design. Renamed from @sema-agent/wire-cc-adapter (0.1.x).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@sema-agent/agent-types": ">=0.2.0",
|
|
31
|
-
"@sema-agent/sdk": ">=6.
|
|
31
|
+
"@sema-agent/sdk": ">=6.11.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@sema-agent/agent-types": "^0.2.0",
|
|
35
35
|
"@sema-agent/core": "^5.20.0",
|
|
36
|
-
"@sema-agent/sdk": "^6.
|
|
36
|
+
"@sema-agent/sdk": "^6.11.0",
|
|
37
37
|
"esbuild": "^0.27.4",
|
|
38
38
|
"typescript": "^6.0.2"
|
|
39
39
|
}
|