@morlay/ui-conversation-message-actions 0.0.12 → 0.0.13
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 +23 -23
- package/dist/index.d.mts +21 -69
- package/dist/index.mjs +2 -606
- package/dist/invariant.d.mts +1 -2
- package/dist/invariant.mjs +0 -2
- package/dist/plan-Bw4zoI4N.d.mts +86 -0
- package/dist/plan.d.mts +2 -0
- package/dist/plan.mjs +225 -0
- package/dist/src-CXYW0Bc0.mjs +408 -0
- package/dist/testing.d.mts +707 -0
- package/dist/testing.mjs +23690 -0
- package/package.json +32 -12
- package/src/index.ts +79 -365
- package/src/plan.ts +322 -0
- package/src/testing.ts +151 -0
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/invariant.d.mts.map +0 -1
- package/dist/invariant.mjs.map +0 -1
package/dist/client.js
CHANGED
|
@@ -352,10 +352,10 @@ window.__ModuleLoader__.load({
|
|
|
352
352
|
}
|
|
353
353
|
var MessageIconActions_module_css_default = {
|
|
354
354
|
"timeStart": "lKOSUG_timeStart",
|
|
355
|
-
"
|
|
355
|
+
"action": "lKOSUG_action",
|
|
356
356
|
"timeEnd": "lKOSUG_timeEnd",
|
|
357
357
|
"actions": "lKOSUG_actions",
|
|
358
|
-
"
|
|
358
|
+
"runTimeDot": "lKOSUG_runTimeDot",
|
|
359
359
|
"visuallyHidden": "lKOSUG_visuallyHidden"
|
|
360
360
|
};
|
|
361
361
|
//#endregion
|
|
@@ -568,34 +568,34 @@ window.__ModuleLoader__.load({
|
|
|
568
568
|
document.head.appendChild(tag);
|
|
569
569
|
}
|
|
570
570
|
var MessageItem_module_css_default = {
|
|
571
|
-
"
|
|
571
|
+
"compactionBody": "okW0Ua_compactionBody",
|
|
572
|
+
"userRow": "okW0Ua_userRow",
|
|
573
|
+
"turnErrorCode": "okW0Ua_turnErrorCode",
|
|
574
|
+
"compactionLeading": "okW0Ua_compactionLeading",
|
|
575
|
+
"bubble": "okW0Ua_bubble",
|
|
576
|
+
"retryText": "okW0Ua_retryText",
|
|
577
|
+
"compactionButton": "okW0Ua_compactionButton",
|
|
578
|
+
"retrySummary": "okW0Ua_retrySummary",
|
|
579
|
+
"compactionDisclosureIcon": "okW0Ua_compactionDisclosureIcon",
|
|
580
|
+
"compactionSummary": "okW0Ua_compactionSummary",
|
|
572
581
|
"retryDetailLabel": "okW0Ua_retryDetailLabel",
|
|
573
|
-
"
|
|
582
|
+
"retryDetails": "okW0Ua_retryDetails",
|
|
574
583
|
"turnErrorRow": "okW0Ua_turnErrorRow",
|
|
575
|
-
"refChip": "okW0Ua_refChip",
|
|
576
584
|
"compactionContextIcon": "okW0Ua_compactionContextIcon",
|
|
585
|
+
"turnErrorCopy": "okW0Ua_turnErrorCopy",
|
|
577
586
|
"turnErrorMessage": "okW0Ua_turnErrorMessage",
|
|
578
|
-
"
|
|
587
|
+
"maxTokensTitle": "okW0Ua_maxTokensTitle",
|
|
588
|
+
"compactionRow": "okW0Ua_compactionRow",
|
|
589
|
+
"retry-shimmer": "okW0Ua_retry-shimmer",
|
|
590
|
+
"refChip": "okW0Ua_refChip",
|
|
579
591
|
"turnErrorDot": "okW0Ua_turnErrorDot",
|
|
580
|
-
"
|
|
592
|
+
"confirmActions": "okW0Ua_confirmActions",
|
|
581
593
|
"compactionSep": "okW0Ua_compactionSep",
|
|
582
|
-
"
|
|
583
|
-
"
|
|
584
|
-
"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",
|
|
594
|
+
"compactionTitle": "okW0Ua_compactionTitle",
|
|
595
|
+
"userStack": "okW0Ua_userStack",
|
|
590
596
|
"contextRow": "okW0Ua_contextRow",
|
|
591
|
-
"
|
|
592
|
-
"
|
|
593
|
-
"compactionLeading": "okW0Ua_compactionLeading",
|
|
594
|
-
"retryDetails": "okW0Ua_retryDetails",
|
|
595
|
-
"compactionDisclosureIcon": "okW0Ua_compactionDisclosureIcon",
|
|
596
|
-
"retryText": "okW0Ua_retryText",
|
|
597
|
-
"maxTokensTitle": "okW0Ua_maxTokensTitle",
|
|
598
|
-
"compactionSummary": "okW0Ua_compactionSummary"
|
|
597
|
+
"retryRow": "okW0Ua_retryRow",
|
|
598
|
+
"turnErrorTitle": "okW0Ua_turnErrorTitle"
|
|
599
599
|
};
|
|
600
600
|
//#endregion
|
|
601
601
|
//#region src/client/chat-node/MessageItem.tsx
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
126
|
-
|
|
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 };
|