@morlay/ui-conversation-message-actions 0.0.12 → 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
- "runTimeDot": "lKOSUG_runTimeDot",
356
- "timeEnd": "lKOSUG_timeEnd",
357
- "actions": "lKOSUG_actions",
358
354
  "action": "lKOSUG_action",
359
- "visuallyHidden": "lKOSUG_visuallyHidden"
355
+ "visuallyHidden": "lKOSUG_visuallyHidden",
356
+ "actions": "lKOSUG_actions",
357
+ "runTimeDot": "lKOSUG_runTimeDot",
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
+ "compactionButton": "okW0Ua_compactionButton",
572
+ "retryRow": "okW0Ua_retryRow",
573
+ "retry-shimmer": "okW0Ua_retry-shimmer",
574
+ "maxTokensTitle": "okW0Ua_maxTokensTitle",
575
+ "refChip": "okW0Ua_refChip",
576
+ "userRow": "okW0Ua_userRow",
577
+ "compactionSummary": "okW0Ua_compactionSummary",
571
578
  "userStack": "okW0Ua_userStack",
579
+ "compactionRow": "okW0Ua_compactionRow",
580
+ "compactionLeading": "okW0Ua_compactionLeading",
581
+ "compactionDisclosureIcon": "okW0Ua_compactionDisclosureIcon",
582
+ "retryDetails": "okW0Ua_retryDetails",
583
+ "contextRow": "okW0Ua_contextRow",
572
584
  "retryDetailLabel": "okW0Ua_retryDetailLabel",
573
- "compactionTitle": "okW0Ua_compactionTitle",
574
585
  "turnErrorRow": "okW0Ua_turnErrorRow",
575
- "refChip": "okW0Ua_refChip",
576
- "compactionContextIcon": "okW0Ua_compactionContextIcon",
577
- "turnErrorMessage": "okW0Ua_turnErrorMessage",
578
- "confirmActions": "okW0Ua_confirmActions",
579
- "turnErrorDot": "okW0Ua_turnErrorDot",
580
- "bubble": "okW0Ua_bubble",
581
586
  "compactionSep": "okW0Ua_compactionSep",
587
+ "turnErrorDot": "okW0Ua_turnErrorDot",
582
588
  "turnErrorCopy": "okW0Ua_turnErrorCopy",
583
- "turnErrorTitle": "okW0Ua_turnErrorTitle",
589
+ "bubble": "okW0Ua_bubble",
584
590
  "compactionBody": "okW0Ua_compactionBody",
585
- "userRow": "okW0Ua_userRow",
586
- "retry-shimmer": "okW0Ua_retry-shimmer",
587
- "turnErrorCode": "okW0Ua_turnErrorCode",
588
- "retryRow": "okW0Ua_retryRow",
589
- "retrySummary": "okW0Ua_retrySummary",
590
- "contextRow": "okW0Ua_contextRow",
591
- "compactionRow": "okW0Ua_compactionRow",
592
- "compactionButton": "okW0Ua_compactionButton",
593
- "compactionLeading": "okW0Ua_compactionLeading",
594
- "retryDetails": "okW0Ua_retryDetails",
595
- "compactionDisclosureIcon": "okW0Ua_compactionDisclosureIcon",
596
591
  "retryText": "okW0Ua_retryText",
597
- "maxTokensTitle": "okW0Ua_maxTokensTitle",
598
- "compactionSummary": "okW0Ua_compactionSummary"
592
+ "retrySummary": "okW0Ua_retrySummary",
593
+ "compactionTitle": "okW0Ua_compactionTitle",
594
+ "turnErrorTitle": "okW0Ua_turnErrorTitle",
595
+ "turnErrorMessage": "okW0Ua_turnErrorMessage",
596
+ "turnErrorCode": "okW0Ua_turnErrorCode",
597
+ "confirmActions": "okW0Ua_confirmActions",
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.d.mts CHANGED
@@ -1,59 +1,8 @@
1
+ import { _ as SessionEditorResult, d as EditableMessageBlock, f as RerollOperation, g as SessionEditorOperation, h as RewindOperation, l as retryableTurns, m as RetryableTurn, o as editableMessages, p as RetryOperation, r as closedTurns, u as EditOperation } from "./plan-Bw4zoI4N.mjs";
1
2
  import { Context, Service } from "@deepseek-ai/cordis";
2
- import { BranchBoundary, BranchTimeline, BranchTimeline as BranchTimeline$1, CascadePolicy, CascadePolicy as CascadePolicy$1, EditableBlockKind, SESSION_BRANCH_VERSION_SCHEMA, SessionBranchVersionEvent } from "@morlay/session-branch";
3
- import { UserMessage } from "@deepseek-ai/dsh-llm";
3
+ import { BranchBoundary, BranchTimeline, BranchTimeline as BranchTimeline$1, CascadePolicy, EditableBlockKind, SESSION_BRANCH_VERSION_SCHEMA, SessionBranchVersionEvent } from "@morlay/session-branch";
4
4
  import { Session, SessionEvent, SessionId } from "@deepseek-ai/dsh-session";
5
- //#region src/types.d.ts
6
- interface EditOperation {
7
- action: "edit";
8
- sessionId: SessionId;
9
- eventSeq: number;
10
- blockIndex: number;
11
- text: string;
12
- cascade: CascadePolicy$1;
13
- }
14
- interface RerollOperation {
15
- action: "reroll";
16
- sessionId: SessionId;
17
- }
18
- interface RetryOperation {
19
- action: "retry";
20
- sessionId: SessionId;
21
- turn: number;
22
- cascade: CascadePolicy$1;
23
- }
24
- interface RewindOperation {
25
- action: "rewind";
26
- sessionId: SessionId;
27
- toBoundary: number;
28
- }
29
- interface ForkOperation {
30
- action: "fork";
31
- sessionId: SessionId;
32
- atSeq?: number;
33
- childSessionId?: SessionId;
34
- }
35
- type SessionEditorOperation = EditOperation | RerollOperation | RetryOperation | RewindOperation | ForkOperation;
36
- interface SessionEditorResult {
37
- sessionId: SessionId;
38
- queuedTurns: number;
39
- live?: boolean;
40
- }
41
- interface EditableMessageBlock {
42
- key: string;
43
- turn: number;
44
- eventSeq: number;
45
- blockIndex: number;
46
- kind: "user" | "assistant.reasoning" | "assistant.response";
47
- text: string;
48
- time: number;
49
- }
50
- interface RetryableTurn {
51
- turn: number;
52
- userEventSeq: number;
53
- preview: string;
54
- time: number;
55
- }
56
- //#endregion
5
+ import { UserMessage } from "@deepseek-ai/dsh-llm";
57
6
  //#region src/index.d.ts
58
7
  declare module "@deepseek-ai/cordis" {
59
8
  interface Context {
@@ -63,6 +12,16 @@ declare module "@deepseek-ai/cordis" {
63
12
  interface EditorAgent {
64
13
  readonly session: Session;
65
14
  followup(message: UserMessage): void;
15
+ /** 等待 agent 到达 quiescence(当前 turn/任务结束后 resolve)。 */
16
+ whenIdle(): Promise<void>;
17
+ /**
18
+ * 队列中是否有待处理输入(next-turn / next-step)。rewind 截断会删除这些
19
+ * 输入所属轮次的事件,残留的 inbox 状态会与截断后的 log 失配,使后续
20
+ * splice 落库后无法从日志重放——编辑前必须清空。
21
+ */
22
+ readonly inboxPending: boolean;
23
+ /** 清空待处理输入(落库 canceled splice,须在 rewind 前调用)。 */
24
+ clearInbox(): void;
66
25
  }
67
26
  interface EditorAgentHandle {
68
27
  readonly agent: EditorAgent;
@@ -94,17 +53,6 @@ interface EditorAgentRegistry {
94
53
  };
95
54
  }): Promise<EditorAgentHandle>;
96
55
  }
97
- interface ClosedTurn {
98
- turn: number;
99
- startSeq: number;
100
- endSeq?: number;
101
- closed: boolean;
102
- user?: SessionEvent<"user/message">;
103
- assistants: SessionEvent<"assistant/message">[];
104
- }
105
- declare function closedTurns(events: readonly SessionEvent[]): ClosedTurn[];
106
- declare function editableMessages(turns: readonly ClosedTurn[]): EditableMessageBlock[];
107
- declare function retryableTurns(turns: readonly ClosedTurn[]): RetryableTurn[];
108
56
  declare class SessionEditor extends Service {
109
57
  static inject: string[];
110
58
  constructor(ctx: Context);
@@ -122,8 +70,13 @@ declare class SessionEditor extends Service {
122
70
  retryableTurns(sessionId: SessionId, signal?: AbortSignal): Promise<RetryableTurn[]>;
123
71
  private branchOperation;
124
72
  private readEvents;
125
- private driveAgent;
126
- private queueThroughAgent;
73
+ /**
74
+ * rewind 前确保 agent 可驱动重放:live agent 先等待其停下(rewind 会截断其
75
+ * session 内存 log,须在 quiescence 后执行);cold 会话先 resume 出驻留
76
+ * agent(此时会话完整,resume 的 prepare 不与截断冲突)。agents 服务缺失或
77
+ * 无需重放时返回空——调用方退化为就地截断版本。
78
+ */
79
+ private prepareReplay;
127
80
  }
128
81
  interface HttpRequestLike {
129
82
  method?: string;
@@ -149,5 +102,4 @@ declare module "@deepseek-ai/cordis" {
149
102
  }
150
103
  }
151
104
  //#endregion
152
- export { type BranchTimeline, type CascadePolicy, type EditOperation, type EditableBlockKind, type EditableMessageBlock, EditorAgent, EditorAgentHandle, EditorAgentRegistry, type RerollOperation, type RetryOperation, type RetryableTurn, type RewindOperation, SESSION_BRANCH_VERSION_SCHEMA, type SessionBranchVersionEvent, SessionEditor, SessionEditor as default, type SessionEditorOperation, type SessionEditorResult, closedTurns, editableMessages, retryableTurns };
153
- //# sourceMappingURL=index.d.mts.map
105
+ export { type BranchTimeline, type CascadePolicy, type EditOperation, type EditableBlockKind, type EditableMessageBlock, EditorAgent, EditorAgentHandle, EditorAgentRegistry, type RerollOperation, type RetryOperation, type RetryableTurn, type RewindOperation, SESSION_BRANCH_VERSION_SCHEMA, type SessionBranchVersionEvent, SessionEditor, SessionEditor as default, type SessionEditorOperation, type SessionEditorResult, closedTurns, editableMessages, retryableTurns };