ai-first-cli 1.1.5 → 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 +8 -8
- package/{ai → .ai-dev}/ai_rules.md +2 -2
- package/{ai → .ai-dev}/architecture.md +38 -23
- package/.ai-dev/cache.json +2349 -0
- package/.ai-dev/context/features/test-projects.json +69 -0
- package/.ai-dev/context/flows/api.json +9 -0
- package/{ai → .ai-dev}/context/flows/auth.json +2 -1
- package/.ai-dev/context/flows/category.json +12 -0
- package/.ai-dev/context/flows/comment.json +16 -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/views.json +14 -0
- package/.ai-dev/dependencies.json +2946 -0
- package/.ai-dev/files.json +2944 -0
- package/{ai → .ai-dev}/git/commit-activity.json +39 -126
- package/{ai → .ai-dev}/git/recent-files.json +6 -6
- package/.ai-dev/git/recent-flows.json +1 -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 → .ai-dev}/project.json +8 -7
- package/{ai → .ai-dev}/repo_map.json +3403 -918
- package/{ai → .ai-dev}/repo_map.md +604 -45
- package/{test-projects/nestjs-backend/ai → .ai-dev}/schema.json +1 -1
- package/{ai → .ai-dev}/summary.md +15 -5
- package/.ai-dev/symbols.json +7 -0
- package/{ai → .ai-dev}/tech_stack.md +7 -3
- package/.github/workflows/publish.yml +55 -0
- package/CHANGELOG.md +125 -0
- 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 -44411
- 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-features.json +1 -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/{test-projects/python-cli/ai → ai-context}/schema.json +1 -1
- package/ai-context/summary.md +42 -0
- package/ai-context/symbols.json +7 -0
- package/ai-context/tech_stack.md +46 -0
- package/dist/analyzers/symbols.d.ts.map +1 -1
- package/dist/analyzers/symbols.js +135 -7
- package/dist/analyzers/symbols.js.map +1 -1
- package/dist/commands/ai-first.d.ts.map +1 -1
- package/dist/commands/ai-first.js +35 -15
- 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 +13 -4
- package/dist/core/semanticContexts.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 +1 -1
- package/src/analyzers/symbols.ts +144 -7
- package/src/commands/ai-first.ts +37 -15
- 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 +14 -4
- 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/dependencies.json +312 -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/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/{express-api/ai → django-app/.ai-dev}/schema.json +1 -1
- 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/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/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/{ai → test-projects/django-app/ai-context}/schema.json +1 -1
- 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/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 → .ai-dev}/project.json +2 -2
- package/test-projects/express-api/{ai → .ai-dev}/repo_map.json +1 -1
- package/test-projects/express-api/.ai-dev/schema.json +5 -0
- package/test-projects/express-api/.ai-dev/symbols.json +7 -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/index.js +9 -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/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/{express-api/ai/repo-map.json → fastapi-app/.ai-dev/repo_map.json} +121 -114
- 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/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 → .ai-dev}/ai_context.md +7 -6
- package/test-projects/nestjs-backend/{ai → .ai-dev}/ai_rules.md +4 -4
- package/test-projects/nestjs-backend/{ai → .ai-dev}/architecture.md +6 -0
- package/test-projects/nestjs-backend/{ai → .ai-dev}/cache.json +65 -33
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +14 -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 → .ai-dev}/files.json +25 -0
- package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +132 -0
- package/test-projects/nestjs-backend/{ai → .ai-dev}/index-state.json +122 -87
- package/{ai → test-projects/nestjs-backend/.ai-dev}/index.db +0 -0
- package/test-projects/nestjs-backend/{ai → .ai-dev}/project.json +6 -2
- package/test-projects/nestjs-backend/{ai/repo-map.json → .ai-dev/repo_map.json} +106 -2
- 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 → .ai-dev}/summary.md +4 -2
- package/test-projects/nestjs-backend/.ai-dev/symbols.json +1 -0
- package/test-projects/nestjs-backend/{ai → .ai-dev}/tech_stack.md +2 -1
- 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/python-cli/{ai → .ai-dev}/ai_context.md +5 -4
- package/test-projects/python-cli/{ai → .ai-dev}/ai_rules.md +2 -2
- package/test-projects/python-cli/{ai → .ai-dev}/architecture.md +6 -0
- package/test-projects/python-cli/{ai → .ai-dev}/cache.json +53 -33
- package/test-projects/python-cli/.ai-dev/entrypoints.md +4 -0
- package/test-projects/python-cli/{ai → .ai-dev}/files.json +10 -0
- package/test-projects/python-cli/{ai → .ai-dev}/graph/knowledge-graph.json +1 -1
- package/test-projects/python-cli/{ai → .ai-dev}/index-state.json +97 -83
- package/test-projects/python-cli/{ai → .ai-dev}/index.db +0 -0
- package/test-projects/python-cli/{ai → .ai-dev}/project.json +1 -1
- package/test-projects/python-cli/{ai/repo-map.json → .ai-dev/repo_map.json} +79 -2
- 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 → .ai-dev}/summary.md +4 -1
- 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/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/{nestjs-backend/ai → 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/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 → .ai-dev}/ai_context.md +5 -4
- package/test-projects/react-app/{ai → .ai-dev}/ai_rules.md +2 -2
- package/test-projects/react-app/{ai → .ai-dev}/architecture.md +6 -0
- package/test-projects/react-app/{ai → .ai-dev}/cache.json +57 -33
- package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +14 -0
- package/test-projects/react-app/.ai-dev/entrypoints.md +4 -0
- package/test-projects/react-app/{ai → .ai-dev}/files.json +15 -0
- package/test-projects/react-app/{ai → .ai-dev}/graph/knowledge-graph.json +32 -3
- package/test-projects/react-app/{ai → .ai-dev}/index-state.json +105 -84
- package/test-projects/react-app/{ai → .ai-dev}/index.db +0 -0
- package/test-projects/react-app/{ai → .ai-dev}/project.json +2 -1
- package/test-projects/react-app/{ai/repo-map.json → .ai-dev/repo_map.json} +88 -2
- 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 → .ai-dev}/summary.md +4 -2
- package/test-projects/react-app/.ai-dev/symbols.json +1 -0
- package/test-projects/react-app/{ai → .ai-dev}/tech_stack.md +2 -1
- 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/{nestjs-backend/ai → react-app/ai-context}/conventions.md +2 -2
- 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/salesforce-cli/{ai → .ai-dev}/ai_context.md +5 -4
- package/test-projects/salesforce-cli/{ai → .ai-dev}/ai_rules.md +2 -2
- package/test-projects/salesforce-cli/{ai → .ai-dev}/architecture.md +6 -0
- package/test-projects/salesforce-cli/{ai → .ai-dev}/cache.json +52 -32
- 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 → .ai-dev}/files.json +10 -0
- package/test-projects/salesforce-cli/{ai → .ai-dev}/graph/knowledge-graph.json +1 -1
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +1 -0
- package/test-projects/salesforce-cli/{ai → .ai-dev}/index-state.json +90 -76
- package/test-projects/salesforce-cli/{ai → .ai-dev}/index.db +0 -0
- package/test-projects/salesforce-cli/{ai → .ai-dev}/project.json +1 -1
- package/test-projects/salesforce-cli/{ai/repo-map.json → .ai-dev/repo_map.json} +79 -2
- 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 → .ai-dev}/summary.md +4 -2
- package/test-projects/salesforce-cli/.ai-dev/symbols.json +1 -0
- package/test-projects/salesforce-cli/{ai → .ai-dev}/tech_stack.md +2 -1
- package/test-projects/salesforce-cli/.ai-dev/tools.json +10 -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/{express-api/ai → salesforce-cli/ai-context}/files.json +27 -42
- 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/{express-api/ai → 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/{python-cli/ai → salesforce-cli/ai-context}/tech_stack.md +3 -2
- package/test-projects/salesforce-cli/ai-context/tools.json +10 -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 +20 -20
- package/tests/phase2-fixes.test.ts +200 -0
- package/ANALISIS_MEJORAS.md +0 -327
- package/TEST_RESULTS.md +0 -198
- package/TEST_RESULTS_COMPARATIVE.md +0 -159
- package/TEST_RESULTS_COMPLETE.md +0 -127
- package/TEST_RESULTS_COMPREHENSIVE.md +0 -208
- package/ai/cache.json +0 -1109
- package/ai/context/features/test-projects.json +0 -56
- package/ai/context/flows/add_.json +0 -9
- package/ai/context/flows/auth..json +0 -10
- package/ai/context/flows/list_.json +0 -9
- package/ai/context/flows/remove_.json +0 -9
- package/ai/context/flows/user.json +0 -14
- package/ai/context/flows/users..json +0 -10
- package/ai/dependencies.json +0 -485
- package/ai/files.json +0 -2029
- package/ai/git/recent-features.json +0 -3
- package/ai/git/recent-flows.json +0 -3
- package/ai/graph/module-graph.json +0 -389
- package/ai/graph/symbol-graph.json +0 -85206
- package/ai/graph/symbol-references.json +0 -2707
- package/ai/hierarchy.json +0 -7
- package/ai/index-state.json +0 -1939
- package/ai/modules.json +0 -299
- package/ai/repo-map.json +0 -2867
- package/test-projects/express-api/ai/cache.json +0 -125
- package/test-projects/express-api/ai/graph/knowledge-graph.json +0 -98
- package/test-projects/express-api/ai/graph/module-graph.json +0 -44
- package/test-projects/express-api/ai/graph/symbol-graph.json +0 -882
- package/test-projects/express-api/ai/graph/symbol-references.json +0 -51
- package/test-projects/express-api/ai/index-state.json +0 -238
- package/test-projects/express-api/ai/symbols.json +0 -1174
- package/test-projects/nestjs-backend/ai/graph/knowledge-graph.json +0 -74
- package/test-projects/nestjs-backend/ai/repo_map.json +0 -141
- package/test-projects/nestjs-backend/ai/repo_map.md +0 -39
- package/test-projects/nestjs-backend/ai/symbols.json +0 -527
- package/test-projects/python-cli/ai/context/flows/add_.json +0 -9
- package/test-projects/python-cli/ai/repo_map.json +0 -99
- package/test-projects/python-cli/ai/repo_map.md +0 -32
- package/test-projects/python-cli/ai/symbols.json +0 -475
- package/test-projects/react-app/ai/repo_map.json +0 -114
- package/test-projects/react-app/ai/repo_map.md +0 -31
- package/test-projects/react-app/ai/schema.json +0 -5
- package/test-projects/react-app/ai/symbols.json +0 -985
- package/test-projects/salesforce-cli/ai/repo_map.json +0 -69
- package/test-projects/salesforce-cli/ai/repo_map.md +0 -21
- package/test-projects/salesforce-cli/ai/schema.json +0 -5
- package/test-projects/salesforce-cli/ai/symbols.json +0 -245
- /package/{ai → .ai-dev}/ccp/jira-123/context.json +0 -0
- /package/{ai → .ai-dev}/context/features/commands.json +0 -0
- /package/{ai → .ai-dev}/context/features/src.json +0 -0
- /package/{ai → .ai-dev}/context/flows/account.json +0 -0
- /package/{ai → .ai-dev}/context/flows/ai-first.json +0 -0
- /package/{ai → .ai-dev}/context/flows/dashboard.json +0 -0
- /package/{ai → .ai-dev}/context/flows/doctor.json +0 -0
- /package/{ai → .ai-dev}/context/flows/explore.json +0 -0
- /package/{ai → .ai-dev}/context/flows/login.json +0 -0
- /package/{ai → .ai-dev}/context/flows/opportunity.json +0 -0
- /package/{ai → .ai-dev}/context/flows/users.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}/conventions.md +0 -0
- /package/{ai → .ai-dev}/embeddings.json +0 -0
- /package/{ai → .ai-dev}/entrypoints.md +0 -0
- /package/{ai/symbols.json → .ai-dev/git/recent-features.json} +0 -0
- /package/{ai → .ai-dev}/tools.json +0 -0
- /package/{test-projects/express-api/ai → ai-context}/tools.json +0 -0
- /package/test-projects/{salesforce-cli/ai → django-app/.ai-dev}/conventions.md +0 -0
- /package/test-projects/{python-cli/ai → django-app/.ai-dev}/entrypoints.md +0 -0
- /package/test-projects/{salesforce-cli/ai → django-app/.ai-dev}/graph/symbol-references.json +0 -0
- /package/test-projects/{nestjs-backend/ai → django-app/.ai-dev}/tools.json +0 -0
- /package/test-projects/{react-app/ai → django-app/ai-context}/entrypoints.md +0 -0
- /package/test-projects/{python-cli/ai → django-app/ai-context}/tools.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/ai_context.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/ai_rules.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/architecture.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/context/features/controllers.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/context/features/services.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/context/flows/auth.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/context/flows/user.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/conventions.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/dependencies.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/entrypoints.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/modules.json +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/repo_map.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/summary.md +0 -0
- /package/test-projects/express-api/{ai → .ai-dev}/tech_stack.md +0 -0
- /package/test-projects/{react-app/ai → express-api/.ai-dev}/tools.json +0 -0
- /package/test-projects/{salesforce-cli/ai → express-api/ai-context}/tools.json +0 -0
- /package/test-projects/{salesforce-cli/ai → fastapi-app/.ai-dev}/entrypoints.md +0 -0
- /package/test-projects/{salesforce-cli/ai → laravel-app/.ai-dev}/dependencies.json +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/context/features/src.json +0 -0
- /package/test-projects/nestjs-backend/{ai/context/flows/auth..json → .ai-dev/context/flows/auth.json} +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/context/flows/users..json +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/dependencies.json +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/entrypoints.md +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/graph/module-graph.json +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/graph/symbol-graph.json +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/graph/symbol-references.json +0 -0
- /package/test-projects/nestjs-backend/{ai → .ai-dev}/modules.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/context/features/cli.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/context/flows/list_.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/context/flows/remove_.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/conventions.md +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/dependencies.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/graph/module-graph.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/graph/symbol-graph.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/graph/symbol-references.json +0 -0
- /package/test-projects/python-cli/{ai → .ai-dev}/modules.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/context/features/src.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/context/flows/dashboard.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/context/flows/login.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/context/flows/users.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/conventions.md +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/dependencies.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/graph/module-graph.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/graph/symbol-graph.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/graph/symbol-references.json +0 -0
- /package/test-projects/react-app/{ai → .ai-dev}/modules.json +0 -0
- /package/test-projects/salesforce-cli/{ai → .ai-dev}/context/features/force-app.json +0 -0
- /package/test-projects/salesforce-cli/{ai → .ai-dev}/context/flows/account.json +0 -0
- /package/test-projects/salesforce-cli/{ai → .ai-dev}/context/flows/opportunity.json +0 -0
- /package/test-projects/salesforce-cli/{ai → .ai-dev}/graph/module-graph.json +0 -0
- /package/test-projects/salesforce-cli/{ai → .ai-dev}/graph/symbol-graph.json +0 -0
- /package/test-projects/salesforce-cli/{ai → .ai-dev}/modules.json +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Technology Stack
|
|
2
|
+
|
|
3
|
+
**Languages**: Markdown, JSON, Python
|
|
4
|
+
|
|
5
|
+
## Languages
|
|
6
|
+
- Markdown
|
|
7
|
+
- JSON
|
|
8
|
+
- Python
|
|
9
|
+
|
|
10
|
+
## Frameworks
|
|
11
|
+
- None detected
|
|
12
|
+
|
|
13
|
+
## Key Libraries
|
|
14
|
+
- None detected
|
|
15
|
+
|
|
16
|
+
## Development Tools
|
|
17
|
+
- None detected
|
|
18
|
+
|
|
19
|
+
## Package Managers
|
|
20
|
+
- None detected
|
|
21
|
+
|
|
22
|
+
## Testing
|
|
23
|
+
- None detected
|
|
24
|
+
|
|
25
|
+
## Linters
|
|
26
|
+
- None detected
|
|
27
|
+
|
|
28
|
+
## Formatters
|
|
29
|
+
- None detected
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
*Generated by ai-first*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from sqlalchemy import create_engine
|
|
2
|
+
from sqlalchemy.ext.declarative import declarative_base
|
|
3
|
+
from sqlalchemy.orm import sessionmaker
|
|
4
|
+
|
|
5
|
+
SQLALCHEMY_DATABASE_URL = "sqlite:///./fastapi_app.db"
|
|
6
|
+
|
|
7
|
+
engine = create_engine(
|
|
8
|
+
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
|
9
|
+
)
|
|
10
|
+
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|
11
|
+
|
|
12
|
+
Base = declarative_base()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_db():
|
|
16
|
+
"""Dependency to get database session."""
|
|
17
|
+
db = SessionLocal()
|
|
18
|
+
try:
|
|
19
|
+
yield db
|
|
20
|
+
finally:
|
|
21
|
+
db.close()
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from datetime import datetime, timedelta
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from jose import JWTError, jwt
|
|
4
|
+
from passlib.context import CryptContext
|
|
5
|
+
from sqlalchemy.orm import Session
|
|
6
|
+
from fastapi import Depends, HTTPException, status
|
|
7
|
+
from fastapi.security import OAuth2PasswordBearer
|
|
8
|
+
from app import models, schemas
|
|
9
|
+
from app.database import get_db
|
|
10
|
+
|
|
11
|
+
# Security configuration
|
|
12
|
+
SECRET_KEY = "your-secret-key-here-change-in-production"
|
|
13
|
+
ALGORITHM = "HS256"
|
|
14
|
+
ACCESS_TOKEN_EXPIRE_MINUTES = 30
|
|
15
|
+
|
|
16
|
+
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
|
17
|
+
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="api/v1/auth/token")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def verify_password(plain_password: str, hashed_password: str) -> bool:
|
|
21
|
+
"""Verify a password against its hash."""
|
|
22
|
+
return pwd_context.verify(plain_password, hashed_password)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def get_password_hash(password: str) -> str:
|
|
26
|
+
"""Hash a password."""
|
|
27
|
+
return pwd_context.hash(password)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def get_user(db: Session, username: str) -> Optional[models.User]:
|
|
31
|
+
"""Get user by username."""
|
|
32
|
+
return db.query(models.User).filter(models.User.username == username).first()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_user_by_email(db: Session, email: str) -> Optional[models.User]:
|
|
36
|
+
"""Get user by email."""
|
|
37
|
+
return db.query(models.User).filter(models.User.email == email).first()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def authenticate_user(
|
|
41
|
+
db: Session, username: str, password: str
|
|
42
|
+
) -> Optional[models.User]:
|
|
43
|
+
"""Authenticate a user."""
|
|
44
|
+
user = get_user(db, username)
|
|
45
|
+
if not user:
|
|
46
|
+
return None
|
|
47
|
+
if not verify_password(password, user.hashed_password):
|
|
48
|
+
return None
|
|
49
|
+
return user
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -> str:
|
|
53
|
+
"""Create JWT access token."""
|
|
54
|
+
to_encode = data.copy()
|
|
55
|
+
if expires_delta:
|
|
56
|
+
expire = datetime.utcnow() + expires_delta
|
|
57
|
+
else:
|
|
58
|
+
expire = datetime.utcnow() + timedelta(minutes=15)
|
|
59
|
+
to_encode.update({"exp": expire})
|
|
60
|
+
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
|
|
61
|
+
return encoded_jwt
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
async def get_current_user(
|
|
65
|
+
token: str = Depends(oauth2_scheme), db: Session = Depends(get_db)
|
|
66
|
+
) -> models.User:
|
|
67
|
+
"""Get current authenticated user."""
|
|
68
|
+
credentials_exception = HTTPException(
|
|
69
|
+
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
70
|
+
detail="Could not validate credentials",
|
|
71
|
+
headers={"WWW-Authenticate": "Bearer"},
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
try:
|
|
75
|
+
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
|
|
76
|
+
username: str = payload.get("sub")
|
|
77
|
+
if username is None:
|
|
78
|
+
raise credentials_exception
|
|
79
|
+
token_data = schemas.TokenData(username=username)
|
|
80
|
+
except JWTError:
|
|
81
|
+
raise credentials_exception
|
|
82
|
+
|
|
83
|
+
user = get_user(db, username=token_data.username)
|
|
84
|
+
if user is None:
|
|
85
|
+
raise credentials_exception
|
|
86
|
+
|
|
87
|
+
return user
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
async def get_current_active_user(
|
|
91
|
+
current_user: models.User = Depends(get_current_user),
|
|
92
|
+
) -> models.User:
|
|
93
|
+
"""Get current active user."""
|
|
94
|
+
if not current_user.is_active:
|
|
95
|
+
raise HTTPException(status_code=400, detail="Inactive user")
|
|
96
|
+
return current_user
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
async def get_current_superuser(
|
|
100
|
+
current_user: models.User = Depends(get_current_active_user),
|
|
101
|
+
) -> models.User:
|
|
102
|
+
"""Get current superuser."""
|
|
103
|
+
if not current_user.is_superuser:
|
|
104
|
+
raise HTTPException(
|
|
105
|
+
status_code=status.HTTP_403_FORBIDDEN, detail="Not enough permissions"
|
|
106
|
+
)
|
|
107
|
+
return current_user
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from fastapi import FastAPI
|
|
2
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
3
|
+
from app.database import engine, Base
|
|
4
|
+
from app.routers import auth, posts
|
|
5
|
+
|
|
6
|
+
# Create database tables
|
|
7
|
+
Base.metadata.create_all(bind=engine)
|
|
8
|
+
|
|
9
|
+
# Create FastAPI app
|
|
10
|
+
app = FastAPI(
|
|
11
|
+
title="FastAPI Blog",
|
|
12
|
+
description="A modern blog API built with FastAPI",
|
|
13
|
+
version="1.0.0",
|
|
14
|
+
docs_url="/docs",
|
|
15
|
+
redoc_url="/redoc",
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Add CORS middleware
|
|
19
|
+
app.add_middleware(
|
|
20
|
+
CORSMiddleware,
|
|
21
|
+
allow_origins=["*"],
|
|
22
|
+
allow_credentials=True,
|
|
23
|
+
allow_methods=["*"],
|
|
24
|
+
allow_headers=["*"],
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# Include routers
|
|
28
|
+
app.include_router(auth.router, prefix="/api/v1")
|
|
29
|
+
app.include_router(posts.router, prefix="/api/v1")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@app.get("/")
|
|
33
|
+
def read_root():
|
|
34
|
+
"""Root endpoint."""
|
|
35
|
+
return {"message": "Welcome to FastAPI Blog", "docs": "/docs", "version": "1.0.0"}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@app.get("/health")
|
|
39
|
+
def health_check():
|
|
40
|
+
"""Health check endpoint."""
|
|
41
|
+
return {"status": "healthy"}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
import uvicorn
|
|
46
|
+
|
|
47
|
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
from sqlalchemy import (
|
|
2
|
+
Column,
|
|
3
|
+
Integer,
|
|
4
|
+
String,
|
|
5
|
+
Boolean,
|
|
6
|
+
DateTime,
|
|
7
|
+
ForeignKey,
|
|
8
|
+
Text,
|
|
9
|
+
Table,
|
|
10
|
+
)
|
|
11
|
+
from sqlalchemy.orm import relationship
|
|
12
|
+
from sqlalchemy.sql import func
|
|
13
|
+
from app.database import Base
|
|
14
|
+
|
|
15
|
+
# Association table for many-to-many relationship
|
|
16
|
+
post_tags = Table(
|
|
17
|
+
"post_tags",
|
|
18
|
+
Base.metadata,
|
|
19
|
+
Column("post_id", Integer, ForeignKey("posts.id")),
|
|
20
|
+
Column("tag_id", Integer, ForeignKey("tags.id")),
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class User(Base):
|
|
25
|
+
"""User model for authentication and posts."""
|
|
26
|
+
|
|
27
|
+
__tablename__ = "users"
|
|
28
|
+
|
|
29
|
+
id = Column(Integer, primary_key=True, index=True)
|
|
30
|
+
email = Column(String, unique=True, index=True, nullable=False)
|
|
31
|
+
username = Column(String, unique=True, index=True, nullable=False)
|
|
32
|
+
hashed_password = Column(String, nullable=False)
|
|
33
|
+
full_name = Column(String)
|
|
34
|
+
bio = Column(Text)
|
|
35
|
+
is_active = Column(Boolean, default=True)
|
|
36
|
+
is_superuser = Column(Boolean, default=False)
|
|
37
|
+
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
38
|
+
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
|
39
|
+
|
|
40
|
+
# Relationships
|
|
41
|
+
posts = relationship("Post", back_populates="author", cascade="all, delete-orphan")
|
|
42
|
+
comments = relationship(
|
|
43
|
+
"Comment", back_populates="author", cascade="all, delete-orphan"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def __repr__(self):
|
|
47
|
+
return f"<User(username='{self.username}', email='{self.email}')>"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class Post(Base):
|
|
51
|
+
"""Blog post model."""
|
|
52
|
+
|
|
53
|
+
__tablename__ = "posts"
|
|
54
|
+
|
|
55
|
+
id = Column(Integer, primary_key=True, index=True)
|
|
56
|
+
title = Column(String(255), nullable=False)
|
|
57
|
+
slug = Column(String(255), unique=True, index=True, nullable=False)
|
|
58
|
+
content = Column(Text, nullable=False)
|
|
59
|
+
summary = Column(String(500))
|
|
60
|
+
is_published = Column(Boolean, default=False)
|
|
61
|
+
published_at = Column(DateTime(timezone=True))
|
|
62
|
+
view_count = Column(Integer, default=0)
|
|
63
|
+
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
64
|
+
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
|
65
|
+
author_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
|
66
|
+
|
|
67
|
+
# Relationships
|
|
68
|
+
author = relationship("User", back_populates="posts")
|
|
69
|
+
comments = relationship(
|
|
70
|
+
"Comment", back_populates="post", cascade="all, delete-orphan"
|
|
71
|
+
)
|
|
72
|
+
tags = relationship("Tag", secondary=post_tags, back_populates="posts")
|
|
73
|
+
category_id = Column(Integer, ForeignKey("categories.id"))
|
|
74
|
+
category = relationship("Category", back_populates="posts")
|
|
75
|
+
|
|
76
|
+
def __repr__(self):
|
|
77
|
+
return f"<Post(title='{self.title}', slug='{self.slug}')>"
|
|
78
|
+
|
|
79
|
+
def publish(self):
|
|
80
|
+
"""Publish the post."""
|
|
81
|
+
from datetime import datetime
|
|
82
|
+
|
|
83
|
+
self.is_published = True
|
|
84
|
+
self.published_at = datetime.utcnow()
|
|
85
|
+
|
|
86
|
+
def unpublish(self):
|
|
87
|
+
"""Unpublish the post."""
|
|
88
|
+
self.is_published = False
|
|
89
|
+
self.published_at = None
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class Comment(Base):
|
|
93
|
+
"""Comment model for blog posts."""
|
|
94
|
+
|
|
95
|
+
__tablename__ = "comments"
|
|
96
|
+
|
|
97
|
+
id = Column(Integer, primary_key=True, index=True)
|
|
98
|
+
content = Column(Text, nullable=False)
|
|
99
|
+
is_approved = Column(Boolean, default=False)
|
|
100
|
+
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
101
|
+
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
|
102
|
+
|
|
103
|
+
# Foreign keys
|
|
104
|
+
post_id = Column(Integer, ForeignKey("posts.id"), nullable=False)
|
|
105
|
+
author_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
|
106
|
+
parent_id = Column(Integer, ForeignKey("comments.id"), nullable=True)
|
|
107
|
+
|
|
108
|
+
# Relationships
|
|
109
|
+
post = relationship("Post", back_populates="comments")
|
|
110
|
+
author = relationship("User", back_populates="comments")
|
|
111
|
+
replies = relationship("Comment", backref="parent", remote_side=[id])
|
|
112
|
+
|
|
113
|
+
def __repr__(self):
|
|
114
|
+
return f"<Comment(id={self.id}, post_id={self.post_id})>"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class Category(Base):
|
|
118
|
+
"""Category model for organizing posts."""
|
|
119
|
+
|
|
120
|
+
__tablename__ = "categories"
|
|
121
|
+
|
|
122
|
+
id = Column(Integer, primary_key=True, index=True)
|
|
123
|
+
name = Column(String(100), unique=True, nullable=False)
|
|
124
|
+
slug = Column(String(100), unique=True, index=True, nullable=False)
|
|
125
|
+
description = Column(Text)
|
|
126
|
+
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
127
|
+
|
|
128
|
+
# Relationships
|
|
129
|
+
posts = relationship("Post", back_populates="category")
|
|
130
|
+
|
|
131
|
+
def __repr__(self):
|
|
132
|
+
return f"<Category(name='{self.name}')>"
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class Tag(Base):
|
|
136
|
+
"""Tag model for posts."""
|
|
137
|
+
|
|
138
|
+
__tablename__ = "tags"
|
|
139
|
+
|
|
140
|
+
id = Column(Integer, primary_key=True, index=True)
|
|
141
|
+
name = Column(String(50), unique=True, nullable=False)
|
|
142
|
+
slug = Column(String(50), unique=True, index=True, nullable=False)
|
|
143
|
+
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
144
|
+
|
|
145
|
+
# Relationships
|
|
146
|
+
posts = relationship("Post", secondary=post_tags, back_populates="tags")
|
|
147
|
+
|
|
148
|
+
def __repr__(self):
|
|
149
|
+
return f"<Tag(name='{self.name}')>"
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
from datetime import timedelta
|
|
2
|
+
from typing import List
|
|
3
|
+
from fastapi import APIRouter, Depends, HTTPException, status
|
|
4
|
+
from sqlalchemy.orm import Session
|
|
5
|
+
from app import models, schemas
|
|
6
|
+
from app.database import get_db
|
|
7
|
+
from app.dependencies import (
|
|
8
|
+
authenticate_user,
|
|
9
|
+
create_access_token,
|
|
10
|
+
get_current_active_user,
|
|
11
|
+
get_password_hash,
|
|
12
|
+
ACCESS_TOKEN_EXPIRE_MINUTES,
|
|
13
|
+
get_user,
|
|
14
|
+
get_user_by_email,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
router = APIRouter(prefix="/auth", tags=["authentication"])
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@router.post(
|
|
21
|
+
"/register", response_model=schemas.User, status_code=status.HTTP_201_CREATED
|
|
22
|
+
)
|
|
23
|
+
def register(user: schemas.UserCreate, db: Session = Depends(get_db)):
|
|
24
|
+
"""Register a new user."""
|
|
25
|
+
# Check if username exists
|
|
26
|
+
db_user = get_user(db, username=user.username)
|
|
27
|
+
if db_user:
|
|
28
|
+
raise HTTPException(
|
|
29
|
+
status_code=status.HTTP_400_BAD_REQUEST,
|
|
30
|
+
detail="Username already registered",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Check if email exists
|
|
34
|
+
db_user = get_user_by_email(db, email=user.email)
|
|
35
|
+
if db_user:
|
|
36
|
+
raise HTTPException(
|
|
37
|
+
status_code=status.HTTP_400_BAD_REQUEST, detail="Email already registered"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Create new user
|
|
41
|
+
hashed_password = get_password_hash(user.password)
|
|
42
|
+
db_user = models.User(
|
|
43
|
+
email=user.email,
|
|
44
|
+
username=user.username,
|
|
45
|
+
hashed_password=hashed_password,
|
|
46
|
+
full_name=user.full_name,
|
|
47
|
+
bio=user.bio,
|
|
48
|
+
)
|
|
49
|
+
db.add(db_user)
|
|
50
|
+
db.commit()
|
|
51
|
+
db.refresh(db_user)
|
|
52
|
+
|
|
53
|
+
return db_user
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@router.post("/token", response_model=schemas.Token)
|
|
57
|
+
def login(form_data: schemas.LoginRequest, db: Session = Depends(get_db)):
|
|
58
|
+
"""Login and get access token."""
|
|
59
|
+
user = authenticate_user(db, form_data.username, form_data.password)
|
|
60
|
+
if not user:
|
|
61
|
+
raise HTTPException(
|
|
62
|
+
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
63
|
+
detail="Incorrect username or password",
|
|
64
|
+
headers={"WWW-Authenticate": "Bearer"},
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
|
|
68
|
+
access_token = create_access_token(
|
|
69
|
+
data={"sub": user.username}, expires_delta=access_token_expires
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
return {"access_token": access_token, "token_type": "bearer"}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@router.get("/me", response_model=schemas.User)
|
|
76
|
+
def read_users_me(current_user: models.User = Depends(get_current_active_user)):
|
|
77
|
+
"""Get current user information."""
|
|
78
|
+
return current_user
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@router.put("/me", response_model=schemas.User)
|
|
82
|
+
def update_user_me(
|
|
83
|
+
user_update: schemas.UserUpdate,
|
|
84
|
+
current_user: models.User = Depends(get_current_active_user),
|
|
85
|
+
db: Session = Depends(get_db),
|
|
86
|
+
):
|
|
87
|
+
"""Update current user."""
|
|
88
|
+
update_data = user_update.model_dump(exclude_unset=True)
|
|
89
|
+
|
|
90
|
+
for field, value in update_data.items():
|
|
91
|
+
setattr(current_user, field, value)
|
|
92
|
+
|
|
93
|
+
db.commit()
|
|
94
|
+
db.refresh(current_user)
|
|
95
|
+
|
|
96
|
+
return current_user
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@router.post("/change-password")
|
|
100
|
+
def change_password(
|
|
101
|
+
old_password: str,
|
|
102
|
+
new_password: str,
|
|
103
|
+
current_user: models.User = Depends(get_current_active_user),
|
|
104
|
+
db: Session = Depends(get_db),
|
|
105
|
+
):
|
|
106
|
+
"""Change user password."""
|
|
107
|
+
from app.dependencies import verify_password, get_password_hash
|
|
108
|
+
|
|
109
|
+
if not verify_password(old_password, current_user.hashed_password):
|
|
110
|
+
raise HTTPException(
|
|
111
|
+
status_code=status.HTTP_400_BAD_REQUEST, detail="Incorrect password"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
current_user.hashed_password = get_password_hash(new_password)
|
|
115
|
+
db.commit()
|
|
116
|
+
|
|
117
|
+
return {"message": "Password updated successfully"}
|