@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,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFormatSpec = getFormatSpec;
|
|
4
|
+
const line_pattern_1 = require("../../line-pattern");
|
|
5
|
+
const VALUE_RANGE_PATTERN = new line_pattern_1.LinePattern([
|
|
6
|
+
(0, line_pattern_1.keyword)("The valid value is range from"),
|
|
7
|
+
(0, line_pattern_1.spaces)(1),
|
|
8
|
+
(0, line_pattern_1.backticked)("min"),
|
|
9
|
+
(0, line_pattern_1.spaces)(1),
|
|
10
|
+
(0, line_pattern_1.keyword)("to"),
|
|
11
|
+
(0, line_pattern_1.spaces)(1),
|
|
12
|
+
(0, line_pattern_1.backticked)("max"),
|
|
13
|
+
(0, line_pattern_1.literal)("."),
|
|
14
|
+
]);
|
|
15
|
+
const ENUM_INTRO_PATTERN = new line_pattern_1.LinePattern([
|
|
16
|
+
(0, line_pattern_1.keyword)("The valid values are as follow:"),
|
|
17
|
+
]);
|
|
18
|
+
const ENUM_ITEM_PATTERN = new line_pattern_1.LinePattern([
|
|
19
|
+
(0, line_pattern_1.literal)("+ "),
|
|
20
|
+
(0, line_pattern_1.literal)("**"),
|
|
21
|
+
(0, line_pattern_1.rest)("value"),
|
|
22
|
+
]);
|
|
23
|
+
const MAX_LENGTH_REGEX = /contain a maximum of `[^`]+` characters\./;
|
|
24
|
+
const DEFAULT_VALUE_PATTERN = new line_pattern_1.LinePattern([
|
|
25
|
+
(0, line_pattern_1.keyword)("The default value is"),
|
|
26
|
+
(0, line_pattern_1.spaces)(1),
|
|
27
|
+
(0, line_pattern_1.backticked)("value"),
|
|
28
|
+
(0, line_pattern_1.literal)("."),
|
|
29
|
+
]);
|
|
30
|
+
const CHAR_RESTRICTION_PATTERN = new line_pattern_1.LinePattern([
|
|
31
|
+
(0, line_pattern_1.keyword)("Only the"),
|
|
32
|
+
(0, line_pattern_1.spaces)(1),
|
|
33
|
+
(0, line_pattern_1.rest)("char_types_and_suffix"),
|
|
34
|
+
]);
|
|
35
|
+
const VALUE_RANGE_SPEC = {
|
|
36
|
+
intent: "value-range",
|
|
37
|
+
validate(lines) {
|
|
38
|
+
const expected = VALUE_RANGE_PATTERN.toDisplayFormat();
|
|
39
|
+
const target = findRelevantLine(lines, /valid\s+value.*range|range\s+from/i);
|
|
40
|
+
if (!target) {
|
|
41
|
+
return {
|
|
42
|
+
ok: false,
|
|
43
|
+
expected,
|
|
44
|
+
detail: "No line matches value-range pattern",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const ok = VALUE_RANGE_PATTERN.test(target);
|
|
48
|
+
return {
|
|
49
|
+
ok,
|
|
50
|
+
expected,
|
|
51
|
+
detail: ok ? undefined : VALUE_RANGE_PATTERN.describeFailure(target) ?? undefined,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const ENUM_VALUES_SPEC = {
|
|
56
|
+
intent: "enum-values",
|
|
57
|
+
validate(lines) {
|
|
58
|
+
const introExpected = ENUM_INTRO_PATTERN.toDisplayFormat();
|
|
59
|
+
if (lines.length === 0) {
|
|
60
|
+
return { ok: false, expected: introExpected, detail: "No lines to check" };
|
|
61
|
+
}
|
|
62
|
+
const introLine = lines[0].trim();
|
|
63
|
+
if (!ENUM_INTRO_PATTERN.test(introLine)) {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
expected: introExpected,
|
|
67
|
+
detail: ENUM_INTRO_PATTERN.describeFailure(introLine) ?? undefined,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const itemLines = lines.slice(1).filter((l) => l.trim().length > 0);
|
|
71
|
+
for (const line of itemLines) {
|
|
72
|
+
const trimmed = line.trim();
|
|
73
|
+
if (!ENUM_ITEM_PATTERN.test(trimmed)) {
|
|
74
|
+
return {
|
|
75
|
+
ok: false,
|
|
76
|
+
expected: "+ **value**: description",
|
|
77
|
+
detail: `Invalid enum item: "${trimmed}"`,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { ok: true, expected: introExpected };
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
const CHAR_RESTRICTION_SPEC = {
|
|
85
|
+
intent: "char-restriction",
|
|
86
|
+
validate(lines) {
|
|
87
|
+
const expected = "Only the {char_types} are allowed";
|
|
88
|
+
const target = findRelevantLine(lines, /only\s+the\b/i);
|
|
89
|
+
if (!target) {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
expected,
|
|
93
|
+
detail: "No line matches char-restriction pattern",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const ok = CHAR_RESTRICTION_PATTERN.test(target);
|
|
97
|
+
if (!ok) {
|
|
98
|
+
return {
|
|
99
|
+
ok: false,
|
|
100
|
+
expected,
|
|
101
|
+
detail: CHAR_RESTRICTION_PATTERN.describeFailure(target) ?? undefined,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (!/are allowed/i.test(target)) {
|
|
105
|
+
return { ok: false, expected, detail: "Missing \"are allowed\" suffix" };
|
|
106
|
+
}
|
|
107
|
+
return { ok: true, expected };
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
const MAX_LENGTH_SPEC = {
|
|
111
|
+
intent: "max-length",
|
|
112
|
+
validate(lines) {
|
|
113
|
+
const expected = "... contain a maximum of `N` characters.";
|
|
114
|
+
const target = findRelevantLine(lines, /maximum|at most/i);
|
|
115
|
+
if (!target) {
|
|
116
|
+
return {
|
|
117
|
+
ok: false,
|
|
118
|
+
expected,
|
|
119
|
+
detail: "No line matches max-length pattern",
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const ok = MAX_LENGTH_REGEX.test(target);
|
|
123
|
+
return {
|
|
124
|
+
ok,
|
|
125
|
+
expected,
|
|
126
|
+
detail: ok ? undefined : `Got: "${target}"`,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
const DEFAULT_VALUE_SPEC = {
|
|
131
|
+
intent: "default-value",
|
|
132
|
+
validate(lines) {
|
|
133
|
+
const expected = DEFAULT_VALUE_PATTERN.toDisplayFormat();
|
|
134
|
+
const target = findRelevantLine(lines, /default\s+value/i);
|
|
135
|
+
if (!target) {
|
|
136
|
+
return {
|
|
137
|
+
ok: false,
|
|
138
|
+
expected,
|
|
139
|
+
detail: "No line matches default-value pattern",
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const ok = DEFAULT_VALUE_PATTERN.test(target);
|
|
143
|
+
return {
|
|
144
|
+
ok,
|
|
145
|
+
expected,
|
|
146
|
+
detail: ok ? undefined : DEFAULT_VALUE_PATTERN.describeFailure(target) ?? undefined,
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
const SPEC_MAP = new Map([
|
|
151
|
+
["value-range", VALUE_RANGE_SPEC],
|
|
152
|
+
["enum-values", ENUM_VALUES_SPEC],
|
|
153
|
+
["char-restriction", CHAR_RESTRICTION_SPEC],
|
|
154
|
+
["max-length", MAX_LENGTH_SPEC],
|
|
155
|
+
["default-value", DEFAULT_VALUE_SPEC],
|
|
156
|
+
]);
|
|
157
|
+
function getFormatSpec(intent) {
|
|
158
|
+
return SPEC_MAP.get(intent);
|
|
159
|
+
}
|
|
160
|
+
function findRelevantLine(lines, pattern) {
|
|
161
|
+
for (const line of lines) {
|
|
162
|
+
if (pattern.test(line))
|
|
163
|
+
return line.trim();
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=format-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-spec.js","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/format-spec.ts"],"names":[],"mappings":";;AAoLA,sCAEC;AAtLD,qDAO4B;AAM5B,MAAM,mBAAmB,GAAG,IAAI,0BAAW,CAAC;IACxC,IAAA,sBAAO,EAAC,+BAA+B,CAAC;IACxC,IAAA,qBAAM,EAAC,CAAC,CAAC;IACT,IAAA,yBAAU,EAAC,KAAK,CAAC;IACjB,IAAA,qBAAM,EAAC,CAAC,CAAC;IACT,IAAA,sBAAO,EAAC,IAAI,CAAC;IACb,IAAA,qBAAM,EAAC,CAAC,CA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;IACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/C,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DescriptionIntentDetector } from "./intent-detector";
|
|
2
|
+
export { extractSlotsForIntent } from "./slot-extractor";
|
|
3
|
+
export { suggestNormalizedSentence } from "./normalizer";
|
|
4
|
+
export { getFormatSpec } from "./format-spec";
|
|
5
|
+
export { DESCRIPTION_INTENTS, DETECTABLE_DESCRIPTION_INTENTS, } from "./types";
|
|
6
|
+
export type { DescriptionIntent, DetectableDescriptionIntent, SlotMap, SlotValue, IntentResult, IntentDetectionResult, DetectionStatus, FormatValidationResult, DescriptionFormatSpec, } from "./types";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EACH,mBAAmB,EACnB,8BAA8B,GACjC,MAAM,SAAS,CAAC;AACjB,YAAY,EACR,iBAAiB,EACjB,2BAA2B,EAC3B,OAAO,EACP,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,GACxB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DETECTABLE_DESCRIPTION_INTENTS = exports.DESCRIPTION_INTENTS = exports.getFormatSpec = exports.suggestNormalizedSentence = exports.extractSlotsForIntent = exports.DescriptionIntentDetector = void 0;
|
|
4
|
+
var intent_detector_1 = require("./intent-detector");
|
|
5
|
+
Object.defineProperty(exports, "DescriptionIntentDetector", { enumerable: true, get: function () { return intent_detector_1.DescriptionIntentDetector; } });
|
|
6
|
+
var slot_extractor_1 = require("./slot-extractor");
|
|
7
|
+
Object.defineProperty(exports, "extractSlotsForIntent", { enumerable: true, get: function () { return slot_extractor_1.extractSlotsForIntent; } });
|
|
8
|
+
var normalizer_1 = require("./normalizer");
|
|
9
|
+
Object.defineProperty(exports, "suggestNormalizedSentence", { enumerable: true, get: function () { return normalizer_1.suggestNormalizedSentence; } });
|
|
10
|
+
var format_spec_1 = require("./format-spec");
|
|
11
|
+
Object.defineProperty(exports, "getFormatSpec", { enumerable: true, get: function () { return format_spec_1.getFormatSpec; } });
|
|
12
|
+
var types_1 = require("./types");
|
|
13
|
+
Object.defineProperty(exports, "DESCRIPTION_INTENTS", { enumerable: true, get: function () { return types_1.DESCRIPTION_INTENTS; } });
|
|
14
|
+
Object.defineProperty(exports, "DETECTABLE_DESCRIPTION_INTENTS", { enumerable: true, get: function () { return types_1.DETECTABLE_DESCRIPTION_INTENTS; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/index.ts"],"names":[],"mappings":";;;AAAA,qDAA8D;AAArD,4HAAA,yBAAyB,OAAA;AAClC,mDAAyD;AAAhD,uHAAA,qBAAqB,OAAA;AAC9B,2CAAyD;AAAhD,uHAAA,yBAAyB,OAAA;AAClC,6CAA8C;AAArC,4GAAA,aAAa,OAAA;AACtB,iCAGiB;AAFb,4GAAA,mBAAmB,OAAA;AACnB,uHAAA,8BAA8B,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
2
|
+
import { type IntentDetectionResult } from "./types";
|
|
3
|
+
export declare class DescriptionIntentDetector {
|
|
4
|
+
private readonly caller;
|
|
5
|
+
constructor(model: BaseChatModel);
|
|
6
|
+
detect(argName: string, text: string): Promise<IntentDetectionResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=intent-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-detector.d.ts","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/intent-detector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAGH,KAAK,qBAAqB,EAE7B,MAAM,SAAS,CAAC;AA6CjB,qBAAa,yBAAyB;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;gBAE9B,KAAK,EAAE,aAAa;IAInB,MAAM,CACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;CA+CpC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DescriptionIntentDetector = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const structured_caller_1 = require("../structured-caller");
|
|
6
|
+
const types_1 = require("./types");
|
|
7
|
+
const slot_extractor_1 = require("./slot-extractor");
|
|
8
|
+
const IntentItemSchema = zod_1.z.object({
|
|
9
|
+
name: zod_1.z.enum(types_1.DETECTABLE_DESCRIPTION_INTENTS),
|
|
10
|
+
confidence: zod_1.z.number().min(0).max(1),
|
|
11
|
+
evidenceSpan: zod_1.z.string().min(1),
|
|
12
|
+
});
|
|
13
|
+
const DetectionSchema = zod_1.z.object({
|
|
14
|
+
intents: zod_1.z.array(IntentItemSchema).default([]),
|
|
15
|
+
uncertain: zod_1.z.boolean().optional(),
|
|
16
|
+
reason: zod_1.z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
const SYSTEM_PROMPT = `You classify Terraform argument descriptions by semantic intent.
|
|
19
|
+
|
|
20
|
+
Return all matching intents (multi-label), not just one. Intents:
|
|
21
|
+
- "value-range": valid numeric range constraints
|
|
22
|
+
- "enum-values": finite allowed values list
|
|
23
|
+
- "char-restriction": allowed character classes/content restrictions
|
|
24
|
+
- "max-length": maximum length/character count constraints
|
|
25
|
+
- "default-value": explicit default value statement
|
|
26
|
+
|
|
27
|
+
Rules:
|
|
28
|
+
1) Output only intents directly supported by text.
|
|
29
|
+
2) If confidence is low, set uncertain=true.
|
|
30
|
+
3) evidenceSpan must quote the most relevant phrase from input.
|
|
31
|
+
4) If no intent matches, return intents=[].
|
|
32
|
+
5) Never invent values not present in input text.`;
|
|
33
|
+
const SUSPECTED_STANDARD_KEYWORDS = [
|
|
34
|
+
/\bvalid values?\b/i,
|
|
35
|
+
/\brange\b/i,
|
|
36
|
+
/\bmaximum\b/i,
|
|
37
|
+
/\bdefault\b/i,
|
|
38
|
+
/\bonly\b/i,
|
|
39
|
+
/\ballowed\b/i,
|
|
40
|
+
];
|
|
41
|
+
class DescriptionIntentDetector {
|
|
42
|
+
constructor(model) {
|
|
43
|
+
this.caller = new structured_caller_1.StructuredCaller(model, { maxRetries: 1 });
|
|
44
|
+
}
|
|
45
|
+
async detect(argName, text) {
|
|
46
|
+
const userPrompt = `Argument: \`${argName}\`\nDescription:\n${text}`;
|
|
47
|
+
const result = await this.caller.call(DetectionSchema, SYSTEM_PROMPT, userPrompt);
|
|
48
|
+
// console.log(result);
|
|
49
|
+
if (!result.ok) {
|
|
50
|
+
if (containsSuspiciousSignals(text)) {
|
|
51
|
+
return {
|
|
52
|
+
status: "suspected-standard-intent",
|
|
53
|
+
intents: [],
|
|
54
|
+
reason: "model_call_failed_with_suspected_signals",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return { status: "none", intents: [], reason: "model_call_failed" };
|
|
58
|
+
}
|
|
59
|
+
const normalized = dedupeIntents(result.data.intents, text);
|
|
60
|
+
if (normalized.length === 0) {
|
|
61
|
+
if (containsSuspiciousSignals(text)) {
|
|
62
|
+
return {
|
|
63
|
+
status: "suspected-standard-intent",
|
|
64
|
+
intents: [],
|
|
65
|
+
reason: "no_intent_but_suspected_signals",
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return { status: "none", intents: [] };
|
|
69
|
+
}
|
|
70
|
+
if (result.data.uncertain) {
|
|
71
|
+
return {
|
|
72
|
+
status: "uncertain",
|
|
73
|
+
intents: normalized,
|
|
74
|
+
reason: result.data.reason ?? "model_marked_uncertain",
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
status: "classified",
|
|
79
|
+
intents: normalized,
|
|
80
|
+
reason: result.data.reason,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.DescriptionIntentDetector = DescriptionIntentDetector;
|
|
85
|
+
function dedupeIntents(intents, text) {
|
|
86
|
+
const map = new Map();
|
|
87
|
+
for (const intent of intents) {
|
|
88
|
+
const slots = (0, slot_extractor_1.extractSlotsForIntent)(intent.name, text);
|
|
89
|
+
const next = {
|
|
90
|
+
...intent,
|
|
91
|
+
slots,
|
|
92
|
+
};
|
|
93
|
+
const prev = map.get(intent.name);
|
|
94
|
+
if (!prev || next.confidence > prev.confidence) {
|
|
95
|
+
map.set(intent.name, next);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return Array.from(map.values()).sort((a, b) => b.confidence - a.confidence);
|
|
99
|
+
}
|
|
100
|
+
function containsSuspiciousSignals(text) {
|
|
101
|
+
return SUSPECTED_STANDARD_KEYWORDS.some((pattern) => pattern.test(text));
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=intent-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent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E,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAA,sCAAqB,EAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvD,MAAM,IAAI,GAAiB;YACvB,GAAG,MAAM;YACT,KAAK;SACR,CAAC;QACF,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAY;IAC3C,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DetectableDescriptionIntent, SlotMap } from "./types";
|
|
2
|
+
export interface NormalizationSuggestion {
|
|
3
|
+
intent: DetectableDescriptionIntent;
|
|
4
|
+
template: string;
|
|
5
|
+
suggestion: string | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Best-effort formatter that suggests canonical sentences based on slots.
|
|
9
|
+
* It does not mutate source content and is safe to use as a hint provider.
|
|
10
|
+
*/
|
|
11
|
+
export declare function suggestNormalizedSentence(intent: DetectableDescriptionIntent, slots: SlotMap): NormalizationSuggestion;
|
|
12
|
+
//# sourceMappingURL=normalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/normalizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,2BAA2B,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,2BAA2B,EACnC,KAAK,EAAE,OAAO,GACf,uBAAuB,CAuCzB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.suggestNormalizedSentence = suggestNormalizedSentence;
|
|
4
|
+
/**
|
|
5
|
+
* Best-effort formatter that suggests canonical sentences based on slots.
|
|
6
|
+
* It does not mutate source content and is safe to use as a hint provider.
|
|
7
|
+
*/
|
|
8
|
+
function suggestNormalizedSentence(intent, slots) {
|
|
9
|
+
switch (intent) {
|
|
10
|
+
case "value-range":
|
|
11
|
+
return {
|
|
12
|
+
intent,
|
|
13
|
+
template: "The valid value is range from `min` to `max`.",
|
|
14
|
+
suggestion: buildRangeSuggestion(slots),
|
|
15
|
+
};
|
|
16
|
+
case "enum-values":
|
|
17
|
+
return {
|
|
18
|
+
intent,
|
|
19
|
+
template: "The valid values are as follow:",
|
|
20
|
+
suggestion: "The valid values are as follow:",
|
|
21
|
+
};
|
|
22
|
+
case "char-restriction":
|
|
23
|
+
return {
|
|
24
|
+
intent,
|
|
25
|
+
template: "Only the <char-types> are allowed",
|
|
26
|
+
suggestion: buildCharRestrictionSuggestion(slots),
|
|
27
|
+
};
|
|
28
|
+
case "max-length":
|
|
29
|
+
return {
|
|
30
|
+
intent,
|
|
31
|
+
template: "The <arg_name> contain a maximum of `N` characters.",
|
|
32
|
+
suggestion: buildMaxLengthSuggestion(slots),
|
|
33
|
+
};
|
|
34
|
+
case "default-value":
|
|
35
|
+
return {
|
|
36
|
+
intent,
|
|
37
|
+
template: "The default value is `value`.",
|
|
38
|
+
suggestion: buildDefaultValueSuggestion(slots),
|
|
39
|
+
};
|
|
40
|
+
default:
|
|
41
|
+
return {
|
|
42
|
+
intent,
|
|
43
|
+
template: "",
|
|
44
|
+
suggestion: null,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function buildRangeSuggestion(slots) {
|
|
49
|
+
const min = slots.min;
|
|
50
|
+
const max = slots.max;
|
|
51
|
+
if (!min || !max)
|
|
52
|
+
return null;
|
|
53
|
+
return `The valid value is range from \`${min}\` to \`${max}\`.`;
|
|
54
|
+
}
|
|
55
|
+
function buildCharRestrictionSuggestion(slots) {
|
|
56
|
+
const allowedChars = slots.allowedChars;
|
|
57
|
+
if (!allowedChars || typeof allowedChars !== "string")
|
|
58
|
+
return null;
|
|
59
|
+
return `Only the ${allowedChars} are allowed`;
|
|
60
|
+
}
|
|
61
|
+
function buildMaxLengthSuggestion(slots) {
|
|
62
|
+
const maxLength = slots.maxLength;
|
|
63
|
+
if (!maxLength)
|
|
64
|
+
return null;
|
|
65
|
+
return `The value contain a maximum of \`${maxLength}\` characters.`;
|
|
66
|
+
}
|
|
67
|
+
function buildDefaultValueSuggestion(slots) {
|
|
68
|
+
const defaultValue = slots.defaultValue;
|
|
69
|
+
if (!defaultValue)
|
|
70
|
+
return null;
|
|
71
|
+
return `The default value is \`${defaultValue}\`.`;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=normalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizer.js","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/normalizer.ts"],"names":[],"mappings":";;AAYA,8DA0CC;AA9CD;;;GAGG;AACH,SAAgB,yBAAyB,CACrC,MAAmC,EACnC,KAAc;IAEd,QAAQ,MAAM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C,KAAc;IAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,oCAAoC,SAAS,gBAAgB,CAAC;AACzE,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAc;IAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACxC,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,0BAA0B,YAAY,KAAK,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-extractor.d.ts","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/slot-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMpE,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,2BAA2B,EACnC,IAAI,EAAE,MAAM,GACb,OAAO,CAeT"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractSlotsForIntent = extractSlotsForIntent;
|
|
4
|
+
const BACKTICK_PAIR_REGEX = /`([^`]+)`\s+to\s+`([^`]+)`/i;
|
|
5
|
+
const MAX_LENGTH_REGEX = /maximum of `([^`]+)` characters/i;
|
|
6
|
+
const DEFAULT_VALUE_REGEX = /default value is `([^`]+)`/i;
|
|
7
|
+
function extractSlotsForIntent(intent, text) {
|
|
8
|
+
switch (intent) {
|
|
9
|
+
case "value-range":
|
|
10
|
+
return extractValueRangeSlots(text);
|
|
11
|
+
case "enum-values":
|
|
12
|
+
return extractEnumSlots(text);
|
|
13
|
+
case "char-restriction":
|
|
14
|
+
return extractCharRestrictionSlots(text);
|
|
15
|
+
case "max-length":
|
|
16
|
+
return extractMaxLengthSlots(text);
|
|
17
|
+
case "default-value":
|
|
18
|
+
return extractDefaultValueSlots(text);
|
|
19
|
+
default:
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function extractValueRangeSlots(text) {
|
|
24
|
+
const match = text.match(BACKTICK_PAIR_REGEX);
|
|
25
|
+
if (!match)
|
|
26
|
+
return {};
|
|
27
|
+
return {
|
|
28
|
+
min: match[1],
|
|
29
|
+
max: match[2],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function extractEnumSlots(text) {
|
|
33
|
+
const lines = text.split("\n").map((line) => line.trim());
|
|
34
|
+
const values = [];
|
|
35
|
+
for (const line of lines) {
|
|
36
|
+
const item = line.match(/^\+\s+\*\*([^*]+)\*\*:/);
|
|
37
|
+
if (item)
|
|
38
|
+
values.push(item[1].trim());
|
|
39
|
+
}
|
|
40
|
+
return values.length > 0 ? { valueSet: values } : {};
|
|
41
|
+
}
|
|
42
|
+
function extractCharRestrictionSlots(text) {
|
|
43
|
+
const match = text.match(/only the (.+?) are allowed/i);
|
|
44
|
+
if (!match)
|
|
45
|
+
return {};
|
|
46
|
+
return {
|
|
47
|
+
allowedChars: match[1].trim(),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function extractMaxLengthSlots(text) {
|
|
51
|
+
const match = text.match(MAX_LENGTH_REGEX);
|
|
52
|
+
if (!match)
|
|
53
|
+
return {};
|
|
54
|
+
return {
|
|
55
|
+
maxLength: match[1],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function extractDefaultValueSlots(text) {
|
|
59
|
+
const match = text.match(DEFAULT_VALUE_REGEX);
|
|
60
|
+
if (!match)
|
|
61
|
+
return {};
|
|
62
|
+
return {
|
|
63
|
+
defaultValue: match[1],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=slot-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-extractor.js","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/slot-extractor.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AAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACzD,CAAC;AAED,SAAS,2BAA2B,CAAC,IAAY;IAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACxD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO;QACH,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;KAChC,CAAC;AACN,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO;QACH,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;KACtB,CAAC;AACN,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO;QACH,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;KACzB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type DescriptionIntent = "value-range" | "enum-values" | "char-restriction" | "max-length" | "default-value" | "none";
|
|
2
|
+
export type DetectableDescriptionIntent = Exclude<DescriptionIntent, "none">;
|
|
3
|
+
export declare const DESCRIPTION_INTENTS: DescriptionIntent[];
|
|
4
|
+
export declare const DETECTABLE_DESCRIPTION_INTENTS: DetectableDescriptionIntent[];
|
|
5
|
+
export type SlotValue = string | number | boolean | string[];
|
|
6
|
+
export type SlotMap = Record<string, SlotValue>;
|
|
7
|
+
export interface IntentResult {
|
|
8
|
+
name: DetectableDescriptionIntent;
|
|
9
|
+
confidence: number;
|
|
10
|
+
evidenceSpan: string;
|
|
11
|
+
slots?: SlotMap;
|
|
12
|
+
}
|
|
13
|
+
export type DetectionStatus = "classified" | "none" | "uncertain" | "suspected-standard-intent";
|
|
14
|
+
export interface IntentDetectionResult {
|
|
15
|
+
status: DetectionStatus;
|
|
16
|
+
intents: IntentResult[];
|
|
17
|
+
reason?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FormatValidationResult {
|
|
20
|
+
ok: boolean;
|
|
21
|
+
expected: string;
|
|
22
|
+
detail?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DescriptionFormatSpec {
|
|
25
|
+
intent: DetectableDescriptionIntent;
|
|
26
|
+
validate: (lines: string[]) => FormatValidationResult;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACvB,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,MAAM,CAAC;AAEb,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAE7E,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAOlD,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,2BAA2B,EAMvE,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEhD,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,2BAA2B,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GACrB,YAAY,GACZ,MAAM,GACN,WAAW,GACX,2BAA2B,CAAC;AAElC,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,2BAA2B,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,sBAAsB,CAAC;CACzD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DETECTABLE_DESCRIPTION_INTENTS = exports.DESCRIPTION_INTENTS = void 0;
|
|
4
|
+
exports.DESCRIPTION_INTENTS = [
|
|
5
|
+
"value-range",
|
|
6
|
+
"enum-values",
|
|
7
|
+
"char-restriction",
|
|
8
|
+
"max-length",
|
|
9
|
+
"default-value",
|
|
10
|
+
"none",
|
|
11
|
+
];
|
|
12
|
+
exports.DETECTABLE_DESCRIPTION_INTENTS = [
|
|
13
|
+
"value-range",
|
|
14
|
+
"enum-values",
|
|
15
|
+
"char-restriction",
|
|
16
|
+
"max-length",
|
|
17
|
+
"default-value",
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/llm/description-intent/types.ts"],"names":[],"mappings":";;;AAUa,QAAA,mBAAmB,GAAwB;IACpD,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,eAAe;IACf,MAAM;CACT,CAAC;AAEW,QAAA,8BAA8B,GAAkC;IACzE,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,eAAe;CAClB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Tool Module
|
|
3
|
+
*
|
|
4
|
+
* Provides structured LLM calling with automatic schema validation
|
|
5
|
+
* and retry logic. Analogous to RegexGrep for text search —
|
|
6
|
+
* StructuredCaller takes a prompt + Zod schema and returns a
|
|
7
|
+
* type-safe, validated object.
|
|
8
|
+
*
|
|
9
|
+
* @module tools/llm
|
|
10
|
+
*/
|
|
11
|
+
export { StructuredCaller, extractJson } from "./structured-caller";
|
|
12
|
+
export { createModel } from "./model";
|
|
13
|
+
export type { StructuredCallerOptions, StructuredCallResult, StructuredCallSuccess, StructuredCallFailure, } from "./structured-caller";
|
|
14
|
+
export { DescriptionIntentDetector, extractSlotsForIntent, suggestNormalizedSentence, getFormatSpec, DESCRIPTION_INTENTS, DETECTABLE_DESCRIPTION_INTENTS, } from "./description-intent";
|
|
15
|
+
export type { DescriptionIntent, DetectableDescriptionIntent, SlotMap, SlotValue, IntentResult, IntentDetectionResult, DetectionStatus, FormatValidationResult, DescriptionFormatSpec, } from "./description-intent";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/llm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EACR,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,GACjC,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACR,iBAAiB,EACjB,2BAA2B,EAC3B,OAAO,EACP,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,GACxB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LLM Tool Module
|
|
4
|
+
*
|
|
5
|
+
* Provides structured LLM calling with automatic schema validation
|
|
6
|
+
* and retry logic. Analogous to RegexGrep for text search —
|
|
7
|
+
* StructuredCaller takes a prompt + Zod schema and returns a
|
|
8
|
+
* type-safe, validated object.
|
|
9
|
+
*
|
|
10
|
+
* @module tools/llm
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.DETECTABLE_DESCRIPTION_INTENTS = exports.DESCRIPTION_INTENTS = exports.getFormatSpec = exports.suggestNormalizedSentence = exports.extractSlotsForIntent = exports.DescriptionIntentDetector = exports.createModel = exports.extractJson = exports.StructuredCaller = void 0;
|
|
14
|
+
var structured_caller_1 = require("./structured-caller");
|
|
15
|
+
Object.defineProperty(exports, "StructuredCaller", { enumerable: true, get: function () { return structured_caller_1.StructuredCaller; } });
|
|
16
|
+
Object.defineProperty(exports, "extractJson", { enumerable: true, get: function () { return structured_caller_1.extractJson; } });
|
|
17
|
+
var model_1 = require("./model");
|
|
18
|
+
Object.defineProperty(exports, "createModel", { enumerable: true, get: function () { return model_1.createModel; } });
|
|
19
|
+
var description_intent_1 = require("./description-intent");
|
|
20
|
+
Object.defineProperty(exports, "DescriptionIntentDetector", { enumerable: true, get: function () { return description_intent_1.DescriptionIntentDetector; } });
|
|
21
|
+
Object.defineProperty(exports, "extractSlotsForIntent", { enumerable: true, get: function () { return description_intent_1.extractSlotsForIntent; } });
|
|
22
|
+
Object.defineProperty(exports, "suggestNormalizedSentence", { enumerable: true, get: function () { return description_intent_1.suggestNormalizedSentence; } });
|
|
23
|
+
Object.defineProperty(exports, "getFormatSpec", { enumerable: true, get: function () { return description_intent_1.getFormatSpec; } });
|
|
24
|
+
Object.defineProperty(exports, "DESCRIPTION_INTENTS", { enumerable: true, get: function () { return description_intent_1.DESCRIPTION_INTENTS; } });
|
|
25
|
+
Object.defineProperty(exports, "DETECTABLE_DESCRIPTION_INTENTS", { enumerable: true, get: function () { return description_intent_1.DETECTABLE_DESCRIPTION_INTENTS; } });
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/llm/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,yDAAoE;AAA3D,qHAAA,gBAAgB,OAAA;AAAE,gHAAA,WAAW,OAAA;AACtC,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AAQpB,2DAO8B;AAN1B,+HAAA,yBAAyB,OAAA;AACzB,2HAAA,qBAAqB,OAAA;AACrB,+HAAA,yBAAyB,OAAA;AACzB,mHAAA,aAAa,OAAA;AACb,yHAAA,mBAAmB,OAAA;AACnB,oIAAA,8BAA8B,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/tools/llm/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,wBAAgB,WAAW,CACvB,SAAS,GAAE,MAA8C,EACzD,WAAW,GAAE,MAAY,EACzB,SAAS,GAAE,OAAe,EAC1B,OAAO,GAAE,MAA6C,EACtD,MAAM,GAAE,MAA4C,GACrD,UAAU,CAUZ"}
|