@greyworld/code-check-core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/dist/facade/code-checker.d.ts +14 -0
  2. package/dist/facade/code-checker.d.ts.map +1 -0
  3. package/dist/facade/code-checker.js +63 -0
  4. package/dist/facade/code-checker.js.map +1 -0
  5. package/dist/facade/index.d.ts +3 -0
  6. package/dist/facade/index.d.ts.map +1 -0
  7. package/dist/facade/index.js +6 -0
  8. package/dist/facade/index.js.map +1 -0
  9. package/dist/facade/types.d.ts +24 -0
  10. package/dist/facade/types.d.ts.map +1 -0
  11. package/dist/facade/types.js +3 -0
  12. package/dist/facade/types.js.map +1 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +7 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/tools/ast-parser/go/index.d.ts +3 -0
  18. package/dist/tools/ast-parser/go/index.d.ts.map +1 -0
  19. package/dist/tools/ast-parser/go/index.js +6 -0
  20. package/dist/tools/ast-parser/go/index.js.map +1 -0
  21. package/dist/tools/ast-parser/go/parser.d.ts +56 -0
  22. package/dist/tools/ast-parser/go/parser.d.ts.map +1 -0
  23. package/dist/tools/ast-parser/go/parser.js +147 -0
  24. package/dist/tools/ast-parser/go/parser.js.map +1 -0
  25. package/dist/tools/ast-parser/go/schema-extractor.d.ts +103 -0
  26. package/dist/tools/ast-parser/go/schema-extractor.d.ts.map +1 -0
  27. package/dist/tools/ast-parser/go/schema-extractor.js +487 -0
  28. package/dist/tools/ast-parser/go/schema-extractor.js.map +1 -0
  29. package/dist/tools/ast-parser/go/semantic-normalizer.d.ts +51 -0
  30. package/dist/tools/ast-parser/go/semantic-normalizer.d.ts.map +1 -0
  31. package/dist/tools/ast-parser/go/semantic-normalizer.js +263 -0
  32. package/dist/tools/ast-parser/go/semantic-normalizer.js.map +1 -0
  33. package/dist/tools/ast-parser/go/types.d.ts +131 -0
  34. package/dist/tools/ast-parser/go/types.d.ts.map +1 -0
  35. package/dist/tools/ast-parser/go/types.js +3 -0
  36. package/dist/tools/ast-parser/go/types.js.map +1 -0
  37. package/dist/tools/ast-parser/markdown/index.d.ts +28 -0
  38. package/dist/tools/ast-parser/markdown/index.d.ts.map +1 -0
  39. package/dist/tools/ast-parser/markdown/index.js +31 -0
  40. package/dist/tools/ast-parser/markdown/index.js.map +1 -0
  41. package/dist/tools/ast-parser/markdown/parser.d.ts +271 -0
  42. package/dist/tools/ast-parser/markdown/parser.d.ts.map +1 -0
  43. package/dist/tools/ast-parser/markdown/parser.js +613 -0
  44. package/dist/tools/ast-parser/markdown/parser.js.map +1 -0
  45. package/dist/tools/ast-parser/markdown/types.d.ts +131 -0
  46. package/dist/tools/ast-parser/markdown/types.d.ts.map +1 -0
  47. package/dist/tools/ast-parser/markdown/types.js +3 -0
  48. package/dist/tools/ast-parser/markdown/types.js.map +1 -0
  49. package/dist/tools/env/index.d.ts +2 -0
  50. package/dist/tools/env/index.d.ts.map +1 -0
  51. package/dist/tools/env/index.js +6 -0
  52. package/dist/tools/env/index.js.map +1 -0
  53. package/dist/tools/env/load-env.d.ts +9 -0
  54. package/dist/tools/env/load-env.d.ts.map +1 -0
  55. package/dist/tools/env/load-env.js +39 -0
  56. package/dist/tools/env/load-env.js.map +1 -0
  57. package/dist/tools/line-pattern/index.d.ts +15 -0
  58. package/dist/tools/line-pattern/index.d.ts.map +1 -0
  59. package/dist/tools/line-pattern/index.js +25 -0
  60. package/dist/tools/line-pattern/index.js.map +1 -0
  61. package/dist/tools/line-pattern/line-pattern.d.ts +53 -0
  62. package/dist/tools/line-pattern/line-pattern.d.ts.map +1 -0
  63. package/dist/tools/line-pattern/line-pattern.js +88 -0
  64. package/dist/tools/line-pattern/line-pattern.js.map +1 -0
  65. package/dist/tools/line-pattern/segment.d.ts +24 -0
  66. package/dist/tools/line-pattern/segment.d.ts.map +1 -0
  67. package/dist/tools/line-pattern/segment.js +15 -0
  68. package/dist/tools/line-pattern/segment.js.map +1 -0
  69. package/dist/tools/line-pattern/segments.d.ts +43 -0
  70. package/dist/tools/line-pattern/segments.d.ts.map +1 -0
  71. package/dist/tools/line-pattern/segments.js +91 -0
  72. package/dist/tools/line-pattern/segments.js.map +1 -0
  73. package/dist/tools/llm/description-intent/format-spec.d.ts +3 -0
  74. package/dist/tools/llm/description-intent/format-spec.d.ts.map +1 -0
  75. package/dist/tools/llm/description-intent/format-spec.js +167 -0
  76. package/dist/tools/llm/description-intent/format-spec.js.map +1 -0
  77. package/dist/tools/llm/description-intent/index.d.ts +7 -0
  78. package/dist/tools/llm/description-intent/index.d.ts.map +1 -0
  79. package/dist/tools/llm/description-intent/index.js +15 -0
  80. package/dist/tools/llm/description-intent/index.js.map +1 -0
  81. package/dist/tools/llm/description-intent/intent-detector.d.ts +8 -0
  82. package/dist/tools/llm/description-intent/intent-detector.d.ts.map +1 -0
  83. package/dist/tools/llm/description-intent/intent-detector.js +103 -0
  84. package/dist/tools/llm/description-intent/intent-detector.js.map +1 -0
  85. package/dist/tools/llm/description-intent/normalizer.d.ts +12 -0
  86. package/dist/tools/llm/description-intent/normalizer.d.ts.map +1 -0
  87. package/dist/tools/llm/description-intent/normalizer.js +73 -0
  88. package/dist/tools/llm/description-intent/normalizer.js.map +1 -0
  89. package/dist/tools/llm/description-intent/slot-extractor.d.ts +3 -0
  90. package/dist/tools/llm/description-intent/slot-extractor.d.ts.map +1 -0
  91. package/dist/tools/llm/description-intent/slot-extractor.js +66 -0
  92. package/dist/tools/llm/description-intent/slot-extractor.js.map +1 -0
  93. package/dist/tools/llm/description-intent/types.d.ts +28 -0
  94. package/dist/tools/llm/description-intent/types.d.ts.map +1 -0
  95. package/dist/tools/llm/description-intent/types.js +19 -0
  96. package/dist/tools/llm/description-intent/types.js.map +1 -0
  97. package/dist/tools/llm/index.d.ts +16 -0
  98. package/dist/tools/llm/index.d.ts.map +1 -0
  99. package/dist/tools/llm/index.js +26 -0
  100. package/dist/tools/llm/index.js.map +1 -0
  101. package/dist/tools/llm/model.d.ts +3 -0
  102. package/dist/tools/llm/model.d.ts.map +1 -0
  103. package/dist/tools/llm/model.js +18 -0
  104. package/dist/tools/llm/model.js.map +1 -0
  105. package/dist/tools/llm/structured-caller.d.ts +86 -0
  106. package/dist/tools/llm/structured-caller.d.ts.map +1 -0
  107. package/dist/tools/llm/structured-caller.js +181 -0
  108. package/dist/tools/llm/structured-caller.js.map +1 -0
  109. package/dist/tools/node-pattern/index.d.ts +17 -0
  110. package/dist/tools/node-pattern/index.d.ts.map +1 -0
  111. package/dist/tools/node-pattern/index.js +36 -0
  112. package/dist/tools/node-pattern/index.js.map +1 -0
  113. package/dist/tools/node-pattern/matchers.d.ts +61 -0
  114. package/dist/tools/node-pattern/matchers.d.ts.map +1 -0
  115. package/dist/tools/node-pattern/matchers.js +154 -0
  116. package/dist/tools/node-pattern/matchers.js.map +1 -0
  117. package/dist/tools/node-pattern/node-matcher.d.ts +69 -0
  118. package/dist/tools/node-pattern/node-matcher.d.ts.map +1 -0
  119. package/dist/tools/node-pattern/node-matcher.js +122 -0
  120. package/dist/tools/node-pattern/node-matcher.js.map +1 -0
  121. package/dist/tools/node-pattern/node-pattern.d.ts +65 -0
  122. package/dist/tools/node-pattern/node-pattern.d.ts.map +1 -0
  123. package/dist/tools/node-pattern/node-pattern.js +129 -0
  124. package/dist/tools/node-pattern/node-pattern.js.map +1 -0
  125. package/dist/tools/section-check/index.d.ts +4 -0
  126. package/dist/tools/section-check/index.d.ts.map +1 -0
  127. package/dist/tools/section-check/index.js +10 -0
  128. package/dist/tools/section-check/index.js.map +1 -0
  129. package/dist/tools/section-check/section-check.d.ts +46 -0
  130. package/dist/tools/section-check/section-check.d.ts.map +1 -0
  131. package/dist/tools/section-check/section-check.js +264 -0
  132. package/dist/tools/section-check/section-check.js.map +1 -0
  133. package/dist/tools/section-check/types.d.ts +35 -0
  134. package/dist/tools/section-check/types.d.ts.map +1 -0
  135. package/dist/tools/section-check/types.js +23 -0
  136. package/dist/tools/section-check/types.js.map +1 -0
  137. package/dist/tools/text-grep/index.d.ts +10 -0
  138. package/dist/tools/text-grep/index.d.ts.map +1 -0
  139. package/dist/tools/text-grep/index.js +13 -0
  140. package/dist/tools/text-grep/index.js.map +1 -0
  141. package/dist/tools/text-grep/regex-grep.d.ts +92 -0
  142. package/dist/tools/text-grep/regex-grep.d.ts.map +1 -0
  143. package/dist/tools/text-grep/regex-grep.js +141 -0
  144. package/dist/tools/text-grep/regex-grep.js.map +1 -0
  145. package/dist/workflow/context/context.d.ts +13 -0
  146. package/dist/workflow/context/context.d.ts.map +1 -0
  147. package/dist/workflow/context/context.js +29 -0
  148. package/dist/workflow/context/context.js.map +1 -0
  149. package/dist/workflow/implement/resource-check/context-keys.d.ts +30 -0
  150. package/dist/workflow/implement/resource-check/context-keys.d.ts.map +1 -0
  151. package/dist/workflow/implement/resource-check/context-keys.js +33 -0
  152. package/dist/workflow/implement/resource-check/context-keys.js.map +1 -0
  153. package/dist/workflow/implement/resource-check/resource-check-workflow.d.ts +20 -0
  154. package/dist/workflow/implement/resource-check/resource-check-workflow.d.ts.map +1 -0
  155. package/dist/workflow/implement/resource-check/resource-check-workflow.js +325 -0
  156. package/dist/workflow/implement/resource-check/resource-check-workflow.js.map +1 -0
  157. package/dist/workflow/implement/resource-check/rules/index.d.ts +5 -0
  158. package/dist/workflow/implement/resource-check/rules/index.d.ts.map +1 -0
  159. package/dist/workflow/implement/resource-check/rules/index.js +21 -0
  160. package/dist/workflow/implement/resource-check/rules/index.js.map +1 -0
  161. package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.d.ts +8 -0
  162. package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.d.ts.map +1 -0
  163. package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.js +51 -0
  164. package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.js.map +1 -0
  165. package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.d.ts +8 -0
  166. package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.d.ts.map +1 -0
  167. package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.js +60 -0
  168. package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.js.map +1 -0
  169. package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.d.ts +9 -0
  170. package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.d.ts.map +1 -0
  171. package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.js +80 -0
  172. package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.js.map +1 -0
  173. package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.d.ts +8 -0
  174. package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.d.ts.map +1 -0
  175. package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.js +42 -0
  176. package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.js.map +1 -0
  177. package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.d.ts +8 -0
  178. package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.d.ts.map +1 -0
  179. package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.js +34 -0
  180. package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.js.map +1 -0
  181. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.d.ts +8 -0
  182. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.d.ts.map +1 -0
  183. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.js +33 -0
  184. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.js.map +1 -0
  185. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.d.ts +8 -0
  186. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.d.ts.map +1 -0
  187. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.js +33 -0
  188. package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.js.map +1 -0
  189. package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.d.ts +8 -0
  190. package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.d.ts.map +1 -0
  191. package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.js +34 -0
  192. package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.js.map +1 -0
  193. package/dist/workflow/implement/resource-check/rules/markdown-format/index.d.ts +11 -0
  194. package/dist/workflow/implement/resource-check/rules/markdown-format/index.d.ts.map +1 -0
  195. package/dist/workflow/implement/resource-check/rules/markdown-format/index.js +38 -0
  196. package/dist/workflow/implement/resource-check/rules/markdown-format/index.js.map +1 -0
  197. package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.d.ts +15 -0
  198. package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.d.ts.map +1 -0
  199. package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.js +77 -0
  200. package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.js.map +1 -0
  201. package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.d.ts +23 -0
  202. package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.d.ts.map +1 -0
  203. package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.js +128 -0
  204. package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.js.map +1 -0
  205. package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.d.ts +9 -0
  206. package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.d.ts.map +1 -0
  207. package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.js +19 -0
  208. package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.js.map +1 -0
  209. package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.d.ts +8 -0
  210. package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.d.ts.map +1 -0
  211. package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.js +44 -0
  212. package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.js.map +1 -0
  213. package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.d.ts +9 -0
  214. package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.d.ts.map +1 -0
  215. package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.js +80 -0
  216. package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.js.map +1 -0
  217. package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.d.ts +15 -0
  218. package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.d.ts.map +1 -0
  219. package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.js +77 -0
  220. package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.js.map +1 -0
  221. package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.d.ts +23 -0
  222. package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.d.ts.map +1 -0
  223. package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js +128 -0
  224. package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js.map +1 -0
  225. package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.d.ts +11 -0
  226. package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.d.ts.map +1 -0
  227. package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.js +145 -0
  228. package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.js.map +1 -0
  229. package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.d.ts +11 -0
  230. package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.d.ts.map +1 -0
  231. package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.js +145 -0
  232. package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.js.map +1 -0
  233. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.d.ts +9 -0
  234. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.d.ts.map +1 -0
  235. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.js +83 -0
  236. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.js.map +1 -0
  237. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.d.ts +9 -0
  238. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.d.ts.map +1 -0
  239. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.js +83 -0
  240. package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.js.map +1 -0
  241. package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.d.ts +7 -0
  242. package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.d.ts.map +1 -0
  243. package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.js +15 -0
  244. package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.js.map +1 -0
  245. package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts +9 -0
  246. package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts.map +1 -0
  247. package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.js +96 -0
  248. package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.js.map +1 -0
  249. package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.d.ts +9 -0
  250. package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.d.ts.map +1 -0
  251. package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.js +109 -0
  252. package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.js.map +1 -0
  253. package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.d.ts +19 -0
  254. package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.d.ts.map +1 -0
  255. package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.js +31 -0
  256. package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.js.map +1 -0
  257. package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.d.ts +15 -0
  258. package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.d.ts.map +1 -0
  259. package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.js +554 -0
  260. package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.js.map +1 -0
  261. package/dist/workflow/implement/resource-check/tools/doc-semantic/index.d.ts +5 -0
  262. package/dist/workflow/implement/resource-check/tools/doc-semantic/index.d.ts.map +1 -0
  263. package/dist/workflow/implement/resource-check/tools/doc-semantic/index.js +16 -0
  264. package/dist/workflow/implement/resource-check/tools/doc-semantic/index.js.map +1 -0
  265. package/dist/workflow/implement/resource-check/tools/doc-semantic/types.d.ts +94 -0
  266. package/dist/workflow/implement/resource-check/tools/doc-semantic/types.d.ts.map +1 -0
  267. package/dist/workflow/implement/resource-check/tools/doc-semantic/types.js +42 -0
  268. package/dist/workflow/implement/resource-check/tools/doc-semantic/types.js.map +1 -0
  269. package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.d.ts +4 -0
  270. package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.d.ts.map +1 -0
  271. package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.js +103 -0
  272. package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.js.map +1 -0
  273. package/dist/workflow/implement/resource-check/tools/schema-semantic/index.d.ts +3 -0
  274. package/dist/workflow/implement/resource-check/tools/schema-semantic/index.d.ts.map +1 -0
  275. package/dist/workflow/implement/resource-check/tools/schema-semantic/index.js +6 -0
  276. package/dist/workflow/implement/resource-check/tools/schema-semantic/index.js.map +1 -0
  277. package/dist/workflow/implement/resource-check/tools/schema-semantic/types.d.ts +47 -0
  278. package/dist/workflow/implement/resource-check/tools/schema-semantic/types.d.ts.map +1 -0
  279. package/dist/workflow/implement/resource-check/tools/schema-semantic/types.js +3 -0
  280. package/dist/workflow/implement/resource-check/tools/schema-semantic/types.js.map +1 -0
  281. package/dist/workflow/implement/resource-check/tools/terraform-schema/index.d.ts +4 -0
  282. package/dist/workflow/implement/resource-check/tools/terraform-schema/index.d.ts.map +1 -0
  283. package/dist/workflow/implement/resource-check/tools/terraform-schema/index.js +8 -0
  284. package/dist/workflow/implement/resource-check/tools/terraform-schema/index.js.map +1 -0
  285. package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.d.ts +108 -0
  286. package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.d.ts.map +1 -0
  287. package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.js +498 -0
  288. package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.js.map +1 -0
  289. package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.d.ts +51 -0
  290. package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.d.ts.map +1 -0
  291. package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.js +271 -0
  292. package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.js.map +1 -0
  293. package/dist/workflow/implement/resource-check/tools/terraform-schema/types.d.ts +133 -0
  294. package/dist/workflow/implement/resource-check/tools/terraform-schema/types.d.ts.map +1 -0
  295. package/dist/workflow/implement/resource-check/tools/terraform-schema/types.js +3 -0
  296. package/dist/workflow/implement/resource-check/tools/terraform-schema/types.js.map +1 -0
  297. package/dist/workflow/implement/resource-check/types.d.ts +18 -0
  298. package/dist/workflow/implement/resource-check/types.d.ts.map +1 -0
  299. package/dist/workflow/implement/resource-check/types.js +107 -0
  300. package/dist/workflow/implement/resource-check/types.js.map +1 -0
  301. package/dist/workflow/types/rule/rule.d.ts +72 -0
  302. package/dist/workflow/types/rule/rule.d.ts.map +1 -0
  303. package/dist/workflow/types/rule/rule.js +110 -0
  304. package/dist/workflow/types/rule/rule.js.map +1 -0
  305. package/dist/workflow/workflow.d.ts +52 -0
  306. package/dist/workflow/workflow.d.ts.map +1 -0
  307. package/dist/workflow/workflow.js +121 -0
  308. package/dist/workflow/workflow.js.map +1 -0
  309. package/package.json +36 -0
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Rule = exports.RuleCheckResult = void 0;
4
+ class RuleCheckResult {
5
+ constructor(success, message, original, suggested, children = [], range) {
6
+ this.success = success;
7
+ this.message = message;
8
+ this.original = original;
9
+ this.suggested = suggested;
10
+ this.children = children;
11
+ this.range = range;
12
+ }
13
+ static aggregate(children) {
14
+ return new RuleCheckResult(true, "", "", "", children);
15
+ }
16
+ static pass(message, range, original = "", suggested, children = []) {
17
+ const normalizedSuggested = suggested ?? original;
18
+ return new RuleCheckResult(true, message, original, normalizedSuggested, children, range);
19
+ }
20
+ static fromLine(line) {
21
+ if (!line || line <= 0)
22
+ return undefined;
23
+ return {
24
+ start: { line, column: 1 },
25
+ end: { line, column: 1 },
26
+ };
27
+ }
28
+ /**
29
+ * Aggregate success: this result is successful only when itself
30
+ * AND all descendant results are successful.
31
+ */
32
+ get aggregateSuccess() {
33
+ if (!this.success)
34
+ return false;
35
+ return this.children.every((c) => c.aggregateSuccess);
36
+ }
37
+ /**
38
+ * Collect all failing results across the tree (depth-first).
39
+ */
40
+ collectFailures() {
41
+ const failures = [];
42
+ if (!this.success)
43
+ failures.push(this);
44
+ for (const child of this.children) {
45
+ failures.push(...child.collectFailures());
46
+ }
47
+ return failures;
48
+ }
49
+ }
50
+ exports.RuleCheckResult = RuleCheckResult;
51
+ /**
52
+ * Abstract base class for code checking rules.
53
+ *
54
+ * Supports a tree structure: each rule can have child rules.
55
+ * Subclasses override `test()` to implement their checking logic
56
+ * and can call `executeChildren()` to dispatch child rules.
57
+ *
58
+ * Rule metadata (name, description, error message templates) is
59
+ * declared separately via `RuleMeta` so that checking logic stays
60
+ * focused on *what* to check rather than *how to describe* results.
61
+ */
62
+ class Rule {
63
+ constructor(meta, type = "code") {
64
+ this.children = [];
65
+ this.meta = meta;
66
+ this.name = meta.name;
67
+ this.description = meta.description;
68
+ this.type = type;
69
+ }
70
+ // ── Child rule management ──
71
+ addChild(rule) {
72
+ this.children.push(rule);
73
+ return this;
74
+ }
75
+ addChildren(rules) {
76
+ this.children.push(...rules);
77
+ return this;
78
+ }
79
+ getChildren() {
80
+ return this.children;
81
+ }
82
+ // ── Result helpers ──
83
+ /**
84
+ * Build a failing `RuleCheckResult` from a registered message key.
85
+ * Extra `args` are forwarded when the template is a function.
86
+ */
87
+ fail(key, original, suggested, range, ...args) {
88
+ return new RuleCheckResult(false, this.msg(key, ...args), original, suggested ?? original, [], range);
89
+ }
90
+ msg(key, ...args) {
91
+ const tpl = this.meta.messages[key];
92
+ if (!tpl)
93
+ return key;
94
+ return typeof tpl === "function" ? tpl(...args) : tpl;
95
+ }
96
+ /**
97
+ * Dispatches child rules sequentially.
98
+ * Available for parent rules that need to coordinate children.
99
+ */
100
+ async executeChildren(code, ast, ctx) {
101
+ const all = [];
102
+ for (const child of this.children) {
103
+ const childResults = await child.test(code, ast, ctx);
104
+ all.push(...childResults);
105
+ }
106
+ return all;
107
+ }
108
+ }
109
+ exports.Rule = Rule;
110
+ //# sourceMappingURL=rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../../src/workflow/types/rule/rule.ts"],"names":[],"mappings":";;;AAGA,MAAa,eAAe;IASxB,YACI,OAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,WAA8B,EAAE,EAChC,KAAmB;QAEnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,QAA2B;QACxC,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CAAC,IAAI,CACP,OAAe,EACf,KAAmB,EACnB,WAAmB,EAAE,EACrB,SAAkB,EAClB,WAA8B,EAAE;QAEhC,MAAM,mBAAmB,GAAG,SAAS,IAAI,QAAQ,CAAC;QAClD,OAAO,IAAI,eAAe,CACtB,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,KAAK,CACR,CAAC;IACN,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAa;QACzB,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QACzC,OAAO;YACH,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE;YAC1B,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE;SAC3B,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,IAAI,gBAAgB;QAChB,IAAI,CAAC,IAAI,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,EAClB,KAAmB,EACnB,GAAG,IAAe;QAElB,OAAO,IAAI,eAAe,CACtB,KAAK,EACL,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EACtB,QAAQ,EACR,SAAS,IAAI,QAAQ,EACrB,EAAE,EACF,KAAK,CACR,CAAC;IACN,CAAC;IAES,GAAG,CAAC,GAAW,EAAE,GAAG,IAAe;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG;YAAE,OAAO,GAAG,CAAC;QACrB,OAAO,OAAO,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC1D,CAAC;IAcD;;;OAGG;IACO,KAAK,CAAC,eAAe,CAC3B,IAAY,EACZ,GAAwB,EACxB,GAAY;QAEZ,MAAM,GAAG,GAAsB,EAAE,CAAC;QAClC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChC,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACtD,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AAxFD,oBAwFC"}
@@ -0,0 +1,52 @@
1
+ import { Context } from "./context/context";
2
+ import { Rule, RuleCheckResult } from "./types/rule/rule";
3
+ export interface LifeCycle {
4
+ run(code: string, onRuleComplete?: OnRuleComplete): Promise<RuleResult[]>;
5
+ }
6
+ export interface RuleResult {
7
+ ruleName: string;
8
+ ruleDescription: string;
9
+ ruleType: string;
10
+ results: RuleCheckResult[];
11
+ }
12
+ export type OnRuleComplete = (ruleResult: RuleResult) => void;
13
+ export type RuleExecutionStrategy = "isolated" | "shared";
14
+ export interface RunRulesOptions {
15
+ rules?: ReadonlyArray<Rule>;
16
+ baseContext?: Context;
17
+ strategy?: RuleExecutionStrategy;
18
+ }
19
+ export interface WorkflowStageRuntime {
20
+ readonly code: string;
21
+ readonly context: Context;
22
+ readonly onRuleComplete?: OnRuleComplete;
23
+ updateCode(code: string): void;
24
+ setArtifact<T>(key: string, value: T, targetCtx?: Context): void;
25
+ getArtifact<T>(key: string, sourceCtx?: Context): T | undefined;
26
+ createChildContext(parentCtx?: Context): Context;
27
+ runRules(options?: RunRulesOptions): Promise<RuleResult[]>;
28
+ }
29
+ export interface WorkflowStage {
30
+ id: string;
31
+ description: string;
32
+ execute(runtime: WorkflowStageRuntime): Promise<void>;
33
+ }
34
+ export declare abstract class Workflow implements LifeCycle {
35
+ protected context: Context;
36
+ protected rules: Rule[];
37
+ protected code: string;
38
+ abstract readonly id: string;
39
+ abstract readonly description: string;
40
+ setContext(context: Context): void;
41
+ getContext(): Context;
42
+ setCode(code: string): void;
43
+ setRules(rules: Rule[]): void;
44
+ getRules(): ReadonlyArray<Rule>;
45
+ protected abstract defineStages(): WorkflowStage[];
46
+ run(code: string, onRuleComplete?: OnRuleComplete): Promise<RuleResult[]>;
47
+ protected createRuleExecutionStage(id?: string, description?: string, options?: RunRulesOptions): WorkflowStage;
48
+ protected runRules(options?: RunRulesOptions, onRuleComplete?: OnRuleComplete): Promise<RuleResult[]>;
49
+ protected createStageRuntime(allRuleResults: RuleResult[], onRuleComplete?: OnRuleComplete): WorkflowStageRuntime;
50
+ protected executeRule(rule: Rule, ctx?: Context): Promise<RuleCheckResult[]>;
51
+ }
52
+ //# sourceMappingURL=workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/workflow/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1D,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defineProperty(exports, "__esModule", { value: true });
3
+ exports.Workflow = void 0;
4
+ const context_1 = require("./context/context");
5
+ const rule_1 = require("./types/rule/rule");
6
+ class Workflow {
7
+ constructor() {
8
+ this.context = new context_1.Context();
9
+ this.rules = [];
10
+ this.code = "";
11
+ }
12
+ setContext(context) {
13
+ if (!this.context) {
14
+ this.context = new context_1.Context();
15
+ }
16
+ this.context = context;
17
+ }
18
+ getContext() {
19
+ return this.context;
20
+ }
21
+ setCode(code) {
22
+ this.code = code;
23
+ }
24
+ setRules(rules) {
25
+ this.rules = rules;
26
+ }
27
+ getRules() {
28
+ return this.rules;
29
+ }
30
+ async run(code, onRuleComplete) {
31
+ this.setCode(code);
32
+ const allRuleResults = [];
33
+ const runtime = this.createStageRuntime(allRuleResults, onRuleComplete);
34
+ for (const stage of this.defineStages()) {
35
+ try {
36
+ await stage.execute(runtime);
37
+ }
38
+ catch (err) {
39
+ const message = err instanceof Error ? err.message : String(err);
40
+ allRuleResults.push({
41
+ ruleName: `stage:${stage.id}`,
42
+ ruleDescription: stage.description,
43
+ ruleType: "stage",
44
+ results: [
45
+ new rule_1.RuleCheckResult(false, `Stage execution error: ${message}`, "", ""),
46
+ ],
47
+ });
48
+ }
49
+ }
50
+ return allRuleResults;
51
+ }
52
+ createRuleExecutionStage(id = "run-rules", description = "Execute workflow rules", options = {}) {
53
+ return {
54
+ id,
55
+ description,
56
+ execute: async (runtime) => {
57
+ await runtime.runRules(options);
58
+ },
59
+ };
60
+ }
61
+ async runRules(options = {}, onRuleComplete) {
62
+ const { rules = this.rules, baseContext = this.context, strategy = "isolated", } = options;
63
+ const allRuleResults = [];
64
+ for (const rule of rules) {
65
+ const ruleCtx = strategy === "shared" ? baseContext : baseContext.createChild();
66
+ let results;
67
+ try {
68
+ results = await this.executeRule(rule, ruleCtx);
69
+ }
70
+ catch (err) {
71
+ const message = err instanceof Error ? err.message : String(err);
72
+ results = [
73
+ new rule_1.RuleCheckResult(false, `Rule execution error: ${message}`, "", ""),
74
+ ];
75
+ }
76
+ const ruleResult = {
77
+ ruleName: rule.name,
78
+ ruleDescription: rule.description,
79
+ ruleType: rule.type,
80
+ results,
81
+ };
82
+ allRuleResults.push(ruleResult);
83
+ onRuleComplete?.(ruleResult);
84
+ }
85
+ return allRuleResults;
86
+ }
87
+ createStageRuntime(allRuleResults, onRuleComplete) {
88
+ const self = this;
89
+ return {
90
+ get code() {
91
+ return self.code;
92
+ },
93
+ get context() {
94
+ return self.context;
95
+ },
96
+ onRuleComplete,
97
+ updateCode: (code) => {
98
+ this.setCode(code);
99
+ },
100
+ setArtifact: (key, value, targetCtx) => {
101
+ (targetCtx ?? self.context).set(key, value);
102
+ },
103
+ getArtifact: (key, sourceCtx) => {
104
+ return (sourceCtx ?? self.context).get(key);
105
+ },
106
+ createChildContext: (parentCtx) => {
107
+ return (parentCtx ?? self.context).createChild();
108
+ },
109
+ runRules: async (options) => {
110
+ const result = await this.runRules(options, onRuleComplete);
111
+ allRuleResults.push(...result);
112
+ return result;
113
+ },
114
+ };
115
+ }
116
+ async executeRule(rule, ctx) {
117
+ return rule.test(this.code, undefined, ctx);
118
+ }
119
+ }
120
+ exports.Workflow = Workflow;
121
+ //# sourceMappingURL=workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/workflow/workflow.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,4CAA0D;AAwC1D,MAAsB,QAAQ;IAA9B;QACY,YAAO,GAAY,IAAI,iBAAO,EAAE,CAAC;QACjC,UAAK,GAAW,EAAE,CAAC;QACnB,SAAI,GAAW,EAAE,CAAC;IA0J9B,CAAC;IArJQ,UAAU,CAAC,OAAgB;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,UAAU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AC;CACF;AA7JD,4BA6JC"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@greyworld/code-check-core",
3
+ "version": "1.0.0",
4
+ "description": "AI-powered code review core library",
5
+ "license": "MIT",
6
+ "author": "greyworld",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@langchain/core": "^1.1.24",
17
+ "@langchain/openai": "^1.2.7",
18
+ "commonmark": "^0.31.2",
19
+ "langchain": "^1.2.24",
20
+ "tree-sitter-wasms": "^0.1.13",
21
+ "uuid": "^13.0.0",
22
+ "web-tree-sitter": "0.25.10",
23
+ "yaml": "^2.8.2",
24
+ "zod": "^4.3.6"
25
+ },
26
+ "devDependencies": {
27
+ "@types/commonmark": "^0.27.10",
28
+ "@types/node": "^25.2.3",
29
+ "@types/uuid": "^10.0.0",
30
+ "typescript": "^5.9.3"
31
+ },
32
+ "scripts": {
33
+ "build": "tsc",
34
+ "dev": "tsc --watch"
35
+ }
36
+ }