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
package/one/knowledge/dsl.md
DELETED
|
@@ -1,1678 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Dsl
|
|
3
|
-
dimension: knowledge
|
|
4
|
-
category: dsl.md
|
|
5
|
-
tags: ai, ontology
|
|
6
|
-
related_dimensions: connections, events, 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 dsl.md category.
|
|
13
|
-
Location: one/knowledge/dsl.md
|
|
14
|
-
Purpose: Provides information
|
|
15
|
-
Related dimensions: connections, events, things
|
|
16
|
-
For AI agents: Read this to understand dsl.
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
// ============================================================================
|
|
20
|
-
// ONE DSL - Domain Specific Language
|
|
21
|
-
// Purpose: Declare features in high-level syntax that compiles to Effect.ts
|
|
22
|
-
// ============================================================================
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* DSL SYNTAX SPECIFICATION
|
|
26
|
-
*
|
|
27
|
-
* The ONE DSL is a declarative language for defining features on the ONE platform.
|
|
28
|
-
* It compiles to TypeScript with Effect.ts and plain Convex schemas (no Convex Ents).
|
|
29
|
-
*
|
|
30
|
-
* Core principles:
|
|
31
|
-
* 1. Declarative - describe WHAT, not HOW
|
|
32
|
-
* 2. Type-safe - validates against ontology
|
|
33
|
-
* 3. Composable - features built from primitives
|
|
34
|
-
* 4. Auditable - generates readable TypeScript
|
|
35
|
-
* 5. Metadata-based - uses metadata field for type consolidation
|
|
36
|
-
*
|
|
37
|
-
* Hybrid Type Strategy:
|
|
38
|
-
* - 25 connection types (18 specific + 7 consolidated via metadata)
|
|
39
|
-
* - 35 event types (24 specific + 11 consolidated via metadata)
|
|
40
|
-
* - Specific types for core domain concepts (tokens, courses, clones)
|
|
41
|
-
* - Consolidated types for protocol-agnostic patterns (payment, content, communication)
|
|
42
|
-
* - Metadata field stores variants and protocol identity
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
// ============================================================================
|
|
46
|
-
// DSL PRIMITIVES
|
|
47
|
-
// ============================================================================
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* ENTITY DECLARATION
|
|
51
|
-
* Creates a new entity in the ontology
|
|
52
|
-
*/
|
|
53
|
-
type EntityDeclaration = {
|
|
54
|
-
entity: {
|
|
55
|
-
type: EntityType;
|
|
56
|
-
name: string;
|
|
57
|
-
properties: Record<string, any>;
|
|
58
|
-
status?: "active" | "inactive" | "draft";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* CONNECTION DECLARATION
|
|
64
|
-
* Creates relationship between entities
|
|
65
|
-
*
|
|
66
|
-
* 25 HYBRID CONNECTION TYPES:
|
|
67
|
-
*
|
|
68
|
-
* Specific Types (18):
|
|
69
|
-
* - Ownership: "owns", "created_by"
|
|
70
|
-
* - AI: "clone_of", "trained_on", "powers"
|
|
71
|
-
* - Content: "authored", "generated_by", "published_to", "part_of", "references"
|
|
72
|
-
* - Community: "member_of", "following", "moderates", "participated_in"
|
|
73
|
-
* - Business: "manages", "reports_to", "collaborates_with"
|
|
74
|
-
* - Tokens: "holds_tokens", "staked_in", "earned_from"
|
|
75
|
-
* - Products: "purchased", "enrolled_in", "completed", "teaching"
|
|
76
|
-
*
|
|
77
|
-
* Consolidated Types (7) - use metadata:
|
|
78
|
-
* - "transacted" (metadata.transactionType + protocol)
|
|
79
|
-
* - "notified" (metadata.channel + notificationType)
|
|
80
|
-
* - "referred" (metadata.referralType)
|
|
81
|
-
* - "communicated" (metadata.protocol + messageType)
|
|
82
|
-
* - "delegated" (metadata.protocol + taskType)
|
|
83
|
-
* - "approved" (metadata.approvalType + protocol)
|
|
84
|
-
* - "fulfilled" (metadata.fulfillmentType + protocol)
|
|
85
|
-
*/
|
|
86
|
-
type ConnectionDeclaration = {
|
|
87
|
-
connect: {
|
|
88
|
-
from: EntityReference;
|
|
89
|
-
to: EntityReference;
|
|
90
|
-
type: ConnectionType; // One of 24 consolidated types
|
|
91
|
-
metadata?: {
|
|
92
|
-
// Type-specific metadata for consolidated types
|
|
93
|
-
paymentType?: "subscription" | "purchase" | "tip" | "refund";
|
|
94
|
-
livestreamType?: "hosted" | "attended" | "moderated" | "banned_from";
|
|
95
|
-
notificationType?: "sent" | "received" | "read";
|
|
96
|
-
referralType?: "referred" | "earned_from";
|
|
97
|
-
actionType?: string; // For admin_action
|
|
98
|
-
// Custom fields
|
|
99
|
-
[key: string]: any;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* EVENT DECLARATION
|
|
106
|
-
* Logs an event
|
|
107
|
-
*
|
|
108
|
-
* 35 HYBRID EVENT TYPES:
|
|
109
|
-
*
|
|
110
|
-
* Specific Types (24):
|
|
111
|
-
* - Entity Lifecycle: "entity_created", "entity_updated", "entity_deleted", "entity_archived"
|
|
112
|
-
* - User: "user_registered", "user_verified", "user_login", "user_logout", "profile_updated"
|
|
113
|
-
* - AI/Clone: "clone_created", "clone_updated", "voice_cloned", "appearance_cloned"
|
|
114
|
-
* - Agent: "agent_created", "agent_executed", "agent_completed", "agent_failed"
|
|
115
|
-
* - Token: "token_created", "token_minted", "token_burned", "tokens_purchased", "tokens_staked", "tokens_unstaked", "tokens_transferred"
|
|
116
|
-
* - Course: "course_created", "course_enrolled", "lesson_completed", "course_completed", "certificate_earned"
|
|
117
|
-
* - Analytics: "metric_calculated", "insight_generated", "prediction_made", "optimization_applied", "report_generated"
|
|
118
|
-
*
|
|
119
|
-
* Consolidated Types (11) - use metadata:
|
|
120
|
-
* - "content_event" (metadata.action: created|updated|deleted|viewed|shared|liked)
|
|
121
|
-
* - "payment_event" (metadata.status: requested|verified|processed + protocol)
|
|
122
|
-
* - "subscription_event" (metadata.action: started|renewed|cancelled)
|
|
123
|
-
* - "commerce_event" (metadata.eventType + protocol: ACP, AP2)
|
|
124
|
-
* - "livestream_event" (metadata.status + metadata.action)
|
|
125
|
-
* - "notification_event" (metadata.channel + deliveryStatus)
|
|
126
|
-
* - "referral_event" (metadata.action: created|completed|rewarded)
|
|
127
|
-
* - "communication_event" (metadata.protocol + messageType: A2A, ACP, AG-UI)
|
|
128
|
-
* - "task_event" (metadata.action: delegated|completed|failed + protocol)
|
|
129
|
-
* - "mandate_event" (metadata.mandateType: intent|cart + protocol: AP2)
|
|
130
|
-
* - "price_event" (metadata.action: checked|changed)
|
|
131
|
-
*/
|
|
132
|
-
type EventDeclaration = {
|
|
133
|
-
event: {
|
|
134
|
-
entity: EntityReference;
|
|
135
|
-
type: EventType; // One of 38 consolidated types
|
|
136
|
-
actor?: EntityReference;
|
|
137
|
-
metadata?: {
|
|
138
|
-
// Type-specific metadata for consolidated types
|
|
139
|
-
contentType?: "created" | "published" | "edited" | "deleted" | "viewed" | "shared";
|
|
140
|
-
paymentType?: "initiated" | "completed" | "failed" | "refunded" | "subscription_created" | "subscription_cancelled";
|
|
141
|
-
livestreamType?: "started" | "ended" | "viewer_joined" | "viewer_left" | "chat_message" | "donation_received";
|
|
142
|
-
notificationType?: "sent" | "delivered" | "read" | "clicked";
|
|
143
|
-
referralType?: "created" | "completed" | "reward_paid";
|
|
144
|
-
actionType?: string; // For admin_action
|
|
145
|
-
// Custom fields
|
|
146
|
-
[key: string]: any;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* QUERY DECLARATION
|
|
153
|
-
* Retrieves entities/connections/events
|
|
154
|
-
*/
|
|
155
|
-
type QueryDeclaration = {
|
|
156
|
-
query: {
|
|
157
|
-
from: "entities" | "connections" | "events";
|
|
158
|
-
where?: Array<{
|
|
159
|
-
field: string;
|
|
160
|
-
operator: "eq" | "gt" | "lt" | "contains";
|
|
161
|
-
value: any;
|
|
162
|
-
}>;
|
|
163
|
-
limit?: number;
|
|
164
|
-
orderBy?: { field: string; direction: "asc" | "desc" };
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* FLOW DECLARATION
|
|
170
|
-
* Multi-step workflow with branching logic
|
|
171
|
-
*/
|
|
172
|
-
type FlowDeclaration = {
|
|
173
|
-
flow: {
|
|
174
|
-
name: string;
|
|
175
|
-
steps: Array<StepDeclaration>;
|
|
176
|
-
error?: ErrorHandler;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* SERVICE DECLARATION
|
|
182
|
-
* Calls external provider
|
|
183
|
-
*/
|
|
184
|
-
type ServiceDeclaration = {
|
|
185
|
-
service: {
|
|
186
|
-
provider:
|
|
187
|
-
| "openai" // OpenAI GPT models
|
|
188
|
-
| "elevenlabs" // Voice cloning
|
|
189
|
-
| "stripe" // Payment processing
|
|
190
|
-
| "blockchain" // Blockchain interactions
|
|
191
|
-
| "resend" // Email service
|
|
192
|
-
| "d-id" // Appearance cloning (D-ID)
|
|
193
|
-
| "heygen" // Alternative appearance cloning
|
|
194
|
-
| "uniswap" // DEX integration for token trading
|
|
195
|
-
| "alchemy" // Blockchain provider/API
|
|
196
|
-
| "twilio" // SMS and voice communications
|
|
197
|
-
| "sendgrid" // Email service (alternative)
|
|
198
|
-
| "aws" // Media storage (S3)
|
|
199
|
-
| "cloudflare"; // CDN and live streaming
|
|
200
|
-
method: string;
|
|
201
|
-
params: Record<string, any>;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
// ============================================================================
|
|
206
|
-
// METADATA PATTERNS - Examples of Consolidated Types
|
|
207
|
-
// ============================================================================
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* PAYMENT CONNECTION EXAMPLES
|
|
211
|
-
* Single "payment" type with metadata.paymentType
|
|
212
|
-
*/
|
|
213
|
-
const paymentSubscriptionExample = {
|
|
214
|
-
connect: {
|
|
215
|
-
from: "$userId",
|
|
216
|
-
to: "$creatorId",
|
|
217
|
-
type: "payment",
|
|
218
|
-
metadata: {
|
|
219
|
-
paymentType: "subscription",
|
|
220
|
-
amount: 999,
|
|
221
|
-
currency: "usd",
|
|
222
|
-
interval: "monthly",
|
|
223
|
-
stripeSubscriptionId: "sub_123",
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const paymentTipExample = {
|
|
229
|
-
connect: {
|
|
230
|
-
from: "$userId",
|
|
231
|
-
to: "$creatorId",
|
|
232
|
-
type: "payment",
|
|
233
|
-
metadata: {
|
|
234
|
-
paymentType: "tip",
|
|
235
|
-
amount: 500,
|
|
236
|
-
currency: "usd",
|
|
237
|
-
message: "Great content!",
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* CONTENT EVENT EXAMPLES
|
|
244
|
-
* Single "content" type with metadata.contentType
|
|
245
|
-
*/
|
|
246
|
-
const contentPublishedEvent = {
|
|
247
|
-
event: {
|
|
248
|
-
entity: "$contentId",
|
|
249
|
-
type: "content",
|
|
250
|
-
actor: "$userId",
|
|
251
|
-
metadata: {
|
|
252
|
-
contentType: "published",
|
|
253
|
-
title: "My Blog Post",
|
|
254
|
-
visibility: "public",
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
const contentViewedEvent = {
|
|
260
|
-
event: {
|
|
261
|
-
entity: "$contentId",
|
|
262
|
-
type: "content",
|
|
263
|
-
actor: "$viewerId",
|
|
264
|
-
metadata: {
|
|
265
|
-
contentType: "viewed",
|
|
266
|
-
duration: 120, // seconds
|
|
267
|
-
source: "feed",
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* LIVESTREAM EVENT EXAMPLES
|
|
274
|
-
* Single "livestream" type with metadata.livestreamType
|
|
275
|
-
*/
|
|
276
|
-
const livestreamStartedEvent = {
|
|
277
|
-
event: {
|
|
278
|
-
entity: "$livestreamId",
|
|
279
|
-
type: "livestream",
|
|
280
|
-
actor: "$hostId",
|
|
281
|
-
metadata: {
|
|
282
|
-
livestreamType: "started",
|
|
283
|
-
title: "Q&A Session",
|
|
284
|
-
expectedDuration: 3600,
|
|
285
|
-
},
|
|
286
|
-
},
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
const livestreamDonationEvent = {
|
|
290
|
-
event: {
|
|
291
|
-
entity: "$livestreamId",
|
|
292
|
-
type: "livestream",
|
|
293
|
-
actor: "$donorId",
|
|
294
|
-
metadata: {
|
|
295
|
-
livestreamType: "donation_received",
|
|
296
|
-
amount: 1000,
|
|
297
|
-
currency: "usd",
|
|
298
|
-
message: "Love your work!",
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* NOTIFICATION CONNECTION EXAMPLES
|
|
305
|
-
* Single "notification" type with metadata.notificationType
|
|
306
|
-
*/
|
|
307
|
-
const notificationSentConnection = {
|
|
308
|
-
connect: {
|
|
309
|
-
from: "$systemId",
|
|
310
|
-
to: "$userId",
|
|
311
|
-
type: "notification",
|
|
312
|
-
metadata: {
|
|
313
|
-
notificationType: "sent",
|
|
314
|
-
title: "New follower",
|
|
315
|
-
body: "John Doe started following you",
|
|
316
|
-
priority: "medium",
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* REFERRAL CONNECTION EXAMPLES
|
|
323
|
-
* Single "referral" type with metadata.referralType
|
|
324
|
-
*/
|
|
325
|
-
const referralConnection = {
|
|
326
|
-
connect: {
|
|
327
|
-
from: "$referrerId",
|
|
328
|
-
to: "$referredUserId",
|
|
329
|
-
type: "referral",
|
|
330
|
-
metadata: {
|
|
331
|
-
referralType: "referred",
|
|
332
|
-
code: "FRIEND50",
|
|
333
|
-
reward: 500,
|
|
334
|
-
status: "pending",
|
|
335
|
-
},
|
|
336
|
-
},
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
// ============================================================================
|
|
340
|
-
// PLAIN CONVEX SCHEMA - How DSL Compiles
|
|
341
|
-
// ============================================================================
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* The DSL compiles to plain Convex schemas (NO Convex Ents)
|
|
345
|
-
*
|
|
346
|
-
* This is the actual Convex schema that the DSL generates:
|
|
347
|
-
*/
|
|
348
|
-
|
|
349
|
-
// convex/schema.ts (Generated from DSL)
|
|
350
|
-
import { defineSchema, defineTable } from "convex/server";
|
|
351
|
-
import { v } from "convex/values";
|
|
352
|
-
|
|
353
|
-
export default defineSchema({
|
|
354
|
-
// Entity table - all entities stored here
|
|
355
|
-
entities: defineTable({
|
|
356
|
-
type: v.string(), // Entity type (creator, ai_clone, token, etc.)
|
|
357
|
-
name: v.string(),
|
|
358
|
-
properties: v.any(), // Type-specific properties
|
|
359
|
-
status: v.union(v.literal("active"), v.literal("inactive"), v.literal("draft")),
|
|
360
|
-
createdAt: v.number(),
|
|
361
|
-
updatedAt: v.number(),
|
|
362
|
-
})
|
|
363
|
-
.index("by_type", ["type"])
|
|
364
|
-
.index("by_status", ["status"])
|
|
365
|
-
.index("by_created", ["createdAt"]),
|
|
366
|
-
|
|
367
|
-
// Connection table - 24 consolidated types
|
|
368
|
-
connections: defineTable({
|
|
369
|
-
fromEntityId: v.id("entities"),
|
|
370
|
-
toEntityId: v.id("entities"),
|
|
371
|
-
relationshipType: v.string(), // One of 24 consolidated types
|
|
372
|
-
metadata: v.optional(v.any()), // Stores paymentType, livestreamType, etc.
|
|
373
|
-
createdAt: v.number(),
|
|
374
|
-
})
|
|
375
|
-
.index("by_from", ["fromEntityId"])
|
|
376
|
-
.index("by_to", ["toEntityId"])
|
|
377
|
-
.index("by_type", ["relationshipType"])
|
|
378
|
-
.index("by_from_and_type", ["fromEntityId", "relationshipType"])
|
|
379
|
-
.index("by_to_and_type", ["toEntityId", "relationshipType"]),
|
|
380
|
-
|
|
381
|
-
// Event table - 38 consolidated types
|
|
382
|
-
events: defineTable({
|
|
383
|
-
entityId: v.id("entities"),
|
|
384
|
-
eventType: v.string(), // One of 38 consolidated types
|
|
385
|
-
timestamp: v.number(),
|
|
386
|
-
actorType: v.union(v.literal("user"), v.literal("system")),
|
|
387
|
-
actorId: v.optional(v.id("entities")),
|
|
388
|
-
metadata: v.optional(v.any()), // Stores contentType, paymentType, etc.
|
|
389
|
-
})
|
|
390
|
-
.index("by_entity", ["entityId"])
|
|
391
|
-
.index("by_type", ["eventType"])
|
|
392
|
-
.index("by_timestamp", ["timestamp"])
|
|
393
|
-
.index("by_entity_and_type", ["entityId", "eventType"])
|
|
394
|
-
.index("by_actor", ["actorId"]),
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* KEY DIFFERENCES FROM CONVEX ENTS:
|
|
399
|
-
*
|
|
400
|
-
* 1. NO ent() definitions - just plain defineTable()
|
|
401
|
-
* 2. NO edge() definitions - connections stored as regular rows
|
|
402
|
-
* 3. NO automatic relationship traversal - use manual queries
|
|
403
|
-
* 4. Metadata field (v.any()) stores type-specific data
|
|
404
|
-
* 5. Simpler, more flexible, easier to understand
|
|
405
|
-
* 6. Better for AI agents - less magic, more explicit
|
|
406
|
-
*/
|
|
407
|
-
|
|
408
|
-
// ============================================================================
|
|
409
|
-
// EXAMPLE 1: Create AI Clone (DSL)
|
|
410
|
-
// ============================================================================
|
|
411
|
-
|
|
412
|
-
const createAICloneDSL = {
|
|
413
|
-
feature: "CreateAIClone",
|
|
414
|
-
input: {
|
|
415
|
-
creatorId: "Id<entities>",
|
|
416
|
-
videoUrls: "string[]",
|
|
417
|
-
},
|
|
418
|
-
output: {
|
|
419
|
-
cloneId: "Id<entities>",
|
|
420
|
-
voiceId: "string",
|
|
421
|
-
},
|
|
422
|
-
|
|
423
|
-
flow: [
|
|
424
|
-
// Step 1: Validate input
|
|
425
|
-
{
|
|
426
|
-
validate: {
|
|
427
|
-
creatorId: { exists: true, type: "creator" },
|
|
428
|
-
videoUrls: { minLength: 3 },
|
|
429
|
-
},
|
|
430
|
-
onError: { return: { error: "InsufficientContent" } },
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
// Step 2: Extract audio samples
|
|
434
|
-
{
|
|
435
|
-
service: {
|
|
436
|
-
provider: "openai",
|
|
437
|
-
method: "extractAudioFromVideos",
|
|
438
|
-
params: { urls: "$input.videoUrls" },
|
|
439
|
-
output: "audioSamples",
|
|
440
|
-
},
|
|
441
|
-
},
|
|
442
|
-
|
|
443
|
-
// Step 3: Clone voice
|
|
444
|
-
{
|
|
445
|
-
service: {
|
|
446
|
-
provider: "elevenlabs",
|
|
447
|
-
method: "cloneVoice",
|
|
448
|
-
params: {
|
|
449
|
-
name: "$creator.name + ' Voice'",
|
|
450
|
-
samples: "$audioSamples",
|
|
451
|
-
},
|
|
452
|
-
output: "voiceId",
|
|
453
|
-
retry: { times: 3, delay: "5s" },
|
|
454
|
-
timeout: "5m",
|
|
455
|
-
},
|
|
456
|
-
},
|
|
457
|
-
|
|
458
|
-
// Step 4: Analyze personality
|
|
459
|
-
{
|
|
460
|
-
service: {
|
|
461
|
-
provider: "openai",
|
|
462
|
-
method: "analyzePersonality",
|
|
463
|
-
params: {
|
|
464
|
-
videos: "$input.videoUrls",
|
|
465
|
-
posts: "$creator.properties.recentPosts",
|
|
466
|
-
},
|
|
467
|
-
output: "personality",
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
// Step 5: Create AI clone entity
|
|
472
|
-
{
|
|
473
|
-
entity: {
|
|
474
|
-
type: "ai_clone",
|
|
475
|
-
name: "$creator.name + ' AI Clone'",
|
|
476
|
-
properties: {
|
|
477
|
-
voiceId: "$voiceId",
|
|
478
|
-
voiceProvider: "elevenlabs",
|
|
479
|
-
systemPrompt: "$personality.systemPrompt",
|
|
480
|
-
temperature: 0.7,
|
|
481
|
-
totalInteractions: 0,
|
|
482
|
-
},
|
|
483
|
-
status: "active",
|
|
484
|
-
},
|
|
485
|
-
output: "cloneId",
|
|
486
|
-
},
|
|
487
|
-
|
|
488
|
-
// Step 6: Create ownership connection
|
|
489
|
-
{
|
|
490
|
-
connect: {
|
|
491
|
-
from: "$input.creatorId",
|
|
492
|
-
to: "$cloneId",
|
|
493
|
-
type: "owns",
|
|
494
|
-
},
|
|
495
|
-
},
|
|
496
|
-
|
|
497
|
-
// Step 7: Log creation event
|
|
498
|
-
{
|
|
499
|
-
event: {
|
|
500
|
-
entity: "$cloneId",
|
|
501
|
-
type: "clone_created",
|
|
502
|
-
actor: "$input.creatorId",
|
|
503
|
-
metadata: {
|
|
504
|
-
voiceId: "$voiceId",
|
|
505
|
-
personality: "$personality.traits",
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
// Step 8: Return result
|
|
511
|
-
{
|
|
512
|
-
return: {
|
|
513
|
-
cloneId: "$cloneId",
|
|
514
|
-
voiceId: "$voiceId",
|
|
515
|
-
},
|
|
516
|
-
},
|
|
517
|
-
],
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
// ============================================================================
|
|
521
|
-
// EXAMPLE 2: Token Purchase (DSL)
|
|
522
|
-
// ============================================================================
|
|
523
|
-
|
|
524
|
-
const tokenPurchaseDSL = {
|
|
525
|
-
feature: "PurchaseTokens",
|
|
526
|
-
input: {
|
|
527
|
-
userId: "Id<entities>",
|
|
528
|
-
tokenId: "Id<entities>",
|
|
529
|
-
amount: "number",
|
|
530
|
-
usdAmount: "number",
|
|
531
|
-
},
|
|
532
|
-
output: {
|
|
533
|
-
paymentId: "string",
|
|
534
|
-
txHash: "string",
|
|
535
|
-
},
|
|
536
|
-
|
|
537
|
-
flow: [
|
|
538
|
-
// Step 1: Validate inputs
|
|
539
|
-
{
|
|
540
|
-
validate: {
|
|
541
|
-
userId: { exists: true, type: "audience_member" },
|
|
542
|
-
tokenId: { exists: true, type: "token" },
|
|
543
|
-
amount: { gt: 0 },
|
|
544
|
-
usdAmount: { gt: 0 },
|
|
545
|
-
},
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
// Step 2: Charge payment (atomic with step 3)
|
|
549
|
-
{
|
|
550
|
-
atomic: [
|
|
551
|
-
// 2a: Stripe payment
|
|
552
|
-
{
|
|
553
|
-
service: {
|
|
554
|
-
provider: "stripe",
|
|
555
|
-
method: "charge",
|
|
556
|
-
params: {
|
|
557
|
-
amount: "$input.usdAmount * 100",
|
|
558
|
-
currency: "usd",
|
|
559
|
-
metadata: {
|
|
560
|
-
userId: "$input.userId",
|
|
561
|
-
tokenId: "$input.tokenId",
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
output: "payment",
|
|
565
|
-
},
|
|
566
|
-
},
|
|
567
|
-
|
|
568
|
-
// 2b: Mint tokens on blockchain
|
|
569
|
-
{
|
|
570
|
-
service: {
|
|
571
|
-
provider: "blockchain",
|
|
572
|
-
method: "mint",
|
|
573
|
-
params: {
|
|
574
|
-
contractAddress: "$token.properties.contractAddress",
|
|
575
|
-
toAddress: "$input.userId",
|
|
576
|
-
amount: "$input.amount",
|
|
577
|
-
},
|
|
578
|
-
output: "mintTx",
|
|
579
|
-
},
|
|
580
|
-
},
|
|
581
|
-
],
|
|
582
|
-
onError: {
|
|
583
|
-
rollback: [
|
|
584
|
-
{
|
|
585
|
-
service: {
|
|
586
|
-
provider: "stripe",
|
|
587
|
-
method: "refund",
|
|
588
|
-
params: { paymentIntentId: "$payment.id" },
|
|
589
|
-
},
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
service: {
|
|
593
|
-
provider: "blockchain",
|
|
594
|
-
method: "burn",
|
|
595
|
-
params: {
|
|
596
|
-
contractAddress: "$token.properties.contractAddress",
|
|
597
|
-
amount: "$input.amount",
|
|
598
|
-
},
|
|
599
|
-
},
|
|
600
|
-
},
|
|
601
|
-
],
|
|
602
|
-
},
|
|
603
|
-
},
|
|
604
|
-
|
|
605
|
-
// Step 3a: Log payment event (using consolidated "payment" event type)
|
|
606
|
-
{
|
|
607
|
-
event: {
|
|
608
|
-
entity: "$input.userId",
|
|
609
|
-
type: "payment",
|
|
610
|
-
actor: "$input.userId",
|
|
611
|
-
metadata: {
|
|
612
|
-
paymentType: "completed",
|
|
613
|
-
amount: "$input.usdAmount",
|
|
614
|
-
currency: "usd",
|
|
615
|
-
paymentId: "$payment.id",
|
|
616
|
-
purpose: "token_purchase",
|
|
617
|
-
tokenId: "$input.tokenId",
|
|
618
|
-
tokenAmount: "$input.amount",
|
|
619
|
-
},
|
|
620
|
-
},
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
// Step 3b: Log token purchase event
|
|
624
|
-
{
|
|
625
|
-
event: {
|
|
626
|
-
entity: "$input.tokenId",
|
|
627
|
-
type: "tokens_purchased",
|
|
628
|
-
actor: "$input.userId",
|
|
629
|
-
metadata: {
|
|
630
|
-
amount: "$input.amount",
|
|
631
|
-
usdAmount: "$input.usdAmount",
|
|
632
|
-
paymentId: "$payment.id",
|
|
633
|
-
txHash: "$mintTx.transactionHash",
|
|
634
|
-
},
|
|
635
|
-
},
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
// Step 4: Update token balance
|
|
639
|
-
{
|
|
640
|
-
query: {
|
|
641
|
-
from: "connections",
|
|
642
|
-
where: [
|
|
643
|
-
{ field: "fromEntityId", operator: "eq", value: "$input.userId" },
|
|
644
|
-
{ field: "toEntityId", operator: "eq", value: "$input.tokenId" },
|
|
645
|
-
{ field: "relationshipType", operator: "eq", value: "holds_tokens" },
|
|
646
|
-
],
|
|
647
|
-
limit: 1,
|
|
648
|
-
},
|
|
649
|
-
output: "existingConnection",
|
|
650
|
-
},
|
|
651
|
-
|
|
652
|
-
{
|
|
653
|
-
if: {
|
|
654
|
-
condition: "$existingConnection != null",
|
|
655
|
-
then: [
|
|
656
|
-
{
|
|
657
|
-
update: {
|
|
658
|
-
connection: "$existingConnection._id",
|
|
659
|
-
set: {
|
|
660
|
-
metadata: {
|
|
661
|
-
balance:
|
|
662
|
-
"$existingConnection.metadata.balance + $input.amount",
|
|
663
|
-
},
|
|
664
|
-
},
|
|
665
|
-
},
|
|
666
|
-
},
|
|
667
|
-
],
|
|
668
|
-
else: [
|
|
669
|
-
{
|
|
670
|
-
connect: {
|
|
671
|
-
from: "$input.userId",
|
|
672
|
-
to: "$input.tokenId",
|
|
673
|
-
type: "holds_tokens",
|
|
674
|
-
metadata: {
|
|
675
|
-
balance: "$input.amount",
|
|
676
|
-
firstPurchaseDate: Date.now(),
|
|
677
|
-
txHash: "$mintTx.transactionHash",
|
|
678
|
-
},
|
|
679
|
-
},
|
|
680
|
-
},
|
|
681
|
-
],
|
|
682
|
-
},
|
|
683
|
-
},
|
|
684
|
-
|
|
685
|
-
// Step 5a: Create payment connection record (using consolidated "payment" type)
|
|
686
|
-
{
|
|
687
|
-
connect: {
|
|
688
|
-
from: "$input.userId",
|
|
689
|
-
to: "$input.tokenId",
|
|
690
|
-
type: "payment",
|
|
691
|
-
metadata: {
|
|
692
|
-
paymentType: "purchase",
|
|
693
|
-
amount: "$input.usdAmount",
|
|
694
|
-
currency: "usd",
|
|
695
|
-
tokenAmount: "$input.amount",
|
|
696
|
-
paymentId: "$payment.id",
|
|
697
|
-
txHash: "$mintTx.transactionHash",
|
|
698
|
-
},
|
|
699
|
-
},
|
|
700
|
-
},
|
|
701
|
-
|
|
702
|
-
// Step 6: Return result
|
|
703
|
-
{
|
|
704
|
-
return: {
|
|
705
|
-
paymentId: "$payment.id",
|
|
706
|
-
txHash: "$mintTx.transactionHash",
|
|
707
|
-
},
|
|
708
|
-
},
|
|
709
|
-
],
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
// ============================================================================
|
|
713
|
-
// EXAMPLE 2B: Token Purchase with Referral (DSL)
|
|
714
|
-
// Shows referral metadata pattern
|
|
715
|
-
// ============================================================================
|
|
716
|
-
|
|
717
|
-
const tokenPurchaseWithReferralDSL = {
|
|
718
|
-
feature: "PurchaseTokensWithReferral",
|
|
719
|
-
input: {
|
|
720
|
-
userId: "Id<entities>",
|
|
721
|
-
tokenId: "Id<entities>",
|
|
722
|
-
amount: "number",
|
|
723
|
-
usdAmount: "number",
|
|
724
|
-
referralCode: "string",
|
|
725
|
-
},
|
|
726
|
-
output: {
|
|
727
|
-
paymentId: "string",
|
|
728
|
-
txHash: "string",
|
|
729
|
-
referralReward: "number",
|
|
730
|
-
},
|
|
731
|
-
|
|
732
|
-
flow: [
|
|
733
|
-
// Step 1: Find referral connection
|
|
734
|
-
{
|
|
735
|
-
query: {
|
|
736
|
-
from: "connections",
|
|
737
|
-
where: [
|
|
738
|
-
{ field: "toEntityId", operator: "eq", value: "$input.userId" },
|
|
739
|
-
{ field: "relationshipType", operator: "eq", value: "referral" },
|
|
740
|
-
{
|
|
741
|
-
field: "metadata.code",
|
|
742
|
-
operator: "eq",
|
|
743
|
-
value: "$input.referralCode",
|
|
744
|
-
},
|
|
745
|
-
{ field: "metadata.status", operator: "eq", value: "pending" },
|
|
746
|
-
],
|
|
747
|
-
limit: 1,
|
|
748
|
-
},
|
|
749
|
-
output: "referralConnection",
|
|
750
|
-
},
|
|
751
|
-
|
|
752
|
-
// Step 2: Process payment (same as before)
|
|
753
|
-
// ... payment steps ...
|
|
754
|
-
|
|
755
|
-
// Step 3: Update referral status if found
|
|
756
|
-
{
|
|
757
|
-
if: {
|
|
758
|
-
condition: "$referralConnection != null",
|
|
759
|
-
then: [
|
|
760
|
-
{
|
|
761
|
-
update: {
|
|
762
|
-
connection: "$referralConnection._id",
|
|
763
|
-
set: {
|
|
764
|
-
metadata: {
|
|
765
|
-
referralType: "completed",
|
|
766
|
-
code: "$input.referralCode",
|
|
767
|
-
reward: 500,
|
|
768
|
-
status: "completed",
|
|
769
|
-
completedAt: Date.now(),
|
|
770
|
-
},
|
|
771
|
-
},
|
|
772
|
-
},
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
event: {
|
|
776
|
-
entity: "$referralConnection.fromEntityId",
|
|
777
|
-
type: "referral",
|
|
778
|
-
actor: "$input.userId",
|
|
779
|
-
metadata: {
|
|
780
|
-
referralType: "completed",
|
|
781
|
-
code: "$input.referralCode",
|
|
782
|
-
reward: 500,
|
|
783
|
-
referredUserId: "$input.userId",
|
|
784
|
-
},
|
|
785
|
-
},
|
|
786
|
-
},
|
|
787
|
-
],
|
|
788
|
-
},
|
|
789
|
-
},
|
|
790
|
-
|
|
791
|
-
// Step 4: Return result
|
|
792
|
-
{
|
|
793
|
-
return: {
|
|
794
|
-
paymentId: "$payment.id",
|
|
795
|
-
txHash: "$mintTx.transactionHash",
|
|
796
|
-
referralReward:
|
|
797
|
-
"$referralConnection != null ? $referralConnection.metadata.reward : 0",
|
|
798
|
-
},
|
|
799
|
-
},
|
|
800
|
-
],
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
// ============================================================================
|
|
804
|
-
// EXAMPLE 3: Livestream with Notifications (DSL)
|
|
805
|
-
// Shows livestream and notification metadata patterns
|
|
806
|
-
// ============================================================================
|
|
807
|
-
|
|
808
|
-
const livestreamWithNotificationsDSL = {
|
|
809
|
-
feature: "StartLivestreamWithNotifications",
|
|
810
|
-
input: {
|
|
811
|
-
hostId: "Id<entities>",
|
|
812
|
-
title: "string",
|
|
813
|
-
description: "string",
|
|
814
|
-
},
|
|
815
|
-
output: {
|
|
816
|
-
livestreamId: "Id<entities>",
|
|
817
|
-
notificationsSent: "number",
|
|
818
|
-
},
|
|
819
|
-
|
|
820
|
-
flow: [
|
|
821
|
-
// Step 1: Create livestream entity
|
|
822
|
-
{
|
|
823
|
-
entity: {
|
|
824
|
-
type: "livestream",
|
|
825
|
-
name: "$input.title",
|
|
826
|
-
properties: {
|
|
827
|
-
description: "$input.description",
|
|
828
|
-
status: "live",
|
|
829
|
-
viewerCount: 0,
|
|
830
|
-
startedAt: Date.now(),
|
|
831
|
-
},
|
|
832
|
-
status: "active",
|
|
833
|
-
},
|
|
834
|
-
output: "livestreamId",
|
|
835
|
-
},
|
|
836
|
-
|
|
837
|
-
// Step 2: Create livestream connection (using consolidated type)
|
|
838
|
-
{
|
|
839
|
-
connect: {
|
|
840
|
-
from: "$input.hostId",
|
|
841
|
-
to: "$livestreamId",
|
|
842
|
-
type: "livestream",
|
|
843
|
-
metadata: {
|
|
844
|
-
livestreamType: "hosted",
|
|
845
|
-
role: "host",
|
|
846
|
-
startedAt: Date.now(),
|
|
847
|
-
},
|
|
848
|
-
},
|
|
849
|
-
},
|
|
850
|
-
|
|
851
|
-
// Step 3: Log livestream started event (using consolidated type)
|
|
852
|
-
{
|
|
853
|
-
event: {
|
|
854
|
-
entity: "$livestreamId",
|
|
855
|
-
type: "livestream",
|
|
856
|
-
actor: "$input.hostId",
|
|
857
|
-
metadata: {
|
|
858
|
-
livestreamType: "started",
|
|
859
|
-
title: "$input.title",
|
|
860
|
-
expectedDuration: 3600,
|
|
861
|
-
},
|
|
862
|
-
},
|
|
863
|
-
},
|
|
864
|
-
|
|
865
|
-
// Step 4: Get all followers
|
|
866
|
-
{
|
|
867
|
-
query: {
|
|
868
|
-
from: "connections",
|
|
869
|
-
where: [
|
|
870
|
-
{ field: "toEntityId", operator: "eq", value: "$input.hostId" },
|
|
871
|
-
{ field: "relationshipType", operator: "eq", value: "following" },
|
|
872
|
-
],
|
|
873
|
-
},
|
|
874
|
-
output: "followers",
|
|
875
|
-
},
|
|
876
|
-
|
|
877
|
-
// Step 5: Send notifications to all followers
|
|
878
|
-
{
|
|
879
|
-
forEach: {
|
|
880
|
-
array: "$followers",
|
|
881
|
-
do: [
|
|
882
|
-
{
|
|
883
|
-
connect: {
|
|
884
|
-
from: "$input.hostId",
|
|
885
|
-
to: "$item.fromEntityId",
|
|
886
|
-
type: "notification",
|
|
887
|
-
metadata: {
|
|
888
|
-
notificationType: "sent",
|
|
889
|
-
title: "Livestream started!",
|
|
890
|
-
body: "$input.title",
|
|
891
|
-
livestreamId: "$livestreamId",
|
|
892
|
-
sentAt: Date.now(),
|
|
893
|
-
priority: "high",
|
|
894
|
-
},
|
|
895
|
-
},
|
|
896
|
-
},
|
|
897
|
-
{
|
|
898
|
-
event: {
|
|
899
|
-
entity: "$item.fromEntityId",
|
|
900
|
-
type: "notification",
|
|
901
|
-
actor: "$input.hostId",
|
|
902
|
-
metadata: {
|
|
903
|
-
notificationType: "sent",
|
|
904
|
-
channel: "push",
|
|
905
|
-
livestreamId: "$livestreamId",
|
|
906
|
-
},
|
|
907
|
-
},
|
|
908
|
-
},
|
|
909
|
-
],
|
|
910
|
-
output: "notificationResults",
|
|
911
|
-
},
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
// Step 6: Return result
|
|
915
|
-
{
|
|
916
|
-
return: {
|
|
917
|
-
livestreamId: "$livestreamId",
|
|
918
|
-
notificationsSent: "$notificationResults.length",
|
|
919
|
-
},
|
|
920
|
-
},
|
|
921
|
-
],
|
|
922
|
-
};
|
|
923
|
-
|
|
924
|
-
// ============================================================================
|
|
925
|
-
// EXAMPLE 4: ELEVATE Journey (DSL)
|
|
926
|
-
// ============================================================================
|
|
927
|
-
|
|
928
|
-
const elevateJourneyDSL = {
|
|
929
|
-
feature: "ELEVATEJourney",
|
|
930
|
-
input: {
|
|
931
|
-
userId: "Id<entities>",
|
|
932
|
-
},
|
|
933
|
-
output: {
|
|
934
|
-
completed: "boolean",
|
|
935
|
-
},
|
|
936
|
-
|
|
937
|
-
flow: [
|
|
938
|
-
// Step 1: Hook - Free AI analysis
|
|
939
|
-
{
|
|
940
|
-
step: "hook",
|
|
941
|
-
actions: [
|
|
942
|
-
{
|
|
943
|
-
service: {
|
|
944
|
-
provider: "openai",
|
|
945
|
-
method: "generateBusinessAnalysis",
|
|
946
|
-
params: { userId: "$input.userId" },
|
|
947
|
-
output: "analysis",
|
|
948
|
-
},
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
event: {
|
|
952
|
-
entity: "$input.userId",
|
|
953
|
-
type: "elevate_step_completed",
|
|
954
|
-
metadata: { step: "hook", output: "$analysis" },
|
|
955
|
-
},
|
|
956
|
-
},
|
|
957
|
-
],
|
|
958
|
-
},
|
|
959
|
-
|
|
960
|
-
// Wait 24 hours
|
|
961
|
-
{ wait: "24h" },
|
|
962
|
-
|
|
963
|
-
// Step 2: Gift - Send insights
|
|
964
|
-
{
|
|
965
|
-
step: "gift",
|
|
966
|
-
actions: [
|
|
967
|
-
{
|
|
968
|
-
service: {
|
|
969
|
-
provider: "resend",
|
|
970
|
-
method: "sendInsightsReport",
|
|
971
|
-
params: {
|
|
972
|
-
to: "$user.properties.email",
|
|
973
|
-
insights: "$analysis",
|
|
974
|
-
},
|
|
975
|
-
},
|
|
976
|
-
},
|
|
977
|
-
{
|
|
978
|
-
event: {
|
|
979
|
-
entity: "$input.userId",
|
|
980
|
-
type: "elevate_step_completed",
|
|
981
|
-
metadata: { step: "gift" },
|
|
982
|
-
},
|
|
983
|
-
},
|
|
984
|
-
],
|
|
985
|
-
},
|
|
986
|
-
|
|
987
|
-
// Step 3: Identify - Payment gate
|
|
988
|
-
{
|
|
989
|
-
step: "identify",
|
|
990
|
-
actions: [
|
|
991
|
-
{
|
|
992
|
-
service: {
|
|
993
|
-
provider: "stripe",
|
|
994
|
-
method: "createCheckoutSession",
|
|
995
|
-
params: {
|
|
996
|
-
amount: 10000,
|
|
997
|
-
currency: "usd",
|
|
998
|
-
successUrl: "$baseUrl/elevate/success",
|
|
999
|
-
cancelUrl: "$baseUrl/elevate/cancel",
|
|
1000
|
-
},
|
|
1001
|
-
output: "checkout",
|
|
1002
|
-
},
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
waitForEvent: {
|
|
1006
|
-
eventType: "payment_completed",
|
|
1007
|
-
entityId: "$input.userId",
|
|
1008
|
-
timeout: "7d",
|
|
1009
|
-
},
|
|
1010
|
-
output: "paymentCompleted",
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
if: {
|
|
1014
|
-
condition: "$paymentCompleted == false",
|
|
1015
|
-
then: [{ return: { completed: false } }],
|
|
1016
|
-
},
|
|
1017
|
-
},
|
|
1018
|
-
],
|
|
1019
|
-
},
|
|
1020
|
-
|
|
1021
|
-
// Steps 4-9 continue...
|
|
1022
|
-
|
|
1023
|
-
{ return: { completed: true } },
|
|
1024
|
-
],
|
|
1025
|
-
};
|
|
1026
|
-
|
|
1027
|
-
// ============================================================================
|
|
1028
|
-
// EXAMPLE 4: Query Pattern (DSL)
|
|
1029
|
-
// ============================================================================
|
|
1030
|
-
|
|
1031
|
-
const getCreatorWithContentDSL = {
|
|
1032
|
-
feature: "GetCreatorWithContent",
|
|
1033
|
-
input: {
|
|
1034
|
-
creatorId: "Id<entities>",
|
|
1035
|
-
},
|
|
1036
|
-
output: {
|
|
1037
|
-
creator: "Entity",
|
|
1038
|
-
content: "Entity[]",
|
|
1039
|
-
followerCount: "number",
|
|
1040
|
-
},
|
|
1041
|
-
|
|
1042
|
-
flow: [
|
|
1043
|
-
// Step 1: Get creator entity
|
|
1044
|
-
{
|
|
1045
|
-
query: {
|
|
1046
|
-
from: "entities",
|
|
1047
|
-
where: [
|
|
1048
|
-
{ field: "_id", operator: "eq", value: "$input.creatorId" },
|
|
1049
|
-
{ field: "type", operator: "eq", value: "creator" },
|
|
1050
|
-
],
|
|
1051
|
-
limit: 1,
|
|
1052
|
-
},
|
|
1053
|
-
output: "creator",
|
|
1054
|
-
},
|
|
1055
|
-
|
|
1056
|
-
// Step 2: Get authored content
|
|
1057
|
-
{
|
|
1058
|
-
query: {
|
|
1059
|
-
from: "connections",
|
|
1060
|
-
where: [
|
|
1061
|
-
{ field: "fromEntityId", operator: "eq", value: "$input.creatorId" },
|
|
1062
|
-
{ field: "relationshipType", operator: "eq", value: "authored" },
|
|
1063
|
-
],
|
|
1064
|
-
},
|
|
1065
|
-
output: "contentConnections",
|
|
1066
|
-
},
|
|
1067
|
-
|
|
1068
|
-
// Step 3: Hydrate content entities
|
|
1069
|
-
{
|
|
1070
|
-
forEach: {
|
|
1071
|
-
array: "$contentConnections",
|
|
1072
|
-
do: [
|
|
1073
|
-
{
|
|
1074
|
-
query: {
|
|
1075
|
-
from: "entities",
|
|
1076
|
-
where: [
|
|
1077
|
-
{ field: "_id", operator: "eq", value: "$item.toEntityId" },
|
|
1078
|
-
],
|
|
1079
|
-
},
|
|
1080
|
-
},
|
|
1081
|
-
],
|
|
1082
|
-
output: "content",
|
|
1083
|
-
},
|
|
1084
|
-
},
|
|
1085
|
-
|
|
1086
|
-
// Step 4: Count followers
|
|
1087
|
-
{
|
|
1088
|
-
query: {
|
|
1089
|
-
from: "connections",
|
|
1090
|
-
where: [
|
|
1091
|
-
{ field: "toEntityId", operator: "eq", value: "$input.creatorId" },
|
|
1092
|
-
{ field: "relationshipType", operator: "eq", value: "following" },
|
|
1093
|
-
],
|
|
1094
|
-
},
|
|
1095
|
-
output: "followers",
|
|
1096
|
-
},
|
|
1097
|
-
|
|
1098
|
-
// Step 5: Return result
|
|
1099
|
-
{
|
|
1100
|
-
return: {
|
|
1101
|
-
creator: "$creator",
|
|
1102
|
-
content: "$content",
|
|
1103
|
-
followerCount: "$followers.length",
|
|
1104
|
-
},
|
|
1105
|
-
},
|
|
1106
|
-
],
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
// ============================================================================
|
|
1110
|
-
// DSL COMPILER
|
|
1111
|
-
// Compiles DSL to TypeScript with Effect.ts and Plain Convex
|
|
1112
|
-
// ============================================================================
|
|
1113
|
-
|
|
1114
|
-
class ONECompiler {
|
|
1115
|
-
/**
|
|
1116
|
-
* Compiles DSL to TypeScript with Effect.ts
|
|
1117
|
-
*
|
|
1118
|
-
* Key Features:
|
|
1119
|
-
* - Generates plain Convex queries/mutations (NO Convex Ents)
|
|
1120
|
-
* - Uses ctx.db.insert/query/patch directly
|
|
1121
|
-
* - Metadata field stores type-specific data
|
|
1122
|
-
* - Effect.ts for composition and error handling
|
|
1123
|
-
*/
|
|
1124
|
-
compile(dsl: any): string {
|
|
1125
|
-
const feature = dsl.feature;
|
|
1126
|
-
const input = dsl.input;
|
|
1127
|
-
const output = dsl.output;
|
|
1128
|
-
const flow = dsl.flow;
|
|
1129
|
-
|
|
1130
|
-
let code = `// Generated from ONE DSL
|
|
1131
|
-
// Compiles to Plain Convex (NO Convex Ents) + Effect.ts
|
|
1132
|
-
import { Effect } from "effect";
|
|
1133
|
-
import { mutation, query, internalMutation } from "./_generated/server";
|
|
1134
|
-
import { v } from "convex/values";
|
|
1135
|
-
import { OpenAIProvider, ElevenLabsProvider, StripeProvider, BlockchainProvider, ResendProvider } from "@/convex/services/providers";
|
|
1136
|
-
|
|
1137
|
-
/**
|
|
1138
|
-
* Generated ${feature} function
|
|
1139
|
-
* Uses plain Convex with Effect.ts for composition
|
|
1140
|
-
*/
|
|
1141
|
-
export const ${this.toCamelCase(feature)} = mutation({
|
|
1142
|
-
args: ${this.generateInputArgs(input)},
|
|
1143
|
-
handler: async (ctx, args) => {
|
|
1144
|
-
return await Effect.runPromise(
|
|
1145
|
-
Effect.gen(function* () {
|
|
1146
|
-
`;
|
|
1147
|
-
|
|
1148
|
-
// Compile each step in flow
|
|
1149
|
-
for (const step of flow) {
|
|
1150
|
-
code += this.compileStep(step, 4);
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
code += ` })
|
|
1154
|
-
);
|
|
1155
|
-
},
|
|
1156
|
-
});
|
|
1157
|
-
`;
|
|
1158
|
-
|
|
1159
|
-
return code;
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
private compileStep(step: any, indent: number): string {
|
|
1163
|
-
const ind = " ".repeat(indent);
|
|
1164
|
-
|
|
1165
|
-
// Entity creation (Plain Convex - NO Convex Ents)
|
|
1166
|
-
if (step.entity) {
|
|
1167
|
-
return `${ind}// Create entity using plain Convex ctx.db.insert
|
|
1168
|
-
${ind}const ${step.output || "entity"} = yield* Effect.promise(() =>
|
|
1169
|
-
${ind} ctx.db.insert("entities", {
|
|
1170
|
-
${ind} type: "${step.entity.type}",
|
|
1171
|
-
${ind} name: ${this.compileExpression(step.entity.name)},
|
|
1172
|
-
${ind} properties: ${JSON.stringify(step.entity.properties, null, 2).replace(/\n/g, "\n" + ind + " ")},
|
|
1173
|
-
${ind} status: "${step.entity.status || "active"}",
|
|
1174
|
-
${ind} createdAt: Date.now(),
|
|
1175
|
-
${ind} updatedAt: Date.now(),
|
|
1176
|
-
${ind} })
|
|
1177
|
-
${ind});
|
|
1178
|
-
`;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
// Connection creation (Plain Convex - stores metadata)
|
|
1182
|
-
if (step.connect) {
|
|
1183
|
-
const metadataStr = step.connect.metadata
|
|
1184
|
-
? JSON.stringify(step.connect.metadata, null, 2).replace(
|
|
1185
|
-
/\n/g,
|
|
1186
|
-
"\n" + ind + " "
|
|
1187
|
-
)
|
|
1188
|
-
: "undefined";
|
|
1189
|
-
return `${ind}// Create connection using plain Convex ctx.db.insert
|
|
1190
|
-
${ind}yield* Effect.promise(() =>
|
|
1191
|
-
${ind} ctx.db.insert("connections", {
|
|
1192
|
-
${ind} fromEntityId: ${this.compileExpression(step.connect.from)},
|
|
1193
|
-
${ind} toEntityId: ${this.compileExpression(step.connect.to)},
|
|
1194
|
-
${ind} relationshipType: "${step.connect.type}",
|
|
1195
|
-
${ind} metadata: ${metadataStr},
|
|
1196
|
-
${ind} createdAt: Date.now(),
|
|
1197
|
-
${ind} })
|
|
1198
|
-
${ind});
|
|
1199
|
-
`;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
// Event logging (Plain Convex - stores metadata)
|
|
1203
|
-
if (step.event) {
|
|
1204
|
-
const metadataStr = step.event.metadata
|
|
1205
|
-
? JSON.stringify(step.event.metadata, null, 2).replace(
|
|
1206
|
-
/\n/g,
|
|
1207
|
-
"\n" + ind + " "
|
|
1208
|
-
)
|
|
1209
|
-
: "undefined";
|
|
1210
|
-
return `${ind}// Log event using plain Convex ctx.db.insert
|
|
1211
|
-
${ind}yield* Effect.promise(() =>
|
|
1212
|
-
${ind} ctx.db.insert("events", {
|
|
1213
|
-
${ind} entityId: ${this.compileExpression(step.event.entity)},
|
|
1214
|
-
${ind} eventType: "${step.event.type}",
|
|
1215
|
-
${ind} actorId: ${this.compileExpression(step.event.actor || '"system"')},
|
|
1216
|
-
${ind} timestamp: Date.now(),
|
|
1217
|
-
${ind} actorType: "${step.event.actor ? "user" : "system"}",
|
|
1218
|
-
${ind} metadata: ${metadataStr},
|
|
1219
|
-
${ind} })
|
|
1220
|
-
${ind});
|
|
1221
|
-
`;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
// Service call
|
|
1225
|
-
if (step.service) {
|
|
1226
|
-
const provider = this.capitalizeFirst(step.service.provider);
|
|
1227
|
-
return `${ind}const ${step.output || "result"} = yield* Effect.gen(function* () {
|
|
1228
|
-
${ind} const ${step.service.provider} = yield* ${provider}Provider;
|
|
1229
|
-
${ind} return yield* ${step.service.provider}.${step.service.method}(${JSON.stringify(step.service.params)});
|
|
1230
|
-
${ind}})${step.retry ? `.pipe(Effect.retry({ times: ${step.retry.times} }))` : ""}${step.timeout ? `.pipe(Effect.timeout("${step.timeout}"))` : ""};
|
|
1231
|
-
`;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
// Query (Plain Convex - uses ctx.db.query)
|
|
1235
|
-
if (step.query) {
|
|
1236
|
-
return `${ind}// Query using plain Convex ctx.db.query
|
|
1237
|
-
${ind}const ${step.output || "queryResult"} = yield* Effect.promise(async () => {
|
|
1238
|
-
${ind} let query = ctx.db.query("${step.query.from}");
|
|
1239
|
-
${this.compileQueryFilters(step.query.where || [], indent + 1)}
|
|
1240
|
-
${step.query.limit ? `${ind} query = query.take(${step.query.limit});` : ""}
|
|
1241
|
-
${ind} return await query.collect();
|
|
1242
|
-
${ind}});
|
|
1243
|
-
`;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
// Conditional
|
|
1247
|
-
if (step.if) {
|
|
1248
|
-
let code = `${ind}if (${this.compileExpression(step.if.condition)}) {
|
|
1249
|
-
`;
|
|
1250
|
-
for (const thenStep of step.if.then) {
|
|
1251
|
-
code += this.compileStep(thenStep, indent + 1);
|
|
1252
|
-
}
|
|
1253
|
-
if (step.if.else) {
|
|
1254
|
-
code += `${ind}} else {
|
|
1255
|
-
`;
|
|
1256
|
-
for (const elseStep of step.if.else) {
|
|
1257
|
-
code += this.compileStep(elseStep, indent + 1);
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
code += `${ind}}
|
|
1261
|
-
`;
|
|
1262
|
-
return code;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
// Return
|
|
1266
|
-
if (step.return) {
|
|
1267
|
-
return `${ind}return ${JSON.stringify(step.return)};
|
|
1268
|
-
`;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
return `${ind}// Unknown step type
|
|
1272
|
-
`;
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
private compileExpression(expr: string): string {
|
|
1276
|
-
if (expr.startsWith("$")) {
|
|
1277
|
-
// Variable reference
|
|
1278
|
-
return expr.substring(1).replace(/\./g, "?.");
|
|
1279
|
-
}
|
|
1280
|
-
return `"${expr}"`;
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
private compileQueryFilters(filters: any[], indent: number): string {
|
|
1284
|
-
const ind = " ".repeat(indent);
|
|
1285
|
-
let code = "";
|
|
1286
|
-
for (const filter of filters) {
|
|
1287
|
-
// Plain Convex filter syntax (no Convex Ents)
|
|
1288
|
-
code += `${ind}query = query.filter((q) => q.eq(q.field("${filter.field}"), ${this.compileExpression(filter.value)}));\n`;
|
|
1289
|
-
}
|
|
1290
|
-
return code;
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
private generateInputArgs(input: Record<string, string>): string {
|
|
1294
|
-
// Generate Convex args validator object
|
|
1295
|
-
const args = Object.entries(input)
|
|
1296
|
-
.map(([key, type]) => {
|
|
1297
|
-
const convexType = this.typeToConvexValidator(type);
|
|
1298
|
-
return ` ${key}: ${convexType}`;
|
|
1299
|
-
})
|
|
1300
|
-
.join(",\n");
|
|
1301
|
-
return `{\n${args}\n }`;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
private typeToConvexValidator(type: string): string {
|
|
1305
|
-
// Map DSL types to Convex validators
|
|
1306
|
-
if (type.includes("Id<")) return "v.id('entities')";
|
|
1307
|
-
if (type === "string") return "v.string()";
|
|
1308
|
-
if (type === "number") return "v.number()";
|
|
1309
|
-
if (type === "boolean") return "v.boolean()";
|
|
1310
|
-
if (type.includes("[]")) {
|
|
1311
|
-
const innerType = type.replace("[]", "");
|
|
1312
|
-
return `v.array(${this.typeToConvexValidator(innerType)})`;
|
|
1313
|
-
}
|
|
1314
|
-
return "v.any()";
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
private toCamelCase(str: string): string {
|
|
1318
|
-
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
private capitalizeFirst(str: string): string {
|
|
1322
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
// ============================================================================
|
|
1327
|
-
// DSL VALIDATOR
|
|
1328
|
-
// Validates DSL against ontology before compilation
|
|
1329
|
-
// ============================================================================
|
|
1330
|
-
|
|
1331
|
-
class ONEValidator {
|
|
1332
|
-
private ontology: {
|
|
1333
|
-
entityTypes: string[];
|
|
1334
|
-
connectionTypes: string[]; // 24 consolidated types
|
|
1335
|
-
eventTypes: string[]; // 38 consolidated types
|
|
1336
|
-
};
|
|
1337
|
-
|
|
1338
|
-
constructor(ontology: any) {
|
|
1339
|
-
this.ontology = ontology;
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
validate(dsl: any): { valid: boolean; errors: string[] } {
|
|
1343
|
-
const errors: string[] = [];
|
|
1344
|
-
|
|
1345
|
-
// Validate all entity types used exist in ontology
|
|
1346
|
-
this.validateEntities(dsl.flow, errors);
|
|
1347
|
-
|
|
1348
|
-
// Validate all connection types used exist in ontology
|
|
1349
|
-
this.validateConnections(dsl.flow, errors);
|
|
1350
|
-
|
|
1351
|
-
// Validate all event types used exist in ontology
|
|
1352
|
-
this.validateEvents(dsl.flow, errors);
|
|
1353
|
-
|
|
1354
|
-
// Validate metadata patterns for consolidated types
|
|
1355
|
-
this.validateMetadata(dsl.flow, errors);
|
|
1356
|
-
|
|
1357
|
-
return {
|
|
1358
|
-
valid: errors.length === 0,
|
|
1359
|
-
errors,
|
|
1360
|
-
};
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
private validateEntities(flow: any[], errors: string[]): void {
|
|
1364
|
-
for (const step of flow) {
|
|
1365
|
-
if (step.entity && !this.ontology.entityTypes.includes(step.entity.type)) {
|
|
1366
|
-
errors.push(
|
|
1367
|
-
`Invalid entity type: ${step.entity.type}. Must be one of: ${this.ontology.entityTypes.join(", ")}`
|
|
1368
|
-
);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
private validateConnections(flow: any[], errors: string[]): void {
|
|
1374
|
-
for (const step of flow) {
|
|
1375
|
-
if (
|
|
1376
|
-
step.connect &&
|
|
1377
|
-
!this.ontology.connectionTypes.includes(step.connect.type)
|
|
1378
|
-
) {
|
|
1379
|
-
errors.push(
|
|
1380
|
-
`Invalid connection type: ${step.connect.type}. Must be one of 24 consolidated types: ${this.ontology.connectionTypes.join(", ")}`
|
|
1381
|
-
);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
private validateEvents(flow: any[], errors: string[]): void {
|
|
1387
|
-
for (const step of flow) {
|
|
1388
|
-
if (step.event && !this.ontology.eventTypes.includes(step.event.type)) {
|
|
1389
|
-
errors.push(
|
|
1390
|
-
`Invalid event type: ${step.event.type}. Must be one of 38 consolidated types: ${this.ontology.eventTypes.join(", ")}`
|
|
1391
|
-
);
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
private validateMetadata(flow: any[], errors: string[]): void {
|
|
1397
|
-
const consolidatedTypes = {
|
|
1398
|
-
payment: ["subscription", "purchase", "tip", "refund"],
|
|
1399
|
-
livestream: ["hosted", "attended", "moderated", "banned_from"],
|
|
1400
|
-
notification: ["sent", "received", "read"],
|
|
1401
|
-
referral: ["referred", "earned_from"],
|
|
1402
|
-
content: ["created", "published", "edited", "deleted", "viewed", "shared"],
|
|
1403
|
-
};
|
|
1404
|
-
|
|
1405
|
-
for (const step of flow) {
|
|
1406
|
-
// Validate connection metadata
|
|
1407
|
-
if (step.connect && step.connect.metadata) {
|
|
1408
|
-
const type = step.connect.type;
|
|
1409
|
-
if (consolidatedTypes[type]) {
|
|
1410
|
-
const metadataType = step.connect.metadata[`${type}Type`];
|
|
1411
|
-
if (
|
|
1412
|
-
metadataType &&
|
|
1413
|
-
!consolidatedTypes[type].includes(metadataType)
|
|
1414
|
-
) {
|
|
1415
|
-
errors.push(
|
|
1416
|
-
`Invalid ${type}Type: ${metadataType}. Must be one of: ${consolidatedTypes[type].join(", ")}`
|
|
1417
|
-
);
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
// Validate event metadata
|
|
1423
|
-
if (step.event && step.event.metadata) {
|
|
1424
|
-
const type = step.event.type;
|
|
1425
|
-
if (consolidatedTypes[type]) {
|
|
1426
|
-
const metadataType = step.event.metadata[`${type}Type`];
|
|
1427
|
-
if (
|
|
1428
|
-
metadataType &&
|
|
1429
|
-
!consolidatedTypes[type].includes(metadataType)
|
|
1430
|
-
) {
|
|
1431
|
-
errors.push(
|
|
1432
|
-
`Invalid ${type}Type: ${metadataType}. Must be one of: ${consolidatedTypes[type].join(", ")}`
|
|
1433
|
-
);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
// ============================================================================
|
|
1442
|
-
// USAGE EXAMPLE - Full Ontology with 24+38 Consolidated Types
|
|
1443
|
-
// ============================================================================
|
|
1444
|
-
|
|
1445
|
-
/**
|
|
1446
|
-
* Complete ontology with hybrid type strategy
|
|
1447
|
-
*/
|
|
1448
|
-
const FULL_ONTOLOGY = {
|
|
1449
|
-
entityTypes: [
|
|
1450
|
-
"creator",
|
|
1451
|
-
"ai_clone",
|
|
1452
|
-
"token",
|
|
1453
|
-
"audience_member",
|
|
1454
|
-
"content",
|
|
1455
|
-
"course",
|
|
1456
|
-
"livestream",
|
|
1457
|
-
"subscription",
|
|
1458
|
-
"notification",
|
|
1459
|
-
],
|
|
1460
|
-
|
|
1461
|
-
// 25 HYBRID CONNECTION TYPES
|
|
1462
|
-
connectionTypes: [
|
|
1463
|
-
// Specific Types (18)
|
|
1464
|
-
"owns", "created_by",
|
|
1465
|
-
"clone_of", "trained_on", "powers",
|
|
1466
|
-
"authored", "generated_by", "published_to", "part_of", "references",
|
|
1467
|
-
"member_of", "following", "moderates", "participated_in",
|
|
1468
|
-
"manages", "reports_to", "collaborates_with",
|
|
1469
|
-
"holds_tokens", "staked_in", "earned_from",
|
|
1470
|
-
"purchased", "enrolled_in", "completed", "teaching",
|
|
1471
|
-
// Consolidated Types (7) - use metadata
|
|
1472
|
-
"transacted", // metadata.transactionType + protocol
|
|
1473
|
-
"notified", // metadata.channel + notificationType
|
|
1474
|
-
"referred", // metadata.referralType
|
|
1475
|
-
"communicated", // metadata.protocol + messageType
|
|
1476
|
-
"delegated", // metadata.protocol + taskType
|
|
1477
|
-
"approved", // metadata.approvalType + protocol
|
|
1478
|
-
"fulfilled", // metadata.fulfillmentType + protocol
|
|
1479
|
-
],
|
|
1480
|
-
|
|
1481
|
-
// 35 HYBRID EVENT TYPES
|
|
1482
|
-
eventTypes: [
|
|
1483
|
-
// Specific Types (24)
|
|
1484
|
-
"entity_created", "entity_updated", "entity_deleted", "entity_archived",
|
|
1485
|
-
"user_registered", "user_verified", "user_login", "user_logout", "profile_updated",
|
|
1486
|
-
"clone_created", "clone_updated", "voice_cloned", "appearance_cloned",
|
|
1487
|
-
"agent_created", "agent_executed", "agent_completed", "agent_failed",
|
|
1488
|
-
"token_created", "token_minted", "token_burned", "tokens_purchased", "tokens_staked", "tokens_unstaked", "tokens_transferred",
|
|
1489
|
-
"course_created", "course_enrolled", "lesson_completed", "course_completed", "certificate_earned",
|
|
1490
|
-
"metric_calculated", "insight_generated", "prediction_made", "optimization_applied", "report_generated",
|
|
1491
|
-
// Consolidated Types (11) - use metadata
|
|
1492
|
-
"content_event", // metadata.action + protocol
|
|
1493
|
-
"payment_event", // metadata.status + protocol
|
|
1494
|
-
"subscription_event", // metadata.action
|
|
1495
|
-
"commerce_event", // metadata.eventType + protocol
|
|
1496
|
-
"livestream_event", // metadata.status + metadata.action
|
|
1497
|
-
"notification_event", // metadata.channel + deliveryStatus
|
|
1498
|
-
"referral_event", // metadata.action
|
|
1499
|
-
"communication_event", // metadata.protocol + messageType
|
|
1500
|
-
"task_event", // metadata.action + protocol
|
|
1501
|
-
"mandate_event", // metadata.mandateType + protocol
|
|
1502
|
-
"price_event", // metadata.action
|
|
1503
|
-
],
|
|
1504
|
-
};
|
|
1505
|
-
|
|
1506
|
-
// 1. Define feature in DSL
|
|
1507
|
-
const myFeature = livestreamWithNotificationsDSL;
|
|
1508
|
-
|
|
1509
|
-
// 2. Validate against full ontology
|
|
1510
|
-
const validator = new ONEValidator(FULL_ONTOLOGY);
|
|
1511
|
-
|
|
1512
|
-
const validation = validator.validate(myFeature);
|
|
1513
|
-
if (!validation.valid) {
|
|
1514
|
-
console.error("DSL validation failed:", validation.errors);
|
|
1515
|
-
process.exit(1);
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
// 3. Compile to TypeScript with Plain Convex
|
|
1519
|
-
const compiler = new ONECompiler();
|
|
1520
|
-
const generatedCode = compiler.compile(myFeature);
|
|
1521
|
-
|
|
1522
|
-
// 4. Write to file
|
|
1523
|
-
// fs.writeFileSync("convex/features/startLivestream.ts", generatedCode);
|
|
1524
|
-
|
|
1525
|
-
console.log("Generated Plain Convex code:");
|
|
1526
|
-
console.log(generatedCode);
|
|
1527
|
-
|
|
1528
|
-
/**
|
|
1529
|
-
* EXAMPLE OUTPUT - What the compiler generates:
|
|
1530
|
-
*
|
|
1531
|
-
* // Generated from ONE DSL
|
|
1532
|
-
* // Compiles to Plain Convex (NO Convex Ents) + Effect.ts
|
|
1533
|
-
* import { Effect } from "effect";
|
|
1534
|
-
* import { mutation } from "./_generated/server";
|
|
1535
|
-
* import { v } from "convex/values";
|
|
1536
|
-
*
|
|
1537
|
-
* export const startLivestreamWithNotifications = mutation({
|
|
1538
|
-
* args: {
|
|
1539
|
-
* hostId: v.id('entities'),
|
|
1540
|
-
* title: v.string(),
|
|
1541
|
-
* description: v.string()
|
|
1542
|
-
* },
|
|
1543
|
-
* handler: async (ctx, args) => {
|
|
1544
|
-
* return await Effect.runPromise(
|
|
1545
|
-
* Effect.gen(function* () {
|
|
1546
|
-
* // Create entity using plain Convex ctx.db.insert
|
|
1547
|
-
* const livestreamId = yield* Effect.promise(() =>
|
|
1548
|
-
* ctx.db.insert("entities", {
|
|
1549
|
-
* type: "livestream",
|
|
1550
|
-
* name: args.title,
|
|
1551
|
-
* properties: { ... },
|
|
1552
|
-
* ...
|
|
1553
|
-
* })
|
|
1554
|
-
* );
|
|
1555
|
-
*
|
|
1556
|
-
* // Create connection with metadata
|
|
1557
|
-
* yield* Effect.promise(() =>
|
|
1558
|
-
* ctx.db.insert("connections", {
|
|
1559
|
-
* fromEntityId: args.hostId,
|
|
1560
|
-
* toEntityId: livestreamId,
|
|
1561
|
-
* relationshipType: "livestream",
|
|
1562
|
-
* metadata: {
|
|
1563
|
-
* livestreamType: "hosted",
|
|
1564
|
-
* ...
|
|
1565
|
-
* }
|
|
1566
|
-
* })
|
|
1567
|
-
* );
|
|
1568
|
-
* // ... rest of generated code
|
|
1569
|
-
* })
|
|
1570
|
-
* );
|
|
1571
|
-
* }
|
|
1572
|
-
* });
|
|
1573
|
-
*/
|
|
1574
|
-
|
|
1575
|
-
// ============================================================================
|
|
1576
|
-
// DSL SYNTAX SUMMARY - Plain English vs Technical DSL
|
|
1577
|
-
// ============================================================================
|
|
1578
|
-
|
|
1579
|
-
/**
|
|
1580
|
-
* The ONE DSL supports TWO syntax styles:
|
|
1581
|
-
*
|
|
1582
|
-
* 1. PLAIN ENGLISH DSL (Non-technical users)
|
|
1583
|
-
* - Natural language commands
|
|
1584
|
-
* - Example: "Create a token named 'MyToken' with supply 1000000"
|
|
1585
|
-
* - Example: "When user purchases tokens, send them a confirmation email"
|
|
1586
|
-
*
|
|
1587
|
-
* 2. TECHNICAL DSL (Developers and AI agents)
|
|
1588
|
-
* - Structured declarative syntax (shown in this file)
|
|
1589
|
-
* - Type-safe with validation
|
|
1590
|
-
* - Compiles to Effect.ts + Plain Convex
|
|
1591
|
-
*
|
|
1592
|
-
* Both syntaxes are maintained separately but compile to the same output.
|
|
1593
|
-
*
|
|
1594
|
-
* WHY TWO SYNTAXES?
|
|
1595
|
-
* - Plain English: For product managers, designers, non-technical stakeholders
|
|
1596
|
-
* - Technical DSL: For developers, AI agents who need precision and type safety
|
|
1597
|
-
*
|
|
1598
|
-
* CURRENT STATUS:
|
|
1599
|
-
* - Technical DSL: Fully specified in this file
|
|
1600
|
-
* - Plain English DSL: Defined in separate documentation
|
|
1601
|
-
* - Both will be implemented in the compiler
|
|
1602
|
-
*/
|
|
1603
|
-
|
|
1604
|
-
// ============================================================================
|
|
1605
|
-
// KEY ARCHITECTURAL DECISIONS
|
|
1606
|
-
// ============================================================================
|
|
1607
|
-
|
|
1608
|
-
/**
|
|
1609
|
-
* 1. PLAIN CONVEX (NO CONVEX ENTS)
|
|
1610
|
-
* - Uses defineTable() not ent()
|
|
1611
|
-
* - Manual relationship queries
|
|
1612
|
-
* - More explicit, easier for AI agents
|
|
1613
|
-
* - Better for metadata-based patterns
|
|
1614
|
-
*
|
|
1615
|
-
* 2. 25 HYBRID CONNECTION TYPES
|
|
1616
|
-
* - 18 specific semantic types for core domain
|
|
1617
|
-
* - 7 consolidated types with metadata variants
|
|
1618
|
-
* - Protocol-agnostic via metadata.protocol
|
|
1619
|
-
* - Simpler queries, better AI comprehension
|
|
1620
|
-
*
|
|
1621
|
-
* 3. 35 HYBRID EVENT TYPES
|
|
1622
|
-
* - 24 specific types for core domain events
|
|
1623
|
-
* - 11 consolidated types with metadata variants
|
|
1624
|
-
* - Protocol identification via metadata
|
|
1625
|
-
* - Balance between specificity and flexibility
|
|
1626
|
-
*
|
|
1627
|
-
* 4. METADATA-BASED PATTERNS
|
|
1628
|
-
* - Consolidated types use metadata for variants
|
|
1629
|
-
* - Protocol identity in metadata.protocol
|
|
1630
|
-
* - Reduces schema complexity
|
|
1631
|
-
* - Maintains queryability
|
|
1632
|
-
* - Flexible for future protocols
|
|
1633
|
-
*
|
|
1634
|
-
* 5. EFFECT.TS INTEGRATION
|
|
1635
|
-
* - All compiled code uses Effect.ts
|
|
1636
|
-
* - Composable, type-safe operations
|
|
1637
|
-
* - Standardized error handling
|
|
1638
|
-
* - Better testability
|
|
1639
|
-
*
|
|
1640
|
-
* 6. VALIDATOR WITH METADATA CHECKING
|
|
1641
|
-
* - Validates base types (24 connections, 38 events)
|
|
1642
|
-
* - Validates metadata patterns for consolidated types
|
|
1643
|
-
* - Ensures type safety before compilation
|
|
1644
|
-
* - Prevents invalid metadata.typeType values
|
|
1645
|
-
*/
|
|
1646
|
-
|
|
1647
|
-
// ============================================================================
|
|
1648
|
-
// NEXT STEPS FOR IMPLEMENTATION
|
|
1649
|
-
// ============================================================================
|
|
1650
|
-
|
|
1651
|
-
/**
|
|
1652
|
-
* 1. Implement Plain English parser
|
|
1653
|
-
* - Parse natural language to Technical DSL AST
|
|
1654
|
-
* - Use LLM for intent extraction
|
|
1655
|
-
* - Map to Technical DSL constructs
|
|
1656
|
-
*
|
|
1657
|
-
* 2. Complete compiler implementation
|
|
1658
|
-
* - Add support for all DSL primitives
|
|
1659
|
-
* - Generate Effect.ts code
|
|
1660
|
-
* - Generate plain Convex mutations/queries
|
|
1661
|
-
* - Add error handling and retry logic
|
|
1662
|
-
*
|
|
1663
|
-
* 3. Add schema generator
|
|
1664
|
-
* - Generate Convex schema from DSL features
|
|
1665
|
-
* - Create indices based on query patterns
|
|
1666
|
-
* - Generate TypeScript types
|
|
1667
|
-
*
|
|
1668
|
-
* 4. Build testing infrastructure
|
|
1669
|
-
* - DSL validator tests
|
|
1670
|
-
* - Compiler output tests
|
|
1671
|
-
* - Generated code integration tests
|
|
1672
|
-
*
|
|
1673
|
-
* 5. Create developer tools
|
|
1674
|
-
* - VS Code extension for DSL syntax
|
|
1675
|
-
* - Real-time validation
|
|
1676
|
-
* - Auto-completion
|
|
1677
|
-
* - DSL playground
|
|
1678
|
-
*/
|