@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.
- package/dist/agent/index.cjs +37 -29
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +4 -3
- package/dist/agent/index.d.ts +4 -3
- package/dist/agent/index.js +16 -8
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +15 -1
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +3 -226
- package/dist/animation/index.d.ts +3 -226
- package/dist/animation/index.js +14 -0
- package/dist/bridge/cli.cjs +36 -0
- package/dist/bridge/cli.cjs.map +1 -0
- package/dist/bridge/cli.d.cts +1 -0
- package/dist/bridge/cli.d.ts +1 -0
- package/dist/bridge/cli.js +36 -0
- package/dist/bridge/cli.js.map +1 -0
- package/dist/bridge/index.cjs +16 -0
- package/dist/bridge/index.cjs.map +1 -0
- package/dist/bridge/index.d.cts +65 -0
- package/dist/bridge/index.d.ts +65 -0
- package/dist/bridge/index.js +16 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge-client-C5OziCRK.d.cts +148 -0
- package/dist/bridge-client-C5dRjrz5.d.ts +148 -0
- package/dist/canvas/index.cjs +1308 -528
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +309 -5
- package/dist/canvas/index.d.ts +309 -5
- package/dist/canvas/index.js +1295 -515
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +193 -192
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.d.cts +77 -59
- package/dist/chart/index.d.ts +77 -59
- package/dist/chart/index.js +87 -86
- package/dist/chart/index.js.map +1 -1
- package/dist/{chunk-UAW5FEMD.js → chunk-3S72F46R.js} +66 -8
- package/dist/chunk-3S72F46R.js.map +1 -0
- package/dist/{chunk-5TWIN7ZJ.js → chunk-47WWV3LI.js} +34 -4
- package/dist/chunk-47WWV3LI.js.map +1 -0
- package/dist/{chunk-OV7UAKIY.js → chunk-633QC34G.js} +172 -1
- package/dist/chunk-633QC34G.js.map +1 -0
- package/dist/chunk-AWKPSOSX.js +401 -0
- package/dist/chunk-AWKPSOSX.js.map +1 -0
- package/dist/chunk-B6DSIEXA.js +96 -0
- package/dist/chunk-B6DSIEXA.js.map +1 -0
- package/dist/{chunk-5N6AQCVB.js → chunk-BQQZ6MOI.js} +3 -3
- package/dist/{chunk-M5Z77GFH.cjs → chunk-C3JHII3M.cjs} +53 -53
- package/dist/{chunk-M5Z77GFH.cjs.map → chunk-C3JHII3M.cjs.map} +1 -1
- package/dist/{chunk-JOX6MJW4.cjs → chunk-CKRNELPO.cjs} +176 -5
- package/dist/chunk-CKRNELPO.cjs.map +1 -0
- package/dist/{chunk-TGBCBQFV.cjs → chunk-DK6QBGCS.cjs} +45 -15
- package/dist/chunk-DK6QBGCS.cjs.map +1 -0
- package/dist/chunk-EGFUVXKK.cjs +96 -0
- package/dist/chunk-EGFUVXKK.cjs.map +1 -0
- package/dist/{chunk-AMWXSYCI.js → chunk-GPWNYQ7R.js} +2 -370
- package/dist/chunk-GPWNYQ7R.js.map +1 -0
- package/dist/chunk-H5K77C7Y.cjs +3848 -0
- package/dist/chunk-H5K77C7Y.cjs.map +1 -0
- package/dist/chunk-K73CKYUM.cjs +458 -0
- package/dist/chunk-K73CKYUM.cjs.map +1 -0
- package/dist/{chunk-GTZXF4BI.cjs → chunk-NK3WL5TJ.cjs} +298 -133
- package/dist/chunk-NK3WL5TJ.cjs.map +1 -0
- package/dist/{chunk-3ZBAXET6.cjs → chunk-NN3JGUSX.cjs} +80 -22
- package/dist/chunk-NN3JGUSX.cjs.map +1 -0
- package/dist/chunk-NV22EMOZ.cjs +401 -0
- package/dist/chunk-NV22EMOZ.cjs.map +1 -0
- package/dist/{chunk-YMKPMXZ4.js → chunk-OIKYP7XC.js} +4 -4
- package/dist/{chunk-FEMIVHN3.cjs → chunk-P43HUQRX.cjs} +16 -16
- package/dist/{chunk-FEMIVHN3.cjs.map → chunk-P43HUQRX.cjs.map} +1 -1
- package/dist/chunk-PTMIGXZ2.js +467 -0
- package/dist/chunk-PTMIGXZ2.js.map +1 -0
- package/dist/chunk-QIWFEEWG.cjs +467 -0
- package/dist/chunk-QIWFEEWG.cjs.map +1 -0
- package/dist/{chunk-QFTVLEVN.js → chunk-RIXTW3C4.js} +3 -3
- package/dist/{chunk-WBOAXDKD.js → chunk-VODBAO32.js} +222 -57
- package/dist/chunk-VODBAO32.js.map +1 -0
- package/dist/chunk-WWJNC7SX.js +3848 -0
- package/dist/chunk-WWJNC7SX.js.map +1 -0
- package/dist/{chunk-2DEBI6KU.cjs → chunk-YZZMX6V7.cjs} +10 -10
- package/dist/{chunk-2DEBI6KU.cjs.map → chunk-YZZMX6V7.cjs.map} +1 -1
- package/dist/commands/index.d.cts +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/{controller-DS3drIvy.d.cts → controller-CX0QfSv0.d.cts} +53 -2
- package/dist/{controller-BdKzaxs2.d.ts → controller-DscWQbjO.d.ts} +53 -2
- package/dist/diagram/index.cjs +1146 -0
- package/dist/diagram/index.cjs.map +1 -0
- package/dist/diagram/index.d.cts +787 -0
- package/dist/diagram/index.d.ts +787 -0
- package/dist/diagram/index.js +1146 -0
- package/dist/diagram/index.js.map +1 -0
- package/dist/{easing-DTmX99QG.d.cts → easing-CNGk-W6d.d.cts} +1 -1
- package/dist/{easing-DTmX99QG.d.ts → easing-CNGk-W6d.d.ts} +1 -1
- package/dist/export/index.cjs +4 -4
- package/dist/export/index.js +3 -3
- package/dist/extensions/index.cjs +6 -6
- package/dist/extensions/index.d.cts +2 -2
- package/dist/extensions/index.d.ts +2 -2
- package/dist/extensions/index.js +5 -5
- package/dist/generation/index.d.cts +2 -2
- package/dist/generation/index.d.ts +2 -2
- package/dist/image-editor/index.d.cts +1 -1
- package/dist/image-editor/index.d.ts +1 -1
- package/dist/{index-Dt9lzydb.d.ts → index-CALDD35B.d.ts} +1 -1
- package/dist/{index-DOy9HzfC.d.cts → index-DIWB6xMf.d.cts} +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -6
- package/dist/parameters/index.d.cts +1 -1
- package/dist/parameters/index.d.ts +1 -1
- package/dist/player-DSMjdgQ9.d.cts +225 -0
- package/dist/player-DdfVrKWq.d.ts +225 -0
- package/dist/presence-Cb6WhcrQ.d.cts +77 -0
- package/dist/presence-Cb6WhcrQ.d.ts +77 -0
- package/dist/{registry-CSlH4iUn.d.ts → registry-7AZFuand.d.ts} +1 -1
- package/dist/{registry-B4l-lYts.d.cts → registry-DIpIaCkH.d.cts} +1 -1
- package/dist/tools/index.cjs +10 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +3 -74
- package/dist/tools/index.d.ts +3 -74
- package/dist/tools/index.js +12 -4
- package/dist/types-BULrFyuQ.d.cts +316 -0
- package/dist/types-BULrFyuQ.d.ts +316 -0
- package/dist/vector/index.d.cts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/package.json +14 -1
- package/dist/chunk-3ZBAXET6.cjs.map +0 -1
- package/dist/chunk-5TWIN7ZJ.js.map +0 -1
- package/dist/chunk-AMWXSYCI.js.map +0 -1
- package/dist/chunk-GTZXF4BI.cjs.map +0 -1
- package/dist/chunk-JOX6MJW4.cjs.map +0 -1
- package/dist/chunk-OV7UAKIY.js.map +0 -1
- package/dist/chunk-TGBCBQFV.cjs.map +0 -1
- package/dist/chunk-UAW5FEMD.js.map +0 -1
- package/dist/chunk-WBOAXDKD.js.map +0 -1
- package/dist/chunk-XFYUFVAX.cjs +0 -826
- package/dist/chunk-XFYUFVAX.cjs.map +0 -1
- /package/dist/{chunk-5N6AQCVB.js.map → chunk-BQQZ6MOI.js.map} +0 -0
- /package/dist/{chunk-YMKPMXZ4.js.map → chunk-OIKYP7XC.js.map} +0 -0
- /package/dist/{chunk-QFTVLEVN.js.map → chunk-RIXTW3C4.js.map} +0 -0
package/dist/tools/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { J as JsonSchema, a as JsonSchemaType, S as SchemaValidationError, v as validateJsonSchema } from '../schema-Di0CS6Pe.cjs';
|
|
2
|
-
|
|
3
|
-
export {
|
|
2
|
+
export { b as AgentTool, c as AgentToolHandler, A as AgentToolProvider, d as McpListToolsResult, e as McpToolContent, M as McpToolDefinition, a as McpToolResult, f as TOOL_NAMESPACE_SEPARATOR, g as ToolCallContext, h as ToolCallError, i as ToolErrorCode, T as ToolRegistry, j as ToolRegistryError, k as ToolRegistryOptions, l as createToolRegistry, t as toToolResult } from '../registry-DIpIaCkH.cjs';
|
|
3
|
+
export { C as ConnectToolBridgeOptions, J as JSON_RPC_ERRORS, b as JsonRpcId, c as JsonRpcNotification, d as JsonRpcRequest, e as JsonRpcResponse, f as MCP_PROTOCOL_VERSIONS, M as McpServer, g as McpServerOptions, T as TOOL_BRIDGE_DEFAULT_PORT, a as TOOL_BRIDGE_PROTOCOL, h as ToolBridgeConnection, i as ToolBridgeEditorMessage, j as ToolBridgeServerMessage, k as ToolBridgeSocket, l as ToolBridgeStatus, m as connectToolBridge, n as createMcpServer } from '../bridge-client-C5OziCRK.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Standard MCP Tool Definitions for @pixerate/editor.
|
|
@@ -1129,75 +1129,4 @@ declare const EDITOR_MCP_TOOLS: readonly [{
|
|
|
1129
1129
|
};
|
|
1130
1130
|
}];
|
|
1131
1131
|
|
|
1132
|
-
|
|
1133
|
-
declare const MCP_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
1134
|
-
type JsonRpcId = string | number;
|
|
1135
|
-
interface JsonRpcRequest {
|
|
1136
|
-
jsonrpc: '2.0';
|
|
1137
|
-
id?: JsonRpcId | null;
|
|
1138
|
-
method: string;
|
|
1139
|
-
params?: Record<string, any>;
|
|
1140
|
-
}
|
|
1141
|
-
interface JsonRpcResponse {
|
|
1142
|
-
jsonrpc: '2.0';
|
|
1143
|
-
id: JsonRpcId | null;
|
|
1144
|
-
result?: unknown;
|
|
1145
|
-
error?: {
|
|
1146
|
-
code: number;
|
|
1147
|
-
message: string;
|
|
1148
|
-
data?: unknown;
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
interface JsonRpcNotification {
|
|
1152
|
-
jsonrpc: '2.0';
|
|
1153
|
-
method: string;
|
|
1154
|
-
params?: Record<string, unknown>;
|
|
1155
|
-
}
|
|
1156
|
-
/** Standard JSON-RPC error codes used by the server. */
|
|
1157
|
-
declare const JSON_RPC_ERRORS: {
|
|
1158
|
-
readonly parseError: -32700;
|
|
1159
|
-
readonly invalidRequest: -32600;
|
|
1160
|
-
readonly methodNotFound: -32601;
|
|
1161
|
-
readonly invalidParams: -32602;
|
|
1162
|
-
readonly internalError: -32603;
|
|
1163
|
-
};
|
|
1164
|
-
interface McpServerOptions {
|
|
1165
|
-
/** `serverInfo` sent in the `initialize` result. */
|
|
1166
|
-
name: string;
|
|
1167
|
-
version: string;
|
|
1168
|
-
title?: string;
|
|
1169
|
-
/** Usage hints for the client's model, sent in the `initialize` result. */
|
|
1170
|
-
instructions?: string;
|
|
1171
|
-
/**
|
|
1172
|
-
* Sends server → client messages (`notifications/tools/list_changed`).
|
|
1173
|
-
* Without it the server still answers requests but announces nothing.
|
|
1174
|
-
*/
|
|
1175
|
-
send?: (message: JsonRpcNotification) => void;
|
|
1176
|
-
}
|
|
1177
|
-
interface McpServer {
|
|
1178
|
-
/**
|
|
1179
|
-
* Handles one client message (a JSON string or a parsed object) and
|
|
1180
|
-
* resolves to the response to send back, or `null` for notifications.
|
|
1181
|
-
* Never rejects.
|
|
1182
|
-
*/
|
|
1183
|
-
handle(message: string | JsonRpcRequest): Promise<JsonRpcResponse | null>;
|
|
1184
|
-
/** Whether the client has completed the `initialize` handshake. */
|
|
1185
|
-
readonly initialized: boolean;
|
|
1186
|
-
/** Stops list-changed notifications and aborts running tool calls. */
|
|
1187
|
-
close(): void;
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* A transport-agnostic MCP server for a {@link ToolRegistry}: wire `handle`
|
|
1191
|
-
* to any transport (stdio lines, a WebSocket, `postMessage`, an HTTP POST
|
|
1192
|
-
* handler) and pass `send` for server → client notifications.
|
|
1193
|
-
*
|
|
1194
|
-
* Supports `initialize` (with protocol version negotiation), `ping`,
|
|
1195
|
-
* `tools/list`, `tools/call` and `notifications/cancelled` (aborts the
|
|
1196
|
-
* call's `signal`), and announces `notifications/tools/list_changed` after
|
|
1197
|
-
* the client sends `notifications/initialized`. An unknown tool is a
|
|
1198
|
-
* JSON-RPC `-32602` error, as the MCP spec asks; invalid arguments and
|
|
1199
|
-
* handler failures are `isError` tool results the model can read and fix.
|
|
1200
|
-
*/
|
|
1201
|
-
declare function createMcpServer(registry: ToolRegistry, options: McpServerOptions): McpServer;
|
|
1202
|
-
|
|
1203
|
-
export { EDITOR_CANVAS_TOOLS, EDITOR_MCP_TOOLS, EDITOR_PROMPT_TOOLS, EDIT_OPERATION_REQUIRED_ARGUMENTS, EXPORT_EXCLUDED_SELECTORS, JSON_RPC_ERRORS, type JsonRpcId, type JsonRpcNotification, type JsonRpcRequest, type JsonRpcResponse, MCP_PROTOCOL_VERSIONS, MCP_TOOL_CANVAS_ADD_NODE, MCP_TOOL_CANVAS_CONNECT, MCP_TOOL_CANVAS_HIGHLIGHT, MCP_TOOL_CANVAS_LAYOUT, MCP_TOOL_CANVAS_REMOVE_NODES, MCP_TOOL_CANVAS_SELECT, MCP_TOOL_CANVAS_UPDATE_NODE, MCP_TOOL_EDIT_CANVAS, MCP_TOOL_EDIT_PROMPT, MCP_TOOL_GET_EDITOR_STATE, MCP_TOOL_PROMPT_INSERT_TEXT, MCP_TOOL_PROMPT_REPLACE_RANGE, MCP_TOOL_PROMPT_SELECT, MCP_TOOL_PROMPT_SET_VARIABLE, MCP_TOOL_VIEW_EDITOR, type McpServer, type McpServerOptions, ToolRegistry, createMcpServer };
|
|
1132
|
+
export { EDITOR_CANVAS_TOOLS, EDITOR_MCP_TOOLS, EDITOR_PROMPT_TOOLS, EDIT_OPERATION_REQUIRED_ARGUMENTS, EXPORT_EXCLUDED_SELECTORS, MCP_TOOL_CANVAS_ADD_NODE, MCP_TOOL_CANVAS_CONNECT, MCP_TOOL_CANVAS_HIGHLIGHT, MCP_TOOL_CANVAS_LAYOUT, MCP_TOOL_CANVAS_REMOVE_NODES, MCP_TOOL_CANVAS_SELECT, MCP_TOOL_CANVAS_UPDATE_NODE, MCP_TOOL_EDIT_CANVAS, MCP_TOOL_EDIT_PROMPT, MCP_TOOL_GET_EDITOR_STATE, MCP_TOOL_PROMPT_INSERT_TEXT, MCP_TOOL_PROMPT_REPLACE_RANGE, MCP_TOOL_PROMPT_SELECT, MCP_TOOL_PROMPT_SET_VARIABLE, MCP_TOOL_VIEW_EDITOR };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { J as JsonSchema, a as JsonSchemaType, S as SchemaValidationError, v as validateJsonSchema } from '../schema-Di0CS6Pe.js';
|
|
2
|
-
|
|
3
|
-
export {
|
|
2
|
+
export { b as AgentTool, c as AgentToolHandler, A as AgentToolProvider, d as McpListToolsResult, e as McpToolContent, M as McpToolDefinition, a as McpToolResult, f as TOOL_NAMESPACE_SEPARATOR, g as ToolCallContext, h as ToolCallError, i as ToolErrorCode, T as ToolRegistry, j as ToolRegistryError, k as ToolRegistryOptions, l as createToolRegistry, t as toToolResult } from '../registry-7AZFuand.js';
|
|
3
|
+
export { C as ConnectToolBridgeOptions, J as JSON_RPC_ERRORS, b as JsonRpcId, c as JsonRpcNotification, d as JsonRpcRequest, e as JsonRpcResponse, f as MCP_PROTOCOL_VERSIONS, M as McpServer, g as McpServerOptions, T as TOOL_BRIDGE_DEFAULT_PORT, a as TOOL_BRIDGE_PROTOCOL, h as ToolBridgeConnection, i as ToolBridgeEditorMessage, j as ToolBridgeServerMessage, k as ToolBridgeSocket, l as ToolBridgeStatus, m as connectToolBridge, n as createMcpServer } from '../bridge-client-C5dRjrz5.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Standard MCP Tool Definitions for @pixerate/editor.
|
|
@@ -1129,75 +1129,4 @@ declare const EDITOR_MCP_TOOLS: readonly [{
|
|
|
1129
1129
|
};
|
|
1130
1130
|
}];
|
|
1131
1131
|
|
|
1132
|
-
|
|
1133
|
-
declare const MCP_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
1134
|
-
type JsonRpcId = string | number;
|
|
1135
|
-
interface JsonRpcRequest {
|
|
1136
|
-
jsonrpc: '2.0';
|
|
1137
|
-
id?: JsonRpcId | null;
|
|
1138
|
-
method: string;
|
|
1139
|
-
params?: Record<string, any>;
|
|
1140
|
-
}
|
|
1141
|
-
interface JsonRpcResponse {
|
|
1142
|
-
jsonrpc: '2.0';
|
|
1143
|
-
id: JsonRpcId | null;
|
|
1144
|
-
result?: unknown;
|
|
1145
|
-
error?: {
|
|
1146
|
-
code: number;
|
|
1147
|
-
message: string;
|
|
1148
|
-
data?: unknown;
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
interface JsonRpcNotification {
|
|
1152
|
-
jsonrpc: '2.0';
|
|
1153
|
-
method: string;
|
|
1154
|
-
params?: Record<string, unknown>;
|
|
1155
|
-
}
|
|
1156
|
-
/** Standard JSON-RPC error codes used by the server. */
|
|
1157
|
-
declare const JSON_RPC_ERRORS: {
|
|
1158
|
-
readonly parseError: -32700;
|
|
1159
|
-
readonly invalidRequest: -32600;
|
|
1160
|
-
readonly methodNotFound: -32601;
|
|
1161
|
-
readonly invalidParams: -32602;
|
|
1162
|
-
readonly internalError: -32603;
|
|
1163
|
-
};
|
|
1164
|
-
interface McpServerOptions {
|
|
1165
|
-
/** `serverInfo` sent in the `initialize` result. */
|
|
1166
|
-
name: string;
|
|
1167
|
-
version: string;
|
|
1168
|
-
title?: string;
|
|
1169
|
-
/** Usage hints for the client's model, sent in the `initialize` result. */
|
|
1170
|
-
instructions?: string;
|
|
1171
|
-
/**
|
|
1172
|
-
* Sends server → client messages (`notifications/tools/list_changed`).
|
|
1173
|
-
* Without it the server still answers requests but announces nothing.
|
|
1174
|
-
*/
|
|
1175
|
-
send?: (message: JsonRpcNotification) => void;
|
|
1176
|
-
}
|
|
1177
|
-
interface McpServer {
|
|
1178
|
-
/**
|
|
1179
|
-
* Handles one client message (a JSON string or a parsed object) and
|
|
1180
|
-
* resolves to the response to send back, or `null` for notifications.
|
|
1181
|
-
* Never rejects.
|
|
1182
|
-
*/
|
|
1183
|
-
handle(message: string | JsonRpcRequest): Promise<JsonRpcResponse | null>;
|
|
1184
|
-
/** Whether the client has completed the `initialize` handshake. */
|
|
1185
|
-
readonly initialized: boolean;
|
|
1186
|
-
/** Stops list-changed notifications and aborts running tool calls. */
|
|
1187
|
-
close(): void;
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* A transport-agnostic MCP server for a {@link ToolRegistry}: wire `handle`
|
|
1191
|
-
* to any transport (stdio lines, a WebSocket, `postMessage`, an HTTP POST
|
|
1192
|
-
* handler) and pass `send` for server → client notifications.
|
|
1193
|
-
*
|
|
1194
|
-
* Supports `initialize` (with protocol version negotiation), `ping`,
|
|
1195
|
-
* `tools/list`, `tools/call` and `notifications/cancelled` (aborts the
|
|
1196
|
-
* call's `signal`), and announces `notifications/tools/list_changed` after
|
|
1197
|
-
* the client sends `notifications/initialized`. An unknown tool is a
|
|
1198
|
-
* JSON-RPC `-32602` error, as the MCP spec asks; invalid arguments and
|
|
1199
|
-
* handler failures are `isError` tool results the model can read and fix.
|
|
1200
|
-
*/
|
|
1201
|
-
declare function createMcpServer(registry: ToolRegistry, options: McpServerOptions): McpServer;
|
|
1202
|
-
|
|
1203
|
-
export { EDITOR_CANVAS_TOOLS, EDITOR_MCP_TOOLS, EDITOR_PROMPT_TOOLS, EDIT_OPERATION_REQUIRED_ARGUMENTS, EXPORT_EXCLUDED_SELECTORS, JSON_RPC_ERRORS, type JsonRpcId, type JsonRpcNotification, type JsonRpcRequest, type JsonRpcResponse, MCP_PROTOCOL_VERSIONS, MCP_TOOL_CANVAS_ADD_NODE, MCP_TOOL_CANVAS_CONNECT, MCP_TOOL_CANVAS_HIGHLIGHT, MCP_TOOL_CANVAS_LAYOUT, MCP_TOOL_CANVAS_REMOVE_NODES, MCP_TOOL_CANVAS_SELECT, MCP_TOOL_CANVAS_UPDATE_NODE, MCP_TOOL_EDIT_CANVAS, MCP_TOOL_EDIT_PROMPT, MCP_TOOL_GET_EDITOR_STATE, MCP_TOOL_PROMPT_INSERT_TEXT, MCP_TOOL_PROMPT_REPLACE_RANGE, MCP_TOOL_PROMPT_SELECT, MCP_TOOL_PROMPT_SET_VARIABLE, MCP_TOOL_VIEW_EDITOR, type McpServer, type McpServerOptions, ToolRegistry, createMcpServer };
|
|
1132
|
+
export { EDITOR_CANVAS_TOOLS, EDITOR_MCP_TOOLS, EDITOR_PROMPT_TOOLS, EDIT_OPERATION_REQUIRED_ARGUMENTS, EXPORT_EXCLUDED_SELECTORS, MCP_TOOL_CANVAS_ADD_NODE, MCP_TOOL_CANVAS_CONNECT, MCP_TOOL_CANVAS_HIGHLIGHT, MCP_TOOL_CANVAS_LAYOUT, MCP_TOOL_CANVAS_REMOVE_NODES, MCP_TOOL_CANVAS_SELECT, MCP_TOOL_CANVAS_UPDATE_NODE, MCP_TOOL_EDIT_CANVAS, MCP_TOOL_EDIT_PROMPT, MCP_TOOL_GET_EDITOR_STATE, MCP_TOOL_PROMPT_INSERT_TEXT, MCP_TOOL_PROMPT_REPLACE_RANGE, MCP_TOOL_PROMPT_SELECT, MCP_TOOL_PROMPT_SET_VARIABLE, MCP_TOOL_VIEW_EDITOR };
|
package/dist/tools/index.js
CHANGED
|
@@ -4,8 +4,6 @@ import {
|
|
|
4
4
|
EDITOR_PROMPT_TOOLS,
|
|
5
5
|
EDIT_OPERATION_REQUIRED_ARGUMENTS,
|
|
6
6
|
EXPORT_EXCLUDED_SELECTORS,
|
|
7
|
-
JSON_RPC_ERRORS,
|
|
8
|
-
MCP_PROTOCOL_VERSIONS,
|
|
9
7
|
MCP_TOOL_CANVAS_ADD_NODE,
|
|
10
8
|
MCP_TOOL_CANVAS_CONNECT,
|
|
11
9
|
MCP_TOOL_CANVAS_HIGHLIGHT,
|
|
@@ -20,14 +18,21 @@ import {
|
|
|
20
18
|
MCP_TOOL_PROMPT_REPLACE_RANGE,
|
|
21
19
|
MCP_TOOL_PROMPT_SELECT,
|
|
22
20
|
MCP_TOOL_PROMPT_SET_VARIABLE,
|
|
23
|
-
MCP_TOOL_VIEW_EDITOR
|
|
21
|
+
MCP_TOOL_VIEW_EDITOR
|
|
22
|
+
} from "../chunk-GPWNYQ7R.js";
|
|
23
|
+
import {
|
|
24
|
+
JSON_RPC_ERRORS,
|
|
25
|
+
MCP_PROTOCOL_VERSIONS,
|
|
26
|
+
TOOL_BRIDGE_DEFAULT_PORT,
|
|
27
|
+
TOOL_BRIDGE_PROTOCOL,
|
|
24
28
|
TOOL_NAMESPACE_SEPARATOR,
|
|
25
29
|
ToolRegistry,
|
|
26
30
|
ToolRegistryError,
|
|
31
|
+
connectToolBridge,
|
|
27
32
|
createMcpServer,
|
|
28
33
|
createToolRegistry,
|
|
29
34
|
toToolResult
|
|
30
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-PTMIGXZ2.js";
|
|
31
36
|
import {
|
|
32
37
|
validateJsonSchema
|
|
33
38
|
} from "../chunk-4FX5ACVG.js";
|
|
@@ -54,9 +59,12 @@ export {
|
|
|
54
59
|
MCP_TOOL_PROMPT_SELECT,
|
|
55
60
|
MCP_TOOL_PROMPT_SET_VARIABLE,
|
|
56
61
|
MCP_TOOL_VIEW_EDITOR,
|
|
62
|
+
TOOL_BRIDGE_DEFAULT_PORT,
|
|
63
|
+
TOOL_BRIDGE_PROTOCOL,
|
|
57
64
|
TOOL_NAMESPACE_SEPARATOR,
|
|
58
65
|
ToolRegistry,
|
|
59
66
|
ToolRegistryError,
|
|
67
|
+
connectToolBridge,
|
|
60
68
|
createMcpServer,
|
|
61
69
|
createToolRegistry,
|
|
62
70
|
toToolResult,
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core document model shared by every diagram family.
|
|
3
|
+
*
|
|
4
|
+
* Design goals:
|
|
5
|
+
* - **Lossless**: a document parsed and serialised without edits is
|
|
6
|
+
* byte-identical to its input. Anything the diagram module does not understand is kept
|
|
7
|
+
* verbatim as a passthrough statement.
|
|
8
|
+
* - **Graph-first**: every editable family projects onto the same
|
|
9
|
+
* {@link DiagramGraph} so that one canvas can render all of them.
|
|
10
|
+
* - **Mermaid-compatible metadata**: canvas state is stored in
|
|
11
|
+
* `%% @pixerate …` comments (or frontmatter) that every Mermaid parser ignores.
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
/** Mermaid diagram families the diagram module knows how to detect. */
|
|
16
|
+
type DiagramFamily = "flowchart" | "state" | "class" | "er" | "requirement" | "mindmap" | "sequence" | "gantt" | "pie" | "journey" | "timeline" | "gitGraph" | "c4" | "quadrant" | "sankey" | "xychart" | "block" | "architecture" | "packet" | "kanban" | "radar" | "treemap" | "info" | "unknown";
|
|
17
|
+
/**
|
|
18
|
+
* How deeply the diagram module can edit a family.
|
|
19
|
+
*
|
|
20
|
+
* - `editable` — statement-level lossless editing on the canvas. Every
|
|
21
|
+
* family the diagram module ships an adapter for is editable; the canvas model differs
|
|
22
|
+
* per family (graph, tree, timeline, chart data…).
|
|
23
|
+
* - `render-only` — source editing with a live Mermaid preview; no canvas.
|
|
24
|
+
* Used for families without an adapter and for unknown input.
|
|
25
|
+
*/
|
|
26
|
+
type SupportTier = "editable" | "render-only";
|
|
27
|
+
/** `[x, y]` canvas position in React Flow coordinates. */
|
|
28
|
+
type Point = readonly [number, number];
|
|
29
|
+
/** Line pattern of an edge. Mirrors Mermaid's `thickness` / `pattern`. */
|
|
30
|
+
type EdgePattern = "solid" | "dotted" | "thick" | "invisible";
|
|
31
|
+
/**
|
|
32
|
+
* Arrow head identifiers, aligned with Mermaid's `arrowTypeStart` /
|
|
33
|
+
* `arrowTypeEnd` values so React Flow markers can be derived uniformly.
|
|
34
|
+
*/
|
|
35
|
+
type ArrowHead = "none" | "arrow_point" | "arrow_open" | "arrow_cross" | "arrow_circle" | "arrow_barb" | "extension" | "composition" | "aggregation" | "dependency" | "lollipop" | "only_one" | "zero_or_one" | "one_or_more" | "zero_or_more" | "md_parent" | "requirement_arrow" | "requirement_contains";
|
|
36
|
+
interface GraphNode {
|
|
37
|
+
/** Stable identifier (the Mermaid id, e.g. `A`). */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Display label (raw Mermaid text, markdown strings included). */
|
|
40
|
+
label: string;
|
|
41
|
+
/**
|
|
42
|
+
* Canonical shape identifier (`rect`, `diam`, `cyl`, `stateStart`,
|
|
43
|
+
* `classBox`, `erBox`…). Mermaid aliases such as `squareRect` or `diamond`
|
|
44
|
+
* are normalised on parse. See `FLOWCHART_SHAPES` for the flowchart set.
|
|
45
|
+
*/
|
|
46
|
+
shape: string;
|
|
47
|
+
/** Enclosing group (subgraph / composite state / namespace) id. */
|
|
48
|
+
parentId?: string;
|
|
49
|
+
/** CSS class names applied with `:::`, `class`, or `classDef` defaults. */
|
|
50
|
+
classes: string[];
|
|
51
|
+
/** Inline `style` declarations (`fill:#f9f`, …). */
|
|
52
|
+
styles: string[];
|
|
53
|
+
/** `click` href target. */
|
|
54
|
+
link?: string;
|
|
55
|
+
linkTarget?: string;
|
|
56
|
+
tooltip?: string;
|
|
57
|
+
/** Family-specific payload (class members, ER attributes, state notes…). */
|
|
58
|
+
data?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
interface GraphGroup {
|
|
61
|
+
id: string;
|
|
62
|
+
label: string;
|
|
63
|
+
parentId?: string;
|
|
64
|
+
/** Local layout direction override (`TB`, `LR`, …). */
|
|
65
|
+
direction?: string;
|
|
66
|
+
classes: string[];
|
|
67
|
+
styles: string[];
|
|
68
|
+
data?: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
interface GraphEdge {
|
|
71
|
+
/** Mermaid-compatible id (`L_A_B_0` for auto ids, or the user id). */
|
|
72
|
+
id: string;
|
|
73
|
+
source: string;
|
|
74
|
+
target: string;
|
|
75
|
+
label?: string;
|
|
76
|
+
pattern: EdgePattern;
|
|
77
|
+
arrowStart: ArrowHead;
|
|
78
|
+
arrowEnd: ArrowHead;
|
|
79
|
+
/** Minimum rank length requested with extra dashes (`---->`). */
|
|
80
|
+
length: number;
|
|
81
|
+
classes: string[];
|
|
82
|
+
styles: string[];
|
|
83
|
+
animate?: boolean;
|
|
84
|
+
animation?: "fast" | "slow";
|
|
85
|
+
/** True when the id was written by the user (`A e1@--> B`). */
|
|
86
|
+
userDefinedId: boolean;
|
|
87
|
+
data?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/** Normalised, family-independent view of a diagram. */
|
|
90
|
+
interface DiagramGraph {
|
|
91
|
+
direction: string;
|
|
92
|
+
nodes: GraphNode[];
|
|
93
|
+
edges: GraphEdge[];
|
|
94
|
+
groups: GraphGroup[];
|
|
95
|
+
/** `classDef` declarations keyed by class name. */
|
|
96
|
+
classDefs: Record<string, string[]>;
|
|
97
|
+
title?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Diagram-level, family-specific settings that are not nodes or edges
|
|
100
|
+
* (pie `showData`, quadrant axis labels, gantt `dateFormat`…). Edited with
|
|
101
|
+
* `setGraphData`; the keys are documented per family in `FamilyUI.diagramFields`.
|
|
102
|
+
*/
|
|
103
|
+
data?: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
/** Canvas state that Mermaid itself does not model. Persisted as metadata. */
|
|
106
|
+
interface DiagramMeta {
|
|
107
|
+
/** Schema version of the metadata payload. */
|
|
108
|
+
v: 1;
|
|
109
|
+
/** Node / group positions keyed by id. */
|
|
110
|
+
layout?: Record<string, Point>;
|
|
111
|
+
/** Explicit node sizes for resized nodes/groups. */
|
|
112
|
+
sizes?: Record<string, readonly [number, number]>;
|
|
113
|
+
/** Viewport the user last looked at. */
|
|
114
|
+
viewport?: {
|
|
115
|
+
x: number;
|
|
116
|
+
y: number;
|
|
117
|
+
zoom: number;
|
|
118
|
+
};
|
|
119
|
+
/** Free-form extension slot for host applications. */
|
|
120
|
+
ext?: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
/** Where metadata lives in the source. */
|
|
123
|
+
type MetaCarrier = "comment" | "frontmatter";
|
|
124
|
+
/**
|
|
125
|
+
* Lines that precede the diagram header: YAML frontmatter, `%%{init}%%`
|
|
126
|
+
* directives, comments and blank lines. Kept verbatim.
|
|
127
|
+
*/
|
|
128
|
+
interface Preamble {
|
|
129
|
+
/** Raw lines, including the `---` fences of any frontmatter. */
|
|
130
|
+
lines: string[];
|
|
131
|
+
/** Parsed frontmatter when present (title/config/pixerate…). */
|
|
132
|
+
frontmatter?: Record<string, unknown>;
|
|
133
|
+
}
|
|
134
|
+
/** A parse problem reported by the diagram parser or by Mermaid. */
|
|
135
|
+
interface Diagnostic {
|
|
136
|
+
severity: "error" | "warning" | "info";
|
|
137
|
+
message: string;
|
|
138
|
+
/** 1-based line in the source, when known. */
|
|
139
|
+
line?: number;
|
|
140
|
+
column?: number;
|
|
141
|
+
source: "pixerate" | "mermaid";
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The parsed document. Family adapters extend `body` with their own statement
|
|
145
|
+
* list; consumers that only need the graph never look at it.
|
|
146
|
+
*/
|
|
147
|
+
interface MermaidDocument<TBody = unknown> {
|
|
148
|
+
family: DiagramFamily;
|
|
149
|
+
tier: SupportTier;
|
|
150
|
+
/** Source as given to {@link parseMermaid}. */
|
|
151
|
+
source: string;
|
|
152
|
+
preamble: Preamble;
|
|
153
|
+
/** The header line (`flowchart LR`, `stateDiagram-v2`, …) exactly as written. */
|
|
154
|
+
header: string;
|
|
155
|
+
/** Trailing newline / whitespace after the last statement, kept for fidelity. */
|
|
156
|
+
trailing: string;
|
|
157
|
+
/** End-of-line sequence detected in the source. */
|
|
158
|
+
eol: "\n" | "\r\n";
|
|
159
|
+
graph: DiagramGraph;
|
|
160
|
+
meta: DiagramMeta;
|
|
161
|
+
metaCarrier: MetaCarrier;
|
|
162
|
+
body: TBody;
|
|
163
|
+
diagnostics: Diagnostic[];
|
|
164
|
+
/** True once any edit has been applied to this document. */
|
|
165
|
+
dirty: boolean;
|
|
166
|
+
}
|
|
167
|
+
/** Directions understood by flowchart / state / class / ER. */
|
|
168
|
+
declare const DIRECTIONS: readonly ["TB", "TD", "BT", "LR", "RL"];
|
|
169
|
+
type Direction = (typeof DIRECTIONS)[number];
|
|
170
|
+
type EditOp = {
|
|
171
|
+
type: "addNode";
|
|
172
|
+
node: Partial<GraphNode> & {
|
|
173
|
+
id: string;
|
|
174
|
+
};
|
|
175
|
+
position?: Point;
|
|
176
|
+
} | {
|
|
177
|
+
type: "removeNodes";
|
|
178
|
+
ids: string[];
|
|
179
|
+
} | {
|
|
180
|
+
type: "renameNode";
|
|
181
|
+
id: string;
|
|
182
|
+
label: string;
|
|
183
|
+
} | {
|
|
184
|
+
type: "setNodeShape";
|
|
185
|
+
id: string;
|
|
186
|
+
shape: string;
|
|
187
|
+
} | {
|
|
188
|
+
type: "setNodeClasses";
|
|
189
|
+
id: string;
|
|
190
|
+
classes: string[];
|
|
191
|
+
} | {
|
|
192
|
+
type: "setNodeStyles";
|
|
193
|
+
id: string;
|
|
194
|
+
styles: string[];
|
|
195
|
+
} | {
|
|
196
|
+
type: "setNodeLink";
|
|
197
|
+
id: string;
|
|
198
|
+
link?: string;
|
|
199
|
+
target?: string;
|
|
200
|
+
tooltip?: string;
|
|
201
|
+
} | {
|
|
202
|
+
type: "setNodeData";
|
|
203
|
+
id: string;
|
|
204
|
+
data: Record<string, unknown>;
|
|
205
|
+
} | {
|
|
206
|
+
type: "moveNodes";
|
|
207
|
+
moves: {
|
|
208
|
+
id: string;
|
|
209
|
+
position: Point;
|
|
210
|
+
}[];
|
|
211
|
+
} | {
|
|
212
|
+
type: "resizeNode";
|
|
213
|
+
id: string;
|
|
214
|
+
size: readonly [number, number] | undefined;
|
|
215
|
+
} | {
|
|
216
|
+
type: "addEdge";
|
|
217
|
+
edge: Partial<GraphEdge> & {
|
|
218
|
+
source: string;
|
|
219
|
+
target: string;
|
|
220
|
+
};
|
|
221
|
+
} | {
|
|
222
|
+
type: "removeEdges";
|
|
223
|
+
ids: string[];
|
|
224
|
+
} | {
|
|
225
|
+
type: "setEdgeLabel";
|
|
226
|
+
id: string;
|
|
227
|
+
label: string;
|
|
228
|
+
}
|
|
229
|
+
/** Family-specific edge payload (sequence activation, message order, gantt dependency type…). */
|
|
230
|
+
| {
|
|
231
|
+
type: "setEdgeData";
|
|
232
|
+
id: string;
|
|
233
|
+
data: Record<string, unknown>;
|
|
234
|
+
} | {
|
|
235
|
+
type: "setEdgeStyle";
|
|
236
|
+
id: string;
|
|
237
|
+
pattern?: EdgePattern;
|
|
238
|
+
arrowStart?: ArrowHead;
|
|
239
|
+
arrowEnd?: ArrowHead;
|
|
240
|
+
length?: number;
|
|
241
|
+
styles?: string[];
|
|
242
|
+
} | {
|
|
243
|
+
type: "reconnectEdge";
|
|
244
|
+
id: string;
|
|
245
|
+
source: string;
|
|
246
|
+
target: string;
|
|
247
|
+
} | {
|
|
248
|
+
type: "groupNodes";
|
|
249
|
+
groupId: string;
|
|
250
|
+
label: string;
|
|
251
|
+
nodeIds: string[];
|
|
252
|
+
parentId?: string;
|
|
253
|
+
} | {
|
|
254
|
+
type: "ungroup";
|
|
255
|
+
groupId: string;
|
|
256
|
+
} | {
|
|
257
|
+
type: "renameGroup";
|
|
258
|
+
id: string;
|
|
259
|
+
label: string;
|
|
260
|
+
} | {
|
|
261
|
+
type: "setGroupDirection";
|
|
262
|
+
id: string;
|
|
263
|
+
direction?: string;
|
|
264
|
+
} | {
|
|
265
|
+
type: "setNodeParent";
|
|
266
|
+
ids: string[];
|
|
267
|
+
parentId?: string;
|
|
268
|
+
} | {
|
|
269
|
+
type: "setDirection";
|
|
270
|
+
direction: string;
|
|
271
|
+
} | {
|
|
272
|
+
type: "setClassDef";
|
|
273
|
+
name: string;
|
|
274
|
+
styles: string[] | undefined;
|
|
275
|
+
} | {
|
|
276
|
+
type: "setTitle";
|
|
277
|
+
title: string | undefined;
|
|
278
|
+
}
|
|
279
|
+
/** Merge diagram-level settings into `graph.data` (see {@link DiagramGraph.data}). */
|
|
280
|
+
| {
|
|
281
|
+
type: "setGraphData";
|
|
282
|
+
data: Record<string, unknown>;
|
|
283
|
+
} | {
|
|
284
|
+
type: "setViewport";
|
|
285
|
+
viewport: DiagramMeta["viewport"];
|
|
286
|
+
} | {
|
|
287
|
+
type: "setMetaExt";
|
|
288
|
+
key: string;
|
|
289
|
+
value: unknown;
|
|
290
|
+
} | {
|
|
291
|
+
type: "replaceSource";
|
|
292
|
+
source: string;
|
|
293
|
+
};
|
|
294
|
+
/** Family adapter contract. See `docs/architecture.md`. */
|
|
295
|
+
interface DiagramAdapter<TBody = unknown> {
|
|
296
|
+
family: DiagramFamily;
|
|
297
|
+
tier: SupportTier;
|
|
298
|
+
parse(source: string, context: AdapterParseContext): MermaidDocument<TBody>;
|
|
299
|
+
serialize(doc: MermaidDocument<TBody>): string;
|
|
300
|
+
apply(doc: MermaidDocument<TBody>, op: EditOp): MermaidDocument<TBody>;
|
|
301
|
+
}
|
|
302
|
+
/** Pre-split source handed to adapters so they do not repeat the work. */
|
|
303
|
+
interface AdapterParseContext {
|
|
304
|
+
source: string;
|
|
305
|
+
eol: "\n" | "\r\n";
|
|
306
|
+
preamble: Preamble;
|
|
307
|
+
header: string;
|
|
308
|
+
/** Body lines after the header (metadata comments already removed). */
|
|
309
|
+
bodyLines: string[];
|
|
310
|
+
trailing: string;
|
|
311
|
+
meta: DiagramMeta;
|
|
312
|
+
metaCarrier: MetaCarrier;
|
|
313
|
+
family: DiagramFamily;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export { type ArrowHead as A, type DiagramFamily as D, type EditOp as E, type GraphEdge as G, type MetaCarrier as M, type Preamble as P, type SupportTier as S, type MermaidDocument as a, type DiagramAdapter as b, type DiagramMeta as c, type EdgePattern as d, type Point as e, type DiagramGraph as f, type AdapterParseContext as g, DIRECTIONS as h, type Diagnostic as i, type Direction as j, type GraphGroup as k, type GraphNode as l };
|