@pixerate/editor 0.272.0 → 0.273.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 (65) hide show
  1. package/dist/agent/index.cjs +34 -32
  2. package/dist/agent/index.js +10 -8
  3. package/dist/chart/contract.d.cts +95 -0
  4. package/dist/chart/contract.d.ts +95 -0
  5. package/dist/chart/controller.d.cts +4 -0
  6. package/dist/chart/controller.d.ts +4 -0
  7. package/dist/chart/index.cjs +492 -26
  8. package/dist/chart/index.d.cts +1 -0
  9. package/dist/chart/index.d.ts +1 -0
  10. package/dist/chart/index.js +476 -10
  11. package/dist/chart/tools.d.cts +3 -0
  12. package/dist/chart/tools.d.ts +3 -0
  13. package/dist/chart-maps/index.cjs +4 -64
  14. package/dist/chart-maps/index.js +3 -63
  15. package/dist/chunk-2A5IKZMU.js +557 -0
  16. package/dist/{chunk-NMZQMPFZ.js → chunk-4LZQO5Y7.js} +2 -0
  17. package/dist/chunk-5UGRMVNE.js +328 -0
  18. package/dist/{chunk-X4FTNFIA.js → chunk-7MGPW2OV.js} +1 -1
  19. package/dist/{chunk-DGITFN73.cjs → chunk-BWJBZAUE.cjs} +8 -8
  20. package/dist/chunk-CHZYVNXZ.js +336 -0
  21. package/dist/chunk-DRMZ5R3S.cjs +67 -0
  22. package/dist/chunk-EI5GFTKG.js +67 -0
  23. package/dist/chunk-JV7DKLMX.js +1073 -0
  24. package/dist/chunk-MFBUQC67.cjs +328 -0
  25. package/dist/{chunk-IBXEQOGI.js → chunk-PYHB2EHE.js} +2 -324
  26. package/dist/chunk-QEUI6OGE.cjs +336 -0
  27. package/dist/{chunk-6ZSFRRJI.js → chunk-RSF6BT34.js} +1 -1
  28. package/dist/chunk-T2HUQBRC.cjs +1073 -0
  29. package/dist/{chunk-GSLOH2IN.cjs → chunk-VF6ODSYX.cjs} +2 -0
  30. package/dist/{chunk-NQUKTRKN.cjs → chunk-WZLNNGG3.cjs} +45 -45
  31. package/dist/{chunk-NRBGAEFI.cjs → chunk-Y3RUYOOW.cjs} +8 -330
  32. package/dist/chunk-YH6SKC7P.cjs +557 -0
  33. package/dist/commands/index.cjs +7 -323
  34. package/dist/commands/index.js +5 -321
  35. package/dist/extensions/index.cjs +4 -4
  36. package/dist/extensions/index.js +3 -3
  37. package/dist/index.cjs +9 -9
  38. package/dist/index.js +3 -3
  39. package/dist/paint-editor/controller.d.cts +86 -0
  40. package/dist/paint-editor/controller.d.ts +86 -0
  41. package/dist/paint-editor/document.d.cts +1 -1
  42. package/dist/paint-editor/document.d.ts +1 -1
  43. package/dist/paint-editor/index.cjs +559 -166
  44. package/dist/paint-editor/index.d.cts +1 -0
  45. package/dist/paint-editor/index.d.ts +1 -0
  46. package/dist/paint-editor/index.js +397 -4
  47. package/dist/paint-editor/presence.d.cts +5 -1
  48. package/dist/paint-editor/presence.d.ts +5 -1
  49. package/dist/paint-editor/ui.d.cts +5 -2
  50. package/dist/paint-editor/ui.d.ts +5 -2
  51. package/dist/persistence/index.cjs +24 -1042
  52. package/dist/persistence/index.js +22 -1040
  53. package/dist/raster/fill.d.cts +85 -0
  54. package/dist/raster/fill.d.ts +85 -0
  55. package/dist/raster/index.cjs +9 -1
  56. package/dist/raster/index.d.cts +1 -0
  57. package/dist/raster/index.d.ts +1 -0
  58. package/dist/raster/index.js +8 -0
  59. package/dist/tools/index.cjs +5 -3
  60. package/dist/tools/index.js +8 -6
  61. package/package.json +1 -1
  62. package/skills/pixerate-paint-editor/SKILL.md +19 -43
  63. package/skills/pixerate-paint-editor/references/evolution.md +27 -0
  64. package/skills/pixerate-paint-sketch-to-finish/SKILL.md +16 -5
  65. package/skills/pixerate-paint-sketch-to-finish/evals/flats-under-ink.json +2 -3
@@ -36,21 +36,23 @@ require('../chunk-QJVOJUTD.cjs');
36
36
 
37
37
 
38
38
 
39
+ var _chunkY3RUYOOWcjs = require('../chunk-Y3RUYOOW.cjs');
39
40
 
40
41
 
41
42
 
42
43
 
43
44
 
44
- var _chunkNRBGAEFIcjs = require('../chunk-NRBGAEFI.cjs');
45
45
 
46
46
 
47
47
 
48
+ var _chunkZEKI6EPIcjs = require('../chunk-ZEKI6EPI.cjs');
48
49
 
49
50
 
50
51
 
51
52
 
52
53
 
53
- var _chunkZEKI6EPIcjs = require('../chunk-ZEKI6EPI.cjs');
54
+
55
+ var _chunkMFBUQC67cjs = require('../chunk-MFBUQC67.cjs');
54
56
 
55
57
 
56
58
 
@@ -140,10 +142,10 @@ var _chunkN2FGYZ4Qcjs = require('../chunk-N2FGYZ4Q.cjs');
140
142
 
141
143
 
142
144
 
143
- var _chunkDGITFN73cjs = require('../chunk-DGITFN73.cjs');
145
+ var _chunkBWJBZAUEcjs = require('../chunk-BWJBZAUE.cjs');
144
146
 
145
147
 
146
- var _chunkGSLOH2INcjs = require('../chunk-GSLOH2IN.cjs');
148
+ var _chunkVF6ODSYXcjs = require('../chunk-VF6ODSYX.cjs');
147
149
  require('../chunk-TTCJPX4U.cjs');
148
150
  require('../chunk-MDLEGVEN.cjs');
149
151
  require('../chunk-VU6WQSMB.cjs');
@@ -691,14 +693,14 @@ function describe(chart, includeSpec) {
691
693
  series: spec.series.map((s) => ({ id: s.id, name: s.name })),
692
694
  width: _nullishCoalesce(node.attrs.width, () => ( null)),
693
695
  height: node.attrs.height,
694
- description: _chunkGSLOH2INcjs.describeChart.call(void 0, spec),
696
+ description: _chunkVF6ODSYXcjs.describeChart.call(void 0, spec),
695
697
  ...includeSpec ? { spec } : {}
696
698
  };
697
699
  }
698
700
  function sparklines(doc) {
699
701
  const found = [];
700
702
  doc.descendants((node, pos) => {
701
- if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkDGITFN73cjs.sparklineLabel.call(void 0, node) });
703
+ if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkBWJBZAUEcjs.sparklineLabel.call(void 0, node) });
702
704
  });
703
705
  return found;
704
706
  }
@@ -709,7 +711,7 @@ function checkPosition(editor, at) {
709
711
  function createDocumentChartTools(editor) {
710
712
  const chartType = () => editor().schema.nodes.chart;
711
713
  const findChart = (args) => {
712
- const charts = _chunkDGITFN73cjs.getDocumentCharts.call(void 0, editor().state.doc);
714
+ const charts = _chunkBWJBZAUEcjs.getDocumentCharts.call(void 0, editor().state.doc);
713
715
  const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
714
716
  if (args.chartId !== void 0) {
715
717
  const chart = charts.find((c) => c.id === args.chartId);
@@ -736,7 +738,7 @@ function createDocumentChartTools(editor) {
736
738
  annotations: { title: "List charts in the document", ...READ },
737
739
  handler: ({ includeSpec = false }) => {
738
740
  const doc = editor().state.doc;
739
- return { charts: _chunkDGITFN73cjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
741
+ return { charts: _chunkBWJBZAUEcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
740
742
  }
741
743
  };
742
744
  const insertChart = {
@@ -763,7 +765,7 @@ function createDocumentChartTools(editor) {
763
765
  const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
764
766
  const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
765
767
  const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
766
- const chart = _chunkDGITFN73cjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
768
+ const chart = _chunkBWJBZAUEcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
767
769
  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.`);
768
770
  return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
769
771
  }
@@ -810,8 +812,8 @@ function createDocumentChartTools(editor) {
810
812
  inputSchema: {
811
813
  type: "object",
812
814
  properties: {
813
- values: { type: "array", items: _chunkG23BTQA5cjs.VALUE, minItems: 1, maxItems: _chunkDGITFN73cjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
814
- kind: { type: "string", enum: [..._chunkDGITFN73cjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
815
+ values: { type: "array", items: _chunkG23BTQA5cjs.VALUE, minItems: 1, maxItems: _chunkBWJBZAUEcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
816
+ kind: { type: "string", enum: [..._chunkBWJBZAUEcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
815
817
  at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
816
818
  width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
817
819
  height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
@@ -830,7 +832,7 @@ function createDocumentChartTools(editor) {
830
832
  if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
831
833
  const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
832
834
  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}).`);
833
- const stored = _chunkDGITFN73cjs.normalizeSparklineValues.call(void 0, parsed);
835
+ const stored = _chunkBWJBZAUEcjs.normalizeSparklineValues.call(void 0, parsed);
834
836
  ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
835
837
  return { pos, kind, values: stored };
836
838
  }
@@ -1168,8 +1170,8 @@ function createTextPresence(editor, providerId, option) {
1168
1170
  const config = option === false ? null : option === true || option === void 0 ? {} : option;
1169
1171
  const caret = {
1170
1172
  id: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _43 => _43.id]), () => ( providerId)),
1171
- name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _44 => _44.name]), () => ( _chunkDGITFN73cjs.DEFAULT_AGENT_CARET_NAME)),
1172
- color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _45 => _45.color]), () => ( _chunkDGITFN73cjs.DEFAULT_AGENT_CARET_COLOR))
1173
+ name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _44 => _44.name]), () => ( _chunkBWJBZAUEcjs.DEFAULT_AGENT_CARET_NAME)),
1174
+ color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _45 => _45.color]), () => ( _chunkBWJBZAUEcjs.DEFAULT_AGENT_CARET_COLOR))
1173
1175
  };
1174
1176
  const typing = !_optionalChain([config, 'optionalAccess', _46 => _46.typing]) ? null : config.typing === true ? {} : config.typing;
1175
1177
  const idleMs = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _47 => _47.idleMs]), () => ( 12e3));
@@ -1182,19 +1184,19 @@ function createTextPresence(editor, providerId, option) {
1182
1184
  };
1183
1185
  const touch = () => {
1184
1186
  clearTimeout(idleTimer);
1185
- if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkDGITFN73cjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
1187
+ if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkBWJBZAUEcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
1186
1188
  };
1187
1189
  const tint = (ed, ranges) => {
1188
1190
  clearTimeout(tintTimer);
1189
- _chunkDGITFN73cjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
1190
- if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkDGITFN73cjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1191
+ _chunkBWJBZAUEcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
1192
+ if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkBWJBZAUEcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1191
1193
  };
1192
1194
  return {
1193
1195
  /** Puts the caret at `head`, selecting from `anchor`. */
1194
1196
  show(anchor, head = anchor) {
1195
1197
  const ed = live();
1196
1198
  if (!ed) return;
1197
- _chunkDGITFN73cjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
1199
+ _chunkBWJBZAUEcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
1198
1200
  touch();
1199
1201
  },
1200
1202
  /** Shows the caret after ranges just changed by a tool, tinting them. */
@@ -1202,7 +1204,7 @@ function createTextPresence(editor, providerId, option) {
1202
1204
  const ed = live();
1203
1205
  if (!ed || !ranges.length) return;
1204
1206
  const last = ranges[ranges.length - 1];
1205
- _chunkDGITFN73cjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
1207
+ _chunkBWJBZAUEcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
1206
1208
  tint(ed, ranges);
1207
1209
  touch();
1208
1210
  },
@@ -1210,12 +1212,12 @@ function createTextPresence(editor, providerId, option) {
1210
1212
  async write(ed, from, to, text, signal) {
1211
1213
  if (live() && typing) {
1212
1214
  clearTimeout(tintTimer);
1213
- const range2 = await _chunkDGITFN73cjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
1214
- if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkDGITFN73cjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1215
+ const range2 = await _chunkBWJBZAUEcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
1216
+ if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkBWJBZAUEcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
1215
1217
  touch();
1216
1218
  return range2;
1217
1219
  }
1218
- const tr = _history.closeHistory.call(void 0, _chunkDGITFN73cjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text));
1220
+ const tr = _history.closeHistory.call(void 0, _chunkBWJBZAUEcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text));
1219
1221
  const end = tr.mapping.map(to, 1);
1220
1222
  const range = { from: Math.min(tr.mapping.map(from, -1), end), to: end };
1221
1223
  ed.view.dispatch(tr.scrollIntoView());
@@ -1244,7 +1246,7 @@ function findMatches(editor, query, args, replacement) {
1244
1246
  wholeWord: !!args.wholeWord,
1245
1247
  ...args.regex ? { regex: true } : { literal: true }
1246
1248
  };
1247
- const result = _chunkDGITFN73cjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
1249
+ const result = _chunkBWJBZAUEcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
1248
1250
  if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
1249
1251
  return { matches: result.matches, truncated: result.truncated };
1250
1252
  }
@@ -1406,7 +1408,7 @@ function createRichTextToolProvider(target, options) {
1406
1408
  replacement: String(replace).replace(/\r\n?|\n/g, "\r")
1407
1409
  }));
1408
1410
  const tr = _history.closeHistory.call(void 0, ed.state.tr);
1409
- const ends = _chunkDGITFN73cjs.applyReplacements.call(void 0, tr, chosen);
1411
+ const ends = _chunkBWJBZAUEcjs.applyReplacements.call(void 0, tr, chosen);
1410
1412
  ed.view.dispatch(tr.scrollIntoView());
1411
1413
  const ranges = chosen.map((m, i) => ({ from: tr.mapping.map(m.from, -1), to: ends[i] }));
1412
1414
  presence.changed(ranges.filter((r) => r.from < r.to));
@@ -1507,7 +1509,7 @@ function createRichTextToolProvider(target, options) {
1507
1509
  inputSchema: {
1508
1510
  type: "object",
1509
1511
  properties: {
1510
- operation: { type: "string", enum: _chunkDGITFN73cjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
1512
+ operation: { type: "string", enum: _chunkBWJBZAUEcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
1511
1513
  at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
1512
1514
  rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
1513
1515
  cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
@@ -1537,10 +1539,10 @@ function createRichTextToolProvider(target, options) {
1537
1539
  ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
1538
1540
  }
1539
1541
  const action = operation;
1540
- const state = _chunkDGITFN73cjs.getTableActionState.call(void 0, ed, action, params);
1542
+ const state = _chunkBWJBZAUEcjs.getTableActionState.call(void 0, ed, action, params);
1541
1543
  if (state !== true) throw new Error(state);
1542
- _chunkDGITFN73cjs.runTableAction.call(void 0, ed, action, params);
1543
- const table = _chunkDGITFN73cjs.getTableState.call(void 0, ed);
1544
+ _chunkBWJBZAUEcjs.runTableAction.call(void 0, ed, action, params);
1545
+ const table = _chunkBWJBZAUEcjs.getTableState.call(void 0, ed);
1544
1546
  return {
1545
1547
  operation,
1546
1548
  table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
@@ -1559,7 +1561,7 @@ function createRichTextToolProvider(target, options) {
1559
1561
  if (!ed || ed.isDestroyed) return [];
1560
1562
  if (!ed.isEditable) return [getText, findText, ...charts.read()];
1561
1563
  const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection, ...formatting.tools(ed)];
1562
- return [...tools, ..._chunkDGITFN73cjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write().map(withCaret)];
1564
+ return [...tools, ..._chunkBWJBZAUEcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write().map(withCaret)];
1563
1565
  },
1564
1566
  subscribe: (notify) => {
1565
1567
  const ed = editor();
@@ -2235,7 +2237,7 @@ function createReviewToolProvider(target, options) {
2235
2237
  const editor = () => toEditor2(target);
2236
2238
  const author = _nullishCoalesce(options.author, () => ( { id: "agent", name: "Agent" }));
2237
2239
  const store = () => {
2238
- const s = _chunkDGITFN73cjs.getCommentStore.call(void 0, editor());
2240
+ const s = _chunkBWJBZAUEcjs.getCommentStore.call(void 0, editor());
2239
2241
  if (!s) throw new Error("This editor has no Comments extension.");
2240
2242
  return s;
2241
2243
  };
@@ -2430,7 +2432,7 @@ function createReviewToolProvider(target, options) {
2430
2432
  tools: () => {
2431
2433
  const ed = editor();
2432
2434
  if (!ed || ed.isDestroyed) return [];
2433
- const comments = !!_chunkDGITFN73cjs.getCommentStore.call(void 0, ed);
2435
+ const comments = !!_chunkBWJBZAUEcjs.getCommentStore.call(void 0, ed);
2434
2436
  const changes = !!_chunk34RQAGWIcjs.getTrackChangesStore.call(void 0, ed);
2435
2437
  const tools = [...comments ? [listComments] : [], ...changes ? [listChanges] : []];
2436
2438
  if (!ed.isEditable) return tools;
@@ -2565,4 +2567,4 @@ function createReviewToolProvider(target, options) {
2565
2567
 
2566
2568
 
2567
2569
 
2568
- exports.AgentPlayback = _chunk3SLBXKAWcjs.AgentPlayback; exports.CAPTURE_EXCLUDE_SELECTOR = _chunkSVFEVKLFcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkSVFEVKLFcjs.CAPTURE_OVERLAY_SELECTORS; exports.CONFORMANCE_BINARY_MIN_LENGTH = _chunkNRBGAEFIcjs.CONFORMANCE_BINARY_MIN_LENGTH; exports.CONFORMANCE_NUMBER_TOLERANCE = _chunkNRBGAEFIcjs.CONFORMANCE_NUMBER_TOLERANCE; exports.ConformanceIds = _chunkNRBGAEFIcjs.ConformanceIds; exports.EDITOR_CANVAS_TOOLS = _chunkSVFEVKLFcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkSVFEVKLFcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkSVFEVKLFcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkSVFEVKLFcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkSVFEVKLFcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkZEKI6EPIcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkZEKI6EPIcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkSVFEVKLFcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkSVFEVKLFcjs.MCP_TOOL_VIEW_EDITOR; exports.PRESENCE_COLORS = _chunkK7ENM55Pcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkK7ENM55Pcjs.PerformanceQueue; exports.PresenceStore = _chunkK7ENM55Pcjs.PresenceStore; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkZEKI6EPIcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkZEKI6EPIcjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_DISCOVERY_TOOLS = _chunk7TD63DZPcjs.TOOL_DISCOVERY_TOOLS; exports.TOOL_NAMESPACE_SEPARATOR = _chunk7TD63DZPcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunk7TD63DZPcjs.ToolRegistry; exports.ToolRegistryError = _chunk7TD63DZPcjs.ToolRegistryError; exports.ToolRegistryView = _chunk7TD63DZPcjs.ToolRegistryView; exports.UNSAFE_JSON_KEYS = _chunk2BSBFBOAcjs.UNSAFE_JSON_KEYS; exports.baseToolName = _chunk7TD63DZPcjs.baseToolName; exports.callEvalTool = _chunkNRBGAEFIcjs.callEvalTool; exports.captureInputSchema = _chunkN2FGYZ4Qcjs.captureInputSchema; exports.captureOutputSize = _chunkN2FGYZ4Qcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkSVFEVKLFcjs.cloneElementWithStyles; exports.conformanceResult = _chunkNRBGAEFIcjs.conformanceResult; exports.conformanceValuesMatch = _chunkNRBGAEFIcjs.conformanceValuesMatch; exports.connectToolBridge = _chunkZEKI6EPIcjs.connectToolBridge; exports.createAgentPlayback = _chunk3SLBXKAWcjs.createAgentPlayback; exports.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createDocumentChartTools = createDocumentChartTools; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkK7ENM55Pcjs.createInstantPresenceClock; exports.createMcpServer = _chunkZEKI6EPIcjs.createMcpServer; exports.createOriginMiddleware = _chunkNRBGAEFIcjs.createOriginMiddleware; exports.createPlaybackToolProvider = _chunk3SLBXKAWcjs.createPlaybackToolProvider; exports.createReviewToolProvider = createReviewToolProvider; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; exports.createStyleResolver = _chunkNRBGAEFIcjs.createStyleResolver; exports.createStyleToolProvider = _chunkNRBGAEFIcjs.createStyleToolProvider; exports.createToolRegistry = _chunk7TD63DZPcjs.createToolRegistry; exports.derivePlaybackSteps = _chunk3SLBXKAWcjs.derivePlaybackSteps; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunk7TD63DZPcjs.errorResult; exports.failedEvalChecks = _chunkNRBGAEFIcjs.failedEvalChecks; exports.imageEvalFixturePixels = _chunkNRBGAEFIcjs.imageEvalFixturePixels; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkillEvals = _chunkNRBGAEFIcjs.listSkillEvals; exports.listSkills = _chunk7TD63DZPcjs.listSkills; exports.locatePlaybackChrome = _chunk3SLBXKAWcjs.locatePlaybackChrome; exports.matchesEvalExpectation = _chunkNRBGAEFIcjs.matchesEvalExpectation; exports.memoryStyleStore = _chunkNRBGAEFIcjs.memoryStyleStore; exports.normalizeConformanceValue = _chunkNRBGAEFIcjs.normalizeConformanceValue; exports.normalizeSide = normalizeSide; exports.omitConformancePaths = _chunkNRBGAEFIcjs.omitConformancePaths; exports.parseSkillFrontmatter = _chunk7TD63DZPcjs.parseSkillFrontmatter; exports.parseStyleDomains = _chunkNRBGAEFIcjs.parseStyleDomains; exports.planAgentCommand = planAgentCommand; exports.planCanvasPlaybackSteps = planCanvasPlaybackSteps; exports.planCanvasToolPlayback = planCanvasToolPlayback; exports.planToolCall = planToolCall; exports.playbackRectFromClient = _chunk3SLBXKAWcjs.playbackRectFromClient; exports.playbackRefsFromArgs = _chunk3SLBXKAWcjs.playbackRefsFromArgs; exports.playbackRefsFromResult = _chunk3SLBXKAWcjs.playbackRefsFromResult; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunk7TD63DZPcjs.readSkillFile; exports.readingTime = _chunk3SLBXKAWcjs.readingTime; exports.realPresenceClock = _chunkK7ENM55Pcjs.realPresenceClock; exports.renderStyle = _chunkNRBGAEFIcjs.renderStyle; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.resolveConformanceArguments = _chunkNRBGAEFIcjs.resolveConformanceArguments; exports.runConformanceScenario = _chunkNRBGAEFIcjs.runConformanceScenario; exports.runStyleChecks = _chunkNRBGAEFIcjs.runStyleChecks; exports.runToolScript = _chunkNRBGAEFIcjs.runToolScript; exports.searchTokens = _chunk7TD63DZPcjs.searchTokens; exports.searchTools = _chunk7TD63DZPcjs.searchTools; exports.stripPrototypeKeys = _chunk2BSBFBOAcjs.stripPrototypeKeys; exports.summarize = _chunk7TD63DZPcjs.summarize; exports.toCapturedImageData = _chunkN2FGYZ4Qcjs.toCapturedImageData; exports.toToolResult = _chunk7TD63DZPcjs.toToolResult; exports.toolCallToAgentCommand = toolCallToAgentCommand; exports.toolResultError = _chunkNRBGAEFIcjs.toolResultError; exports.toolResultValue = _chunkNRBGAEFIcjs.toolResultValue; exports.toolsetInstructions = _chunkZEKI6EPIcjs.toolsetInstructions; exports.toolsetName = _chunk7TD63DZPcjs.toolsetName; exports.trackPresenceDrag = _chunkK7ENM55Pcjs.trackPresenceDrag; exports.tweenPresenceCursor = _chunkK7ENM55Pcjs.tweenPresenceCursor; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unionRects = _chunk3SLBXKAWcjs.unionRects; exports.unknownToolMessage = _chunk7TD63DZPcjs.unknownToolMessage; exports.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
2570
+ exports.AgentPlayback = _chunk3SLBXKAWcjs.AgentPlayback; exports.CAPTURE_EXCLUDE_SELECTOR = _chunkSVFEVKLFcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkSVFEVKLFcjs.CAPTURE_OVERLAY_SELECTORS; exports.CONFORMANCE_BINARY_MIN_LENGTH = _chunkY3RUYOOWcjs.CONFORMANCE_BINARY_MIN_LENGTH; exports.CONFORMANCE_NUMBER_TOLERANCE = _chunkY3RUYOOWcjs.CONFORMANCE_NUMBER_TOLERANCE; exports.ConformanceIds = _chunkY3RUYOOWcjs.ConformanceIds; exports.EDITOR_CANVAS_TOOLS = _chunkSVFEVKLFcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkSVFEVKLFcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkSVFEVKLFcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkSVFEVKLFcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkSVFEVKLFcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkZEKI6EPIcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkZEKI6EPIcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkSVFEVKLFcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkSVFEVKLFcjs.MCP_TOOL_VIEW_EDITOR; exports.PRESENCE_COLORS = _chunkK7ENM55Pcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkK7ENM55Pcjs.PerformanceQueue; exports.PresenceStore = _chunkK7ENM55Pcjs.PresenceStore; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkZEKI6EPIcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkZEKI6EPIcjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_DISCOVERY_TOOLS = _chunk7TD63DZPcjs.TOOL_DISCOVERY_TOOLS; exports.TOOL_NAMESPACE_SEPARATOR = _chunk7TD63DZPcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunk7TD63DZPcjs.ToolRegistry; exports.ToolRegistryError = _chunk7TD63DZPcjs.ToolRegistryError; exports.ToolRegistryView = _chunk7TD63DZPcjs.ToolRegistryView; exports.UNSAFE_JSON_KEYS = _chunk2BSBFBOAcjs.UNSAFE_JSON_KEYS; exports.baseToolName = _chunk7TD63DZPcjs.baseToolName; exports.callEvalTool = _chunkY3RUYOOWcjs.callEvalTool; exports.captureInputSchema = _chunkN2FGYZ4Qcjs.captureInputSchema; exports.captureOutputSize = _chunkN2FGYZ4Qcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkSVFEVKLFcjs.cloneElementWithStyles; exports.conformanceResult = _chunkY3RUYOOWcjs.conformanceResult; exports.conformanceValuesMatch = _chunkY3RUYOOWcjs.conformanceValuesMatch; exports.connectToolBridge = _chunkZEKI6EPIcjs.connectToolBridge; exports.createAgentPlayback = _chunk3SLBXKAWcjs.createAgentPlayback; exports.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createDocumentChartTools = createDocumentChartTools; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkK7ENM55Pcjs.createInstantPresenceClock; exports.createMcpServer = _chunkZEKI6EPIcjs.createMcpServer; exports.createOriginMiddleware = _chunkY3RUYOOWcjs.createOriginMiddleware; exports.createPlaybackToolProvider = _chunk3SLBXKAWcjs.createPlaybackToolProvider; exports.createReviewToolProvider = createReviewToolProvider; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; exports.createStyleResolver = _chunkMFBUQC67cjs.createStyleResolver; exports.createStyleToolProvider = _chunkY3RUYOOWcjs.createStyleToolProvider; exports.createToolRegistry = _chunk7TD63DZPcjs.createToolRegistry; exports.derivePlaybackSteps = _chunk3SLBXKAWcjs.derivePlaybackSteps; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunk7TD63DZPcjs.errorResult; exports.failedEvalChecks = _chunkY3RUYOOWcjs.failedEvalChecks; exports.imageEvalFixturePixels = _chunkY3RUYOOWcjs.imageEvalFixturePixels; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkillEvals = _chunkY3RUYOOWcjs.listSkillEvals; exports.listSkills = _chunk7TD63DZPcjs.listSkills; exports.locatePlaybackChrome = _chunk3SLBXKAWcjs.locatePlaybackChrome; exports.matchesEvalExpectation = _chunkY3RUYOOWcjs.matchesEvalExpectation; exports.memoryStyleStore = _chunkMFBUQC67cjs.memoryStyleStore; exports.normalizeConformanceValue = _chunkY3RUYOOWcjs.normalizeConformanceValue; exports.normalizeSide = normalizeSide; exports.omitConformancePaths = _chunkY3RUYOOWcjs.omitConformancePaths; exports.parseSkillFrontmatter = _chunk7TD63DZPcjs.parseSkillFrontmatter; exports.parseStyleDomains = _chunkMFBUQC67cjs.parseStyleDomains; exports.planAgentCommand = planAgentCommand; exports.planCanvasPlaybackSteps = planCanvasPlaybackSteps; exports.planCanvasToolPlayback = planCanvasToolPlayback; exports.planToolCall = planToolCall; exports.playbackRectFromClient = _chunk3SLBXKAWcjs.playbackRectFromClient; exports.playbackRefsFromArgs = _chunk3SLBXKAWcjs.playbackRefsFromArgs; exports.playbackRefsFromResult = _chunk3SLBXKAWcjs.playbackRefsFromResult; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunk7TD63DZPcjs.readSkillFile; exports.readingTime = _chunk3SLBXKAWcjs.readingTime; exports.realPresenceClock = _chunkK7ENM55Pcjs.realPresenceClock; exports.renderStyle = _chunkMFBUQC67cjs.renderStyle; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.resolveConformanceArguments = _chunkY3RUYOOWcjs.resolveConformanceArguments; exports.runConformanceScenario = _chunkY3RUYOOWcjs.runConformanceScenario; exports.runStyleChecks = _chunkMFBUQC67cjs.runStyleChecks; exports.runToolScript = _chunkY3RUYOOWcjs.runToolScript; exports.searchTokens = _chunk7TD63DZPcjs.searchTokens; exports.searchTools = _chunk7TD63DZPcjs.searchTools; exports.stripPrototypeKeys = _chunk2BSBFBOAcjs.stripPrototypeKeys; exports.summarize = _chunk7TD63DZPcjs.summarize; exports.toCapturedImageData = _chunkN2FGYZ4Qcjs.toCapturedImageData; exports.toToolResult = _chunk7TD63DZPcjs.toToolResult; exports.toolCallToAgentCommand = toolCallToAgentCommand; exports.toolResultError = _chunkY3RUYOOWcjs.toolResultError; exports.toolResultValue = _chunkY3RUYOOWcjs.toolResultValue; exports.toolsetInstructions = _chunkZEKI6EPIcjs.toolsetInstructions; exports.toolsetName = _chunk7TD63DZPcjs.toolsetName; exports.trackPresenceDrag = _chunkK7ENM55Pcjs.trackPresenceDrag; exports.tweenPresenceCursor = _chunkK7ENM55Pcjs.tweenPresenceCursor; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unionRects = _chunk3SLBXKAWcjs.unionRects; exports.unknownToolMessage = _chunk7TD63DZPcjs.unknownToolMessage; exports.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
@@ -24,24 +24,19 @@ import {
24
24
  conformanceResult,
25
25
  conformanceValuesMatch,
26
26
  createOriginMiddleware,
27
- createStyleResolver,
28
27
  createStyleToolProvider,
29
28
  failedEvalChecks,
30
29
  imageEvalFixturePixels,
31
30
  listSkillEvals,
32
31
  matchesEvalExpectation,
33
- memoryStyleStore,
34
32
  normalizeConformanceValue,
35
33
  omitConformancePaths,
36
- parseStyleDomains,
37
- renderStyle,
38
34
  resolveConformanceArguments,
39
35
  runConformanceScenario,
40
- runStyleChecks,
41
36
  runToolScript,
42
37
  toolResultError,
43
38
  toolResultValue
44
- } from "../chunk-IBXEQOGI.js";
39
+ } from "../chunk-PYHB2EHE.js";
45
40
  import {
46
41
  JSON_RPC_ERRORS,
47
42
  MCP_PROTOCOL_VERSIONS,
@@ -51,6 +46,13 @@ import {
51
46
  createMcpServer,
52
47
  toolsetInstructions
53
48
  } from "../chunk-SYEOA5MS.js";
49
+ import {
50
+ createStyleResolver,
51
+ memoryStyleStore,
52
+ parseStyleDomains,
53
+ renderStyle,
54
+ runStyleChecks
55
+ } from "../chunk-5UGRMVNE.js";
54
56
  import {
55
57
  TOOL_DISCOVERY_TOOLS,
56
58
  TOOL_NAMESPACE_SEPARATOR,
@@ -140,10 +142,10 @@ import {
140
142
  setAgentCaret,
141
143
  sparklineLabel,
142
144
  typeAgentText
143
- } from "../chunk-X4FTNFIA.js";
145
+ } from "../chunk-7MGPW2OV.js";
144
146
  import {
145
147
  describeChart
146
- } from "../chunk-NMZQMPFZ.js";
148
+ } from "../chunk-4LZQO5Y7.js";
147
149
  import "../chunk-KGRZMHZB.js";
148
150
  import "../chunk-C2WEIEUB.js";
149
151
  import "../chunk-O6OGNDND.js";
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The chart editor as language-neutral contracts (`@pixerate/conformance` `domains/chart`), so
3
+ * another implementation (the Swift port, #694) offers the same commands, tools, controls and
4
+ * documents: the commands in `createChartCommands`, the tools of the chart, chart-style and
5
+ * office-charts providers, the UI tables React and Svelte render, and a JSON Schema of a saved
6
+ * chart document. `scripts/export-contracts.mjs` writes them; `tests/chart-contract.test.ts` fails
7
+ * when the committed files differ from what this returns.
8
+ *
9
+ * Everything here is data from this module's own tables and providers; nothing depends on the
10
+ * package version, so a release does not change the files.
11
+ */
12
+ import type { ConformanceHost } from '../tools/conformance.cjs';
13
+ import { type McpToolDefinition } from '../tools/registry.cjs';
14
+ import type { JsonSchema } from '../tools/schema.cjs';
15
+ import { ChartController } from './controller.cjs';
16
+ import { type ChartTextMeasure } from './layout.cjs';
17
+ import { type ChartMapGeometry } from './maps.cjs';
18
+ import { type ChartStyleProfile } from './style.cjs';
19
+ import type { ChartSpec } from './types.cjs';
20
+ /** Bumped when a contract file changes shape (not when its data changes). */
21
+ export declare const CHART_CONTRACT_FORMAT_VERSION = 1;
22
+ /**
23
+ * Fixed text-width measure used by the conformance host (both the controller and the tools) and
24
+ * required of the Swift port so layout coordinates, tick thinning and label truncation match:
25
+ * `text.length * fontSize * (weight >= 600 ? 0.6 : 0.56)` (UTF-16 code units, matching
26
+ * `estimateChartTextWidth`).
27
+ */
28
+ export declare const conformanceChartTextMeasure: ChartTextMeasure;
29
+ /**
30
+ * JSON Schema of a saved chart document: the `pixerate.editor-document` envelope of kind `chart`
31
+ * around a `ChartSpec` (`createChartEditorDocument`), built from `chart/schemas.ts`.
32
+ */
33
+ export declare const CHART_DOCUMENT_JSON_SCHEMA: JsonSchema;
34
+ export interface ChartCommandContractEntry {
35
+ id: string;
36
+ label: string;
37
+ group?: string;
38
+ keywords?: string[];
39
+ description?: string;
40
+ params?: JsonSchema;
41
+ shortcut?: string | string[];
42
+ scope?: string;
43
+ undoable: boolean;
44
+ readOnly: boolean;
45
+ hidden?: boolean;
46
+ }
47
+ export interface ChartToolProviderContract {
48
+ id: string;
49
+ title?: string;
50
+ skill?: string;
51
+ tools: McpToolDefinition[];
52
+ }
53
+ /**
54
+ * Every chart contract file, by its path under `domains/chart/` (plain JSON values).
55
+ */
56
+ export declare function chartContracts(): Record<string, unknown>;
57
+ export interface ChartConformanceSetup {
58
+ /** Initial chart spec (or partial spec) loaded into the controller. */
59
+ spec?: Partial<ChartSpec> | Record<string, unknown>;
60
+ /** Width used by `render()` and default tool calls (default 640). */
61
+ width?: number;
62
+ /** Height used by `render()` and default tool calls (default 400). */
63
+ height?: number;
64
+ /** Read-only state or reason for the chart tool providers. */
65
+ readOnly?: boolean | string;
66
+ /**
67
+ * Open Office files for `createOfficeChartToolProvider`, either as an array of
68
+ * `{ name, data }` (base64 bytes or `Uint8Array`) or a `{ [name]: base64 }` map.
69
+ */
70
+ files?: ReadonlyArray<{
71
+ name: string;
72
+ data: string | Uint8Array;
73
+ }> | Record<string, string | Uint8Array>;
74
+ /** Optional house-style profile for `check_chart_style`. */
75
+ style?: ChartStyleProfile;
76
+ /** Extra map geometries to register alongside `EUROPE_CHART_MAP`. */
77
+ maps?: ReadonlyArray<ChartMapGeometry>;
78
+ }
79
+ export interface ChartConformanceHost extends ConformanceHost {
80
+ readonly controller: ChartController;
81
+ /** Advances the manual bar-race clock by `ms` and runs any queued animation frame steps. */
82
+ advanceRace(ms?: number): void;
83
+ }
84
+ /**
85
+ * A fresh chart editor for replaying a conformance scenario (`domains/chart/fixtures`):
86
+ * - A manual `raceTicker`: `now()` returns a counter the host advances via `advanceRace`, and
87
+ * `next()` queues the step instead of using timers, so `play_chart_race` records the same result
88
+ * on every run.
89
+ * - Fixed `measureText` (`conformanceChartTextMeasure`) in both the controller and the tools.
90
+ * - Series ids come from `uniqueChartSeriesId`'s counter (`series-1`, `series-2`, …).
91
+ * - In-memory `files` decoded from `setup.files` (base64 bytes) for the Office chart tools.
92
+ * - `render()` returns the `ChartScene` from `layoutChart` for the current state.
93
+ * - No `rasterize` option, so `render_chart` with `format: "png"` returns its documented error.
94
+ */
95
+ export declare function createChartConformanceHost(setup?: ChartConformanceSetup & Record<string, unknown>): ChartConformanceHost;
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The chart editor as language-neutral contracts (`@pixerate/conformance` `domains/chart`), so
3
+ * another implementation (the Swift port, #694) offers the same commands, tools, controls and
4
+ * documents: the commands in `createChartCommands`, the tools of the chart, chart-style and
5
+ * office-charts providers, the UI tables React and Svelte render, and a JSON Schema of a saved
6
+ * chart document. `scripts/export-contracts.mjs` writes them; `tests/chart-contract.test.ts` fails
7
+ * when the committed files differ from what this returns.
8
+ *
9
+ * Everything here is data from this module's own tables and providers; nothing depends on the
10
+ * package version, so a release does not change the files.
11
+ */
12
+ import type { ConformanceHost } from '../tools/conformance.js';
13
+ import { type McpToolDefinition } from '../tools/registry.js';
14
+ import type { JsonSchema } from '../tools/schema.js';
15
+ import { ChartController } from './controller.js';
16
+ import { type ChartTextMeasure } from './layout.js';
17
+ import { type ChartMapGeometry } from './maps.js';
18
+ import { type ChartStyleProfile } from './style.js';
19
+ import type { ChartSpec } from './types.js';
20
+ /** Bumped when a contract file changes shape (not when its data changes). */
21
+ export declare const CHART_CONTRACT_FORMAT_VERSION = 1;
22
+ /**
23
+ * Fixed text-width measure used by the conformance host (both the controller and the tools) and
24
+ * required of the Swift port so layout coordinates, tick thinning and label truncation match:
25
+ * `text.length * fontSize * (weight >= 600 ? 0.6 : 0.56)` (UTF-16 code units, matching
26
+ * `estimateChartTextWidth`).
27
+ */
28
+ export declare const conformanceChartTextMeasure: ChartTextMeasure;
29
+ /**
30
+ * JSON Schema of a saved chart document: the `pixerate.editor-document` envelope of kind `chart`
31
+ * around a `ChartSpec` (`createChartEditorDocument`), built from `chart/schemas.ts`.
32
+ */
33
+ export declare const CHART_DOCUMENT_JSON_SCHEMA: JsonSchema;
34
+ export interface ChartCommandContractEntry {
35
+ id: string;
36
+ label: string;
37
+ group?: string;
38
+ keywords?: string[];
39
+ description?: string;
40
+ params?: JsonSchema;
41
+ shortcut?: string | string[];
42
+ scope?: string;
43
+ undoable: boolean;
44
+ readOnly: boolean;
45
+ hidden?: boolean;
46
+ }
47
+ export interface ChartToolProviderContract {
48
+ id: string;
49
+ title?: string;
50
+ skill?: string;
51
+ tools: McpToolDefinition[];
52
+ }
53
+ /**
54
+ * Every chart contract file, by its path under `domains/chart/` (plain JSON values).
55
+ */
56
+ export declare function chartContracts(): Record<string, unknown>;
57
+ export interface ChartConformanceSetup {
58
+ /** Initial chart spec (or partial spec) loaded into the controller. */
59
+ spec?: Partial<ChartSpec> | Record<string, unknown>;
60
+ /** Width used by `render()` and default tool calls (default 640). */
61
+ width?: number;
62
+ /** Height used by `render()` and default tool calls (default 400). */
63
+ height?: number;
64
+ /** Read-only state or reason for the chart tool providers. */
65
+ readOnly?: boolean | string;
66
+ /**
67
+ * Open Office files for `createOfficeChartToolProvider`, either as an array of
68
+ * `{ name, data }` (base64 bytes or `Uint8Array`) or a `{ [name]: base64 }` map.
69
+ */
70
+ files?: ReadonlyArray<{
71
+ name: string;
72
+ data: string | Uint8Array;
73
+ }> | Record<string, string | Uint8Array>;
74
+ /** Optional house-style profile for `check_chart_style`. */
75
+ style?: ChartStyleProfile;
76
+ /** Extra map geometries to register alongside `EUROPE_CHART_MAP`. */
77
+ maps?: ReadonlyArray<ChartMapGeometry>;
78
+ }
79
+ export interface ChartConformanceHost extends ConformanceHost {
80
+ readonly controller: ChartController;
81
+ /** Advances the manual bar-race clock by `ms` and runs any queued animation frame steps. */
82
+ advanceRace(ms?: number): void;
83
+ }
84
+ /**
85
+ * A fresh chart editor for replaying a conformance scenario (`domains/chart/fixtures`):
86
+ * - A manual `raceTicker`: `now()` returns a counter the host advances via `advanceRace`, and
87
+ * `next()` queues the step instead of using timers, so `play_chart_race` records the same result
88
+ * on every run.
89
+ * - Fixed `measureText` (`conformanceChartTextMeasure`) in both the controller and the tools.
90
+ * - Series ids come from `uniqueChartSeriesId`'s counter (`series-1`, `series-2`, …).
91
+ * - In-memory `files` decoded from `setup.files` (base64 bytes) for the Office chart tools.
92
+ * - `render()` returns the `ChartScene` from `layoutChart` for the current state.
93
+ * - No `rasterize` option, so `render_chart` with `format: "png"` returns its documented error.
94
+ */
95
+ export declare function createChartConformanceHost(setup?: ChartConformanceSetup & Record<string, unknown>): ChartConformanceHost;
@@ -1,4 +1,5 @@
1
1
  import { HistoryManager } from '../history/HistoryManager.cjs';
2
+ import { type ChartTextMeasure } from './layout.cjs';
2
3
  import { type ChartTrendFit } from './trend.cjs';
3
4
  import { type ChartTreeRow } from './tree.cjs';
4
5
  import { type ChartTableOptions } from './spec.cjs';
@@ -12,6 +13,8 @@ export interface ChartControllerOptions {
12
13
  onChange?: (spec: Readonly<ChartSpec>) => void;
13
14
  /** Time and frames for playing a bar race (default: `performance.now` / `requestAnimationFrame`, else timers). */
14
15
  raceTicker?: ChartRaceTicker;
16
+ /** Text width in pixels for layout, summaries and hit testing (default: `estimateChartTextWidth`). */
17
+ measureText?: ChartTextMeasure;
15
18
  }
16
19
  /** Drives bar race playback: the current time in ms, and a way to run `step` on the next frame (returns a cancel). */
17
20
  export interface ChartRaceTicker {
@@ -111,6 +114,7 @@ export interface ChartEditOptions {
111
114
  */
112
115
  export declare class ChartController {
113
116
  readonly history: HistoryManager;
117
+ readonly measureText?: ChartTextMeasure;
114
118
  private spec;
115
119
  private selection;
116
120
  private issues;
@@ -1,4 +1,5 @@
1
1
  import { HistoryManager } from '../history/HistoryManager.js';
2
+ import { type ChartTextMeasure } from './layout.js';
2
3
  import { type ChartTrendFit } from './trend.js';
3
4
  import { type ChartTreeRow } from './tree.js';
4
5
  import { type ChartTableOptions } from './spec.js';
@@ -12,6 +13,8 @@ export interface ChartControllerOptions {
12
13
  onChange?: (spec: Readonly<ChartSpec>) => void;
13
14
  /** Time and frames for playing a bar race (default: `performance.now` / `requestAnimationFrame`, else timers). */
14
15
  raceTicker?: ChartRaceTicker;
16
+ /** Text width in pixels for layout, summaries and hit testing (default: `estimateChartTextWidth`). */
17
+ measureText?: ChartTextMeasure;
15
18
  }
16
19
  /** Drives bar race playback: the current time in ms, and a way to run `step` on the next frame (returns a cancel). */
17
20
  export interface ChartRaceTicker {
@@ -111,6 +114,7 @@ export interface ChartEditOptions {
111
114
  */
112
115
  export declare class ChartController {
113
116
  readonly history: HistoryManager;
117
+ readonly measureText?: ChartTextMeasure;
114
118
  private spec;
115
119
  private selection;
116
120
  private issues;