markloom 0.4.0 → 0.5.1

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.
Files changed (51) hide show
  1. package/README.md +29 -16
  2. package/ai.md +160 -0
  3. package/collab.md +70 -0
  4. package/dist/ai/index.cjs +4 -3
  5. package/dist/ai/index.d.cts +4 -2
  6. package/dist/ai/index.d.ts +4 -2
  7. package/dist/ai/index.js +3 -2
  8. package/dist/chunk-4JSJAHTB.js +255 -0
  9. package/dist/{chunk-VVFIQLVR.cjs → chunk-4TMHVNL6.cjs} +71 -79
  10. package/dist/chunk-ALZ3A5CS.cjs +255 -0
  11. package/dist/{chunk-QXJHFQLJ.js → chunk-FCH7LZFI.js} +23 -15
  12. package/dist/chunk-GQ2HHRGI.cjs +16 -0
  13. package/dist/chunk-JS527FDV.cjs +294 -0
  14. package/dist/chunk-LA5SBCGQ.js +16 -0
  15. package/dist/{chunk-ITVAR2UM.js → chunk-LEYAQNJA.js} +5 -3
  16. package/dist/{chunk-J3QWW6CN.js → chunk-MFYF2A6U.js} +5 -13
  17. package/dist/chunk-RLTHVQNQ.js +294 -0
  18. package/dist/{chunk-VSTOMEU2.cjs → chunk-VXM7Q6P5.cjs} +813 -478
  19. package/dist/{chunk-LNSKDJMF.cjs → chunk-YIFOGP2D.cjs} +46 -38
  20. package/dist/{chunk-HA6XHJUD.cjs → chunk-YXQDCW4Y.cjs} +22 -20
  21. package/dist/{chunk-VMUJM52A.js → chunk-ZMTLSFLO.js} +350 -15
  22. package/dist/client-6KiH4kGK.d.ts +144 -0
  23. package/dist/client-ZRZj2nkq.d.cts +144 -0
  24. package/dist/collab/index.cjs +25 -0
  25. package/dist/collab/index.d.cts +11 -0
  26. package/dist/collab/index.d.ts +11 -0
  27. package/dist/collab/index.js +25 -0
  28. package/dist/comments-DlExS6f-.d.cts +43 -0
  29. package/dist/comments-PhnR7Gkn.d.ts +43 -0
  30. package/dist/{controller-B_wG2Wh-.d.ts → controller-BNuuUM3E.d.ts} +26 -2
  31. package/dist/{controller-Cd1Dprrk.d.cts → controller-DQITsFhy.d.cts} +26 -2
  32. package/dist/index.cjs +21 -243
  33. package/dist/index.d.cts +5 -7
  34. package/dist/index.d.ts +5 -7
  35. package/dist/index.js +22 -244
  36. package/dist/react/index.cjs +8 -5
  37. package/dist/react/index.d.cts +4 -2
  38. package/dist/react/index.d.ts +4 -2
  39. package/dist/react/index.js +7 -4
  40. package/dist/rebase-batch-8rL_aXEE.d.ts +38 -0
  41. package/dist/rebase-batch-bYnBJpRO.d.cts +38 -0
  42. package/dist/step-BrvHIK7O.d.cts +65 -0
  43. package/dist/step-BrvHIK7O.d.ts +65 -0
  44. package/dist/view/index.cjs +11 -8
  45. package/dist/view/index.d.cts +5 -3
  46. package/dist/view/index.d.ts +5 -3
  47. package/dist/view/index.js +7 -4
  48. package/dist/view/theme.css +72 -0
  49. package/package.json +10 -3
  50. package/dist/comments-USjT1wYN.d.cts +0 -105
  51. package/dist/comments-USjT1wYN.d.ts +0 -105
@@ -0,0 +1,144 @@
1
+ import { P as Path, E as ElementNode, S as Step } from './step-BrvHIK7O.cjs';
2
+
3
+ /** 光标/选区在协议里的轻量形态(path + offset,无 assoc) */
4
+ type WireSel = {
5
+ anchor: {
6
+ path: Path;
7
+ offset: number;
8
+ };
9
+ head: {
10
+ path: Path;
11
+ offset: number;
12
+ };
13
+ };
14
+ type PeerInfo = {
15
+ siteId: number;
16
+ name?: string;
17
+ color?: string;
18
+ sel?: WireSel | null;
19
+ };
20
+ type ClientJoin = {
21
+ type: 'join';
22
+ room: string;
23
+ name?: string;
24
+ color?: string;
25
+ /** 空房时用客户端 doc 初始化 */
26
+ seed?: ElementNode;
27
+ };
28
+ type ClientOp = {
29
+ type: 'op';
30
+ baseVersion: number;
31
+ clientSeq: number;
32
+ steps: Step[];
33
+ };
34
+ type ClientPresence = {
35
+ type: 'presence';
36
+ name?: string;
37
+ color?: string;
38
+ sel?: WireSel | null;
39
+ };
40
+ type ClientPing = {
41
+ type: 'ping';
42
+ };
43
+ type ClientMsg = ClientJoin | ClientOp | ClientPresence | ClientPing;
44
+ type ServerWelcome = {
45
+ type: 'welcome';
46
+ siteId: number;
47
+ version: number;
48
+ doc: ElementNode;
49
+ peers: PeerInfo[];
50
+ };
51
+ type ServerOp = {
52
+ type: 'op';
53
+ version: number;
54
+ siteId: number;
55
+ clientSeq?: number;
56
+ steps: Step[];
57
+ };
58
+ type ServerPresence = {
59
+ type: 'presence';
60
+ siteId: number;
61
+ name?: string;
62
+ color?: string;
63
+ sel?: WireSel | null;
64
+ };
65
+ type ServerPeerJoin = {
66
+ type: 'peer-join';
67
+ siteId: number;
68
+ name?: string;
69
+ color?: string;
70
+ };
71
+ type ServerPeerLeave = {
72
+ type: 'peer-leave';
73
+ siteId: number;
74
+ };
75
+ type ServerResync = {
76
+ type: 'resync';
77
+ version: number;
78
+ doc: ElementNode;
79
+ };
80
+ type ServerError = {
81
+ type: 'error';
82
+ message: string;
83
+ };
84
+ type ServerPong = {
85
+ type: 'pong';
86
+ };
87
+ type ServerMsg = ServerWelcome | ServerOp | ServerPresence | ServerPeerJoin | ServerPeerLeave | ServerResync | ServerError | ServerPong;
88
+
89
+ type CollabConfig = {
90
+ /** ws(s)://host 或 http(s)://host(自动改 scheme) */
91
+ url: string;
92
+ room: string;
93
+ name?: string;
94
+ color?: string;
95
+ /** 空房初始化文档;默认由 Editor 传入当前 doc */
96
+ seed?: ElementNode;
97
+ };
98
+ type CollabHandlers = {
99
+ /** 权威快照(welcome / resync) */
100
+ onDoc: (doc: ElementNode, version: number) => void;
101
+ /** 已变换的远端 steps,应 applyRemote */
102
+ onRemote: (steps: Step[]) => void;
103
+ /** 进房成功(分配 siteId,可画本人头像) */
104
+ onWelcome?: (info: {
105
+ siteId: number;
106
+ version: number;
107
+ name?: string;
108
+ color?: string;
109
+ }) => void;
110
+ onPeers?: (peers: PeerInfo[]) => void;
111
+ onStatus?: (s: 'connecting' | 'open' | 'closed') => void;
112
+ onError?: (message: string) => void;
113
+ };
114
+ /**
115
+ * 协作会话:WS + pending OT。
116
+ * Editor 调 push(localSteps);远端经 onRemote / onDoc。
117
+ */
118
+ declare class CollabClient {
119
+ private cfg;
120
+ private handlers;
121
+ private ws;
122
+ private closed;
123
+ private retry;
124
+ private reconnectTimer;
125
+ siteId: number;
126
+ version: number;
127
+ private clientSeq;
128
+ private pending;
129
+ private peers;
130
+ private joined;
131
+ constructor(cfg: CollabConfig, handlers: CollabHandlers);
132
+ get peersList(): PeerInfo[];
133
+ private connect;
134
+ private scheduleReconnect;
135
+ private send;
136
+ private onServer;
137
+ /** 本地已 apply 的 steps 推上服务器 */
138
+ push(steps: Step[]): void;
139
+ presence(sel: WireSel | null): void;
140
+ close(): void;
141
+ }
142
+ declare function connectCollab(cfg: CollabConfig, handlers: CollabHandlers): CollabClient;
143
+
144
+ export { type ClientJoin as C, type PeerInfo as P, type ServerMsg as S, type WireSel as W, type ClientMsg as a, type ClientOp as b, CollabClient as c, type CollabConfig as d, type CollabHandlers as e, type ServerOp as f, type ServerWelcome as g, connectCollab as h };
@@ -0,0 +1,25 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkALZ3A5CScjs = require('../chunk-ALZ3A5CS.cjs');
8
+
9
+
10
+
11
+
12
+
13
+ var _chunkJS527FDVcjs = require('../chunk-JS527FDV.cjs');
14
+ require('../chunk-GQ2HHRGI.cjs');
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ exports.COLLAB_COLORS = _chunkALZ3A5CScjs.COLLAB_COLORS; exports.CollabClient = _chunkALZ3A5CScjs.CollabClient; exports.collabColor = _chunkALZ3A5CScjs.collabColor; exports.collabInitial = _chunkALZ3A5CScjs.collabInitial; exports.connectCollab = _chunkALZ3A5CScjs.connectCollab; exports.rebaseBatchOver = _chunkJS527FDVcjs.rebaseBatchOver; exports.rebaseOne = _chunkJS527FDVcjs.rebaseOne; exports.rebaseStepsThrough = _chunkJS527FDVcjs.rebaseStepsThrough; exports.transformRemoteAgainstPending = _chunkJS527FDVcjs.transformRemoteAgainstPending;
@@ -0,0 +1,11 @@
1
+ export { C as ClientJoin, a as ClientMsg, b as ClientOp, c as CollabClient, d as CollabConfig, e as CollabHandlers, P as PeerInfo, S as ServerMsg, f as ServerOp, g as ServerWelcome, W as WireSel, h as connectCollab } from '../client-ZRZj2nkq.cjs';
2
+ export { r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending } from '../rebase-batch-bYnBJpRO.cjs';
3
+ import '../step-BrvHIK7O.cjs';
4
+
5
+ /** 协作用户色板(飞书/Notion 式高饱和,互不撞) */
6
+ declare const COLLAB_COLORS: readonly ["#3370ff", "#f54a45", "#ff8800", "#00b578", "#7b61ff", "#e13edb", "#14c0ff", "#8f959e", "#d83931", "#2ea121"];
7
+ declare function collabColor(siteId: number, explicit?: string): string;
8
+ /** 头像一字:优先首字/首字母 */
9
+ declare function collabInitial(name?: string, siteId?: number): string;
10
+
11
+ export { COLLAB_COLORS, collabColor, collabInitial };
@@ -0,0 +1,11 @@
1
+ export { C as ClientJoin, a as ClientMsg, b as ClientOp, c as CollabClient, d as CollabConfig, e as CollabHandlers, P as PeerInfo, S as ServerMsg, f as ServerOp, g as ServerWelcome, W as WireSel, h as connectCollab } from '../client-6KiH4kGK.js';
2
+ export { r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending } from '../rebase-batch-8rL_aXEE.js';
3
+ import '../step-BrvHIK7O.js';
4
+
5
+ /** 协作用户色板(飞书/Notion 式高饱和,互不撞) */
6
+ declare const COLLAB_COLORS: readonly ["#3370ff", "#f54a45", "#ff8800", "#00b578", "#7b61ff", "#e13edb", "#14c0ff", "#8f959e", "#d83931", "#2ea121"];
7
+ declare function collabColor(siteId: number, explicit?: string): string;
8
+ /** 头像一字:优先首字/首字母 */
9
+ declare function collabInitial(name?: string, siteId?: number): string;
10
+
11
+ export { COLLAB_COLORS, collabColor, collabInitial };
@@ -0,0 +1,25 @@
1
+ import {
2
+ COLLAB_COLORS,
3
+ CollabClient,
4
+ collabColor,
5
+ collabInitial,
6
+ connectCollab
7
+ } from "../chunk-4JSJAHTB.js";
8
+ import {
9
+ rebaseBatchOver,
10
+ rebaseOne,
11
+ rebaseStepsThrough,
12
+ transformRemoteAgainstPending
13
+ } from "../chunk-RLTHVQNQ.js";
14
+ import "../chunk-LA5SBCGQ.js";
15
+ export {
16
+ COLLAB_COLORS,
17
+ CollabClient,
18
+ collabColor,
19
+ collabInitial,
20
+ connectCollab,
21
+ rebaseBatchOver,
22
+ rebaseOne,
23
+ rebaseStepsThrough,
24
+ transformRemoteAgainstPending
25
+ };
@@ -0,0 +1,43 @@
1
+ import { E as ElementNode, S as Step } from './step-BrvHIK7O.cjs';
2
+
3
+ interface Commit {
4
+ steps: Step[];
5
+ inverse: Step[];
6
+ }
7
+ interface History {
8
+ doc: ElementNode;
9
+ past: Commit[];
10
+ future: Commit[];
11
+ validate?: (doc: ElementNode) => string | null;
12
+ }
13
+ declare function init(doc: ElementNode, validate?: (doc: ElementNode) => string | null): History;
14
+ declare function commit(h: History, steps: Step[]): History;
15
+ declare function amend(h: History, more: Step[]): History;
16
+ declare function undo(h: History): History;
17
+ declare function redo(h: History): History;
18
+
19
+ interface CommentAuthor {
20
+ id: string;
21
+ name: string;
22
+ avatar?: string;
23
+ }
24
+ interface CommentMessage {
25
+ id: string;
26
+ author: CommentAuthor;
27
+ body: string;
28
+ createdAt: number;
29
+ }
30
+ interface CommentThread {
31
+ id: string;
32
+ resolved: boolean;
33
+ quote?: string;
34
+ messages: CommentMessage[];
35
+ }
36
+ interface CommentRenderState {
37
+ resolved: Set<string>;
38
+ activeId: string | null;
39
+ }
40
+ declare function commentIdsInDoc(doc: ElementNode): Set<string>;
41
+ declare function stripCommentMarks(doc: ElementNode, id: string): Step[];
42
+
43
+ export { type CommentAuthor as C, type History as H, type CommentMessage as a, type CommentRenderState as b, type CommentThread as c, type Commit as d, amend as e, commentIdsInDoc as f, commit as g, init as i, redo as r, stripCommentMarks as s, undo as u };
@@ -0,0 +1,43 @@
1
+ import { E as ElementNode, S as Step } from './step-BrvHIK7O.js';
2
+
3
+ interface Commit {
4
+ steps: Step[];
5
+ inverse: Step[];
6
+ }
7
+ interface History {
8
+ doc: ElementNode;
9
+ past: Commit[];
10
+ future: Commit[];
11
+ validate?: (doc: ElementNode) => string | null;
12
+ }
13
+ declare function init(doc: ElementNode, validate?: (doc: ElementNode) => string | null): History;
14
+ declare function commit(h: History, steps: Step[]): History;
15
+ declare function amend(h: History, more: Step[]): History;
16
+ declare function undo(h: History): History;
17
+ declare function redo(h: History): History;
18
+
19
+ interface CommentAuthor {
20
+ id: string;
21
+ name: string;
22
+ avatar?: string;
23
+ }
24
+ interface CommentMessage {
25
+ id: string;
26
+ author: CommentAuthor;
27
+ body: string;
28
+ createdAt: number;
29
+ }
30
+ interface CommentThread {
31
+ id: string;
32
+ resolved: boolean;
33
+ quote?: string;
34
+ messages: CommentMessage[];
35
+ }
36
+ interface CommentRenderState {
37
+ resolved: Set<string>;
38
+ activeId: string | null;
39
+ }
40
+ declare function commentIdsInDoc(doc: ElementNode): Set<string>;
41
+ declare function stripCommentMarks(doc: ElementNode, id: string): Step[];
42
+
43
+ export { type CommentAuthor as C, type History as H, type CommentMessage as a, type CommentRenderState as b, type CommentThread as c, type Commit as d, amend as e, commentIdsInDoc as f, commit as g, init as i, redo as r, stripCommentMarks as s, undo as u };
@@ -1,6 +1,8 @@
1
- import { E as ElementNode, S as Step, g as Selection, M as Mark, P as Path, N as Node, H as History, d as CommentThread, C as CommentAuthor } from './comments-USjT1wYN.js';
1
+ import { E as ElementNode, S as Step, c as Selection, M as Mark, P as Path, N as Node } from './step-BrvHIK7O.js';
2
2
  import * as preact from 'preact';
3
3
  import { ComponentChild } from 'preact';
4
+ import { H as History, c as CommentThread, C as CommentAuthor } from './comments-PhnR7Gkn.js';
5
+ import { d as CollabConfig, c as CollabClient } from './client-6KiH4kGK.js';
4
6
 
5
7
  interface MentionCandidate {
6
8
  id: string;
@@ -336,6 +338,11 @@ interface EditorOptions {
336
338
  * 应用只配 provider / endpoint。
337
339
  */
338
340
  ai?: boolean | AiConfig;
341
+ /**
342
+ * 实时协作(中心化 OT + WebSocket)。传 { url, room } 即连 Cloudflare worker 房间。
343
+ * 本地 dispatch 自动上行;远端 applyRemote。见 collab.md。
344
+ */
345
+ collab?: CollabConfig;
339
346
  }
340
347
  declare class Editor {
341
348
  root: HTMLElement;
@@ -354,10 +361,16 @@ declare class Editor {
354
361
  private decorations;
355
362
  /** AI 一等公民(opts.ai):斜杠 / 格式栏 / 卡片全内置 */
356
363
  private aiCtl;
364
+ /** 协作会话;applyingRemote 期间本地 steps 不上行 */
365
+ private collabCtl;
366
+ private collabUi;
367
+ private applyingRemote;
357
368
  constructor(root: HTMLElement, doc: ElementNode, opts?: EditorOptions);
358
369
  destroy(): void;
359
370
  /** AI 控制器(opts.ai 启用时);应用工具栏可 ed.ai?.openAtFocus / stop */
360
371
  get ai(): MarkloomAi | null;
372
+ /** 协作客户端(opts.collab 启用时) */
373
+ get collab(): CollabClient | null;
361
374
  openAi(mode: 'continue' | 'rewrite'): void;
362
375
  stopAi(): void;
363
376
  get doc(): ElementNode;
@@ -371,6 +384,10 @@ declare class Editor {
371
384
  private syncPlaceholder;
372
385
  dispatch(steps: Step[], selectionAfter?: Selection): void;
373
386
  dispatchStream(steps: Step[], selectionAfter?: Selection): void;
387
+ /** 远端协作 op:写入 model 但不上行 */
388
+ applyRemote(steps: Step[], selectionAfter?: Selection): void;
389
+ /** 权威快照替换(welcome/resync);清空本地 undo 栈 */
390
+ replaceDoc(doc: ElementNode): void;
374
391
  /** 回退一笔 history(AI 事务 discard = undo 整笔) */
375
392
  undo(): boolean;
376
393
  redo(): boolean;
@@ -387,6 +404,8 @@ declare class Editor {
387
404
  /** caret 是否在 type=ai 块内;是则返该块,否则 null */
388
405
  private aiBlockAt;
389
406
  private aiBlockGuard;
407
+ /** 壳已不在的 aiDraft 顶层块 → 剥事务标记,恢复可编辑 */
408
+ private promoteOrphanAiDrafts;
390
409
  private codeEdge;
391
410
  private codeBlockGuard;
392
411
  private atomControls;
@@ -490,8 +509,13 @@ declare class MarkloomAi {
490
509
  * 走 amend,与 begin/stream 同一笔 undo。
491
510
  */
492
511
  accept(blockId: string): void;
493
- /** 整笔撤回事务(= undo) */
512
+ /** 整笔撤回事务(= undo);务必不留 aiDraft 孤儿段 */
494
513
  discard(blockId: string): void;
514
+ /**
515
+ * 清掉 aiFrom=blockId 的顶层 draft;shell=true 时把 ai 壳也换成空段。
516
+ * discard / 异常恢复共用。
517
+ */
518
+ private purgeDrafts;
495
519
  act(blockId: string, action: string): void;
496
520
  private rollback;
497
521
  private findAi;
@@ -1,6 +1,8 @@
1
- import { E as ElementNode, S as Step, g as Selection, M as Mark, P as Path, N as Node, H as History, d as CommentThread, C as CommentAuthor } from './comments-USjT1wYN.cjs';
1
+ import { E as ElementNode, S as Step, c as Selection, M as Mark, P as Path, N as Node } from './step-BrvHIK7O.cjs';
2
2
  import * as preact from 'preact';
3
3
  import { ComponentChild } from 'preact';
4
+ import { H as History, c as CommentThread, C as CommentAuthor } from './comments-DlExS6f-.cjs';
5
+ import { d as CollabConfig, c as CollabClient } from './client-ZRZj2nkq.cjs';
4
6
 
5
7
  interface MentionCandidate {
6
8
  id: string;
@@ -336,6 +338,11 @@ interface EditorOptions {
336
338
  * 应用只配 provider / endpoint。
337
339
  */
338
340
  ai?: boolean | AiConfig;
341
+ /**
342
+ * 实时协作(中心化 OT + WebSocket)。传 { url, room } 即连 Cloudflare worker 房间。
343
+ * 本地 dispatch 自动上行;远端 applyRemote。见 collab.md。
344
+ */
345
+ collab?: CollabConfig;
339
346
  }
340
347
  declare class Editor {
341
348
  root: HTMLElement;
@@ -354,10 +361,16 @@ declare class Editor {
354
361
  private decorations;
355
362
  /** AI 一等公民(opts.ai):斜杠 / 格式栏 / 卡片全内置 */
356
363
  private aiCtl;
364
+ /** 协作会话;applyingRemote 期间本地 steps 不上行 */
365
+ private collabCtl;
366
+ private collabUi;
367
+ private applyingRemote;
357
368
  constructor(root: HTMLElement, doc: ElementNode, opts?: EditorOptions);
358
369
  destroy(): void;
359
370
  /** AI 控制器(opts.ai 启用时);应用工具栏可 ed.ai?.openAtFocus / stop */
360
371
  get ai(): MarkloomAi | null;
372
+ /** 协作客户端(opts.collab 启用时) */
373
+ get collab(): CollabClient | null;
361
374
  openAi(mode: 'continue' | 'rewrite'): void;
362
375
  stopAi(): void;
363
376
  get doc(): ElementNode;
@@ -371,6 +384,10 @@ declare class Editor {
371
384
  private syncPlaceholder;
372
385
  dispatch(steps: Step[], selectionAfter?: Selection): void;
373
386
  dispatchStream(steps: Step[], selectionAfter?: Selection): void;
387
+ /** 远端协作 op:写入 model 但不上行 */
388
+ applyRemote(steps: Step[], selectionAfter?: Selection): void;
389
+ /** 权威快照替换(welcome/resync);清空本地 undo 栈 */
390
+ replaceDoc(doc: ElementNode): void;
374
391
  /** 回退一笔 history(AI 事务 discard = undo 整笔) */
375
392
  undo(): boolean;
376
393
  redo(): boolean;
@@ -387,6 +404,8 @@ declare class Editor {
387
404
  /** caret 是否在 type=ai 块内;是则返该块,否则 null */
388
405
  private aiBlockAt;
389
406
  private aiBlockGuard;
407
+ /** 壳已不在的 aiDraft 顶层块 → 剥事务标记,恢复可编辑 */
408
+ private promoteOrphanAiDrafts;
390
409
  private codeEdge;
391
410
  private codeBlockGuard;
392
411
  private atomControls;
@@ -490,8 +509,13 @@ declare class MarkloomAi {
490
509
  * 走 amend,与 begin/stream 同一笔 undo。
491
510
  */
492
511
  accept(blockId: string): void;
493
- /** 整笔撤回事务(= undo) */
512
+ /** 整笔撤回事务(= undo);务必不留 aiDraft 孤儿段 */
494
513
  discard(blockId: string): void;
514
+ /**
515
+ * 清掉 aiFrom=blockId 的顶层 draft;shell=true 时把 ai 壳也换成空段。
516
+ * discard / 异常恢复共用。
517
+ */
518
+ private purgeDrafts;
495
519
  act(blockId: string, action: string): void;
496
520
  private rollback;
497
521
  private findAi;