@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.
- package/dist/facade/code-checker.d.ts +14 -0
- package/dist/facade/code-checker.d.ts.map +1 -0
- package/dist/facade/code-checker.js +63 -0
- package/dist/facade/code-checker.js.map +1 -0
- package/dist/facade/index.d.ts +3 -0
- package/dist/facade/index.d.ts.map +1 -0
- package/dist/facade/index.js +6 -0
- package/dist/facade/index.js.map +1 -0
- package/dist/facade/types.d.ts +24 -0
- package/dist/facade/types.d.ts.map +1 -0
- package/dist/facade/types.js +3 -0
- package/dist/facade/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/ast-parser/go/index.d.ts +3 -0
- package/dist/tools/ast-parser/go/index.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/index.js +6 -0
- package/dist/tools/ast-parser/go/index.js.map +1 -0
- package/dist/tools/ast-parser/go/parser.d.ts +56 -0
- package/dist/tools/ast-parser/go/parser.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/parser.js +147 -0
- package/dist/tools/ast-parser/go/parser.js.map +1 -0
- package/dist/tools/ast-parser/go/schema-extractor.d.ts +103 -0
- package/dist/tools/ast-parser/go/schema-extractor.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/schema-extractor.js +487 -0
- package/dist/tools/ast-parser/go/schema-extractor.js.map +1 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.d.ts +51 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.js +263 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.js.map +1 -0
- package/dist/tools/ast-parser/go/types.d.ts +131 -0
- package/dist/tools/ast-parser/go/types.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/types.js +3 -0
- package/dist/tools/ast-parser/go/types.js.map +1 -0
- package/dist/tools/ast-parser/markdown/index.d.ts +28 -0
- package/dist/tools/ast-parser/markdown/index.d.ts.map +1 -0
- package/dist/tools/ast-parser/markdown/index.js +31 -0
- package/dist/tools/ast-parser/markdown/index.js.map +1 -0
- package/dist/tools/ast-parser/markdown/parser.d.ts +271 -0
- package/dist/tools/ast-parser/markdown/parser.d.ts.map +1 -0
- package/dist/tools/ast-parser/markdown/parser.js +613 -0
- package/dist/tools/ast-parser/markdown/parser.js.map +1 -0
- package/dist/tools/ast-parser/markdown/types.d.ts +131 -0
- package/dist/tools/ast-parser/markdown/types.d.ts.map +1 -0
- package/dist/tools/ast-parser/markdown/types.js +3 -0
- package/dist/tools/ast-parser/markdown/types.js.map +1 -0
- package/dist/tools/env/index.d.ts +2 -0
- package/dist/tools/env/index.d.ts.map +1 -0
- package/dist/tools/env/index.js +6 -0
- package/dist/tools/env/index.js.map +1 -0
- package/dist/tools/env/load-env.d.ts +9 -0
- package/dist/tools/env/load-env.d.ts.map +1 -0
- package/dist/tools/env/load-env.js +39 -0
- package/dist/tools/env/load-env.js.map +1 -0
- package/dist/tools/line-pattern/index.d.ts +15 -0
- package/dist/tools/line-pattern/index.d.ts.map +1 -0
- package/dist/tools/line-pattern/index.js +25 -0
- package/dist/tools/line-pattern/index.js.map +1 -0
- package/dist/tools/line-pattern/line-pattern.d.ts +53 -0
- package/dist/tools/line-pattern/line-pattern.d.ts.map +1 -0
- package/dist/tools/line-pattern/line-pattern.js +88 -0
- package/dist/tools/line-pattern/line-pattern.js.map +1 -0
- package/dist/tools/line-pattern/segment.d.ts +24 -0
- package/dist/tools/line-pattern/segment.d.ts.map +1 -0
- package/dist/tools/line-pattern/segment.js +15 -0
- package/dist/tools/line-pattern/segment.js.map +1 -0
- package/dist/tools/line-pattern/segments.d.ts +43 -0
- package/dist/tools/line-pattern/segments.d.ts.map +1 -0
- package/dist/tools/line-pattern/segments.js +91 -0
- package/dist/tools/line-pattern/segments.js.map +1 -0
- package/dist/tools/llm/description-intent/format-spec.d.ts +3 -0
- package/dist/tools/llm/description-intent/format-spec.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/format-spec.js +167 -0
- package/dist/tools/llm/description-intent/format-spec.js.map +1 -0
- package/dist/tools/llm/description-intent/index.d.ts +7 -0
- package/dist/tools/llm/description-intent/index.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/index.js +15 -0
- package/dist/tools/llm/description-intent/index.js.map +1 -0
- package/dist/tools/llm/description-intent/intent-detector.d.ts +8 -0
- package/dist/tools/llm/description-intent/intent-detector.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/intent-detector.js +103 -0
- package/dist/tools/llm/description-intent/intent-detector.js.map +1 -0
- package/dist/tools/llm/description-intent/normalizer.d.ts +12 -0
- package/dist/tools/llm/description-intent/normalizer.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/normalizer.js +73 -0
- package/dist/tools/llm/description-intent/normalizer.js.map +1 -0
- package/dist/tools/llm/description-intent/slot-extractor.d.ts +3 -0
- package/dist/tools/llm/description-intent/slot-extractor.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/slot-extractor.js +66 -0
- package/dist/tools/llm/description-intent/slot-extractor.js.map +1 -0
- package/dist/tools/llm/description-intent/types.d.ts +28 -0
- package/dist/tools/llm/description-intent/types.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/types.js +19 -0
- package/dist/tools/llm/description-intent/types.js.map +1 -0
- package/dist/tools/llm/index.d.ts +16 -0
- package/dist/tools/llm/index.d.ts.map +1 -0
- package/dist/tools/llm/index.js +26 -0
- package/dist/tools/llm/index.js.map +1 -0
- package/dist/tools/llm/model.d.ts +3 -0
- package/dist/tools/llm/model.d.ts.map +1 -0
- package/dist/tools/llm/model.js +18 -0
- package/dist/tools/llm/model.js.map +1 -0
- package/dist/tools/llm/structured-caller.d.ts +86 -0
- package/dist/tools/llm/structured-caller.d.ts.map +1 -0
- package/dist/tools/llm/structured-caller.js +181 -0
- package/dist/tools/llm/structured-caller.js.map +1 -0
- package/dist/tools/node-pattern/index.d.ts +17 -0
- package/dist/tools/node-pattern/index.d.ts.map +1 -0
- package/dist/tools/node-pattern/index.js +36 -0
- package/dist/tools/node-pattern/index.js.map +1 -0
- package/dist/tools/node-pattern/matchers.d.ts +61 -0
- package/dist/tools/node-pattern/matchers.d.ts.map +1 -0
- package/dist/tools/node-pattern/matchers.js +154 -0
- package/dist/tools/node-pattern/matchers.js.map +1 -0
- package/dist/tools/node-pattern/node-matcher.d.ts +69 -0
- package/dist/tools/node-pattern/node-matcher.d.ts.map +1 -0
- package/dist/tools/node-pattern/node-matcher.js +122 -0
- package/dist/tools/node-pattern/node-matcher.js.map +1 -0
- package/dist/tools/node-pattern/node-pattern.d.ts +65 -0
- package/dist/tools/node-pattern/node-pattern.d.ts.map +1 -0
- package/dist/tools/node-pattern/node-pattern.js +129 -0
- package/dist/tools/node-pattern/node-pattern.js.map +1 -0
- package/dist/tools/section-check/index.d.ts +4 -0
- package/dist/tools/section-check/index.d.ts.map +1 -0
- package/dist/tools/section-check/index.js +10 -0
- package/dist/tools/section-check/index.js.map +1 -0
- package/dist/tools/section-check/section-check.d.ts +46 -0
- package/dist/tools/section-check/section-check.d.ts.map +1 -0
- package/dist/tools/section-check/section-check.js +264 -0
- package/dist/tools/section-check/section-check.js.map +1 -0
- package/dist/tools/section-check/types.d.ts +35 -0
- package/dist/tools/section-check/types.d.ts.map +1 -0
- package/dist/tools/section-check/types.js +23 -0
- package/dist/tools/section-check/types.js.map +1 -0
- package/dist/tools/text-grep/index.d.ts +10 -0
- package/dist/tools/text-grep/index.d.ts.map +1 -0
- package/dist/tools/text-grep/index.js +13 -0
- package/dist/tools/text-grep/index.js.map +1 -0
- package/dist/tools/text-grep/regex-grep.d.ts +92 -0
- package/dist/tools/text-grep/regex-grep.d.ts.map +1 -0
- package/dist/tools/text-grep/regex-grep.js +141 -0
- package/dist/tools/text-grep/regex-grep.js.map +1 -0
- package/dist/workflow/context/context.d.ts +13 -0
- package/dist/workflow/context/context.d.ts.map +1 -0
- package/dist/workflow/context/context.js +29 -0
- package/dist/workflow/context/context.js.map +1 -0
- package/dist/workflow/implement/resource-check/context-keys.d.ts +30 -0
- package/dist/workflow/implement/resource-check/context-keys.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/context-keys.js +33 -0
- package/dist/workflow/implement/resource-check/context-keys.js.map +1 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.d.ts +20 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.js +325 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/index.d.ts +5 -0
- package/dist/workflow/implement/resource-check/rules/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/index.js +21 -0
- package/dist/workflow/implement/resource-check/rules/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.js +51 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.js +60 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.js +80 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.js +42 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.js +34 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.js +33 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.js +33 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.js +34 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.d.ts +11 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.js +38 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.d.ts +15 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.js +77 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.d.ts +23 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.js +128 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.js +19 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.js +44 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.js +80 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.d.ts +15 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.js +77 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.d.ts +23 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js +128 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.d.ts +11 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.js +145 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.d.ts +11 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.js +145 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.js +83 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.js +83 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.d.ts +7 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.js +15 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.js +96 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.js +109 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.d.ts +19 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.js +31 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.d.ts +15 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.js +554 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.d.ts +5 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.js +16 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.d.ts +94 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.js +42 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.d.ts +4 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.js +103 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.d.ts +3 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.js +6 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.d.ts +47 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.js +3 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.d.ts +4 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.js +8 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.d.ts +108 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.js +498 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.d.ts +51 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.js +271 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.d.ts +133 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.js +3 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.js.map +1 -0
- package/dist/workflow/implement/resource-check/types.d.ts +18 -0
- package/dist/workflow/implement/resource-check/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/types.js +107 -0
- package/dist/workflow/implement/resource-check/types.js.map +1 -0
- package/dist/workflow/types/rule/rule.d.ts +72 -0
- package/dist/workflow/types/rule/rule.d.ts.map +1 -0
- package/dist/workflow/types/rule/rule.js +110 -0
- package/dist/workflow/types/rule/rule.js.map +1 -0
- package/dist/workflow/workflow.d.ts +52 -0
- package/dist/workflow/workflow.d.ts.map +1 -0
- package/dist/workflow/workflow.js +121 -0
- package/dist/workflow/workflow.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { Node } from "commonmark";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown node types defined in CommonMark specification,
|
|
4
|
+
* extended with "frontmatter" for YAML front-matter blocks.
|
|
5
|
+
*/
|
|
6
|
+
export type MarkdownNodeType = "document" | "block_quote" | "list" | "item" | "paragraph" | "heading" | "emph" | "strong" | "link" | "image" | "code" | "code_block" | "thematic_break" | "softbreak" | "linebreak" | "html_block" | "html_inline" | "text" | "custom_block" | "custom_inline" | "frontmatter";
|
|
7
|
+
/**
|
|
8
|
+
* List type for list nodes
|
|
9
|
+
*/
|
|
10
|
+
export type ListType = "bullet" | "ordered";
|
|
11
|
+
/**
|
|
12
|
+
* Position information for a node in the source document
|
|
13
|
+
*/
|
|
14
|
+
export interface SourcePosition {
|
|
15
|
+
line: number;
|
|
16
|
+
column: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Source location range for a node
|
|
20
|
+
*/
|
|
21
|
+
export interface SourceRange {
|
|
22
|
+
start: SourcePosition;
|
|
23
|
+
end: SourcePosition;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Simplified markdown AST node interface
|
|
27
|
+
*/
|
|
28
|
+
export interface MarkdownNode {
|
|
29
|
+
/**
|
|
30
|
+
* The type of the node
|
|
31
|
+
*/
|
|
32
|
+
type: MarkdownNodeType;
|
|
33
|
+
/**
|
|
34
|
+
* Text content for text, code, code_block, and html nodes
|
|
35
|
+
*/
|
|
36
|
+
literal: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Destination URL for link and image nodes
|
|
39
|
+
*/
|
|
40
|
+
destination: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Title for link and image nodes
|
|
43
|
+
*/
|
|
44
|
+
title: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Info string for code_block nodes (e.g., language identifier)
|
|
47
|
+
*/
|
|
48
|
+
info: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Heading level (1-6) for heading nodes
|
|
51
|
+
*/
|
|
52
|
+
level: number | null;
|
|
53
|
+
/**
|
|
54
|
+
* List type for list nodes
|
|
55
|
+
*/
|
|
56
|
+
listType: ListType | null;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the list is tight (no blank lines between items)
|
|
59
|
+
*/
|
|
60
|
+
listTight: boolean | null;
|
|
61
|
+
/**
|
|
62
|
+
* Starting number for ordered lists
|
|
63
|
+
*/
|
|
64
|
+
listStart: number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Delimiter for ordered lists ("." or ")")
|
|
67
|
+
*/
|
|
68
|
+
listDelimiter: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Parsed key-value data for frontmatter nodes (YAML content)
|
|
71
|
+
*/
|
|
72
|
+
data: Record<string, unknown> | null;
|
|
73
|
+
/**
|
|
74
|
+
* Source location in the original document
|
|
75
|
+
*/
|
|
76
|
+
sourceRange: SourceRange | null;
|
|
77
|
+
/**
|
|
78
|
+
* Child nodes
|
|
79
|
+
*/
|
|
80
|
+
children: MarkdownNode[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Walker event for traversing the AST
|
|
84
|
+
*/
|
|
85
|
+
export interface WalkEvent {
|
|
86
|
+
/**
|
|
87
|
+
* Whether this is an entering or leaving event
|
|
88
|
+
*/
|
|
89
|
+
entering: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The current node
|
|
92
|
+
*/
|
|
93
|
+
node: MarkdownNode;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Visitor callback function type
|
|
97
|
+
*/
|
|
98
|
+
export type NodeVisitor = (node: MarkdownNode, entering: boolean) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Type-specific visitor callbacks
|
|
101
|
+
*/
|
|
102
|
+
export type TypedVisitors = {
|
|
103
|
+
[K in MarkdownNodeType]?: NodeVisitor;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Options for the markdown parser
|
|
107
|
+
*/
|
|
108
|
+
export interface ParserOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Whether to enable smart punctuation (e.g., converting quotes)
|
|
111
|
+
*/
|
|
112
|
+
smart?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Maximum nesting level for nested content
|
|
115
|
+
*/
|
|
116
|
+
maxNesting?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Whether to enable YAML front-matter parsing.
|
|
119
|
+
* When enabled, the parser extracts the leading `---...---` block,
|
|
120
|
+
* parses its YAML content, and inserts a "frontmatter" node as
|
|
121
|
+
* the first child of the document node.
|
|
122
|
+
*
|
|
123
|
+
* @default true
|
|
124
|
+
*/
|
|
125
|
+
enableFrontmatter?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Re-export the original commonmark Node type for advanced usage
|
|
129
|
+
*/
|
|
130
|
+
export type { Node as CommonMarkNode };
|
|
131
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/ast-parser/markdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACtB,UAAU,GACV,aAAa,GACb,MAAM,GACN,MAAM,GACN,WAAW,GACX,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,MAAM,GACN,YAAY,GACZ,gBAAgB,GAChB,WAAW,GACX,WAAW,GACX,YAAY,GACZ,aAAa,GACb,MAAM,GACN,cAAc,GACd,eAAe,GACf,aAAa,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,GAAG,EAAE,cAAc,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB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ED;;GAEG;AACH,YAAY,EAAE,IAAI,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/ast-parser/markdown/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/env/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadEnvFile = void 0;
|
|
4
|
+
var load_env_1 = require("./load-env");
|
|
5
|
+
Object.defineProperty(exports, "loadEnvFile", { enumerable: true, get: function () { return load_env_1.loadEnvFile; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/env/index.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAAhC,uGAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load key-value pairs from workspace `.env` into `process.env`.
|
|
3
|
+
*
|
|
4
|
+
* - Reads `<cwd>/.env`
|
|
5
|
+
* - Skips blank lines and `#` comments
|
|
6
|
+
* - Does not overwrite pre-existing environment variables
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadEnvFile(): void;
|
|
9
|
+
//# sourceMappingURL=load-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-env.d.ts","sourceRoot":"","sources":["../../../src/tools/env/load-env.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,IAAI,CA2BlC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadEnvFile = loadEnvFile;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
let loaded = false;
|
|
7
|
+
/**
|
|
8
|
+
* Load key-value pairs from workspace `.env` into `process.env`.
|
|
9
|
+
*
|
|
10
|
+
* - Reads `<cwd>/.env`
|
|
11
|
+
* - Skips blank lines and `#` comments
|
|
12
|
+
* - Does not overwrite pre-existing environment variables
|
|
13
|
+
*/
|
|
14
|
+
function loadEnvFile() {
|
|
15
|
+
if (loaded)
|
|
16
|
+
return;
|
|
17
|
+
const envPath = (0, path_1.resolve)(process.cwd(), ".env");
|
|
18
|
+
if (!(0, fs_1.existsSync)(envPath)) {
|
|
19
|
+
loaded = true;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const content = (0, fs_1.readFileSync)(envPath, "utf8");
|
|
23
|
+
const lines = content.split(/\r?\n/);
|
|
24
|
+
for (const rawLine of lines) {
|
|
25
|
+
const line = rawLine.trim();
|
|
26
|
+
if (!line || line.startsWith("#"))
|
|
27
|
+
continue;
|
|
28
|
+
const separatorIndex = line.indexOf("=");
|
|
29
|
+
if (separatorIndex <= 0)
|
|
30
|
+
continue;
|
|
31
|
+
const key = line.slice(0, separatorIndex).trim();
|
|
32
|
+
if (!key || process.env[key] !== undefined)
|
|
33
|
+
continue;
|
|
34
|
+
const value = line.slice(separatorIndex + 1).trim();
|
|
35
|
+
process.env[key] = value;
|
|
36
|
+
}
|
|
37
|
+
loaded = true;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=load-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-env.js","sourceRoot":"","sources":["../../../src/tools/env/load-env.ts"],"names":[],"mappings":";;AAYA,kCA2BC;AAvCD,2BAA8C;AAC9C,+BAA+B;AAE/B,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB;;;;;;GAMG;AACH,SAAgB,WAAW;IACvB,IAAI,MAAM;QAAE,OAAO;IAEnB,MAAM,OAAO,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAA,eAAU,EAAC,OAAO,CAAC,EAAE,CAAC;QACvB,MAAM,GAAG,IAAI,CAAC;QACd,OAAO;IACX,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAErC,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAE5C,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,cAAc,IAAI,CAAC;YAAE,SAAS;QAElC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,SAAS;QAErD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,MAAM,GAAG,IAAI,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line Pattern Module
|
|
3
|
+
*
|
|
4
|
+
* Provides a composable, segment-based approach to defining
|
|
5
|
+
* and validating line-level text format patterns.
|
|
6
|
+
*
|
|
7
|
+
* @module tools/line-pattern
|
|
8
|
+
*/
|
|
9
|
+
export { LinePattern } from "./line-pattern";
|
|
10
|
+
export type { LineMatchResult, LineMatchSuccess, LineMatchFailure, } from "./line-pattern";
|
|
11
|
+
export type { Segment, SegmentMatchResult } from "./segment";
|
|
12
|
+
export { matchSegment } from "./segment";
|
|
13
|
+
export { literal, backticked, parenthesized, spaces, keyword, rest, optional, csvParenthesized, } from "./segments";
|
|
14
|
+
export type { CsvSlot } from "./segments";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/line-pattern/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACR,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EACH,OAAO,EACP,UAAU,EACV,aAAa,EACb,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Line Pattern Module
|
|
4
|
+
*
|
|
5
|
+
* Provides a composable, segment-based approach to defining
|
|
6
|
+
* and validating line-level text format patterns.
|
|
7
|
+
*
|
|
8
|
+
* @module tools/line-pattern
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.csvParenthesized = exports.optional = exports.rest = exports.keyword = exports.spaces = exports.parenthesized = exports.backticked = exports.literal = exports.matchSegment = exports.LinePattern = void 0;
|
|
12
|
+
var line_pattern_1 = require("./line-pattern");
|
|
13
|
+
Object.defineProperty(exports, "LinePattern", { enumerable: true, get: function () { return line_pattern_1.LinePattern; } });
|
|
14
|
+
var segment_1 = require("./segment");
|
|
15
|
+
Object.defineProperty(exports, "matchSegment", { enumerable: true, get: function () { return segment_1.matchSegment; } });
|
|
16
|
+
var segments_1 = require("./segments");
|
|
17
|
+
Object.defineProperty(exports, "literal", { enumerable: true, get: function () { return segments_1.literal; } });
|
|
18
|
+
Object.defineProperty(exports, "backticked", { enumerable: true, get: function () { return segments_1.backticked; } });
|
|
19
|
+
Object.defineProperty(exports, "parenthesized", { enumerable: true, get: function () { return segments_1.parenthesized; } });
|
|
20
|
+
Object.defineProperty(exports, "spaces", { enumerable: true, get: function () { return segments_1.spaces; } });
|
|
21
|
+
Object.defineProperty(exports, "keyword", { enumerable: true, get: function () { return segments_1.keyword; } });
|
|
22
|
+
Object.defineProperty(exports, "rest", { enumerable: true, get: function () { return segments_1.rest; } });
|
|
23
|
+
Object.defineProperty(exports, "optional", { enumerable: true, get: function () { return segments_1.optional; } });
|
|
24
|
+
Object.defineProperty(exports, "csvParenthesized", { enumerable: true, get: function () { return segments_1.csvParenthesized; } });
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/line-pattern/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AAQpB,qCAAyC;AAAhC,uGAAA,YAAY,OAAA;AAErB,uCASoB;AARhB,mGAAA,OAAO,OAAA;AACP,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA;AACb,kGAAA,MAAM,OAAA;AACN,mGAAA,OAAO,OAAA;AACP,gGAAA,IAAI,OAAA;AACJ,oGAAA,QAAQ,OAAA;AACR,4GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Segment } from "./segment";
|
|
2
|
+
export interface LineMatchFailure {
|
|
3
|
+
/** 0-based index of the segment that failed. */
|
|
4
|
+
segmentIndex: number;
|
|
5
|
+
/** The display string of the failed segment. */
|
|
6
|
+
expectedDisplay: string;
|
|
7
|
+
/** The remaining unmatched portion of the input. */
|
|
8
|
+
remaining: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LineMatchSuccess {
|
|
11
|
+
/** The portion of input consumed by each segment. */
|
|
12
|
+
captures: string[];
|
|
13
|
+
}
|
|
14
|
+
export type LineMatchResult = {
|
|
15
|
+
ok: true;
|
|
16
|
+
value: LineMatchSuccess;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: LineMatchFailure;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A line-level format pattern composed of ordered segments.
|
|
23
|
+
*
|
|
24
|
+
* Instead of one monolithic regex, the pattern validates input
|
|
25
|
+
* by sequentially applying each segment's own small regex.
|
|
26
|
+
* This makes each piece independently readable, testable,
|
|
27
|
+
* and produces precise error reporting on mismatch.
|
|
28
|
+
*/
|
|
29
|
+
export declare class LinePattern {
|
|
30
|
+
private readonly segments;
|
|
31
|
+
constructor(segments: Segment[]);
|
|
32
|
+
/**
|
|
33
|
+
* Generate the human-readable display format by joining
|
|
34
|
+
* all segment display strings.
|
|
35
|
+
*/
|
|
36
|
+
toDisplayFormat(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Test whether the full line matches this pattern.
|
|
39
|
+
*/
|
|
40
|
+
test(line: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Match the line against all segments sequentially.
|
|
43
|
+
*
|
|
44
|
+
* On success, returns the text captured by each segment.
|
|
45
|
+
* On failure, returns which segment failed and what remained.
|
|
46
|
+
*/
|
|
47
|
+
match(line: string): LineMatchResult;
|
|
48
|
+
/**
|
|
49
|
+
* Produce a diagnostic message when a line fails to match.
|
|
50
|
+
*/
|
|
51
|
+
describeFailure(line: string): string | null;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=line-pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-pattern.d.ts","sourceRoot":"","sources":["../../../src/tools/line-pattern/line-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,WAAW,gBAAgB;IAC7B,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC7B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,GACrC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAE7C;;;;;;;GAOG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;gBAEzB,QAAQ,EAAE,OAAO,EAAE;IAI/B;;;OAGG;IACH,eAAe,IAAI,MAAM;IAMzB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI3B;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe;IAyCpC;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAY/C"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinePattern = void 0;
|
|
4
|
+
const segment_1 = require("./segment");
|
|
5
|
+
/**
|
|
6
|
+
* A line-level format pattern composed of ordered segments.
|
|
7
|
+
*
|
|
8
|
+
* Instead of one monolithic regex, the pattern validates input
|
|
9
|
+
* by sequentially applying each segment's own small regex.
|
|
10
|
+
* This makes each piece independently readable, testable,
|
|
11
|
+
* and produces precise error reporting on mismatch.
|
|
12
|
+
*/
|
|
13
|
+
class LinePattern {
|
|
14
|
+
constructor(segments) {
|
|
15
|
+
this.segments = segments;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generate the human-readable display format by joining
|
|
19
|
+
* all segment display strings.
|
|
20
|
+
*/
|
|
21
|
+
toDisplayFormat() {
|
|
22
|
+
return this.segments
|
|
23
|
+
.map((s) => s.display)
|
|
24
|
+
.join("");
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Test whether the full line matches this pattern.
|
|
28
|
+
*/
|
|
29
|
+
test(line) {
|
|
30
|
+
return this.match(line).ok;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Match the line against all segments sequentially.
|
|
34
|
+
*
|
|
35
|
+
* On success, returns the text captured by each segment.
|
|
36
|
+
* On failure, returns which segment failed and what remained.
|
|
37
|
+
*/
|
|
38
|
+
match(line) {
|
|
39
|
+
let remaining = line;
|
|
40
|
+
const captures = [];
|
|
41
|
+
for (let i = 0; i < this.segments.length; i++) {
|
|
42
|
+
const seg = this.segments[i];
|
|
43
|
+
const result = (0, segment_1.matchSegment)(seg, remaining);
|
|
44
|
+
if (!result.matched) {
|
|
45
|
+
if (seg.optional) {
|
|
46
|
+
captures.push("");
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
ok: false,
|
|
51
|
+
error: {
|
|
52
|
+
segmentIndex: i,
|
|
53
|
+
expectedDisplay: seg.display,
|
|
54
|
+
remaining,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
captures.push(remaining.slice(0, result.consumed));
|
|
59
|
+
remaining = remaining.slice(result.consumed);
|
|
60
|
+
}
|
|
61
|
+
if (remaining.length > 0) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
error: {
|
|
65
|
+
segmentIndex: this.segments.length,
|
|
66
|
+
expectedDisplay: "<end of line>",
|
|
67
|
+
remaining,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return { ok: true, value: { captures } };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Produce a diagnostic message when a line fails to match.
|
|
75
|
+
*/
|
|
76
|
+
describeFailure(line) {
|
|
77
|
+
const result = this.match(line);
|
|
78
|
+
if (result.ok)
|
|
79
|
+
return null;
|
|
80
|
+
const { segmentIndex, expectedDisplay, remaining } = result.error;
|
|
81
|
+
const pos = line.length - remaining.length;
|
|
82
|
+
return (`Mismatch at position ${pos} (segment #${segmentIndex}): ` +
|
|
83
|
+
`expected ${expectedDisplay}, ` +
|
|
84
|
+
`got "${remaining.slice(0, 20)}${remaining.length > 20 ? "..." : ""}"`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.LinePattern = LinePattern;
|
|
88
|
+
//# sourceMappingURL=line-pattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-pattern.js","sourceRoot":"","sources":["../../../src/tools/line-pattern/line-pattern.ts"],"names":[],"mappings":";;;AACA,uCAAyC;AAoBzC;;;;;;;GAOG;AACH,MAAa,WAAW;IAGpB,YAAY,QAAmB;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,eAAe;QACX,OAAO,IAAI,CAAC,QAAQ;aACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;aACrB,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAY;QACb,OAAO,IAAI,CAAC,KAAK,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E,EAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,IAAY;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,MAAM,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QAE3B,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;QAClE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;QAC3C,OAAO,CACH,wBAAwB,GAAG,cAAc,YAAY,KAAK;YAC1D,YAAY,eAAe,IAAI;YAC/B,QAAQ,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CACzE,CAAC;IACN,CAAC;CACJ;AAtFD,kCAsFC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents one atomic piece of a line format pattern.
|
|
3
|
+
*
|
|
4
|
+
* Each segment owns a small regex that matches its portion of the input
|
|
5
|
+
* and a human-readable placeholder used when generating display formats.
|
|
6
|
+
*/
|
|
7
|
+
export interface Segment {
|
|
8
|
+
/** Regex that matches this segment (must NOT be anchored with ^ or $). */
|
|
9
|
+
readonly regex: RegExp;
|
|
10
|
+
/** Human-readable placeholder, e.g. "`arg_name`" or "(Modifier, Type)". */
|
|
11
|
+
readonly display: string;
|
|
12
|
+
/** Whether this segment is optional. */
|
|
13
|
+
readonly optional?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SegmentMatchResult {
|
|
16
|
+
matched: boolean;
|
|
17
|
+
consumed: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Try to match a segment at the beginning of `input`.
|
|
21
|
+
* Returns how many characters were consumed, or -1 on failure.
|
|
22
|
+
*/
|
|
23
|
+
export declare function matchSegment(segment: Segment, input: string): SegmentMatchResult;
|
|
24
|
+
//# sourceMappingURL=segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../../src/tools/line-pattern/segment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACpB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GACd,kBAAkB,CAMpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchSegment = matchSegment;
|
|
4
|
+
/**
|
|
5
|
+
* Try to match a segment at the beginning of `input`.
|
|
6
|
+
* Returns how many characters were consumed, or -1 on failure.
|
|
7
|
+
*/
|
|
8
|
+
function matchSegment(segment, input) {
|
|
9
|
+
const m = segment.regex.exec(input);
|
|
10
|
+
if (!m || m.index !== 0) {
|
|
11
|
+
return { matched: false, consumed: 0 };
|
|
12
|
+
}
|
|
13
|
+
return { matched: true, consumed: m[0].length };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.js","sourceRoot":"","sources":["../../../src/tools/line-pattern/segment.ts"],"names":[],"mappings":";;AA0BA,oCASC;AAbD;;;GAGG;AACH,SAAgB,YAAY,CACxB,OAAgB,EAChB,KAAa;IAEb,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Segment } from "./segment";
|
|
2
|
+
/**
|
|
3
|
+
* Factory functions for common segment types.
|
|
4
|
+
*
|
|
5
|
+
* Each factory returns a Segment with a focused regex and
|
|
6
|
+
* a descriptive display string.
|
|
7
|
+
*/
|
|
8
|
+
/** Matches an exact literal string (whitespace-flexible). */
|
|
9
|
+
export declare function literal(text: string): Segment;
|
|
10
|
+
/** Matches `name` — a back-ticked identifier. */
|
|
11
|
+
export declare function backticked(placeholder: string): Segment;
|
|
12
|
+
/** Matches (content) — parenthesized group. */
|
|
13
|
+
export declare function parenthesized(placeholder: string): Segment;
|
|
14
|
+
/** Matches whitespace characters. Optionally specify an exact count. */
|
|
15
|
+
export declare function spaces(count?: number): Segment;
|
|
16
|
+
/** Matches a fixed keyword. */
|
|
17
|
+
export declare function keyword(word: string): Segment;
|
|
18
|
+
/** Matches the rest of the line (at least one character). */
|
|
19
|
+
export declare function rest(placeholder: string): Segment;
|
|
20
|
+
/** Matches an optional segment — skipped without error if absent. */
|
|
21
|
+
export declare function optional(segment: Segment): Segment;
|
|
22
|
+
/** One slot in a CSV-parenthesized group. */
|
|
23
|
+
export interface CsvSlot {
|
|
24
|
+
/** Display name for this slot. */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Allowed values (matched literally, case-sensitive). */
|
|
27
|
+
values: string[];
|
|
28
|
+
/**
|
|
29
|
+
* If true, zero or more items from this value set may trail
|
|
30
|
+
* the required slots. Must be the last slot.
|
|
31
|
+
*/
|
|
32
|
+
zeroOrMore?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Matches a parenthesized, comma-separated group where each positional
|
|
36
|
+
* slot validates against a fixed set of allowed values.
|
|
37
|
+
*
|
|
38
|
+
* Required slots appear in order, separated by `, `.
|
|
39
|
+
* A trailing `zeroOrMore` slot allows 0+ extra comma-separated items
|
|
40
|
+
* drawn from its value set.
|
|
41
|
+
*/
|
|
42
|
+
export declare function csvParenthesized(slots: CsvSlot[]): Segment;
|
|
43
|
+
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/tools/line-pattern/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;GAKG;AAEH,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM7C;AAED,iDAAiD;AACjD,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAKvD;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAK1D;AAED,wEAAwE;AACxE,wBAAgB,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAK9C;AAED,+BAA+B;AAC/B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM7C;AAED,6DAA6D;AAC7D,wBAAgB,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAKjD;AAED,qEAAqE;AACrE,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAElD;AAED,6CAA6C;AAC7C,MAAM,WAAW,OAAO;IACpB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAuB1D"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.literal = literal;
|
|
4
|
+
exports.backticked = backticked;
|
|
5
|
+
exports.parenthesized = parenthesized;
|
|
6
|
+
exports.spaces = spaces;
|
|
7
|
+
exports.keyword = keyword;
|
|
8
|
+
exports.rest = rest;
|
|
9
|
+
exports.optional = optional;
|
|
10
|
+
exports.csvParenthesized = csvParenthesized;
|
|
11
|
+
/**
|
|
12
|
+
* Factory functions for common segment types.
|
|
13
|
+
*
|
|
14
|
+
* Each factory returns a Segment with a focused regex and
|
|
15
|
+
* a descriptive display string.
|
|
16
|
+
*/
|
|
17
|
+
/** Matches an exact literal string (whitespace-flexible). */
|
|
18
|
+
function literal(text) {
|
|
19
|
+
const escaped = text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
20
|
+
return {
|
|
21
|
+
regex: new RegExp(escaped),
|
|
22
|
+
display: text,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Matches `name` — a back-ticked identifier. */
|
|
26
|
+
function backticked(placeholder) {
|
|
27
|
+
return {
|
|
28
|
+
regex: /`[^`]+`/,
|
|
29
|
+
display: `\`${placeholder}\``,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Matches (content) — parenthesized group. */
|
|
33
|
+
function parenthesized(placeholder) {
|
|
34
|
+
return {
|
|
35
|
+
regex: /\([^)]+\)/,
|
|
36
|
+
display: `(${placeholder})`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Matches whitespace characters. Optionally specify an exact count. */
|
|
40
|
+
function spaces(count) {
|
|
41
|
+
return {
|
|
42
|
+
regex: count !== undefined ? new RegExp(`\\s{${count}}`) : /\s+/,
|
|
43
|
+
display: " ",
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Matches a fixed keyword. */
|
|
47
|
+
function keyword(word) {
|
|
48
|
+
const escaped = word.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
49
|
+
return {
|
|
50
|
+
regex: new RegExp(escaped),
|
|
51
|
+
display: word,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Matches the rest of the line (at least one character). */
|
|
55
|
+
function rest(placeholder) {
|
|
56
|
+
return {
|
|
57
|
+
regex: /.+/,
|
|
58
|
+
display: placeholder,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Matches an optional segment — skipped without error if absent. */
|
|
62
|
+
function optional(segment) {
|
|
63
|
+
return { ...segment, optional: true };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Matches a parenthesized, comma-separated group where each positional
|
|
67
|
+
* slot validates against a fixed set of allowed values.
|
|
68
|
+
*
|
|
69
|
+
* Required slots appear in order, separated by `, `.
|
|
70
|
+
* A trailing `zeroOrMore` slot allows 0+ extra comma-separated items
|
|
71
|
+
* drawn from its value set.
|
|
72
|
+
*/
|
|
73
|
+
function csvParenthesized(slots) {
|
|
74
|
+
const required = slots.filter((s) => !s.zeroOrMore);
|
|
75
|
+
const trailing = slots.find((s) => s.zeroOrMore);
|
|
76
|
+
const parts = required.map((s) => `(?:${s.values.join("|")})`);
|
|
77
|
+
let inner = parts.join(",\\s+");
|
|
78
|
+
if (trailing) {
|
|
79
|
+
inner += `(?:,\\s+(?:${trailing.values.join("|")}))*`;
|
|
80
|
+
}
|
|
81
|
+
const displayParts = required.map((s) => s.name);
|
|
82
|
+
let display = displayParts.join(", ");
|
|
83
|
+
if (trailing) {
|
|
84
|
+
display += `[, ${trailing.name}...]`;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
regex: new RegExp(`\\(${inner}\\)`),
|
|
88
|
+
display: `(${display})`,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=segments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../../src/tools/line-pattern/segments.ts"],"names":[],"mappings":";;AAUA,0BAMC;AAGD,gCAKC;AAGD,sCAKC;AAGD,wBAKC;AAGD,0BAMC;AAGD,oBAKC;AAGD,4BAEC;AAuBD,4CAuBC;AA1GD;;;;;GAKG;AAEH,6DAA6D;AAC7D,SAAgB,OAAO,CAAC,IAAY;IAChC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO;QACH,KAAK,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC;QAC1B,OAAO,EAAE,IAAI;KAChB,CAAC;AACN,CAAC;AAED,iDAAiD;AACjD,SAAgB,UAAU,CAAC,WAAmB;IAC1C,OAAO;QACH,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,KAAK,WAAW,IAAI;KAChC,CAAC;AACN,CAAC;AAED,+CAA+C;AAC/C,SAAgB,aAAa,CAAC,WAAmB;IAC7C,OAAO;QACH,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,IAAI,WAAW,GAAG;KAC9B,CAAC;AACN,CAAC;AAED,wEAAwE;AACxE,SAAgB,MAAM,CAAC,KAAc;IACjC,OAAO;QACH,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;QAChE,OAAO,EAAE,GAAG;KACf,CAAC;AACN,CAAC;AAED,+BAA+B;AAC/B,SAAgB,OAAO,CAAC,IAAY;IAChC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MA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