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
@@ -9,149 +9,141 @@
9
9
  // place that can be tested.
10
10
  //
11
11
  // No DOM, no imports from the view layer: importable in Node.
12
-
13
12
  // The views that share the Explorer tab and its canvas.
14
13
  export const EXPLORER_VIEWS = ['map', 'files', 'patterns', 'health', 'security', 'history', 'services', 'tour', 'atlas'];
15
-
16
14
  // Views whose default inspector panel is their own, rather than the overview.
17
15
  const PANEL_VIEWS = { patterns: 'patterns', health: 'health', security: 'security', history: 'history' };
18
-
19
16
  // Per-repo state, rebuilt by `loadRepo`. Split out from the rest so "what has
20
17
  // to be reset when a new repo arrives" is a list in one place rather than a
21
18
  // thing you remember — forgetting an entry here is how a new repo inherits the
22
19
  // previous one's open tabs.
23
20
  function perRepo() {
24
- return {
25
- scan: null,
26
- facts: null,
27
- manifest: null,
28
- stack: null,
29
- health: null,
30
- security: null,
31
- history: null,
32
- patterns: null,
33
- treeData: null,
34
- scanId: null,
35
- cloneId: null,
36
- browserSource: null,
37
- view: 'map',
38
- lastExplorer: 'map',
39
- folder: '',
40
- detail: null, // file open in deep-dive, if any
41
- selected: null, // the focused FILE (the inspector's current subject)
42
- focusedFolder: null, // the focused FOLDER subject, when it's a folder
43
- tour: { stops: [], idx: 0 },
44
- currentDiagram: { source: '', nodes: {} },
45
- aiDiagrams: {}, // viewKey -> { body, caption } — unthemed, composed at render
46
- aiActiveKey: null, // which viewKey is currently showing its AI draft
47
- docs: { rendered: false, writing: false, tabs: new Map(), active: 'overview' },
48
- about: { rendered: false },
49
- mm: { expanded: new Set(['dir:']) }, // tree map: open folder/file cells
50
- filters: { text: '', showTests: true, depth: 0 },
51
- atlas: { built: false, items: [] },
52
- atlasOpen: null, // an atlas card currently open on the canvas
53
- code: { path: null, history: [], idx: -1, cache: {} }, // the Code tab
54
- // Deep-analysis engines (semgrep, gitleaks, knip…). `status` is which are
55
- // installed; `report` is the last run; `findings` merge into the security
56
- // view. Only ever filled for a server-side scan — a browser-picked folder
57
- // has no server-visible root for a tool to read.
58
- //
59
- // `install` is per-engine GUI install state ({ running, log, ok, error });
60
- // `options` is the per-engine form values the Configure panel edits.
61
- tools: {
62
- status: null, report: null, running: false, loading: false,
63
- findings: [], merged: 0, error: null,
64
- install: {}, options: {},
65
- },
66
- // The Deep Analysis view's own controls: which findings are on screen, and
67
- // whatever the AI has said about the report so far. Per-repo, so a new scan
68
- // does not inherit the previous repo's filters or its explanation.
69
- analysis: {
70
- severity: 'all', tool: 'all', q: '',
71
- ai: { text: '', error: '', running: false, question: '' },
72
- },
73
- history: null,
74
- };
21
+ return {
22
+ scan: null,
23
+ facts: null,
24
+ manifest: null,
25
+ stack: null,
26
+ health: null,
27
+ security: null,
28
+ history: null,
29
+ patterns: null,
30
+ treeData: null,
31
+ scanId: null,
32
+ cloneId: null,
33
+ browserSource: null,
34
+ view: 'map',
35
+ lastExplorer: 'map',
36
+ folder: '',
37
+ detail: null, // file open in deep-dive, if any
38
+ selected: null, // the focused FILE (the inspector's current subject)
39
+ focusedFolder: null, // the focused FOLDER subject, when it's a folder
40
+ tour: { stops: [], idx: 0 },
41
+ currentDiagram: { source: '', nodes: {} },
42
+ aiDiagrams: {}, // viewKey -> { body, caption } — unthemed, composed at render
43
+ aiActiveKey: null, // which viewKey is currently showing its AI draft
44
+ docs: { rendered: false, writing: false, tabs: new Map(), active: 'overview', tabsEl: null, wrapEl: null, railEl: null, bar: null, pageEl: null },
45
+ about: { rendered: false },
46
+ mm: { expanded: new Set(['dir:']) }, // tree map: open folder/file cells
47
+ filters: { text: '', showTests: true, depth: 0 },
48
+ atlas: { built: false, items: [] },
49
+ atlasOpen: null, // an atlas card currently open on the canvas
50
+ code: { path: null, history: [], idx: -1, cache: {} }, // the Code tab
51
+ // Deep-analysis engines (semgrep, gitleaks, knip…). `status` is which are
52
+ // installed; `report` is the last run; `findings` merge into the security
53
+ // view. Only ever filled for a server-side scan — a browser-picked folder
54
+ // has no server-visible root for a tool to read.
55
+ //
56
+ // `install` is per-engine GUI install state ({ running, log, ok, error });
57
+ // `options` is the per-engine form values the Configure panel edits.
58
+ tools: {
59
+ status: null, report: null, running: false, loading: false,
60
+ findings: [], merged: 0, error: null,
61
+ install: {}, options: {},
62
+ },
63
+ // The Deep Analysis view's own controls: which findings are on screen, and
64
+ // whatever the AI has said about the report so far. Per-repo, so a new scan
65
+ // does not inherit the previous repo's filters or its explanation.
66
+ analysis: {
67
+ severity: 'all', tool: 'all', q: '',
68
+ ai: { text: '', error: '', running: false, question: '' },
69
+ },
70
+ review: { report: null, mode: 'working', base: 'HEAD', head: 'HEAD', profile: '', severity: 'all', query: '', showAcknowledged: false, aiText: '', error: '' },
71
+ };
75
72
  }
76
-
77
73
  export const state = perRepo();
78
-
79
74
  // Replaces the per-repo state wholesale. Anything not listed in `perRepo()`
80
75
  // survives, which is what you want for preferences like the theme.
81
76
  export function loadRepo({ scan, facts, manifest, history, scanId, cloneId }, extra = {}) {
82
- Object.assign(state, perRepo(), {
83
- scan,
84
- facts,
85
- manifest: manifest || { services: [] },
86
- history: history || null,
87
- scanId: scanId || null,
88
- cloneId: cloneId || null,
89
- }, extra);
90
- return state;
77
+ Object.assign(state, perRepo(), {
78
+ scan,
79
+ facts,
80
+ manifest: manifest || { services: [] },
81
+ history: history || null,
82
+ scanId: scanId || null,
83
+ cloneId: cloneId || null,
84
+ }, extra);
85
+ return state;
91
86
  }
92
-
93
87
  export function unloadRepo() {
94
- Object.assign(state, perRepo());
88
+ Object.assign(state, perRepo());
95
89
  }
96
-
97
90
  // Focus: a file and a folder are alternatives, never both. Every selection path
98
91
  // in the app funnels through these, so the inspector can trust that reading
99
92
  // `selected` first and `focusedFolder` second gives an unambiguous subject.
100
93
  export function focusFile(path) {
101
- state.selected = path;
102
- state.focusedFolder = null;
94
+ state.selected = path;
95
+ state.focusedFolder = null;
103
96
  }
104
-
105
97
  export function focusFolder(path) {
106
- state.focusedFolder = path;
107
- state.selected = null;
98
+ state.focusedFolder = path;
99
+ state.selected = null;
108
100
  }
109
-
110
101
  export function clearFocus() {
111
- state.selected = null;
112
- state.focusedFolder = null;
113
- state.detail = null;
102
+ state.selected = null;
103
+ state.focusedFolder = null;
104
+ state.detail = null;
114
105
  }
115
-
116
106
  // Which subject the inspector should show, and the label for the "back" control
117
107
  // that returns to the view's own panel. Pure function of state, so the panel
118
108
  // and the canvas can never disagree about what is focused.
119
109
  export function inspectorSubject(s = state) {
120
- const backLabel = inspectorBackLabel(s);
121
- if (s.selected && s.facts && s.facts.fanIn[s.selected] !== undefined) {
122
- return { kind: 'file', path: s.selected, backLabel };
123
- }
124
- if (s.focusedFolder !== null && s.focusedFolder !== undefined) {
125
- return { kind: 'folder', path: s.focusedFolder, backLabel };
126
- }
127
- if (PANEL_VIEWS[s.view]) return { kind: s.view, backLabel: null };
128
- if (s.view === 'files') return { kind: 'folder', path: s.folder, backLabel };
129
- return { kind: 'overview', backLabel: null };
110
+ const backLabel = inspectorBackLabel(s);
111
+ if (s.selected && s.facts && s.facts.fanIn[s.selected] !== undefined) {
112
+ return { kind: 'file', path: s.selected, backLabel };
113
+ }
114
+ if (s.focusedFolder !== null && s.focusedFolder !== undefined) {
115
+ return { kind: 'folder', path: s.focusedFolder, backLabel };
116
+ }
117
+ if (PANEL_VIEWS[s.view])
118
+ return { kind: s.view, backLabel: null };
119
+ if (s.view === 'files')
120
+ return { kind: 'folder', path: s.folder, backLabel };
121
+ return { kind: 'overview', backLabel: null };
130
122
  }
131
-
132
123
  export function inspectorBackLabel(s = state) {
133
- if (s.view === 'tour') return null; // the tour drives its own focus
134
- if (s.view === 'files') return s.folder ? 'the folder' : 'the overview';
135
- if (PANEL_VIEWS[s.view]) return PANEL_VIEWS[s.view];
136
- return 'the overview';
124
+ if (s.view === 'tour')
125
+ return null; // the tour drives its own focus
126
+ if (s.view === 'files')
127
+ return s.folder ? 'the folder' : 'the overview';
128
+ if (PANEL_VIEWS[s.view])
129
+ return PANEL_VIEWS[s.view];
130
+ return 'the overview';
137
131
  }
138
-
139
132
  export function isExplorerView(view) {
140
- return EXPLORER_VIEWS.includes(view);
133
+ return EXPLORER_VIEWS.includes(view);
141
134
  }
142
-
143
135
  // Which slot in `aiDiagrams` the current view's AI draft belongs to. Two views
144
136
  // that show different pictures must never share a key, or one's draft appears
145
137
  // over the other's diagram.
146
138
  export function aiViewKey(s = state) {
147
- // A tour draft belongs to the stop, not to whatever file was last selected.
148
- if (s.view === 'tour') return `tour:${s.tour.idx}`;
149
- if (s.view === 'atlas') {
150
- return s.atlasOpen ? `atlas:${s.atlasOpen.kind}:${s.atlasOpen.path}` : 'atlas:';
151
- }
152
- return `${s.view}:${s.detail || s.folder || ''}`;
139
+ // A tour draft belongs to the stop, not to whatever file was last selected.
140
+ if (s.view === 'tour')
141
+ return `tour:${s.tour.idx}`;
142
+ if (s.view === 'atlas') {
143
+ return s.atlasOpen ? `atlas:${s.atlasOpen.kind}:${s.atlasOpen.path}` : 'atlas:';
144
+ }
145
+ return `${s.view}:${s.detail || s.folder || ''}`;
153
146
  }
154
-
155
147
  // ---- the Code tab's history ------------------------------------------------
156
148
  //
157
149
  // A browser-style back/forward stack over the files opened in the Code tab.
@@ -159,34 +151,34 @@ export function aiViewKey(s = state) {
159
151
  // opening a new file has to discard the entries in front of the cursor, exactly
160
152
  // as a browser drops the forward stack. That rule is the whole reason this lives
161
153
  // here with a test rather than inline in a render function.
162
-
163
154
  // Which file the Code tab should show when it is asked to render. The chain is
164
155
  // most-specific-first: what the tab already had, then whatever the rest of the
165
156
  // app is looking at, then the repo's own front door, then anything at all.
166
157
  export function defaultCodePath(s = state) {
167
- const { scan, facts, code } = s;
168
- // `facts.entries` holds plain path strings — `graph.js` builds it by mapping
169
- // files to `f.path`. (`facts.hubs`, confusingly, holds objects.) An earlier
170
- // version of this accepted either shape for `entries`; nothing has ever
171
- // produced the object one, and pretending otherwise hid the asymmetry.
172
- return code.path || s.detail || s.selected || facts?.entries?.[0]
173
- || scan?.files?.[0]?.path || scan?.allFiles?.[0] || null;
158
+ const { scan, facts, code } = s;
159
+ // `facts.entries` holds plain path strings — `graph.js` builds it by mapping
160
+ // files to `f.path`. (`facts.hubs`, confusingly, holds objects.) An earlier
161
+ // version of this accepted either shape for `entries`; nothing has ever
162
+ // produced the object one, and pretending otherwise hid the asymmetry.
163
+ return code.path || s.detail || s.selected || facts?.entries?.[0]
164
+ || scan?.files?.[0]?.path || scan?.allFiles?.[0] || null;
174
165
  }
175
-
176
166
  export function pushCodeHistory(path, s = state) {
177
- const h = s.code.history;
178
- if (h[s.code.idx] === path) return; // re-opening the current file is not a move
179
- h.length = s.code.idx + 1; // drop any forward entries
180
- h.push(path);
181
- s.code.idx = h.length - 1;
167
+ const h = s.code.history;
168
+ if (h[s.code.idx] === path)
169
+ return; // re-opening the current file is not a move
170
+ h.length = s.code.idx + 1; // drop any forward entries
171
+ h.push(path);
172
+ s.code.idx = h.length - 1;
182
173
  }
183
-
184
174
  // Moves the cursor by `delta` and reports where it landed, or null if that would
185
175
  // step off either end. The caller opens the returned path; refusing to move and
186
176
  // returning null is how the disabled arrow buttons stay honest.
187
177
  export function codeHistoryTarget(delta, s = state) {
188
- const next = s.code.idx + delta;
189
- if (next < 0 || next >= s.code.history.length) return null;
190
- s.code.idx = next;
191
- return s.code.history[next];
178
+ const next = s.code.idx + delta;
179
+ if (next < 0 || next >= s.code.history.length)
180
+ return null;
181
+ s.code.idx = next;
182
+ return s.code.history[next];
192
183
  }
184
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/public/js/state.ts"],"names":[],"mappings":"AACA,yCAAyC;AACzC,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,4BAA4B;AAC5B,EAAE;AACF,8DAA8D;AAE9D,wDAAwD;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAEzH,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EAAE,CAAC,CAAC,CAAC;WAC5D,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK;IAC7C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACzB,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,4CAA4C;IAChF,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAU,2BAA2B;IAC/D,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,iFAAiF;AACjF,gFAAgF;AAChF,gEAAgE;AAChE,MAAM,UAAU,iBAAiB,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK;IAChD,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC;IAChC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAC3D,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { ReviewReport } from '../../shared/review/contracts.js';\n// The application's state, in one place.\n//\n// This is a plain mutable object, not a reactive store, and that is deliberate.\n// Rendering here is expensive and stateful — the canvas holds a pan/zoom\n// transform, the code tab holds a Monaco editor — so \"every mutation triggers a\n// re-render\" would be both slow and destructive. Callers still decide what to\n// redraw. What this module does own is the state's *invariants*, which used to\n// be maintained by convention in a 2,400-line file and are now enforced in one\n// place that can be tested.\n//\n// No DOM, no imports from the view layer: importable in Node.\n\n// The views that share the Explorer tab and its canvas.\nexport const EXPLORER_VIEWS = ['map', 'files', 'patterns', 'health', 'security', 'history', 'services', 'tour', 'atlas'];\n\n// Views whose default inspector panel is their own, rather than the overview.\nconst PANEL_VIEWS = { patterns: 'patterns', health: 'health', security: 'security', history: 'history' };\n\n// Per-repo state, rebuilt by `loadRepo`. Split out from the rest so \"what has\n// to be reset when a new repo arrives\" is a list in one place rather than a\n// thing you remember — forgetting an entry here is how a new repo inherits the\n// previous one's open tabs.\nfunction perRepo() {\n return {\n scan: null,\n facts: null,\n manifest: null,\n stack: null,\n health: null,\n security: null,\n history: null,\n patterns: null,\n treeData: null,\n scanId: null,\n cloneId: null,\n browserSource: null,\n view: 'map',\n lastExplorer: 'map',\n folder: '',\n detail: null, // file open in deep-dive, if any\n selected: null, // the focused FILE (the inspector's current subject)\n focusedFolder: null, // the focused FOLDER subject, when it's a folder\n tour: { stops: [], idx: 0 },\n currentDiagram: { source: '', nodes: {} },\n aiDiagrams: {}, // viewKey -> { body, caption } — unthemed, composed at render\n aiActiveKey: null, // which viewKey is currently showing its AI draft\n docs: { rendered: false, writing: false, tabs: new Map(), active: 'overview', tabsEl: null as HTMLElement | null, wrapEl: null as HTMLElement | null, railEl: null as HTMLElement | null, bar: null as HTMLElement | null, pageEl: null as HTMLElement | null },\n about: { rendered: false },\n mm: { expanded: new Set(['dir:']) }, // tree map: open folder/file cells\n filters: { text: '', showTests: true, depth: 0 },\n atlas: { built: false, items: [] },\n atlasOpen: null, // an atlas card currently open on the canvas\n code: { path: null, history: [], idx: -1, cache: {} }, // the Code tab\n // Deep-analysis engines (semgrep, gitleaks, knip…). `status` is which are\n // installed; `report` is the last run; `findings` merge into the security\n // view. Only ever filled for a server-side scan — a browser-picked folder\n // has no server-visible root for a tool to read.\n //\n // `install` is per-engine GUI install state ({ running, log, ok, error });\n // `options` is the per-engine form values the Configure panel edits.\n tools: {\n status: null, report: null, running: false, loading: false,\n findings: [], merged: 0, error: null,\n install: {}, options: {},\n },\n // The Deep Analysis view's own controls: which findings are on screen, and\n // whatever the AI has said about the report so far. Per-repo, so a new scan\n // does not inherit the previous repo's filters or its explanation.\n analysis: {\n severity: 'all', tool: 'all', q: '',\n ai: { text: '', error: '', running: false, question: '' },\n },\n review: { report: null as ReviewReport | null, mode: 'working', base: 'HEAD', head: 'HEAD', profile: '', severity: 'all', query: '', showAcknowledged: false, aiText: '', error: '' },\n };\n}\n\nexport const state = perRepo();\n\n// Replaces the per-repo state wholesale. Anything not listed in `perRepo()`\n// survives, which is what you want for preferences like the theme.\nexport function loadRepo({ scan, facts, manifest, history, scanId, cloneId }, extra: Record<string, any> = {}) {\n Object.assign(state, perRepo(), {\n scan,\n facts,\n manifest: manifest || { services: [] },\n history: history || null,\n scanId: scanId || null,\n cloneId: cloneId || null,\n }, extra);\n return state;\n}\n\nexport function unloadRepo() {\n Object.assign(state, perRepo());\n}\n\n// Focus: a file and a folder are alternatives, never both. Every selection path\n// in the app funnels through these, so the inspector can trust that reading\n// `selected` first and `focusedFolder` second gives an unambiguous subject.\nexport function focusFile(path) {\n state.selected = path;\n state.focusedFolder = null;\n}\n\nexport function focusFolder(path) {\n state.focusedFolder = path;\n state.selected = null;\n}\n\nexport function clearFocus() {\n state.selected = null;\n state.focusedFolder = null;\n state.detail = null;\n}\n\n// Which subject the inspector should show, and the label for the \"back\" control\n// that returns to the view's own panel. Pure function of state, so the panel\n// and the canvas can never disagree about what is focused.\nexport function inspectorSubject(s = state) {\n const backLabel = inspectorBackLabel(s);\n if (s.selected && s.facts && s.facts.fanIn[s.selected] !== undefined) {\n return { kind: 'file', path: s.selected, backLabel };\n }\n if (s.focusedFolder !== null && s.focusedFolder !== undefined) {\n return { kind: 'folder', path: s.focusedFolder, backLabel };\n }\n if (PANEL_VIEWS[s.view]) return { kind: s.view, backLabel: null };\n if (s.view === 'files') return { kind: 'folder', path: s.folder, backLabel };\n return { kind: 'overview', backLabel: null };\n}\n\nexport function inspectorBackLabel(s = state) {\n if (s.view === 'tour') return null; // the tour drives its own focus\n if (s.view === 'files') return s.folder ? 'the folder' : 'the overview';\n if (PANEL_VIEWS[s.view]) return PANEL_VIEWS[s.view];\n return 'the overview';\n}\n\nexport function isExplorerView(view) {\n return EXPLORER_VIEWS.includes(view);\n}\n\n// Which slot in `aiDiagrams` the current view's AI draft belongs to. Two views\n// that show different pictures must never share a key, or one's draft appears\n// over the other's diagram.\nexport function aiViewKey(s = state) {\n // A tour draft belongs to the stop, not to whatever file was last selected.\n if (s.view === 'tour') return `tour:${s.tour.idx}`;\n if (s.view === 'atlas') {\n return s.atlasOpen ? `atlas:${s.atlasOpen.kind}:${s.atlasOpen.path}` : 'atlas:';\n }\n return `${s.view}:${s.detail || s.folder || ''}`;\n}\n\n// ---- the Code tab's history ------------------------------------------------\n//\n// A browser-style back/forward stack over the files opened in the Code tab.\n// `idx` is a cursor into `history`, not always its last entry: after going back,\n// opening a new file has to discard the entries in front of the cursor, exactly\n// as a browser drops the forward stack. That rule is the whole reason this lives\n// here with a test rather than inline in a render function.\n\n// Which file the Code tab should show when it is asked to render. The chain is\n// most-specific-first: what the tab already had, then whatever the rest of the\n// app is looking at, then the repo's own front door, then anything at all.\nexport function defaultCodePath(s = state) {\n const { scan, facts, code } = s;\n // `facts.entries` holds plain path strings — `graph.js` builds it by mapping\n // files to `f.path`. (`facts.hubs`, confusingly, holds objects.) An earlier\n // version of this accepted either shape for `entries`; nothing has ever\n // produced the object one, and pretending otherwise hid the asymmetry.\n return code.path || s.detail || s.selected || facts?.entries?.[0]\n || scan?.files?.[0]?.path || scan?.allFiles?.[0] || null;\n}\n\nexport function pushCodeHistory(path, s = state) {\n const h = s.code.history;\n if (h[s.code.idx] === path) return; // re-opening the current file is not a move\n h.length = s.code.idx + 1; // drop any forward entries\n h.push(path);\n s.code.idx = h.length - 1;\n}\n\n// Moves the cursor by `delta` and reports where it landed, or null if that would\n// step off either end. The caller opens the returned path; refusing to move and\n// returning null is how the disabled arrow buttons stay honest.\nexport function codeHistoryTarget(delta, s = state) {\n const next = s.code.idx + delta;\n if (next < 0 || next >= s.code.history.length) return null;\n s.code.idx = next;\n return s.code.history[next];\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { buildTourStops } from '/shared/analyzer/tour.js';
2
+ export { buildTourStops };
3
+ export declare function describeStop(stop: any, index: any, total: any): {
4
+ title: any;
5
+ count: string;
6
+ };
package/public/js/tour.js CHANGED
@@ -4,14 +4,12 @@
4
4
  // same list to an agent, and two copies of "which eight files should a newcomer
5
5
  // read first" would eventually disagree. This module keeps only what is genuinely
6
6
  // the view's — the label the tour bar draws.
7
-
8
7
  import { buildTourStops, tourStopTitle } from '/shared/analyzer/tour.js';
9
-
10
8
  export { buildTourStops };
11
-
12
9
  export function describeStop(stop, index, total) {
13
- return {
14
- title: tourStopTitle(stop),
15
- count: `${index + 1} / ${total}`,
16
- };
10
+ return {
11
+ title: tourStopTitle(stop),
12
+ count: `${index + 1} / ${total}`,
13
+ };
17
14
  }
15
+ //# sourceMappingURL=tour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tour.js","sourceRoot":"","sources":["../../src/public/js/tour.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,mFAAmF;AACnF,gFAAgF;AAChF,kFAAkF;AAClF,6CAA6C;AAE7C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,UAAU,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK;IAC7C,OAAO;QACL,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC;QAC1B,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,MAAM,KAAK,EAAE;KACjC,CAAC;AACJ,CAAC","sourcesContent":["// The guided walk, as the browser sees it.\n//\n// The ordering itself moved to `shared/analyzer/tour.js`: the MCP server hands the\n// same list to an agent, and two copies of \"which eight files should a newcomer\n// read first\" would eventually disagree. This module keeps only what is genuinely\n// the view's — the label the tour bar draws.\n\nimport { buildTourStops, tourStopTitle } from '/shared/analyzer/tour.js';\n\nexport { buildTourStops };\n\nexport function describeStop(stop, index, total) {\n return {\n title: tourStopTitle(stop),\n count: `${index + 1} / ${total}`,\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function withTransition(callback: any): void;
2
+ export declare function setupViewTransitionNames(elements: Record<string, string>): void;
@@ -1,15 +1,14 @@
1
1
  export function withTransition(callback) {
2
- if (document.startViewTransition) {
3
- document.startViewTransition(callback);
4
- } else {
2
+ // Switching a workbench view should not snapshot and animate the entire page.
3
+ // That retains both heavy views during a transition and delays rapid tab changes.
5
4
  callback();
6
- }
7
5
  }
8
-
9
6
  export function setupViewTransitionNames(elements) {
10
- // Utility for adding transition names if needed
11
- Object.entries(elements).forEach(([id, name]) => {
12
- const el = document.getElementById(id);
13
- if (el) el.style.viewTransitionName = name;
14
- });
7
+ // Utility for adding transition names if needed
8
+ Object.entries(elements).forEach(([id, name]) => {
9
+ const el = document.getElementById(id);
10
+ if (el)
11
+ el.style.viewTransitionName = name;
12
+ });
15
13
  }
14
+ //# sourceMappingURL=transitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/public/js/transitions.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,QAAQ;IACrC,8EAA8E;IAC9E,kFAAkF;IAClF,QAAQ,EAAE,CAAC;AACb,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAgC;IACvE,gDAAgD;IAChD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;QAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,EAAE;YAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["export function withTransition(callback) {\n // Switching a workbench view should not snapshot and animate the entire page.\n // That retains both heavy views during a transition and delays rapid tab changes.\n callback();\n}\n\nexport function setupViewTransitionNames(elements: Record<string, string>) {\n // Utility for adding transition names if needed\n Object.entries(elements).forEach(([id, name]) => {\n const el = document.getElementById(id);\n if (el) el.style.viewTransitionName = name;\n });\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export declare function buildTree(allFiles: any): {
2
+ name: string;
3
+ path: string;
4
+ dirs: Map<any, any>;
5
+ files: any[];
6
+ };
7
+ export declare function findNode(root: any, path: any): any;
8
+ export declare function countFiles(node: any): any;
9
+ export declare function pruneTree(root: any, include: any, matchesFolder?: any): any;
10
+ export declare function expandedToDepth(root: any, maxDepth: any): Set<string>;
11
+ export declare function resetOpenState(): void;
12
+ export declare function renderTree(container: any, tree: any, ctx: any): void;