@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,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Context = void 0;
4
+ class Context {
5
+ constructor(parent) {
6
+ this.store = new Map();
7
+ this.parent = parent ?? null;
8
+ }
9
+ set(key, value) {
10
+ this.store.set(key, value);
11
+ }
12
+ /**
13
+ * Looks up the key in this context first, then walks up the parent chain.
14
+ */
15
+ get(key) {
16
+ if (this.store.has(key)) {
17
+ return this.store.get(key);
18
+ }
19
+ return this.parent?.get(key);
20
+ }
21
+ has(key) {
22
+ return this.store.has(key) || (this.parent?.has(key) ?? false);
23
+ }
24
+ createChild() {
25
+ return new Context(this);
26
+ }
27
+ }
28
+ exports.Context = Context;
29
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/workflow/context/context.ts"],"names":[],"mappings":";;;AAAA,MAAa,OAAO;IAKlB,YAAY,MAAgB;QAHpB,UAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;QAIzC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC;IAC/B,CAAC;IAED,GAAG,CAAI,GAAW,EAAE,KAAQ;QAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,GAAG,CAAI,GAAW;QAChB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAM,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAI,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,WAAW;QACT,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF;AA9BD,0BA8BC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Context keys for ResourceCheckWorkflow stage artifacts.
3
+ */
4
+ /** Parsed ResourceCheckInput object */
5
+ export declare const CTX_INPUT = "resource-check.stage.input";
6
+ /** Resolved implement go file path */
7
+ export declare const CTX_IMPLEMENT_GO_PATH = "resource-check.stage.implementGoPath";
8
+ /** Resolved markdown doc file path */
9
+ export declare const CTX_DOC_MD_PATH = "resource-check.stage.docMdPath";
10
+ /** Resolved go test file path */
11
+ export declare const CTX_TEST_GO_PATH = "resource-check.stage.testGoPath";
12
+ /** Loaded implement go source content */
13
+ export declare const CTX_IMPLEMENT_GO_SOURCE = "resource-check.stage.implementGoSource";
14
+ /** Loaded markdown source content */
15
+ export declare const CTX_DOC_MD_SOURCE = "resource-check.stage.docMdSource";
16
+ /** Loaded go test source content */
17
+ export declare const CTX_TEST_GO_SOURCE = "resource-check.stage.testGoSource";
18
+ /** Extracted ResourceSchema[] from implement go source */
19
+ export declare const CTX_IMPLEMENT_GO_SCHEMAS = "resource-check.stage.implementGoSchemas";
20
+ /** Parsed markdown AST */
21
+ export declare const CTX_DOC_MARKDOWN_AST = "resource-check.stage.docMarkdownAst";
22
+ /** Extracted DocSemanticView from markdown doc */
23
+ export declare const CTX_DOC_SEMANTIC_VIEW = "resource-check.stage.docSemanticView";
24
+ /** Schema semantic view for doc validation (SchemaSemanticView) */
25
+ export declare const CTX_SCHEMA_SEMANTIC_VIEW = "resource-check.stage.schemaSemanticView";
26
+ /** Go test extraction summary */
27
+ export declare const CTX_TEST_GO_SUMMARY = "resource-check.stage.testGoSummary";
28
+ /** HCL stage status message */
29
+ export declare const CTX_HCL_STAGE_STATUS = "resource-check.stage.hclStatus";
30
+ //# sourceMappingURL=context-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-keys.d.ts","sourceRoot":"","sources":["../../../../src/workflow/implement/resource-check/context-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uCAAuC;AACvC,eAAO,MAAM,SAAS,+BAA+B,CAAC;AAEtD,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAE5E,sCAAsC;AACtC,eAAO,MAAM,eAAe,mCAAmC,CAAC;AAEhE,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,oCAAoC,CAAC;AAElE,yCAAyC;AACzC,eAAO,MAAM,uBAAuB,2CAA2C,CAAC;AAEhF,qCAAqC;AACrC,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AAEpE,oCAAoC;AACpC,eAAO,MAAM,kBAAkB,sCAAsC,CAAC;AAEtE,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;AAElF,0BAA0B;AAC1B,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAE1E,kDAAkD;AAClD,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAE5E,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;AAElF,iCAAiC;AACjC,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AAExE,+BAA+B;AAC/B,eAAO,MAAM,oBAAoB,mCAAmC,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * Context keys for ResourceCheckWorkflow stage artifacts.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CTX_HCL_STAGE_STATUS = exports.CTX_TEST_GO_SUMMARY = exports.CTX_SCHEMA_SEMANTIC_VIEW = exports.CTX_DOC_SEMANTIC_VIEW = exports.CTX_DOC_MARKDOWN_AST = exports.CTX_IMPLEMENT_GO_SCHEMAS = exports.CTX_TEST_GO_SOURCE = exports.CTX_DOC_MD_SOURCE = exports.CTX_IMPLEMENT_GO_SOURCE = exports.CTX_TEST_GO_PATH = exports.CTX_DOC_MD_PATH = exports.CTX_IMPLEMENT_GO_PATH = exports.CTX_INPUT = void 0;
7
+ /** Parsed ResourceCheckInput object */
8
+ exports.CTX_INPUT = "resource-check.stage.input";
9
+ /** Resolved implement go file path */
10
+ exports.CTX_IMPLEMENT_GO_PATH = "resource-check.stage.implementGoPath";
11
+ /** Resolved markdown doc file path */
12
+ exports.CTX_DOC_MD_PATH = "resource-check.stage.docMdPath";
13
+ /** Resolved go test file path */
14
+ exports.CTX_TEST_GO_PATH = "resource-check.stage.testGoPath";
15
+ /** Loaded implement go source content */
16
+ exports.CTX_IMPLEMENT_GO_SOURCE = "resource-check.stage.implementGoSource";
17
+ /** Loaded markdown source content */
18
+ exports.CTX_DOC_MD_SOURCE = "resource-check.stage.docMdSource";
19
+ /** Loaded go test source content */
20
+ exports.CTX_TEST_GO_SOURCE = "resource-check.stage.testGoSource";
21
+ /** Extracted ResourceSchema[] from implement go source */
22
+ exports.CTX_IMPLEMENT_GO_SCHEMAS = "resource-check.stage.implementGoSchemas";
23
+ /** Parsed markdown AST */
24
+ exports.CTX_DOC_MARKDOWN_AST = "resource-check.stage.docMarkdownAst";
25
+ /** Extracted DocSemanticView from markdown doc */
26
+ exports.CTX_DOC_SEMANTIC_VIEW = "resource-check.stage.docSemanticView";
27
+ /** Schema semantic view for doc validation (SchemaSemanticView) */
28
+ exports.CTX_SCHEMA_SEMANTIC_VIEW = "resource-check.stage.schemaSemanticView";
29
+ /** Go test extraction summary */
30
+ exports.CTX_TEST_GO_SUMMARY = "resource-check.stage.testGoSummary";
31
+ /** HCL stage status message */
32
+ exports.CTX_HCL_STAGE_STATUS = "resource-check.stage.hclStatus";
33
+ //# sourceMappingURL=context-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-keys.js","sourceRoot":"","sources":["../../../../src/workflow/implement/resource-check/context-keys.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAAuC;AAC1B,QAAA,SAAS,GAAG,4BAA4B,CAAC;AAEtD,sCAAsC;AACzB,QAAA,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E,sCAAsC;AACzB,QAAA,eAAe,GAAG,gCAAgC,CAAC;AAEhE,iCAAiC;AACpB,QAAA,gBAAgB,GAAG,iCAAiC,CAAC;AAElE,yCAAyC;AAC5B,QAAA,uBAAuB,GAAG,wCAAwC,CAAC;AAEhF,qCAAqC;AACxB,QAAA,iBAAiB,GAAG,kCAAkC,CAAC;AAEpE,oCAAoC;AACvB,QAAA,kBAAkB,GAAG,mCAAmC,CAAC;AAEtE,0DAA0D;AAC7C,QAAA,wBAAwB,GAAG,yCAAyC,CAAC;AAElF,0BAA0B;AACb,QAAA,oBAAoB,GAAG,qCAAqC,CAAC;AAE1E,kDAAkD;AACrC,QAAA,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E,mEAAmE;AACtD,QAAA,wBAAwB,GAAG,yCAAyC,CAAC;AAElF,iCAAiC;AACpB,QAAA,mBAAmB,GAAG,oCAAoC,CAAC;AAExE,+BAA+B;AAClB,QAAA,oBAAoB,GAAG,gCAAgC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Workflow, type WorkflowStage } from "../../workflow";
2
+ import { Rule, RuleCheckResult } from "../../types/rule/rule";
3
+ import type { Context } from "../../context/context";
4
+ export declare class ResourceCheckWorkflow extends Workflow {
5
+ readonly id = "resource-check";
6
+ readonly description = "Staged checks for resource implement/doc/test files (Go + Markdown + HCL)";
7
+ private readonly markdownParser;
8
+ protected executeRule(rule: Rule, ctx?: Context): Promise<RuleCheckResult[]>;
9
+ protected defineStages(): WorkflowStage[];
10
+ private stageResolveResourceFiles;
11
+ private stageExtractGoSchema;
12
+ private stageExtractDocStructure;
13
+ private stageCheckGoImplement;
14
+ private stageCheckMarkdownFormat;
15
+ private stageCheckMarkdownSemantic;
16
+ private stageExtractGoTest;
17
+ private stageCheckGoTest;
18
+ private stageCheckGoTestHclStyle;
19
+ }
20
+ //# sourceMappingURL=resource-check-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-check-workflow.d.ts","sourceRoot":"","sources":["../../../../src/workflow/implement/resource-check/resource-check-workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAqCrD,qBAAa,qBAAsB,SAAQ,QAAQ;IAC/C,SAAgB,EAAE,oBAAoB;IACtC,SAAgB,WAAW,+EACqD;IAEhF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwB;cAE9B,WAAW,CAChC,IAAI,EAAE,IAAI,EACV,GAAG,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,eAAe,EAAE,CAAC;IAM7B,SAAS,CAAC,YAAY,IAAI,aAAa,EAAE;IAgBzC,OAAO,CAAC,yBAAyB;IA4BjC,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,qBAAqB;IA+B7B,OAAO,CAAC,wBAAwB;IA6ChC,OAAO,CAAC,0BAA0B;IA6DlC,OAAO,CAAC,kBAAkB;IAqC1B,OAAO,CAAC,gBAAgB;IAmCxB,OAAO,CAAC,wBAAwB;CAuBnC"}
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ResourceCheckWorkflow = void 0;
7
+ const promises_1 = __importDefault(require("fs/promises"));
8
+ const workflow_1 = require("../../workflow");
9
+ const go_1 = require("../../../tools/ast-parser/go");
10
+ const terraform_schema_1 = require("./tools/terraform-schema");
11
+ const markdown_1 = require("../../../tools/ast-parser/markdown");
12
+ const doc_semantic_1 = require("./tools/doc-semantic");
13
+ const types_1 = require("./types");
14
+ const schema_semantic_1 = require("./tools/schema-semantic");
15
+ const context_keys_1 = require("./context-keys");
16
+ const rules_1 = require("./rules");
17
+ const markdown_format_1 = require("./rules/markdown-format");
18
+ const markdown_semantic_1 = require("./rules/markdown-semantic");
19
+ class ResourceCheckWorkflow extends workflow_1.Workflow {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.id = "resource-check";
23
+ this.description = "Staged checks for resource implement/doc/test files (Go + Markdown + HCL)";
24
+ this.markdownParser = new markdown_1.MarkdownParser();
25
+ }
26
+ async executeRule(rule, ctx) {
27
+ const ast = ctx?.get(context_keys_1.CTX_DOC_MARKDOWN_AST)
28
+ ?? this.context.get(context_keys_1.CTX_DOC_MARKDOWN_AST);
29
+ return rule.test(this.code, ast ?? undefined, ctx);
30
+ }
31
+ defineStages() {
32
+ return [
33
+ this.stageResolveResourceFiles(),
34
+ this.stageExtractGoSchema(),
35
+ this.stageExtractDocStructure(),
36
+ this.stageCheckGoImplement(),
37
+ this.stageCheckMarkdownFormat(),
38
+ this.stageCheckMarkdownSemantic(),
39
+ this.stageExtractGoTest(),
40
+ this.stageCheckGoTest(),
41
+ this.stageCheckGoTestHclStyle(),
42
+ ];
43
+ }
44
+ // ── Stage 1: resolve-resource-files ──
45
+ stageResolveResourceFiles() {
46
+ return {
47
+ id: "resolve-resource-files",
48
+ description: "Parse input and resolve resource file paths",
49
+ execute: async (runtime) => {
50
+ const input = (0, types_1.parseResourceCheckInput)(runtime.code);
51
+ runtime.setArtifact(context_keys_1.CTX_INPUT, input);
52
+ const paths = (0, types_1.resolveResourcePaths)(input);
53
+ runtime.setArtifact(context_keys_1.CTX_IMPLEMENT_GO_PATH, paths.implementGoPath);
54
+ runtime.setArtifact(context_keys_1.CTX_DOC_MD_PATH, paths.docMdPath);
55
+ runtime.setArtifact(context_keys_1.CTX_TEST_GO_PATH, paths.testGoPath);
56
+ const [goSrc, mdSrc, testSrc] = await Promise.all([
57
+ readFileIfExists(paths.implementGoPath),
58
+ readFileIfExists(paths.docMdPath),
59
+ readFileIfExists(paths.testGoPath),
60
+ ]);
61
+ runtime.setArtifact(context_keys_1.CTX_IMPLEMENT_GO_SOURCE, goSrc ?? "");
62
+ runtime.setArtifact(context_keys_1.CTX_DOC_MD_SOURCE, mdSrc ?? "");
63
+ runtime.setArtifact(context_keys_1.CTX_TEST_GO_SOURCE, testSrc ?? "");
64
+ },
65
+ };
66
+ }
67
+ // ── Stage 2: extract-go-schema ──
68
+ stageExtractGoSchema() {
69
+ return {
70
+ id: "extract-go-schema",
71
+ description: "Extract Terraform schema from implement go file",
72
+ execute: async (runtime) => {
73
+ const source = runtime.getArtifact(context_keys_1.CTX_IMPLEMENT_GO_SOURCE) ?? "";
74
+ if (!source.trim()) {
75
+ runtime.setArtifact(context_keys_1.CTX_IMPLEMENT_GO_SCHEMAS, []);
76
+ return;
77
+ }
78
+ const parser = await go_1.GoParser.create();
79
+ try {
80
+ const extractor = new terraform_schema_1.TerraformSchemaExtractor(parser);
81
+ const normalizer = new terraform_schema_1.TerraformSchemaSemanticNormalizer();
82
+ const rawSchemas = extractor.extract(source);
83
+ const schemas = normalizer.normalizeSchemas(source, rawSchemas);
84
+ runtime.setArtifact(context_keys_1.CTX_IMPLEMENT_GO_SCHEMAS, schemas);
85
+ }
86
+ finally {
87
+ parser.dispose();
88
+ }
89
+ },
90
+ };
91
+ }
92
+ // ── Stage 3: extract-doc-structure ──
93
+ stageExtractDocStructure() {
94
+ return {
95
+ id: "extract-doc-structure",
96
+ description: "Parse markdown and extract document structure",
97
+ execute: async (runtime) => {
98
+ const source = runtime.getArtifact(context_keys_1.CTX_DOC_MD_SOURCE) ?? "";
99
+ if (!source.trim()) {
100
+ runtime.setArtifact(context_keys_1.CTX_DOC_SEMANTIC_VIEW, new doc_semantic_1.DocSemanticView());
101
+ return;
102
+ }
103
+ const ast = this.markdownParser.parse(source);
104
+ runtime.setArtifact(context_keys_1.CTX_DOC_MARKDOWN_AST, ast);
105
+ const docSemanticView = (0, doc_semantic_1.buildDocSemanticView)(ast, source, this.markdownParser);
106
+ runtime.setArtifact(context_keys_1.CTX_DOC_SEMANTIC_VIEW, docSemanticView);
107
+ },
108
+ };
109
+ }
110
+ // ── Stage 4: check-go-implement ──
111
+ stageCheckGoImplement() {
112
+ return {
113
+ id: "check-go-implement",
114
+ description: "Structured checks for implement go file",
115
+ execute: async (runtime) => {
116
+ const goPath = runtime.getArtifact(context_keys_1.CTX_IMPLEMENT_GO_PATH) ?? "";
117
+ const source = runtime.getArtifact(context_keys_1.CTX_IMPLEMENT_GO_SOURCE) ?? "";
118
+ const schemas = runtime.getArtifact(context_keys_1.CTX_IMPLEMENT_GO_SCHEMAS) ?? [];
119
+ const missing = !source.trim();
120
+ const message = missing
121
+ ? `Implement file is missing or empty: ${goPath}`
122
+ : `Implement check placeholder: extracted ${schemas.length} schema(s)`;
123
+ await runtime.runRules({
124
+ rules: [
125
+ new rules_1.StagePlaceholderRule({
126
+ name: "implement-structured-check",
127
+ description: "Structured check for implement go file",
128
+ message,
129
+ success: !missing,
130
+ }),
131
+ ],
132
+ strategy: "shared",
133
+ });
134
+ },
135
+ };
136
+ }
137
+ // ── Stage 5: check-markdown-format ──
138
+ stageCheckMarkdownFormat() {
139
+ return {
140
+ id: "check-markdown-format",
141
+ description: "Markdown format checks without semantic context",
142
+ execute: async (runtime) => {
143
+ const source = runtime.getArtifact(context_keys_1.CTX_DOC_MD_SOURCE) ?? "";
144
+ const ast = runtime.getArtifact(context_keys_1.CTX_DOC_MARKDOWN_AST);
145
+ if (!ast || !source.trim()) {
146
+ const docPath = runtime.getArtifact(context_keys_1.CTX_DOC_MD_PATH) ?? "";
147
+ await runtime.runRules({
148
+ rules: [
149
+ new rules_1.StagePlaceholderRule({
150
+ name: "doc-format-check",
151
+ description: "Markdown format checks without semantic context",
152
+ message: `Document file is missing or empty: ${docPath}`,
153
+ success: false,
154
+ }),
155
+ ],
156
+ strategy: "shared",
157
+ });
158
+ return;
159
+ }
160
+ const savedCode = runtime.code;
161
+ runtime.updateCode(source);
162
+ const checkCtx = runtime.createChildContext();
163
+ checkCtx.set(context_keys_1.CTX_DOC_MARKDOWN_AST, ast);
164
+ try {
165
+ await runtime.runRules({
166
+ rules: markdown_format_1.MARKDOWN_FORMAT_RULES,
167
+ baseContext: checkCtx,
168
+ strategy: "shared",
169
+ });
170
+ }
171
+ finally {
172
+ runtime.updateCode(savedCode);
173
+ }
174
+ },
175
+ };
176
+ }
177
+ // ── Stage 6: check-markdown-semantic ──
178
+ stageCheckMarkdownSemantic() {
179
+ return {
180
+ id: "check-markdown-semantic",
181
+ description: "Build schema semantic view and run doc-semantic rules",
182
+ execute: async (runtime) => {
183
+ const source = runtime.getArtifact(context_keys_1.CTX_DOC_MD_SOURCE) ?? "";
184
+ const schemas = runtime.getArtifact(context_keys_1.CTX_IMPLEMENT_GO_SCHEMAS) ?? [];
185
+ const input = runtime.getArtifact(context_keys_1.CTX_INPUT);
186
+ const missingDoc = !source.trim();
187
+ const missingSemantic = schemas.length === 0;
188
+ if (missingDoc || missingSemantic) {
189
+ const message = missingDoc
190
+ ? "Semantic doc check skipped: markdown source missing"
191
+ : "Semantic doc check skipped: go schema extraction context missing";
192
+ await runtime.runRules({
193
+ rules: [
194
+ new rules_1.StagePlaceholderRule({
195
+ name: "doc-semantic-check",
196
+ description: "Markdown checks with semantic context",
197
+ message,
198
+ success: false,
199
+ }),
200
+ ],
201
+ strategy: "shared",
202
+ });
203
+ return;
204
+ }
205
+ const view = (0, schema_semantic_1.buildSchemaSemanticView)(schemas[0], input?.resourceType ?? "resource");
206
+ runtime.setArtifact(context_keys_1.CTX_SCHEMA_SEMANTIC_VIEW, view);
207
+ const ast = runtime.getArtifact(context_keys_1.CTX_DOC_MARKDOWN_AST);
208
+ const docSemanticView = runtime.getArtifact(context_keys_1.CTX_DOC_SEMANTIC_VIEW);
209
+ const checkCtx = runtime.createChildContext();
210
+ checkCtx.set(context_keys_1.CTX_SCHEMA_SEMANTIC_VIEW, view);
211
+ checkCtx.set(context_keys_1.CTX_DOC_SEMANTIC_VIEW, docSemanticView);
212
+ checkCtx.set(context_keys_1.CTX_DOC_MARKDOWN_AST, ast);
213
+ const savedCode = runtime.code;
214
+ runtime.updateCode(source);
215
+ try {
216
+ await runtime.runRules({
217
+ rules: markdown_semantic_1.MARKDOWN_SEMANTIC_RULES,
218
+ baseContext: checkCtx,
219
+ strategy: "shared",
220
+ });
221
+ }
222
+ finally {
223
+ runtime.updateCode(savedCode);
224
+ }
225
+ },
226
+ };
227
+ }
228
+ // ── Stage 7: extract-go-test ──
229
+ stageExtractGoTest() {
230
+ return {
231
+ id: "extract-go-test",
232
+ description: "Extract go test structure",
233
+ execute: async (runtime) => {
234
+ const source = runtime.getArtifact(context_keys_1.CTX_TEST_GO_SOURCE) ?? "";
235
+ if (!source.trim()) {
236
+ runtime.setArtifact(context_keys_1.CTX_TEST_GO_SUMMARY, {
237
+ functionCount: 0,
238
+ testFunctionCount: 0,
239
+ });
240
+ return;
241
+ }
242
+ const parser = await go_1.GoParser.create();
243
+ try {
244
+ const tree = parser.parse(source);
245
+ const funcs = parser.findByType(tree.rootNode, "function_declaration");
246
+ const testFuncCount = funcs.filter((fn) => {
247
+ const nameNode = fn.childForFieldName("name");
248
+ return /^Test[A-Z0-9_]/.test(nameNode?.text ?? "");
249
+ }).length;
250
+ runtime.setArtifact(context_keys_1.CTX_TEST_GO_SUMMARY, {
251
+ functionCount: funcs.length,
252
+ testFunctionCount: testFuncCount,
253
+ });
254
+ tree.delete();
255
+ }
256
+ finally {
257
+ parser.dispose();
258
+ }
259
+ },
260
+ };
261
+ }
262
+ // ── Stage 8: check-go-test ──
263
+ stageCheckGoTest() {
264
+ return {
265
+ id: "check-go-test",
266
+ description: "Structured checks for go test file",
267
+ execute: async (runtime) => {
268
+ const testPath = runtime.getArtifact(context_keys_1.CTX_TEST_GO_PATH) ?? "";
269
+ const source = runtime.getArtifact(context_keys_1.CTX_TEST_GO_SOURCE) ?? "";
270
+ const summary = runtime.getArtifact(context_keys_1.CTX_TEST_GO_SUMMARY) ?? {
271
+ functionCount: 0,
272
+ testFunctionCount: 0,
273
+ };
274
+ const missing = !source.trim();
275
+ const message = missing
276
+ ? `Go test file is missing or empty: ${testPath}`
277
+ : `Go test check placeholder: ${summary.functionCount} function(s), ` +
278
+ `${summary.testFunctionCount} test function(s)`;
279
+ await runtime.runRules({
280
+ rules: [
281
+ new rules_1.StagePlaceholderRule({
282
+ name: "test-go-structured-check",
283
+ description: "Structured check for go test file",
284
+ message,
285
+ success: !missing,
286
+ }),
287
+ ],
288
+ strategy: "shared",
289
+ });
290
+ },
291
+ };
292
+ }
293
+ // ── Stage 9: check-go-test-hcl-style ──
294
+ stageCheckGoTestHclStyle() {
295
+ return {
296
+ id: "check-go-test-hcl-style",
297
+ description: "Run existing go test hcl style script when configured",
298
+ execute: async (runtime) => {
299
+ const status = "HCL style check script is not configured yet; placeholder stage passed";
300
+ runtime.setArtifact(context_keys_1.CTX_HCL_STAGE_STATUS, status);
301
+ await runtime.runRules({
302
+ rules: [
303
+ new rules_1.StagePlaceholderRule({
304
+ name: "test-hcl-style-check",
305
+ description: "Go test HCL style check",
306
+ message: status,
307
+ success: true,
308
+ }),
309
+ ],
310
+ strategy: "shared",
311
+ });
312
+ },
313
+ };
314
+ }
315
+ }
316
+ exports.ResourceCheckWorkflow = ResourceCheckWorkflow;
317
+ async function readFileIfExists(filePath) {
318
+ try {
319
+ return await promises_1.default.readFile(filePath, "utf-8");
320
+ }
321
+ catch {
322
+ return undefined;
323
+ }
324
+ }
325
+ //# sourceMappingURL=resource-check-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-check-workflow.js","sourceRoot":"","sources":["../../../../src/workflow/implement/resource-check/resource-check-workflow.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA6B;AAC7B,6CAA8D;AAG9D,qDAAwD;AACxD,+DAAuG;AAEvG,iEAAoE;AAEpE,uDAA6E;AAC7E,mCAGiB;AAEjB,6DAAkE;AAClE,iDAcwB;AACxB,mCAA+C;AAC/C,6DAAgE;AAChE,iEAAoE;AAOpE,MAAa,qBAAsB,SAAQ,mBAAQ;IAAnD;;QACoB,OAAE,GAAG,gBAAgB,CAAC;QACtB,gBAAW,GACvB,2EAA2E,CAAC;QAE/D,mBAAc,GAAG,IAAI,yBAAc,EAAE,CAAC;IAmV3D,CAAC;IAjVsB,KAAK,CAAC,WAAW,CAChC,IAAU,EACV,GAAa;QAEb,MAAM,GAAG,GAAG,GAAG,EAAE,GAAG,CAAe,mCAAoB,CAAC;eACjD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAe,mCAAoB,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,SAAS,EAAE,GAAG,CAAC,CAAC;IACvD,CAAC;IAES,YAAY;QAClB,OAAO;YACH,IAAI,CAAC,yBAAyB,EAAE;YAChC,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,wBAAwB,EAAE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
+ export { StagePlaceholderRule } from "./stage-placeholder-rule";
2
+ export type { StagePlaceholderOptions } from "./stage-placeholder-rule";
3
+ export { MARKDOWN_FORMAT_RULES, FrontmatterCheckRule, LineLengthRule, NumberFormatRule, BlankLineBetweenBlocksRule, H1ExistsRule, ExampleSectionExistsRule, ArgumentSectionFormatRule, AttributeSectionFormatRule, } from "./markdown-format";
4
+ export { MARKDOWN_SEMANTIC_RULES, SectionExistenceRule, ArgumentSectionSemanticRule, AttributeSectionSemanticRule, } from "./markdown-semantic";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/workflow/implement/resource-check/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EACH,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,0BAA0B,EAC1B,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,uBAAuB,EACvB,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,GAC/B,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttributeSectionSemanticRule = exports.ArgumentSectionSemanticRule = exports.SectionExistenceRule = exports.MARKDOWN_SEMANTIC_RULES = exports.AttributeSectionFormatRule = exports.ArgumentSectionFormatRule = exports.ExampleSectionExistsRule = exports.H1ExistsRule = exports.BlankLineBetweenBlocksRule = exports.NumberFormatRule = exports.LineLengthRule = exports.FrontmatterCheckRule = exports.MARKDOWN_FORMAT_RULES = exports.StagePlaceholderRule = void 0;
4
+ var stage_placeholder_rule_1 = require("./stage-placeholder-rule");
5
+ Object.defineProperty(exports, "StagePlaceholderRule", { enumerable: true, get: function () { return stage_placeholder_rule_1.StagePlaceholderRule; } });
6
+ var markdown_format_1 = require("./markdown-format");
7
+ Object.defineProperty(exports, "MARKDOWN_FORMAT_RULES", { enumerable: true, get: function () { return markdown_format_1.MARKDOWN_FORMAT_RULES; } });
8
+ Object.defineProperty(exports, "FrontmatterCheckRule", { enumerable: true, get: function () { return markdown_format_1.FrontmatterCheckRule; } });
9
+ Object.defineProperty(exports, "LineLengthRule", { enumerable: true, get: function () { return markdown_format_1.LineLengthRule; } });
10
+ Object.defineProperty(exports, "NumberFormatRule", { enumerable: true, get: function () { return markdown_format_1.NumberFormatRule; } });
11
+ Object.defineProperty(exports, "BlankLineBetweenBlocksRule", { enumerable: true, get: function () { return markdown_format_1.BlankLineBetweenBlocksRule; } });
12
+ Object.defineProperty(exports, "H1ExistsRule", { enumerable: true, get: function () { return markdown_format_1.H1ExistsRule; } });
13
+ Object.defineProperty(exports, "ExampleSectionExistsRule", { enumerable: true, get: function () { return markdown_format_1.ExampleSectionExistsRule; } });
14
+ Object.defineProperty(exports, "ArgumentSectionFormatRule", { enumerable: true, get: function () { return markdown_format_1.ArgumentSectionFormatRule; } });
15
+ Object.defineProperty(exports, "AttributeSectionFormatRule", { enumerable: true, get: function () { return markdown_format_1.AttributeSectionFormatRule; } });
16
+ var markdown_semantic_1 = require("./markdown-semantic");
17
+ Object.defineProperty(exports, "MARKDOWN_SEMANTIC_RULES", { enumerable: true, get: function () { return markdown_semantic_1.MARKDOWN_SEMANTIC_RULES; } });
18
+ Object.defineProperty(exports, "SectionExistenceRule", { enumerable: true, get: function () { return markdown_semantic_1.SectionExistenceRule; } });
19
+ Object.defineProperty(exports, "ArgumentSectionSemanticRule", { enumerable: true, get: function () { return markdown_semantic_1.ArgumentSectionSemanticRule; } });
20
+ Object.defineProperty(exports, "AttributeSectionSemanticRule", { enumerable: true, get: function () { return markdown_semantic_1.AttributeSectionSemanticRule; } });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/workflow/implement/resource-check/rules/index.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAG7B,qDAU2B;AATvB,wHAAA,qBAAqB,OAAA;AACrB,uHAAA,oBAAoB,OAAA;AACpB,iHAAA,cAAc,OAAA;AACd,mHAAA,gBAAgB,OAAA;AAChB,6HAAA,0BAA0B,OAAA;AAC1B,+GAAA,YAAY,OAAA;AACZ,2HAAA,wBAAwB,OAAA;AACxB,4HAAA,yBAAyB,OAAA;AACzB,6HAAA,0BAA0B,OAAA;AAG9B,yDAK6B;AAJzB,4HAAA,uBAAuB,OAAA;AACvB,yHAAA,oBAAoB,OAAA;AACpB,gIAAA,2BAA2B,OAAA;AAC3B,iIAAA,4BAA4B,OAAA"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../../types/rule/rule";
2
+ import type { Context } from "../../../../../context/context";
3
+ export declare class ArgumentSectionFormatRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=argument-section-format-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argument-section-format-rule.d.ts","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAiB9D,qBAAa,yBAA0B,SAAQ,IAAI;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;;IAMlC,IAAI,CACb,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CA8BhC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArgumentSectionFormatRule = void 0;
4
+ const markdown_1 = require("../../../../../../tools/ast-parser/markdown");
5
+ const section_check_1 = require("../../../../../../tools/section-check");
6
+ const rule_1 = require("../../../../../types/rule/rule");
7
+ const builder_1 = require("../../../tools/doc-semantic/builder");
8
+ const section_check_result_1 = require("../shared/section-check-result");
9
+ const META = {
10
+ name: "md-argument-section-format",
11
+ description: "Validate Argument Reference section list structure and bullet style",
12
+ messages: {
13
+ missingList: "Argument Reference section exists but does not contain a bullet list.",
14
+ invalidItem: (line, reason) => `Invalid argument bullet format at line ${String(line)}: ${String(reason)}`,
15
+ summary: (count) => `${String(count)} argument bullet format issue(s) found`,
16
+ },
17
+ };
18
+ class ArgumentSectionFormatRule extends rule_1.Rule {
19
+ constructor() {
20
+ super(META, "markdown");
21
+ this.parser = new markdown_1.MarkdownParser();
22
+ }
23
+ async test(code, ast, _parentCtx) {
24
+ if (!ast) {
25
+ return [rule_1.RuleCheckResult.pass("AST unavailable, rule skipped")];
26
+ }
27
+ const doc = ast;
28
+ const section = this.parser.getSection(doc, 2, "Argument Reference");
29
+ if (!section) {
30
+ return [rule_1.RuleCheckResult.pass("Argument Reference section not found, skipped")];
31
+ }
32
+ const failures = await (0, section_check_1.sectionCheck)("Argument Reference", 2)
33
+ .requireBulletList({
34
+ includeNestedLists: true,
35
+ message: this.msg("missingList"),
36
+ })
37
+ .eachBulletItem((line) => line.matches(builder_1.ARG_BULLET_PATTERN), {
38
+ includeNestedLists: false,
39
+ })
40
+ .run(doc, code);
41
+ if (failures.length === 1 && failures[0].message === this.msg("missingList")) {
42
+ return [this.fail("missingList", "", undefined, rule_1.RuleCheckResult.fromLine(1))];
43
+ }
44
+ return (0, section_check_result_1.toSectionRuleResults)(failures, {
45
+ passMessage: "Argument Reference section format is valid",
46
+ summaryMessage: (count) => this.msg("summary", count),
47
+ });
48
+ }
49
+ }
50
+ exports.ArgumentSectionFormatRule = ArgumentSectionFormatRule;
51
+ //# sourceMappingURL=argument-section-format-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argument-section-format-rule.js","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.ts"],"names":[],"mappings":";;;AACA,0EAA6E;AAC7E,yEAAqE;AACrE,yDAAsF;AAEtF,iEAAyE;AACzE,yEAAsE;AAEtE,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,qEAAqE;IAClF,QAAQ,EAAE;QACN,WAAW,EACP,uEAAuE;QAC3E,WAAW,EAAE,CAAC,IAAa,EAAE,MAAe,EAAE,EAAE,CAC5C,0CAA0C,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,EAAE;QAC/E,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE,CACxB,GAAG,MAAM,CAAC,KAAK,CAAC,wCAAwC;KAC/D;CACJ,CAAC;AAEF,MAAa,yBAA0B,SAAQ,WAAI;IAG/C;QACI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAHX,WAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;IAI/C,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,IAAY,EACZ,GAAa,EACb,UAAoB;QAEpB,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,CAAC,sBAAe,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;QACnE,CAAC;QAED,MAAM,GAAG,GAAG,GAAmB,CAAC;QAChC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,oBAAoB,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,CAAC,sBAAe,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC,CAAC;QACnF,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAY,EAAC,oBAAoB,EAAE,CAAC,CAAC;aACvD,iBAAiB,CAAC;YACf,kBAAkB,EAAE,IAAI;YACxB,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC;SACnC,CAAC;aACD,cAAc,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,4BAAkB,CAAC,EAAE;YACxD,kBAAkB,EAAE,KAAK;SAC5B,CAAC;aACD,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;YAC3E,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,SAAS,EAAE,sBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,CAAC;QAED,OAAO,IAAA,2CAAoB,EAAC,QAAQ,EAAE;YAClC,WAAW,EAAE,4CAA4C;YACzD,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC;SACxD,CAAC,CAAC;IACP,CAAC;CACJ;AAzCD,8DAyCC"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../../types/rule/rule";
2
+ import type { Context } from "../../../../../context/context";
3
+ export declare class AttributeSectionFormatRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=attribute-section-format-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribute-section-format-rule.d.ts","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAmB9D,qBAAa,0BAA2B,SAAQ,IAAI;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;;IAMlC,IAAI,CACb,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CA8BhC"}