@morlay/ui-conversation-message-actions 0.0.13 → 0.0.14-alpha.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/dist/client.js CHANGED
@@ -351,12 +351,12 @@ window.__ModuleLoader__.load({
351
351
  document.head.appendChild(tag);
352
352
  }
353
353
  var MessageIconActions_module_css_default = {
354
- "timeStart": "lKOSUG_timeStart",
355
354
  "action": "lKOSUG_action",
356
- "timeEnd": "lKOSUG_timeEnd",
355
+ "visuallyHidden": "lKOSUG_visuallyHidden",
357
356
  "actions": "lKOSUG_actions",
358
357
  "runTimeDot": "lKOSUG_runTimeDot",
359
- "visuallyHidden": "lKOSUG_visuallyHidden"
358
+ "timeStart": "lKOSUG_timeStart",
359
+ "timeEnd": "lKOSUG_timeEnd"
360
360
  };
361
361
  //#endregion
362
362
  //#region src/client/chat-node/MessageIconActions.tsx
@@ -496,8 +496,8 @@ window.__ModuleLoader__.load({
496
496
  document.head.appendChild(tag);
497
497
  }
498
498
  var MessageEditDialog_module_css_default = {
499
- "input": "_7VqDXa_input",
500
- "actions": "_7VqDXa_actions"
499
+ "actions": "_7VqDXa_actions",
500
+ "input": "_7VqDXa_input"
501
501
  };
502
502
  //#endregion
503
503
  //#region src/client/chat-node/MessageEditDialog.tsx
@@ -568,34 +568,34 @@ window.__ModuleLoader__.load({
568
568
  document.head.appendChild(tag);
569
569
  }
570
570
  var MessageItem_module_css_default = {
571
- "compactionBody": "okW0Ua_compactionBody",
571
+ "compactionButton": "okW0Ua_compactionButton",
572
+ "retryRow": "okW0Ua_retryRow",
573
+ "retry-shimmer": "okW0Ua_retry-shimmer",
574
+ "maxTokensTitle": "okW0Ua_maxTokensTitle",
575
+ "refChip": "okW0Ua_refChip",
572
576
  "userRow": "okW0Ua_userRow",
573
- "turnErrorCode": "okW0Ua_turnErrorCode",
577
+ "compactionSummary": "okW0Ua_compactionSummary",
578
+ "userStack": "okW0Ua_userStack",
579
+ "compactionRow": "okW0Ua_compactionRow",
574
580
  "compactionLeading": "okW0Ua_compactionLeading",
575
- "bubble": "okW0Ua_bubble",
576
- "retryText": "okW0Ua_retryText",
577
- "compactionButton": "okW0Ua_compactionButton",
578
- "retrySummary": "okW0Ua_retrySummary",
579
581
  "compactionDisclosureIcon": "okW0Ua_compactionDisclosureIcon",
580
- "compactionSummary": "okW0Ua_compactionSummary",
581
- "retryDetailLabel": "okW0Ua_retryDetailLabel",
582
582
  "retryDetails": "okW0Ua_retryDetails",
583
+ "contextRow": "okW0Ua_contextRow",
584
+ "retryDetailLabel": "okW0Ua_retryDetailLabel",
583
585
  "turnErrorRow": "okW0Ua_turnErrorRow",
584
- "compactionContextIcon": "okW0Ua_compactionContextIcon",
586
+ "compactionSep": "okW0Ua_compactionSep",
587
+ "turnErrorDot": "okW0Ua_turnErrorDot",
585
588
  "turnErrorCopy": "okW0Ua_turnErrorCopy",
589
+ "bubble": "okW0Ua_bubble",
590
+ "compactionBody": "okW0Ua_compactionBody",
591
+ "retryText": "okW0Ua_retryText",
592
+ "retrySummary": "okW0Ua_retrySummary",
593
+ "compactionTitle": "okW0Ua_compactionTitle",
594
+ "turnErrorTitle": "okW0Ua_turnErrorTitle",
586
595
  "turnErrorMessage": "okW0Ua_turnErrorMessage",
587
- "maxTokensTitle": "okW0Ua_maxTokensTitle",
588
- "compactionRow": "okW0Ua_compactionRow",
589
- "retry-shimmer": "okW0Ua_retry-shimmer",
590
- "refChip": "okW0Ua_refChip",
591
- "turnErrorDot": "okW0Ua_turnErrorDot",
596
+ "turnErrorCode": "okW0Ua_turnErrorCode",
592
597
  "confirmActions": "okW0Ua_confirmActions",
593
- "compactionSep": "okW0Ua_compactionSep",
594
- "compactionTitle": "okW0Ua_compactionTitle",
595
- "userStack": "okW0Ua_userStack",
596
- "contextRow": "okW0Ua_contextRow",
597
- "retryRow": "okW0Ua_retryRow",
598
- "turnErrorTitle": "okW0Ua_turnErrorTitle"
598
+ "compactionContextIcon": "okW0Ua_compactionContextIcon"
599
599
  };
600
600
  //#endregion
601
601
  //#region src/client/chat-node/MessageItem.tsx
@@ -623,7 +623,7 @@ window.__ModuleLoader__.load({
623
623
  while ((m = re.exec(text)) !== null) {
624
624
  const tokenStart = m.index + (m[1]?.length ?? 0);
625
625
  const label = m[2] ?? "";
626
- if (tokenStart > cursor) parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MessageText, { text: text.slice(cursor, tokenStart) }, cursor));
626
+ if (tokenStart > cursor) parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text.slice(cursor, tokenStart) }, cursor));
627
627
  parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
628
628
  className: MessageItem_module_css_default.refChip,
629
629
  "data-ref-chip": label.startsWith("@") ? "subagent" : "skill",
@@ -631,8 +631,8 @@ window.__ModuleLoader__.load({
631
631
  }, tokenStart));
632
632
  cursor = tokenStart + label.length;
633
633
  }
634
- if (parts.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MessageText, { text });
635
- if (cursor < text.length) parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MessageText, { text: text.slice(cursor) }, cursor));
634
+ if (parts.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text });
635
+ if (cursor < text.length) parts.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text.slice(cursor) }, cursor));
636
636
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: parts });
637
637
  }
638
638
  function UserStyleBubble({ content, renderMessageImages, actions, t }) {
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as SessionEditor, t as SESSION_BRANCH_VERSION_SCHEMA } from "./src-CXYW0Bc0.mjs";
1
+ import { n as SessionEditor, t as SESSION_BRANCH_VERSION_SCHEMA } from "./src-Da2ZVKlq.mjs";
2
2
  import { closedTurns, editableMessages, retryableTurns } from "./plan.mjs";
3
3
  export { SESSION_BRANCH_VERSION_SCHEMA, SessionEditor, SessionEditor as default, closedTurns, editableMessages, retryableTurns };
@@ -86,11 +86,9 @@ function appendManualTurn(events, manual) {
86
86
  appendSurfaceSeedEvent(events, "assistant/message", {
87
87
  turn,
88
88
  step: 1,
89
- message: assistant
90
- }, {
91
- surfaceOp: "append",
92
- sourceEventSeqs: []
93
- });
89
+ message: assistant,
90
+ stream: []
91
+ }, { surfaceOp: "append" });
94
92
  appendLogSeedEvent(events, "step/end", {
95
93
  turn,
96
94
  step: 1
@@ -100,13 +98,18 @@ function appendManualTurn(events, manual) {
100
98
  reason: { kind: "completed" }
101
99
  });
102
100
  }
103
- function appendSeedSuffixLive(session, seedSuffix) {
101
+ async function appendSeedSuffixLive(session, seedSuffix, appendDirect) {
104
102
  for (const event of seedSuffix) {
105
103
  if (event.ignorable === true) {
106
104
  const s = session;
105
+ const seq = s.log.length;
106
+ await appendDirect([{
107
+ ...event,
108
+ seq
109
+ }]);
107
110
  s.log.push({
108
111
  ...event,
109
- seq: s.log.length
112
+ seq
110
113
  });
111
114
  s.eventsSnapshot = void 0;
112
115
  continue;
@@ -179,8 +182,9 @@ var SessionEditor = class extends Service {
179
182
  await this.ctx.sessionBranch.rewind(operation.sessionId, boundary, signal);
180
183
  if (seedSuffix.length > 0) {
181
184
  if (live !== void 0) {
182
- appendSeedSuffixLive(live, seedSuffix);
183
- this.ctx.sessionBranch.syncLiveCursor(operation.sessionId);
185
+ const handle = this.ctx.sessionPersistence.tracker.writerOf(operation.sessionId);
186
+ if (handle === void 0) throw new Error(`session "${operation.sessionId}" has no live write handle for the version effect`);
187
+ await appendSeedSuffixLive(live, seedSuffix, (events) => handle.append(events));
184
188
  await this.ctx.sessions.flush(live);
185
189
  } else {
186
190
  const rawKeepLength = boundary + (plan.rewindBoundary === void 0 ? 1 : 0);
@@ -189,7 +193,12 @@ var SessionEditor = class extends Service {
189
193
  ...event,
190
194
  seq: keepLength + index
191
195
  }));
192
- await this.ctx.sessionPersistence.append(operation.sessionId, renumbered);
196
+ const handle = await this.ctx.sessionPersistence.open(operation.sessionId, "write");
197
+ try {
198
+ await handle.append(renumbered);
199
+ } finally {
200
+ await handle.close();
201
+ }
193
202
  }
194
203
  }
195
204
  let queuedTurns = 0;
@@ -2,7 +2,7 @@ import { SessionEditor } from "./index.mjs";
2
2
  import { Context, Service } from "@deepseek-ai/cordis";
3
3
  import { BranchBoundary, BranchTimeline, SessionBranch } from "@morlay/session-branch";
4
4
  import { TokenMeter } from "@deepseek-ai/dsh-token-meter";
5
- import { Session, Session as Session$1, SessionEvent, SessionEvent as SessionEvent$1, SessionHeader, SessionHeader as SessionHeader$1, SessionId, SessionId as SessionIdBrand, SessionSeq, SessionStore } from "@deepseek-ai/dsh-session";
5
+ import { Session, Session as Session$1, SessionEvent, SessionEvent as SessionEvent$1, SessionHeader, SessionHeader as SessionHeader$1, SessionId, SessionId as SessionIdBrand, SessionLogOffset, SessionSeq, SessionStore } from "@deepseek-ai/dsh-session";
6
6
  import { SessionPersistence, SessionPersistenceRevision, SessionStorageMetadata } from "@deepseek-ai/dsh-session-persistence";
7
7
  //#region ../../vendor/deepseek-harness/vendor/cosmokit/lib/types/types.d.ts
8
8
  declare function isArrayBufferLike(value: any): value is ArrayBufferLike;
@@ -678,7 +678,9 @@ declare class EmptySettings extends SettingsProvider {
678
678
  }
679
679
  //#endregion
680
680
  //#region ../session-rdb/src/testing/contract.d.ts
681
+ /** Build a minimal {@link SessionHeader} for a session id. */
681
682
  declare function meta(id: string, cwd?: string): SessionHeader$1;
683
+ /** A well-formed one-turn event log (contiguous seqs from 0). */
682
684
  declare function oneTurnLog(): SessionEvent$1[];
683
685
  //#endregion
684
686
  //#region src/testing.d.ts