@principal-ai/subsystems-react 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/dist/components/ConfigurationSelector.d.ts +35 -0
- package/dist/components/ConfigurationSelector.d.ts.map +1 -0
- package/dist/components/ConfigurationSelector.js +63 -0
- package/dist/components/ConfigurationSelector.js.map +1 -0
- package/dist/components/GraphRenderer.d.ts +295 -0
- package/dist/components/GraphRenderer.d.ts.map +1 -0
- package/dist/components/GraphRenderer.js +2008 -0
- package/dist/components/GraphRenderer.js.map +1 -0
- package/dist/components/MultiCanvasRenderer.d.ts +75 -0
- package/dist/components/MultiCanvasRenderer.d.ts.map +1 -0
- package/dist/components/MultiCanvasRenderer.js +203 -0
- package/dist/components/MultiCanvasRenderer.js.map +1 -0
- package/dist/components/NodeTooltip.d.ts +24 -0
- package/dist/components/NodeTooltip.d.ts.map +1 -0
- package/dist/components/NodeTooltip.js +160 -0
- package/dist/components/NodeTooltip.js.map +1 -0
- package/dist/components/SelectionSidebar.d.ts +18 -0
- package/dist/components/SelectionSidebar.d.ts.map +1 -0
- package/dist/components/SelectionSidebar.js +190 -0
- package/dist/components/SelectionSidebar.js.map +1 -0
- package/dist/components/SequenceDiagramRenderer.d.ts +77 -0
- package/dist/components/SequenceDiagramRenderer.d.ts.map +1 -0
- package/dist/components/SequenceDiagramRenderer.js +604 -0
- package/dist/components/SequenceDiagramRenderer.js.map +1 -0
- package/dist/components/WorkflowSequenceDiagram.d.ts +63 -0
- package/dist/components/WorkflowSequenceDiagram.d.ts.map +1 -0
- package/dist/components/WorkflowSequenceDiagram.js +147 -0
- package/dist/components/WorkflowSequenceDiagram.js.map +1 -0
- package/dist/components/dashboard/DashboardRenderer.d.ts +10 -0
- package/dist/components/dashboard/DashboardRenderer.d.ts.map +1 -0
- package/dist/components/dashboard/DashboardRenderer.js +179 -0
- package/dist/components/dashboard/DashboardRenderer.js.map +1 -0
- package/dist/components/dashboard/MetricPanel.d.ts +10 -0
- package/dist/components/dashboard/MetricPanel.d.ts.map +1 -0
- package/dist/components/dashboard/MetricPanel.js +103 -0
- package/dist/components/dashboard/MetricPanel.js.map +1 -0
- package/dist/components/dashboard/MockDataProvider.d.ts +30 -0
- package/dist/components/dashboard/MockDataProvider.d.ts.map +1 -0
- package/dist/components/dashboard/MockDataProvider.js +270 -0
- package/dist/components/dashboard/MockDataProvider.js.map +1 -0
- package/dist/components/dashboard/components/BarChart.d.ts +10 -0
- package/dist/components/dashboard/components/BarChart.d.ts.map +1 -0
- package/dist/components/dashboard/components/BarChart.js +167 -0
- package/dist/components/dashboard/components/BarChart.js.map +1 -0
- package/dist/components/dashboard/components/LineChart.d.ts +10 -0
- package/dist/components/dashboard/components/LineChart.d.ts.map +1 -0
- package/dist/components/dashboard/components/LineChart.js +141 -0
- package/dist/components/dashboard/components/LineChart.js.map +1 -0
- package/dist/components/dashboard/components/MetricCard.d.ts +9 -0
- package/dist/components/dashboard/components/MetricCard.d.ts.map +1 -0
- package/dist/components/dashboard/components/MetricCard.js +163 -0
- package/dist/components/dashboard/components/MetricCard.js.map +1 -0
- package/dist/components/dashboard/components/SourceLink.d.ts +9 -0
- package/dist/components/dashboard/components/SourceLink.d.ts.map +1 -0
- package/dist/components/dashboard/components/SourceLink.js +39 -0
- package/dist/components/dashboard/components/SourceLink.js.map +1 -0
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts +9 -0
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +1 -0
- package/dist/components/dashboard/components/TimeRangeSelector.js +167 -0
- package/dist/components/dashboard/components/TimeRangeSelector.js.map +1 -0
- package/dist/components/dashboard/components/index.d.ts +6 -0
- package/dist/components/dashboard/components/index.d.ts.map +1 -0
- package/dist/components/dashboard/components/index.js +6 -0
- package/dist/components/dashboard/components/index.js.map +1 -0
- package/dist/components/dashboard/index.d.ts +6 -0
- package/dist/components/dashboard/index.d.ts.map +1 -0
- package/dist/components/dashboard/index.js +8 -0
- package/dist/components/dashboard/index.js.map +1 -0
- package/dist/components/dashboard/types.d.ts +74 -0
- package/dist/components/dashboard/types.d.ts.map +1 -0
- package/dist/components/dashboard/types.js +8 -0
- package/dist/components/dashboard/types.js.map +1 -0
- package/dist/components/session-events/SessionEventFeed.d.ts +34 -0
- package/dist/components/session-events/SessionEventFeed.d.ts.map +1 -0
- package/dist/components/session-events/SessionEventFeed.js +1196 -0
- package/dist/components/session-events/SessionEventFeed.js.map +1 -0
- package/dist/components/session-events/index.d.ts +7 -0
- package/dist/components/session-events/index.d.ts.map +1 -0
- package/dist/components/session-events/index.js +6 -0
- package/dist/components/session-events/index.js.map +1 -0
- package/dist/components/state-view/PipelineView.d.ts +14 -0
- package/dist/components/state-view/PipelineView.d.ts.map +1 -0
- package/dist/components/state-view/PipelineView.js +195 -0
- package/dist/components/state-view/PipelineView.js.map +1 -0
- package/dist/components/state-view/index.d.ts +14 -0
- package/dist/components/state-view/index.d.ts.map +1 -0
- package/dist/components/state-view/index.js +12 -0
- package/dist/components/state-view/index.js.map +1 -0
- package/dist/components/state-view/types.d.ts +188 -0
- package/dist/components/state-view/types.d.ts.map +1 -0
- package/dist/components/state-view/types.js +10 -0
- package/dist/components/state-view/types.js.map +1 -0
- package/dist/components/state-view/useStateView.d.ts +32 -0
- package/dist/components/state-view/useStateView.d.ts.map +1 -0
- package/dist/components/state-view/useStateView.js +129 -0
- package/dist/components/state-view/useStateView.js.map +1 -0
- package/dist/contexts/GraphEditContext.d.ts +20 -0
- package/dist/contexts/GraphEditContext.d.ts.map +1 -0
- package/dist/contexts/GraphEditContext.js +8 -0
- package/dist/contexts/GraphEditContext.js.map +1 -0
- package/dist/contexts/TooltipPortalContext.d.ts +8 -0
- package/dist/contexts/TooltipPortalContext.d.ts.map +1 -0
- package/dist/contexts/TooltipPortalContext.js +8 -0
- package/dist/contexts/TooltipPortalContext.js.map +1 -0
- package/dist/edges/CustomEdge.d.ts +24 -0
- package/dist/edges/CustomEdge.d.ts.map +1 -0
- package/dist/edges/CustomEdge.js +222 -0
- package/dist/edges/CustomEdge.js.map +1 -0
- package/dist/edges/GenericEdge.d.ts +18 -0
- package/dist/edges/GenericEdge.d.ts.map +1 -0
- package/dist/edges/GenericEdge.js +10 -0
- package/dist/edges/GenericEdge.js.map +1 -0
- package/dist/graphify/anchor.d.ts +28 -0
- package/dist/graphify/anchor.d.ts.map +1 -0
- package/dist/graphify/anchor.js +132 -0
- package/dist/graphify/anchor.js.map +1 -0
- package/dist/graphify/consolidated.d.ts +210 -0
- package/dist/graphify/consolidated.d.ts.map +1 -0
- package/dist/graphify/consolidated.js +11 -0
- package/dist/graphify/consolidated.js.map +1 -0
- package/dist/graphify/ids.d.ts +19 -0
- package/dist/graphify/ids.d.ts.map +1 -0
- package/dist/graphify/ids.js +46 -0
- package/dist/graphify/ids.js.map +1 -0
- package/dist/graphify/index.d.ts +18 -0
- package/dist/graphify/index.d.ts.map +1 -0
- package/dist/graphify/index.js +12 -0
- package/dist/graphify/index.js.map +1 -0
- package/dist/graphify/kind.d.ts +23 -0
- package/dist/graphify/kind.d.ts.map +1 -0
- package/dist/graphify/kind.js +77 -0
- package/dist/graphify/kind.js.map +1 -0
- package/dist/graphify/resolve.d.ts +48 -0
- package/dist/graphify/resolve.d.ts.map +1 -0
- package/dist/graphify/resolve.js +83 -0
- package/dist/graphify/resolve.js.map +1 -0
- package/dist/graphify/signature.d.ts +87 -0
- package/dist/graphify/signature.d.ts.map +1 -0
- package/dist/graphify/signature.js +276 -0
- package/dist/graphify/signature.js.map +1 -0
- package/dist/graphify/types.d.ts +141 -0
- package/dist/graphify/types.d.ts.map +1 -0
- package/dist/graphify/types.js +8 -0
- package/dist/graphify/types.js.map +1 -0
- package/dist/hooks/useElkLayout.d.ts +66 -0
- package/dist/hooks/useElkLayout.d.ts.map +1 -0
- package/dist/hooks/useElkLayout.js +136 -0
- package/dist/hooks/useElkLayout.js.map +1 -0
- package/dist/hooks/usePathBasedEvents.d.ts +42 -0
- package/dist/hooks/usePathBasedEvents.d.ts.map +1 -0
- package/dist/hooks/usePathBasedEvents.js +119 -0
- package/dist/hooks/usePathBasedEvents.js.map +1 -0
- package/dist/hooks/useSequenceLayout.d.ts +186 -0
- package/dist/hooks/useSequenceLayout.d.ts.map +1 -0
- package/dist/hooks/useSequenceLayout.js +327 -0
- package/dist/hooks/useSequenceLayout.js.map +1 -0
- package/dist/hooks/useUndoRedo.d.ts +80 -0
- package/dist/hooks/useUndoRedo.d.ts.map +1 -0
- package/dist/hooks/useUndoRedo.js +70 -0
- package/dist/hooks/useUndoRedo.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/CustomNode.d.ts +28 -0
- package/dist/nodes/CustomNode.d.ts.map +1 -0
- package/dist/nodes/CustomNode.js +820 -0
- package/dist/nodes/CustomNode.js.map +1 -0
- package/dist/nodes/GenericNode.d.ts +20 -0
- package/dist/nodes/GenericNode.d.ts.map +1 -0
- package/dist/nodes/GenericNode.js +20 -0
- package/dist/nodes/GenericNode.js.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts +55 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.js +81 -0
- package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -0
- package/dist/nodes/otel/OtelEventNode.d.ts +59 -0
- package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelEventNode.js +82 -0
- package/dist/nodes/otel/OtelEventNode.js.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts +53 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.js +105 -0
- package/dist/nodes/otel/OtelResourceNode.js.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts +53 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.js +81 -0
- package/dist/nodes/otel/OtelScopeNode.js.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts +61 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js +131 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -0
- package/dist/nodes/otel/index.d.ts +17 -0
- package/dist/nodes/otel/index.d.ts.map +1 -0
- package/dist/nodes/otel/index.js +13 -0
- package/dist/nodes/otel/index.js.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.js +178 -0
- package/dist/nodes/otel/shared/NodeBadges.js.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.js +96 -0
- package/dist/nodes/otel/shared/NodeContent.js.map +1 -0
- package/dist/nodes/otel/shared/index.d.ts +8 -0
- package/dist/nodes/otel/shared/index.d.ts.map +1 -0
- package/dist/nodes/otel/shared/index.js +8 -0
- package/dist/nodes/otel/shared/index.js.map +1 -0
- package/dist/nodes/otel/shared/types.d.ts +129 -0
- package/dist/nodes/otel/shared/types.d.ts.map +1 -0
- package/dist/nodes/otel/shared/types.js +5 -0
- package/dist/nodes/otel/shared/types.js.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts +42 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js +61 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js.map +1 -0
- package/dist/pierre/PierreFileView.d.ts +17 -0
- package/dist/pierre/PierreFileView.d.ts.map +1 -0
- package/dist/pierre/PierreFileView.js +46 -0
- package/dist/pierre/PierreFileView.js.map +1 -0
- package/dist/pierre/PierreSnippetView.d.ts +28 -0
- package/dist/pierre/PierreSnippetView.d.ts.map +1 -0
- package/dist/pierre/PierreSnippetView.js +105 -0
- package/dist/pierre/PierreSnippetView.js.map +1 -0
- package/dist/pierre/PierreThroughlineCodeView.d.ts +22 -0
- package/dist/pierre/PierreThroughlineCodeView.d.ts.map +1 -0
- package/dist/pierre/PierreThroughlineCodeView.js +206 -0
- package/dist/pierre/PierreThroughlineCodeView.js.map +1 -0
- package/dist/pierre/constructColors.d.ts +24 -0
- package/dist/pierre/constructColors.d.ts.map +1 -0
- package/dist/pierre/constructColors.js +91 -0
- package/dist/pierre/constructColors.js.map +1 -0
- package/dist/pierre/index.d.ts +12 -0
- package/dist/pierre/index.d.ts.map +1 -0
- package/dist/pierre/index.js +7 -0
- package/dist/pierre/index.js.map +1 -0
- package/dist/pierre/pierreBackground.d.ts +15 -0
- package/dist/pierre/pierreBackground.d.ts.map +1 -0
- package/dist/pierre/pierreBackground.js +31 -0
- package/dist/pierre/pierreBackground.js.map +1 -0
- package/dist/pierre/pierreFileLang.d.ts +27 -0
- package/dist/pierre/pierreFileLang.d.ts.map +1 -0
- package/dist/pierre/pierreFileLang.js +52 -0
- package/dist/pierre/pierreFileLang.js.map +1 -0
- package/dist/pierre/pierreSyntaxTheme.d.ts +11 -0
- package/dist/pierre/pierreSyntaxTheme.d.ts.map +1 -0
- package/dist/pierre/pierreSyntaxTheme.js +20 -0
- package/dist/pierre/pierreSyntaxTheme.js.map +1 -0
- package/dist/pierre/scrollAnchor.d.ts +5 -0
- package/dist/pierre/scrollAnchor.d.ts.map +1 -0
- package/dist/pierre/scrollAnchor.js +9 -0
- package/dist/pierre/scrollAnchor.js.map +1 -0
- package/dist/pierre/sliceSnippet.d.ts +10 -0
- package/dist/pierre/sliceSnippet.d.ts.map +1 -0
- package/dist/pierre/sliceSnippet.js +16 -0
- package/dist/pierre/sliceSnippet.js.map +1 -0
- package/dist/pierre/syntaxTokens.d.ts +11 -0
- package/dist/pierre/syntaxTokens.d.ts.map +1 -0
- package/dist/pierre/syntaxTokens.js +51 -0
- package/dist/pierre/syntaxTokens.js.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
- package/dist/subsystem/ComponentDeclaration.d.ts +87 -0
- package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -0
- package/dist/subsystem/ComponentDeclaration.js +374 -0
- package/dist/subsystem/ComponentDeclaration.js.map +1 -0
- package/dist/subsystem/FileDrawer.d.ts +17 -0
- package/dist/subsystem/FileDrawer.d.ts.map +1 -0
- package/dist/subsystem/FileDrawer.js +72 -0
- package/dist/subsystem/FileDrawer.js.map +1 -0
- package/dist/subsystem/GraphLayoutCover.d.ts +20 -0
- package/dist/subsystem/GraphLayoutCover.d.ts.map +1 -0
- package/dist/subsystem/GraphLayoutCover.js +42 -0
- package/dist/subsystem/GraphLayoutCover.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +96 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.js +1059 -0
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -0
- package/dist/subsystem/SubsystemFileTree.d.ts +24 -0
- package/dist/subsystem/SubsystemFileTree.d.ts.map +1 -0
- package/dist/subsystem/SubsystemFileTree.js +150 -0
- package/dist/subsystem/SubsystemFileTree.js.map +1 -0
- package/dist/subsystem/declarationRef.d.ts +39 -0
- package/dist/subsystem/declarationRef.d.ts.map +1 -0
- package/dist/subsystem/declarationRef.js +32 -0
- package/dist/subsystem/declarationRef.js.map +1 -0
- package/dist/subsystem/formatDeclaration.d.ts +11 -0
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -0
- package/dist/subsystem/formatDeclaration.js +146 -0
- package/dist/subsystem/formatDeclaration.js.map +1 -0
- package/dist/subsystem/model.d.ts +353 -0
- package/dist/subsystem/model.d.ts.map +1 -0
- package/dist/subsystem/model.js +503 -0
- package/dist/subsystem/model.js.map +1 -0
- package/dist/subsystem/nodes.d.ts +69 -0
- package/dist/subsystem/nodes.d.ts.map +1 -0
- package/dist/subsystem/nodes.js +289 -0
- package/dist/subsystem/nodes.js.map +1 -0
- package/dist/subsystem/paths.d.ts +63 -0
- package/dist/subsystem/paths.d.ts.map +1 -0
- package/dist/subsystem/paths.js +86 -0
- package/dist/subsystem/paths.js.map +1 -0
- package/dist/subsystem/tokenizeComponent.d.ts +20 -0
- package/dist/subsystem/tokenizeComponent.d.ts.map +1 -0
- package/dist/subsystem/tokenizeComponent.js +56 -0
- package/dist/subsystem/tokenizeComponent.js.map +1 -0
- package/dist/subsystem/tokenizeFormatted.d.ts +12 -0
- package/dist/subsystem/tokenizeFormatted.d.ts.map +1 -0
- package/dist/subsystem/tokenizeFormatted.js +13 -0
- package/dist/subsystem/tokenizeFormatted.js.map +1 -0
- package/dist/utils/animationMapping.d.ts +53 -0
- package/dist/utils/animationMapping.d.ts.map +1 -0
- package/dist/utils/animationMapping.js +126 -0
- package/dist/utils/animationMapping.js.map +1 -0
- package/dist/utils/canvasBounds.d.ts +50 -0
- package/dist/utils/canvasBounds.d.ts.map +1 -0
- package/dist/utils/canvasBounds.js +88 -0
- package/dist/utils/canvasBounds.js.map +1 -0
- package/dist/utils/elkLayout.d.ts +137 -0
- package/dist/utils/elkLayout.d.ts.map +1 -0
- package/dist/utils/elkLayout.js +596 -0
- package/dist/utils/elkLayout.js.map +1 -0
- package/dist/utils/graphConverter.d.ts +18 -0
- package/dist/utils/graphConverter.d.ts.map +1 -0
- package/dist/utils/graphConverter.js +114 -0
- package/dist/utils/graphConverter.js.map +1 -0
- package/dist/utils/iconResolver.d.ts +29 -0
- package/dist/utils/iconResolver.d.ts.map +1 -0
- package/dist/utils/iconResolver.js +30 -0
- package/dist/utils/iconResolver.js.map +1 -0
- package/dist/utils/orientationUtils.d.ts +19 -0
- package/dist/utils/orientationUtils.d.ts.map +1 -0
- package/dist/utils/orientationUtils.js +62 -0
- package/dist/utils/orientationUtils.js.map +1 -0
- package/package.json +80 -0
- package/src/components/ConfigurationSelector.tsx +133 -0
- package/src/components/GraphRenderer.tsx +3195 -0
- package/src/components/MultiCanvasRenderer.tsx +295 -0
- package/src/components/NodeTooltip.tsx +279 -0
- package/src/components/PendingChanges.test.tsx +375 -0
- package/src/components/SelectionSidebar.tsx +352 -0
- package/src/components/SequenceDiagramRenderer.tsx +1156 -0
- package/src/components/WorkflowSequenceDiagram.tsx +270 -0
- package/src/components/dashboard/DashboardRenderer.tsx +317 -0
- package/src/components/dashboard/MetricPanel.tsx +254 -0
- package/src/components/dashboard/MockDataProvider.ts +330 -0
- package/src/components/dashboard/components/BarChart.tsx +299 -0
- package/src/components/dashboard/components/LineChart.tsx +279 -0
- package/src/components/dashboard/components/MetricCard.tsx +270 -0
- package/src/components/dashboard/components/SourceLink.tsx +63 -0
- package/src/components/dashboard/components/TimeRangeSelector.tsx +280 -0
- package/src/components/dashboard/components/index.ts +5 -0
- package/src/components/dashboard/index.ts +47 -0
- package/src/components/dashboard/types.ts +126 -0
- package/src/components/session-events/SessionEventFeed.tsx +1797 -0
- package/src/components/session-events/index.ts +13 -0
- package/src/components/state-view/PipelineView.tsx +347 -0
- package/src/components/state-view/index.ts +14 -0
- package/src/components/state-view/types.ts +261 -0
- package/src/components/state-view/useStateView.ts +205 -0
- package/src/contexts/GraphEditContext.tsx +27 -0
- package/src/contexts/TooltipPortalContext.ts +8 -0
- package/src/edges/CustomEdge.tsx +402 -0
- package/src/edges/GenericEdge.tsx +36 -0
- package/src/graphify/anchor.test.ts +124 -0
- package/src/graphify/anchor.ts +160 -0
- package/src/graphify/consolidated.ts +246 -0
- package/src/graphify/ids.ts +48 -0
- package/src/graphify/index.ts +72 -0
- package/src/graphify/kind.test.ts +108 -0
- package/src/graphify/kind.ts +120 -0
- package/src/graphify/resolve.test.ts +89 -0
- package/src/graphify/resolve.ts +115 -0
- package/src/graphify/signature.test.ts +278 -0
- package/src/graphify/signature.ts +354 -0
- package/src/graphify/types.ts +164 -0
- package/src/hooks/useElkLayout.test.ts +134 -0
- package/src/hooks/useElkLayout.ts +191 -0
- package/src/hooks/usePathBasedEvents.ts +192 -0
- package/src/hooks/useSequenceLayout.ts +543 -0
- package/src/hooks/useUndoRedo.ts +144 -0
- package/src/index.ts +341 -0
- package/src/nodes/CustomNode.tsx +1231 -0
- package/src/nodes/GenericNode.tsx +55 -0
- package/src/nodes/otel/OtelBoundaryNode.tsx +224 -0
- package/src/nodes/otel/OtelEventNode.tsx +225 -0
- package/src/nodes/otel/OtelResourceNode.tsx +251 -0
- package/src/nodes/otel/OtelScopeNode.tsx +221 -0
- package/src/nodes/otel/OtelSpanConventionNode.tsx +295 -0
- package/src/nodes/otel/index.ts +23 -0
- package/src/nodes/otel/shared/NodeBadges.tsx +295 -0
- package/src/nodes/otel/shared/NodeContent.tsx +204 -0
- package/src/nodes/otel/shared/index.ts +8 -0
- package/src/nodes/otel/shared/types.ts +138 -0
- package/src/nodes/otel/shared/useNodeBehavior.ts +114 -0
- package/src/pierre/PierreFileView.tsx +81 -0
- package/src/pierre/PierreSnippetView.tsx +184 -0
- package/src/pierre/PierreThroughlineCodeView.tsx +304 -0
- package/src/pierre/constructColors.test.ts +52 -0
- package/src/pierre/constructColors.ts +112 -0
- package/src/pierre/index.ts +18 -0
- package/src/pierre/pierreBackground.ts +33 -0
- package/src/pierre/pierreFileLang.test.ts +26 -0
- package/src/pierre/pierreFileLang.ts +55 -0
- package/src/pierre/pierreSyntaxTheme.ts +23 -0
- package/src/pierre/scrollAnchor.test.ts +13 -0
- package/src/pierre/scrollAnchor.ts +11 -0
- package/src/pierre/sliceSnippet.test.ts +21 -0
- package/src/pierre/sliceSnippet.ts +31 -0
- package/src/pierre/syntaxTokens.test.ts +35 -0
- package/src/pierre/syntaxTokens.ts +60 -0
- package/src/stories/Audit/BoundaryNodes.stories.tsx +385 -0
- package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +1448 -0
- package/src/stories/Audit/CanvasNodeTypes.stories.tsx +1049 -0
- package/src/stories/Audit/ColorPriority.stories.tsx +895 -0
- package/src/stories/Audit/DiamondBadges.stories.tsx +629 -0
- package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +724 -0
- package/src/stories/Audit/NodeFieldsAudit.stories.tsx +996 -0
- package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +715 -0
- package/src/stories/Audit/NodeShapes.stories.tsx +1208 -0
- package/src/stories/Audit/WideNodesTesting.stories.tsx +1045 -0
- package/src/stories/Components/DashboardRenderer.stories.tsx +263 -0
- package/src/stories/Components/GraphRenderer.stories.tsx +3236 -0
- package/src/stories/Components/MultiCanvasRenderer.stories.tsx +370 -0
- package/src/stories/Components/SequenceDiagram.stories.tsx +255 -0
- package/src/stories/Components/StateView.stories.tsx +417 -0
- package/src/stories/Components/TraceViewer.stories.tsx +442 -0
- package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +802 -0
- package/src/stories/Features/AnimationWorkshop.stories.tsx +727 -0
- package/src/stories/Features/ChangeTypeVisual.stories.tsx +67 -0
- package/src/stories/Features/EventDrivenAnimations.stories.tsx +513 -0
- package/src/stories/Features/MultiConfig.stories.tsx +539 -0
- package/src/stories/Introduction.mdx +34 -0
- package/src/stories/Layout/ElkEdgeRouting.stories.tsx +539 -0
- package/src/stories/Layout/GraphOrientation.stories.tsx +500 -0
- package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +352 -0
- package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +560 -0
- package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +491 -0
- package/src/stories/Nodes/NumericColors.stories.tsx +440 -0
- package/src/stories/OTEL/EventNameDisplay.stories.tsx +694 -0
- package/src/stories/OTEL/EventNameFallback.stories.tsx +578 -0
- package/src/stories/OTEL/OtelComponents.stories.tsx +422 -0
- package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +806 -0
- package/src/stories/OTEL/RawEventCards.stories.tsx +57 -0
- package/src/stories/OTEL/SpanBadges.stories.tsx +840 -0
- package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +209 -0
- package/src/stories/Pierre/CodeView.stories.tsx +219 -0
- package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +721 -0
- package/src/stories/RealWorld/FileCitySequence.stories.tsx +516 -0
- package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +336 -0
- package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +321 -0
- package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
- package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
- package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
- package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +239 -0
- package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +216 -0
- package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +70 -0
- package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +68 -0
- package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
- package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +681 -0
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
- package/src/stories/__traces__/test-run.canvas.json +241 -0
- package/src/stories/data/activity-feed-analytics.dashboard.json +300 -0
- package/src/stories/data/file-city-images-transformed.otel.canvas.json +295 -0
- package/src/stories/data/file-city-workflows.json +269 -0
- package/src/stories/data/graph-converter-test-execution.json +443 -0
- package/src/stories/data/graph-converter-test.workflow.json +105 -0
- package/src/stories/data/graph-converter-validated-execution.json +58 -0
- package/src/stories/data/opencode-session-raw-events.json +273396 -0
- package/src/subsystem/ComponentDeclaration.tsx +643 -0
- package/src/subsystem/FileDrawer.tsx +106 -0
- package/src/subsystem/GraphLayoutCover.tsx +69 -0
- package/src/subsystem/SubsystemComponentGraph.tsx +1644 -0
- package/src/subsystem/SubsystemFileTree.tsx +190 -0
- package/src/subsystem/declarationRef.test.ts +33 -0
- package/src/subsystem/declarationRef.ts +63 -0
- package/src/subsystem/formatDeclaration.ts +174 -0
- package/src/subsystem/model.test.ts +244 -0
- package/src/subsystem/model.ts +850 -0
- package/src/subsystem/nodes.test.ts +56 -0
- package/src/subsystem/nodes.tsx +443 -0
- package/src/subsystem/paths.test.ts +123 -0
- package/src/subsystem/paths.ts +127 -0
- package/src/subsystem/tokenizeComponent.ts +70 -0
- package/src/subsystem/tokenizeFormatted.ts +19 -0
- package/src/utils/animationMapping.ts +166 -0
- package/src/utils/canvasBounds.ts +146 -0
- package/src/utils/elkLayout.test.ts +240 -0
- package/src/utils/elkLayout.ts +779 -0
- package/src/utils/graphConverter.ts +148 -0
- package/src/utils/iconResolver.tsx +53 -0
- package/src/utils/orientationUtils.ts +73 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve graphify type-name references to their defining nodes.
|
|
3
|
+
*
|
|
4
|
+
* A `references` edge (`parameter_type`, `return_type`, `field`,
|
|
5
|
+
* `generic_arg`) targets either the type's real definition node or a
|
|
6
|
+
* *sourceless stub* graphify left behind when the name could not be uniquely
|
|
7
|
+
* resolved at extraction time (mirrors `_rewire_unique_stub_nodes` there:
|
|
8
|
+
* ambiguous same-label definitions and never-defined names stay stubs).
|
|
9
|
+
*
|
|
10
|
+
* This module applies the same conservative matching from the consumer side so
|
|
11
|
+
* UI click targets can distinguish "jump to definition" from "N candidates"
|
|
12
|
+
* from "not in this corpus".
|
|
13
|
+
*/
|
|
14
|
+
import type { GraphifyNode } from './types';
|
|
15
|
+
import type { GraphifyReferenceInfo } from './consolidated';
|
|
16
|
+
/** Outcome of resolving one type reference. */
|
|
17
|
+
export type GraphifyTypeRefStatus =
|
|
18
|
+
/** Target node is a real definition — jump to its `source_file`. */
|
|
19
|
+
'resolved'
|
|
20
|
+
/** Target was a stub and multiple same-label definitions exist. */
|
|
21
|
+
| 'ambiguous'
|
|
22
|
+
/** Target was a stub and nothing in the corpus defines the name. */
|
|
23
|
+
| 'unresolved'
|
|
24
|
+
/** No nodeId on the ref, or the id is not in the graph. */
|
|
25
|
+
| 'missing';
|
|
26
|
+
export interface GraphifyTypeRefResolution {
|
|
27
|
+
status: GraphifyTypeRefStatus;
|
|
28
|
+
/** The definition node when resolved; the stub itself otherwise. */
|
|
29
|
+
node: GraphifyNode | null;
|
|
30
|
+
/** Same-label definitions when the target was an unresolved stub. */
|
|
31
|
+
candidates: GraphifyNode[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Mirror graphify's `normalise_callable_label`: trim, strip surrounding
|
|
35
|
+
* parens/leading dots, lowercase. `SessionReader()` and `sessionreader`
|
|
36
|
+
* collapse to the same key.
|
|
37
|
+
*/
|
|
38
|
+
export declare function normalizeGraphifyLabel(label: string): string;
|
|
39
|
+
/** Prebuilt lookup state — build once per graph, resolve many refs. */
|
|
40
|
+
export interface GraphifyTypeResolver {
|
|
41
|
+
resolve(nodeId: string | undefined, fallbackLabel?: string): GraphifyTypeRefResolution;
|
|
42
|
+
}
|
|
43
|
+
export declare function createGraphifyTypeResolver(nodes: readonly GraphifyNode[]): GraphifyTypeResolver;
|
|
44
|
+
/** One-shot convenience over {@link createGraphifyTypeResolver}. */
|
|
45
|
+
export declare function resolveGraphifyTypeRef(nodes: readonly GraphifyNode[], ref: Pick<GraphifyReferenceInfo, 'nodeId'> | {
|
|
46
|
+
nodeId?: string;
|
|
47
|
+
} | undefined, fallbackLabel?: string): GraphifyTypeRefResolution;
|
|
48
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/graphify/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,+CAA+C;AAC/C,MAAM,MAAM,qBAAqB;AAC/B,oEAAoE;AAClE,UAAU;AACZ,mEAAmE;GACjE,WAAW;AACb,oEAAoE;GAClE,YAAY;AACd,2DAA2D;GACzD,SAAS,CAAC;AAEd,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,oEAAoE;IACpE,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,qEAAqE;IACrE,UAAU,EAAE,YAAY,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM5D;AAaD,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,yBAAyB,CAAC;CACxF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,oBAAoB,CAwC/F;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,YAAY,EAAE,EAC9B,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAC5E,aAAa,CAAC,EAAE,MAAM,GACrB,yBAAyB,CAE3B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve graphify type-name references to their defining nodes.
|
|
3
|
+
*
|
|
4
|
+
* A `references` edge (`parameter_type`, `return_type`, `field`,
|
|
5
|
+
* `generic_arg`) targets either the type's real definition node or a
|
|
6
|
+
* *sourceless stub* graphify left behind when the name could not be uniquely
|
|
7
|
+
* resolved at extraction time (mirrors `_rewire_unique_stub_nodes` there:
|
|
8
|
+
* ambiguous same-label definitions and never-defined names stay stubs).
|
|
9
|
+
*
|
|
10
|
+
* This module applies the same conservative matching from the consumer side so
|
|
11
|
+
* UI click targets can distinguish "jump to definition" from "N candidates"
|
|
12
|
+
* from "not in this corpus".
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Mirror graphify's `normalise_callable_label`: trim, strip surrounding
|
|
16
|
+
* parens/leading dots, lowercase. `SessionReader()` and `sessionreader`
|
|
17
|
+
* collapse to the same key.
|
|
18
|
+
*/
|
|
19
|
+
export function normalizeGraphifyLabel(label) {
|
|
20
|
+
return label
|
|
21
|
+
.trim()
|
|
22
|
+
.replace(/^[()]+|[()]+$/g, '')
|
|
23
|
+
.replace(/^\.+/, '')
|
|
24
|
+
.toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
const FILE_SUFFIX_RE = /\.(py|js|jsx|ts|tsx|mjs|cjs|java|go|rs|rb|php|cs|cpp|cc|c|h|hpp|pas|pp|dpr|swift|kt|scala|dart|lua|pl|pm|ex|exs|zig|vue|svelte)$/i;
|
|
27
|
+
function isDefinition(node) {
|
|
28
|
+
if (node.file_type !== 'code')
|
|
29
|
+
return false;
|
|
30
|
+
const file = typeof node.source_file === 'string' ? node.source_file : '';
|
|
31
|
+
if (!file)
|
|
32
|
+
return false;
|
|
33
|
+
const label = typeof node.label === 'string' ? node.label.trim() : '';
|
|
34
|
+
return !!label && !FILE_SUFFIX_RE.test(label);
|
|
35
|
+
}
|
|
36
|
+
export function createGraphifyTypeResolver(nodes) {
|
|
37
|
+
const byId = new Map();
|
|
38
|
+
const defsByExactLabel = new Map();
|
|
39
|
+
const defsByFoldedLabel = new Map();
|
|
40
|
+
for (const node of nodes) {
|
|
41
|
+
byId.set(String(node.id), node);
|
|
42
|
+
if (!isDefinition(node))
|
|
43
|
+
continue;
|
|
44
|
+
const label = String(node.label).trim();
|
|
45
|
+
(defsByExactLabel.get(label) ?? defsByExactLabel.set(label, []).get(label)).push(node);
|
|
46
|
+
const folded = normalizeGraphifyLabel(label);
|
|
47
|
+
if (!folded)
|
|
48
|
+
continue;
|
|
49
|
+
(defsByFoldedLabel.get(folded) ?? defsByFoldedLabel.set(folded, []).get(folded)).push(node);
|
|
50
|
+
}
|
|
51
|
+
function resolve(nodeId, fallbackLabel) {
|
|
52
|
+
if (!nodeId)
|
|
53
|
+
return { status: 'missing', node: null, candidates: [] };
|
|
54
|
+
const target = byId.get(nodeId);
|
|
55
|
+
if (!target)
|
|
56
|
+
return { status: 'missing', node: null, candidates: [] };
|
|
57
|
+
// Real definition (graphify rewired the reference onto it, or it lived in
|
|
58
|
+
// the referencing file all along).
|
|
59
|
+
if (isDefinition(target))
|
|
60
|
+
return { status: 'resolved', node: target, candidates: [] };
|
|
61
|
+
// Sourceless stub — try the rewire tiers: exact label, then folded.
|
|
62
|
+
const label = typeof target.label === 'string' && target.label.trim() ? target.label.trim() : (fallbackLabel ?? '');
|
|
63
|
+
let candidates = defsByExactLabel.get(label) ?? [];
|
|
64
|
+
if (candidates.length !== 1) {
|
|
65
|
+
const folded = normalizeGraphifyLabel(label);
|
|
66
|
+
candidates = folded ? (defsByFoldedLabel.get(folded) ?? []) : [];
|
|
67
|
+
}
|
|
68
|
+
if (candidates.length === 1) {
|
|
69
|
+
// Unique match — same fold `_rewire_unique_stub_nodes` performs at
|
|
70
|
+
// extraction time; graphs built before that pass land here instead.
|
|
71
|
+
return { status: 'resolved', node: candidates[0], candidates };
|
|
72
|
+
}
|
|
73
|
+
if (candidates.length > 1)
|
|
74
|
+
return { status: 'ambiguous', node: target, candidates };
|
|
75
|
+
return { status: 'unresolved', node: target, candidates: [] };
|
|
76
|
+
}
|
|
77
|
+
return { resolve };
|
|
78
|
+
}
|
|
79
|
+
/** One-shot convenience over {@link createGraphifyTypeResolver}. */
|
|
80
|
+
export function resolveGraphifyTypeRef(nodes, ref, fallbackLabel) {
|
|
81
|
+
return createGraphifyTypeResolver(nodes).resolve(ref?.nodeId, fallbackLabel);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/graphify/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwBH;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,OAAO,KAAK;SACT,IAAI,EAAE;SACN,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;SACnB,WAAW,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,cAAc,GAClB,mIAAmI,CAAC;AAEtI,SAAS,YAAY,CAAC,IAAkB;IACtC,IAAI,IAAI,CAAC,SAAS,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAOD,MAAM,UAAU,0BAA0B,CAAC,KAA8B;IACvE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC7C,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC3D,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE5D,KAAK,MAAM,IAAI,IA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|
1
|
+
/**
|
|
2
|
+
* Signature / params verification against graphify `references` edges.
|
|
3
|
+
*
|
|
4
|
+
* Graphify does not store arity or parameter names — only `parameter_type` /
|
|
5
|
+
* `return_type` edges to type nodes (unions become multiple edges). Comparison
|
|
6
|
+
* is therefore **named type bags**, not positional arity.
|
|
7
|
+
*
|
|
8
|
+
* Many TS/JS functions have no such edges yet. When graphify has no signature
|
|
9
|
+
* signal, the check is skipped (not a hard fail) so Verify can still gate on
|
|
10
|
+
* kind. When graphify *does* emit types, claimed detail must match.
|
|
11
|
+
*/
|
|
12
|
+
import type { GraphifyEdge, GraphifyNode } from './types';
|
|
13
|
+
/** Inferred signature from graphify edges (no param names). */
|
|
14
|
+
export interface GraphifyInferredSignature {
|
|
15
|
+
parameters: Array<{
|
|
16
|
+
type: string;
|
|
17
|
+
nodeId: string;
|
|
18
|
+
}>;
|
|
19
|
+
returnType?: string;
|
|
20
|
+
returnTypeNodeId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Types reachable only via `generic_arg` edges (Promise<X>, Array<X>,
|
|
23
|
+
* Omit<X,…>, Map<…>). Kept out of `parameters`/`returnType` — not read
|
|
24
|
+
* by the bag comparison — so skipped cases can be told apart.
|
|
25
|
+
*/
|
|
26
|
+
genericArgs?: Array<{
|
|
27
|
+
type: string;
|
|
28
|
+
nodeId: string;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Count of `inline_parameter` self-edges (anonymous object-literal params).
|
|
32
|
+
* Graphify emits one per anon param only with its `--inline-params` flag.
|
|
33
|
+
*/
|
|
34
|
+
inlineParameters?: number;
|
|
35
|
+
/** True when at least one parameter_type or return_type edge exists. */
|
|
36
|
+
hasSignal: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface ClaimedSignature {
|
|
39
|
+
parameters?: Array<{
|
|
40
|
+
name?: string;
|
|
41
|
+
type: string;
|
|
42
|
+
}>;
|
|
43
|
+
returnType?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Granular skip classification. `signature_skipped` means "graphify has no
|
|
47
|
+
* parameter_type/return_type edges to compare", but *why* matters for future
|
|
48
|
+
* work:
|
|
49
|
+
* - `no_claimed_types`: authored detail has no named types (primitives/inline).
|
|
50
|
+
* - `generic_arg_only`: claimed types resolve, but only as `generic_arg`
|
|
51
|
+
* (Promise/Omit/Map/Array wrappers) — this extractor does not read them.
|
|
52
|
+
* - `partially_generic_arg`: some, not all, claimed types resolve as generic_arg.
|
|
53
|
+
* - `unresolved_claimed_types`: claimed names have no edges at all
|
|
54
|
+
* (global/npm types, or a dropped same-file label collision).
|
|
55
|
+
*/
|
|
56
|
+
export type SignatureSkipCode = 'no_claimed_types' | 'generic_arg_only' | 'partially_generic_arg' | 'unresolved_claimed_types';
|
|
57
|
+
export interface SignatureCompareResult {
|
|
58
|
+
match: boolean;
|
|
59
|
+
/** Skipped because graphify had no parameter/return type edges. */
|
|
60
|
+
skipped: boolean;
|
|
61
|
+
reason?: string;
|
|
62
|
+
/** Granular skip classification when `skipped` is true. */
|
|
63
|
+
skipCode?: SignatureSkipCode;
|
|
64
|
+
claimed: {
|
|
65
|
+
parameterTypes: string[];
|
|
66
|
+
returnTypes: string[];
|
|
67
|
+
};
|
|
68
|
+
inferred: {
|
|
69
|
+
parameterTypes: string[];
|
|
70
|
+
returnTypes: string[];
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Pull comparable named type identifiers out of an authored / graphify type
|
|
75
|
+
* string. Skips primitives, inline object types, and known wrappers.
|
|
76
|
+
*/
|
|
77
|
+
export declare function extractNamedTypes(typeStr: string): string[];
|
|
78
|
+
/** Collect parameter_type / return_type edges for a callable node. */
|
|
79
|
+
export declare function extractGraphifySignature(nodeId: string, edges: readonly GraphifyEdge[], nodesById: ReadonlyMap<string, GraphifyNode>): GraphifyInferredSignature;
|
|
80
|
+
/**
|
|
81
|
+
* Compare authored function/method detail signature to graphify edges.
|
|
82
|
+
*
|
|
83
|
+
* - No graphify signal → skipped (match=true).
|
|
84
|
+
* - Otherwise named-type bags for params and return must match exactly.
|
|
85
|
+
*/
|
|
86
|
+
export declare function compareSignatures(claimed: ClaimedSignature | undefined, inferred: GraphifyInferredSignature): SignatureCompareResult;
|
|
87
|
+
//# sourceMappingURL=signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/graphify/signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACzC,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAChC,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAC1B,kBAAkB,GAClB,kBAAkB,GAClB,uBAAuB,GACvB,0BAA0B,CAAC;AAE9B,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE;QAAE,cAAc,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC7D,QAAQ,EAAE;QAAE,cAAc,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC9D;AA4CD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA4B3D;AAWD,sEAAsE;AACtE,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,YAAY,EAAE,EAC9B,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,GAC1C,yBAAyB,CAgC3B;AA8CD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,gBAAgB,GAAG,SAAS,EACrC,QAAQ,EAAE,yBAAyB,GACjC,sBAAsB,CA6GxB"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signature / params verification against graphify `references` edges.
|
|
3
|
+
*
|
|
4
|
+
* Graphify does not store arity or parameter names — only `parameter_type` /
|
|
5
|
+
* `return_type` edges to type nodes (unions become multiple edges). Comparison
|
|
6
|
+
* is therefore **named type bags**, not positional arity.
|
|
7
|
+
*
|
|
8
|
+
* Many TS/JS functions have no such edges yet. When graphify has no signature
|
|
9
|
+
* signal, the check is skipped (not a hard fail) so Verify can still gate on
|
|
10
|
+
* kind. When graphify *does* emit types, claimed detail must match.
|
|
11
|
+
*/
|
|
12
|
+
const PRIMITIVES = new Set([
|
|
13
|
+
'string',
|
|
14
|
+
'number',
|
|
15
|
+
'boolean',
|
|
16
|
+
'void',
|
|
17
|
+
'null',
|
|
18
|
+
'undefined',
|
|
19
|
+
'any',
|
|
20
|
+
'unknown',
|
|
21
|
+
'never',
|
|
22
|
+
'object',
|
|
23
|
+
'symbol',
|
|
24
|
+
'bigint',
|
|
25
|
+
'true',
|
|
26
|
+
'false',
|
|
27
|
+
'this',
|
|
28
|
+
]);
|
|
29
|
+
/** Common generic wrappers — keep inner type names, drop the wrapper. */
|
|
30
|
+
const TYPE_WRAPPERS = new Set([
|
|
31
|
+
'Promise',
|
|
32
|
+
'Array',
|
|
33
|
+
'ReadonlyArray',
|
|
34
|
+
'Map',
|
|
35
|
+
'Set',
|
|
36
|
+
'WeakMap',
|
|
37
|
+
'WeakSet',
|
|
38
|
+
'Record',
|
|
39
|
+
'Partial',
|
|
40
|
+
'Required',
|
|
41
|
+
'Readonly',
|
|
42
|
+
'Awaited',
|
|
43
|
+
'NonNullable',
|
|
44
|
+
'ReturnType',
|
|
45
|
+
'Parameters',
|
|
46
|
+
'InstanceType',
|
|
47
|
+
'Pick',
|
|
48
|
+
'Omit',
|
|
49
|
+
'Exclude',
|
|
50
|
+
'Extract',
|
|
51
|
+
]);
|
|
52
|
+
/**
|
|
53
|
+
* Pull comparable named type identifiers out of an authored / graphify type
|
|
54
|
+
* string. Skips primitives, inline object types, and known wrappers.
|
|
55
|
+
*/
|
|
56
|
+
export function extractNamedTypes(typeStr) {
|
|
57
|
+
if (!typeStr || !typeStr.trim())
|
|
58
|
+
return [];
|
|
59
|
+
let s = typeStr;
|
|
60
|
+
// Drop string/template literals so their contents aren't tokens.
|
|
61
|
+
s = s.replace(/`(?:\\.|[^`\\])*`/g, ' ');
|
|
62
|
+
s = s.replace(/'(?:\\.|[^'\\])*'/g, ' ');
|
|
63
|
+
s = s.replace(/"(?:\\.|[^"\\])*"/g, ' ');
|
|
64
|
+
// Drop inline object / mapped types (non-greedy, repeated for nesting).
|
|
65
|
+
for (let i = 0; i < 8; i++) {
|
|
66
|
+
const next = s.replace(/\{[^{}]*\}/g, ' ');
|
|
67
|
+
if (next === s)
|
|
68
|
+
break;
|
|
69
|
+
s = next;
|
|
70
|
+
}
|
|
71
|
+
const found = new Set();
|
|
72
|
+
const re = /[A-Za-z_][A-Za-z0-9_.]*/g;
|
|
73
|
+
let m;
|
|
74
|
+
while ((m = re.exec(s)) !== null) {
|
|
75
|
+
const raw = m[0];
|
|
76
|
+
const base = raw.includes('.') ? (raw.split('.').pop() ?? raw) : raw;
|
|
77
|
+
if (PRIMITIVES.has(base))
|
|
78
|
+
continue;
|
|
79
|
+
if (TYPE_WRAPPERS.has(base))
|
|
80
|
+
continue;
|
|
81
|
+
// Skip lone lowercase keywords that aren't types we care about.
|
|
82
|
+
if (base === 'typeof' || base === 'keyof' || base === 'infer' || base === 'extends') {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
found.add(base);
|
|
86
|
+
}
|
|
87
|
+
return [...found].sort();
|
|
88
|
+
}
|
|
89
|
+
function labelOf(nodeId, nodesById) {
|
|
90
|
+
const n = nodesById.get(nodeId);
|
|
91
|
+
const label = n && typeof n.label === 'string' ? n.label.trim() : '';
|
|
92
|
+
return label || nodeId;
|
|
93
|
+
}
|
|
94
|
+
/** Collect parameter_type / return_type edges for a callable node. */
|
|
95
|
+
export function extractGraphifySignature(nodeId, edges, nodesById) {
|
|
96
|
+
const id = String(nodeId);
|
|
97
|
+
const parameters = [];
|
|
98
|
+
const genericArgs = [];
|
|
99
|
+
let returnType;
|
|
100
|
+
let returnTypeNodeId;
|
|
101
|
+
let inlineParameters = 0;
|
|
102
|
+
for (const e of edges) {
|
|
103
|
+
if (String(e.source) !== id || e.relation !== 'references')
|
|
104
|
+
continue;
|
|
105
|
+
const ctx = e.context;
|
|
106
|
+
const target = String(e.target);
|
|
107
|
+
if (ctx === 'parameter_type') {
|
|
108
|
+
parameters.push({ type: labelOf(target, nodesById), nodeId: target });
|
|
109
|
+
}
|
|
110
|
+
else if (ctx === 'return_type' && returnType === undefined) {
|
|
111
|
+
returnType = labelOf(target, nodesById);
|
|
112
|
+
returnTypeNodeId = target;
|
|
113
|
+
}
|
|
114
|
+
else if (ctx === 'generic_arg') {
|
|
115
|
+
genericArgs.push({ type: labelOf(target, nodesById), nodeId: target });
|
|
116
|
+
}
|
|
117
|
+
else if (ctx === 'inline_parameter') {
|
|
118
|
+
inlineParameters += 1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
parameters,
|
|
123
|
+
genericArgs,
|
|
124
|
+
returnType,
|
|
125
|
+
returnTypeNodeId,
|
|
126
|
+
inlineParameters,
|
|
127
|
+
hasSignal: parameters.length > 0 || returnType !== undefined,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function bagsEqual(a, b) {
|
|
131
|
+
if (a.length !== b.length)
|
|
132
|
+
return false;
|
|
133
|
+
for (let i = 0; i < a.length; i++) {
|
|
134
|
+
if (a[i] !== b[i])
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
function claimedBags(claimed) {
|
|
140
|
+
const parameterTypes = new Set();
|
|
141
|
+
for (const p of claimed?.parameters ?? []) {
|
|
142
|
+
for (const t of extractNamedTypes(p.type))
|
|
143
|
+
parameterTypes.add(t);
|
|
144
|
+
}
|
|
145
|
+
const returnTypes = new Set();
|
|
146
|
+
if (claimed?.returnType) {
|
|
147
|
+
for (const t of extractNamedTypes(claimed.returnType))
|
|
148
|
+
returnTypes.add(t);
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
parameterTypes: [...parameterTypes].sort(),
|
|
152
|
+
returnTypes: [...returnTypes].sort(),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function inferredBags(inferred) {
|
|
156
|
+
const parameterTypes = new Set();
|
|
157
|
+
for (const p of inferred.parameters) {
|
|
158
|
+
for (const t of extractNamedTypes(p.type))
|
|
159
|
+
parameterTypes.add(t);
|
|
160
|
+
}
|
|
161
|
+
const returnTypes = new Set();
|
|
162
|
+
if (inferred.returnType) {
|
|
163
|
+
for (const t of extractNamedTypes(inferred.returnType))
|
|
164
|
+
returnTypes.add(t);
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
parameterTypes: [...parameterTypes].sort(),
|
|
168
|
+
returnTypes: [...returnTypes].sort(),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Compare authored function/method detail signature to graphify edges.
|
|
173
|
+
*
|
|
174
|
+
* - No graphify signal → skipped (match=true).
|
|
175
|
+
* - Otherwise named-type bags for params and return must match exactly.
|
|
176
|
+
*/
|
|
177
|
+
export function compareSignatures(claimed, inferred) {
|
|
178
|
+
const claimedBagsResult = claimedBags(claimed);
|
|
179
|
+
const inferredBagsResult = inferredBags(inferred);
|
|
180
|
+
// Anonymous object-literal params ("inline") carry no named types, so they
|
|
181
|
+
// only ever surface via graphify's `inline_parameter` markers. A claim of an
|
|
182
|
+
// inline param against a graph with no marker proves nothing (the store
|
|
183
|
+
// graph may predate the flag), so absence alone keeps the skip path. When
|
|
184
|
+
// the graph DOES emit a marker, anon-count parity is compared like any
|
|
185
|
+
// parameter signal.
|
|
186
|
+
const claimedAnonCount = (claimed?.parameters ?? []).filter((p) => (p.type ?? '').trim().startsWith('{')).length;
|
|
187
|
+
const inferredAnonCount = inferred.inlineParameters ?? 0;
|
|
188
|
+
const hasAnonSignal = inferredAnonCount > 0;
|
|
189
|
+
if (!inferred.hasSignal && !hasAnonSignal) {
|
|
190
|
+
const claimedTypes = new Set([
|
|
191
|
+
...claimedBagsResult.parameterTypes,
|
|
192
|
+
...claimedBagsResult.returnTypes,
|
|
193
|
+
]);
|
|
194
|
+
const genericArgTypes = new Set((inferred.genericArgs ?? []).map((a) => a.type));
|
|
195
|
+
const sorted = [...claimedTypes].sort();
|
|
196
|
+
let skipCode;
|
|
197
|
+
let reason;
|
|
198
|
+
if (sorted.length === 0) {
|
|
199
|
+
skipCode = 'no_claimed_types';
|
|
200
|
+
reason = 'no claimable named types in authored signature (primitives/inline only)';
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
const found = sorted.filter((t) => genericArgTypes.has(t));
|
|
204
|
+
if (found.length === sorted.length) {
|
|
205
|
+
skipCode = 'generic_arg_only';
|
|
206
|
+
reason = `claimed types ([${sorted.join(', ')}]) present only as generic_arg (wrapper-indirected: Promise/Omit/Map/Array) — extractor does not read generic_arg`;
|
|
207
|
+
}
|
|
208
|
+
else if (found.length > 0) {
|
|
209
|
+
skipCode = 'partially_generic_arg';
|
|
210
|
+
reason = `claimed types resolve only via generic_arg for ${found.join(', ')}; rest unresolved (${sorted.filter((t) => !genericArgTypes.has(t)).join(', ')})`;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
skipCode = 'unresolved_claimed_types';
|
|
214
|
+
reason = `claimed types ([${sorted.join(', ')}]) have no parameter_type/return_type/generic_arg edges (global/npm types or dropped same-file label collision)`;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
match: true,
|
|
219
|
+
skipped: true,
|
|
220
|
+
reason,
|
|
221
|
+
skipCode,
|
|
222
|
+
claimed: claimedBagsResult,
|
|
223
|
+
inferred: inferredBagsResult,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
const paramsOk = bagsEqual(claimedBagsResult.parameterTypes, inferredBagsResult.parameterTypes);
|
|
227
|
+
const anonParamsOk = claimedAnonCount === inferredAnonCount;
|
|
228
|
+
const returnOk = bagsEqual(claimedBagsResult.returnTypes, inferredBagsResult.returnTypes);
|
|
229
|
+
const match = paramsOk && anonParamsOk && returnOk;
|
|
230
|
+
if (paramsOk && anonParamsOk && !returnOk) {
|
|
231
|
+
// Params verified, but the claimed return types can't be backed. When
|
|
232
|
+
// every claimed return type is either wrapper-indirected (generic_arg:
|
|
233
|
+
// Promise<X>, Omit<X,…>) or entirely unresolved (global/npm/DOM types),
|
|
234
|
+
// that's a coverage gap, not a lie — mark the check skipped instead of
|
|
235
|
+
// hard-failing, mirroring the pre-signal skip classification. A mixed
|
|
236
|
+
// bag (some generic, some unresolved) stays a hard mismatch.
|
|
237
|
+
const claimReturn = claimedBagsResult.returnTypes;
|
|
238
|
+
if (claimReturn.length > 0) {
|
|
239
|
+
const genericArgTypes = new Set((inferred.genericArgs ?? []).map((a) => a.type));
|
|
240
|
+
const gen = claimReturn.filter((t) => genericArgTypes.has(t));
|
|
241
|
+
const unresolved = claimReturn.filter((t) => !genericArgTypes.has(t));
|
|
242
|
+
let skipCode;
|
|
243
|
+
let reason;
|
|
244
|
+
if (gen.length === claimReturn.length) {
|
|
245
|
+
skipCode = 'generic_arg_only';
|
|
246
|
+
reason = `claimed return types ([${claimReturn.join(', ')}]) present only as generic_arg (wrapper-indirected: Promise/Omit/Map/Array) — extractor does not read generic_arg; params verified`;
|
|
247
|
+
}
|
|
248
|
+
else if (unresolved.length === claimReturn.length) {
|
|
249
|
+
skipCode = 'unresolved_claimed_types';
|
|
250
|
+
reason = `claimed return types ([${claimReturn.join(', ')}]) have no parameter_type/return_type/generic_arg edges (global/npm types or dropped same-file label collision); params verified`;
|
|
251
|
+
}
|
|
252
|
+
if (skipCode) {
|
|
253
|
+
return {
|
|
254
|
+
match: true,
|
|
255
|
+
skipped: true,
|
|
256
|
+
reason,
|
|
257
|
+
skipCode,
|
|
258
|
+
claimed: claimedBagsResult,
|
|
259
|
+
inferred: inferredBagsResult,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
match,
|
|
266
|
+
skipped: false,
|
|
267
|
+
reason: match
|
|
268
|
+
? undefined
|
|
269
|
+
: !paramsOk || !anonParamsOk
|
|
270
|
+
? 'parameter_types_mismatch'
|
|
271
|
+
: 'return_type_mismatch',
|
|
272
|
+
claimed: claimedBagsResult,
|
|
273
|
+
inferred: inferredBagsResult,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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G,0BAA0B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,oIAAoI,CAAC;aAC9L;iBAAM,IAAI,UAAU,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE;gBACpD,QAAQ,GAAG,0BAA0B,CAAC;gBACtC,MAAM,GAAG,0BAA0B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,kIAAkI,CAAC;aAC5L;YACD,IAAI,QAAQ,EAAE;gBACb,OAAO;oBACN,KAAK,EAAE,IAAI;oBACX,OAAO,EAAE,IAAI;oBACb,MAAM;oBACN,QAAQ;oBACR,OAAO,EAAE,iBAAiB;oBAC1B,QAAQ,EAAE,kBAAkB;iBAC5B,CAAC;aACF;SACD;KACD;IACD,OAAO;QACN,KAAK;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;YACZ,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,YAAY;gBAC3B,CAAC,CAAC,0BAA0B;gBAC5B,CAAC,CAAC,sBAAsB;QAC1B,OAAO,EAAE,iBAAiB;QAC1B,QAAQ,EAAE,kBAAkB;KAC5B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graphify graph.json schema types.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the graphify data model (graphify/validate.py, graphify/export.py)
|
|
5
|
+
* so graphify output can be consumed by this library in a type-compatible way.
|
|
6
|
+
*/
|
|
7
|
+
/** Any JSON-serializable value carried in node/edge metadata. */
|
|
8
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
};
|
|
11
|
+
/** Node classification (graphify/validate.py VALID_FILE_TYPES). */
|
|
12
|
+
export type GraphifyFileType = 'code' | 'document' | 'paper' | 'image' | 'rationale' | 'concept';
|
|
13
|
+
/** Edge provenance tag (graphify/validate.py VALID_CONFIDENCES). */
|
|
14
|
+
export type GraphifyConfidence = 'EXTRACTED' | 'INFERRED' | 'AMBIGUOUS';
|
|
15
|
+
/** Optional semantic kind carried on nodes (e.g. `module`, `namespace`). */
|
|
16
|
+
export type GraphifyNodeType = 'module' | 'namespace' | string;
|
|
17
|
+
/** Canonical relation verbs emitted by graphify extractors and resolvers. */
|
|
18
|
+
export type GraphifyRelation = 'calls' | 'imports' | 'imports_from' | 're_exports' | 'references' | 'inherits' | 'implements' | 'mixes_in' | 'uses' | 'contains' | 'defines' | 'method' | 'decorator' | 'rationale_for' | 'semantically_similar_to' | string;
|
|
19
|
+
/**
|
|
20
|
+
* A graphify node.
|
|
21
|
+
*
|
|
22
|
+
* Required fields are enforced by graphify/validate.py:
|
|
23
|
+
* `id`, `label`, `file_type`, `source_file`. The rest are populated by the
|
|
24
|
+
* extractors (`source_location`, optional `type`/`metadata`) and by the build
|
|
25
|
+
* writer (`community`, `community_name`, `norm_label`).
|
|
26
|
+
*/
|
|
27
|
+
export interface GraphifyNode {
|
|
28
|
+
/** Stable identifier: repo-relative path + symbol names (make_id slug). */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Human-readable name. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Classification used as the primary node kind. */
|
|
33
|
+
file_type: GraphifyFileType;
|
|
34
|
+
/** Repo-relative path of the source file this node came from. */
|
|
35
|
+
source_file: string;
|
|
36
|
+
/** `L<line>` location, or `''` for sourceless stub nodes. */
|
|
37
|
+
source_location?: string | null;
|
|
38
|
+
/** Optional semantic kind (e.g. `module`, `namespace`). */
|
|
39
|
+
type?: GraphifyNodeType;
|
|
40
|
+
/** Node state / extra node definitions. */
|
|
41
|
+
state?: string;
|
|
42
|
+
/** Arbitrary per-extractor metadata (e.g. `{ kind: "csharp_namespace" }`). */
|
|
43
|
+
metadata?: Record<string, JsonValue>;
|
|
44
|
+
/** Leiden community id, stamped at build time. */
|
|
45
|
+
community?: number | null;
|
|
46
|
+
/** Human-readable community label, stamped at build time. */
|
|
47
|
+
community_name?: string;
|
|
48
|
+
/** Diacritic-stripped lowercased label, stamped at build time. */
|
|
49
|
+
norm_label?: string;
|
|
50
|
+
/** Extra fields tolerated for forward compatibility. */
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A graphify edge.
|
|
55
|
+
*
|
|
56
|
+
* Required fields: `source`, `target`, `relation`, `confidence`, `source_file`.
|
|
57
|
+
* `context` is populated for `references` edges (e.g. `type`, `return_type`,
|
|
58
|
+
* `field`, `generic_arg`).
|
|
59
|
+
*/
|
|
60
|
+
export interface GraphifyEdge {
|
|
61
|
+
/** Source node id. */
|
|
62
|
+
source: string;
|
|
63
|
+
/** Target node id. */
|
|
64
|
+
target: string;
|
|
65
|
+
/** Canonical relation verb. */
|
|
66
|
+
relation: GraphifyRelation;
|
|
67
|
+
/** Provenance: read directly from source vs. resolved by graphify. */
|
|
68
|
+
confidence: GraphifyConfidence;
|
|
69
|
+
/** Float 0.0-1.0; 1.0 for EXTRACTED, discrete rubric for INFERRED. */
|
|
70
|
+
confidence_score?: number;
|
|
71
|
+
/** Repo-relative path where the relationship was found. */
|
|
72
|
+
source_file: string;
|
|
73
|
+
/** `L<line>` location of the relationship. */
|
|
74
|
+
source_location?: string | null;
|
|
75
|
+
/** Edge weight. */
|
|
76
|
+
weight?: number;
|
|
77
|
+
/** Reference context for `references` edges. */
|
|
78
|
+
context?: string;
|
|
79
|
+
/** Arbitrary per-extractor metadata. */
|
|
80
|
+
metadata?: Record<string, JsonValue>;
|
|
81
|
+
/** Extra fields tolerated for forward compatibility. */
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A graphify hyperedge — a group relationship connecting 3+ nodes.
|
|
86
|
+
*
|
|
87
|
+
* Member list is canonical on `nodes` (aliases `members`/`node_ids` are folded
|
|
88
|
+
* by graphify/export.py build normalization).
|
|
89
|
+
*/
|
|
90
|
+
export interface GraphifyHyperedge {
|
|
91
|
+
/** Stable identifier. */
|
|
92
|
+
id: string;
|
|
93
|
+
/** Human-readable label. */
|
|
94
|
+
label?: string;
|
|
95
|
+
/** Member node ids (canonical key). */
|
|
96
|
+
nodes: string[];
|
|
97
|
+
/** Group relation verb (e.g. `participate_in`, `implement`, `form`). */
|
|
98
|
+
relation?: GraphifyRelation;
|
|
99
|
+
/** Provenance tag. */
|
|
100
|
+
confidence?: GraphifyConfidence;
|
|
101
|
+
/** Float 0.0-1.0. */
|
|
102
|
+
confidence_score?: number;
|
|
103
|
+
/** Repo-relative path where the relationship was found. */
|
|
104
|
+
source_file?: string;
|
|
105
|
+
/** Extra fields tolerated for forward compatibility. */
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}
|
|
108
|
+
/** Graph-level metadata stored on the graph (`graph` key). */
|
|
109
|
+
export interface GraphifyGraphMetadata {
|
|
110
|
+
directed?: boolean;
|
|
111
|
+
multigraph?: boolean;
|
|
112
|
+
/** Edges may be serialized under `links` (NetworkX node-link) or `edges`. */
|
|
113
|
+
hyperedges?: GraphifyHyperedge[];
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The full graph.json document.
|
|
118
|
+
*
|
|
119
|
+
* graphify writes NetworkX node-link format: nodes under `nodes`, edges under
|
|
120
|
+
* `links`. Older/legacy payloads may use `edges` instead of `links`.
|
|
121
|
+
*/
|
|
122
|
+
export interface GraphifyGraph {
|
|
123
|
+
/** Graph nodes. */
|
|
124
|
+
nodes: GraphifyNode[];
|
|
125
|
+
/** Graph edges (NetworkX node-link key). */
|
|
126
|
+
links?: GraphifyEdge[];
|
|
127
|
+
/** Legacy alias for `links`. */
|
|
128
|
+
edges?: GraphifyEdge[];
|
|
129
|
+
/** Group relationships connecting 3+ nodes. */
|
|
130
|
+
hyperedges?: GraphifyHyperedge[];
|
|
131
|
+
/** Graph-level metadata (directed, multigraph, hyperedges). */
|
|
132
|
+
graph?: GraphifyGraphMetadata;
|
|
133
|
+
/** Top-level directed flag (NetworkX). */
|
|
134
|
+
directed?: boolean;
|
|
135
|
+
/** Top-level multigraph flag (NetworkX). */
|
|
136
|
+
multigraph?: boolean;
|
|
137
|
+
/** Git HEAD the graph was built against, when available. */
|
|
138
|
+
built_at_commit?: string;
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=types.d.ts.map
|