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.
Files changed (448) hide show
  1. package/README.md +196 -47
  2. package/bin/build-if-source.js +23 -0
  3. package/cli/commands.d.ts +26 -0
  4. package/cli/commands.js +836 -811
  5. package/cli/commands.js.map +1 -0
  6. package/cli/explorer/advanced.d.ts +14 -0
  7. package/cli/explorer/advanced.js +449 -0
  8. package/cli/explorer/advanced.js.map +1 -0
  9. package/cli/explorer/app.d.ts +1 -0
  10. package/cli/explorer/app.js +396 -229
  11. package/cli/explorer/app.js.map +1 -0
  12. package/cli/explorer/assistant.d.ts +9 -0
  13. package/cli/explorer/assistant.js +58 -0
  14. package/cli/explorer/assistant.js.map +1 -0
  15. package/cli/explorer/commands.d.ts +17 -0
  16. package/cli/explorer/commands.js +400 -162
  17. package/cli/explorer/commands.js.map +1 -0
  18. package/cli/explorer/featureViews.d.ts +124 -0
  19. package/cli/explorer/featureViews.js +179 -0
  20. package/cli/explorer/featureViews.js.map +1 -0
  21. package/cli/explorer/github.d.ts +21 -0
  22. package/cli/explorer/github.js +73 -0
  23. package/cli/explorer/github.js.map +1 -0
  24. package/cli/explorer/graphs.d.ts +7 -0
  25. package/cli/explorer/graphs.js +173 -0
  26. package/cli/explorer/graphs.js.map +1 -0
  27. package/cli/explorer/picker.d.ts +22 -0
  28. package/cli/explorer/picker.js +150 -0
  29. package/cli/explorer/picker.js.map +1 -0
  30. package/cli/explorer/report.d.ts +85 -0
  31. package/cli/explorer/report.js +60 -0
  32. package/cli/explorer/report.js.map +1 -0
  33. package/cli/explorer/session.d.ts +449 -0
  34. package/cli/explorer/session.js +184 -95
  35. package/cli/explorer/session.js.map +1 -0
  36. package/cli/explorer/views.d.ts +19 -0
  37. package/cli/explorer/views.js +496 -412
  38. package/cli/explorer/views.js.map +1 -0
  39. package/cli/explorer/wrap.d.ts +1 -0
  40. package/cli/explorer/wrap.js +33 -0
  41. package/cli/explorer/wrap.js.map +1 -0
  42. package/cli/main.d.ts +1 -0
  43. package/cli/main.js +235 -138
  44. package/cli/main.js.map +1 -0
  45. package/cli/prompt.d.ts +5 -0
  46. package/cli/prompt.js +84 -80
  47. package/cli/prompt.js.map +1 -0
  48. package/cli/scanOptions.d.ts +2 -0
  49. package/cli/scanOptions.js +11 -0
  50. package/cli/scanOptions.js.map +1 -0
  51. package/cli/ui.d.ts +33 -0
  52. package/cli/ui.js +55 -35
  53. package/cli/ui.js.map +1 -0
  54. package/cli/wizard.d.ts +187 -0
  55. package/cli/wizard.js +304 -284
  56. package/cli/wizard.js.map +1 -0
  57. package/package.json +15 -4
  58. package/public/app.d.ts +1 -0
  59. package/public/app.js +1057 -1009
  60. package/public/app.js.map +1 -0
  61. package/public/browser.d.ts +68 -0
  62. package/public/browser.js +2 -0
  63. package/public/browser.js.map +1 -0
  64. package/public/index.html +30 -13
  65. package/public/js/about.d.ts +6 -0
  66. package/public/js/about.js +165 -172
  67. package/public/js/about.js.map +1 -0
  68. package/public/js/aiDraft.d.ts +3 -0
  69. package/public/js/aiDraft.js +116 -124
  70. package/public/js/aiDraft.js.map +1 -0
  71. package/public/js/analysisPanel.d.ts +7 -0
  72. package/public/js/analysisPanel.js +166 -166
  73. package/public/js/analysisPanel.js.map +1 -0
  74. package/public/js/analysisReport.d.ts +38 -0
  75. package/public/js/analysisReport.js +105 -110
  76. package/public/js/analysisReport.js.map +1 -0
  77. package/public/js/api.d.ts +26 -0
  78. package/public/js/api.js +176 -167
  79. package/public/js/api.js.map +1 -0
  80. package/public/js/atlas.d.ts +6 -0
  81. package/public/js/atlas.js +50 -58
  82. package/public/js/atlas.js.map +1 -0
  83. package/public/js/blameView.d.ts +2 -0
  84. package/public/js/blameView.js +36 -37
  85. package/public/js/blameView.js.map +1 -0
  86. package/public/js/codeTab.d.ts +3 -0
  87. package/public/js/codeTab.js +175 -180
  88. package/public/js/codeTab.js.map +1 -0
  89. package/public/js/codeViewer.d.ts +5 -0
  90. package/public/js/codeViewer.js +162 -150
  91. package/public/js/codeViewer.js.map +1 -0
  92. package/public/js/components/FileChip.d.ts +9 -0
  93. package/public/js/components/FileChip.js +45 -49
  94. package/public/js/components/FileChip.js.map +1 -0
  95. package/public/js/components/MetricSparkline.d.ts +7 -0
  96. package/public/js/components/MetricSparkline.js +35 -44
  97. package/public/js/components/MetricSparkline.js.map +1 -0
  98. package/public/js/components/RiskBadge.d.ts +9 -0
  99. package/public/js/components/RiskBadge.js +55 -63
  100. package/public/js/components/RiskBadge.js.map +1 -0
  101. package/public/js/deepAnalysisView.d.ts +99 -0
  102. package/public/js/deepAnalysisView.js +282 -302
  103. package/public/js/deepAnalysisView.js.map +1 -0
  104. package/public/js/diagramPane.d.ts +8 -0
  105. package/public/js/diagramPane.js +133 -135
  106. package/public/js/diagramPane.js.map +1 -0
  107. package/public/js/diffView.d.ts +6 -0
  108. package/public/js/diffView.js +222 -209
  109. package/public/js/diffView.js.map +1 -0
  110. package/public/js/docsView.d.ts +2 -0
  111. package/public/js/docsView.js +441 -442
  112. package/public/js/docsView.js.map +1 -0
  113. package/public/js/dom.d.ts +189 -0
  114. package/public/js/dom.js +5 -0
  115. package/public/js/dom.js.map +1 -0
  116. package/public/js/fileSourceBrowser.d.ts +5 -0
  117. package/public/js/fileSourceBrowser.js +33 -41
  118. package/public/js/fileSourceBrowser.js.map +1 -0
  119. package/public/js/flameGraph.d.ts +5 -0
  120. package/public/js/flameGraph.js +62 -72
  121. package/public/js/flameGraph.js.map +1 -0
  122. package/public/js/forceGraph.d.ts +10 -0
  123. package/public/js/forceGraph.js +581 -556
  124. package/public/js/forceGraph.js.map +1 -0
  125. package/public/js/heatmap.d.ts +4 -0
  126. package/public/js/heatmap.js +142 -164
  127. package/public/js/heatmap.js.map +1 -0
  128. package/public/js/highlight.d.ts +2 -0
  129. package/public/js/highlight.js +116 -107
  130. package/public/js/highlight.js.map +1 -0
  131. package/public/js/html.d.ts +2 -0
  132. package/public/js/html.js +14 -44
  133. package/public/js/html.js.map +1 -0
  134. package/public/js/insightsView.d.ts +5 -0
  135. package/public/js/insightsView.js +93 -111
  136. package/public/js/insightsView.js.map +1 -0
  137. package/public/js/inspector.d.ts +37 -0
  138. package/public/js/inspector.js +416 -445
  139. package/public/js/inspector.js.map +1 -0
  140. package/public/js/llm.d.ts +113 -0
  141. package/public/js/llm.js +233 -272
  142. package/public/js/llm.js.map +1 -0
  143. package/public/js/mapView.d.ts +3 -0
  144. package/public/js/mapView.js +121 -120
  145. package/public/js/mapView.js.map +1 -0
  146. package/public/js/markdown.d.ts +3 -0
  147. package/public/js/markdown.js +84 -91
  148. package/public/js/markdown.js.map +1 -0
  149. package/public/js/mindmap.d.ts +32 -0
  150. package/public/js/mindmap.js +244 -259
  151. package/public/js/mindmap.js.map +1 -0
  152. package/public/js/mobilePanels.d.ts +5 -0
  153. package/public/js/mobilePanels.js +50 -0
  154. package/public/js/mobilePanels.js.map +1 -0
  155. package/public/js/repoFiles.d.ts +12 -0
  156. package/public/js/repoFiles.js +28 -27
  157. package/public/js/repoFiles.js.map +1 -0
  158. package/public/js/reviewView.d.ts +28 -0
  159. package/public/js/reviewView.js +256 -0
  160. package/public/js/reviewView.js.map +1 -0
  161. package/public/js/sbomView.d.ts +3 -0
  162. package/public/js/sbomView.js +59 -67
  163. package/public/js/sbomView.js.map +1 -0
  164. package/public/js/scanCache.d.ts +16 -0
  165. package/public/js/scanCache.js +67 -65
  166. package/public/js/scanCache.js.map +1 -0
  167. package/public/js/search.d.ts +7 -0
  168. package/public/js/search.js +868 -800
  169. package/public/js/search.js.map +1 -0
  170. package/public/js/searchLocal.d.ts +42 -0
  171. package/public/js/searchLocal.js +87 -0
  172. package/public/js/searchLocal.js.map +1 -0
  173. package/public/js/serverSettings.d.ts +5 -0
  174. package/public/js/serverSettings.js +153 -164
  175. package/public/js/serverSettings.js.map +1 -0
  176. package/public/js/state.d.ts +798 -0
  177. package/public/js/state.js +114 -122
  178. package/public/js/state.js.map +1 -0
  179. package/public/js/tour.d.ts +6 -0
  180. package/public/js/tour.js +5 -7
  181. package/public/js/tour.js.map +1 -0
  182. package/public/js/transitions.d.ts +2 -0
  183. package/public/js/transitions.js +9 -10
  184. package/public/js/transitions.js.map +1 -0
  185. package/public/js/tree.d.ts +12 -0
  186. package/public/js/tree.js +157 -154
  187. package/public/js/tree.js.map +1 -0
  188. package/public/js/workflowsView.d.ts +3 -0
  189. package/public/js/workflowsView.js +15 -22
  190. package/public/js/workflowsView.js.map +1 -0
  191. package/public/search.css +495 -0
  192. package/public/styles.css +163 -346
  193. package/public/workbench.css +166 -0
  194. package/server/apiAuth.d.ts +3 -0
  195. package/server/apiAuth.js +18 -20
  196. package/server/apiAuth.js.map +1 -0
  197. package/server/apiDiff.d.ts +2 -0
  198. package/server/apiDiff.js +20 -18
  199. package/server/apiDiff.js.map +1 -0
  200. package/server/apiDocs.d.ts +2 -0
  201. package/server/apiDocs.js +38 -40
  202. package/server/apiDocs.js.map +1 -0
  203. package/server/apiFile.d.ts +1 -0
  204. package/server/apiFile.js +14 -17
  205. package/server/apiFile.js.map +1 -0
  206. package/server/apiGitBlame.d.ts +2 -0
  207. package/server/apiGitBlame.js +50 -51
  208. package/server/apiGitBlame.js.map +1 -0
  209. package/server/apiMcp.d.ts +4 -0
  210. package/server/apiMcp.js +64 -66
  211. package/server/apiMcp.js.map +1 -0
  212. package/server/apiReview.d.ts +2 -0
  213. package/server/apiReview.js +45 -0
  214. package/server/apiReview.js.map +1 -0
  215. package/server/apiScan.d.ts +5 -0
  216. package/server/apiScan.js +90 -71
  217. package/server/apiScan.js.map +1 -0
  218. package/server/apiSearch.d.ts +33 -0
  219. package/server/apiSearch.js +184 -200
  220. package/server/apiSearch.js.map +1 -0
  221. package/server/apiSettings.d.ts +4 -0
  222. package/server/apiSettings.js +84 -85
  223. package/server/apiSettings.js.map +1 -0
  224. package/server/apiTools.d.ts +3 -0
  225. package/server/apiTools.js +55 -56
  226. package/server/apiTools.js.map +1 -0
  227. package/server/auth.d.ts +5 -0
  228. package/server/auth.js +54 -51
  229. package/server/auth.js.map +1 -0
  230. package/server/config.d.ts +42 -0
  231. package/server/config.js +189 -194
  232. package/server/config.js.map +1 -0
  233. package/server/daemon.d.ts +12 -0
  234. package/server/daemon.js +124 -114
  235. package/server/daemon.js.map +1 -0
  236. package/server/fileSourceNode.d.ts +2 -0
  237. package/server/fileSourceNode.js +34 -36
  238. package/server/fileSourceNode.js.map +1 -0
  239. package/server/gitClone.d.ts +9 -0
  240. package/server/gitClone.js +59 -61
  241. package/server/gitClone.js.map +1 -0
  242. package/server/gitDiff.d.ts +36 -0
  243. package/server/gitDiff.js +271 -169
  244. package/server/gitDiff.js.map +1 -0
  245. package/server/gitHistory.d.ts +12 -0
  246. package/server/gitHistory.js +80 -80
  247. package/server/gitHistory.js.map +1 -0
  248. package/server/gitRemote.d.ts +12 -0
  249. package/server/gitRemote.js +60 -0
  250. package/server/gitRemote.js.map +1 -0
  251. package/server/htmlText.d.ts +4 -0
  252. package/server/htmlText.js +16 -23
  253. package/server/htmlText.js.map +1 -0
  254. package/server/http.d.ts +5 -0
  255. package/server/http.js +27 -30
  256. package/server/http.js.map +1 -0
  257. package/server/httpGuards.d.ts +2 -0
  258. package/server/httpGuards.js +47 -43
  259. package/server/httpGuards.js.map +1 -0
  260. package/server/https.d.ts +34 -0
  261. package/server/https.js +121 -111
  262. package/server/https.js.map +1 -0
  263. package/server/index.d.ts +40 -0
  264. package/server/index.js +139 -147
  265. package/server/index.js.map +1 -0
  266. package/server/layout.d.ts +26 -0
  267. package/server/layout.js +59 -37
  268. package/server/layout.js.map +1 -0
  269. package/server/llmProxy.d.ts +3 -0
  270. package/server/llmProxy.js +137 -135
  271. package/server/llmProxy.js.map +1 -0
  272. package/server/logger.d.ts +38 -0
  273. package/server/logger.js +198 -211
  274. package/server/logger.js.map +1 -0
  275. package/server/mcp/analysis.d.ts +29 -0
  276. package/server/mcp/analysis.js +99 -120
  277. package/server/mcp/analysis.js.map +1 -0
  278. package/server/mcp/http.d.ts +9 -0
  279. package/server/mcp/http.js +128 -137
  280. package/server/mcp/http.js.map +1 -0
  281. package/server/mcp/runner.d.ts +68 -0
  282. package/server/mcp/runner.js +208 -218
  283. package/server/mcp/runner.js.map +1 -0
  284. package/server/mcp/server.d.ts +29 -0
  285. package/server/mcp/server.js +166 -179
  286. package/server/mcp/server.js.map +1 -0
  287. package/server/mcp/standalone.d.ts +1 -0
  288. package/server/mcp/standalone.js +8 -10
  289. package/server/mcp/standalone.js.map +1 -0
  290. package/server/mcp/tools.d.ts +2020 -0
  291. package/server/mcp/tools.js +523 -574
  292. package/server/mcp/tools.js.map +1 -0
  293. package/server/paths.d.ts +3 -0
  294. package/server/paths.js +17 -15
  295. package/server/paths.js.map +1 -0
  296. package/server/pidfile.d.ts +9 -0
  297. package/server/pidfile.js +43 -45
  298. package/server/pidfile.js.map +1 -0
  299. package/server/review.d.ts +5 -0
  300. package/server/review.js +35 -0
  301. package/server/review.js.map +1 -0
  302. package/server/router.d.ts +33 -0
  303. package/server/router.js +191 -197
  304. package/server/router.js.map +1 -0
  305. package/server/scanRequest.d.ts +3 -0
  306. package/server/scanRequest.js +36 -0
  307. package/server/scanRequest.js.map +1 -0
  308. package/server/searchIndex.d.ts +17 -0
  309. package/server/searchIndex.js +83 -80
  310. package/server/searchIndex.js.map +1 -0
  311. package/server/sessions.d.ts +14 -0
  312. package/server/sessions.js +62 -70
  313. package/server/sessions.js.map +1 -0
  314. package/server/startup.d.ts +118 -0
  315. package/server/startup.js +143 -148
  316. package/server/startup.js.map +1 -0
  317. package/server/static.d.ts +6 -0
  318. package/server/static.js +28 -31
  319. package/server/static.js.map +1 -0
  320. package/server/tools/install.d.ts +4 -0
  321. package/server/tools/install.js +176 -185
  322. package/server/tools/install.js.map +1 -0
  323. package/server/tools/parse.d.ts +8 -0
  324. package/server/tools/parse.js +112 -114
  325. package/server/tools/parse.js.map +1 -0
  326. package/server/tools/platform.d.ts +9 -0
  327. package/server/tools/platform.js +49 -47
  328. package/server/tools/platform.js.map +1 -0
  329. package/server/tools/registry.d.ts +137 -0
  330. package/server/tools/registry.js +173 -172
  331. package/server/tools/registry.js.map +1 -0
  332. package/server/tools/scan.d.ts +34 -0
  333. package/server/tools/scan.js +89 -98
  334. package/server/tools/scan.js.map +1 -0
  335. package/server/tools.d.ts +34 -0
  336. package/server/tools.js +94 -107
  337. package/server/tools.js.map +1 -0
  338. package/server/tunnel.d.ts +29 -0
  339. package/server/tunnel.js +61 -66
  340. package/server/tunnel.js.map +1 -0
  341. package/shared/analyzer/docs.d.ts +16 -0
  342. package/shared/analyzer/docs.js +99 -93
  343. package/shared/analyzer/docs.js.map +1 -0
  344. package/shared/analyzer/explainLocal.d.ts +4 -0
  345. package/shared/analyzer/explainLocal.js +122 -142
  346. package/shared/analyzer/explainLocal.js.map +1 -0
  347. package/shared/analyzer/github.d.ts +37 -0
  348. package/shared/analyzer/github.js +79 -0
  349. package/shared/analyzer/github.js.map +1 -0
  350. package/shared/analyzer/graph.d.ts +41 -0
  351. package/shared/analyzer/graph.js +393 -400
  352. package/shared/analyzer/graph.js.map +1 -0
  353. package/shared/analyzer/health.d.ts +33 -0
  354. package/shared/analyzer/health.js +197 -193
  355. package/shared/analyzer/health.js.map +1 -0
  356. package/shared/analyzer/history.d.ts +29 -0
  357. package/shared/analyzer/history.js +110 -111
  358. package/shared/analyzer/history.js.map +1 -0
  359. package/shared/analyzer/jsonConfig.d.ts +2 -0
  360. package/shared/analyzer/jsonConfig.js +61 -0
  361. package/shared/analyzer/jsonConfig.js.map +1 -0
  362. package/shared/analyzer/languages/csharp.d.ts +26 -0
  363. package/shared/analyzer/languages/csharp.js +83 -88
  364. package/shared/analyzer/languages/csharp.js.map +1 -0
  365. package/shared/analyzer/languages/generic.d.ts +23 -0
  366. package/shared/analyzer/languages/generic.js +94 -105
  367. package/shared/analyzer/languages/generic.js.map +1 -0
  368. package/shared/analyzer/languages/go.d.ts +24 -0
  369. package/shared/analyzer/languages/go.js +45 -54
  370. package/shared/analyzer/languages/go.js.map +1 -0
  371. package/shared/analyzer/languages/index.d.ts +6 -0
  372. package/shared/analyzer/languages/index.js +19 -20
  373. package/shared/analyzer/languages/index.js.map +1 -0
  374. package/shared/analyzer/languages/java.d.ts +20 -0
  375. package/shared/analyzer/languages/java.js +73 -78
  376. package/shared/analyzer/languages/java.js.map +1 -0
  377. package/shared/analyzer/languages/javascript.d.ts +12 -0
  378. package/shared/analyzer/languages/javascript.js +258 -209
  379. package/shared/analyzer/languages/javascript.js.map +1 -0
  380. package/shared/analyzer/languages/python.d.ts +23 -0
  381. package/shared/analyzer/languages/python.js +92 -100
  382. package/shared/analyzer/languages/python.js.map +1 -0
  383. package/shared/analyzer/languages/rust.d.ts +17 -0
  384. package/shared/analyzer/languages/rust.js +96 -98
  385. package/shared/analyzer/languages/rust.js.map +1 -0
  386. package/shared/analyzer/languages/typescript.d.ts +11 -0
  387. package/shared/analyzer/languages/typescript.js +117 -116
  388. package/shared/analyzer/languages/typescript.js.map +1 -0
  389. package/shared/analyzer/licenses.d.ts +18 -0
  390. package/shared/analyzer/licenses.js +130 -133
  391. package/shared/analyzer/licenses.js.map +1 -0
  392. package/shared/analyzer/metrics.d.ts +20 -0
  393. package/shared/analyzer/metrics.js +112 -104
  394. package/shared/analyzer/metrics.js.map +1 -0
  395. package/shared/analyzer/pathUtil.d.ts +10 -0
  396. package/shared/analyzer/pathUtil.js +29 -35
  397. package/shared/analyzer/pathUtil.js.map +1 -0
  398. package/shared/analyzer/patterns.d.ts +11 -0
  399. package/shared/analyzer/patterns.js +231 -253
  400. package/shared/analyzer/patterns.js.map +1 -0
  401. package/shared/analyzer/scan.d.ts +62 -0
  402. package/shared/analyzer/scan.js +451 -442
  403. package/shared/analyzer/scan.js.map +1 -0
  404. package/shared/analyzer/scanControl.d.ts +11 -0
  405. package/shared/analyzer/scanControl.js +62 -0
  406. package/shared/analyzer/scanControl.js.map +1 -0
  407. package/shared/analyzer/security.d.ts +18 -0
  408. package/shared/analyzer/security.js +159 -159
  409. package/shared/analyzer/security.js.map +1 -0
  410. package/shared/analyzer/services.d.ts +5 -0
  411. package/shared/analyzer/services.js +141 -138
  412. package/shared/analyzer/services.js.map +1 -0
  413. package/shared/analyzer/stack.d.ts +6 -0
  414. package/shared/analyzer/stack.js +134 -141
  415. package/shared/analyzer/stack.js.map +1 -0
  416. package/shared/analyzer/tour.d.ts +2 -0
  417. package/shared/analyzer/tour.js +45 -53
  418. package/shared/analyzer/tour.js.map +1 -0
  419. package/shared/analyzer/util.d.ts +8 -0
  420. package/shared/analyzer/util.js +130 -76
  421. package/shared/analyzer/util.js.map +1 -0
  422. package/shared/analyzer/workflows.d.ts +8 -0
  423. package/shared/analyzer/workflows.js +139 -134
  424. package/shared/analyzer/workflows.js.map +1 -0
  425. package/shared/contracts.d.ts +250 -0
  426. package/shared/contracts.js +2 -0
  427. package/shared/contracts.js.map +1 -0
  428. package/shared/diagram/aiFacts.d.ts +35 -0
  429. package/shared/diagram/aiFacts.js +102 -105
  430. package/shared/diagram/aiFacts.js.map +1 -0
  431. package/shared/diagram/aiMermaid.d.ts +5 -0
  432. package/shared/diagram/aiMermaid.js +46 -45
  433. package/shared/diagram/aiMermaid.js.map +1 -0
  434. package/shared/diagram/atlas.d.ts +16 -0
  435. package/shared/diagram/atlas.js +51 -60
  436. package/shared/diagram/atlas.js.map +1 -0
  437. package/shared/diagram/mermaid.d.ts +43 -0
  438. package/shared/diagram/mermaid.js +348 -370
  439. package/shared/diagram/mermaid.js.map +1 -0
  440. package/shared/review/contracts.d.ts +95 -0
  441. package/shared/review/contracts.js +2 -0
  442. package/shared/review/contracts.js.map +1 -0
  443. package/shared/review/review.d.ts +10 -0
  444. package/shared/review/review.js +184 -0
  445. package/shared/review/review.js.map +1 -0
  446. package/shared/search/query.d.ts +32 -0
  447. package/shared/search/query.js +395 -388
  448. package/shared/search/query.js.map +1 -0
package/server/logger.js CHANGED
@@ -9,26 +9,20 @@
9
9
  // A `time` field (local HH:MM:SS.mmm) rides along with the ISO `ts` on purpose:
10
10
  // tailing a file gives you the string, not a Date, and a reader wants their own
11
11
  // clock, not UTC.
12
-
13
12
  const levels = { debug: 0, info: 1, warn: 2, error: 3 };
14
-
15
13
  // Worst first — the order any summary or sort should use.
16
14
  export const SEVERITY = { error: 0, warn: 1, info: 2, debug: 3 };
17
-
18
15
  const CODES = { red: 31, green: 32, yellow: 33, cyan: 36, gray: 90 };
19
16
  const LEVEL_COLOR = { debug: 'gray', info: 'cyan', warn: 'yellow', error: 'red' };
20
-
21
17
  // The server sits *under* the CLI, so it cannot import `cli/ui.js` without
22
18
  // inverting the dependency. These three lines of ANSI are the whole price.
23
19
  function paint(text, color, enabled) {
24
- return enabled && color ? `\x1b[${CODES[color]}m${text}\x1b[0m` : String(text);
20
+ return enabled && color ? `\x1b[${CODES[color]}m${text}\x1b[0m` : String(text);
25
21
  }
26
-
27
22
  // Fields that are part of the envelope or already rendered into the message.
28
23
  // `summary` is here so the suppressed-noise footer does not print itself as
29
24
  // `summary=true` — it is a rendering flag, not data.
30
25
  const ENVELOPE = new Set(['ts', 'time', 'level', 'msg', 'method', 'path', 'status', 'ms', 'line', 'scope', 'summary']);
31
-
32
26
  // Request classification — the difference between a person doing something and
33
27
  // a browser fetching a file.
34
28
  //
@@ -43,69 +37,72 @@ const ENVELOPE = new Set(['ts', 'time', 'level', 'msg', 'method', 'path', 'statu
43
37
  // because "nothing happened" and "90 files were served" are different facts and
44
38
  // only one of them is interesting most of the time.
45
39
  export function classifyPath(pathname = '') {
46
- const path = String(pathname).split('?')[0];
47
- if (path === '/api/health') return 'poll'; // uptime checks
48
- if (path.startsWith('/api/')) return 'action';
49
- return 'noise';
40
+ const path = String(pathname).split('?')[0];
41
+ if (path === '/api/health')
42
+ return 'poll'; // uptime checks
43
+ if (path.startsWith('/api/'))
44
+ return 'action';
45
+ return 'noise';
50
46
  }
51
-
52
47
  export function classifyRequest(req = {}) {
53
- const kind = classifyPath(req.path);
54
- // A failure is always an action, whatever it was: a 404 on a missing asset is
55
- // a broken build, and a 500 is a bug. Neither is noise to be summarized away.
56
- if (Number(req.status) >= 400) return 'action';
57
- if (req.method && req.method !== 'GET' && req.method !== 'HEAD') return 'action';
58
- return kind;
48
+ const kind = classifyPath(req.path);
49
+ // A failure is always an action, whatever it was: a 404 on a missing asset is
50
+ // a broken build, and a 500 is a bug. Neither is noise to be summarized away.
51
+ if (Number(req.status) >= 400)
52
+ return 'action';
53
+ if (req.method && req.method !== 'GET' && req.method !== 'HEAD')
54
+ return 'action';
55
+ return kind;
59
56
  }
60
-
61
57
  // One line, no styling: what a log file holds and what a test asserts on.
62
58
  export function formatMessage(entry) {
63
- if (entry.line) return `${entry.msg ?? ''} ${entry.line}`.trim();
64
- if (entry.method) {
65
- const status = entry.status === undefined ? '' : ` ${entry.status}`;
66
- const took = entry.ms === undefined ? '' : ` (${entry.ms}ms)`;
67
- return `${entry.method} ${entry.path}${status}${took}`;
68
- }
69
- const extra = Object.entries(entry)
70
- .filter(([key, value]) => !ENVELOPE.has(key) && value !== undefined && value !== null)
71
- .map(([key, value]) => `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}`);
72
- return [entry.msg ?? '', ...extra].filter(Boolean).join(' ');
59
+ if (entry.line)
60
+ return `${entry.msg ?? ''} ${entry.line}`.trim();
61
+ if (entry.method) {
62
+ const status = entry.status === undefined ? '' : ` ${entry.status}`;
63
+ const took = entry.ms === undefined ? '' : ` (${entry.ms}ms)`;
64
+ return `${entry.method} ${entry.path}${status}${took}`;
65
+ }
66
+ const extra = Object.entries(entry)
67
+ .filter(([key, value]) => !ENVELOPE.has(key) && value !== undefined && value !== null)
68
+ .map(([key, value]) => `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}`);
69
+ return [entry.msg ?? '', ...extra].filter(Boolean).join(' ');
73
70
  }
74
-
75
71
  // Every log line is `time LEVEL message`, with the level in a fixed 5-wide
76
72
  // column so the messages of an `INFO` and a `ERROR` line start at the same
77
73
  // offset. That alignment is the entire point: a wall of request logs is only
78
74
  // scannable if the eye can find the message column without reading.
79
75
  const LEVEL_WIDTH = 5;
80
76
  const GUTTER = ' ';
81
-
82
77
  // The part of a path that identifies it: the filename with its extension. When
83
78
  // a line has to be cut, this is what must survive — `…typescript.js` is useful,
84
79
  // `…script` is not. A path with no filename (`/` or `/a/`) falls back to its tail.
85
80
  export function identifyingTail(text) {
86
- const value = String(text);
87
- const name = value.slice(value.lastIndexOf('/') + 1);
88
- return name.length >= 4 ? name : value.slice(-8);
81
+ const value = String(text);
82
+ const name = value.slice(value.lastIndexOf('/') + 1);
83
+ return name.length >= 4 ? name : value.slice(-8);
89
84
  }
90
-
91
85
  // How the message area adapts to the terminal. Wide terminals get the whole
92
86
  // path; narrow ones get the part that identifies it, elided in the middle — the
93
87
  // tail of a path is the informative half, so it survives and the boring prefix
94
88
  // is what gets dropped.
95
89
  export function fitPath(text, max) {
96
- const value = String(text);
97
- if (max <= 0) return '';
98
- if (value.length <= max) return value;
99
- if (max === 1) return '…';
100
- // An ellipsis stands in for the dropped prefix, so do not also add a leading
101
- // slash: `/…/file.js` reads as a path, `//file.js` reads as a typo. The kept
102
- // tail is the filename, so a long path loses its directories rather than
103
- // losing its extension — `…typescript.js` is useful, `…typescript` is not.
104
- const tail = identifyingTail(value);
105
- if (tail.length + 1 <= max) return '…' + tail;
106
- return '…' + value.slice(-(max - 1));
90
+ const value = String(text);
91
+ if (max <= 0)
92
+ return '';
93
+ if (value.length <= max)
94
+ return value;
95
+ if (max === 1)
96
+ return '…';
97
+ // An ellipsis stands in for the dropped prefix, so do not also add a leading
98
+ // slash: `/…/file.js` reads as a path, `//file.js` reads as a typo. The kept
99
+ // tail is the filename, so a long path loses its directories rather than
100
+ // losing its extension — `…typescript.js` is useful, `…typescript` is not.
101
+ const tail = identifyingTail(value);
102
+ if (tail.length + 1 <= max)
103
+ return '…' + tail;
104
+ return '…' + value.slice(-(max - 1));
107
105
  }
108
-
109
106
  // How much room the message gets, and whether the level column is affordable.
110
107
  //
111
108
  // The fixed prefix is the time, two gutters, and the level column. On a narrow
@@ -121,27 +118,23 @@ export function fitPath(text, max) {
121
118
  export const LEVEL_MIN_COLUMNS = 52;
122
119
  export const SHORT_TIME_COLUMNS = 24;
123
120
  export const NO_TIME_COLUMNS = 12;
124
-
125
121
  export function showLevel(columns) {
126
- return (columns || 80) >= LEVEL_MIN_COLUMNS;
122
+ return (columns || 80) >= LEVEL_MIN_COLUMNS;
127
123
  }
128
-
129
124
  export function showFullTime(columns) {
130
- return (columns || 80) >= SHORT_TIME_COLUMNS;
125
+ return (columns || 80) >= SHORT_TIME_COLUMNS;
131
126
  }
132
-
133
127
  export function showTime(columns) {
134
- return (columns || 80) >= NO_TIME_COLUMNS;
128
+ return (columns || 80) >= NO_TIME_COLUMNS;
135
129
  }
136
-
137
130
  // The time as it will actually be printed, so callers do not re-derive the same
138
131
  // decision and get it subtly wrong.
139
132
  export function timeColumn(entry, columns) {
140
- if (!showTime(columns)) return '';
141
- const raw = String(entry.time || String(entry.ts || '').slice(11, 19));
142
- return showFullTime(columns) ? raw : raw.slice(0, 5);
133
+ if (!showTime(columns))
134
+ return '';
135
+ const raw = String(entry.time || String(entry.ts || '').slice(11, 19));
136
+ return showFullTime(columns) ? raw : raw.slice(0, 5);
143
137
  }
144
-
145
138
  // Everything before the message: time + gutter + optional level + gutter.
146
139
  //
147
140
  // Deliberately computed from the *width* alone, not from an entry: an earlier
@@ -150,26 +143,24 @@ export function timeColumn(entry, columns) {
150
143
  // long and overflowed. The prefix is a property of the terminal, not of the log
151
144
  // line, so it is computed from the terminal.
152
145
  export function prefixWidth(columns) {
153
- if (!showTime(columns)) return 0;
154
- const time = showFullTime(columns) ? 12 : 5;
155
- return time + GUTTER.length + (showLevel(columns) ? LEVEL_WIDTH + GUTTER.length : 0);
146
+ if (!showTime(columns))
147
+ return 0;
148
+ const time = showFullTime(columns) ? 12 : 5;
149
+ return time + GUTTER.length + (showLevel(columns) ? LEVEL_WIDTH + GUTTER.length : 0);
156
150
  }
157
-
158
151
  export function messageWidth(columns) {
159
- const total = columns || 80;
160
- return Math.max(0, total - prefixWidth(total));
152
+ const total = columns || 80;
153
+ return Math.max(0, total - prefixWidth(total));
161
154
  }
162
-
163
155
  export function formatEntry(entry, { columns } = {}) {
164
- const time = timeColumn(entry, columns);
165
- const level = showLevel(columns) ? entryLevel(entry) + GUTTER : '';
166
- const head = time ? time + GUTTER + level : '';
167
- // The message was already fitted to `messageWidth` and the head is exactly
168
- // `prefixWidth`, so the line is exactly the terminal width by construction —
169
- // no trailing clamp, and therefore no risk of cutting a word in half.
170
- return head + fitMessage(entry, columns);
156
+ const time = timeColumn(entry, columns);
157
+ const level = showLevel(columns) ? entryLevel(entry) + GUTTER : '';
158
+ const head = time ? time + GUTTER + level : '';
159
+ // The message was already fitted to `messageWidth` and the head is exactly
160
+ // `prefixWidth`, so the line is exactly the terminal width by construction —
161
+ // no trailing clamp, and therefore no risk of cutting a word in half.
162
+ return head + fitMessage(entry, columns);
171
163
  }
172
-
173
164
  // One line, fitted to the terminal.
174
165
  //
175
166
  // What gets sacrificed as space runs out, in order: the timing, then the HTTP
@@ -178,166 +169,162 @@ export function formatEntry(entry, { columns } = {}) {
178
169
  // request. A 40-column terminal gets `…zer/languages/typescript.js` (the
179
170
  // extension intact); an 80-column one gets the whole sentence.
180
171
  function fitMessage(entry, columns) {
181
- const text = formatMessage(entry);
182
- const room = messageWidth(columns);
183
- if (text.length <= room) return text;
184
- if (!entry.method || !entry.path) return fitPath(text, room);
185
-
186
- const status = entry.status === undefined ? '' : ` ${entry.status}`;
187
- const method = `${entry.method} `;
188
- // Drop the status before the method, and the method before any of the path.
189
- const withStatus = method + fitPath(entry.path, room - method.length - status.length) + status;
190
- if (withStatus.length <= room) return withStatus;
191
- const withoutStatus = method + fitPath(entry.path, room - method.length);
192
- if (withoutStatus.length <= room) return withoutStatus;
193
- // Last resort: the path alone, at exactly the room available. `fitPath` is
194
- // given the exact width, so this is always exactly `room` — never over, which
195
- // is what would make the caller's clamp cut the *front* of the line and leave
196
- // an unreadable tail like `pt.js 200`.
197
- return fitPath(entry.path, room);
172
+ const text = formatMessage(entry);
173
+ const room = messageWidth(columns);
174
+ if (text.length <= room)
175
+ return text;
176
+ if (!entry.method || !entry.path)
177
+ return fitPath(text, room);
178
+ const status = entry.status === undefined ? '' : ` ${entry.status}`;
179
+ const method = `${entry.method} `;
180
+ // Drop the status before the method, and the method before any of the path.
181
+ const withStatus = method + fitPath(entry.path, room - method.length - status.length) + status;
182
+ if (withStatus.length <= room)
183
+ return withStatus;
184
+ const withoutStatus = method + fitPath(entry.path, room - method.length);
185
+ if (withoutStatus.length <= room)
186
+ return withoutStatus;
187
+ // Last resort: the path alone, at exactly the room available. `fitPath` is
188
+ // given the exact width, so this is always exactly `room` — never over, which
189
+ // is what would make the caller's clamp cut the *front* of the line and leave
190
+ // an unreadable tail like `pt.js 200`.
191
+ return fitPath(entry.path, room);
198
192
  }
199
-
200
193
  // A summary of suppressed noise renders as a footnote, not an event: dim, and
201
194
  // with no level column, so the eye skips it while scanning for real lines. It
202
195
  // occupies the same time gutter so it still lines up in the scrollback.
203
196
  export function renderEntry(entry, { color = false, columns } = {}) {
204
- const message = fitMessage(entry, columns);
205
- const limit = Math.max(8, columns || 80);
206
- if (entry.summary) {
207
- const pad = showLevel(columns) ? ' '.repeat(LEVEL_WIDTH) + GUTTER : '';
208
- return paint(timeColumn(entry, columns), 'gray', color)
209
- + GUTTER + paint(GUTTER + pad + message, 'gray', color);
210
- }
211
- const painted = paint(timeColumn(entry, columns), 'gray', color) + GUTTER
212
- + (showLevel(columns) ? paint(entryLevel(entry), LEVEL_COLOR[entry.level] || 'gray', color) + GUTTER : '')
213
- + message;
214
- // Clamp on *visible* width: the ANSI codes cost nothing on screen, so slicing
215
- // the painted string by character count would cut a real character and leave
216
- // the escape sequence unterminated.
217
- return visibleWidth(painted) <= limit ? painted : trimVisible(painted, limit);
197
+ const message = fitMessage(entry, columns);
198
+ const limit = Math.max(8, columns || 80);
199
+ if (entry.summary) {
200
+ const pad = showLevel(columns) ? ' '.repeat(LEVEL_WIDTH) + GUTTER : '';
201
+ return paint(timeColumn(entry, columns), 'gray', color)
202
+ + GUTTER + paint(GUTTER + pad + message, 'gray', color);
203
+ }
204
+ const painted = paint(timeColumn(entry, columns), 'gray', color) + GUTTER
205
+ + (showLevel(columns) ? paint(entryLevel(entry), LEVEL_COLOR[entry.level] || 'gray', color) + GUTTER : '')
206
+ + message;
207
+ // Clamp on *visible* width: the ANSI codes cost nothing on screen, so slicing
208
+ // the painted string by character count would cut a real character and leave
209
+ // the escape sequence unterminated.
210
+ return visibleWidth(painted) <= limit ? painted : trimVisible(painted, limit);
218
211
  }
219
-
220
212
  // Visible width, ANSI excluded.
221
213
  function visibleWidth(text) {
222
- return String(text).replace(/\x1b\[[0-9;]*m/g, '').length;
214
+ return String(text).replace(/\x1b\[[0-9;]*m/g, '').length;
223
215
  }
224
-
225
216
  // Cut a painted string to `max` visible columns, passing escape sequences through
226
217
  // and never splitting one, then resetting so the terminal is left clean.
227
218
  function trimVisible(text, max) {
228
- const pattern = /\x1b\[[0-9;]*m/g;
229
- let out = '';
230
- let seen = 0;
231
- let last = 0;
232
- let match;
233
- while ((match = pattern.exec(text)) !== null) {
234
- const chunk = text.slice(last, match.index);
235
- if (seen + chunk.length >= max) return out + chunk.slice(0, Math.max(0, max - seen)) + '\x1b[0m';
236
- out += chunk + match[0];
237
- seen += chunk.length;
238
- last = pattern.lastIndex;
239
- }
240
- const rest = text.slice(last);
241
- return out + (seen + rest.length > max ? rest.slice(0, max - seen) : rest);
219
+ const pattern = /\x1b\[[0-9;]*m/g;
220
+ let out = '';
221
+ let seen = 0;
222
+ let last = 0;
223
+ let match;
224
+ while ((match = pattern.exec(text)) !== null) {
225
+ const chunk = text.slice(last, match.index);
226
+ if (seen + chunk.length >= max)
227
+ return out + chunk.slice(0, Math.max(0, max - seen)) + '\x1b[0m';
228
+ out += chunk + match[0];
229
+ seen += chunk.length;
230
+ last = pattern.lastIndex;
231
+ }
232
+ const rest = text.slice(last);
233
+ return out + (seen + rest.length > max ? rest.slice(0, max - seen) : rest);
242
234
  }
243
-
244
235
  function entryLevel(entry) {
245
- return String(entry.level || 'info').toUpperCase().padEnd(LEVEL_WIDTH);
236
+ return String(entry.level || 'info').toUpperCase().padEnd(LEVEL_WIDTH);
246
237
  }
247
-
248
238
  // A human summary of suppressed noise, so silence is never ambiguous. "Nothing
249
239
  // happened" and "94 files were served" are different facts; printing the second
250
240
  // as one line every so often keeps the first honest.
251
241
  export function noiseSummary(count, ms = 0) {
252
- const files = `${count} static file${count === 1 ? '' : 's'}`;
253
- const took = ms >= 1000 ? ` in ${(ms / 1000).toFixed(1)}s` : ms ? ` in ${ms}ms` : '';
254
- return `served ${files}${took}`;
242
+ const files = `${count} static file${count === 1 ? '' : 's'}`;
243
+ const took = ms >= 1000 ? ` in ${(ms / 1000).toFixed(1)}s` : ms ? ` in ${ms}ms` : '';
244
+ return `served ${files}${took}`;
255
245
  }
256
-
257
246
  export function logEntry(level, msg, extra = {}) {
258
- const now = new Date();
259
- return {
260
- ts: now.toISOString(),
261
- // Built from the local parts, not `toTimeString()`: that carries a timezone
262
- // abbreviation whose width changes (`GMT` vs ` PDT`), which is exactly what
263
- // makes a log column ragged. Always 12 characters, always the reader's clock.
264
- time: [now.getHours(), now.getMinutes(), now.getSeconds()]
265
- .map((part) => String(part).padStart(2, '0'))
266
- .join(':') + '.' + String(now.getMilliseconds()).padStart(3, '0'),
267
- level,
268
- msg,
269
- ...extra,
270
- };
247
+ const now = new Date();
248
+ return {
249
+ ts: now.toISOString(),
250
+ // Built from the local parts, not `toTimeString()`: that carries a timezone
251
+ // abbreviation whose width changes (`GMT` vs ` PDT`), which is exactly what
252
+ // makes a log column ragged. Always 12 characters, always the reader's clock.
253
+ time: [now.getHours(), now.getMinutes(), now.getSeconds()]
254
+ .map((part) => String(part).padStart(2, '0'))
255
+ .join(':') + '.' + String(now.getMilliseconds()).padStart(3, '0'),
256
+ level,
257
+ msg,
258
+ ...extra,
259
+ };
271
260
  }
272
-
273
261
  export function createLogger(level = process.env.LOG_LEVEL || 'info', options = {}) {
274
- const minLevel = levels[level] ?? levels.info;
275
- // `pretty` is the default for a terminal *and* for a log file (aligned text is
276
- // what a person reads at 2am); `ONBOARDER_LOG=json` is the machine escape
277
- // hatch, and so is a non-TTY consumer that parses stdout.
278
- const format = options.format || process.env.ONBOARDER_LOG || 'pretty';
279
- const color = options.color ?? (Boolean(process.stdout.isTTY) && !process.env.NO_COLOR);
280
- const out = options.stdout || process.stdout;
281
- const err = options.stderr || process.stderr;
282
-
283
- // The noise policy. `info` (the default) drops successful static assets and
284
- // uptime polls; `debug` shows every request, which is what you want when you
285
- // are debugging the server rather than watching it. ONBOARDER_LOG_VERBOSE=1 is
286
- // the same escape hatch without changing the level.
287
- const quiet = options.quiet ?? (minLevel > levels.debug && process.env.ONBOARDER_LOG_VERBOSE !== '1');
288
- // Read the terminal width per write, not once at construction: a log line
289
- // printed after the user resized their window should use the new width.
290
- const columns = options.columns ?? (() => out.columns || undefined);
291
-
292
- // Suppressed-asset accounting. Assets are counted, not printed, and the tally
293
- // is flushed as ONE dim summary line once it reaches `flushAt` — so a page
294
- // load that serves 94 files produces one line, and a terminal that is idle
295
- // still admits the server is busy rather than looking dead.
296
- const flushAt = options.flushAt ?? 40;
297
- let suppressed = 0;
298
- let since = Date.now();
299
-
300
- function flush(force = false) {
301
- if (!suppressed) return;
302
- if (!force && suppressed < flushAt) return;
303
- write(logEntry('info', noiseSummary(suppressed, Date.now() - since), { summary: true }));
304
- suppressed = 0;
305
- since = Date.now();
306
- }
307
-
308
- function write(entry) {
309
- if (format === 'json') {
310
- const line = JSON.stringify(entry) + '\n';
311
- (entry.level === 'warn' || entry.level === 'error' ? err : out).write(line);
312
- return;
262
+ const minLevel = levels[level] ?? levels.info;
263
+ // `pretty` is the default for a terminal *and* for a log file (aligned text is
264
+ // what a person reads at 2am); `ONBOARDER_LOG=json` is the machine escape
265
+ // hatch, and so is a non-TTY consumer that parses stdout.
266
+ const format = options.format || process.env.ONBOARDER_LOG || 'pretty';
267
+ const color = options.color ?? (Boolean(process.stdout.isTTY) && !process.env.NO_COLOR);
268
+ const out = options.stdout || process.stdout;
269
+ const err = options.stderr || process.stderr;
270
+ // The noise policy. `info` (the default) drops successful static assets and
271
+ // uptime polls; `debug` shows every request, which is what you want when you
272
+ // are debugging the server rather than watching it. ONBOARDER_LOG_VERBOSE=1 is
273
+ // the same escape hatch without changing the level.
274
+ const quiet = options.quiet ?? (minLevel > levels.debug && process.env.ONBOARDER_LOG_VERBOSE !== '1');
275
+ // Read the terminal width per write, not once at construction: a log line
276
+ // printed after the user resized their window should use the new width.
277
+ const columns = options.columns ?? (() => out.columns || undefined);
278
+ // Suppressed-asset accounting. Assets are counted, not printed, and the tally
279
+ // is flushed as ONE dim summary line once it reaches `flushAt` — so a page
280
+ // load that serves 94 files produces one line, and a terminal that is idle
281
+ // still admits the server is busy rather than looking dead.
282
+ const flushAt = options.flushAt ?? 40;
283
+ let suppressed = 0;
284
+ let since = Date.now();
285
+ function flush(force = false) {
286
+ if (!suppressed)
287
+ return;
288
+ if (!force && suppressed < flushAt)
289
+ return;
290
+ write(logEntry('info', noiseSummary(suppressed, Date.now() - since), { summary: true }));
291
+ suppressed = 0;
292
+ since = Date.now();
293
+ }
294
+ function write(entry) {
295
+ if (format === 'json') {
296
+ const line = JSON.stringify(entry) + '\n';
297
+ (entry.level === 'warn' || entry.level === 'error' ? err : out).write(line);
298
+ return;
299
+ }
300
+ (entry.level === 'warn' || entry.level === 'error' ? err : out).write(renderEntry(entry, { color, columns: columns() }) + '\n');
301
+ }
302
+ function log(lvl, msg, extra = {}) {
303
+ if (levels[lvl] < minLevel)
304
+ return;
305
+ write(logEntry(lvl, msg, extra));
313
306
  }
314
- (entry.level === 'warn' || entry.level === 'error' ? err : out).write(renderEntry(entry, { color, columns: columns() }) + '\n');
315
- }
316
-
317
- function log(lvl, msg, extra = {}) {
318
- if (levels[lvl] < minLevel) return;
319
- write(logEntry(lvl, msg, extra));
320
- }
321
-
322
- return {
323
- debug: (msg, extra) => log('debug', msg, extra),
324
- info: (msg, extra) => log('info', msg, extra),
325
- warn: (msg, extra) => log('warn', msg, extra),
326
- error: (msg, extra) => log('error', msg, extra),
327
- // The one place the noise policy lives. A successful GET of a static file is
328
- // counted, not printed; a scan, a login, or any failure is printed.
329
- http: (req) => {
330
- if (quiet && classifyRequest(req) === 'noise') {
331
- suppressed += 1;
332
- flush();
333
- return;
334
- }
335
- if (quiet && classifyPath(req.path) === 'poll') return;
336
- flush();
337
- log(Number(req.status) >= 500 ? 'error' : 'info', 'http', req);
338
- },
339
- // Let a shutdown path (or a test) get the tally out before the process dies.
340
- flush: () => flush(true),
341
- suppressed: () => suppressed,
342
- };
307
+ return {
308
+ debug: (msg, extra) => log('debug', msg, extra),
309
+ info: (msg, extra) => log('info', msg, extra),
310
+ warn: (msg, extra) => log('warn', msg, extra),
311
+ error: (msg, extra) => log('error', msg, extra),
312
+ // The one place the noise policy lives. A successful GET of a static file is
313
+ // counted, not printed; a scan, a login, or any failure is printed.
314
+ http: (req) => {
315
+ if (quiet && classifyRequest(req) === 'noise') {
316
+ suppressed += 1;
317
+ flush();
318
+ return;
319
+ }
320
+ if (quiet && classifyPath(req.path) === 'poll')
321
+ return;
322
+ flush();
323
+ log(Number(req.status) >= 500 ? 'error' : 'info', 'http', req);
324
+ },
325
+ // Let a shutdown path (or a test) get the tally out before the process dies.
326
+ flush: () => flush(true),
327
+ suppressed: () => suppressed,
328
+ };
343
329
  }
330
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/server/logger.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,6EAA6E;AAC7E,kBAAkB;AAClB,EAAE;AACF,gF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KAAK,EAAE,CAAC;YACR,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACjE,CAAC;QACD,6EAA6E;QAC7E,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Every line Onboarder writes, in two faces.\n//\n// The entry itself is data — `{ ts, time, level, msg, ...fields }` — and the\n// renderer decides how it looks. JSON goes to pipes, log files and anything\n// parsing us; the aligned human line goes to a terminal. Picking the face once,\n// here, is what keeps a log file readable *and* machine-parseable instead of\n// half one thing.\n//\n// A `time` field (local HH:MM:SS.mmm) rides along with the ISO `ts` on purpose:\n// tailing a file gives you the string, not a Date, and a reader wants their own\n// clock, not UTC.\n\nconst levels = { debug: 0, info: 1, warn: 2, error: 3 };\n\n// Worst first — the order any summary or sort should use.\nexport const SEVERITY = { error: 0, warn: 1, info: 2, debug: 3 };\n\nconst CODES = { red: 31, green: 32, yellow: 33, cyan: 36, gray: 90 };\nconst LEVEL_COLOR = { debug: 'gray', info: 'cyan', warn: 'yellow', error: 'red' };\n\n// The server sits *under* the CLI, so it cannot import `cli/ui.js` without\n// inverting the dependency. These three lines of ANSI are the whole price.\nfunction paint(text, color, enabled) {\n return enabled && color ? `\\x1b[${CODES[color]}m${text}\\x1b[0m` : String(text);\n}\n\n// Fields that are part of the envelope or already rendered into the message.\n// `summary` is here so the suppressed-noise footer does not print itself as\n// `summary=true` — it is a rendering flag, not data.\nconst ENVELOPE = new Set(['ts', 'time', 'level', 'msg', 'method', 'path', 'status', 'ms', 'line', 'scope', 'summary']);\n\n// Request classification — the difference between a person doing something and\n// a browser fetching a file.\n//\n// This is the single most important thing about Onboarder's logs. A page load\n// pulls ~90 ES modules, a stylesheet, and two vendored libraries: 90 log lines\n// describing zero user actions, repeated on every reload and on every auth\n// check. The MCP status poll adds one more line every nine seconds, forever. Log\n// all of it and the real events — a scan, a login, a 500 — are buried.\n//\n// So: a request is an **action** if it is an API call, and **noise** if it is a\n// static asset. Noise is not thrown away, it is *counted* (see `NoiseCounter`),\n// because \"nothing happened\" and \"90 files were served\" are different facts and\n// only one of them is interesting most of the time.\nexport function classifyPath(pathname = '') {\n const path = String(pathname).split('?')[0];\n if (path === '/api/health') return 'poll'; // uptime checks\n if (path.startsWith('/api/')) return 'action';\n return 'noise';\n}\n\nexport function classifyRequest(req: Record<string, any> = {}) {\n const kind = classifyPath(req.path);\n // A failure is always an action, whatever it was: a 404 on a missing asset is\n // a broken build, and a 500 is a bug. Neither is noise to be summarized away.\n if (Number(req.status) >= 400) return 'action';\n if (req.method && req.method !== 'GET' && req.method !== 'HEAD') return 'action';\n return kind;\n}\n\n// One line, no styling: what a log file holds and what a test asserts on.\nexport function formatMessage(entry) {\n if (entry.line) return `${entry.msg ?? ''} ${entry.line}`.trim();\n if (entry.method) {\n const status = entry.status === undefined ? '' : ` ${entry.status}`;\n const took = entry.ms === undefined ? '' : ` (${entry.ms}ms)`;\n return `${entry.method} ${entry.path}${status}${took}`;\n }\n const extra = Object.entries(entry)\n .filter(([key, value]) => !ENVELOPE.has(key) && value !== undefined && value !== null)\n .map(([key, value]) => `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}`);\n return [entry.msg ?? '', ...extra].filter(Boolean).join(' ');\n}\n\n// Every log line is `time LEVEL message`, with the level in a fixed 5-wide\n// column so the messages of an `INFO` and a `ERROR` line start at the same\n// offset. That alignment is the entire point: a wall of request logs is only\n// scannable if the eye can find the message column without reading.\nconst LEVEL_WIDTH = 5;\nconst GUTTER = ' ';\n\n// The part of a path that identifies it: the filename with its extension. When\n// a line has to be cut, this is what must survive — `…typescript.js` is useful,\n// `…script` is not. A path with no filename (`/` or `/a/`) falls back to its tail.\nexport function identifyingTail(text) {\n const value = String(text);\n const name = value.slice(value.lastIndexOf('/') + 1);\n return name.length >= 4 ? name : value.slice(-8);\n}\n\n// How the message area adapts to the terminal. Wide terminals get the whole\n// path; narrow ones get the part that identifies it, elided in the middle — the\n// tail of a path is the informative half, so it survives and the boring prefix\n// is what gets dropped.\nexport function fitPath(text, max) {\n const value = String(text);\n if (max <= 0) return '';\n if (value.length <= max) return value;\n if (max === 1) return '…';\n // An ellipsis stands in for the dropped prefix, so do not also add a leading\n // slash: `/…/file.js` reads as a path, `//file.js` reads as a typo. The kept\n // tail is the filename, so a long path loses its directories rather than\n // losing its extension — `…typescript.js` is useful, `…typescript` is not.\n const tail = identifyingTail(value);\n if (tail.length + 1 <= max) return '…' + tail;\n return '…' + value.slice(-(max - 1));\n}\n\n// How much room the message gets, and whether the level column is affordable.\n//\n// The fixed prefix is the time, two gutters, and the level column. On a narrow\n// terminal that fixed cost eats the whole line, so two things give way: below 52\n// columns the level column is dropped, and below 24 the timestamp reduces to\n// HH:MM. Below 12 there is no room for any prefix at all, so both are dropped.\n//\n// Crucially the prefix never exceeds the terminal. An earlier version floored\n// `messageWidth` at 12, which meant a 20-column line asked for 20 columns of\n// message, overflowed, and got clamped from the front — producing `pt.js 200`,\n// the tail of a line with its head cut off. The prefix is the part that must\n// yield, not the message.\nexport const LEVEL_MIN_COLUMNS = 52;\nexport const SHORT_TIME_COLUMNS = 24;\nexport const NO_TIME_COLUMNS = 12;\n\nexport function showLevel(columns) {\n return (columns || 80) >= LEVEL_MIN_COLUMNS;\n}\n\nexport function showFullTime(columns) {\n return (columns || 80) >= SHORT_TIME_COLUMNS;\n}\n\nexport function showTime(columns) {\n return (columns || 80) >= NO_TIME_COLUMNS;\n}\n\n// The time as it will actually be printed, so callers do not re-derive the same\n// decision and get it subtly wrong.\nexport function timeColumn(entry, columns) {\n if (!showTime(columns)) return '';\n const raw = String(entry.time || String(entry.ts || '').slice(11, 19));\n return showFullTime(columns) ? raw : raw.slice(0, 5);\n}\n\n// Everything before the message: time + gutter + optional level + gutter.\n//\n// Deliberately computed from the *width* alone, not from an entry: an earlier\n// version asked `timeColumn({}, columns)`, which has no timestamp and so\n// reported a zero-width prefix — and then every line was built 19 columns too\n// long and overflowed. The prefix is a property of the terminal, not of the log\n// line, so it is computed from the terminal.\nexport function prefixWidth(columns) {\n if (!showTime(columns)) return 0;\n const time = showFullTime(columns) ? 12 : 5;\n return time + GUTTER.length + (showLevel(columns) ? LEVEL_WIDTH + GUTTER.length : 0);\n}\n\nexport function messageWidth(columns) {\n const total = columns || 80;\n return Math.max(0, total - prefixWidth(total));\n}\n\nexport function formatEntry(entry, { columns }: Record<string, any> = {}) {\n const time = timeColumn(entry, columns);\n const level = showLevel(columns) ? entryLevel(entry) + GUTTER : '';\n const head = time ? time + GUTTER + level : '';\n // The message was already fitted to `messageWidth` and the head is exactly\n // `prefixWidth`, so the line is exactly the terminal width by construction —\n // no trailing clamp, and therefore no risk of cutting a word in half.\n return head + fitMessage(entry, columns);\n}\n\n// One line, fitted to the terminal.\n//\n// What gets sacrificed as space runs out, in order: the timing, then the HTTP\n// status, then the level column, then the *method* — and the path's tail is\n// protected, because the filename is the one thing that still identifies the\n// request. A 40-column terminal gets `…zer/languages/typescript.js` (the\n// extension intact); an 80-column one gets the whole sentence.\nfunction fitMessage(entry, columns) {\n const text = formatMessage(entry);\n const room = messageWidth(columns);\n if (text.length <= room) return text;\n if (!entry.method || !entry.path) return fitPath(text, room);\n\n const status = entry.status === undefined ? '' : ` ${entry.status}`;\n const method = `${entry.method} `;\n // Drop the status before the method, and the method before any of the path.\n const withStatus = method + fitPath(entry.path, room - method.length - status.length) + status;\n if (withStatus.length <= room) return withStatus;\n const withoutStatus = method + fitPath(entry.path, room - method.length);\n if (withoutStatus.length <= room) return withoutStatus;\n // Last resort: the path alone, at exactly the room available. `fitPath` is\n // given the exact width, so this is always exactly `room` — never over, which\n // is what would make the caller's clamp cut the *front* of the line and leave\n // an unreadable tail like `pt.js 200`.\n return fitPath(entry.path, room);\n}\n\n// A summary of suppressed noise renders as a footnote, not an event: dim, and\n// with no level column, so the eye skips it while scanning for real lines. It\n// occupies the same time gutter so it still lines up in the scrollback.\nexport function renderEntry(entry, { color = false, columns }: Record<string, any> = {}) {\n const message = fitMessage(entry, columns);\n const limit = Math.max(8, columns || 80);\n if (entry.summary) {\n const pad = showLevel(columns) ? ' '.repeat(LEVEL_WIDTH) + GUTTER : '';\n return paint(timeColumn(entry, columns), 'gray', color)\n + GUTTER + paint(GUTTER + pad + message, 'gray', color);\n }\n const painted = paint(timeColumn(entry, columns), 'gray', color) + GUTTER\n + (showLevel(columns) ? paint(entryLevel(entry), LEVEL_COLOR[entry.level] || 'gray', color) + GUTTER : '')\n + message;\n // Clamp on *visible* width: the ANSI codes cost nothing on screen, so slicing\n // the painted string by character count would cut a real character and leave\n // the escape sequence unterminated.\n return visibleWidth(painted) <= limit ? painted : trimVisible(painted, limit);\n}\n\n// Visible width, ANSI excluded.\nfunction visibleWidth(text) {\n return String(text).replace(/\\x1b\\[[0-9;]*m/g, '').length;\n}\n\n// Cut a painted string to `max` visible columns, passing escape sequences through\n// and never splitting one, then resetting so the terminal is left clean.\nfunction trimVisible(text, max) {\n const pattern = /\\x1b\\[[0-9;]*m/g;\n let out = '';\n let seen = 0;\n let last = 0;\n let match;\n while ((match = pattern.exec(text)) !== null) {\n const chunk = text.slice(last, match.index);\n if (seen + chunk.length >= max) return out + chunk.slice(0, Math.max(0, max - seen)) + '\\x1b[0m';\n out += chunk + match[0];\n seen += chunk.length;\n last = pattern.lastIndex;\n }\n const rest = text.slice(last);\n return out + (seen + rest.length > max ? rest.slice(0, max - seen) : rest);\n}\n\nfunction entryLevel(entry) {\n return String(entry.level || 'info').toUpperCase().padEnd(LEVEL_WIDTH);\n}\n\n// A human summary of suppressed noise, so silence is never ambiguous. \"Nothing\n// happened\" and \"94 files were served\" are different facts; printing the second\n// as one line every so often keeps the first honest.\nexport function noiseSummary(count, ms = 0) {\n const files = `${count} static file${count === 1 ? '' : 's'}`;\n const took = ms >= 1000 ? ` in ${(ms / 1000).toFixed(1)}s` : ms ? ` in ${ms}ms` : '';\n return `served ${files}${took}`;\n}\n\nexport function logEntry(level, msg, extra: Record<string, any> = {}) {\n const now = new Date();\n return {\n ts: now.toISOString(),\n // Built from the local parts, not `toTimeString()`: that carries a timezone\n // abbreviation whose width changes (`GMT` vs ` PDT`), which is exactly what\n // makes a log column ragged. Always 12 characters, always the reader's clock.\n time: [now.getHours(), now.getMinutes(), now.getSeconds()]\n .map((part) => String(part).padStart(2, '0'))\n .join(':') + '.' + String(now.getMilliseconds()).padStart(3, '0'),\n level,\n msg,\n ...extra,\n };\n}\n\nexport function createLogger(level = process.env.LOG_LEVEL || 'info', options: Record<string, any> = {}) {\n const minLevel = levels[level] ?? levels.info;\n // `pretty` is the default for a terminal *and* for a log file (aligned text is\n // what a person reads at 2am); `ONBOARDER_LOG=json` is the machine escape\n // hatch, and so is a non-TTY consumer that parses stdout.\n const format = options.format || process.env.ONBOARDER_LOG || 'pretty';\n const color = options.color ?? (Boolean(process.stdout.isTTY) && !process.env.NO_COLOR);\n const out = options.stdout || process.stdout;\n const err = options.stderr || process.stderr;\n\n // The noise policy. `info` (the default) drops successful static assets and\n // uptime polls; `debug` shows every request, which is what you want when you\n // are debugging the server rather than watching it. ONBOARDER_LOG_VERBOSE=1 is\n // the same escape hatch without changing the level.\n const quiet = options.quiet ?? (minLevel > levels.debug && process.env.ONBOARDER_LOG_VERBOSE !== '1');\n // Read the terminal width per write, not once at construction: a log line\n // printed after the user resized their window should use the new width.\n const columns = options.columns ?? (() => out.columns || undefined);\n\n // Suppressed-asset accounting. Assets are counted, not printed, and the tally\n // is flushed as ONE dim summary line once it reaches `flushAt` — so a page\n // load that serves 94 files produces one line, and a terminal that is idle\n // still admits the server is busy rather than looking dead.\n const flushAt = options.flushAt ?? 40;\n let suppressed = 0;\n let since = Date.now();\n\n function flush(force = false) {\n if (!suppressed) return;\n if (!force && suppressed < flushAt) return;\n write(logEntry('info', noiseSummary(suppressed, Date.now() - since), { summary: true }));\n suppressed = 0;\n since = Date.now();\n }\n\n function write(entry) {\n if (format === 'json') {\n const line = JSON.stringify(entry) + '\\n';\n (entry.level === 'warn' || entry.level === 'error' ? err : out).write(line);\n return;\n }\n (entry.level === 'warn' || entry.level === 'error' ? err : out).write(renderEntry(entry, { color, columns: columns() }) + '\\n');\n }\n\n function log(lvl, msg, extra: Record<string, any> = {}) {\n if (levels[lvl] < minLevel) return;\n write(logEntry(lvl, msg, extra));\n }\n\n return {\n debug: (msg, extra) => log('debug', msg, extra),\n info: (msg, extra) => log('info', msg, extra),\n warn: (msg, extra) => log('warn', msg, extra),\n error: (msg, extra) => log('error', msg, extra),\n // The one place the noise policy lives. A successful GET of a static file is\n // counted, not printed; a scan, a login, or any failure is printed.\n http: (req) => {\n if (quiet && classifyRequest(req) === 'noise') {\n suppressed += 1;\n flush();\n return;\n }\n if (quiet && classifyPath(req.path) === 'poll') return;\n flush();\n log(Number(req.status) >= 500 ? 'error' : 'info', 'http', req);\n },\n // Let a shutdown path (or a test) get the tally out before the process dies.\n flush: () => flush(true),\n suppressed: () => suppressed,\n };\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { scanIndex } from '../../shared/analyzer/graph.js';
2
+ import { explainFile, explainFolder } from '../../shared/analyzer/explainLocal.js';
3
+ import { docFileRow, fileFactsLine, fileStaticDoc, folderStaticDoc } from '../../shared/analyzer/docs.js';
4
+ import { baseName, dirOf } from '../../shared/analyzer/pathUtil.js';
5
+ import { searchDocuments } from '../apiSearch.js';
6
+ export declare function cachedAnalysis(root: any): any;
7
+ export declare function cachedRoots(): any[];
8
+ export declare function clearAnalysisCache(): void;
9
+ export declare class ToolError extends Error {
10
+ name: string;
11
+ constructor(message: any);
12
+ }
13
+ export declare function analyzeRepository(rootInput: any, { force }?: Record<string, any>): Promise<any>;
14
+ export declare function filesUnder(analysis: any, folder: any): any;
15
+ export declare function parsedFilesUnder(analysis: any, folder: any): any;
16
+ export declare function resolveIn(analysis: any, relPath: any): {
17
+ abs: string;
18
+ rel: string;
19
+ };
20
+ export declare function fileIn(analysis: any, relPath: any): {
21
+ abs: string;
22
+ rel: string;
23
+ file: any;
24
+ };
25
+ export declare function readFileText(analysis: any, relPath: any): Promise<{
26
+ path: string;
27
+ text: string;
28
+ }>;
29
+ export { scanIndex, dirOf, baseName, explainFile, explainFolder, docFileRow, fileFactsLine, fileStaticDoc, folderStaticDoc, searchDocuments, };