aspectcode 0.2.1 → 0.3.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 (307) hide show
  1. package/dist/cli.d.ts +16 -56
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +18 -21
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts +14 -25
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +5 -61
  8. package/dist/config.js.map +1 -1
  9. package/dist/kbBuilder.d.ts +14 -0
  10. package/dist/kbBuilder.d.ts.map +1 -0
  11. package/dist/kbBuilder.js +106 -0
  12. package/dist/kbBuilder.js.map +1 -0
  13. package/dist/main.d.ts +4 -5
  14. package/dist/main.d.ts.map +1 -1
  15. package/dist/main.js +46 -145
  16. package/dist/main.js.map +1 -1
  17. package/dist/optimize.d.ts +14 -0
  18. package/dist/optimize.d.ts.map +1 -0
  19. package/dist/optimize.js +131 -0
  20. package/dist/optimize.js.map +1 -0
  21. package/dist/pipeline.d.ts +15 -0
  22. package/dist/pipeline.d.ts.map +1 -0
  23. package/dist/pipeline.js +212 -0
  24. package/dist/pipeline.js.map +1 -0
  25. package/dist/toolIngestion.d.ts +15 -0
  26. package/dist/toolIngestion.d.ts.map +1 -0
  27. package/dist/toolIngestion.js +47 -0
  28. package/dist/toolIngestion.js.map +1 -0
  29. package/dist/writer.d.ts +17 -0
  30. package/dist/writer.d.ts.map +1 -0
  31. package/dist/writer.js +26 -0
  32. package/dist/writer.js.map +1 -0
  33. package/node_modules/@aspectcode/core/dist/analysis/analyzer.d.ts +34 -0
  34. package/node_modules/@aspectcode/core/dist/analysis/analyzer.d.ts.map +1 -0
  35. package/node_modules/@aspectcode/core/dist/analysis/analyzer.js +240 -0
  36. package/node_modules/@aspectcode/core/dist/analysis/analyzer.js.map +1 -0
  37. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.d.ts +32 -0
  38. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.d.ts.map +1 -0
  39. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.js +133 -0
  40. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.js.map +1 -0
  41. package/node_modules/@aspectcode/core/dist/analysis/importParsers.d.ts +30 -0
  42. package/node_modules/@aspectcode/core/dist/analysis/importParsers.d.ts.map +1 -0
  43. package/node_modules/@aspectcode/core/dist/analysis/importParsers.js +92 -0
  44. package/node_modules/@aspectcode/core/dist/analysis/importParsers.js.map +1 -0
  45. package/node_modules/@aspectcode/core/dist/analysis/index.d.ts +9 -0
  46. package/node_modules/@aspectcode/core/dist/analysis/index.d.ts.map +1 -0
  47. package/node_modules/@aspectcode/core/dist/analysis/index.js +9 -0
  48. package/node_modules/@aspectcode/core/dist/analysis/index.js.map +1 -0
  49. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.d.ts +34 -0
  50. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.d.ts.map +1 -0
  51. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.js +240 -0
  52. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.js.map +1 -0
  53. package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts +33 -0
  54. package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -0
  55. package/node_modules/@aspectcode/core/dist/analysis/repo.js +246 -0
  56. package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -0
  57. package/node_modules/@aspectcode/core/dist/classifiers.d.ts +24 -0
  58. package/node_modules/@aspectcode/core/dist/classifiers.d.ts.map +1 -0
  59. package/node_modules/@aspectcode/core/dist/classifiers.js +119 -0
  60. package/node_modules/@aspectcode/core/dist/classifiers.js.map +1 -0
  61. package/node_modules/@aspectcode/core/dist/fs/exclusions.d.ts +26 -0
  62. package/node_modules/@aspectcode/core/dist/fs/exclusions.d.ts.map +1 -0
  63. package/node_modules/@aspectcode/core/dist/fs/exclusions.js +130 -0
  64. package/node_modules/@aspectcode/core/dist/fs/exclusions.js.map +1 -0
  65. package/node_modules/@aspectcode/core/dist/fs/fingerprint.d.ts +42 -0
  66. package/node_modules/@aspectcode/core/dist/fs/fingerprint.d.ts.map +1 -0
  67. package/node_modules/@aspectcode/core/dist/fs/fingerprint.js +125 -0
  68. package/node_modules/@aspectcode/core/dist/fs/fingerprint.js.map +1 -0
  69. package/node_modules/@aspectcode/core/dist/fs/index.d.ts +9 -0
  70. package/node_modules/@aspectcode/core/dist/fs/index.d.ts.map +1 -0
  71. package/node_modules/@aspectcode/core/dist/fs/index.js +26 -0
  72. package/node_modules/@aspectcode/core/dist/fs/index.js.map +1 -0
  73. package/node_modules/@aspectcode/core/dist/fs/walker.d.ts +23 -0
  74. package/node_modules/@aspectcode/core/dist/fs/walker.d.ts.map +1 -0
  75. package/node_modules/@aspectcode/core/dist/fs/walker.js +94 -0
  76. package/node_modules/@aspectcode/core/dist/fs/walker.js.map +1 -0
  77. package/node_modules/@aspectcode/core/dist/host.d.ts +38 -0
  78. package/node_modules/@aspectcode/core/dist/host.d.ts.map +1 -0
  79. package/node_modules/@aspectcode/core/dist/host.js +110 -0
  80. package/node_modules/@aspectcode/core/dist/host.js.map +1 -0
  81. package/node_modules/@aspectcode/core/dist/index.d.ts +23 -0
  82. package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -0
  83. package/node_modules/@aspectcode/core/dist/index.js +59 -0
  84. package/node_modules/@aspectcode/core/dist/index.js.map +1 -0
  85. package/node_modules/@aspectcode/core/dist/model.d.ts +90 -0
  86. package/node_modules/@aspectcode/core/dist/model.d.ts.map +1 -0
  87. package/node_modules/@aspectcode/core/dist/model.js +9 -0
  88. package/node_modules/@aspectcode/core/dist/model.js.map +1 -0
  89. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.d.ts +17 -0
  90. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.d.ts.map +1 -0
  91. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.js +225 -0
  92. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.js.map +1 -0
  93. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.d.ts +30 -0
  94. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.d.ts.map +1 -0
  95. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.js +71 -0
  96. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.js.map +1 -0
  97. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +13 -0
  98. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -0
  99. package/node_modules/@aspectcode/core/dist/parsers/index.js +32 -0
  100. package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -0
  101. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.d.ts +17 -0
  102. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.d.ts.map +1 -0
  103. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.js +182 -0
  104. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.js.map +1 -0
  105. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +44 -0
  106. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -0
  107. package/node_modules/@aspectcode/core/dist/parsers/languages.js +64 -0
  108. package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -0
  109. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.d.ts +18 -0
  110. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.d.ts.map +1 -0
  111. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.js +139 -0
  112. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.js.map +1 -0
  113. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts +22 -0
  114. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -0
  115. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +240 -0
  116. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -0
  117. package/node_modules/@aspectcode/core/dist/parsers/utils.d.ts +7 -0
  118. package/node_modules/@aspectcode/core/dist/parsers/utils.d.ts.map +1 -0
  119. package/node_modules/@aspectcode/core/dist/parsers/utils.js +11 -0
  120. package/node_modules/@aspectcode/core/dist/parsers/utils.js.map +1 -0
  121. package/node_modules/@aspectcode/core/dist/paths.d.ts +27 -0
  122. package/node_modules/@aspectcode/core/dist/paths.d.ts.map +1 -0
  123. package/node_modules/@aspectcode/core/dist/paths.js +45 -0
  124. package/node_modules/@aspectcode/core/dist/paths.js.map +1 -0
  125. package/node_modules/@aspectcode/core/dist/stats.d.ts +41 -0
  126. package/node_modules/@aspectcode/core/dist/stats.d.ts.map +1 -0
  127. package/node_modules/@aspectcode/core/dist/stats.js +88 -0
  128. package/node_modules/@aspectcode/core/dist/stats.js.map +1 -0
  129. package/node_modules/@aspectcode/core/package.json +41 -0
  130. package/node_modules/@aspectcode/core/parsers/c_sharp.wasm +0 -0
  131. package/node_modules/@aspectcode/core/parsers/java.wasm +0 -0
  132. package/node_modules/@aspectcode/core/parsers/javascript.wasm +0 -0
  133. package/node_modules/@aspectcode/core/parsers/python.wasm +0 -0
  134. package/node_modules/@aspectcode/core/parsers/tree-sitter.wasm +0 -0
  135. package/node_modules/@aspectcode/core/parsers/tsx.wasm +0 -0
  136. package/node_modules/@aspectcode/core/parsers/typescript.wasm +0 -0
  137. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +72 -0
  138. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +1 -0
  139. package/node_modules/@aspectcode/emitters/dist/emitter.js +10 -0
  140. package/node_modules/@aspectcode/emitters/dist/emitter.js.map +1 -0
  141. package/node_modules/@aspectcode/emitters/dist/host.d.ts +31 -0
  142. package/node_modules/@aspectcode/emitters/dist/host.d.ts.map +1 -0
  143. package/node_modules/@aspectcode/emitters/dist/host.js +86 -0
  144. package/node_modules/@aspectcode/emitters/dist/host.js.map +1 -0
  145. package/node_modules/@aspectcode/emitters/dist/index.d.ts +27 -0
  146. package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -0
  147. package/node_modules/@aspectcode/emitters/dist/index.js +116 -0
  148. package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -0
  149. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +15 -0
  150. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +1 -0
  151. package/node_modules/@aspectcode/emitters/dist/instructions/content.js +289 -0
  152. package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +1 -0
  153. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +13 -0
  154. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +1 -0
  155. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +55 -0
  156. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +1 -0
  157. package/node_modules/@aspectcode/emitters/dist/instructions/formats.d.ts +17 -0
  158. package/node_modules/@aspectcode/emitters/dist/instructions/formats.d.ts.map +1 -0
  159. package/node_modules/@aspectcode/emitters/dist/instructions/formats.js +23 -0
  160. package/node_modules/@aspectcode/emitters/dist/instructions/formats.js.map +1 -0
  161. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +5 -0
  162. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -0
  163. package/node_modules/@aspectcode/emitters/dist/instructions/index.js +12 -0
  164. package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -0
  165. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +9 -0
  166. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +1 -0
  167. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +30 -0
  168. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +1 -0
  169. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +64 -0
  170. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -0
  171. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +504 -0
  172. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -0
  173. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.d.ts +24 -0
  174. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.d.ts.map +1 -0
  175. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.js +238 -0
  176. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.js.map +1 -0
  177. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.d.ts +8 -0
  178. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.d.ts.map +1 -0
  179. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.js +14 -0
  180. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.js.map +1 -0
  181. package/node_modules/@aspectcode/emitters/dist/kb/constants.d.ts +35 -0
  182. package/node_modules/@aspectcode/emitters/dist/kb/constants.d.ts.map +1 -0
  183. package/node_modules/@aspectcode/emitters/dist/kb/constants.js +38 -0
  184. package/node_modules/@aspectcode/emitters/dist/kb/constants.js.map +1 -0
  185. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.d.ts +20 -0
  186. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.d.ts.map +1 -0
  187. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.js +155 -0
  188. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.js.map +1 -0
  189. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +52 -0
  190. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -0
  191. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +391 -0
  192. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -0
  193. package/node_modules/@aspectcode/emitters/dist/kb/depData.d.ts +18 -0
  194. package/node_modules/@aspectcode/emitters/dist/kb/depData.d.ts.map +1 -0
  195. package/node_modules/@aspectcode/emitters/dist/kb/depData.js +31 -0
  196. package/node_modules/@aspectcode/emitters/dist/kb/depData.js.map +1 -0
  197. package/node_modules/@aspectcode/emitters/dist/kb/detectors.d.ts +18 -0
  198. package/node_modules/@aspectcode/emitters/dist/kb/detectors.d.ts.map +1 -0
  199. package/node_modules/@aspectcode/emitters/dist/kb/detectors.js +317 -0
  200. package/node_modules/@aspectcode/emitters/dist/kb/detectors.js.map +1 -0
  201. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.d.ts +33 -0
  202. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.d.ts.map +1 -0
  203. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.js +323 -0
  204. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.js.map +1 -0
  205. package/node_modules/@aspectcode/emitters/dist/kb/helpers.d.ts +27 -0
  206. package/node_modules/@aspectcode/emitters/dist/kb/helpers.d.ts.map +1 -0
  207. package/node_modules/@aspectcode/emitters/dist/kb/helpers.js +63 -0
  208. package/node_modules/@aspectcode/emitters/dist/kb/helpers.js.map +1 -0
  209. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +27 -0
  210. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -0
  211. package/node_modules/@aspectcode/emitters/dist/kb/index.js +72 -0
  212. package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -0
  213. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +21 -0
  214. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +1 -0
  215. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +125 -0
  216. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +1 -0
  217. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.d.ts +26 -0
  218. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.d.ts.map +1 -0
  219. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.js +255 -0
  220. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.js.map +1 -0
  221. package/node_modules/@aspectcode/emitters/dist/kb/policy.d.ts +12 -0
  222. package/node_modules/@aspectcode/emitters/dist/kb/policy.d.ts.map +1 -0
  223. package/node_modules/@aspectcode/emitters/dist/kb/policy.js +29 -0
  224. package/node_modules/@aspectcode/emitters/dist/kb/policy.js.map +1 -0
  225. package/node_modules/@aspectcode/emitters/dist/kb/symbols.d.ts +43 -0
  226. package/node_modules/@aspectcode/emitters/dist/kb/symbols.d.ts.map +1 -0
  227. package/node_modules/@aspectcode/emitters/dist/kb/symbols.js +343 -0
  228. package/node_modules/@aspectcode/emitters/dist/kb/symbols.js.map +1 -0
  229. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +37 -0
  230. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +1 -0
  231. package/node_modules/@aspectcode/emitters/dist/manifest.js +50 -0
  232. package/node_modules/@aspectcode/emitters/dist/manifest.js.map +1 -0
  233. package/node_modules/@aspectcode/emitters/dist/report.d.ts +22 -0
  234. package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +1 -0
  235. package/node_modules/@aspectcode/emitters/dist/report.js +3 -0
  236. package/node_modules/@aspectcode/emitters/dist/report.js.map +1 -0
  237. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +14 -0
  238. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +1 -0
  239. package/node_modules/@aspectcode/emitters/dist/stableJson.js +40 -0
  240. package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +1 -0
  241. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +29 -0
  242. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +1 -0
  243. package/node_modules/@aspectcode/emitters/dist/transaction.js +104 -0
  244. package/node_modules/@aspectcode/emitters/dist/transaction.js.map +1 -0
  245. package/node_modules/@aspectcode/emitters/package.json +39 -0
  246. package/node_modules/@aspectcode/optimizer/dist/agent.d.ts +18 -0
  247. package/node_modules/@aspectcode/optimizer/dist/agent.d.ts.map +1 -0
  248. package/node_modules/@aspectcode/optimizer/dist/agent.js +123 -0
  249. package/node_modules/@aspectcode/optimizer/dist/agent.js.map +1 -0
  250. package/node_modules/@aspectcode/optimizer/dist/index.d.ts +15 -0
  251. package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -0
  252. package/node_modules/@aspectcode/optimizer/dist/index.js +31 -0
  253. package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -0
  254. package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts +39 -0
  255. package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts.map +1 -0
  256. package/node_modules/@aspectcode/optimizer/dist/prompts.js +156 -0
  257. package/node_modules/@aspectcode/optimizer/dist/prompts.js.map +1 -0
  258. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts +20 -0
  259. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -0
  260. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +126 -0
  261. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -0
  262. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +28 -0
  263. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -0
  264. package/node_modules/@aspectcode/optimizer/dist/providers/index.js +142 -0
  265. package/node_modules/@aspectcode/optimizer/dist/providers/index.js.map +1 -0
  266. package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts +19 -0
  267. package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -0
  268. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +98 -0
  269. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -0
  270. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +19 -0
  271. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -0
  272. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +87 -0
  273. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -0
  274. package/node_modules/@aspectcode/optimizer/dist/types.d.ts +93 -0
  275. package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -0
  276. package/node_modules/@aspectcode/optimizer/dist/types.js +20 -0
  277. package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -0
  278. package/node_modules/@aspectcode/optimizer/package.json +41 -0
  279. package/package.json +11 -3
  280. package/dist/commands/deps.d.ts +0 -3
  281. package/dist/commands/deps.d.ts.map +0 -1
  282. package/dist/commands/deps.js +0 -39
  283. package/dist/commands/deps.js.map +0 -1
  284. package/dist/commands/generate.d.ts +0 -8
  285. package/dist/commands/generate.d.ts.map +0 -1
  286. package/dist/commands/generate.js +0 -176
  287. package/dist/commands/generate.js.map +0 -1
  288. package/dist/commands/impact.d.ts +0 -9
  289. package/dist/commands/impact.d.ts.map +0 -1
  290. package/dist/commands/impact.js +0 -162
  291. package/dist/commands/impact.js.map +0 -1
  292. package/dist/commands/init.d.ts +0 -11
  293. package/dist/commands/init.d.ts.map +0 -1
  294. package/dist/commands/init.js +0 -204
  295. package/dist/commands/init.js.map +0 -1
  296. package/dist/commands/settings.d.ts +0 -13
  297. package/dist/commands/settings.d.ts.map +0 -1
  298. package/dist/commands/settings.js +0 -196
  299. package/dist/commands/settings.js.map +0 -1
  300. package/dist/commands/watch.d.ts +0 -6
  301. package/dist/commands/watch.d.ts.map +0 -1
  302. package/dist/commands/watch.js +0 -181
  303. package/dist/commands/watch.js.map +0 -1
  304. package/dist/connections.d.ts +0 -24
  305. package/dist/connections.d.ts.map +0 -1
  306. package/dist/connections.js +0 -89
  307. package/dist/connections.js.map +0 -1
@@ -1,204 +0,0 @@
1
- "use strict";
2
- /**
3
- * `aspectcode init` — create an `aspectcode.json` config file.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.runInit = runInit;
40
- const fs = __importStar(require("fs"));
41
- const path = __importStar(require("path"));
42
- const readline = __importStar(require("readline"));
43
- const config_1 = require("../config");
44
- const cli_1 = require("../cli");
45
- const logger_1 = require("../logger");
46
- const settings_1 = require("./settings");
47
- const watch_1 = require("./watch");
48
- async function runInit(ctx, deps = {}) {
49
- const { root, flags, log } = ctx;
50
- (0, settings_1.printAspectCodeBanner)(log);
51
- const dest = (0, config_1.configPath)(root);
52
- // Guard: config already exists
53
- const existing = (0, config_1.loadConfig)(root);
54
- if (existing && !flags.force) {
55
- log.warn(`${config_1.CONFIG_FILE_NAME} already exists. Use ${logger_1.fmt.bold('--force')} to overwrite.`);
56
- return { exitCode: cli_1.ExitCode.OK };
57
- }
58
- const config = await resolveInitConfig(flags);
59
- const content = JSON.stringify(config, null, 2) + '\n';
60
- fs.mkdirSync(path.dirname(dest), { recursive: true });
61
- fs.writeFileSync(dest, content, 'utf-8');
62
- log.success(`Created ${logger_1.fmt.cyan(config_1.CONFIG_FILE_NAME)}`);
63
- log.info('');
64
- log.info(` Next step: run ${logger_1.fmt.bold('aspectcode generate')} to build the knowledge base.`);
65
- log.info(` Edit ${logger_1.fmt.cyan(config_1.CONFIG_FILE_NAME)} to customise output and exclusions.`);
66
- if (!flags.quiet && isInteractiveTty()) {
67
- const startWatchNow = await askYesNo('Start watch now?', false);
68
- if (startWatchNow) {
69
- const watchRunner = deps.runWatchFn ?? watch_1.runWatch;
70
- return await watchRunner({ root, flags, config, log, positionals: [] });
71
- }
72
- }
73
- return { exitCode: cli_1.ExitCode.OK };
74
- }
75
- async function resolveInitConfig(flags) {
76
- const defaults = (0, config_1.defaultConfig)();
77
- if (flags.quiet || !isInteractiveTty()) {
78
- return defaults;
79
- }
80
- const updateRate = await selectUpdateRate(defaults.updateRate ?? 'onChange');
81
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
82
- try {
83
- const outDirAnswer = (await ask(rl, 'Where should generated files be written? (leave blank for workspace root): ')).trim();
84
- const outDir = outDirAnswer || undefined;
85
- const excludeAnswer = await ask(rl, 'Any paths to exclude from analysis? (comma-separated, leave blank for none): ');
86
- const exclude = parseExcludeList(excludeAnswer);
87
- return {
88
- ...defaults,
89
- updateRate,
90
- ...(outDir ? { outDir } : {}),
91
- ...(exclude.length > 0 ? { exclude } : {}),
92
- };
93
- }
94
- finally {
95
- rl.close();
96
- }
97
- }
98
- function ask(rl, question) {
99
- return new Promise((resolve) => {
100
- rl.question(question, (answer) => resolve(answer));
101
- });
102
- }
103
- async function askYesNo(question, defaultValue) {
104
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
105
- const defaultHint = defaultValue ? '[Y/n]' : '[y/N]';
106
- try {
107
- const answer = (await ask(rl, `${question} ${defaultHint} `)).trim().toLowerCase();
108
- if (!answer) {
109
- return defaultValue;
110
- }
111
- return answer === 'y' || answer === 'yes';
112
- }
113
- finally {
114
- rl.close();
115
- }
116
- }
117
- async function selectUpdateRate(defaultRate) {
118
- const options = ['onChange', 'idle', 'manual'];
119
- const fallback = defaultRate === 'manual' || defaultRate === 'idle' || defaultRate === 'onChange'
120
- ? defaultRate
121
- : 'onChange';
122
- const selected = await selectWithArrowKeys('Update rate (arrow keys + Enter):', options, options.indexOf(fallback) >= 0 ? options.indexOf(fallback) : 0);
123
- return selected;
124
- }
125
- async function selectWithArrowKeys(prompt, options, initialIndex) {
126
- if (options.length === 0) {
127
- throw new Error('selectWithArrowKeys requires at least one option');
128
- }
129
- if (!isInteractiveTty()) {
130
- const boundedIndex = Math.min(Math.max(initialIndex, 0), options.length - 1);
131
- return options[boundedIndex];
132
- }
133
- const input = process.stdin;
134
- const output = process.stdout;
135
- let index = Math.min(Math.max(initialIndex, 0), options.length - 1);
136
- let renderedLines = 0;
137
- const render = () => {
138
- if (renderedLines > 0) {
139
- readline.moveCursor(output, 0, -renderedLines);
140
- readline.cursorTo(output, 0);
141
- readline.clearScreenDown(output);
142
- }
143
- const lines = [
144
- `${prompt} ${logger_1.fmt.dim('(↑/↓ then Enter)')}`,
145
- ...options.map((option, optionIndex) => {
146
- const marker = optionIndex === index ? logger_1.fmt.cyan('❯') : ' ';
147
- return `${marker} ${option}`;
148
- }),
149
- ];
150
- output.write(lines.join('\n') + '\n');
151
- renderedLines = lines.length;
152
- };
153
- return await new Promise((resolve, reject) => {
154
- const previousRawMode = input.isRaw === true;
155
- const cleanup = () => {
156
- input.off('keypress', onKeypress);
157
- if (typeof input.setRawMode === 'function') {
158
- input.setRawMode(previousRawMode);
159
- }
160
- input.pause();
161
- readline.cursorTo(output, 0);
162
- readline.clearScreenDown(output);
163
- output.write(`${prompt} ${logger_1.fmt.cyan(options[index])}\n`);
164
- };
165
- const onKeypress = (_str, key) => {
166
- if (key.name === 'up') {
167
- index = index > 0 ? index - 1 : options.length - 1;
168
- render();
169
- return;
170
- }
171
- if (key.name === 'down') {
172
- index = index < options.length - 1 ? index + 1 : 0;
173
- render();
174
- return;
175
- }
176
- if (key.name === 'return' || key.name === 'enter') {
177
- cleanup();
178
- resolve(options[index]);
179
- return;
180
- }
181
- if (key.ctrl && key.name === 'c') {
182
- cleanup();
183
- reject(new Error('Cancelled by user'));
184
- }
185
- };
186
- readline.emitKeypressEvents(input);
187
- if (typeof input.setRawMode === 'function') {
188
- input.setRawMode(true);
189
- }
190
- input.resume();
191
- input.on('keypress', onKeypress);
192
- render();
193
- });
194
- }
195
- function isInteractiveTty() {
196
- return process.stdin.isTTY === true && process.stdout.isTTY === true;
197
- }
198
- function parseExcludeList(input) {
199
- return input
200
- .split(',')
201
- .map((part) => part.trim())
202
- .filter((part) => part.length > 0);
203
- }
204
- //# sourceMappingURL=init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBH,0BAsCC;AA5DD,uCAAyB;AACzB,2CAA6B;AAC7B,mDAAqC;AACrC,sCAMmB;AAEnB,gCAAkC;AAClC,sCAAgC;AAChC,yCAAmD;AACnD,mCAAmC;AAQ5B,KAAK,UAAU,OAAO,CAC3B,GAAmB,EACnB,OAAiB,EAAE;IAEnB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IACjC,IAAA,gCAAqB,EAAC,GAAG,CAAC,CAAC;IAE3B,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAE9B,+BAA+B;IAC/B,MAAM,QAAQ,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAClC,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC7B,GAAG,CAAC,IAAI,CACN,GAAG,yBAAgB,wBAAwB,YAAG,CAAC,IAAI,CAAC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AE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * `aspectcode` settings commands.
3
- */
4
- import type { CommandContext, CommandResult } from '../cli';
5
- import type { Logger } from '../logger';
6
- export declare function printAspectCodeBanner(log: Logger): void;
7
- export declare function runShowConfig(ctx: CommandContext): Promise<CommandResult>;
8
- export declare function runSetUpdateRate(ctx: CommandContext, value: string): Promise<CommandResult>;
9
- export declare function runSetOutDir(ctx: CommandContext, value: string): Promise<CommandResult>;
10
- export declare function runClearOutDir(ctx: CommandContext): Promise<CommandResult>;
11
- export declare function runAddExclude(ctx: CommandContext, value: string): Promise<CommandResult>;
12
- export declare function runRemoveExclude(ctx: CommandContext, value: string): Promise<CommandResult>;
13
- //# sourceMappingURL=settings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/commands/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAY,cAAc,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAkBxC,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAcvD;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CAexB;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CASxB;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,aAAa,CAAC,CAIxB;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CAaxB;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CAcxB"}
@@ -1,196 +0,0 @@
1
- "use strict";
2
- /**
3
- * `aspectcode` settings commands.
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.printAspectCodeBanner = printAspectCodeBanner;
7
- exports.runShowConfig = runShowConfig;
8
- exports.runSetUpdateRate = runSetUpdateRate;
9
- exports.runSetOutDir = runSetOutDir;
10
- exports.runClearOutDir = runClearOutDir;
11
- exports.runAddExclude = runAddExclude;
12
- exports.runRemoveExclude = runRemoveExclude;
13
- const cli_1 = require("../cli");
14
- const config_1 = require("../config");
15
- const logger_1 = require("../logger");
16
- function printAspectCodeBanner(log) {
17
- const lines = [
18
- ' ___ ____ ____ _____ ____ _____ ____ ___ ____ _____',
19
- ' / _ \\ / ___|| _ \\| ____/ ___|_ _| / ___/ _ \\| _ \\| ____|',
20
- '| | | |\\___ \\| |_) | _|| | | | | | | | | | | | | _|',
21
- '| |_| | ___) | __/| |__| |___ | | | |__| |_| | |_| | |___',
22
- ' \\___/ |____/|_| |_____\\____| |_| \\____\\___/|____/|_____|',
23
- ' ASPECT CODE',
24
- ];
25
- for (const line of lines) {
26
- log.info(logger_1.fmt.blue(line));
27
- }
28
- log.blank();
29
- }
30
- async function runShowConfig(ctx) {
31
- const { root, flags, log } = ctx;
32
- const command = 'show-config';
33
- try {
34
- const current = (0, config_1.loadRawConfig)(root) ?? {};
35
- const displayConfig = withCanonicalUpdateRate(current);
36
- if (flags.json) {
37
- emitJson({
38
- ok: true,
39
- command,
40
- config: displayConfig,
41
- });
42
- }
43
- else {
44
- log.info(JSON.stringify(displayConfig, null, 2));
45
- }
46
- return { exitCode: cli_1.ExitCode.OK };
47
- }
48
- catch (error) {
49
- return outputError(command, flags, log, error);
50
- }
51
- }
52
- async function runSetUpdateRate(ctx, value) {
53
- const parsed = parseUpdateRate(value);
54
- if (!parsed) {
55
- return outputUsageError('set-update-rate', ctx.flags, ctx.log, `Invalid update rate: ${logger_1.fmt.bold(value)}. Expected manual|onChange|idle.`);
56
- }
57
- return runSettingsMutation(ctx, 'set-update-rate', ['updateRate', 'autoRegenerateKb'], (cfg) => {
58
- cfg.updateRate = parsed;
59
- delete cfg.autoRegenerateKb;
60
- });
61
- }
62
- async function runSetOutDir(ctx, value) {
63
- const outDir = value.trim();
64
- if (!outDir) {
65
- return outputUsageError('set-out-dir', ctx.flags, ctx.log, `${logger_1.fmt.bold('set-out-dir')} requires a non-empty path value.`);
66
- }
67
- return runSettingsMutation(ctx, 'set-out-dir', ['outDir'], (cfg) => {
68
- cfg.outDir = outDir;
69
- });
70
- }
71
- async function runClearOutDir(ctx) {
72
- return runSettingsMutation(ctx, 'clear-out-dir', ['outDir'], (cfg) => {
73
- delete cfg.outDir;
74
- });
75
- }
76
- async function runAddExclude(ctx, value) {
77
- const excludePath = value.trim();
78
- if (!excludePath) {
79
- return outputUsageError('add-exclude', ctx.flags, ctx.log, `${logger_1.fmt.bold('add-exclude')} requires a non-empty path value.`);
80
- }
81
- return runSettingsMutation(ctx, 'add-exclude', ['exclude'], (cfg) => {
82
- const list = normalizeExcludeList(cfg.exclude);
83
- if (!list.includes(excludePath)) {
84
- list.push(excludePath);
85
- }
86
- cfg.exclude = list;
87
- });
88
- }
89
- async function runRemoveExclude(ctx, value) {
90
- const excludePath = value.trim();
91
- if (!excludePath) {
92
- return outputUsageError('remove-exclude', ctx.flags, ctx.log, `${logger_1.fmt.bold('remove-exclude')} requires a non-empty path value.`);
93
- }
94
- return runSettingsMutation(ctx, 'remove-exclude', ['exclude'], (cfg) => {
95
- const list = normalizeExcludeList(cfg.exclude).filter((entry) => entry !== excludePath);
96
- if (list.length > 0) {
97
- cfg.exclude = list;
98
- }
99
- else {
100
- delete cfg.exclude;
101
- }
102
- });
103
- }
104
- // ── Shared mutation runner ───────────────────────────────────
105
- /**
106
- * Generic helper for settings mutation commands.
107
- *
108
- * Encapsulates the try/catch + load → mutate → save → output pattern
109
- * shared by all mutation commands.
110
- */
111
- function runSettingsMutation(ctx, command, changed, mutate) {
112
- const { root, flags, log } = ctx;
113
- try {
114
- const nextConfig = updateRawConfig(root, mutate);
115
- return outputSuccess(command, flags, log, nextConfig, changed);
116
- }
117
- catch (error) {
118
- return outputError(command, flags, log, error);
119
- }
120
- }
121
- function updateRawConfig(root, apply) {
122
- const nextConfig = { ...((0, config_1.loadRawConfig)(root) ?? {}) };
123
- apply(nextConfig);
124
- (0, config_1.saveRawConfig)(root, nextConfig);
125
- return nextConfig;
126
- }
127
- function withCanonicalUpdateRate(config) {
128
- if (config.updateRate || !config.autoRegenerateKb) {
129
- return { ...config };
130
- }
131
- let mapped;
132
- if (config.autoRegenerateKb === 'off') {
133
- mapped = 'manual';
134
- }
135
- else if (config.autoRegenerateKb === 'onSave') {
136
- mapped = 'onChange';
137
- }
138
- else if (config.autoRegenerateKb === 'idle') {
139
- mapped = 'idle';
140
- }
141
- if (!mapped) {
142
- return { ...config };
143
- }
144
- return {
145
- ...config,
146
- updateRate: mapped,
147
- };
148
- }
149
- function parseUpdateRate(value) {
150
- const normalized = value.trim();
151
- if (normalized === 'manual' || normalized === 'onChange' || normalized === 'idle') {
152
- return normalized;
153
- }
154
- return undefined;
155
- }
156
- function normalizeExcludeList(value) {
157
- if (!Array.isArray(value)) {
158
- return [];
159
- }
160
- return value.filter((item) => typeof item === 'string');
161
- }
162
- function outputSuccess(command, flags, log, config, changed) {
163
- if (flags.json) {
164
- const payload = { ok: true, command, config, changed };
165
- emitJson(payload);
166
- }
167
- else {
168
- log.success(`Updated ${logger_1.fmt.cyan('aspectcode.json')} via ${logger_1.fmt.bold(command)}.`);
169
- }
170
- return { exitCode: cli_1.ExitCode.OK };
171
- }
172
- function outputUsageError(command, flags, log, message) {
173
- if (flags.json) {
174
- const payload = { ok: false, command, error: message };
175
- emitJson(payload);
176
- }
177
- else {
178
- log.error(message);
179
- }
180
- return { exitCode: cli_1.ExitCode.USAGE };
181
- }
182
- function outputError(command, flags, log, error) {
183
- const message = error instanceof Error ? error.message : String(error);
184
- if (flags.json) {
185
- const payload = { ok: false, command, error: message };
186
- emitJson(payload);
187
- }
188
- else {
189
- log.error(message);
190
- }
191
- return { exitCode: cli_1.ExitCode.ERROR };
192
- }
193
- function emitJson(payload) {
194
- console.log(JSON.stringify(payload, null, 2));
195
- }
196
- //# sourceMappingURL=settings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/commands/settings.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAuBH,sDAcC;AAED,sCAwBC;AAED,4CAkBC;AAED,oCAYC;AAED,wCAMC;AAED,sCAgBC;AAED,4CAiBC;AA3ID,gCAAkC;AAClC,sCAAmF;AAEnF,sCAAgC;AAiBhC,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,MAAM,KAAK,GAAG;QACZ,+DAA+D;QAC/D,oEAAoE;QACpE,gEAAgE;QAChE,+DAA+D;QAC/D,oEAAoE;QACpE,sCAAsC;KACvC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,GAAG,CAAC,IAAI,CAAC,YAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,GAAG,CAAC,KAAK,EAAE,CAAC;AACd,CAAC;AAEM,KAAK,UAAU,aAAa,CACjC,GAAmB;IAEnB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IACjC,MAAM,OAAO,GAAG,aAAa,CAAC;IAE9B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1C,MAAM,aAAa,GAAG,uB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AAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,OAAO,GAAqB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACzE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,cAAQ,CAAC,KAAK,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,QAAQ,CAAC,OAA8C;IAC9D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { CliFlags, CommandContext, CommandResult } from '../cli';
2
- import type { AspectCodeConfig } from '../config';
3
- export type WatchMode = 'manual' | 'onChange' | 'idle';
4
- export declare function resolveWatchMode(flags: CliFlags, config: AspectCodeConfig | undefined): WatchMode;
5
- export declare function runWatch(ctx: CommandContext): Promise<CommandResult>;
6
- //# sourceMappingURL=watch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAuBvD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,gBAAgB,GAAG,SAAS,GACnC,SAAS,CAEX;AAYD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA2H1E"}
@@ -1,181 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.resolveWatchMode = resolveWatchMode;
37
- exports.runWatch = runWatch;
38
- const path = __importStar(require("path"));
39
- const core_1 = require("@aspectcode/core");
40
- const cli_1 = require("../cli");
41
- const logger_1 = require("../logger");
42
- const generate_1 = require("./generate");
43
- const ON_CHANGE_DEBOUNCE_MS = 2000;
44
- const IDLE_DEBOUNCE_MS = 30000;
45
- const IGNORED_SEGMENTS = [
46
- '/node_modules/',
47
- '/.git/',
48
- '/.aspect/',
49
- '/dist/',
50
- '/build/',
51
- '/target/',
52
- '/coverage/',
53
- '/.next/',
54
- '/__pycache__/',
55
- '/.venv/',
56
- '/venv/',
57
- '/.pytest_cache/',
58
- '/.mypy_cache/',
59
- '/.tox/',
60
- '/htmlcov/',
61
- ];
62
- function resolveWatchMode(flags, config) {
63
- return flags.mode ?? config?.updateRate ?? 'onChange';
64
- }
65
- function isSupportedSourceFile(filePath) {
66
- const ext = path.extname(filePath).toLowerCase();
67
- return core_1.SUPPORTED_EXTENSIONS.includes(ext);
68
- }
69
- function isIgnoredPath(filePath) {
70
- const normalized = filePath.replace(/\\/g, '/').toLowerCase();
71
- return IGNORED_SEGMENTS.some((seg) => normalized.includes(seg));
72
- }
73
- async function runWatch(ctx) {
74
- const { root, flags, config, log } = ctx;
75
- const chokidarModule = await Promise.resolve().then(() => __importStar(require('chokidar')));
76
- // Handle both ESM default export and CJS module shapes
77
- const chokidar = chokidarModule.default ?? chokidarModule;
78
- const mode = resolveWatchMode(flags, config);
79
- const exts = core_1.SUPPORTED_EXTENSIONS.map((ext) => ext.slice(1)).join(',');
80
- log.info(`Workspace: ${logger_1.fmt.cyan(root)}`);
81
- log.info(`Mode: ${logger_1.fmt.cyan(mode)}`);
82
- log.info(`Watching: ${logger_1.fmt.dim(`**/*.{${exts}}`)}`);
83
- log.info(logger_1.fmt.dim('No initial run. Waiting for file changes...'));
84
- log.blank();
85
- const watcher = chokidar.watch('.', {
86
- cwd: root,
87
- ignoreInitial: true,
88
- awaitWriteFinish: {
89
- stabilityThreshold: 200,
90
- pollInterval: 100,
91
- },
92
- ignored: (watchedPath) => {
93
- const abs = path.resolve(root, watchedPath);
94
- return isIgnoredPath(abs);
95
- },
96
- });
97
- let timer;
98
- let running = false;
99
- let pending = false;
100
- let stopped = false;
101
- const triggerGenerate = async (reason) => {
102
- if (stopped)
103
- return;
104
- if (running) {
105
- pending = true;
106
- log.debug(`[watch] generation already in progress; queued (${reason})`);
107
- return;
108
- }
109
- running = true;
110
- try {
111
- log.info(`${logger_1.fmt.bold('watch')} trigger: ${reason}`);
112
- await (0, generate_1.runGenerate)({ root, flags: { ...flags, listConnections: false, json: false }, config, log, positionals: [] });
113
- }
114
- catch (error) {
115
- const msg = error instanceof Error ? error.message : String(error);
116
- log.error(`watch regeneration failed: ${msg}`);
117
- }
118
- finally {
119
- running = false;
120
- if (pending && !stopped) {
121
- pending = false;
122
- void triggerGenerate('queued changes');
123
- }
124
- }
125
- };
126
- const scheduleOnChange = (reason) => {
127
- if (mode === 'manual') {
128
- log.debug(`[watch] change detected (${reason}) but mode=manual`);
129
- return;
130
- }
131
- if (timer) {
132
- clearTimeout(timer);
133
- }
134
- const delay = mode === 'idle' ? IDLE_DEBOUNCE_MS : ON_CHANGE_DEBOUNCE_MS;
135
- timer = setTimeout(() => {
136
- timer = undefined;
137
- void triggerGenerate(reason);
138
- }, delay);
139
- };
140
- const onFsEvent = (eventType, eventPath) => {
141
- const abs = path.resolve(root, eventPath);
142
- if (!isSupportedSourceFile(abs) || isIgnoredPath(abs)) {
143
- return;
144
- }
145
- scheduleOnChange(`${eventType}: ${eventPath.replace(/\\/g, '/')}`);
146
- };
147
- watcher.on('add', (p) => onFsEvent('add', p));
148
- watcher.on('change', (p) => onFsEvent('change', p));
149
- watcher.on('unlink', (p) => onFsEvent('unlink', p));
150
- watcher.on('error', (e) => {
151
- log.error(`watcher error: ${String(e)}`);
152
- });
153
- await new Promise((resolve) => {
154
- watcher.once('ready', () => resolve());
155
- });
156
- log.info(logger_1.fmt.dim('Watcher ready.'));
157
- return await new Promise((resolve) => {
158
- const shutdown = async (signal) => {
159
- if (stopped)
160
- return;
161
- stopped = true;
162
- if (timer) {
163
- clearTimeout(timer);
164
- timer = undefined;
165
- }
166
- log.blank();
167
- log.info(logger_1.fmt.dim(`Stopping watch (${signal})...`));
168
- await watcher.close();
169
- resolve({ exitCode: cli_1.ExitCode.OK });
170
- };
171
- const onSigInt = () => {
172
- void shutdown('SIGINT');
173
- };
174
- const onSigTerm = () => {
175
- void shutdown('SIGTERM');
176
- };
177
- process.once('SIGINT', onSigInt);
178
- process.once('SIGTERM', onSigTerm);
179
- });
180
- }
181
- //# sourceMappingURL=wat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