@principal-ai/subsystems-react 0.50.0 → 0.51.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 (83) hide show
  1. package/dist/index.d.ts +8 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +7 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/pierre/PierreTrailCodeView.d.ts +1 -1
  6. package/dist/pierre/PierreTrailCodeView.d.ts.map +1 -1
  7. package/dist/pierre/PierreTrailCodeView.js +44 -21
  8. package/dist/pierre/PierreTrailCodeView.js.map +1 -1
  9. package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.d.ts +493 -0
  10. package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.d.ts.map +1 -0
  11. package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.js +329 -0
  12. package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.js.map +1 -0
  13. package/dist/subsystem/C4Graph.d.ts +2 -2
  14. package/dist/subsystem/C4Graph.d.ts.map +1 -1
  15. package/dist/subsystem/C4Graph.js +38 -73
  16. package/dist/subsystem/C4Graph.js.map +1 -1
  17. package/dist/subsystem/C4NodeCard.d.ts +119 -0
  18. package/dist/subsystem/C4NodeCard.d.ts.map +1 -0
  19. package/dist/subsystem/C4NodeCard.js +223 -0
  20. package/dist/subsystem/C4NodeCard.js.map +1 -0
  21. package/dist/subsystem/DiagnosticToggle.d.ts +8 -1
  22. package/dist/subsystem/DiagnosticToggle.d.ts.map +1 -1
  23. package/dist/subsystem/DiagnosticToggle.js +40 -6
  24. package/dist/subsystem/DiagnosticToggle.js.map +1 -1
  25. package/dist/subsystem/FileDrawer.d.ts.map +1 -1
  26. package/dist/subsystem/FileDrawer.js +20 -21
  27. package/dist/subsystem/FileDrawer.js.map +1 -1
  28. package/dist/subsystem/IssueList.js +1 -1
  29. package/dist/subsystem/IssueList.js.map +1 -1
  30. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  31. package/dist/subsystem/SubsystemComponentGraph.js +13 -4
  32. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  33. package/dist/subsystem/c4.d.ts +272 -0
  34. package/dist/subsystem/c4.d.ts.map +1 -0
  35. package/dist/subsystem/c4.js +322 -0
  36. package/dist/subsystem/c4.js.map +1 -0
  37. package/dist/subsystem/c4Evidence.d.ts +143 -0
  38. package/dist/subsystem/c4Evidence.d.ts.map +1 -0
  39. package/dist/subsystem/c4Evidence.js +240 -0
  40. package/dist/subsystem/c4Evidence.js.map +1 -0
  41. package/dist/subsystem/model.d.ts +27 -7
  42. package/dist/subsystem/model.d.ts.map +1 -1
  43. package/dist/subsystem/model.js +15 -0
  44. package/dist/subsystem/model.js.map +1 -1
  45. package/dist/subsystem/nodes.d.ts.map +1 -1
  46. package/dist/subsystem/nodes.js +78 -7
  47. package/dist/subsystem/nodes.js.map +1 -1
  48. package/package.json +3 -2
  49. package/src/index.ts +37 -0
  50. package/src/pierre/PierreTrailCodeView.tsx +49 -21
  51. package/src/stories/Subsystem/C4Graph/C4NodeGallery.stories.tsx +413 -0
  52. package/src/stories/Subsystem/C4Graph/ProposedElements.stories.tsx +293 -0
  53. package/src/stories/Subsystem/C4Graph/c4ProposedElements.fixture.ts +366 -0
  54. package/src/stories/Subsystem/ComponentGraph/Deprecated.stories.tsx +358 -0
  55. package/src/stories/Subsystem/ComponentGraph/Diagnostics.stories.tsx +27 -2
  56. package/src/stories/Subsystem/ComponentGraph/IssueOverlay.stories.tsx +1 -1
  57. package/src/stories/Subsystem/ComponentGraph/Issues.stories.tsx +1 -1
  58. package/src/stories/Subsystem/ComponentGraph/{Flows.stories.tsx → Trails.stories.tsx} +4 -4
  59. package/src/subsystem/C4Graph.tsx +81 -107
  60. package/src/subsystem/C4NodeCard.test.ts +301 -0
  61. package/src/subsystem/C4NodeCard.tsx +301 -0
  62. package/src/subsystem/DiagnosticToggle.tsx +58 -4
  63. package/src/subsystem/FileDrawer.tsx +32 -34
  64. package/src/subsystem/IssueList.tsx +1 -1
  65. package/src/subsystem/SubsystemComponentGraph.tsx +13 -5
  66. package/src/subsystem/c4.test.ts +573 -0
  67. package/src/subsystem/c4.ts +558 -0
  68. package/src/subsystem/c4Evidence.test.ts +386 -0
  69. package/src/subsystem/c4Evidence.ts +329 -0
  70. package/src/subsystem/model.ts +36 -7
  71. package/src/subsystem/nodes.tsx +124 -5
  72. package/dist/stories/Subsystem/C4Graph/c4Fixture.d.ts +0 -3
  73. package/dist/stories/Subsystem/C4Graph/c4Fixture.d.ts.map +0 -1
  74. package/dist/stories/Subsystem/C4Graph/c4Fixture.js +0 -2
  75. package/dist/stories/Subsystem/C4Graph/c4Fixture.js.map +0 -1
  76. package/dist/subsystem/toC4.d.ts +0 -95
  77. package/dist/subsystem/toC4.d.ts.map +0 -1
  78. package/dist/subsystem/toC4.js +0 -192
  79. package/dist/subsystem/toC4.js.map +0 -1
  80. package/src/stories/Subsystem/C4Graph/C4Container.stories.tsx +0 -101
  81. package/src/stories/Subsystem/C4Graph/c4Fixture.ts +0 -6
  82. package/src/subsystem/toC4.test.ts +0 -114
  83. package/src/subsystem/toC4.ts +0 -273
@@ -0,0 +1,329 @@
1
+ const author = 'c4-proposer';
2
+ export const c4ProposedElements = [
3
+ // --- deployable units ----------------------------------------------------
4
+ {
5
+ id: 'container:studio-host',
6
+ kind: 'container',
7
+ label: 'Subsystem Studio — host',
8
+ derivedFrom: ['subsystems-studio/host'],
9
+ // Only the aliases with no component of their own. The store I/O and the
10
+ // audit runner name their own members below, and `buildC4Model` rolls
11
+ // those up into this container rather than counting them twice.
12
+ members: [
13
+ 'resolve-root', 'http-put', 'http-propose', 'tab-registry',
14
+ 'live-feed-store', 'maintain-probe-registry', 'run-store',
15
+ 'graphify-store', 'proposal-create', 'proposal-accept',
16
+ 'maintain-orchestrator', 'run-maintain-agent', 'ensure-graphify',
17
+ 'close-tab', 'open-tab',
18
+ ],
19
+ containerKind: 'application',
20
+ technology: 'Bun + Electrobun host',
21
+ description: 'Owns the model store on disk, runs graphify-backed verification, and serves the renderer over RPC.',
22
+ state: 'proposed',
23
+ rationale: 'The Electron main process, holding 113 components in the live corpus.',
24
+ author,
25
+ },
26
+ {
27
+ id: 'container:legacy-host',
28
+ kind: 'container',
29
+ label: 'Principal Studio — host',
30
+ // The other half of the merge question. `subsystems-studio/host` (113
31
+ // components) and `principal-studio/host` (1) are either one process or
32
+ // two, and no amount of reading the keys decides it — `mergeElements`
33
+ // exists for exactly this, and the story shows the button.
34
+ derivedFrom: ['principal-studio/host'],
35
+ members: ['register-roots'],
36
+ containerKind: 'application',
37
+ technology: 'Electrobun host',
38
+ description: "The same Electron main process under the app's former name.",
39
+ state: 'proposed',
40
+ rationale: 'One member, and the same process as container:studio-host. Merged or kept separate, one deployable unit under two app names or two units?',
41
+ author,
42
+ },
43
+ {
44
+ id: 'container:studio-renderer',
45
+ kind: 'container',
46
+ label: 'Subsystem Studio — renderer',
47
+ // `file-panel` is not repeated here: component:file-viewer owns it, and
48
+ // the build rolls it up. An alias belongs to exactly one element.
49
+ derivedFrom: ['subsystems-studio/renderer'],
50
+ members: [
51
+ 'subsystems-view', 'model-view', 'regular-audit-view', 'list-view',
52
+ 'rpc-bridge', 'reload-subs', 'regular-audit-subscribers',
53
+ 'tab-strip', 'graph-view', 'detail-graph', 'is-model-viewed',
54
+ 'preloadHighlighter', 'SharedHighlighter', 'CodeView',
55
+ ],
56
+ containerKind: 'application',
57
+ technology: 'React 19 in an Electron renderer',
58
+ description: 'Renders subsystem models and talks to the host over the Electrobun RPC bridge.',
59
+ state: 'proposed',
60
+ rationale: 'The Electron renderer process, holding 41 components in the live corpus.',
61
+ author,
62
+ },
63
+ {
64
+ id: 'container:legacy-renderer',
65
+ kind: 'container',
66
+ label: 'Principal Studio — renderer',
67
+ // The other half of the renderer merge question, mirroring legacy-host.
68
+ derivedFrom: ['principal-studio/renderer'],
69
+ members: ['app-shell'],
70
+ containerKind: 'application',
71
+ technology: 'React 19',
72
+ description: "The same React bundle under the app's former name.",
73
+ state: 'proposed',
74
+ rationale: 'One member, and the same process as container:studio-renderer. One deployable unit under two app names or two units?',
75
+ author,
76
+ },
77
+ {
78
+ id: 'container:cli',
79
+ kind: 'container',
80
+ label: 'Subsystem Modeling CLI',
81
+ derivedFrom: ['principal-studio-cli'],
82
+ members: ['cli-create'],
83
+ containerKind: 'application',
84
+ technology: 'Node',
85
+ description: 'Creates and updates models from the terminal.',
86
+ state: 'proposed',
87
+ rationale: 'A standalone binary is a deployable unit even with one command.',
88
+ author,
89
+ },
90
+ // --- the shape questions -------------------------------------------------
91
+ {
92
+ id: 'container:shared-ui',
93
+ kind: 'container',
94
+ label: 'subsystems-react (proposed container?)',
95
+ members: ['measured-dims'],
96
+ containerKind: 'application',
97
+ technology: 'React',
98
+ description: 'Shared graph UI, published as an npm package.',
99
+ state: 'proposed',
100
+ // Proposed as a container so the question is visible. There is no `library`
101
+ // kind to fall back on: c4model says a JAR/assembly/module "typically" is
102
+ // not an element at all, so a published package has to earn its box or be
103
+ // demoted into the containers that import it.
104
+ rationale: 'MEMBER OF THE COMPANION LIBRARY, not a runtime unit — no process of its own, imported by both renderers. Expected to be rejected or demoted.',
105
+ author,
106
+ },
107
+ {
108
+ id: 'container:model-store',
109
+ kind: 'container',
110
+ label: 'Subsystem model store',
111
+ members: ['model-disk-store', 'proposals-store'],
112
+ containerKind: 'data-store',
113
+ technology: 'JSON files under ~/.principal',
114
+ description: 'Every stored model and the correction queue, on local disk.',
115
+ state: 'proposed',
116
+ // The open Q2 decision: is this one C4 data-store container, or internals
117
+ // of the host that owns them?
118
+ rationale: 'Disk-backed and shared across the host and the CLI, which reads it. Whether C4 wants one data-store container or internals of the host is unresolved.',
119
+ author,
120
+ },
121
+ {
122
+ id: 'container:in-memory-state',
123
+ kind: 'container',
124
+ label: 'In-memory renderer state (proposed container?)',
125
+ // Two aliases nothing else claims. Rejecting this element is what makes
126
+ // them reappear in `unmapped` — which is the point: rejecting an element
127
+ // orphans whatever was in it, and the build says so out loud.
128
+ members: ['renderer-probe-cache', 'tab-order-cache'],
129
+ containerKind: 'application',
130
+ // Required by the type on every container, and empty on purpose: this is
131
+ // the shape the C4 notation forbids (process-lifetime state has no
132
+ // technology), and `summarizeElements` reports exactly this gap.
133
+ technology: '',
134
+ description: 'Module-level Sets and Maps that do not outlive the process.',
135
+ state: 'proposed',
136
+ rationale: 'Process-lifetime state, not durable storage. Belongs inside the renderer container as components, not beside it as its own container. Expected to be rejected.',
137
+ author,
138
+ },
139
+ // --- outside the boundary ----------------------------------------------
140
+ {
141
+ id: 'external:opencode2',
142
+ kind: 'external-system',
143
+ label: 'OpenCode v2 service',
144
+ members: ['opencode-v2-service'],
145
+ technology: 'HTTP',
146
+ description: 'Runs the maintain agent sessions this model is edited by.',
147
+ state: 'proposed',
148
+ rationale: 'Another system we call out to — a C4 software system, not one of our containers.',
149
+ author,
150
+ },
151
+ {
152
+ id: 'external:gists',
153
+ kind: 'external-system',
154
+ label: 'GitHub Gists API',
155
+ members: ['github-gists-api'],
156
+ technology: 'REST',
157
+ description: 'Publishes the portable model JSON as a gist.',
158
+ state: 'proposed',
159
+ author,
160
+ },
161
+ {
162
+ id: 'external:opencode-db',
163
+ kind: 'external-system',
164
+ label: 'opencode.db',
165
+ members: ['session-v2', 'event', 'session-message'],
166
+ // No technology field at all: C4 makes technology optional for an
167
+ // external system, and for a SQLite file the honest answer is "on disk".
168
+ description: 'Agent session transcripts, read by the host to build the timeline.',
169
+ state: 'proposed',
170
+ // Two models disagree about this: one claims these tables inside our
171
+ // system, another marks them external. Flagged rather than resolved.
172
+ rationale: 'CONFLICT — one stored model claims these tables inside the system, another marks the same tables external. Needs the user.',
173
+ author,
174
+ },
175
+ {
176
+ id: 'person:maintainer',
177
+ kind: 'person',
178
+ label: 'Maintain operator',
179
+ members: ['maintain-agent'],
180
+ description: 'Reviews and accepts the correction proposals this subsystem model accumulates.',
181
+ state: 'proposed',
182
+ rationale: 'C4 Person — no technology, by the notation. The only actor in the corpus; entityKind was never set on the underlying custom_entity.',
183
+ author,
184
+ },
185
+ // --- component level ----------------------------------------------------
186
+ {
187
+ id: 'component:boundary-layout',
188
+ kind: 'component',
189
+ label: 'Boundary layout builder',
190
+ members: ['build-boundary-layout', 'nest-groups'],
191
+ // Naming `container:shared-ui` as the parent is itself part of the open
192
+ // question: if that container is rejected, this component has no home and
193
+ // `buildC4Model` reports `unknown_container`.
194
+ container: 'container:shared-ui',
195
+ technology: 'React + ELK',
196
+ description: 'Turns module and process claims into nested compound frames.',
197
+ state: 'proposed',
198
+ author,
199
+ },
200
+ {
201
+ id: 'component:file-viewer',
202
+ kind: 'component',
203
+ label: 'Pierre file viewer',
204
+ members: ['file-panel'],
205
+ container: 'container:studio-renderer',
206
+ technology: 'React',
207
+ description: 'Opens the source slice a trail step points at.',
208
+ state: 'proposed',
209
+ author,
210
+ },
211
+ {
212
+ id: 'component:model-store-io',
213
+ kind: 'component',
214
+ label: 'Model store I/O',
215
+ members: ['store-create', 'store-list', 'read-file', 'store-file'],
216
+ container: 'container:studio-host',
217
+ technology: 'Bun fs',
218
+ description: 'Reads and writes model JSON under ~/.principal.',
219
+ state: 'proposed',
220
+ author,
221
+ },
222
+ {
223
+ id: 'component:audit-runner',
224
+ kind: 'component',
225
+ label: 'Audit runner',
226
+ members: ['audit-model', 'verify-files'],
227
+ // Deliberately dangling: points at a container that is not in this set, so
228
+ // the story shows what `unknown_container` looks like.
229
+ container: 'container:verifier',
230
+ technology: 'Bun',
231
+ description: 'Verifies every component claim in a model.',
232
+ state: 'proposed',
233
+ rationale: 'Named a container that does not exist yet — shows the build problem report.',
234
+ author,
235
+ },
236
+ ];
237
+ /**
238
+ * A small document the elements above can be drawn against: the member aliases
239
+ * resolved, plus one trail so there is a line to draw.
240
+ *
241
+ * Only members named by an element appear. A component nobody claimed is
242
+ * deliberately absent — `buildC4Model` reports those as `unmapped` instead of
243
+ * inventing a home for them.
244
+ */
245
+ export const c4FixtureDocument = {
246
+ components: [
247
+ { alias: 'store-create', name: 'createSubsystemModel', construct: 'function', file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-store.ts' },
248
+ { alias: 'store-list', name: 'listSubsystemModels', construct: 'function', file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-store.ts' },
249
+ { alias: 'verify-files', name: 'verifyModelFiles', construct: 'function', file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-store.ts' },
250
+ { alias: 'resolve-root', name: 'resolveRepoRootForComponent', construct: 'function', file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-store.ts' },
251
+ { alias: 'audit-model', name: 'auditSubsystemModel', construct: 'function', file: 'packages/subsystems-studio/src/bun/verify-subsystem-component.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts' },
252
+ { alias: 'http-put', name: 'handleSubsystemModelRequest', construct: 'function', file: 'packages/subsystems-studio/src/bun/http-server.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/http-server.ts' },
253
+ { alias: 'http-propose', name: 'postSubsystemModelProposal', construct: 'function', file: 'packages/subsystems-studio/src/bun/proposal-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/proposal-store.ts' },
254
+ { alias: 'register-roots', name: 'registerRepoRoots', construct: 'function', file: 'packages/subsystems-studio/src/bun/alexandria.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/alexandria.ts' },
255
+ { alias: 'tab-registry', name: 'tabs', construct: 'store', file: 'packages/subsystems-studio/src/bun/index.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts', declaration: { kind: 'store', storage: 'memory', properties: [] } },
256
+ { alias: 'live-feed-store', name: 'OpencodeLiveFeedState', construct: 'store', file: 'packages/subsystems-studio/src/bun/opencode-v2-live.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/opencode-v2-live.ts', declaration: { kind: 'store', storage: 'memory', properties: [] } },
257
+ { alias: 'maintain-probe-registry', name: 'MaintainerProbeRegistry', construct: 'store', file: 'packages/subsystems-studio/src/bun/maintainer-probe.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/maintainer-probe.ts', declaration: { kind: 'store', storage: 'memory', properties: [] } },
258
+ { alias: 'run-store', name: 'SubsystemModelRunStore', construct: 'store', file: 'packages/subsystems-studio/src/bun/subsystem-model-runs.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-runs.ts', declaration: { kind: 'store', storage: 'disk', properties: [] } },
259
+ { alias: 'graphify-store', name: 'ensureCaches', construct: 'function', file: 'packages/subsystems-studio/src/bun/graphify-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/graphify-store.ts' },
260
+ { alias: 'proposal-create', name: 'createSubsystemModelProposal', construct: 'function', file: 'packages/subsystems-studio/src/bun/proposal-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/proposal-store.ts' },
261
+ { alias: 'proposal-accept', name: 'acceptSubsystemModelProposal', construct: 'function', file: 'packages/subsystems-studio/src/bun/proposal-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/proposal-store.ts' },
262
+ { alias: 'maintain-orchestrator', name: 'maintainSubsystemModel', construct: 'function', file: 'packages/subsystems-studio/src/bun/maintain-model.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/maintain-model.ts' },
263
+ { alias: 'run-maintain-agent', name: 'runMaintainAgent', construct: 'function', file: 'packages/subsystems-studio/src/bun/maintain-model.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/maintain-model.ts' },
264
+ { alias: 'ensure-graphify', name: 'ensureCaches', construct: 'function', file: 'packages/subsystems-studio/src/bun/graphify-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/graphify-store.ts' },
265
+ { alias: 'store-file', name: 'writeFile', construct: 'function', file: 'packages/subsystems-studio/src/bun/subsystem-model-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-store.ts' },
266
+ { alias: 'read-file', name: 'readSubsystemFile', construct: 'function', file: 'packages/subsystems-studio/src/bun/index.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts' },
267
+ { alias: 'close-tab', name: 'closeTabById', construct: 'function', file: 'packages/subsystems-studio/src/bun/index.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts' },
268
+ { alias: 'open-tab', name: 'openSubsystemModelTab', construct: 'function', file: 'packages/subsystems-studio/src/bun/index.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts' },
269
+ { alias: 'subsystems-view', name: 'SubsystemsModelsView', construct: 'function', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx' },
270
+ { alias: 'model-view', name: 'SubsystemModelView', construct: 'function', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx' },
271
+ { alias: 'regular-audit-view', name: 'RegularAuditView', construct: 'function', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx' },
272
+ { alias: 'list-view', name: 'listView', construct: 'function', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx' },
273
+ { alias: 'file-panel', name: 'FilePanel', construct: 'function', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx' },
274
+ { alias: 'rpc-bridge', name: 'electrobun', construct: 'store', file: 'packages/subsystems-studio/src/mainview/rpc.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/rpc.ts', declaration: { kind: 'store', properties: [] } },
275
+ { alias: 'reload-subs', name: 'reloadSubscribers', construct: 'store', file: 'packages/subsystems-studio/src/mainview/rpc.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/rpc.ts', declaration: { kind: 'store', properties: [] } },
276
+ { alias: 'regular-audit-subscribers', name: 'regularAuditChangeSubscribers', construct: 'store', file: 'packages/subsystems-studio/src/mainview/rpc.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/rpc.ts', declaration: { kind: 'store', properties: [] } },
277
+ { alias: 'app-shell', name: 'App', construct: 'function', file: 'packages/subsystems-studio/src/mainview/App.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/App.tsx' },
278
+ { alias: 'tab-strip', name: 'TabStrip', construct: 'function', file: 'packages/subsystems-studio/src/mainview/components/TabStrip.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/components/TabStrip.tsx' },
279
+ { alias: 'graph-view', name: 'SubsystemComponentGraph', construct: 'function', file: 'packages/subsystems-react/src/subsystem/SubsystemComponentGraph.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-react/src/subsystem/SubsystemComponentGraph.tsx' },
280
+ { alias: 'detail-graph', name: 'DetailGraph', construct: 'function', file: 'packages/subsystems-react/src/subsystem/SubsystemComponentGraph.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-react/src/subsystem/SubsystemComponentGraph.tsx' },
281
+ { alias: 'is-model-viewed', name: 'isModelViewed', construct: 'function', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx' },
282
+ { alias: 'preloadHighlighter', name: 'preloadHighlighter', construct: 'external', file: '', purl: 'pkg:npm/@pierre/diffs' },
283
+ { alias: 'SharedHighlighter', name: 'SharedHighlighter', construct: 'external', file: '', purl: 'pkg:npm/@pierre/diffs' },
284
+ { alias: 'CodeView', name: 'CodeView', construct: 'external', file: '', purl: 'pkg:npm/@pierre/diffs' },
285
+ { alias: 'cli-create', name: 'create', construct: 'function', file: 'packages/principal-studio-cli/src/commands/subsystem-model.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/principal-studio-cli/src/commands/subsystem-model.ts' },
286
+ { alias: 'nest-groups', name: 'nestCompoundGroups', construct: 'function', file: 'packages/subsystems-react/src/utils/elkLayout.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-react/src/utils/elkLayout.ts' },
287
+ { alias: 'build-boundary-layout', name: 'buildBoundaryLayoutGroups', construct: 'function', file: 'packages/subsystems-react/src/subsystem/model.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-react/src/subsystem/model.ts' },
288
+ { alias: 'measured-dims', name: 'measuredDimsRef', construct: 'store', file: 'packages/subsystems-react/src/subsystem/SubsystemComponentGraph.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-react/src/subsystem/SubsystemComponentGraph.tsx', declaration: { kind: 'store', properties: [] } },
289
+ { alias: 'model-disk-store', name: '~/.principal/subsystem-models', construct: 'store', file: '', purl: 'external:file:~/.principal/subsystem-models', declaration: { kind: 'store', storage: 'disk', properties: [] } },
290
+ { alias: 'proposals-store', name: 'SubsystemModelProposalStore', construct: 'store', file: 'packages/subsystems-studio/src/bun/proposal-store.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/proposal-store.ts', declaration: { kind: 'store', storage: 'disk', properties: [] } },
291
+ { alias: 'opencode-v2-service', name: 'OpenCode v2 service', construct: 'external', file: '', purl: 'external:opencode/v2-service' },
292
+ { alias: 'github-gists-api', name: 'GitHub Gists API', construct: 'external', file: '', purl: 'external:api.github.com/gists' },
293
+ { alias: 'session-v2', name: 'session_v2', construct: 'external', file: '', purl: 'external:opencode.db/session-v2' },
294
+ { alias: 'event', name: 'event', construct: 'external', file: '', purl: 'external:opencode.db/event' },
295
+ { alias: 'session-message', name: 'session_message', construct: 'external', file: '', purl: 'external:opencode.db/session-message' },
296
+ { alias: 'renderer-probe-cache', name: 'rendererProbeCache', construct: 'store', file: 'packages/subsystems-studio/src/mainview/rpc.ts', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/rpc.ts', declaration: { kind: 'store', storage: 'memory', properties: [] } },
297
+ { alias: 'tab-order-cache', name: 'tabOrderCache', construct: 'store', file: 'packages/subsystems-studio/src/mainview/components/TabStrip.tsx', purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/components/TabStrip.tsx', declaration: { kind: 'store', storage: 'memory', properties: [] } },
298
+ { alias: 'maintain-agent', name: 'Maintenance agent (OpenCode) session', construct: 'custom_entity', file: '', purl: 'external' },
299
+ ],
300
+ trails: [
301
+ {
302
+ id: 'tl-audit',
303
+ title: 'Run a dry-run audit from the Audit button',
304
+ steps: [
305
+ { from: 'model-view', to: 'audit-model', mechanism: 'calls', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx', line: 443, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx', symbol: 'SubsystemModelView' },
306
+ { from: 'audit-model', to: 'model-disk-store', mechanism: 'writes', file: 'packages/subsystems-studio/src/bun/verify-subsystem-component.ts', line: 950, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts', symbol: 'auditSubsystemModel' },
307
+ { from: 'subsystems-view', to: 'model-view', mechanism: 'feeds', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', line: 1152, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', symbol: 'openSubsystemModel' },
308
+ { from: 'subsystems-view', to: 'file-panel', mechanism: 'uses', file: 'packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', line: 958, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelsView.tsx', symbol: 'onShowAuditReport' },
309
+ ],
310
+ },
311
+ {
312
+ id: 'tl-maintain',
313
+ title: 'Maintain run posts a correction proposal',
314
+ steps: [
315
+ { from: 'maintain-orchestrator', to: 'run-maintain-agent', mechanism: 'calls', file: 'packages/subsystems-studio/src/bun/maintain-model.ts', line: 854, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/maintain-model.ts', symbol: 'maintainSubsystemModel' },
316
+ { from: 'run-maintain-agent', to: 'opencode-v2-service', mechanism: 'calls', file: 'packages/subsystems-studio/src/bun/maintain-model.ts', line: 651, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/maintain-model.ts', symbol: 'runMaintainAgent' },
317
+ { from: 'opencode-v2-service', to: 'maintain-agent', mechanism: 'feeds', file: 'packages/subsystems-studio/src/bun/maintain-model.ts', line: 650, purl: 'external:opencode/v2-service#packages/subsystems-studio/src/bun/maintain-model.ts', symbol: 'runMaintainAgent' },
318
+ { from: 'http-propose', to: 'proposal-create', mechanism: 'calls', file: 'packages/subsystems-studio/src/bun/http-server.ts', line: 404, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/http-server.ts', symbol: 'handleSubsystemModelRequest' },
319
+ { from: 'proposal-create', to: 'proposals-store', mechanism: 'writes', file: 'packages/subsystems-studio/src/bun/proposal-store.ts', line: 554, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/proposal-store.ts', symbol: 'createSubsystemModelProposal' },
320
+ { from: 'maintain-orchestrator', to: 'run-store', mechanism: 'writes', file: 'packages/subsystems-studio/src/bun/maintain-model.ts', line: 892, purl: 'pkg:github/acme/subsystem-modeling#packages/subsystems-studio/src/bun/maintain-model.ts', symbol: 'noteSubsystemModelRunStart' },
321
+ ],
322
+ },
323
+ ],
324
+ };
325
+ /** Elements the author is asking a question about, surfaced in the story. */
326
+ export const c4OpenQuestions = c4ProposedElements
327
+ .filter((a) => a.rationale && /(CONFLICT|not a|Expected to be|whether|Needs|one deployable unit)/.test(a.rationale))
328
+ .map((a) => ({ id: a.id, label: a.label, rationale: a.rationale }));
329
+ //# sourceMappingURL=c4ProposedElements.fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c4ProposedElements.fixture.js","sourceRoot":"","sources":["../../../../src/stories/Subsystem/C4Graph/c4ProposedElements.fixture.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,GAAG,aAAa,CAAC;AAE7B,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,4EAA4E;IAC5E;QACE,EAAE,EAAE,uBAAuB;QAC3B,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,CAAC,wBAAwB,CAAC;QACvC,yEAAyE;QACzE,sEAAsE;QACtE,gEAAgE;QAChE,OAAO,EAAE;YACP,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc;YAC1D,iBAAiB,EAAE,yBAAyB,EAAE,WAAW;YACzD,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB;YACtD,uBAAuB,EAAE,oBAAoB,EAAE,iBAAiB;YAChE,WAAW,EAAE,UAAU;SACxB;QACD,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,uB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EAAE,cAAc,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAgB,EAAE,IAAI,EAAE,mDAAmD,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,sFAAsF,EAAE,MAAM,EAAE,6BAA6B,EAAE;gBACvR,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,QAAiB,EAAE,IAAI,EAAE,sDAAsD,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,yFAAyF,EAAE,MAAM,EAAE,8BAA8B,EAAE;gBAClS,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAiB,EAAE,IAAI,EAAE,sDAAsD,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,yFAAyF,EAAE,MAAM,EAAE,4BAA4B,EAAE;aACjS;SACF;KACF;CACO,CAAC;AAEX,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB;KAC9C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,mEAAmE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;KACnH,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,SAAU,EAAE,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * C4Graph — a C4 projection of a (composed) subsystem model on React Flow.
3
3
  *
4
- * Prototype test case: feed it a `C4Model` from `toC4()` and it draws the
4
+ * Feed it a `C4Model` from `buildC4Model()` and it draws the
5
5
  * system as a compound frame, its containers (or components) as boxes, and
6
6
  * externals/actors outside the system. `trail` steps render as flow
7
7
  * edges. Click a box to list the source components it rolled up.
@@ -11,7 +11,7 @@
11
11
  * drawers, no trail playback.
12
12
  */
13
13
  /// <reference types="react" />
14
- import type { C4Model } from './toC4';
14
+ import type { C4Model } from './c4';
15
15
  export interface C4GraphProps {
16
16
  model: C4Model;
17
17
  title?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"C4Graph.d.ts","sourceRoot":"","sources":["../../src/subsystem/C4Graph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;AAkBH,OAAO,KAAK,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5C;AAsaD,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAM1C"}
1
+ {"version":3,"file":"C4Graph.d.ts","sourceRoot":"","sources":["../../src/subsystem/C4Graph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;AAmBH,OAAO,KAAK,EAAE,OAAO,EAAU,MAAM,MAAM,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5C;AA2YD,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAM1C"}
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * C4Graph — a C4 projection of a (composed) subsystem model on React Flow.
4
4
  *
5
- * Prototype test case: feed it a `C4Model` from `toC4()` and it draws the
5
+ * Feed it a `C4Model` from `buildC4Model()` and it draws the
6
6
  * system as a compound frame, its containers (or components) as boxes, and
7
7
  * externals/actors outside the system. `trail` steps render as flow
8
8
  * edges. Click a box to list the source components it rolled up.
@@ -15,71 +15,17 @@ import { useEffect, useMemo, useState } from 'react';
15
15
  import { Handle, MarkerType, Position, ReactFlow, ReactFlowProvider, useReactFlow, } from '@xyflow/react';
16
16
  import { useTheme } from '@principal-ade/industry-theme';
17
17
  import { computeElkLayout } from '../utils/elkLayout';
18
- import { describeConstructBreakdown, MECHANISM_COLOR } from './model';
18
+ import { MECHANISM_COLOR } from './model';
19
+ import { C4NodeCard, NODE_H, NODE_W, nodeSize, nodeStyle } from './C4NodeCard';
19
20
  import { GRAPH_CANVAS_CLASS, GRAPH_NAV_PROPS, GraphChrome, GraphLayerStyle } from './graphChrome';
20
- const NODE_W = 230;
21
- const NODE_H = 80;
22
- function baseName(path) {
23
- const parts = path.split('/').filter(Boolean);
24
- return parts[parts.length - 1] ?? path;
25
- }
26
21
  function edgeColor(mechanism, fallback) {
27
22
  if (!mechanism)
28
23
  return fallback;
29
24
  return MECHANISM_COLOR[mechanism] ?? fallback;
30
25
  }
31
26
  function C4NodeView(props) {
32
- const { theme } = useTheme();
33
27
  const { node, selected } = props.data;
34
- const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
35
- const kindColor = node.kind === 'external'
36
- ? (theme.colors.warning ?? theme.colors.accent ?? theme.colors.info)
37
- : node.kind === 'actor'
38
- ? (theme.colors.accent ?? theme.colors.info)
39
- : (theme.colors.border ?? '#333');
40
- const tag = node.kind === 'container' ? 'container' : node.kind === 'external' ? 'external system' : node.kind === 'actor' ? 'actor' : 'component';
41
- const subtitle = node.kind === 'component'
42
- ? `${node.component?.construct ?? 'code'}${node.component?.file ? ` · ${baseName(node.component.file)}` : ''}`
43
- : `${describeConstructBreakdown(node.constructs)}${node.members.length > 0 ? ` · ${node.members.length} component${node.members.length === 1 ? '' : 's'}` : ''}`;
44
- return (_jsxs("div", { style: {
45
- width: NODE_W,
46
- height: NODE_H,
47
- boxSizing: 'border-box',
48
- display: 'flex',
49
- flexDirection: 'column',
50
- justifyContent: 'center',
51
- gap: 2,
52
- padding: '8px 12px',
53
- borderRadius: node.kind === 'actor' ? 20 : 8,
54
- background: theme.colors.backgroundSecondary ?? theme.colors.background,
55
- border: `2px ${node.kind === 'component' ? 'solid' : node.kind === 'container' ? 'solid' : 'dashed'} ${selected ? theme.colors.primary : kindColor}`,
56
- boxShadow: '0 1px 4px rgba(0,0,0,0.25)',
57
- cursor: 'pointer',
58
- fontFamily: theme.fonts.body,
59
- }, children: [_jsx("span", { style: {
60
- fontFamily: theme.fonts.monospace,
61
- fontSize: theme.fontSizes[0],
62
- letterSpacing: 0.5,
63
- textTransform: 'uppercase',
64
- color: kindColor,
65
- whiteSpace: 'nowrap',
66
- overflow: 'hidden',
67
- textOverflow: 'ellipsis',
68
- }, children: tag }), _jsx("span", { style: {
69
- fontWeight: 600,
70
- fontSize: theme.fontSizes[2],
71
- color: theme.colors.text,
72
- whiteSpace: 'nowrap',
73
- overflow: 'hidden',
74
- textOverflow: 'ellipsis',
75
- }, title: node.label, children: node.label }), _jsx("span", { style: {
76
- fontFamily: theme.fonts.monospace,
77
- fontSize: theme.fontSizes[0],
78
- color: muted,
79
- whiteSpace: 'nowrap',
80
- overflow: 'hidden',
81
- textOverflow: 'ellipsis',
82
- }, title: node.members.join(', '), children: subtitle }), _jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }));
28
+ return (_jsx(C4NodeCard, { node: node, selected: selected, handles: _jsxs(_Fragment, { children: [_jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }) }));
83
29
  }
84
30
  function C4GroupView(props) {
85
31
  const { theme } = useTheme();
@@ -135,23 +81,32 @@ function Inner({ model, title, onSelectNode }) {
135
81
  let alive = true;
136
82
  setReady(false);
137
83
  setSelectedId(null);
138
- const rfNodes = model.nodes.map((n, i) => ({
139
- id: n.id,
140
- type: 'c4-node',
141
- position: { x: (i % 4) * (NODE_W + 60), y: Math.floor(i / 4) * (NODE_H + 40) },
142
- width: NODE_W,
143
- height: NODE_H,
144
- ...(n.parentId ? { parentId: n.parentId } : {}),
145
- data: { node: n, selected: false },
146
- }));
84
+ // Per-node size, so a square component is laid out as a square. Feeding the
85
+ // container dimensions for everything would make ELK reserve 210x138 of
86
+ // space around a 132x132 box and space the component view twice as far
87
+ // apart as it needs.
88
+ const rfNodes = model.nodes.map((n, i) => {
89
+ const size = nodeSize(n);
90
+ return {
91
+ id: n.id,
92
+ type: 'c4-node',
93
+ // Fallback grid pitch uses the container box — the largest, so the
94
+ // pre-layout positions never overlap. ELK replaces them on success.
95
+ position: { x: (i % 5) * (NODE_W + 44), y: Math.floor(i / 5) * (NODE_H + 44) },
96
+ width: size.width,
97
+ height: size.height,
98
+ ...(n.parentId ? { parentId: n.parentId } : {}),
99
+ data: { node: n, selected: false },
100
+ };
101
+ });
147
102
  const groups = model.groups.map((g) => ({
148
103
  id: g.id,
149
104
  memberIds: g.memberIds,
150
105
  ...(g.parentId ? { parentId: g.parentId } : {}),
151
106
  }));
152
107
  const rfEdges = model.edges.map((e) => {
153
- const flow = e.kind === 'flow';
154
- const color = flow ? edgeColor(e.mechanisms[0], muted) : (theme.colors.border ?? '#666');
108
+ // Every edge here came from a trail step, so the mechanism colours apply.
109
+ const color = edgeColor(e.mechanisms[0], muted);
155
110
  return {
156
111
  id: e.id,
157
112
  source: e.source,
@@ -162,7 +117,7 @@ function Inner({ model, title, onSelectNode }) {
162
117
  style: {
163
118
  stroke: color,
164
119
  strokeWidth: 1 + Math.min(e.count, 6) * 0.4,
165
- ...(flow ? { strokeDasharray: '6 4' } : {}),
120
+ strokeDasharray: '6 4',
166
121
  },
167
122
  markerEnd: { type: MarkerType.ArrowClosed, color, width: 18, height: 18 },
168
123
  data: { edge: e },
@@ -244,7 +199,7 @@ function Inner({ model, title, onSelectNode }) {
244
199
  ? { ...n, data: { ...n.data, selected: n.id === selectedId } }
245
200
  : n), [nodes, selectedId]);
246
201
  const runtime = model.nodes.filter((n) => n.kind === 'container' || n.kind === 'component').length;
247
- const outside = model.nodes.filter((n) => n.kind === 'external' || n.kind === 'actor').length;
202
+ const outside = model.nodes.filter((n) => n.kind === 'external-system' || n.kind === 'person').length;
248
203
  return (_jsxs("div", { style: { position: 'relative', width: '100%', height: '100%', background: theme.colors.background }, children: [_jsx(GraphLayerStyle, {}), _jsx(ReactFlow, { nodes: displayNodes, edges: rfEdges, nodeTypes: nodeTypes, className: GRAPH_CANVAS_CLASS, ...GRAPH_NAV_PROPS, onNodeClick: (_e, node) => {
249
204
  if (node.type !== 'c4-node')
250
205
  return;
@@ -289,7 +244,17 @@ function Inner({ model, title, onSelectNode }) {
289
244
  }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [_jsx("span", { style: { fontWeight: 600, color: theme.colors.text, flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, children: selected.label }), _jsx("button", { type: "button", onClick: () => {
290
245
  setSelectedId(null);
291
246
  onSelectNode?.(null);
292
- }, "aria-label": "Clear selection", style: { border: 'none', background: 'transparent', color: muted, cursor: 'pointer', fontSize: theme.fontSizes[2], lineHeight: 1 }, children: "\u00D7" })] }), _jsxs("div", { style: { fontFamily: theme.fonts.monospace, fontSize: theme.fontSizes[0], color: muted, margin: '4px 0 8px' }, children: [selected.kind, " \u00B7 ", selected.members.length, " component", selected.members.length === 1 ? '' : 's', selected.models && selected.models.length > 0 ? ` · ${selected.models.length} model${selected.models.length === 1 ? '' : 's'}` : ''] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 2 }, children: selected.members.map((alias) => (_jsx("span", { title: alias, style: {
247
+ }, "aria-label": "Clear selection", style: { border: 'none', background: 'transparent', color: muted, cursor: 'pointer', fontSize: theme.fontSizes[2], lineHeight: 1 }, children: "\u00D7" })] }), _jsxs("div", { style: { fontFamily: theme.fonts.monospace, fontSize: theme.fontSizes[0], color: muted, margin: '4px 0 8px' }, children: [selected.kind, " \u00B7 ", selected.members.length, " component", selected.members.length === 1 ? '' : 's', selected.models && selected.models.length > 0 ? ` · ${selected.models.length} model${selected.models.length === 1 ? '' : 's'}` : ''] }), selected.kind === 'container' && (_jsxs("div", { style: {
248
+ fontFamily: theme.fonts.monospace,
249
+ fontSize: theme.fontSizes[0],
250
+ color: muted,
251
+ borderTop: `1px solid ${theme.colors.border ?? '#333'}`,
252
+ paddingTop: 6,
253
+ marginBottom: 8,
254
+ display: 'flex',
255
+ flexDirection: 'column',
256
+ gap: 3,
257
+ }, children: [_jsxs("span", { style: { color: nodeStyle(selected, theme).color }, children: [selected.state, selected.containerKind ? ` · ${selected.containerKind}` : ` · ${selected.kind}`] }), selected.technology ? (_jsxs("span", { children: ["technology: ", selected.technology] })) : (_jsx("span", { style: { color: theme.colors.warning ?? '#e8a33a' }, children: "technology: not stated" })), selected.description ? (_jsx("span", { style: { whiteSpace: 'normal', lineHeight: 1.4 }, children: selected.description })) : (_jsx("span", { style: { color: theme.colors.warning ?? '#e8a33a' }, children: "description: not stated" })), selected.derivedFrom && selected.derivedFrom.length > 1 && (_jsxs("span", { style: { whiteSpace: 'normal', lineHeight: 1.4 }, children: ["consolidated from: ", selected.derivedFrom.join(', ')] }))] })), _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 2 }, children: selected.members.map((alias) => (_jsx("span", { title: alias, style: {
293
258
  fontFamily: theme.fonts.monospace,
294
259
  fontSize: theme.fontSizes[0],
295
260
  color: theme.colors.text,