@sema-agent/client-core 0.71.1 → 0.71.2
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/adapt/textStream.js +18 -7
- package/dist/decideReceipt.js +3 -3
- package/docs/INTEGRATION-CLIENTS.md +29 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -49,6 +49,15 @@
|
|
|
49
49
|
> 挡住 ⇒ 本批把它机械化——④a0 对 `pending` 行**要求段头已是日期形**(`(未发布)` 直接红),阶段一
|
|
50
50
|
> commit 漏转在发布前就红,不再靠人记。
|
|
51
51
|
|
|
52
|
+
## 0.71.2(2026-09-17)
|
|
53
|
+
|
|
54
|
+
> 主题:接入方 1.0.117 黑盒验收两票归包(B-132 / B-133)。**patch**:零型面变化、公面 986 不变、peer 不动;运行期只改两句拒体人话 + 一条「说不出」守卫。接入面 §44。
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **CC-28(B-132)decide 拒体人话去内部措辞**:`decideRefusalFromError` 的两句(`decide.workflow_host_unknown` / `decide.workflow_remember_unsupported`)与闭集内无专句时的兜底句此前带「workflow run / lane」这类内部车道词;改成用户可执行的一句(「no session is attached to this run to receive the decision …」/「this run cannot remember the decision for the session …」/ 兜底「the engine refused this decision; the approval is still pending and can be decided again」),`resendable` 与结构位不变。同族排查:`conflict.resume_context_unavailable` 在本包源码与 dist **零命中**(不是本包铸的句子);本包内用户面句再无 workflow / lane 措辞。
|
|
59
|
+
- **CC-29(B-133)`committedUuids` 唯一性**:行 uuid 由 wire 帧 uuid 派生,只有上游帧 uuid 重复才会让两条已提交行同 uuid;端按 uuid 找行,重复 = 归属**说不出** ⇒ `committedUuids` / `committedUuid` / `committedRows` 整键缺席(零经手形 f),且不清尾巴、不同步补差账(退回零经手行为)。不去重不取首(任一种都是替上游湮灭「两条行一个身份」)。§42y ① (b) 补唯一性一句;TSA 门 Z10 三格(真实构造重复 uuid)+ D10 四格(同一消息账两条重复行 + 尾段:三键缺席 / 补差账不动 / 尾段照提 —— 发车前对抗复审抓出「守卫只清三键、endsWith 回退仍清尾同步」后补),红先绿后。
|
|
60
|
+
|
|
52
61
|
## 0.71.1(2026-09-17)
|
|
53
62
|
|
|
54
63
|
> 主题:接入文档打回一条(接入方 1.0.117 实测):`readRootCandidate` 帧→卡透传位。**patch**:型面纯 additive(`ApprovalCardRequest.readRootCandidate?` + 新导出型 `ReadRootCandidateView`;窄读器不出公面),运行期零 BREAKING;公面 986 不变。接入面 §43。
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Renamed from **`@sema-agent/wire-cc-adapter`** (0.1.x, deprecated — see *Migra
|
|
|
35
35
|
|
|
36
36
|
## Scope
|
|
37
37
|
|
|
38
|
-
**Version:** 0.71.
|
|
38
|
+
**Version:** 0.71.2
|
|
39
39
|
|
|
40
40
|
- **Today** — the adapter seam, the whole `adapt()` pipeline (all 14 A-layer arms plus the
|
|
41
41
|
B/D/E tool-card layers), the notification/caps/model families, the adapter kernel (stream driver
|
package/dist/adapt/textStream.js
CHANGED
|
@@ -373,19 +373,26 @@ export function createTextStream(ctx, idOf) {
|
|
|
373
373
|
const committedPrefixLen = verdict.committedPrefixLen;
|
|
374
374
|
const committedPrefixDiverged = verdict.committedPrefixDiverged;
|
|
375
375
|
// CC-16:本窗口已提交行的归属一次交全(用过即清;轮换也清)。`[]` 是正面事实,不是缺席。
|
|
376
|
-
const
|
|
376
|
+
const rowsAll = committedTextRows;
|
|
377
377
|
committedTextRows = [];
|
|
378
|
+
// B-133 / CC-29(0.71.2):行 uuid 由 wire 帧 uuid 派生,只有上游帧 uuid 重复才会让两条行同 uuid;端按 uuid 找行,
|
|
379
|
+
// 重复 = 归属**说不出** ⇒ 整键缺席(形 f),且不交 committedRows、不清尾巴不同步账(退回零经手行为)。
|
|
380
|
+
// 不去重、不取首:任一种都是替上游把「两条行一个身份」这件事湮灭掉。
|
|
381
|
+
const uuidsUnique = new Set(rowsAll.map((r) => r.uuid)).size === rowsAll.length;
|
|
382
|
+
const rows = uuidsUnique ? rowsAll : [];
|
|
378
383
|
const rowUuids = rows.map((r) => r.uuid);
|
|
379
384
|
// 只有「已提交前缀自己也过期」这一形端才有东西要写回:首行 = 前段定稿前缀 + content(混合行的上一段正文保住),
|
|
380
385
|
// 其余行清空(它们的字节全在 content 里)。b1 形已提交行本来就对,不给;形 (a) 零行,不给。
|
|
381
386
|
const committedRowsOut = committedPrefixDiverged && rows.length > 0
|
|
382
387
|
? rows.map((r, i) => ({ uuid: r.uuid, text: i === 0 ? r.sealedPrefix + content : r.sealedPrefix }))
|
|
383
388
|
: undefined;
|
|
384
|
-
const attribution =
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
+
const attribution = uuidsUnique
|
|
390
|
+
? {
|
|
391
|
+
committedUuids: rowUuids,
|
|
392
|
+
...(rowUuids.length > 0 ? { committedUuid: rowUuids[rowUuids.length - 1] } : {}),
|
|
393
|
+
...(committedRowsOut !== undefined ? { committedRows: committedRowsOut } : {}),
|
|
394
|
+
}
|
|
395
|
+
: {};
|
|
389
396
|
/**
|
|
390
397
|
* 🔴 **段跨过包侧边界、而且已提交那截自己也过期** ⇒ 本模块**一个字节都不动**(只发信号)。
|
|
391
398
|
*
|
|
@@ -427,7 +434,11 @@ export function createTextStream(ctx, idOf) {
|
|
|
427
434
|
// 🔴 第 4 轮 finding①:`committedRows` 在场时**一律**按消息分组重建(行归属确定,零启发式);`endsWith` 快捷分支只在
|
|
428
435
|
// 零行(没有行归属可用)时回退 —— 重复正文(两条消息都是「Intro. 」)会让 endsWith 误命中、跳过重建,消息二那本账没清 ⇒ 终帧再补一次。
|
|
429
436
|
let booksSynced = false;
|
|
430
|
-
if (
|
|
437
|
+
if (!uuidsUnique) {
|
|
438
|
+
// B-133 / CC-29:重复 uuid ⇒ 归属说不出 ⇒ **一个字节不动**:既不进分组重建,也不走 endsWith 回退(复审实抓:回退会把
|
|
439
|
+
// previousCommittedText 同步成从未提交的权威全文,再把尾段清掉 —— 端按缺席契约零写回,尾段就此消失)。
|
|
440
|
+
}
|
|
441
|
+
else if (committedRowsOut !== undefined) {
|
|
431
442
|
// 按**消息**重建(第 3 轮 finding②):一条消息的正文 = 窗口之外已独立提交的那截(`msgTextBefore`)+ 该消息里
|
|
432
443
|
// 各行写回后的正文;只按首行写回正文重建会丢掉独立提交的定稿前缀,终帧再落第⑤臂误报分岔。
|
|
433
444
|
const groups = new Map();
|
package/dist/decideReceipt.js
CHANGED
|
@@ -100,8 +100,8 @@ export function decideAcceptedNotResolved(receipt) {
|
|
|
100
100
|
* message 里没有的那件事 —— 「我现在该做什么」。
|
|
101
101
|
*/
|
|
102
102
|
const DECIDE_REFUSAL_SENTENCES = Object.freeze({
|
|
103
|
-
[DECIDE_WORKFLOW_HOST_UNKNOWN]: '
|
|
104
|
-
[DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED]: 'this
|
|
103
|
+
[DECIDE_WORKFLOW_HOST_UNKNOWN]: 'no session is attached to this run to receive the decision, so re-sending the same decision cannot help; the approval is still pending and can be decided again once the run is reachable',
|
|
104
|
+
[DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED]: 'this run cannot remember the decision for the session; re-send the same decision without the remember option — nothing was consumed by this refusal',
|
|
105
105
|
});
|
|
106
106
|
/** 按码给出的 `resendable`(单铸;理由逐码写在 `engineErrorCodes.ts` 的顶注里)。 */
|
|
107
107
|
const DECIDE_RESENDABLE = Object.freeze({
|
|
@@ -134,7 +134,7 @@ export function decideRefusalFromError(e) {
|
|
|
134
134
|
return {
|
|
135
135
|
code,
|
|
136
136
|
...(runId !== undefined ? { runId } : {}),
|
|
137
|
-
detail: detail ?? 'the engine refused this decision
|
|
137
|
+
detail: detail ?? 'the engine refused this decision; the approval is still pending and can be decided again',
|
|
138
138
|
resendable: Object.hasOwn(DECIDE_RESENDABLE, code) ? DECIDE_RESENDABLE[code] === true : false,
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
| 项 | 值 | 真源 |
|
|
21
21
|
|---|---|---|
|
|
22
|
-
| 本包 | `@sema-agent/client-core` **0.71.
|
|
22
|
+
| 本包 | `@sema-agent/client-core` **0.71.2**(本批发布版 = **patch**:接入方验收两票归包 —— CC-28 B-132 decide 拒体三句去内部车道词 / CC-29 B-133 committedUuids 唯一性(重复 ⇒ 形 f);零型面变化、公面 986、peer 不动;§44。上一版 0.71.1 = **patch**:接入档打回修正 —— CC-27 `ApprovalCardRequest.readRootCandidate?` 帧→卡透传位 + 新导出型 `ReadRootCandidateView`;型面纯 additive、公面 986 不变、peer 不动;§43。上一版 0.71.0 = **minor**:型面 BREAKING 六件 —— peer sdk 地板 >=9.6.0 + agent-types >=0.3.0 / `SkillsListingTruncatedFactsView` 删 `requestedBudgetBytes?`·`laneClamped?` / `WiringManifestMcpEntry` → `WiringManifestMcpEntryView` / `MAX_AGENT_SKILLS` 删 / `decide.workflow_host_not_parked` 退役;运行期零 BREAKING。内容:core 7.20.0 提货(闭集 +5 六十四码)/ 🔴 CC-16 `text_segment_end.committedUuids[]` / CC-08 全五件(tool_disclosure / tool_progress 两 chrome 臂、wiring_manifest tools·hooks·lsp 进切片、tool_roster_delta 接上、context_usage 进切片、`readRootCandidate` 镜像)/ CC-19 `mcpEngineLegPresence` 归包 / CC-20 not_parked clean-cut;公面 986;§42 / 42y 八条)|
|
|
23
23
|
| peer:wire 契约 | `@sema-agent/sdk` **>=9.6.0**(value-level,非 type-only;**0.71.0 抬版**:`tool_disclosure` / `tool_progress` 两帧型与 `ToolApprovalFrame.readRootCandidate` 自 9.6.0 起;0.69.0 曾抬到 >=9.4.0(`reasoning_end` / `lastLegMcp`),0.60.0 抬到 >=8.4.0;地板由 `scripts/run-sdk-floor-test.mjs` 的 `FLOOR` 与 public-surface 门 C-CC-3「不低于见证到的最低实装版」双钉)| `package.json` `peerDependencies` |
|
|
24
24
|
| peer:会话词汇表 | `@sema-agent/agent-types` **>=0.3.0**(type-only,零运行时;0.71.0 抬版:devDep 与 peer 同步,type-superset 门 ④ 撞名预警对着 0.3.0 的 .d.ts 求值) | 同上 |
|
|
25
25
|
| runtime dep | `diff` ^9.0.0(**唯一**一条;portability 门按**等值**钉死) | `package.json` `dependencies` |
|
|
@@ -8127,7 +8127,7 @@ installCoreValuePorts({ resolveAutonomousLoopPrompt, loosenReasons, combinePolic
|
|
|
8127
8127
|
|
|
8128
8128
|
### 42y. 🔴 三端升级必读(固定段式,[C295];本批起草,发车时补全)
|
|
8129
8129
|
|
|
8130
|
-
1. 🔴 **`text_segment_end` 归属交全(CC-16)**:`committedUuids[]` 在场即以它为准 —— `committedPrefixDiverged` ⇒ 按 `committedRows[]` 逐行写回正文(🔴 别自己整行换首行)。两形:**(a)** 提交行 = 「上一段定稿 + 本段那截」同一行时,该行最终正文 = 上一段正文(该行里已封存那截,逐字)+ 本段权威 `content`,其余行 `''`;**(b)** `committedRows` 在场 ⇔ `committedPrefixDiverged === true` ∧ `committedUuids.length > 0`,在场时与 `committedUuids` 长度相等、顺序一一对应(`committedRows[i].uuid === committedUuids[i]`)
|
|
8130
|
+
1. 🔴 **`text_segment_end` 归属交全(CC-16)**:`committedUuids[]` 在场即以它为准 —— `committedPrefixDiverged` ⇒ 按 `committedRows[]` 逐行写回正文(🔴 别自己整行换首行)。两形:**(a)** 提交行 = 「上一段定稿 + 本段那截」同一行时,该行最终正文 = 上一段正文(该行里已封存那截,逐字)+ 本段权威 `content`,其余行 `''`;**(b)** `committedRows` 在场 ⇔ `committedPrefixDiverged === true` ∧ `committedUuids.length > 0`,在场时与 `committedUuids` 长度相等、顺序一一对应(`committedRows[i].uuid === committedUuids[i]`),绝不只给其一;🔧 0.71.2 补:`committedUuids` **内部唯一**(重复 = 上游帧 uuid 重复 ⇒ 包判归属说不出,三键整键缺席走形 f,端零写回);b1 形(前缀对得上)只有 `committedUuids`;`[]` = 本窗口零已提交行;整键缺席才是「包说不出」。自建的「本窗口过境行」跟踪与 `=== 1` 歧义闸可删,多行跨界段不再整发放弃。
|
|
8131
8131
|
2. **`SkillsListingTruncatedFactsView` 删 `requestedBudgetBytes?` / `laneClamped?`**:运维面只读 `budgetBytes`。
|
|
8132
8132
|
3. **peer sdk `>=9.6.0`**;两条新 chrome 臂 `tool_disclosure` / `tool_progress` 均 `required: false`,渲的端接、不渲零动作;🔴 `tool_progress.output` 绝不回喂模型。
|
|
8133
8133
|
4. **审批卡 `readRootCandidate`**:🔧 0.71.1 订正 —— 本版(0.71.0)卡入参**零该位**(只镜像了帧键名),端登 n/a 不渲;0.71.1 起按 `ApprovalCardRequest.readRootCandidate?` 在场渲一格 add-dir,`dir` 原样回传,缺席不渲(§43)。
|
|
@@ -8163,3 +8163,30 @@ installCoreValuePorts({ resolveAutonomousLoopPrompt, loosenReasons, combinePolic
|
|
|
8163
8163
|
3. **零 BREAKING**:peer 不动、公面运行期导出 986 不变(只加一个导出型)。
|
|
8164
8164
|
|
|
8165
8165
|
**包侧缺口:** ① CC-06 B-081 包侧半场(窗 09-22);② CC-24 export-liveness 门(窗 09-20);③ CC-25 §NNz 机读门 + 三已发版本落点 + FROZEN 腿判据(窗 09-22);④ CC-26 `as unknown as` 铸出口棘轮(窗 09-22);⑤ `agents.listing_truncated` detail 读器候消费场景(by-design);⑥ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design)。
|
|
8166
|
+
|
|
8167
|
+
## §44 🆕 0.71.2 接入方验收两票归包(B-132 decide 拒体人话 / B-133 committedUuids 唯一性)
|
|
8168
|
+
|
|
8169
|
+
> **patch**:零型面变化、公面 986 不变、peer 不动。两件都是接入方 1.0.117 黑盒验收(test [7389])立票、cli [7392] 显式转包(壳零自铸 / 零代偿)。
|
|
8170
|
+
|
|
8171
|
+
### 44a. 处置表
|
|
8172
|
+
|
|
8173
|
+
| # | 面 | 本包做了什么 | 端要做什么 |
|
|
8174
|
+
|---|---|---|---|
|
|
8175
|
+
| S-1 | **decide 拒体人话**(`decideRefusalFromError().detail`,唯一铸点) | `decide.workflow_host_unknown` / `decide.workflow_remember_unsupported` 两句去内部车道词(workflow run / lane),改成用户可执行的一句;结构位(`code` / `runId` / `resendable`)不变 | 零动作(`detail` 原样渲);端零自铸第二句。`conflict.resume_context_unavailable` 不在本包(源码 + dist 零命中),渲它的那一面请按坐标另立 |
|
|
8176
|
+
| S-2 | **`text_segment_end.committedUuids[]` 唯一性** | 交全前判唯一;重复 ⇒ `committedUuids` / `committedUuid` / `committedRows` 整键缺席(形 f),包不清尾巴不同步账 | 端照 §42y ① (b):整键缺席 = 包说不出 ⇒ 零写回 + 披露;端不必再判唯一(包边界已判,壳侧第二份判据不加) |
|
|
8177
|
+
|
|
8178
|
+
### 44z. 逐键处置表
|
|
8179
|
+
|
|
8180
|
+
| # | 键 / 面 | 处置 | 坐标 / 理由 |
|
|
8181
|
+
|---|---|---|---|
|
|
8182
|
+
| 1 | B-132 两句 | **consumed(改口)** | `src/decideReceipt.ts` 的 `#DECIDE_REFUSAL_SENTENCES`;decide 门 E3/E3b |
|
|
8183
|
+
| 2 | B-132 第三码 `conflict.resume_context_unavailable` | **n/a(不在本包)** | 本包源码与 dist 零命中 |
|
|
8184
|
+
| 3 | B-133 唯一性 | **consumed(说不出走形 f)** | `src/adapt/textStream.ts` 的 `#uuidsUnique`;TSA 门 Z10 |
|
|
8185
|
+
|
|
8186
|
+
### 44y. 🔴 三端升级必读(固定段式,[C295])
|
|
8187
|
+
|
|
8188
|
+
1. `decideRefusalFromError().detail` 措辞变了(零内部车道词);按句子做字面匹配的端改掉(不该有)。
|
|
8189
|
+
2. `committedUuids` 内部重复 ⇒ 三键整键缺席(形 f),端按既有「包说不出」分支走;端侧不加唯一性第二判据。
|
|
8190
|
+
3. 零 BREAKING:型面、公面、peer 均不动。
|
|
8191
|
+
|
|
8192
|
+
**包侧缺口:** ① CC-06 B-081 包侧半场(窗 09-22);② CC-24 export-liveness 门(窗 09-20);③ CC-25 §NNz 机读门 + 三已发版本落点 + FROZEN 腿判据(窗 09-22);④ CC-26 `as unknown as` 铸出口棘轮(窗 09-22);⑤ `agents.listing_truncated` detail 读器候消费场景(by-design);⑥ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.2",
|
|
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. Renamed from @sema-agent/wire-cc-adapter (0.1.x).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|