@zbigniewsobiecki/squint 1.0.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 (649) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1065 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.js +5 -0
  5. package/dist/commands/_shared/db-helper.d.ts +18 -0
  6. package/dist/commands/_shared/db-helper.d.ts.map +1 -0
  7. package/dist/commands/_shared/db-helper.js +72 -0
  8. package/dist/commands/_shared/db-helper.js.map +1 -0
  9. package/dist/commands/_shared/flags.d.ts +20 -0
  10. package/dist/commands/_shared/flags.d.ts.map +1 -0
  11. package/dist/commands/_shared/flags.js +38 -0
  12. package/dist/commands/_shared/flags.js.map +1 -0
  13. package/dist/commands/_shared/index.d.ts +6 -0
  14. package/dist/commands/_shared/index.d.ts.map +1 -0
  15. package/dist/commands/_shared/index.js +6 -0
  16. package/dist/commands/_shared/index.js.map +1 -0
  17. package/dist/commands/_shared/output.d.ts +22 -0
  18. package/dist/commands/_shared/output.d.ts.map +1 -0
  19. package/dist/commands/_shared/output.js +36 -0
  20. package/dist/commands/_shared/output.js.map +1 -0
  21. package/dist/commands/_shared/source-reader.d.ts +23 -0
  22. package/dist/commands/_shared/source-reader.d.ts.map +1 -0
  23. package/dist/commands/_shared/source-reader.js +45 -0
  24. package/dist/commands/_shared/source-reader.js.map +1 -0
  25. package/dist/commands/_shared/symbol-resolver.d.ts +35 -0
  26. package/dist/commands/_shared/symbol-resolver.d.ts.map +1 -0
  27. package/dist/commands/_shared/symbol-resolver.js +102 -0
  28. package/dist/commands/_shared/symbol-resolver.js.map +1 -0
  29. package/dist/commands/browse.d.ts +13 -0
  30. package/dist/commands/browse.d.ts.map +1 -0
  31. package/dist/commands/browse.js +106 -0
  32. package/dist/commands/browse.js.map +1 -0
  33. package/dist/commands/domains/create.d.ts +15 -0
  34. package/dist/commands/domains/create.d.ts.map +1 -0
  35. package/dist/commands/domains/create.js +34 -0
  36. package/dist/commands/domains/create.js.map +1 -0
  37. package/dist/commands/domains/delete.d.ts +14 -0
  38. package/dist/commands/domains/delete.d.ts.map +1 -0
  39. package/dist/commands/domains/delete.js +41 -0
  40. package/dist/commands/domains/delete.js.map +1 -0
  41. package/dist/commands/domains/index.d.ts +2 -0
  42. package/dist/commands/domains/index.d.ts.map +1 -0
  43. package/dist/commands/domains/index.js +2 -0
  44. package/dist/commands/domains/index.js.map +1 -0
  45. package/dist/commands/domains/list.d.ts +12 -0
  46. package/dist/commands/domains/list.d.ts.map +1 -0
  47. package/dist/commands/domains/list.js +67 -0
  48. package/dist/commands/domains/list.js.map +1 -0
  49. package/dist/commands/domains/merge.d.ts +14 -0
  50. package/dist/commands/domains/merge.d.ts.map +1 -0
  51. package/dist/commands/domains/merge.js +40 -0
  52. package/dist/commands/domains/merge.js.map +1 -0
  53. package/dist/commands/domains/rename.d.ts +14 -0
  54. package/dist/commands/domains/rename.d.ts.map +1 -0
  55. package/dist/commands/domains/rename.js +33 -0
  56. package/dist/commands/domains/rename.js.map +1 -0
  57. package/dist/commands/domains/show.d.ts +14 -0
  58. package/dist/commands/domains/show.d.ts.map +1 -0
  59. package/dist/commands/domains/show.js +47 -0
  60. package/dist/commands/domains/show.js.map +1 -0
  61. package/dist/commands/domains/sync.d.ts +11 -0
  62. package/dist/commands/domains/sync.d.ts.map +1 -0
  63. package/dist/commands/domains/sync.js +33 -0
  64. package/dist/commands/domains/sync.js.map +1 -0
  65. package/dist/commands/domains/update.d.ts +14 -0
  66. package/dist/commands/domains/update.d.ts.map +1 -0
  67. package/dist/commands/domains/update.js +28 -0
  68. package/dist/commands/domains/update.js.map +1 -0
  69. package/dist/commands/features/assign.d.ts +16 -0
  70. package/dist/commands/features/assign.d.ts.map +1 -0
  71. package/dist/commands/features/assign.js +51 -0
  72. package/dist/commands/features/assign.js.map +1 -0
  73. package/dist/commands/features/create.d.ts +15 -0
  74. package/dist/commands/features/create.d.ts.map +1 -0
  75. package/dist/commands/features/create.js +30 -0
  76. package/dist/commands/features/create.js.map +1 -0
  77. package/dist/commands/features/delete.d.ts +14 -0
  78. package/dist/commands/features/delete.d.ts.map +1 -0
  79. package/dist/commands/features/delete.js +37 -0
  80. package/dist/commands/features/delete.js.map +1 -0
  81. package/dist/commands/features/generate.d.ts +34 -0
  82. package/dist/commands/features/generate.d.ts.map +1 -0
  83. package/dist/commands/features/generate.js +178 -0
  84. package/dist/commands/features/generate.js.map +1 -0
  85. package/dist/commands/features/index.d.ts +2 -0
  86. package/dist/commands/features/index.d.ts.map +1 -0
  87. package/dist/commands/features/index.js +2 -0
  88. package/dist/commands/features/index.js.map +1 -0
  89. package/dist/commands/features/list.d.ts +11 -0
  90. package/dist/commands/features/list.d.ts.map +1 -0
  91. package/dist/commands/features/list.js +45 -0
  92. package/dist/commands/features/list.js.map +1 -0
  93. package/dist/commands/features/show.d.ts +15 -0
  94. package/dist/commands/features/show.d.ts.map +1 -0
  95. package/dist/commands/features/show.js +61 -0
  96. package/dist/commands/features/show.js.map +1 -0
  97. package/dist/commands/features/unassign.d.ts +16 -0
  98. package/dist/commands/features/unassign.d.ts.map +1 -0
  99. package/dist/commands/features/unassign.js +55 -0
  100. package/dist/commands/features/unassign.js.map +1 -0
  101. package/dist/commands/features/update.d.ts +16 -0
  102. package/dist/commands/features/update.d.ts.map +1 -0
  103. package/dist/commands/features/update.js +54 -0
  104. package/dist/commands/features/update.js.map +1 -0
  105. package/dist/commands/files/imported-by.d.ts +13 -0
  106. package/dist/commands/files/imported-by.d.ts.map +1 -0
  107. package/dist/commands/files/imported-by.js +40 -0
  108. package/dist/commands/files/imported-by.js.map +1 -0
  109. package/dist/commands/files/imports.d.ts +14 -0
  110. package/dist/commands/files/imports.d.ts.map +1 -0
  111. package/dist/commands/files/imports.js +48 -0
  112. package/dist/commands/files/imports.js.map +1 -0
  113. package/dist/commands/files/index.d.ts +2 -0
  114. package/dist/commands/files/index.d.ts.map +1 -0
  115. package/dist/commands/files/index.js +2 -0
  116. package/dist/commands/files/index.js.map +1 -0
  117. package/dist/commands/files/list.d.ts +11 -0
  118. package/dist/commands/files/list.d.ts.map +1 -0
  119. package/dist/commands/files/list.js +35 -0
  120. package/dist/commands/files/list.js.map +1 -0
  121. package/dist/commands/files/orphans.d.ts +12 -0
  122. package/dist/commands/files/orphans.d.ts.map +1 -0
  123. package/dist/commands/files/orphans.js +43 -0
  124. package/dist/commands/files/orphans.js.map +1 -0
  125. package/dist/commands/files/show.d.ts +14 -0
  126. package/dist/commands/files/show.d.ts.map +1 -0
  127. package/dist/commands/files/show.js +95 -0
  128. package/dist/commands/files/show.js.map +1 -0
  129. package/dist/commands/flows/add-step.d.ts +19 -0
  130. package/dist/commands/flows/add-step.d.ts.map +1 -0
  131. package/dist/commands/flows/add-step.js +46 -0
  132. package/dist/commands/flows/add-step.js.map +1 -0
  133. package/dist/commands/flows/create.d.ts +17 -0
  134. package/dist/commands/flows/create.d.ts.map +1 -0
  135. package/dist/commands/flows/create.js +39 -0
  136. package/dist/commands/flows/create.js.map +1 -0
  137. package/dist/commands/flows/delete.d.ts +14 -0
  138. package/dist/commands/flows/delete.d.ts.map +1 -0
  139. package/dist/commands/flows/delete.js +37 -0
  140. package/dist/commands/flows/delete.js.map +1 -0
  141. package/dist/commands/flows/generate.d.ts +50 -0
  142. package/dist/commands/flows/generate.d.ts.map +1 -0
  143. package/dist/commands/flows/generate.js +438 -0
  144. package/dist/commands/flows/generate.js.map +1 -0
  145. package/dist/commands/flows/index.d.ts +2 -0
  146. package/dist/commands/flows/index.d.ts.map +1 -0
  147. package/dist/commands/flows/index.js +2 -0
  148. package/dist/commands/flows/index.js.map +1 -0
  149. package/dist/commands/flows/list.d.ts +12 -0
  150. package/dist/commands/flows/list.d.ts.map +1 -0
  151. package/dist/commands/flows/list.js +98 -0
  152. package/dist/commands/flows/list.js.map +1 -0
  153. package/dist/commands/flows/remove-step.d.ts +18 -0
  154. package/dist/commands/flows/remove-step.d.ts.map +1 -0
  155. package/dist/commands/flows/remove-step.js +41 -0
  156. package/dist/commands/flows/remove-step.js.map +1 -0
  157. package/dist/commands/flows/show.d.ts +17 -0
  158. package/dist/commands/flows/show.d.ts.map +1 -0
  159. package/dist/commands/flows/show.js +136 -0
  160. package/dist/commands/flows/show.js.map +1 -0
  161. package/dist/commands/flows/trace.d.ts +22 -0
  162. package/dist/commands/flows/trace.d.ts.map +1 -0
  163. package/dist/commands/flows/trace.js +217 -0
  164. package/dist/commands/flows/trace.js.map +1 -0
  165. package/dist/commands/flows/update.d.ts +17 -0
  166. package/dist/commands/flows/update.d.ts.map +1 -0
  167. package/dist/commands/flows/update.js +60 -0
  168. package/dist/commands/flows/update.js.map +1 -0
  169. package/dist/commands/flows/verify.d.ts +21 -0
  170. package/dist/commands/flows/verify.d.ts.map +1 -0
  171. package/dist/commands/flows/verify.js +123 -0
  172. package/dist/commands/flows/verify.js.map +1 -0
  173. package/dist/commands/gaps.d.ts +14 -0
  174. package/dist/commands/gaps.d.ts.map +1 -0
  175. package/dist/commands/gaps.js +184 -0
  176. package/dist/commands/gaps.js.map +1 -0
  177. package/dist/commands/hierarchy/index.d.ts +20 -0
  178. package/dist/commands/hierarchy/index.d.ts.map +1 -0
  179. package/dist/commands/hierarchy/index.js +344 -0
  180. package/dist/commands/hierarchy/index.js.map +1 -0
  181. package/dist/commands/ingest.d.ts +23 -0
  182. package/dist/commands/ingest.d.ts.map +1 -0
  183. package/dist/commands/ingest.js +249 -0
  184. package/dist/commands/ingest.js.map +1 -0
  185. package/dist/commands/interactions/create.d.ts +16 -0
  186. package/dist/commands/interactions/create.d.ts.map +1 -0
  187. package/dist/commands/interactions/create.js +58 -0
  188. package/dist/commands/interactions/create.js.map +1 -0
  189. package/dist/commands/interactions/delete.d.ts +16 -0
  190. package/dist/commands/interactions/delete.d.ts.map +1 -0
  191. package/dist/commands/interactions/delete.js +28 -0
  192. package/dist/commands/interactions/delete.js.map +1 -0
  193. package/dist/commands/interactions/generate.d.ts +62 -0
  194. package/dist/commands/interactions/generate.d.ts.map +1 -0
  195. package/dist/commands/interactions/generate.js +870 -0
  196. package/dist/commands/interactions/generate.js.map +1 -0
  197. package/dist/commands/interactions/index.d.ts +2 -0
  198. package/dist/commands/interactions/index.d.ts.map +1 -0
  199. package/dist/commands/interactions/index.js +2 -0
  200. package/dist/commands/interactions/index.js.map +1 -0
  201. package/dist/commands/interactions/list.d.ts +15 -0
  202. package/dist/commands/interactions/list.d.ts.map +1 -0
  203. package/dist/commands/interactions/list.js +127 -0
  204. package/dist/commands/interactions/list.js.map +1 -0
  205. package/dist/commands/interactions/show.d.ts +17 -0
  206. package/dist/commands/interactions/show.d.ts.map +1 -0
  207. package/dist/commands/interactions/show.js +80 -0
  208. package/dist/commands/interactions/show.js.map +1 -0
  209. package/dist/commands/interactions/update.d.ts +20 -0
  210. package/dist/commands/interactions/update.d.ts.map +1 -0
  211. package/dist/commands/interactions/update.js +57 -0
  212. package/dist/commands/interactions/update.js.map +1 -0
  213. package/dist/commands/interactions/validate.d.ts +12 -0
  214. package/dist/commands/interactions/validate.d.ts.map +1 -0
  215. package/dist/commands/interactions/validate.js +94 -0
  216. package/dist/commands/interactions/validate.js.map +1 -0
  217. package/dist/commands/interactions/verify.d.ts +18 -0
  218. package/dist/commands/interactions/verify.d.ts.map +1 -0
  219. package/dist/commands/interactions/verify.js +127 -0
  220. package/dist/commands/interactions/verify.js.map +1 -0
  221. package/dist/commands/llm/_shared/base-llm-command.d.ts +44 -0
  222. package/dist/commands/llm/_shared/base-llm-command.d.ts.map +1 -0
  223. package/dist/commands/llm/_shared/base-llm-command.js +73 -0
  224. package/dist/commands/llm/_shared/base-llm-command.js.map +1 -0
  225. package/dist/commands/llm/_shared/coverage.d.ts +61 -0
  226. package/dist/commands/llm/_shared/coverage.d.ts.map +1 -0
  227. package/dist/commands/llm/_shared/coverage.js +161 -0
  228. package/dist/commands/llm/_shared/coverage.js.map +1 -0
  229. package/dist/commands/llm/_shared/csv-utils.d.ts +65 -0
  230. package/dist/commands/llm/_shared/csv-utils.d.ts.map +1 -0
  231. package/dist/commands/llm/_shared/csv-utils.js +231 -0
  232. package/dist/commands/llm/_shared/csv-utils.js.map +1 -0
  233. package/dist/commands/llm/_shared/csv.d.ts +44 -0
  234. package/dist/commands/llm/_shared/csv.d.ts.map +1 -0
  235. package/dist/commands/llm/_shared/csv.js +76 -0
  236. package/dist/commands/llm/_shared/csv.js.map +1 -0
  237. package/dist/commands/llm/_shared/entity-utils.d.ts +11 -0
  238. package/dist/commands/llm/_shared/entity-utils.d.ts.map +1 -0
  239. package/dist/commands/llm/_shared/entity-utils.js +87 -0
  240. package/dist/commands/llm/_shared/entity-utils.js.map +1 -0
  241. package/dist/commands/llm/_shared/flow-csv.d.ts +74 -0
  242. package/dist/commands/llm/_shared/flow-csv.d.ts.map +1 -0
  243. package/dist/commands/llm/_shared/flow-csv.js +198 -0
  244. package/dist/commands/llm/_shared/flow-csv.js.map +1 -0
  245. package/dist/commands/llm/_shared/flow-prompts.d.ts +61 -0
  246. package/dist/commands/llm/_shared/flow-prompts.d.ts.map +1 -0
  247. package/dist/commands/llm/_shared/flow-prompts.js +281 -0
  248. package/dist/commands/llm/_shared/flow-prompts.js.map +1 -0
  249. package/dist/commands/llm/_shared/flow-validation.d.ts +69 -0
  250. package/dist/commands/llm/_shared/flow-validation.d.ts.map +1 -0
  251. package/dist/commands/llm/_shared/flow-validation.js +176 -0
  252. package/dist/commands/llm/_shared/flow-validation.js.map +1 -0
  253. package/dist/commands/llm/_shared/llm-utils.d.ts +88 -0
  254. package/dist/commands/llm/_shared/llm-utils.d.ts.map +1 -0
  255. package/dist/commands/llm/_shared/llm-utils.js +256 -0
  256. package/dist/commands/llm/_shared/llm-utils.js.map +1 -0
  257. package/dist/commands/llm/_shared/module-csv.d.ts +76 -0
  258. package/dist/commands/llm/_shared/module-csv.d.ts.map +1 -0
  259. package/dist/commands/llm/_shared/module-csv.js +196 -0
  260. package/dist/commands/llm/_shared/module-csv.js.map +1 -0
  261. package/dist/commands/llm/_shared/module-prompts.d.ts +107 -0
  262. package/dist/commands/llm/_shared/module-prompts.d.ts.map +1 -0
  263. package/dist/commands/llm/_shared/module-prompts.js +395 -0
  264. package/dist/commands/llm/_shared/module-prompts.js.map +1 -0
  265. package/dist/commands/llm/_shared/process-utils.d.ts +52 -0
  266. package/dist/commands/llm/_shared/process-utils.d.ts.map +1 -0
  267. package/dist/commands/llm/_shared/process-utils.js +214 -0
  268. package/dist/commands/llm/_shared/process-utils.js.map +1 -0
  269. package/dist/commands/llm/_shared/prompts.d.ts +132 -0
  270. package/dist/commands/llm/_shared/prompts.d.ts.map +1 -0
  271. package/dist/commands/llm/_shared/prompts.js +391 -0
  272. package/dist/commands/llm/_shared/prompts.js.map +1 -0
  273. package/dist/commands/llm/_shared/pure-check.d.ts +10 -0
  274. package/dist/commands/llm/_shared/pure-check.d.ts.map +1 -0
  275. package/dist/commands/llm/_shared/pure-check.js +449 -0
  276. package/dist/commands/llm/_shared/pure-check.js.map +1 -0
  277. package/dist/commands/llm/_shared/verify/content-verifier.d.ts +40 -0
  278. package/dist/commands/llm/_shared/verify/content-verifier.d.ts.map +1 -0
  279. package/dist/commands/llm/_shared/verify/content-verifier.js +247 -0
  280. package/dist/commands/llm/_shared/verify/content-verifier.js.map +1 -0
  281. package/dist/commands/llm/_shared/verify/coverage-checker.d.ts +34 -0
  282. package/dist/commands/llm/_shared/verify/coverage-checker.d.ts.map +1 -0
  283. package/dist/commands/llm/_shared/verify/coverage-checker.js +1096 -0
  284. package/dist/commands/llm/_shared/verify/coverage-checker.js.map +1 -0
  285. package/dist/commands/llm/_shared/verify/verify-prompts.d.ts +30 -0
  286. package/dist/commands/llm/_shared/verify/verify-prompts.d.ts.map +1 -0
  287. package/dist/commands/llm/_shared/verify/verify-prompts.js +118 -0
  288. package/dist/commands/llm/_shared/verify/verify-prompts.js.map +1 -0
  289. package/dist/commands/llm/_shared/verify/verify-types.d.ts +47 -0
  290. package/dist/commands/llm/_shared/verify/verify-types.d.ts.map +1 -0
  291. package/dist/commands/llm/_shared/verify/verify-types.js +2 -0
  292. package/dist/commands/llm/_shared/verify/verify-types.js.map +1 -0
  293. package/dist/commands/llm/annotate.d.ts +7 -0
  294. package/dist/commands/llm/annotate.d.ts.map +1 -0
  295. package/dist/commands/llm/annotate.js +11 -0
  296. package/dist/commands/llm/annotate.js.map +1 -0
  297. package/dist/commands/llm/features/feature-grouper.d.ts +31 -0
  298. package/dist/commands/llm/features/feature-grouper.d.ts.map +1 -0
  299. package/dist/commands/llm/features/feature-grouper.js +223 -0
  300. package/dist/commands/llm/features/feature-grouper.js.map +1 -0
  301. package/dist/commands/llm/features/index.d.ts +6 -0
  302. package/dist/commands/llm/features/index.d.ts.map +1 -0
  303. package/dist/commands/llm/features/index.js +6 -0
  304. package/dist/commands/llm/features/index.js.map +1 -0
  305. package/dist/commands/llm/features/types.d.ts +10 -0
  306. package/dist/commands/llm/features/types.d.ts.map +1 -0
  307. package/dist/commands/llm/features/types.js +5 -0
  308. package/dist/commands/llm/features/types.js.map +1 -0
  309. package/dist/commands/llm/features.d.ts +7 -0
  310. package/dist/commands/llm/features.d.ts.map +1 -0
  311. package/dist/commands/llm/features.js +11 -0
  312. package/dist/commands/llm/features.js.map +1 -0
  313. package/dist/commands/llm/flows/atomic-flow-builder.d.ts +51 -0
  314. package/dist/commands/llm/flows/atomic-flow-builder.d.ts.map +1 -0
  315. package/dist/commands/llm/flows/atomic-flow-builder.js +247 -0
  316. package/dist/commands/llm/flows/atomic-flow-builder.js.map +1 -0
  317. package/dist/commands/llm/flows/dedup.d.ts +18 -0
  318. package/dist/commands/llm/flows/dedup.d.ts.map +1 -0
  319. package/dist/commands/llm/flows/dedup.js +76 -0
  320. package/dist/commands/llm/flows/dedup.js.map +1 -0
  321. package/dist/commands/llm/flows/entry-point-detector.d.ts +41 -0
  322. package/dist/commands/llm/flows/entry-point-detector.d.ts.map +1 -0
  323. package/dist/commands/llm/flows/entry-point-detector.js +388 -0
  324. package/dist/commands/llm/flows/entry-point-detector.js.map +1 -0
  325. package/dist/commands/llm/flows/flow-enhancer.d.ts +21 -0
  326. package/dist/commands/llm/flows/flow-enhancer.d.ts.map +1 -0
  327. package/dist/commands/llm/flows/flow-enhancer.js +166 -0
  328. package/dist/commands/llm/flows/flow-enhancer.js.map +1 -0
  329. package/dist/commands/llm/flows/flow-tracer.d.ts +50 -0
  330. package/dist/commands/llm/flows/flow-tracer.d.ts.map +1 -0
  331. package/dist/commands/llm/flows/flow-tracer.js +271 -0
  332. package/dist/commands/llm/flows/flow-tracer.js.map +1 -0
  333. package/dist/commands/llm/flows/flow-validator.d.ts +31 -0
  334. package/dist/commands/llm/flows/flow-validator.d.ts.map +1 -0
  335. package/dist/commands/llm/flows/flow-validator.js +262 -0
  336. package/dist/commands/llm/flows/flow-validator.js.map +1 -0
  337. package/dist/commands/llm/flows/gap-flow-generator.d.ts +13 -0
  338. package/dist/commands/llm/flows/gap-flow-generator.d.ts.map +1 -0
  339. package/dist/commands/llm/flows/gap-flow-generator.js +48 -0
  340. package/dist/commands/llm/flows/gap-flow-generator.js.map +1 -0
  341. package/dist/commands/llm/flows/index.d.ts +12 -0
  342. package/dist/commands/llm/flows/index.d.ts.map +1 -0
  343. package/dist/commands/llm/flows/index.js +12 -0
  344. package/dist/commands/llm/flows/index.js.map +1 -0
  345. package/dist/commands/llm/flows/types.d.ts +87 -0
  346. package/dist/commands/llm/flows/types.d.ts.map +1 -0
  347. package/dist/commands/llm/flows/types.js +5 -0
  348. package/dist/commands/llm/flows/types.js.map +1 -0
  349. package/dist/commands/llm/flows.d.ts +7 -0
  350. package/dist/commands/llm/flows.d.ts.map +1 -0
  351. package/dist/commands/llm/flows.js +11 -0
  352. package/dist/commands/llm/flows.js.map +1 -0
  353. package/dist/commands/llm/interactions.d.ts +7 -0
  354. package/dist/commands/llm/interactions.d.ts.map +1 -0
  355. package/dist/commands/llm/interactions.js +11 -0
  356. package/dist/commands/llm/interactions.js.map +1 -0
  357. package/dist/commands/llm/modules.d.ts +7 -0
  358. package/dist/commands/llm/modules.d.ts.map +1 -0
  359. package/dist/commands/llm/modules.js +11 -0
  360. package/dist/commands/llm/modules.js.map +1 -0
  361. package/dist/commands/llm/relationships.d.ts +7 -0
  362. package/dist/commands/llm/relationships.d.ts.map +1 -0
  363. package/dist/commands/llm/relationships.js +11 -0
  364. package/dist/commands/llm/relationships.js.map +1 -0
  365. package/dist/commands/modules/assign.d.ts +14 -0
  366. package/dist/commands/modules/assign.d.ts.map +1 -0
  367. package/dist/commands/modules/assign.js +54 -0
  368. package/dist/commands/modules/assign.js.map +1 -0
  369. package/dist/commands/modules/create.d.ts +16 -0
  370. package/dist/commands/modules/create.d.ts.map +1 -0
  371. package/dist/commands/modules/create.js +37 -0
  372. package/dist/commands/modules/create.js.map +1 -0
  373. package/dist/commands/modules/delete.d.ts +14 -0
  374. package/dist/commands/modules/delete.d.ts.map +1 -0
  375. package/dist/commands/modules/delete.js +54 -0
  376. package/dist/commands/modules/delete.js.map +1 -0
  377. package/dist/commands/modules/generate.d.ts +84 -0
  378. package/dist/commands/modules/generate.d.ts.map +1 -0
  379. package/dist/commands/modules/generate.js +1234 -0
  380. package/dist/commands/modules/generate.js.map +1 -0
  381. package/dist/commands/modules/index.d.ts +2 -0
  382. package/dist/commands/modules/index.d.ts.map +1 -0
  383. package/dist/commands/modules/index.js +2 -0
  384. package/dist/commands/modules/index.js.map +1 -0
  385. package/dist/commands/modules/list.d.ts +13 -0
  386. package/dist/commands/modules/list.d.ts.map +1 -0
  387. package/dist/commands/modules/list.js +92 -0
  388. package/dist/commands/modules/list.js.map +1 -0
  389. package/dist/commands/modules/prune.d.ts +10 -0
  390. package/dist/commands/modules/prune.d.ts.map +1 -0
  391. package/dist/commands/modules/prune.js +23 -0
  392. package/dist/commands/modules/prune.js.map +1 -0
  393. package/dist/commands/modules/show.d.ts +15 -0
  394. package/dist/commands/modules/show.d.ts.map +1 -0
  395. package/dist/commands/modules/show.js +95 -0
  396. package/dist/commands/modules/show.js.map +1 -0
  397. package/dist/commands/modules/unassign.d.ts +13 -0
  398. package/dist/commands/modules/unassign.d.ts.map +1 -0
  399. package/dist/commands/modules/unassign.js +49 -0
  400. package/dist/commands/modules/unassign.js.map +1 -0
  401. package/dist/commands/modules/update.d.ts +15 -0
  402. package/dist/commands/modules/update.d.ts.map +1 -0
  403. package/dist/commands/modules/update.js +50 -0
  404. package/dist/commands/modules/update.js.map +1 -0
  405. package/dist/commands/modules/verify.d.ts +18 -0
  406. package/dist/commands/modules/verify.d.ts.map +1 -0
  407. package/dist/commands/modules/verify.js +114 -0
  408. package/dist/commands/modules/verify.js.map +1 -0
  409. package/dist/commands/overview.d.ts +12 -0
  410. package/dist/commands/overview.d.ts.map +1 -0
  411. package/dist/commands/overview.js +219 -0
  412. package/dist/commands/overview.js.map +1 -0
  413. package/dist/commands/parse.d.ts +30 -0
  414. package/dist/commands/parse.d.ts.map +1 -0
  415. package/dist/commands/parse.js +211 -0
  416. package/dist/commands/parse.js.map +1 -0
  417. package/dist/commands/process-groups/index.d.ts +2 -0
  418. package/dist/commands/process-groups/index.d.ts.map +1 -0
  419. package/dist/commands/process-groups/index.js +2 -0
  420. package/dist/commands/process-groups/index.js.map +1 -0
  421. package/dist/commands/process-groups/list.d.ts +11 -0
  422. package/dist/commands/process-groups/list.d.ts.map +1 -0
  423. package/dist/commands/process-groups/list.js +98 -0
  424. package/dist/commands/process-groups/list.js.map +1 -0
  425. package/dist/commands/relationships/annotate.d.ts +27 -0
  426. package/dist/commands/relationships/annotate.d.ts.map +1 -0
  427. package/dist/commands/relationships/annotate.js +453 -0
  428. package/dist/commands/relationships/annotate.js.map +1 -0
  429. package/dist/commands/relationships/index.d.ts +2 -0
  430. package/dist/commands/relationships/index.d.ts.map +1 -0
  431. package/dist/commands/relationships/index.js +2 -0
  432. package/dist/commands/relationships/index.js.map +1 -0
  433. package/dist/commands/relationships/list.d.ts +18 -0
  434. package/dist/commands/relationships/list.d.ts.map +1 -0
  435. package/dist/commands/relationships/list.js +147 -0
  436. package/dist/commands/relationships/list.js.map +1 -0
  437. package/dist/commands/relationships/next.d.ts +17 -0
  438. package/dist/commands/relationships/next.d.ts.map +1 -0
  439. package/dist/commands/relationships/next.js +178 -0
  440. package/dist/commands/relationships/next.js.map +1 -0
  441. package/dist/commands/relationships/set.d.ts +19 -0
  442. package/dist/commands/relationships/set.d.ts.map +1 -0
  443. package/dist/commands/relationships/set.js +65 -0
  444. package/dist/commands/relationships/set.js.map +1 -0
  445. package/dist/commands/relationships/show.d.ts +13 -0
  446. package/dist/commands/relationships/show.d.ts.map +1 -0
  447. package/dist/commands/relationships/show.js +59 -0
  448. package/dist/commands/relationships/show.js.map +1 -0
  449. package/dist/commands/relationships/unset.d.ts +16 -0
  450. package/dist/commands/relationships/unset.d.ts.map +1 -0
  451. package/dist/commands/relationships/unset.js +62 -0
  452. package/dist/commands/relationships/unset.js.map +1 -0
  453. package/dist/commands/relationships/verify.d.ts +24 -0
  454. package/dist/commands/relationships/verify.d.ts.map +1 -0
  455. package/dist/commands/relationships/verify.js +328 -0
  456. package/dist/commands/relationships/verify.js.map +1 -0
  457. package/dist/commands/stats.d.ts +11 -0
  458. package/dist/commands/stats.d.ts.map +1 -0
  459. package/dist/commands/stats.js +207 -0
  460. package/dist/commands/stats.js.map +1 -0
  461. package/dist/commands/symbols/annotate.d.ts +32 -0
  462. package/dist/commands/symbols/annotate.d.ts.map +1 -0
  463. package/dist/commands/symbols/annotate.js +862 -0
  464. package/dist/commands/symbols/annotate.js.map +1 -0
  465. package/dist/commands/symbols/deps.d.ts +18 -0
  466. package/dist/commands/symbols/deps.d.ts.map +1 -0
  467. package/dist/commands/symbols/deps.js +104 -0
  468. package/dist/commands/symbols/deps.js.map +1 -0
  469. package/dist/commands/symbols/index.d.ts +2 -0
  470. package/dist/commands/symbols/index.d.ts.map +1 -0
  471. package/dist/commands/symbols/index.js +2 -0
  472. package/dist/commands/symbols/index.js.map +1 -0
  473. package/dist/commands/symbols/list.d.ts +17 -0
  474. package/dist/commands/symbols/list.d.ts.map +1 -0
  475. package/dist/commands/symbols/list.js +136 -0
  476. package/dist/commands/symbols/list.js.map +1 -0
  477. package/dist/commands/symbols/next.d.ts +15 -0
  478. package/dist/commands/symbols/next.d.ts.map +1 -0
  479. package/dist/commands/symbols/next.js +147 -0
  480. package/dist/commands/symbols/next.js.map +1 -0
  481. package/dist/commands/symbols/prereqs.d.ts +18 -0
  482. package/dist/commands/symbols/prereqs.d.ts.map +1 -0
  483. package/dist/commands/symbols/prereqs.js +107 -0
  484. package/dist/commands/symbols/prereqs.js.map +1 -0
  485. package/dist/commands/symbols/ready.d.ts +17 -0
  486. package/dist/commands/symbols/ready.d.ts.map +1 -0
  487. package/dist/commands/symbols/ready.js +126 -0
  488. package/dist/commands/symbols/ready.js.map +1 -0
  489. package/dist/commands/symbols/set.d.ts +27 -0
  490. package/dist/commands/symbols/set.d.ts.map +1 -0
  491. package/dist/commands/symbols/set.js +241 -0
  492. package/dist/commands/symbols/set.js.map +1 -0
  493. package/dist/commands/symbols/show.d.ts +19 -0
  494. package/dist/commands/symbols/show.d.ts.map +1 -0
  495. package/dist/commands/symbols/show.js +182 -0
  496. package/dist/commands/symbols/show.js.map +1 -0
  497. package/dist/commands/symbols/understood.d.ts +15 -0
  498. package/dist/commands/symbols/understood.d.ts.map +1 -0
  499. package/dist/commands/symbols/understood.js +101 -0
  500. package/dist/commands/symbols/understood.js.map +1 -0
  501. package/dist/commands/symbols/unset.d.ts +16 -0
  502. package/dist/commands/symbols/unset.d.ts.map +1 -0
  503. package/dist/commands/symbols/unset.js +48 -0
  504. package/dist/commands/symbols/unset.js.map +1 -0
  505. package/dist/commands/symbols/verify.d.ts +25 -0
  506. package/dist/commands/symbols/verify.d.ts.map +1 -0
  507. package/dist/commands/symbols/verify.js +360 -0
  508. package/dist/commands/symbols/verify.js.map +1 -0
  509. package/dist/db/connection.d.ts +14 -0
  510. package/dist/db/connection.d.ts.map +1 -0
  511. package/dist/db/connection.js +37 -0
  512. package/dist/db/connection.js.map +1 -0
  513. package/dist/db/database-facade.d.ts +125 -0
  514. package/dist/db/database-facade.d.ts.map +1 -0
  515. package/dist/db/database-facade.js +347 -0
  516. package/dist/db/database-facade.js.map +1 -0
  517. package/dist/db/database.d.ts +9 -0
  518. package/dist/db/database.d.ts.map +1 -0
  519. package/dist/db/database.js +11 -0
  520. package/dist/db/database.js.map +1 -0
  521. package/dist/db/index.d.ts +7 -0
  522. package/dist/db/index.d.ts.map +1 -0
  523. package/dist/db/index.js +11 -0
  524. package/dist/db/index.js.map +1 -0
  525. package/dist/db/repositories/_shared/call-graph-query.d.ts +10 -0
  526. package/dist/db/repositories/_shared/call-graph-query.d.ts.map +1 -0
  527. package/dist/db/repositories/_shared/call-graph-query.js +59 -0
  528. package/dist/db/repositories/_shared/call-graph-query.js.map +1 -0
  529. package/dist/db/repositories/call-graph-service.d.ts +28 -0
  530. package/dist/db/repositories/call-graph-service.d.ts.map +1 -0
  531. package/dist/db/repositories/call-graph-service.js +223 -0
  532. package/dist/db/repositories/call-graph-service.js.map +1 -0
  533. package/dist/db/repositories/definition-repository.d.ts +99 -0
  534. package/dist/db/repositories/definition-repository.d.ts.map +1 -0
  535. package/dist/db/repositories/definition-repository.js +317 -0
  536. package/dist/db/repositories/definition-repository.js.map +1 -0
  537. package/dist/db/repositories/dependency-repository.d.ts +78 -0
  538. package/dist/db/repositories/dependency-repository.d.ts.map +1 -0
  539. package/dist/db/repositories/dependency-repository.js +446 -0
  540. package/dist/db/repositories/dependency-repository.js.map +1 -0
  541. package/dist/db/repositories/domain-repository.d.ts +97 -0
  542. package/dist/db/repositories/domain-repository.d.ts.map +1 -0
  543. package/dist/db/repositories/domain-repository.js +261 -0
  544. package/dist/db/repositories/domain-repository.js.map +1 -0
  545. package/dist/db/repositories/feature-repository.d.ts +64 -0
  546. package/dist/db/repositories/feature-repository.d.ts.map +1 -0
  547. package/dist/db/repositories/feature-repository.js +189 -0
  548. package/dist/db/repositories/feature-repository.js.map +1 -0
  549. package/dist/db/repositories/file-repository.d.ts +67 -0
  550. package/dist/db/repositories/file-repository.d.ts.map +1 -0
  551. package/dist/db/repositories/file-repository.js +179 -0
  552. package/dist/db/repositories/file-repository.js.map +1 -0
  553. package/dist/db/repositories/flow-repository.d.ts +172 -0
  554. package/dist/db/repositories/flow-repository.d.ts.map +1 -0
  555. package/dist/db/repositories/flow-repository.js +599 -0
  556. package/dist/db/repositories/flow-repository.js.map +1 -0
  557. package/dist/db/repositories/graph-repository.d.ts +93 -0
  558. package/dist/db/repositories/graph-repository.d.ts.map +1 -0
  559. package/dist/db/repositories/graph-repository.js +413 -0
  560. package/dist/db/repositories/graph-repository.js.map +1 -0
  561. package/dist/db/repositories/index.d.ts +20 -0
  562. package/dist/db/repositories/index.d.ts.map +1 -0
  563. package/dist/db/repositories/index.js +15 -0
  564. package/dist/db/repositories/index.js.map +1 -0
  565. package/dist/db/repositories/interaction-analysis.d.ts +78 -0
  566. package/dist/db/repositories/interaction-analysis.d.ts.map +1 -0
  567. package/dist/db/repositories/interaction-analysis.js +340 -0
  568. package/dist/db/repositories/interaction-analysis.js.map +1 -0
  569. package/dist/db/repositories/interaction-repository.d.ts +145 -0
  570. package/dist/db/repositories/interaction-repository.d.ts.map +1 -0
  571. package/dist/db/repositories/interaction-repository.js +395 -0
  572. package/dist/db/repositories/interaction-repository.js.map +1 -0
  573. package/dist/db/repositories/metadata-repository.d.ts +110 -0
  574. package/dist/db/repositories/metadata-repository.d.ts.map +1 -0
  575. package/dist/db/repositories/metadata-repository.js +294 -0
  576. package/dist/db/repositories/metadata-repository.js.map +1 -0
  577. package/dist/db/repositories/module-repository.d.ts +162 -0
  578. package/dist/db/repositories/module-repository.d.ts.map +1 -0
  579. package/dist/db/repositories/module-repository.js +519 -0
  580. package/dist/db/repositories/module-repository.js.map +1 -0
  581. package/dist/db/repositories/relationship-repository.d.ts +98 -0
  582. package/dist/db/repositories/relationship-repository.d.ts.map +1 -0
  583. package/dist/db/repositories/relationship-repository.js +421 -0
  584. package/dist/db/repositories/relationship-repository.js.map +1 -0
  585. package/dist/db/schema-manager.d.ts +31 -0
  586. package/dist/db/schema-manager.d.ts.map +1 -0
  587. package/dist/db/schema-manager.js +398 -0
  588. package/dist/db/schema-manager.js.map +1 -0
  589. package/dist/db/schema.d.ts +404 -0
  590. package/dist/db/schema.d.ts.map +1 -0
  591. package/dist/db/schema.js +234 -0
  592. package/dist/db/schema.js.map +1 -0
  593. package/dist/db/utils/tree-builder.d.ts +25 -0
  594. package/dist/db/utils/tree-builder.d.ts.map +1 -0
  595. package/dist/db/utils/tree-builder.js +38 -0
  596. package/dist/db/utils/tree-builder.js.map +1 -0
  597. package/dist/index.d.ts +2 -0
  598. package/dist/index.d.ts.map +1 -0
  599. package/dist/index.js +2 -0
  600. package/dist/index.js.map +1 -0
  601. package/dist/parser/ast-parser.d.ts +23 -0
  602. package/dist/parser/ast-parser.d.ts.map +1 -0
  603. package/dist/parser/ast-parser.js +65 -0
  604. package/dist/parser/ast-parser.js.map +1 -0
  605. package/dist/parser/definition-extractor.d.ts +29 -0
  606. package/dist/parser/definition-extractor.d.ts.map +1 -0
  607. package/dist/parser/definition-extractor.js +379 -0
  608. package/dist/parser/definition-extractor.js.map +1 -0
  609. package/dist/parser/reference-extractor.d.ts +72 -0
  610. package/dist/parser/reference-extractor.d.ts.map +1 -0
  611. package/dist/parser/reference-extractor.js +759 -0
  612. package/dist/parser/reference-extractor.js.map +1 -0
  613. package/dist/utils/file-scanner.d.ts +6 -0
  614. package/dist/utils/file-scanner.d.ts.map +1 -0
  615. package/dist/utils/file-scanner.js +33 -0
  616. package/dist/utils/file-scanner.js.map +1 -0
  617. package/dist/web/api-transforms.d.ts +4 -0
  618. package/dist/web/api-transforms.d.ts.map +1 -0
  619. package/dist/web/api-transforms.js +4 -0
  620. package/dist/web/api-transforms.js.map +1 -0
  621. package/dist/web/server.d.ts +16 -0
  622. package/dist/web/server.d.ts.map +1 -0
  623. package/dist/web/server.js +229 -0
  624. package/dist/web/server.js.map +1 -0
  625. package/dist/web/server.test.d.ts +2 -0
  626. package/dist/web/server.test.d.ts.map +1 -0
  627. package/dist/web/server.test.js +505 -0
  628. package/dist/web/server.test.js.map +1 -0
  629. package/dist/web/transforms/flow-transforms.d.ts +117 -0
  630. package/dist/web/transforms/flow-transforms.d.ts.map +1 -0
  631. package/dist/web/transforms/flow-transforms.js +202 -0
  632. package/dist/web/transforms/flow-transforms.js.map +1 -0
  633. package/dist/web/transforms/index.d.ts +4 -0
  634. package/dist/web/transforms/index.d.ts.map +1 -0
  635. package/dist/web/transforms/index.js +4 -0
  636. package/dist/web/transforms/index.js.map +1 -0
  637. package/dist/web/transforms/module-transforms.d.ts +42 -0
  638. package/dist/web/transforms/module-transforms.d.ts.map +1 -0
  639. package/dist/web/transforms/module-transforms.js +64 -0
  640. package/dist/web/transforms/module-transforms.js.map +1 -0
  641. package/dist/web/transforms/symbol-transforms.d.ts +31 -0
  642. package/dist/web/transforms/symbol-transforms.d.ts.map +1 -0
  643. package/dist/web/transforms/symbol-transforms.js +95 -0
  644. package/dist/web/transforms/symbol-transforms.js.map +1 -0
  645. package/package.json +96 -0
  646. package/ui/dist/assets/index-DP3dRMlh.js +268 -0
  647. package/ui/dist/assets/index-DP3dRMlh.js.map +1 -0
  648. package/ui/dist/assets/index-Db204Xn1.css +1 -0
  649. package/ui/dist/index.html +67 -0
package/README.md ADDED
@@ -0,0 +1,1065 @@
1
+ # Squint — Codebase Understanding Tool
2
+
3
+ Squint is an AST + LLM driven tool for codebase analysis and visualization. It indexes TypeScript and JavaScript source code into an SQLite database, then provides tools to systematically annotate symbols and relationships with human-readable descriptions.
4
+
5
+ **Use case**: When an AI agent or human needs to understand a codebase, Squint provides a structured workflow: index the code, identify what needs understanding, annotate symbols with their purpose, and document relationships between components.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pnpm install
11
+ pnpm run build
12
+ ```
13
+
14
+ ## Quick Start
15
+
16
+ **Full automated pipeline:**
17
+ ```bash
18
+ # Index, annotate, detect modules and flows in one go
19
+ squint parse ./src -o index.db && \
20
+ squint llm annotate -a purpose -a domain -a role && \
21
+ squint llm modules && \
22
+ squint llm flows
23
+ ```
24
+
25
+ **Manual workflow:**
26
+ ```bash
27
+ # 1. Index your codebase
28
+ squint parse ./src
29
+
30
+ # 2. Check what needs understanding
31
+ squint symbols understood
32
+
33
+ # 3. Find symbols ready to annotate (no unmet dependencies)
34
+ squint symbols ready --aspect purpose
35
+
36
+ # 4. View the next symbol to understand with its source code
37
+ squint symbols next --aspect purpose
38
+
39
+ # 5. Annotate the symbol
40
+ squint symbols set purpose "Validates user credentials against the database" --name authenticate
41
+
42
+ # 6. Annotate relationships between symbols
43
+ squint relationships next
44
+ squint relationships set "delegates authentication to service layer" --from loginController --to authService
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Command Reference
50
+
51
+ ### `squint parse` - Index a Codebase
52
+
53
+ Scans TypeScript/JavaScript files and builds an SQLite index of definitions, references, and symbol usages.
54
+
55
+ ```bash
56
+ squint parse <directory> [-o <output.db>]
57
+ ```
58
+
59
+ | Flag | Default | Description |
60
+ |------|---------|-------------|
61
+ | `-o, --output` | `index.db` | Output database file path |
62
+
63
+ **Examples:**
64
+ ```bash
65
+ squint parse ./src
66
+ squint parse ./src -o my-project.db
67
+ ```
68
+
69
+ ---
70
+
71
+ ### `squint symbols` - List and Filter Symbols
72
+
73
+ Lists all symbols (functions, classes, variables, etc.) in the index.
74
+
75
+ ```bash
76
+ squint symbols [flags]
77
+ ```
78
+
79
+ | Flag | Description |
80
+ |------|-------------|
81
+ | `-d, --database` | Path to database (default: `index.db`) |
82
+ | `--kind` | Filter by kind: `function`, `class`, `variable`, `type`, `interface`, `enum` |
83
+ | `--file` | Filter to symbols in a specific file |
84
+ | `--has <key>` | Filter to symbols that have this metadata key |
85
+ | `--missing <key>` | Filter to symbols missing this metadata key |
86
+ | `--domain <name>` | Filter to symbols with this domain tag |
87
+ | `--pure <bool>` | Filter by purity (`true` or `false`) |
88
+ | `--domains` | List all unique domains in use |
89
+
90
+ **Examples:**
91
+ ```bash
92
+ squint symbols # List all symbols
93
+ squint symbols --kind function # Only functions
94
+ squint symbols --missing purpose # Symbols without purpose annotation
95
+ squint symbols --has purpose --kind class # Classes with purpose set
96
+ squint symbols --domain auth # Symbols tagged with "auth" domain
97
+ squint symbols --domains # List all domain tags in use
98
+ ```
99
+
100
+ ---
101
+
102
+ ### `squint symbols show` - Inspect a Symbol
103
+
104
+ Shows detailed information about a specific symbol including its source code, callsites, and metadata.
105
+
106
+ ```bash
107
+ squint symbols show <name> [flags]
108
+ squint symbols show --id <id> [flags]
109
+ ```
110
+
111
+ | Flag | Description |
112
+ |------|-------------|
113
+ | `--id` | Look up by definition ID |
114
+ | `-f, --file` | Disambiguate by file path |
115
+ | `-c, --context-lines` | Lines of context around callsites (default: 3) |
116
+ | `--json` | Output as JSON |
117
+
118
+ **Examples:**
119
+ ```bash
120
+ squint symbols show parseFile
121
+ squint symbols show --id 42
122
+ squint symbols show MyClass --file src/models/
123
+ squint symbols show authenticate --json
124
+ ```
125
+
126
+ ---
127
+
128
+ ### `squint symbols set` - Annotate a Symbol
129
+
130
+ Sets metadata (annotations) on a symbol.
131
+
132
+ ```bash
133
+ squint symbols set <key> <value> --name <symbol>
134
+ squint symbols set <key> <value> --id <id>
135
+ ```
136
+
137
+ | Flag | Description |
138
+ |------|-------------|
139
+ | `-n, --name` | Symbol name |
140
+ | `--id` | Definition ID |
141
+ | `-f, --file` | Disambiguate by file path |
142
+ | `--batch` | Read symbol-value pairs from stdin (JSON array) |
143
+ | `-i, --input-file` | Read batch input from file |
144
+ | `--json` | Output as JSON (batch mode) |
145
+
146
+ **Common metadata keys:**
147
+ - `purpose` - What the symbol does and why it exists
148
+ - `domain` - Business domains (JSON array: `'["auth", "user"]'`)
149
+ - `role` - Architectural role (e.g., "controller", "service", "repository")
150
+ - `pure` - Whether the function has side effects (`true` or `false`)
151
+
152
+ **Examples:**
153
+ ```bash
154
+ # Set purpose
155
+ squint symbols set purpose "Parses TypeScript AST and extracts definitions" --name parseFile
156
+
157
+ # Set domain tags
158
+ squint symbols set domain '["auth", "security"]' --name validateToken
159
+
160
+ # Set architectural role
161
+ squint symbols set role "HTTP controller handling user requests" --name UserController
162
+
163
+ # Mark as pure (no side effects)
164
+ squint symbols set pure true --name calculateTotal
165
+
166
+ # Batch mode
167
+ echo '[{"name":"add","value":"Adds two numbers"},{"name":"sub","value":"Subtracts"}]' | \
168
+ squint symbols set purpose --batch
169
+ ```
170
+
171
+ ---
172
+
173
+ ### `squint symbols unset` - Remove Annotation
174
+
175
+ Removes a metadata key from a symbol.
176
+
177
+ ```bash
178
+ squint symbols unset <key> --name <symbol>
179
+ squint symbols unset <key> --id <id>
180
+ ```
181
+
182
+ ---
183
+
184
+ ### `squint symbols ready` - Find Symbols Ready to Understand
185
+
186
+ Lists symbols that are ready to annotate because all their dependencies already have the specified aspect annotated.
187
+
188
+ ```bash
189
+ squint symbols ready --aspect <key> [flags]
190
+ ```
191
+
192
+ | Flag | Description |
193
+ |------|-------------|
194
+ | `-a, --aspect` | **(required)** The metadata key to check |
195
+ | `-l, --limit` | Maximum results (default: 20) |
196
+ | `-k, --kind` | Filter by symbol kind |
197
+ | `-f, --file` | Filter to symbols in path |
198
+ | `-v, --verbose` | Show dependency metadata inline |
199
+ | `--json` | Output as JSON |
200
+
201
+ **Examples:**
202
+ ```bash
203
+ squint symbols ready --aspect purpose # What's ready to annotate?
204
+ squint symbols ready --aspect purpose --kind function # Only functions
205
+ squint symbols ready --aspect purpose --file src/parser/ # Only in parser/
206
+ squint symbols ready --aspect purpose --verbose # Show dependency info
207
+ ```
208
+
209
+ ---
210
+
211
+ ### `squint symbols next` - View Next Symbol to Understand
212
+
213
+ Shows the next symbol ready to understand with its full source code. This is the primary command for the annotation workflow.
214
+
215
+ ```bash
216
+ squint symbols next --aspect <key> [flags]
217
+ ```
218
+
219
+ | Flag | Description |
220
+ |------|-------------|
221
+ | `-a, --aspect` | **(required)** The metadata key to check |
222
+ | `-c, --count` | Number of symbols to show (default: 1) |
223
+ | `-m, --max-lines` | Max source lines to display (default: 50, 0 = unlimited) |
224
+ | `--json` | Output as JSON |
225
+
226
+ **Examples:**
227
+ ```bash
228
+ squint symbols next --aspect purpose # Show next symbol to annotate
229
+ squint symbols next --aspect purpose --count 3 # Show next 3 symbols
230
+ squint symbols next --aspect purpose --json # JSON output for automation
231
+ ```
232
+
233
+ ---
234
+
235
+ ### `squint symbols deps` - View Symbol Dependencies
236
+
237
+ Shows what other symbols a given symbol depends on, with their annotation status.
238
+
239
+ ```bash
240
+ squint symbols deps <name> [flags]
241
+ squint symbols deps --id <id> [flags]
242
+ ```
243
+
244
+ | Flag | Description |
245
+ |------|-------------|
246
+ | `-a, --aspect` | Highlight status of specific aspect |
247
+ | `--json` | Output as JSON |
248
+
249
+ **Examples:**
250
+ ```bash
251
+ squint symbols deps parseFile # What does parseFile depend on?
252
+ squint symbols deps parseFile --aspect purpose # Show which deps have purpose set
253
+ ```
254
+
255
+ ---
256
+
257
+ ### `squint symbols prereqs` - View Prerequisites
258
+
259
+ Shows unmet dependencies in topological order - what you need to understand first before understanding a target symbol.
260
+
261
+ ```bash
262
+ squint symbols prereqs <name> --aspect <key>
263
+ ```
264
+
265
+ **Examples:**
266
+ ```bash
267
+ squint symbols prereqs IndexDatabase --aspect purpose
268
+ ```
269
+
270
+ ---
271
+
272
+ ### `squint symbols understood` - Coverage Report
273
+
274
+ Shows understanding coverage statistics per aspect.
275
+
276
+ ```bash
277
+ squint symbols understood [flags]
278
+ ```
279
+
280
+ | Flag | Description |
281
+ |------|-------------|
282
+ | `-a, --aspect` | Show only specific aspect |
283
+ | `-k, --kind` | Filter by symbol kind |
284
+ | `-f, --file` | Filter to symbols in path |
285
+ | `--json` | Output as JSON |
286
+
287
+ **Examples:**
288
+ ```bash
289
+ squint symbols understood # Overall coverage
290
+ squint symbols understood --kind function # Function coverage only
291
+ squint symbols understood --file src/parser/ # Coverage for parser module
292
+ ```
293
+
294
+ ---
295
+
296
+ ### `squint domains` - Manage Domain Tags
297
+
298
+ Domains are business/architectural tags that group related symbols (e.g., "auth", "payment", "user").
299
+
300
+ #### List Domains
301
+ ```bash
302
+ squint domains # List registered domains with symbol counts
303
+ squint domains --unregistered # Show domains in use but not registered
304
+ squint domains --json # JSON output
305
+ ```
306
+
307
+ #### Register a Domain
308
+ ```bash
309
+ squint domains add <name> [--description "..."]
310
+ ```
311
+
312
+ #### Rename a Domain
313
+ Renames in registry and updates all symbol metadata:
314
+ ```bash
315
+ squint domains rename <old-name> <new-name>
316
+ ```
317
+
318
+ #### Merge Domains
319
+ Merges source domain into target, updating all symbols:
320
+ ```bash
321
+ squint domains merge <from-domain> <into-domain>
322
+ ```
323
+
324
+ #### Remove a Domain
325
+ ```bash
326
+ squint domains remove <name> # Fails if symbols still use it
327
+ squint domains remove <name> --force # Remove anyway
328
+ ```
329
+
330
+ #### Sync Domains
331
+ Bulk-register all domains currently in use:
332
+ ```bash
333
+ squint domains sync
334
+ ```
335
+
336
+ ---
337
+
338
+ ### `squint relationships` - Manage Relationship Annotations
339
+
340
+ Relationships describe *why* one symbol calls/uses another.
341
+
342
+ #### List Relationships
343
+ ```bash
344
+ squint relationships # List all annotated relationships
345
+ squint relationships --from Controller # Filter by source symbol
346
+ squint relationships --to AuthService # Filter by target symbol
347
+ squint relationships --count # Just show count
348
+ squint relationships --json # JSON output
349
+ ```
350
+
351
+ #### View Next Relationship to Annotate
352
+ Shows unannotated relationships with rich context including both symbols' metadata, other relationships, and shared domains:
353
+
354
+ ```bash
355
+ squint relationships next # Show next relationship to annotate
356
+ squint relationships next --count 5 # Show next 5
357
+ squint relationships next --from Controller # Only from this symbol
358
+ squint relationships next --json # JSON output for automation
359
+ ```
360
+
361
+ #### Annotate a Relationship
362
+ ```bash
363
+ squint relationships set "<semantic description>" --from <source> --to <target>
364
+ squint relationships set "<semantic description>" --from-id <id> --to-id <id>
365
+ ```
366
+
367
+ **Examples:**
368
+ ```bash
369
+ squint relationships set "delegates credential validation" --from loginController --to authService
370
+ squint relationships set "persists user data to PostgreSQL" --from-id 42 --to-id 15
371
+ ```
372
+
373
+ #### Remove a Relationship Annotation
374
+ ```bash
375
+ squint relationships unset --from <source> --to <target>
376
+ ```
377
+
378
+ ---
379
+
380
+ ### `squint llm annotate` - Bulk Annotate Symbols with LLM
381
+
382
+ Uses an LLM to automatically annotate symbols with metadata like purpose, domain, and role. Processes symbols in batches, respecting the dependency order (leaves first).
383
+
384
+ ```bash
385
+ squint llm annotate -a <aspect> [flags]
386
+ ```
387
+
388
+ | Flag | Description |
389
+ |------|-------------|
390
+ | `-a, --aspect` | **(required)** Metadata key to annotate (can repeat: `-a purpose -a domain`) |
391
+ | `-d, --database` | Path to database (default: `index.db`) |
392
+ | `-m, --model` | LLM model alias (default: `sonnet`) |
393
+ | `-b, --batch-size` | Symbols per LLM call (default: 5) |
394
+ | `--max-iterations` | Maximum iterations, 0 = unlimited (default: 0) |
395
+ | `-k, --kind` | Filter by symbol kind |
396
+ | `-f, --file` | Filter by file path pattern |
397
+ | `-x, --exclude` | Glob pattern to exclude (e.g., `**/*.test.ts`) |
398
+ | `--force` | Annotate even if dependencies aren't annotated |
399
+ | `--dry-run` | Parse LLM output but don't persist |
400
+ | `--json` | Output as JSON |
401
+
402
+ **Examples:**
403
+ ```bash
404
+ # Annotate all symbols with purpose
405
+ squint llm annotate --aspect purpose
406
+
407
+ # Annotate multiple aspects at once
408
+ squint llm annotate --aspect purpose --aspect domain --aspect role
409
+
410
+ # Use a different model with larger batches
411
+ squint llm annotate --aspect purpose --model gpt4o --batch-size 10
412
+
413
+ # Only annotate functions, exclude tests
414
+ squint llm annotate --aspect purpose --kind function --exclude "**/*.test.ts"
415
+
416
+ # Preview without saving
417
+ squint llm annotate --aspect purpose --dry-run
418
+
419
+ # Limit iterations for incremental annotation
420
+ squint llm annotate --aspect purpose --max-iterations 5
421
+ ```
422
+
423
+ **Workflow:**
424
+ The command processes symbols bottom-up (dependencies first), so annotations build on already-understood code. Use `--force` to skip dependency checking.
425
+
426
+ ---
427
+
428
+ ### `squint llm modules` - Detect Architectural Modules
429
+
430
+ Uses a two-phase LLM approach to create a hierarchical module structure:
431
+
432
+ **Phase 1: Module Tree Design**
433
+ The LLM analyzes the overall codebase structure (file paths, symbol patterns, domains) to design a hierarchical module tree with dot-notation paths like `project.backend.services.auth`.
434
+
435
+ **Phase 2: Symbol Assignment**
436
+ Symbols are assigned to leaf modules in batches. The LLM receives symbol metadata (name, kind, purpose, domain, file path) and assigns each to the most appropriate module.
437
+
438
+ ```bash
439
+ squint llm modules [flags]
440
+ ```
441
+
442
+ | Flag | Description |
443
+ |------|-------------|
444
+ | `-d, --database` | Path to database (default: `index.db`) |
445
+ | `-b, --batch-size` | Symbols per assignment batch (default: 30) |
446
+ | `--dry-run` | Show detected modules without persisting |
447
+ | `--force` | Re-detect even if modules exist |
448
+ | `-m, --model` | LLM model for detection (default: sonnet) |
449
+ | `--json` | Output as JSON |
450
+
451
+ **Examples:**
452
+ ```bash
453
+ # Detect modules with default settings
454
+ squint llm modules
455
+
456
+ # Dry run to preview detection
457
+ squint llm modules --dry-run
458
+
459
+ # Use faster model with larger batches
460
+ squint llm modules --model haiku --batch-size 50
461
+
462
+ # Re-detect and overwrite existing modules
463
+ squint llm modules --force
464
+ ```
465
+
466
+ **Module Structure:**
467
+ Modules are organized hierarchically with dot-notation paths:
468
+ - `project` - Root module for the codebase
469
+ - `project.backend` - Backend subsystem
470
+ - `project.backend.services` - Service layer
471
+ - `project.backend.services.auth` - Authentication service (leaf with members)
472
+
473
+ **Web UI:**
474
+ The web UI (`squint web`) displays modules as an interactive tree with:
475
+ - Expandable/collapsible hierarchy
476
+ - Member counts at each level
477
+ - Click to view module members
478
+ - Visual tree lines showing parent-child relationships
479
+
480
+ ---
481
+
482
+ ### `squint llm flows` - Detect Execution Flows
483
+
484
+ Traces execution paths from entry points (controllers, routes, handlers) through the call graph to detect end-to-end flows. Optionally uses LLM to name and describe the flows.
485
+
486
+ ```bash
487
+ squint llm flows [flags]
488
+ ```
489
+
490
+ | Flag | Description |
491
+ |------|-------------|
492
+ | `-d, --database` | Path to database (default: `index.db`) |
493
+ | `--min-steps` | Minimum steps for a valid flow (default: 2) |
494
+ | `--max-depth` | Maximum traversal depth (default: 15) |
495
+ | `--domain` | Only detect flows in a specific domain |
496
+ | `--from` | Start from a specific entry point (name pattern) |
497
+ | `--dry-run` | Show detected flows without persisting |
498
+ | `--force` | Re-detect even if flows exist |
499
+ | `--skip-llm` | Skip LLM naming (use auto-generated names) |
500
+ | `-m, --model` | LLM model for naming (default: sonnet) |
501
+ | `--json` | Output as JSON |
502
+
503
+ **Examples:**
504
+ ```bash
505
+ # Detect all flows
506
+ squint llm flows
507
+
508
+ # Preview flows without persisting
509
+ squint llm flows --dry-run --skip-llm
510
+
511
+ # Only detect flows starting from sales controllers
512
+ squint llm flows --from sales --domain sales-management
513
+
514
+ # Limit traversal depth for simpler flows
515
+ squint llm flows --max-depth 5 --min-steps 3
516
+ ```
517
+
518
+ **Entry Points:**
519
+ The command identifies entry points by:
520
+ - Symbols with `role=controller` metadata
521
+ - Names containing "Controller" or "Handler"
522
+ - Exported functions in `/routes/`, `/controllers/`, or `/handlers/` directories
523
+
524
+ **Output Example:**
525
+ ```
526
+ Flow: CreateSale
527
+ Domain: sales-management
528
+ Entry: SalesController.create (controller)
529
+
530
+ Steps:
531
+ 1. SalesController.create [controller]
532
+ 2. salesService.createSale [service]
533
+ 3. vehicleService.updateStatus [service]
534
+ 4. saleModel.insert [repository]
535
+ 5. vehicleModel.update [repository]
536
+
537
+ Modules crossed: SalesAPI → SalesService → VehicleService → DataLayer
538
+ ```
539
+
540
+ ---
541
+
542
+ ### `squint stats` - Database Health Check
543
+
544
+ Shows aggregate statistics and pipeline progress for the index database: parsed counts, annotation coverage, module assignment, interactions, flows, and features.
545
+
546
+ ```bash
547
+ squint stats [flags]
548
+ ```
549
+
550
+ | Flag | Description |
551
+ |------|-------------|
552
+ | `-d, --database` | Path to database (default: `index.db`) |
553
+ | `--json` | Output as JSON |
554
+
555
+ **Examples:**
556
+ ```bash
557
+ squint stats # Overview of all pipeline stages
558
+ squint stats -d ./my-index.db # Specific database
559
+ squint stats --json # Machine-readable output
560
+ ```
561
+
562
+ ---
563
+
564
+ ### `squint gaps` - Find Unannotated and Unassigned Entities
565
+
566
+ Lists individual entities that are incomplete across the pipeline: unannotated symbols, unannotated relationships, empty modules, and unassigned symbols. Complements `squint stats` by showing *which* items need attention, not just counts.
567
+
568
+ ```bash
569
+ squint gaps [flags]
570
+ ```
571
+
572
+ | Flag | Description |
573
+ |------|-------------|
574
+ | `-d, --database` | Path to database (default: `index.db`) |
575
+ | `-t, --type` | Gap type to show: `symbols`, `relationships`, `modules`, `unassigned` (default: all) |
576
+ | `--limit` | Max items per section (default: 20) |
577
+ | `--kind` | Filter symbols by kind (`function`, `class`, etc.) |
578
+ | `--json` | Output as JSON |
579
+
580
+ **Examples:**
581
+ ```bash
582
+ squint gaps # Show all gap sections
583
+ squint gaps --type symbols # Only unannotated symbols
584
+ squint gaps --type unassigned --kind class # Unassigned classes
585
+ squint gaps --limit 50 # Show more items per section
586
+ squint gaps --json # Machine-readable output
587
+ ```
588
+
589
+ **Sections:**
590
+ - **Unannotated Symbols** — definitions with no metadata annotations at all
591
+ - **Unannotated Relationships** — call edges with no semantic annotation
592
+ - **Empty Modules** — modules with zero symbols assigned
593
+ - **Unassigned Symbols** — definitions not assigned to any module
594
+
595
+ ---
596
+
597
+ ### `squint files` - Explore File Structure
598
+
599
+ #### List Files
600
+ ```bash
601
+ squint files # List all indexed files
602
+ squint files --stats # Include import statistics
603
+ ```
604
+
605
+ #### View File Imports
606
+ ```bash
607
+ squint files imports <path> # What does this file import?
608
+ squint files imported-by <path> # What files import this file?
609
+ squint files orphans # Find files with no incoming imports
610
+ ```
611
+
612
+ ---
613
+
614
+ ### `squint modules` - View Detected Modules
615
+
616
+ Lists modules detected by `squint llm modules`. Modules are organized hierarchically with dot-notation paths (e.g., `project.backend.services.auth`) representing architectural boundaries.
617
+
618
+ ```bash
619
+ squint modules [flags]
620
+ ```
621
+
622
+ | Flag | Description |
623
+ |------|-------------|
624
+ | `-d, --database` | Path to database (default: `index.db`) |
625
+ | `--tree` | Display modules as a hierarchical tree |
626
+ | `--json` | Output as JSON |
627
+
628
+ **Examples:**
629
+ ```bash
630
+ squint modules # List all modules with paths
631
+ squint modules --tree # Show as hierarchical tree
632
+ squint modules --json # JSON output for automation
633
+ ```
634
+
635
+ **Output (tree view):**
636
+ ```
637
+ Module Tree (8 modules, 156 symbols assigned)
638
+
639
+ project
640
+ ├── backend
641
+ │ ├── controllers (12 members) - HTTP request handlers
642
+ │ ├── services (28 members) - Business logic layer
643
+ │ │ ├── auth (8 members) - Authentication logic
644
+ │ │ └── user (10 members) - User management
645
+ │ └── repositories (18 members) - Data access layer
646
+ └── shared
647
+ └── utils (14 members) - Common utilities
648
+
649
+ 15 definitions not assigned to any module
650
+ ```
651
+
652
+ **Output (flat list):**
653
+ ```
654
+ Modules (8 total, 156 assigned)
655
+
656
+ Path Members Description
657
+ ────────────────────────────────────────────────────────────
658
+ project 0 Root module
659
+ project.backend 0 Backend application
660
+ project.backend.controllers 12 HTTP request handlers
661
+ project.backend.services 28 Business logic layer
662
+ project.backend.services.auth 8 Authentication logic
663
+ ...
664
+ ```
665
+
666
+ #### `squint modules show` - View Module Details
667
+
668
+ Shows detailed information about a specific module including all its members.
669
+
670
+ ```bash
671
+ squint modules show <name> [flags]
672
+ ```
673
+
674
+ **Examples:**
675
+ ```bash
676
+ squint modules show auth # Show auth module details
677
+ squint modules show project.backend.services # Show by full path
678
+ squint modules show services --json # JSON output
679
+ ```
680
+
681
+ **Output:**
682
+ ```
683
+ Module: auth
684
+ Full Path: project.backend.services.auth
685
+ Description: Authentication and session management
686
+
687
+ Members (8):
688
+ Name Kind Location
689
+ ───────────────────────────────────────────────────────
690
+ validateToken function src/auth/validate.ts
691
+ hashPassword function src/auth/hash.ts
692
+ AuthService class src/auth/service.ts
693
+ ...
694
+ ```
695
+
696
+ ---
697
+
698
+ ### `squint flows` - View Detected Flows
699
+
700
+ Lists execution flows detected by `squint llm flows`. Flows trace request paths from entry points through the call graph.
701
+
702
+ ```bash
703
+ squint flows [flags]
704
+ ```
705
+
706
+ | Flag | Description |
707
+ |------|-------------|
708
+ | `-d, --database` | Path to database (default: `index.db`) |
709
+ | `--domain` | Filter by domain |
710
+ | `--json` | Output as JSON |
711
+
712
+ **Examples:**
713
+ ```bash
714
+ squint flows # List all flows with step counts
715
+ squint flows --domain user # Only user-domain flows
716
+ squint flows --json # JSON output for automation
717
+ ```
718
+
719
+ **Output:**
720
+ ```
721
+ Flows (5 total, 47 steps)
722
+
723
+ Name Entry Point Steps Modules Crossed
724
+ ────────────────────────────────────────────────────────────────
725
+ user-registration handleRegister 8 auth, user, db
726
+ login handleLogin 6 auth, session
727
+ checkout processCheckout 12 cart, payment, inventory
728
+ ```
729
+
730
+ #### `squint flows show` - View Flow Details
731
+
732
+ Shows detailed information about a specific flow including all its steps.
733
+
734
+ ```bash
735
+ squint flows show <name> [flags]
736
+ ```
737
+
738
+ **Examples:**
739
+ ```bash
740
+ squint flows show user-registration # Show flow details
741
+ squint flows show login --json # JSON output
742
+ ```
743
+
744
+ **Output:**
745
+ ```
746
+ Flow: user-registration
747
+ Entry: handleRegister (function) - src/api/user.ts:45
748
+ Domain: user
749
+
750
+ Steps (8):
751
+ # Name Kind Module Layer
752
+ ────────────────────────────────────────────────────────────────
753
+ 1 validateInput function user-api controller
754
+ 2 hashPassword function auth service
755
+ 3 createUser function user service
756
+ 4 insertUser function database repository
757
+ ...
758
+ ```
759
+
760
+ #### `squint flows trace` - Trace Execution Path
761
+
762
+ Traces the call graph from a specific entry point, showing reachable symbols as a tree. This is useful for ad-hoc exploration before flows are formally detected.
763
+
764
+ ```bash
765
+ squint flows trace [flags]
766
+ ```
767
+
768
+ | Flag | Description |
769
+ |------|-------------|
770
+ | `-d, --database` | Path to database (default: `index.db`) |
771
+ | `-n, --name` | Symbol name to trace from |
772
+ | `--id` | Definition ID to trace from |
773
+ | `--depth` | Max traversal depth (default: 10) |
774
+ | `-f, --file` | Disambiguate by file path |
775
+ | `--json` | Output as JSON |
776
+
777
+ **Examples:**
778
+ ```bash
779
+ squint flows trace --name handleRegister # Trace from handleRegister
780
+ squint flows trace --id 42 --depth 5 # Trace by ID, limit depth
781
+ squint flows trace --name processPayment --json # JSON output
782
+ ```
783
+
784
+ **Output:**
785
+ ```
786
+ Trace from: handleRegister (src/api/user.ts:45)
787
+
788
+ handleRegister
789
+ └── [1] validateInput (user-api) [controller]
790
+ └── [1] hashPassword (auth) [service]
791
+ └── [2] bcryptHash
792
+ └── [1] createUser (user) [service]
793
+ └── [2] insertUser (database) [repository]
794
+ └── [2] sendWelcomeEmail (notifications)
795
+
796
+ 12 nodes traced (max depth: 10)
797
+ ```
798
+
799
+ ---
800
+
801
+ ### `squint hierarchy` - View Inheritance and Call Hierarchies
802
+
803
+ Shows class/interface inheritance trees or call hierarchies between symbols.
804
+
805
+ ```bash
806
+ squint hierarchy [flags]
807
+ ```
808
+
809
+ | Flag | Description |
810
+ |------|-------------|
811
+ | `-d, --database` | Path to database (default: `index.db`) |
812
+ | `--type` | Relationship type: `extends`, `implements`, `calls`, `imports`, `uses` (default: `extends`) |
813
+ | `--root` | Start from specific symbol (required for `calls` type) |
814
+ | `-f, --file` | Disambiguate root symbol by file path |
815
+ | `--depth` | Max depth for call/import hierarchies (default: 10) |
816
+ | `--json` | Output as JSON |
817
+
818
+ **Examples:**
819
+ ```bash
820
+ # Class inheritance hierarchy
821
+ squint hierarchy # Show all extends relationships
822
+ squint hierarchy --type extends # Same as above
823
+ squint hierarchy --type implements # Show interface implementations
824
+
825
+ # Call hierarchy from a specific function
826
+ squint hierarchy --type calls --root main # Show what main() calls
827
+ squint hierarchy --type calls --root IndexDatabase --depth 3
828
+
829
+ # Annotated relationships
830
+ squint hierarchy --type uses # Show uses relationships from annotations
831
+ ```
832
+
833
+ **Output (extends):**
834
+ ```
835
+ Class Hierarchy (extends)
836
+
837
+ BaseController (class)
838
+ ├── UserController (class)
839
+ │ └── AdminController (class)
840
+ └── AuthController (class)
841
+
842
+ BaseService (class)
843
+ ├── UserService (class)
844
+ └── AuthService (class)
845
+
846
+ (3 roots, 7 total nodes)
847
+ ```
848
+
849
+ **Output (calls):**
850
+ ```
851
+ Call Hierarchy from: main
852
+
853
+ main (function)
854
+ ├── parseArgs (function)
855
+ ├── loadConfig (function)
856
+ │ └── readFile (function)
857
+ └── startServer (function)
858
+ ├── createRoutes (function)
859
+ └── listen (function)
860
+
861
+ (6 nodes, max depth: 10)
862
+ ```
863
+
864
+ ---
865
+
866
+ ### `squint browse` - Interactive Code Browser
867
+
868
+ Launches a web-based visualization of the codebase.
869
+
870
+ ```bash
871
+ squint browse # Open browser at localhost:3000
872
+ squint browse -p 8080 # Use different port
873
+ squint browse --no-open # Don't auto-open browser
874
+ ```
875
+
876
+ ---
877
+
878
+ ## Understanding Workflow
879
+
880
+ The recommended process for systematically understanding a codebase:
881
+
882
+ ### Phase 1: Index and Explore
883
+
884
+ ```bash
885
+ # Index the codebase
886
+ squint parse ./src
887
+
888
+ # Get an overview
889
+ squint symbols # How many symbols?
890
+ squint symbols --kind function # How many functions?
891
+ squint files --stats # File structure
892
+
893
+ # Check current understanding coverage
894
+ squint symbols understood
895
+ ```
896
+
897
+ ### Phase 2: Annotate Symbols (Bottom-Up)
898
+
899
+ The tool enforces a bottom-up approach: you can only annotate a symbol once all its dependencies are annotated. This ensures you build understanding from foundational code upward.
900
+
901
+ **Option A: Automatic LLM annotation**
902
+ ```bash
903
+ # Annotate all symbols with LLM (recommended for initial pass)
904
+ squint llm annotate --aspect purpose --aspect domain --aspect role
905
+
906
+ # Check coverage
907
+ squint symbols understood
908
+ ```
909
+
910
+ **Option B: Manual annotation**
911
+ ```bash
912
+ # Find symbols ready to annotate (leaves first)
913
+ squint symbols ready --aspect purpose
914
+
915
+ # View the next symbol with source code
916
+ squint symbols next --aspect purpose
917
+
918
+ # Annotate it
919
+ squint symbols set purpose "Computes SHA-256 hash of file content" --name computeHash
920
+
921
+ # Repeat until coverage is complete
922
+ squint symbols understood
923
+ ```
924
+
925
+ ### Phase 3: Organize with Domains
926
+
927
+ As patterns emerge, organize symbols into business domains:
928
+
929
+ ```bash
930
+ # See what domains are in use
931
+ squint symbols --domains
932
+
933
+ # Register domains with descriptions
934
+ squint domains add auth "Authentication and authorization"
935
+ squint domains add user "User management and profiles"
936
+
937
+ # Tag symbols with domains
938
+ squint symbols set domain '["auth"]' --name validateToken
939
+ squint symbols set domain '["auth", "user"]' --name loginUser
940
+
941
+ # Query by domain
942
+ squint symbols --domain auth
943
+ ```
944
+
945
+ ### Phase 4: Annotate Relationships
946
+
947
+ Once symbols are understood, document why they interact:
948
+
949
+ ```bash
950
+ # Find relationships needing annotation
951
+ squint relationships next
952
+
953
+ # The output shows:
954
+ # - Both symbols' metadata (purpose, domains, role)
955
+ # - Other relationships for context
956
+ # - Source code around the call site
957
+
958
+ # Annotate the relationship
959
+ squint relationships set "validates credentials before creating session" \
960
+ --from loginController --to authService
961
+
962
+ # Track progress
963
+ squint relationships --count
964
+ ```
965
+
966
+ ### Phase 5: Detect Architecture (Modules & Flows)
967
+
968
+ Once symbols are annotated with purpose and domain, detect higher-level structures:
969
+
970
+ ```bash
971
+ # Detect hierarchical module tree (two-phase LLM approach)
972
+ squint llm modules --dry-run # Preview module tree
973
+ squint llm modules # Detect and persist
974
+
975
+ # View modules as tree
976
+ squint modules --tree
977
+
978
+ # Detect execution flows (request paths through the system)
979
+ squint llm flows --dry-run --skip-llm # Preview
980
+ squint llm flows # Detect and persist
981
+
982
+ # View detected modules and flows via the web UI
983
+ squint web
984
+ # The Modules view shows an interactive tree
985
+ # API endpoints: /api/modules, /api/flows
986
+ ```
987
+
988
+ ### Phase 6: Ongoing Maintenance
989
+
990
+ As the codebase evolves, keep annotations current:
991
+
992
+ ```bash
993
+ # Re-index to pick up changes
994
+ squint parse ./src
995
+
996
+ # Find new symbols needing annotation
997
+ squint symbols --missing purpose
998
+
999
+ # Check for orphan files (possibly dead code)
1000
+ squint files orphans
1001
+ ```
1002
+
1003
+ ---
1004
+
1005
+ ## Batch Annotation
1006
+
1007
+ For automation or bulk updates, use batch mode:
1008
+
1009
+ ```bash
1010
+ # Create a JSON file with annotations
1011
+ cat > annotations.json << 'EOF'
1012
+ [
1013
+ {"name": "parseFile", "value": "Parses a TypeScript file into an AST"},
1014
+ {"name": "extractDefs", "value": "Extracts definitions from AST"},
1015
+ {"name": "buildIndex", "value": "Builds searchable index from definitions"}
1016
+ ]
1017
+ EOF
1018
+
1019
+ # Apply all at once
1020
+ squint symbols set purpose -i annotations.json
1021
+ ```
1022
+
1023
+ ---
1024
+
1025
+ ## Database Schema
1026
+
1027
+ The SQLite database contains:
1028
+
1029
+ | Table | Description |
1030
+ |-------|-------------|
1031
+ | `metadata` | Index metadata (version, timestamp, source directory) |
1032
+ | `files` | Indexed files with content hash and modification time |
1033
+ | `definitions` | All symbol definitions with position and export info |
1034
+ | `imports` | File references (imports, requires, re-exports) |
1035
+ | `symbols` | Imported symbols linked to their definitions |
1036
+ | `usages` | Where each symbol is used in the codebase |
1037
+ | `definition_metadata` | Key-value annotations on symbols |
1038
+ | `relationship_annotations` | Semantic descriptions of symbol relationships |
1039
+ | `domains` | Registered domain tags with descriptions |
1040
+ | `modules` | Detected architectural modules with layer and subsystem |
1041
+ | `module_members` | Mapping of definitions to modules with confidence scores |
1042
+ | `flows` | Detected execution flows with entry points and domains |
1043
+ | `flow_steps` | Ordered steps in each flow with module and layer info |
1044
+
1045
+ ---
1046
+
1047
+ ## Development
1048
+
1049
+ ```bash
1050
+ # Build
1051
+ pnpm run build
1052
+
1053
+ # Run tests
1054
+ pnpm test
1055
+
1056
+ # Watch mode
1057
+ pnpm test:watch
1058
+
1059
+ # Development mode (uses ts-node)
1060
+ pnpm run dev ./src
1061
+ ```
1062
+
1063
+ ## License
1064
+
1065
+ MIT