oneie 3.6.40 → 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 (984) hide show
  1. package/README.md +28 -9
  2. package/dist/admin/build.d.ts +15 -0
  3. package/dist/admin/build.d.ts.map +1 -0
  4. package/dist/admin/build.js +295 -0
  5. package/dist/admin/build.js.map +1 -0
  6. package/dist/admin/index.d.ts +24 -0
  7. package/dist/admin/index.d.ts.map +1 -0
  8. package/dist/admin/index.js +98 -0
  9. package/dist/admin/index.js.map +1 -0
  10. package/dist/admin/list.d.ts +14 -0
  11. package/dist/admin/list.d.ts.map +1 -0
  12. package/dist/admin/list.js +90 -0
  13. package/dist/admin/list.js.map +1 -0
  14. package/dist/admin/manifest.d.ts +86 -0
  15. package/dist/admin/manifest.d.ts.map +1 -0
  16. package/dist/admin/manifest.js +183 -0
  17. package/dist/admin/manifest.js.map +1 -0
  18. package/dist/admin/monorepo.d.ts +25 -0
  19. package/dist/admin/monorepo.d.ts.map +1 -0
  20. package/dist/admin/monorepo.js +59 -0
  21. package/dist/admin/monorepo.js.map +1 -0
  22. package/dist/admin/release.d.ts +17 -0
  23. package/dist/admin/release.d.ts.map +1 -0
  24. package/dist/admin/release.js +144 -0
  25. package/dist/admin/release.js.map +1 -0
  26. package/dist/admin/sync.d.ts +14 -0
  27. package/dist/admin/sync.d.ts.map +1 -0
  28. package/dist/admin/sync.js +104 -0
  29. package/dist/admin/sync.js.map +1 -0
  30. package/dist/admin/validate.d.ts +15 -0
  31. package/dist/admin/validate.d.ts.map +1 -0
  32. package/dist/admin/validate.js +169 -0
  33. package/dist/admin/validate.js.map +1 -0
  34. package/dist/commands/agent.d.ts +2 -0
  35. package/dist/commands/agent.d.ts.map +1 -1
  36. package/dist/commands/agent.js +44 -0
  37. package/dist/commands/agent.js.map +1 -1
  38. package/dist/commands/ask.d.ts +4 -0
  39. package/dist/commands/ask.d.ts.map +1 -0
  40. package/dist/commands/ask.js +8 -0
  41. package/dist/commands/ask.js.map +1 -0
  42. package/dist/commands/bounty.d.ts +4 -0
  43. package/dist/commands/bounty.d.ts.map +1 -0
  44. package/dist/commands/bounty.js +24 -0
  45. package/dist/commands/bounty.js.map +1 -0
  46. package/dist/commands/capabilities.d.ts +4 -0
  47. package/dist/commands/capabilities.d.ts.map +1 -0
  48. package/dist/commands/capabilities.js +18 -0
  49. package/dist/commands/capabilities.js.map +1 -0
  50. package/dist/commands/claw.d.ts +4 -0
  51. package/dist/commands/claw.d.ts.map +1 -0
  52. package/dist/commands/claw.js +14 -0
  53. package/dist/commands/claw.js.map +1 -0
  54. package/dist/commands/commend.d.ts +4 -0
  55. package/dist/commands/commend.d.ts.map +1 -0
  56. package/dist/commands/commend.js +13 -0
  57. package/dist/commands/commend.js.map +1 -0
  58. package/dist/commands/completion.d.ts +4 -0
  59. package/dist/commands/completion.d.ts.map +1 -0
  60. package/dist/commands/completion.js +49 -0
  61. package/dist/commands/completion.js.map +1 -0
  62. package/dist/commands/config.d.ts +4 -0
  63. package/dist/commands/config.d.ts.map +1 -0
  64. package/dist/commands/config.js +78 -0
  65. package/dist/commands/config.js.map +1 -0
  66. package/dist/commands/deploy.d.ts +4 -0
  67. package/dist/commands/deploy.d.ts.map +1 -0
  68. package/dist/commands/deploy.js +10 -0
  69. package/dist/commands/deploy.js.map +1 -0
  70. package/dist/commands/doctor.d.ts +4 -0
  71. package/dist/commands/doctor.d.ts.map +1 -0
  72. package/dist/commands/doctor.js +72 -0
  73. package/dist/commands/doctor.js.map +1 -0
  74. package/dist/commands/export.d.ts +4 -0
  75. package/dist/commands/export.d.ts.map +1 -0
  76. package/dist/commands/export.js +15 -0
  77. package/dist/commands/export.js.map +1 -0
  78. package/dist/commands/fade.d.ts +4 -0
  79. package/dist/commands/fade.d.ts.map +1 -0
  80. package/dist/commands/fade.js +15 -0
  81. package/dist/commands/fade.js.map +1 -0
  82. package/dist/commands/flag.d.ts +4 -0
  83. package/dist/commands/flag.d.ts.map +1 -0
  84. package/dist/commands/flag.js +13 -0
  85. package/dist/commands/flag.js.map +1 -0
  86. package/dist/commands/forget.d.ts +4 -0
  87. package/dist/commands/forget.d.ts.map +1 -0
  88. package/dist/commands/forget.js +16 -0
  89. package/dist/commands/forget.js.map +1 -0
  90. package/dist/commands/frontier.d.ts +4 -0
  91. package/dist/commands/frontier.d.ts.map +1 -0
  92. package/dist/commands/frontier.js +11 -0
  93. package/dist/commands/frontier.js.map +1 -0
  94. package/dist/commands/health.d.ts +4 -0
  95. package/dist/commands/health.d.ts.map +1 -0
  96. package/dist/commands/health.js +11 -0
  97. package/dist/commands/health.js.map +1 -0
  98. package/dist/commands/highways.d.ts +4 -0
  99. package/dist/commands/highways.d.ts.map +1 -0
  100. package/dist/commands/highways.js +14 -0
  101. package/dist/commands/highways.js.map +1 -0
  102. package/dist/commands/hire.d.ts +4 -0
  103. package/dist/commands/hire.d.ts.map +1 -0
  104. package/dist/commands/hire.js +16 -0
  105. package/dist/commands/hire.js.map +1 -0
  106. package/dist/commands/init.d.ts.map +1 -1
  107. package/dist/commands/init.js +69 -42
  108. package/dist/commands/init.js.map +1 -1
  109. package/dist/commands/know.d.ts +4 -0
  110. package/dist/commands/know.d.ts.map +1 -0
  111. package/dist/commands/know.js +8 -0
  112. package/dist/commands/know.js.map +1 -0
  113. package/dist/commands/launch.d.ts +4 -0
  114. package/dist/commands/launch.d.ts.map +1 -0
  115. package/dist/commands/launch.js +16 -0
  116. package/dist/commands/launch.js.map +1 -0
  117. package/dist/commands/mark.d.ts +4 -0
  118. package/dist/commands/mark.d.ts.map +1 -0
  119. package/dist/commands/mark.js +15 -0
  120. package/dist/commands/mark.js.map +1 -0
  121. package/dist/commands/pay.d.ts +4 -0
  122. package/dist/commands/pay.d.ts.map +1 -0
  123. package/dist/commands/pay.js +21 -0
  124. package/dist/commands/pay.js.map +1 -0
  125. package/dist/commands/pipe.d.ts +4 -0
  126. package/dist/commands/pipe.d.ts.map +1 -0
  127. package/dist/commands/pipe.js +35 -0
  128. package/dist/commands/pipe.js.map +1 -0
  129. package/dist/commands/publish.d.ts +4 -0
  130. package/dist/commands/publish.d.ts.map +1 -0
  131. package/dist/commands/publish.js +23 -0
  132. package/dist/commands/publish.js.map +1 -0
  133. package/dist/commands/recall.d.ts +4 -0
  134. package/dist/commands/recall.d.ts.map +1 -0
  135. package/dist/commands/recall.js +12 -0
  136. package/dist/commands/recall.js.map +1 -0
  137. package/dist/commands/repl.d.ts +4 -0
  138. package/dist/commands/repl.d.ts.map +1 -0
  139. package/dist/commands/repl.js +56 -0
  140. package/dist/commands/repl.js.map +1 -0
  141. package/dist/commands/reveal.d.ts +4 -0
  142. package/dist/commands/reveal.d.ts.map +1 -0
  143. package/dist/commands/reveal.js +11 -0
  144. package/dist/commands/reveal.js.map +1 -0
  145. package/dist/commands/revenue.d.ts +4 -0
  146. package/dist/commands/revenue.d.ts.map +1 -0
  147. package/dist/commands/revenue.js +11 -0
  148. package/dist/commands/revenue.js.map +1 -0
  149. package/dist/commands/select.d.ts +4 -0
  150. package/dist/commands/select.d.ts.map +1 -0
  151. package/dist/commands/select.js +19 -0
  152. package/dist/commands/select.js.map +1 -0
  153. package/dist/commands/signal.d.ts +4 -0
  154. package/dist/commands/signal.d.ts.map +1 -0
  155. package/dist/commands/signal.js +8 -0
  156. package/dist/commands/signal.js.map +1 -0
  157. package/dist/commands/stats.d.ts +4 -0
  158. package/dist/commands/stats.d.ts.map +1 -0
  159. package/dist/commands/stats.js +11 -0
  160. package/dist/commands/stats.js.map +1 -0
  161. package/dist/commands/status.d.ts +4 -0
  162. package/dist/commands/status.d.ts.map +1 -0
  163. package/dist/commands/status.js +18 -0
  164. package/dist/commands/status.js.map +1 -0
  165. package/dist/commands/sync.d.ts +4 -0
  166. package/dist/commands/sync.d.ts.map +1 -0
  167. package/dist/commands/sync.js +20 -0
  168. package/dist/commands/sync.js.map +1 -0
  169. package/dist/commands/tail.d.ts +4 -0
  170. package/dist/commands/tail.d.ts.map +1 -0
  171. package/dist/commands/tail.js +51 -0
  172. package/dist/commands/tail.js.map +1 -0
  173. package/dist/commands/warn.d.ts +4 -0
  174. package/dist/commands/warn.d.ts.map +1 -0
  175. package/dist/commands/warn.js +15 -0
  176. package/dist/commands/warn.js.map +1 -0
  177. package/dist/create-org-profile.js +2 -2
  178. package/dist/create-user-profile.js +2 -2
  179. package/dist/index.js +135 -7
  180. package/dist/index.js.map +1 -1
  181. package/dist/lib/args.d.ts +11 -0
  182. package/dist/lib/args.d.ts.map +1 -0
  183. package/dist/lib/args.js +57 -0
  184. package/dist/lib/args.js.map +1 -0
  185. package/dist/lib/config.d.ts +12 -0
  186. package/dist/lib/config.d.ts.map +1 -0
  187. package/dist/lib/config.js +38 -0
  188. package/dist/lib/config.js.map +1 -0
  189. package/dist/lib/http.d.ts +9 -0
  190. package/dist/lib/http.d.ts.map +1 -0
  191. package/dist/lib/http.js +25 -0
  192. package/dist/lib/http.js.map +1 -0
  193. package/dist/lib/output.d.ts +5 -0
  194. package/dist/lib/output.d.ts.map +1 -0
  195. package/dist/lib/output.js +32 -0
  196. package/dist/lib/output.js.map +1 -0
  197. package/dist/lib/sdk.d.ts +10 -0
  198. package/dist/lib/sdk.d.ts.map +1 -0
  199. package/dist/lib/sdk.js +22 -0
  200. package/dist/lib/sdk.js.map +1 -0
  201. package/dist/lib/telemetry.d.ts +4 -0
  202. package/dist/lib/telemetry.d.ts.map +1 -0
  203. package/dist/lib/telemetry.js +61 -0
  204. package/dist/lib/telemetry.js.map +1 -0
  205. package/dist/utils/file-resolver.js +1 -3
  206. package/dist/utils/file-resolver.js.map +1 -1
  207. package/dist/utils/installation-setup.d.ts +15 -0
  208. package/dist/utils/installation-setup.d.ts.map +1 -1
  209. package/dist/utils/installation-setup.js +71 -8
  210. package/dist/utils/installation-setup.js.map +1 -1
  211. package/package.json +5 -21
  212. package/.claude/agents/TROUBLESHOOTING.md +0 -530
  213. package/.claude/agents/agent-backend.md +0 -574
  214. package/.claude/agents/agent-builder.md +0 -911
  215. package/.claude/agents/agent-claude.md +0 -645
  216. package/.claude/agents/agent-clean.md +0 -477
  217. package/.claude/agents/agent-clone.md +0 -554
  218. package/.claude/agents/agent-designer.md +0 -1080
  219. package/.claude/agents/agent-director.md +0 -2254
  220. package/.claude/agents/agent-documenter.md +0 -688
  221. package/.claude/agents/agent-frontend.md +0 -1199
  222. package/.claude/agents/agent-integrator.md +0 -670
  223. package/.claude/agents/agent-lawyer.md +0 -1320
  224. package/.claude/agents/agent-news.md +0 -363
  225. package/.claude/agents/agent-onboard.md +0 -613
  226. package/.claude/agents/agent-ontology.md +0 -585
  227. package/.claude/agents/agent-ops.md +0 -1275
  228. package/.claude/agents/agent-problem-solver.md +0 -669
  229. package/.claude/agents/agent-quality.md +0 -1042
  230. package/.claude/agents/agent-sales.md +0 -507
  231. package/.claude/agents/agent-writer.md +0 -1068
  232. package/.claude/commands/cascade.md +0 -742
  233. package/.claude/commands/chat.md +0 -728
  234. package/.claude/commands/commit.md +0 -95
  235. package/.claude/commands/create.md +0 -544
  236. package/.claude/commands/deploy.md +0 -309
  237. package/.claude/commands/fast.md +0 -636
  238. package/.claude/commands/mcp-on.md +0 -191
  239. package/.claude/commands/media-upload.md +0 -186
  240. package/.claude/commands/news.md +0 -274
  241. package/.claude/commands/onboard.md +0 -440
  242. package/.claude/commands/one.md +0 -398
  243. package/.claude/commands/optimize.md +0 -74
  244. package/.claude/commands/plan.md +0 -719
  245. package/.claude/commands/push.md +0 -214
  246. package/.claude/commands/release.md +0 -105
  247. package/.claude/commands/review.md +0 -99
  248. package/.claude/commands/server.md +0 -487
  249. package/.claude/commands/start.md +0 -227
  250. package/.claude/commands/test.md +0 -197
  251. package/.claude/commands/validate.md +0 -140
  252. package/.claude/hooks/.last-news-context +0 -1
  253. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
  254. package/.claude/hooks/README-knowledge-hooks.md +0 -451
  255. package/.claude/hooks/README-news-generation.md +0 -364
  256. package/.claude/hooks/README-root-cleanup.md +0 -200
  257. package/.claude/hooks/README.md +0 -284
  258. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  259. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  260. package/.claude/hooks/auto-format.sh +0 -106
  261. package/.claude/hooks/check-filenames.py +0 -177
  262. package/.claude/hooks/clean-post.py +0 -468
  263. package/.claude/hooks/clean-pre.py +0 -393
  264. package/.claude/hooks/clean-root-markdown.sh +0 -73
  265. package/.claude/hooks/commit-push.sh +0 -95
  266. package/.claude/hooks/done.py +0 -236
  267. package/.claude/hooks/format-hook.sh +0 -163
  268. package/.claude/hooks/formatting.py +0 -187
  269. package/.claude/hooks/hook-logger.sh +0 -173
  270. package/.claude/hooks/knowledge-post.py +0 -355
  271. package/.claude/hooks/knowledge-pre.py +0 -245
  272. package/.claude/hooks/mcp-on.sh +0 -134
  273. package/.claude/hooks/notification-hook.sh +0 -279
  274. package/.claude/hooks/ontology-validation.py +0 -255
  275. package/.claude/hooks/push.sh +0 -153
  276. package/.claude/hooks/release-cli.sh +0 -205
  277. package/.claude/hooks/root-cleanup.py +0 -217
  278. package/.claude/hooks/security-hook.sh +0 -397
  279. package/.claude/hooks/tag-all-docs.py +0 -464
  280. package/.claude/hooks/test-validate-ontology.sh +0 -170
  281. package/.claude/hooks/todo.py +0 -368
  282. package/.claude/hooks/track-changes.sh +0 -101
  283. package/.claude/hooks/validate-imports.py +0 -182
  284. package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
  285. package/.claude/hooks/validate-ontology-structure.py +0 -558
  286. package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
  287. package/.claude/hooks/validate-ontology.py +0 -140
  288. package/.claude/hooks/write-news.sh +0 -194
  289. package/.claude/skills/INDEX.md +0 -523
  290. package/.claude/skills/REGISTRY.md +0 -529
  291. package/.claude/skills/agent-backend-create-mutation.md +0 -319
  292. package/.claude/skills/agent-designer-create-wireframe.md +0 -341
  293. package/.claude/skills/agent-frontend-create-page.md +0 -413
  294. package/.claude/skills/agents/README.md +0 -238
  295. package/.claude/skills/astro/add-content-collection.md +0 -30
  296. package/.claude/skills/astro/check-build.md +0 -29
  297. package/.claude/skills/astro/create-component.md +0 -29
  298. package/.claude/skills/astro/create-page.md +0 -30
  299. package/.claude/skills/astro/optimize-performance.md +0 -21
  300. package/.claude/skills/convex/check-deployment.md +0 -46
  301. package/.claude/skills/convex/create-mutation.md +0 -405
  302. package/.claude/skills/convex/create-query.md +0 -52
  303. package/.claude/skills/convex/read-schema.md +0 -373
  304. package/.claude/skills/convex/test-function.md +0 -50
  305. package/.claude/skills/deployment/check-deployment-health.md +0 -20
  306. package/.claude/skills/deployment/create-release.md +0 -21
  307. package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
  308. package/.claude/skills/deployment/deploy-convex.md +0 -30
  309. package/.claude/skills/deployment/sync-repositories.md +0 -19
  310. package/.claude/skills/design/check-accessibility.md +0 -21
  311. package/.claude/skills/design/create-component-spec.md +0 -27
  312. package/.claude/skills/design/generate-design-tokens.md +0 -24
  313. package/.claude/skills/design/generate-wireframe.md +0 -30
  314. package/.claude/skills/documentation/create-migration-guide.md +0 -20
  315. package/.claude/skills/documentation/generate-api-docs.md +0 -27
  316. package/.claude/skills/documentation/generate-readme.md +0 -22
  317. package/.claude/skills/documentation/update-knowledge.md +0 -20
  318. package/.claude/skills/integration/connect-external-system.md +0 -21
  319. package/.claude/skills/integration/implement-a2a.md +0 -20
  320. package/.claude/skills/integration/implement-acp.md +0 -20
  321. package/.claude/skills/integration/verify-integration.md +0 -20
  322. package/.claude/skills/ontology/README.md +0 -255
  323. package/.claude/skills/ontology/check-dimension.md +0 -307
  324. package/.claude/skills/ontology/generate-entity-type.md +0 -339
  325. package/.claude/skills/ontology/validate-schema.md +0 -229
  326. package/.claude/skills/ontology/verify-relationships.md +0 -310
  327. package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
  328. package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
  329. package/.claude/skills/problem-solving/propose-solution.md +0 -29
  330. package/.claude/skills/problem-solving/verify-fix.md +0 -21
  331. package/.claude/skills/sales/generate-demo-script.md +0 -21
  332. package/.claude/skills/sales/qualify-lead.md +0 -30
  333. package/.claude/skills/sales/track-trial.md +0 -20
  334. package/.claude/skills/sales/verify-kyc.md +0 -20
  335. package/.claude/skills/testing/analyze-coverage.md +0 -24
  336. package/.claude/skills/testing/generate-tests.md +0 -24
  337. package/.claude/skills/testing/run-tests.md +0 -27
  338. package/.claude/skills/testing/validate-e2e.md +0 -25
  339. package/AGENTS.md +0 -60
  340. package/CLAUDE.md +0 -321
  341. package/CREATE-WEBSITE.md +0 -458
  342. package/SECURITY.md +0 -31
  343. package/dist/commands/create-website.d.ts +0 -19
  344. package/dist/commands/create-website.d.ts.map +0 -1
  345. package/dist/commands/create-website.js +0 -231
  346. package/dist/commands/create-website.js.map +0 -1
  347. package/folders.yaml +0 -92
  348. package/one/README.md +0 -760
  349. package/one/connections/a2a.md +0 -600
  350. package/one/connections/acp.md +0 -808
  351. package/one/connections/acps.md +0 -749
  352. package/one/connections/agentkit.md +0 -367
  353. package/one/connections/agui.md +0 -785
  354. package/one/connections/any-backend.md +0 -1720
  355. package/one/connections/ap2.md +0 -1072
  356. package/one/connections/api/queries-reference.md +0 -860
  357. package/one/connections/api-docs.md +0 -1909
  358. package/one/connections/api-reference.md +0 -1029
  359. package/one/connections/api.md +0 -2208
  360. package/one/connections/architecture-diagram.md +0 -112
  361. package/one/connections/communications.md +0 -467
  362. package/one/connections/connections.md +0 -357
  363. package/one/connections/copilotkit.md +0 -1577
  364. package/one/connections/cryptonetworks.md +0 -799
  365. package/one/connections/documentation.md +0 -1138
  366. package/one/connections/effect.md +0 -297
  367. package/one/connections/elizaos.md +0 -1308
  368. package/one/connections/groups.md +0 -814
  369. package/one/connections/inference.md +0 -76
  370. package/one/connections/integration-examples.md +0 -893
  371. package/one/connections/integration-guide.md +0 -887
  372. package/one/connections/integration-phase2.md +0 -754
  373. package/one/connections/kyc.md +0 -650
  374. package/one/connections/mcp.md +0 -860
  375. package/one/connections/membership.md +0 -1170
  376. package/one/connections/middleware.md +0 -1085
  377. package/one/connections/multitenant.md +0 -1359
  378. package/one/connections/n8n.md +0 -1033
  379. package/one/connections/patterns.md +0 -107
  380. package/one/connections/protocols.md +0 -297
  381. package/one/connections/relationships.md +0 -125
  382. package/one/connections/schema.md +0 -605
  383. package/one/connections/service-layer.md +0 -568
  384. package/one/connections/vectors.md +0 -225
  385. package/one/connections/wordpress.md +0 -1320
  386. package/one/connections/workflow-copy.md +0 -923
  387. package/one/connections/workflow-examples.md +0 -759
  388. package/one/connections/workflow-onboarding.md +0 -701
  389. package/one/connections/workflow.md +0 -923
  390. package/one/connections/workflows/delegation.md +0 -903
  391. package/one/connections/workflows/frontend.md +0 -1055
  392. package/one/connections/workflows/strategy.md +0 -921
  393. package/one/connections/workflows/tasks.md +0 -716
  394. package/one/connections/x402-baazar.md +0 -131
  395. package/one/connections/x402.md +0 -1353
  396. package/one/groups/features.md +0 -2904
  397. package/one/groups/groups.md +0 -587
  398. package/one/groups/one.md +0 -619
  399. package/one/groups/strategy-copy.md +0 -887
  400. package/one/knowledge/.obsidian/app.json +0 -1
  401. package/one/knowledge/.obsidian/appearance.json +0 -1
  402. package/one/knowledge/.obsidian/core-plugins.json +0 -33
  403. package/one/knowledge/.obsidian/ecommerce-ontology.md +0 -210
  404. package/one/knowledge/.obsidian/workspace.json +0 -211
  405. package/one/knowledge/100-inference-quick-reference.md +0 -449
  406. package/one/knowledge/ag-ui-protocol.md +0 -613
  407. package/one/knowledge/agent-onboard-usage.md +0 -630
  408. package/one/knowledge/agentic-commerce.md +0 -146
  409. package/one/knowledge/ai-agents-vs-memecoins-thesis.md +0 -683
  410. package/one/knowledge/ai-api-reference.md +0 -715
  411. package/one/knowledge/ai-platform.md +0 -323
  412. package/one/knowledge/ai-quickstart.md +0 -355
  413. package/one/knowledge/ai-sdk-implementation.md +0 -436
  414. package/one/knowledge/ai-token-crypto-analysis-framework.md +0 -1191
  415. package/one/knowledge/ai-token-paradigm-shift-2025.md +0 -732
  416. package/one/knowledge/altcoin-cycle-prediction-ontology.md +0 -884
  417. package/one/knowledge/altcoin-cycle-trading-strategy.md +0 -642
  418. package/one/knowledge/architecture-any-backend.md +0 -1589
  419. package/one/knowledge/architecture-diagram.md +0 -404
  420. package/one/knowledge/architecture-frontend.md +0 -1014
  421. package/one/knowledge/architecture.md +0 -1742
  422. package/one/knowledge/archived/ontology.old.md +0 -2840
  423. package/one/knowledge/astro-effect-complete-vision.md +0 -2148
  424. package/one/knowledge/astro-effect-simple-architecture.md +0 -750
  425. package/one/knowledge/audit-agent-onboard-alignment.md +0 -481
  426. package/one/knowledge/audit-agent-sales-alignment.md +0 -444
  427. package/one/knowledge/backend-api-reference.md +0 -728
  428. package/one/knowledge/cascading-context-specification.md +0 -1617
  429. package/one/knowledge/claude-code-integration.md +0 -1293
  430. package/one/knowledge/cli-claude-handoff.md +0 -736
  431. package/one/knowledge/context-engineering.md +0 -610
  432. package/one/knowledge/crypto-analysis-strategy.md +0 -1276
  433. package/one/knowledge/crypto-cycle-2024-2025-analysis.md +0 -44
  434. package/one/knowledge/crypto.md +0 -978
  435. package/one/knowledge/develop/design.md +0 -364
  436. package/one/knowledge/develop/index.md +0 -145
  437. package/one/knowledge/development-commands.md +0 -251
  438. package/one/knowledge/docs.md +0 -627
  439. package/one/knowledge/dsl.md +0 -1678
  440. package/one/knowledge/event-driven-documentation.md +0 -270
  441. package/one/knowledge/files.md +0 -2489
  442. package/one/knowledge/frontend.md +0 -1056
  443. package/one/knowledge/games-english.md +0 -691
  444. package/one/knowledge/games.md +0 -1082
  445. package/one/knowledge/generative-ui-patterns.md +0 -559
  446. package/one/knowledge/guidelines.md +0 -314
  447. package/one/knowledge/hono.md +0 -2127
  448. package/one/knowledge/implementation-examples.md +0 -2554
  449. package/one/knowledge/installation-folders.md +0 -366
  450. package/one/knowledge/institutional-cycle-paradigm-2025.md +0 -555
  451. package/one/knowledge/knowledge.md +0 -660
  452. package/one/knowledge/language.md +0 -998
  453. package/one/knowledge/lessons-learned.md +0 -378
  454. package/one/knowledge/lessons-website-building-focus.md +0 -382
  455. package/one/knowledge/merge-report.md +0 -254
  456. package/one/knowledge/metadata-system.md +0 -504
  457. package/one/knowledge/nine-padel-playbook.md +0 -229
  458. package/one/knowledge/one-protocol-ai-agents.md +0 -892
  459. package/one/knowledge/one-protocol-executive-report.md +0 -617
  460. package/one/knowledge/one-protocol-standard.md +0 -869
  461. package/one/knowledge/one-protocol-whitepaper.md +0 -756
  462. package/one/knowledge/ontology-blog.yaml +0 -47
  463. package/one/knowledge/ontology-cheatsheet.md +0 -617
  464. package/one/knowledge/ontology-community.yaml +0 -65
  465. package/one/knowledge/ontology-core-universal.md +0 -740
  466. package/one/knowledge/ontology-core.yaml +0 -63
  467. package/one/knowledge/ontology-courses.yaml +0 -76
  468. package/one/knowledge/ontology-creator.md +0 -402
  469. package/one/knowledge/ontology-crypto.md +0 -1603
  470. package/one/knowledge/ontology-developer-guide.md +0 -814
  471. package/one/knowledge/ontology-documentation.md +0 -377
  472. package/one/knowledge/ontology-ecommerce.md +0 -269
  473. package/one/knowledge/ontology-education-game.md +0 -1654
  474. package/one/knowledge/ontology-education.md +0 -938
  475. package/one/knowledge/ontology-engineering-specification.md +0 -1310
  476. package/one/knowledge/ontology-engineering.md +0 -1676
  477. package/one/knowledge/ontology-files.yaml +0 -525
  478. package/one/knowledge/ontology-frontend-master.md +0 -2898
  479. package/one/knowledge/ontology-frontend-specifications.md +0 -2196
  480. package/one/knowledge/ontology-frontend.md +0 -2475
  481. package/one/knowledge/ontology-index.md +0 -397
  482. package/one/knowledge/ontology-minimal.yaml +0 -301
  483. package/one/knowledge/ontology-portfolio.yaml +0 -45
  484. package/one/knowledge/ontology-quickstart.md +0 -602
  485. package/one/knowledge/ontology-release.md +0 -317
  486. package/one/knowledge/ontology-shop.yaml +0 -148
  487. package/one/knowledge/ontology-tokens.yaml +0 -51
  488. package/one/knowledge/ontology-tutorial.md +0 -455
  489. package/one/knowledge/ontology-v2.md +0 -4449
  490. package/one/knowledge/ontology-video-script.md +0 -939
  491. package/one/knowledge/ontology-visual-guide.md +0 -378
  492. package/one/knowledge/ontology.md +0 -3847
  493. package/one/knowledge/ontology.yaml +0 -1653
  494. package/one/knowledge/parallel-agents.md +0 -932
  495. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +0 -130
  496. package/one/knowledge/patterns/backend/convex-query-pattern.md +0 -143
  497. package/one/knowledge/patterns/backend/mutation-template.md +0 -249
  498. package/one/knowledge/patterns/backend/query-template.md +0 -286
  499. package/one/knowledge/patterns/backend/service-template.md +0 -258
  500. package/one/knowledge/patterns/design/component-architecture.md +0 -435
  501. package/one/knowledge/patterns/design/index.md +0 -160
  502. package/one/knowledge/patterns/design/test-driven-design-pattern.md +0 -196
  503. package/one/knowledge/patterns/design/wireframe-template.md +0 -250
  504. package/one/knowledge/patterns/frontend/component-template.md +0 -246
  505. package/one/knowledge/patterns/frontend/form-template.md +0 -348
  506. package/one/knowledge/patterns/frontend/page-template.md +0 -209
  507. package/one/knowledge/patterns/frontend/react-component-pattern.md +0 -188
  508. package/one/knowledge/patterns/test/acceptance-criteria-template.md +0 -396
  509. package/one/knowledge/patterns/test/technical-test-template.md +0 -566
  510. package/one/knowledge/patterns/test/test-driven-pattern.md +0 -160
  511. package/one/knowledge/patterns/test/user-flow-template.md +0 -272
  512. package/one/knowledge/performance.md +0 -459
  513. package/one/knowledge/provider-agnostic-content.md +0 -995
  514. package/one/knowledge/provider-creation-guide.md +0 -1082
  515. package/one/knowledge/quality-loop.md +0 -419
  516. package/one/knowledge/quick-start-ontology-mapping.md +0 -773
  517. package/one/knowledge/readme-architecture.md +0 -158
  518. package/one/knowledge/readme.md +0 -149
  519. package/one/knowledge/rules.md +0 -644
  520. package/one/knowledge/score.md +0 -85
  521. package/one/knowledge/specifications.md +0 -873
  522. package/one/knowledge/tags.md +0 -148
  523. package/one/knowledge/todo-template.md +0 -269
  524. package/one/knowledge/todo.md +0 -269
  525. package/one/knowledge/troubleshooting.md +0 -434
  526. package/one/knowledge/typescript-patterns.md +0 -321
  527. package/one/knowledge/universal-generation-language.md +0 -827
  528. package/one/knowledge/x402-research.md +0 -104
  529. package/one/license.md +0 -107
  530. package/one/people/anthony-o-connell.md +0 -469
  531. package/one/people/people.md +0 -590
  532. package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
  533. package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
  534. package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
  535. package/one/things/CHECKLIST.md +0 -407
  536. package/one/things/IMPLEMENTATION_STATUS.md +0 -379
  537. package/one/things/ONE.md +0 -529
  538. package/one/things/agents/agent-backend.md +0 -1501
  539. package/one/things/agents/agent-builder.md +0 -1064
  540. package/one/things/agents/agent-clean.md +0 -1112
  541. package/one/things/agents/agent-clone.md +0 -1324
  542. package/one/things/agents/agent-deploy.md +0 -986
  543. package/one/things/agents/agent-designer.md +0 -2305
  544. package/one/things/agents/agent-director.md +0 -1526
  545. package/one/things/agents/agent-documenter.md +0 -1129
  546. package/one/things/agents/agent-frontend.md +0 -1201
  547. package/one/things/agents/agent-integrator.md +0 -1269
  548. package/one/things/agents/agent-lawyer.md +0 -1371
  549. package/one/things/agents/agent-problem-solver.md +0 -1457
  550. package/one/things/agents/agent-quality.md +0 -1483
  551. package/one/things/agents/agent-sales.md +0 -1074
  552. package/one/things/cascade/cascade.yaml +0 -481
  553. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
  554. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
  555. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
  556. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
  557. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
  558. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
  559. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
  560. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
  561. package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
  562. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
  563. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
  564. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
  565. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
  566. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
  567. package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
  568. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
  569. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
  570. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
  571. package/one/things/cascade/docs/examples/readme.md +0 -259
  572. package/one/things/cascade/docs/getting-started.md +0 -533
  573. package/one/things/cascade/docs/workflow.md +0 -1378
  574. package/one/things/cascade/readme.md +0 -379
  575. package/one/things/cascade/templates/feature-template.md +0 -289
  576. package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
  577. package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
  578. package/one/things/claude/agents/analyst.md +0 -508
  579. package/one/things/claude/agents/architect.md +0 -505
  580. package/one/things/claude/agents/brand-identity-specialist.md +0 -538
  581. package/one/things/claude/agents/bstp-token-strategist.md +0 -690
  582. package/one/things/claude/agents/builder-repo.md +0 -532
  583. package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
  584. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
  585. package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
  586. package/one/things/claude/agents/company-bullstamp-character.md +0 -602
  587. package/one/things/claude/agents/company-bullstamp-community.md +0 -307
  588. package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
  589. package/one/things/claude/agents/company-bullstamp-token.md +0 -307
  590. package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
  591. package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
  592. package/one/things/claude/agents/content-calendar-planner.md +0 -473
  593. package/one/things/claude/agents/content-chapter-formatter.md +0 -513
  594. package/one/things/claude/agents/content-formatter.md +0 -571
  595. package/one/things/claude/agents/content-hook-specialist.md +0 -485
  596. package/one/things/claude/agents/content-image-formatter.md +0 -560
  597. package/one/things/claude/agents/content-introduction-formatter.md +0 -510
  598. package/one/things/claude/agents/content-multiplication-engine.md +0 -579
  599. package/one/things/claude/agents/content-playbook-writer.md +0 -473
  600. package/one/things/claude/agents/content-team-manager.md +0 -647
  601. package/one/things/claude/agents/content-toc-formatter.md +0 -547
  602. package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
  603. package/one/things/claude/agents/core-manager.md +0 -607
  604. package/one/things/claude/agents/core-master.md +0 -426
  605. package/one/things/claude/agents/cross-functional-manager.md +0 -476
  606. package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
  607. package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
  608. package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
  609. package/one/things/claude/agents/crypto-community-analyst.md +0 -314
  610. package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
  611. package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
  612. package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
  613. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
  614. package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
  615. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
  616. package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
  617. package/one/things/claude/agents/crypto-market-researcher.md +0 -307
  618. package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
  619. package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
  620. package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
  621. package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
  622. package/one/things/claude/agents/crypto-team-manager.md +0 -392
  623. package/one/things/claude/agents/crypto-token-analyst.md +0 -319
  624. package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
  625. package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
  626. package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
  627. package/one/things/claude/agents/customer-journey-designer.md +0 -474
  628. package/one/things/claude/agents/customer-success-manager.md +0 -574
  629. package/one/things/claude/agents/dev.md +0 -406
  630. package/one/things/claude/agents/documenter.md +0 -548
  631. package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
  632. package/one/things/claude/agents/engagement-specialist.md +0 -502
  633. package/one/things/claude/agents/engineering-architect.md +0 -387
  634. package/one/things/claude/agents/engineering-business-analyst.md +0 -527
  635. package/one/things/claude/agents/engineering-developer.md +0 -386
  636. package/one/things/claude/agents/engineering-director.md +0 -322
  637. package/one/things/claude/agents/engineering-ingestor.md +0 -659
  638. package/one/things/claude/agents/engineering-product-manager.md +0 -525
  639. package/one/things/claude/agents/engineering-product-owner.md +0 -527
  640. package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
  641. package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
  642. package/one/things/claude/agents/engineering-team-manager.md +0 -515
  643. package/one/things/claude/agents/engineering-user-experience.md +0 -386
  644. package/one/things/claude/agents/framework-elevate-manager.md +0 -309
  645. package/one/things/claude/agents/improver.md +0 -805
  646. package/one/things/claude/agents/intelligence-team-manager.md +0 -390
  647. package/one/things/claude/agents/lead-capture-expert.md +0 -459
  648. package/one/things/claude/agents/lead-magnet-creator.md +0 -446
  649. package/one/things/claude/agents/market-research-analyst.md +0 -435
  650. package/one/things/claude/agents/marketing-brand-identity.md +0 -344
  651. package/one/things/claude/agents/marketing-content-hooks.md +0 -455
  652. package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
  653. package/one/things/claude/agents/marketing-content-poster.md +0 -372
  654. package/one/things/claude/agents/marketing-customer-journey.md +0 -331
  655. package/one/things/claude/agents/marketing-director.md +0 -402
  656. package/one/things/claude/agents/marketing-engagement.md +0 -331
  657. package/one/things/claude/agents/marketing-lead-capture.md +0 -331
  658. package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
  659. package/one/things/claude/agents/marketing-network-effects.md +0 -331
  660. package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
  661. package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
  662. package/one/things/claude/agents/marketing-team-manager.md +0 -451
  663. package/one/things/claude/agents/marketing-viral-growth.md +0 -232
  664. package/one/things/claude/agents/mission-commander.md +0 -378
  665. package/one/things/claude/agents/network-effect-analyst.md +0 -604
  666. package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
  667. package/one/things/claude/agents/npx.md +0 -946
  668. package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
  669. package/one/things/claude/agents/one-master.md +0 -378
  670. package/one/things/claude/agents/one-orchestrator.md +0 -345
  671. package/one/things/claude/agents/one.md +0 -658
  672. package/one/things/claude/agents/playbook-generator.md +0 -526
  673. package/one/things/claude/agents/pm.md +0 -349
  674. package/one/things/claude/agents/po.md +0 -370
  675. package/one/things/claude/agents/qa.md +0 -361
  676. package/one/things/claude/agents/research-foundation-analyst.md +0 -324
  677. package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
  678. package/one/things/claude/agents/research-market-analyst.md +0 -324
  679. package/one/things/claude/agents/research-team-manager.md +0 -489
  680. package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
  681. package/one/things/claude/agents/sales-team-manager.md +0 -407
  682. package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
  683. package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
  684. package/one/things/claude/agents/service-advocacy-manager.md +0 -324
  685. package/one/things/claude/agents/service-success-manager.md +0 -324
  686. package/one/things/claude/agents/service-team-manager.md +0 -405
  687. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
  688. package/one/things/claude/agents/share-optimization-specialist.md +0 -576
  689. package/one/things/claude/agents/sm.md +0 -352
  690. package/one/things/claude/agents/story-teller.md +0 -498
  691. package/one/things/claude/agents/task-master.md +0 -621
  692. package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
  693. package/one/things/claude/agents/tester.md +0 -595
  694. package/one/things/claude/agents/the-bull-character-manager.md +0 -603
  695. package/one/things/claude/agents/tools-playbook-generator.md +0 -492
  696. package/one/things/claude/agents/turbo-repo-builder.md +0 -346
  697. package/one/things/claude/agents/upsell-strategist.md +0 -503
  698. package/one/things/claude/agents/ux-expert.md +0 -360
  699. package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
  700. package/one/things/claude/claude-code-hooks-development.json +0 -21
  701. package/one/things/claude/claude-code-hooks-production.json +0 -21
  702. package/one/things/claude/claude-code-hooks.json +0 -25
  703. package/one/things/claude/commands/agent.md +0 -124
  704. package/one/things/claude/commands/cascade-status.md +0 -153
  705. package/one/things/claude/commands/ingest.md +0 -343
  706. package/one/things/claude/commands/ingestor.md +0 -158
  707. package/one/things/claude/commands/mission.md +0 -103
  708. package/one/things/claude/commands/npx.md +0 -156
  709. package/one/things/claude/commands/one.md +0 -486
  710. package/one/things/claude/commands/quality-check.md +0 -252
  711. package/one/things/claude/commands/smart-route.md +0 -261
  712. package/one/things/claude/commands/start.md +0 -139
  713. package/one/things/claude/commands/story.md +0 -103
  714. package/one/things/claude/commands/task.md +0 -193
  715. package/one/things/claude/hook-bypass.json +0 -32
  716. package/one/things/claude/hooks/agent-hook-config.json +0 -427
  717. package/one/things/claude/hooks/build-hook.sh +0 -156
  718. package/one/things/claude/hooks/cleanup-hook.sh +0 -201
  719. package/one/things/claude/hooks/file-organization-hook.sh +0 -80
  720. package/one/things/claude/hooks/format-hook.sh +0 -43
  721. package/one/things/claude/hooks/hook-bypass.sh +0 -293
  722. package/one/things/claude/hooks/hook-debouncer.sh +0 -62
  723. package/one/things/claude/hooks/hook-logger.sh +0 -89
  724. package/one/things/claude/hooks/lint-hook.sh +0 -140
  725. package/one/things/claude/hooks/notification-hook.sh +0 -204
  726. package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
  727. package/one/things/claude/hooks/performance-metrics.json +0 -25
  728. package/one/things/claude/hooks/security-hook.sh +0 -256
  729. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
  730. package/one/things/claude/hooks/story-validation-hook.sh +0 -145
  731. package/one/things/claude/hooks/test-hook.sh +0 -145
  732. package/one/things/claude/hooks/test-story-validation.sh +0 -170
  733. package/one/things/claude/settings-local.json +0 -86
  734. package/one/things/cli/cli-code.md +0 -677
  735. package/one/things/cli/cli-compiler-code.md +0 -677
  736. package/one/things/cli/cli.md +0 -871
  737. package/one/things/components/card-shadcn.md +0 -953
  738. package/one/things/components/card.md +0 -1041
  739. package/one/things/components.md +0 -1743
  740. package/one/things/componets.md +0 -19
  741. package/one/things/contracts/Move.toml +0 -12
  742. package/one/things/contracts/README.md +0 -288
  743. package/one/things/contracts/one.move +0 -762
  744. package/one/things/contracts/sdk.ts +0 -578
  745. package/one/things/creator-diagram.md +0 -184
  746. package/one/things/crypto/FEATURES.md +0 -78
  747. package/one/things/crypto/ONECORE.md +0 -62
  748. package/one/things/crypto/ONECOREFAQ.md +0 -22
  749. package/one/things/crypto/ONECOREHOW.md +0 -46
  750. package/one/things/crypto/ONEENTERPRISE.md +0 -64
  751. package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
  752. package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
  753. package/one/things/crypto/ONEPRO.md +0 -60
  754. package/one/things/crypto/ONEPROFAQ.md +0 -22
  755. package/one/things/crypto/ONEPROHOW.md +0 -53
  756. package/one/things/crypto/READMEAGENCY.md +0 -64
  757. package/one/things/crypto/VSL.md +0 -45
  758. package/one/things/crypto/WebsiteCopy.md +0 -176
  759. package/one/things/demo-accessibility-animations.md +0 -1025
  760. package/one/things/demo-components.md +0 -1310
  761. package/one/things/demo-design-summary.md +0 -692
  762. package/one/things/demo-design-system.md +0 -973
  763. package/one/things/demo-page-layouts.md +0 -1016
  764. package/one/things/design-system.md +0 -832
  765. package/one/things/designs/accessibility-audit.md +0 -877
  766. package/one/things/designs/component-specifications.md +0 -855
  767. package/one/things/designs/design-overview.md +0 -377
  768. package/one/things/designs/design-tokens.md +0 -448
  769. package/one/things/designs/wireframes-dashboard.md +0 -710
  770. package/one/things/docs/api-requests.md +0 -987
  771. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
  772. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
  773. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
  774. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
  775. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
  776. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
  777. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
  778. package/one/things/docs/ecommerce/QUICK-START.md +0 -405
  779. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
  780. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
  781. package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
  782. package/one/things/docs/ecommerce/demo.astro +0 -309
  783. package/one/things/examples/children/lemonade-stand.md +0 -404
  784. package/one/things/examples/enterprise/crm-saas.md +0 -1444
  785. package/one/things/features/1-1-agent-prompts.md +0 -562
  786. package/one/things/features/1-2-yaml-orchestrator.md +0 -548
  787. package/one/things/features/1-3-event-coordination.md +0 -547
  788. package/one/things/features/1-4-knowledge-management.md +0 -652
  789. package/one/things/features/1-5-quality-loops.md +0 -725
  790. package/one/things/features/1-6-numbering-structure.md +0 -639
  791. package/one/things/features/2-1-dataprovider-interface.md +0 -2583
  792. package/one/things/features/2-2-config-system.md +0 -3242
  793. package/one/things/features/2-3-effectts-services.md +0 -1645
  794. package/one/things/features/2-4-react-hooks.md +0 -2136
  795. package/one/things/features/2-5-auth-migration.md +0 -2144
  796. package/one/things/features/2-6-dashboard-migration.md +0 -2084
  797. package/one/things/features/2-7-alternative-providers.md +0 -2578
  798. package/one/things/features/2-7-implementation-report.md +0 -724
  799. package/one/things/features/2-cli.md +0 -1720
  800. package/one/things/features/2-design.md +0 -1770
  801. package/one/things/features/2-tests.md +0 -576
  802. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
  803. package/one/things/features/DECOUPLING.md +0 -290
  804. package/one/things/features/DEPLOYMENT.md +0 -470
  805. package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
  806. package/one/things/features/improve.md +0 -861
  807. package/one/things/features/remove-convex-deps.md +0 -63
  808. package/one/things/features/top-features.md +0 -87
  809. package/one/things/features/use-one-backend.md +0 -1217
  810. package/one/things/features-in-english.md +0 -200
  811. package/one/things/files.yaml +0 -721
  812. package/one/things/ideas/1-create-workflow.md +0 -207
  813. package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
  814. package/one/things/implementation/backend-guide.md +0 -457
  815. package/one/things/interface.md +0 -257
  816. package/one/things/landing-page-implementation.md +0 -455
  817. package/one/things/legal/README.md +0 -234
  818. package/one/things/legal/privacy-policy.md +0 -1227
  819. package/one/things/legal/terms-of-service.md +0 -1432
  820. package/one/things/master-workflow-plan.md +0 -806
  821. package/one/things/pay.one.ie.md +0 -53
  822. package/one/things/plans/0-in-sync.md +0 -136
  823. package/one/things/plans/0-timeline.md +0 -36
  824. package/one/things/plans/1-create-workflow.md +0 -732
  825. package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
  826. package/one/things/plans/README-SIMPLIFICATION.md +0 -349
  827. package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
  828. package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
  829. package/one/things/plans/ai-elements-integration.md +0 -483
  830. package/one/things/plans/ai-elements.md +0 -1278
  831. package/one/things/plans/ai-integration-plan.md +0 -263
  832. package/one/things/plans/ai-integration.md +0 -996
  833. package/one/things/plans/ai-sdk.md +0 -798
  834. package/one/things/plans/ai-tools.md +0 -621
  835. package/one/things/plans/app.md +0 -832
  836. package/one/things/plans/architecture-summary.md +0 -312
  837. package/one/things/plans/async-ai-agents.md +0 -233
  838. package/one/things/plans/backend-agnostic-frontend.md +0 -390
  839. package/one/things/plans/backend-cleanup-quickstart.md +0 -380
  840. package/one/things/plans/backend-ontology-conformance.md +0 -475
  841. package/one/things/plans/backend-status.md +0 -599
  842. package/one/things/plans/backend-structure.md +0 -847
  843. package/one/things/plans/backend-target-structure.md +0 -482
  844. package/one/things/plans/backend.md +0 -1175
  845. package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
  846. package/one/things/plans/better-auth-any-backend.md +0 -1896
  847. package/one/things/plans/better-auth-available-features.md +0 -273
  848. package/one/things/plans/big-plan.md +0 -52
  849. package/one/things/plans/cli-updates-required.md +0 -320
  850. package/one/things/plans/complete-step-by-step.md +0 -1409
  851. package/one/things/plans/components.md +0 -709
  852. package/one/things/plans/convex-agents.md +0 -1034
  853. package/one/things/plans/convex-better-auth.md +0 -1141
  854. package/one/things/plans/convex-on-off.md +0 -407
  855. package/one/things/plans/crypto-token-researcher.md +0 -629
  856. package/one/things/plans/data-quality-metrics.md +0 -745
  857. package/one/things/plans/deep-researcher-agent.md +0 -466
  858. package/one/things/plans/deploy-to-cloudflare.md +0 -623
  859. package/one/things/plans/deployment-architecture.md +0 -469
  860. package/one/things/plans/desktop.md +0 -1139
  861. package/one/things/plans/development-plan.md +0 -1283
  862. package/one/things/plans/development-workflow-tldr.md +0 -207
  863. package/one/things/plans/development-workflow.md +0 -959
  864. package/one/things/plans/dsl-claude-code.md +0 -1011
  865. package/one/things/plans/effect-components.md +0 -1743
  866. package/one/things/plans/effect-patterns-reference.md +0 -2235
  867. package/one/things/plans/effect.md +0 -1806
  868. package/one/things/plans/email.md +0 -966
  869. package/one/things/plans/enhance-auth.md +0 -1692
  870. package/one/things/plans/execution-strategy.md +0 -1291
  871. package/one/things/plans/existing-infrastructure.md +0 -712
  872. package/one/things/plans/feature-based-sites.md +0 -894
  873. package/one/things/plans/frontend-effects.md +0 -1276
  874. package/one/things/plans/group-folder-multi-tenancy.md +0 -893
  875. package/one/things/plans/improve-codebase.md +0 -1811
  876. package/one/things/plans/install-components.md +0 -215
  877. package/one/things/plans/integrate-frontend-and-backend.md +0 -603
  878. package/one/things/plans/landing.md +0 -820
  879. package/one/things/plans/layout.md +0 -249
  880. package/one/things/plans/mail-backend.md +0 -1361
  881. package/one/things/plans/mail.md +0 -2677
  882. package/one/things/plans/mcp-clear-context-prompt.md +0 -81
  883. package/one/things/plans/mcp-simple.md +0 -248
  884. package/one/things/plans/multi-ontology-architecture.md +0 -885
  885. package/one/things/plans/next-features.md +0 -114
  886. package/one/things/plans/npx-agent-safety.md +0 -785
  887. package/one/things/plans/npx-agent.md +0 -1089
  888. package/one/things/plans/onboarding.md +0 -51
  889. package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
  890. package/one/things/plans/one.md +0 -677
  891. package/one/things/plans/ontology-6-dimensions.md +0 -2201
  892. package/one/things/plans/ontology-compliance-audit.md +0 -342
  893. package/one/things/plans/ontology-driven-strategy.md +0 -882
  894. package/one/things/plans/ontology-refine.md +0 -586
  895. package/one/things/plans/ontology-ui-approach.md +0 -375
  896. package/one/things/plans/open-agent.md +0 -840
  897. package/one/things/plans/performace.md +0 -122
  898. package/one/things/plans/phase-1-foundation.md +0 -620
  899. package/one/things/plans/phase-3-implementation.md +0 -1037
  900. package/one/things/plans/plan-connect-to-api.md +0 -146
  901. package/one/things/plans/quick-wins.md +0 -1428
  902. package/one/things/plans/r2.md +0 -777
  903. package/one/things/plans/readme-backend-cleanup.md +0 -402
  904. package/one/things/plans/release.md +0 -507
  905. package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
  906. package/one/things/plans/repos.md +0 -98
  907. package/one/things/plans/separate-copy-2.md +0 -1349
  908. package/one/things/plans/separate-copy-3.md +0 -2479
  909. package/one/things/plans/separate-copy.md +0 -1349
  910. package/one/things/plans/separate-demo.md +0 -864
  911. package/one/things/plans/separate.md +0 -1999
  912. package/one/things/plans/sequence.md +0 -2040
  913. package/one/things/plans/shadcn-integration-summary.md +0 -510
  914. package/one/things/plans/sidebar.md +0 -206
  915. package/one/things/plans/skills.md +0 -709
  916. package/one/things/plans/small-fixes.md +0 -23
  917. package/one/things/plans/start-new.md +0 -764
  918. package/one/things/plans/switch-off-auth.md +0 -42
  919. package/one/things/plans/sync-checklist.md +0 -351
  920. package/one/things/plans/test-backend-connection.md +0 -514
  921. package/one/things/plans/unified-implementation-plan.md +0 -934
  922. package/one/things/plans/update-demos.md +0 -581
  923. package/one/things/plans/use-our-backend.md +0 -572
  924. package/one/things/plans/video-backend.md +0 -638
  925. package/one/things/plans/video-frontend.md +0 -490
  926. package/one/things/plans/video-old-archived.md +0 -656
  927. package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
  928. package/one/things/plans/wave1-onboarding-vision.md +0 -744
  929. package/one/things/plans/wave1-orchestration-summary.md +0 -604
  930. package/one/things/plans/wave1-specialist-assignments.md +0 -1413
  931. package/one/things/plans/workflow-files.md +0 -1210
  932. package/one/things/plans/workflow.md +0 -1378
  933. package/one/things/plans-u.md +0 -905
  934. package/one/things/products/Blockchain Products.md +0 -6278
  935. package/one/things/products/cascade-landing-page.md +0 -841
  936. package/one/things/products/cascade.md +0 -1568
  937. package/one/things/products/context-engineering.md +0 -1488
  938. package/one/things/products/onthology.md +0 -15
  939. package/one/things/products/ontology-ui-shadcn.md +0 -1302
  940. package/one/things/products/ontology-ui.md +0 -1429
  941. package/one/things/products/ontology.md +0 -789
  942. package/one/things/products/sdk.md +0 -573
  943. package/one/things/promptkit.md +0 -930
  944. package/one/things/repos/all-repos.md +0 -0
  945. package/one/things/scripts-clean-mac.sh +0 -409
  946. package/one/things/service-providers-new.md +0 -1052
  947. package/one/things/service-providers.md +0 -1121
  948. package/one/things/structure.md +0 -532
  949. package/one/things/system.md +0 -618
  950. package/one/things/templates.md +0 -294
  951. package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
  952. package/one/things/tests/2-1-test-analysis.md +0 -544
  953. package/one/things/things.md +0 -384
  954. package/one/things/todo-acp-integration.md +0 -744
  955. package/one/things/todo-ai.md +0 -933
  956. package/one/things/todo-api.md +0 -1078
  957. package/one/things/todo-assignment.md +0 -580
  958. package/one/things/todo-buy-chatgpt.md +0 -1450
  959. package/one/things/todo-components.md +0 -1683
  960. package/one/things/todo-connections.md +0 -278
  961. package/one/things/todo-ecommerce-frontend.md +0 -1313
  962. package/one/things/todo-ecommerce.md +0 -569
  963. package/one/things/todo-effects.md +0 -1075
  964. package/one/things/todo-frontend-effects.md +0 -977
  965. package/one/things/todo-landing-page.md +0 -1091
  966. package/one/things/todo-mail.md +0 -1160
  967. package/one/things/todo-master-plan.md +0 -490
  968. package/one/things/todo-onboard.md +0 -666
  969. package/one/things/todo-one-ie.md +0 -538
  970. package/one/things/todo-page.md +0 -606
  971. package/one/things/todo-plans.md +0 -282
  972. package/one/things/todo-projects.md +0 -241
  973. package/one/things/todo-refactoring-plan.md +0 -366
  974. package/one/things/todo-release.md +0 -654
  975. package/one/things/todo-sequence.md +0 -1621
  976. package/one/things/todo-use-our-backend.md +0 -1908
  977. package/one/things/todo-workflow.md +0 -626
  978. package/one/things/todo-x402.md +0 -2047
  979. package/one/things/todo.md +0 -21
  980. package/one/things/video/scripts-crypto.md +0 -835
  981. package/one/things/video-script-backup.md +0 -318
  982. package/one/things/video-script-demo.md +0 -382
  983. package/one/things/video-script-ontology.md +0 -333
  984. package/one/things/video-script.md +0 -361
@@ -1,2840 +0,0 @@
1
- ---
2
- title: Ontology.Old
3
- dimension: knowledge
4
- category: archived
5
- tags: 6-dimensions, ai, architecture, connections, events, cycle, knowledge, ontology, people, protocol
6
- related_dimensions: connections, events, groups, 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 archived category.
13
- Location: one/knowledge/archived/ontology.old.md
14
- Purpose: Documents one platform - ontology specification
15
- Related dimensions: connections, events, groups, people, things
16
- For AI agents: Read this to understand ontology.old.
17
- ---
18
-
19
- # ONE Platform - Ontology Specification
20
-
21
- **Version:** 2.0.0 (6-Dimension Architecture)
22
- **Status:** Complete - Reality-Aware Architecture
23
- **Design Principle:** This ontology models reality in six dimensions. All protocols map TO this ontology via metadata.
24
- ## Structure
25
-
26
- This ontology is organized into 6 dimension files:
27
-
28
- 1. **[organisation.md](./organisation.md)** - Multi-tenant isolation & ownership
29
- 2. **[people.md](./people.md)** - Authorization, governance, & user customization
30
- 3. **[things.md](./things.md)** - 66 entity types (what exists)
31
- 4. **[connections.md](./connections.md)** - 25 relationship types (how they relate)
32
- 5. **[events.md](./events.md)** - 67 event types (what happened)
33
- 6. **[knowledge.md](./knowledge.md)** - Vectors, embeddings, RAG (what it means)
34
-
35
- **Execution Guide:**
36
-
37
- 7. **[todo.md](./todo.md)** - 100-cycle execution sequence (plan in cycles, not days)
38
-
39
- **This document (Ontology.md)** contains the complete technical specification. The consolidated files above provide focused summaries and patterns.
40
-
41
- **Planning Paradigm:** We don't plan in days. We plan in **cycle passes** (Cycle 1-100). See [todo.md](./todo.md) for the complete 100-cycle template that guides feature implementation from idea to production.
42
-
43
- ## The 6-Dimension Reality Model
44
-
45
- Every single thing in ONE platform exists within one of these 6 dimensions:
46
-
47
- ```
48
- ┌──────────────────────────────────────────────────────────────┐
49
- │ 1. GROUPS │
50
- │ Multi-tenant isolation with hierarchical nesting - who owns │
51
- │ what at group level (friend circles → DAOs → governments) │
52
- └──────────────────────────────────────────────────────────────┘
53
- ↓
54
- ┌──────────────────────────────────────────────────────────────┐
55
- │ 2. PEOPLE │
56
- │ Authorization & governance - platform owner, group owners │
57
- └──────────────────────────────────────────────────────────────┘
58
- ↓
59
- ┌──────────────────────────────────────────────────────────────┐
60
- │ 3. THINGS │
61
- │ Every "thing" - users, agents, content, tokens, courses │
62
- └──────────────────────────────────────────────────────────────┘
63
- ↓
64
- ┌──────────────────────────────────────────────────────────────┐
65
- │ 4. CONNECTIONS │
66
- │ Every relationship - owns, follows, taught_by, powers │
67
- └──────────────────────────────────────────────────────────────┘
68
- ↓
69
- ┌──────────────────────────────────────────────────────────────┐
70
- │ 5. EVENTS │
71
- │ Every action - purchased, created, viewed, completed │
72
- └──────────────────────────────────────────────────────────────┘
73
- ↓
74
- ┌──────────────────────────────────────────────────────────────┐
75
- │ 6. KNOWLEDGE │
76
- │ Labels + chunks + vectors powering RAG & search │
77
- └──────────────────────────────────────────────────────────────┘
78
- ```
79
-
80
- **Golden Rule:** If you can't map your feature to these 6 dimensions, you're thinking about it wrong.
81
-
82
- **Simplicity:** ONE is six dimensions — groups partition, people authorize, things exist, connections relate, events record, and knowledge understands. Everything composes from these building blocks.
83
-
84
- ---
85
-
86
- ## GROUPS: The Isolation Boundary with Hierarchical Nesting
87
-
88
- Purpose: Partition the system with perfect isolation and support nested groups (groups within groups) - from friend circles to DAOs to governments. Every group owns its own graph of things, connections, events, and knowledge.
89
-
90
- ### Group Structure
91
-
92
- ```typescript
93
- {
94
- _id: Id<'groups'>,
95
- slug: string, // REQUIRED: URL identifier (/group/slug)
96
- name: string, // REQUIRED: Display name
97
- type: 'friend_circle' | 'business' | 'community' | 'dao' | 'government' | 'organization',
98
- parentGroupId?: Id<'groups'>, // OPTIONAL: Parent group for hierarchical nesting
99
- description?: string, // OPTIONAL: About text
100
-
101
- metadata: Record<string, any>,
102
-
103
- settings: {
104
- visibility: 'public' | 'private',
105
- joinPolicy: 'open' | 'invite_only' | 'approval_required',
106
- plan: 'starter' | 'pro' | 'enterprise',
107
- limits: {
108
- users: number,
109
- storage: number, // GB
110
- apiCalls: number,
111
- }
112
- },
113
-
114
- status: 'active' | 'archived',
115
- createdAt: number,
116
- updatedAt: number,
117
- }
118
- ```
119
-
120
- ### Common Fields by Use Case
121
-
122
- **Identity:** `[slug, name]` - Who they are + URL
123
- **Web:** `[slug, name, description]` - Website generation
124
- **Operations:** `[status, type, settings, parentGroupId]` - System management
125
-
126
- ### Why Groups Matter
127
-
128
- 1. **Multi-Tenant Isolation:** Each group's data is completely separate
129
- 2. **Hierarchical Nesting:** Groups can contain sub-groups for complex organizations (parent → child → grandchild...)
130
- 3. **Flexible Types:** From friend circles (2 people) to businesses to DAOs to governments (billions)
131
- 4. **Resource Quotas:** Control costs and usage per group
132
- 5. **Privacy Control:** Groups can be public or private with controlled access
133
- 6. **Flexible Scale:** Scales from friend circles to global governments without schema changes
134
-
135
- ---
136
-
137
- ## PEOPLE: Authorization & Governance
138
-
139
- Purpose: Define who can do what. People direct organizations, customize AI agents, and govern access.
140
-
141
- ### Person Structure
142
-
143
- ```typescript
144
- {
145
- _id: Id<'people'>,
146
- email: string,
147
- username: string,
148
- displayName: string,
149
-
150
- // CRITICAL: Role determines access level
151
- role: 'platform_owner' | 'org_owner' | 'org_user' | 'customer',
152
-
153
- // Organization context
154
- organizationId?: Id<'organizations'>, // Current/default org
155
- permissions?: string[],
156
-
157
- // Profile
158
- bio?: string,
159
- avatar?: string,
160
-
161
- // Multi-tenant tracking
162
- organizations: Id<'organizations'>[], // All orgs this person belongs to
163
-
164
- createdAt: number,
165
- updatedAt: number,
166
- }
167
- ```
168
-
169
- ### Four Roles
170
-
171
- 1. **Platform Owner** (Anthony)
172
- - Owns the ONE Platform
173
- - 100% revenue from platform-level services
174
- - Can access all organizations (support/debugging)
175
- - Creates new organizations
176
-
177
- 2. **Org Owner**
178
- - Owns/manages one or more organizations
179
- - Controls users, permissions, billing within org
180
- - Customizes AI agents and frontend
181
- - Revenue sharing with platform
182
-
183
- 3. **Org User**
184
- - Works within an organization
185
- - Limited permissions (defined by org owner)
186
- - Can create content, run agents (within quotas)
187
-
188
- 4. **Customer**
189
- - External user consuming content
190
- - Purchases tokens, enrolls in courses
191
- - No admin access
192
-
193
- ### Why People Matter
194
-
195
- 1. **Authorization:** Every action must have an actor (person)
196
- 2. **Governance:** Org owners control who can do what
197
- 3. **Audit Trail:** Events log who did what when
198
- 4. **Customization:** People teach AI agents their preferences
199
-
200
- ---
201
-
202
- ## KNOWLEDGE: Labels, Chunks, and Vectors (RAG)
203
-
204
- Purpose: unify taxonomy (“tags”) and retrieval‑augmented generation (RAG) under one table. A knowledge item can be a label (former tag), a document wrapper, or a chunk with an embedding.
205
-
206
- Design principles:
207
- - Protocol‑agnostic: store protocol details in `metadata`.
208
- - Many‑to‑many: link knowledge ⇄ things via `thingKnowledge` with optional context metadata.
209
- - Scalable: consolidated types minimize index fan‑out; embeddings enable semantic search.
210
-
211
- ### Knowledge Types
212
-
213
- ```typescript
214
- type KnowledgeType =
215
- | 'label' // replaces legacy "tag"; lightweight categorical marker
216
- | 'document' // wrapper for a source text/blob (pre-chunking)
217
- | 'chunk' // atomic chunk of text with embedding
218
- | 'vector_only'; // embedding without stored text (e.g., privacy)
219
- ```
220
-
221
- ### Knowledge Structure
222
-
223
- ```typescript
224
- {
225
- _id: Id<'knowledge'>,
226
- knowledgeType: KnowledgeType,
227
- // Textual content (optional for label/vector_only)
228
- text?: string,
229
- // Embedding for semantic search (optional for label/document)
230
- embedding?: number[], // Float32 vector; model-dependent dimension
231
- embeddingModel?: string, // e.g., "text-embedding-3-large"
232
- embeddingDim?: number,
233
- // Source linkage
234
- sourceThingId?: Id<'things'>, // Primary source entity
235
- sourceField?: string, // e.g., 'content', 'transcript', 'title'
236
- chunk?: { index: number; start?: number; end?: number; tokenCount?: number; overlap?: number },
237
- // Lightweight categorization (free-form)
238
- labels?: string[], // Replaces per-thing tags; applied to knowledge
239
- // Additional metadata (protocol, language, mime, hash, version)
240
- metadata?: Record<string, any>,
241
- createdAt: number,
242
- updatedAt: number,
243
- deletedAt?: number,
244
- }
245
- ```
246
-
247
- ### Junction: thingKnowledge
248
-
249
- ```typescript
250
- {
251
- _id: Id<'thingKnowledge'>,
252
- thingId: Id<'things'>,
253
- knowledgeId: Id<'knowledge'>,
254
- role?: 'label' | 'summary' | 'chunk_of' | 'caption' | 'keyword',
255
- // Context for the link (e.g., confidence, section name)
256
- metadata?: Record<string, any>,
257
- createdAt: number,
258
- }
259
- ```
260
-
261
- ### Indexes (recommended)
262
-
263
- - `knowledge.by_type` (knowledgeType)
264
- - `knowledge.by_source` (sourceThingId)
265
- - `knowledge.by_created` (createdAt)
266
- - `thingKnowledge.by_thing` (thingId)
267
- - `thingKnowledge.by_knowledge` (knowledgeId)
268
- - Vector index (provider-dependent): `knowledge.by_embedding` for ANN search
269
-
270
- Notes:
271
- - The legacy ThingType `embedding` is deprecated for operational vectors; use the `knowledge` table with `knowledgeType: 'chunk' | 'vector_only'`.
272
- - Labels (formerly tags) now live in `knowledge.labels` and via `thingKnowledge` relations. Use labels to curate taxonomy without enum churn.
273
-
274
- ---
275
-
276
- ## THINGS: All The "Things"
277
-
278
- ### What Goes in Things?
279
-
280
- **Simple test:** If you can point at it and say "this is a \_\_\_", it's a thing.
281
-
282
- Examples:
283
-
284
- - "This is a **creator**" ✅ Thing
285
- - "This is a **blog post**" ✅ Thing
286
- - "This is a **token**" ✅ Thing
287
- - "This is a **relationship**" ❌ Connection, not thing
288
- - "This is a **purchase**" ❌ Event, not thing
289
-
290
- ### Thing Types
291
-
292
- ```typescript
293
- type ThingType =
294
- // CORE
295
- | 'creator' // Human creator (role: platform_owner, org_owner, org_user, customer)
296
- | 'ai_clone' // Digital twin of creator
297
- | 'audience_member' // Fan/user (role: customer)
298
- | 'organization' // Multi-tenant organization
299
-
300
- // BUSINESS AGENTS (10 types)
301
- | 'strategy_agent' // Vision, planning, OKRs
302
- | 'research_agent' // Market, trends, competitors
303
- | 'marketing_agent' // Content strategy, SEO, distribution
304
- | 'sales_agent' // Funnels, conversion, follow-up
305
- | 'service_agent' // Support, onboarding, success
306
- | 'design_agent' // Brand, UI/UX, assets
307
- | 'engineering_agent' // Tech, integration, automation
308
- | 'finance_agent' // Revenue, costs, forecasting
309
- | 'legal_agent' // Compliance, contracts, IP
310
- | 'intelligence_agent' // Analytics, insights, predictions
311
-
312
- // CONTENT
313
- | 'blog_post' // Written content
314
- | 'video' // Video content
315
- | 'podcast' // Audio content
316
- | 'social_post' // Social media post
317
- | 'email' // Email content
318
- | 'course' // Educational course
319
- | 'lesson' // Individual lesson
320
-
321
- // PRODUCTS
322
- | 'digital_product' // Templates, tools, assets
323
- | 'membership' // Tiered membership
324
- | 'consultation' // 1-on-1 session
325
- | 'nft' // NFT collectible
326
-
327
- // COMMUNITY
328
- | 'community' // Community space
329
- | 'conversation' // Thread/discussion
330
- | 'message' // Individual message
331
-
332
- // TOKEN
333
- | 'token' // Actual token instance
334
- | 'token_contract' // Smart contract
335
-
336
- // KNOWLEDGE
337
- | 'knowledge_item' // Piece of creator knowledge
338
- | 'embedding' // Vector embedding
339
-
340
- // PLATFORM
341
- | 'website' // Auto-generated creator site
342
- | 'landing_page' // Custom landing pages
343
- | 'template' // Design templates
344
- | 'livestream' // Live broadcast
345
- | 'recording' // Saved livestream content
346
- | 'media_asset' // Images, videos, files
347
-
348
- // BUSINESS
349
- | 'payment' // Payment transaction
350
- | 'subscription' // Recurring subscription
351
- | 'invoice' // Invoice record
352
- | 'metric' // Tracked metric
353
- | 'insight' // AI-generated insight
354
- | 'prediction' // AI prediction
355
- | 'report' // Analytics report
356
-
357
- // AUTHENTICATION & SESSION
358
- | 'session' // User session (Better Auth)
359
- | 'oauth_account' // OAuth connection (GitHub, Google)
360
- | 'verification_token' // Email/2FA verification token
361
- | 'password_reset_token' // Password reset token
362
-
363
- // UI & PREFERENCES
364
- | 'ui_preferences' // User UI settings (theme, layout, etc.)
365
-
366
- // MARKETING
367
- | 'notification' // System notification
368
- | 'email_campaign' // Email marketing campaign
369
- | 'announcement' // Platform announcement
370
- | 'referral' // Referral record
371
- | 'campaign' // Marketing campaign
372
- | 'lead' // Potential customer/lead
373
-
374
- // EXTERNAL INTEGRATIONS
375
- | 'external_agent' // External AI agent (ElizaOS, etc.)
376
- | 'external_workflow' // External workflow (n8n, Zapier, Make)
377
- | 'external_connection' // Connection config to external service
378
-
379
- // PROTOCOL ENTITIES (protocol-agnostic via properties.protocol)
380
- | 'mandate' // Intent or cart mandate (AP2)
381
- | 'product'; // Sellable product (ACP/marketplace)
382
- ```
383
-
384
- ### Thing Structure
385
-
386
- ```typescript
387
- {
388
- _id: Id<"things">,
389
- type: ThingType,
390
- name: string, // Display name
391
- properties: { // Type-specific properties (JSON)
392
- // For creator:
393
- email?: string,
394
- username?: string,
395
- niche?: string[],
396
- // For token:
397
- contractAddress?: string,
398
- totalSupply?: number,
399
- // etc...
400
- },
401
- status: "active" | "inactive" | "draft" | "published" | "archived",
402
- createdAt: number,
403
- updatedAt: number,
404
- deletedAt?: number
405
- }
406
- ```
407
-
408
- ### Properties by Thing Type
409
-
410
- **Creator Properties:**
411
-
412
- ```typescript
413
- {
414
- email: string,
415
- username: string,
416
- displayName: string,
417
- bio?: string,
418
- avatar?: string,
419
- niche: string[],
420
- expertise: string[],
421
- targetAudience: string,
422
- brandColors?: {
423
- primary: string,
424
- secondary: string,
425
- accent: string
426
- },
427
- totalFollowers: number,
428
- totalContent: number,
429
- totalRevenue: number,
430
- // MULTI-TENANT ROLES
431
- role: "platform_owner" | "group_owner" | "group_user" | "customer",
432
- groupId?: Id<"groups">, // Current/default group (if group_owner or group_user)
433
- permissions?: string[], // Additional permissions
434
- }
435
- ```
436
-
437
- **Organization Properties:**
438
-
439
- ```typescript
440
- {
441
- name: string,
442
- slug: string, // URL-friendly identifier
443
- domain?: string, // Custom domain (e.g., acme.one.ie)
444
- logo?: string,
445
- description?: string,
446
- status: "active" | "suspended" | "trial" | "cancelled",
447
- plan: "starter" | "pro" | "enterprise",
448
- limits: {
449
- users: number, // Max users allowed
450
- storage: number, // GB
451
- apiCalls: number, // Per month
452
- },
453
- usage: {
454
- users: number, // Current users
455
- storage: number, // GB used
456
- apiCalls: number, // This month
457
- },
458
- billing: {
459
- customerId?: string, // Stripe customer ID
460
- subscriptionId?: string, // Stripe subscription ID
461
- currentPeriodEnd?: number,
462
- },
463
- settings: {
464
- allowSignups: boolean,
465
- requireEmailVerification: boolean,
466
- enableTwoFactor: boolean,
467
- allowedDomains?: string[], // Email domain whitelist
468
- },
469
- createdAt: number,
470
- trialEndsAt?: number,
471
- }
472
- ```
473
-
474
- **AI Clone Properties:**
475
-
476
- ```typescript
477
- {
478
- voiceId?: string,
479
- voiceProvider?: "elevenlabs" | "azure" | "custom",
480
- appearanceId?: string,
481
- appearanceProvider?: "d-id" | "heygen" | "custom",
482
- systemPrompt: string,
483
- temperature: number,
484
- knowledgeBaseSize: number,
485
- lastTrainingDate: number,
486
- totalInteractions: number,
487
- satisfactionScore: number
488
- }
489
- ```
490
-
491
- **Agent Properties:**
492
-
493
- ```typescript
494
- {
495
- agentType: "strategy" | "marketing" | "sales" | ...,
496
- systemPrompt: string,
497
- model: string,
498
- temperature: number,
499
- capabilities: string[],
500
- tools: string[],
501
- totalExecutions: number,
502
- successRate: number,
503
- averageExecutionTime: number
504
- }
505
- ```
506
-
507
- **Token Properties:**
508
-
509
- ```typescript
510
- {
511
- contractAddress: string,
512
- blockchain: "base" | "ethereum" | "polygon",
513
- standard: "ERC20" | "ERC721" | "ERC1155",
514
- totalSupply: number,
515
- circulatingSupply: number,
516
- price: number,
517
- marketCap: number,
518
- utility: string[],
519
- burnRate: number,
520
- holders: number,
521
- transactions24h: number,
522
- volume24h: number
523
- }
524
- ```
525
-
526
- **Course Properties:**
527
-
528
- ```typescript
529
- {
530
- title: string,
531
- description: string,
532
- thumbnail?: string,
533
- modules: number,
534
- lessons: number,
535
- totalDuration: number,
536
- price: number,
537
- currency: string,
538
- tokenPrice?: number,
539
- enrollments: number,
540
- completions: number,
541
- averageRating: number,
542
- generatedBy: "ai" | "human" | "hybrid",
543
- personalizationLevel: "none" | "basic" | "advanced"
544
- }
545
- ```
546
-
547
- **Website Properties:**
548
-
549
- ```typescript
550
- {
551
- domain: string,
552
- subdomain: string, // creator.one.ie
553
- template: "minimal" | "showcase" | "portfolio",
554
- customCSS?: string,
555
- customDomain?: string,
556
- sslEnabled: boolean,
557
- analytics: {
558
- visitors30d: number,
559
- pageViews: number,
560
- conversionRate: number
561
- }
562
- }
563
- ```
564
-
565
- **Livestream Properties:**
566
-
567
- ```typescript
568
- {
569
- title: string,
570
- scheduledAt: number,
571
- startedAt?: number,
572
- endedAt?: number,
573
- platform: "youtube" | "twitch" | "custom",
574
- streamUrl: string,
575
- recordingUrl?: string,
576
- viewersPeak: number,
577
- viewersAverage: number,
578
- chatEnabled: boolean,
579
- aiCloneMixEnabled: boolean, // For human + AI mixing
580
- status: "scheduled" | "live" | "ended" | "cancelled"
581
- }
582
- ```
583
-
584
- **Payment Properties:**
585
-
586
- ```typescript
587
- {
588
- amount: number,
589
- currency: "usd" | "eur",
590
- paymentMethod: "stripe" | "crypto",
591
- stripePaymentIntentId?: string,
592
- txHash?: string, // Blockchain transaction
593
- status: "pending" | "completed" | "failed" | "refunded",
594
- fees: number,
595
- netAmount: number,
596
- processedAt?: number
597
- }
598
- ```
599
-
600
- **Subscription Properties:**
601
-
602
- ```typescript
603
- {
604
- tier: "starter" | "pro" | "enterprise",
605
- price: number,
606
- currency: string,
607
- interval: "monthly" | "yearly",
608
- status: "active" | "cancelled" | "past_due" | "expired",
609
- currentPeriodStart: number,
610
- currentPeriodEnd: number,
611
- cancelAt?: number,
612
- stripeSubscriptionId?: string
613
- }
614
- ```
615
-
616
- **Metric Properties:**
617
-
618
- ```typescript
619
- {
620
- name: string,
621
- value: number,
622
- unit: string,
623
- timestamp: number,
624
- period: "realtime" | "hourly" | "daily" | "weekly" | "monthly",
625
- change: number, // Percentage change from previous
626
- trend: "up" | "down" | "stable"
627
- }
628
- ```
629
-
630
- **Insight Properties:**
631
-
632
- ```typescript
633
- {
634
- title: string,
635
- description: string,
636
- category: "performance" | "audience" | "revenue" | "content",
637
- confidence: number, // 0.0 to 1.0
638
- actionable: boolean,
639
- recommendations: string[],
640
- generatedAt: number,
641
- generatedBy: Id<"things"> // intelligence_agent
642
- }
643
- ```
644
-
645
- **Referral Properties:**
646
-
647
- ```typescript
648
- {
649
- referrerCode: string,
650
- referredEmail: string,
651
- referredUserId?: Id<"things">,
652
- status: "pending" | "converted" | "expired",
653
- tokensEarned: number,
654
- bonusEarned?: number,
655
- conversionDate?: number,
656
- expiresAt: number
657
- }
658
- ```
659
-
660
- **Notification Properties:**
661
-
662
- ```typescript
663
- {
664
- title: string,
665
- message: string,
666
- type: "info" | "success" | "warning" | "error",
667
- channel: "email" | "sms" | "push" | "in_app",
668
- read: boolean,
669
- readAt?: number,
670
- actionUrl?: string,
671
- actionLabel?: string
672
- }
673
- ```
674
-
675
- **External Agent Properties:**
676
-
677
- ```typescript
678
- {
679
- platform: "elizaos" | "autogen" | "crewai" | "langchain" | "custom",
680
- agentId: string, // External platform's agent ID
681
- name: string, // Agent name
682
- description?: string, // What the agent does
683
- capabilities: string[], // Available actions/tools
684
- apiEndpoint?: string, // REST/GraphQL endpoint
685
- websocketUrl?: string, // WebSocket endpoint for real-time
686
- status: "online" | "offline" | "busy" | "unknown",
687
- lastSeen?: number,
688
- metadata: { // Platform-specific data
689
- personality?: any, // For ElizaOS character
690
- tools?: string[], // Available tools
691
- model?: string, // LLM model used
692
- [key: string]: any // Other platform-specific fields
693
- },
694
- conversationCount: number, // Total conversations
695
- messageCount: number, // Total messages exchanged
696
- createdAt: number,
697
- updatedAt: number
698
- }
699
- ```
700
-
701
- **External Workflow Properties:**
702
-
703
- ```typescript
704
- {
705
- platform: "n8n" | "zapier" | "make" | "pipedream" | "custom",
706
- workflowId: string, // External platform's workflow ID
707
- name: string, // Workflow name
708
- description: string, // What the workflow does
709
- webhookUrl?: string, // Trigger URL
710
- active: boolean, // Is workflow active?
711
- tags: string[], // Workflow tags/categories
712
- inputSchema: { // Expected input parameters
713
- [key: string]: {
714
- type: "string" | "number" | "boolean" | "object" | "array",
715
- required: boolean,
716
- description: string,
717
- default?: any
718
- }
719
- },
720
- outputSchema: { // Expected output structure
721
- [key: string]: {
722
- type: "string" | "number" | "boolean" | "object" | "array",
723
- description: string
724
- }
725
- },
726
- executionCount: number, // Total executions
727
- successRate: number, // 0.0 to 1.0
728
- averageExecutionTime: number, // milliseconds
729
- lastExecutedAt?: number,
730
- createdAt: number,
731
- updatedAt: number
732
- }
733
- ```
734
-
735
- **External Connection Properties:**
736
-
737
- ```typescript
738
- {
739
- platform: "elizaos" | "n8n" | "zapier" | "make" | "autogen" | "custom",
740
- name: string, // Connection name
741
- baseUrl?: string, // API base URL
742
- apiKey?: string, // Encrypted API key
743
- websocketUrl?: string, // WebSocket endpoint
744
- webhookSecret?: string, // Webhook signature secret
745
- connectionType: "rest" | "websocket" | "webhook" | "graphql",
746
- authentication: {
747
- type: "apiKey" | "oauth" | "basic" | "bearer" | "custom",
748
- credentials: any // Encrypted credentials
749
- },
750
- status: "active" | "inactive" | "error",
751
- lastConnectedAt?: number,
752
- lastError?: string,
753
- linkedEntityIds: string[], // Connected agents/workflows
754
- rateLimits?: {
755
- requestsPerMinute: number,
756
- requestsPerDay: number
757
- },
758
- createdAt: number,
759
- updatedAt: number
760
- }
761
- ```
762
-
763
- **Session Properties:**
764
-
765
- ```typescript
766
- {
767
- userId: Id<"things">, // User this session belongs to
768
- token: string, // Session token (hashed)
769
- expiresAt: number, // Expiration timestamp
770
- ipAddress?: string, // IP address
771
- userAgent?: string, // Browser/device info
772
- lastActivityAt: number, // Last activity timestamp
773
- createdAt: number,
774
- }
775
- ```
776
-
777
- **OAuth Account Properties:**
778
-
779
- ```typescript
780
- {
781
- userId: Id<"things">, // User this account belongs to
782
- provider: "github" | "google" | "discord" | "twitter",
783
- providerAccountId: string, // Provider's user ID
784
- accessToken?: string, // Encrypted access token
785
- refreshToken?: string, // Encrypted refresh token
786
- expiresAt?: number, // Token expiration
787
- tokenType?: string, // Bearer, etc.
788
- scope?: string, // Granted scopes
789
- idToken?: string, // OpenID Connect ID token
790
- createdAt: number,
791
- updatedAt: number,
792
- }
793
- ```
794
-
795
- **Verification Token Properties:**
796
-
797
- ```typescript
798
- {
799
- userId: Id<"things">, // User to verify
800
- token: string, // Verification token (hashed)
801
- type: "email" | "two_factor", // Verification type
802
- expiresAt: number, // Expiration timestamp
803
- attempts: number, // Failed attempts count
804
- maxAttempts: number, // Max allowed attempts
805
- verifiedAt?: number, // When verified (if completed)
806
- createdAt: number,
807
- }
808
- ```
809
-
810
- **Password Reset Token Properties:**
811
-
812
- ```typescript
813
- {
814
- userId: Id<"things">, // User requesting reset
815
- token: string, // Reset token (hashed)
816
- expiresAt: number, // Expiration timestamp (15-30 min)
817
- usedAt?: number, // When token was used
818
- createdAt: number,
819
- }
820
- ```
821
-
822
- **UI Preferences Properties:**
823
-
824
- ```typescript
825
- {
826
- userId: Id<"things">, // User these preferences belong to
827
- theme: "light" | "dark" | "system",
828
- language: string, // ISO language code
829
- timezone: string, // IANA timezone
830
- dashboardLayout: {
831
- sidebarCollapsed: boolean,
832
- defaultView: "grid" | "list" | "kanban",
833
- itemsPerPage: number,
834
- },
835
- notifications: {
836
- email: boolean,
837
- push: boolean,
838
- sms: boolean,
839
- inApp: boolean,
840
- },
841
- accessibility: {
842
- reducedMotion: boolean,
843
- highContrast: boolean,
844
- fontSize: "small" | "medium" | "large",
845
- },
846
- customSettings: any, // App-specific settings
847
- updatedAt: number,
848
- }
849
- ```
850
-
851
- ---
852
-
853
- ## CONNECTIONS: All The Relationships
854
-
855
- ### What Goes in Connections?
856
-
857
- **Simple test:** If you're describing how thing X relates to thing Y, it's a connection.
858
-
859
- Examples:
860
-
861
- - "Creator **owns** token" ✅ Connection
862
- - "User **enrolled_in** course" ✅ Connection
863
- - "Agent **powers** AI clone" ✅ Connection
864
- - "Creator created a post" ❌ Event (action), not connection
865
-
866
- ### Connection Types (25 total)
867
-
868
- **Design Principle:** Consolidated types with metadata for variants. Protocol identity stored in `metadata.protocol`.
869
-
870
- ```typescript
871
- type ConnectionType =
872
- // OWNERSHIP (2)
873
- | 'owns'
874
- | 'created_by'
875
-
876
- // AI RELATIONSHIPS (3)
877
- | 'clone_of'
878
- | 'trained_on'
879
- | 'powers'
880
-
881
- // CONTENT RELATIONSHIPS (5)
882
- | 'authored'
883
- | 'generated_by'
884
- | 'published_to'
885
- | 'part_of'
886
- | 'references'
887
-
888
- // COMMUNITY RELATIONSHIPS (4)
889
- | 'member_of'
890
- | 'following'
891
- | 'moderates'
892
- | 'participated_in'
893
-
894
- // BUSINESS RELATIONSHIPS (3)
895
- | 'manages'
896
- | 'reports_to'
897
- | 'collaborates_with'
898
-
899
- // TOKEN RELATIONSHIPS (3)
900
- | 'holds_tokens'
901
- | 'staked_in'
902
- | 'earned_from'
903
-
904
- // PRODUCT RELATIONSHIPS (4)
905
- | 'purchased'
906
- | 'enrolled_in'
907
- | 'completed'
908
- | 'teaching'
909
-
910
- // CONSOLIDATED TYPES (use metadata for variants + protocol)
911
- | 'transacted' // Payment/subscription/invoice (metadata.transactionType + protocol)
912
- | 'notified' // Notifications (metadata.channel + notificationType)
913
- | 'referred' // Referrals (metadata.referralType)
914
- | 'communicated' // Agent/protocol communication (metadata.protocol + messageType)
915
- | 'delegated' // Task/workflow delegation (metadata.protocol + taskType)
916
- | 'approved' // Approvals (metadata.approvalType + protocol)
917
- | 'fulfilled'; // Fulfillment (metadata.fulfillmentType + protocol)
918
-
919
- // Total: 25 connection types
920
- ```
921
-
922
- ### Connection Structure
923
-
924
- ```typescript
925
- {
926
- _id: Id<"connections">,
927
- fromThingId: Id<"things">,
928
- toThingId: Id<"things">,
929
- relationshipType: ConnectionType,
930
- metadata?: { // Optional relationship data
931
- // For revenue splits:
932
- revenueShare?: number, // 0.0 to 1.0
933
- // For token holdings:
934
- balance?: number,
935
- // For course enrollment:
936
- enrolledAt?: number,
937
- progress?: number,
938
- // etc...
939
- },
940
- strength?: number, // Relationship strength (0-1)
941
- validFrom?: number, // When relationship started
942
- validTo?: number, // When relationship ended
943
- createdAt: number,
944
- updatedAt?: number
945
- }
946
- ```
947
-
948
- ### Common Connection Patterns
949
-
950
- **Pattern: Ownership**
951
-
952
- ```typescript
953
- // Creator owns AI clone (thing-to-thing)
954
- {
955
- fromThingId: creatorId,
956
- toThingId: cloneId,
957
- relationshipType: "owns",
958
- createdAt: Date.now()
959
- }
960
- ```
961
-
962
- **Pattern: Revenue Split**
963
-
964
- ```typescript
965
- // Collaborator owns 30% of course
966
- {
967
- fromThingId: collaboratorId,
968
- toThingId: courseId,
969
- relationshipType: "owns",
970
- metadata: {
971
- revenueShare: 0.3
972
- },
973
- createdAt: Date.now()
974
- }
975
- ```
976
-
977
- **Pattern: Token Holding**
978
-
979
- ```typescript
980
- // User holds 1000 tokens
981
- {
982
- fromThingId: userId,
983
- toThingId: tokenId,
984
- relationshipType: "holds_tokens",
985
- metadata: {
986
- balance: 1000,
987
- acquiredAt: Date.now()
988
- },
989
- createdAt: Date.now()
990
- }
991
- ```
992
-
993
- **Pattern: Course Enrollment**
994
-
995
- ```typescript
996
- // User enrolled in course
997
- {
998
- fromThingId: userId,
999
- toThingId: courseId,
1000
- relationshipType: "enrolled_in",
1001
- metadata: {
1002
- progress: 0.45, // 45% complete
1003
- enrolledAt: Date.now(),
1004
- lastAccessedAt: Date.now()
1005
- },
1006
- createdAt: Date.now()
1007
- }
1008
- ```
1009
-
1010
- **Pattern: Group Membership**
1011
-
1012
- ```typescript
1013
- // User is member of group with role
1014
- {
1015
- fromThingId: userId,
1016
- toThingId: groupId,
1017
- relationshipType: "member_of",
1018
- metadata: {
1019
- role: "group_owner" | "group_user", // Group-specific role
1020
- permissions: ["read", "write", "admin"],
1021
- invitedBy?: Id<"things">, // Who invited this user
1022
- invitedAt?: number,
1023
- joinedAt: Date.now(),
1024
- },
1025
- createdAt: Date.now()
1026
- }
1027
-
1028
- // Group owns content/resources
1029
- {
1030
- fromThingId: groupId,
1031
- toThingId: contentId,
1032
- relationshipType: "owns",
1033
- metadata: {
1034
- createdBy: userId, // User who created it
1035
- },
1036
- createdAt: Date.now()
1037
- }
1038
- ```
1039
-
1040
- **Pattern: Payment Transaction (Consolidated)**
1041
-
1042
- ```typescript
1043
- // User paid for product (use "transacted" with metadata)
1044
- {
1045
- fromThingId: userId,
1046
- toThingId: productId,
1047
- relationshipType: "transacted",
1048
- metadata: {
1049
- transactionType: "payment", // or "subscription" or "invoice"
1050
- amount: 99.00,
1051
- currency: "USD",
1052
- paymentId: "pi_123456",
1053
- status: "completed"
1054
- },
1055
- createdAt: Date.now()
1056
- }
1057
-
1058
- // User subscribed to service
1059
- {
1060
- fromThingId: userId,
1061
- toThingId: subscriptionId,
1062
- relationshipType: "transacted",
1063
- metadata: {
1064
- transactionType: "subscription",
1065
- amount: 29.00,
1066
- currency: "USD",
1067
- interval: "monthly",
1068
- subscriptionId: "sub_123456",
1069
- status: "active"
1070
- },
1071
- createdAt: Date.now()
1072
- }
1073
- ```
1074
-
1075
- **Pattern: Referral (Consolidated)**
1076
-
1077
- ```typescript
1078
- // User referred by another user (use "referred" with metadata)
1079
- {
1080
- fromThingId: newUserId,
1081
- toThingId: referrerId,
1082
- relationshipType: "referred",
1083
- metadata: {
1084
- referralType: "direct", // or "conversion" or "campaign"
1085
- source: "referral_link",
1086
- referralCode: "REF123",
1087
- tokensEarned: 100,
1088
- status: "converted"
1089
- },
1090
- createdAt: Date.now()
1091
- }
1092
- ```
1093
-
1094
- **Pattern: Notification (Consolidated)**
1095
-
1096
- ```typescript
1097
- // User notified about event (use "notified" with metadata)
1098
- {
1099
- fromThingId: userId,
1100
- toThingId: notificationId,
1101
- relationshipType: "notified",
1102
- metadata: {
1103
- channel: "email", // or "sms" or "push" or "in_app"
1104
- campaignId: campaignId, // optional
1105
- deliveredAt: Date.now(),
1106
- readAt: Date.now(),
1107
- clicked: true
1108
- },
1109
- createdAt: Date.now()
1110
- }
1111
- ```
1112
-
1113
- ---
1114
-
1115
- ## EVENTS: All The Actions
1116
-
1117
- ### What Goes in Events?
1118
-
1119
- **Simple test:** If you're describing something that HAPPENED at a specific TIME, it's an event.
1120
-
1121
- Examples:
1122
-
1123
- - "User **purchased** tokens at 3pm" ✅ Event
1124
- - "Content **was published** yesterday" ✅ Event
1125
- - "Clone **interacted** with user" ✅ Event
1126
- - "User owns tokens" ❌ Connection (state), not event
1127
-
1128
- ### Event Types (35 total)
1129
-
1130
- **Design Principle:** Consolidated types with metadata for variants. Protocol identity stored in `metadata.protocol`.
1131
-
1132
- ```typescript
1133
- type EventType =
1134
- // ENTITY LIFECYCLE (4)
1135
- | 'entity_created'
1136
- | 'entity_updated'
1137
- | 'entity_deleted'
1138
- | 'entity_archived'
1139
-
1140
- // USER EVENTS (5)
1141
- | 'user_registered'
1142
- | 'user_verified'
1143
- | 'user_login'
1144
- | 'user_logout'
1145
- | 'profile_updated'
1146
-
1147
- // AUTHENTICATION EVENTS (6)
1148
- | 'password_reset_requested'
1149
- | 'password_reset_completed'
1150
- | 'email_verification_sent'
1151
- | 'email_verified'
1152
- | 'two_factor_enabled'
1153
- | 'two_factor_disabled'
1154
-
1155
- // GROUP EVENTS (5)
1156
- | 'group_created'
1157
- | 'group_updated'
1158
- | 'user_invited_to_group'
1159
- | 'user_joined_group'
1160
- | 'user_removed_from_group'
1161
-
1162
- // DASHBOARD & UI EVENTS (4)
1163
- | 'dashboard_viewed'
1164
- | 'settings_updated'
1165
- | 'theme_changed'
1166
- | 'preferences_updated'
1167
-
1168
- // AI/CLONE EVENTS (4)
1169
- | 'clone_created'
1170
- | 'clone_updated'
1171
- | 'voice_cloned'
1172
- | 'appearance_cloned'
1173
-
1174
- // AGENT EVENTS (4)
1175
- | 'agent_created'
1176
- | 'agent_executed'
1177
- | 'agent_completed'
1178
- | 'agent_failed'
1179
-
1180
- // TOKEN EVENTS (7)
1181
- | 'token_created'
1182
- | 'token_minted'
1183
- | 'token_burned'
1184
- | 'tokens_purchased'
1185
- | 'tokens_staked'
1186
- | 'tokens_unstaked'
1187
- | 'tokens_transferred'
1188
-
1189
- // COURSE EVENTS (5)
1190
- | 'course_created'
1191
- | 'course_enrolled'
1192
- | 'lesson_completed'
1193
- | 'course_completed'
1194
- | 'certificate_earned'
1195
-
1196
- // ANALYTICS EVENTS (5)
1197
- | 'metric_calculated'
1198
- | 'insight_generated'
1199
- | 'prediction_made'
1200
- | 'optimization_applied'
1201
- | 'report_generated'
1202
-
1203
- // CYCLEENCE EVENTS (7) - NEW
1204
- | 'cycle_request' // User requests AI cycle
1205
- | 'cycle_completed' // Cycle result delivered
1206
- | 'cycle_failed' // Cycle failed
1207
- | 'cycle_quota_exceeded' // Monthly limit hit
1208
- | 'cycle_revenue_collected' // Daily revenue sweep
1209
- | 'org_revenue_generated' // Org generates platform revenue
1210
- | 'revenue_share_distributed' // Revenue share paid out
1211
-
1212
- // BLOCKCHAIN EVENTS (5) - NEW
1213
- | 'nft_minted' // NFT created on-chain
1214
- | 'nft_transferred' // NFT ownership changed
1215
- | 'tokens_bridged' // Cross-chain bridge
1216
- | 'contract_deployed' // Smart contract deployed
1217
- | 'treasury_withdrawal' // Platform owner withdraws revenue
1218
-
1219
- // CONSOLIDATED EVENTS (use metadata for variants + protocol)
1220
- | 'content_event' // metadata.action: created|updated|deleted|viewed|shared|liked
1221
- | 'payment_event' // metadata.status: requested|verified|processed + protocol
1222
- | 'subscription_event' // metadata.action: started|renewed|cancelled
1223
- | 'commerce_event' // metadata.eventType + protocol (ACP, AP2)
1224
- | 'livestream_event' // metadata.status: started|ended + metadata.action: joined|left|chat|donation
1225
- | 'notification_event' // metadata.channel: email|sms|push|in_app + deliveryStatus
1226
- | 'referral_event' // metadata.action: created|completed|rewarded
1227
- | 'communication_event' // metadata.protocol (A2A, ACP, AG-UI) + messageType
1228
- | 'task_event' // metadata.action: delegated|completed|failed + protocol
1229
- | 'mandate_event' // metadata.mandateType: intent|cart + protocol (AP2)
1230
- | 'price_event'; // metadata.action: checked|changed
1231
-
1232
- // Total: 52 event types (35 original + 7 cycle + 5 blockchain + 5 NFT overlap)
1233
- ```
1234
-
1235
- ### Event Structure
1236
-
1237
- ```typescript
1238
- {
1239
- _id: Id<"events">,
1240
- type: EventType, // What happened
1241
- actorId: Id<"things">, // Who/what caused this
1242
- targetId?: Id<"things">, // Optional target thing
1243
- timestamp: number, // When it happened
1244
- metadata: any // Event-specific data
1245
- }
1246
- ```
1247
-
1248
- **Metadata Structure:**
1249
-
1250
- The `metadata` field is flexible JSON that ALWAYS includes `protocol` for protocol-specific events:
1251
-
1252
- ```typescript
1253
- // Protocol-agnostic events (no protocol field needed)
1254
- { action: "created", contentType: "blog_post" }
1255
-
1256
- // Protocol-specific events (includes protocol identifier)
1257
- {
1258
- protocol: "a2a" | "acp" | "ap2" | "x402" | "ag-ui",
1259
- // ... protocol-specific fields
1260
- }
1261
-
1262
- // Examples:
1263
- // A2A message
1264
- { protocol: "a2a", messageType: "task_delegation", task: "research" }
1265
-
1266
- // ACP commerce
1267
- { protocol: "acp", eventType: "purchase_initiated", agentPlatform: "chatgpt" }
1268
-
1269
- // AP2 mandate
1270
- { protocol: "ap2", mandateType: "intent", autoExecute: true }
1271
-
1272
- // X402 payment
1273
- { protocol: "x402", network: "base", txHash: "0x..." }
1274
- ```
1275
-
1276
- ### Event Patterns
1277
-
1278
- **Pattern: User Action**
1279
-
1280
- ```typescript
1281
- // User purchased tokens
1282
- {
1283
- type: "tokens_purchased",
1284
- actorId: userId,
1285
- targetId: tokenId,
1286
- timestamp: Date.now(),
1287
- metadata: {
1288
- amount: 100,
1289
- usdAmount: 10,
1290
- paymentId: "pi_123",
1291
- txHash: "0x456"
1292
- }
1293
- }
1294
- ```
1295
-
1296
- **Pattern: Payment Event (Consolidated)**
1297
-
1298
- ```typescript
1299
- // Payment completed (use "payment_processed" with metadata.status)
1300
- {
1301
- type: "payment_processed",
1302
- actorId: userId,
1303
- targetId: paymentId,
1304
- timestamp: Date.now(),
1305
- metadata: {
1306
- status: "completed", // or "initiated" | "failed" | "refunded"
1307
- amount: 99.00,
1308
- currency: "USD",
1309
- paymentId: "pi_123456",
1310
- method: "stripe"
1311
- }
1312
- }
1313
-
1314
- // Subscription renewed (use "subscription_updated" with metadata.action)
1315
- {
1316
- type: "subscription_updated",
1317
- actorId: userId,
1318
- targetId: subscriptionId,
1319
- timestamp: Date.now(),
1320
- metadata: {
1321
- action: "renewed", // or "started" | "cancelled"
1322
- tier: "pro",
1323
- amount: 29.00,
1324
- nextBillingDate: Date.now() + 30 * 24 * 60 * 60 * 1000
1325
- }
1326
- }
1327
- ```
1328
-
1329
- **Pattern: Content Event (Consolidated)**
1330
-
1331
- ```typescript
1332
- // Content created (use "content_changed" with metadata.action)
1333
- {
1334
- type: "content_changed",
1335
- actorId: creatorId,
1336
- targetId: contentId,
1337
- timestamp: Date.now(),
1338
- metadata: {
1339
- action: "created", // or "updated" | "deleted"
1340
- contentType: "blog_post",
1341
- generatedBy: "marketing_agent",
1342
- platform: "instagram"
1343
- }
1344
- }
1345
-
1346
- // Content viewed (use "content_interacted" with metadata.interactionType)
1347
- {
1348
- type: "content_interacted",
1349
- actorId: userId,
1350
- targetId: contentId,
1351
- timestamp: Date.now(),
1352
- metadata: {
1353
- interactionType: "viewed", // or "shared" | "liked"
1354
- duration: 120, // seconds
1355
- source: "feed"
1356
- }
1357
- }
1358
- ```
1359
-
1360
- **Pattern: Livestream Event (Consolidated)**
1361
-
1362
- ```typescript
1363
- // Livestream started (use "livestream_status_changed" with metadata.status)
1364
- {
1365
- type: "livestream_status_changed",
1366
- actorId: creatorId,
1367
- targetId: livestreamId,
1368
- timestamp: Date.now(),
1369
- metadata: {
1370
- status: "started", // or "scheduled" | "ended"
1371
- streamId: "stream_123",
1372
- platform: "cloudflare",
1373
- rtmpUrl: "rtmp://..."
1374
- }
1375
- }
1376
-
1377
- // Viewer joined (use "livestream_interaction" with metadata.type)
1378
- {
1379
- type: "livestream_interaction",
1380
- actorId: viewerId,
1381
- targetId: livestreamId,
1382
- timestamp: Date.now(),
1383
- metadata: {
1384
- type: "joined", // or "left" | "message"
1385
- viewerCount: 42,
1386
- message: "Hello!" // if type === "message"
1387
- }
1388
- }
1389
- ```
1390
-
1391
- **Pattern: Notification Event (Consolidated)**
1392
-
1393
- ```typescript
1394
- // Email notification sent (use "notification_delivered" with metadata.channel)
1395
- {
1396
- type: "notification_delivered",
1397
- actorId: systemId,
1398
- targetId: userId,
1399
- timestamp: Date.now(),
1400
- metadata: {
1401
- channel: "email", // or "sms" | "push" | "in_app"
1402
- messageId: "msg_123",
1403
- subject: "New content available",
1404
- deliveredAt: Date.now(),
1405
- readAt: Date.now() + 1000 // optional
1406
- }
1407
- }
1408
- ```
1409
-
1410
- **Pattern: AI Interaction**
1411
-
1412
- ```typescript
1413
- // Clone chatted with user
1414
- {
1415
- type: "clone_interaction",
1416
- actorId: userId,
1417
- targetId: cloneId,
1418
- timestamp: Date.now(),
1419
- metadata: {
1420
- message: "How do I start?",
1421
- response: "Let me help you...",
1422
- tokensUsed: 150,
1423
- sentiment: "positive"
1424
- }
1425
- }
1426
- ```
1427
-
1428
- **Pattern: Metric Tracking**
1429
-
1430
- ```typescript
1431
- // Token price calculated
1432
- {
1433
- type: "metric_calculated",
1434
- actorId: systemId,
1435
- targetId: tokenId,
1436
- timestamp: Date.now(),
1437
- metadata: {
1438
- metric: "token_price",
1439
- value: 0.12,
1440
- change: +0.05,
1441
- changePercent: 4.2
1442
- }
1443
- }
1444
- ```
1445
-
1446
- **Pattern: Authentication Events**
1447
-
1448
- ```typescript
1449
- // Password reset requested
1450
- {
1451
- type: "password_reset_requested",
1452
- actorId: userId,
1453
- targetId: passwordResetTokenId,
1454
- timestamp: Date.now(),
1455
- metadata: {
1456
- email: "user@example.com",
1457
- ipAddress: "192.168.1.1",
1458
- expiresAt: Date.now() + 30 * 60 * 1000 // 30 minutes
1459
- }
1460
- }
1461
-
1462
- // Email verified
1463
- {
1464
- type: "email_verified",
1465
- actorId: userId,
1466
- targetId: verificationTokenId,
1467
- timestamp: Date.now(),
1468
- metadata: {
1469
- email: "user@example.com",
1470
- verificationMethod: "link" | "code"
1471
- }
1472
- }
1473
-
1474
- // Two-factor enabled
1475
- {
1476
- type: "two_factor_enabled",
1477
- actorId: userId,
1478
- timestamp: Date.now(),
1479
- metadata: {
1480
- method: "totp" | "sms" | "email",
1481
- backupCodesGenerated: 10
1482
- }
1483
- }
1484
- ```
1485
-
1486
- **Pattern: Group Events**
1487
-
1488
- ```typescript
1489
- // Group created
1490
- {
1491
- type: "group_created",
1492
- actorId: creatorId,
1493
- targetId: groupId,
1494
- timestamp: Date.now(),
1495
- metadata: {
1496
- name: "Acme Corp",
1497
- slug: "acme",
1498
- plan: "pro",
1499
- trialEndsAt: Date.now() + 14 * 24 * 60 * 60 * 1000 // 14 days
1500
- }
1501
- }
1502
-
1503
- // User invited to group
1504
- {
1505
- type: "user_invited_to_group",
1506
- actorId: inviterId,
1507
- targetId: groupId,
1508
- timestamp: Date.now(),
1509
- metadata: {
1510
- invitedEmail: "newuser@example.com",
1511
- role: "group_user",
1512
- inviteToken: "inv_123456",
1513
- expiresAt: Date.now() + 7 * 24 * 60 * 60 * 1000 // 7 days
1514
- }
1515
- }
1516
-
1517
- // User joined group
1518
- {
1519
- type: "user_joined_group",
1520
- actorId: userId,
1521
- targetId: groupId,
1522
- timestamp: Date.now(),
1523
- metadata: {
1524
- role: "group_user",
1525
- invitedBy: inviterId
1526
- }
1527
- }
1528
- ```
1529
-
1530
- **Pattern: Dashboard & UI Events**
1531
-
1532
- ```typescript
1533
- // Dashboard viewed
1534
- {
1535
- type: "dashboard_viewed",
1536
- actorId: userId,
1537
- timestamp: Date.now(),
1538
- metadata: {
1539
- dashboardType: "platform_owner" | "group_owner" | "group_user" | "customer",
1540
- groupId?: groupId,
1541
- route: "/admin/dashboard",
1542
- sessionDuration: 0 // Updated on session end
1543
- }
1544
- }
1545
-
1546
- // Theme changed
1547
- {
1548
- type: "theme_changed",
1549
- actorId: userId,
1550
- targetId: uiPreferencesId,
1551
- timestamp: Date.now(),
1552
- metadata: {
1553
- previousTheme: "light",
1554
- newTheme: "dark"
1555
- }
1556
- }
1557
-
1558
- // Settings updated
1559
- {
1560
- type: "settings_updated",
1561
- actorId: userId,
1562
- targetId: uiPreferencesId,
1563
- timestamp: Date.now(),
1564
- metadata: {
1565
- updatedFields: ["dashboardLayout", "notifications"],
1566
- changes: {
1567
- "dashboardLayout.sidebarCollapsed": { from: false, to: true },
1568
- "notifications.email": { from: true, to: false }
1569
- }
1570
- }
1571
- }
1572
- ```
1573
-
1574
- ---
1575
-
1576
- ## KNOWLEDGE Labels & Semantic Chunks
1577
-
1578
- Use knowledge items of `knowledgeType: 'label'` for taxonomy and `knowledgeType: 'chunk'` for RAG. Associate via `thingKnowledge`.
1579
-
1580
- Examples:
1581
-
1582
- - "This creator is in the fitness industry" ✅ label knowledge with `labels: ['industry:fitness']`
1583
- - "This content is video format" ✅ label knowledge with `labels: ['format:video']`
1584
- - "This page content paragraph 3" ✅ chunk knowledge with `text` + `embedding`
1585
-
1586
- Pattern: multi‑label entity
1587
-
1588
- ```typescript
1589
- const labels = [ 'industry:fitness', 'skill:video-editing', 'technology:youtube', 'audience:beginners' ];
1590
- for (const label of labels) {
1591
- const kid = await getOrCreateKnowledgeLabel(label);
1592
- await db.insert('thingKnowledge', { thingId: creatorId, knowledgeId: kid, role: 'label', createdAt: Date.now() });
1593
- }
1594
- ```
1595
-
1596
- Pattern: semantic search across chunks
1597
-
1598
- ```typescript
1599
- // Given a query embedding, find top-k similar chunks for an org
1600
- const topK = await vectorSearch('knowledge', {
1601
- vectorField: 'embedding',
1602
- query: queryEmbedding,
1603
- filter: { 'sourceThingId.orgId': orgId, knowledgeType: 'chunk' },
1604
- k: 10,
1605
- });
1606
- ```
1607
-
1608
- ---
1609
-
1610
- ## How Features Map to Ontology
1611
-
1612
- ### Feature: AI Clone Creation
1613
-
1614
- **Things Created:**
1615
-
1616
- 1. `ai_clone` thing (the clone)
1617
- 2. `knowledge_item` entities (training data)
1618
-
1619
- **Connections Created:**
1620
-
1621
- 1. creator → ai_clone (relationship: "owns")
1622
- 2. ai_clone → knowledge_items (relationship: "trained_on")
1623
-
1624
- **Events Logged:**
1625
-
1626
- 1. `clone_created` (when clone created)
1627
- 2. `voice_cloned` (when voice ready)
1628
- 3. `appearance_cloned` (when appearance ready)
1629
-
1630
- **Knowledge Labels Added:**
1631
-
1632
- - Clone inherits creator's labels
1633
- - Additional: "ai_clone", "active"
1634
-
1635
- ### Feature: Token Purchase
1636
-
1637
- **Things Involved:**
1638
-
1639
- 1. `token` thing (the token being purchased)
1640
- 2. `audience_member` thing (the buyer)
1641
-
1642
- **Connections Created/Updated:**
1643
-
1644
- 1. buyer → token (relationship: "holds_tokens", metadata: { balance: 100 })
1645
-
1646
- **Events Logged:**
1647
-
1648
- 1. `tokens_purchased` (the purchase)
1649
- 2. `revenue_generated` (for creator)
1650
-
1651
- **Knowledge Labels Added:**
1652
-
1653
- - None (tokens already labeled)
1654
-
1655
- ### Feature: Course Generation
1656
-
1657
- **Things Created:**
1658
-
1659
- 1. `course` entity
1660
- 2. `lesson` entities (multiple)
1661
-
1662
- **Connections Created:**
1663
-
1664
- 1. creator → course (relationship: "owns")
1665
- 2. ai_clone → course (relationship: "teaching")
1666
- 3. course → lessons (relationship: "part_of")
1667
-
1668
- **Events Logged:**
1669
-
1670
- 1. `course_created`
1671
- 2. `content_generated` (for each lesson)
1672
-
1673
- **Knowledge Labels Added:**
1674
-
1675
- - skill labels (what course teaches)
1676
- - industry labels (course category)
1677
- - audience labels (target audience)
1678
-
1679
- ### Feature: ELEVATE Journey
1680
-
1681
- **Things Involved:**
1682
-
1683
- 1. `audience_member` (user going through journey)
1684
- 2. Workflow thing (tracks progress)
1685
-
1686
- **Connections Created:**
1687
-
1688
- - None (journey tracked in workflow state)
1689
-
1690
- **Events Logged:**
1691
-
1692
- 1. `journey_step_completed` (for each step: hook, gift, identify, etc.)
1693
- 2. `achievement_unlocked` (at milestones)
1694
- 3. `tokens_earned` (rewards)
1695
-
1696
- **Knowledge Labels Added:**
1697
-
1698
- - Status labels (current step)
1699
-
1700
- ---
1701
-
1702
- ## Querying the Ontology
1703
-
1704
- ### Get Thing by ID (table: things)
1705
-
1706
- ```typescript
1707
- const thing = await db.get(thingId);
1708
- ```
1709
-
1710
- ### Get All Things of Type (index: by_type)
1711
-
1712
- ```typescript
1713
- const creators = await db
1714
- .query('things')
1715
- .withIndex('by_type', (q) => q.eq('type', 'creator'))
1716
- .collect();
1717
- ```
1718
-
1719
- ### Get Thing's Relationships (table: connections)
1720
-
1721
- ```typescript
1722
- // Get all entities this entity owns
1723
- const owned = await db
1724
- .query('connections')
1725
- .withIndex('from_type', (q) =>
1726
- q.eq('fromThingId', thingId).eq('relationshipType', 'owns')
1727
- )
1728
- .collect();
1729
-
1730
- const ownedThings = await Promise.all(
1731
- owned.map((conn) => db.get(conn.toThingId))
1732
- );
1733
- ```
1734
-
1735
- ### Get Thing's History (table: events)
1736
-
1737
- ```typescript
1738
- // Get all events for this entity
1739
- const history = await db
1740
- .query('events')
1741
- .withIndex('thing_type_time', (q) => q.eq('thingId', thingId))
1742
- .order('desc') // Most recent first
1743
- .collect();
1744
- ```
1745
-
1746
- ### Get Thing's Knowledge (junction: thingKnowledge)
1747
-
1748
- ```typescript
1749
- const knowledgeAssocs = await db
1750
- .query('thingKnowledge')
1751
- .withIndex('by_thing', (q) => q.eq('thingId', thingId))
1752
- .collect();
1753
-
1754
- const knowledgeItems = await Promise.all(
1755
- knowledgeAssocs.map((assoc) => db.get(assoc.knowledgeId))
1756
- );
1757
- ```
1758
-
1759
- ### Search by Multiple Criteria
1760
-
1761
- ```typescript
1762
- // Find fitness creators with >10k followers
1763
- const creators = await db
1764
- .query('things')
1765
- .withIndex('by_type', (q) => q.eq('type', 'creator'))
1766
- .collect();
1767
-
1768
- const fitnessCreators = creators.filter(
1769
- (c) =>
1770
- c.properties.totalFollowers > 10000 &&
1771
- c.properties.niche.includes('fitness')
1772
- );
1773
- ```
1774
-
1775
- ---
1776
-
1777
- ## Migration from Old Systems
1778
-
1779
- When migrating from one.ie or bullfm:
1780
-
1781
- ### Step 1: Identify Thing Types
1782
-
1783
- Map old models to new thing types:
1784
-
1785
- - Old "User" → "creator" or "audience_member"
1786
- - Old "Post" → "blog_post" or "social_post"
1787
- - Old "Follow" → connection with "following" type
1788
- - Old "Like" → event with "content_liked" type
1789
-
1790
- ### Step 2: Transform Properties
1791
-
1792
- Extract structured data into `properties` JSON:
1793
-
1794
- ```typescript
1795
- // Old user model
1796
- {
1797
- id: "123",
1798
- name: "John",
1799
- email: "john@example.com",
1800
- bio: "Fitness coach",
1801
- followers: 5000
1802
- }
1803
-
1804
- // New entity
1805
- {
1806
- type: "creator",
1807
- name: "John",
1808
- properties: {
1809
- email: "john@example.com",
1810
- username: "john",
1811
- displayName: "John",
1812
- bio: "Fitness coach",
1813
- niche: ["fitness"],
1814
- totalFollowers: 5000,
1815
- totalContent: 0,
1816
- totalRevenue: 0
1817
- },
1818
- status: "active",
1819
- createdAt: Date.now(),
1820
- updatedAt: Date.now()
1821
- }
1822
- ```
1823
-
1824
- ### Step 3: Convert Relationships
1825
-
1826
- Transform foreign keys into connections:
1827
-
1828
- ```typescript
1829
- // Old: user_id in posts table
1830
- // New: connection
1831
- {
1832
- fromThingId: userId,
1833
- toThingId: postId,
1834
- relationshipType: "authored",
1835
- createdAt: Date.now()
1836
- }
1837
- ```
1838
-
1839
- ### Step 4: Preserve History
1840
-
1841
- Convert activity logs to events:
1842
-
1843
- ```typescript
1844
- // Old: activity log entry
1845
- { user: "123", action: "viewed", post: "456", timestamp: 1234567890 }
1846
-
1847
- // New: event
1848
- {
1849
- thingId: "post-456",
1850
- eventType: "content_viewed",
1851
- timestamp: 1234567890,
1852
- actorType: "user",
1853
- actorId: "user-123"
1854
- }
1855
- ```
1856
-
1857
- ---
1858
-
1859
- ## Validation Rules
1860
-
1861
- ### Thing Validation
1862
-
1863
- - `type` must be valid ThingType (implementation alias may be `EntityType`)
1864
- - `name` cannot be empty
1865
- - `properties` structure must match type
1866
- - `status` must be valid status
1867
- - `createdAt` required, `updatedAt` required
1868
-
1869
- ### Connection Validation
1870
-
1871
- - `fromThingId` must exist
1872
- - `toThingId` must exist
1873
- - `relationshipType` must be valid
1874
- - Cannot connect a thing to itself (usually)
1875
- - Relationship must make semantic sense
1876
-
1877
- ### Event Validation
1878
-
1879
- - `thingId` must exist
1880
- - `eventType` must be valid
1881
- - `timestamp` required
1882
- - `actorId` must exist if provided
1883
- - `metadata` structure must match event type
1884
-
1885
- ### Tag Validation
1886
-
1887
- - `name` must be unique
1888
- - `category` must be valid TagCategory
1889
- - `usageCount` must be >= 0
1890
-
1891
- ---
1892
-
1893
- ## Performance Optimization
1894
-
1895
- ### Indexes
1896
-
1897
- Every table has optimized indexes:
1898
-
1899
- ```typescript
1900
- things: -by_type(type) -
1901
- by_status(status) -
1902
- by_created(createdAt) -
1903
- search_things(name, type, status);
1904
-
1905
- connections: -from_type(fromThingId, relationshipType) -
1906
- to_type(toThingId, relationshipType) -
1907
- bidirectional(fromThingId, toThingId);
1908
-
1909
- events: -thing_type_time(thingId, eventType, timestamp) -
1910
- type_time(eventType, timestamp) -
1911
- session(sessionId, timestamp);
1912
-
1913
- knowledge: -by_type(knowledgeType) - by_source(sourceThingId) - by_created(createdAt);
1914
- ```
1915
-
1916
- ### Query Optimization
1917
-
1918
- - Always use indexes for filters
1919
- - Limit results with `.take(n)`
1920
- - Paginate large result sets
1921
- - Use `.collect()` sparingly, prefer streaming
1922
-
1923
- ---
1924
-
1925
- ## Event Retention & Archival
1926
-
1927
- - Purpose: keep queries fast and costs predictable at scale.
1928
- - Recommended windows (tune per deployment):
1929
- - Hot (fast queries): last 30–90 days in primary `events` table, fully indexed.
1930
- - Warm (historical analytics): 90–365 days; restrict heavy scans and rely on `type_time`/`actor_time`.
1931
- - Cold archive: >365 days exported to warehouse/storage; query via batch jobs or precomputed aggregates.
1932
- - Patterns:
1933
- - Use `type_time` and `actor_time` for filters; avoid full scans.
1934
- - Precompute aggregates into `metric` entities (daily revenue, views) to avoid wide re-reads.
1935
- - Optional scheduled rollups to move very old events to archive and keep hot sets lean.
1936
-
1937
- ---
1938
-
1939
- ## Protocol Integration Examples
1940
-
1941
- ### How Protocols Map to This Ontology
1942
-
1943
- **Key Principle:** Our ontology is protocol-agnostic. Protocols identify themselves via `metadata.protocol`.
1944
-
1945
- #### A2A Protocol (Agent-to-Agent)
1946
-
1947
- ```typescript
1948
- // Event: Agent delegates task
1949
- {
1950
- type: "task_delegated",
1951
- actorId: oneAgentId,
1952
- targetId: externalAgentId,
1953
- timestamp: Date.now(),
1954
- metadata: {
1955
- protocol: "a2a",
1956
- task: "research_market_trends",
1957
- parameters: { industry: "fitness" }
1958
- }
1959
- }
1960
-
1961
- // Connection: Agents communicate
1962
- {
1963
- fromThingId: oneAgentId,
1964
- toThingId: externalAgentId,
1965
- relationshipType: "communicates_with",
1966
- metadata: {
1967
- protocol: "a2a",
1968
- platform: "elizaos",
1969
- messagesExchanged: 42
1970
- }
1971
- }
1972
- ```
1973
-
1974
- #### ACP Protocol (Agentic Commerce)
1975
-
1976
- ```typescript
1977
- // Event: Purchase initiated
1978
- {
1979
- type: "commerce_event",
1980
- actorId: agentId,
1981
- targetId: transactionId,
1982
- timestamp: Date.now(),
1983
- metadata: {
1984
- protocol: "acp",
1985
- eventType: "purchase_initiated",
1986
- agentPlatform: "chatgpt",
1987
- productId: productId,
1988
- amount: 99.00
1989
- }
1990
- }
1991
-
1992
- // Connection: Merchant approves
1993
- {
1994
- fromThingId: merchantId,
1995
- toThingId: transactionId,
1996
- relationshipType: "approved",
1997
- metadata: {
1998
- protocol: "acp",
1999
- approvalType: "transaction",
2000
- approvedAt: Date.now()
2001
- }
2002
- }
2003
- ```
2004
-
2005
- #### AP2 Protocol (Agent Payments)
2006
-
2007
- ```typescript
2008
- // Event: Intent mandate created
2009
- {
2010
- type: "mandate_created",
2011
- actorId: userId,
2012
- targetId: mandateId,
2013
- timestamp: Date.now(),
2014
- metadata: {
2015
- protocol: "ap2",
2016
- mandateType: "intent",
2017
- autoExecute: true,
2018
- maxBudget: 1500
2019
- }
2020
- }
2021
-
2022
- // Event: Price checked
2023
- {
2024
- type: "price_checked",
2025
- actorId: agentId,
2026
- targetId: intentMandateId,
2027
- timestamp: Date.now(),
2028
- metadata: {
2029
- protocol: "ap2",
2030
- productId: "prod_123",
2031
- currentPrice: 1399,
2032
- targetPrice: 1500,
2033
- withinBudget: true
2034
- }
2035
- }
2036
-
2037
- // Connection: Cart fulfills intent
2038
- {
2039
- fromThingId: intentMandateId,
2040
- toThingId: cartMandateId,
2041
- relationshipType: "fulfills",
2042
- metadata: {
2043
- protocol: "ap2",
2044
- fulfillmentType: "intent_to_cart",
2045
- matchScore: 0.95
2046
- }
2047
- }
2048
- ```
2049
-
2050
- #### X402 Protocol (HTTP Micropayments)
2051
-
2052
- ```typescript
2053
- // Event: Payment requested (402 status)
2054
- {
2055
- type: "payment_requested",
2056
- actorId: apiServiceId,
2057
- targetId: resourceId,
2058
- timestamp: Date.now(),
2059
- metadata: {
2060
- protocol: "x402",
2061
- scheme: "permit",
2062
- network: "base",
2063
- amount: "0.01",
2064
- resource: "/api/agent/analyze"
2065
- }
2066
- }
2067
-
2068
- // Event: Payment verified
2069
- {
2070
- type: "payment_verified",
2071
- actorId: systemId,
2072
- targetId: paymentId,
2073
- timestamp: Date.now(),
2074
- metadata: {
2075
- protocol: "x402",
2076
- network: "base",
2077
- txHash: "0x...",
2078
- verified: true
2079
- }
2080
- }
2081
-
2082
- // Connection: Payment made
2083
- {
2084
- fromThingId: payerId,
2085
- toThingId: serviceId,
2086
- relationshipType: "transacted",
2087
- metadata: {
2088
- protocol: "x402",
2089
- network: "base",
2090
- amount: "0.01",
2091
- txHash: "0x..."
2092
- }
2093
- }
2094
- ```
2095
-
2096
- #### AG-UI Protocol (CopilotKit Generative UI)
2097
-
2098
- ```typescript
2099
- // Event: UI component sent
2100
- {
2101
- type: "message_sent",
2102
- actorId: agentId,
2103
- targetId: conversationId,
2104
- timestamp: Date.now(),
2105
- metadata: {
2106
- protocol: "ag-ui",
2107
- messageType: "ui",
2108
- component: "chart",
2109
- data: { chartType: "line", ... }
2110
- }
2111
- }
2112
-
2113
- // Connection: No connections needed (UI is stateless)
2114
- ```
2115
-
2116
- ### Cross-Protocol Queries
2117
-
2118
- **All payments across all protocols:**
2119
-
2120
- ```typescript
2121
- const allPayments = await ctx.db
2122
- .query('events')
2123
- .filter((q) => q.eq(q.field('type'), 'payment_processed'))
2124
- .collect();
2125
- ```
2126
-
2127
- **Only X402 blockchain payments:**
2128
-
2129
- ```typescript
2130
- const x402Payments = allPayments.filter((e) => e.metadata.protocol === 'x402');
2131
- ```
2132
-
2133
- **Total revenue by protocol:**
2134
-
2135
- ```typescript
2136
- const byProtocol = allPayments.reduce((acc, e) => {
2137
- const protocol = e.metadata.protocol || 'traditional';
2138
- acc[protocol] = (acc[protocol] || 0) + e.metadata.amount;
2139
- return acc;
2140
- }, {});
2141
-
2142
- // Result: { x402: 1250, acp: 3400, ap2: 890, traditional: 5600 }
2143
- ```
2144
-
2145
- ---
2146
-
2147
- ## Merged: Protocol Integration Requirements (from OntologyUpdates.md)
2148
-
2149
- This section consolidates the proposal in `OntologyUpdates.md` into the ontology's protocol‑agnostic model. We preserve the 6‑dimension architecture (organizations, people, things, connections, events, knowledge) and use consolidated types + `metadata.protocol` for extensibility and query performance.
2150
-
2151
- - Things
2152
- - Keep consolidated `mandate` thing with `properties.mandateType: "intent" | "cart"` instead of separate `intent_mandate`/`cart_mandate` types. This reduces index fan‑out and simplifies queries while preserving full fidelity in `properties`.
2153
- - Keep `product` (ACP/marketplace) and `payment` (transaction). For X402/AP2/ACP specifics, store details in `payment.properties` and event metadata (see below).
2154
- - External integrations remain: `external_agent`, `external_workflow`, `external_connection`.
2155
-
2156
- - Connections
2157
- - Use existing specific types (e.g., `owns`, `member_of`, `holds_tokens`) plus consolidated types with metadata:
2158
- - `communicated` for cross‑agent communication (A2A/ACP/AG‑UI)
2159
- - `delegated` for task delegation/assignment
2160
- - `approved` for approvals; `fulfilled` for fulfillment; `transacted` for financial relations
2161
- - Protocol identity is always in `metadata.protocol`.
2162
-
2163
- - Events (consolidated, protocol‑aware)
2164
- - Use consolidated events already defined in this spec:
2165
- - `payment_event` with `metadata.status: requested|verified|processed` (X402/AP2/ACP)
2166
- - `commerce_event` with `metadata.eventType` (ACP/AP2)
2167
- - `communication_event` with `metadata.messageType` (A2A/ACP/AG‑UI)
2168
- - `task_event` with `metadata.action: delegated|completed|failed`
2169
- - `mandate_event` with `metadata.mandateType: intent|cart` (AP2)
2170
- - We map granular variants proposed in `OntologyUpdates.md` (e.g., `message_sent`, `task_delegated`, `price_checked`) to the consolidated forms for index efficiency and simpler analytics.
2171
-
2172
- - Protocol‑specific properties (examples)
2173
- - AP2 Mandate (stored on `mandate` thing):
2174
- - `properties`: `{ mandateType: "intent"|"cart", intent?: {...}, items?: [...], subtotal, tax, total, status, signature, credentialHash, approvedAt?, completedAt? }`
2175
- - X402/ACP/AP2 Payment (stored on `payment` thing and echoed in `payment_event.metadata`):
2176
- - `properties`: `{ protocol: "x402"|"acp"|"ap2", scheme?, network?, amount, currency?, txHash?, invoiceId?, status }`
2177
-
2178
- - Indexes (unchanged, validated)
2179
- - `things`: `by_type`, `by_status`, `by_created`, plus `search_things(name, type, status)`
2180
- - `connections`: `from_type`, `to_type`, `bidirectional`
2181
- - `events`: `type_time`, `actor_time`, `thing_type_time`
2182
- - `knowledge`: `by_type`, `by_source`, `by_created` (plus vector index when supported)
2183
-
2184
- - Auth migration strategy (compatibility)
2185
- - Existing auth tables (Better Auth: users, sessions, verification, resets, 2FA) remain intact.
2186
- - Link `users` to `things` via optional `users.thingId` and backfill with an internal migration (see `OntologyUpdates.md`). This preserves zero‑downtime compatibility.
2187
-
2188
- Rationale: Consolidation minimizes index cardinality, improves query ergonomics, and retains protocol fidelity in `metadata`/`properties`. This yields better beauty (clean mental model), completeness (coverage for all protocols), speed (lean indexes), and scalability (new protocols drop in via metadata).
2189
-
2190
- ---
2191
-
2192
- ## Extensibility: User-Safe Additions
2193
-
2194
- Principle: Users can add to any type without breaking the ontology.
2195
-
2196
- - Use `properties` for schema-free details; don’t edit core enums casually.
2197
- - Use knowledge labels to categorize, filter, and group. Add labels freely without schema changes.
2198
- - Use `metadata` on connections and events for protocol/workflow-specific context.
2199
- - When a new subtype emerges (e.g., new content flavor), prefer:
2200
- - Keep `type` stable (e.g., `video`).
2201
- - Add `properties.kind` and labels (e.g., `format:webinar`, `topic:fitness`).
2202
- - Introduce a new enum literal only when global indexes/constraints benefit.
2203
- - Custom automations integrate via `external_agent`, `external_workflow`, and `external_connection` entities with `delegated`/`communicated` connections.
2204
-
2205
- ---
2206
-
2207
- ## Glossary (Compact)
2208
-
2209
- - `entity` (thing): Any addressable object (creator, organization, content, product, payment, external_agent, mandate, etc.).
2210
- - `connection` (state): Relationship between two entities (owns, member_of, transacted, fulfilled, delegated, communicated).
2211
- - `event` (action): Time-stamped occurrence (content_changed, payment_event, communication_event, task_event, mandate_event).
2212
- - `knowledge` (label/chunk): Classification and RAG units applied via `thingKnowledge` (labels like skill/industry/topic and chunks with embeddings).
2213
- - `owner`: A `creator` with ownership responsibilities. Platform owner (platform_owner) or organization owner (org_owner). See `one/people/owner.md`.
2214
- - `organization`: Multi-tenant container for users and resources. See `one/people/organisation.md`.
2215
-
2216
- ---
2217
-
2218
- ## Summary Statistics
2219
-
2220
- **Dimensions:** 6 total (organizations, people, things, connections, events, knowledge)
2221
-
2222
- **Thing Types:** 66 total
2223
- - Core: 4 (creator, ai_clone, audience_member, organization)
2224
- - Business Agents: 10
2225
- - Content: 7
2226
- - Products: 4
2227
- - Community: 3
2228
- - Token: 2
2229
- - Knowledge: 2
2230
- - Platform: 6
2231
- - Business: 7
2232
- - Authentication & Session: 5
2233
- - Marketing: 6
2234
- - External: 3
2235
- - Protocol: 2
2236
-
2237
- **Connection Types:** 25 total (Hybrid approach)
2238
- - 18 specific semantic types
2239
- - 7 consolidated types with metadata variants
2240
- - Protocol-agnostic via metadata.protocol
2241
- - Includes organization membership with role-based metadata
2242
-
2243
- **Event Types:** 67 total (Hybrid approach)
2244
- - 4 Thing lifecycle
2245
- - 5 User events
2246
- - 6 Authentication events
2247
- - 5 Group events
2248
- - 4 Dashboard & UI events
2249
- - 4 AI/Clone events
2250
- - 4 Agent events
2251
- - 7 Token events
2252
- - 5 Course events
2253
- - 5 Analytics events
2254
- - 7 Cycle events
2255
- - 5 Blockchain events
2256
- - 11 consolidated types with metadata variants
2257
-
2258
- **Design Benefits:**
2259
- - Six-dimension reality model
2260
- - Multi-tenant by design
2261
- - Clear ownership & governance
2262
- - Protocol-agnostic core
2263
- - Infinite protocol extensibility
2264
- - Cross-protocol analytics
2265
- - Type-safe
2266
- - Future-proof
2267
- - Scales from children to enterprise
2268
-
2269
- ---
2270
-
2271
- ## Knowledge Governance
2272
-
2273
- Policy: Default is free-form, user-extensible knowledge labels for maximum flexibility and zero schema churn.
2274
-
2275
- - Curated label prefixes (recommended): `skill:*`, `industry:*`, `topic:*`, `format:*`, `goal:*`, `audience:*`, `technology:*`, `status:*`, `capability:*`, `protocol:*`, `payment_method:*`, `network:*`.
2276
- - Validation: Enforce label hygiene (no duplicates within scope); allow synonyms via an alias list if needed.
2277
- - Ownership: Platform/organization owners may curate official labels; users can still apply ad‑hoc labels.
2278
- - Hygiene: Periodically consolidate low-usage duplicates; do not delete knowledge items with active references—mark deprecated instead.
2279
-
2280
- ---
2281
-
2282
- ## Changelog
2283
-
2284
- - 2025-10-07
2285
- - Canonicalized terminology: “things” as the conceptual term; kept implementation table/fields as `entities` for compatibility.
2286
- - Merged protocol integration requirements; clarified consolidated events/connections with `metadata.protocol`.
2287
- - Added Event Retention & Archival guidance for scale.
2288
- - Added Extensibility rules and a compact Glossary.
2289
- - Added Knowledge Governance and links to `owner.md` and `organisation.md`.
2290
-
2291
- **Thing Types:** 66 total
2292
-
2293
- - Core: 4 (creator, ai_clone, audience_member, organization)
2294
- - Business Agents: 10
2295
- - Content: 7
2296
- - Products: 4
2297
- - Community: 3
2298
- - Token: 2
2299
- - Knowledge: 2
2300
- - Platform: 6
2301
- - Business: 7
2302
- - Authentication & Session: 5 (session, oauth_account, verification_token, password_reset_token, ui_preferences)
2303
- - Marketing: 6
2304
- - External: 3
2305
- - Protocol: 2
2306
-
2307
- **Connection Types:** 25 total (Hybrid approach)
2308
-
2309
- - 18 specific semantic types
2310
- - 7 consolidated types with metadata variants
2311
- - Protocol-agnostic via metadata.protocol
2312
- - Includes organization membership with role-based metadata
2313
-
2314
- **Event Types:** 63 total (Hybrid approach)
2315
-
2316
- - 4 Thing lifecycle
2317
- - 5 User events
2318
- - 6 Authentication events (password_reset, email_verification, 2FA)
2319
- - 5 Group events (group_created, user_invited_to_group, user_joined_group)
2320
- - 4 Dashboard & UI events (dashboard_viewed, theme_changed, settings_updated)
2321
- - 4 AI/Clone events
2322
- - 4 Agent events
2323
- - 7 Token events
2324
- - 5 Course events
2325
- - 5 Analytics events
2326
- - **7 Cycle events** (NEW: cycle_request, cycle_completed, revenue_collected, quota_exceeded)
2327
- - **5 Blockchain events** (NEW: nft_minted, nft_transferred, tokens_bridged, contract_deployed, treasury_withdrawal)
2328
- - 11 consolidated types with metadata variants
2329
- - Protocol identification via metadata.protocol + metadata.network
2330
-
2331
- **Tag Categories:** 12 total
2332
-
2333
- - Industry, skill, topic, format, goal, audience, technology, status
2334
- - Plus: capability, protocol, payment_method, network
2335
-
2336
- **Design Benefits:**
2337
-
2338
- - ✅ Single source of truth
2339
- - ✅ Protocol-agnostic core
2340
- - ✅ Infinite protocol extensibility
2341
- - ✅ Cross-protocol analytics
2342
- - ✅ Clean, maintainable
2343
- - ✅ Type-safe
2344
- - ✅ Future-proof
2345
-
2346
- ---
2347
-
2348
- **END OF ONTOLOGY SPECIFICATION**
2349
-
2350
- ## The Philosophy
2351
-
2352
- **Simplicity is the ultimate sophistication.**
2353
-
2354
- This ontology proves that you don't need hundreds of tables or complex schemas to build a complete AI-native platform. You need:
2355
-
2356
- 1. **6 dimensions** (organizations, people, things, connections, events, knowledge)
2357
- 2. **66 thing types** (every "thing")
2358
- 3. **25 connection types** (every relationship)
2359
- 4. **67 event types** (every action)
2360
- 5. **Metadata** (for protocol identity via metadata.protocol)
2361
-
2362
- That's it. Everything else is just data.
2363
-
2364
- ### Why This Works
2365
-
2366
- **Other systems:**
2367
-
2368
- - Create new tables for every feature
2369
- - Add protocol-specific columns
2370
- - Pollute schema with temporary concepts
2371
- - End up with 50+ tables, 200+ columns
2372
- - Become unmaintainable nightmares
2373
-
2374
- **ONE's approach:**
2375
-
2376
- - Map every feature to 6 dimensions
2377
- - Organizations partition the space
2378
- - People authorize and govern
2379
- - Things, connections, events flow from there
2380
- - Knowledge understands it all
2381
- - Scale infinitely without schema changes
2382
- - Stay simple, clean, beautiful
2383
-
2384
- ### The Result
2385
-
2386
- A database schema that:
2387
-
2388
- - Scales from lemonade stands to global enterprises
2389
- - Children can understand: "I own (org), I'm the boss (person), I sell lemonade (things)"
2390
- - Enterprises can rely on: Multi-tenant isolation, clear governance, infinite scale
2391
- - AI agents can reason about completely
2392
- - Never needs breaking changes
2393
- - Grows more powerful as it grows larger
2394
-
2395
- **This is what happens when you design for clarity first.**
2396
-
2397
- ---
2398
-
2399
- ## Frontend Integration Examples
2400
-
2401
- ### How the Frontend Uses This Ontology
2402
-
2403
- The Astro frontend (documented in `Frontend.md`) uses this ontology through:
2404
-
2405
- 1. **Astro Content Collections** - Can load entities as typed collections
2406
- 2. **Convex Hooks** - Real-time subscriptions to entity/connection/event data
2407
- 3. **Hono API** - Complex mutations that create/update entities and log events
2408
-
2409
- **Example: Multi-Tenant Dashboard**
2410
-
2411
- ```typescript
2412
- // Frontend Component (src/components/admin/OrganizationList.tsx)
2413
- import { useQuery } from 'convex/react';
2414
- import { api } from '@/convex/_generated/api';
2415
-
2416
- export function OrganizationList() {
2417
- // Query organizations (type: "organization")
2418
- const orgs = useQuery(api.queries.admin.listOrganizations);
2419
-
2420
- return (
2421
- <div>
2422
- {orgs?.map(org => (
2423
- <Card key={org._id}>
2424
- <CardHeader>
2425
- <CardTitle>{org.name}</CardTitle>
2426
- <Badge>{org.properties.plan}</Badge>
2427
- </CardHeader>
2428
- <CardContent>
2429
- <p>{org.properties.usage.users} / {org.properties.limits.users} users</p>
2430
- <p>Status: {org.properties.status}</p>
2431
- </CardContent>
2432
- </Card>
2433
- ))}
2434
- </div>
2435
- );
2436
- }
2437
- ```
2438
-
2439
- **Example: Authentication Flow**
2440
-
2441
- ```typescript
2442
- // Password reset request creates:
2443
- // 1. Entity: password_reset_token
2444
- // 2. Event: password_reset_requested
2445
-
2446
- // Backend (Convex mutation)
2447
- export const requestPasswordReset = mutation({
2448
- handler: async (ctx, { email }) => {
2449
- // 1. Find user entity
2450
- const user = await ctx.db
2451
- .query('entities')
2452
- .filter((q) => q.eq(q.field('properties.email'), email))
2453
- .first();
2454
-
2455
- if (!user) return { success: true }; // Don't reveal if user exists
2456
-
2457
- // 2. Create password_reset_token entity
2458
- const tokenId = await ctx.db.insert('entities', {
2459
- type: 'password_reset_token',
2460
- name: `Reset token for ${email}`,
2461
- properties: {
2462
- userId: user._id,
2463
- token: hashedToken,
2464
- expiresAt: Date.now() + 30 * 60 * 1000,
2465
- },
2466
- status: 'active',
2467
- createdAt: Date.now(),
2468
- updatedAt: Date.now(),
2469
- });
2470
-
2471
- // 3. Log event
2472
- await ctx.db.insert('events', {
2473
- type: 'password_reset_requested',
2474
- actorId: user._id,
2475
- targetId: tokenId,
2476
- timestamp: Date.now(),
2477
- metadata: {
2478
- email,
2479
- ipAddress: ctx.auth.sessionId,
2480
- expiresAt: Date.now() + 30 * 60 * 1000,
2481
- },
2482
- });
2483
-
2484
- return { success: true };
2485
- },
2486
- });
2487
-
2488
- // Frontend usage
2489
- import { useMutation } from 'convex/react';
2490
-
2491
- export function PasswordResetForm() {
2492
- const requestReset = useMutation(api.auth.requestPasswordReset);
2493
-
2494
- const handleSubmit = async (email: string) => {
2495
- await requestReset({ email });
2496
- // Show success message
2497
- };
2498
- }
2499
- ```
2500
-
2501
- **Example: Organization Membership Check**
2502
-
2503
- ```typescript
2504
- // Check if user is org_owner (Middleware.md pattern)
2505
- export const checkOrgOwner = query({
2506
- args: { userId: v.id('entities'), orgId: v.id('entities') },
2507
- handler: async (ctx, { userId, orgId }) => {
2508
- // Query connection with role metadata
2509
- const membership = await ctx.db
2510
- .query('connections')
2511
- .withIndex('from_type', (q) =>
2512
- q
2513
- .eq('fromThingId', userId)
2514
- .eq('toThingId', orgId)
2515
- .eq('relationshipType', 'member_of')
2516
- )
2517
- .first();
2518
-
2519
- return membership?.metadata?.role === 'org_owner';
2520
- },
2521
- });
2522
-
2523
- // Frontend usage in middleware
2524
- import { ConvexHttpClient } from 'convex/browser';
2525
-
2526
- export async function checkAccess(userId: string, orgId: string) {
2527
- const convex = new ConvexHttpClient(env.CONVEX_URL);
2528
- const isOwner = await convex.query(api.auth.checkOrgOwner, { userId, orgId });
2529
-
2530
- if (!isOwner) {
2531
- throw new Error('Forbidden: Org owner access required');
2532
- }
2533
- }
2534
- ```
2535
-
2536
- **Example: Dashboard Analytics**
2537
-
2538
- ```typescript
2539
- // Query events for analytics (Dashboard.md pattern)
2540
- export const getOrgAnalytics = query({
2541
- args: { orgId: v.id('entities'), days: v.number() },
2542
- handler: async (ctx, { orgId, days }) => {
2543
- const since = Date.now() - days * 24 * 60 * 60 * 1000;
2544
-
2545
- // Get all dashboard_viewed events for org users
2546
- const orgMembers = await ctx.db
2547
- .query('connections')
2548
- .withIndex('to_type', (q) =>
2549
- q.eq('toThingId', orgId).eq('relationshipType', 'member_of')
2550
- )
2551
- .collect();
2552
-
2553
- const memberIds = orgMembers.map((m) => m.fromThingId);
2554
-
2555
- const dashboardViews = await ctx.db
2556
- .query('events')
2557
- .withIndex('type_time', (q) =>
2558
- q.eq('type', 'dashboard_viewed').gte('timestamp', since)
2559
- )
2560
- .filter((q) => memberIds.includes(q.field('actorId')))
2561
- .collect();
2562
-
2563
- return {
2564
- totalViews: dashboardViews.length,
2565
- uniqueUsers: new Set(dashboardViews.map((e) => e.actorId)).size,
2566
- averageSessionDuration:
2567
- dashboardViews.reduce(
2568
- (sum, e) => sum + (e.metadata.sessionDuration || 0),
2569
- 0
2570
- ) / dashboardViews.length,
2571
- };
2572
- },
2573
- });
2574
- ```
2575
-
2576
- **Example: UI Preferences Sync**
2577
-
2578
- ```typescript
2579
- // Update user preferences (creates ui_preferences thing if not exists)
2580
- export const updatePreferences = mutation({
2581
- args: {
2582
- userId: v.id('entities'),
2583
- theme: v.optional(
2584
- v.union(v.literal('light'), v.literal('dark'), v.literal('system'))
2585
- ),
2586
- language: v.optional(v.string()),
2587
- },
2588
- handler: async (ctx, { userId, theme, language }) => {
2589
- // Get or create ui_preferences entity
2590
- let prefs = await ctx.db
2591
- .query('entities')
2592
- .withIndex('by_type', (q) => q.eq('type', 'ui_preferences'))
2593
- .filter((q) => q.eq(q.field('properties.userId'), userId))
2594
- .first();
2595
-
2596
- if (!prefs) {
2597
- // Create new preferences entity
2598
- const prefsId = await ctx.db.insert('entities', {
2599
- type: 'ui_preferences',
2600
- name: `Preferences for user ${userId}`,
2601
- properties: {
2602
- userId,
2603
- theme: theme || 'system',
2604
- language: language || 'en',
2605
- timezone: 'UTC',
2606
- dashboardLayout: {
2607
- sidebarCollapsed: false,
2608
- defaultView: 'grid',
2609
- itemsPerPage: 20,
2610
- },
2611
- notifications: { email: true, push: false, sms: false, inApp: true },
2612
- accessibility: {
2613
- reducedMotion: false,
2614
- highContrast: false,
2615
- fontSize: 'medium',
2616
- },
2617
- updatedAt: Date.now(),
2618
- },
2619
- status: 'active',
2620
- createdAt: Date.now(),
2621
- updatedAt: Date.now(),
2622
- });
2623
-
2624
- prefs = await ctx.db.get(prefsId);
2625
- } else {
2626
- // Update existing preferences
2627
- await ctx.db.patch(prefs._id, {
2628
- properties: {
2629
- ...prefs.properties,
2630
- theme: theme || prefs.properties.theme,
2631
- language: language || prefs.properties.language,
2632
- updatedAt: Date.now(),
2633
- },
2634
- updatedAt: Date.now(),
2635
- });
2636
- }
2637
-
2638
- // Log preferences_updated event
2639
- if (theme) {
2640
- await ctx.db.insert('events', {
2641
- type: 'theme_changed',
2642
- actorId: userId,
2643
- targetId: prefs._id,
2644
- timestamp: Date.now(),
2645
- metadata: {
2646
- previousTheme: prefs.properties.theme,
2647
- newTheme: theme,
2648
- },
2649
- });
2650
- }
2651
-
2652
- return { success: true };
2653
- },
2654
- });
2655
-
2656
- // Frontend hook
2657
- export function usePreferences(userId: string) {
2658
- const prefs = useQuery(api.queries.preferences.get, { userId });
2659
- const updatePrefs = useMutation(api.mutations.preferences.update);
2660
-
2661
- return { preferences: prefs?.properties, updatePreferences: updatePrefs };
2662
- }
2663
- ```
2664
-
2665
- ### Key Frontend Patterns
2666
-
2667
- **1. Thing as Content Collection**
2668
-
2669
- ```typescript
2670
- // src/content/config.ts
2671
- const agentsCollection = defineCollection({
2672
- type: 'data',
2673
- loader: async () => {
2674
- const convex = new ConvexHttpClient(env.CONVEX_URL);
2675
- const agents = await convex.query(api.queries.entities.list, {
2676
- type: 'strategy_agent',
2677
- });
2678
- return agents;
2679
- },
2680
- });
2681
- ```
2682
-
2683
- **2. Real-time Dashboard Stats**
2684
-
2685
- ```tsx
2686
- export function DashboardStats({ orgId }) {
2687
- // Subscribes to changes - auto-updates when events are logged!
2688
- const stats = useQuery(api.queries.dashboard.getStats, { orgId });
2689
-
2690
- return <StatsCards data={stats} />;
2691
- }
2692
- ```
2693
-
2694
- **3. Permission-Based Rendering**
2695
-
2696
- ```tsx
2697
- export function AdminPanel({ userId, orgId }) {
2698
- const membership = useQuery(api.queries.orgs.getMembership, {
2699
- userId,
2700
- orgId,
2701
- });
2702
-
2703
- if (membership?.metadata?.role !== 'org_owner') {
2704
- return <div>Access denied</div>;
2705
- }
2706
-
2707
- return <AdminDashboard />;
2708
- }
2709
- ```
2710
-
2711
- **4. Astro SSR with Ontology**
2712
-
2713
- ```astro
2714
- ---
2715
- // src/pages/org/[orgId]/dashboard.astro
2716
- import { ConvexHttpClient } from 'convex/browser';
2717
- import { api } from '@/convex/_generated/api';
2718
-
2719
- const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
2720
-
2721
- // Fetch organization entity
2722
- const org = await convex.query(api.queries.entities.get, {
2723
- id: Astro.params.orgId,
2724
- });
2725
-
2726
- // Fetch org members (connections where relationshipType = "member_of")
2727
- const members = await convex.query(api.queries.orgs.getMembers, {
2728
- orgId: Astro.params.orgId,
2729
- });
2730
- ---
2731
-
2732
- <Layout title={org.name}>
2733
- <h1>{org.name} Dashboard</h1>
2734
- <p>Plan: {org.properties.plan}</p>
2735
- <p>Members: {members.length} / {org.properties.limits.users}</p>
2736
-
2737
- <!-- Real-time stats component -->
2738
- <OrgStats client:load orgId={org._id} />
2739
- </Layout>
2740
- ```
2741
-
2742
- This demonstrates how the complete ontology (things, connections, events, knowledge) powers the entire frontend architecture through clean, type-safe queries and real-time subscriptions.
2743
-
2744
- ---
2745
-
2746
- ## For Implementers
2747
-
2748
- **AI agents:** When implementing ANY feature, start by asking:
2749
-
2750
- 1. What **entities** are involved?
2751
- 2. What **connections** link them?
2752
- 3. What **events** need to be logged?
2753
- 4. What **knowledge labels** categorize them?
2754
- 5. What **protocol** is this for? (add to metadata)
2755
- 6. What **knowledge** (labels + chunks) should be linked?
2756
-
2757
- **Humans:** Your AI agents now have a complete, unambiguous data model. They will generate consistent database operations because they understand the underlying structure.
2758
-
2759
- **Developers:** You have a schema that will never need major refactoring. Just add new thing types as needed, use existing event types with metadata, and enjoy the simplicity.
2760
-
2761
- **This ontology is complete. It's ready for production.**
2762
-
2763
- ---
2764
-
2765
- ## RAG Ingestion Strategy for `one/`
2766
-
2767
- Objective: attach vectors to every relevant piece of content to enable high‑quality retrieval, while preserving ontology simplicity.
2768
-
2769
- 1) Inventory sources (by thing type)
2770
- - Text bodies: `blog_post.content`, `social_post.text`, `email.content`, `lesson.content`, `course.description`, `website.page.html (stripped)`
2771
- - Transcripts: `video.transcript`, `podcast.transcript`, `livestream.recording.transcript`
2772
- - Metadata: titles, summaries, captions
2773
-
2774
- 2) Chunking standard
2775
- - Window: ~800 tokens; overlap: ~200 tokens; language‑aware sentence boundaries when possible.
2776
- - Store per‑chunk: `{ index, tokenCount, start, end, overlap }`.
2777
-
2778
- 3) Embedding policy
2779
- - Model: configurable via env (e.g., `text-embedding-3-large`). Store `embeddingModel` + `embeddingDim` per knowledge item.
2780
- - PII/Privacy: use `knowledgeType: 'vector_only'` for sensitive texts; omit `text` and keep only embeddings + hashes.
2781
-
2782
- 4) Ingestion pipeline
2783
- - Mutation: `scheduleEmbeddingForThing({ thingId, fields[] })` validates and enqueues work.
2784
- - Internal action: `embedText({ text, model })` calls provider and returns `embedding`.
2785
- - Internal mutation: `upsertKnowledgeChunks({ thingId, chunks[] })` writes `knowledge` items and links via `thingKnowledge` with role `chunk_of`.
2786
- - Event log: `content_changed` on source updates triggers re‑embedding (debounced) via scheduler.
2787
-
2788
- 5) Query + retrieval
2789
- - Vector search over `knowledge` filtered by org, creator, and content type; k‑NN approximate index when available, else provider‑side search.
2790
- - Hybrid scoring: combine semantic similarity with lexical signals from `labels` and metadata.
2791
-
2792
- 6) Governance + lifecycle
2793
- - Versioning: keep `metadata.hash` of source; if unchanged, skip.
2794
- - Retention: archive old chunks on major edits; GC orphaned knowledge items.
2795
- - Quality: track `metadata.qualityScore` and `feedback` for active learning.
2796
-
2797
- Example (Convex pseudo‑API)
2798
-
2799
- ```typescript
2800
- // internal action: embed text
2801
- export const embedText = internalAction({
2802
- args: { text: v.string(), model: v.optional(v.string()) },
2803
- handler: async (ctx, { text, model }) => {
2804
- const embedding = await callEmbedProvider(text, model);
2805
- return { embedding, model: model || 'text-embedding-3-large', dim: embedding.length };
2806
- },
2807
- });
2808
-
2809
- // mutation: schedule embedding for a thing
2810
- export const scheduleEmbeddingForThing = mutation({
2811
- args: { id: v.id('things'), fields: v.optional(v.array(v.string())) },
2812
- handler: async (ctx, { id, fields }) => {
2813
- await ctx.scheduler.runAfter(0, internal.rag.ingestThing, { id, fields });
2814
- },
2815
- });
2816
-
2817
- // internal action: ingest a thing into knowledge
2818
- export const ingestThing = internalAction({
2819
- args: { id: v.id('things'), fields: v.optional(v.array(v.string())) },
2820
- handler: async (ctx, { id, fields }) => {
2821
- const thing = await ctx.runQuery(internal.entities.get, { id });
2822
- const texts = extractTexts(thing, fields);
2823
- let index = 0;
2824
- for (const t of chunk(texts, { size: 800, overlap: 200 })) {
2825
- const { embedding, model, dim } = await ctx.runAction(internal.rag.embedText, { text: t.text });
2826
- const knowledgeId = await ctx.runMutation(internal.rag.upsertKnowledge, {
2827
- item: {
2828
- knowledgeType: 'chunk', text: t.text, embedding, embeddingModel: model, embeddingDim: dim,
2829
- sourceThingId: id, sourceField: t.field, chunk: { index, tokenCount: t.tokens, overlap: 200 },
2830
- labels: t.labels,
2831
- },
2832
- });
2833
- await ctx.runMutation(internal.rag.linkThingKnowledge, { thingId: id, knowledgeId, role: 'chunk_of' });
2834
- index++;
2835
- }
2836
- },
2837
- });
2838
- ```
2839
-
2840
- This strategy keeps vectors first‑class without expanding primitives: knowledge absorbs both legacy tags (as labels) and semantic chunks (as embeddings).