@agent-native/toolkit 0.4.10 → 0.5.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.
Files changed (143) hide show
  1. package/README.md +17 -6
  2. package/dist/collab-ui/agent-identity.d.ts +9 -0
  3. package/dist/collab-ui/agent-identity.d.ts.map +1 -0
  4. package/dist/collab-ui/agent-identity.js +9 -0
  5. package/dist/collab-ui/agent-identity.js.map +1 -0
  6. package/dist/collab-ui/index.d.ts +2 -0
  7. package/dist/collab-ui/index.d.ts.map +1 -1
  8. package/dist/collab-ui/index.js +2 -0
  9. package/dist/collab-ui/index.js.map +1 -1
  10. package/dist/collab-ui/lead-client.d.ts +3 -0
  11. package/dist/collab-ui/lead-client.d.ts.map +1 -0
  12. package/dist/collab-ui/lead-client.js +29 -0
  13. package/dist/collab-ui/lead-client.js.map +1 -0
  14. package/dist/context-ui/ContextMeter.d.ts +10 -0
  15. package/dist/context-ui/ContextMeter.d.ts.map +1 -0
  16. package/dist/context-ui/ContextMeter.js +20 -0
  17. package/dist/context-ui/ContextMeter.js.map +1 -0
  18. package/dist/context-ui/ContextSegmentRow.d.ts +14 -0
  19. package/dist/context-ui/ContextSegmentRow.d.ts.map +1 -0
  20. package/dist/context-ui/ContextSegmentRow.js +25 -0
  21. package/dist/context-ui/ContextSegmentRow.js.map +1 -0
  22. package/dist/context-ui/ContextTreemap.d.ts +7 -0
  23. package/dist/context-ui/ContextTreemap.d.ts.map +1 -0
  24. package/dist/context-ui/ContextTreemap.js +55 -0
  25. package/dist/context-ui/ContextTreemap.js.map +1 -0
  26. package/dist/context-ui/ContextXRayPanel.d.ts +13 -0
  27. package/dist/context-ui/ContextXRayPanel.d.ts.map +1 -0
  28. package/dist/context-ui/ContextXRayPanel.js +120 -0
  29. package/dist/context-ui/ContextXRayPanel.js.map +1 -0
  30. package/dist/context-ui/format.d.ts +6 -0
  31. package/dist/context-ui/format.d.ts.map +1 -0
  32. package/dist/context-ui/format.js +58 -0
  33. package/dist/context-ui/format.js.map +1 -0
  34. package/dist/context-ui/index.d.ts +7 -0
  35. package/dist/context-ui/index.d.ts.map +1 -0
  36. package/dist/context-ui/index.js +6 -0
  37. package/dist/context-ui/index.js.map +1 -0
  38. package/dist/context-ui/types.d.ts +39 -0
  39. package/dist/context-ui/types.d.ts.map +1 -0
  40. package/dist/context-ui/types.js +2 -0
  41. package/dist/context-ui/types.js.map +1 -0
  42. package/dist/design-tweaks/index.d.ts +2 -0
  43. package/dist/design-tweaks/index.d.ts.map +1 -0
  44. package/dist/design-tweaks/index.js +2 -0
  45. package/dist/design-tweaks/index.js.map +1 -0
  46. package/dist/design-tweaks/visual-style-controls.d.ts +90 -0
  47. package/dist/design-tweaks/visual-style-controls.d.ts.map +1 -0
  48. package/dist/design-tweaks/visual-style-controls.js +499 -0
  49. package/dist/design-tweaks/visual-style-controls.js.map +1 -0
  50. package/dist/editor/BubbleToolbar.d.ts +37 -0
  51. package/dist/editor/BubbleToolbar.d.ts.map +1 -0
  52. package/dist/editor/BubbleToolbar.js +171 -0
  53. package/dist/editor/BubbleToolbar.js.map +1 -0
  54. package/dist/editor/CodeBlockNode.d.ts +49 -0
  55. package/dist/editor/CodeBlockNode.d.ts.map +1 -0
  56. package/dist/editor/CodeBlockNode.js +127 -0
  57. package/dist/editor/CodeBlockNode.js.map +1 -0
  58. package/dist/editor/DragHandle.d.ts +97 -0
  59. package/dist/editor/DragHandle.d.ts.map +1 -0
  60. package/dist/editor/DragHandle.js +1066 -0
  61. package/dist/editor/DragHandle.js.map +1 -0
  62. package/dist/editor/DragHandle.spec.d.ts +2 -0
  63. package/dist/editor/DragHandle.spec.d.ts.map +1 -0
  64. package/dist/editor/DragHandle.spec.js +407 -0
  65. package/dist/editor/DragHandle.spec.js.map +1 -0
  66. package/dist/editor/ImageExtension.d.ts +63 -0
  67. package/dist/editor/ImageExtension.d.ts.map +1 -0
  68. package/dist/editor/ImageExtension.js +243 -0
  69. package/dist/editor/ImageExtension.js.map +1 -0
  70. package/dist/editor/ImageExtension.roundtrip.spec.d.ts +2 -0
  71. package/dist/editor/ImageExtension.roundtrip.spec.d.ts.map +1 -0
  72. package/dist/editor/ImageExtension.roundtrip.spec.js +103 -0
  73. package/dist/editor/ImageExtension.roundtrip.spec.js.map +1 -0
  74. package/dist/editor/RichMarkdownEditor.collab.spec.d.ts +2 -0
  75. package/dist/editor/RichMarkdownEditor.collab.spec.d.ts.map +1 -0
  76. package/dist/editor/RichMarkdownEditor.collab.spec.js +65 -0
  77. package/dist/editor/RichMarkdownEditor.collab.spec.js.map +1 -0
  78. package/dist/editor/RichMarkdownEditor.d.ts +52 -0
  79. package/dist/editor/RichMarkdownEditor.d.ts.map +1 -0
  80. package/dist/editor/RichMarkdownEditor.js +38 -0
  81. package/dist/editor/RichMarkdownEditor.js.map +1 -0
  82. package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts +2 -0
  83. package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts.map +1 -0
  84. package/dist/editor/RichMarkdownEditor.roundtrip.spec.js +186 -0
  85. package/dist/editor/RichMarkdownEditor.roundtrip.spec.js.map +1 -0
  86. package/dist/editor/RunId.d.ts +28 -0
  87. package/dist/editor/RunId.d.ts.map +1 -0
  88. package/dist/editor/RunId.js +60 -0
  89. package/dist/editor/RunId.js.map +1 -0
  90. package/dist/editor/SharedRichEditor.d.ts +110 -0
  91. package/dist/editor/SharedRichEditor.d.ts.map +1 -0
  92. package/dist/editor/SharedRichEditor.js +144 -0
  93. package/dist/editor/SharedRichEditor.js.map +1 -0
  94. package/dist/editor/SlashCommandMenu.d.ts +41 -0
  95. package/dist/editor/SlashCommandMenu.d.ts.map +1 -0
  96. package/dist/editor/SlashCommandMenu.js +221 -0
  97. package/dist/editor/SlashCommandMenu.js.map +1 -0
  98. package/dist/editor/disableHistory.spec.d.ts +2 -0
  99. package/dist/editor/disableHistory.spec.d.ts.map +1 -0
  100. package/dist/editor/disableHistory.spec.js +73 -0
  101. package/dist/editor/disableHistory.spec.js.map +1 -0
  102. package/dist/editor/extensions.d.ts +178 -0
  103. package/dist/editor/extensions.d.ts.map +1 -0
  104. package/dist/editor/extensions.js +224 -0
  105. package/dist/editor/extensions.js.map +1 -0
  106. package/dist/editor/gfmDoc.d.ts +24 -0
  107. package/dist/editor/gfmDoc.d.ts.map +1 -0
  108. package/dist/editor/gfmDoc.js +83 -0
  109. package/dist/editor/gfmDoc.js.map +1 -0
  110. package/dist/editor/gfmDoc.spec.d.ts +2 -0
  111. package/dist/editor/gfmDoc.spec.d.ts.map +1 -0
  112. package/dist/editor/gfmDoc.spec.js +194 -0
  113. package/dist/editor/gfmDoc.spec.js.map +1 -0
  114. package/dist/editor/index.d.ts +13 -0
  115. package/dist/editor/index.d.ts.map +1 -0
  116. package/dist/editor/index.js +13 -0
  117. package/dist/editor/index.js.map +1 -0
  118. package/dist/editor/structuralReorderUndo.spec.d.ts +2 -0
  119. package/dist/editor/structuralReorderUndo.spec.d.ts.map +1 -0
  120. package/dist/editor/structuralReorderUndo.spec.js +120 -0
  121. package/dist/editor/structuralReorderUndo.spec.js.map +1 -0
  122. package/dist/editor/surgical-apply.d.ts +66 -0
  123. package/dist/editor/surgical-apply.d.ts.map +1 -0
  124. package/dist/editor/surgical-apply.js +147 -0
  125. package/dist/editor/surgical-apply.js.map +1 -0
  126. package/dist/editor/surgical-apply.spec.d.ts +2 -0
  127. package/dist/editor/surgical-apply.spec.d.ts.map +1 -0
  128. package/dist/editor/surgical-apply.spec.js +257 -0
  129. package/dist/editor/surgical-apply.spec.js.map +1 -0
  130. package/dist/editor/useCollabReconcile.concurrent.spec.d.ts +2 -0
  131. package/dist/editor/useCollabReconcile.concurrent.spec.d.ts.map +1 -0
  132. package/dist/editor/useCollabReconcile.concurrent.spec.js +329 -0
  133. package/dist/editor/useCollabReconcile.concurrent.spec.js.map +1 -0
  134. package/dist/editor/useCollabReconcile.d.ts +110 -0
  135. package/dist/editor/useCollabReconcile.d.ts.map +1 -0
  136. package/dist/editor/useCollabReconcile.idempotent.spec.d.ts +2 -0
  137. package/dist/editor/useCollabReconcile.idempotent.spec.d.ts.map +1 -0
  138. package/dist/editor/useCollabReconcile.idempotent.spec.js +248 -0
  139. package/dist/editor/useCollabReconcile.idempotent.spec.js.map +1 -0
  140. package/dist/editor/useCollabReconcile.js +440 -0
  141. package/dist/editor/useCollabReconcile.js.map +1 -0
  142. package/dist/editor.css +510 -0
  143. package/package.json +63 -9
@@ -0,0 +1,248 @@
1
+ // @vitest-environment happy-dom
2
+ import { useEditor } from "@tiptap/react";
3
+ import React, { act } from "react";
4
+ import { createRoot } from "react-dom/client";
5
+ import { afterEach, beforeEach, describe, expect, it } from "vitest";
6
+ import { createRichMarkdownExtensions } from "./RichMarkdownEditor.js";
7
+ import { useCollabReconcile, getEditorMarkdown } from "./useCollabReconcile.js";
8
+ /**
9
+ * Regression for the collab-reconcile escalation loop.
10
+ *
11
+ * When a block's stored markdown is NOT idempotent through the editor's
12
+ * parse/serialize (e.g. raw HTML in a GFM block: `<h1>...</h1>` serializes to
13
+ * the escaped `&lt;h1&gt;...`), the reconcile used to re-`setContent` the value
14
+ * every poll because the raw `value` never equalled the editor's serialized
15
+ * output. Each re-apply re-parsed already-applied content, the autosave echo
16
+ * came back as a "new" value, and the doc kept mutating (`<p>` → `&lt;p&gt;` →
17
+ * `&amp;lt;p&amp;gt;` …) while also fighting active typing.
18
+ *
19
+ * The fix makes the reconcile compare by DOC EQUIVALENCE: it tracks the raw
20
+ * value it last applied AND the editor's serialized output after that apply, so
21
+ * a re-supplied raw value or its own serialized echo is recognized and skipped.
22
+ * These tests drive the REAL hook + a REAL editor across simulated polls and
23
+ * assert the reconcile applies a non-idempotent value AT MOST ONCE and the
24
+ * editor stabilizes (no repeated emit / mutation).
25
+ */
26
+ let container;
27
+ let root;
28
+ beforeEach(() => {
29
+ globalThis.IS_REACT_ACT_ENVIRONMENT = true;
30
+ container = document.createElement("div");
31
+ document.body.appendChild(container);
32
+ root = createRoot(container);
33
+ });
34
+ afterEach(() => {
35
+ act(() => root.unmount());
36
+ container.remove();
37
+ });
38
+ /**
39
+ * Mirrors the real SharedRichEditor wiring: an `onUpdate` that defers to the
40
+ * hook's guards (so programmatic setContent is ignored and only genuine edits
41
+ * "autosave"), and a `setContent` override that counts applies. Non-collab path
42
+ * (no ydoc) — the escalation reproduces there and keeps the harness simple.
43
+ */
44
+ function makeHarness() {
45
+ const captured = {
46
+ editor: null,
47
+ emitted: [],
48
+ setContentCalls: 0,
49
+ };
50
+ function Harness({ value, contentUpdatedAt }) {
51
+ const guardsRef = React.useRef(null);
52
+ const editor = useEditor({
53
+ extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
54
+ content: value,
55
+ onUpdate: ({ editor, transaction }) => {
56
+ const guards = guardsRef.current;
57
+ if (!guards || guards.shouldIgnoreUpdate(transaction))
58
+ return;
59
+ const markdown = getEditorMarkdown(editor);
60
+ if (!guards.registerEmitted(markdown))
61
+ return;
62
+ captured.emitted.push(markdown);
63
+ },
64
+ });
65
+ captured.editor = editor;
66
+ const guards = useCollabReconcile({
67
+ editor,
68
+ value,
69
+ contentUpdatedAt,
70
+ editable: true,
71
+ getMarkdown: getEditorMarkdown,
72
+ // These specs pin the LEGACY whole-document setContent path (the
73
+ // fallback when no parsed doc is available); the surgical path has its
74
+ // own coverage in surgical-apply.spec.ts. Disable it so `setContent`
75
+ // remains the counted apply mechanism.
76
+ parseValue: false,
77
+ // Mirror the hook's (fixed) defaultSetContent: hand the markdown string to
78
+ // tiptap-markdown's setContent override WITHOUT
79
+ // `parseOptions.preserveWhitespace`, which would otherwise route through
80
+ // insertContentAt's double-parse and escape the markdown. Counts applies.
81
+ setContent: (ed, v, options) => {
82
+ captured.setContentCalls += 1;
83
+ if (options.addToHistory === false) {
84
+ ed.chain()
85
+ .command(({ tr }) => {
86
+ tr.setMeta("addToHistory", false);
87
+ return true;
88
+ })
89
+ .setContent(v, { emitUpdate: options.emitUpdate })
90
+ .run();
91
+ return;
92
+ }
93
+ ed.commands.setContent(v);
94
+ },
95
+ });
96
+ guardsRef.current = guards;
97
+ return React.createElement("div", null);
98
+ }
99
+ return { captured, Harness };
100
+ }
101
+ /** Flush the reconcile's timer task + any chained promises. */
102
+ async function flush() {
103
+ await act(async () => {
104
+ await Promise.resolve();
105
+ await new Promise((resolve) => setTimeout(resolve, 0));
106
+ await Promise.resolve();
107
+ });
108
+ }
109
+ const NON_IDEMPOTENT = '<h1>Title</h1><ul class="contains-task-list"><li>One</li></ul>';
110
+ describe("useCollabReconcile idempotent-safe reconcile", () => {
111
+ it("applies a NON-idempotent value at most once across many polls and stabilizes", async () => {
112
+ const { captured, Harness } = makeHarness();
113
+ // Initial mount: editor seeded empty, first poll delivers the raw HTML.
114
+ act(() => {
115
+ root.render(React.createElement(Harness, {
116
+ value: "",
117
+ contentUpdatedAt: "2024-01-01T00:00:00.000Z",
118
+ }));
119
+ });
120
+ await flush();
121
+ // First real value arrives.
122
+ act(() => {
123
+ root.render(React.createElement(Harness, {
124
+ value: NON_IDEMPOTENT,
125
+ contentUpdatedAt: "2024-01-01T00:00:01.000Z",
126
+ }));
127
+ });
128
+ await flush();
129
+ const serializedAfterApply = getEditorMarkdown(captured.editor);
130
+ // The non-idempotent value escapes on apply, so the serialized form differs
131
+ // from the raw input — that divergence is exactly what used to loop.
132
+ expect(serializedAfterApply).not.toBe(NON_IDEMPOTENT);
133
+ const applyCountAfterFirst = captured.setContentCalls;
134
+ expect(applyCountAfterFirst).toBeGreaterThanOrEqual(1);
135
+ // Simulate the poll loop RE-SUPPLYING the SAME raw value many times (a
136
+ // source-sync / lagging poll that keeps handing back the stored HTML).
137
+ for (let i = 0; i < 6; i++) {
138
+ act(() => {
139
+ root.render(React.createElement(Harness, {
140
+ value: NON_IDEMPOTENT,
141
+ contentUpdatedAt: "2024-01-01T00:00:01.000Z",
142
+ }));
143
+ });
144
+ await flush();
145
+ }
146
+ // It must NOT keep re-applying — the doc-equivalence guard recognizes the
147
+ // re-supplied raw value as already-applied.
148
+ expect(captured.setContentCalls).toBe(applyCountAfterFirst);
149
+ // And the editor's serialized output is stable (did not escalate).
150
+ expect(getEditorMarkdown(captured.editor)).toBe(serializedAfterApply);
151
+ });
152
+ it("recognizes its own serialized echo (bumped timestamp) and does not re-apply", async () => {
153
+ const { captured, Harness } = makeHarness();
154
+ act(() => {
155
+ root.render(React.createElement(Harness, {
156
+ value: "",
157
+ contentUpdatedAt: "2024-01-01T00:00:00.000Z",
158
+ }));
159
+ });
160
+ await flush();
161
+ act(() => {
162
+ root.render(React.createElement(Harness, {
163
+ value: NON_IDEMPOTENT,
164
+ contentUpdatedAt: "2024-01-01T00:00:01.000Z",
165
+ }));
166
+ });
167
+ await flush();
168
+ const serialized = getEditorMarkdown(captured.editor);
169
+ const applyCount = captured.setContentCalls;
170
+ // Autosave persists the editor's SERIALIZED output, bumping updatedAt; the
171
+ // next poll hands that serialized echo back as the new authoritative value.
172
+ for (let i = 0; i < 5; i++) {
173
+ act(() => {
174
+ root.render(React.createElement(Harness, {
175
+ value: serialized,
176
+ contentUpdatedAt: `2024-01-01T00:00:0${2 + i}.000Z`,
177
+ }));
178
+ });
179
+ await flush();
180
+ }
181
+ // The echo is doc-equivalent to what the editor already shows -> no re-apply
182
+ // and no escalation.
183
+ expect(captured.setContentCalls).toBe(applyCount);
184
+ expect(getEditorMarkdown(captured.editor)).toBe(serialized);
185
+ });
186
+ it("still applies a genuinely-new external edit after a non-idempotent apply", async () => {
187
+ const { captured, Harness } = makeHarness();
188
+ act(() => {
189
+ root.render(React.createElement(Harness, {
190
+ value: "",
191
+ contentUpdatedAt: "2024-01-01T00:00:00.000Z",
192
+ }));
193
+ });
194
+ await flush();
195
+ act(() => {
196
+ root.render(React.createElement(Harness, {
197
+ value: NON_IDEMPOTENT,
198
+ contentUpdatedAt: "2024-01-01T00:00:01.000Z",
199
+ }));
200
+ });
201
+ await flush();
202
+ const applyCount = captured.setContentCalls;
203
+ // A real, different agent edit (clean idempotent markdown) with a newer
204
+ // timestamp must still reconcile in.
205
+ act(() => {
206
+ root.render(React.createElement(Harness, {
207
+ value: "# Brand New Heading\n\nFresh body.",
208
+ contentUpdatedAt: "2024-01-01T00:00:05.000Z",
209
+ }));
210
+ });
211
+ await flush();
212
+ expect(captured.setContentCalls).toBeGreaterThan(applyCount);
213
+ expect(getEditorMarkdown(captured.editor)).toBe("# Brand New Heading\n\nFresh body.");
214
+ });
215
+ it("does not re-apply an idempotent value that is re-polled unchanged", async () => {
216
+ const { captured, Harness } = makeHarness();
217
+ const CLEAN = "# Heading\n\nA paragraph with **bold** text.";
218
+ act(() => {
219
+ root.render(React.createElement(Harness, {
220
+ value: "",
221
+ contentUpdatedAt: "2024-01-01T00:00:00.000Z",
222
+ }));
223
+ });
224
+ await flush();
225
+ act(() => {
226
+ root.render(React.createElement(Harness, {
227
+ value: CLEAN,
228
+ contentUpdatedAt: "2024-01-01T00:00:01.000Z",
229
+ }));
230
+ });
231
+ await flush();
232
+ const applyCount = captured.setContentCalls;
233
+ expect(getEditorMarkdown(captured.editor)).toBe(CLEAN);
234
+ for (let i = 0; i < 4; i++) {
235
+ act(() => {
236
+ root.render(React.createElement(Harness, {
237
+ value: CLEAN,
238
+ contentUpdatedAt: "2024-01-01T00:00:01.000Z",
239
+ }));
240
+ });
241
+ await flush();
242
+ }
243
+ // Idempotent + unchanged -> the existing equality guard already skips.
244
+ expect(captured.setContentCalls).toBe(applyCount);
245
+ expect(getEditorMarkdown(captured.editor)).toBe(CLEAN);
246
+ });
247
+ });
248
+ //# sourceMappingURL=useCollabReconcile.idempotent.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCollabReconcile.idempotent.spec.js","sourceRoot":"","sources":["../../src/editor/useCollabReconcile.idempotent.spec.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,SAAS,EAAe,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACnC,O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