circle-ir-ai 1.1.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 (420) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/LICENSE +15 -0
  3. package/README.md +336 -0
  4. package/dist/action-queue/aggregator.d.ts +40 -0
  5. package/dist/action-queue/aggregator.d.ts.map +1 -0
  6. package/dist/action-queue/aggregator.js +375 -0
  7. package/dist/action-queue/aggregator.js.map +1 -0
  8. package/dist/action-queue/index.d.ts +14 -0
  9. package/dist/action-queue/index.d.ts.map +1 -0
  10. package/dist/action-queue/index.js +17 -0
  11. package/dist/action-queue/index.js.map +1 -0
  12. package/dist/action-queue/queue.d.ts +74 -0
  13. package/dist/action-queue/queue.d.ts.map +1 -0
  14. package/dist/action-queue/queue.js +433 -0
  15. package/dist/action-queue/queue.js.map +1 -0
  16. package/dist/action-queue/types.d.ts +162 -0
  17. package/dist/action-queue/types.d.ts.map +1 -0
  18. package/dist/action-queue/types.js +44 -0
  19. package/dist/action-queue/types.js.map +1 -0
  20. package/dist/agents/enrichment-agent.d.ts +16 -0
  21. package/dist/agents/enrichment-agent.d.ts.map +1 -0
  22. package/dist/agents/enrichment-agent.js +102 -0
  23. package/dist/agents/enrichment-agent.js.map +1 -0
  24. package/dist/agents/index.d.ts +12 -0
  25. package/dist/agents/index.d.ts.map +1 -0
  26. package/dist/agents/index.js +15 -0
  27. package/dist/agents/index.js.map +1 -0
  28. package/dist/agents/mastra/agents.d.ts +373 -0
  29. package/dist/agents/mastra/agents.d.ts.map +1 -0
  30. package/dist/agents/mastra/agents.js +347 -0
  31. package/dist/agents/mastra/agents.js.map +1 -0
  32. package/dist/agents/mastra/index.d.ts +12 -0
  33. package/dist/agents/mastra/index.d.ts.map +1 -0
  34. package/dist/agents/mastra/index.js +17 -0
  35. package/dist/agents/mastra/index.js.map +1 -0
  36. package/dist/agents/mastra/instance.d.ts +383 -0
  37. package/dist/agents/mastra/instance.d.ts.map +1 -0
  38. package/dist/agents/mastra/instance.js +37 -0
  39. package/dist/agents/mastra/instance.js.map +1 -0
  40. package/dist/agents/mastra/steps.d.ts +300 -0
  41. package/dist/agents/mastra/steps.d.ts.map +1 -0
  42. package/dist/agents/mastra/steps.js +468 -0
  43. package/dist/agents/mastra/steps.js.map +1 -0
  44. package/dist/agents/mastra/swarm.d.ts +106 -0
  45. package/dist/agents/mastra/swarm.d.ts.map +1 -0
  46. package/dist/agents/mastra/swarm.js +501 -0
  47. package/dist/agents/mastra/swarm.js.map +1 -0
  48. package/dist/agents/mastra/workflow.d.ts +81 -0
  49. package/dist/agents/mastra/workflow.d.ts.map +1 -0
  50. package/dist/agents/mastra/workflow.js +460 -0
  51. package/dist/agents/mastra/workflow.js.map +1 -0
  52. package/dist/agents/multi/agents/security.d.ts +29 -0
  53. package/dist/agents/multi/agents/security.d.ts.map +1 -0
  54. package/dist/agents/multi/agents/security.js +830 -0
  55. package/dist/agents/multi/agents/security.js.map +1 -0
  56. package/dist/agents/multi/extractor.d.ts +21 -0
  57. package/dist/agents/multi/extractor.d.ts.map +1 -0
  58. package/dist/agents/multi/extractor.js +483 -0
  59. package/dist/agents/multi/extractor.js.map +1 -0
  60. package/dist/agents/multi/index.d.ts +32 -0
  61. package/dist/agents/multi/index.d.ts.map +1 -0
  62. package/dist/agents/multi/index.js +34 -0
  63. package/dist/agents/multi/index.js.map +1 -0
  64. package/dist/agents/multi/runner.d.ts +79 -0
  65. package/dist/agents/multi/runner.d.ts.map +1 -0
  66. package/dist/agents/multi/runner.js +323 -0
  67. package/dist/agents/multi/runner.js.map +1 -0
  68. package/dist/agents/security-agent.d.ts +16 -0
  69. package/dist/agents/security-agent.d.ts.map +1 -0
  70. package/dist/agents/security-agent.js +299 -0
  71. package/dist/agents/security-agent.js.map +1 -0
  72. package/dist/agents/types.d.ts +373 -0
  73. package/dist/agents/types.d.ts.map +1 -0
  74. package/dist/agents/types.js +14 -0
  75. package/dist/agents/types.js.map +1 -0
  76. package/dist/agents/verification-agent.d.ts +23 -0
  77. package/dist/agents/verification-agent.d.ts.map +1 -0
  78. package/dist/agents/verification-agent.js +217 -0
  79. package/dist/agents/verification-agent.js.map +1 -0
  80. package/dist/agents/workflow.d.ts +30 -0
  81. package/dist/agents/workflow.d.ts.map +1 -0
  82. package/dist/agents/workflow.js +79 -0
  83. package/dist/agents/workflow.js.map +1 -0
  84. package/dist/analysis/enriched.d.ts +16 -0
  85. package/dist/analysis/enriched.d.ts.map +1 -0
  86. package/dist/analysis/enriched.js +297 -0
  87. package/dist/analysis/enriched.js.map +1 -0
  88. package/dist/analysis/llm-correlated-predicates.d.ts +80 -0
  89. package/dist/analysis/llm-correlated-predicates.d.ts.map +1 -0
  90. package/dist/analysis/llm-correlated-predicates.js +255 -0
  91. package/dist/analysis/llm-correlated-predicates.js.map +1 -0
  92. package/dist/analysis/llm-cross-file-taint.d.ts +86 -0
  93. package/dist/analysis/llm-cross-file-taint.d.ts.map +1 -0
  94. package/dist/analysis/llm-cross-file-taint.js +264 -0
  95. package/dist/analysis/llm-cross-file-taint.js.map +1 -0
  96. package/dist/analysis/pattern-discovery.d.ts +79 -0
  97. package/dist/analysis/pattern-discovery.d.ts.map +1 -0
  98. package/dist/analysis/pattern-discovery.js +447 -0
  99. package/dist/analysis/pattern-discovery.js.map +1 -0
  100. package/dist/cache/file-cache.d.ts +89 -0
  101. package/dist/cache/file-cache.d.ts.map +1 -0
  102. package/dist/cache/file-cache.js +208 -0
  103. package/dist/cache/file-cache.js.map +1 -0
  104. package/dist/cache/index.d.ts +6 -0
  105. package/dist/cache/index.d.ts.map +1 -0
  106. package/dist/cache/index.js +5 -0
  107. package/dist/cache/index.js.map +1 -0
  108. package/dist/cli/args.d.ts +52 -0
  109. package/dist/cli/args.d.ts.map +1 -0
  110. package/dist/cli/args.js +422 -0
  111. package/dist/cli/args.js.map +1 -0
  112. package/dist/cli/colors.d.ts +31 -0
  113. package/dist/cli/colors.d.ts.map +1 -0
  114. package/dist/cli/colors.js +80 -0
  115. package/dist/cli/colors.js.map +1 -0
  116. package/dist/cli/commands/analyze-skill.d.ts +33 -0
  117. package/dist/cli/commands/analyze-skill.d.ts.map +1 -0
  118. package/dist/cli/commands/analyze-skill.js +217 -0
  119. package/dist/cli/commands/analyze-skill.js.map +1 -0
  120. package/dist/cli/commands/analyze.d.ts +18 -0
  121. package/dist/cli/commands/analyze.d.ts.map +1 -0
  122. package/dist/cli/commands/analyze.js +30 -0
  123. package/dist/cli/commands/analyze.js.map +1 -0
  124. package/dist/cli/commands/benchmark-runner.d.ts +42 -0
  125. package/dist/cli/commands/benchmark-runner.d.ts.map +1 -0
  126. package/dist/cli/commands/benchmark-runner.js +18 -0
  127. package/dist/cli/commands/benchmark-runner.js.map +1 -0
  128. package/dist/cli/commands/benchmark.d.ts +11 -0
  129. package/dist/cli/commands/benchmark.d.ts.map +1 -0
  130. package/dist/cli/commands/benchmark.js +90 -0
  131. package/dist/cli/commands/benchmark.js.map +1 -0
  132. package/dist/cli/commands/dead-code.d.ts +11 -0
  133. package/dist/cli/commands/dead-code.d.ts.map +1 -0
  134. package/dist/cli/commands/dead-code.js +65 -0
  135. package/dist/cli/commands/dead-code.js.map +1 -0
  136. package/dist/cli/commands/generate-spec.d.ts +11 -0
  137. package/dist/cli/commands/generate-spec.d.ts.map +1 -0
  138. package/dist/cli/commands/generate-spec.js +67 -0
  139. package/dist/cli/commands/generate-spec.js.map +1 -0
  140. package/dist/cli/commands/health.d.ts +11 -0
  141. package/dist/cli/commands/health.d.ts.map +1 -0
  142. package/dist/cli/commands/health.js +67 -0
  143. package/dist/cli/commands/health.js.map +1 -0
  144. package/dist/cli/commands/project.d.ts +21 -0
  145. package/dist/cli/commands/project.d.ts.map +1 -0
  146. package/dist/cli/commands/project.js +92 -0
  147. package/dist/cli/commands/project.js.map +1 -0
  148. package/dist/cli/commands/scan.d.ts +11 -0
  149. package/dist/cli/commands/scan.d.ts.map +1 -0
  150. package/dist/cli/commands/scan.js +68 -0
  151. package/dist/cli/commands/scan.js.map +1 -0
  152. package/dist/cli/commands/secrets.d.ts +11 -0
  153. package/dist/cli/commands/secrets.d.ts.map +1 -0
  154. package/dist/cli/commands/secrets.js +71 -0
  155. package/dist/cli/commands/secrets.js.map +1 -0
  156. package/dist/cli/commands/swarm.d.ts +20 -0
  157. package/dist/cli/commands/swarm.d.ts.map +1 -0
  158. package/dist/cli/commands/swarm.js +174 -0
  159. package/dist/cli/commands/swarm.js.map +1 -0
  160. package/dist/cli/config.d.ts +103 -0
  161. package/dist/cli/config.d.ts.map +1 -0
  162. package/dist/cli/config.js +307 -0
  163. package/dist/cli/config.js.map +1 -0
  164. package/dist/cli/discovery.d.ts +31 -0
  165. package/dist/cli/discovery.d.ts.map +1 -0
  166. package/dist/cli/discovery.js +212 -0
  167. package/dist/cli/discovery.js.map +1 -0
  168. package/dist/cli/formatters/index.d.ts +15 -0
  169. package/dist/cli/formatters/index.d.ts.map +1 -0
  170. package/dist/cli/formatters/index.js +51 -0
  171. package/dist/cli/formatters/index.js.map +1 -0
  172. package/dist/cli/formatters/json.d.ts +11 -0
  173. package/dist/cli/formatters/json.d.ts.map +1 -0
  174. package/dist/cli/formatters/json.js +12 -0
  175. package/dist/cli/formatters/json.js.map +1 -0
  176. package/dist/cli/formatters/project-json.d.ts +11 -0
  177. package/dist/cli/formatters/project-json.d.ts.map +1 -0
  178. package/dist/cli/formatters/project-json.js +12 -0
  179. package/dist/cli/formatters/project-json.js.map +1 -0
  180. package/dist/cli/formatters/project-sarif.d.ts +11 -0
  181. package/dist/cli/formatters/project-sarif.d.ts.map +1 -0
  182. package/dist/cli/formatters/project-sarif.js +127 -0
  183. package/dist/cli/formatters/project-sarif.js.map +1 -0
  184. package/dist/cli/formatters/project-summary.d.ts +11 -0
  185. package/dist/cli/formatters/project-summary.d.ts.map +1 -0
  186. package/dist/cli/formatters/project-summary.js +202 -0
  187. package/dist/cli/formatters/project-summary.js.map +1 -0
  188. package/dist/cli/formatters/sarif-shared.d.ts +101 -0
  189. package/dist/cli/formatters/sarif-shared.d.ts.map +1 -0
  190. package/dist/cli/formatters/sarif-shared.js +57 -0
  191. package/dist/cli/formatters/sarif-shared.js.map +1 -0
  192. package/dist/cli/formatters/sarif.d.ts +12 -0
  193. package/dist/cli/formatters/sarif.d.ts.map +1 -0
  194. package/dist/cli/formatters/sarif.js +92 -0
  195. package/dist/cli/formatters/sarif.js.map +1 -0
  196. package/dist/cli/formatters/summary.d.ts +11 -0
  197. package/dist/cli/formatters/summary.d.ts.map +1 -0
  198. package/dist/cli/formatters/summary.js +240 -0
  199. package/dist/cli/formatters/summary.js.map +1 -0
  200. package/dist/cli/formatters/two-phase-summary.d.ts +11 -0
  201. package/dist/cli/formatters/two-phase-summary.d.ts.map +1 -0
  202. package/dist/cli/formatters/two-phase-summary.js +188 -0
  203. package/dist/cli/formatters/two-phase-summary.js.map +1 -0
  204. package/dist/cli/index.d.ts +15 -0
  205. package/dist/cli/index.d.ts.map +1 -0
  206. package/dist/cli/index.js +555 -0
  207. package/dist/cli/index.js.map +1 -0
  208. package/dist/components/clustering.d.ts +60 -0
  209. package/dist/components/clustering.d.ts.map +1 -0
  210. package/dist/components/clustering.js +129 -0
  211. package/dist/components/clustering.js.map +1 -0
  212. package/dist/components/enrichment.d.ts +45 -0
  213. package/dist/components/enrichment.d.ts.map +1 -0
  214. package/dist/components/enrichment.js +193 -0
  215. package/dist/components/enrichment.js.map +1 -0
  216. package/dist/components/index.d.ts +29 -0
  217. package/dist/components/index.d.ts.map +1 -0
  218. package/dist/components/index.js +56 -0
  219. package/dist/components/index.js.map +1 -0
  220. package/dist/dead-code/detector.d.ts +200 -0
  221. package/dist/dead-code/detector.d.ts.map +1 -0
  222. package/dist/dead-code/detector.js +1003 -0
  223. package/dist/dead-code/detector.js.map +1 -0
  224. package/dist/dead-code/index.d.ts +7 -0
  225. package/dist/dead-code/index.d.ts.map +1 -0
  226. package/dist/dead-code/index.js +7 -0
  227. package/dist/dead-code/index.js.map +1 -0
  228. package/dist/extractors/index.d.ts +15 -0
  229. package/dist/extractors/index.d.ts.map +1 -0
  230. package/dist/extractors/index.js +14 -0
  231. package/dist/extractors/index.js.map +1 -0
  232. package/dist/extractors/natural-language.d.ts +46 -0
  233. package/dist/extractors/natural-language.d.ts.map +1 -0
  234. package/dist/extractors/natural-language.js +228 -0
  235. package/dist/extractors/natural-language.js.map +1 -0
  236. package/dist/extractors/tree-sitter.d.ts +33 -0
  237. package/dist/extractors/tree-sitter.d.ts.map +1 -0
  238. package/dist/extractors/tree-sitter.js +69 -0
  239. package/dist/extractors/tree-sitter.js.map +1 -0
  240. package/dist/extractors/types.d.ts +62 -0
  241. package/dist/extractors/types.d.ts.map +1 -0
  242. package/dist/extractors/types.js +54 -0
  243. package/dist/extractors/types.js.map +1 -0
  244. package/dist/health-score/calculator.d.ts +123 -0
  245. package/dist/health-score/calculator.d.ts.map +1 -0
  246. package/dist/health-score/calculator.js +444 -0
  247. package/dist/health-score/calculator.js.map +1 -0
  248. package/dist/health-score/index.d.ts +12 -0
  249. package/dist/health-score/index.d.ts.map +1 -0
  250. package/dist/health-score/index.js +14 -0
  251. package/dist/health-score/index.js.map +1 -0
  252. package/dist/health-score/metrics.d.ts +142 -0
  253. package/dist/health-score/metrics.d.ts.map +1 -0
  254. package/dist/health-score/metrics.js +332 -0
  255. package/dist/health-score/metrics.js.map +1 -0
  256. package/dist/index.d.ts +26 -0
  257. package/dist/index.d.ts.map +1 -0
  258. package/dist/index.js +43 -0
  259. package/dist/index.js.map +1 -0
  260. package/dist/llm/ax-client.d.ts +477 -0
  261. package/dist/llm/ax-client.d.ts.map +1 -0
  262. package/dist/llm/ax-client.js +1641 -0
  263. package/dist/llm/ax-client.js.map +1 -0
  264. package/dist/llm/config.d.ts +58 -0
  265. package/dist/llm/config.d.ts.map +1 -0
  266. package/dist/llm/config.js +97 -0
  267. package/dist/llm/config.js.map +1 -0
  268. package/dist/llm/discovery.d.ts +123 -0
  269. package/dist/llm/discovery.d.ts.map +1 -0
  270. package/dist/llm/discovery.js +505 -0
  271. package/dist/llm/discovery.js.map +1 -0
  272. package/dist/llm/enrichment.d.ts +108 -0
  273. package/dist/llm/enrichment.d.ts.map +1 -0
  274. package/dist/llm/enrichment.js +312 -0
  275. package/dist/llm/enrichment.js.map +1 -0
  276. package/dist/llm/index.d.ts +13 -0
  277. package/dist/llm/index.d.ts.map +1 -0
  278. package/dist/llm/index.js +22 -0
  279. package/dist/llm/index.js.map +1 -0
  280. package/dist/llm/language-context.d.ts +64 -0
  281. package/dist/llm/language-context.d.ts.map +1 -0
  282. package/dist/llm/language-context.js +492 -0
  283. package/dist/llm/language-context.js.map +1 -0
  284. package/dist/llm/pattern-verification.d.ts +39 -0
  285. package/dist/llm/pattern-verification.d.ts.map +1 -0
  286. package/dist/llm/pattern-verification.js +127 -0
  287. package/dist/llm/pattern-verification.js.map +1 -0
  288. package/dist/llm/prompt-security.d.ts +120 -0
  289. package/dist/llm/prompt-security.d.ts.map +1 -0
  290. package/dist/llm/prompt-security.js +301 -0
  291. package/dist/llm/prompt-security.js.map +1 -0
  292. package/dist/llm/prompts/index.d.ts +31 -0
  293. package/dist/llm/prompts/index.d.ts.map +1 -0
  294. package/dist/llm/prompts/index.js +92 -0
  295. package/dist/llm/prompts/index.js.map +1 -0
  296. package/dist/llm/prompts/rust.d.ts +30 -0
  297. package/dist/llm/prompts/rust.d.ts.map +1 -0
  298. package/dist/llm/prompts/rust.js +121 -0
  299. package/dist/llm/prompts/rust.js.map +1 -0
  300. package/dist/llm/schemas.d.ts +892 -0
  301. package/dist/llm/schemas.d.ts.map +1 -0
  302. package/dist/llm/schemas.js +258 -0
  303. package/dist/llm/schemas.js.map +1 -0
  304. package/dist/llm/verification.d.ts +127 -0
  305. package/dist/llm/verification.d.ts.map +1 -0
  306. package/dist/llm/verification.js +394 -0
  307. package/dist/llm/verification.js.map +1 -0
  308. package/dist/project/analyzer.d.ts +30 -0
  309. package/dist/project/analyzer.d.ts.map +1 -0
  310. package/dist/project/analyzer.js +358 -0
  311. package/dist/project/analyzer.js.map +1 -0
  312. package/dist/project/call-graph.d.ts +22 -0
  313. package/dist/project/call-graph.d.ts.map +1 -0
  314. package/dist/project/call-graph.js +246 -0
  315. package/dist/project/call-graph.js.map +1 -0
  316. package/dist/project/index.d.ts +18 -0
  317. package/dist/project/index.d.ts.map +1 -0
  318. package/dist/project/index.js +20 -0
  319. package/dist/project/index.js.map +1 -0
  320. package/dist/project/taint-paths.d.ts +22 -0
  321. package/dist/project/taint-paths.d.ts.map +1 -0
  322. package/dist/project/taint-paths.js +265 -0
  323. package/dist/project/taint-paths.js.map +1 -0
  324. package/dist/project/two-phase-analyzer.d.ts +143 -0
  325. package/dist/project/two-phase-analyzer.d.ts.map +1 -0
  326. package/dist/project/two-phase-analyzer.js +646 -0
  327. package/dist/project/two-phase-analyzer.js.map +1 -0
  328. package/dist/project/type-hierarchy.d.ts +28 -0
  329. package/dist/project/type-hierarchy.d.ts.map +1 -0
  330. package/dist/project/type-hierarchy.js +218 -0
  331. package/dist/project/type-hierarchy.js.map +1 -0
  332. package/dist/secret-scan/index.d.ts +12 -0
  333. package/dist/secret-scan/index.d.ts.map +1 -0
  334. package/dist/secret-scan/index.js +14 -0
  335. package/dist/secret-scan/index.js.map +1 -0
  336. package/dist/secret-scan/patterns.d.ts +38 -0
  337. package/dist/secret-scan/patterns.d.ts.map +1 -0
  338. package/dist/secret-scan/patterns.js +473 -0
  339. package/dist/secret-scan/patterns.js.map +1 -0
  340. package/dist/secret-scan/scanner.d.ts +162 -0
  341. package/dist/secret-scan/scanner.d.ts.map +1 -0
  342. package/dist/secret-scan/scanner.js +511 -0
  343. package/dist/secret-scan/scanner.js.map +1 -0
  344. package/dist/security-scan/index.d.ts +12 -0
  345. package/dist/security-scan/index.d.ts.map +1 -0
  346. package/dist/security-scan/index.js +15 -0
  347. package/dist/security-scan/index.js.map +1 -0
  348. package/dist/security-scan/owasp-mapping.d.ts +29 -0
  349. package/dist/security-scan/owasp-mapping.d.ts.map +1 -0
  350. package/dist/security-scan/owasp-mapping.js +246 -0
  351. package/dist/security-scan/owasp-mapping.js.map +1 -0
  352. package/dist/security-scan/scanner.d.ts +204 -0
  353. package/dist/security-scan/scanner.d.ts.map +1 -0
  354. package/dist/security-scan/scanner.js +693 -0
  355. package/dist/security-scan/scanner.js.map +1 -0
  356. package/dist/security-scan/trend-tracker.d.ts +150 -0
  357. package/dist/security-scan/trend-tracker.d.ts.map +1 -0
  358. package/dist/security-scan/trend-tracker.js +299 -0
  359. package/dist/security-scan/trend-tracker.js.map +1 -0
  360. package/dist/skills/bundle-loader.d.ts +26 -0
  361. package/dist/skills/bundle-loader.d.ts.map +1 -0
  362. package/dist/skills/bundle-loader.js +284 -0
  363. package/dist/skills/bundle-loader.js.map +1 -0
  364. package/dist/skills/capability-mismatch.d.ts +21 -0
  365. package/dist/skills/capability-mismatch.d.ts.map +1 -0
  366. package/dist/skills/capability-mismatch.js +188 -0
  367. package/dist/skills/capability-mismatch.js.map +1 -0
  368. package/dist/skills/index.d.ts +10 -0
  369. package/dist/skills/index.d.ts.map +1 -0
  370. package/dist/skills/index.js +9 -0
  371. package/dist/skills/index.js.map +1 -0
  372. package/dist/skills/skill-analyzer.d.ts +16 -0
  373. package/dist/skills/skill-analyzer.d.ts.map +1 -0
  374. package/dist/skills/skill-analyzer.js +361 -0
  375. package/dist/skills/skill-analyzer.js.map +1 -0
  376. package/dist/skills/types.d.ts +195 -0
  377. package/dist/skills/types.d.ts.map +1 -0
  378. package/dist/skills/types.js +7 -0
  379. package/dist/skills/types.js.map +1 -0
  380. package/dist/specifica/conflict-resolver.d.ts +23 -0
  381. package/dist/specifica/conflict-resolver.d.ts.map +1 -0
  382. package/dist/specifica/conflict-resolver.js +129 -0
  383. package/dist/specifica/conflict-resolver.js.map +1 -0
  384. package/dist/specifica/evidence-aggregator.d.ts +33 -0
  385. package/dist/specifica/evidence-aggregator.d.ts.map +1 -0
  386. package/dist/specifica/evidence-aggregator.js +236 -0
  387. package/dist/specifica/evidence-aggregator.js.map +1 -0
  388. package/dist/specifica/evidence-extractor.d.ts +13 -0
  389. package/dist/specifica/evidence-extractor.d.ts.map +1 -0
  390. package/dist/specifica/evidence-extractor.js +431 -0
  391. package/dist/specifica/evidence-extractor.js.map +1 -0
  392. package/dist/specifica/feature-clustering.d.ts +19 -0
  393. package/dist/specifica/feature-clustering.d.ts.map +1 -0
  394. package/dist/specifica/feature-clustering.js +231 -0
  395. package/dist/specifica/feature-clustering.js.map +1 -0
  396. package/dist/specifica/generator.d.ts +16 -0
  397. package/dist/specifica/generator.d.ts.map +1 -0
  398. package/dist/specifica/generator.js +277 -0
  399. package/dist/specifica/generator.js.map +1 -0
  400. package/dist/specifica/index.d.ts +15 -0
  401. package/dist/specifica/index.d.ts.map +1 -0
  402. package/dist/specifica/index.js +18 -0
  403. package/dist/specifica/index.js.map +1 -0
  404. package/dist/specifica/prompts.d.ts +21 -0
  405. package/dist/specifica/prompts.d.ts.map +1 -0
  406. package/dist/specifica/prompts.js +196 -0
  407. package/dist/specifica/prompts.js.map +1 -0
  408. package/dist/specifica/spec-generator.d.ts +22 -0
  409. package/dist/specifica/spec-generator.d.ts.map +1 -0
  410. package/dist/specifica/spec-generator.js +229 -0
  411. package/dist/specifica/spec-generator.js.map +1 -0
  412. package/dist/specifica/types.d.ts +213 -0
  413. package/dist/specifica/types.d.ts.map +1 -0
  414. package/dist/specifica/types.js +7 -0
  415. package/dist/specifica/types.js.map +1 -0
  416. package/dist/utils/logger.d.ts +17 -0
  417. package/dist/utils/logger.d.ts.map +1 -0
  418. package/dist/utils/logger.js +51 -0
  419. package/dist/utils/logger.js.map +1 -0
  420. package/package.json +99 -0
@@ -0,0 +1,492 @@
1
+ /**
2
+ * Language-Specific Context for LLM Prompts
3
+ *
4
+ * Provides language-aware examples, patterns, and guidance for
5
+ * enrichment and verification across Java, Python, JavaScript/TypeScript, and Rust.
6
+ */
7
+ // ============================================================================
8
+ // Java Context
9
+ // ============================================================================
10
+ const JAVA_CONTEXT = {
11
+ name: 'Java',
12
+ codeFence: 'java',
13
+ frameworks: ['Spring', 'Spring Boot', 'Jakarta EE', 'Struts', 'Vert.x', 'Spark'],
14
+ httpSources: [
15
+ { pattern: 'request.getParameter()', type: 'http_param', description: 'HTTP query/form parameter' },
16
+ { pattern: 'request.getHeader()', type: 'http_header', description: 'HTTP header value' },
17
+ { pattern: 'request.getCookies()', type: 'http_cookie', description: 'HTTP cookies' },
18
+ { pattern: 'request.getInputStream()', type: 'http_body', description: 'Request body stream' },
19
+ { pattern: '@RequestParam', type: 'http_param', description: 'Spring parameter annotation' },
20
+ { pattern: '@RequestBody', type: 'http_body', description: 'Spring body annotation' },
21
+ { pattern: '@PathVariable', type: 'http_path', description: 'Spring path variable' },
22
+ ],
23
+ sanitizers: {
24
+ 'CWE-89': ['PreparedStatement with ?', 'JPA parameterized queries', 'MyBatis #{param}'],
25
+ 'CWE-79': ['ESAPI.encoder().encodeForHTML()', 'HtmlUtils.htmlEscape()', 'StringEscapeUtils.escapeHtml4()'],
26
+ 'CWE-78': ['ProcessBuilder with array args (no shell)', 'Apache Commons Exec with CommandLine'],
27
+ 'CWE-22': ['File.getCanonicalPath() + startsWith check', 'Paths.get().normalize()'],
28
+ },
29
+ sinkPatterns: {
30
+ 'CWE-89': [
31
+ { pattern: 'Statement.execute*(sql)', safe: 'PreparedStatement with ?', description: 'SQL execution' },
32
+ { pattern: 'createQuery(sql)', safe: 'JPA with parameters', description: 'JPA query' },
33
+ ],
34
+ 'CWE-78': [
35
+ { pattern: 'Runtime.exec(cmd)', safe: 'Constant commands only', description: 'Command execution' },
36
+ { pattern: 'ProcessBuilder.command()', safe: 'Array args without shell', description: 'Process builder' },
37
+ ],
38
+ 'CWE-79': [
39
+ { pattern: 'response.getWriter().print()', safe: 'JSON responses', description: 'Response output' },
40
+ { pattern: 'out.println()', safe: 'Escaped content', description: 'JSP output' },
41
+ ],
42
+ },
43
+ sourceExamples: `// Java HTTP sources
44
+ String param = request.getParameter("input");
45
+ String header = request.getHeader("X-Custom");
46
+ Cookie[] cookies = request.getCookies();
47
+ BufferedReader reader = request.getReader();
48
+
49
+ // Spring annotations
50
+ public String handle(@RequestParam String input, @RequestBody User user) { }`,
51
+ sinkExamples: `// SQL Injection - VULNERABLE
52
+ String sql = "SELECT * FROM users WHERE id = " + userInput;
53
+ stmt.executeQuery(sql);
54
+
55
+ // SQL Injection - SAFE (parameterized)
56
+ PreparedStatement ps = conn.prepareStatement("SELECT * FROM users WHERE id = ?");
57
+ ps.setString(1, userInput);`,
58
+ };
59
+ // ============================================================================
60
+ // Python Context
61
+ // ============================================================================
62
+ const PYTHON_CONTEXT = {
63
+ name: 'Python',
64
+ codeFence: 'python',
65
+ frameworks: ['Flask', 'Django', 'FastAPI', 'Pyramid', 'aiohttp', 'Tornado'],
66
+ httpSources: [
67
+ { pattern: 'request.args.get()', type: 'http_param', description: 'Flask query parameter' },
68
+ { pattern: 'request.form.get()', type: 'http_param', description: 'Flask form data' },
69
+ { pattern: 'request.json', type: 'http_body', description: 'Flask JSON body' },
70
+ { pattern: 'request.headers.get()', type: 'http_header', description: 'Flask HTTP header' },
71
+ { pattern: 'request.cookies.get()', type: 'http_cookie', description: 'Flask cookie' },
72
+ { pattern: 'request.GET.get()', type: 'http_param', description: 'Django query parameter' },
73
+ { pattern: 'request.POST.get()', type: 'http_param', description: 'Django form data' },
74
+ ],
75
+ sanitizers: {
76
+ 'CWE-89': ['cursor.execute(sql, params)', 'SQLAlchemy with bindparams', 'Django ORM (no raw())'],
77
+ 'CWE-79': ['markupsafe.escape()', 'bleach.clean()', 'html.escape()', 'Jinja2 autoescape'],
78
+ 'CWE-78': ['shlex.quote()', 'subprocess with array args (shell=False)'],
79
+ 'CWE-22': ['os.path.basename()', 'werkzeug.utils.secure_filename()', 'Path.resolve() + check'],
80
+ 'CWE-502': ['yaml.safe_load()', 'json.loads() (safe by default)'],
81
+ },
82
+ sinkPatterns: {
83
+ 'CWE-89': [
84
+ { pattern: 'cursor.execute(f"SELECT...{var}")', safe: 'cursor.execute(sql, params)', description: 'SQL query' },
85
+ { pattern: 'Model.objects.raw(sql)', safe: 'Django ORM filter()', description: 'Django raw SQL' },
86
+ ],
87
+ 'CWE-78': [
88
+ { pattern: 'os.system(cmd)', safe: 'subprocess with shell=False', description: 'Shell command' },
89
+ { pattern: 'subprocess.run(cmd, shell=True)', safe: 'shell=False with list', description: 'Subprocess' },
90
+ ],
91
+ 'CWE-79': [
92
+ { pattern: 'render_template_string(user_input)', safe: 'render_template() with autoescape', description: 'Template injection' },
93
+ { pattern: 'Markup(user_input)', safe: 'escape() first', description: 'Safe markup' },
94
+ ],
95
+ 'CWE-502': [
96
+ { pattern: 'pickle.loads(data)', safe: 'Never safe with untrusted data', description: 'Pickle deserialization' },
97
+ { pattern: 'yaml.load(data)', safe: 'yaml.safe_load(data)', description: 'YAML deserialization' },
98
+ ],
99
+ },
100
+ sourceExamples: `# Flask HTTP sources
101
+ user_input = request.args.get('input')
102
+ form_data = request.form.get('data')
103
+ json_body = request.json
104
+ header = request.headers.get('X-Custom')
105
+ cookie = request.cookies.get('session')
106
+
107
+ # Django HTTP sources
108
+ param = request.GET.get('input')
109
+ post_data = request.POST.get('data')
110
+ body = request.body`,
111
+ sinkExamples: `# SQL Injection - VULNERABLE
112
+ cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")
113
+
114
+ # SQL Injection - SAFE (parameterized)
115
+ cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
116
+
117
+ # Command Injection - VULNERABLE
118
+ os.system(f"ping {host}")
119
+
120
+ # Command Injection - SAFE
121
+ subprocess.run(["ping", host], shell=False)`,
122
+ };
123
+ // ============================================================================
124
+ // JavaScript/TypeScript Context
125
+ // ============================================================================
126
+ const JAVASCRIPT_CONTEXT = {
127
+ name: 'JavaScript/TypeScript',
128
+ codeFence: 'javascript',
129
+ frameworks: ['Express', 'Fastify', 'Koa', 'Hapi', 'NestJS', 'Next.js'],
130
+ httpSources: [
131
+ { pattern: 'req.query.param', type: 'http_param', description: 'Express query parameter' },
132
+ { pattern: 'req.body.field', type: 'http_body', description: 'Express body field' },
133
+ { pattern: 'req.params.id', type: 'http_path', description: 'Express route parameter' },
134
+ { pattern: 'req.headers["x-header"]', type: 'http_header', description: 'Express header' },
135
+ { pattern: 'req.cookies.name', type: 'http_cookie', description: 'Express cookie' },
136
+ { pattern: 'ctx.query', type: 'http_param', description: 'Koa query params' },
137
+ { pattern: 'ctx.request.body', type: 'http_body', description: 'Koa body' },
138
+ ],
139
+ sanitizers: {
140
+ 'CWE-89': ['Parameterized queries with ?', 'Knex.js query builder', 'Sequelize ORM', 'Prisma'],
141
+ 'CWE-79': ['DOMPurify.sanitize()', 'validator.escape()', 'encodeURIComponent()', 'React JSX (auto-escaped)'],
142
+ 'CWE-78': ['child_process.spawn() with array args', 'shell-escape library'],
143
+ 'CWE-22': ['path.basename()', 'path.normalize() + startsWith check'],
144
+ 'CWE-943': ['MongoDB with strict schemas', 'Mongoose sanitization'],
145
+ },
146
+ sinkPatterns: {
147
+ 'CWE-89': [
148
+ { pattern: 'db.query(`SELECT...${input}`)', safe: 'db.query(sql, [params])', description: 'SQL query' },
149
+ { pattern: 'connection.query(sql + input)', safe: 'Parameterized query', description: 'MySQL query' },
150
+ ],
151
+ 'CWE-78': [
152
+ { pattern: 'exec(cmd)', safe: 'spawn() with array args', description: 'Command execution' },
153
+ { pattern: 'child_process.execSync(cmd)', safe: 'spawnSync with args array', description: 'Sync execution' },
154
+ ],
155
+ 'CWE-79': [
156
+ { pattern: 'res.send(userInput)', safe: 'res.json() or escaped HTML', description: 'Response output' },
157
+ { pattern: 'element.innerHTML = input', safe: 'textContent or DOMPurify', description: 'DOM XSS' },
158
+ ],
159
+ 'CWE-943': [
160
+ { pattern: 'collection.find({$where: input})', safe: 'Avoid $where with user input', description: 'NoSQL injection' },
161
+ { pattern: 'Model.find(userQuery)', safe: 'Sanitize query operators', description: 'MongoDB query' },
162
+ ],
163
+ },
164
+ sourceExamples: `// Express HTTP sources
165
+ const userInput = req.query.input;
166
+ const bodyData = req.body.data;
167
+ const pathParam = req.params.id;
168
+ const header = req.headers['x-custom'];
169
+ const cookie = req.cookies.session;
170
+
171
+ // Koa HTTP sources
172
+ const query = ctx.query;
173
+ const body = ctx.request.body;`,
174
+ sinkExamples: `// SQL Injection - VULNERABLE
175
+ const sql = \`SELECT * FROM users WHERE id = \${userId}\`;
176
+ db.query(sql);
177
+
178
+ // SQL Injection - SAFE (parameterized)
179
+ db.query('SELECT * FROM users WHERE id = ?', [userId]);
180
+
181
+ // Command Injection - VULNERABLE
182
+ exec(\`ping \${host}\`);
183
+
184
+ // Command Injection - SAFE
185
+ spawn('ping', [host]);`,
186
+ };
187
+ // ============================================================================
188
+ // Rust Context
189
+ // ============================================================================
190
+ const RUST_CONTEXT = {
191
+ name: 'Rust',
192
+ codeFence: 'rust',
193
+ frameworks: ['Actix-web', 'Rocket', 'Axum', 'Warp', 'Tide'],
194
+ httpSources: [
195
+ { pattern: 'Path<T>::into_inner()', type: 'http_path', description: 'Actix path extractor' },
196
+ { pattern: 'Query<T>::into_inner()', type: 'http_param', description: 'Actix query extractor' },
197
+ { pattern: 'Json<T>::into_inner()', type: 'http_body', description: 'Actix JSON body' },
198
+ { pattern: 'Form<T>::into_inner()', type: 'http_param', description: 'Actix form data' },
199
+ { pattern: 'req.headers()', type: 'http_header', description: 'HTTP headers' },
200
+ { pattern: 'req.cookie()', type: 'http_cookie', description: 'Request cookies' },
201
+ ],
202
+ sanitizers: {
203
+ 'CWE-89': ['sqlx::query!() macro (compile-time checked)', 'Diesel query builder', 'sea-query builder'],
204
+ 'CWE-79': ['askama templates (auto-escaped)', 'maud! macro', 'html_escape crate'],
205
+ 'CWE-78': ['Command::new().arg() (no shell)', 'Avoid shell=true'],
206
+ 'CWE-22': ['Path::file_name()', 'canonicalize() + starts_with check'],
207
+ 'CWE-502': ['serde with #[serde(deny_unknown_fields)]', 'Avoid bincode with untrusted data'],
208
+ },
209
+ sinkPatterns: {
210
+ 'CWE-89': [
211
+ { pattern: 'sqlx::query(&format!("SELECT...{}", input))', safe: 'sqlx::query!() macro', description: 'SQL query' },
212
+ { pattern: 'conn.execute(sql, &[])', safe: 'Parameterized with $1', description: 'PostgreSQL query' },
213
+ ],
214
+ 'CWE-78': [
215
+ { pattern: 'Command::new("sh").arg("-c").arg(cmd)', safe: 'Command::new(prog).args()', description: 'Shell command' },
216
+ { pattern: 'std::process::Command with shell', safe: 'Direct program execution', description: 'Process spawn' },
217
+ ],
218
+ 'CWE-79': [
219
+ { pattern: 'HttpResponse::Ok().body(user_input)', safe: 'Template with auto-escape', description: 'HTTP response' },
220
+ { pattern: 'Html(user_input)', safe: 'askama/maud templates', description: 'HTML response' },
221
+ ],
222
+ 'CWE-22': [
223
+ { pattern: 'std::fs::read(user_path)', safe: 'Validate path prefix', description: 'File read' },
224
+ { pattern: 'File::open(path)', safe: 'canonicalize + check', description: 'File open' },
225
+ ],
226
+ },
227
+ sourceExamples: `// Actix-web extractors
228
+ async fn handler(
229
+ path: web::Path<String>,
230
+ query: web::Query<QueryParams>,
231
+ body: web::Json<RequestBody>,
232
+ req: HttpRequest,
233
+ ) -> impl Responder {
234
+ let path_param = path.into_inner();
235
+ let query_param = query.into_inner();
236
+ let json_body = body.into_inner();
237
+ let header = req.headers().get("X-Custom");
238
+ }`,
239
+ sinkExamples: `// SQL Injection - VULNERABLE
240
+ let sql = format!("SELECT * FROM users WHERE id = {}", user_id);
241
+ sqlx::query(&sql).fetch_one(&pool).await?;
242
+
243
+ // SQL Injection - SAFE (compile-time checked)
244
+ sqlx::query!("SELECT * FROM users WHERE id = $1", user_id)
245
+ .fetch_one(&pool).await?;
246
+
247
+ // Command Injection - VULNERABLE
248
+ Command::new("sh").arg("-c").arg(&user_cmd).output()?;
249
+
250
+ // Command Injection - SAFE
251
+ Command::new("ping").arg(&host).output()?;`,
252
+ };
253
+ // ============================================================================
254
+ // Language Context Registry
255
+ // ============================================================================
256
+ const LANGUAGE_CONTEXTS = {
257
+ java: JAVA_CONTEXT,
258
+ python: PYTHON_CONTEXT,
259
+ javascript: JAVASCRIPT_CONTEXT,
260
+ typescript: JAVASCRIPT_CONTEXT, // Share with JavaScript
261
+ rust: RUST_CONTEXT,
262
+ c: JAVA_CONTEXT, // Fallback to Java-like patterns
263
+ cpp: JAVA_CONTEXT,
264
+ };
265
+ /**
266
+ * Get the language context for a supported language
267
+ */
268
+ export function getLanguageContext(language) {
269
+ return LANGUAGE_CONTEXTS[language] || JAVA_CONTEXT;
270
+ }
271
+ /**
272
+ * Generate source discovery prompt for a specific language
273
+ *
274
+ * Uses semantic-guided prompts that focus on security concepts rather than
275
+ * specific API patterns. This allows the LLM to reason about data flow
276
+ * semantics and discover sources in unfamiliar frameworks or custom code.
277
+ */
278
+ export function generateSourceDiscoveryPrompt(language) {
279
+ const ctx = getLanguageContext(language);
280
+ return `You are a security expert analyzing ${ctx.name} code for taint sources.
281
+ Find user-controlled input sources NOT already identified.
282
+
283
+ Method code:
284
+ \`\`\`${ctx.codeFence}
285
+ {methodCode}
286
+ \`\`\`
287
+
288
+ Method: {methodName}
289
+ Class role: {classRole}
290
+ Already identified sources: {existingSources}
291
+
292
+ ## SEMANTIC CATEGORIES OF SOURCES (reason about the data origin, not method names):
293
+
294
+ **1. Network Input** - Data arriving over HTTP/network:
295
+ - Query parameters, form data, request bodies
296
+ - HTTP headers, cookies, path segments
297
+ - WebSocket messages, gRPC requests
298
+ - ANY data extracted from incoming requests
299
+
300
+ **2. File/Stream Input** - Data read from external sources:
301
+ - File contents, uploaded files
302
+ - Standard input, pipes
303
+ - ANY data read from I/O streams
304
+
305
+ **3. Database/Storage Input** - Data from persistence that may have been user-supplied:
306
+ - Query results containing user-submitted data
307
+ - Cache values, session storage
308
+ - ANY data retrieved that originated from users
309
+
310
+ **4. Environment Input** - Configuration that could be attacker-controlled:
311
+ - Environment variables in shared environments
312
+ - System properties, config files
313
+ - Command-line arguments
314
+
315
+ **5. Inter-Process Input** - Data from other processes/services:
316
+ - API responses, message queues
317
+ - Subprocess output, RPC results
318
+
319
+ ## KEY QUESTION: Does this data originate from OUTSIDE the application's trust boundary?
320
+
321
+ Think about the data's ORIGIN, not the specific API used to access it.
322
+ A source is ANY point where untrusted data enters the application.
323
+
324
+ ## WHAT TO IGNORE (NOT user-controlled):
325
+ - Constants, literals, hardcoded strings
326
+ - Internal configuration values
327
+ - Data constructed entirely within the application
328
+ - Return values from pure internal computations
329
+
330
+ Respond in JSON format:
331
+ {
332
+ "additionalSources": [
333
+ {
334
+ "line": number,
335
+ "variable": "variable name",
336
+ "type": "http_param | http_body | http_header | http_cookie | http_path | io_input | env_input | db_input | network_input",
337
+ "confidence": 0.0-1.0,
338
+ "reasoning": "Why this data originates from outside the trust boundary"
339
+ }
340
+ ]
341
+ }`;
342
+ }
343
+ /**
344
+ * Generate sink discovery prompt for a specific language
345
+ *
346
+ * Uses semantic-guided prompts that focus on what operations DO
347
+ * rather than specific API names. This allows the LLM to discover
348
+ * dangerous operations in unfamiliar frameworks or custom code.
349
+ */
350
+ export function generateSinkDiscoveryPrompt(language) {
351
+ const ctx = getLanguageContext(language);
352
+ return `You are a security expert analyzing ${ctx.name} code for security sinks.
353
+ Find dangerous operations NOT already identified.
354
+
355
+ Method code:
356
+ \`\`\`${ctx.codeFence}
357
+ {methodCode}
358
+ \`\`\`
359
+
360
+ Method: {methodName}
361
+ Method calls: {methodCalls}
362
+ Already identified sinks: {existingSinks}
363
+
364
+ ## SEMANTIC CATEGORIES OF SINKS (reason about the EFFECT, not method names):
365
+
366
+ **1. Data Query Execution** (CWE-89, CWE-943) - Operations that execute queries:
367
+ - SQL queries against relational databases
368
+ - NoSQL queries, graph queries, search queries
369
+ - ANY operation that interprets data as a query language
370
+ - KEY QUESTION: Is the query structure influenced by external data?
371
+ - SAFE: Parameterized/prepared statements where data is bound separately
372
+
373
+ **2. System Command Execution** (CWE-78) - Operations that run system commands:
374
+ - Process spawning, shell execution
375
+ - Script evaluation, macro execution
376
+ - ANY operation that interprets data as system commands
377
+ - KEY QUESTION: Can external data influence what command runs?
378
+ - SAFE: Fixed commands with data passed only as arguments (no shell interpretation)
379
+
380
+ **3. Output Rendering** (CWE-79) - Operations that render content to users:
381
+ - HTML response generation, template rendering
382
+ - JavaScript output, DOM manipulation
383
+ - ANY operation that sends data to be rendered by clients
384
+ - KEY QUESTION: Can external data inject executable content?
385
+ - SAFE: Properly escaped output, JSON responses, auto-escaping templates
386
+
387
+ **4. File System Operations** (CWE-22) - Operations that access file paths:
388
+ - File read/write, directory creation
389
+ - Path construction, file inclusion
390
+ - ANY operation that uses paths from external data
391
+ - KEY QUESTION: Can external data escape intended directories?
392
+ - SAFE: Validated paths, canonicalization with prefix checks
393
+
394
+ **5. Code Evaluation** (CWE-94) - Operations that interpret data as code:
395
+ - Dynamic code execution, eval(), script engines
396
+ - Reflection with external class names
397
+ - ANY operation that compiles/interprets data
398
+ - KEY QUESTION: Can external data become executable code?
399
+
400
+ **6. Deserialization** (CWE-502) - Operations that reconstruct objects from data:
401
+ - Object deserialization, unmarshalling
402
+ - ANY operation that creates objects from serialized data
403
+ - KEY QUESTION: Can external data instantiate arbitrary classes?
404
+
405
+ **7. Directory/Query Injection** (CWE-90, CWE-643) - Operations on hierarchical data:
406
+ - LDAP queries, XPath expressions
407
+ - ANY operation that queries tree/directory structures
408
+ - KEY QUESTION: Can external data modify query structure?
409
+
410
+ **8. Network Requests** (CWE-918) - Operations that make outbound requests:
411
+ - HTTP clients, URL fetching, API calls
412
+ - ANY operation where URL/host is from external data
413
+ - KEY QUESTION: Can external data control request destination?
414
+
415
+ ## KEY REASONING APPROACH:
416
+ 1. What EFFECT does this operation have?
417
+ 2. What INPUT influences that effect?
418
+ 3. Can EXTERNAL DATA reach that input?
419
+ 4. Is there SANITIZATION that makes it safe?
420
+
421
+ ## WHAT TO IGNORE:
422
+ - Logging operations (observation only, no side effects)
423
+ - Pure string manipulation (unless it reaches a dangerous operation)
424
+ - Internal method calls with no dangerous effects
425
+ - Operations with parameterized/bound inputs (data separate from structure)
426
+
427
+ Respond in JSON format:
428
+ {
429
+ "additionalSinks": [
430
+ {
431
+ "line": number,
432
+ "method": "operation description",
433
+ "type": "sql_injection | command_injection | xss | path_traversal | code_injection | deserialization | ldap_injection | xpath_injection | ssrf | nosql_injection",
434
+ "cwe": "CWE-XX",
435
+ "argPositions": [0],
436
+ "confidence": 0.0-1.0,
437
+ "reasoning": "Why this operation is dangerous if given untrusted input"
438
+ }
439
+ ]
440
+ }`;
441
+ }
442
+ /**
443
+ * Generate role classification prompt for a specific language
444
+ */
445
+ export function generateRoleClassificationPrompt(language) {
446
+ const ctx = getLanguageContext(language);
447
+ return `You are a security expert analyzing ${ctx.name} code.
448
+ Classify the role of this class/module based on its name, methods, and patterns.
449
+
450
+ Class/Module: {className}
451
+ Methods/Functions: {methodNames}
452
+ Annotations/Decorators: {annotations}
453
+ Imports: {imports}
454
+
455
+ ## ${ctx.name} FRAMEWORKS TO CONSIDER:
456
+ ${ctx.frameworks.join(', ')}
457
+
458
+ ## ROLE DEFINITIONS:
459
+ - controller: Handles HTTP requests, routes, API endpoints
460
+ - service: Business logic, data processing, orchestration
461
+ - repository: Database access, data persistence, queries
462
+ - utility: Helper functions, string manipulation, validation
463
+ - entity: Data models, DTOs, domain objects
464
+ - unknown: Cannot determine role
465
+
466
+ Respond in JSON format:
467
+ {
468
+ "role": "controller" | "service" | "repository" | "utility" | "entity" | "unknown",
469
+ "confidence": 0.0-1.0,
470
+ "reasoning": "explanation",
471
+ "indicators": ["list", "of", "indicators"]
472
+ }`;
473
+ }
474
+ /**
475
+ * Get CWE-specific verification guidance for a language
476
+ */
477
+ export function getCWEGuidance(language, cwe) {
478
+ const ctx = getLanguageContext(language);
479
+ const sanitizers = ctx.sanitizers[cwe] || [];
480
+ const patterns = ctx.sinkPatterns[cwe] || [];
481
+ if (sanitizers.length === 0 && patterns.length === 0) {
482
+ return '';
483
+ }
484
+ const sanitizerGuide = sanitizers.length > 0
485
+ ? `## Known Sanitizers for ${cwe} in ${ctx.name}:\n${sanitizers.map((s) => `- ${s}`).join('\n')}`
486
+ : '';
487
+ const patternGuide = patterns.length > 0
488
+ ? `## Vulnerable vs Safe Patterns:\n${patterns.map((p) => `- VULNERABLE: ${p.pattern}\n SAFE: ${p.safe}`).join('\n')}`
489
+ : '';
490
+ return `${sanitizerGuide}\n\n${patternGuide}`.trim();
491
+ }
492
+ //# sourceMappingURL=language-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-context.js","sourceRoot":"","sources":["../../src/llm/language-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuCH,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,YAAY,GAAoB;IACpC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;IAChF,WAAW,EAAE;QACX,EAAE,OAAO,EAAE,wBAAwB,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE;QACnG,EAAE,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE;QACzF,EAAE,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE;QACrF,EAAE,OAAO,EAAE,0BAA0B,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,qBAAqB,EAAE;QAC9F,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,6BAA6B,EAAE;QAC5F,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE;QACrF,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,sBA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AAC,QAAQ,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC7C,MAAM,QAAQ,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAE7C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC;QAC1C,CAAC,CAAC,2BAA2B,GAAG,OAAO,GAAG,CAAC,IAAI,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACjG,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC;QACtC,CAAC,CAAC,oCAAoC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACvH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,GAAG,cAAc,OAAO,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC;AACvD,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * LLM-based pattern verification
3
+ *
4
+ * Verifies heuristically discovered patterns using LLM analysis.
5
+ */
6
+ import type { DiscoveredPattern } from '../analysis/pattern-discovery.js';
7
+ import type { SourcePattern, SinkPattern } from 'circle-ir';
8
+ /**
9
+ * Verification result for a pattern
10
+ */
11
+ export interface PatternVerificationResult {
12
+ pattern: SourcePattern | SinkPattern;
13
+ isValid: boolean;
14
+ confidence: number;
15
+ reasoning: string;
16
+ suggestedType?: string;
17
+ suggestedCwe?: string;
18
+ }
19
+ /**
20
+ * Batch verification result
21
+ */
22
+ export interface BatchVerificationResult {
23
+ verified: PatternVerificationResult[];
24
+ modelUsed: string;
25
+ tokensUsed: number;
26
+ }
27
+ /**
28
+ * Verify a batch of discovered patterns using LLM
29
+ */
30
+ export declare function verifyPatterns(patterns: DiscoveredPattern[], codeContext?: string): Promise<BatchVerificationResult>;
31
+ /**
32
+ * Verify a single pattern with more detailed analysis
33
+ */
34
+ export declare function verifyPatternDetailed(pattern: DiscoveredPattern, code: string, _methodName: string): Promise<PatternVerificationResult>;
35
+ /**
36
+ * Check if LLM verification is available
37
+ */
38
+ export declare function isVerificationAvailable(): Promise<boolean>;
39
+ //# sourceMappingURL=pattern-verification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pattern-verification.d.ts","sourceRoot":"","sources":["../../src/llm/pattern-verification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,aAAa,GAAG,WAAW,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,uBAAuB,CAAC,CA6DlC;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,yBAAyB,CAAC,CAoDpC;AAED;;GAEG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC,CAOhE"}