@pixerate/editor 0.139.1 → 0.140.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 (120) hide show
  1. package/README.md +25 -4
  2. package/dist/agent/formatTools.d.cts +15 -0
  3. package/dist/agent/formatTools.d.ts +15 -0
  4. package/dist/agent/index.cjs +397 -46
  5. package/dist/agent/index.js +365 -14
  6. package/dist/agent/providers.d.cts +5 -3
  7. package/dist/agent/providers.d.ts +5 -3
  8. package/dist/animation-editor/effect-tools.d.cts +1 -1
  9. package/dist/animation-editor/effect-tools.d.ts +1 -1
  10. package/dist/animation-editor/index.cjs +250 -116
  11. package/dist/animation-editor/index.js +228 -94
  12. package/dist/animation-editor/instructions.d.cts +1 -1
  13. package/dist/animation-editor/instructions.d.ts +1 -1
  14. package/dist/animation-editor/parse.d.cts +3 -1
  15. package/dist/animation-editor/parse.d.ts +3 -1
  16. package/dist/animation-editor/tools.d.cts +8 -3
  17. package/dist/animation-editor/tools.d.ts +8 -3
  18. package/dist/bridge/cli.cjs +3 -3
  19. package/dist/bridge/cli.js +2 -2
  20. package/dist/bridge/index.cjs +7 -3
  21. package/dist/bridge/index.d.cts +7 -0
  22. package/dist/bridge/index.d.ts +7 -0
  23. package/dist/bridge/index.js +8 -4
  24. package/dist/bridge/skills.d.cts +9 -0
  25. package/dist/bridge/skills.d.ts +9 -0
  26. package/dist/canvas/effect-tools.d.cts +1 -1
  27. package/dist/canvas/effect-tools.d.ts +1 -1
  28. package/dist/canvas/index.cjs +22 -17
  29. package/dist/canvas/index.js +8 -3
  30. package/dist/chart/file-tools.d.cts +1 -1
  31. package/dist/chart/file-tools.d.ts +1 -1
  32. package/dist/chart/index.cjs +7 -1
  33. package/dist/chart/index.js +7 -1
  34. package/dist/chart/tools.d.cts +1 -1
  35. package/dist/chart/tools.d.ts +1 -1
  36. package/dist/{chunk-BKMU3V6K.js → chunk-5ED73EC6.js} +8 -1
  37. package/dist/{chunk-VRIR53SW.js → chunk-5G3KYRER.js} +2 -1
  38. package/dist/{chunk-KHMVB3SJ.js → chunk-7KWJEYIK.js} +4 -1
  39. package/dist/{chunk-R47NQICB.cjs → chunk-HDCH35UM.cjs} +47 -10
  40. package/dist/{chunk-6NCBFBXA.js → chunk-IQ6KKXOU.js} +1 -1
  41. package/dist/{chunk-PCNCT4ZY.js → chunk-KIBEEN5K.js} +40 -3
  42. package/dist/{chunk-CZRWP6IW.cjs → chunk-N2FGYZ4Q.cjs} +8 -1
  43. package/dist/{chunk-T6Y5FV7G.cjs → chunk-RPW7YL3D.cjs} +2 -1
  44. package/dist/{chunk-3V746PF4.cjs → chunk-RUZQMYXH.cjs} +4 -1
  45. package/dist/{chunk-GUPQ5BNA.cjs → chunk-RWML7TWG.cjs} +44 -44
  46. package/dist/{chunk-HGHXGCKG.cjs → chunk-SVFEVKLF.cjs} +1 -1
  47. package/dist/{chunk-PQMADRCI.js → chunk-UOJS6PUP.js} +1 -1
  48. package/dist/{chunk-BWT4IWLK.cjs → chunk-VKF3PWKR.cjs} +7 -7
  49. package/dist/chunk-WBKLYLZE.js +1156 -0
  50. package/dist/{chunk-TBSPPVTT.js → chunk-XCK7QK5D.js} +1 -1
  51. package/dist/chunk-ZAOOIJ6I.cjs +1156 -0
  52. package/dist/commands/agentTools.d.cts +1 -1
  53. package/dist/commands/agentTools.d.ts +1 -1
  54. package/dist/commands/index.cjs +3 -0
  55. package/dist/commands/index.js +3 -0
  56. package/dist/diagram/index.cjs +3 -0
  57. package/dist/diagram/index.js +3 -0
  58. package/dist/diagram/tools.d.cts +1 -1
  59. package/dist/diagram/tools.d.ts +1 -1
  60. package/dist/effects/index.cjs +32 -32
  61. package/dist/effects/index.js +1 -1
  62. package/dist/effects/tools.d.cts +5 -1
  63. package/dist/effects/tools.d.ts +5 -1
  64. package/dist/extensions/index.cjs +3 -3
  65. package/dist/extensions/index.js +2 -2
  66. package/dist/generation/index.cjs +7 -1
  67. package/dist/generation/index.js +7 -1
  68. package/dist/image-editor/index.cjs +21 -15
  69. package/dist/image-editor/index.js +8 -2
  70. package/dist/image-editor/provider-effect-tools.d.cts +1 -1
  71. package/dist/image-editor/provider-effect-tools.d.ts +1 -1
  72. package/dist/image-editor/tools.d.cts +1 -1
  73. package/dist/image-editor/tools.d.ts +1 -1
  74. package/dist/index.cjs +8 -8
  75. package/dist/index.js +2 -2
  76. package/dist/paint-editor/effect-tools.d.cts +1 -1
  77. package/dist/paint-editor/effect-tools.d.ts +1 -1
  78. package/dist/paint-editor/index.cjs +18 -8
  79. package/dist/paint-editor/index.js +13 -3
  80. package/dist/paint-editor/tools.d.cts +1 -1
  81. package/dist/paint-editor/tools.d.ts +1 -1
  82. package/dist/tools/bridge-client.d.cts +3 -3
  83. package/dist/tools/bridge-client.d.ts +3 -3
  84. package/dist/tools/capture.d.cts +5 -1
  85. package/dist/tools/capture.d.ts +5 -1
  86. package/dist/tools/definitions.d.cts +2 -2
  87. package/dist/tools/definitions.d.ts +2 -2
  88. package/dist/tools/index.cjs +31 -5
  89. package/dist/tools/index.d.cts +3 -0
  90. package/dist/tools/index.d.ts +3 -0
  91. package/dist/tools/index.js +31 -5
  92. package/dist/tools/mcp-server.d.cts +24 -6
  93. package/dist/tools/mcp-server.d.ts +24 -6
  94. package/dist/tools/registry.d.cts +81 -6
  95. package/dist/tools/registry.d.ts +81 -6
  96. package/dist/tools/search.d.cts +30 -0
  97. package/dist/tools/search.d.ts +30 -0
  98. package/dist/tools/skills.d.cts +26 -0
  99. package/dist/tools/skills.d.ts +26 -0
  100. package/dist/tools/view.d.cts +95 -0
  101. package/dist/tools/view.d.ts +95 -0
  102. package/dist/vector/effect-tools.d.cts +1 -1
  103. package/dist/vector/effect-tools.d.ts +1 -1
  104. package/dist/vector/index.cjs +13 -7
  105. package/dist/vector/index.js +8 -2
  106. package/dist/video-editor/effect-tools.d.cts +1 -1
  107. package/dist/video-editor/effect-tools.d.ts +1 -1
  108. package/dist/video-editor/index.cjs +275 -269
  109. package/dist/video-editor/index.js +8 -2
  110. package/dist/video-editor/tools.d.cts +1 -1
  111. package/dist/video-editor/tools.d.ts +1 -1
  112. package/package.json +4 -2
  113. package/skills/README.md +8 -3
  114. package/skills/pixerate-agent-tools/SKILL.md +33 -7
  115. package/skills/pixerate-animation-editor/SKILL.md +7 -0
  116. package/skills/pixerate-rich-text/SKILL.md +18 -4
  117. package/dist/chunk-5RRYDFU2.js +0 -466
  118. package/dist/chunk-SPVIXXIB.cjs +0 -466
  119. /package/dist/{chunk-SMJK5HBJ.js → chunk-MCTQXUXR.js} +0 -0
  120. /package/dist/{chunk-DDF6WQ62.cjs → chunk-R6DFK5OX.cjs} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-DDF6WQ62.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-R6DFK5OX.cjs');
2
2
 
3
3
 
4
4
 
@@ -11,7 +11,6 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkSPVIXXIBcjs = require('../chunk-SPVIXXIB.cjs');
15
14
 
16
15
 
17
16
 
@@ -25,6 +24,7 @@ var _chunkSPVIXXIBcjs = require('../chunk-SPVIXXIB.cjs');
25
24
 
26
25
 
27
26
 
27
+ var _chunkZAOOIJ6Icjs = require('../chunk-ZAOOIJ6I.cjs');
28
28
 
29
29
 
30
30
 
@@ -39,7 +39,6 @@ var _chunkSPVIXXIBcjs = require('../chunk-SPVIXXIB.cjs');
39
39
 
40
40
 
41
41
 
42
- var _chunkHGHXGCKGcjs = require('../chunk-HGHXGCKG.cjs');
43
42
 
44
43
 
45
44
 
@@ -48,7 +47,21 @@ var _chunkHGHXGCKGcjs = require('../chunk-HGHXGCKG.cjs');
48
47
 
49
48
 
50
49
 
51
- var _chunkCZRWP6IWcjs = require('../chunk-CZRWP6IW.cjs');
50
+
51
+
52
+
53
+
54
+
55
+ var _chunkSVFEVKLFcjs = require('../chunk-SVFEVKLF.cjs');
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+ var _chunkN2FGYZ4Qcjs = require('../chunk-N2FGYZ4Q.cjs');
52
65
 
53
66
 
54
67
  var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
@@ -98,4 +111,17 @@ var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
98
111
 
99
112
 
100
113
 
101
- exports.CAPTURE_EXCLUDE_SELECTOR = _chunkHGHXGCKGcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkHGHXGCKGcjs.CAPTURE_OVERLAY_SELECTORS; exports.EDITOR_CANVAS_TOOLS = _chunkHGHXGCKGcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkHGHXGCKGcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkHGHXGCKGcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkHGHXGCKGcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkHGHXGCKGcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkSPVIXXIBcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkSPVIXXIBcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkHGHXGCKGcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkHGHXGCKGcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkHGHXGCKGcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkHGHXGCKGcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkHGHXGCKGcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkHGHXGCKGcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkHGHXGCKGcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkHGHXGCKGcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkHGHXGCKGcjs.MCP_TOOL_VIEW_EDITOR; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkSPVIXXIBcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkSPVIXXIBcjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_NAMESPACE_SEPARATOR = _chunkSPVIXXIBcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkSPVIXXIBcjs.ToolRegistry; exports.ToolRegistryError = _chunkSPVIXXIBcjs.ToolRegistryError; exports.captureInputSchema = _chunkCZRWP6IWcjs.captureInputSchema; exports.captureOutputSize = _chunkCZRWP6IWcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkHGHXGCKGcjs.cloneElementWithStyles; exports.connectToolBridge = _chunkSPVIXXIBcjs.connectToolBridge; exports.createCaptureTool = _chunkCZRWP6IWcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkCZRWP6IWcjs.createCaptureToolProvider; exports.createElementCaptureSurface = _chunkHGHXGCKGcjs.createElementCaptureSurface; exports.createMcpServer = _chunkSPVIXXIBcjs.createMcpServer; exports.createToolRegistry = _chunkSPVIXXIBcjs.createToolRegistry; exports.elementToSvg = _chunkHGHXGCKGcjs.elementToSvg; exports.rasterizeElement = _chunkHGHXGCKGcjs.rasterizeElement; exports.resolveCaptureRequest = _chunkCZRWP6IWcjs.resolveCaptureRequest; exports.toCapturedImageData = _chunkCZRWP6IWcjs.toCapturedImageData; exports.toToolResult = _chunkSPVIXXIBcjs.toToolResult; exports.unionCaptureRects = _chunkCZRWP6IWcjs.unionCaptureRects; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ exports.CAPTURE_EXCLUDE_SELECTOR = _chunkSVFEVKLFcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkSVFEVKLFcjs.CAPTURE_OVERLAY_SELECTORS; exports.EDITOR_CANVAS_TOOLS = _chunkSVFEVKLFcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkSVFEVKLFcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkSVFEVKLFcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkSVFEVKLFcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkSVFEVKLFcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkZAOOIJ6Icjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkZAOOIJ6Icjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkSVFEVKLFcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkSVFEVKLFcjs.MCP_TOOL_VIEW_EDITOR; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkZAOOIJ6Icjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkZAOOIJ6Icjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_DISCOVERY_TOOLS = _chunkZAOOIJ6Icjs.TOOL_DISCOVERY_TOOLS; exports.TOOL_NAMESPACE_SEPARATOR = _chunkZAOOIJ6Icjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkZAOOIJ6Icjs.ToolRegistry; exports.ToolRegistryError = _chunkZAOOIJ6Icjs.ToolRegistryError; exports.ToolRegistryView = _chunkZAOOIJ6Icjs.ToolRegistryView; exports.baseToolName = _chunkZAOOIJ6Icjs.baseToolName; exports.captureInputSchema = _chunkN2FGYZ4Qcjs.captureInputSchema; exports.captureOutputSize = _chunkN2FGYZ4Qcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkSVFEVKLFcjs.cloneElementWithStyles; exports.connectToolBridge = _chunkZAOOIJ6Icjs.connectToolBridge; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createMcpServer = _chunkZAOOIJ6Icjs.createMcpServer; exports.createToolRegistry = _chunkZAOOIJ6Icjs.createToolRegistry; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunkZAOOIJ6Icjs.errorResult; exports.listSkills = _chunkZAOOIJ6Icjs.listSkills; exports.parseSkillFrontmatter = _chunkZAOOIJ6Icjs.parseSkillFrontmatter; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunkZAOOIJ6Icjs.readSkillFile; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.searchTokens = _chunkZAOOIJ6Icjs.searchTokens; exports.searchTools = _chunkZAOOIJ6Icjs.searchTools; exports.summarize = _chunkZAOOIJ6Icjs.summarize; exports.toCapturedImageData = _chunkN2FGYZ4Qcjs.toCapturedImageData; exports.toToolResult = _chunkZAOOIJ6Icjs.toToolResult; exports.toolsetInstructions = _chunkZAOOIJ6Icjs.toolsetInstructions; exports.toolsetName = _chunkZAOOIJ6Icjs.toolsetName; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unknownToolMessage = _chunkZAOOIJ6Icjs.unknownToolMessage; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
@@ -14,3 +14,6 @@ export * from './mcp-server.cjs';
14
14
  export * from './bridge-client.cjs';
15
15
  export * from './capture.cjs';
16
16
  export * from './dom-capture.cjs';
17
+ export * from './view.cjs';
18
+ export * from './search.cjs';
19
+ export * from './skills.cjs';
@@ -14,3 +14,6 @@ export * from './mcp-server.js';
14
14
  export * from './bridge-client.js';
15
15
  export * from './capture.js';
16
16
  export * from './dom-capture.js';
17
+ export * from './view.js';
18
+ export * from './search.js';
19
+ export * from './skills.js';
@@ -1,17 +1,30 @@
1
- import "../chunk-SMJK5HBJ.js";
1
+ import "../chunk-MCTQXUXR.js";
2
2
  import {
3
3
  JSON_RPC_ERRORS,
4
4
  MCP_PROTOCOL_VERSIONS,
5
5
  TOOL_BRIDGE_DEFAULT_PORT,
6
6
  TOOL_BRIDGE_PROTOCOL,
7
+ TOOL_DISCOVERY_TOOLS,
7
8
  TOOL_NAMESPACE_SEPARATOR,
8
9
  ToolRegistry,
9
10
  ToolRegistryError,
11
+ ToolRegistryView,
12
+ baseToolName,
10
13
  connectToolBridge,
11
14
  createMcpServer,
12
15
  createToolRegistry,
13
- toToolResult
14
- } from "../chunk-5RRYDFU2.js";
16
+ errorResult,
17
+ listSkills,
18
+ parseSkillFrontmatter,
19
+ readSkillFile,
20
+ searchTokens,
21
+ searchTools,
22
+ summarize,
23
+ toToolResult,
24
+ toolsetInstructions,
25
+ toolsetName,
26
+ unknownToolMessage
27
+ } from "../chunk-WBKLYLZE.js";
15
28
  import {
16
29
  CAPTURE_EXCLUDE_SELECTOR,
17
30
  CAPTURE_OVERLAY_SELECTORS,
@@ -39,7 +52,7 @@ import {
39
52
  createElementCaptureSurface,
40
53
  elementToSvg,
41
54
  rasterizeElement
42
- } from "../chunk-TBSPPVTT.js";
55
+ } from "../chunk-XCK7QK5D.js";
43
56
  import {
44
57
  captureInputSchema,
45
58
  captureOutputSize,
@@ -48,7 +61,7 @@ import {
48
61
  resolveCaptureRequest,
49
62
  toCapturedImageData,
50
63
  unionCaptureRects
51
- } from "../chunk-BKMU3V6K.js";
64
+ } from "../chunk-5ED73EC6.js";
52
65
  import {
53
66
  validateJsonSchema
54
67
  } from "../chunk-V2ZCJRDM.js";
@@ -79,9 +92,12 @@ export {
79
92
  MCP_TOOL_VIEW_EDITOR,
80
93
  TOOL_BRIDGE_DEFAULT_PORT,
81
94
  TOOL_BRIDGE_PROTOCOL,
95
+ TOOL_DISCOVERY_TOOLS,
82
96
  TOOL_NAMESPACE_SEPARATOR,
83
97
  ToolRegistry,
84
98
  ToolRegistryError,
99
+ ToolRegistryView,
100
+ baseToolName,
85
101
  captureInputSchema,
86
102
  captureOutputSize,
87
103
  cloneElementWithStyles,
@@ -92,10 +108,20 @@ export {
92
108
  createMcpServer,
93
109
  createToolRegistry,
94
110
  elementToSvg,
111
+ errorResult,
112
+ listSkills,
113
+ parseSkillFrontmatter,
95
114
  rasterizeElement,
115
+ readSkillFile,
96
116
  resolveCaptureRequest,
117
+ searchTokens,
118
+ searchTools,
119
+ summarize,
97
120
  toCapturedImageData,
98
121
  toToolResult,
122
+ toolsetInstructions,
123
+ toolsetName,
99
124
  unionCaptureRects,
125
+ unknownToolMessage,
100
126
  validateJsonSchema
101
127
  };
@@ -1,4 +1,5 @@
1
- import type { ToolRegistry } from './registry.cjs';
1
+ import type { ToolSource } from './registry.cjs';
2
+ import { type SkillFiles } from './skills.cjs';
2
3
  /** MCP protocol revisions this server speaks, newest first. */
3
4
  export declare const MCP_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26", "2024-11-05"];
4
5
  export type JsonRpcId = string | number;
@@ -36,8 +37,18 @@ export interface McpServerOptions {
36
37
  name: string;
37
38
  version: string;
38
39
  title?: string;
39
- /** Usage hints for the client's model, sent in the `initialize` result. */
40
- instructions?: string;
40
+ /**
41
+ * Usage hints for the client's model, sent in the `initialize` result. Pass
42
+ * `toolsetInstructions` (or your own function) to describe the toolsets
43
+ * registered when the client connects.
44
+ */
45
+ instructions?: string | ((source: ToolSource) => string);
46
+ /**
47
+ * Agent skill files to serve as MCP resources (`skill://<name>/SKILL.md` and
48
+ * its reference files) and prompts (one per skill), so a client can load the
49
+ * guide for the tools it uses. See {@link SkillFiles}.
50
+ */
51
+ skills?: SkillFiles;
41
52
  /**
42
53
  * Sends server → client messages (`notifications/tools/list_changed`).
43
54
  * Without it the server still answers requests but announces nothing.
@@ -57,15 +68,22 @@ export interface McpServer {
57
68
  close(): void;
58
69
  }
59
70
  /**
60
- * A transport-agnostic MCP server for a {@link ToolRegistry}: wire `handle`
71
+ * Instructions describing the toolsets of a tool source: what each covers, how
72
+ * tools are named, and which skill documents it. Pass it as
73
+ * `createMcpServer(source, { instructions: toolsetInstructions })`.
74
+ */
75
+ export declare function toolsetInstructions(source: ToolSource): string;
76
+ /**
77
+ * A transport-agnostic MCP server for a {@link ToolRegistry} (or any {@link ToolSource}): wire `handle`
61
78
  * to any transport (stdio lines, a WebSocket, `postMessage`, an HTTP POST
62
79
  * handler) and pass `send` for server → client notifications.
63
80
  *
64
81
  * Supports `initialize` (with protocol version negotiation), `ping`,
65
- * `tools/list`, `tools/call` and `notifications/cancelled` (aborts the
82
+ * `tools/list`, `tools/call`, with `skills` `resources/list`, `resources/read`,
83
+ * `prompts/list` and `prompts/get`, and `notifications/cancelled` (aborts the
66
84
  * call's `signal`), and announces `notifications/tools/list_changed` after
67
85
  * the client sends `notifications/initialized`. An unknown tool is a
68
86
  * JSON-RPC `-32602` error, as the MCP spec asks; invalid arguments and
69
87
  * handler failures are `isError` tool results the model can read and fix.
70
88
  */
71
- export declare function createMcpServer(registry: ToolRegistry, options: McpServerOptions): McpServer;
89
+ export declare function createMcpServer(registry: ToolSource, options: McpServerOptions): McpServer;
@@ -1,4 +1,5 @@
1
- import type { ToolRegistry } from './registry.js';
1
+ import type { ToolSource } from './registry.js';
2
+ import { type SkillFiles } from './skills.js';
2
3
  /** MCP protocol revisions this server speaks, newest first. */
3
4
  export declare const MCP_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26", "2024-11-05"];
4
5
  export type JsonRpcId = string | number;
@@ -36,8 +37,18 @@ export interface McpServerOptions {
36
37
  name: string;
37
38
  version: string;
38
39
  title?: string;
39
- /** Usage hints for the client's model, sent in the `initialize` result. */
40
- instructions?: string;
40
+ /**
41
+ * Usage hints for the client's model, sent in the `initialize` result. Pass
42
+ * `toolsetInstructions` (or your own function) to describe the toolsets
43
+ * registered when the client connects.
44
+ */
45
+ instructions?: string | ((source: ToolSource) => string);
46
+ /**
47
+ * Agent skill files to serve as MCP resources (`skill://<name>/SKILL.md` and
48
+ * its reference files) and prompts (one per skill), so a client can load the
49
+ * guide for the tools it uses. See {@link SkillFiles}.
50
+ */
51
+ skills?: SkillFiles;
41
52
  /**
42
53
  * Sends server → client messages (`notifications/tools/list_changed`).
43
54
  * Without it the server still answers requests but announces nothing.
@@ -57,15 +68,22 @@ export interface McpServer {
57
68
  close(): void;
58
69
  }
59
70
  /**
60
- * A transport-agnostic MCP server for a {@link ToolRegistry}: wire `handle`
71
+ * Instructions describing the toolsets of a tool source: what each covers, how
72
+ * tools are named, and which skill documents it. Pass it as
73
+ * `createMcpServer(source, { instructions: toolsetInstructions })`.
74
+ */
75
+ export declare function toolsetInstructions(source: ToolSource): string;
76
+ /**
77
+ * A transport-agnostic MCP server for a {@link ToolRegistry} (or any {@link ToolSource}): wire `handle`
61
78
  * to any transport (stdio lines, a WebSocket, `postMessage`, an HTTP POST
62
79
  * handler) and pass `send` for server → client notifications.
63
80
  *
64
81
  * Supports `initialize` (with protocol version negotiation), `ping`,
65
- * `tools/list`, `tools/call` and `notifications/cancelled` (aborts the
82
+ * `tools/list`, `tools/call`, with `skills` `resources/list`, `resources/read`,
83
+ * `prompts/list` and `prompts/get`, and `notifications/cancelled` (aborts the
66
84
  * call's `signal`), and announces `notifications/tools/list_changed` after
67
85
  * the client sends `notifications/initialized`. An unknown tool is a
68
86
  * JSON-RPC `-32602` error, as the MCP spec asks; invalid arguments and
69
87
  * handler failures are `isError` tool results the model can read and fix.
70
88
  */
71
- export declare function createMcpServer(registry: ToolRegistry, options: McpServerOptions): McpServer;
89
+ export declare function createMcpServer(registry: ToolSource, options: McpServerOptions): McpServer;
@@ -1,4 +1,5 @@
1
1
  import { type JsonSchema, type SchemaValidationError } from './schema.cjs';
2
+ import { ToolRegistryView, type ToolViewOptions } from './view.cjs';
2
3
  /**
3
4
  * MCP-shaped tool definition, as returned by `tools/list`.
4
5
  */
@@ -59,12 +60,25 @@ export interface AgentTool extends McpToolDefinition {
59
60
  }
60
61
  /**
61
62
  * A source of tools, typically one per mounted editor, spreadsheet or canvas.
63
+ * Each provider is a toolset: its tools are exposed as `<namespace>__<name>`
64
+ * (see {@link ToolRegistryOptions.namespaces}) and grouped under that name by
65
+ * `toolsets()`, `registry.view()` and the discovery tools.
62
66
  */
63
67
  export interface AgentToolProvider {
64
- /** Unique id within a registry, e.g. `doc-1`. Used as the namespace on collisions. */
68
+ /** Unique id within a registry, e.g. `doc-1`. The default namespace. */
65
69
  id: string;
66
- /** Always prefix this provider's tools with `<namespace>__`. */
70
+ /**
71
+ * Prefix for this provider's tools (`<namespace>__<name>`). Defaults to the
72
+ * `id`. Pass `''` to expose bare names (prefixed by `id` only on a collision).
73
+ * Providers may share a namespace when their tool names differ.
74
+ */
67
75
  namespace?: string;
76
+ /** Short name of the toolset for agents and UIs, e.g. "Chart editor". */
77
+ title?: string;
78
+ /** What the toolset covers and when to use it, in a sentence or two. */
79
+ description?: string;
80
+ /** Name of the agent skill that documents these tools, e.g. `pixerate-chart`. */
81
+ skill?: string;
68
82
  /** Tools, or a function returning the current tools (re-read on every `listTools`). */
69
83
  tools: readonly AgentTool[] | (() => readonly AgentTool[]);
70
84
  /** Lets the provider signal that its tool list changed; returns an unsubscribe function. */
@@ -84,7 +98,18 @@ export declare class ToolRegistryError extends Error {
84
98
  }
85
99
  export interface ToolRegistryOptions {
86
100
  /**
87
- * What to do when two providers contribute the same tool name:
101
+ * `always` (default): every tool is exposed as `<namespace>__<name>`, where the
102
+ * namespace is the provider's `namespace` or else its `id`, so names don't
103
+ * change when another editor mounts. `on-collision`: only providers with an
104
+ * explicit `namespace` are prefixed; other tools keep their bare name unless
105
+ * two providers share it (see `onCollision`).
106
+ *
107
+ * Either way, `callTool`, `hasTool` and `getTool` also accept a bare name
108
+ * when exactly one exposed tool has it.
109
+ */
110
+ namespaces?: 'always' | 'on-collision';
111
+ /**
112
+ * What to do when two unprefixed tools share a name:
88
113
  * `namespace` (default) exposes every colliding tool as `<providerId>__<name>`;
89
114
  * `error` makes `register` throw.
90
115
  */
@@ -96,6 +121,48 @@ export interface ToolRegistryOptions {
96
121
  }
97
122
  /** Separator between namespace and tool name; valid in MCP and LLM tool-name charsets. */
98
123
  export declare const TOOL_NAMESPACE_SEPARATOR = "__";
124
+ /** The toolset a provider belongs to: its namespace, or else its id. */
125
+ export declare function toolsetName(provider: Pick<AgentToolProvider, 'id' | 'namespace'>): string;
126
+ /** The name a tool was registered under, without its namespace (`chart__get_chart` → `get_chart`). */
127
+ export declare function baseToolName(name: string): string;
128
+ /** A group of tools from one or more providers that share a namespace. */
129
+ export interface ToolsetInfo {
130
+ /** Toolset name: the providers' namespace, or the provider id. */
131
+ name: string;
132
+ title?: string;
133
+ description?: string;
134
+ /** Agent skill that documents these tools. */
135
+ skill?: string;
136
+ /** Ids of the providers in this toolset. */
137
+ providers: string[];
138
+ /** Exposed names of its tools, in listing order. */
139
+ tools: string[];
140
+ }
141
+ /**
142
+ * Anything that serves tools the way a {@link ToolRegistry} does: a registry,
143
+ * a {@link ToolRegistryView} of one, or the MCP bridge's registry.
144
+ * `createMcpServer` and `connectToolBridge` accept any of them.
145
+ */
146
+ export interface ToolSource {
147
+ readonly capabilities: {
148
+ tools: {
149
+ listChanged: boolean;
150
+ };
151
+ };
152
+ listTools(): McpListToolsResult;
153
+ hasTool(name: string): boolean;
154
+ getTool(name: string): McpToolDefinition | undefined;
155
+ callTool(name: string, args?: Record<string, unknown>, options?: {
156
+ signal?: AbortSignal;
157
+ }): Promise<McpToolResult>;
158
+ onListChanged(listener: (tools: McpToolDefinition[]) => void): () => void;
159
+ /** The toolsets behind `listTools()`, in listing order. */
160
+ toolsets(): ToolsetInfo[];
161
+ }
162
+ /** `unknown_tool` message, naming the tools a bare name could mean. */
163
+ export declare function unknownToolMessage(name: string, candidates?: readonly string[]): string;
164
+ /** An `isError` tool result carrying a {@link ToolCallError}. */
165
+ export declare function errorResult(error: ToolCallError): McpToolResult;
99
166
  /** Normalizes a handler's return value into an MCP `tools/call` result. */
100
167
  export declare function toToolResult(value: unknown): McpToolResult;
101
168
  /**
@@ -106,7 +173,7 @@ export declare function toToolResult(value: unknown): McpToolResult;
106
173
  * tool list changes, mirroring MCP's `notifications/tools/list_changed`, so an
107
174
  * MCP server can be a thin wrapper around it.
108
175
  */
109
- export declare class ToolRegistry {
176
+ export declare class ToolRegistry implements ToolSource {
110
177
  /** MCP server capabilities this registry supports. */
111
178
  readonly capabilities: {
112
179
  readonly tools: {
@@ -136,10 +203,18 @@ export declare class ToolRegistry {
136
203
  private resolve;
137
204
  /** MCP `tools/list` result for the current providers. */
138
205
  listTools(): McpListToolsResult;
139
- /** Whether a tool with this exposed name exists. */
206
+ /** Whether a tool with this exposed name (or unique bare name) exists. */
140
207
  hasTool(name: string): boolean;
141
- /** Looks up a tool definition by exposed name. */
208
+ /** Looks up a tool definition by exposed name (or unique bare name). */
142
209
  getTool(name: string): McpToolDefinition | undefined;
210
+ /** The registered providers grouped by namespace, in listing order. */
211
+ toolsets(): ToolsetInfo[];
212
+ /**
213
+ * A filtered, optionally self-discovering view of this registry: serve it
214
+ * with `createMcpServer` or `connectToolBridge` instead of the registry to
215
+ * show an agent only some toolsets. See {@link ToolRegistryView}.
216
+ */
217
+ view(options?: ToolViewOptions): ToolRegistryView;
143
218
  /**
144
219
  * Calls a tool by exposed name and returns an MCP `tools/call` result.
145
220
  * Never rejects: unknown tools, invalid arguments and handler errors come
@@ -1,4 +1,5 @@
1
1
  import { type JsonSchema, type SchemaValidationError } from './schema.js';
2
+ import { ToolRegistryView, type ToolViewOptions } from './view.js';
2
3
  /**
3
4
  * MCP-shaped tool definition, as returned by `tools/list`.
4
5
  */
@@ -59,12 +60,25 @@ export interface AgentTool extends McpToolDefinition {
59
60
  }
60
61
  /**
61
62
  * A source of tools, typically one per mounted editor, spreadsheet or canvas.
63
+ * Each provider is a toolset: its tools are exposed as `<namespace>__<name>`
64
+ * (see {@link ToolRegistryOptions.namespaces}) and grouped under that name by
65
+ * `toolsets()`, `registry.view()` and the discovery tools.
62
66
  */
63
67
  export interface AgentToolProvider {
64
- /** Unique id within a registry, e.g. `doc-1`. Used as the namespace on collisions. */
68
+ /** Unique id within a registry, e.g. `doc-1`. The default namespace. */
65
69
  id: string;
66
- /** Always prefix this provider's tools with `<namespace>__`. */
70
+ /**
71
+ * Prefix for this provider's tools (`<namespace>__<name>`). Defaults to the
72
+ * `id`. Pass `''` to expose bare names (prefixed by `id` only on a collision).
73
+ * Providers may share a namespace when their tool names differ.
74
+ */
67
75
  namespace?: string;
76
+ /** Short name of the toolset for agents and UIs, e.g. "Chart editor". */
77
+ title?: string;
78
+ /** What the toolset covers and when to use it, in a sentence or two. */
79
+ description?: string;
80
+ /** Name of the agent skill that documents these tools, e.g. `pixerate-chart`. */
81
+ skill?: string;
68
82
  /** Tools, or a function returning the current tools (re-read on every `listTools`). */
69
83
  tools: readonly AgentTool[] | (() => readonly AgentTool[]);
70
84
  /** Lets the provider signal that its tool list changed; returns an unsubscribe function. */
@@ -84,7 +98,18 @@ export declare class ToolRegistryError extends Error {
84
98
  }
85
99
  export interface ToolRegistryOptions {
86
100
  /**
87
- * What to do when two providers contribute the same tool name:
101
+ * `always` (default): every tool is exposed as `<namespace>__<name>`, where the
102
+ * namespace is the provider's `namespace` or else its `id`, so names don't
103
+ * change when another editor mounts. `on-collision`: only providers with an
104
+ * explicit `namespace` are prefixed; other tools keep their bare name unless
105
+ * two providers share it (see `onCollision`).
106
+ *
107
+ * Either way, `callTool`, `hasTool` and `getTool` also accept a bare name
108
+ * when exactly one exposed tool has it.
109
+ */
110
+ namespaces?: 'always' | 'on-collision';
111
+ /**
112
+ * What to do when two unprefixed tools share a name:
88
113
  * `namespace` (default) exposes every colliding tool as `<providerId>__<name>`;
89
114
  * `error` makes `register` throw.
90
115
  */
@@ -96,6 +121,48 @@ export interface ToolRegistryOptions {
96
121
  }
97
122
  /** Separator between namespace and tool name; valid in MCP and LLM tool-name charsets. */
98
123
  export declare const TOOL_NAMESPACE_SEPARATOR = "__";
124
+ /** The toolset a provider belongs to: its namespace, or else its id. */
125
+ export declare function toolsetName(provider: Pick<AgentToolProvider, 'id' | 'namespace'>): string;
126
+ /** The name a tool was registered under, without its namespace (`chart__get_chart` → `get_chart`). */
127
+ export declare function baseToolName(name: string): string;
128
+ /** A group of tools from one or more providers that share a namespace. */
129
+ export interface ToolsetInfo {
130
+ /** Toolset name: the providers' namespace, or the provider id. */
131
+ name: string;
132
+ title?: string;
133
+ description?: string;
134
+ /** Agent skill that documents these tools. */
135
+ skill?: string;
136
+ /** Ids of the providers in this toolset. */
137
+ providers: string[];
138
+ /** Exposed names of its tools, in listing order. */
139
+ tools: string[];
140
+ }
141
+ /**
142
+ * Anything that serves tools the way a {@link ToolRegistry} does: a registry,
143
+ * a {@link ToolRegistryView} of one, or the MCP bridge's registry.
144
+ * `createMcpServer` and `connectToolBridge` accept any of them.
145
+ */
146
+ export interface ToolSource {
147
+ readonly capabilities: {
148
+ tools: {
149
+ listChanged: boolean;
150
+ };
151
+ };
152
+ listTools(): McpListToolsResult;
153
+ hasTool(name: string): boolean;
154
+ getTool(name: string): McpToolDefinition | undefined;
155
+ callTool(name: string, args?: Record<string, unknown>, options?: {
156
+ signal?: AbortSignal;
157
+ }): Promise<McpToolResult>;
158
+ onListChanged(listener: (tools: McpToolDefinition[]) => void): () => void;
159
+ /** The toolsets behind `listTools()`, in listing order. */
160
+ toolsets(): ToolsetInfo[];
161
+ }
162
+ /** `unknown_tool` message, naming the tools a bare name could mean. */
163
+ export declare function unknownToolMessage(name: string, candidates?: readonly string[]): string;
164
+ /** An `isError` tool result carrying a {@link ToolCallError}. */
165
+ export declare function errorResult(error: ToolCallError): McpToolResult;
99
166
  /** Normalizes a handler's return value into an MCP `tools/call` result. */
100
167
  export declare function toToolResult(value: unknown): McpToolResult;
101
168
  /**
@@ -106,7 +173,7 @@ export declare function toToolResult(value: unknown): McpToolResult;
106
173
  * tool list changes, mirroring MCP's `notifications/tools/list_changed`, so an
107
174
  * MCP server can be a thin wrapper around it.
108
175
  */
109
- export declare class ToolRegistry {
176
+ export declare class ToolRegistry implements ToolSource {
110
177
  /** MCP server capabilities this registry supports. */
111
178
  readonly capabilities: {
112
179
  readonly tools: {
@@ -136,10 +203,18 @@ export declare class ToolRegistry {
136
203
  private resolve;
137
204
  /** MCP `tools/list` result for the current providers. */
138
205
  listTools(): McpListToolsResult;
139
- /** Whether a tool with this exposed name exists. */
206
+ /** Whether a tool with this exposed name (or unique bare name) exists. */
140
207
  hasTool(name: string): boolean;
141
- /** Looks up a tool definition by exposed name. */
208
+ /** Looks up a tool definition by exposed name (or unique bare name). */
142
209
  getTool(name: string): McpToolDefinition | undefined;
210
+ /** The registered providers grouped by namespace, in listing order. */
211
+ toolsets(): ToolsetInfo[];
212
+ /**
213
+ * A filtered, optionally self-discovering view of this registry: serve it
214
+ * with `createMcpServer` or `connectToolBridge` instead of the registry to
215
+ * show an agent only some toolsets. See {@link ToolRegistryView}.
216
+ */
217
+ view(options?: ToolViewOptions): ToolRegistryView;
143
218
  /**
144
219
  * Calls a tool by exposed name and returns an MCP `tools/call` result.
145
220
  * Never rejects: unknown tools, invalid arguments and handler errors come
@@ -0,0 +1,30 @@
1
+ import type { McpToolDefinition, ToolsetInfo } from './registry.cjs';
2
+ /** A tool as `search_tools` ranks it. */
3
+ export interface ToolSearchResult {
4
+ /** Exposed tool name, to call or to pass to `enable_tools`. */
5
+ name: string;
6
+ toolset: string;
7
+ title?: string;
8
+ /** The first sentence of the tool's description. */
9
+ summary: string;
10
+ readOnly: boolean;
11
+ score: number;
12
+ }
13
+ export interface ToolSearchOptions {
14
+ /** Only search this toolset. */
15
+ toolset?: string;
16
+ /** Maximum results (default 10). */
17
+ limit?: number;
18
+ }
19
+ /** Lower-cased, stemmed word tokens of `text`, splitting snake_case and camelCase. */
20
+ export declare function searchTokens(text: string): string[];
21
+ /** The first sentence of a description, for compact listings. */
22
+ export declare function summarize(description: string | undefined, max?: number): string;
23
+ /**
24
+ * Ranks tools against a free-text query: every query word scores by the
25
+ * fields it appears in (name, title, toolset, description, arguments), weighted by how
26
+ * rare the word is across all tools, so "trendline" outranks "chart". A word
27
+ * that prefixes a longer one ("trend" → "trendline") counts at half weight.
28
+ * Pure and dependency-free; `search_tools` uses it.
29
+ */
30
+ export declare function searchTools(tools: readonly McpToolDefinition[], toolsets: readonly ToolsetInfo[], query: string, options?: ToolSearchOptions): ToolSearchResult[];
@@ -0,0 +1,30 @@
1
+ import type { McpToolDefinition, ToolsetInfo } from './registry.js';
2
+ /** A tool as `search_tools` ranks it. */
3
+ export interface ToolSearchResult {
4
+ /** Exposed tool name, to call or to pass to `enable_tools`. */
5
+ name: string;
6
+ toolset: string;
7
+ title?: string;
8
+ /** The first sentence of the tool's description. */
9
+ summary: string;
10
+ readOnly: boolean;
11
+ score: number;
12
+ }
13
+ export interface ToolSearchOptions {
14
+ /** Only search this toolset. */
15
+ toolset?: string;
16
+ /** Maximum results (default 10). */
17
+ limit?: number;
18
+ }
19
+ /** Lower-cased, stemmed word tokens of `text`, splitting snake_case and camelCase. */
20
+ export declare function searchTokens(text: string): string[];
21
+ /** The first sentence of a description, for compact listings. */
22
+ export declare function summarize(description: string | undefined, max?: number): string;
23
+ /**
24
+ * Ranks tools against a free-text query: every query word scores by the
25
+ * fields it appears in (name, title, toolset, description, arguments), weighted by how
26
+ * rare the word is across all tools, so "trendline" outranks "chart". A word
27
+ * that prefixes a longer one ("trend" → "trendline") counts at half weight.
28
+ * Pure and dependency-free; `search_tools` uses it.
29
+ */
30
+ export declare function searchTools(tools: readonly McpToolDefinition[], toolsets: readonly ToolsetInfo[], query: string, options?: ToolSearchOptions): ToolSearchResult[];
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Agent skill files (`skills/<name>/SKILL.md` plus its `references/*.md`), keyed by
3
+ * path relative to the skills directory: `pixerate-chart/SKILL.md`,
4
+ * `pixerate-vector/references/commands.md`. In Node, `loadSkillFiles()` from
5
+ * `@pixerate/editor/bridge` reads the ones shipped with the package; in a browser,
6
+ * import them as text (with Vite, `import.meta.glob('…/skills/**\/*.md', { query: '?raw', import: 'default', eager: true })`).
7
+ */
8
+ export type SkillFiles = Readonly<Record<string, string>>;
9
+ export interface SkillInfo {
10
+ /** Skill name (its directory), e.g. `pixerate-chart`. */
11
+ name: string;
12
+ /** The frontmatter `description`: what the skill covers and when to use it. */
13
+ description: string;
14
+ /** Other files of the skill relative to its directory, e.g. `references/commands.md`. */
15
+ references: string[];
16
+ }
17
+ /** Reads `name` and `description` from a SKILL.md's YAML frontmatter. */
18
+ export declare function parseSkillFrontmatter(markdown: string): {
19
+ name?: string;
20
+ description?: string;
21
+ body: string;
22
+ };
23
+ /** The skills in a set of skill files, sorted by name. */
24
+ export declare function listSkills(files: SkillFiles): SkillInfo[];
25
+ /** One file of a skill (`SKILL.md` by default), or `undefined` if there is none. */
26
+ export declare function readSkillFile(files: SkillFiles, skill: string, file?: string): string | undefined;