codesift-mcp 0.2.18 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -20
- package/dist/cache/hono-cache.d.ts +50 -0
- package/dist/cache/hono-cache.d.ts.map +1 -0
- package/dist/cache/hono-cache.js +132 -0
- package/dist/cache/hono-cache.js.map +1 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +17 -2
- package/dist/cli/setup.js.map +1 -1
- package/dist/formatters-shortening.d.ts +13 -0
- package/dist/formatters-shortening.d.ts.map +1 -1
- package/dist/formatters-shortening.js +131 -0
- package/dist/formatters-shortening.js.map +1 -1
- package/dist/formatters.d.ts +38 -0
- package/dist/formatters.d.ts.map +1 -1
- package/dist/formatters.js +498 -0
- package/dist/formatters.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +27 -26
- package/dist/instructions.js.map +1 -1
- package/dist/lsp/lsp-servers.d.ts.map +1 -1
- package/dist/lsp/lsp-servers.js +5 -0
- package/dist/lsp/lsp-servers.js.map +1 -1
- package/dist/lsp/lsp-tools.d.ts.map +1 -1
- package/dist/lsp/lsp-tools.js +1 -0
- package/dist/lsp/lsp-tools.js.map +1 -1
- package/dist/parser/astro-template.d.ts +47 -0
- package/dist/parser/astro-template.d.ts.map +1 -0
- package/dist/parser/astro-template.js +171 -0
- package/dist/parser/astro-template.js.map +1 -0
- package/dist/parser/extractors/_shared.d.ts +4 -0
- package/dist/parser/extractors/_shared.d.ts.map +1 -1
- package/dist/parser/extractors/_shared.js +8 -0
- package/dist/parser/extractors/_shared.js.map +1 -1
- package/dist/parser/extractors/astro.d.ts +4 -5
- package/dist/parser/extractors/astro.d.ts.map +1 -1
- package/dist/parser/extractors/astro.js +102 -26
- package/dist/parser/extractors/astro.js.map +1 -1
- package/dist/parser/extractors/gradle-kts.d.ts +4 -0
- package/dist/parser/extractors/gradle-kts.d.ts.map +1 -0
- package/dist/parser/extractors/gradle-kts.js +246 -0
- package/dist/parser/extractors/gradle-kts.js.map +1 -0
- package/dist/parser/extractors/hono-inline-analyzer.d.ts +34 -0
- package/dist/parser/extractors/hono-inline-analyzer.d.ts.map +1 -0
- package/dist/parser/extractors/hono-inline-analyzer.js +465 -0
- package/dist/parser/extractors/hono-inline-analyzer.js.map +1 -0
- package/dist/parser/extractors/hono-model.d.ts +196 -0
- package/dist/parser/extractors/hono-model.d.ts.map +1 -0
- package/dist/parser/extractors/hono-model.js +10 -0
- package/dist/parser/extractors/hono-model.js.map +1 -0
- package/dist/parser/extractors/hono.d.ts +118 -0
- package/dist/parser/extractors/hono.d.ts.map +1 -0
- package/dist/parser/extractors/hono.js +1527 -0
- package/dist/parser/extractors/hono.js.map +1 -0
- package/dist/parser/extractors/kotlin.d.ts +4 -0
- package/dist/parser/extractors/kotlin.d.ts.map +1 -0
- package/dist/parser/extractors/kotlin.js +521 -0
- package/dist/parser/extractors/kotlin.js.map +1 -0
- package/dist/parser/extractors/php.d.ts +22 -0
- package/dist/parser/extractors/php.d.ts.map +1 -0
- package/dist/parser/extractors/php.js +326 -0
- package/dist/parser/extractors/php.js.map +1 -0
- package/dist/parser/extractors/python.d.ts.map +1 -1
- package/dist/parser/extractors/python.js +234 -11
- package/dist/parser/extractors/python.js.map +1 -1
- package/dist/parser/extractors/sql.d.ts +33 -0
- package/dist/parser/extractors/sql.d.ts.map +1 -0
- package/dist/parser/extractors/sql.js +506 -0
- package/dist/parser/extractors/sql.js.map +1 -0
- package/dist/parser/extractors/typescript.d.ts.map +1 -1
- package/dist/parser/extractors/typescript.js +166 -3
- package/dist/parser/extractors/typescript.js.map +1 -1
- package/dist/parser/languages/tree-sitter-javascript.wasm +0 -0
- package/dist/parser/languages/tree-sitter-kotlin.wasm +0 -0
- package/dist/parser/languages/tree-sitter-php.wasm +0 -0
- package/dist/parser/languages/tree-sitter-php_only.wasm +0 -0
- package/dist/parser/languages/tree-sitter-python.wasm +0 -0
- package/dist/parser/parser-manager.d.ts +32 -0
- package/dist/parser/parser-manager.d.ts.map +1 -1
- package/dist/parser/parser-manager.js +82 -3
- package/dist/parser/parser-manager.js.map +1 -1
- package/dist/parser/symbol-extractor.d.ts.map +1 -1
- package/dist/parser/symbol-extractor.js +16 -0
- package/dist/parser/symbol-extractor.js.map +1 -1
- package/dist/register-tools.d.ts +37 -1
- package/dist/register-tools.d.ts.map +1 -1
- package/dist/register-tools.js +2657 -191
- package/dist/register-tools.js.map +1 -1
- package/dist/search/reranker.js +1 -1
- package/dist/search/reranker.js.map +1 -1
- package/dist/server-helpers.d.ts.map +1 -1
- package/dist/server-helpers.js +11 -0
- package/dist/server-helpers.js.map +1 -1
- package/dist/server.js +28 -1
- package/dist/server.js.map +1 -1
- package/dist/storage/index-store.d.ts +15 -1
- package/dist/storage/index-store.d.ts.map +1 -1
- package/dist/storage/index-store.js +27 -1
- package/dist/storage/index-store.js.map +1 -1
- package/dist/storage/session-state.d.ts +1 -1
- package/dist/storage/session-state.d.ts.map +1 -1
- package/dist/storage/session-state.js +6 -4
- package/dist/storage/session-state.js.map +1 -1
- package/dist/tools/agent-config-tools.d.ts +24 -0
- package/dist/tools/agent-config-tools.d.ts.map +1 -0
- package/dist/tools/agent-config-tools.js +119 -0
- package/dist/tools/agent-config-tools.js.map +1 -0
- package/dist/tools/architecture-tools.d.ts +23 -0
- package/dist/tools/architecture-tools.d.ts.map +1 -0
- package/dist/tools/architecture-tools.js +140 -0
- package/dist/tools/architecture-tools.js.map +1 -0
- package/dist/tools/astro-config.d.ts +33 -0
- package/dist/tools/astro-config.d.ts.map +1 -0
- package/dist/tools/astro-config.js +260 -0
- package/dist/tools/astro-config.js.map +1 -0
- package/dist/tools/astro-islands.d.ts +61 -0
- package/dist/tools/astro-islands.d.ts.map +1 -0
- package/dist/tools/astro-islands.js +240 -0
- package/dist/tools/astro-islands.js.map +1 -0
- package/dist/tools/astro-routes.d.ts +49 -0
- package/dist/tools/astro-routes.d.ts.map +1 -0
- package/dist/tools/astro-routes.js +119 -0
- package/dist/tools/astro-routes.js.map +1 -0
- package/dist/tools/audit-tools.d.ts +38 -0
- package/dist/tools/audit-tools.d.ts.map +1 -0
- package/dist/tools/audit-tools.js +248 -0
- package/dist/tools/audit-tools.js.map +1 -0
- package/dist/tools/celery-tools.d.ts +38 -0
- package/dist/tools/celery-tools.d.ts.map +1 -0
- package/dist/tools/celery-tools.js +154 -0
- package/dist/tools/celery-tools.js.map +1 -0
- package/dist/tools/clone-tools.js +1 -1
- package/dist/tools/clone-tools.js.map +1 -1
- package/dist/tools/complexity-tools.d.ts +4 -0
- package/dist/tools/complexity-tools.d.ts.map +1 -1
- package/dist/tools/complexity-tools.js +78 -4
- package/dist/tools/complexity-tools.js.map +1 -1
- package/dist/tools/compose-tools.d.ts +60 -0
- package/dist/tools/compose-tools.d.ts.map +1 -0
- package/dist/tools/compose-tools.js +203 -0
- package/dist/tools/compose-tools.js.map +1 -0
- package/dist/tools/coupling-tools.d.ts +50 -0
- package/dist/tools/coupling-tools.d.ts.map +1 -0
- package/dist/tools/coupling-tools.js +262 -0
- package/dist/tools/coupling-tools.js.map +1 -0
- package/dist/tools/dependency-audit-tools.d.ts +65 -0
- package/dist/tools/dependency-audit-tools.d.ts.map +1 -0
- package/dist/tools/dependency-audit-tools.js +553 -0
- package/dist/tools/dependency-audit-tools.js.map +1 -0
- package/dist/tools/django-settings.d.ts +22 -0
- package/dist/tools/django-settings.d.ts.map +1 -0
- package/dist/tools/django-settings.js +301 -0
- package/dist/tools/django-settings.js.map +1 -0
- package/dist/tools/frequency-tools.js +1 -1
- package/dist/tools/frequency-tools.js.map +1 -1
- package/dist/tools/graph-tools.d.ts +8 -2
- package/dist/tools/graph-tools.d.ts.map +1 -1
- package/dist/tools/graph-tools.js +44 -3
- package/dist/tools/graph-tools.js.map +1 -1
- package/dist/tools/hilt-tools.d.ts +55 -0
- package/dist/tools/hilt-tools.d.ts.map +1 -0
- package/dist/tools/hilt-tools.js +258 -0
- package/dist/tools/hilt-tools.js.map +1 -0
- package/dist/tools/hono-analyze-app.d.ts +48 -0
- package/dist/tools/hono-analyze-app.d.ts.map +1 -0
- package/dist/tools/hono-analyze-app.js +102 -0
- package/dist/tools/hono-analyze-app.js.map +1 -0
- package/dist/tools/hono-api-contract.d.ts +22 -0
- package/dist/tools/hono-api-contract.d.ts.map +1 -0
- package/dist/tools/hono-api-contract.js +80 -0
- package/dist/tools/hono-api-contract.js.map +1 -0
- package/dist/tools/hono-conditional-middleware.d.ts +27 -0
- package/dist/tools/hono-conditional-middleware.d.ts.map +1 -0
- package/dist/tools/hono-conditional-middleware.js +62 -0
- package/dist/tools/hono-conditional-middleware.js.map +1 -0
- package/dist/tools/hono-context-flow.d.ts +24 -0
- package/dist/tools/hono-context-flow.d.ts.map +1 -0
- package/dist/tools/hono-context-flow.js +78 -0
- package/dist/tools/hono-context-flow.js.map +1 -0
- package/dist/tools/hono-dead-routes.d.ts +26 -0
- package/dist/tools/hono-dead-routes.d.ts.map +1 -0
- package/dist/tools/hono-dead-routes.js +109 -0
- package/dist/tools/hono-dead-routes.js.map +1 -0
- package/dist/tools/hono-env-regression.d.ts +29 -0
- package/dist/tools/hono-env-regression.d.ts.map +1 -0
- package/dist/tools/hono-env-regression.js +157 -0
- package/dist/tools/hono-env-regression.js.map +1 -0
- package/dist/tools/hono-inline-analyze.d.ts +31 -0
- package/dist/tools/hono-inline-analyze.d.ts.map +1 -0
- package/dist/tools/hono-inline-analyze.js +67 -0
- package/dist/tools/hono-inline-analyze.js.map +1 -0
- package/dist/tools/hono-middleware-chain.d.ts +22 -0
- package/dist/tools/hono-middleware-chain.d.ts.map +1 -0
- package/dist/tools/hono-middleware-chain.js +84 -0
- package/dist/tools/hono-middleware-chain.js.map +1 -0
- package/dist/tools/hono-modules.d.ts +22 -0
- package/dist/tools/hono-modules.d.ts.map +1 -0
- package/dist/tools/hono-modules.js +126 -0
- package/dist/tools/hono-modules.js.map +1 -0
- package/dist/tools/hono-response-types.d.ts +37 -0
- package/dist/tools/hono-response-types.d.ts.map +1 -0
- package/dist/tools/hono-response-types.js +84 -0
- package/dist/tools/hono-response-types.js.map +1 -0
- package/dist/tools/hono-rpc-types.d.ts +21 -0
- package/dist/tools/hono-rpc-types.d.ts.map +1 -0
- package/dist/tools/hono-rpc-types.js +57 -0
- package/dist/tools/hono-rpc-types.js.map +1 -0
- package/dist/tools/hono-security.d.ts +21 -0
- package/dist/tools/hono-security.d.ts.map +1 -0
- package/dist/tools/hono-security.js +98 -0
- package/dist/tools/hono-security.js.map +1 -0
- package/dist/tools/hono-visualize.d.ts +13 -0
- package/dist/tools/hono-visualize.d.ts.map +1 -0
- package/dist/tools/hono-visualize.js +72 -0
- package/dist/tools/hono-visualize.js.map +1 -0
- package/dist/tools/hotspot-tools.d.ts.map +1 -1
- package/dist/tools/hotspot-tools.js +9 -7
- package/dist/tools/hotspot-tools.js.map +1 -1
- package/dist/tools/index-tools.d.ts +17 -0
- package/dist/tools/index-tools.d.ts.map +1 -1
- package/dist/tools/index-tools.js +210 -10
- package/dist/tools/index-tools.js.map +1 -1
- package/dist/tools/kotlin-tools.d.ts +142 -0
- package/dist/tools/kotlin-tools.d.ts.map +1 -0
- package/dist/tools/kotlin-tools.js +572 -0
- package/dist/tools/kotlin-tools.js.map +1 -0
- package/dist/tools/legacy-hono-conventions.d.ts +14 -0
- package/dist/tools/legacy-hono-conventions.d.ts.map +1 -0
- package/dist/tools/legacy-hono-conventions.js +152 -0
- package/dist/tools/legacy-hono-conventions.js.map +1 -0
- package/dist/tools/migration-lint-tools.d.ts +26 -0
- package/dist/tools/migration-lint-tools.d.ts.map +1 -0
- package/dist/tools/migration-lint-tools.js +247 -0
- package/dist/tools/migration-lint-tools.js.map +1 -0
- package/dist/tools/model-tools.d.ts +30 -0
- package/dist/tools/model-tools.d.ts.map +1 -0
- package/dist/tools/model-tools.js +145 -0
- package/dist/tools/model-tools.js.map +1 -0
- package/dist/tools/nest-ext-tools.d.ts +92 -0
- package/dist/tools/nest-ext-tools.d.ts.map +1 -0
- package/dist/tools/nest-ext-tools.js +359 -0
- package/dist/tools/nest-ext-tools.js.map +1 -0
- package/dist/tools/nest-tools.d.ts +171 -0
- package/dist/tools/nest-tools.d.ts.map +1 -0
- package/dist/tools/nest-tools.js +1042 -0
- package/dist/tools/nest-tools.js.map +1 -0
- package/dist/tools/nextjs-api-contract-readers.d.ts +14 -0
- package/dist/tools/nextjs-api-contract-readers.d.ts.map +1 -0
- package/dist/tools/nextjs-api-contract-readers.js +204 -0
- package/dist/tools/nextjs-api-contract-readers.js.map +1 -0
- package/dist/tools/nextjs-api-contract-tools.d.ts +57 -0
- package/dist/tools/nextjs-api-contract-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-api-contract-tools.js +144 -0
- package/dist/tools/nextjs-api-contract-tools.js.map +1 -0
- package/dist/tools/nextjs-boundary-tools.d.ts +39 -0
- package/dist/tools/nextjs-boundary-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-boundary-tools.js +152 -0
- package/dist/tools/nextjs-boundary-tools.js.map +1 -0
- package/dist/tools/nextjs-component-tools.d.ts +121 -0
- package/dist/tools/nextjs-component-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-component-tools.js +460 -0
- package/dist/tools/nextjs-component-tools.js.map +1 -0
- package/dist/tools/nextjs-data-flow-tools.d.ts +42 -0
- package/dist/tools/nextjs-data-flow-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-data-flow-tools.js +158 -0
- package/dist/tools/nextjs-data-flow-tools.js.map +1 -0
- package/dist/tools/nextjs-framework-audit-tools.d.ts +37 -0
- package/dist/tools/nextjs-framework-audit-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-framework-audit-tools.js +211 -0
- package/dist/tools/nextjs-framework-audit-tools.js.map +1 -0
- package/dist/tools/nextjs-link-tools.d.ts +41 -0
- package/dist/tools/nextjs-link-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-link-tools.js +157 -0
- package/dist/tools/nextjs-link-tools.js.map +1 -0
- package/dist/tools/nextjs-metadata-tools.d.ts +74 -0
- package/dist/tools/nextjs-metadata-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-metadata-tools.js +252 -0
- package/dist/tools/nextjs-metadata-tools.js.map +1 -0
- package/dist/tools/nextjs-middleware-coverage-tools.d.ts +41 -0
- package/dist/tools/nextjs-middleware-coverage-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-middleware-coverage-tools.js +88 -0
- package/dist/tools/nextjs-middleware-coverage-tools.js.map +1 -0
- package/dist/tools/nextjs-route-tools.d.ts +100 -0
- package/dist/tools/nextjs-route-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-route-tools.js +493 -0
- package/dist/tools/nextjs-route-tools.js.map +1 -0
- package/dist/tools/nextjs-security-readers.d.ts +22 -0
- package/dist/tools/nextjs-security-readers.d.ts.map +1 -0
- package/dist/tools/nextjs-security-readers.js +318 -0
- package/dist/tools/nextjs-security-readers.js.map +1 -0
- package/dist/tools/nextjs-security-scoring.d.ts +15 -0
- package/dist/tools/nextjs-security-scoring.d.ts.map +1 -0
- package/dist/tools/nextjs-security-scoring.js +65 -0
- package/dist/tools/nextjs-security-scoring.js.map +1 -0
- package/dist/tools/nextjs-security-tools.d.ts +75 -0
- package/dist/tools/nextjs-security-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-security-tools.js +153 -0
- package/dist/tools/nextjs-security-tools.js.map +1 -0
- package/dist/tools/nextjs-tools.d.ts +15 -0
- package/dist/tools/nextjs-tools.d.ts.map +1 -0
- package/dist/tools/nextjs-tools.js +15 -0
- package/dist/tools/nextjs-tools.js.map +1 -0
- package/dist/tools/outline-tools.d.ts.map +1 -1
- package/dist/tools/outline-tools.js +20 -0
- package/dist/tools/outline-tools.js.map +1 -1
- package/dist/tools/pattern-tools.d.ts +8 -0
- package/dist/tools/pattern-tools.d.ts.map +1 -1
- package/dist/tools/pattern-tools.js +561 -3
- package/dist/tools/pattern-tools.js.map +1 -1
- package/dist/tools/perf-tools.d.ts +32 -0
- package/dist/tools/perf-tools.d.ts.map +1 -0
- package/dist/tools/perf-tools.js +227 -0
- package/dist/tools/perf-tools.js.map +1 -0
- package/dist/tools/php-tools.d.ts +176 -0
- package/dist/tools/php-tools.d.ts.map +1 -0
- package/dist/tools/php-tools.js +543 -0
- package/dist/tools/php-tools.js.map +1 -0
- package/dist/tools/prisma-schema-tools.d.ts +44 -0
- package/dist/tools/prisma-schema-tools.d.ts.map +1 -0
- package/dist/tools/prisma-schema-tools.js +358 -0
- package/dist/tools/prisma-schema-tools.js.map +1 -0
- package/dist/tools/project-tools.d.ts +115 -6
- package/dist/tools/project-tools.d.ts.map +1 -1
- package/dist/tools/project-tools.js +594 -217
- package/dist/tools/project-tools.js.map +1 -1
- package/dist/tools/pyproject-tools.d.ts +23 -0
- package/dist/tools/pyproject-tools.d.ts.map +1 -0
- package/dist/tools/pyproject-tools.js +133 -0
- package/dist/tools/pyproject-tools.js.map +1 -0
- package/dist/tools/pytest-tools.d.ts +20 -0
- package/dist/tools/pytest-tools.d.ts.map +1 -0
- package/dist/tools/pytest-tools.js +106 -0
- package/dist/tools/pytest-tools.js.map +1 -0
- package/dist/tools/python-callers.d.ts +28 -0
- package/dist/tools/python-callers.d.ts.map +1 -0
- package/dist/tools/python-callers.js +110 -0
- package/dist/tools/python-callers.js.map +1 -0
- package/dist/tools/python-circular-imports.d.ts +19 -0
- package/dist/tools/python-circular-imports.d.ts.map +1 -0
- package/dist/tools/python-circular-imports.js +126 -0
- package/dist/tools/python-circular-imports.js.map +1 -0
- package/dist/tools/python-deps-analyzer.d.ts +46 -0
- package/dist/tools/python-deps-analyzer.d.ts.map +1 -0
- package/dist/tools/python-deps-analyzer.js +227 -0
- package/dist/tools/python-deps-analyzer.js.map +1 -0
- package/dist/tools/query-tools.d.ts +23 -0
- package/dist/tools/query-tools.d.ts.map +1 -0
- package/dist/tools/query-tools.js +256 -0
- package/dist/tools/query-tools.js.map +1 -0
- package/dist/tools/react-tools.d.ts +218 -0
- package/dist/tools/react-tools.d.ts.map +1 -0
- package/dist/tools/react-tools.js +714 -0
- package/dist/tools/react-tools.js.map +1 -0
- package/dist/tools/report-tools.js +47 -0
- package/dist/tools/report-tools.js.map +1 -1
- package/dist/tools/review-diff-tools.d.ts +2 -6
- package/dist/tools/review-diff-tools.d.ts.map +1 -1
- package/dist/tools/review-diff-tools.js +51 -66
- package/dist/tools/review-diff-tools.js.map +1 -1
- package/dist/tools/room-tools.d.ts +36 -0
- package/dist/tools/room-tools.d.ts.map +1 -0
- package/dist/tools/room-tools.js +147 -0
- package/dist/tools/room-tools.js.map +1 -0
- package/dist/tools/route-tools.d.ts +27 -1
- package/dist/tools/route-tools.d.ts.map +1 -1
- package/dist/tools/route-tools.js +744 -18
- package/dist/tools/route-tools.js.map +1 -1
- package/dist/tools/ruff-tools.d.ts +32 -0
- package/dist/tools/ruff-tools.d.ts.map +1 -0
- package/dist/tools/ruff-tools.js +114 -0
- package/dist/tools/ruff-tools.js.map +1 -0
- package/dist/tools/search-ranker.d.ts.map +1 -1
- package/dist/tools/search-ranker.js +7 -0
- package/dist/tools/search-ranker.js.map +1 -1
- package/dist/tools/serialization-tools.d.ts +24 -0
- package/dist/tools/serialization-tools.d.ts.map +1 -0
- package/dist/tools/serialization-tools.js +156 -0
- package/dist/tools/serialization-tools.js.map +1 -0
- package/dist/tools/sql-tools.d.ts +234 -0
- package/dist/tools/sql-tools.d.ts.map +1 -0
- package/dist/tools/sql-tools.js +1037 -0
- package/dist/tools/sql-tools.js.map +1 -0
- package/dist/tools/status-tools.d.ts +10 -0
- package/dist/tools/status-tools.d.ts.map +1 -0
- package/dist/tools/status-tools.js +32 -0
- package/dist/tools/status-tools.js.map +1 -0
- package/dist/tools/symbol-tools.d.ts +19 -0
- package/dist/tools/symbol-tools.d.ts.map +1 -1
- package/dist/tools/symbol-tools.js +78 -4
- package/dist/tools/symbol-tools.js.map +1 -1
- package/dist/tools/test-impact-tools.d.ts +29 -0
- package/dist/tools/test-impact-tools.d.ts.map +1 -0
- package/dist/tools/test-impact-tools.js +156 -0
- package/dist/tools/test-impact-tools.js.map +1 -0
- package/dist/tools/typecheck-tools.d.ts +39 -0
- package/dist/tools/typecheck-tools.d.ts.map +1 -0
- package/dist/tools/typecheck-tools.js +191 -0
- package/dist/tools/typecheck-tools.js.map +1 -0
- package/dist/tools/wiring-tools.d.ts +19 -0
- package/dist/tools/wiring-tools.d.ts.map +1 -0
- package/dist/tools/wiring-tools.js +147 -0
- package/dist/tools/wiring-tools.js.map +1 -0
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/framework-detect.d.ts +18 -2
- package/dist/utils/framework-detect.d.ts.map +1 -1
- package/dist/utils/framework-detect.js +150 -3
- package/dist/utils/framework-detect.js.map +1 -1
- package/dist/utils/import-graph.d.ts +36 -0
- package/dist/utils/import-graph.d.ts.map +1 -1
- package/dist/utils/import-graph.js +212 -9
- package/dist/utils/import-graph.js.map +1 -1
- package/dist/utils/language-detect.d.ts +21 -0
- package/dist/utils/language-detect.d.ts.map +1 -0
- package/dist/utils/language-detect.js +183 -0
- package/dist/utils/language-detect.js.map +1 -0
- package/dist/utils/nextjs-ast-readers.d.ts +44 -0
- package/dist/utils/nextjs-ast-readers.d.ts.map +1 -0
- package/dist/utils/nextjs-ast-readers.js +341 -0
- package/dist/utils/nextjs-ast-readers.js.map +1 -0
- package/dist/utils/nextjs-audit-cache.d.ts +51 -0
- package/dist/utils/nextjs-audit-cache.d.ts.map +1 -0
- package/dist/utils/nextjs-audit-cache.js +116 -0
- package/dist/utils/nextjs-audit-cache.js.map +1 -0
- package/dist/utils/nextjs-metadata-readers.d.ts +65 -0
- package/dist/utils/nextjs-metadata-readers.d.ts.map +1 -0
- package/dist/utils/nextjs-metadata-readers.js +447 -0
- package/dist/utils/nextjs-metadata-readers.js.map +1 -0
- package/dist/utils/nextjs.d.ts +42 -0
- package/dist/utils/nextjs.d.ts.map +1 -0
- package/dist/utils/nextjs.js +284 -0
- package/dist/utils/nextjs.js.map +1 -0
- package/dist/utils/python-import-resolver.d.ts +42 -0
- package/dist/utils/python-import-resolver.d.ts.map +1 -0
- package/dist/utils/python-import-resolver.js +101 -0
- package/dist/utils/python-import-resolver.js.map +1 -0
- package/dist/utils/python-imports.d.ts +28 -0
- package/dist/utils/python-imports.d.ts.map +1 -0
- package/dist/utils/python-imports.js +117 -0
- package/dist/utils/python-imports.js.map +1 -0
- package/dist/utils/react-alias.d.ts +15 -0
- package/dist/utils/react-alias.d.ts.map +1 -0
- package/dist/utils/react-alias.js +31 -0
- package/dist/utils/react-alias.js.map +1 -0
- package/dist/utils/test-file.d.ts.map +1 -1
- package/dist/utils/test-file.js +7 -0
- package/dist/utils/test-file.js.map +1 -1
- package/dist/utils/walk.d.ts +22 -0
- package/dist/utils/walk.d.ts.map +1 -1
- package/dist/utils/walk.js +70 -2
- package/dist/utils/walk.js.map +1 -1
- package/package.json +3 -2
- package/rules/codesift.md +34 -5
- package/rules/codesift.mdc +34 -5
- package/rules/codex.md +34 -5
- package/rules/gemini.md +34 -5
- package/src/parser/languages/tree-sitter-javascript.wasm +0 -0
- package/src/parser/languages/tree-sitter-kotlin.wasm +0 -0
- package/src/parser/languages/tree-sitter-php.wasm +0 -0
- package/src/parser/languages/tree-sitter-php_only.wasm +0 -0
- package/src/parser/languages/tree-sitter-python.wasm +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trace_context_flow — tracks c.set/c.get/c.var/c.env flow through Hono app.
|
|
3
|
+
*
|
|
4
|
+
* Identifies MISSING_CONTEXT_VARIABLE when a route accesses a var that no
|
|
5
|
+
* middleware in its scope sets.
|
|
6
|
+
*
|
|
7
|
+
* Spec: docs/specs/2026-04-10-hono-framework-intelligence-spec.md (Task 18)
|
|
8
|
+
*/
|
|
9
|
+
import type { ContextVariable } from "../parser/extractors/hono-model.js";
|
|
10
|
+
export interface ContextFlowResult {
|
|
11
|
+
context_vars?: ContextVariable[];
|
|
12
|
+
findings?: Array<{
|
|
13
|
+
type: "MISSING_CONTEXT_VARIABLE";
|
|
14
|
+
variable: string;
|
|
15
|
+
route: string;
|
|
16
|
+
get_point: {
|
|
17
|
+
file: string;
|
|
18
|
+
line: number;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function traceContextFlow(repo: string, variable?: string): Promise<ContextFlowResult>;
|
|
24
|
+
//# sourceMappingURL=hono-context-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-context-flow.d.ts","sourceRoot":"","sources":["../../src/tools/hono-context-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,0BAA0B,CAAC;QACjC,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3C,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CA4D5B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trace_context_flow — tracks c.set/c.get/c.var/c.env flow through Hono app.
|
|
3
|
+
*
|
|
4
|
+
* Identifies MISSING_CONTEXT_VARIABLE when a route accesses a var that no
|
|
5
|
+
* middleware in its scope sets.
|
|
6
|
+
*
|
|
7
|
+
* Spec: docs/specs/2026-04-10-hono-framework-intelligence-spec.md (Task 18)
|
|
8
|
+
*/
|
|
9
|
+
import { getCodeIndex } from "./index-tools.js";
|
|
10
|
+
import { honoCache } from "../cache/hono-cache.js";
|
|
11
|
+
import { HonoExtractor } from "../parser/extractors/hono.js";
|
|
12
|
+
import { detectFrameworks } from "../utils/framework-detect.js";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
export async function traceContextFlow(repo, variable) {
|
|
15
|
+
const index = await getCodeIndex(repo);
|
|
16
|
+
if (!index)
|
|
17
|
+
return { error: `Repository "${repo}" not found` };
|
|
18
|
+
const frameworks = detectFrameworks(index);
|
|
19
|
+
if (!frameworks.has("hono"))
|
|
20
|
+
return { error: "No Hono app detected" };
|
|
21
|
+
const entryFile = resolveHonoEntryFile(index);
|
|
22
|
+
if (!entryFile)
|
|
23
|
+
return { error: "No Hono app entry file found" };
|
|
24
|
+
let model;
|
|
25
|
+
try {
|
|
26
|
+
model = await honoCache.get(repo, entryFile, new HonoExtractor());
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
30
|
+
return { error: `Failed to parse: ${msg}` };
|
|
31
|
+
}
|
|
32
|
+
const vars = variable
|
|
33
|
+
? model.context_vars.filter((cv) => cv.name === variable)
|
|
34
|
+
: model.context_vars;
|
|
35
|
+
const findings = [];
|
|
36
|
+
// MISSING_CONTEXT_VARIABLE detection: variable accessed in route whose
|
|
37
|
+
// middleware scope doesn't include a setter
|
|
38
|
+
for (const cv of vars) {
|
|
39
|
+
if (cv.is_env_binding)
|
|
40
|
+
continue; // c.env.* always available
|
|
41
|
+
if (cv.set_points.length === 0)
|
|
42
|
+
continue;
|
|
43
|
+
for (const getPoint of cv.get_points) {
|
|
44
|
+
// Find route containing this get point
|
|
45
|
+
const route = model.routes.find((r) => r.file === getPoint.file &&
|
|
46
|
+
Math.abs(r.line - getPoint.line) <= 50);
|
|
47
|
+
if (!route)
|
|
48
|
+
continue;
|
|
49
|
+
// Check if any middleware chain matching the route has a file that
|
|
50
|
+
// contains a set_point for this variable
|
|
51
|
+
const activeScopes = model.middleware_chains.filter((mc) => {
|
|
52
|
+
if (mc.scope === "*")
|
|
53
|
+
return true;
|
|
54
|
+
const pattern = mc.scope.replace(/\*/g, ".*");
|
|
55
|
+
return new RegExp(`^${pattern}$`).test(route.path);
|
|
56
|
+
});
|
|
57
|
+
const setInScope = cv.set_points.some((sp) => activeScopes.some((s) => s.entries.some((e) => e.file === sp.file)));
|
|
58
|
+
if (!setInScope) {
|
|
59
|
+
findings.push({
|
|
60
|
+
type: "MISSING_CONTEXT_VARIABLE",
|
|
61
|
+
variable: cv.name,
|
|
62
|
+
route: route.path,
|
|
63
|
+
get_point: { file: getPoint.file, line: getPoint.line },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { context_vars: vars, findings };
|
|
69
|
+
}
|
|
70
|
+
function resolveHonoEntryFile(index) {
|
|
71
|
+
for (const sym of index.symbols) {
|
|
72
|
+
if (sym.source && /new\s+(?:Hono|OpenAPIHono)\s*(?:<[^>]*>)?\s*\(/.test(sym.source)) {
|
|
73
|
+
return join(index.root, sym.file);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=hono-context-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-context-flow.js","sourceRoot":"","sources":["../../src/tools/hono-context-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW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0B;oBAChC,QAAQ,EAAE,EAAE,CAAC,IAAI;oBACjB,KAAK,EAAE,KAAK,CAAC,IAAI;oBACjB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE;iBACxD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,oBAAoB,CAAC,KAG7B;IACC,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAChC,IAAI,GAAG,CAAC,MAAM,IAAI,gDAAgD,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* find_dead_hono_routes — heuristically flags server routes that are not
|
|
3
|
+
* called by any Hono RPC client (`hc<AppType>(...).segment.$method(...)`)
|
|
4
|
+
* in the repo. Useful in monorepos with colocated server + client code
|
|
5
|
+
* during refactors: you can delete server routes that no client touches.
|
|
6
|
+
*
|
|
7
|
+
* HEURISTIC — best-effort. Does not follow dynamic path construction,
|
|
8
|
+
* does not understand route aliases. Documented via `note` in the result;
|
|
9
|
+
* callers should review before deleting.
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/specs/2026-04-11-hono-phase-2-plan.md (T12)
|
|
12
|
+
*/
|
|
13
|
+
export interface DeadRouteFinding {
|
|
14
|
+
route: string;
|
|
15
|
+
file: string;
|
|
16
|
+
line: number;
|
|
17
|
+
reason: "no_rpc_client_caller_found";
|
|
18
|
+
}
|
|
19
|
+
export interface DeadRoutesResult {
|
|
20
|
+
findings?: DeadRouteFinding[];
|
|
21
|
+
total?: number;
|
|
22
|
+
note?: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function findDeadHonoRoutes(repo: string): Promise<DeadRoutesResult>;
|
|
26
|
+
//# sourceMappingURL=hono-dead-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-dead-routes.d.ts","sourceRoot":"","sources":["../../src/tools/hono-dead-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,4BAA4B,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,CAiF3B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* find_dead_hono_routes — heuristically flags server routes that are not
|
|
3
|
+
* called by any Hono RPC client (`hc<AppType>(...).segment.$method(...)`)
|
|
4
|
+
* in the repo. Useful in monorepos with colocated server + client code
|
|
5
|
+
* during refactors: you can delete server routes that no client touches.
|
|
6
|
+
*
|
|
7
|
+
* HEURISTIC — best-effort. Does not follow dynamic path construction,
|
|
8
|
+
* does not understand route aliases. Documented via `note` in the result;
|
|
9
|
+
* callers should review before deleting.
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/specs/2026-04-11-hono-phase-2-plan.md (T12)
|
|
12
|
+
*/
|
|
13
|
+
import { getCodeIndex } from "./index-tools.js";
|
|
14
|
+
import { honoCache } from "../cache/hono-cache.js";
|
|
15
|
+
import { HonoExtractor } from "../parser/extractors/hono.js";
|
|
16
|
+
import { detectFrameworks } from "../utils/framework-detect.js";
|
|
17
|
+
import { join, relative } from "node:path";
|
|
18
|
+
import { readFile } from "node:fs/promises";
|
|
19
|
+
import { realpathSync } from "node:fs";
|
|
20
|
+
import { walkDirectory } from "../utils/walk.js";
|
|
21
|
+
const HEURISTIC_NOTE = "Heuristic grep-based scan. Flags routes whose path segments do not appear in any non-server .ts/.tsx/.js/.jsx source. False negatives are possible for dynamically-constructed paths; false positives are possible when route segments appear in unrelated code. Review before deleting.";
|
|
22
|
+
export async function findDeadHonoRoutes(repo) {
|
|
23
|
+
const index = await getCodeIndex(repo);
|
|
24
|
+
if (!index)
|
|
25
|
+
return { error: `Repository "${repo}" not found` };
|
|
26
|
+
const frameworks = detectFrameworks(index);
|
|
27
|
+
if (!frameworks.has("hono"))
|
|
28
|
+
return { error: "No Hono app detected" };
|
|
29
|
+
const entryFile = resolveHonoEntryFile(index);
|
|
30
|
+
if (!entryFile)
|
|
31
|
+
return { error: "No Hono app entry file found" };
|
|
32
|
+
let model;
|
|
33
|
+
try {
|
|
34
|
+
model = await honoCache.get(repo, entryFile, new HonoExtractor());
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
38
|
+
return { error: `Failed to parse: ${msg}` };
|
|
39
|
+
}
|
|
40
|
+
// Candidate client files: every .ts/.tsx/.js/.jsx in the repo that the
|
|
41
|
+
// server parse didn't touch. Walk the filesystem directly — the symbol
|
|
42
|
+
// index may not include every TS file (e.g., client-only stubs), and
|
|
43
|
+
// we want full coverage of user code. Both sides are canonicalized via
|
|
44
|
+
// realpath because model.files_used comes from HonoExtractor.canonicalize
|
|
45
|
+
// while walkDirectory returns the raw path (mismatched on macOS where
|
|
46
|
+
// /tmp is a symlink to /private/tmp).
|
|
47
|
+
const canon = (p) => {
|
|
48
|
+
try {
|
|
49
|
+
return realpathSync(p);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return p;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const serverFiles = new Set(model.files_used.map(canon));
|
|
56
|
+
const allTsFiles = await walkDirectory(index.root, {
|
|
57
|
+
fileFilter: (ext) => /\.(tsx?|jsx?)$/.test(ext),
|
|
58
|
+
});
|
|
59
|
+
const candidateFiles = allTsFiles
|
|
60
|
+
.map(canon)
|
|
61
|
+
.filter((f) => !serverFiles.has(f));
|
|
62
|
+
const clientContents = [];
|
|
63
|
+
for (const file of candidateFiles) {
|
|
64
|
+
try {
|
|
65
|
+
clientContents.push(await readFile(file, "utf-8"));
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// skip unreadable
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const joined = clientContents.join("\n");
|
|
72
|
+
const findings = [];
|
|
73
|
+
for (const route of model.routes) {
|
|
74
|
+
// Extract significant segments (non-parameter, non-empty) from the path.
|
|
75
|
+
// `/api/users/:id` → ["api", "users"]
|
|
76
|
+
// `/:id` → [] (fully-dynamic path — can't reliably detect usage, skip)
|
|
77
|
+
const significantSegments = route.path
|
|
78
|
+
.split("/")
|
|
79
|
+
.filter((s) => s.length > 0 && !s.startsWith(":"));
|
|
80
|
+
if (significantSegments.length === 0)
|
|
81
|
+
continue;
|
|
82
|
+
// "Used" = every significant segment appears somewhere in the joined
|
|
83
|
+
// candidate source. Loose on purpose — we want high recall (fewer false
|
|
84
|
+
// positives of "this is dead") at the cost of false negatives.
|
|
85
|
+
const allSegmentsPresent = significantSegments.every((seg) => joined.includes(seg));
|
|
86
|
+
if (allSegmentsPresent)
|
|
87
|
+
continue;
|
|
88
|
+
findings.push({
|
|
89
|
+
route: `${route.method} ${route.path}`,
|
|
90
|
+
file: relative(index.root, route.file),
|
|
91
|
+
line: route.line,
|
|
92
|
+
reason: "no_rpc_client_caller_found",
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
findings,
|
|
97
|
+
total: findings.length,
|
|
98
|
+
note: HEURISTIC_NOTE,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function resolveHonoEntryFile(index) {
|
|
102
|
+
for (const sym of index.symbols) {
|
|
103
|
+
if (sym.source && /new\s+(?:Hono|OpenAPIHono)\s*(?:<[^>]*>)?\s*\(/.test(sym.source)) {
|
|
104
|
+
return join(index.root, sym.file);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=hono-dead-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-dead-routes.js","sourceRoot":"","sources":["../../src/tools/hono-dead-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBjD,MAAM,cAAc,GAClB,0RAA0R,CAAC;AAE7R,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY;IAEZ,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,KAAK,EAAE,eAAe,IAAI,aAAa,EAAE,CAAC;IAE/D,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CA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K,CAAC,IAAI,CAAC;YACtC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,MAAM,EAAE,4BAA4B;SACrC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,KAAK,EAAE,QAAQ,CAAC,MAAM;QACtB,IAAI,EAAE,cAAc;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,KAG7B;IACC,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAChC,IAAI,GAAG,CAAC,MAAM,IAAI,gDAAgD,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* detect_middleware_env_regression — static check for the Issue #3587 pattern:
|
|
3
|
+
* in a chain of 3+ middleware, intermediate entries declared with plain
|
|
4
|
+
* `createMiddleware(...)` (no Env generic) reset the accumulated Env type
|
|
5
|
+
* back to BlankEnv. Downstream middleware then can't see the custom bindings.
|
|
6
|
+
*
|
|
7
|
+
* Best-effort heuristic — regex over middleware declaration files, not a
|
|
8
|
+
* real type checker. Flags candidates for manual review rather than hard
|
|
9
|
+
* assertions, and documents this in the result `note` field.
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/specs/2026-04-11-hono-phase-2-plan.md (T10)
|
|
12
|
+
*/
|
|
13
|
+
export interface EnvRegressionFinding {
|
|
14
|
+
chain_scope: string;
|
|
15
|
+
chain_length: number;
|
|
16
|
+
middleware_name: string;
|
|
17
|
+
file: string;
|
|
18
|
+
/** First line in the file where the plain createMiddleware( call occurs. */
|
|
19
|
+
line: number;
|
|
20
|
+
reason: "plain_createMiddleware_no_generic";
|
|
21
|
+
}
|
|
22
|
+
export interface EnvRegressionResult {
|
|
23
|
+
findings?: EnvRegressionFinding[];
|
|
24
|
+
total?: number;
|
|
25
|
+
note?: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function detectMiddlewareEnvRegression(repo: string): Promise<EnvRegressionResult>;
|
|
29
|
+
//# sourceMappingURL=hono-env-regression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-env-regression.d.ts","sourceRoot":"","sources":["../../src/tools/hono-env-regression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,mCAAmC,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,CAAC,CA6D9B"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* detect_middleware_env_regression — static check for the Issue #3587 pattern:
|
|
3
|
+
* in a chain of 3+ middleware, intermediate entries declared with plain
|
|
4
|
+
* `createMiddleware(...)` (no Env generic) reset the accumulated Env type
|
|
5
|
+
* back to BlankEnv. Downstream middleware then can't see the custom bindings.
|
|
6
|
+
*
|
|
7
|
+
* Best-effort heuristic — regex over middleware declaration files, not a
|
|
8
|
+
* real type checker. Flags candidates for manual review rather than hard
|
|
9
|
+
* assertions, and documents this in the result `note` field.
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/specs/2026-04-11-hono-phase-2-plan.md (T10)
|
|
12
|
+
*/
|
|
13
|
+
import { getCodeIndex } from "./index-tools.js";
|
|
14
|
+
import { honoCache } from "../cache/hono-cache.js";
|
|
15
|
+
import { HonoExtractor } from "../parser/extractors/hono.js";
|
|
16
|
+
import { detectFrameworks } from "../utils/framework-detect.js";
|
|
17
|
+
import { join, dirname, resolve as pathResolve } from "node:path";
|
|
18
|
+
import { readFile } from "node:fs/promises";
|
|
19
|
+
import { existsSync } from "node:fs";
|
|
20
|
+
const HEURISTIC_NOTE = "Heuristic regex scan; false positives possible when middleware factories wrap createMiddleware or re-export it under a different name. Review each finding before typing changes.";
|
|
21
|
+
/**
|
|
22
|
+
* Regex explanation:
|
|
23
|
+
* \bcreateMiddleware → word-boundary before the token
|
|
24
|
+
* (?!\s*<) → negative lookahead — NOT followed by `<` (generic arg)
|
|
25
|
+
* \s*\( → open paren of the call
|
|
26
|
+
*
|
|
27
|
+
* Matches: createMiddleware(async (c, next) => ...)
|
|
28
|
+
* createMiddleware (async (c, next) => ...)
|
|
29
|
+
* Does not match: createMiddleware<AppEnv>(...)
|
|
30
|
+
* createMiddleware< { Bindings: ... } >(...)
|
|
31
|
+
*/
|
|
32
|
+
const PLAIN_CREATE_MIDDLEWARE = /\bcreateMiddleware(?!\s*<)\s*\(/g;
|
|
33
|
+
export async function detectMiddlewareEnvRegression(repo) {
|
|
34
|
+
const index = await getCodeIndex(repo);
|
|
35
|
+
if (!index)
|
|
36
|
+
return { error: `Repository "${repo}" not found` };
|
|
37
|
+
const frameworks = detectFrameworks(index);
|
|
38
|
+
if (!frameworks.has("hono"))
|
|
39
|
+
return { error: "No Hono app detected" };
|
|
40
|
+
const entryFile = resolveHonoEntryFile(index);
|
|
41
|
+
if (!entryFile)
|
|
42
|
+
return { error: "No Hono app entry file found" };
|
|
43
|
+
let model;
|
|
44
|
+
try {
|
|
45
|
+
model = await honoCache.get(repo, entryFile, new HonoExtractor());
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
49
|
+
return { error: `Failed to parse: ${msg}` };
|
|
50
|
+
}
|
|
51
|
+
const findings = [];
|
|
52
|
+
// Cache file scans so a middleware file shared across chains is only read once.
|
|
53
|
+
const fileScanCache = new Map();
|
|
54
|
+
for (const chain of model.middleware_chains) {
|
|
55
|
+
if (chain.entries.length < 3)
|
|
56
|
+
continue;
|
|
57
|
+
// Intermediate entries: exclude first + last (those are endpoints of the chain).
|
|
58
|
+
// We only suspect regression on entries that sit between custom-typed middleware.
|
|
59
|
+
const intermediates = chain.entries.slice(1, -1);
|
|
60
|
+
for (const entry of intermediates) {
|
|
61
|
+
if (entry.is_third_party)
|
|
62
|
+
continue;
|
|
63
|
+
if (entry.inline)
|
|
64
|
+
continue;
|
|
65
|
+
// Resolve the DEFINITION file — entry.file is the caller (app.use site).
|
|
66
|
+
// If the entry was imported from a relative path, resolve it; otherwise
|
|
67
|
+
// fall back to scanning the caller file (local definitions).
|
|
68
|
+
const definitionFile = resolveDefinitionFile(entry.file, entry.imported_from);
|
|
69
|
+
if (!definitionFile)
|
|
70
|
+
continue;
|
|
71
|
+
let hits = fileScanCache.get(definitionFile);
|
|
72
|
+
if (!hits) {
|
|
73
|
+
hits = await scanFileForPlainCreateMiddleware(definitionFile);
|
|
74
|
+
fileScanCache.set(definitionFile, hits);
|
|
75
|
+
}
|
|
76
|
+
if (hits.length === 0)
|
|
77
|
+
continue;
|
|
78
|
+
// Report the first hit — a file may contain many, but the chain-level
|
|
79
|
+
// signal is "this middleware file has at least one regression candidate".
|
|
80
|
+
const first = hits[0];
|
|
81
|
+
if (!first)
|
|
82
|
+
continue;
|
|
83
|
+
findings.push({
|
|
84
|
+
chain_scope: chain.scope,
|
|
85
|
+
chain_length: chain.entries.length,
|
|
86
|
+
middleware_name: entry.name,
|
|
87
|
+
file: definitionFile,
|
|
88
|
+
line: first.line,
|
|
89
|
+
reason: "plain_createMiddleware_no_generic",
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
findings,
|
|
95
|
+
total: findings.length,
|
|
96
|
+
note: HEURISTIC_NOTE,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Resolve the file that defines a middleware based on the caller file and
|
|
101
|
+
* the optional import specifier. Returns the absolute path, or null if the
|
|
102
|
+
* import specifier is third-party (bare module) or can't be resolved on disk.
|
|
103
|
+
*/
|
|
104
|
+
function resolveDefinitionFile(callerFile, importSpec) {
|
|
105
|
+
if (!importSpec) {
|
|
106
|
+
// No import record — middleware is defined in the same file as the caller.
|
|
107
|
+
return existsSync(callerFile) ? callerFile : null;
|
|
108
|
+
}
|
|
109
|
+
if (!importSpec.startsWith(".")) {
|
|
110
|
+
// Bare module specifier — third-party, nothing to scan.
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
const base = pathResolve(dirname(callerFile), importSpec);
|
|
114
|
+
const candidates = [
|
|
115
|
+
base,
|
|
116
|
+
`${base}.ts`,
|
|
117
|
+
`${base}.tsx`,
|
|
118
|
+
`${base}.js`,
|
|
119
|
+
`${base}.jsx`,
|
|
120
|
+
join(base, "index.ts"),
|
|
121
|
+
join(base, "index.tsx"),
|
|
122
|
+
join(base, "index.js"),
|
|
123
|
+
join(base, "index.jsx"),
|
|
124
|
+
];
|
|
125
|
+
for (const candidate of candidates) {
|
|
126
|
+
if (existsSync(candidate))
|
|
127
|
+
return candidate;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
async function scanFileForPlainCreateMiddleware(file) {
|
|
132
|
+
let source;
|
|
133
|
+
try {
|
|
134
|
+
source = await readFile(file, "utf-8");
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
const hits = [];
|
|
140
|
+
// Reset regex state per scan (global flag retains lastIndex).
|
|
141
|
+
PLAIN_CREATE_MIDDLEWARE.lastIndex = 0;
|
|
142
|
+
let m;
|
|
143
|
+
while ((m = PLAIN_CREATE_MIDDLEWARE.exec(source)) !== null) {
|
|
144
|
+
const line = source.slice(0, m.index).split("\n").length;
|
|
145
|
+
hits.push({ line });
|
|
146
|
+
}
|
|
147
|
+
return hits;
|
|
148
|
+
}
|
|
149
|
+
function resolveHonoEntryFile(index) {
|
|
150
|
+
for (const sym of index.symbols) {
|
|
151
|
+
if (sym.source && /new\s+(?:Hono|OpenAPIHono)\s*(?:<[^>]*>)?\s*\(/.test(sym.source)) {
|
|
152
|
+
return join(index.root, sym.file);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=hono-env-regression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-env-regression.js","sourceRoot":"","sources":["../../src/tools/hono-env-regression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmBrC,MAAM,cAAc,GAClB,mLAAmL,CAAC;AAEtL;;;;;;;;;;GAUG;AACH,MAAM,uBAAuB,GAAG,kCAAkC,CAAC;AAEnE,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,IAAY;IAEZ,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,IAAI,C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AM,CAAC;QACzD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAAC,KAG7B;IACC,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAChC,IAAI,GAAG,CAAC,MAAM,IAAI,gDAAgD,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* analyze_inline_handler — returns structured body analysis for a specific
|
|
3
|
+
* inline handler. Consumes HonoRoute.inline_analysis populated by T3.
|
|
4
|
+
*
|
|
5
|
+
* Closes blog API demo gap #1: all 7 blog routes are (c) => c.json(...) inline
|
|
6
|
+
* arrows, and Phase 1 reported them as opaque "<inline>" handlers with zero
|
|
7
|
+
* introspection. With this tool, callers can ask "what does GET /users/:id do?"
|
|
8
|
+
* and get responses, errors, DB calls, fetch calls, context access, and
|
|
9
|
+
* validators — all statically extracted.
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/specs/2026-04-11-hono-phase-2-plan.md (T8)
|
|
12
|
+
*/
|
|
13
|
+
import type { InlineHandlerAnalysis } from "../parser/extractors/hono-model.js";
|
|
14
|
+
export interface InlineHandlerReport {
|
|
15
|
+
route: string;
|
|
16
|
+
file: string;
|
|
17
|
+
line: number;
|
|
18
|
+
analysis: InlineHandlerAnalysis;
|
|
19
|
+
}
|
|
20
|
+
export interface InlineHandlerResult {
|
|
21
|
+
reports?: InlineHandlerReport[];
|
|
22
|
+
total?: number;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param repo repository identifier
|
|
27
|
+
* @param method optional HTTP method filter (e.g. "GET"); case-insensitive
|
|
28
|
+
* @param path optional path filter (e.g. "/users/:id"); exact match
|
|
29
|
+
*/
|
|
30
|
+
export declare function analyzeInlineHandler(repo: string, method?: string, routePath?: string): Promise<InlineHandlerResult>;
|
|
31
|
+
//# sourceMappingURL=hono-inline-analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-inline-analyze.d.ts","sourceRoot":"","sources":["../../src/tools/hono-inline-analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEhF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAiC9B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* analyze_inline_handler — returns structured body analysis for a specific
|
|
3
|
+
* inline handler. Consumes HonoRoute.inline_analysis populated by T3.
|
|
4
|
+
*
|
|
5
|
+
* Closes blog API demo gap #1: all 7 blog routes are (c) => c.json(...) inline
|
|
6
|
+
* arrows, and Phase 1 reported them as opaque "<inline>" handlers with zero
|
|
7
|
+
* introspection. With this tool, callers can ask "what does GET /users/:id do?"
|
|
8
|
+
* and get responses, errors, DB calls, fetch calls, context access, and
|
|
9
|
+
* validators — all statically extracted.
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/specs/2026-04-11-hono-phase-2-plan.md (T8)
|
|
12
|
+
*/
|
|
13
|
+
import { getCodeIndex } from "./index-tools.js";
|
|
14
|
+
import { honoCache } from "../cache/hono-cache.js";
|
|
15
|
+
import { HonoExtractor } from "../parser/extractors/hono.js";
|
|
16
|
+
import { detectFrameworks } from "../utils/framework-detect.js";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
/**
|
|
19
|
+
* @param repo repository identifier
|
|
20
|
+
* @param method optional HTTP method filter (e.g. "GET"); case-insensitive
|
|
21
|
+
* @param path optional path filter (e.g. "/users/:id"); exact match
|
|
22
|
+
*/
|
|
23
|
+
export async function analyzeInlineHandler(repo, method, routePath) {
|
|
24
|
+
const index = await getCodeIndex(repo);
|
|
25
|
+
if (!index)
|
|
26
|
+
return { error: `Repository "${repo}" not found` };
|
|
27
|
+
const frameworks = detectFrameworks(index);
|
|
28
|
+
if (!frameworks.has("hono"))
|
|
29
|
+
return { error: "No Hono app detected" };
|
|
30
|
+
const entryFile = resolveHonoEntryFile(index);
|
|
31
|
+
if (!entryFile)
|
|
32
|
+
return { error: "No Hono app entry file found" };
|
|
33
|
+
let model;
|
|
34
|
+
try {
|
|
35
|
+
model = await honoCache.get(repo, entryFile, new HonoExtractor());
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
39
|
+
return { error: `Failed to parse: ${msg}` };
|
|
40
|
+
}
|
|
41
|
+
const methodFilter = method?.toUpperCase();
|
|
42
|
+
const reports = [];
|
|
43
|
+
for (const route of model.routes) {
|
|
44
|
+
if (!route.inline_analysis)
|
|
45
|
+
continue;
|
|
46
|
+
if (methodFilter && route.method !== methodFilter)
|
|
47
|
+
continue;
|
|
48
|
+
if (routePath && route.path !== routePath)
|
|
49
|
+
continue;
|
|
50
|
+
reports.push({
|
|
51
|
+
route: `${route.method} ${route.path}`,
|
|
52
|
+
file: route.file,
|
|
53
|
+
line: route.line,
|
|
54
|
+
analysis: route.inline_analysis,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return { reports, total: reports.length };
|
|
58
|
+
}
|
|
59
|
+
function resolveHonoEntryFile(index) {
|
|
60
|
+
for (const sym of index.symbols) {
|
|
61
|
+
if (sym.source && /new\s+(?:Hono|OpenAPIHono)\s*(?:<[^>]*>)?\s*\(/.test(sym.source)) {
|
|
62
|
+
return join(index.root, sym.file);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=hono-inline-analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-inline-analyze.js","sourceRoot":"","sources":["../../src/tools/hono-inline-analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgBjC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAY,EACZ,MAAe,EACf,SAAkB;IAElB,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,KAAK,EAAE,eAAe,IAAI,aAAa,EAAE,CAAC;IAE/D,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAEtE,MAAM,SAAS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AC,OAAO,EAAE,CAAC;QAChC,IAAI,GAAG,CAAC,MAAM,IAAI,gDAAgD,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trace_middleware_chain — returns the ordered middleware chain for a given Hono route.
|
|
3
|
+
*
|
|
4
|
+
* For a path like /api/admin/users/:id, walks all middleware chains whose scope
|
|
5
|
+
* pattern matches the route's fully-resolved path and concatenates them in
|
|
6
|
+
* registration order. Output is a MiddlewareEntry[] (see hono-model.ts).
|
|
7
|
+
*
|
|
8
|
+
* Spec: docs/specs/2026-04-10-hono-framework-intelligence-spec.md (Task 16)
|
|
9
|
+
*/
|
|
10
|
+
import type { MiddlewareEntry } from "../parser/extractors/hono-model.js";
|
|
11
|
+
export interface MiddlewareChainResult {
|
|
12
|
+
route?: {
|
|
13
|
+
method: string;
|
|
14
|
+
path: string;
|
|
15
|
+
file: string;
|
|
16
|
+
line: number;
|
|
17
|
+
};
|
|
18
|
+
chain: MiddlewareEntry[];
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function traceMiddlewareChain(repo: string, path: string, method?: string): Promise<MiddlewareChainResult>;
|
|
22
|
+
//# sourceMappingURL=hono-middleware-chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono-middleware-chain.d.ts","sourceRoot":"","sources":["../../src/tools/hono-middleware-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,oCAAoC,CAAC;AAErF,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC,CA2DhC"}
|