@sema-agent/client-core 0.63.1 → 0.63.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 +12 -0
- package/README.md +1 -1
- package/dist/adapt/arms.js +3 -1
- package/dist/adapt/textStream.d.ts +10 -0
- package/dist/adapt/textStream.js +7 -0
- package/docs/INTEGRATION-CLIENTS.md +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -49,6 +49,18 @@
|
|
|
49
49
|
> 挡住 ⇒ 本批把它机械化——④a0 对 `pending` 行**要求段头已是日期形**(`(未发布)` 直接红),阶段一
|
|
50
50
|
> commit 漏转在发布前就红,不再靠人记。
|
|
51
51
|
|
|
52
|
+
## 0.63.2(2026-09-09)
|
|
53
|
+
|
|
54
|
+
### 修复
|
|
55
|
+
|
|
56
|
+
- **终答补差臂在「工具卡后零散文」形下把整段终帧再渲一遍**(cli 1.0.105 收官 daemon-reattach 套实撞:
|
|
57
|
+
mock 车道「散文 → Config 卡 → turn 收口」屏上同一段话两遍;真引擎上 turn 收在工具之后同形)。根因:工具
|
|
58
|
+
边界把「当前消息已上屏正文」重置成空串,而 provider 一条 assistant 消息 = `[text, tool_use]`,引擎「最后一条
|
|
59
|
+
消息的文本」正是卡**之前**那段;空串是任何终帧的前缀 ⇒ 补差臂把整段终帧当缺的后缀补出。修:比较对象改为
|
|
60
|
+
`lastCommittedAnswerText`(当前消息零上屏时回退到上一条真有正文的消息;有字时与修前逐字同)。门:
|
|
61
|
+
`run-result-text-backfill` +G5/G5b(卡后零散文 + 终帧 = 卡前那段 ⇒ 零补;终帧多一截 ⇒ 只补后缀);变异
|
|
62
|
+
(比较源改回 `committedAnswerText`)⇒ G5 红。§26g 加订正段。宿主零换装。
|
|
63
|
+
|
|
52
64
|
## 0.63.1(2026-09-09)
|
|
53
65
|
|
|
54
66
|
test 对 0.63.0 的黑盒回执(G-1…G-20 五路交叉)提了六项;逐项亲核后 **四修二订**。本段只记内容,
|
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.63.
|
|
38
|
+
**Version:** 0.63.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/arms.js
CHANGED
|
@@ -652,7 +652,9 @@ const resultArm = function* (m, { ctx, idOf, text, cards, panel, flags }) {
|
|
|
652
652
|
yield* text.takeAnswerSegment();
|
|
653
653
|
// 具名成 terminalText:M1 收编后 `text` 是流合并器的名字,原来的同名局部会遮蔽它。
|
|
654
654
|
const terminalText = typeof m.result === 'string' ? m.result : '';
|
|
655
|
-
|
|
655
|
+
// 🔴 比较对象 = 引擎「最后一条 assistant 消息」在屏上那段(0.63.2):卡后零散文时回退到卡前那条
|
|
656
|
+
// (provider 一条消息 = [text, tool_use];空串是任何终帧的前缀 ⇒ 拿空串比会把整段终帧再渲一遍)。
|
|
657
|
+
const committed = text.lastCommittedAnswerText;
|
|
656
658
|
const emitTerminal = function* (body, tag) {
|
|
657
659
|
yield transcript({
|
|
658
660
|
type: 'assistant',
|
|
@@ -87,6 +87,16 @@ export interface TextStream {
|
|
|
87
87
|
* 这一个记的是「屏上这条消息已经有了哪些字」,是**补差判据的输入**。
|
|
88
88
|
*/
|
|
89
89
|
readonly committedAnswerText: string;
|
|
90
|
+
/**
|
|
91
|
+
* 引擎「最后一条 assistant 消息」在屏上对应的那段正文 —— 终答补差的**正确比较对象**(0.63.2)。
|
|
92
|
+
*
|
|
93
|
+
* 🔴 与 {@link TextStream.committedAnswerText} 的差别只在一格:工具卡是这一轮最后一件事、卡后
|
|
94
|
+
* **零散文**时,`committedAnswerText` 已被边界重置成空串,而 provider 的一条 assistant 消息 =
|
|
95
|
+
* [text, tool_use] 两块 —— 引擎取的「最后一条消息的文本」正是卡**之前**那段。空串是任何终帧的
|
|
96
|
+
* 前缀,拿它去比会把整段终帧当「缺的后缀」再渲一遍(同一段话上屏两遍)。⇒ 当前消息一个字都没
|
|
97
|
+
* 上屏时,回退到**上一条真有正文的消息**那段;当前消息有字时与 `committedAnswerText` 逐字同。
|
|
98
|
+
*/
|
|
99
|
+
readonly lastCommittedAnswerText: string;
|
|
90
100
|
/**
|
|
91
101
|
* **一条新的 assistant 消息从这里开始**(重置 {@link TextStream.committedAnswerText})。
|
|
92
102
|
*
|
package/dist/adapt/textStream.js
CHANGED
|
@@ -49,6 +49,8 @@ export function createTextStream(ctx, idOf) {
|
|
|
49
49
|
let emittedAssistantText = false;
|
|
50
50
|
/** **当前这条 assistant 消息**已提交上屏的正文(补差判据的输入;与 `answer` 刻意分家,见接口注)。 */
|
|
51
51
|
let committedText = '';
|
|
52
|
+
/** 上一条**真有正文**的 assistant 消息在屏上的那段(见 lastCommittedAnswerText 头注)。 */
|
|
53
|
+
let previousCommittedText = '';
|
|
52
54
|
let textPending = '';
|
|
53
55
|
let thinkingPending = '';
|
|
54
56
|
let textBlockOpen = false;
|
|
@@ -203,11 +205,16 @@ export function createTextStream(ctx, idOf) {
|
|
|
203
205
|
committedText += committed;
|
|
204
206
|
},
|
|
205
207
|
beginAssistantMessage: () => {
|
|
208
|
+
if (committedText.length > 0)
|
|
209
|
+
previousCommittedText = committedText;
|
|
206
210
|
committedText = '';
|
|
207
211
|
},
|
|
208
212
|
get committedAnswerText() {
|
|
209
213
|
return committedText;
|
|
210
214
|
},
|
|
215
|
+
get lastCommittedAnswerText() {
|
|
216
|
+
return committedText.length > 0 ? committedText : previousCommittedText;
|
|
217
|
+
},
|
|
211
218
|
get emittedAssistantText() {
|
|
212
219
|
return emittedAssistantText;
|
|
213
220
|
},
|
|
@@ -4175,6 +4175,13 @@ readonly detachArmed?: boolean | undefined
|
|
|
4175
4175
|
「本轮全部正文」去比,一个「散文 → 工具 → 散文」的**正常多步回答**会被判成分岔,只差首尾空白的回答
|
|
4176
4176
|
同理。⇒ 左边必须是**当前这条 assistant 消息**已上屏的正文(工具边界重置),相等判定先过一次 `trim()`。
|
|
4177
4177
|
|
|
4178
|
+
**0.63.2 订正(卡后零散文)**:provider 的一条 assistant 消息 = `[text, tool_use]` 两块。工具卡是这一轮
|
|
4179
|
+
**最后**一件事、卡后一个字都没有时,引擎「最后一条消息的文本」正是卡**之前**那段;而工具边界已把
|
|
4180
|
+
「当前消息已上屏正文」重置成空串,空串是任何终帧的前缀 ⇒ 修前补差臂把整段终帧当「缺的后缀」再渲一遍
|
|
4181
|
+
(同一段话上屏两遍;cli 1.0.105 收官 mock 车道「散文 → Config 卡 → 收口」实撞)。⇒ 左边现在是
|
|
4182
|
+
「当前消息已上屏正文,**当前消息一个字都没上屏时回退到上一条真有正文的消息**」(`lastCommittedAnswerText`);
|
|
4183
|
+
当前消息有字时与修前逐字同。宿主零换装。
|
|
4184
|
+
|
|
4178
4185
|
**新 chrome 臂**:
|
|
4179
4186
|
|
|
4180
4187
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.63.
|
|
3
|
+
"version": "0.63.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",
|