@flanksource/clicky-ui 0.3.44 → 0.3.46
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 +24 -0
- package/dist/ai.cjs +4 -2
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.js +3 -1
- package/dist/components/MdxEditorField.cjs +40 -22
- package/dist/components/MdxEditorField.cjs.map +1 -1
- package/dist/components/MdxEditorField.d.ts.map +1 -1
- package/dist/components/MdxEditorField.js +41 -23
- package/dist/components/MdxEditorField.js.map +1 -1
- package/dist/components/json-schema-form-item-summary.cjs +6 -1
- package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
- package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-summary.js +6 -1
- package/dist/components/json-schema-form-item-summary.js.map +1 -1
- package/dist/data/AccessMark.cjs +23 -0
- package/dist/data/AccessMark.cjs.map +1 -0
- package/dist/data/AccessMark.d.ts +11 -0
- package/dist/data/AccessMark.d.ts.map +1 -0
- package/dist/data/AccessMark.js +23 -0
- package/dist/data/AccessMark.js.map +1 -0
- package/dist/data/CodeBlock.cjs +3 -2
- package/dist/data/CodeBlock.cjs.map +1 -1
- package/dist/data/CodeBlock.d.ts +3 -1
- package/dist/data/CodeBlock.d.ts.map +1 -1
- package/dist/data/CodeBlock.js +3 -2
- package/dist/data/CodeBlock.js.map +1 -1
- package/dist/data/CodeDiff.cjs +116 -23
- package/dist/data/CodeDiff.cjs.map +1 -1
- package/dist/data/CodeDiff.d.ts +26 -0
- package/dist/data/CodeDiff.d.ts.map +1 -1
- package/dist/data/CodeDiff.js +116 -23
- package/dist/data/CodeDiff.js.map +1 -1
- package/dist/data/GraphDiagram.cjs +75 -11
- package/dist/data/GraphDiagram.cjs.map +1 -1
- package/dist/data/GraphDiagram.d.ts +17 -2
- package/dist/data/GraphDiagram.d.ts.map +1 -1
- package/dist/data/GraphDiagram.js +76 -12
- package/dist/data/GraphDiagram.js.map +1 -1
- package/dist/data/GraphDiagramGroups.cjs +100 -0
- package/dist/data/GraphDiagramGroups.cjs.map +1 -0
- package/dist/data/GraphDiagramGroups.d.ts +24 -0
- package/dist/data/GraphDiagramGroups.d.ts.map +1 -0
- package/dist/data/GraphDiagramGroups.js +100 -0
- package/dist/data/GraphDiagramGroups.js.map +1 -0
- package/dist/data/GraphDiagramNodes.cjs +46 -51
- package/dist/data/GraphDiagramNodes.cjs.map +1 -1
- package/dist/data/GraphDiagramNodes.d.ts +8 -9
- package/dist/data/GraphDiagramNodes.d.ts.map +1 -1
- package/dist/data/GraphDiagramNodes.js +46 -51
- package/dist/data/GraphDiagramNodes.js.map +1 -1
- package/dist/data/JsonView.cjs +118 -49
- package/dist/data/JsonView.cjs.map +1 -1
- package/dist/data/JsonView.d.ts +13 -10
- package/dist/data/JsonView.d.ts.map +1 -1
- package/dist/data/JsonView.js +118 -49
- package/dist/data/JsonView.js.map +1 -1
- package/dist/data/MarkdownEditor.cjs +2 -2
- package/dist/data/MarkdownEditor.cjs.map +1 -1
- package/dist/data/MarkdownEditor.js +2 -2
- package/dist/data/MarkdownEditor.js.map +1 -1
- package/dist/data/TreeNode.cjs +1 -1
- package/dist/data/TreeNode.cjs.map +1 -1
- package/dist/data/TreeNode.d.ts.map +1 -1
- package/dist/data/TreeNode.js +1 -1
- package/dist/data/TreeNode.js.map +1 -1
- package/dist/data/ai/AdvancedChatConfig.cjs +90 -249
- package/dist/data/ai/AdvancedChatConfig.cjs.map +1 -1
- package/dist/data/ai/AdvancedChatConfig.d.ts +2 -5
- package/dist/data/ai/AdvancedChatConfig.d.ts.map +1 -1
- package/dist/data/ai/AdvancedChatConfig.js +91 -250
- package/dist/data/ai/AdvancedChatConfig.js.map +1 -1
- package/dist/data/ai/ChatButton.cjs +2 -0
- package/dist/data/ai/ChatButton.cjs.map +1 -1
- package/dist/data/ai/ChatButton.d.ts +1 -1
- package/dist/data/ai/ChatButton.d.ts.map +1 -1
- package/dist/data/ai/ChatButton.js +2 -0
- package/dist/data/ai/ChatButton.js.map +1 -1
- package/dist/data/ai/ChatFab.cjs +5 -1
- package/dist/data/ai/ChatFab.cjs.map +1 -1
- package/dist/data/ai/ChatFab.d.ts +5 -1
- package/dist/data/ai/ChatFab.d.ts.map +1 -1
- package/dist/data/ai/ChatFab.js +5 -1
- package/dist/data/ai/ChatFab.js.map +1 -1
- package/dist/data/ai/ChatWindow.cjs +2 -8
- package/dist/data/ai/ChatWindow.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.js +2 -8
- package/dist/data/ai/ChatWindow.js.map +1 -1
- package/dist/data/ai/ChatWindow.runtime.cjs +0 -5
- package/dist/data/ai/ChatWindow.runtime.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.runtime.d.ts +0 -2
- package/dist/data/ai/ChatWindow.runtime.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.runtime.js +0 -5
- package/dist/data/ai/ChatWindow.runtime.js.map +1 -1
- package/dist/data/ai/PromptRunEditor/runtimeActions.cjs +2 -2
- package/dist/data/ai/PromptRunEditor/runtimeActions.cjs.map +1 -1
- package/dist/data/ai/PromptRunEditor/runtimeActions.d.ts.map +1 -1
- package/dist/data/ai/PromptRunEditor/runtimeActions.js +2 -2
- package/dist/data/ai/PromptRunEditor/runtimeActions.js.map +1 -1
- package/dist/data/ai/SessionInspector.approvals.cjs +3 -6
- package/dist/data/ai/SessionInspector.approvals.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.approvals.js +3 -6
- package/dist/data/ai/SessionInspector.approvals.js.map +1 -1
- package/dist/data/ai/SessionViewer.cjs +13 -4
- package/dist/data/ai/SessionViewer.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.d.ts +5 -1
- package/dist/data/ai/SessionViewer.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.header.cjs +1 -1
- package/dist/data/ai/SessionViewer.header.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.header.js +1 -1
- package/dist/data/ai/SessionViewer.header.js.map +1 -1
- package/dist/data/ai/SessionViewer.js +13 -4
- package/dist/data/ai/SessionViewer.js.map +1 -1
- package/dist/data/ai/SessionViewer.model.cjs +2 -0
- package/dist/data/ai/SessionViewer.model.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.model.d.ts +1 -0
- package/dist/data/ai/SessionViewer.model.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.model.js +2 -0
- package/dist/data/ai/SessionViewer.model.js.map +1 -1
- package/dist/data/ai/SessionViewer.rows.cjs +41 -27
- package/dist/data/ai/SessionViewer.rows.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.rows.d.ts +4 -2
- package/dist/data/ai/SessionViewer.rows.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.rows.js +41 -27
- package/dist/data/ai/SessionViewer.rows.js.map +1 -1
- package/dist/data/ai/SessionViewer.tokens.cjs +35 -0
- package/dist/data/ai/SessionViewer.tokens.cjs.map +1 -0
- package/dist/data/ai/SessionViewer.tokens.d.ts +5 -0
- package/dist/data/ai/SessionViewer.tokens.d.ts.map +1 -0
- package/dist/data/ai/SessionViewer.tokens.js +35 -0
- package/dist/data/ai/SessionViewer.tokens.js.map +1 -0
- package/dist/data/ai/SessionViewer.tool-cost.cjs +128 -0
- package/dist/data/ai/SessionViewer.tool-cost.cjs.map +1 -0
- package/dist/data/ai/SessionViewer.tool-cost.d.ts +6 -0
- package/dist/data/ai/SessionViewer.tool-cost.d.ts.map +1 -0
- package/dist/data/ai/SessionViewer.tool-cost.js +128 -0
- package/dist/data/ai/SessionViewer.tool-cost.js.map +1 -0
- package/dist/data/ai/SessionViewer.tool-details.cjs +3 -1
- package/dist/data/ai/SessionViewer.tool-details.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.js +3 -1
- package/dist/data/ai/SessionViewer.tool-details.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.cjs +55 -35
- package/dist/data/ai/SessionViewer.tool-row.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.d.ts +2 -1
- package/dist/data/ai/SessionViewer.tool-row.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.js +55 -35
- package/dist/data/ai/SessionViewer.tool-row.js.map +1 -1
- package/dist/data/ai/SessionViewer.unified.d.ts +4 -0
- package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
- package/dist/data/ai/SessionViewerMenu.cjs +18 -1
- package/dist/data/ai/SessionViewerMenu.cjs.map +1 -1
- package/dist/data/ai/SessionViewerMenu.d.ts +6 -1
- package/dist/data/ai/SessionViewerMenu.d.ts.map +1 -1
- package/dist/data/ai/SessionViewerMenu.js +18 -1
- package/dist/data/ai/SessionViewerMenu.js.map +1 -1
- package/dist/data/ai/ToolPreferences.cjs +149 -143
- package/dist/data/ai/ToolPreferences.cjs.map +1 -1
- package/dist/data/ai/ToolPreferences.d.ts +20 -6
- package/dist/data/ai/ToolPreferences.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferences.js +151 -146
- package/dist/data/ai/ToolPreferences.js.map +1 -1
- package/dist/data/ai/ToolPreferences.model.cjs +14 -10
- package/dist/data/ai/ToolPreferences.model.cjs.map +1 -1
- package/dist/data/ai/ToolPreferences.model.d.ts +1 -0
- package/dist/data/ai/ToolPreferences.model.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferences.model.js +15 -11
- package/dist/data/ai/ToolPreferences.model.js.map +1 -1
- package/dist/data/ai/ToolPreferencesList.cjs +1 -0
- package/dist/data/ai/ToolPreferencesList.cjs.map +1 -1
- package/dist/data/ai/ToolPreferencesList.d.ts +4 -1
- package/dist/data/ai/ToolPreferencesList.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferencesList.js +2 -1
- package/dist/data/ai/ToolPreferencesList.js.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.cjs +52 -53
- package/dist/data/ai/ToolSchemaBrowser.cjs.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.d.ts +6 -3
- package/dist/data/ai/ToolSchemaBrowser.d.ts.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.directory-header.cjs +9 -13
- package/dist/data/ai/ToolSchemaBrowser.directory-header.cjs.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.directory-header.d.ts +5 -2
- package/dist/data/ai/ToolSchemaBrowser.directory-header.d.ts.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.directory-header.js +9 -13
- package/dist/data/ai/ToolSchemaBrowser.directory-header.js.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.js +53 -54
- package/dist/data/ai/ToolSchemaBrowser.js.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.model.cjs +19 -27
- package/dist/data/ai/ToolSchemaBrowser.model.cjs.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.model.d.ts +9 -6
- package/dist/data/ai/ToolSchemaBrowser.model.d.ts.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.model.js +20 -28
- package/dist/data/ai/ToolSchemaBrowser.model.js.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.sidebar.cjs +12 -213
- package/dist/data/ai/ToolSchemaBrowser.sidebar.cjs.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.sidebar.d.ts +1 -3
- package/dist/data/ai/ToolSchemaBrowser.sidebar.d.ts.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.sidebar.js +13 -214
- package/dist/data/ai/ToolSchemaBrowser.sidebar.js.map +1 -1
- package/dist/data/ai/ToolSchemaBrowser.strategies.cjs +54 -0
- package/dist/data/ai/ToolSchemaBrowser.strategies.cjs.map +1 -0
- package/dist/data/ai/ToolSchemaBrowser.strategies.d.ts +9 -0
- package/dist/data/ai/ToolSchemaBrowser.strategies.d.ts.map +1 -0
- package/dist/data/ai/ToolSchemaBrowser.strategies.js +54 -0
- package/dist/data/ai/ToolSchemaBrowser.strategies.js.map +1 -0
- package/dist/data/ai/ToolSchemaBrowser.tree.cjs +179 -0
- package/dist/data/ai/ToolSchemaBrowser.tree.cjs.map +1 -0
- package/dist/data/ai/ToolSchemaBrowser.tree.d.ts +20 -0
- package/dist/data/ai/ToolSchemaBrowser.tree.d.ts.map +1 -0
- package/dist/data/ai/ToolSchemaBrowser.tree.js +179 -0
- package/dist/data/ai/ToolSchemaBrowser.tree.js.map +1 -0
- package/dist/data/ai/index.d.ts +2 -2
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/PermissionStrategiesEditor.cjs +8 -28
- package/dist/data/ai/runtime-profiles/PermissionStrategiesEditor.cjs.map +1 -1
- package/dist/data/ai/runtime-profiles/PermissionStrategiesEditor.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/PermissionStrategiesEditor.js +9 -29
- package/dist/data/ai/runtime-profiles/PermissionStrategiesEditor.js.map +1 -1
- package/dist/data/ai/session-token-sizing.d.ts +32 -0
- package/dist/data/ai/session-token-sizing.d.ts.map +1 -0
- package/dist/data/ai/use-session-token-sizing.cjs +73 -0
- package/dist/data/ai/use-session-token-sizing.cjs.map +1 -0
- package/dist/data/ai/use-session-token-sizing.d.ts +21 -0
- package/dist/data/ai/use-session-token-sizing.d.ts.map +1 -0
- package/dist/data/ai/use-session-token-sizing.js +73 -0
- package/dist/data/ai/use-session-token-sizing.js.map +1 -0
- package/dist/data/call-graph/CallGraph.cjs +269 -0
- package/dist/data/call-graph/CallGraph.cjs.map +1 -0
- package/dist/data/call-graph/CallGraph.d.ts +78 -0
- package/dist/data/call-graph/CallGraph.d.ts.map +1 -0
- package/dist/data/call-graph/CallGraph.js +269 -0
- package/dist/data/call-graph/CallGraph.js.map +1 -0
- package/dist/data/call-graph/CallGraphGlyphs.cjs +39 -0
- package/dist/data/call-graph/CallGraphGlyphs.cjs.map +1 -0
- package/dist/data/call-graph/CallGraphGlyphs.d.ts +19 -0
- package/dist/data/call-graph/CallGraphGlyphs.d.ts.map +1 -0
- package/dist/data/call-graph/CallGraphGlyphs.js +39 -0
- package/dist/data/call-graph/CallGraphGlyphs.js.map +1 -0
- package/dist/data/call-graph/CallGraphMembers.cjs +51 -0
- package/dist/data/call-graph/CallGraphMembers.cjs.map +1 -0
- package/dist/data/call-graph/CallGraphMembers.d.ts +22 -0
- package/dist/data/call-graph/CallGraphMembers.d.ts.map +1 -0
- package/dist/data/call-graph/CallGraphMembers.js +51 -0
- package/dist/data/call-graph/CallGraphMembers.js.map +1 -0
- package/dist/data/call-graph/CallGraphParts.cjs +204 -0
- package/dist/data/call-graph/CallGraphParts.cjs.map +1 -0
- package/dist/data/call-graph/CallGraphParts.d.ts +44 -0
- package/dist/data/call-graph/CallGraphParts.d.ts.map +1 -0
- package/dist/data/call-graph/CallGraphParts.js +204 -0
- package/dist/data/call-graph/CallGraphParts.js.map +1 -0
- package/dist/data/call-graph/CallGraphToolbar.cjs +198 -0
- package/dist/data/call-graph/CallGraphToolbar.cjs.map +1 -0
- package/dist/data/call-graph/CallGraphToolbar.d.ts +55 -0
- package/dist/data/call-graph/CallGraphToolbar.d.ts.map +1 -0
- package/dist/data/call-graph/CallGraphToolbar.js +198 -0
- package/dist/data/call-graph/CallGraphToolbar.js.map +1 -0
- package/dist/data/call-graph/call-graph-exclude.cjs +75 -0
- package/dist/data/call-graph/call-graph-exclude.cjs.map +1 -0
- package/dist/data/call-graph/call-graph-exclude.d.ts +31 -0
- package/dist/data/call-graph/call-graph-exclude.d.ts.map +1 -0
- package/dist/data/call-graph/call-graph-exclude.js +75 -0
- package/dist/data/call-graph/call-graph-exclude.js.map +1 -0
- package/dist/data/call-graph/call-graph-labels.cjs +96 -0
- package/dist/data/call-graph/call-graph-labels.cjs.map +1 -0
- package/dist/data/call-graph/call-graph-labels.d.ts +53 -0
- package/dist/data/call-graph/call-graph-labels.d.ts.map +1 -0
- package/dist/data/call-graph/call-graph-labels.js +96 -0
- package/dist/data/call-graph/call-graph-labels.js.map +1 -0
- package/dist/data/call-graph/call-graph-model.cjs +312 -0
- package/dist/data/call-graph/call-graph-model.cjs.map +1 -0
- package/dist/data/call-graph/call-graph-model.d.ts +138 -0
- package/dist/data/call-graph/call-graph-model.d.ts.map +1 -0
- package/dist/data/call-graph/call-graph-model.js +312 -0
- package/dist/data/call-graph/call-graph-model.js.map +1 -0
- package/dist/data/call-graph/call-graph-vocabulary.cjs +195 -0
- package/dist/data/call-graph/call-graph-vocabulary.cjs.map +1 -0
- package/dist/data/call-graph/call-graph-vocabulary.d.ts +76 -0
- package/dist/data/call-graph/call-graph-vocabulary.d.ts.map +1 -0
- package/dist/data/call-graph/call-graph-vocabulary.js +195 -0
- package/dist/data/call-graph/call-graph-vocabulary.js.map +1 -0
- package/dist/data/call-graph/call-graph.fixtures.d.ts +63 -0
- package/dist/data/call-graph/call-graph.fixtures.d.ts.map +1 -0
- package/dist/data/call-graph/index.d.ts +7 -0
- package/dist/data/call-graph/index.d.ts.map +1 -0
- package/dist/data/call-graph/types.cjs +5 -0
- package/dist/data/call-graph/types.cjs.map +1 -0
- package/dist/data/call-graph/types.d.ts +140 -0
- package/dist/data/call-graph/types.d.ts.map +1 -0
- package/dist/data/call-graph/types.js +5 -0
- package/dist/data/call-graph/types.js.map +1 -0
- package/dist/data/call-graph/use-call-graph.cjs +93 -0
- package/dist/data/call-graph/use-call-graph.cjs.map +1 -0
- package/dist/data/call-graph/use-call-graph.d.ts +24 -0
- package/dist/data/call-graph/use-call-graph.d.ts.map +1 -0
- package/dist/data/call-graph/use-call-graph.js +93 -0
- package/dist/data/call-graph/use-call-graph.js.map +1 -0
- package/dist/data/chat/Chat.cjs +39 -15
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.fixtures.cjs +2 -2
- package/dist/data/chat/Chat.fixtures.cjs.map +1 -1
- package/dist/data/chat/Chat.fixtures.js +2 -2
- package/dist/data/chat/Chat.fixtures.js.map +1 -1
- package/dist/data/chat/Chat.js +40 -16
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.cjs +3 -6
- package/dist/data/chat/ChatRuntimeToolbar.cjs.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.d.ts.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.js +3 -6
- package/dist/data/chat/ChatRuntimeToolbar.js.map +1 -1
- package/dist/data/chat/ContextMeter.bar.cjs +5 -8
- package/dist/data/chat/ContextMeter.bar.cjs.map +1 -1
- package/dist/data/chat/ContextMeter.bar.d.ts +1 -1
- package/dist/data/chat/ContextMeter.bar.d.ts.map +1 -1
- package/dist/data/chat/ContextMeter.bar.js +5 -8
- package/dist/data/chat/ContextMeter.bar.js.map +1 -1
- package/dist/data/chat/ContextMeter.cjs +18 -19
- package/dist/data/chat/ContextMeter.cjs.map +1 -1
- package/dist/data/chat/ContextMeter.d.ts +1 -1
- package/dist/data/chat/ContextMeter.d.ts.map +1 -1
- package/dist/data/chat/ContextMeter.js +18 -19
- package/dist/data/chat/ContextMeter.js.map +1 -1
- package/dist/data/chat/Conversation.cjs +2 -1
- package/dist/data/chat/Conversation.cjs.map +1 -1
- package/dist/data/chat/Conversation.d.ts +4 -1
- package/dist/data/chat/Conversation.d.ts.map +1 -1
- package/dist/data/chat/Conversation.js +2 -1
- package/dist/data/chat/Conversation.js.map +1 -1
- package/dist/data/chat/Message.cjs +39 -12
- package/dist/data/chat/Message.cjs.map +1 -1
- package/dist/data/chat/Message.d.ts +1 -1
- package/dist/data/chat/Message.d.ts.map +1 -1
- package/dist/data/chat/Message.js +40 -13
- package/dist/data/chat/Message.js.map +1 -1
- package/dist/data/chat/ToolCall.cjs +60 -5
- package/dist/data/chat/ToolCall.cjs.map +1 -1
- package/dist/data/chat/ToolCall.d.ts +7 -2
- package/dist/data/chat/ToolCall.d.ts.map +1 -1
- package/dist/data/chat/ToolCall.js +60 -5
- package/dist/data/chat/ToolCall.js.map +1 -1
- package/dist/data/chat/approval.cjs.map +1 -1
- package/dist/data/chat/approval.d.ts +2 -2
- package/dist/data/chat/approval.d.ts.map +1 -1
- package/dist/data/chat/approval.js.map +1 -1
- package/dist/data/chat/tool-policy.cjs +59 -2
- package/dist/data/chat/tool-policy.cjs.map +1 -1
- package/dist/data/chat/tool-policy.d.ts +9 -0
- package/dist/data/chat/tool-policy.d.ts.map +1 -1
- package/dist/data/chat/tool-policy.js +59 -2
- package/dist/data/chat/tool-policy.js.map +1 -1
- package/dist/data/chat/types.cjs +6 -0
- package/dist/data/chat/types.cjs.map +1 -1
- package/dist/data/chat/types.d.ts +13 -4
- package/dist/data/chat/types.d.ts.map +1 -1
- package/dist/data/chat/types.js +7 -1
- package/dist/data/chat/types.js.map +1 -1
- package/dist/data/chat/usage-snapshot.cjs +11 -6
- package/dist/data/chat/usage-snapshot.cjs.map +1 -1
- package/dist/data/chat/usage-snapshot.d.ts +0 -1
- package/dist/data/chat/usage-snapshot.d.ts.map +1 -1
- package/dist/data/chat/usage-snapshot.js +11 -6
- package/dist/data/chat/usage-snapshot.js.map +1 -1
- package/dist/data/data-access.cjs +8 -0
- package/dist/data/data-access.cjs.map +1 -0
- package/dist/data/data-access.d.ts +5 -0
- package/dist/data/data-access.d.ts.map +1 -0
- package/dist/data/data-access.js +8 -0
- package/dist/data/data-access.js.map +1 -0
- package/dist/data/diagnostics/StackFrameRow.cjs +3 -3
- package/dist/data/diagnostics/StackFrameRow.cjs.map +1 -1
- package/dist/data/diagnostics/StackFrameRow.js +3 -3
- package/dist/data/diagnostics/StackFrameRow.js.map +1 -1
- package/dist/data/git/GitChangeList.cjs +6 -2
- package/dist/data/git/GitChangeList.cjs.map +1 -1
- package/dist/data/git/GitChangeList.d.ts +6 -1
- package/dist/data/git/GitChangeList.d.ts.map +1 -1
- package/dist/data/git/GitChangeList.js +6 -2
- package/dist/data/git/GitChangeList.js.map +1 -1
- package/dist/data/graph-columns-layout.cjs +61 -14
- package/dist/data/graph-columns-layout.cjs.map +1 -1
- package/dist/data/graph-columns-layout.d.ts +42 -0
- package/dist/data/graph-columns-layout.d.ts.map +1 -1
- package/dist/data/graph-columns-layout.js +61 -14
- package/dist/data/graph-columns-layout.js.map +1 -1
- package/dist/data/graph-diagram-model.cjs +5 -0
- package/dist/data/graph-diagram-model.cjs.map +1 -1
- package/dist/data/graph-diagram-model.d.ts +24 -0
- package/dist/data/graph-diagram-model.d.ts.map +1 -1
- package/dist/data/graph-diagram-model.js +5 -0
- package/dist/data/graph-diagram-model.js.map +1 -1
- package/dist/data/graph-edge-routing.cjs +9 -3
- package/dist/data/graph-edge-routing.cjs.map +1 -1
- package/dist/data/graph-edge-routing.d.ts +2 -0
- package/dist/data/graph-edge-routing.d.ts.map +1 -1
- package/dist/data/graph-edge-routing.js +9 -3
- package/dist/data/graph-edge-routing.js.map +1 -1
- package/dist/data/graph-group-window.cjs +60 -0
- package/dist/data/graph-group-window.cjs.map +1 -0
- package/dist/data/graph-group-window.d.ts +33 -0
- package/dist/data/graph-group-window.d.ts.map +1 -0
- package/dist/data/graph-group-window.js +60 -0
- package/dist/data/graph-group-window.js.map +1 -0
- package/dist/data/json-view/JsonSource.cjs +84 -0
- package/dist/data/json-view/JsonSource.cjs.map +1 -0
- package/dist/data/json-view/JsonSource.d.ts +7 -0
- package/dist/data/json-view/JsonSource.d.ts.map +1 -0
- package/dist/data/json-view/JsonSource.js +84 -0
- package/dist/data/json-view/JsonSource.js.map +1 -0
- package/dist/data/json-view/parse-prefix.cjs +132 -0
- package/dist/data/json-view/parse-prefix.cjs.map +1 -0
- package/dist/data/json-view/parse-prefix.d.ts +11 -0
- package/dist/data/json-view/parse-prefix.d.ts.map +1 -0
- package/dist/data/json-view/parse-prefix.js +132 -0
- package/dist/data/json-view/parse-prefix.js.map +1 -0
- package/dist/data/json-view/parse-source.cjs +62 -0
- package/dist/data/json-view/parse-source.cjs.map +1 -0
- package/dist/data/json-view/parse-source.d.ts +16 -0
- package/dist/data/json-view/parse-source.d.ts.map +1 -0
- package/dist/data/json-view/parse-source.js +62 -0
- package/dist/data/json-view/parse-source.js.map +1 -0
- package/dist/data/json-view/story-fixtures.d.ts +6 -0
- package/dist/data/json-view/story-fixtures.d.ts.map +1 -0
- package/dist/data/json-view/types.d.ts +14 -0
- package/dist/data/json-view/types.d.ts.map +1 -0
- package/dist/data/runtime/RuntimeBar.cjs +2 -5
- package/dist/data/runtime/RuntimeBar.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBar.d.ts +2 -4
- package/dist/data/runtime/RuntimeBar.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBar.fields.cjs +2 -2
- package/dist/data/runtime/RuntimeBar.fields.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBar.fields.js +2 -2
- package/dist/data/runtime/RuntimeBar.fields.js.map +1 -1
- package/dist/data/runtime/RuntimeBar.js +2 -5
- package/dist/data/runtime/RuntimeBar.js.map +1 -1
- package/dist/data/runtime/RuntimeBar.selection.cjs +4 -1
- package/dist/data/runtime/RuntimeBar.selection.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBar.selection.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBar.selection.js +5 -2
- package/dist/data/runtime/RuntimeBar.selection.js.map +1 -1
- package/dist/data/runtime/RuntimeBarActions.cjs +1 -5
- package/dist/data/runtime/RuntimeBarActions.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarActions.d.ts +1 -1
- package/dist/data/runtime/RuntimeBarActions.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarActions.js +1 -5
- package/dist/data/runtime/RuntimeBarActions.js.map +1 -1
- package/dist/data/runtime/RuntimeBarIdentity.cjs +6 -14
- package/dist/data/runtime/RuntimeBarIdentity.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarIdentity.d.ts +0 -1
- package/dist/data/runtime/RuntimeBarIdentity.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarIdentity.js +6 -14
- package/dist/data/runtime/RuntimeBarIdentity.js.map +1 -1
- package/dist/data/runtime/RuntimeBarLayout.cjs +8 -27
- package/dist/data/runtime/RuntimeBarLayout.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarLayout.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarLayout.js +8 -27
- package/dist/data/runtime/RuntimeBarLayout.js.map +1 -1
- package/dist/data/runtime/RuntimeBarSegment.cjs +1 -5
- package/dist/data/runtime/RuntimeBarSegment.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarSegment.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarSegment.js +1 -5
- package/dist/data/runtime/RuntimeBarSegment.js.map +1 -1
- package/dist/data/runtime/use-runtime-bar-overflow.cjs +4 -10
- package/dist/data/runtime/use-runtime-bar-overflow.cjs.map +1 -1
- package/dist/data/runtime/use-runtime-bar-overflow.d.ts +1 -2
- package/dist/data/runtime/use-runtime-bar-overflow.d.ts.map +1 -1
- package/dist/data/runtime/use-runtime-bar-overflow.js +4 -10
- package/dist/data/runtime/use-runtime-bar-overflow.js.map +1 -1
- package/dist/data/test-runner/TestRunner.fixtures.d.ts +0 -20
- package/dist/data/test-runner/TestRunner.fixtures.d.ts.map +1 -1
- package/dist/data/test-runner/TestRunner.large-fixtures.d.ts +22 -0
- package/dist/data/test-runner/TestRunner.large-fixtures.d.ts.map +1 -0
- package/dist/data/use-group-windows.cjs +50 -0
- package/dist/data/use-group-windows.cjs.map +1 -0
- package/dist/data/use-group-windows.d.ts +27 -0
- package/dist/data/use-group-windows.d.ts.map +1 -0
- package/dist/data/use-group-windows.js +50 -0
- package/dist/data/use-group-windows.js.map +1 -0
- package/dist/data/use-pan-zoom.cjs +23 -10
- package/dist/data/use-pan-zoom.cjs.map +1 -1
- package/dist/data/use-pan-zoom.d.ts +16 -2
- package/dist/data/use-pan-zoom.d.ts.map +1 -1
- package/dist/data/use-pan-zoom.js +23 -10
- package/dist/data/use-pan-zoom.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +36 -2
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +5 -2
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +35 -1
- package/dist/data.js.map +1 -1
- package/dist/hooks/event-hub.cjs +229 -0
- package/dist/hooks/event-hub.cjs.map +1 -0
- package/dist/hooks/event-hub.d.ts +26 -0
- package/dist/hooks/event-hub.d.ts.map +1 -0
- package/dist/hooks/event-hub.js +229 -0
- package/dist/hooks/event-hub.js.map +1 -0
- package/dist/hooks.cjs +2 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +40 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/Workspace.cjs +13 -4
- package/dist/layout/Workspace.cjs.map +1 -1
- package/dist/layout/Workspace.d.ts +7 -2
- package/dist/layout/Workspace.d.ts.map +1 -1
- package/dist/layout/Workspace.js +13 -4
- package/dist/layout/Workspace.js.map +1 -1
- package/dist/lib/permission-strategies.cjs +71 -11
- package/dist/lib/permission-strategies.cjs.map +1 -1
- package/dist/lib/permission-strategies.d.ts +3 -0
- package/dist/lib/permission-strategies.d.ts.map +1 -1
- package/dist/lib/permission-strategies.js +71 -11
- package/dist/lib/permission-strategies.js.map +1 -1
- package/dist/overlay/modalStack.cjs +13 -6
- package/dist/overlay/modalStack.cjs.map +1 -1
- package/dist/overlay/modalStack.d.ts.map +1 -1
- package/dist/overlay/modalStack.js +13 -6
- package/dist/overlay/modalStack.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -3
- package/dist/data/ai/ToolSchemaBrowser.selection-toolbar.cjs +0 -57
- package/dist/data/ai/ToolSchemaBrowser.selection-toolbar.cjs.map +0 -1
- package/dist/data/ai/ToolSchemaBrowser.selection-toolbar.d.ts +0 -7
- package/dist/data/ai/ToolSchemaBrowser.selection-toolbar.d.ts.map +0 -1
- package/dist/data/ai/ToolSchemaBrowser.selection-toolbar.js +0 -57
- package/dist/data/ai/ToolSchemaBrowser.selection-toolbar.js.map +0 -1
- package/dist/data/runtime/RuntimeBar.context.cjs +0 -8
- package/dist/data/runtime/RuntimeBar.context.cjs.map +0 -1
- package/dist/data/runtime/RuntimeBar.context.d.ts +0 -2
- package/dist/data/runtime/RuntimeBar.context.d.ts.map +0 -1
- package/dist/data/runtime/RuntimeBar.context.js +0 -8
- package/dist/data/runtime/RuntimeBar.context.js.map +0 -1
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { mergeAccess } from "../data-access.js";
|
|
2
|
+
import { groupCaption, edgeLabel, edgeTitle, isConditional } from "./call-graph-labels.js";
|
|
3
|
+
import { siteKey, isDataMember, DATA_MEMBER_OWNER, dataMemberAside, nodeTitle } from "./call-graph-vocabulary.js";
|
|
4
|
+
import { CALL_GRAPH_ACCESS } from "./types.js";
|
|
5
|
+
const CALL_GRAPH_MAX_DEPTH = 8;
|
|
6
|
+
const CALL_GRAPH_DEFAULT_DEPTH = 2;
|
|
7
|
+
const DEFAULT_EDGE_LABELS = { call: "call", dispatch: "dispatch", read: "read", write: "write" };
|
|
8
|
+
const EDGE_TONE = { dispatch: "info", read: "success", write: "warning" };
|
|
9
|
+
function toggleAccess(access, type) {
|
|
10
|
+
const on = !access.includes(type);
|
|
11
|
+
if (!on && type !== "variable" && baseAccess(access).length === 1) throw new Error(`call graph: ${type} is the only access type on`);
|
|
12
|
+
return ACCESS_ORDER.filter((entry) => entry === type ? on : access.includes(entry));
|
|
13
|
+
}
|
|
14
|
+
const ACCESS_ORDER = [...CALL_GRAPH_ACCESS, "variable"];
|
|
15
|
+
function baseAccess(access) {
|
|
16
|
+
return access.filter((type) => CALL_GRAPH_ACCESS.includes(type));
|
|
17
|
+
}
|
|
18
|
+
function requireNode(graph, id) {
|
|
19
|
+
const node = graph.nodes.find((candidate) => candidate.id === id);
|
|
20
|
+
if (!node) throw new Error(`call graph: no node "${id}"`);
|
|
21
|
+
return node;
|
|
22
|
+
}
|
|
23
|
+
function inDirection(depth, direction) {
|
|
24
|
+
if (direction === "both" || depth === 0) return true;
|
|
25
|
+
return direction === "callees" ? depth > 0 : depth < 0;
|
|
26
|
+
}
|
|
27
|
+
function visibleGraph(graph, view) {
|
|
28
|
+
const revealed = new Set(view.revealed);
|
|
29
|
+
const nodes = graph.nodes.filter(
|
|
30
|
+
(node) => inDirection(node.depth, view.direction) && (Math.abs(node.depth) <= view.depth || revealed.has(node.id))
|
|
31
|
+
);
|
|
32
|
+
const ids = new Set(nodes.map((node) => node.id));
|
|
33
|
+
return { nodes, edges: graph.edges.filter((edge) => ids.has(edge.from) && ids.has(edge.to)) };
|
|
34
|
+
}
|
|
35
|
+
function outerSide(node) {
|
|
36
|
+
return node.depth < 0 ? "in" : "out";
|
|
37
|
+
}
|
|
38
|
+
function expansionDirection(node) {
|
|
39
|
+
return outerSide(node) === "in" ? "callers" : "callees";
|
|
40
|
+
}
|
|
41
|
+
function outerEdges(graph, node) {
|
|
42
|
+
const side = outerSide(node);
|
|
43
|
+
return graph.edges.filter((edge) => (side === "out" ? edge.from : edge.to) === node.id);
|
|
44
|
+
}
|
|
45
|
+
function expandCount(graph, visible, nodeId, direction, vocabulary, merged = /* @__PURE__ */ new Map()) {
|
|
46
|
+
const node = requireNode(graph, nodeId);
|
|
47
|
+
const side = outerSide(node);
|
|
48
|
+
if (!vocabulary.hasSource(node) || direction === (side === "out" ? "callers" : "callees")) return 0;
|
|
49
|
+
const drawn = new Set(visible.nodes.map((entry) => entry.id));
|
|
50
|
+
const accounted = outerEdges(graph, node).filter((edge) => drawn.has(side === "out" ? edge.to : edge.from)).reduce((sum, edge) => {
|
|
51
|
+
var _a;
|
|
52
|
+
return sum + (((_a = merged.get(edge.id)) == null ? void 0 : _a.sources.length) ?? 1);
|
|
53
|
+
}, 0);
|
|
54
|
+
return Math.max(0, (side === "out" ? node.out : node.in) - accounted);
|
|
55
|
+
}
|
|
56
|
+
function accessTotals(graph, node) {
|
|
57
|
+
const into = (types) => graph.edges.filter((edge) => edge.to === node.id && types.includes(edge.type)).length;
|
|
58
|
+
const totals = [["readers", into(["read"])], ["writers", into(["write"])], ["callers", into(["call", "dispatch"])]];
|
|
59
|
+
return Object.fromEntries(totals.filter(([, count]) => count > 0));
|
|
60
|
+
}
|
|
61
|
+
function walkedTotals(graph, node, vocabulary) {
|
|
62
|
+
if (vocabulary.isData(node)) return accessTotals(graph, node);
|
|
63
|
+
const walked = (sign) => graph.nodes.some((other) => Math.sign(other.depth) === sign);
|
|
64
|
+
return {
|
|
65
|
+
...node.depth <= 0 && walked(-1) ? { callers: node.in } : {},
|
|
66
|
+
...node.depth >= 0 && walked(1) ? { callees: node.out } : {}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function distinctSites(sites) {
|
|
70
|
+
return sites.filter((site, index) => sites.findIndex((other) => siteKey(other) === siteKey(site)) === index);
|
|
71
|
+
}
|
|
72
|
+
const edgeKey = (edge) => `${edge.from}|${edge.to}|${edge.type}`;
|
|
73
|
+
function mergeGraph(held, expansion) {
|
|
74
|
+
const [rootId] = expansion.roots;
|
|
75
|
+
const base = held.nodes.find((node) => node.id === rootId);
|
|
76
|
+
if (rootId === void 0 || !base) throw new Error(`call graph: expansion root "${rootId}" is not in the held graph`);
|
|
77
|
+
const heldIds = new Set(held.nodes.map((node) => node.id));
|
|
78
|
+
const added = expansion.nodes.filter((node) => !heldIds.has(node.id)).map((node) => ({ ...node, depth: base.depth + node.depth }));
|
|
79
|
+
const incoming = new Map(expansion.edges.map((edge) => [edgeKey(edge), edge]));
|
|
80
|
+
const edges = held.edges.map((edge) => {
|
|
81
|
+
const more = incoming.get(edgeKey(edge));
|
|
82
|
+
incoming.delete(edgeKey(edge));
|
|
83
|
+
if (!more) return edge;
|
|
84
|
+
const properties = edge.properties && Object.keys(edge.properties).length > 0 ? edge.properties : more.properties;
|
|
85
|
+
return { ...edge, sites: distinctSites([...edge.sites, ...more.sites]), ...properties ? { properties } : {} };
|
|
86
|
+
});
|
|
87
|
+
const groupIds = new Set((held.groups ?? []).map((group) => group.id));
|
|
88
|
+
const groups = [...held.groups ?? [], ...(expansion.groups ?? []).filter((group) => !groupIds.has(group.id))];
|
|
89
|
+
return { ...held, nodes: [...held.nodes, ...added], edges: [...edges, ...incoming.values()], groups };
|
|
90
|
+
}
|
|
91
|
+
function groupRank(graph, vocabulary) {
|
|
92
|
+
const rootGroups2 = new Set(graph.roots.map((id) => requireNode(graph, id).group));
|
|
93
|
+
const sourced = new Set(graph.nodes.filter((node) => vocabulary.hasSource(node)).map((node) => node.group));
|
|
94
|
+
return (node) => {
|
|
95
|
+
if (node.group === void 0) return 3;
|
|
96
|
+
if (rootGroups2.has(node.group)) return 0;
|
|
97
|
+
return sourced.has(node.group) ? 1 : 2;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function accessInto(edges, id) {
|
|
101
|
+
return edges.reduce((held, edge) => edge.to === id && (edge.type === "read" || edge.type === "write") ? mergeAccess(held, edge.type) : held, void 0);
|
|
102
|
+
}
|
|
103
|
+
function toDiagramNode(node, { direction, options, glyphs, vocabulary }, drawn, records) {
|
|
104
|
+
var _a;
|
|
105
|
+
const { graph, visible } = drawn;
|
|
106
|
+
const count = expandCount(graph, visible, node.id, direction, vocabulary, drawn.merged);
|
|
107
|
+
const isRoot = graph.roots.includes(node.id);
|
|
108
|
+
const tone = isRoot ? "info" : node.unresolved ? "warning" : void 0;
|
|
109
|
+
const compact = node.group !== void 0 && records.has(node.group) || !isRoot && vocabulary.isData(node) && !vocabulary.hasSource(node);
|
|
110
|
+
const aside = dataMemberAside(node);
|
|
111
|
+
const access = glyphs.access && accessInto(visible.edges, node.id);
|
|
112
|
+
return {
|
|
113
|
+
id: node.id,
|
|
114
|
+
label: node.label,
|
|
115
|
+
icon: glyphs.node(vocabulary.glyphOf(graph, node), vocabulary.kindOf(graph, node)),
|
|
116
|
+
title: nodeTitle(graph, node, vocabulary),
|
|
117
|
+
level: node.depth,
|
|
118
|
+
...options.grouped && node.group !== void 0 ? { group: node.group } : {},
|
|
119
|
+
...compact ? { size: "compact" } : {},
|
|
120
|
+
...aside !== void 0 ? { aside } : {},
|
|
121
|
+
...access ? { mark: (_a = glyphs.access) == null ? void 0 : _a.call(glyphs, access) } : {},
|
|
122
|
+
...tone !== void 0 ? { tone } : {},
|
|
123
|
+
...vocabulary.muted(node) ? { muted: true } : {},
|
|
124
|
+
...count > 0 ? { expandCount: count } : {}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function toDiagramEdge(edge, { options, glyphs, edgeLabels, vocabulary }, drawn) {
|
|
128
|
+
const merge = drawn.merged.get(edge.id);
|
|
129
|
+
const label = [edgeLabel(edge, options), merge && countWords(merge.members, drawn.graph, vocabulary)].filter(Boolean).join(" · ") || void 0;
|
|
130
|
+
const title = edgeTitle(edge);
|
|
131
|
+
return {
|
|
132
|
+
id: edge.id,
|
|
133
|
+
from: edge.from,
|
|
134
|
+
to: edge.to,
|
|
135
|
+
dashed: isConditional(edge),
|
|
136
|
+
...edge.type === "call" ? {} : { tone: EDGE_TONE[edge.type], icon: glyphs.edge(edge.type), iconLabel: edgeLabels[edge.type] },
|
|
137
|
+
...label !== void 0 ? { label } : {},
|
|
138
|
+
...title !== void 0 ? { title } : {}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
const PILL_CHAR_WIDTH = 5.2;
|
|
142
|
+
const PILL_CHROME = 22;
|
|
143
|
+
const PILL_ICON_CHARS = 3;
|
|
144
|
+
const MIN_COLUMN_GAP = 96;
|
|
145
|
+
function columnGap({
|
|
146
|
+
nodes,
|
|
147
|
+
edges
|
|
148
|
+
}) {
|
|
149
|
+
const level = new Map(nodes.map((node) => [node.id, node.level]));
|
|
150
|
+
const chars = edges.filter((edge) => level.get(edge.from) !== level.get(edge.to)).map((edge) => {
|
|
151
|
+
var _a;
|
|
152
|
+
return (((_a = edge.label) == null ? void 0 : _a.length) ?? 0) + (edge.icon != null ? PILL_ICON_CHARS : 0);
|
|
153
|
+
});
|
|
154
|
+
return Math.max(MIN_COLUMN_GAP, Math.round(Math.max(0, ...chars) * PILL_CHAR_WIDTH) + PILL_CHROME);
|
|
155
|
+
}
|
|
156
|
+
function recordGroups(visible, vocabulary) {
|
|
157
|
+
var _a;
|
|
158
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
159
|
+
for (const node of visible.nodes) {
|
|
160
|
+
if (node.group !== void 0) grouped.set(node.group, [...grouped.get(node.group) ?? [], node]);
|
|
161
|
+
}
|
|
162
|
+
const records = /* @__PURE__ */ new Map();
|
|
163
|
+
for (const [group, nodes] of grouped) {
|
|
164
|
+
const kind = (_a = nodes[0]) == null ? void 0 : _a.kind;
|
|
165
|
+
if (kind !== void 0 && nodes.every((node) => vocabulary.isData(node) && isDataMember(node) && node.kind === kind)) {
|
|
166
|
+
const owner = DATA_MEMBER_OWNER[kind];
|
|
167
|
+
if (owner === void 0) throw new Error(`call graph: no owner kind for data member "${kind}"`);
|
|
168
|
+
records.set(group, owner);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return records;
|
|
172
|
+
}
|
|
173
|
+
const STAND_IN_PREFIX = "group:";
|
|
174
|
+
function standInId(group) {
|
|
175
|
+
return `${STAND_IN_PREFIX}${group}`;
|
|
176
|
+
}
|
|
177
|
+
function rootGroups(graph) {
|
|
178
|
+
return new Set(graph.roots.map((id) => requireNode(graph, id).group));
|
|
179
|
+
}
|
|
180
|
+
function collapsibleGroups(graph, visible) {
|
|
181
|
+
const roots = rootGroups(graph);
|
|
182
|
+
return [...new Set(visible.nodes.map((node) => node.group))].filter((group) => group !== void 0 && !roots.has(group));
|
|
183
|
+
}
|
|
184
|
+
function countWords(members, graph, vocabulary) {
|
|
185
|
+
const [first] = members;
|
|
186
|
+
const kind = first && members.every((member) => member.kind === first.kind) ? vocabulary.kindOf(graph, first) : "member";
|
|
187
|
+
return `${members.length} ${kind}${members.length === 1 ? "" : "s"}`;
|
|
188
|
+
}
|
|
189
|
+
function memberProperties(members) {
|
|
190
|
+
const keys = { column: "columns", field: "fields" };
|
|
191
|
+
const names = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const member of members) {
|
|
193
|
+
const key = keys[member.kind] ?? "members";
|
|
194
|
+
names.set(key, [...names.get(key) ?? [], member.label]);
|
|
195
|
+
}
|
|
196
|
+
return Object.fromEntries([...names].map(([key, list]) => [key, list.join(", ")]));
|
|
197
|
+
}
|
|
198
|
+
function mergeEdges(id, sources, standInOf, nodes) {
|
|
199
|
+
const [first] = sources;
|
|
200
|
+
if (!first) throw new Error(`call graph: merged edge "${id}" stands for no edge`);
|
|
201
|
+
const memberIds = [...new Set(sources.flatMap((edge2) => [edge2.from, edge2.to]).filter((end) => standInOf.has(end)))];
|
|
202
|
+
const members = memberIds.map((member) => {
|
|
203
|
+
const node = nodes.get(member);
|
|
204
|
+
if (!node) throw new Error(`call graph: no node "${member}"`);
|
|
205
|
+
return node;
|
|
206
|
+
});
|
|
207
|
+
const kind = sources.every((edge2) => edge2.kind === first.kind) ? first.kind : void 0;
|
|
208
|
+
const edge = {
|
|
209
|
+
id,
|
|
210
|
+
from: standInOf.get(first.from) ?? first.from,
|
|
211
|
+
to: standInOf.get(first.to) ?? first.to,
|
|
212
|
+
type: first.type,
|
|
213
|
+
...kind !== void 0 ? { kind } : {},
|
|
214
|
+
sites: distinctSites(sources.flatMap((source) => source.sites)),
|
|
215
|
+
properties: memberProperties(members)
|
|
216
|
+
};
|
|
217
|
+
return [edge, { sources: [...sources], members }];
|
|
218
|
+
}
|
|
219
|
+
function foldEdges(edges, standInOf, nodes) {
|
|
220
|
+
const kept = [];
|
|
221
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
222
|
+
for (const edge of edges) {
|
|
223
|
+
const from = standInOf.get(edge.from) ?? edge.from;
|
|
224
|
+
const to = standInOf.get(edge.to) ?? edge.to;
|
|
225
|
+
if (from === edge.from && to === edge.to) kept.push(edge);
|
|
226
|
+
else grouped.set(`${from}|${to}|${edge.type}`, [...grouped.get(`${from}|${to}|${edge.type}`) ?? [], edge]);
|
|
227
|
+
}
|
|
228
|
+
const merged = new Map([...grouped].map(([id, sources]) => mergeEdges(id, sources, standInOf, nodes)).map(([edge, merge]) => [edge.id, { edge, merge }]));
|
|
229
|
+
return { edges: [...kept, ...[...merged.values()].map(({ edge }) => edge)], merged: new Map([...merged].map(([id, { merge }]) => [id, merge])) };
|
|
230
|
+
}
|
|
231
|
+
function standInNode(id, fold, graph, records, edges) {
|
|
232
|
+
var _a, _b;
|
|
233
|
+
const [first, ...rest] = fold.members;
|
|
234
|
+
if (!first) throw new Error(`call graph: collapsed group "${fold.group}" holds no node`);
|
|
235
|
+
const nearest = rest.reduce((best, member) => Math.abs(member.depth) < Math.abs(best.depth) ? member : best, first);
|
|
236
|
+
return {
|
|
237
|
+
id,
|
|
238
|
+
identifier: {},
|
|
239
|
+
kind: records.get(fold.group) ?? first.kind,
|
|
240
|
+
label: ((_b = (_a = graph.groups) == null ? void 0 : _a.find((group) => group.id === fold.group)) == null ? void 0 : _b.label) ?? fold.group,
|
|
241
|
+
group: fold.group,
|
|
242
|
+
depth: nearest.depth,
|
|
243
|
+
in: edges.filter((edge) => edge.to === id).length,
|
|
244
|
+
out: edges.filter((edge) => edge.from === id).length
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function foldGroups(graph, visible, collapsed, records) {
|
|
248
|
+
var _a;
|
|
249
|
+
const roots = rootGroups(graph);
|
|
250
|
+
const folds = /* @__PURE__ */ new Map();
|
|
251
|
+
const standInOf = /* @__PURE__ */ new Map();
|
|
252
|
+
for (const node of visible.nodes) {
|
|
253
|
+
if (node.group === void 0 || roots.has(node.group) || !collapsed.includes(node.group)) continue;
|
|
254
|
+
const id = standInId(node.group);
|
|
255
|
+
folds.set(id, { group: node.group, members: [...((_a = folds.get(id)) == null ? void 0 : _a.members) ?? [], node] });
|
|
256
|
+
standInOf.set(node.id, id);
|
|
257
|
+
}
|
|
258
|
+
if (folds.size === 0) return { graph, visible, folds, merged: /* @__PURE__ */ new Map() };
|
|
259
|
+
const { edges, merged } = foldEdges(graph.edges, standInOf, new Map(graph.nodes.map((node) => [node.id, node])));
|
|
260
|
+
const standIns = [...folds].map(([id, fold]) => standInNode(id, fold, graph, records, edges));
|
|
261
|
+
const nodes = [...visible.nodes.filter((node) => !standInOf.has(node.id)), ...standIns];
|
|
262
|
+
const drawnIds = new Set(nodes.map((node) => node.id));
|
|
263
|
+
return {
|
|
264
|
+
graph: { ...graph, nodes: [...graph.nodes.filter((node) => !standInOf.has(node.id)), ...standIns], edges },
|
|
265
|
+
visible: { nodes, edges: edges.filter((edge) => drawnIds.has(edge.from) && drawnIds.has(edge.to)) },
|
|
266
|
+
folds,
|
|
267
|
+
merged
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function toDiagramGroup({ id, label }, { glyphs, graph, vocabulary }, drawn, records, collapsible) {
|
|
271
|
+
const fold = drawn.folds.get(standInId(id));
|
|
272
|
+
return {
|
|
273
|
+
id,
|
|
274
|
+
label: glyphs.group(groupCaption(label), records.get(id)),
|
|
275
|
+
title: label,
|
|
276
|
+
...records.has(id) ? { variant: "record" } : {},
|
|
277
|
+
...(collapsible == null ? void 0 : collapsible.has(id)) ? { collapsed: fold !== void 0 } : {},
|
|
278
|
+
...fold ? { aside: countWords(fold.members, graph, vocabulary) } : {}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function toDiagram(input) {
|
|
282
|
+
const { graph, visible, options, vocabulary, collapsed } = input;
|
|
283
|
+
const records = options.grouped ? recordGroups(visible, vocabulary) : /* @__PURE__ */ new Map();
|
|
284
|
+
const drawn = options.grouped && collapsed ? foldGroups(graph, visible, collapsed, records) : { graph, visible, folds: /* @__PURE__ */ new Map(), merged: /* @__PURE__ */ new Map() };
|
|
285
|
+
const collapsible = options.grouped && collapsed ? new Set(collapsibleGroups(graph, visible)) : void 0;
|
|
286
|
+
const rank = groupRank(drawn.graph, vocabulary);
|
|
287
|
+
return {
|
|
288
|
+
nodes: [...drawn.visible.nodes].sort((a, b) => rank(a) - rank(b)).map((node) => toDiagramNode(node, input, drawn, records)),
|
|
289
|
+
edges: drawn.visible.edges.map((edge) => toDiagramEdge(edge, input, drawn)),
|
|
290
|
+
groups: options.grouped ? (graph.groups ?? []).map((group) => toDiagramGroup(group, input, drawn, records, collapsible)) : [],
|
|
291
|
+
drawn
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
export {
|
|
295
|
+
CALL_GRAPH_DEFAULT_DEPTH,
|
|
296
|
+
CALL_GRAPH_MAX_DEPTH,
|
|
297
|
+
DEFAULT_EDGE_LABELS,
|
|
298
|
+
baseAccess,
|
|
299
|
+
collapsibleGroups,
|
|
300
|
+
columnGap,
|
|
301
|
+
expandCount,
|
|
302
|
+
expansionDirection,
|
|
303
|
+
mergeGraph,
|
|
304
|
+
recordGroups,
|
|
305
|
+
requireNode,
|
|
306
|
+
standInId,
|
|
307
|
+
toDiagram,
|
|
308
|
+
toggleAccess,
|
|
309
|
+
visibleGraph,
|
|
310
|
+
walkedTotals
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=call-graph-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-graph-model.js","sources":["../../../src/data/call-graph/call-graph-model.ts"],"sourcesContent":["// Pure mapping from a call graph to what GraphDiagram draws, and how a `+N` expansion merges into the\n// held graph. It decides what is shown and leaves drawing a glyph to the DiagramGlyphs it is handed,\n// so it renders nothing itself.\nimport type { ReactNode } from \"react\";\nimport type { BadgeTone } from \"../Badge\";\nimport { mergeAccess, type DataAccess } from \"../data-access\";\nimport type { GraphDiagramEdge, GraphDiagramGroup, GraphDiagramNode } from \"../graph-diagram-model\";\nimport { edgeLabel, edgeTitle, groupCaption, isConditional, type PillOptions } from \"./call-graph-labels\";\nimport { DATA_MEMBER_OWNER, dataMemberAside, isDataMember, nodeTitle, siteKey, type CallGraphVocabulary } from \"./call-graph-vocabulary\";\nimport {\n CALL_GRAPH_ACCESS,\n type CallGraph,\n type CallGraphAccess,\n type CallGraphDirection,\n type CallGraphEdge,\n type CallGraphEdgeLabels,\n type CallGraphEdgeType,\n type CallGraphGroup,\n type CallGraphNode,\n type CallGraphSite,\n} from \"./types\";\n\n/** The deepest graph uir builds (graph.MaxDepth). */\nexport const CALL_GRAPH_MAX_DEPTH = 8;\n/** The depth uir builds when none is asked for (graph.DefaultDepth). */\nexport const CALL_GRAPH_DEFAULT_DEPTH = 2;\n\nexport const DEFAULT_EDGE_LABELS: CallGraphEdgeLabels = { call: \"call\", dispatch: \"dispatch\", read: \"read\", write: \"write\" };\n\n/** The tone each edge type but a plain call is drawn in: dispatch blue, a read green, a write amber. */\nconst EDGE_TONE: Record<Exclude<CallGraphEdgeType, \"call\">, BadgeTone> = { dispatch: \"info\", read: \"success\", write: \"warning\" };\n\n/** Turns one access type on or off, in the usual order. Turning the last one off fails: a graph follows something. */\nexport function toggleAccess(access: readonly CallGraphAccess[], type: CallGraphAccess): CallGraphAccess[] {\n const on = !access.includes(type);\n if (!on && type !== \"variable\" && baseAccess(access).length === 1) throw new Error(`call graph: ${type} is the only access type on`);\n return ACCESS_ORDER.filter((entry) => (entry === type ? on : access.includes(entry)));\n}\n\n/** Every access type in the usual order: variables last, on top of the others. */\nconst ACCESS_ORDER: readonly CallGraphAccess[] = [...CALL_GRAPH_ACCESS, \"variable\"];\n\n/** The access types of `access` that are not variables, at least one of which a graph follows. */\nexport function baseAccess(access: readonly CallGraphAccess[]): CallGraphAccess[] {\n return access.filter((type) => CALL_GRAPH_ACCESS.includes(type));\n}\n\nexport interface GraphView {\n direction: CallGraphDirection;\n /** Nodes further than this many hops from the root are hidden. */\n depth: number;\n /** Node ids shown regardless of `depth`, because a `+N` expansion revealed them. */\n revealed: readonly string[];\n}\n\nexport interface VisibleGraph {\n nodes: CallGraphNode[];\n edges: CallGraphEdge[];\n}\n\nexport interface DiagramOptions extends PillOptions {\n /** Box nodes by their `group`. */\n grouped: boolean;\n}\n\nexport type DiagramNode = GraphDiagramNode & { label: string; level: number; title: string };\nexport type DiagramEdge = GraphDiagramEdge & { dashed: boolean };\nexport type DiagramGroup = GraphDiagramGroup & { title: string; aside?: string };\n\nexport interface Diagram {\n nodes: DiagramNode[];\n edges: DiagramEdge[];\n groups: DiagramGroup[];\n /** The graph as drawn, collapsed groups folded into their stand-ins: what a selection is looked up in. */\n drawn: DrawnGraph;\n}\n\n/** Draws the glyphs the model chooses. The component supplies icons; the tests supply strings. */\nexport interface DiagramGlyphs {\n /** `words` is the icon's name for a screen reader, such as `external function`. */\n node(glyph: string, words: string): ReactNode;\n /** The pill icon of an edge type; a plain call has none. */\n edge(type: CallGraphEdgeType): ReactNode | undefined;\n group(caption: string, glyph?: string): ReactNode;\n /** The mark of a node the reads and writes into it access; without it no node is marked. */\n access?(access: DataAccess): ReactNode;\n}\n\nexport interface DiagramInput {\n graph: CallGraph;\n visible: VisibleGraph;\n direction: CallGraphDirection;\n options: DiagramOptions;\n glyphs: DiagramGlyphs;\n vocabulary: CallGraphVocabulary;\n edgeLabels: CallGraphEdgeLabels;\n /**\n * The groups drawn as their header alone, by id: each folds into one stand-in node, and its members'\n * edges merge onto it. The root's group never folds. Leave it out and no group can collapse.\n */\n collapsed?: readonly string[];\n}\n\nexport function requireNode(graph: CallGraph, id: string): CallGraphNode {\n const node = graph.nodes.find((candidate) => candidate.id === id);\n if (!node) throw new Error(`call graph: no node \"${id}\"`);\n return node;\n}\n\nfunction inDirection(depth: number, direction: CallGraphDirection): boolean {\n if (direction === \"both\" || depth === 0) return true;\n return direction === \"callees\" ? depth > 0 : depth < 0;\n}\n\n/** The nodes on the requested side within `depth`, plus revealed ones, and the edges between them. */\nexport function visibleGraph(graph: CallGraph, view: GraphView): VisibleGraph {\n const revealed = new Set(view.revealed);\n const nodes = graph.nodes.filter(\n (node) => inDirection(node.depth, view.direction) && (Math.abs(node.depth) <= view.depth || revealed.has(node.id)),\n );\n const ids = new Set(nodes.map((node) => node.id));\n return { nodes, edges: graph.edges.filter((edge) => ids.has(edge.from) && ids.has(edge.to)) };\n}\n\n/** A caller grows toward its own callers; the root and callees grow toward their callees. */\nfunction outerSide(node: CallGraphNode): \"in\" | \"out\" {\n return node.depth < 0 ? \"in\" : \"out\";\n}\n\n/** The direction a `+N` expansion of the node walks: its outer side, the side `+N` counts. */\nexport function expansionDirection(node: CallGraphNode): Exclude<CallGraphDirection, \"both\"> {\n return outerSide(node) === \"in\" ? \"callers\" : \"callees\";\n}\n\n/** A node's edges on its outer side, as the response holds them. */\nfunction outerEdges(graph: CallGraph, node: CallGraphNode): CallGraphEdge[] {\n const side = outerSide(node);\n return graph.edges.filter((edge) => (side === \"out\" ? edge.from : edge.to) === node.id);\n}\n\n/** The ids at the far end of a node's edges on its outer side, as the response holds them. */\nfunction outerNeighbours(graph: CallGraph, node: CallGraphNode): string[] {\n const side = outerSide(node);\n return outerEdges(graph, node).map((edge) => (side === \"out\" ? edge.to : edge.from));\n}\n\n/** The neighbours on a node's outer side that the response holds and are not drawn. */\nexport function hiddenNeighbours(graph: CallGraph, visible: VisibleGraph, nodeId: string): string[] {\n const drawn = new Set(visible.nodes.map((node) => node.id));\n return outerNeighbours(graph, requireNode(graph, nodeId)).filter((id, index, all) => !drawn.has(id) && all.indexOf(id) === index);\n}\n\n/**\n * The `+N` on a node: how many more edges there are to load on its outer side. Only that side's count\n * is a total (`out` for the root and callees, `in` for callers); the other equals the edges in the\n * response. Excluded neighbours are in neither. From it come off the edges drawn, a merged edge counting\n * every edge it stands for. A node without a source cannot be expanded, nor can the side the direction hides.\n */\nexport function expandCount(\n graph: CallGraph,\n visible: VisibleGraph,\n nodeId: string,\n direction: CallGraphDirection,\n vocabulary: Pick<CallGraphVocabulary, \"hasSource\">,\n merged: ReadonlyMap<string, EdgeMerge> = new Map(),\n): number {\n const node = requireNode(graph, nodeId);\n const side = outerSide(node);\n if (!vocabulary.hasSource(node) || direction === (side === \"out\" ? \"callers\" : \"callees\")) return 0;\n const drawn = new Set(visible.nodes.map((entry) => entry.id));\n const accounted = outerEdges(graph, node)\n .filter((edge) => drawn.has(side === \"out\" ? edge.to : edge.from))\n .reduce((sum, edge) => sum + (merged.get(edge.id)?.sources.length ?? 1), 0);\n return Math.max(0, (side === \"out\" ? node.out : node.in) - accounted);\n}\n\nexport interface NodeTotals {\n callers?: number;\n callees?: number;\n readers?: number;\n writers?: number;\n}\n\n/**\n * A data node's readers, writers and callers: the edges into it the graph holds, by type, each left\n * out when there are none.\n */\nfunction accessTotals(graph: CallGraph, node: CallGraphNode): NodeTotals {\n const into = (types: readonly CallGraphEdgeType[]) => graph.edges.filter((edge) => edge.to === node.id && types.includes(edge.type)).length;\n const totals: [keyof NodeTotals, number][] = [[\"readers\", into([\"read\"])], [\"writers\", into([\"write\"])], [\"callers\", into([\"call\", \"dispatch\"])]];\n return Object.fromEntries(totals.filter(([, count]) => count > 0));\n}\n\n/**\n * A node's call totals on the sides the response walked: callees at depth >= 0, callers at depth <= 0.\n * A data node counts who reads, writes and calls it instead.\n */\nexport function walkedTotals(graph: CallGraph, node: CallGraphNode, vocabulary: Pick<CallGraphVocabulary, \"isData\">): NodeTotals {\n if (vocabulary.isData(node)) return accessTotals(graph, node);\n const walked = (sign: number) => graph.nodes.some((other) => Math.sign(other.depth) === sign);\n return {\n ...(node.depth <= 0 && walked(-1) ? { callers: node.in } : {}),\n ...(node.depth >= 0 && walked(1) ? { callees: node.out } : {}),\n };\n}\n\nfunction distinctSites(sites: CallGraphSite[]): CallGraphSite[] {\n return sites.filter((site, index) => sites.findIndex((other) => siteKey(other) === siteKey(site)) === index);\n}\n\nconst edgeKey = (edge: CallGraphEdge) => `${edge.from}|${edge.to}|${edge.type}`;\n\n/**\n * Merges a one-hop expansion into the held graph. The expansion is rooted at a held node, so its\n * depths are re-signed from that node's depth. Held nodes keep their place; edges are keyed by\n * `from|to|type`, gain the call sites they did not hold and keep their first non-empty properties;\n * the held response's other fields stay.\n */\nexport function mergeGraph<T extends CallGraph>(held: T, expansion: CallGraph): T {\n const [rootId] = expansion.roots;\n const base = held.nodes.find((node) => node.id === rootId);\n if (rootId === undefined || !base) throw new Error(`call graph: expansion root \"${rootId}\" is not in the held graph`);\n const heldIds = new Set(held.nodes.map((node) => node.id));\n const added = expansion.nodes.filter((node) => !heldIds.has(node.id)).map((node) => ({ ...node, depth: base.depth + node.depth }));\n const incoming = new Map(expansion.edges.map((edge) => [edgeKey(edge), edge]));\n const edges = held.edges.map((edge) => {\n const more = incoming.get(edgeKey(edge));\n incoming.delete(edgeKey(edge));\n if (!more) return edge;\n const properties = edge.properties && Object.keys(edge.properties).length > 0 ? edge.properties : more.properties;\n return { ...edge, sites: distinctSites([...edge.sites, ...more.sites]), ...(properties ? { properties } : {}) };\n });\n const groupIds = new Set((held.groups ?? []).map((group) => group.id));\n const groups: CallGraphGroup[] = [...(held.groups ?? []), ...(expansion.groups ?? []).filter((group) => !groupIds.has(group.id))];\n return { ...held, nodes: [...held.nodes, ...added], edges: [...edges, ...incoming.values()], groups };\n}\n\n/**\n * The order nodes are handed to the diagram, which stacks groups in the order they first appear: the\n * root's group, then the other groups holding nodes with a source, then the others, then nodes in no group.\n */\nfunction groupRank(graph: CallGraph, vocabulary: CallGraphVocabulary): (node: CallGraphNode) => number {\n const rootGroups = new Set(graph.roots.map((id) => requireNode(graph, id).group));\n const sourced = new Set(graph.nodes.filter((node) => vocabulary.hasSource(node)).map((node) => node.group));\n return (node) => {\n if (node.group === undefined) return 3;\n if (rootGroups.has(node.group)) return 0;\n return sourced.has(node.group) ? 1 : 2;\n };\n}\n\n/** How the reads and writes among `edges` into the node access it, or undefined when none do. */\nfunction accessInto(edges: readonly CallGraphEdge[], id: string): DataAccess | undefined {\n return edges.reduce<DataAccess | undefined>((held, edge) => (edge.to === id && (edge.type === \"read\" || edge.type === \"write\") ? mergeAccess(held, edge.type) : held), undefined);\n}\n\nfunction toDiagramNode(node: CallGraphNode, { direction, options, glyphs, vocabulary }: DiagramInput, drawn: DrawnGraph, records: ReadonlyMap<string, string>): DiagramNode {\n const { graph, visible } = drawn;\n const count = expandCount(graph, visible, node.id, direction, vocabulary, drawn.merged);\n const isRoot = graph.roots.includes(node.id);\n const tone = isRoot ? \"info\" : node.unresolved ? \"warning\" : undefined;\n // A table, column, entity or field is a name its group box already places: one short line will do.\n const compact = (node.group !== undefined && records.has(node.group)) || (!isRoot && vocabulary.isData(node) && !vocabulary.hasSource(node));\n const aside = dataMemberAside(node);\n const access = glyphs.access && accessInto(visible.edges, node.id);\n return {\n id: node.id,\n label: node.label,\n icon: glyphs.node(vocabulary.glyphOf(graph, node), vocabulary.kindOf(graph, node)),\n title: nodeTitle(graph, node, vocabulary),\n level: node.depth,\n ...(options.grouped && node.group !== undefined ? { group: node.group } : {}),\n ...(compact ? { size: \"compact\" as const } : {}),\n ...(aside !== undefined ? { aside } : {}),\n ...(access ? { mark: glyphs.access?.(access) } : {}),\n ...(tone !== undefined ? { tone } : {}),\n ...(vocabulary.muted(node) ? { muted: true } : {}),\n ...(count > 0 ? { expandCount: count } : {}),\n };\n}\n\nfunction toDiagramEdge(edge: CallGraphEdge, { options, glyphs, edgeLabels, vocabulary }: DiagramInput, drawn: DrawnGraph): DiagramEdge {\n const merge = drawn.merged.get(edge.id);\n const label = [edgeLabel(edge, options), merge && countWords(merge.members, drawn.graph, vocabulary)].filter(Boolean).join(\" · \") || undefined;\n const title = edgeTitle(edge);\n return {\n id: edge.id,\n from: edge.from,\n to: edge.to,\n dashed: isConditional(edge),\n ...(edge.type === \"call\" ? {} : { tone: EDGE_TONE[edge.type], icon: glyphs.edge(edge.type), iconLabel: edgeLabels[edge.type] }),\n ...(label !== undefined ? { label } : {}),\n ...(title !== undefined ? { title } : {}),\n };\n}\n\n/** Mean glyph advance of the 10px pill text, and the pill's padding plus a little air. */\nconst PILL_CHAR_WIDTH = 5.2;\nconst PILL_CHROME = 22;\n/** The room a pill's icon and its gap take, in characters. */\nconst PILL_ICON_CHARS = 3;\nconst MIN_COLUMN_GAP = 96;\n\n/**\n * The gap between columns: as wide as the longest pill on an edge between two columns, so no pill\n * covers a node. Wider gaps than the pills need make the diagram wider, and so smaller once fitted.\n */\nexport function columnGap({\n nodes,\n edges,\n}: {\n nodes: readonly Pick<DiagramNode, \"id\" | \"level\">[];\n edges: readonly Pick<DiagramEdge, \"id\" | \"from\" | \"to\" | \"label\" | \"icon\">[];\n}): number {\n const level = new Map(nodes.map((node) => [node.id, node.level]));\n const chars = edges\n .filter((edge) => level.get(edge.from) !== level.get(edge.to))\n .map((edge) => (edge.label?.length ?? 0) + (edge.icon != null ? PILL_ICON_CHARS : 0));\n return Math.max(MIN_COLUMN_GAP, Math.round(Math.max(0, ...chars) * PILL_CHAR_WIDTH) + PILL_CHROME);\n}\n\nexport function recordGroups(visible: VisibleGraph, vocabulary: CallGraphVocabulary): Map<string, string> {\n const grouped = new Map<string, CallGraphNode[]>();\n for (const node of visible.nodes) {\n if (node.group !== undefined) grouped.set(node.group, [...(grouped.get(node.group) ?? []), node]);\n }\n const records = new Map<string, string>();\n for (const [group, nodes] of grouped) {\n const kind = nodes[0]?.kind;\n if (kind !== undefined && nodes.every((node) => vocabulary.isData(node) && isDataMember(node) && node.kind === kind)) {\n const owner = DATA_MEMBER_OWNER[kind];\n if (owner === undefined) throw new Error(`call graph: no owner kind for data member \"${kind}\"`);\n records.set(group, owner);\n }\n }\n return records;\n}\n\n/** A collapsed group's members, and the stand-in node drawn for them. */\nexport interface GroupFold {\n group: string;\n members: CallGraphNode[];\n}\n\n/** One edge drawn for the edges of several members: the edges it stands for and the members at their ends. */\nexport interface EdgeMerge {\n sources: CallGraphEdge[];\n members: CallGraphNode[];\n}\n\nexport interface DrawnGraph {\n graph: CallGraph;\n visible: VisibleGraph;\n /** By stand-in id. */\n folds: ReadonlyMap<string, GroupFold>;\n /** By the id of the edge drawn for them. */\n merged: ReadonlyMap<string, EdgeMerge>;\n}\n\nconst STAND_IN_PREFIX = \"group:\";\n\n/** The id of the node a collapsed group is drawn as. */\nexport function standInId(group: string): string {\n return `${STAND_IN_PREFIX}${group}`;\n}\n\nfunction rootGroups(graph: CallGraph): Set<string | undefined> {\n return new Set(graph.roots.map((id) => requireNode(graph, id).group));\n}\n\n/** The groups that hold a drawn node and can collapse: every one but the root's, in first-drawn order. */\nexport function collapsibleGroups(graph: CallGraph, visible: VisibleGraph): string[] {\n const roots = rootGroups(graph);\n return [...new Set(visible.nodes.map((node) => node.group))].filter((group): group is string => group !== undefined && !roots.has(group));\n}\n\n/** \"10 columns\", \"2 fields\", \"3 variables\": how many members, in the words of their one kind, else \"members\". */\nfunction countWords(members: readonly CallGraphNode[], graph: CallGraph, vocabulary: CallGraphVocabulary): string {\n const [first] = members;\n const kind = first && members.every((member) => member.kind === first.kind) ? vocabulary.kindOf(graph, first) : \"member\";\n return `${members.length} ${kind}${members.length === 1 ? \"\" : \"s\"}`;\n}\n\n/** A merged edge's properties: the names of the members it stands for, gathered as columns, fields or members. */\nfunction memberProperties(members: readonly CallGraphNode[]): Record<string, string> {\n const keys: Record<string, string> = { column: \"columns\", field: \"fields\" };\n const names = new Map<string, string[]>();\n for (const member of members) {\n const key = keys[member.kind] ?? \"members\";\n names.set(key, [...(names.get(key) ?? []), member.label]);\n }\n return Object.fromEntries([...names].map(([key, list]) => [key, list.join(\", \")]));\n}\n\nfunction mergeEdges(id: string, sources: readonly CallGraphEdge[], standInOf: ReadonlyMap<string, string>, nodes: ReadonlyMap<string, CallGraphNode>): [CallGraphEdge, EdgeMerge] {\n const [first] = sources;\n if (!first) throw new Error(`call graph: merged edge \"${id}\" stands for no edge`);\n const memberIds = [...new Set(sources.flatMap((edge) => [edge.from, edge.to]).filter((end) => standInOf.has(end)))];\n const members = memberIds.map((member) => {\n const node = nodes.get(member);\n if (!node) throw new Error(`call graph: no node \"${member}\"`);\n return node;\n });\n const kind = sources.every((edge) => edge.kind === first.kind) ? first.kind : undefined;\n const edge: CallGraphEdge = {\n id, from: standInOf.get(first.from) ?? first.from, to: standInOf.get(first.to) ?? first.to, type: first.type,\n ...(kind !== undefined ? { kind } : {}),\n sites: distinctSites(sources.flatMap((source) => source.sites)),\n properties: memberProperties(members),\n };\n return [edge, { sources: [...sources], members }];\n}\n\n/** Edges with an end in a collapsed group, re-ended on its stand-in and merged per stand-in, other end and type. */\nfunction foldEdges(edges: readonly CallGraphEdge[], standInOf: ReadonlyMap<string, string>, nodes: ReadonlyMap<string, CallGraphNode>) {\n const kept: CallGraphEdge[] = [];\n const grouped = new Map<string, CallGraphEdge[]>();\n for (const edge of edges) {\n const from = standInOf.get(edge.from) ?? edge.from;\n const to = standInOf.get(edge.to) ?? edge.to;\n if (from === edge.from && to === edge.to) kept.push(edge);\n else grouped.set(`${from}|${to}|${edge.type}`, [...(grouped.get(`${from}|${to}|${edge.type}`) ?? []), edge]);\n }\n const merged = new Map([...grouped].map(([id, sources]) => mergeEdges(id, sources, standInOf, nodes)).map(([edge, merge]) => [edge.id, { edge, merge }]));\n return { edges: [...kept, ...[...merged.values()].map(({ edge }) => edge)], merged: new Map([...merged].map(([id, { merge }]) => [id, merge])) };\n}\n\n/** The node a collapsed group is drawn as: its owner's kind for a record, else its first member's, at the depth nearest the root. */\nfunction standInNode(id: string, fold: GroupFold, graph: CallGraph, records: ReadonlyMap<string, string>, edges: readonly CallGraphEdge[]): CallGraphNode {\n const [first, ...rest] = fold.members;\n if (!first) throw new Error(`call graph: collapsed group \"${fold.group}\" holds no node`);\n const nearest = rest.reduce((best, member) => (Math.abs(member.depth) < Math.abs(best.depth) ? member : best), first);\n return {\n id, identifier: {}, kind: records.get(fold.group) ?? first.kind,\n label: graph.groups?.find((group) => group.id === fold.group)?.label ?? fold.group,\n group: fold.group, depth: nearest.depth,\n in: edges.filter((edge) => edge.to === id).length, out: edges.filter((edge) => edge.from === id).length,\n };\n}\n\n/** The graph with each collapsed group's drawn members folded into one stand-in. */\nfunction foldGroups(graph: CallGraph, visible: VisibleGraph, collapsed: readonly string[], records: ReadonlyMap<string, string>): DrawnGraph {\n const roots = rootGroups(graph);\n const folds = new Map<string, GroupFold>();\n const standInOf = new Map<string, string>();\n for (const node of visible.nodes) {\n if (node.group === undefined || roots.has(node.group) || !collapsed.includes(node.group)) continue;\n const id = standInId(node.group);\n folds.set(id, { group: node.group, members: [...(folds.get(id)?.members ?? []), node] });\n standInOf.set(node.id, id);\n }\n if (folds.size === 0) return { graph, visible, folds, merged: new Map() };\n const { edges, merged } = foldEdges(graph.edges, standInOf, new Map(graph.nodes.map((node) => [node.id, node])));\n const standIns = [...folds].map(([id, fold]) => standInNode(id, fold, graph, records, edges));\n const nodes = [...visible.nodes.filter((node) => !standInOf.has(node.id)), ...standIns];\n const drawnIds = new Set(nodes.map((node) => node.id));\n return {\n graph: { ...graph, nodes: [...graph.nodes.filter((node) => !standInOf.has(node.id)), ...standIns], edges },\n visible: { nodes, edges: edges.filter((edge) => drawnIds.has(edge.from) && drawnIds.has(edge.to)) },\n folds,\n merged,\n };\n}\n\nfunction toDiagramGroup({ id, label }: CallGraphGroup, { glyphs, graph, vocabulary }: DiagramInput, drawn: DrawnGraph, records: ReadonlyMap<string, string>, collapsible: ReadonlySet<string> | undefined): DiagramGroup {\n const fold = drawn.folds.get(standInId(id));\n return {\n id, label: glyphs.group(groupCaption(label), records.get(id)), title: label,\n ...(records.has(id) ? { variant: \"record\" as const } : {}),\n ...(collapsible?.has(id) ? { collapsed: fold !== undefined } : {}),\n ...(fold ? { aside: countWords(fold.members, graph, vocabulary) } : {}),\n };\n}\n\nexport function toDiagram(input: DiagramInput): Diagram {\n const { graph, visible, options, vocabulary, collapsed } = input;\n const records = options.grouped ? recordGroups(visible, vocabulary) : new Map<string, string>();\n const drawn = options.grouped && collapsed ? foldGroups(graph, visible, collapsed, records) : { graph, visible, folds: new Map(), merged: new Map() };\n const collapsible = options.grouped && collapsed ? new Set(collapsibleGroups(graph, visible)) : undefined;\n const rank = groupRank(drawn.graph, vocabulary);\n return {\n nodes: [...drawn.visible.nodes].sort((a, b) => rank(a) - rank(b)).map((node) => toDiagramNode(node, input, drawn, records)),\n edges: drawn.visible.edges.map((edge) => toDiagramEdge(edge, input, drawn)),\n groups: options.grouped ? (graph.groups ?? []).map((group) => toDiagramGroup(group, input, drawn, records, collapsible)) : [],\n drawn,\n };\n}\n"],"names":["rootGroups","edge"],"mappings":";;;;AAuBO,MAAM,uBAAuB;AAE7B,MAAM,2BAA2B;AAEjC,MAAM,sBAA2C,EAAE,MAAM,QAAQ,UAAU,YAAY,MAAM,QAAQ,OAAO,QAAA;AAGnH,MAAM,YAAmE,EAAE,UAAU,QAAQ,MAAM,WAAW,OAAO,UAAA;AAG9G,SAAS,aAAa,QAAoC,MAA0C;AACzG,QAAM,KAAK,CAAC,OAAO,SAAS,IAAI;AAChC,MAAI,CAAC,MAAM,SAAS,cAAc,WAAW,MAAM,EAAE,WAAW,EAAG,OAAM,IAAI,MAAM,eAAe,IAAI,6BAA6B;AACnI,SAAO,aAAa,OAAO,CAAC,UAAW,UAAU,OAAO,KAAK,OAAO,SAAS,KAAK,CAAE;AACtF;AAGA,MAAM,eAA2C,CAAC,GAAG,mBAAmB,UAAU;AAG3E,SAAS,WAAW,QAAuD;AAChF,SAAO,OAAO,OAAO,CAAC,SAAS,kBAAkB,SAAS,IAAI,CAAC;AACjE;AA0DO,SAAS,YAAY,OAAkB,IAA2B;AACvE,QAAM,OAAO,MAAM,MAAM,KAAK,CAAC,cAAc,UAAU,OAAO,EAAE;AAChE,MAAI,CAAC,KAAM,OAAM,IAAI,MAAM,wBAAwB,EAAE,GAAG;AACxD,SAAO;AACT;AAEA,SAAS,YAAY,OAAe,WAAwC;AAC1E,MAAI,cAAc,UAAU,UAAU,EAAG,QAAO;AAChD,SAAO,cAAc,YAAY,QAAQ,IAAI,QAAQ;AACvD;AAGO,SAAS,aAAa,OAAkB,MAA+B;AAC5E,QAAM,WAAW,IAAI,IAAI,KAAK,QAAQ;AACtC,QAAM,QAAQ,MAAM,MAAM;AAAA,IACxB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MAAM,IAAI,CAAC,SAAS,cAAc,MAAM,OAAO,KAAK,CAAC;AAAA,IAC1E,QAAQ,QAAQ,WAAW,MAAM,UAAU,CAAA,GAAI,IAAI,CAAC,UAAU,eAAe,OAAO,OAAO,OAAO,SAAS,WAAW,CAAC,IAAI,CAAA;AAAA,IAC3H;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const UiSqlTable = require("../../icons/components/UiSqlTable.cjs");
|
|
4
|
+
const UiSqlColumn = require("../../icons/components/UiSqlColumn.cjs");
|
|
5
|
+
const UiKey = require("../../icons/components/UiKey.cjs");
|
|
6
|
+
const UiSqlStoredProc = require("../../icons/components/UiSqlStoredProc.cjs");
|
|
7
|
+
const UiTableProperties = require("../../icons/components/UiTableProperties.cjs");
|
|
8
|
+
const UiField = require("../../icons/components/UiField.cjs");
|
|
9
|
+
const UiPackage = require("../../icons/components/UiPackage.cjs");
|
|
10
|
+
const UiFunction = require("../../icons/components/UiFunction.cjs");
|
|
11
|
+
const UiMethod = require("../../icons/components/UiMethod.cjs");
|
|
12
|
+
const UiInterface = require("../../icons/components/UiInterface.cjs");
|
|
13
|
+
const UiMethod11 = require("../../icons/components/UiMethod11.cjs");
|
|
14
|
+
const UiFunction1 = require("../../icons/components/UiFunction1.cjs");
|
|
15
|
+
const UiFunctionSquare = require("../../icons/components/UiFunctionSquare.cjs");
|
|
16
|
+
const UiTypeParameter = require("../../icons/components/UiTypeParameter.cjs");
|
|
17
|
+
const UiVariable = require("../../icons/components/UiVariable.cjs");
|
|
18
|
+
const UiConstant = require("../../icons/components/UiConstant.cjs");
|
|
19
|
+
const UiUnknown = require("../../icons/components/UiUnknown.cjs");
|
|
20
|
+
const UiSymbol = require("../../icons/components/UiSymbol.cjs");
|
|
21
|
+
function requireGlyph(vocabulary, id) {
|
|
22
|
+
const glyph = vocabulary.glyphs.find((candidate) => candidate.id === id);
|
|
23
|
+
if (!glyph) throw new Error(`call graph: the vocabulary has no glyph "${id}"`);
|
|
24
|
+
return glyph;
|
|
25
|
+
}
|
|
26
|
+
function usedGlyphs(graph, vocabulary) {
|
|
27
|
+
const used = new Set(graph.nodes.map((node) => vocabulary.glyphOf(graph, node)));
|
|
28
|
+
return vocabulary.glyphs.filter((glyph) => used.has(glyph.id));
|
|
29
|
+
}
|
|
30
|
+
function nodeTitle(graph, node, vocabulary) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const group = ((_b = (_a = graph.groups) == null ? void 0 : _a.find((candidate) => candidate.id === node.group)) == null ? void 0 : _b.label) ?? node.group;
|
|
33
|
+
return `${vocabulary.kindOf(graph, node)} ${node.label}${group ? ` in ${group}` : ""}`;
|
|
34
|
+
}
|
|
35
|
+
function callsItself(graph, node) {
|
|
36
|
+
return graph.edges.some((edge) => edge.from === node.id && edge.to === node.id);
|
|
37
|
+
}
|
|
38
|
+
function siteKey(site) {
|
|
39
|
+
return `${site.path}:${site.line}:${site.column}`;
|
|
40
|
+
}
|
|
41
|
+
const UIR_KINDS = /* @__PURE__ */ new Map([
|
|
42
|
+
["func", { glyph: "func", words: "function" }],
|
|
43
|
+
["method", { glyph: "method", words: "method" }],
|
|
44
|
+
["builtin", { glyph: "builtin", words: "builtin" }],
|
|
45
|
+
["type", { glyph: "type", words: "type" }],
|
|
46
|
+
["field", { glyph: "field", words: "field" }],
|
|
47
|
+
["var", { glyph: "var", words: "variable" }],
|
|
48
|
+
["const", { glyph: "const", words: "constant" }],
|
|
49
|
+
["package", { glyph: "package", words: "package scope" }]
|
|
50
|
+
]);
|
|
51
|
+
const DATA_KIND_WORDS = {
|
|
52
|
+
table: "table",
|
|
53
|
+
column: "column",
|
|
54
|
+
procedure: "stored procedure",
|
|
55
|
+
entity: "entity",
|
|
56
|
+
field: "field"
|
|
57
|
+
};
|
|
58
|
+
const CALL_GRAPH_DATA_GLYPHS = [
|
|
59
|
+
{ id: "table", name: "table", icon: UiSqlTable.UiSqlTable },
|
|
60
|
+
{ id: "column", name: "column", icon: UiSqlColumn.UiSqlColumn },
|
|
61
|
+
{ id: "primary_key", name: "primary key column", icon: UiKey.UiKey },
|
|
62
|
+
{ id: "procedure", name: "stored procedure", icon: UiSqlStoredProc.UiSqlStoredProc },
|
|
63
|
+
{ id: "entity", name: "entity", icon: UiTableProperties.UiTableProperties },
|
|
64
|
+
{ id: "field", name: "field", icon: UiField.UiField }
|
|
65
|
+
];
|
|
66
|
+
function isDataNode(node) {
|
|
67
|
+
return Object.hasOwn(DATA_KIND_WORDS, node.kind);
|
|
68
|
+
}
|
|
69
|
+
const DATA_MEMBER_OWNER = { column: "table", field: "entity" };
|
|
70
|
+
function isDataMember(node) {
|
|
71
|
+
return isDataNode(node) && Object.hasOwn(DATA_MEMBER_OWNER, node.kind);
|
|
72
|
+
}
|
|
73
|
+
function dataNodeGlyph(node) {
|
|
74
|
+
var _a;
|
|
75
|
+
return node.kind === "column" && ((_a = node.properties) == null ? void 0 : _a.primaryKey) === "true" ? "primary_key" : node.kind;
|
|
76
|
+
}
|
|
77
|
+
function dataMemberAside(node) {
|
|
78
|
+
var _a;
|
|
79
|
+
return node.kind === "column" ? (_a = node.properties) == null ? void 0 : _a.sqlType : void 0;
|
|
80
|
+
}
|
|
81
|
+
function dataName(node) {
|
|
82
|
+
const prefix = `${node.kind}:`;
|
|
83
|
+
return node.id.startsWith(prefix) ? node.id.slice(prefix.length) : node.label;
|
|
84
|
+
}
|
|
85
|
+
function dataNodeStatus(node) {
|
|
86
|
+
const name = dataName(node);
|
|
87
|
+
switch (node.kind) {
|
|
88
|
+
case "table":
|
|
89
|
+
return `Table ${name}`;
|
|
90
|
+
case "column":
|
|
91
|
+
return `Column ${name}`;
|
|
92
|
+
case "procedure":
|
|
93
|
+
return `Stored procedure ${name}`;
|
|
94
|
+
case "entity":
|
|
95
|
+
return `${name} fields`;
|
|
96
|
+
}
|
|
97
|
+
const entity = name.includes(".") ? name.slice(0, name.indexOf(".")) : node.group ?? "";
|
|
98
|
+
const { column, storage } = node.properties ?? {};
|
|
99
|
+
if (column) return `${entity} field → ${column}`;
|
|
100
|
+
if (storage) return `${entity} field, dynamic, stored in ${storage}`;
|
|
101
|
+
return `${entity} field`;
|
|
102
|
+
}
|
|
103
|
+
function dataNodeBacking(node) {
|
|
104
|
+
var _a;
|
|
105
|
+
const column = node.kind === "field" ? (_a = node.properties) == null ? void 0 : _a.column : void 0;
|
|
106
|
+
return column ? { id: `column:${column}`, label: column } : void 0;
|
|
107
|
+
}
|
|
108
|
+
function isBuiltin(node) {
|
|
109
|
+
return node.kind === "builtin";
|
|
110
|
+
}
|
|
111
|
+
function isPackageScope(node) {
|
|
112
|
+
return node.kind === "package";
|
|
113
|
+
}
|
|
114
|
+
function isExternal(node) {
|
|
115
|
+
return !node.location && !node.unresolved && !isBuiltin(node) && !isPackageScope(node) && !isDataNode(node);
|
|
116
|
+
}
|
|
117
|
+
function interfaceMethods(graph) {
|
|
118
|
+
const dispatched = new Set(
|
|
119
|
+
graph.edges.filter((edge) => edge.type === "dispatch").flatMap((edge) => edge.sites.map((site) => `${edge.from} ${siteKey(site)}`))
|
|
120
|
+
);
|
|
121
|
+
return new Set(
|
|
122
|
+
graph.edges.filter((edge) => edge.type === "call" && edge.sites.some((site) => dispatched.has(`${edge.from} ${siteKey(site)}`))).map((edge) => edge.to)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
function uirGlyph(graph, node) {
|
|
126
|
+
var _a;
|
|
127
|
+
if (node.unresolved) return "unresolved";
|
|
128
|
+
if (isBuiltin(node)) return "builtin";
|
|
129
|
+
if (isPackageScope(node)) return "package";
|
|
130
|
+
if (isDataNode(node)) return dataNodeGlyph(node);
|
|
131
|
+
if (callsItself(graph, node)) return "recursive";
|
|
132
|
+
if (isExternal(node) && node.kind === "func") return "external_func";
|
|
133
|
+
if (interfaceMethods(graph).has(node.id)) return "interface_method";
|
|
134
|
+
return ((_a = UIR_KINDS.get(node.kind)) == null ? void 0 : _a.glyph) ?? "symbol";
|
|
135
|
+
}
|
|
136
|
+
function uirKind(graph, node) {
|
|
137
|
+
var _a;
|
|
138
|
+
if (node.unresolved) return "unresolved call";
|
|
139
|
+
const kind = interfaceMethods(graph).has(node.id) ? "interface method" : ((_a = UIR_KINDS.get(node.kind)) == null ? void 0 : _a.words) ?? DATA_KIND_WORDS[node.kind] ?? node.kind.replaceAll("_", " ");
|
|
140
|
+
return [isExternal(node) ? "external" : "", callsItself(graph, node) ? "recursive" : "", kind].filter(Boolean).join(" ");
|
|
141
|
+
}
|
|
142
|
+
function uirStatus(node) {
|
|
143
|
+
if (node.unresolved) return "Unresolved: the index has no target for this call";
|
|
144
|
+
if (isBuiltin(node)) return "Builtin: no source";
|
|
145
|
+
if (isExternal(node)) return "External: declared outside the indexed snapshots";
|
|
146
|
+
if (node.location) return "Indexed";
|
|
147
|
+
return isDataNode(node) ? dataNodeStatus(node) : "Package scope: calls made outside any declaration";
|
|
148
|
+
}
|
|
149
|
+
const UIR_CALL_GRAPH_VOCABULARY = {
|
|
150
|
+
glyphs: [
|
|
151
|
+
{ id: "func", name: "function", icon: UiFunction.UiFunction },
|
|
152
|
+
{ id: "method", name: "method", icon: UiMethod.UiMethod },
|
|
153
|
+
{ id: "interface_method", name: "interface method", icon: UiInterface.UiInterface },
|
|
154
|
+
{ id: "recursive", name: "calls itself", icon: UiMethod11.UiMethod11, darkIcon: UiMethod11.UiMethod11Dark },
|
|
155
|
+
{ id: "external_func", name: "external function", icon: UiFunction1.UiFunction1, darkIcon: UiFunction1.UiFunction1Dark },
|
|
156
|
+
{ id: "builtin", name: "builtin", icon: UiFunctionSquare.UiFunctionSquare },
|
|
157
|
+
{ id: "type", name: "type", icon: UiTypeParameter.UiTypeParameter },
|
|
158
|
+
{ id: "field", name: "field", icon: UiField.UiField },
|
|
159
|
+
{ id: "var", name: "variable", icon: UiVariable.UiVariable },
|
|
160
|
+
{ id: "const", name: "constant", icon: UiConstant.UiConstant },
|
|
161
|
+
{ id: "package", name: "package scope", icon: UiPackage.UiPackage },
|
|
162
|
+
// uir's `field` is already a glyph of its own: a struct field is data too.
|
|
163
|
+
...CALL_GRAPH_DATA_GLYPHS.filter((glyph) => glyph.id !== "field"),
|
|
164
|
+
{ id: "unresolved", name: "unresolved call", icon: UiUnknown.UiUnknown },
|
|
165
|
+
{ id: "symbol", name: "other symbol", icon: UiSymbol.UiSymbol, darkIcon: UiSymbol.UiSymbolDark }
|
|
166
|
+
],
|
|
167
|
+
glyphOf: uirGlyph,
|
|
168
|
+
kindOf: uirKind,
|
|
169
|
+
hasSource: (node) => Boolean(node.location),
|
|
170
|
+
canRoot: (node) => Boolean(node.location) || isDataNode(node),
|
|
171
|
+
isData: isDataNode,
|
|
172
|
+
muted: (node) => Boolean(node.unresolved) || isBuiltin(node) || isExternal(node),
|
|
173
|
+
status: uirStatus,
|
|
174
|
+
backing: dataNodeBacking,
|
|
175
|
+
group: { noun: "package", plural: "packages", icon: UiPackage.UiPackage, patternHint: "example.com/module/..." }
|
|
176
|
+
};
|
|
177
|
+
exports.CALL_GRAPH_DATA_GLYPHS = CALL_GRAPH_DATA_GLYPHS;
|
|
178
|
+
exports.DATA_KIND_WORDS = DATA_KIND_WORDS;
|
|
179
|
+
exports.DATA_MEMBER_OWNER = DATA_MEMBER_OWNER;
|
|
180
|
+
exports.UIR_CALL_GRAPH_VOCABULARY = UIR_CALL_GRAPH_VOCABULARY;
|
|
181
|
+
exports.callsItself = callsItself;
|
|
182
|
+
exports.dataMemberAside = dataMemberAside;
|
|
183
|
+
exports.dataNodeBacking = dataNodeBacking;
|
|
184
|
+
exports.dataNodeGlyph = dataNodeGlyph;
|
|
185
|
+
exports.dataNodeStatus = dataNodeStatus;
|
|
186
|
+
exports.interfaceMethods = interfaceMethods;
|
|
187
|
+
exports.isBuiltin = isBuiltin;
|
|
188
|
+
exports.isDataMember = isDataMember;
|
|
189
|
+
exports.isDataNode = isDataNode;
|
|
190
|
+
exports.isExternal = isExternal;
|
|
191
|
+
exports.nodeTitle = nodeTitle;
|
|
192
|
+
exports.requireGlyph = requireGlyph;
|
|
193
|
+
exports.siteKey = siteKey;
|
|
194
|
+
exports.usedGlyphs = usedGlyphs;
|
|
195
|
+
//# sourceMappingURL=call-graph-vocabulary.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-graph-vocabulary.cjs","sources":["../../../src/data/call-graph/call-graph-vocabulary.ts"],"sourcesContent":["// What a node kind means and how it is drawn. A host whose source names its own kinds (OIPA's\n// transactions, copybooks and functions) passes its own vocabulary; the default is the one uir's\n// `graph.Build` reports without a Theme: uir node types, a builtin, a package scope and an index\n// location for every node with a source.\nimport {\n UiConstant,\n UiField,\n UiFunction,\n UiFunction1,\n UiFunction1Dark,\n UiFunctionSquare,\n UiInterface,\n UiKey,\n UiMethod,\n UiMethod11,\n UiMethod11Dark,\n UiPackage,\n UiSqlColumn,\n UiSqlStoredProc,\n UiSqlTable,\n UiSymbol,\n UiSymbolDark,\n UiTableProperties,\n UiTypeParameter,\n UiUnknown,\n UiVariable,\n type IconComponent,\n} from \"../../icons\";\nimport type { CallGraph, CallGraphNode } from \"./types\";\n\nexport interface CallGraphGlyph {\n id: string;\n /** The legend's name for it. */\n name: string;\n icon: IconComponent;\n /** Drawn instead of `icon` in the dark theme, for coloured artwork. */\n darkIcon?: IconComponent;\n}\n\nexport interface CallGraphVocabulary {\n /** Every glyph the vocabulary draws, in legend order. */\n glyphs: readonly CallGraphGlyph[];\n /** The id of the one glyph a node shows. */\n glyphOf(graph: CallGraph, node: CallGraphNode): string;\n /** What the node is, in words: `method`, `external function`, `copybook`. */\n kindOf(graph: CallGraph, node: CallGraphNode): string;\n /** The node has a body the source walks: it can be expanded and opened. */\n hasSource(node: CallGraphNode): boolean;\n /** The graph can be drawn around the node: Focus is offered for it, with or without a source. */\n canRoot(node: CallGraphNode): boolean;\n /** A table, column, procedure, entity or field: its details count readers and writers. */\n isData(node: CallGraphNode): boolean;\n /** Drawn dimmed: the node leads nowhere further. */\n muted(node: CallGraphNode): boolean;\n /** The node's status line in its details. */\n status(node: CallGraphNode): string;\n /** The node a data node stands for, such as the column behind a field, offered as a Focus link. */\n backing?(node: CallGraphNode): { id: string; label: string } | undefined;\n /** What a group is, and the icon its box caption shows. */\n group: { noun: string; plural: string; icon: IconComponent; patternHint: string };\n}\n\n/** The glyph with that id, failing on one the vocabulary does not list. */\nexport function requireGlyph(vocabulary: CallGraphVocabulary, id: string): CallGraphGlyph {\n const glyph = vocabulary.glyphs.find((candidate) => candidate.id === id);\n if (!glyph) throw new Error(`call graph: the vocabulary has no glyph \"${id}\"`);\n return glyph;\n}\n\n/** The glyphs the graph's nodes use, once each, in legend order. */\nexport function usedGlyphs(graph: CallGraph, vocabulary: CallGraphVocabulary): CallGraphGlyph[] {\n const used = new Set(graph.nodes.map((node) => vocabulary.glyphOf(graph, node)));\n return vocabulary.glyphs.filter((glyph) => used.has(glyph.id));\n}\n\n/** The node's tooltip: its kind, its label and its group's full label. */\nexport function nodeTitle(graph: CallGraph, node: CallGraphNode, vocabulary: CallGraphVocabulary): string {\n const group = graph.groups?.find((candidate) => candidate.id === node.group)?.label ?? node.group;\n return `${vocabulary.kindOf(graph, node)} ${node.label}${group ? ` in ${group}` : \"\"}`;\n}\n\nexport function callsItself(graph: CallGraph, node: CallGraphNode): boolean {\n return graph.edges.some((edge) => edge.from === node.id && edge.to === node.id);\n}\n\nexport function siteKey(site: { path?: string; line?: number; column?: number }): string {\n return `${site.path}:${site.line}:${site.column}`;\n}\n\n// uir node types that have a glyph of their own, and the words for each.\nconst UIR_KINDS = new Map<string, { glyph: string; words: string }>([\n [\"func\", { glyph: \"func\", words: \"function\" }],\n [\"method\", { glyph: \"method\", words: \"method\" }],\n [\"builtin\", { glyph: \"builtin\", words: \"builtin\" }],\n [\"type\", { glyph: \"type\", words: \"type\" }],\n [\"field\", { glyph: \"field\", words: \"field\" }],\n [\"var\", { glyph: \"var\", words: \"variable\" }],\n [\"const\", { glyph: \"const\", words: \"constant\" }],\n [\"package\", { glyph: \"package\", words: \"package scope\" }],\n]);\n\n// Data access, as the graph's data model names it: `table:AsPolicy`, `column:AsPolicy.STATUSCODE`,\n// `procedure:Update_ClassGroup`, `entity:Policy` and `field:Policy.StatusCode`, a field carrying\n// `column` (its `x-oipa-column`) or `storage` (the table a dynamic field is kept in).\n\nexport const DATA_KIND_WORDS: Readonly<Record<string, string>> = {\n table: \"table\",\n column: \"column\",\n procedure: \"stored procedure\",\n entity: \"entity\",\n field: \"field\",\n};\n\nexport const CALL_GRAPH_DATA_GLYPHS: readonly CallGraphGlyph[] = [\n { id: \"table\", name: \"table\", icon: UiSqlTable },\n { id: \"column\", name: \"column\", icon: UiSqlColumn },\n { id: \"primary_key\", name: \"primary key column\", icon: UiKey },\n { id: \"procedure\", name: \"stored procedure\", icon: UiSqlStoredProc },\n { id: \"entity\", name: \"entity\", icon: UiTableProperties },\n { id: \"field\", name: \"field\", icon: UiField },\n];\n\nexport function isDataNode(node: CallGraphNode): boolean {\n return Object.hasOwn(DATA_KIND_WORDS, node.kind);\n}\n\nexport const DATA_MEMBER_OWNER: Readonly<Record<string, string>> = { column: \"table\", field: \"entity\" };\n\nexport function isDataMember(node: CallGraphNode): boolean {\n return isDataNode(node) && Object.hasOwn(DATA_MEMBER_OWNER, node.kind);\n}\n\nexport function dataNodeGlyph(node: CallGraphNode): string {\n return node.kind === \"column\" && node.properties?.primaryKey === \"true\" ? \"primary_key\" : node.kind;\n}\n\nexport function dataMemberAside(node: CallGraphNode): string | undefined {\n return node.kind === \"column\" ? node.properties?.sqlType : undefined;\n}\n\n/** The data node's name: its id after `<kind>:`, else its label. */\nfunction dataName(node: CallGraphNode): string {\n const prefix = `${node.kind}:`;\n return node.id.startsWith(prefix) ? node.id.slice(prefix.length) : node.label;\n}\n\nexport function dataNodeStatus(node: CallGraphNode): string {\n const name = dataName(node);\n switch (node.kind) {\n case \"table\": return `Table ${name}`;\n case \"column\": return `Column ${name}`;\n case \"procedure\": return `Stored procedure ${name}`;\n case \"entity\": return `${name} fields`;\n }\n const entity = name.includes(\".\") ? name.slice(0, name.indexOf(\".\")) : (node.group ?? \"\");\n const { column, storage } = node.properties ?? {};\n if (column) return `${entity} field → ${column}`;\n if (storage) return `${entity} field, dynamic, stored in ${storage}`;\n return `${entity} field`;\n}\n\n/** The column behind a field, by its `column` property. */\nexport function dataNodeBacking(node: CallGraphNode): { id: string; label: string } | undefined {\n const column = node.kind === \"field\" ? node.properties?.column : undefined;\n return column ? { id: `column:${column}`, label: column } : undefined;\n}\n\nexport function isBuiltin(node: CallGraphNode): boolean {\n return node.kind === \"builtin\";\n}\n\n/** The node standing for the calls a package makes outside any declaration. */\nfunction isPackageScope(node: CallGraphNode): boolean {\n return node.kind === \"package\";\n}\n\n/** A symbol declared outside the indexed snapshots: it has no source, so it cannot be opened or expanded. */\nexport function isExternal(node: CallGraphNode): boolean {\n return !node.location && !node.unresolved && !isBuiltin(node) && !isPackageScope(node) && !isDataNode(node);\n}\n\n/**\n * The index has no kind for an interface method: it is a `method`. It shows in the graph as the target\n * of a call whose site also carries a dispatch edge from the same caller, because the source adds that\n * dispatch edge to each implementation of the interface method called there.\n */\nexport function interfaceMethods(graph: CallGraph): Set<string> {\n const dispatched = new Set(\n graph.edges.filter((edge) => edge.type === \"dispatch\").flatMap((edge) => edge.sites.map((site) => `${edge.from} ${siteKey(site)}`)),\n );\n return new Set(\n graph.edges\n .filter((edge) => edge.type === \"call\" && edge.sites.some((site) => dispatched.has(`${edge.from} ${siteKey(site)}`)))\n .map((edge) => edge.to),\n );\n}\n\n/**\n * The one glyph a node shows. An unresolved call, a builtin and a package scope are what they are;\n * after those, a symbol that calls itself, an external function and an interface method outrank the\n * plain kind. An external method keeps the method glyph: its dimmed box already says it has no source.\n */\nfunction uirGlyph(graph: CallGraph, node: CallGraphNode): string {\n if (node.unresolved) return \"unresolved\";\n if (isBuiltin(node)) return \"builtin\";\n if (isPackageScope(node)) return \"package\";\n if (isDataNode(node)) return dataNodeGlyph(node);\n if (callsItself(graph, node)) return \"recursive\";\n if (isExternal(node) && node.kind === \"func\") return \"external_func\";\n if (interfaceMethods(graph).has(node.id)) return \"interface_method\";\n return UIR_KINDS.get(node.kind)?.glyph ?? \"symbol\";\n}\n\nfunction uirKind(graph: CallGraph, node: CallGraphNode): string {\n if (node.unresolved) return \"unresolved call\";\n const kind = interfaceMethods(graph).has(node.id) ? \"interface method\" : (UIR_KINDS.get(node.kind)?.words ?? DATA_KIND_WORDS[node.kind] ?? node.kind.replaceAll(\"_\", \" \"));\n return [isExternal(node) ? \"external\" : \"\", callsItself(graph, node) ? \"recursive\" : \"\", kind].filter(Boolean).join(\" \");\n}\n\nfunction uirStatus(node: CallGraphNode): string {\n if (node.unresolved) return \"Unresolved: the index has no target for this call\";\n if (isBuiltin(node)) return \"Builtin: no source\";\n if (isExternal(node)) return \"External: declared outside the indexed snapshots\";\n if (node.location) return \"Indexed\";\n return isDataNode(node) ? dataNodeStatus(node) : \"Package scope: calls made outside any declaration\";\n}\n\nexport const UIR_CALL_GRAPH_VOCABULARY: CallGraphVocabulary = {\n glyphs: [\n { id: \"func\", name: \"function\", icon: UiFunction },\n { id: \"method\", name: \"method\", icon: UiMethod },\n { id: \"interface_method\", name: \"interface method\", icon: UiInterface },\n { id: \"recursive\", name: \"calls itself\", icon: UiMethod11, darkIcon: UiMethod11Dark },\n { id: \"external_func\", name: \"external function\", icon: UiFunction1, darkIcon: UiFunction1Dark },\n { id: \"builtin\", name: \"builtin\", icon: UiFunctionSquare },\n { id: \"type\", name: \"type\", icon: UiTypeParameter },\n { id: \"field\", name: \"field\", icon: UiField },\n { id: \"var\", name: \"variable\", icon: UiVariable },\n { id: \"const\", name: \"constant\", icon: UiConstant },\n { id: \"package\", name: \"package scope\", icon: UiPackage },\n // uir's `field` is already a glyph of its own: a struct field is data too.\n ...CALL_GRAPH_DATA_GLYPHS.filter((glyph) => glyph.id !== \"field\"),\n { id: \"unresolved\", name: \"unresolved call\", icon: UiUnknown },\n { id: \"symbol\", name: \"other symbol\", icon: UiSymbol, darkIcon: UiSymbolDark },\n ],\n glyphOf: uirGlyph,\n kindOf: uirKind,\n hasSource: (node) => Boolean(node.location),\n canRoot: (node) => Boolean(node.location) || isDataNode(node),\n isData: isDataNode,\n muted: (node) => Boolean(node.unresolved) || isBuiltin(node) || isExternal(node),\n status: uirStatus,\n backing: dataNodeBacking,\n group: { noun: \"package\", plural: \"packages\", icon: UiPackage, patternHint: \"example.com/module/...\" },\n};\n"],"names":["UiSqlTable","UiSqlColumn","UiKey","UiSqlStoredProc","UiTableProperties","UiField","UiFunction","UiMethod","UiInterface","UiMethod11","UiMethod11Dark","UiFunction1","UiFunction1Dark","UiFunctionSquare","UiTypeParameter","UiVariable","UiConstant","UiPackage","UiUnknown","UiSymbol","UiSymbolDark"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+DO,SAAS,aAAa,YAAiC,IAA4B;AACxF,QAAM,QAAQ,WAAW,OAAO,KAAK,CAAC,cAAc,UAAU,OAAO,EAAE;AACvE,MAAI,CAAC,MAAO,OAAM,IAAI,MAAM,4CAA4C,EAAE,GAAG;AAC7E,SAAO;AACT;AAGO,SAAS,WAAW,OAAkB,YAAmD;AAC9F,QAAM,OAAO,IAAI,IAAI,MAAM,MAAM,IAAI,CAAC,SAAS,WAAW,QAAQ,OAAO,IAAI,CAAC,CAAC;AAC/E,SAAO,WAAW,OAAO,OAAO,CAAC,UAAU,KAAK,IAAI,MAAM,EAAE,CAAC;AAC/D;AAGO,SAAS,UAAU,OAAkB,MAAqB,YAAyC;;AACxG,QAAM,UAAQ,iBAAM,WAAN,mBAAc,KAAK,CAAC,cAAc,UAAU,OAAO,KAAK,WAAxD,mBAAgE,UAAS,KAAK;AAC5F,SAAO,GAAG,WAAW,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,GAAG,QAAQ,OAAO,KAAK,KAAK,EAAE;AACtF;AAEO,SAA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