ai-first-cli 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (923) hide show
  1. package/{ai → .ai-dev}/ai_context.md +18 -11
  2. package/{ai → .ai-dev}/ai_rules.md +5 -3
  3. package/{ai → .ai-dev}/architecture.md +52 -16
  4. package/.ai-dev/cache.json +2349 -0
  5. package/.ai-dev/context/features/commands.json +18 -0
  6. package/.ai-dev/context/features/src.json +61 -0
  7. package/.ai-dev/context/features/test-projects.json +69 -0
  8. package/.ai-dev/context/flows/account.json +9 -0
  9. package/.ai-dev/context/flows/ai-first.json +9 -0
  10. package/.ai-dev/context/flows/api.json +9 -0
  11. package/.ai-dev/context/flows/auth.json +13 -0
  12. package/.ai-dev/context/flows/category.json +12 -0
  13. package/.ai-dev/context/flows/comment.json +16 -0
  14. package/.ai-dev/context/flows/dashboard.json +9 -0
  15. package/.ai-dev/context/flows/doctor.json +9 -0
  16. package/.ai-dev/context/flows/explore.json +9 -0
  17. package/.ai-dev/context/flows/login.json +9 -0
  18. package/.ai-dev/context/flows/opportunity.json +9 -0
  19. package/.ai-dev/context/flows/post.json +18 -0
  20. package/.ai-dev/context/flows/routes.json +19 -0
  21. package/.ai-dev/context/flows/user.json +20 -0
  22. package/.ai-dev/context/flows/users.json +9 -0
  23. package/.ai-dev/context/flows/views.json +14 -0
  24. package/.ai-dev/conventions.md +53 -0
  25. package/.ai-dev/dependencies.json +2946 -0
  26. package/{ai → .ai-dev}/entrypoints.md +10 -0
  27. package/.ai-dev/files.json +2944 -0
  28. package/.ai-dev/graph/knowledge-graph.json +44314 -0
  29. package/.ai-dev/graph/module-graph.json +866 -0
  30. package/.ai-dev/graph/symbol-graph.json +200622 -0
  31. package/.ai-dev/graph/symbol-references.json +6778 -0
  32. package/.ai-dev/hierarchy.json +20 -0
  33. package/.ai-dev/index-state.json +4123 -0
  34. package/.ai-dev/index.db +0 -0
  35. package/.ai-dev/modules.json +532 -0
  36. package/.ai-dev/project.json +30 -0
  37. package/.ai-dev/repo_map.json +5818 -0
  38. package/.ai-dev/repo_map.md +1327 -0
  39. package/.ai-dev/schema.json +5 -0
  40. package/.ai-dev/summary.md +42 -0
  41. package/.ai-dev/symbols.json +7 -0
  42. package/.ai-dev/tech_stack.md +46 -0
  43. package/.ai-dev/tools.json +10 -0
  44. package/.github/workflows/publish.yml +55 -0
  45. package/BUGS.md +455 -0
  46. package/CHANGELOG.md +218 -218
  47. package/PLAN_MEJORAS.md +216 -0
  48. package/README.es.md +82 -99
  49. package/README.md +70 -89
  50. package/STATUS_ADAPTADORES +126 -0
  51. package/TEST_RESULTS_PHASE1.md +420 -0
  52. package/ai/graph/knowledge-graph.json +6 -43639
  53. package/ai-context/ai_context.md +130 -0
  54. package/ai-context/ai_rules.md +54 -0
  55. package/ai-context/architecture.md +136 -0
  56. package/ai-context/cache.json +2349 -0
  57. package/ai-context/ccp/jira-123/context.json +7 -0
  58. package/ai-context/context/features/commands.json +18 -0
  59. package/ai-context/context/features/src.json +61 -0
  60. package/ai-context/context/features/test-projects.json +69 -0
  61. package/ai-context/context/flows/account.json +9 -0
  62. package/ai-context/context/flows/ai-first.json +9 -0
  63. package/ai-context/context/flows/api.json +9 -0
  64. package/ai-context/context/flows/auth.json +13 -0
  65. package/ai-context/context/flows/category.json +12 -0
  66. package/ai-context/context/flows/comment.json +16 -0
  67. package/ai-context/context/flows/dashboard.json +9 -0
  68. package/ai-context/context/flows/doctor.json +9 -0
  69. package/ai-context/context/flows/explore.json +9 -0
  70. package/ai-context/context/flows/login.json +9 -0
  71. package/ai-context/context/flows/opportunity.json +9 -0
  72. package/ai-context/context/flows/post.json +18 -0
  73. package/ai-context/context/flows/routes.json +19 -0
  74. package/ai-context/context/flows/user.json +20 -0
  75. package/ai-context/context/flows/users.json +9 -0
  76. package/ai-context/context/flows/views.json +14 -0
  77. package/ai-context/context/repo.json +56 -0
  78. package/ai-context/context/utils.json +7 -0
  79. package/ai-context/conventions.md +53 -0
  80. package/ai-context/dependencies.json +2946 -0
  81. package/ai-context/embeddings.json +23828 -0
  82. package/ai-context/entrypoints.md +42 -0
  83. package/ai-context/files.json +2944 -0
  84. package/ai-context/git/commit-activity.json +8646 -0
  85. package/ai-context/git/recent-files.json +52 -0
  86. package/ai-context/git/recent-flows.json +1 -0
  87. package/ai-context/graph/knowledge-graph.json +44314 -0
  88. package/ai-context/graph/module-graph.json +866 -0
  89. package/ai-context/graph/symbol-graph.json +200622 -0
  90. package/ai-context/graph/symbol-references.json +6778 -0
  91. package/ai-context/hierarchy.json +20 -0
  92. package/ai-context/index-state.json +4123 -0
  93. package/ai-context/index.db +0 -0
  94. package/ai-context/modules.json +532 -0
  95. package/ai-context/project.json +30 -0
  96. package/ai-context/repo_map.json +5818 -0
  97. package/ai-context/repo_map.md +1327 -0
  98. package/ai-context/schema.json +5 -0
  99. package/ai-context/summary.md +42 -0
  100. package/ai-context/symbols.json +7 -0
  101. package/ai-context/tech_stack.md +46 -0
  102. package/ai-context/tools.json +10 -0
  103. package/dist/analyzers/dependencies.d.ts.map +1 -1
  104. package/dist/analyzers/dependencies.js +8 -16
  105. package/dist/analyzers/dependencies.js.map +1 -1
  106. package/dist/analyzers/symbols.d.ts.map +1 -1
  107. package/dist/analyzers/symbols.js +194 -6
  108. package/dist/analyzers/symbols.js.map +1 -1
  109. package/dist/commands/ai-first.d.ts.map +1 -1
  110. package/dist/commands/ai-first.js +63 -21
  111. package/dist/commands/ai-first.js.map +1 -1
  112. package/dist/commands/doctor.js +1 -1
  113. package/dist/commands/doctor.js.map +1 -1
  114. package/dist/commands/explore.js +1 -1
  115. package/dist/commands/explore.js.map +1 -1
  116. package/dist/core/ccp.js +1 -1
  117. package/dist/core/ccp.js.map +1 -1
  118. package/dist/core/embeddings.d.ts +11 -6
  119. package/dist/core/embeddings.d.ts.map +1 -1
  120. package/dist/core/embeddings.js +88 -38
  121. package/dist/core/embeddings.js.map +1 -1
  122. package/dist/core/gitAnalyzer.js +3 -3
  123. package/dist/core/gitAnalyzer.js.map +1 -1
  124. package/dist/core/incrementalAnalyzer.d.ts.map +1 -1
  125. package/dist/core/incrementalAnalyzer.js +76 -14
  126. package/dist/core/incrementalAnalyzer.js.map +1 -1
  127. package/dist/core/knowledgeGraphBuilder.js +1 -1
  128. package/dist/core/knowledgeGraphBuilder.js.map +1 -1
  129. package/dist/core/semanticContexts.d.ts.map +1 -1
  130. package/dist/core/semanticContexts.js +61 -30
  131. package/dist/core/semanticContexts.js.map +1 -1
  132. package/dist/core/symbolGraph.d.ts.map +1 -1
  133. package/dist/core/symbolGraph.js +14 -2
  134. package/dist/core/symbolGraph.js.map +1 -1
  135. package/dist/utils/fileUtils.d.ts.map +1 -1
  136. package/dist/utils/fileUtils.js +5 -0
  137. package/dist/utils/fileUtils.js.map +1 -1
  138. package/docs/guide/getting-started.md +8 -8
  139. package/docs/guide/quick-start.md +8 -8
  140. package/examples/01-express-api.md +3 -3
  141. package/examples/02-react-app.md +3 -3
  142. package/examples/03-python-django.md +3 -3
  143. package/examples/README.md +3 -3
  144. package/package.json +2 -2
  145. package/src/analyzers/dependencies.ts +10 -20
  146. package/src/analyzers/symbols.ts +207 -6
  147. package/src/commands/ai-first.ts +67 -22
  148. package/src/commands/doctor.ts +1 -1
  149. package/src/commands/explore.ts +1 -1
  150. package/src/core/ccp.ts +1 -1
  151. package/src/core/embeddings.ts +106 -40
  152. package/src/core/gitAnalyzer.ts +3 -3
  153. package/src/core/incrementalAnalyzer.ts +101 -11
  154. package/src/core/knowledgeGraphBuilder.ts +1 -1
  155. package/src/core/semanticContexts.ts +68 -33
  156. package/src/core/symbolGraph.ts +16 -2
  157. package/src/utils/fileUtils.ts +5 -0
  158. package/test-projects/django-app/.ai-dev/ai_context.md +92 -0
  159. package/test-projects/django-app/.ai-dev/ai_rules.md +47 -0
  160. package/test-projects/django-app/.ai-dev/architecture.md +57 -0
  161. package/test-projects/django-app/.ai-dev/cache.json +169 -0
  162. package/test-projects/django-app/.ai-dev/context/flows/views.json +10 -0
  163. package/test-projects/django-app/.ai-dev/conventions.md +51 -0
  164. package/test-projects/django-app/.ai-dev/dependencies.json +312 -0
  165. package/test-projects/django-app/.ai-dev/entrypoints.md +4 -0
  166. package/test-projects/django-app/.ai-dev/files.json +209 -0
  167. package/test-projects/django-app/.ai-dev/graph/knowledge-graph.json +36 -0
  168. package/test-projects/django-app/.ai-dev/graph/module-graph.json +145 -0
  169. package/test-projects/django-app/.ai-dev/graph/symbol-graph.json +1488 -0
  170. package/test-projects/django-app/.ai-dev/graph/symbol-references.json +1 -0
  171. package/test-projects/django-app/.ai-dev/index-state.json +294 -0
  172. package/test-projects/django-app/.ai-dev/index.db +0 -0
  173. package/test-projects/django-app/.ai-dev/modules.json +35 -0
  174. package/test-projects/django-app/.ai-dev/project.json +11 -0
  175. package/test-projects/django-app/.ai-dev/repo_map.json +412 -0
  176. package/test-projects/django-app/.ai-dev/repo_map.md +105 -0
  177. package/test-projects/django-app/.ai-dev/schema.json +5 -0
  178. package/test-projects/django-app/.ai-dev/summary.md +15 -0
  179. package/test-projects/django-app/.ai-dev/symbols.json +1 -0
  180. package/test-projects/django-app/.ai-dev/tech_stack.md +32 -0
  181. package/test-projects/django-app/.ai-dev/tools.json +10 -0
  182. package/test-projects/django-app/README.md +91 -0
  183. package/test-projects/django-app/ai-context/ai_context.md +92 -0
  184. package/test-projects/django-app/ai-context/ai_rules.md +47 -0
  185. package/test-projects/django-app/ai-context/architecture.md +57 -0
  186. package/test-projects/django-app/ai-context/cache.json +169 -0
  187. package/test-projects/django-app/ai-context/context/flows/views.json +10 -0
  188. package/test-projects/django-app/ai-context/conventions.md +51 -0
  189. package/test-projects/django-app/ai-context/dependencies.json +312 -0
  190. package/test-projects/django-app/ai-context/entrypoints.md +4 -0
  191. package/test-projects/django-app/ai-context/files.json +209 -0
  192. package/test-projects/django-app/ai-context/graph/knowledge-graph.json +36 -0
  193. package/test-projects/django-app/ai-context/graph/module-graph.json +145 -0
  194. package/test-projects/django-app/ai-context/graph/symbol-graph.json +1488 -0
  195. package/test-projects/django-app/ai-context/graph/symbol-references.json +1 -0
  196. package/test-projects/django-app/ai-context/index-state.json +294 -0
  197. package/test-projects/django-app/ai-context/index.db +0 -0
  198. package/test-projects/django-app/ai-context/modules.json +35 -0
  199. package/test-projects/django-app/ai-context/project.json +11 -0
  200. package/test-projects/django-app/ai-context/repo_map.json +412 -0
  201. package/test-projects/django-app/ai-context/repo_map.md +105 -0
  202. package/test-projects/django-app/ai-context/schema.json +5 -0
  203. package/test-projects/django-app/ai-context/summary.md +15 -0
  204. package/test-projects/django-app/ai-context/symbols.json +1 -0
  205. package/test-projects/django-app/ai-context/tech_stack.md +32 -0
  206. package/test-projects/django-app/ai-context/tools.json +10 -0
  207. package/test-projects/django-app/blog/__init__.py +0 -0
  208. package/test-projects/django-app/blog/admin.py +31 -0
  209. package/test-projects/django-app/blog/models.py +55 -0
  210. package/test-projects/django-app/blog/serializers.py +69 -0
  211. package/test-projects/django-app/blog/urls.py +14 -0
  212. package/test-projects/django-app/blog/views.py +96 -0
  213. package/test-projects/django-app/django_app/__init__.py +0 -0
  214. package/test-projects/django-app/django_app/settings.py +90 -0
  215. package/test-projects/django-app/django_app/urls.py +11 -0
  216. package/test-projects/django-app/django_app/wsgi.py +9 -0
  217. package/test-projects/django-app/manage.py +23 -0
  218. package/test-projects/django-app/requirements.txt +3 -0
  219. package/test-projects/django-app/users/__init__.py +0 -0
  220. package/test-projects/django-app/users/admin.py +42 -0
  221. package/test-projects/django-app/users/models.py +54 -0
  222. package/test-projects/django-app/users/serializers.py +113 -0
  223. package/test-projects/django-app/users/urls.py +13 -0
  224. package/test-projects/django-app/users/views.py +135 -0
  225. package/test-projects/express-api/.ai-dev/ai_context.md +112 -0
  226. package/test-projects/express-api/.ai-dev/ai_rules.md +50 -0
  227. package/test-projects/express-api/.ai-dev/architecture.md +62 -0
  228. package/test-projects/express-api/.ai-dev/context/features/controllers.json +13 -0
  229. package/test-projects/express-api/.ai-dev/context/features/services.json +13 -0
  230. package/test-projects/express-api/.ai-dev/context/flows/auth.json +12 -0
  231. package/test-projects/express-api/.ai-dev/context/flows/user.json +13 -0
  232. package/test-projects/express-api/.ai-dev/conventions.md +51 -0
  233. package/test-projects/express-api/.ai-dev/dependencies.json +54 -0
  234. package/test-projects/express-api/.ai-dev/entrypoints.md +17 -0
  235. package/test-projects/express-api/.ai-dev/modules.json +30 -0
  236. package/test-projects/express-api/.ai-dev/project.json +15 -0
  237. package/test-projects/express-api/.ai-dev/repo_map.json +100 -0
  238. package/test-projects/express-api/.ai-dev/repo_map.md +36 -0
  239. package/test-projects/express-api/.ai-dev/schema.json +5 -0
  240. package/test-projects/express-api/.ai-dev/summary.md +14 -0
  241. package/test-projects/express-api/.ai-dev/symbols.json +7 -0
  242. package/test-projects/express-api/.ai-dev/tech_stack.md +38 -0
  243. package/test-projects/express-api/.ai-dev/tools.json +10 -0
  244. package/test-projects/express-api/ai-context/ai_context.md +112 -0
  245. package/test-projects/express-api/ai-context/ai_rules.md +50 -0
  246. package/test-projects/express-api/ai-context/architecture.md +62 -0
  247. package/test-projects/express-api/ai-context/context/features/controllers.json +13 -0
  248. package/test-projects/express-api/ai-context/context/features/services.json +13 -0
  249. package/test-projects/express-api/ai-context/context/flows/auth.json +12 -0
  250. package/test-projects/express-api/ai-context/context/flows/user.json +13 -0
  251. package/test-projects/express-api/ai-context/conventions.md +51 -0
  252. package/test-projects/express-api/ai-context/dependencies.json +54 -0
  253. package/test-projects/express-api/ai-context/entrypoints.md +17 -0
  254. package/test-projects/express-api/ai-context/modules.json +30 -0
  255. package/test-projects/express-api/ai-context/project.json +15 -0
  256. package/test-projects/express-api/ai-context/repo_map.json +100 -0
  257. package/test-projects/express-api/ai-context/repo_map.md +36 -0
  258. package/test-projects/express-api/ai-context/schema.json +5 -0
  259. package/test-projects/express-api/ai-context/summary.md +14 -0
  260. package/test-projects/express-api/ai-context/symbols.json +7 -0
  261. package/test-projects/express-api/ai-context/tech_stack.md +38 -0
  262. package/test-projects/express-api/ai-context/tools.json +10 -0
  263. package/test-projects/express-api/controllers/authController.js +32 -0
  264. package/test-projects/express-api/controllers/userController.js +51 -0
  265. package/test-projects/express-api/index.js +30 -0
  266. package/test-projects/express-api/middleware/authMiddleware.js +30 -0
  267. package/test-projects/express-api/models/userRepository.js +25 -0
  268. package/test-projects/express-api/package.json +18 -0
  269. package/test-projects/express-api/services/authService.js +17 -0
  270. package/test-projects/express-api/services/userService.js +28 -0
  271. package/test-projects/fastapi-app/.ai-dev/ai_context.md +89 -0
  272. package/test-projects/fastapi-app/.ai-dev/ai_rules.md +47 -0
  273. package/test-projects/fastapi-app/.ai-dev/architecture.md +39 -0
  274. package/test-projects/fastapi-app/.ai-dev/cache.json +125 -0
  275. package/test-projects/fastapi-app/.ai-dev/conventions.md +51 -0
  276. package/test-projects/fastapi-app/.ai-dev/dependencies.json +244 -0
  277. package/test-projects/fastapi-app/.ai-dev/entrypoints.md +4 -0
  278. package/test-projects/fastapi-app/.ai-dev/files.json +154 -0
  279. package/test-projects/fastapi-app/.ai-dev/graph/knowledge-graph.json +15 -0
  280. package/test-projects/fastapi-app/.ai-dev/graph/module-graph.json +78 -0
  281. package/test-projects/fastapi-app/.ai-dev/graph/symbol-graph.json +1724 -0
  282. package/test-projects/fastapi-app/.ai-dev/graph/symbol-references.json +51 -0
  283. package/test-projects/fastapi-app/.ai-dev/index-state.json +217 -0
  284. package/test-projects/fastapi-app/.ai-dev/index.db +0 -0
  285. package/test-projects/fastapi-app/.ai-dev/modules.json +16 -0
  286. package/test-projects/fastapi-app/.ai-dev/project.json +9 -0
  287. package/test-projects/fastapi-app/.ai-dev/repo_map.json +298 -0
  288. package/test-projects/fastapi-app/.ai-dev/repo_map.md +74 -0
  289. package/test-projects/fastapi-app/.ai-dev/schema.json +5 -0
  290. package/test-projects/fastapi-app/.ai-dev/summary.md +12 -0
  291. package/test-projects/fastapi-app/.ai-dev/symbols.json +1 -0
  292. package/test-projects/fastapi-app/.ai-dev/tech_stack.md +32 -0
  293. package/test-projects/fastapi-app/.ai-dev/tools.json +10 -0
  294. package/test-projects/fastapi-app/README.md +118 -0
  295. package/test-projects/fastapi-app/ai-context/ai_context.md +89 -0
  296. package/test-projects/fastapi-app/ai-context/ai_rules.md +47 -0
  297. package/test-projects/fastapi-app/ai-context/architecture.md +39 -0
  298. package/test-projects/fastapi-app/ai-context/cache.json +125 -0
  299. package/test-projects/fastapi-app/ai-context/conventions.md +51 -0
  300. package/test-projects/fastapi-app/ai-context/dependencies.json +244 -0
  301. package/test-projects/fastapi-app/ai-context/entrypoints.md +4 -0
  302. package/test-projects/fastapi-app/ai-context/files.json +154 -0
  303. package/test-projects/fastapi-app/ai-context/graph/knowledge-graph.json +15 -0
  304. package/test-projects/fastapi-app/ai-context/graph/module-graph.json +78 -0
  305. package/test-projects/fastapi-app/ai-context/graph/symbol-graph.json +1724 -0
  306. package/test-projects/fastapi-app/ai-context/graph/symbol-references.json +51 -0
  307. package/test-projects/fastapi-app/ai-context/index-state.json +217 -0
  308. package/test-projects/fastapi-app/ai-context/index.db +0 -0
  309. package/test-projects/fastapi-app/ai-context/modules.json +16 -0
  310. package/test-projects/fastapi-app/ai-context/project.json +9 -0
  311. package/test-projects/fastapi-app/ai-context/repo_map.json +298 -0
  312. package/test-projects/fastapi-app/ai-context/repo_map.md +74 -0
  313. package/test-projects/fastapi-app/ai-context/schema.json +5 -0
  314. package/test-projects/fastapi-app/ai-context/summary.md +12 -0
  315. package/test-projects/fastapi-app/ai-context/symbols.json +1 -0
  316. package/test-projects/fastapi-app/ai-context/tech_stack.md +32 -0
  317. package/test-projects/fastapi-app/ai-context/tools.json +10 -0
  318. package/test-projects/fastapi-app/app/database.py +21 -0
  319. package/test-projects/fastapi-app/app/dependencies.py +107 -0
  320. package/test-projects/fastapi-app/app/main.py +47 -0
  321. package/test-projects/fastapi-app/app/models.py +149 -0
  322. package/test-projects/fastapi-app/app/routers/auth.py +117 -0
  323. package/test-projects/fastapi-app/app/routers/posts.py +272 -0
  324. package/test-projects/fastapi-app/app/schemas.py +191 -0
  325. package/test-projects/fastapi-app/requirements.txt +10 -0
  326. package/test-projects/flask-app/.ai-dev/ai_context.md +94 -0
  327. package/test-projects/flask-app/.ai-dev/ai_rules.md +47 -0
  328. package/test-projects/flask-app/.ai-dev/architecture.md +49 -0
  329. package/test-projects/flask-app/.ai-dev/cache.json +157 -0
  330. package/test-projects/flask-app/.ai-dev/context/features/app.json +25 -0
  331. package/test-projects/flask-app/.ai-dev/context/flows/routes.json +14 -0
  332. package/test-projects/flask-app/.ai-dev/conventions.md +51 -0
  333. package/test-projects/flask-app/.ai-dev/dependencies.json +298 -0
  334. package/test-projects/flask-app/.ai-dev/entrypoints.md +4 -0
  335. package/test-projects/flask-app/.ai-dev/files.json +194 -0
  336. package/test-projects/flask-app/.ai-dev/graph/knowledge-graph.json +60 -0
  337. package/test-projects/flask-app/.ai-dev/graph/module-graph.json +95 -0
  338. package/test-projects/flask-app/.ai-dev/graph/symbol-graph.json +1448 -0
  339. package/test-projects/flask-app/.ai-dev/graph/symbol-references.json +45 -0
  340. package/test-projects/flask-app/.ai-dev/index-state.json +273 -0
  341. package/test-projects/flask-app/.ai-dev/index.db +0 -0
  342. package/test-projects/flask-app/.ai-dev/modules.json +21 -0
  343. package/test-projects/flask-app/.ai-dev/project.json +13 -0
  344. package/test-projects/flask-app/.ai-dev/repo_map.json +400 -0
  345. package/test-projects/flask-app/.ai-dev/repo_map.md +98 -0
  346. package/test-projects/flask-app/.ai-dev/schema.json +5 -0
  347. package/test-projects/flask-app/.ai-dev/summary.md +13 -0
  348. package/test-projects/flask-app/.ai-dev/symbols.json +1 -0
  349. package/test-projects/flask-app/.ai-dev/tech_stack.md +32 -0
  350. package/test-projects/flask-app/.ai-dev/tools.json +10 -0
  351. package/test-projects/flask-app/README.md +129 -0
  352. package/test-projects/flask-app/ai-context/ai_context.md +94 -0
  353. package/test-projects/flask-app/ai-context/ai_rules.md +47 -0
  354. package/test-projects/flask-app/ai-context/architecture.md +49 -0
  355. package/test-projects/flask-app/ai-context/cache.json +157 -0
  356. package/test-projects/flask-app/ai-context/context/features/app.json +25 -0
  357. package/test-projects/flask-app/ai-context/context/flows/routes.json +14 -0
  358. package/test-projects/flask-app/ai-context/conventions.md +51 -0
  359. package/test-projects/flask-app/ai-context/dependencies.json +298 -0
  360. package/test-projects/flask-app/ai-context/entrypoints.md +4 -0
  361. package/test-projects/flask-app/ai-context/files.json +194 -0
  362. package/test-projects/flask-app/ai-context/graph/knowledge-graph.json +60 -0
  363. package/test-projects/flask-app/ai-context/graph/module-graph.json +95 -0
  364. package/test-projects/flask-app/ai-context/graph/symbol-graph.json +1448 -0
  365. package/test-projects/flask-app/ai-context/graph/symbol-references.json +45 -0
  366. package/test-projects/flask-app/ai-context/index-state.json +273 -0
  367. package/test-projects/flask-app/ai-context/index.db +0 -0
  368. package/test-projects/flask-app/ai-context/modules.json +21 -0
  369. package/test-projects/flask-app/ai-context/project.json +13 -0
  370. package/test-projects/flask-app/ai-context/repo_map.json +400 -0
  371. package/test-projects/flask-app/ai-context/repo_map.md +98 -0
  372. package/test-projects/flask-app/ai-context/schema.json +5 -0
  373. package/test-projects/flask-app/ai-context/summary.md +13 -0
  374. package/test-projects/flask-app/ai-context/symbols.json +1 -0
  375. package/test-projects/flask-app/ai-context/tech_stack.md +32 -0
  376. package/test-projects/flask-app/ai-context/tools.json +10 -0
  377. package/test-projects/flask-app/app/__init__.py +46 -0
  378. package/test-projects/flask-app/app/api/__init__.py +7 -0
  379. package/test-projects/flask-app/app/api/routes.py +122 -0
  380. package/test-projects/flask-app/app/auth/__init__.py +7 -0
  381. package/test-projects/flask-app/app/auth/forms.py +52 -0
  382. package/test-projects/flask-app/app/auth/routes.py +68 -0
  383. package/test-projects/flask-app/app/blog/__init__.py +7 -0
  384. package/test-projects/flask-app/app/blog/forms.py +35 -0
  385. package/test-projects/flask-app/app/blog/routes.py +140 -0
  386. package/test-projects/flask-app/app/main/__init__.py +7 -0
  387. package/test-projects/flask-app/app/main/routes.py +88 -0
  388. package/test-projects/flask-app/app/models.py +177 -0
  389. package/test-projects/flask-app/config.py +64 -0
  390. package/test-projects/flask-app/requirements.txt +10 -0
  391. package/test-projects/laravel-app/.ai-dev/ai_context.md +97 -0
  392. package/test-projects/laravel-app/.ai-dev/ai_rules.md +47 -0
  393. package/test-projects/laravel-app/.ai-dev/architecture.md +60 -0
  394. package/test-projects/laravel-app/.ai-dev/cache.json +161 -0
  395. package/test-projects/laravel-app/.ai-dev/context/features/app.json +21 -0
  396. package/test-projects/laravel-app/.ai-dev/context/flows/.json +9 -0
  397. package/test-projects/laravel-app/.ai-dev/context/flows/category.json +12 -0
  398. package/test-projects/laravel-app/.ai-dev/context/flows/comment.json +12 -0
  399. package/test-projects/laravel-app/.ai-dev/context/flows/post.json +12 -0
  400. package/test-projects/laravel-app/.ai-dev/context/flows/unnamed.json +9 -0
  401. package/test-projects/laravel-app/.ai-dev/conventions.md +51 -0
  402. package/test-projects/laravel-app/.ai-dev/dependencies.json +6 -0
  403. package/test-projects/laravel-app/.ai-dev/entrypoints.md +4 -0
  404. package/test-projects/laravel-app/.ai-dev/files.json +199 -0
  405. package/test-projects/laravel-app/.ai-dev/graph/knowledge-graph.json +98 -0
  406. package/test-projects/laravel-app/.ai-dev/graph/module-graph.json +30 -0
  407. package/test-projects/laravel-app/.ai-dev/graph/symbol-graph.json +5 -0
  408. package/test-projects/laravel-app/.ai-dev/graph/symbol-references.json +1 -0
  409. package/test-projects/laravel-app/.ai-dev/index-state.json +280 -0
  410. package/test-projects/laravel-app/.ai-dev/index.db +0 -0
  411. package/test-projects/laravel-app/.ai-dev/modules.json +29 -0
  412. package/test-projects/laravel-app/.ai-dev/project.json +17 -0
  413. package/test-projects/laravel-app/.ai-dev/repo_map.json +419 -0
  414. package/test-projects/laravel-app/.ai-dev/repo_map.md +106 -0
  415. package/test-projects/laravel-app/.ai-dev/schema.json +5 -0
  416. package/test-projects/laravel-app/.ai-dev/summary.md +15 -0
  417. package/test-projects/laravel-app/.ai-dev/symbols.json +1 -0
  418. package/test-projects/laravel-app/.ai-dev/tech_stack.md +34 -0
  419. package/test-projects/laravel-app/.ai-dev/tools.json +10 -0
  420. package/test-projects/laravel-app/README.md +107 -0
  421. package/test-projects/laravel-app/ai-context/ai_context.md +97 -0
  422. package/test-projects/laravel-app/ai-context/ai_rules.md +47 -0
  423. package/test-projects/laravel-app/ai-context/architecture.md +60 -0
  424. package/test-projects/laravel-app/ai-context/cache.json +161 -0
  425. package/test-projects/laravel-app/ai-context/context/features/app.json +21 -0
  426. package/test-projects/laravel-app/ai-context/context/flows/.json +9 -0
  427. package/test-projects/laravel-app/ai-context/context/flows/category.json +12 -0
  428. package/test-projects/laravel-app/ai-context/context/flows/comment.json +12 -0
  429. package/test-projects/laravel-app/ai-context/context/flows/post.json +12 -0
  430. package/test-projects/laravel-app/ai-context/context/flows/unnamed.json +9 -0
  431. package/test-projects/laravel-app/ai-context/conventions.md +51 -0
  432. package/test-projects/laravel-app/ai-context/dependencies.json +6 -0
  433. package/test-projects/laravel-app/ai-context/entrypoints.md +4 -0
  434. package/test-projects/laravel-app/ai-context/files.json +199 -0
  435. package/test-projects/laravel-app/ai-context/graph/knowledge-graph.json +98 -0
  436. package/test-projects/laravel-app/ai-context/graph/module-graph.json +30 -0
  437. package/test-projects/laravel-app/ai-context/graph/symbol-graph.json +5 -0
  438. package/test-projects/laravel-app/ai-context/graph/symbol-references.json +1 -0
  439. package/test-projects/laravel-app/ai-context/index-state.json +280 -0
  440. package/test-projects/laravel-app/ai-context/index.db +0 -0
  441. package/test-projects/laravel-app/ai-context/modules.json +29 -0
  442. package/test-projects/laravel-app/ai-context/project.json +17 -0
  443. package/test-projects/laravel-app/ai-context/repo_map.json +419 -0
  444. package/test-projects/laravel-app/ai-context/repo_map.md +106 -0
  445. package/test-projects/laravel-app/ai-context/schema.json +5 -0
  446. package/test-projects/laravel-app/ai-context/summary.md +15 -0
  447. package/test-projects/laravel-app/ai-context/symbols.json +1 -0
  448. package/test-projects/laravel-app/ai-context/tech_stack.md +34 -0
  449. package/test-projects/laravel-app/ai-context/tools.json +10 -0
  450. package/test-projects/laravel-app/app/Http/Controllers/Api/CategoryController.php +88 -0
  451. package/test-projects/laravel-app/app/Http/Controllers/Api/CommentController.php +56 -0
  452. package/test-projects/laravel-app/app/Http/Controllers/Api/PostController.php +174 -0
  453. package/test-projects/laravel-app/app/Http/Controllers/Controller.php +12 -0
  454. package/test-projects/laravel-app/app/Models/Category.php +34 -0
  455. package/test-projects/laravel-app/app/Models/Comment.php +51 -0
  456. package/test-projects/laravel-app/app/Models/Post.php +108 -0
  457. package/test-projects/laravel-app/app/Models/User.php +85 -0
  458. package/test-projects/laravel-app/bootstrap/app.php +25 -0
  459. package/test-projects/laravel-app/composer.json +35 -0
  460. package/test-projects/laravel-app/routes/api.php +40 -0
  461. package/test-projects/nestjs-backend/.ai-dev/ai_context.md +111 -0
  462. package/test-projects/nestjs-backend/.ai-dev/ai_rules.md +52 -0
  463. package/test-projects/nestjs-backend/.ai-dev/architecture.md +49 -0
  464. package/test-projects/nestjs-backend/.ai-dev/cache.json +169 -0
  465. package/test-projects/nestjs-backend/.ai-dev/context/features/src.json +23 -0
  466. package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +14 -0
  467. package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.json +10 -0
  468. package/test-projects/nestjs-backend/.ai-dev/context/flows/users..json +10 -0
  469. package/test-projects/nestjs-backend/.ai-dev/context/flows/users.controller.json +14 -0
  470. package/test-projects/nestjs-backend/.ai-dev/context/flows/users.json +10 -0
  471. package/test-projects/nestjs-backend/.ai-dev/conventions.md +52 -0
  472. package/test-projects/nestjs-backend/.ai-dev/dependencies.json +152 -0
  473. package/test-projects/nestjs-backend/.ai-dev/entrypoints.md +18 -0
  474. package/test-projects/nestjs-backend/.ai-dev/files.json +209 -0
  475. package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +132 -0
  476. package/test-projects/nestjs-backend/.ai-dev/graph/module-graph.json +29 -0
  477. package/test-projects/nestjs-backend/.ai-dev/graph/symbol-graph.json +304 -0
  478. package/test-projects/nestjs-backend/.ai-dev/graph/symbol-references.json +5 -0
  479. package/test-projects/nestjs-backend/.ai-dev/index-state.json +294 -0
  480. package/test-projects/nestjs-backend/.ai-dev/index.db +0 -0
  481. package/test-projects/nestjs-backend/.ai-dev/modules.json +19 -0
  482. package/test-projects/nestjs-backend/.ai-dev/project.json +18 -0
  483. package/test-projects/nestjs-backend/.ai-dev/repo_map.json +427 -0
  484. package/test-projects/nestjs-backend/.ai-dev/repo_map.md +104 -0
  485. package/test-projects/nestjs-backend/.ai-dev/schema.json +5 -0
  486. package/test-projects/nestjs-backend/.ai-dev/summary.md +13 -0
  487. package/test-projects/nestjs-backend/.ai-dev/symbols.json +1 -0
  488. package/{ai → test-projects/nestjs-backend/.ai-dev}/tech_stack.md +6 -7
  489. package/test-projects/nestjs-backend/.ai-dev/tools.json +10 -0
  490. package/test-projects/nestjs-backend/ai-context/ai_context.md +111 -0
  491. package/test-projects/nestjs-backend/ai-context/ai_rules.md +52 -0
  492. package/test-projects/nestjs-backend/ai-context/architecture.md +49 -0
  493. package/test-projects/nestjs-backend/ai-context/cache.json +169 -0
  494. package/test-projects/nestjs-backend/ai-context/context/features/src.json +23 -0
  495. package/test-projects/nestjs-backend/ai-context/context/flows/auth.controller.json +14 -0
  496. package/test-projects/nestjs-backend/ai-context/context/flows/auth.json +10 -0
  497. package/test-projects/nestjs-backend/ai-context/context/flows/users..json +10 -0
  498. package/test-projects/nestjs-backend/ai-context/context/flows/users.controller.json +14 -0
  499. package/test-projects/nestjs-backend/ai-context/context/flows/users.json +10 -0
  500. package/test-projects/nestjs-backend/ai-context/conventions.md +52 -0
  501. package/test-projects/nestjs-backend/ai-context/dependencies.json +152 -0
  502. package/test-projects/nestjs-backend/ai-context/entrypoints.md +18 -0
  503. package/test-projects/nestjs-backend/ai-context/files.json +209 -0
  504. package/test-projects/nestjs-backend/ai-context/graph/knowledge-graph.json +132 -0
  505. package/test-projects/nestjs-backend/ai-context/graph/module-graph.json +29 -0
  506. package/test-projects/nestjs-backend/ai-context/graph/symbol-graph.json +304 -0
  507. package/test-projects/nestjs-backend/ai-context/graph/symbol-references.json +5 -0
  508. package/test-projects/nestjs-backend/ai-context/index-state.json +294 -0
  509. package/test-projects/nestjs-backend/ai-context/index.db +0 -0
  510. package/test-projects/nestjs-backend/ai-context/modules.json +19 -0
  511. package/test-projects/nestjs-backend/ai-context/project.json +18 -0
  512. package/test-projects/nestjs-backend/ai-context/repo_map.json +427 -0
  513. package/test-projects/nestjs-backend/ai-context/repo_map.md +104 -0
  514. package/test-projects/nestjs-backend/ai-context/schema.json +5 -0
  515. package/test-projects/nestjs-backend/ai-context/summary.md +13 -0
  516. package/test-projects/nestjs-backend/ai-context/symbols.json +1 -0
  517. package/test-projects/nestjs-backend/ai-context/tech_stack.md +38 -0
  518. package/test-projects/nestjs-backend/ai-context/tools.json +10 -0
  519. package/test-projects/nestjs-backend/package.json +22 -0
  520. package/test-projects/nestjs-backend/src/app.module.ts +8 -0
  521. package/test-projects/nestjs-backend/src/auth/auth.controller.ts +22 -0
  522. package/test-projects/nestjs-backend/src/auth/auth.module.ts +11 -0
  523. package/test-projects/nestjs-backend/src/auth/auth.service.ts +28 -0
  524. package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +4 -0
  525. package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +18 -0
  526. package/test-projects/nestjs-backend/src/main.ts +9 -0
  527. package/test-projects/nestjs-backend/src/users/users.controller.ts +32 -0
  528. package/test-projects/nestjs-backend/src/users/users.module.ts +10 -0
  529. package/test-projects/nestjs-backend/src/users/users.service.ts +42 -0
  530. package/test-projects/nestjs-backend/tsconfig.json +21 -0
  531. package/test-projects/python-cli/.ai-dev/ai_context.md +95 -0
  532. package/test-projects/python-cli/.ai-dev/ai_rules.md +47 -0
  533. package/test-projects/python-cli/.ai-dev/architecture.md +55 -0
  534. package/test-projects/python-cli/.ai-dev/cache.json +149 -0
  535. package/test-projects/python-cli/.ai-dev/context/features/cli.json +16 -0
  536. package/test-projects/python-cli/.ai-dev/context/flows/list_.json +9 -0
  537. package/test-projects/python-cli/.ai-dev/context/flows/remove_.json +9 -0
  538. package/test-projects/python-cli/.ai-dev/conventions.md +51 -0
  539. package/test-projects/python-cli/.ai-dev/dependencies.json +66 -0
  540. package/test-projects/python-cli/.ai-dev/entrypoints.md +4 -0
  541. package/test-projects/python-cli/.ai-dev/files.json +184 -0
  542. package/test-projects/python-cli/.ai-dev/graph/knowledge-graph.json +83 -0
  543. package/test-projects/python-cli/.ai-dev/graph/module-graph.json +31 -0
  544. package/test-projects/python-cli/.ai-dev/graph/symbol-graph.json +358 -0
  545. package/test-projects/python-cli/.ai-dev/graph/symbol-references.json +11 -0
  546. package/test-projects/python-cli/.ai-dev/index-state.json +259 -0
  547. package/test-projects/python-cli/.ai-dev/index.db +0 -0
  548. package/test-projects/python-cli/.ai-dev/modules.json +21 -0
  549. package/test-projects/python-cli/.ai-dev/project.json +15 -0
  550. package/test-projects/python-cli/.ai-dev/repo_map.json +367 -0
  551. package/test-projects/python-cli/.ai-dev/repo_map.md +93 -0
  552. package/test-projects/python-cli/.ai-dev/schema.json +5 -0
  553. package/test-projects/python-cli/.ai-dev/summary.md +14 -0
  554. package/test-projects/python-cli/.ai-dev/symbols.json +1 -0
  555. package/test-projects/python-cli/.ai-dev/tech_stack.md +32 -0
  556. package/test-projects/python-cli/.ai-dev/tools.json +10 -0
  557. package/test-projects/python-cli/__init__.py +1 -0
  558. package/test-projects/python-cli/ai-context/ai_context.md +95 -0
  559. package/test-projects/python-cli/ai-context/ai_rules.md +47 -0
  560. package/test-projects/python-cli/ai-context/architecture.md +55 -0
  561. package/test-projects/python-cli/ai-context/cache.json +149 -0
  562. package/test-projects/python-cli/ai-context/context/features/cli.json +16 -0
  563. package/test-projects/python-cli/ai-context/context/flows/list_.json +9 -0
  564. package/test-projects/python-cli/ai-context/context/flows/remove_.json +9 -0
  565. package/test-projects/python-cli/ai-context/conventions.md +51 -0
  566. package/test-projects/python-cli/ai-context/dependencies.json +66 -0
  567. package/test-projects/python-cli/ai-context/entrypoints.md +4 -0
  568. package/test-projects/python-cli/ai-context/files.json +184 -0
  569. package/test-projects/python-cli/ai-context/graph/knowledge-graph.json +83 -0
  570. package/test-projects/python-cli/ai-context/graph/module-graph.json +31 -0
  571. package/test-projects/python-cli/ai-context/graph/symbol-graph.json +358 -0
  572. package/test-projects/python-cli/ai-context/graph/symbol-references.json +11 -0
  573. package/test-projects/python-cli/ai-context/index-state.json +259 -0
  574. package/test-projects/python-cli/ai-context/index.db +0 -0
  575. package/test-projects/python-cli/ai-context/modules.json +21 -0
  576. package/test-projects/python-cli/ai-context/project.json +15 -0
  577. package/test-projects/python-cli/ai-context/repo_map.json +367 -0
  578. package/test-projects/python-cli/ai-context/repo_map.md +93 -0
  579. package/test-projects/python-cli/ai-context/schema.json +5 -0
  580. package/test-projects/python-cli/ai-context/summary.md +14 -0
  581. package/test-projects/python-cli/ai-context/symbols.json +1 -0
  582. package/test-projects/python-cli/ai-context/tech_stack.md +32 -0
  583. package/test-projects/python-cli/ai-context/tools.json +10 -0
  584. package/test-projects/python-cli/cli/__init__.py +1 -0
  585. package/test-projects/python-cli/cli/add_command.py +6 -0
  586. package/test-projects/python-cli/cli/list_command.py +7 -0
  587. package/test-projects/python-cli/cli/remove_command.py +6 -0
  588. package/test-projects/python-cli/main.py +34 -0
  589. package/test-projects/python-cli/models/__init__.py +2 -0
  590. package/test-projects/python-cli/models/task.py +19 -0
  591. package/test-projects/python-cli/models/task_repository.py +44 -0
  592. package/test-projects/rails-app/.ai-dev/ai_context.md +94 -0
  593. package/test-projects/rails-app/.ai-dev/ai_rules.md +47 -0
  594. package/test-projects/rails-app/.ai-dev/architecture.md +49 -0
  595. package/test-projects/rails-app/.ai-dev/cache.json +193 -0
  596. package/test-projects/rails-app/.ai-dev/context/features/app.json +24 -0
  597. package/test-projects/rails-app/.ai-dev/context/features/config.json +13 -0
  598. package/test-projects/rails-app/.ai-dev/context/flows/application.json +9 -0
  599. package/test-projects/rails-app/.ai-dev/context/flows/application_.json +9 -0
  600. package/test-projects/rails-app/.ai-dev/context/flows/comments.json +11 -0
  601. package/test-projects/rails-app/.ai-dev/context/flows/comments_.json +11 -0
  602. package/test-projects/rails-app/.ai-dev/context/flows/posts.json +11 -0
  603. package/test-projects/rails-app/.ai-dev/context/flows/posts_.json +11 -0
  604. package/test-projects/rails-app/.ai-dev/context/flows/routes.json +9 -0
  605. package/test-projects/rails-app/.ai-dev/context/flows/users.json +11 -0
  606. package/test-projects/rails-app/.ai-dev/context/flows/users_.json +11 -0
  607. package/test-projects/rails-app/.ai-dev/conventions.md +51 -0
  608. package/test-projects/rails-app/.ai-dev/dependencies.json +6 -0
  609. package/test-projects/rails-app/.ai-dev/entrypoints.md +4 -0
  610. package/test-projects/rails-app/.ai-dev/files.json +239 -0
  611. package/test-projects/rails-app/.ai-dev/graph/knowledge-graph.json +130 -0
  612. package/test-projects/rails-app/.ai-dev/graph/module-graph.json +27 -0
  613. package/test-projects/rails-app/.ai-dev/graph/symbol-graph.json +5 -0
  614. package/test-projects/rails-app/.ai-dev/graph/symbol-references.json +1 -0
  615. package/test-projects/rails-app/.ai-dev/index-state.json +336 -0
  616. package/test-projects/rails-app/.ai-dev/index.db +0 -0
  617. package/test-projects/rails-app/.ai-dev/modules.json +26 -0
  618. package/test-projects/rails-app/.ai-dev/project.json +22 -0
  619. package/test-projects/rails-app/.ai-dev/repo_map.json +486 -0
  620. package/test-projects/rails-app/.ai-dev/repo_map.md +117 -0
  621. package/test-projects/rails-app/.ai-dev/schema.json +5 -0
  622. package/test-projects/rails-app/.ai-dev/summary.md +13 -0
  623. package/test-projects/rails-app/.ai-dev/symbols.json +1 -0
  624. package/test-projects/rails-app/.ai-dev/tech_stack.md +32 -0
  625. package/test-projects/rails-app/.ai-dev/tools.json +10 -0
  626. package/test-projects/rails-app/Gemfile +38 -0
  627. package/test-projects/rails-app/README.md +140 -0
  628. package/test-projects/rails-app/Rakefile +8 -0
  629. package/test-projects/rails-app/ai-context/ai_context.md +94 -0
  630. package/test-projects/rails-app/ai-context/ai_rules.md +47 -0
  631. package/test-projects/rails-app/ai-context/architecture.md +49 -0
  632. package/test-projects/rails-app/ai-context/cache.json +193 -0
  633. package/test-projects/rails-app/ai-context/context/features/app.json +24 -0
  634. package/test-projects/rails-app/ai-context/context/features/config.json +13 -0
  635. package/test-projects/rails-app/ai-context/context/flows/application.json +9 -0
  636. package/test-projects/rails-app/ai-context/context/flows/application_.json +9 -0
  637. package/test-projects/rails-app/ai-context/context/flows/comments.json +11 -0
  638. package/test-projects/rails-app/ai-context/context/flows/comments_.json +11 -0
  639. package/test-projects/rails-app/ai-context/context/flows/posts.json +11 -0
  640. package/test-projects/rails-app/ai-context/context/flows/posts_.json +11 -0
  641. package/test-projects/rails-app/ai-context/context/flows/routes.json +9 -0
  642. package/test-projects/rails-app/ai-context/context/flows/users.json +11 -0
  643. package/test-projects/rails-app/ai-context/context/flows/users_.json +11 -0
  644. package/test-projects/rails-app/ai-context/conventions.md +51 -0
  645. package/test-projects/rails-app/ai-context/dependencies.json +6 -0
  646. package/test-projects/rails-app/ai-context/entrypoints.md +4 -0
  647. package/test-projects/rails-app/ai-context/files.json +239 -0
  648. package/test-projects/rails-app/ai-context/graph/knowledge-graph.json +130 -0
  649. package/test-projects/rails-app/ai-context/graph/module-graph.json +27 -0
  650. package/test-projects/rails-app/ai-context/graph/symbol-graph.json +5 -0
  651. package/test-projects/rails-app/ai-context/graph/symbol-references.json +1 -0
  652. package/test-projects/rails-app/ai-context/index-state.json +336 -0
  653. package/test-projects/rails-app/ai-context/index.db +0 -0
  654. package/test-projects/rails-app/ai-context/modules.json +26 -0
  655. package/test-projects/rails-app/ai-context/project.json +22 -0
  656. package/test-projects/rails-app/ai-context/repo_map.json +486 -0
  657. package/test-projects/rails-app/ai-context/repo_map.md +117 -0
  658. package/test-projects/rails-app/ai-context/schema.json +5 -0
  659. package/test-projects/rails-app/ai-context/summary.md +13 -0
  660. package/test-projects/rails-app/ai-context/symbols.json +1 -0
  661. package/test-projects/rails-app/ai-context/tech_stack.md +32 -0
  662. package/test-projects/rails-app/ai-context/tools.json +10 -0
  663. package/test-projects/rails-app/app/controllers/api/comments_controller.rb +75 -0
  664. package/test-projects/rails-app/app/controllers/api/posts_controller.rb +68 -0
  665. package/test-projects/rails-app/app/controllers/api/users_controller.rb +54 -0
  666. package/test-projects/rails-app/app/controllers/application_controller.rb +31 -0
  667. package/test-projects/rails-app/app/models/comment.rb +34 -0
  668. package/test-projects/rails-app/app/models/post.rb +36 -0
  669. package/test-projects/rails-app/app/models/user.rb +28 -0
  670. package/test-projects/rails-app/app/services/post_service.rb +92 -0
  671. package/test-projects/rails-app/app/services/user_service.rb +76 -0
  672. package/test-projects/rails-app/config/application.rb +27 -0
  673. package/test-projects/rails-app/config/environment.rb +7 -0
  674. package/test-projects/rails-app/config/routes.rb +15 -0
  675. package/test-projects/react-app/.ai-dev/ai_context.md +96 -0
  676. package/test-projects/react-app/.ai-dev/ai_rules.md +49 -0
  677. package/test-projects/react-app/.ai-dev/architecture.md +39 -0
  678. package/test-projects/react-app/.ai-dev/cache.json +153 -0
  679. package/test-projects/react-app/.ai-dev/context/features/src.json +18 -0
  680. package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +14 -0
  681. package/test-projects/react-app/.ai-dev/context/flows/dashboard.json +9 -0
  682. package/test-projects/react-app/.ai-dev/context/flows/login.json +9 -0
  683. package/test-projects/react-app/.ai-dev/context/flows/users.json +9 -0
  684. package/test-projects/react-app/.ai-dev/dependencies.json +128 -0
  685. package/test-projects/react-app/.ai-dev/entrypoints.md +4 -0
  686. package/test-projects/react-app/.ai-dev/files.json +189 -0
  687. package/test-projects/react-app/.ai-dev/graph/knowledge-graph.json +112 -0
  688. package/test-projects/react-app/.ai-dev/graph/module-graph.json +31 -0
  689. package/test-projects/react-app/.ai-dev/graph/symbol-graph.json +868 -0
  690. package/test-projects/react-app/.ai-dev/graph/symbol-references.json +31 -0
  691. package/test-projects/react-app/.ai-dev/index-state.json +266 -0
  692. package/test-projects/react-app/.ai-dev/index.db +0 -0
  693. package/test-projects/react-app/.ai-dev/modules.json +17 -0
  694. package/test-projects/react-app/.ai-dev/project.json +16 -0
  695. package/test-projects/react-app/.ai-dev/repo_map.json +391 -0
  696. package/test-projects/react-app/.ai-dev/repo_map.md +94 -0
  697. package/test-projects/react-app/.ai-dev/schema.json +5 -0
  698. package/test-projects/react-app/.ai-dev/summary.md +13 -0
  699. package/test-projects/react-app/.ai-dev/symbols.json +1 -0
  700. package/test-projects/react-app/.ai-dev/tech_stack.md +39 -0
  701. package/test-projects/react-app/.ai-dev/tools.json +10 -0
  702. package/test-projects/react-app/ai-context/ai_context.md +96 -0
  703. package/test-projects/react-app/ai-context/ai_rules.md +49 -0
  704. package/test-projects/react-app/ai-context/architecture.md +39 -0
  705. package/test-projects/react-app/ai-context/cache.json +153 -0
  706. package/test-projects/react-app/ai-context/context/features/src.json +18 -0
  707. package/test-projects/react-app/ai-context/context/flows/UsersPage.json +14 -0
  708. package/test-projects/react-app/ai-context/context/flows/dashboard.json +9 -0
  709. package/test-projects/react-app/ai-context/context/flows/login.json +9 -0
  710. package/test-projects/react-app/ai-context/context/flows/users.json +9 -0
  711. package/test-projects/react-app/ai-context/conventions.md +52 -0
  712. package/test-projects/react-app/ai-context/dependencies.json +128 -0
  713. package/test-projects/react-app/ai-context/entrypoints.md +4 -0
  714. package/test-projects/react-app/ai-context/files.json +189 -0
  715. package/test-projects/react-app/ai-context/graph/knowledge-graph.json +112 -0
  716. package/test-projects/react-app/ai-context/graph/module-graph.json +31 -0
  717. package/test-projects/react-app/ai-context/graph/symbol-graph.json +868 -0
  718. package/test-projects/react-app/ai-context/graph/symbol-references.json +31 -0
  719. package/test-projects/react-app/ai-context/index-state.json +266 -0
  720. package/test-projects/react-app/ai-context/index.db +0 -0
  721. package/test-projects/react-app/ai-context/modules.json +17 -0
  722. package/test-projects/react-app/ai-context/project.json +16 -0
  723. package/test-projects/react-app/ai-context/repo_map.json +391 -0
  724. package/test-projects/react-app/ai-context/repo_map.md +94 -0
  725. package/test-projects/react-app/ai-context/schema.json +5 -0
  726. package/test-projects/react-app/ai-context/summary.md +13 -0
  727. package/test-projects/react-app/ai-context/symbols.json +1 -0
  728. package/test-projects/react-app/ai-context/tech_stack.md +39 -0
  729. package/test-projects/react-app/ai-context/tools.json +10 -0
  730. package/test-projects/react-app/package.json +16 -0
  731. package/test-projects/react-app/src/App.tsx +21 -0
  732. package/test-projects/react-app/src/context/AuthContext.tsx +41 -0
  733. package/test-projects/react-app/src/hooks/useAuth.ts +10 -0
  734. package/test-projects/react-app/src/main.tsx +10 -0
  735. package/test-projects/react-app/src/pages/DashboardPage.tsx +17 -0
  736. package/test-projects/react-app/src/pages/LoginPage.tsx +41 -0
  737. package/test-projects/react-app/src/pages/UsersPage.tsx +36 -0
  738. package/test-projects/react-app/src/services/userService.ts +37 -0
  739. package/test-projects/salesforce-cli/.ai-dev/ai_context.md +89 -0
  740. package/test-projects/salesforce-cli/.ai-dev/ai_rules.md +47 -0
  741. package/test-projects/salesforce-cli/.ai-dev/architecture.md +39 -0
  742. package/test-projects/salesforce-cli/.ai-dev/cache.json +125 -0
  743. package/test-projects/salesforce-cli/.ai-dev/context/features/force-app.json +14 -0
  744. package/test-projects/salesforce-cli/.ai-dev/context/flows/account.json +9 -0
  745. package/test-projects/salesforce-cli/.ai-dev/context/flows/opportunity.json +9 -0
  746. package/test-projects/salesforce-cli/.ai-dev/conventions.md +51 -0
  747. package/test-projects/salesforce-cli/.ai-dev/dependencies.json +6 -0
  748. package/test-projects/salesforce-cli/.ai-dev/entrypoints.md +4 -0
  749. package/test-projects/salesforce-cli/.ai-dev/files.json +154 -0
  750. package/test-projects/salesforce-cli/.ai-dev/graph/knowledge-graph.json +64 -0
  751. package/test-projects/salesforce-cli/.ai-dev/graph/module-graph.json +13 -0
  752. package/test-projects/salesforce-cli/.ai-dev/graph/symbol-graph.json +148 -0
  753. package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +1 -0
  754. package/test-projects/salesforce-cli/.ai-dev/index-state.json +217 -0
  755. package/test-projects/salesforce-cli/.ai-dev/index.db +0 -0
  756. package/test-projects/salesforce-cli/.ai-dev/modules.json +12 -0
  757. package/test-projects/salesforce-cli/.ai-dev/project.json +14 -0
  758. package/test-projects/salesforce-cli/.ai-dev/repo_map.json +328 -0
  759. package/test-projects/salesforce-cli/.ai-dev/repo_map.md +80 -0
  760. package/test-projects/salesforce-cli/.ai-dev/schema.json +5 -0
  761. package/test-projects/salesforce-cli/.ai-dev/summary.md +13 -0
  762. package/test-projects/salesforce-cli/.ai-dev/symbols.json +1 -0
  763. package/test-projects/salesforce-cli/.ai-dev/tech_stack.md +31 -0
  764. package/test-projects/salesforce-cli/.ai-dev/tools.json +10 -0
  765. package/test-projects/salesforce-cli/.forceignore +27 -0
  766. package/test-projects/salesforce-cli/ai-context/ai_context.md +89 -0
  767. package/test-projects/salesforce-cli/ai-context/ai_rules.md +47 -0
  768. package/test-projects/salesforce-cli/ai-context/architecture.md +39 -0
  769. package/test-projects/salesforce-cli/ai-context/cache.json +125 -0
  770. package/test-projects/salesforce-cli/ai-context/context/features/force-app.json +14 -0
  771. package/test-projects/salesforce-cli/ai-context/context/flows/account.json +9 -0
  772. package/test-projects/salesforce-cli/ai-context/context/flows/opportunity.json +9 -0
  773. package/test-projects/salesforce-cli/ai-context/conventions.md +51 -0
  774. package/test-projects/salesforce-cli/ai-context/dependencies.json +6 -0
  775. package/test-projects/salesforce-cli/ai-context/entrypoints.md +4 -0
  776. package/test-projects/salesforce-cli/ai-context/files.json +154 -0
  777. package/test-projects/salesforce-cli/ai-context/graph/knowledge-graph.json +64 -0
  778. package/test-projects/salesforce-cli/ai-context/graph/module-graph.json +13 -0
  779. package/test-projects/salesforce-cli/ai-context/graph/symbol-graph.json +148 -0
  780. package/test-projects/salesforce-cli/ai-context/graph/symbol-references.json +1 -0
  781. package/test-projects/salesforce-cli/ai-context/index-state.json +217 -0
  782. package/test-projects/salesforce-cli/ai-context/index.db +0 -0
  783. package/test-projects/salesforce-cli/ai-context/modules.json +12 -0
  784. package/test-projects/salesforce-cli/ai-context/project.json +14 -0
  785. package/test-projects/salesforce-cli/ai-context/repo_map.json +328 -0
  786. package/test-projects/salesforce-cli/ai-context/repo_map.md +80 -0
  787. package/test-projects/salesforce-cli/ai-context/schema.json +5 -0
  788. package/test-projects/salesforce-cli/ai-context/summary.md +13 -0
  789. package/test-projects/salesforce-cli/ai-context/symbols.json +1 -0
  790. package/test-projects/salesforce-cli/ai-context/tech_stack.md +31 -0
  791. package/test-projects/salesforce-cli/ai-context/tools.json +10 -0
  792. package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +24 -0
  793. package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +25 -0
  794. package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +45 -0
  795. package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +33 -0
  796. package/test-projects/salesforce-cli/sfdx-project.json +11 -0
  797. package/test-projects/spring-boot-app/.ai-dev/ai_context.md +91 -0
  798. package/test-projects/spring-boot-app/.ai-dev/ai_rules.md +48 -0
  799. package/test-projects/spring-boot-app/.ai-dev/architecture.md +39 -0
  800. package/test-projects/spring-boot-app/.ai-dev/cache.json +173 -0
  801. package/test-projects/spring-boot-app/.ai-dev/context/features/src.json +26 -0
  802. package/test-projects/spring-boot-app/.ai-dev/context/flows/PostController.json +19 -0
  803. package/test-projects/spring-boot-app/.ai-dev/context/flows/UserController.json +19 -0
  804. package/test-projects/spring-boot-app/.ai-dev/context/flows/comment.json +11 -0
  805. package/test-projects/spring-boot-app/.ai-dev/context/flows/post.json +14 -0
  806. package/test-projects/spring-boot-app/.ai-dev/context/flows/user.json +14 -0
  807. package/test-projects/spring-boot-app/.ai-dev/conventions.md +52 -0
  808. package/test-projects/spring-boot-app/.ai-dev/dependencies.json +326 -0
  809. package/test-projects/spring-boot-app/.ai-dev/entrypoints.md +4 -0
  810. package/test-projects/spring-boot-app/.ai-dev/files.json +214 -0
  811. package/test-projects/spring-boot-app/.ai-dev/graph/knowledge-graph.json +231 -0
  812. package/test-projects/spring-boot-app/.ai-dev/graph/module-graph.json +22 -0
  813. package/test-projects/spring-boot-app/.ai-dev/graph/symbol-graph.json +794 -0
  814. package/test-projects/spring-boot-app/.ai-dev/graph/symbol-references.json +70 -0
  815. package/test-projects/spring-boot-app/.ai-dev/index-state.json +301 -0
  816. package/test-projects/spring-boot-app/.ai-dev/index.db +0 -0
  817. package/test-projects/spring-boot-app/.ai-dev/modules.json +21 -0
  818. package/test-projects/spring-boot-app/.ai-dev/project.json +17 -0
  819. package/test-projects/spring-boot-app/.ai-dev/repo_map.json +461 -0
  820. package/test-projects/spring-boot-app/.ai-dev/repo_map.md +109 -0
  821. package/test-projects/spring-boot-app/.ai-dev/schema.json +5 -0
  822. package/test-projects/spring-boot-app/.ai-dev/summary.md +12 -0
  823. package/test-projects/spring-boot-app/.ai-dev/symbols.json +1 -0
  824. package/test-projects/spring-boot-app/.ai-dev/tech_stack.md +32 -0
  825. package/test-projects/spring-boot-app/.ai-dev/tools.json +10 -0
  826. package/test-projects/spring-boot-app/.classpath +57 -0
  827. package/test-projects/spring-boot-app/.factorypath +69 -0
  828. package/test-projects/spring-boot-app/.project +34 -0
  829. package/test-projects/spring-boot-app/.settings/org.eclipse.core.resources.prefs +4 -0
  830. package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.apt.core.prefs +4 -0
  831. package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.core.prefs +10 -0
  832. package/test-projects/spring-boot-app/.settings/org.eclipse.m2e.core.prefs +4 -0
  833. package/test-projects/spring-boot-app/README.md +122 -0
  834. package/test-projects/spring-boot-app/ai-context/ai_context.md +91 -0
  835. package/test-projects/spring-boot-app/ai-context/ai_rules.md +48 -0
  836. package/test-projects/spring-boot-app/ai-context/architecture.md +39 -0
  837. package/test-projects/spring-boot-app/ai-context/cache.json +173 -0
  838. package/test-projects/spring-boot-app/ai-context/context/features/src.json +26 -0
  839. package/test-projects/spring-boot-app/ai-context/context/flows/PostController.json +19 -0
  840. package/test-projects/spring-boot-app/ai-context/context/flows/UserController.json +19 -0
  841. package/test-projects/spring-boot-app/ai-context/context/flows/comment.json +11 -0
  842. package/test-projects/spring-boot-app/ai-context/context/flows/post.json +14 -0
  843. package/test-projects/spring-boot-app/ai-context/context/flows/user.json +14 -0
  844. package/test-projects/spring-boot-app/ai-context/conventions.md +52 -0
  845. package/test-projects/spring-boot-app/ai-context/dependencies.json +326 -0
  846. package/test-projects/spring-boot-app/ai-context/entrypoints.md +4 -0
  847. package/test-projects/spring-boot-app/ai-context/files.json +214 -0
  848. package/test-projects/spring-boot-app/ai-context/graph/knowledge-graph.json +231 -0
  849. package/test-projects/spring-boot-app/ai-context/graph/module-graph.json +22 -0
  850. package/test-projects/spring-boot-app/ai-context/graph/symbol-graph.json +794 -0
  851. package/test-projects/spring-boot-app/ai-context/graph/symbol-references.json +70 -0
  852. package/test-projects/spring-boot-app/ai-context/index-state.json +301 -0
  853. package/test-projects/spring-boot-app/ai-context/index.db +0 -0
  854. package/test-projects/spring-boot-app/ai-context/modules.json +21 -0
  855. package/test-projects/spring-boot-app/ai-context/project.json +17 -0
  856. package/test-projects/spring-boot-app/ai-context/repo_map.json +461 -0
  857. package/test-projects/spring-boot-app/ai-context/repo_map.md +109 -0
  858. package/test-projects/spring-boot-app/ai-context/schema.json +5 -0
  859. package/test-projects/spring-boot-app/ai-context/summary.md +12 -0
  860. package/test-projects/spring-boot-app/ai-context/symbols.json +1 -0
  861. package/test-projects/spring-boot-app/ai-context/tech_stack.md +32 -0
  862. package/test-projects/spring-boot-app/ai-context/tools.json +10 -0
  863. package/test-projects/spring-boot-app/pom.xml +79 -0
  864. package/test-projects/spring-boot-app/src/main/java/com/example/demo/DemoApplication.java +12 -0
  865. package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/CommentController.java +89 -0
  866. package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java +92 -0
  867. package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java +84 -0
  868. package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Comment.java +38 -0
  869. package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Post.java +56 -0
  870. package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/User.java +44 -0
  871. package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/CommentRepository.java +21 -0
  872. package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/PostRepository.java +18 -0
  873. package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/UserRepository.java +15 -0
  874. package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/PostService.java +83 -0
  875. package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/UserService.java +62 -0
  876. package/test-projects/spring-boot-app/src/main/resources/application.properties +22 -0
  877. package/test-projects/spring-boot-app/target/classes/com/example/demo/DemoApplication.class +0 -0
  878. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentCreateRequest.class +0 -0
  879. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentUpdateRequest.class +0 -0
  880. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController.class +0 -0
  881. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostCreateRequest.class +0 -0
  882. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostUpdateRequest.class +0 -0
  883. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController.class +0 -0
  884. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserCreateRequest.class +0 -0
  885. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserUpdateRequest.class +0 -0
  886. package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController.class +0 -0
  887. package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Comment.class +0 -0
  888. package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Post.class +0 -0
  889. package/test-projects/spring-boot-app/target/classes/com/example/demo/models/User.class +0 -0
  890. package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/CommentRepository.class +0 -0
  891. package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/PostRepository.class +0 -0
  892. package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/UserRepository.class +0 -0
  893. package/test-projects/spring-boot-app/target/classes/com/example/demo/services/PostService.class +0 -0
  894. package/test-projects/spring-boot-app/target/classes/com/example/demo/services/UserService.class +0 -0
  895. package/test_adapters.mjs +87 -0
  896. package/tests/e2e/README.md +85 -0
  897. package/tests/e2e/run-e2e.sh +88 -0
  898. package/tests/phase2-fixes.test.ts +200 -0
  899. package/tests/semanticContexts.test.ts +23 -25
  900. package/ai/cache.json +0 -329
  901. package/ai/dependencies.json +0 -307
  902. package/ai/files.json +0 -1253
  903. package/ai/graph/module-graph.json +0 -119
  904. package/ai/graph/symbol-graph.json +0 -52738
  905. package/ai/graph/symbol-references.json +0 -1810
  906. package/ai/hierarchy.json +0 -28
  907. package/ai/index-state.json +0 -931
  908. package/ai/index.db +0 -0
  909. package/ai/modules.json +0 -73
  910. package/ai/repo-map.json +0 -833
  911. package/ai/repo_map.json +0 -833
  912. package/ai/repo_map.md +0 -211
  913. package/ai/summary.md +0 -23
  914. /package/{ai → .ai-dev}/ccp/jira-123/context.json +0 -0
  915. /package/{ai → .ai-dev}/context/repo.json +0 -0
  916. /package/{ai → .ai-dev}/context/utils.json +0 -0
  917. /package/{ai → .ai-dev}/embeddings.json +0 -0
  918. /package/{ai → .ai-dev}/git/commit-activity.json +0 -0
  919. /package/{ai → .ai-dev}/git/recent-features.json +0 -0
  920. /package/{ai → .ai-dev}/git/recent-files.json +0 -0
  921. /package/{ai → .ai-dev}/git/recent-flows.json +0 -0
  922. /package/{ai/symbols.json → ai-context/git/recent-features.json} +0 -0
  923. /package/{ai → test-projects/react-app/.ai-dev}/conventions.md +0 -0
@@ -0,0 +1,69 @@
1
+ """Blog application serializers."""
2
+
3
+ from rest_framework import serializers
4
+ from django.contrib.auth.models import User
5
+ from .models import Post, Comment, Category
6
+
7
+
8
+ class CategorySerializer(serializers.ModelSerializer):
9
+ """Serializer for Category model."""
10
+
11
+ class Meta:
12
+ model = Category
13
+ fields = ["id", "name", "description"]
14
+
15
+
16
+ class CommentSerializer(serializers.ModelSerializer):
17
+ """Serializer for Comment model."""
18
+
19
+ author_username = serializers.CharField(source="author.username", read_only=True)
20
+
21
+ class Meta:
22
+ model = Comment
23
+ fields = ["id", "post", "author", "author_username", "content", "created_at"]
24
+ read_only_fields = ["author"]
25
+
26
+
27
+ class PostSerializer(serializers.ModelSerializer):
28
+ """Serializer for Post model."""
29
+
30
+ author_username = serializers.CharField(source="author.username", read_only=True)
31
+ comments_count = serializers.IntegerField(source="comments.count", read_only=True)
32
+ categories = CategorySerializer(many=True, read_only=True)
33
+
34
+ class Meta:
35
+ model = Post
36
+ fields = [
37
+ "id",
38
+ "title",
39
+ "content",
40
+ "author",
41
+ "author_username",
42
+ "created_at",
43
+ "updated_at",
44
+ "published",
45
+ "comments_count",
46
+ "categories",
47
+ ]
48
+ read_only_fields = ["author"]
49
+
50
+
51
+ class PostCreateUpdateSerializer(serializers.ModelSerializer):
52
+ """Serializer for creating and updating posts."""
53
+
54
+ category_ids = serializers.ListField(
55
+ child=serializers.IntegerField(), write_only=True, required=False
56
+ )
57
+
58
+ class Meta:
59
+ model = Post
60
+ fields = ["id", "title", "content", "published", "category_ids"]
61
+
62
+ def create(self, validated_data):
63
+ """Create a new post with categories."""
64
+ category_ids = validated_data.pop("category_ids", [])
65
+ post = Post.objects.create(**validated_data)
66
+ if category_ids:
67
+ categories = Category.objects.filter(id__in=category_ids)
68
+ post.categories.set(categories)
69
+ return post
@@ -0,0 +1,14 @@
1
+ """Blog application URL configuration."""
2
+
3
+ from django.urls import path, include
4
+ from rest_framework.routers import DefaultRouter
5
+ from .views import PostViewSet, CommentViewSet, CategoryViewSet
6
+
7
+ router = DefaultRouter()
8
+ router.register(r"posts", PostViewSet)
9
+ router.register(r"comments", CommentViewSet)
10
+ router.register(r"categories", CategoryViewSet)
11
+
12
+ urlpatterns = [
13
+ path("", include(router.urls)),
14
+ ]
@@ -0,0 +1,96 @@
1
+ """Blog application views."""
2
+
3
+ from rest_framework import viewsets, status
4
+ from rest_framework.decorators import action
5
+ from rest_framework.response import Response
6
+ from rest_framework.permissions import IsAuthenticated, AllowAny
7
+ from django.contrib.auth.models import User
8
+ from .models import Post, Comment, Category
9
+ from .serializers import (
10
+ PostSerializer,
11
+ PostCreateUpdateSerializer,
12
+ CommentSerializer,
13
+ CategorySerializer,
14
+ )
15
+
16
+
17
+ class PostViewSet(viewsets.ModelViewSet):
18
+ """ViewSet for blog posts."""
19
+
20
+ queryset = Post.objects.all()
21
+ permission_classes = [IsAuthenticated]
22
+
23
+ def get_serializer_class(self):
24
+ """Return appropriate serializer class."""
25
+ if self.action in ["create", "update", "partial_update"]:
26
+ return PostCreateUpdateSerializer
27
+ return PostSerializer
28
+
29
+ def get_permissions(self):
30
+ """Allow anyone to view published posts."""
31
+ if self.action in ["list", "retrieve"]:
32
+ return [AllowAny()]
33
+ return [IsAuthenticated()]
34
+
35
+ def perform_create(self, serializer):
36
+ """Set the author to the current user."""
37
+ serializer.save(author=self.request.user)
38
+
39
+ @action(detail=True, methods=["post"])
40
+ def publish(self, request, pk=None):
41
+ """Publish a blog post."""
42
+ post = self.get_object()
43
+ post.publish()
44
+ return Response({"status": "post published"})
45
+
46
+ @action(detail=False, methods=["get"])
47
+ def my_posts(self, request):
48
+ """Get posts by current user."""
49
+ posts = Post.objects.filter(author=request.user)
50
+ serializer = PostSerializer(posts, many=True)
51
+ return Response(serializer.data)
52
+
53
+ @action(detail=False, methods=["get"])
54
+ def published(self, request):
55
+ """Get all published posts."""
56
+ posts = Post.objects.filter(published=True)
57
+ serializer = PostSerializer(posts, many=True)
58
+ return Response(serializer.data)
59
+
60
+
61
+ class CommentViewSet(viewsets.ModelViewSet):
62
+ """ViewSet for comments."""
63
+
64
+ queryset = Comment.objects.all()
65
+ serializer_class = CommentSerializer
66
+ permission_classes = [IsAuthenticated]
67
+
68
+ def perform_create(self, serializer):
69
+ """Set the author to the current user."""
70
+ serializer.save(author=self.request.user)
71
+
72
+ def get_queryset(self):
73
+ """Filter comments by post if provided."""
74
+ queryset = Comment.objects.all()
75
+ post_id = self.request.query_params.get("post", None)
76
+ if post_id:
77
+ queryset = queryset.filter(post_id=post_id)
78
+ return queryset
79
+
80
+
81
+ class CategoryViewSet(viewsets.ModelViewSet):
82
+ """ViewSet for categories."""
83
+
84
+ queryset = Category.objects.all()
85
+ serializer_class = CategorySerializer
86
+ permission_classes = [AllowAny]
87
+
88
+ @action(detail=True, methods=["get"])
89
+ def posts(self, request, pk=None):
90
+ """Get posts in this category."""
91
+ category = self.get_object()
92
+ posts = category.posts.filter(published=True)
93
+ from .serializers import PostSerializer
94
+
95
+ serializer = PostSerializer(posts, many=True)
96
+ return Response(serializer.data)
@@ -0,0 +1,90 @@
1
+ """
2
+ Django settings for django_app project.
3
+ """
4
+
5
+ from pathlib import Path
6
+
7
+ BASE_DIR = Path(__file__).resolve().parent.parent
8
+
9
+ SECRET_KEY = "django-insecure-test-key-not-for-production"
10
+
11
+ DEBUG = True
12
+
13
+ ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
14
+
15
+ INSTALLED_APPS = [
16
+ "django.contrib.admin",
17
+ "django.contrib.auth",
18
+ "django.contrib.contenttypes",
19
+ "django.contrib.sessions",
20
+ "django.contrib.messages",
21
+ "django.contrib.staticfiles",
22
+ "rest_framework",
23
+ "blog",
24
+ "users",
25
+ ]
26
+
27
+ MIDDLEWARE = [
28
+ "django.middleware.security.SecurityMiddleware",
29
+ "django.contrib.sessions.middleware.SessionMiddleware",
30
+ "django.middleware.common.CommonMiddleware",
31
+ "django.middleware.csrf.CsrfViewMiddleware",
32
+ "django.contrib.auth.middleware.AuthenticationMiddleware",
33
+ "django.contrib.messages.middleware.MessageMiddleware",
34
+ "django.middleware.clickjacking.XFrameOptionsMiddleware",
35
+ ]
36
+
37
+ ROOT_URLCONF = "django_app.urls"
38
+
39
+ TEMPLATES = [
40
+ {
41
+ "BACKEND": "django.template.backends.django.DjangoTemplates",
42
+ "DIRS": [],
43
+ "APP_DIRS": True,
44
+ "OPTIONS": {
45
+ "context_processors": [
46
+ "django.template.context_processors.debug",
47
+ "django.template.context_processors.request",
48
+ "django.contrib.auth.context_processors.auth",
49
+ "django.contrib.messages.context_processors.messages",
50
+ ],
51
+ },
52
+ },
53
+ ]
54
+
55
+ WSGI_APPLICATION = "django_app.wsgi.application"
56
+
57
+ DATABASES = {
58
+ "default": {
59
+ "ENGINE": "django.db.backends.sqlite3",
60
+ "NAME": BASE_DIR / "db.sqlite3",
61
+ }
62
+ }
63
+
64
+ AUTH_PASSWORD_VALIDATORS = [
65
+ {
66
+ "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
67
+ },
68
+ {
69
+ "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
70
+ },
71
+ ]
72
+
73
+ LANGUAGE_CODE = "en-us"
74
+ TIME_ZONE = "UTC"
75
+ USE_I18N = True
76
+ USE_TZ = True
77
+
78
+ STATIC_URL = "static/"
79
+
80
+ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
81
+
82
+ REST_FRAMEWORK = {
83
+ "DEFAULT_AUTHENTICATION_CLASSES": [
84
+ "rest_framework.authentication.SessionAuthentication",
85
+ "rest_framework.authentication.TokenAuthentication",
86
+ ],
87
+ "DEFAULT_PERMISSION_CLASSES": [
88
+ "rest_framework.permissions.IsAuthenticated",
89
+ ],
90
+ }
@@ -0,0 +1,11 @@
1
+ """django_app URL configuration."""
2
+
3
+ from django.contrib import admin
4
+ from django.urls import path, include
5
+
6
+ urlpatterns = [
7
+ path("admin/", admin.site.urls),
8
+ path("api/blog/", include("blog.urls")),
9
+ path("api/users/", include("users.urls")),
10
+ path("api-auth/", include("rest_framework.urls")),
11
+ ]
@@ -0,0 +1,9 @@
1
+ """WSGI config for django_app project."""
2
+
3
+ import os
4
+
5
+ from django.core.wsgi import get_wsgi_application
6
+
7
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_app.settings")
8
+
9
+ application = get_wsgi_application()
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env python
2
+ """Django's command-line utility for administrative tasks."""
3
+
4
+ import os
5
+ import sys
6
+
7
+
8
+ def main():
9
+ """Run administrative tasks."""
10
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_app.settings")
11
+ try:
12
+ from django.core.management import execute_from_command_line
13
+ except ImportError as exc:
14
+ raise ImportError(
15
+ "Couldn't import Django. Are you sure it's installed and "
16
+ "available on your PYTHONPATH environment variable? Did you "
17
+ "forget to activate a virtual environment?"
18
+ ) from exc
19
+ execute_from_command_line(sys.argv)
20
+
21
+
22
+ if __name__ == "__main__":
23
+ main()
@@ -0,0 +1,3 @@
1
+ Django>=4.2.0,<5.0
2
+ djangorestframework>=3.14.0
3
+ Pillow>=10.0.0
File without changes
@@ -0,0 +1,42 @@
1
+ """Users application admin configuration."""
2
+
3
+ from django.contrib import admin
4
+ from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
5
+ from django.contrib.auth.models import User
6
+ from .models import UserProfile, Follow
7
+
8
+
9
+ class UserProfileInline(admin.StackedInline):
10
+ """Inline admin for UserProfile."""
11
+
12
+ model = UserProfile
13
+ can_delete = False
14
+ verbose_name_plural = "Profile"
15
+
16
+
17
+ class UserAdmin(BaseUserAdmin):
18
+ """Extended User admin with profile."""
19
+
20
+ inlines = [UserProfileInline]
21
+ list_display = [
22
+ "username",
23
+ "email",
24
+ "first_name",
25
+ "last_name",
26
+ "is_staff",
27
+ "date_joined",
28
+ ]
29
+
30
+
31
+ # Re-register UserAdmin
32
+ admin.site.unregister(User)
33
+ admin.site.register(User, UserAdmin)
34
+
35
+
36
+ @admin.register(Follow)
37
+ class FollowAdmin(admin.ModelAdmin):
38
+ """Admin configuration for Follow model."""
39
+
40
+ list_display = ["follower", "following", "created_at"]
41
+ list_filter = ["created_at"]
42
+ search_fields = ["follower__username", "following__username"]
@@ -0,0 +1,54 @@
1
+ """Users application models."""
2
+
3
+ from django.db import models
4
+ from django.contrib.auth.models import User
5
+ from django.db.models.signals import post_save
6
+ from django.dispatch import receiver
7
+
8
+
9
+ class UserProfile(models.Model):
10
+ """Extended user profile model."""
11
+
12
+ user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="profile")
13
+ bio = models.TextField(max_length=500, blank=True)
14
+ location = models.CharField(max_length=100, blank=True)
15
+ birth_date = models.DateField(null=True, blank=True)
16
+ avatar = models.ImageField(upload_to="avatars/", blank=True)
17
+ website = models.URLField(blank=True)
18
+ twitter = models.CharField(max_length=100, blank=True)
19
+ github = models.CharField(max_length=100, blank=True)
20
+
21
+ def __str__(self):
22
+ return f"{self.user.username} Profile"
23
+
24
+
25
+ @receiver(post_save, sender=User)
26
+ def create_user_profile(sender, instance, created, **kwargs):
27
+ """Create a user profile when a new user is created."""
28
+ if created:
29
+ UserProfile.objects.create(user=instance)
30
+
31
+
32
+ @receiver(post_save, sender=User)
33
+ def save_user_profile(sender, instance, **kwargs):
34
+ """Save user profile when user is saved."""
35
+ instance.profile.save()
36
+
37
+
38
+ class Follow(models.Model):
39
+ """Follow relationship model."""
40
+
41
+ follower = models.ForeignKey(
42
+ User, on_delete=models.CASCADE, related_name="following"
43
+ )
44
+ following = models.ForeignKey(
45
+ User, on_delete=models.CASCADE, related_name="followers"
46
+ )
47
+ created_at = models.DateTimeField(auto_now_add=True)
48
+
49
+ class Meta:
50
+ unique_together = ["follower", "following"]
51
+ ordering = ["-created_at"]
52
+
53
+ def __str__(self):
54
+ return f"{self.follower.username} follows {self.following.username}"
@@ -0,0 +1,113 @@
1
+ """Users application serializers."""
2
+
3
+ from rest_framework import serializers
4
+ from django.contrib.auth.models import User
5
+ from .models import UserProfile, Follow
6
+
7
+
8
+ class UserProfileSerializer(serializers.ModelSerializer):
9
+ """Serializer for UserProfile model."""
10
+
11
+ class Meta:
12
+ model = UserProfile
13
+ fields = [
14
+ "bio",
15
+ "location",
16
+ "birth_date",
17
+ "avatar",
18
+ "website",
19
+ "twitter",
20
+ "github",
21
+ ]
22
+
23
+
24
+ class UserSerializer(serializers.ModelSerializer):
25
+ """Serializer for User model."""
26
+
27
+ profile = UserProfileSerializer()
28
+ posts_count = serializers.IntegerField(source="posts.count", read_only=True)
29
+ followers_count = serializers.IntegerField(source="followers.count", read_only=True)
30
+ following_count = serializers.IntegerField(source="following.count", read_only=True)
31
+
32
+ class Meta:
33
+ model = User
34
+ fields = [
35
+ "id",
36
+ "username",
37
+ "email",
38
+ "first_name",
39
+ "last_name",
40
+ "profile",
41
+ "posts_count",
42
+ "followers_count",
43
+ "following_count",
44
+ "date_joined",
45
+ ]
46
+ read_only_fields = ["date_joined"]
47
+
48
+
49
+ class UserCreateSerializer(serializers.ModelSerializer):
50
+ """Serializer for creating new users."""
51
+
52
+ password = serializers.CharField(write_only=True)
53
+ password_confirm = serializers.CharField(write_only=True)
54
+
55
+ class Meta:
56
+ model = User
57
+ fields = [
58
+ "username",
59
+ "email",
60
+ "password",
61
+ "password_confirm",
62
+ "first_name",
63
+ "last_name",
64
+ ]
65
+
66
+ def validate(self, data):
67
+ """Validate that passwords match."""
68
+ if data["password"] != data["password_confirm"]:
69
+ raise serializers.ValidationError("Passwords don't match")
70
+ return data
71
+
72
+ def create(self, validated_data):
73
+ """Create a new user."""
74
+ validated_data.pop("password_confirm")
75
+ user = User.objects.create_user(**validated_data)
76
+ return user
77
+
78
+
79
+ class FollowSerializer(serializers.ModelSerializer):
80
+ """Serializer for Follow model."""
81
+
82
+ follower_username = serializers.CharField(
83
+ source="follower.username", read_only=True
84
+ )
85
+ following_username = serializers.CharField(
86
+ source="following.username", read_only=True
87
+ )
88
+
89
+ class Meta:
90
+ model = Follow
91
+ fields = [
92
+ "id",
93
+ "follower",
94
+ "follower_username",
95
+ "following",
96
+ "following_username",
97
+ "created_at",
98
+ ]
99
+ read_only_fields = ["follower"]
100
+
101
+
102
+ class ChangePasswordSerializer(serializers.Serializer):
103
+ """Serializer for password change."""
104
+
105
+ old_password = serializers.CharField(required=True)
106
+ new_password = serializers.CharField(required=True)
107
+ new_password_confirm = serializers.CharField(required=True)
108
+
109
+ def validate(self, data):
110
+ """Validate new passwords match."""
111
+ if data["new_password"] != data["new_password_confirm"]:
112
+ raise serializers.ValidationError("New passwords don't match")
113
+ return data
@@ -0,0 +1,13 @@
1
+ """Users application URL configuration."""
2
+
3
+ from django.urls import path, include
4
+ from rest_framework.routers import DefaultRouter
5
+ from .views import UserViewSet, UserProfileViewSet
6
+
7
+ router = DefaultRouter()
8
+ router.register(r"users", UserViewSet)
9
+ router.register(r"profiles", UserProfileViewSet)
10
+
11
+ urlpatterns = [
12
+ path("", include(router.urls)),
13
+ ]
@@ -0,0 +1,135 @@
1
+ """Users application views."""
2
+
3
+ from rest_framework import viewsets, status, generics
4
+ from rest_framework.decorators import action
5
+ from rest_framework.response import Response
6
+ from rest_framework.permissions import IsAuthenticated, AllowAny
7
+ from django.contrib.auth.models import User
8
+ from django.contrib.auth import authenticate
9
+ from .models import UserProfile, Follow
10
+ from .serializers import (
11
+ UserSerializer,
12
+ UserCreateSerializer,
13
+ UserProfileSerializer,
14
+ FollowSerializer,
15
+ ChangePasswordSerializer,
16
+ )
17
+
18
+
19
+ class UserViewSet(viewsets.ModelViewSet):
20
+ """ViewSet for users."""
21
+
22
+ queryset = User.objects.all()
23
+ serializer_class = UserSerializer
24
+
25
+ def get_permissions(self):
26
+ """Allow anyone to register, but only authenticated users for other actions."""
27
+ if self.action == "create":
28
+ return [AllowAny()]
29
+ return [IsAuthenticated()]
30
+
31
+ def get_serializer_class(self):
32
+ """Return appropriate serializer class."""
33
+ if self.action == "create":
34
+ return UserCreateSerializer
35
+ return UserSerializer
36
+
37
+ @action(detail=False, methods=["get"])
38
+ def me(self, request):
39
+ """Get current user profile."""
40
+ serializer = UserSerializer(request.user)
41
+ return Response(serializer.data)
42
+
43
+ @action(detail=False, methods=["put", "patch"])
44
+ def update_profile(self, request):
45
+ """Update current user profile."""
46
+ user = request.user
47
+ profile = user.profile
48
+
49
+ # Update user data
50
+ user_serializer = UserSerializer(user, data=request.data, partial=True)
51
+ if user_serializer.is_valid():
52
+ user_serializer.save()
53
+
54
+ # Update profile data
55
+ if "profile" in request.data:
56
+ profile_serializer = UserProfileSerializer(
57
+ profile, data=request.data["profile"], partial=True
58
+ )
59
+ if profile_serializer.is_valid():
60
+ profile_serializer.save()
61
+
62
+ return Response(UserSerializer(user).data)
63
+
64
+ @action(detail=False, methods=["post"])
65
+ def change_password(self, request):
66
+ """Change user password."""
67
+ serializer = ChangePasswordSerializer(data=request.data)
68
+ if serializer.is_valid():
69
+ user = request.user
70
+ if user.check_password(serializer.validated_data["old_password"]):
71
+ user.set_password(serializer.validated_data["new_password"])
72
+ user.save()
73
+ return Response({"status": "password changed"})
74
+ return Response(
75
+ {"error": "Wrong old password"}, status=status.HTTP_400_BAD_REQUEST
76
+ )
77
+ return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
78
+
79
+ @action(detail=True, methods=["post"])
80
+ def follow(self, request, pk=None):
81
+ """Follow a user."""
82
+ user_to_follow = self.get_object()
83
+ if user_to_follow == request.user:
84
+ return Response(
85
+ {"error": "Cannot follow yourself"}, status=status.HTTP_400_BAD_REQUEST
86
+ )
87
+
88
+ follow, created = Follow.objects.get_or_create(
89
+ follower=request.user, following=user_to_follow
90
+ )
91
+
92
+ if created:
93
+ return Response({"status": "following"})
94
+ return Response({"status": "already following"})
95
+
96
+ @action(detail=True, methods=["post"])
97
+ def unfollow(self, request, pk=None):
98
+ """Unfollow a user."""
99
+ user_to_unfollow = self.get_object()
100
+ Follow.objects.filter(
101
+ follower=request.user, following=user_to_unfollow
102
+ ).delete()
103
+ return Response({"status": "unfollowed"})
104
+
105
+ @action(detail=True, methods=["get"])
106
+ def followers(self, request, pk=None):
107
+ """Get user followers."""
108
+ user = self.get_object()
109
+ followers = Follow.objects.filter(following=user)
110
+ serializer = FollowSerializer(followers, many=True)
111
+ return Response(serializer.data)
112
+
113
+ @action(detail=True, methods=["get"])
114
+ def following(self, request, pk=None):
115
+ """Get who user is following."""
116
+ user = self.get_object()
117
+ following = Follow.objects.filter(follower=user)
118
+ serializer = FollowSerializer(following, many=True)
119
+ return Response(serializer.data)
120
+
121
+
122
+ class UserProfileViewSet(viewsets.ModelViewSet):
123
+ """ViewSet for user profiles."""
124
+
125
+ queryset = UserProfile.objects.all()
126
+ serializer_class = UserProfileSerializer
127
+ permission_classes = [IsAuthenticated]
128
+
129
+ def get_queryset(self):
130
+ """Filter by user if provided."""
131
+ queryset = UserProfile.objects.all()
132
+ user_id = self.request.query_params.get("user", None)
133
+ if user_id:
134
+ queryset = queryset.filter(user_id=user_id)
135
+ return queryset