project-graph-mcp 2.3.2 → 2.4.1

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 (279) hide show
  1. package/package.json +3 -2
  2. package/src/analysis/analysis-cache.ctx +9 -0
  3. package/src/analysis/analysis-cache.js +1 -1
  4. package/src/analysis/complexity.ctx +6 -0
  5. package/src/analysis/complexity.js +1 -1
  6. package/src/analysis/custom-rules.ctx +14 -0
  7. package/src/analysis/custom-rules.js +1 -1
  8. package/src/analysis/db-analysis.ctx +7 -0
  9. package/src/analysis/db-analysis.js +1 -1
  10. package/src/analysis/dead-code.ctx +6 -0
  11. package/src/analysis/dead-code.js +1 -1
  12. package/src/analysis/full-analysis.ctx +9 -0
  13. package/src/analysis/full-analysis.js +1 -1
  14. package/src/analysis/jsdoc-checker.ctx +10 -0
  15. package/src/analysis/jsdoc-checker.js +1 -1
  16. package/src/analysis/jsdoc-generator.ctx +9 -0
  17. package/src/analysis/jsdoc-generator.js +1 -1
  18. package/src/analysis/large-files.ctx +6 -0
  19. package/src/analysis/large-files.js +1 -1
  20. package/src/analysis/outdated-patterns.ctx +7 -0
  21. package/src/analysis/outdated-patterns.js +1 -1
  22. package/src/analysis/similar-functions.ctx +6 -0
  23. package/src/analysis/similar-functions.js +1 -1
  24. package/src/analysis/test-annotations.ctx +11 -0
  25. package/src/analysis/test-annotations.js +1 -1
  26. package/src/analysis/type-checker.ctx +6 -0
  27. package/src/analysis/type-checker.js +1 -1
  28. package/src/analysis/undocumented.ctx +8 -0
  29. package/src/analysis/undocumented.js +1 -1
  30. package/src/cli/cli-handlers.ctx +7 -0
  31. package/src/cli/cli-handlers.js +1 -1
  32. package/src/cli/cli.ctx +6 -0
  33. package/src/cli/cli.js +1 -1
  34. package/src/compact/ai-context.ctx +6 -0
  35. package/src/compact/ai-context.js +1 -1
  36. package/src/compact/compact-migrate.ctx +8 -0
  37. package/src/compact/compact-migrate.js +1 -1
  38. package/src/compact/compact.ctx +11 -0
  39. package/src/compact/compact.js +1 -1
  40. package/src/compact/compress.ctx +7 -0
  41. package/src/compact/compress.js +1 -1
  42. package/src/compact/ctx-resolver.ctx +2 -0
  43. package/src/compact/ctx-resolver.js +1 -1
  44. package/src/compact/ctx-to-jsdoc.ctx +11 -0
  45. package/src/compact/ctx-to-jsdoc.js +1 -1
  46. package/src/compact/doc-dialect.ctx +11 -0
  47. package/src/compact/doc-dialect.js +2 -2
  48. package/src/compact/expand.ctx +14 -0
  49. package/src/compact/expand.js +1 -1
  50. package/src/compact/framework-references.ctx +7 -0
  51. package/src/compact/framework-references.js +1 -1
  52. package/src/compact/instructions.ctx +6 -0
  53. package/src/compact/instructions.js +1 -1
  54. package/src/compact/jsdoc-builder.ctx +4 -0
  55. package/src/compact/jsdoc-builder.js +1 -1
  56. package/src/compact/mode-config.ctx +8 -0
  57. package/src/compact/mode-config.js +1 -1
  58. package/src/compact/split-declarations.ctx +6 -0
  59. package/src/compact/split-declarations.js +1 -1
  60. package/src/compact/validate-pipeline.ctx +12 -0
  61. package/src/compact/validate-pipeline.js +1 -1
  62. package/src/core/event-bus.ctx +9 -0
  63. package/src/core/event-bus.js +1 -1
  64. package/src/core/file-walker.ctx +1 -0
  65. package/src/core/file-walker.js +1 -1
  66. package/src/core/filters.ctx +12 -0
  67. package/src/core/filters.js +1 -1
  68. package/src/core/graph-builder.ctx +7 -0
  69. package/src/core/graph-builder.js +1 -1
  70. package/src/core/parser.ctx +12 -0
  71. package/src/core/parser.js +1 -1
  72. package/src/core/utils.ctx +1 -0
  73. package/src/core/utils.js +1 -1
  74. package/src/core/workspace.ctx +7 -0
  75. package/src/core/workspace.js +1 -1
  76. package/src/lang/lang-go.ctx +8 -0
  77. package/src/lang/lang-go.js +1 -1
  78. package/src/lang/lang-python.ctx +5 -0
  79. package/src/lang/lang-python.js +1 -1
  80. package/src/lang/lang-sql.ctx +10 -0
  81. package/src/lang/lang-sql.js +1 -1
  82. package/src/lang/lang-typescript.ctx +6 -0
  83. package/src/lang/lang-typescript.js +1 -1
  84. package/src/lang/lang-utils.ctx +5 -0
  85. package/src/lang/lang-utils.js +1 -1
  86. package/src/mcp/mcp-server.ctx +6 -0
  87. package/src/mcp/mcp-server.js +1 -1
  88. package/src/mcp/tool-defs.ctx +2 -0
  89. package/src/mcp/tool-defs.js +1 -1
  90. package/src/mcp/tools.ctx +13 -0
  91. package/src/mcp/tools.js +1 -1
  92. package/src/network/backend-lifecycle.ctx +10 -0
  93. package/src/network/backend-lifecycle.js +1 -1
  94. package/src/network/backend.ctx +5 -0
  95. package/src/network/backend.js +1 -1
  96. package/src/network/local-gateway.ctx +9 -0
  97. package/src/network/local-gateway.js +1 -1
  98. package/src/network/mdns.ctx +6 -0
  99. package/src/network/mdns.js +1 -1
  100. package/src/network/server.ctx +2 -0
  101. package/src/network/server.js +2 -2
  102. package/src/network/web-server.ctx +17 -0
  103. package/src/network/web-server.js +2 -2
  104. package/web/follow-controller.js +94 -25
  105. package/web/panels/dep-graph.js +207 -21
  106. package/project-graph-mcp-2.3.0.tgz +0 -0
  107. package/vendor/symbiote-node/CHANGELOG.md +0 -31
  108. package/vendor/symbiote-node/LICENSE +0 -21
  109. package/vendor/symbiote-node/README.md +0 -206
  110. package/vendor/symbiote-node/canvas/AutoLayout.js +0 -725
  111. package/vendor/symbiote-node/canvas/Breadcrumb/Breadcrumb.css.js +0 -73
  112. package/vendor/symbiote-node/canvas/Breadcrumb/Breadcrumb.js +0 -93
  113. package/vendor/symbiote-node/canvas/Breadcrumb/Breadcrumb.tpl.js +0 -9
  114. package/vendor/symbiote-node/canvas/CanvasConnectionRenderer.js +0 -962
  115. package/vendor/symbiote-node/canvas/ConnectionRenderer.js +0 -1468
  116. package/vendor/symbiote-node/canvas/FlowSimulator.js +0 -323
  117. package/vendor/symbiote-node/canvas/ForceLayout.js +0 -189
  118. package/vendor/symbiote-node/canvas/ForceWorker.js +0 -1325
  119. package/vendor/symbiote-node/canvas/GraphTabs/GraphTabs.css.js +0 -97
  120. package/vendor/symbiote-node/canvas/GraphTabs/GraphTabs.js +0 -176
  121. package/vendor/symbiote-node/canvas/GraphTabs/GraphTabs.tpl.js +0 -12
  122. package/vendor/symbiote-node/canvas/LODManager.js +0 -88
  123. package/vendor/symbiote-node/canvas/Minimap/Minimap.css.js +0 -71
  124. package/vendor/symbiote-node/canvas/Minimap/Minimap.js +0 -207
  125. package/vendor/symbiote-node/canvas/Minimap/Minimap.tpl.js +0 -9
  126. package/vendor/symbiote-node/canvas/NodeCanvas/NodeCanvas.css.js +0 -261
  127. package/vendor/symbiote-node/canvas/NodeCanvas/NodeCanvas.js +0 -1840
  128. package/vendor/symbiote-node/canvas/NodeCanvas/NodeCanvas.tpl.js +0 -22
  129. package/vendor/symbiote-node/canvas/NodeSearch/NodeSearch.css.js +0 -97
  130. package/vendor/symbiote-node/canvas/NodeSearch/NodeSearch.js +0 -132
  131. package/vendor/symbiote-node/canvas/NodeSearch/NodeSearch.tpl.js +0 -21
  132. package/vendor/symbiote-node/canvas/NodeViewManager.js +0 -584
  133. package/vendor/symbiote-node/canvas/PinExpansion.js +0 -131
  134. package/vendor/symbiote-node/canvas/PseudoConnection.js +0 -80
  135. package/vendor/symbiote-node/canvas/SubgraphManager.js +0 -201
  136. package/vendor/symbiote-node/canvas/SubgraphRouter.js +0 -443
  137. package/vendor/symbiote-node/canvas/ViewportActions.js +0 -446
  138. package/vendor/symbiote-node/core/Connection.js +0 -45
  139. package/vendor/symbiote-node/core/Editor.js +0 -451
  140. package/vendor/symbiote-node/core/Frame.js +0 -31
  141. package/vendor/symbiote-node/core/GraphMermaid.js +0 -348
  142. package/vendor/symbiote-node/core/GraphText.js +0 -210
  143. package/vendor/symbiote-node/core/Node.js +0 -143
  144. package/vendor/symbiote-node/core/Portal.js +0 -104
  145. package/vendor/symbiote-node/core/Socket.js +0 -185
  146. package/vendor/symbiote-node/core/SubgraphNode.js +0 -125
  147. package/vendor/symbiote-node/engine/AgentUICommands.js +0 -100
  148. package/vendor/symbiote-node/engine/Executor.js +0 -371
  149. package/vendor/symbiote-node/engine/Graph.js +0 -314
  150. package/vendor/symbiote-node/engine/GraphServer.js +0 -353
  151. package/vendor/symbiote-node/engine/HandlerLoader.js +0 -145
  152. package/vendor/symbiote-node/engine/History.js +0 -83
  153. package/vendor/symbiote-node/engine/Lifecycle.js +0 -118
  154. package/vendor/symbiote-node/engine/Persistence.js +0 -84
  155. package/vendor/symbiote-node/engine/Registry.js +0 -264
  156. package/vendor/symbiote-node/engine/SocketTypes.js +0 -79
  157. package/vendor/symbiote-node/engine/cli.js +0 -404
  158. package/vendor/symbiote-node/engine/index.js +0 -56
  159. package/vendor/symbiote-node/engine/nanoid.js +0 -28
  160. package/vendor/symbiote-node/engine/package.json +0 -26
  161. package/vendor/symbiote-node/engine/packs/ai/beat-detect.handler.js +0 -215
  162. package/vendor/symbiote-node/engine/packs/ai/content-adapt.handler.js +0 -238
  163. package/vendor/symbiote-node/engine/packs/ai/face-detect.handler.js +0 -287
  164. package/vendor/symbiote-node/engine/packs/ai/grok-generate.handler.js +0 -565
  165. package/vendor/symbiote-node/engine/packs/ai/kling-lipsync.handler.js +0 -414
  166. package/vendor/symbiote-node/engine/packs/ai/lesson-generate.handler.js +0 -343
  167. package/vendor/symbiote-node/engine/packs/ai/opencode.handler.js +0 -164
  168. package/vendor/symbiote-node/engine/packs/ai/replicate-lipsync.handler.js +0 -341
  169. package/vendor/symbiote-node/engine/packs/ai/tts.handler.js +0 -241
  170. package/vendor/symbiote-node/engine/packs/ai/whisper.handler.js +0 -191
  171. package/vendor/symbiote-node/engine/packs/data/db-query.handler.js +0 -67
  172. package/vendor/symbiote-node/engine/packs/data/news-accumulate.handler.js +0 -281
  173. package/vendor/symbiote-node/engine/packs/data/personas.handler.js +0 -160
  174. package/vendor/symbiote-node/engine/packs/data/prompt-loader.handler.js +0 -193
  175. package/vendor/symbiote-node/engine/packs/data/roles.handler.js +0 -216
  176. package/vendor/symbiote-node/engine/packs/data/rss-feed.handler.js +0 -244
  177. package/vendor/symbiote-node/engine/packs/debug/inject.handler.js +0 -52
  178. package/vendor/symbiote-node/engine/packs/flow/agent.handler.js +0 -73
  179. package/vendor/symbiote-node/engine/packs/flow/if.handler.js +0 -107
  180. package/vendor/symbiote-node/engine/packs/flow/loop.handler.js +0 -58
  181. package/vendor/symbiote-node/engine/packs/flow/merge.handler.js +0 -60
  182. package/vendor/symbiote-node/engine/packs/flow/retry.handler.js +0 -65
  183. package/vendor/symbiote-node/engine/packs/flow/switch.handler.js +0 -64
  184. package/vendor/symbiote-node/engine/packs/flow/wait-all.handler.js +0 -39
  185. package/vendor/symbiote-node/engine/packs/io/http-request.handler.js +0 -82
  186. package/vendor/symbiote-node/engine/packs/io/read-file.handler.js +0 -60
  187. package/vendor/symbiote-node/engine/packs/io/write-file.handler.js +0 -63
  188. package/vendor/symbiote-node/engine/packs/transform/anchor-match.handler.js +0 -494
  189. package/vendor/symbiote-node/engine/packs/transform/effects-skeleton.handler.js +0 -417
  190. package/vendor/symbiote-node/engine/packs/transform/json-parse.handler.js +0 -43
  191. package/vendor/symbiote-node/engine/packs/transform/lipsync-select.handler.js +0 -339
  192. package/vendor/symbiote-node/engine/packs/transform/riopla-adapt.handler.js +0 -432
  193. package/vendor/symbiote-node/engine/packs/transform/set.handler.js +0 -57
  194. package/vendor/symbiote-node/engine/packs/transform/template-builder.handler.js +0 -134
  195. package/vendor/symbiote-node/engine/packs/transform/template.handler.js +0 -79
  196. package/vendor/symbiote-node/engine/packs/transform/timeline-build.handler.js +0 -399
  197. package/vendor/symbiote-node/engine/packs/util/delay.handler.js +0 -39
  198. package/vendor/symbiote-node/engine/packs/util/log.handler.js +0 -44
  199. package/vendor/symbiote-node/engine/packs/video-pack.js +0 -323
  200. package/vendor/symbiote-node/index.js +0 -103
  201. package/vendor/symbiote-node/inspector/InspectorPanel/InspectorPanel.css.js +0 -361
  202. package/vendor/symbiote-node/inspector/InspectorPanel/InspectorPanel.js +0 -332
  203. package/vendor/symbiote-node/inspector/InspectorPanel/InspectorPanel.tpl.js +0 -96
  204. package/vendor/symbiote-node/inspector/TemplatePreview/TemplatePreview.css.js +0 -104
  205. package/vendor/symbiote-node/inspector/TemplatePreview/TemplatePreview.js +0 -133
  206. package/vendor/symbiote-node/inspector/TemplatePreview/TemplatePreview.tpl.js +0 -33
  207. package/vendor/symbiote-node/interactions/ConnectFlow.js +0 -307
  208. package/vendor/symbiote-node/interactions/Drag.js +0 -102
  209. package/vendor/symbiote-node/interactions/Selector.js +0 -132
  210. package/vendor/symbiote-node/interactions/SnapGrid.js +0 -65
  211. package/vendor/symbiote-node/interactions/Zoom.js +0 -140
  212. package/vendor/symbiote-node/layout/ActionZone/ActionZone.css.js +0 -88
  213. package/vendor/symbiote-node/layout/ActionZone/ActionZone.js +0 -254
  214. package/vendor/symbiote-node/layout/ActionZone/ActionZone.tpl.js +0 -11
  215. package/vendor/symbiote-node/layout/Layout/Layout.css.js +0 -88
  216. package/vendor/symbiote-node/layout/Layout/Layout.js +0 -622
  217. package/vendor/symbiote-node/layout/Layout/Layout.tpl.js +0 -25
  218. package/vendor/symbiote-node/layout/LayoutNode/LayoutNode.css.js +0 -293
  219. package/vendor/symbiote-node/layout/LayoutNode/LayoutNode.js +0 -467
  220. package/vendor/symbiote-node/layout/LayoutNode/LayoutNode.tpl.js +0 -33
  221. package/vendor/symbiote-node/layout/LayoutPreview/LayoutPreview.css.js +0 -46
  222. package/vendor/symbiote-node/layout/LayoutPreview/LayoutPreview.js +0 -102
  223. package/vendor/symbiote-node/layout/LayoutPreview/LayoutPreview.tpl.js +0 -6
  224. package/vendor/symbiote-node/layout/LayoutRouter/LayoutRouter.js +0 -156
  225. package/vendor/symbiote-node/layout/LayoutRouter/routerSync.js +0 -250
  226. package/vendor/symbiote-node/layout/LayoutSidebar/LayoutSidebar.css.js +0 -379
  227. package/vendor/symbiote-node/layout/LayoutSidebar/LayoutSidebar.js +0 -263
  228. package/vendor/symbiote-node/layout/LayoutSidebar/LayoutSidebar.tpl.js +0 -20
  229. package/vendor/symbiote-node/layout/LayoutSidebar/SidebarSection.js +0 -183
  230. package/vendor/symbiote-node/layout/LayoutTree.js +0 -246
  231. package/vendor/symbiote-node/layout/PanelMenu/PanelMenu.css.js +0 -43
  232. package/vendor/symbiote-node/layout/PanelMenu/PanelMenu.js +0 -89
  233. package/vendor/symbiote-node/layout/PanelMenu/PanelMenu.tpl.js +0 -14
  234. package/vendor/symbiote-node/layout/index.js +0 -16
  235. package/vendor/symbiote-node/menu/ContextMenu/ContextMenu.css.js +0 -61
  236. package/vendor/symbiote-node/menu/ContextMenu/ContextMenu.js +0 -79
  237. package/vendor/symbiote-node/menu/ContextMenu/ContextMenu.tpl.js +0 -19
  238. package/vendor/symbiote-node/node/CtrlItem/CtrlItem.css.js +0 -41
  239. package/vendor/symbiote-node/node/CtrlItem/CtrlItem.js +0 -24
  240. package/vendor/symbiote-node/node/CtrlItem/CtrlItem.tpl.js +0 -16
  241. package/vendor/symbiote-node/node/GraphFrame/GraphFrame.css.js +0 -65
  242. package/vendor/symbiote-node/node/GraphFrame/GraphFrame.js +0 -29
  243. package/vendor/symbiote-node/node/GraphFrame/GraphFrame.tpl.js +0 -13
  244. package/vendor/symbiote-node/node/GraphNode/GraphNode.css.js +0 -683
  245. package/vendor/symbiote-node/node/GraphNode/GraphNode.js +0 -92
  246. package/vendor/symbiote-node/node/GraphNode/GraphNode.tpl.js +0 -17
  247. package/vendor/symbiote-node/node/NodeSocket/NodeSocket.js +0 -25
  248. package/vendor/symbiote-node/node/NodeSocket/NodeSocket.tpl.js +0 -7
  249. package/vendor/symbiote-node/node/PortItem/PortItem.css.js +0 -90
  250. package/vendor/symbiote-node/node/PortItem/PortItem.js +0 -87
  251. package/vendor/symbiote-node/node/PortItem/PortItem.tpl.js +0 -10
  252. package/vendor/symbiote-node/package.json +0 -59
  253. package/vendor/symbiote-node/palette/PaletteBrowser/PaletteBrowser.css.js +0 -143
  254. package/vendor/symbiote-node/palette/PaletteBrowser/PaletteBrowser.js +0 -131
  255. package/vendor/symbiote-node/palette/PaletteBrowser/PaletteBrowser.tpl.js +0 -16
  256. package/vendor/symbiote-node/plugins/History.js +0 -384
  257. package/vendor/symbiote-node/plugins/Readonly.js +0 -59
  258. package/vendor/symbiote-node/shapes/CircleShape.js +0 -80
  259. package/vendor/symbiote-node/shapes/CommentShape.js +0 -35
  260. package/vendor/symbiote-node/shapes/DiamondShape.js +0 -115
  261. package/vendor/symbiote-node/shapes/NodeShape.js +0 -80
  262. package/vendor/symbiote-node/shapes/PillShape.js +0 -91
  263. package/vendor/symbiote-node/shapes/RectShape.js +0 -72
  264. package/vendor/symbiote-node/shapes/SVGShape.js +0 -494
  265. package/vendor/symbiote-node/shapes/index.js +0 -53
  266. package/vendor/symbiote-node/themes/Palette.js +0 -32
  267. package/vendor/symbiote-node/themes/Skin.js +0 -113
  268. package/vendor/symbiote-node/themes/Theme.js +0 -84
  269. package/vendor/symbiote-node/themes/carbon.js +0 -137
  270. package/vendor/symbiote-node/themes/dark.js +0 -137
  271. package/vendor/symbiote-node/themes/ebook.js +0 -138
  272. package/vendor/symbiote-node/themes/grey.js +0 -137
  273. package/vendor/symbiote-node/themes/light.js +0 -137
  274. package/vendor/symbiote-node/themes/neon.js +0 -138
  275. package/vendor/symbiote-node/themes/pcb.js +0 -273
  276. package/vendor/symbiote-node/themes/synthwave.js +0 -137
  277. package/vendor/symbiote-node/toolbar/QuickToolbar/QuickToolbar.css.js +0 -86
  278. package/vendor/symbiote-node/toolbar/QuickToolbar/QuickToolbar.js +0 -128
  279. package/vendor/symbiote-node/toolbar/QuickToolbar/QuickToolbar.tpl.js +0 -29
@@ -1,104 +0,0 @@
1
- /**
2
- * Portal — Named Reroutes for wireless connections
3
- *
4
- * Provides virtual sender/receiver pairs that act as invisible
5
- * connections. PortalManager tracks named channels and resolves
6
- * portal connections during graph evaluation.
7
- *
8
- * Usage:
9
- * const pm = new PortalManager();
10
- * pm.addSender('channelA', node1, 'output');
11
- * pm.addReceiver('channelA', node2, 'input');
12
- * pm.getConnections(); // returns virtual connections
13
- *
14
- * @module symbiote-node/core/Portal
15
- */
16
-
17
- /**
18
- * PortalManager — manages named reroute channels
19
- */
20
- export class PortalManager {
21
- /** @type {Map<string, { senders: Array<{nodeId: string, portKey: string}>, receivers: Array<{nodeId: string, portKey: string}> }>} */
22
- #channels = new Map();
23
-
24
- /**
25
- * Register a sender portal
26
- * @param {string} channel - Named channel
27
- * @param {string} nodeId - Source node ID
28
- * @param {string} portKey - Output port key
29
- */
30
- addSender(channel, nodeId, portKey) {
31
- if (!this.#channels.has(channel)) {
32
- this.#channels.set(channel, { senders: [], receivers: [] });
33
- }
34
- this.#channels.get(channel).senders.push({ nodeId, portKey });
35
- }
36
-
37
- /**
38
- * Register a receiver portal
39
- * @param {string} channel - Named channel
40
- * @param {string} nodeId - Target node ID
41
- * @param {string} portKey - Input port key
42
- */
43
- addReceiver(channel, nodeId, portKey) {
44
- if (!this.#channels.has(channel)) {
45
- this.#channels.set(channel, { senders: [], receivers: [] });
46
- }
47
- this.#channels.get(channel).receivers.push({ nodeId, portKey });
48
- }
49
-
50
- /**
51
- * Remove all portals for a node
52
- * @param {string} nodeId
53
- */
54
- removeNode(nodeId) {
55
- for (const [, ch] of this.#channels) {
56
- ch.senders = ch.senders.filter(s => s.nodeId !== nodeId);
57
- ch.receivers = ch.receivers.filter(r => r.nodeId !== nodeId);
58
- }
59
- }
60
-
61
- /**
62
- * Get all virtual connections from portal channels
63
- * @returns {Array<{ from: string, out: string, to: string, in: string, channel: string }>}
64
- */
65
- getConnections() {
66
- const result = [];
67
- for (const [channel, ch] of this.#channels) {
68
- for (const sender of ch.senders) {
69
- for (const receiver of ch.receivers) {
70
- result.push({
71
- from: sender.nodeId,
72
- out: sender.portKey,
73
- to: receiver.nodeId,
74
- in: receiver.portKey,
75
- channel,
76
- });
77
- }
78
- }
79
- }
80
- return result;
81
- }
82
-
83
- /**
84
- * Get all channel names
85
- * @returns {string[]}
86
- */
87
- getChannels() {
88
- return [...this.#channels.keys()];
89
- }
90
-
91
- /**
92
- * Get channel info
93
- * @param {string} channel
94
- * @returns {{ senders: Array, receivers: Array }|undefined}
95
- */
96
- getChannel(channel) {
97
- return this.#channels.get(channel);
98
- }
99
-
100
- /** Clear all portals */
101
- clear() {
102
- this.#channels.clear();
103
- }
104
- }
@@ -1,185 +0,0 @@
1
- /**
2
- * Socket — typed port connector
3
- *
4
- * Defines the type and visual identity of a connection endpoint.
5
- * Compatible with symbiote-node SocketTypes system.
6
- *
7
- * @module symbiote-node/core/Socket
8
- */
9
-
10
- let _uid = 0;
11
-
12
- /**
13
- * Generate unique ID with prefix
14
- * @param {string} prefix
15
- * @returns {string}
16
- */
17
- export function uid(prefix = 'id') {
18
- return `${prefix}_${(++_uid).toString(36)}_${Date.now().toString(36)}`;
19
- }
20
-
21
- /**
22
- * Socket type — defines connection endpoint type
23
- */
24
- export class Socket {
25
- /**
26
- * @param {string} name - Socket type name (e.g. 'number', 'string', 'any')
27
- * @param {object} [options]
28
- * @param {string} [options.color] - CSS color for visual
29
- */
30
- constructor(name, options = {}) {
31
- /** @type {string} */
32
- this.name = name;
33
-
34
- /** @type {string} */
35
- this.color = options.color || 'var(--clr-3)';
36
- }
37
-
38
- /**
39
- * Check if this socket is compatible with another
40
- * @param {Socket} other
41
- * @returns {boolean}
42
- */
43
- isCompatibleWith(other) {
44
- if (this.name === 'any' || other.name === 'any') return true;
45
- return this.name === other.name;
46
- }
47
- }
48
-
49
- /**
50
- * Port — represents an input or output endpoint on a node
51
- */
52
- export class Port {
53
- /**
54
- * @param {Socket} socket - Socket type
55
- * @param {string} [label] - Display label
56
- * @param {boolean} [multipleConnections=false] - Allow multiple connections
57
- */
58
- constructor(socket, label, multipleConnections = false) {
59
- /** @type {string} */
60
- this.id = uid('port');
61
-
62
- /** @type {Socket} */
63
- this.socket = socket;
64
-
65
- /** @type {string|undefined} */
66
- this.label = label;
67
-
68
- /** @type {boolean} */
69
- this.multipleConnections = multipleConnections;
70
-
71
- /** @type {number} */
72
- this.index = 0;
73
- }
74
- }
75
-
76
- /**
77
- * Input port — accepts incoming connections
78
- */
79
- export class Input extends Port {
80
- /**
81
- * @param {Socket} socket
82
- * @param {string} [label]
83
- * @param {boolean} [multipleConnections=false]
84
- */
85
- constructor(socket, label, multipleConnections = false) {
86
- super(socket, label, multipleConnections);
87
-
88
- /** @type {Control|null} */
89
- this.control = null;
90
-
91
- /** @type {boolean} */
92
- this.showControl = true;
93
- }
94
-
95
- /**
96
- * Add embedded control to this input
97
- * @param {Control} control
98
- */
99
- addControl(control) {
100
- if (this.control) throw new Error('control already added for this input');
101
- this.control = control;
102
- }
103
-
104
- /**
105
- * Remove embedded control
106
- */
107
- removeControl() {
108
- this.control = null;
109
- }
110
- }
111
-
112
- /**
113
- * Output port — provides outgoing connections
114
- */
115
- export class Output extends Port {
116
- /**
117
- * @param {Socket} socket
118
- * @param {string} [label]
119
- * @param {boolean} [multipleConnections=true]
120
- */
121
- constructor(socket, label, multipleConnections = true) {
122
- super(socket, label, multipleConnections);
123
- }
124
- }
125
-
126
- /**
127
- * Control — embeddable UI widget inside a node
128
- */
129
- export class Control {
130
- constructor() {
131
- /** @type {string} */
132
- this.id = uid('ctrl');
133
-
134
- /** @type {number} */
135
- this.index = 0;
136
-
137
- /** @type {function|undefined} */
138
- this._onChange = undefined;
139
- }
140
- }
141
-
142
- /**
143
- * InputControl — text or number input widget
144
- */
145
- export class InputControl extends Control {
146
- /**
147
- * @param {'text'|'number'|'textarea'|'select'|'boolean'} type
148
- * @param {object} [options]
149
- * @param {boolean} [options.readonly=false]
150
- * @param {string|number|boolean} [options.initial]
151
- * @param {string} [options.label] - Display label
152
- * @param {string[]} [options.options] - Options for select type
153
- * @param {function} [options.change] - Callback on value change
154
- */
155
- constructor(type, options = {}) {
156
- super();
157
-
158
- /** @type {'text'|'number'|'textarea'|'select'|'boolean'} */
159
- this.type = type;
160
-
161
- /** @type {boolean} */
162
- this.readonly = options.readonly || false;
163
-
164
- /** @type {string|number|boolean|undefined} */
165
- this.value = options.initial;
166
-
167
- /** @type {string} */
168
- this.label = options.label || '';
169
-
170
- /** @type {string[]} */
171
- this.options = options.options || [];
172
-
173
- /** @type {function|undefined} */
174
- this._onChange = options.change;
175
- }
176
-
177
- /**
178
- * Set control value
179
- * @param {string|number|boolean} value
180
- */
181
- setValue(value) {
182
- this.value = value;
183
- if (this._onChange) this._onChange(value);
184
- }
185
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * SubgraphNode — Node containing an embedded graph
3
- *
4
- * Extends Node with an inner NodeEditor that holds a sub-pipeline.
5
- * Ports are auto-generated from exposed inner nodes.
6
- * Supports drill-down navigation via SubgraphManager.
7
- *
8
- * @module symbiote-node/core/SubgraphNode
9
- */
10
-
11
- import { Node } from './Node.js';
12
- import { NodeEditor } from './Editor.js';
13
- import { Socket, Input, Output } from './Socket.js';
14
-
15
- export class SubgraphNode extends Node {
16
- /** @type {NodeEditor} */
17
- innerEditor;
18
-
19
- /** @type {Object<string, { x: number, y: number }>} */
20
- innerPositions = {};
21
-
22
- /** @type {{ panX: number, panY: number, zoom: number }} */
23
- innerTransform = { panX: 0, panY: 0, zoom: 1 };
24
-
25
- /**
26
- * @param {string} label - Display name
27
- * @param {object} [options={}]
28
- * @param {string} [options.category='subgraph']
29
- * @param {string} [options.icon='account_tree']
30
- */
31
- constructor(label, options = {}) {
32
- super(label, {
33
- type: 'subgraph',
34
- category: options.category ?? 'subgraph',
35
- icon: options.icon ?? 'account_tree',
36
- shape: 'rect',
37
- ...options,
38
- });
39
-
40
- this.innerEditor = new NodeEditor();
41
- this._isSubgraph = true;
42
- }
43
-
44
- /**
45
- * Sync external ports with inner graph exposed nodes.
46
- * Inner nodes with `_exposed: 'input'` become subgraph inputs.
47
- * Inner nodes with `_exposed: 'output'` become subgraph outputs.
48
- */
49
- syncPorts() {
50
- // Clear existing auto-ports (keep manually added ones)
51
- for (const key of Object.keys(this.inputs)) {
52
- if (key.startsWith('sg_')) this.removeInput(key);
53
- }
54
- for (const key of Object.keys(this.outputs)) {
55
- if (key.startsWith('sg_')) this.removeOutput(key);
56
- }
57
-
58
- const anySocket = new Socket('any', { color: '#94a3b8' });
59
-
60
- // Find exposed inner nodes
61
- for (const innerNode of this.innerEditor.getNodes()) {
62
- if (innerNode._exposed === 'input') {
63
- for (const [key, output] of Object.entries(innerNode.outputs)) {
64
- const portKey = `sg_${innerNode.id}_${key}`;
65
- this.addInput(portKey, new Input(
66
- output.socket ?? anySocket,
67
- innerNode.label ?? key
68
- ));
69
- }
70
- }
71
- if (innerNode._exposed === 'output') {
72
- for (const [key, input] of Object.entries(innerNode.inputs)) {
73
- const portKey = `sg_${innerNode.id}_${key}`;
74
- this.addOutput(portKey, new Output(
75
- input.socket ?? anySocket,
76
- innerNode.label ?? key
77
- ));
78
- }
79
- }
80
- }
81
- }
82
-
83
- /**
84
- * Get inner editor
85
- * @returns {NodeEditor}
86
- */
87
- getInnerEditor() {
88
- return this.innerEditor;
89
- }
90
-
91
- /**
92
- * Save inner node positions
93
- * @param {Object<string, { x: number, y: number }>} positions
94
- */
95
- setInnerPositions(positions) {
96
- this.innerPositions = { ...positions };
97
- }
98
-
99
- /**
100
- * Save inner viewport transform
101
- * @param {{ panX: number, panY: number, zoom: number }} transform
102
- */
103
- setInnerTransform(transform) {
104
- this.innerTransform = { ...transform };
105
- }
106
-
107
- /**
108
- * Serialize subgraph node including inner graph
109
- * @returns {object}
110
- */
111
- toJSON() {
112
- return {
113
- id: this.id,
114
- type: 'subgraph',
115
- label: this.label,
116
- category: this.category,
117
- innerGraph: this.innerEditor.toJSON(
118
- Object.fromEntries(
119
- Object.entries(this.innerPositions).map(([id, pos]) => [id, [pos.x, pos.y]])
120
- )
121
- ),
122
- innerTransform: this.innerTransform,
123
- };
124
- }
125
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * AgentUICommands.js - Agent UI control command builders
3
- *
4
- * Pure data builders for WebSocket messages that control the UI.
5
- * No WebSocket dependency — produces message objects for P23 bridge to send.
6
- *
7
- * @module agi-graph/AgentUICommands
8
- */
9
-
10
- /**
11
- * @typedef {object} UICommand
12
- * @property {string} type - Command type (ui:layout, ui:focus, etc.)
13
- * @property {object} payload - Command payload
14
- */
15
-
16
- /**
17
- * Switch UI layout — control which panels are visible
18
- * @param {string[]} panels - Panel names to show
19
- * @param {string} [split='horizontal'] - Split direction
20
- * @returns {UICommand}
21
- */
22
- export function layout(panels, split = 'horizontal') {
23
- return { type: 'ui:layout', payload: { panels, split } };
24
- }
25
-
26
- /**
27
- * Focus on a specific panel or node
28
- * @param {string} panel - Panel name to focus
29
- * @param {string} [nodeId] - Optional node to zoom to
30
- * @returns {UICommand}
31
- */
32
- export function focus(panel, nodeId) {
33
- return { type: 'ui:focus', payload: { panel, nodeId } };
34
- }
35
-
36
- /**
37
- * Select nodes on canvas
38
- * @param {string[]} nodeIds - Node IDs to select
39
- * @returns {UICommand}
40
- */
41
- export function select(nodeIds) {
42
- return { type: 'ui:select', payload: { nodeIds } };
43
- }
44
-
45
- /**
46
- * Navigate into a compound node
47
- * @param {string} compoundId - Compound node ID to enter
48
- * @returns {UICommand}
49
- */
50
- export function navigate(compoundId) {
51
- return { type: 'ui:navigate', payload: { compoundId } };
52
- }
53
-
54
- /**
55
- * Control timeline playback
56
- * @param {'play'|'stop'|'seek'} action - Playback action
57
- * @param {number} [frame] - Frame to seek to (for 'seek' action)
58
- * @returns {UICommand}
59
- */
60
- export function playback(action, frame) {
61
- const payload = { action };
62
- if (frame !== undefined) payload.frame = frame;
63
- return { type: 'ui:playback', payload };
64
- }
65
-
66
- /**
67
- * Show notification to user
68
- * @param {string} message - Notification text
69
- * @param {'info'|'success'|'warning'|'error'} [type='info'] - Notification type
70
- * @returns {UICommand}
71
- */
72
- export function notify(message, type = 'info') {
73
- return { type: 'ui:notify', payload: { message, type } };
74
- }
75
-
76
- /**
77
- * Move virtual agent cursor on canvas
78
- * @param {number} x - X position
79
- * @param {number} y - Y position
80
- * @param {string} [label] - Cursor label text
81
- * @returns {UICommand}
82
- */
83
- export function cursor(x, y, label) {
84
- const payload = { x, y };
85
- if (label) payload.label = label;
86
- return { type: 'ui:cursor', payload };
87
- }
88
-
89
- /**
90
- * All command types for reference
91
- */
92
- export const COMMAND_TYPES = [
93
- 'ui:layout',
94
- 'ui:focus',
95
- 'ui:select',
96
- 'ui:navigate',
97
- 'ui:playback',
98
- 'ui:notify',
99
- 'ui:cursor',
100
- ];