@decaf-ts/mcp-server 0.4.2 → 0.4.6
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/LICENSE.md +31 -0
- package/dist/mcp-server.cjs +2 -2360
- package/dist/mcp-server.cjs.map +1 -0
- package/dist/mcp-server.js +2 -0
- package/dist/mcp-server.js.map +1 -0
- package/lib/bin/cli.cjs +7 -35
- package/lib/bin/cli.js.map +1 -0
- package/lib/builders/builder.cjs +91 -0
- package/lib/builders/builder.d.ts +25 -0
- package/lib/builders/builder.js.map +1 -0
- package/lib/{mcp/resources → builders}/index.cjs +5 -2
- package/lib/builders/index.d.ts +4 -0
- package/lib/builders/index.js.map +1 -0
- package/lib/builders/prompt-builder.cjs +76 -0
- package/lib/builders/prompt-builder.d.ts +12 -0
- package/lib/builders/prompt-builder.js.map +1 -0
- package/lib/builders/resource-builder.cjs +83 -0
- package/lib/builders/resource-builder.d.ts +14 -0
- package/lib/builders/resource-builder.js.map +1 -0
- package/lib/builders/tool-builder.cjs +104 -0
- package/lib/builders/tool-builder.d.ts +16 -0
- package/lib/builders/tool-builder.js.map +1 -0
- package/lib/constants.cjs +28 -30
- package/lib/constants.d.ts +19 -24
- package/lib/constants.js.map +1 -0
- package/lib/environment.cjs +32 -0
- package/lib/environment.d.ts +71 -0
- package/lib/environment.js.map +1 -0
- package/lib/esm/bin/cli.js +7 -35
- package/lib/esm/bin/cli.js.map +1 -0
- package/lib/esm/builders/builder.d.ts +25 -0
- package/lib/esm/builders/builder.js +86 -0
- package/lib/esm/builders/builder.js.map +1 -0
- package/lib/esm/builders/index.d.ts +4 -0
- package/lib/esm/builders/index.js +5 -0
- package/lib/esm/builders/index.js.map +1 -0
- package/lib/esm/builders/prompt-builder.d.ts +12 -0
- package/lib/esm/builders/prompt-builder.js +72 -0
- package/lib/esm/builders/prompt-builder.js.map +1 -0
- package/lib/esm/builders/resource-builder.d.ts +14 -0
- package/lib/esm/builders/resource-builder.js +79 -0
- package/lib/esm/builders/resource-builder.js.map +1 -0
- package/lib/esm/builders/tool-builder.d.ts +16 -0
- package/lib/esm/builders/tool-builder.js +100 -0
- package/lib/esm/builders/tool-builder.js.map +1 -0
- package/lib/esm/constants.d.ts +19 -24
- package/lib/esm/constants.js +27 -29
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/environment.d.ts +71 -0
- package/lib/esm/environment.js +29 -0
- package/lib/esm/environment.js.map +1 -0
- package/lib/esm/index.d.ts +3 -10
- package/lib/esm/index.js +4 -11
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/mcp-server.d.ts +10 -0
- package/lib/esm/mcp-server.js +189 -0
- package/lib/esm/mcp-server.js.map +1 -0
- package/lib/esm/modules/template-module/index.d.ts +6 -0
- package/lib/esm/modules/template-module/index.js +4 -0
- package/lib/esm/modules/template-module/index.js.map +1 -0
- package/lib/esm/prompts/code/constants.d.ts +1 -0
- package/lib/esm/prompts/code/constants.js +2 -0
- package/lib/esm/prompts/code/constants.js.map +1 -0
- package/lib/esm/prompts/code/design-patterns/builder.d.ts +2 -0
- package/lib/esm/prompts/code/design-patterns/builder.js +118 -0
- package/lib/esm/prompts/code/design-patterns/builder.js.map +1 -0
- package/lib/esm/prompts/code/design-patterns/constants.d.ts +1 -0
- package/lib/esm/prompts/code/design-patterns/constants.js +3 -0
- package/lib/esm/prompts/code/design-patterns/constants.js.map +1 -0
- package/lib/esm/prompts/example-prompt/index.d.ts +2 -0
- package/lib/esm/prompts/example-prompt/index.js +18 -0
- package/lib/esm/prompts/example-prompt/index.js.map +1 -0
- package/lib/esm/prompts/index.d.ts +2 -0
- package/lib/esm/prompts/index.js +26 -0
- package/lib/esm/prompts/index.js.map +1 -0
- package/lib/esm/prompts/interactive-jsdoc/index.d.ts +2 -0
- package/lib/esm/prompts/interactive-jsdoc/index.js +18 -0
- package/lib/esm/prompts/interactive-jsdoc/index.js.map +1 -0
- package/lib/esm/prompts/jsdocs/class-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/class-prompt.js +52 -0
- package/lib/esm/prompts/jsdocs/class-prompt.js.map +1 -0
- package/lib/esm/prompts/jsdocs/const-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/const-prompt.js +24 -0
- package/lib/esm/prompts/jsdocs/const-prompt.js.map +1 -0
- package/lib/esm/prompts/jsdocs/constants.d.ts +4 -0
- package/lib/esm/prompts/jsdocs/constants.js +46 -0
- package/lib/esm/prompts/jsdocs/constants.js.map +1 -0
- package/lib/esm/prompts/jsdocs/decorator-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/decorator-prompt.js +42 -0
- package/lib/esm/prompts/jsdocs/decorator-prompt.js.map +1 -0
- package/lib/esm/prompts/jsdocs/enum-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/enum-prompt.js +24 -0
- package/lib/esm/prompts/jsdocs/enum-prompt.js.map +1 -0
- package/lib/esm/prompts/jsdocs/function-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/function-prompt.js +43 -0
- package/lib/esm/prompts/jsdocs/function-prompt.js.map +1 -0
- package/lib/esm/prompts/jsdocs/interface-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/interface-prompt.js +24 -0
- package/lib/esm/prompts/jsdocs/interface-prompt.js.map +1 -0
- package/lib/esm/prompts/jsdocs/types-prompt.d.ts +2 -0
- package/lib/esm/prompts/jsdocs/types-prompt.js +24 -0
- package/lib/esm/prompts/jsdocs/types-prompt.js.map +1 -0
- package/lib/esm/resources/example-resource/index.d.ts +2 -0
- package/lib/esm/resources/example-resource/index.js +19 -0
- package/lib/esm/resources/example-resource/index.js.map +1 -0
- package/lib/esm/resources/index.d.ts +2 -0
- package/lib/esm/resources/index.js +4 -0
- package/lib/esm/resources/index.js.map +1 -0
- package/lib/esm/resources/repo-metadata/index.d.ts +2 -0
- package/lib/esm/resources/repo-metadata/index.js +25 -0
- package/lib/esm/resources/repo-metadata/index.js.map +1 -0
- package/lib/esm/tools/ast/ts-ast-tool.d.ts +2 -0
- package/lib/esm/tools/ast/ts-ast-tool.js +67 -0
- package/lib/esm/tools/ast/ts-ast-tool.js.map +1 -0
- package/lib/esm/tools/ast/types.d.ts +105 -0
- package/lib/esm/tools/ast/types.js +33 -0
- package/lib/esm/tools/ast/types.js.map +1 -0
- package/lib/esm/tools/ast/utils.d.ts +5 -0
- package/lib/esm/tools/ast/utils.js +58 -0
- package/lib/esm/tools/ast/utils.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/apply.d.ts +6 -0
- package/lib/esm/tools/ast-jsdoc-tools/apply.js +29 -0
- package/lib/esm/tools/ast-jsdoc-tools/apply.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/cli.js +33 -0
- package/lib/esm/tools/ast-jsdoc-tools/cli.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/enumerator.d.ts +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/enumerator.js +25 -0
- package/lib/esm/tools/ast-jsdoc-tools/enumerator.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/fileRunner.d.ts +11 -0
- package/lib/esm/tools/ast-jsdoc-tools/fileRunner.js +29 -0
- package/lib/esm/tools/ast-jsdoc-tools/fileRunner.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/formatter.d.ts +6 -0
- package/lib/esm/tools/ast-jsdoc-tools/formatter.js +18 -0
- package/lib/esm/tools/ast-jsdoc-tools/formatter.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/generator.d.ts +12 -0
- package/lib/esm/tools/ast-jsdoc-tools/generator.js +55 -0
- package/lib/esm/tools/ast-jsdoc-tools/generator.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/index.d.ts +7 -0
- package/lib/esm/tools/ast-jsdoc-tools/index.js +29 -0
- package/lib/esm/tools/ast-jsdoc-tools/index.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/interactive.d.ts +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/interactive.js +7 -0
- package/lib/esm/tools/ast-jsdoc-tools/interactive.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/parser.d.ts +13 -0
- package/lib/esm/tools/ast-jsdoc-tools/parser.js +71 -0
- package/lib/esm/tools/ast-jsdoc-tools/parser.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/patch.d.ts +2 -0
- package/lib/esm/tools/ast-jsdoc-tools/patch.js +23 -0
- package/lib/esm/tools/ast-jsdoc-tools/patch.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/prompts/loader.d.ts +10 -0
- package/lib/esm/tools/ast-jsdoc-tools/prompts/loader.js +26 -0
- package/lib/esm/tools/ast-jsdoc-tools/prompts/loader.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/repoRunner.d.ts +16 -0
- package/lib/esm/tools/ast-jsdoc-tools/repoRunner.js +61 -0
- package/lib/esm/tools/ast-jsdoc-tools/repoRunner.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/tools/jsdoc-generator.d.ts +5 -0
- package/lib/esm/tools/ast-jsdoc-tools/tools/jsdoc-generator.js +78 -0
- package/lib/esm/tools/ast-jsdoc-tools/tools/jsdoc-generator.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/conflict-detector.d.ts +5 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/conflict-detector.js +30 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/conflict-detector.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/context-schema.d.ts +7 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/context-schema.js +29 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/context-schema.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/heuristics.d.ts +2 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/heuristics.js +31 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/heuristics.js.map +1 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/ts-project.d.ts +12 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/ts-project.js +21 -0
- package/lib/esm/tools/ast-jsdoc-tools/utils/ts-project.js.map +1 -0
- package/lib/esm/tools/example-tool/index.d.ts +2 -0
- package/lib/esm/tools/example-tool/index.js +29 -0
- package/lib/esm/tools/example-tool/index.js.map +1 -0
- package/lib/esm/tools/file-summarizer/index.d.ts +2 -0
- package/lib/esm/tools/file-summarizer/index.js +29 -0
- package/lib/esm/tools/file-summarizer/index.js.map +1 -0
- package/lib/esm/tools/index.d.ts +2 -0
- package/lib/esm/tools/index.js +6 -0
- package/lib/esm/tools/index.js.map +1 -0
- package/lib/esm/tools/jsdoc/ts-jsdoc-element-tool.d.ts +2 -0
- package/lib/esm/tools/jsdoc/ts-jsdoc-element-tool.js +84 -0
- package/lib/esm/tools/jsdoc/ts-jsdoc-element-tool.js.map +1 -0
- package/lib/esm/tools/jsdoc/utils.d.ts +5 -0
- package/lib/esm/tools/jsdoc/utils.js +53 -0
- package/lib/esm/tools/jsdoc/utils.js.map +1 -0
- package/lib/esm/tools/testing/ts-jest-list-tests.d.ts +2 -0
- package/lib/esm/tools/testing/ts-jest-list-tests.js +53 -0
- package/lib/esm/tools/testing/ts-jest-list-tests.js.map +1 -0
- package/lib/esm/types.d.ts +56 -47
- package/lib/esm/types.js +1 -1
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/utils/banner.d.ts +3 -0
- package/lib/esm/utils/banner.js +107 -0
- package/lib/esm/utils/banner.js.map +1 -0
- package/lib/esm/version.d.ts +2 -0
- package/lib/esm/version.js +5 -0
- package/lib/esm/version.js.map +1 -0
- package/lib/index.cjs +4 -11
- package/lib/index.d.ts +3 -10
- package/lib/index.js.map +1 -0
- package/lib/mcp-server.cjs +226 -0
- package/lib/mcp-server.d.ts +10 -0
- package/lib/mcp-server.js.map +1 -0
- package/lib/modules/template-module/index.cjs +7 -0
- package/lib/modules/template-module/index.d.ts +6 -0
- package/lib/modules/template-module/index.js.map +1 -0
- package/lib/prompts/code/constants.cjs +5 -0
- package/lib/prompts/code/constants.d.ts +1 -0
- package/lib/prompts/code/constants.js.map +1 -0
- package/lib/prompts/code/design-patterns/builder.cjs +121 -0
- package/lib/prompts/code/design-patterns/builder.d.ts +2 -0
- package/lib/prompts/code/design-patterns/builder.js.map +1 -0
- package/lib/prompts/code/design-patterns/constants.cjs +6 -0
- package/lib/prompts/code/design-patterns/constants.d.ts +1 -0
- package/lib/prompts/code/design-patterns/constants.js.map +1 -0
- package/lib/prompts/example-prompt/index.cjs +21 -0
- package/lib/prompts/example-prompt/index.d.ts +2 -0
- package/lib/prompts/example-prompt/index.js.map +1 -0
- package/lib/prompts/index.cjs +29 -0
- package/lib/prompts/index.d.ts +2 -0
- package/lib/prompts/index.js.map +1 -0
- package/lib/prompts/interactive-jsdoc/index.cjs +21 -0
- package/lib/prompts/interactive-jsdoc/index.d.ts +2 -0
- package/lib/prompts/interactive-jsdoc/index.js.map +1 -0
- package/lib/prompts/jsdocs/class-prompt.cjs +55 -0
- package/lib/prompts/jsdocs/class-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/class-prompt.js.map +1 -0
- package/lib/prompts/jsdocs/const-prompt.cjs +27 -0
- package/lib/prompts/jsdocs/const-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/const-prompt.js.map +1 -0
- package/lib/prompts/jsdocs/constants.cjs +49 -0
- package/lib/prompts/jsdocs/constants.d.ts +4 -0
- package/lib/prompts/jsdocs/constants.js.map +1 -0
- package/lib/prompts/jsdocs/decorator-prompt.cjs +45 -0
- package/lib/prompts/jsdocs/decorator-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/decorator-prompt.js.map +1 -0
- package/lib/prompts/jsdocs/enum-prompt.cjs +27 -0
- package/lib/prompts/jsdocs/enum-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/enum-prompt.js.map +1 -0
- package/lib/prompts/jsdocs/function-prompt.cjs +46 -0
- package/lib/prompts/jsdocs/function-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/function-prompt.js.map +1 -0
- package/lib/prompts/jsdocs/interface-prompt.cjs +27 -0
- package/lib/prompts/jsdocs/interface-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/interface-prompt.js.map +1 -0
- package/lib/prompts/jsdocs/types-prompt.cjs +27 -0
- package/lib/prompts/jsdocs/types-prompt.d.ts +2 -0
- package/lib/prompts/jsdocs/types-prompt.js.map +1 -0
- package/lib/resources/example-resource/index.cjs +22 -0
- package/lib/resources/example-resource/index.d.ts +2 -0
- package/lib/resources/example-resource/index.js.map +1 -0
- package/lib/resources/index.cjs +7 -0
- package/lib/resources/index.d.ts +2 -0
- package/lib/resources/index.js.map +1 -0
- package/lib/resources/repo-metadata/index.cjs +28 -0
- package/lib/resources/repo-metadata/index.d.ts +2 -0
- package/lib/resources/repo-metadata/index.js.map +1 -0
- package/lib/tools/ast/ts-ast-tool.cjs +70 -0
- package/lib/tools/ast/ts-ast-tool.d.ts +2 -0
- package/lib/tools/ast/ts-ast-tool.js.map +1 -0
- package/lib/tools/ast/types.cjs +36 -0
- package/lib/tools/ast/types.d.ts +105 -0
- package/lib/tools/ast/types.js.map +1 -0
- package/lib/tools/ast/utils.cjs +65 -0
- package/lib/tools/ast/utils.d.ts +5 -0
- package/lib/tools/ast/utils.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/apply.cjs +36 -0
- package/lib/tools/ast-jsdoc-tools/apply.d.ts +6 -0
- package/lib/tools/ast-jsdoc-tools/apply.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/cli.cjs +38 -0
- package/lib/tools/ast-jsdoc-tools/cli.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/enumerator.cjs +31 -0
- package/lib/tools/ast-jsdoc-tools/enumerator.d.ts +1 -0
- package/lib/tools/ast-jsdoc-tools/enumerator.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/fileRunner.cjs +35 -0
- package/lib/tools/ast-jsdoc-tools/fileRunner.d.ts +11 -0
- package/lib/tools/ast-jsdoc-tools/fileRunner.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/formatter.cjs +21 -0
- package/lib/tools/ast-jsdoc-tools/formatter.d.ts +6 -0
- package/lib/tools/ast-jsdoc-tools/formatter.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/generator.cjs +58 -0
- package/lib/tools/ast-jsdoc-tools/generator.d.ts +12 -0
- package/lib/tools/ast-jsdoc-tools/generator.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/index.cjs +33 -0
- package/lib/tools/ast-jsdoc-tools/index.d.ts +7 -0
- package/lib/tools/ast-jsdoc-tools/index.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/interactive.cjs +10 -0
- package/lib/tools/ast-jsdoc-tools/interactive.d.ts +1 -0
- package/lib/tools/ast-jsdoc-tools/interactive.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/parser.cjs +77 -0
- package/lib/tools/ast-jsdoc-tools/parser.d.ts +13 -0
- package/lib/tools/ast-jsdoc-tools/parser.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/patch.cjs +29 -0
- package/lib/tools/ast-jsdoc-tools/patch.d.ts +2 -0
- package/lib/tools/ast-jsdoc-tools/patch.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/prompts/loader.cjs +32 -0
- package/lib/tools/ast-jsdoc-tools/prompts/loader.d.ts +10 -0
- package/lib/tools/ast-jsdoc-tools/prompts/loader.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/repoRunner.cjs +67 -0
- package/lib/tools/ast-jsdoc-tools/repoRunner.d.ts +16 -0
- package/lib/tools/ast-jsdoc-tools/repoRunner.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/tools/jsdoc-generator.cjs +81 -0
- package/lib/tools/ast-jsdoc-tools/tools/jsdoc-generator.d.ts +5 -0
- package/lib/tools/ast-jsdoc-tools/tools/jsdoc-generator.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/utils/conflict-detector.cjs +33 -0
- package/lib/tools/ast-jsdoc-tools/utils/conflict-detector.d.ts +5 -0
- package/lib/tools/ast-jsdoc-tools/utils/conflict-detector.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/utils/context-schema.cjs +32 -0
- package/lib/tools/ast-jsdoc-tools/utils/context-schema.d.ts +7 -0
- package/lib/tools/ast-jsdoc-tools/utils/context-schema.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/utils/heuristics.cjs +34 -0
- package/lib/tools/ast-jsdoc-tools/utils/heuristics.d.ts +2 -0
- package/lib/tools/ast-jsdoc-tools/utils/heuristics.js.map +1 -0
- package/lib/tools/ast-jsdoc-tools/utils/ts-project.cjs +57 -0
- package/lib/tools/ast-jsdoc-tools/utils/ts-project.d.ts +12 -0
- package/lib/tools/ast-jsdoc-tools/utils/ts-project.js.map +1 -0
- package/lib/tools/example-tool/index.cjs +32 -0
- package/lib/tools/example-tool/index.d.ts +2 -0
- package/lib/tools/example-tool/index.js.map +1 -0
- package/lib/tools/file-summarizer/index.cjs +32 -0
- package/lib/tools/file-summarizer/index.d.ts +2 -0
- package/lib/tools/file-summarizer/index.js.map +1 -0
- package/lib/tools/index.cjs +9 -0
- package/lib/tools/index.d.ts +2 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/tools/jsdoc/ts-jsdoc-element-tool.cjs +87 -0
- package/lib/tools/jsdoc/ts-jsdoc-element-tool.d.ts +2 -0
- package/lib/tools/jsdoc/ts-jsdoc-element-tool.js.map +1 -0
- package/lib/tools/jsdoc/utils.cjs +60 -0
- package/lib/tools/jsdoc/utils.d.ts +5 -0
- package/lib/tools/jsdoc/utils.js.map +1 -0
- package/lib/tools/testing/ts-jest-list-tests.cjs +56 -0
- package/lib/tools/testing/ts-jest-list-tests.d.ts +2 -0
- package/lib/tools/testing/ts-jest-list-tests.js.map +1 -0
- package/lib/types.cjs +1 -1
- package/lib/types.d.ts +56 -47
- package/lib/types.js.map +1 -0
- package/lib/utils/banner.cjs +114 -0
- package/lib/utils/banner.d.ts +3 -0
- package/lib/utils/banner.js.map +1 -0
- package/lib/version.cjs +8 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.js.map +1 -0
- package/package.json +14 -63
- package/dist/mcp-server.esm.cjs +0 -2314
- package/lib/McpWrapper.cjs +0 -233
- package/lib/McpWrapper.d.ts +0 -89
- package/lib/bin/validate-modules.cjs +0 -24
- package/lib/esm/McpWrapper.d.ts +0 -89
- package/lib/esm/McpWrapper.js +0 -196
- package/lib/esm/bin/validate-modules.js +0 -22
- package/lib/esm/mcp/aggregateModules.d.ts +0 -26
- package/lib/esm/mcp/aggregateModules.js +0 -185
- package/lib/esm/mcp/code.d.ts +0 -23
- package/lib/esm/mcp/code.js +0 -70
- package/lib/esm/mcp/decorator-tools.d.ts +0 -118
- package/lib/esm/mcp/decorator-tools.js +0 -237
- package/lib/esm/mcp/fastmcp-wiring.d.ts +0 -14
- package/lib/esm/mcp/fastmcp-wiring.js +0 -56
- package/lib/esm/mcp/index.d.ts +0 -9
- package/lib/esm/mcp/index.js +0 -29
- package/lib/esm/mcp/mcp-module.d.ts +0 -11
- package/lib/esm/mcp/mcp-module.js +0 -31
- package/lib/esm/mcp/moduleRegistry.d.ts +0 -14
- package/lib/esm/mcp/moduleRegistry.js +0 -47
- package/lib/esm/mcp/prompts/index.d.ts +0 -4
- package/lib/esm/mcp/prompts/index.js +0 -7
- package/lib/esm/mcp/prompts/prompts.d.ts +0 -22
- package/lib/esm/mcp/prompts/prompts.js +0 -203
- package/lib/esm/mcp/resources/index.d.ts +0 -1
- package/lib/esm/mcp/resources/index.js +0 -2
- package/lib/esm/mcp/resources/resources.d.ts +0 -2
- package/lib/esm/mcp/resources/resources.js +0 -69
- package/lib/esm/mcp/schemas.d.ts +0 -53
- package/lib/esm/mcp/schemas.js +0 -97
- package/lib/esm/mcp/templates/codex-templates.d.ts +0 -3
- package/lib/esm/mcp/templates/codex-templates.js +0 -33
- package/lib/esm/mcp/templates/index.d.ts +0 -71
- package/lib/esm/mcp/templates/index.js +0 -66
- package/lib/esm/mcp/templates/resource-templates.d.ts +0 -3
- package/lib/esm/mcp/templates/resource-templates.js +0 -60
- package/lib/esm/mcp/templates/workspace-templates.d.ts +0 -3
- package/lib/esm/mcp/templates/workspace-templates.js +0 -66
- package/lib/esm/mcp/tools/codex-tools.d.ts +0 -5
- package/lib/esm/mcp/tools/codex-tools.js +0 -244
- package/lib/esm/mcp/tools/generateMcpModule.d.ts +0 -9
- package/lib/esm/mcp/tools/generateMcpModule.js +0 -133
- package/lib/esm/mcp/tools/index.d.ts +0 -219
- package/lib/esm/mcp/tools/index.js +0 -27
- package/lib/esm/mcp/tools/tools.d.ts +0 -10
- package/lib/esm/mcp/tools/tools.js +0 -275
- package/lib/esm/mcp/types.d.ts +0 -66
- package/lib/esm/mcp/types.js +0 -2
- package/lib/esm/mcp/utils.d.ts +0 -3
- package/lib/esm/mcp/utils.js +0 -46
- package/lib/esm/mcp/validation/index.d.ts +0 -13
- package/lib/esm/mcp/validation/index.js +0 -116
- package/lib/esm/mcp/validation/scaffoldModule.d.ts +0 -9
- package/lib/esm/mcp/validation/scaffoldModule.js +0 -88
- package/lib/esm/mcp/workspace.d.ts +0 -9
- package/lib/esm/mcp/workspace.js +0 -73
- package/lib/esm/metadata.d.ts +0 -9
- package/lib/esm/metadata.js +0 -22
- package/lib/esm/modules/_template/index.d.ts +0 -32
- package/lib/esm/modules/_template/index.js +0 -16
- package/lib/esm/modules/_template/prompts/index.d.ts +0 -6
- package/lib/esm/modules/_template/prompts/index.js +0 -9
- package/lib/esm/modules/_template/resources/index.d.ts +0 -6
- package/lib/esm/modules/_template/resources/index.js +0 -9
- package/lib/esm/modules/_template/templates/index.d.ts +0 -7
- package/lib/esm/modules/_template/templates/index.js +0 -10
- package/lib/esm/modules/_template/tools/index.d.ts +0 -6
- package/lib/esm/modules/_template/tools/index.js +0 -15
- package/lib/esm/modules/decoration/index.d.ts +0 -46
- package/lib/esm/modules/decoration/index.js +0 -10
- package/lib/esm/modules/decoration/prompts/index.d.ts +0 -1
- package/lib/esm/modules/decoration/prompts/index.js +0 -2
- package/lib/esm/modules/decoration/resources/index.d.ts +0 -7
- package/lib/esm/modules/decoration/resources/index.js +0 -10
- package/lib/esm/modules/decoration/templates/index.d.ts +0 -6
- package/lib/esm/modules/decoration/templates/index.js +0 -9
- package/lib/esm/modules/decoration/tools/index.d.ts +0 -26
- package/lib/esm/modules/decoration/tools/index.js +0 -7
- package/lib/esm/modules/index.d.ts +0 -2
- package/lib/esm/modules/index.js +0 -17
- package/lib/esm/modules/mcp/decoration-assist.d.ts +0 -4
- package/lib/esm/modules/mcp/decoration-assist.js +0 -6
- package/lib/esm/modules/mcp/index.d.ts +0 -6
- package/lib/esm/modules/mcp/index.js +0 -16
- package/lib/esm/modules/mcp/prompts/index.d.ts +0 -2
- package/lib/esm/modules/mcp/prompts/index.js +0 -9
- package/lib/esm/modules/mcp/resources/index.d.ts +0 -2
- package/lib/esm/modules/mcp/resources/index.js +0 -24
- package/lib/esm/modules/mcp/templates/index.d.ts +0 -2
- package/lib/esm/modules/mcp/templates/index.js +0 -28
- package/lib/esm/modules/mcp/tools/index.d.ts +0 -6
- package/lib/esm/modules/mcp/tools/index.js +0 -15
- package/lib/esm/utils/modulePaths.d.ts +0 -6
- package/lib/esm/utils/modulePaths.js +0 -33
- package/lib/esm/utils/moduleValidator.d.ts +0 -14
- package/lib/esm/utils/moduleValidator.js +0 -176
- package/lib/esm/utils.d.ts +0 -61
- package/lib/esm/utils.js +0 -86
- package/lib/mcp/aggregateModules.cjs +0 -225
- package/lib/mcp/aggregateModules.d.ts +0 -26
- package/lib/mcp/code.cjs +0 -81
- package/lib/mcp/code.d.ts +0 -23
- package/lib/mcp/decorator-tools.cjs +0 -243
- package/lib/mcp/decorator-tools.d.ts +0 -118
- package/lib/mcp/fastmcp-wiring.cjs +0 -59
- package/lib/mcp/fastmcp-wiring.d.ts +0 -14
- package/lib/mcp/index.cjs +0 -57
- package/lib/mcp/index.d.ts +0 -9
- package/lib/mcp/mcp-module.cjs +0 -46
- package/lib/mcp/mcp-module.d.ts +0 -11
- package/lib/mcp/moduleRegistry.cjs +0 -52
- package/lib/mcp/moduleRegistry.d.ts +0 -14
- package/lib/mcp/prompts/index.cjs +0 -25
- package/lib/mcp/prompts/index.d.ts +0 -4
- package/lib/mcp/prompts/prompts.cjs +0 -217
- package/lib/mcp/prompts/prompts.d.ts +0 -22
- package/lib/mcp/resources/index.d.ts +0 -1
- package/lib/mcp/resources/resources.cjs +0 -72
- package/lib/mcp/resources/resources.d.ts +0 -2
- package/lib/mcp/schemas.cjs +0 -100
- package/lib/mcp/schemas.d.ts +0 -53
- package/lib/mcp/templates/codex-templates.cjs +0 -40
- package/lib/mcp/templates/codex-templates.d.ts +0 -3
- package/lib/mcp/templates/index.cjs +0 -76
- package/lib/mcp/templates/index.d.ts +0 -71
- package/lib/mcp/templates/resource-templates.cjs +0 -67
- package/lib/mcp/templates/resource-templates.d.ts +0 -3
- package/lib/mcp/templates/workspace-templates.cjs +0 -70
- package/lib/mcp/templates/workspace-templates.d.ts +0 -3
- package/lib/mcp/tools/codex-tools.cjs +0 -250
- package/lib/mcp/tools/codex-tools.d.ts +0 -5
- package/lib/mcp/tools/generateMcpModule.cjs +0 -139
- package/lib/mcp/tools/generateMcpModule.d.ts +0 -9
- package/lib/mcp/tools/index.cjs +0 -30
- package/lib/mcp/tools/index.d.ts +0 -219
- package/lib/mcp/tools/tools.cjs +0 -317
- package/lib/mcp/tools/tools.d.ts +0 -10
- package/lib/mcp/types.cjs +0 -3
- package/lib/mcp/types.d.ts +0 -66
- package/lib/mcp/utils.cjs +0 -54
- package/lib/mcp/utils.d.ts +0 -3
- package/lib/mcp/validation/index.cjs +0 -123
- package/lib/mcp/validation/index.d.ts +0 -13
- package/lib/mcp/validation/scaffoldModule.cjs +0 -94
- package/lib/mcp/validation/scaffoldModule.d.ts +0 -9
- package/lib/mcp/workspace.cjs +0 -119
- package/lib/mcp/workspace.d.ts +0 -9
- package/lib/metadata.cjs +0 -25
- package/lib/metadata.d.ts +0 -9
- package/lib/modules/_template/index.cjs +0 -23
- package/lib/modules/_template/index.d.ts +0 -32
- package/lib/modules/_template/prompts/index.cjs +0 -12
- package/lib/modules/_template/prompts/index.d.ts +0 -6
- package/lib/modules/_template/resources/index.cjs +0 -12
- package/lib/modules/_template/resources/index.d.ts +0 -6
- package/lib/modules/_template/templates/index.cjs +0 -13
- package/lib/modules/_template/templates/index.d.ts +0 -7
- package/lib/modules/_template/tools/index.cjs +0 -18
- package/lib/modules/_template/tools/index.d.ts +0 -6
- package/lib/modules/decoration/index.cjs +0 -17
- package/lib/modules/decoration/index.d.ts +0 -46
- package/lib/modules/decoration/prompts/index.cjs +0 -5
- package/lib/modules/decoration/prompts/index.d.ts +0 -1
- package/lib/modules/decoration/resources/index.cjs +0 -13
- package/lib/modules/decoration/resources/index.d.ts +0 -7
- package/lib/modules/decoration/templates/index.cjs +0 -12
- package/lib/modules/decoration/templates/index.d.ts +0 -6
- package/lib/modules/decoration/tools/index.cjs +0 -10
- package/lib/modules/decoration/tools/index.d.ts +0 -26
- package/lib/modules/index.cjs +0 -20
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/mcp/decoration-assist.cjs +0 -13
- package/lib/modules/mcp/decoration-assist.d.ts +0 -4
- package/lib/modules/mcp/index.cjs +0 -23
- package/lib/modules/mcp/index.d.ts +0 -6
- package/lib/modules/mcp/prompts/index.cjs +0 -12
- package/lib/modules/mcp/prompts/index.d.ts +0 -2
- package/lib/modules/mcp/resources/index.cjs +0 -27
- package/lib/modules/mcp/resources/index.d.ts +0 -2
- package/lib/modules/mcp/templates/index.cjs +0 -31
- package/lib/modules/mcp/templates/index.d.ts +0 -2
- package/lib/modules/mcp/tools/index.cjs +0 -18
- package/lib/modules/mcp/tools/index.d.ts +0 -6
- package/lib/utils/modulePaths.cjs +0 -43
- package/lib/utils/modulePaths.d.ts +0 -6
- package/lib/utils/moduleValidator.cjs +0 -184
- package/lib/utils/moduleValidator.d.ts +0 -14
- package/lib/utils.cjs +0 -129
- package/lib/utils.d.ts +0 -61
- /package/lib/{bin/validate-modules.d.ts → esm/tools/ast-jsdoc-tools/cli.d.ts} +0 -0
- /package/lib/{esm/bin/validate-modules.d.ts → tools/ast-jsdoc-tools/cli.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/example-prompt/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wEAA8D;AAO9D,qDAAoE;AAEpE,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAEzC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAGhD,QAAA,aAAa,GAAG,8BAAa,CAAC,OAAO;KAC/C,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,sBAAsB,CAAC;KAChC,cAAc,CAAC,0EAA0E,CAAC;KAC1F,aAAa,CAAC,UAAiB,CAAC;KAChC,YAAY,CAAC,0BAAc,CAAC,KAAK,CAAC;KAClC,KAAK,CACJ,CACE,IAAU,EACV,MAA8D,EAC7C,EAAE;IACnB,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,oBAAoB,CAAC;IAChD,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAS,CAAC;AACxC,CAAC,CACF,CAAC;AAEJ,oFAAoF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Prompts = void 0;
|
|
4
|
+
const class_prompt_1 = require("./jsdocs/class-prompt.cjs");
|
|
5
|
+
const const_prompt_1 = require("./jsdocs/const-prompt.cjs");
|
|
6
|
+
const decorator_prompt_1 = require("./jsdocs/decorator-prompt.cjs");
|
|
7
|
+
const enum_prompt_1 = require("./jsdocs/enum-prompt.cjs");
|
|
8
|
+
const function_prompt_1 = require("./jsdocs/function-prompt.cjs");
|
|
9
|
+
const interface_prompt_1 = require("./jsdocs/interface-prompt.cjs");
|
|
10
|
+
const types_prompt_1 = require("./jsdocs/types-prompt.cjs");
|
|
11
|
+
const builder_1 = require("./code/design-patterns/builder.cjs");
|
|
12
|
+
const example_prompt_1 = require("./example-prompt/index.cjs");
|
|
13
|
+
const interactive_jsdoc_1 = require("./interactive-jsdoc/index.cjs");
|
|
14
|
+
exports.Prompts = [
|
|
15
|
+
// Documentation prompts
|
|
16
|
+
class_prompt_1.TsDocClassPrompt,
|
|
17
|
+
const_prompt_1.TsDocConstPrompt,
|
|
18
|
+
decorator_prompt_1.TsDocDecoratorPrompt,
|
|
19
|
+
enum_prompt_1.TsDocEnumPrompt,
|
|
20
|
+
function_prompt_1.TsDocFunctionPrompt,
|
|
21
|
+
interface_prompt_1.TsDocInterfacePrompt,
|
|
22
|
+
types_prompt_1.TsDocTypeePrompt,
|
|
23
|
+
// Code generation prompts
|
|
24
|
+
builder_1.TsCodeDesignPatterBuilderPrompt,
|
|
25
|
+
// Example prompt
|
|
26
|
+
example_prompt_1.ExamplePrompt,
|
|
27
|
+
interactive_jsdoc_1.InteractiveJsDocPrompt,
|
|
28
|
+
];
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":";;;AAAA,4DAAyD;AACzD,4DAAyD;AACzD,oEAAiE;AACjE,0DAAuD;AACvD,kEAA+D;AAC/D,oEAAiE;AACjE,4DAAyD;AAEzD,gEAAiF;AACjF,+DAAiD;AACjD,qEAA6D;AAEhD,QAAA,OAAO,GAAoB;IACtC,wBAAwB;IACxB,+BAAgB;IAChB,+BAAgB;IAChB,uCAAoB;IACpB,6BAAe;IACf,qCAAmB;IACnB,uCAAoB;IACpB,+BAAgB;IAChB,0BAA0B;IAC1B,yCAA+B;IAC/B,iBAAiB;IACjB,8BAAa;IACb,0CAAsB;CACvB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractiveJsDocPrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
6
|
+
const constants_1 = require("./../../constants.cjs");
|
|
7
|
+
const promptName = "interactive.jsdoc.assistant";
|
|
8
|
+
const argsSchema = zod_1.z.object({ code: zod_1.z.string().optional(), astObject: zod_1.z.any().optional() });
|
|
9
|
+
exports.InteractiveJsDocPrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Interactive JSDoc Assistant")
|
|
12
|
+
.setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setReasoning(constants_1.ReasoningLevel.BASIC)
|
|
15
|
+
.setCb((args, _extra) => {
|
|
16
|
+
const code = args?.code ?? "";
|
|
17
|
+
const prompt = `Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n${code}`;
|
|
18
|
+
const result = { messages: [{ role: "user", content: { type: "text", text: prompt } }], _meta: {} };
|
|
19
|
+
return result;
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/interactive-jsdoc/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wEAA8D;AAO9D,qDAAiD;AAEjD,MAAM,UAAU,GAAG,6BAA6B,CAAC;AAEjD,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAG/E,QAAA,sBAAsB,GAAG,8BAAa,CAAC,OAAO;KACxD,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,6BAA6B,CAAC;KACvC,cAAc,CAAC,kFAAkF,CAAC;KAClG,aAAa,CAAC,UAAiB,CAAC;KAChC,YAAY,CAAC,0BAAc,CAAC,KAAK,CAAC;KAClC,KAAK,CAAC,CAAC,IAAU,EAAE,MAA8D,EAAmB,EAAE;IACrG,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,8GAA8G,IAAI,EAAE,CAAC;IACpI,MAAM,MAAM,GAAoB,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAS,CAAC;IAC5H,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocClassPrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const constants_2 = require("./../../constants.cjs");
|
|
8
|
+
const promptName = "ts.jsdoc.class";
|
|
9
|
+
const argsSchema = zod_1.z.object({});
|
|
10
|
+
exports.TsDocClassPrompt = prompt_builder_1.PromptBuilder.builder
|
|
11
|
+
.setName(promptName)
|
|
12
|
+
.setTitle("Class JSDocs Prompt")
|
|
13
|
+
.setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.")
|
|
14
|
+
.setArgsSchema(argsSchema)
|
|
15
|
+
.setReasoning(constants_2.ReasoningLevel.BASIC)
|
|
16
|
+
.setCb((
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
args,
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
extra) => {
|
|
21
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
22
|
+
document the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.
|
|
23
|
+
Include @class tags when applicable.
|
|
24
|
+
include @param tags in the class documentation and its type definitions
|
|
25
|
+
Include detailed @description for all properties.
|
|
26
|
+
Include @template tags when necessary.
|
|
27
|
+
Do NOT document the constructor, but include the constructor arguments as @param in the class documentation
|
|
28
|
+
For methods and functions:
|
|
29
|
+
- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.
|
|
30
|
+
- create a usage example under the @example tag on the class documentation
|
|
31
|
+
- create mermaid sequence diagrams under the @mermaid tag;
|
|
32
|
+
|
|
33
|
+
The order of tags (when applicable) should be as follows:
|
|
34
|
+
1 - @description;
|
|
35
|
+
2 - @summary;
|
|
36
|
+
3 - @template;
|
|
37
|
+
4 - @param;
|
|
38
|
+
5 - @return;
|
|
39
|
+
6 - @class
|
|
40
|
+
7 - @example
|
|
41
|
+
8 - @mermaid;
|
|
42
|
+
|
|
43
|
+
ignore @mermaid for methods with less that 15 lines and constructors.
|
|
44
|
+
Respond only with the full JSDoc comment block for the class and its methods.
|
|
45
|
+
NEVER user @memberOf in the class or any of it's methods
|
|
46
|
+
if the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information
|
|
47
|
+
never omit or change any code, including the constructor
|
|
48
|
+
${constants_1.Footer}`;
|
|
49
|
+
const result = {
|
|
50
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
51
|
+
_meta: {},
|
|
52
|
+
};
|
|
53
|
+
return result;
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=class-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/class-prompt.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAAsD;AAOtD,wEAA8D;AAC9D,qDAAiD;AAEjD,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,gBAAgB,GAAkB,8BAAa,CAAC,OAAO;KACjE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,qBAAqB,CAAC;KAC/B,cAAc,CACb,4FAA4F,CAC7F;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,YAAY,CAAC,0BAAc,CAAC,KAAK,CAAC;KAClC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BrC,kBAAM,EAAE,CAAC;IACL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;QACrE,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocConstPrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const promptName = "ts.jsdoc.const";
|
|
8
|
+
const argsSchema = zod_1.z.object({});
|
|
9
|
+
exports.TsDocConstPrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Const JSDocs Prompt")
|
|
12
|
+
.setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setCb((
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
args,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
extra) => {
|
|
19
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
20
|
+
${constants_1.ConstantsPrompt}
|
|
21
|
+
${constants_1.Footer}`;
|
|
22
|
+
const result = {
|
|
23
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
24
|
+
};
|
|
25
|
+
return result;
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=const-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/const-prompt.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAAuE;AAOvE,wEAA8D;AAE9D,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,gBAAgB,GAAkB,8BAAa,CAAC,OAAO;KACjE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,qBAAqB,CAAC;KAC/B,cAAc,CACb,+FAA+F,CAChG;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;EACrC,2BAAe;EACf,kBAAM,EAAE,CAAC;IAEL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Footer = exports.ConstantsPrompt = exports.TypesPrompt = exports.BaseJSDocPrompt = void 0;
|
|
4
|
+
exports.BaseJSDocPrompt = `You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:
|
|
5
|
+
Generate a JSDoc comment block for a TypeScript module file using better-docs formatting:`;
|
|
6
|
+
exports.TypesPrompt = `document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.
|
|
7
|
+
Include @interface and @typeDef an @template tags when appropriate.
|
|
8
|
+
Include detailed @description for all properties.
|
|
9
|
+
For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.
|
|
10
|
+
|
|
11
|
+
The order of tags (when applicable) should be as follows:
|
|
12
|
+
1 - @description;
|
|
13
|
+
2 - @summary;
|
|
14
|
+
3 - @template;
|
|
15
|
+
4 - @param;
|
|
16
|
+
5 - @return;
|
|
17
|
+
6 - @interface or @typeDef followed by the interface or type name;
|
|
18
|
+
8 - @memberOf referencing the appropriate module using the appropriate syntax
|
|
19
|
+
|
|
20
|
+
Output only the completed JSDoc comment block for the type or interface.
|
|
21
|
+
refer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax
|
|
22
|
+
never omit or change any code
|
|
23
|
+
if the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information`;
|
|
24
|
+
exports.ConstantsPrompt = `document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.
|
|
25
|
+
Include @const and @typeDef tags when appropriate.
|
|
26
|
+
Include detailed @description for all properties.
|
|
27
|
+
- For enums, include @enum and @readonly, and add inline documentation for each member
|
|
28
|
+
- For object-like constants:
|
|
29
|
+
- Create a @typedef with @property for each key
|
|
30
|
+
- Reference it in the constant using @type
|
|
31
|
+
- Alternatively, document each key inline if small
|
|
32
|
+
|
|
33
|
+
The order of tags (when applicable) should be as follows:
|
|
34
|
+
1 - @description;
|
|
35
|
+
2 - @summary;
|
|
36
|
+
3 - @template;
|
|
37
|
+
4 - @property;
|
|
38
|
+
6 - @const followed by the const or enum name;
|
|
39
|
+
8 - @memberOf referencing the appropriate module using the appropriate syntax
|
|
40
|
+
|
|
41
|
+
Respond with the JSDoc comment block(s) for both the typedef and the constant or enum.
|
|
42
|
+
refer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax
|
|
43
|
+
never omit or change any code
|
|
44
|
+
if the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information`;
|
|
45
|
+
exports.Footer = `NOTES:
|
|
46
|
+
- when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;
|
|
47
|
+
- when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;
|
|
48
|
+
`;
|
|
49
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const BaseJSDocPrompt = "You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:";
|
|
2
|
+
export declare const TypesPrompt = "document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information";
|
|
3
|
+
export declare const ConstantsPrompt = "document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information";
|
|
4
|
+
export declare const Footer = "NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;0FAC2D,CAAC;AAE9E,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;gIAiBqG,CAAC;AAEpH,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;gIAoBiG,CAAC;AAEpH,QAAA,MAAM,GAAG;;;EAGpB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocDecoratorPrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const promptName = "ts.jsdoc.decorator";
|
|
8
|
+
const argsSchema = zod_1.z.object({});
|
|
9
|
+
exports.TsDocDecoratorPrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Decorator JSDocs Prompt")
|
|
12
|
+
.setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setCb((
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
args,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
extra) => {
|
|
19
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
20
|
+
document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.
|
|
21
|
+
Include @function an @template tags when appropriate.
|
|
22
|
+
Include detailed @description for all properties.
|
|
23
|
+
For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.
|
|
24
|
+
create mermaid sequence diagrams under the @mermaid tag;
|
|
25
|
+
|
|
26
|
+
The order of tags (when applicable) should be as follows:
|
|
27
|
+
1 - @description;
|
|
28
|
+
2 - @summary;
|
|
29
|
+
3 - @template;
|
|
30
|
+
4 - @param including type definitions;
|
|
31
|
+
5 - @return;
|
|
32
|
+
6 - @function followed by the interface or type name;
|
|
33
|
+
7 - @mermaid with the sequence diagram for the function if it has over 10 lines
|
|
34
|
+
8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"
|
|
35
|
+
Output only the full JSDoc comment block for the function.
|
|
36
|
+
DO NOT refer to the module it belongs with @memberOf
|
|
37
|
+
never omit or change any code
|
|
38
|
+
if the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information
|
|
39
|
+
${constants_1.Footer}`;
|
|
40
|
+
const result = {
|
|
41
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
42
|
+
};
|
|
43
|
+
return result;
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=decorator-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/decorator-prompt.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAAsD;AAOtD,wEAA8D;AAE9D,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,oBAAoB,GAAkB,8BAAa,CAAC,OAAO;KACrE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,yBAAyB,CAAC;KACnC,cAAc,CACb,gGAAgG,CACjG;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;;;;;;;;;;;;;;;;;;;;EAoBrC,kBAAM,EAAE,CAAC;IAEL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocEnumPrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const promptName = "ts.jsdoc.enum";
|
|
8
|
+
const argsSchema = zod_1.z.object({});
|
|
9
|
+
exports.TsDocEnumPrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Enum JSDocs Prompt")
|
|
12
|
+
.setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setCb((
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
args,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
extra) => {
|
|
19
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
20
|
+
${constants_1.ConstantsPrompt}
|
|
21
|
+
${constants_1.Footer}`;
|
|
22
|
+
const result = {
|
|
23
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
24
|
+
};
|
|
25
|
+
return result;
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=enum-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/enum-prompt.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,+CAAuE;AAOvE,wEAA8D;AAE9D,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,eAAe,GAAkB,8BAAa,CAAC,OAAO;KAChE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,oBAAoB,CAAC;KAC9B,cAAc,CACb,2FAA2F,CAC5F;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;EACrC,2BAAe;EACf,kBAAM,EAAE,CAAC;IAEL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocFunctionPrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const promptName = "ts.jsdoc.function";
|
|
8
|
+
const argsSchema = zod_1.z.object({});
|
|
9
|
+
exports.TsDocFunctionPrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Function JSDocs Prompt")
|
|
12
|
+
.setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setCb((
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
args,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
extra) => {
|
|
19
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
20
|
+
document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.
|
|
21
|
+
Include @function an @template tags when appropriate.
|
|
22
|
+
Include detailed @description for all properties.
|
|
23
|
+
For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.
|
|
24
|
+
create mermaid sequence diagrams under the @mermaid tag;
|
|
25
|
+
|
|
26
|
+
The order of tags (when applicable) should be as follows:
|
|
27
|
+
1 - @description;
|
|
28
|
+
2 - @summary;
|
|
29
|
+
3 - @template;
|
|
30
|
+
4 - @param including type definitions;
|
|
31
|
+
5 - @return;
|
|
32
|
+
6 - @function followed by the interface or type name;
|
|
33
|
+
7 - @mermaid with the sequence diagram for the function if ithas over 10 lines
|
|
34
|
+
8 - @memberOf referencing the appropriate module using the appropriate syntax
|
|
35
|
+
|
|
36
|
+
Output only the full JSDoc comment block for the function.
|
|
37
|
+
refer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax
|
|
38
|
+
never omit or change any code
|
|
39
|
+
if the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information
|
|
40
|
+
${constants_1.Footer}`;
|
|
41
|
+
const result = {
|
|
42
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
43
|
+
};
|
|
44
|
+
return result;
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=function-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/function-prompt.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAAsD;AAOtD,wEAA8D;AAE9D,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAEvC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,mBAAmB,GAAkB,8BAAa,CAAC,OAAO;KACpE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,wBAAwB,CAAC;KAClC,cAAc,CACb,+FAA+F,CAChG;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;;;;;;;;;;;;;;;;;;;;;EAqBrC,kBAAM,EAAE,CAAC;IAEL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocInterfacePrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const promptName = "ts.jsdoc.interface";
|
|
8
|
+
const argsSchema = zod_1.z.object({});
|
|
9
|
+
exports.TsDocInterfacePrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Interface JSDocs Prompt")
|
|
12
|
+
.setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setCb((
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
args,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
extra) => {
|
|
19
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
20
|
+
${constants_1.TypesPrompt}
|
|
21
|
+
${constants_1.Footer}`;
|
|
22
|
+
const result = {
|
|
23
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
24
|
+
};
|
|
25
|
+
return result;
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=interface-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/interface-prompt.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAAmE;AAOnE,wEAA8D;AAE9D,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,oBAAoB,GAAkB,8BAAa,CAAC,OAAO;KACrE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,yBAAyB,CAAC;KACnC,cAAc,CACb,gGAAgG,CACjG;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;EACrC,uBAAW;EACX,kBAAM,EAAE,CAAC;IAEL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsDocTypeePrompt = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("./constants.cjs");
|
|
6
|
+
const prompt_builder_1 = require("./../../builders/prompt-builder.cjs");
|
|
7
|
+
const promptName = "ts.jsdoc.type";
|
|
8
|
+
const argsSchema = zod_1.z.object({});
|
|
9
|
+
exports.TsDocTypeePrompt = prompt_builder_1.PromptBuilder.builder
|
|
10
|
+
.setName(promptName)
|
|
11
|
+
.setTitle("Type JSDocs Prompt")
|
|
12
|
+
.setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.")
|
|
13
|
+
.setArgsSchema(argsSchema)
|
|
14
|
+
.setCb((
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
args,
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
extra) => {
|
|
19
|
+
const prompt = `${constants_1.BaseJSDocPrompt}
|
|
20
|
+
${constants_1.TypesPrompt}
|
|
21
|
+
${constants_1.Footer}`;
|
|
22
|
+
const result = {
|
|
23
|
+
messages: [{ role: "user", content: { type: "text", text: prompt } }],
|
|
24
|
+
};
|
|
25
|
+
return result;
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=types-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-prompt.js","sourceRoot":"","sources":["../../../src/prompts/jsdocs/types-prompt.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+CAAmE;AAOnE,wEAA8D;AAE9D,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAGnB,QAAA,gBAAgB,GAAkB,8BAAa,CAAC,OAAO;KACjE,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,oBAAoB,CAAC;KAC9B,cAAc,CACb,2FAA2F,CAC5F;KACA,aAAa,CAAC,UAAiB,CAAC;KAChC,KAAK,CACJ;AACE,6DAA6D;AAC7D,IAAU;AACV,6DAA6D;AAC7D,KAA6D,EAC7D,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,2BAAe;EACrC,uBAAW;EACX,kBAAM,EAAE,CAAC;IAEL,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExampleResource = void 0;
|
|
4
|
+
const resource_builder_1 = require("./../../builders/resource-builder.cjs");
|
|
5
|
+
const constants_1 = require("./../../constants.cjs");
|
|
6
|
+
exports.ExampleResource = resource_builder_1.ResourceBuilder.builder
|
|
7
|
+
.setName("example.resource.hello")
|
|
8
|
+
.setTitle("Example: Hello Resource")
|
|
9
|
+
.setDescription("A tiny example resource that returns a simple payload for any URI.")
|
|
10
|
+
.setUriOtTemplate("example://hello/{name}")
|
|
11
|
+
.setConfig({ description: "Example resource", _meta: { usage: { reasoning: constants_1.ReasoningLevel.NONE, effort: constants_1.EffortLevel.NONE, cost: constants_1.Cost.FREE } } })
|
|
12
|
+
.setCb(async (_uri, _extra) => {
|
|
13
|
+
const payload = {
|
|
14
|
+
content: {
|
|
15
|
+
type: "text",
|
|
16
|
+
text: "hello from example resource",
|
|
17
|
+
},
|
|
18
|
+
_meta: {},
|
|
19
|
+
};
|
|
20
|
+
return payload;
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/example-resource/index.ts"],"names":[],"mappings":";;;AAAA,4EAAkE;AAOlE,qDAAoE;AAEvD,QAAA,eAAe,GAAG,kCAAe,CAAC,OAAO;KACnD,OAAO,CAAC,wBAAwB,CAAC;KACjC,QAAQ,CAAC,yBAAyB,CAAC;KACnC,cAAc,CAAC,oEAAoE,CAAC;KACpF,gBAAgB,CAAC,wBAAwB,CAAC;KAC1C,SAAS,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,0BAAc,CAAC,IAAI,EAAE,MAAM,EAAE,uBAAW,CAAC,IAAI,EAAE,IAAI,EAAE,gBAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;KAC/I,KAAK,CAAC,KAAK,EAAE,IAAS,EAAE,MAA8D,EAAE,EAAE;IACzF,MAAM,OAAO,GAAuB;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,6BAA6B;SACpC;QACD,KAAK,EAAE,EAAE;KACH,CAAC;IACT,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC,CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Resources = void 0;
|
|
4
|
+
const example_resource_1 = require("./example-resource/index.cjs");
|
|
5
|
+
const repo_metadata_1 = require("./repo-metadata/index.cjs");
|
|
6
|
+
exports.Resources = [example_resource_1.ExampleResource, repo_metadata_1.RepoMetadataResource];
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";;;AACA,mEAAqD;AACrD,6DAAuD;AAE1C,QAAA,SAAS,GAAsB,CAAC,kCAAe,EAAE,oCAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RepoMetadataResource = void 0;
|
|
4
|
+
const resource_builder_1 = require("./../../builders/resource-builder.cjs");
|
|
5
|
+
const constants_1 = require("./../../constants.cjs");
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
exports.RepoMetadataResource = resource_builder_1.ResourceBuilder.builder
|
|
9
|
+
.setName("repo.metadata")
|
|
10
|
+
.setTitle("Repository Metadata Resource")
|
|
11
|
+
.setDescription("Expose basic repository metadata such as package.json and lint rules.")
|
|
12
|
+
.setUriOtTemplate("repo://metadata/{file}")
|
|
13
|
+
.setConfig({ description: "Repository metadata resource", _meta: { usage: { reasoning: constants_1.ReasoningLevel.NONE, effort: constants_1.EffortLevel.NONE, cost: constants_1.Cost.FREE } } })
|
|
14
|
+
.setCb(async (uri, _extra) => {
|
|
15
|
+
const file = uri.pathname.replace(/^\//, "") || "package.json";
|
|
16
|
+
try {
|
|
17
|
+
const p = (0, path_1.resolve)(process.cwd(), file);
|
|
18
|
+
const raw = await (0, promises_1.readFile)(p, { encoding: "utf8" });
|
|
19
|
+
const parsed = JSON.parse(raw);
|
|
20
|
+
const payload = { content: { type: "json", data: JSON.stringify(parsed) }, _meta: {} };
|
|
21
|
+
return payload;
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
const payload = { content: { type: "text", text: "" }, _meta: {} };
|
|
25
|
+
return payload;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/repo-metadata/index.ts"],"names":[],"mappings":";;;AAAA,4EAAkE;AAOlE,qDAAoE;AACpE,0CAAuC;AACvC,+BAA+B;AAElB,QAAA,oBAAoB,GAAG,kCAAe,CAAC,OAAO;KACxD,OAAO,CAAC,eAAe,CAAC;KACxB,QAAQ,CAAC,8BAA8B,CAAC;KACxC,cAAc,CAAC,uEAAuE,CAAC;KACvF,gBAAgB,CAAC,wBAAwB,CAAC;KAC1C,SAAS,CAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,0BAAc,CAAC,IAAI,EAAE,MAAM,EAAE,uBAAW,CAAC,IAAI,EAAE,IAAI,EAAE,gBAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;KAC3J,KAAK,CAAC,KAAK,EAAE,GAAQ,EAAE,MAA8D,EAAE,EAAE;IACxF,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC;IAC/D,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;QACvC,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAuB,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAS,CAAC;QAClH,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,OAAO,GAAuB,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAS,CAAC;QAC9F,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsAstTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("./utils.cjs");
|
|
6
|
+
const tool_builder_1 = require("./../../builders/tool-builder.cjs");
|
|
7
|
+
const toolName = "ts.ast.extract";
|
|
8
|
+
const toolTitle = "AST Extraction Tool for TypeScript";
|
|
9
|
+
const inputSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
filePath: zod_1.z
|
|
12
|
+
.string()
|
|
13
|
+
.describe("The path to the TypeScript file to analyze."),
|
|
14
|
+
})
|
|
15
|
+
.describe(`the input schema for the ${toolName} tool`);
|
|
16
|
+
const outputSchema = zod_1.z
|
|
17
|
+
.object({})
|
|
18
|
+
.describe(`the output schema for the ${toolName} tool`);
|
|
19
|
+
exports.TsAstTool = tool_builder_1.ToolBuilder.builder
|
|
20
|
+
.setName(toolName)
|
|
21
|
+
.setTitle(toolTitle)
|
|
22
|
+
.setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.")
|
|
23
|
+
.setInputSchema(inputSchema)
|
|
24
|
+
// This tool returns a list of content blocks (in `content`) rather than a
|
|
25
|
+
// structured object; do not set an outputSchema to avoid requiring
|
|
26
|
+
// `structuredContent` in the CallToolResult.
|
|
27
|
+
.setAnnotations({
|
|
28
|
+
title: toolTitle,
|
|
29
|
+
readOnlyHint: true,
|
|
30
|
+
destructiveHint: false,
|
|
31
|
+
idempotentHint: true,
|
|
32
|
+
openWorldHint: false,
|
|
33
|
+
})
|
|
34
|
+
.setCb(async (args,
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
|
+
extra) => {
|
|
37
|
+
const { filePath } = args;
|
|
38
|
+
// Guard analyzeFile with a short overall timeout so a slow ts-morph
|
|
39
|
+
// resolution won't block the integration test indefinitely.
|
|
40
|
+
const res = await Promise.race([
|
|
41
|
+
(0, utils_1.analyzeFile)(filePath),
|
|
42
|
+
new Promise((res) => setTimeout(() => res(null), 1500)),
|
|
43
|
+
]);
|
|
44
|
+
if (!res || !res.astObjects) {
|
|
45
|
+
// return an empty content array (CallToolResult expects an object; we
|
|
46
|
+
// provide readable content and a lightweight structuredContent)
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: "No AST objects or analysis timed out" }],
|
|
49
|
+
structuredContent: { astObjects: [] },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Normalize shape to AstObject as much as possible
|
|
53
|
+
const objects = res.astObjects.map((o) => ({
|
|
54
|
+
id: o.id,
|
|
55
|
+
name: o.name,
|
|
56
|
+
kind: o.kind || "unknown",
|
|
57
|
+
location: o.location,
|
|
58
|
+
isExported: !!o.isExported,
|
|
59
|
+
signature: o.signature,
|
|
60
|
+
parentId: o.parentId,
|
|
61
|
+
children: o.children,
|
|
62
|
+
decorators: o.decorators,
|
|
63
|
+
contextHints: o.contextHints || [],
|
|
64
|
+
}));
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: "text", text: `Found ${objects.length} AST objects` }],
|
|
67
|
+
structuredContent: { astObjects: objects },
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=ts-ast-tool.js.map
|