@principal-ai/subsystems-react 0.28.7 → 0.30.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 (37) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/pierre/PierreWalkthroughCodeView.js +1 -1
  5. package/dist/pierre/PierreWalkthroughCodeView.js.map +1 -1
  6. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -1
  7. package/dist/stories/Subsystem/ComponentGraph/fixtures.js +0 -1
  8. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -1
  9. package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -1
  10. package/dist/subsystem/ComponentDeclaration.js +5 -1
  11. package/dist/subsystem/ComponentDeclaration.js.map +1 -1
  12. package/dist/subsystem/SubsystemComponentGraph.d.ts +1 -1
  13. package/dist/subsystem/SubsystemComponentGraph.js +2 -2
  14. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  15. package/dist/subsystem/model.d.ts +31 -3
  16. package/dist/subsystem/model.d.ts.map +1 -1
  17. package/dist/subsystem/model.js +0 -4
  18. package/dist/subsystem/model.js.map +1 -1
  19. package/dist/subsystem/nodes.js +1 -1
  20. package/dist/subsystem/nodes.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/index.ts +2 -0
  23. package/src/pierre/PierreWalkthroughCodeView.tsx +1 -1
  24. package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +110 -0
  25. package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +2 -2
  26. package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +6 -6
  27. package/src/stories/Subsystem/ComponentGraph/EdgeViews.stories.tsx +7 -7
  28. package/src/stories/Subsystem/ComponentGraph/Issues.stories.tsx +1 -1
  29. package/src/stories/Subsystem/ComponentGraph/ModuleBadges.stories.tsx +5 -5
  30. package/src/stories/Subsystem/ComponentGraph/Modules.stories.tsx +2 -2
  31. package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +2 -2
  32. package/src/stories/Subsystem/ComponentGraph/fixtures.ts +0 -1
  33. package/src/subsystem/ComponentDeclaration.tsx +5 -0
  34. package/src/subsystem/SubsystemComponentGraph.tsx +3 -3
  35. package/src/subsystem/model.test.ts +2 -2
  36. package/src/subsystem/model.ts +31 -6
  37. package/src/subsystem/nodes.tsx +1 -1
@@ -26,6 +26,27 @@ import { purlOwnerName, purlRepoKey } from './paths';
26
26
  export type SubsystemConstructDeclaration = GraphifyComponentDetail;
27
27
  export type SubsystemDeclarationProvenance = 'verified' | 'authored';
28
28
 
29
+ /** One declared parameter in an agent-extracted (augmented) signature. */
30
+ export interface SubsystemSignatureParameter {
31
+ /** Parameter name when the language declares one. */
32
+ name?: string;
33
+ /** Declared type as written in source (empty string when untyped). */
34
+ type: string;
35
+ /** True for optional parameters (`?`, defaulted, rest, …). */
36
+ optional?: boolean;
37
+ }
38
+
39
+ /**
40
+ * Language-agnostic declared signature extracted by an agent from source and
41
+ * accepted as a graphify augmentation. Confirms a function/method when Graphify
42
+ * has no usable signature edges. Distinct from `declaration` (the model's own
43
+ * structured shape) and from a graphify-derived signature.
44
+ */
45
+ export interface SubsystemSignatureClaim {
46
+ parameters: SubsystemSignatureParameter[];
47
+ returnType?: string;
48
+ }
49
+
29
50
  export type SubsystemComponentConstruct =
30
51
  | 'class'
31
52
  | 'function'
@@ -91,7 +112,6 @@ export interface SubsystemDeclToken {
91
112
  * Belongs on `relations[]`, not on walkthrough hops.
92
113
  */
93
114
  export type SubsystemRelationType =
94
- | 'imports'
95
115
  | 'extends'
96
116
  | 'inherits'
97
117
  | 'implements'
@@ -120,7 +140,7 @@ export type SubsystemEdgeMechanism =
120
140
  /**
121
141
  * Which edge vocabulary the canvas draws. The two vocabularies are disjoint;
122
142
  * a view shows only edges (and their labels) from the selected source.
123
- * - `relations`: only topology relation edges (`imports`, `extends`, …)
143
+ * - `relations`: only topology relation edges (`extends`, `implements`, …)
124
144
  * - `walkthroughs`: only walkthrough hop edges (`calls`, `feeds`, …)
125
145
  */
126
146
  export type SubsystemEdgeView = 'relations' | 'walkthroughs';
@@ -251,6 +271,15 @@ export interface SubsystemComponent {
251
271
  * a different language just needs a different tokenizer and text joiner.
252
272
  */
253
273
  tokens?: SubsystemDeclToken[];
274
+ /**
275
+ * Accepted agent-extracted signature (from the graphify augmentation store)
276
+ * confirming this function/method when Graphify has no usable signature
277
+ * edges. Populated by the host when serving an enriched graph — never
278
+ * persisted in the model document. Its presence is how a component knows its
279
+ * declaration is augmentation-backed; the panel renders no special treatment
280
+ * yet.
281
+ */
282
+ signatureAugmentation?: SubsystemSignatureClaim;
254
283
  /**
255
284
  * Anchored declaration location: graphify start line + hash of that line's
256
285
  * content at capture time. Populated by verify when an exact anchor resolves.
@@ -945,7 +974,6 @@ export type SubsystemGraphEdge = Edge<SubsystemGraphEdgeData>;
945
974
  * source (the two unions are disjoint).
946
975
  */
947
976
  export const SUBSYSTEM_RELATION_TYPES = [
948
- 'imports',
949
977
  'extends',
950
978
  'inherits',
951
979
  'implements',
@@ -986,7 +1014,6 @@ export function isWalkthroughMechanism(
986
1014
  }
987
1015
 
988
1016
  export const MECHANISM_COLOR: Record<SubsystemEdgeMechanism, string> = {
989
- imports: '#0893d2', // blue
990
1017
  calls: '#4ec9b0', // teal
991
1018
  extends: '#b48ead', // purple
992
1019
  inherits: '#9b6fd0', // purple
@@ -1004,7 +1031,6 @@ export const MECHANISM_COLOR: Record<SubsystemEdgeMechanism, string> = {
1004
1031
  };
1005
1032
 
1006
1033
  export const MECHANISM_STYLE: Record<SubsystemEdgeMechanism, 'solid' | 'dashed' | 'dotted'> = {
1007
- imports: 'solid',
1008
1034
  calls: 'solid',
1009
1035
  extends: 'dashed',
1010
1036
  inherits: 'dashed',
@@ -1024,7 +1050,6 @@ export const MECHANISM_STYLE: Record<SubsystemEdgeMechanism, 'solid' | 'dashed'
1024
1050
  /** Mechanism → [description, verifiable-with-graphify]. Drives the "not
1025
1051
  * directly verifiable" styling of edge labels. */
1026
1052
  export const MECHANISM_DESCRIPTIONS: [SubsystemEdgeMechanism, string, boolean][] = [
1027
- ['imports', 'import statement (code-level dependency)', true],
1028
1053
  ['calls', 'function/method call (call graph edge)', true],
1029
1054
  ['extends', 'class inheritance', true],
1030
1055
  ['inherits', 'class inheritance', true],
@@ -539,7 +539,7 @@ export function SubsystemEdge({
539
539
  markerEnd,
540
540
  }: EdgeProps<SubsystemGraphEdge>) {
541
541
  const path = data?.elkPath ?? '';
542
- const mechanism = data?.mechanism ?? 'imports';
542
+ const mechanism = data?.mechanism ?? 'uses';
543
543
  const color = MECHANISM_COLOR[mechanism] ?? '#888';
544
544
  // Dash style comes from the mechanism table (dashed = inverted-control or
545
545
  // observational relationships: hierarchy, registration, watches).