@pixerate/editor 0.145.0 → 0.147.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 (135) hide show
  1. package/README.md +4 -2
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/agent/index.cjs +36 -34
  4. package/dist/agent/index.js +7 -5
  5. package/dist/animation/index.cjs +5 -3
  6. package/dist/animation/index.js +4 -2
  7. package/dist/animation-editor/index.cjs +62 -60
  8. package/dist/animation-editor/index.js +6 -4
  9. package/dist/canvas/index.cjs +36 -34
  10. package/dist/canvas/index.js +19 -17
  11. package/dist/chart/index.cjs +88 -86
  12. package/dist/chart/index.js +7 -5
  13. package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
  14. package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
  15. package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
  16. package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
  17. package/dist/chunk-6ONMQ6WF.js +113 -0
  18. package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
  19. package/dist/chunk-AA34BA7G.js +1913 -0
  20. package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
  21. package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
  22. package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
  23. package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
  24. package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
  25. package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
  26. package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
  27. package/dist/chunk-HRLT5BYO.js +133 -0
  28. package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
  29. package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
  30. package/dist/chunk-IPJ3TEYR.cjs +113 -0
  31. package/dist/chunk-KC7HB5GF.cjs +133 -0
  32. package/dist/chunk-KY3FYKP3.js +52 -0
  33. package/dist/chunk-LEUZ4FRC.cjs +52 -0
  34. package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
  35. package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
  36. package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
  37. package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
  38. package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
  39. package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
  40. package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
  41. package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
  42. package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
  43. package/dist/chunk-UKCJ43YL.cjs +1913 -0
  44. package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
  45. package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
  46. package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
  47. package/dist/cms/index.cjs +5 -3
  48. package/dist/cms/index.js +18 -16
  49. package/dist/color/contrast.d.cts +14 -0
  50. package/dist/color/contrast.d.ts +14 -0
  51. package/dist/color/convert.d.cts +30 -0
  52. package/dist/color/convert.d.ts +30 -0
  53. package/dist/color/dual.d.cts +98 -0
  54. package/dist/color/dual.d.ts +98 -0
  55. package/dist/color/format.d.cts +12 -0
  56. package/dist/color/format.d.ts +12 -0
  57. package/dist/color/gamut.d.cts +12 -0
  58. package/dist/color/gamut.d.ts +12 -0
  59. package/dist/color/harmony.d.cts +22 -0
  60. package/dist/color/harmony.d.ts +22 -0
  61. package/dist/color/index.cjs +115 -0
  62. package/dist/color/index.d.cts +18 -0
  63. package/dist/color/index.d.ts +18 -0
  64. package/dist/color/index.js +115 -0
  65. package/dist/color/mix.d.cts +11 -0
  66. package/dist/color/mix.d.ts +11 -0
  67. package/dist/color/named.d.cts +5 -0
  68. package/dist/color/named.d.ts +5 -0
  69. package/dist/color/parse.d.cts +11 -0
  70. package/dist/color/parse.d.ts +11 -0
  71. package/dist/color/picker.d.cts +52 -0
  72. package/dist/color/picker.d.ts +52 -0
  73. package/dist/color/recent.d.cts +8 -0
  74. package/dist/color/recent.d.ts +8 -0
  75. package/dist/color/tools.d.cts +15 -0
  76. package/dist/color/tools.d.ts +15 -0
  77. package/dist/color/types.d.cts +41 -0
  78. package/dist/color/types.d.ts +41 -0
  79. package/dist/color/vision.d.cts +36 -0
  80. package/dist/color/vision.d.ts +36 -0
  81. package/dist/diagram/editorDocument.d.cts +12 -0
  82. package/dist/diagram/editorDocument.d.ts +12 -0
  83. package/dist/diagram/index.cjs +35 -1
  84. package/dist/diagram/index.d.cts +1 -0
  85. package/dist/diagram/index.d.ts +1 -0
  86. package/dist/diagram/index.js +34 -0
  87. package/dist/export/index.cjs +6 -4
  88. package/dist/export/index.js +5 -3
  89. package/dist/extensions/index.cjs +10 -8
  90. package/dist/extensions/index.js +9 -7
  91. package/dist/gradient/controller.d.cts +109 -0
  92. package/dist/gradient/controller.d.ts +109 -0
  93. package/dist/gradient/editor.d.cts +38 -0
  94. package/dist/gradient/editor.d.ts +38 -0
  95. package/dist/gradient/index.cjs +1549 -0
  96. package/dist/gradient/index.d.cts +5 -0
  97. package/dist/gradient/index.d.ts +5 -0
  98. package/dist/gradient/index.js +1549 -0
  99. package/dist/gradient/model.d.cts +94 -0
  100. package/dist/gradient/model.d.ts +94 -0
  101. package/dist/gradient/tools.d.cts +11 -0
  102. package/dist/gradient/tools.d.ts +11 -0
  103. package/dist/gradient/types.d.cts +44 -0
  104. package/dist/gradient/types.d.ts +44 -0
  105. package/dist/image-editor/index.cjs +649 -647
  106. package/dist/image-editor/index.js +6 -4
  107. package/dist/index.cjs +19 -17
  108. package/dist/index.js +16 -14
  109. package/dist/paint-editor/color.d.cts +3 -13
  110. package/dist/paint-editor/color.d.ts +3 -13
  111. package/dist/paint-editor/index.cjs +23 -68
  112. package/dist/paint-editor/index.js +15 -60
  113. package/dist/persistence/documentStore.d.cts +51 -0
  114. package/dist/persistence/documentStore.d.ts +51 -0
  115. package/dist/persistence/documentTools.d.cts +35 -0
  116. package/dist/persistence/documentTools.d.ts +35 -0
  117. package/dist/persistence/editorAutosave.d.cts +33 -0
  118. package/dist/persistence/editorAutosave.d.ts +33 -0
  119. package/dist/persistence/editorDocument.d.cts +118 -0
  120. package/dist/persistence/editorDocument.d.ts +118 -0
  121. package/dist/persistence/index.cjs +294 -1
  122. package/dist/persistence/index.d.cts +4 -0
  123. package/dist/persistence/index.d.ts +4 -0
  124. package/dist/persistence/index.js +293 -0
  125. package/dist/vector/index.cjs +950 -948
  126. package/dist/vector/index.js +5 -3
  127. package/dist/video-editor/index.cjs +5 -3
  128. package/dist/video-editor/index.js +4 -2
  129. package/package.json +21 -1
  130. package/skills/README.md +1 -0
  131. package/skills/pixerate-agent-tools/SKILL.md +21 -0
  132. package/skills/pixerate-color/SKILL.md +69 -0
  133. package/skills/pixerate-diagram/SKILL.md +13 -0
  134. package/dist/chunk-45VRG4RB.js +0 -65
  135. package/dist/chunk-5FXOR7F2.cjs +0 -65
package/README.md CHANGED
@@ -477,7 +477,7 @@ Each module is also available as a subpath import:
477
477
  | `@pixerate/editor/agent` | MCP tool schemas, a planner for agent-driven canvas edits, and the dynamic `ToolRegistry` with editor/spreadsheet tool providers |
478
478
  | `@pixerate/editor/tools` | `ToolRegistry`, tool types, `validateJsonSchema` and the static MCP tool definitions, without TipTap or dagre (no third-party imports) |
479
479
  | `@pixerate/editor/commands` | `CommandRegistry`, `ShortcutMap`, palette ranking, `createCommandToolProvider` and built-in history / arrange / spreadsheet commands (no third-party imports) |
480
- | `@pixerate/editor/persistence` | Autosave and crash recovery (`createAutosaveController`, `createRecoveryPolicy`, `createRevisionTracker`), storage adapters (memory, localStorage, IndexedDB, OPFS) and document migration (`migrateDocument`, `loadSections`, `LoadReport`) (no third-party imports) |
480
+ | `@pixerate/editor/persistence` | Autosave and crash recovery (`createAutosaveController`, `createRecoveryPolicy`, `createRevisionTracker`), storage adapters (memory, localStorage, IndexedDB, OPFS), document migration (`migrateDocument`, `loadSections`, `LoadReport`), and the editor document contract: `EditorDocument` / `defineEditorDocument`, files (`serializeEditorDocument`, `parseEditorDocument`), `createEditorAutosave`, named saves (`createEditorDocumentStore`) and the shared agent tools (`createDocumentToolProvider`) (no third-party imports) |
481
481
  | `@pixerate/editor/generation` | Model capability descriptors, `planGenerationRequest`, `capabilitiesToJsonSchema`, `createGenerationToolProvider`, provenance, `createBatchResolver` and job-progress estimates (no third-party imports) |
482
482
  | `@pixerate/editor/compare` | `diffSequences` (Myers + patience), `compareDocuments` and `compareHtml`: two versions of a document as tracked changes (also re-exported from the root entry) |
483
483
  | `@pixerate/editor/export` | Word export: `exportDocx`, `exportDocxBlob`, `createDocxParts`, `DocxExportController`, plus the zip writer and XML escapers it uses (no third-party imports; also re-exported from the root entry) |
@@ -485,8 +485,10 @@ Each module is also available as a subpath import:
485
485
  | `@pixerate/editor/vector` | Headless vector editor: `VectorDocument` (Bézier paths with corner / smooth / symmetric anchors, groups, gradients), `VectorEditorController` (select, direct select, pen, pencil and shape tools driven by pointer / key events; transforms, booleans, align, group, undo, viewport), scene and overlay render data, DOM-free `parseVectorSvg` / `vectorDocumentToSvg` and `createVectorCommands` for agents (no third-party imports; see [the vector editor guide](../../docs/vector-editor.md)) |
486
486
  | `@pixerate/editor/chart` | Headless chart editor: `ChartSpec` (bar, line, area, scatter, pie, donut, combos, stacking) with `normalizeChartSpec`, the DOM-free `layoutChart` scene (drawing primitives with click targets), `ChartController` (data and presentation edits, selection, drag gestures, undo), `chartToSvg`, CSV / table import and `createChartCommands` for agents (no third-party imports; see [the chart editor guide](../../docs/chart-editor.md)) |
487
487
  | `@pixerate/editor/parameters` | Schema-driven parameters editor for effects, shaders, generators and component props: `ParameterSchema` (number, int, boolean, choice, color, vector, image and text fields; groups; `showIf`), `ParametersController` (validation, undo with merged slider gestures, reset, randomize, presets, keyframe hooks), `createParameterCommands` for agents and `parameterSchemaFromShaderControls` (no third-party imports) |
488
+ | `@pixerate/editor/color` | Shared colour module: parsing (hex, rgb, hsl, oklab, oklch, color(srgb/p3)), conversions, OKLCH gamut mapping, WCAG 2 contrast, Machado colour-vision deficiency simulation, harmonies, dual light/dark colours and CSS export, the headless colour picker model, recent colours, and agent tools (no third-party imports) |
489
+ | `@pixerate/editor/gradient` | Gradient data model, CSS gradient serialization/deserialization, `GradientController` with undo, stop & midpoint editing, and gradient agent tools (opt-in: `/color` never imports it) (no third-party imports) |
488
490
 
489
- The root entry (`@pixerate/editor`) re-exports everything except animation, canvas, agent, commands, persistence, generation, tokens, parameters, vector, chart and image editor, including TipTap. Import from the narrowest subpath you need: `grammar`, `history`, `animation`, `spreadsheet`, `commands`, `persistence` and `image-editor` have no third-party imports, so a spreadsheet-only app bundles no TipTap, markdown or dagre code. The package is marked `sideEffects: false`, so unused root exports are also tree-shaken.
491
+ The root entry (`@pixerate/editor`) re-exports everything except animation, canvas, agent, commands, persistence, generation, tokens, parameters, vector, chart, color, gradient and image editor, including TipTap. Import from the narrowest subpath you need: `grammar`, `history`, `animation`, `spreadsheet`, `commands`, `persistence`, `color`, `gradient` and `image-editor` have no third-party imports, so a spreadsheet-only app bundles no TipTap, markdown or dagre code. The package is marked `sideEffects: false`, so unused root exports are also tree-shaken.
490
492
 
491
493
  ## Keyframe animation without the canvas
492
494
 
@@ -45,7 +45,7 @@ reproduced at the end of this file. Paths are relative to each source repository
45
45
 
46
46
  - `crates/render/src/damage.rs` (drawing only what the view needs) → the approach of viewport culling in `getVectorSceneRenderData` (`packages/core/src/vector/render.ts`), through our spatial index; no code copied
47
47
  - `crates/tools/src/snap.rs` (`pass_dimensions`: a resized or created object's side matches another object's width or height in its own frame, nearest within the zone, when nothing else snapped on that axis) → `VectorSnapTargets.snapScale` / `matchSize` in `packages/core/src/vector/snap.ts`
48
- - `crates/color/src/cms/mod.rs` (`simulate_cvd`: Machado–Oliveira–Fernandes 2009 colour-vision matrices in linear RGB) → `simulateChartVision` and `checkChartColors` in `packages/core/src/chart/color.ts`
48
+ - `crates/color/src/cms/mod.rs` (`simulate_cvd`: Machado–Oliveira–Fernandes 2009 colour-vision matrices in linear RGB) → `simulateColorVision` and `checkPaletteColors` in `packages/core/src/color/vision.ts` (used by `simulateChartVision` and `checkChartColors` in `packages/core/src/chart/color.ts`)
49
49
  - `crates/mcp/src/tools.rs` (`key`: keys through the real keyboard path) → `press_chart_key` in `packages/core/src/chart/tools.ts`
50
50
  - `crates/render/src/fx.rs` (`draw_item_fx`, `inner_edge`, `split`, `outset`: drop shadow and outer glow as the blurred, grown silhouette under the object; inner shadow and inner glow as the offset inverse of the shape, blurred and clipped to it, over the object; feather as the object kept where its silhouette, inset by half the width and blurred by a quarter of it, is; spread / choke as growth instead of blur) → `vectorFilterSvg` in `packages/core/src/vector/filters.ts`; drawn as one SVG `<filter>` per node instead of offscreen layers, with a separate `spread` length instead of a percentage of the size, and satin, bevel and the directional / gradient feathers were not ported; test cases re-expressed → `packages/core/tests/vector-appearance.test.ts`
51
51
  - `crates/render/src/fx.rs` (an item's body drawn inside a clip layer of a shape, `push_clip_layer` … `pop_layer`, with its effects outside the clip) → `vectorMaskRenderData` in `packages/core/src/vector/mask.ts` and the masked groups of `packages/core/src/vector/render.ts` / `svg.ts`; drawn as an SVG `<clipPath>` / `<mask>` on an inner group, the group's filter on the outer one; test cases re-expressed → `packages/core/tests/vector-mask.test.ts`
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkFLUTRPLYcjs = require('../chunk-FLUTRPLY.cjs');
5
+ var _chunkTLMRGLQQcjs = require('../chunk-TLMRGLQQ.cjs');
6
6
 
7
7
 
8
8
  var _chunkGLQQ2VILcjs = require('../chunk-GLQQ2VIL.cjs');
@@ -113,15 +113,15 @@ var _chunkN2FGYZ4Qcjs = require('../chunk-N2FGYZ4Q.cjs');
113
113
 
114
114
 
115
115
 
116
- var _chunkL434J57Vcjs = require('../chunk-L434J57V.cjs');
116
+ var _chunk6QTON3VWcjs = require('../chunk-6QTON3VW.cjs');
117
117
 
118
118
 
119
- var _chunkXQ33O5BCcjs = require('../chunk-XQ33O5BC.cjs');
120
- require('../chunk-6HMEHNWW.cjs');
119
+ var _chunkX35BV5YTcjs = require('../chunk-X35BV5YT.cjs');
120
+ require('../chunk-XTU6QO2W.cjs');
121
121
 
122
122
 
123
123
 
124
- var _chunkUR37VCIRcjs = require('../chunk-UR37VCIR.cjs');
124
+ var _chunkI4AHLP7Fcjs = require('../chunk-I4AHLP7F.cjs');
125
125
 
126
126
 
127
127
 
@@ -158,6 +158,8 @@ var _chunkUJGAA6AKcjs = require('../chunk-UJGAA6AK.cjs');
158
158
 
159
159
  var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
160
160
  require('../chunk-FJ2MSI43.cjs');
161
+ require('../chunk-UKCJ43YL.cjs');
162
+ require('../chunk-IPJ3TEYR.cjs');
161
163
 
162
164
  // src/agent/planner.ts
163
165
  function normalizeSide(side) {
@@ -618,14 +620,14 @@ var SIZE_WIDTH = {
618
620
  };
619
621
  var SIZE_HEIGHT = { type: "number", minimum: 50, maximum: 4096, description: "Height in pixels (default 320)." };
620
622
  var SPEC_PROPERTIES = {
621
- ..._chunkFLUTRPLYcjs.CHART_UPDATE_PROPERTIES,
623
+ ..._chunkTLMRGLQQcjs.CHART_UPDATE_PROPERTIES,
622
624
  categories: { type: "array", items: { type: "string" }, description: "Category labels in order (x axis labels, or pie slices)." },
623
625
  series: {
624
626
  type: "array",
625
627
  description: "The series, each with one value per category (padded with gaps).",
626
628
  items: {
627
629
  type: "object",
628
- properties: { id: { type: "string", description: "Stable id (default: from the name)." }, ..._chunkFLUTRPLYcjs.SERIES_PROPS },
630
+ properties: { id: { type: "string", description: "Stable id (default: from the name)." }, ..._chunkTLMRGLQQcjs.SERIES_PROPS },
629
631
  required: ["name", "values"],
630
632
  additionalProperties: false
631
633
  }
@@ -636,7 +638,7 @@ function cleanSeries(series) {
636
638
  return series.map((s) => s && typeof s === "object" ? Object.fromEntries(Object.entries(s).filter(([, v]) => v !== null)) : s);
637
639
  }
638
640
  function checkedSpec(input) {
639
- const { spec, issues } = _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, { ...input, ...input.series !== void 0 ? { series: cleanSeries(input.series) } : {} });
641
+ const { spec, issues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, { ...input, ...input.series !== void 0 ? { series: cleanSeries(input.series) } : {} });
640
642
  if (issues.length) throw new Error(`The chart was not changed: ${issues.map((i) => i.message).join(" ")}`);
641
643
  return spec;
642
644
  }
@@ -651,14 +653,14 @@ function describe(chart, includeSpec) {
651
653
  series: spec.series.map((s) => ({ id: s.id, name: s.name })),
652
654
  width: _nullishCoalesce(node.attrs.width, () => ( null)),
653
655
  height: node.attrs.height,
654
- description: _chunkXQ33O5BCcjs.describeChart.call(void 0, spec),
656
+ description: _chunkX35BV5YTcjs.describeChart.call(void 0, spec),
655
657
  ...includeSpec ? { spec } : {}
656
658
  };
657
659
  }
658
660
  function sparklines(doc) {
659
661
  const found = [];
660
662
  doc.descendants((node, pos) => {
661
- if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkL434J57Vcjs.sparklineLabel.call(void 0, node) });
663
+ if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunk6QTON3VWcjs.sparklineLabel.call(void 0, node) });
662
664
  });
663
665
  return found;
664
666
  }
@@ -669,7 +671,7 @@ function checkPosition(editor, at) {
669
671
  function createDocumentChartTools(editor) {
670
672
  const chartType = () => editor().schema.nodes.chart;
671
673
  const findChart = (args) => {
672
- const charts = _chunkL434J57Vcjs.getDocumentCharts.call(void 0, editor().state.doc);
674
+ const charts = _chunk6QTON3VWcjs.getDocumentCharts.call(void 0, editor().state.doc);
673
675
  const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
674
676
  if (args.chartId !== void 0) {
675
677
  const chart = charts.find((c) => c.id === args.chartId);
@@ -696,7 +698,7 @@ function createDocumentChartTools(editor) {
696
698
  annotations: { title: "List charts in the document", ...READ },
697
699
  handler: ({ includeSpec = false }) => {
698
700
  const doc = editor().state.doc;
699
- return { charts: _chunkL434J57Vcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
701
+ return { charts: _chunk6QTON3VWcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
700
702
  }
701
703
  };
702
704
  const insertChart = {
@@ -723,7 +725,7 @@ function createDocumentChartTools(editor) {
723
725
  const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
724
726
  const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
725
727
  const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
726
- const chart = _chunkL434J57Vcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
728
+ const chart = _chunk6QTON3VWcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
727
729
  if (!ok || !chart) throw new Error(`A chart cannot go at ${_nullishCoalesce(at, () => ( ed.state.selection.from))}; pass a position between blocks or inside a paragraph.`);
728
730
  return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
729
731
  }
@@ -770,8 +772,8 @@ function createDocumentChartTools(editor) {
770
772
  inputSchema: {
771
773
  type: "object",
772
774
  properties: {
773
- values: { type: "array", items: _chunkFLUTRPLYcjs.VALUE, minItems: 1, maxItems: _chunkL434J57Vcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
774
- kind: { type: "string", enum: [..._chunkL434J57Vcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
775
+ values: { type: "array", items: _chunkTLMRGLQQcjs.VALUE, minItems: 1, maxItems: _chunk6QTON3VWcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
776
+ kind: { type: "string", enum: [..._chunk6QTON3VWcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
775
777
  at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
776
778
  width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
777
779
  height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
@@ -785,12 +787,12 @@ function createDocumentChartTools(editor) {
785
787
  handler: ({ values, kind = "line", at, width = 80, height = 18, color = null, label = null }) => {
786
788
  const ed = editor();
787
789
  checkPosition(ed, at);
788
- const parsed = values.map((v) => _chunkUR37VCIRcjs.parseChartValue.call(void 0, v));
790
+ const parsed = values.map((v) => _chunkI4AHLP7Fcjs.parseChartValue.call(void 0, v));
789
791
  const bad = parsed.findIndex((v) => v === void 0);
790
792
  if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
791
793
  const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
792
794
  if (!ed.state.doc.resolve(pos).parent.inlineContent) throw new Error(`Position ${pos} is between blocks; a sparkline goes inside a paragraph (use a position from get_text {blocks: true}).`);
793
- const stored = _chunkL434J57Vcjs.normalizeSparklineValues.call(void 0, parsed);
795
+ const stored = _chunk6QTON3VWcjs.normalizeSparklineValues.call(void 0, parsed);
794
796
  ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
795
797
  return { pos, kind, values: stored };
796
798
  }
@@ -1128,8 +1130,8 @@ function createTextPresence(editor, providerId, option) {
1128
1130
  const config = option === false ? null : option === true || option === void 0 ? {} : option;
1129
1131
  const caret = {
1130
1132
  id: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _43 => _43.id]), () => ( providerId)),
1131
- name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _44 => _44.name]), () => ( _chunkL434J57Vcjs.DEFAULT_AGENT_CARET_NAME)),
1132
- color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _45 => _45.color]), () => ( _chunkL434J57Vcjs.DEFAULT_AGENT_CARET_COLOR))
1133
+ name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _44 => _44.name]), () => ( _chunk6QTON3VWcjs.DEFAULT_AGENT_CARET_NAME)),
1134
+ color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _45 => _45.color]), () => ( _chunk6QTON3VWcjs.DEFAULT_AGENT_CARET_COLOR))
1133
1135
  };
1134
1136
  const typing = !_optionalChain([config, 'optionalAccess', _46 => _46.typing]) ? null : config.typing === true ? {} : config.typing;
1135
1137
  const idleMs = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _47 => _47.idleMs]), () => ( 12e3));
@@ -1142,19 +1144,19 @@ function createTextPresence(editor, providerId, option) {
1142
1144
  };
1143
1145
  const touch = () => {
1144
1146
  clearTimeout(idleTimer);
1145
- if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkL434J57Vcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
1147
+ if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunk6QTON3VWcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
1146
1148
  };
1147
1149
  const tint = (ed, ranges) => {
1148
1150
  clearTimeout(tintTimer);
1149
- _chunkL434J57Vcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
1150
- if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkL434J57Vcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1151
+ _chunk6QTON3VWcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
1152
+ if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunk6QTON3VWcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1151
1153
  };
1152
1154
  return {
1153
1155
  /** Puts the caret at `head`, selecting from `anchor`. */
1154
1156
  show(anchor, head = anchor) {
1155
1157
  const ed = live();
1156
1158
  if (!ed) return;
1157
- _chunkL434J57Vcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
1159
+ _chunk6QTON3VWcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
1158
1160
  touch();
1159
1161
  },
1160
1162
  /** Shows the caret after ranges just changed by a tool, tinting them. */
@@ -1162,7 +1164,7 @@ function createTextPresence(editor, providerId, option) {
1162
1164
  const ed = live();
1163
1165
  if (!ed || !ranges.length) return;
1164
1166
  const last = ranges[ranges.length - 1];
1165
- _chunkL434J57Vcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
1167
+ _chunk6QTON3VWcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
1166
1168
  tint(ed, ranges);
1167
1169
  touch();
1168
1170
  },
@@ -1170,12 +1172,12 @@ function createTextPresence(editor, providerId, option) {
1170
1172
  async write(ed, from, to, text, signal) {
1171
1173
  if (live() && typing) {
1172
1174
  clearTimeout(tintTimer);
1173
- const range2 = await _chunkL434J57Vcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
1174
- if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkL434J57Vcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1175
+ const range2 = await _chunk6QTON3VWcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
1176
+ if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunk6QTON3VWcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1175
1177
  touch();
1176
1178
  return range2;
1177
1179
  }
1178
- const tr = _history.closeHistory.call(void 0, _chunkL434J57Vcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text));
1180
+ const tr = _history.closeHistory.call(void 0, _chunk6QTON3VWcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text));
1179
1181
  const end = tr.mapping.map(to, 1);
1180
1182
  const range = { from: Math.min(tr.mapping.map(from, -1), end), to: end };
1181
1183
  ed.view.dispatch(tr.scrollIntoView());
@@ -1204,7 +1206,7 @@ function findMatches(editor, query, args, replacement) {
1204
1206
  wholeWord: !!args.wholeWord,
1205
1207
  ...args.regex ? { regex: true } : { literal: true }
1206
1208
  };
1207
- const result = _chunkL434J57Vcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
1209
+ const result = _chunk6QTON3VWcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
1208
1210
  if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
1209
1211
  return { matches: result.matches, truncated: result.truncated };
1210
1212
  }
@@ -1366,7 +1368,7 @@ function createRichTextToolProvider(target, options) {
1366
1368
  replacement: String(replace).replace(/\r\n?|\n/g, "\r")
1367
1369
  }));
1368
1370
  const tr = _history.closeHistory.call(void 0, ed.state.tr);
1369
- const ends = _chunkL434J57Vcjs.applyReplacements.call(void 0, tr, chosen);
1371
+ const ends = _chunk6QTON3VWcjs.applyReplacements.call(void 0, tr, chosen);
1370
1372
  ed.view.dispatch(tr.scrollIntoView());
1371
1373
  const ranges = chosen.map((m, i) => ({ from: tr.mapping.map(m.from, -1), to: ends[i] }));
1372
1374
  presence.changed(ranges.filter((r) => r.from < r.to));
@@ -1467,7 +1469,7 @@ function createRichTextToolProvider(target, options) {
1467
1469
  inputSchema: {
1468
1470
  type: "object",
1469
1471
  properties: {
1470
- operation: { type: "string", enum: _chunkL434J57Vcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
1472
+ operation: { type: "string", enum: _chunk6QTON3VWcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
1471
1473
  at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
1472
1474
  rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
1473
1475
  cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
@@ -1497,10 +1499,10 @@ function createRichTextToolProvider(target, options) {
1497
1499
  ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
1498
1500
  }
1499
1501
  const action = operation;
1500
- const state = _chunkL434J57Vcjs.getTableActionState.call(void 0, ed, action, params);
1502
+ const state = _chunk6QTON3VWcjs.getTableActionState.call(void 0, ed, action, params);
1501
1503
  if (state !== true) throw new Error(state);
1502
- _chunkL434J57Vcjs.runTableAction.call(void 0, ed, action, params);
1503
- const table = _chunkL434J57Vcjs.getTableState.call(void 0, ed);
1504
+ _chunk6QTON3VWcjs.runTableAction.call(void 0, ed, action, params);
1505
+ const table = _chunk6QTON3VWcjs.getTableState.call(void 0, ed);
1504
1506
  return {
1505
1507
  operation,
1506
1508
  table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
@@ -1519,7 +1521,7 @@ function createRichTextToolProvider(target, options) {
1519
1521
  if (!ed || ed.isDestroyed) return [];
1520
1522
  if (!ed.isEditable) return [getText, findText, ...charts.read()];
1521
1523
  const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection, ...formatting.tools(ed)];
1522
- return [...tools, ..._chunkL434J57Vcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write().map(withCaret)];
1524
+ return [...tools, ..._chunk6QTON3VWcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write().map(withCaret)];
1523
1525
  },
1524
1526
  subscribe: (notify) => {
1525
1527
  const ed = editor();
@@ -2,7 +2,7 @@ import {
2
2
  CHART_UPDATE_PROPERTIES,
3
3
  SERIES_PROPS,
4
4
  VALUE
5
- } from "../chunk-ALUWD3FG.js";
5
+ } from "../chunk-EIUTJPEL.js";
6
6
  import {
7
7
  hasVariantCommands
8
8
  } from "../chunk-3TNA7JKI.js";
@@ -113,15 +113,15 @@ import {
113
113
  setAgentCaret,
114
114
  sparklineLabel,
115
115
  typeAgentText
116
- } from "../chunk-6GAYGQDC.js";
116
+ } from "../chunk-O5ML2I6O.js";
117
117
  import {
118
118
  describeChart
119
- } from "../chunk-KI2VBONS.js";
120
- import "../chunk-YM75DN54.js";
119
+ } from "../chunk-OET45HIR.js";
120
+ import "../chunk-DSZCDNTM.js";
121
121
  import {
122
122
  normalizeChartSpec,
123
123
  parseChartValue
124
- } from "../chunk-RN767PO6.js";
124
+ } from "../chunk-SUVZJ2CP.js";
125
125
  import {
126
126
  getEditorMarkdown,
127
127
  getEditorText
@@ -158,6 +158,8 @@ import {
158
158
  validateJsonSchema
159
159
  } from "../chunk-V2ZCJRDM.js";
160
160
  import "../chunk-RNSANXPT.js";
161
+ import "../chunk-AA34BA7G.js";
162
+ import "../chunk-6ONMQ6WF.js";
161
163
 
162
164
  // src/agent/planner.ts
163
165
  function normalizeSide(side) {
@@ -26,7 +26,7 @@ var _chunk7B5GTJXBcjs = require('../chunk-7B5GTJXB.cjs');
26
26
 
27
27
 
28
28
 
29
- var _chunkUUTTJK77cjs = require('../chunk-UUTTJK77.cjs');
29
+ var _chunkSUF6WRXRcjs = require('../chunk-SUF6WRXR.cjs');
30
30
 
31
31
 
32
32
 
@@ -51,8 +51,10 @@ var _chunkDWJJI6RTcjs = require('../chunk-DWJJI6RT.cjs');
51
51
 
52
52
 
53
53
 
54
- var _chunk5FXOR7F2cjs = require('../chunk-5FXOR7F2.cjs');
54
+ var _chunkLEUZ4FRCcjs = require('../chunk-LEUZ4FRC.cjs');
55
55
  require('../chunk-A6QWKBJP.cjs');
56
+ require('../chunk-UKCJ43YL.cjs');
57
+ require('../chunk-IPJ3TEYR.cjs');
56
58
 
57
59
 
58
60
 
@@ -98,4 +100,4 @@ require('../chunk-A6QWKBJP.cjs');
98
100
 
99
101
 
100
102
 
101
- exports.ANIMATION_EASING_LABELS = _chunkDWJJI6RTcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkDWJJI6RTcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkUUTTJK77cjs.ANIMATION_TIME_EPSILON; exports.AnimationPlayer = _chunkUUTTJK77cjs.AnimationPlayer; exports.CUBIC_BEZIER_PRESETS = _chunkDWJJI6RTcjs.CUBIC_BEZIER_PRESETS; exports.MOTION_BEHAVIORS = _chunk7B5GTJXBcjs.MOTION_BEHAVIORS; exports.ManualClock = _chunkUUTTJK77cjs.ManualClock; exports.PRESENCE_COLORS = _chunkUJGAA6AKcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkUJGAA6AKcjs.PerformanceQueue; exports.PresenceStore = _chunkUJGAA6AKcjs.PresenceStore; exports.SPRING_PRESETS = _chunkDWJJI6RTcjs.SPRING_PRESETS; exports.behaviorProgress = _chunk7B5GTJXBcjs.behaviorProgress; exports.createAnimationPlayer = _chunkUUTTJK77cjs.createAnimationPlayer; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.cubicBezierAt = _chunkDWJJI6RTcjs.cubicBezierAt; exports.easingFromInfluence = _chunkDWJJI6RTcjs.easingFromInfluence; exports.easingLabel = _chunkDWJJI6RTcjs.easingLabel; exports.easingToCss = _chunkDWJJI6RTcjs.easingToCss; exports.elasticAt = _chunkDWJJI6RTcjs.elasticAt; exports.evaluateEasing = _chunkDWJJI6RTcjs.evaluateEasing; exports.evaluateTrack = _chunkUUTTJK77cjs.evaluateTrack; exports.formatOklab = _chunk5FXOR7F2cjs.formatOklab; exports.fractalWiggle = _chunk7B5GTJXBcjs.fractalWiggle; exports.interpolateAnimationValue = _chunkUUTTJK77cjs.interpolateAnimationValue; exports.isAnimationEasing = _chunkDWJJI6RTcjs.isAnimationEasing; exports.isAnimationKeyframe = _chunkUUTTJK77cjs.isAnimationKeyframe; exports.isMotionBehavior = _chunk7B5GTJXBcjs.isMotionBehavior; exports.mixColorsOklab = _chunk5FXOR7F2cjs.mixColorsOklab; exports.motionSeedFromId = _chunk7B5GTJXBcjs.motionSeedFromId; exports.normalizeKeyframes = _chunkUUTTJK77cjs.normalizeKeyframes; exports.oklabToRgb = _chunk5FXOR7F2cjs.oklabToRgb; exports.pageHidden = _chunkUUTTJK77cjs.pageHidden; exports.parseCssEasing = _chunkDWJJI6RTcjs.parseCssEasing; exports.parseOklab = _chunk5FXOR7F2cjs.parseOklab; exports.quinticFade = _chunk7B5GTJXBcjs.quinticFade; exports.realClock = _chunkUUTTJK77cjs.realClock; exports.realPresenceClock = _chunkUJGAA6AKcjs.realPresenceClock; exports.resolveEasing = _chunkDWJJI6RTcjs.resolveEasing; exports.reverseCubicBezier = _chunkDWJJI6RTcjs.reverseCubicBezier; exports.rgbToOklab = _chunk5FXOR7F2cjs.rgbToOklab; exports.springAt = _chunkDWJJI6RTcjs.springAt; exports.springSettleMs = _chunkDWJJI6RTcjs.springSettleMs; exports.tweenPresenceCursor = _chunkUJGAA6AKcjs.tweenPresenceCursor; exports.wrapAnimationTime = _chunkUUTTJK77cjs.wrapAnimationTime;
103
+ exports.ANIMATION_EASING_LABELS = _chunkDWJJI6RTcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkDWJJI6RTcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkSUF6WRXRcjs.ANIMATION_TIME_EPSILON; exports.AnimationPlayer = _chunkSUF6WRXRcjs.AnimationPlayer; exports.CUBIC_BEZIER_PRESETS = _chunkDWJJI6RTcjs.CUBIC_BEZIER_PRESETS; exports.MOTION_BEHAVIORS = _chunk7B5GTJXBcjs.MOTION_BEHAVIORS; exports.ManualClock = _chunkSUF6WRXRcjs.ManualClock; exports.PRESENCE_COLORS = _chunkUJGAA6AKcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkUJGAA6AKcjs.PerformanceQueue; exports.PresenceStore = _chunkUJGAA6AKcjs.PresenceStore; exports.SPRING_PRESETS = _chunkDWJJI6RTcjs.SPRING_PRESETS; exports.behaviorProgress = _chunk7B5GTJXBcjs.behaviorProgress; exports.createAnimationPlayer = _chunkSUF6WRXRcjs.createAnimationPlayer; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.cubicBezierAt = _chunkDWJJI6RTcjs.cubicBezierAt; exports.easingFromInfluence = _chunkDWJJI6RTcjs.easingFromInfluence; exports.easingLabel = _chunkDWJJI6RTcjs.easingLabel; exports.easingToCss = _chunkDWJJI6RTcjs.easingToCss; exports.elasticAt = _chunkDWJJI6RTcjs.elasticAt; exports.evaluateEasing = _chunkDWJJI6RTcjs.evaluateEasing; exports.evaluateTrack = _chunkSUF6WRXRcjs.evaluateTrack; exports.formatOklab = _chunkLEUZ4FRCcjs.formatOklab; exports.fractalWiggle = _chunk7B5GTJXBcjs.fractalWiggle; exports.interpolateAnimationValue = _chunkSUF6WRXRcjs.interpolateAnimationValue; exports.isAnimationEasing = _chunkDWJJI6RTcjs.isAnimationEasing; exports.isAnimationKeyframe = _chunkSUF6WRXRcjs.isAnimationKeyframe; exports.isMotionBehavior = _chunk7B5GTJXBcjs.isMotionBehavior; exports.mixColorsOklab = _chunkLEUZ4FRCcjs.mixColorsOklab; exports.motionSeedFromId = _chunk7B5GTJXBcjs.motionSeedFromId; exports.normalizeKeyframes = _chunkSUF6WRXRcjs.normalizeKeyframes; exports.oklabToRgb = _chunkLEUZ4FRCcjs.oklabToRgb; exports.pageHidden = _chunkSUF6WRXRcjs.pageHidden; exports.parseCssEasing = _chunkDWJJI6RTcjs.parseCssEasing; exports.parseOklab = _chunkLEUZ4FRCcjs.parseOklab; exports.quinticFade = _chunk7B5GTJXBcjs.quinticFade; exports.realClock = _chunkSUF6WRXRcjs.realClock; exports.realPresenceClock = _chunkUJGAA6AKcjs.realPresenceClock; exports.resolveEasing = _chunkDWJJI6RTcjs.resolveEasing; exports.reverseCubicBezier = _chunkDWJJI6RTcjs.reverseCubicBezier; exports.rgbToOklab = _chunkLEUZ4FRCcjs.rgbToOklab; exports.springAt = _chunkDWJJI6RTcjs.springAt; exports.springSettleMs = _chunkDWJJI6RTcjs.springSettleMs; exports.tweenPresenceCursor = _chunkUJGAA6AKcjs.tweenPresenceCursor; exports.wrapAnimationTime = _chunkSUF6WRXRcjs.wrapAnimationTime;
@@ -26,7 +26,7 @@ import {
26
26
  pageHidden,
27
27
  realClock,
28
28
  wrapAnimationTime
29
- } from "../chunk-QX25HWFL.js";
29
+ } from "../chunk-AY65VQSU.js";
30
30
  import {
31
31
  ANIMATION_EASING_LABELS,
32
32
  ANIMATION_EASING_PRESETS,
@@ -51,8 +51,10 @@ import {
51
51
  oklabToRgb,
52
52
  parseOklab,
53
53
  rgbToOklab
54
- } from "../chunk-45VRG4RB.js";
54
+ } from "../chunk-KY3FYKP3.js";
55
55
  import "../chunk-2WPNAGHI.js";
56
+ import "../chunk-AA34BA7G.js";
57
+ import "../chunk-6ONMQ6WF.js";
56
58
  export {
57
59
  ANIMATION_EASING_LABELS,
58
60
  ANIMATION_EASING_PRESETS,