@principal-ai/subsystems-react 0.17.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 (496) hide show
  1. package/README.md +93 -0
  2. package/dist/components/ConfigurationSelector.d.ts +35 -0
  3. package/dist/components/ConfigurationSelector.d.ts.map +1 -0
  4. package/dist/components/ConfigurationSelector.js +63 -0
  5. package/dist/components/ConfigurationSelector.js.map +1 -0
  6. package/dist/components/GraphRenderer.d.ts +295 -0
  7. package/dist/components/GraphRenderer.d.ts.map +1 -0
  8. package/dist/components/GraphRenderer.js +2008 -0
  9. package/dist/components/GraphRenderer.js.map +1 -0
  10. package/dist/components/MultiCanvasRenderer.d.ts +75 -0
  11. package/dist/components/MultiCanvasRenderer.d.ts.map +1 -0
  12. package/dist/components/MultiCanvasRenderer.js +203 -0
  13. package/dist/components/MultiCanvasRenderer.js.map +1 -0
  14. package/dist/components/NodeTooltip.d.ts +24 -0
  15. package/dist/components/NodeTooltip.d.ts.map +1 -0
  16. package/dist/components/NodeTooltip.js +160 -0
  17. package/dist/components/NodeTooltip.js.map +1 -0
  18. package/dist/components/SelectionSidebar.d.ts +18 -0
  19. package/dist/components/SelectionSidebar.d.ts.map +1 -0
  20. package/dist/components/SelectionSidebar.js +190 -0
  21. package/dist/components/SelectionSidebar.js.map +1 -0
  22. package/dist/components/SequenceDiagramRenderer.d.ts +77 -0
  23. package/dist/components/SequenceDiagramRenderer.d.ts.map +1 -0
  24. package/dist/components/SequenceDiagramRenderer.js +604 -0
  25. package/dist/components/SequenceDiagramRenderer.js.map +1 -0
  26. package/dist/components/WorkflowSequenceDiagram.d.ts +63 -0
  27. package/dist/components/WorkflowSequenceDiagram.d.ts.map +1 -0
  28. package/dist/components/WorkflowSequenceDiagram.js +147 -0
  29. package/dist/components/WorkflowSequenceDiagram.js.map +1 -0
  30. package/dist/components/dashboard/DashboardRenderer.d.ts +10 -0
  31. package/dist/components/dashboard/DashboardRenderer.d.ts.map +1 -0
  32. package/dist/components/dashboard/DashboardRenderer.js +179 -0
  33. package/dist/components/dashboard/DashboardRenderer.js.map +1 -0
  34. package/dist/components/dashboard/MetricPanel.d.ts +10 -0
  35. package/dist/components/dashboard/MetricPanel.d.ts.map +1 -0
  36. package/dist/components/dashboard/MetricPanel.js +103 -0
  37. package/dist/components/dashboard/MetricPanel.js.map +1 -0
  38. package/dist/components/dashboard/MockDataProvider.d.ts +30 -0
  39. package/dist/components/dashboard/MockDataProvider.d.ts.map +1 -0
  40. package/dist/components/dashboard/MockDataProvider.js +270 -0
  41. package/dist/components/dashboard/MockDataProvider.js.map +1 -0
  42. package/dist/components/dashboard/components/BarChart.d.ts +10 -0
  43. package/dist/components/dashboard/components/BarChart.d.ts.map +1 -0
  44. package/dist/components/dashboard/components/BarChart.js +167 -0
  45. package/dist/components/dashboard/components/BarChart.js.map +1 -0
  46. package/dist/components/dashboard/components/LineChart.d.ts +10 -0
  47. package/dist/components/dashboard/components/LineChart.d.ts.map +1 -0
  48. package/dist/components/dashboard/components/LineChart.js +141 -0
  49. package/dist/components/dashboard/components/LineChart.js.map +1 -0
  50. package/dist/components/dashboard/components/MetricCard.d.ts +9 -0
  51. package/dist/components/dashboard/components/MetricCard.d.ts.map +1 -0
  52. package/dist/components/dashboard/components/MetricCard.js +163 -0
  53. package/dist/components/dashboard/components/MetricCard.js.map +1 -0
  54. package/dist/components/dashboard/components/SourceLink.d.ts +9 -0
  55. package/dist/components/dashboard/components/SourceLink.d.ts.map +1 -0
  56. package/dist/components/dashboard/components/SourceLink.js +39 -0
  57. package/dist/components/dashboard/components/SourceLink.js.map +1 -0
  58. package/dist/components/dashboard/components/TimeRangeSelector.d.ts +9 -0
  59. package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +1 -0
  60. package/dist/components/dashboard/components/TimeRangeSelector.js +167 -0
  61. package/dist/components/dashboard/components/TimeRangeSelector.js.map +1 -0
  62. package/dist/components/dashboard/components/index.d.ts +6 -0
  63. package/dist/components/dashboard/components/index.d.ts.map +1 -0
  64. package/dist/components/dashboard/components/index.js +6 -0
  65. package/dist/components/dashboard/components/index.js.map +1 -0
  66. package/dist/components/dashboard/index.d.ts +6 -0
  67. package/dist/components/dashboard/index.d.ts.map +1 -0
  68. package/dist/components/dashboard/index.js +8 -0
  69. package/dist/components/dashboard/index.js.map +1 -0
  70. package/dist/components/dashboard/types.d.ts +74 -0
  71. package/dist/components/dashboard/types.d.ts.map +1 -0
  72. package/dist/components/dashboard/types.js +8 -0
  73. package/dist/components/dashboard/types.js.map +1 -0
  74. package/dist/components/session-events/SessionEventFeed.d.ts +34 -0
  75. package/dist/components/session-events/SessionEventFeed.d.ts.map +1 -0
  76. package/dist/components/session-events/SessionEventFeed.js +1196 -0
  77. package/dist/components/session-events/SessionEventFeed.js.map +1 -0
  78. package/dist/components/session-events/index.d.ts +7 -0
  79. package/dist/components/session-events/index.d.ts.map +1 -0
  80. package/dist/components/session-events/index.js +6 -0
  81. package/dist/components/session-events/index.js.map +1 -0
  82. package/dist/components/state-view/PipelineView.d.ts +14 -0
  83. package/dist/components/state-view/PipelineView.d.ts.map +1 -0
  84. package/dist/components/state-view/PipelineView.js +195 -0
  85. package/dist/components/state-view/PipelineView.js.map +1 -0
  86. package/dist/components/state-view/index.d.ts +14 -0
  87. package/dist/components/state-view/index.d.ts.map +1 -0
  88. package/dist/components/state-view/index.js +12 -0
  89. package/dist/components/state-view/index.js.map +1 -0
  90. package/dist/components/state-view/types.d.ts +188 -0
  91. package/dist/components/state-view/types.d.ts.map +1 -0
  92. package/dist/components/state-view/types.js +10 -0
  93. package/dist/components/state-view/types.js.map +1 -0
  94. package/dist/components/state-view/useStateView.d.ts +32 -0
  95. package/dist/components/state-view/useStateView.d.ts.map +1 -0
  96. package/dist/components/state-view/useStateView.js +129 -0
  97. package/dist/components/state-view/useStateView.js.map +1 -0
  98. package/dist/contexts/GraphEditContext.d.ts +20 -0
  99. package/dist/contexts/GraphEditContext.d.ts.map +1 -0
  100. package/dist/contexts/GraphEditContext.js +8 -0
  101. package/dist/contexts/GraphEditContext.js.map +1 -0
  102. package/dist/contexts/TooltipPortalContext.d.ts +8 -0
  103. package/dist/contexts/TooltipPortalContext.d.ts.map +1 -0
  104. package/dist/contexts/TooltipPortalContext.js +8 -0
  105. package/dist/contexts/TooltipPortalContext.js.map +1 -0
  106. package/dist/edges/CustomEdge.d.ts +24 -0
  107. package/dist/edges/CustomEdge.d.ts.map +1 -0
  108. package/dist/edges/CustomEdge.js +222 -0
  109. package/dist/edges/CustomEdge.js.map +1 -0
  110. package/dist/edges/GenericEdge.d.ts +18 -0
  111. package/dist/edges/GenericEdge.d.ts.map +1 -0
  112. package/dist/edges/GenericEdge.js +10 -0
  113. package/dist/edges/GenericEdge.js.map +1 -0
  114. package/dist/graphify/anchor.d.ts +28 -0
  115. package/dist/graphify/anchor.d.ts.map +1 -0
  116. package/dist/graphify/anchor.js +132 -0
  117. package/dist/graphify/anchor.js.map +1 -0
  118. package/dist/graphify/consolidated.d.ts +210 -0
  119. package/dist/graphify/consolidated.d.ts.map +1 -0
  120. package/dist/graphify/consolidated.js +11 -0
  121. package/dist/graphify/consolidated.js.map +1 -0
  122. package/dist/graphify/ids.d.ts +19 -0
  123. package/dist/graphify/ids.d.ts.map +1 -0
  124. package/dist/graphify/ids.js +46 -0
  125. package/dist/graphify/ids.js.map +1 -0
  126. package/dist/graphify/index.d.ts +18 -0
  127. package/dist/graphify/index.d.ts.map +1 -0
  128. package/dist/graphify/index.js +12 -0
  129. package/dist/graphify/index.js.map +1 -0
  130. package/dist/graphify/kind.d.ts +23 -0
  131. package/dist/graphify/kind.d.ts.map +1 -0
  132. package/dist/graphify/kind.js +77 -0
  133. package/dist/graphify/kind.js.map +1 -0
  134. package/dist/graphify/resolve.d.ts +48 -0
  135. package/dist/graphify/resolve.d.ts.map +1 -0
  136. package/dist/graphify/resolve.js +83 -0
  137. package/dist/graphify/resolve.js.map +1 -0
  138. package/dist/graphify/signature.d.ts +87 -0
  139. package/dist/graphify/signature.d.ts.map +1 -0
  140. package/dist/graphify/signature.js +276 -0
  141. package/dist/graphify/signature.js.map +1 -0
  142. package/dist/graphify/types.d.ts +141 -0
  143. package/dist/graphify/types.d.ts.map +1 -0
  144. package/dist/graphify/types.js +8 -0
  145. package/dist/graphify/types.js.map +1 -0
  146. package/dist/hooks/useElkLayout.d.ts +66 -0
  147. package/dist/hooks/useElkLayout.d.ts.map +1 -0
  148. package/dist/hooks/useElkLayout.js +136 -0
  149. package/dist/hooks/useElkLayout.js.map +1 -0
  150. package/dist/hooks/usePathBasedEvents.d.ts +42 -0
  151. package/dist/hooks/usePathBasedEvents.d.ts.map +1 -0
  152. package/dist/hooks/usePathBasedEvents.js +119 -0
  153. package/dist/hooks/usePathBasedEvents.js.map +1 -0
  154. package/dist/hooks/useSequenceLayout.d.ts +186 -0
  155. package/dist/hooks/useSequenceLayout.d.ts.map +1 -0
  156. package/dist/hooks/useSequenceLayout.js +327 -0
  157. package/dist/hooks/useSequenceLayout.js.map +1 -0
  158. package/dist/hooks/useUndoRedo.d.ts +80 -0
  159. package/dist/hooks/useUndoRedo.d.ts.map +1 -0
  160. package/dist/hooks/useUndoRedo.js +70 -0
  161. package/dist/hooks/useUndoRedo.js.map +1 -0
  162. package/dist/index.d.ts +73 -0
  163. package/dist/index.d.ts.map +1 -0
  164. package/dist/index.js +51 -0
  165. package/dist/index.js.map +1 -0
  166. package/dist/nodes/CustomNode.d.ts +28 -0
  167. package/dist/nodes/CustomNode.d.ts.map +1 -0
  168. package/dist/nodes/CustomNode.js +820 -0
  169. package/dist/nodes/CustomNode.js.map +1 -0
  170. package/dist/nodes/GenericNode.d.ts +20 -0
  171. package/dist/nodes/GenericNode.d.ts.map +1 -0
  172. package/dist/nodes/GenericNode.js +20 -0
  173. package/dist/nodes/GenericNode.js.map +1 -0
  174. package/dist/nodes/otel/OtelBoundaryNode.d.ts +55 -0
  175. package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -0
  176. package/dist/nodes/otel/OtelBoundaryNode.js +81 -0
  177. package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -0
  178. package/dist/nodes/otel/OtelEventNode.d.ts +59 -0
  179. package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -0
  180. package/dist/nodes/otel/OtelEventNode.js +82 -0
  181. package/dist/nodes/otel/OtelEventNode.js.map +1 -0
  182. package/dist/nodes/otel/OtelResourceNode.d.ts +53 -0
  183. package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -0
  184. package/dist/nodes/otel/OtelResourceNode.js +105 -0
  185. package/dist/nodes/otel/OtelResourceNode.js.map +1 -0
  186. package/dist/nodes/otel/OtelScopeNode.d.ts +53 -0
  187. package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -0
  188. package/dist/nodes/otel/OtelScopeNode.js +81 -0
  189. package/dist/nodes/otel/OtelScopeNode.js.map +1 -0
  190. package/dist/nodes/otel/OtelSpanConventionNode.d.ts +61 -0
  191. package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -0
  192. package/dist/nodes/otel/OtelSpanConventionNode.js +131 -0
  193. package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -0
  194. package/dist/nodes/otel/index.d.ts +17 -0
  195. package/dist/nodes/otel/index.d.ts.map +1 -0
  196. package/dist/nodes/otel/index.js +13 -0
  197. package/dist/nodes/otel/index.js.map +1 -0
  198. package/dist/nodes/otel/shared/NodeBadges.d.ts +10 -0
  199. package/dist/nodes/otel/shared/NodeBadges.d.ts.map +1 -0
  200. package/dist/nodes/otel/shared/NodeBadges.js +178 -0
  201. package/dist/nodes/otel/shared/NodeBadges.js.map +1 -0
  202. package/dist/nodes/otel/shared/NodeContent.d.ts +10 -0
  203. package/dist/nodes/otel/shared/NodeContent.d.ts.map +1 -0
  204. package/dist/nodes/otel/shared/NodeContent.js +96 -0
  205. package/dist/nodes/otel/shared/NodeContent.js.map +1 -0
  206. package/dist/nodes/otel/shared/index.d.ts +8 -0
  207. package/dist/nodes/otel/shared/index.d.ts.map +1 -0
  208. package/dist/nodes/otel/shared/index.js +8 -0
  209. package/dist/nodes/otel/shared/index.js.map +1 -0
  210. package/dist/nodes/otel/shared/types.d.ts +129 -0
  211. package/dist/nodes/otel/shared/types.d.ts.map +1 -0
  212. package/dist/nodes/otel/shared/types.js +5 -0
  213. package/dist/nodes/otel/shared/types.js.map +1 -0
  214. package/dist/nodes/otel/shared/useNodeBehavior.d.ts +42 -0
  215. package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +1 -0
  216. package/dist/nodes/otel/shared/useNodeBehavior.js +61 -0
  217. package/dist/nodes/otel/shared/useNodeBehavior.js.map +1 -0
  218. package/dist/pierre/PierreFileView.d.ts +17 -0
  219. package/dist/pierre/PierreFileView.d.ts.map +1 -0
  220. package/dist/pierre/PierreFileView.js +46 -0
  221. package/dist/pierre/PierreFileView.js.map +1 -0
  222. package/dist/pierre/PierreSnippetView.d.ts +28 -0
  223. package/dist/pierre/PierreSnippetView.d.ts.map +1 -0
  224. package/dist/pierre/PierreSnippetView.js +105 -0
  225. package/dist/pierre/PierreSnippetView.js.map +1 -0
  226. package/dist/pierre/PierreThroughlineCodeView.d.ts +22 -0
  227. package/dist/pierre/PierreThroughlineCodeView.d.ts.map +1 -0
  228. package/dist/pierre/PierreThroughlineCodeView.js +206 -0
  229. package/dist/pierre/PierreThroughlineCodeView.js.map +1 -0
  230. package/dist/pierre/constructColors.d.ts +24 -0
  231. package/dist/pierre/constructColors.d.ts.map +1 -0
  232. package/dist/pierre/constructColors.js +91 -0
  233. package/dist/pierre/constructColors.js.map +1 -0
  234. package/dist/pierre/index.d.ts +12 -0
  235. package/dist/pierre/index.d.ts.map +1 -0
  236. package/dist/pierre/index.js +7 -0
  237. package/dist/pierre/index.js.map +1 -0
  238. package/dist/pierre/pierreBackground.d.ts +15 -0
  239. package/dist/pierre/pierreBackground.d.ts.map +1 -0
  240. package/dist/pierre/pierreBackground.js +31 -0
  241. package/dist/pierre/pierreBackground.js.map +1 -0
  242. package/dist/pierre/pierreFileLang.d.ts +27 -0
  243. package/dist/pierre/pierreFileLang.d.ts.map +1 -0
  244. package/dist/pierre/pierreFileLang.js +52 -0
  245. package/dist/pierre/pierreFileLang.js.map +1 -0
  246. package/dist/pierre/pierreSyntaxTheme.d.ts +11 -0
  247. package/dist/pierre/pierreSyntaxTheme.d.ts.map +1 -0
  248. package/dist/pierre/pierreSyntaxTheme.js +20 -0
  249. package/dist/pierre/pierreSyntaxTheme.js.map +1 -0
  250. package/dist/pierre/scrollAnchor.d.ts +5 -0
  251. package/dist/pierre/scrollAnchor.d.ts.map +1 -0
  252. package/dist/pierre/scrollAnchor.js +9 -0
  253. package/dist/pierre/scrollAnchor.js.map +1 -0
  254. package/dist/pierre/sliceSnippet.d.ts +10 -0
  255. package/dist/pierre/sliceSnippet.d.ts.map +1 -0
  256. package/dist/pierre/sliceSnippet.js +16 -0
  257. package/dist/pierre/sliceSnippet.js.map +1 -0
  258. package/dist/pierre/syntaxTokens.d.ts +11 -0
  259. package/dist/pierre/syntaxTokens.d.ts.map +1 -0
  260. package/dist/pierre/syntaxTokens.js +51 -0
  261. package/dist/pierre/syntaxTokens.js.map +1 -0
  262. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
  263. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
  264. package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
  265. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
  266. package/dist/subsystem/ComponentDeclaration.d.ts +87 -0
  267. package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -0
  268. package/dist/subsystem/ComponentDeclaration.js +374 -0
  269. package/dist/subsystem/ComponentDeclaration.js.map +1 -0
  270. package/dist/subsystem/FileDrawer.d.ts +17 -0
  271. package/dist/subsystem/FileDrawer.d.ts.map +1 -0
  272. package/dist/subsystem/FileDrawer.js +72 -0
  273. package/dist/subsystem/FileDrawer.js.map +1 -0
  274. package/dist/subsystem/GraphLayoutCover.d.ts +20 -0
  275. package/dist/subsystem/GraphLayoutCover.d.ts.map +1 -0
  276. package/dist/subsystem/GraphLayoutCover.js +42 -0
  277. package/dist/subsystem/GraphLayoutCover.js.map +1 -0
  278. package/dist/subsystem/SubsystemComponentGraph.d.ts +96 -0
  279. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -0
  280. package/dist/subsystem/SubsystemComponentGraph.js +1059 -0
  281. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -0
  282. package/dist/subsystem/SubsystemFileTree.d.ts +24 -0
  283. package/dist/subsystem/SubsystemFileTree.d.ts.map +1 -0
  284. package/dist/subsystem/SubsystemFileTree.js +150 -0
  285. package/dist/subsystem/SubsystemFileTree.js.map +1 -0
  286. package/dist/subsystem/declarationRef.d.ts +39 -0
  287. package/dist/subsystem/declarationRef.d.ts.map +1 -0
  288. package/dist/subsystem/declarationRef.js +32 -0
  289. package/dist/subsystem/declarationRef.js.map +1 -0
  290. package/dist/subsystem/formatDeclaration.d.ts +11 -0
  291. package/dist/subsystem/formatDeclaration.d.ts.map +1 -0
  292. package/dist/subsystem/formatDeclaration.js +146 -0
  293. package/dist/subsystem/formatDeclaration.js.map +1 -0
  294. package/dist/subsystem/model.d.ts +353 -0
  295. package/dist/subsystem/model.d.ts.map +1 -0
  296. package/dist/subsystem/model.js +503 -0
  297. package/dist/subsystem/model.js.map +1 -0
  298. package/dist/subsystem/nodes.d.ts +69 -0
  299. package/dist/subsystem/nodes.d.ts.map +1 -0
  300. package/dist/subsystem/nodes.js +289 -0
  301. package/dist/subsystem/nodes.js.map +1 -0
  302. package/dist/subsystem/paths.d.ts +63 -0
  303. package/dist/subsystem/paths.d.ts.map +1 -0
  304. package/dist/subsystem/paths.js +86 -0
  305. package/dist/subsystem/paths.js.map +1 -0
  306. package/dist/subsystem/tokenizeComponent.d.ts +20 -0
  307. package/dist/subsystem/tokenizeComponent.d.ts.map +1 -0
  308. package/dist/subsystem/tokenizeComponent.js +56 -0
  309. package/dist/subsystem/tokenizeComponent.js.map +1 -0
  310. package/dist/subsystem/tokenizeFormatted.d.ts +12 -0
  311. package/dist/subsystem/tokenizeFormatted.d.ts.map +1 -0
  312. package/dist/subsystem/tokenizeFormatted.js +13 -0
  313. package/dist/subsystem/tokenizeFormatted.js.map +1 -0
  314. package/dist/utils/animationMapping.d.ts +53 -0
  315. package/dist/utils/animationMapping.d.ts.map +1 -0
  316. package/dist/utils/animationMapping.js +126 -0
  317. package/dist/utils/animationMapping.js.map +1 -0
  318. package/dist/utils/canvasBounds.d.ts +50 -0
  319. package/dist/utils/canvasBounds.d.ts.map +1 -0
  320. package/dist/utils/canvasBounds.js +88 -0
  321. package/dist/utils/canvasBounds.js.map +1 -0
  322. package/dist/utils/elkLayout.d.ts +137 -0
  323. package/dist/utils/elkLayout.d.ts.map +1 -0
  324. package/dist/utils/elkLayout.js +596 -0
  325. package/dist/utils/elkLayout.js.map +1 -0
  326. package/dist/utils/graphConverter.d.ts +18 -0
  327. package/dist/utils/graphConverter.d.ts.map +1 -0
  328. package/dist/utils/graphConverter.js +114 -0
  329. package/dist/utils/graphConverter.js.map +1 -0
  330. package/dist/utils/iconResolver.d.ts +29 -0
  331. package/dist/utils/iconResolver.d.ts.map +1 -0
  332. package/dist/utils/iconResolver.js +30 -0
  333. package/dist/utils/iconResolver.js.map +1 -0
  334. package/dist/utils/orientationUtils.d.ts +19 -0
  335. package/dist/utils/orientationUtils.d.ts.map +1 -0
  336. package/dist/utils/orientationUtils.js +62 -0
  337. package/dist/utils/orientationUtils.js.map +1 -0
  338. package/package.json +80 -0
  339. package/src/components/ConfigurationSelector.tsx +133 -0
  340. package/src/components/GraphRenderer.tsx +3195 -0
  341. package/src/components/MultiCanvasRenderer.tsx +295 -0
  342. package/src/components/NodeTooltip.tsx +279 -0
  343. package/src/components/PendingChanges.test.tsx +375 -0
  344. package/src/components/SelectionSidebar.tsx +352 -0
  345. package/src/components/SequenceDiagramRenderer.tsx +1156 -0
  346. package/src/components/WorkflowSequenceDiagram.tsx +270 -0
  347. package/src/components/dashboard/DashboardRenderer.tsx +317 -0
  348. package/src/components/dashboard/MetricPanel.tsx +254 -0
  349. package/src/components/dashboard/MockDataProvider.ts +330 -0
  350. package/src/components/dashboard/components/BarChart.tsx +299 -0
  351. package/src/components/dashboard/components/LineChart.tsx +279 -0
  352. package/src/components/dashboard/components/MetricCard.tsx +270 -0
  353. package/src/components/dashboard/components/SourceLink.tsx +63 -0
  354. package/src/components/dashboard/components/TimeRangeSelector.tsx +280 -0
  355. package/src/components/dashboard/components/index.ts +5 -0
  356. package/src/components/dashboard/index.ts +47 -0
  357. package/src/components/dashboard/types.ts +126 -0
  358. package/src/components/session-events/SessionEventFeed.tsx +1797 -0
  359. package/src/components/session-events/index.ts +13 -0
  360. package/src/components/state-view/PipelineView.tsx +347 -0
  361. package/src/components/state-view/index.ts +14 -0
  362. package/src/components/state-view/types.ts +261 -0
  363. package/src/components/state-view/useStateView.ts +205 -0
  364. package/src/contexts/GraphEditContext.tsx +27 -0
  365. package/src/contexts/TooltipPortalContext.ts +8 -0
  366. package/src/edges/CustomEdge.tsx +402 -0
  367. package/src/edges/GenericEdge.tsx +36 -0
  368. package/src/graphify/anchor.test.ts +124 -0
  369. package/src/graphify/anchor.ts +160 -0
  370. package/src/graphify/consolidated.ts +246 -0
  371. package/src/graphify/ids.ts +48 -0
  372. package/src/graphify/index.ts +72 -0
  373. package/src/graphify/kind.test.ts +108 -0
  374. package/src/graphify/kind.ts +120 -0
  375. package/src/graphify/resolve.test.ts +89 -0
  376. package/src/graphify/resolve.ts +115 -0
  377. package/src/graphify/signature.test.ts +278 -0
  378. package/src/graphify/signature.ts +354 -0
  379. package/src/graphify/types.ts +164 -0
  380. package/src/hooks/useElkLayout.test.ts +134 -0
  381. package/src/hooks/useElkLayout.ts +191 -0
  382. package/src/hooks/usePathBasedEvents.ts +192 -0
  383. package/src/hooks/useSequenceLayout.ts +543 -0
  384. package/src/hooks/useUndoRedo.ts +144 -0
  385. package/src/index.ts +341 -0
  386. package/src/nodes/CustomNode.tsx +1231 -0
  387. package/src/nodes/GenericNode.tsx +55 -0
  388. package/src/nodes/otel/OtelBoundaryNode.tsx +224 -0
  389. package/src/nodes/otel/OtelEventNode.tsx +225 -0
  390. package/src/nodes/otel/OtelResourceNode.tsx +251 -0
  391. package/src/nodes/otel/OtelScopeNode.tsx +221 -0
  392. package/src/nodes/otel/OtelSpanConventionNode.tsx +295 -0
  393. package/src/nodes/otel/index.ts +23 -0
  394. package/src/nodes/otel/shared/NodeBadges.tsx +295 -0
  395. package/src/nodes/otel/shared/NodeContent.tsx +204 -0
  396. package/src/nodes/otel/shared/index.ts +8 -0
  397. package/src/nodes/otel/shared/types.ts +138 -0
  398. package/src/nodes/otel/shared/useNodeBehavior.ts +114 -0
  399. package/src/pierre/PierreFileView.tsx +81 -0
  400. package/src/pierre/PierreSnippetView.tsx +184 -0
  401. package/src/pierre/PierreThroughlineCodeView.tsx +304 -0
  402. package/src/pierre/constructColors.test.ts +52 -0
  403. package/src/pierre/constructColors.ts +112 -0
  404. package/src/pierre/index.ts +18 -0
  405. package/src/pierre/pierreBackground.ts +33 -0
  406. package/src/pierre/pierreFileLang.test.ts +26 -0
  407. package/src/pierre/pierreFileLang.ts +55 -0
  408. package/src/pierre/pierreSyntaxTheme.ts +23 -0
  409. package/src/pierre/scrollAnchor.test.ts +13 -0
  410. package/src/pierre/scrollAnchor.ts +11 -0
  411. package/src/pierre/sliceSnippet.test.ts +21 -0
  412. package/src/pierre/sliceSnippet.ts +31 -0
  413. package/src/pierre/syntaxTokens.test.ts +35 -0
  414. package/src/pierre/syntaxTokens.ts +60 -0
  415. package/src/stories/Audit/BoundaryNodes.stories.tsx +385 -0
  416. package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +1448 -0
  417. package/src/stories/Audit/CanvasNodeTypes.stories.tsx +1049 -0
  418. package/src/stories/Audit/ColorPriority.stories.tsx +895 -0
  419. package/src/stories/Audit/DiamondBadges.stories.tsx +629 -0
  420. package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +724 -0
  421. package/src/stories/Audit/NodeFieldsAudit.stories.tsx +996 -0
  422. package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +715 -0
  423. package/src/stories/Audit/NodeShapes.stories.tsx +1208 -0
  424. package/src/stories/Audit/WideNodesTesting.stories.tsx +1045 -0
  425. package/src/stories/Components/DashboardRenderer.stories.tsx +263 -0
  426. package/src/stories/Components/GraphRenderer.stories.tsx +3236 -0
  427. package/src/stories/Components/MultiCanvasRenderer.stories.tsx +370 -0
  428. package/src/stories/Components/SequenceDiagram.stories.tsx +255 -0
  429. package/src/stories/Components/StateView.stories.tsx +417 -0
  430. package/src/stories/Components/TraceViewer.stories.tsx +442 -0
  431. package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +802 -0
  432. package/src/stories/Features/AnimationWorkshop.stories.tsx +727 -0
  433. package/src/stories/Features/ChangeTypeVisual.stories.tsx +67 -0
  434. package/src/stories/Features/EventDrivenAnimations.stories.tsx +513 -0
  435. package/src/stories/Features/MultiConfig.stories.tsx +539 -0
  436. package/src/stories/Introduction.mdx +34 -0
  437. package/src/stories/Layout/ElkEdgeRouting.stories.tsx +539 -0
  438. package/src/stories/Layout/GraphOrientation.stories.tsx +500 -0
  439. package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +352 -0
  440. package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +560 -0
  441. package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +491 -0
  442. package/src/stories/Nodes/NumericColors.stories.tsx +440 -0
  443. package/src/stories/OTEL/EventNameDisplay.stories.tsx +694 -0
  444. package/src/stories/OTEL/EventNameFallback.stories.tsx +578 -0
  445. package/src/stories/OTEL/OtelComponents.stories.tsx +422 -0
  446. package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +806 -0
  447. package/src/stories/OTEL/RawEventCards.stories.tsx +57 -0
  448. package/src/stories/OTEL/SpanBadges.stories.tsx +840 -0
  449. package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +209 -0
  450. package/src/stories/Pierre/CodeView.stories.tsx +219 -0
  451. package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +721 -0
  452. package/src/stories/RealWorld/FileCitySequence.stories.tsx +516 -0
  453. package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +336 -0
  454. package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +321 -0
  455. package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
  456. package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
  457. package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
  458. package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
  459. package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +239 -0
  460. package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +216 -0
  461. package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +70 -0
  462. package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +68 -0
  463. package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
  464. package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +681 -0
  465. package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
  466. package/src/stories/__traces__/test-run.canvas.json +241 -0
  467. package/src/stories/data/activity-feed-analytics.dashboard.json +300 -0
  468. package/src/stories/data/file-city-images-transformed.otel.canvas.json +295 -0
  469. package/src/stories/data/file-city-workflows.json +269 -0
  470. package/src/stories/data/graph-converter-test-execution.json +443 -0
  471. package/src/stories/data/graph-converter-test.workflow.json +105 -0
  472. package/src/stories/data/graph-converter-validated-execution.json +58 -0
  473. package/src/stories/data/opencode-session-raw-events.json +273396 -0
  474. package/src/subsystem/ComponentDeclaration.tsx +643 -0
  475. package/src/subsystem/FileDrawer.tsx +106 -0
  476. package/src/subsystem/GraphLayoutCover.tsx +69 -0
  477. package/src/subsystem/SubsystemComponentGraph.tsx +1644 -0
  478. package/src/subsystem/SubsystemFileTree.tsx +190 -0
  479. package/src/subsystem/declarationRef.test.ts +33 -0
  480. package/src/subsystem/declarationRef.ts +63 -0
  481. package/src/subsystem/formatDeclaration.ts +174 -0
  482. package/src/subsystem/model.test.ts +244 -0
  483. package/src/subsystem/model.ts +850 -0
  484. package/src/subsystem/nodes.test.ts +56 -0
  485. package/src/subsystem/nodes.tsx +443 -0
  486. package/src/subsystem/paths.test.ts +123 -0
  487. package/src/subsystem/paths.ts +127 -0
  488. package/src/subsystem/tokenizeComponent.ts +70 -0
  489. package/src/subsystem/tokenizeFormatted.ts +19 -0
  490. package/src/utils/animationMapping.ts +166 -0
  491. package/src/utils/canvasBounds.ts +146 -0
  492. package/src/utils/elkLayout.test.ts +240 -0
  493. package/src/utils/elkLayout.ts +779 -0
  494. package/src/utils/graphConverter.ts +148 -0
  495. package/src/utils/iconResolver.tsx +53 -0
  496. package/src/utils/orientationUtils.ts +73 -0
@@ -0,0 +1,289 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * Subsystem component/group node + edge renderers.
4
+ *
5
+ * Lightweight, purpose-built for the subsystem component graph: a component
6
+ * renders its name (kind-tagged, colored by package) plus its symbol/purpose.
7
+ * Groups render as package containers. Clicking
8
+ * a component calls `onSelect` (to open the entry point / file).
9
+ */
10
+ import { useState } from 'react';
11
+ import { Handle, Position, } from '@xyflow/react';
12
+ import { useTheme } from '@principal-ade/industry-theme';
13
+ import { MECHANISM_COLOR, MECHANISM_STYLE, ROLE_COLOR, ROLE_LABEL, constructBadgeLabel, deriveNameFromSymbol, BADGE_EDGE_INSET, nodeMinWidthForBadges, packageColor, } from './model';
14
+ import { constructColorsFromPierreTheme } from '../pierre/constructColors';
15
+ import { resolvePierreSyntaxThemeName } from '../pierre/pierreSyntaxTheme';
16
+ export const CONSTRUCT_LABEL = {
17
+ class: 'class',
18
+ function: 'function',
19
+ method: 'method',
20
+ interface: 'interface',
21
+ type_alias: 'type alias',
22
+ enum: 'enum',
23
+ module: 'module',
24
+ store: 'store',
25
+ external: 'external',
26
+ };
27
+ /** Insert zero-width spaces at identifier word boundaries so long names wrap
28
+ * on naming conventions (snake_case `foo_`|`bar`, camelCase `foo`|`Bar`,
29
+ * PascalCase `Foo`|`Bar`, acronym `ABC`|`Def`) instead of mid-character. */
30
+ function breakWords(s) {
31
+ const zwsp = '\u200b';
32
+ return s
33
+ // camelCase: lower/digit → Upper (and the boundary before it holds)
34
+ .replace(/([a-z0-9])([A-Z])/g, `$1${zwsp}$2`)
35
+ // acronym → word: `ABC`|`Def` (two Uppercase then a lowercase)
36
+ .replace(/([A-Z])([A-Z][a-z])/g, `$1${zwsp}$2`)
37
+ // separators: break after `_`, `-`, `.`
38
+ .replace(/([_\-.])([^_\-.\u200b])/g, `$1${zwsp}$2`);
39
+ }
40
+ /** Root callbacks carried through node data (injected by the graph component). */
41
+ export const SUBSYSTEM_CALLBACKS = {};
42
+ export function SubsystemComponentNode(props) {
43
+ const { theme, mode } = useTheme();
44
+ const { data, selected, width: nodeWidth, height: nodeHeight } = props;
45
+ const c = data.component;
46
+ // Construct owns node color, derived from the active Pierre syntax theme —
47
+ // the same palette the declaration panel and file drawer render with. Role
48
+ // shows as the hover badge, not as color — for now; a role glyph/accent may
49
+ // come later.
50
+ const color = constructColorsFromPierreTheme(resolvePierreSyntaxThemeName(mode))[c.construct];
51
+ const [hover, setHover] = useState(false);
52
+ const configuredMax = SUBSYSTEM_CALLBACKS.maxNodeWidth;
53
+ const maxWidth = configuredMax ?? 300;
54
+ // `symbol` is the source of truth; `name` is derived from it consistently.
55
+ const displayName = deriveNameFromSymbol(c.symbol, c.construct, c.name, c.file, c.stereotype);
56
+ // Top badges are absolutely positioned — widen the node so they nowrap
57
+ // instead of wrapping, including when construct + role badges share the top.
58
+ const badgeMinWidth = nodeMinWidthForBadges(c);
59
+ // Set while a file is open in the drawer: true → spotlight, false → dim,
60
+ // absent (no file open) → neutral.
61
+ const fileMatch = data.fileMatch;
62
+ // Selection is stamped into data by the graph component — React Flow's own
63
+ // `selected` never updates because the node stops click propagation.
64
+ const isSelected = selected || data.isSelected === true;
65
+ return (_jsxs("div", { onMouseEnter: () => {
66
+ setHover(true);
67
+ SUBSYSTEM_CALLBACKS.onHover?.(c.id);
68
+ }, onMouseLeave: () => {
69
+ setHover(false);
70
+ SUBSYSTEM_CALLBACKS.onHover?.(null);
71
+ }, onClick: (e) => {
72
+ e.stopPropagation();
73
+ SUBSYSTEM_CALLBACKS.onSelect?.(c.id);
74
+ }, style: {
75
+ position: 'relative',
76
+ display: 'flex',
77
+ flexDirection: 'column',
78
+ justifyContent: 'center',
79
+ alignItems: 'center',
80
+ boxSizing: 'border-box',
81
+ width: nodeWidth,
82
+ height: nodeHeight,
83
+ minWidth: badgeMinWidth,
84
+ maxWidth,
85
+ padding: '6px 10px',
86
+ borderRadius: 8,
87
+ background: theme.colors.backgroundSecondary ?? theme.colors.background,
88
+ // Selected / file-matched nodes get a thicker border; kind colors are
89
+ // kept for selection (thickness only). The file-open spotlight keeps
90
+ // its primary tint.
91
+ border: `${isSelected || fileMatch ? 4 : 2}px solid ${fileMatch ? theme.colors.primary : color}`,
92
+ boxShadow: fileMatch
93
+ ? `0 1px 4px rgba(0,0,0,0.25), 0 0 12px ${theme.colors.primary}55`
94
+ : '0 1px 4px rgba(0,0,0,0.25)',
95
+ opacity: fileMatch === false || data.dimmed === true ? 0.18 : 1,
96
+ transition: 'opacity 150ms ease',
97
+ cursor: 'pointer',
98
+ fontFamily: theme.fonts.body,
99
+ }, children: [_jsx("div", { style: {
100
+ position: 'absolute',
101
+ top: -9,
102
+ left: BADGE_EDGE_INSET,
103
+ zIndex: 1,
104
+ fontFamily: theme.fonts.monospace,
105
+ fontSize: theme.fontSizes[0] * 1.1,
106
+ letterSpacing: 0.5,
107
+ textTransform: 'uppercase',
108
+ lineHeight: '17px',
109
+ whiteSpace: 'nowrap',
110
+ color,
111
+ background: theme.colors.backgroundSecondary ?? theme.colors.background,
112
+ border: `1px solid ${color}`,
113
+ borderRadius: 4,
114
+ padding: '0 5px',
115
+ }, children: constructBadgeLabel(c) }), c.role != null && (_jsx("div", { style: {
116
+ position: 'absolute',
117
+ top: -9,
118
+ right: BADGE_EDGE_INSET,
119
+ zIndex: 1,
120
+ fontFamily: theme.fonts.monospace,
121
+ fontSize: theme.fontSizes[0] * 1.1,
122
+ letterSpacing: 0.5,
123
+ textTransform: 'uppercase',
124
+ lineHeight: '17px',
125
+ whiteSpace: 'nowrap',
126
+ color: ROLE_COLOR[c.role],
127
+ background: theme.colors.backgroundSecondary ?? theme.colors.background,
128
+ border: `1px solid ${ROLE_COLOR[c.role]}`,
129
+ borderRadius: 4,
130
+ padding: '0 5px',
131
+ }, children: ROLE_LABEL[c.role] })), (hover || fileMatch === true) && c.file ? (_jsx("div", { style: {
132
+ position: 'absolute',
133
+ bottom: -13,
134
+ left: '50%',
135
+ transform: 'translateX(-50%)',
136
+ zIndex: 1,
137
+ fontFamily: theme.fonts.monospace,
138
+ fontSize: theme.fontSizes[0] * 1.1,
139
+ letterSpacing: 0.5,
140
+ lineHeight: '17px',
141
+ whiteSpace: 'nowrap',
142
+ // filename stays neutral — the construct color belongs to the
143
+ // borders and badges, not the file name
144
+ color: theme.colors.text ?? theme.colors.textSecondary,
145
+ background: theme.colors.backgroundSecondary ?? theme.colors.background,
146
+ border: `1px solid ${color}`,
147
+ borderRadius: 4,
148
+ padding: '0 5px',
149
+ cursor: 'pointer',
150
+ }, onClick: (e) => {
151
+ // Open the file directly; don't also toggle node selection.
152
+ e.stopPropagation();
153
+ SUBSYSTEM_CALLBACKS.onOpenFile?.(c.id);
154
+ }, children: c.file.split('/').pop() })) : null, _jsx("div", { style: {
155
+ fontSize: theme.fontSizes[2],
156
+ fontWeight: 600,
157
+ color: theme.colors.text,
158
+ lineHeight: 1.2,
159
+ textAlign: 'center',
160
+ // Let long names wrap within the node's capped width (instead of
161
+ // truncating), but cap each line so the node doesn't grow unbounded.
162
+ whiteSpace: 'normal',
163
+ overflowWrap: 'anywhere',
164
+ maxWidth: '100%',
165
+ fontFamily: theme.fonts.body,
166
+ }, children: breakWords(displayName) }), c.symbol &&
167
+ c.symbol !==
168
+ displayName
169
+ .replace(/^<(.+)>$/, '$1')
170
+ .replace(/ ?\{\}$/, '')
171
+ .replace(/\(\)$/, '') && (_jsx("div", { style: {
172
+ fontSize: theme.fontSizes[0] * 0.82,
173
+ fontFamily: theme.fonts.monospace,
174
+ color: color,
175
+ marginTop: 1,
176
+ textAlign: 'center',
177
+ whiteSpace: 'nowrap',
178
+ overflow: 'hidden',
179
+ textOverflow: 'ellipsis',
180
+ maxWidth: '100%',
181
+ }, title: c.symbol, children: c.symbol })), _jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }));
182
+ }
183
+ /**
184
+ * Process boundary frame — a React Flow parent node. Members render inside
185
+ * via `parentId`; this draws the labeled container only (no handles, no
186
+ * selection). The border color derives deterministically from the process key
187
+ * so each deployment unit reads as its own region.
188
+ */
189
+ export function SubsystemGroupNode(props) {
190
+ const { theme } = useTheme();
191
+ const { data, width, height, selected } = props;
192
+ const region = data.region;
193
+ const color = packageColor(region?.key ?? 'process');
194
+ const dimmed = data.dimmed === true;
195
+ const hidden = data.hidden === true;
196
+ if (!region)
197
+ return null;
198
+ return (_jsx("div", { style: {
199
+ position: 'relative',
200
+ width: width ?? 400,
201
+ height: height ?? 300,
202
+ boxSizing: 'border-box',
203
+ borderRadius: 12,
204
+ border: `2px ${selected ? 'solid' : 'dashed'} ${color}`,
205
+ background: `${color}14`,
206
+ opacity: hidden ? 0 : dimmed ? 0.35 : 1,
207
+ transition: 'opacity 150ms ease',
208
+ pointerEvents: 'none',
209
+ }, children: _jsx("div", { style: {
210
+ position: 'absolute',
211
+ top: -19,
212
+ left: 12,
213
+ fontFamily: theme.fonts.monospace,
214
+ fontSize: theme.fontSizes[3],
215
+ fontWeight: 700,
216
+ letterSpacing: 0.6,
217
+ color,
218
+ background: theme.colors.backgroundSecondary ?? theme.colors.background,
219
+ border: `1px solid ${color}`,
220
+ borderRadius: 4,
221
+ padding: '1px 7px',
222
+ whiteSpace: 'nowrap',
223
+ }, children: region.label }) }));
224
+ }
225
+ /** `#rrggbb` + alpha → `#rrggbbaa`. Used to dim a stroke/marker by color so
226
+ * each opacity gets its own SVG marker id — path `opacity` leaks across every
227
+ * edge that shares a `url(#marker)` (the focused edge's arrowhead dims). */
228
+ export function hexWithAlpha(hex, alpha) {
229
+ const raw = hex.replace('#', '');
230
+ const full = raw.length === 3 ? [...raw].map((c) => c + c).join('') : raw;
231
+ if (!/^[0-9a-fA-F]{6}$/.test(full))
232
+ return hex;
233
+ const a = Math.round(Math.min(1, Math.max(0, alpha)) * 255)
234
+ .toString(16)
235
+ .padStart(2, '0');
236
+ return `#${full}${a}`;
237
+ }
238
+ /**
239
+ * File-open spotlight flag for a node. `true` = lives in the open file,
240
+ * `false` = dim, `undefined` = render neutrally.
241
+ *
242
+ * Focused-edge endpoints stay neutral when they don't live in the open file
243
+ * (the target of a focused edge must not dim with the rest).
244
+ */
245
+ export function fileMatchForNode(nodeFile, openFile, isFocusEndpoint) {
246
+ if (!openFile)
247
+ return undefined;
248
+ if (nodeFile === openFile)
249
+ return true;
250
+ if (isFocusEndpoint)
251
+ return undefined;
252
+ return false;
253
+ }
254
+ /**
255
+ * Hide / dim a node or edge while flows are open.
256
+ * - not in any opened flow → hidden
257
+ * - in an opened flow, but not the selected flow/step → dimmed
258
+ * - in the selected flow or step (or opened with nothing selected) → full
259
+ */
260
+ export function flowElementVisibility(opts) {
261
+ const { inOpened, inSelected, anyOpened, anySelected } = opts;
262
+ if (!anyOpened && !anySelected)
263
+ return { hidden: false, dimmed: false };
264
+ if (!inOpened && !inSelected)
265
+ return { hidden: true, dimmed: false };
266
+ if (anySelected && !inSelected)
267
+ return { hidden: false, dimmed: true };
268
+ return { hidden: false, dimmed: false };
269
+ }
270
+ export const EDGE_DIM_ALPHA = 0.15;
271
+ /** Subsystem edge — SVG path only. The mechanism label is rendered as an
272
+ * absolutely-positioned HTML overlay OUTSIDE the ReactFlow tree (by the
273
+ * parent Inner component) so it sits above the pane and receives pointer
274
+ * events. */
275
+ export function SubsystemEdge({ data, markerEnd, }) {
276
+ const path = data?.elkPath ?? '';
277
+ const mechanism = data?.mechanism ?? 'imports';
278
+ const color = MECHANISM_COLOR[mechanism] ?? '#888';
279
+ // Dash style comes from the mechanism table (dashed = inverted-control or
280
+ // observational relationships: hierarchy, registration, watches).
281
+ const isDashed = MECHANISM_STYLE[mechanism] === 'dashed';
282
+ const dimmed = data?.dimmed === true;
283
+ // Dim the stroke by color, never via path `opacity`. SVG markers are shared
284
+ // by id; opacity on the referencing path paints every arrowhead that uses
285
+ // the same marker — including the focused edge's target.
286
+ const stroke = dimmed ? hexWithAlpha(color, EDGE_DIM_ALPHA) : color;
287
+ return (_jsxs(_Fragment, { children: [_jsx("path", { d: path, fill: "none", stroke: "transparent", strokeWidth: 20, className: "react-flow__edge-interaction" }), _jsx("path", { d: path, fill: "none", stroke: stroke, strokeWidth: 1.5, strokeDasharray: isDashed ? '6 4' : undefined, markerEnd: markerEnd, style: { pointerEvents: 'none' } })] }));
288
+ }
289
+ //# sourceMappingURL=nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/subsystem/nodes.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,MAAM,EACN,QAAQ,GAIT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAA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,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Multi-repo path handling for subsystem graphs.
3
+ *
4
+ * A component's `file` is relative to ITS OWN repo root — the repo identified
5
+ * by its `purl` (`pkg:github/<owner>/<name>[#<path>]`) — never to the machine.
6
+ * When a graph spans several repos the sidebar tree needs synthetic
7
+ * `<owner>/<name>/` prefixes to keep same-named paths apart; hosts resolve
8
+ * each file against `repoRoots[purlRepo] ?? repoRoot`.
9
+ */
10
+ /** Normalize a purl to its repo key: fragment and surrounding whitespace stripped. */
11
+ export declare function purlRepoKey(purl: string | undefined): string | undefined;
12
+ /** `owner/name` from a purl (`pkg:github/acme/widget#x/y.ts` → `acme/widget`). */
13
+ export declare function purlOwnerName(purl: string | undefined): string | undefined;
14
+ export interface TreeEntry {
15
+ /** Path as shown in the sidebar tree (repo-prefixed when multi-repo). */
16
+ displayPath: string;
17
+ /** The component's own file value — what hosts resolve + drawers open. */
18
+ file: string;
19
+ }
20
+ export interface TreePathMapping {
21
+ entries: TreeEntry[];
22
+ /** True when components span more than one repo (prefixes are shown). */
23
+ multiRepo: boolean;
24
+ /** displayPath → file. */
25
+ toFile: Map<string, string>;
26
+ /** file → displayPath (first component wins). */
27
+ toDisplay: Map<string, string>;
28
+ }
29
+ /**
30
+ * Build the sidebar tree's path set from components. Single-repo graphs (and
31
+ * purl-less components) keep bare `file` values; mixed-repo graphs prefix each
32
+ * entry with its purl's `owner/name` so the tree groups by repo.
33
+ */
34
+ export declare function buildTreePathMapping(components: ReadonlyArray<{
35
+ file?: string;
36
+ purl?: string;
37
+ }>): TreePathMapping;
38
+ export interface RepoGroup {
39
+ /** Purl repo key (`pkg:github/owner/name`) — undefined for purl-less components. */
40
+ repoKey?: string;
41
+ /** `owner` segment of the purl, when present. */
42
+ owner?: string;
43
+ /** Repository name segment of the purl, when present. */
44
+ repo?: string;
45
+ /** The group's files, bare `file` values (each tree scopes its own paths). */
46
+ entries: TreeEntry[];
47
+ }
48
+ /**
49
+ * Group components by repo for the multi-tree sidebar. Groups preserve
50
+ * first-appearance order; purl-less components land in a trailing unbadged
51
+ * group. Entries carry bare `file` values — separate trees scope their own
52
+ * path sets, so no synthetic prefixes are needed.
53
+ */
54
+ export declare function buildRepoGroups(components: ReadonlyArray<{
55
+ file?: string;
56
+ purl?: string;
57
+ }>): {
58
+ multiRepo: boolean;
59
+ groups: RepoGroup[];
60
+ };
61
+ /** GitHub owner-avatar URL for a purl, or undefined for non-github hosts. */
62
+ export declare function repoAvatarUrl(purl: string | undefined): string | undefined;
63
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/subsystem/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIxE;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO1E;AAED,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,iDAAiD;IACjD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,eAAe,CAmBjH;AAOD,MAAM,WAAW,SAAS;IACxB,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG;IAC5F,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAwBA;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAI1E"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Multi-repo path handling for subsystem graphs.
3
+ *
4
+ * A component's `file` is relative to ITS OWN repo root — the repo identified
5
+ * by its `purl` (`pkg:github/<owner>/<name>[#<path>]`) — never to the machine.
6
+ * When a graph spans several repos the sidebar tree needs synthetic
7
+ * `<owner>/<name>/` prefixes to keep same-named paths apart; hosts resolve
8
+ * each file against `repoRoots[purlRepo] ?? repoRoot`.
9
+ */
10
+ /** Normalize a purl to its repo key: fragment and surrounding whitespace stripped. */
11
+ export function purlRepoKey(purl) {
12
+ if (!purl)
13
+ return undefined;
14
+ const base = purl.split('#')[0]?.trim();
15
+ return base || undefined;
16
+ }
17
+ /** `owner/name` from a purl (`pkg:github/acme/widget#x/y.ts` → `acme/widget`). */
18
+ export function purlOwnerName(purl) {
19
+ const key = purlRepoKey(purl);
20
+ if (!key)
21
+ return undefined;
22
+ // pkg:<type>/<owner>/<name> → take the last two segments.
23
+ const parts = key.split('/').filter(Boolean);
24
+ if (parts.length < 2)
25
+ return undefined;
26
+ return `${parts[parts.length - 2]}/${parts[parts.length - 1]}`;
27
+ }
28
+ /**
29
+ * Build the sidebar tree's path set from components. Single-repo graphs (and
30
+ * purl-less components) keep bare `file` values; mixed-repo graphs prefix each
31
+ * entry with its purl's `owner/name` so the tree groups by repo.
32
+ */
33
+ export function buildTreePathMapping(components) {
34
+ const withFiles = components.filter((c) => c.file);
35
+ const repos = new Set(withFiles.map((c) => purlRepoKey(c.purl)).filter((k) => !!k));
36
+ const multiRepo = repos.size > 1;
37
+ const entries = [];
38
+ const toFile = new Map();
39
+ const toDisplay = new Map();
40
+ for (const c of withFiles) {
41
+ const ownerName = multiRepo ? purlOwnerName(c.purl) : undefined;
42
+ const displayPath = ownerName ? `${ownerName}/${c.file}` : c.file;
43
+ if (toFile.has(displayPath))
44
+ continue;
45
+ entries.push({ displayPath, file: c.file });
46
+ toFile.set(displayPath, c.file);
47
+ if (!toDisplay.has(c.file))
48
+ toDisplay.set(c.file, displayPath);
49
+ }
50
+ return { entries, multiRepo, toFile, toDisplay };
51
+ }
52
+ /**
53
+ * Group components by repo for the multi-tree sidebar. Groups preserve
54
+ * first-appearance order; purl-less components land in a trailing unbadged
55
+ * group. Entries carry bare `file` values — separate trees scope their own
56
+ * path sets, so no synthetic prefixes are needed.
57
+ */
58
+ export function buildRepoGroups(components) {
59
+ const withFiles = components.filter((c) => c.file);
60
+ const repos = new Set(withFiles.map((c) => purlRepoKey(c.purl)).filter((k) => !!k));
61
+ const multiRepo = repos.size > 1;
62
+ const byKey = new Map();
63
+ const order = [];
64
+ for (const c of withFiles) {
65
+ const key = purlRepoKey(c.purl);
66
+ let group = byKey.get(key ?? '');
67
+ if (!group) {
68
+ const ownerName = key ? purlOwnerName(c.purl) : undefined;
69
+ const [owner, repo] = ownerName?.split('/') ?? [];
70
+ group = { repoKey: key, owner, repo, entries: [] };
71
+ byKey.set(key ?? '', group);
72
+ order.push(key);
73
+ }
74
+ if (!group.entries.some((e) => e.file === c.file)) {
75
+ group.entries.push({ displayPath: c.file, file: c.file });
76
+ }
77
+ }
78
+ return { multiRepo, groups: order.map((k) => byKey.get(k ?? '')) };
79
+ }
80
+ /** GitHub owner-avatar URL for a purl, or undefined for non-github hosts. */
81
+ export function repoAvatarUrl(purl) {
82
+ const key = purlRepoKey(purl);
83
+ const match = key?.match(/^pkg:github\/([^/]+)\//);
84
+ return match ? `https://github.com/${match[1]}.png?size=64` : undefined;
85
+ }
86
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/subsystem/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sFAAsF;AACtF,MAAM,UAAU,WAAW,CAAC,IAAwB;IAClD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACxC,OAAO,IAAI,IAAI,SAAS,CAAC;AAC3B,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,IAAwB;IACpD,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,0DAA0D;IAC1D,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AACjE,CAAC;AAmBD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAA2D;IAC9F,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,C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I,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE;YACjD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,IAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAK,EAAE,CAAC,CAAC;SAC7D;KACF;IACD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAE,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,IAAwB;IACpD,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,GAAG,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC,CAAC,CAAC,sBAAsB,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tokenize a SubsystemComponent into a flat token stream for the detail panel.
3
+ *
4
+ * Pipeline: generate declaration string → format with Prettier → tokenize
5
+ * with Shiki + Pierre themes. The `component.tokens` field, when present,
6
+ * overrides the entire pipeline (for pre-tokenized data from graphify).
7
+ *
8
+ * This function is async because Prettier's format() is async.
9
+ */
10
+ import type { PierreSyntaxThemeName } from '../pierre/pierreSyntaxTheme';
11
+ import type { SubsystemComponent, SubsystemDeclToken } from './model';
12
+ /**
13
+ * Tokenize a SubsystemComponent into SubsystemDeclToken[].
14
+ *
15
+ * When `component.tokens` is present (pre-tokenized data from the wire),
16
+ * it's returned as-is. Otherwise the pipeline generates a TypeScript
17
+ * declaration string, formats it with Prettier, and tokenizes the output.
18
+ */
19
+ export declare function tokenizeComponent(component: SubsystemComponent, printWidth?: number, themeName?: PierreSyntaxThemeName): Promise<SubsystemDeclToken[]>;
20
+ //# sourceMappingURL=tokenizeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizeComponent.d.ts","sourceRoot":"","sources":["../../src/subsystem/tokenizeComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAyBtE;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,kBAAkB,EAC7B,UAAU,SAAK,EACf,SAAS,GAAE,qBAAqC,GAC/C,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsB/B"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Tokenize a SubsystemComponent into a flat token stream for the detail panel.
3
+ *
4
+ * Pipeline: generate declaration string → format with Prettier → tokenize
5
+ * with Shiki + Pierre themes. The `component.tokens` field, when present,
6
+ * overrides the entire pipeline (for pre-tokenized data from graphify).
7
+ *
8
+ * This function is async because Prettier's format() is async.
9
+ */
10
+ import { generateDeclarationString } from './formatDeclaration';
11
+ import { tokenizeFormatted } from './tokenizeFormatted';
12
+ // Lazy-loaded Prettier to avoid startup cost.
13
+ let prettierPromise = null;
14
+ let prettierPluginsPromise = null;
15
+ async function getPrettier() {
16
+ if (!prettierPromise) {
17
+ prettierPromise = import('prettier/standalone');
18
+ }
19
+ if (!prettierPluginsPromise) {
20
+ prettierPluginsPromise = Promise.all([
21
+ import('prettier/plugins/typescript'),
22
+ import('prettier/plugins/estree'),
23
+ ]).then(([typescript, estree]) => ({ typescript, estree }));
24
+ }
25
+ const [prettier, plugins] = await Promise.all([prettierPromise, prettierPluginsPromise]);
26
+ return { prettier, plugins };
27
+ }
28
+ /**
29
+ * Tokenize a SubsystemComponent into SubsystemDeclToken[].
30
+ *
31
+ * When `component.tokens` is present (pre-tokenized data from the wire),
32
+ * it's returned as-is. Otherwise the pipeline generates a TypeScript
33
+ * declaration string, formats it with Prettier, and tokenizes the output.
34
+ */
35
+ export async function tokenizeComponent(component, printWidth = 80, themeName = 'pierre-dark') {
36
+ // Pre-tokenized tokens from the wire take precedence.
37
+ if (component.tokens)
38
+ return component.tokens;
39
+ // External kind — not valid TypeScript, bypass Prettier.
40
+ const kind = component.detail?.kind ?? component.construct;
41
+ if (kind === 'external') {
42
+ const label = component.detail?.kind === 'external' ? component.detail.label : component.name;
43
+ const escaped = label.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
44
+ return tokenizeFormatted(`external '${escaped}'`, themeName);
45
+ }
46
+ // Generate → format → tokenize
47
+ const raw = generateDeclarationString(component);
48
+ const { prettier, plugins } = await getPrettier();
49
+ const formatted = await prettier.format(raw, {
50
+ parser: 'typescript',
51
+ plugins: [plugins.typescript, plugins.estree],
52
+ printWidth,
53
+ });
54
+ return tokenizeFormatted(formatted, themeName);
55
+ }
56
+ //# sourceMappingURL=tokenizeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizeComponent.js","sourceRoot":"","sources":["../../src/subsystem/tokenizeComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,8CAA8C;AAC9C,IAAI,eAAe,GAAyD,IAAI,CAAC;AACjF,IAAI,sBAAsB,GAGd,IAAI,CAAC;AAEjB,KAAK,UAAU,WAAW;IACxB,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;KACjD;IACD,IAAI,CAAC,sBAAsB,EAAE;QAC3B,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC;YACnC,MAAM,CAAC,6BAA6B,CAAC;YACrC,MAAM,CAAC,yBAAyB,CAAC;S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MAAM,EAAE,YAAY;QACpB,OAAO,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC;QAC7C,UAAU;KACX,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tokenize a formatted TypeScript declaration string into SubsystemDeclToken[]
3
+ * using Shiki + Pierre themes (same highlighter stack as @pierre/diffs).
4
+ */
5
+ import type { PierreSyntaxThemeName } from '../pierre/pierreSyntaxTheme';
6
+ import type { SubsystemDeclToken } from './model';
7
+ /**
8
+ * Tokenize a formatted TypeScript string into SubsystemDeclToken[].
9
+ * The input should already be formatted by Prettier (or be valid TS).
10
+ */
11
+ export declare function tokenizeFormatted(code: string, themeName?: PierreSyntaxThemeName): Promise<SubsystemDeclToken[]>;
12
+ //# sourceMappingURL=tokenizeFormatted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizeFormatted.d.ts","sourceRoot":"","sources":["../../src/subsystem/tokenizeFormatted.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,qBAAqC,GAC/C,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAE/B"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tokenize a formatted TypeScript declaration string into SubsystemDeclToken[]
3
+ * using Shiki + Pierre themes (same highlighter stack as @pierre/diffs).
4
+ */
5
+ import { tokenizeWithPierreSyntax } from '../pierre/syntaxTokens';
6
+ /**
7
+ * Tokenize a formatted TypeScript string into SubsystemDeclToken[].
8
+ * The input should already be formatted by Prettier (or be valid TS).
9
+ */
10
+ export function tokenizeFormatted(code, themeName = 'pierre-dark') {
11
+ return tokenizeWithPierreSyntax(code, themeName);
12
+ }
13
+ //# sourceMappingURL=tokenizeFormatted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizeFormatted.js","sourceRoot":"","sources":["../../src/subsystem/tokenizeFormatted.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAIlE;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,YAAmC,aAAa;IAEhD,OAAO,wBAAwB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Animation mapping utilities
3
+ *
4
+ * Maps log levels and component events to appropriate animations
5
+ * for Milestone 1 default visualization behavior
6
+ */
7
+ import type { LogLevel } from '@principal-ai/subsystems-core';
8
+ /**
9
+ * Node animation configuration
10
+ */
11
+ export interface NodeAnimation {
12
+ type: 'pulse' | 'flash' | 'shake' | 'entry';
13
+ duration: number;
14
+ intensity?: number;
15
+ color?: string;
16
+ }
17
+ /**
18
+ * Edge animation configuration
19
+ */
20
+ export interface EdgeAnimation {
21
+ type: 'flow' | 'particle' | 'pulse' | 'glow';
22
+ duration: number;
23
+ direction?: 'forward' | 'backward' | 'bidirectional';
24
+ color?: string;
25
+ }
26
+ /**
27
+ * Map log level to node animation
28
+ *
29
+ * Default behavior for Milestone 1:
30
+ * - debug: subtle pulse (low intensity)
31
+ * - info: standard pulse (medium intensity)
32
+ * - warn: amber pulse (high intensity)
33
+ * - error: red flash + shake
34
+ */
35
+ export declare function logLevelToNodeAnimation(level: LogLevel): NodeAnimation;
36
+ /**
37
+ * Map component action to node animation (Milestone 2)
38
+ */
39
+ export declare function actionToNodeAnimation(_action: string, state?: string): NodeAnimation;
40
+ /**
41
+ * Get animation config for edge based on action (Milestone 2)
42
+ */
43
+ export declare function actionToEdgeAnimation(_action: string, edgeConfig?: EdgeAnimation): EdgeAnimation;
44
+ /**
45
+ * Check if log level should trigger animation
46
+ */
47
+ export declare function shouldAnimate(level: LogLevel, minLevel?: LogLevel): boolean;
48
+ /**
49
+ * Calculate animation intensity based on frequency
50
+ * Used to adjust animation intensity when multiple logs occur rapidly
51
+ */
52
+ export declare function calculateIntensity(baseIntensity: number, eventCount: number, _timeWindow?: number): number;
53
+ //# sourceMappingURL=animationMapping.d.ts.map