@pixerate/editor 0.46.1 → 0.48.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 (98) hide show
  1. package/THIRD_PARTY_NOTICES.md +20 -0
  2. package/dist/agent/index.cjs +252 -34
  3. package/dist/agent/index.cjs.map +1 -1
  4. package/dist/agent/index.d.cts +19 -7
  5. package/dist/agent/index.d.ts +19 -7
  6. package/dist/agent/index.js +228 -10
  7. package/dist/agent/index.js.map +1 -1
  8. package/dist/{builtins-CZW-aYKS.d.cts → builtins-1kqwLUnb.d.cts} +2 -2
  9. package/dist/{builtins-DghNQbT-.d.ts → builtins-BKYlHH1s.d.ts} +2 -2
  10. package/dist/chart/index.cjs +1596 -1849
  11. package/dist/chart/index.cjs.map +1 -1
  12. package/dist/chart/index.d.cts +760 -548
  13. package/dist/chart/index.d.ts +760 -548
  14. package/dist/chart/index.js +1499 -1752
  15. package/dist/chart/index.js.map +1 -1
  16. package/dist/{chunk-3RPOW4CS.js → chunk-2CJ3LPYQ.js} +12 -10
  17. package/dist/{chunk-3RPOW4CS.js.map → chunk-2CJ3LPYQ.js.map} +1 -1
  18. package/dist/{chunk-PQM5W7ZN.js → chunk-4FX5ACVG.js} +29 -2
  19. package/dist/{chunk-PQM5W7ZN.js.map → chunk-4FX5ACVG.js.map} +1 -1
  20. package/dist/{chunk-HHQ4XJWT.js → chunk-AMWXSYCI.js} +2 -2
  21. package/dist/chunk-EKYHKQPG.js +1895 -0
  22. package/dist/chunk-EKYHKQPG.js.map +1 -0
  23. package/dist/chunk-HXUL3LS7.js +113 -0
  24. package/dist/chunk-HXUL3LS7.js.map +1 -0
  25. package/dist/{chunk-ZRNHGAQT.js → chunk-JQ3BB3E6.js} +43 -1891
  26. package/dist/chunk-JQ3BB3E6.js.map +1 -0
  27. package/dist/chunk-LTUM52X6.js +4074 -0
  28. package/dist/chunk-LTUM52X6.js.map +1 -0
  29. package/dist/{chunk-J3R2OWOE.cjs → chunk-MUCYWI6W.cjs} +608 -15
  30. package/dist/chunk-MUCYWI6W.cjs.map +1 -0
  31. package/dist/chunk-PIMCHMZE.cjs +521 -0
  32. package/dist/chunk-PIMCHMZE.cjs.map +1 -0
  33. package/dist/{chunk-TK2XZK6Z.js → chunk-PKBWLEL7.js} +594 -1
  34. package/dist/chunk-PKBWLEL7.js.map +1 -0
  35. package/dist/chunk-PRSJJZBS.cjs +4074 -0
  36. package/dist/chunk-PRSJJZBS.cjs.map +1 -0
  37. package/dist/{chunk-EFDCLENW.cjs → chunk-RIWPYSKU.cjs} +29 -2
  38. package/dist/chunk-RIWPYSKU.cjs.map +1 -0
  39. package/dist/chunk-U6IZKC7B.cjs +113 -0
  40. package/dist/chunk-U6IZKC7B.cjs.map +1 -0
  41. package/dist/{chunk-EWCOFSCQ.cjs → chunk-UN33YOXW.cjs} +252 -2100
  42. package/dist/chunk-UN33YOXW.cjs.map +1 -0
  43. package/dist/{chunk-Q25ZS4F7.js → chunk-VKPEPWKZ.js} +72 -92
  44. package/dist/chunk-VKPEPWKZ.js.map +1 -0
  45. package/dist/{chunk-N4MLNJPO.cjs → chunk-WXEHCVJQ.cjs} +160 -180
  46. package/dist/chunk-WXEHCVJQ.cjs.map +1 -0
  47. package/dist/{chunk-K2LVZ4FA.cjs → chunk-XFYUFVAX.cjs} +3 -3
  48. package/dist/{chunk-K2LVZ4FA.cjs.map → chunk-XFYUFVAX.cjs.map} +1 -1
  49. package/dist/chunk-XP5IUZUO.cjs +1895 -0
  50. package/dist/chunk-XP5IUZUO.cjs.map +1 -0
  51. package/dist/chunk-XUUD43OV.js +521 -0
  52. package/dist/chunk-XUUD43OV.js.map +1 -0
  53. package/dist/{chunk-U7VGDSNY.cjs → chunk-YU4WQE5M.cjs} +101 -99
  54. package/dist/chunk-YU4WQE5M.cjs.map +1 -0
  55. package/dist/commands/index.cjs +93 -11
  56. package/dist/commands/index.cjs.map +1 -1
  57. package/dist/commands/index.d.cts +9 -7
  58. package/dist/commands/index.d.ts +9 -7
  59. package/dist/commands/index.js +92 -10
  60. package/dist/commands/index.js.map +1 -1
  61. package/dist/controller-ChjCCMLl.d.cts +822 -0
  62. package/dist/controller-DtbEo3om.d.ts +822 -0
  63. package/dist/extensions/index.cjs +32 -3
  64. package/dist/extensions/index.cjs.map +1 -1
  65. package/dist/extensions/index.d.cts +5 -2
  66. package/dist/extensions/index.d.ts +5 -2
  67. package/dist/extensions/index.js +31 -2
  68. package/dist/generation/index.cjs +2 -2
  69. package/dist/generation/index.js +1 -1
  70. package/dist/{index-CfOQf70b.d.cts → index-DoHqT1mq.d.cts} +222 -5
  71. package/dist/{index-jwJ_onWf.d.ts → index-YLZ0fKqE.d.ts} +222 -5
  72. package/dist/index.cjs +38 -10
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.cts +13 -5
  75. package/dist/index.d.ts +13 -5
  76. package/dist/index.js +52 -24
  77. package/dist/index.js.map +1 -1
  78. package/dist/parameters/index.d.cts +1 -1
  79. package/dist/parameters/index.d.ts +1 -1
  80. package/dist/{registry-vz6HOiiy.d.cts → registry-CaR7LC6W.d.cts} +2 -0
  81. package/dist/{registry-BfVD-vVg.d.ts → registry-rVtFJjRM.d.ts} +2 -0
  82. package/dist/spreadsheet/index.cjs +5 -3
  83. package/dist/spreadsheet/index.cjs.map +1 -1
  84. package/dist/spreadsheet/index.js +24 -22
  85. package/dist/tools/index.cjs +3 -3
  86. package/dist/tools/index.js +2 -2
  87. package/dist/vector/index.d.cts +1 -1
  88. package/dist/vector/index.d.ts +1 -1
  89. package/package.json +2 -1
  90. package/dist/chunk-EFDCLENW.cjs.map +0 -1
  91. package/dist/chunk-EWCOFSCQ.cjs.map +0 -1
  92. package/dist/chunk-J3R2OWOE.cjs.map +0 -1
  93. package/dist/chunk-N4MLNJPO.cjs.map +0 -1
  94. package/dist/chunk-Q25ZS4F7.js.map +0 -1
  95. package/dist/chunk-TK2XZK6Z.js.map +0 -1
  96. package/dist/chunk-U7VGDSNY.cjs.map +0 -1
  97. package/dist/chunk-ZRNHGAQT.js.map +0 -1
  98. /package/dist/{chunk-HHQ4XJWT.js.map → chunk-AMWXSYCI.js.map} +0 -0
@@ -30,12 +30,15 @@ reproduced at the end of this file. Paths are relative to each source repository
30
30
  © 2026 ArtCraft Team and the DeckCraft contributors.
31
31
 
32
32
  - `crates/geom/src/morph.rs` (`contours`: every segment as a cubic, lines with handles at thirds; `align`: contours paired in order, one without a partner meeting a point at the same place relative to the other outline's box (`place`); `turn`: a closed contour restarted at another anchor; `match_pair`: the closed side of a pair turned, open paired with closed) → `subpathToMorphContour`, `turnMorphContour` and `correspondMorphContours` in `packages/core/src/vector/blend.ts`; anchors are inserted by arc length rather than split evenly per curve, and the winding of closed shapes follows their areas (effectcraft) instead of a cost comparison; test cases re-expressed → `packages/core/tests/vector-blend.test.ts`
33
+ - `crates/pptx/src/read/chart.rs` (DrawingML chart reading: group → type mapping, secondary value axis by axis id and position rather than file order, cached and literal data, data-label number-format precedence, point fills) → `chartFromOoxml` in `packages/core/src/chart/ooxml.ts`
33
34
 
34
35
  ## designcraft
35
36
 
36
37
  © 2026 ArtCraft Team and the DesignCraft contributors.
37
38
 
38
39
  - `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`
40
+ - `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`
41
+ - `crates/mcp/src/tools.rs` (`key`: keys through the real keyboard path) → `press_chart_key` in `packages/core/src/chart/tools.ts`
39
42
 
40
43
  ## effectcraft
41
44
 
@@ -46,6 +49,7 @@ reproduced at the end of this file. Paths are relative to each source repository
46
49
  - `crates/path/src/ops.rs` (`trim` / `trim_individually` with `trim_intervals` and `Measured::append`: start / end percentages swapped when reversed, an offset in degrees wrapping round, a piece that starts where the last ended continuing it; `pucker_bloat`; `round_corners`; `offset` with copies at `amount · (i + 1 + copy_offset)`; `twist` with subdivided segments and handles mapped through the warp's derivative; `resample` and `emit` (corner bisectors, smooth handles as a fraction of the pieces); `zigzag`; `WiggleParams`, `splitmix`, `hash`, the Catmull-Rom `noise` and `wiggle`; `MergeMode` and `merge`) → `trimPaths`, `trimPathsIndividually`, `puckerBloatPaths`, `offsetPaths`, `twistPaths`, `zigzagPaths`, `wigglePaths` and `mergePaths` in `packages/core/src/vector/pathEffects.ts`; arc lengths come from our `segmentLength` / `trimSegments`, offsets from `offsetPath`, booleans from `pathBoolean`, and Round Corners (`roundCornerPaths`) uses our live-corner maths (a true radius) instead of the port's setback arc; the wiggle's time is a plain parameter; test cases from `crates/path/src/ops/tests.rs` re-expressed → `packages/core/tests/vector-effects.test.ts`
47
50
  - `crates/render/src/shapes.rs` (the module's stacking rule — an operator acts on every path above it in its group, nested groups included, and operators below a repeater act on its copies; the `"repeater"` branch of `collect()`: copy i transformed by `translate(position·k) · rotate(rotation·k) · scale^k` about the anchor with `k = i + offset`, opacity ramped from start to end, a fractional count fading the last copy, below / above composite order; Merge Paths painting with the paint below it) → `applyVectorEffects` / `vectorAppearanceShapes` in `packages/core/src/vector/appearance.ts` and `vectorRepeaterCopies` / `repeatPaths` in `packages/core/src/vector/pathEffects.ts`; effects live on path and group nodes rather than as items among paints, each shape painted in its source path's style (merged results in the bottom one's), and the repeater's anchor is an offset from the middle of the shapes' bounds
48
51
  - `crates/render/src/shapes.rs` (`GradientRamp::new` / `t`: a radial gradient's focal point and t measured along the ray from it to the circle, the same as SVG `fx` / `fy`) → `vectorGradientFocalParam` in `packages/core/src/vector/gradient.ts`, generalised to SVG's focal circle (`fr`); test cases re-expressed → `packages/core/tests/vector-gradient.test.ts`
52
+ - `crates/ui-egui/src/panels/graph.rs` and `graph_tools.rs` (value range frozen while a key is dragged, Shift locks to the axis moved most, `snap_px` nearest candidate within a few screen pixels) → `startChartPointDrag` and `snapChartDragValue` in `packages/core/src/chart/interaction.ts`
49
53
 
50
54
  ## figcraft
51
55
 
@@ -89,6 +93,9 @@ reproduced at the end of this file. Paths are relative to each source repository
89
93
  - `crates/project/src/keyframe.rs` (`Keyframe`, `Param::value_at` segment evaluation and hold, `set_at` inheriting the previous interpolation, `remove_keyframe_at` keeping the last value, `toggle_animation` keeping the value at a time, temporal influence easing, `cubic_bezier_y_for_x` Newton + bisection solver) → `packages/core/src/canvas/animation/{easing,model,evaluate,edit}.ts`
90
94
  - `crates/engine/src/keyframe_move.rs` (`move_many`: one common delta across lanes clamped to the movement range, remove-all-originals-then-insert, validation without partial edits, at most 4096 keys) → `moveKeyframes` / `scaleKeyframes` in `packages/core/src/canvas/animation/edit.ts`, keyframe drags in `packages/core/src/canvas/animation/controller.ts`
91
95
  - `crates/project/src/keyframe.rs` tests, `crates/engine/src/keyframe_move.rs` tests and `crates/ui-egui/tests/keyframes_ui.rs` (group move and undo as one step, snapping within a screen-space threshold, Escape cancelling a drag preview; test cases re-expressed) → `packages/core/tests/canvas-animation.test.ts`, `packages/react/tests/canvas-animation.test.tsx`, `packages/svelte/tests/canvas/canvas-animation.test.ts`
96
+ - `crates/ui-egui/src/panels/timeline.rs` (`ruler_steps`: the first step on a ladder that keeps labels apart) → `chartDateLabels` in `packages/core/src/chart/date.ts`, with calendar units
97
+ - `crates/scopes/src/summary.rs` (numeric summaries for agents that check visuals without looking) → `summarizeChart` in `packages/core/src/chart/summary.ts`
98
+ - `crates/golden` (committed reference renders with a regenerate mode) → `packages/core/tests/chart-golden.test.ts`
92
99
 
93
100
  ## gridcraft
94
101
 
@@ -113,6 +120,13 @@ reproduced at the end of this file. Paths are relative to each source repository
113
120
  `TEXT()` result) come from Apache POI's `test-data/spreadsheet/NumberFormatApproxTests.xlsx`, as collected in
114
121
  GridCraft. Apache POI is © The Apache Software Foundation, licensed under the Apache License, Version 2.0
115
122
  (https://www.apache.org/licenses/LICENSE-2.0).
123
+ - `crates/chart/src/trend.rs` (least-squares trendlines on transformed data, polynomial normal equations on centred / scaled x, Gaussian elimination, fixed intercept with uncentred R², equation text, moving average, legend names) → `packages/core/src/chart/trend.ts`; test cases re-expressed → `packages/core/tests/chart-features.test.ts`
124
+ - `crates/chart/src/render.rs` (`histogram` binning, `quantile` and `box_whisker`, `squarify` treemap, `waterfall`, `funnel`, `radar`, `decimate`, marker de-duplication, `clip_segment`, label colour by fill, legend height cap, `finalize`) → `packages/core/src/chart/stats.ts`, `layout-families.ts`, `layout-cartesian.ts` and `layout.ts`
125
+ - `crates/chart/src/resolve.rs` (palette tint cycle after the base colours) → `cyclePaletteColor` in `packages/core/src/chart/color.ts`
126
+ - `crates/chart/src/sparkline.rs` → `layoutSparkline` in `packages/core/src/chart/sparkline.ts`
127
+ - `crates/engine/src/cmd/insert.rs` (`series_from_range`, `scatter_x_from_first`, `recommend_charts`) → `packages/core/src/chart/recommend.ts`
128
+ - `crates/engine/src/cmd/extra.rs` (`chart.quickLayout`, `chart.changeColors`) → `packages/core/src/chart/presets.ts`
129
+ - `crates/xlsx/src/chartex.rs` (chartex parts for waterfall, funnel, treemap, histogram and box charts) → `chartFromOoxml` in `packages/core/src/chart/ooxml.ts`
116
130
 
117
131
  ## lightcraft
118
132
 
@@ -124,6 +138,8 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
124
138
  - `crates/pipeline/src/local.rs` (relative white balance with neutral-luminance normalisation) → `packages/core/src/image-editor/color.ts`
125
139
  - `crates/develop/src/settings.rs` and `docs/process-versions.md` (process version semantics) → `packages/core/src/image-editor/color.ts`
126
140
  - `crates/develop/src/controls.rs` (`ControlSpec` table: id, label, section, range, default, step, decimals, track style; clamping) → `packages/core/src/image-editor/controls.ts`
141
+ - `crates/ui-egui/src/tests_curve.rs` (Alt moves a point a tenth as far) → `ChartDragMoveOptions.fine` in `packages/core/src/chart/interaction.ts`
142
+ - `crates/mcp/src/tools.rs` (`pointer_gesture` in normalized coordinates) → `drag_chart_point` in `packages/core/src/chart/tools.ts`
127
143
 
128
144
  ## pdfcraft
129
145
 
@@ -205,6 +221,9 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
205
221
  - `crates/svg/src/import/spread.rs` (`expand`, `whole_period`, `mirror`: `reflect` and `repeat` emulated by repeating the stops over the periods the painted area needs, every other one mirrored for reflect, capped at 64) → `periodicVectorGradientStops` / `expandVectorGradientSpread` in `packages/core/src/vector/gradient.ts`, used where SVG has no spread mode for the style (reflected gradients that pad or repeat); import keeps `spreadMethod` as the gradient's `spread`; test cases re-expressed → `packages/core/tests/vector-gradient.test.ts`
206
222
  - `crates/effects/src/stroke/gradient.rs` (gradients along and across a stroke: ribs through the flattened path on the bisectors of gentle turns, square ribs and a fill in the corner's colour at sharp ones, slices between ribs painted with the part of the gradient between them — along — or from the stroke's left edge to its right — across — clipped to the stroke) → `vectorStrokeGradientDefs` in `packages/core/src/vector/gradientStroke.ts`, written as a `<pattern>` of slices the stroke paints through (no clip); a sharp corner gets one patch instead of a fan of ribs
207
223
  - `crates/tools/src/xform/gradient.rs` (the Gradient tool's annotator: a bar from the start to the end handle with stop chips below it and midpoint diamonds above, a radial's extent ellipse with its aspect handle and focal point; click the bar to add a stop, drag a stop along it or off it to delete it; Shift constrains the vector) → `packages/core/src/vector/gradientTool.ts` and the `gradient` tool in `packages/core/src/vector/controller.ts`
224
+ - `crates/mcp/src/tools.rs` (`command_batch`: `$N.path` result references, atomic batches with a label; `render_preview`) → `run_commands` in `packages/core/src/commands/agentTools.ts` and `render_chart` in `packages/core/src/chart/tools.ts`
225
+ - `crates/testkit/src/strategies.rs` and `invariants.rs` (random command sequences with junk values, invariants, undo-all / redo-all) → `packages/core/tests/chart-property.test.ts`
226
+ - `crates/svg/src/export.rs` (`<title>` and `<desc>` in exported SVG) → `chartSceneToSvg` in `packages/core/src/chart/svg.ts`
208
227
 
209
228
  ## wordcraft
210
229
 
@@ -230,6 +249,7 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
230
249
  - `crates/docx/src/read/mod.rs` (`read_comments`: comments keyed by the `w14:paraId` of their last paragraph, `commentEx` parents and `done`) and `crates/docx/src/read/story.rs` (tracked insertions, deletions and named move ranges) → `packages/core/src/import/docx.ts`
231
250
  - Test cases from `crates/docx/tests/privacy.rs` (`remove_personal_information_and_dates_on_save`: the two-commenter fixture, no names or initials in any part, "Author" / "A"), `crates/docx/tests/roundtrip.rs` and `crates/docx/tests/fixtures.rs` (comments, replies, tracked changes and moves surviving a save and reload), re-expressed → `packages/core/tests/docx-export.test.ts`
232
251
  - `crates/engine/src/cmd/ink_shape.rs` (`recognise`, `ellipse_rms`, `snap_square`, `corners`, `turning`, `rdp`, `upright`, `MIN_SIZE`, `MAX_CORNERS`) → `recognizeInkShape` in `packages/core/src/vector/ink.ts`; its test cases re-expressed → `packages/core/tests/vector-path-edit.test.ts`
252
+ - `crates/docx/src/chart_spec.rs` (a chart is editable only when it regenerates without loss) → `ChartOoxmlReadResult.lossless` and the DOCX chart import in `packages/core/src/import/docx.ts`
233
253
 
234
254
  ## MIT License
235
255
 
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
 
5
+ var _chunkU6IZKC7Bcjs = require('../chunk-U6IZKC7B.cjs');
5
6
 
6
7
 
7
8
 
@@ -27,13 +28,23 @@
27
28
 
28
29
 
29
30
 
30
- var _chunkK2LVZ4FAcjs = require('../chunk-K2LVZ4FA.cjs');
31
+
32
+
33
+
34
+
35
+ var _chunkXFYUFVAXcjs = require('../chunk-XFYUFVAX.cjs');
31
36
 
32
37
 
33
38
  var _chunkHXDMZQTDcjs = require('../chunk-HXDMZQTD.cjs');
34
39
 
35
40
 
36
- var _chunkEFDCLENWcjs = require('../chunk-EFDCLENW.cjs');
41
+ var _chunkRIWPYSKUcjs = require('../chunk-RIWPYSKU.cjs');
42
+
43
+
44
+
45
+
46
+
47
+
37
48
 
38
49
 
39
50
 
@@ -41,8 +52,12 @@ var _chunkEFDCLENWcjs = require('../chunk-EFDCLENW.cjs');
41
52
 
42
53
 
43
54
 
55
+ var _chunkMUCYWI6Wcjs = require('../chunk-MUCYWI6W.cjs');
44
56
 
45
- var _chunkJ3R2OWOEcjs = require('../chunk-J3R2OWOE.cjs');
57
+
58
+
59
+
60
+ var _chunkPRSJJZBScjs = require('../chunk-PRSJJZBS.cjs');
46
61
 
47
62
 
48
63
 
@@ -50,11 +65,14 @@ var _chunkJ3R2OWOEcjs = require('../chunk-J3R2OWOE.cjs');
50
65
  var _chunk66IMF6ODcjs = require('../chunk-66IMF6OD.cjs');
51
66
  require('../chunk-BVP3TSLH.cjs');
52
67
  require('../chunk-IFHKKVXH.cjs');
68
+ require('../chunk-UN33YOXW.cjs');
53
69
 
54
70
 
55
71
 
56
72
 
57
- var _chunkEWCOFSCQcjs = require('../chunk-EWCOFSCQ.cjs');
73
+ var _chunkXP5IUZUOcjs = require('../chunk-XP5IUZUO.cjs');
74
+ require('../chunk-TNNJXF46.cjs');
75
+ require('../chunk-QKLRAA4T.cjs');
58
76
 
59
77
 
60
78
 
@@ -386,6 +404,204 @@ function planToolCall(name, args, snapshot, options) {
386
404
 
387
405
  // src/agent/providers.ts
388
406
  var _state = require('@tiptap/pm/state');
407
+
408
+ // src/agent/documentChartTools.ts
409
+ var _history = require('@tiptap/pm/history');
410
+ var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
411
+ var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
412
+ var WRITE_IDEMPOTENT = { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false };
413
+ var SIZE_WIDTH = {
414
+ type: ["number", "null"],
415
+ minimum: 50,
416
+ maximum: 4096,
417
+ description: "Width in pixels, or null to fill the line (default null)."
418
+ };
419
+ var SIZE_HEIGHT = { type: "number", minimum: 50, maximum: 4096, description: "Height in pixels (default 320)." };
420
+ var SPEC_PROPERTIES = {
421
+ ..._chunkU6IZKC7Bcjs.CHART_UPDATE_PROPERTIES,
422
+ categories: { type: "array", items: { type: "string" }, description: "Category labels in order (x axis labels, or pie slices)." },
423
+ series: {
424
+ type: "array",
425
+ description: "The series, each with one value per category (padded with gaps).",
426
+ items: {
427
+ type: "object",
428
+ properties: { id: { type: "string", description: "Stable id (default: from the name)." }, ..._chunkU6IZKC7Bcjs.SERIES_PROPS },
429
+ required: ["name", "values"],
430
+ additionalProperties: false
431
+ }
432
+ }
433
+ };
434
+ function cleanSeries(series) {
435
+ if (!Array.isArray(series)) return series;
436
+ return series.map((s) => s && typeof s === "object" ? Object.fromEntries(Object.entries(s).filter(([, v]) => v !== null)) : s);
437
+ }
438
+ function checkedSpec(input) {
439
+ const { spec, issues } = _chunkPRSJJZBScjs.normalizeChartSpec.call(void 0, { ...input, ...input.series !== void 0 ? { series: cleanSeries(input.series) } : {} });
440
+ if (issues.length) throw new Error(`The chart was not changed: ${issues.map((i) => i.message).join(" ")}`);
441
+ return spec;
442
+ }
443
+ function describe(chart, includeSpec) {
444
+ const { spec, node } = chart;
445
+ return {
446
+ id: chart.id,
447
+ pos: chart.pos,
448
+ type: spec.type,
449
+ title: spec.title,
450
+ categories: spec.categories,
451
+ series: spec.series.map((s) => ({ id: s.id, name: s.name })),
452
+ width: _nullishCoalesce(node.attrs.width, () => ( null)),
453
+ height: node.attrs.height,
454
+ description: _chunkPRSJJZBScjs.describeChart.call(void 0, spec),
455
+ ...includeSpec ? { spec } : {}
456
+ };
457
+ }
458
+ function sparklines(doc) {
459
+ const found = [];
460
+ doc.descendants((node, pos) => {
461
+ if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkMUCYWI6Wcjs.sparklineLabel.call(void 0, node) });
462
+ });
463
+ return found;
464
+ }
465
+ function checkPosition(editor, at) {
466
+ const size = editor.state.doc.content.size;
467
+ if (at !== void 0 && at > size) throw new Error(`Position ${at} is outside the document (size ${size}).`);
468
+ }
469
+ function createDocumentChartTools(editor) {
470
+ const chartType = () => editor().schema.nodes.chart;
471
+ const findChart = (args) => {
472
+ const charts = _chunkMUCYWI6Wcjs.getDocumentCharts.call(void 0, editor().state.doc);
473
+ const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
474
+ if (args.chartId !== void 0) {
475
+ const chart = charts.find((c) => c.id === args.chartId);
476
+ if (!chart) throw new Error(`There is no chart "${args.chartId}" in the document. Charts: ${list}.`);
477
+ if (args.pos !== void 0 && args.pos !== chart.pos) throw new Error(`Chart "${args.chartId}" is at ${chart.pos}, not ${args.pos}; pass one of chartId or pos.`);
478
+ return chart;
479
+ }
480
+ if (args.pos !== void 0) {
481
+ const chart = charts.find((c) => c.pos === args.pos);
482
+ if (!chart) throw new Error(`There is no chart at position ${args.pos}. Charts: ${list}.`);
483
+ return chart;
484
+ }
485
+ throw new Error(`Pass chartId or pos (from list_document_charts). Charts: ${list}.`);
486
+ };
487
+ const listCharts = {
488
+ name: "list_document_charts",
489
+ title: "List charts in the document",
490
+ description: "Lists the charts in the document in order: id, document position, type, title, categories, series (ids and names), size in pixels and a plain-language description of the data. Also lists inline sparklines (position, kind, values). Pass the id or position to update_chart_in_document.",
491
+ inputSchema: {
492
+ type: "object",
493
+ properties: { includeSpec: { type: "boolean", description: "Also return each chart's full spec (default false)." } },
494
+ additionalProperties: false
495
+ },
496
+ annotations: { title: "List charts in the document", ...READ },
497
+ handler: ({ includeSpec = false }) => {
498
+ const doc = editor().state.doc;
499
+ return { charts: _chunkMUCYWI6Wcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
500
+ }
501
+ };
502
+ const insertChart = {
503
+ name: "insert_chart",
504
+ title: "Insert a chart",
505
+ description: "Inserts a chart block at a document position (or the cursor), as one undo step. Give the categories and series (one value per category) and any presentation fields (type, titles, axes, legend, stacking, palette, \u2026). Invalid fields change nothing and come back as sentences. Returns the new chart's id, position and stored spec.",
506
+ inputSchema: {
507
+ type: "object",
508
+ properties: {
509
+ spec: { type: "object", description: "The chart: categories and series, plus optional presentation fields.", properties: SPEC_PROPERTIES, required: ["categories", "series"], additionalProperties: false },
510
+ at: { type: "integer", minimum: 0, description: "Document position (default: the selection). A position inside a paragraph splits it." },
511
+ width: SIZE_WIDTH,
512
+ height: SIZE_HEIGHT
513
+ },
514
+ required: ["spec"],
515
+ additionalProperties: false
516
+ },
517
+ annotations: { title: "Insert a chart", ...WRITE },
518
+ handler: ({ spec: input, at, width = null, height }) => {
519
+ const ed = editor();
520
+ checkPosition(ed, at);
521
+ const spec = checkedSpec(input);
522
+ const id = _nullishCoalesce(_optionalChain([ed, 'access', _16 => _16.extensionManager, 'access', _17 => _17.extensions, 'access', _18 => _18.find, 'call', _19 => _19((e) => e.name === "chart"), 'optionalAccess', _20 => _20.options, 'access', _21 => _21.generateId, 'optionalCall', _22 => _22()]), () => ( `chart-${Date.now().toString(36)}`));
523
+ const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
524
+ const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
525
+ const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
526
+ const chart = _chunkMUCYWI6Wcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
527
+ 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.`);
528
+ return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
529
+ }
530
+ };
531
+ const updateChart = {
532
+ name: "update_chart_in_document",
533
+ title: "Change a chart in the document",
534
+ description: "Changes one chart (by id or position from list_document_charts) as one undo step: data (categories, series \u2014 given series replace all) and / or presentation fields, which merge into the current spec (axes and legend field by field), plus its size. All-or-nothing: invalid values change nothing and come back as sentences. Returns the chart's id, position and new spec.",
535
+ inputSchema: {
536
+ type: "object",
537
+ properties: {
538
+ chartId: { type: "string", description: "Chart id from list_document_charts." },
539
+ pos: { type: "integer", minimum: 0, description: "Document position of the chart (from list_document_charts), instead of chartId." },
540
+ changes: { type: "object", description: "Fields to change; omitted fields keep their value.", properties: SPEC_PROPERTIES, additionalProperties: false },
541
+ width: SIZE_WIDTH,
542
+ height: { ...SIZE_HEIGHT, description: "Height in pixels (default: unchanged)." }
543
+ },
544
+ additionalProperties: false
545
+ },
546
+ annotations: { title: "Change a chart in the document", ...WRITE_IDEMPOTENT },
547
+ handler: ({ chartId, pos, changes, width, height }) => {
548
+ const ed = editor();
549
+ const chart = findChart({ chartId, pos });
550
+ if (!changes && width === void 0 && height === void 0) throw new Error('Nothing to change: pass changes, width or height, e.g. {"changes": {"type": "line"}}.');
551
+ const s = chart.spec;
552
+ const patch = _nullishCoalesce(changes, () => ( {}));
553
+ const spec = checkedSpec({
554
+ ...s,
555
+ ...patch,
556
+ xAxis: patch.xAxis ? { ...s.xAxis, ...patch.xAxis } : s.xAxis,
557
+ yAxis: patch.yAxis ? { ...s.yAxis, ...patch.yAxis } : s.yAxis,
558
+ yAxis2: patch.yAxis2 ? { ...s.yAxis2, ...patch.yAxis2 } : s.yAxis2,
559
+ legend: patch.legend ? { ...s.legend, ...patch.legend } : s.legend
560
+ });
561
+ const attrs = { ...chart.node.attrs, spec, ...width !== void 0 ? { width } : {}, ...height !== void 0 ? { height } : {} };
562
+ ed.view.dispatch(_history.closeHistory.call(void 0, ed.state.tr.setNodeMarkup(chart.pos, void 0, attrs)));
563
+ return { id: chart.id, pos: chart.pos, spec, width: attrs.width, height: attrs.height };
564
+ }
565
+ };
566
+ const insertSparkline = {
567
+ name: "insert_sparkline",
568
+ title: "Insert a sparkline",
569
+ description: "Inserts a word-sized chart into the text at a document position (or the cursor), as one undo step. Returns its position and stored values.",
570
+ inputSchema: {
571
+ type: "object",
572
+ properties: {
573
+ values: { type: "array", items: _chunkU6IZKC7Bcjs.VALUE, minItems: 1, maxItems: _chunkMUCYWI6Wcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
574
+ kind: { type: "string", enum: [..._chunkMUCYWI6Wcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
575
+ at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
576
+ width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
577
+ height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
578
+ color: { type: "string", description: "CSS colour (default: the first palette colour)." },
579
+ label: { type: "string", description: 'Accessible label (default: "Trend from <first> to <last>").' }
580
+ },
581
+ required: ["values"],
582
+ additionalProperties: false
583
+ },
584
+ annotations: { title: "Insert a sparkline", ...WRITE },
585
+ handler: ({ values, kind = "line", at, width = 80, height = 18, color = null, label = null }) => {
586
+ const ed = editor();
587
+ checkPosition(ed, at);
588
+ const parsed = values.map((v) => _chunkPRSJJZBScjs.parseChartValue.call(void 0, v));
589
+ const bad = parsed.findIndex((v) => v === void 0);
590
+ if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
591
+ const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
592
+ 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}).`);
593
+ const stored = _chunkMUCYWI6Wcjs.normalizeSparklineValues.call(void 0, parsed);
594
+ ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
595
+ return { pos, kind, values: stored };
596
+ }
597
+ };
598
+ return {
599
+ read: () => chartType() ? [listCharts] : [],
600
+ write: () => chartType() ? [insertChart, updateChart, ...editor().schema.nodes.sparkline ? [insertSparkline] : []] : []
601
+ };
602
+ }
603
+
604
+ // src/agent/providers.ts
389
605
  var toEditor = (target) => "commands" in target ? target : target.editor;
390
606
  function replaceWithText(editor, from, to, text) {
391
607
  const { state, view } = editor;
@@ -425,12 +641,13 @@ function findMatches(editor, query, args, replacement) {
425
641
  wholeWord: !!args.wholeWord,
426
642
  ...args.regex ? { regex: true } : { literal: true }
427
643
  };
428
- const result = _chunkJ3R2OWOEcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
644
+ const result = _chunkMUCYWI6Wcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
429
645
  if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
430
646
  return { matches: result.matches, truncated: result.truncated };
431
647
  }
432
648
  function createRichTextToolProvider(target, options) {
433
649
  const editor = () => toEditor(target);
650
+ const charts = createDocumentChartTools(editor);
434
651
  const getText = {
435
652
  name: "get_text",
436
653
  title: "Get document text",
@@ -576,7 +793,7 @@ function createRichTextToolProvider(target, options) {
576
793
  replacement: String(replace).replace(/\r\n?|\n/g, "\r")
577
794
  }));
578
795
  const tr = ed.state.tr;
579
- const ends = _chunkJ3R2OWOEcjs.applyReplacements.call(void 0, tr, chosen);
796
+ const ends = _chunkMUCYWI6Wcjs.applyReplacements.call(void 0, tr, chosen);
580
797
  ed.view.dispatch(tr.scrollIntoView());
581
798
  return {
582
799
  replaced: chosen.length,
@@ -673,7 +890,7 @@ function createRichTextToolProvider(target, options) {
673
890
  inputSchema: {
674
891
  type: "object",
675
892
  properties: {
676
- operation: { type: "string", enum: _chunkJ3R2OWOEcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
893
+ operation: { type: "string", enum: _chunkMUCYWI6Wcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
677
894
  at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
678
895
  rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
679
896
  cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
@@ -703,10 +920,10 @@ function createRichTextToolProvider(target, options) {
703
920
  ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
704
921
  }
705
922
  const action = operation;
706
- const state = _chunkJ3R2OWOEcjs.getTableActionState.call(void 0, ed, action, params);
923
+ const state = _chunkMUCYWI6Wcjs.getTableActionState.call(void 0, ed, action, params);
707
924
  if (state !== true) throw new Error(state);
708
- _chunkJ3R2OWOEcjs.runTableAction.call(void 0, ed, action, params);
709
- const table = _chunkJ3R2OWOEcjs.getTableState.call(void 0, ed);
925
+ _chunkMUCYWI6Wcjs.runTableAction.call(void 0, ed, action, params);
926
+ const table = _chunkMUCYWI6Wcjs.getTableState.call(void 0, ed);
710
927
  return {
711
928
  operation,
712
929
  table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
@@ -720,9 +937,9 @@ function createRichTextToolProvider(target, options) {
720
937
  tools: () => {
721
938
  const ed = editor();
722
939
  if (!ed || ed.isDestroyed) return [];
723
- if (!ed.isEditable) return [getText, findText];
940
+ if (!ed.isEditable) return [getText, findText, ...charts.read()];
724
941
  const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection];
725
- return _chunkJ3R2OWOEcjs.isTableEnabled.call(void 0, ed) ? [...tools, editTable] : tools;
942
+ return [...tools, ..._chunkMUCYWI6Wcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write()];
726
943
  },
727
944
  subscribe: (notify) => {
728
945
  const ed = editor();
@@ -739,12 +956,12 @@ var CELL_REF_REGEX = /^\$?([A-Za-z]{1,3})\$?(\d{1,7})$/;
739
956
  function parseCell(ref) {
740
957
  const match = CELL_REF_REGEX.exec(ref.trim());
741
958
  if (!match) throw new Error(`Invalid cell reference "${ref}". Use A1 notation, e.g. "B3".`);
742
- return { col: _chunkEWCOFSCQcjs.colNameToIndex.call(void 0, match[1].toUpperCase()), row: parseInt(match[2], 10) - 1 };
959
+ return { col: _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, match[1].toUpperCase()), row: parseInt(match[2], 10) - 1 };
743
960
  }
744
961
  var COLUMN_REGEX = /^[A-Za-z]{1,3}$/;
745
962
  function parseColumn(name) {
746
963
  if (!COLUMN_REGEX.test(name.trim())) throw new Error(`Invalid column "${name}". Use a letter name, e.g. "C".`);
747
- return _chunkEWCOFSCQcjs.colNameToIndex.call(void 0, name.trim().toUpperCase());
964
+ return _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, name.trim().toUpperCase());
748
965
  }
749
966
  var CELL_INPUT = { type: ["string", "number", "boolean", "null"] };
750
967
  function createSpreadsheetToolProvider(controller, options) {
@@ -793,14 +1010,14 @@ function createSpreadsheetToolProvider(controller, options) {
793
1010
  const cell = controller.getCell(found.rowDef.id, found.colDef.id);
794
1011
  valueRow.push(_nullishCoalesce(cell.error, () => ( cell.value)));
795
1012
  rawRow.push(cell.raw);
796
- const error = _nullishCoalesce(cell.error, () => ( (_chunkEWCOFSCQcjs.isFormulaError.call(void 0, cell.value) ? cell.value : void 0)));
797
- if (error) errors.push({ cell: `${_chunkEWCOFSCQcjs.indexToColName.call(void 0, c)}${r + 1}`, error });
1013
+ const error = _nullishCoalesce(cell.error, () => ( (_chunkXP5IUZUOcjs.isFormulaError.call(void 0, cell.value) ? cell.value : void 0)));
1014
+ if (error) errors.push({ cell: `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, c)}${r + 1}`, error });
798
1015
  }
799
1016
  values.push(valueRow);
800
1017
  raw.push(rawRow);
801
1018
  }
802
1019
  return {
803
- range: values.length && values[0].length ? `${_chunkEWCOFSCQcjs.indexToColName.call(void 0, c0)}${r0 + 1}:${_chunkEWCOFSCQcjs.indexToColName.call(void 0, c1)}${r1 + 1}` : null,
1020
+ range: values.length && values[0].length ? `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, c0)}${r0 + 1}:${_chunkXP5IUZUOcjs.indexToColName.call(void 0, c1)}${r1 + 1}` : null,
804
1021
  values,
805
1022
  raw,
806
1023
  errors,
@@ -879,7 +1096,7 @@ function createSpreadsheetToolProvider(controller, options) {
879
1096
  const readOnly = [];
880
1097
  rows.forEach(
881
1098
  (line, r) => line.forEach((_, c) => {
882
- if (isReadOnly(row + r, col + c)) readOnly.push(`${_chunkEWCOFSCQcjs.indexToColName.call(void 0, col + c)}${row + r + 1}`);
1099
+ if (isReadOnly(row + r, col + c)) readOnly.push(`${_chunkXP5IUZUOcjs.indexToColName.call(void 0, col + c)}${row + r + 1}`);
883
1100
  })
884
1101
  );
885
1102
  if (readOnly.length) throw new Error(`Read-only cells: ${readOnly.slice(0, 20).join(", ")}. Nothing was written.`);
@@ -888,19 +1105,19 @@ function createSpreadsheetToolProvider(controller, options) {
888
1105
  { startRow: row, startCol: col }
889
1106
  );
890
1107
  const width = Math.max(0, ...rows.map((line) => line.length));
891
- const end = `${_chunkEWCOFSCQcjs.indexToColName.call(void 0, col + Math.max(width, 1) - 1)}${row + rows.length}`;
1108
+ const end = `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, col + Math.max(width, 1) - 1)}${row + rows.length}`;
892
1109
  const errors = [];
893
1110
  rows.forEach(
894
1111
  (line, r) => line.forEach((_, c) => {
895
1112
  const found = lookup(row + r, col + c);
896
1113
  if (!found) return;
897
1114
  const cell = controller.getCell(found.rowDef.id, found.colDef.id);
898
- const error = _nullishCoalesce(cell.error, () => ( (_chunkEWCOFSCQcjs.isFormulaError.call(void 0, cell.value) ? cell.value : void 0)));
899
- if (error) errors.push({ cell: `${_chunkEWCOFSCQcjs.indexToColName.call(void 0, col + c)}${row + r + 1}`, error: String(error) });
1115
+ const error = _nullishCoalesce(cell.error, () => ( (_chunkXP5IUZUOcjs.isFormulaError.call(void 0, cell.value) ? cell.value : void 0)));
1116
+ if (error) errors.push({ cell: `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, col + c)}${row + r + 1}`, error: String(error) });
900
1117
  })
901
1118
  );
902
1119
  return {
903
- range: `${_chunkEWCOFSCQcjs.indexToColName.call(void 0, col)}${row + 1}:${end}`,
1120
+ range: `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, col)}${row + 1}:${end}`,
904
1121
  written: rows.reduce((n, line) => n + line.length, 0),
905
1122
  errors,
906
1123
  sheet: { rows: controller.document.rows.length, columns: controller.document.columns.length }
@@ -956,7 +1173,7 @@ function createSpreadsheetToolProvider(controller, options) {
956
1173
  const index = parseColumn(before);
957
1174
  if (index > controller.document.columns.length) throw new Error(`Column ${before} is past the end of the sheet (${controller.document.columns.length} columns).`);
958
1175
  for (let i = 0; i < count; i++) controller.insertColumn(index);
959
- return { inserted: count, columns: `${_chunkEWCOFSCQcjs.indexToColName.call(void 0, index)}:${_chunkEWCOFSCQcjs.indexToColName.call(void 0, index + count - 1)}`, sheet: sheetSize() };
1176
+ return { inserted: count, columns: `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, index)}:${_chunkXP5IUZUOcjs.indexToColName.call(void 0, index + count - 1)}`, sheet: sheetSize() };
960
1177
  }
961
1178
  );
962
1179
  const deleteColumns = structural(
@@ -981,10 +1198,10 @@ function createSpreadsheetToolProvider(controller, options) {
981
1198
  };
982
1199
  }
983
1200
  function missingArgumentsMessage(name, args) {
984
- const required = _chunkK2LVZ4FAcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS[name][args.operation];
1201
+ const required = _chunkXFYUFVAXcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS[name][args.operation];
985
1202
  if (!required) return `Unknown operation "${args.operation}".`;
986
1203
  const missing = required.filter(
987
- (key) => key === "id" ? args.id === void 0 && _optionalChain([args, 'access', _16 => _16.node, 'optionalAccess', _17 => _17.id]) === void 0 : args[key] === void 0
1204
+ (key) => key === "id" ? args.id === void 0 && _optionalChain([args, 'access', _23 => _23.node, 'optionalAccess', _24 => _24.id]) === void 0 : args[key] === void 0
988
1205
  );
989
1206
  return missing.length ? `Operation "${args.operation}" requires ${required.join(", ")}; missing: ${missing.join(", ")}.` : `Operation "${args.operation}" has invalid arguments (expected ${required.join(", ")} with the types in the schema).`;
990
1207
  }
@@ -1016,12 +1233,12 @@ function createEditorMcpToolProvider(options) {
1016
1233
  await options.applySteps(steps);
1017
1234
  return describeSteps(steps);
1018
1235
  };
1019
- const canvas = _nullishCoalesce(_optionalChain([options, 'access', _18 => _18.surfaces, 'optionalAccess', _19 => _19.canvas]), () => ( true));
1020
- const prompt = _nullishCoalesce(_optionalChain([options, 'access', _20 => _20.surfaces, 'optionalAccess', _21 => _21.prompt]), () => ( true));
1021
- const editTools = options.toolStyle === "combined" ? [...canvas ? [_chunkK2LVZ4FAcjs.MCP_TOOL_EDIT_CANVAS] : [], ...prompt ? [_chunkK2LVZ4FAcjs.MCP_TOOL_EDIT_PROMPT] : []] : [...canvas ? _chunkK2LVZ4FAcjs.EDITOR_CANVAS_TOOLS : [], ...prompt ? _chunkK2LVZ4FAcjs.EDITOR_PROMPT_TOOLS : []];
1236
+ const canvas = _nullishCoalesce(_optionalChain([options, 'access', _25 => _25.surfaces, 'optionalAccess', _26 => _26.canvas]), () => ( true));
1237
+ const prompt = _nullishCoalesce(_optionalChain([options, 'access', _27 => _27.surfaces, 'optionalAccess', _28 => _28.prompt]), () => ( true));
1238
+ const editTools = options.toolStyle === "combined" ? [...canvas ? [_chunkXFYUFVAXcjs.MCP_TOOL_EDIT_CANVAS] : [], ...prompt ? [_chunkXFYUFVAXcjs.MCP_TOOL_EDIT_PROMPT] : []] : [...canvas ? _chunkXFYUFVAXcjs.EDITOR_CANVAS_TOOLS : [], ...prompt ? _chunkXFYUFVAXcjs.EDITOR_PROMPT_TOOLS : []];
1022
1239
  const tools = [
1023
1240
  {
1024
- ..._chunkK2LVZ4FAcjs.MCP_TOOL_GET_EDITOR_STATE,
1241
+ ..._chunkXFYUFVAXcjs.MCP_TOOL_GET_EDITOR_STATE,
1025
1242
  handler: ({ includeDocument = true, includeCanvas = true }) => {
1026
1243
  const snapshot = options.getSnapshot();
1027
1244
  return {
@@ -1035,7 +1252,7 @@ function createEditorMcpToolProvider(options) {
1035
1252
  if (options.captureView) {
1036
1253
  const capture = options.captureView;
1037
1254
  tools.push({
1038
- ..._chunkK2LVZ4FAcjs.MCP_TOOL_VIEW_EDITOR,
1255
+ ..._chunkXFYUFVAXcjs.MCP_TOOL_VIEW_EDITOR,
1039
1256
  handler: async (args) => {
1040
1257
  const image = await capture(args);
1041
1258
  return { content: [{ type: "image", data: image.data, mimeType: image.mimeType }] };
@@ -1052,8 +1269,8 @@ var COMPONENT_ID = { type: "string", description: "Component or component set id
1052
1269
  var PARENT_ID = { type: "string", description: "Frame to place the instance in (default: the canvas root)." };
1053
1270
  var X = { type: "number", description: "X position (canvas coordinates, or relative to the parent frame)." };
1054
1271
  var Y = { type: "number", description: "Y position (canvas coordinates, or relative to the parent frame)." };
1055
- var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
1056
- var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
1272
+ var READ2 = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
1273
+ var WRITE2 = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
1057
1274
  var DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false };
1058
1275
  var TITLES = {
1059
1276
  list_components: "List components",
@@ -1087,7 +1304,7 @@ function createCanvasComponentToolProvider(controller, options = { id: "canvas-c
1087
1304
  inputSchema: { type: "object", properties, ...extra.required ? { required: extra.required } : {}, additionalProperties: false },
1088
1305
  annotations: {
1089
1306
  title: TITLES[name],
1090
- ...extra.readOnly ? READ : DESTRUCTIVE_TOOLS.has(name) ? DESTRUCTIVE : WRITE
1307
+ ...extra.readOnly ? READ2 : DESTRUCTIVE_TOOLS.has(name) ? DESTRUCTIVE : WRITE2
1091
1308
  },
1092
1309
  handler
1093
1310
  });
@@ -1279,5 +1496,6 @@ function createCanvasComponentToolProvider(controller, options = { id: "canvas-c
1279
1496
 
1280
1497
 
1281
1498
 
1282
- exports.EDITOR_CANVAS_TOOLS = _chunkK2LVZ4FAcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkK2LVZ4FAcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkK2LVZ4FAcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkK2LVZ4FAcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkK2LVZ4FAcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkK2LVZ4FAcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkK2LVZ4FAcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkK2LVZ4FAcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkK2LVZ4FAcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkK2LVZ4FAcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkK2LVZ4FAcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkK2LVZ4FAcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkK2LVZ4FAcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkK2LVZ4FAcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkK2LVZ4FAcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkK2LVZ4FAcjs.MCP_TOOL_VIEW_EDITOR; exports.TOOL_NAMESPACE_SEPARATOR = _chunkK2LVZ4FAcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkK2LVZ4FAcjs.ToolRegistry; exports.ToolRegistryError = _chunkK2LVZ4FAcjs.ToolRegistryError; exports.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createMcpServer = _chunkK2LVZ4FAcjs.createMcpServer; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; exports.createToolRegistry = _chunkK2LVZ4FAcjs.createToolRegistry; exports.normalizeSide = normalizeSide; exports.planAgentCommand = planAgentCommand; exports.planToolCall = planToolCall; exports.toToolResult = _chunkK2LVZ4FAcjs.toToolResult; exports.toolCallToAgentCommand = toolCallToAgentCommand; exports.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkEFDCLENWcjs.validateJsonSchema;
1499
+
1500
+ exports.EDITOR_CANVAS_TOOLS = _chunkXFYUFVAXcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkXFYUFVAXcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkXFYUFVAXcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkXFYUFVAXcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkXFYUFVAXcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkXFYUFVAXcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkXFYUFVAXcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkXFYUFVAXcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkXFYUFVAXcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkXFYUFVAXcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkXFYUFVAXcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkXFYUFVAXcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkXFYUFVAXcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkXFYUFVAXcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkXFYUFVAXcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkXFYUFVAXcjs.MCP_TOOL_VIEW_EDITOR; exports.TOOL_NAMESPACE_SEPARATOR = _chunkXFYUFVAXcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkXFYUFVAXcjs.ToolRegistry; exports.ToolRegistryError = _chunkXFYUFVAXcjs.ToolRegistryError; exports.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createDocumentChartTools = createDocumentChartTools; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createMcpServer = _chunkXFYUFVAXcjs.createMcpServer; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; exports.createToolRegistry = _chunkXFYUFVAXcjs.createToolRegistry; exports.normalizeSide = normalizeSide; exports.planAgentCommand = planAgentCommand; exports.planToolCall = planToolCall; exports.toToolResult = _chunkXFYUFVAXcjs.toToolResult; exports.toolCallToAgentCommand = toolCallToAgentCommand; exports.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkRIWPYSKUcjs.validateJsonSchema;
1283
1501
  //# sourceMappingURL=index.cjs.map