ai-first-cli 1.3.1 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai-dev/index.db +0 -0
- package/CHANGELOG.md +241 -0
- package/PHASE1_USER_SIMULATION.md +56 -0
- package/PHASE2_USER_SIMULATION.md +81 -0
- package/PHASE3_USER_SIMULATION.md +176 -0
- package/README.es.md +73 -0
- package/README.md +119 -15
- package/ai/graph/knowledge-graph.json +10 -0
- package/ai-context/ai_context.md +130 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/ai_rules.md +10 -5
- package/ai-context/architecture.md +136 -0
- package/ai-context/context/features/src.json +69 -0
- package/ai-context/context/features/test-projects.json +69 -0
- package/ai-context/context/flows/ai-first.json +9 -0
- package/ai-context/context/flows/auth.json +13 -0
- package/ai-context/context/flows/doctor.json +9 -0
- package/ai-context/context/flows/explore.json +9 -0
- package/ai-context/context/flows/routes.json +15 -0
- package/ai-context/context/flows/user.json +23 -0
- package/ai-context/context/flows/views.json +12 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/conventions.md +3 -2
- package/ai-context/dependencies.json +3360 -0
- package/ai-context/entrypoints.md +45 -0
- package/ai-context/index-state.json +196 -0
- package/ai-context/modules.json +901 -0
- package/ai-context/project.json +33 -0
- package/ai-context/repo_map.json +8857 -0
- package/ai-context/repo_map.md +2002 -0
- package/{test-projects/flask-app/.ai-dev → ai-context}/schema.json +1 -1
- package/ai-context/summary.md +46 -0
- package/ai-context/symbols.json +82467 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/tech_stack.md +15 -7
- package/ai-context-evaluation-report-1774223059505.md +206 -0
- package/dist/analyzers/architecture.d.ts.map +1 -1
- package/dist/analyzers/architecture.js +78 -5
- package/dist/analyzers/architecture.js.map +1 -1
- package/dist/analyzers/entrypoints.d.ts.map +1 -1
- package/dist/analyzers/entrypoints.js +358 -0
- package/dist/analyzers/entrypoints.js.map +1 -1
- package/dist/analyzers/symbols.d.ts.map +1 -1
- package/dist/analyzers/symbols.js +119 -3
- package/dist/analyzers/symbols.js.map +1 -1
- package/dist/analyzers/techStack.d.ts +8 -0
- package/dist/analyzers/techStack.d.ts.map +1 -1
- package/dist/analyzers/techStack.js +118 -0
- package/dist/analyzers/techStack.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/package.json +1 -1
- package/scripts/ai-context-evaluator.ts +440 -0
- package/src/analyzers/architecture.ts +83 -6
- package/src/analyzers/entrypoints.ts +400 -0
- package/src/analyzers/symbols.ts +129 -3
- package/src/analyzers/techStack.ts +137 -0
- package/src/utils/fileUtils.ts +5 -0
- package/tests/apex-parser.test.ts +193 -0
- package/tests/cli-commands-batch1.test.ts +808 -0
- package/tests/cli-commands-batch2.test.ts +1113 -0
- package/tests/cli-commands-batch3.test.ts +1128 -0
- package/tests/cli-index.test.ts +1007 -0
- package/tests/cli-init.test.ts +761 -0
- package/tests/entrypoints-languages.test.ts +373 -0
- package/tests/framework-detection.test.ts +296 -0
- package/tests/salesforce-apex-classes.test.ts +713 -0
- package/tests/salesforce-apex-triggers.test.ts +871 -0
- package/tests/salesforce-custom-objects.test.ts +918 -0
- package/tests/salesforce-flows.test.ts +710 -0
- package/tests/salesforce-lwc.test.ts +963 -0
- package/tests/salesforce-sfdx-integration.test.ts +1125 -0
- package/ANALISIS_COMPLETO.md +0 -424
- package/ANALISIS_MEJORAS.md +0 -327
- package/CONTRIBUTING.md +0 -89
- package/FLOW.md +0 -129
- 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/install.sh +0 -188
- package/run-all-tests.sh +0 -184
- package/test-ai-context-understanding.sh +0 -21
- package/test-projects/django-app/.ai-dev/ai_context.md +0 -92
- package/test-projects/django-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/django-app/.ai-dev/architecture.md +0 -57
- package/test-projects/django-app/.ai-dev/cache.json +0 -169
- package/test-projects/django-app/.ai-dev/context/flows/views.json +0 -10
- package/test-projects/django-app/.ai-dev/conventions.md +0 -51
- package/test-projects/django-app/.ai-dev/dependencies.json +0 -312
- package/test-projects/django-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/django-app/.ai-dev/files.json +0 -209
- package/test-projects/django-app/.ai-dev/graph/knowledge-graph.json +0 -36
- package/test-projects/django-app/.ai-dev/graph/module-graph.json +0 -145
- package/test-projects/django-app/.ai-dev/graph/symbol-graph.json +0 -1488
- package/test-projects/django-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/django-app/.ai-dev/index-state.json +0 -294
- package/test-projects/django-app/.ai-dev/modules.json +0 -35
- package/test-projects/django-app/.ai-dev/project.json +0 -11
- package/test-projects/django-app/.ai-dev/repo_map.json +0 -412
- package/test-projects/django-app/.ai-dev/repo_map.md +0 -105
- package/test-projects/django-app/.ai-dev/schema.json +0 -5
- package/test-projects/django-app/.ai-dev/summary.md +0 -15
- package/test-projects/django-app/.ai-dev/symbols.json +0 -1
- package/test-projects/django-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/django-app/README.md +0 -91
- package/test-projects/django-app/blog/__init__.py +0 -0
- package/test-projects/django-app/blog/admin.py +0 -31
- package/test-projects/django-app/blog/models.py +0 -55
- package/test-projects/django-app/blog/serializers.py +0 -69
- package/test-projects/django-app/blog/urls.py +0 -14
- package/test-projects/django-app/blog/views.py +0 -96
- package/test-projects/django-app/django_app/__init__.py +0 -0
- package/test-projects/django-app/django_app/settings.py +0 -90
- package/test-projects/django-app/django_app/urls.py +0 -11
- package/test-projects/django-app/django_app/wsgi.py +0 -9
- package/test-projects/django-app/manage.py +0 -23
- package/test-projects/django-app/requirements.txt +0 -3
- package/test-projects/django-app/users/__init__.py +0 -0
- package/test-projects/django-app/users/admin.py +0 -42
- package/test-projects/django-app/users/models.py +0 -54
- package/test-projects/django-app/users/serializers.py +0 -113
- package/test-projects/django-app/users/urls.py +0 -13
- package/test-projects/django-app/users/views.py +0 -135
- package/test-projects/express-api/.ai-dev/ai_context.md +0 -112
- package/test-projects/express-api/.ai-dev/ai_rules.md +0 -50
- package/test-projects/express-api/.ai-dev/architecture.md +0 -62
- package/test-projects/express-api/.ai-dev/context/features/controllers.json +0 -13
- package/test-projects/express-api/.ai-dev/context/features/services.json +0 -13
- package/test-projects/express-api/.ai-dev/context/flows/auth.json +0 -12
- package/test-projects/express-api/.ai-dev/context/flows/user.json +0 -13
- package/test-projects/express-api/.ai-dev/conventions.md +0 -51
- package/test-projects/express-api/.ai-dev/dependencies.json +0 -54
- package/test-projects/express-api/.ai-dev/entrypoints.md +0 -17
- package/test-projects/express-api/.ai-dev/modules.json +0 -30
- package/test-projects/express-api/.ai-dev/project.json +0 -15
- package/test-projects/express-api/.ai-dev/repo_map.json +0 -100
- package/test-projects/express-api/.ai-dev/repo_map.md +0 -36
- package/test-projects/express-api/.ai-dev/schema.json +0 -5
- package/test-projects/express-api/.ai-dev/summary.md +0 -14
- package/test-projects/express-api/.ai-dev/symbols.json +0 -7
- package/test-projects/express-api/.ai-dev/tech_stack.md +0 -38
- package/test-projects/express-api/.ai-dev/tools.json +0 -10
- package/test-projects/express-api/controllers/authController.js +0 -32
- package/test-projects/express-api/controllers/userController.js +0 -51
- package/test-projects/express-api/index.js +0 -30
- package/test-projects/express-api/middleware/authMiddleware.js +0 -30
- package/test-projects/express-api/models/userRepository.js +0 -25
- package/test-projects/express-api/package.json +0 -18
- package/test-projects/express-api/services/authService.js +0 -17
- package/test-projects/express-api/services/userService.js +0 -28
- package/test-projects/fastapi-app/.ai-dev/ai_context.md +0 -89
- package/test-projects/fastapi-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/fastapi-app/.ai-dev/architecture.md +0 -39
- package/test-projects/fastapi-app/.ai-dev/cache.json +0 -125
- package/test-projects/fastapi-app/.ai-dev/conventions.md +0 -51
- package/test-projects/fastapi-app/.ai-dev/dependencies.json +0 -244
- package/test-projects/fastapi-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/fastapi-app/.ai-dev/files.json +0 -154
- package/test-projects/fastapi-app/.ai-dev/graph/knowledge-graph.json +0 -15
- package/test-projects/fastapi-app/.ai-dev/graph/module-graph.json +0 -78
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-graph.json +0 -1724
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-references.json +0 -51
- package/test-projects/fastapi-app/.ai-dev/index-state.json +0 -217
- package/test-projects/fastapi-app/.ai-dev/modules.json +0 -16
- package/test-projects/fastapi-app/.ai-dev/project.json +0 -9
- package/test-projects/fastapi-app/.ai-dev/repo_map.json +0 -298
- package/test-projects/fastapi-app/.ai-dev/repo_map.md +0 -74
- package/test-projects/fastapi-app/.ai-dev/schema.json +0 -5
- package/test-projects/fastapi-app/.ai-dev/summary.md +0 -12
- package/test-projects/fastapi-app/.ai-dev/symbols.json +0 -1
- package/test-projects/fastapi-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/fastapi-app/.ai-dev/tools.json +0 -10
- package/test-projects/fastapi-app/README.md +0 -118
- package/test-projects/fastapi-app/app/database.py +0 -21
- package/test-projects/fastapi-app/app/dependencies.py +0 -107
- package/test-projects/fastapi-app/app/main.py +0 -47
- package/test-projects/fastapi-app/app/models.py +0 -149
- package/test-projects/fastapi-app/app/routers/auth.py +0 -117
- package/test-projects/fastapi-app/app/routers/posts.py +0 -272
- package/test-projects/fastapi-app/app/schemas.py +0 -191
- package/test-projects/fastapi-app/requirements.txt +0 -10
- package/test-projects/flask-app/.ai-dev/ai_context.md +0 -94
- package/test-projects/flask-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/flask-app/.ai-dev/architecture.md +0 -49
- package/test-projects/flask-app/.ai-dev/cache.json +0 -157
- package/test-projects/flask-app/.ai-dev/context/features/app.json +0 -25
- package/test-projects/flask-app/.ai-dev/context/flows/routes.json +0 -14
- package/test-projects/flask-app/.ai-dev/conventions.md +0 -51
- package/test-projects/flask-app/.ai-dev/dependencies.json +0 -298
- package/test-projects/flask-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/flask-app/.ai-dev/files.json +0 -194
- package/test-projects/flask-app/.ai-dev/graph/knowledge-graph.json +0 -60
- package/test-projects/flask-app/.ai-dev/graph/module-graph.json +0 -95
- package/test-projects/flask-app/.ai-dev/graph/symbol-graph.json +0 -1448
- package/test-projects/flask-app/.ai-dev/graph/symbol-references.json +0 -45
- package/test-projects/flask-app/.ai-dev/index-state.json +0 -273
- package/test-projects/flask-app/.ai-dev/modules.json +0 -21
- package/test-projects/flask-app/.ai-dev/project.json +0 -13
- package/test-projects/flask-app/.ai-dev/repo_map.json +0 -400
- package/test-projects/flask-app/.ai-dev/repo_map.md +0 -98
- package/test-projects/flask-app/.ai-dev/summary.md +0 -13
- package/test-projects/flask-app/.ai-dev/symbols.json +0 -1
- package/test-projects/flask-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/flask-app/.ai-dev/tools.json +0 -10
- package/test-projects/flask-app/README.md +0 -129
- package/test-projects/flask-app/app/__init__.py +0 -46
- package/test-projects/flask-app/app/api/__init__.py +0 -7
- package/test-projects/flask-app/app/api/routes.py +0 -122
- package/test-projects/flask-app/app/auth/__init__.py +0 -7
- package/test-projects/flask-app/app/auth/forms.py +0 -52
- package/test-projects/flask-app/app/auth/routes.py +0 -68
- package/test-projects/flask-app/app/blog/__init__.py +0 -7
- package/test-projects/flask-app/app/blog/forms.py +0 -35
- package/test-projects/flask-app/app/blog/routes.py +0 -140
- package/test-projects/flask-app/app/main/__init__.py +0 -7
- package/test-projects/flask-app/app/main/routes.py +0 -88
- package/test-projects/flask-app/app/models.py +0 -177
- package/test-projects/flask-app/config.py +0 -64
- package/test-projects/flask-app/requirements.txt +0 -10
- package/test-projects/laravel-app/.ai-dev/ai_context.md +0 -97
- package/test-projects/laravel-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/laravel-app/.ai-dev/architecture.md +0 -60
- package/test-projects/laravel-app/.ai-dev/cache.json +0 -161
- package/test-projects/laravel-app/.ai-dev/context/features/app.json +0 -21
- package/test-projects/laravel-app/.ai-dev/context/flows/.json +0 -9
- package/test-projects/laravel-app/.ai-dev/context/flows/category.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/comment.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/post.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/unnamed.json +0 -9
- package/test-projects/laravel-app/.ai-dev/conventions.md +0 -51
- package/test-projects/laravel-app/.ai-dev/dependencies.json +0 -6
- package/test-projects/laravel-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/laravel-app/.ai-dev/files.json +0 -199
- package/test-projects/laravel-app/.ai-dev/graph/knowledge-graph.json +0 -98
- package/test-projects/laravel-app/.ai-dev/graph/module-graph.json +0 -30
- package/test-projects/laravel-app/.ai-dev/graph/symbol-graph.json +0 -5
- package/test-projects/laravel-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/laravel-app/.ai-dev/index-state.json +0 -280
- package/test-projects/laravel-app/.ai-dev/modules.json +0 -29
- package/test-projects/laravel-app/.ai-dev/project.json +0 -17
- package/test-projects/laravel-app/.ai-dev/repo_map.json +0 -419
- package/test-projects/laravel-app/.ai-dev/repo_map.md +0 -106
- package/test-projects/laravel-app/.ai-dev/schema.json +0 -5
- package/test-projects/laravel-app/.ai-dev/summary.md +0 -15
- package/test-projects/laravel-app/.ai-dev/symbols.json +0 -1
- package/test-projects/laravel-app/.ai-dev/tech_stack.md +0 -34
- package/test-projects/laravel-app/.ai-dev/tools.json +0 -10
- package/test-projects/laravel-app/README.md +0 -107
- package/test-projects/laravel-app/app/Http/Controllers/Api/CategoryController.php +0 -88
- package/test-projects/laravel-app/app/Http/Controllers/Api/CommentController.php +0 -56
- package/test-projects/laravel-app/app/Http/Controllers/Api/PostController.php +0 -174
- package/test-projects/laravel-app/app/Http/Controllers/Controller.php +0 -12
- package/test-projects/laravel-app/app/Models/Category.php +0 -34
- package/test-projects/laravel-app/app/Models/Comment.php +0 -51
- package/test-projects/laravel-app/app/Models/Post.php +0 -108
- package/test-projects/laravel-app/app/Models/User.php +0 -85
- package/test-projects/laravel-app/bootstrap/app.php +0 -25
- package/test-projects/laravel-app/composer.json +0 -35
- package/test-projects/laravel-app/routes/api.php +0 -40
- package/test-projects/nestjs-backend/.ai-dev/ai_context.md +0 -111
- package/test-projects/nestjs-backend/.ai-dev/ai_rules.md +0 -52
- package/test-projects/nestjs-backend/.ai-dev/architecture.md +0 -49
- package/test-projects/nestjs-backend/.ai-dev/cache.json +0 -169
- package/test-projects/nestjs-backend/.ai-dev/context/features/src.json +0 -23
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +0 -14
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users..json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.controller.json +0 -14
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/conventions.md +0 -52
- package/test-projects/nestjs-backend/.ai-dev/dependencies.json +0 -152
- package/test-projects/nestjs-backend/.ai-dev/entrypoints.md +0 -18
- package/test-projects/nestjs-backend/.ai-dev/files.json +0 -209
- package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +0 -132
- package/test-projects/nestjs-backend/.ai-dev/graph/module-graph.json +0 -29
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-graph.json +0 -304
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-references.json +0 -5
- package/test-projects/nestjs-backend/.ai-dev/index-state.json +0 -294
- package/test-projects/nestjs-backend/.ai-dev/modules.json +0 -19
- package/test-projects/nestjs-backend/.ai-dev/project.json +0 -18
- package/test-projects/nestjs-backend/.ai-dev/repo_map.json +0 -427
- package/test-projects/nestjs-backend/.ai-dev/repo_map.md +0 -104
- package/test-projects/nestjs-backend/.ai-dev/schema.json +0 -5
- package/test-projects/nestjs-backend/.ai-dev/summary.md +0 -13
- package/test-projects/nestjs-backend/.ai-dev/symbols.json +0 -1
- package/test-projects/nestjs-backend/.ai-dev/tech_stack.md +0 -38
- package/test-projects/nestjs-backend/.ai-dev/tools.json +0 -10
- package/test-projects/nestjs-backend/package.json +0 -22
- package/test-projects/nestjs-backend/src/app.module.ts +0 -8
- package/test-projects/nestjs-backend/src/auth/auth.controller.ts +0 -22
- package/test-projects/nestjs-backend/src/auth/auth.module.ts +0 -11
- package/test-projects/nestjs-backend/src/auth/auth.service.ts +0 -28
- package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +0 -4
- package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +0 -18
- package/test-projects/nestjs-backend/src/main.ts +0 -9
- package/test-projects/nestjs-backend/src/users/users.controller.ts +0 -32
- package/test-projects/nestjs-backend/src/users/users.module.ts +0 -10
- package/test-projects/nestjs-backend/src/users/users.service.ts +0 -42
- package/test-projects/nestjs-backend/tsconfig.json +0 -21
- package/test-projects/python-cli/.ai-dev/ai_context.md +0 -95
- package/test-projects/python-cli/.ai-dev/ai_rules.md +0 -47
- package/test-projects/python-cli/.ai-dev/architecture.md +0 -55
- package/test-projects/python-cli/.ai-dev/cache.json +0 -149
- package/test-projects/python-cli/.ai-dev/context/features/cli.json +0 -16
- package/test-projects/python-cli/.ai-dev/context/flows/list_.json +0 -9
- package/test-projects/python-cli/.ai-dev/context/flows/remove_.json +0 -9
- package/test-projects/python-cli/.ai-dev/conventions.md +0 -51
- package/test-projects/python-cli/.ai-dev/dependencies.json +0 -66
- package/test-projects/python-cli/.ai-dev/entrypoints.md +0 -4
- package/test-projects/python-cli/.ai-dev/files.json +0 -184
- package/test-projects/python-cli/.ai-dev/graph/knowledge-graph.json +0 -83
- package/test-projects/python-cli/.ai-dev/graph/module-graph.json +0 -31
- package/test-projects/python-cli/.ai-dev/graph/symbol-graph.json +0 -358
- package/test-projects/python-cli/.ai-dev/graph/symbol-references.json +0 -11
- package/test-projects/python-cli/.ai-dev/index-state.json +0 -259
- package/test-projects/python-cli/.ai-dev/modules.json +0 -21
- package/test-projects/python-cli/.ai-dev/project.json +0 -15
- package/test-projects/python-cli/.ai-dev/repo_map.json +0 -367
- package/test-projects/python-cli/.ai-dev/repo_map.md +0 -93
- package/test-projects/python-cli/.ai-dev/schema.json +0 -5
- package/test-projects/python-cli/.ai-dev/summary.md +0 -14
- package/test-projects/python-cli/.ai-dev/symbols.json +0 -1
- package/test-projects/python-cli/.ai-dev/tech_stack.md +0 -32
- package/test-projects/python-cli/.ai-dev/tools.json +0 -10
- package/test-projects/python-cli/__init__.py +0 -1
- package/test-projects/python-cli/cli/__init__.py +0 -1
- package/test-projects/python-cli/cli/add_command.py +0 -6
- package/test-projects/python-cli/cli/list_command.py +0 -7
- package/test-projects/python-cli/cli/remove_command.py +0 -6
- package/test-projects/python-cli/main.py +0 -34
- package/test-projects/python-cli/models/__init__.py +0 -2
- package/test-projects/python-cli/models/task.py +0 -19
- package/test-projects/python-cli/models/task_repository.py +0 -44
- package/test-projects/rails-app/.ai-dev/ai_context.md +0 -94
- package/test-projects/rails-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/rails-app/.ai-dev/architecture.md +0 -49
- package/test-projects/rails-app/.ai-dev/cache.json +0 -193
- package/test-projects/rails-app/.ai-dev/context/features/app.json +0 -24
- package/test-projects/rails-app/.ai-dev/context/features/config.json +0 -13
- package/test-projects/rails-app/.ai-dev/context/flows/application.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/application_.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/comments.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/comments_.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/posts.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/posts_.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/routes.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/users.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/users_.json +0 -11
- package/test-projects/rails-app/.ai-dev/conventions.md +0 -51
- package/test-projects/rails-app/.ai-dev/dependencies.json +0 -6
- package/test-projects/rails-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/rails-app/.ai-dev/files.json +0 -239
- package/test-projects/rails-app/.ai-dev/graph/knowledge-graph.json +0 -130
- package/test-projects/rails-app/.ai-dev/graph/module-graph.json +0 -27
- package/test-projects/rails-app/.ai-dev/graph/symbol-graph.json +0 -5
- package/test-projects/rails-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/rails-app/.ai-dev/index-state.json +0 -336
- package/test-projects/rails-app/.ai-dev/modules.json +0 -26
- package/test-projects/rails-app/.ai-dev/project.json +0 -22
- package/test-projects/rails-app/.ai-dev/repo_map.json +0 -486
- package/test-projects/rails-app/.ai-dev/repo_map.md +0 -117
- package/test-projects/rails-app/.ai-dev/schema.json +0 -5
- package/test-projects/rails-app/.ai-dev/summary.md +0 -13
- package/test-projects/rails-app/.ai-dev/symbols.json +0 -1
- package/test-projects/rails-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/rails-app/.ai-dev/tools.json +0 -10
- package/test-projects/rails-app/Gemfile +0 -38
- package/test-projects/rails-app/README.md +0 -140
- package/test-projects/rails-app/Rakefile +0 -8
- package/test-projects/rails-app/app/controllers/api/comments_controller.rb +0 -75
- package/test-projects/rails-app/app/controllers/api/posts_controller.rb +0 -68
- package/test-projects/rails-app/app/controllers/api/users_controller.rb +0 -54
- package/test-projects/rails-app/app/controllers/application_controller.rb +0 -31
- package/test-projects/rails-app/app/models/comment.rb +0 -34
- package/test-projects/rails-app/app/models/post.rb +0 -36
- package/test-projects/rails-app/app/models/user.rb +0 -28
- package/test-projects/rails-app/app/services/post_service.rb +0 -92
- package/test-projects/rails-app/app/services/user_service.rb +0 -76
- package/test-projects/rails-app/config/application.rb +0 -27
- package/test-projects/rails-app/config/environment.rb +0 -7
- package/test-projects/rails-app/config/routes.rb +0 -15
- package/test-projects/react-app/.ai-dev/ai_context.md +0 -96
- package/test-projects/react-app/.ai-dev/architecture.md +0 -39
- package/test-projects/react-app/.ai-dev/cache.json +0 -153
- package/test-projects/react-app/.ai-dev/context/features/src.json +0 -18
- package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +0 -14
- package/test-projects/react-app/.ai-dev/context/flows/dashboard.json +0 -9
- package/test-projects/react-app/.ai-dev/context/flows/login.json +0 -9
- package/test-projects/react-app/.ai-dev/context/flows/users.json +0 -9
- package/test-projects/react-app/.ai-dev/dependencies.json +0 -128
- package/test-projects/react-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/react-app/.ai-dev/files.json +0 -189
- package/test-projects/react-app/.ai-dev/graph/knowledge-graph.json +0 -112
- package/test-projects/react-app/.ai-dev/graph/module-graph.json +0 -31
- package/test-projects/react-app/.ai-dev/graph/symbol-graph.json +0 -868
- package/test-projects/react-app/.ai-dev/graph/symbol-references.json +0 -31
- package/test-projects/react-app/.ai-dev/index-state.json +0 -266
- package/test-projects/react-app/.ai-dev/modules.json +0 -17
- package/test-projects/react-app/.ai-dev/project.json +0 -16
- package/test-projects/react-app/.ai-dev/repo_map.json +0 -391
- package/test-projects/react-app/.ai-dev/repo_map.md +0 -94
- package/test-projects/react-app/.ai-dev/schema.json +0 -5
- package/test-projects/react-app/.ai-dev/summary.md +0 -13
- package/test-projects/react-app/.ai-dev/symbols.json +0 -1
- package/test-projects/react-app/.ai-dev/tools.json +0 -10
- package/test-projects/react-app/package.json +0 -16
- package/test-projects/react-app/src/App.tsx +0 -21
- package/test-projects/react-app/src/context/AuthContext.tsx +0 -41
- package/test-projects/react-app/src/hooks/useAuth.ts +0 -10
- package/test-projects/react-app/src/main.tsx +0 -10
- package/test-projects/react-app/src/pages/DashboardPage.tsx +0 -17
- package/test-projects/react-app/src/pages/LoginPage.tsx +0 -41
- package/test-projects/react-app/src/pages/UsersPage.tsx +0 -36
- package/test-projects/react-app/src/services/userService.ts +0 -37
- package/test-projects/salesforce-cli/.ai-dev/ai_context.md +0 -89
- package/test-projects/salesforce-cli/.ai-dev/ai_rules.md +0 -47
- package/test-projects/salesforce-cli/.ai-dev/architecture.md +0 -39
- package/test-projects/salesforce-cli/.ai-dev/cache.json +0 -125
- package/test-projects/salesforce-cli/.ai-dev/context/features/force-app.json +0 -14
- package/test-projects/salesforce-cli/.ai-dev/context/flows/account.json +0 -9
- package/test-projects/salesforce-cli/.ai-dev/context/flows/opportunity.json +0 -9
- package/test-projects/salesforce-cli/.ai-dev/conventions.md +0 -51
- package/test-projects/salesforce-cli/.ai-dev/dependencies.json +0 -6
- package/test-projects/salesforce-cli/.ai-dev/entrypoints.md +0 -4
- package/test-projects/salesforce-cli/.ai-dev/files.json +0 -154
- package/test-projects/salesforce-cli/.ai-dev/graph/knowledge-graph.json +0 -64
- package/test-projects/salesforce-cli/.ai-dev/graph/module-graph.json +0 -13
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-graph.json +0 -148
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/salesforce-cli/.ai-dev/index-state.json +0 -217
- package/test-projects/salesforce-cli/.ai-dev/modules.json +0 -12
- package/test-projects/salesforce-cli/.ai-dev/project.json +0 -14
- package/test-projects/salesforce-cli/.ai-dev/repo_map.json +0 -328
- package/test-projects/salesforce-cli/.ai-dev/repo_map.md +0 -80
- package/test-projects/salesforce-cli/.ai-dev/schema.json +0 -5
- package/test-projects/salesforce-cli/.ai-dev/summary.md +0 -13
- package/test-projects/salesforce-cli/.ai-dev/symbols.json +0 -1
- package/test-projects/salesforce-cli/.ai-dev/tech_stack.md +0 -31
- package/test-projects/salesforce-cli/.ai-dev/tools.json +0 -10
- package/test-projects/salesforce-cli/.forceignore +0 -27
- package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +0 -24
- package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +0 -25
- package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +0 -45
- package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +0 -33
- package/test-projects/salesforce-cli/sfdx-project.json +0 -11
- package/test-projects/spring-boot-app/.ai-dev/ai_context.md +0 -91
- package/test-projects/spring-boot-app/.ai-dev/ai_rules.md +0 -48
- package/test-projects/spring-boot-app/.ai-dev/architecture.md +0 -39
- package/test-projects/spring-boot-app/.ai-dev/cache.json +0 -173
- package/test-projects/spring-boot-app/.ai-dev/context/features/src.json +0 -26
- package/test-projects/spring-boot-app/.ai-dev/context/flows/PostController.json +0 -19
- package/test-projects/spring-boot-app/.ai-dev/context/flows/UserController.json +0 -19
- package/test-projects/spring-boot-app/.ai-dev/context/flows/comment.json +0 -11
- package/test-projects/spring-boot-app/.ai-dev/context/flows/post.json +0 -14
- package/test-projects/spring-boot-app/.ai-dev/context/flows/user.json +0 -14
- package/test-projects/spring-boot-app/.ai-dev/conventions.md +0 -52
- package/test-projects/spring-boot-app/.ai-dev/dependencies.json +0 -326
- package/test-projects/spring-boot-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/spring-boot-app/.ai-dev/files.json +0 -214
- package/test-projects/spring-boot-app/.ai-dev/graph/knowledge-graph.json +0 -231
- package/test-projects/spring-boot-app/.ai-dev/graph/module-graph.json +0 -22
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-graph.json +0 -794
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-references.json +0 -70
- package/test-projects/spring-boot-app/.ai-dev/index-state.json +0 -301
- package/test-projects/spring-boot-app/.ai-dev/modules.json +0 -21
- package/test-projects/spring-boot-app/.ai-dev/project.json +0 -17
- package/test-projects/spring-boot-app/.ai-dev/repo_map.json +0 -461
- package/test-projects/spring-boot-app/.ai-dev/repo_map.md +0 -109
- package/test-projects/spring-boot-app/.ai-dev/schema.json +0 -5
- package/test-projects/spring-boot-app/.ai-dev/summary.md +0 -12
- package/test-projects/spring-boot-app/.ai-dev/symbols.json +0 -1
- package/test-projects/spring-boot-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/spring-boot-app/.ai-dev/tools.json +0 -10
- package/test-projects/spring-boot-app/.classpath +0 -57
- package/test-projects/spring-boot-app/.factorypath +0 -69
- package/test-projects/spring-boot-app/.project +0 -34
- package/test-projects/spring-boot-app/.settings/org.eclipse.core.resources.prefs +0 -4
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.apt.core.prefs +0 -4
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.core.prefs +0 -10
- package/test-projects/spring-boot-app/.settings/org.eclipse.m2e.core.prefs +0 -4
- package/test-projects/spring-boot-app/README.md +0 -122
- package/test-projects/spring-boot-app/pom.xml +0 -79
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/DemoApplication.java +0 -12
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/CommentController.java +0 -89
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java +0 -92
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java +0 -84
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Comment.java +0 -38
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Post.java +0 -56
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/User.java +0 -44
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/CommentRepository.java +0 -21
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/PostRepository.java +0 -18
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/UserRepository.java +0 -15
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/PostService.java +0 -83
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/UserService.java +0 -62
- package/test-projects/spring-boot-app/src/main/resources/application.properties +0 -22
- 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/tests/e2e/run-e2e.sh +0 -88
- /package/{test-projects/django-app/.ai-dev → ai-context}/tools.json +0 -0
|
@@ -79,6 +79,50 @@ export function discoverEntrypoints(files: FileInfo[], rootDir: string): Entrypo
|
|
|
79
79
|
} catch {}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
const sfdxFiles = files.filter(f => f.name === "sfdx-project.json");
|
|
83
|
+
if (sfdxFiles.length > 0) {
|
|
84
|
+
try {
|
|
85
|
+
const salesforceEntrypoints = discoverSalesforceEntrypoints(files, rootDir);
|
|
86
|
+
entrypoints.push(...salesforceEntrypoints);
|
|
87
|
+
} catch {}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Detect iOS/SwiftUI entrypoints from Swift files
|
|
91
|
+
const swiftFiles = files.filter(f => f.extension === "swift");
|
|
92
|
+
if (swiftFiles.length > 0) {
|
|
93
|
+
try {
|
|
94
|
+
const swiftEntrypoints = discoverSwiftUIEntrypoints(swiftFiles, rootDir);
|
|
95
|
+
entrypoints.push(...swiftEntrypoints);
|
|
96
|
+
} catch {}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Detect Go entrypoints
|
|
100
|
+
const goFiles = files.filter(f => f.extension === "go");
|
|
101
|
+
if (goFiles.length > 0) {
|
|
102
|
+
try {
|
|
103
|
+
const goEntrypoints = discoverGoEntrypoints(goFiles, rootDir);
|
|
104
|
+
entrypoints.push(...goEntrypoints);
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Detect Rust entrypoints
|
|
109
|
+
const rustFiles = files.filter(f => f.extension === "rs");
|
|
110
|
+
if (rustFiles.length > 0) {
|
|
111
|
+
try {
|
|
112
|
+
const rustEntrypoints = discoverRustEntrypoints(rustFiles, rootDir);
|
|
113
|
+
entrypoints.push(...rustEntrypoints);
|
|
114
|
+
} catch {}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Detect PHP entrypoints
|
|
118
|
+
const phpFiles = files.filter(f => f.extension === "php");
|
|
119
|
+
if (phpFiles.length > 0) {
|
|
120
|
+
try {
|
|
121
|
+
const phpEntrypoints = discoverPHPEntrypoints(phpFiles, rootDir);
|
|
122
|
+
entrypoints.push(...phpEntrypoints);
|
|
123
|
+
} catch {}
|
|
124
|
+
}
|
|
125
|
+
|
|
82
126
|
return entrypoints;
|
|
83
127
|
}
|
|
84
128
|
|
|
@@ -151,6 +195,104 @@ function parseAndroidManifest(content: string, manifestPath: string): Entrypoint
|
|
|
151
195
|
return entrypoints;
|
|
152
196
|
}
|
|
153
197
|
|
|
198
|
+
function discoverSalesforceEntrypoints(files: FileInfo[], rootDir: string): Entrypoint[] {
|
|
199
|
+
const entrypoints: Entrypoint[] = [];
|
|
200
|
+
|
|
201
|
+
const apexFiles = files.filter(f => f.extension === "cls" || f.extension === "trigger");
|
|
202
|
+
|
|
203
|
+
for (const apexFile of apexFiles) {
|
|
204
|
+
try {
|
|
205
|
+
const content = readFile(path.join(rootDir, apexFile.relativePath));
|
|
206
|
+
|
|
207
|
+
if (apexFile.extension === "trigger") {
|
|
208
|
+
const triggerMatch = content.match(/^trigger\s+(\w+)\s+on\s+(\w+)/i);
|
|
209
|
+
if (triggerMatch) {
|
|
210
|
+
entrypoints.push({
|
|
211
|
+
name: triggerMatch[1],
|
|
212
|
+
path: apexFile.relativePath,
|
|
213
|
+
type: "api",
|
|
214
|
+
description: `Trigger on ${triggerMatch[2]} SObject`,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
const classMatch = content.match(/^(?:\s*(?:public|private|global)(?:\s+(?:with|without|inherited)\s+sharing)?\s+)?class\s+(\w+)/i);
|
|
219
|
+
if (classMatch) {
|
|
220
|
+
const className = classMatch[1];
|
|
221
|
+
const methods = extractApexMethods(content);
|
|
222
|
+
|
|
223
|
+
const auraEnabled = methods.filter(m => m.includes("@AuraEnabled"));
|
|
224
|
+
const restResource = methods.some(m => m.includes("@RestResource"));
|
|
225
|
+
const webservice = methods.some(m => m.includes("@webservice"));
|
|
226
|
+
|
|
227
|
+
let description = "Apex Class";
|
|
228
|
+
if (restResource) description += " (REST Resource)";
|
|
229
|
+
else if (auraEnabled.length > 0) description += ` (${auraEnabled.length} @AuraEnabled methods)`;
|
|
230
|
+
else if (webservice) description += " (WebService)";
|
|
231
|
+
|
|
232
|
+
entrypoints.push({
|
|
233
|
+
name: className,
|
|
234
|
+
path: apexFile.relativePath,
|
|
235
|
+
type: "api",
|
|
236
|
+
description,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
} catch {}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return entrypoints;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function extractApexMethods(content: string): string[] {
|
|
247
|
+
const methods: string[] = [];
|
|
248
|
+
const methodRegex = /@(?:AuraEnabled|RestResource|webservice|InvocableMethod)\s*(?:public|private|protected|global)?\s*(?:static)?\s*\w+\s+(\w+)\s*\(/g;
|
|
249
|
+
let match;
|
|
250
|
+
while ((match = methodRegex.exec(content)) !== null) {
|
|
251
|
+
methods.push(match[0]);
|
|
252
|
+
}
|
|
253
|
+
return methods;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function discoverSwiftUIEntrypoints(swiftFiles: FileInfo[], rootDir: string): Entrypoint[] {
|
|
257
|
+
const entrypoints: Entrypoint[] = [];
|
|
258
|
+
|
|
259
|
+
for (const swiftFile of swiftFiles) {
|
|
260
|
+
try {
|
|
261
|
+
const content = readFile(path.join(rootDir, swiftFile.relativePath));
|
|
262
|
+
|
|
263
|
+
if (!content.includes("import SwiftUI")) {
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const structRegex = /struct\s+(\w+)\s*:\s*View/g;
|
|
268
|
+
let match;
|
|
269
|
+
while ((match = structRegex.exec(content)) !== null) {
|
|
270
|
+
const viewName = match[1];
|
|
271
|
+
const isContentView = viewName === "ContentView";
|
|
272
|
+
|
|
273
|
+
entrypoints.push({
|
|
274
|
+
name: viewName,
|
|
275
|
+
path: swiftFile.relativePath,
|
|
276
|
+
type: "client",
|
|
277
|
+
description: isContentView ? "Main SwiftUI View" : `SwiftUI View: ${viewName}`,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const appRegex = /@main\s*\n\s*struct\s+(\w+)/g;
|
|
282
|
+
while ((match = appRegex.exec(content)) !== null) {
|
|
283
|
+
entrypoints.push({
|
|
284
|
+
name: match[1],
|
|
285
|
+
path: swiftFile.relativePath,
|
|
286
|
+
type: "client",
|
|
287
|
+
description: `SwiftUI App Entry Point: ${match[1]}`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
} catch {}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return entrypoints;
|
|
294
|
+
}
|
|
295
|
+
|
|
154
296
|
function getScriptType(name: string): Entrypoint["type"] | null {
|
|
155
297
|
const l = name.toLowerCase();
|
|
156
298
|
if (l.includes("start") || l.includes("dev") || l.includes("serve")) return "server";
|
|
@@ -161,6 +303,264 @@ function getScriptType(name: string): Entrypoint["type"] | null {
|
|
|
161
303
|
return null;
|
|
162
304
|
}
|
|
163
305
|
|
|
306
|
+
function discoverGoEntrypoints(goFiles: FileInfo[], rootDir: string): Entrypoint[] {
|
|
307
|
+
const entrypoints: Entrypoint[] = [];
|
|
308
|
+
|
|
309
|
+
for (const file of goFiles) {
|
|
310
|
+
try {
|
|
311
|
+
const content = readFile(path.join(rootDir, file.relativePath));
|
|
312
|
+
const fileName = file.name;
|
|
313
|
+
|
|
314
|
+
if (fileName === "main.go") {
|
|
315
|
+
const hasMain = content.match(/func\s+main\s*\(\s*\)/);
|
|
316
|
+
const packageMatch = content.match(/package\s+(\w+)/);
|
|
317
|
+
const packageName = packageMatch ? packageMatch[1] : "main";
|
|
318
|
+
|
|
319
|
+
const handlers: string[] = [];
|
|
320
|
+
const handlerMatches = content.matchAll(/http\.HandleFunc\s*\(\s*["']([^"']+)["']/g);
|
|
321
|
+
for (const match of handlerMatches) {
|
|
322
|
+
handlers.push(match[1]);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const portMatches = content.matchAll(/:\s*(\d{2,5})/g);
|
|
326
|
+
const ports: string[] = [];
|
|
327
|
+
for (const match of portMatches) {
|
|
328
|
+
ports.push(match[1]);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
let description = `Go main package (${packageName})`;
|
|
332
|
+
if (handlers.length > 0) {
|
|
333
|
+
description += ` with HTTP handlers: ${handlers.join(", ")}`;
|
|
334
|
+
}
|
|
335
|
+
if (ports.length > 0) {
|
|
336
|
+
description += ` on port${ports.length > 1 ? "s" : ""} :${ports.join(", :")}`;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
entrypoints.push({
|
|
340
|
+
name: "main.go",
|
|
341
|
+
path: file.relativePath,
|
|
342
|
+
type: hasMain ? "server" : "library",
|
|
343
|
+
description,
|
|
344
|
+
});
|
|
345
|
+
} else {
|
|
346
|
+
const structMatches = content.matchAll(/type\s+(\w+)\s+struct/g);
|
|
347
|
+
const structs: string[] = [];
|
|
348
|
+
for (const match of structMatches) {
|
|
349
|
+
structs.push(match[1]);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const methodMatches = content.matchAll(/func\s*\(?\s*\*?\s*(\w+)\s*\)?\s*(\w+)\s*\(/g);
|
|
353
|
+
const methods: string[] = [];
|
|
354
|
+
for (const match of methodMatches) {
|
|
355
|
+
methods.push(match[2]);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (structs.length > 0 || methods.length > 0) {
|
|
359
|
+
let description = "Go module";
|
|
360
|
+
if (structs.length > 0) {
|
|
361
|
+
description += ` with structs: ${structs.slice(0, 3).join(", ")}`;
|
|
362
|
+
}
|
|
363
|
+
if (methods.length > 0) {
|
|
364
|
+
description += `, methods: ${methods.slice(0, 3).join(", ")}`;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
entrypoints.push({
|
|
368
|
+
name: fileName,
|
|
369
|
+
path: file.relativePath,
|
|
370
|
+
type: "library",
|
|
371
|
+
description,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
} catch {}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const goModPath = path.join(rootDir, "go.mod");
|
|
379
|
+
try {
|
|
380
|
+
const goMod = readFile(goModPath);
|
|
381
|
+
const moduleMatch = goMod.match(/module\s+(\S+)/);
|
|
382
|
+
if (moduleMatch) {
|
|
383
|
+
entrypoints.push({
|
|
384
|
+
name: "go.mod",
|
|
385
|
+
path: "go.mod",
|
|
386
|
+
type: "config",
|
|
387
|
+
description: `Go module: ${moduleMatch[1]}`,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
} catch {}
|
|
391
|
+
|
|
392
|
+
return entrypoints;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function discoverRustEntrypoints(rustFiles: FileInfo[], rootDir: string): Entrypoint[] {
|
|
396
|
+
const entrypoints: Entrypoint[] = [];
|
|
397
|
+
|
|
398
|
+
for (const file of rustFiles) {
|
|
399
|
+
try {
|
|
400
|
+
const content = readFile(path.join(rootDir, file.relativePath));
|
|
401
|
+
const fileName = file.name;
|
|
402
|
+
|
|
403
|
+
if (fileName === "main.rs") {
|
|
404
|
+
const hasMain = content.match(/fn\s+main\s*\(\s*\)/);
|
|
405
|
+
|
|
406
|
+
const structMatches = content.matchAll(/struct\s+(\w+)/g);
|
|
407
|
+
const structs: string[] = [];
|
|
408
|
+
for (const match of structMatches) {
|
|
409
|
+
structs.push(match[1]);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const implMatches = content.matchAll(/impl\s+(?:\w+\s+for\s+)?(\w+)/g);
|
|
413
|
+
const implementations: string[] = [];
|
|
414
|
+
for (const match of implMatches) {
|
|
415
|
+
implementations.push(match[1]);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
let description = "Rust main";
|
|
419
|
+
if (structs.length > 0) {
|
|
420
|
+
description += ` with structs: ${structs.slice(0, 3).join(", ")}`;
|
|
421
|
+
}
|
|
422
|
+
if (implementations.length > 0) {
|
|
423
|
+
description += `, implementations: ${implementations.slice(0, 3).join(", ")}`;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
entrypoints.push({
|
|
427
|
+
name: "main.rs",
|
|
428
|
+
path: file.relativePath,
|
|
429
|
+
type: hasMain ? "cli" : "library",
|
|
430
|
+
description,
|
|
431
|
+
});
|
|
432
|
+
} else if (fileName === "lib.rs") {
|
|
433
|
+
const pubFnMatches = content.matchAll(/pub\s+fn\s+(\w+)/g);
|
|
434
|
+
const publicFns: string[] = [];
|
|
435
|
+
for (const match of pubFnMatches) {
|
|
436
|
+
publicFns.push(match[1]);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
let description = "Rust library";
|
|
440
|
+
if (publicFns.length > 0) {
|
|
441
|
+
description += ` with public functions: ${publicFns.slice(0, 3).join(", ")}`;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
entrypoints.push({
|
|
445
|
+
name: "lib.rs",
|
|
446
|
+
path: file.relativePath,
|
|
447
|
+
type: "library",
|
|
448
|
+
description,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
} catch {}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
const cargoPath = path.join(rootDir, "Cargo.toml");
|
|
455
|
+
try {
|
|
456
|
+
const cargoContent = readFile(cargoPath);
|
|
457
|
+
const nameMatch = cargoContent.match(/name\s*=\s*"([^"]+)"/);
|
|
458
|
+
const versionMatch = cargoContent.match(/version\s*=\s*"([^"]+)"/);
|
|
459
|
+
|
|
460
|
+
let description = "Rust project";
|
|
461
|
+
if (nameMatch) {
|
|
462
|
+
description += `: ${nameMatch[1]}`;
|
|
463
|
+
}
|
|
464
|
+
if (versionMatch) {
|
|
465
|
+
description += ` v${versionMatch[1]}`;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const binMatch = cargoContent.match(/\[\[bin\]\]/);
|
|
469
|
+
if (binMatch) {
|
|
470
|
+
description += " (has binaries)";
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
entrypoints.push({
|
|
474
|
+
name: "Cargo.toml",
|
|
475
|
+
path: "Cargo.toml",
|
|
476
|
+
type: "config",
|
|
477
|
+
description,
|
|
478
|
+
});
|
|
479
|
+
} catch {}
|
|
480
|
+
|
|
481
|
+
return entrypoints;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function discoverPHPEntrypoints(phpFiles: FileInfo[], rootDir: string): Entrypoint[] {
|
|
485
|
+
const entrypoints: Entrypoint[] = [];
|
|
486
|
+
|
|
487
|
+
const hasIndexPhp = phpFiles.some(f => f.name === "index.php");
|
|
488
|
+
const hasPublicIndex = phpFiles.some(f => f.relativePath.includes("public/index.php"));
|
|
489
|
+
|
|
490
|
+
if (hasIndexPhp) {
|
|
491
|
+
const indexFile = phpFiles.find(f => f.name === "index.php")!;
|
|
492
|
+
try {
|
|
493
|
+
const content = readFile(path.join(rootDir, indexFile.relativePath));
|
|
494
|
+
|
|
495
|
+
const classMatches = content.matchAll(/class\s+(\w+)/g);
|
|
496
|
+
const classes: string[] = [];
|
|
497
|
+
for (const match of classMatches) {
|
|
498
|
+
classes.push(match[1]);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const routes: string[] = [];
|
|
502
|
+
|
|
503
|
+
// Match $router->get('/path') or $app->post('/path') patterns
|
|
504
|
+
const httpMethodMatches = content.matchAll(/->\s*(?:get|post|put|delete|patch)\s*\(\s*["']([^"']+)["']/g);
|
|
505
|
+
for (const match of httpMethodMatches) {
|
|
506
|
+
routes.push(match[1]);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// Match $router->add('METHOD', '/path') patterns (second argument is the path)
|
|
510
|
+
const addMethodMatches = content.matchAll(/->\s*add\s*\(\s*["'][^"']+["']\s*,\s*["']([^"']+)["']/g);
|
|
511
|
+
for (const match of addMethodMatches) {
|
|
512
|
+
routes.push(match[1]);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
let description = "PHP entry point";
|
|
516
|
+
if (classes.length > 0) {
|
|
517
|
+
description += ` with classes: ${classes.slice(0, 3).join(", ")}`;
|
|
518
|
+
}
|
|
519
|
+
if (routes.length > 0) {
|
|
520
|
+
description += `, routes: ${routes.slice(0, 3).join(", ")}`;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
entrypoints.push({
|
|
524
|
+
name: "index.php",
|
|
525
|
+
path: indexFile.relativePath,
|
|
526
|
+
type: hasPublicIndex ? "server" : "api",
|
|
527
|
+
description,
|
|
528
|
+
});
|
|
529
|
+
} catch {}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
const composerPath = path.join(rootDir, "composer.json");
|
|
533
|
+
try {
|
|
534
|
+
const composer = readJsonFile(composerPath) as { name?: string; description?: string; require?: Record<string, string> };
|
|
535
|
+
|
|
536
|
+
let description = "PHP project";
|
|
537
|
+
if (composer.name) {
|
|
538
|
+
description += `: ${composer.name}`;
|
|
539
|
+
}
|
|
540
|
+
if (composer.description) {
|
|
541
|
+
description += ` - ${composer.description}`;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
const hasLaravel = composer.require && (composer.require["laravel/framework"] || composer.require["illuminate/support"]);
|
|
545
|
+
const hasSymfony = composer.require && (composer.require["symfony/framework-bundle"] || composer.require["symfony/symfony"]);
|
|
546
|
+
|
|
547
|
+
if (hasLaravel) {
|
|
548
|
+
description += " (Laravel)";
|
|
549
|
+
} else if (hasSymfony) {
|
|
550
|
+
description += " (Symfony)";
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
entrypoints.push({
|
|
554
|
+
name: "composer.json",
|
|
555
|
+
path: "composer.json",
|
|
556
|
+
type: "config",
|
|
557
|
+
description,
|
|
558
|
+
});
|
|
559
|
+
} catch {}
|
|
560
|
+
|
|
561
|
+
return entrypoints;
|
|
562
|
+
}
|
|
563
|
+
|
|
164
564
|
export function generateEntrypointsFile(entrypoints: Entrypoint[]): string {
|
|
165
565
|
const grouped = new Map<string, Entrypoint[]>();
|
|
166
566
|
for (const ep of entrypoints) {
|
package/src/analyzers/symbols.ts
CHANGED
|
@@ -89,6 +89,8 @@ function parseFileForSymbols(file: FileInfo): Symbol[] {
|
|
|
89
89
|
parsePHP(file, content, lines, symbols);
|
|
90
90
|
} else if (file.extension === "rb") {
|
|
91
91
|
parseRuby(file, content, lines, symbols);
|
|
92
|
+
} else if (file.extension === "swift") {
|
|
93
|
+
parseSwift(file, content, lines, symbols);
|
|
92
94
|
}
|
|
93
95
|
} catch {}
|
|
94
96
|
|
|
@@ -453,15 +455,105 @@ function parseRuby(file: FileInfo, content: string, lines: string[], symbols: Sy
|
|
|
453
455
|
}
|
|
454
456
|
}
|
|
455
457
|
|
|
458
|
+
/**
|
|
459
|
+
* Parse Swift files
|
|
460
|
+
*/
|
|
461
|
+
function parseSwift(file: FileInfo, content: string, lines: string[], symbols: Symbol[]): void {
|
|
462
|
+
for (let i = 0; i < lines.length; i++) {
|
|
463
|
+
const line = lines[i].trim();
|
|
464
|
+
|
|
465
|
+
// Classes/Structs: struct ViewName, class ClassName
|
|
466
|
+
const structMatch = line.match(/^(?:struct|class)\s+(\w+)/);
|
|
467
|
+
if (structMatch) {
|
|
468
|
+
symbols.push({
|
|
469
|
+
id: generateSymbolId(file.relativePath, structMatch[1]),
|
|
470
|
+
name: structMatch[1],
|
|
471
|
+
type: "class",
|
|
472
|
+
file: file.relativePath,
|
|
473
|
+
line: i + 1,
|
|
474
|
+
export: line.startsWith("struct") || line.startsWith("class"),
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Functions: func functionName
|
|
479
|
+
const funcMatch = line.match(/^func\s+(\w+)/);
|
|
480
|
+
if (funcMatch) {
|
|
481
|
+
symbols.push({
|
|
482
|
+
id: generateSymbolId(file.relativePath, funcMatch[1]),
|
|
483
|
+
name: funcMatch[1],
|
|
484
|
+
type: "function",
|
|
485
|
+
file: file.relativePath,
|
|
486
|
+
line: i + 1,
|
|
487
|
+
export: true,
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// Enums: enum EnumName
|
|
492
|
+
const enumMatch = line.match(/^enum\s+(\w+)/);
|
|
493
|
+
if (enumMatch) {
|
|
494
|
+
symbols.push({
|
|
495
|
+
id: generateSymbolId(file.relativePath, enumMatch[1]),
|
|
496
|
+
name: enumMatch[1],
|
|
497
|
+
type: "enum",
|
|
498
|
+
file: file.relativePath,
|
|
499
|
+
line: i + 1,
|
|
500
|
+
export: true,
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Protocols: protocol ProtocolName
|
|
505
|
+
const protocolMatch = line.match(/^protocol\s+(\w+)/);
|
|
506
|
+
if (protocolMatch) {
|
|
507
|
+
symbols.push({
|
|
508
|
+
id: generateSymbolId(file.relativePath, protocolMatch[1]),
|
|
509
|
+
name: protocolMatch[1],
|
|
510
|
+
type: "interface",
|
|
511
|
+
file: file.relativePath,
|
|
512
|
+
line: i + 1,
|
|
513
|
+
export: true,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// Constants: let CONST_NAME or var CONST_NAME
|
|
518
|
+
const constMatch = line.match(/^(?:let|var)\s+([A-Z][A-Z0-9_]*)/);
|
|
519
|
+
if (constMatch) {
|
|
520
|
+
symbols.push({
|
|
521
|
+
id: generateSymbolId(file.relativePath, constMatch[1]),
|
|
522
|
+
name: constMatch[1],
|
|
523
|
+
type: "const",
|
|
524
|
+
file: file.relativePath,
|
|
525
|
+
line: i + 1,
|
|
526
|
+
export: true,
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
456
532
|
/**
|
|
457
533
|
* Parse Apex (Salesforce) files
|
|
458
534
|
*/
|
|
459
535
|
function parseApex(file: FileInfo, content: string, lines: string[], symbols: Symbol[]): void {
|
|
536
|
+
// Track annotations across lines
|
|
537
|
+
let pendingAnnotations: string[] = [];
|
|
538
|
+
|
|
460
539
|
for (let i = 0; i < lines.length; i++) {
|
|
461
540
|
const line = lines[i].trim();
|
|
541
|
+
|
|
542
|
+
// Skip empty lines
|
|
543
|
+
if (!line) {
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// Collect annotations (@AuraEnabled, @IsTest, etc.) - handles both single-line and multi-line
|
|
548
|
+
// Match patterns like @AuraEnabled, @AuraEnabled(cacheable=true), @IsTest
|
|
549
|
+
const annotationMatch = line.match(/^@(\w+)(?:\s*\([^)]*\))?\s*$/);
|
|
550
|
+
if (annotationMatch) {
|
|
551
|
+
pendingAnnotations.push(annotationMatch[1]);
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
462
554
|
|
|
463
555
|
// Classes: public with sharing class ClassName, public class ClassName, etc.
|
|
464
|
-
const classMatch = line.match(/^(?:public
|
|
556
|
+
const classMatch = line.match(/^(?:\s*(?:public|private|global)(?:\s+(?:with|without|inherited)\s+sharing)?\s+)?class\s+(\w+)/);
|
|
465
557
|
if (classMatch) {
|
|
466
558
|
symbols.push({
|
|
467
559
|
id: generateSymbolId(file.relativePath, classMatch[1]),
|
|
@@ -471,6 +563,8 @@ function parseApex(file: FileInfo, content: string, lines: string[], symbols: Sy
|
|
|
471
563
|
line: i + 1,
|
|
472
564
|
export: true,
|
|
473
565
|
});
|
|
566
|
+
pendingAnnotations = [];
|
|
567
|
+
continue;
|
|
474
568
|
}
|
|
475
569
|
|
|
476
570
|
// Interfaces
|
|
@@ -484,11 +578,16 @@ function parseApex(file: FileInfo, content: string, lines: string[], symbols: Sy
|
|
|
484
578
|
line: i + 1,
|
|
485
579
|
export: true,
|
|
486
580
|
});
|
|
581
|
+
pendingAnnotations = [];
|
|
582
|
+
continue;
|
|
487
583
|
}
|
|
488
584
|
|
|
489
585
|
// Methods: public static ReturnType methodName(
|
|
490
586
|
// Also handles @AuraEnabled public static ReturnType methodName(
|
|
491
|
-
|
|
587
|
+
// Also handles @AuraEnabled(cacheable=true) on separate line
|
|
588
|
+
// Handles generic return types like List<Account>, Map<String, Object>
|
|
589
|
+
// Also handles webservice methods
|
|
590
|
+
const methodMatch = line.match(/^(?:@\w+(?:\s*\([^)]*\))?\s+)?(?:public|private|protected|global|webservice)\s+(?:static\s+)?(?:[\w<>,\s]+?)\s+(\w+)\s*\(/);
|
|
492
591
|
if (methodMatch && !["if", "for", "while", "switch"].includes(methodMatch[1])) {
|
|
493
592
|
symbols.push({
|
|
494
593
|
id: generateSymbolId(file.relativePath, methodMatch[1]),
|
|
@@ -496,8 +595,28 @@ function parseApex(file: FileInfo, content: string, lines: string[], symbols: Sy
|
|
|
496
595
|
type: "function",
|
|
497
596
|
file: file.relativePath,
|
|
498
597
|
line: i + 1,
|
|
499
|
-
export: line.includes("public") || line.includes("global"),
|
|
598
|
+
export: line.includes("public") || line.includes("global") || line.includes("webservice"),
|
|
500
599
|
});
|
|
600
|
+
pendingAnnotations = [];
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Alternative: Method with annotations on previous lines
|
|
605
|
+
// Check if we have pending annotations and current line looks like a method
|
|
606
|
+
if (pendingAnnotations.length > 0) {
|
|
607
|
+
const methodWithAnnotationMatch = line.match(/^(?:public|private|protected|global|webservice)\s+(?:static\s+)?(?:[\w<>,\s]+?)\s+(\w+)\s*\(/);
|
|
608
|
+
if (methodWithAnnotationMatch && !["if", "for", "while", "switch"].includes(methodWithAnnotationMatch[1])) {
|
|
609
|
+
symbols.push({
|
|
610
|
+
id: generateSymbolId(file.relativePath, methodWithAnnotationMatch[1]),
|
|
611
|
+
name: methodWithAnnotationMatch[1],
|
|
612
|
+
type: "function",
|
|
613
|
+
file: file.relativePath,
|
|
614
|
+
line: i + 1,
|
|
615
|
+
export: line.includes("public") || line.includes("global") || line.includes("webservice"),
|
|
616
|
+
});
|
|
617
|
+
pendingAnnotations = [];
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
501
620
|
}
|
|
502
621
|
|
|
503
622
|
// Triggers: trigger TriggerName on ObjectName
|
|
@@ -511,6 +630,13 @@ function parseApex(file: FileInfo, content: string, lines: string[], symbols: Sy
|
|
|
511
630
|
line: i + 1,
|
|
512
631
|
export: true,
|
|
513
632
|
});
|
|
633
|
+
pendingAnnotations = [];
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// Reset pending annotations if we encounter non-annotation, non-method line
|
|
638
|
+
if (!line.startsWith("@")) {
|
|
639
|
+
pendingAnnotations = [];
|
|
514
640
|
}
|
|
515
641
|
}
|
|
516
642
|
}
|