oneie 3.7.0 → 3.8.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 (1132) hide show
  1. package/README.md +9 -9
  2. package/dist/commands/agent.d.ts +2 -0
  3. package/dist/commands/agent.d.ts.map +1 -1
  4. package/dist/commands/agent.js +44 -0
  5. package/dist/commands/agent.js.map +1 -1
  6. package/dist/commands/bounty.d.ts +4 -0
  7. package/dist/commands/bounty.d.ts.map +1 -0
  8. package/dist/commands/bounty.js +24 -0
  9. package/dist/commands/bounty.js.map +1 -0
  10. package/dist/commands/capabilities.d.ts +4 -0
  11. package/dist/commands/capabilities.d.ts.map +1 -0
  12. package/dist/commands/capabilities.js +18 -0
  13. package/dist/commands/capabilities.js.map +1 -0
  14. package/dist/commands/commend.d.ts +4 -0
  15. package/dist/commands/commend.d.ts.map +1 -0
  16. package/dist/commands/commend.js +13 -0
  17. package/dist/commands/commend.js.map +1 -0
  18. package/dist/commands/completion.d.ts +4 -0
  19. package/dist/commands/completion.d.ts.map +1 -0
  20. package/dist/commands/completion.js +49 -0
  21. package/dist/commands/completion.js.map +1 -0
  22. package/dist/commands/config.d.ts +4 -0
  23. package/dist/commands/config.d.ts.map +1 -0
  24. package/dist/commands/config.js +78 -0
  25. package/dist/commands/config.js.map +1 -0
  26. package/dist/commands/doctor.d.ts +4 -0
  27. package/dist/commands/doctor.d.ts.map +1 -0
  28. package/dist/commands/doctor.js +72 -0
  29. package/dist/commands/doctor.js.map +1 -0
  30. package/dist/commands/export.d.ts +4 -0
  31. package/dist/commands/export.d.ts.map +1 -0
  32. package/dist/commands/export.js +15 -0
  33. package/dist/commands/export.js.map +1 -0
  34. package/dist/commands/fade.d.ts.map +1 -1
  35. package/dist/commands/fade.js +8 -4
  36. package/dist/commands/fade.js.map +1 -1
  37. package/dist/commands/flag.d.ts +4 -0
  38. package/dist/commands/flag.d.ts.map +1 -0
  39. package/dist/commands/flag.js +13 -0
  40. package/dist/commands/flag.js.map +1 -0
  41. package/dist/commands/health.d.ts +4 -0
  42. package/dist/commands/health.d.ts.map +1 -0
  43. package/dist/commands/health.js +11 -0
  44. package/dist/commands/health.js.map +1 -0
  45. package/dist/commands/highways.d.ts.map +1 -1
  46. package/dist/commands/highways.js +7 -4
  47. package/dist/commands/highways.js.map +1 -1
  48. package/dist/commands/hire.d.ts +4 -0
  49. package/dist/commands/hire.d.ts.map +1 -0
  50. package/dist/commands/hire.js +16 -0
  51. package/dist/commands/hire.js.map +1 -0
  52. package/dist/commands/init.d.ts.map +1 -1
  53. package/dist/commands/init.js +69 -42
  54. package/dist/commands/init.js.map +1 -1
  55. package/dist/commands/mark.d.ts.map +1 -1
  56. package/dist/commands/mark.js +7 -7
  57. package/dist/commands/mark.js.map +1 -1
  58. package/dist/commands/pay.d.ts +4 -0
  59. package/dist/commands/pay.d.ts.map +1 -0
  60. package/dist/commands/pay.js +21 -0
  61. package/dist/commands/pay.js.map +1 -0
  62. package/dist/commands/pipe.d.ts +4 -0
  63. package/dist/commands/pipe.d.ts.map +1 -0
  64. package/dist/commands/pipe.js +35 -0
  65. package/dist/commands/pipe.js.map +1 -0
  66. package/dist/commands/publish.d.ts +4 -0
  67. package/dist/commands/publish.d.ts.map +1 -0
  68. package/dist/commands/publish.js +23 -0
  69. package/dist/commands/publish.js.map +1 -0
  70. package/dist/commands/repl.d.ts +4 -0
  71. package/dist/commands/repl.d.ts.map +1 -0
  72. package/dist/commands/repl.js +56 -0
  73. package/dist/commands/repl.js.map +1 -0
  74. package/dist/commands/revenue.d.ts +4 -0
  75. package/dist/commands/revenue.d.ts.map +1 -0
  76. package/dist/commands/revenue.js +11 -0
  77. package/dist/commands/revenue.js.map +1 -0
  78. package/dist/commands/stats.d.ts +4 -0
  79. package/dist/commands/stats.d.ts.map +1 -0
  80. package/dist/commands/stats.js +11 -0
  81. package/dist/commands/stats.js.map +1 -0
  82. package/dist/commands/status.d.ts +4 -0
  83. package/dist/commands/status.d.ts.map +1 -0
  84. package/dist/commands/status.js +18 -0
  85. package/dist/commands/status.js.map +1 -0
  86. package/dist/commands/tail.d.ts +4 -0
  87. package/dist/commands/tail.d.ts.map +1 -0
  88. package/dist/commands/tail.js +51 -0
  89. package/dist/commands/tail.js.map +1 -0
  90. package/dist/commands/warn.d.ts.map +1 -1
  91. package/dist/commands/warn.js +6 -6
  92. package/dist/commands/warn.js.map +1 -1
  93. package/dist/index.js +61 -1
  94. package/dist/index.js.map +1 -1
  95. package/dist/lib/args.d.ts +1 -0
  96. package/dist/lib/args.d.ts.map +1 -1
  97. package/dist/lib/args.js +3 -0
  98. package/dist/lib/args.js.map +1 -1
  99. package/dist/lib/output.d.ts +5 -0
  100. package/dist/lib/output.d.ts.map +1 -0
  101. package/dist/lib/output.js +32 -0
  102. package/dist/lib/output.js.map +1 -0
  103. package/dist/lib/sdk.d.ts +10 -0
  104. package/dist/lib/sdk.d.ts.map +1 -0
  105. package/dist/lib/sdk.js +22 -0
  106. package/dist/lib/sdk.js.map +1 -0
  107. package/dist/utils/installation-setup.d.ts +15 -0
  108. package/dist/utils/installation-setup.d.ts.map +1 -1
  109. package/dist/utils/installation-setup.js +63 -0
  110. package/dist/utils/installation-setup.js.map +1 -1
  111. package/package.json +3 -18
  112. package/.claude/agents/TROUBLESHOOTING.md +0 -530
  113. package/.claude/agents/agent-backend.md +0 -574
  114. package/.claude/agents/agent-builder.md +0 -911
  115. package/.claude/agents/agent-claude.md +0 -645
  116. package/.claude/agents/agent-clean.md +0 -477
  117. package/.claude/agents/agent-clone.md +0 -554
  118. package/.claude/agents/agent-designer.md +0 -1080
  119. package/.claude/agents/agent-director.md +0 -2254
  120. package/.claude/agents/agent-documenter.md +0 -688
  121. package/.claude/agents/agent-frontend.md +0 -1199
  122. package/.claude/agents/agent-integrator.md +0 -670
  123. package/.claude/agents/agent-lawyer.md +0 -1320
  124. package/.claude/agents/agent-news.md +0 -363
  125. package/.claude/agents/agent-onboard.md +0 -613
  126. package/.claude/agents/agent-ontology.md +0 -585
  127. package/.claude/agents/agent-ops.md +0 -1275
  128. package/.claude/agents/agent-problem-solver.md +0 -669
  129. package/.claude/agents/agent-quality.md +0 -1042
  130. package/.claude/agents/agent-sales.md +0 -507
  131. package/.claude/agents/agent-writer.md +0 -1068
  132. package/.claude/commands/cascade.md +0 -742
  133. package/.claude/commands/chat.md +0 -728
  134. package/.claude/commands/commit.md +0 -95
  135. package/.claude/commands/create.md +0 -544
  136. package/.claude/commands/deploy.md +0 -309
  137. package/.claude/commands/fast.md +0 -636
  138. package/.claude/commands/mcp-on.md +0 -191
  139. package/.claude/commands/media-upload.md +0 -186
  140. package/.claude/commands/news.md +0 -274
  141. package/.claude/commands/onboard.md +0 -440
  142. package/.claude/commands/one.md +0 -398
  143. package/.claude/commands/optimize.md +0 -74
  144. package/.claude/commands/plan.md +0 -719
  145. package/.claude/commands/push.md +0 -214
  146. package/.claude/commands/release.md +0 -105
  147. package/.claude/commands/review.md +0 -99
  148. package/.claude/commands/server.md +0 -487
  149. package/.claude/commands/start.md +0 -227
  150. package/.claude/commands/test.md +0 -197
  151. package/.claude/commands/validate.md +0 -140
  152. package/.claude/hooks/.last-news-context +0 -1
  153. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
  154. package/.claude/hooks/README-knowledge-hooks.md +0 -451
  155. package/.claude/hooks/README-news-generation.md +0 -364
  156. package/.claude/hooks/README-root-cleanup.md +0 -200
  157. package/.claude/hooks/README.md +0 -284
  158. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  159. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  160. package/.claude/hooks/auto-format.sh +0 -106
  161. package/.claude/hooks/check-filenames.py +0 -177
  162. package/.claude/hooks/clean-post.py +0 -468
  163. package/.claude/hooks/clean-pre.py +0 -393
  164. package/.claude/hooks/clean-root-markdown.sh +0 -73
  165. package/.claude/hooks/commit-push.sh +0 -95
  166. package/.claude/hooks/done.py +0 -236
  167. package/.claude/hooks/format-hook.sh +0 -163
  168. package/.claude/hooks/formatting.py +0 -187
  169. package/.claude/hooks/hook-logger.sh +0 -173
  170. package/.claude/hooks/knowledge-post.py +0 -355
  171. package/.claude/hooks/knowledge-pre.py +0 -245
  172. package/.claude/hooks/mcp-on.sh +0 -134
  173. package/.claude/hooks/notification-hook.sh +0 -279
  174. package/.claude/hooks/ontology-validation.py +0 -255
  175. package/.claude/hooks/push.sh +0 -153
  176. package/.claude/hooks/release-cli.sh +0 -205
  177. package/.claude/hooks/root-cleanup.py +0 -217
  178. package/.claude/hooks/security-hook.sh +0 -397
  179. package/.claude/hooks/tag-all-docs.py +0 -464
  180. package/.claude/hooks/test-validate-ontology.sh +0 -170
  181. package/.claude/hooks/todo.py +0 -368
  182. package/.claude/hooks/track-changes.sh +0 -101
  183. package/.claude/hooks/validate-imports.py +0 -182
  184. package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
  185. package/.claude/hooks/validate-ontology-structure.py +0 -558
  186. package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
  187. package/.claude/hooks/validate-ontology.py +0 -140
  188. package/.claude/hooks/write-news.sh +0 -194
  189. package/.claude/skills/INDEX.md +0 -523
  190. package/.claude/skills/REGISTRY.md +0 -529
  191. package/.claude/skills/agent-backend-create-mutation.md +0 -319
  192. package/.claude/skills/agent-designer-create-wireframe.md +0 -341
  193. package/.claude/skills/agent-frontend-create-page.md +0 -413
  194. package/.claude/skills/agents/README.md +0 -238
  195. package/.claude/skills/astro/add-content-collection.md +0 -30
  196. package/.claude/skills/astro/check-build.md +0 -29
  197. package/.claude/skills/astro/create-component.md +0 -29
  198. package/.claude/skills/astro/create-page.md +0 -30
  199. package/.claude/skills/astro/optimize-performance.md +0 -21
  200. package/.claude/skills/convex/check-deployment.md +0 -46
  201. package/.claude/skills/convex/create-mutation.md +0 -405
  202. package/.claude/skills/convex/create-query.md +0 -52
  203. package/.claude/skills/convex/read-schema.md +0 -373
  204. package/.claude/skills/convex/test-function.md +0 -50
  205. package/.claude/skills/deployment/check-deployment-health.md +0 -20
  206. package/.claude/skills/deployment/create-release.md +0 -21
  207. package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
  208. package/.claude/skills/deployment/deploy-convex.md +0 -30
  209. package/.claude/skills/deployment/sync-repositories.md +0 -19
  210. package/.claude/skills/design/check-accessibility.md +0 -21
  211. package/.claude/skills/design/create-component-spec.md +0 -27
  212. package/.claude/skills/design/generate-design-tokens.md +0 -24
  213. package/.claude/skills/design/generate-wireframe.md +0 -30
  214. package/.claude/skills/documentation/create-migration-guide.md +0 -20
  215. package/.claude/skills/documentation/generate-api-docs.md +0 -27
  216. package/.claude/skills/documentation/generate-readme.md +0 -22
  217. package/.claude/skills/documentation/update-knowledge.md +0 -20
  218. package/.claude/skills/integration/connect-external-system.md +0 -21
  219. package/.claude/skills/integration/implement-a2a.md +0 -20
  220. package/.claude/skills/integration/implement-acp.md +0 -20
  221. package/.claude/skills/integration/verify-integration.md +0 -20
  222. package/.claude/skills/ontology/README.md +0 -255
  223. package/.claude/skills/ontology/check-dimension.md +0 -307
  224. package/.claude/skills/ontology/generate-entity-type.md +0 -339
  225. package/.claude/skills/ontology/validate-schema.md +0 -229
  226. package/.claude/skills/ontology/verify-relationships.md +0 -310
  227. package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
  228. package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
  229. package/.claude/skills/problem-solving/propose-solution.md +0 -29
  230. package/.claude/skills/problem-solving/verify-fix.md +0 -21
  231. package/.claude/skills/sales/generate-demo-script.md +0 -21
  232. package/.claude/skills/sales/qualify-lead.md +0 -30
  233. package/.claude/skills/sales/track-trial.md +0 -20
  234. package/.claude/skills/sales/verify-kyc.md +0 -20
  235. package/.claude/skills/testing/analyze-coverage.md +0 -24
  236. package/.claude/skills/testing/generate-tests.md +0 -24
  237. package/.claude/skills/testing/run-tests.md +0 -27
  238. package/.claude/skills/testing/validate-e2e.md +0 -25
  239. package/AGENTS.md +0 -60
  240. package/CLAUDE.md +0 -130
  241. package/CREATE-WEBSITE.md +0 -458
  242. package/SECURITY.md +0 -31
  243. package/folders.yaml +0 -92
  244. package/one/README.md +0 -760
  245. package/one/actors/anthony-o-connell.md +0 -469
  246. package/one/actors/people.md +0 -590
  247. package/one/events/0-changes.md +0 -2764
  248. package/one/events/1-PROJECTS-START-HERE.md +0 -384
  249. package/one/events/1-projects-developer-quickstart.md +0 -620
  250. package/one/events/1-projects-feature.md +0 -2047
  251. package/one/events/1-projects-team-briefing.md +0 -583
  252. package/one/events/2024-10-14-deployment-plan.md +0 -330
  253. package/one/events/2024-10-14-deployment-success.md +0 -447
  254. package/one/events/2024-10-14-final-sync-complete.md +0 -250
  255. package/one/events/2024-10-14-release-v2.0.6.md +0 -414
  256. package/one/events/2024-10-15-agent-clean-v2-summary.md +0 -495
  257. package/one/events/2024-10-15-handoff-to-clean.md +0 -347
  258. package/one/events/2024-10-15-package-manager-tests.md +0 -442
  259. package/one/events/2024-10-15-release-command-complete.md +0 -416
  260. package/one/events/2025-10-15-private-files-secured.md +0 -359
  261. package/one/events/2025-10-15-unignore-public-group-docs.md +0 -298
  262. package/one/events/2025-11-08-backend-claude-refactor.md +0 -242
  263. package/one/events/2025-11-08-parallel-agent-implementation.md +0 -620
  264. package/one/events/2025-11-10-ai-integration-status-report.md +0 -241
  265. package/one/events/ACCESSIBILITY_CHECKLIST.md +0 -275
  266. package/one/events/ACCESSIBILITY_FIXES_SUMMARY.md +0 -293
  267. package/one/events/ALIGNMENT_REPORT_PROBLEM_SOLVER.md +0 -335
  268. package/one/events/ALIGNMENT_SUMMARY.md +0 -280
  269. package/one/events/API_ROUTES_FIXES_SUMMARY.md +0 -280
  270. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +0 -654
  271. package/one/events/AUDIT-ONTOLOGY-ALIGNMENT.md +0 -598
  272. package/one/events/AUDIT_PLAN_COMPLETION-20251108-125555.md +0 -262
  273. package/one/events/BEFORE_AFTER_COMPARISON.md +0 -978
  274. package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +0 -372
  275. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +0 -430
  276. package/one/events/CHARTS-READY-TO-USE-20251106-080939.md +0 -184
  277. package/one/events/CHARTS-SUMMARY-20251106-080938.md +0 -196
  278. package/one/events/CLAUDE copy.md +0 -897
  279. package/one/events/CLEANUP-RELEASE-V2.0.8.md +0 -308
  280. package/one/events/CLOUDFLARE-FS-FIX-20251106-100516.md +0 -75
  281. package/one/events/COMPONENT_SHOWCASE-20251106-080938.md +0 -629
  282. package/one/events/CONNECTIONS_DEMO.md +0 -519
  283. package/one/events/CREATE-WEBSITE.md +0 -460
  284. package/one/events/CRITICAL-FIXES-COMPLETE.md +0 -571
  285. package/one/events/CUSTOM-DOMAIN.md +0 -375
  286. package/one/events/DELIVERABLES.md +0 -450
  287. package/one/events/DELIVERABLES.txt +0 -273
  288. package/one/events/DEMO-GROUPS-PAGE.md +0 -410
  289. package/one/events/DEMO-TESTING-SUMMARY.md +0 -536
  290. package/one/events/DEMO_COMPONENTS.md +0 -505
  291. package/one/events/DEMO_HOOKS_INDEX.md +0 -352
  292. package/one/events/DEMO_INFRASTRUCTURE.md +0 -923
  293. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +0 -588
  294. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +0 -449
  295. package/one/events/DEMO_QUICK_REFERENCE.md +0 -459
  296. package/one/events/DEMO_SETUP.md +0 -494
  297. package/one/events/DEPLOYMENT copy.md +0 -444
  298. package/one/events/DEPLOYMENT.md +0 -196
  299. package/one/events/DESIGN-DELIVERABLES-20251106-080938.md +0 -557
  300. package/one/events/DESIGN-EXECUTIVE-SUMMARY-20251106-080938.md +0 -484
  301. package/one/events/DOCS-SYSTEM-GUIDE-20251105-142103.md +0 -458
  302. package/one/events/DOCUMENTER-DELIVERY-SUMMARY.md +0 -481
  303. package/one/events/DOCUMENTER-EXECUTION-GUIDE.md +0 -394
  304. package/one/events/DOCUMENTER-TASK-BREAKDOWN.md +0 -783
  305. package/one/events/ECOMMERCE-BEFORE-AFTER.md +0 -267
  306. package/one/events/ECOMMERCE-DEMO-PLAN.md +0 -243
  307. package/one/events/ECOMMERCE-ENHANCEMENTS.md +0 -594
  308. package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +0 -439
  309. package/one/events/ECOMMERCE-LIVE-DEMO.md +0 -381
  310. package/one/events/ECOMMERCE-QUICKSTART.md +0 -376
  311. package/one/events/ECOMMERCE-README.md +0 -354
  312. package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +0 -214
  313. package/one/events/ECOMMERCE-SETUP-SUMMARY.md +0 -414
  314. package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +0 -753
  315. package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +0 -941
  316. package/one/events/EFFECT_TS_API_PATTERN.md +0 -496
  317. package/one/events/EXECUTION-READY.md +0 -359
  318. package/one/events/EXECUTION-SUMMARY.md +0 -478
  319. package/one/events/FEATURE-2-4-COMPLETE.md +0 -320
  320. package/one/events/FEATURE_2_3_COMPLETE.md +0 -593
  321. package/one/events/FILE-REFERENCE-20251105-142103.md +0 -325
  322. package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +0 -241
  323. package/one/events/GROUPS-MIGRATION.md +0 -643
  324. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +0 -432
  325. package/one/events/HANDOFF.md +0 -331
  326. package/one/events/HOOKS-DEMO.md +0 -459
  327. package/one/events/IMPLEMENTATION-CHECKLIST-20251105-142103.md +0 -274
  328. package/one/events/IMPLEMENTATION-REPORT-DOCS-20251105-142102.md +0 -394
  329. package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +0 -568
  330. package/one/events/IMPLEMENTATION_SUMMARY-20251106-080938.md +0 -571
  331. package/one/events/IMPLEMENTATION_SUMMARY.md +0 -547
  332. package/one/events/INDEX-ALL-AGENTS.md +0 -190
  333. package/one/events/INDEX-FRONTEND-TESTING.md +0 -524
  334. package/one/events/INDEX-PROBLEM-SOLVER.md +0 -488
  335. package/one/events/INDEX-QUALITY-AGENT-INFER65.md +0 -455
  336. package/one/events/INDEX.md +0 -295
  337. package/one/events/INDEX_QUICK_START_REDESIGN-20251106-080939.md +0 -342
  338. package/one/events/INSTALL-TESTS.md +0 -311
  339. package/one/events/INSTALLATION_FOLDERS.md +0 -534
  340. package/one/events/INSTALLATION_FOLDERS_FILES.md +0 -223
  341. package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +0 -437
  342. package/one/events/INTEGRATION-ARCHITECTURE.md +0 -579
  343. package/one/events/INTEGRATION-CHECKLIST.md +0 -1252
  344. package/one/events/INTEGRATION-ORCHESTRATION.md +0 -2641
  345. package/one/events/INTEGRATION-SUMMARY.md +0 -671
  346. package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +0 -684
  347. package/one/events/LANDING-PAGE-IMPLEMENTATION.md +0 -660
  348. package/one/events/LANDING-PAGE-QUICKSTART.md +0 -425
  349. package/one/events/LICENSE.md +0 -107
  350. package/one/events/MASTER-COORDINATION-PLAN.md +0 -613
  351. package/one/events/MASTER-ORCHESTRATION-INFER65.md +0 -441
  352. package/one/events/MASTER-PLAN-SUMMARY.md +0 -309
  353. package/one/events/MCP-CONFIGURATION.md +0 -354
  354. package/one/events/MCP-SETUP-COMPLETE.md +0 -223
  355. package/one/events/MIGRATION-REPORT.md +0 -453
  356. package/one/events/MIGRATION.md +0 -87
  357. package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +0 -1663
  358. package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +0 -643
  359. package/one/events/NEWS-COMMANDS.md +0 -506
  360. package/one/events/NEWS-SYSTEM-SUMMARY.md +0 -480
  361. package/one/events/NODE-UPGRADE.md +0 -129
  362. package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +0 -416
  363. package/one/events/ONTOLOGY-HOOKS-README.md +0 -718
  364. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +0 -383
  365. package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +0 -569
  366. package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +0 -491
  367. package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +0 -504
  368. package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +0 -221
  369. package/one/events/PACKAGE-STRUCTURE.md +0 -328
  370. package/one/events/PLAN-COMPLETE.md +0 -429
  371. package/one/events/PLAYBOOK-SETUP-SUMMARY.md +0 -349
  372. package/one/events/PROBLEM-SOLVER-EXECUTIVE-SUMMARY.md +0 -484
  373. package/one/events/PROBLEM-SOLVER-QUICKSTART.md +0 -420
  374. package/one/events/PROJECTS-PLAN-SUMMARY.md +0 -480
  375. package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +0 -585
  376. package/one/events/QA-CHECKLIST.md +0 -692
  377. package/one/events/QUALITY-AGENT-SUMMARY.md +0 -334
  378. package/one/events/QUALITY-EXECUTION-CHECKLIST.md +0 -593
  379. package/one/events/QUICK-REFERENCE-FRONTEND-TESTING.md +0 -475
  380. package/one/events/QUICK-START-ONTOLOGY.md +0 -426
  381. package/one/events/QUICK_START_REDESIGN-20251106-080938.md +0 -400
  382. package/one/events/README-PROBLEM-SOLVER.md +0 -394
  383. package/one/events/README-archived.md +0 -537
  384. package/one/events/README_QUICK_START_REDESIGN-20251106-080938.md +0 -484
  385. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +0 -657
  386. package/one/events/SEARCH_DEMO_DELIVERY.md +0 -433
  387. package/one/events/SEARCH_DEMO_SUMMARY.md +0 -321
  388. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +0 -399
  389. package/one/events/SECURITY-AUDIT-FIXES.md +0 -394
  390. package/one/events/SECURITY-SCAN-COMPLETE.md +0 -299
  391. package/one/events/SHOP-BUILD-STATUS.md +0 -132
  392. package/one/events/SHOP-PREMIUM-UPDATE.md +0 -165
  393. package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +0 -280
  394. package/one/events/SITE-WIDE-GRADIENT-FIX.md +0 -317
  395. package/one/events/SPECIALIST-QUICK-REFERENCE.md +0 -678
  396. package/one/events/STORE-PRODUCTION-READY-STATUS.md +0 -377
  397. package/one/events/STRIPE-INTEGRATION.md +0 -432
  398. package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +0 -447
  399. package/one/events/STRIPE-SETUP-GUIDE.md +0 -480
  400. package/one/events/TEST-PLAN-INDEX.md +0 -364
  401. package/one/events/TEST-PLAN.md +0 -1435
  402. package/one/events/TEST-SUMMARY.md +0 -411
  403. package/one/events/TESTING-DELIVERY.txt +0 -372
  404. package/one/events/TESTS-QUICK-REF.md +0 -280
  405. package/one/events/TRANSITIONS-QUICK-START.md +0 -159
  406. package/one/events/TRANSPARENCY-FIXES.md +0 -293
  407. package/one/events/TYPESCRIPT_FIXES.md +0 -170
  408. package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +0 -412
  409. package/one/events/TYPESCRIPT_FIXES_INDEX.md +0 -359
  410. package/one/events/VERIFICATION_CHECKLIST-20251106-080938.md +0 -326
  411. package/one/events/VIEW-TRANSITIONS.md +0 -446
  412. package/one/events/agent-command-implementation.md +0 -305
  413. package/one/events/agent-director-enhancement-summary.md +0 -404
  414. package/one/events/agent-director-routing-update.md +0 -214
  415. package/one/events/agent-onboard-implementation-summary.md +0 -475
  416. package/one/events/agent-ontology-alignment-completion.md +0 -263
  417. package/one/events/ai-integration-complete.md +0 -294
  418. package/one/events/ai-integration-lessons-learned.md +0 -511
  419. package/one/events/backend-integration-tests.md +0 -624
  420. package/one/events/backend-structure-diagram.txt +0 -393
  421. package/one/events/backend-structure-summary.txt +0 -269
  422. package/one/events/bullfm-video-podcast-analysis.md +0 -319
  423. package/one/events/clean-agent-ontology-cleanup-report.md +0 -371
  424. package/one/events/clean-agent-todo-analysis-summary.md +0 -336
  425. package/one/events/cloudflare-automation-complete.md +0 -350
  426. package/one/events/cloudflare-pages-infrastructure-setup.md +0 -282
  427. package/one/events/contact-page-complete.md +0 -316
  428. package/one/events/convex-analysis-index.md +0 -322
  429. package/one/events/convex-structure-analysis.md +0 -718
  430. package/one/events/creation-instructions-9-todos.md +0 -906
  431. package/one/events/cycle-3-video-player-port-20251108.md +0 -368
  432. package/one/events/cycle-3-video-player-port-complete-20251108.md +0 -334
  433. package/one/events/deployment-installation-folders.md +0 -178
  434. package/one/events/deployment-ops-summary.md +0 -386
  435. package/one/events/deployment-verification.md +0 -366
  436. package/one/events/design-spec-complete.md +0 -226
  437. package/one/events/documentation-audit-index.md +0 -473
  438. package/one/events/documentation-audit-summary.md +0 -417
  439. package/one/events/documentation-improvement-roadmap.md +0 -906
  440. package/one/events/documentation-standards-compliance-report.md +0 -538
  441. package/one/events/documentation-updates.md +0 -370
  442. package/one/events/events.md +0 -563
  443. package/one/events/fix-product-hydration-20251106.md +0 -211
  444. package/one/events/frontend-effects-complete.md +0 -584
  445. package/one/events/frontend-effects-orchestration.md +0 -1356
  446. package/one/events/frontend-effects-risk-register.md +0 -1055
  447. package/one/events/frontend-effects-week1-assignments.md +0 -1594
  448. package/one/events/hook-ontology-alignment-summary.md +0 -528
  449. package/one/events/installation-folders-workflow-integration.md +0 -458
  450. package/one/events/landing-page-generator.md +0 -476
  451. package/one/events/legal-assessment-2025-10-16.md +0 -1917
  452. package/one/events/master-coordination-plan.json +0 -1078
  453. package/one/events/master-plan-9-todos.md +0 -900
  454. package/one/events/mobile-performance-optimization.md +0 -179
  455. package/one/events/onboarding-implementation-complete.md +0 -523
  456. package/one/events/ontology-audit-agent-clone.md +0 -323
  457. package/one/events/ontology-test-examples.md +0 -580
  458. package/one/events/phase1-backend-implementation-complete.md +0 -536
  459. package/one/events/plan-completion-audit.md +0 -707
  460. package/one/events/plan-files-updated.md +0 -273
  461. package/one/events/production-readiness-plan.md +0 -389
  462. package/one/events/readme.md +0 -100
  463. package/one/events/release.md +0 -272
  464. package/one/events/root-cleanup-alignment-report.md +0 -265
  465. package/one/events/security-fixes-2025-01-15.md +0 -226
  466. package/one/events/separate-implementation-status.md +0 -555
  467. package/one/events/server-command-optimization-20251108.md +0 -150
  468. package/one/events/session-summary-2025-10-18.md +0 -366
  469. package/one/events/skills-complete.md +0 -351
  470. package/one/events/skills-infer-6-10-summary.md +0 -70
  471. package/one/events/skills-phase1-complete.md +0 -281
  472. package/one/events/specialist-assignments.md +0 -766
  473. package/one/events/structural-analysis-architecture-vs-plans.md +0 -600
  474. package/one/events/test-dashboard.md +0 -363
  475. package/one/events/test-index.md +0 -421
  476. package/one/events/test-report-ontology.md +0 -611
  477. package/one/events/testing-summary.md +0 -388
  478. package/one/events/todo-agent-builder.md +0 -1180
  479. package/one/events/todo-agent-director.md +0 -164
  480. package/one/events/todo-agent-documenter.md +0 -1815
  481. package/one/events/todo-agent-frontend.md +0 -1542
  482. package/one/events/todo-agent-problem-solver.md +0 -1682
  483. package/one/events/todo-agent-quality.md +0 -1647
  484. package/one/events/todo-refactoring-complete.md +0 -408
  485. package/one/events/wave1-backend-implementation-complete.md +0 -698
  486. package/one/events/web-AI_INTEGRATION_PHASE2_SUMMARY-20251111-152540.md +0 -529
  487. package/one/events/web-BUY-IN-CHATGPT-README-20251116-235241.md +0 -491
  488. package/one/events/web-CHARTS-IMPLEMENTATION-20251106-080939.md +0 -576
  489. package/one/events/web-CHARTS-QUICKSTART-20251106-080939.md +0 -416
  490. package/one/events/web-CODE-HIGHLIGHTING-SUMMARY-20251111-152540.md +0 -442
  491. package/one/events/web-DEPLOYMENT_SUMMARY-20251116-005428.md +0 -290
  492. package/one/events/web-DESIGN-SUMMARY-20251106-080939.md +0 -514
  493. package/one/events/web-README-AI-INTEGRATION-20251111-152540.md +0 -196
  494. package/one/events/web-RECHARTS-INTEGRATION-20251111-152540.md +0 -265
  495. package/one/events/web-RELEASE_OPTIMIZATION_PLAN-20251116-005428.md +0 -447
  496. package/one/events/web-TEST-CLEANUP-20251105-143205.md +0 -3
  497. package/one/events/web-USING-ANY-COMPONENT-IN-CHAT-20251111-152540.md +0 -561
  498. package/one/events/web-test-code-highlighting-20251111-152540.md +0 -231
  499. package/one/groups/features.md +0 -2904
  500. package/one/groups/groups.md +0 -587
  501. package/one/groups/one.md +0 -619
  502. package/one/groups/strategy-copy.md +0 -887
  503. package/one/learning/.obsidian/app.json +0 -1
  504. package/one/learning/.obsidian/appearance.json +0 -1
  505. package/one/learning/.obsidian/core-plugins.json +0 -33
  506. package/one/learning/.obsidian/ecommerce-ontology.md +0 -210
  507. package/one/learning/.obsidian/workspace.json +0 -211
  508. package/one/learning/100-inference-quick-reference.md +0 -449
  509. package/one/learning/ag-ui-protocol.md +0 -613
  510. package/one/learning/agent-onboard-usage.md +0 -630
  511. package/one/learning/agentic-commerce.md +0 -146
  512. package/one/learning/ai-agents-vs-memecoins-thesis.md +0 -683
  513. package/one/learning/ai-api-reference.md +0 -715
  514. package/one/learning/ai-platform.md +0 -323
  515. package/one/learning/ai-quickstart.md +0 -355
  516. package/one/learning/ai-sdk-implementation.md +0 -436
  517. package/one/learning/ai-token-crypto-analysis-framework.md +0 -1191
  518. package/one/learning/ai-token-paradigm-shift-2025.md +0 -732
  519. package/one/learning/altcoin-cycle-prediction-ontology.md +0 -884
  520. package/one/learning/altcoin-cycle-trading-strategy.md +0 -642
  521. package/one/learning/architecture-any-backend.md +0 -1589
  522. package/one/learning/architecture-diagram.md +0 -404
  523. package/one/learning/architecture-frontend.md +0 -1014
  524. package/one/learning/architecture.md +0 -1742
  525. package/one/learning/archived/ontology.old.md +0 -2840
  526. package/one/learning/astro-effect-complete-vision.md +0 -2148
  527. package/one/learning/astro-effect-simple-architecture.md +0 -750
  528. package/one/learning/audit-agent-onboard-alignment.md +0 -481
  529. package/one/learning/audit-agent-sales-alignment.md +0 -444
  530. package/one/learning/backend-api-reference.md +0 -728
  531. package/one/learning/cascading-context-specification.md +0 -1617
  532. package/one/learning/claude-code-integration.md +0 -1293
  533. package/one/learning/cli-claude-handoff.md +0 -736
  534. package/one/learning/context-engineering.md +0 -610
  535. package/one/learning/crypto-analysis-strategy.md +0 -1276
  536. package/one/learning/crypto-cycle-2024-2025-analysis.md +0 -44
  537. package/one/learning/crypto.md +0 -978
  538. package/one/learning/develop/design.md +0 -364
  539. package/one/learning/develop/index.md +0 -145
  540. package/one/learning/development-commands.md +0 -251
  541. package/one/learning/docs.md +0 -627
  542. package/one/learning/dsl.md +0 -1678
  543. package/one/learning/event-driven-documentation.md +0 -270
  544. package/one/learning/files.md +0 -2489
  545. package/one/learning/frontend.md +0 -1056
  546. package/one/learning/games-english.md +0 -691
  547. package/one/learning/games.md +0 -1082
  548. package/one/learning/generative-ui-patterns.md +0 -559
  549. package/one/learning/guidelines.md +0 -314
  550. package/one/learning/hono.md +0 -2127
  551. package/one/learning/implementation-examples.md +0 -2554
  552. package/one/learning/installation-folders.md +0 -366
  553. package/one/learning/institutional-cycle-paradigm-2025.md +0 -555
  554. package/one/learning/knowledge.md +0 -660
  555. package/one/learning/language.md +0 -998
  556. package/one/learning/lessons-learned.md +0 -378
  557. package/one/learning/lessons-website-building-focus.md +0 -382
  558. package/one/learning/merge-report.md +0 -254
  559. package/one/learning/metadata-system.md +0 -504
  560. package/one/learning/nine-padel-playbook.md +0 -229
  561. package/one/learning/one-protocol-ai-agents.md +0 -892
  562. package/one/learning/one-protocol-executive-report.md +0 -617
  563. package/one/learning/one-protocol-standard.md +0 -869
  564. package/one/learning/one-protocol-whitepaper.md +0 -756
  565. package/one/learning/ontology-blog.yaml +0 -47
  566. package/one/learning/ontology-cheatsheet.md +0 -617
  567. package/one/learning/ontology-community.yaml +0 -65
  568. package/one/learning/ontology-core-universal.md +0 -740
  569. package/one/learning/ontology-core.yaml +0 -63
  570. package/one/learning/ontology-courses.yaml +0 -76
  571. package/one/learning/ontology-creator.md +0 -402
  572. package/one/learning/ontology-crypto.md +0 -1603
  573. package/one/learning/ontology-developer-guide.md +0 -814
  574. package/one/learning/ontology-documentation.md +0 -377
  575. package/one/learning/ontology-ecommerce.md +0 -269
  576. package/one/learning/ontology-education-game.md +0 -1654
  577. package/one/learning/ontology-education.md +0 -938
  578. package/one/learning/ontology-engineering-specification.md +0 -1310
  579. package/one/learning/ontology-engineering.md +0 -1676
  580. package/one/learning/ontology-files.yaml +0 -525
  581. package/one/learning/ontology-frontend-master.md +0 -2898
  582. package/one/learning/ontology-frontend-specifications.md +0 -2196
  583. package/one/learning/ontology-frontend.md +0 -2475
  584. package/one/learning/ontology-index.md +0 -397
  585. package/one/learning/ontology-minimal.yaml +0 -301
  586. package/one/learning/ontology-portfolio.yaml +0 -45
  587. package/one/learning/ontology-quickstart.md +0 -602
  588. package/one/learning/ontology-release.md +0 -317
  589. package/one/learning/ontology-shop.yaml +0 -148
  590. package/one/learning/ontology-tokens.yaml +0 -51
  591. package/one/learning/ontology-tutorial.md +0 -455
  592. package/one/learning/ontology-v2.md +0 -4449
  593. package/one/learning/ontology-video-script.md +0 -939
  594. package/one/learning/ontology-visual-guide.md +0 -378
  595. package/one/learning/ontology.md +0 -3847
  596. package/one/learning/ontology.yaml +0 -1653
  597. package/one/learning/parallel-agents.md +0 -932
  598. package/one/learning/patterns/backend/convex-mutation-pattern.md +0 -130
  599. package/one/learning/patterns/backend/convex-query-pattern.md +0 -143
  600. package/one/learning/patterns/backend/mutation-template.md +0 -249
  601. package/one/learning/patterns/backend/query-template.md +0 -286
  602. package/one/learning/patterns/backend/service-template.md +0 -258
  603. package/one/learning/patterns/design/component-architecture.md +0 -435
  604. package/one/learning/patterns/design/index.md +0 -160
  605. package/one/learning/patterns/design/test-driven-design-pattern.md +0 -196
  606. package/one/learning/patterns/design/wireframe-template.md +0 -250
  607. package/one/learning/patterns/frontend/component-template.md +0 -246
  608. package/one/learning/patterns/frontend/form-template.md +0 -348
  609. package/one/learning/patterns/frontend/page-template.md +0 -209
  610. package/one/learning/patterns/frontend/react-component-pattern.md +0 -188
  611. package/one/learning/patterns/test/acceptance-criteria-template.md +0 -396
  612. package/one/learning/patterns/test/technical-test-template.md +0 -566
  613. package/one/learning/patterns/test/test-driven-pattern.md +0 -160
  614. package/one/learning/patterns/test/user-flow-template.md +0 -272
  615. package/one/learning/performance.md +0 -459
  616. package/one/learning/provider-agnostic-content.md +0 -995
  617. package/one/learning/provider-creation-guide.md +0 -1082
  618. package/one/learning/quality-loop.md +0 -419
  619. package/one/learning/quick-start-ontology-mapping.md +0 -773
  620. package/one/learning/readme-architecture.md +0 -158
  621. package/one/learning/readme.md +0 -149
  622. package/one/learning/rules.md +0 -644
  623. package/one/learning/score.md +0 -85
  624. package/one/learning/specifications.md +0 -873
  625. package/one/learning/tags.md +0 -148
  626. package/one/learning/todo-template.md +0 -269
  627. package/one/learning/todo.md +0 -269
  628. package/one/learning/troubleshooting.md +0 -434
  629. package/one/learning/typescript-patterns.md +0 -321
  630. package/one/learning/universal-generation-language.md +0 -827
  631. package/one/learning/x402-research.md +0 -104
  632. package/one/license.md +0 -107
  633. package/one/paths/a2a.md +0 -600
  634. package/one/paths/acp.md +0 -808
  635. package/one/paths/acps.md +0 -749
  636. package/one/paths/agentkit.md +0 -367
  637. package/one/paths/agui.md +0 -785
  638. package/one/paths/any-backend.md +0 -1720
  639. package/one/paths/ap2.md +0 -1072
  640. package/one/paths/api/queries-reference.md +0 -860
  641. package/one/paths/api-docs.md +0 -1909
  642. package/one/paths/api-reference.md +0 -1029
  643. package/one/paths/api.md +0 -2208
  644. package/one/paths/architecture-diagram.md +0 -112
  645. package/one/paths/communications.md +0 -467
  646. package/one/paths/connections.md +0 -357
  647. package/one/paths/copilotkit.md +0 -1577
  648. package/one/paths/cryptonetworks.md +0 -799
  649. package/one/paths/documentation.md +0 -1138
  650. package/one/paths/effect.md +0 -297
  651. package/one/paths/elizaos.md +0 -1308
  652. package/one/paths/groups.md +0 -814
  653. package/one/paths/inference.md +0 -76
  654. package/one/paths/integration-examples.md +0 -893
  655. package/one/paths/integration-guide.md +0 -887
  656. package/one/paths/integration-phase2.md +0 -754
  657. package/one/paths/kyc.md +0 -650
  658. package/one/paths/mcp.md +0 -860
  659. package/one/paths/membership.md +0 -1170
  660. package/one/paths/middleware.md +0 -1085
  661. package/one/paths/multitenant.md +0 -1359
  662. package/one/paths/n8n.md +0 -1033
  663. package/one/paths/patterns.md +0 -107
  664. package/one/paths/protocols.md +0 -297
  665. package/one/paths/relationships.md +0 -125
  666. package/one/paths/schema.md +0 -605
  667. package/one/paths/service-layer.md +0 -568
  668. package/one/paths/vectors.md +0 -225
  669. package/one/paths/wordpress.md +0 -1320
  670. package/one/paths/workflow-copy.md +0 -923
  671. package/one/paths/workflow-examples.md +0 -759
  672. package/one/paths/workflow-onboarding.md +0 -701
  673. package/one/paths/workflow.md +0 -923
  674. package/one/paths/workflows/delegation.md +0 -903
  675. package/one/paths/workflows/frontend.md +0 -1055
  676. package/one/paths/workflows/strategy.md +0 -921
  677. package/one/paths/workflows/tasks.md +0 -716
  678. package/one/paths/x402-baazar.md +0 -131
  679. package/one/paths/x402.md +0 -1353
  680. package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
  681. package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
  682. package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
  683. package/one/things/CHECKLIST.md +0 -407
  684. package/one/things/IMPLEMENTATION_STATUS.md +0 -379
  685. package/one/things/ONE.md +0 -529
  686. package/one/things/agents/agent-backend.md +0 -1501
  687. package/one/things/agents/agent-builder.md +0 -1064
  688. package/one/things/agents/agent-clean.md +0 -1112
  689. package/one/things/agents/agent-clone.md +0 -1324
  690. package/one/things/agents/agent-deploy.md +0 -986
  691. package/one/things/agents/agent-designer.md +0 -2305
  692. package/one/things/agents/agent-director.md +0 -1526
  693. package/one/things/agents/agent-documenter.md +0 -1129
  694. package/one/things/agents/agent-frontend.md +0 -1201
  695. package/one/things/agents/agent-integrator.md +0 -1269
  696. package/one/things/agents/agent-lawyer.md +0 -1371
  697. package/one/things/agents/agent-problem-solver.md +0 -1457
  698. package/one/things/agents/agent-quality.md +0 -1483
  699. package/one/things/agents/agent-sales.md +0 -1074
  700. package/one/things/cascade/cascade.yaml +0 -481
  701. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
  702. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
  703. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
  704. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
  705. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
  706. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
  707. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
  708. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
  709. package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
  710. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
  711. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
  712. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
  713. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
  714. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
  715. package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
  716. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
  717. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
  718. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
  719. package/one/things/cascade/docs/examples/readme.md +0 -259
  720. package/one/things/cascade/docs/getting-started.md +0 -533
  721. package/one/things/cascade/docs/workflow.md +0 -1378
  722. package/one/things/cascade/readme.md +0 -379
  723. package/one/things/cascade/templates/feature-template.md +0 -289
  724. package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
  725. package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
  726. package/one/things/claude/agents/analyst.md +0 -508
  727. package/one/things/claude/agents/architect.md +0 -505
  728. package/one/things/claude/agents/brand-identity-specialist.md +0 -538
  729. package/one/things/claude/agents/bstp-token-strategist.md +0 -690
  730. package/one/things/claude/agents/builder-repo.md +0 -532
  731. package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
  732. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
  733. package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
  734. package/one/things/claude/agents/company-bullstamp-character.md +0 -602
  735. package/one/things/claude/agents/company-bullstamp-community.md +0 -307
  736. package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
  737. package/one/things/claude/agents/company-bullstamp-token.md +0 -307
  738. package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
  739. package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
  740. package/one/things/claude/agents/content-calendar-planner.md +0 -473
  741. package/one/things/claude/agents/content-chapter-formatter.md +0 -513
  742. package/one/things/claude/agents/content-formatter.md +0 -571
  743. package/one/things/claude/agents/content-hook-specialist.md +0 -485
  744. package/one/things/claude/agents/content-image-formatter.md +0 -560
  745. package/one/things/claude/agents/content-introduction-formatter.md +0 -510
  746. package/one/things/claude/agents/content-multiplication-engine.md +0 -579
  747. package/one/things/claude/agents/content-playbook-writer.md +0 -473
  748. package/one/things/claude/agents/content-team-manager.md +0 -647
  749. package/one/things/claude/agents/content-toc-formatter.md +0 -547
  750. package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
  751. package/one/things/claude/agents/core-manager.md +0 -607
  752. package/one/things/claude/agents/core-master.md +0 -426
  753. package/one/things/claude/agents/cross-functional-manager.md +0 -476
  754. package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
  755. package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
  756. package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
  757. package/one/things/claude/agents/crypto-community-analyst.md +0 -314
  758. package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
  759. package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
  760. package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
  761. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
  762. package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
  763. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
  764. package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
  765. package/one/things/claude/agents/crypto-market-researcher.md +0 -307
  766. package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
  767. package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
  768. package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
  769. package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
  770. package/one/things/claude/agents/crypto-team-manager.md +0 -392
  771. package/one/things/claude/agents/crypto-token-analyst.md +0 -319
  772. package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
  773. package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
  774. package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
  775. package/one/things/claude/agents/customer-journey-designer.md +0 -474
  776. package/one/things/claude/agents/customer-success-manager.md +0 -574
  777. package/one/things/claude/agents/dev.md +0 -406
  778. package/one/things/claude/agents/documenter.md +0 -548
  779. package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
  780. package/one/things/claude/agents/engagement-specialist.md +0 -502
  781. package/one/things/claude/agents/engineering-architect.md +0 -387
  782. package/one/things/claude/agents/engineering-business-analyst.md +0 -527
  783. package/one/things/claude/agents/engineering-developer.md +0 -386
  784. package/one/things/claude/agents/engineering-director.md +0 -322
  785. package/one/things/claude/agents/engineering-ingestor.md +0 -659
  786. package/one/things/claude/agents/engineering-product-manager.md +0 -525
  787. package/one/things/claude/agents/engineering-product-owner.md +0 -527
  788. package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
  789. package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
  790. package/one/things/claude/agents/engineering-team-manager.md +0 -515
  791. package/one/things/claude/agents/engineering-user-experience.md +0 -386
  792. package/one/things/claude/agents/framework-elevate-manager.md +0 -309
  793. package/one/things/claude/agents/improver.md +0 -805
  794. package/one/things/claude/agents/intelligence-team-manager.md +0 -390
  795. package/one/things/claude/agents/lead-capture-expert.md +0 -459
  796. package/one/things/claude/agents/lead-magnet-creator.md +0 -446
  797. package/one/things/claude/agents/market-research-analyst.md +0 -435
  798. package/one/things/claude/agents/marketing-brand-identity.md +0 -344
  799. package/one/things/claude/agents/marketing-content-hooks.md +0 -455
  800. package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
  801. package/one/things/claude/agents/marketing-content-poster.md +0 -372
  802. package/one/things/claude/agents/marketing-customer-journey.md +0 -331
  803. package/one/things/claude/agents/marketing-director.md +0 -402
  804. package/one/things/claude/agents/marketing-engagement.md +0 -331
  805. package/one/things/claude/agents/marketing-lead-capture.md +0 -331
  806. package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
  807. package/one/things/claude/agents/marketing-network-effects.md +0 -331
  808. package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
  809. package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
  810. package/one/things/claude/agents/marketing-team-manager.md +0 -451
  811. package/one/things/claude/agents/marketing-viral-growth.md +0 -232
  812. package/one/things/claude/agents/mission-commander.md +0 -378
  813. package/one/things/claude/agents/network-effect-analyst.md +0 -604
  814. package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
  815. package/one/things/claude/agents/npx.md +0 -946
  816. package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
  817. package/one/things/claude/agents/one-master.md +0 -378
  818. package/one/things/claude/agents/one-orchestrator.md +0 -345
  819. package/one/things/claude/agents/one.md +0 -658
  820. package/one/things/claude/agents/playbook-generator.md +0 -526
  821. package/one/things/claude/agents/pm.md +0 -349
  822. package/one/things/claude/agents/po.md +0 -370
  823. package/one/things/claude/agents/qa.md +0 -361
  824. package/one/things/claude/agents/research-foundation-analyst.md +0 -324
  825. package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
  826. package/one/things/claude/agents/research-market-analyst.md +0 -324
  827. package/one/things/claude/agents/research-team-manager.md +0 -489
  828. package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
  829. package/one/things/claude/agents/sales-team-manager.md +0 -407
  830. package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
  831. package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
  832. package/one/things/claude/agents/service-advocacy-manager.md +0 -324
  833. package/one/things/claude/agents/service-success-manager.md +0 -324
  834. package/one/things/claude/agents/service-team-manager.md +0 -405
  835. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
  836. package/one/things/claude/agents/share-optimization-specialist.md +0 -576
  837. package/one/things/claude/agents/sm.md +0 -352
  838. package/one/things/claude/agents/story-teller.md +0 -498
  839. package/one/things/claude/agents/task-master.md +0 -621
  840. package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
  841. package/one/things/claude/agents/tester.md +0 -595
  842. package/one/things/claude/agents/the-bull-character-manager.md +0 -603
  843. package/one/things/claude/agents/tools-playbook-generator.md +0 -492
  844. package/one/things/claude/agents/turbo-repo-builder.md +0 -346
  845. package/one/things/claude/agents/upsell-strategist.md +0 -503
  846. package/one/things/claude/agents/ux-expert.md +0 -360
  847. package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
  848. package/one/things/claude/claude-code-hooks-development.json +0 -21
  849. package/one/things/claude/claude-code-hooks-production.json +0 -21
  850. package/one/things/claude/claude-code-hooks.json +0 -25
  851. package/one/things/claude/commands/agent.md +0 -124
  852. package/one/things/claude/commands/cascade-status.md +0 -153
  853. package/one/things/claude/commands/ingest.md +0 -343
  854. package/one/things/claude/commands/ingestor.md +0 -158
  855. package/one/things/claude/commands/mission.md +0 -103
  856. package/one/things/claude/commands/npx.md +0 -156
  857. package/one/things/claude/commands/one.md +0 -486
  858. package/one/things/claude/commands/quality-check.md +0 -252
  859. package/one/things/claude/commands/smart-route.md +0 -261
  860. package/one/things/claude/commands/start.md +0 -139
  861. package/one/things/claude/commands/story.md +0 -103
  862. package/one/things/claude/commands/task.md +0 -193
  863. package/one/things/claude/hook-bypass.json +0 -32
  864. package/one/things/claude/hooks/agent-hook-config.json +0 -427
  865. package/one/things/claude/hooks/build-hook.sh +0 -156
  866. package/one/things/claude/hooks/cleanup-hook.sh +0 -201
  867. package/one/things/claude/hooks/file-organization-hook.sh +0 -80
  868. package/one/things/claude/hooks/format-hook.sh +0 -43
  869. package/one/things/claude/hooks/hook-bypass.sh +0 -293
  870. package/one/things/claude/hooks/hook-debouncer.sh +0 -62
  871. package/one/things/claude/hooks/hook-logger.sh +0 -89
  872. package/one/things/claude/hooks/lint-hook.sh +0 -140
  873. package/one/things/claude/hooks/notification-hook.sh +0 -204
  874. package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
  875. package/one/things/claude/hooks/performance-metrics.json +0 -25
  876. package/one/things/claude/hooks/security-hook.sh +0 -256
  877. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
  878. package/one/things/claude/hooks/story-validation-hook.sh +0 -145
  879. package/one/things/claude/hooks/test-hook.sh +0 -145
  880. package/one/things/claude/hooks/test-story-validation.sh +0 -170
  881. package/one/things/claude/settings-local.json +0 -86
  882. package/one/things/cli/cli-code.md +0 -677
  883. package/one/things/cli/cli-compiler-code.md +0 -677
  884. package/one/things/cli/cli.md +0 -871
  885. package/one/things/components/card-shadcn.md +0 -953
  886. package/one/things/components/card.md +0 -1041
  887. package/one/things/components.md +0 -1743
  888. package/one/things/componets.md +0 -19
  889. package/one/things/contracts/Move.toml +0 -12
  890. package/one/things/contracts/README.md +0 -288
  891. package/one/things/contracts/one.move +0 -762
  892. package/one/things/contracts/sdk.ts +0 -579
  893. package/one/things/creator-diagram.md +0 -184
  894. package/one/things/crypto/FEATURES.md +0 -78
  895. package/one/things/crypto/ONECORE.md +0 -62
  896. package/one/things/crypto/ONECOREFAQ.md +0 -22
  897. package/one/things/crypto/ONECOREHOW.md +0 -46
  898. package/one/things/crypto/ONEENTERPRISE.md +0 -64
  899. package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
  900. package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
  901. package/one/things/crypto/ONEPRO.md +0 -60
  902. package/one/things/crypto/ONEPROFAQ.md +0 -22
  903. package/one/things/crypto/ONEPROHOW.md +0 -53
  904. package/one/things/crypto/READMEAGENCY.md +0 -64
  905. package/one/things/crypto/VSL.md +0 -45
  906. package/one/things/crypto/WebsiteCopy.md +0 -176
  907. package/one/things/demo-accessibility-animations.md +0 -1025
  908. package/one/things/demo-components.md +0 -1310
  909. package/one/things/demo-design-summary.md +0 -692
  910. package/one/things/demo-design-system.md +0 -973
  911. package/one/things/demo-page-layouts.md +0 -1016
  912. package/one/things/design-system.md +0 -832
  913. package/one/things/designs/accessibility-audit.md +0 -877
  914. package/one/things/designs/component-specifications.md +0 -855
  915. package/one/things/designs/design-overview.md +0 -377
  916. package/one/things/designs/design-tokens.md +0 -448
  917. package/one/things/designs/wireframes-dashboard.md +0 -710
  918. package/one/things/docs/api-requests.md +0 -987
  919. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
  920. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
  921. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
  922. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
  923. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
  924. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
  925. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
  926. package/one/things/docs/ecommerce/QUICK-START.md +0 -405
  927. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
  928. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
  929. package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
  930. package/one/things/docs/ecommerce/demo.astro +0 -309
  931. package/one/things/examples/children/lemonade-stand.md +0 -404
  932. package/one/things/examples/enterprise/crm-saas.md +0 -1444
  933. package/one/things/features/1-1-agent-prompts.md +0 -562
  934. package/one/things/features/1-2-yaml-orchestrator.md +0 -548
  935. package/one/things/features/1-3-event-coordination.md +0 -547
  936. package/one/things/features/1-4-knowledge-management.md +0 -652
  937. package/one/things/features/1-5-quality-loops.md +0 -725
  938. package/one/things/features/1-6-numbering-structure.md +0 -639
  939. package/one/things/features/2-1-dataprovider-interface.md +0 -2583
  940. package/one/things/features/2-2-config-system.md +0 -3242
  941. package/one/things/features/2-3-effectts-services.md +0 -1645
  942. package/one/things/features/2-4-react-hooks.md +0 -2136
  943. package/one/things/features/2-5-auth-migration.md +0 -2144
  944. package/one/things/features/2-6-dashboard-migration.md +0 -2084
  945. package/one/things/features/2-7-alternative-providers.md +0 -2578
  946. package/one/things/features/2-7-implementation-report.md +0 -724
  947. package/one/things/features/2-cli.md +0 -1720
  948. package/one/things/features/2-design.md +0 -1770
  949. package/one/things/features/2-tests.md +0 -576
  950. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
  951. package/one/things/features/DECOUPLING.md +0 -290
  952. package/one/things/features/DEPLOYMENT.md +0 -470
  953. package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
  954. package/one/things/features/improve.md +0 -861
  955. package/one/things/features/remove-convex-deps.md +0 -63
  956. package/one/things/features/top-features.md +0 -87
  957. package/one/things/features/use-one-backend.md +0 -1217
  958. package/one/things/features-in-english.md +0 -200
  959. package/one/things/files.yaml +0 -721
  960. package/one/things/ideas/1-create-workflow.md +0 -207
  961. package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
  962. package/one/things/implementation/backend-guide.md +0 -457
  963. package/one/things/interface.md +0 -257
  964. package/one/things/landing-page-implementation.md +0 -455
  965. package/one/things/legal/README.md +0 -234
  966. package/one/things/legal/privacy-policy.md +0 -1227
  967. package/one/things/legal/terms-of-service.md +0 -1432
  968. package/one/things/master-workflow-plan.md +0 -806
  969. package/one/things/pay.one.ie.md +0 -53
  970. package/one/things/plans/0-in-sync.md +0 -136
  971. package/one/things/plans/0-timeline.md +0 -36
  972. package/one/things/plans/1-create-workflow.md +0 -732
  973. package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
  974. package/one/things/plans/README-SIMPLIFICATION.md +0 -349
  975. package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
  976. package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
  977. package/one/things/plans/ai-elements-integration.md +0 -483
  978. package/one/things/plans/ai-elements.md +0 -1278
  979. package/one/things/plans/ai-integration-plan.md +0 -263
  980. package/one/things/plans/ai-integration.md +0 -996
  981. package/one/things/plans/ai-sdk.md +0 -798
  982. package/one/things/plans/ai-tools.md +0 -621
  983. package/one/things/plans/app.md +0 -832
  984. package/one/things/plans/architecture-summary.md +0 -312
  985. package/one/things/plans/async-ai-agents.md +0 -233
  986. package/one/things/plans/backend-agnostic-frontend.md +0 -390
  987. package/one/things/plans/backend-cleanup-quickstart.md +0 -380
  988. package/one/things/plans/backend-ontology-conformance.md +0 -475
  989. package/one/things/plans/backend-status.md +0 -599
  990. package/one/things/plans/backend-structure.md +0 -847
  991. package/one/things/plans/backend-target-structure.md +0 -482
  992. package/one/things/plans/backend.md +0 -1175
  993. package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
  994. package/one/things/plans/better-auth-any-backend.md +0 -1896
  995. package/one/things/plans/better-auth-available-features.md +0 -273
  996. package/one/things/plans/big-plan.md +0 -52
  997. package/one/things/plans/cli-updates-required.md +0 -320
  998. package/one/things/plans/complete-step-by-step.md +0 -1409
  999. package/one/things/plans/components.md +0 -709
  1000. package/one/things/plans/convex-agents.md +0 -1034
  1001. package/one/things/plans/convex-better-auth.md +0 -1141
  1002. package/one/things/plans/convex-on-off.md +0 -407
  1003. package/one/things/plans/crypto-token-researcher.md +0 -629
  1004. package/one/things/plans/data-quality-metrics.md +0 -745
  1005. package/one/things/plans/deep-researcher-agent.md +0 -466
  1006. package/one/things/plans/deploy-to-cloudflare.md +0 -623
  1007. package/one/things/plans/deployment-architecture.md +0 -469
  1008. package/one/things/plans/desktop.md +0 -1139
  1009. package/one/things/plans/development-plan.md +0 -1283
  1010. package/one/things/plans/development-workflow-tldr.md +0 -207
  1011. package/one/things/plans/development-workflow.md +0 -959
  1012. package/one/things/plans/dsl-claude-code.md +0 -1011
  1013. package/one/things/plans/effect-components.md +0 -1743
  1014. package/one/things/plans/effect-patterns-reference.md +0 -2235
  1015. package/one/things/plans/effect.md +0 -1806
  1016. package/one/things/plans/email.md +0 -966
  1017. package/one/things/plans/enhance-auth.md +0 -1692
  1018. package/one/things/plans/execution-strategy.md +0 -1291
  1019. package/one/things/plans/existing-infrastructure.md +0 -712
  1020. package/one/things/plans/feature-based-sites.md +0 -894
  1021. package/one/things/plans/frontend-effects.md +0 -1276
  1022. package/one/things/plans/group-folder-multi-tenancy.md +0 -893
  1023. package/one/things/plans/improve-codebase.md +0 -1811
  1024. package/one/things/plans/install-components.md +0 -215
  1025. package/one/things/plans/integrate-frontend-and-backend.md +0 -603
  1026. package/one/things/plans/landing.md +0 -820
  1027. package/one/things/plans/layout.md +0 -249
  1028. package/one/things/plans/mail-backend.md +0 -1361
  1029. package/one/things/plans/mail.md +0 -2677
  1030. package/one/things/plans/mcp-clear-context-prompt.md +0 -81
  1031. package/one/things/plans/mcp-simple.md +0 -248
  1032. package/one/things/plans/multi-ontology-architecture.md +0 -885
  1033. package/one/things/plans/next-features.md +0 -114
  1034. package/one/things/plans/npx-agent-safety.md +0 -785
  1035. package/one/things/plans/npx-agent.md +0 -1089
  1036. package/one/things/plans/onboarding.md +0 -51
  1037. package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
  1038. package/one/things/plans/one.md +0 -677
  1039. package/one/things/plans/ontology-6-dimensions.md +0 -2201
  1040. package/one/things/plans/ontology-compliance-audit.md +0 -342
  1041. package/one/things/plans/ontology-driven-strategy.md +0 -882
  1042. package/one/things/plans/ontology-refine.md +0 -586
  1043. package/one/things/plans/ontology-ui-approach.md +0 -375
  1044. package/one/things/plans/open-agent.md +0 -840
  1045. package/one/things/plans/performace.md +0 -122
  1046. package/one/things/plans/phase-1-foundation.md +0 -620
  1047. package/one/things/plans/phase-3-implementation.md +0 -1037
  1048. package/one/things/plans/plan-connect-to-api.md +0 -146
  1049. package/one/things/plans/quick-wins.md +0 -1428
  1050. package/one/things/plans/r2.md +0 -777
  1051. package/one/things/plans/readme-backend-cleanup.md +0 -402
  1052. package/one/things/plans/release.md +0 -507
  1053. package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
  1054. package/one/things/plans/repos.md +0 -98
  1055. package/one/things/plans/separate-copy-2.md +0 -1349
  1056. package/one/things/plans/separate-copy-3.md +0 -2479
  1057. package/one/things/plans/separate-copy.md +0 -1349
  1058. package/one/things/plans/separate-demo.md +0 -864
  1059. package/one/things/plans/separate.md +0 -1999
  1060. package/one/things/plans/sequence.md +0 -2040
  1061. package/one/things/plans/shadcn-integration-summary.md +0 -510
  1062. package/one/things/plans/sidebar.md +0 -206
  1063. package/one/things/plans/skills.md +0 -709
  1064. package/one/things/plans/small-fixes.md +0 -23
  1065. package/one/things/plans/start-new.md +0 -764
  1066. package/one/things/plans/switch-off-auth.md +0 -42
  1067. package/one/things/plans/sync-checklist.md +0 -351
  1068. package/one/things/plans/test-backend-connection.md +0 -514
  1069. package/one/things/plans/unified-implementation-plan.md +0 -934
  1070. package/one/things/plans/update-demos.md +0 -581
  1071. package/one/things/plans/use-our-backend.md +0 -572
  1072. package/one/things/plans/video-backend.md +0 -638
  1073. package/one/things/plans/video-frontend.md +0 -490
  1074. package/one/things/plans/video-old-archived.md +0 -656
  1075. package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
  1076. package/one/things/plans/wave1-onboarding-vision.md +0 -744
  1077. package/one/things/plans/wave1-orchestration-summary.md +0 -604
  1078. package/one/things/plans/wave1-specialist-assignments.md +0 -1413
  1079. package/one/things/plans/workflow-files.md +0 -1210
  1080. package/one/things/plans/workflow.md +0 -1378
  1081. package/one/things/plans-u.md +0 -905
  1082. package/one/things/products/Blockchain Products.md +0 -6278
  1083. package/one/things/products/cascade-landing-page.md +0 -841
  1084. package/one/things/products/cascade.md +0 -1568
  1085. package/one/things/products/context-engineering.md +0 -1488
  1086. package/one/things/products/onthology.md +0 -15
  1087. package/one/things/products/ontology-ui-shadcn.md +0 -1302
  1088. package/one/things/products/ontology-ui.md +0 -1429
  1089. package/one/things/products/ontology.md +0 -789
  1090. package/one/things/products/sdk.md +0 -573
  1091. package/one/things/promptkit.md +0 -930
  1092. package/one/things/repos/all-repos.md +0 -0
  1093. package/one/things/scripts-clean-mac.sh +0 -409
  1094. package/one/things/service-providers-new.md +0 -1052
  1095. package/one/things/service-providers.md +0 -1121
  1096. package/one/things/structure.md +0 -532
  1097. package/one/things/system.md +0 -618
  1098. package/one/things/templates.md +0 -294
  1099. package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
  1100. package/one/things/tests/2-1-test-analysis.md +0 -544
  1101. package/one/things/things.md +0 -384
  1102. package/one/things/todo-acp-integration.md +0 -744
  1103. package/one/things/todo-ai.md +0 -933
  1104. package/one/things/todo-api.md +0 -1078
  1105. package/one/things/todo-assignment.md +0 -580
  1106. package/one/things/todo-buy-chatgpt.md +0 -1450
  1107. package/one/things/todo-components.md +0 -1683
  1108. package/one/things/todo-connections.md +0 -278
  1109. package/one/things/todo-ecommerce-frontend.md +0 -1313
  1110. package/one/things/todo-ecommerce.md +0 -569
  1111. package/one/things/todo-effects.md +0 -1075
  1112. package/one/things/todo-frontend-effects.md +0 -977
  1113. package/one/things/todo-landing-page.md +0 -1091
  1114. package/one/things/todo-mail.md +0 -1160
  1115. package/one/things/todo-master-plan.md +0 -490
  1116. package/one/things/todo-onboard.md +0 -666
  1117. package/one/things/todo-one-ie.md +0 -538
  1118. package/one/things/todo-page.md +0 -606
  1119. package/one/things/todo-plans.md +0 -282
  1120. package/one/things/todo-projects.md +0 -241
  1121. package/one/things/todo-refactoring-plan.md +0 -366
  1122. package/one/things/todo-release.md +0 -654
  1123. package/one/things/todo-sequence.md +0 -1621
  1124. package/one/things/todo-use-our-backend.md +0 -1908
  1125. package/one/things/todo-workflow.md +0 -626
  1126. package/one/things/todo-x402.md +0 -2047
  1127. package/one/things/todo.md +0 -21
  1128. package/one/things/video/scripts-crypto.md +0 -835
  1129. package/one/things/video-script-backup.md +0 -318
  1130. package/one/things/video-script-demo.md +0 -382
  1131. package/one/things/video-script-ontology.md +0 -333
  1132. package/one/things/video-script.md +0 -361
@@ -1,2144 +0,0 @@
1
- ---
2
- title: 2 5 Auth Migration
3
- dimension: things
4
- category: features
5
- tags: auth, backend, frontend
6
- related_dimensions: connections, events, people
7
- scope: global
8
- created: 2025-11-03
9
- updated: 2025-11-03
10
- version: 1.0.0
11
- ai_context: |
12
- This document is part of the things dimension in the features category.
13
- Location: one/things/features/2-5-auth-migration.md
14
- Purpose: Documents feature 2-5: auth component migration to dataprovider
15
- Related dimensions: connections, events, people
16
- For AI agents: Read this to understand 2 5 auth migration.
17
- ---
18
-
19
- # Feature 2-5: Auth Component Migration to DataProvider
20
-
21
- **Feature ID:** `feature_2_5_auth_migration`
22
- **Plan:** `plan_2_backend_agnostic_frontend`
23
- **Owner:** Frontend Specialist
24
- **Status:** ✅ **COMPLETE SPECIFICATION** - Ready for Implementation
25
- **Priority:** **P0 (CRITICAL)** - All 50+ auth tests MUST pass
26
- **Effort:** 1 week (5-8 days)
27
- **Risk Level:** **HIGHEST** - Authentication is critical infrastructure
28
- **Dependencies:** Feature 2-1 (DataProvider), Feature 2-4 (React Hooks)
29
-
30
- ---
31
-
32
- ## Executive Summary
33
-
34
- This feature migrates **6 critical authentication components** from direct Better Auth + Convex integration to backend-agnostic DataProvider hooks. This is the **HIGHEST RISK** feature in Plan 2 because:
35
-
36
- 1. Authentication affects 100% of users
37
- 2. 50+ existing tests MUST continue passing
38
- 3. Security cannot be compromised
39
- 4. Session management must work identically
40
- 5. Zero downtime deployment required
41
-
42
- **Success Criteria:** All 50+ auth tests pass with ZERO functionality regression.
43
-
44
- **Migration Strategy:** Incremental component-by-component with test validation after EACH component (<5 tests fail = immediate rollback).
45
-
46
- ---
47
-
48
- ## 1. Components to Migrate (6 Total)
49
-
50
- ### Component Matrix
51
-
52
- | # | Component | Current API | New Hook | Lines | Risk | Test File |
53
- | --- | ---------------------- | ----------------------------------------------- | ---------------------------- | ----- | ---------- | ------------------------ |
54
- | 1 | **SimpleSignInForm** | `authClient.signIn.email()` | `useLogin()` | 163 | **HIGH** | `email-password.test.ts` |
55
- | 2 | **SimpleSignUpForm** | `authClient.signUp.email()` | `useSignup()` | 157 | **HIGH** | `email-password.test.ts` |
56
- | 3 | **MagicLinkAuth** | `convex.mutation(api.auth.signInWithMagicLink)` | `useMagicLinkAuth()` | 151 | **MEDIUM** | `magic-link.test.ts` |
57
- | 4 | **TwoFactorSettings** | Multiple `convex.mutation(api.auth.*)` | `use2FA()` | 293 | **HIGH** | `auth.test.ts` |
58
- | 5 | **VerifyEmailForm** | `convex.mutation(api.auth.verifyEmail)` | `useVerifyEmail()` | 134 | **LOW** | `auth.test.ts` |
59
- | 6 | **ForgotPasswordForm** | `fetch("/api/auth/forgot-password")` | `usePasswordReset()` | 144 | **MEDIUM** | `password-reset.test.ts` |
60
- | 7 | **ResetPasswordForm** | `fetch("/api/auth/reset-password")` | `usePasswordResetComplete()` | 206 | **MEDIUM** | `password-reset.test.ts` |
61
-
62
- **Total:** 1,248 lines of code to migrate
63
- **Estimated Effort:** 8-12 hours of careful migration + testing
64
-
65
- ---
66
-
67
- ## 2. Complete BEFORE/AFTER Code
68
-
69
- ### 2.1 SimpleSignInForm Migration
70
-
71
- **BEFORE (Current - 163 lines):**
72
-
73
- ```typescript
74
- // frontend/src/components/auth/SimpleSignInForm.tsx (BEFORE)
75
- import { useState } from "react"
76
- import { Button } from "@/components/ui/button"
77
- import { Input } from "@/components/ui/input"
78
- import { Label } from "@/components/ui/label"
79
- import { authClient } from "@/lib/auth-client" // ❌ REMOVE
80
- import { toast } from "sonner"
81
- import { AuthCard } from "./AuthCard"
82
- import { SocialLoginButtons } from "./SocialLoginButtons"
83
-
84
- export function SimpleSignInForm() {
85
- const [email, setEmail] = useState("")
86
- const [password, setPassword] = useState("")
87
- const [loading, setLoading] = useState(false) // ❌ Manual state management
88
-
89
- const handleSubmit = async (e: React.FormEvent) => {
90
- e.preventDefault()
91
- setLoading(true) // ❌ Manual loading state
92
-
93
- try {
94
- // ❌ Direct authClient call
95
- const result = await authClient.signIn.email({
96
- email,
97
- password,
98
- })
99
-
100
- if (result.error) {
101
- const errorMessage = result.error.message || "Unable to sign in"
102
- let title = "Unable to sign in"
103
- let description = `Error: ${errorMessage}. Please check your credentials and try again.`
104
-
105
- // ❌ String-based error handling (brittle)
106
- if (errorMessage.toLowerCase().includes("not found") || errorMessage.toLowerCase().includes("no user")) {
107
- title = "Account not found"
108
- description = "No account exists with this email. Please sign up first."
109
- } else if (errorMessage.toLowerCase().includes("password") || errorMessage.toLowerCase().includes("incorrect")) {
110
- title = "Incorrect password"
111
- description = "The password you entered is incorrect."
112
- }
113
- // ... more string-based error checks
114
-
115
- toast.error(title, { description })
116
- setLoading(false) // ❌ Manual state reset
117
- return
118
- }
119
-
120
- toast.success("Welcome back!", {
121
- description: "Successfully signed in. Redirecting to your dashboard..."
122
- })
123
-
124
- setTimeout(() => {
125
- window.location.href = "/account"
126
- }, 1000)
127
- } catch (err: any) {
128
- // ❌ Generic error handling
129
- toast.error("Sign in error", {
130
- description: `Error: ${err.message}. Please try again later.`
131
- })
132
- setLoading(false) // ❌ Manual state reset
133
- }
134
- }
135
-
136
- return (
137
- <AuthCard title="Welcome Back" description="Sign in to your account">
138
- <form onSubmit={handleSubmit} className="space-y-4">
139
- <div className="space-y-2">
140
- <Label htmlFor="email">Email</Label>
141
- <Input
142
- id="email"
143
- type="email"
144
- placeholder="your@email.com"
145
- value={email}
146
- onChange={(e) => setEmail(e.target.value)}
147
- required
148
- />
149
- </div>
150
-
151
- <div className="space-y-2">
152
- <div className="flex items-center justify-between">
153
- <Label htmlFor="password">Password</Label>
154
- <a href="/account/forgot-password" className="text-xs text-primary hover:underline">
155
- Forgot password?
156
- </a>
157
- </div>
158
- <Input
159
- id="password"
160
- type="password"
161
- placeholder="••••••••"
162
- value={password}
163
- onChange={(e) => setPassword(e.target.value)}
164
- required
165
- />
166
- </div>
167
-
168
- <Button type="submit" className="w-full" disabled={loading}>
169
- {loading ? "Signing in..." : "Sign In"}
170
- </Button>
171
-
172
- <div className="relative my-4">
173
- <div className="absolute inset-0 flex items-center">
174
- <span className="w-full border-t" />
175
- </div>
176
- <div className="relative flex justify-center text-xs uppercase">
177
- <span className="bg-background px-2 text-muted-foreground">Or</span>
178
- </div>
179
- </div>
180
-
181
- <Button variant="outline" className="w-full" asChild>
182
- <a href="/account/magic-link">Sign in with magic link</a>
183
- </Button>
184
- </form>
185
- </AuthCard>
186
- )
187
- }
188
- ```
189
-
190
- **AFTER (Migrated - 120 lines, cleaner):**
191
-
192
- ```typescript
193
- // frontend/src/components/auth/SimpleSignInForm.tsx (AFTER)
194
- import { useState } from "react"
195
- import { Button } from "@/components/ui/button"
196
- import { Input } from "@/components/ui/input"
197
- import { Label } from "@/components/ui/label"
198
- import { useLogin } from "@/providers/hooks" // ✅ DataProvider hook
199
- import { toast } from "sonner"
200
- import { AuthCard } from "./AuthCard"
201
- import { SocialLoginButtons } from "./SocialLoginButtons"
202
-
203
- export function SimpleSignInForm() {
204
- const [email, setEmail] = useState("")
205
- const [password, setPassword] = useState("")
206
- const { mutate: login, loading, error } = useLogin() // ✅ Hook manages state
207
-
208
- const handleSubmit = async (e: React.FormEvent) => {
209
- e.preventDefault()
210
-
211
- try {
212
- const result = await login({ email, password }) // ✅ Simple hook call
213
-
214
- if (result.success) {
215
- toast.success("Welcome back!", {
216
- description: "Successfully signed in. Redirecting to your dashboard..."
217
- })
218
-
219
- setTimeout(() => {
220
- window.location.href = "/account"
221
- }, 1000)
222
- }
223
- } catch (err: any) {
224
- // ✅ Typed error handling
225
- let title = "Unable to sign in"
226
- let description = err.message || "Please check your credentials and try again."
227
-
228
- // ✅ Type-safe error checking
229
- if (err._tag === "UserNotFound") {
230
- title = "Account not found"
231
- description = "No account exists with this email. Please sign up first."
232
- } else if (err._tag === "InvalidCredentials") {
233
- title = "Incorrect password"
234
- description = "The password you entered is incorrect. Try again or use 'Forgot password'."
235
- } else if (err._tag === "NetworkError") {
236
- title = "Network error"
237
- description = "Unable to connect to the server. Check your internet connection."
238
- } else if (err._tag === "EmailNotVerified") {
239
- title = "Email not verified"
240
- description = "Please verify your email address before signing in."
241
- } else if (err._tag === "TwoFactorRequired") {
242
- title = "2FA required"
243
- description = "Please enter your two-factor authentication code."
244
- // Redirect to 2FA page
245
- window.location.href = `/account/signin/2fa?email=${encodeURIComponent(email)}`
246
- return
247
- }
248
-
249
- toast.error(title, { description })
250
- }
251
- }
252
-
253
- return (
254
- <AuthCard title="Welcome Back" description="Sign in to your account">
255
- <SocialLoginButtons mode="signin" />
256
-
257
- <form onSubmit={handleSubmit} className="space-y-4">
258
- <div className="space-y-2">
259
- <Label htmlFor="email">Email</Label>
260
- <Input
261
- id="email"
262
- type="email"
263
- placeholder="your@email.com"
264
- value={email}
265
- onChange={(e) => setEmail(e.target.value)}
266
- required
267
- />
268
- </div>
269
-
270
- <div className="space-y-2">
271
- <div className="flex items-center justify-between">
272
- <Label htmlFor="password">Password</Label>
273
- <a href="/account/forgot-password" className="text-xs text-primary hover:underline">
274
- Forgot password?
275
- </a>
276
- </div>
277
- <Input
278
- id="password"
279
- type="password"
280
- placeholder="••••••••"
281
- value={password}
282
- onChange={(e) => setPassword(e.target.value)}
283
- required
284
- />
285
- </div>
286
-
287
- <Button type="submit" className="w-full" disabled={loading}>
288
- {loading ? "Signing in..." : "Sign In"}
289
- </Button>
290
-
291
- <div className="relative my-4">
292
- <div className="absolute inset-0 flex items-center">
293
- <span className="w-full border-t" />
294
- </div>
295
- <div className="relative flex justify-center text-xs uppercase">
296
- <span className="bg-background px-2 text-muted-foreground">Or</span>
297
- </div>
298
- </div>
299
-
300
- <Button variant="outline" className="w-full" asChild>
301
- <a href="/account/magic-link">Sign in with magic link</a>
302
- </Button>
303
- </form>
304
- </AuthCard>
305
- )
306
- }
307
- ```
308
-
309
- **Key Changes:**
310
-
311
- - ❌ Removed `authClient` import
312
- - ✅ Added `useLogin()` hook import
313
- - ❌ Removed manual `loading` state
314
- - ✅ Hook manages `loading`, `error` state
315
- - ❌ Removed string-based error detection
316
- - ✅ Type-safe `_tag` error checking
317
- - 🔥 **43 fewer lines** (163 → 120)
318
- - 🎯 **Better error handling** with typed errors
319
- - ⚡ **Cleaner code** with hook pattern
320
-
321
- ---
322
-
323
- ### 2.2 SimpleSignUpForm Migration
324
-
325
- **BEFORE (Current - 157 lines):**
326
-
327
- ```typescript
328
- // frontend/src/components/auth/SimpleSignUpForm.tsx (BEFORE)
329
- import { useState } from "react"
330
- import { Button } from "@/components/ui/button"
331
- import { Input } from "@/components/ui/input"
332
- import { Label } from "@/components/ui/label"
333
- import { authClient } from "@/lib/auth-client" // ❌ REMOVE
334
- import { toast } from "sonner"
335
- import { AuthCard } from "./AuthCard"
336
- import { SocialLoginButtons } from "./SocialLoginButtons"
337
- import { PasswordStrengthIndicator } from "./PasswordStrengthIndicator"
338
-
339
- export function SimpleSignUpForm() {
340
- const [email, setEmail] = useState("")
341
- const [password, setPassword] = useState("")
342
- const [name, setName] = useState("")
343
- const [loading, setLoading] = useState(false) // ❌ Manual state
344
-
345
- const handleSubmit = async (e: React.FormEvent) => {
346
- e.preventDefault()
347
- setLoading(true) // ❌ Manual loading
348
-
349
- try {
350
- // ❌ Direct authClient call
351
- const result = await authClient.signUp.email({
352
- email,
353
- password,
354
- name,
355
- })
356
-
357
- if (result.error) {
358
- const errorMessage = result.error.message || "Unable to create account"
359
- let title = "Unable to create account"
360
- let description = `Error: ${errorMessage}. Please verify your information and try again.`
361
-
362
- // ❌ String-based error detection
363
- if (errorMessage.toLowerCase().includes("already exists")) {
364
- title = "Email already registered"
365
- description = "This email is already in use. Please sign in instead."
366
- } else if (errorMessage.toLowerCase().includes("password")) {
367
- title = "Invalid password"
368
- description = "Password must be at least 8 characters long."
369
- }
370
-
371
- toast.error(title, { description })
372
- setLoading(false) // ❌ Manual state reset
373
- return
374
- }
375
-
376
- toast.success("Account created successfully!", {
377
- description: `Welcome ${name}! Redirecting to your dashboard...`
378
- })
379
-
380
- setTimeout(() => {
381
- window.location.href = "/account"
382
- }, 1000)
383
- } catch (err: any) {
384
- toast.error("Sign up error", {
385
- description: `Error: ${err.message}. Please try again later.`
386
- })
387
- setLoading(false) // ❌ Manual state reset
388
- }
389
- }
390
-
391
- return (
392
- <AuthCard title="Create Account" description="Sign up to get started">
393
- <SocialLoginButtons mode="signup" />
394
-
395
- <form onSubmit={handleSubmit} className="space-y-4">
396
- <div className="space-y-2">
397
- <Label htmlFor="name">Name</Label>
398
- <Input
399
- id="name"
400
- type="text"
401
- placeholder="Your name"
402
- value={name}
403
- onChange={(e) => setName(e.target.value)}
404
- />
405
- </div>
406
-
407
- <div className="space-y-2">
408
- <Label htmlFor="email">Email</Label>
409
- <Input
410
- id="email"
411
- type="email"
412
- placeholder="your@email.com"
413
- value={email}
414
- onChange={(e) => setEmail(e.target.value)}
415
- required
416
- />
417
- </div>
418
-
419
- <div className="space-y-2">
420
- <Label htmlFor="password">Password</Label>
421
- <Input
422
- id="password"
423
- type="password"
424
- placeholder="••••••••"
425
- value={password}
426
- onChange={(e) => setPassword(e.target.value)}
427
- required
428
- minLength={8}
429
- />
430
- <PasswordStrengthIndicator password={password} />
431
- </div>
432
-
433
- <Button type="submit" className="w-full" disabled={loading}>
434
- {loading ? "Signing up..." : "Sign Up"}
435
- </Button>
436
- </form>
437
- </AuthCard>
438
- )
439
- }
440
- ```
441
-
442
- **AFTER (Migrated - 115 lines):**
443
-
444
- ```typescript
445
- // frontend/src/components/auth/SimpleSignUpForm.tsx (AFTER)
446
- import { useState } from "react"
447
- import { Button } from "@/components/ui/button"
448
- import { Input } from "@/components/ui/input"
449
- import { Label } from "@/components/ui/label"
450
- import { useSignup } from "@/providers/hooks" // ✅ DataProvider hook
451
- import { toast } from "sonner"
452
- import { AuthCard } from "./AuthCard"
453
- import { SocialLoginButtons } from "./SocialLoginButtons"
454
- import { PasswordStrengthIndicator } from "./PasswordStrengthIndicator"
455
-
456
- export function SimpleSignUpForm() {
457
- const [email, setEmail] = useState("")
458
- const [password, setPassword] = useState("")
459
- const [name, setName] = useState("")
460
- const { mutate: signup, loading, error } = useSignup() // ✅ Hook manages state
461
-
462
- const handleSubmit = async (e: React.FormEvent) => {
463
- e.preventDefault()
464
-
465
- try {
466
- const result = await signup({ email, password, name }) // ✅ Simple call
467
-
468
- if (result.success) {
469
- toast.success("Account created successfully!", {
470
- description: `Welcome ${name}! Redirecting to your dashboard...`
471
- })
472
-
473
- setTimeout(() => {
474
- window.location.href = "/account"
475
- }, 1000)
476
- }
477
- } catch (err: any) {
478
- let title = "Unable to create account"
479
- let description = err.message || "Please verify your information and try again."
480
-
481
- // ✅ Typed error handling
482
- if (err._tag === "EmailAlreadyExists") {
483
- title = "Email already registered"
484
- description = "This email is already in use. Please sign in or use a different email."
485
- } else if (err._tag === "WeakPassword") {
486
- title = "Password too weak"
487
- description = "Password must be at least 8 characters with letters and numbers."
488
- } else if (err._tag === "NetworkError") {
489
- title = "Network error"
490
- description = "Unable to connect to the server. Check your internet connection."
491
- }
492
-
493
- toast.error(title, { description })
494
- }
495
- }
496
-
497
- return (
498
- <AuthCard title="Create Account" description="Sign up to get started">
499
- <SocialLoginButtons mode="signup" />
500
-
501
- <form onSubmit={handleSubmit} className="space-y-4">
502
- <div className="space-y-2">
503
- <Label htmlFor="name">Name</Label>
504
- <Input
505
- id="name"
506
- type="text"
507
- placeholder="Your name"
508
- value={name}
509
- onChange={(e) => setName(e.target.value)}
510
- />
511
- </div>
512
-
513
- <div className="space-y-2">
514
- <Label htmlFor="email">Email</Label>
515
- <Input
516
- id="email"
517
- type="email"
518
- placeholder="your@email.com"
519
- value={email}
520
- onChange={(e) => setEmail(e.target.value)}
521
- required
522
- />
523
- </div>
524
-
525
- <div className="space-y-2">
526
- <Label htmlFor="password">Password</Label>
527
- <Input
528
- id="password"
529
- type="password"
530
- placeholder="••••••••"
531
- value={password}
532
- onChange={(e) => setPassword(e.target.value)}
533
- required
534
- minLength={8}
535
- />
536
- <PasswordStrengthIndicator password={password} />
537
- </div>
538
-
539
- <Button type="submit" className="w-full" disabled={loading}>
540
- {loading ? "Signing up..." : "Sign Up"}
541
- </Button>
542
- </form>
543
- </AuthCard>
544
- )
545
- }
546
- ```
547
-
548
- **Key Changes:**
549
-
550
- - 🔥 **42 fewer lines** (157 → 115)
551
- - ✅ Cleaner error handling with typed errors
552
- - ✅ Password strength indicator preserved
553
- - ✅ Same UX, better code
554
-
555
- ---
556
-
557
- ### 2.3 MagicLinkAuth Migration
558
-
559
- **BEFORE (Current - 151 lines):**
560
-
561
- ```typescript
562
- // frontend/src/components/auth/MagicLinkAuth.tsx (BEFORE)
563
- import { useState, useEffect } from "react";
564
- import { Button } from "@/components/ui/button";
565
- import { toast } from "sonner";
566
- import { AuthCard } from "./AuthCard";
567
- import { CheckCircle2, Mail } from "lucide-react";
568
- import { Alert, AlertDescription } from "@/components/ui/alert";
569
- import { ConvexHttpClient } from "convex/browser"; // ❌ REMOVE
570
- import { api } from "../../../convex/_generated/api"; // ❌ REMOVE
571
-
572
- const convex = new ConvexHttpClient( // ❌ REMOVE
573
- import.meta.env.PUBLIC_CONVEX_URL || import.meta.env.NEXT_PUBLIC_CONVEX_URL,
574
- );
575
-
576
- interface MagicLinkAuthProps {
577
- token: string;
578
- }
579
-
580
- export function MagicLinkAuth({ token }: MagicLinkAuthProps) {
581
- const [loading, setLoading] = useState(false); // ❌ Manual state
582
- const [authSuccess, setAuthSuccess] = useState(false);
583
- const [tokenValid, setTokenValid] = useState(true);
584
- const [authenticating, setAuthenticating] = useState(true);
585
-
586
- useEffect(() => {
587
- const authenticateWithMagicLink = async () => {
588
- if (!token) {
589
- setTokenValid(false);
590
- setAuthenticating(false);
591
- toast.error("No magic link token", {
592
- description: "This link is missing a token.",
593
- });
594
- return;
595
- }
596
-
597
- setLoading(true);
598
- try {
599
- // ❌ Direct Convex mutation call
600
- const result = await convex.mutation(api.auth.signInWithMagicLink, {
601
- token,
602
- });
603
-
604
- if (result?.token) {
605
- // ❌ Manual cookie setting via API
606
- const response = await fetch("/api/auth/set-cookie", {
607
- method: "POST",
608
- headers: { "Content-Type": "application/json" },
609
- body: JSON.stringify({ token: result.token }),
610
- });
611
-
612
- if (response.ok) {
613
- setAuthSuccess(true);
614
- toast.success("Signed in successfully!", {
615
- description: "Redirecting to your dashboard...",
616
- });
617
-
618
- setTimeout(() => {
619
- window.location.href = "/account";
620
- }, 1500);
621
- } else {
622
- throw new Error("Failed to set authentication cookie");
623
- }
624
- }
625
- } catch (err: any) {
626
- setTokenValid(false);
627
- toast.error("Authentication failed", {
628
- description: err.message || "Invalid or expired link",
629
- });
630
- } finally {
631
- setLoading(false);
632
- setAuthenticating(false);
633
- }
634
- };
635
-
636
- authenticateWithMagicLink();
637
- }, [token]);
638
-
639
- // ... render logic (unchanged)
640
- }
641
- ```
642
-
643
- **AFTER (Migrated - 105 lines):**
644
-
645
- ```typescript
646
- // frontend/src/components/auth/MagicLinkAuth.tsx (AFTER)
647
- import { useState, useEffect } from "react"
648
- import { Button } from "@/components/ui/button"
649
- import { toast } from "sonner"
650
- import { AuthCard } from "./AuthCard"
651
- import { CheckCircle2, Mail } from "lucide-react"
652
- import { Alert, AlertDescription } from "@/components/ui/alert"
653
- import { useMagicLinkAuth } from "@/providers/hooks" // ✅ DataProvider hook
654
-
655
- interface MagicLinkAuthProps {
656
- token: string
657
- }
658
-
659
- export function MagicLinkAuth({ token }: MagicLinkAuthProps) {
660
- const { mutate: authenticate, loading, error } = useMagicLinkAuth() // ✅ Hook
661
- const [authSuccess, setAuthSuccess] = useState(false)
662
- const [tokenValid, setTokenValid] = useState(true)
663
-
664
- useEffect(() => {
665
- const authenticateWithToken = async () => {
666
- if (!token) {
667
- setTokenValid(false)
668
- toast.error("No magic link token", {
669
- description: "This link is missing a token."
670
- })
671
- return
672
- }
673
-
674
- try {
675
- const result = await authenticate({ token }) // ✅ Simple hook call
676
-
677
- if (result.success) {
678
- setAuthSuccess(true)
679
- toast.success("Signed in successfully!", {
680
- description: "Redirecting to your dashboard..."
681
- })
682
-
683
- setTimeout(() => {
684
- window.location.href = "/account"
685
- }, 1500)
686
- }
687
- } catch (err: any) {
688
- setTokenValid(false)
689
-
690
- let title = "Authentication failed"
691
- let description = err.message
692
-
693
- // ✅ Typed error handling
694
- if (err._tag === "InvalidToken" || err._tag === "TokenExpired") {
695
- title = "Invalid or expired link"
696
- description = "This magic link has expired or is invalid. Magic links expire after 15 minutes."
697
- }
698
-
699
- toast.error(title, { description })
700
- }
701
- }
702
-
703
- authenticateWithToken()
704
- }, [token])
705
-
706
- if (loading) {
707
- return (
708
- <AuthCard
709
- title="Signing you in"
710
- description="Please wait while we authenticate your magic link"
711
- >
712
- <div className="flex justify-center py-8">
713
- <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
714
- </div>
715
- </AuthCard>
716
- )
717
- }
718
-
719
- if (!tokenValid) {
720
- return (
721
- <AuthCard
722
- title="Authentication failed"
723
- description="This magic link is no longer valid"
724
- >
725
- <Alert variant="destructive">
726
- <Mail className="h-4 w-4" />
727
- <AlertDescription>
728
- This magic link has expired or is invalid. Magic links expire after 15 minutes.
729
- </AlertDescription>
730
- </Alert>
731
-
732
- <Button variant="outline" className="w-full" asChild>
733
- <a href="/account/magic-link">Request new magic link</a>
734
- </Button>
735
- </AuthCard>
736
- )
737
- }
738
-
739
- if (authSuccess) {
740
- return (
741
- <AuthCard
742
- title="Signed in successfully!"
743
- description="Redirecting to your dashboard"
744
- >
745
- <Alert className="border-green-500/50 bg-green-500/10">
746
- <CheckCircle2 className="h-4 w-4 text-green-500" />
747
- <AlertDescription>
748
- You've been successfully signed in with your magic link.
749
- </AlertDescription>
750
- </Alert>
751
-
752
- <Button className="w-full" asChild>
753
- <a href="/account">Go to dashboard</a>
754
- </Button>
755
- </AuthCard>
756
- )
757
- }
758
-
759
- return null
760
- }
761
- ```
762
-
763
- **Key Changes:**
764
-
765
- - ❌ Removed ConvexHttpClient import
766
- - ❌ Removed api import
767
- - ✅ Added `useMagicLinkAuth()` hook
768
- - 🔥 **46 fewer lines** (151 → 105)
769
- - ✅ Automatic cookie management (hook handles it)
770
- - ✅ Cleaner error handling
771
-
772
- ---
773
-
774
- ### 2.4 TwoFactorSettings Migration
775
-
776
- **BEFORE (Current - 293 lines):**
777
-
778
- ```typescript
779
- // frontend/src/components/auth/TwoFactorSettings.tsx (BEFORE)
780
- import { useState, useEffect } from "react";
781
- import { Button } from "@/components/ui/button";
782
- import { Input } from "@/components/ui/input";
783
- import { Label } from "@/components/ui/label";
784
- import { toast } from "sonner";
785
- import {
786
- Card,
787
- CardContent,
788
- CardDescription,
789
- CardHeader,
790
- CardTitle,
791
- } from "@/components/ui/card";
792
- import { Alert, AlertDescription } from "@/components/ui/alert";
793
- import { Shield, Key, Copy, CheckCircle2 } from "lucide-react";
794
- import { ConvexHttpClient } from "convex/browser"; // ❌ REMOVE
795
- import { api } from "../../../convex/_generated/api"; // ❌ REMOVE
796
- import * as OTPAuth from "otpauth";
797
- import QRCode from "qrcode";
798
-
799
- const convex = new ConvexHttpClient( // ❌ REMOVE
800
- import.meta.env.PUBLIC_CONVEX_URL || import.meta.env.NEXT_PUBLIC_CONVEX_URL,
801
- );
802
-
803
- export function TwoFactorSettings() {
804
- const [loading, setLoading] = useState(false); // ❌ Manual state
805
- const [status, setStatus] = useState<{ enabled: boolean; hasSetup: boolean }>(
806
- { enabled: false, hasSetup: false },
807
- );
808
- const [showSetup, setShowSetup] = useState(false);
809
- const [secret, setSecret] = useState("");
810
- const [backupCodes, setBackupCodes] = useState<string[]>([]);
811
- const [qrCodeUrl, setQrCodeUrl] = useState("");
812
- const [verificationCode, setVerificationCode] = useState("");
813
- const [disablePassword, setDisablePassword] = useState("");
814
-
815
- useEffect(() => {
816
- loadStatus();
817
- }, []);
818
-
819
- const loadStatus = async () => {
820
- try {
821
- // ❌ Manual token extraction from cookies
822
- const token = document.cookie
823
- .split("; ")
824
- .find((row) => row.startsWith("auth_token="))
825
- ?.split("=")[1];
826
- if (!token) return;
827
-
828
- // ❌ Direct Convex query
829
- const result = await convex.query(api.auth.get2FAStatus, { token });
830
- setStatus(result);
831
- } catch (err) {
832
- console.error("Failed to load 2FA status:", err);
833
- }
834
- };
835
-
836
- const handleSetup = async () => {
837
- setLoading(true); // ❌ Manual state
838
- try {
839
- const token = document.cookie
840
- .split("; ")
841
- .find((row) => row.startsWith("auth_token="))
842
- ?.split("=")[1];
843
- if (!token) {
844
- toast.error("Not authenticated");
845
- return;
846
- }
847
-
848
- // ❌ Direct Convex mutation
849
- const result = await convex.mutation(api.auth.setup2FA, { token });
850
- setSecret(result.secret);
851
- setBackupCodes(result.backupCodes);
852
-
853
- // Generate TOTP URI
854
- const totp = new OTPAuth.TOTP({
855
- issuer: "ONE",
856
- label: "user@one.ie",
857
- algorithm: "SHA1",
858
- digits: 6,
859
- period: 30,
860
- secret: OTPAuth.Secret.fromBase32(
861
- result.secret.toUpperCase().padEnd(32, "A"),
862
- ),
863
- });
864
-
865
- const uri = totp.toString();
866
- const qrUrl = await QRCode.toDataURL(uri);
867
- setQrCodeUrl(qrUrl);
868
- setShowSetup(true);
869
-
870
- toast.success("2FA setup initiated", {
871
- description: "Scan the QR code with your authenticator app",
872
- });
873
- } catch (err: any) {
874
- toast.error("Setup failed", {
875
- description: err.message || "Failed to setup 2FA",
876
- });
877
- } finally {
878
- setLoading(false); // ❌ Manual state
879
- }
880
- };
881
-
882
- const handleVerify = async () => {
883
- setLoading(true);
884
- try {
885
- const token = document.cookie
886
- .split("; ")
887
- .find((row) => row.startsWith("auth_token="))
888
- ?.split("=")[1];
889
- if (!token) {
890
- toast.error("Not authenticated");
891
- return;
892
- }
893
-
894
- // Client-side TOTP verification
895
- const totp = new OTPAuth.TOTP({
896
- issuer: "ONE",
897
- label: "user@one.ie",
898
- algorithm: "SHA1",
899
- digits: 6,
900
- period: 30,
901
- secret: OTPAuth.Secret.fromBase32(secret.toUpperCase().padEnd(32, "A")),
902
- });
903
-
904
- const delta = totp.validate({ token: verificationCode, window: 1 });
905
- if (delta === null) {
906
- toast.error("Invalid code", {
907
- description: "The verification code is incorrect. Please try again.",
908
- });
909
- setLoading(false);
910
- return;
911
- }
912
-
913
- // ❌ Direct Convex mutation
914
- await convex.mutation(api.auth.verify2FA, { token });
915
-
916
- toast.success("2FA enabled!", {
917
- description:
918
- "Two-factor authentication has been enabled for your account",
919
- });
920
-
921
- setShowSetup(false);
922
- loadStatus();
923
- } catch (err: any) {
924
- toast.error("Verification failed", {
925
- description: err.message || "Failed to verify code",
926
- });
927
- } finally {
928
- setLoading(false);
929
- }
930
- };
931
-
932
- const handleDisable = async () => {
933
- setLoading(true);
934
- try {
935
- const token = document.cookie
936
- .split("; ")
937
- .find((row) => row.startsWith("auth_token="))
938
- ?.split("=")[1];
939
- if (!token) {
940
- toast.error("Not authenticated");
941
- return;
942
- }
943
-
944
- // ❌ Direct Convex mutation
945
- await convex.mutation(api.auth.disable2FA, {
946
- token,
947
- password: disablePassword,
948
- });
949
-
950
- toast.success("2FA disabled", {
951
- description: "Two-factor authentication has been disabled",
952
- });
953
-
954
- setDisablePassword("");
955
- loadStatus();
956
- } catch (err: any) {
957
- toast.error("Failed to disable 2FA", {
958
- description: err.message || "Incorrect password",
959
- });
960
- } finally {
961
- setLoading(false);
962
- }
963
- };
964
-
965
- const copyToClipboard = (text: string) => {
966
- navigator.clipboard.writeText(text);
967
- toast.success("Copied to clipboard");
968
- };
969
-
970
- // ... rest of component (render logic - 150+ lines unchanged)
971
- }
972
- ```
973
-
974
- **AFTER (Migrated - 210 lines):**
975
-
976
- ```typescript
977
- // frontend/src/components/auth/TwoFactorSettings.tsx (AFTER)
978
- import { useState, useEffect } from "react";
979
- import { Button } from "@/components/ui/button";
980
- import { Input } from "@/components/ui/input";
981
- import { Label } from "@/components/ui/label";
982
- import { toast } from "sonner";
983
- import {
984
- Card,
985
- CardContent,
986
- CardDescription,
987
- CardHeader,
988
- CardTitle,
989
- } from "@/components/ui/card";
990
- import { Alert, AlertDescription } from "@/components/ui/alert";
991
- import { Shield, Key, Copy, CheckCircle2 } from "lucide-react";
992
- import { use2FA } from "@/providers/hooks"; // ✅ DataProvider hook
993
- import * as OTPAuth from "otpauth";
994
- import QRCode from "qrcode";
995
-
996
- export function TwoFactorSettings() {
997
- const { getStatus, setup, verify, disable, loading, error } = use2FA(); // ✅ Hook
998
- const [status, setStatus] = useState<{ enabled: boolean; hasSetup: boolean }>(
999
- { enabled: false, hasSetup: false },
1000
- );
1001
- const [showSetup, setShowSetup] = useState(false);
1002
- const [secret, setSecret] = useState("");
1003
- const [backupCodes, setBackupCodes] = useState<string[]>([]);
1004
- const [qrCodeUrl, setQrCodeUrl] = useState("");
1005
- const [verificationCode, setVerificationCode] = useState("");
1006
- const [disablePassword, setDisablePassword] = useState("");
1007
-
1008
- useEffect(() => {
1009
- loadStatus();
1010
- }, []);
1011
-
1012
- const loadStatus = async () => {
1013
- try {
1014
- const result = await getStatus(); // ✅ Simple hook call (no token needed)
1015
- setStatus(result);
1016
- } catch (err) {
1017
- console.error("Failed to load 2FA status:", err);
1018
- }
1019
- };
1020
-
1021
- const handleSetup = async () => {
1022
- try {
1023
- const result = await setup(); // ✅ Simple hook call
1024
- setSecret(result.secret);
1025
- setBackupCodes(result.backupCodes);
1026
-
1027
- // Generate TOTP URI (unchanged)
1028
- const totp = new OTPAuth.TOTP({
1029
- issuer: "ONE",
1030
- label: "user@one.ie",
1031
- algorithm: "SHA1",
1032
- digits: 6,
1033
- period: 30,
1034
- secret: OTPAuth.Secret.fromBase32(
1035
- result.secret.toUpperCase().padEnd(32, "A"),
1036
- ),
1037
- });
1038
-
1039
- const uri = totp.toString();
1040
- const qrUrl = await QRCode.toDataURL(uri);
1041
- setQrCodeUrl(qrUrl);
1042
- setShowSetup(true);
1043
-
1044
- toast.success("2FA setup initiated", {
1045
- description: "Scan the QR code with your authenticator app",
1046
- });
1047
- } catch (err: any) {
1048
- toast.error("Setup failed", {
1049
- description: err.message || "Failed to setup 2FA",
1050
- });
1051
- }
1052
- };
1053
-
1054
- const handleVerify = async () => {
1055
- try {
1056
- // Client-side TOTP verification (unchanged)
1057
- const totp = new OTPAuth.TOTP({
1058
- issuer: "ONE",
1059
- label: "user@one.ie",
1060
- algorithm: "SHA1",
1061
- digits: 6,
1062
- period: 30,
1063
- secret: OTPAuth.Secret.fromBase32(secret.toUpperCase().padEnd(32, "A")),
1064
- });
1065
-
1066
- const delta = totp.validate({ token: verificationCode, window: 1 });
1067
- if (delta === null) {
1068
- toast.error("Invalid code", {
1069
- description: "The verification code is incorrect. Please try again.",
1070
- });
1071
- return;
1072
- }
1073
-
1074
- await verify(verificationCode); // ✅ Simple hook call
1075
-
1076
- toast.success("2FA enabled!", {
1077
- description:
1078
- "Two-factor authentication has been enabled for your account",
1079
- });
1080
-
1081
- setShowSetup(false);
1082
- loadStatus();
1083
- } catch (err: any) {
1084
- toast.error("Verification failed", {
1085
- description: err.message || "Failed to verify code",
1086
- });
1087
- }
1088
- };
1089
-
1090
- const handleDisable = async () => {
1091
- try {
1092
- await disable(disablePassword); // ✅ Simple hook call
1093
-
1094
- toast.success("2FA disabled", {
1095
- description: "Two-factor authentication has been disabled",
1096
- });
1097
-
1098
- setDisablePassword("");
1099
- loadStatus();
1100
- } catch (err: any) {
1101
- toast.error("Failed to disable 2FA", {
1102
- description: err.message || "Incorrect password",
1103
- });
1104
- }
1105
- };
1106
-
1107
- const copyToClipboard = (text: string) => {
1108
- navigator.clipboard.writeText(text);
1109
- toast.success("Copied to clipboard");
1110
- };
1111
-
1112
- // ... render logic (unchanged - 100+ lines)
1113
- }
1114
- ```
1115
-
1116
- **Key Changes:**
1117
-
1118
- - ❌ Removed ConvexHttpClient
1119
- - ❌ Removed manual token extraction
1120
- - ✅ Added `use2FA()` hook with all operations
1121
- - 🔥 **83 fewer lines** (293 → 210)
1122
- - ✅ Automatic authentication (hook handles tokens)
1123
- - ✅ Same functionality, cleaner code
1124
-
1125
- ---
1126
-
1127
- ### 2.5 VerifyEmailForm Migration
1128
-
1129
- **BEFORE (Current - 134 lines):**
1130
-
1131
- ```typescript
1132
- // frontend/src/components/auth/VerifyEmailForm.tsx (BEFORE)
1133
- import { useState, useEffect } from "react";
1134
- import { Button } from "@/components/ui/button";
1135
- import { toast } from "sonner";
1136
- import { AuthCard } from "./AuthCard";
1137
- import { CheckCircle2, Mail } from "lucide-react";
1138
- import { Alert, AlertDescription } from "@/components/ui/alert";
1139
- import { ConvexHttpClient } from "convex/browser"; // ❌ REMOVE
1140
- import { api } from "../../../convex/_generated/api"; // ❌ REMOVE
1141
-
1142
- const convex = new ConvexHttpClient( // ❌ REMOVE
1143
- import.meta.env.PUBLIC_CONVEX_URL || import.meta.env.NEXT_PUBLIC_CONVEX_URL,
1144
- );
1145
-
1146
- interface VerifyEmailFormProps {
1147
- token: string;
1148
- }
1149
-
1150
- export function VerifyEmailForm({ token }: VerifyEmailFormProps) {
1151
- const [loading, setLoading] = useState(false); // ❌ Manual state
1152
- const [verifySuccess, setVerifySuccess] = useState(false);
1153
- const [tokenValid, setTokenValid] = useState(true);
1154
- const [verifying, setVerifying] = useState(true);
1155
-
1156
- useEffect(() => {
1157
- const verifyToken = async () => {
1158
- if (!token) {
1159
- setTokenValid(false);
1160
- setVerifying(false);
1161
- toast.error("No verification token", {
1162
- description: "This verification link is missing a token.",
1163
- });
1164
- return;
1165
- }
1166
-
1167
- setLoading(true);
1168
- try {
1169
- // ❌ Direct Convex mutation
1170
- const result = await convex.mutation(api.auth.verifyEmail, { token });
1171
-
1172
- if (result?.success) {
1173
- setVerifySuccess(true);
1174
- toast.success("Email verified successfully!", {
1175
- description:
1176
- "Your email has been verified. You can now access all features.",
1177
- });
1178
- }
1179
- } catch (err: any) {
1180
- setTokenValid(false);
1181
- toast.error("Verification failed", {
1182
- description: err.message || "Invalid or expired link",
1183
- });
1184
- } finally {
1185
- setLoading(false);
1186
- setVerifying(false);
1187
- }
1188
- };
1189
-
1190
- verifyToken();
1191
- }, [token]);
1192
-
1193
- // ... render logic (unchanged)
1194
- }
1195
- ```
1196
-
1197
- **AFTER (Migrated - 95 lines):**
1198
-
1199
- ```typescript
1200
- // frontend/src/components/auth/VerifyEmailForm.tsx (AFTER)
1201
- import { useState, useEffect } from "react"
1202
- import { Button } from "@/components/ui/button"
1203
- import { toast } from "sonner"
1204
- import { AuthCard } from "./AuthCard"
1205
- import { CheckCircle2, Mail } from "lucide-react"
1206
- import { Alert, AlertDescription } from "@/components/ui/alert"
1207
- import { useVerifyEmail } from "@/providers/hooks" // ✅ DataProvider hook
1208
-
1209
- interface VerifyEmailFormProps {
1210
- token: string
1211
- }
1212
-
1213
- export function VerifyEmailForm({ token }: VerifyEmailFormProps) {
1214
- const { mutate: verify, loading, error } = useVerifyEmail() // ✅ Hook
1215
- const [verifySuccess, setVerifySuccess] = useState(false)
1216
- const [tokenValid, setTokenValid] = useState(true)
1217
-
1218
- useEffect(() => {
1219
- const verifyToken = async () => {
1220
- if (!token) {
1221
- setTokenValid(false)
1222
- toast.error("No verification token", {
1223
- description: "This verification link is missing a token."
1224
- })
1225
- return
1226
- }
1227
-
1228
- try {
1229
- const result = await verify({ token }) // ✅ Simple hook call
1230
-
1231
- if (result.success) {
1232
- setVerifySuccess(true)
1233
- toast.success("Email verified successfully!", {
1234
- description: "Your email has been verified. You can now access all features."
1235
- })
1236
- }
1237
- } catch (err: any) {
1238
- setTokenValid(false)
1239
-
1240
- let title = "Verification failed"
1241
- let description = err.message
1242
-
1243
- // ✅ Typed error handling
1244
- if (err._tag === "InvalidToken" || err._tag === "TokenExpired") {
1245
- title = "Invalid or expired link"
1246
- description = "This verification link has expired or is invalid."
1247
- }
1248
-
1249
- toast.error(title, { description })
1250
- }
1251
- }
1252
-
1253
- verifyToken()
1254
- }, [token])
1255
-
1256
- if (loading) {
1257
- return (
1258
- <AuthCard
1259
- title="Verifying your email"
1260
- description="Please wait while we verify your email address"
1261
- >
1262
- <div className="flex justify-center py-8">
1263
- <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
1264
- </div>
1265
- </AuthCard>
1266
- )
1267
- }
1268
-
1269
- if (!tokenValid) {
1270
- return (
1271
- <AuthCard
1272
- title="Verification failed"
1273
- description="This verification link is no longer valid"
1274
- >
1275
- <Alert variant="destructive">
1276
- <Mail className="h-4 w-4" />
1277
- <AlertDescription>
1278
- This verification link has expired or is invalid. If you need a new verification email, please contact support.
1279
- </AlertDescription>
1280
- </Alert>
1281
-
1282
- <Button variant="outline" className="w-full" asChild>
1283
- <a href="/account">Go to dashboard</a>
1284
- </Button>
1285
- </AuthCard>
1286
- )
1287
- }
1288
-
1289
- if (verifySuccess) {
1290
- return (
1291
- <AuthCard
1292
- title="Email verified!"
1293
- description="Your email has been successfully verified"
1294
- >
1295
- <Alert className="border-green-500/50 bg-green-500/10">
1296
- <CheckCircle2 className="h-4 w-4 text-green-500" />
1297
- <AlertDescription>
1298
- Your email has been successfully verified. You can now access all features.
1299
- </AlertDescription>
1300
- </Alert>
1301
-
1302
- <Button className="w-full" asChild>
1303
- <a href="/account">Go to dashboard</a>
1304
- </Button>
1305
- </AuthCard>
1306
- )
1307
- }
1308
-
1309
- return null
1310
- }
1311
- ```
1312
-
1313
- **Key Changes:**
1314
-
1315
- - 🔥 **39 fewer lines** (134 → 95)
1316
- - ✅ Simple hook-based verification
1317
- - ✅ Automatic verification on mount
1318
-
1319
- ---
1320
-
1321
- ### 2.6 ForgotPasswordForm Migration
1322
-
1323
- **BEFORE (Current - 144 lines):**
1324
-
1325
- ```typescript
1326
- // frontend/src/components/auth/ForgotPasswordForm.tsx (BEFORE)
1327
- import { useState } from "react";
1328
- import { Button } from "@/components/ui/button";
1329
- import { Input } from "@/components/ui/input";
1330
- import { Label } from "@/components/ui/label";
1331
- import { toast } from "sonner";
1332
- import { AuthCard } from "./AuthCard";
1333
- import { AlertCircle, CheckCircle2 } from "lucide-react";
1334
- import { Alert, AlertDescription } from "@/components/ui/alert";
1335
-
1336
- export function ForgotPasswordForm() {
1337
- const [email, setEmail] = useState("");
1338
- const [loading, setLoading] = useState(false); // ❌ Manual state
1339
- const [emailSent, setEmailSent] = useState(false);
1340
-
1341
- const handleSubmit = async (e: React.FormEvent) => {
1342
- e.preventDefault();
1343
- setLoading(true); // ❌ Manual loading
1344
-
1345
- try {
1346
- // ❌ Direct fetch call
1347
- const response = await fetch("/api/auth/forgot-password", {
1348
- method: "POST",
1349
- headers: { "Content-Type": "application/json" },
1350
- body: JSON.stringify({ email }),
1351
- });
1352
-
1353
- const data = await response.json();
1354
-
1355
- if (!response.ok) {
1356
- const errorMessage = data.error || "Unable to send reset email";
1357
- // ... string-based error handling
1358
- toast.error("Unable to send reset email", {
1359
- description: errorMessage,
1360
- });
1361
- setLoading(false); // ❌ Manual state
1362
- return;
1363
- }
1364
-
1365
- setEmailSent(true);
1366
- toast.success("Reset email sent!", {
1367
- description: "Check your inbox for password reset instructions.",
1368
- });
1369
- setLoading(false);
1370
- } catch (err: any) {
1371
- toast.error("Request failed", {
1372
- description: `Error: ${err.message}. Please try again later.`,
1373
- });
1374
- setLoading(false); // ❌ Manual state
1375
- }
1376
- };
1377
-
1378
- // ... render logic (unchanged)
1379
- }
1380
- ```
1381
-
1382
- **AFTER (Migrated - 105 lines):**
1383
-
1384
- ```typescript
1385
- // frontend/src/components/auth/ForgotPasswordForm.tsx (AFTER)
1386
- import { useState } from "react"
1387
- import { Button } from "@/components/ui/button"
1388
- import { Input } from "@/components/ui/input"
1389
- import { Label } from "@/components/ui/label"
1390
- import { toast } from "sonner"
1391
- import { AuthCard } from "./AuthCard"
1392
- import { AlertCircle, CheckCircle2 } from "lucide-react"
1393
- import { Alert, AlertDescription } from "@/components/ui/alert"
1394
- import { usePasswordReset } from "@/providers/hooks" // ✅ DataProvider hook
1395
-
1396
- export function ForgotPasswordForm() {
1397
- const [email, setEmail] = useState("")
1398
- const { mutate: requestReset, loading, error } = usePasswordReset() // ✅ Hook
1399
- const [emailSent, setEmailSent] = useState(false)
1400
-
1401
- const handleSubmit = async (e: React.FormEvent) => {
1402
- e.preventDefault()
1403
-
1404
- try {
1405
- await requestReset({ email }) // ✅ Simple hook call
1406
-
1407
- setEmailSent(true)
1408
- toast.success("Reset email sent!", {
1409
- description: "Check your inbox for password reset instructions."
1410
- })
1411
- } catch (err: any) {
1412
- let title = "Unable to send reset email"
1413
- let description = err.message || "Please try again."
1414
-
1415
- // ✅ Typed error handling
1416
- if (err._tag === "UserNotFound") {
1417
- title = "Email not found"
1418
- description = "No account exists with this email address."
1419
- } else if (err._tag === "RateLimitExceeded") {
1420
- title = "Too many requests"
1421
- description = "Please wait a few minutes and try again."
1422
- } else if (err._tag === "NetworkError") {
1423
- title = "Network error"
1424
- description = "Unable to connect to the server."
1425
- }
1426
-
1427
- toast.error(title, { description })
1428
- }
1429
- }
1430
-
1431
- if (emailSent) {
1432
- return (
1433
- <AuthCard
1434
- title="Check your email"
1435
- description="We've sent password reset instructions"
1436
- >
1437
- <Alert className="border-green-500/50 bg-green-500/10">
1438
- <CheckCircle2 className="h-4 w-4 text-green-500" />
1439
- <AlertDescription>
1440
- If an account exists with <strong>{email}</strong>, you will receive an email.
1441
- </AlertDescription>
1442
- </Alert>
1443
-
1444
- <Button
1445
- variant="outline"
1446
- className="w-full"
1447
- onClick={() => {
1448
- setEmailSent(false)
1449
- setEmail("")
1450
- }}
1451
- >
1452
- Try another email
1453
- </Button>
1454
- </AuthCard>
1455
- )
1456
- }
1457
-
1458
- return (
1459
- <AuthCard title="Forgot your password?" description="Enter your email to receive reset instructions">
1460
- <Alert>
1461
- <AlertCircle className="h-4 w-4" />
1462
- <AlertDescription>
1463
- We'll send you an email with instructions to reset your password.
1464
- </AlertDescription>
1465
- </Alert>
1466
-
1467
- <form onSubmit={handleSubmit} className="space-y-4">
1468
- <div className="space-y-2">
1469
- <Label htmlFor="email">Email</Label>
1470
- <Input
1471
- id="email"
1472
- type="email"
1473
- placeholder="your@email.com"
1474
- value={email}
1475
- onChange={(e) => setEmail(e.target.value)}
1476
- required
1477
- />
1478
- </div>
1479
-
1480
- <Button type="submit" className="w-full" disabled={loading}>
1481
- {loading ? "Sending..." : "Send reset email"}
1482
- </Button>
1483
- </form>
1484
- </AuthCard>
1485
- )
1486
- }
1487
- ```
1488
-
1489
- **Key Changes:**
1490
-
1491
- - 🔥 **39 fewer lines** (144 → 105)
1492
- - ❌ Removed fetch call
1493
- - ✅ Added hook-based request
1494
-
1495
- ---
1496
-
1497
- ### 2.7 ResetPasswordForm Migration
1498
-
1499
- **AFTER (Complete):**
1500
-
1501
- ```typescript
1502
- // frontend/src/components/auth/ResetPasswordForm.tsx (AFTER)
1503
- import { useState, useEffect } from "react";
1504
- import { Button } from "@/components/ui/button";
1505
- import { Input } from "@/components/ui/input";
1506
- import { Label } from "@/components/ui/label";
1507
- import { toast } from "sonner";
1508
- import { AuthCard } from "./AuthCard";
1509
- import { PasswordStrengthIndicator } from "./PasswordStrengthIndicator";
1510
- import { CheckCircle2 } from "lucide-react";
1511
- import { Alert, AlertDescription } from "@/components/ui/alert";
1512
- import { usePasswordResetComplete } from "@/providers/hooks"; // ✅ Hook
1513
-
1514
- interface ResetPasswordFormProps {
1515
- token: string;
1516
- }
1517
-
1518
- export function ResetPasswordForm({ token }: ResetPasswordFormProps) {
1519
- const [password, setPassword] = useState("");
1520
- const [confirmPassword, setConfirmPassword] = useState("");
1521
- const { mutate: resetPassword, loading, error } = usePasswordResetComplete(); // ✅ Hook
1522
- const [resetSuccess, setResetSuccess] = useState(false);
1523
- const [tokenValid, setTokenValid] = useState(true);
1524
-
1525
- useEffect(() => {
1526
- // Token validation can be done on mount if needed
1527
- if (!token) {
1528
- setTokenValid(false);
1529
- toast.error("Invalid or expired token", {
1530
- description: "This password reset link is invalid or has expired.",
1531
- });
1532
- }
1533
- }, [token]);
1534
-
1535
- const handleSubmit = async (e: React.FormEvent) => {
1536
- e.preventDefault();
1537
-
1538
- if (password !== confirmPassword) {
1539
- toast.error("Passwords don't match", {
1540
- description: "Please make sure both password fields match.",
1541
- });
1542
- return;
1543
- }
1544
-
1545
- if (password.length < 8) {
1546
- toast.error("Password too short", {
1547
- description: "Password must be at least 8 characters long.",
1548
- });
1549
- return;
1550
- }
1551
-
1552
- try {
1553
- await resetPassword({ token, newPassword: password }); // ✅ Simple hook call
1554
-
1555
- setResetSuccess(true);
1556
- toast.success("Password reset successful!", {
1557
- description:
1558
- "Your password has been updated. Redirecting to sign in...",
1559
- });
1560
-
1561
- setTimeout(() => {
1562
- window.location.href = "/account/signin";
1563
- }, 2000);
1564
- } catch (err: any) {
1565
- let title = "Unable to reset password";
1566
- let description = err.message || "Please try again.";
1567
-
1568
- // ✅ Typed error handling
1569
- if (err._tag === "InvalidToken" || err._tag === "TokenExpired") {
1570
- title = "Invalid or expired token";
1571
- description =
1572
- "This password reset link is invalid or has expired. Please request a new one.";
1573
- setTokenValid(false);
1574
- } else if (err._tag === "WeakPassword") {
1575
- title = "Invalid password";
1576
- description =
1577
- "Password must be at least 8 characters with letters and numbers.";
1578
- } else if (err._tag === "NetworkError") {
1579
- title = "Network error";
1580
- description = "Unable to connect to the server.";
1581
- }
1582
-
1583
- toast.error(title, { description });
1584
- }
1585
- };
1586
-
1587
- // ... render logic (similar to BEFORE)
1588
- }
1589
- ```
1590
-
1591
- ---
1592
-
1593
- ## 3. Implementation Procedure (60 Steps)
1594
-
1595
- ### Phase 1: Pre-Migration Setup (Steps 1-12)
1596
-
1597
- **Step 1: Audit Current Implementation**
1598
-
1599
- ```bash
1600
- cd /Users/toc/Server/ONE/frontend
1601
-
1602
- # Count lines
1603
- wc -l src/components/auth/*.tsx
1604
-
1605
- # Find dependencies
1606
- grep -r "authClient" src/components/auth/
1607
- grep -r "ConvexHttpClient" src/components/auth/
1608
- grep -r "import.*convex" src/components/auth/
1609
- ```
1610
-
1611
- **Expected Output:**
1612
-
1613
- ```
1614
- 163 SimpleSignInForm.tsx
1615
- 157 SimpleSignUpForm.tsx
1616
- 151 MagicLinkAuth.tsx
1617
- 293 TwoFactorSettings.tsx
1618
- 134 VerifyEmailForm.tsx
1619
- 144 ForgotPasswordForm.tsx
1620
- 206 ResetPasswordForm.tsx
1621
- ```
1622
-
1623
- **Step 2: Run Baseline Tests**
1624
-
1625
- ```bash
1626
- # Save baseline results
1627
- bun test test/auth > baseline-auth-tests.txt 2>&1
1628
-
1629
- # Count passing tests
1630
- grep -c "PASS" baseline-auth-tests.txt
1631
- ```
1632
-
1633
- **Expected:** 50+ passing tests
1634
-
1635
- **Step 3: Create Migration Branch**
1636
-
1637
- ```bash
1638
- git checkout -b feature/auth-migration-2-5
1639
- git push -u origin feature/auth-migration-2-5
1640
- ```
1641
-
1642
- **Step 4: Create Rollback Tags**
1643
-
1644
- ```bash
1645
- # Tag before any changes
1646
- git tag rollback-pre-auth-migration
1647
- git push --tags
1648
- ```
1649
-
1650
- **Step 5: Verify Dependencies**
1651
-
1652
- ```bash
1653
- # Check DataProvider exists
1654
- test -f src/providers/DataProvider.ts || echo "ERROR: DataProvider missing"
1655
-
1656
- # Check hooks exist
1657
- test -f src/providers/hooks/index.ts || echo "ERROR: hooks missing"
1658
-
1659
- # Check ConvexAuthProvider exists
1660
- grep -q "ConvexAuthProvider" src/providers/ConvexProvider.ts || echo "ERROR: Provider missing"
1661
- ```
1662
-
1663
- **Step 6-12: Create Auth Hook Infrastructure**
1664
-
1665
- See full hook implementations in Appendix A.
1666
-
1667
- ---
1668
-
1669
- ### Phase 2: SimpleSignInForm Migration (Steps 13-17)
1670
-
1671
- **Step 13: Backup Current File**
1672
-
1673
- ```bash
1674
- cp src/components/auth/SimpleSignInForm.tsx src/components/auth/SimpleSignInForm.tsx.backup
1675
- ```
1676
-
1677
- **Step 14: Migrate SimpleSignInForm**
1678
-
1679
- Apply BEFORE → AFTER changes shown in section 2.1 above.
1680
-
1681
- **Step 15: Test SimpleSignInForm**
1682
-
1683
- ```bash
1684
- # Run login tests only
1685
- bun test test/auth/email-password.test.ts -t "login"
1686
-
1687
- # Manual testing checklist:
1688
- # 1. Login with valid credentials succeeds ✓
1689
- # 2. Login with invalid credentials shows error ✓
1690
- # 3. Login with non-existent email shows error ✓
1691
- # 4. Loading state displays correctly ✓
1692
- # 5. Success redirects to /account ✓
1693
- # 6. Session persists after refresh ✓
1694
- ```
1695
-
1696
- **Quality Gate:** ALL login tests must pass. If >5 tests fail → ROLLBACK.
1697
-
1698
- **Step 16: Compare Results**
1699
-
1700
- ```bash
1701
- bun test test/auth > step16-results.txt 2>&1
1702
- diff baseline-auth-tests.txt step16-results.txt
1703
- ```
1704
-
1705
- **Step 17: Commit SimpleSignInForm**
1706
-
1707
- ```bash
1708
- git add src/components/auth/SimpleSignInForm.tsx
1709
- git add src/providers/hooks/auth.ts
1710
- git commit -m "feat(auth): migrate SimpleSignInForm to DataProvider
1711
-
1712
- - Replace authClient.signIn.email() with useLogin() hook
1713
- - Improve error handling with typed errors (_tag pattern)
1714
- - Reduce code from 163 to 120 lines
1715
- - Preserve all existing functionality
1716
- - All login tests passing
1717
-
1718
- TESTS: bun test test/auth/email-password.test.ts
1719
- BREAKING: None
1720
- "
1721
- git tag rollback-post-signin-migration
1722
- git push --tags
1723
- ```
1724
-
1725
- ---
1726
-
1727
- ### Phase 3: SimpleSignUpForm Migration (Steps 18-22)
1728
-
1729
- **Step 18: Backup**
1730
-
1731
- ```bash
1732
- cp src/components/auth/SimpleSignUpForm.tsx src/components/auth/SimpleSignUpForm.tsx.backup
1733
- ```
1734
-
1735
- **Step 19: Migrate**
1736
-
1737
- Apply BEFORE → AFTER changes from section 2.2.
1738
-
1739
- **Step 20: Test**
1740
-
1741
- ```bash
1742
- bun test test/auth/email-password.test.ts -t "signup"
1743
- bun test test/auth
1744
-
1745
- # Manual tests:
1746
- # 1. Signup with new email succeeds ✓
1747
- # 2. Signup with existing email shows error ✓
1748
- # 3. Weak password shows error ✓
1749
- # 4. Password strength indicator works ✓
1750
- # 5. Success creates user + org membership ✓
1751
- ```
1752
-
1753
- **Step 21: Compare**
1754
-
1755
- ```bash
1756
- bun test test/auth > step21-results.txt 2>&1
1757
- diff baseline-auth-tests.txt step21-results.txt
1758
- ```
1759
-
1760
- **Step 22: Commit**
1761
-
1762
- ```bash
1763
- git add src/components/auth/SimpleSignUpForm.tsx
1764
- git commit -m "feat(auth): migrate SimpleSignUpForm to DataProvider
1765
-
1766
- - Replace authClient.signUp.email() with useSignup() hook
1767
- - Reduce code from 157 to 115 lines
1768
- - Preserve password strength indicator
1769
- - All signup tests passing
1770
-
1771
- TESTS: bun test test/auth/email-password.test.ts
1772
- "
1773
- git tag rollback-post-signup-migration
1774
- git push --tags
1775
- ```
1776
-
1777
- ---
1778
-
1779
- ### Phase 4: MagicLinkAuth Migration (Steps 23-27)
1780
-
1781
- **Step 23-27:** Follow same pattern as Phase 2-3.
1782
-
1783
- **Quality Gate:** All magic link tests must pass.
1784
-
1785
- ---
1786
-
1787
- ### Phase 5: TwoFactorSettings Migration (Steps 28-32)
1788
-
1789
- **Step 28-32:** Follow same pattern. This is the most complex component.
1790
-
1791
- **Quality Gate:** All 2FA tests must pass (TOTP generation, QR codes, backup codes).
1792
-
1793
- ---
1794
-
1795
- ### Phase 6: VerifyEmailForm Migration (Steps 33-37)
1796
-
1797
- **Step 33-37:** Follow same pattern.
1798
-
1799
- **Quality Gate:** Email verification tests must pass.
1800
-
1801
- ---
1802
-
1803
- ### Phase 7: Password Reset Forms (Steps 38-45)
1804
-
1805
- Migrate both ForgotPasswordForm and ResetPasswordForm.
1806
-
1807
- **Quality Gate:** All password reset tests must pass.
1808
-
1809
- ---
1810
-
1811
- ### Phase 8: Final Validation (Steps 46-60)
1812
-
1813
- **Step 46: Remove Direct Imports**
1814
-
1815
- ```bash
1816
- # Find remaining direct imports
1817
- grep -r "authClient" src/components/auth/
1818
- grep -r "ConvexHttpClient" src/components/auth/
1819
- grep -r "api\.auth" src/components/auth/
1820
-
1821
- # Should return NO results
1822
- ```
1823
-
1824
- **Step 47: TypeScript Check**
1825
-
1826
- ```bash
1827
- bunx astro check
1828
-
1829
- # Expected: 0 errors
1830
- ```
1831
-
1832
- **Step 48: Full Test Suite**
1833
-
1834
- ```bash
1835
- bun test test/auth > final-auth-tests.txt 2>&1
1836
-
1837
- # Compare to baseline
1838
- diff baseline-auth-tests.txt final-auth-tests.txt
1839
-
1840
- # Count passing
1841
- grep -c "PASS" final-auth-tests.txt
1842
- ```
1843
-
1844
- **Expected:** 50+ tests passing, same as baseline.
1845
-
1846
- **Step 49: Performance Testing**
1847
-
1848
- ```bash
1849
- # Measure login time
1850
- time curl -X POST http://localhost:4321/api/auth/signin \
1851
- -H "Content-Type: application/json" \
1852
- -d '{"email":"test@example.com","password":"password123"}'
1853
-
1854
- # Should complete in <2 seconds
1855
- ```
1856
-
1857
- **Step 50-60:** Documentation, cleanup, final review.
1858
-
1859
- ---
1860
-
1861
- ## 4. Rollback Plan
1862
-
1863
- ### Level 1: Single Component Rollback
1864
-
1865
- ```bash
1866
- # Example: Rollback SimpleSignInForm
1867
- git reset --hard rollback-pre-signin-migration
1868
-
1869
- # Restore backup
1870
- cp src/components/auth/SimpleSignInForm.tsx.backup src/components/auth/SimpleSignInForm.tsx
1871
-
1872
- # Verify tests pass
1873
- bun test test/auth/email-password.test.ts
1874
- ```
1875
-
1876
- **Time:** <5 minutes
1877
-
1878
- ### Level 2: Full Feature Rollback
1879
-
1880
- ```bash
1881
- # Rollback to pre-migration state
1882
- git reset --hard rollback-pre-auth-migration
1883
-
1884
- # Verify all tests pass
1885
- bun test test/auth
1886
- diff baseline-auth-tests.txt current-tests.txt
1887
- ```
1888
-
1889
- **Time:** <10 minutes
1890
-
1891
- ### Level 3: Feature Flag Rollback
1892
-
1893
- Create environment variable to toggle between old and new:
1894
-
1895
- ```bash
1896
- # .env.local
1897
- USE_NEW_AUTH_HOOKS=false # Use old authClient
1898
- USE_NEW_AUTH_HOOKS=true # Use new DataProvider (default)
1899
- ```
1900
-
1901
- **Time:** <2 minutes (just change env var and restart)
1902
-
1903
- ---
1904
-
1905
- ## 5. Testing Strategy
1906
-
1907
- ### Test Execution After Each Component
1908
-
1909
- ```bash
1910
- # Pattern:
1911
- bun test test/auth/[specific-test].test.ts
1912
- bun test test/auth # Full suite
1913
-
1914
- # If >5 tests fail:
1915
- # 1. Review errors
1916
- # 2. Check DataProvider implementation
1917
- # 3. Rollback to previous tag
1918
- # 4. Investigate and fix
1919
- # 5. Retry
1920
- ```
1921
-
1922
- ### Critical Test Cases (50+)
1923
-
1924
- **Email/Password (20 tests):**
1925
-
1926
- - ✅ Login with valid credentials
1927
- - ✅ Login with invalid password
1928
- - ✅ Login with non-existent email
1929
- - ✅ Signup with new email
1930
- - ✅ Signup with existing email
1931
- - ✅ Password strength validation
1932
- - ✅ Session persistence
1933
- - ✅ Logout functionality
1934
-
1935
- **OAuth (10 tests):**
1936
-
1937
- - ✅ GitHub OAuth flow
1938
- - ✅ Google OAuth flow
1939
- - ✅ Account linking
1940
- - ✅ OAuth error handling
1941
-
1942
- **Magic Links (8 tests):**
1943
-
1944
- - ✅ Request magic link
1945
- - ✅ Authenticate with valid token
1946
- - ✅ Expired token (>15 min)
1947
- - ✅ Used token (single-use)
1948
- - ✅ Invalid token
1949
-
1950
- **Password Reset (8 tests):**
1951
-
1952
- - ✅ Request reset
1953
- - ✅ Reset with valid token
1954
- - ✅ Expired token (>1 hour)
1955
- - ✅ New password works
1956
-
1957
- **Email Verification (4 tests):**
1958
-
1959
- - ✅ Verify with valid token
1960
- - ✅ Expired token
1961
- - ✅ Already verified
1962
-
1963
- **2FA (8 tests):**
1964
-
1965
- - ✅ Enable 2FA
1966
- - ✅ QR code generation
1967
- - ✅ Backup codes
1968
- - ✅ TOTP verification
1969
- - ✅ Disable 2FA
1970
-
1971
- ---
1972
-
1973
- ## 6. Quality Gates
1974
-
1975
- ### Mandatory Gates (MUST PASS)
1976
-
1977
- 1. **All 50+ auth tests pass** ✅
1978
- 2. **No direct Convex imports** ✅
1979
- 3. **TypeScript compiles (0 errors)** ✅
1980
- 4. **Performance within 10% baseline** ✅
1981
- 5. **Zero functionality regression** ✅
1982
-
1983
- ### Quality Metrics
1984
-
1985
- - Code reduction: **~250 fewer lines** (1,248 → ~1,000)
1986
- - Type safety: **100% typed errors** (no string checking)
1987
- - Maintainability: **Cleaner hook-based code**
1988
- - Testability: **Easier to mock providers**
1989
-
1990
- ---
1991
-
1992
- ## 7. Success Criteria
1993
-
1994
- ✅ **All 50+ tests passing**
1995
- ✅ **No direct authClient or Convex imports**
1996
- ✅ **TypeScript clean (0 errors)**
1997
- ✅ **Performance maintained**
1998
- ✅ **Documentation updated**
1999
- ✅ **Rollback plan tested**
2000
-
2001
- **Sign-Off Requirements:**
2002
-
2003
- 1. Frontend Specialist approval
2004
- 2. Quality Agent validation
2005
- 3. All tests green
2006
- 4. Performance benchmarks met
2007
- 5. Code review complete
2008
-
2009
- ---
2010
-
2011
- ## Appendix A: Complete Hook Implementations
2012
-
2013
- ### useLogin Hook
2014
-
2015
- ```typescript
2016
- // frontend/src/providers/hooks/auth.ts
2017
- import { useState } from "react";
2018
- import { useDataProvider } from "../DataProviderContext";
2019
- import type { AuthResult, LoginArgs } from "../types";
2020
-
2021
- export function useLogin() {
2022
- const provider = useDataProvider();
2023
- const [loading, setLoading] = useState(false);
2024
- const [error, setError] = useState<Error | null>(null);
2025
-
2026
- const mutate = async (args: LoginArgs): Promise<AuthResult> => {
2027
- setLoading(true);
2028
- setError(null);
2029
-
2030
- try {
2031
- const result = await provider.auth.login(args);
2032
- setLoading(false);
2033
- return result;
2034
- } catch (err) {
2035
- const error = err instanceof Error ? err : new Error(String(err));
2036
- setError(error);
2037
- setLoading(false);
2038
- throw error;
2039
- }
2040
- };
2041
-
2042
- return { mutate, loading, error };
2043
- }
2044
- ```
2045
-
2046
- ### use2FA Hook
2047
-
2048
- ```typescript
2049
- export function use2FA() {
2050
- const provider = useDataProvider();
2051
- const [loading, setLoading] = useState(false);
2052
- const [error, setError] = useState<Error | null>(null);
2053
-
2054
- const getStatus = async (): Promise<{
2055
- enabled: boolean;
2056
- hasSetup: boolean;
2057
- }> => {
2058
- try {
2059
- return await provider.auth.get2FAStatus();
2060
- } catch (err) {
2061
- throw err instanceof Error ? err : new Error(String(err));
2062
- }
2063
- };
2064
-
2065
- const setup = async (): Promise<{
2066
- secret: string;
2067
- backupCodes: string[];
2068
- }> => {
2069
- setLoading(true);
2070
- setError(null);
2071
-
2072
- try {
2073
- const result = await provider.auth.setup2FA();
2074
- setLoading(false);
2075
- return result;
2076
- } catch (err) {
2077
- const error = err instanceof Error ? err : new Error(String(err));
2078
- setError(error);
2079
- setLoading(false);
2080
- throw error;
2081
- }
2082
- };
2083
-
2084
- const verify = async (code: string): Promise<void> => {
2085
- setLoading(true);
2086
- setError(null);
2087
-
2088
- try {
2089
- await provider.auth.verify2FA({ code });
2090
- setLoading(false);
2091
- } catch (err) {
2092
- const error = err instanceof Error ? err : new Error(String(err));
2093
- setError(error);
2094
- setLoading(false);
2095
- throw error;
2096
- }
2097
- };
2098
-
2099
- const disable = async (password: string): Promise<void> => {
2100
- setLoading(true);
2101
- setError(null);
2102
-
2103
- try {
2104
- await provider.auth.disable2FA({ password });
2105
- setLoading(false);
2106
- } catch (err) {
2107
- const error = err instanceof Error ? err : new Error(String(err));
2108
- setError(error);
2109
- setLoading(false);
2110
- throw error;
2111
- }
2112
- };
2113
-
2114
- return { getStatus, setup, verify, disable, loading, error };
2115
- }
2116
- ```
2117
-
2118
- ---
2119
-
2120
- ## Appendix B: Error Types
2121
-
2122
- ```typescript
2123
- // frontend/src/providers/types/auth-errors.ts
2124
- export type AuthError =
2125
- | { _tag: "InvalidCredentials"; message: string; suggestion: string }
2126
- | { _tag: "UserNotFound"; message: string; suggestion: string }
2127
- | { _tag: "EmailAlreadyExists"; message: string; suggestion: string }
2128
- | { _tag: "WeakPassword"; message: string; suggestion: string }
2129
- | { _tag: "InvalidToken"; message: string; suggestion: string }
2130
- | { _tag: "TokenExpired"; message: string; suggestion: string }
2131
- | { _tag: "NetworkError"; message: string; suggestion: string }
2132
- | { _tag: "RateLimitExceeded"; message: string; suggestion: string }
2133
- | { _tag: "EmailNotVerified"; message: string; suggestion: string }
2134
- | { _tag: "TwoFactorRequired"; message: string; suggestion: string }
2135
- | { _tag: "Invalid2FACode"; message: string; suggestion: string };
2136
- ```
2137
-
2138
- ---
2139
-
2140
- **Total Specification Length:** 950+ lines
2141
- **Status:** ✅ COMPLETE - Ready for Implementation
2142
- **Next:** Wait for Feature 2-1 and 2-4 completion, then execute migration
2143
-
2144
- **Critical Reminder:** ALL 50+ auth tests MUST pass. <5 failures = continue. >5 failures = STOP and ROLLBACK immediately.