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,2554 +0,0 @@
1
- ---
2
- title: Implementation Examples
3
- dimension: knowledge
4
- category: implementation-examples.md
5
- tags: agent, ai, architecture, auth, backend, connections, events, frontend, knowledge, ontology
6
- related_dimensions: connections, events, people, things
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 knowledge dimension in the implementation-examples.md category.
13
- Location: one/knowledge/implementation-examples.md
14
- Purpose: Documents one platform - implementation examples
15
- Related dimensions: connections, events, people, things
16
- For AI agents: Read this to understand implementation examples.
17
- ---
18
-
19
-
20
- # ONE Platform - Implementation Examples
21
-
22
- **Complete Reference**: Ontology, DSL, Schema, and Implementation Patterns
23
-
24
- ---
25
-
26
- ## Overview
27
-
28
- The 6-dimension ontology architecture (things, connections, events, knowledge, people, protocols) provides unprecedented flexibility, while Convex + Effect.ts delivers production-grade reliability.
29
-
30
- **Tech Stack**: Astro + React + shadcn/ui frontend, Convex backend with comprehensive components (@convex-dev/agent, workflow, rag, rate-limiter), Effect.ts service layer, Stripe Connect for payments.
31
-
32
- ### Foundation Documents
33
-
34
- This document integrates information from:
35
-
36
- 1. **Ontology** (`Ontology.md`) - The 6-dimension data model that defines ALL things, connections, events, knowledge, people, and protocols
37
- 2. **DSL** (`DSL.md`, `ONE DSL.md`, `ONE DSL English.md`) - Domain-specific language for feature definition
38
- 3. **Schema** (`convex/schema.ts`) - Current authentication-focused schema and target ontology-based schema
39
- 4. **Implementation Examples** - Real-world code patterns and feature implementations
40
-
41
- ### Complete Architecture Stack
42
-
43
- ```
44
- ┌─────────────────────────────────────────────────────────────┐
45
- │ Plain English DSL (Creator/CEO writes features) │
46
- └─────────────────────────────────────────────────────────────┘
47
- ↓
48
- ┌─────────────────────────────────────────────────────────────┐
49
- │ Technical DSL (JSON-like, validates against ontology) │
50
- └─────────────────────────────────────────────────────────────┘
51
- ↓
52
- ┌─────────────────────────────────────────────────────────────┐
53
- │ Ontology (6 dimensions: things, connections, events, knowledge, people, protocols) │
54
- └─────────────────────────────────────────────────────────────┘
55
- ↓
56
- ┌─────────────────────────────────────────────────────────────┐
57
- │ Schema Definition (Convex with validation) │
58
- └─────────────────────────────────────────────────────────────┘
59
- ↓
60
- ┌─────────────────────────────────────────────────────────────┐
61
- │ Generated Types (TypeScript strict mode) │
62
- └─────────────────────────────────────────────────────────────┘
63
- ↓
64
- ┌─────────────────────────────────────────────────────────────┐
65
- │ Provider Services (Effect.ts with dependency injection) │
66
- └─────────────────────────────────────────────────────────────┘
67
- ↓
68
- ┌─────────────────────────────────────────────────────────────┐
69
- │ Compiled TypeScript (Production code with tests) │
70
- └─────────────────────────────────────────────────────────────┘
71
- ↓
72
- ┌─────────────────────────────────────────────────────────────┐
73
- │ Deployed Feature (Live on ONE platform) │
74
- └─────────────────────────────────────────────────────────────┘
75
- ```
76
-
77
- ### Why This Architecture Works
78
-
79
- **Ontology-First Design:**
80
- - Every feature maps to 6 dimensions (things, connections, events, knowledge, people, protocols)
81
- - Simple test: "If you can't map it to these 6 dimensions, rethink it"
82
- - AI agents can't generate invalid data models
83
-
84
- **DSL Validation:**
85
- - Plain English → Technical DSL → TypeScript
86
- - Validates against ontology before compilation
87
- - Generates type-safe code automatically
88
- - Non-technical users can write features
89
-
90
- **Schema Enforcement:**
91
- - Convex schema validates all database operations
92
- - Type-safe queries with full autocompletion
93
- - Indexed for performance (< 100ms queries)
94
- - Vector search for semantic operations
95
-
96
- **Effect.ts Service Layer:**
97
- - Typed error channels (no silent failures)
98
- - Automatic dependency injection
99
- - Testable with mocked services
100
- - Composable business logic
101
-
102
- ---
103
-
104
- ## Ontology: The 6-Dimension Universe
105
-
106
- **Purpose**: Complete data model for AI agents to understand how EVERYTHING in ONE platform is structured.
107
-
108
- ### Core Concept
109
-
110
- Every single thing in ONE platform exists in one of these 6 dimensions:
111
-
112
- ```
113
- ┌──────────────────────────────────────────────────────────────┐
114
- │ ENTITIES TABLE │
115
- │ Every "thing" - users, agents, content, tokens, courses │
116
- └──────────────────────────────────────────────────────────────┘
117
- ↓
118
- ┌──────────────────────────────────────────────────────────────┐
119
- │ CONNECTIONS TABLE │
120
- │ Every relationship - owns, follows, taught_by, powers │
121
- └──────────────────────────────────────────────────────────────┘
122
- ↓
123
- ┌──────────────────────────────────────────────────────────────┐
124
- │ EVENTS TABLE │
125
- │ Every action - purchased, created, viewed, completed │
126
- └──────────────────────────────────────────────────────────────┘
127
- ↓
128
- ┌──────────────────────────────────────────────────────────────┐
129
- │ TAGS TABLE │
130
- │ Every category - industry:fitness, skill:video, etc. │
131
- └──────────────────────────────────────────────────────────────┘
132
- ```
133
-
134
- **Golden Rule:** If you can't map your feature to these 6 dimensions, you're thinking about it wrong.
135
-
136
- ### Entity Types
137
-
138
- ```typescript
139
- type EntityType =
140
- // CORE
141
- | "creator" // Human creator
142
- | "ai_clone" // Digital twin of creator
143
- | "audience_member" // Fan/user
144
-
145
- // BUSINESS AGENTS (10 types)
146
- | "strategy_agent" // Vision, planning, OKRs
147
- | "research_agent" // Market, trends, competitors
148
- | "marketing_agent" // Content strategy, SEO, distribution
149
- | "sales_agent" // Funnels, conversion, follow-up
150
- | "service_agent" // Support, onboarding, success
151
- | "design_agent" // Brand, UI/UX, assets
152
- | "engineering_agent" // Tech, integration, automation
153
- | "finance_agent" // Revenue, costs, forecasting
154
- | "legal_agent" // Compliance, contracts, IP
155
- | "intelligence_agent" // Analytics, insights, predictions
156
-
157
- // CONTENT
158
- | "blog_post" // Written content
159
- | "video" // Video content
160
- | "podcast" // Audio content
161
- | "social_post" // Social media post
162
- | "email" // Email content
163
- | "course" // Educational course
164
- | "lesson" // Individual lesson
165
-
166
- // PRODUCTS
167
- | "digital_product" // Templates, tools, assets
168
- | "membership" // Tiered membership
169
- | "consultation" // 1-on-1 session
170
- | "nft" // NFT collectible
171
-
172
- // COMMUNITY
173
- | "community" // Community space
174
- | "conversation" // Thread/discussion
175
- | "message" // Individual message
176
-
177
- // TOKEN
178
- | "token" // Actual token instance
179
- | "token_contract" // Smart contract
180
-
181
- // KNOWLEDGE
182
- | "knowledge_item" // Piece of creator knowledge
183
- | "embedding" // Vector embedding
184
- ```
185
-
186
- ### Connection Types (Optimized 24 Types)
187
-
188
- **Design Philosophy**: Use metadata fields instead of proliferating connection types.
189
-
190
- ```typescript
191
- type ConnectionType =
192
- // OWNERSHIP (3 types)
193
- | "owns" // Creator owns token/content (metadata.revenueShare)
194
- | "created_by" // Content created by creator
195
- | "authored" // User authored content (vs. generated_by for AI)
196
-
197
- // AI RELATIONSHIPS (3 types)
198
- | "clone_of" // AI is clone of creator
199
- | "trained_on" // Clone trained on content (metadata.trainingDataType)
200
- | "powers" // Agent powers clone/feature (metadata.capability)
201
-
202
- // CONTENT RELATIONSHIPS (4 types)
203
- | "published_to" // Content published to platform (metadata.visibility)
204
- | "part_of" // Lesson part of course (metadata.order, metadata.section)
205
- | "references" // Content references entity (metadata.referenceType)
206
- | "derived_from" // Content derived from original (metadata.derivationType)
207
-
208
- // COMMUNITY RELATIONSHIPS (3 types)
209
- | "member_of" // User member of community (metadata.role, metadata.joinedAt)
210
- | "following" // User follows creator (metadata.notificationsEnabled)
211
- | "engaged_with" // User engaged with content (metadata.engagementType: "liked", "commented", "shared")
212
-
213
- // BUSINESS RELATIONSHIPS (3 types)
214
- | "manages" // Agent manages function (metadata.permissions)
215
- | "collaborates_with" // Entities collaborate (metadata.collaborationType, metadata.revenueShare)
216
- | "assigned_to" // Task assigned to entity (metadata.priority, metadata.deadline)
217
-
218
- // TRANSACTIONAL RELATIONSHIPS (4 types - consolidated from 7)
219
- | "transacted" // Generic transaction (metadata.transactionType: "purchase", "subscription", "invoice")
220
- | "holds" // User holds asset (metadata.assetType: "tokens", "nft", "stake", metadata.amount)
221
- | "enrolled_in" // User enrolled in course (metadata.progress, metadata.startedAt)
222
- | "completed" // User completed course/task (metadata.completedAt, metadata.certificateId)
223
-
224
- // REFERRAL/GROWTH (2 types)
225
- | "referred_by" // User referred by another (metadata.referralCode, metadata.conversionStatus)
226
- | "converted_from" // User converted from lead (metadata.conversionType, metadata.source)
227
-
228
- // MEDIA/ANALYTICS (2 types)
229
- | "featured_in" // Entity featured in content (metadata.startTime, metadata.endTime)
230
- | "analyzed_by" // Entity analyzed by intelligence (metadata.analysisType, metadata.confidence)
231
- ```
232
-
233
- **Key Improvements**:
234
- - **Before**: 30+ connection types
235
- - **After**: 24 optimized types
236
- - **Strategy**: Use `metadata` for variants (e.g., "transacted" with metadata.transactionType instead of "paid_for", "subscribed_to", "invoiced_to")
237
- - **Benefits**: Simpler schema, more flexible queries, easier to extend
238
-
239
- ### Event Types (Optimized 38 Types)
240
-
241
- **Design Philosophy**: Consolidate status variants into metadata fields.
242
-
243
- ```typescript
244
- type EventType =
245
- // ENTITY LIFECYCLE (6 types)
246
- | "entity_created" // Any entity created (metadata.entityType)
247
- | "entity_updated" // Any entity updated (metadata.fields)
248
- | "entity_deleted" // Soft delete (metadata.reason)
249
- | "entity_restored" // Undelete (metadata.restoredBy)
250
- | "entity_published" // Draft → Published (metadata.visibility)
251
- | "entity_archived" // Active → Archived (metadata.archiveReason)
252
-
253
- // AI/CLONE EVENTS (4 types)
254
- | "clone_interaction" // Chat/interaction with clone (metadata.messageCount, metadata.duration)
255
- | "clone_trained" // Training completed (metadata.dataPoints, metadata.model)
256
- | "ai_generated" // AI generated content (metadata.contentType, metadata.prompt)
257
- | "voice_cloned" // Voice clone created (metadata.provider, metadata.voiceId)
258
-
259
- // AGENT EVENTS (3 types - consolidated from 4)
260
- | "agent_executed" // Agent ran (metadata.status: "success", "failed", "partial")
261
- | "workflow_started" // Workflow initiated (metadata.workflowType, metadata.steps)
262
- | "workflow_completed" // Workflow finished (metadata.duration, metadata.status)
263
-
264
- // CONTENT EVENTS (5 types)
265
- | "content_viewed" // Content viewed (metadata.duration, metadata.completionRate)
266
- | "content_interacted" // User interacted (metadata.interactionType: "liked", "shared", "commented")
267
- | "content_downloaded" // Content downloaded (metadata.format)
268
- | "content_embedded" // Embedding generated (metadata.model, metadata.dimensions)
269
- | "content_moderated" // Moderation action (metadata.action, metadata.reason)
270
-
271
- // LEARNING EVENTS (4 types - consolidated from 5)
272
- | "course_enrolled" // User enrolled in course
273
- | "progress_updated" // Progress on course/lesson (metadata.entityId, metadata.progress)
274
- | "assessment_completed" // Test/quiz finished (metadata.score, metadata.passed)
275
- | "certificate_earned" // Certificate issued (metadata.certificateId, metadata.skills)
276
-
277
- // TOKEN/ASSET EVENTS (5 types - consolidated from 7)
278
- | "token_deployed" // Contract deployed (metadata.contractAddress, metadata.chain)
279
- | "token_transacted" // Token transaction (metadata.action: "purchased", "earned", "burned", metadata.amount)
280
- | "token_staked" // Staking action (metadata.action: "staked", "unstaked", metadata.amount, metadata.duration)
281
- | "governance_action" // Governance event (metadata.actionType: "vote", "proposal", "execution")
282
- | "nft_minted" // NFT minted (metadata.tokenId, metadata.metadata)
283
-
284
- // PAYMENT EVENTS (3 types - consolidated from 5)
285
- | "payment_processed" // Payment event (metadata.status: "initiated", "completed", "failed", "refunded")
286
- | "subscription_changed" // Subscription event (metadata.action: "started", "renewed", "cancelled", "upgraded")
287
- | "invoice_generated" // Invoice created/sent (metadata.amount, metadata.dueDate, metadata.status)
288
-
289
- // GROWTH/ENGAGEMENT (5 types)
290
- | "referral_created" // Referral made (metadata.referralCode, metadata.channel)
291
- | "referral_converted" // Referral converted (metadata.conversionValue)
292
- | "achievement_unlocked" // Achievement earned (metadata.achievementId, metadata.points)
293
- | "level_changed" // User level changed (metadata.oldLevel, metadata.newLevel, metadata.reason)
294
- | "viral_shared" // Viral share occurred (metadata.platform, metadata.reach)
295
-
296
- // ANALYTICS/INTELLIGENCE (3 types)
297
- | "metric_calculated" // Metric computed (metadata.metricType, metadata.value)
298
- | "insight_generated" // AI insight created (metadata.insightType, metadata.confidence)
299
- | "report_generated" // Report created (metadata.reportType, metadata.period)
300
- ```
301
-
302
- **Key Improvements**:
303
- - **Before**: 50+ event types with status variants
304
- - **After**: 38 consolidated types
305
- - **Strategy**: Use `metadata.status` or `metadata.action` for state variants
306
- - **Example**: "payment_initiated", "payment_completed", "payment_failed" → "payment_processed" with metadata.status
307
- - **Benefits**: Easier analytics queries, consistent event structure, simpler event handlers
308
-
309
- **For complete ontology details, see:** `Ontology.md`
310
-
311
- ---
312
-
313
- ## ONE DSL: Domain-Specific Language
314
-
315
- **Purpose**: Declarative language for defining features that compiles to Effect.ts and TypeScript.
316
-
317
- ### DSL Architecture Stack
318
-
319
- ```
320
- Plain English (CEO writes)
321
- ↓ [Parser]
322
- Technical DSL (validated against ontology)
323
- ↓ [Compiler]
324
- TypeScript with Effect.ts (production code)
325
- ↓ [Generated automatically]
326
- Tests + Documentation
327
- ↓
328
- Deployed Feature
329
- ```
330
-
331
- ### Plain English DSL
332
-
333
- **For creators and non-technical users** - Natural language that compiles to working code.
334
-
335
- **Example:**
336
- ```
337
- FEATURE: Let fans chat with my AI clone
338
-
339
- WHEN a fan sends a message
340
- CHECK they own tokens
341
- GET my AI personality
342
- SEND message to AI with my personality
343
- SAVE the conversation
344
- GIVE fan 10 tokens as reward
345
- SHOW AI response to fan
346
- ```
347
-
348
- **Core Commands:**
349
- - `CHECK` - Validate something
350
- - `CREATE` - Make something new
351
- - `CONNECT` - Link two things
352
- - `RECORD` - Log that something happened
353
- - `CALL` - Use external service
354
- - `GET` - Retrieve something
355
- - `IF/THEN/ELSE` - Conditional logic
356
- - `DO TOGETHER` - Atomic operations
357
- - `WAIT` - Pause execution
358
- - `FOR EACH` - Loop through items
359
- - `GIVE` - Return result
360
-
361
- ### Technical DSL
362
-
363
- **For AI agents and developers** - JSON-like syntax that validates against ontology.
364
-
365
- **Example:**
366
- ```typescript
367
- const createAICloneDSL = {
368
- feature: "CreateAIClone",
369
- input: {
370
- creatorId: "Id<entities>",
371
- videoUrls: "string[]",
372
- },
373
- output: {
374
- cloneId: "Id<entities>",
375
- voiceId: "string",
376
- },
377
- flow: [
378
- {
379
- validate: {
380
- creatorId: { exists: true, type: "creator" },
381
- videoUrls: { minLength: 3 },
382
- },
383
- onError: { return: { error: "InsufficientContent" } },
384
- },
385
- {
386
- service: {
387
- provider: "elevenlabs",
388
- method: "cloneVoice",
389
- params: { samples: "$audioSamples" },
390
- output: "voiceId",
391
- retry: { times: 3, delay: "5s" },
392
- },
393
- },
394
- {
395
- entity: {
396
- type: "ai_clone",
397
- name: "$creator.name + ' AI Clone'",
398
- properties: {
399
- voiceId: "$voiceId",
400
- systemPrompt: "$personality.systemPrompt",
401
- temperature: 0.7,
402
- },
403
- status: "active",
404
- },
405
- output: "cloneId",
406
- },
407
- {
408
- connect: {
409
- from: "$input.creatorId",
410
- to: "$cloneId",
411
- type: "owns",
412
- },
413
- },
414
- {
415
- event: {
416
- entity: "$cloneId",
417
- type: "clone_created",
418
- actor: "$input.creatorId",
419
- },
420
- },
421
- {
422
- return: {
423
- cloneId: "$cloneId",
424
- voiceId: "$voiceId",
425
- },
426
- },
427
- ],
428
- };
429
- ```
430
-
431
- **DSL Primitives:**
432
- - `entity` - Create entity in ontology
433
- - `connect` - Create relationship between entities
434
- - `event` - Log an event
435
- - `query` - Retrieve entities/connections/events
436
- - `flow` - Multi-step workflow with branching
437
- - `service` - Call external provider (OpenAI, ElevenLabs, Stripe, etc.)
438
- - `validate` - Check conditions
439
- - `atomic` - Group operations with rollback support
440
-
441
- ### DSL Validation & Compilation
442
-
443
- **Validator** - Ensures DSL uses only valid ontology types:
444
- ```typescript
445
- class ONEValidator {
446
- validate(dsl: any): { valid: boolean; errors: string[] } {
447
- // Validates all entity types exist in ontology
448
- // Validates all connection types exist in ontology
449
- // Validates all event types exist in ontology
450
- return { valid: true, errors: [] };
451
- }
452
- }
453
- ```
454
-
455
- **Compiler** - Generates type-safe TypeScript with Effect.ts:
456
- ```typescript
457
- class ONECompiler {
458
- compile(dsl: any): string {
459
- // Compiles DSL to TypeScript
460
- // Generates Effect.ts service calls
461
- // Adds proper error handling
462
- // Creates fully typed code
463
- return generatedCode;
464
- }
465
- }
466
- ```
467
-
468
- **Complete DSL examples and specifications in:** `DSL.md`, `ONE DSL.md`, `ONE DSL English.md`
469
-
470
- ---
471
-
472
- ## Schema Implementation
473
-
474
- ### Current Schema (Authentication Focus)
475
-
476
- **File**: `convex/schema.ts` (Current - Authentication focused)
477
-
478
- ```typescript
479
- import { defineSchema, defineTable } from "convex/server";
480
- import { v } from "convex/values";
481
-
482
- export default defineSchema({
483
- users: defineTable({
484
- email: v.string(),
485
- passwordHash: v.string(),
486
- name: v.optional(v.string()),
487
- emailVerified: v.optional(v.boolean()),
488
- createdAt: v.number(),
489
- }).index("by_email", ["email"]),
490
-
491
- sessions: defineTable({
492
- userId: v.id("users"),
493
- token: v.string(),
494
- expiresAt: v.number(),
495
- createdAt: v.number(),
496
- }).index("by_token", ["token"])
497
- .index("by_userId", ["userId"]),
498
-
499
- passwordResets: defineTable({
500
- userId: v.id("users"),
501
- token: v.string(),
502
- expiresAt: v.number(),
503
- createdAt: v.number(),
504
- used: v.boolean(),
505
- }).index("by_token", ["token"])
506
- .index("by_userId", ["userId"]),
507
-
508
- emailVerifications: defineTable({
509
- userId: v.id("users"),
510
- email: v.string(),
511
- token: v.string(),
512
- expiresAt: v.number(),
513
- createdAt: v.number(),
514
- verified: v.boolean(),
515
- }).index("by_token", ["token"])
516
- .index("by_userId", ["userId"])
517
- .index("by_email", ["email"]),
518
-
519
- magicLinks: defineTable({
520
- email: v.string(),
521
- token: v.string(),
522
- expiresAt: v.number(),
523
- createdAt: v.number(),
524
- used: v.boolean(),
525
- }).index("by_token", ["token"])
526
- .index("by_email", ["email"]),
527
-
528
- twoFactorAuth: defineTable({
529
- userId: v.id("users"),
530
- secret: v.string(),
531
- backupCodes: v.array(v.string()),
532
- enabled: v.boolean(),
533
- createdAt: v.number(),
534
- }).index("by_userId", ["userId"]),
535
- });
536
- ```
537
-
538
- ### Target Ontology-Based Schema (Plain Convex)
539
-
540
- **Future implementation** - 6-dimension architecture with full ontology support:
541
-
542
- ```typescript
543
- import { defineSchema, defineTable } from "convex/server";
544
- import { v } from "convex/values";
545
-
546
- export default defineSchema({
547
- // ENTITIES TABLE - All "things"
548
- entities: defineTable({
549
- type: v.union(
550
- // Core
551
- v.literal("creator"),
552
- v.literal("ai_clone"),
553
- v.literal("audience_member"),
554
- // Business Agents
555
- v.literal("strategy_agent"),
556
- v.literal("research_agent"),
557
- v.literal("marketing_agent"),
558
- v.literal("sales_agent"),
559
- v.literal("service_agent"),
560
- v.literal("design_agent"),
561
- v.literal("engineering_agent"),
562
- v.literal("finance_agent"),
563
- v.literal("legal_agent"),
564
- v.literal("intelligence_agent"),
565
- // Content
566
- v.literal("blog_post"),
567
- v.literal("video"),
568
- v.literal("podcast"),
569
- v.literal("social_post"),
570
- v.literal("email"),
571
- v.literal("course"),
572
- v.literal("lesson"),
573
- // Products
574
- v.literal("digital_product"),
575
- v.literal("membership"),
576
- v.literal("consultation"),
577
- v.literal("nft"),
578
- // Community
579
- v.literal("community"),
580
- v.literal("conversation"),
581
- v.literal("message"),
582
- // Token
583
- v.literal("token"),
584
- v.literal("token_contract"),
585
- // Knowledge
586
- v.literal("knowledge_item"),
587
- v.literal("embedding"),
588
- // Platform
589
- v.literal("website"),
590
- v.literal("landing_page"),
591
- v.literal("template"),
592
- v.literal("livestream"),
593
- v.literal("recording"),
594
- v.literal("media_asset"),
595
- // Business
596
- v.literal("payment"),
597
- v.literal("subscription"),
598
- v.literal("invoice"),
599
- v.literal("metric"),
600
- v.literal("insight"),
601
- v.literal("prediction"),
602
- v.literal("report"),
603
- // Marketing
604
- v.literal("notification"),
605
- v.literal("email_campaign"),
606
- v.literal("announcement"),
607
- v.literal("referral"),
608
- v.literal("campaign"),
609
- v.literal("lead")
610
- ),
611
- name: v.string(),
612
- properties: v.any(), // Type-specific properties as JSON
613
- status: v.optional(
614
- v.union(
615
- v.literal("active"),
616
- v.literal("inactive"),
617
- v.literal("draft"),
618
- v.literal("published"),
619
- v.literal("archived")
620
- )
621
- ),
622
- createdAt: v.number(),
623
- updatedAt: v.number(),
624
- deletedAt: v.optional(v.number()),
625
- })
626
- .index("by_type", ["type"])
627
- .index("by_status", ["status"])
628
- .index("by_createdAt", ["createdAt"])
629
- .index("by_type_status", ["type", "status"])
630
- .searchIndex("search_entities", {
631
- searchField: "name",
632
- filterFields: ["type", "status"],
633
- }),
634
-
635
- // CONNECTIONS TABLE - All relationships
636
- connections: defineTable({
637
- fromEntityId: v.id("entities"),
638
- toEntityId: v.id("entities"),
639
- relationshipType: v.union(
640
- // Ownership (3 types)
641
- v.literal("owns"),
642
- v.literal("created_by"),
643
- v.literal("authored"),
644
- // AI relationships (3 types)
645
- v.literal("clone_of"),
646
- v.literal("trained_on"),
647
- v.literal("powers"),
648
- // Content relationships (4 types)
649
- v.literal("published_to"),
650
- v.literal("part_of"),
651
- v.literal("references"),
652
- v.literal("derived_from"),
653
- // Community relationships (3 types)
654
- v.literal("member_of"),
655
- v.literal("following"),
656
- v.literal("engaged_with"),
657
- // Business relationships (3 types)
658
- v.literal("manages"),
659
- v.literal("collaborates_with"),
660
- v.literal("assigned_to"),
661
- // Transactional relationships (4 types)
662
- v.literal("transacted"),
663
- v.literal("holds"),
664
- v.literal("enrolled_in"),
665
- v.literal("completed"),
666
- // Referral/growth (2 types)
667
- v.literal("referred_by"),
668
- v.literal("converted_from"),
669
- // Media/analytics (2 types)
670
- v.literal("featured_in"),
671
- v.literal("analyzed_by")
672
- ),
673
- metadata: v.optional(v.any()),
674
- strength: v.optional(v.number()),
675
- validFrom: v.optional(v.number()),
676
- validTo: v.optional(v.number()),
677
- createdAt: v.number(),
678
- updatedAt: v.optional(v.number()),
679
- })
680
- .index("by_relationshipType", ["relationshipType"])
681
- .index("by_fromEntity", ["fromEntityId"])
682
- .index("by_toEntity", ["toEntityId"])
683
- .index("by_from_type", ["fromEntityId", "relationshipType"])
684
- .index("by_to_type", ["toEntityId", "relationshipType"])
685
- .index("by_bidirectional", ["fromEntityId", "toEntityId"])
686
- .index("by_type_from_to", ["relationshipType", "fromEntityId", "toEntityId"]),
687
-
688
- // EVENTS TABLE - All actions
689
- events: defineTable({
690
- entityId: v.id("entities"),
691
- eventType: v.union(
692
- // Entity lifecycle (6 types)
693
- v.literal("entity_created"),
694
- v.literal("entity_updated"),
695
- v.literal("entity_deleted"),
696
- v.literal("entity_restored"),
697
- v.literal("entity_published"),
698
- v.literal("entity_archived"),
699
- // AI/Clone events (4 types)
700
- v.literal("clone_interaction"),
701
- v.literal("clone_trained"),
702
- v.literal("ai_generated"),
703
- v.literal("voice_cloned"),
704
- // Agent events (3 types)
705
- v.literal("agent_executed"),
706
- v.literal("workflow_started"),
707
- v.literal("workflow_completed"),
708
- // Content events (5 types)
709
- v.literal("content_viewed"),
710
- v.literal("content_interacted"),
711
- v.literal("content_downloaded"),
712
- v.literal("content_embedded"),
713
- v.literal("content_moderated"),
714
- // Learning events (4 types)
715
- v.literal("course_enrolled"),
716
- v.literal("progress_updated"),
717
- v.literal("assessment_completed"),
718
- v.literal("certificate_earned"),
719
- // Token/asset events (5 types)
720
- v.literal("token_deployed"),
721
- v.literal("token_transacted"),
722
- v.literal("token_staked"),
723
- v.literal("governance_action"),
724
- v.literal("nft_minted"),
725
- // Payment events (3 types)
726
- v.literal("payment_processed"),
727
- v.literal("subscription_changed"),
728
- v.literal("invoice_generated"),
729
- // Growth/engagement (5 types)
730
- v.literal("referral_created"),
731
- v.literal("referral_converted"),
732
- v.literal("achievement_unlocked"),
733
- v.literal("level_changed"),
734
- v.literal("viral_shared"),
735
- // Analytics/intelligence (3 types)
736
- v.literal("metric_calculated"),
737
- v.literal("insight_generated"),
738
- v.literal("report_generated")
739
- ),
740
- timestamp: v.number(),
741
- metadata: v.optional(v.any()),
742
- actorType: v.optional(
743
- v.union(
744
- v.literal("user"),
745
- v.literal("ai_agent"),
746
- v.literal("system"),
747
- v.literal("api")
748
- )
749
- ),
750
- actorId: v.optional(v.id("entities")),
751
- source: v.optional(v.string()),
752
- sessionId: v.optional(v.string()),
753
- })
754
- .index("by_entity", ["entityId"])
755
- .index("by_timestamp", ["timestamp"])
756
- .index("by_eventType", ["eventType"])
757
- .index("by_entity_type", ["entityId", "eventType"])
758
- .index("by_entity_type_time", ["entityId", "eventType", "timestamp"])
759
- .index("by_type_time", ["eventType", "timestamp"])
760
- .index("by_session", ["sessionId", "timestamp"])
761
- .index("by_actor", ["actorId", "timestamp"]),
762
-
763
- // TAGS TABLE - All categories
764
- tags: defineTable({
765
- name: v.string(),
766
- category: v.optional(
767
- v.union(
768
- v.literal("skill"),
769
- v.literal("industry"),
770
- v.literal("topic"),
771
- v.literal("format"),
772
- v.literal("goal"),
773
- v.literal("audience"),
774
- v.literal("technology"),
775
- v.literal("status")
776
- )
777
- ),
778
- description: v.optional(v.string()),
779
- color: v.optional(v.string()),
780
- icon: v.optional(v.string()),
781
- usageCount: v.number(),
782
- createdAt: v.number(),
783
- })
784
- .index("by_name", ["name"])
785
- .index("by_category", ["category"])
786
- .index("by_usageCount", ["usageCount"]),
787
-
788
- // ENTITY-TAG JUNCTION TABLE
789
- entityTags: defineTable({
790
- entityId: v.id("entities"),
791
- tagId: v.id("tags"),
792
- createdAt: v.number(),
793
- })
794
- .index("by_entity", ["entityId"])
795
- .index("by_tag", ["tagId"])
796
- .index("by_entity_tag", ["entityId", "tagId"]),
797
-
798
- // EMBEDDINGS TABLE - Vector search
799
- embeddings: defineTable({
800
- entityId: v.id("entities"),
801
- embedding: v.array(v.float64()),
802
- model: v.string(),
803
- createdAt: v.number(),
804
- })
805
- .index("by_entity", ["entityId"])
806
- .vectorIndex("by_embedding", {
807
- vectorField: "embedding",
808
- dimensions: 1536,
809
- filterFields: ["entityId", "model"],
810
- }),
811
- });
812
- ```
813
-
814
- **Migration Strategy**: Batched processing with dual-write pattern during transition period.
815
-
816
- **Success Criteria**: ✅ Schema deploys without errors, ✅ All entity types creatable, ✅ Relationship queries work
817
-
818
- ### Metadata-Based Query Patterns
819
-
820
- **Purpose**: Show how to query consolidated types using metadata filters instead of proliferating specific types.
821
-
822
- #### Example 1: Query Payments by Status
823
-
824
- ```typescript
825
- // OLD WAY: Multiple event types
826
- // query("events").filter(q =>
827
- // q.or(
828
- // q.eq(q.field("eventType"), "payment_initiated"),
829
- // q.eq(q.field("eventType"), "payment_completed"),
830
- // q.eq(q.field("eventType"), "payment_failed")
831
- // )
832
- // )
833
-
834
- // NEW WAY: Single event type with metadata filter
835
- export const getPaymentsByStatus = query({
836
- args: { status: v.union(v.literal("initiated"), v.literal("completed"), v.literal("failed"), v.literal("refunded")) },
837
- handler: async (ctx, args) => {
838
- const payments = await ctx.db
839
- .query("events")
840
- .withIndex("by_eventType", (q) => q.eq("eventType", "payment_processed"))
841
- .filter((q) => q.eq(q.field("metadata.status"), args.status))
842
- .order("desc")
843
- .take(100);
844
-
845
- return payments;
846
- },
847
- });
848
- ```
849
-
850
- #### Example 2: Query Connections by Transaction Type
851
-
852
- ```typescript
853
- // OLD WAY: Separate connection types for each transaction
854
- // "paid_for", "subscribed_to", "invoiced_to"
855
-
856
- // NEW WAY: Single "transacted" type with metadata
857
- export const getTransactionsByType = query({
858
- args: {
859
- userId: v.id("entities"),
860
- transactionType: v.union(v.literal("purchase"), v.literal("subscription"), v.literal("invoice"))
861
- },
862
- handler: async (ctx, args) => {
863
- const transactions = await ctx.db
864
- .query("connections")
865
- .withIndex("by_from_type", (q) =>
866
- q.eq("fromEntityId", args.userId).eq("relationshipType", "transacted")
867
- )
868
- .filter((q) => q.eq(q.field("metadata.transactionType"), args.transactionType))
869
- .collect();
870
-
871
- return transactions;
872
- },
873
- });
874
- ```
875
-
876
- #### Example 3: Query User Engagement by Interaction Type
877
-
878
- ```typescript
879
- // OLD WAY: Multiple connection types
880
- // "content_liked", "content_shared", "content_commented"
881
-
882
- // NEW WAY: Single "engaged_with" type with metadata
883
- export const getUserEngagement = query({
884
- args: {
885
- contentId: v.id("entities"),
886
- interactionType: v.optional(v.union(v.literal("liked"), v.literal("shared"), v.literal("commented")))
887
- },
888
- handler: async (ctx, args) => {
889
- let engagements = ctx.db
890
- .query("connections")
891
- .withIndex("by_to_type", (q) =>
892
- q.eq("toEntityId", args.contentId).eq("relationshipType", "engaged_with")
893
- );
894
-
895
- // Filter by interaction type if specified
896
- if (args.interactionType) {
897
- engagements = engagements.filter((q) =>
898
- q.eq(q.field("metadata.engagementType"), args.interactionType)
899
- );
900
- }
901
-
902
- return await engagements.collect();
903
- },
904
- });
905
- ```
906
-
907
- #### Example 4: Query Agent Executions by Status
908
-
909
- ```typescript
910
- // OLD WAY: Multiple event types
911
- // "agent_executed", "agent_completed", "agent_failed"
912
-
913
- // NEW WAY: Single event type with status in metadata
914
- export const getAgentExecutions = query({
915
- args: {
916
- agentId: v.id("entities"),
917
- status: v.optional(v.union(v.literal("success"), v.literal("failed"), v.literal("partial")))
918
- },
919
- handler: async (ctx, args) => {
920
- let executions = ctx.db
921
- .query("events")
922
- .withIndex("by_entity_type", (q) =>
923
- q.eq("entityId", args.agentId).eq("eventType", "agent_executed")
924
- );
925
-
926
- // Filter by status if specified
927
- if (args.status) {
928
- executions = executions.filter((q) =>
929
- q.eq(q.field("metadata.status"), args.status)
930
- );
931
- }
932
-
933
- return await executions.order("desc").take(50);
934
- },
935
- });
936
- ```
937
-
938
- #### Example 5: Analytics Query Across Consolidated Types
939
-
940
- ```typescript
941
- // Query all payment statuses for analytics
942
- export const getPaymentAnalytics = query({
943
- args: { startDate: v.number(), endDate: v.number() },
944
- handler: async (ctx, args) => {
945
- const payments = await ctx.db
946
- .query("events")
947
- .withIndex("by_type_time", (q) =>
948
- q.eq("eventType", "payment_processed")
949
- .gte("timestamp", args.startDate)
950
- .lte("timestamp", args.endDate)
951
- )
952
- .collect();
953
-
954
- // Aggregate by status
955
- const analytics = {
956
- initiated: 0,
957
- completed: 0,
958
- failed: 0,
959
- refunded: 0,
960
- totalAmount: 0,
961
- };
962
-
963
- payments.forEach((payment) => {
964
- const status = payment.metadata?.status || "unknown";
965
- if (status in analytics) {
966
- analytics[status]++;
967
- }
968
- if (status === "completed") {
969
- analytics.totalAmount += payment.metadata?.amount || 0;
970
- }
971
- });
972
-
973
- return analytics;
974
- },
975
- });
976
- ```
977
-
978
- **Benefits of Metadata-Based Queries**:
979
- - **Simpler schema**: 25 connection types vs. 30+, 35 event types vs. 50+
980
- - **Easier analytics**: Single event type aggregation vs. multiple OR conditions
981
- - **More flexible**: Add new statuses without schema migrations
982
- - **Better performance**: Index on single eventType, filter on metadata
983
- - **Clearer intent**: `metadata.status` explicitly shows state variants
984
-
985
- ---
986
-
987
- ## Quick Reference Guide
988
-
989
- ### How to Build a Feature (Step-by-Step)
990
-
991
- **1. Map to Ontology**
992
- - What **entities** are involved? (creator, ai_clone, token, etc.)
993
- - What **connections** link them? (owns, follows, enrolled_in, etc.)
994
- - What **events** need logging? (clone_created, tokens_purchased, etc.)
995
- - What **tags** categorize them? (industry:fitness, skill:video, etc.)
996
-
997
- **2. Write in Plain English DSL**
998
- ```
999
- FEATURE: [What this does]
1000
-
1001
- INPUT:
1002
- - [what you need]
1003
-
1004
- OUTPUT:
1005
- - [what you get back]
1006
-
1007
- FLOW:
1008
- CHECK [validations]
1009
- CALL [external services]
1010
- CREATE [entities]
1011
- CONNECT [relationships]
1012
- RECORD [events]
1013
- GIVE [results]
1014
- ```
1015
-
1016
- **3. Validate Against Ontology**
1017
- ```typescript
1018
- const validator = new ONEValidator(ontology);
1019
- const validation = validator.validate(myFeatureDSL);
1020
- if (!validation.valid) {
1021
- console.error(validation.errors);
1022
- }
1023
- ```
1024
-
1025
- **4. Compile to TypeScript**
1026
- ```typescript
1027
- const compiler = new ONECompiler();
1028
- const code = compiler.compile(myFeatureDSL);
1029
- // Generates type-safe Effect.ts code
1030
- ```
1031
-
1032
- **5. Deploy**
1033
- ```bash
1034
- # Code is automatically tested and deployed
1035
- ```
1036
-
1037
- ### Common Patterns
1038
-
1039
- **Pattern: Create Thing with Ownership**
1040
- ```typescript
1041
- // DSL
1042
- {
1043
- thing: { type: "ai_clone", name: "My Clone", properties: {...} },
1044
- output: "cloneId"
1045
- }
1046
- {
1047
- connect: { from: "$creatorId", to: "$cloneId", type: "owns" }
1048
- }
1049
- {
1050
- event: { thing: "$cloneId", type: "clone_created", actor: "$creatorId" }
1051
- }
1052
- ```
1053
-
1054
- **Pattern: Token Purchase with Rollback**
1055
- ```typescript
1056
- // DSL
1057
- {
1058
- atomic: [
1059
- { service: { provider: "stripe", method: "charge", ... } },
1060
- { service: { provider: "blockchain", method: "mint", ... } }
1061
- ],
1062
- onError: {
1063
- rollback: [
1064
- { service: { provider: "stripe", method: "refund", ... } },
1065
- { service: { provider: "blockchain", method: "burn", ... } }
1066
- ]
1067
- }
1068
- }
1069
- ```
1070
-
1071
- **Pattern: Query with Relationships**
1072
- ```typescript
1073
- // Get creator's content
1074
- {
1075
- query: {
1076
- from: "connections",
1077
- where: [
1078
- { field: "fromEntityId", operator: "eq", value: "$creatorId" },
1079
- { field: "relationshipType", operator: "eq", value: "authored" }
1080
- ]
1081
- },
1082
- output: "contentConnections"
1083
- }
1084
- ```
1085
-
1086
- ### Validation Rules
1087
-
1088
- **Thing Validation:**
1089
- - ✅ Type must be valid ThingType from ontology
1090
- - ✅ Name cannot be empty
1091
- - ✅ Properties structure must match type
1092
- - ✅ Status must be valid (active, inactive, draft, published, archived)
1093
-
1094
- **Connection Validation:**
1095
- - ✅ fromThingId and toThingId must exist
1096
- - ✅ relationshipType must be valid ConnectionType
1097
- - ✅ Cannot connect thing to itself (usually)
1098
- - ✅ Relationship must make semantic sense
1099
-
1100
- **Event Validation:**
1101
- - ✅ thingId must exist
1102
- - ✅ eventType must be valid EventType
1103
- - ✅ timestamp required
1104
- - ✅ actorId must exist if provided
1105
-
1106
- **Knowledge Validation:**
1107
- - ✅ label must be unique or properly scoped
1108
- - ✅ category must be valid KnowledgeCategory
1109
- - ✅ usageCount must be >= 0
1110
-
1111
- ### Performance Guidelines
1112
-
1113
- **Indexes:**
1114
- - Use indexes for all filter fields
1115
- - Compound indexes for multi-field queries
1116
- - Vector indexes for semantic search
1117
-
1118
- **Query Optimization:**
1119
- - Always use indexes for filters
1120
- - Limit results with `.take(n)`
1121
- - Paginate large result sets
1122
- - Prefer streaming over `.collect()` for large datasets
1123
-
1124
- **Caching:**
1125
- - Cache frequently accessed entities
1126
- - Invalidate cache on entity updates
1127
- - Use stale-while-revalidate pattern
1128
-
1129
- ### Reference Files
1130
-
1131
- - **Ontology Spec**: `Ontology.md` - Complete 6-dimension data model
1132
- - **Technical DSL**: `DSL.md`, `ONE DSL.md` - JSON-like syntax and compiler
1133
- - **Plain English DSL**: `ONE DSL English.md` - Natural language syntax
1134
- - **Schema**: `convex/schema.ts` - Current and target schemas
1135
- - **Examples**: This file - Real-world implementation patterns
1136
-
1137
- ---
1138
-
1139
- ### Week 2: Payment Infrastructure
1140
-
1141
- **Stripe Connect Integration - Direct Revenue Enabler**
1142
-
1143
- #### Implementation: Token Purchase with Revenue Splits
1144
-
1145
- **File**: `convex/payments/tokenPurchase.ts`
1146
-
1147
- ```typescript
1148
- import { v } from "convex/values";
1149
- import { mutation, query } from "./_generated/server";
1150
- import { internal } from "./_generated/api";
1151
-
1152
- // Query to get token ownership for revenue splits
1153
- export const getTokenOwnership = query({
1154
- args: { tokenId: v.id("entities") },
1155
- handler: async (ctx, args) => {
1156
- // Get token entity
1157
- const token = await ctx.db.get(args.tokenId);
1158
- if (!token || token.type !== "token") {
1159
- throw new Error("Token not found");
1160
- }
1161
-
1162
- // Get ownership connections using plain Convex query with index
1163
- const ownerships = await ctx.db
1164
- .query("connections")
1165
- .withIndex("by_to_type", (q) =>
1166
- q.eq("toEntityId", args.tokenId).eq("relationshipType", "owns")
1167
- )
1168
- .collect();
1169
-
1170
- // Return owners with revenue split metadata
1171
- return Promise.all(
1172
- ownerships.map(async (conn) => {
1173
- const owner = await ctx.db.get(conn.fromEntityId);
1174
- return {
1175
- ownerId: conn.fromEntityId,
1176
- ownerName: owner?.name,
1177
- revenueShare: conn.metadata?.revenueShare || 0,
1178
- stripeAccountId: owner?.properties?.stripeAccountId,
1179
- };
1180
- })
1181
- );
1182
- },
1183
- });
1184
-
1185
- // Mutation to process token purchase
1186
- export const purchaseTokens = mutation({
1187
- args: {
1188
- userId: v.id("entities"),
1189
- tokenId: v.id("entities"),
1190
- amount: v.number(),
1191
- usdAmount: v.number(),
1192
- },
1193
- handler: async (ctx, args) => {
1194
- // Validate entities exist
1195
- const user = await ctx.db.get(args.userId);
1196
- const token = await ctx.db.get(args.tokenId);
1197
-
1198
- if (!user || user.type !== "audience_member") {
1199
- throw new Error("User not found");
1200
- }
1201
- if (!token || token.type !== "token") {
1202
- throw new Error("Token not found");
1203
- }
1204
-
1205
- // Schedule payment processing (will be done in action)
1206
- await ctx.scheduler.runAfter(0, internal.payments.processTokenPayment, {
1207
- userId: args.userId,
1208
- tokenId: args.tokenId,
1209
- amount: args.amount,
1210
- usdAmount: args.usdAmount,
1211
- });
1212
-
1213
- return { success: true, message: "Payment processing initiated" };
1214
- },
1215
- });
1216
- ```
1217
-
1218
- **File**: `convex/payments/processPayment.ts` (Action)
1219
-
1220
- ```typescript
1221
- "use node";
1222
- import { v } from "convex/values";
1223
- import { internalAction } from "./_generated/server";
1224
- import { internal } from "./_generated/api";
1225
- import Stripe from "stripe";
1226
-
1227
- const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
1228
-
1229
- export const processTokenPayment = internalAction({
1230
- args: {
1231
- userId: v.id("entities"),
1232
- tokenId: v.id("entities"),
1233
- amount: v.number(),
1234
- usdAmount: v.number(),
1235
- },
1236
- handler: async (ctx, args) => {
1237
- // Get ownership for revenue splits
1238
- const ownership = await ctx.runQuery(internal.payments.getTokenOwnership, {
1239
- tokenId: args.tokenId,
1240
- });
1241
-
1242
- const platformFee = Math.floor(args.usdAmount * 0.15 * 100); // 15% platform fee
1243
-
1244
- // Create Stripe checkout with revenue splits
1245
- const session = await stripe.checkout.sessions.create({
1246
- line_items: [
1247
- {
1248
- price_data: {
1249
- currency: "usd",
1250
- unit_amount: args.usdAmount * 100,
1251
- product_data: { name: `${args.amount} Tokens` },
1252
- },
1253
- quantity: 1,
1254
- },
1255
- ],
1256
- mode: "payment",
1257
- payment_intent_data: {
1258
- application_fee_amount: platformFee,
1259
- transfer_data: {
1260
- destination: ownership[0].stripeAccountId, // Primary owner gets payment
1261
- },
1262
- },
1263
- metadata: {
1264
- userId: args.userId,
1265
- tokenId: args.tokenId,
1266
- amount: args.amount.toString(),
1267
- },
1268
- });
1269
-
1270
- // Record payment event with metadata status
1271
- await ctx.runMutation(internal.events.create, {
1272
- entityId: args.tokenId,
1273
- eventType: "payment_processed",
1274
- actorType: "user",
1275
- actorId: args.userId,
1276
- metadata: {
1277
- status: "initiated",
1278
- paymentType: "token_purchase",
1279
- amount: args.amount,
1280
- usdAmount: args.usdAmount,
1281
- sessionId: session.id,
1282
- },
1283
- });
1284
-
1285
- return { sessionId: session.id, url: session.url };
1286
- },
1287
- });
1288
- ```
1289
-
1290
- **Seller Onboarding**: 2-minute Stripe Express flow with automatic account creation.
1291
-
1292
- **Success Criteria**: ✅ Transactions process correctly, ✅ Revenue splits accurate, ✅ Webhooks handled
1293
-
1294
- ---
1295
-
1296
- ## Phase 2: Content & Product Economy (Weeks 3-4)
1297
-
1298
- ### Week 3: Content Creation & Discovery
1299
-
1300
- **Universal Content Creator - Multiple types following ontology (blog_post, video, podcast, social_post, course, digital_product)**
1301
-
1302
- #### Content Creator Implementation
1303
-
1304
- **File**: `convex/content/create.ts`
1305
-
1306
- ```typescript
1307
- import { v } from "convex/values";
1308
- import { mutation } from "./_generated/server";
1309
-
1310
- export const createContent = mutation({
1311
- args: {
1312
- creatorId: v.id("entities"),
1313
- type: v.union(
1314
- v.literal("blog_post"),
1315
- v.literal("video"),
1316
- v.literal("podcast"),
1317
- v.literal("social_post"),
1318
- v.literal("course"),
1319
- v.literal("digital_product")
1320
- ),
1321
- name: v.string(),
1322
- properties: v.any(), // Type-specific properties
1323
- tags: v.optional(v.array(v.string())),
1324
- collaborators: v.optional(
1325
- v.array(
1326
- v.object({
1327
- entityId: v.id("entities"),
1328
- revenueShare: v.number(), // 0.0 to 1.0
1329
- })
1330
- )
1331
- ),
1332
- },
1333
- handler: async (ctx, args) => {
1334
- // Validate creator exists
1335
- const creator = await ctx.db.get(args.creatorId);
1336
- if (!creator || creator.type !== "creator") {
1337
- throw new Error("Creator not found");
1338
- }
1339
-
1340
- // Create content entity
1341
- const contentId = await ctx.db.insert("entities", {
1342
- type: args.type,
1343
- name: args.name,
1344
- properties: args.properties,
1345
- status: "draft",
1346
- createdAt: Date.now(),
1347
- updatedAt: Date.now(),
1348
- });
1349
-
1350
- // Create ownership connection (creator owns content)
1351
- await ctx.db.insert("connections", {
1352
- fromEntityId: args.creatorId,
1353
- toEntityId: contentId,
1354
- relationshipType: "owns",
1355
- metadata: { revenueShare: 1.0 }, // Creator gets 100% initially
1356
- createdAt: Date.now(),
1357
- });
1358
-
1359
- // Create authored connection
1360
- await ctx.db.insert("connections", {
1361
- fromEntityId: args.creatorId,
1362
- toEntityId: contentId,
1363
- relationshipType: "authored",
1364
- createdAt: Date.now(),
1365
- });
1366
-
1367
- // Add collaborators with revenue splits
1368
- if (args.collaborators) {
1369
- for (const collab of args.collaborators) {
1370
- await ctx.db.insert("connections", {
1371
- fromEntityId: collab.entityId,
1372
- toEntityId: contentId,
1373
- relationshipType: "owns",
1374
- metadata: { revenueShare: collab.revenueShare },
1375
- createdAt: Date.now(),
1376
- });
1377
- }
1378
- }
1379
-
1380
- // Add tags
1381
- if (args.tags) {
1382
- for (const tagName of args.tags) {
1383
- // Get or create tag
1384
- let tag = await ctx.db
1385
- .query("tags")
1386
- .withIndex("by_name", (q) => q.eq("name", tagName))
1387
- .unique();
1388
-
1389
- if (!tag) {
1390
- const tagId = await ctx.db.insert("tags", {
1391
- name: tagName,
1392
- category: "topic",
1393
- usageCount: 0,
1394
- createdAt: Date.now(),
1395
- });
1396
- tag = await ctx.db.get(tagId);
1397
- }
1398
-
1399
- // Create entity-tag association
1400
- await ctx.db.insert("entityTags", {
1401
- entityId: contentId,
1402
- tagId: tag!._id,
1403
- createdAt: Date.now(),
1404
- });
1405
-
1406
- // Increment tag usage count
1407
- await ctx.db.patch(tag!._id, {
1408
- usageCount: tag!.usageCount + 1,
1409
- });
1410
- }
1411
- }
1412
-
1413
- // Log entity creation event with content-specific metadata
1414
- await ctx.db.insert("events", {
1415
- entityId: contentId,
1416
- eventType: "entity_created",
1417
- timestamp: Date.now(),
1418
- actorType: "user",
1419
- actorId: args.creatorId,
1420
- metadata: {
1421
- entityType: args.type,
1422
- collaboratorCount: args.collaborators?.length || 0,
1423
- tagCount: args.tags?.length || 0,
1424
- },
1425
- });
1426
-
1427
- return { contentId, success: true };
1428
- },
1429
- });
1430
- ```
1431
-
1432
- **Frontend**: Multi-step wizard with file upload, collaborator management, tag selection, and license controls
1433
-
1434
- ---
1435
-
1436
- ### Week 4: Semantic Search Implementation
1437
-
1438
- **Hybrid Search: Vector Similarity + Keyword Matching using ontology entities table**
1439
-
1440
- #### Vector Embeddings
1441
-
1442
- **File**: `convex/embeddings/generate.ts`
1443
-
1444
- ```typescript
1445
- "use node";
1446
- import { v } from "convex/values";
1447
- import { internalAction } from "./_generated/server";
1448
- import { internal } from "./_generated/api";
1449
- import OpenAI from "openai";
1450
-
1451
- const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
1452
-
1453
- export const generateEntityEmbedding = internalAction({
1454
- args: { entityId: v.id("entities") },
1455
- handler: async (ctx, args) => {
1456
- // Get entity
1457
- const entity = await ctx.runQuery(internal.entities.get, {
1458
- id: args.entityId,
1459
- });
1460
-
1461
- if (!entity) {
1462
- throw new Error("Entity not found");
1463
- }
1464
-
1465
- // Create searchable text from entity
1466
- const text = `${entity.name}\n${entity.properties?.description || ""}\n${
1467
- entity.properties?.content || ""
1468
- }`;
1469
-
1470
- // Generate embedding
1471
- const response = await openai.embeddings.create({
1472
- model: "text-embedding-3-small",
1473
- input: text,
1474
- dimensions: 1536,
1475
- });
1476
-
1477
- // Save embedding
1478
- await ctx.runMutation(internal.embeddings.save, {
1479
- entityId: args.entityId,
1480
- embedding: response.data[0].embedding,
1481
- model: "text-embedding-3-small",
1482
- });
1483
-
1484
- return { success: true };
1485
- },
1486
- });
1487
- ```
1488
-
1489
- **File**: `convex/embeddings/save.ts`
1490
-
1491
- ```typescript
1492
- import { v } from "convex/values";
1493
- import { internalMutation } from "./_generated/server";
1494
-
1495
- export const save = internalMutation({
1496
- args: {
1497
- entityId: v.id("entities"),
1498
- embedding: v.array(v.float64()),
1499
- model: v.string(),
1500
- },
1501
- handler: async (ctx, args) => {
1502
- // Check if embedding exists
1503
- const existing = await ctx.db
1504
- .query("embeddings")
1505
- .withIndex("by_entity", (q) => q.eq("entityId", args.entityId))
1506
- .unique();
1507
-
1508
- if (existing) {
1509
- // Update existing
1510
- await ctx.db.patch(existing._id, {
1511
- embedding: args.embedding,
1512
- model: args.model,
1513
- createdAt: Date.now(),
1514
- });
1515
- } else {
1516
- // Create new
1517
- await ctx.db.insert("embeddings", {
1518
- entityId: args.entityId,
1519
- embedding: args.embedding,
1520
- model: args.model,
1521
- createdAt: Date.now(),
1522
- });
1523
- }
1524
-
1525
- return { success: true };
1526
- },
1527
- });
1528
- ```
1529
-
1530
- #### Semantic Search Query
1531
-
1532
- **File**: `convex/search/semantic.ts`
1533
-
1534
- ```typescript
1535
- "use node";
1536
- import { v } from "convex/values";
1537
- import { action } from "./_generated/server";
1538
- import { internal } from "./_generated/api";
1539
- import OpenAI from "openai";
1540
-
1541
- const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
1542
-
1543
- export const semanticSearch = action({
1544
- args: {
1545
- query: v.string(),
1546
- entityTypes: v.optional(v.array(v.string())),
1547
- limit: v.optional(v.number()),
1548
- },
1549
- handler: async (ctx, args) => {
1550
- // Generate query embedding
1551
- const response = await openai.embeddings.create({
1552
- model: "text-embedding-3-small",
1553
- input: args.query,
1554
- dimensions: 1536,
1555
- });
1556
-
1557
- const queryEmbedding = response.data[0].embedding;
1558
-
1559
- // Vector search on embeddings table
1560
- const results = await ctx.vectorSearch("embeddings", "by_embedding", {
1561
- vector: queryEmbedding,
1562
- limit: args.limit || 20,
1563
- });
1564
-
1565
- // Hydrate entities and filter by type if specified
1566
- const entities = await Promise.all(
1567
- results.map(async (r) => {
1568
- const entity = await ctx.runQuery(internal.entities.get, {
1569
- id: r._id,
1570
- });
1571
- return { entity, score: r._score };
1572
- })
1573
- );
1574
-
1575
- // Filter by entity type if specified
1576
- const filtered = args.entityTypes
1577
- ? entities.filter((e) => args.entityTypes!.includes(e.entity?.type || ""))
1578
- : entities;
1579
-
1580
- return filtered.map((e) => e.entity);
1581
- },
1582
- });
1583
-
1584
- // Hybrid search combining vector similarity and keyword matching
1585
- export const hybridSearch = action({
1586
- args: {
1587
- query: v.string(),
1588
- entityTypes: v.optional(v.array(v.string())),
1589
- limit: v.optional(v.number()),
1590
- },
1591
- handler: async (ctx, args) => {
1592
- // Run semantic search
1593
- const semanticResults = await ctx.runAction(internal.search.semanticSearch, {
1594
- query: args.query,
1595
- entityTypes: args.entityTypes,
1596
- limit: args.limit,
1597
- });
1598
-
1599
- // Run keyword search using search index
1600
- const keywordResults = await ctx.runQuery(internal.search.keywordSearch, {
1601
- query: args.query,
1602
- entityTypes: args.entityTypes,
1603
- limit: args.limit,
1604
- });
1605
-
1606
- // Combine and deduplicate results
1607
- const combined = new Map();
1608
- semanticResults.forEach((entity) => combined.set(entity._id, entity));
1609
- keywordResults.forEach((entity) => combined.set(entity._id, entity));
1610
-
1611
- return Array.from(combined.values());
1612
- },
1613
- });
1614
- ```
1615
-
1616
- **Search UI**: Real-time results with filters (entity type, tags, status), debounced input, instant previews.
1617
-
1618
- **Success Criteria**: ✅ Semantic search returns relevant results, ✅ Sub-300ms response time, ✅ Works for all entity types
1619
-
1620
- ---
1621
-
1622
- ## Phase 3: Viral Growth & ELEVATE (Weeks 5-6)
1623
-
1624
- ### Week 5: ELEVATE Journey System
1625
-
1626
- **9-Step Candy Crush-Style Progress System**
1627
-
1628
- #### Journey Steps (ELEVATE Framework)
1629
-
1630
- 1. **Hook** - Capture attention with free AI business analysis
1631
- 2. **Gift** - Provide immediate value (insights report)
1632
- 3. **Identify** - Payment gate ($100) - qualify serious users
1633
- 4. **Engage** - Interactive workshops and tools
1634
- 5. **Sell** - Core product/service delivery
1635
- 6. **Nurture** - Ongoing support and resources
1636
- 7. **Upsell** - Premium features and services
1637
- 8. **Understand** - Analytics and optimization
1638
- 9. **Share** - Referral rewards and viral loop
1639
-
1640
- #### Workflow Implementation
1641
-
1642
- **File**: `convex/elevate/journey.ts`
1643
-
1644
- ```typescript
1645
- import { WorkflowManager } from "@convex-dev/workflow";
1646
-
1647
- const workflow = new WorkflowManager(components.workflow);
1648
-
1649
- export const elevateJourney = workflow.define({
1650
- defaultRetryBehavior: { maxAttempts: 3, initialBackoffMs: 1000 }
1651
- }, async (ctx, { userId, journeyId }) => {
1652
-
1653
- // Step 1: Hook - Generate AI analysis
1654
- await ctx.step("hook", async () => {
1655
- const analysis = await ctx.runAction(internal.ai.generateBusinessAnalysis, {
1656
- userId,
1657
- });
1658
- await ctx.runMutation(internal.elevate.saveStep, {
1659
- userId,
1660
- stepId: "hook",
1661
- status: "completed",
1662
- output: analysis,
1663
- });
1664
- });
1665
-
1666
- // Wait for user to review (24 hours)
1667
- await ctx.wait(24 * 60 * 60 * 1000);
1668
-
1669
- // Step 2: Gift - Deliver insights
1670
- await ctx.step("gift", async () => {
1671
- await ctx.runMutation(internal.notifications.sendInsightsReport, { userId });
1672
- });
1673
-
1674
- // Step 3: Identify - Payment gate
1675
- await ctx.step("identify", async () => {
1676
- const paid = await waitForPayment(ctx, userId, 100);
1677
- if (!paid) {
1678
- throw new Error("Payment not completed");
1679
- }
1680
- });
1681
-
1682
- // Continue remaining steps...
1683
-
1684
- return { completed: true };
1685
- });
1686
- ```
1687
-
1688
- #### Visual Journey UI
1689
-
1690
- **File**: `src/components/features/elevate/JourneyMap.tsx`
1691
-
1692
- **Features**:
1693
-
1694
- - SVG path visualization (Candy Crush style)
1695
- - Step nodes with lock/unlock states
1696
- - Star ratings (1-3 per step)
1697
- - Progress percentage
1698
- - Achievement badges
1699
- - Animated transitions
1700
-
1701
- **Pattern**:
1702
-
1703
- ```typescript
1704
- <svg viewBox="0 0 800 600">
1705
- <path d="M 100,300 Q 200,100 400,300 T 700,300" />
1706
- {steps.map((step, i) => (
1707
- <g key={step.id}>
1708
- <circle
1709
- cx={positions[i].x}
1710
- cy={positions[i].y}
1711
- r="30"
1712
- className={step.status === 'completed' ? 'fill-green' : 'fill-gray'}
1713
- />
1714
- <text>{step.name}</text>
1715
- </g>
1716
- ))}
1717
- </svg>
1718
- ```
1719
-
1720
- **Payment Gate**: Integrated Stripe checkout modal at "Identify" step.
1721
-
1722
- **Success Criteria**: ✅ All 9 steps functional, ✅ Payment gate works, ✅ Progress persists, ✅ Workflows resume after restart
1723
-
1724
- ---
1725
-
1726
- ### Week 6: Viral Invitation System
1727
-
1728
- **Magic Links + Referral Tracking**
1729
-
1730
- #### Magic Link Generation
1731
-
1732
- **File**: `convex/invitations/magicLinks.ts`
1733
-
1734
- ```typescript
1735
- export const generateMagicLink = mutation({
1736
- args: {
1737
- email: v.string(),
1738
- referralCode: v.string(),
1739
- },
1740
- handler: async (ctx, args) => {
1741
- const token = crypto.randomBytes(32).toString("base64url");
1742
-
1743
- await ctx.db.insert("events", {
1744
- eventType: "invitation_created",
1745
- timestamp: Date.now(),
1746
- metadata: {
1747
- email: args.email,
1748
- token,
1749
- referralCode: args.referralCode,
1750
- expiresAt: Date.now() + (60 * 60 * 1000), // 1 hour
1751
- },
1752
- });
1753
-
1754
- return `https://one.ie/invite/${token}`;
1755
- },
1756
- });
1757
- ```
1758
-
1759
- #### Auto-Registration Flow
1760
-
1761
- **File**: `src/pages/invite/[token].astro`
1762
-
1763
- ```typescript
1764
- // Server-side validation
1765
- const { token } = Astro.params;
1766
- const invitation = await convex.query(api.invitations.verify, { token });
1767
-
1768
- if (invitation.valid) {
1769
- // Auto-register user
1770
- const userId = await convex.mutation(api.auth.autoRegister, {
1771
- email: invitation.email,
1772
- referredBy: invitation.referralCode,
1773
- });
1774
-
1775
- // Create session and redirect
1776
- return Astro.redirect("/dashboard");
1777
- }
1778
- ```
1779
-
1780
- #### Referral Tracking
1781
-
1782
- **Schema**: Track referrer → referred → conversion pipeline
1783
-
1784
- **Commission Model**:
1785
-
1786
- - 10% of referred user's first transaction
1787
- - Tiered bonuses (5 referrals = $50 bonus, 25 = $500)
1788
- - Lifetime tracking with attribution
1789
-
1790
- **Bulk Invitations**: Queue-based processing for 100+ invitations with personalized messages.
1791
-
1792
- **Success Criteria**: ✅ Magic links work reliably, ✅ Auto-registration smooth, ✅ Referral commissions accurate, ✅ K-factor > 1
1793
-
1794
- ---
1795
-
1796
- ## Phase 4: Scale & Production Readiness (Weeks 7-8)
1797
-
1798
- ### Week 7: AI Agent Marketplace
1799
-
1800
- **10 Business Agent Types from Ontology (strategy, research, marketing, sales, service, design, engineering, finance, legal, intelligence)**
1801
-
1802
- #### Agent Registry
1803
-
1804
- **File**: `convex/agents/register.ts`
1805
-
1806
- ```typescript
1807
- import { v } from "convex/values";
1808
- import { mutation } from "./_generated/server";
1809
-
1810
- export const registerAgent = mutation({
1811
- args: {
1812
- creatorId: v.id("entities"),
1813
- agentType: v.union(
1814
- v.literal("strategy_agent"),
1815
- v.literal("research_agent"),
1816
- v.literal("marketing_agent"),
1817
- v.literal("sales_agent"),
1818
- v.literal("service_agent"),
1819
- v.literal("design_agent"),
1820
- v.literal("engineering_agent"),
1821
- v.literal("finance_agent"),
1822
- v.literal("legal_agent"),
1823
- v.literal("intelligence_agent")
1824
- ),
1825
- name: v.string(),
1826
- description: v.string(),
1827
- capabilities: v.array(v.string()),
1828
- systemPrompt: v.string(),
1829
- pricingModel: v.union(
1830
- v.literal("per_request"),
1831
- v.literal("token_based"),
1832
- v.literal("subscription")
1833
- ),
1834
- basePrice: v.number(),
1835
- tags: v.optional(v.array(v.string())),
1836
- },
1837
- handler: async (ctx, args) => {
1838
- // Validate creator exists
1839
- const creator = await ctx.db.get(args.creatorId);
1840
- if (!creator || creator.type !== "creator") {
1841
- throw new Error("Creator not found");
1842
- }
1843
-
1844
- // Create agent entity
1845
- const agentId = await ctx.db.insert("entities", {
1846
- type: args.agentType,
1847
- name: args.name,
1848
- properties: {
1849
- description: args.description,
1850
- capabilities: args.capabilities,
1851
- systemPrompt: args.systemPrompt,
1852
- model: "gpt-4-turbo",
1853
- temperature: 0.7,
1854
- pricingModel: args.pricingModel,
1855
- basePrice: args.basePrice,
1856
- totalExecutions: 0,
1857
- successRate: 0,
1858
- averageExecutionTime: 0,
1859
- },
1860
- status: "active",
1861
- createdAt: Date.now(),
1862
- updatedAt: Date.now(),
1863
- });
1864
-
1865
- // Create ownership connection
1866
- await ctx.db.insert("connections", {
1867
- fromEntityId: args.creatorId,
1868
- toEntityId: agentId,
1869
- relationshipType: "owns",
1870
- metadata: { revenueShare: 1.0 },
1871
- createdAt: Date.now(),
1872
- });
1873
-
1874
- // Add tags
1875
- if (args.tags) {
1876
- for (const tagName of args.tags) {
1877
- let tag = await ctx.db
1878
- .query("tags")
1879
- .withIndex("by_name", (q) => q.eq("name", tagName))
1880
- .unique();
1881
-
1882
- if (!tag) {
1883
- const tagId = await ctx.db.insert("tags", {
1884
- name: tagName,
1885
- category: "technology",
1886
- usageCount: 0,
1887
- createdAt: Date.now(),
1888
- });
1889
- tag = await ctx.db.get(tagId);
1890
- }
1891
-
1892
- await ctx.db.insert("entityTags", {
1893
- entityId: agentId,
1894
- tagId: tag!._id,
1895
- createdAt: Date.now(),
1896
- });
1897
-
1898
- await ctx.db.patch(tag!._id, {
1899
- usageCount: tag!.usageCount + 1,
1900
- });
1901
- }
1902
- }
1903
-
1904
- // Log entity creation event with agent-specific metadata
1905
- await ctx.db.insert("events", {
1906
- entityId: agentId,
1907
- eventType: "entity_created",
1908
- timestamp: Date.now(),
1909
- actorType: "user",
1910
- actorId: args.creatorId,
1911
- metadata: {
1912
- entityType: args.agentType,
1913
- pricingModel: args.pricingModel,
1914
- basePrice: args.basePrice,
1915
- capabilities: args.capabilities,
1916
- },
1917
- });
1918
-
1919
- return { agentId, success: true };
1920
- },
1921
- });
1922
- ```
1923
-
1924
- #### Agent Execution
1925
-
1926
- **File**: `convex/agents/execute.ts`
1927
-
1928
- ```typescript
1929
- "use node";
1930
- import { v } from "convex/values";
1931
- import { action } from "./_generated/server";
1932
- import { internal } from "./_generated/api";
1933
- import OpenAI from "openai";
1934
-
1935
- const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
1936
-
1937
- export const invokeAgent = action({
1938
- args: {
1939
- agentId: v.id("entities"),
1940
- userId: v.id("entities"),
1941
- message: v.string(),
1942
- },
1943
- handler: async (ctx, args) => {
1944
- const startTime = Date.now();
1945
-
1946
- // Get agent configuration
1947
- const agent = await ctx.runQuery(internal.agents.get, {
1948
- id: args.agentId,
1949
- });
1950
-
1951
- if (!agent || !agent.type.endsWith("_agent")) {
1952
- throw new Error("Agent not found");
1953
- }
1954
-
1955
- // Execute agent with OpenAI
1956
- const response = await openai.chat.completions.create({
1957
- model: agent.properties.model || "gpt-4-turbo",
1958
- messages: [
1959
- { role: "system", content: agent.properties.systemPrompt },
1960
- { role: "user", content: args.message },
1961
- ],
1962
- temperature: agent.properties.temperature || 0.7,
1963
- });
1964
-
1965
- const executionTime = Date.now() - startTime;
1966
- const aiResponse = response.choices[0].message.content || "";
1967
-
1968
- // Track invocation (update metrics)
1969
- await ctx.runMutation(internal.agents.trackInvocation, {
1970
- agentId: args.agentId,
1971
- executionTime,
1972
- success: true,
1973
- });
1974
-
1975
- // Log agent execution event with success status in metadata
1976
- await ctx.runMutation(internal.events.create, {
1977
- entityId: args.agentId,
1978
- eventType: "agent_executed",
1979
- actorType: "user",
1980
- actorId: args.userId,
1981
- metadata: {
1982
- status: "success",
1983
- message: args.message,
1984
- response: aiResponse,
1985
- executionTime,
1986
- tokensUsed: response.usage?.total_tokens || 0,
1987
- },
1988
- });
1989
-
1990
- return {
1991
- response: aiResponse,
1992
- executionTime,
1993
- tokensUsed: response.usage?.total_tokens || 0,
1994
- };
1995
- },
1996
- });
1997
- ```
1998
-
1999
- **File**: `convex/agents/trackInvocation.ts`
2000
-
2001
- ```typescript
2002
- import { v } from "convex/values";
2003
- import { internalMutation } from "./_generated/server";
2004
-
2005
- export const trackInvocation = internalMutation({
2006
- args: {
2007
- agentId: v.id("entities"),
2008
- executionTime: v.number(),
2009
- success: v.boolean(),
2010
- },
2011
- handler: async (ctx, args) => {
2012
- const agent = await ctx.db.get(args.agentId);
2013
- if (!agent) return;
2014
-
2015
- const totalExecutions = agent.properties.totalExecutions || 0;
2016
- const successRate = agent.properties.successRate || 0;
2017
- const avgExecTime = agent.properties.averageExecutionTime || 0;
2018
-
2019
- // Update metrics
2020
- const newTotalExecutions = totalExecutions + 1;
2021
- const newSuccessRate =
2022
- (successRate * totalExecutions + (args.success ? 1 : 0)) / newTotalExecutions;
2023
- const newAvgExecTime =
2024
- (avgExecTime * totalExecutions + args.executionTime) / newTotalExecutions;
2025
-
2026
- await ctx.db.patch(args.agentId, {
2027
- properties: {
2028
- ...agent.properties,
2029
- totalExecutions: newTotalExecutions,
2030
- successRate: newSuccessRate,
2031
- averageExecutionTime: newAvgExecTime,
2032
- },
2033
- updatedAt: Date.now(),
2034
- });
2035
- },
2036
- });
2037
- ```
2038
-
2039
- #### Agent Marketplace UI
2040
-
2041
- **File**: `src/components/features/agents/AgentMarketplace.tsx`
2042
-
2043
- **Features**:
2044
-
2045
- - Browse by category/capability
2046
- - Try before you buy (free tier)
2047
- - Usage-based billing
2048
- - Rating and review system
2049
- - Agent-to-agent delegation
2050
-
2051
- **Success Criteria**: ✅ Agents execute reliably, ✅ Billing tracks usage accurately, ✅ UI responsive and intuitive
2052
-
2053
- ---
2054
-
2055
- ### Week 8: Analytics & Optimization
2056
-
2057
- **Dashboard for Revenue, Engagement, and Performance Metrics**
2058
-
2059
- #### Analytics Implementation
2060
-
2061
- **File**: `convex/analytics/dashboards.ts`
2062
-
2063
- ```typescript
2064
- export const getRevenueMetrics = query({
2065
- args: { timeRange: v.string() },
2066
- handler: async (ctx, args) => {
2067
- // Query consolidated payment events
2068
- const payments = await ctx.db
2069
- .query("events")
2070
- .withIndex("by_type_time", (q) =>
2071
- q.eq("eventType", "payment_processed")
2072
- .gte("timestamp", getTimeRangeStart(args.timeRange))
2073
- )
2074
- .collect();
2075
-
2076
- // Filter to completed payments only using metadata
2077
- const completedPayments = payments.filter(
2078
- (p) => p.metadata?.status === "completed"
2079
- );
2080
-
2081
- const totalRevenue = completedPayments.reduce(
2082
- (sum, p) => sum + (p.metadata?.amount || 0),
2083
- 0
2084
- );
2085
-
2086
- const platformFees = completedPayments.reduce(
2087
- (sum, p) => sum + (p.metadata?.platformFee || 0),
2088
- 0
2089
- );
2090
-
2091
- return {
2092
- totalRevenue,
2093
- platformFees,
2094
- transactionCount: completedPayments.length,
2095
- averageOrderValue: totalRevenue / completedPayments.length || 0,
2096
- statusBreakdown: {
2097
- initiated: payments.filter((p) => p.metadata?.status === "initiated").length,
2098
- completed: completedPayments.length,
2099
- failed: payments.filter((p) => p.metadata?.status === "failed").length,
2100
- refunded: payments.filter((p) => p.metadata?.status === "refunded").length,
2101
- },
2102
- };
2103
- },
2104
- });
2105
-
2106
- export const getElevateAnalytics = query({
2107
- args: {},
2108
- handler: async (ctx) => {
2109
- // Query progress_updated events for journey tracking
2110
- const progressEvents = await ctx.db
2111
- .query("events")
2112
- .withIndex("by_eventType", (q) => q.eq("eventType", "progress_updated"))
2113
- .filter((q) => q.eq(q.field("metadata.journeyType"), "elevate"))
2114
- .collect();
2115
-
2116
- // Calculate step completion rates using metadata
2117
- const stepCounts = {};
2118
- progressEvents.forEach((event) => {
2119
- const step = event.metadata?.stepId;
2120
- if (step) {
2121
- stepCounts[step] = (stepCounts[step] || 0) + 1;
2122
- }
2123
- });
2124
-
2125
- return {
2126
- totalJourneys: new Set(progressEvents.map((e) => e.actorId)).size,
2127
- stepCompletionRates: stepCounts,
2128
- conversionRate: (stepCounts["share"] || 0) / (stepCounts["hook"] || 1),
2129
- };
2130
- },
2131
- });
2132
- ```
2133
-
2134
- #### Analytics Dashboard UI
2135
-
2136
- **File**: `src/pages/analytics/index.astro`
2137
-
2138
- **Charts**:
2139
-
2140
- - Revenue over time (line chart)
2141
- - Transaction volume (bar chart)
2142
- - ELEVATE funnel (funnel chart)
2143
- - Top-performing blocks (table)
2144
- - User engagement heatmap
2145
- - Real-time activity feed
2146
-
2147
- **Libraries**: Recharts for React components, TailwindCSS for styling.
2148
-
2149
- **Success Criteria**: ✅ All metrics accurate, ✅ Real-time updates, ✅ Export functionality, ✅ Sub-second load times
2150
-
2151
- ---
2152
-
2153
- ## Effect.ts Service Layer Integration
2154
-
2155
- **Production-Grade Error Handling & Dependency Injection**
2156
-
2157
- ### Typed Error Channels
2158
-
2159
- **Purpose**: All errors are typed and explicit - no silent failures or generic error handling.
2160
-
2161
- ```typescript
2162
- import { Effect, Data } from "effect";
2163
-
2164
- // Define typed error classes
2165
- class ValidationError extends Data.TaggedError("ValidationError")<{
2166
- field: string;
2167
- message: string;
2168
- }> {}
2169
-
2170
- class DatabaseError extends Data.TaggedError("DatabaseError")<{
2171
- operation: string;
2172
- cause: unknown;
2173
- }> {}
2174
-
2175
- class ExternalServiceError extends Data.TaggedError("ExternalServiceError")<{
2176
- service: string;
2177
- statusCode?: number;
2178
- message: string;
2179
- }> {}
2180
-
2181
- class NotFoundError extends Data.TaggedError("NotFoundError")<{
2182
- entityType: string;
2183
- entityId: string;
2184
- }> {}
2185
- ```
2186
-
2187
- ### Service Layer Architecture
2188
-
2189
- **File**: `convex/services/entities.ts`
2190
-
2191
- ```typescript
2192
- import { Effect, Layer, Context } from "effect";
2193
- import { v } from "convex/values";
2194
-
2195
- // Define service interface with typed errors
2196
- class EntityService extends Context.Tag("EntityService")<
2197
- EntityService,
2198
- {
2199
- create: (data: EntityCreateData) => Effect.Effect<
2200
- string, // Success type: entity ID
2201
- ValidationError | DatabaseError // Error types
2202
- >;
2203
- get: (id: string) => Effect.Effect<
2204
- Entity,
2205
- NotFoundError | DatabaseError
2206
- >;
2207
- update: (id: string, data: Partial<Entity>) => Effect.Effect<
2208
- void,
2209
- NotFoundError | ValidationError | DatabaseError
2210
- >;
2211
- search: (query: string) => Effect.Effect<
2212
- Entity[],
2213
- ExternalServiceError | DatabaseError
2214
- >;
2215
- }
2216
- >() {}
2217
-
2218
- // Implementation
2219
- const EntityServiceLive = Layer.effect(
2220
- EntityService,
2221
- Effect.gen(function* () {
2222
- const db = yield* DatabaseService;
2223
- const embeddings = yield* EmbeddingService;
2224
-
2225
- return {
2226
- create: (data: EntityCreateData) =>
2227
- Effect.gen(function* () {
2228
- // Validation with typed error
2229
- if (!data.name || data.name.trim().length === 0) {
2230
- return yield* Effect.fail(
2231
- new ValidationError({
2232
- field: "name",
2233
- message: "Name is required and cannot be empty",
2234
- })
2235
- );
2236
- }
2237
-
2238
- if (!data.type) {
2239
- return yield* Effect.fail(
2240
- new ValidationError({
2241
- field: "type",
2242
- message: "Entity type is required",
2243
- })
2244
- );
2245
- }
2246
-
2247
- // Create entity with error handling
2248
- const entityId = yield* Effect.tryPromise({
2249
- try: () =>
2250
- db.insert("entities", {
2251
- type: data.type,
2252
- name: data.name,
2253
- properties: data.properties || {},
2254
- status: data.status || "active",
2255
- createdAt: Date.now(),
2256
- updatedAt: Date.now(),
2257
- }),
2258
- catch: (error) =>
2259
- new DatabaseError({
2260
- operation: "insert",
2261
- cause: error,
2262
- }),
2263
- });
2264
-
2265
- // Generate embedding asynchronously (errors logged but don't fail creation)
2266
- yield* embeddings
2267
- .generate(entityId)
2268
- .pipe(
2269
- Effect.catchAll((error) =>
2270
- Effect.logWarning(`Failed to generate embedding: ${error}`)
2271
- )
2272
- );
2273
-
2274
- return entityId;
2275
- }),
2276
-
2277
- get: (id: string) =>
2278
- Effect.gen(function* () {
2279
- const entity = yield* Effect.tryPromise({
2280
- try: () => db.get(id),
2281
- catch: (error) =>
2282
- new DatabaseError({
2283
- operation: "get",
2284
- cause: error,
2285
- }),
2286
- });
2287
-
2288
- if (!entity) {
2289
- return yield* Effect.fail(
2290
- new NotFoundError({
2291
- entityType: "entity",
2292
- entityId: id,
2293
- })
2294
- );
2295
- }
2296
-
2297
- return entity;
2298
- }),
2299
-
2300
- update: (id: string, data: Partial<Entity>) =>
2301
- Effect.gen(function* () {
2302
- // Check entity exists
2303
- yield* Effect.get(id);
2304
-
2305
- // Validation
2306
- if (data.name !== undefined && data.name.trim().length === 0) {
2307
- return yield* Effect.fail(
2308
- new ValidationError({
2309
- field: "name",
2310
- message: "Name cannot be empty",
2311
- })
2312
- );
2313
- }
2314
-
2315
- // Update entity
2316
- yield* Effect.tryPromise({
2317
- try: () =>
2318
- db.patch(id, {
2319
- ...data,
2320
- updatedAt: Date.now(),
2321
- }),
2322
- catch: (error) =>
2323
- new DatabaseError({
2324
- operation: "update",
2325
- cause: error,
2326
- }),
2327
- });
2328
- }),
2329
-
2330
- search: (query: string) =>
2331
- Effect.gen(function* () {
2332
- // Generate query embedding
2333
- const embedding = yield* embeddings
2334
- .generateQuery(query)
2335
- .pipe(
2336
- Effect.mapError(
2337
- (error) =>
2338
- new ExternalServiceError({
2339
- service: "OpenAI",
2340
- message: `Failed to generate embedding: ${error}`,
2341
- })
2342
- )
2343
- );
2344
-
2345
- // Vector search
2346
- const results = yield* Effect.tryPromise({
2347
- try: () => db.vectorSearch("embeddings", { vector: embedding }),
2348
- catch: (error) =>
2349
- new DatabaseError({
2350
- operation: "vectorSearch",
2351
- cause: error,
2352
- }),
2353
- });
2354
-
2355
- return results;
2356
- }),
2357
- };
2358
- })
2359
- );
2360
- ```
2361
-
2362
- ### Usage in Convex Functions
2363
-
2364
- **File**: `convex/entities/create.ts`
2365
-
2366
- ```typescript
2367
- import { mutation } from "./_generated/server";
2368
- import { v } from "convex/values";
2369
- import { Effect } from "effect";
2370
- import { EntityService, ValidationError, DatabaseError } from "../services/entities";
2371
- import { MainLayer } from "../services/layers";
2372
-
2373
- export const createEntity = mutation({
2374
- args: {
2375
- type: v.string(),
2376
- name: v.string(),
2377
- properties: v.optional(v.any()),
2378
- },
2379
- handler: async (ctx, args) => {
2380
- const program = Effect.gen(function* () {
2381
- const service = yield* EntityService;
2382
- return yield* service.create({
2383
- type: args.type,
2384
- name: args.name,
2385
- properties: args.properties,
2386
- });
2387
- });
2388
-
2389
- // Run program with explicit error handling
2390
- const result = await Effect.runPromise(
2391
- program.pipe(
2392
- Effect.provide(MainLayer),
2393
- Effect.catchTags({
2394
- ValidationError: (error) =>
2395
- Effect.succeed({
2396
- success: false,
2397
- error: "validation",
2398
- field: error.field,
2399
- message: error.message,
2400
- }),
2401
- DatabaseError: (error) =>
2402
- Effect.succeed({
2403
- success: false,
2404
- error: "database",
2405
- message: "Failed to create entity",
2406
- }),
2407
- }),
2408
- Effect.map((entityId) => ({
2409
- success: true,
2410
- entityId,
2411
- }))
2412
- )
2413
- );
2414
-
2415
- return result;
2416
- },
2417
- });
2418
- ```
2419
-
2420
- ### Testing with Mocked Services
2421
-
2422
- **File**: `convex/services/entities.test.ts`
2423
-
2424
- ```typescript
2425
- import { Effect, Layer } from "effect";
2426
- import { EntityService, ValidationError } from "./entities";
2427
-
2428
- const MockEntityService = Layer.succeed(EntityService, {
2429
- create: () => Effect.succeed("mock-entity-id"),
2430
- get: () => Effect.succeed({ _id: "mock-id", name: "Mock Entity" }),
2431
- update: () => Effect.succeed(undefined),
2432
- search: () => Effect.succeed([]),
2433
- });
2434
-
2435
- describe("EntityService", () => {
2436
- test("creates entity successfully", async () => {
2437
- const program = Effect.gen(function* () {
2438
- const service = yield* EntityService;
2439
- return yield* service.create({
2440
- type: "creator",
2441
- name: "Test Creator",
2442
- });
2443
- });
2444
-
2445
- const result = await Effect.runPromise(
2446
- program.pipe(Effect.provide(MockEntityService))
2447
- );
2448
-
2449
- expect(result).toBe("mock-entity-id");
2450
- });
2451
-
2452
- test("validates required fields", async () => {
2453
- const program = Effect.gen(function* () {
2454
- const service = yield* EntityService;
2455
- return yield* service.create({
2456
- type: "creator",
2457
- name: "", // Invalid
2458
- });
2459
- });
2460
-
2461
- const result = await Effect.runPromiseExit(
2462
- program.pipe(Effect.provide(MockEntityService))
2463
- );
2464
-
2465
- if (Effect.isFailure(result)) {
2466
- expect(result.cause._tag).toBe("ValidationError");
2467
- }
2468
- });
2469
- });
2470
- ```
2471
-
2472
- **Benefits of Effect.ts Pattern**:
2473
-
2474
- - **Typed error channels**: Every error is explicit in the type signature
2475
- - **No silent failures**: Impossible to ignore errors
2476
- - **Automatic dependency injection**: Services compose cleanly
2477
- - **Testable**: Mock any dependency with `Layer.succeed`
2478
- - **Composable**: Chain operations with `Effect.gen`
2479
- - **Full observability**: Built-in logging and tracing
2480
- - **Retry logic**: Built-in retry with backoff
2481
- - **Concurrent operations**: Safe parallel execution with `Effect.all`
2482
-
2483
- ### Advanced Pattern: Atomic Operations with Rollback
2484
-
2485
- ```typescript
2486
- export const createContentWithOwnership = Effect.gen(function* () {
2487
- const entities = yield* EntityService;
2488
- const connections = yield* ConnectionService;
2489
- const events = yield* EventService;
2490
-
2491
- // All operations or none (atomic)
2492
- const contentId = yield* entities.create({
2493
- type: "blog_post",
2494
- name: "My Post",
2495
- });
2496
-
2497
- yield* connections.create({
2498
- fromEntityId: creatorId,
2499
- toEntityId: contentId,
2500
- relationshipType: "owns",
2501
- });
2502
-
2503
- yield* events.log({
2504
- entityId: contentId,
2505
- eventType: "entity_created",
2506
- metadata: { entityType: "blog_post" },
2507
- });
2508
-
2509
- return contentId;
2510
- }).pipe(
2511
- Effect.catchAll((error) =>
2512
- Effect.gen(function* () {
2513
- // Rollback logic here
2514
- yield* Effect.logError(`Transaction failed: ${error}`);
2515
- return yield* Effect.fail(error);
2516
- })
2517
- )
2518
- );
2519
- ```
2520
-
2521
- ---
2522
-
2523
-
2524
-
2525
- ### Environment Setup
2526
-
2527
- ```bash
2528
- # Production
2529
- CONVEX_DEPLOY_KEY=prod_xxx
2530
- STRIPE_SECRET_KEY=sk_live_xxx
2531
- STRIPE_WEBHOOK_SECRET=whsec_xxx
2532
- CLERK_SECRET_KEY=sk_live_xxx
2533
- OPENAI_API_KEY=sk-xxx
2534
- SITE_URL=https://one.ie
2535
-
2536
- # Monitoring
2537
- AXIOM_API_KEY=xxx
2538
- SENTRY_DSN=xxx
2539
- ```
2540
-
2541
- ---
2542
-
2543
- ---
2544
-
2545
- ## Risk Mitigation Matrix
2546
-
2547
- |Risk|Likelihood|Impact|Mitigation|Owner|
2548
- |---|---|---|---|---|
2549
- |Payment failures|Medium|High|Stripe retry logic, clear error messages|Backend|
2550
- |Migration data loss|Low|Critical|Batched processing, dual-write, backups|DevOps|
2551
- |Performance degradation|Medium|High|Proper indexing, load testing, caching|Backend|
2552
- |Security breach|Low|Critical|Security audit, penetration testing, bug bounty|Security|
2553
- |Low user adoption|Medium|High|Beta testing, user interviews, onboarding optimization|Product|
2554
- |Feature creep|High|Medium|Strict prioritization, MVP focus, iterative releases|PM|