codebase-onboarder 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -46
- package/bin/build-if-source.js +23 -0
- package/cli/commands.d.ts +26 -0
- package/cli/commands.js +836 -811
- package/cli/commands.js.map +1 -0
- package/cli/explorer/advanced.d.ts +14 -0
- package/cli/explorer/advanced.js +321 -329
- package/cli/explorer/advanced.js.map +1 -0
- package/cli/explorer/app.d.ts +1 -0
- package/cli/explorer/app.js +384 -313
- package/cli/explorer/app.js.map +1 -0
- package/cli/explorer/assistant.d.ts +9 -0
- package/cli/explorer/assistant.js +58 -0
- package/cli/explorer/assistant.js.map +1 -0
- package/cli/explorer/commands.d.ts +17 -0
- package/cli/explorer/commands.js +368 -302
- package/cli/explorer/commands.js.map +1 -0
- package/cli/explorer/featureViews.d.ts +124 -0
- package/cli/explorer/featureViews.js +179 -0
- package/cli/explorer/featureViews.js.map +1 -0
- package/cli/explorer/github.d.ts +21 -0
- package/cli/explorer/github.js +42 -44
- package/cli/explorer/github.js.map +1 -0
- package/cli/explorer/graphs.d.ts +7 -0
- package/cli/explorer/graphs.js +90 -95
- package/cli/explorer/graphs.js.map +1 -0
- package/cli/explorer/picker.d.ts +22 -0
- package/cli/explorer/picker.js +150 -0
- package/cli/explorer/picker.js.map +1 -0
- package/cli/explorer/report.d.ts +85 -0
- package/cli/explorer/report.js +60 -0
- package/cli/explorer/report.js.map +1 -0
- package/cli/explorer/session.d.ts +449 -0
- package/cli/explorer/session.js +143 -144
- package/cli/explorer/session.js.map +1 -0
- package/cli/explorer/views.d.ts +19 -0
- package/cli/explorer/views.js +465 -482
- package/cli/explorer/views.js.map +1 -0
- package/cli/explorer/wrap.d.ts +1 -0
- package/cli/explorer/wrap.js +28 -44
- package/cli/explorer/wrap.js.map +1 -0
- package/cli/main.d.ts +1 -0
- package/cli/main.js +214 -161
- package/cli/main.js.map +1 -0
- package/cli/prompt.d.ts +5 -0
- package/cli/prompt.js +84 -80
- package/cli/prompt.js.map +1 -0
- package/cli/scanOptions.d.ts +2 -0
- package/cli/scanOptions.js +11 -0
- package/cli/scanOptions.js.map +1 -0
- package/cli/ui.d.ts +33 -0
- package/cli/ui.js +35 -44
- package/cli/ui.js.map +1 -0
- package/cli/wizard.d.ts +187 -0
- package/cli/wizard.js +304 -284
- package/cli/wizard.js.map +1 -0
- package/package.json +15 -4
- package/public/app.d.ts +1 -0
- package/public/app.js +1057 -1009
- package/public/app.js.map +1 -0
- package/public/browser.d.ts +68 -0
- package/public/browser.js +2 -0
- package/public/browser.js.map +1 -0
- package/public/index.html +30 -13
- package/public/js/about.d.ts +6 -0
- package/public/js/about.js +152 -172
- package/public/js/about.js.map +1 -0
- package/public/js/aiDraft.d.ts +3 -0
- package/public/js/aiDraft.js +116 -124
- package/public/js/aiDraft.js.map +1 -0
- package/public/js/analysisPanel.d.ts +7 -0
- package/public/js/analysisPanel.js +166 -166
- package/public/js/analysisPanel.js.map +1 -0
- package/public/js/analysisReport.d.ts +38 -0
- package/public/js/analysisReport.js +105 -110
- package/public/js/analysisReport.js.map +1 -0
- package/public/js/api.d.ts +26 -0
- package/public/js/api.js +176 -167
- package/public/js/api.js.map +1 -0
- package/public/js/atlas.d.ts +6 -0
- package/public/js/atlas.js +50 -58
- package/public/js/atlas.js.map +1 -0
- package/public/js/blameView.d.ts +2 -0
- package/public/js/blameView.js +36 -37
- package/public/js/blameView.js.map +1 -0
- package/public/js/codeTab.d.ts +3 -0
- package/public/js/codeTab.js +175 -180
- package/public/js/codeTab.js.map +1 -0
- package/public/js/codeViewer.d.ts +5 -0
- package/public/js/codeViewer.js +162 -150
- package/public/js/codeViewer.js.map +1 -0
- package/public/js/components/FileChip.d.ts +9 -0
- package/public/js/components/FileChip.js +45 -49
- package/public/js/components/FileChip.js.map +1 -0
- package/public/js/components/MetricSparkline.d.ts +7 -0
- package/public/js/components/MetricSparkline.js +35 -44
- package/public/js/components/MetricSparkline.js.map +1 -0
- package/public/js/components/RiskBadge.d.ts +9 -0
- package/public/js/components/RiskBadge.js +55 -63
- package/public/js/components/RiskBadge.js.map +1 -0
- package/public/js/deepAnalysisView.d.ts +99 -0
- package/public/js/deepAnalysisView.js +282 -302
- package/public/js/deepAnalysisView.js.map +1 -0
- package/public/js/diagramPane.d.ts +8 -0
- package/public/js/diagramPane.js +133 -135
- package/public/js/diagramPane.js.map +1 -0
- package/public/js/diffView.d.ts +6 -0
- package/public/js/diffView.js +222 -209
- package/public/js/diffView.js.map +1 -0
- package/public/js/docsView.d.ts +2 -0
- package/public/js/docsView.js +441 -442
- package/public/js/docsView.js.map +1 -0
- package/public/js/dom.d.ts +189 -0
- package/public/js/dom.js +5 -0
- package/public/js/dom.js.map +1 -0
- package/public/js/fileSourceBrowser.d.ts +5 -0
- package/public/js/fileSourceBrowser.js +33 -41
- package/public/js/fileSourceBrowser.js.map +1 -0
- package/public/js/flameGraph.d.ts +5 -0
- package/public/js/flameGraph.js +62 -72
- package/public/js/flameGraph.js.map +1 -0
- package/public/js/forceGraph.d.ts +10 -0
- package/public/js/forceGraph.js +581 -556
- package/public/js/forceGraph.js.map +1 -0
- package/public/js/heatmap.d.ts +4 -0
- package/public/js/heatmap.js +142 -164
- package/public/js/heatmap.js.map +1 -0
- package/public/js/highlight.d.ts +2 -0
- package/public/js/highlight.js +116 -107
- package/public/js/highlight.js.map +1 -0
- package/public/js/html.d.ts +2 -0
- package/public/js/html.js +14 -44
- package/public/js/html.js.map +1 -0
- package/public/js/insightsView.d.ts +5 -0
- package/public/js/insightsView.js +93 -111
- package/public/js/insightsView.js.map +1 -0
- package/public/js/inspector.d.ts +37 -0
- package/public/js/inspector.js +416 -445
- package/public/js/inspector.js.map +1 -0
- package/public/js/llm.d.ts +113 -0
- package/public/js/llm.js +233 -272
- package/public/js/llm.js.map +1 -0
- package/public/js/mapView.d.ts +3 -0
- package/public/js/mapView.js +121 -120
- package/public/js/mapView.js.map +1 -0
- package/public/js/markdown.d.ts +3 -0
- package/public/js/markdown.js +84 -91
- package/public/js/markdown.js.map +1 -0
- package/public/js/mindmap.d.ts +32 -0
- package/public/js/mindmap.js +244 -259
- package/public/js/mindmap.js.map +1 -0
- package/public/js/mobilePanels.d.ts +5 -0
- package/public/js/mobilePanels.js +50 -0
- package/public/js/mobilePanels.js.map +1 -0
- package/public/js/repoFiles.d.ts +12 -0
- package/public/js/repoFiles.js +28 -27
- package/public/js/repoFiles.js.map +1 -0
- package/public/js/reviewView.d.ts +28 -0
- package/public/js/reviewView.js +256 -0
- package/public/js/reviewView.js.map +1 -0
- package/public/js/sbomView.d.ts +3 -0
- package/public/js/sbomView.js +59 -67
- package/public/js/sbomView.js.map +1 -0
- package/public/js/scanCache.d.ts +16 -0
- package/public/js/scanCache.js +67 -65
- package/public/js/scanCache.js.map +1 -0
- package/public/js/search.d.ts +7 -0
- package/public/js/search.js +868 -800
- package/public/js/search.js.map +1 -0
- package/public/js/searchLocal.d.ts +42 -0
- package/public/js/searchLocal.js +87 -0
- package/public/js/searchLocal.js.map +1 -0
- package/public/js/serverSettings.d.ts +5 -0
- package/public/js/serverSettings.js +153 -164
- package/public/js/serverSettings.js.map +1 -0
- package/public/js/state.d.ts +798 -0
- package/public/js/state.js +114 -122
- package/public/js/state.js.map +1 -0
- package/public/js/tour.d.ts +6 -0
- package/public/js/tour.js +5 -7
- package/public/js/tour.js.map +1 -0
- package/public/js/transitions.d.ts +2 -0
- package/public/js/transitions.js +9 -10
- package/public/js/transitions.js.map +1 -0
- package/public/js/tree.d.ts +12 -0
- package/public/js/tree.js +157 -154
- package/public/js/tree.js.map +1 -0
- package/public/js/workflowsView.d.ts +3 -0
- package/public/js/workflowsView.js +15 -22
- package/public/js/workflowsView.js.map +1 -0
- package/public/search.css +495 -0
- package/public/styles.css +163 -346
- package/public/workbench.css +166 -0
- package/server/apiAuth.d.ts +3 -0
- package/server/apiAuth.js +18 -20
- package/server/apiAuth.js.map +1 -0
- package/server/apiDiff.d.ts +2 -0
- package/server/apiDiff.js +20 -18
- package/server/apiDiff.js.map +1 -0
- package/server/apiDocs.d.ts +2 -0
- package/server/apiDocs.js +38 -40
- package/server/apiDocs.js.map +1 -0
- package/server/apiFile.d.ts +1 -0
- package/server/apiFile.js +14 -17
- package/server/apiFile.js.map +1 -0
- package/server/apiGitBlame.d.ts +2 -0
- package/server/apiGitBlame.js +50 -51
- package/server/apiGitBlame.js.map +1 -0
- package/server/apiMcp.d.ts +4 -0
- package/server/apiMcp.js +64 -66
- package/server/apiMcp.js.map +1 -0
- package/server/apiReview.d.ts +2 -0
- package/server/apiReview.js +45 -0
- package/server/apiReview.js.map +1 -0
- package/server/apiScan.d.ts +5 -0
- package/server/apiScan.js +90 -71
- package/server/apiScan.js.map +1 -0
- package/server/apiSearch.d.ts +33 -0
- package/server/apiSearch.js +184 -200
- package/server/apiSearch.js.map +1 -0
- package/server/apiSettings.d.ts +4 -0
- package/server/apiSettings.js +84 -85
- package/server/apiSettings.js.map +1 -0
- package/server/apiTools.d.ts +3 -0
- package/server/apiTools.js +55 -56
- package/server/apiTools.js.map +1 -0
- package/server/auth.d.ts +5 -0
- package/server/auth.js +54 -51
- package/server/auth.js.map +1 -0
- package/server/config.d.ts +42 -0
- package/server/config.js +189 -194
- package/server/config.js.map +1 -0
- package/server/daemon.d.ts +12 -0
- package/server/daemon.js +124 -114
- package/server/daemon.js.map +1 -0
- package/server/fileSourceNode.d.ts +2 -0
- package/server/fileSourceNode.js +34 -36
- package/server/fileSourceNode.js.map +1 -0
- package/server/gitClone.d.ts +9 -0
- package/server/gitClone.js +59 -61
- package/server/gitClone.js.map +1 -0
- package/server/gitDiff.d.ts +36 -0
- package/server/gitDiff.js +271 -169
- package/server/gitDiff.js.map +1 -0
- package/server/gitHistory.d.ts +12 -0
- package/server/gitHistory.js +80 -80
- package/server/gitHistory.js.map +1 -0
- package/server/gitRemote.d.ts +12 -0
- package/server/gitRemote.js +37 -38
- package/server/gitRemote.js.map +1 -0
- package/server/htmlText.d.ts +4 -0
- package/server/htmlText.js +16 -23
- package/server/htmlText.js.map +1 -0
- package/server/http.d.ts +5 -0
- package/server/http.js +27 -30
- package/server/http.js.map +1 -0
- package/server/httpGuards.d.ts +2 -0
- package/server/httpGuards.js +47 -43
- package/server/httpGuards.js.map +1 -0
- package/server/https.d.ts +34 -0
- package/server/https.js +121 -111
- package/server/https.js.map +1 -0
- package/server/index.d.ts +40 -0
- package/server/index.js +139 -147
- package/server/index.js.map +1 -0
- package/server/layout.d.ts +26 -0
- package/server/layout.js +59 -64
- package/server/layout.js.map +1 -0
- package/server/llmProxy.d.ts +3 -0
- package/server/llmProxy.js +137 -135
- package/server/llmProxy.js.map +1 -0
- package/server/logger.d.ts +38 -0
- package/server/logger.js +198 -211
- package/server/logger.js.map +1 -0
- package/server/mcp/analysis.d.ts +29 -0
- package/server/mcp/analysis.js +99 -120
- package/server/mcp/analysis.js.map +1 -0
- package/server/mcp/http.d.ts +9 -0
- package/server/mcp/http.js +128 -137
- package/server/mcp/http.js.map +1 -0
- package/server/mcp/runner.d.ts +68 -0
- package/server/mcp/runner.js +208 -218
- package/server/mcp/runner.js.map +1 -0
- package/server/mcp/server.d.ts +29 -0
- package/server/mcp/server.js +166 -179
- package/server/mcp/server.js.map +1 -0
- package/server/mcp/standalone.d.ts +1 -0
- package/server/mcp/standalone.js +8 -10
- package/server/mcp/standalone.js.map +1 -0
- package/server/mcp/tools.d.ts +2020 -0
- package/server/mcp/tools.js +523 -574
- package/server/mcp/tools.js.map +1 -0
- package/server/paths.d.ts +3 -0
- package/server/paths.js +17 -15
- package/server/paths.js.map +1 -0
- package/server/pidfile.d.ts +9 -0
- package/server/pidfile.js +43 -45
- package/server/pidfile.js.map +1 -0
- package/server/review.d.ts +5 -0
- package/server/review.js +35 -0
- package/server/review.js.map +1 -0
- package/server/router.d.ts +33 -0
- package/server/router.js +191 -197
- package/server/router.js.map +1 -0
- package/server/scanRequest.d.ts +3 -0
- package/server/scanRequest.js +36 -0
- package/server/scanRequest.js.map +1 -0
- package/server/searchIndex.d.ts +17 -0
- package/server/searchIndex.js +83 -80
- package/server/searchIndex.js.map +1 -0
- package/server/sessions.d.ts +14 -0
- package/server/sessions.js +62 -70
- package/server/sessions.js.map +1 -0
- package/server/startup.d.ts +118 -0
- package/server/startup.js +143 -148
- package/server/startup.js.map +1 -0
- package/server/static.d.ts +6 -0
- package/server/static.js +28 -31
- package/server/static.js.map +1 -0
- package/server/tools/install.d.ts +4 -0
- package/server/tools/install.js +176 -185
- package/server/tools/install.js.map +1 -0
- package/server/tools/parse.d.ts +8 -0
- package/server/tools/parse.js +112 -114
- package/server/tools/parse.js.map +1 -0
- package/server/tools/platform.d.ts +9 -0
- package/server/tools/platform.js +49 -47
- package/server/tools/platform.js.map +1 -0
- package/server/tools/registry.d.ts +137 -0
- package/server/tools/registry.js +173 -172
- package/server/tools/registry.js.map +1 -0
- package/server/tools/scan.d.ts +34 -0
- package/server/tools/scan.js +89 -98
- package/server/tools/scan.js.map +1 -0
- package/server/tools.d.ts +34 -0
- package/server/tools.js +94 -107
- package/server/tools.js.map +1 -0
- package/server/tunnel.d.ts +29 -0
- package/server/tunnel.js +61 -66
- package/server/tunnel.js.map +1 -0
- package/shared/analyzer/docs.d.ts +16 -0
- package/shared/analyzer/docs.js +99 -93
- package/shared/analyzer/docs.js.map +1 -0
- package/shared/analyzer/explainLocal.d.ts +4 -0
- package/shared/analyzer/explainLocal.js +122 -142
- package/shared/analyzer/explainLocal.js.map +1 -0
- package/shared/analyzer/github.d.ts +37 -0
- package/shared/analyzer/github.js +41 -43
- package/shared/analyzer/github.js.map +1 -0
- package/shared/analyzer/graph.d.ts +41 -0
- package/shared/analyzer/graph.js +393 -400
- package/shared/analyzer/graph.js.map +1 -0
- package/shared/analyzer/health.d.ts +33 -0
- package/shared/analyzer/health.js +197 -193
- package/shared/analyzer/health.js.map +1 -0
- package/shared/analyzer/history.d.ts +29 -0
- package/shared/analyzer/history.js +110 -111
- package/shared/analyzer/history.js.map +1 -0
- package/shared/analyzer/jsonConfig.d.ts +2 -0
- package/shared/analyzer/jsonConfig.js +61 -0
- package/shared/analyzer/jsonConfig.js.map +1 -0
- package/shared/analyzer/languages/csharp.d.ts +26 -0
- package/shared/analyzer/languages/csharp.js +83 -88
- package/shared/analyzer/languages/csharp.js.map +1 -0
- package/shared/analyzer/languages/generic.d.ts +23 -0
- package/shared/analyzer/languages/generic.js +94 -105
- package/shared/analyzer/languages/generic.js.map +1 -0
- package/shared/analyzer/languages/go.d.ts +24 -0
- package/shared/analyzer/languages/go.js +45 -54
- package/shared/analyzer/languages/go.js.map +1 -0
- package/shared/analyzer/languages/index.d.ts +6 -0
- package/shared/analyzer/languages/index.js +19 -20
- package/shared/analyzer/languages/index.js.map +1 -0
- package/shared/analyzer/languages/java.d.ts +20 -0
- package/shared/analyzer/languages/java.js +73 -78
- package/shared/analyzer/languages/java.js.map +1 -0
- package/shared/analyzer/languages/javascript.d.ts +12 -0
- package/shared/analyzer/languages/javascript.js +258 -209
- package/shared/analyzer/languages/javascript.js.map +1 -0
- package/shared/analyzer/languages/python.d.ts +23 -0
- package/shared/analyzer/languages/python.js +92 -100
- package/shared/analyzer/languages/python.js.map +1 -0
- package/shared/analyzer/languages/rust.d.ts +17 -0
- package/shared/analyzer/languages/rust.js +96 -98
- package/shared/analyzer/languages/rust.js.map +1 -0
- package/shared/analyzer/languages/typescript.d.ts +11 -0
- package/shared/analyzer/languages/typescript.js +117 -116
- package/shared/analyzer/languages/typescript.js.map +1 -0
- package/shared/analyzer/licenses.d.ts +18 -0
- package/shared/analyzer/licenses.js +130 -133
- package/shared/analyzer/licenses.js.map +1 -0
- package/shared/analyzer/metrics.d.ts +20 -0
- package/shared/analyzer/metrics.js +112 -104
- package/shared/analyzer/metrics.js.map +1 -0
- package/shared/analyzer/pathUtil.d.ts +10 -0
- package/shared/analyzer/pathUtil.js +29 -35
- package/shared/analyzer/pathUtil.js.map +1 -0
- package/shared/analyzer/patterns.d.ts +11 -0
- package/shared/analyzer/patterns.js +231 -253
- package/shared/analyzer/patterns.js.map +1 -0
- package/shared/analyzer/scan.d.ts +62 -0
- package/shared/analyzer/scan.js +451 -442
- package/shared/analyzer/scan.js.map +1 -0
- package/shared/analyzer/scanControl.d.ts +11 -0
- package/shared/analyzer/scanControl.js +62 -0
- package/shared/analyzer/scanControl.js.map +1 -0
- package/shared/analyzer/security.d.ts +18 -0
- package/shared/analyzer/security.js +159 -159
- package/shared/analyzer/security.js.map +1 -0
- package/shared/analyzer/services.d.ts +5 -0
- package/shared/analyzer/services.js +141 -138
- package/shared/analyzer/services.js.map +1 -0
- package/shared/analyzer/stack.d.ts +6 -0
- package/shared/analyzer/stack.js +134 -141
- package/shared/analyzer/stack.js.map +1 -0
- package/shared/analyzer/tour.d.ts +2 -0
- package/shared/analyzer/tour.js +45 -53
- package/shared/analyzer/tour.js.map +1 -0
- package/shared/analyzer/util.d.ts +8 -0
- package/shared/analyzer/util.js +130 -76
- package/shared/analyzer/util.js.map +1 -0
- package/shared/analyzer/workflows.d.ts +8 -0
- package/shared/analyzer/workflows.js +139 -134
- package/shared/analyzer/workflows.js.map +1 -0
- package/shared/contracts.d.ts +250 -0
- package/shared/contracts.js +2 -0
- package/shared/contracts.js.map +1 -0
- package/shared/diagram/aiFacts.d.ts +35 -0
- package/shared/diagram/aiFacts.js +102 -105
- package/shared/diagram/aiFacts.js.map +1 -0
- package/shared/diagram/aiMermaid.d.ts +5 -0
- package/shared/diagram/aiMermaid.js +46 -45
- package/shared/diagram/aiMermaid.js.map +1 -0
- package/shared/diagram/atlas.d.ts +16 -0
- package/shared/diagram/atlas.js +51 -60
- package/shared/diagram/atlas.js.map +1 -0
- package/shared/diagram/mermaid.d.ts +43 -0
- package/shared/diagram/mermaid.js +348 -370
- package/shared/diagram/mermaid.js.map +1 -0
- package/shared/review/contracts.d.ts +95 -0
- package/shared/review/contracts.js +2 -0
- package/shared/review/contracts.js.map +1 -0
- package/shared/review/review.d.ts +10 -0
- package/shared/review/review.js +184 -0
- package/shared/review/review.js.map +1 -0
- package/shared/search/query.d.ts +32 -0
- package/shared/search/query.js +395 -388
- package/shared/search/query.js.map +1 -0
package/shared/analyzer/stack.js
CHANGED
|
@@ -2,100 +2,96 @@
|
|
|
2
2
|
// language counts, name the frameworks, libraries and languages a repo leans
|
|
3
3
|
// on — each tagged with a category and the official docs URL. The docs URLs
|
|
4
4
|
// feed the server-side /api/doc fetch (allowlisted) for informed summaries.
|
|
5
|
-
|
|
6
5
|
// name -> [category, docs url]
|
|
7
6
|
const KNOWN = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
7
|
+
react: ['Frontend framework', 'https://react.dev'],
|
|
8
|
+
'react-dom': ['Frontend framework', 'https://react.dev'],
|
|
9
|
+
'@angular/core': ['Frontend framework', 'https://angular.dev'],
|
|
10
|
+
vue: ['Frontend framework', 'https://vuejs.org'],
|
|
11
|
+
svelte: ['Frontend framework', 'https://svelte.dev'],
|
|
12
|
+
next: ['Web framework', 'https://nextjs.org/docs'],
|
|
13
|
+
nuxt: ['Web framework', 'https://nuxt.com/docs'],
|
|
14
|
+
remix: ['Web framework', 'https://remix.run/docs'],
|
|
15
|
+
gatsby: ['Web framework', 'https://www.gatsbyjs.com/docs'],
|
|
16
|
+
express: ['Web framework', 'https://expressjs.com'],
|
|
17
|
+
fastify: ['Web framework', 'https://fastify.dev'],
|
|
18
|
+
koa: ['Web framework', 'https://koajs.com'],
|
|
19
|
+
'@nestjs/core': ['Web framework', 'https://docs.nestjs.com'],
|
|
20
|
+
hapi: ['Web framework', 'https://hapi.dev'],
|
|
21
|
+
flask: ['Web framework', 'https://flask.palletsprojects.com'],
|
|
22
|
+
django: ['Web framework', 'https://docs.djangoproject.com'],
|
|
23
|
+
fastapi: ['Web framework', 'https://fastapi.tiangolo.com'],
|
|
24
|
+
'spring-boot': ['Web framework', 'https://docs.spring.io/spring-boot'],
|
|
25
|
+
laravel: ['Web framework', 'https://laravel.com/docs'],
|
|
26
|
+
rails: ['Web framework', 'https://guides.rubyonrails.org'],
|
|
27
|
+
gin: ['Web framework', 'https://gin-gonic.com'],
|
|
28
|
+
echo: ['Web framework', 'https://echo.labstack.com'],
|
|
29
|
+
fiber: ['Web framework', 'https://gofiber.io'],
|
|
30
|
+
'actix-web': ['Web framework', 'https://actix.rs'],
|
|
31
|
+
axum: ['Web framework', 'https://docs.rs/axum'],
|
|
32
|
+
rocket: ['Web framework', 'https://rocket.rs'],
|
|
33
|
+
prisma: ['Database / ORM', 'https://www.prisma.io/docs'],
|
|
34
|
+
sequelize: ['Database / ORM', 'https://sequelize.org'],
|
|
35
|
+
typeorm: ['Database / ORM', 'https://typeorm.io'],
|
|
36
|
+
sqlalchemy: ['Database / ORM', 'https://docs.sqlalchemy.org'],
|
|
37
|
+
'drizzle-orm': ['Database / ORM', 'https://orm.drizzle.team'],
|
|
38
|
+
mongoose: ['Database / ORM', 'https://mongoosejs.com'],
|
|
39
|
+
knex: ['Database / ORM', 'https://knexjs.org'],
|
|
40
|
+
pg: ['Database / ORM', 'https://node-postgres.com'],
|
|
41
|
+
pymongo: ['Database / ORM', 'https://pymongo.readthedocs.io'],
|
|
42
|
+
gorm: ['Database / ORM', 'https://gorm.io'],
|
|
43
|
+
sqlx: ['Database / ORM', 'https://docs.rs/sqlx'],
|
|
44
|
+
diesel: ['Database / ORM', 'https://diesel.rs'],
|
|
45
|
+
redis: ['Database / ORM', 'https://redis.io/docs/'],
|
|
46
|
+
jest: ['Testing', 'https://jestjs.io'],
|
|
47
|
+
vitest: ['Testing', 'https://vitest.dev'],
|
|
48
|
+
mocha: ['Testing', 'https://mochajs.org'],
|
|
49
|
+
'@testing-library/react': ['Testing', 'https://testing-library.com'],
|
|
50
|
+
pytest: ['Testing', 'https://docs.pytest.org'],
|
|
51
|
+
playwright: ['Testing', 'https://playwright.dev'],
|
|
52
|
+
cypress: ['Testing', 'https://docs.cypress.io'],
|
|
53
|
+
rspec: ['Testing', 'https://rspec.info'],
|
|
54
|
+
typescript: ['Tooling / build', 'https://www.typescriptlang.org/docs'],
|
|
55
|
+
vite: ['Tooling / build', 'https://vitejs.dev/guide/'],
|
|
56
|
+
webpack: ['Tooling / build', 'https://webpack.js.org'],
|
|
57
|
+
esbuild: ['Tooling / build', 'https://esbuild.github.io'],
|
|
58
|
+
babel: ['Tooling / build', 'https://babeljs.io/docs'],
|
|
59
|
+
rollup: ['Tooling / build', 'https://rollupjs.org'],
|
|
60
|
+
tailwindcss: ['UI / styling', 'https://tailwindcss.com/docs'],
|
|
61
|
+
bootstrap: ['UI / styling', 'https://getbootstrap.com/docs'],
|
|
62
|
+
sass: ['UI / styling', 'https://sass-lang.com/documentation'],
|
|
63
|
+
'styled-components': ['UI / styling', 'https://styled-components.com'],
|
|
64
|
+
axios: ['Networking', 'https://axios-http.com'],
|
|
65
|
+
requests: ['Networking', 'https://requests.readthedocs.io'],
|
|
66
|
+
urllib3: ['Networking', 'https://urllib3.readthedocs.io'],
|
|
67
|
+
httpx: ['Networking', 'https://www.python-httpx.org'],
|
|
68
|
+
passport: ['Auth', 'https://www.passportjs.org'],
|
|
69
|
+
'next-auth': ['Auth', 'https://next-auth.js.org'],
|
|
70
|
+
jsonwebtoken: ['Auth', 'https://github.com/auth0/node-jsonwebtoken'],
|
|
71
|
+
pydantic: ['Data validation', 'https://docs.pydantic.dev'],
|
|
72
|
+
numpy: ['Data / science', 'https://numpy.org/doc/'],
|
|
73
|
+
pandas: ['Data / science', 'https://pandas.pydata.org/docs/'],
|
|
74
|
+
'scikit-learn': ['Data / science', 'https://scikit-learn.org/stable/'],
|
|
75
|
+
torch: ['Data / science', 'https://pytorch.org/docs/'],
|
|
76
|
+
tensorflow: ['Data / science', 'https://www.tensorflow.org/api_docs'],
|
|
77
|
+
'opencv-python': ['Data / science', 'https://docs.opencv.org'],
|
|
78
|
+
keras: ['Data / science', 'https://keras.io'],
|
|
79
|
+
'python-dotenv': ['Tooling / config', 'https://github.com/theskumar/python-dotenv'],
|
|
81
80
|
};
|
|
82
|
-
|
|
83
81
|
const ORDER = [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
'Web framework', 'Frontend framework', 'Database / ORM', 'Auth',
|
|
83
|
+
'Networking', 'Data / science', 'Data validation', 'UI / styling',
|
|
84
|
+
'Testing', 'Tooling / build', 'Tooling / config', 'Library',
|
|
87
85
|
];
|
|
88
|
-
|
|
89
86
|
// Where a dependency that is not in KNOWN sends you: its registry page. Named
|
|
90
87
|
// here rather than inlined below because two things need them — the URL
|
|
91
88
|
// builders, and the host allowlist under them.
|
|
92
89
|
const REGISTRY = {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
npm: (name) => `https://www.npmjs.com/package/${name}`,
|
|
91
|
+
pip: (name) => `https://pypi.org/project/${name}/`,
|
|
92
|
+
go: (name) => `https://pkg.go.dev/${name}`,
|
|
93
|
+
cargo: (name) => `https://docs.rs/${name}`,
|
|
97
94
|
};
|
|
98
|
-
|
|
99
95
|
// Every host `analyzeStack` can hand out a docs URL for. The server allowlists
|
|
100
96
|
// exactly this set for `/api/doc`, and that is the SSRF guard: a host no
|
|
101
97
|
// dependency name can produce is a host the server will not fetch.
|
|
@@ -110,64 +106,61 @@ const REGISTRY = {
|
|
|
110
106
|
// `www.` comes off because the caller strips it from the incoming host too;
|
|
111
107
|
// leaving it on would mean `www.npmjs.com` never matched a request for
|
|
112
108
|
// `npmjs.com`.
|
|
113
|
-
export const DOC_HOSTS = Object.freeze([...new Set(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
].map((url) => new URL(url).hostname.replace(/^www\./, ''))
|
|
118
|
-
)].sort());
|
|
119
|
-
|
|
109
|
+
export const DOC_HOSTS = Object.freeze([...new Set([
|
|
110
|
+
...Object.values(KNOWN).map(([, url]) => url),
|
|
111
|
+
...Object.values(REGISTRY).map((toUrl) => toUrl('any')),
|
|
112
|
+
].map((url) => new URL(url).hostname.replace(/^www\./, '')))].sort());
|
|
120
113
|
function cleanVersion(v) {
|
|
121
|
-
|
|
114
|
+
return String(v || '').replace(/^[\^~>=< ]+/, '').split(' ')[0].trim();
|
|
122
115
|
}
|
|
123
|
-
|
|
124
116
|
export function analyzeStack(manifest = {}, languages = {}) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
117
|
+
const deps = manifest.deps || { npm: {}, dev: {}, pip: [], go: [], cargo: [] };
|
|
118
|
+
const items = [];
|
|
119
|
+
const seen = new Set();
|
|
120
|
+
const add = (name, version, category, lang, docs, dev = false) => {
|
|
121
|
+
if (!name || seen.has(name))
|
|
122
|
+
return;
|
|
123
|
+
seen.add(name);
|
|
124
|
+
items.push({ name, version: cleanVersion(version), category, lang, docs, dev });
|
|
125
|
+
};
|
|
126
|
+
const npmDocs = (name) => {
|
|
127
|
+
const k = KNOWN[name];
|
|
128
|
+
return k ? k[1] : REGISTRY.npm(name);
|
|
129
|
+
};
|
|
130
|
+
const catOf = (name) => {
|
|
131
|
+
const k = KNOWN[name];
|
|
132
|
+
return k ? k[0] : 'Library';
|
|
133
|
+
};
|
|
134
|
+
for (const [name, ver] of Object.entries(deps.npm || {})) {
|
|
135
|
+
if (name !== 'react-dom')
|
|
136
|
+
add(name, ver, catOf(name), 'JavaScript', npmDocs(name), false);
|
|
137
|
+
}
|
|
138
|
+
for (const [name, ver] of Object.entries(deps.dev || {})) {
|
|
139
|
+
if (name !== 'react-dom')
|
|
140
|
+
add(name, ver, catOf(name), 'JavaScript', npmDocs(name), true);
|
|
141
|
+
}
|
|
142
|
+
for (const name of deps.pip || []) {
|
|
143
|
+
const k = KNOWN[name];
|
|
144
|
+
add(name, '', k ? k[0] : 'Library', 'Python', k ? k[1] : REGISTRY.pip(name), false);
|
|
145
|
+
}
|
|
146
|
+
for (const name of deps.go || []) {
|
|
147
|
+
const k = KNOWN[name.split('/').pop()];
|
|
148
|
+
add(name, '', k ? k[0] : 'Library', 'Go', REGISTRY.go(name), false);
|
|
149
|
+
}
|
|
150
|
+
for (const name of deps.cargo || []) {
|
|
151
|
+
const k = KNOWN[name] || KNOWN[name.replace(/_/g, '-')];
|
|
152
|
+
add(name, '', k ? k[0] : 'Library', 'Rust', k ? k[1] : REGISTRY.cargo(name), false);
|
|
153
|
+
}
|
|
154
|
+
items.sort((a, b) => (ORDER.indexOf(a.category) - ORDER.indexOf(b.category)) || a.name.localeCompare(b.name));
|
|
155
|
+
const pm = [];
|
|
156
|
+
if (deps.npm && Object.keys(deps.npm).length)
|
|
157
|
+
pm.push('npm');
|
|
158
|
+
if (deps.pip && deps.pip.length)
|
|
159
|
+
pm.push('pip');
|
|
160
|
+
if (deps.go && deps.go.length)
|
|
161
|
+
pm.push('go modules');
|
|
162
|
+
if (deps.cargo && deps.cargo.length)
|
|
163
|
+
pm.push('cargo');
|
|
164
|
+
return { languages, pm, items: items.slice(0, 48) };
|
|
172
165
|
}
|
|
173
|
-
|
|
166
|
+
//# sourceMappingURL=stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../src/shared/analyzer/stack.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAE5E,+BAA+B;AAC/B,MAAM,KAAK,GAAG;IACZ,KAAK,EAAE,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IAClD,WAAW,EAAE,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IACxD,eAAe,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAC9D,GAAG,EAAE,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IACpD,IAAI,EAAE,CAAC,eAAe,EAAE,yB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K,CAAC,CAAC;IAChD,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,MAAM;QAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEtD,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACtD,CAAC","sourcesContent":["// Stack analytics: from the manifest's declared dependencies plus the scan\n// language counts, name the frameworks, libraries and languages a repo leans\n// on — each tagged with a category and the official docs URL. The docs URLs\n// feed the server-side /api/doc fetch (allowlisted) for informed summaries.\n\n// name -> [category, docs url]\nconst KNOWN = {\n react: ['Frontend framework', 'https://react.dev'],\n 'react-dom': ['Frontend framework', 'https://react.dev'],\n '@angular/core': ['Frontend framework', 'https://angular.dev'],\n vue: ['Frontend framework', 'https://vuejs.org'],\n svelte: ['Frontend framework', 'https://svelte.dev'],\n next: ['Web framework', 'https://nextjs.org/docs'],\n nuxt: ['Web framework', 'https://nuxt.com/docs'],\n remix: ['Web framework', 'https://remix.run/docs'],\n gatsby: ['Web framework', 'https://www.gatsbyjs.com/docs'],\n express: ['Web framework', 'https://expressjs.com'],\n fastify: ['Web framework', 'https://fastify.dev'],\n koa: ['Web framework', 'https://koajs.com'],\n '@nestjs/core': ['Web framework', 'https://docs.nestjs.com'],\n hapi: ['Web framework', 'https://hapi.dev'],\n flask: ['Web framework', 'https://flask.palletsprojects.com'],\n django: ['Web framework', 'https://docs.djangoproject.com'],\n fastapi: ['Web framework', 'https://fastapi.tiangolo.com'],\n 'spring-boot': ['Web framework', 'https://docs.spring.io/spring-boot'],\n laravel: ['Web framework', 'https://laravel.com/docs'],\n rails: ['Web framework', 'https://guides.rubyonrails.org'],\n gin: ['Web framework', 'https://gin-gonic.com'],\n echo: ['Web framework', 'https://echo.labstack.com'],\n fiber: ['Web framework', 'https://gofiber.io'],\n 'actix-web': ['Web framework', 'https://actix.rs'],\n axum: ['Web framework', 'https://docs.rs/axum'],\n rocket: ['Web framework', 'https://rocket.rs'],\n prisma: ['Database / ORM', 'https://www.prisma.io/docs'],\n sequelize: ['Database / ORM', 'https://sequelize.org'],\n typeorm: ['Database / ORM', 'https://typeorm.io'],\n sqlalchemy: ['Database / ORM', 'https://docs.sqlalchemy.org'],\n 'drizzle-orm': ['Database / ORM', 'https://orm.drizzle.team'],\n mongoose: ['Database / ORM', 'https://mongoosejs.com'],\n knex: ['Database / ORM', 'https://knexjs.org'],\n pg: ['Database / ORM', 'https://node-postgres.com'],\n pymongo: ['Database / ORM', 'https://pymongo.readthedocs.io'],\n gorm: ['Database / ORM', 'https://gorm.io'],\n sqlx: ['Database / ORM', 'https://docs.rs/sqlx'],\n diesel: ['Database / ORM', 'https://diesel.rs'],\n redis: ['Database / ORM', 'https://redis.io/docs/'],\n jest: ['Testing', 'https://jestjs.io'],\n vitest: ['Testing', 'https://vitest.dev'],\n mocha: ['Testing', 'https://mochajs.org'],\n '@testing-library/react': ['Testing', 'https://testing-library.com'],\n pytest: ['Testing', 'https://docs.pytest.org'],\n playwright: ['Testing', 'https://playwright.dev'],\n cypress: ['Testing', 'https://docs.cypress.io'],\n rspec: ['Testing', 'https://rspec.info'],\n typescript: ['Tooling / build', 'https://www.typescriptlang.org/docs'],\n vite: ['Tooling / build', 'https://vitejs.dev/guide/'],\n webpack: ['Tooling / build', 'https://webpack.js.org'],\n esbuild: ['Tooling / build', 'https://esbuild.github.io'],\n babel: ['Tooling / build', 'https://babeljs.io/docs'],\n rollup: ['Tooling / build', 'https://rollupjs.org'],\n tailwindcss: ['UI / styling', 'https://tailwindcss.com/docs'],\n bootstrap: ['UI / styling', 'https://getbootstrap.com/docs'],\n sass: ['UI / styling', 'https://sass-lang.com/documentation'],\n 'styled-components': ['UI / styling', 'https://styled-components.com'],\n axios: ['Networking', 'https://axios-http.com'],\n requests: ['Networking', 'https://requests.readthedocs.io'],\n urllib3: ['Networking', 'https://urllib3.readthedocs.io'],\n httpx: ['Networking', 'https://www.python-httpx.org'],\n passport: ['Auth', 'https://www.passportjs.org'],\n 'next-auth': ['Auth', 'https://next-auth.js.org'],\n jsonwebtoken: ['Auth', 'https://github.com/auth0/node-jsonwebtoken'],\n pydantic: ['Data validation', 'https://docs.pydantic.dev'],\n numpy: ['Data / science', 'https://numpy.org/doc/'],\n pandas: ['Data / science', 'https://pandas.pydata.org/docs/'],\n 'scikit-learn': ['Data / science', 'https://scikit-learn.org/stable/'],\n torch: ['Data / science', 'https://pytorch.org/docs/'],\n tensorflow: ['Data / science', 'https://www.tensorflow.org/api_docs'],\n 'opencv-python': ['Data / science', 'https://docs.opencv.org'],\n keras: ['Data / science', 'https://keras.io'],\n 'python-dotenv': ['Tooling / config', 'https://github.com/theskumar/python-dotenv'],\n};\n\nconst ORDER = [\n 'Web framework', 'Frontend framework', 'Database / ORM', 'Auth',\n 'Networking', 'Data / science', 'Data validation', 'UI / styling',\n 'Testing', 'Tooling / build', 'Tooling / config', 'Library',\n];\n\n// Where a dependency that is not in KNOWN sends you: its registry page. Named\n// here rather than inlined below because two things need them — the URL\n// builders, and the host allowlist under them.\nconst REGISTRY = {\n npm: (name) => `https://www.npmjs.com/package/${name}`,\n pip: (name) => `https://pypi.org/project/${name}/`,\n go: (name) => `https://pkg.go.dev/${name}`,\n cargo: (name) => `https://docs.rs/${name}`,\n};\n\n// Every host `analyzeStack` can hand out a docs URL for. The server allowlists\n// exactly this set for `/api/doc`, and that is the SSRF guard: a host no\n// dependency name can produce is a host the server will not fetch.\n//\n// Derived, not restated. The server used to carry its own hand-written copy of\n// this list, and the two had drifted: `diesel.rs` was reachable from a Cargo\n// dependency but missing from the allowlist, so those docs always came back 403,\n// while `docusaurus.io`, `auth0.com` and a bare `readthedocs.io` were allowed\n// and nothing here could ever ask for them — the last one opening every project\n// on the site rather than the three we name.\n//\n// `www.` comes off because the caller strips it from the incoming host too;\n// leaving it on would mean `www.npmjs.com` never matched a request for\n// `npmjs.com`.\nexport const DOC_HOSTS = Object.freeze([...new Set(\n [\n ...Object.values(KNOWN).map(([, url]) => url),\n ...Object.values(REGISTRY).map((toUrl) => toUrl('any')),\n ].map((url) => new URL(url).hostname.replace(/^www\\./, ''))\n)].sort());\n\nfunction cleanVersion(v) {\n return String(v || '').replace(/^[\\^~>=< ]+/, '').split(' ')[0].trim();\n}\n\nexport function analyzeStack(manifest: Record<string, any> = {}, languages: Record<string, any> = {}) {\n const deps = manifest.deps || { npm: {}, dev: {}, pip: [], go: [], cargo: [] };\n const items = [];\n const seen = new Set();\n\n const add = (name, version, category, lang, docs, dev = false) => {\n if (!name || seen.has(name)) return;\n seen.add(name);\n items.push({ name, version: cleanVersion(version), category, lang, docs, dev });\n };\n\n const npmDocs = (name) => {\n const k = KNOWN[name];\n return k ? k[1] : REGISTRY.npm(name);\n };\n const catOf = (name) => {\n const k = KNOWN[name];\n return k ? k[0] : 'Library';\n };\n\n for (const [name, ver] of Object.entries(deps.npm || {})) {\n if (name !== 'react-dom') add(name, ver, catOf(name), 'JavaScript', npmDocs(name), false);\n }\n for (const [name, ver] of Object.entries(deps.dev || {})) {\n if (name !== 'react-dom') add(name, ver, catOf(name), 'JavaScript', npmDocs(name), true);\n }\n for (const name of deps.pip || []) {\n const k = KNOWN[name];\n add(name, '', k ? k[0] : 'Library', 'Python', k ? k[1] : REGISTRY.pip(name), false);\n }\n for (const name of deps.go || []) {\n const k = KNOWN[name.split('/').pop()];\n add(name, '', k ? k[0] : 'Library', 'Go', REGISTRY.go(name), false);\n }\n for (const name of deps.cargo || []) {\n const k = KNOWN[name] || KNOWN[name.replace(/_/g, '-')];\n add(name, '', k ? k[0] : 'Library', 'Rust', k ? k[1] : REGISTRY.cargo(name), false);\n }\n\n items.sort((a, b) => (ORDER.indexOf(a.category) - ORDER.indexOf(b.category)) || a.name.localeCompare(b.name));\n\n const pm = [];\n if (deps.npm && Object.keys(deps.npm).length) pm.push('npm');\n if (deps.pip && deps.pip.length) pm.push('pip');\n if (deps.go && deps.go.length) pm.push('go modules');\n if (deps.cargo && deps.cargo.length) pm.push('cargo');\n\n return { languages, pm, items: items.slice(0, 48) };\n}\n\n"]}
|
package/shared/analyzer/tour.js
CHANGED
|
@@ -7,63 +7,55 @@
|
|
|
7
7
|
// and a drifted tour would tell a person and an agent different things about the
|
|
8
8
|
// same repository. `describeStop` is presentation for the browser's own chrome
|
|
9
9
|
// and has no business here.
|
|
10
|
-
|
|
11
10
|
import { baseName } from './pathUtil.js';
|
|
12
|
-
|
|
13
11
|
export function buildTourStops(scan, facts) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const orphan = facts.orphans.find((p) => !used.has(p));
|
|
58
|
-
if (orphan && stops.length < 8) {
|
|
59
|
-
push(orphan, 'Nothing imports this. Dead code, or a door we did not recognize — you decide.');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return stops.slice(0, 8);
|
|
12
|
+
const stops = [];
|
|
13
|
+
const used = new Set();
|
|
14
|
+
const push = (path, why) => {
|
|
15
|
+
if (!path || used.has(path))
|
|
16
|
+
return;
|
|
17
|
+
if (!scan.files.some((f) => f.path === path))
|
|
18
|
+
return;
|
|
19
|
+
used.add(path);
|
|
20
|
+
stops.push({ path, why });
|
|
21
|
+
};
|
|
22
|
+
// 1. The front door: the entry point with the most reach.
|
|
23
|
+
const entriesByReach = facts.entries
|
|
24
|
+
.map((p) => ({ path: p, out: facts.fanOut[p] || 0 }))
|
|
25
|
+
.sort((a, b) => b.out - a.out);
|
|
26
|
+
if (entriesByReach.length) {
|
|
27
|
+
push(entriesByReach[0].path, 'Start here. This is a way in — code that runs first and calls everything else.');
|
|
28
|
+
}
|
|
29
|
+
// 2–4. The load-bearing files.
|
|
30
|
+
for (const hub of facts.hubs.slice(0, 3)) {
|
|
31
|
+
push(hub.path, `${hub.fanIn} files depend on this. Understand it before you change anything around it.`);
|
|
32
|
+
}
|
|
33
|
+
// 5. A second entry if there is one (servers often have a CLI beside them).
|
|
34
|
+
if (entriesByReach.length > 1) {
|
|
35
|
+
push(entriesByReach[1].path, 'Another door into the codebase — same building, different handle.');
|
|
36
|
+
}
|
|
37
|
+
// 6. A well-used leaf: end of a chain, usually where the real work happens.
|
|
38
|
+
const leaf = scan.files
|
|
39
|
+
.filter((f) => (facts.fanOut[f.path] || 0) === 0 && (facts.fanIn[f.path] || 0) >= 2)
|
|
40
|
+
.sort((a, b) => (facts.fanIn[b.path] || 0) - (facts.fanIn[a.path] || 0))[0];
|
|
41
|
+
if (leaf) {
|
|
42
|
+
push(leaf.path, 'The end of a chain. Nothing below it but the work itself.');
|
|
43
|
+
}
|
|
44
|
+
// 7. A cycle member, if the repo has them — worth the warning early.
|
|
45
|
+
if (facts.cycles.length) {
|
|
46
|
+
const member = facts.cycles[0][0];
|
|
47
|
+
push(member, `Careful with this one: it sits in a loop of ${facts.cycles[0].length} files importing each other.`);
|
|
48
|
+
}
|
|
49
|
+
// 8. An orphan, if any survive the earlier stops.
|
|
50
|
+
const orphan = facts.orphans.find((p) => !used.has(p));
|
|
51
|
+
if (orphan && stops.length < 8) {
|
|
52
|
+
push(orphan, 'Nothing imports this. Dead code, or a door we did not recognize — you decide.');
|
|
53
|
+
}
|
|
54
|
+
return stops.slice(0, 8);
|
|
63
55
|
}
|
|
64
|
-
|
|
65
56
|
// The name a stop shows in the browser's tour bar. Exported from here anyway so
|
|
66
57
|
// neither caller has to import `baseName` just to label a stop.
|
|
67
58
|
export function tourStopTitle(stop) {
|
|
68
|
-
|
|
59
|
+
return baseName(stop.path);
|
|
69
60
|
}
|
|
61
|
+
//# sourceMappingURL=tour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour.js","sourceRoot":"","sources":["../../src/shared/analyzer/tour.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,6EAA6E;AAC7E,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,+EAA+E;AAC/E,4BAA4B;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,cAAc,CAAC,IAAI,EAAE,KAAK;IACxC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;IAEvB,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACzB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QACpC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;YAAE,OAAO;QACrD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,0DAA0D;IAC1D,MAAM,cAAc,GAAG,KAAK,CAAC,OA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AAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED,qEAAqE;IACrE,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,EAAE,+CAA+C,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,8BAA8B,CAAC,CAAC;IACpH,CAAC;IAED,kDAAkD;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,IAAI,MAAM,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,EAAE,+EAA+E,CAAC,CAAC;IAChG,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,gFAAgF;AAChF,gEAAgE;AAChE,MAAM,UAAU,aAAa,CAAC,IAAI;IAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// The guided walk: pick the handful of files a new teammate should see\n// first, in the order they should see them, each with a one-line reason why.\n//\n// This lives in `shared/` because two very different callers want the same\n// ordering: the browser draws it as a tour, and the MCP server hands it to an\n// agent as \"read these eight files first\". A second implementation would drift,\n// and a drifted tour would tell a person and an agent different things about the\n// same repository. `describeStop` is presentation for the browser's own chrome\n// and has no business here.\n\nimport { baseName } from './pathUtil.js';\n\nexport function buildTourStops(scan, facts) {\n const stops = [];\n const used = new Set();\n\n const push = (path, why) => {\n if (!path || used.has(path)) return;\n if (!scan.files.some((f) => f.path === path)) return;\n used.add(path);\n stops.push({ path, why });\n };\n\n // 1. The front door: the entry point with the most reach.\n const entriesByReach = facts.entries\n .map((p) => ({ path: p, out: facts.fanOut[p] || 0 }))\n .sort((a, b) => b.out - a.out);\n if (entriesByReach.length) {\n push(entriesByReach[0].path, 'Start here. This is a way in — code that runs first and calls everything else.');\n }\n\n // 2–4. The load-bearing files.\n for (const hub of facts.hubs.slice(0, 3)) {\n push(hub.path, `${hub.fanIn} files depend on this. Understand it before you change anything around it.`);\n }\n\n // 5. A second entry if there is one (servers often have a CLI beside them).\n if (entriesByReach.length > 1) {\n push(entriesByReach[1].path, 'Another door into the codebase — same building, different handle.');\n }\n\n // 6. A well-used leaf: end of a chain, usually where the real work happens.\n const leaf = scan.files\n .filter((f) => (facts.fanOut[f.path] || 0) === 0 && (facts.fanIn[f.path] || 0) >= 2)\n .sort((a, b) => (facts.fanIn[b.path] || 0) - (facts.fanIn[a.path] || 0))[0];\n if (leaf) {\n push(leaf.path, 'The end of a chain. Nothing below it but the work itself.');\n }\n\n // 7. A cycle member, if the repo has them — worth the warning early.\n if (facts.cycles.length) {\n const member = facts.cycles[0][0];\n push(member, `Careful with this one: it sits in a loop of ${facts.cycles[0].length} files importing each other.`);\n }\n\n // 8. An orphan, if any survive the earlier stops.\n const orphan = facts.orphans.find((p) => !used.has(p));\n if (orphan && stops.length < 8) {\n push(orphan, 'Nothing imports this. Dead code, or a door we did not recognize — you decide.');\n }\n\n return stops.slice(0, 8);\n}\n\n// The name a stop shows in the browser's tour bar. Exported from here anyway so\n// neither caller has to import `baseName` just to label a stop.\nexport function tourStopTitle(stop) {\n return baseName(stop.path);\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function blankComments(source: any, { block, line, lineChar }?: Record<string, any>): any;
|
|
2
|
+
export declare function jsCodeMask(source: any): string;
|
|
3
|
+
export declare function lineOf(source: any, index: any): number;
|
|
4
|
+
export declare function lineCounter(source: any): (index: any) => number;
|
|
5
|
+
export declare function braceBodyEnd(source: any, openIndex: any): any;
|
|
6
|
+
export declare function uniqueBy(items: any, key: any): any[];
|
|
7
|
+
export declare function callsWithin(body: any, names: any): any[];
|
|
8
|
+
export declare function declarationOrder(fns: any): Map<any, any>;
|