codebase-onboarder 0.5.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 +196 -47
- 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 +449 -0
- package/cli/explorer/advanced.js.map +1 -0
- package/cli/explorer/app.d.ts +1 -0
- package/cli/explorer/app.js +396 -229
- 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 +400 -162
- 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 +73 -0
- package/cli/explorer/github.js.map +1 -0
- package/cli/explorer/graphs.d.ts +7 -0
- package/cli/explorer/graphs.js +173 -0
- 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 +184 -95
- package/cli/explorer/session.js.map +1 -0
- package/cli/explorer/views.d.ts +19 -0
- package/cli/explorer/views.js +496 -412
- package/cli/explorer/views.js.map +1 -0
- package/cli/explorer/wrap.d.ts +1 -0
- package/cli/explorer/wrap.js +33 -0
- package/cli/explorer/wrap.js.map +1 -0
- package/cli/main.d.ts +1 -0
- package/cli/main.js +235 -138
- 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 +55 -35
- 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 +165 -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 +60 -0
- 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 -37
- 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 +79 -0
- 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/cli/prompt.js
CHANGED
|
@@ -6,101 +6,105 @@
|
|
|
6
6
|
//
|
|
7
7
|
// Ctrl-C is a first-class answer ("cancelled"), not a stack trace: the wizard
|
|
8
8
|
// has written nothing yet at any point it can be pressed, and it says so.
|
|
9
|
-
|
|
10
9
|
import readline from 'node:readline/promises';
|
|
11
|
-
|
|
12
10
|
import { bold, cyan, dim, bad, section } from './ui.js';
|
|
13
11
|
import { defaultOf } from './wizard.js';
|
|
14
|
-
|
|
15
12
|
export class WizardCancelled extends Error {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
code;
|
|
14
|
+
constructor() {
|
|
15
|
+
super('cancelled');
|
|
16
|
+
this.code = 'CANCELLED';
|
|
17
|
+
}
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
// Run every pending step in order, collecting answers. `answers` is seeded
|
|
23
20
|
// with flag answers by the caller, which is how --flags skip questions.
|
|
24
21
|
export async function runSteps(steps, answers = {}, io = {}) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
const input = io.input || process.stdin;
|
|
23
|
+
const output = io.output || process.stdout;
|
|
24
|
+
const rl = readline.createInterface({ input, output });
|
|
25
|
+
// readline eats SIGINT when the terminal is in its raw-ish mode; route it to
|
|
26
|
+
// the same cancellation path as anything else that would kill us mid-ask.
|
|
27
|
+
const onSigint = () => rl.close();
|
|
28
|
+
process.once('SIGINT', onSigint);
|
|
29
|
+
try {
|
|
30
|
+
let lastSection = null;
|
|
31
|
+
for (const step of steps) {
|
|
32
|
+
// `when` is evaluated here, one question at a time — never upfront.
|
|
33
|
+
// Conditions read answers collected earlier in the same run ("ask about
|
|
34
|
+
// the bind only when mode is self-hosted"), so filtering the list
|
|
35
|
+
// before the first question would prune branches the answers reopen.
|
|
36
|
+
if (step.when && !step.when(answers))
|
|
37
|
+
continue;
|
|
38
|
+
if (step.section && step.section !== lastSection) {
|
|
39
|
+
output.write(section(step.section) + '\n');
|
|
40
|
+
lastSection = step.section;
|
|
41
|
+
}
|
|
42
|
+
answers[step.id] = await askOne(rl, output, step, answers);
|
|
43
|
+
}
|
|
44
|
+
return answers;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
throw new WizardCancelled();
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
process.removeListener('SIGINT', onSigint);
|
|
51
|
+
rl.close();
|
|
45
52
|
}
|
|
46
|
-
return answers;
|
|
47
|
-
} catch (err) {
|
|
48
|
-
throw new WizardCancelled();
|
|
49
|
-
} finally {
|
|
50
|
-
process.removeListener('SIGINT', onSigint);
|
|
51
|
-
rl.close();
|
|
52
|
-
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
54
|
async function askOne(rl, output, step, answers) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
// Re-ask until the validator is happy; each failure prints the reason so the
|
|
56
|
+
// next attempt is informed rather than punished.
|
|
57
|
+
for (;;) {
|
|
58
|
+
const value = step.type === 'choice'
|
|
59
|
+
? await askChoice(rl, output, step, answers)
|
|
60
|
+
: step.type === 'confirm'
|
|
61
|
+
? await askConfirm(rl, step, answers)
|
|
62
|
+
: await askText(rl, step, answers);
|
|
63
|
+
const complaint = step.validate ? step.validate(value) : null;
|
|
64
|
+
if (!complaint)
|
|
65
|
+
return value;
|
|
66
|
+
output.write(bad(' ' + complaint) + '\n');
|
|
67
|
+
}
|
|
68
68
|
}
|
|
69
|
-
|
|
70
69
|
async function askText(rl, step, answers) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
const fallback = defaultOf(step, answers);
|
|
71
|
+
if (step.hint)
|
|
72
|
+
rl.output.write(dim(' ' + step.hint) + '\n');
|
|
73
|
+
const suffix = fallback ? dim(` (${fallback})`) : '';
|
|
74
|
+
const typed = await rl.question(` ${bold(step.question)}${suffix}: `);
|
|
75
|
+
const value = typed.trim() || String(fallback ?? '');
|
|
76
|
+
return step.type === 'text' && /port/i.test(step.id) ? value : value;
|
|
77
77
|
}
|
|
78
|
-
|
|
79
78
|
async function askConfirm(rl, step, answers) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
const fallback = Boolean(defaultOf(step, answers));
|
|
80
|
+
const typed = await rl.question(` ${bold(step.question)} ${dim(fallback ? '(Y/n)' : '(y/N)')} `);
|
|
81
|
+
const v = typed.trim().toLowerCase();
|
|
82
|
+
if (!v)
|
|
83
|
+
return fallback;
|
|
84
|
+
return v === 'y' || v === 'yes';
|
|
85
85
|
}
|
|
86
|
-
|
|
87
86
|
async function askChoice(rl, output, step, answers) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
const fallback = defaultOf(step, answers);
|
|
88
|
+
const choices = step.choices.filter((c) => !c.when || c.when(answers));
|
|
89
|
+
output.write(` ${bold(step.question)}\n`);
|
|
90
|
+
choices.forEach((c, i) => {
|
|
91
|
+
const marker = c.value === fallback ? cyan('›') : ' ';
|
|
92
|
+
const hint = c.hint ? dim(' ' + c.hint) : '';
|
|
93
|
+
output.write(` ${marker} ${i + 1}. ${c.label}${hint}\n`);
|
|
94
|
+
});
|
|
95
|
+
if (step.hint)
|
|
96
|
+
output.write(dim(' ' + step.hint) + '\n');
|
|
97
|
+
const typed = await rl.question(dim(' Choose [1-' + choices.length + '] ') + '');
|
|
98
|
+
const v = typed.trim();
|
|
99
|
+
if (!v)
|
|
100
|
+
return fallback;
|
|
101
|
+
const byNumber = choices[Number(v) - 1];
|
|
102
|
+
if (byNumber)
|
|
103
|
+
return byNumber.value;
|
|
104
|
+
const byValue = choices.find((c) => c.value === v.toLowerCase());
|
|
105
|
+
if (byValue)
|
|
106
|
+
return byValue.value;
|
|
107
|
+
output.write(bad(' Pick a number from the list.') + '\n');
|
|
108
|
+
return askChoice(rl, output, step, answers);
|
|
106
109
|
}
|
|
110
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/cli/prompt.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,sEAAsE;AACtE,4EAA4E;AAC5E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAE1E,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,IAAI,CAAS;IAEb;QACE,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,2EAA2E;AAC3E,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,QAAQ,CAA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IAAI,OAAO;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,kCAAkC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7D,OAAO,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["// The wizard's face: one readline interface that renders the pure steps from\n// `wizard.js`. Everything display-shaped lives here — numbered choices, hints\n// in gray, validation loops that re-ask with the reason — and nothing\n// decision-shaped does. A step asks, validates, returns; the engine decides\n// what the answer means.\n//\n// Ctrl-C is a first-class answer (\"cancelled\"), not a stack trace: the wizard\n// has written nothing yet at any point it can be pressed, and it says so.\n\nimport readline from 'node:readline/promises';\n\nimport { bold, cyan, dim, bad, section } from './ui.js';\nimport { defaultOf } from './wizard.js';\n\nexport class WizardCancelled extends Error {\n code: string;\n\n constructor() {\n super('cancelled');\n this.code = 'CANCELLED';\n }\n}\n\n// Run every pending step in order, collecting answers. `answers` is seeded\n// with flag answers by the caller, which is how --flags skip questions.\nexport async function runSteps(steps, answers: Record<string, any> = {}, io: Record<string, any> = {}) {\n const input = io.input || process.stdin;\n const output = io.output || process.stdout;\n const rl = readline.createInterface({ input, output });\n // readline eats SIGINT when the terminal is in its raw-ish mode; route it to\n // the same cancellation path as anything else that would kill us mid-ask.\n const onSigint = () => rl.close();\n process.once('SIGINT', onSigint);\n try {\n let lastSection = null;\n for (const step of steps) {\n // `when` is evaluated here, one question at a time — never upfront.\n // Conditions read answers collected earlier in the same run (\"ask about\n // the bind only when mode is self-hosted\"), so filtering the list\n // before the first question would prune branches the answers reopen.\n if (step.when && !step.when(answers)) continue;\n if (step.section && step.section !== lastSection) {\n output.write(section(step.section) + '\\n');\n lastSection = step.section;\n }\n answers[step.id] = await askOne(rl, output, step, answers);\n }\n return answers;\n } catch (err) {\n throw new WizardCancelled();\n } finally {\n process.removeListener('SIGINT', onSigint);\n rl.close();\n }\n}\n\nasync function askOne(rl, output, step, answers) {\n // Re-ask until the validator is happy; each failure prints the reason so the\n // next attempt is informed rather than punished.\n for (;;) {\n const value = step.type === 'choice'\n ? await askChoice(rl, output, step, answers)\n : step.type === 'confirm'\n ? await askConfirm(rl, step, answers)\n : await askText(rl, step, answers);\n const complaint = step.validate ? step.validate(value) : null;\n if (!complaint) return value;\n output.write(bad(' ' + complaint) + '\\n');\n }\n}\n\nasync function askText(rl, step, answers) {\n const fallback = defaultOf(step, answers);\n if (step.hint) rl.output.write(dim(' ' + step.hint) + '\\n');\n const suffix = fallback ? dim(` (${fallback})`) : '';\n const typed = await rl.question(` ${bold(step.question)}${suffix}: `);\n const value = typed.trim() || String(fallback ?? '');\n return step.type === 'text' && /port/i.test(step.id) ? value : value;\n}\n\nasync function askConfirm(rl, step, answers) {\n const fallback = Boolean(defaultOf(step, answers));\n const typed = await rl.question(` ${bold(step.question)} ${dim(fallback ? '(Y/n)' : '(y/N)')} `);\n const v = typed.trim().toLowerCase();\n if (!v) return fallback;\n return v === 'y' || v === 'yes';\n}\n\nasync function askChoice(rl, output, step, answers) {\n const fallback = defaultOf(step, answers);\n const choices = step.choices.filter((c) => !c.when || c.when(answers));\n output.write(` ${bold(step.question)}\\n`);\n choices.forEach((c, i) => {\n const marker = c.value === fallback ? cyan('›') : ' ';\n const hint = c.hint ? dim(' ' + c.hint) : '';\n output.write(` ${marker} ${i + 1}. ${c.label}${hint}\\n`);\n });\n if (step.hint) output.write(dim(' ' + step.hint) + '\\n');\n const typed = await rl.question(dim(' Choose [1-' + choices.length + '] ') + '');\n const v = typed.trim();\n if (!v) return fallback;\n const byNumber = choices[Number(v) - 1];\n if (byNumber) return byNumber.value;\n const byValue = choices.find((c) => c.value === v.toLowerCase());\n if (byValue) return byValue.value;\n output.write(bad(' Pick a number from the list.') + '\\n');\n return askChoice(rl, output, step, answers);\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { normalizeScanOptions } from '../shared/analyzer/scanControl.js';
|
|
2
|
+
export function scanOptionsFromFlags(flags) {
|
|
3
|
+
const options = {};
|
|
4
|
+
for (const key of ['maxFiles', 'maxFileSize', 'readConcurrency']) {
|
|
5
|
+
if (flags[key] !== undefined)
|
|
6
|
+
options[key] = Number(flags[key]);
|
|
7
|
+
}
|
|
8
|
+
normalizeScanOptions(options);
|
|
9
|
+
return options;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=scanOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanOptions.js","sourceRoot":"","sources":["../src/cli/scanOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,UAAU,oBAAoB,CAAC,KAA8B;IACjE,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,EAAE,iBAAiB,CAAU,EAAE,CAAC;QAC1E,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { ScanRequestOptions } from '../shared/contracts.js';\nimport { normalizeScanOptions } from '../shared/analyzer/scanControl.js';\n\nexport function scanOptionsFromFlags(flags: Record<string, unknown>): ScanRequestOptions {\n const options: ScanRequestOptions = {};\n for (const key of ['maxFiles', 'maxFileSize', 'readConcurrency'] as const) {\n if (flags[key] !== undefined) options[key] = Number(flags[key]);\n }\n normalizeScanOptions(options);\n return options;\n}\n"]}
|
package/cli/ui.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PanelRow, PanelOptions } from '../server/layout.js';
|
|
2
|
+
export declare function setColorEnabled(on?: boolean): void;
|
|
3
|
+
export declare function colorEnabled(): boolean;
|
|
4
|
+
export declare function supportsColor(): boolean;
|
|
5
|
+
declare const CODES: {
|
|
6
|
+
reset: number;
|
|
7
|
+
bold: number;
|
|
8
|
+
dim: number;
|
|
9
|
+
italic: number;
|
|
10
|
+
red: number;
|
|
11
|
+
green: number;
|
|
12
|
+
yellow: number;
|
|
13
|
+
blue: number;
|
|
14
|
+
magenta: number;
|
|
15
|
+
cyan: number;
|
|
16
|
+
gray: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function paint(text: unknown, ...styles: Array<keyof typeof CODES>): string;
|
|
19
|
+
export declare const ok: (s: unknown) => string;
|
|
20
|
+
export declare const warn: (s: unknown) => string;
|
|
21
|
+
export declare const bad: (s: unknown) => string;
|
|
22
|
+
export declare const dim: (s: unknown) => string;
|
|
23
|
+
export declare const bold: (s: unknown) => string;
|
|
24
|
+
export declare const cyan: (s: unknown) => string;
|
|
25
|
+
export declare function welcomeBanner(version: string, configFile: string): string;
|
|
26
|
+
export declare function section(title: string): string;
|
|
27
|
+
export declare function kv(label: string, value: unknown): string;
|
|
28
|
+
export declare const tick: string;
|
|
29
|
+
export declare const cross: string;
|
|
30
|
+
export declare const dash: string;
|
|
31
|
+
import { width, fit, termWidth, hint, row } from '../server/layout.js';
|
|
32
|
+
export { width, fit, termWidth, hint, row };
|
|
33
|
+
export declare function panel(title: string, rows: PanelRow[], options?: PanelOptions): string;
|
package/cli/ui.js
CHANGED
|
@@ -3,71 +3,91 @@
|
|
|
3
3
|
// Everything goes through `paint` so --no-color, NO_COLOR, and a piped stdout
|
|
4
4
|
// all strip styling in one place. Nothing here is load-bearing — every message
|
|
5
5
|
// has to read fine as plain text, because that is how logs and CI see it.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
// Color resolution, in strict precedence order:
|
|
7
|
+
//
|
|
8
|
+
// 1. An explicit `--no-color` / `NO_COLOR` → off. A person who asked for plain
|
|
9
|
+
// text gets plain text, whatever the environment says.
|
|
10
|
+
// 2. An explicit `--color` / `FORCE_COLOR` → on. This is the documented way
|
|
11
|
+
// to keep ANSI in a captured log or a pipe, so it has to beat the TTY sniff.
|
|
12
|
+
// 3. Otherwise, a TTY → on.
|
|
13
|
+
// 4. Otherwise → off.
|
|
14
|
+
//
|
|
15
|
+
// Every step reads live rather than caching at import, because `main` parses
|
|
16
|
+
// flags *after* the module graph has loaded. The old `const supportsColor = ...`
|
|
17
|
+
// decided once, at import, which is before `--no-color` was knowable — so the
|
|
18
|
+
// documented flags were silently ignored everywhere.
|
|
19
|
+
let forced = null; // null = undecided, true = force on, false = force off
|
|
20
|
+
export function setColorEnabled(on) {
|
|
21
|
+
forced = on === undefined ? null : Boolean(on);
|
|
22
|
+
}
|
|
23
|
+
export function colorEnabled() {
|
|
24
|
+
if (forced === false)
|
|
25
|
+
return false;
|
|
26
|
+
if (forced === true)
|
|
27
|
+
return true;
|
|
28
|
+
if (process.env.NO_COLOR !== undefined && process.env.NO_COLOR !== '')
|
|
29
|
+
return false;
|
|
30
|
+
if (process.env.FORCE_COLOR)
|
|
31
|
+
return true;
|
|
32
|
+
return Boolean(process.stdout.isTTY);
|
|
33
|
+
}
|
|
34
|
+
export function supportsColor() {
|
|
35
|
+
return colorEnabled();
|
|
36
|
+
}
|
|
9
37
|
const CODES = {
|
|
10
|
-
|
|
11
|
-
|
|
38
|
+
reset: 0, bold: 1, dim: 2, italic: 3,
|
|
39
|
+
red: 31, green: 32, yellow: 33, blue: 34, magenta: 35, cyan: 36, gray: 90,
|
|
12
40
|
};
|
|
13
|
-
|
|
14
41
|
export function paint(text, ...styles) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
if (!colorEnabled() || !styles.length)
|
|
43
|
+
return String(text);
|
|
44
|
+
const open = styles.map((s) => `\x1b[${CODES[s]}m`).join('');
|
|
45
|
+
return `${open}${text}\x1b[0m`;
|
|
18
46
|
}
|
|
19
|
-
|
|
20
47
|
export const ok = (s) => paint(s, 'green');
|
|
21
48
|
export const warn = (s) => paint(s, 'yellow');
|
|
22
49
|
export const bad = (s) => paint(s, 'red');
|
|
23
50
|
export const dim = (s) => paint(s, 'gray');
|
|
24
51
|
export const bold = (s) => paint(s, 'bold');
|
|
25
52
|
export const cyan = (s) => paint(s, 'cyan');
|
|
26
|
-
|
|
27
53
|
// The wizard's welcome — one screen, says what the tool is and what the wizard
|
|
28
54
|
// is about to touch (one file), and how to leave. Modeled on the honesty of a
|
|
29
55
|
// good installer: no art, no spinner, no mystery.
|
|
30
56
|
export function welcomeBanner(version, configFile) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
return [
|
|
58
|
+
'',
|
|
59
|
+
bold(' 🧭 Onboarder setup') + dim(` v${version}`),
|
|
60
|
+
dim(' Drop a path. Get a map.'),
|
|
61
|
+
'',
|
|
62
|
+
' This wizard asks a handful of questions and writes one file:',
|
|
63
|
+
' ' + cyan(configFile),
|
|
64
|
+
dim(' Nothing is sent anywhere. Ctrl-C at any question cancels without writing.'),
|
|
65
|
+
'',
|
|
66
|
+
].join('\n');
|
|
41
67
|
}
|
|
42
|
-
|
|
43
68
|
export function section(title) {
|
|
44
|
-
|
|
69
|
+
return '\n' + bold(` ── ${title} ` + '─'.repeat(Math.max(2, 46 - title.length)));
|
|
45
70
|
}
|
|
46
|
-
|
|
47
71
|
// Label/value rows, aligned — the banner, `config show`, and the doctor all
|
|
48
72
|
// print in this shape so output greps the same everywhere.
|
|
49
73
|
export function kv(label, value) {
|
|
50
|
-
|
|
74
|
+
return ' ' + paint((label + ' ').padEnd(12), 'gray') + value;
|
|
51
75
|
}
|
|
52
|
-
|
|
53
76
|
export const tick = ok(' ✓ ');
|
|
54
77
|
export const cross = bad(' ✗ ');
|
|
55
78
|
export const dash = dim(' – ');
|
|
56
|
-
|
|
57
79
|
// The layout math (width, fit, panel) lives in `server/layout.js` so the server's
|
|
58
80
|
// own startup banner can use the identical geometry without importing this file
|
|
59
81
|
// and inverting the dependency. This module is only the *color* on top of it.
|
|
60
82
|
import { width, fit, termWidth, panel as layoutPanel, hint, row } from '../server/layout.js';
|
|
61
|
-
|
|
62
83
|
export { width, fit, termWidth, hint, row };
|
|
63
|
-
|
|
64
84
|
// A titled block of rows that fits the terminal it is printed into. Same shape
|
|
65
85
|
// the server banner uses; the difference is only that this one paints.
|
|
66
86
|
export function panel(title, rows, options = {}) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
87
|
+
const styles = { label: 'gray', frame: 'gray', hint: 'gray', title: 'bold' };
|
|
88
|
+
return layoutPanel(title, rows, {
|
|
89
|
+
...options,
|
|
90
|
+
paint: (text, style) => paint(text, styles[style] || 'gray'),
|
|
91
|
+
});
|
|
72
92
|
}
|
|
73
|
-
|
|
93
|
+
//# sourceMappingURL=ui.js.map
|
package/cli/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/cli/ui.ts"],"names":[],"mappings":"AACA,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,0EAA0E;AAE1E,gDAAgD;AAChD,EAAE;AACF,kFAAkF;AAClF,4DAA4D;AAC5D,gFAAgF;AAChF,kFAAkF;AAClF,sDAAsD;AACtD,sDAAsD;AACtD,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,8EAA8E;AAC9E,qDAAqD;AACrD,IAAI,MAAM,GAAmB,IAAI,CAAC,CAAC,uDAAuD;AAE1F,MAAM,UAAU,eAAe,CAAC,EAAY;IAC1C,MAAM,GAAG,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,IAAI,MAAM,KAAK,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G,KAAK,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;AAChE,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AAEhC,kFAAkF;AAClF,gFAAgF;AAChF,8EAA8E;AAC9E,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,IAAI,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAE5C,+EAA+E;AAC/E,uEAAuE;AACvE,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,IAAgB,EAAE,OAAO,GAAiB,EAAE;IAC/E,MAAM,MAAM,GAA2C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IACrH,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE;QAC9B,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC;KAC7D,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { PanelRow, PanelOptions, PanelStyle } from '../server/layout.js';\n// Terminal paint: the few ANSI touches the CLI uses, all behind one flag.\n//\n// Everything goes through `paint` so --no-color, NO_COLOR, and a piped stdout\n// all strip styling in one place. Nothing here is load-bearing — every message\n// has to read fine as plain text, because that is how logs and CI see it.\n\n// Color resolution, in strict precedence order:\n//\n// 1. An explicit `--no-color` / `NO_COLOR` → off. A person who asked for plain\n// text gets plain text, whatever the environment says.\n// 2. An explicit `--color` / `FORCE_COLOR` → on. This is the documented way\n// to keep ANSI in a captured log or a pipe, so it has to beat the TTY sniff.\n// 3. Otherwise, a TTY → on.\n// 4. Otherwise → off.\n//\n// Every step reads live rather than caching at import, because `main` parses\n// flags *after* the module graph has loaded. The old `const supportsColor = ...`\n// decided once, at import, which is before `--no-color` was knowable — so the\n// documented flags were silently ignored everywhere.\nlet forced: boolean | null = null; // null = undecided, true = force on, false = force off\n\nexport function setColorEnabled(on?: boolean) {\n forced = on === undefined ? null : Boolean(on);\n}\n\nexport function colorEnabled() {\n if (forced === false) return false;\n if (forced === true) return true;\n if (process.env.NO_COLOR !== undefined && process.env.NO_COLOR !== '') return false;\n if (process.env.FORCE_COLOR) return true;\n return Boolean(process.stdout.isTTY);\n}\n\nexport function supportsColor() {\n return colorEnabled();\n}\n\nconst CODES = {\n reset: 0, bold: 1, dim: 2, italic: 3,\n red: 31, green: 32, yellow: 33, blue: 34, magenta: 35, cyan: 36, gray: 90,\n};\n\nexport function paint(text: unknown, ...styles: Array<keyof typeof CODES>) {\n if (!colorEnabled() || !styles.length) return String(text);\n const open = styles.map((s) => `\\x1b[${CODES[s]}m`).join('');\n return `${open}${text}\\x1b[0m`;\n}\n\nexport const ok = (s: unknown) => paint(s, 'green');\nexport const warn = (s: unknown) => paint(s, 'yellow');\nexport const bad = (s: unknown) => paint(s, 'red');\nexport const dim = (s: unknown) => paint(s, 'gray');\nexport const bold = (s: unknown) => paint(s, 'bold');\nexport const cyan = (s: unknown) => paint(s, 'cyan');\n\n// The wizard's welcome — one screen, says what the tool is and what the wizard\n// is about to touch (one file), and how to leave. Modeled on the honesty of a\n// good installer: no art, no spinner, no mystery.\nexport function welcomeBanner(version: string, configFile: string) {\n return [\n '',\n bold(' 🧭 Onboarder setup') + dim(` v${version}`),\n dim(' Drop a path. Get a map.'),\n '',\n ' This wizard asks a handful of questions and writes one file:',\n ' ' + cyan(configFile),\n dim(' Nothing is sent anywhere. Ctrl-C at any question cancels without writing.'),\n '',\n ].join('\\n');\n}\n\nexport function section(title: string) {\n return '\\n' + bold(` ── ${title} ` + '─'.repeat(Math.max(2, 46 - title.length)));\n}\n\n// Label/value rows, aligned — the banner, `config show`, and the doctor all\n// print in this shape so output greps the same everywhere.\nexport function kv(label: string, value: unknown) {\n return ' ' + paint((label + ' ').padEnd(12), 'gray') + value;\n}\n\nexport const tick = ok(' ✓ ');\nexport const cross = bad(' ✗ ');\nexport const dash = dim(' – ');\n\n// The layout math (width, fit, panel) lives in `server/layout.js` so the server's\n// own startup banner can use the identical geometry without importing this file\n// and inverting the dependency. This module is only the *color* on top of it.\nimport { width, fit, termWidth, panel as layoutPanel, hint, row } from '../server/layout.js';\n\nexport { width, fit, termWidth, hint, row };\n\n// A titled block of rows that fits the terminal it is printed into. Same shape\n// the server banner uses; the difference is only that this one paints.\nexport function panel(title: string, rows: PanelRow[], options: PanelOptions = {}) {\n const styles: Record<PanelStyle, keyof typeof CODES> = { label: 'gray', frame: 'gray', hint: 'gray', title: 'bold' };\n return layoutPanel(title, rows, {\n ...options,\n paint: (text, style) => paint(text, styles[style] || 'gray'),\n });\n}\n\n"]}
|
package/cli/wizard.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { Settings } from '../shared/contracts.js';
|
|
2
|
+
export declare const PROVIDER_PRESETS: {
|
|
3
|
+
none: {
|
|
4
|
+
label: string;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
};
|
|
7
|
+
'openai-compatible': {
|
|
8
|
+
label: string;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
};
|
|
11
|
+
ollama: {
|
|
12
|
+
label: string;
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
};
|
|
15
|
+
openrouter: {
|
|
16
|
+
label: string;
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
};
|
|
19
|
+
custom: {
|
|
20
|
+
label: string;
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const TUNNEL_CHOICES: {
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
hint: string;
|
|
28
|
+
}[];
|
|
29
|
+
export declare function validPort(value: any): string;
|
|
30
|
+
export declare function validDomain(value: any): string;
|
|
31
|
+
export declare function validEmail(value: any): string;
|
|
32
|
+
export declare function buildSteps(current?: Settings): ({
|
|
33
|
+
id: string;
|
|
34
|
+
section: string;
|
|
35
|
+
type: string;
|
|
36
|
+
question: string;
|
|
37
|
+
hint: string;
|
|
38
|
+
default: string;
|
|
39
|
+
validate?: undefined;
|
|
40
|
+
choices?: undefined;
|
|
41
|
+
when?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
id: string;
|
|
44
|
+
section: string;
|
|
45
|
+
type: string;
|
|
46
|
+
question: string;
|
|
47
|
+
hint: string;
|
|
48
|
+
default: string;
|
|
49
|
+
validate: typeof validEmail;
|
|
50
|
+
choices?: undefined;
|
|
51
|
+
when?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
id: string;
|
|
54
|
+
section: string;
|
|
55
|
+
type: string;
|
|
56
|
+
question: string;
|
|
57
|
+
choices: {
|
|
58
|
+
value: string;
|
|
59
|
+
label: string;
|
|
60
|
+
hint: string;
|
|
61
|
+
}[];
|
|
62
|
+
default: (answers: any) => any;
|
|
63
|
+
when: (a: any) => boolean;
|
|
64
|
+
validate?: undefined;
|
|
65
|
+
hint?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
id: string;
|
|
68
|
+
section: string;
|
|
69
|
+
type: string;
|
|
70
|
+
question: string;
|
|
71
|
+
default: string;
|
|
72
|
+
validate: typeof validPort;
|
|
73
|
+
hint?: undefined;
|
|
74
|
+
choices?: undefined;
|
|
75
|
+
when?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
id: string;
|
|
78
|
+
section: string;
|
|
79
|
+
type: string;
|
|
80
|
+
question: string;
|
|
81
|
+
hint: string;
|
|
82
|
+
default: string;
|
|
83
|
+
validate: typeof validDomain;
|
|
84
|
+
when: (a: any) => boolean;
|
|
85
|
+
choices?: undefined;
|
|
86
|
+
} | {
|
|
87
|
+
id: string;
|
|
88
|
+
section: string;
|
|
89
|
+
type: string;
|
|
90
|
+
question: string;
|
|
91
|
+
hint: string;
|
|
92
|
+
default: boolean;
|
|
93
|
+
when: (a: any) => boolean;
|
|
94
|
+
validate?: undefined;
|
|
95
|
+
choices?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
id: string;
|
|
98
|
+
section: string;
|
|
99
|
+
type: string;
|
|
100
|
+
question: string;
|
|
101
|
+
choices: {
|
|
102
|
+
value: string;
|
|
103
|
+
label: string;
|
|
104
|
+
hint: string;
|
|
105
|
+
}[];
|
|
106
|
+
default: string;
|
|
107
|
+
when: (a: any) => boolean;
|
|
108
|
+
validate?: undefined;
|
|
109
|
+
hint?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
id: string;
|
|
112
|
+
section: string;
|
|
113
|
+
type: string;
|
|
114
|
+
question: string;
|
|
115
|
+
hint: string;
|
|
116
|
+
validate: (v: any) => string;
|
|
117
|
+
when: (a: any) => boolean;
|
|
118
|
+
choices?: undefined;
|
|
119
|
+
default?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
id: string;
|
|
122
|
+
section: string;
|
|
123
|
+
type: string;
|
|
124
|
+
question: string;
|
|
125
|
+
choices: {
|
|
126
|
+
value: string;
|
|
127
|
+
label: string;
|
|
128
|
+
hint: string;
|
|
129
|
+
}[];
|
|
130
|
+
default: string;
|
|
131
|
+
validate?: undefined;
|
|
132
|
+
hint?: undefined;
|
|
133
|
+
when?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
id: string;
|
|
136
|
+
section: string;
|
|
137
|
+
type: string;
|
|
138
|
+
question: string;
|
|
139
|
+
default: (a: any) => any;
|
|
140
|
+
validate: (v: any) => string;
|
|
141
|
+
when: (a: any) => boolean;
|
|
142
|
+
hint?: undefined;
|
|
143
|
+
choices?: undefined;
|
|
144
|
+
} | {
|
|
145
|
+
validate?: undefined;
|
|
146
|
+
id: string;
|
|
147
|
+
section: string;
|
|
148
|
+
type: string;
|
|
149
|
+
question: string;
|
|
150
|
+
hint: string;
|
|
151
|
+
default: string;
|
|
152
|
+
when: (a: any) => boolean;
|
|
153
|
+
choices?: undefined;
|
|
154
|
+
} | {
|
|
155
|
+
validate?: undefined;
|
|
156
|
+
id: string;
|
|
157
|
+
section: string;
|
|
158
|
+
type: string;
|
|
159
|
+
question: string;
|
|
160
|
+
hint: string;
|
|
161
|
+
choices: {
|
|
162
|
+
value: string;
|
|
163
|
+
label: string;
|
|
164
|
+
hint: string;
|
|
165
|
+
}[];
|
|
166
|
+
default: string;
|
|
167
|
+
when: (a: any) => boolean;
|
|
168
|
+
} | {
|
|
169
|
+
validate?: undefined;
|
|
170
|
+
hint?: undefined;
|
|
171
|
+
choices?: undefined;
|
|
172
|
+
when?: undefined;
|
|
173
|
+
id: string;
|
|
174
|
+
section: string;
|
|
175
|
+
type: string;
|
|
176
|
+
question: string;
|
|
177
|
+
default: boolean;
|
|
178
|
+
})[];
|
|
179
|
+
export declare function pendingSteps(steps: any, answers?: Record<string, any>): any;
|
|
180
|
+
export declare function unansweredSteps(steps: any, answers?: Record<string, any>): any;
|
|
181
|
+
export declare function defaultOf(step: any, answers: any): any;
|
|
182
|
+
export declare function answersToSettings(current: any, answers: any): Settings;
|
|
183
|
+
export declare function applyFlags(current: any, flags?: Record<string, any>): {
|
|
184
|
+
patch: Record<string, any>;
|
|
185
|
+
settings: Settings;
|
|
186
|
+
};
|
|
187
|
+
export declare function summaryLines(settings: any, { revealKey }?: Record<string, any>): any[][];
|