@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,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttributeSectionFormatRule = 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 ATTRIBUTE_SECTION_TITLES = ["Attributes Reference", "Attribute Reference"];
10
+ const META = {
11
+ name: "md-attribute-section-format",
12
+ description: "Validate Attribute Reference section list structure and bullet style",
13
+ messages: {
14
+ missingList: "Attribute Reference section exists but does not contain a bullet list.",
15
+ invalidItem: (line, reason) => `Invalid attribute bullet format at line ${String(line)}: ${String(reason)}`,
16
+ summary: (count) => `${String(count)} attribute bullet format issue(s) found`,
17
+ },
18
+ };
19
+ class AttributeSectionFormatRule extends rule_1.Rule {
20
+ constructor() {
21
+ super(META, "markdown");
22
+ this.parser = new markdown_1.MarkdownParser();
23
+ }
24
+ async test(code, ast, _parentCtx) {
25
+ if (!ast) {
26
+ return [rule_1.RuleCheckResult.pass("AST unavailable, rule skipped")];
27
+ }
28
+ const doc = ast;
29
+ const sectionInfo = getSectionByTitles(this.parser, doc, ATTRIBUTE_SECTION_TITLES);
30
+ if (!sectionInfo) {
31
+ return [rule_1.RuleCheckResult.pass("Attribute Reference section not found, skipped")];
32
+ }
33
+ const failures = await (0, section_check_1.sectionCheck)(sectionInfo.title, 2)
34
+ .requireBulletList({
35
+ includeNestedLists: true,
36
+ message: this.msg("missingList"),
37
+ })
38
+ .eachBulletItem((line) => line.matches(builder_1.ATTR_BULLET_PATTERN), {
39
+ includeNestedLists: false,
40
+ })
41
+ .run(doc, code);
42
+ if (failures.length === 1 && failures[0].message === this.msg("missingList")) {
43
+ return [this.fail("missingList", "", undefined, rule_1.RuleCheckResult.fromLine(1))];
44
+ }
45
+ return (0, section_check_result_1.toSectionRuleResults)(failures, {
46
+ passMessage: "Attribute Reference section format is valid",
47
+ summaryMessage: (count) => this.msg("summary", count),
48
+ });
49
+ }
50
+ }
51
+ exports.AttributeSectionFormatRule = AttributeSectionFormatRule;
52
+ function getSectionByTitles(parser, doc, titles) {
53
+ for (const title of titles) {
54
+ const section = parser.getSection(doc, 2, title);
55
+ if (section)
56
+ return { title, nodes: section };
57
+ }
58
+ return null;
59
+ }
60
+ //# sourceMappingURL=attribute-section-format-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribute-section-format-rule.js","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.ts"],"names":[],"mappings":";;;AACA,0EAA6E;AAC7E,yEAAqE;AACrE,yDAAsF;AAEtF,iEAA0E;AAC1E,yEAAsE;AAEtE,MAAM,wBAAwB,GAAG,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;AAEjF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE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;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,6CAA6C;YAC1D,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC;SACxD,CAAC,CAAC;IACP,CAAC;CACJ;AAzCD,gEAyCC;AAED,SAAS,kBAAkB,CACvB,MAAsB,EACtB,GAAiB,EACjB,MAAgB;IAEhB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACjD,IAAI,OAAO;YAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
2
+ import type { Context } from "../../../../context/context";
3
+ export declare class BlankLineBetweenBlocksRule extends Rule {
4
+ constructor();
5
+ test(code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
6
+ private shouldCheckBoundary;
7
+ private hasBlankLineBetween;
8
+ }
9
+ //# sourceMappingURL=blank-line-between-blocks-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blank-line-between-blocks-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAuB3D,qBAAa,0BAA2B,SAAQ,IAAI;;IAKnC,IAAI,CACb,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;IAkD7B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,mBAAmB;CAY9B"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BlankLineBetweenBlocksRule = void 0;
4
+ const rule_1 = require("../../../../types/rule/rule");
5
+ const META = {
6
+ name: "md-blank-line-between-blocks",
7
+ description: "Top-level markdown blocks should be separated by a blank line",
8
+ messages: {
9
+ missing: (prevType, currType, line) => `Missing blank line between ${String(prevType)} and ${String(currType)} blocks ` +
10
+ `before line ${String(line)}.`,
11
+ summary: (count) => `${String(count)} block boundary issue(s) found`,
12
+ },
13
+ };
14
+ const BLOCK_TYPES_REQUIRING_SEPARATOR = new Set([
15
+ "heading",
16
+ "paragraph",
17
+ "list",
18
+ "code_block",
19
+ "block_quote",
20
+ "html_block",
21
+ ]);
22
+ class BlankLineBetweenBlocksRule extends rule_1.Rule {
23
+ constructor() {
24
+ super(META, "markdown");
25
+ }
26
+ async test(code, ast, _parentCtx) {
27
+ if (!ast) {
28
+ return [rule_1.RuleCheckResult.pass("AST unavailable, rule skipped")];
29
+ }
30
+ const doc = ast;
31
+ const blocks = doc.children.filter((n) => n.type !== "frontmatter");
32
+ const lines = code.split(/\r?\n/);
33
+ const violations = [];
34
+ for (let i = 1; i < blocks.length; i++) {
35
+ const prev = blocks[i - 1];
36
+ const curr = blocks[i];
37
+ if (!this.shouldCheckBoundary(prev, curr))
38
+ continue;
39
+ const prevEnd = prev.sourceRange?.end.line;
40
+ const currStart = curr.sourceRange?.start.line;
41
+ if (!prevEnd || !currStart || currStart <= prevEnd)
42
+ continue;
43
+ if (!this.hasBlankLineBetween(lines, prevEnd, currStart)) {
44
+ const line = currStart;
45
+ violations.push(this.fail("missing", lines[line - 1] ?? "", lines[line - 1] ?? "", rule_1.RuleCheckResult.fromLine(line), prev.type, curr.type, line));
46
+ }
47
+ }
48
+ if (violations.length === 0) {
49
+ return [rule_1.RuleCheckResult.pass("All top-level block boundaries have blank lines")];
50
+ }
51
+ return [
52
+ new rule_1.RuleCheckResult(false, this.msg("summary", violations.length), "", "", violations),
53
+ ];
54
+ }
55
+ shouldCheckBoundary(prev, curr) {
56
+ if (!BLOCK_TYPES_REQUIRING_SEPARATOR.has(prev.type))
57
+ return false;
58
+ if (!BLOCK_TYPES_REQUIRING_SEPARATOR.has(curr.type))
59
+ return false;
60
+ // Allow adjacent headings for intentionally empty sections.
61
+ if (prev.type === "heading" && curr.type === "heading") {
62
+ return false;
63
+ }
64
+ return true;
65
+ }
66
+ hasBlankLineBetween(lines, prevEndLine, currStartLine) {
67
+ const start = prevEndLine + 1;
68
+ const end = currStartLine - 1;
69
+ if (start > end)
70
+ return false;
71
+ for (let line = start; line <= end; line++) {
72
+ if ((lines[line - 1] ?? "").trim() === "") {
73
+ return true;
74
+ }
75
+ }
76
+ return false;
77
+ }
78
+ }
79
+ exports.BlankLineBetweenBlocksRule = BlankLineBetweenBlocksRule;
80
+ //# sourceMappingURL=blank-line-between-blocks-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blank-line-between-blocks-rule.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.ts"],"names":[],"mappings":";;;AACA,sDAAmF;AAGnF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,+DAA+D;IAC5E,QAAQ,EAAE;QACN,OAAO,EAAE,CAAC,QAAiB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AC5D,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,mBAAmB,CAAC,KAAe,EAAE,WAAmB,EAAE,aAAqB;QACnF,MAAM,KAAK,GAAG,WAAW,GAAG,CAAC,CAAC;QAC9B,MAAM,GAAG,GAAG,aAAa,GAAG,CAAC,CAAC;QAC9B,IAAI,KAAK,GAAG,GAAG;YAAE,OAAO,KAAK,CAAC;QAE9B,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBACxC,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAnFD,gEAmFC"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../../types/rule/rule";
2
+ import type { Context } from "../../../../../context/context";
3
+ export declare class ExampleSectionExistsRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=example-section-exists-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-section-exists-rule.d.ts","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAW9D,qBAAa,wBAAyB,SAAQ,IAAI;IAC9C,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;CA0BhC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExampleSectionExistsRule = 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 META = {
8
+ name: "md-example-section-exists",
9
+ description: "Document must contain an 'Example Usage' section",
10
+ messages: {
11
+ missing: "Document must contain an 'Example Usage' section (## Example Usage)",
12
+ },
13
+ };
14
+ class ExampleSectionExistsRule extends rule_1.Rule {
15
+ constructor() {
16
+ super(META, "markdown");
17
+ this.parser = new markdown_1.MarkdownParser();
18
+ }
19
+ async test(code, ast, _parentCtx) {
20
+ if (!ast) {
21
+ return [this.fail("missing", "")];
22
+ }
23
+ const doc = ast;
24
+ const failures = await (0, section_check_1.bodyCheck)()
25
+ .validate(({ nodes, startLine }) => {
26
+ const hasExampleSection = nodes.some((node) => node.type === "heading" &&
27
+ (node.level ?? 0) === 2 &&
28
+ this.parser.getTextContent(node).trim() === "Example Usage");
29
+ if (hasExampleSection)
30
+ return [];
31
+ return [{ message: this.msg("missing"), line: startLine }];
32
+ })
33
+ .run(doc, code);
34
+ if (failures.length === 0) {
35
+ return [rule_1.RuleCheckResult.pass("Example Usage section exists")];
36
+ }
37
+ const line = failures[0].line ?? 1;
38
+ return [this.fail("missing", "", undefined, rule_1.RuleCheckResult.fromLine(line))];
39
+ }
40
+ }
41
+ exports.ExampleSectionExistsRule = ExampleSectionExistsRule;
42
+ //# sourceMappingURL=example-section-exists-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-section-exists-rule.js","sourceRoot":"","sources":["../../../../../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EpB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,sBAAe,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAClE,CAAC;QAED,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,sBAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;CACJ;AArCD,4DAqCC"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
2
+ import type { Context } from "../../../../context/context";
3
+ export declare class ExampleSectionExistsRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(_code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=example-section-exists-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-section-exists-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAW3D,qBAAa,wBAAyB,SAAQ,IAAI;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;;IAMlC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CAoBhC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExampleSectionExistsRule = void 0;
4
+ const markdown_1 = require("../../../../../tools/ast-parser/markdown");
5
+ const rule_1 = require("../../../../types/rule/rule");
6
+ const META = {
7
+ name: "md-example-section-exists",
8
+ description: "Document must contain an 'Example Usage' section",
9
+ messages: {
10
+ missing: "Document must contain an 'Example Usage' section (## Example Usage)",
11
+ },
12
+ };
13
+ class ExampleSectionExistsRule extends rule_1.Rule {
14
+ constructor() {
15
+ super(META, "markdown");
16
+ this.parser = new markdown_1.MarkdownParser();
17
+ }
18
+ async test(_code, ast, _parentCtx) {
19
+ if (!ast) {
20
+ return [this.fail("missing", "")];
21
+ }
22
+ const doc = ast;
23
+ const section = this.parser.getSection(doc, 2, "Example Usage");
24
+ if (section && section.length > 0) {
25
+ const firstNode = section[0];
26
+ return [
27
+ rule_1.RuleCheckResult.pass("Example Usage section exists", firstNode.sourceRange ?? undefined),
28
+ ];
29
+ }
30
+ return [this.fail("missing", "", undefined, rule_1.RuleCheckResult.fromLine(1))];
31
+ }
32
+ }
33
+ exports.ExampleSectionExistsRule = ExampleSectionExistsRule;
34
+ //# sourceMappingURL=example-section-exists-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-section-exists-rule.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.ts"],"names":[],"mappings":";;;AACA,uEAA0E;AAC1E,sDAAmF;AAGnF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE;QACN,OAAO,EACH,qEAAqE;KAC5E;CACJ,CAAC;AAEF,MAAa,wBAAyB,SAAQ,WAAI;IAG9C;QACI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAHX,WAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;IAI/C,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,KAAa,EACb,GAAa,EACb,UAAoB;QAEpB,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,GAAG,GAAG,GAAmB,CAAC;QAChC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC;QAEhE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC7B,OAAO;gBACH,sBAAe,CAAC,IAAI,CAChB,8BAA8B,EAC9B,SAAS,CAAC,WAAW,IAAI,SAAS,CACrC;aACJ,CAAC;QACN,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,sBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;CACJ;AA/BD,4DA+BC"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../../types/rule/rule";
2
+ import type { Context } from "../../../../../context/context";
3
+ export declare class FrontmatterCheckRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(_code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=frontmatter-check-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter-check-rule.d.ts","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAW9D,qBAAa,oBAAqB,SAAQ,IAAI;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;;IAMlC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CAmBhC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FrontmatterCheckRule = void 0;
4
+ const markdown_1 = require("../../../../../../tools/ast-parser/markdown");
5
+ const rule_1 = require("../../../../../types/rule/rule");
6
+ const META = {
7
+ name: "md-frontmatter-check",
8
+ description: "Front matter block must exist at the start of the document",
9
+ messages: {
10
+ missing: "Missing front matter block at the start of the document",
11
+ },
12
+ };
13
+ class FrontmatterCheckRule extends rule_1.Rule {
14
+ constructor() {
15
+ super(META, "markdown");
16
+ this.parser = new markdown_1.MarkdownParser();
17
+ }
18
+ async test(_code, ast, _parentCtx) {
19
+ if (!ast) {
20
+ return [this.fail("missing", "")];
21
+ }
22
+ const doc = ast;
23
+ const fm = this.parser.findFirst(doc, (n) => n.type === "frontmatter");
24
+ if (fm) {
25
+ return [
26
+ rule_1.RuleCheckResult.pass("Front matter block exists", fm.sourceRange ?? undefined),
27
+ ];
28
+ }
29
+ return [this.fail("missing", "", undefined, rule_1.RuleCheckResult.fromLine(1))];
30
+ }
31
+ }
32
+ exports.FrontmatterCheckRule = FrontmatterCheckRule;
33
+ //# sourceMappingURL=frontmatter-check-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter-check-rule.js","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.ts"],"names":[],"mappings":";;;AACA,0EAA6E;AAC7E,yDAAsF;AAGtF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACP,4DAA4D;IAChE,QAAQ,EAAE;QACN,OAAO,EAAE,yDAAyD;KACrE;CACJ,CAAC;AAEF,MAAa,oBAAqB,SAAQ,WAAI;IAG1C;QACI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAHX,WAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;IAI/C,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,KAAa,EACb,GAAa,EACb,UAAoB;QAEpB,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,GAAG,GAAG,GAAmB,CAAC;QAChC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QAEvE,IAAI,EAAE,EAAE,CAAC;YACL,OAAO;gBACH,sBAAe,CAAC,IAAI,CAChB,2BAA2B,EAC3B,EAAE,CAAC,WAAW,IAAI,SAAS,CAC9B;aACJ,CAAC;QACN,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,sBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;CACJ;AA9BD,oDA8BC"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
2
+ import type { Context } from "../../../../context/context";
3
+ export declare class FrontmatterCheckRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(_code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=frontmatter-check-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter-check-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAW3D,qBAAa,oBAAqB,SAAQ,IAAI;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;;IAMlC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CAmBhC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FrontmatterCheckRule = void 0;
4
+ const markdown_1 = require("../../../../../tools/ast-parser/markdown");
5
+ const rule_1 = require("../../../../types/rule/rule");
6
+ const META = {
7
+ name: "md-frontmatter-check",
8
+ description: "Front matter block must exist at the start of the document",
9
+ messages: {
10
+ missing: "Missing front matter block at the start of the document",
11
+ },
12
+ };
13
+ class FrontmatterCheckRule extends rule_1.Rule {
14
+ constructor() {
15
+ super(META, "markdown");
16
+ this.parser = new markdown_1.MarkdownParser();
17
+ }
18
+ async test(_code, ast, _parentCtx) {
19
+ if (!ast) {
20
+ return [this.fail("missing", "")];
21
+ }
22
+ const doc = ast;
23
+ const fm = this.parser.findFirst(doc, (n) => n.type === "frontmatter");
24
+ if (fm) {
25
+ return [
26
+ rule_1.RuleCheckResult.pass("Front matter block exists", fm.sourceRange ?? undefined),
27
+ ];
28
+ }
29
+ return [this.fail("missing", "", undefined, rule_1.RuleCheckResult.fromLine(1))];
30
+ }
31
+ }
32
+ exports.FrontmatterCheckRule = FrontmatterCheckRule;
33
+ //# sourceMappingURL=frontmatter-check-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter-check-rule.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.ts"],"names":[],"mappings":";;;AACA,uEAA0E;AAC1E,sDAAmF;AAGnF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACP,4DAA4D;IAChE,QAAQ,EAAE;QACN,OAAO,EAAE,yDAAyD;KACrE;CACJ,CAAC;AAEF,MAAa,oBAAqB,SAAQ,WAAI;IAG1C;QACI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAHX,WAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;IAI/C,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,KAAa,EACb,GAAa,EACb,UAAoB;QAEpB,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,GAAG,GAAG,GAAmB,CAAC;QAChC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QAEvE,IAAI,EAAE,EAAE,CAAC;YACL,OAAO;gBACH,sBAAe,CAAC,IAAI,CAChB,2BAA2B,EAC3B,EAAE,CAAC,WAAW,IAAI,SAAS,CAC9B;aACJ,CAAC;QACN,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,sBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;CACJ;AA9BD,oDA8BC"}
@@ -0,0 +1,8 @@
1
+ import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
2
+ import type { Context } from "../../../../context/context";
3
+ export declare class H1ExistsRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(_code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ }
8
+ //# sourceMappingURL=h1-exists-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"h1-exists-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAU3D,qBAAa,YAAa,SAAQ,IAAI;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;;IAMlC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,eAAe,EAAE,CAAC;CAoBhC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.H1ExistsRule = void 0;
4
+ const markdown_1 = require("../../../../../tools/ast-parser/markdown");
5
+ const rule_1 = require("../../../../types/rule/rule");
6
+ const META = {
7
+ name: "md-h1-exists",
8
+ description: "Document must contain at least one level-1 heading",
9
+ messages: {
10
+ missing: "Document must contain a level-1 heading (# Title)",
11
+ },
12
+ };
13
+ class H1ExistsRule extends rule_1.Rule {
14
+ constructor() {
15
+ super(META, "markdown");
16
+ this.parser = new markdown_1.MarkdownParser();
17
+ }
18
+ async test(_code, ast, _parentCtx) {
19
+ if (!ast) {
20
+ return [this.fail("missing", "")];
21
+ }
22
+ const doc = ast;
23
+ const headings = this.parser.getHeadings(doc);
24
+ const h1 = headings.find((h) => h.level === 1);
25
+ if (h1) {
26
+ return [
27
+ rule_1.RuleCheckResult.pass("Level-1 heading exists", h1.node.sourceRange ?? undefined),
28
+ ];
29
+ }
30
+ return [this.fail("missing", "", undefined, rule_1.RuleCheckResult.fromLine(1))];
31
+ }
32
+ }
33
+ exports.H1ExistsRule = H1ExistsRule;
34
+ //# sourceMappingURL=h1-exists-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"h1-exists-rule.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.ts"],"names":[],"mappings":";;;AACA,uEAA0E;AAC1E,sDAAmF;AAGnF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE;QACN,OAAO,EAAE,mDAAmD;KAC/D;CACJ,CAAC;AAEF,MAAa,YAAa,SAAQ,WAAI;IAGlC;QACI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAHX,WAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;IAI/C,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,KAAa,EACb,GAAa,EACb,UAAoB;QAEpB,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,GAAG,GAAG,GAAmB,CAAC;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;QAE/C,IAAI,EAAE,EAAE,CAAC;YACL,OAAO;gBACH,sBAAe,CAAC,IAAI,CAChB,wBAAwB,EACxB,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,SAAS,CACnC;aACJ,CAAC;QACN,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,sBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;CACJ;AA/BD,oCA+BC"}
@@ -0,0 +1,11 @@
1
+ import type { Rule } from "../../../../types/rule/rule";
2
+ export { FrontmatterCheckRule } from "./frontmatter/frontmatter-check-rule";
3
+ export { LineLengthRule } from "./total/line-length-rule";
4
+ export { NumberFormatRule } from "./total/number-format-rule";
5
+ export { H1ExistsRule } from "./title/h1-exists-rule";
6
+ export { ExampleSectionExistsRule } from "./example/example-section-exists-rule";
7
+ export { BlankLineBetweenBlocksRule } from "./total/blank-line-between-blocks-rule";
8
+ export { ArgumentSectionFormatRule } from "./arguments/argument-section-format-rule";
9
+ export { AttributeSectionFormatRule } from "./attributes/attribute-section-format-rule";
10
+ export declare const MARKDOWN_FORMAT_RULES: Rule[];
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAUxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAExF,eAAO,MAAM,qBAAqB,EAAE,IAAI,EASvC,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MARKDOWN_FORMAT_RULES = exports.AttributeSectionFormatRule = exports.ArgumentSectionFormatRule = exports.BlankLineBetweenBlocksRule = exports.ExampleSectionExistsRule = exports.H1ExistsRule = exports.NumberFormatRule = exports.LineLengthRule = exports.FrontmatterCheckRule = void 0;
4
+ const frontmatter_check_rule_1 = require("./frontmatter/frontmatter-check-rule");
5
+ const line_length_rule_1 = require("./total/line-length-rule");
6
+ const number_format_rule_1 = require("./total/number-format-rule");
7
+ const h1_exists_rule_1 = require("./title/h1-exists-rule");
8
+ const example_section_exists_rule_1 = require("./example/example-section-exists-rule");
9
+ const blank_line_between_blocks_rule_1 = require("./total/blank-line-between-blocks-rule");
10
+ const argument_section_format_rule_1 = require("./arguments/argument-section-format-rule");
11
+ const attribute_section_format_rule_1 = require("./attributes/attribute-section-format-rule");
12
+ var frontmatter_check_rule_2 = require("./frontmatter/frontmatter-check-rule");
13
+ Object.defineProperty(exports, "FrontmatterCheckRule", { enumerable: true, get: function () { return frontmatter_check_rule_2.FrontmatterCheckRule; } });
14
+ var line_length_rule_2 = require("./total/line-length-rule");
15
+ Object.defineProperty(exports, "LineLengthRule", { enumerable: true, get: function () { return line_length_rule_2.LineLengthRule; } });
16
+ var number_format_rule_2 = require("./total/number-format-rule");
17
+ Object.defineProperty(exports, "NumberFormatRule", { enumerable: true, get: function () { return number_format_rule_2.NumberFormatRule; } });
18
+ var h1_exists_rule_2 = require("./title/h1-exists-rule");
19
+ Object.defineProperty(exports, "H1ExistsRule", { enumerable: true, get: function () { return h1_exists_rule_2.H1ExistsRule; } });
20
+ var example_section_exists_rule_2 = require("./example/example-section-exists-rule");
21
+ Object.defineProperty(exports, "ExampleSectionExistsRule", { enumerable: true, get: function () { return example_section_exists_rule_2.ExampleSectionExistsRule; } });
22
+ var blank_line_between_blocks_rule_2 = require("./total/blank-line-between-blocks-rule");
23
+ Object.defineProperty(exports, "BlankLineBetweenBlocksRule", { enumerable: true, get: function () { return blank_line_between_blocks_rule_2.BlankLineBetweenBlocksRule; } });
24
+ var argument_section_format_rule_2 = require("./arguments/argument-section-format-rule");
25
+ Object.defineProperty(exports, "ArgumentSectionFormatRule", { enumerable: true, get: function () { return argument_section_format_rule_2.ArgumentSectionFormatRule; } });
26
+ var attribute_section_format_rule_2 = require("./attributes/attribute-section-format-rule");
27
+ Object.defineProperty(exports, "AttributeSectionFormatRule", { enumerable: true, get: function () { return attribute_section_format_rule_2.AttributeSectionFormatRule; } });
28
+ exports.MARKDOWN_FORMAT_RULES = [
29
+ new frontmatter_check_rule_1.FrontmatterCheckRule(),
30
+ new line_length_rule_1.LineLengthRule(),
31
+ new number_format_rule_1.NumberFormatRule(),
32
+ new blank_line_between_blocks_rule_1.BlankLineBetweenBlocksRule(),
33
+ new h1_exists_rule_1.H1ExistsRule(),
34
+ new example_section_exists_rule_1.ExampleSectionExistsRule(),
35
+ new argument_section_format_rule_1.ArgumentSectionFormatRule(),
36
+ new attribute_section_format_rule_1.AttributeSectionFormatRule(),
37
+ ];
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/index.ts"],"names":[],"mappings":";;;AACA,iFAA4E;AAC5E,+DAA0D;AAC1D,mEAA8D;AAC9D,2DAAsD;AACtD,uFAAiF;AACjF,2FAAoF;AACpF,2FAAqF;AACrF,8FAAwF;AAExF,+EAA4E;AAAnE,8HAAA,oBAAoB,OAAA;AAC7B,6DAA0D;AAAjD,kHAAA,cAAc,OAAA;AACvB,iEAA8D;AAArD,sHAAA,gBAAgB,OAAA;AACzB,yDAAsD;AAA7C,8GAAA,YAAY,OAAA;AACrB,qFAAiF;AAAxE,uIAAA,wBAAwB,OAAA;AACjC,yFAAoF;AAA3E,4IAAA,0BAA0B,OAAA;AACnC,yFAAqF;AAA5E,yIAAA,yBAAyB,OAAA;AAClC,4FAAwF;AAA/E,2IAAA,0BAA0B,OAAA;AAEtB,QAAA,qBAAqB,GAAW;IACzC,IAAI,6CAAoB,EAAE;IAC1B,IAAI,iCAAc,EAAE;IACpB,IAAI,qCAAgB,EAAE;IACtB,IAAI,2DAA0B,EAAE;IAChC,IAAI,6BAAY,EAAE;IAClB,IAAI,sDAAwB,EAAE;IAC9B,IAAI,wDAAyB,EAAE;IAC/B,IAAI,0DAA0B,EAAE;CACnC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
2
+ import type { Context } from "../../../../context/context";
3
+ export declare class LineLengthRule extends Rule {
4
+ private readonly parser;
5
+ constructor();
6
+ test(code: string, ast?: unknown, _parentCtx?: Context): Promise<RuleCheckResult[]>;
7
+ private buildSkipRanges;
8
+ private isInSkipRange;
9
+ /**
10
+ * Skip lines that cannot reasonably be wrapped:
11
+ * HTML anchor tags, pure URLs, markdown link definitions.
12
+ */
13
+ private shouldSkipLine;
14
+ }
15
+ //# sourceMappingURL=line-length-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-length-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/line-length-rule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAqB3D,qBAAa,cAAe,SAAQ,IAAI;IACpC,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;IAwC7B,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,aAAa;IAIrB;;;OAGG;IACH,OAAO,CAAC,cAAc;CAOzB"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LineLengthRule = void 0;
4
+ const markdown_1 = require("../../../../../tools/ast-parser/markdown");
5
+ const rule_1 = require("../../../../types/rule/rule");
6
+ const MAX_LINE_LENGTH = 120;
7
+ const META = {
8
+ name: "md-line-length",
9
+ description: `Lines must not exceed ${MAX_LINE_LENGTH} columns; use soft line breaks to wrap`,
10
+ messages: {
11
+ tooLong: (line, length) => `Line ${line} exceeds ${MAX_LINE_LENGTH} columns (actual: ${length}). ` +
12
+ `Use a soft line break to wrap.`,
13
+ summary: (count) => `${count} line(s) exceed ${MAX_LINE_LENGTH} columns`,
14
+ },
15
+ };
16
+ class LineLengthRule extends rule_1.Rule {
17
+ constructor() {
18
+ super(META, "markdown");
19
+ this.parser = new markdown_1.MarkdownParser();
20
+ }
21
+ async test(code, ast, _parentCtx) {
22
+ const lines = code.split(/\r?\n/);
23
+ const skipRanges = ast ? this.buildSkipRanges(ast) : [];
24
+ const violations = [];
25
+ for (let i = 0; i < lines.length; i++) {
26
+ const lineNum = i + 1;
27
+ const line = lines[i];
28
+ if (line.length <= MAX_LINE_LENGTH)
29
+ continue;
30
+ if (this.isInSkipRange(lineNum, skipRanges))
31
+ continue;
32
+ if (this.shouldSkipLine(line))
33
+ continue;
34
+ violations.push(new rule_1.RuleCheckResult(false, this.msg("tooLong", lineNum, line.length), line, line, [], rule_1.RuleCheckResult.fromLine(lineNum)));
35
+ }
36
+ if (violations.length === 0) {
37
+ return [rule_1.RuleCheckResult.pass("All lines are within length limit")];
38
+ }
39
+ return [
40
+ new rule_1.RuleCheckResult(false, this.msg("summary", violations.length), "", "", violations),
41
+ ];
42
+ }
43
+ buildSkipRanges(doc) {
44
+ const ranges = [];
45
+ const codeBlocks = this.parser.getCodeBlocks(doc);
46
+ for (const cb of codeBlocks) {
47
+ const sr = cb.node.sourceRange;
48
+ if (sr) {
49
+ ranges.push({ start: sr.start.line, end: sr.end.line });
50
+ }
51
+ }
52
+ const fm = this.parser.findFirst(doc, (n) => n.type === "frontmatter");
53
+ if (fm?.sourceRange) {
54
+ ranges.push({ start: fm.sourceRange.start.line, end: fm.sourceRange.end.line });
55
+ }
56
+ return ranges;
57
+ }
58
+ isInSkipRange(line, ranges) {
59
+ return ranges.some((r) => line >= r.start && line <= r.end);
60
+ }
61
+ /**
62
+ * Skip lines that cannot reasonably be wrapped:
63
+ * HTML anchor tags, pure URLs, markdown link definitions.
64
+ */
65
+ shouldSkipLine(line) {
66
+ const trimmed = line.trim();
67
+ if (trimmed.startsWith("<a ") && trimmed.endsWith(">"))
68
+ return true;
69
+ if (/^\[.+\]:\s*https?:\/\//.test(trimmed))
70
+ return true;
71
+ if (/^https?:\/\/\S+$/.test(trimmed))
72
+ return true;
73
+ return false;
74
+ }
75
+ }
76
+ exports.LineLengthRule = LineLengthRule;
77
+ //# sourceMappingURL=line-length-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-length-rule.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-format/line-length-rule.ts"],"names":[],"mappings":";;;AACA,uEAA0E;AAC1E,sDAAmF;AAGnF,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,yBAAyB,eAAe,wCAAwC;IAC7F,QAAQ,EAAE;QACN,OAAO,EAAE,CAAC,IAAa,EAAE,MAAe,EAAE,EAAE,CACxC,QAAQ,IAAI,YAAY,eAAe,qBAAqB,MAAM,KAAK;YACvE,gCAAgC;QACpC,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE,CACxB,GAAG,KAAK,mBAAmB,eAAe,UAAU;KAC3D;CACJ,CAAC;AAOF,MAAa,cAAe,SAAQ,WAAI;IAGpC;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,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxE,MAAM,UAAU,GAAsB,EAAE,CAAC;QAEzC,KAAK,IAAI,CA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