@pixerate/editor 0.139.1 → 0.140.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 (120) 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 +397 -46
  5. package/dist/agent/index.js +365 -14
  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 +3 -3
  19. package/dist/bridge/cli.js +2 -2
  20. package/dist/bridge/index.cjs +7 -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 +8 -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-BKMU3V6K.js → chunk-5ED73EC6.js} +8 -1
  37. package/dist/{chunk-VRIR53SW.js → chunk-5G3KYRER.js} +2 -1
  38. package/dist/{chunk-KHMVB3SJ.js → chunk-7KWJEYIK.js} +4 -1
  39. package/dist/{chunk-R47NQICB.cjs → chunk-HDCH35UM.cjs} +47 -10
  40. package/dist/{chunk-6NCBFBXA.js → chunk-IQ6KKXOU.js} +1 -1
  41. package/dist/{chunk-PCNCT4ZY.js → chunk-KIBEEN5K.js} +40 -3
  42. package/dist/{chunk-CZRWP6IW.cjs → chunk-N2FGYZ4Q.cjs} +8 -1
  43. package/dist/{chunk-T6Y5FV7G.cjs → chunk-RPW7YL3D.cjs} +2 -1
  44. package/dist/{chunk-3V746PF4.cjs → chunk-RUZQMYXH.cjs} +4 -1
  45. package/dist/{chunk-GUPQ5BNA.cjs → chunk-RWML7TWG.cjs} +44 -44
  46. package/dist/{chunk-HGHXGCKG.cjs → chunk-SVFEVKLF.cjs} +1 -1
  47. package/dist/{chunk-PQMADRCI.js → chunk-UOJS6PUP.js} +1 -1
  48. package/dist/{chunk-BWT4IWLK.cjs → chunk-VKF3PWKR.cjs} +7 -7
  49. package/dist/chunk-WBKLYLZE.js +1156 -0
  50. package/dist/{chunk-TBSPPVTT.js → chunk-XCK7QK5D.js} +1 -1
  51. package/dist/chunk-ZAOOIJ6I.cjs +1156 -0
  52. package/dist/commands/agentTools.d.cts +1 -1
  53. package/dist/commands/agentTools.d.ts +1 -1
  54. package/dist/commands/index.cjs +3 -0
  55. package/dist/commands/index.js +3 -0
  56. package/dist/diagram/index.cjs +3 -0
  57. package/dist/diagram/index.js +3 -0
  58. package/dist/diagram/tools.d.cts +1 -1
  59. package/dist/diagram/tools.d.ts +1 -1
  60. package/dist/effects/index.cjs +32 -32
  61. package/dist/effects/index.js +1 -1
  62. package/dist/effects/tools.d.cts +5 -1
  63. package/dist/effects/tools.d.ts +5 -1
  64. package/dist/extensions/index.cjs +3 -3
  65. package/dist/extensions/index.js +2 -2
  66. package/dist/generation/index.cjs +7 -1
  67. package/dist/generation/index.js +7 -1
  68. package/dist/image-editor/index.cjs +21 -15
  69. package/dist/image-editor/index.js +8 -2
  70. package/dist/image-editor/provider-effect-tools.d.cts +1 -1
  71. package/dist/image-editor/provider-effect-tools.d.ts +1 -1
  72. package/dist/image-editor/tools.d.cts +1 -1
  73. package/dist/image-editor/tools.d.ts +1 -1
  74. package/dist/index.cjs +8 -8
  75. package/dist/index.js +2 -2
  76. package/dist/paint-editor/effect-tools.d.cts +1 -1
  77. package/dist/paint-editor/effect-tools.d.ts +1 -1
  78. package/dist/paint-editor/index.cjs +18 -8
  79. package/dist/paint-editor/index.js +13 -3
  80. package/dist/paint-editor/tools.d.cts +1 -1
  81. package/dist/paint-editor/tools.d.ts +1 -1
  82. package/dist/tools/bridge-client.d.cts +3 -3
  83. package/dist/tools/bridge-client.d.ts +3 -3
  84. package/dist/tools/capture.d.cts +5 -1
  85. package/dist/tools/capture.d.ts +5 -1
  86. package/dist/tools/definitions.d.cts +2 -2
  87. package/dist/tools/definitions.d.ts +2 -2
  88. package/dist/tools/index.cjs +31 -5
  89. package/dist/tools/index.d.cts +3 -0
  90. package/dist/tools/index.d.ts +3 -0
  91. package/dist/tools/index.js +31 -5
  92. package/dist/tools/mcp-server.d.cts +24 -6
  93. package/dist/tools/mcp-server.d.ts +24 -6
  94. package/dist/tools/registry.d.cts +81 -6
  95. package/dist/tools/registry.d.ts +81 -6
  96. package/dist/tools/search.d.cts +30 -0
  97. package/dist/tools/search.d.ts +30 -0
  98. package/dist/tools/skills.d.cts +26 -0
  99. package/dist/tools/skills.d.ts +26 -0
  100. package/dist/tools/view.d.cts +95 -0
  101. package/dist/tools/view.d.ts +95 -0
  102. package/dist/vector/effect-tools.d.cts +1 -1
  103. package/dist/vector/effect-tools.d.ts +1 -1
  104. package/dist/vector/index.cjs +13 -7
  105. package/dist/vector/index.js +8 -2
  106. package/dist/video-editor/effect-tools.d.cts +1 -1
  107. package/dist/video-editor/effect-tools.d.ts +1 -1
  108. package/dist/video-editor/index.cjs +275 -269
  109. package/dist/video-editor/index.js +8 -2
  110. package/dist/video-editor/tools.d.cts +1 -1
  111. package/dist/video-editor/tools.d.ts +1 -1
  112. package/package.json +4 -2
  113. package/skills/README.md +8 -3
  114. package/skills/pixerate-agent-tools/SKILL.md +33 -7
  115. package/skills/pixerate-animation-editor/SKILL.md +7 -0
  116. package/skills/pixerate-rich-text/SKILL.md +18 -4
  117. package/dist/chunk-5RRYDFU2.js +0 -466
  118. package/dist/chunk-SPVIXXIB.cjs +0 -466
  119. /package/dist/{chunk-SMJK5HBJ.js → chunk-MCTQXUXR.js} +0 -0
  120. /package/dist/{chunk-DDF6WQ62.cjs → chunk-R6DFK5OX.cjs} +0 -0
@@ -3,12 +3,41 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkSPVIXXIBcjs = require('./chunk-SPVIXXIB.cjs');
6
+ var _chunkZAOOIJ6Icjs = require('./chunk-ZAOOIJ6I.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, () => ( _chunkZAOOIJ6Icjs.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, _chunkZAOOIJ6Icjs.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 !== _chunkZAOOIJ6Icjs.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${_chunkZAOOIJ6Icjs.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: _chunkZAOOIJ6Icjs.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 = _chunkZAOOIJ6Icjs.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;
@@ -7,7 +7,7 @@ import {
7
7
  EffectsSlot,
8
8
  createEffectPixels,
9
9
  effectValueErrors
10
- } from "./chunk-KHMVB3SJ.js";
10
+ } from "./chunk-7KWJEYIK.js";
11
11
  import {
12
12
  validateJsonSchema
13
13
  } from "./chunk-V2ZCJRDM.js";
@@ -3,12 +3,41 @@ import {
3
3
  TOOL_BRIDGE_PROTOCOL,
4
4
  ToolRegistry,
5
5
  createMcpServer
6
- } from "./chunk-5RRYDFU2.js";
6
+ } from "./chunk-WBKLYLZE.js";
7
7
 
8
8
  // src/bridge/index.ts
9
9
  import { createServer } from "http";
10
10
  import { createInterface } from "readline";
11
11
 
12
+ // src/bridge/skills.ts
13
+ import { existsSync, readdirSync, readFileSync, statSync } from "fs";
14
+ import { dirname, join, relative, sep } from "path";
15
+ import { fileURLToPath } from "url";
16
+ function defaultSkillsDir() {
17
+ let dir = typeof __dirname === "string" ? __dirname : dirname(fileURLToPath(import.meta.url));
18
+ for (let i = 0; i < 5; i++) {
19
+ const candidate = join(dir, "skills");
20
+ if (existsSync(join(candidate, "pixerate-agent-tools", "SKILL.md"))) return candidate;
21
+ const parent = dirname(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 || !existsSync(dir)) return files;
30
+ const walk = (current) => {
31
+ for (const name of readdirSync(current)) {
32
+ const path = join(current, name);
33
+ if (statSync(path).isDirectory()) walk(path);
34
+ else if (name.endsWith(".md") && current !== dir) files[relative(dir, path).split(sep).join("/")] = readFileSync(path, "utf8");
35
+ }
36
+ };
37
+ walk(dir);
38
+ return files;
39
+ }
40
+
12
41
  // src/bridge/websocket.ts
13
42
  import { createHash } from "crypto";
14
43
  var GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
@@ -163,7 +192,8 @@ 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 = options.log ?? ((message) => process.stderr.write(`[${options.name}] ${message}
169
199
  `));
@@ -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);
@@ -347,10 +379,13 @@ async function createToolBridge(options) {
347
379
  let output = null;
348
380
  const write = (message) => output?.write(`${JSON.stringify(message)}
349
381
  `);
382
+ const skills = options.skills === false ? {} : options.skills ?? loadSkillFiles();
383
+ const hasSkills = Object.keys(skills).length > 0;
350
384
  const mcp = createMcpServer(registry, {
351
385
  name: options.name,
352
386
  version: 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;
@@ -395,6 +430,8 @@ async function createToolBridge(options) {
395
430
  }
396
431
 
397
432
  export {
433
+ defaultSkillsDir,
434
+ loadSkillFiles,
398
435
  isLocalOrigin,
399
436
  createToolBridge
400
437
  };
@@ -186,7 +186,14 @@ function createCaptureTool(surface, options = {}) {
186
186
  };
187
187
  }
188
188
  function createCaptureToolProvider(surface, options = {}) {
189
- return { id: _nullishCoalesce(options.id, () => ( "capture")), namespace: options.namespace, tools: [createCaptureTool(surface, options)] };
189
+ return {
190
+ id: _nullishCoalesce(options.id, () => ( "capture")),
191
+ namespace: options.namespace,
192
+ title: _nullishCoalesce(options.title, () => ( "Screen capture")),
193
+ description: _nullishCoalesce(options.description, () => ( `A screenshot of ${_nullishCoalesce(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
 
@@ -2005,6 +2005,7 @@ function createTableStore(editor) {
2005
2005
 
2006
2006
  // src/extensions/agent-caret.ts
2007
2007
 
2008
+ var _history = require('@tiptap/pm/history');
2008
2009
 
2009
2010
  var _view = require('@tiptap/pm/view');
2010
2011
  var DEFAULT_AGENT_CARET_COLOR = "#8b5cf6";
@@ -2164,7 +2165,7 @@ async function typeAgentText(editor, options) {
2164
2165
  ensureAgentCaret(editor);
2165
2166
  const show = (tr, anchor, head = anchor) => tr.setMeta(agentCaretPluginKey, { set: { ...caret, from: anchor, to: head } });
2166
2167
  const commit = (start, end) => {
2167
- const tr = replaceWithTextTransaction(editor.state, start, end, text);
2168
+ const tr = _history.closeHistory.call(void 0, replaceWithTextTransaction(editor.state, start, end, text));
2168
2169
  const insertedTo = tr.mapping.map(end, 1);
2169
2170
  const insertedFrom = Math.min(tr.mapping.map(start, -1), insertedTo);
2170
2171
  editor.view.dispatch(show(tr, insertedTo).scrollIntoView());
@@ -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 = _nullishCoalesce(_optionalChain([host, 'access', _5 => _5.extraTools, 'optionalCall', _6 => _6(context)]), () => ( []));
349
352
  if (host.readOnlyReason()) return [...readTools(), ...extra.filter((t) => _optionalChain([t, 'access', _7 => _7.annotations, 'optionalAccess', _8 => _8.readOnlyHint]))];
@@ -34,7 +34,7 @@ var _chunkHLMF3E53cjs = require('./chunk-HLMF3E53.cjs');
34
34
 
35
35
 
36
36
 
37
- var _chunkT6Y5FV7Gcjs = require('./chunk-T6Y5FV7G.cjs');
37
+ var _chunkRPW7YL3Dcjs = require('./chunk-RPW7YL3D.cjs');
38
38
 
39
39
 
40
40
  var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
@@ -3642,9 +3642,9 @@ function insertImportedDocument(target, content, options = {}) {
3642
3642
  if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
3643
3643
  from = to = _state.Selection.near(state.doc.resolve(from)).from;
3644
3644
  }
3645
- if (htmlSlice && _chunkT6Y5FV7Gcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkT6Y5FV7Gcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3645
+ if (htmlSlice && _chunkRPW7YL3Dcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkRPW7YL3Dcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3646
3646
  const tr2 = state.tr;
3647
- const end2 = _chunkT6Y5FV7Gcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3647
+ const end2 = _chunkRPW7YL3Dcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3648
3648
  if (end2 !== null) {
3649
3649
  if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
3650
3650
  view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
@@ -3821,7 +3821,7 @@ var RichClipboard = _core.Extension.create({
3821
3821
  const slice = _chunkHXCBQ7A6cjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
3822
3822
  if (!slice) return false;
3823
3823
  event.preventDefault();
3824
- if (_chunkT6Y5FV7Gcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3824
+ if (_chunkRPW7YL3Dcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3825
3825
  view.dispatch(
3826
3826
  view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
3827
3827
  );
@@ -4222,7 +4222,7 @@ function createOutlineStore(editor) {
4222
4222
  if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
4223
4223
  const headings = getOutline(editor);
4224
4224
  const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _161 => _161(editor, headings), 'optionalAccess', _162 => _162.id]), () => ( null));
4225
- const sameStructure = _chunkT6Y5FV7Gcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4225
+ const sameStructure = _chunkRPW7YL3Dcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4226
4226
  if (sameStructure && snapshot.activeId === activeId) return snapshot;
4227
4227
  return {
4228
4228
  headings: sameStructure ? snapshot.headings : headings,
@@ -4270,7 +4270,7 @@ function navigateToHeading(editor, heading, options = {}) {
4270
4270
  editor.view.dispatch(tr);
4271
4271
  editor.view.focus();
4272
4272
  }
4273
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4273
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4274
4274
  return true;
4275
4275
  }
4276
4276
  function assignHeadingIds(state, types, generateId) {
@@ -4295,11 +4295,11 @@ function assignHeadingIds(state, types, generateId) {
4295
4295
  }
4296
4296
  var Outline = _core.Extension.create({
4297
4297
  name: "outline",
4298
- priority: _chunkT6Y5FV7Gcjs.STRUCTURE_PRIORITY,
4298
+ priority: _chunkRPW7YL3Dcjs.STRUCTURE_PRIORITY,
4299
4299
  addOptions() {
4300
4300
  return {
4301
4301
  types: ["heading"],
4302
- generateId: () => _chunkT6Y5FV7Gcjs.generateStructureId.call(void 0, "h"),
4302
+ generateId: () => _chunkRPW7YL3Dcjs.generateStructureId.call(void 0, "h"),
4303
4303
  onUpdate: void 0
4304
4304
  };
4305
4305
  },
@@ -4332,14 +4332,14 @@ var Outline = _core.Extension.create({
4332
4332
  tr.scrollIntoView();
4333
4333
  _optionalChain([view, 'optionalAccess', _169 => _169.focus, 'optionalCall', _170 => _170()]);
4334
4334
  }
4335
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4335
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4336
4336
  }
4337
4337
  return true;
4338
4338
  },
4339
4339
  scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
4340
4340
  const heading = findHeading(state, id);
4341
4341
  if (!heading) return false;
4342
- if (dispatch) _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4342
+ if (dispatch) _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4343
4343
  return true;
4344
4344
  }
4345
4345
  };
@@ -4360,7 +4360,7 @@ var Outline = _core.Extension.create({
4360
4360
  apply: (tr, prev, _oldState, newState) => {
4361
4361
  if (!tr.docChanged) return prev;
4362
4362
  const next = computeOutline(newState.doc, types);
4363
- if (_chunkT6Y5FV7Gcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4363
+ if (_chunkRPW7YL3Dcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4364
4364
  storage.headings = next;
4365
4365
  _optionalChain([onUpdate, 'call', _171 => _171(), 'optionalCall', _172 => _172(next)]);
4366
4366
  return next;
@@ -4378,7 +4378,7 @@ var Outline = _core.Extension.create({
4378
4378
  },
4379
4379
  onBeforeCreate() {
4380
4380
  const { types, generateId } = this.options;
4381
- _chunkT6Y5FV7Gcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4381
+ _chunkRPW7YL3Dcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4382
4382
  }
4383
4383
  });
4384
4384
 
@@ -4548,7 +4548,7 @@ function syncTableOfContents(state, headingTypes) {
4548
4548
  node.attrs.minLevel,
4549
4549
  node.attrs.maxLevel
4550
4550
  );
4551
- if (!_chunkT6Y5FV7Gcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4551
+ if (!_chunkRPW7YL3Dcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4552
4552
  tr = _nullishCoalesce(tr, () => ( state.tr));
4553
4553
  tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
4554
4554
  }
@@ -4560,7 +4560,7 @@ function syncTableOfContents(state, headingTypes) {
4560
4560
  }
4561
4561
  var TableOfContents = _core.Node.create({
4562
4562
  name: "tableOfContents",
4563
- priority: _chunkT6Y5FV7Gcjs.STRUCTURE_PRIORITY - 5,
4563
+ priority: _chunkRPW7YL3Dcjs.STRUCTURE_PRIORITY - 5,
4564
4564
  group: "block",
4565
4565
  atom: true,
4566
4566
  selectable: true,
@@ -4671,7 +4671,7 @@ var TableOfContents = _core.Node.create({
4671
4671
  return [
4672
4672
  new (0, _state.Plugin)({
4673
4673
  key: tableOfContentsPluginKey,
4674
- state: _chunkT6Y5FV7Gcjs.presenceStateSpec.call(void 0, [this.name]),
4674
+ state: _chunkRPW7YL3Dcjs.presenceStateSpec.call(void 0, [this.name]),
4675
4675
  appendTransaction: (transactions, _oldState, newState) => {
4676
4676
  if (!transactions.some((tr) => tr.docChanged)) return null;
4677
4677
  if (!tableOfContentsPluginKey.getState(newState)) return null;
@@ -4695,7 +4695,7 @@ var TableOfContents = _core.Node.create({
4695
4695
  );
4696
4696
  view.focus();
4697
4697
  }
4698
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, heading.pos);
4698
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, heading.pos);
4699
4699
  return true;
4700
4700
  }
4701
4701
  }
@@ -4705,7 +4705,7 @@ var TableOfContents = _core.Node.create({
4705
4705
  },
4706
4706
  onBeforeCreate() {
4707
4707
  const { headingTypes } = this.options;
4708
- _chunkT6Y5FV7Gcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4708
+ _chunkRPW7YL3Dcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4709
4709
  }
4710
4710
  });
4711
4711
 
@@ -4763,7 +4763,7 @@ function syncFootnotes(tr, options = {}) {
4763
4763
  const listType = schema.nodes[LIST];
4764
4764
  const itemType = schema.nodes[ITEM];
4765
4765
  if (!listType || !itemType) return false;
4766
- const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkT6Y5FV7Gcjs.generateStructureId.call(void 0, "fn"))));
4766
+ const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkRPW7YL3Dcjs.generateStructureId.call(void 0, "fn"))));
4767
4767
  const refs = [];
4768
4768
  const lists = [];
4769
4769
  const existing = /* @__PURE__ */ new Map();
@@ -4847,7 +4847,7 @@ function findReferences(doc, id) {
4847
4847
  }
4848
4848
  var FootnoteReference = _core.Node.create({
4849
4849
  name: REFERENCE,
4850
- priority: _chunkT6Y5FV7Gcjs.STRUCTURE_PRIORITY - 5,
4850
+ priority: _chunkRPW7YL3Dcjs.STRUCTURE_PRIORITY - 5,
4851
4851
  group: "inline",
4852
4852
  inline: true,
4853
4853
  atom: true,
@@ -4855,7 +4855,7 @@ var FootnoteReference = _core.Node.create({
4855
4855
  addOptions() {
4856
4856
  return {
4857
4857
  HTMLAttributes: {},
4858
- generateId: () => _chunkT6Y5FV7Gcjs.generateStructureId.call(void 0, "fn")
4858
+ generateId: () => _chunkRPW7YL3Dcjs.generateStructureId.call(void 0, "fn")
4859
4859
  };
4860
4860
  },
4861
4861
  addAttributes() {
@@ -4966,7 +4966,7 @@ var FootnoteReference = _core.Node.create({
4966
4966
  _state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
4967
4967
  );
4968
4968
  tr.scrollIntoView();
4969
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4969
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4970
4970
  }
4971
4971
  return true;
4972
4972
  },
@@ -4976,7 +4976,7 @@ var FootnoteReference = _core.Node.create({
4976
4976
  if (dispatch) {
4977
4977
  tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
4978
4978
  tr.scrollIntoView();
4979
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, ref.pos);
4979
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, ref.pos);
4980
4980
  }
4981
4981
  return true;
4982
4982
  }
@@ -4988,7 +4988,7 @@ var FootnoteReference = _core.Node.create({
4988
4988
  return [
4989
4989
  new (0, _state.Plugin)({
4990
4990
  key: footnotesPluginKey,
4991
- state: _chunkT6Y5FV7Gcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4991
+ state: _chunkRPW7YL3Dcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4992
4992
  appendTransaction: (transactions, _oldState, newState) => {
4993
4993
  if (!transactions.some((tr2) => tr2.docChanged)) return null;
4994
4994
  if (!footnotesPluginKey.getState(newState)) return null;
@@ -5009,7 +5009,7 @@ var FootnoteReference = _core.Node.create({
5009
5009
  },
5010
5010
  onBeforeCreate() {
5011
5011
  const { generateId } = this.options;
5012
- _chunkT6Y5FV7Gcjs.syncInitialContent.call(void 0, this.editor, (state) => {
5012
+ _chunkRPW7YL3Dcjs.syncInitialContent.call(void 0, this.editor, (state) => {
5013
5013
  const tr = state.tr;
5014
5014
  return syncFootnotes(tr, { generateId }) ? tr : null;
5015
5015
  });
@@ -5149,7 +5149,7 @@ var Bookmark = _core.Mark.create({
5149
5149
  addOptions() {
5150
5150
  return {
5151
5151
  HTMLAttributes: {},
5152
- generateId: () => _chunkT6Y5FV7Gcjs.generateStructureId.call(void 0, "bm")
5152
+ generateId: () => _chunkRPW7YL3Dcjs.generateStructureId.call(void 0, "bm")
5153
5153
  };
5154
5154
  },
5155
5155
  addAttributes() {
@@ -5234,7 +5234,7 @@ var Bookmark = _core.Mark.create({
5234
5234
  tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
5235
5235
  tr.scrollIntoView();
5236
5236
  const domPos = state.doc.resolve(bookmark.from);
5237
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5237
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5238
5238
  }
5239
5239
  return true;
5240
5240
  }
@@ -5299,7 +5299,7 @@ function syncCrossReferences(state, headingTypes) {
5299
5299
  }
5300
5300
  var CrossReference = _core.Node.create({
5301
5301
  name: NAME,
5302
- priority: _chunkT6Y5FV7Gcjs.STRUCTURE_PRIORITY - 5,
5302
+ priority: _chunkRPW7YL3Dcjs.STRUCTURE_PRIORITY - 5,
5303
5303
  group: "inline",
5304
5304
  inline: true,
5305
5305
  atom: true,
@@ -5401,7 +5401,7 @@ var CrossReference = _core.Node.create({
5401
5401
  if (dispatch) {
5402
5402
  tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
5403
5403
  tr.scrollIntoView();
5404
- _chunkT6Y5FV7Gcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5404
+ _chunkRPW7YL3Dcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5405
5405
  }
5406
5406
  return true;
5407
5407
  }
@@ -5413,7 +5413,7 @@ var CrossReference = _core.Node.create({
5413
5413
  return [
5414
5414
  new (0, _state.Plugin)({
5415
5415
  key: crossReferencePluginKey,
5416
- state: _chunkT6Y5FV7Gcjs.presenceStateSpec.call(void 0, [NAME]),
5416
+ state: _chunkRPW7YL3Dcjs.presenceStateSpec.call(void 0, [NAME]),
5417
5417
  appendTransaction: (transactions, _oldState, newState) => {
5418
5418
  if (!transactions.some((tr) => tr.docChanged)) return null;
5419
5419
  if (!crossReferencePluginKey.getState(newState)) return null;
@@ -5432,7 +5432,7 @@ var CrossReference = _core.Node.create({
5432
5432
  },
5433
5433
  onBeforeCreate() {
5434
5434
  const { headingTypes } = this.options;
5435
- _chunkT6Y5FV7Gcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5435
+ _chunkRPW7YL3Dcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5436
5436
  }
5437
5437
  });
5438
5438
 
@@ -5687,7 +5687,7 @@ var FindReplace = _core.Extension.create({
5687
5687
  if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
5688
5688
  if (dispatch) {
5689
5689
  _history.closeHistory.call(void 0, tr);
5690
- const [end] = _chunkT6Y5FV7Gcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5690
+ const [end] = _chunkRPW7YL3Dcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5691
5691
  tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
5692
5692
  meta(tr, { type: "replaced", anchor: end, count: 1 });
5693
5693
  }
@@ -5698,7 +5698,7 @@ var FindReplace = _core.Extension.create({
5698
5698
  if (!s || !s.active || !s.matches.length) return false;
5699
5699
  if (dispatch) {
5700
5700
  _history.closeHistory.call(void 0, tr);
5701
- const ends = _chunkT6Y5FV7Gcjs.applyReplacements.call(void 0, tr, s.matches);
5701
+ const ends = _chunkRPW7YL3Dcjs.applyReplacements.call(void 0, tr, s.matches);
5702
5702
  meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
5703
5703
  }
5704
5704
  return true;
@@ -5730,7 +5730,7 @@ var FindReplace = _core.Extension.create({
5730
5730
  if (!s.active || !s.query) {
5731
5731
  return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
5732
5732
  }
5733
- const result = _chunkT6Y5FV7Gcjs.searchDocument.call(void 0, doc, s.query, s.options, {
5733
+ const result = _chunkRPW7YL3Dcjs.searchDocument.call(void 0, doc, s.query, s.options, {
5734
5734
  replacement: s.replacement,
5735
5735
  clipboardText: safeClipboard(options.getClipboardText),
5736
5736
  timeLimitMs: options.timeLimitMs,
@@ -6317,7 +6317,7 @@ function createRichTextPreset(options = {}) {
6317
6317
  })
6318
6318
  ];
6319
6319
  if (options.table !== false) {
6320
- extensions2.push(..._chunkT6Y5FV7Gcjs.createTableExtensions.call(void 0, optionObject(options.table)));
6320
+ extensions2.push(..._chunkRPW7YL3Dcjs.createTableExtensions.call(void 0, optionObject(options.table)));
6321
6321
  }
6322
6322
  if (characterLimit) {
6323
6323
  extensions2.push(
@@ -6424,8 +6424,8 @@ function createRichTextPreset(options = {}) {
6424
6424
  }
6425
6425
  if (options.chart) {
6426
6426
  const { sparkline = true, ...chartOptions } = optionObject(options.chart);
6427
- extensions2.push(_chunkT6Y5FV7Gcjs.Chart.configure(chartOptions));
6428
- if (sparkline) extensions2.push(_chunkT6Y5FV7Gcjs.Sparkline.configure(optionObject(sparkline)));
6427
+ extensions2.push(_chunkRPW7YL3Dcjs.Chart.configure(chartOptions));
6428
+ if (sparkline) extensions2.push(_chunkRPW7YL3Dcjs.Sparkline.configure(optionObject(sparkline)));
6429
6429
  }
6430
6430
  if (options.paragraphStyles) {
6431
6431
  extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
@@ -6566,7 +6566,7 @@ function createFindReplaceCommands(editor, options = {}) {
6566
6566
  ];
6567
6567
  }
6568
6568
  function validateFindPattern(query, options = {}) {
6569
- const result = _chunkT6Y5FV7Gcjs.compileFindPattern.call(void 0, query, options);
6569
+ const result = _chunkRPW7YL3Dcjs.compileFindPattern.call(void 0, query, options);
6570
6570
  return result.ok ? null : result.error;
6571
6571
  }
6572
6572
 
@@ -6575,8 +6575,8 @@ var PARAMS = {
6575
6575
  insertTable: {
6576
6576
  type: "object",
6577
6577
  properties: {
6578
- rows: { type: "integer", minimum: 1, maximum: _chunkT6Y5FV7Gcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6579
- cols: { type: "integer", minimum: 1, maximum: _chunkT6Y5FV7Gcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6578
+ rows: { type: "integer", minimum: 1, maximum: _chunkRPW7YL3Dcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6579
+ cols: { type: "integer", minimum: 1, maximum: _chunkRPW7YL3Dcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6580
6580
  withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
6581
6581
  },
6582
6582
  additionalProperties: false
@@ -6607,7 +6607,7 @@ function createTableCommands(editor, options = {}) {
6607
6607
  const group = _nullishCoalesce(options.group, () => ( "Table"));
6608
6608
  const scope = options.scope ? { scope: options.scope } : {};
6609
6609
  const focus = _nullishCoalesce(options.focus, () => ( true));
6610
- return _chunkT6Y5FV7Gcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6610
+ return _chunkRPW7YL3Dcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6611
6611
  const params = PARAMS[action];
6612
6612
  return {
6613
6613
  id: `${prefix}${action}`,
@@ -6617,13 +6617,13 @@ function createTableCommands(editor, options = {}) {
6617
6617
  description,
6618
6618
  ...params ? { params } : {},
6619
6619
  ...scope,
6620
- enabled: (_ctx, p) => _chunkT6Y5FV7Gcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6620
+ enabled: (_ctx, p) => _chunkRPW7YL3Dcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6621
6621
  run: (_ctx, p) => {
6622
- if (!_chunkT6Y5FV7Gcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6623
- const reason = _chunkT6Y5FV7Gcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6622
+ if (!_chunkRPW7YL3Dcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6623
+ const reason = _chunkRPW7YL3Dcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6624
6624
  throw new Error(reason === true ? `${label} did not change the document.` : reason);
6625
6625
  }
6626
- const state = _chunkT6Y5FV7Gcjs.getTableState.call(void 0, editor);
6626
+ const state = _chunkRPW7YL3Dcjs.getTableState.call(void 0, editor);
6627
6627
  return {
6628
6628
  done: true,
6629
6629
  table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
@@ -287,7 +287,7 @@ var MCP_TOOL_CANVAS_LAYOUT = {
287
287
  name: "canvas_layout",
288
288
  title: "Lay out the canvas",
289
289
  annotations: { title: "Lay out the canvas", ...IDEMPOTENT_ANNOTATIONS },
290
- description: "Arranges the canvas graph automatically.",
290
+ description: "Arranges the canvas nodes automatically in a layered graph layout that follows the edges, so nodes line up and do not overlap. Nodes that already have a position stay put unless incremental is false.",
291
291
  inputSchema: {
292
292
  type: "object",
293
293
  properties: {
@@ -34,7 +34,7 @@ import {
34
34
  searchDocument,
35
35
  sliceContainsTable,
36
36
  syncInitialContent
37
- } from "./chunk-VRIR53SW.js";
37
+ } from "./chunk-5G3KYRER.js";
38
38
  import {
39
39
  chartDataToTable
40
40
  } from "./chunk-RN767PO6.js";