@pixerate/editor 0.52.0 → 0.54.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 (142) hide show
  1. package/dist/agent/index.cjs +37 -29
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.d.cts +4 -3
  4. package/dist/agent/index.d.ts +4 -3
  5. package/dist/agent/index.js +16 -8
  6. package/dist/agent/index.js.map +1 -1
  7. package/dist/animation/index.cjs +15 -1
  8. package/dist/animation/index.cjs.map +1 -1
  9. package/dist/animation/index.d.cts +3 -226
  10. package/dist/animation/index.d.ts +3 -226
  11. package/dist/animation/index.js +14 -0
  12. package/dist/bridge/cli.cjs +36 -0
  13. package/dist/bridge/cli.cjs.map +1 -0
  14. package/dist/bridge/cli.d.cts +1 -0
  15. package/dist/bridge/cli.d.ts +1 -0
  16. package/dist/bridge/cli.js +36 -0
  17. package/dist/bridge/cli.js.map +1 -0
  18. package/dist/bridge/index.cjs +16 -0
  19. package/dist/bridge/index.cjs.map +1 -0
  20. package/dist/bridge/index.d.cts +65 -0
  21. package/dist/bridge/index.d.ts +65 -0
  22. package/dist/bridge/index.js +16 -0
  23. package/dist/bridge/index.js.map +1 -0
  24. package/dist/bridge-client-C5OziCRK.d.cts +148 -0
  25. package/dist/bridge-client-C5dRjrz5.d.ts +148 -0
  26. package/dist/canvas/index.cjs +1308 -528
  27. package/dist/canvas/index.cjs.map +1 -1
  28. package/dist/canvas/index.d.cts +309 -5
  29. package/dist/canvas/index.d.ts +309 -5
  30. package/dist/canvas/index.js +1295 -515
  31. package/dist/canvas/index.js.map +1 -1
  32. package/dist/chart/index.cjs +193 -192
  33. package/dist/chart/index.cjs.map +1 -1
  34. package/dist/chart/index.d.cts +77 -59
  35. package/dist/chart/index.d.ts +77 -59
  36. package/dist/chart/index.js +87 -86
  37. package/dist/chart/index.js.map +1 -1
  38. package/dist/{chunk-UAW5FEMD.js → chunk-3S72F46R.js} +66 -8
  39. package/dist/chunk-3S72F46R.js.map +1 -0
  40. package/dist/{chunk-5TWIN7ZJ.js → chunk-47WWV3LI.js} +34 -4
  41. package/dist/chunk-47WWV3LI.js.map +1 -0
  42. package/dist/{chunk-OV7UAKIY.js → chunk-633QC34G.js} +172 -1
  43. package/dist/chunk-633QC34G.js.map +1 -0
  44. package/dist/chunk-AWKPSOSX.js +401 -0
  45. package/dist/chunk-AWKPSOSX.js.map +1 -0
  46. package/dist/chunk-B6DSIEXA.js +96 -0
  47. package/dist/chunk-B6DSIEXA.js.map +1 -0
  48. package/dist/{chunk-5N6AQCVB.js → chunk-BQQZ6MOI.js} +3 -3
  49. package/dist/{chunk-M5Z77GFH.cjs → chunk-C3JHII3M.cjs} +53 -53
  50. package/dist/{chunk-M5Z77GFH.cjs.map → chunk-C3JHII3M.cjs.map} +1 -1
  51. package/dist/{chunk-JOX6MJW4.cjs → chunk-CKRNELPO.cjs} +176 -5
  52. package/dist/chunk-CKRNELPO.cjs.map +1 -0
  53. package/dist/{chunk-TGBCBQFV.cjs → chunk-DK6QBGCS.cjs} +45 -15
  54. package/dist/chunk-DK6QBGCS.cjs.map +1 -0
  55. package/dist/chunk-EGFUVXKK.cjs +96 -0
  56. package/dist/chunk-EGFUVXKK.cjs.map +1 -0
  57. package/dist/{chunk-AMWXSYCI.js → chunk-GPWNYQ7R.js} +2 -370
  58. package/dist/chunk-GPWNYQ7R.js.map +1 -0
  59. package/dist/chunk-H5K77C7Y.cjs +3848 -0
  60. package/dist/chunk-H5K77C7Y.cjs.map +1 -0
  61. package/dist/chunk-K73CKYUM.cjs +458 -0
  62. package/dist/chunk-K73CKYUM.cjs.map +1 -0
  63. package/dist/{chunk-GTZXF4BI.cjs → chunk-NK3WL5TJ.cjs} +298 -133
  64. package/dist/chunk-NK3WL5TJ.cjs.map +1 -0
  65. package/dist/{chunk-3ZBAXET6.cjs → chunk-NN3JGUSX.cjs} +80 -22
  66. package/dist/chunk-NN3JGUSX.cjs.map +1 -0
  67. package/dist/chunk-NV22EMOZ.cjs +401 -0
  68. package/dist/chunk-NV22EMOZ.cjs.map +1 -0
  69. package/dist/{chunk-YMKPMXZ4.js → chunk-OIKYP7XC.js} +4 -4
  70. package/dist/{chunk-FEMIVHN3.cjs → chunk-P43HUQRX.cjs} +16 -16
  71. package/dist/{chunk-FEMIVHN3.cjs.map → chunk-P43HUQRX.cjs.map} +1 -1
  72. package/dist/chunk-PTMIGXZ2.js +467 -0
  73. package/dist/chunk-PTMIGXZ2.js.map +1 -0
  74. package/dist/chunk-QIWFEEWG.cjs +467 -0
  75. package/dist/chunk-QIWFEEWG.cjs.map +1 -0
  76. package/dist/{chunk-QFTVLEVN.js → chunk-RIXTW3C4.js} +3 -3
  77. package/dist/{chunk-WBOAXDKD.js → chunk-VODBAO32.js} +222 -57
  78. package/dist/chunk-VODBAO32.js.map +1 -0
  79. package/dist/chunk-WWJNC7SX.js +3848 -0
  80. package/dist/chunk-WWJNC7SX.js.map +1 -0
  81. package/dist/{chunk-2DEBI6KU.cjs → chunk-YZZMX6V7.cjs} +10 -10
  82. package/dist/{chunk-2DEBI6KU.cjs.map → chunk-YZZMX6V7.cjs.map} +1 -1
  83. package/dist/commands/index.d.cts +1 -1
  84. package/dist/commands/index.d.ts +1 -1
  85. package/dist/{controller-DS3drIvy.d.cts → controller-CX0QfSv0.d.cts} +53 -2
  86. package/dist/{controller-BdKzaxs2.d.ts → controller-DscWQbjO.d.ts} +53 -2
  87. package/dist/diagram/index.cjs +1146 -0
  88. package/dist/diagram/index.cjs.map +1 -0
  89. package/dist/diagram/index.d.cts +787 -0
  90. package/dist/diagram/index.d.ts +787 -0
  91. package/dist/diagram/index.js +1146 -0
  92. package/dist/diagram/index.js.map +1 -0
  93. package/dist/{easing-DTmX99QG.d.cts → easing-CNGk-W6d.d.cts} +1 -1
  94. package/dist/{easing-DTmX99QG.d.ts → easing-CNGk-W6d.d.ts} +1 -1
  95. package/dist/export/index.cjs +4 -4
  96. package/dist/export/index.js +3 -3
  97. package/dist/extensions/index.cjs +6 -6
  98. package/dist/extensions/index.d.cts +2 -2
  99. package/dist/extensions/index.d.ts +2 -2
  100. package/dist/extensions/index.js +5 -5
  101. package/dist/generation/index.d.cts +2 -2
  102. package/dist/generation/index.d.ts +2 -2
  103. package/dist/image-editor/index.d.cts +1 -1
  104. package/dist/image-editor/index.d.ts +1 -1
  105. package/dist/{index-Dt9lzydb.d.ts → index-CALDD35B.d.ts} +1 -1
  106. package/dist/{index-DOy9HzfC.d.cts → index-DIWB6xMf.d.cts} +1 -1
  107. package/dist/index.cjs +13 -13
  108. package/dist/index.d.cts +3 -3
  109. package/dist/index.d.ts +3 -3
  110. package/dist/index.js +6 -6
  111. package/dist/parameters/index.d.cts +1 -1
  112. package/dist/parameters/index.d.ts +1 -1
  113. package/dist/player-DSMjdgQ9.d.cts +225 -0
  114. package/dist/player-DdfVrKWq.d.ts +225 -0
  115. package/dist/presence-Cb6WhcrQ.d.cts +77 -0
  116. package/dist/presence-Cb6WhcrQ.d.ts +77 -0
  117. package/dist/{registry-CSlH4iUn.d.ts → registry-7AZFuand.d.ts} +1 -1
  118. package/dist/{registry-B4l-lYts.d.cts → registry-DIpIaCkH.d.cts} +1 -1
  119. package/dist/tools/index.cjs +10 -2
  120. package/dist/tools/index.cjs.map +1 -1
  121. package/dist/tools/index.d.cts +3 -74
  122. package/dist/tools/index.d.ts +3 -74
  123. package/dist/tools/index.js +12 -4
  124. package/dist/types-BULrFyuQ.d.cts +316 -0
  125. package/dist/types-BULrFyuQ.d.ts +316 -0
  126. package/dist/vector/index.d.cts +1 -1
  127. package/dist/vector/index.d.ts +1 -1
  128. package/package.json +14 -1
  129. package/dist/chunk-3ZBAXET6.cjs.map +0 -1
  130. package/dist/chunk-5TWIN7ZJ.js.map +0 -1
  131. package/dist/chunk-AMWXSYCI.js.map +0 -1
  132. package/dist/chunk-GTZXF4BI.cjs.map +0 -1
  133. package/dist/chunk-JOX6MJW4.cjs.map +0 -1
  134. package/dist/chunk-OV7UAKIY.js.map +0 -1
  135. package/dist/chunk-TGBCBQFV.cjs.map +0 -1
  136. package/dist/chunk-UAW5FEMD.js.map +0 -1
  137. package/dist/chunk-WBOAXDKD.js.map +0 -1
  138. package/dist/chunk-XFYUFVAX.cjs +0 -826
  139. package/dist/chunk-XFYUFVAX.cjs.map +0 -1
  140. /package/dist/{chunk-5N6AQCVB.js.map → chunk-BQQZ6MOI.js.map} +0 -0
  141. /package/dist/{chunk-YMKPMXZ4.js.map → chunk-OIKYP7XC.js.map} +0 -0
  142. /package/dist/{chunk-QFTVLEVN.js.map → chunk-RIXTW3C4.js.map} +0 -0
@@ -0,0 +1,96 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;// src/animation/presence.ts
2
+ var PRESENCE_COLORS = ["#7c3aed", "#db2777", "#0891b2", "#ea580c", "#16a34a"];
3
+ var PresenceStore = (_class = class {constructor() { _class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this); }
4
+ __init() {this.state = { actors: [] }}
5
+ __init2() {this.listeners = /* @__PURE__ */ new Set()}
6
+ __init3() {this.getState = () => this.state}
7
+ __init4() {this.subscribe = (listener) => {
8
+ this.listeners.add(listener);
9
+ return () => {
10
+ this.listeners.delete(listener);
11
+ };
12
+ }}
13
+ /** The actor with `id`, if it is on the surface. */
14
+ get(id) {
15
+ return this.state.actors.find((a) => a.id === id);
16
+ }
17
+ /** Adds or changes an actor. */
18
+ set(actor) {
19
+ const current = this.get(actor.id);
20
+ const next = { name: actor.id, color: PRESENCE_COLORS[this.state.actors.length % PRESENCE_COLORS.length], x: 0, y: 0, pressed: false, ...current, ...actor };
21
+ this.state = { actors: current ? this.state.actors.map((a) => a.id === actor.id ? next : a) : [...this.state.actors, next] };
22
+ this.listeners.forEach((l) => l(this.state));
23
+ }
24
+ remove(id) {
25
+ if (!this.get(id)) return;
26
+ this.state = { actors: this.state.actors.filter((a) => a.id !== id) };
27
+ this.listeners.forEach((l) => l(this.state));
28
+ }
29
+ }, _class);
30
+ var realPresenceClock = {
31
+ now: () => Date.now(),
32
+ wait: (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)))
33
+ };
34
+ function createInstantPresenceClock(start = 0) {
35
+ let t = start;
36
+ return {
37
+ now: () => t,
38
+ wait: async (ms) => {
39
+ t += Math.max(0, ms);
40
+ },
41
+ elapsed: () => t - start
42
+ };
43
+ }
44
+ async function tweenPresenceCursor(presence, clock, id, from, to, ms, each) {
45
+ const frames = Math.max(1, Math.round(ms / 16));
46
+ for (let f = 1; f <= frames; f++) {
47
+ const t = f / frames;
48
+ const e = 1 - Math.pow(1 - t, 3);
49
+ presence.set({ id, x: from.x + (to.x - from.x) * e, y: from.y + (to.y - from.y) * e });
50
+ _optionalChain([each, 'optionalCall', _ => _(e)]);
51
+ await clock.wait(ms / frames);
52
+ }
53
+ }
54
+ var PerformanceQueue = (_class2 = class {
55
+ constructor(presence, options) {;_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);
56
+ this.presence = presence;
57
+ this.options = options;
58
+ }
59
+
60
+
61
+ __init5() {this.queues = /* @__PURE__ */ new Map()}
62
+ __init6() {this.calls = 0}
63
+ run(actor, perform) {
64
+ const prev = _nullishCoalesce(this.queues.get(actor.id), () => ( Promise.resolve()));
65
+ const run = prev.then(async () => {
66
+ this.presence.set({ id: actor.id, ...actor.name ? { name: actor.name } : {}, ...actor.color ? { color: actor.color } : {} });
67
+ _optionalChain([this, 'access', _2 => _2.options, 'access', _3 => _3.beginGesture, 'optionalCall', _4 => _4(`agent:${actor.id}:${++this.calls}`)]);
68
+ let result;
69
+ try {
70
+ result = await perform();
71
+ } finally {
72
+ _optionalChain([this, 'access', _5 => _5.options, 'access', _6 => _6.endGesture, 'optionalCall', _7 => _7()]);
73
+ this.presence.set({ id: actor.id, message: void 0, pressed: false });
74
+ }
75
+ const linger = _nullishCoalesce(this.options.linger, () => ( 1500));
76
+ if (linger > 0) {
77
+ await this.options.clock.wait(linger);
78
+ if (this.queues.get(actor.id) === guarded) this.presence.remove(actor.id);
79
+ }
80
+ return result;
81
+ });
82
+ const guarded = run.catch(() => void 0);
83
+ this.queues.set(actor.id, guarded);
84
+ return run;
85
+ }
86
+ }, _class2);
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ exports.PRESENCE_COLORS = PRESENCE_COLORS; exports.PresenceStore = PresenceStore; exports.realPresenceClock = realPresenceClock; exports.createInstantPresenceClock = createInstantPresenceClock; exports.tweenPresenceCursor = tweenPresenceCursor; exports.PerformanceQueue = PerformanceQueue;
96
+ //# sourceMappingURL=chunk-EGFUVXKK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-EGFUVXKK.cjs","../src/animation/presence.ts"],"names":[],"mappings":"AAAA;ACwBO,IAAM,gBAAA,EAAqC,CAAC,SAAA,EAAW,SAAA,EAAW,SAAA,EAAW,SAAA,EAAW,SAAS,CAAA;AAGjG,IAAM,cAAA,YAAN,MAAoB;AAAA,iBAClB,MAAA,EAAuB,EAAE,MAAA,EAAQ,CAAC,EAAE,EAAA;AAAA,kBAC3B,UAAA,kBAAY,IAAI,GAAA,CAAoC,EAAA;AAAA,kBAErE,SAAA,EAAW,CAAA,EAAA,GAAqB,IAAA,CAAK,MAAA;AAAA,kBAErC,UAAA,EAAY,CAAC,QAAA,EAAA,GAA2D;AACvE,IAAA,IAAA,CAAK,SA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AAA,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,EAAE,EAAA,EAAI,KAAA,CAAM,EAAA,EAAI,GAAI,KAAA,CAAM,KAAA,EAAO,EAAE,IAAA,EAAM,KAAA,CAAM,KAAK,EAAA,EAAI,CAAC,CAAA,EAAI,GAAI,KAAA,CAAM,MAAA,EAAQ,EAAE,KAAA,EAAO,KAAA,CAAM,MAAM,EAAA,EAAI,CAAC,EAAG,CAAC,CAAA;AAC/H,sBAAA,IAAA,qBAAK,OAAA,qBAAQ,YAAA,0BAAA,CAAe,CAAA,MAAA,EAAS,KAAA,CAAM,EAAE,CAAA,CAAA,EAAI,EAAE,IAAA,CAAK,KAAK,CAAA,CAAA;AACzD,MAAA;AACA,MAAA;AACoB,QAAA;AACtB,MAAA;AACyB,wBAAA;AACqC,QAAA;AAChE,MAAA;AACsC,MAAA;AACtB,MAAA;AACqB,QAAA;AACqB,QAAA;AAC1D,MAAA;AACO,MAAA;AACP,IAAA;AACwC,IAAA;AACR,IAAA;AAC1B,IAAA;AACR,EAAA;AACD;ADxEoE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-EGFUVXKK.cjs","sourcesContent":[null,"// Agent \"performances\" follow Ursula's remote control (src/remote/commands.ts `planCommand`,\n// src/react/remote/director.ts, presence.ts, clock.ts): a pure planner turns a command into\n// cursor steps, a director acts them out per actor and commits each call as one undo step,\n// and the clock is injectable so performances are repeatable in tests. This module holds the\n// parts every director shares (charts, Mermaid diagrams): the cursor store, the clock, the\n// cursor tween and the per-actor queue.\n\nexport interface PresenceActor {\n\tid: string;\n\tname: string;\n\tcolor: string;\n\t/** Cursor position in the surface's own coordinates (scene / canvas). */\n\tx: number;\n\ty: number;\n\t/** The button is down (dragging). */\n\tpressed: boolean;\n\t/** A short note shown next to the cursor (what the agent is doing). */\n\tmessage?: string;\n}\n\nexport interface PresenceState {\n\tactors: readonly PresenceActor[];\n}\n\nexport const PRESENCE_COLORS: readonly string[] = ['#7c3aed', '#db2777', '#0891b2', '#ea580c', '#16a34a'];\n\n/** Cursor positions and notes of agents acting on a surface, for an overlay. */\nexport class PresenceStore {\n\tprivate state: PresenceState = { actors: [] };\n\tprivate readonly listeners = new Set<(state: PresenceState) => void>();\n\n\tgetState = (): PresenceState => this.state;\n\n\tsubscribe = (listener: (state: PresenceState) => void): (() => void) => {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t};\n\n\t/** The actor with `id`, if it is on the surface. */\n\tget(id: string): PresenceActor | undefined {\n\t\treturn this.state.actors.find((a) => a.id === id);\n\t}\n\n\t/** Adds or changes an actor. */\n\tset(actor: Pick<PresenceActor, 'id'> & Partial<PresenceActor>): void {\n\t\tconst current = this.get(actor.id);\n\t\tconst next: PresenceActor = { name: actor.id, color: PRESENCE_COLORS[this.state.actors.length % PRESENCE_COLORS.length]!, x: 0, y: 0, pressed: false, ...current, ...actor };\n\t\tthis.state = { actors: current ? this.state.actors.map((a) => (a.id === actor.id ? next : a)) : [...this.state.actors, next] };\n\t\tthis.listeners.forEach((l) => l(this.state));\n\t}\n\n\tremove(id: string): void {\n\t\tif (!this.get(id)) return;\n\t\tthis.state = { actors: this.state.actors.filter((a) => a.id !== id) };\n\t\tthis.listeners.forEach((l) => l(this.state));\n\t}\n}\n\n/** Time for performances: real timers, or an instant clock for tests and recordings. */\nexport interface PresenceClock {\n\tnow(): number;\n\twait(ms: number): Promise<void>;\n}\n\nexport const realPresenceClock: PresenceClock = {\n\tnow: () => Date.now(),\n\twait: (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)))\n};\n\n/** A clock whose waits finish at once while its time still advances (repeatable performances). */\nexport function createInstantPresenceClock(start = 0): PresenceClock & { elapsed(): number } {\n\tlet t = start;\n\treturn {\n\t\tnow: () => t,\n\t\twait: async (ms) => {\n\t\t\tt += Math.max(0, ms);\n\t\t},\n\t\telapsed: () => t - start\n\t};\n}\n\n/**\n * Glides an actor's cursor from `from` to `to` over `ms` (ease-out cubic, ~60 frames a second),\n * calling `each` with the eased progress after every frame (e.g. to drag a value along).\n */\nexport async function tweenPresenceCursor(\n\tpresence: PresenceStore,\n\tclock: PresenceClock,\n\tid: string,\n\tfrom: { x: number; y: number },\n\tto: { x: number; y: number },\n\tms: number,\n\teach?: (t: number) => void\n): Promise<void> {\n\tconst frames = Math.max(1, Math.round(ms / 16));\n\tfor (let f = 1; f <= frames; f++) {\n\t\tconst t = f / frames;\n\t\tconst e = 1 - Math.pow(1 - t, 3);\n\t\tpresence.set({ id, x: from.x + (to.x - from.x) * e, y: from.y + (to.y - from.y) * e });\n\t\teach?.(e);\n\t\tawait clock.wait(ms / frames);\n\t}\n}\n\nexport interface PresenceActorInfo {\n\tid: string;\n\tname?: string;\n\tcolor?: string;\n}\n\nexport interface PerformanceQueueOptions {\n\tclock: PresenceClock;\n\t/** Hide each actor's cursor this long after its last call (ms, default 1500; 0 keeps it). */\n\tlinger?: number;\n\t/** Called around each call so everything it changes is one undo step. */\n\tbeginGesture?: (key: string) => void;\n\tendGesture?: () => void;\n}\n\n/**\n * Runs performances one after another per actor (different actors run side by side). Each\n * call shows the actor's cursor, wraps the call in one gesture (one undo step), clears the\n * note when it ends, and hides the cursor after `linger` unless another call followed.\n */\nexport class PerformanceQueue {\n\tprivate readonly queues = new Map<string, Promise<unknown>>();\n\tprivate calls = 0;\n\n\tconstructor(\n\t\treadonly presence: PresenceStore,\n\t\tprivate readonly options: PerformanceQueueOptions\n\t) {}\n\n\trun<T>(actor: PresenceActorInfo, perform: () => Promise<T>): Promise<T> {\n\t\tconst prev = this.queues.get(actor.id) ?? Promise.resolve();\n\t\tconst run = prev.then(async () => {\n\t\t\tthis.presence.set({ id: actor.id, ...(actor.name ? { name: actor.name } : {}), ...(actor.color ? { color: actor.color } : {}) });\n\t\t\tthis.options.beginGesture?.(`agent:${actor.id}:${++this.calls}`);\n\t\t\tlet result: T;\n\t\t\ttry {\n\t\t\t\tresult = await perform();\n\t\t\t} finally {\n\t\t\t\tthis.options.endGesture?.();\n\t\t\t\tthis.presence.set({ id: actor.id, message: undefined, pressed: false });\n\t\t\t}\n\t\t\tconst linger = this.options.linger ?? 1500;\n\t\t\tif (linger > 0) {\n\t\t\t\tawait this.options.clock.wait(linger);\n\t\t\t\tif (this.queues.get(actor.id) === guarded) this.presence.remove(actor.id);\n\t\t\t}\n\t\t\treturn result;\n\t\t});\n\t\tconst guarded = run.catch(() => undefined);\n\t\tthis.queues.set(actor.id, guarded);\n\t\treturn run;\n\t}\n}\n"]}
@@ -1,242 +1,3 @@
1
- import {
2
- validateJsonSchema
3
- } from "./chunk-4FX5ACVG.js";
4
-
5
- // src/tools/registry.ts
6
- var ToolRegistryError = class extends Error {
7
- code;
8
- constructor(code, message) {
9
- super(message);
10
- this.name = "ToolRegistryError";
11
- this.code = code;
12
- }
13
- };
14
- var TOOL_NAMESPACE_SEPARATOR = "__";
15
- var TOOL_NAME_REGEX = /^[A-Za-z0-9_.-]{1,128}$/;
16
- var sanitizeNamespace = (id) => id.replace(/[^A-Za-z0-9_-]/g, "_");
17
- function readTools(provider) {
18
- return typeof provider.tools === "function" ? provider.tools() : provider.tools;
19
- }
20
- function toDefinition(name, tool) {
21
- const { handler: _handler, name: _name, ...rest } = tool;
22
- return { name, ...rest };
23
- }
24
- function errorResult(error) {
25
- const details = error.details?.length ? "\n" + error.details.map((d) => `- ${d.path}: ${d.message}`).join("\n") : "";
26
- return {
27
- isError: true,
28
- content: [{ type: "text", text: `${error.message}${details}` }],
29
- structuredContent: { error }
30
- };
31
- }
32
- function toToolResult(value) {
33
- if (value && typeof value === "object" && Array.isArray(value.content)) {
34
- return value;
35
- }
36
- if (value === void 0) return { content: [] };
37
- if (typeof value === "string") return { content: [{ type: "text", text: value }] };
38
- const text = JSON.stringify(value);
39
- const isPlainObject = typeof value === "object" && value !== null && !Array.isArray(value);
40
- return {
41
- content: [{ type: "text", text: text ?? String(value) }],
42
- ...isPlainObject ? { structuredContent: value } : {}
43
- };
44
- }
45
- var ToolRegistry = class {
46
- /** MCP server capabilities this registry supports. */
47
- capabilities = { tools: { listChanged: true } };
48
- entries = [];
49
- listeners = /* @__PURE__ */ new Set();
50
- options;
51
- timer = null;
52
- lastSignature;
53
- constructor(options = {}) {
54
- this.options = {
55
- onCollision: options.onCollision ?? "namespace",
56
- listChangedDelayMs: options.listChangedDelayMs ?? 0,
57
- validateArguments: options.validateArguments ?? true
58
- };
59
- this.lastSignature = this.signature();
60
- }
61
- /**
62
- * Registers a provider and returns a function that unregisters it.
63
- * Throws a {@link ToolRegistryError} for a duplicate provider id, an invalid
64
- * tool name, or (with `onCollision: 'error'`) a tool name collision.
65
- */
66
- register(provider) {
67
- if (this.entries.some((e) => e.provider.id === provider.id)) {
68
- throw new ToolRegistryError("duplicate_provider", `Tool provider "${provider.id}" is already registered.`);
69
- }
70
- for (const tool of readTools(provider)) {
71
- if (!TOOL_NAME_REGEX.test(tool.name)) {
72
- throw new ToolRegistryError("invalid_tool", `Invalid tool name "${tool.name}" from provider "${provider.id}".`);
73
- }
74
- }
75
- const entry = { provider };
76
- this.entries.push(entry);
77
- try {
78
- const names = this.resolve(this.options.onCollision === "error").map((t) => t.name);
79
- const duplicate = names.find((name, i) => names.indexOf(name) !== i);
80
- if (duplicate) {
81
- throw new ToolRegistryError("name_collision", `Tool name "${duplicate}" is exposed more than once.`);
82
- }
83
- } catch (error) {
84
- this.entries.pop();
85
- throw error;
86
- }
87
- if (provider.subscribe) {
88
- entry.unsubscribe = provider.subscribe(() => this.notifyListChanged());
89
- }
90
- this.notifyListChanged();
91
- let registered = true;
92
- return () => {
93
- if (!registered) return;
94
- registered = false;
95
- this.unregister(provider);
96
- };
97
- }
98
- /** Removes a provider by id or instance. Returns whether it was registered. */
99
- unregister(providerOrId) {
100
- const index = this.entries.findIndex(
101
- (e) => typeof providerOrId === "string" ? e.provider.id === providerOrId : e.provider === providerOrId
102
- );
103
- if (index === -1) return false;
104
- const [entry] = this.entries.splice(index, 1);
105
- entry.unsubscribe?.();
106
- this.notifyListChanged();
107
- return true;
108
- }
109
- /** Registered provider ids in registration order. */
110
- providerIds() {
111
- return this.entries.map((e) => e.provider.id);
112
- }
113
- /**
114
- * Resolves exposed names. Tools are ordered by provider registration, then
115
- * by their order within the provider.
116
- */
117
- resolve(throwOnCollision = false) {
118
- const all = [];
119
- const counts = /* @__PURE__ */ new Map();
120
- for (const { provider } of this.entries) {
121
- for (const tool of readTools(provider)) {
122
- all.push({ name: tool.name, tool, provider });
123
- if (!provider.namespace) counts.set(tool.name, (counts.get(tool.name) ?? 0) + 1);
124
- }
125
- }
126
- for (const item of all) {
127
- const prefix = item.provider.namespace ?? ((counts.get(item.name) ?? 0) > 1 ? item.provider.id : void 0);
128
- if (prefix !== void 0) {
129
- if (throwOnCollision && !item.provider.namespace) {
130
- throw new ToolRegistryError(
131
- "name_collision",
132
- `Tool "${item.name}" from provider "${item.provider.id}" collides with another provider's tool.`
133
- );
134
- }
135
- item.name = `${sanitizeNamespace(prefix)}${TOOL_NAMESPACE_SEPARATOR}${item.name}`;
136
- }
137
- }
138
- return all;
139
- }
140
- /** MCP `tools/list` result for the current providers. */
141
- listTools() {
142
- return { tools: this.resolve().map(({ name, tool }) => toDefinition(name, tool)) };
143
- }
144
- /** Whether a tool with this exposed name exists. */
145
- hasTool(name) {
146
- return this.resolve().some((t) => t.name === name);
147
- }
148
- /** Looks up a tool definition by exposed name. */
149
- getTool(name) {
150
- const found = this.resolve().find((t) => t.name === name);
151
- return found ? toDefinition(found.name, found.tool) : void 0;
152
- }
153
- /**
154
- * Calls a tool by exposed name and returns an MCP `tools/call` result.
155
- * Never rejects: unknown tools, invalid arguments and handler errors come
156
- * back as `isError: true` results with a {@link ToolCallError} in
157
- * `structuredContent.error` (MCP transports may map `unknown_tool` to a
158
- * JSON-RPC `-32602` error instead).
159
- */
160
- async callTool(name, args = {}, options = {}) {
161
- const found = this.resolve().find((t) => t.name === name);
162
- if (!found) {
163
- return errorResult({ code: "unknown_tool", message: `Unknown tool "${name}".`, tool: name });
164
- }
165
- const input = args ?? {};
166
- if (this.options.validateArguments) {
167
- const details = validateJsonSchema(input, found.tool.inputSchema);
168
- if (details.length > 0) {
169
- return errorResult({
170
- code: "invalid_arguments",
171
- message: `Invalid arguments for tool "${name}".`,
172
- tool: name,
173
- details
174
- });
175
- }
176
- }
177
- try {
178
- const value = await found.tool.handler(input, {
179
- name,
180
- providerId: found.provider.id,
181
- signal: options.signal
182
- });
183
- return toToolResult(value);
184
- } catch (error) {
185
- return errorResult({
186
- code: "tool_failed",
187
- message: error instanceof Error ? error.message : String(error),
188
- tool: name
189
- });
190
- }
191
- }
192
- /**
193
- * Subscribes to tool-list changes. Notifications are coalesced: many
194
- * registrations or provider signals within the delay window produce one
195
- * call, and none if the exposed list ends up unchanged (e.g. a provider
196
- * unmounted and remounted). Returns an unsubscribe function.
197
- */
198
- onListChanged(listener) {
199
- this.listeners.add(listener);
200
- return () => {
201
- this.listeners.delete(listener);
202
- };
203
- }
204
- /** Schedules a coalesced `listChanged` check; providers may call it directly. */
205
- notifyListChanged() {
206
- if (this.timer !== null) return;
207
- this.timer = setTimeout(() => this.flush(), this.options.listChangedDelayMs);
208
- }
209
- /** Runs a pending `listChanged` check immediately. */
210
- flush() {
211
- if (this.timer !== null) {
212
- clearTimeout(this.timer);
213
- this.timer = null;
214
- }
215
- const signature = this.signature();
216
- if (signature === this.lastSignature) return;
217
- this.lastSignature = signature;
218
- const { tools } = this.listTools();
219
- for (const listener of Array.from(this.listeners)) listener(tools);
220
- }
221
- signature() {
222
- try {
223
- return JSON.stringify(this.listTools().tools);
224
- } catch {
225
- return String(Math.random());
226
- }
227
- }
228
- /** Unregisters every provider and listener and cancels pending notifications. */
229
- dispose() {
230
- if (this.timer !== null) clearTimeout(this.timer);
231
- this.timer = null;
232
- for (const entry of this.entries.splice(0)) entry.unsubscribe?.();
233
- this.listeners.clear();
234
- }
235
- };
236
- function createToolRegistry(options) {
237
- return new ToolRegistry(options);
238
- }
239
-
240
1
  // src/tools/definitions.ts
241
2
  var MCP_TOOL_GET_EDITOR_STATE = {
242
3
  name: "get_editor_state",
@@ -672,133 +433,7 @@ var EDITOR_MCP_TOOLS = [
672
433
  MCP_TOOL_VIEW_EDITOR
673
434
  ];
674
435
 
675
- // src/tools/mcp-server.ts
676
- var MCP_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
677
- var JSON_RPC_ERRORS = {
678
- parseError: -32700,
679
- invalidRequest: -32600,
680
- methodNotFound: -32601,
681
- invalidParams: -32602,
682
- internalError: -32603
683
- };
684
- var errorResponse = (id, code, message, data) => ({
685
- jsonrpc: "2.0",
686
- id,
687
- error: { code, message, ...data !== void 0 ? { data } : {} }
688
- });
689
- function createMcpServer(registry, options) {
690
- let initialized = false;
691
- let unsubscribe = null;
692
- const running = /* @__PURE__ */ new Map();
693
- const startNotifications = () => {
694
- if (unsubscribe || !options.send) return;
695
- const send = options.send;
696
- unsubscribe = registry.onListChanged(() => send({ jsonrpc: "2.0", method: "notifications/tools/list_changed" }));
697
- };
698
- async function dispatch(request) {
699
- const id = request.id ?? null;
700
- const isNotification = request.id === void 0 || request.id === null;
701
- const params = request.params ?? {};
702
- switch (request.method) {
703
- case "initialize": {
704
- const requested = String(params.protocolVersion ?? "");
705
- const protocolVersion = MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : MCP_PROTOCOL_VERSIONS[0];
706
- return {
707
- jsonrpc: "2.0",
708
- id,
709
- result: {
710
- protocolVersion,
711
- capabilities: registry.capabilities,
712
- serverInfo: { name: options.name, version: options.version, ...options.title ? { title: options.title } : {} },
713
- ...options.instructions ? { instructions: options.instructions } : {}
714
- }
715
- };
716
- }
717
- case "notifications/initialized":
718
- initialized = true;
719
- startNotifications();
720
- return null;
721
- case "notifications/cancelled": {
722
- const requestId = params.requestId;
723
- if (requestId !== void 0) running.get(requestId)?.abort(params.reason);
724
- return null;
725
- }
726
- case "ping":
727
- return { jsonrpc: "2.0", id, result: {} };
728
- case "tools/list":
729
- return { jsonrpc: "2.0", id, result: registry.listTools() };
730
- case "tools/call": {
731
- const name = params.name;
732
- if (typeof name !== "string") {
733
- return errorResponse(id, JSON_RPC_ERRORS.invalidParams, 'tools/call needs a string "name".');
734
- }
735
- if (!registry.hasTool(name)) {
736
- return errorResponse(id, JSON_RPC_ERRORS.invalidParams, `Unknown tool: ${name}`);
737
- }
738
- const args = params.arguments;
739
- if (args !== void 0 && (typeof args !== "object" || args === null || Array.isArray(args))) {
740
- return errorResponse(id, JSON_RPC_ERRORS.invalidParams, '"arguments" must be an object.');
741
- }
742
- const controller = new AbortController();
743
- if (!isNotification) running.set(id, controller);
744
- try {
745
- const result = await registry.callTool(name, args ?? {}, { signal: controller.signal });
746
- if (controller.signal.aborted) return null;
747
- return { jsonrpc: "2.0", id, result };
748
- } finally {
749
- if (!isNotification) running.delete(id);
750
- }
751
- }
752
- default:
753
- if (isNotification) return null;
754
- return errorResponse(id, JSON_RPC_ERRORS.methodNotFound, `Method not found: ${request.method}`);
755
- }
756
- }
757
- return {
758
- get initialized() {
759
- return initialized;
760
- },
761
- async handle(message) {
762
- let request;
763
- if (typeof message === "string") {
764
- try {
765
- request = JSON.parse(message);
766
- } catch {
767
- return errorResponse(null, JSON_RPC_ERRORS.parseError, "Parse error.");
768
- }
769
- } else {
770
- request = message;
771
- }
772
- if (!request || typeof request !== "object" || Array.isArray(request) || request.jsonrpc !== "2.0" || typeof request.method !== "string") {
773
- const id = request && typeof request === "object" && !Array.isArray(request) ? request.id ?? null : null;
774
- return errorResponse(id, JSON_RPC_ERRORS.invalidRequest, "Invalid JSON-RPC 2.0 request.");
775
- }
776
- try {
777
- return await dispatch(request);
778
- } catch (error) {
779
- if (request.id === void 0 || request.id === null) return null;
780
- return errorResponse(
781
- request.id,
782
- JSON_RPC_ERRORS.internalError,
783
- error instanceof Error ? error.message : String(error)
784
- );
785
- }
786
- },
787
- close() {
788
- unsubscribe?.();
789
- unsubscribe = null;
790
- for (const controller of running.values()) controller.abort("Server closed.");
791
- running.clear();
792
- }
793
- };
794
- }
795
-
796
436
  export {
797
- ToolRegistryError,
798
- TOOL_NAMESPACE_SEPARATOR,
799
- toToolResult,
800
- ToolRegistry,
801
- createToolRegistry,
802
437
  MCP_TOOL_GET_EDITOR_STATE,
803
438
  MCP_TOOL_EDIT_CANVAS,
804
439
  MCP_TOOL_EDIT_PROMPT,
@@ -818,9 +453,6 @@ export {
818
453
  EDITOR_PROMPT_TOOLS,
819
454
  EDIT_OPERATION_REQUIRED_ARGUMENTS,
820
455
  EXPORT_EXCLUDED_SELECTORS,
821
- EDITOR_MCP_TOOLS,
822
- MCP_PROTOCOL_VERSIONS,
823
- JSON_RPC_ERRORS,
824
- createMcpServer
456
+ EDITOR_MCP_TOOLS
825
457
  };
826
- //# sourceMappingURL=chunk-AMWXSYCI.js.map
458
+ //# sourceMappingURL=chunk-GPWNYQ7R.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/definitions.ts"],"sourcesContent":["/**\n * Standard MCP Tool Definitions for @pixerate/editor.\n * Compatible with the Model Context Protocol (MCP) tool specification schema.\n */\n\nexport const MCP_TOOL_GET_EDITOR_STATE = {\n\tname: 'get_editor_state',\n\ttitle: 'Get editor state',\n\tannotations: {\n\t\ttitle: 'Get editor state',\n\t\treadOnlyHint: true,\n\t\tdestructiveHint: false,\n\t\tidempotentHint: true,\n\t\topenWorldHint: false\n\t},\n\tdescription:\n\t\t'Retrieves the current state of the document, variables, selection, and canvas graph (nodes and edges).',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tincludeDocument: {\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription: 'Whether to include the prompt document text and variables (default: true).'\n\t\t\t},\n\t\t\tincludeCanvas: {\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription: 'Whether to include the canvas nodes and edges (default: true).'\n\t\t\t}\n\t\t}\n\t}\n} as const;\n\nexport const MCP_TOOL_EDIT_CANVAS = {\n\tname: 'edit_canvas',\n\ttitle: 'Edit the canvas',\n\tannotations: {\n\t\ttitle: 'Edit the canvas',\n\t\treadOnlyHint: false,\n\t\tdestructiveHint: true,\n\t\tidempotentHint: false,\n\t\topenWorldHint: false\n\t},\n\tdescription:\n\t\t'Applies high-level structural operations to the visual canvas (adding nodes, connecting edges, organizing layout, or moving elements). ' +\n\t\t'Prefer the per-operation canvas_* tools when the host exposes them. Returns the ids of created nodes and edges.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\toperation: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: [\n\t\t\t\t\t'add_node',\n\t\t\t\t\t'remove_nodes',\n\t\t\t\t\t'connect',\n\t\t\t\t\t'update_node',\n\t\t\t\t\t'layout',\n\t\t\t\t\t'select',\n\t\t\t\t\t'highlight'\n\t\t\t\t],\n\t\t\t\tdescription: 'The canvas operation to execute.'\n\t\t\t},\n\t\t\tnode: {\n\t\t\t\ttype: 'object',\n\t\t\t\tdescription: 'Node definition when operation is add_node. Can omit position to auto-place.'\n\t\t\t},\n\t\t\tnearNodeId: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Anchor node ID to position beside using collision-aware placement.'\n\t\t\t},\n\t\t\tside: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['top', 'right', 'bottom', 'left'],\n\t\t\t\tdescription: 'Side of the anchor node to place the new node beside.'\n\t\t\t},\n\t\t\tnodeIds: {\n\t\t\t\ttype: 'array',\n\t\t\t\titems: { type: 'string' },\n\t\t\t\tdescription: 'Array of node IDs for remove_nodes, select, or highlight.'\n\t\t\t},\n\t\t\tid: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Node ID for update_node (or pass `node: { id, data }`).'\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\ttype: 'object',\n\t\t\t\tdescription: 'Data fields to merge into the node for update_node.'\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'CSS color for highlight (default #3b82f6).'\n\t\t\t},\n\t\t\tdurationMs: {\n\t\t\t\ttype: 'integer',\n\t\t\t\tminimum: 0,\n\t\t\t\tdescription: 'How long the highlight lasts in ms (default 2000).'\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Source node ID for connect operation.'\n\t\t\t},\n\t\t\ttarget: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Target node ID for connect operation.'\n\t\t\t},\n\t\t\tlabel: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Optional edge label for connect operation.'\n\t\t\t},\n\t\t\tdirection: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['LR', 'TB', 'RL', 'BT'],\n\t\t\t\tdescription: 'Layout direction (default LR).'\n\t\t\t},\n\t\t\tincremental: {\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription: 'Preserve existing node coordinates and blend layout (default true).'\n\t\t\t}\n\t\t},\n\t\trequired: ['operation']\n\t}\n} as const;\n\nexport const MCP_TOOL_EDIT_PROMPT = {\n\tname: 'edit_prompt',\n\ttitle: 'Edit the prompt',\n\tannotations: {\n\t\ttitle: 'Edit the prompt',\n\t\treadOnlyHint: false,\n\t\tdestructiveHint: true,\n\t\tidempotentHint: false,\n\t\topenWorldHint: false\n\t},\n\tdescription:\n\t\t'Applies edits to the prompt template document, including inserting text, replacing ranges, and setting variables.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\toperation: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['insert_text', 'replace_range', 'set_variable', 'select'],\n\t\t\t\tdescription: 'The prompt operation to execute.'\n\t\t\t},\n\t\t\ttext: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Text to insert or replace.'\n\t\t\t},\n\t\t\tat: {\n\t\t\t\ttype: 'integer',\n\t\t\t\tminimum: 0,\n\t\t\t\tdescription: 'Position to insert text at.'\n\t\t\t},\n\t\t\tfrom: {\n\t\t\t\ttype: 'integer',\n\t\t\t\tminimum: 0,\n\t\t\t\tdescription: 'Start offset for replace_range or select.'\n\t\t\t},\n\t\t\tto: {\n\t\t\t\ttype: 'integer',\n\t\t\t\tminimum: 0,\n\t\t\t\tdescription: 'End offset for replace_range or select.'\n\t\t\t},\n\t\t\tname: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Variable name for set_variable.'\n\t\t\t},\n\t\t\tvalue: {\n\t\t\t\tdescription: 'Variable value for set_variable.'\n\t\t\t}\n\t\t},\n\t\trequired: ['operation']\n\t}\n} as const;\n\nexport const MCP_TOOL_VIEW_EDITOR = {\n\tname: 'view_editor',\n\ttitle: 'View the editor',\n\tannotations: {\n\t\ttitle: 'View the editor',\n\t\treadOnlyHint: true,\n\t\tdestructiveHint: false,\n\t\tidempotentHint: true,\n\t\topenWorldHint: false\n\t},\n\tdescription:\n\t\t'Captures a visual image snapshot (JPEG or PNG) of the editor canvas or viewport for multimodal evaluation. Active agent cursor indicators are automatically excluded from the snapshot.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tscope: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['viewport', 'canvas'],\n\t\t\t\tdescription: 'Whether to capture only the visible viewport or the full canvas bounding box (default: viewport).'\n\t\t\t},\n\t\t\tformat: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['jpeg', 'png'],\n\t\t\t\tdescription: 'Image format of the base64 snapshot (default: jpeg).'\n\t\t\t},\n\t\t\tmaxEdge: {\n\t\t\t\ttype: 'integer',\n\t\t\t\tdescription: 'Maximum width or height dimension in pixels (default: 1024).'\n\t\t\t}\n\t\t}\n\t}\n} as const;\n\n// ---------------------------------------------------------------------------\n// Per-operation tools: one strict schema per canvas / prompt operation.\n// ---------------------------------------------------------------------------\n\nconst WRITE_ANNOTATIONS = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } as const;\nconst DESTRUCTIVE_ANNOTATIONS = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false } as const;\nconst IDEMPOTENT_ANNOTATIONS = { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false } as const;\n\nconst NODE_IDS = {\n\ttype: 'array',\n\titems: { type: 'string', minLength: 1 },\n\tminItems: 1,\n\tuniqueItems: true,\n\tdescription: 'Node ids (from get_editor_state).'\n} as const;\n\nconst POSITION = {\n\ttype: 'object',\n\tproperties: { x: { type: 'number' }, y: { type: 'number' } },\n\trequired: ['x', 'y'],\n\tadditionalProperties: false\n} as const;\n\nconst DOC_POSITION = { type: 'integer', minimum: 0 } as const;\n\nexport const MCP_TOOL_CANVAS_ADD_NODE = {\n\tname: 'canvas_add_node',\n\ttitle: 'Add a canvas node',\n\tannotations: { title: 'Add a canvas node', ...WRITE_ANNOTATIONS },\n\tdescription:\n\t\t'Adds a node to the canvas. Without `position` it is placed without overlaps beside `nearNodeId` (and connected from it) ' +\n\t\t'or beside the last node. Returns the new node id (generated unless you pass `node.id`) and the id of the connecting edge.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tnode: {\n\t\t\t\ttype: 'object',\n\t\t\t\tdescription: 'The node. Extra host-specific fields are kept.',\n\t\t\t\tproperties: {\n\t\t\t\t\tid: { type: 'string', minLength: 1, description: 'Node id (default: generated). Must be unused.' },\n\t\t\t\t\ttype: { type: 'string', description: 'Node type registered by the host.' },\n\t\t\t\t\tdata: { type: 'object', description: 'Node data (e.g. { \"label\": \"...\" }).' },\n\t\t\t\t\tposition: { ...POSITION, description: 'Canvas coordinates (default: auto-placed).' },\n\t\t\t\t\twidth: { type: 'number', exclusiveMinimum: 0 },\n\t\t\t\t\theight: { type: 'number', exclusiveMinimum: 0 },\n\t\t\t\t\tparentId: { type: 'string', description: 'Parent (group/frame) node id.' }\n\t\t\t\t}\n\t\t\t},\n\t\t\tnearNodeId: { type: 'string', description: 'Existing node to place the new node beside and connect from.' },\n\t\t\tside: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: ['top', 'right', 'bottom', 'left'],\n\t\t\t\tdescription: 'Side of `nearNodeId` to place the node on (default right).'\n\t\t\t}\n\t\t},\n\t\trequired: ['node'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_CANVAS_REMOVE_NODES = {\n\tname: 'canvas_remove_nodes',\n\ttitle: 'Remove canvas nodes',\n\tannotations: { title: 'Remove canvas nodes', ...DESTRUCTIVE_ANNOTATIONS },\n\tdescription: 'Removes nodes (and their edges) from the canvas. Every id must exist.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: { nodeIds: NODE_IDS },\n\t\trequired: ['nodeIds'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_CANVAS_CONNECT = {\n\tname: 'canvas_connect',\n\ttitle: 'Connect canvas nodes',\n\tannotations: { title: 'Connect canvas nodes', ...WRITE_ANNOTATIONS },\n\tdescription: 'Adds an edge from one existing node to another. Returns the new edge id.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tsource: { type: 'string', minLength: 1, description: 'Source node id.' },\n\t\t\ttarget: { type: 'string', minLength: 1, description: 'Target node id.' },\n\t\t\tlabel: { type: 'string', description: 'Edge label.' }\n\t\t},\n\t\trequired: ['source', 'target'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_CANVAS_UPDATE_NODE = {\n\tname: 'canvas_update_node',\n\ttitle: 'Update a canvas node',\n\tannotations: { title: 'Update a canvas node', ...DESTRUCTIVE_ANNOTATIONS, idempotentHint: true },\n\tdescription: \"Merges fields into an existing node's data.\",\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tid: { type: 'string', minLength: 1, description: 'Node id.' },\n\t\t\tdata: { type: 'object', description: 'Data fields to merge (e.g. { \"label\": \"New\" }).' }\n\t\t},\n\t\trequired: ['id', 'data'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_CANVAS_LAYOUT = {\n\tname: 'canvas_layout',\n\ttitle: 'Lay out the canvas',\n\tannotations: { title: 'Lay out the canvas', ...IDEMPOTENT_ANNOTATIONS },\n\tdescription: 'Arranges the canvas graph automatically.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tdirection: { type: 'string', enum: ['LR', 'TB', 'RL', 'BT'], description: 'Layout direction (default LR).' },\n\t\t\tincremental: {\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription: 'Keep nodes that already have a position where they are (default true).'\n\t\t\t}\n\t\t},\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_CANVAS_SELECT = {\n\tname: 'canvas_select',\n\ttitle: 'Select canvas nodes',\n\tannotations: { title: 'Select canvas nodes', ...IDEMPOTENT_ANNOTATIONS },\n\tdescription: 'Replaces the canvas selection with these nodes (an empty list clears it).',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: { nodeIds: { ...NODE_IDS, minItems: 0 } },\n\t\trequired: ['nodeIds'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_CANVAS_HIGHLIGHT = {\n\tname: 'canvas_highlight',\n\ttitle: 'Highlight canvas nodes',\n\tannotations: { title: 'Highlight canvas nodes', ...IDEMPOTENT_ANNOTATIONS },\n\tdescription: 'Briefly highlights nodes to draw the user\\'s attention to them.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tnodeIds: NODE_IDS,\n\t\t\tcolor: { type: 'string', description: 'CSS color (default #3b82f6).' },\n\t\t\tdurationMs: { type: 'integer', minimum: 0, maximum: 60000, description: 'Duration in ms (default 2000).' }\n\t\t},\n\t\trequired: ['nodeIds'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_PROMPT_INSERT_TEXT = {\n\tname: 'prompt_insert_text',\n\ttitle: 'Insert prompt text',\n\tannotations: { title: 'Insert prompt text', ...WRITE_ANNOTATIONS },\n\tdescription: 'Inserts text into the prompt at a position, or at the cursor when `at` is omitted.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\ttext: { type: 'string', description: 'Text to insert.' },\n\t\t\tat: { ...DOC_POSITION, description: 'Position (as in get_editor_state `document.selection`).' }\n\t\t},\n\t\trequired: ['text'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_PROMPT_REPLACE_RANGE = {\n\tname: 'prompt_replace_range',\n\ttitle: 'Replace prompt text',\n\tannotations: { title: 'Replace prompt text', ...DESTRUCTIVE_ANNOTATIONS },\n\tdescription: 'Replaces the prompt text between two positions (an empty text deletes it).',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tfrom: { ...DOC_POSITION, description: 'Start position.' },\n\t\t\tto: { ...DOC_POSITION, description: 'End position (>= from).' },\n\t\t\ttext: { type: 'string', description: 'Replacement text.' }\n\t\t},\n\t\trequired: ['from', 'to', 'text'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_PROMPT_SET_VARIABLE = {\n\tname: 'prompt_set_variable',\n\ttitle: 'Set a prompt variable',\n\tannotations: { title: 'Set a prompt variable', ...DESTRUCTIVE_ANNOTATIONS, idempotentHint: true },\n\tdescription: 'Sets the value of a template variable used by the prompt.',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tname: { type: 'string', minLength: 1, description: 'Variable name.' },\n\t\t\tvalue: { description: 'Variable value (any JSON value).' }\n\t\t},\n\t\trequired: ['name', 'value'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\nexport const MCP_TOOL_PROMPT_SELECT = {\n\tname: 'prompt_select',\n\ttitle: 'Select prompt text',\n\tannotations: { title: 'Select prompt text', ...IDEMPOTENT_ANNOTATIONS },\n\tdescription: 'Selects the prompt text between two positions (from === to places the cursor).',\n\tinputSchema: {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tfrom: { ...DOC_POSITION, description: 'Start position.' },\n\t\t\tto: { ...DOC_POSITION, description: 'End position (>= from).' }\n\t\t},\n\t\trequired: ['from', 'to'],\n\t\tadditionalProperties: false\n\t}\n} as const;\n\n/** Per-operation canvas tools, the strict alternative to `edit_canvas`. */\nexport const EDITOR_CANVAS_TOOLS = [\n\tMCP_TOOL_CANVAS_ADD_NODE,\n\tMCP_TOOL_CANVAS_REMOVE_NODES,\n\tMCP_TOOL_CANVAS_CONNECT,\n\tMCP_TOOL_CANVAS_UPDATE_NODE,\n\tMCP_TOOL_CANVAS_LAYOUT,\n\tMCP_TOOL_CANVAS_SELECT,\n\tMCP_TOOL_CANVAS_HIGHLIGHT\n] as const;\n\n/** Per-operation prompt tools, the strict alternative to `edit_prompt`. */\nexport const EDITOR_PROMPT_TOOLS = [\n\tMCP_TOOL_PROMPT_INSERT_TEXT,\n\tMCP_TOOL_PROMPT_REPLACE_RANGE,\n\tMCP_TOOL_PROMPT_SET_VARIABLE,\n\tMCP_TOOL_PROMPT_SELECT\n] as const;\n\n/**\n * Arguments each `edit_canvas` / `edit_prompt` operation needs, used to tell\n * an agent exactly what is missing (the combined schemas cannot express it).\n */\nexport const EDIT_OPERATION_REQUIRED_ARGUMENTS: Readonly<Record<'edit_canvas' | 'edit_prompt', Readonly<Record<string, readonly string[]>>>> = {\n\tedit_canvas: {\n\t\tadd_node: ['node'],\n\t\tremove_nodes: ['nodeIds'],\n\t\tconnect: ['source', 'target'],\n\t\tupdate_node: ['id'],\n\t\tlayout: [],\n\t\tselect: ['nodeIds'],\n\t\thighlight: ['nodeIds']\n\t},\n\tedit_prompt: {\n\t\tinsert_text: ['text'],\n\t\treplace_range: ['from', 'to', 'text'],\n\t\tset_variable: ['name'],\n\t\tselect: ['from', 'to']\n\t}\n};\n\n/**\n * CSS selectors for ephemeral UI overlays (such as agent cursors, presence tags, and transient bubbles)\n * that should be excluded during canvas image export and visual snapshot generation.\n */\nexport const EXPORT_EXCLUDED_SELECTORS = [\n\t'.pixerate-presence',\n\t'.agent-presence',\n\t'.ursula-presence'\n] as const;\n\nexport const EDITOR_MCP_TOOLS = [\n\tMCP_TOOL_GET_EDITOR_STATE,\n\tMCP_TOOL_EDIT_CANVAS,\n\tMCP_TOOL_EDIT_PROMPT,\n\tMCP_TOOL_VIEW_EDITOR\n] as const;\n\n"],"mappings":";AAKO,IAAM,4BAA4B;AAAA,EACxC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,IACZ,OAAO;AAAA,IACP,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,eAAe;AAAA,EAChB;AAAA,EACA,aACC;AAAA,EACD,aAAa;AAAA,IACZ,MAAM;AAAA,IACN,YAAY;AAAA,MACX,iBAAiB;AAAA,QAChB,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,MACA,eAAe;AAAA,QACd,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,uBAAuB;AAAA,EACnC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,IACZ,OAAO;AAAA,IACP,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,eAAe;AAAA,EAChB;AAAA,EACA,aACC;AAAA,EAED,aAAa;AAAA,IACZ,MAAM;AAAA,IACN,YAAY;AAAA,MACX,WAAW;AAAA,QACV,MAAM;AAAA,QACN,MAAM;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,QACA,aAAa;AAAA,MACd;AAAA,MACA,MAAM;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,MACA,YAAY;AAAA,QACX,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,MACA,MAAM;AAAA,QAC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