@pixerate/editor 0.139.1 → 0.140.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 (152) hide show
  1. package/README.md +25 -4
  2. package/dist/agent/formatTools.d.cts +15 -0
  3. package/dist/agent/formatTools.d.ts +15 -0
  4. package/dist/agent/index.cjs +408 -49
  5. package/dist/agent/index.js +375 -16
  6. package/dist/agent/providers.d.cts +5 -3
  7. package/dist/agent/providers.d.ts +5 -3
  8. package/dist/animation-editor/effect-tools.d.cts +1 -1
  9. package/dist/animation-editor/effect-tools.d.ts +1 -1
  10. package/dist/animation-editor/index.cjs +250 -116
  11. package/dist/animation-editor/index.js +228 -94
  12. package/dist/animation-editor/instructions.d.cts +1 -1
  13. package/dist/animation-editor/instructions.d.ts +1 -1
  14. package/dist/animation-editor/parse.d.cts +3 -1
  15. package/dist/animation-editor/parse.d.ts +3 -1
  16. package/dist/animation-editor/tools.d.cts +8 -3
  17. package/dist/animation-editor/tools.d.ts +8 -3
  18. package/dist/bridge/cli.cjs +4 -3
  19. package/dist/bridge/cli.js +3 -2
  20. package/dist/bridge/index.cjs +8 -3
  21. package/dist/bridge/index.d.cts +7 -0
  22. package/dist/bridge/index.d.ts +7 -0
  23. package/dist/bridge/index.js +9 -4
  24. package/dist/bridge/skills.d.cts +9 -0
  25. package/dist/bridge/skills.d.ts +9 -0
  26. package/dist/canvas/effect-tools.d.cts +1 -1
  27. package/dist/canvas/effect-tools.d.ts +1 -1
  28. package/dist/canvas/index.cjs +22 -17
  29. package/dist/canvas/index.js +8 -3
  30. package/dist/chart/file-tools.d.cts +1 -1
  31. package/dist/chart/file-tools.d.ts +1 -1
  32. package/dist/chart/index.cjs +7 -1
  33. package/dist/chart/index.js +7 -1
  34. package/dist/chart/tools.d.cts +1 -1
  35. package/dist/chart/tools.d.ts +1 -1
  36. package/dist/chunk-2BSBFBOA.cjs +46 -0
  37. package/dist/{chunk-SWZTQWY7.js → chunk-2INPJDNY.js} +1 -1
  38. package/dist/{chunk-CCKP4XAN.cjs → chunk-34RQAGWI.cjs} +27 -7
  39. package/dist/{chunk-HXCBQ7A6.cjs → chunk-3AJMR7EG.cjs} +7 -4
  40. package/dist/{chunk-BKMU3V6K.js → chunk-5ED73EC6.js} +8 -1
  41. package/dist/{chunk-NKBUVQJW.cjs → chunk-5WOY52O6.cjs} +15 -15
  42. package/dist/{chunk-VRIR53SW.js → chunk-6GAYGQDC.js} +10 -8
  43. package/dist/{chunk-HZZXBTLB.js → chunk-6IN474P4.js} +25 -5
  44. package/dist/{chunk-KHMVB3SJ.js → chunk-7KWJEYIK.js} +4 -1
  45. package/dist/{chunk-R47NQICB.cjs → chunk-AGCD3EHB.cjs} +47 -10
  46. package/dist/{chunk-6I63VZ45.js → chunk-CXXKJBQZ.js} +5 -1
  47. package/dist/{chunk-6NXVDJDR.cjs → chunk-G43MNQ4C.cjs} +5 -5
  48. package/dist/chunk-HDK3T2QS.cjs +1159 -0
  49. package/dist/chunk-HF5QZS7Z.js +46 -0
  50. package/dist/{chunk-S7I3RI5Z.cjs → chunk-HMGWFXEC.cjs} +27 -24
  51. package/dist/{chunk-6NCBFBXA.js → chunk-IQ6KKXOU.js} +1 -1
  52. package/dist/{chunk-T6Y5FV7G.cjs → chunk-L434J57V.cjs} +10 -8
  53. package/dist/{chunk-UCRL6JEV.cjs → chunk-L5OWG2NA.cjs} +8 -3
  54. package/dist/{chunk-CZRWP6IW.cjs → chunk-N2FGYZ4Q.cjs} +8 -1
  55. package/dist/{chunk-GUPQ5BNA.cjs → chunk-PUR6BZFA.cjs} +112 -111
  56. package/dist/chunk-RB62U6MS.js +1159 -0
  57. package/dist/{chunk-3V746PF4.cjs → chunk-RUZQMYXH.cjs} +4 -1
  58. package/dist/{chunk-HGHXGCKG.cjs → chunk-SVFEVKLF.cjs} +1 -1
  59. package/dist/{chunk-PCNCT4ZY.js → chunk-UMS6YFA6.js} +40 -3
  60. package/dist/{chunk-4LGWAJDI.js → chunk-V5OOP74P.js} +5 -2
  61. package/dist/{chunk-BWT4IWLK.cjs → chunk-VKF3PWKR.cjs} +7 -7
  62. package/dist/{chunk-PQMADRCI.js → chunk-WBJ6BG4R.js} +23 -22
  63. package/dist/{chunk-WIYAOZZU.js → chunk-WHKNYFM2.js} +7 -2
  64. package/dist/{chunk-TBSPPVTT.js → chunk-XCK7QK5D.js} +1 -1
  65. package/dist/{chunk-F652BKMS.cjs → chunk-YN6JKAUE.cjs} +6 -2
  66. package/dist/{chunk-YTGF4TJR.js → chunk-ZLZKGHSZ.js} +5 -2
  67. package/dist/{chunk-USU2FL3N.js → chunk-ZNHB5RG6.js} +1 -1
  68. package/dist/commands/agentTools.d.cts +1 -1
  69. package/dist/commands/agentTools.d.ts +1 -1
  70. package/dist/commands/index.cjs +3 -0
  71. package/dist/commands/index.js +3 -0
  72. package/dist/compare/index.cjs +4 -3
  73. package/dist/compare/index.js +3 -2
  74. package/dist/diagram/index.cjs +3 -0
  75. package/dist/diagram/index.js +3 -0
  76. package/dist/diagram/tools.d.cts +1 -1
  77. package/dist/diagram/tools.d.ts +1 -1
  78. package/dist/effects/index.cjs +32 -32
  79. package/dist/effects/index.js +1 -1
  80. package/dist/effects/tools.d.cts +5 -1
  81. package/dist/effects/tools.d.ts +5 -1
  82. package/dist/export/index.cjs +4 -3
  83. package/dist/export/index.js +3 -2
  84. package/dist/extensions/index.cjs +11 -8
  85. package/dist/extensions/index.d.cts +1 -0
  86. package/dist/extensions/index.d.ts +1 -0
  87. package/dist/extensions/index.js +10 -7
  88. package/dist/extensions/safe-merge-attributes.d.cts +10 -0
  89. package/dist/extensions/safe-merge-attributes.d.ts +10 -0
  90. package/dist/generation/index.cjs +7 -1
  91. package/dist/generation/index.js +7 -1
  92. package/dist/image-editor/index.cjs +25 -18
  93. package/dist/image-editor/index.js +10 -3
  94. package/dist/image-editor/provider-effect-tools.d.cts +1 -1
  95. package/dist/image-editor/provider-effect-tools.d.ts +1 -1
  96. package/dist/image-editor/tools.d.cts +1 -1
  97. package/dist/image-editor/tools.d.ts +1 -1
  98. package/dist/index.cjs +42 -29
  99. package/dist/index.d.cts +1 -0
  100. package/dist/index.d.ts +1 -0
  101. package/dist/index.js +22 -9
  102. package/dist/paint-editor/effect-tools.d.cts +1 -1
  103. package/dist/paint-editor/effect-tools.d.ts +1 -1
  104. package/dist/paint-editor/index.cjs +18 -8
  105. package/dist/paint-editor/index.js +13 -3
  106. package/dist/paint-editor/tools.d.cts +1 -1
  107. package/dist/paint-editor/tools.d.ts +1 -1
  108. package/dist/persistence/index.cjs +3 -2
  109. package/dist/persistence/index.js +2 -1
  110. package/dist/serializers/index.cjs +5 -4
  111. package/dist/serializers/index.js +4 -3
  112. package/dist/tools/bridge-client.d.cts +3 -3
  113. package/dist/tools/bridge-client.d.ts +3 -3
  114. package/dist/tools/capture.d.cts +5 -1
  115. package/dist/tools/capture.d.ts +5 -1
  116. package/dist/tools/definitions.d.cts +2 -2
  117. package/dist/tools/definitions.d.ts +2 -2
  118. package/dist/tools/index.cjs +39 -5
  119. package/dist/tools/index.d.cts +4 -0
  120. package/dist/tools/index.d.ts +4 -0
  121. package/dist/tools/index.js +39 -5
  122. package/dist/tools/mcp-server.d.cts +24 -6
  123. package/dist/tools/mcp-server.d.ts +24 -6
  124. package/dist/tools/registry.d.cts +81 -6
  125. package/dist/tools/registry.d.ts +81 -6
  126. package/dist/tools/safe-json.d.cts +27 -0
  127. package/dist/tools/safe-json.d.ts +27 -0
  128. package/dist/tools/search.d.cts +30 -0
  129. package/dist/tools/search.d.ts +30 -0
  130. package/dist/tools/skills.d.cts +26 -0
  131. package/dist/tools/skills.d.ts +26 -0
  132. package/dist/tools/view.d.cts +95 -0
  133. package/dist/tools/view.d.ts +95 -0
  134. package/dist/vector/effect-tools.d.cts +1 -1
  135. package/dist/vector/effect-tools.d.ts +1 -1
  136. package/dist/vector/index.cjs +13 -7
  137. package/dist/vector/index.js +8 -2
  138. package/dist/video-editor/effect-tools.d.cts +1 -1
  139. package/dist/video-editor/effect-tools.d.ts +1 -1
  140. package/dist/video-editor/index.cjs +275 -269
  141. package/dist/video-editor/index.js +8 -2
  142. package/dist/video-editor/tools.d.cts +1 -1
  143. package/dist/video-editor/tools.d.ts +1 -1
  144. package/package.json +31 -29
  145. package/skills/README.md +8 -3
  146. package/skills/pixerate-agent-tools/SKILL.md +33 -7
  147. package/skills/pixerate-animation-editor/SKILL.md +7 -0
  148. package/skills/pixerate-rich-text/SKILL.md +18 -4
  149. package/dist/chunk-5RRYDFU2.js +0 -466
  150. package/dist/chunk-SPVIXXIB.cjs +0 -466
  151. /package/dist/{chunk-SMJK5HBJ.js → chunk-K73HMKQP.js} +0 -0
  152. /package/dist/{chunk-DDF6WQ62.cjs → chunk-LACYURUW.cjs} +0 -0
@@ -1,4 +1,23 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;// src/extensions/comment-store.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
2
+
3
+
4
+ var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
5
+
6
+ // src/extensions/safe-merge-attributes.ts
7
+ var _core = require('@tiptap/core');
8
+ function safeMergeAttributes(...objects) {
9
+ return _core.mergeAttributes.call(void 0,
10
+ ...objects.filter((item) => !!item).map((item) => {
11
+ const keys = Object.keys(item);
12
+ if (!keys.some(_chunk2BSBFBOAcjs.isUnsafeJsonKey)) return item;
13
+ const copy = {};
14
+ for (const key of keys) if (!_chunk2BSBFBOAcjs.isUnsafeJsonKey.call(void 0, key)) copy[key] = item[key];
15
+ return copy;
16
+ })
17
+ );
18
+ }
19
+
20
+ // src/extensions/comment-store.ts
2
21
  var idCounter = 0;
3
22
  function createReviewId(prefix = "c") {
4
23
  idCounter = (idCounter + 1) % 1e6;
@@ -44,7 +63,7 @@ var CommentStore = (_class = class _CommentStore {
44
63
  }
45
64
  /** Parses `toJSON()` output (or a plain thread array). */
46
65
  static parse(json) {
47
- const value = typeof json === "string" ? JSON.parse(json) : json;
66
+ const value = _chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, typeof json === "string" ? JSON.parse(json) : json);
48
67
  const list = Array.isArray(value) ? value : _optionalChain([value, 'optionalAccess', _ => _.threads]);
49
68
  if (!Array.isArray(list)) return [];
50
69
  return list.filter((t) => t && t.id != null).map(normalizeThread);
@@ -237,7 +256,7 @@ function formatReviewTime(timestamp, now = Date.now()) {
237
256
  }
238
257
 
239
258
  // src/extensions/track-changes.ts
240
- var _core = require('@tiptap/core');
259
+
241
260
 
242
261
 
243
262
 
@@ -369,7 +388,7 @@ var TrackedInsertion = _core.Mark.create({
369
388
  const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
370
389
  return [
371
390
  "ins",
372
- _core.mergeAttributes.call(void 0, base, HTMLAttributes, {
391
+ safeMergeAttributes(base, HTMLAttributes, {
373
392
  "data-change-type": "insertion"
374
393
  }),
375
394
  0
@@ -403,7 +422,7 @@ var TrackedDeletion = _core.Mark.create({
403
422
  const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
404
423
  return [
405
424
  "del",
406
- _core.mergeAttributes.call(void 0, base, HTMLAttributes, {
425
+ safeMergeAttributes(base, HTMLAttributes, {
407
426
  "data-change-type": "deletion"
408
427
  }),
409
428
  0
@@ -444,7 +463,7 @@ var TrackedFormatChange = _core.Mark.create({
444
463
  renderHTML({ HTMLAttributes }) {
445
464
  return [
446
465
  "span",
447
- _core.mergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
466
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
448
467
  "data-change-type": "format"
449
468
  }),
450
469
  0
@@ -1958,4 +1977,5 @@ var TrackChanges = _core.Extension.create({
1958
1977
 
1959
1978
 
1960
1979
 
1961
- exports.createReviewId = createReviewId; exports.CommentStore = CommentStore; exports.createCommentStore = createCommentStore; exports.formatReviewTime = formatReviewTime; exports.INSERTION_MARK_NAME = INSERTION_MARK_NAME; exports.DELETION_MARK_NAME = DELETION_MARK_NAME; exports.FORMAT_CHANGE_MARK_NAME = FORMAT_CHANGE_MARK_NAME; exports.BLOCK_CHANGE_ATTRIBUTE = BLOCK_CHANGE_ATTRIBUTE; exports.MOVE_ID_ATTRIBUTE = MOVE_ID_ATTRIBUTE; exports.TRACK_CHANGES_SKIP_META = TRACK_CHANGES_SKIP_META; exports.TrackChangesStore = TrackChangesStore; exports.trackChangesPluginKey = trackChangesPluginKey; exports.MOVE_TO_CLASS = MOVE_TO_CLASS; exports.MOVE_FROM_CLASS = MOVE_FROM_CLASS; exports.TrackedInsertion = TrackedInsertion; exports.TrackedDeletion = TrackedDeletion; exports.TrackedFormatChange = TrackedFormatChange; exports.describeFormatChange = describeFormatChange; exports.describeBlockChange = describeBlockChange; exports.trackedChangeLabel = trackedChangeLabel; exports.getTrackedChanges = getTrackedChanges; exports.getTrackedChangeAt = getTrackedChangeAt; exports.isTrackChangesEnabled = isTrackChangesEnabled; exports.getTrackChangesStore = getTrackChangesStore; exports.resolveTrackedChanges = resolveTrackedChanges; exports.isMoveSized = isMoveSized; exports.TrackChanges = TrackChanges;
1980
+
1981
+ exports.safeMergeAttributes = safeMergeAttributes; exports.createReviewId = createReviewId; exports.CommentStore = CommentStore; exports.createCommentStore = createCommentStore; exports.formatReviewTime = formatReviewTime; exports.INSERTION_MARK_NAME = INSERTION_MARK_NAME; exports.DELETION_MARK_NAME = DELETION_MARK_NAME; exports.FORMAT_CHANGE_MARK_NAME = FORMAT_CHANGE_MARK_NAME; exports.BLOCK_CHANGE_ATTRIBUTE = BLOCK_CHANGE_ATTRIBUTE; exports.MOVE_ID_ATTRIBUTE = MOVE_ID_ATTRIBUTE; exports.TRACK_CHANGES_SKIP_META = TRACK_CHANGES_SKIP_META; exports.TrackChangesStore = TrackChangesStore; exports.trackChangesPluginKey = trackChangesPluginKey; exports.MOVE_TO_CLASS = MOVE_TO_CLASS; exports.MOVE_FROM_CLASS = MOVE_FROM_CLASS; exports.TrackedInsertion = TrackedInsertion; exports.TrackedDeletion = TrackedDeletion; exports.TrackedFormatChange = TrackedFormatChange; exports.describeFormatChange = describeFormatChange; exports.describeBlockChange = describeBlockChange; exports.trackedChangeLabel = trackedChangeLabel; exports.getTrackedChanges = getTrackedChanges; exports.getTrackedChangeAt = getTrackedChangeAt; exports.isTrackChangesEnabled = isTrackChangesEnabled; exports.getTrackChangesStore = getTrackChangesStore; exports.resolveTrackedChanges = resolveTrackedChanges; exports.isMoveSized = isMoveSized; exports.TrackChanges = TrackChanges;
@@ -1,7 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunk6NXVDJDRcjs = require('./chunk-6NXVDJDR.cjs');
4
+ var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
5
+
6
+
7
+ var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
5
8
 
6
9
  // src/serializers/html.ts
7
10
  var DROP_WITH_CONTENT_REGEX = /<(script|style|template|noscript|iframe|object|embed|head|title|svg|math|textarea|select|button)\b[^>]*>[\s\S]*?<\/\1\s*>/gi;
@@ -15,12 +18,12 @@ function sanitizeImportedHtml(html) {
15
18
  const body = BODY_REGEX.exec(content);
16
19
  if (body) content = body[1];
17
20
  content = content.replace(DROP_WITH_CONTENT_REGEX, "").replace(UNCLOSED_RAW_TEXT_REGEX, "").replace(NAMESPACED_TAG_REGEX, "");
18
- const sanitized = _chunk6NXVDJDRcjs.sanitizeHtml.call(void 0, content, { disallowedTags: "strip" }).trim();
21
+ const sanitized = _chunkG43MNQ4Ccjs.sanitizeHtml.call(void 0, content, { disallowedTags: "strip" }).trim();
19
22
  return sanitized || "<p></p>";
20
23
  }
21
24
  function plainTextToParagraphHtml(text) {
22
25
  if (!text) return "<p></p>";
23
- return text.replace(/\r\n?/g, "\n").split("\n").map((line) => `<p>${_chunk6NXVDJDRcjs.escapeHtml.call(void 0, line)}</p>`).join("");
26
+ return text.replace(/\r\n?/g, "\n").split("\n").map((line) => `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, line)}</p>`).join("");
24
27
  }
25
28
 
26
29
  // src/serializers/rtf.ts
@@ -263,7 +266,7 @@ function parseRichClipboardPayload(data, schema) {
263
266
  if (!payload || payload.version !== 1) return null;
264
267
  if (payload.schema !== getSchemaSignature(schema)) return null;
265
268
  if (!payload.slice) return null;
266
- return _model.Slice.fromJSON(schema, payload.slice);
269
+ return _model.Slice.fromJSON(schema, _chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, payload.slice));
267
270
  } catch (e) {
268
271
  return null;
269
272
  }
@@ -186,7 +186,14 @@ function createCaptureTool(surface, options = {}) {
186
186
  };
187
187
  }
188
188
  function createCaptureToolProvider(surface, options = {}) {
189
- return { id: options.id ?? "capture", namespace: options.namespace, tools: [createCaptureTool(surface, options)] };
189
+ return {
190
+ id: options.id ?? "capture",
191
+ namespace: options.namespace,
192
+ title: options.title ?? "Screen capture",
193
+ description: options.description ?? `A screenshot of ${options.subject ?? "the editor"}, to check what text cannot tell you: overlap, legibility, balance.`,
194
+ ...options.skill ? { skill: options.skill } : {},
195
+ tools: [createCaptureTool(surface, options)]
196
+ };
190
197
  }
191
198
 
192
199
  export {
@@ -5,7 +5,7 @@ var _chunkJLWLX52Lcjs = require('./chunk-JLWLX52L.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkF652BKMScjs = require('./chunk-F652BKMS.cjs');
8
+ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
9
9
 
10
10
 
11
11
 
@@ -316,7 +316,7 @@ function threadsOf(source) {
316
316
  return Array.isArray(value.threads) ? [...value.threads] : [];
317
317
  }
318
318
  function stylesOf(source) {
319
- if (!source) return { styles: _chunkF652BKMScjs.DEFAULT_STYLES.map((s) => ({ ...s })), defaults: {} };
319
+ if (!source) return { styles: _chunkYN6JKAUEcjs.DEFAULT_STYLES.map((s) => ({ ...s })), defaults: {} };
320
320
  if (Array.isArray(source)) return { styles: [...source], defaults: {} };
321
321
  const value = source;
322
322
  const json = typeof value.toJSON === "function" ? value.toJSON() : value;
@@ -384,7 +384,7 @@ function runFormatOf(marks) {
384
384
  break;
385
385
  }
386
386
  case "characterStyle":
387
- if (_chunkF652BKMScjs.isValidStyleId.call(void 0, attrs2.styleId)) format.charStyle = attrs2.styleId;
387
+ if (_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, attrs2.styleId)) format.charStyle = attrs2.styleId;
388
388
  break;
389
389
  case "link":
390
390
  format.charStyle ??= "Hyperlink";
@@ -522,7 +522,7 @@ var DocxBuilder = (_class2 = class {
522
522
  this.styles = styles;
523
523
  this.anonymous = options.privacy === "strip-authors";
524
524
  this.defaultAuthor = authorOf(options.author);
525
- this.styleIds = new Set(styles.styles.filter((s) => _chunkF652BKMScjs.isValidStyleId.call(void 0, s.id)).map((s) => s.id));
525
+ this.styleIds = new Set(styles.styles.filter((s) => _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, s.id)).map((s) => s.id));
526
526
  }
527
527
 
528
528
 
@@ -713,7 +713,7 @@ var DocxBuilder = (_class2 = class {
713
713
  styleFor(node, ctx, opts) {
714
714
  const own = _optionalChain([node, 'access', _37 => _37.attrs, 'optionalAccess', _38 => _38.styleId]);
715
715
  if (own) {
716
- if (_chunkF652BKMScjs.isValidStyleId.call(void 0, own) && this.styleIds.has(own)) return own;
716
+ if (_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, own) && this.styleIds.has(own)) return own;
717
717
  this.drop("style", String(own), "style is not in the registry");
718
718
  }
719
719
  if (opts.heading) return this.needStyle(`Heading${opts.heading}`);
@@ -730,7 +730,7 @@ var DocxBuilder = (_class2 = class {
730
730
  previousStyle(previous) {
731
731
  if (!previous) return void 0;
732
732
  const id = _optionalChain([previous, 'access', _39 => _39.attrs, 'optionalAccess', _40 => _40.styleId]);
733
- if (_chunkF652BKMScjs.isValidStyleId.call(void 0, id) && this.styleIds.has(id)) return id;
733
+ if (_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, id) && this.styleIds.has(id)) return id;
734
734
  if (previous.type === "heading") return this.needStyle(`Heading${Math.max(1, Math.min(6, Number(_optionalChain([previous, 'access', _41 => _41.attrs, 'optionalAccess', _42 => _42.level])) || 1))}`);
735
735
  if (previous.type === "codeBlock") return this.needStyle("Code");
736
736
  return void 0;
@@ -1200,7 +1200,7 @@ var DocxBuilder = (_class2 = class {
1200
1200
  if (defaults.paragraph && Object.keys(defaults.paragraph).length) writeParagraphFormat(w, defaults.paragraph);
1201
1201
  else w.empty("w:spacing", { "w:after": 160, "w:line": 259, "w:lineRule": "auto" });
1202
1202
  w.close("w:pPr").close("w:pPrDefault").close("w:docDefaults");
1203
- const byId = new Map(this.styles.styles.filter((s) => _chunkF652BKMScjs.isValidStyleId.call(void 0, s.id)).map((s) => [s.id, s]));
1203
+ const byId = new Map(this.styles.styles.filter((s) => _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, s.id)).map((s) => [s.id, s]));
1204
1204
  const written = /* @__PURE__ */ new Set();
1205
1205
  const blockOf = (style) => {
1206
1206
  let current = style;
@@ -1213,7 +1213,7 @@ var DocxBuilder = (_class2 = class {
1213
1213
  const writeStyle = (style) => {
1214
1214
  if (written.has(style.id)) return;
1215
1215
  written.add(style.id);
1216
- const isNormal = style.kind === "paragraph" && style.id === _chunkF652BKMScjs.NORMAL_STYLE_ID;
1216
+ const isNormal = style.kind === "paragraph" && style.id === _chunkYN6JKAUEcjs.NORMAL_STYLE_ID;
1217
1217
  w.open("w:style", {
1218
1218
  "w:type": style.kind === "character" ? "character" : "paragraph",
1219
1219
  "w:default": isNormal ? 1 : void 0,
@@ -1255,7 +1255,7 @@ var DocxBuilder = (_class2 = class {
1255
1255
  byId.forEach((style) => visit(style));
1256
1256
  for (const id of this.extraStyles) {
1257
1257
  if (written.has(id)) continue;
1258
- const extra = _nullishCoalesce(EXTRA_STYLES[id], () => ( { id, name: id, kind: "paragraph", basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID }));
1258
+ const extra = _nullishCoalesce(EXTRA_STYLES[id], () => ( { id, name: id, kind: "paragraph", basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID }));
1259
1259
  byId.set(id, extra);
1260
1260
  writeStyle(extra);
1261
1261
  }
@@ -1425,7 +1425,7 @@ var EXTRA_STYLES = {
1425
1425
  id: "BlockText",
1426
1426
  name: "Block Text",
1427
1427
  kind: "paragraph",
1428
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1428
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1429
1429
  paragraph: { indentLeft: "0.5in", indentRight: "0.5in" },
1430
1430
  character: { italic: true },
1431
1431
  priority: 99,
@@ -1435,7 +1435,7 @@ var EXTRA_STYLES = {
1435
1435
  id: "ListParagraph",
1436
1436
  name: "List Paragraph",
1437
1437
  kind: "paragraph",
1438
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1438
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1439
1439
  paragraph: { indentLeft: "0.5in" },
1440
1440
  priority: 34,
1441
1441
  quick: true,
@@ -1445,7 +1445,7 @@ var EXTRA_STYLES = {
1445
1445
  id: "Code",
1446
1446
  name: "Code",
1447
1447
  kind: "paragraph",
1448
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1448
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1449
1449
  block: { type: "codeBlock" },
1450
1450
  character: { fontFamily: "Consolas", fontSize: "10pt" },
1451
1451
  paragraph: { spaceAfter: "0pt", lineHeight: "1" },
@@ -1473,7 +1473,7 @@ var EXTRA_STYLES = {
1473
1473
  id: "CommentText",
1474
1474
  name: "annotation text",
1475
1475
  kind: "paragraph",
1476
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1476
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1477
1477
  character: { fontSize: "10pt" },
1478
1478
  priority: 99,
1479
1479
  hidden: true,
@@ -1485,8 +1485,8 @@ for (let level = 1; level <= 6; level++) {
1485
1485
  id: `Heading${level}`,
1486
1486
  name: `Heading ${level}`,
1487
1487
  kind: "paragraph",
1488
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1489
- next: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1488
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1489
+ next: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1490
1490
  block: { type: "heading", attrs: { level } },
1491
1491
  character: { bold: true },
1492
1492
  priority: 9,
@@ -15,11 +15,12 @@ import {
15
15
  } from "./chunk-RN767PO6.js";
16
16
  import {
17
17
  plainTextToSlice
18
- } from "./chunk-SWZTQWY7.js";
18
+ } from "./chunk-2INPJDNY.js";
19
19
  import {
20
20
  TRACK_CHANGES_SKIP_META,
21
- isTrackChangesEnabled
22
- } from "./chunk-HZZXBTLB.js";
21
+ isTrackChangesEnabled,
22
+ safeMergeAttributes
23
+ } from "./chunk-6IN474P4.js";
23
24
 
24
25
  // src/extensions/table/nesting.ts
25
26
  import { Fragment, Slice } from "@tiptap/pm/model";
@@ -1332,7 +1333,7 @@ function createChartNodeView(mount, renderStatic) {
1332
1333
  }
1333
1334
 
1334
1335
  // src/extensions/chart/chart-node.ts
1335
- import { Node, mergeAttributes } from "@tiptap/core";
1336
+ import { Node } from "@tiptap/core";
1336
1337
  import { Plugin as Plugin2, PluginKey as PluginKey2 } from "@tiptap/pm/state";
1337
1338
 
1338
1339
  // src/extensions/document-structure/utils.ts
@@ -1550,7 +1551,7 @@ var Chart = Node.create({
1550
1551
  const svg = staticChartSvg(node, this.options);
1551
1552
  return [
1552
1553
  "div",
1553
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
1554
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
1554
1555
  "data-type": "chart",
1555
1556
  class: "pixerate-chart"
1556
1557
  }),
@@ -1630,7 +1631,7 @@ var Chart = Node.create({
1630
1631
  });
1631
1632
 
1632
1633
  // src/extensions/chart/sparkline-node.ts
1633
- import { Node as Node2, mergeAttributes as mergeAttributes2 } from "@tiptap/core";
1634
+ import { Node as Node2 } from "@tiptap/core";
1634
1635
  var SPARKLINE_KINDS = ["line", "column", "win-loss"];
1635
1636
  var MAX_SPARKLINE_VALUES = 1e3;
1636
1637
  function normalizeSparklineValues(values) {
@@ -1717,7 +1718,7 @@ var Sparkline = Node2.create({
1717
1718
  });
1718
1719
  return [
1719
1720
  "span",
1720
- mergeAttributes2(this.options.HTMLAttributes, HTMLAttributes, {
1721
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
1721
1722
  "data-type": "sparkline",
1722
1723
  class: "pixerate-sparkline"
1723
1724
  }),
@@ -2005,6 +2006,7 @@ function createTableStore(editor) {
2005
2006
 
2006
2007
  // src/extensions/agent-caret.ts
2007
2008
  import { Extension } from "@tiptap/core";
2009
+ import { closeHistory } from "@tiptap/pm/history";
2008
2010
  import { Plugin as Plugin3, PluginKey as PluginKey3 } from "@tiptap/pm/state";
2009
2011
  import { Decoration, DecorationSet } from "@tiptap/pm/view";
2010
2012
  var DEFAULT_AGENT_CARET_COLOR = "#8b5cf6";
@@ -2164,7 +2166,7 @@ async function typeAgentText(editor, options) {
2164
2166
  ensureAgentCaret(editor);
2165
2167
  const show = (tr, anchor, head = anchor) => tr.setMeta(agentCaretPluginKey, { set: { ...caret, from: anchor, to: head } });
2166
2168
  const commit = (start, end) => {
2167
- const tr = replaceWithTextTransaction(editor.state, start, end, text);
2169
+ const tr = closeHistory(replaceWithTextTransaction(editor.state, start, end, text));
2168
2170
  const insertedTo = tr.mapping.map(end, 1);
2169
2171
  const insertedFrom = Math.min(tr.mapping.map(start, -1), insertedTo);
2170
2172
  editor.view.dispatch(show(tr, insertedTo).scrollIntoView());
@@ -1,3 +1,22 @@
1
+ import {
2
+ isUnsafeJsonKey,
3
+ stripPrototypeKeys
4
+ } from "./chunk-HF5QZS7Z.js";
5
+
6
+ // src/extensions/safe-merge-attributes.ts
7
+ import { mergeAttributes } from "@tiptap/core";
8
+ function safeMergeAttributes(...objects) {
9
+ return mergeAttributes(
10
+ ...objects.filter((item) => !!item).map((item) => {
11
+ const keys = Object.keys(item);
12
+ if (!keys.some(isUnsafeJsonKey)) return item;
13
+ const copy = {};
14
+ for (const key of keys) if (!isUnsafeJsonKey(key)) copy[key] = item[key];
15
+ return copy;
16
+ })
17
+ );
18
+ }
19
+
1
20
  // src/extensions/comment-store.ts
2
21
  var idCounter = 0;
3
22
  function createReviewId(prefix = "c") {
@@ -44,7 +63,7 @@ var CommentStore = class _CommentStore {
44
63
  }
45
64
  /** Parses `toJSON()` output (or a plain thread array). */
46
65
  static parse(json) {
47
- const value = typeof json === "string" ? JSON.parse(json) : json;
66
+ const value = stripPrototypeKeys(typeof json === "string" ? JSON.parse(json) : json);
48
67
  const list = Array.isArray(value) ? value : value?.threads;
49
68
  if (!Array.isArray(list)) return [];
50
69
  return list.filter((t) => t && t.id != null).map(normalizeThread);
@@ -237,7 +256,7 @@ function formatReviewTime(timestamp, now = Date.now()) {
237
256
  }
238
257
 
239
258
  // src/extensions/track-changes.ts
240
- import { Extension, Mark, mergeAttributes } from "@tiptap/core";
259
+ import { Extension, Mark } from "@tiptap/core";
241
260
  import {
242
261
  Plugin,
243
262
  PluginKey,
@@ -369,7 +388,7 @@ var TrackedInsertion = Mark.create({
369
388
  const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
370
389
  return [
371
390
  "ins",
372
- mergeAttributes(base, HTMLAttributes, {
391
+ safeMergeAttributes(base, HTMLAttributes, {
373
392
  "data-change-type": "insertion"
374
393
  }),
375
394
  0
@@ -403,7 +422,7 @@ var TrackedDeletion = Mark.create({
403
422
  const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
404
423
  return [
405
424
  "del",
406
- mergeAttributes(base, HTMLAttributes, {
425
+ safeMergeAttributes(base, HTMLAttributes, {
407
426
  "data-change-type": "deletion"
408
427
  }),
409
428
  0
@@ -444,7 +463,7 @@ var TrackedFormatChange = Mark.create({
444
463
  renderHTML({ HTMLAttributes }) {
445
464
  return [
446
465
  "span",
447
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
466
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
448
467
  "data-change-type": "format"
449
468
  }),
450
469
  0
@@ -1931,6 +1950,7 @@ var TrackChanges = Extension.create({
1931
1950
  });
1932
1951
 
1933
1952
  export {
1953
+ safeMergeAttributes,
1934
1954
  createReviewId,
1935
1955
  CommentStore,
1936
1956
  createCommentStore,
@@ -343,7 +343,10 @@ function createEffectToolProvider(host) {
343
343
  ];
344
344
  return {
345
345
  id: host.id,
346
- ...host.namespace ? { namespace: host.namespace } : {},
346
+ ...host.namespace !== void 0 ? { namespace: host.namespace } : {},
347
+ ...host.title ? { title: host.title } : {},
348
+ ...host.description ? { description: host.description } : {},
349
+ ...host.skill ? { skill: host.skill } : {},
347
350
  tools: () => {
348
351
  const extra = host.extraTools?.(context) ?? [];
349
352
  if (host.readOnlyReason()) return [...readTools(), ...extra.filter((t) => t.annotations?.readOnlyHint)];
@@ -3,12 +3,41 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkSPVIXXIBcjs = require('./chunk-SPVIXXIB.cjs');
6
+ var _chunkHDK3T2QScjs = require('./chunk-HDK3T2QS.cjs');
7
7
 
8
8
  // src/bridge/index.ts
9
9
  var _http = require('http');
10
10
  var _readline = require('readline');
11
11
 
12
+ // src/bridge/skills.ts
13
+ var _fs = require('fs');
14
+ var _path = require('path');
15
+ var _url = require('url');
16
+ function defaultSkillsDir() {
17
+ let dir = typeof __dirname === "string" ? __dirname : _path.dirname.call(void 0, _url.fileURLToPath.call(void 0, void 0));
18
+ for (let i = 0; i < 5; i++) {
19
+ const candidate = _path.join.call(void 0, dir, "skills");
20
+ if (_fs.existsSync.call(void 0, _path.join.call(void 0, candidate, "pixerate-agent-tools", "SKILL.md"))) return candidate;
21
+ const parent = _path.dirname.call(void 0, dir);
22
+ if (parent === dir) break;
23
+ dir = parent;
24
+ }
25
+ return null;
26
+ }
27
+ function loadSkillFiles(dir = defaultSkillsDir()) {
28
+ const files = {};
29
+ if (!dir || !_fs.existsSync.call(void 0, dir)) return files;
30
+ const walk = (current) => {
31
+ for (const name of _fs.readdirSync.call(void 0, current)) {
32
+ const path = _path.join.call(void 0, current, name);
33
+ if (_fs.statSync.call(void 0, path).isDirectory()) walk(path);
34
+ else if (name.endsWith(".md") && current !== dir) files[_path.relative.call(void 0, dir, path).split(_path.sep).join("/")] = _fs.readFileSync.call(void 0, path, "utf8");
35
+ }
36
+ };
37
+ walk(dir);
38
+ return files;
39
+ }
40
+
12
41
  // src/bridge/websocket.ts
13
42
  var _crypto = require('crypto');
14
43
  var GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
@@ -163,11 +192,12 @@ var EDITOR_ARG = {
163
192
  type: "string",
164
193
  description: 'Editor id (e.g. "e1") or part of its name, from list_editors. Default: the most recently active editor that has this tool.'
165
194
  };
166
- var BRIDGE_INSTRUCTIONS = "Tools come from editors open in a browser. Call list_editors to see them; when several are open, pass `editor` (an id or part of a name) to pick one, otherwise the most recently active editor that has the tool answers. If no editor is connected, ask the user to open the app and connect it to the bridge.";
195
+ var BRIDGE_INSTRUCTIONS = "Tools come from editors open in a browser. Call list_editors to see them; when several are open, pass `editor` (an id or part of a name) to pick one, otherwise the most recently active editor that has the tool answers. If no editor is connected, ask the user to open the app and connect it to the bridge. Tool names are `<toolset>__<tool>`; when an editor offers list_toolsets and search_tools, use them to find tools that are not listed yet.";
196
+ var SKILL_INSTRUCTIONS = "Each editor's tools are documented by an agent skill (pixerate-chart, pixerate-video-editor, ...), served here as MCP prompts and as resources at skill://<skill>/SKILL.md. Read pixerate-agent-tools and the skill for the editor at hand before working with its tools.";
167
197
  async function createToolBridge(options) {
168
198
  const log = _nullishCoalesce(options.log, () => ( ((message) => process.stderr.write(`[${options.name}] ${message}
169
199
  `))));
170
- const port = _nullishCoalesce(options.port, () => ( _chunkSPVIXXIBcjs.TOOL_BRIDGE_DEFAULT_PORT));
200
+ const port = _nullishCoalesce(options.port, () => ( _chunkHDK3T2QScjs.TOOL_BRIDGE_DEFAULT_PORT));
171
201
  const retryMs = _nullishCoalesce(options.retryMs, () => ( 2e3));
172
202
  const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( 6e4));
173
203
  const extraOrigins = new Set(_nullishCoalesce(options.origins, () => ( [])));
@@ -181,7 +211,7 @@ async function createToolBridge(options) {
181
211
  let closed = false;
182
212
  let retry;
183
213
  const send = (editor, message) => editor.socket.send(JSON.stringify(message));
184
- const registry = new (0, _chunkSPVIXXIBcjs.ToolRegistry)();
214
+ const registry = new (0, _chunkHDK3T2QScjs.ToolRegistry)();
185
215
  const listeners = /* @__PURE__ */ new Set();
186
216
  const toolsChanged = () => listeners.forEach((l) => l());
187
217
  const describeEditors = () => [...editors.values()].map((e) => `${e.id} (${e.name})`).join(", ");
@@ -251,6 +281,8 @@ async function createToolBridge(options) {
251
281
  };
252
282
  registry.register({
253
283
  id: "bridge",
284
+ // Forwarded tools keep the names their pages gave them.
285
+ namespace: "",
254
286
  tools: () => [listEditors, ...forwardedTools()],
255
287
  subscribe: (notify) => {
256
288
  listeners.add(notify);
@@ -287,13 +319,13 @@ async function createToolBridge(options) {
287
319
  return;
288
320
  }
289
321
  if (message.t === "hello") {
290
- if (message.v !== _chunkSPVIXXIBcjs.TOOL_BRIDGE_PROTOCOL) {
322
+ if (message.v !== _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL) {
291
323
  log(`refused an editor speaking protocol v${String(message.v)}`);
292
- return ws.close(1008, `This bridge speaks protocol v${_chunkSPVIXXIBcjs.TOOL_BRIDGE_PROTOCOL}; update @pixerate/editor.`);
324
+ return ws.close(1008, `This bridge speaks protocol v${_chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL}; update @pixerate/editor.`);
293
325
  }
294
326
  editor = { id: `e${++editorCounter}`, name: String(message.name || "Editor"), ...message.kind ? { kind: message.kind } : {}, socket: ws, tools: Array.isArray(message.tools) ? message.tools : [], activeAt: Date.now(), activeSeq: ++activity };
295
327
  editors.set(editor.id, editor);
296
- ws.send(JSON.stringify({ t: "welcome", v: _chunkSPVIXXIBcjs.TOOL_BRIDGE_PROTOCOL, id: editor.id }));
328
+ ws.send(JSON.stringify({ t: "welcome", v: _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL, id: editor.id }));
297
329
  log(`editor ${editor.id} connected: ${editor.name} (${editor.tools.length} tools)`);
298
330
  toolsChanged();
299
331
  } else if (message.t === "tools" && editor) {
@@ -347,10 +379,13 @@ async function createToolBridge(options) {
347
379
  let output = null;
348
380
  const write = (message) => _optionalChain([output, 'optionalAccess', _12 => _12.write, 'call', _13 => _13(`${JSON.stringify(message)}
349
381
  `)]);
350
- const mcp = _chunkSPVIXXIBcjs.createMcpServer.call(void 0, registry, {
382
+ const skills = options.skills === false ? {} : _nullishCoalesce(options.skills, () => ( loadSkillFiles()));
383
+ const hasSkills = Object.keys(skills).length > 0;
384
+ const mcp = _chunkHDK3T2QScjs.createMcpServer.call(void 0, registry, {
351
385
  name: options.name,
352
386
  version: _nullishCoalesce(options.version, () => ( "0.1.0")),
353
- instructions: [options.instructions, BRIDGE_INSTRUCTIONS].filter(Boolean).join("\n\n"),
387
+ instructions: [options.instructions, BRIDGE_INSTRUCTIONS, hasSkills ? SKILL_INSTRUCTIONS : ""].filter(Boolean).join("\n\n"),
388
+ ...hasSkills ? { skills } : {},
354
389
  send: write
355
390
  });
356
391
  let lines = null;
@@ -397,4 +432,6 @@ async function createToolBridge(options) {
397
432
 
398
433
 
399
434
 
400
- exports.isLocalOrigin = isLocalOrigin; exports.createToolBridge = createToolBridge;
435
+
436
+
437
+ exports.defaultSkillsDir = defaultSkillsDir; exports.loadSkillFiles = loadSkillFiles; exports.isLocalOrigin = isLocalOrigin; exports.createToolBridge = createToolBridge;
@@ -1,3 +1,7 @@
1
+ import {
2
+ isUnsafeJsonKey
3
+ } from "./chunk-HF5QZS7Z.js";
4
+
1
5
  // src/extensions/paragraph-styles/registry.ts
2
6
  var MAX_CHAIN = 32;
3
7
  var STYLE_ID = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
@@ -154,7 +158,7 @@ function overlay(base, patch) {
154
158
  if (!patch) return base;
155
159
  const out = { ...base };
156
160
  Object.entries(patch).forEach(([key, value]) => {
157
- if (value !== void 0 && value !== null) out[key] = value;
161
+ if (value !== void 0 && value !== null && !isUnsafeJsonKey(key)) out[key] = value;
158
162
  });
159
163
  return out;
160
164
  }
@@ -8,7 +8,7 @@ var _chunkJG5VGCKPcjs = require('./chunk-JG5VGCKP.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkCCKP4XANcjs = require('./chunk-CCKP4XAN.cjs');
11
+ var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
12
12
 
13
13
  // src/serializers/plain-text.ts
14
14
  var _model = require('@tiptap/pm/model');
@@ -261,16 +261,16 @@ function resolvedBlockOperationsHtml(editor, view) {
261
261
  doc.descendants((node) => {
262
262
  if (found) return false;
263
263
  if (node.isTextblock) {
264
- if (_optionalChain([node, 'access', _3 => _3.attrs, 'optionalAccess', _4 => _4[_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _5 => _5.operation])) found = true;
264
+ if (_optionalChain([node, 'access', _3 => _3.attrs, 'optionalAccess', _4 => _4[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _5 => _5.operation])) found = true;
265
265
  else node.forEach((child) => {
266
- if (child.marks.some((mark) => _optionalChain([mark, 'access', _6 => _6.attrs, 'optionalAccess', _7 => _7[_chunkCCKP4XANcjs.MOVE_ID_ATTRIBUTE]]))) found = true;
266
+ if (child.marks.some((mark) => _optionalChain([mark, 'access', _6 => _6.attrs, 'optionalAccess', _7 => _7[_chunk34RQAGWIcjs.MOVE_ID_ATTRIBUTE]]))) found = true;
267
267
  });
268
268
  return false;
269
269
  }
270
270
  return true;
271
271
  });
272
272
  if (!found) return null;
273
- const resolved = _chunkCCKP4XANcjs.resolveTrackedChanges.call(void 0, doc, view);
273
+ const resolved = _chunk34RQAGWIcjs.resolveTrackedChanges.call(void 0, doc, view);
274
274
  const container = document.createElement("div");
275
275
  container.appendChild(_model.DOMSerializer.fromSchema(doc.type.schema).serializeFragment(resolved.content));
276
276
  return container.innerHTML;
@@ -818,7 +818,7 @@ function getEditorMarkdown(editor, options = {}) {
818
818
  if (typeof _optionalChain([markdown, 'optionalAccess', _50 => _50.getMarkdown]) === "function") {
819
819
  const doc = _optionalChain([editor, 'access', _51 => _51.state, 'optionalAccess', _52 => _52.doc]);
820
820
  if (doc && typeof _optionalChain([markdown, 'access', _53 => _53.serializer, 'optionalAccess', _54 => _54.serialize]) === "function") {
821
- const resolved = _chunkCCKP4XANcjs.resolveTrackedChanges.call(void 0, doc, _nullishCoalesce(options.trackedChanges, () => ( "accepted")));
821
+ const resolved = _chunk34RQAGWIcjs.resolveTrackedChanges.call(void 0, doc, _nullishCoalesce(options.trackedChanges, () => ( "accepted")));
822
822
  if (resolved !== doc) return markdown.serializer.serialize(resolved);
823
823
  }
824
824
  return markdown.getMarkdown();