@principal-ai/subsystems-react 0.20.5 → 0.21.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 (87) 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/graphify/construct.d.ts +23 -0
  9. package/dist/graphify/construct.d.ts.map +1 -0
  10. package/dist/graphify/construct.js +77 -0
  11. package/dist/graphify/construct.js.map +1 -0
  12. package/dist/graphify/index.d.ts +2 -2
  13. package/dist/graphify/index.d.ts.map +1 -1
  14. package/dist/graphify/index.js +1 -1
  15. package/dist/graphify/index.js.map +1 -1
  16. package/dist/index.d.ts +7 -7
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3 -3
  19. package/dist/index.js.map +1 -1
  20. package/dist/pierre/PierreWalkthroughCodeView.d.ts +22 -0
  21. package/dist/pierre/PierreWalkthroughCodeView.d.ts.map +1 -0
  22. package/dist/pierre/PierreWalkthroughCodeView.js +198 -0
  23. package/dist/pierre/PierreWalkthroughCodeView.js.map +1 -0
  24. package/dist/pierre/index.d.ts +2 -2
  25. package/dist/pierre/index.js +1 -1
  26. package/dist/pierre/pierreFileLang.d.ts +1 -1
  27. package/dist/pierre/pierreFileLang.js +1 -1
  28. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +14 -2
  29. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -1
  30. package/dist/stories/Subsystem/ComponentGraph/fixtures.js +86 -20
  31. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -1
  32. package/dist/subsystem/ComponentDeclaration.js +1 -1
  33. package/dist/subsystem/ComponentDeclaration.js.map +1 -1
  34. package/dist/subsystem/FileDrawer.d.ts +2 -2
  35. package/dist/subsystem/FileDrawer.js +2 -2
  36. package/dist/subsystem/SubsystemComponentGraph.d.ts +25 -24
  37. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  38. package/dist/subsystem/SubsystemComponentGraph.js +220 -194
  39. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  40. package/dist/subsystem/formatDeclaration.d.ts +2 -1
  41. package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
  42. package/dist/subsystem/formatDeclaration.js +57 -33
  43. package/dist/subsystem/formatDeclaration.js.map +1 -1
  44. package/dist/subsystem/model.d.ts +109 -42
  45. package/dist/subsystem/model.d.ts.map +1 -1
  46. package/dist/subsystem/model.js +107 -5
  47. package/dist/subsystem/model.js.map +1 -1
  48. package/dist/subsystem/nodes.d.ts.map +1 -1
  49. package/dist/subsystem/nodes.js +43 -18
  50. package/dist/subsystem/nodes.js.map +1 -1
  51. package/dist/subsystem/tokenizeComponent.js +2 -2
  52. package/dist/subsystem/tokenizeComponent.js.map +1 -1
  53. package/package.json +3 -3
  54. package/src/graphify/anchor.test.ts +31 -2
  55. package/src/graphify/anchor.ts +46 -0
  56. package/src/graphify/consolidated.ts +43 -1
  57. package/src/graphify/{kind.test.ts → construct.test.ts} +20 -20
  58. package/src/graphify/{kind.ts → construct.ts} +17 -17
  59. package/src/graphify/index.ts +5 -2
  60. package/src/index.ts +20 -9
  61. package/src/pierre/{PierreThroughlineCodeView.tsx → PierreWalkthroughCodeView.tsx} +39 -47
  62. package/src/pierre/index.ts +2 -2
  63. package/src/pierre/pierreFileLang.ts +1 -1
  64. package/src/stories/Pierre/CodeView.stories.tsx +3 -3
  65. package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +14 -14
  66. package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +13 -15
  67. package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +8 -8
  68. package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +16 -20
  69. package/src/stories/Subsystem/ComponentGraph/CustomEntities.stories.tsx +11 -10
  70. package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +13 -14
  71. package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +31 -66
  72. package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +2 -2
  73. package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +4 -4
  74. package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +3 -3
  75. package/src/stories/Subsystem/ComponentGraph/Proposed.stories.tsx +254 -0
  76. package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +518 -33
  77. package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +13 -13
  78. package/src/stories/Subsystem/ComponentGraph/fixtures.ts +105 -21
  79. package/src/subsystem/ComponentDeclaration.tsx +1 -1
  80. package/src/subsystem/FileDrawer.tsx +2 -2
  81. package/src/subsystem/SubsystemComponentGraph.tsx +284 -254
  82. package/src/subsystem/formatDeclaration.test.ts +76 -1
  83. package/src/subsystem/formatDeclaration.ts +57 -33
  84. package/src/subsystem/model.test.ts +49 -15
  85. package/src/subsystem/model.ts +210 -51
  86. package/src/subsystem/nodes.tsx +63 -22
  87. package/src/subsystem/tokenizeComponent.ts +2 -2
@@ -12,28 +12,29 @@
12
12
  * injection, onNodeClick) adapted to the subsystem model — read-only.
13
13
  */
14
14
  import type { ReactNode } from 'react';
15
- import { type SubsystemComponentEdge, type SubsystemComponent, type SubsystemThroughline } from './model';
15
+ import { type SubsystemComponentEdge, type SubsystemComponent, type SubsystemRelation, type SubsystemWalkthrough } from './model';
16
16
  import type { SubsystemOpenFileOptions } from './declarationRef';
17
17
  import type { ComponentVerificationState } from './ComponentDeclaration';
18
- /** Context passed to `renderThroughlineViewer` when a flow/step is focused. */
19
- export interface ThroughlineViewerContext {
20
- throughline: SubsystemThroughline;
18
+ /** Context passed to `renderWalkthroughViewer` when a flow/step is focused. */
19
+ export interface WalkthroughViewerContext {
20
+ walkthrough: SubsystemWalkthrough;
21
21
  /** Focused step index; `null` means the whole flow (no specific step). */
22
22
  stepIndex: number | null;
23
23
  }
24
24
  export interface SubsystemComponentGraphProps {
25
25
  components: SubsystemComponent[];
26
- edges: SubsystemComponentEdge[];
26
+ /** Topology relations (structural / module / type). Display edges are derived with walkthrough hops. */
27
+ relations: SubsystemRelation[];
27
28
  /**
28
- * Ordered execution stories over the graph's edges — one throughline per
29
- * flow. When present the sidebar's bottom half offers a Files/Flows toggle:
30
- * the flows panel lists each throughline's steps (`symbol` or `file:line`);
29
+ * Ordered runtime walkthroughs — one walkthrough per flow. When present the
30
+ * sidebar's bottom half offers a Files/Walkthroughs toggle:
31
+ * the flows panel lists each walkthrough's steps (`symbol` or `file:line`);
31
32
  * clicking a flow row toggles its steps; clicking a step focuses that
32
- * step's edge and (when `renderThroughlineViewer` is set) opens the bottom
33
+ * step's edge and (when `renderWalkthroughViewer` is set) opens the bottom
33
34
  * drawer on that flow's snippets. Opened flows stay on the canvas
34
35
  * (unselected ones dimmed); everything else is hidden.
35
36
  */
36
- throughlines?: SubsystemThroughline[];
37
+ walkthroughs?: SubsystemWalkthrough[];
37
38
  onSelect?: (componentId: string) => void;
38
39
  /** Called when an edge is clicked (relationship / mechanism + refs seam). */
39
40
  onEdgeSelect?: (edge: SubsystemComponentEdge) => void;
@@ -46,29 +47,29 @@ export interface SubsystemComponentGraphProps {
46
47
  title?: string;
47
48
  /**
48
49
  * Suppresses the sidebar entirely (title, description, file tree,
49
- * throughlines) for graph-only embeds. Pair with `graphTitle` to keep the
50
+ * walkthroughs) for graph-only embeds. Pair with `graphTitle` to keep the
50
51
  * subsystem name visible as an overlay on the canvas.
51
52
  */
52
53
  hideSidebar?: boolean;
53
54
  /**
54
- * How throughline step highlighting behaves on the canvas.
55
+ * How walkthrough step highlighting behaves on the canvas.
55
56
  * - `focus` (default): zoom to the step, hide non-participants, open drawer
56
57
  * - `dim`: keep the full graph, dim non-participants (same as hovering a step)
57
58
  */
58
- throughlineStepMode?: 'focus' | 'dim';
59
+ walkthroughStepMode?: 'focus' | 'dim';
59
60
  /**
60
- * When true, cycles throughline steps automatically using `dim` highlighting
61
- * (no zoom, no drawer). Loops across all throughlines that have steps.
61
+ * When true, cycles walkthrough steps automatically using `dim` highlighting
62
+ * (no zoom, no drawer). Loops across all walkthroughs that have steps.
62
63
  * Useful for graph-only embeds (`hideSidebar`).
63
64
  */
64
- autoPlayThroughlines?: boolean;
65
+ autoPlayWalkthroughs?: boolean;
65
66
  /** Pause between autoplay steps in ms. @default 2500 */
66
- throughlineAutoPlayIntervalMs?: number;
67
+ walkthroughAutoPlayIntervalMs?: number;
67
68
  /**
68
- * When false, focusing a throughline/step does not call `fitView`.
69
+ * When false, focusing a walkthrough/step does not call `fitView`.
69
70
  * @default true
70
71
  */
71
- zoomOnThroughlineFocus?: boolean;
72
+ zoomOnWalkthroughFocus?: boolean;
72
73
  /**
73
74
  * Subsystem title rendered as a non-interactive overlay chip on the graph
74
75
  * canvas (top-center). Does not trigger the sidebar — for graph-only
@@ -76,11 +77,11 @@ export interface SubsystemComponentGraphProps {
76
77
  */
77
78
  graphTitle?: string;
78
79
  /**
79
- * When true, shows the active throughline's title as a non-interactive
80
+ * When true, shows the active walkthrough's title as a non-interactive
80
81
  * overlay chip on the canvas (under `graphTitle` when both are set).
81
- * Uses the focused or hover-highlighted throughline.
82
+ * Uses the focused or hover-highlighted walkthrough.
82
83
  */
83
- showThroughlineTitle?: boolean;
84
+ showWalkthroughTitle?: boolean;
84
85
  /** Markdown description rendered in the sidebar. */
85
86
  description?: string;
86
87
  /** Rendered over the graph canvas only (not the title/legend sidebar). */
@@ -96,11 +97,11 @@ export interface SubsystemComponentGraphProps {
96
97
  */
97
98
  renderFileViewer?: (file: string, opts?: SubsystemOpenFileOptions) => ReactNode;
98
99
  /**
99
- * Host-injected multi-snippet viewer for a focused throughline. When set,
100
+ * Host-injected multi-snippet viewer for a focused walkthrough. When set,
100
101
  * clicking a flow step opens the bottom drawer with this content and
101
102
  * updates it as the focused step changes.
102
103
  */
103
- renderThroughlineViewer?: (ctx: ThroughlineViewerContext) => ReactNode;
104
+ renderWalkthroughViewer?: (ctx: WalkthroughViewerContext) => ReactNode;
104
105
  /**
105
106
  * Legacy component-keyed variant, kept for backward compatibility. When
106
107
  * `renderFileViewer` is absent, drawer content resolves via the first
@@ -1 +1 @@
1
- {"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAqBtE,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAKjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAYzE,+EAA+E;AAC/E,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,oBAAoB,CAAC;IAClC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAMD,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACtD;kFAC8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gDAAgD;IACh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