@shirokuma-library/shirokuma-docs 0.1.0-alpha.5
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.
Potentially problematic release.
This version of @shirokuma-library/shirokuma-docs might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.en.md +308 -0
- package/README.md +308 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bin/shirokuma-docs +2 -0
- package/dist/analyzers/details-test-analysis.d.ts +31 -0
- package/dist/analyzers/details-test-analysis.d.ts.map +1 -0
- package/dist/analyzers/details-test-analysis.js +172 -0
- package/dist/analyzers/details-test-analysis.js.map +1 -0
- package/dist/analyzers/feature-map-builder.d.ts +20 -0
- package/dist/analyzers/feature-map-builder.d.ts.map +1 -0
- package/dist/analyzers/feature-map-builder.js +154 -0
- package/dist/analyzers/feature-map-builder.js.map +1 -0
- package/dist/analyzers/feature-map-references.d.ts +34 -0
- package/dist/analyzers/feature-map-references.d.ts.map +1 -0
- package/dist/analyzers/feature-map-references.js +249 -0
- package/dist/analyzers/feature-map-references.js.map +1 -0
- package/dist/analyzers/reference-analyzer.d.ts +95 -0
- package/dist/analyzers/reference-analyzer.d.ts.map +1 -0
- package/dist/analyzers/reference-analyzer.js +372 -0
- package/dist/analyzers/reference-analyzer.js.map +1 -0
- package/dist/commands/adr.d.ts +26 -0
- package/dist/commands/adr.d.ts.map +1 -0
- package/dist/commands/adr.js +129 -0
- package/dist/commands/adr.js.map +1 -0
- package/dist/commands/api-tools.d.ts +83 -0
- package/dist/commands/api-tools.d.ts.map +1 -0
- package/dist/commands/api-tools.js +775 -0
- package/dist/commands/api-tools.js.map +1 -0
- package/dist/commands/coverage.d.ts +139 -0
- package/dist/commands/coverage.d.ts.map +1 -0
- package/dist/commands/coverage.js +481 -0
- package/dist/commands/coverage.js.map +1 -0
- package/dist/commands/deps.d.ts +24 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +211 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/details-context.d.ts +38 -0
- package/dist/commands/details-context.d.ts.map +1 -0
- package/dist/commands/details-context.js +193 -0
- package/dist/commands/details-context.js.map +1 -0
- package/dist/commands/details-types.d.ts +315 -0
- package/dist/commands/details-types.d.ts.map +1 -0
- package/dist/commands/details-types.js +7 -0
- package/dist/commands/details-types.js.map +1 -0
- package/dist/commands/details.d.ts +24 -0
- package/dist/commands/details.d.ts.map +1 -0
- package/dist/commands/details.js +299 -0
- package/dist/commands/details.js.map +1 -0
- package/dist/commands/discussion-templates.d.ts +26 -0
- package/dist/commands/discussion-templates.d.ts.map +1 -0
- package/dist/commands/discussion-templates.js +270 -0
- package/dist/commands/discussion-templates.js.map +1 -0
- package/dist/commands/discussions.d.ts +31 -0
- package/dist/commands/discussions.d.ts.map +1 -0
- package/dist/commands/discussions.js +743 -0
- package/dist/commands/discussions.js.map +1 -0
- package/dist/commands/feature-map-types.d.ts +294 -0
- package/dist/commands/feature-map-types.d.ts.map +1 -0
- package/dist/commands/feature-map-types.js +8 -0
- package/dist/commands/feature-map-types.js.map +1 -0
- package/dist/commands/feature-map.d.ts +30 -0
- package/dist/commands/feature-map.d.ts.map +1 -0
- package/dist/commands/feature-map.js +137 -0
- package/dist/commands/feature-map.js.map +1 -0
- package/dist/commands/generate.d.ts +16 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +88 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/gh-discussions.d.ts +31 -0
- package/dist/commands/gh-discussions.d.ts.map +1 -0
- package/dist/commands/gh-discussions.js +743 -0
- package/dist/commands/gh-discussions.js.map +1 -0
- package/dist/commands/gh-issues-pr.d.ts +74 -0
- package/dist/commands/gh-issues-pr.d.ts.map +1 -0
- package/dist/commands/gh-issues-pr.js +417 -0
- package/dist/commands/gh-issues-pr.js.map +1 -0
- package/dist/commands/gh-issues.d.ts +90 -0
- package/dist/commands/gh-issues.d.ts.map +1 -0
- package/dist/commands/gh-issues.js +1297 -0
- package/dist/commands/gh-issues.js.map +1 -0
- package/dist/commands/gh-projects.d.ts +54 -0
- package/dist/commands/gh-projects.d.ts.map +1 -0
- package/dist/commands/gh-projects.js +966 -0
- package/dist/commands/gh-projects.js.map +1 -0
- package/dist/commands/gh-repo.d.ts +18 -0
- package/dist/commands/gh-repo.d.ts.map +1 -0
- package/dist/commands/gh-repo.js +253 -0
- package/dist/commands/gh-repo.js.map +1 -0
- package/dist/commands/github-data.d.ts +67 -0
- package/dist/commands/github-data.d.ts.map +1 -0
- package/dist/commands/github-data.js +361 -0
- package/dist/commands/github-data.js.map +1 -0
- package/dist/commands/i18n.d.ts +102 -0
- package/dist/commands/i18n.d.ts.map +1 -0
- package/dist/commands/i18n.js +829 -0
- package/dist/commands/i18n.js.map +1 -0
- package/dist/commands/impact.d.ts +14 -0
- package/dist/commands/impact.d.ts.map +1 -0
- package/dist/commands/impact.js +263 -0
- package/dist/commands/impact.js.map +1 -0
- package/dist/commands/init.d.ts +53 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +429 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/issues-pr.d.ts +74 -0
- package/dist/commands/issues-pr.d.ts.map +1 -0
- package/dist/commands/issues-pr.js +417 -0
- package/dist/commands/issues-pr.js.map +1 -0
- package/dist/commands/issues.d.ts +76 -0
- package/dist/commands/issues.d.ts.map +1 -0
- package/dist/commands/issues.js +1285 -0
- package/dist/commands/issues.js.map +1 -0
- package/dist/commands/link-docs.d.ts +21 -0
- package/dist/commands/link-docs.d.ts.map +1 -0
- package/dist/commands/link-docs.js +990 -0
- package/dist/commands/link-docs.js.map +1 -0
- package/dist/commands/lint-annotations.d.ts +28 -0
- package/dist/commands/lint-annotations.d.ts.map +1 -0
- package/dist/commands/lint-annotations.js +511 -0
- package/dist/commands/lint-annotations.js.map +1 -0
- package/dist/commands/lint-code.d.ts +26 -0
- package/dist/commands/lint-code.d.ts.map +1 -0
- package/dist/commands/lint-code.js +428 -0
- package/dist/commands/lint-code.js.map +1 -0
- package/dist/commands/lint-coverage.d.ts +33 -0
- package/dist/commands/lint-coverage.d.ts.map +1 -0
- package/dist/commands/lint-coverage.js +379 -0
- package/dist/commands/lint-coverage.js.map +1 -0
- package/dist/commands/lint-docs.d.ts +23 -0
- package/dist/commands/lint-docs.d.ts.map +1 -0
- package/dist/commands/lint-docs.js +338 -0
- package/dist/commands/lint-docs.js.map +1 -0
- package/dist/commands/lint-structure.d.ts +38 -0
- package/dist/commands/lint-structure.d.ts.map +1 -0
- package/dist/commands/lint-structure.js +350 -0
- package/dist/commands/lint-structure.js.map +1 -0
- package/dist/commands/lint-tests.d.ts +25 -0
- package/dist/commands/lint-tests.d.ts.map +1 -0
- package/dist/commands/lint-tests.js +105 -0
- package/dist/commands/lint-tests.js.map +1 -0
- package/dist/commands/lint-workflow.d.ts +36 -0
- package/dist/commands/lint-workflow.d.ts.map +1 -0
- package/dist/commands/lint-workflow.js +255 -0
- package/dist/commands/lint-workflow.js.map +1 -0
- package/dist/commands/overview.d.ts +21 -0
- package/dist/commands/overview.d.ts.map +1 -0
- package/dist/commands/overview.js +1300 -0
- package/dist/commands/overview.js.map +1 -0
- package/dist/commands/packages.d.ts +107 -0
- package/dist/commands/packages.d.ts.map +1 -0
- package/dist/commands/packages.js +308 -0
- package/dist/commands/packages.js.map +1 -0
- package/dist/commands/portal-nextjs.d.ts +23 -0
- package/dist/commands/portal-nextjs.d.ts.map +1 -0
- package/dist/commands/portal-nextjs.js +336 -0
- package/dist/commands/portal-nextjs.js.map +1 -0
- package/dist/commands/portal.d.ts +24 -0
- package/dist/commands/portal.d.ts.map +1 -0
- package/dist/commands/portal.js +16 -0
- package/dist/commands/portal.js.map +1 -0
- package/dist/commands/projects.d.ts +54 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +969 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/repo-pairs.d.ts +19 -0
- package/dist/commands/repo-pairs.d.ts.map +1 -0
- package/dist/commands/repo-pairs.js +529 -0
- package/dist/commands/repo-pairs.js.map +1 -0
- package/dist/commands/repo.d.ts +18 -0
- package/dist/commands/repo.d.ts.map +1 -0
- package/dist/commands/repo.js +253 -0
- package/dist/commands/repo.js.map +1 -0
- package/dist/commands/schema.d.ts +49 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +830 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/screenshots.d.ts +203 -0
- package/dist/commands/screenshots.d.ts.map +1 -0
- package/dist/commands/screenshots.js +1234 -0
- package/dist/commands/screenshots.js.map +1 -0
- package/dist/commands/search-index.d.ts +83 -0
- package/dist/commands/search-index.d.ts.map +1 -0
- package/dist/commands/search-index.js +389 -0
- package/dist/commands/search-index.js.map +1 -0
- package/dist/commands/session.d.ts +153 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +1243 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/test-cases-types.d.ts +154 -0
- package/dist/commands/test-cases-types.d.ts.map +1 -0
- package/dist/commands/test-cases-types.js +7 -0
- package/dist/commands/test-cases-types.js.map +1 -0
- package/dist/commands/test-cases.d.ts +28 -0
- package/dist/commands/test-cases.d.ts.map +1 -0
- package/dist/commands/test-cases.js +192 -0
- package/dist/commands/test-cases.js.map +1 -0
- package/dist/commands/typedoc.d.ts +21 -0
- package/dist/commands/typedoc.d.ts.map +1 -0
- package/dist/commands/typedoc.js +192 -0
- package/dist/commands/typedoc.js.map +1 -0
- package/dist/commands/update-skills.d.ts +56 -0
- package/dist/commands/update-skills.d.ts.map +1 -0
- package/dist/commands/update-skills.js +620 -0
- package/dist/commands/update-skills.js.map +1 -0
- package/dist/generators/details-entity-pages.d.ts +40 -0
- package/dist/generators/details-entity-pages.d.ts.map +1 -0
- package/dist/generators/details-entity-pages.js +301 -0
- package/dist/generators/details-entity-pages.js.map +1 -0
- package/dist/generators/details-html.d.ts +23 -0
- package/dist/generators/details-html.d.ts.map +1 -0
- package/dist/generators/details-html.js +324 -0
- package/dist/generators/details-html.js.map +1 -0
- package/dist/generators/details-module-page.d.ts +33 -0
- package/dist/generators/details-module-page.d.ts.map +1 -0
- package/dist/generators/details-module-page.js +408 -0
- package/dist/generators/details-module-page.js.map +1 -0
- package/dist/generators/details-styles.d.ts +39 -0
- package/dist/generators/details-styles.d.ts.map +1 -0
- package/dist/generators/details-styles.js +409 -0
- package/dist/generators/details-styles.js.map +1 -0
- package/dist/generators/feature-map-html.d.ts +66 -0
- package/dist/generators/feature-map-html.d.ts.map +1 -0
- package/dist/generators/feature-map-html.js +569 -0
- package/dist/generators/feature-map-html.js.map +1 -0
- package/dist/generators/feature-map-styles.d.ts +39 -0
- package/dist/generators/feature-map-styles.d.ts.map +1 -0
- package/dist/generators/feature-map-styles.js +449 -0
- package/dist/generators/feature-map-styles.js.map +1 -0
- package/dist/generators/test-cases-hierarchy.d.ts +21 -0
- package/dist/generators/test-cases-hierarchy.d.ts.map +1 -0
- package/dist/generators/test-cases-hierarchy.js +336 -0
- package/dist/generators/test-cases-hierarchy.js.map +1 -0
- package/dist/generators/test-cases-main.d.ts +20 -0
- package/dist/generators/test-cases-main.d.ts.map +1 -0
- package/dist/generators/test-cases-main.js +439 -0
- package/dist/generators/test-cases-main.js.map +1 -0
- package/dist/generators/test-cases-styles.d.ts +64 -0
- package/dist/generators/test-cases-styles.d.ts.map +1 -0
- package/dist/generators/test-cases-styles.js +1277 -0
- package/dist/generators/test-cases-styles.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +517 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/annotation-lint.d.ts +198 -0
- package/dist/lint/annotation-lint.d.ts.map +1 -0
- package/dist/lint/annotation-lint.js +510 -0
- package/dist/lint/annotation-lint.js.map +1 -0
- package/dist/lint/annotation-types.d.ts +161 -0
- package/dist/lint/annotation-types.d.ts.map +1 -0
- package/dist/lint/annotation-types.js +31 -0
- package/dist/lint/annotation-types.js.map +1 -0
- package/dist/lint/code-types.d.ts +135 -0
- package/dist/lint/code-types.d.ts.map +1 -0
- package/dist/lint/code-types.js +25 -0
- package/dist/lint/code-types.js.map +1 -0
- package/dist/lint/coverage-types.d.ts +128 -0
- package/dist/lint/coverage-types.d.ts.map +1 -0
- package/dist/lint/coverage-types.js +24 -0
- package/dist/lint/coverage-types.js.map +1 -0
- package/dist/lint/docs-types.d.ts +214 -0
- package/dist/lint/docs-types.d.ts.map +1 -0
- package/dist/lint/docs-types.js +18 -0
- package/dist/lint/docs-types.js.map +1 -0
- package/dist/lint/formatters/index.d.ts +14 -0
- package/dist/lint/formatters/index.d.ts.map +1 -0
- package/dist/lint/formatters/index.js +28 -0
- package/dist/lint/formatters/index.js.map +1 -0
- package/dist/lint/formatters/json.d.ts +11 -0
- package/dist/lint/formatters/json.d.ts.map +1 -0
- package/dist/lint/formatters/json.js +12 -0
- package/dist/lint/formatters/json.js.map +1 -0
- package/dist/lint/formatters/summary.d.ts +11 -0
- package/dist/lint/formatters/summary.d.ts.map +1 -0
- package/dist/lint/formatters/summary.js +37 -0
- package/dist/lint/formatters/summary.js.map +1 -0
- package/dist/lint/formatters/terminal.d.ts +11 -0
- package/dist/lint/formatters/terminal.d.ts.map +1 -0
- package/dist/lint/formatters/terminal.js +99 -0
- package/dist/lint/formatters/terminal.js.map +1 -0
- package/dist/lint/index.d.ts +18 -0
- package/dist/lint/index.d.ts.map +1 -0
- package/dist/lint/index.js +103 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/rules/annotation-required.d.ts +35 -0
- package/dist/lint/rules/annotation-required.d.ts.map +1 -0
- package/dist/lint/rules/annotation-required.js +127 -0
- package/dist/lint/rules/annotation-required.js.map +1 -0
- package/dist/lint/rules/code-rules.d.ts +12 -0
- package/dist/lint/rules/code-rules.d.ts.map +1 -0
- package/dist/lint/rules/code-rules.js +11 -0
- package/dist/lint/rules/code-rules.js.map +1 -0
- package/dist/lint/rules/describe-coverage.d.ts +8 -0
- package/dist/lint/rules/describe-coverage.d.ts.map +1 -0
- package/dist/lint/rules/describe-coverage.js +43 -0
- package/dist/lint/rules/describe-coverage.js.map +1 -0
- package/dist/lint/rules/duplicate-testdoc.d.ts +8 -0
- package/dist/lint/rules/duplicate-testdoc.d.ts.map +1 -0
- package/dist/lint/rules/duplicate-testdoc.js +38 -0
- package/dist/lint/rules/duplicate-testdoc.js.map +1 -0
- package/dist/lint/rules/index.d.ts +29 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/index.js +55 -0
- package/dist/lint/rules/index.js.map +1 -0
- package/dist/lint/rules/server-action-structure.d.ts +37 -0
- package/dist/lint/rules/server-action-structure.d.ts.map +1 -0
- package/dist/lint/rules/server-action-structure.js +151 -0
- package/dist/lint/rules/server-action-structure.js.map +1 -0
- package/dist/lint/rules/skipped-test-report.d.ts +11 -0
- package/dist/lint/rules/skipped-test-report.d.ts.map +1 -0
- package/dist/lint/rules/skipped-test-report.js +31 -0
- package/dist/lint/rules/skipped-test-report.js.map +1 -0
- package/dist/lint/rules/structure-rules.d.ts +67 -0
- package/dist/lint/rules/structure-rules.d.ts.map +1 -0
- package/dist/lint/rules/structure-rules.js +615 -0
- package/dist/lint/rules/structure-rules.js.map +1 -0
- package/dist/lint/rules/testdoc-japanese.d.ts +8 -0
- package/dist/lint/rules/testdoc-japanese.d.ts.map +1 -0
- package/dist/lint/rules/testdoc-japanese.js +31 -0
- package/dist/lint/rules/testdoc-japanese.js.map +1 -0
- package/dist/lint/rules/testdoc-min-length.d.ts +8 -0
- package/dist/lint/rules/testdoc-min-length.d.ts.map +1 -0
- package/dist/lint/rules/testdoc-min-length.js +31 -0
- package/dist/lint/rules/testdoc-min-length.js.map +1 -0
- package/dist/lint/rules/testdoc-required.d.ts +8 -0
- package/dist/lint/rules/testdoc-required.d.ts.map +1 -0
- package/dist/lint/rules/testdoc-required.js +27 -0
- package/dist/lint/rules/testdoc-required.js.map +1 -0
- package/dist/lint/rules/workflow-branch-naming.d.ts +20 -0
- package/dist/lint/rules/workflow-branch-naming.d.ts.map +1 -0
- package/dist/lint/rules/workflow-branch-naming.js +85 -0
- package/dist/lint/rules/workflow-branch-naming.js.map +1 -0
- package/dist/lint/rules/workflow-commit-format.d.ts +27 -0
- package/dist/lint/rules/workflow-commit-format.d.ts.map +1 -0
- package/dist/lint/rules/workflow-commit-format.js +92 -0
- package/dist/lint/rules/workflow-commit-format.js.map +1 -0
- package/dist/lint/rules/workflow-issue-fields.d.ts +24 -0
- package/dist/lint/rules/workflow-issue-fields.d.ts.map +1 -0
- package/dist/lint/rules/workflow-issue-fields.js +89 -0
- package/dist/lint/rules/workflow-issue-fields.js.map +1 -0
- package/dist/lint/rules/workflow-main-protection.d.ts +32 -0
- package/dist/lint/rules/workflow-main-protection.d.ts.map +1 -0
- package/dist/lint/rules/workflow-main-protection.js +114 -0
- package/dist/lint/rules/workflow-main-protection.js.map +1 -0
- package/dist/lint/structure-types.d.ts +216 -0
- package/dist/lint/structure-types.d.ts.map +1 -0
- package/dist/lint/structure-types.js +96 -0
- package/dist/lint/structure-types.js.map +1 -0
- package/dist/lint/types.d.ts +154 -0
- package/dist/lint/types.d.ts.map +1 -0
- package/dist/lint/types.js +21 -0
- package/dist/lint/types.js.map +1 -0
- package/dist/lint/workflow-types.d.ts +90 -0
- package/dist/lint/workflow-types.d.ts.map +1 -0
- package/dist/lint/workflow-types.js +7 -0
- package/dist/lint/workflow-types.js.map +1 -0
- package/dist/md/analyzer/index.d.ts +46 -0
- package/dist/md/analyzer/index.d.ts.map +1 -0
- package/dist/md/analyzer/index.js +288 -0
- package/dist/md/analyzer/index.js.map +1 -0
- package/dist/md/builder/index.d.ts +91 -0
- package/dist/md/builder/index.d.ts.map +1 -0
- package/dist/md/builder/index.js +446 -0
- package/dist/md/builder/index.js.map +1 -0
- package/dist/md/cli/analyze.d.ts +11 -0
- package/dist/md/cli/analyze.d.ts.map +1 -0
- package/dist/md/cli/analyze.js +118 -0
- package/dist/md/cli/analyze.js.map +1 -0
- package/dist/md/cli/build.d.ts +11 -0
- package/dist/md/cli/build.d.ts.map +1 -0
- package/dist/md/cli/build.js +74 -0
- package/dist/md/cli/build.js.map +1 -0
- package/dist/md/cli/extract.d.ts +25 -0
- package/dist/md/cli/extract.d.ts.map +1 -0
- package/dist/md/cli/extract.js +230 -0
- package/dist/md/cli/extract.js.map +1 -0
- package/dist/md/cli/index.d.ts +3 -0
- package/dist/md/cli/index.d.ts.map +1 -0
- package/dist/md/cli/index.js +99 -0
- package/dist/md/cli/index.js.map +1 -0
- package/dist/md/cli/lint.d.ts +11 -0
- package/dist/md/cli/lint.d.ts.map +1 -0
- package/dist/md/cli/lint.js +165 -0
- package/dist/md/cli/lint.js.map +1 -0
- package/dist/md/cli/list.d.ts +16 -0
- package/dist/md/cli/list.d.ts.map +1 -0
- package/dist/md/cli/list.js +85 -0
- package/dist/md/cli/list.js.map +1 -0
- package/dist/md/cli/program.d.ts +11 -0
- package/dist/md/cli/program.d.ts.map +1 -0
- package/dist/md/cli/program.js +104 -0
- package/dist/md/cli/program.js.map +1 -0
- package/dist/md/cli/validate.d.ts +8 -0
- package/dist/md/cli/validate.d.ts.map +1 -0
- package/dist/md/cli/validate.js +82 -0
- package/dist/md/cli/validate.js.map +1 -0
- package/dist/md/constants.d.ts +69 -0
- package/dist/md/constants.d.ts.map +1 -0
- package/dist/md/constants.js +69 -0
- package/dist/md/constants.js.map +1 -0
- package/dist/md/extractor/index.d.ts +57 -0
- package/dist/md/extractor/index.d.ts.map +1 -0
- package/dist/md/extractor/index.js +359 -0
- package/dist/md/extractor/index.js.map +1 -0
- package/dist/md/index.d.ts +26 -0
- package/dist/md/index.d.ts.map +1 -0
- package/dist/md/index.js +30 -0
- package/dist/md/index.js.map +1 -0
- package/dist/md/linter/index.d.ts +20 -0
- package/dist/md/linter/index.d.ts.map +1 -0
- package/dist/md/linter/index.js +412 -0
- package/dist/md/linter/index.js.map +1 -0
- package/dist/md/linter/token-optimizer.d.ts +66 -0
- package/dist/md/linter/token-optimizer.d.ts.map +1 -0
- package/dist/md/linter/token-optimizer.js +292 -0
- package/dist/md/linter/token-optimizer.js.map +1 -0
- package/dist/md/lister/index.d.ts +42 -0
- package/dist/md/lister/index.d.ts.map +1 -0
- package/dist/md/lister/index.js +317 -0
- package/dist/md/lister/index.js.map +1 -0
- package/dist/md/parser/heading-numbers.d.ts +43 -0
- package/dist/md/parser/heading-numbers.d.ts.map +1 -0
- package/dist/md/parser/heading-numbers.js +97 -0
- package/dist/md/parser/heading-numbers.js.map +1 -0
- package/dist/md/parser/section-meta.d.ts +50 -0
- package/dist/md/parser/section-meta.d.ts.map +1 -0
- package/dist/md/parser/section-meta.js +212 -0
- package/dist/md/parser/section-meta.js.map +1 -0
- package/dist/md/parser/template.d.ts +56 -0
- package/dist/md/parser/template.d.ts.map +1 -0
- package/dist/md/parser/template.js +122 -0
- package/dist/md/parser/template.js.map +1 -0
- package/dist/md/plugins/loader.d.ts +15 -0
- package/dist/md/plugins/loader.d.ts.map +1 -0
- package/dist/md/plugins/loader.js +80 -0
- package/dist/md/plugins/loader.js.map +1 -0
- package/dist/md/plugins/normalize-headings.d.ts +43 -0
- package/dist/md/plugins/normalize-headings.d.ts.map +1 -0
- package/dist/md/plugins/normalize-headings.js +51 -0
- package/dist/md/plugins/normalize-headings.js.map +1 -0
- package/dist/md/plugins/normalize-whitespace.d.ts +46 -0
- package/dist/md/plugins/normalize-whitespace.d.ts.map +1 -0
- package/dist/md/plugins/normalize-whitespace.js +86 -0
- package/dist/md/plugins/normalize-whitespace.js.map +1 -0
- package/dist/md/plugins/remove-badges.d.ts +36 -0
- package/dist/md/plugins/remove-badges.d.ts.map +1 -0
- package/dist/md/plugins/remove-badges.js +59 -0
- package/dist/md/plugins/remove-badges.js.map +1 -0
- package/dist/md/plugins/remove-comments.d.ts +27 -0
- package/dist/md/plugins/remove-comments.d.ts.map +1 -0
- package/dist/md/plugins/remove-comments.js +40 -0
- package/dist/md/plugins/remove-comments.js.map +1 -0
- package/dist/md/plugins/remove-duplicates.d.ts +40 -0
- package/dist/md/plugins/remove-duplicates.d.ts.map +1 -0
- package/dist/md/plugins/remove-duplicates.js +72 -0
- package/dist/md/plugins/remove-duplicates.js.map +1 -0
- package/dist/md/plugins/remove-internal-links.d.ts +38 -0
- package/dist/md/plugins/remove-internal-links.d.ts.map +1 -0
- package/dist/md/plugins/remove-internal-links.js +66 -0
- package/dist/md/plugins/remove-internal-links.js.map +1 -0
- package/dist/md/plugins/strip-heading-numbers.d.ts +35 -0
- package/dist/md/plugins/strip-heading-numbers.d.ts.map +1 -0
- package/dist/md/plugins/strip-heading-numbers.js +59 -0
- package/dist/md/plugins/strip-heading-numbers.js.map +1 -0
- package/dist/md/plugins/strip-section-meta.d.ts +37 -0
- package/dist/md/plugins/strip-section-meta.d.ts.map +1 -0
- package/dist/md/plugins/strip-section-meta.js +62 -0
- package/dist/md/plugins/strip-section-meta.js.map +1 -0
- package/dist/md/types/config.d.ts +260 -0
- package/dist/md/types/config.d.ts.map +1 -0
- package/dist/md/types/config.js +156 -0
- package/dist/md/types/config.js.map +1 -0
- package/dist/md/types/document.d.ts +37 -0
- package/dist/md/types/document.d.ts.map +1 -0
- package/dist/md/types/document.js +2 -0
- package/dist/md/types/document.js.map +1 -0
- package/dist/md/types/validation.d.ts +107 -0
- package/dist/md/types/validation.d.ts.map +1 -0
- package/dist/md/types/validation.js +2 -0
- package/dist/md/types/validation.js.map +1 -0
- package/dist/md/utils/code-blocks.d.ts +136 -0
- package/dist/md/utils/code-blocks.d.ts.map +1 -0
- package/dist/md/utils/code-blocks.js +178 -0
- package/dist/md/utils/code-blocks.js.map +1 -0
- package/dist/md/utils/config.d.ts +10 -0
- package/dist/md/utils/config.d.ts.map +1 -0
- package/dist/md/utils/config.js +99 -0
- package/dist/md/utils/config.js.map +1 -0
- package/dist/md/utils/file-collector.d.ts +78 -0
- package/dist/md/utils/file-collector.d.ts.map +1 -0
- package/dist/md/utils/file-collector.js +100 -0
- package/dist/md/utils/file-collector.js.map +1 -0
- package/dist/md/utils/markdown.d.ts +18 -0
- package/dist/md/utils/markdown.d.ts.map +1 -0
- package/dist/md/utils/markdown.js +93 -0
- package/dist/md/utils/markdown.js.map +1 -0
- package/dist/md/utils/remark.d.ts +91 -0
- package/dist/md/utils/remark.d.ts.map +1 -0
- package/dist/md/utils/remark.js +125 -0
- package/dist/md/utils/remark.js.map +1 -0
- package/dist/md/utils/tokens.d.ts +9 -0
- package/dist/md/utils/tokens.d.ts.map +1 -0
- package/dist/md/utils/tokens.js +31 -0
- package/dist/md/utils/tokens.js.map +1 -0
- package/dist/md/validator/index.d.ts +40 -0
- package/dist/md/validator/index.d.ts.map +1 -0
- package/dist/md/validator/index.js +289 -0
- package/dist/md/validator/index.js.map +1 -0
- package/dist/parsers/details-jsdoc.d.ts +46 -0
- package/dist/parsers/details-jsdoc.d.ts.map +1 -0
- package/dist/parsers/details-jsdoc.js +262 -0
- package/dist/parsers/details-jsdoc.js.map +1 -0
- package/dist/parsers/details-zod.d.ts +22 -0
- package/dist/parsers/details-zod.d.ts.map +1 -0
- package/dist/parsers/details-zod.js +145 -0
- package/dist/parsers/details-zod.js.map +1 -0
- package/dist/parsers/drizzle-schema.d.ts +92 -0
- package/dist/parsers/drizzle-schema.d.ts.map +1 -0
- package/dist/parsers/drizzle-schema.js +376 -0
- package/dist/parsers/drizzle-schema.js.map +1 -0
- package/dist/parsers/feature-map-tags.d.ts +45 -0
- package/dist/parsers/feature-map-tags.d.ts.map +1 -0
- package/dist/parsers/feature-map-tags.js +292 -0
- package/dist/parsers/feature-map-tags.js.map +1 -0
- package/dist/parsers/feature-map-type-extraction.d.ts +62 -0
- package/dist/parsers/feature-map-type-extraction.d.ts.map +1 -0
- package/dist/parsers/feature-map-type-extraction.js +347 -0
- package/dist/parsers/feature-map-type-extraction.js.map +1 -0
- package/dist/parsers/feature-map-utils.d.ts +34 -0
- package/dist/parsers/feature-map-utils.d.ts.map +1 -0
- package/dist/parsers/feature-map-utils.js +101 -0
- package/dist/parsers/feature-map-utils.js.map +1 -0
- package/dist/parsers/jsdoc-common.d.ts +209 -0
- package/dist/parsers/jsdoc-common.d.ts.map +1 -0
- package/dist/parsers/jsdoc-common.js +655 -0
- package/dist/parsers/jsdoc-common.js.map +1 -0
- package/dist/parsers/jsdoc.d.ts +76 -0
- package/dist/parsers/jsdoc.d.ts.map +1 -0
- package/dist/parsers/jsdoc.js +238 -0
- package/dist/parsers/jsdoc.js.map +1 -0
- package/dist/parsers/screenshot-annotations.d.ts +96 -0
- package/dist/parsers/screenshot-annotations.d.ts.map +1 -0
- package/dist/parsers/screenshot-annotations.js +227 -0
- package/dist/parsers/screenshot-annotations.js.map +1 -0
- package/dist/parsers/test-annotations.d.ts +46 -0
- package/dist/parsers/test-annotations.d.ts.map +1 -0
- package/dist/parsers/test-annotations.js +393 -0
- package/dist/parsers/test-annotations.js.map +1 -0
- package/dist/parsers/test-categorization.d.ts +42 -0
- package/dist/parsers/test-categorization.d.ts.map +1 -0
- package/dist/parsers/test-categorization.js +182 -0
- package/dist/parsers/test-categorization.js.map +1 -0
- package/dist/parsers/zod-schema.d.ts +105 -0
- package/dist/parsers/zod-schema.d.ts.map +1 -0
- package/dist/parsers/zod-schema.js +270 -0
- package/dist/parsers/zod-schema.js.map +1 -0
- package/dist/utils/action-inference.d.ts +23 -0
- package/dist/utils/action-inference.d.ts.map +1 -0
- package/dist/utils/action-inference.js +36 -0
- package/dist/utils/action-inference.js.map +1 -0
- package/dist/utils/app-inference.d.ts +31 -0
- package/dist/utils/app-inference.d.ts.map +1 -0
- package/dist/utils/app-inference.js +41 -0
- package/dist/utils/app-inference.js.map +1 -0
- package/dist/utils/auto-infer.d.ts +93 -0
- package/dist/utils/auto-infer.d.ts.map +1 -0
- package/dist/utils/auto-infer.js +184 -0
- package/dist/utils/auto-infer.js.map +1 -0
- package/dist/utils/config.d.ts +709 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +504 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/file.d.ts +46 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +103 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/formatters.d.ts +111 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +164 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/gh-config.d.ts +99 -0
- package/dist/utils/gh-config.d.ts.map +1 -0
- package/dist/utils/gh-config.js +247 -0
- package/dist/utils/gh-config.js.map +1 -0
- package/dist/utils/github.d.ts +98 -0
- package/dist/utils/github.d.ts.map +1 -0
- package/dist/utils/github.js +295 -0
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/html.d.ts +107 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +376 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/i18n.d.ts +40 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +148 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +49 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/project-fields.d.ts +71 -0
- package/dist/utils/project-fields.d.ts.map +1 -0
- package/dist/utils/project-fields.js +318 -0
- package/dist/utils/project-fields.js.map +1 -0
- package/dist/utils/repo-pairs.d.ts +94 -0
- package/dist/utils/repo-pairs.d.ts.map +1 -0
- package/dist/utils/repo-pairs.js +196 -0
- package/dist/utils/repo-pairs.js.map +1 -0
- package/dist/utils/route-inference.d.ts +81 -0
- package/dist/utils/route-inference.d.ts.map +1 -0
- package/dist/utils/route-inference.js +137 -0
- package/dist/utils/route-inference.js.map +1 -0
- package/dist/utils/setup-check.d.ts +34 -0
- package/dist/utils/setup-check.d.ts.map +1 -0
- package/dist/utils/setup-check.js +136 -0
- package/dist/utils/setup-check.js.map +1 -0
- package/dist/utils/shirokumaignore.d.ts +55 -0
- package/dist/utils/shirokumaignore.d.ts.map +1 -0
- package/dist/utils/shirokumaignore.js +94 -0
- package/dist/utils/shirokumaignore.js.map +1 -0
- package/dist/utils/skills-repo.d.ts +353 -0
- package/dist/utils/skills-repo.d.ts.map +1 -0
- package/dist/utils/skills-repo.js +793 -0
- package/dist/utils/skills-repo.js.map +1 -0
- package/dist/utils/status-workflow.d.ts +54 -0
- package/dist/utils/status-workflow.d.ts.map +1 -0
- package/dist/utils/status-workflow.js +103 -0
- package/dist/utils/status-workflow.js.map +1 -0
- package/dist/validators/frontmatter.d.ts +41 -0
- package/dist/validators/frontmatter.d.ts.map +1 -0
- package/dist/validators/frontmatter.js +117 -0
- package/dist/validators/frontmatter.js.map +1 -0
- package/dist/validators/link-checker.d.ts +48 -0
- package/dist/validators/link-checker.d.ts.map +1 -0
- package/dist/validators/link-checker.js +108 -0
- package/dist/validators/link-checker.js.map +1 -0
- package/dist/validators/markdown-structure.d.ts +50 -0
- package/dist/validators/markdown-structure.d.ts.map +1 -0
- package/dist/validators/markdown-structure.js +253 -0
- package/dist/validators/markdown-structure.js.map +1 -0
- package/i18n/cli/en.json +155 -0
- package/i18n/cli/ja.json +155 -0
- package/i18n/discussion/en.json +191 -0
- package/i18n/discussion/ja.json +191 -0
- package/package.json +113 -0
- package/portal/app/api-tools/api-tools-client.tsx +411 -0
- package/portal/app/api-tools/api-tools-document.tsx +240 -0
- package/portal/app/api-tools/page.tsx +56 -0
- package/portal/app/api-tools/swagger-view.tsx +114 -0
- package/portal/app/apps/[appId]/[type]/[module]/[item]/item-tabs-client.tsx +71 -0
- package/portal/app/apps/[appId]/[type]/[module]/[item]/page.tsx +1422 -0
- package/portal/app/apps/[appId]/[type]/[module]/page.tsx +373 -0
- package/portal/app/apps/[appId]/feature-map/feature-map-app-document.tsx +298 -0
- package/portal/app/apps/[appId]/feature-map/page.tsx +224 -0
- package/portal/app/apps/[appId]/i18n/page.tsx +139 -0
- package/portal/app/apps/[appId]/test-cases/page.tsx +840 -0
- package/portal/app/apps/[appId]/tools/[tool]/page.tsx +351 -0
- package/portal/app/apps/[appId]/tools/api-tools-client.tsx +429 -0
- package/portal/app/apps/[appId]/tools/page.tsx +119 -0
- package/portal/app/db-schema/[db]/[table]/page.tsx +235 -0
- package/portal/app/db-schema/[db]/diagram/page.tsx +81 -0
- package/portal/app/db-schema/[db]/page.tsx +148 -0
- package/portal/app/db-schema/db-schema-document.tsx +100 -0
- package/portal/app/db-schema/diagram/client.tsx +211 -0
- package/portal/app/db-schema/diagram/page.tsx +20 -0
- package/portal/app/db-schema/page.tsx +145 -0
- package/portal/app/db-schema/table-detail-document.tsx +710 -0
- package/portal/app/db-schema/table-detail.tsx +747 -0
- package/portal/app/db-schema/table-list-document.tsx +224 -0
- package/portal/app/db-schema/table-list.tsx +247 -0
- package/portal/app/details/[type]/[module]/[item]/item-tabs-client.tsx +71 -0
- package/portal/app/details/[type]/[module]/[item]/page.tsx +1286 -0
- package/portal/app/details/[type]/[module]/page.tsx +884 -0
- package/portal/app/feature-map/feature-map-client.tsx +681 -0
- package/portal/app/feature-map/feature-map-document.tsx +313 -0
- package/portal/app/feature-map/page.tsx +438 -0
- package/portal/app/globals.css +205 -0
- package/portal/app/i18n/[...namespace]/page.tsx +190 -0
- package/portal/app/i18n/i18n-client.tsx +369 -0
- package/portal/app/i18n/page.tsx +339 -0
- package/portal/app/layout.tsx +37 -0
- package/portal/app/overview/page.tsx +65 -0
- package/portal/app/packages/[packageId]/page.tsx +201 -0
- package/portal/app/packages/page.tsx +148 -0
- package/portal/app/page.tsx +568 -0
- package/portal/app/test-cases/[file]/[line]/page.tsx +455 -0
- package/portal/app/test-cases/[file]/[line]/test-detail-document.tsx +335 -0
- package/portal/app/test-cases/[file]/page.tsx +323 -0
- package/portal/app/test-cases/[file]/test-file-document.tsx +335 -0
- package/portal/app/test-cases/page.tsx +546 -0
- package/portal/app/test-cases/test-cases-document.tsx +384 -0
- package/portal/components/code-block.tsx +57 -0
- package/portal/components/document/doc-params-table.tsx +71 -0
- package/portal/components/document/doc-section.tsx +133 -0
- package/portal/components/document/doc-table.tsx +119 -0
- package/portal/components/document/index.ts +9 -0
- package/portal/components/drawflow-er-diagram.tsx +607 -0
- package/portal/components/interactive-er-diagram.tsx +228 -0
- package/portal/components/layout/app-sidebar.tsx +490 -0
- package/portal/components/layout/er-sidebar.tsx +116 -0
- package/portal/components/layout/global-header.tsx +117 -0
- package/portal/components/layout/layout-content.tsx +48 -0
- package/portal/components/markdown-content.tsx +120 -0
- package/portal/components/mermaid-diagram.tsx +83 -0
- package/portal/components/reactflow-er-diagram.tsx +475 -0
- package/portal/components/search-dialog.tsx +268 -0
- package/portal/components/shared/coverage-score-bar.tsx +144 -0
- package/portal/components/swagger/endpoint-accordion.tsx +117 -0
- package/portal/components/swagger/index.ts +7 -0
- package/portal/components/swagger/method-badge.tsx +55 -0
- package/portal/components/swagger/params-table.tsx +78 -0
- package/portal/components/tabs-with-hash.tsx +43 -0
- package/portal/components/test/index.ts +2 -0
- package/portal/components/test/test-bdd-card.tsx +192 -0
- package/portal/components/test/test-matrix.tsx +242 -0
- package/portal/components/ui/accordion.tsx +66 -0
- package/portal/components/ui/badge.tsx +46 -0
- package/portal/components/ui/breadcrumb.tsx +109 -0
- package/portal/components/ui/button.tsx +62 -0
- package/portal/components/ui/card.tsx +92 -0
- package/portal/components/ui/collapsible.tsx +33 -0
- package/portal/components/ui/dialog.tsx +118 -0
- package/portal/components/ui/progress.tsx +28 -0
- package/portal/components/ui/scroll-area.tsx +58 -0
- package/portal/components/ui/sheet.tsx +139 -0
- package/portal/components/ui/table.tsx +116 -0
- package/portal/components/ui/tabs.tsx +66 -0
- package/portal/components.json +21 -0
- package/portal/lib/constants/test-categories.ts +186 -0
- package/portal/lib/data-loader.ts +1181 -0
- package/portal/lib/db-schema-utils.ts +182 -0
- package/portal/lib/format.ts +43 -0
- package/portal/lib/hooks/use-hash-tab.ts +144 -0
- package/portal/lib/path-utils.ts +25 -0
- package/portal/lib/search-index-generator.ts +214 -0
- package/portal/lib/search.ts +126 -0
- package/portal/lib/sidebar-context.tsx +111 -0
- package/portal/lib/types.ts +740 -0
- package/portal/lib/utils.ts +6 -0
- package/portal/next.config.ts +21 -0
- package/portal/package.json +45 -0
- package/portal/postcss.config.mjs +8 -0
- package/portal/tsconfig.json +41 -0
- package/portal/types/drawflow.d.ts +80 -0
- package/templates/README.md +73 -0
- package/templates/coverage.html +367 -0
- package/templates/dark-theme.css +443 -0
- package/templates/discussion/adr.yml.hbs +65 -0
- package/templates/discussion/handovers.yml.hbs +57 -0
- package/templates/discussion/knowledge.yml.hbs +60 -0
- package/templates/discussion/reports.yml.hbs +68 -0
- package/templates/discussion/research.yml.hbs +61 -0
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Tools documentation generator
|
|
3
|
+
*
|
|
4
|
+
* Parses MCP Tool[] definitions and generates documentation.
|
|
5
|
+
* Supports apps/mcp/src/tools/*.ts structure.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from "fs";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
import * as glob from "glob";
|
|
10
|
+
// typescript は重い依存のため、コマンド実行時のみ動的にロードする
|
|
11
|
+
let ts;
|
|
12
|
+
import { loadConfig } from "../utils/config.js";
|
|
13
|
+
import { inferAppFromPath } from "../utils/app-inference.js";
|
|
14
|
+
/**
|
|
15
|
+
* Infer HTTP method from tool name
|
|
16
|
+
*
|
|
17
|
+
* Checks both prefix and suffix patterns:
|
|
18
|
+
* - Prefix: get_user, list_items, search_entities
|
|
19
|
+
* - Suffix: entity_get, project_list, user_delete
|
|
20
|
+
*/
|
|
21
|
+
function inferHttpMethod(toolName) {
|
|
22
|
+
const name = toolName.toLowerCase();
|
|
23
|
+
// GET patterns: read-only operations (prefix, suffix, or middle with _get_)
|
|
24
|
+
if (name.match(/^(get|list|search|find|fetch|read|check|verify|validate)_/) ||
|
|
25
|
+
name.match(/_(get|list|search|find|fetch|read|check|verify|validate)$/) ||
|
|
26
|
+
name.includes("_get_") || name.includes("_list_") || name.includes("_search_")) {
|
|
27
|
+
return "GET";
|
|
28
|
+
}
|
|
29
|
+
// DELETE patterns: removal operations (prefix or suffix)
|
|
30
|
+
if (name.match(/^(delete|remove|revoke|cancel|reject)_/) ||
|
|
31
|
+
name.match(/_(delete|remove|revoke|cancel|reject)$/)) {
|
|
32
|
+
return "DELETE";
|
|
33
|
+
}
|
|
34
|
+
// PUT patterns: update operations (prefix or suffix)
|
|
35
|
+
if (name.match(/^(update|edit|modify|set|change|rename|move)_/) ||
|
|
36
|
+
name.match(/_(update|edit|modify|set|change|rename|move)$/)) {
|
|
37
|
+
return "PUT";
|
|
38
|
+
}
|
|
39
|
+
// PATCH patterns: partial update operations (prefix or suffix)
|
|
40
|
+
if (name.match(/^(patch|toggle|enable|disable)_/) ||
|
|
41
|
+
name.match(/_(patch|toggle|enable|disable)$/)) {
|
|
42
|
+
return "PATCH";
|
|
43
|
+
}
|
|
44
|
+
// POST patterns (default): create/action operations
|
|
45
|
+
// create, add, start, complete, pause, resume, approve, defer, import, link, etc.
|
|
46
|
+
return "POST";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Extract JSDoc tags from a comment string
|
|
50
|
+
*/
|
|
51
|
+
function extractJsDocTags(comment) {
|
|
52
|
+
const tags = {};
|
|
53
|
+
const tagRegex = /@(\w+)\s+([^\n@]+)?/g;
|
|
54
|
+
let match;
|
|
55
|
+
while ((match = tagRegex.exec(comment)) !== null) {
|
|
56
|
+
const [, tagName, tagValue] = match;
|
|
57
|
+
tags[tagName] = (tagValue || "").trim();
|
|
58
|
+
}
|
|
59
|
+
return tags;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Parse file header JSDoc for module-level annotations
|
|
63
|
+
*/
|
|
64
|
+
function parseFileHeaderAnnotations(sourceCode) {
|
|
65
|
+
const headerMatch = sourceCode.match(/^\/\*\*[\s\S]*?\*\//);
|
|
66
|
+
if (!headerMatch)
|
|
67
|
+
return {};
|
|
68
|
+
const tags = extractJsDocTags(headerMatch[0]);
|
|
69
|
+
return {
|
|
70
|
+
feature: tags.feature,
|
|
71
|
+
dbTables: tags.dbTables?.split(",").map((t) => t.trim()),
|
|
72
|
+
authLevel: tags.authLevel,
|
|
73
|
+
relatedTests: tags.relatedTests,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get leading JSDoc comment for a node
|
|
78
|
+
*/
|
|
79
|
+
function getLeadingJsDoc(node, sourceFile) {
|
|
80
|
+
const fullText = sourceFile.getFullText();
|
|
81
|
+
const nodeStart = node.getFullStart();
|
|
82
|
+
// Look for JSDoc comment before the node
|
|
83
|
+
const textBefore = fullText.substring(Math.max(0, nodeStart - 500), nodeStart);
|
|
84
|
+
const jsDocMatch = textBefore.match(/\/\*\*[\s\S]*?\*\/\s*$/);
|
|
85
|
+
return jsDocMatch ? jsDocMatch[0] : null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Parse MCP tool definitions from TypeScript source
|
|
89
|
+
*/
|
|
90
|
+
function parseApiToolsFromSource(filePath, sourceCode) {
|
|
91
|
+
const tools = [];
|
|
92
|
+
const app = inferAppFromPath(filePath);
|
|
93
|
+
const category = path.basename(filePath, ".ts");
|
|
94
|
+
// Parse file header annotations (module-level)
|
|
95
|
+
const fileAnnotations = parseFileHeaderAnnotations(sourceCode);
|
|
96
|
+
// Parse TypeScript AST
|
|
97
|
+
const sourceFile = ts.createSourceFile(filePath, sourceCode, ts.ScriptTarget.Latest, true);
|
|
98
|
+
// Find Tool[] array literals
|
|
99
|
+
function visit(node) {
|
|
100
|
+
// Look for variable declarations with Tool[] type
|
|
101
|
+
if (ts.isVariableDeclaration(node) && node.initializer) {
|
|
102
|
+
if (ts.isArrayLiteralExpression(node.initializer)) {
|
|
103
|
+
// Check if it's a Tool[] array
|
|
104
|
+
const varName = node.name.getText(sourceFile);
|
|
105
|
+
if (varName.endsWith("Tools") || varName.includes("tool")) {
|
|
106
|
+
// Parse each tool object in the array
|
|
107
|
+
for (const element of node.initializer.elements) {
|
|
108
|
+
if (ts.isObjectLiteralExpression(element)) {
|
|
109
|
+
// Get JSDoc comment before this element
|
|
110
|
+
const jsDoc = getLeadingJsDoc(element, sourceFile);
|
|
111
|
+
const toolAnnotations = jsDoc ? extractJsDocTags(jsDoc) : {};
|
|
112
|
+
const tool = parseToolObject(element, sourceFile, filePath, app, category);
|
|
113
|
+
if (tool) {
|
|
114
|
+
// Merge annotations: tool-level > file-level
|
|
115
|
+
tool.feature = toolAnnotations.feature || fileAnnotations.feature;
|
|
116
|
+
tool.dbTables = toolAnnotations.dbTables
|
|
117
|
+
? toolAnnotations.dbTables.split(",").map((t) => t.trim())
|
|
118
|
+
: fileAnnotations.dbTables;
|
|
119
|
+
tool.authLevel = toolAnnotations.authLevel || fileAnnotations.authLevel;
|
|
120
|
+
tool.relatedTests = toolAnnotations.relatedTests || fileAnnotations.relatedTests;
|
|
121
|
+
tools.push(tool);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
ts.forEachChild(node, visit);
|
|
129
|
+
}
|
|
130
|
+
visit(sourceFile);
|
|
131
|
+
return tools;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Parse a single tool object literal
|
|
135
|
+
*/
|
|
136
|
+
function parseToolObject(obj, sourceFile, filePath, app, category) {
|
|
137
|
+
let name = "";
|
|
138
|
+
let description = "";
|
|
139
|
+
const params = [];
|
|
140
|
+
const required = [];
|
|
141
|
+
for (const prop of obj.properties) {
|
|
142
|
+
if (!ts.isPropertyAssignment(prop))
|
|
143
|
+
continue;
|
|
144
|
+
const propName = prop.name.getText(sourceFile);
|
|
145
|
+
if (propName === "name" && ts.isStringLiteral(prop.initializer)) {
|
|
146
|
+
name = prop.initializer.text;
|
|
147
|
+
}
|
|
148
|
+
if (propName === "description" && ts.isStringLiteral(prop.initializer)) {
|
|
149
|
+
description = prop.initializer.text;
|
|
150
|
+
}
|
|
151
|
+
if (propName === "inputSchema" && ts.isObjectLiteralExpression(prop.initializer)) {
|
|
152
|
+
// Parse inputSchema
|
|
153
|
+
for (const schemaProp of prop.initializer.properties) {
|
|
154
|
+
if (!ts.isPropertyAssignment(schemaProp))
|
|
155
|
+
continue;
|
|
156
|
+
const schemaPropName = schemaProp.name.getText(sourceFile);
|
|
157
|
+
if (schemaPropName === "properties" && ts.isObjectLiteralExpression(schemaProp.initializer)) {
|
|
158
|
+
// Parse properties
|
|
159
|
+
for (const paramProp of schemaProp.initializer.properties) {
|
|
160
|
+
if (!ts.isPropertyAssignment(paramProp))
|
|
161
|
+
continue;
|
|
162
|
+
const paramName = paramProp.name.getText(sourceFile);
|
|
163
|
+
if (ts.isObjectLiteralExpression(paramProp.initializer)) {
|
|
164
|
+
const param = parseParamObject(paramName, paramProp.initializer, sourceFile);
|
|
165
|
+
params.push(param);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (schemaPropName === "required" && ts.isArrayLiteralExpression(schemaProp.initializer)) {
|
|
170
|
+
for (const reqElement of schemaProp.initializer.elements) {
|
|
171
|
+
if (ts.isStringLiteral(reqElement)) {
|
|
172
|
+
required.push(reqElement.text);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Mark required params
|
|
180
|
+
for (const param of params) {
|
|
181
|
+
param.required = required.includes(param.name);
|
|
182
|
+
}
|
|
183
|
+
if (!name)
|
|
184
|
+
return null;
|
|
185
|
+
return {
|
|
186
|
+
name,
|
|
187
|
+
description,
|
|
188
|
+
params,
|
|
189
|
+
sourceFile: filePath,
|
|
190
|
+
app,
|
|
191
|
+
category,
|
|
192
|
+
httpMethod: inferHttpMethod(name),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Parse parameter object
|
|
197
|
+
*/
|
|
198
|
+
function parseParamObject(name, obj, sourceFile) {
|
|
199
|
+
let type = "string";
|
|
200
|
+
let description = "";
|
|
201
|
+
let defaultValue = undefined;
|
|
202
|
+
for (const prop of obj.properties) {
|
|
203
|
+
if (!ts.isPropertyAssignment(prop))
|
|
204
|
+
continue;
|
|
205
|
+
const propName = prop.name.getText(sourceFile);
|
|
206
|
+
if (propName === "type" && ts.isStringLiteral(prop.initializer)) {
|
|
207
|
+
type = prop.initializer.text;
|
|
208
|
+
}
|
|
209
|
+
if (propName === "description" && ts.isStringLiteral(prop.initializer)) {
|
|
210
|
+
description = prop.initializer.text;
|
|
211
|
+
}
|
|
212
|
+
if (propName === "default") {
|
|
213
|
+
if (ts.isStringLiteral(prop.initializer)) {
|
|
214
|
+
defaultValue = prop.initializer.text;
|
|
215
|
+
}
|
|
216
|
+
else if (ts.isNumericLiteral(prop.initializer)) {
|
|
217
|
+
defaultValue = Number(prop.initializer.text);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
name,
|
|
223
|
+
type,
|
|
224
|
+
description,
|
|
225
|
+
required: false,
|
|
226
|
+
default: defaultValue,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Generate HTML documentation
|
|
231
|
+
*/
|
|
232
|
+
function generateApiToolsHtml(data) {
|
|
233
|
+
const toolsByCategory = {};
|
|
234
|
+
for (const tool of data.tools) {
|
|
235
|
+
if (!toolsByCategory[tool.category]) {
|
|
236
|
+
toolsByCategory[tool.category] = [];
|
|
237
|
+
}
|
|
238
|
+
toolsByCategory[tool.category].push(tool);
|
|
239
|
+
}
|
|
240
|
+
const sidebarItems = Object.entries(toolsByCategory)
|
|
241
|
+
.map(([category, tools]) => {
|
|
242
|
+
const toolLinks = tools
|
|
243
|
+
.map((t) => `<a href="#${t.name}" class="sidebar-subitem">${t.name}</a>`)
|
|
244
|
+
.join("\n");
|
|
245
|
+
return `
|
|
246
|
+
<div class="sidebar-category">
|
|
247
|
+
<div class="sidebar-category-title">${category}</div>
|
|
248
|
+
${toolLinks}
|
|
249
|
+
</div>
|
|
250
|
+
`;
|
|
251
|
+
})
|
|
252
|
+
.join("\n");
|
|
253
|
+
const toolCards = data.tools
|
|
254
|
+
.map((tool) => {
|
|
255
|
+
const paramsHtml = tool.params.length
|
|
256
|
+
? `
|
|
257
|
+
<div class="params-section">
|
|
258
|
+
<h4>Parameters</h4>
|
|
259
|
+
<table class="params-table">
|
|
260
|
+
<thead>
|
|
261
|
+
<tr>
|
|
262
|
+
<th>Name</th>
|
|
263
|
+
<th>Type</th>
|
|
264
|
+
<th>Required</th>
|
|
265
|
+
<th>Description</th>
|
|
266
|
+
</tr>
|
|
267
|
+
</thead>
|
|
268
|
+
<tbody>
|
|
269
|
+
${tool.params
|
|
270
|
+
.map((p) => `
|
|
271
|
+
<tr>
|
|
272
|
+
<td><code>${p.name}</code></td>
|
|
273
|
+
<td><code>${p.type}</code></td>
|
|
274
|
+
<td>${p.required ? "✅" : "—"}</td>
|
|
275
|
+
<td>${p.description}${p.default !== undefined ? ` (default: ${p.default})` : ""}</td>
|
|
276
|
+
</tr>
|
|
277
|
+
`)
|
|
278
|
+
.join("")}
|
|
279
|
+
</tbody>
|
|
280
|
+
</table>
|
|
281
|
+
</div>
|
|
282
|
+
`
|
|
283
|
+
: "";
|
|
284
|
+
// Auth level badge
|
|
285
|
+
const authBadge = tool.authLevel
|
|
286
|
+
? `<span class="badge badge-auth badge-${tool.authLevel}">${tool.authLevel}</span>`
|
|
287
|
+
: "";
|
|
288
|
+
// Feature badge
|
|
289
|
+
const featureBadge = tool.feature
|
|
290
|
+
? `<span class="badge badge-teal">${tool.feature}</span>`
|
|
291
|
+
: "";
|
|
292
|
+
// DB tables
|
|
293
|
+
const dbTablesHtml = tool.dbTables?.length
|
|
294
|
+
? `<div class="meta-item"><span class="meta-label">DB:</span> ${tool.dbTables.join(", ")}</div>`
|
|
295
|
+
: "";
|
|
296
|
+
// Tests
|
|
297
|
+
const testsHtml = tool.tests?.length
|
|
298
|
+
? `<div class="tests-section">
|
|
299
|
+
<h4>Related Tests (${tool.tests.length})</h4>
|
|
300
|
+
<ul class="tests-list">
|
|
301
|
+
${tool.tests.map((t) => `<li><code>${t.target}</code> - ${t.testdoc}</li>`).join("")}
|
|
302
|
+
</ul>
|
|
303
|
+
</div>`
|
|
304
|
+
: "";
|
|
305
|
+
return `
|
|
306
|
+
<div class="tool-card" id="${tool.name}">
|
|
307
|
+
<div class="tool-header">
|
|
308
|
+
<h3 class="tool-name">${tool.name}</h3>
|
|
309
|
+
<div class="tool-badges">
|
|
310
|
+
<span class="badge badge-purple">${tool.category}</span>
|
|
311
|
+
${featureBadge}
|
|
312
|
+
${authBadge}
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
<p class="tool-description">${tool.description}</p>
|
|
316
|
+
${dbTablesHtml}
|
|
317
|
+
${paramsHtml}
|
|
318
|
+
${testsHtml}
|
|
319
|
+
<div class="tool-source">
|
|
320
|
+
<span class="source-label">Source:</span>
|
|
321
|
+
<code>${tool.sourceFile}</code>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
`;
|
|
325
|
+
})
|
|
326
|
+
.join("\n");
|
|
327
|
+
return `<!DOCTYPE html>
|
|
328
|
+
<html lang="en">
|
|
329
|
+
<head>
|
|
330
|
+
<meta charset="UTF-8">
|
|
331
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
332
|
+
<title>API Tools - Documentation Portal</title>
|
|
333
|
+
<style>
|
|
334
|
+
:root {
|
|
335
|
+
--bg-primary: #0d1117;
|
|
336
|
+
--bg-secondary: #161b22;
|
|
337
|
+
--bg-tertiary: #21262d;
|
|
338
|
+
--border-color: #30363d;
|
|
339
|
+
--text-primary: #e6edf3;
|
|
340
|
+
--text-secondary: #8b949e;
|
|
341
|
+
--accent-purple: #a371f7;
|
|
342
|
+
--accent-blue: #58a6ff;
|
|
343
|
+
--accent-green: #3fb950;
|
|
344
|
+
--accent-teal: #2dd4bf;
|
|
345
|
+
--accent-orange: #f97316;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
* {
|
|
349
|
+
box-sizing: border-box;
|
|
350
|
+
margin: 0;
|
|
351
|
+
padding: 0;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
body {
|
|
355
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
|
|
356
|
+
background: var(--bg-primary);
|
|
357
|
+
color: var(--text-primary);
|
|
358
|
+
line-height: 1.6;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.layout {
|
|
362
|
+
display: flex;
|
|
363
|
+
min-height: 100vh;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.sidebar {
|
|
367
|
+
width: 280px;
|
|
368
|
+
background: var(--bg-secondary);
|
|
369
|
+
border-right: 1px solid var(--border-color);
|
|
370
|
+
padding: 1.5rem;
|
|
371
|
+
position: fixed;
|
|
372
|
+
height: 100vh;
|
|
373
|
+
overflow-y: auto;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.sidebar-title {
|
|
377
|
+
font-size: 1.25rem;
|
|
378
|
+
font-weight: 600;
|
|
379
|
+
margin-bottom: 1.5rem;
|
|
380
|
+
color: var(--accent-purple);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.sidebar-category {
|
|
384
|
+
margin-bottom: 1rem;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.sidebar-category-title {
|
|
388
|
+
font-size: 0.875rem;
|
|
389
|
+
font-weight: 600;
|
|
390
|
+
color: var(--text-secondary);
|
|
391
|
+
text-transform: uppercase;
|
|
392
|
+
margin-bottom: 0.5rem;
|
|
393
|
+
padding-left: 0.5rem;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.sidebar-subitem {
|
|
397
|
+
display: block;
|
|
398
|
+
padding: 0.375rem 0.75rem;
|
|
399
|
+
color: var(--text-primary);
|
|
400
|
+
text-decoration: none;
|
|
401
|
+
font-size: 0.875rem;
|
|
402
|
+
border-radius: 6px;
|
|
403
|
+
margin-bottom: 2px;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.sidebar-subitem:hover {
|
|
407
|
+
background: var(--bg-tertiary);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.main-content {
|
|
411
|
+
flex: 1;
|
|
412
|
+
margin-left: 280px;
|
|
413
|
+
padding: 2rem;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.page-header {
|
|
417
|
+
margin-bottom: 2rem;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.page-title {
|
|
421
|
+
font-size: 2rem;
|
|
422
|
+
font-weight: 600;
|
|
423
|
+
margin-bottom: 0.5rem;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.page-subtitle {
|
|
427
|
+
color: var(--text-secondary);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.stats-bar {
|
|
431
|
+
display: flex;
|
|
432
|
+
gap: 1.5rem;
|
|
433
|
+
margin-bottom: 2rem;
|
|
434
|
+
padding: 1rem;
|
|
435
|
+
background: var(--bg-secondary);
|
|
436
|
+
border-radius: 8px;
|
|
437
|
+
border: 1px solid var(--border-color);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.stat-item {
|
|
441
|
+
text-align: center;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.stat-value {
|
|
445
|
+
font-size: 1.5rem;
|
|
446
|
+
font-weight: 600;
|
|
447
|
+
color: var(--accent-blue);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.stat-label {
|
|
451
|
+
font-size: 0.75rem;
|
|
452
|
+
color: var(--text-secondary);
|
|
453
|
+
text-transform: uppercase;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.tool-card {
|
|
457
|
+
background: var(--bg-secondary);
|
|
458
|
+
border: 1px solid var(--border-color);
|
|
459
|
+
border-radius: 8px;
|
|
460
|
+
padding: 1.5rem;
|
|
461
|
+
margin-bottom: 1.5rem;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.tool-header {
|
|
465
|
+
display: flex;
|
|
466
|
+
align-items: center;
|
|
467
|
+
gap: 0.75rem;
|
|
468
|
+
margin-bottom: 0.75rem;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.tool-name {
|
|
472
|
+
font-size: 1.125rem;
|
|
473
|
+
font-weight: 600;
|
|
474
|
+
color: var(--accent-blue);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.badge {
|
|
478
|
+
font-size: 0.75rem;
|
|
479
|
+
padding: 0.25rem 0.5rem;
|
|
480
|
+
border-radius: 4px;
|
|
481
|
+
font-weight: 500;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.badge-purple {
|
|
485
|
+
background: rgba(163, 113, 247, 0.2);
|
|
486
|
+
color: var(--accent-purple);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.badge-teal {
|
|
490
|
+
background: rgba(45, 212, 191, 0.2);
|
|
491
|
+
color: var(--accent-teal);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.badge-member {
|
|
495
|
+
background: rgba(63, 185, 80, 0.2);
|
|
496
|
+
color: var(--accent-green);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.badge-authenticated {
|
|
500
|
+
background: rgba(88, 166, 255, 0.2);
|
|
501
|
+
color: var(--accent-blue);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.badge-admin {
|
|
505
|
+
background: rgba(249, 115, 22, 0.2);
|
|
506
|
+
color: var(--accent-orange);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.tool-badges {
|
|
510
|
+
display: flex;
|
|
511
|
+
gap: 0.5rem;
|
|
512
|
+
flex-wrap: wrap;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.meta-item {
|
|
516
|
+
font-size: 0.8125rem;
|
|
517
|
+
color: var(--text-secondary);
|
|
518
|
+
margin-bottom: 0.5rem;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.meta-label {
|
|
522
|
+
font-weight: 500;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.tests-section {
|
|
526
|
+
margin-top: 1rem;
|
|
527
|
+
padding-top: 1rem;
|
|
528
|
+
border-top: 1px solid var(--border-color);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.tests-section h4 {
|
|
532
|
+
font-size: 0.875rem;
|
|
533
|
+
font-weight: 600;
|
|
534
|
+
margin-bottom: 0.5rem;
|
|
535
|
+
color: var(--text-secondary);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.tests-list {
|
|
539
|
+
list-style: none;
|
|
540
|
+
font-size: 0.8125rem;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.tests-list li {
|
|
544
|
+
padding: 0.25rem 0;
|
|
545
|
+
color: var(--text-secondary);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.tests-list code {
|
|
549
|
+
background: var(--bg-tertiary);
|
|
550
|
+
padding: 0.125rem 0.375rem;
|
|
551
|
+
border-radius: 4px;
|
|
552
|
+
color: var(--accent-green);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.tool-description {
|
|
556
|
+
color: var(--text-secondary);
|
|
557
|
+
margin-bottom: 1rem;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.params-section h4 {
|
|
561
|
+
font-size: 0.875rem;
|
|
562
|
+
font-weight: 600;
|
|
563
|
+
margin-bottom: 0.75rem;
|
|
564
|
+
color: var(--text-secondary);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.params-table {
|
|
568
|
+
width: 100%;
|
|
569
|
+
border-collapse: collapse;
|
|
570
|
+
font-size: 0.875rem;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.params-table th,
|
|
574
|
+
.params-table td {
|
|
575
|
+
padding: 0.5rem 0.75rem;
|
|
576
|
+
text-align: left;
|
|
577
|
+
border-bottom: 1px solid var(--border-color);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.params-table th {
|
|
581
|
+
color: var(--text-secondary);
|
|
582
|
+
font-weight: 500;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.params-table code {
|
|
586
|
+
background: var(--bg-tertiary);
|
|
587
|
+
padding: 0.125rem 0.375rem;
|
|
588
|
+
border-radius: 4px;
|
|
589
|
+
font-size: 0.8125rem;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.tool-source {
|
|
593
|
+
margin-top: 1rem;
|
|
594
|
+
padding-top: 0.75rem;
|
|
595
|
+
border-top: 1px solid var(--border-color);
|
|
596
|
+
font-size: 0.75rem;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.source-label {
|
|
600
|
+
color: var(--text-secondary);
|
|
601
|
+
margin-right: 0.5rem;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.tool-source code {
|
|
605
|
+
color: var(--text-secondary);
|
|
606
|
+
}
|
|
607
|
+
</style>
|
|
608
|
+
</head>
|
|
609
|
+
<body>
|
|
610
|
+
<div class="layout">
|
|
611
|
+
<aside class="sidebar">
|
|
612
|
+
<div class="sidebar-title">API Tools</div>
|
|
613
|
+
${sidebarItems}
|
|
614
|
+
</aside>
|
|
615
|
+
|
|
616
|
+
<main class="main-content">
|
|
617
|
+
<header class="page-header">
|
|
618
|
+
<h1 class="page-title">API Tools Documentation</h1>
|
|
619
|
+
<p class="page-subtitle">Model Context Protocol tools for AI assistants</p>
|
|
620
|
+
</header>
|
|
621
|
+
|
|
622
|
+
<div class="stats-bar">
|
|
623
|
+
<div class="stat-item">
|
|
624
|
+
<div class="stat-value">${data.tools.length}</div>
|
|
625
|
+
<div class="stat-label">Total Tools</div>
|
|
626
|
+
</div>
|
|
627
|
+
<div class="stat-item">
|
|
628
|
+
<div class="stat-value">${data.categories.length}</div>
|
|
629
|
+
<div class="stat-label">Categories</div>
|
|
630
|
+
</div>
|
|
631
|
+
<div class="stat-item">
|
|
632
|
+
<div class="stat-value">${data.apps.join(", ") || "—"}</div>
|
|
633
|
+
<div class="stat-label">Apps</div>
|
|
634
|
+
</div>
|
|
635
|
+
</div>
|
|
636
|
+
|
|
637
|
+
<section class="tools-list">
|
|
638
|
+
${toolCards}
|
|
639
|
+
</section>
|
|
640
|
+
</main>
|
|
641
|
+
</div>
|
|
642
|
+
</body>
|
|
643
|
+
</html>`;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Parse test files for @target annotations
|
|
647
|
+
*/
|
|
648
|
+
function parseTestsForTargets(projectPath) {
|
|
649
|
+
const testPattern = path.join(projectPath, "apps/mcp/src/__tests__/*.test.ts");
|
|
650
|
+
const testFiles = glob.sync(testPattern);
|
|
651
|
+
const tests = [];
|
|
652
|
+
for (const testFile of testFiles) {
|
|
653
|
+
const sourceCode = fs.readFileSync(testFile, "utf-8");
|
|
654
|
+
const relativePath = path.relative(projectPath, testFile);
|
|
655
|
+
// Find describe blocks with @target annotation
|
|
656
|
+
const describeRegex = /\/\*\*[\s\S]*?@target\s+(\S+)[\s\S]*?@testdoc\s+([^\n@]+)[\s\S]*?\*\/\s*describe\s*\(/g;
|
|
657
|
+
let match;
|
|
658
|
+
while ((match = describeRegex.exec(sourceCode)) !== null) {
|
|
659
|
+
const [, target, testdoc] = match;
|
|
660
|
+
tests.push({
|
|
661
|
+
target: target.trim(),
|
|
662
|
+
testdoc: testdoc.trim(),
|
|
663
|
+
file: relativePath,
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
// Also check for testdoc first, target second (different order)
|
|
667
|
+
const altRegex = /\/\*\*[\s\S]*?@testdoc\s+([^\n@]+)[\s\S]*?@target\s+(\S+)[\s\S]*?\*\/\s*describe\s*\(/g;
|
|
668
|
+
while ((match = altRegex.exec(sourceCode)) !== null) {
|
|
669
|
+
const [, testdoc, target] = match;
|
|
670
|
+
// Avoid duplicates
|
|
671
|
+
if (!tests.some((t) => t.target === target.trim() && t.testdoc === testdoc.trim())) {
|
|
672
|
+
tests.push({
|
|
673
|
+
target: target.trim(),
|
|
674
|
+
testdoc: testdoc.trim(),
|
|
675
|
+
file: relativePath,
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return tests;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Run API Tools documentation generator
|
|
684
|
+
*/
|
|
685
|
+
export async function runApiTools(options) {
|
|
686
|
+
// typescript を動的にロード(グローバルインストール時に起動を妨げないため)
|
|
687
|
+
const tsModule = await import("typescript");
|
|
688
|
+
ts = tsModule.default ?? tsModule;
|
|
689
|
+
const { projectPath, configPath } = options;
|
|
690
|
+
// Load config (optional, MCP tools don't need much config)
|
|
691
|
+
const configFile = configPath || "shirokuma-docs.config.yaml";
|
|
692
|
+
let _config = null;
|
|
693
|
+
try {
|
|
694
|
+
_config = loadConfig(projectPath, configFile);
|
|
695
|
+
}
|
|
696
|
+
catch {
|
|
697
|
+
// Config is optional for api-tools
|
|
698
|
+
}
|
|
699
|
+
// Find MCP tool files
|
|
700
|
+
const mcpPattern = path.join(projectPath, "apps/mcp/src/tools/*.ts");
|
|
701
|
+
const toolFiles = glob.sync(mcpPattern, { ignore: ["**/__tests__/**", "**/*.test.ts"] });
|
|
702
|
+
if (toolFiles.length === 0) {
|
|
703
|
+
console.log("info", "MCP tool files not found in apps/mcp/src/tools/");
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
console.log("info", `Found ${toolFiles.length} MCP tool files`);
|
|
707
|
+
// Parse all tool files
|
|
708
|
+
const allTools = [];
|
|
709
|
+
for (const filePath of toolFiles) {
|
|
710
|
+
const sourceCode = fs.readFileSync(filePath, "utf-8");
|
|
711
|
+
const relativePath = path.relative(projectPath, filePath);
|
|
712
|
+
const tools = parseApiToolsFromSource(relativePath, sourceCode);
|
|
713
|
+
allTools.push(...tools);
|
|
714
|
+
}
|
|
715
|
+
console.log("info", `Parsed ${allTools.length} MCP tools`);
|
|
716
|
+
// Parse test files and link to tools
|
|
717
|
+
const allTests = parseTestsForTargets(projectPath);
|
|
718
|
+
console.log("info", `Found ${allTests.length} test targets`);
|
|
719
|
+
// Link tests to tools and calculate coverage
|
|
720
|
+
for (const tool of allTools) {
|
|
721
|
+
tool.tests = allTests.filter((t) => t.target === tool.name);
|
|
722
|
+
// Calculate coverage score (similar to details.ts logic)
|
|
723
|
+
const testCount = tool.tests?.length || 0;
|
|
724
|
+
const hasAuth = tool.authLevel && tool.authLevel !== "none";
|
|
725
|
+
const hasDb = tool.dbTables && tool.dbTables.length > 0;
|
|
726
|
+
let score = 0;
|
|
727
|
+
if (testCount > 0) {
|
|
728
|
+
// Base score for having any tests
|
|
729
|
+
score = 40;
|
|
730
|
+
// Bonus for multiple tests
|
|
731
|
+
if (testCount >= 3)
|
|
732
|
+
score += 20;
|
|
733
|
+
if (testCount >= 5)
|
|
734
|
+
score += 20;
|
|
735
|
+
// Bonus for DB integration tests
|
|
736
|
+
if (hasDb && testCount >= 2)
|
|
737
|
+
score += 10;
|
|
738
|
+
// Bonus for auth testing
|
|
739
|
+
if (hasAuth && testCount >= 2)
|
|
740
|
+
score += 10;
|
|
741
|
+
score = Math.min(score, 100);
|
|
742
|
+
}
|
|
743
|
+
tool.testCoverage = {
|
|
744
|
+
hasTest: testCount > 0,
|
|
745
|
+
totalTests: testCount,
|
|
746
|
+
coverageScore: score,
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
// Build output
|
|
750
|
+
const categories = [...new Set(allTools.map((t) => t.category))];
|
|
751
|
+
const apps = [...new Set(allTools.map((t) => t.app))];
|
|
752
|
+
const output = {
|
|
753
|
+
generatedAt: new Date().toISOString(),
|
|
754
|
+
projectPath,
|
|
755
|
+
tools: allTools,
|
|
756
|
+
categories,
|
|
757
|
+
apps,
|
|
758
|
+
};
|
|
759
|
+
// Determine output directory
|
|
760
|
+
const outputDir = options.outputDir || path.join(projectPath, "docs/portal");
|
|
761
|
+
if (!fs.existsSync(outputDir)) {
|
|
762
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
763
|
+
}
|
|
764
|
+
// Write JSON
|
|
765
|
+
const jsonPath = path.join(outputDir, "api-tools.json");
|
|
766
|
+
fs.writeFileSync(jsonPath, JSON.stringify(output, null, 2));
|
|
767
|
+
console.log("done", `JSON: ${jsonPath}`);
|
|
768
|
+
// Write HTML
|
|
769
|
+
const htmlPath = path.join(outputDir, "api-tools.html");
|
|
770
|
+
const htmlContent = generateApiToolsHtml(output);
|
|
771
|
+
fs.writeFileSync(htmlPath, htmlContent);
|
|
772
|
+
console.log("done", `HTML: ${htmlPath}`);
|
|
773
|
+
console.log("done", "MCP tools documentation generated");
|
|
774
|
+
}
|
|
775
|
+
//# sourceMappingURL=api-tools.js.map
|