ai-first-cli 1.1.3 → 1.2.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/{ai → .ai-dev}/ai_context.md +18 -11
- package/{ai → .ai-dev}/ai_rules.md +5 -3
- package/{ai → .ai-dev}/architecture.md +52 -16
- package/.ai-dev/cache.json +2349 -0
- package/.ai-dev/context/features/commands.json +18 -0
- package/.ai-dev/context/features/src.json +61 -0
- package/.ai-dev/context/features/test-projects.json +69 -0
- package/.ai-dev/context/flows/account.json +9 -0
- package/.ai-dev/context/flows/ai-first.json +9 -0
- package/.ai-dev/context/flows/api.json +9 -0
- package/.ai-dev/context/flows/auth.json +13 -0
- package/.ai-dev/context/flows/category.json +12 -0
- package/.ai-dev/context/flows/comment.json +16 -0
- package/.ai-dev/context/flows/dashboard.json +9 -0
- package/.ai-dev/context/flows/doctor.json +9 -0
- package/.ai-dev/context/flows/explore.json +9 -0
- package/.ai-dev/context/flows/login.json +9 -0
- package/.ai-dev/context/flows/opportunity.json +9 -0
- package/.ai-dev/context/flows/post.json +18 -0
- package/.ai-dev/context/flows/routes.json +19 -0
- package/.ai-dev/context/flows/user.json +20 -0
- package/.ai-dev/context/flows/users.json +9 -0
- package/.ai-dev/context/flows/views.json +14 -0
- package/.ai-dev/conventions.md +53 -0
- package/.ai-dev/dependencies.json +2946 -0
- package/{ai → .ai-dev}/entrypoints.md +10 -0
- package/.ai-dev/files.json +2944 -0
- package/.ai-dev/graph/knowledge-graph.json +44314 -0
- package/.ai-dev/graph/module-graph.json +866 -0
- package/.ai-dev/graph/symbol-graph.json +200622 -0
- package/.ai-dev/graph/symbol-references.json +6778 -0
- package/.ai-dev/hierarchy.json +20 -0
- package/.ai-dev/index-state.json +4123 -0
- package/.ai-dev/index.db +0 -0
- package/.ai-dev/modules.json +532 -0
- package/.ai-dev/project.json +30 -0
- package/.ai-dev/repo_map.json +5818 -0
- package/.ai-dev/repo_map.md +1327 -0
- package/.ai-dev/schema.json +5 -0
- package/.ai-dev/summary.md +42 -0
- package/.ai-dev/symbols.json +7 -0
- package/.ai-dev/tech_stack.md +46 -0
- package/.ai-dev/tools.json +10 -0
- package/.github/workflows/publish.yml +55 -0
- package/BUGS.md +455 -0
- package/CHANGELOG.md +218 -218
- package/PLAN_MEJORAS.md +216 -0
- package/README.es.md +82 -99
- package/README.md +70 -89
- package/STATUS_ADAPTADORES +126 -0
- package/TEST_RESULTS_PHASE1.md +420 -0
- package/ai/graph/knowledge-graph.json +6 -43639
- package/ai-context/ai_context.md +130 -0
- package/ai-context/ai_rules.md +54 -0
- package/ai-context/architecture.md +136 -0
- package/ai-context/cache.json +2349 -0
- package/ai-context/ccp/jira-123/context.json +7 -0
- package/ai-context/context/features/commands.json +18 -0
- package/ai-context/context/features/src.json +61 -0
- package/ai-context/context/features/test-projects.json +69 -0
- package/ai-context/context/flows/account.json +9 -0
- package/ai-context/context/flows/ai-first.json +9 -0
- package/ai-context/context/flows/api.json +9 -0
- package/ai-context/context/flows/auth.json +13 -0
- package/ai-context/context/flows/category.json +12 -0
- package/ai-context/context/flows/comment.json +16 -0
- package/ai-context/context/flows/dashboard.json +9 -0
- package/ai-context/context/flows/doctor.json +9 -0
- package/ai-context/context/flows/explore.json +9 -0
- package/ai-context/context/flows/login.json +9 -0
- package/ai-context/context/flows/opportunity.json +9 -0
- package/ai-context/context/flows/post.json +18 -0
- package/ai-context/context/flows/routes.json +19 -0
- package/ai-context/context/flows/user.json +20 -0
- package/ai-context/context/flows/users.json +9 -0
- package/ai-context/context/flows/views.json +14 -0
- package/ai-context/context/repo.json +56 -0
- package/ai-context/context/utils.json +7 -0
- package/ai-context/conventions.md +53 -0
- package/ai-context/dependencies.json +2946 -0
- package/ai-context/embeddings.json +23828 -0
- package/ai-context/entrypoints.md +42 -0
- package/ai-context/files.json +2944 -0
- package/ai-context/git/commit-activity.json +8646 -0
- package/ai-context/git/recent-files.json +52 -0
- package/ai-context/git/recent-flows.json +1 -0
- package/ai-context/graph/knowledge-graph.json +44314 -0
- package/ai-context/graph/module-graph.json +866 -0
- package/ai-context/graph/symbol-graph.json +200622 -0
- package/ai-context/graph/symbol-references.json +6778 -0
- package/ai-context/hierarchy.json +20 -0
- package/ai-context/index-state.json +4123 -0
- package/ai-context/index.db +0 -0
- package/ai-context/modules.json +532 -0
- package/ai-context/project.json +30 -0
- package/ai-context/repo_map.json +5818 -0
- package/ai-context/repo_map.md +1327 -0
- package/ai-context/schema.json +5 -0
- package/ai-context/summary.md +42 -0
- package/ai-context/symbols.json +7 -0
- package/ai-context/tech_stack.md +46 -0
- package/ai-context/tools.json +10 -0
- package/dist/analyzers/dependencies.d.ts.map +1 -1
- package/dist/analyzers/dependencies.js +8 -16
- package/dist/analyzers/dependencies.js.map +1 -1
- package/dist/analyzers/symbols.d.ts.map +1 -1
- package/dist/analyzers/symbols.js +194 -6
- package/dist/analyzers/symbols.js.map +1 -1
- package/dist/commands/ai-first.d.ts.map +1 -1
- package/dist/commands/ai-first.js +63 -21
- package/dist/commands/ai-first.js.map +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explore.js +1 -1
- package/dist/commands/explore.js.map +1 -1
- package/dist/core/ccp.js +1 -1
- package/dist/core/ccp.js.map +1 -1
- package/dist/core/embeddings.d.ts +11 -6
- package/dist/core/embeddings.d.ts.map +1 -1
- package/dist/core/embeddings.js +88 -38
- package/dist/core/embeddings.js.map +1 -1
- package/dist/core/gitAnalyzer.js +3 -3
- package/dist/core/gitAnalyzer.js.map +1 -1
- package/dist/core/incrementalAnalyzer.d.ts.map +1 -1
- package/dist/core/incrementalAnalyzer.js +76 -14
- package/dist/core/incrementalAnalyzer.js.map +1 -1
- package/dist/core/knowledgeGraphBuilder.js +1 -1
- package/dist/core/knowledgeGraphBuilder.js.map +1 -1
- package/dist/core/semanticContexts.d.ts.map +1 -1
- package/dist/core/semanticContexts.js +61 -30
- package/dist/core/semanticContexts.js.map +1 -1
- package/dist/core/symbolGraph.d.ts.map +1 -1
- package/dist/core/symbolGraph.js +14 -2
- package/dist/core/symbolGraph.js.map +1 -1
- package/dist/utils/fileUtils.d.ts.map +1 -1
- package/dist/utils/fileUtils.js +5 -0
- package/dist/utils/fileUtils.js.map +1 -1
- package/docs/guide/getting-started.md +8 -8
- package/docs/guide/quick-start.md +8 -8
- package/examples/01-express-api.md +3 -3
- package/examples/02-react-app.md +3 -3
- package/examples/03-python-django.md +3 -3
- package/examples/README.md +3 -3
- package/package.json +2 -2
- package/src/analyzers/dependencies.ts +10 -20
- package/src/analyzers/symbols.ts +207 -6
- package/src/commands/ai-first.ts +67 -22
- package/src/commands/doctor.ts +1 -1
- package/src/commands/explore.ts +1 -1
- package/src/core/ccp.ts +1 -1
- package/src/core/embeddings.ts +106 -40
- package/src/core/gitAnalyzer.ts +3 -3
- package/src/core/incrementalAnalyzer.ts +101 -11
- package/src/core/knowledgeGraphBuilder.ts +1 -1
- package/src/core/semanticContexts.ts +68 -33
- package/src/core/symbolGraph.ts +16 -2
- package/src/utils/fileUtils.ts +5 -0
- package/test-projects/django-app/.ai-dev/ai_context.md +92 -0
- package/test-projects/django-app/.ai-dev/ai_rules.md +47 -0
- package/test-projects/django-app/.ai-dev/architecture.md +57 -0
- package/test-projects/django-app/.ai-dev/cache.json +169 -0
- package/test-projects/django-app/.ai-dev/context/flows/views.json +10 -0
- package/test-projects/django-app/.ai-dev/conventions.md +51 -0
- package/test-projects/django-app/.ai-dev/dependencies.json +312 -0
- package/test-projects/django-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/django-app/.ai-dev/files.json +209 -0
- package/test-projects/django-app/.ai-dev/graph/knowledge-graph.json +36 -0
- package/test-projects/django-app/.ai-dev/graph/module-graph.json +145 -0
- package/test-projects/django-app/.ai-dev/graph/symbol-graph.json +1488 -0
- package/test-projects/django-app/.ai-dev/graph/symbol-references.json +1 -0
- package/test-projects/django-app/.ai-dev/index-state.json +294 -0
- package/test-projects/django-app/.ai-dev/index.db +0 -0
- package/test-projects/django-app/.ai-dev/modules.json +35 -0
- package/test-projects/django-app/.ai-dev/project.json +11 -0
- package/test-projects/django-app/.ai-dev/repo_map.json +412 -0
- package/test-projects/django-app/.ai-dev/repo_map.md +105 -0
- package/test-projects/django-app/.ai-dev/schema.json +5 -0
- package/test-projects/django-app/.ai-dev/summary.md +15 -0
- package/test-projects/django-app/.ai-dev/symbols.json +1 -0
- package/test-projects/django-app/.ai-dev/tech_stack.md +32 -0
- package/test-projects/django-app/.ai-dev/tools.json +10 -0
- package/test-projects/django-app/README.md +91 -0
- package/test-projects/django-app/ai-context/ai_context.md +92 -0
- package/test-projects/django-app/ai-context/ai_rules.md +47 -0
- package/test-projects/django-app/ai-context/architecture.md +57 -0
- package/test-projects/django-app/ai-context/cache.json +169 -0
- package/test-projects/django-app/ai-context/context/flows/views.json +10 -0
- package/test-projects/django-app/ai-context/conventions.md +51 -0
- package/test-projects/django-app/ai-context/dependencies.json +312 -0
- package/test-projects/django-app/ai-context/entrypoints.md +4 -0
- package/test-projects/django-app/ai-context/files.json +209 -0
- package/test-projects/django-app/ai-context/graph/knowledge-graph.json +36 -0
- package/test-projects/django-app/ai-context/graph/module-graph.json +145 -0
- package/test-projects/django-app/ai-context/graph/symbol-graph.json +1488 -0
- package/test-projects/django-app/ai-context/graph/symbol-references.json +1 -0
- package/test-projects/django-app/ai-context/index-state.json +294 -0
- package/test-projects/django-app/ai-context/index.db +0 -0
- package/test-projects/django-app/ai-context/modules.json +35 -0
- package/test-projects/django-app/ai-context/project.json +11 -0
- package/test-projects/django-app/ai-context/repo_map.json +412 -0
- package/test-projects/django-app/ai-context/repo_map.md +105 -0
- package/test-projects/django-app/ai-context/schema.json +5 -0
- package/test-projects/django-app/ai-context/summary.md +15 -0
- package/test-projects/django-app/ai-context/symbols.json +1 -0
- package/test-projects/django-app/ai-context/tech_stack.md +32 -0
- package/test-projects/django-app/ai-context/tools.json +10 -0
- package/test-projects/django-app/blog/__init__.py +0 -0
- package/test-projects/django-app/blog/admin.py +31 -0
- package/test-projects/django-app/blog/models.py +55 -0
- package/test-projects/django-app/blog/serializers.py +69 -0
- package/test-projects/django-app/blog/urls.py +14 -0
- package/test-projects/django-app/blog/views.py +96 -0
- package/test-projects/django-app/django_app/__init__.py +0 -0
- package/test-projects/django-app/django_app/settings.py +90 -0
- package/test-projects/django-app/django_app/urls.py +11 -0
- package/test-projects/django-app/django_app/wsgi.py +9 -0
- package/test-projects/django-app/manage.py +23 -0
- package/test-projects/django-app/requirements.txt +3 -0
- package/test-projects/django-app/users/__init__.py +0 -0
- package/test-projects/django-app/users/admin.py +42 -0
- package/test-projects/django-app/users/models.py +54 -0
- package/test-projects/django-app/users/serializers.py +113 -0
- package/test-projects/django-app/users/urls.py +13 -0
- package/test-projects/django-app/users/views.py +135 -0
- package/test-projects/express-api/.ai-dev/ai_context.md +112 -0
- package/test-projects/express-api/.ai-dev/ai_rules.md +50 -0
- package/test-projects/express-api/.ai-dev/architecture.md +62 -0
- package/test-projects/express-api/.ai-dev/context/features/controllers.json +13 -0
- package/test-projects/express-api/.ai-dev/context/features/services.json +13 -0
- package/test-projects/express-api/.ai-dev/context/flows/auth.json +12 -0
- package/test-projects/express-api/.ai-dev/context/flows/user.json +13 -0
- package/test-projects/express-api/.ai-dev/conventions.md +51 -0
- package/test-projects/express-api/.ai-dev/dependencies.json +54 -0
- package/test-projects/express-api/.ai-dev/entrypoints.md +17 -0
- package/test-projects/express-api/.ai-dev/modules.json +30 -0
- package/test-projects/express-api/.ai-dev/project.json +15 -0
- package/test-projects/express-api/.ai-dev/repo_map.json +100 -0
- package/test-projects/express-api/.ai-dev/repo_map.md +36 -0
- package/test-projects/express-api/.ai-dev/schema.json +5 -0
- package/test-projects/express-api/.ai-dev/summary.md +14 -0
- package/test-projects/express-api/.ai-dev/symbols.json +7 -0
- package/test-projects/express-api/.ai-dev/tech_stack.md +38 -0
- package/test-projects/express-api/.ai-dev/tools.json +10 -0
- package/test-projects/express-api/ai-context/ai_context.md +112 -0
- package/test-projects/express-api/ai-context/ai_rules.md +50 -0
- package/test-projects/express-api/ai-context/architecture.md +62 -0
- package/test-projects/express-api/ai-context/context/features/controllers.json +13 -0
- package/test-projects/express-api/ai-context/context/features/services.json +13 -0
- package/test-projects/express-api/ai-context/context/flows/auth.json +12 -0
- package/test-projects/express-api/ai-context/context/flows/user.json +13 -0
- package/test-projects/express-api/ai-context/conventions.md +51 -0
- package/test-projects/express-api/ai-context/dependencies.json +54 -0
- package/test-projects/express-api/ai-context/entrypoints.md +17 -0
- package/test-projects/express-api/ai-context/modules.json +30 -0
- package/test-projects/express-api/ai-context/project.json +15 -0
- package/test-projects/express-api/ai-context/repo_map.json +100 -0
- package/test-projects/express-api/ai-context/repo_map.md +36 -0
- package/test-projects/express-api/ai-context/schema.json +5 -0
- package/test-projects/express-api/ai-context/summary.md +14 -0
- package/test-projects/express-api/ai-context/symbols.json +7 -0
- package/test-projects/express-api/ai-context/tech_stack.md +38 -0
- package/test-projects/express-api/ai-context/tools.json +10 -0
- package/test-projects/express-api/controllers/authController.js +32 -0
- package/test-projects/express-api/controllers/userController.js +51 -0
- package/test-projects/express-api/index.js +30 -0
- package/test-projects/express-api/middleware/authMiddleware.js +30 -0
- package/test-projects/express-api/models/userRepository.js +25 -0
- package/test-projects/express-api/package.json +18 -0
- package/test-projects/express-api/services/authService.js +17 -0
- package/test-projects/express-api/services/userService.js +28 -0
- package/test-projects/fastapi-app/.ai-dev/ai_context.md +89 -0
- package/test-projects/fastapi-app/.ai-dev/ai_rules.md +47 -0
- package/test-projects/fastapi-app/.ai-dev/architecture.md +39 -0
- package/test-projects/fastapi-app/.ai-dev/cache.json +125 -0
- package/test-projects/fastapi-app/.ai-dev/conventions.md +51 -0
- package/test-projects/fastapi-app/.ai-dev/dependencies.json +244 -0
- package/test-projects/fastapi-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/fastapi-app/.ai-dev/files.json +154 -0
- package/test-projects/fastapi-app/.ai-dev/graph/knowledge-graph.json +15 -0
- package/test-projects/fastapi-app/.ai-dev/graph/module-graph.json +78 -0
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-graph.json +1724 -0
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-references.json +51 -0
- package/test-projects/fastapi-app/.ai-dev/index-state.json +217 -0
- package/test-projects/fastapi-app/.ai-dev/index.db +0 -0
- package/test-projects/fastapi-app/.ai-dev/modules.json +16 -0
- package/test-projects/fastapi-app/.ai-dev/project.json +9 -0
- package/test-projects/fastapi-app/.ai-dev/repo_map.json +298 -0
- package/test-projects/fastapi-app/.ai-dev/repo_map.md +74 -0
- package/test-projects/fastapi-app/.ai-dev/schema.json +5 -0
- package/test-projects/fastapi-app/.ai-dev/summary.md +12 -0
- package/test-projects/fastapi-app/.ai-dev/symbols.json +1 -0
- package/test-projects/fastapi-app/.ai-dev/tech_stack.md +32 -0
- package/test-projects/fastapi-app/.ai-dev/tools.json +10 -0
- package/test-projects/fastapi-app/README.md +118 -0
- package/test-projects/fastapi-app/ai-context/ai_context.md +89 -0
- package/test-projects/fastapi-app/ai-context/ai_rules.md +47 -0
- package/test-projects/fastapi-app/ai-context/architecture.md +39 -0
- package/test-projects/fastapi-app/ai-context/cache.json +125 -0
- package/test-projects/fastapi-app/ai-context/conventions.md +51 -0
- package/test-projects/fastapi-app/ai-context/dependencies.json +244 -0
- package/test-projects/fastapi-app/ai-context/entrypoints.md +4 -0
- package/test-projects/fastapi-app/ai-context/files.json +154 -0
- package/test-projects/fastapi-app/ai-context/graph/knowledge-graph.json +15 -0
- package/test-projects/fastapi-app/ai-context/graph/module-graph.json +78 -0
- package/test-projects/fastapi-app/ai-context/graph/symbol-graph.json +1724 -0
- package/test-projects/fastapi-app/ai-context/graph/symbol-references.json +51 -0
- package/test-projects/fastapi-app/ai-context/index-state.json +217 -0
- package/test-projects/fastapi-app/ai-context/index.db +0 -0
- package/test-projects/fastapi-app/ai-context/modules.json +16 -0
- package/test-projects/fastapi-app/ai-context/project.json +9 -0
- package/test-projects/fastapi-app/ai-context/repo_map.json +298 -0
- package/test-projects/fastapi-app/ai-context/repo_map.md +74 -0
- package/test-projects/fastapi-app/ai-context/schema.json +5 -0
- package/test-projects/fastapi-app/ai-context/summary.md +12 -0
- package/test-projects/fastapi-app/ai-context/symbols.json +1 -0
- package/test-projects/fastapi-app/ai-context/tech_stack.md +32 -0
- package/test-projects/fastapi-app/ai-context/tools.json +10 -0
- package/test-projects/fastapi-app/app/database.py +21 -0
- package/test-projects/fastapi-app/app/dependencies.py +107 -0
- package/test-projects/fastapi-app/app/main.py +47 -0
- package/test-projects/fastapi-app/app/models.py +149 -0
- package/test-projects/fastapi-app/app/routers/auth.py +117 -0
- package/test-projects/fastapi-app/app/routers/posts.py +272 -0
- package/test-projects/fastapi-app/app/schemas.py +191 -0
- package/test-projects/fastapi-app/requirements.txt +10 -0
- package/test-projects/flask-app/.ai-dev/ai_context.md +94 -0
- package/test-projects/flask-app/.ai-dev/ai_rules.md +47 -0
- package/test-projects/flask-app/.ai-dev/architecture.md +49 -0
- package/test-projects/flask-app/.ai-dev/cache.json +157 -0
- package/test-projects/flask-app/.ai-dev/context/features/app.json +25 -0
- package/test-projects/flask-app/.ai-dev/context/flows/routes.json +14 -0
- package/test-projects/flask-app/.ai-dev/conventions.md +51 -0
- package/test-projects/flask-app/.ai-dev/dependencies.json +298 -0
- package/test-projects/flask-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/flask-app/.ai-dev/files.json +194 -0
- package/test-projects/flask-app/.ai-dev/graph/knowledge-graph.json +60 -0
- package/test-projects/flask-app/.ai-dev/graph/module-graph.json +95 -0
- package/test-projects/flask-app/.ai-dev/graph/symbol-graph.json +1448 -0
- package/test-projects/flask-app/.ai-dev/graph/symbol-references.json +45 -0
- package/test-projects/flask-app/.ai-dev/index-state.json +273 -0
- package/test-projects/flask-app/.ai-dev/index.db +0 -0
- package/test-projects/flask-app/.ai-dev/modules.json +21 -0
- package/test-projects/flask-app/.ai-dev/project.json +13 -0
- package/test-projects/flask-app/.ai-dev/repo_map.json +400 -0
- package/test-projects/flask-app/.ai-dev/repo_map.md +98 -0
- package/test-projects/flask-app/.ai-dev/schema.json +5 -0
- package/test-projects/flask-app/.ai-dev/summary.md +13 -0
- package/test-projects/flask-app/.ai-dev/symbols.json +1 -0
- package/test-projects/flask-app/.ai-dev/tech_stack.md +32 -0
- package/test-projects/flask-app/.ai-dev/tools.json +10 -0
- package/test-projects/flask-app/README.md +129 -0
- package/test-projects/flask-app/ai-context/ai_context.md +94 -0
- package/test-projects/flask-app/ai-context/ai_rules.md +47 -0
- package/test-projects/flask-app/ai-context/architecture.md +49 -0
- package/test-projects/flask-app/ai-context/cache.json +157 -0
- package/test-projects/flask-app/ai-context/context/features/app.json +25 -0
- package/test-projects/flask-app/ai-context/context/flows/routes.json +14 -0
- package/test-projects/flask-app/ai-context/conventions.md +51 -0
- package/test-projects/flask-app/ai-context/dependencies.json +298 -0
- package/test-projects/flask-app/ai-context/entrypoints.md +4 -0
- package/test-projects/flask-app/ai-context/files.json +194 -0
- package/test-projects/flask-app/ai-context/graph/knowledge-graph.json +60 -0
- package/test-projects/flask-app/ai-context/graph/module-graph.json +95 -0
- package/test-projects/flask-app/ai-context/graph/symbol-graph.json +1448 -0
- package/test-projects/flask-app/ai-context/graph/symbol-references.json +45 -0
- package/test-projects/flask-app/ai-context/index-state.json +273 -0
- package/test-projects/flask-app/ai-context/index.db +0 -0
- package/test-projects/flask-app/ai-context/modules.json +21 -0
- package/test-projects/flask-app/ai-context/project.json +13 -0
- package/test-projects/flask-app/ai-context/repo_map.json +400 -0
- package/test-projects/flask-app/ai-context/repo_map.md +98 -0
- package/test-projects/flask-app/ai-context/schema.json +5 -0
- package/test-projects/flask-app/ai-context/summary.md +13 -0
- package/test-projects/flask-app/ai-context/symbols.json +1 -0
- package/test-projects/flask-app/ai-context/tech_stack.md +32 -0
- package/test-projects/flask-app/ai-context/tools.json +10 -0
- package/test-projects/flask-app/app/__init__.py +46 -0
- package/test-projects/flask-app/app/api/__init__.py +7 -0
- package/test-projects/flask-app/app/api/routes.py +122 -0
- package/test-projects/flask-app/app/auth/__init__.py +7 -0
- package/test-projects/flask-app/app/auth/forms.py +52 -0
- package/test-projects/flask-app/app/auth/routes.py +68 -0
- package/test-projects/flask-app/app/blog/__init__.py +7 -0
- package/test-projects/flask-app/app/blog/forms.py +35 -0
- package/test-projects/flask-app/app/blog/routes.py +140 -0
- package/test-projects/flask-app/app/main/__init__.py +7 -0
- package/test-projects/flask-app/app/main/routes.py +88 -0
- package/test-projects/flask-app/app/models.py +177 -0
- package/test-projects/flask-app/config.py +64 -0
- package/test-projects/flask-app/requirements.txt +10 -0
- package/test-projects/laravel-app/.ai-dev/ai_context.md +97 -0
- package/test-projects/laravel-app/.ai-dev/ai_rules.md +47 -0
- package/test-projects/laravel-app/.ai-dev/architecture.md +60 -0
- package/test-projects/laravel-app/.ai-dev/cache.json +161 -0
- package/test-projects/laravel-app/.ai-dev/context/features/app.json +21 -0
- package/test-projects/laravel-app/.ai-dev/context/flows/.json +9 -0
- package/test-projects/laravel-app/.ai-dev/context/flows/category.json +12 -0
- package/test-projects/laravel-app/.ai-dev/context/flows/comment.json +12 -0
- package/test-projects/laravel-app/.ai-dev/context/flows/post.json +12 -0
- package/test-projects/laravel-app/.ai-dev/context/flows/unnamed.json +9 -0
- package/test-projects/laravel-app/.ai-dev/conventions.md +51 -0
- package/test-projects/laravel-app/.ai-dev/dependencies.json +6 -0
- package/test-projects/laravel-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/laravel-app/.ai-dev/files.json +199 -0
- package/test-projects/laravel-app/.ai-dev/graph/knowledge-graph.json +98 -0
- package/test-projects/laravel-app/.ai-dev/graph/module-graph.json +30 -0
- package/test-projects/laravel-app/.ai-dev/graph/symbol-graph.json +5 -0
- package/test-projects/laravel-app/.ai-dev/graph/symbol-references.json +1 -0
- package/test-projects/laravel-app/.ai-dev/index-state.json +280 -0
- package/test-projects/laravel-app/.ai-dev/index.db +0 -0
- package/test-projects/laravel-app/.ai-dev/modules.json +29 -0
- package/test-projects/laravel-app/.ai-dev/project.json +17 -0
- package/test-projects/laravel-app/.ai-dev/repo_map.json +419 -0
- package/test-projects/laravel-app/.ai-dev/repo_map.md +106 -0
- package/test-projects/laravel-app/.ai-dev/schema.json +5 -0
- package/test-projects/laravel-app/.ai-dev/summary.md +15 -0
- package/test-projects/laravel-app/.ai-dev/symbols.json +1 -0
- package/test-projects/laravel-app/.ai-dev/tech_stack.md +34 -0
- package/test-projects/laravel-app/.ai-dev/tools.json +10 -0
- package/test-projects/laravel-app/README.md +107 -0
- package/test-projects/laravel-app/ai-context/ai_context.md +97 -0
- package/test-projects/laravel-app/ai-context/ai_rules.md +47 -0
- package/test-projects/laravel-app/ai-context/architecture.md +60 -0
- package/test-projects/laravel-app/ai-context/cache.json +161 -0
- package/test-projects/laravel-app/ai-context/context/features/app.json +21 -0
- package/test-projects/laravel-app/ai-context/context/flows/.json +9 -0
- package/test-projects/laravel-app/ai-context/context/flows/category.json +12 -0
- package/test-projects/laravel-app/ai-context/context/flows/comment.json +12 -0
- package/test-projects/laravel-app/ai-context/context/flows/post.json +12 -0
- package/test-projects/laravel-app/ai-context/context/flows/unnamed.json +9 -0
- package/test-projects/laravel-app/ai-context/conventions.md +51 -0
- package/test-projects/laravel-app/ai-context/dependencies.json +6 -0
- package/test-projects/laravel-app/ai-context/entrypoints.md +4 -0
- package/test-projects/laravel-app/ai-context/files.json +199 -0
- package/test-projects/laravel-app/ai-context/graph/knowledge-graph.json +98 -0
- package/test-projects/laravel-app/ai-context/graph/module-graph.json +30 -0
- package/test-projects/laravel-app/ai-context/graph/symbol-graph.json +5 -0
- package/test-projects/laravel-app/ai-context/graph/symbol-references.json +1 -0
- package/test-projects/laravel-app/ai-context/index-state.json +280 -0
- package/test-projects/laravel-app/ai-context/index.db +0 -0
- package/test-projects/laravel-app/ai-context/modules.json +29 -0
- package/test-projects/laravel-app/ai-context/project.json +17 -0
- package/test-projects/laravel-app/ai-context/repo_map.json +419 -0
- package/test-projects/laravel-app/ai-context/repo_map.md +106 -0
- package/test-projects/laravel-app/ai-context/schema.json +5 -0
- package/test-projects/laravel-app/ai-context/summary.md +15 -0
- package/test-projects/laravel-app/ai-context/symbols.json +1 -0
- package/test-projects/laravel-app/ai-context/tech_stack.md +34 -0
- package/test-projects/laravel-app/ai-context/tools.json +10 -0
- package/test-projects/laravel-app/app/Http/Controllers/Api/CategoryController.php +88 -0
- package/test-projects/laravel-app/app/Http/Controllers/Api/CommentController.php +56 -0
- package/test-projects/laravel-app/app/Http/Controllers/Api/PostController.php +174 -0
- package/test-projects/laravel-app/app/Http/Controllers/Controller.php +12 -0
- package/test-projects/laravel-app/app/Models/Category.php +34 -0
- package/test-projects/laravel-app/app/Models/Comment.php +51 -0
- package/test-projects/laravel-app/app/Models/Post.php +108 -0
- package/test-projects/laravel-app/app/Models/User.php +85 -0
- package/test-projects/laravel-app/bootstrap/app.php +25 -0
- package/test-projects/laravel-app/composer.json +35 -0
- package/test-projects/laravel-app/routes/api.php +40 -0
- package/test-projects/nestjs-backend/.ai-dev/ai_context.md +111 -0
- package/test-projects/nestjs-backend/.ai-dev/ai_rules.md +52 -0
- package/test-projects/nestjs-backend/.ai-dev/architecture.md +49 -0
- package/test-projects/nestjs-backend/.ai-dev/cache.json +169 -0
- package/test-projects/nestjs-backend/.ai-dev/context/features/src.json +23 -0
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +14 -0
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.json +10 -0
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users..json +10 -0
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.controller.json +14 -0
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.json +10 -0
- package/test-projects/nestjs-backend/.ai-dev/conventions.md +52 -0
- package/test-projects/nestjs-backend/.ai-dev/dependencies.json +152 -0
- package/test-projects/nestjs-backend/.ai-dev/entrypoints.md +18 -0
- package/test-projects/nestjs-backend/.ai-dev/files.json +209 -0
- package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +132 -0
- package/test-projects/nestjs-backend/.ai-dev/graph/module-graph.json +29 -0
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-graph.json +304 -0
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-references.json +5 -0
- package/test-projects/nestjs-backend/.ai-dev/index-state.json +294 -0
- package/test-projects/nestjs-backend/.ai-dev/index.db +0 -0
- package/test-projects/nestjs-backend/.ai-dev/modules.json +19 -0
- package/test-projects/nestjs-backend/.ai-dev/project.json +18 -0
- package/test-projects/nestjs-backend/.ai-dev/repo_map.json +427 -0
- package/test-projects/nestjs-backend/.ai-dev/repo_map.md +104 -0
- package/test-projects/nestjs-backend/.ai-dev/schema.json +5 -0
- package/test-projects/nestjs-backend/.ai-dev/summary.md +13 -0
- package/test-projects/nestjs-backend/.ai-dev/symbols.json +1 -0
- package/{ai → test-projects/nestjs-backend/.ai-dev}/tech_stack.md +6 -7
- package/test-projects/nestjs-backend/.ai-dev/tools.json +10 -0
- package/test-projects/nestjs-backend/ai-context/ai_context.md +111 -0
- package/test-projects/nestjs-backend/ai-context/ai_rules.md +52 -0
- package/test-projects/nestjs-backend/ai-context/architecture.md +49 -0
- package/test-projects/nestjs-backend/ai-context/cache.json +169 -0
- package/test-projects/nestjs-backend/ai-context/context/features/src.json +23 -0
- package/test-projects/nestjs-backend/ai-context/context/flows/auth.controller.json +14 -0
- package/test-projects/nestjs-backend/ai-context/context/flows/auth.json +10 -0
- package/test-projects/nestjs-backend/ai-context/context/flows/users..json +10 -0
- package/test-projects/nestjs-backend/ai-context/context/flows/users.controller.json +14 -0
- package/test-projects/nestjs-backend/ai-context/context/flows/users.json +10 -0
- package/test-projects/nestjs-backend/ai-context/conventions.md +52 -0
- package/test-projects/nestjs-backend/ai-context/dependencies.json +152 -0
- package/test-projects/nestjs-backend/ai-context/entrypoints.md +18 -0
- package/test-projects/nestjs-backend/ai-context/files.json +209 -0
- package/test-projects/nestjs-backend/ai-context/graph/knowledge-graph.json +132 -0
- package/test-projects/nestjs-backend/ai-context/graph/module-graph.json +29 -0
- package/test-projects/nestjs-backend/ai-context/graph/symbol-graph.json +304 -0
- package/test-projects/nestjs-backend/ai-context/graph/symbol-references.json +5 -0
- package/test-projects/nestjs-backend/ai-context/index-state.json +294 -0
- package/test-projects/nestjs-backend/ai-context/index.db +0 -0
- package/test-projects/nestjs-backend/ai-context/modules.json +19 -0
- package/test-projects/nestjs-backend/ai-context/project.json +18 -0
- package/test-projects/nestjs-backend/ai-context/repo_map.json +427 -0
- package/test-projects/nestjs-backend/ai-context/repo_map.md +104 -0
- package/test-projects/nestjs-backend/ai-context/schema.json +5 -0
- package/test-projects/nestjs-backend/ai-context/summary.md +13 -0
- package/test-projects/nestjs-backend/ai-context/symbols.json +1 -0
- package/test-projects/nestjs-backend/ai-context/tech_stack.md +38 -0
- package/test-projects/nestjs-backend/ai-context/tools.json +10 -0
- package/test-projects/nestjs-backend/package.json +22 -0
- package/test-projects/nestjs-backend/src/app.module.ts +8 -0
- package/test-projects/nestjs-backend/src/auth/auth.controller.ts +22 -0
- package/test-projects/nestjs-backend/src/auth/auth.module.ts +11 -0
- package/test-projects/nestjs-backend/src/auth/auth.service.ts +28 -0
- package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +4 -0
- package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +18 -0
- package/test-projects/nestjs-backend/src/main.ts +9 -0
- package/test-projects/nestjs-backend/src/users/users.controller.ts +32 -0
- package/test-projects/nestjs-backend/src/users/users.module.ts +10 -0
- package/test-projects/nestjs-backend/src/users/users.service.ts +42 -0
- package/test-projects/nestjs-backend/tsconfig.json +21 -0
- package/test-projects/python-cli/.ai-dev/ai_context.md +95 -0
- package/test-projects/python-cli/.ai-dev/ai_rules.md +47 -0
- package/test-projects/python-cli/.ai-dev/architecture.md +55 -0
- package/test-projects/python-cli/.ai-dev/cache.json +149 -0
- package/test-projects/python-cli/.ai-dev/context/features/cli.json +16 -0
- package/test-projects/python-cli/.ai-dev/context/flows/list_.json +9 -0
- package/test-projects/python-cli/.ai-dev/context/flows/remove_.json +9 -0
- package/test-projects/python-cli/.ai-dev/conventions.md +51 -0
- package/test-projects/python-cli/.ai-dev/dependencies.json +66 -0
- package/test-projects/python-cli/.ai-dev/entrypoints.md +4 -0
- package/test-projects/python-cli/.ai-dev/files.json +184 -0
- package/test-projects/python-cli/.ai-dev/graph/knowledge-graph.json +83 -0
- package/test-projects/python-cli/.ai-dev/graph/module-graph.json +31 -0
- package/test-projects/python-cli/.ai-dev/graph/symbol-graph.json +358 -0
- package/test-projects/python-cli/.ai-dev/graph/symbol-references.json +11 -0
- package/test-projects/python-cli/.ai-dev/index-state.json +259 -0
- package/test-projects/python-cli/.ai-dev/index.db +0 -0
- package/test-projects/python-cli/.ai-dev/modules.json +21 -0
- package/test-projects/python-cli/.ai-dev/project.json +15 -0
- package/test-projects/python-cli/.ai-dev/repo_map.json +367 -0
- package/test-projects/python-cli/.ai-dev/repo_map.md +93 -0
- package/test-projects/python-cli/.ai-dev/schema.json +5 -0
- package/test-projects/python-cli/.ai-dev/summary.md +14 -0
- package/test-projects/python-cli/.ai-dev/symbols.json +1 -0
- package/test-projects/python-cli/.ai-dev/tech_stack.md +32 -0
- package/test-projects/python-cli/.ai-dev/tools.json +10 -0
- package/test-projects/python-cli/__init__.py +1 -0
- package/test-projects/python-cli/ai-context/ai_context.md +95 -0
- package/test-projects/python-cli/ai-context/ai_rules.md +47 -0
- package/test-projects/python-cli/ai-context/architecture.md +55 -0
- package/test-projects/python-cli/ai-context/cache.json +149 -0
- package/test-projects/python-cli/ai-context/context/features/cli.json +16 -0
- package/test-projects/python-cli/ai-context/context/flows/list_.json +9 -0
- package/test-projects/python-cli/ai-context/context/flows/remove_.json +9 -0
- package/test-projects/python-cli/ai-context/conventions.md +51 -0
- package/test-projects/python-cli/ai-context/dependencies.json +66 -0
- package/test-projects/python-cli/ai-context/entrypoints.md +4 -0
- package/test-projects/python-cli/ai-context/files.json +184 -0
- package/test-projects/python-cli/ai-context/graph/knowledge-graph.json +83 -0
- package/test-projects/python-cli/ai-context/graph/module-graph.json +31 -0
- package/test-projects/python-cli/ai-context/graph/symbol-graph.json +358 -0
- package/test-projects/python-cli/ai-context/graph/symbol-references.json +11 -0
- package/test-projects/python-cli/ai-context/index-state.json +259 -0
- package/test-projects/python-cli/ai-context/index.db +0 -0
- package/test-projects/python-cli/ai-context/modules.json +21 -0
- package/test-projects/python-cli/ai-context/project.json +15 -0
- package/test-projects/python-cli/ai-context/repo_map.json +367 -0
- package/test-projects/python-cli/ai-context/repo_map.md +93 -0
- package/test-projects/python-cli/ai-context/schema.json +5 -0
- package/test-projects/python-cli/ai-context/summary.md +14 -0
- package/test-projects/python-cli/ai-context/symbols.json +1 -0
- package/test-projects/python-cli/ai-context/tech_stack.md +32 -0
- package/test-projects/python-cli/ai-context/tools.json +10 -0
- package/test-projects/python-cli/cli/__init__.py +1 -0
- package/test-projects/python-cli/cli/add_command.py +6 -0
- package/test-projects/python-cli/cli/list_command.py +7 -0
- package/test-projects/python-cli/cli/remove_command.py +6 -0
- package/test-projects/python-cli/main.py +34 -0
- package/test-projects/python-cli/models/__init__.py +2 -0
- package/test-projects/python-cli/models/task.py +19 -0
- package/test-projects/python-cli/models/task_repository.py +44 -0
- package/test-projects/rails-app/.ai-dev/ai_context.md +94 -0
- package/test-projects/rails-app/.ai-dev/ai_rules.md +47 -0
- package/test-projects/rails-app/.ai-dev/architecture.md +49 -0
- package/test-projects/rails-app/.ai-dev/cache.json +193 -0
- package/test-projects/rails-app/.ai-dev/context/features/app.json +24 -0
- package/test-projects/rails-app/.ai-dev/context/features/config.json +13 -0
- package/test-projects/rails-app/.ai-dev/context/flows/application.json +9 -0
- package/test-projects/rails-app/.ai-dev/context/flows/application_.json +9 -0
- package/test-projects/rails-app/.ai-dev/context/flows/comments.json +11 -0
- package/test-projects/rails-app/.ai-dev/context/flows/comments_.json +11 -0
- package/test-projects/rails-app/.ai-dev/context/flows/posts.json +11 -0
- package/test-projects/rails-app/.ai-dev/context/flows/posts_.json +11 -0
- package/test-projects/rails-app/.ai-dev/context/flows/routes.json +9 -0
- package/test-projects/rails-app/.ai-dev/context/flows/users.json +11 -0
- package/test-projects/rails-app/.ai-dev/context/flows/users_.json +11 -0
- package/test-projects/rails-app/.ai-dev/conventions.md +51 -0
- package/test-projects/rails-app/.ai-dev/dependencies.json +6 -0
- package/test-projects/rails-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/rails-app/.ai-dev/files.json +239 -0
- package/test-projects/rails-app/.ai-dev/graph/knowledge-graph.json +130 -0
- package/test-projects/rails-app/.ai-dev/graph/module-graph.json +27 -0
- package/test-projects/rails-app/.ai-dev/graph/symbol-graph.json +5 -0
- package/test-projects/rails-app/.ai-dev/graph/symbol-references.json +1 -0
- package/test-projects/rails-app/.ai-dev/index-state.json +336 -0
- package/test-projects/rails-app/.ai-dev/index.db +0 -0
- package/test-projects/rails-app/.ai-dev/modules.json +26 -0
- package/test-projects/rails-app/.ai-dev/project.json +22 -0
- package/test-projects/rails-app/.ai-dev/repo_map.json +486 -0
- package/test-projects/rails-app/.ai-dev/repo_map.md +117 -0
- package/test-projects/rails-app/.ai-dev/schema.json +5 -0
- package/test-projects/rails-app/.ai-dev/summary.md +13 -0
- package/test-projects/rails-app/.ai-dev/symbols.json +1 -0
- package/test-projects/rails-app/.ai-dev/tech_stack.md +32 -0
- package/test-projects/rails-app/.ai-dev/tools.json +10 -0
- package/test-projects/rails-app/Gemfile +38 -0
- package/test-projects/rails-app/README.md +140 -0
- package/test-projects/rails-app/Rakefile +8 -0
- package/test-projects/rails-app/ai-context/ai_context.md +94 -0
- package/test-projects/rails-app/ai-context/ai_rules.md +47 -0
- package/test-projects/rails-app/ai-context/architecture.md +49 -0
- package/test-projects/rails-app/ai-context/cache.json +193 -0
- package/test-projects/rails-app/ai-context/context/features/app.json +24 -0
- package/test-projects/rails-app/ai-context/context/features/config.json +13 -0
- package/test-projects/rails-app/ai-context/context/flows/application.json +9 -0
- package/test-projects/rails-app/ai-context/context/flows/application_.json +9 -0
- package/test-projects/rails-app/ai-context/context/flows/comments.json +11 -0
- package/test-projects/rails-app/ai-context/context/flows/comments_.json +11 -0
- package/test-projects/rails-app/ai-context/context/flows/posts.json +11 -0
- package/test-projects/rails-app/ai-context/context/flows/posts_.json +11 -0
- package/test-projects/rails-app/ai-context/context/flows/routes.json +9 -0
- package/test-projects/rails-app/ai-context/context/flows/users.json +11 -0
- package/test-projects/rails-app/ai-context/context/flows/users_.json +11 -0
- package/test-projects/rails-app/ai-context/conventions.md +51 -0
- package/test-projects/rails-app/ai-context/dependencies.json +6 -0
- package/test-projects/rails-app/ai-context/entrypoints.md +4 -0
- package/test-projects/rails-app/ai-context/files.json +239 -0
- package/test-projects/rails-app/ai-context/graph/knowledge-graph.json +130 -0
- package/test-projects/rails-app/ai-context/graph/module-graph.json +27 -0
- package/test-projects/rails-app/ai-context/graph/symbol-graph.json +5 -0
- package/test-projects/rails-app/ai-context/graph/symbol-references.json +1 -0
- package/test-projects/rails-app/ai-context/index-state.json +336 -0
- package/test-projects/rails-app/ai-context/index.db +0 -0
- package/test-projects/rails-app/ai-context/modules.json +26 -0
- package/test-projects/rails-app/ai-context/project.json +22 -0
- package/test-projects/rails-app/ai-context/repo_map.json +486 -0
- package/test-projects/rails-app/ai-context/repo_map.md +117 -0
- package/test-projects/rails-app/ai-context/schema.json +5 -0
- package/test-projects/rails-app/ai-context/summary.md +13 -0
- package/test-projects/rails-app/ai-context/symbols.json +1 -0
- package/test-projects/rails-app/ai-context/tech_stack.md +32 -0
- package/test-projects/rails-app/ai-context/tools.json +10 -0
- package/test-projects/rails-app/app/controllers/api/comments_controller.rb +75 -0
- package/test-projects/rails-app/app/controllers/api/posts_controller.rb +68 -0
- package/test-projects/rails-app/app/controllers/api/users_controller.rb +54 -0
- package/test-projects/rails-app/app/controllers/application_controller.rb +31 -0
- package/test-projects/rails-app/app/models/comment.rb +34 -0
- package/test-projects/rails-app/app/models/post.rb +36 -0
- package/test-projects/rails-app/app/models/user.rb +28 -0
- package/test-projects/rails-app/app/services/post_service.rb +92 -0
- package/test-projects/rails-app/app/services/user_service.rb +76 -0
- package/test-projects/rails-app/config/application.rb +27 -0
- package/test-projects/rails-app/config/environment.rb +7 -0
- package/test-projects/rails-app/config/routes.rb +15 -0
- package/test-projects/react-app/.ai-dev/ai_context.md +96 -0
- package/test-projects/react-app/.ai-dev/ai_rules.md +49 -0
- package/test-projects/react-app/.ai-dev/architecture.md +39 -0
- package/test-projects/react-app/.ai-dev/cache.json +153 -0
- package/test-projects/react-app/.ai-dev/context/features/src.json +18 -0
- package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +14 -0
- package/test-projects/react-app/.ai-dev/context/flows/dashboard.json +9 -0
- package/test-projects/react-app/.ai-dev/context/flows/login.json +9 -0
- package/test-projects/react-app/.ai-dev/context/flows/users.json +9 -0
- package/test-projects/react-app/.ai-dev/dependencies.json +128 -0
- package/test-projects/react-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/react-app/.ai-dev/files.json +189 -0
- package/test-projects/react-app/.ai-dev/graph/knowledge-graph.json +112 -0
- package/test-projects/react-app/.ai-dev/graph/module-graph.json +31 -0
- package/test-projects/react-app/.ai-dev/graph/symbol-graph.json +868 -0
- package/test-projects/react-app/.ai-dev/graph/symbol-references.json +31 -0
- package/test-projects/react-app/.ai-dev/index-state.json +266 -0
- package/test-projects/react-app/.ai-dev/index.db +0 -0
- package/test-projects/react-app/.ai-dev/modules.json +17 -0
- package/test-projects/react-app/.ai-dev/project.json +16 -0
- package/test-projects/react-app/.ai-dev/repo_map.json +391 -0
- package/test-projects/react-app/.ai-dev/repo_map.md +94 -0
- package/test-projects/react-app/.ai-dev/schema.json +5 -0
- package/test-projects/react-app/.ai-dev/summary.md +13 -0
- package/test-projects/react-app/.ai-dev/symbols.json +1 -0
- package/test-projects/react-app/.ai-dev/tech_stack.md +39 -0
- package/test-projects/react-app/.ai-dev/tools.json +10 -0
- package/test-projects/react-app/ai-context/ai_context.md +96 -0
- package/test-projects/react-app/ai-context/ai_rules.md +49 -0
- package/test-projects/react-app/ai-context/architecture.md +39 -0
- package/test-projects/react-app/ai-context/cache.json +153 -0
- package/test-projects/react-app/ai-context/context/features/src.json +18 -0
- package/test-projects/react-app/ai-context/context/flows/UsersPage.json +14 -0
- package/test-projects/react-app/ai-context/context/flows/dashboard.json +9 -0
- package/test-projects/react-app/ai-context/context/flows/login.json +9 -0
- package/test-projects/react-app/ai-context/context/flows/users.json +9 -0
- package/test-projects/react-app/ai-context/conventions.md +52 -0
- package/test-projects/react-app/ai-context/dependencies.json +128 -0
- package/test-projects/react-app/ai-context/entrypoints.md +4 -0
- package/test-projects/react-app/ai-context/files.json +189 -0
- package/test-projects/react-app/ai-context/graph/knowledge-graph.json +112 -0
- package/test-projects/react-app/ai-context/graph/module-graph.json +31 -0
- package/test-projects/react-app/ai-context/graph/symbol-graph.json +868 -0
- package/test-projects/react-app/ai-context/graph/symbol-references.json +31 -0
- package/test-projects/react-app/ai-context/index-state.json +266 -0
- package/test-projects/react-app/ai-context/index.db +0 -0
- package/test-projects/react-app/ai-context/modules.json +17 -0
- package/test-projects/react-app/ai-context/project.json +16 -0
- package/test-projects/react-app/ai-context/repo_map.json +391 -0
- package/test-projects/react-app/ai-context/repo_map.md +94 -0
- package/test-projects/react-app/ai-context/schema.json +5 -0
- package/test-projects/react-app/ai-context/summary.md +13 -0
- package/test-projects/react-app/ai-context/symbols.json +1 -0
- package/test-projects/react-app/ai-context/tech_stack.md +39 -0
- package/test-projects/react-app/ai-context/tools.json +10 -0
- package/test-projects/react-app/package.json +16 -0
- package/test-projects/react-app/src/App.tsx +21 -0
- package/test-projects/react-app/src/context/AuthContext.tsx +41 -0
- package/test-projects/react-app/src/hooks/useAuth.ts +10 -0
- package/test-projects/react-app/src/main.tsx +10 -0
- package/test-projects/react-app/src/pages/DashboardPage.tsx +17 -0
- package/test-projects/react-app/src/pages/LoginPage.tsx +41 -0
- package/test-projects/react-app/src/pages/UsersPage.tsx +36 -0
- package/test-projects/react-app/src/services/userService.ts +37 -0
- package/test-projects/salesforce-cli/.ai-dev/ai_context.md +89 -0
- package/test-projects/salesforce-cli/.ai-dev/ai_rules.md +47 -0
- package/test-projects/salesforce-cli/.ai-dev/architecture.md +39 -0
- package/test-projects/salesforce-cli/.ai-dev/cache.json +125 -0
- package/test-projects/salesforce-cli/.ai-dev/context/features/force-app.json +14 -0
- package/test-projects/salesforce-cli/.ai-dev/context/flows/account.json +9 -0
- package/test-projects/salesforce-cli/.ai-dev/context/flows/opportunity.json +9 -0
- package/test-projects/salesforce-cli/.ai-dev/conventions.md +51 -0
- package/test-projects/salesforce-cli/.ai-dev/dependencies.json +6 -0
- package/test-projects/salesforce-cli/.ai-dev/entrypoints.md +4 -0
- package/test-projects/salesforce-cli/.ai-dev/files.json +154 -0
- package/test-projects/salesforce-cli/.ai-dev/graph/knowledge-graph.json +64 -0
- package/test-projects/salesforce-cli/.ai-dev/graph/module-graph.json +13 -0
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-graph.json +148 -0
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +1 -0
- package/test-projects/salesforce-cli/.ai-dev/index-state.json +217 -0
- package/test-projects/salesforce-cli/.ai-dev/index.db +0 -0
- package/test-projects/salesforce-cli/.ai-dev/modules.json +12 -0
- package/test-projects/salesforce-cli/.ai-dev/project.json +14 -0
- package/test-projects/salesforce-cli/.ai-dev/repo_map.json +328 -0
- package/test-projects/salesforce-cli/.ai-dev/repo_map.md +80 -0
- package/test-projects/salesforce-cli/.ai-dev/schema.json +5 -0
- package/test-projects/salesforce-cli/.ai-dev/summary.md +13 -0
- package/test-projects/salesforce-cli/.ai-dev/symbols.json +1 -0
- package/test-projects/salesforce-cli/.ai-dev/tech_stack.md +31 -0
- package/test-projects/salesforce-cli/.ai-dev/tools.json +10 -0
- package/test-projects/salesforce-cli/.forceignore +27 -0
- package/test-projects/salesforce-cli/ai-context/ai_context.md +89 -0
- package/test-projects/salesforce-cli/ai-context/ai_rules.md +47 -0
- package/test-projects/salesforce-cli/ai-context/architecture.md +39 -0
- package/test-projects/salesforce-cli/ai-context/cache.json +125 -0
- package/test-projects/salesforce-cli/ai-context/context/features/force-app.json +14 -0
- package/test-projects/salesforce-cli/ai-context/context/flows/account.json +9 -0
- package/test-projects/salesforce-cli/ai-context/context/flows/opportunity.json +9 -0
- package/test-projects/salesforce-cli/ai-context/conventions.md +51 -0
- package/test-projects/salesforce-cli/ai-context/dependencies.json +6 -0
- package/test-projects/salesforce-cli/ai-context/entrypoints.md +4 -0
- package/test-projects/salesforce-cli/ai-context/files.json +154 -0
- package/test-projects/salesforce-cli/ai-context/graph/knowledge-graph.json +64 -0
- package/test-projects/salesforce-cli/ai-context/graph/module-graph.json +13 -0
- package/test-projects/salesforce-cli/ai-context/graph/symbol-graph.json +148 -0
- package/test-projects/salesforce-cli/ai-context/graph/symbol-references.json +1 -0
- package/test-projects/salesforce-cli/ai-context/index-state.json +217 -0
- package/test-projects/salesforce-cli/ai-context/index.db +0 -0
- package/test-projects/salesforce-cli/ai-context/modules.json +12 -0
- package/test-projects/salesforce-cli/ai-context/project.json +14 -0
- package/test-projects/salesforce-cli/ai-context/repo_map.json +328 -0
- package/test-projects/salesforce-cli/ai-context/repo_map.md +80 -0
- package/test-projects/salesforce-cli/ai-context/schema.json +5 -0
- package/test-projects/salesforce-cli/ai-context/summary.md +13 -0
- package/test-projects/salesforce-cli/ai-context/symbols.json +1 -0
- package/test-projects/salesforce-cli/ai-context/tech_stack.md +31 -0
- package/test-projects/salesforce-cli/ai-context/tools.json +10 -0
- package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +24 -0
- package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +25 -0
- package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +45 -0
- package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +33 -0
- package/test-projects/salesforce-cli/sfdx-project.json +11 -0
- package/test-projects/spring-boot-app/.ai-dev/ai_context.md +91 -0
- package/test-projects/spring-boot-app/.ai-dev/ai_rules.md +48 -0
- package/test-projects/spring-boot-app/.ai-dev/architecture.md +39 -0
- package/test-projects/spring-boot-app/.ai-dev/cache.json +173 -0
- package/test-projects/spring-boot-app/.ai-dev/context/features/src.json +26 -0
- package/test-projects/spring-boot-app/.ai-dev/context/flows/PostController.json +19 -0
- package/test-projects/spring-boot-app/.ai-dev/context/flows/UserController.json +19 -0
- package/test-projects/spring-boot-app/.ai-dev/context/flows/comment.json +11 -0
- package/test-projects/spring-boot-app/.ai-dev/context/flows/post.json +14 -0
- package/test-projects/spring-boot-app/.ai-dev/context/flows/user.json +14 -0
- package/test-projects/spring-boot-app/.ai-dev/conventions.md +52 -0
- package/test-projects/spring-boot-app/.ai-dev/dependencies.json +326 -0
- package/test-projects/spring-boot-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/spring-boot-app/.ai-dev/files.json +214 -0
- package/test-projects/spring-boot-app/.ai-dev/graph/knowledge-graph.json +231 -0
- package/test-projects/spring-boot-app/.ai-dev/graph/module-graph.json +22 -0
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-graph.json +794 -0
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-references.json +70 -0
- package/test-projects/spring-boot-app/.ai-dev/index-state.json +301 -0
- package/test-projects/spring-boot-app/.ai-dev/index.db +0 -0
- package/test-projects/spring-boot-app/.ai-dev/modules.json +21 -0
- package/test-projects/spring-boot-app/.ai-dev/project.json +17 -0
- package/test-projects/spring-boot-app/.ai-dev/repo_map.json +461 -0
- package/test-projects/spring-boot-app/.ai-dev/repo_map.md +109 -0
- package/test-projects/spring-boot-app/.ai-dev/schema.json +5 -0
- package/test-projects/spring-boot-app/.ai-dev/summary.md +12 -0
- package/test-projects/spring-boot-app/.ai-dev/symbols.json +1 -0
- package/test-projects/spring-boot-app/.ai-dev/tech_stack.md +32 -0
- package/test-projects/spring-boot-app/.ai-dev/tools.json +10 -0
- package/test-projects/spring-boot-app/.classpath +57 -0
- package/test-projects/spring-boot-app/.factorypath +69 -0
- package/test-projects/spring-boot-app/.project +34 -0
- package/test-projects/spring-boot-app/.settings/org.eclipse.core.resources.prefs +4 -0
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.apt.core.prefs +4 -0
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.core.prefs +10 -0
- package/test-projects/spring-boot-app/.settings/org.eclipse.m2e.core.prefs +4 -0
- package/test-projects/spring-boot-app/README.md +122 -0
- package/test-projects/spring-boot-app/ai-context/ai_context.md +91 -0
- package/test-projects/spring-boot-app/ai-context/ai_rules.md +48 -0
- package/test-projects/spring-boot-app/ai-context/architecture.md +39 -0
- package/test-projects/spring-boot-app/ai-context/cache.json +173 -0
- package/test-projects/spring-boot-app/ai-context/context/features/src.json +26 -0
- package/test-projects/spring-boot-app/ai-context/context/flows/PostController.json +19 -0
- package/test-projects/spring-boot-app/ai-context/context/flows/UserController.json +19 -0
- package/test-projects/spring-boot-app/ai-context/context/flows/comment.json +11 -0
- package/test-projects/spring-boot-app/ai-context/context/flows/post.json +14 -0
- package/test-projects/spring-boot-app/ai-context/context/flows/user.json +14 -0
- package/test-projects/spring-boot-app/ai-context/conventions.md +52 -0
- package/test-projects/spring-boot-app/ai-context/dependencies.json +326 -0
- package/test-projects/spring-boot-app/ai-context/entrypoints.md +4 -0
- package/test-projects/spring-boot-app/ai-context/files.json +214 -0
- package/test-projects/spring-boot-app/ai-context/graph/knowledge-graph.json +231 -0
- package/test-projects/spring-boot-app/ai-context/graph/module-graph.json +22 -0
- package/test-projects/spring-boot-app/ai-context/graph/symbol-graph.json +794 -0
- package/test-projects/spring-boot-app/ai-context/graph/symbol-references.json +70 -0
- package/test-projects/spring-boot-app/ai-context/index-state.json +301 -0
- package/test-projects/spring-boot-app/ai-context/index.db +0 -0
- package/test-projects/spring-boot-app/ai-context/modules.json +21 -0
- package/test-projects/spring-boot-app/ai-context/project.json +17 -0
- package/test-projects/spring-boot-app/ai-context/repo_map.json +461 -0
- package/test-projects/spring-boot-app/ai-context/repo_map.md +109 -0
- package/test-projects/spring-boot-app/ai-context/schema.json +5 -0
- package/test-projects/spring-boot-app/ai-context/summary.md +12 -0
- package/test-projects/spring-boot-app/ai-context/symbols.json +1 -0
- package/test-projects/spring-boot-app/ai-context/tech_stack.md +32 -0
- package/test-projects/spring-boot-app/ai-context/tools.json +10 -0
- package/test-projects/spring-boot-app/pom.xml +79 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/DemoApplication.java +12 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/CommentController.java +89 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java +92 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java +84 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Comment.java +38 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Post.java +56 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/User.java +44 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/CommentRepository.java +21 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/PostRepository.java +18 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/UserRepository.java +15 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/PostService.java +83 -0
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/UserService.java +62 -0
- package/test-projects/spring-boot-app/src/main/resources/application.properties +22 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/DemoApplication.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Comment.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Post.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/User.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/CommentRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/PostRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/UserRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/services/PostService.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/services/UserService.class +0 -0
- package/test_adapters.mjs +87 -0
- package/tests/e2e/README.md +85 -0
- package/tests/e2e/run-e2e.sh +88 -0
- package/tests/phase2-fixes.test.ts +200 -0
- package/tests/semanticContexts.test.ts +23 -25
- package/ai/cache.json +0 -329
- package/ai/dependencies.json +0 -307
- package/ai/files.json +0 -1253
- package/ai/graph/module-graph.json +0 -119
- package/ai/graph/symbol-graph.json +0 -52738
- package/ai/graph/symbol-references.json +0 -1810
- package/ai/hierarchy.json +0 -28
- package/ai/index-state.json +0 -931
- package/ai/index.db +0 -0
- package/ai/modules.json +0 -73
- package/ai/repo-map.json +0 -833
- package/ai/repo_map.json +0 -833
- package/ai/repo_map.md +0 -211
- package/ai/summary.md +0 -23
- /package/{ai → .ai-dev}/ccp/jira-123/context.json +0 -0
- /package/{ai → .ai-dev}/context/repo.json +0 -0
- /package/{ai → .ai-dev}/context/utils.json +0 -0
- /package/{ai → .ai-dev}/embeddings.json +0 -0
- /package/{ai → .ai-dev}/git/commit-activity.json +0 -0
- /package/{ai → .ai-dev}/git/recent-features.json +0 -0
- /package/{ai → .ai-dev}/git/recent-files.json +0 -0
- /package/{ai → .ai-dev}/git/recent-flows.json +0 -0
- /package/{ai/symbols.json → ai-context/git/recent-features.json} +0 -0
- /package/{ai → test-projects/react-app/.ai-dev}/conventions.md +0 -0
package/src/core/embeddings.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
1
|
import crypto from "crypto";
|
|
2
|
+
import { Database } from "sql.js";
|
|
4
3
|
import { Chunk } from "./chunker.js";
|
|
5
4
|
|
|
6
5
|
export interface Embedding {
|
|
@@ -24,6 +23,26 @@ export interface EmbeddingsIndex {
|
|
|
24
23
|
embeddings: Embedding[];
|
|
25
24
|
}
|
|
26
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Create embeddings table in the database
|
|
28
|
+
*/
|
|
29
|
+
export function createEmbeddingsTable(db: Database): void {
|
|
30
|
+
db.run(`
|
|
31
|
+
CREATE TABLE IF NOT EXISTS embeddings (
|
|
32
|
+
id TEXT PRIMARY KEY,
|
|
33
|
+
vector TEXT NOT NULL,
|
|
34
|
+
metadata TEXT NOT NULL,
|
|
35
|
+
chunk_id TEXT,
|
|
36
|
+
file_path TEXT,
|
|
37
|
+
start_line INTEGER,
|
|
38
|
+
end_line INTEGER,
|
|
39
|
+
type TEXT,
|
|
40
|
+
language TEXT
|
|
41
|
+
)
|
|
42
|
+
`);
|
|
43
|
+
db.run("CREATE INDEX IF NOT EXISTS idx_embeddings_file_path ON embeddings(file_path)");
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
/**
|
|
28
47
|
* Generate a simple hash-based embedding (for testing/fallback)
|
|
29
48
|
* This creates a deterministic embedding based on content
|
|
@@ -86,40 +105,72 @@ export async function generateEmbeddings(
|
|
|
86
105
|
}
|
|
87
106
|
|
|
88
107
|
/**
|
|
89
|
-
* Save embeddings to
|
|
108
|
+
* Save embeddings to SQLite database
|
|
90
109
|
*/
|
|
91
110
|
export function saveEmbeddings(
|
|
111
|
+
db: Database,
|
|
92
112
|
embeddings: Embedding[],
|
|
93
|
-
aiDir: string,
|
|
94
113
|
model: string,
|
|
95
114
|
dimensions: number
|
|
96
115
|
): void {
|
|
97
|
-
|
|
98
|
-
version: "1.0.0",
|
|
99
|
-
model,
|
|
100
|
-
dimensions,
|
|
101
|
-
generated: new Date().toISOString(),
|
|
102
|
-
embeddings
|
|
103
|
-
};
|
|
116
|
+
db.run("DELETE FROM embeddings");
|
|
104
117
|
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
for (const embedding of embeddings) {
|
|
119
|
+
const vectorJson = JSON.stringify(embedding.vector);
|
|
120
|
+
const metadataJson = JSON.stringify(embedding.metadata);
|
|
121
|
+
|
|
122
|
+
db.run(
|
|
123
|
+
`INSERT INTO embeddings (id, vector, metadata, chunk_id, file_path, start_line, end_line, type, language)
|
|
124
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
125
|
+
[
|
|
126
|
+
embedding.id,
|
|
127
|
+
vectorJson,
|
|
128
|
+
metadataJson,
|
|
129
|
+
embedding.metadata.chunkId,
|
|
130
|
+
embedding.metadata.filePath,
|
|
131
|
+
embedding.metadata.startLine,
|
|
132
|
+
embedding.metadata.endLine,
|
|
133
|
+
embedding.metadata.type,
|
|
134
|
+
embedding.metadata.language
|
|
135
|
+
]
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
console.log(` ✅ Saved ${embeddings.length} embeddings to database`);
|
|
108
140
|
}
|
|
109
141
|
|
|
110
142
|
/**
|
|
111
|
-
* Load embeddings from
|
|
143
|
+
* Load embeddings from SQLite database
|
|
112
144
|
*/
|
|
113
|
-
export function loadEmbeddings(
|
|
114
|
-
const embeddingsPath = path.join(aiDir, "embeddings.json");
|
|
115
|
-
|
|
116
|
-
if (!fs.existsSync(embeddingsPath)) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
|
|
145
|
+
export function loadEmbeddings(db: Database): EmbeddingsIndex | null {
|
|
120
146
|
try {
|
|
121
|
-
const
|
|
122
|
-
|
|
147
|
+
const result = db.exec("SELECT id, vector, metadata FROM embeddings");
|
|
148
|
+
|
|
149
|
+
if (result.length === 0 || result[0].values.length === 0) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const embeddings: Embedding[] = [];
|
|
154
|
+
|
|
155
|
+
for (const row of result[0].values) {
|
|
156
|
+
const id = row[0] as string;
|
|
157
|
+
const vectorJson = row[1] as string;
|
|
158
|
+
const metadataJson = row[2] as string;
|
|
159
|
+
|
|
160
|
+
embeddings.push({
|
|
161
|
+
id,
|
|
162
|
+
vector: JSON.parse(vectorJson),
|
|
163
|
+
metadata: JSON.parse(metadataJson)
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
version: "1.0.0",
|
|
169
|
+
model: "simple-fallback",
|
|
170
|
+
dimensions: embeddings.length > 0 ? embeddings[0].vector.length : 384,
|
|
171
|
+
generated: new Date().toISOString(),
|
|
172
|
+
embeddings
|
|
173
|
+
};
|
|
123
174
|
} catch {
|
|
124
175
|
return null;
|
|
125
176
|
}
|
|
@@ -143,30 +194,45 @@ function cosineSimilarity(a: number[], b: number[]): number {
|
|
|
143
194
|
}
|
|
144
195
|
|
|
145
196
|
/**
|
|
146
|
-
* Search embeddings for similar chunks
|
|
197
|
+
* Search embeddings for similar chunks using SQLite database
|
|
147
198
|
*/
|
|
148
199
|
export function searchEmbeddings(
|
|
200
|
+
db: Database,
|
|
149
201
|
query: string,
|
|
150
|
-
|
|
202
|
+
dimensions: number = 384,
|
|
151
203
|
topK: number = 5
|
|
152
204
|
): { chunkId: string; filePath: string; score: number; content: string }[] {
|
|
153
|
-
|
|
154
|
-
const queryEmbedding = generateSimpleEmbedding(query, embeddingsIndex.dimensions);
|
|
205
|
+
const queryEmbedding = generateSimpleEmbedding(query, dimensions);
|
|
155
206
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
207
|
+
const result = db.exec("SELECT id, vector, metadata FROM embeddings");
|
|
208
|
+
|
|
209
|
+
if (result.length === 0 || result[0].values.length === 0) {
|
|
210
|
+
return [];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const searchResults: { chunkId: string; filePath: string; score: number; startLine: number; endLine: number; type: string }[] = [];
|
|
214
|
+
|
|
215
|
+
for (const row of result[0].values) {
|
|
216
|
+
const id = row[0] as string;
|
|
217
|
+
const vectorJson = row[1] as string;
|
|
218
|
+
const metadataJson = row[2] as string;
|
|
219
|
+
|
|
220
|
+
const vector = JSON.parse(vectorJson);
|
|
221
|
+
const metadata = JSON.parse(metadataJson);
|
|
222
|
+
|
|
223
|
+
searchResults.push({
|
|
224
|
+
chunkId: id,
|
|
225
|
+
filePath: metadata.filePath,
|
|
226
|
+
score: cosineSimilarity(queryEmbedding, vector),
|
|
227
|
+
startLine: metadata.startLine,
|
|
228
|
+
endLine: metadata.endLine,
|
|
229
|
+
type: metadata.type
|
|
230
|
+
});
|
|
231
|
+
}
|
|
165
232
|
|
|
166
|
-
|
|
167
|
-
results.sort((a, b) => b.score - a.score);
|
|
233
|
+
searchResults.sort((a, b) => b.score - a.score);
|
|
168
234
|
|
|
169
|
-
return
|
|
235
|
+
return searchResults.slice(0, topK).map(r => ({
|
|
170
236
|
chunkId: r.chunkId,
|
|
171
237
|
filePath: r.filePath,
|
|
172
238
|
score: r.score,
|
package/src/core/gitAnalyzer.ts
CHANGED
|
@@ -240,7 +240,7 @@ function loadFlows(aiDir: string): Map<string, string[]> {
|
|
|
240
240
|
* Map changed files to features
|
|
241
241
|
*/
|
|
242
242
|
export function mapFilesToFeatures(rootDir: string, files: string[]): string[] {
|
|
243
|
-
const aiDir = path.join(rootDir, "ai");
|
|
243
|
+
const aiDir = path.join(rootDir, "ai-context");
|
|
244
244
|
const featuresMap = loadFeatures(aiDir);
|
|
245
245
|
|
|
246
246
|
const featureSet = new Set<string>();
|
|
@@ -267,7 +267,7 @@ export function mapFilesToFeatures(rootDir: string, files: string[]): string[] {
|
|
|
267
267
|
* Map changed files to flows
|
|
268
268
|
*/
|
|
269
269
|
export function mapFilesToFlows(rootDir: string, files: string[]): string[] {
|
|
270
|
-
const aiDir = path.join(rootDir, "ai");
|
|
270
|
+
const aiDir = path.join(rootDir, "ai-context");
|
|
271
271
|
const flowsMap = loadFlows(aiDir);
|
|
272
272
|
|
|
273
273
|
const flowSet = new Set<string>();
|
|
@@ -354,7 +354,7 @@ export function generateGitContext(rootDir: string, aiDir?: string): {
|
|
|
354
354
|
recentFlows: string[];
|
|
355
355
|
activity: GitActivity | null;
|
|
356
356
|
} {
|
|
357
|
-
const targetAiDir = aiDir || path.join(rootDir, "ai");
|
|
357
|
+
const targetAiDir = aiDir || path.join(rootDir, "ai-context");
|
|
358
358
|
const gitDir = path.join(targetAiDir, "git");
|
|
359
359
|
|
|
360
360
|
ensureDir(gitDir);
|
|
@@ -86,7 +86,7 @@ function detectChangesWithGit(rootDir: string): ChangedFile[] {
|
|
|
86
86
|
|
|
87
87
|
function detectChangesWithTimestamps(rootDir: string): ChangedFile[] {
|
|
88
88
|
const changes: ChangedFile[] = [];
|
|
89
|
-
const aiDir = path.join(rootDir, "ai");
|
|
89
|
+
const aiDir = path.join(rootDir, "ai-context");
|
|
90
90
|
const state = loadIndexState(aiDir);
|
|
91
91
|
|
|
92
92
|
if (!state) return [];
|
|
@@ -114,18 +114,56 @@ function detectChangesWithTimestamps(rootDir: string): ChangedFile[] {
|
|
|
114
114
|
|
|
115
115
|
export function updateSymbols(rootDir: string, changedFiles: ChangedFile[], aiDir: string): number {
|
|
116
116
|
const symbolsPath = path.join(aiDir, "symbols.json");
|
|
117
|
-
|
|
117
|
+
|
|
118
|
+
// Read existing symbols.json structure
|
|
119
|
+
interface SymbolsIndex {
|
|
120
|
+
[id: string]: { name: string; type: string; file: string; line?: number; module?: string; export?: boolean };
|
|
121
|
+
}
|
|
122
|
+
interface SymbolsData {
|
|
123
|
+
symbols: SymbolsIndex;
|
|
124
|
+
total: number;
|
|
125
|
+
byType: { [type: string]: Array<{ id: string; name: string; type: string; file: string; line?: number; export?: boolean }> };
|
|
126
|
+
byFile: { [file: string]: Array<{ id: string; name: string; type: string; file: string; line?: number; export?: boolean }> };
|
|
127
|
+
exported: Array<{ id: string; name: string; type: string; file: string; line?: number; export?: boolean }>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
let symbolsData: SymbolsData | null = null;
|
|
118
131
|
|
|
119
132
|
if (fs.existsSync(symbolsPath)) {
|
|
120
133
|
try {
|
|
121
134
|
const raw = readJsonFile(symbolsPath);
|
|
122
|
-
if (Array.isArray(raw)
|
|
123
|
-
|
|
135
|
+
if (!Array.isArray(raw) && raw && typeof raw === 'object') {
|
|
136
|
+
symbolsData = raw as unknown as SymbolsData;
|
|
137
|
+
}
|
|
138
|
+
} catch { }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// If no valid symbols.json exists, nothing to update
|
|
142
|
+
if (!symbolsData) {
|
|
143
|
+
return 0;
|
|
124
144
|
}
|
|
125
145
|
|
|
126
146
|
const changedPaths = new Set(changedFiles.map(f => f.path));
|
|
127
|
-
existingSymbols = existingSymbols.filter(s => !changedPaths.has(s.file));
|
|
128
147
|
|
|
148
|
+
// Remove symbols from changed files
|
|
149
|
+
for (const filePath of changedPaths) {
|
|
150
|
+
delete symbolsData.byFile[filePath];
|
|
151
|
+
for (const type of Object.keys(symbolsData.byType)) {
|
|
152
|
+
symbolsData.byType[type] = symbolsData.byType[type].filter(
|
|
153
|
+
sym => sym.file !== filePath
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
symbolsData.exported = symbolsData.exported.filter(sym => sym.file !== filePath);
|
|
157
|
+
// Remove from symbols index
|
|
158
|
+
const keysToDelete = Object.keys(symbolsData.symbols).filter(
|
|
159
|
+
id => id.startsWith(filePath + '#')
|
|
160
|
+
);
|
|
161
|
+
for (const key of keysToDelete) {
|
|
162
|
+
delete symbolsData.symbols[key];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Extract and add new symbols from changed files
|
|
129
167
|
for (const changed of changedFiles) {
|
|
130
168
|
if (changed.status === "deleted") continue;
|
|
131
169
|
const fullPath = path.join(rootDir, changed.path);
|
|
@@ -133,20 +171,72 @@ export function updateSymbols(rootDir: string, changedFiles: ChangedFile[], aiDi
|
|
|
133
171
|
|
|
134
172
|
try {
|
|
135
173
|
const fileInfo: FileInfo = {
|
|
136
|
-
path:
|
|
174
|
+
path: fullPath,
|
|
137
175
|
relativePath: changed.path,
|
|
138
176
|
extension: path.extname(changed.path),
|
|
139
177
|
name: path.basename(changed.path, path.extname(changed.path))
|
|
140
178
|
};
|
|
141
179
|
const symbols = extractSymbols([fileInfo]);
|
|
180
|
+
|
|
142
181
|
for (const symbol of symbols.symbols || []) {
|
|
143
|
-
|
|
182
|
+
const id = `${changed.path}#${symbol.name}`;
|
|
183
|
+
|
|
184
|
+
// Add to symbols index
|
|
185
|
+
symbolsData.symbols[id] = {
|
|
186
|
+
name: symbol.name,
|
|
187
|
+
type: symbol.type,
|
|
188
|
+
file: changed.path,
|
|
189
|
+
line: symbol.line,
|
|
190
|
+
module: changed.path.split('/')[0],
|
|
191
|
+
export: symbol.export
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// Add to byFile
|
|
195
|
+
if (!symbolsData.byFile[changed.path]) {
|
|
196
|
+
symbolsData.byFile[changed.path] = [];
|
|
197
|
+
}
|
|
198
|
+
symbolsData.byFile[changed.path].push({
|
|
199
|
+
id,
|
|
200
|
+
name: symbol.name,
|
|
201
|
+
type: symbol.type,
|
|
202
|
+
file: changed.path,
|
|
203
|
+
line: symbol.line,
|
|
204
|
+
export: symbol.export
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// Add to byType
|
|
208
|
+
if (!symbolsData.byType[symbol.type]) {
|
|
209
|
+
symbolsData.byType[symbol.type] = [];
|
|
210
|
+
}
|
|
211
|
+
symbolsData.byType[symbol.type].push({
|
|
212
|
+
id,
|
|
213
|
+
name: symbol.name,
|
|
214
|
+
type: symbol.type,
|
|
215
|
+
file: changed.path,
|
|
216
|
+
line: symbol.line,
|
|
217
|
+
export: symbol.export
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// Add to exported if applicable
|
|
221
|
+
if (symbol.export) {
|
|
222
|
+
symbolsData.exported.push({
|
|
223
|
+
id,
|
|
224
|
+
name: symbol.name,
|
|
225
|
+
type: symbol.type,
|
|
226
|
+
file: changed.path,
|
|
227
|
+
line: symbol.line,
|
|
228
|
+
export: symbol.export
|
|
229
|
+
});
|
|
230
|
+
}
|
|
144
231
|
}
|
|
145
232
|
} catch { /* skip */ }
|
|
146
233
|
}
|
|
147
234
|
|
|
148
|
-
|
|
149
|
-
|
|
235
|
+
// Update total
|
|
236
|
+
symbolsData.total = Object.keys(symbolsData.symbols).length;
|
|
237
|
+
|
|
238
|
+
writeFile(symbolsPath, JSON.stringify(symbolsData, null, 2));
|
|
239
|
+
return symbolsData.total;
|
|
150
240
|
}
|
|
151
241
|
|
|
152
242
|
// ============================================================
|
|
@@ -282,7 +372,7 @@ export function updateKnowledgeGraph(rootDir: string, aiDir: string): boolean {
|
|
|
282
372
|
// ============================================================
|
|
283
373
|
|
|
284
374
|
export function runIncrementalUpdate(rootDir: string, aiDir?: string): IncrementalUpdateResult {
|
|
285
|
-
const targetAiDir = aiDir || path.join(rootDir, "ai");
|
|
375
|
+
const targetAiDir = aiDir || path.join(rootDir, "ai-context");
|
|
286
376
|
const errors: string[] = [];
|
|
287
377
|
|
|
288
378
|
if (!fs.existsSync(targetAiDir)) {
|
|
@@ -346,7 +436,7 @@ export function runIncrementalUpdate(rootDir: string, aiDir?: string): Increment
|
|
|
346
436
|
}
|
|
347
437
|
|
|
348
438
|
function updateIndexState(rootDir: string, changedFiles: ChangedFile[]): void {
|
|
349
|
-
const aiDir = path.join(rootDir, "ai");
|
|
439
|
+
const aiDir = path.join(rootDir, "ai-context");
|
|
350
440
|
let state = loadIndexState(aiDir);
|
|
351
441
|
|
|
352
442
|
if (!state) {
|
|
@@ -147,7 +147,7 @@ export function createEdges(aiDir: string): KnowledgeEdge[] {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export function buildKnowledgeGraph(rootDir: string, aiDir?: string): KnowledgeGraph {
|
|
150
|
-
const targetAiDir = aiDir || path.join(rootDir, "ai");
|
|
150
|
+
const targetAiDir = aiDir || path.join(rootDir, "ai-context");
|
|
151
151
|
const graphDir = path.join(targetAiDir, "graph");
|
|
152
152
|
ensureDir(graphDir);
|
|
153
153
|
const nodes = createNodes(targetAiDir);
|
|
@@ -28,7 +28,11 @@ export interface SemanticContexts {
|
|
|
28
28
|
// ============================================================
|
|
29
29
|
|
|
30
30
|
// 1. Candidate roots - scan inside these directories
|
|
31
|
-
const CANDIDATE_ROOTS = [
|
|
31
|
+
const CANDIDATE_ROOTS = [
|
|
32
|
+
"src", "app", "packages", "services", "modules", "features",
|
|
33
|
+
// MVC patterns - for projects without src/ prefix
|
|
34
|
+
"controllers", "routes", "handlers", "views", "pages"
|
|
35
|
+
];
|
|
32
36
|
|
|
33
37
|
// 2. Ignore folders - these are technical, not business features
|
|
34
38
|
const IGNORED_FOLDERS = new Set([
|
|
@@ -39,7 +43,6 @@ const IGNORED_FOLDERS = new Set([
|
|
|
39
43
|
"constants",
|
|
40
44
|
"config",
|
|
41
45
|
"dto",
|
|
42
|
-
"models",
|
|
43
46
|
"common",
|
|
44
47
|
"shared"
|
|
45
48
|
]);
|
|
@@ -54,7 +57,11 @@ const ENTRYPOINT_PATTERNS = [
|
|
|
54
57
|
];
|
|
55
58
|
|
|
56
59
|
// 4. Flow-specific patterns
|
|
57
|
-
const FLOW_ENTRY_PATTERNS = [
|
|
60
|
+
const FLOW_ENTRY_PATTERNS = [
|
|
61
|
+
"controller", "route", "handler", "command",
|
|
62
|
+
// Frontend patterns
|
|
63
|
+
"page", "screen", "view", "component"
|
|
64
|
+
];
|
|
58
65
|
|
|
59
66
|
// 5. Flow exclusion patterns
|
|
60
67
|
const FLOW_EXCLUDE = new Set([
|
|
@@ -83,26 +90,44 @@ const MAX_FLOW_FILES = 30;
|
|
|
83
90
|
|
|
84
91
|
// Supported source file extensions
|
|
85
92
|
const SOURCE_EXTENSIONS = new Set([
|
|
86
|
-
".ts", ".tsx", ".js", ".jsx", ".py", ".java", ".kt", ".go", ".rs", ".rb", ".php", ".cs", ".vue", ".svelte"
|
|
93
|
+
".ts", ".tsx", ".js", ".jsx", ".py", ".java", ".kt", ".go", ".rs", ".rb", ".php", ".cs", ".vue", ".svelte",
|
|
94
|
+
// Salesforce/Apex
|
|
95
|
+
".cls", ".trigger", ".apex", ".object"
|
|
87
96
|
]);
|
|
88
97
|
|
|
89
98
|
// ============================================================
|
|
90
99
|
// HELPER FUNCTIONS
|
|
91
100
|
// ============================================================
|
|
92
101
|
|
|
102
|
+
function sanitizeFlowName(name: string): string {
|
|
103
|
+
return name
|
|
104
|
+
.replace(/\.\.+/g, ".")
|
|
105
|
+
.replace(/_+$/g, "")
|
|
106
|
+
.replace(/[^\w\-]/g, "_")
|
|
107
|
+
.replace(/_+/g, "_")
|
|
108
|
+
.replace(/^_+|_+$/g, "") || "unnamed";
|
|
109
|
+
}
|
|
110
|
+
|
|
93
111
|
function isSourceFile(filePath: string): boolean {
|
|
94
112
|
const ext = path.extname(filePath).toLowerCase();
|
|
95
113
|
return SOURCE_EXTENSIONS.has(ext);
|
|
96
114
|
}
|
|
97
115
|
|
|
98
116
|
function isEntrypoint(filePath: string): boolean {
|
|
117
|
+
const lower = filePath.toLowerCase();
|
|
118
|
+
// Check both filename and directory path
|
|
99
119
|
const basename = path.basename(filePath).toLowerCase();
|
|
100
|
-
return ENTRYPOINT_PATTERNS.some(pattern =>
|
|
120
|
+
return ENTRYPOINT_PATTERNS.some(pattern =>
|
|
121
|
+
basename.includes(pattern) || lower.includes("/" + pattern + "s/")
|
|
122
|
+
);
|
|
101
123
|
}
|
|
102
124
|
|
|
103
125
|
function isFlowEntrypoint(filePath: string): boolean {
|
|
126
|
+
const lower = filePath.toLowerCase();
|
|
104
127
|
const basename = path.basename(filePath).toLowerCase();
|
|
105
|
-
return FLOW_ENTRY_PATTERNS.some(pattern =>
|
|
128
|
+
return FLOW_ENTRY_PATTERNS.some(pattern =>
|
|
129
|
+
basename.includes(pattern) || lower.includes("/" + pattern + "s/")
|
|
130
|
+
);
|
|
106
131
|
}
|
|
107
132
|
|
|
108
133
|
function isIgnoredFolder(folderName: string): boolean {
|
|
@@ -164,7 +189,20 @@ function findFeatureCandidates(files: string[]): Map<string, string[]> {
|
|
|
164
189
|
|
|
165
190
|
if (rootIdx === -1) continue;
|
|
166
191
|
|
|
167
|
-
// Check depth
|
|
192
|
+
// Check depth 0: controllers/ itself is a feature (when file is directly in root)
|
|
193
|
+
const depth0FeatureIdx = rootIdx;
|
|
194
|
+
if (depth0FeatureIdx < parts.length - 1) {
|
|
195
|
+
const featureName0 = parts[depth0FeatureIdx];
|
|
196
|
+
if (!isIgnoredFolder(featureName0) && !featureName0.includes(".")) {
|
|
197
|
+
const featurePath0 = parts.slice(0, depth0FeatureIdx + 1).join("/");
|
|
198
|
+
if (!candidates.has(featurePath0)) {
|
|
199
|
+
candidates.set(featurePath0, []);
|
|
200
|
+
}
|
|
201
|
+
candidates.get(featurePath0)!.push(file);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Check depth 1 and 2: src/auth, src/modules/auth
|
|
168
206
|
for (let depth = 1; depth <= 2; depth++) {
|
|
169
207
|
const featureIdx = rootIdx + depth;
|
|
170
208
|
|
|
@@ -249,36 +287,29 @@ export function generateFeatures(
|
|
|
249
287
|
// Ignore errors, return empty
|
|
250
288
|
}
|
|
251
289
|
|
|
252
|
-
//
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const candidates = findFeatureCandidates(allFiles);
|
|
257
|
-
|
|
258
|
-
// Filter and validate candidates
|
|
259
|
-
for (const [featurePath, files] of candidates) {
|
|
290
|
+
// Use modules directly from modules.json
|
|
291
|
+
for (const [moduleName, mod] of Object.entries(modules)) {
|
|
292
|
+
const files = mod.files || [];
|
|
293
|
+
|
|
260
294
|
// Filter to source files only
|
|
261
295
|
const sourceFiles = files.filter(isSourceFile);
|
|
262
296
|
|
|
263
|
-
// Must have at least
|
|
264
|
-
if (sourceFiles.length <
|
|
297
|
+
// Must have at least 2 source files (relaxed from 3 for smaller projects)
|
|
298
|
+
if (sourceFiles.length < 2) continue;
|
|
265
299
|
|
|
266
300
|
// Must have at least one entrypoint
|
|
267
301
|
const entrypoints = sourceFiles.filter(isEntrypoint);
|
|
268
302
|
if (entrypoints.length === 0) continue;
|
|
269
303
|
|
|
270
|
-
// Extract feature name from path
|
|
271
|
-
const featureName =
|
|
272
|
-
|
|
273
|
-
// Get dependencies
|
|
274
|
-
const dependencies = getFeatureDependencies(featurePath, modules);
|
|
304
|
+
// Extract feature name from path - get the last segment
|
|
305
|
+
const featureName = mod.path.split("/").pop() || moduleName;
|
|
275
306
|
|
|
276
307
|
features.push({
|
|
277
308
|
name: featureName,
|
|
278
|
-
path:
|
|
309
|
+
path: mod.path,
|
|
279
310
|
files: sourceFiles.slice(0, 50),
|
|
280
311
|
entrypoints: entrypoints.slice(0, 10),
|
|
281
|
-
dependencies
|
|
312
|
+
dependencies: []
|
|
282
313
|
});
|
|
283
314
|
}
|
|
284
315
|
|
|
@@ -348,7 +379,7 @@ function flowsFromGraph(graphData: any): Flow[] {
|
|
|
348
379
|
// Must have at least 3 files and 2 layers
|
|
349
380
|
if (fileSet.size >= 3 && layerSet.size >= 2) {
|
|
350
381
|
flows.push({
|
|
351
|
-
name: path.basename(ep.file || ""),
|
|
382
|
+
name: sanitizeFlowName(path.basename(ep.file || "").replace(/\.[^.]+$/, "")),
|
|
352
383
|
entrypoint: ep.file || "",
|
|
353
384
|
files: Array.from(fileSet).slice(0, MAX_FLOW_FILES),
|
|
354
385
|
depth: Math.min(MAX_FLOW_DEPTH, [...visited].length),
|
|
@@ -372,9 +403,9 @@ function flowsFromFolders(files: string[]): Flow[] {
|
|
|
372
403
|
for (const file of files) {
|
|
373
404
|
if (!isSourceFile(file)) continue;
|
|
374
405
|
|
|
375
|
-
const baseName = path.basename(file).replace(/\.
|
|
376
|
-
// Extract feature: authController -> auth, userService -> user
|
|
377
|
-
const feature = baseName.replace(/(Controller|Service|Repository|Handler|Route|Model|Entity)$/i, "");
|
|
406
|
+
const baseName = path.basename(file).replace(/\.[^.]+$/, "");
|
|
407
|
+
// Extract feature: authController -> auth, userService -> user, LoginPage -> login, Dashboard -> dashboard
|
|
408
|
+
const feature = baseName.replace(/(Controller|Service|Repository|Handler|Route|Model|Entity|Command|Page|Screen|View|Component)$/i, "");
|
|
378
409
|
const key = feature.toLowerCase();
|
|
379
410
|
|
|
380
411
|
if (!byFeature.has(key)) {
|
|
@@ -384,10 +415,13 @@ function flowsFromFolders(files: string[]): Flow[] {
|
|
|
384
415
|
}
|
|
385
416
|
|
|
386
417
|
for (const [feature, featureFiles] of byFeature) {
|
|
387
|
-
|
|
418
|
+
// Relaxed: allow flows with 2+ files OR files that match entrypoint patterns
|
|
419
|
+
const hasEntrypoint = featureFiles.some(f => isFlowEntrypoint(f));
|
|
420
|
+
if (featureFiles.length < 2 && !hasEntrypoint) continue;
|
|
388
421
|
|
|
389
422
|
const layers = new Set(featureFiles.map(getLayer).filter(l => l !== "unknown"));
|
|
390
|
-
if
|
|
423
|
+
// Relaxed: allow single layer if files match entrypoint patterns
|
|
424
|
+
if (layers.size < 2 && !hasEntrypoint) continue;
|
|
391
425
|
|
|
392
426
|
const sorted = [...featureFiles].sort((a, b) =>
|
|
393
427
|
getLayerPriority(a) - getLayerPriority(b)
|
|
@@ -396,7 +430,7 @@ function flowsFromFolders(files: string[]): Flow[] {
|
|
|
396
430
|
const entrypoint = sorted.find(isFlowEntrypoint) || sorted[0];
|
|
397
431
|
|
|
398
432
|
flows.push({
|
|
399
|
-
name: feature,
|
|
433
|
+
name: sanitizeFlowName(feature),
|
|
400
434
|
entrypoint,
|
|
401
435
|
files: sorted.slice(0, MAX_FLOW_FILES),
|
|
402
436
|
depth: layers.size,
|
|
@@ -461,7 +495,7 @@ function flowsFromImports(
|
|
|
461
495
|
|
|
462
496
|
if (fileSet.size >= 3 && layerSet.size >= 2) {
|
|
463
497
|
flows.push({
|
|
464
|
-
name: path.basename(ep, path.extname(ep)),
|
|
498
|
+
name: sanitizeFlowName(path.basename(ep, path.extname(ep))),
|
|
465
499
|
entrypoint: ep,
|
|
466
500
|
files: Array.from(fileSet),
|
|
467
501
|
depth: Math.min(MAX_FLOW_DEPTH, [...visited].length),
|
|
@@ -567,7 +601,8 @@ export function generateSemanticContexts(aiDir: string): SemanticContexts {
|
|
|
567
601
|
// Write flows
|
|
568
602
|
ensureDir(flowsDir);
|
|
569
603
|
for (const flow of flows) {
|
|
570
|
-
const
|
|
604
|
+
const safeName = sanitizeFlowName(flow.name);
|
|
605
|
+
const filePath = path.join(flowsDir, `${safeName}.json`);
|
|
571
606
|
writeFile(filePath, JSON.stringify(flow, null, 2));
|
|
572
607
|
}
|
|
573
608
|
|
package/src/core/symbolGraph.ts
CHANGED
|
@@ -145,7 +145,7 @@ function buildSymbolRelationships(
|
|
|
145
145
|
// 1. Process imports relationships
|
|
146
146
|
for (const dep of depsAnalysis.dependencies) {
|
|
147
147
|
const sourceSymbols = symbols.filter(s => s.file === dep.source);
|
|
148
|
-
let targetSymbol = findTargetSymbol(dep.target, symbolMap);
|
|
148
|
+
let targetSymbol = findTargetSymbol(dep.target, symbolMap, symbols);
|
|
149
149
|
|
|
150
150
|
if (targetSymbol && sourceSymbols.length > 0) {
|
|
151
151
|
for (const source of sourceSymbols) {
|
|
@@ -185,7 +185,7 @@ function buildSymbolRelationships(
|
|
|
185
185
|
/**
|
|
186
186
|
* Find target symbol from import path
|
|
187
187
|
*/
|
|
188
|
-
function findTargetSymbol(targetPath: string, symbolMap: Map<string, Symbol
|
|
188
|
+
function findTargetSymbol(targetPath: string, symbolMap: Map<string, Symbol>, allSymbols?: Symbol[]): Symbol | undefined {
|
|
189
189
|
// Try exact match
|
|
190
190
|
let target = symbolMap.get(targetPath);
|
|
191
191
|
|
|
@@ -208,6 +208,20 @@ function findTargetSymbol(targetPath: string, symbolMap: Map<string, Symbol>): S
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
// Try to find any symbol in the target file
|
|
212
|
+
if (!target && allSymbols) {
|
|
213
|
+
const targetFile = targetPath.replace(/\.[^.]+$/, '');
|
|
214
|
+
const fileSymbols = allSymbols.filter(s => {
|
|
215
|
+
const symFile = s.file.replace(/\.[^.]+$/, '');
|
|
216
|
+
return symFile === targetFile || symFile.endsWith('/' + targetFile) || symFile.endsWith('/' + targetPath.replace(/\.[^.]+$/, ''));
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (fileSymbols.length > 0) {
|
|
220
|
+
// Return the first exported symbol, or just the first one
|
|
221
|
+
target = fileSymbols.find(s => s.export) || fileSymbols[0];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
211
225
|
return target;
|
|
212
226
|
}
|
|
213
227
|
|