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.
- package/README.md +28 -9
- package/dist/admin/build.d.ts +15 -0
- package/dist/admin/build.d.ts.map +1 -0
- package/dist/admin/build.js +295 -0
- package/dist/admin/build.js.map +1 -0
- package/dist/admin/index.d.ts +24 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +98 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/list.d.ts +14 -0
- package/dist/admin/list.d.ts.map +1 -0
- package/dist/admin/list.js +90 -0
- package/dist/admin/list.js.map +1 -0
- package/dist/admin/manifest.d.ts +86 -0
- package/dist/admin/manifest.d.ts.map +1 -0
- package/dist/admin/manifest.js +183 -0
- package/dist/admin/manifest.js.map +1 -0
- package/dist/admin/monorepo.d.ts +25 -0
- package/dist/admin/monorepo.d.ts.map +1 -0
- package/dist/admin/monorepo.js +59 -0
- package/dist/admin/monorepo.js.map +1 -0
- package/dist/admin/release.d.ts +17 -0
- package/dist/admin/release.d.ts.map +1 -0
- package/dist/admin/release.js +144 -0
- package/dist/admin/release.js.map +1 -0
- package/dist/admin/sync.d.ts +14 -0
- package/dist/admin/sync.d.ts.map +1 -0
- package/dist/admin/sync.js +104 -0
- package/dist/admin/sync.js.map +1 -0
- package/dist/admin/validate.d.ts +15 -0
- package/dist/admin/validate.d.ts.map +1 -0
- package/dist/admin/validate.js +169 -0
- package/dist/admin/validate.js.map +1 -0
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +44 -0
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/ask.d.ts +4 -0
- package/dist/commands/ask.d.ts.map +1 -0
- package/dist/commands/ask.js +8 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/bounty.d.ts +4 -0
- package/dist/commands/bounty.d.ts.map +1 -0
- package/dist/commands/bounty.js +24 -0
- package/dist/commands/bounty.js.map +1 -0
- package/dist/commands/capabilities.d.ts +4 -0
- package/dist/commands/capabilities.d.ts.map +1 -0
- package/dist/commands/capabilities.js +18 -0
- package/dist/commands/capabilities.js.map +1 -0
- package/dist/commands/claw.d.ts +4 -0
- package/dist/commands/claw.d.ts.map +1 -0
- package/dist/commands/claw.js +14 -0
- package/dist/commands/claw.js.map +1 -0
- package/dist/commands/commend.d.ts +4 -0
- package/dist/commands/commend.d.ts.map +1 -0
- package/dist/commands/commend.js +13 -0
- package/dist/commands/commend.js.map +1 -0
- package/dist/commands/completion.d.ts +4 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +49 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +4 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +78 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +4 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +10 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +72 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/export.d.ts +4 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +15 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/fade.d.ts +4 -0
- package/dist/commands/fade.d.ts.map +1 -0
- package/dist/commands/fade.js +15 -0
- package/dist/commands/fade.js.map +1 -0
- package/dist/commands/flag.d.ts +4 -0
- package/dist/commands/flag.d.ts.map +1 -0
- package/dist/commands/flag.js +13 -0
- package/dist/commands/flag.js.map +1 -0
- package/dist/commands/forget.d.ts +4 -0
- package/dist/commands/forget.d.ts.map +1 -0
- package/dist/commands/forget.js +16 -0
- package/dist/commands/forget.js.map +1 -0
- package/dist/commands/frontier.d.ts +4 -0
- package/dist/commands/frontier.d.ts.map +1 -0
- package/dist/commands/frontier.js +11 -0
- package/dist/commands/frontier.js.map +1 -0
- package/dist/commands/health.d.ts +4 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +11 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/highways.d.ts +4 -0
- package/dist/commands/highways.d.ts.map +1 -0
- package/dist/commands/highways.js +14 -0
- package/dist/commands/highways.js.map +1 -0
- package/dist/commands/hire.d.ts +4 -0
- package/dist/commands/hire.d.ts.map +1 -0
- package/dist/commands/hire.js +16 -0
- package/dist/commands/hire.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +69 -42
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/know.d.ts +4 -0
- package/dist/commands/know.d.ts.map +1 -0
- package/dist/commands/know.js +8 -0
- package/dist/commands/know.js.map +1 -0
- package/dist/commands/launch.d.ts +4 -0
- package/dist/commands/launch.d.ts.map +1 -0
- package/dist/commands/launch.js +16 -0
- package/dist/commands/launch.js.map +1 -0
- package/dist/commands/mark.d.ts +4 -0
- package/dist/commands/mark.d.ts.map +1 -0
- package/dist/commands/mark.js +15 -0
- package/dist/commands/mark.js.map +1 -0
- package/dist/commands/pay.d.ts +4 -0
- package/dist/commands/pay.d.ts.map +1 -0
- package/dist/commands/pay.js +21 -0
- package/dist/commands/pay.js.map +1 -0
- package/dist/commands/pipe.d.ts +4 -0
- package/dist/commands/pipe.d.ts.map +1 -0
- package/dist/commands/pipe.js +35 -0
- package/dist/commands/pipe.js.map +1 -0
- package/dist/commands/publish.d.ts +4 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +23 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/recall.d.ts +4 -0
- package/dist/commands/recall.d.ts.map +1 -0
- package/dist/commands/recall.js +12 -0
- package/dist/commands/recall.js.map +1 -0
- package/dist/commands/repl.d.ts +4 -0
- package/dist/commands/repl.d.ts.map +1 -0
- package/dist/commands/repl.js +56 -0
- package/dist/commands/repl.js.map +1 -0
- package/dist/commands/reveal.d.ts +4 -0
- package/dist/commands/reveal.d.ts.map +1 -0
- package/dist/commands/reveal.js +11 -0
- package/dist/commands/reveal.js.map +1 -0
- package/dist/commands/revenue.d.ts +4 -0
- package/dist/commands/revenue.d.ts.map +1 -0
- package/dist/commands/revenue.js +11 -0
- package/dist/commands/revenue.js.map +1 -0
- package/dist/commands/select.d.ts +4 -0
- package/dist/commands/select.d.ts.map +1 -0
- package/dist/commands/select.js +19 -0
- package/dist/commands/select.js.map +1 -0
- package/dist/commands/signal.d.ts +4 -0
- package/dist/commands/signal.d.ts.map +1 -0
- package/dist/commands/signal.js +8 -0
- package/dist/commands/signal.js.map +1 -0
- package/dist/commands/stats.d.ts +4 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +11 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +18 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +4 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +20 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/tail.d.ts +4 -0
- package/dist/commands/tail.d.ts.map +1 -0
- package/dist/commands/tail.js +51 -0
- package/dist/commands/tail.js.map +1 -0
- package/dist/commands/warn.d.ts +4 -0
- package/dist/commands/warn.d.ts.map +1 -0
- package/dist/commands/warn.js +15 -0
- package/dist/commands/warn.js.map +1 -0
- package/dist/create-org-profile.js +2 -2
- package/dist/create-user-profile.js +2 -2
- package/dist/index.js +135 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/args.d.ts +11 -0
- package/dist/lib/args.d.ts.map +1 -0
- package/dist/lib/args.js +57 -0
- package/dist/lib/args.js.map +1 -0
- package/dist/lib/config.d.ts +12 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +38 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/http.d.ts +9 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +25 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/output.d.ts +5 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +32 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/sdk.d.ts +10 -0
- package/dist/lib/sdk.d.ts.map +1 -0
- package/dist/lib/sdk.js +22 -0
- package/dist/lib/sdk.js.map +1 -0
- package/dist/lib/telemetry.d.ts +4 -0
- package/dist/lib/telemetry.d.ts.map +1 -0
- package/dist/lib/telemetry.js +61 -0
- package/dist/lib/telemetry.js.map +1 -0
- package/dist/utils/file-resolver.js +1 -3
- package/dist/utils/file-resolver.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +15 -0
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +71 -8
- package/dist/utils/installation-setup.js.map +1 -1
- package/package.json +5 -21
- package/.claude/agents/TROUBLESHOOTING.md +0 -530
- package/.claude/agents/agent-backend.md +0 -574
- package/.claude/agents/agent-builder.md +0 -911
- package/.claude/agents/agent-claude.md +0 -645
- package/.claude/agents/agent-clean.md +0 -477
- package/.claude/agents/agent-clone.md +0 -554
- package/.claude/agents/agent-designer.md +0 -1080
- package/.claude/agents/agent-director.md +0 -2254
- package/.claude/agents/agent-documenter.md +0 -688
- package/.claude/agents/agent-frontend.md +0 -1199
- package/.claude/agents/agent-integrator.md +0 -670
- package/.claude/agents/agent-lawyer.md +0 -1320
- package/.claude/agents/agent-news.md +0 -363
- package/.claude/agents/agent-onboard.md +0 -613
- package/.claude/agents/agent-ontology.md +0 -585
- package/.claude/agents/agent-ops.md +0 -1275
- package/.claude/agents/agent-problem-solver.md +0 -669
- package/.claude/agents/agent-quality.md +0 -1042
- package/.claude/agents/agent-sales.md +0 -507
- package/.claude/agents/agent-writer.md +0 -1068
- package/.claude/commands/cascade.md +0 -742
- package/.claude/commands/chat.md +0 -728
- package/.claude/commands/commit.md +0 -95
- package/.claude/commands/create.md +0 -544
- package/.claude/commands/deploy.md +0 -309
- package/.claude/commands/fast.md +0 -636
- package/.claude/commands/mcp-on.md +0 -191
- package/.claude/commands/media-upload.md +0 -186
- package/.claude/commands/news.md +0 -274
- package/.claude/commands/onboard.md +0 -440
- package/.claude/commands/one.md +0 -398
- package/.claude/commands/optimize.md +0 -74
- package/.claude/commands/plan.md +0 -719
- package/.claude/commands/push.md +0 -214
- package/.claude/commands/release.md +0 -105
- package/.claude/commands/review.md +0 -99
- package/.claude/commands/server.md +0 -487
- package/.claude/commands/start.md +0 -227
- package/.claude/commands/test.md +0 -197
- package/.claude/commands/validate.md +0 -140
- package/.claude/hooks/.last-news-context +0 -1
- package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
- package/.claude/hooks/README-knowledge-hooks.md +0 -451
- package/.claude/hooks/README-news-generation.md +0 -364
- package/.claude/hooks/README-root-cleanup.md +0 -200
- package/.claude/hooks/README.md +0 -284
- package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/auto-format.sh +0 -106
- package/.claude/hooks/check-filenames.py +0 -177
- package/.claude/hooks/clean-post.py +0 -468
- package/.claude/hooks/clean-pre.py +0 -393
- package/.claude/hooks/clean-root-markdown.sh +0 -73
- package/.claude/hooks/commit-push.sh +0 -95
- package/.claude/hooks/done.py +0 -236
- package/.claude/hooks/format-hook.sh +0 -163
- package/.claude/hooks/formatting.py +0 -187
- package/.claude/hooks/hook-logger.sh +0 -173
- package/.claude/hooks/knowledge-post.py +0 -355
- package/.claude/hooks/knowledge-pre.py +0 -245
- package/.claude/hooks/mcp-on.sh +0 -134
- package/.claude/hooks/notification-hook.sh +0 -279
- package/.claude/hooks/ontology-validation.py +0 -255
- package/.claude/hooks/push.sh +0 -153
- package/.claude/hooks/release-cli.sh +0 -205
- package/.claude/hooks/root-cleanup.py +0 -217
- package/.claude/hooks/security-hook.sh +0 -397
- package/.claude/hooks/tag-all-docs.py +0 -464
- package/.claude/hooks/test-validate-ontology.sh +0 -170
- package/.claude/hooks/todo.py +0 -368
- package/.claude/hooks/track-changes.sh +0 -101
- package/.claude/hooks/validate-imports.py +0 -182
- package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
- package/.claude/hooks/validate-ontology-structure.py +0 -558
- package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
- package/.claude/hooks/validate-ontology.py +0 -140
- package/.claude/hooks/write-news.sh +0 -194
- package/.claude/skills/INDEX.md +0 -523
- package/.claude/skills/REGISTRY.md +0 -529
- package/.claude/skills/agent-backend-create-mutation.md +0 -319
- package/.claude/skills/agent-designer-create-wireframe.md +0 -341
- package/.claude/skills/agent-frontend-create-page.md +0 -413
- package/.claude/skills/agents/README.md +0 -238
- package/.claude/skills/astro/add-content-collection.md +0 -30
- package/.claude/skills/astro/check-build.md +0 -29
- package/.claude/skills/astro/create-component.md +0 -29
- package/.claude/skills/astro/create-page.md +0 -30
- package/.claude/skills/astro/optimize-performance.md +0 -21
- package/.claude/skills/convex/check-deployment.md +0 -46
- package/.claude/skills/convex/create-mutation.md +0 -405
- package/.claude/skills/convex/create-query.md +0 -52
- package/.claude/skills/convex/read-schema.md +0 -373
- package/.claude/skills/convex/test-function.md +0 -50
- package/.claude/skills/deployment/check-deployment-health.md +0 -20
- package/.claude/skills/deployment/create-release.md +0 -21
- package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
- package/.claude/skills/deployment/deploy-convex.md +0 -30
- package/.claude/skills/deployment/sync-repositories.md +0 -19
- package/.claude/skills/design/check-accessibility.md +0 -21
- package/.claude/skills/design/create-component-spec.md +0 -27
- package/.claude/skills/design/generate-design-tokens.md +0 -24
- package/.claude/skills/design/generate-wireframe.md +0 -30
- package/.claude/skills/documentation/create-migration-guide.md +0 -20
- package/.claude/skills/documentation/generate-api-docs.md +0 -27
- package/.claude/skills/documentation/generate-readme.md +0 -22
- package/.claude/skills/documentation/update-knowledge.md +0 -20
- package/.claude/skills/integration/connect-external-system.md +0 -21
- package/.claude/skills/integration/implement-a2a.md +0 -20
- package/.claude/skills/integration/implement-acp.md +0 -20
- package/.claude/skills/integration/verify-integration.md +0 -20
- package/.claude/skills/ontology/README.md +0 -255
- package/.claude/skills/ontology/check-dimension.md +0 -307
- package/.claude/skills/ontology/generate-entity-type.md +0 -339
- package/.claude/skills/ontology/validate-schema.md +0 -229
- package/.claude/skills/ontology/verify-relationships.md +0 -310
- package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
- package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
- package/.claude/skills/problem-solving/propose-solution.md +0 -29
- package/.claude/skills/problem-solving/verify-fix.md +0 -21
- package/.claude/skills/sales/generate-demo-script.md +0 -21
- package/.claude/skills/sales/qualify-lead.md +0 -30
- package/.claude/skills/sales/track-trial.md +0 -20
- package/.claude/skills/sales/verify-kyc.md +0 -20
- package/.claude/skills/testing/analyze-coverage.md +0 -24
- package/.claude/skills/testing/generate-tests.md +0 -24
- package/.claude/skills/testing/run-tests.md +0 -27
- package/.claude/skills/testing/validate-e2e.md +0 -25
- package/AGENTS.md +0 -60
- package/CLAUDE.md +0 -321
- package/CREATE-WEBSITE.md +0 -458
- package/SECURITY.md +0 -31
- package/dist/commands/create-website.d.ts +0 -19
- package/dist/commands/create-website.d.ts.map +0 -1
- package/dist/commands/create-website.js +0 -231
- package/dist/commands/create-website.js.map +0 -1
- package/folders.yaml +0 -92
- package/one/README.md +0 -760
- package/one/connections/a2a.md +0 -600
- package/one/connections/acp.md +0 -808
- package/one/connections/acps.md +0 -749
- package/one/connections/agentkit.md +0 -367
- package/one/connections/agui.md +0 -785
- package/one/connections/any-backend.md +0 -1720
- package/one/connections/ap2.md +0 -1072
- package/one/connections/api/queries-reference.md +0 -860
- package/one/connections/api-docs.md +0 -1909
- package/one/connections/api-reference.md +0 -1029
- package/one/connections/api.md +0 -2208
- package/one/connections/architecture-diagram.md +0 -112
- package/one/connections/communications.md +0 -467
- package/one/connections/connections.md +0 -357
- package/one/connections/copilotkit.md +0 -1577
- package/one/connections/cryptonetworks.md +0 -799
- package/one/connections/documentation.md +0 -1138
- package/one/connections/effect.md +0 -297
- package/one/connections/elizaos.md +0 -1308
- package/one/connections/groups.md +0 -814
- package/one/connections/inference.md +0 -76
- package/one/connections/integration-examples.md +0 -893
- package/one/connections/integration-guide.md +0 -887
- package/one/connections/integration-phase2.md +0 -754
- package/one/connections/kyc.md +0 -650
- package/one/connections/mcp.md +0 -860
- package/one/connections/membership.md +0 -1170
- package/one/connections/middleware.md +0 -1085
- package/one/connections/multitenant.md +0 -1359
- package/one/connections/n8n.md +0 -1033
- package/one/connections/patterns.md +0 -107
- package/one/connections/protocols.md +0 -297
- package/one/connections/relationships.md +0 -125
- package/one/connections/schema.md +0 -605
- package/one/connections/service-layer.md +0 -568
- package/one/connections/vectors.md +0 -225
- package/one/connections/wordpress.md +0 -1320
- package/one/connections/workflow-copy.md +0 -923
- package/one/connections/workflow-examples.md +0 -759
- package/one/connections/workflow-onboarding.md +0 -701
- package/one/connections/workflow.md +0 -923
- package/one/connections/workflows/delegation.md +0 -903
- package/one/connections/workflows/frontend.md +0 -1055
- package/one/connections/workflows/strategy.md +0 -921
- package/one/connections/workflows/tasks.md +0 -716
- package/one/connections/x402-baazar.md +0 -131
- package/one/connections/x402.md +0 -1353
- package/one/groups/features.md +0 -2904
- package/one/groups/groups.md +0 -587
- package/one/groups/one.md +0 -619
- package/one/groups/strategy-copy.md +0 -887
- package/one/knowledge/.obsidian/app.json +0 -1
- package/one/knowledge/.obsidian/appearance.json +0 -1
- package/one/knowledge/.obsidian/core-plugins.json +0 -33
- package/one/knowledge/.obsidian/ecommerce-ontology.md +0 -210
- package/one/knowledge/.obsidian/workspace.json +0 -211
- package/one/knowledge/100-inference-quick-reference.md +0 -449
- package/one/knowledge/ag-ui-protocol.md +0 -613
- package/one/knowledge/agent-onboard-usage.md +0 -630
- package/one/knowledge/agentic-commerce.md +0 -146
- package/one/knowledge/ai-agents-vs-memecoins-thesis.md +0 -683
- package/one/knowledge/ai-api-reference.md +0 -715
- package/one/knowledge/ai-platform.md +0 -323
- package/one/knowledge/ai-quickstart.md +0 -355
- package/one/knowledge/ai-sdk-implementation.md +0 -436
- package/one/knowledge/ai-token-crypto-analysis-framework.md +0 -1191
- package/one/knowledge/ai-token-paradigm-shift-2025.md +0 -732
- package/one/knowledge/altcoin-cycle-prediction-ontology.md +0 -884
- package/one/knowledge/altcoin-cycle-trading-strategy.md +0 -642
- package/one/knowledge/architecture-any-backend.md +0 -1589
- package/one/knowledge/architecture-diagram.md +0 -404
- package/one/knowledge/architecture-frontend.md +0 -1014
- package/one/knowledge/architecture.md +0 -1742
- package/one/knowledge/archived/ontology.old.md +0 -2840
- package/one/knowledge/astro-effect-complete-vision.md +0 -2148
- package/one/knowledge/astro-effect-simple-architecture.md +0 -750
- package/one/knowledge/audit-agent-onboard-alignment.md +0 -481
- package/one/knowledge/audit-agent-sales-alignment.md +0 -444
- package/one/knowledge/backend-api-reference.md +0 -728
- package/one/knowledge/cascading-context-specification.md +0 -1617
- package/one/knowledge/claude-code-integration.md +0 -1293
- package/one/knowledge/cli-claude-handoff.md +0 -736
- package/one/knowledge/context-engineering.md +0 -610
- package/one/knowledge/crypto-analysis-strategy.md +0 -1276
- package/one/knowledge/crypto-cycle-2024-2025-analysis.md +0 -44
- package/one/knowledge/crypto.md +0 -978
- package/one/knowledge/develop/design.md +0 -364
- package/one/knowledge/develop/index.md +0 -145
- package/one/knowledge/development-commands.md +0 -251
- package/one/knowledge/docs.md +0 -627
- package/one/knowledge/dsl.md +0 -1678
- package/one/knowledge/event-driven-documentation.md +0 -270
- package/one/knowledge/files.md +0 -2489
- package/one/knowledge/frontend.md +0 -1056
- package/one/knowledge/games-english.md +0 -691
- package/one/knowledge/games.md +0 -1082
- package/one/knowledge/generative-ui-patterns.md +0 -559
- package/one/knowledge/guidelines.md +0 -314
- package/one/knowledge/hono.md +0 -2127
- package/one/knowledge/implementation-examples.md +0 -2554
- package/one/knowledge/installation-folders.md +0 -366
- package/one/knowledge/institutional-cycle-paradigm-2025.md +0 -555
- package/one/knowledge/knowledge.md +0 -660
- package/one/knowledge/language.md +0 -998
- package/one/knowledge/lessons-learned.md +0 -378
- package/one/knowledge/lessons-website-building-focus.md +0 -382
- package/one/knowledge/merge-report.md +0 -254
- package/one/knowledge/metadata-system.md +0 -504
- package/one/knowledge/nine-padel-playbook.md +0 -229
- package/one/knowledge/one-protocol-ai-agents.md +0 -892
- package/one/knowledge/one-protocol-executive-report.md +0 -617
- package/one/knowledge/one-protocol-standard.md +0 -869
- package/one/knowledge/one-protocol-whitepaper.md +0 -756
- package/one/knowledge/ontology-blog.yaml +0 -47
- package/one/knowledge/ontology-cheatsheet.md +0 -617
- package/one/knowledge/ontology-community.yaml +0 -65
- package/one/knowledge/ontology-core-universal.md +0 -740
- package/one/knowledge/ontology-core.yaml +0 -63
- package/one/knowledge/ontology-courses.yaml +0 -76
- package/one/knowledge/ontology-creator.md +0 -402
- package/one/knowledge/ontology-crypto.md +0 -1603
- package/one/knowledge/ontology-developer-guide.md +0 -814
- package/one/knowledge/ontology-documentation.md +0 -377
- package/one/knowledge/ontology-ecommerce.md +0 -269
- package/one/knowledge/ontology-education-game.md +0 -1654
- package/one/knowledge/ontology-education.md +0 -938
- package/one/knowledge/ontology-engineering-specification.md +0 -1310
- package/one/knowledge/ontology-engineering.md +0 -1676
- package/one/knowledge/ontology-files.yaml +0 -525
- package/one/knowledge/ontology-frontend-master.md +0 -2898
- package/one/knowledge/ontology-frontend-specifications.md +0 -2196
- package/one/knowledge/ontology-frontend.md +0 -2475
- package/one/knowledge/ontology-index.md +0 -397
- package/one/knowledge/ontology-minimal.yaml +0 -301
- package/one/knowledge/ontology-portfolio.yaml +0 -45
- package/one/knowledge/ontology-quickstart.md +0 -602
- package/one/knowledge/ontology-release.md +0 -317
- package/one/knowledge/ontology-shop.yaml +0 -148
- package/one/knowledge/ontology-tokens.yaml +0 -51
- package/one/knowledge/ontology-tutorial.md +0 -455
- package/one/knowledge/ontology-v2.md +0 -4449
- package/one/knowledge/ontology-video-script.md +0 -939
- package/one/knowledge/ontology-visual-guide.md +0 -378
- package/one/knowledge/ontology.md +0 -3847
- package/one/knowledge/ontology.yaml +0 -1653
- package/one/knowledge/parallel-agents.md +0 -932
- package/one/knowledge/patterns/backend/convex-mutation-pattern.md +0 -130
- package/one/knowledge/patterns/backend/convex-query-pattern.md +0 -143
- package/one/knowledge/patterns/backend/mutation-template.md +0 -249
- package/one/knowledge/patterns/backend/query-template.md +0 -286
- package/one/knowledge/patterns/backend/service-template.md +0 -258
- package/one/knowledge/patterns/design/component-architecture.md +0 -435
- package/one/knowledge/patterns/design/index.md +0 -160
- package/one/knowledge/patterns/design/test-driven-design-pattern.md +0 -196
- package/one/knowledge/patterns/design/wireframe-template.md +0 -250
- package/one/knowledge/patterns/frontend/component-template.md +0 -246
- package/one/knowledge/patterns/frontend/form-template.md +0 -348
- package/one/knowledge/patterns/frontend/page-template.md +0 -209
- package/one/knowledge/patterns/frontend/react-component-pattern.md +0 -188
- package/one/knowledge/patterns/test/acceptance-criteria-template.md +0 -396
- package/one/knowledge/patterns/test/technical-test-template.md +0 -566
- package/one/knowledge/patterns/test/test-driven-pattern.md +0 -160
- package/one/knowledge/patterns/test/user-flow-template.md +0 -272
- package/one/knowledge/performance.md +0 -459
- package/one/knowledge/provider-agnostic-content.md +0 -995
- package/one/knowledge/provider-creation-guide.md +0 -1082
- package/one/knowledge/quality-loop.md +0 -419
- package/one/knowledge/quick-start-ontology-mapping.md +0 -773
- package/one/knowledge/readme-architecture.md +0 -158
- package/one/knowledge/readme.md +0 -149
- package/one/knowledge/rules.md +0 -644
- package/one/knowledge/score.md +0 -85
- package/one/knowledge/specifications.md +0 -873
- package/one/knowledge/tags.md +0 -148
- package/one/knowledge/todo-template.md +0 -269
- package/one/knowledge/todo.md +0 -269
- package/one/knowledge/troubleshooting.md +0 -434
- package/one/knowledge/typescript-patterns.md +0 -321
- package/one/knowledge/universal-generation-language.md +0 -827
- package/one/knowledge/x402-research.md +0 -104
- package/one/license.md +0 -107
- package/one/people/anthony-o-connell.md +0 -469
- package/one/people/people.md +0 -590
- package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
- package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
- package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
- package/one/things/CHECKLIST.md +0 -407
- package/one/things/IMPLEMENTATION_STATUS.md +0 -379
- package/one/things/ONE.md +0 -529
- package/one/things/agents/agent-backend.md +0 -1501
- package/one/things/agents/agent-builder.md +0 -1064
- package/one/things/agents/agent-clean.md +0 -1112
- package/one/things/agents/agent-clone.md +0 -1324
- package/one/things/agents/agent-deploy.md +0 -986
- package/one/things/agents/agent-designer.md +0 -2305
- package/one/things/agents/agent-director.md +0 -1526
- package/one/things/agents/agent-documenter.md +0 -1129
- package/one/things/agents/agent-frontend.md +0 -1201
- package/one/things/agents/agent-integrator.md +0 -1269
- package/one/things/agents/agent-lawyer.md +0 -1371
- package/one/things/agents/agent-problem-solver.md +0 -1457
- package/one/things/agents/agent-quality.md +0 -1483
- package/one/things/agents/agent-sales.md +0 -1074
- package/one/things/cascade/cascade.yaml +0 -481
- package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
- package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
- package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
- package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
- package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
- package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
- package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
- package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
- package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
- package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
- package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
- package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
- package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
- package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
- package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
- package/one/things/cascade/docs/examples/readme.md +0 -259
- package/one/things/cascade/docs/getting-started.md +0 -533
- package/one/things/cascade/docs/workflow.md +0 -1378
- package/one/things/cascade/readme.md +0 -379
- package/one/things/cascade/templates/feature-template.md +0 -289
- package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
- package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
- package/one/things/claude/agents/analyst.md +0 -508
- package/one/things/claude/agents/architect.md +0 -505
- package/one/things/claude/agents/brand-identity-specialist.md +0 -538
- package/one/things/claude/agents/bstp-token-strategist.md +0 -690
- package/one/things/claude/agents/builder-repo.md +0 -532
- package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
- package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
- package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
- package/one/things/claude/agents/company-bullstamp-character.md +0 -602
- package/one/things/claude/agents/company-bullstamp-community.md +0 -307
- package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
- package/one/things/claude/agents/company-bullstamp-token.md +0 -307
- package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
- package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
- package/one/things/claude/agents/content-calendar-planner.md +0 -473
- package/one/things/claude/agents/content-chapter-formatter.md +0 -513
- package/one/things/claude/agents/content-formatter.md +0 -571
- package/one/things/claude/agents/content-hook-specialist.md +0 -485
- package/one/things/claude/agents/content-image-formatter.md +0 -560
- package/one/things/claude/agents/content-introduction-formatter.md +0 -510
- package/one/things/claude/agents/content-multiplication-engine.md +0 -579
- package/one/things/claude/agents/content-playbook-writer.md +0 -473
- package/one/things/claude/agents/content-team-manager.md +0 -647
- package/one/things/claude/agents/content-toc-formatter.md +0 -547
- package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
- package/one/things/claude/agents/core-manager.md +0 -607
- package/one/things/claude/agents/core-master.md +0 -426
- package/one/things/claude/agents/cross-functional-manager.md +0 -476
- package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
- package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
- package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
- package/one/things/claude/agents/crypto-community-analyst.md +0 -314
- package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
- package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
- package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
- package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
- package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
- package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
- package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
- package/one/things/claude/agents/crypto-market-researcher.md +0 -307
- package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
- package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
- package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
- package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
- package/one/things/claude/agents/crypto-team-manager.md +0 -392
- package/one/things/claude/agents/crypto-token-analyst.md +0 -319
- package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
- package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
- package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
- package/one/things/claude/agents/customer-journey-designer.md +0 -474
- package/one/things/claude/agents/customer-success-manager.md +0 -574
- package/one/things/claude/agents/dev.md +0 -406
- package/one/things/claude/agents/documenter.md +0 -548
- package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
- package/one/things/claude/agents/engagement-specialist.md +0 -502
- package/one/things/claude/agents/engineering-architect.md +0 -387
- package/one/things/claude/agents/engineering-business-analyst.md +0 -527
- package/one/things/claude/agents/engineering-developer.md +0 -386
- package/one/things/claude/agents/engineering-director.md +0 -322
- package/one/things/claude/agents/engineering-ingestor.md +0 -659
- package/one/things/claude/agents/engineering-product-manager.md +0 -525
- package/one/things/claude/agents/engineering-product-owner.md +0 -527
- package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
- package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
- package/one/things/claude/agents/engineering-team-manager.md +0 -515
- package/one/things/claude/agents/engineering-user-experience.md +0 -386
- package/one/things/claude/agents/framework-elevate-manager.md +0 -309
- package/one/things/claude/agents/improver.md +0 -805
- package/one/things/claude/agents/intelligence-team-manager.md +0 -390
- package/one/things/claude/agents/lead-capture-expert.md +0 -459
- package/one/things/claude/agents/lead-magnet-creator.md +0 -446
- package/one/things/claude/agents/market-research-analyst.md +0 -435
- package/one/things/claude/agents/marketing-brand-identity.md +0 -344
- package/one/things/claude/agents/marketing-content-hooks.md +0 -455
- package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
- package/one/things/claude/agents/marketing-content-poster.md +0 -372
- package/one/things/claude/agents/marketing-customer-journey.md +0 -331
- package/one/things/claude/agents/marketing-director.md +0 -402
- package/one/things/claude/agents/marketing-engagement.md +0 -331
- package/one/things/claude/agents/marketing-lead-capture.md +0 -331
- package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
- package/one/things/claude/agents/marketing-network-effects.md +0 -331
- package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
- package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
- package/one/things/claude/agents/marketing-team-manager.md +0 -451
- package/one/things/claude/agents/marketing-viral-growth.md +0 -232
- package/one/things/claude/agents/mission-commander.md +0 -378
- package/one/things/claude/agents/network-effect-analyst.md +0 -604
- package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
- package/one/things/claude/agents/npx.md +0 -946
- package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
- package/one/things/claude/agents/one-master.md +0 -378
- package/one/things/claude/agents/one-orchestrator.md +0 -345
- package/one/things/claude/agents/one.md +0 -658
- package/one/things/claude/agents/playbook-generator.md +0 -526
- package/one/things/claude/agents/pm.md +0 -349
- package/one/things/claude/agents/po.md +0 -370
- package/one/things/claude/agents/qa.md +0 -361
- package/one/things/claude/agents/research-foundation-analyst.md +0 -324
- package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
- package/one/things/claude/agents/research-market-analyst.md +0 -324
- package/one/things/claude/agents/research-team-manager.md +0 -489
- package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
- package/one/things/claude/agents/sales-team-manager.md +0 -407
- package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
- package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
- package/one/things/claude/agents/service-advocacy-manager.md +0 -324
- package/one/things/claude/agents/service-success-manager.md +0 -324
- package/one/things/claude/agents/service-team-manager.md +0 -405
- package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
- package/one/things/claude/agents/share-optimization-specialist.md +0 -576
- package/one/things/claude/agents/sm.md +0 -352
- package/one/things/claude/agents/story-teller.md +0 -498
- package/one/things/claude/agents/task-master.md +0 -621
- package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
- package/one/things/claude/agents/tester.md +0 -595
- package/one/things/claude/agents/the-bull-character-manager.md +0 -603
- package/one/things/claude/agents/tools-playbook-generator.md +0 -492
- package/one/things/claude/agents/turbo-repo-builder.md +0 -346
- package/one/things/claude/agents/upsell-strategist.md +0 -503
- package/one/things/claude/agents/ux-expert.md +0 -360
- package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
- package/one/things/claude/claude-code-hooks-development.json +0 -21
- package/one/things/claude/claude-code-hooks-production.json +0 -21
- package/one/things/claude/claude-code-hooks.json +0 -25
- package/one/things/claude/commands/agent.md +0 -124
- package/one/things/claude/commands/cascade-status.md +0 -153
- package/one/things/claude/commands/ingest.md +0 -343
- package/one/things/claude/commands/ingestor.md +0 -158
- package/one/things/claude/commands/mission.md +0 -103
- package/one/things/claude/commands/npx.md +0 -156
- package/one/things/claude/commands/one.md +0 -486
- package/one/things/claude/commands/quality-check.md +0 -252
- package/one/things/claude/commands/smart-route.md +0 -261
- package/one/things/claude/commands/start.md +0 -139
- package/one/things/claude/commands/story.md +0 -103
- package/one/things/claude/commands/task.md +0 -193
- package/one/things/claude/hook-bypass.json +0 -32
- package/one/things/claude/hooks/agent-hook-config.json +0 -427
- package/one/things/claude/hooks/build-hook.sh +0 -156
- package/one/things/claude/hooks/cleanup-hook.sh +0 -201
- package/one/things/claude/hooks/file-organization-hook.sh +0 -80
- package/one/things/claude/hooks/format-hook.sh +0 -43
- package/one/things/claude/hooks/hook-bypass.sh +0 -293
- package/one/things/claude/hooks/hook-debouncer.sh +0 -62
- package/one/things/claude/hooks/hook-logger.sh +0 -89
- package/one/things/claude/hooks/lint-hook.sh +0 -140
- package/one/things/claude/hooks/notification-hook.sh +0 -204
- package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
- package/one/things/claude/hooks/performance-metrics.json +0 -25
- package/one/things/claude/hooks/security-hook.sh +0 -256
- package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
- package/one/things/claude/hooks/story-validation-hook.sh +0 -145
- package/one/things/claude/hooks/test-hook.sh +0 -145
- package/one/things/claude/hooks/test-story-validation.sh +0 -170
- package/one/things/claude/settings-local.json +0 -86
- package/one/things/cli/cli-code.md +0 -677
- package/one/things/cli/cli-compiler-code.md +0 -677
- package/one/things/cli/cli.md +0 -871
- package/one/things/components/card-shadcn.md +0 -953
- package/one/things/components/card.md +0 -1041
- package/one/things/components.md +0 -1743
- package/one/things/componets.md +0 -19
- package/one/things/contracts/Move.toml +0 -12
- package/one/things/contracts/README.md +0 -288
- package/one/things/contracts/one.move +0 -762
- package/one/things/contracts/sdk.ts +0 -578
- package/one/things/creator-diagram.md +0 -184
- package/one/things/crypto/FEATURES.md +0 -78
- package/one/things/crypto/ONECORE.md +0 -62
- package/one/things/crypto/ONECOREFAQ.md +0 -22
- package/one/things/crypto/ONECOREHOW.md +0 -46
- package/one/things/crypto/ONEENTERPRISE.md +0 -64
- package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
- package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
- package/one/things/crypto/ONEPRO.md +0 -60
- package/one/things/crypto/ONEPROFAQ.md +0 -22
- package/one/things/crypto/ONEPROHOW.md +0 -53
- package/one/things/crypto/READMEAGENCY.md +0 -64
- package/one/things/crypto/VSL.md +0 -45
- package/one/things/crypto/WebsiteCopy.md +0 -176
- package/one/things/demo-accessibility-animations.md +0 -1025
- package/one/things/demo-components.md +0 -1310
- package/one/things/demo-design-summary.md +0 -692
- package/one/things/demo-design-system.md +0 -973
- package/one/things/demo-page-layouts.md +0 -1016
- package/one/things/design-system.md +0 -832
- package/one/things/designs/accessibility-audit.md +0 -877
- package/one/things/designs/component-specifications.md +0 -855
- package/one/things/designs/design-overview.md +0 -377
- package/one/things/designs/design-tokens.md +0 -448
- package/one/things/designs/wireframes-dashboard.md +0 -710
- package/one/things/docs/api-requests.md +0 -987
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
- package/one/things/docs/ecommerce/QUICK-START.md +0 -405
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
- package/one/things/docs/ecommerce/demo.astro +0 -309
- package/one/things/examples/children/lemonade-stand.md +0 -404
- package/one/things/examples/enterprise/crm-saas.md +0 -1444
- package/one/things/features/1-1-agent-prompts.md +0 -562
- package/one/things/features/1-2-yaml-orchestrator.md +0 -548
- package/one/things/features/1-3-event-coordination.md +0 -547
- package/one/things/features/1-4-knowledge-management.md +0 -652
- package/one/things/features/1-5-quality-loops.md +0 -725
- package/one/things/features/1-6-numbering-structure.md +0 -639
- package/one/things/features/2-1-dataprovider-interface.md +0 -2583
- package/one/things/features/2-2-config-system.md +0 -3242
- package/one/things/features/2-3-effectts-services.md +0 -1645
- package/one/things/features/2-4-react-hooks.md +0 -2136
- package/one/things/features/2-5-auth-migration.md +0 -2144
- package/one/things/features/2-6-dashboard-migration.md +0 -2084
- package/one/things/features/2-7-alternative-providers.md +0 -2578
- package/one/things/features/2-7-implementation-report.md +0 -724
- package/one/things/features/2-cli.md +0 -1720
- package/one/things/features/2-design.md +0 -1770
- package/one/things/features/2-tests.md +0 -576
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
- package/one/things/features/DECOUPLING.md +0 -290
- package/one/things/features/DEPLOYMENT.md +0 -470
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
- package/one/things/features/improve.md +0 -861
- package/one/things/features/remove-convex-deps.md +0 -63
- package/one/things/features/top-features.md +0 -87
- package/one/things/features/use-one-backend.md +0 -1217
- package/one/things/features-in-english.md +0 -200
- package/one/things/files.yaml +0 -721
- package/one/things/ideas/1-create-workflow.md +0 -207
- package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
- package/one/things/implementation/backend-guide.md +0 -457
- package/one/things/interface.md +0 -257
- package/one/things/landing-page-implementation.md +0 -455
- package/one/things/legal/README.md +0 -234
- package/one/things/legal/privacy-policy.md +0 -1227
- package/one/things/legal/terms-of-service.md +0 -1432
- package/one/things/master-workflow-plan.md +0 -806
- package/one/things/pay.one.ie.md +0 -53
- package/one/things/plans/0-in-sync.md +0 -136
- package/one/things/plans/0-timeline.md +0 -36
- package/one/things/plans/1-create-workflow.md +0 -732
- package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
- package/one/things/plans/README-SIMPLIFICATION.md +0 -349
- package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
- package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
- package/one/things/plans/ai-elements-integration.md +0 -483
- package/one/things/plans/ai-elements.md +0 -1278
- package/one/things/plans/ai-integration-plan.md +0 -263
- package/one/things/plans/ai-integration.md +0 -996
- package/one/things/plans/ai-sdk.md +0 -798
- package/one/things/plans/ai-tools.md +0 -621
- package/one/things/plans/app.md +0 -832
- package/one/things/plans/architecture-summary.md +0 -312
- package/one/things/plans/async-ai-agents.md +0 -233
- package/one/things/plans/backend-agnostic-frontend.md +0 -390
- package/one/things/plans/backend-cleanup-quickstart.md +0 -380
- package/one/things/plans/backend-ontology-conformance.md +0 -475
- package/one/things/plans/backend-status.md +0 -599
- package/one/things/plans/backend-structure.md +0 -847
- package/one/things/plans/backend-target-structure.md +0 -482
- package/one/things/plans/backend.md +0 -1175
- package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
- package/one/things/plans/better-auth-any-backend.md +0 -1896
- package/one/things/plans/better-auth-available-features.md +0 -273
- package/one/things/plans/big-plan.md +0 -52
- package/one/things/plans/cli-updates-required.md +0 -320
- package/one/things/plans/complete-step-by-step.md +0 -1409
- package/one/things/plans/components.md +0 -709
- package/one/things/plans/convex-agents.md +0 -1034
- package/one/things/plans/convex-better-auth.md +0 -1141
- package/one/things/plans/convex-on-off.md +0 -407
- package/one/things/plans/crypto-token-researcher.md +0 -629
- package/one/things/plans/data-quality-metrics.md +0 -745
- package/one/things/plans/deep-researcher-agent.md +0 -466
- package/one/things/plans/deploy-to-cloudflare.md +0 -623
- package/one/things/plans/deployment-architecture.md +0 -469
- package/one/things/plans/desktop.md +0 -1139
- package/one/things/plans/development-plan.md +0 -1283
- package/one/things/plans/development-workflow-tldr.md +0 -207
- package/one/things/plans/development-workflow.md +0 -959
- package/one/things/plans/dsl-claude-code.md +0 -1011
- package/one/things/plans/effect-components.md +0 -1743
- package/one/things/plans/effect-patterns-reference.md +0 -2235
- package/one/things/plans/effect.md +0 -1806
- package/one/things/plans/email.md +0 -966
- package/one/things/plans/enhance-auth.md +0 -1692
- package/one/things/plans/execution-strategy.md +0 -1291
- package/one/things/plans/existing-infrastructure.md +0 -712
- package/one/things/plans/feature-based-sites.md +0 -894
- package/one/things/plans/frontend-effects.md +0 -1276
- package/one/things/plans/group-folder-multi-tenancy.md +0 -893
- package/one/things/plans/improve-codebase.md +0 -1811
- package/one/things/plans/install-components.md +0 -215
- package/one/things/plans/integrate-frontend-and-backend.md +0 -603
- package/one/things/plans/landing.md +0 -820
- package/one/things/plans/layout.md +0 -249
- package/one/things/plans/mail-backend.md +0 -1361
- package/one/things/plans/mail.md +0 -2677
- package/one/things/plans/mcp-clear-context-prompt.md +0 -81
- package/one/things/plans/mcp-simple.md +0 -248
- package/one/things/plans/multi-ontology-architecture.md +0 -885
- package/one/things/plans/next-features.md +0 -114
- package/one/things/plans/npx-agent-safety.md +0 -785
- package/one/things/plans/npx-agent.md +0 -1089
- package/one/things/plans/onboarding.md +0 -51
- package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
- package/one/things/plans/one.md +0 -677
- package/one/things/plans/ontology-6-dimensions.md +0 -2201
- package/one/things/plans/ontology-compliance-audit.md +0 -342
- package/one/things/plans/ontology-driven-strategy.md +0 -882
- package/one/things/plans/ontology-refine.md +0 -586
- package/one/things/plans/ontology-ui-approach.md +0 -375
- package/one/things/plans/open-agent.md +0 -840
- package/one/things/plans/performace.md +0 -122
- package/one/things/plans/phase-1-foundation.md +0 -620
- package/one/things/plans/phase-3-implementation.md +0 -1037
- package/one/things/plans/plan-connect-to-api.md +0 -146
- package/one/things/plans/quick-wins.md +0 -1428
- package/one/things/plans/r2.md +0 -777
- package/one/things/plans/readme-backend-cleanup.md +0 -402
- package/one/things/plans/release.md +0 -507
- package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
- package/one/things/plans/repos.md +0 -98
- package/one/things/plans/separate-copy-2.md +0 -1349
- package/one/things/plans/separate-copy-3.md +0 -2479
- package/one/things/plans/separate-copy.md +0 -1349
- package/one/things/plans/separate-demo.md +0 -864
- package/one/things/plans/separate.md +0 -1999
- package/one/things/plans/sequence.md +0 -2040
- package/one/things/plans/shadcn-integration-summary.md +0 -510
- package/one/things/plans/sidebar.md +0 -206
- package/one/things/plans/skills.md +0 -709
- package/one/things/plans/small-fixes.md +0 -23
- package/one/things/plans/start-new.md +0 -764
- package/one/things/plans/switch-off-auth.md +0 -42
- package/one/things/plans/sync-checklist.md +0 -351
- package/one/things/plans/test-backend-connection.md +0 -514
- package/one/things/plans/unified-implementation-plan.md +0 -934
- package/one/things/plans/update-demos.md +0 -581
- package/one/things/plans/use-our-backend.md +0 -572
- package/one/things/plans/video-backend.md +0 -638
- package/one/things/plans/video-frontend.md +0 -490
- package/one/things/plans/video-old-archived.md +0 -656
- package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
- package/one/things/plans/wave1-onboarding-vision.md +0 -744
- package/one/things/plans/wave1-orchestration-summary.md +0 -604
- package/one/things/plans/wave1-specialist-assignments.md +0 -1413
- package/one/things/plans/workflow-files.md +0 -1210
- package/one/things/plans/workflow.md +0 -1378
- package/one/things/plans-u.md +0 -905
- package/one/things/products/Blockchain Products.md +0 -6278
- package/one/things/products/cascade-landing-page.md +0 -841
- package/one/things/products/cascade.md +0 -1568
- package/one/things/products/context-engineering.md +0 -1488
- package/one/things/products/onthology.md +0 -15
- package/one/things/products/ontology-ui-shadcn.md +0 -1302
- package/one/things/products/ontology-ui.md +0 -1429
- package/one/things/products/ontology.md +0 -789
- package/one/things/products/sdk.md +0 -573
- package/one/things/promptkit.md +0 -930
- package/one/things/repos/all-repos.md +0 -0
- package/one/things/scripts-clean-mac.sh +0 -409
- package/one/things/service-providers-new.md +0 -1052
- package/one/things/service-providers.md +0 -1121
- package/one/things/structure.md +0 -532
- package/one/things/system.md +0 -618
- package/one/things/templates.md +0 -294
- package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
- package/one/things/tests/2-1-test-analysis.md +0 -544
- package/one/things/things.md +0 -384
- package/one/things/todo-acp-integration.md +0 -744
- package/one/things/todo-ai.md +0 -933
- package/one/things/todo-api.md +0 -1078
- package/one/things/todo-assignment.md +0 -580
- package/one/things/todo-buy-chatgpt.md +0 -1450
- package/one/things/todo-components.md +0 -1683
- package/one/things/todo-connections.md +0 -278
- package/one/things/todo-ecommerce-frontend.md +0 -1313
- package/one/things/todo-ecommerce.md +0 -569
- package/one/things/todo-effects.md +0 -1075
- package/one/things/todo-frontend-effects.md +0 -977
- package/one/things/todo-landing-page.md +0 -1091
- package/one/things/todo-mail.md +0 -1160
- package/one/things/todo-master-plan.md +0 -490
- package/one/things/todo-onboard.md +0 -666
- package/one/things/todo-one-ie.md +0 -538
- package/one/things/todo-page.md +0 -606
- package/one/things/todo-plans.md +0 -282
- package/one/things/todo-projects.md +0 -241
- package/one/things/todo-refactoring-plan.md +0 -366
- package/one/things/todo-release.md +0 -654
- package/one/things/todo-sequence.md +0 -1621
- package/one/things/todo-use-our-backend.md +0 -1908
- package/one/things/todo-workflow.md +0 -626
- package/one/things/todo-x402.md +0 -2047
- package/one/things/todo.md +0 -21
- package/one/things/video/scripts-crypto.md +0 -835
- package/one/things/video-script-backup.md +0 -318
- package/one/things/video-script-demo.md +0 -382
- package/one/things/video-script-ontology.md +0 -333
- package/one/things/video-script.md +0 -361
|
@@ -1,3847 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Ontology
|
|
3
|
-
dimension: knowledge
|
|
4
|
-
category: ontology.md
|
|
5
|
-
tags: 6-dimensions, ai, architecture, ontology
|
|
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 ontology.md category.
|
|
13
|
-
Location: one/knowledge/ontology.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.
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# ONE Platform - Ontology Specification
|
|
20
|
-
|
|
21
|
-
**Version:** 1.0.0 (Reality as DSL - The Universal Code Generation Language)
|
|
22
|
-
**Status:** Complete - Reality-Aware Architecture
|
|
23
|
-
**Design Principle:** This isn't just a data model. It's a Domain-Specific Language (DSL) that models reality itself, enabling 98% AI code generation accuracy through compound structure.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Why This Changes Everything
|
|
28
|
-
|
|
29
|
-
### The Breakthrough: Reality as DSL
|
|
30
|
-
|
|
31
|
-
**Most developers think databases model their application.**
|
|
32
|
-
|
|
33
|
-
We flipped this. **The 6-dimension ontology models reality itself**. Applications map to it.
|
|
34
|
-
|
|
35
|
-
This enables:
|
|
36
|
-
|
|
37
|
-
- **98% AI code generation accuracy** (not 30-70%)
|
|
38
|
-
- **Compound structure** (each feature makes the next MORE accurate, not less)
|
|
39
|
-
- **Universal feature import** (clone ANY system into the ontology)
|
|
40
|
-
- **Never breaks** (reality doesn't change, technology does)
|
|
41
|
-
|
|
42
|
-
### What AI Sees
|
|
43
|
-
|
|
44
|
-
**Traditional Codebase (Pattern Divergence):**
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
Feature 1: createUser(email) ────────┐
|
|
48
|
-
Feature 2: addProduct(name) ─────────┼─→ 100 patterns
|
|
49
|
-
Feature 3: registerCustomer(data) ───┤ AI confused
|
|
50
|
-
Feature 4: insertOrder(items) ───────┤ Accuracy: 30%
|
|
51
|
-
...each uses different approach
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**ONE Codebase (Pattern Convergence):**
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
Feature 1: provider.things.create({ type: "user" }) ────┐
|
|
58
|
-
Feature 2: provider.things.create({ type: "product" }) ─┼─→ 1 pattern
|
|
59
|
-
Feature 3: provider.things.create({ type: "customer" })─┤ AI masters it
|
|
60
|
-
Feature 4: provider.things.create({ type: "order" }) ───┤ Accuracy: 98%
|
|
61
|
-
...all use same pattern
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**The difference:** Traditional codebases teach AI 100 patterns (chaos). ONE teaches AI 1 pattern (mastery).
|
|
65
|
-
|
|
66
|
-
### Why This Never Breaks
|
|
67
|
-
|
|
68
|
-
**Reality is stable. Technology changes.**
|
|
69
|
-
|
|
70
|
-
The 6 dimensions model reality:
|
|
71
|
-
|
|
72
|
-
1. **Groups** - Containers exist (friend circles → governments)
|
|
73
|
-
2. **People** - Actors authorize (who can do what)
|
|
74
|
-
3. **Things** - Entities exist (users, products, courses, agents)
|
|
75
|
-
4. **Connections** - Relationships relate (owns, purchased, enrolled_in)
|
|
76
|
-
5. **Events** - Actions happen (created, updated, purchased)
|
|
77
|
-
6. **Knowledge** - Understanding emerges (embeddings, search, RAG)
|
|
78
|
-
|
|
79
|
-
These dimensions NEVER change because they model reality itself, not any specific technology.
|
|
80
|
-
|
|
81
|
-
**Examples of systems that map perfectly:**
|
|
82
|
-
|
|
83
|
-
- **Shopify** → Products (things), Orders (connections + events), Customers (people)
|
|
84
|
-
- **Moodle** → Courses (things), Enrollments (connections), Completions (events)
|
|
85
|
-
- **Stripe** → Payments (things), Transactions (connections + events), Customers (people)
|
|
86
|
-
- **WordPress** → Posts (things), Authors (people), Categories (knowledge labels)
|
|
87
|
-
|
|
88
|
-
**Every system maps to the same 6 dimensions.** That's why AI agents achieve 98% accuracy.
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Structure
|
|
93
|
-
|
|
94
|
-
This ontology is organized into 6 dimension files:
|
|
95
|
-
|
|
96
|
-
1. **[organisation.md](./organisation.md)** - Multi-tenant isolation & ownership
|
|
97
|
-
2. **[people.md](./people.md)** - Authorization, governance, & user customization
|
|
98
|
-
3. **[things.md](./things.md)** - 66 entity types (what exists)
|
|
99
|
-
4. **[connections.md](./connections.md)** - 25 relationship types (how they relate)
|
|
100
|
-
5. **[events.md](./events.md)** - 67 event types (what happened)
|
|
101
|
-
6. **[knowledge.md](./knowledge.md)** - Vectors, embeddings, RAG (what it means)
|
|
102
|
-
|
|
103
|
-
**Execution Guide:**
|
|
104
|
-
|
|
105
|
-
7. **[todo.md](./todo.md)** - 100-cycle execution sequence (plan in cycles, not days)
|
|
106
|
-
|
|
107
|
-
**This document (Ontology.md)** contains the complete technical specification. The consolidated files above provide focused summaries and patterns.
|
|
108
|
-
|
|
109
|
-
**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.
|
|
110
|
-
|
|
111
|
-
## The 6-Dimension Reality Model
|
|
112
|
-
|
|
113
|
-
**This is the universal interface.** Every feature in every system maps to these 6 dimensions.
|
|
114
|
-
|
|
115
|
-
**Every single thing in ONE platform exists within one of these 6 dimensions:**
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
119
|
-
│ 1. GROUPS │
|
|
120
|
-
│ Multi-tenant isolation with hierarchical nesting - who owns │
|
|
121
|
-
│ what at group level (friend circles → DAOs → governments) │
|
|
122
|
-
└──────────────────────────────────────────────────────────────┘
|
|
123
|
-
↓
|
|
124
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
125
|
-
│ 2. PEOPLE │
|
|
126
|
-
│ Authorization & governance - platform owner, group owners │
|
|
127
|
-
└──────────────────────────────────────────────────────────────┘
|
|
128
|
-
↓
|
|
129
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
130
|
-
│ 3. THINGS │
|
|
131
|
-
│ Every "thing" - users, agents, content, tokens, courses │
|
|
132
|
-
└──────────────────────────────────────────────────────────────┘
|
|
133
|
-
↓
|
|
134
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
135
|
-
│ 4. CONNECTIONS │
|
|
136
|
-
│ Every relationship - owns, follows, taught_by, powers │
|
|
137
|
-
└──────────────────────────────────────────────────────────────┘
|
|
138
|
-
↓
|
|
139
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
140
|
-
│ 5. EVENTS │
|
|
141
|
-
│ Every action - purchased, created, viewed, completed │
|
|
142
|
-
└──────────────────────────────────────────────────────────────┘
|
|
143
|
-
↓
|
|
144
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
145
|
-
│ 6. KNOWLEDGE │
|
|
146
|
-
│ Labels + chunks + vectors powering RAG & search │
|
|
147
|
-
└──────────────────────────────────────────────────────────────┘
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
**The Universal Interface (How Technology Implements the Ontology):**
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
┌─────────────────────────────────────────────────────────────────────┐
|
|
154
|
-
│ LAYER 1: UNIVERSAL INTERFACE │
|
|
155
|
-
│ (The 6-Dimension DSL) │
|
|
156
|
-
├─────────────────────────────────────────────────────────────────────┤
|
|
157
|
-
│ groups → Hierarchical containers (friend circles → governments)│
|
|
158
|
-
│ people → Authorization & governance (who can do what) │
|
|
159
|
-
│ things → All entities (66 types: user, product, course...) │
|
|
160
|
-
│ connections → All relationships (25 types: owns, purchased...) │
|
|
161
|
-
│ events → All actions (67 types: created, updated, logged...) │
|
|
162
|
-
│ knowledge → AI understanding (embeddings, search, RAG) │
|
|
163
|
-
│ │
|
|
164
|
-
│ This layer NEVER changes. It models reality. │
|
|
165
|
-
└──────────────────┬──────────────────────────────────────────────────┘
|
|
166
|
-
│
|
|
167
|
-
↓ Technology changes, ontology stays the same
|
|
168
|
-
|
|
169
|
-
┌─────────────────────────────────────────────────────────────────────┐
|
|
170
|
-
│ TECHNOLOGY ADAPTERS (swap freely) │
|
|
171
|
-
│ (Convex, Hono, Astro, React, etc.) │
|
|
172
|
-
├─────────────────────────────────────────────────────────────────────┤
|
|
173
|
-
│ Backend: Hono API + Convex Database (implements ontology) │
|
|
174
|
-
│ Frontend: Astro SSR + React Islands (renders ontology) │
|
|
175
|
-
│ Real-time: Convex hooks (live ontology subscriptions) │
|
|
176
|
-
│ Static: Astro Content Collections (ontology as files) │
|
|
177
|
-
│ │
|
|
178
|
-
│ Technology can be swapped. Ontology stays the same. │
|
|
179
|
-
└─────────────────────────────────────────────────────────────────────┘
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Dimension 1: Groups (Containers)
|
|
183
|
-
|
|
184
|
-
**Purpose:** Partition the system with hierarchical nesting (friend circles → DAOs → governments)
|
|
185
|
-
|
|
186
|
-
**Why it never changes:** Containers always contain things. Whether it's a lemonade stand or a global government, the concept of "container" is universal.
|
|
187
|
-
|
|
188
|
-
**Pattern for AI:**
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
// AI learns: Everything belongs to a group
|
|
192
|
-
provider.things.create({ groupId, type, name, properties });
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
**Example mappings:**
|
|
196
|
-
|
|
197
|
-
- Shopify Store → group (type: business)
|
|
198
|
-
- Moodle School → group (type: organization)
|
|
199
|
-
- DAO Treasury → group (type: dao)
|
|
200
|
-
- Friend Circle → group (type: friend_circle)
|
|
201
|
-
|
|
202
|
-
### Dimension 2: People (Authorization)
|
|
203
|
-
|
|
204
|
-
**Purpose:** Define who can do what (actors, roles, permissions)
|
|
205
|
-
|
|
206
|
-
**Why it never changes:** Authorization is a universal concept. Someone always performs actions.
|
|
207
|
-
|
|
208
|
-
**Pattern for AI:**
|
|
209
|
-
|
|
210
|
-
```typescript
|
|
211
|
-
// AI learns: Every action has an actor
|
|
212
|
-
events.log({ actorId: personId, type, targetId });
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
**Example mappings:**
|
|
216
|
-
|
|
217
|
-
- Shopify Admin → person (role: org_owner)
|
|
218
|
-
- Moodle Student → person (role: customer)
|
|
219
|
-
- Platform Owner → person (role: platform_owner)
|
|
220
|
-
- Team Member → person (role: org_user)
|
|
221
|
-
|
|
222
|
-
### Dimension 3: Things (Entities)
|
|
223
|
-
|
|
224
|
-
**Purpose:** All nouns in the system (66 types, infinitely extensible)
|
|
225
|
-
|
|
226
|
-
**Why it never changes:** Entities exist. Users, products, courses, agents—these are all "things" with different types.
|
|
227
|
-
|
|
228
|
-
**Pattern for AI:**
|
|
229
|
-
|
|
230
|
-
```typescript
|
|
231
|
-
// AI learns: One pattern for all entities
|
|
232
|
-
provider.things.create({ type: "product" | "course" | "user" | ..., name, properties })
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
**Example mappings:**
|
|
236
|
-
|
|
237
|
-
- Shopify Product → thing (type: product)
|
|
238
|
-
- Moodle Course → thing (type: course)
|
|
239
|
-
- Stripe Payment → thing (type: payment)
|
|
240
|
-
- WordPress Post → thing (type: blog_post)
|
|
241
|
-
|
|
242
|
-
**New entity type?** Just add to `properties`. No schema migration needed.
|
|
243
|
-
|
|
244
|
-
### Dimension 4: Connections (Relationships)
|
|
245
|
-
|
|
246
|
-
**Purpose:** How entities relate to each other (25 types + metadata)
|
|
247
|
-
|
|
248
|
-
**Why it never changes:** Relationships are universal. Things connect to other things.
|
|
249
|
-
|
|
250
|
-
**Pattern for AI:**
|
|
251
|
-
|
|
252
|
-
```typescript
|
|
253
|
-
// AI learns: One pattern for all relationships
|
|
254
|
-
provider.connections.create({
|
|
255
|
-
fromThingId,
|
|
256
|
-
toThingId,
|
|
257
|
-
relationshipType,
|
|
258
|
-
metadata,
|
|
259
|
-
});
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
**Example mappings:**
|
|
263
|
-
|
|
264
|
-
- Shopify Order → connection (type: purchased) + event (type: order_placed)
|
|
265
|
-
- Moodle Enrollment → connection (type: enrolled_in)
|
|
266
|
-
- GitHub Follows → connection (type: following)
|
|
267
|
-
- Token Holdings → connection (type: holds_tokens, metadata: { balance })
|
|
268
|
-
|
|
269
|
-
### Dimension 5: Events (Actions)
|
|
270
|
-
|
|
271
|
-
**Purpose:** Complete audit trail of what happened when (67 types + metadata)
|
|
272
|
-
|
|
273
|
-
**Why it never changes:** Actions happen at specific times. This is universal.
|
|
274
|
-
|
|
275
|
-
**Pattern for AI:**
|
|
276
|
-
|
|
277
|
-
```typescript
|
|
278
|
-
// AI learns: All actions are logged the same way
|
|
279
|
-
provider.events.log({ type, actorId, targetId, timestamp, metadata });
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
**Example mappings:**
|
|
283
|
-
|
|
284
|
-
- Shopify Checkout → event (type: payment_processed)
|
|
285
|
-
- Moodle Lesson View → event (type: content_viewed)
|
|
286
|
-
- User Login → event (type: user_login)
|
|
287
|
-
- Token Purchase → event (type: tokens_purchased)
|
|
288
|
-
|
|
289
|
-
### Dimension 6: Knowledge (Understanding)
|
|
290
|
-
|
|
291
|
-
**Purpose:** Labels, embeddings, and semantic search for AI
|
|
292
|
-
|
|
293
|
-
**Why it never changes:** Categorization and understanding are universal concepts.
|
|
294
|
-
|
|
295
|
-
**Pattern for AI:**
|
|
296
|
-
|
|
297
|
-
```typescript
|
|
298
|
-
// AI learns: Knowledge is linked to things
|
|
299
|
-
provider.knowledge.create({
|
|
300
|
-
sourceThingId,
|
|
301
|
-
knowledgeType: "label" | "chunk",
|
|
302
|
-
text,
|
|
303
|
-
embedding,
|
|
304
|
-
});
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
**Example mappings:**
|
|
308
|
-
|
|
309
|
-
- WordPress Categories → knowledge (type: label)
|
|
310
|
-
- Course Content → knowledge (type: chunk, embedding: [...])
|
|
311
|
-
- Product Tags → knowledge (type: label)
|
|
312
|
-
- Semantic Search → knowledge vector search
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
**Golden Rule:** If you can't map your feature to these 6 dimensions, you're thinking about it wrong.
|
|
317
|
-
|
|
318
|
-
**For AI Agents:** This ontology is your universal language. Learn these 6 patterns and you can generate ANY feature with 98% accuracy.
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## Compound Structure Accuracy: Why AI Gets Better Over Time
|
|
323
|
-
|
|
324
|
-
### Traditional AI Code Generation (Pattern Divergence)
|
|
325
|
-
|
|
326
|
-
**The death spiral:**
|
|
327
|
-
|
|
328
|
-
```
|
|
329
|
-
Generation 1: Clean code → 95% accurate
|
|
330
|
-
Generation 2: Slight drift → 90% accurate (-5% - patterns starting to diverge)
|
|
331
|
-
Generation 3: Pattern divergence → 80% accurate (-10% - AI sees multiple patterns)
|
|
332
|
-
Generation 4: Inconsistency → 65% accurate (-15% - AI confused by variations)
|
|
333
|
-
Generation N: Unmaintainable mess → 30% accurate (-20% - complete chaos)
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
**Why?** Each feature introduces NEW patterns. AI has to guess which pattern to use.
|
|
337
|
-
|
|
338
|
-
### ONE's AI Code Generation (Pattern Convergence)
|
|
339
|
-
|
|
340
|
-
**The virtuous cycle:**
|
|
341
|
-
|
|
342
|
-
```
|
|
343
|
-
Generation 1: Maps to ontology → 85% accurate (learning the ontology)
|
|
344
|
-
Generation 2: Follows patterns → 90% accurate (+5% - recognizing service pattern)
|
|
345
|
-
Generation 3: Reuses services → 93% accurate (+3% - composing existing services)
|
|
346
|
-
Generation 4: Predictable structure → 96% accurate (+3% - mastering Effect.ts patterns)
|
|
347
|
-
Generation N: Perfect consistency → 98%+ accurate (+2% - generalized patterns)
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
**Why?** Each feature uses the SAME patterns. AI masters the ontology, then reuses it.
|
|
351
|
-
|
|
352
|
-
### How Agents Learn the Ontology
|
|
353
|
-
|
|
354
|
-
**Generation 1-5: Learning (85% accurate)**
|
|
355
|
-
|
|
356
|
-
```
|
|
357
|
-
Agent thinks:
|
|
358
|
-
"I see things being created with `type` field. Let me check..."
|
|
359
|
-
"All entities are things? Even users, products, courses?"
|
|
360
|
-
"Connections link things together. Got it."
|
|
361
|
-
"Events log actions. People are actors."
|
|
362
|
-
"Pattern emerging: 6 dimensions for everything."
|
|
363
|
-
CONFIDENCE: 85% (still learning)
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
**Generation 6-20: Recognizing (90% accurate)**
|
|
367
|
-
|
|
368
|
-
```
|
|
369
|
-
Agent thinks:
|
|
370
|
-
"Every create operation uses provider.things.create. 100% of the time."
|
|
371
|
-
"Every service uses Effect.gen. Pattern confirmed."
|
|
372
|
-
"All errors are tagged unions. I can handle exhaustively."
|
|
373
|
-
"Dependencies are injected. I know what's needed."
|
|
374
|
-
CONFIDENCE: 90% (pattern recognized)
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
**Generation 21-50: Composing (93% accurate)**
|
|
378
|
-
|
|
379
|
-
```
|
|
380
|
-
Agent thinks:
|
|
381
|
-
"I can reuse existing services:"
|
|
382
|
-
"- createThing service exists"
|
|
383
|
-
"- createConnection service exists"
|
|
384
|
-
"- logEvent service exists"
|
|
385
|
-
"My new feature: compose these three services."
|
|
386
|
-
"No new patterns needed. Just composition."
|
|
387
|
-
CONFIDENCE: 93% (composing existing patterns)
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
**Generation 51-100: Mastering (96% accurate)**
|
|
391
|
-
|
|
392
|
-
```
|
|
393
|
-
Agent thinks:
|
|
394
|
-
"I've generated 50 services. All follow same structure:"
|
|
395
|
-
"1. Get provider from context"
|
|
396
|
-
"2. Call provider operation"
|
|
397
|
-
"3. Handle typed errors"
|
|
398
|
-
"4. Return typed result"
|
|
399
|
-
"Pattern is UNIVERSAL. Works for ANY feature."
|
|
400
|
-
CONFIDENCE: 96% (mastered the structure)
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
**Generation 100+: Generalizing (98%+ accurate)**
|
|
404
|
-
|
|
405
|
-
```
|
|
406
|
-
Agent thinks:
|
|
407
|
-
"I don't even need to think. The pattern IS the system."
|
|
408
|
-
"New feature request? Map to 6 dimensions."
|
|
409
|
-
"Need validation? Effect.ts service."
|
|
410
|
-
"Need data? Provider interface."
|
|
411
|
-
"Need state? Nanostores."
|
|
412
|
-
"Every decision is deterministic."
|
|
413
|
-
CONFIDENCE: 98%+ (system internalized)
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
### What This Means for Development
|
|
417
|
-
|
|
418
|
-
**Feature #1:**
|
|
419
|
-
|
|
420
|
-
- Traditional: 8 hours (70% AI, 30% human)
|
|
421
|
-
- ONE: 8 hours (70% AI, 30% human)
|
|
422
|
-
- **No difference yet**
|
|
423
|
-
|
|
424
|
-
**Feature #10:**
|
|
425
|
-
|
|
426
|
-
- Traditional: 10 hours (60% AI, 40% human - patterns diverging)
|
|
427
|
-
- ONE: 6 hours (85% AI, 15% human - patterns converging)
|
|
428
|
-
- **ONE is 1.7x faster**
|
|
429
|
-
|
|
430
|
-
**Feature #50:**
|
|
431
|
-
|
|
432
|
-
- Traditional: 16 hours (40% AI, 60% human - technical debt)
|
|
433
|
-
- ONE: 3 hours (95% AI, 5% human - pattern mastery)
|
|
434
|
-
- **ONE is 5.3x faster**
|
|
435
|
-
|
|
436
|
-
**Feature #100:**
|
|
437
|
-
|
|
438
|
-
- Traditional: 24 hours (25% AI, 75% human - chaos)
|
|
439
|
-
- ONE: 1.5 hours (98% AI, 2% human - generalized)
|
|
440
|
-
- **ONE is 16x faster**
|
|
441
|
-
|
|
442
|
-
**Cumulative for 100 features:**
|
|
443
|
-
|
|
444
|
-
- Traditional: 1,400 hours
|
|
445
|
-
- ONE: 350 hours
|
|
446
|
-
- **ONE is 4x faster overall**
|
|
447
|
-
- **And the gap keeps growing**
|
|
448
|
-
|
|
449
|
-
### Why Schema Migrations Never Break This
|
|
450
|
-
|
|
451
|
-
**New entity type?**
|
|
452
|
-
|
|
453
|
-
```typescript
|
|
454
|
-
// NO schema migration needed
|
|
455
|
-
{ type: "new_thing", name: "...", properties: { ...custom } }
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
**New field on existing type?**
|
|
459
|
-
|
|
460
|
-
```typescript
|
|
461
|
-
// NO schema migration needed
|
|
462
|
-
{ type: "product", properties: { price, SKU, newField: "value" } }
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
**New relationship?**
|
|
466
|
-
|
|
467
|
-
```typescript
|
|
468
|
-
// NO schema migration needed
|
|
469
|
-
{ relationshipType: "new_connection", metadata: { ...custom } }
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
**New protocol integration?**
|
|
473
|
-
|
|
474
|
-
```typescript
|
|
475
|
-
// NO schema migration needed
|
|
476
|
-
{
|
|
477
|
-
relationshipType: "transacted",
|
|
478
|
-
metadata: { protocol: "new_protocol", ...custom }
|
|
479
|
-
}
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
**Result:** Technology changes (React → Svelte, REST → GraphQL), but the ontology stays the same forever.
|
|
483
|
-
|
|
484
|
-
---
|
|
485
|
-
|
|
486
|
-
## GROUPS: The Isolation Boundary with Hierarchical Nesting
|
|
487
|
-
|
|
488
|
-
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.
|
|
489
|
-
|
|
490
|
-
### Group Structure
|
|
491
|
-
|
|
492
|
-
```typescript
|
|
493
|
-
{
|
|
494
|
-
_id: Id<'groups'>,
|
|
495
|
-
slug: string, // REQUIRED: URL identifier (/group/slug)
|
|
496
|
-
name: string, // REQUIRED: Display name
|
|
497
|
-
type: 'friend_circle' | 'business' | 'community' | 'dao' | 'government' | 'organization',
|
|
498
|
-
parentGroupId?: Id<'groups'>, // OPTIONAL: Parent group for hierarchical nesting
|
|
499
|
-
description?: string, // OPTIONAL: About text
|
|
500
|
-
|
|
501
|
-
metadata: Record<string, any>,
|
|
502
|
-
|
|
503
|
-
settings: {
|
|
504
|
-
visibility: 'public' | 'private',
|
|
505
|
-
joinPolicy: 'open' | 'invite_only' | 'approval_required',
|
|
506
|
-
plan: 'starter' | 'pro' | 'enterprise',
|
|
507
|
-
limits: {
|
|
508
|
-
users: number,
|
|
509
|
-
storage: number, // GB
|
|
510
|
-
apiCalls: number,
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
status: 'active' | 'archived',
|
|
515
|
-
createdAt: number,
|
|
516
|
-
updatedAt: number,
|
|
517
|
-
}
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
### Common Fields by Use Case
|
|
521
|
-
|
|
522
|
-
**Identity:** `[slug, name]` - Who they are + URL
|
|
523
|
-
**Web:** `[slug, name, description]` - Website generation
|
|
524
|
-
**Operations:** `[status, type, settings, parentGroupId]` - System management
|
|
525
|
-
|
|
526
|
-
### Why Groups Matter
|
|
527
|
-
|
|
528
|
-
1. **Multi-Tenant Isolation:** Each group's data is completely separate
|
|
529
|
-
2. **Hierarchical Nesting:** Groups can contain sub-groups for complex organizations (parent → child → grandchild...)
|
|
530
|
-
3. **Flexible Types:** From friend circles (2 people) to businesses to DAOs to governments (billions)
|
|
531
|
-
4. **Resource Quotas:** Control costs and usage per group
|
|
532
|
-
5. **Privacy Control:** Groups can be public or private with controlled access
|
|
533
|
-
6. **Flexible Scale:** Scales from friend circles to global governments without schema changes
|
|
534
|
-
|
|
535
|
-
### Hierarchical Group Examples by Domain
|
|
536
|
-
|
|
537
|
-
**E-Commerce (Retail Chain):**
|
|
538
|
-
|
|
539
|
-
```
|
|
540
|
-
Corporate Headquarters (group)
|
|
541
|
-
├─ North American Division (child group)
|
|
542
|
-
│ ├─ New York Store (grandchild group)
|
|
543
|
-
│ └─ California Store (grandchild group)
|
|
544
|
-
└─ European Division (child group)
|
|
545
|
-
├─ London Store (grandchild group)
|
|
546
|
-
└─ Paris Store (grandchild group)
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
**Education (University System):**
|
|
550
|
-
|
|
551
|
-
```
|
|
552
|
-
MIT (group)
|
|
553
|
-
├─ School of Engineering (child group)
|
|
554
|
-
│ ├─ Computer Science Dept (grandchild group)
|
|
555
|
-
│ ├─ Electrical Engineering Dept (grandchild group)
|
|
556
|
-
│ └─ Mechanical Engineering Dept (grandchild group)
|
|
557
|
-
├─ School of Science (child group)
|
|
558
|
-
│ ├─ Mathematics Dept (grandchild group)
|
|
559
|
-
│ └─ Physics Dept (grandchild group)
|
|
560
|
-
└─ School of Business (child group)
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
**Creator (Multi-Channel Brand):**
|
|
564
|
-
|
|
565
|
-
```
|
|
566
|
-
Creator Brand (group)
|
|
567
|
-
├─ YouTube Channel (child group)
|
|
568
|
-
│ └─ Content Series 1 (grandchild group)
|
|
569
|
-
├─ Podcast (child group)
|
|
570
|
-
│ └─ Season 2 (grandchild group)
|
|
571
|
-
└─ Community (child group - Discord server with channels)
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
**Crypto (DAO Treasury):**
|
|
575
|
-
|
|
576
|
-
```
|
|
577
|
-
DAO Treasury (group)
|
|
578
|
-
├─ Core Operations (child group)
|
|
579
|
-
│ ├─ Development Fund (grandchild group)
|
|
580
|
-
│ └─ Marketing Fund (grandchild group)
|
|
581
|
-
├─ Investment Committee (child group)
|
|
582
|
-
│ └─ Venture Capital Allocation (grandchild group)
|
|
583
|
-
└─ Community Grants (child group)
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
---
|
|
587
|
-
|
|
588
|
-
## PEOPLE: Authorization & Governance
|
|
589
|
-
|
|
590
|
-
Purpose: Define who can do what. People direct groups, customize AI agents, and govern access.
|
|
591
|
-
|
|
592
|
-
### Person Structure
|
|
593
|
-
|
|
594
|
-
```typescript
|
|
595
|
-
{
|
|
596
|
-
_id: Id<'people'>,
|
|
597
|
-
email: string,
|
|
598
|
-
username: string,
|
|
599
|
-
displayName: string,
|
|
600
|
-
|
|
601
|
-
// CRITICAL: Role determines access level
|
|
602
|
-
role: 'platform_owner' | 'group_owner' | 'group_user' | 'customer',
|
|
603
|
-
|
|
604
|
-
// Group context
|
|
605
|
-
groupId?: Id<'groups'>, // Current/default group
|
|
606
|
-
permissions?: string[],
|
|
607
|
-
|
|
608
|
-
// Profile
|
|
609
|
-
bio?: string,
|
|
610
|
-
avatar?: string,
|
|
611
|
-
|
|
612
|
-
// Multi-tenant tracking
|
|
613
|
-
groups: Id<'groups'>[], // All groups this person belongs to
|
|
614
|
-
|
|
615
|
-
createdAt: number,
|
|
616
|
-
updatedAt: number,
|
|
617
|
-
}
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
### Four Roles
|
|
621
|
-
|
|
622
|
-
1. **Platform Owner** (Anthony)
|
|
623
|
-
- Owns the ONE Platform
|
|
624
|
-
- 100% revenue from platform-level services
|
|
625
|
-
- Can access all groups (support/debugging)
|
|
626
|
-
- Creates new groups
|
|
627
|
-
|
|
628
|
-
2. **Group Owner**
|
|
629
|
-
- Owns/manages one or more groups
|
|
630
|
-
- Controls users, permissions, billing within group
|
|
631
|
-
- Customizes AI agents and frontend
|
|
632
|
-
- Revenue sharing with platform
|
|
633
|
-
|
|
634
|
-
3. **Group User**
|
|
635
|
-
- Works within a group
|
|
636
|
-
- Limited permissions (defined by group owner)
|
|
637
|
-
- Can create content, run agents (within quotas)
|
|
638
|
-
|
|
639
|
-
4. **Customer**
|
|
640
|
-
- External user consuming content
|
|
641
|
-
- Purchases tokens, enrolls in courses
|
|
642
|
-
- No admin access
|
|
643
|
-
|
|
644
|
-
### Why People Matter
|
|
645
|
-
|
|
646
|
-
1. **Authorization:** Every action must have an actor (person)
|
|
647
|
-
2. **Governance:** Group owners control who can do what
|
|
648
|
-
3. **Audit Trail:** Events log who did what when
|
|
649
|
-
4. **Customization:** People teach AI agents their preferences
|
|
650
|
-
|
|
651
|
-
---
|
|
652
|
-
|
|
653
|
-
## KNOWLEDGE: Labels, Chunks, and Vectors (RAG)
|
|
654
|
-
|
|
655
|
-
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.
|
|
656
|
-
|
|
657
|
-
Design principles:
|
|
658
|
-
|
|
659
|
-
- Protocol‑agnostic: store protocol details in `metadata`.
|
|
660
|
-
- Many‑to‑many: link knowledge ⇄ things via `thingKnowledge` with optional context metadata.
|
|
661
|
-
- Scalable: consolidated types minimize index fan‑out; embeddings enable semantic search.
|
|
662
|
-
|
|
663
|
-
### Knowledge Types
|
|
664
|
-
|
|
665
|
-
```typescript
|
|
666
|
-
type KnowledgeType =
|
|
667
|
-
| "label" // replaces legacy "tag"; lightweight categorical marker
|
|
668
|
-
| "document" // wrapper for a source text/blob (pre-chunking)
|
|
669
|
-
| "chunk" // atomic chunk of text with embedding
|
|
670
|
-
| "vector_only"; // embedding without stored text (e.g., privacy)
|
|
671
|
-
```
|
|
672
|
-
|
|
673
|
-
### Knowledge Structure
|
|
674
|
-
|
|
675
|
-
```typescript
|
|
676
|
-
{
|
|
677
|
-
_id: Id<'knowledge'>,
|
|
678
|
-
knowledgeType: KnowledgeType,
|
|
679
|
-
// Textual content (optional for label/vector_only)
|
|
680
|
-
text?: string,
|
|
681
|
-
// Embedding for semantic search (optional for label/document)
|
|
682
|
-
embedding?: number[], // Float32 vector; model-dependent dimension
|
|
683
|
-
embeddingModel?: string, // e.g., "text-embedding-3-large"
|
|
684
|
-
embeddingDim?: number,
|
|
685
|
-
// Source linkage
|
|
686
|
-
sourceThingId?: Id<'things'>, // Primary source entity
|
|
687
|
-
sourceField?: string, // e.g., 'content', 'transcript', 'title'
|
|
688
|
-
chunk?: { index: number; start?: number; end?: number; tokenCount?: number; overlap?: number },
|
|
689
|
-
// Lightweight categorization (free-form)
|
|
690
|
-
labels?: string[], // Replaces per-thing tags; applied to knowledge
|
|
691
|
-
// Additional metadata (protocol, language, mime, hash, version)
|
|
692
|
-
metadata?: Record<string, any>,
|
|
693
|
-
createdAt: number,
|
|
694
|
-
updatedAt: number,
|
|
695
|
-
deletedAt?: number,
|
|
696
|
-
}
|
|
697
|
-
```
|
|
698
|
-
|
|
699
|
-
### Junction: thingKnowledge
|
|
700
|
-
|
|
701
|
-
```typescript
|
|
702
|
-
{
|
|
703
|
-
_id: Id<'thingKnowledge'>,
|
|
704
|
-
thingId: Id<'things'>,
|
|
705
|
-
knowledgeId: Id<'knowledge'>,
|
|
706
|
-
role?: 'label' | 'summary' | 'chunk_of' | 'caption' | 'keyword',
|
|
707
|
-
// Context for the link (e.g., confidence, section name)
|
|
708
|
-
metadata?: Record<string, any>,
|
|
709
|
-
createdAt: number,
|
|
710
|
-
}
|
|
711
|
-
```
|
|
712
|
-
|
|
713
|
-
### Indexes (recommended)
|
|
714
|
-
|
|
715
|
-
- `knowledge.by_type` (knowledgeType)
|
|
716
|
-
- `knowledge.by_source` (sourceThingId)
|
|
717
|
-
- `knowledge.by_created` (createdAt)
|
|
718
|
-
- `thingKnowledge.by_thing` (thingId)
|
|
719
|
-
- `thingKnowledge.by_knowledge` (knowledgeId)
|
|
720
|
-
- Vector index (provider-dependent): `knowledge.by_embedding` for ANN search
|
|
721
|
-
|
|
722
|
-
### How Domains Apply Knowledge
|
|
723
|
-
|
|
724
|
-
**Education - Learning Objectives & Study Materials:**
|
|
725
|
-
|
|
726
|
-
```typescript
|
|
727
|
-
// Knowledge: Learning objective chunk
|
|
728
|
-
{
|
|
729
|
-
knowledgeType: 'chunk',
|
|
730
|
-
text: 'Students should be able to solve quadratic equations',
|
|
731
|
-
sourceThingId: courseId,
|
|
732
|
-
labels: ['subject:mathematics', 'grade:9-12', 'objective:apply', 'skill:algebra']
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
// Link: Course references this learning objective
|
|
736
|
-
{
|
|
737
|
-
thingId: courseId,
|
|
738
|
-
knowledgeId: knowledgeId,
|
|
739
|
-
role: 'learning_objective'
|
|
740
|
-
}
|
|
741
|
-
```
|
|
742
|
-
|
|
743
|
-
**Creator - Content SEO & Discovery:**
|
|
744
|
-
|
|
745
|
-
```typescript
|
|
746
|
-
// Knowledge: Video description chunk with embedded metadata
|
|
747
|
-
{
|
|
748
|
-
knowledgeType: 'chunk',
|
|
749
|
-
text: 'This video teaches React hooks for beginners...',
|
|
750
|
-
sourceThingId: videoId,
|
|
751
|
-
embedding: [0.1, 0.2, ...],
|
|
752
|
-
labels: ['topic:react', 'difficulty:beginner', 'platform:youtube', 'series:javascript101']
|
|
753
|
-
}
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
**E-Commerce - Product Categorization & Search:**
|
|
757
|
-
|
|
758
|
-
```typescript
|
|
759
|
-
// Knowledge: Product description for semantic search
|
|
760
|
-
{
|
|
761
|
-
knowledgeType: 'document',
|
|
762
|
-
text: 'Blue wireless headphones with 40-hour battery life',
|
|
763
|
-
sourceThingId: productId,
|
|
764
|
-
embedding: [0.5, 0.3, ...],
|
|
765
|
-
labels: ['category:electronics', 'color:blue', 'feature:wireless', 'price_range:premium']
|
|
766
|
-
}
|
|
767
|
-
```
|
|
768
|
-
|
|
769
|
-
**Crypto - Risk Analysis & Token Intelligence:**
|
|
770
|
-
|
|
771
|
-
```typescript
|
|
772
|
-
// Knowledge: Token risk assessment
|
|
773
|
-
{
|
|
774
|
-
knowledgeType: 'chunk',
|
|
775
|
-
text: 'Token has no minting restrictions, moderate holder concentration',
|
|
776
|
-
sourceThingId: tokenId,
|
|
777
|
-
labels: ['risk:medium', 'metric:tvl_trend_up', 'audit:completed', 'governance:none']
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// Knowledge: Protocol dependency analysis
|
|
781
|
-
{
|
|
782
|
-
knowledgeType: 'label',
|
|
783
|
-
text: 'Depends on Chainlink oracle',
|
|
784
|
-
sourceThingId: protocolId,
|
|
785
|
-
labels: ['dependency:critical', 'type:oracle', 'risk_factor:oracle']
|
|
786
|
-
}
|
|
787
|
-
```
|
|
788
|
-
|
|
789
|
-
**Notes:**
|
|
790
|
-
|
|
791
|
-
- The legacy ThingType `embedding` is deprecated for operational vectors; use the `knowledge` table with `knowledgeType: 'chunk' | 'vector_only'`.
|
|
792
|
-
- Labels (formerly tags) now live in `knowledge.labels` and via `thingKnowledge` relations. Use labels to curate taxonomy without enum churn.
|
|
793
|
-
- Domain-specific labels follow `category:value` pattern for semantic organization (e.g., `subject:math`, `platform:youtube`, `risk:high`).
|
|
794
|
-
|
|
795
|
-
---
|
|
796
|
-
|
|
797
|
-
## THINGS: All The "Things"
|
|
798
|
-
|
|
799
|
-
### What Goes in Things?
|
|
800
|
-
|
|
801
|
-
**Simple test:** If you can point at it and say "this is a \_\_\_", it's a thing.
|
|
802
|
-
|
|
803
|
-
Examples:
|
|
804
|
-
|
|
805
|
-
- "This is a **creator**" ✅ Thing
|
|
806
|
-
- "This is a **blog post**" ✅ Thing
|
|
807
|
-
- "This is a **token**" ✅ Thing
|
|
808
|
-
- "This is a **relationship**" ❌ Connection, not thing
|
|
809
|
-
- "This is a **purchase**" ❌ Event, not thing
|
|
810
|
-
|
|
811
|
-
### Thing Types
|
|
812
|
-
|
|
813
|
-
**66 Types Organized in 13 Categories:**
|
|
814
|
-
|
|
815
|
-
```typescript
|
|
816
|
-
type ThingType =
|
|
817
|
-
// CORE (4)
|
|
818
|
-
| "creator" // Human creator (role: platform_owner, org_owner, org_user, customer)
|
|
819
|
-
| "ai_clone" // Digital twin of creator
|
|
820
|
-
| "audience_member" // Fan/user (role: customer)
|
|
821
|
-
| "organization" // Multi-tenant organization
|
|
822
|
-
|
|
823
|
-
// BUSINESS AGENTS (10)
|
|
824
|
-
| "strategy_agent" // Vision, planning, OKRs
|
|
825
|
-
| "research_agent" // Market, trends, competitors
|
|
826
|
-
| "marketing_agent" // Content strategy, SEO, distribution
|
|
827
|
-
| "sales_agent" // Funnels, conversion, follow-up
|
|
828
|
-
| "service_agent" // Support, onboarding, success
|
|
829
|
-
| "design_agent" // Brand, UI/UX, assets
|
|
830
|
-
| "engineering_agent" // Tech, integration, automation
|
|
831
|
-
| "finance_agent" // Revenue, costs, forecasting
|
|
832
|
-
| "legal_agent" // Compliance, contracts, IP
|
|
833
|
-
| "intelligence_agent" // Analytics, insights, predictions
|
|
834
|
-
|
|
835
|
-
// CONTENT (7)
|
|
836
|
-
| "blog_post" // Written content (guides, newsletters, articles)
|
|
837
|
-
| "video" // Video content (lectures, demos, shorts)
|
|
838
|
-
| "podcast" // Audio content (episodes, interviews)
|
|
839
|
-
| "social_post" // Social media post (all platforms)
|
|
840
|
-
| "email" // Email content (campaigns, newsletters)
|
|
841
|
-
| "course" // Educational course (programs, learning paths)
|
|
842
|
-
| "lesson" // Individual lesson (units, modules, segments)
|
|
843
|
-
|
|
844
|
-
// PRODUCTS (4)
|
|
845
|
-
| "digital_product" // Templates, tools, assets
|
|
846
|
-
| "membership" // Tiered membership (Patreon, Substack)
|
|
847
|
-
| "consultation" // 1-on-1 session (coaching, support)
|
|
848
|
-
| "nft" // NFT collectible (governance, utility)
|
|
849
|
-
|
|
850
|
-
// COMMUNITY (3)
|
|
851
|
-
| "community" // Community space (Discord, forums)
|
|
852
|
-
| "conversation" // Thread/discussion (boards, channels)
|
|
853
|
-
| "message" // Individual message (chat, DM)
|
|
854
|
-
|
|
855
|
-
// TOKEN (2)
|
|
856
|
-
| "token" // Actual token instance
|
|
857
|
-
| "token_contract" // Smart contract
|
|
858
|
-
|
|
859
|
-
// KNOWLEDGE (2)
|
|
860
|
-
| "knowledge_item" // Piece of creator knowledge
|
|
861
|
-
| "embedding" // Vector embedding
|
|
862
|
-
|
|
863
|
-
// PLATFORM (6)
|
|
864
|
-
| "website" // Auto-generated creator site
|
|
865
|
-
| "landing_page" // Custom landing pages (campaigns, sales)
|
|
866
|
-
| "template" // Design templates (reusable components)
|
|
867
|
-
| "livestream" // Live broadcast (streaming, webinars)
|
|
868
|
-
| "recording" // Saved livestream content
|
|
869
|
-
| "media_asset" // Images, videos, files
|
|
870
|
-
|
|
871
|
-
// BUSINESS (7)
|
|
872
|
-
| "payment" // Payment transaction
|
|
873
|
-
| "subscription" // Recurring subscription
|
|
874
|
-
| "invoice" // Invoice record
|
|
875
|
-
| "metric" // Tracked metric
|
|
876
|
-
| "insight" // AI-generated insight
|
|
877
|
-
| "prediction" // AI prediction
|
|
878
|
-
| "report" // Analytics report
|
|
879
|
-
|
|
880
|
-
// AUTHENTICATION & SESSION (5)
|
|
881
|
-
| "session" // User session (Better Auth)
|
|
882
|
-
| "oauth_account" // OAuth connection (GitHub, Google)
|
|
883
|
-
| "verification_token" // Email/2FA verification token
|
|
884
|
-
| "password_reset_token" // Password reset token
|
|
885
|
-
| "ui_preferences" // User UI settings (theme, layout)
|
|
886
|
-
|
|
887
|
-
// MARKETING (6)
|
|
888
|
-
| "notification" // System notification
|
|
889
|
-
| "email_campaign" // Email marketing campaign
|
|
890
|
-
| "announcement" // Platform announcement
|
|
891
|
-
| "referral" // Referral record
|
|
892
|
-
| "campaign" // Marketing campaign
|
|
893
|
-
| "lead" // Potential customer/lead
|
|
894
|
-
|
|
895
|
-
// EXTERNAL INTEGRATIONS (3)
|
|
896
|
-
| "external_agent" // External AI agent (ElizaOS)
|
|
897
|
-
| "external_workflow" // External workflow (n8n, Zapier)
|
|
898
|
-
| "external_connection" // Connection config
|
|
899
|
-
|
|
900
|
-
// PROTOCOL ENTITIES (2, protocol-agnostic)
|
|
901
|
-
| "mandate" // Intent/cart (AP2, shopping)
|
|
902
|
-
| "product"; // Sellable product (ACP marketplace)
|
|
903
|
-
```
|
|
904
|
-
|
|
905
|
-
**How Domains Apply These Types:**
|
|
906
|
-
|
|
907
|
-
- **E-Commerce**: Uses `product` (catalog items), `mandate` (shopping carts), `payment` (transactions), `subscription` (auto-renewals), `membership` (loyalty), `notification` (order updates), `email_campaign` (promotional)
|
|
908
|
-
- **Education**: Uses `course` (programs), `lesson` (units), `community` (cohorts), `assignment` (assessments), `conversation` (discussion boards), `metric` (grades), `report` (transcripts)
|
|
909
|
-
- **Creator**: Uses `video` (YouTube/TikTok), `podcast` (episodes), `blog_post` (newsletters), `membership` (tiers), `course` (products), `email_campaign` (outreach), `metric` (engagement), `insight` (analytics)
|
|
910
|
-
- **Crypto**: Uses `token` (holdings), `token_contract` (smart contracts), `metric` (TVL/volume), `payment` (transfers), `knowledge_item` (risk profiles), `report` (protocol analysis)
|
|
911
|
-
|
|
912
|
-
### Thing Structure
|
|
913
|
-
|
|
914
|
-
```typescript
|
|
915
|
-
{
|
|
916
|
-
_id: Id<"things">,
|
|
917
|
-
type: ThingType,
|
|
918
|
-
name: string, // Display name
|
|
919
|
-
properties: { // Type-specific properties (JSON)
|
|
920
|
-
// For creator:
|
|
921
|
-
email?: string,
|
|
922
|
-
username?: string,
|
|
923
|
-
niche?: string[],
|
|
924
|
-
// For token:
|
|
925
|
-
contractAddress?: string,
|
|
926
|
-
totalSupply?: number,
|
|
927
|
-
// etc...
|
|
928
|
-
},
|
|
929
|
-
status: "active" | "inactive" | "draft" | "published" | "archived",
|
|
930
|
-
createdAt: number,
|
|
931
|
-
updatedAt: number,
|
|
932
|
-
deletedAt?: number
|
|
933
|
-
}
|
|
934
|
-
```
|
|
935
|
-
|
|
936
|
-
### Properties by Thing Type
|
|
937
|
-
|
|
938
|
-
**Creator Properties:**
|
|
939
|
-
|
|
940
|
-
```typescript
|
|
941
|
-
{
|
|
942
|
-
email: string,
|
|
943
|
-
username: string,
|
|
944
|
-
displayName: string,
|
|
945
|
-
bio?: string,
|
|
946
|
-
avatar?: string,
|
|
947
|
-
niche: string[],
|
|
948
|
-
expertise: string[],
|
|
949
|
-
targetAudience: string,
|
|
950
|
-
brandColors?: {
|
|
951
|
-
primary: string,
|
|
952
|
-
secondary: string,
|
|
953
|
-
accent: string
|
|
954
|
-
},
|
|
955
|
-
totalFollowers: number,
|
|
956
|
-
totalContent: number,
|
|
957
|
-
totalRevenue: number,
|
|
958
|
-
// MULTI-TENANT ROLES
|
|
959
|
-
role: "platform_owner" | "group_owner" | "group_user" | "customer",
|
|
960
|
-
groupId?: Id<"groups">, // Current/default group (if group_owner or group_user)
|
|
961
|
-
permissions?: string[], // Additional permissions
|
|
962
|
-
}
|
|
963
|
-
```
|
|
964
|
-
|
|
965
|
-
**Organization Properties:**
|
|
966
|
-
|
|
967
|
-
```typescript
|
|
968
|
-
{
|
|
969
|
-
name: string,
|
|
970
|
-
slug: string, // URL-friendly identifier
|
|
971
|
-
domain?: string, // Custom domain (e.g., acme.one.ie)
|
|
972
|
-
logo?: string,
|
|
973
|
-
description?: string,
|
|
974
|
-
status: "active" | "suspended" | "trial" | "cancelled",
|
|
975
|
-
plan: "starter" | "pro" | "enterprise",
|
|
976
|
-
limits: {
|
|
977
|
-
users: number, // Max users allowed
|
|
978
|
-
storage: number, // GB
|
|
979
|
-
apiCalls: number, // Per month
|
|
980
|
-
},
|
|
981
|
-
usage: {
|
|
982
|
-
users: number, // Current users
|
|
983
|
-
storage: number, // GB used
|
|
984
|
-
apiCalls: number, // This month
|
|
985
|
-
},
|
|
986
|
-
billing: {
|
|
987
|
-
customerId?: string, // Stripe customer ID
|
|
988
|
-
subscriptionId?: string, // Stripe subscription ID
|
|
989
|
-
currentPeriodEnd?: number,
|
|
990
|
-
},
|
|
991
|
-
settings: {
|
|
992
|
-
allowSignups: boolean,
|
|
993
|
-
requireEmailVerification: boolean,
|
|
994
|
-
enableTwoFactor: boolean,
|
|
995
|
-
allowedDomains?: string[], // Email domain whitelist
|
|
996
|
-
},
|
|
997
|
-
createdAt: number,
|
|
998
|
-
trialEndsAt?: number,
|
|
999
|
-
}
|
|
1000
|
-
```
|
|
1001
|
-
|
|
1002
|
-
**AI Clone Properties:**
|
|
1003
|
-
|
|
1004
|
-
```typescript
|
|
1005
|
-
{
|
|
1006
|
-
voiceId?: string,
|
|
1007
|
-
voiceProvider?: "elevenlabs" | "azure" | "custom",
|
|
1008
|
-
appearanceId?: string,
|
|
1009
|
-
appearanceProvider?: "d-id" | "heygen" | "custom",
|
|
1010
|
-
systemPrompt: string,
|
|
1011
|
-
temperature: number,
|
|
1012
|
-
knowledgeBaseSize: number,
|
|
1013
|
-
lastTrainingDate: number,
|
|
1014
|
-
totalInteractions: number,
|
|
1015
|
-
satisfactionScore: number
|
|
1016
|
-
}
|
|
1017
|
-
```
|
|
1018
|
-
|
|
1019
|
-
**Agent Properties:**
|
|
1020
|
-
|
|
1021
|
-
```typescript
|
|
1022
|
-
{
|
|
1023
|
-
agentType: "strategy" | "marketing" | "sales" | ...,
|
|
1024
|
-
systemPrompt: string,
|
|
1025
|
-
model: string,
|
|
1026
|
-
temperature: number,
|
|
1027
|
-
capabilities: string[],
|
|
1028
|
-
tools: string[],
|
|
1029
|
-
totalExecutions: number,
|
|
1030
|
-
successRate: number,
|
|
1031
|
-
averageExecutionTime: number
|
|
1032
|
-
}
|
|
1033
|
-
```
|
|
1034
|
-
|
|
1035
|
-
**Token Properties:**
|
|
1036
|
-
|
|
1037
|
-
```typescript
|
|
1038
|
-
{
|
|
1039
|
-
contractAddress: string,
|
|
1040
|
-
blockchain: "base" | "ethereum" | "polygon",
|
|
1041
|
-
standard: "ERC20" | "ERC721" | "ERC1155",
|
|
1042
|
-
totalSupply: number,
|
|
1043
|
-
circulatingSupply: number,
|
|
1044
|
-
price: number,
|
|
1045
|
-
marketCap: number,
|
|
1046
|
-
utility: string[],
|
|
1047
|
-
burnRate: number,
|
|
1048
|
-
holders: number,
|
|
1049
|
-
transactions24h: number,
|
|
1050
|
-
volume24h: number
|
|
1051
|
-
}
|
|
1052
|
-
```
|
|
1053
|
-
|
|
1054
|
-
**Course Properties:**
|
|
1055
|
-
|
|
1056
|
-
```typescript
|
|
1057
|
-
{
|
|
1058
|
-
title: string,
|
|
1059
|
-
description: string,
|
|
1060
|
-
thumbnail?: string,
|
|
1061
|
-
modules: number,
|
|
1062
|
-
lessons: number,
|
|
1063
|
-
totalDuration: number,
|
|
1064
|
-
price: number,
|
|
1065
|
-
currency: string,
|
|
1066
|
-
tokenPrice?: number,
|
|
1067
|
-
enrollments: number,
|
|
1068
|
-
completions: number,
|
|
1069
|
-
averageRating: number,
|
|
1070
|
-
generatedBy: "ai" | "human" | "hybrid",
|
|
1071
|
-
personalizationLevel: "none" | "basic" | "advanced"
|
|
1072
|
-
}
|
|
1073
|
-
```
|
|
1074
|
-
|
|
1075
|
-
**Website Properties:**
|
|
1076
|
-
|
|
1077
|
-
```typescript
|
|
1078
|
-
{
|
|
1079
|
-
domain: string,
|
|
1080
|
-
subdomain: string, // creator.one.ie
|
|
1081
|
-
template: "minimal" | "showcase" | "portfolio",
|
|
1082
|
-
customCSS?: string,
|
|
1083
|
-
customDomain?: string,
|
|
1084
|
-
sslEnabled: boolean,
|
|
1085
|
-
analytics: {
|
|
1086
|
-
visitors30d: number,
|
|
1087
|
-
pageViews: number,
|
|
1088
|
-
conversionRate: number
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
```
|
|
1092
|
-
|
|
1093
|
-
**Livestream Properties:**
|
|
1094
|
-
|
|
1095
|
-
```typescript
|
|
1096
|
-
{
|
|
1097
|
-
title: string,
|
|
1098
|
-
scheduledAt: number,
|
|
1099
|
-
startedAt?: number,
|
|
1100
|
-
endedAt?: number,
|
|
1101
|
-
platform: "youtube" | "twitch" | "custom",
|
|
1102
|
-
streamUrl: string,
|
|
1103
|
-
recordingUrl?: string,
|
|
1104
|
-
viewersPeak: number,
|
|
1105
|
-
viewersAverage: number,
|
|
1106
|
-
chatEnabled: boolean,
|
|
1107
|
-
aiCloneMixEnabled: boolean, // For human + AI mixing
|
|
1108
|
-
status: "scheduled" | "live" | "ended" | "cancelled"
|
|
1109
|
-
}
|
|
1110
|
-
```
|
|
1111
|
-
|
|
1112
|
-
**Payment Properties:**
|
|
1113
|
-
|
|
1114
|
-
```typescript
|
|
1115
|
-
{
|
|
1116
|
-
amount: number,
|
|
1117
|
-
currency: "usd" | "eur",
|
|
1118
|
-
paymentMethod: "stripe" | "crypto",
|
|
1119
|
-
stripePaymentIntentId?: string,
|
|
1120
|
-
txHash?: string, // Blockchain transaction
|
|
1121
|
-
status: "pending" | "completed" | "failed" | "refunded",
|
|
1122
|
-
fees: number,
|
|
1123
|
-
netAmount: number,
|
|
1124
|
-
processedAt?: number
|
|
1125
|
-
}
|
|
1126
|
-
```
|
|
1127
|
-
|
|
1128
|
-
**Subscription Properties:**
|
|
1129
|
-
|
|
1130
|
-
```typescript
|
|
1131
|
-
{
|
|
1132
|
-
tier: "starter" | "pro" | "enterprise",
|
|
1133
|
-
price: number,
|
|
1134
|
-
currency: string,
|
|
1135
|
-
interval: "monthly" | "yearly",
|
|
1136
|
-
status: "active" | "cancelled" | "past_due" | "expired",
|
|
1137
|
-
currentPeriodStart: number,
|
|
1138
|
-
currentPeriodEnd: number,
|
|
1139
|
-
cancelAt?: number,
|
|
1140
|
-
stripeSubscriptionId?: string
|
|
1141
|
-
}
|
|
1142
|
-
```
|
|
1143
|
-
|
|
1144
|
-
**Metric Properties:**
|
|
1145
|
-
|
|
1146
|
-
```typescript
|
|
1147
|
-
{
|
|
1148
|
-
name: string,
|
|
1149
|
-
value: number,
|
|
1150
|
-
unit: string,
|
|
1151
|
-
timestamp: number,
|
|
1152
|
-
period: "realtime" | "hourly" | "daily" | "weekly" | "monthly",
|
|
1153
|
-
change: number, // Percentage change from previous
|
|
1154
|
-
trend: "up" | "down" | "stable"
|
|
1155
|
-
}
|
|
1156
|
-
```
|
|
1157
|
-
|
|
1158
|
-
**Insight Properties:**
|
|
1159
|
-
|
|
1160
|
-
```typescript
|
|
1161
|
-
{
|
|
1162
|
-
title: string,
|
|
1163
|
-
description: string,
|
|
1164
|
-
category: "performance" | "audience" | "revenue" | "content",
|
|
1165
|
-
confidence: number, // 0.0 to 1.0
|
|
1166
|
-
actionable: boolean,
|
|
1167
|
-
recommendations: string[],
|
|
1168
|
-
generatedAt: number,
|
|
1169
|
-
generatedBy: Id<"things"> // intelligence_agent
|
|
1170
|
-
}
|
|
1171
|
-
```
|
|
1172
|
-
|
|
1173
|
-
**Referral Properties:**
|
|
1174
|
-
|
|
1175
|
-
```typescript
|
|
1176
|
-
{
|
|
1177
|
-
referrerCode: string,
|
|
1178
|
-
referredEmail: string,
|
|
1179
|
-
referredUserId?: Id<"things">,
|
|
1180
|
-
status: "pending" | "converted" | "expired",
|
|
1181
|
-
tokensEarned: number,
|
|
1182
|
-
bonusEarned?: number,
|
|
1183
|
-
conversionDate?: number,
|
|
1184
|
-
expiresAt: number
|
|
1185
|
-
}
|
|
1186
|
-
```
|
|
1187
|
-
|
|
1188
|
-
**Notification Properties:**
|
|
1189
|
-
|
|
1190
|
-
```typescript
|
|
1191
|
-
{
|
|
1192
|
-
title: string,
|
|
1193
|
-
message: string,
|
|
1194
|
-
type: "info" | "success" | "warning" | "error",
|
|
1195
|
-
channel: "email" | "sms" | "push" | "in_app",
|
|
1196
|
-
read: boolean,
|
|
1197
|
-
readAt?: number,
|
|
1198
|
-
actionUrl?: string,
|
|
1199
|
-
actionLabel?: string
|
|
1200
|
-
}
|
|
1201
|
-
```
|
|
1202
|
-
|
|
1203
|
-
**External Agent Properties:**
|
|
1204
|
-
|
|
1205
|
-
```typescript
|
|
1206
|
-
{
|
|
1207
|
-
platform: "elizaos" | "autogen" | "crewai" | "langchain" | "custom",
|
|
1208
|
-
agentId: string, // External platform's agent ID
|
|
1209
|
-
name: string, // Agent name
|
|
1210
|
-
description?: string, // What the agent does
|
|
1211
|
-
capabilities: string[], // Available actions/tools
|
|
1212
|
-
apiEndpoint?: string, // REST/GraphQL endpoint
|
|
1213
|
-
websocketUrl?: string, // WebSocket endpoint for real-time
|
|
1214
|
-
status: "online" | "offline" | "busy" | "unknown",
|
|
1215
|
-
lastSeen?: number,
|
|
1216
|
-
metadata: { // Platform-specific data
|
|
1217
|
-
personality?: any, // For ElizaOS character
|
|
1218
|
-
tools?: string[], // Available tools
|
|
1219
|
-
model?: string, // LLM model used
|
|
1220
|
-
[key: string]: any // Other platform-specific fields
|
|
1221
|
-
},
|
|
1222
|
-
conversationCount: number, // Total conversations
|
|
1223
|
-
messageCount: number, // Total messages exchanged
|
|
1224
|
-
createdAt: number,
|
|
1225
|
-
updatedAt: number
|
|
1226
|
-
}
|
|
1227
|
-
```
|
|
1228
|
-
|
|
1229
|
-
**External Workflow Properties:**
|
|
1230
|
-
|
|
1231
|
-
```typescript
|
|
1232
|
-
{
|
|
1233
|
-
platform: "n8n" | "zapier" | "make" | "pipedream" | "custom",
|
|
1234
|
-
workflowId: string, // External platform's workflow ID
|
|
1235
|
-
name: string, // Workflow name
|
|
1236
|
-
description: string, // What the workflow does
|
|
1237
|
-
webhookUrl?: string, // Trigger URL
|
|
1238
|
-
active: boolean, // Is workflow active?
|
|
1239
|
-
tags: string[], // Workflow tags/categories
|
|
1240
|
-
inputSchema: { // Expected input parameters
|
|
1241
|
-
[key: string]: {
|
|
1242
|
-
type: "string" | "number" | "boolean" | "object" | "array",
|
|
1243
|
-
required: boolean,
|
|
1244
|
-
description: string,
|
|
1245
|
-
default?: any
|
|
1246
|
-
}
|
|
1247
|
-
},
|
|
1248
|
-
outputSchema: { // Expected output structure
|
|
1249
|
-
[key: string]: {
|
|
1250
|
-
type: "string" | "number" | "boolean" | "object" | "array",
|
|
1251
|
-
description: string
|
|
1252
|
-
}
|
|
1253
|
-
},
|
|
1254
|
-
executionCount: number, // Total executions
|
|
1255
|
-
successRate: number, // 0.0 to 1.0
|
|
1256
|
-
averageExecutionTime: number, // milliseconds
|
|
1257
|
-
lastExecutedAt?: number,
|
|
1258
|
-
createdAt: number,
|
|
1259
|
-
updatedAt: number
|
|
1260
|
-
}
|
|
1261
|
-
```
|
|
1262
|
-
|
|
1263
|
-
**External Connection Properties:**
|
|
1264
|
-
|
|
1265
|
-
```typescript
|
|
1266
|
-
{
|
|
1267
|
-
platform: "elizaos" | "n8n" | "zapier" | "make" | "autogen" | "custom",
|
|
1268
|
-
name: string, // Connection name
|
|
1269
|
-
baseUrl?: string, // API base URL
|
|
1270
|
-
apiKey?: string, // Encrypted API key
|
|
1271
|
-
websocketUrl?: string, // WebSocket endpoint
|
|
1272
|
-
webhookSecret?: string, // Webhook signature secret
|
|
1273
|
-
connectionType: "rest" | "websocket" | "webhook" | "graphql",
|
|
1274
|
-
authentication: {
|
|
1275
|
-
type: "apiKey" | "oauth" | "basic" | "bearer" | "custom",
|
|
1276
|
-
credentials: any // Encrypted credentials
|
|
1277
|
-
},
|
|
1278
|
-
status: "active" | "inactive" | "error",
|
|
1279
|
-
lastConnectedAt?: number,
|
|
1280
|
-
lastError?: string,
|
|
1281
|
-
linkedEntityIds: string[], // Connected agents/workflows
|
|
1282
|
-
rateLimits?: {
|
|
1283
|
-
requestsPerMinute: number,
|
|
1284
|
-
requestsPerDay: number
|
|
1285
|
-
},
|
|
1286
|
-
createdAt: number,
|
|
1287
|
-
updatedAt: number
|
|
1288
|
-
}
|
|
1289
|
-
```
|
|
1290
|
-
|
|
1291
|
-
**Session Properties:**
|
|
1292
|
-
|
|
1293
|
-
```typescript
|
|
1294
|
-
{
|
|
1295
|
-
userId: Id<"things">, // User this session belongs to
|
|
1296
|
-
token: string, // Session token (hashed)
|
|
1297
|
-
expiresAt: number, // Expiration timestamp
|
|
1298
|
-
ipAddress?: string, // IP address
|
|
1299
|
-
userAgent?: string, // Browser/device info
|
|
1300
|
-
lastActivityAt: number, // Last activity timestamp
|
|
1301
|
-
createdAt: number,
|
|
1302
|
-
}
|
|
1303
|
-
```
|
|
1304
|
-
|
|
1305
|
-
**OAuth Account Properties:**
|
|
1306
|
-
|
|
1307
|
-
```typescript
|
|
1308
|
-
{
|
|
1309
|
-
userId: Id<"things">, // User this account belongs to
|
|
1310
|
-
provider: "github" | "google" | "discord" | "twitter",
|
|
1311
|
-
providerAccountId: string, // Provider's user ID
|
|
1312
|
-
accessToken?: string, // Encrypted access token
|
|
1313
|
-
refreshToken?: string, // Encrypted refresh token
|
|
1314
|
-
expiresAt?: number, // Token expiration
|
|
1315
|
-
tokenType?: string, // Bearer, etc.
|
|
1316
|
-
scope?: string, // Granted scopes
|
|
1317
|
-
idToken?: string, // OpenID Connect ID token
|
|
1318
|
-
createdAt: number,
|
|
1319
|
-
updatedAt: number,
|
|
1320
|
-
}
|
|
1321
|
-
```
|
|
1322
|
-
|
|
1323
|
-
**Verification Token Properties:**
|
|
1324
|
-
|
|
1325
|
-
```typescript
|
|
1326
|
-
{
|
|
1327
|
-
userId: Id<"things">, // User to verify
|
|
1328
|
-
token: string, // Verification token (hashed)
|
|
1329
|
-
type: "email" | "two_factor", // Verification type
|
|
1330
|
-
expiresAt: number, // Expiration timestamp
|
|
1331
|
-
attempts: number, // Failed attempts count
|
|
1332
|
-
maxAttempts: number, // Max allowed attempts
|
|
1333
|
-
verifiedAt?: number, // When verified (if completed)
|
|
1334
|
-
createdAt: number,
|
|
1335
|
-
}
|
|
1336
|
-
```
|
|
1337
|
-
|
|
1338
|
-
**Password Reset Token Properties:**
|
|
1339
|
-
|
|
1340
|
-
```typescript
|
|
1341
|
-
{
|
|
1342
|
-
userId: Id<"things">, // User requesting reset
|
|
1343
|
-
token: string, // Reset token (hashed)
|
|
1344
|
-
expiresAt: number, // Expiration timestamp (15-30 min)
|
|
1345
|
-
usedAt?: number, // When token was used
|
|
1346
|
-
createdAt: number,
|
|
1347
|
-
}
|
|
1348
|
-
```
|
|
1349
|
-
|
|
1350
|
-
**UI Preferences Properties:**
|
|
1351
|
-
|
|
1352
|
-
```typescript
|
|
1353
|
-
{
|
|
1354
|
-
userId: Id<"things">, // User these preferences belong to
|
|
1355
|
-
theme: "light" | "dark" | "system",
|
|
1356
|
-
language: string, // ISO language code
|
|
1357
|
-
timezone: string, // IANA timezone
|
|
1358
|
-
dashboardLayout: {
|
|
1359
|
-
sidebarCollapsed: boolean,
|
|
1360
|
-
defaultView: "grid" | "list" | "kanban",
|
|
1361
|
-
itemsPerPage: number,
|
|
1362
|
-
},
|
|
1363
|
-
notifications: {
|
|
1364
|
-
email: boolean,
|
|
1365
|
-
push: boolean,
|
|
1366
|
-
sms: boolean,
|
|
1367
|
-
inApp: boolean,
|
|
1368
|
-
},
|
|
1369
|
-
accessibility: {
|
|
1370
|
-
reducedMotion: boolean,
|
|
1371
|
-
highContrast: boolean,
|
|
1372
|
-
fontSize: "small" | "medium" | "large",
|
|
1373
|
-
},
|
|
1374
|
-
customSettings: any, // App-specific settings
|
|
1375
|
-
updatedAt: number,
|
|
1376
|
-
}
|
|
1377
|
-
```
|
|
1378
|
-
|
|
1379
|
-
---
|
|
1380
|
-
|
|
1381
|
-
## CONNECTIONS: All The Relationships
|
|
1382
|
-
|
|
1383
|
-
### What Goes in Connections?
|
|
1384
|
-
|
|
1385
|
-
**Simple test:** If you're describing how thing X relates to thing Y, it's a connection.
|
|
1386
|
-
|
|
1387
|
-
Examples:
|
|
1388
|
-
|
|
1389
|
-
- "Creator **owns** token" ✅ Connection
|
|
1390
|
-
- "User **enrolled_in** course" ✅ Connection
|
|
1391
|
-
- "Agent **powers** AI clone" ✅ Connection
|
|
1392
|
-
- "Creator created a post" ❌ Event (action), not connection
|
|
1393
|
-
|
|
1394
|
-
### Connection Types (25 total)
|
|
1395
|
-
|
|
1396
|
-
**Design Principle:** Consolidated types with metadata for variants. Protocol identity stored in `metadata.protocol`.
|
|
1397
|
-
|
|
1398
|
-
```typescript
|
|
1399
|
-
type ConnectionType =
|
|
1400
|
-
// OWNERSHIP (2)
|
|
1401
|
-
| "owns"
|
|
1402
|
-
| "created_by"
|
|
1403
|
-
|
|
1404
|
-
// AI RELATIONSHIPS (3)
|
|
1405
|
-
| "clone_of"
|
|
1406
|
-
| "trained_on"
|
|
1407
|
-
| "powers"
|
|
1408
|
-
|
|
1409
|
-
// CONTENT RELATIONSHIPS (5)
|
|
1410
|
-
| "authored"
|
|
1411
|
-
| "generated_by"
|
|
1412
|
-
| "published_to"
|
|
1413
|
-
| "part_of"
|
|
1414
|
-
| "references"
|
|
1415
|
-
|
|
1416
|
-
// COMMUNITY RELATIONSHIPS (4)
|
|
1417
|
-
| "member_of"
|
|
1418
|
-
| "following"
|
|
1419
|
-
| "moderates"
|
|
1420
|
-
| "participated_in"
|
|
1421
|
-
|
|
1422
|
-
// BUSINESS RELATIONSHIPS (3)
|
|
1423
|
-
| "manages"
|
|
1424
|
-
| "reports_to"
|
|
1425
|
-
| "collaborates_with"
|
|
1426
|
-
|
|
1427
|
-
// TOKEN RELATIONSHIPS (3)
|
|
1428
|
-
| "holds_tokens"
|
|
1429
|
-
| "staked_in"
|
|
1430
|
-
| "earned_from"
|
|
1431
|
-
|
|
1432
|
-
// PRODUCT RELATIONSHIPS (4)
|
|
1433
|
-
| "purchased"
|
|
1434
|
-
| "enrolled_in"
|
|
1435
|
-
| "completed"
|
|
1436
|
-
| "teaching"
|
|
1437
|
-
|
|
1438
|
-
// CONSOLIDATED TYPES (use metadata for variants + protocol)
|
|
1439
|
-
| "transacted" // Payment/subscription/invoice (metadata.transactionType + protocol)
|
|
1440
|
-
| "notified" // Notifications (metadata.channel + notificationType)
|
|
1441
|
-
| "referred" // Referrals (metadata.referralType)
|
|
1442
|
-
| "communicated" // Agent/protocol communication (metadata.protocol + messageType)
|
|
1443
|
-
| "delegated" // Task/workflow delegation (metadata.protocol + taskType)
|
|
1444
|
-
| "approved" // Approvals (metadata.approvalType + protocol)
|
|
1445
|
-
| "fulfilled"; // Fulfillment (metadata.fulfillmentType + protocol)
|
|
1446
|
-
|
|
1447
|
-
// Total: 25 connection types
|
|
1448
|
-
```
|
|
1449
|
-
|
|
1450
|
-
### Connection Structure
|
|
1451
|
-
|
|
1452
|
-
```typescript
|
|
1453
|
-
{
|
|
1454
|
-
_id: Id<"connections">,
|
|
1455
|
-
fromThingId: Id<"things">,
|
|
1456
|
-
toThingId: Id<"things">,
|
|
1457
|
-
relationshipType: ConnectionType,
|
|
1458
|
-
metadata?: { // Optional relationship data
|
|
1459
|
-
// For revenue splits:
|
|
1460
|
-
revenueShare?: number, // 0.0 to 1.0
|
|
1461
|
-
// For token holdings:
|
|
1462
|
-
balance?: number,
|
|
1463
|
-
// For course enrollment:
|
|
1464
|
-
enrolledAt?: number,
|
|
1465
|
-
progress?: number,
|
|
1466
|
-
// etc...
|
|
1467
|
-
},
|
|
1468
|
-
strength?: number, // Relationship strength (0-1)
|
|
1469
|
-
validFrom?: number, // When relationship started
|
|
1470
|
-
validTo?: number, // When relationship ended
|
|
1471
|
-
createdAt: number,
|
|
1472
|
-
updatedAt?: number
|
|
1473
|
-
}
|
|
1474
|
-
```
|
|
1475
|
-
|
|
1476
|
-
### Common Connection Patterns
|
|
1477
|
-
|
|
1478
|
-
**Pattern: Ownership**
|
|
1479
|
-
|
|
1480
|
-
```typescript
|
|
1481
|
-
// Creator owns AI clone (thing-to-thing)
|
|
1482
|
-
{
|
|
1483
|
-
fromThingId: creatorId,
|
|
1484
|
-
toThingId: cloneId,
|
|
1485
|
-
relationshipType: "owns",
|
|
1486
|
-
createdAt: Date.now()
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
// E-Commerce: Store owns product inventory
|
|
1490
|
-
{
|
|
1491
|
-
fromThingId: groupId, // Store
|
|
1492
|
-
toThingId: productId,
|
|
1493
|
-
relationshipType: "owns",
|
|
1494
|
-
createdAt: Date.now()
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
// Education: Department owns course
|
|
1498
|
-
{
|
|
1499
|
-
fromThingId: departmentGroupId,
|
|
1500
|
-
toThingId: courseId,
|
|
1501
|
-
relationshipType: "owns",
|
|
1502
|
-
createdAt: Date.now()
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
// Crypto: DAO owns treasury tokens
|
|
1506
|
-
{
|
|
1507
|
-
fromThingId: daoGroupId,
|
|
1508
|
-
toThingId: tokenId,
|
|
1509
|
-
relationshipType: "owns",
|
|
1510
|
-
metadata: {
|
|
1511
|
-
balance: 1000000
|
|
1512
|
-
},
|
|
1513
|
-
createdAt: Date.now()
|
|
1514
|
-
}
|
|
1515
|
-
```
|
|
1516
|
-
|
|
1517
|
-
**Pattern: Revenue Split**
|
|
1518
|
-
|
|
1519
|
-
```typescript
|
|
1520
|
-
// Collaborator owns 30% of course
|
|
1521
|
-
{
|
|
1522
|
-
fromThingId: collaboratorId,
|
|
1523
|
-
toThingId: courseId,
|
|
1524
|
-
relationshipType: "owns",
|
|
1525
|
-
metadata: {
|
|
1526
|
-
revenueShare: 0.3
|
|
1527
|
-
},
|
|
1528
|
-
createdAt: Date.now()
|
|
1529
|
-
}
|
|
1530
|
-
```
|
|
1531
|
-
|
|
1532
|
-
**Pattern: Token Holding**
|
|
1533
|
-
|
|
1534
|
-
```typescript
|
|
1535
|
-
// User holds 1000 tokens
|
|
1536
|
-
{
|
|
1537
|
-
fromThingId: userId,
|
|
1538
|
-
toThingId: tokenId,
|
|
1539
|
-
relationshipType: "holds_tokens",
|
|
1540
|
-
metadata: {
|
|
1541
|
-
balance: 1000,
|
|
1542
|
-
acquiredAt: Date.now()
|
|
1543
|
-
},
|
|
1544
|
-
createdAt: Date.now()
|
|
1545
|
-
}
|
|
1546
|
-
```
|
|
1547
|
-
|
|
1548
|
-
**Pattern: Course Enrollment**
|
|
1549
|
-
|
|
1550
|
-
```typescript
|
|
1551
|
-
// User enrolled in course
|
|
1552
|
-
{
|
|
1553
|
-
fromThingId: userId,
|
|
1554
|
-
toThingId: courseId,
|
|
1555
|
-
relationshipType: "enrolled_in",
|
|
1556
|
-
metadata: {
|
|
1557
|
-
progress: 0.45, // 45% complete
|
|
1558
|
-
enrolledAt: Date.now(),
|
|
1559
|
-
lastAccessedAt: Date.now()
|
|
1560
|
-
},
|
|
1561
|
-
createdAt: Date.now()
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
// Education: Student enrolled in school with grade level
|
|
1565
|
-
{
|
|
1566
|
-
fromThingId: studentId,
|
|
1567
|
-
toThingId: courseId,
|
|
1568
|
-
relationshipType: "enrolled_in",
|
|
1569
|
-
metadata: {
|
|
1570
|
-
enrollmentType: "credit",
|
|
1571
|
-
progress: 0.65,
|
|
1572
|
-
currentGrade: 92.5,
|
|
1573
|
-
letterGrade: "A",
|
|
1574
|
-
enrolledAt: Date.now()
|
|
1575
|
-
},
|
|
1576
|
-
createdAt: Date.now()
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
// E-Commerce: Customer purchased product
|
|
1580
|
-
{
|
|
1581
|
-
fromThingId: customerId,
|
|
1582
|
-
toThingId: productId,
|
|
1583
|
-
relationshipType: "purchased",
|
|
1584
|
-
metadata: {
|
|
1585
|
-
quantity: 2,
|
|
1586
|
-
price: 49.99,
|
|
1587
|
-
currency: "USD",
|
|
1588
|
-
purchasedAt: Date.now()
|
|
1589
|
-
},
|
|
1590
|
-
createdAt: Date.now()
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
// Creator: Subscriber joined membership tier
|
|
1594
|
-
{
|
|
1595
|
-
fromThingId: subscriberId,
|
|
1596
|
-
toThingId: membershipTierId,
|
|
1597
|
-
relationshipType: "member_of",
|
|
1598
|
-
metadata: {
|
|
1599
|
-
tier: "pro",
|
|
1600
|
-
price: 9.99,
|
|
1601
|
-
interval: "monthly",
|
|
1602
|
-
subscribedAt: Date.now()
|
|
1603
|
-
},
|
|
1604
|
-
createdAt: Date.now()
|
|
1605
|
-
}
|
|
1606
|
-
```
|
|
1607
|
-
|
|
1608
|
-
**Pattern: Group Membership**
|
|
1609
|
-
|
|
1610
|
-
```typescript
|
|
1611
|
-
// User is member of group with role
|
|
1612
|
-
{
|
|
1613
|
-
fromThingId: userId,
|
|
1614
|
-
toThingId: groupId,
|
|
1615
|
-
relationshipType: "member_of",
|
|
1616
|
-
metadata: {
|
|
1617
|
-
role: "group_owner" | "group_user", // Group-specific role
|
|
1618
|
-
permissions: ["read", "write", "admin"],
|
|
1619
|
-
invitedBy?: Id<"things">, // Who invited this user
|
|
1620
|
-
invitedAt?: number,
|
|
1621
|
-
joinedAt: Date.now(),
|
|
1622
|
-
},
|
|
1623
|
-
createdAt: Date.now()
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
// Group owns content/resources
|
|
1627
|
-
{
|
|
1628
|
-
fromThingId: groupId,
|
|
1629
|
-
toThingId: contentId,
|
|
1630
|
-
relationshipType: "owns",
|
|
1631
|
-
metadata: {
|
|
1632
|
-
createdBy: userId, // User who created it
|
|
1633
|
-
},
|
|
1634
|
-
createdAt: Date.now()
|
|
1635
|
-
}
|
|
1636
|
-
```
|
|
1637
|
-
|
|
1638
|
-
**Pattern: Payment Transaction (Consolidated)**
|
|
1639
|
-
|
|
1640
|
-
```typescript
|
|
1641
|
-
// User paid for product (use "transacted" with metadata)
|
|
1642
|
-
{
|
|
1643
|
-
fromThingId: userId,
|
|
1644
|
-
toThingId: productId,
|
|
1645
|
-
relationshipType: "transacted",
|
|
1646
|
-
metadata: {
|
|
1647
|
-
transactionType: "payment", // or "subscription" or "invoice"
|
|
1648
|
-
amount: 99.00,
|
|
1649
|
-
currency: "USD",
|
|
1650
|
-
paymentId: "pi_123456",
|
|
1651
|
-
status: "completed"
|
|
1652
|
-
},
|
|
1653
|
-
createdAt: Date.now()
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
// User subscribed to service
|
|
1657
|
-
{
|
|
1658
|
-
fromThingId: userId,
|
|
1659
|
-
toThingId: subscriptionId,
|
|
1660
|
-
relationshipType: "transacted",
|
|
1661
|
-
metadata: {
|
|
1662
|
-
transactionType: "subscription",
|
|
1663
|
-
amount: 29.00,
|
|
1664
|
-
currency: "USD",
|
|
1665
|
-
interval: "monthly",
|
|
1666
|
-
subscriptionId: "sub_123456",
|
|
1667
|
-
status: "active"
|
|
1668
|
-
},
|
|
1669
|
-
createdAt: Date.now()
|
|
1670
|
-
}
|
|
1671
|
-
```
|
|
1672
|
-
|
|
1673
|
-
**Pattern: Referral (Consolidated)**
|
|
1674
|
-
|
|
1675
|
-
```typescript
|
|
1676
|
-
// User referred by another user (use "referred" with metadata)
|
|
1677
|
-
{
|
|
1678
|
-
fromThingId: newUserId,
|
|
1679
|
-
toThingId: referrerId,
|
|
1680
|
-
relationshipType: "referred",
|
|
1681
|
-
metadata: {
|
|
1682
|
-
referralType: "direct", // or "conversion" or "campaign"
|
|
1683
|
-
source: "referral_link",
|
|
1684
|
-
referralCode: "REF123",
|
|
1685
|
-
tokensEarned: 100,
|
|
1686
|
-
status: "converted"
|
|
1687
|
-
},
|
|
1688
|
-
createdAt: Date.now()
|
|
1689
|
-
}
|
|
1690
|
-
```
|
|
1691
|
-
|
|
1692
|
-
**Pattern: Notification (Consolidated)**
|
|
1693
|
-
|
|
1694
|
-
```typescript
|
|
1695
|
-
// User notified about event (use "notified" with metadata)
|
|
1696
|
-
{
|
|
1697
|
-
fromThingId: userId,
|
|
1698
|
-
toThingId: notificationId,
|
|
1699
|
-
relationshipType: "notified",
|
|
1700
|
-
metadata: {
|
|
1701
|
-
channel: "email", // or "sms" or "push" or "in_app"
|
|
1702
|
-
campaignId: campaignId, // optional
|
|
1703
|
-
deliveredAt: Date.now(),
|
|
1704
|
-
readAt: Date.now(),
|
|
1705
|
-
clicked: true
|
|
1706
|
-
},
|
|
1707
|
-
createdAt: Date.now()
|
|
1708
|
-
}
|
|
1709
|
-
```
|
|
1710
|
-
|
|
1711
|
-
---
|
|
1712
|
-
|
|
1713
|
-
## EVENTS: All The Actions
|
|
1714
|
-
|
|
1715
|
-
### What Goes in Events?
|
|
1716
|
-
|
|
1717
|
-
**Simple test:** If you're describing something that HAPPENED at a specific TIME, it's an event.
|
|
1718
|
-
|
|
1719
|
-
Examples:
|
|
1720
|
-
|
|
1721
|
-
- "User **purchased** tokens at 3pm" ✅ Event
|
|
1722
|
-
- "Content **was published** yesterday" ✅ Event
|
|
1723
|
-
- "Clone **interacted** with user" ✅ Event
|
|
1724
|
-
- "User owns tokens" ❌ Connection (state), not event
|
|
1725
|
-
|
|
1726
|
-
### Event Types (35 total)
|
|
1727
|
-
|
|
1728
|
-
**Design Principle:** Consolidated types with metadata for variants. Protocol identity stored in `metadata.protocol`.
|
|
1729
|
-
|
|
1730
|
-
```typescript
|
|
1731
|
-
type EventType =
|
|
1732
|
-
// THING LIFECYCLE (3) - Consolidated with metadata.thingType
|
|
1733
|
-
| "thing_created" // metadata: { thingType: "group" | "user" | "course" | etc. }
|
|
1734
|
-
| "thing_updated" // metadata: { thingType, action: "updated" | "archived" | "restored" }
|
|
1735
|
-
| "thing_deleted" // metadata: { thingType, action: "deleted" | "archived", deletionType: "soft" | "hard" }
|
|
1736
|
-
|
|
1737
|
-
// USER EVENTS (5)
|
|
1738
|
-
| "user_registered"
|
|
1739
|
-
| "user_verified"
|
|
1740
|
-
| "user_login"
|
|
1741
|
-
| "user_logout"
|
|
1742
|
-
| "profile_updated"
|
|
1743
|
-
|
|
1744
|
-
// AUTHENTICATION EVENTS (6)
|
|
1745
|
-
| "password_reset_requested"
|
|
1746
|
-
| "password_reset_completed"
|
|
1747
|
-
| "email_verification_sent"
|
|
1748
|
-
| "email_verified"
|
|
1749
|
-
| "two_factor_enabled"
|
|
1750
|
-
| "two_factor_disabled"
|
|
1751
|
-
|
|
1752
|
-
// GROUP-SPECIFIC EVENTS (3) - Not lifecycle events (those use thing_*)
|
|
1753
|
-
| "user_invited_to_group"
|
|
1754
|
-
| "user_joined_group"
|
|
1755
|
-
| "user_removed_from_group"
|
|
1756
|
-
|
|
1757
|
-
// DASHBOARD & UI EVENTS (4)
|
|
1758
|
-
| "dashboard_viewed"
|
|
1759
|
-
| "settings_updated"
|
|
1760
|
-
| "theme_changed"
|
|
1761
|
-
| "preferences_updated"
|
|
1762
|
-
|
|
1763
|
-
// AI/CLONE EVENTS (2) - Creation uses thing_created with thingType: "clone"
|
|
1764
|
-
| "voice_cloned"
|
|
1765
|
-
| "appearance_cloned"
|
|
1766
|
-
|
|
1767
|
-
// AGENT EVENTS (3) - Creation uses thing_created with thingType: "agent"
|
|
1768
|
-
| "agent_executed"
|
|
1769
|
-
| "agent_completed"
|
|
1770
|
-
| "agent_failed"
|
|
1771
|
-
|
|
1772
|
-
// TOKEN EVENTS (6) - Creation uses thing_created with thingType: "token"
|
|
1773
|
-
| "token_minted"
|
|
1774
|
-
| "token_burned"
|
|
1775
|
-
| "tokens_purchased"
|
|
1776
|
-
| "tokens_staked"
|
|
1777
|
-
| "tokens_unstaked"
|
|
1778
|
-
| "tokens_transferred"
|
|
1779
|
-
|
|
1780
|
-
// COURSE EVENTS (4) - Creation uses thing_created with thingType: "course"
|
|
1781
|
-
| "course_enrolled"
|
|
1782
|
-
| "lesson_completed"
|
|
1783
|
-
| "course_completed"
|
|
1784
|
-
| "certificate_earned"
|
|
1785
|
-
|
|
1786
|
-
// ANALYTICS EVENTS (5)
|
|
1787
|
-
| "metric_calculated"
|
|
1788
|
-
| "insight_generated"
|
|
1789
|
-
| "prediction_made"
|
|
1790
|
-
| "optimization_applied"
|
|
1791
|
-
| "report_generated"
|
|
1792
|
-
|
|
1793
|
-
// CYCLEENCE EVENTS (7) - NEW
|
|
1794
|
-
| "cycle_request" // User requests AI cycle
|
|
1795
|
-
| "cycle_completed" // Cycle result delivered
|
|
1796
|
-
| "cycle_failed" // Cycle failed
|
|
1797
|
-
| "cycle_quota_exceeded" // Monthly limit hit
|
|
1798
|
-
| "cycle_revenue_collected" // Daily revenue sweep
|
|
1799
|
-
| "org_revenue_generated" // Group generates platform revenue
|
|
1800
|
-
| "revenue_share_distributed" // Revenue share paid out
|
|
1801
|
-
|
|
1802
|
-
// BLOCKCHAIN EVENTS (5) - NEW
|
|
1803
|
-
| "nft_minted" // NFT created on-chain
|
|
1804
|
-
| "nft_transferred" // NFT ownership changed
|
|
1805
|
-
| "tokens_bridged" // Cross-chain bridge
|
|
1806
|
-
| "contract_deployed" // Smart contract deployed
|
|
1807
|
-
| "treasury_withdrawal" // Platform owner withdraws revenue
|
|
1808
|
-
|
|
1809
|
-
// CONSOLIDATED EVENTS (use metadata for variants + protocol)
|
|
1810
|
-
| "content_event" // metadata.action: created|updated|deleted|viewed|shared|liked
|
|
1811
|
-
| "payment_event" // metadata.status: requested|verified|processed + protocol
|
|
1812
|
-
| "subscription_event" // metadata.action: started|renewed|cancelled
|
|
1813
|
-
| "commerce_event" // metadata.eventType + protocol (ACP, AP2)
|
|
1814
|
-
| "livestream_event" // metadata.status: started|ended + metadata.action: joined|left|chat|donation
|
|
1815
|
-
| "notification_event" // metadata.channel: email|sms|push|in_app + deliveryStatus
|
|
1816
|
-
| "referral_event" // metadata.action: created|completed|rewarded
|
|
1817
|
-
| "communication_event" // metadata.protocol (A2A, ACP, AG-UI) + messageType
|
|
1818
|
-
| "task_event" // metadata.action: delegated|completed|failed + protocol
|
|
1819
|
-
| "mandate_event" // metadata.mandateType: intent|cart + protocol (AP2)
|
|
1820
|
-
| "price_event"; // metadata.action: checked|changed
|
|
1821
|
-
|
|
1822
|
-
// Total: 52 event types (35 original + 7 cycle + 5 blockchain + 5 NFT overlap)
|
|
1823
|
-
```
|
|
1824
|
-
|
|
1825
|
-
### Event Structure
|
|
1826
|
-
|
|
1827
|
-
```typescript
|
|
1828
|
-
{
|
|
1829
|
-
_id: Id<"events">,
|
|
1830
|
-
type: EventType, // What happened
|
|
1831
|
-
actorId: Id<"things">, // Who/what caused this
|
|
1832
|
-
targetId?: Id<"things">, // Optional target thing
|
|
1833
|
-
timestamp: number, // When it happened
|
|
1834
|
-
metadata: any // Event-specific data
|
|
1835
|
-
}
|
|
1836
|
-
```
|
|
1837
|
-
|
|
1838
|
-
**Metadata Structure:**
|
|
1839
|
-
|
|
1840
|
-
The `metadata` field is flexible JSON that ALWAYS includes `protocol` for protocol-specific events:
|
|
1841
|
-
|
|
1842
|
-
```typescript
|
|
1843
|
-
// Protocol-agnostic events (no protocol field needed)
|
|
1844
|
-
{ action: "created", contentType: "blog_post" }
|
|
1845
|
-
|
|
1846
|
-
// Protocol-specific events (includes protocol identifier)
|
|
1847
|
-
{
|
|
1848
|
-
protocol: "a2a" | "acp" | "ap2" | "x402" | "ag-ui",
|
|
1849
|
-
// ... protocol-specific fields
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
// Examples:
|
|
1853
|
-
// A2A message
|
|
1854
|
-
{ protocol: "a2a", messageType: "task_delegation", task: "research" }
|
|
1855
|
-
|
|
1856
|
-
// ACP commerce
|
|
1857
|
-
{ protocol: "acp", eventType: "purchase_initiated", agentPlatform: "chatgpt" }
|
|
1858
|
-
|
|
1859
|
-
// AP2 mandate
|
|
1860
|
-
{ protocol: "ap2", mandateType: "intent", autoExecute: true }
|
|
1861
|
-
|
|
1862
|
-
// X402 payment
|
|
1863
|
-
{ protocol: "x402", network: "base", txHash: "0x..." }
|
|
1864
|
-
```
|
|
1865
|
-
|
|
1866
|
-
### Event Patterns
|
|
1867
|
-
|
|
1868
|
-
**Pattern: User Action**
|
|
1869
|
-
|
|
1870
|
-
```typescript
|
|
1871
|
-
// User purchased tokens
|
|
1872
|
-
{
|
|
1873
|
-
type: "tokens_purchased",
|
|
1874
|
-
actorId: userId,
|
|
1875
|
-
targetId: tokenId,
|
|
1876
|
-
timestamp: Date.now(),
|
|
1877
|
-
metadata: {
|
|
1878
|
-
amount: 100,
|
|
1879
|
-
usdAmount: 10,
|
|
1880
|
-
paymentId: "pi_123",
|
|
1881
|
-
txHash: "0x456"
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
```
|
|
1885
|
-
|
|
1886
|
-
**Pattern: Payment Event (Consolidated)**
|
|
1887
|
-
|
|
1888
|
-
```typescript
|
|
1889
|
-
// Payment completed (use "payment_processed" with metadata.status)
|
|
1890
|
-
{
|
|
1891
|
-
type: "payment_processed",
|
|
1892
|
-
actorId: userId,
|
|
1893
|
-
targetId: paymentId,
|
|
1894
|
-
timestamp: Date.now(),
|
|
1895
|
-
metadata: {
|
|
1896
|
-
status: "completed", // or "initiated" | "failed" | "refunded"
|
|
1897
|
-
amount: 99.00,
|
|
1898
|
-
currency: "USD",
|
|
1899
|
-
paymentId: "pi_123456",
|
|
1900
|
-
method: "stripe"
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
// Subscription renewed (use "subscription_updated" with metadata.action)
|
|
1905
|
-
{
|
|
1906
|
-
type: "subscription_updated",
|
|
1907
|
-
actorId: userId,
|
|
1908
|
-
targetId: subscriptionId,
|
|
1909
|
-
timestamp: Date.now(),
|
|
1910
|
-
metadata: {
|
|
1911
|
-
action: "renewed", // or "started" | "cancelled"
|
|
1912
|
-
tier: "pro",
|
|
1913
|
-
amount: 29.00,
|
|
1914
|
-
nextBillingDate: Date.now() + 30 * 24 * 60 * 60 * 1000
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
```
|
|
1918
|
-
|
|
1919
|
-
**Pattern: Content Event (Consolidated)**
|
|
1920
|
-
|
|
1921
|
-
```typescript
|
|
1922
|
-
// Content created (use "content_changed" with metadata.action)
|
|
1923
|
-
{
|
|
1924
|
-
type: "content_changed",
|
|
1925
|
-
actorId: creatorId,
|
|
1926
|
-
targetId: contentId,
|
|
1927
|
-
timestamp: Date.now(),
|
|
1928
|
-
metadata: {
|
|
1929
|
-
action: "created", // or "updated" | "deleted"
|
|
1930
|
-
contentType: "blog_post",
|
|
1931
|
-
generatedBy: "marketing_agent",
|
|
1932
|
-
platform: "instagram"
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
|
-
// Content viewed (use "content_interacted" with metadata.interactionType)
|
|
1937
|
-
{
|
|
1938
|
-
type: "content_interacted",
|
|
1939
|
-
actorId: userId,
|
|
1940
|
-
targetId: contentId,
|
|
1941
|
-
timestamp: Date.now(),
|
|
1942
|
-
metadata: {
|
|
1943
|
-
interactionType: "viewed", // or "shared" | "liked"
|
|
1944
|
-
duration: 120, // seconds
|
|
1945
|
-
source: "feed"
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
// Education: Assignment submitted
|
|
1950
|
-
{
|
|
1951
|
-
type: "content_changed",
|
|
1952
|
-
actorId: studentId,
|
|
1953
|
-
targetId: submissionId,
|
|
1954
|
-
timestamp: Date.now(),
|
|
1955
|
-
metadata: {
|
|
1956
|
-
action: "submitted",
|
|
1957
|
-
contentType: "assignment",
|
|
1958
|
-
assignmentId: assignmentId,
|
|
1959
|
-
courseId: courseId,
|
|
1960
|
-
isLate: false
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
// E-Commerce: Product reviewed
|
|
1965
|
-
{
|
|
1966
|
-
type: "content_interacted",
|
|
1967
|
-
actorId: customerId,
|
|
1968
|
-
targetId: productId,
|
|
1969
|
-
timestamp: Date.now(),
|
|
1970
|
-
metadata: {
|
|
1971
|
-
interactionType: "reviewed",
|
|
1972
|
-
rating: 5,
|
|
1973
|
-
reviewText: "Great product!",
|
|
1974
|
-
verified: true
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
|
-
// Creator: Video published
|
|
1979
|
-
{
|
|
1980
|
-
type: "content_changed",
|
|
1981
|
-
actorId: creatorId,
|
|
1982
|
-
targetId: videoId,
|
|
1983
|
-
timestamp: Date.now(),
|
|
1984
|
-
metadata: {
|
|
1985
|
-
action: "published",
|
|
1986
|
-
contentType: "youtube_video",
|
|
1987
|
-
platform: "youtube",
|
|
1988
|
-
viewCount: 0,
|
|
1989
|
-
engagementMetrics: {}
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
```
|
|
1993
|
-
|
|
1994
|
-
**Pattern: Livestream Event (Consolidated)**
|
|
1995
|
-
|
|
1996
|
-
```typescript
|
|
1997
|
-
// Livestream started (use "livestream_status_changed" with metadata.status)
|
|
1998
|
-
{
|
|
1999
|
-
type: "livestream_status_changed",
|
|
2000
|
-
actorId: creatorId,
|
|
2001
|
-
targetId: livestreamId,
|
|
2002
|
-
timestamp: Date.now(),
|
|
2003
|
-
metadata: {
|
|
2004
|
-
status: "started", // or "scheduled" | "ended"
|
|
2005
|
-
streamId: "stream_123",
|
|
2006
|
-
platform: "cloudflare",
|
|
2007
|
-
rtmpUrl: "rtmp://..."
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
// Viewer joined (use "livestream_interaction" with metadata.type)
|
|
2012
|
-
{
|
|
2013
|
-
type: "livestream_interaction",
|
|
2014
|
-
actorId: viewerId,
|
|
2015
|
-
targetId: livestreamId,
|
|
2016
|
-
timestamp: Date.now(),
|
|
2017
|
-
metadata: {
|
|
2018
|
-
type: "joined", // or "left" | "message"
|
|
2019
|
-
viewerCount: 42,
|
|
2020
|
-
message: "Hello!" // if type === "message"
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
```
|
|
2024
|
-
|
|
2025
|
-
**Pattern: Notification Event (Consolidated)**
|
|
2026
|
-
|
|
2027
|
-
```typescript
|
|
2028
|
-
// Email notification sent (use "notification_delivered" with metadata.channel)
|
|
2029
|
-
{
|
|
2030
|
-
type: "notification_delivered",
|
|
2031
|
-
actorId: systemId,
|
|
2032
|
-
targetId: userId,
|
|
2033
|
-
timestamp: Date.now(),
|
|
2034
|
-
metadata: {
|
|
2035
|
-
channel: "email", // or "sms" | "push" | "in_app"
|
|
2036
|
-
messageId: "msg_123",
|
|
2037
|
-
subject: "New content available",
|
|
2038
|
-
deliveredAt: Date.now(),
|
|
2039
|
-
readAt: Date.now() + 1000 // optional
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
```
|
|
2043
|
-
|
|
2044
|
-
**Pattern: AI Interaction**
|
|
2045
|
-
|
|
2046
|
-
```typescript
|
|
2047
|
-
// Clone chatted with user
|
|
2048
|
-
{
|
|
2049
|
-
type: "clone_interaction",
|
|
2050
|
-
actorId: userId,
|
|
2051
|
-
targetId: cloneId,
|
|
2052
|
-
timestamp: Date.now(),
|
|
2053
|
-
metadata: {
|
|
2054
|
-
message: "How do I start?",
|
|
2055
|
-
response: "Let me help you...",
|
|
2056
|
-
tokensUsed: 150,
|
|
2057
|
-
sentiment: "positive"
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
```
|
|
2061
|
-
|
|
2062
|
-
**Pattern: Metric Tracking**
|
|
2063
|
-
|
|
2064
|
-
```typescript
|
|
2065
|
-
// Token price calculated
|
|
2066
|
-
{
|
|
2067
|
-
type: "metric_calculated",
|
|
2068
|
-
actorId: systemId,
|
|
2069
|
-
targetId: tokenId,
|
|
2070
|
-
timestamp: Date.now(),
|
|
2071
|
-
metadata: {
|
|
2072
|
-
metric: "token_price",
|
|
2073
|
-
value: 0.12,
|
|
2074
|
-
change: +0.05,
|
|
2075
|
-
changePercent: 4.2
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
```
|
|
2079
|
-
|
|
2080
|
-
**Pattern: Authentication Events**
|
|
2081
|
-
|
|
2082
|
-
```typescript
|
|
2083
|
-
// Password reset requested
|
|
2084
|
-
{
|
|
2085
|
-
type: "password_reset_requested",
|
|
2086
|
-
actorId: userId,
|
|
2087
|
-
targetId: passwordResetTokenId,
|
|
2088
|
-
timestamp: Date.now(),
|
|
2089
|
-
metadata: {
|
|
2090
|
-
email: "user@example.com",
|
|
2091
|
-
ipAddress: "192.168.1.1",
|
|
2092
|
-
expiresAt: Date.now() + 30 * 60 * 1000 // 30 minutes
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
|
|
2096
|
-
// Email verified
|
|
2097
|
-
{
|
|
2098
|
-
type: "email_verified",
|
|
2099
|
-
actorId: userId,
|
|
2100
|
-
targetId: verificationTokenId,
|
|
2101
|
-
timestamp: Date.now(),
|
|
2102
|
-
metadata: {
|
|
2103
|
-
email: "user@example.com",
|
|
2104
|
-
verificationMethod: "link" | "code"
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
// Two-factor enabled
|
|
2109
|
-
{
|
|
2110
|
-
type: "two_factor_enabled",
|
|
2111
|
-
actorId: userId,
|
|
2112
|
-
timestamp: Date.now(),
|
|
2113
|
-
metadata: {
|
|
2114
|
-
method: "totp" | "sms" | "email",
|
|
2115
|
-
backupCodesGenerated: 10
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
```
|
|
2119
|
-
|
|
2120
|
-
**Pattern: Group Events**
|
|
2121
|
-
|
|
2122
|
-
```typescript
|
|
2123
|
-
// Group created
|
|
2124
|
-
{
|
|
2125
|
-
type: "group_created",
|
|
2126
|
-
actorId: creatorId,
|
|
2127
|
-
targetId: groupId,
|
|
2128
|
-
timestamp: Date.now(),
|
|
2129
|
-
metadata: {
|
|
2130
|
-
name: "Acme Corp",
|
|
2131
|
-
slug: "acme",
|
|
2132
|
-
plan: "pro",
|
|
2133
|
-
trialEndsAt: Date.now() + 14 * 24 * 60 * 60 * 1000 // 14 days
|
|
2134
|
-
}
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
// User invited to group
|
|
2138
|
-
{
|
|
2139
|
-
type: "user_invited_to_group",
|
|
2140
|
-
actorId: inviterId,
|
|
2141
|
-
targetId: groupId,
|
|
2142
|
-
timestamp: Date.now(),
|
|
2143
|
-
metadata: {
|
|
2144
|
-
invitedEmail: "newuser@example.com",
|
|
2145
|
-
role: "group_user",
|
|
2146
|
-
inviteToken: "inv_123456",
|
|
2147
|
-
expiresAt: Date.now() + 7 * 24 * 60 * 60 * 1000 // 7 days
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
// User joined group
|
|
2152
|
-
{
|
|
2153
|
-
type: "user_joined_group",
|
|
2154
|
-
actorId: userId,
|
|
2155
|
-
targetId: groupId,
|
|
2156
|
-
timestamp: Date.now(),
|
|
2157
|
-
metadata: {
|
|
2158
|
-
role: "group_user",
|
|
2159
|
-
invitedBy: inviterId
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
```
|
|
2163
|
-
|
|
2164
|
-
**Pattern: Dashboard & UI Events**
|
|
2165
|
-
|
|
2166
|
-
```typescript
|
|
2167
|
-
// Dashboard viewed
|
|
2168
|
-
{
|
|
2169
|
-
type: "dashboard_viewed",
|
|
2170
|
-
actorId: userId,
|
|
2171
|
-
timestamp: Date.now(),
|
|
2172
|
-
metadata: {
|
|
2173
|
-
dashboardType: "platform_owner" | "group_owner" | "group_user" | "customer",
|
|
2174
|
-
groupId?: groupId,
|
|
2175
|
-
route: "/admin/dashboard",
|
|
2176
|
-
sessionDuration: 0 // Updated on session end
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
// Theme changed
|
|
2181
|
-
{
|
|
2182
|
-
type: "theme_changed",
|
|
2183
|
-
actorId: userId,
|
|
2184
|
-
targetId: uiPreferencesId,
|
|
2185
|
-
timestamp: Date.now(),
|
|
2186
|
-
metadata: {
|
|
2187
|
-
previousTheme: "light",
|
|
2188
|
-
newTheme: "dark"
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
// Settings updated
|
|
2193
|
-
{
|
|
2194
|
-
type: "settings_updated",
|
|
2195
|
-
actorId: userId,
|
|
2196
|
-
targetId: uiPreferencesId,
|
|
2197
|
-
timestamp: Date.now(),
|
|
2198
|
-
metadata: {
|
|
2199
|
-
updatedFields: ["dashboardLayout", "notifications"],
|
|
2200
|
-
changes: {
|
|
2201
|
-
"dashboardLayout.sidebarCollapsed": { from: false, to: true },
|
|
2202
|
-
"notifications.email": { from: true, to: false }
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
```
|
|
2207
|
-
|
|
2208
|
-
---
|
|
2209
|
-
|
|
2210
|
-
## KNOWLEDGE Labels & Semantic Chunks
|
|
2211
|
-
|
|
2212
|
-
Use knowledge items of `knowledgeType: 'label'` for taxonomy and `knowledgeType: 'chunk'` for RAG. Associate via `thingKnowledge`.
|
|
2213
|
-
|
|
2214
|
-
Examples:
|
|
2215
|
-
|
|
2216
|
-
- "This creator is in the fitness industry" ✅ label knowledge with `labels: ['industry:fitness']`
|
|
2217
|
-
- "This content is video format" ✅ label knowledge with `labels: ['format:video']`
|
|
2218
|
-
- "This page content paragraph 3" ✅ chunk knowledge with `text` + `embedding`
|
|
2219
|
-
|
|
2220
|
-
Pattern: multi‑label entity
|
|
2221
|
-
|
|
2222
|
-
```typescript
|
|
2223
|
-
const labels = [
|
|
2224
|
-
"industry:fitness",
|
|
2225
|
-
"skill:video-editing",
|
|
2226
|
-
"technology:youtube",
|
|
2227
|
-
"audience:beginners",
|
|
2228
|
-
];
|
|
2229
|
-
for (const label of labels) {
|
|
2230
|
-
const kid = await getOrCreateKnowledgeLabel(label);
|
|
2231
|
-
await db.insert("thingKnowledge", {
|
|
2232
|
-
thingId: creatorId,
|
|
2233
|
-
knowledgeId: kid,
|
|
2234
|
-
role: "label",
|
|
2235
|
-
createdAt: Date.now(),
|
|
2236
|
-
});
|
|
2237
|
-
}
|
|
2238
|
-
```
|
|
2239
|
-
|
|
2240
|
-
Pattern: semantic search across chunks
|
|
2241
|
-
|
|
2242
|
-
```typescript
|
|
2243
|
-
// Given a query embedding, find top-k similar chunks for a group
|
|
2244
|
-
const topK = await vectorSearch("knowledge", {
|
|
2245
|
-
vectorField: "embedding",
|
|
2246
|
-
query: queryEmbedding,
|
|
2247
|
-
filter: { "sourceThingId.groupId": groupId, knowledgeType: "chunk" },
|
|
2248
|
-
k: 10,
|
|
2249
|
-
});
|
|
2250
|
-
```
|
|
2251
|
-
|
|
2252
|
-
---
|
|
2253
|
-
|
|
2254
|
-
## How Features Map to Ontology
|
|
2255
|
-
|
|
2256
|
-
### Feature: AI Clone Creation
|
|
2257
|
-
|
|
2258
|
-
**Things Created:**
|
|
2259
|
-
|
|
2260
|
-
1. `ai_clone` thing (the clone)
|
|
2261
|
-
2. `knowledge_item` entities (training data)
|
|
2262
|
-
|
|
2263
|
-
**Connections Created:**
|
|
2264
|
-
|
|
2265
|
-
1. creator → ai_clone (relationship: "owns")
|
|
2266
|
-
2. ai_clone → knowledge_items (relationship: "trained_on")
|
|
2267
|
-
|
|
2268
|
-
**Events Logged:**
|
|
2269
|
-
|
|
2270
|
-
1. `clone_created` (when clone created)
|
|
2271
|
-
2. `voice_cloned` (when voice ready)
|
|
2272
|
-
3. `appearance_cloned` (when appearance ready)
|
|
2273
|
-
|
|
2274
|
-
**Knowledge Labels Added:**
|
|
2275
|
-
|
|
2276
|
-
- Clone inherits creator's labels
|
|
2277
|
-
- Additional: "ai_clone", "active"
|
|
2278
|
-
|
|
2279
|
-
### Feature: Token Purchase
|
|
2280
|
-
|
|
2281
|
-
**Things Involved:**
|
|
2282
|
-
|
|
2283
|
-
1. `token` thing (the token being purchased)
|
|
2284
|
-
2. `audience_member` thing (the buyer)
|
|
2285
|
-
|
|
2286
|
-
**Connections Created/Updated:**
|
|
2287
|
-
|
|
2288
|
-
1. buyer → token (relationship: "holds_tokens", metadata: { balance: 100 })
|
|
2289
|
-
|
|
2290
|
-
**Events Logged:**
|
|
2291
|
-
|
|
2292
|
-
1. `tokens_purchased` (the purchase)
|
|
2293
|
-
2. `revenue_generated` (for creator)
|
|
2294
|
-
|
|
2295
|
-
**Knowledge Labels Added:**
|
|
2296
|
-
|
|
2297
|
-
- None (tokens already labeled)
|
|
2298
|
-
|
|
2299
|
-
### Feature: Course Generation
|
|
2300
|
-
|
|
2301
|
-
**Things Created:**
|
|
2302
|
-
|
|
2303
|
-
1. `course` entity
|
|
2304
|
-
2. `lesson` entities (multiple)
|
|
2305
|
-
|
|
2306
|
-
**Connections Created:**
|
|
2307
|
-
|
|
2308
|
-
1. creator → course (relationship: "owns")
|
|
2309
|
-
2. ai_clone → course (relationship: "teaching")
|
|
2310
|
-
3. course → lessons (relationship: "part_of")
|
|
2311
|
-
|
|
2312
|
-
**Events Logged:**
|
|
2313
|
-
|
|
2314
|
-
1. `course_created`
|
|
2315
|
-
2. `content_generated` (for each lesson)
|
|
2316
|
-
|
|
2317
|
-
**Knowledge Labels Added:**
|
|
2318
|
-
|
|
2319
|
-
- skill labels (what course teaches)
|
|
2320
|
-
- industry labels (course category)
|
|
2321
|
-
- audience labels (target audience)
|
|
2322
|
-
|
|
2323
|
-
### Feature: ELEVATE Journey
|
|
2324
|
-
|
|
2325
|
-
**Things Involved:**
|
|
2326
|
-
|
|
2327
|
-
1. `audience_member` (user going through journey)
|
|
2328
|
-
2. Workflow thing (tracks progress)
|
|
2329
|
-
|
|
2330
|
-
**Connections Created:**
|
|
2331
|
-
|
|
2332
|
-
- None (journey tracked in workflow state)
|
|
2333
|
-
|
|
2334
|
-
**Events Logged:**
|
|
2335
|
-
|
|
2336
|
-
1. `journey_step_completed` (for each step: hook, gift, identify, etc.)
|
|
2337
|
-
2. `achievement_unlocked` (at milestones)
|
|
2338
|
-
3. `tokens_earned` (rewards)
|
|
2339
|
-
|
|
2340
|
-
**Knowledge Labels Added:**
|
|
2341
|
-
|
|
2342
|
-
- Status labels (current step)
|
|
2343
|
-
|
|
2344
|
-
### Domain-Specific Feature Mapping
|
|
2345
|
-
|
|
2346
|
-
**E-Commerce: Shopping Cart Checkout**
|
|
2347
|
-
|
|
2348
|
-
**Things Created/Used:**
|
|
2349
|
-
|
|
2350
|
-
- `mandate` thing (shopping cart)
|
|
2351
|
-
- `product` thing (items in cart)
|
|
2352
|
-
- `payment` thing (transaction record)
|
|
2353
|
-
|
|
2354
|
-
**Connections Created:**
|
|
2355
|
-
|
|
2356
|
-
- customer → mandate (relationship: "owns" or "has_active_cart")
|
|
2357
|
-
- mandate → product items (relationship: "contains")
|
|
2358
|
-
- customer → payment (relationship: "transacted", metadata: { transactionType: "payment" })
|
|
2359
|
-
|
|
2360
|
-
**Events Logged:**
|
|
2361
|
-
|
|
2362
|
-
- `mandate_event` (cart created, items added, checkout started)
|
|
2363
|
-
- `payment_event` (payment processed)
|
|
2364
|
-
- `commerce_event` (order completed)
|
|
2365
|
-
|
|
2366
|
-
**Knowledge Added:**
|
|
2367
|
-
|
|
2368
|
-
- Order items tagged for analytics
|
|
2369
|
-
|
|
2370
|
-
---
|
|
2371
|
-
|
|
2372
|
-
**Education: Course Enrollment & Grading**
|
|
2373
|
-
|
|
2374
|
-
**Things Created/Used:**
|
|
2375
|
-
|
|
2376
|
-
- `course` thing
|
|
2377
|
-
- `lesson` things (modules, assignments)
|
|
2378
|
-
- `submission` thing (student work)
|
|
2379
|
-
- `metric` thing (grades)
|
|
2380
|
-
|
|
2381
|
-
**Connections Created:**
|
|
2382
|
-
|
|
2383
|
-
- student → course (relationship: "enrolled_in", metadata: { progress, grade })
|
|
2384
|
-
- student → submission (relationship: "submitted_for")
|
|
2385
|
-
- submission → lesson (relationship: "part_of")
|
|
2386
|
-
- teacher → submission (relationship: "graded_by")
|
|
2387
|
-
|
|
2388
|
-
**Events Logged:**
|
|
2389
|
-
|
|
2390
|
-
- `course_enrolled` (enrollment)
|
|
2391
|
-
- `content_event` (lesson viewed/completed)
|
|
2392
|
-
- `content_changed` (assignment submitted)
|
|
2393
|
-
- `metric_calculated` (grade calculated)
|
|
2394
|
-
|
|
2395
|
-
**Knowledge Added:**
|
|
2396
|
-
|
|
2397
|
-
- Competency labels (skills demonstrated)
|
|
2398
|
-
- Performance level tags
|
|
2399
|
-
|
|
2400
|
-
---
|
|
2401
|
-
|
|
2402
|
-
**Creator: Multi-Platform Publishing**
|
|
2403
|
-
|
|
2404
|
-
**Things Created/Used:**
|
|
2405
|
-
|
|
2406
|
-
- `video` thing (YouTube upload)
|
|
2407
|
-
- `podcast` thing (episode)
|
|
2408
|
-
- `blog_post` thing (newsletter)
|
|
2409
|
-
- `email_campaign` thing (broadcast)
|
|
2410
|
-
|
|
2411
|
-
**Connections Created:**
|
|
2412
|
-
|
|
2413
|
-
- creator → content (relationship: "authored")
|
|
2414
|
-
- content → platform (relationship: "published_to", metadata: { platform: "youtube" | "spotify" })
|
|
2415
|
-
- audience → content (relationship: "engaged_with")
|
|
2416
|
-
|
|
2417
|
-
**Events Logged:**
|
|
2418
|
-
|
|
2419
|
-
- `content_changed` (published, metadata: { platform, contentType })
|
|
2420
|
-
- `content_interacted` (viewed, listened, shared)
|
|
2421
|
-
- `metric_calculated` (engagement metrics)
|
|
2422
|
-
|
|
2423
|
-
**Knowledge Added:**
|
|
2424
|
-
|
|
2425
|
-
- Topic labels (subject matter)
|
|
2426
|
-
- Platform tags
|
|
2427
|
-
- Performance labels (trending, viral)
|
|
2428
|
-
|
|
2429
|
-
---
|
|
2430
|
-
|
|
2431
|
-
**Crypto: Token Staking & Yield Farming**
|
|
2432
|
-
|
|
2433
|
-
**Things Created/Used:**
|
|
2434
|
-
|
|
2435
|
-
- `token` thing (token instance)
|
|
2436
|
-
- `token_contract` thing (smart contract)
|
|
2437
|
-
- `metric` thing (TVL, APY)
|
|
2438
|
-
- `knowledge_item` thing (risk assessment)
|
|
2439
|
-
|
|
2440
|
-
**Connections Created:**
|
|
2441
|
-
|
|
2442
|
-
- user → token (relationship: "holds_tokens", metadata: { balance })
|
|
2443
|
-
- user → token (relationship: "staked_in", metadata: { amount, duration, earnings })
|
|
2444
|
-
- token → contract (relationship: "defined_by")
|
|
2445
|
-
- contract → dependencies (relationship: "depends_on", metadata: { critical: true })
|
|
2446
|
-
|
|
2447
|
-
**Events Logged:**
|
|
2448
|
-
|
|
2449
|
-
- `token_minted` / `token_burned`
|
|
2450
|
-
- `tokens_staked` / `tokens_unstaked`
|
|
2451
|
-
- `metric_calculated` (TVL, APY updates)
|
|
2452
|
-
- `price_event` (price changes)
|
|
2453
|
-
|
|
2454
|
-
**Knowledge Added:**
|
|
2455
|
-
|
|
2456
|
-
- Risk labels (audit status, vulnerability)
|
|
2457
|
-
- Protocol labels (type, chain)
|
|
2458
|
-
- Market labels (trend, momentum)
|
|
2459
|
-
|
|
2460
|
-
---
|
|
2461
|
-
|
|
2462
|
-
## Querying the Ontology
|
|
2463
|
-
|
|
2464
|
-
### Get Thing by ID (table: things)
|
|
2465
|
-
|
|
2466
|
-
```typescript
|
|
2467
|
-
const thing = await db.get(thingId);
|
|
2468
|
-
```
|
|
2469
|
-
|
|
2470
|
-
### Get All Things of Type (index: by_type)
|
|
2471
|
-
|
|
2472
|
-
```typescript
|
|
2473
|
-
const creators = await db
|
|
2474
|
-
.query("things")
|
|
2475
|
-
.withIndex("by_type", (q) => q.eq("type", "creator"))
|
|
2476
|
-
.collect();
|
|
2477
|
-
```
|
|
2478
|
-
|
|
2479
|
-
### Get Thing's Relationships (table: connections)
|
|
2480
|
-
|
|
2481
|
-
```typescript
|
|
2482
|
-
// Get all entities this entity owns
|
|
2483
|
-
const owned = await db
|
|
2484
|
-
.query("connections")
|
|
2485
|
-
.withIndex("from_type", (q) =>
|
|
2486
|
-
q.eq("fromThingId", thingId).eq("relationshipType", "owns"),
|
|
2487
|
-
)
|
|
2488
|
-
.collect();
|
|
2489
|
-
|
|
2490
|
-
const ownedThings = await Promise.all(
|
|
2491
|
-
owned.map((conn) => db.get(conn.toThingId)),
|
|
2492
|
-
);
|
|
2493
|
-
```
|
|
2494
|
-
|
|
2495
|
-
### Get Thing's History (table: events)
|
|
2496
|
-
|
|
2497
|
-
```typescript
|
|
2498
|
-
// Get all events for this entity
|
|
2499
|
-
const history = await db
|
|
2500
|
-
.query("events")
|
|
2501
|
-
.withIndex("thing_type_time", (q) => q.eq("thingId", thingId))
|
|
2502
|
-
.order("desc") // Most recent first
|
|
2503
|
-
.collect();
|
|
2504
|
-
```
|
|
2505
|
-
|
|
2506
|
-
### Get Thing's Knowledge (junction: thingKnowledge)
|
|
2507
|
-
|
|
2508
|
-
```typescript
|
|
2509
|
-
const knowledgeAssocs = await db
|
|
2510
|
-
.query("thingKnowledge")
|
|
2511
|
-
.withIndex("by_thing", (q) => q.eq("thingId", thingId))
|
|
2512
|
-
.collect();
|
|
2513
|
-
|
|
2514
|
-
const knowledgeItems = await Promise.all(
|
|
2515
|
-
knowledgeAssocs.map((assoc) => db.get(assoc.knowledgeId)),
|
|
2516
|
-
);
|
|
2517
|
-
```
|
|
2518
|
-
|
|
2519
|
-
### Search by Multiple Criteria
|
|
2520
|
-
|
|
2521
|
-
```typescript
|
|
2522
|
-
// Find fitness creators with >10k followers
|
|
2523
|
-
const creators = await db
|
|
2524
|
-
.query("things")
|
|
2525
|
-
.withIndex("by_type", (q) => q.eq("type", "creator"))
|
|
2526
|
-
.collect();
|
|
2527
|
-
|
|
2528
|
-
const fitnessCreators = creators.filter(
|
|
2529
|
-
(c) =>
|
|
2530
|
-
c.properties.totalFollowers > 10000 &&
|
|
2531
|
-
c.properties.niche.includes("fitness"),
|
|
2532
|
-
);
|
|
2533
|
-
```
|
|
2534
|
-
|
|
2535
|
-
---
|
|
2536
|
-
|
|
2537
|
-
## Migration from Old Systems
|
|
2538
|
-
|
|
2539
|
-
When migrating from one.ie or bullfm:
|
|
2540
|
-
|
|
2541
|
-
### Step 1: Identify Thing Types
|
|
2542
|
-
|
|
2543
|
-
Map old models to new thing types:
|
|
2544
|
-
|
|
2545
|
-
- Old "User" → "creator" or "audience_member"
|
|
2546
|
-
- Old "Post" → "blog_post" or "social_post"
|
|
2547
|
-
- Old "Follow" → connection with "following" type
|
|
2548
|
-
- Old "Like" → event with "content_liked" type
|
|
2549
|
-
|
|
2550
|
-
### Step 2: Transform Properties
|
|
2551
|
-
|
|
2552
|
-
Extract structured data into `properties` JSON:
|
|
2553
|
-
|
|
2554
|
-
```typescript
|
|
2555
|
-
// Old user model
|
|
2556
|
-
{
|
|
2557
|
-
id: "123",
|
|
2558
|
-
name: "John",
|
|
2559
|
-
email: "john@example.com",
|
|
2560
|
-
bio: "Fitness coach",
|
|
2561
|
-
followers: 5000
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
|
-
// New entity
|
|
2565
|
-
{
|
|
2566
|
-
type: "creator",
|
|
2567
|
-
name: "John",
|
|
2568
|
-
properties: {
|
|
2569
|
-
email: "john@example.com",
|
|
2570
|
-
username: "john",
|
|
2571
|
-
displayName: "John",
|
|
2572
|
-
bio: "Fitness coach",
|
|
2573
|
-
niche: ["fitness"],
|
|
2574
|
-
totalFollowers: 5000,
|
|
2575
|
-
totalContent: 0,
|
|
2576
|
-
totalRevenue: 0
|
|
2577
|
-
},
|
|
2578
|
-
status: "active",
|
|
2579
|
-
createdAt: Date.now(),
|
|
2580
|
-
updatedAt: Date.now()
|
|
2581
|
-
}
|
|
2582
|
-
```
|
|
2583
|
-
|
|
2584
|
-
### Step 3: Convert Relationships
|
|
2585
|
-
|
|
2586
|
-
Transform foreign keys into connections:
|
|
2587
|
-
|
|
2588
|
-
```typescript
|
|
2589
|
-
// Old: user_id in posts table
|
|
2590
|
-
// New: connection
|
|
2591
|
-
{
|
|
2592
|
-
fromThingId: userId,
|
|
2593
|
-
toThingId: postId,
|
|
2594
|
-
relationshipType: "authored",
|
|
2595
|
-
createdAt: Date.now()
|
|
2596
|
-
}
|
|
2597
|
-
```
|
|
2598
|
-
|
|
2599
|
-
### Step 4: Preserve History
|
|
2600
|
-
|
|
2601
|
-
Convert activity logs to events:
|
|
2602
|
-
|
|
2603
|
-
```typescript
|
|
2604
|
-
// Old: activity log entry
|
|
2605
|
-
{ user: "123", action: "viewed", post: "456", timestamp: 1234567890 }
|
|
2606
|
-
|
|
2607
|
-
// New: event
|
|
2608
|
-
{
|
|
2609
|
-
thingId: "post-456",
|
|
2610
|
-
eventType: "content_viewed",
|
|
2611
|
-
timestamp: 1234567890,
|
|
2612
|
-
actorType: "user",
|
|
2613
|
-
actorId: "user-123"
|
|
2614
|
-
}
|
|
2615
|
-
```
|
|
2616
|
-
|
|
2617
|
-
---
|
|
2618
|
-
|
|
2619
|
-
## Validation Rules
|
|
2620
|
-
|
|
2621
|
-
### Thing Validation
|
|
2622
|
-
|
|
2623
|
-
- `type` must be valid ThingType (implementation alias may be `EntityType`)
|
|
2624
|
-
- `name` cannot be empty
|
|
2625
|
-
- `properties` structure must match type
|
|
2626
|
-
- `status` must be valid status
|
|
2627
|
-
- `createdAt` required, `updatedAt` required
|
|
2628
|
-
|
|
2629
|
-
### Connection Validation
|
|
2630
|
-
|
|
2631
|
-
- `fromThingId` must exist
|
|
2632
|
-
- `toThingId` must exist
|
|
2633
|
-
- `relationshipType` must be valid
|
|
2634
|
-
- Cannot connect a thing to itself (usually)
|
|
2635
|
-
- Relationship must make semantic sense
|
|
2636
|
-
|
|
2637
|
-
### Event Validation
|
|
2638
|
-
|
|
2639
|
-
- `thingId` must exist
|
|
2640
|
-
- `eventType` must be valid
|
|
2641
|
-
- `timestamp` required
|
|
2642
|
-
- `actorId` must exist if provided
|
|
2643
|
-
- `metadata` structure must match event type
|
|
2644
|
-
|
|
2645
|
-
### Tag Validation
|
|
2646
|
-
|
|
2647
|
-
- `name` must be unique
|
|
2648
|
-
- `category` must be valid TagCategory
|
|
2649
|
-
- `usageCount` must be >= 0
|
|
2650
|
-
|
|
2651
|
-
---
|
|
2652
|
-
|
|
2653
|
-
## Performance Optimization
|
|
2654
|
-
|
|
2655
|
-
### Indexes
|
|
2656
|
-
|
|
2657
|
-
Every table has optimized indexes:
|
|
2658
|
-
|
|
2659
|
-
```typescript
|
|
2660
|
-
things: -by_type(type) -
|
|
2661
|
-
by_status(status) -
|
|
2662
|
-
by_created(createdAt) -
|
|
2663
|
-
search_things(name, type, status);
|
|
2664
|
-
|
|
2665
|
-
connections: -from_type(fromThingId, relationshipType) -
|
|
2666
|
-
to_type(toThingId, relationshipType) -
|
|
2667
|
-
bidirectional(fromThingId, toThingId);
|
|
2668
|
-
|
|
2669
|
-
events: -thing_type_time(thingId, eventType, timestamp) -
|
|
2670
|
-
type_time(eventType, timestamp) -
|
|
2671
|
-
session(sessionId, timestamp);
|
|
2672
|
-
|
|
2673
|
-
knowledge: -by_type(knowledgeType) -
|
|
2674
|
-
by_source(sourceThingId) -
|
|
2675
|
-
by_created(createdAt);
|
|
2676
|
-
```
|
|
2677
|
-
|
|
2678
|
-
### Query Optimization
|
|
2679
|
-
|
|
2680
|
-
- Always use indexes for filters
|
|
2681
|
-
- Limit results with `.take(n)`
|
|
2682
|
-
- Paginate large result sets
|
|
2683
|
-
- Use `.collect()` sparingly, prefer streaming
|
|
2684
|
-
|
|
2685
|
-
---
|
|
2686
|
-
|
|
2687
|
-
## Event Retention & Archival
|
|
2688
|
-
|
|
2689
|
-
- Purpose: keep queries fast and costs predictable at scale.
|
|
2690
|
-
- Recommended windows (tune per deployment):
|
|
2691
|
-
- Hot (fast queries): last 30–90 days in primary `events` table, fully indexed.
|
|
2692
|
-
- Warm (historical analytics): 90–365 days; restrict heavy scans and rely on `type_time`/`actor_time`.
|
|
2693
|
-
- Cold archive: >365 days exported to warehouse/storage; query via batch jobs or precomputed aggregates.
|
|
2694
|
-
- Patterns:
|
|
2695
|
-
- Use `type_time` and `actor_time` for filters; avoid full scans.
|
|
2696
|
-
- Precompute aggregates into `metric` entities (daily revenue, views) to avoid wide re-reads.
|
|
2697
|
-
- Optional scheduled rollups to move very old events to archive and keep hot sets lean.
|
|
2698
|
-
|
|
2699
|
-
---
|
|
2700
|
-
|
|
2701
|
-
## Protocol Integration Examples
|
|
2702
|
-
|
|
2703
|
-
### How Protocols Map to This Ontology
|
|
2704
|
-
|
|
2705
|
-
**Key Principle:** Our ontology is protocol-agnostic. Protocols identify themselves via `metadata.protocol`.
|
|
2706
|
-
|
|
2707
|
-
#### A2A Protocol (Agent-to-Agent)
|
|
2708
|
-
|
|
2709
|
-
```typescript
|
|
2710
|
-
// Event: Agent delegates task
|
|
2711
|
-
{
|
|
2712
|
-
type: "task_delegated",
|
|
2713
|
-
actorId: oneAgentId,
|
|
2714
|
-
targetId: externalAgentId,
|
|
2715
|
-
timestamp: Date.now(),
|
|
2716
|
-
metadata: {
|
|
2717
|
-
protocol: "a2a",
|
|
2718
|
-
task: "research_market_trends",
|
|
2719
|
-
parameters: { industry: "fitness" }
|
|
2720
|
-
}
|
|
2721
|
-
}
|
|
2722
|
-
|
|
2723
|
-
// Connection: Agents communicate
|
|
2724
|
-
{
|
|
2725
|
-
fromThingId: oneAgentId,
|
|
2726
|
-
toThingId: externalAgentId,
|
|
2727
|
-
relationshipType: "communicates_with",
|
|
2728
|
-
metadata: {
|
|
2729
|
-
protocol: "a2a",
|
|
2730
|
-
platform: "elizaos",
|
|
2731
|
-
messagesExchanged: 42
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
```
|
|
2735
|
-
|
|
2736
|
-
#### ACP Protocol (Agentic Commerce)
|
|
2737
|
-
|
|
2738
|
-
```typescript
|
|
2739
|
-
// Event: Purchase initiated
|
|
2740
|
-
{
|
|
2741
|
-
type: "commerce_event",
|
|
2742
|
-
actorId: agentId,
|
|
2743
|
-
targetId: transactionId,
|
|
2744
|
-
timestamp: Date.now(),
|
|
2745
|
-
metadata: {
|
|
2746
|
-
protocol: "acp",
|
|
2747
|
-
eventType: "purchase_initiated",
|
|
2748
|
-
agentPlatform: "chatgpt",
|
|
2749
|
-
productId: productId,
|
|
2750
|
-
amount: 99.00
|
|
2751
|
-
}
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
|
-
// Connection: Merchant approves
|
|
2755
|
-
{
|
|
2756
|
-
fromThingId: merchantId,
|
|
2757
|
-
toThingId: transactionId,
|
|
2758
|
-
relationshipType: "approved",
|
|
2759
|
-
metadata: {
|
|
2760
|
-
protocol: "acp",
|
|
2761
|
-
approvalType: "transaction",
|
|
2762
|
-
approvedAt: Date.now()
|
|
2763
|
-
}
|
|
2764
|
-
}
|
|
2765
|
-
```
|
|
2766
|
-
|
|
2767
|
-
#### AP2 Protocol (Agent Payments)
|
|
2768
|
-
|
|
2769
|
-
```typescript
|
|
2770
|
-
// Event: Intent mandate created
|
|
2771
|
-
{
|
|
2772
|
-
type: "mandate_created",
|
|
2773
|
-
actorId: userId,
|
|
2774
|
-
targetId: mandateId,
|
|
2775
|
-
timestamp: Date.now(),
|
|
2776
|
-
metadata: {
|
|
2777
|
-
protocol: "ap2",
|
|
2778
|
-
mandateType: "intent",
|
|
2779
|
-
autoExecute: true,
|
|
2780
|
-
maxBudget: 1500
|
|
2781
|
-
}
|
|
2782
|
-
}
|
|
2783
|
-
|
|
2784
|
-
// Event: Price checked
|
|
2785
|
-
{
|
|
2786
|
-
type: "price_checked",
|
|
2787
|
-
actorId: agentId,
|
|
2788
|
-
targetId: intentMandateId,
|
|
2789
|
-
timestamp: Date.now(),
|
|
2790
|
-
metadata: {
|
|
2791
|
-
protocol: "ap2",
|
|
2792
|
-
productId: "prod_123",
|
|
2793
|
-
currentPrice: 1399,
|
|
2794
|
-
targetPrice: 1500,
|
|
2795
|
-
withinBudget: true
|
|
2796
|
-
}
|
|
2797
|
-
}
|
|
2798
|
-
|
|
2799
|
-
// Connection: Cart fulfills intent
|
|
2800
|
-
{
|
|
2801
|
-
fromThingId: intentMandateId,
|
|
2802
|
-
toThingId: cartMandateId,
|
|
2803
|
-
relationshipType: "fulfills",
|
|
2804
|
-
metadata: {
|
|
2805
|
-
protocol: "ap2",
|
|
2806
|
-
fulfillmentType: "intent_to_cart",
|
|
2807
|
-
matchScore: 0.95
|
|
2808
|
-
}
|
|
2809
|
-
}
|
|
2810
|
-
```
|
|
2811
|
-
|
|
2812
|
-
#### X402 Protocol (HTTP Micropayments)
|
|
2813
|
-
|
|
2814
|
-
```typescript
|
|
2815
|
-
// Event: Payment requested (402 status)
|
|
2816
|
-
{
|
|
2817
|
-
type: "payment_requested",
|
|
2818
|
-
actorId: apiServiceId,
|
|
2819
|
-
targetId: resourceId,
|
|
2820
|
-
timestamp: Date.now(),
|
|
2821
|
-
metadata: {
|
|
2822
|
-
protocol: "x402",
|
|
2823
|
-
scheme: "permit",
|
|
2824
|
-
network: "base",
|
|
2825
|
-
amount: "0.01",
|
|
2826
|
-
resource: "/api/agent/analyze"
|
|
2827
|
-
}
|
|
2828
|
-
}
|
|
2829
|
-
|
|
2830
|
-
// Event: Payment verified
|
|
2831
|
-
{
|
|
2832
|
-
type: "payment_verified",
|
|
2833
|
-
actorId: systemId,
|
|
2834
|
-
targetId: paymentId,
|
|
2835
|
-
timestamp: Date.now(),
|
|
2836
|
-
metadata: {
|
|
2837
|
-
protocol: "x402",
|
|
2838
|
-
network: "base",
|
|
2839
|
-
txHash: "0x...",
|
|
2840
|
-
verified: true
|
|
2841
|
-
}
|
|
2842
|
-
}
|
|
2843
|
-
|
|
2844
|
-
// Connection: Payment made
|
|
2845
|
-
{
|
|
2846
|
-
fromThingId: payerId,
|
|
2847
|
-
toThingId: serviceId,
|
|
2848
|
-
relationshipType: "transacted",
|
|
2849
|
-
metadata: {
|
|
2850
|
-
protocol: "x402",
|
|
2851
|
-
network: "base",
|
|
2852
|
-
amount: "0.01",
|
|
2853
|
-
txHash: "0x..."
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
```
|
|
2857
|
-
|
|
2858
|
-
#### AG-UI Protocol (CopilotKit Generative UI)
|
|
2859
|
-
|
|
2860
|
-
```typescript
|
|
2861
|
-
// Event: UI component sent
|
|
2862
|
-
{
|
|
2863
|
-
type: "message_sent",
|
|
2864
|
-
actorId: agentId,
|
|
2865
|
-
targetId: conversationId,
|
|
2866
|
-
timestamp: Date.now(),
|
|
2867
|
-
metadata: {
|
|
2868
|
-
protocol: "ag-ui",
|
|
2869
|
-
messageType: "ui",
|
|
2870
|
-
component: "chart",
|
|
2871
|
-
data: { chartType: "line", ... }
|
|
2872
|
-
}
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
|
-
// Connection: No connections needed (UI is stateless)
|
|
2876
|
-
```
|
|
2877
|
-
|
|
2878
|
-
### Cross-Protocol Queries
|
|
2879
|
-
|
|
2880
|
-
**All payments across all protocols:**
|
|
2881
|
-
|
|
2882
|
-
```typescript
|
|
2883
|
-
const allPayments = await ctx.db
|
|
2884
|
-
.query("events")
|
|
2885
|
-
.filter((q) => q.eq(q.field("type"), "payment_processed"))
|
|
2886
|
-
.collect();
|
|
2887
|
-
```
|
|
2888
|
-
|
|
2889
|
-
**Only X402 blockchain payments:**
|
|
2890
|
-
|
|
2891
|
-
```typescript
|
|
2892
|
-
const x402Payments = allPayments.filter((e) => e.metadata.protocol === "x402");
|
|
2893
|
-
```
|
|
2894
|
-
|
|
2895
|
-
**Total revenue by protocol:**
|
|
2896
|
-
|
|
2897
|
-
```typescript
|
|
2898
|
-
const byProtocol = allPayments.reduce((acc, e) => {
|
|
2899
|
-
const protocol = e.metadata.protocol || "traditional";
|
|
2900
|
-
acc[protocol] = (acc[protocol] || 0) + e.metadata.amount;
|
|
2901
|
-
return acc;
|
|
2902
|
-
}, {});
|
|
2903
|
-
|
|
2904
|
-
// Result: { x402: 1250, acp: 3400, ap2: 890, traditional: 5600 }
|
|
2905
|
-
```
|
|
2906
|
-
|
|
2907
|
-
---
|
|
2908
|
-
|
|
2909
|
-
## Merged: Protocol Integration Requirements (from OntologyUpdates.md)
|
|
2910
|
-
|
|
2911
|
-
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.
|
|
2912
|
-
|
|
2913
|
-
- Things
|
|
2914
|
-
- 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`.
|
|
2915
|
-
- Keep `product` (ACP/marketplace) and `payment` (transaction). For X402/AP2/ACP specifics, store details in `payment.properties` and event metadata (see below).
|
|
2916
|
-
- External integrations remain: `external_agent`, `external_workflow`, `external_connection`.
|
|
2917
|
-
|
|
2918
|
-
- Connections
|
|
2919
|
-
- Use existing specific types (e.g., `owns`, `member_of`, `holds_tokens`) plus consolidated types with metadata:
|
|
2920
|
-
- `communicated` for cross‑agent communication (A2A/ACP/AG‑UI)
|
|
2921
|
-
- `delegated` for task delegation/assignment
|
|
2922
|
-
- `approved` for approvals; `fulfilled` for fulfillment; `transacted` for financial relations
|
|
2923
|
-
- Protocol identity is always in `metadata.protocol`.
|
|
2924
|
-
|
|
2925
|
-
- Events (consolidated, protocol‑aware)
|
|
2926
|
-
- Use consolidated events already defined in this spec:
|
|
2927
|
-
- `payment_event` with `metadata.status: requested|verified|processed` (X402/AP2/ACP)
|
|
2928
|
-
- `commerce_event` with `metadata.eventType` (ACP/AP2)
|
|
2929
|
-
- `communication_event` with `metadata.messageType` (A2A/ACP/AG‑UI)
|
|
2930
|
-
- `task_event` with `metadata.action: delegated|completed|failed`
|
|
2931
|
-
- `mandate_event` with `metadata.mandateType: intent|cart` (AP2)
|
|
2932
|
-
- 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.
|
|
2933
|
-
|
|
2934
|
-
- Protocol‑specific properties (examples)
|
|
2935
|
-
- AP2 Mandate (stored on `mandate` thing):
|
|
2936
|
-
- `properties`: `{ mandateType: "intent"|"cart", intent?: {...}, items?: [...], subtotal, tax, total, status, signature, credentialHash, approvedAt?, completedAt? }`
|
|
2937
|
-
- X402/ACP/AP2 Payment (stored on `payment` thing and echoed in `payment_event.metadata`):
|
|
2938
|
-
- `properties`: `{ protocol: "x402"|"acp"|"ap2", scheme?, network?, amount, currency?, txHash?, invoiceId?, status }`
|
|
2939
|
-
|
|
2940
|
-
- Indexes (unchanged, validated)
|
|
2941
|
-
- `things`: `by_type`, `by_status`, `by_created`, plus `search_things(name, type, status)`
|
|
2942
|
-
- `connections`: `from_type`, `to_type`, `bidirectional`
|
|
2943
|
-
- `events`: `type_time`, `actor_time`, `thing_type_time`
|
|
2944
|
-
- `knowledge`: `by_type`, `by_source`, `by_created` (plus vector index when supported)
|
|
2945
|
-
|
|
2946
|
-
- Auth migration strategy (compatibility)
|
|
2947
|
-
- Existing auth tables (Better Auth: users, sessions, verification, resets, 2FA) remain intact.
|
|
2948
|
-
- Link `users` to `things` via optional `users.thingId` and backfill with an internal migration (see `OntologyUpdates.md`). This preserves zero‑downtime compatibility.
|
|
2949
|
-
|
|
2950
|
-
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).
|
|
2951
|
-
|
|
2952
|
-
---
|
|
2953
|
-
|
|
2954
|
-
## Extensibility: User-Safe Additions
|
|
2955
|
-
|
|
2956
|
-
Principle: Users can add to any type without breaking the ontology.
|
|
2957
|
-
|
|
2958
|
-
- Use `properties` for schema-free details; don’t edit core enums casually.
|
|
2959
|
-
- Use knowledge labels to categorize, filter, and group. Add labels freely without schema changes.
|
|
2960
|
-
- Use `metadata` on connections and events for protocol/workflow-specific context.
|
|
2961
|
-
- When a new subtype emerges (e.g., new content flavor), prefer:
|
|
2962
|
-
- Keep `type` stable (e.g., `video`).
|
|
2963
|
-
- Add `properties.kind` and labels (e.g., `format:webinar`, `topic:fitness`).
|
|
2964
|
-
- Introduce a new enum literal only when global indexes/constraints benefit.
|
|
2965
|
-
- Custom automations integrate via `external_agent`, `external_workflow`, and `external_connection` entities with `delegated`/`communicated` connections.
|
|
2966
|
-
|
|
2967
|
-
---
|
|
2968
|
-
|
|
2969
|
-
## Glossary (Compact)
|
|
2970
|
-
|
|
2971
|
-
- `entity` (thing): Any addressable object (creator, organization, content, product, payment, external_agent, mandate, etc.).
|
|
2972
|
-
- `connection` (state): Relationship between two entities (owns, member_of, transacted, fulfilled, delegated, communicated).
|
|
2973
|
-
- `event` (action): Time-stamped occurrence (content_changed, payment_event, communication_event, task_event, mandate_event).
|
|
2974
|
-
- `knowledge` (label/chunk): Classification and RAG units applied via `thingKnowledge` (labels like skill/industry/topic and chunks with embeddings).
|
|
2975
|
-
- `owner`: A `creator` with ownership responsibilities. Platform owner (platform_owner) or group owner (group_owner). See `one/people/owner.md`.
|
|
2976
|
-
- `group`: Multi-tenant container for users and resources with hierarchical nesting. See `one/people/organisation.md`.
|
|
2977
|
-
|
|
2978
|
-
---
|
|
2979
|
-
|
|
2980
|
-
## Summary Statistics
|
|
2981
|
-
|
|
2982
|
-
**Dimensions:** 6 total (groups, people, things, connections, events, knowledge)
|
|
2983
|
-
|
|
2984
|
-
**Thing Types:** 66 total
|
|
2985
|
-
|
|
2986
|
-
- Core: 4 (creator, ai_clone, audience_member, organization)
|
|
2987
|
-
- Business Agents: 10
|
|
2988
|
-
- Content: 7
|
|
2989
|
-
- Products: 4
|
|
2990
|
-
- Community: 3
|
|
2991
|
-
- Token: 2
|
|
2992
|
-
- Knowledge: 2
|
|
2993
|
-
- Platform: 6
|
|
2994
|
-
- Business: 7
|
|
2995
|
-
- Authentication & Session: 5
|
|
2996
|
-
- Marketing: 6
|
|
2997
|
-
- External: 3
|
|
2998
|
-
- Protocol: 2
|
|
2999
|
-
|
|
3000
|
-
**Connection Types:** 25 total (Hybrid approach)
|
|
3001
|
-
|
|
3002
|
-
- 18 specific semantic types
|
|
3003
|
-
- 7 consolidated types with metadata variants
|
|
3004
|
-
- Protocol-agnostic via metadata.protocol
|
|
3005
|
-
- Includes group membership with role-based metadata
|
|
3006
|
-
|
|
3007
|
-
**Event Types:** 67 total (Hybrid approach)
|
|
3008
|
-
|
|
3009
|
-
- 4 Thing lifecycle
|
|
3010
|
-
- 5 User events
|
|
3011
|
-
- 6 Authentication events
|
|
3012
|
-
- 5 Group events (formerly "Organization events")
|
|
3013
|
-
- 4 Dashboard & UI events
|
|
3014
|
-
- 4 AI/Clone events
|
|
3015
|
-
- 4 Agent events
|
|
3016
|
-
- 7 Token events
|
|
3017
|
-
- 5 Course events
|
|
3018
|
-
- 5 Analytics events
|
|
3019
|
-
- 7 Cycle events
|
|
3020
|
-
- 5 Blockchain events
|
|
3021
|
-
- 11 consolidated types with metadata variants
|
|
3022
|
-
|
|
3023
|
-
**Design Benefits:**
|
|
3024
|
-
|
|
3025
|
-
- Six-dimension reality model
|
|
3026
|
-
- Multi-tenant by design
|
|
3027
|
-
- Clear ownership & governance
|
|
3028
|
-
- Protocol-agnostic core
|
|
3029
|
-
- Infinite protocol extensibility
|
|
3030
|
-
- Cross-protocol analytics
|
|
3031
|
-
- Type-safe
|
|
3032
|
-
- Future-proof
|
|
3033
|
-
- Scales from children to enterprise
|
|
3034
|
-
|
|
3035
|
-
---
|
|
3036
|
-
|
|
3037
|
-
## Knowledge Governance
|
|
3038
|
-
|
|
3039
|
-
Policy: Default is free-form, user-extensible knowledge labels for maximum flexibility and zero schema churn.
|
|
3040
|
-
|
|
3041
|
-
- Curated label prefixes (recommended): `skill:*`, `industry:*`, `topic:*`, `format:*`, `goal:*`, `audience:*`, `technology:*`, `status:*`, `capability:*`, `protocol:*`, `payment_method:*`, `network:*`.
|
|
3042
|
-
- Validation: Enforce label hygiene (no duplicates within scope); allow synonyms via an alias list if needed.
|
|
3043
|
-
- Ownership: Platform/group owners may curate official labels; users can still apply ad‑hoc labels.
|
|
3044
|
-
- Hygiene: Periodically consolidate low-usage duplicates; do not delete knowledge items with active references—mark deprecated instead.
|
|
3045
|
-
|
|
3046
|
-
---
|
|
3047
|
-
|
|
3048
|
-
## Changelog
|
|
3049
|
-
|
|
3050
|
-
- 2025-10-14
|
|
3051
|
-
- Updated terminology from "organizations" to "groups" throughout Frontend Integration Examples, Summary Statistics, Philosophy, Knowledge Governance, and Glossary sections.
|
|
3052
|
-
- Updated all code examples to use `groups` table and `groupId` references instead of organizations/orgId.
|
|
3053
|
-
- Changed event category from "Organization events" to "Group events" in Summary Statistics.
|
|
3054
|
-
- Updated role references from `org_owner` to `group_owner` throughout examples.
|
|
3055
|
-
- Clarified that groups scale hierarchically from friend circles to governments.
|
|
3056
|
-
- Updated RAG ingestion strategy to use "group" filtering instead of "org".
|
|
3057
|
-
|
|
3058
|
-
- 2025-10-07
|
|
3059
|
-
- Canonicalized terminology: "things" as the conceptual term; kept implementation table/fields as `entities` for compatibility.
|
|
3060
|
-
- Merged protocol integration requirements; clarified consolidated events/connections with `metadata.protocol`.
|
|
3061
|
-
- Added Event Retention & Archival guidance for scale.
|
|
3062
|
-
- Added Extensibility rules and a compact Glossary.
|
|
3063
|
-
- Added Knowledge Governance and links to `owner.md` and `organisation.md`.
|
|
3064
|
-
|
|
3065
|
-
**Thing Types:** 66 total
|
|
3066
|
-
|
|
3067
|
-
- Core: 4 (creator, ai_clone, audience_member, organization)
|
|
3068
|
-
- Business Agents: 10
|
|
3069
|
-
- Content: 7
|
|
3070
|
-
- Products: 4
|
|
3071
|
-
- Community: 3
|
|
3072
|
-
- Token: 2
|
|
3073
|
-
- Knowledge: 2
|
|
3074
|
-
- Platform: 6
|
|
3075
|
-
- Business: 7
|
|
3076
|
-
- Authentication & Session: 5 (session, oauth_account, verification_token, password_reset_token, ui_preferences)
|
|
3077
|
-
- Marketing: 6
|
|
3078
|
-
- External: 3
|
|
3079
|
-
- Protocol: 2
|
|
3080
|
-
|
|
3081
|
-
**Connection Types:** 25 total (Hybrid approach)
|
|
3082
|
-
|
|
3083
|
-
- 18 specific semantic types
|
|
3084
|
-
- 7 consolidated types with metadata variants
|
|
3085
|
-
- Protocol-agnostic via metadata.protocol
|
|
3086
|
-
- Includes group membership with role-based metadata
|
|
3087
|
-
|
|
3088
|
-
**Event Types:** 63 total (Hybrid approach)
|
|
3089
|
-
|
|
3090
|
-
- 4 Thing lifecycle
|
|
3091
|
-
- 5 User events
|
|
3092
|
-
- 6 Authentication events (password_reset, email_verification, 2FA)
|
|
3093
|
-
- 5 Group events (group_created, user_invited_to_group, user_joined_group)
|
|
3094
|
-
- 4 Dashboard & UI events (dashboard_viewed, theme_changed, settings_updated)
|
|
3095
|
-
- 4 AI/Clone events
|
|
3096
|
-
- 4 Agent events
|
|
3097
|
-
- 7 Token events
|
|
3098
|
-
- 5 Course events
|
|
3099
|
-
- 5 Analytics events
|
|
3100
|
-
- **7 Cycle events** (NEW: cycle_request, cycle_completed, revenue_collected, quota_exceeded)
|
|
3101
|
-
- **5 Blockchain events** (NEW: nft_minted, nft_transferred, tokens_bridged, contract_deployed, treasury_withdrawal)
|
|
3102
|
-
- 11 consolidated types with metadata variants
|
|
3103
|
-
- Protocol identification via metadata.protocol + metadata.network
|
|
3104
|
-
|
|
3105
|
-
**Tag Categories:** 12 total
|
|
3106
|
-
|
|
3107
|
-
- Industry, skill, topic, format, goal, audience, technology, status
|
|
3108
|
-
- Plus: capability, protocol, payment_method, network
|
|
3109
|
-
|
|
3110
|
-
**Design Benefits:**
|
|
3111
|
-
|
|
3112
|
-
- ✅ Single source of truth
|
|
3113
|
-
- ✅ Protocol-agnostic core
|
|
3114
|
-
- ✅ Infinite protocol extensibility
|
|
3115
|
-
- ✅ Cross-protocol analytics
|
|
3116
|
-
- ✅ Clean, maintainable
|
|
3117
|
-
- ✅ Type-safe
|
|
3118
|
-
- ✅ Future-proof
|
|
3119
|
-
|
|
3120
|
-
---
|
|
3121
|
-
|
|
3122
|
-
**END OF ONTOLOGY SPECIFICATION**
|
|
3123
|
-
|
|
3124
|
-
## The Philosophy: Reality as DSL
|
|
3125
|
-
|
|
3126
|
-
**This isn't a database schema. It's a Domain-Specific Language for reality itself.**
|
|
3127
|
-
|
|
3128
|
-
### The Core Insight
|
|
3129
|
-
|
|
3130
|
-
**Most systems model their application. ONE models reality.**
|
|
3131
|
-
|
|
3132
|
-
This ontology proves that you don't need hundreds of tables or complex schemas to build a complete AI-native platform. You need:
|
|
3133
|
-
|
|
3134
|
-
1. **6 dimensions** (groups, people, things, connections, events, knowledge)
|
|
3135
|
-
2. **66 thing types** (every "thing")
|
|
3136
|
-
3. **25 connection types** (every relationship)
|
|
3137
|
-
4. **67 event types** (every action)
|
|
3138
|
-
5. **Metadata** (for protocol identity via metadata.protocol)
|
|
3139
|
-
|
|
3140
|
-
That's it. Everything else is just data.
|
|
3141
|
-
|
|
3142
|
-
### Why This Works for AI Agents
|
|
3143
|
-
|
|
3144
|
-
**Traditional codebases:**
|
|
3145
|
-
|
|
3146
|
-
- 100 different patterns for the same concept
|
|
3147
|
-
- AI sees chaos, accuracy degrades (95% → 30%)
|
|
3148
|
-
- Technical debt compounds
|
|
3149
|
-
- Each feature makes the next HARDER
|
|
3150
|
-
|
|
3151
|
-
**ONE codebase:**
|
|
3152
|
-
|
|
3153
|
-
- 1 universal pattern for each dimension
|
|
3154
|
-
- AI sees structure, accuracy compounds (85% → 98%)
|
|
3155
|
-
- Technical credit accumulates
|
|
3156
|
-
- Each feature makes the next EASIER
|
|
3157
|
-
|
|
3158
|
-
**The result:** 100x developer productivity. Not hyperbole. Math.
|
|
3159
|
-
|
|
3160
|
-
### Why Schema Migrations Never Happen
|
|
3161
|
-
|
|
3162
|
-
**Other systems:**
|
|
3163
|
-
|
|
3164
|
-
- Create new tables for every feature
|
|
3165
|
-
- Add protocol-specific columns
|
|
3166
|
-
- Pollute schema with temporary concepts
|
|
3167
|
-
- End up with 50+ tables, 200+ columns
|
|
3168
|
-
- Require migrations for every change
|
|
3169
|
-
- Become unmaintainable nightmares
|
|
3170
|
-
|
|
3171
|
-
**ONE's approach:**
|
|
3172
|
-
|
|
3173
|
-
- Map every feature to 6 dimensions (reality model)
|
|
3174
|
-
- Groups partition the space (hierarchical containers)
|
|
3175
|
-
- People authorize and govern (role-based access)
|
|
3176
|
-
- Things exist with flexible properties (no migrations)
|
|
3177
|
-
- Connections relate (metadata for protocols)
|
|
3178
|
-
- Events record (complete audit trail)
|
|
3179
|
-
- Knowledge understands (embeddings + RAG)
|
|
3180
|
-
- Scale infinitely without schema changes
|
|
3181
|
-
- Stay simple, clean, beautiful
|
|
3182
|
-
|
|
3183
|
-
### The Economic Impact
|
|
3184
|
-
|
|
3185
|
-
**Traditional Development:**
|
|
3186
|
-
|
|
3187
|
-
- Developer writes 100 lines/day
|
|
3188
|
-
- AI assistance degrades over time
|
|
3189
|
-
- Technical debt compounds
|
|
3190
|
-
- Codebases become unmaintainable
|
|
3191
|
-
- **Cost scales linearly with codebase size**
|
|
3192
|
-
|
|
3193
|
-
**ONE Development:**
|
|
3194
|
-
|
|
3195
|
-
- Agent generates 10,000 lines/day (100x)
|
|
3196
|
-
- AI accuracy improves over time (98%+)
|
|
3197
|
-
- Structure compounds (technical credit)
|
|
3198
|
-
- Codebases become MORE maintainable
|
|
3199
|
-
- **Cost scales sublinearly—larger codebases are cheaper per feature**
|
|
3200
|
-
|
|
3201
|
-
**Result:** 12x cheaper per feature at scale. Feature #100 costs LESS than feature #1.
|
|
3202
|
-
|
|
3203
|
-
### The Universal Language
|
|
3204
|
-
|
|
3205
|
-
A system architecture that:
|
|
3206
|
-
|
|
3207
|
-
- **Scales infinitely** - Lemonade stands to global governments, same schema
|
|
3208
|
-
- **Children can understand** - "I own (group), I'm the boss (person), I sell lemonade (things)"
|
|
3209
|
-
- **Enterprises can rely on** - Multi-tenant isolation, clear governance, infinite scale
|
|
3210
|
-
- **AI agents can master** - 6 patterns, 98% accuracy, compound structure
|
|
3211
|
-
- **Never breaks** - Reality doesn't change, technology does
|
|
3212
|
-
- **Grows more powerful** - Each feature adds structure, making the next feature easier
|
|
3213
|
-
- **Enables feature import** - Clone ANY system into the ontology (Shopify, Moodle, Stripe, etc.)
|
|
3214
|
-
|
|
3215
|
-
### What This Enables
|
|
3216
|
-
|
|
3217
|
-
**1. Compound Velocity**
|
|
3218
|
-
|
|
3219
|
-
- Traditional: Feature #100 takes LONGER than feature #1 (technical debt)
|
|
3220
|
-
- ONE: Feature #100 takes LESS TIME than feature #1 (pattern reuse)
|
|
3221
|
-
|
|
3222
|
-
**2. Universal Feature Import**
|
|
3223
|
-
|
|
3224
|
-
- Traditional: Want Shopify's checkout? Build from scratch (3 months)
|
|
3225
|
-
- ONE: Point agent-clone at Shopify. Clone checkout feature (20 minutes)
|
|
3226
|
-
|
|
3227
|
-
**3. Backend Agnosticism**
|
|
3228
|
-
|
|
3229
|
-
- Traditional: Migrating from WordPress to custom backend takes months
|
|
3230
|
-
- ONE: Switch `CONTENT_SOURCE` env var. Done in 1 minute.
|
|
3231
|
-
|
|
3232
|
-
**4. AI-Native Development**
|
|
3233
|
-
|
|
3234
|
-
- Traditional: AI is an assistant. Human is the driver (70% human work)
|
|
3235
|
-
- ONE: AI is the primary builder. Human is the architect (2% human work at scale)
|
|
3236
|
-
|
|
3237
|
-
**5. No Breaking Changes**
|
|
3238
|
-
|
|
3239
|
-
- Traditional: Major versions break everything
|
|
3240
|
-
- ONE: Technology changes (React → Svelte), ontology stays the same
|
|
3241
|
-
|
|
3242
|
-
**This is what happens when you design for AI agents first, not humans.**
|
|
3243
|
-
|
|
3244
|
-
The 6-dimension ontology is the **universal code generation language** that enables 98% accuracy by modeling reality itself.
|
|
3245
|
-
|
|
3246
|
-
---
|
|
3247
|
-
|
|
3248
|
-
## Frontend Integration Examples
|
|
3249
|
-
|
|
3250
|
-
### How the Frontend Uses This Ontology
|
|
3251
|
-
|
|
3252
|
-
The Astro frontend (documented in `Frontend.md`) uses this ontology through:
|
|
3253
|
-
|
|
3254
|
-
1. **Astro Content Collections** - Can load entities as typed collections
|
|
3255
|
-
2. **Convex Hooks** - Real-time subscriptions to entity/connection/event data
|
|
3256
|
-
3. **Hono API** - Complex mutations that create/update entities and log events
|
|
3257
|
-
|
|
3258
|
-
**Example: Multi-Tenant Dashboard**
|
|
3259
|
-
|
|
3260
|
-
```typescript
|
|
3261
|
-
// Frontend Component (src/components/admin/GroupList.tsx)
|
|
3262
|
-
import { useQuery } from 'convex/react';
|
|
3263
|
-
import { api } from '@/convex/_generated/api';
|
|
3264
|
-
|
|
3265
|
-
export function GroupList() {
|
|
3266
|
-
// Query groups (table: "groups")
|
|
3267
|
-
const groups = useQuery(api.queries.admin.listGroups);
|
|
3268
|
-
|
|
3269
|
-
return (
|
|
3270
|
-
<div>
|
|
3271
|
-
{groups?.map(group => (
|
|
3272
|
-
<Card key={group._id}>
|
|
3273
|
-
<CardHeader>
|
|
3274
|
-
<CardTitle>{group.name}</CardTitle>
|
|
3275
|
-
<Badge>{group.settings.plan}</Badge>
|
|
3276
|
-
</CardHeader>
|
|
3277
|
-
<CardContent>
|
|
3278
|
-
<p>{group.metadata.userCount || 0} / {group.settings.limits.users} users</p>
|
|
3279
|
-
<p>Status: {group.status}</p>
|
|
3280
|
-
</CardContent>
|
|
3281
|
-
</Card>
|
|
3282
|
-
))}
|
|
3283
|
-
</div>
|
|
3284
|
-
);
|
|
3285
|
-
}
|
|
3286
|
-
```
|
|
3287
|
-
|
|
3288
|
-
**Example: Authentication Flow**
|
|
3289
|
-
|
|
3290
|
-
```typescript
|
|
3291
|
-
// Password reset request creates:
|
|
3292
|
-
// 1. Entity: password_reset_token
|
|
3293
|
-
// 2. Event: password_reset_requested
|
|
3294
|
-
|
|
3295
|
-
// Backend (Convex mutation)
|
|
3296
|
-
export const requestPasswordReset = mutation({
|
|
3297
|
-
handler: async (ctx, { email }) => {
|
|
3298
|
-
// 1. Find user entity
|
|
3299
|
-
const user = await ctx.db
|
|
3300
|
-
.query("entities")
|
|
3301
|
-
.filter((q) => q.eq(q.field("properties.email"), email))
|
|
3302
|
-
.first();
|
|
3303
|
-
|
|
3304
|
-
if (!user) return { success: true }; // Don't reveal if user exists
|
|
3305
|
-
|
|
3306
|
-
// 2. Create password_reset_token entity
|
|
3307
|
-
const tokenId = await ctx.db.insert("entities", {
|
|
3308
|
-
type: "password_reset_token",
|
|
3309
|
-
name: `Reset token for ${email}`,
|
|
3310
|
-
properties: {
|
|
3311
|
-
userId: user._id,
|
|
3312
|
-
token: hashedToken,
|
|
3313
|
-
expiresAt: Date.now() + 30 * 60 * 1000,
|
|
3314
|
-
},
|
|
3315
|
-
status: "active",
|
|
3316
|
-
createdAt: Date.now(),
|
|
3317
|
-
updatedAt: Date.now(),
|
|
3318
|
-
});
|
|
3319
|
-
|
|
3320
|
-
// 3. Log event
|
|
3321
|
-
await ctx.db.insert("events", {
|
|
3322
|
-
type: "password_reset_requested",
|
|
3323
|
-
actorId: user._id,
|
|
3324
|
-
targetId: tokenId,
|
|
3325
|
-
timestamp: Date.now(),
|
|
3326
|
-
metadata: {
|
|
3327
|
-
email,
|
|
3328
|
-
ipAddress: ctx.auth.sessionId,
|
|
3329
|
-
expiresAt: Date.now() + 30 * 60 * 1000,
|
|
3330
|
-
},
|
|
3331
|
-
});
|
|
3332
|
-
|
|
3333
|
-
return { success: true };
|
|
3334
|
-
},
|
|
3335
|
-
});
|
|
3336
|
-
|
|
3337
|
-
// Frontend usage
|
|
3338
|
-
import { useMutation } from "convex/react";
|
|
3339
|
-
|
|
3340
|
-
export function PasswordResetForm() {
|
|
3341
|
-
const requestReset = useMutation(api.auth.requestPasswordReset);
|
|
3342
|
-
|
|
3343
|
-
const handleSubmit = async (email: string) => {
|
|
3344
|
-
await requestReset({ email });
|
|
3345
|
-
// Show success message
|
|
3346
|
-
};
|
|
3347
|
-
}
|
|
3348
|
-
```
|
|
3349
|
-
|
|
3350
|
-
**Example: Group Membership Check**
|
|
3351
|
-
|
|
3352
|
-
```typescript
|
|
3353
|
-
// Check if user is group_owner (Middleware.md pattern)
|
|
3354
|
-
export const checkGroupOwner = query({
|
|
3355
|
-
args: { userId: v.id("things"), groupId: v.id("groups") },
|
|
3356
|
-
handler: async (ctx, { userId, groupId }) => {
|
|
3357
|
-
// Query connection with role metadata
|
|
3358
|
-
const membership = await ctx.db
|
|
3359
|
-
.query("connections")
|
|
3360
|
-
.withIndex("from_type", (q) =>
|
|
3361
|
-
q
|
|
3362
|
-
.eq("fromThingId", userId)
|
|
3363
|
-
.eq("toThingId", groupId)
|
|
3364
|
-
.eq("relationshipType", "member_of"),
|
|
3365
|
-
)
|
|
3366
|
-
.first();
|
|
3367
|
-
|
|
3368
|
-
return membership?.metadata?.role === "group_owner";
|
|
3369
|
-
},
|
|
3370
|
-
});
|
|
3371
|
-
|
|
3372
|
-
// Frontend usage in middleware
|
|
3373
|
-
import { ConvexHttpClient } from "convex/browser";
|
|
3374
|
-
|
|
3375
|
-
export async function checkAccess(userId: string, groupId: string) {
|
|
3376
|
-
const convex = new ConvexHttpClient(env.CONVEX_URL);
|
|
3377
|
-
const isOwner = await convex.query(api.auth.checkGroupOwner, {
|
|
3378
|
-
userId,
|
|
3379
|
-
groupId,
|
|
3380
|
-
});
|
|
3381
|
-
|
|
3382
|
-
if (!isOwner) {
|
|
3383
|
-
throw new Error("Forbidden: Group owner access required");
|
|
3384
|
-
}
|
|
3385
|
-
}
|
|
3386
|
-
```
|
|
3387
|
-
|
|
3388
|
-
**Example: Dashboard Analytics**
|
|
3389
|
-
|
|
3390
|
-
```typescript
|
|
3391
|
-
// Query events for analytics (Dashboard.md pattern)
|
|
3392
|
-
export const getGroupAnalytics = query({
|
|
3393
|
-
args: { groupId: v.id("groups"), days: v.number() },
|
|
3394
|
-
handler: async (ctx, { groupId, days }) => {
|
|
3395
|
-
const since = Date.now() - days * 24 * 60 * 60 * 1000;
|
|
3396
|
-
|
|
3397
|
-
// Get all dashboard_viewed events for group users
|
|
3398
|
-
const groupMembers = await ctx.db
|
|
3399
|
-
.query("connections")
|
|
3400
|
-
.withIndex("to_type", (q) =>
|
|
3401
|
-
q.eq("toThingId", groupId).eq("relationshipType", "member_of"),
|
|
3402
|
-
)
|
|
3403
|
-
.collect();
|
|
3404
|
-
|
|
3405
|
-
const memberIds = groupMembers.map((m) => m.fromThingId);
|
|
3406
|
-
|
|
3407
|
-
const dashboardViews = await ctx.db
|
|
3408
|
-
.query("events")
|
|
3409
|
-
.withIndex("type_time", (q) =>
|
|
3410
|
-
q.eq("type", "dashboard_viewed").gte("timestamp", since),
|
|
3411
|
-
)
|
|
3412
|
-
.filter((q) => memberIds.includes(q.field("actorId")))
|
|
3413
|
-
.collect();
|
|
3414
|
-
|
|
3415
|
-
return {
|
|
3416
|
-
totalViews: dashboardViews.length,
|
|
3417
|
-
uniqueUsers: new Set(dashboardViews.map((e) => e.actorId)).size,
|
|
3418
|
-
averageSessionDuration:
|
|
3419
|
-
dashboardViews.reduce(
|
|
3420
|
-
(sum, e) => sum + (e.metadata.sessionDuration || 0),
|
|
3421
|
-
0,
|
|
3422
|
-
) / dashboardViews.length,
|
|
3423
|
-
};
|
|
3424
|
-
},
|
|
3425
|
-
});
|
|
3426
|
-
```
|
|
3427
|
-
|
|
3428
|
-
**Example: UI Preferences Sync**
|
|
3429
|
-
|
|
3430
|
-
```typescript
|
|
3431
|
-
// Update user preferences (creates ui_preferences thing if not exists)
|
|
3432
|
-
export const updatePreferences = mutation({
|
|
3433
|
-
args: {
|
|
3434
|
-
userId: v.id("entities"),
|
|
3435
|
-
theme: v.optional(
|
|
3436
|
-
v.union(v.literal("light"), v.literal("dark"), v.literal("system")),
|
|
3437
|
-
),
|
|
3438
|
-
language: v.optional(v.string()),
|
|
3439
|
-
},
|
|
3440
|
-
handler: async (ctx, { userId, theme, language }) => {
|
|
3441
|
-
// Get or create ui_preferences entity
|
|
3442
|
-
let prefs = await ctx.db
|
|
3443
|
-
.query("entities")
|
|
3444
|
-
.withIndex("by_type", (q) => q.eq("type", "ui_preferences"))
|
|
3445
|
-
.filter((q) => q.eq(q.field("properties.userId"), userId))
|
|
3446
|
-
.first();
|
|
3447
|
-
|
|
3448
|
-
if (!prefs) {
|
|
3449
|
-
// Create new preferences entity
|
|
3450
|
-
const prefsId = await ctx.db.insert("entities", {
|
|
3451
|
-
type: "ui_preferences",
|
|
3452
|
-
name: `Preferences for user ${userId}`,
|
|
3453
|
-
properties: {
|
|
3454
|
-
userId,
|
|
3455
|
-
theme: theme || "system",
|
|
3456
|
-
language: language || "en",
|
|
3457
|
-
timezone: "UTC",
|
|
3458
|
-
dashboardLayout: {
|
|
3459
|
-
sidebarCollapsed: false,
|
|
3460
|
-
defaultView: "grid",
|
|
3461
|
-
itemsPerPage: 20,
|
|
3462
|
-
},
|
|
3463
|
-
notifications: { email: true, push: false, sms: false, inApp: true },
|
|
3464
|
-
accessibility: {
|
|
3465
|
-
reducedMotion: false,
|
|
3466
|
-
highContrast: false,
|
|
3467
|
-
fontSize: "medium",
|
|
3468
|
-
},
|
|
3469
|
-
updatedAt: Date.now(),
|
|
3470
|
-
},
|
|
3471
|
-
status: "active",
|
|
3472
|
-
createdAt: Date.now(),
|
|
3473
|
-
updatedAt: Date.now(),
|
|
3474
|
-
});
|
|
3475
|
-
|
|
3476
|
-
prefs = await ctx.db.get(prefsId);
|
|
3477
|
-
} else {
|
|
3478
|
-
// Update existing preferences
|
|
3479
|
-
await ctx.db.patch(prefs._id, {
|
|
3480
|
-
properties: {
|
|
3481
|
-
...prefs.properties,
|
|
3482
|
-
theme: theme || prefs.properties.theme,
|
|
3483
|
-
language: language || prefs.properties.language,
|
|
3484
|
-
updatedAt: Date.now(),
|
|
3485
|
-
},
|
|
3486
|
-
updatedAt: Date.now(),
|
|
3487
|
-
});
|
|
3488
|
-
}
|
|
3489
|
-
|
|
3490
|
-
// Log preferences_updated event
|
|
3491
|
-
if (theme) {
|
|
3492
|
-
await ctx.db.insert("events", {
|
|
3493
|
-
type: "theme_changed",
|
|
3494
|
-
actorId: userId,
|
|
3495
|
-
targetId: prefs._id,
|
|
3496
|
-
timestamp: Date.now(),
|
|
3497
|
-
metadata: {
|
|
3498
|
-
previousTheme: prefs.properties.theme,
|
|
3499
|
-
newTheme: theme,
|
|
3500
|
-
},
|
|
3501
|
-
});
|
|
3502
|
-
}
|
|
3503
|
-
|
|
3504
|
-
return { success: true };
|
|
3505
|
-
},
|
|
3506
|
-
});
|
|
3507
|
-
|
|
3508
|
-
// Frontend hook
|
|
3509
|
-
export function usePreferences(userId: string) {
|
|
3510
|
-
const prefs = useQuery(api.queries.preferences.get, { userId });
|
|
3511
|
-
const updatePrefs = useMutation(api.mutations.preferences.update);
|
|
3512
|
-
|
|
3513
|
-
return { preferences: prefs?.properties, updatePreferences: updatePrefs };
|
|
3514
|
-
}
|
|
3515
|
-
```
|
|
3516
|
-
|
|
3517
|
-
### Key Frontend Patterns
|
|
3518
|
-
|
|
3519
|
-
**1. Thing as Content Collection**
|
|
3520
|
-
|
|
3521
|
-
```typescript
|
|
3522
|
-
// src/content/config.ts
|
|
3523
|
-
const agentsCollection = defineCollection({
|
|
3524
|
-
type: "data",
|
|
3525
|
-
loader: async () => {
|
|
3526
|
-
const convex = new ConvexHttpClient(env.CONVEX_URL);
|
|
3527
|
-
const agents = await convex.query(api.queries.entities.list, {
|
|
3528
|
-
type: "strategy_agent",
|
|
3529
|
-
});
|
|
3530
|
-
return agents;
|
|
3531
|
-
},
|
|
3532
|
-
});
|
|
3533
|
-
```
|
|
3534
|
-
|
|
3535
|
-
**2. Real-time Dashboard Stats**
|
|
3536
|
-
|
|
3537
|
-
```tsx
|
|
3538
|
-
export function DashboardStats({ groupId }) {
|
|
3539
|
-
// Subscribes to changes - auto-updates when events are logged!
|
|
3540
|
-
const stats = useQuery(api.queries.dashboard.getStats, { groupId });
|
|
3541
|
-
|
|
3542
|
-
return <StatsCards data={stats} />;
|
|
3543
|
-
}
|
|
3544
|
-
```
|
|
3545
|
-
|
|
3546
|
-
**3. Permission-Based Rendering**
|
|
3547
|
-
|
|
3548
|
-
```tsx
|
|
3549
|
-
export function AdminPanel({ userId, groupId }) {
|
|
3550
|
-
const membership = useQuery(api.queries.groups.getMembership, {
|
|
3551
|
-
userId,
|
|
3552
|
-
groupId,
|
|
3553
|
-
});
|
|
3554
|
-
|
|
3555
|
-
if (membership?.metadata?.role !== "group_owner") {
|
|
3556
|
-
return <div>Access denied</div>;
|
|
3557
|
-
}
|
|
3558
|
-
|
|
3559
|
-
return <AdminDashboard />;
|
|
3560
|
-
}
|
|
3561
|
-
```
|
|
3562
|
-
|
|
3563
|
-
**4. Astro SSR with Ontology**
|
|
3564
|
-
|
|
3565
|
-
```astro
|
|
3566
|
-
---
|
|
3567
|
-
// src/pages/group/[groupId]/dashboard.astro
|
|
3568
|
-
import { ConvexHttpClient } from 'convex/browser';
|
|
3569
|
-
import { api } from '@/convex/_generated/api';
|
|
3570
|
-
|
|
3571
|
-
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
3572
|
-
|
|
3573
|
-
// Fetch group
|
|
3574
|
-
const group = await convex.query(api.queries.groups.get, {
|
|
3575
|
-
id: Astro.params.groupId,
|
|
3576
|
-
});
|
|
3577
|
-
|
|
3578
|
-
// Fetch group members (connections where relationshipType = "member_of")
|
|
3579
|
-
const members = await convex.query(api.queries.groups.getMembers, {
|
|
3580
|
-
groupId: Astro.params.groupId,
|
|
3581
|
-
});
|
|
3582
|
-
---
|
|
3583
|
-
|
|
3584
|
-
<Layout title={group.name}>
|
|
3585
|
-
<h1>{group.name} Dashboard</h1>
|
|
3586
|
-
<p>Plan: {group.settings.plan}</p>
|
|
3587
|
-
<p>Members: {members.length} / {group.settings.limits.users}</p>
|
|
3588
|
-
|
|
3589
|
-
<!-- Real-time stats component -->
|
|
3590
|
-
<GroupStats client:load groupId={group._id} />
|
|
3591
|
-
</Layout>
|
|
3592
|
-
```
|
|
3593
|
-
|
|
3594
|
-
This demonstrates how the complete ontology (things, connections, events, knowledge) powers the entire frontend architecture through clean, type-safe queries and real-time subscriptions.
|
|
3595
|
-
|
|
3596
|
-
---
|
|
3597
|
-
|
|
3598
|
-
## For Implementers: Using the Universal Language
|
|
3599
|
-
|
|
3600
|
-
### AI Agents: The 6-Question Framework
|
|
3601
|
-
|
|
3602
|
-
When implementing ANY feature, ask these 6 questions (maps to 6 dimensions):
|
|
3603
|
-
|
|
3604
|
-
1. **Groups** - Which group owns this? Any parent/child relationships?
|
|
3605
|
-
2. **People** - Who can access/modify this? What role is required?
|
|
3606
|
-
3. **Things** - What entities are involved? Which thing types?
|
|
3607
|
-
4. **Connections** - How do they relate? Which connection types?
|
|
3608
|
-
5. **Events** - What actions need logging? Which event types?
|
|
3609
|
-
6. **Knowledge** - What needs to be learned/searched? Labels? Chunks? Embeddings?
|
|
3610
|
-
|
|
3611
|
-
**Example: User Purchases a Course**
|
|
3612
|
-
|
|
3613
|
-
1. **Groups** - User's organization (groupId scoping)
|
|
3614
|
-
2. **People** - User (role: customer), Creator (role: org_owner)
|
|
3615
|
-
3. **Things** - User thing, Course thing, Payment thing
|
|
3616
|
-
4. **Connections** - User → Course (enrolled_in), User → Payment (transacted)
|
|
3617
|
-
5. **Events** - course_enrolled, payment_processed
|
|
3618
|
-
6. **Knowledge** - Course chunks (RAG), "education" label, "video" label
|
|
3619
|
-
|
|
3620
|
-
**Pattern Learned:** Every feature maps to all 6 dimensions. This is the universal pattern.
|
|
3621
|
-
|
|
3622
|
-
### Humans: Why This Matters
|
|
3623
|
-
|
|
3624
|
-
**You're building the universal code generation language.**
|
|
3625
|
-
|
|
3626
|
-
Your AI agents now have a complete, unambiguous data model. They will generate consistent database operations because they understand the underlying structure.
|
|
3627
|
-
|
|
3628
|
-
**Key insights:**
|
|
3629
|
-
|
|
3630
|
-
- The ontology models reality, not your app (that's why it never breaks)
|
|
3631
|
-
- Each feature AI generates makes the NEXT feature more accurate
|
|
3632
|
-
- You're not managing technical debt—you're accumulating technical credit
|
|
3633
|
-
- 100 features in, your codebase is EASIER to work with, not harder
|
|
3634
|
-
|
|
3635
|
-
### Developers: Pattern Recognition
|
|
3636
|
-
|
|
3637
|
-
**You have a schema that will never need major refactoring.**
|
|
3638
|
-
|
|
3639
|
-
**Adding features:**
|
|
3640
|
-
|
|
3641
|
-
- New entity type? → Add to `properties`, no schema migration
|
|
3642
|
-
- New relationship? → Use existing connection types + metadata
|
|
3643
|
-
- New protocol? → Add `metadata.protocol`, no new tables
|
|
3644
|
-
- New workflow? → Compose existing services via Effect.ts
|
|
3645
|
-
|
|
3646
|
-
**What you DON'T do:**
|
|
3647
|
-
|
|
3648
|
-
- ❌ Create custom tables (map to 6 dimensions instead)
|
|
3649
|
-
- ❌ Add protocol-specific columns (use metadata)
|
|
3650
|
-
- ❌ Schema migrations for new fields (use properties)
|
|
3651
|
-
- ❌ Hardcode patterns (use provider interface)
|
|
3652
|
-
|
|
3653
|
-
**What you DO:**
|
|
3654
|
-
|
|
3655
|
-
- ✅ Map features to 6 dimensions (groups, people, things, connections, events, knowledge)
|
|
3656
|
-
- ✅ Use flexible properties for type-specific data
|
|
3657
|
-
- ✅ Use metadata for protocol identity
|
|
3658
|
-
- ✅ Compose services via Effect.ts
|
|
3659
|
-
- ✅ Log all actions as events (complete audit trail)
|
|
3660
|
-
|
|
3661
|
-
### The Learning Curve
|
|
3662
|
-
|
|
3663
|
-
**Generation 1-10: Learning the ontology (85% accuracy)**
|
|
3664
|
-
|
|
3665
|
-
- You're teaching AI the 6 dimensions
|
|
3666
|
-
- Patterns are being established
|
|
3667
|
-
- Services are being created
|
|
3668
|
-
|
|
3669
|
-
**Generation 11-50: Pattern recognition (90-93% accuracy)**
|
|
3670
|
-
|
|
3671
|
-
- AI recognizes the universal patterns
|
|
3672
|
-
- Services are being reused
|
|
3673
|
-
- Composition is happening
|
|
3674
|
-
|
|
3675
|
-
**Generation 51-100: Pattern mastery (96-98% accuracy)**
|
|
3676
|
-
|
|
3677
|
-
- AI has internalized the structure
|
|
3678
|
-
- Generation is deterministic
|
|
3679
|
-
- You're reviewing, not debugging
|
|
3680
|
-
|
|
3681
|
-
**Generation 100+: Generalized patterns (98%+ accuracy)**
|
|
3682
|
-
|
|
3683
|
-
- AI doesn't need to think
|
|
3684
|
-
- Every decision is pattern-based
|
|
3685
|
-
- You're the architect, AI is the builder
|
|
3686
|
-
|
|
3687
|
-
**This ontology is complete. It's ready for production. It's the foundation for 98% AI code generation accuracy.**
|
|
3688
|
-
|
|
3689
|
-
---
|
|
3690
|
-
|
|
3691
|
-
## Summary: The Universal Code Generation Language
|
|
3692
|
-
|
|
3693
|
-
### What Makes ONE Universal
|
|
3694
|
-
|
|
3695
|
-
1. **6-Dimension Ontology** - Models reality, not technology
|
|
3696
|
-
2. **Compound Structure** - Each feature adds structure (not debt)
|
|
3697
|
-
3. **Pattern Convergence** - 1 pattern per dimension (not 100 patterns)
|
|
3698
|
-
4. **Backend Agnostic** - Swap technology freely (Convex, WordPress, Shopify)
|
|
3699
|
-
5. **Never Breaks** - Reality doesn't change, technology does
|
|
3700
|
-
6. **Infinite Scale** - Lemonade stands to global governments, same schema
|
|
3701
|
-
|
|
3702
|
-
### The Economic Result
|
|
3703
|
-
|
|
3704
|
-
**Traditional Codebases:**
|
|
3705
|
-
|
|
3706
|
-
```
|
|
3707
|
-
100 files → 90% accurate
|
|
3708
|
-
1,000 files → 70% accurate
|
|
3709
|
-
10,000 files → 30% accurate
|
|
3710
|
-
AI becomes a liability
|
|
3711
|
-
```
|
|
3712
|
-
|
|
3713
|
-
**ONE Codebase:**
|
|
3714
|
-
|
|
3715
|
-
```
|
|
3716
|
-
100 files → 85% accurate (learning)
|
|
3717
|
-
1,000 files → 92% accurate (mastering)
|
|
3718
|
-
10,000 files → 98% accurate (generalized)
|
|
3719
|
-
AI becomes more valuable
|
|
3720
|
-
```
|
|
3721
|
-
|
|
3722
|
-
**Why?** The ontology is the language. Patterns converge. Structure compounds.
|
|
3723
|
-
|
|
3724
|
-
### Next Steps for AI Agents
|
|
3725
|
-
|
|
3726
|
-
**When implementing ANY feature:**
|
|
3727
|
-
|
|
3728
|
-
1. Read `/CLAUDE.md` (platform overview)
|
|
3729
|
-
2. Read `/one/knowledge/ontology.md` (this file - understand the 6 dimensions)
|
|
3730
|
-
3. Read `/one/knowledge/architecture.md` (why this enables 98% accuracy)
|
|
3731
|
-
4. Map feature to ontology (groups, people, things, connections, events, knowledge)
|
|
3732
|
-
5. Generate Effect.ts services (composable business logic)
|
|
3733
|
-
6. Generate provider adapters (if needed)
|
|
3734
|
-
7. Generate UI components (shadcn/ui)
|
|
3735
|
-
8. Test with mocked layers
|
|
3736
|
-
|
|
3737
|
-
**Remember:**
|
|
3738
|
-
|
|
3739
|
-
- The ontology never changes (it's reality)
|
|
3740
|
-
- Effect.ts is for agents (predictable patterns)
|
|
3741
|
-
- Provider pattern is the universal adapter
|
|
3742
|
-
- Every feature adds structure
|
|
3743
|
-
- Each generation compounds accuracy
|
|
3744
|
-
|
|
3745
|
-
**This is how software should be built.**
|
|
3746
|
-
|
|
3747
|
-
---
|
|
3748
|
-
|
|
3749
|
-
## RAG Ingestion Strategy for `one/`
|
|
3750
|
-
|
|
3751
|
-
Objective: attach vectors to every relevant piece of content to enable high‑quality retrieval, while preserving ontology simplicity.
|
|
3752
|
-
|
|
3753
|
-
1. Inventory sources (by thing type)
|
|
3754
|
-
|
|
3755
|
-
- Text bodies: `blog_post.content`, `social_post.text`, `email.content`, `lesson.content`, `course.description`, `website.page.html (stripped)`
|
|
3756
|
-
- Transcripts: `video.transcript`, `podcast.transcript`, `livestream.recording.transcript`
|
|
3757
|
-
- Metadata: titles, summaries, captions
|
|
3758
|
-
|
|
3759
|
-
2. Chunking standard
|
|
3760
|
-
|
|
3761
|
-
- Window: ~800 tokens; overlap: ~200 tokens; language‑aware sentence boundaries when possible.
|
|
3762
|
-
- Store per‑chunk: `{ index, tokenCount, start, end, overlap }`.
|
|
3763
|
-
|
|
3764
|
-
3. Embedding policy
|
|
3765
|
-
|
|
3766
|
-
- Model: configurable via env (e.g., `text-embedding-3-large`). Store `embeddingModel` + `embeddingDim` per knowledge item.
|
|
3767
|
-
- PII/Privacy: use `knowledgeType: 'vector_only'` for sensitive texts; omit `text` and keep only embeddings + hashes.
|
|
3768
|
-
|
|
3769
|
-
4. Ingestion pipeline
|
|
3770
|
-
|
|
3771
|
-
- Mutation: `scheduleEmbeddingForThing({ thingId, fields[] })` validates and enqueues work.
|
|
3772
|
-
- Internal action: `embedText({ text, model })` calls provider and returns `embedding`.
|
|
3773
|
-
- Internal mutation: `upsertKnowledgeChunks({ thingId, chunks[] })` writes `knowledge` items and links via `thingKnowledge` with role `chunk_of`.
|
|
3774
|
-
- Event log: `content_changed` on source updates triggers re‑embedding (debounced) via scheduler.
|
|
3775
|
-
|
|
3776
|
-
5. Query + retrieval
|
|
3777
|
-
|
|
3778
|
-
- Vector search over `knowledge` filtered by group, creator, and content type; k‑NN approximate index when available, else provider‑side search.
|
|
3779
|
-
- Hybrid scoring: combine semantic similarity with lexical signals from `labels` and metadata.
|
|
3780
|
-
|
|
3781
|
-
6. Governance + lifecycle
|
|
3782
|
-
|
|
3783
|
-
- Versioning: keep `metadata.hash` of source; if unchanged, skip.
|
|
3784
|
-
- Retention: archive old chunks on major edits; GC orphaned knowledge items.
|
|
3785
|
-
- Quality: track `metadata.qualityScore` and `feedback` for active learning.
|
|
3786
|
-
|
|
3787
|
-
Example (Convex pseudo‑API)
|
|
3788
|
-
|
|
3789
|
-
```typescript
|
|
3790
|
-
// internal action: embed text
|
|
3791
|
-
export const embedText = internalAction({
|
|
3792
|
-
args: { text: v.string(), model: v.optional(v.string()) },
|
|
3793
|
-
handler: async (ctx, { text, model }) => {
|
|
3794
|
-
const embedding = await callEmbedProvider(text, model);
|
|
3795
|
-
return {
|
|
3796
|
-
embedding,
|
|
3797
|
-
model: model || "text-embedding-3-large",
|
|
3798
|
-
dim: embedding.length,
|
|
3799
|
-
};
|
|
3800
|
-
},
|
|
3801
|
-
});
|
|
3802
|
-
|
|
3803
|
-
// mutation: schedule embedding for a thing
|
|
3804
|
-
export const scheduleEmbeddingForThing = mutation({
|
|
3805
|
-
args: { id: v.id("things"), fields: v.optional(v.array(v.string())) },
|
|
3806
|
-
handler: async (ctx, { id, fields }) => {
|
|
3807
|
-
await ctx.scheduler.runAfter(0, internal.rag.ingestThing, { id, fields });
|
|
3808
|
-
},
|
|
3809
|
-
});
|
|
3810
|
-
|
|
3811
|
-
// internal action: ingest a thing into knowledge
|
|
3812
|
-
export const ingestThing = internalAction({
|
|
3813
|
-
args: { id: v.id("things"), fields: v.optional(v.array(v.string())) },
|
|
3814
|
-
handler: async (ctx, { id, fields }) => {
|
|
3815
|
-
const thing = await ctx.runQuery(internal.entities.get, { id });
|
|
3816
|
-
const texts = extractTexts(thing, fields);
|
|
3817
|
-
let index = 0;
|
|
3818
|
-
for (const t of chunk(texts, { size: 800, overlap: 200 })) {
|
|
3819
|
-
const { embedding, model, dim } = await ctx.runAction(
|
|
3820
|
-
internal.rag.embedText,
|
|
3821
|
-
{ text: t.text },
|
|
3822
|
-
);
|
|
3823
|
-
const knowledgeId = await ctx.runMutation(internal.rag.upsertKnowledge, {
|
|
3824
|
-
item: {
|
|
3825
|
-
knowledgeType: "chunk",
|
|
3826
|
-
text: t.text,
|
|
3827
|
-
embedding,
|
|
3828
|
-
embeddingModel: model,
|
|
3829
|
-
embeddingDim: dim,
|
|
3830
|
-
sourceThingId: id,
|
|
3831
|
-
sourceField: t.field,
|
|
3832
|
-
chunk: { index, tokenCount: t.tokens, overlap: 200 },
|
|
3833
|
-
labels: t.labels,
|
|
3834
|
-
},
|
|
3835
|
-
});
|
|
3836
|
-
await ctx.runMutation(internal.rag.linkThingKnowledge, {
|
|
3837
|
-
thingId: id,
|
|
3838
|
-
knowledgeId,
|
|
3839
|
-
role: "chunk_of",
|
|
3840
|
-
});
|
|
3841
|
-
index++;
|
|
3842
|
-
}
|
|
3843
|
-
},
|
|
3844
|
-
});
|
|
3845
|
-
```
|
|
3846
|
-
|
|
3847
|
-
This strategy keeps vectors first‑class without expanding primitives: knowledge absorbs both legacy tags (as labels) and semantic chunks (as embeddings).
|