@240xu/dsh-message-ops 0.5.7 → 0.6.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/README.md CHANGED
@@ -314,3 +314,33 @@ MIT
314
314
  openSession 强制重建视图(磁盘追加无 live 投影事件)。
315
315
  - live 会话(对象层在册)仍走引擎路径;两条路径共用 turn/step/id 派生与
316
316
  空区间停用语义。新回归测试断言可见节点/计划语义/字段镜像(44/44)。
317
+
318
+ ## 0.6.0 · opencode 对齐:回滚长在「我的消息」上 + 贴条化恢复 UI
319
+
320
+ 用户定调「回滚信息怎么可能回滚的是 AI 的信息」——此前唯一一键入口挂在官方
321
+ `conversation.chat.assistant-actions` 槽(只渲染在助手消息上),方向整个反了。
322
+ Playwright 实测 opencode web(127.0.0.1:4096)后四项改造:
323
+
324
+ 1. **用户消息 hover 注入「回滚」按钮**(核心):官方无用户消息动作槽 →
325
+ 受控 DOM 注入,靶点用官方 `[data-chat-flow-kind="user"]` 属性。点击即回滚
326
+ 「这条及其之后」(范围语义与 opencode 实测一致,未动)。**防错锁**:DOM 块 ↔
327
+ API 可见 user 行按序配对 + 文本归一化前缀互验,点击时复验一次,对不上拒绝
328
+ 执行(宁可不回滚,不回滚错消息)。
329
+ 2. **恢复条贴合输入框**(opencode 实测规格:条→输入框 1px、同宽同列、折叠 42px):
330
+ `.mopsRd` 锁 `max-width:var(--dsh-composer-card-max-width)`(与 `uV2eYG_card`
331
+ 同源变量)+ `margin-inline:auto` + `margin-bottom:-5px` 把宿主 composerStack 的
332
+ 6px gap 压成 **1px**;实测 bar rect [468,751,776,42]、card top 794/前轮 772 →
333
+ **gap=1、dx=-1、dw=2**;展开时列表向上涨(底边钉住,1px 不丢)。删 18px
334
+ spacer hack。EN 文案改 `{n} rolled back messages`(opencode 语序)。
335
+ 3. **对话框删「恢复」模式**:恢复唯一入口 = 贴条逐行按钮;对话框只留
336
+ 回滚/删除/分支(实测 modeCount=3、无恢复项)。顺手防呆:pick 列表排除
337
+ `role=system`(引擎 node0 守卫本就 500 拒绝——不该给用户一个必然失败的选项)。
338
+ 4. **恢复去 `[恢复]` 前缀**:重放干净文本(opencode 实测恢复无任何标记);
339
+ 机制说明保留在 system notice。引擎 append-only 无法真正反遮蔽,重放语义不变。
340
+ - 附带修复:注入器成功/失败回调误用组件级 `t()`(模块作用域未定义 → ReferenceError
341
+ 吃掉刷新链:回滚 200 而贴条不出现)→ 改模块级 `__t`。
342
+ - 验证:单测 44/44;Playwright 全环(发消息 → hover 回滚 200 → 贴条 gap=1 →
343
+ 展开 → 恢复 → 条清空 + 消息回 + 无前缀)两条路径(注入器 / 对话框)各一遍。
344
+ - 已知观察:宿主 `dsh-client-ui-open-in-app` 的 event feed 订阅在**无 id 重放事件**
345
+ (引擎原生 compaction 重放同形)上抛 `operation.kind` 读取错误——客户端已捕获、
346
+ 功能无损,属宿主脆读,不在本插件范围。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@240xu/dsh-message-ops",
3
- "version": "0.5.7",
3
+ "version": "0.6.0",
4
4
  "description": "Roll back, branch, and export any DSH conversation — from the UI or straight from the agent via a message_ops tool. Non-destructive: logs stay append-only and recoverable. 消息回滚/删除/分支/导出四合一,内置 message_ops agent 工具;非破坏语义,日志只追加可恢复。",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/client.js CHANGED
@@ -130,7 +130,7 @@ window.__ModuleLoader__.load({
130
130
  'done.delete': 'Deleted; reload to apply',
131
131
  'action.reload': 'Reload page',
132
132
  'errorPrefix': 'Operation failed: ',
133
- 'dock.title': '{n} messages rolled back',
133
+ 'dock.title': '{n} rolled back messages',
134
134
  'dock.expand': 'Expand revert list',
135
135
  'dock.collapse': 'Collapse revert list',
136
136
  'dock.shadowedN': '{n} shadowed',
@@ -146,6 +146,7 @@ window.__ModuleLoader__.load({
146
146
  var __sessionsSvc = null
147
147
  var __inputActions = null // 0.4.0: 从 session 槽捕获(InputActions.setDraft → composer 回填)
148
148
  var __uiWorkspace = null
149
+ var __currentSessionId = null // 0.6.0:会话视图会话 id(RevertDock/MsgSlotActions 刷新)
149
150
  // messageId→seq 索引缓存(每会话一次拉取;0.3.0 assistant-actions 槽用)
150
151
  var __seqIndexCache = new Map()
151
152
  // messageId→全文缓存(0.5.0 消息引用用)
@@ -430,7 +431,9 @@ window.__ModuleLoader__.load({
430
431
 
431
432
  if (!target) return null
432
433
 
433
- const visible = messages.filter((m) => m.visible !== false)
434
+ // 0.6.0:system prompt 行不可作为回滚/删除/分支目标(引擎拒之以 node0 守卫,
435
+ // 但不该给用户一个必然500的选项)——列表直接排除 role=system。
436
+ const visible = messages.filter((m) => m.visible !== false && m.role !== 'system')
434
437
  const shownBase = visible.slice(-MAX_RENDER)
435
438
  const hiddenCount = visible.length - shownBase.length
436
439
  // 分批渲染(评审 M1):只渲染 renderLimit 条,更早的留给「显示更多」
@@ -481,7 +484,8 @@ window.__ModuleLoader__.load({
481
484
  ),
482
485
  pickedMsg ? React.createElement('div', { key: 'ops' },
483
486
  // restore 仅对 revert/delete 落定的 replace 标记行提供(重放语义)
484
- ['revert', 'delete', 'branch'].concat(pickedMsg.marker ? ['restore'] : []).map((m, i) => React.createElement('div', { key: m, style: { marginTop: i === 0 ? 8 : 4 } },
487
+ // 0.6.0(用户定调):恢复不进对话框——唯一入口是输入框上方贴条;
488
+ ['revert', 'delete', 'branch'].map((m, i) => React.createElement('div', { key: m, style: { marginTop: i === 0 ? 8 : 4 } },
485
489
  React.createElement('label', { style: optStyle },
486
490
  React.createElement('input', {
487
491
  type: 'radio', name: 'dsh-message-ops-mode', checked: mode === m,
@@ -777,6 +781,7 @@ window.__ModuleLoader__.load({
777
781
 
778
782
  function RevertDock(props) {
779
783
  const { sessionId, useSessions, inputActions } = props
784
+ if (sessionId) __currentSessionId = sessionId
780
785
  const t = (props && props.t) || __t
781
786
  useLocaleRevision()
782
787
  if (inputActions && typeof inputActions.setDraft === 'function') __inputActions = inputActions
@@ -797,9 +802,12 @@ window.__ModuleLoader__.load({
797
802
  tag.id = 'dsh-message-ops-dock-style'
798
803
  tag.textContent = [
799
804
  // 容器:rounded-xl + 0.5px 边框 + bg-layer-01(M1 修正令牌)
800
- '.mopsRd{width:100%;overflow:hidden;border-radius:var(--dsw-radius-md,12px);border:.5px solid var(--dsw-alias-border-l1,rgba(128,128,128,.25));background:var(--dsw-alias-bg-layer-1,#1e1e20)}',
805
+ // 0.6.0 贴条(对齐 opencode):宽度锁到输入卡片同源变量(uV2eYG_card 同款
806
+ // max-width),居中;margin-bottom:-5px 把 composerStack 的6px gap 压成
807
+ // **1px 视觉贴合**(实测基线 gap14→目标1)。
808
+ '.mopsRd{width:100%;max-width:var(--dsh-composer-card-max-width);margin-inline:auto;margin-bottom:-5px;overflow:hidden;border-radius:var(--dsw-radius-md,12px);border:.5px solid var(--dsw-alias-border-l1,rgba(128,128,128,.25));background:var(--dsw-alias-bg-layer-1,#1e1e20)}',
801
809
  // 头部 42px:图标 + label + 折叠预览 + 旋转 chevron
802
- '.mopsRdHead{display:flex;height:42px;align-items:center;gap:8px;padding-left:16px;padding-right:8px;cursor:pointer;user-select:none}',
810
+ '.mopsRdHead{display:flex;height:40px;align-items:center;gap:8px;padding-left:16px;padding-right:8px;cursor:pointer;user-select:none}',
803
811
  '.mopsRdIcon{display:inline-flex;color:var(--dsw-alias-label-tertiary,#9a9aa0);flex:none}',
804
812
  '.mopsRdLabel{font-size:13px;font-weight:500;line-height:20px;letter-spacing:-.04px;flex:none;cursor:default;color:var(--dsw-alias-label-primary,inherit)}',
805
813
  '.mopsRdLabelCollapsed{color:var(--dsw-alias-label-secondary,#a8a8ae)}',
@@ -811,8 +819,6 @@ window.__ModuleLoader__.load({
811
819
  '.mopsRdRowText{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:20px;letter-spacing:-.04px;color:var(--dsw-alias-label-secondary,#a8a8ae)}',
812
820
  '.mopsRdRestore{flex:none;font:inherit;font-size:12px;line-height:18px;padding:2px 10px;border-radius:6px;cursor:pointer;color:var(--dsw-alias-label-primary,inherit);background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.12));border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));opacity:1}',
813
821
  '.mopsRdRestore:disabled{opacity:.45;cursor:default}',
814
- // 折叠时 18px sacrificial 空间(composer 负 lift 重叠)
815
- '.mopsRdSpacer{height:18px}',
816
822
  ].join('')
817
823
  document.head.appendChild(tag)
818
824
  setStyleInjected(true)
@@ -924,6 +930,131 @@ window.__ModuleLoader__.load({
924
930
  return null
925
931
  }
926
932
 
933
+ // --- 0.6.0 用户消息 hover「回滚」按钮(DOM 注入)-------------------------------
934
+ // 官方只提供 assistant-actions 槽;回滚的正确对象是**用户自己的消息**(opencode 同款:
935
+ // 悬停我的消息 → 即时回滚「这条及其之后」)。注入点用官方属性 [data-chat-flow-kind="user"]。
936
+ // 防错锁(用户批准的设计):DOM 块 ↔ API 可见 user 行按序配对 + 文本归一化前缀互验,
937
+ // 点击时再复验一次;对不上就拒绝执行(宁可不回滚,不回滚错消息)。
938
+ function installUserRevertInjector() {
939
+ if (window.__MOPS_USER_REVERT_INSTALLED) return
940
+ window.__MOPS_USER_REVERT_INSTALLED = true
941
+ var rowsCache = { sid: null, rows: null, at: 0 }
942
+ var norm = (x) => String(x || '').replace(/\s+/g, '')
943
+ var fetchRows = (sid) => {
944
+ if (rowsCache.sid === sid && rowsCache.rows && Date.now() - rowsCache.at < 8000) return Promise.resolve(rowsCache.rows)
945
+ return fetch('/api/message-ops/messages?sessionId=' + encodeURIComponent(sid))
946
+ .then((r) => (r.ok ? r.json() : null))
947
+ .then((d) => {
948
+ const rows = ((d && d.messages) || [])
949
+ .filter((m) => m && m.role === 'user' && m.visible !== false)
950
+ .map((m) => ({ seq: m.seq, sn: norm(m.snippet) }))
951
+ rowsCache = { sid: sid, rows: rows, at: Date.now() }
952
+ return rows
953
+ })
954
+ .catch(() => rowsCache.sid === sid ? rowsCache.rows : null)
955
+ }
956
+ // 把当前 DOM 的 user 块按序配对到 seq(互验失败的块不打标 → 按钮禁用回滚)
957
+ var assignSeqs = (sid, rows) => {
958
+ if (!rows) return
959
+ const blocks = Array.from(document.querySelectorAll('[data-chat-flow-kind="user"]'))
960
+ let ri = 0
961
+ for (const b of blocks) {
962
+ b.removeAttribute('data-mops-seq')
963
+ const head = norm((b.innerText || '').slice(0, 240))
964
+ let hit = -1
965
+ for (let j = ri; j < rows.length; j++) {
966
+ if (rows[j].sn && head && (head.startsWith(rows[j].sn.slice(0, 48)) || rows[j].sn.startsWith(head.slice(0, 48)))) { hit = j; break }
967
+ }
968
+ if (hit >= 0) { b.setAttribute('data-mops-seq', String(rows[hit].seq)); ri = hit + 1 }
969
+ }
970
+ }
971
+ var ensureAssign = (sid) => fetchRows(sid).then((rows) => assignSeqs(sid, rows))
972
+ // 单击回滚(带复验)
973
+ var runUserRevert = (btn, block) => {
974
+ const sid = __currentSessionId
975
+ if (!sid) return
976
+ const seq = Number(block.getAttribute('data-mops-seq'))
977
+ const head = norm((block.innerText || '').slice(0, 240))
978
+ fetchRows(sid).then((rows) => {
979
+ const row = rows && rows.find((r) => r.seq === seq)
980
+ if (!row || !head || !(head.startsWith(row.sn.slice(0, 48)) || row.sn.startsWith(head.slice(0, 48)))) {
981
+ ensureAssign(sid)
982
+ notifyDone(__t('errorPrefix') + 'revert target verification failed', 'error')
983
+ return
984
+ }
985
+ btn.disabled = true
986
+ Promise.resolve()
987
+ .then(() => fetch('/api/message-ops/revert', {
988
+ method: 'POST', headers: { 'content-type': 'application/json' },
989
+ body: JSON.stringify({ sessionId: sid, seq: row.seq }),
990
+ }))
991
+ .then(async (res) => {
992
+ let data = {}
993
+ try { data = await res.json() } catch { /* keep {} */ }
994
+ if (!res.ok || !data.ok) throw new Error(data.error || ('HTTP ' + res.status))
995
+ notifyDone(__t('done.revert'))
996
+ try { window.dispatchEvent(new Event(CHANGED_EVENT)) } catch { /* non-browser */ }
997
+ try {
998
+ if (__uiWorkspace && typeof __uiWorkspace.openSession === 'function') __uiWorkspace.openSession(sid)
999
+ } catch { /* 视图重建失败不阻断 */ }
1000
+ })
1001
+ .catch((reason) => {
1002
+ notifyDone(__t('errorPrefix') + (reason && reason.message ? reason.message : String(reason)), 'error')
1003
+ })
1004
+ .finally(() => { btn.disabled = false })
1005
+ })
1006
+ }
1007
+ var ensureBtn = (block) => {
1008
+ let btn = block.querySelector('.mopsUserRevert')
1009
+ if (btn) return btn
1010
+ btn = document.createElement('button')
1011
+ btn.type = 'button'
1012
+ btn.className = 'mopsUserRevert'
1013
+ btn.title = __t('slot.revert')
1014
+ btn.setAttribute('aria-label', __t('slot.revert'))
1015
+ btn.innerHTML = '<svg width="15" height="15" viewBox="0 0 16 16" fill="none"><path d="M2.5 8a5.5 5.5 0 1 0 1.6-3.9" stroke="currentColor" stroke-width="1.2"/><path d="M2.2 2.8v3h3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>'
1016
+ btn.addEventListener('click', (e) => {
1017
+ e.preventDefault(); e.stopPropagation()
1018
+ if (btn.disabled) return
1019
+ runUserRevert(btn, block)
1020
+ })
1021
+ block.appendChild(btn)
1022
+ return btn
1023
+ }
1024
+ document.addEventListener('mouseover', (e) => {
1025
+ try {
1026
+ if (!e || !e.target || !e.target.closest) return
1027
+ const block = e.target.closest('[data-chat-flow-kind="user"]')
1028
+ if (!block) return
1029
+ const sid = __currentSessionId
1030
+ if (!sid) return
1031
+ ensureBtn(block)
1032
+ if (!block.hasAttribute('data-mops-seq')) { ensureAssign(sid) }
1033
+ } catch { /* 注入失败不影响会话 */ }
1034
+ }, { passive: true })
1035
+ // 会话切换/回滚落定后:清标(下一次 hover 重新配对)
1036
+ window.addEventListener(CHANGED_EVENT, () => {
1037
+ try {
1038
+ document.querySelectorAll('[data-mops-seq]').forEach((b) => b.removeAttribute('data-mops-seq'))
1039
+ } catch { /* noop */ }
1040
+ })
1041
+ // 注入按钮样式(贴合官方 ghost 按钮)
1042
+ try {
1043
+ if (!document.getElementById('dsh-message-ops-user-revert-style')) {
1044
+ const tag = document.createElement('style')
1045
+ tag.id = 'dsh-message-ops-user-revert-style'
1046
+ tag.textContent = [
1047
+ '[data-chat-flow-kind="user"]{position:relative}',
1048
+ '.mopsUserRevert{position:absolute;top:2px;right:2px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:6px;background:transparent;color:var(--dsw-alias-label-tertiary,#9a9aa0);opacity:0;cursor:pointer;padding:0;z-index:3;transition:opacity .12s ease}',
1049
+ '[data-chat-flow-kind="user"]:hover>.mopsUserRevert,[data-chat-flow-kind="user"]:focus-within>.mopsUserRevert,.mopsUserRevert:focus-visible{opacity:.8}',
1050
+ '.mopsUserRevert:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.12))}',
1051
+ '.mopsUserRevert:disabled{opacity:.4;cursor:default}',
1052
+ ].join('')
1053
+ document.head.appendChild(tag)
1054
+ }
1055
+ } catch { /* style 注入失败不影响功能 */ }
1056
+ }
1057
+
927
1058
  function ensureSidebarOpsItem() {
928
1059
  var menu = document.querySelector('[role=menu]')
929
1060
  if (!menu) return
@@ -1055,6 +1186,7 @@ window.__ModuleLoader__.load({
1055
1186
  ...(__locale ? { locale: NS } : {}),
1056
1187
  }, OpsDialog))
1057
1188
  installSidebarOps()
1189
+ installUserRevertInjector()
1058
1190
  }
1059
1191
 
1060
1192
  return { apply, inject: ['slots'] }
package/src/index.js CHANGED
@@ -353,13 +353,14 @@ async function opsRestore(targetCtx, sessionId, restoreSeq) {
353
353
  }
354
354
  // store-miss → 磁盘路径:说明事件 + 重放事件批量追加(一个帧)
355
355
  let cursor = nextSeqFrom(events);
356
- const now = Date.now();
356
+ const baseTime = Date.now();
357
357
  const batch = [buildRestoreNoticeEvent({
358
- seq: cursor++, time: now, turnStep: plan.turnStep,
358
+ seq: cursor++, time: baseTime, turnStep: plan.turnStep,
359
359
  text: restoreNoticeText(plan), restoreSeq: plan.restoreSeq,
360
360
  })];
361
+ let offset = 0;
361
362
  for (const item of plan.replayable) {
362
- batch.push(buildReplayEvent({ seq: cursor++, time: ++now, item }));
363
+ batch.push(buildReplayEvent({ seq: cursor++, time: baseTime + (++offset), item }));
363
364
  }
364
365
  await diskAppend(logPath, batch);
365
366
  return {
package/src/ops-core.js CHANGED
@@ -12,7 +12,7 @@ import { randomUUID } from "node:crypto";
12
12
  * (dsh-src 仓库较新副本已改名为 start/end;本插件面向安装的运行时,
13
13
  * 写入用 startSeq/endSeq,读取端两种拼写都兼容以便前向迁移)。
14
14
  * - 因此「回滚恢复」只能实现为「重放」(replay):把被遮蔽区间的
15
- * user/assistant 消息文本重新 append 为新事件(文本加 [恢复] 前缀),
15
+ * user/assistant 消息文本重新 append 为新事件(0.6.0:干净文本无前缀,对齐 opencode),
16
16
  * 而不是取消遮蔽。语义差异见 README。
17
17
  * @module dsh-message-ops/ops-core
18
18
  */
@@ -162,7 +162,7 @@ export function planRestore(events, restoreSeq) {
162
162
  /**
163
163
  * applyRestore:把 planRestore 的重放计划落定到 live session。
164
164
  * 引擎不支持取消遮蔽(SurfaceOp 无该变体),故实现为重放:
165
- * 每条消息以原类型 append、文本加 [恢复] 前缀;先 append 一条 system 说明。
165
+ * 0.6.0:每条消息以原类型 append、**干净文本(无前缀,对齐 opencode 干净恢复)**;先 append 一条 system 说明。
166
166
  */
167
167
  /** 恢复说明文案(live append 与磁盘路径共用;空可重放 = 停用语义)。 */
168
168
  export function restoreNoticeText(plan) {
@@ -190,7 +190,7 @@ export function applyRestore(session, plan, { flush } = {}) {
190
190
  for (const item of plan.replayable) {
191
191
  const event = session.append(
192
192
  item.type,
193
- { message: { role: item.role, content: [{ type: "text", text: `[恢复] ${item.text}` }] } },
193
+ { message: { role: item.role, content: [{ type: "text", text: item.text }] } },
194
194
  { surfaceOp: "append" },
195
195
  );
196
196
  if (event && event.seq != null) eventSeqs.push(event.seq);
@@ -417,13 +417,13 @@ export function buildRestoreNoticeEvent({ seq, time, turnStep, text, restoreSeq
417
417
  };
418
418
  }
419
419
 
420
- /** 磁盘重放事件(镜像引擎:无 id、[恢复] 前缀、surfaceOp "append")。 */
420
+ /** 磁盘重放事件(镜像引擎:无 id、干净文本无前缀(0.6.0 对齐 opencode)、surfaceOp "append")。 */
421
421
  export function buildReplayEvent({ seq, time, item }) {
422
422
  return {
423
423
  type: item.type,
424
424
  seq,
425
425
  time,
426
- data: { message: { role: item.role, content: [{ type: "text", text: `[恢复] ${item.text}` }] } },
426
+ data: { message: { role: item.role, content: [{ type: "text", text: item.text }] } },
427
427
  surfaceOp: "append",
428
428
  };
429
429
  }
@@ -104,7 +104,7 @@ test('planRestore:非标记事件 / 越界 seq 拒绝;空可重放区间改
104
104
  assert.equal(plan.startSeq, 0)
105
105
  })
106
106
 
107
- test('applyRestore:重放 append 带 [恢复] 前缀 + system 说明,flush 被调用', () => {
107
+ test('applyRestore:重放 append 干净文本(0.6.0 无前缀)+ system 说明,flush 被调用', () => {
108
108
  const appended = []
109
109
  let seq = 10
110
110
  const session = {
@@ -124,8 +124,8 @@ test('applyRestore:重放 append 带 [恢复] 前缀 + system 说明,flush
124
124
  assert.equal(appended[0].type, 'system/message')
125
125
  assert.match(appended[0].data.message.content[0].text, /\[消息恢复\] 重放 seq 3\.\.4 的 2 条消息/)
126
126
  assert.equal(appended[1].type, 'user/message')
127
- assert.equal(appended[1].data.message.content[0].text, '[恢复] 第二问')
128
- assert.equal(appended[2].data.message.content[0].text, '[恢复] 第二答')
127
+ assert.equal(appended[1].data.message.content[0].text, '第二问', '0.6.0 对齐 opencode:无前缀')
128
+ assert.equal(appended[2].data.message.content[0].text, '第二答')
129
129
  for (const a of appended) assert.equal(a.opts.surfaceOp, 'append')
130
130
  })
131
131
 
@@ -356,6 +356,6 @@ test('磁盘计划/构建器:可见节点剔除遮蔽、marker 字段逐项镜
356
356
  assert.equal(nt.data.restoresSeq, 13);
357
357
  const rp = core.buildReplayEvent({ seq: 17, time: 3, item: { type: 'user/message', role: 'user', text: 'hi' } });
358
358
  assert.equal(rp.surfaceOp, 'append');
359
- assert.deepEqual(rp.data.message, { role: 'user', content: [{ type: 'text', text: '[恢复] hi' }] });
359
+ assert.deepEqual(rp.data.message, { role: 'user', content: [{ type: 'text', text: 'hi' }] }); // 0.6.0 无前缀
360
360
  assert.ok(!('id' in rp.data.message), '重放镜像引擎:不带 id');
361
361
  });