@principal-ai/subsystems-react 0.20.6 → 0.21.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 (270) hide show
  1. package/README.md +1 -1
  2. package/dist/graphify/anchor.d.ts +17 -0
  3. package/dist/graphify/anchor.d.ts.map +1 -1
  4. package/dist/graphify/anchor.js +41 -0
  5. package/dist/graphify/anchor.js.map +1 -1
  6. package/dist/graphify/consolidated.d.ts +40 -1
  7. package/dist/graphify/consolidated.d.ts.map +1 -1
  8. package/dist/index.d.ts +5 -5
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/index.js.map +1 -1
  12. package/dist/pierre/{PierreThroughlineCodeView.d.ts → PierreWalkthroughCodeView.d.ts} +7 -7
  13. package/dist/pierre/{PierreThroughlineCodeView.d.ts.map → PierreWalkthroughCodeView.d.ts.map} +1 -1
  14. package/dist/pierre/{PierreThroughlineCodeView.js → PierreWalkthroughCodeView.js} +28 -36
  15. package/dist/pierre/PierreWalkthroughCodeView.js.map +1 -0
  16. package/dist/pierre/index.d.ts +2 -2
  17. package/dist/pierre/index.js +1 -1
  18. package/dist/pierre/pierreFileLang.d.ts +1 -1
  19. package/dist/pierre/pierreFileLang.js +1 -1
  20. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +14 -2
  21. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -1
  22. package/dist/stories/Subsystem/ComponentGraph/fixtures.js +86 -20
  23. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -1
  24. package/dist/subsystem/FileDrawer.d.ts +2 -2
  25. package/dist/subsystem/FileDrawer.js +2 -2
  26. package/dist/subsystem/SubsystemComponentGraph.d.ts +25 -24
  27. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  28. package/dist/subsystem/SubsystemComponentGraph.js +204 -199
  29. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  30. package/dist/subsystem/formatDeclaration.d.ts +2 -1
  31. package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
  32. package/dist/subsystem/formatDeclaration.js +57 -33
  33. package/dist/subsystem/formatDeclaration.js.map +1 -1
  34. package/dist/subsystem/model.d.ts +85 -35
  35. package/dist/subsystem/model.d.ts.map +1 -1
  36. package/dist/subsystem/model.js +85 -6
  37. package/dist/subsystem/model.js.map +1 -1
  38. package/dist/subsystem/nodes.d.ts.map +1 -1
  39. package/dist/subsystem/nodes.js +30 -13
  40. package/dist/subsystem/nodes.js.map +1 -1
  41. package/dist/subsystem/tokenizeComponent.js +2 -2
  42. package/dist/subsystem/tokenizeComponent.js.map +1 -1
  43. package/package.json +3 -3
  44. package/src/graphify/anchor.test.ts +31 -2
  45. package/src/graphify/anchor.ts +46 -0
  46. package/src/graphify/consolidated.ts +43 -1
  47. package/src/index.ts +13 -5
  48. package/src/pierre/{PierreThroughlineCodeView.tsx → PierreWalkthroughCodeView.tsx} +39 -47
  49. package/src/pierre/index.ts +2 -2
  50. package/src/pierre/pierreFileLang.ts +1 -1
  51. package/src/stories/Pierre/CodeView.stories.tsx +3 -3
  52. package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +14 -14
  53. package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +13 -15
  54. package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +8 -8
  55. package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +14 -14
  56. package/src/stories/Subsystem/ComponentGraph/CustomEntities.stories.tsx +11 -10
  57. package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +13 -14
  58. package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +31 -66
  59. package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +2 -2
  60. package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +4 -4
  61. package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +3 -3
  62. package/src/stories/Subsystem/ComponentGraph/Proposed.stories.tsx +1 -1
  63. package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +518 -33
  64. package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +13 -13
  65. package/src/stories/Subsystem/ComponentGraph/fixtures.ts +105 -21
  66. package/src/subsystem/FileDrawer.tsx +2 -2
  67. package/src/subsystem/SubsystemComponentGraph.tsx +268 -259
  68. package/src/subsystem/formatDeclaration.test.ts +76 -1
  69. package/src/subsystem/formatDeclaration.ts +57 -33
  70. package/src/subsystem/model.test.ts +27 -15
  71. package/src/subsystem/model.ts +175 -45
  72. package/src/subsystem/nodes.tsx +47 -13
  73. package/src/subsystem/tokenizeComponent.ts +2 -2
  74. package/dist/components/ConfigurationSelector.d.ts +0 -35
  75. package/dist/components/ConfigurationSelector.d.ts.map +0 -1
  76. package/dist/components/ConfigurationSelector.js +0 -63
  77. package/dist/components/ConfigurationSelector.js.map +0 -1
  78. package/dist/components/GraphRenderer.d.ts +0 -295
  79. package/dist/components/GraphRenderer.d.ts.map +0 -1
  80. package/dist/components/GraphRenderer.js +0 -2008
  81. package/dist/components/GraphRenderer.js.map +0 -1
  82. package/dist/components/MultiCanvasRenderer.d.ts +0 -75
  83. package/dist/components/MultiCanvasRenderer.d.ts.map +0 -1
  84. package/dist/components/MultiCanvasRenderer.js +0 -203
  85. package/dist/components/MultiCanvasRenderer.js.map +0 -1
  86. package/dist/components/NodeTooltip.d.ts +0 -24
  87. package/dist/components/NodeTooltip.d.ts.map +0 -1
  88. package/dist/components/NodeTooltip.js +0 -160
  89. package/dist/components/NodeTooltip.js.map +0 -1
  90. package/dist/components/SelectionSidebar.d.ts +0 -18
  91. package/dist/components/SelectionSidebar.d.ts.map +0 -1
  92. package/dist/components/SelectionSidebar.js +0 -190
  93. package/dist/components/SelectionSidebar.js.map +0 -1
  94. package/dist/components/SequenceDiagramRenderer.d.ts +0 -77
  95. package/dist/components/SequenceDiagramRenderer.d.ts.map +0 -1
  96. package/dist/components/SequenceDiagramRenderer.js +0 -604
  97. package/dist/components/SequenceDiagramRenderer.js.map +0 -1
  98. package/dist/components/WorkflowSequenceDiagram.d.ts +0 -63
  99. package/dist/components/WorkflowSequenceDiagram.d.ts.map +0 -1
  100. package/dist/components/WorkflowSequenceDiagram.js +0 -147
  101. package/dist/components/WorkflowSequenceDiagram.js.map +0 -1
  102. package/dist/components/dashboard/DashboardRenderer.d.ts +0 -10
  103. package/dist/components/dashboard/DashboardRenderer.d.ts.map +0 -1
  104. package/dist/components/dashboard/DashboardRenderer.js +0 -179
  105. package/dist/components/dashboard/DashboardRenderer.js.map +0 -1
  106. package/dist/components/dashboard/MetricPanel.d.ts +0 -10
  107. package/dist/components/dashboard/MetricPanel.d.ts.map +0 -1
  108. package/dist/components/dashboard/MetricPanel.js +0 -103
  109. package/dist/components/dashboard/MetricPanel.js.map +0 -1
  110. package/dist/components/dashboard/MockDataProvider.d.ts +0 -30
  111. package/dist/components/dashboard/MockDataProvider.d.ts.map +0 -1
  112. package/dist/components/dashboard/MockDataProvider.js +0 -270
  113. package/dist/components/dashboard/MockDataProvider.js.map +0 -1
  114. package/dist/components/dashboard/components/BarChart.d.ts +0 -10
  115. package/dist/components/dashboard/components/BarChart.d.ts.map +0 -1
  116. package/dist/components/dashboard/components/BarChart.js +0 -167
  117. package/dist/components/dashboard/components/BarChart.js.map +0 -1
  118. package/dist/components/dashboard/components/LineChart.d.ts +0 -10
  119. package/dist/components/dashboard/components/LineChart.d.ts.map +0 -1
  120. package/dist/components/dashboard/components/LineChart.js +0 -141
  121. package/dist/components/dashboard/components/LineChart.js.map +0 -1
  122. package/dist/components/dashboard/components/MetricCard.d.ts +0 -9
  123. package/dist/components/dashboard/components/MetricCard.d.ts.map +0 -1
  124. package/dist/components/dashboard/components/MetricCard.js +0 -163
  125. package/dist/components/dashboard/components/MetricCard.js.map +0 -1
  126. package/dist/components/dashboard/components/SourceLink.d.ts +0 -9
  127. package/dist/components/dashboard/components/SourceLink.d.ts.map +0 -1
  128. package/dist/components/dashboard/components/SourceLink.js +0 -39
  129. package/dist/components/dashboard/components/SourceLink.js.map +0 -1
  130. package/dist/components/dashboard/components/TimeRangeSelector.d.ts +0 -9
  131. package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +0 -1
  132. package/dist/components/dashboard/components/TimeRangeSelector.js +0 -167
  133. package/dist/components/dashboard/components/TimeRangeSelector.js.map +0 -1
  134. package/dist/components/dashboard/components/index.d.ts +0 -6
  135. package/dist/components/dashboard/components/index.d.ts.map +0 -1
  136. package/dist/components/dashboard/components/index.js +0 -6
  137. package/dist/components/dashboard/components/index.js.map +0 -1
  138. package/dist/components/dashboard/index.d.ts +0 -6
  139. package/dist/components/dashboard/index.d.ts.map +0 -1
  140. package/dist/components/dashboard/index.js +0 -8
  141. package/dist/components/dashboard/index.js.map +0 -1
  142. package/dist/components/dashboard/types.d.ts +0 -74
  143. package/dist/components/dashboard/types.d.ts.map +0 -1
  144. package/dist/components/dashboard/types.js +0 -8
  145. package/dist/components/dashboard/types.js.map +0 -1
  146. package/dist/components/state-view/PipelineView.d.ts +0 -14
  147. package/dist/components/state-view/PipelineView.d.ts.map +0 -1
  148. package/dist/components/state-view/PipelineView.js +0 -195
  149. package/dist/components/state-view/PipelineView.js.map +0 -1
  150. package/dist/components/state-view/index.d.ts +0 -14
  151. package/dist/components/state-view/index.d.ts.map +0 -1
  152. package/dist/components/state-view/index.js +0 -12
  153. package/dist/components/state-view/index.js.map +0 -1
  154. package/dist/components/state-view/types.d.ts +0 -188
  155. package/dist/components/state-view/types.d.ts.map +0 -1
  156. package/dist/components/state-view/types.js +0 -10
  157. package/dist/components/state-view/types.js.map +0 -1
  158. package/dist/components/state-view/useStateView.d.ts +0 -32
  159. package/dist/components/state-view/useStateView.d.ts.map +0 -1
  160. package/dist/components/state-view/useStateView.js +0 -129
  161. package/dist/components/state-view/useStateView.js.map +0 -1
  162. package/dist/contexts/GraphEditContext.d.ts +0 -20
  163. package/dist/contexts/GraphEditContext.d.ts.map +0 -1
  164. package/dist/contexts/GraphEditContext.js +0 -8
  165. package/dist/contexts/GraphEditContext.js.map +0 -1
  166. package/dist/contexts/TooltipPortalContext.d.ts +0 -8
  167. package/dist/contexts/TooltipPortalContext.d.ts.map +0 -1
  168. package/dist/contexts/TooltipPortalContext.js +0 -8
  169. package/dist/contexts/TooltipPortalContext.js.map +0 -1
  170. package/dist/edges/CustomEdge.d.ts +0 -24
  171. package/dist/edges/CustomEdge.d.ts.map +0 -1
  172. package/dist/edges/CustomEdge.js +0 -222
  173. package/dist/edges/CustomEdge.js.map +0 -1
  174. package/dist/edges/GenericEdge.d.ts +0 -18
  175. package/dist/edges/GenericEdge.d.ts.map +0 -1
  176. package/dist/edges/GenericEdge.js +0 -10
  177. package/dist/edges/GenericEdge.js.map +0 -1
  178. package/dist/graphify/kind.d.ts +0 -23
  179. package/dist/graphify/kind.d.ts.map +0 -1
  180. package/dist/graphify/kind.js +0 -77
  181. package/dist/graphify/kind.js.map +0 -1
  182. package/dist/hooks/usePathBasedEvents.d.ts +0 -42
  183. package/dist/hooks/usePathBasedEvents.d.ts.map +0 -1
  184. package/dist/hooks/usePathBasedEvents.js +0 -119
  185. package/dist/hooks/usePathBasedEvents.js.map +0 -1
  186. package/dist/hooks/useSequenceLayout.d.ts +0 -186
  187. package/dist/hooks/useSequenceLayout.d.ts.map +0 -1
  188. package/dist/hooks/useSequenceLayout.js +0 -327
  189. package/dist/hooks/useSequenceLayout.js.map +0 -1
  190. package/dist/hooks/useUndoRedo.d.ts +0 -80
  191. package/dist/hooks/useUndoRedo.d.ts.map +0 -1
  192. package/dist/hooks/useUndoRedo.js +0 -70
  193. package/dist/hooks/useUndoRedo.js.map +0 -1
  194. package/dist/nodes/CustomNode.d.ts +0 -28
  195. package/dist/nodes/CustomNode.d.ts.map +0 -1
  196. package/dist/nodes/CustomNode.js +0 -820
  197. package/dist/nodes/CustomNode.js.map +0 -1
  198. package/dist/nodes/GenericNode.d.ts +0 -20
  199. package/dist/nodes/GenericNode.d.ts.map +0 -1
  200. package/dist/nodes/GenericNode.js +0 -20
  201. package/dist/nodes/GenericNode.js.map +0 -1
  202. package/dist/nodes/otel/OtelBoundaryNode.d.ts +0 -55
  203. package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +0 -1
  204. package/dist/nodes/otel/OtelBoundaryNode.js +0 -81
  205. package/dist/nodes/otel/OtelBoundaryNode.js.map +0 -1
  206. package/dist/nodes/otel/OtelEventNode.d.ts +0 -59
  207. package/dist/nodes/otel/OtelEventNode.d.ts.map +0 -1
  208. package/dist/nodes/otel/OtelEventNode.js +0 -82
  209. package/dist/nodes/otel/OtelEventNode.js.map +0 -1
  210. package/dist/nodes/otel/OtelResourceNode.d.ts +0 -53
  211. package/dist/nodes/otel/OtelResourceNode.d.ts.map +0 -1
  212. package/dist/nodes/otel/OtelResourceNode.js +0 -105
  213. package/dist/nodes/otel/OtelResourceNode.js.map +0 -1
  214. package/dist/nodes/otel/OtelScopeNode.d.ts +0 -53
  215. package/dist/nodes/otel/OtelScopeNode.d.ts.map +0 -1
  216. package/dist/nodes/otel/OtelScopeNode.js +0 -81
  217. package/dist/nodes/otel/OtelScopeNode.js.map +0 -1
  218. package/dist/nodes/otel/OtelSpanConventionNode.d.ts +0 -61
  219. package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +0 -1
  220. package/dist/nodes/otel/OtelSpanConventionNode.js +0 -131
  221. package/dist/nodes/otel/OtelSpanConventionNode.js.map +0 -1
  222. package/dist/nodes/otel/index.d.ts +0 -17
  223. package/dist/nodes/otel/index.d.ts.map +0 -1
  224. package/dist/nodes/otel/index.js +0 -13
  225. package/dist/nodes/otel/index.js.map +0 -1
  226. package/dist/nodes/otel/shared/NodeBadges.d.ts +0 -10
  227. package/dist/nodes/otel/shared/NodeBadges.d.ts.map +0 -1
  228. package/dist/nodes/otel/shared/NodeBadges.js +0 -178
  229. package/dist/nodes/otel/shared/NodeBadges.js.map +0 -1
  230. package/dist/nodes/otel/shared/NodeContent.d.ts +0 -10
  231. package/dist/nodes/otel/shared/NodeContent.d.ts.map +0 -1
  232. package/dist/nodes/otel/shared/NodeContent.js +0 -96
  233. package/dist/nodes/otel/shared/NodeContent.js.map +0 -1
  234. package/dist/nodes/otel/shared/index.d.ts +0 -8
  235. package/dist/nodes/otel/shared/index.d.ts.map +0 -1
  236. package/dist/nodes/otel/shared/index.js +0 -8
  237. package/dist/nodes/otel/shared/index.js.map +0 -1
  238. package/dist/nodes/otel/shared/types.d.ts +0 -129
  239. package/dist/nodes/otel/shared/types.d.ts.map +0 -1
  240. package/dist/nodes/otel/shared/types.js +0 -5
  241. package/dist/nodes/otel/shared/types.js.map +0 -1
  242. package/dist/nodes/otel/shared/useNodeBehavior.d.ts +0 -42
  243. package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +0 -1
  244. package/dist/nodes/otel/shared/useNodeBehavior.js +0 -61
  245. package/dist/nodes/otel/shared/useNodeBehavior.js.map +0 -1
  246. package/dist/pierre/PierreThroughlineCodeView.js.map +0 -1
  247. package/dist/subsystem/SubsystemCarousel.d.ts +0 -36
  248. package/dist/subsystem/SubsystemCarousel.d.ts.map +0 -1
  249. package/dist/subsystem/SubsystemCarousel.js +0 -163
  250. package/dist/subsystem/SubsystemCarousel.js.map +0 -1
  251. package/dist/utils/animationMapping.d.ts +0 -53
  252. package/dist/utils/animationMapping.d.ts.map +0 -1
  253. package/dist/utils/animationMapping.js +0 -126
  254. package/dist/utils/animationMapping.js.map +0 -1
  255. package/dist/utils/canvasBounds.d.ts +0 -50
  256. package/dist/utils/canvasBounds.d.ts.map +0 -1
  257. package/dist/utils/canvasBounds.js +0 -88
  258. package/dist/utils/canvasBounds.js.map +0 -1
  259. package/dist/utils/graphConverter.d.ts +0 -18
  260. package/dist/utils/graphConverter.d.ts.map +0 -1
  261. package/dist/utils/graphConverter.js +0 -114
  262. package/dist/utils/graphConverter.js.map +0 -1
  263. package/dist/utils/iconResolver.d.ts +0 -29
  264. package/dist/utils/iconResolver.d.ts.map +0 -1
  265. package/dist/utils/iconResolver.js +0 -30
  266. package/dist/utils/iconResolver.js.map +0 -1
  267. package/dist/utils/orientationUtils.d.ts +0 -19
  268. package/dist/utils/orientationUtils.d.ts.map +0 -1
  269. package/dist/utils/orientationUtils.js +0 -62
  270. package/dist/utils/orientationUtils.js.map +0 -1
@@ -155,7 +155,7 @@ const nodeSpotlights: Array<{ label: string; component: SubsystemComponent; note
155
155
  file: 'packages/subsystems-studio/src/bun/analysis.ts',
156
156
  purl: corePurl,
157
157
  symbol: 'AnalysisStatus',
158
- detail: {
158
+ declaration: {
159
159
  kind: 'type',
160
160
  properties: [
161
161
  { name: 'state', type: "'idle' | 'running' | 'done'" },
@@ -189,7 +189,7 @@ const nodeSpotlights: Array<{ label: string; component: SubsystemComponent; note
189
189
  file: 'packages/subsystems-studio/src/bun/verify.ts',
190
190
  purl: corePurl,
191
191
  symbol: 'VerificationPhase',
192
- detail: {
192
+ declaration: {
193
193
  kind: 'type',
194
194
  properties: [{ name: 'idle' }, { name: 'checking' }, { name: 'done' }],
195
195
  usedBy: [],
@@ -261,7 +261,7 @@ const nodeSpotlights: Array<{ label: string; component: SubsystemComponent; note
261
261
  file: 'src/session/SessionCache.ts',
262
262
  purl: 'pkg:github/principal-ai/agent-monitoring',
263
263
  symbol: 'SessionCache',
264
- detail: {
264
+ declaration: {
265
265
  kind: 'class',
266
266
  methods: [{ nodeId: 'm1', name: 'put', parameters: [{ type: 'SessionRecord' }] }],
267
267
  properties: [],
@@ -282,7 +282,7 @@ const nodeSpotlights: Array<{ label: string; component: SubsystemComponent; note
282
282
  file: 'src/session/SessionCache.ts',
283
283
  purl: 'pkg:github/principal-ai/agent-monitoring',
284
284
  symbol: 'SessionCache.put',
285
- detail: {
285
+ declaration: {
286
286
  kind: 'method',
287
287
  hostClass: 'SessionCache',
288
288
  parameters: [{ type: 'SessionRecord' }],
@@ -299,7 +299,7 @@ const nodeSpotlights: Array<{ label: string; component: SubsystemComponent; note
299
299
  file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts',
300
300
  purl: corePurl,
301
301
  purpose: 'retained state — anchored to a state location',
302
- detail: { kind: 'store', properties: [{ name: 'ROOT', type: 'string' }, { name: 'INDEX_PATH', type: 'string' }] },
302
+ declaration: { kind: 'store', properties: [{ name: 'ROOT', type: 'string' }, { name: 'INDEX_PATH', type: 'string' }] },
303
303
  },
304
304
  },
305
305
  {
@@ -495,7 +495,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
495
495
  construct: 'store',
496
496
  file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts',
497
497
  purl: corePurl,
498
- detail: {
498
+ declaration: {
499
499
  kind: 'store',
500
500
  properties: [
501
501
  { name: 'ROOT', type: 'string' },
@@ -516,7 +516,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
516
516
  file: 'src/session/SessionCache.ts',
517
517
  purl: 'pkg:github/principal-ai/agent-monitoring',
518
518
  symbol: 'SessionCache',
519
- detail: {
519
+ declaration: {
520
520
  kind: 'class',
521
521
  methods: [
522
522
  { nodeId: 'cm1', name: 'put', parameters: [{ type: 'SessionRecord' }] },
@@ -540,7 +540,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
540
540
  file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts',
541
541
  purl: corePurl,
542
542
  symbol: 'getSubsystemModel',
543
- detail: {
543
+ declaration: {
544
544
  kind: 'function',
545
545
  parameters: [{ name: 'graphId', type: 'string' }],
546
546
  returnType: 'Promise<StoredSubsystemModel | null>',
@@ -560,7 +560,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
560
560
  purl: corePurl,
561
561
  symbol: 'StudioMessages',
562
562
  role: 'entry',
563
- detail: {
563
+ declaration: {
564
564
  kind: 'type',
565
565
  properties: [
566
566
  { name: 'subsystemModelChanged', type: 'push' },
@@ -581,7 +581,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
581
581
  file: 'src/session/SessionCache.ts',
582
582
  purl: 'pkg:github/principal-ai/agent-monitoring',
583
583
  symbol: 'SessionCache.put',
584
- detail: {
584
+ declaration: {
585
585
  kind: 'method',
586
586
  hostClass: 'SessionCache',
587
587
  parameters: [{ name: 'record', type: 'SessionRecord' }],
@@ -599,7 +599,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
599
599
  file: 'packages/subsystems-studio/src/bun/analysis.ts',
600
600
  purl: corePurl,
601
601
  symbol: 'AnalysisStatus',
602
- detail: {
602
+ declaration: {
603
603
  kind: 'type',
604
604
  properties: [{ name: 'state', type: "'idle' | 'running'" }],
605
605
  usedBy: [],
@@ -617,7 +617,7 @@ const anatomyComponents: Array<{ label: string; component: SubsystemComponent; n
617
617
  file: 'packages/subsystems-studio/src/bun/verify.ts',
618
618
  purl: corePurl,
619
619
  symbol: 'VerificationPhase',
620
- detail: {
620
+ declaration: {
621
621
  kind: 'type',
622
622
  properties: [{ name: 'idle' }, { name: 'checking' }, { name: 'done' }],
623
623
  usedBy: [],
@@ -639,7 +639,7 @@ function AnatomySpotlightsDemo() {
639
639
  {label} — {note}
640
640
  </div>
641
641
  <Row>
642
- <JsonCard label="the data — component.detail" value={component.detail} width={320} />
642
+ <JsonCard label="the data — component.declaration" value={component.declaration} width={320} />
643
643
  <RenderPane label="the rendering — ComponentDeclaration">
644
644
  <div style={{ width: 360 }}>
645
645
  <ComponentDeclaration component={component} />
@@ -1,16 +1,21 @@
1
1
  import type {
2
2
  SubsystemComponent,
3
3
  SubsystemComponentEdge,
4
+ SubsystemRelation,
5
+ SubsystemRelationType,
6
+ SubsystemWalkthrough,
7
+ SubsystemWalkthroughMechanism,
4
8
  } from '../../../subsystem/model';
9
+ import { derivedGraphEdgeId } from '../../../subsystem/model';
5
10
  import type { GraphifyComponentDetail } from '../../../graphify';
6
11
 
7
12
  // ---------------------------------------------------------------------------
8
13
  // Build a subsystem graph from a compact spec - helpers
9
14
  // ---------------------------------------------------------------------------
10
15
  export function components(
11
- spec: Array<[id: string, name: string, construct: SubsystemComponent['construct'], file: string, purl: string, purpose?: string, symbol?: string, detail?: GraphifyComponentDetail]>,
16
+ spec: Array<[id: string, name: string, construct: SubsystemComponent['construct'], file: string, purl: string, purpose?: string, symbol?: string, declaration?: GraphifyComponentDetail]>,
12
17
  ): SubsystemComponent[] {
13
- return spec.map(([id, name, construct, file, purl, purpose, symbol, detail]) => ({
18
+ return spec.map(([id, name, construct, file, purl, purpose, symbol, declaration]) => ({
14
19
  id,
15
20
  name,
16
21
  construct,
@@ -18,10 +23,56 @@ export function components(
18
23
  purl,
19
24
  purpose,
20
25
  symbol,
21
- detail,
26
+ declaration,
22
27
  }));
23
28
  }
24
29
 
30
+ const RELATION_TYPES = new Set<string>([
31
+ 'imports',
32
+ 'imports_from',
33
+ 're_exports',
34
+ 'defines',
35
+ 'extends',
36
+ 'inherits',
37
+ 'implements',
38
+ 'mixes_in',
39
+ 'method',
40
+ 'references',
41
+ 'contains',
42
+ ]);
43
+
44
+ export function relations(
45
+ spec: Array<[from: string, to: string, relationType: SubsystemRelationType, refs?: string[]]>,
46
+ ): SubsystemRelation[] {
47
+ return spec.map(([from, to, relationType, refs], i) => ({
48
+ id: `r${i}`,
49
+ from,
50
+ to,
51
+ relationType,
52
+ refs,
53
+ }));
54
+ }
55
+
56
+ /** Story helper: one walkthrough whose hops derive Set B display edges. */
57
+ export function walkthroughFromHops(
58
+ id: string,
59
+ title: string,
60
+ hops: Array<[from: string, to: string, mechanism: SubsystemWalkthroughMechanism, file: string, line: number]>,
61
+ ): SubsystemWalkthrough {
62
+ return {
63
+ id,
64
+ title,
65
+ steps: hops.map(([from, to, mechanism, file, line]) => ({
66
+ from,
67
+ to,
68
+ mechanism,
69
+ file,
70
+ line,
71
+ })),
72
+ };
73
+ }
74
+
75
+ /** @deprecated story helper — prefer `relations` + `walkthroughFromHops`. */
25
76
  export function edges(
26
77
  spec: Array<[from: string, to: string, mechanism: SubsystemComponentEdge['mechanism'], refs?: string[]]>,
27
78
  ): SubsystemComponentEdge[] {
@@ -34,6 +85,40 @@ export function edges(
34
85
  }));
35
86
  }
36
87
 
88
+ /** Split mixed mechanism lists into relations + optional walkthrough for stories. */
89
+ export function graphSpecFromEdges(
90
+ spec: Array<[from: string, to: string, mechanism: SubsystemComponentEdge['mechanism'], refs?: string[]]>,
91
+ ): { relations: SubsystemRelation[]; walkthroughs?: SubsystemWalkthrough[] } {
92
+ const rels: SubsystemRelation[] = [];
93
+ const hops: SubsystemWalkthrough['steps'] = [];
94
+ for (const [from, to, mechanism, refs] of spec) {
95
+ if (RELATION_TYPES.has(mechanism)) {
96
+ rels.push({
97
+ id: derivedGraphEdgeId(from, to, mechanism as SubsystemRelationType),
98
+ from,
99
+ to,
100
+ relationType: mechanism as SubsystemRelationType,
101
+ refs,
102
+ });
103
+ } else {
104
+ hops.push({
105
+ from,
106
+ to,
107
+ mechanism: mechanism as SubsystemWalkthroughMechanism,
108
+ file: 'story-placeholder.ts',
109
+ line: 1,
110
+ });
111
+ }
112
+ }
113
+ return {
114
+ relations: rels,
115
+ walkthroughs:
116
+ hops.length > 0
117
+ ? [{ id: 'story-hops', title: 'Story hops', steps: hops }]
118
+ : undefined,
119
+ };
120
+ }
121
+
37
122
  export const readerDetail: GraphifyComponentDetail = {
38
123
  kind: 'class',
39
124
  methods: [
@@ -79,39 +164,28 @@ export const investigateOnlyComponents: SubsystemComponent[] = [
79
164
  purl: 'pkg:github/principal-ai/agent-monitoring',
80
165
  purpose: 'the subsystem\u2019s input type — a repo-normalized universal event the readers produce and the accumulator consumes',
81
166
  symbol: 'RepoNormalizedUniversalAgentSessionEvent',
82
- detail: {
83
- kind: 'type',
84
- properties: [
85
- { name: 'eventType', type: 'NormalizedEventType' },
86
- { name: 'sessionId', type: 'string' },
87
- { name: 'timestamp', type: 'number' },
88
- ],
89
- usedBy: [{ nodeId: 'acc', name: 'accumulateToAgentSessionEvents', context: 'parameter_type' }],
90
- implementors: [],
91
- } satisfies GraphifyComponentDetail,
92
167
  },
93
168
  {
94
169
  id: 'acc',
95
170
  name: 'accumulateToAgentSessionEvents',
96
171
  construct: 'function',
97
- file: 'src/event-processing/accumulator.ts',
172
+ file: 'src/accumulateToAgentSessionEvents.ts',
98
173
  purl: 'pkg:github/principal-ai/agent-monitoring',
99
- purpose: 'accumulates normalized events into agent session events',
174
+ purpose: 'folds normalized events into agent session events',
100
175
  symbol: 'accumulateToAgentSessionEvents',
101
176
  },
102
177
  {
103
178
  id: 'out',
104
179
  name: 'AgentSessionEvent',
105
180
  construct: 'interface',
106
- file: 'src/event-processing/accumulator.ts',
181
+ file: 'types/AgentSessionEvent.ts',
107
182
  purl: 'pkg:github/principal-ai/agent-monitoring',
108
- purpose: 'the subsystem\u2019s output type — an accumulated agent-session event',
183
+ purpose: 'output event shape',
109
184
  symbol: 'AgentSessionEvent',
110
- detail: {
185
+ declaration: {
111
186
  kind: 'type',
112
187
  properties: [
113
- { name: 'sessionName', type: 'string' },
114
- { name: 'operation', type: 'AgentSessionEventOperation' },
188
+ { name: 'sessionId', type: 'string' },
115
189
  { name: 'description', type: 'string' },
116
190
  ],
117
191
  usedBy: [{ nodeId: 'acc', name: 'accumulateToAgentSessionEvents', context: 'return_type' }],
@@ -120,8 +194,18 @@ export const investigateOnlyComponents: SubsystemComponent[] = [
120
194
  },
121
195
  ];
122
196
 
197
+ const investigateSpec = graphSpecFromEdges([
198
+ ['v1', 'input', 'produces'],
199
+ ['v2', 'input', 'produces'],
200
+ ['input', 'acc', 'feeds'],
201
+ ['acc', 'out', 'produces'],
202
+ ]);
203
+
204
+ export const investigateOnlyRelations = investigateSpec.relations;
205
+ export const investigateOnlyWalkthroughs = investigateSpec.walkthroughs;
206
+
207
+ /** @deprecated use investigateOnlyRelations + investigateOnlyWalkthroughs */
123
208
  export const investigateOnlyEdges: SubsystemComponentEdge[] = edges([
124
- // Concept-level data flow — the LLM's semantic intent.
125
209
  ['v1', 'input', 'produces'],
126
210
  ['v2', 'input', 'produces'],
127
211
  ['input', 'acc', 'feeds'],
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * FileDrawer — bottom panel that slides up from the bottom of the graph area
3
- * to show file / throughline code. Opened by sidebar file-tree clicks,
4
- * declaration links, and throughline step focus; content is injected as
3
+ * to show file / walkthrough code. Opened by sidebar file-tree clicks,
4
+ * declaration links, and walkthrough step focus; content is injected as
5
5
  * children by the graph component.
6
6
  */
7
7