@pixerate/editor 0.28.0 → 0.30.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.
- package/README.md +20 -1
- package/dist/HistoryManager-DWSLd6Tf.d.ts +150 -0
- package/dist/HistoryManager-DeQQMBCj.d.cts +150 -0
- package/dist/agent/index.cjs +20 -427
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +4 -342
- package/dist/agent/index.d.ts +4 -342
- package/dist/agent/index.js +14 -421
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +6 -2
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +3 -73
- package/dist/animation/index.d.ts +3 -73
- package/dist/animation/index.js +17 -13
- package/dist/{builtins-nMXh9sT3.d.cts → builtins-DxC3aUR2.d.cts} +2 -2
- package/dist/{builtins-haN82vjT.d.ts → builtins-NGxNxQfJ.d.ts} +2 -2
- package/dist/canvas/index.cjs +338 -28
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +109 -4
- package/dist/canvas/index.d.ts +109 -4
- package/dist/canvas/index.js +323 -13
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-36BLROHV.js +438 -0
- package/dist/chunk-36BLROHV.js.map +1 -0
- package/dist/{chunk-OYEFRO3D.cjs → chunk-6MDQKHRH.cjs} +4 -4
- package/dist/{chunk-OYEFRO3D.cjs.map → chunk-6MDQKHRH.cjs.map} +1 -1
- package/dist/{chunk-ARRTP33I.js → chunk-D6S5M7HV.js} +2 -2
- package/dist/{chunk-ARRTP33I.js.map → chunk-D6S5M7HV.js.map} +1 -1
- package/dist/{chunk-MXZJ4PKN.js → chunk-DDADOHJW.js} +8 -8
- package/dist/{chunk-CPOKFNBG.cjs → chunk-I6BZB5ZH.cjs} +2 -2
- package/dist/{chunk-CPOKFNBG.cjs.map → chunk-I6BZB5ZH.cjs.map} +1 -1
- package/dist/chunk-PIIAZV3L.cjs +244 -0
- package/dist/chunk-PIIAZV3L.cjs.map +1 -0
- package/dist/{chunk-G2I4QJOT.cjs → chunk-QKLRAA4T.cjs} +3 -244
- package/dist/chunk-QKLRAA4T.cjs.map +1 -0
- package/dist/{chunk-2H7ZHPEJ.js → chunk-QVZZGT4X.js} +1 -242
- package/dist/chunk-QVZZGT4X.js.map +1 -0
- package/dist/chunk-UB2OY7FD.js +262 -0
- package/dist/chunk-UB2OY7FD.js.map +1 -0
- package/dist/chunk-V7CC7RZ6.cjs +438 -0
- package/dist/chunk-V7CC7RZ6.cjs.map +1 -0
- package/dist/{chunk-PWJARCI4.js → chunk-W7BOBWZD.js} +5 -196
- package/dist/chunk-W7BOBWZD.js.map +1 -0
- package/dist/{chunk-TTYCN6ZH.cjs → chunk-XHRZSB77.cjs} +8 -199
- package/dist/chunk-XHRZSB77.cjs.map +1 -0
- package/dist/chunk-XZ4L3R4K.cjs +262 -0
- package/dist/chunk-XZ4L3R4K.cjs.map +1 -0
- package/dist/chunk-YK57D7PW.js +244 -0
- package/dist/chunk-YK57D7PW.js.map +1 -0
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +2 -2
- package/dist/commands/index.d.ts +2 -2
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/easing-DTmX99QG.d.cts +88 -0
- package/dist/easing-DTmX99QG.d.ts +88 -0
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +9 -9
- package/dist/generation/index.cjs +2 -2
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +1 -1
- package/dist/generation/index.js.map +1 -1
- package/dist/history/index.cjs +4 -2
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +3 -149
- package/dist/history/index.d.ts +3 -149
- package/dist/history/index.js +5 -3
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.js.map +1 -1
- package/dist/index.cjs +15 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/parameters/index.cjs +1320 -0
- package/dist/parameters/index.cjs.map +1 -0
- package/dist/parameters/index.d.cts +625 -0
- package/dist/parameters/index.d.ts +625 -0
- package/dist/parameters/index.js +1320 -0
- package/dist/parameters/index.js.map +1 -0
- package/dist/tools/index.cjs +31 -0
- package/dist/tools/index.cjs.map +1 -0
- package/dist/tools/index.d.cts +343 -0
- package/dist/tools/index.d.ts +343 -0
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/{types-GT5a5YAX.d.cts → types-DsiXGmjo.d.cts} +1 -1
- package/dist/{types-GT5a5YAX.d.ts → types-DsiXGmjo.d.ts} +1 -1
- package/package.json +11 -1
- package/dist/chunk-2H7ZHPEJ.js.map +0 -1
- package/dist/chunk-G2I4QJOT.cjs.map +0 -1
- package/dist/chunk-PWJARCI4.js.map +0 -1
- package/dist/chunk-TTYCN6ZH.cjs.map +0 -1
- /package/dist/{chunk-MXZJ4PKN.js.map → chunk-DDADOHJW.js.map} +0 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validateJsonSchema
|
|
3
|
+
} from "./chunk-D6S5M7HV.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
|
+
// src/tools/definitions.ts
|
|
241
|
+
var MCP_TOOL_GET_EDITOR_STATE = {
|
|
242
|
+
name: "get_editor_state",
|
|
243
|
+
title: "Get editor state",
|
|
244
|
+
annotations: {
|
|
245
|
+
title: "Get editor state",
|
|
246
|
+
readOnlyHint: true,
|
|
247
|
+
destructiveHint: false,
|
|
248
|
+
idempotentHint: true,
|
|
249
|
+
openWorldHint: false
|
|
250
|
+
},
|
|
251
|
+
description: "Retrieves the current state of the document, variables, selection, and canvas graph (nodes and edges).",
|
|
252
|
+
inputSchema: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
includeDocument: {
|
|
256
|
+
type: "boolean",
|
|
257
|
+
description: "Whether to include the prompt document text and variables (default: true)."
|
|
258
|
+
},
|
|
259
|
+
includeCanvas: {
|
|
260
|
+
type: "boolean",
|
|
261
|
+
description: "Whether to include the canvas nodes and edges (default: true)."
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
var MCP_TOOL_EDIT_CANVAS = {
|
|
267
|
+
name: "edit_canvas",
|
|
268
|
+
title: "Edit the canvas",
|
|
269
|
+
annotations: {
|
|
270
|
+
title: "Edit the canvas",
|
|
271
|
+
readOnlyHint: false,
|
|
272
|
+
destructiveHint: true,
|
|
273
|
+
idempotentHint: false,
|
|
274
|
+
openWorldHint: false
|
|
275
|
+
},
|
|
276
|
+
description: "Applies high-level structural operations to the visual canvas (adding nodes, connecting edges, organizing layout, or moving elements).",
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: "object",
|
|
279
|
+
properties: {
|
|
280
|
+
operation: {
|
|
281
|
+
type: "string",
|
|
282
|
+
enum: [
|
|
283
|
+
"add_node",
|
|
284
|
+
"remove_nodes",
|
|
285
|
+
"connect",
|
|
286
|
+
"update_node",
|
|
287
|
+
"layout",
|
|
288
|
+
"select",
|
|
289
|
+
"highlight"
|
|
290
|
+
],
|
|
291
|
+
description: "The canvas operation to execute."
|
|
292
|
+
},
|
|
293
|
+
node: {
|
|
294
|
+
type: "object",
|
|
295
|
+
description: "Node definition when operation is add_node. Can omit position to auto-place."
|
|
296
|
+
},
|
|
297
|
+
nearNodeId: {
|
|
298
|
+
type: "string",
|
|
299
|
+
description: "Anchor node ID to position beside using collision-aware placement."
|
|
300
|
+
},
|
|
301
|
+
side: {
|
|
302
|
+
type: "string",
|
|
303
|
+
enum: ["top", "right", "bottom", "left"],
|
|
304
|
+
description: "Side of the anchor node to place the new node beside."
|
|
305
|
+
},
|
|
306
|
+
nodeIds: {
|
|
307
|
+
type: "array",
|
|
308
|
+
items: { type: "string" },
|
|
309
|
+
description: "Array of node IDs for remove_nodes, select, or highlight."
|
|
310
|
+
},
|
|
311
|
+
source: {
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "Source node ID for connect operation."
|
|
314
|
+
},
|
|
315
|
+
target: {
|
|
316
|
+
type: "string",
|
|
317
|
+
description: "Target node ID for connect operation."
|
|
318
|
+
},
|
|
319
|
+
label: {
|
|
320
|
+
type: "string",
|
|
321
|
+
description: "Optional edge label for connect operation."
|
|
322
|
+
},
|
|
323
|
+
direction: {
|
|
324
|
+
type: "string",
|
|
325
|
+
enum: ["LR", "TB", "RL", "BT"],
|
|
326
|
+
description: "Layout direction (default LR)."
|
|
327
|
+
},
|
|
328
|
+
incremental: {
|
|
329
|
+
type: "boolean",
|
|
330
|
+
description: "Preserve existing node coordinates and blend layout (default true)."
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
required: ["operation"]
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var MCP_TOOL_EDIT_PROMPT = {
|
|
337
|
+
name: "edit_prompt",
|
|
338
|
+
title: "Edit the prompt",
|
|
339
|
+
annotations: {
|
|
340
|
+
title: "Edit the prompt",
|
|
341
|
+
readOnlyHint: false,
|
|
342
|
+
destructiveHint: true,
|
|
343
|
+
idempotentHint: false,
|
|
344
|
+
openWorldHint: false
|
|
345
|
+
},
|
|
346
|
+
description: "Applies edits to the prompt template document, including inserting text, replacing ranges, and setting variables.",
|
|
347
|
+
inputSchema: {
|
|
348
|
+
type: "object",
|
|
349
|
+
properties: {
|
|
350
|
+
operation: {
|
|
351
|
+
type: "string",
|
|
352
|
+
enum: ["insert_text", "replace_range", "set_variable", "select"],
|
|
353
|
+
description: "The prompt operation to execute."
|
|
354
|
+
},
|
|
355
|
+
text: {
|
|
356
|
+
type: "string",
|
|
357
|
+
description: "Text to insert or replace."
|
|
358
|
+
},
|
|
359
|
+
at: {
|
|
360
|
+
type: "number",
|
|
361
|
+
description: "Position to insert text at."
|
|
362
|
+
},
|
|
363
|
+
from: {
|
|
364
|
+
type: "number",
|
|
365
|
+
description: "Start offset for replace_range or select."
|
|
366
|
+
},
|
|
367
|
+
to: {
|
|
368
|
+
type: "number",
|
|
369
|
+
description: "End offset for replace_range or select."
|
|
370
|
+
},
|
|
371
|
+
name: {
|
|
372
|
+
type: "string",
|
|
373
|
+
description: "Variable name for set_variable."
|
|
374
|
+
},
|
|
375
|
+
value: {
|
|
376
|
+
description: "Variable value for set_variable."
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
required: ["operation"]
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
var MCP_TOOL_VIEW_EDITOR = {
|
|
383
|
+
name: "view_editor",
|
|
384
|
+
title: "View the editor",
|
|
385
|
+
annotations: {
|
|
386
|
+
title: "View the editor",
|
|
387
|
+
readOnlyHint: true,
|
|
388
|
+
destructiveHint: false,
|
|
389
|
+
idempotentHint: true,
|
|
390
|
+
openWorldHint: false
|
|
391
|
+
},
|
|
392
|
+
description: "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.",
|
|
393
|
+
inputSchema: {
|
|
394
|
+
type: "object",
|
|
395
|
+
properties: {
|
|
396
|
+
scope: {
|
|
397
|
+
type: "string",
|
|
398
|
+
enum: ["viewport", "canvas"],
|
|
399
|
+
description: "Whether to capture only the visible viewport or the full canvas bounding box (default: viewport)."
|
|
400
|
+
},
|
|
401
|
+
format: {
|
|
402
|
+
type: "string",
|
|
403
|
+
enum: ["jpeg", "png"],
|
|
404
|
+
description: "Image format of the base64 snapshot (default: jpeg)."
|
|
405
|
+
},
|
|
406
|
+
maxEdge: {
|
|
407
|
+
type: "integer",
|
|
408
|
+
description: "Maximum width or height dimension in pixels (default: 1024)."
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
var EXPORT_EXCLUDED_SELECTORS = [
|
|
414
|
+
".pixerate-presence",
|
|
415
|
+
".agent-presence",
|
|
416
|
+
".ursula-presence"
|
|
417
|
+
];
|
|
418
|
+
var EDITOR_MCP_TOOLS = [
|
|
419
|
+
MCP_TOOL_GET_EDITOR_STATE,
|
|
420
|
+
MCP_TOOL_EDIT_CANVAS,
|
|
421
|
+
MCP_TOOL_EDIT_PROMPT,
|
|
422
|
+
MCP_TOOL_VIEW_EDITOR
|
|
423
|
+
];
|
|
424
|
+
|
|
425
|
+
export {
|
|
426
|
+
ToolRegistryError,
|
|
427
|
+
TOOL_NAMESPACE_SEPARATOR,
|
|
428
|
+
toToolResult,
|
|
429
|
+
ToolRegistry,
|
|
430
|
+
createToolRegistry,
|
|
431
|
+
MCP_TOOL_GET_EDITOR_STATE,
|
|
432
|
+
MCP_TOOL_EDIT_CANVAS,
|
|
433
|
+
MCP_TOOL_EDIT_PROMPT,
|
|
434
|
+
MCP_TOOL_VIEW_EDITOR,
|
|
435
|
+
EXPORT_EXCLUDED_SELECTORS,
|
|
436
|
+
EDITOR_MCP_TOOLS
|
|
437
|
+
};
|
|
438
|
+
//# sourceMappingURL=chunk-36BLROHV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/registry.ts","../src/tools/definitions.ts"],"sourcesContent":["import { validateJsonSchema, type JsonSchema, type SchemaValidationError } from './schema.js';\n\n/**\n * MCP-shaped tool definition, as returned by `tools/list`.\n */\nexport interface McpToolDefinition {\n\tname: string;\n\ttitle?: string;\n\tdescription?: string;\n\tinputSchema: JsonSchema & { type: 'object' };\n\toutputSchema?: JsonSchema;\n\tannotations?: {\n\t\ttitle?: string;\n\t\treadOnlyHint?: boolean;\n\t\tdestructiveHint?: boolean;\n\t\tidempotentHint?: boolean;\n\t\topenWorldHint?: boolean;\n\t\t[key: string]: unknown;\n\t};\n}\n\nexport type McpToolContent =\n\t| { type: 'text'; text: string }\n\t| { type: 'image'; data: string; mimeType: string }\n\t| { type: string; [key: string]: unknown };\n\n/** MCP `tools/call` result. */\nexport interface McpToolResult {\n\tcontent: McpToolContent[];\n\tstructuredContent?: Record<string, unknown>;\n\tisError?: boolean;\n}\n\n/** MCP `tools/list` result. */\nexport interface McpListToolsResult {\n\ttools: McpToolDefinition[];\n}\n\nexport interface ToolCallContext {\n\t/** Name the tool was called by (possibly namespaced). */\n\tname: string;\n\t/** Id of the provider that owns the tool. */\n\tproviderId: string;\n\tsignal?: AbortSignal;\n}\n\n/**\n * Handler return values are normalized into an {@link McpToolResult}: a full\n * result (`{ content: [...] }`) is passed through, a string becomes a text\n * block, `undefined` becomes an empty result, and anything else is returned\n * as `structuredContent` (plain objects) plus a JSON text block.\n */\nexport type AgentToolHandler = (args: Record<string, any>, context: ToolCallContext) => unknown | Promise<unknown>;\n\nexport interface AgentTool extends McpToolDefinition {\n\thandler: AgentToolHandler;\n}\n\n/**\n * A source of tools, typically one per mounted editor, spreadsheet or canvas.\n */\nexport interface AgentToolProvider {\n\t/** Unique id within a registry, e.g. `doc-1`. Used as the namespace on collisions. */\n\tid: string;\n\t/** Always prefix this provider's tools with `<namespace>__`. */\n\tnamespace?: string;\n\t/** Tools, or a function returning the current tools (re-read on every `listTools`). */\n\ttools: readonly AgentTool[] | (() => readonly AgentTool[]);\n\t/** Lets the provider signal that its tool list changed; returns an unsubscribe function. */\n\tsubscribe?: (notify: () => void) => () => void;\n}\n\nexport type ToolErrorCode = 'unknown_tool' | 'invalid_arguments' | 'tool_failed';\n\n/** Structured error carried in `structuredContent.error` of a failed call. */\nexport interface ToolCallError {\n\tcode: ToolErrorCode;\n\tmessage: string;\n\ttool: string;\n\tdetails?: SchemaValidationError[];\n}\n\nexport class ToolRegistryError extends Error {\n\treadonly code: 'duplicate_provider' | 'name_collision' | 'invalid_tool';\n\n\tconstructor(code: ToolRegistryError['code'], message: string) {\n\t\tsuper(message);\n\t\tthis.name = 'ToolRegistryError';\n\t\tthis.code = code;\n\t}\n}\n\nexport interface ToolRegistryOptions {\n\t/**\n\t * What to do when two providers contribute the same tool name:\n\t * `namespace` (default) exposes every colliding tool as `<providerId>__<name>`;\n\t * `error` makes `register` throw.\n\t */\n\tonCollision?: 'namespace' | 'error';\n\t/** Coalescing window for `listChanged` notifications in ms (default 0: same tick). */\n\tlistChangedDelayMs?: number;\n\t/** Validate arguments against `inputSchema` before calling handlers (default `true`). */\n\tvalidateArguments?: boolean;\n}\n\n/** Separator between namespace and tool name; valid in MCP and LLM tool-name charsets. */\nexport const TOOL_NAMESPACE_SEPARATOR = '__';\n\nconst TOOL_NAME_REGEX = /^[A-Za-z0-9_.-]{1,128}$/;\nconst sanitizeNamespace = (id: string) => id.replace(/[^A-Za-z0-9_-]/g, '_');\n\ninterface ResolvedTool {\n\tname: string;\n\ttool: AgentTool;\n\tprovider: AgentToolProvider;\n}\n\ninterface ProviderEntry {\n\tprovider: AgentToolProvider;\n\tunsubscribe?: () => void;\n}\n\nfunction readTools(provider: AgentToolProvider): readonly AgentTool[] {\n\treturn typeof provider.tools === 'function' ? provider.tools() : provider.tools;\n}\n\nfunction toDefinition(name: string, tool: AgentTool): McpToolDefinition {\n\tconst { handler: _handler, name: _name, ...rest } = tool;\n\treturn { name, ...rest };\n}\n\nfunction errorResult(error: ToolCallError): McpToolResult {\n\tconst details = error.details?.length\n\t\t? '\\n' + error.details.map((d) => `- ${d.path}: ${d.message}`).join('\\n')\n\t\t: '';\n\treturn {\n\t\tisError: true,\n\t\tcontent: [{ type: 'text', text: `${error.message}${details}` }],\n\t\tstructuredContent: { error: error as unknown as Record<string, unknown> }\n\t};\n}\n\n/** Normalizes a handler's return value into an MCP `tools/call` result. */\nexport function toToolResult(value: unknown): McpToolResult {\n\tif (\n\t\tvalue &&\n\t\ttypeof value === 'object' &&\n\t\tArray.isArray((value as McpToolResult).content)\n\t) {\n\t\treturn value as McpToolResult;\n\t}\n\tif (value === undefined) return { content: [] };\n\tif (typeof value === 'string') return { content: [{ type: 'text', text: value }] };\n\tconst text = JSON.stringify(value);\n\tconst isPlainObject = typeof value === 'object' && value !== null && !Array.isArray(value);\n\treturn {\n\t\tcontent: [{ type: 'text', text: text ?? String(value) }],\n\t\t...(isPlainObject ? { structuredContent: value as Record<string, unknown> } : {})\n\t};\n}\n\n/**\n * Transport-agnostic registry of agent tools contributed by live providers.\n *\n * `listTools()` and `callTool()` return MCP `tools/list` / `tools/call`\n * result shapes, and `onListChanged` fires (coalesced) whenever the exposed\n * tool list changes, mirroring MCP's `notifications/tools/list_changed`, so an\n * MCP server can be a thin wrapper around it.\n */\nexport class ToolRegistry {\n\t/** MCP server capabilities this registry supports. */\n\treadonly capabilities = { tools: { listChanged: true } } as const;\n\n\tprivate readonly entries: ProviderEntry[] = [];\n\tprivate readonly listeners = new Set<(tools: McpToolDefinition[]) => void>();\n\tprivate readonly options: Required<ToolRegistryOptions>;\n\tprivate timer: ReturnType<typeof setTimeout> | null = null;\n\tprivate lastSignature: string;\n\n\tconstructor(options: ToolRegistryOptions = {}) {\n\t\tthis.options = {\n\t\t\tonCollision: options.onCollision ?? 'namespace',\n\t\t\tlistChangedDelayMs: options.listChangedDelayMs ?? 0,\n\t\t\tvalidateArguments: options.validateArguments ?? true\n\t\t};\n\t\tthis.lastSignature = this.signature();\n\t}\n\n\t/**\n\t * Registers a provider and returns a function that unregisters it.\n\t * Throws a {@link ToolRegistryError} for a duplicate provider id, an invalid\n\t * tool name, or (with `onCollision: 'error'`) a tool name collision.\n\t */\n\tregister(provider: AgentToolProvider): () => void {\n\t\tif (this.entries.some((e) => e.provider.id === provider.id)) {\n\t\t\tthrow new ToolRegistryError('duplicate_provider', `Tool provider \"${provider.id}\" is already registered.`);\n\t\t}\n\t\tfor (const tool of readTools(provider)) {\n\t\t\tif (!TOOL_NAME_REGEX.test(tool.name)) {\n\t\t\t\tthrow new ToolRegistryError('invalid_tool', `Invalid tool name \"${tool.name}\" from provider \"${provider.id}\".`);\n\t\t\t}\n\t\t}\n\t\tconst entry: ProviderEntry = { provider };\n\t\tthis.entries.push(entry);\n\t\ttry {\n\t\t\tconst names = this.resolve(this.options.onCollision === 'error').map((t) => t.name);\n\t\t\tconst duplicate = names.find((name, i) => names.indexOf(name) !== i);\n\t\t\tif (duplicate) {\n\t\t\t\t// Only possible with explicit namespaces (or duplicate names within one provider).\n\t\t\t\tthrow new ToolRegistryError('name_collision', `Tool name \"${duplicate}\" is exposed more than once.`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.entries.pop();\n\t\t\tthrow error;\n\t\t}\n\t\tif (provider.subscribe) {\n\t\t\tentry.unsubscribe = provider.subscribe(() => this.notifyListChanged());\n\t\t}\n\t\tthis.notifyListChanged();\n\t\tlet registered = true;\n\t\treturn () => {\n\t\t\tif (!registered) return;\n\t\t\tregistered = false;\n\t\t\tthis.unregister(provider);\n\t\t};\n\t}\n\n\t/** Removes a provider by id or instance. Returns whether it was registered. */\n\tunregister(providerOrId: string | AgentToolProvider): boolean {\n\t\tconst index = this.entries.findIndex((e) =>\n\t\t\ttypeof providerOrId === 'string' ? e.provider.id === providerOrId : e.provider === providerOrId\n\t\t);\n\t\tif (index === -1) return false;\n\t\tconst [entry] = this.entries.splice(index, 1);\n\t\tentry.unsubscribe?.();\n\t\tthis.notifyListChanged();\n\t\treturn true;\n\t}\n\n\t/** Registered provider ids in registration order. */\n\tproviderIds(): string[] {\n\t\treturn this.entries.map((e) => e.provider.id);\n\t}\n\n\t/**\n\t * Resolves exposed names. Tools are ordered by provider registration, then\n\t * by their order within the provider.\n\t */\n\tprivate resolve(throwOnCollision = false): ResolvedTool[] {\n\t\tconst all: ResolvedTool[] = [];\n\t\tconst counts = new Map<string, number>();\n\t\tfor (const { provider } of this.entries) {\n\t\t\tfor (const tool of readTools(provider)) {\n\t\t\t\tall.push({ name: tool.name, tool, provider });\n\t\t\t\tif (!provider.namespace) counts.set(tool.name, (counts.get(tool.name) ?? 0) + 1);\n\t\t\t}\n\t\t}\n\t\tfor (const item of all) {\n\t\t\tconst prefix = item.provider.namespace ?? ((counts.get(item.name) ?? 0) > 1 ? item.provider.id : undefined);\n\t\t\tif (prefix !== undefined) {\n\t\t\t\tif (throwOnCollision && !item.provider.namespace) {\n\t\t\t\t\tthrow new ToolRegistryError(\n\t\t\t\t\t\t'name_collision',\n\t\t\t\t\t\t`Tool \"${item.name}\" from provider \"${item.provider.id}\" collides with another provider's tool.`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\titem.name = `${sanitizeNamespace(prefix)}${TOOL_NAMESPACE_SEPARATOR}${item.name}`;\n\t\t\t}\n\t\t}\n\t\treturn all;\n\t}\n\n\t/** MCP `tools/list` result for the current providers. */\n\tlistTools(): McpListToolsResult {\n\t\treturn { tools: this.resolve().map(({ name, tool }) => toDefinition(name, tool)) };\n\t}\n\n\t/** Whether a tool with this exposed name exists. */\n\thasTool(name: string): boolean {\n\t\treturn this.resolve().some((t) => t.name === name);\n\t}\n\n\t/** Looks up a tool definition by exposed name. */\n\tgetTool(name: string): McpToolDefinition | undefined {\n\t\tconst found = this.resolve().find((t) => t.name === name);\n\t\treturn found ? toDefinition(found.name, found.tool) : undefined;\n\t}\n\n\t/**\n\t * Calls a tool by exposed name and returns an MCP `tools/call` result.\n\t * Never rejects: unknown tools, invalid arguments and handler errors come\n\t * back as `isError: true` results with a {@link ToolCallError} in\n\t * `structuredContent.error` (MCP transports may map `unknown_tool` to a\n\t * JSON-RPC `-32602` error instead).\n\t */\n\tasync callTool(name: string, args: Record<string, unknown> = {}, options: { signal?: AbortSignal } = {}): Promise<McpToolResult> {\n\t\tconst found = this.resolve().find((t) => t.name === name);\n\t\tif (!found) {\n\t\t\treturn errorResult({ code: 'unknown_tool', message: `Unknown tool \"${name}\".`, tool: name });\n\t\t}\n\t\tconst input = args ?? {};\n\t\tif (this.options.validateArguments) {\n\t\t\tconst details = validateJsonSchema(input, found.tool.inputSchema);\n\t\t\tif (details.length > 0) {\n\t\t\t\treturn errorResult({\n\t\t\t\t\tcode: 'invalid_arguments',\n\t\t\t\t\tmessage: `Invalid arguments for tool \"${name}\".`,\n\t\t\t\t\ttool: name,\n\t\t\t\t\tdetails\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tconst value = await found.tool.handler(input as Record<string, any>, {\n\t\t\t\tname,\n\t\t\t\tproviderId: found.provider.id,\n\t\t\t\tsignal: options.signal\n\t\t\t});\n\t\t\treturn toToolResult(value);\n\t\t} catch (error) {\n\t\t\treturn errorResult({\n\t\t\t\tcode: 'tool_failed',\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\ttool: name\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Subscribes to tool-list changes. Notifications are coalesced: many\n\t * registrations or provider signals within the delay window produce one\n\t * call, and none if the exposed list ends up unchanged (e.g. a provider\n\t * unmounted and remounted). Returns an unsubscribe function.\n\t */\n\tonListChanged(listener: (tools: McpToolDefinition[]) => 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/** Schedules a coalesced `listChanged` check; providers may call it directly. */\n\tnotifyListChanged(): void {\n\t\tif (this.timer !== null) return;\n\t\tthis.timer = setTimeout(() => this.flush(), this.options.listChangedDelayMs);\n\t}\n\n\t/** Runs a pending `listChanged` check immediately. */\n\tflush(): void {\n\t\tif (this.timer !== null) {\n\t\t\tclearTimeout(this.timer);\n\t\t\tthis.timer = null;\n\t\t}\n\t\tconst signature = this.signature();\n\t\tif (signature === this.lastSignature) return;\n\t\tthis.lastSignature = signature;\n\t\tconst { tools } = this.listTools();\n\t\tfor (const listener of Array.from(this.listeners)) listener(tools);\n\t}\n\n\tprivate signature(): string {\n\t\ttry {\n\t\t\treturn JSON.stringify(this.listTools().tools);\n\t\t} catch {\n\t\t\treturn String(Math.random());\n\t\t}\n\t}\n\n\t/** Unregisters every provider and listener and cancels pending notifications. */\n\tdispose(): void {\n\t\tif (this.timer !== null) clearTimeout(this.timer);\n\t\tthis.timer = null;\n\t\tfor (const entry of this.entries.splice(0)) entry.unsubscribe?.();\n\t\tthis.listeners.clear();\n\t}\n}\n\nexport function createToolRegistry(options?: ToolRegistryOptions): ToolRegistry {\n\treturn new ToolRegistry(options);\n}\n","/**\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\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\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: 'number',\n\t\t\t\tdescription: 'Position to insert text at.'\n\t\t\t},\n\t\t\tfrom: {\n\t\t\t\ttype: 'number',\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: 'number',\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 * 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":";;;;;AAkFO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EACnC;AAAA,EAET,YAAY,MAAiC,SAAiB;AAC7D,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACb;AACD;AAgBO,IAAM,2BAA2B;AAExC,IAAM,kBAAkB;AACxB,IAAM,oBAAoB,CAAC,OAAe,GAAG,QAAQ,mBAAmB,GAAG;AAa3E,SAAS,UAAU,UAAmD;AACrE,SAAO,OAAO,SAAS,UAAU,aAAa,SAAS,MAAM,IAAI,SAAS;AAC3E;AAEA,SAAS,aAAa,MAAc,MAAoC;AACvE,QAAM,EAAE,SAAS,UAAU,MAAM,OAAO,GAAG,KAAK,IAAI;AACpD,SAAO,EAAE,MAAM,GAAG,KAAK;AAC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AAA,QACP,MAAM;AAAA,QACN,MAAM,CAAC,QAAQ,KAAK;AAAA,QACpB,aAAa;AAAA,MACd;AAAA,MACA,SAAS;AAAA,QACR,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD;AAMO,IAAM,4BAA4B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,mBAAmB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
var _chunk3CC7OPUQcjs = require('./chunk-3CC7OPUQ.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
var _chunkMC2LQN5Scjs = require('./chunk-MC2LQN5S.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var _chunkCS6NZWWAcjs = require('./chunk-CS6NZWWA.cjs');
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
|
|
20
|
+
var _chunkMC2LQN5Scjs = require('./chunk-MC2LQN5S.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkCS6NZWWAcjs = require('./chunk-CS6NZWWA.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -7651,4 +7651,4 @@ function createTableCommands(editor, options = {}) {
|
|
|
7651
7651
|
|
|
7652
7652
|
|
|
7653
7653
|
exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; exports.LoadingNode = LoadingNode; exports.SMILIE_REPLACEMENTS = SMILIE_REPLACEMENTS; exports.smilieAutocorrectRules = smilieAutocorrectRules; exports.SmilieReplacer = SmilieReplacer; exports.findHexColors = findHexColors; exports.ColorHighlighter = ColorHighlighter; exports.FontSize = FontSize; exports.Mention = Mention; exports.getMentionNodes = getMentionNodes; exports.setMentionRoleAt = setMentionRoleAt; exports.createMentionExtension = createMentionExtension; exports.Markdown = Markdown2; exports.imagePastePluginKey = imagePastePluginKey; exports.insertImageNode = insertImageNode; exports.updateImageSrc = updateImageSrc; exports.removeImageNode = removeImageNode; exports.handleImageInsertion = handleImageInsertion; exports.Image = Image2; exports.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; exports.compareInEditor = compareInEditor; exports.applyDocumentComparison = applyDocumentComparison; exports.DocumentCompare = DocumentCompare; exports.ImportError = ImportError; exports.createImportContext = createImportContext; exports.ImportAdapterRegistry = ImportAdapterRegistry; exports.DOCX_MIME_TYPES = DOCX_MIME_TYPES; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.docxToDocumentImport = docxToDocumentImport; exports.createDocxImportAdapter = createDocxImportAdapter; exports.docxImportAdapter = docxImportAdapter; exports.markdownImportAdapter = markdownImportAdapter; exports.htmlImportAdapter = htmlImportAdapter; exports.plainTextImportAdapter = plainTextImportAdapter; exports.rtfImportAdapter = rtfImportAdapter; exports.BUILT_IN_IMPORT_ADAPTERS = BUILT_IN_IMPORT_ADAPTERS; exports.createImportAdapterRegistry = createImportAdapterRegistry; exports.defaultImportRegistry = defaultImportRegistry; exports.registerImportAdapter = registerImportAdapter; exports.unregisterImportAdapter = unregisterImportAdapter; exports.findImportAdapter = findImportAdapter; exports.importFile = importFile; exports.getImportAccept = getImportAccept; exports.htmlToSlice = htmlToSlice; exports.insertImportedDocument = insertImportedDocument; exports.applyImportedReviewData = applyImportedReviewData; exports.importFilesIntoEditor = importFilesIntoEditor; exports.fileImportPluginKey = fileImportPluginKey; exports.FileImport = FileImport; exports.richClipboardPluginKey = richClipboardPluginKey; exports.writeRichClipboard = writeRichClipboard; exports.RichClipboard = RichClipboard; exports.smartQuoteRules = smartQuoteRules; exports.symbolRules = symbolRules; exports.fractionRules = fractionRules; exports.capitalizeSentenceRules = capitalizeSentenceRules; exports.twoInitialCapitalsRules = twoInitialCapitalsRules; exports.defaultAutocorrectRules = defaultAutocorrectRules; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.autocorrectPluginKey = autocorrectPluginKey; exports.findAutocorrection = findAutocorrection; exports.isInsidePromptToken = isInsidePromptToken; exports.Autocorrect = Autocorrect; exports.outlinePluginKey = outlinePluginKey; exports.computeOutline = computeOutline; exports.buildOutlineTree = buildOutlineTree; exports.getOutline = getOutline; exports.getActiveHeading = getActiveHeading; exports.createOutlineStore = createOutlineStore; exports.navigateToHeading = navigateToHeading; exports.Outline = Outline; exports.tableOfContentsMarkdownIt = tableOfContentsMarkdownIt; exports.footnotesMarkdownIt = footnotesMarkdownIt; exports.tableOfContentsPluginKey = tableOfContentsPluginKey; exports.getTableOfContentsEntries = getTableOfContentsEntries; exports.TableOfContents = TableOfContents; exports.footnotesPluginKey = footnotesPluginKey; exports.getFootnotes = getFootnotes; exports.syncFootnotes = syncFootnotes; exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.getBookmarks = getBookmarks; exports.Bookmark = Bookmark; exports.crossReferencePluginKey = crossReferencePluginKey; exports.getCrossReferenceTargets = getCrossReferenceTargets; exports.CrossReference = CrossReference; exports.documentStructureCommandItems = documentStructureCommandItems; exports.getDocumentStructureCommandItems = getDocumentStructureCommandItems; exports.FIND_PARAGRAPH_MARK = FIND_PARAGRAPH_MARK; exports.MAX_FIND_PATTERN_LENGTH = MAX_FIND_PATTERN_LENGTH; exports.createSearchBudget = createSearchBudget; exports.foldCodePoint = foldCodePoint; exports.compileFindPattern = compileFindPattern; exports.findAllMatches = findAllMatches; exports.parseReplacement = parseReplacement; exports.expandReplacement = expandReplacement; exports.searchDocument = searchDocument; exports.applyReplacements = applyReplacements; exports.EMPTY_FIND_REPLACE_SNAPSHOT = EMPTY_FIND_REPLACE_SNAPSHOT; exports.FindReplaceStore = FindReplaceStore; exports.findReplacePluginKey = findReplacePluginKey; exports.getFindReplaceState = getFindReplaceState; exports.getFindReplaceStore = getFindReplaceStore; exports.FIND_OPTION_TOGGLES = FIND_OPTION_TOGGLES; exports.formatFindStatus = formatFindStatus; exports.FindReplace = FindReplace; exports.STYLE_ID_ATTRIBUTE = STYLE_ID_ATTRIBUTE; exports.CHARACTER_STYLE_MARK_NAME = CHARACTER_STYLE_MARK_NAME; exports.paragraphStylesPluginKey = paragraphStylesPluginKey; exports.getStyleRegistry = getStyleRegistry; exports.isParagraphStyleAvailable = isParagraphStyleAvailable; exports.getParagraphStyleAt = getParagraphStyleAt; exports.captureSelectionFormat = captureSelectionFormat; exports.CharacterStyle = CharacterStyle; exports.ParagraphStyles = ParagraphStyles; exports.createParagraphStylesStore = createParagraphStylesStore; exports.createRichTextPreset = createRichTextPreset; exports.createFindReplaceCommands = createFindReplaceCommands; exports.validateFindPattern = validateFindPattern; exports.createTableCommands = createTableCommands;
|
|
7654
|
-
//# sourceMappingURL=chunk-
|
|
7654
|
+
//# sourceMappingURL=chunk-6MDQKHRH.cjs.map
|