ai-first-cli 1.3.0 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (527) hide show
  1. package/.ai-dev/index.db +0 -0
  2. package/.github/workflows/publish.yml +4 -1
  3. package/BETA_EVALUATION_REPORT.md +151 -0
  4. package/CHANGELOG.md +178 -0
  5. package/PHASE1_USER_SIMULATION.md +56 -0
  6. package/PHASE2_USER_SIMULATION.md +81 -0
  7. package/PHASE3_USER_SIMULATION.md +176 -0
  8. package/README.es.md +18 -0
  9. package/README.md +80 -1
  10. package/ai/graph/knowledge-graph.json +10 -0
  11. package/ai-context/ai_context.md +130 -0
  12. package/{test-projects/react-app/.ai-dev → ai-context}/ai_rules.md +10 -5
  13. package/ai-context/architecture.md +136 -0
  14. package/ai-context/context/features/src.json +69 -0
  15. package/ai-context/context/features/test-projects.json +69 -0
  16. package/ai-context/context/flows/App.json +17 -0
  17. package/ai-context/context/flows/DashboardPage.json +14 -0
  18. package/ai-context/context/flows/LoginPage.json +14 -0
  19. package/ai-context/context/flows/admin.json +10 -0
  20. package/ai-context/context/flows/ai-first.json +9 -0
  21. package/ai-context/context/flows/androidresources.json +11 -0
  22. package/ai-context/context/flows/auth.json +13 -0
  23. package/ai-context/context/flows/authController.json +14 -0
  24. package/ai-context/context/flows/doctor.json +9 -0
  25. package/ai-context/context/flows/entrypoints.json +9 -0
  26. package/ai-context/context/flows/explore.json +9 -0
  27. package/ai-context/context/flows/fastapiAdapter.json +14 -0
  28. package/ai-context/context/flows/fastapiadapter.json +11 -0
  29. package/ai-context/context/flows/index.json +19 -0
  30. package/ai-context/context/flows/indexer.json +9 -0
  31. package/ai-context/context/flows/indexstate.json +9 -0
  32. package/ai-context/context/flows/init.json +22 -0
  33. package/ai-context/context/flows/main.json +18 -0
  34. package/ai-context/context/flows/mainactivity.json +9 -0
  35. package/ai-context/context/flows/models.json +15 -0
  36. package/ai-context/context/flows/posts.json +15 -0
  37. package/ai-context/context/flows/repoMapper.json +20 -0
  38. package/ai-context/context/flows/repomapper.json +11 -0
  39. package/ai-context/context/flows/routes.json +15 -0
  40. package/ai-context/context/flows/serializers.json +10 -0
  41. package/ai-context/context/flows/user.json +23 -0
  42. package/ai-context/context/flows/views.json +12 -0
  43. package/{test-projects/react-app/.ai-dev → ai-context}/conventions.md +3 -2
  44. package/ai-context/dependencies.json +3360 -0
  45. package/ai-context/entrypoints.md +45 -0
  46. package/ai-context/index-state.json +196 -0
  47. package/ai-context/modules.json +901 -0
  48. package/ai-context/project.json +33 -0
  49. package/ai-context/repo_map.json +8857 -0
  50. package/ai-context/repo_map.md +2002 -0
  51. package/{test-projects/flask-app/.ai-dev → ai-context}/schema.json +1 -1
  52. package/ai-context/summary.md +46 -0
  53. package/ai-context/symbols.json +82467 -0
  54. package/{test-projects/react-app/.ai-dev → ai-context}/tech_stack.md +15 -7
  55. package/ai-context-evaluation-report-1774223059505.md +206 -0
  56. package/dist/analyzers/architecture.d.ts.map +1 -1
  57. package/dist/analyzers/architecture.js +6 -0
  58. package/dist/analyzers/architecture.js.map +1 -1
  59. package/dist/analyzers/entrypoints.d.ts.map +1 -1
  60. package/dist/analyzers/entrypoints.js +105 -0
  61. package/dist/analyzers/entrypoints.js.map +1 -1
  62. package/dist/analyzers/symbols.d.ts.map +1 -1
  63. package/dist/analyzers/symbols.js +72 -1
  64. package/dist/analyzers/symbols.js.map +1 -1
  65. package/dist/analyzers/techStack.d.ts +8 -0
  66. package/dist/analyzers/techStack.d.ts.map +1 -1
  67. package/dist/analyzers/techStack.js +75 -0
  68. package/dist/analyzers/techStack.js.map +1 -1
  69. package/dist/scripts/ai-context-evaluator.js +367 -0
  70. package/package.json +1 -1
  71. package/quick-evaluation-report-1774396002305.md +64 -0
  72. package/quick-evaluator.ts +200 -0
  73. package/scripts/ai-context-evaluator.ts +440 -0
  74. package/src/analyzers/architecture.ts +8 -0
  75. package/src/analyzers/entrypoints.ts +115 -0
  76. package/src/analyzers/symbols.ts +77 -1
  77. package/src/analyzers/techStack.ts +93 -0
  78. package/test_adapters.mjs +11 -11
  79. package/tests/apex-parser.test.ts +193 -0
  80. package/tests/cli-commands-batch1.test.ts +808 -0
  81. package/tests/cli-commands-batch2.test.ts +1113 -0
  82. package/tests/cli-commands-batch3.test.ts +1128 -0
  83. package/tests/cli-index.test.ts +1007 -0
  84. package/tests/cli-init.test.ts +761 -0
  85. package/tests/salesforce-apex-classes.test.ts +713 -0
  86. package/tests/salesforce-apex-triggers.test.ts +871 -0
  87. package/tests/salesforce-custom-objects.test.ts +918 -0
  88. package/tests/salesforce-flows.test.ts +710 -0
  89. package/tests/salesforce-lwc.test.ts +963 -0
  90. package/tests/salesforce-sfdx-integration.test.ts +1125 -0
  91. package/CONTRIBUTING.md +0 -89
  92. package/FLOW.md +0 -129
  93. package/install.sh +0 -188
  94. package/run-all-tests.sh +0 -184
  95. package/test-projects/django-app/.ai-dev/ai_context.md +0 -92
  96. package/test-projects/django-app/.ai-dev/ai_rules.md +0 -47
  97. package/test-projects/django-app/.ai-dev/architecture.md +0 -57
  98. package/test-projects/django-app/.ai-dev/cache.json +0 -169
  99. package/test-projects/django-app/.ai-dev/context/flows/views.json +0 -10
  100. package/test-projects/django-app/.ai-dev/conventions.md +0 -51
  101. package/test-projects/django-app/.ai-dev/dependencies.json +0 -312
  102. package/test-projects/django-app/.ai-dev/entrypoints.md +0 -4
  103. package/test-projects/django-app/.ai-dev/files.json +0 -209
  104. package/test-projects/django-app/.ai-dev/graph/knowledge-graph.json +0 -36
  105. package/test-projects/django-app/.ai-dev/graph/module-graph.json +0 -145
  106. package/test-projects/django-app/.ai-dev/graph/symbol-graph.json +0 -1488
  107. package/test-projects/django-app/.ai-dev/graph/symbol-references.json +0 -1
  108. package/test-projects/django-app/.ai-dev/index-state.json +0 -294
  109. package/test-projects/django-app/.ai-dev/modules.json +0 -35
  110. package/test-projects/django-app/.ai-dev/project.json +0 -11
  111. package/test-projects/django-app/.ai-dev/repo_map.json +0 -412
  112. package/test-projects/django-app/.ai-dev/repo_map.md +0 -105
  113. package/test-projects/django-app/.ai-dev/schema.json +0 -5
  114. package/test-projects/django-app/.ai-dev/summary.md +0 -15
  115. package/test-projects/django-app/.ai-dev/symbols.json +0 -1
  116. package/test-projects/django-app/.ai-dev/tech_stack.md +0 -32
  117. package/test-projects/django-app/README.md +0 -91
  118. package/test-projects/django-app/blog/__init__.py +0 -0
  119. package/test-projects/django-app/blog/admin.py +0 -31
  120. package/test-projects/django-app/blog/models.py +0 -55
  121. package/test-projects/django-app/blog/serializers.py +0 -69
  122. package/test-projects/django-app/blog/urls.py +0 -14
  123. package/test-projects/django-app/blog/views.py +0 -96
  124. package/test-projects/django-app/django_app/__init__.py +0 -0
  125. package/test-projects/django-app/django_app/settings.py +0 -90
  126. package/test-projects/django-app/django_app/urls.py +0 -11
  127. package/test-projects/django-app/django_app/wsgi.py +0 -9
  128. package/test-projects/django-app/manage.py +0 -23
  129. package/test-projects/django-app/requirements.txt +0 -3
  130. package/test-projects/django-app/users/__init__.py +0 -0
  131. package/test-projects/django-app/users/admin.py +0 -42
  132. package/test-projects/django-app/users/models.py +0 -54
  133. package/test-projects/django-app/users/serializers.py +0 -113
  134. package/test-projects/django-app/users/urls.py +0 -13
  135. package/test-projects/django-app/users/views.py +0 -135
  136. package/test-projects/express-api/.ai-dev/ai_context.md +0 -112
  137. package/test-projects/express-api/.ai-dev/ai_rules.md +0 -50
  138. package/test-projects/express-api/.ai-dev/architecture.md +0 -62
  139. package/test-projects/express-api/.ai-dev/context/features/controllers.json +0 -13
  140. package/test-projects/express-api/.ai-dev/context/features/services.json +0 -13
  141. package/test-projects/express-api/.ai-dev/context/flows/auth.json +0 -12
  142. package/test-projects/express-api/.ai-dev/context/flows/user.json +0 -13
  143. package/test-projects/express-api/.ai-dev/conventions.md +0 -51
  144. package/test-projects/express-api/.ai-dev/dependencies.json +0 -54
  145. package/test-projects/express-api/.ai-dev/entrypoints.md +0 -17
  146. package/test-projects/express-api/.ai-dev/modules.json +0 -30
  147. package/test-projects/express-api/.ai-dev/project.json +0 -15
  148. package/test-projects/express-api/.ai-dev/repo_map.json +0 -100
  149. package/test-projects/express-api/.ai-dev/repo_map.md +0 -36
  150. package/test-projects/express-api/.ai-dev/schema.json +0 -5
  151. package/test-projects/express-api/.ai-dev/summary.md +0 -14
  152. package/test-projects/express-api/.ai-dev/symbols.json +0 -7
  153. package/test-projects/express-api/.ai-dev/tech_stack.md +0 -38
  154. package/test-projects/express-api/.ai-dev/tools.json +0 -10
  155. package/test-projects/express-api/controllers/authController.js +0 -32
  156. package/test-projects/express-api/controllers/userController.js +0 -51
  157. package/test-projects/express-api/index.js +0 -30
  158. package/test-projects/express-api/middleware/authMiddleware.js +0 -30
  159. package/test-projects/express-api/models/userRepository.js +0 -25
  160. package/test-projects/express-api/package.json +0 -18
  161. package/test-projects/express-api/services/authService.js +0 -17
  162. package/test-projects/express-api/services/userService.js +0 -28
  163. package/test-projects/fastapi-app/.ai-dev/ai_context.md +0 -89
  164. package/test-projects/fastapi-app/.ai-dev/ai_rules.md +0 -47
  165. package/test-projects/fastapi-app/.ai-dev/architecture.md +0 -39
  166. package/test-projects/fastapi-app/.ai-dev/cache.json +0 -125
  167. package/test-projects/fastapi-app/.ai-dev/conventions.md +0 -51
  168. package/test-projects/fastapi-app/.ai-dev/dependencies.json +0 -244
  169. package/test-projects/fastapi-app/.ai-dev/entrypoints.md +0 -4
  170. package/test-projects/fastapi-app/.ai-dev/files.json +0 -154
  171. package/test-projects/fastapi-app/.ai-dev/graph/knowledge-graph.json +0 -15
  172. package/test-projects/fastapi-app/.ai-dev/graph/module-graph.json +0 -78
  173. package/test-projects/fastapi-app/.ai-dev/graph/symbol-graph.json +0 -1724
  174. package/test-projects/fastapi-app/.ai-dev/graph/symbol-references.json +0 -51
  175. package/test-projects/fastapi-app/.ai-dev/index-state.json +0 -217
  176. package/test-projects/fastapi-app/.ai-dev/modules.json +0 -16
  177. package/test-projects/fastapi-app/.ai-dev/project.json +0 -9
  178. package/test-projects/fastapi-app/.ai-dev/repo_map.json +0 -298
  179. package/test-projects/fastapi-app/.ai-dev/repo_map.md +0 -74
  180. package/test-projects/fastapi-app/.ai-dev/schema.json +0 -5
  181. package/test-projects/fastapi-app/.ai-dev/summary.md +0 -12
  182. package/test-projects/fastapi-app/.ai-dev/symbols.json +0 -1
  183. package/test-projects/fastapi-app/.ai-dev/tech_stack.md +0 -32
  184. package/test-projects/fastapi-app/.ai-dev/tools.json +0 -10
  185. package/test-projects/fastapi-app/README.md +0 -118
  186. package/test-projects/fastapi-app/app/database.py +0 -21
  187. package/test-projects/fastapi-app/app/dependencies.py +0 -107
  188. package/test-projects/fastapi-app/app/main.py +0 -47
  189. package/test-projects/fastapi-app/app/models.py +0 -149
  190. package/test-projects/fastapi-app/app/routers/auth.py +0 -117
  191. package/test-projects/fastapi-app/app/routers/posts.py +0 -272
  192. package/test-projects/fastapi-app/app/schemas.py +0 -191
  193. package/test-projects/fastapi-app/requirements.txt +0 -10
  194. package/test-projects/flask-app/.ai-dev/ai_context.md +0 -94
  195. package/test-projects/flask-app/.ai-dev/ai_rules.md +0 -47
  196. package/test-projects/flask-app/.ai-dev/architecture.md +0 -49
  197. package/test-projects/flask-app/.ai-dev/cache.json +0 -157
  198. package/test-projects/flask-app/.ai-dev/context/features/app.json +0 -25
  199. package/test-projects/flask-app/.ai-dev/context/flows/routes.json +0 -14
  200. package/test-projects/flask-app/.ai-dev/conventions.md +0 -51
  201. package/test-projects/flask-app/.ai-dev/dependencies.json +0 -298
  202. package/test-projects/flask-app/.ai-dev/entrypoints.md +0 -4
  203. package/test-projects/flask-app/.ai-dev/files.json +0 -194
  204. package/test-projects/flask-app/.ai-dev/graph/knowledge-graph.json +0 -60
  205. package/test-projects/flask-app/.ai-dev/graph/module-graph.json +0 -95
  206. package/test-projects/flask-app/.ai-dev/graph/symbol-graph.json +0 -1448
  207. package/test-projects/flask-app/.ai-dev/graph/symbol-references.json +0 -45
  208. package/test-projects/flask-app/.ai-dev/index-state.json +0 -273
  209. package/test-projects/flask-app/.ai-dev/modules.json +0 -21
  210. package/test-projects/flask-app/.ai-dev/project.json +0 -13
  211. package/test-projects/flask-app/.ai-dev/repo_map.json +0 -400
  212. package/test-projects/flask-app/.ai-dev/repo_map.md +0 -98
  213. package/test-projects/flask-app/.ai-dev/summary.md +0 -13
  214. package/test-projects/flask-app/.ai-dev/symbols.json +0 -1
  215. package/test-projects/flask-app/.ai-dev/tech_stack.md +0 -32
  216. package/test-projects/flask-app/.ai-dev/tools.json +0 -10
  217. package/test-projects/flask-app/README.md +0 -129
  218. package/test-projects/flask-app/app/__init__.py +0 -46
  219. package/test-projects/flask-app/app/api/__init__.py +0 -7
  220. package/test-projects/flask-app/app/api/routes.py +0 -122
  221. package/test-projects/flask-app/app/auth/__init__.py +0 -7
  222. package/test-projects/flask-app/app/auth/forms.py +0 -52
  223. package/test-projects/flask-app/app/auth/routes.py +0 -68
  224. package/test-projects/flask-app/app/blog/__init__.py +0 -7
  225. package/test-projects/flask-app/app/blog/forms.py +0 -35
  226. package/test-projects/flask-app/app/blog/routes.py +0 -140
  227. package/test-projects/flask-app/app/main/__init__.py +0 -7
  228. package/test-projects/flask-app/app/main/routes.py +0 -88
  229. package/test-projects/flask-app/app/models.py +0 -177
  230. package/test-projects/flask-app/config.py +0 -64
  231. package/test-projects/flask-app/requirements.txt +0 -10
  232. package/test-projects/laravel-app/.ai-dev/ai_context.md +0 -97
  233. package/test-projects/laravel-app/.ai-dev/ai_rules.md +0 -47
  234. package/test-projects/laravel-app/.ai-dev/architecture.md +0 -60
  235. package/test-projects/laravel-app/.ai-dev/cache.json +0 -161
  236. package/test-projects/laravel-app/.ai-dev/context/features/app.json +0 -21
  237. package/test-projects/laravel-app/.ai-dev/context/flows/.json +0 -9
  238. package/test-projects/laravel-app/.ai-dev/context/flows/category.json +0 -12
  239. package/test-projects/laravel-app/.ai-dev/context/flows/comment.json +0 -12
  240. package/test-projects/laravel-app/.ai-dev/context/flows/post.json +0 -12
  241. package/test-projects/laravel-app/.ai-dev/context/flows/unnamed.json +0 -9
  242. package/test-projects/laravel-app/.ai-dev/conventions.md +0 -51
  243. package/test-projects/laravel-app/.ai-dev/dependencies.json +0 -6
  244. package/test-projects/laravel-app/.ai-dev/entrypoints.md +0 -4
  245. package/test-projects/laravel-app/.ai-dev/files.json +0 -199
  246. package/test-projects/laravel-app/.ai-dev/graph/knowledge-graph.json +0 -98
  247. package/test-projects/laravel-app/.ai-dev/graph/module-graph.json +0 -30
  248. package/test-projects/laravel-app/.ai-dev/graph/symbol-graph.json +0 -5
  249. package/test-projects/laravel-app/.ai-dev/graph/symbol-references.json +0 -1
  250. package/test-projects/laravel-app/.ai-dev/index-state.json +0 -280
  251. package/test-projects/laravel-app/.ai-dev/modules.json +0 -29
  252. package/test-projects/laravel-app/.ai-dev/project.json +0 -17
  253. package/test-projects/laravel-app/.ai-dev/repo_map.json +0 -419
  254. package/test-projects/laravel-app/.ai-dev/repo_map.md +0 -106
  255. package/test-projects/laravel-app/.ai-dev/schema.json +0 -5
  256. package/test-projects/laravel-app/.ai-dev/summary.md +0 -15
  257. package/test-projects/laravel-app/.ai-dev/symbols.json +0 -1
  258. package/test-projects/laravel-app/.ai-dev/tech_stack.md +0 -34
  259. package/test-projects/laravel-app/.ai-dev/tools.json +0 -10
  260. package/test-projects/laravel-app/README.md +0 -107
  261. package/test-projects/laravel-app/app/Http/Controllers/Api/CategoryController.php +0 -88
  262. package/test-projects/laravel-app/app/Http/Controllers/Api/CommentController.php +0 -56
  263. package/test-projects/laravel-app/app/Http/Controllers/Api/PostController.php +0 -174
  264. package/test-projects/laravel-app/app/Http/Controllers/Controller.php +0 -12
  265. package/test-projects/laravel-app/app/Models/Category.php +0 -34
  266. package/test-projects/laravel-app/app/Models/Comment.php +0 -51
  267. package/test-projects/laravel-app/app/Models/Post.php +0 -108
  268. package/test-projects/laravel-app/app/Models/User.php +0 -85
  269. package/test-projects/laravel-app/bootstrap/app.php +0 -25
  270. package/test-projects/laravel-app/composer.json +0 -35
  271. package/test-projects/laravel-app/routes/api.php +0 -40
  272. package/test-projects/nestjs-backend/.ai-dev/ai_context.md +0 -111
  273. package/test-projects/nestjs-backend/.ai-dev/ai_rules.md +0 -52
  274. package/test-projects/nestjs-backend/.ai-dev/architecture.md +0 -49
  275. package/test-projects/nestjs-backend/.ai-dev/cache.json +0 -169
  276. package/test-projects/nestjs-backend/.ai-dev/context/features/src.json +0 -23
  277. package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +0 -14
  278. package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.json +0 -10
  279. package/test-projects/nestjs-backend/.ai-dev/context/flows/users..json +0 -10
  280. package/test-projects/nestjs-backend/.ai-dev/context/flows/users.controller.json +0 -14
  281. package/test-projects/nestjs-backend/.ai-dev/context/flows/users.json +0 -10
  282. package/test-projects/nestjs-backend/.ai-dev/conventions.md +0 -52
  283. package/test-projects/nestjs-backend/.ai-dev/dependencies.json +0 -152
  284. package/test-projects/nestjs-backend/.ai-dev/entrypoints.md +0 -18
  285. package/test-projects/nestjs-backend/.ai-dev/files.json +0 -209
  286. package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +0 -132
  287. package/test-projects/nestjs-backend/.ai-dev/graph/module-graph.json +0 -29
  288. package/test-projects/nestjs-backend/.ai-dev/graph/symbol-graph.json +0 -304
  289. package/test-projects/nestjs-backend/.ai-dev/graph/symbol-references.json +0 -5
  290. package/test-projects/nestjs-backend/.ai-dev/index-state.json +0 -294
  291. package/test-projects/nestjs-backend/.ai-dev/modules.json +0 -19
  292. package/test-projects/nestjs-backend/.ai-dev/project.json +0 -18
  293. package/test-projects/nestjs-backend/.ai-dev/repo_map.json +0 -427
  294. package/test-projects/nestjs-backend/.ai-dev/repo_map.md +0 -104
  295. package/test-projects/nestjs-backend/.ai-dev/schema.json +0 -5
  296. package/test-projects/nestjs-backend/.ai-dev/summary.md +0 -13
  297. package/test-projects/nestjs-backend/.ai-dev/symbols.json +0 -1
  298. package/test-projects/nestjs-backend/.ai-dev/tech_stack.md +0 -38
  299. package/test-projects/nestjs-backend/.ai-dev/tools.json +0 -10
  300. package/test-projects/nestjs-backend/package.json +0 -22
  301. package/test-projects/nestjs-backend/src/app.module.ts +0 -8
  302. package/test-projects/nestjs-backend/src/auth/auth.controller.ts +0 -22
  303. package/test-projects/nestjs-backend/src/auth/auth.module.ts +0 -11
  304. package/test-projects/nestjs-backend/src/auth/auth.service.ts +0 -28
  305. package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +0 -4
  306. package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +0 -18
  307. package/test-projects/nestjs-backend/src/main.ts +0 -9
  308. package/test-projects/nestjs-backend/src/users/users.controller.ts +0 -32
  309. package/test-projects/nestjs-backend/src/users/users.module.ts +0 -10
  310. package/test-projects/nestjs-backend/src/users/users.service.ts +0 -42
  311. package/test-projects/nestjs-backend/tsconfig.json +0 -21
  312. package/test-projects/python-cli/.ai-dev/ai_context.md +0 -95
  313. package/test-projects/python-cli/.ai-dev/ai_rules.md +0 -47
  314. package/test-projects/python-cli/.ai-dev/architecture.md +0 -55
  315. package/test-projects/python-cli/.ai-dev/cache.json +0 -149
  316. package/test-projects/python-cli/.ai-dev/context/features/cli.json +0 -16
  317. package/test-projects/python-cli/.ai-dev/context/flows/list_.json +0 -9
  318. package/test-projects/python-cli/.ai-dev/context/flows/remove_.json +0 -9
  319. package/test-projects/python-cli/.ai-dev/conventions.md +0 -51
  320. package/test-projects/python-cli/.ai-dev/dependencies.json +0 -66
  321. package/test-projects/python-cli/.ai-dev/entrypoints.md +0 -4
  322. package/test-projects/python-cli/.ai-dev/files.json +0 -184
  323. package/test-projects/python-cli/.ai-dev/graph/knowledge-graph.json +0 -83
  324. package/test-projects/python-cli/.ai-dev/graph/module-graph.json +0 -31
  325. package/test-projects/python-cli/.ai-dev/graph/symbol-graph.json +0 -358
  326. package/test-projects/python-cli/.ai-dev/graph/symbol-references.json +0 -11
  327. package/test-projects/python-cli/.ai-dev/index-state.json +0 -259
  328. package/test-projects/python-cli/.ai-dev/modules.json +0 -21
  329. package/test-projects/python-cli/.ai-dev/project.json +0 -15
  330. package/test-projects/python-cli/.ai-dev/repo_map.json +0 -367
  331. package/test-projects/python-cli/.ai-dev/repo_map.md +0 -93
  332. package/test-projects/python-cli/.ai-dev/schema.json +0 -5
  333. package/test-projects/python-cli/.ai-dev/summary.md +0 -14
  334. package/test-projects/python-cli/.ai-dev/symbols.json +0 -1
  335. package/test-projects/python-cli/.ai-dev/tech_stack.md +0 -32
  336. package/test-projects/python-cli/.ai-dev/tools.json +0 -10
  337. package/test-projects/python-cli/__init__.py +0 -1
  338. package/test-projects/python-cli/cli/__init__.py +0 -1
  339. package/test-projects/python-cli/cli/add_command.py +0 -6
  340. package/test-projects/python-cli/cli/list_command.py +0 -7
  341. package/test-projects/python-cli/cli/remove_command.py +0 -6
  342. package/test-projects/python-cli/main.py +0 -34
  343. package/test-projects/python-cli/models/__init__.py +0 -2
  344. package/test-projects/python-cli/models/task.py +0 -19
  345. package/test-projects/python-cli/models/task_repository.py +0 -44
  346. package/test-projects/rails-app/.ai-dev/ai_context.md +0 -94
  347. package/test-projects/rails-app/.ai-dev/ai_rules.md +0 -47
  348. package/test-projects/rails-app/.ai-dev/architecture.md +0 -49
  349. package/test-projects/rails-app/.ai-dev/cache.json +0 -193
  350. package/test-projects/rails-app/.ai-dev/context/features/app.json +0 -24
  351. package/test-projects/rails-app/.ai-dev/context/features/config.json +0 -13
  352. package/test-projects/rails-app/.ai-dev/context/flows/application.json +0 -9
  353. package/test-projects/rails-app/.ai-dev/context/flows/application_.json +0 -9
  354. package/test-projects/rails-app/.ai-dev/context/flows/comments.json +0 -11
  355. package/test-projects/rails-app/.ai-dev/context/flows/comments_.json +0 -11
  356. package/test-projects/rails-app/.ai-dev/context/flows/posts.json +0 -11
  357. package/test-projects/rails-app/.ai-dev/context/flows/posts_.json +0 -11
  358. package/test-projects/rails-app/.ai-dev/context/flows/routes.json +0 -9
  359. package/test-projects/rails-app/.ai-dev/context/flows/users.json +0 -11
  360. package/test-projects/rails-app/.ai-dev/context/flows/users_.json +0 -11
  361. package/test-projects/rails-app/.ai-dev/conventions.md +0 -51
  362. package/test-projects/rails-app/.ai-dev/dependencies.json +0 -6
  363. package/test-projects/rails-app/.ai-dev/entrypoints.md +0 -4
  364. package/test-projects/rails-app/.ai-dev/files.json +0 -239
  365. package/test-projects/rails-app/.ai-dev/graph/knowledge-graph.json +0 -130
  366. package/test-projects/rails-app/.ai-dev/graph/module-graph.json +0 -27
  367. package/test-projects/rails-app/.ai-dev/graph/symbol-graph.json +0 -5
  368. package/test-projects/rails-app/.ai-dev/graph/symbol-references.json +0 -1
  369. package/test-projects/rails-app/.ai-dev/index-state.json +0 -336
  370. package/test-projects/rails-app/.ai-dev/modules.json +0 -26
  371. package/test-projects/rails-app/.ai-dev/project.json +0 -22
  372. package/test-projects/rails-app/.ai-dev/repo_map.json +0 -486
  373. package/test-projects/rails-app/.ai-dev/repo_map.md +0 -117
  374. package/test-projects/rails-app/.ai-dev/schema.json +0 -5
  375. package/test-projects/rails-app/.ai-dev/summary.md +0 -13
  376. package/test-projects/rails-app/.ai-dev/symbols.json +0 -1
  377. package/test-projects/rails-app/.ai-dev/tech_stack.md +0 -32
  378. package/test-projects/rails-app/.ai-dev/tools.json +0 -10
  379. package/test-projects/rails-app/Gemfile +0 -38
  380. package/test-projects/rails-app/README.md +0 -140
  381. package/test-projects/rails-app/Rakefile +0 -8
  382. package/test-projects/rails-app/app/controllers/api/comments_controller.rb +0 -75
  383. package/test-projects/rails-app/app/controllers/api/posts_controller.rb +0 -68
  384. package/test-projects/rails-app/app/controllers/api/users_controller.rb +0 -54
  385. package/test-projects/rails-app/app/controllers/application_controller.rb +0 -31
  386. package/test-projects/rails-app/app/models/comment.rb +0 -34
  387. package/test-projects/rails-app/app/models/post.rb +0 -36
  388. package/test-projects/rails-app/app/models/user.rb +0 -28
  389. package/test-projects/rails-app/app/services/post_service.rb +0 -92
  390. package/test-projects/rails-app/app/services/user_service.rb +0 -76
  391. package/test-projects/rails-app/config/application.rb +0 -27
  392. package/test-projects/rails-app/config/environment.rb +0 -7
  393. package/test-projects/rails-app/config/routes.rb +0 -15
  394. package/test-projects/react-app/.ai-dev/ai_context.md +0 -96
  395. package/test-projects/react-app/.ai-dev/architecture.md +0 -39
  396. package/test-projects/react-app/.ai-dev/cache.json +0 -153
  397. package/test-projects/react-app/.ai-dev/context/features/src.json +0 -18
  398. package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +0 -14
  399. package/test-projects/react-app/.ai-dev/context/flows/dashboard.json +0 -9
  400. package/test-projects/react-app/.ai-dev/context/flows/login.json +0 -9
  401. package/test-projects/react-app/.ai-dev/context/flows/users.json +0 -9
  402. package/test-projects/react-app/.ai-dev/dependencies.json +0 -128
  403. package/test-projects/react-app/.ai-dev/entrypoints.md +0 -4
  404. package/test-projects/react-app/.ai-dev/files.json +0 -189
  405. package/test-projects/react-app/.ai-dev/graph/knowledge-graph.json +0 -112
  406. package/test-projects/react-app/.ai-dev/graph/module-graph.json +0 -31
  407. package/test-projects/react-app/.ai-dev/graph/symbol-graph.json +0 -868
  408. package/test-projects/react-app/.ai-dev/graph/symbol-references.json +0 -31
  409. package/test-projects/react-app/.ai-dev/index-state.json +0 -266
  410. package/test-projects/react-app/.ai-dev/modules.json +0 -17
  411. package/test-projects/react-app/.ai-dev/project.json +0 -16
  412. package/test-projects/react-app/.ai-dev/repo_map.json +0 -391
  413. package/test-projects/react-app/.ai-dev/repo_map.md +0 -94
  414. package/test-projects/react-app/.ai-dev/schema.json +0 -5
  415. package/test-projects/react-app/.ai-dev/summary.md +0 -13
  416. package/test-projects/react-app/.ai-dev/symbols.json +0 -1
  417. package/test-projects/react-app/.ai-dev/tools.json +0 -10
  418. package/test-projects/react-app/package.json +0 -16
  419. package/test-projects/react-app/src/App.tsx +0 -21
  420. package/test-projects/react-app/src/context/AuthContext.tsx +0 -41
  421. package/test-projects/react-app/src/hooks/useAuth.ts +0 -10
  422. package/test-projects/react-app/src/main.tsx +0 -10
  423. package/test-projects/react-app/src/pages/DashboardPage.tsx +0 -17
  424. package/test-projects/react-app/src/pages/LoginPage.tsx +0 -41
  425. package/test-projects/react-app/src/pages/UsersPage.tsx +0 -36
  426. package/test-projects/react-app/src/services/userService.ts +0 -37
  427. package/test-projects/salesforce-cli/.ai-dev/ai_context.md +0 -89
  428. package/test-projects/salesforce-cli/.ai-dev/ai_rules.md +0 -47
  429. package/test-projects/salesforce-cli/.ai-dev/architecture.md +0 -39
  430. package/test-projects/salesforce-cli/.ai-dev/cache.json +0 -125
  431. package/test-projects/salesforce-cli/.ai-dev/context/features/force-app.json +0 -14
  432. package/test-projects/salesforce-cli/.ai-dev/context/flows/account.json +0 -9
  433. package/test-projects/salesforce-cli/.ai-dev/context/flows/opportunity.json +0 -9
  434. package/test-projects/salesforce-cli/.ai-dev/conventions.md +0 -51
  435. package/test-projects/salesforce-cli/.ai-dev/dependencies.json +0 -6
  436. package/test-projects/salesforce-cli/.ai-dev/entrypoints.md +0 -4
  437. package/test-projects/salesforce-cli/.ai-dev/files.json +0 -154
  438. package/test-projects/salesforce-cli/.ai-dev/graph/knowledge-graph.json +0 -64
  439. package/test-projects/salesforce-cli/.ai-dev/graph/module-graph.json +0 -13
  440. package/test-projects/salesforce-cli/.ai-dev/graph/symbol-graph.json +0 -148
  441. package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +0 -1
  442. package/test-projects/salesforce-cli/.ai-dev/index-state.json +0 -217
  443. package/test-projects/salesforce-cli/.ai-dev/modules.json +0 -12
  444. package/test-projects/salesforce-cli/.ai-dev/project.json +0 -14
  445. package/test-projects/salesforce-cli/.ai-dev/repo_map.json +0 -328
  446. package/test-projects/salesforce-cli/.ai-dev/repo_map.md +0 -80
  447. package/test-projects/salesforce-cli/.ai-dev/schema.json +0 -5
  448. package/test-projects/salesforce-cli/.ai-dev/summary.md +0 -13
  449. package/test-projects/salesforce-cli/.ai-dev/symbols.json +0 -1
  450. package/test-projects/salesforce-cli/.ai-dev/tech_stack.md +0 -31
  451. package/test-projects/salesforce-cli/.ai-dev/tools.json +0 -10
  452. package/test-projects/salesforce-cli/.forceignore +0 -27
  453. package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +0 -24
  454. package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +0 -25
  455. package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +0 -45
  456. package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +0 -33
  457. package/test-projects/salesforce-cli/sfdx-project.json +0 -11
  458. package/test-projects/spring-boot-app/.ai-dev/ai_context.md +0 -91
  459. package/test-projects/spring-boot-app/.ai-dev/ai_rules.md +0 -48
  460. package/test-projects/spring-boot-app/.ai-dev/architecture.md +0 -39
  461. package/test-projects/spring-boot-app/.ai-dev/cache.json +0 -173
  462. package/test-projects/spring-boot-app/.ai-dev/context/features/src.json +0 -26
  463. package/test-projects/spring-boot-app/.ai-dev/context/flows/PostController.json +0 -19
  464. package/test-projects/spring-boot-app/.ai-dev/context/flows/UserController.json +0 -19
  465. package/test-projects/spring-boot-app/.ai-dev/context/flows/comment.json +0 -11
  466. package/test-projects/spring-boot-app/.ai-dev/context/flows/post.json +0 -14
  467. package/test-projects/spring-boot-app/.ai-dev/context/flows/user.json +0 -14
  468. package/test-projects/spring-boot-app/.ai-dev/conventions.md +0 -52
  469. package/test-projects/spring-boot-app/.ai-dev/dependencies.json +0 -326
  470. package/test-projects/spring-boot-app/.ai-dev/entrypoints.md +0 -4
  471. package/test-projects/spring-boot-app/.ai-dev/files.json +0 -214
  472. package/test-projects/spring-boot-app/.ai-dev/graph/knowledge-graph.json +0 -231
  473. package/test-projects/spring-boot-app/.ai-dev/graph/module-graph.json +0 -22
  474. package/test-projects/spring-boot-app/.ai-dev/graph/symbol-graph.json +0 -794
  475. package/test-projects/spring-boot-app/.ai-dev/graph/symbol-references.json +0 -70
  476. package/test-projects/spring-boot-app/.ai-dev/index-state.json +0 -301
  477. package/test-projects/spring-boot-app/.ai-dev/modules.json +0 -21
  478. package/test-projects/spring-boot-app/.ai-dev/project.json +0 -17
  479. package/test-projects/spring-boot-app/.ai-dev/repo_map.json +0 -461
  480. package/test-projects/spring-boot-app/.ai-dev/repo_map.md +0 -109
  481. package/test-projects/spring-boot-app/.ai-dev/schema.json +0 -5
  482. package/test-projects/spring-boot-app/.ai-dev/summary.md +0 -12
  483. package/test-projects/spring-boot-app/.ai-dev/symbols.json +0 -1
  484. package/test-projects/spring-boot-app/.ai-dev/tech_stack.md +0 -32
  485. package/test-projects/spring-boot-app/.ai-dev/tools.json +0 -10
  486. package/test-projects/spring-boot-app/.classpath +0 -57
  487. package/test-projects/spring-boot-app/.factorypath +0 -69
  488. package/test-projects/spring-boot-app/.project +0 -34
  489. package/test-projects/spring-boot-app/.settings/org.eclipse.core.resources.prefs +0 -4
  490. package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.apt.core.prefs +0 -4
  491. package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.core.prefs +0 -10
  492. package/test-projects/spring-boot-app/.settings/org.eclipse.m2e.core.prefs +0 -4
  493. package/test-projects/spring-boot-app/README.md +0 -122
  494. package/test-projects/spring-boot-app/pom.xml +0 -79
  495. package/test-projects/spring-boot-app/src/main/java/com/example/demo/DemoApplication.java +0 -12
  496. package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/CommentController.java +0 -89
  497. package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java +0 -92
  498. package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java +0 -84
  499. package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Comment.java +0 -38
  500. package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Post.java +0 -56
  501. package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/User.java +0 -44
  502. package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/CommentRepository.java +0 -21
  503. package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/PostRepository.java +0 -18
  504. package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/UserRepository.java +0 -15
  505. package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/PostService.java +0 -83
  506. package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/UserService.java +0 -62
  507. package/test-projects/spring-boot-app/src/main/resources/application.properties +0 -22
  508. package/test-projects/spring-boot-app/target/classes/com/example/demo/DemoApplication.class +0 -0
  509. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentCreateRequest.class +0 -0
  510. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentUpdateRequest.class +0 -0
  511. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController.class +0 -0
  512. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostCreateRequest.class +0 -0
  513. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostUpdateRequest.class +0 -0
  514. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController.class +0 -0
  515. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserCreateRequest.class +0 -0
  516. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserUpdateRequest.class +0 -0
  517. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController.class +0 -0
  518. package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Comment.class +0 -0
  519. package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Post.class +0 -0
  520. package/test-projects/spring-boot-app/target/classes/com/example/demo/models/User.class +0 -0
  521. package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/CommentRepository.class +0 -0
  522. package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/PostRepository.class +0 -0
  523. package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/UserRepository.class +0 -0
  524. package/test-projects/spring-boot-app/target/classes/com/example/demo/services/PostService.class +0 -0
  525. package/test-projects/spring-boot-app/target/classes/com/example/demo/services/UserService.class +0 -0
  526. package/tests/e2e/run-e2e.sh +0 -88
  527. /package/{test-projects/django-app/.ai-dev → ai-context}/tools.json +0 -0
@@ -0,0 +1,440 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * ai-context-evaluator.ts
5
+ *
6
+ * Evalúa la calidad de ai-context/ usando 3 modelos de AI (Kimi, GLM, MiniMax)
7
+ * en paralelo por proyecto, procesando secuencialmente para evitar timeouts.
8
+ *
9
+ * Proyectos evaluados:
10
+ * - PRIORIDAD: salesforce-cli (especial interés)
11
+ * - Soportados: ai-first, express-api, nestjs-backend, python-cli, spring-boot-app
12
+ * - No soportados: android-kotlin-app, ios-swift-app, go-microservice, rust-cli, php-vanilla
13
+ */
14
+
15
+ import { readFileSync, readdirSync, statSync, existsSync, writeFileSync } from 'fs';
16
+ import { join, basename } from 'path';
17
+ import { exec } from 'child_process';
18
+ import { promisify } from 'util';
19
+
20
+ const execAsync = promisify(exec);
21
+
22
+ // Configuration
23
+ const CONFIG = {
24
+ opencodeApiKey: process.env.OPENCODE_API_KEY || '',
25
+ minimaxApiKey: process.env.MINIMAX_API_KEY || '',
26
+ timeout: 120000, // 2 minutes per call
27
+ maxRetries: 3,
28
+ retryDelay: 2000,
29
+ };
30
+
31
+ // Projects to evaluate (mix of supported and unsupported)
32
+ const PROJECTS = [
33
+ // PRIORITY: Salesforce (special interest)
34
+ { path: 'test-projects/salesforce-cli', name: 'salesforce-cli', type: 'priority' },
35
+ // Supported
36
+ { path: '.', name: 'ai-first-cli', type: 'supported' },
37
+ { path: 'test-projects/express-api', name: 'express-api', type: 'supported' },
38
+ { path: 'test-projects/nestjs-backend', name: 'nestjs-backend', type: 'supported' },
39
+ { path: 'test-projects/python-cli', name: 'python-cli', type: 'supported' },
40
+ { path: 'test-projects/spring-boot-app', name: 'spring-boot-app', type: 'supported' },
41
+ // Unsupported
42
+ { path: 'test-projects/android-kotlin-app', name: 'android-kotlin-app', type: 'unsupported' },
43
+ { path: 'test-projects/ios-swift-app', name: 'ios-swift-app', type: 'unsupported' },
44
+ { path: 'test-projects/go-microservice', name: 'go-microservice', type: 'unsupported' },
45
+ { path: 'test-projects/rust-cli', name: 'rust-cli', type: 'unsupported' },
46
+ { path: 'test-projects/php-vanilla', name: 'php-vanilla', type: 'unsupported' },
47
+ ];
48
+
49
+ interface EvaluationResult {
50
+ model: string;
51
+ perspective: string;
52
+ score: number;
53
+ feedback: string;
54
+ improvements: string[];
55
+ }
56
+
57
+ interface ProjectEvaluation {
58
+ projectName: string;
59
+ projectType: 'priority' | 'supported' | 'unsupported';
60
+ aiContextPath: string;
61
+ hasIndexDb: boolean;
62
+ results: EvaluationResult[];
63
+ summary: string;
64
+ synthesizedImprovements: string[];
65
+ }
66
+
67
+ /**
68
+ * Read ai-context files and create evaluation prompt
69
+ */
70
+ function createEvaluationPrompt(projectPath: string, projectName: string): string {
71
+ const aiContextPath = join(projectPath, 'ai-context');
72
+
73
+ if (!existsSync(aiContextPath)) {
74
+ return `ERROR: No ai-context directory found for ${projectName}`;
75
+ }
76
+
77
+ // Read key files
78
+ const files: Record<string, string> = {};
79
+ const keyFiles = [
80
+ 'summary.md',
81
+ 'architecture.md',
82
+ 'tech_stack.md',
83
+ 'repo_map.md',
84
+ 'ai_context.md',
85
+ 'entrypoints.md',
86
+ ];
87
+
88
+ for (const file of keyFiles) {
89
+ const filePath = join(aiContextPath, file);
90
+ if (existsSync(filePath)) {
91
+ try {
92
+ files[file] = readFileSync(filePath, 'utf8').substring(0, 5000); // Limit size
93
+ } catch (e) {
94
+ files[file] = `[Error reading ${file}: ${e}]`;
95
+ }
96
+ }
97
+ }
98
+
99
+ // Check for index.db
100
+ const hasIndexDb = existsSync(join(aiContextPath, 'index.db'));
101
+ const hasFeatures = existsSync(join(aiContextPath, 'context', 'features'));
102
+ const hasFlows = existsSync(join(aiContextPath, 'context', 'flows'));
103
+
104
+ return `
105
+ EVALUATE THIS AI-CONTEXT DIRECTORY:
106
+
107
+ PROJECT: ${projectName}
108
+ INDEX DB: ${hasIndexDb ? 'YES' : 'NO'}
109
+ FEATURES: ${hasFeatures ? 'YES' : 'NO'}
110
+ FLOWS: ${hasFlows ? 'YES' : 'NO'}
111
+
112
+ KEY FILES:
113
+ ${Object.entries(files).map(([name, content]) => `=== ${name} ===\n${content}`).join('\n')}
114
+
115
+ TASK: Evaluate from 1-5 (5=excellent) on:
116
+ 1. CLARITY - Clear and non-redundant?
117
+ 2. COMPLETENESS - Has everything needed?
118
+ 3. STRUCTURE - Easy for LLM to parse?
119
+ 4. ACTIONABILITY - Can AI use it to code/decide?
120
+ 5. IMPROVEMENTS - What changes would help?
121
+
122
+ REQUIRED RESPONSE:
123
+ - ONLY return valid JSON, no other text
124
+ - Start with { and end with }
125
+ - Include all fields
126
+
127
+ EXAMPLE (follow this exact format):
128
+ {"clarity":{"score":4,"feedback":"clear","improvements":["item1"]},"completeness":{"score":3,"feedback":"missing X","improvements":["item2"]},"structure":{"score":4,"feedback":"good","improvements":[]},"actionability":{"score":3,"feedback":"needs Y","improvements":["item3"]},"overall_score":3.5,"overall_feedback":"overall good","top_3_improvements":["fix A","add B","remove C"]}
129
+ `.trim();
130
+ }
131
+
132
+ /**
133
+ * Call OpenCode API (Kimi or GLM)
134
+ */
135
+ async function callOpenCode(model: string, prompt: string): Promise<any> {
136
+ const data = {
137
+ model: model,
138
+ messages: [{ role: 'user', content: prompt }],
139
+ temperature: 0.3,
140
+ max_tokens: 8000,
141
+ };
142
+
143
+ const curlCommand = `curl -s --max-time ${CONFIG.timeout / 1000} -X POST "https://opencode.ai/zen/go/v1/chat/completions" \
144
+ -H "Content-Type: application/json" \
145
+ -H "Authorization: Bearer ${CONFIG.opencodeApiKey}" \
146
+ --data-raw '${JSON.stringify(data).replace(/'/g, "'\\''")}'`;
147
+
148
+ for (let attempt = 1; attempt <= CONFIG.maxRetries; attempt++) {
149
+ try {
150
+ const { stdout } = await execAsync(curlCommand, { timeout: CONFIG.timeout });
151
+ const response = JSON.parse(stdout);
152
+
153
+ if (response.choices && response.choices[0]?.message?.content) {
154
+ const content = response.choices[0].message.content;
155
+ // Try to parse JSON from response
156
+ const jsonMatch = content.match(/\{[\s\S]*\}/);
157
+ if (jsonMatch) {
158
+ return JSON.parse(jsonMatch[0]);
159
+ }
160
+ return { raw_response: content };
161
+ }
162
+ throw new Error('Invalid response format');
163
+ } catch (error) {
164
+ if (attempt === CONFIG.maxRetries) {
165
+ console.error(`OpenCode ${model} failed after ${CONFIG.maxRetries} attempts:`, error);
166
+ return { error: error.message };
167
+ }
168
+ await new Promise(resolve => setTimeout(resolve, CONFIG.retryDelay * attempt));
169
+ }
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Call MiniMax API
175
+ */
176
+ async function callMiniMax(prompt: string): Promise<any> {
177
+ const data = {
178
+ model: 'minimax-coding-plan/MiniMax-M2.7',
179
+ max_tokens: 8000,
180
+ temperature: 0.3,
181
+ messages: [{ role: 'user', content: prompt }],
182
+ };
183
+
184
+ const curlCommand = `curl -s --max-time ${CONFIG.timeout / 1000} -X POST "https://api.minimax.io/anthropic/v1/messages" \
185
+ -H "Content-Type: application/json" \
186
+ -H "Authorization: Bearer ${CONFIG.minimaxApiKey}" \
187
+ --data-raw '${JSON.stringify(data).replace(/'/g, "'\\''")}'`;
188
+
189
+ for (let attempt = 1; attempt <= CONFIG.maxRetries; attempt++) {
190
+ try {
191
+ const { stdout } = await execAsync(curlCommand, { timeout: CONFIG.timeout });
192
+ const response = JSON.parse(stdout);
193
+
194
+ if (response.content && Array.isArray(response.content)) {
195
+ const textObj = response.content.find((c: any) => c.type === 'text');
196
+ const content = textObj?.text || response.content[0]?.text || '';
197
+ const jsonMatch = content.match(/\{[\s\S]*\}/);
198
+ if (jsonMatch) {
199
+ return JSON.parse(jsonMatch[0]);
200
+ }
201
+ return { raw_response: content };
202
+ }
203
+ throw new Error('Invalid response format');
204
+ } catch (error) {
205
+ if (attempt === CONFIG.maxRetries) {
206
+ console.error('MiniMax failed after retries:', error);
207
+ return { error: error.message };
208
+ }
209
+ await new Promise(resolve => setTimeout(resolve, CONFIG.retryDelay * attempt));
210
+ }
211
+ }
212
+ }
213
+
214
+ /**
215
+ * Evaluate single project with all 3 models in parallel
216
+ */
217
+ async function evaluateProject(project: typeof PROJECTS[0]): Promise<ProjectEvaluation> {
218
+ console.log(`\n📁 Evaluating: ${project.name} (${project.type})`);
219
+
220
+ const aiContextPath = join(project.path, 'ai-context');
221
+ const hasIndexDb = existsSync(join(aiContextPath, 'index.db'));
222
+
223
+ // Skip if no ai-context
224
+ if (!existsSync(aiContextPath)) {
225
+ console.log(` ⚠️ No ai-context directory found`);
226
+ return {
227
+ projectName: project.name,
228
+ projectType: project.type as 'priority' | 'supported' | 'unsupported',
229
+ aiContextPath,
230
+ hasIndexDb,
231
+ results: [],
232
+ summary: 'No ai-context directory found',
233
+ synthesizedImprovements: [],
234
+ };
235
+ }
236
+
237
+ const prompt = createEvaluationPrompt(project.path, project.name);
238
+
239
+ // Call all 3 models in parallel
240
+ console.log(' 🔄 Calling models in parallel...');
241
+ const startTime = Date.now();
242
+
243
+ const [kimiResult, glmResult, minimaxResult] = await Promise.all([
244
+ callOpenCode('kimi-k2.5', prompt),
245
+ callOpenCode('glm-5', prompt),
246
+ callMiniMax(prompt),
247
+ ]);
248
+
249
+ const duration = ((Date.now() - startTime) / 1000).toFixed(1);
250
+ console.log(` ✅ Completed in ${duration}s`);
251
+
252
+ // Process results
253
+ const results: EvaluationResult[] = [
254
+ { model: 'Kimi K2.5', perspective: 'overall', score: kimiResult.overall_score || 0, feedback: kimiResult.overall_feedback || '', improvements: kimiResult.top_3_improvements || [] },
255
+ { model: 'GLM 5', perspective: 'overall', score: glmResult.overall_score || 0, feedback: glmResult.overall_feedback || '', improvements: glmResult.top_3_improvements || [] },
256
+ { model: 'MiniMax 2.7', perspective: 'overall', score: minimaxResult.overall_score || 0, feedback: minimaxResult.overall_feedback || '', improvements: minimaxResult.top_3_improvements || [] },
257
+ ];
258
+
259
+ // Synthesize improvements
260
+ const allImprovements = [
261
+ ...(kimiResult.top_3_improvements || []),
262
+ ...(glmResult.top_3_improvements || []),
263
+ ...(minimaxResult.top_3_improvements || []),
264
+ ];
265
+
266
+ // Simple deduplication (in real implementation, use LLM to synthesize)
267
+ const synthesizedImprovements = [...new Set(allImprovements)].slice(0, 5);
268
+
269
+ return {
270
+ projectName: project.name,
271
+ projectType: project.type as 'priority' | 'supported' | 'unsupported',
272
+ aiContextPath,
273
+ hasIndexDb,
274
+ results,
275
+ summary: `Average score: ${(results.reduce((a, b) => a + b.score, 0) / results.length).toFixed(1)}/5`,
276
+ synthesizedImprovements,
277
+ };
278
+ }
279
+
280
+ /**
281
+ * Generate final report
282
+ */
283
+ function generateReport(evaluations: ProjectEvaluation[]): string {
284
+ let report = `# AI-Context Evaluation Report\n\n`;
285
+ report += `Generated: ${new Date().toISOString()}\n\n`;
286
+
287
+ // Summary table
288
+ report += `## Summary\n\n`;
289
+ report += `| Project | Type | Index DB | Avg Score | Key Issue |\n`;
290
+ report += `|---------|------|----------|-----------|-----------|\n`;
291
+
292
+ for (const eval_ of evaluations) {
293
+ const avgScore = eval_.results.length > 0
294
+ ? (eval_.results.reduce((a, b) => a + b.score, 0) / eval_.results.length).toFixed(1)
295
+ : 'N/A';
296
+ const keyIssue = eval_.synthesizedImprovements[0] || 'None identified';
297
+ report += `| ${eval_.projectName} | ${eval_.projectType} | ${eval_.hasIndexDb ? '✅' : '❌'} | ${avgScore} | ${keyIssue.substring(0, 40)}... |\n`;
298
+ }
299
+
300
+ // Detailed findings
301
+ report += `\n## Detailed Findings\n\n`;
302
+
303
+ for (const eval_ of evaluations) {
304
+ report += `### ${eval_.projectName}\n\n`;
305
+ report += `- **Type:** ${eval_.projectType}\n`;
306
+ report += `- **Index DB:** ${eval_.hasIndexDb ? 'Yes' : 'No'}\n`;
307
+ report += `- **Model Scores:**\n`;
308
+
309
+ for (const result of eval_.results) {
310
+ report += ` - ${result.model}: ${result.score}/5\n`;
311
+ }
312
+
313
+ if (eval_.synthesizedImprovements.length > 0) {
314
+ report += `- **Top Improvements:**\n`;
315
+ for (const improvement of eval_.synthesizedImprovements) {
316
+ report += ` - ${improvement}\n`;
317
+ }
318
+ }
319
+
320
+ report += `\n`;
321
+ }
322
+
323
+ // Cross-project patterns
324
+ const priority = evaluations.filter(e => e.projectType === 'priority');
325
+ const unsupported = evaluations.filter(e => e.projectType === 'unsupported');
326
+ const supported = evaluations.filter(e => e.projectType === 'supported');
327
+
328
+ report += `## Cross-Project Analysis\n\n`;
329
+
330
+ report += `### 🎯 Priority Projects (Salesforce)\n`;
331
+ report += `- Average score: ${calculateAverageScore(priority)}\n`;
332
+ report += `- Key findings: ${extractCommonIssues(priority).join(', ') || 'See detailed section above'}\n`;
333
+ report += `- Salesforce-specific insights: ${priority.length > 0 ? 'Apex classes, triggers, and SObject metadata handling' : 'N/A'}\n\n`;
334
+
335
+ report += `### Supported Projects\n`;
336
+ report += `- Average score: ${calculateAverageScore(supported)}\n`;
337
+ report += `- Common issues: ${extractCommonIssues(supported).join(', ') || 'None'}\n\n`;
338
+
339
+ report += `### Unsupported Projects\n`;
340
+ report += `- Average score: ${calculateAverageScore(unsupported)}\n`;
341
+ report += `- Common issues: ${extractCommonIssues(unsupported).join(', ') || 'None'}\n\n`;
342
+
343
+ report += `### Key Insights\n`;
344
+ report += `1. **Salesforce Priority**: Detailed analysis of Apex, triggers, and metadata\n`;
345
+ report += `2. Index DB impact on quality: ${evaluations.filter(e => e.hasIndexDb).length > 0 ? 'Projects with Index DB show...' : 'Mixed results'}\n`;
346
+ report += `3. Unsupported projects: ${unsupported.length > 0 ? 'Generic analysis provides value but lacks framework-specific insights' : 'N/A'}\n`;
347
+
348
+ return report;
349
+ }
350
+
351
+ function calculateAverageScore(evaluations: ProjectEvaluation[]): string {
352
+ const scores = evaluations
353
+ .flatMap(e => e.results)
354
+ .map(r => r.score)
355
+ .filter(s => s > 0);
356
+
357
+ if (scores.length === 0) return 'N/A';
358
+ return (scores.reduce((a, b) => a + b, 0) / scores.length).toFixed(1);
359
+ }
360
+
361
+ function extractCommonIssues(evaluations: ProjectEvaluation[]): string[] {
362
+ const allIssues = evaluations.flatMap(e => e.synthesizedImprovements);
363
+ const issueCounts: Record<string, number> = {};
364
+
365
+ for (const issue of allIssues) {
366
+ const normalized = issue.toLowerCase().replace(/[^a-z0-9\s]/g, '');
367
+ issueCounts[normalized] = (issueCounts[normalized] || 0) + 1;
368
+ }
369
+
370
+ return Object.entries(issueCounts)
371
+ .filter(([_, count]) => count > 1)
372
+ .map(([issue, _]) => issue)
373
+ .slice(0, 3);
374
+ }
375
+
376
+ /**
377
+ * Main execution
378
+ */
379
+ async function main() {
380
+ console.log('🚀 AI-Context Evaluator\n');
381
+ console.log('Configuration:');
382
+ console.log(` - Timeout: ${CONFIG.timeout}ms per call`);
383
+ console.log(` - Max retries: ${CONFIG.maxRetries}`);
384
+ console.log(` - Projects: ${PROJECTS.length}`);
385
+ console.log(` - Models: Kimi K2.5, GLM 5, MiniMax 2.7\n`);
386
+
387
+ // Validate API keys
388
+ if (!CONFIG.opencodeApiKey) {
389
+ console.error('❌ Error: OPENCODE_API_KEY not set');
390
+ process.exit(1);
391
+ }
392
+ if (!CONFIG.minimaxApiKey) {
393
+ console.error('❌ Error: MINIMAX_API_KEY not set');
394
+ process.exit(1);
395
+ }
396
+
397
+ const evaluations: ProjectEvaluation[] = [];
398
+
399
+ // Evaluate each project sequentially
400
+ for (const project of PROJECTS) {
401
+ try {
402
+ const evaluation = await evaluateProject(project);
403
+ evaluations.push(evaluation);
404
+
405
+ // Save intermediate results
406
+ const intermediateFile = `evaluation-${project.name}.json`;
407
+ // In real implementation, write to file
408
+ console.log(` 💾 Saved intermediate results\n`);
409
+
410
+ } catch (error) {
411
+ console.error(` ❌ Failed to evaluate ${project.name}:`, error);
412
+ evaluations.push({
413
+ projectName: project.name,
414
+ projectType: project.type as 'priority' | 'supported' | 'unsupported',
415
+ aiContextPath: '',
416
+ hasIndexDb: false,
417
+ results: [],
418
+ summary: `Error: ${error}`,
419
+ synthesizedImprovements: [],
420
+ });
421
+ }
422
+ }
423
+
424
+ // Generate final report
425
+ console.log('\n📊 Generating final report...\n');
426
+ const report = generateReport(evaluations);
427
+
428
+ // Save report
429
+ const reportPath = `ai-context-evaluation-report-${Date.now()}.md`;
430
+ writeFileSync(reportPath, report);
431
+ console.log(`✅ Report saved to: ${reportPath}`);
432
+ console.log('\n📋 Summary:');
433
+ console.log(report.split('\n').slice(0, 20).join('\n'));
434
+ console.log('\n... (truncated)');
435
+ }
436
+
437
+ // Run if called directly
438
+ main().catch(console.error);
439
+
440
+ export { evaluateProject, createEvaluationPrompt, generateReport };
@@ -151,7 +151,15 @@ function detectModules(files: FileInfo[], directories: string[]): ModuleInfo[] {
151
151
  const dirs = directories.filter(d => d && d !== "root");
152
152
 
153
153
  for (const dir of dirs.slice(0, 20)) { // Limit to 20 modules
154
+ // Skip root-level files (entries without "/" that are not real directories)
155
+ // A proper directory should have files under it with path "dir/file"
154
156
  const moduleFiles = files.filter(f => f.relativePath.startsWith(dir + "/"));
157
+
158
+ // Skip if no files found under this directory (it's likely a root-level file misidentified as directory)
159
+ if (moduleFiles.length === 0) {
160
+ continue;
161
+ }
162
+
155
163
  const mainFiles = moduleFiles.filter(f => {
156
164
  const name = f.name.toLowerCase();
157
165
  return name === "index.ts" || name === "mod.ts" || name === "mod.rs" ||
@@ -79,6 +79,23 @@ 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
+
82
99
  return entrypoints;
83
100
  }
84
101
 
@@ -151,6 +168,104 @@ function parseAndroidManifest(content: string, manifestPath: string): Entrypoint
151
168
  return entrypoints;
152
169
  }
153
170
 
171
+ function discoverSalesforceEntrypoints(files: FileInfo[], rootDir: string): Entrypoint[] {
172
+ const entrypoints: Entrypoint[] = [];
173
+
174
+ const apexFiles = files.filter(f => f.extension === "cls" || f.extension === "trigger");
175
+
176
+ for (const apexFile of apexFiles) {
177
+ try {
178
+ const content = readFile(path.join(rootDir, apexFile.relativePath));
179
+
180
+ if (apexFile.extension === "trigger") {
181
+ const triggerMatch = content.match(/^trigger\s+(\w+)\s+on\s+(\w+)/i);
182
+ if (triggerMatch) {
183
+ entrypoints.push({
184
+ name: triggerMatch[1],
185
+ path: apexFile.relativePath,
186
+ type: "api",
187
+ description: `Trigger on ${triggerMatch[2]} SObject`,
188
+ });
189
+ }
190
+ } else {
191
+ const classMatch = content.match(/^(?:\s*(?:public|private|global)(?:\s+(?:with|without|inherited)\s+sharing)?\s+)?class\s+(\w+)/i);
192
+ if (classMatch) {
193
+ const className = classMatch[1];
194
+ const methods = extractApexMethods(content);
195
+
196
+ const auraEnabled = methods.filter(m => m.includes("@AuraEnabled"));
197
+ const restResource = methods.some(m => m.includes("@RestResource"));
198
+ const webservice = methods.some(m => m.includes("@webservice"));
199
+
200
+ let description = "Apex Class";
201
+ if (restResource) description += " (REST Resource)";
202
+ else if (auraEnabled.length > 0) description += ` (${auraEnabled.length} @AuraEnabled methods)`;
203
+ else if (webservice) description += " (WebService)";
204
+
205
+ entrypoints.push({
206
+ name: className,
207
+ path: apexFile.relativePath,
208
+ type: "api",
209
+ description,
210
+ });
211
+ }
212
+ }
213
+ } catch {}
214
+ }
215
+
216
+ return entrypoints;
217
+ }
218
+
219
+ function extractApexMethods(content: string): string[] {
220
+ const methods: string[] = [];
221
+ const methodRegex = /@(?:AuraEnabled|RestResource|webservice|InvocableMethod)\s*(?:public|private|protected|global)?\s*(?:static)?\s*\w+\s+(\w+)\s*\(/g;
222
+ let match;
223
+ while ((match = methodRegex.exec(content)) !== null) {
224
+ methods.push(match[0]);
225
+ }
226
+ return methods;
227
+ }
228
+
229
+ function discoverSwiftUIEntrypoints(swiftFiles: FileInfo[], rootDir: string): Entrypoint[] {
230
+ const entrypoints: Entrypoint[] = [];
231
+
232
+ for (const swiftFile of swiftFiles) {
233
+ try {
234
+ const content = readFile(path.join(rootDir, swiftFile.relativePath));
235
+
236
+ if (!content.includes("import SwiftUI")) {
237
+ continue;
238
+ }
239
+
240
+ const structRegex = /struct\s+(\w+)\s*:\s*View/g;
241
+ let match;
242
+ while ((match = structRegex.exec(content)) !== null) {
243
+ const viewName = match[1];
244
+ const isContentView = viewName === "ContentView";
245
+
246
+ entrypoints.push({
247
+ name: viewName,
248
+ path: swiftFile.relativePath,
249
+ type: "client",
250
+ description: isContentView ? "Main SwiftUI View" : `SwiftUI View: ${viewName}`,
251
+ });
252
+ }
253
+
254
+ const appRegex = /@main\s*\n\s*struct\s+(\w+)/g;
255
+ while ((match = appRegex.exec(content)) !== null) {
256
+ entrypoints.push({
257
+ name: match[1],
258
+ path: swiftFile.relativePath,
259
+ type: "client",
260
+ description: `SwiftUI App Entry Point: ${match[1]}`,
261
+ });
262
+ }
263
+ } catch {}
264
+ }
265
+
266
+ return entrypoints;
267
+ }
268
+
154
269
  function getScriptType(name: string): Entrypoint["type"] | null {
155
270
  const l = name.toLowerCase();
156
271
  if (l.includes("start") || l.includes("dev") || l.includes("serve")) return "server";
@@ -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,6 +455,80 @@ 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
  */
@@ -461,7 +537,7 @@ function parseApex(file: FileInfo, content: string, lines: string[], symbols: Sy
461
537
  const line = lines[i].trim();
462
538
 
463
539
  // Classes: public with sharing class ClassName, public class ClassName, etc.
464
- const classMatch = line.match(/^(?:public\s+(?:with\s+sharing|without\s+sharing|inherited\s+sharing)\s+)?class\s+(\w+)/);
540
+ const classMatch = line.match(/^(?:\s*(?:public|private|global)(?:\s+(?:with|without|inherited)\s+sharing)?\s+)?class\s+(\w+)/);
465
541
  if (classMatch) {
466
542
  symbols.push({
467
543
  id: generateSymbolId(file.relativePath, classMatch[1]),