oneie 3.6.40 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -9
- package/dist/admin/build.d.ts +15 -0
- package/dist/admin/build.d.ts.map +1 -0
- package/dist/admin/build.js +295 -0
- package/dist/admin/build.js.map +1 -0
- package/dist/admin/index.d.ts +24 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +98 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/list.d.ts +14 -0
- package/dist/admin/list.d.ts.map +1 -0
- package/dist/admin/list.js +90 -0
- package/dist/admin/list.js.map +1 -0
- package/dist/admin/manifest.d.ts +86 -0
- package/dist/admin/manifest.d.ts.map +1 -0
- package/dist/admin/manifest.js +183 -0
- package/dist/admin/manifest.js.map +1 -0
- package/dist/admin/monorepo.d.ts +25 -0
- package/dist/admin/monorepo.d.ts.map +1 -0
- package/dist/admin/monorepo.js +59 -0
- package/dist/admin/monorepo.js.map +1 -0
- package/dist/admin/release.d.ts +17 -0
- package/dist/admin/release.d.ts.map +1 -0
- package/dist/admin/release.js +144 -0
- package/dist/admin/release.js.map +1 -0
- package/dist/admin/sync.d.ts +14 -0
- package/dist/admin/sync.d.ts.map +1 -0
- package/dist/admin/sync.js +104 -0
- package/dist/admin/sync.js.map +1 -0
- package/dist/admin/validate.d.ts +15 -0
- package/dist/admin/validate.d.ts.map +1 -0
- package/dist/admin/validate.js +169 -0
- package/dist/admin/validate.js.map +1 -0
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +44 -0
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/ask.d.ts +4 -0
- package/dist/commands/ask.d.ts.map +1 -0
- package/dist/commands/ask.js +8 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/bounty.d.ts +4 -0
- package/dist/commands/bounty.d.ts.map +1 -0
- package/dist/commands/bounty.js +24 -0
- package/dist/commands/bounty.js.map +1 -0
- package/dist/commands/capabilities.d.ts +4 -0
- package/dist/commands/capabilities.d.ts.map +1 -0
- package/dist/commands/capabilities.js +18 -0
- package/dist/commands/capabilities.js.map +1 -0
- package/dist/commands/claw.d.ts +4 -0
- package/dist/commands/claw.d.ts.map +1 -0
- package/dist/commands/claw.js +14 -0
- package/dist/commands/claw.js.map +1 -0
- package/dist/commands/commend.d.ts +4 -0
- package/dist/commands/commend.d.ts.map +1 -0
- package/dist/commands/commend.js +13 -0
- package/dist/commands/commend.js.map +1 -0
- package/dist/commands/completion.d.ts +4 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +49 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +4 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +78 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +4 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +10 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +72 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/export.d.ts +4 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +15 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/fade.d.ts +4 -0
- package/dist/commands/fade.d.ts.map +1 -0
- package/dist/commands/fade.js +15 -0
- package/dist/commands/fade.js.map +1 -0
- package/dist/commands/flag.d.ts +4 -0
- package/dist/commands/flag.d.ts.map +1 -0
- package/dist/commands/flag.js +13 -0
- package/dist/commands/flag.js.map +1 -0
- package/dist/commands/forget.d.ts +4 -0
- package/dist/commands/forget.d.ts.map +1 -0
- package/dist/commands/forget.js +16 -0
- package/dist/commands/forget.js.map +1 -0
- package/dist/commands/frontier.d.ts +4 -0
- package/dist/commands/frontier.d.ts.map +1 -0
- package/dist/commands/frontier.js +11 -0
- package/dist/commands/frontier.js.map +1 -0
- package/dist/commands/health.d.ts +4 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +11 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/highways.d.ts +4 -0
- package/dist/commands/highways.d.ts.map +1 -0
- package/dist/commands/highways.js +14 -0
- package/dist/commands/highways.js.map +1 -0
- package/dist/commands/hire.d.ts +4 -0
- package/dist/commands/hire.d.ts.map +1 -0
- package/dist/commands/hire.js +16 -0
- package/dist/commands/hire.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +69 -42
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/know.d.ts +4 -0
- package/dist/commands/know.d.ts.map +1 -0
- package/dist/commands/know.js +8 -0
- package/dist/commands/know.js.map +1 -0
- package/dist/commands/launch.d.ts +4 -0
- package/dist/commands/launch.d.ts.map +1 -0
- package/dist/commands/launch.js +16 -0
- package/dist/commands/launch.js.map +1 -0
- package/dist/commands/mark.d.ts +4 -0
- package/dist/commands/mark.d.ts.map +1 -0
- package/dist/commands/mark.js +15 -0
- package/dist/commands/mark.js.map +1 -0
- package/dist/commands/pay.d.ts +4 -0
- package/dist/commands/pay.d.ts.map +1 -0
- package/dist/commands/pay.js +21 -0
- package/dist/commands/pay.js.map +1 -0
- package/dist/commands/pipe.d.ts +4 -0
- package/dist/commands/pipe.d.ts.map +1 -0
- package/dist/commands/pipe.js +35 -0
- package/dist/commands/pipe.js.map +1 -0
- package/dist/commands/publish.d.ts +4 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +23 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/recall.d.ts +4 -0
- package/dist/commands/recall.d.ts.map +1 -0
- package/dist/commands/recall.js +12 -0
- package/dist/commands/recall.js.map +1 -0
- package/dist/commands/repl.d.ts +4 -0
- package/dist/commands/repl.d.ts.map +1 -0
- package/dist/commands/repl.js +56 -0
- package/dist/commands/repl.js.map +1 -0
- package/dist/commands/reveal.d.ts +4 -0
- package/dist/commands/reveal.d.ts.map +1 -0
- package/dist/commands/reveal.js +11 -0
- package/dist/commands/reveal.js.map +1 -0
- package/dist/commands/revenue.d.ts +4 -0
- package/dist/commands/revenue.d.ts.map +1 -0
- package/dist/commands/revenue.js +11 -0
- package/dist/commands/revenue.js.map +1 -0
- package/dist/commands/select.d.ts +4 -0
- package/dist/commands/select.d.ts.map +1 -0
- package/dist/commands/select.js +19 -0
- package/dist/commands/select.js.map +1 -0
- package/dist/commands/signal.d.ts +4 -0
- package/dist/commands/signal.d.ts.map +1 -0
- package/dist/commands/signal.js +8 -0
- package/dist/commands/signal.js.map +1 -0
- package/dist/commands/stats.d.ts +4 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +11 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +18 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +4 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +20 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/tail.d.ts +4 -0
- package/dist/commands/tail.d.ts.map +1 -0
- package/dist/commands/tail.js +51 -0
- package/dist/commands/tail.js.map +1 -0
- package/dist/commands/warn.d.ts +4 -0
- package/dist/commands/warn.d.ts.map +1 -0
- package/dist/commands/warn.js +15 -0
- package/dist/commands/warn.js.map +1 -0
- package/dist/create-org-profile.js +2 -2
- package/dist/create-user-profile.js +2 -2
- package/dist/index.js +135 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/args.d.ts +11 -0
- package/dist/lib/args.d.ts.map +1 -0
- package/dist/lib/args.js +57 -0
- package/dist/lib/args.js.map +1 -0
- package/dist/lib/config.d.ts +12 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +38 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/http.d.ts +9 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +25 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/output.d.ts +5 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +32 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/sdk.d.ts +10 -0
- package/dist/lib/sdk.d.ts.map +1 -0
- package/dist/lib/sdk.js +22 -0
- package/dist/lib/sdk.js.map +1 -0
- package/dist/lib/telemetry.d.ts +4 -0
- package/dist/lib/telemetry.d.ts.map +1 -0
- package/dist/lib/telemetry.js +61 -0
- package/dist/lib/telemetry.js.map +1 -0
- package/dist/utils/file-resolver.js +1 -3
- package/dist/utils/file-resolver.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +15 -0
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +71 -8
- package/dist/utils/installation-setup.js.map +1 -1
- package/package.json +5 -21
- package/.claude/agents/TROUBLESHOOTING.md +0 -530
- package/.claude/agents/agent-backend.md +0 -574
- package/.claude/agents/agent-builder.md +0 -911
- package/.claude/agents/agent-claude.md +0 -645
- package/.claude/agents/agent-clean.md +0 -477
- package/.claude/agents/agent-clone.md +0 -554
- package/.claude/agents/agent-designer.md +0 -1080
- package/.claude/agents/agent-director.md +0 -2254
- package/.claude/agents/agent-documenter.md +0 -688
- package/.claude/agents/agent-frontend.md +0 -1199
- package/.claude/agents/agent-integrator.md +0 -670
- package/.claude/agents/agent-lawyer.md +0 -1320
- package/.claude/agents/agent-news.md +0 -363
- package/.claude/agents/agent-onboard.md +0 -613
- package/.claude/agents/agent-ontology.md +0 -585
- package/.claude/agents/agent-ops.md +0 -1275
- package/.claude/agents/agent-problem-solver.md +0 -669
- package/.claude/agents/agent-quality.md +0 -1042
- package/.claude/agents/agent-sales.md +0 -507
- package/.claude/agents/agent-writer.md +0 -1068
- package/.claude/commands/cascade.md +0 -742
- package/.claude/commands/chat.md +0 -728
- package/.claude/commands/commit.md +0 -95
- package/.claude/commands/create.md +0 -544
- package/.claude/commands/deploy.md +0 -309
- package/.claude/commands/fast.md +0 -636
- package/.claude/commands/mcp-on.md +0 -191
- package/.claude/commands/media-upload.md +0 -186
- package/.claude/commands/news.md +0 -274
- package/.claude/commands/onboard.md +0 -440
- package/.claude/commands/one.md +0 -398
- package/.claude/commands/optimize.md +0 -74
- package/.claude/commands/plan.md +0 -719
- package/.claude/commands/push.md +0 -214
- package/.claude/commands/release.md +0 -105
- package/.claude/commands/review.md +0 -99
- package/.claude/commands/server.md +0 -487
- package/.claude/commands/start.md +0 -227
- package/.claude/commands/test.md +0 -197
- package/.claude/commands/validate.md +0 -140
- package/.claude/hooks/.last-news-context +0 -1
- package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
- package/.claude/hooks/README-knowledge-hooks.md +0 -451
- package/.claude/hooks/README-news-generation.md +0 -364
- package/.claude/hooks/README-root-cleanup.md +0 -200
- package/.claude/hooks/README.md +0 -284
- package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/auto-format.sh +0 -106
- package/.claude/hooks/check-filenames.py +0 -177
- package/.claude/hooks/clean-post.py +0 -468
- package/.claude/hooks/clean-pre.py +0 -393
- package/.claude/hooks/clean-root-markdown.sh +0 -73
- package/.claude/hooks/commit-push.sh +0 -95
- package/.claude/hooks/done.py +0 -236
- package/.claude/hooks/format-hook.sh +0 -163
- package/.claude/hooks/formatting.py +0 -187
- package/.claude/hooks/hook-logger.sh +0 -173
- package/.claude/hooks/knowledge-post.py +0 -355
- package/.claude/hooks/knowledge-pre.py +0 -245
- package/.claude/hooks/mcp-on.sh +0 -134
- package/.claude/hooks/notification-hook.sh +0 -279
- package/.claude/hooks/ontology-validation.py +0 -255
- package/.claude/hooks/push.sh +0 -153
- package/.claude/hooks/release-cli.sh +0 -205
- package/.claude/hooks/root-cleanup.py +0 -217
- package/.claude/hooks/security-hook.sh +0 -397
- package/.claude/hooks/tag-all-docs.py +0 -464
- package/.claude/hooks/test-validate-ontology.sh +0 -170
- package/.claude/hooks/todo.py +0 -368
- package/.claude/hooks/track-changes.sh +0 -101
- package/.claude/hooks/validate-imports.py +0 -182
- package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
- package/.claude/hooks/validate-ontology-structure.py +0 -558
- package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
- package/.claude/hooks/validate-ontology.py +0 -140
- package/.claude/hooks/write-news.sh +0 -194
- package/.claude/skills/INDEX.md +0 -523
- package/.claude/skills/REGISTRY.md +0 -529
- package/.claude/skills/agent-backend-create-mutation.md +0 -319
- package/.claude/skills/agent-designer-create-wireframe.md +0 -341
- package/.claude/skills/agent-frontend-create-page.md +0 -413
- package/.claude/skills/agents/README.md +0 -238
- package/.claude/skills/astro/add-content-collection.md +0 -30
- package/.claude/skills/astro/check-build.md +0 -29
- package/.claude/skills/astro/create-component.md +0 -29
- package/.claude/skills/astro/create-page.md +0 -30
- package/.claude/skills/astro/optimize-performance.md +0 -21
- package/.claude/skills/convex/check-deployment.md +0 -46
- package/.claude/skills/convex/create-mutation.md +0 -405
- package/.claude/skills/convex/create-query.md +0 -52
- package/.claude/skills/convex/read-schema.md +0 -373
- package/.claude/skills/convex/test-function.md +0 -50
- package/.claude/skills/deployment/check-deployment-health.md +0 -20
- package/.claude/skills/deployment/create-release.md +0 -21
- package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
- package/.claude/skills/deployment/deploy-convex.md +0 -30
- package/.claude/skills/deployment/sync-repositories.md +0 -19
- package/.claude/skills/design/check-accessibility.md +0 -21
- package/.claude/skills/design/create-component-spec.md +0 -27
- package/.claude/skills/design/generate-design-tokens.md +0 -24
- package/.claude/skills/design/generate-wireframe.md +0 -30
- package/.claude/skills/documentation/create-migration-guide.md +0 -20
- package/.claude/skills/documentation/generate-api-docs.md +0 -27
- package/.claude/skills/documentation/generate-readme.md +0 -22
- package/.claude/skills/documentation/update-knowledge.md +0 -20
- package/.claude/skills/integration/connect-external-system.md +0 -21
- package/.claude/skills/integration/implement-a2a.md +0 -20
- package/.claude/skills/integration/implement-acp.md +0 -20
- package/.claude/skills/integration/verify-integration.md +0 -20
- package/.claude/skills/ontology/README.md +0 -255
- package/.claude/skills/ontology/check-dimension.md +0 -307
- package/.claude/skills/ontology/generate-entity-type.md +0 -339
- package/.claude/skills/ontology/validate-schema.md +0 -229
- package/.claude/skills/ontology/verify-relationships.md +0 -310
- package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
- package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
- package/.claude/skills/problem-solving/propose-solution.md +0 -29
- package/.claude/skills/problem-solving/verify-fix.md +0 -21
- package/.claude/skills/sales/generate-demo-script.md +0 -21
- package/.claude/skills/sales/qualify-lead.md +0 -30
- package/.claude/skills/sales/track-trial.md +0 -20
- package/.claude/skills/sales/verify-kyc.md +0 -20
- package/.claude/skills/testing/analyze-coverage.md +0 -24
- package/.claude/skills/testing/generate-tests.md +0 -24
- package/.claude/skills/testing/run-tests.md +0 -27
- package/.claude/skills/testing/validate-e2e.md +0 -25
- package/AGENTS.md +0 -60
- package/CLAUDE.md +0 -321
- package/CREATE-WEBSITE.md +0 -458
- package/SECURITY.md +0 -31
- package/dist/commands/create-website.d.ts +0 -19
- package/dist/commands/create-website.d.ts.map +0 -1
- package/dist/commands/create-website.js +0 -231
- package/dist/commands/create-website.js.map +0 -1
- package/folders.yaml +0 -92
- package/one/README.md +0 -760
- package/one/connections/a2a.md +0 -600
- package/one/connections/acp.md +0 -808
- package/one/connections/acps.md +0 -749
- package/one/connections/agentkit.md +0 -367
- package/one/connections/agui.md +0 -785
- package/one/connections/any-backend.md +0 -1720
- package/one/connections/ap2.md +0 -1072
- package/one/connections/api/queries-reference.md +0 -860
- package/one/connections/api-docs.md +0 -1909
- package/one/connections/api-reference.md +0 -1029
- package/one/connections/api.md +0 -2208
- package/one/connections/architecture-diagram.md +0 -112
- package/one/connections/communications.md +0 -467
- package/one/connections/connections.md +0 -357
- package/one/connections/copilotkit.md +0 -1577
- package/one/connections/cryptonetworks.md +0 -799
- package/one/connections/documentation.md +0 -1138
- package/one/connections/effect.md +0 -297
- package/one/connections/elizaos.md +0 -1308
- package/one/connections/groups.md +0 -814
- package/one/connections/inference.md +0 -76
- package/one/connections/integration-examples.md +0 -893
- package/one/connections/integration-guide.md +0 -887
- package/one/connections/integration-phase2.md +0 -754
- package/one/connections/kyc.md +0 -650
- package/one/connections/mcp.md +0 -860
- package/one/connections/membership.md +0 -1170
- package/one/connections/middleware.md +0 -1085
- package/one/connections/multitenant.md +0 -1359
- package/one/connections/n8n.md +0 -1033
- package/one/connections/patterns.md +0 -107
- package/one/connections/protocols.md +0 -297
- package/one/connections/relationships.md +0 -125
- package/one/connections/schema.md +0 -605
- package/one/connections/service-layer.md +0 -568
- package/one/connections/vectors.md +0 -225
- package/one/connections/wordpress.md +0 -1320
- package/one/connections/workflow-copy.md +0 -923
- package/one/connections/workflow-examples.md +0 -759
- package/one/connections/workflow-onboarding.md +0 -701
- package/one/connections/workflow.md +0 -923
- package/one/connections/workflows/delegation.md +0 -903
- package/one/connections/workflows/frontend.md +0 -1055
- package/one/connections/workflows/strategy.md +0 -921
- package/one/connections/workflows/tasks.md +0 -716
- package/one/connections/x402-baazar.md +0 -131
- package/one/connections/x402.md +0 -1353
- package/one/groups/features.md +0 -2904
- package/one/groups/groups.md +0 -587
- package/one/groups/one.md +0 -619
- package/one/groups/strategy-copy.md +0 -887
- package/one/knowledge/.obsidian/app.json +0 -1
- package/one/knowledge/.obsidian/appearance.json +0 -1
- package/one/knowledge/.obsidian/core-plugins.json +0 -33
- package/one/knowledge/.obsidian/ecommerce-ontology.md +0 -210
- package/one/knowledge/.obsidian/workspace.json +0 -211
- package/one/knowledge/100-inference-quick-reference.md +0 -449
- package/one/knowledge/ag-ui-protocol.md +0 -613
- package/one/knowledge/agent-onboard-usage.md +0 -630
- package/one/knowledge/agentic-commerce.md +0 -146
- package/one/knowledge/ai-agents-vs-memecoins-thesis.md +0 -683
- package/one/knowledge/ai-api-reference.md +0 -715
- package/one/knowledge/ai-platform.md +0 -323
- package/one/knowledge/ai-quickstart.md +0 -355
- package/one/knowledge/ai-sdk-implementation.md +0 -436
- package/one/knowledge/ai-token-crypto-analysis-framework.md +0 -1191
- package/one/knowledge/ai-token-paradigm-shift-2025.md +0 -732
- package/one/knowledge/altcoin-cycle-prediction-ontology.md +0 -884
- package/one/knowledge/altcoin-cycle-trading-strategy.md +0 -642
- package/one/knowledge/architecture-any-backend.md +0 -1589
- package/one/knowledge/architecture-diagram.md +0 -404
- package/one/knowledge/architecture-frontend.md +0 -1014
- package/one/knowledge/architecture.md +0 -1742
- package/one/knowledge/archived/ontology.old.md +0 -2840
- package/one/knowledge/astro-effect-complete-vision.md +0 -2148
- package/one/knowledge/astro-effect-simple-architecture.md +0 -750
- package/one/knowledge/audit-agent-onboard-alignment.md +0 -481
- package/one/knowledge/audit-agent-sales-alignment.md +0 -444
- package/one/knowledge/backend-api-reference.md +0 -728
- package/one/knowledge/cascading-context-specification.md +0 -1617
- package/one/knowledge/claude-code-integration.md +0 -1293
- package/one/knowledge/cli-claude-handoff.md +0 -736
- package/one/knowledge/context-engineering.md +0 -610
- package/one/knowledge/crypto-analysis-strategy.md +0 -1276
- package/one/knowledge/crypto-cycle-2024-2025-analysis.md +0 -44
- package/one/knowledge/crypto.md +0 -978
- package/one/knowledge/develop/design.md +0 -364
- package/one/knowledge/develop/index.md +0 -145
- package/one/knowledge/development-commands.md +0 -251
- package/one/knowledge/docs.md +0 -627
- package/one/knowledge/dsl.md +0 -1678
- package/one/knowledge/event-driven-documentation.md +0 -270
- package/one/knowledge/files.md +0 -2489
- package/one/knowledge/frontend.md +0 -1056
- package/one/knowledge/games-english.md +0 -691
- package/one/knowledge/games.md +0 -1082
- package/one/knowledge/generative-ui-patterns.md +0 -559
- package/one/knowledge/guidelines.md +0 -314
- package/one/knowledge/hono.md +0 -2127
- package/one/knowledge/implementation-examples.md +0 -2554
- package/one/knowledge/installation-folders.md +0 -366
- package/one/knowledge/institutional-cycle-paradigm-2025.md +0 -555
- package/one/knowledge/knowledge.md +0 -660
- package/one/knowledge/language.md +0 -998
- package/one/knowledge/lessons-learned.md +0 -378
- package/one/knowledge/lessons-website-building-focus.md +0 -382
- package/one/knowledge/merge-report.md +0 -254
- package/one/knowledge/metadata-system.md +0 -504
- package/one/knowledge/nine-padel-playbook.md +0 -229
- package/one/knowledge/one-protocol-ai-agents.md +0 -892
- package/one/knowledge/one-protocol-executive-report.md +0 -617
- package/one/knowledge/one-protocol-standard.md +0 -869
- package/one/knowledge/one-protocol-whitepaper.md +0 -756
- package/one/knowledge/ontology-blog.yaml +0 -47
- package/one/knowledge/ontology-cheatsheet.md +0 -617
- package/one/knowledge/ontology-community.yaml +0 -65
- package/one/knowledge/ontology-core-universal.md +0 -740
- package/one/knowledge/ontology-core.yaml +0 -63
- package/one/knowledge/ontology-courses.yaml +0 -76
- package/one/knowledge/ontology-creator.md +0 -402
- package/one/knowledge/ontology-crypto.md +0 -1603
- package/one/knowledge/ontology-developer-guide.md +0 -814
- package/one/knowledge/ontology-documentation.md +0 -377
- package/one/knowledge/ontology-ecommerce.md +0 -269
- package/one/knowledge/ontology-education-game.md +0 -1654
- package/one/knowledge/ontology-education.md +0 -938
- package/one/knowledge/ontology-engineering-specification.md +0 -1310
- package/one/knowledge/ontology-engineering.md +0 -1676
- package/one/knowledge/ontology-files.yaml +0 -525
- package/one/knowledge/ontology-frontend-master.md +0 -2898
- package/one/knowledge/ontology-frontend-specifications.md +0 -2196
- package/one/knowledge/ontology-frontend.md +0 -2475
- package/one/knowledge/ontology-index.md +0 -397
- package/one/knowledge/ontology-minimal.yaml +0 -301
- package/one/knowledge/ontology-portfolio.yaml +0 -45
- package/one/knowledge/ontology-quickstart.md +0 -602
- package/one/knowledge/ontology-release.md +0 -317
- package/one/knowledge/ontology-shop.yaml +0 -148
- package/one/knowledge/ontology-tokens.yaml +0 -51
- package/one/knowledge/ontology-tutorial.md +0 -455
- package/one/knowledge/ontology-v2.md +0 -4449
- package/one/knowledge/ontology-video-script.md +0 -939
- package/one/knowledge/ontology-visual-guide.md +0 -378
- package/one/knowledge/ontology.md +0 -3847
- package/one/knowledge/ontology.yaml +0 -1653
- package/one/knowledge/parallel-agents.md +0 -932
- package/one/knowledge/patterns/backend/convex-mutation-pattern.md +0 -130
- package/one/knowledge/patterns/backend/convex-query-pattern.md +0 -143
- package/one/knowledge/patterns/backend/mutation-template.md +0 -249
- package/one/knowledge/patterns/backend/query-template.md +0 -286
- package/one/knowledge/patterns/backend/service-template.md +0 -258
- package/one/knowledge/patterns/design/component-architecture.md +0 -435
- package/one/knowledge/patterns/design/index.md +0 -160
- package/one/knowledge/patterns/design/test-driven-design-pattern.md +0 -196
- package/one/knowledge/patterns/design/wireframe-template.md +0 -250
- package/one/knowledge/patterns/frontend/component-template.md +0 -246
- package/one/knowledge/patterns/frontend/form-template.md +0 -348
- package/one/knowledge/patterns/frontend/page-template.md +0 -209
- package/one/knowledge/patterns/frontend/react-component-pattern.md +0 -188
- package/one/knowledge/patterns/test/acceptance-criteria-template.md +0 -396
- package/one/knowledge/patterns/test/technical-test-template.md +0 -566
- package/one/knowledge/patterns/test/test-driven-pattern.md +0 -160
- package/one/knowledge/patterns/test/user-flow-template.md +0 -272
- package/one/knowledge/performance.md +0 -459
- package/one/knowledge/provider-agnostic-content.md +0 -995
- package/one/knowledge/provider-creation-guide.md +0 -1082
- package/one/knowledge/quality-loop.md +0 -419
- package/one/knowledge/quick-start-ontology-mapping.md +0 -773
- package/one/knowledge/readme-architecture.md +0 -158
- package/one/knowledge/readme.md +0 -149
- package/one/knowledge/rules.md +0 -644
- package/one/knowledge/score.md +0 -85
- package/one/knowledge/specifications.md +0 -873
- package/one/knowledge/tags.md +0 -148
- package/one/knowledge/todo-template.md +0 -269
- package/one/knowledge/todo.md +0 -269
- package/one/knowledge/troubleshooting.md +0 -434
- package/one/knowledge/typescript-patterns.md +0 -321
- package/one/knowledge/universal-generation-language.md +0 -827
- package/one/knowledge/x402-research.md +0 -104
- package/one/license.md +0 -107
- package/one/people/anthony-o-connell.md +0 -469
- package/one/people/people.md +0 -590
- package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
- package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
- package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
- package/one/things/CHECKLIST.md +0 -407
- package/one/things/IMPLEMENTATION_STATUS.md +0 -379
- package/one/things/ONE.md +0 -529
- package/one/things/agents/agent-backend.md +0 -1501
- package/one/things/agents/agent-builder.md +0 -1064
- package/one/things/agents/agent-clean.md +0 -1112
- package/one/things/agents/agent-clone.md +0 -1324
- package/one/things/agents/agent-deploy.md +0 -986
- package/one/things/agents/agent-designer.md +0 -2305
- package/one/things/agents/agent-director.md +0 -1526
- package/one/things/agents/agent-documenter.md +0 -1129
- package/one/things/agents/agent-frontend.md +0 -1201
- package/one/things/agents/agent-integrator.md +0 -1269
- package/one/things/agents/agent-lawyer.md +0 -1371
- package/one/things/agents/agent-problem-solver.md +0 -1457
- package/one/things/agents/agent-quality.md +0 -1483
- package/one/things/agents/agent-sales.md +0 -1074
- package/one/things/cascade/cascade.yaml +0 -481
- package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
- package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
- package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
- package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
- package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
- package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
- package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
- package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
- package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
- package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
- package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
- package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
- package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
- package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
- package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
- package/one/things/cascade/docs/examples/readme.md +0 -259
- package/one/things/cascade/docs/getting-started.md +0 -533
- package/one/things/cascade/docs/workflow.md +0 -1378
- package/one/things/cascade/readme.md +0 -379
- package/one/things/cascade/templates/feature-template.md +0 -289
- package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
- package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
- package/one/things/claude/agents/analyst.md +0 -508
- package/one/things/claude/agents/architect.md +0 -505
- package/one/things/claude/agents/brand-identity-specialist.md +0 -538
- package/one/things/claude/agents/bstp-token-strategist.md +0 -690
- package/one/things/claude/agents/builder-repo.md +0 -532
- package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
- package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
- package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
- package/one/things/claude/agents/company-bullstamp-character.md +0 -602
- package/one/things/claude/agents/company-bullstamp-community.md +0 -307
- package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
- package/one/things/claude/agents/company-bullstamp-token.md +0 -307
- package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
- package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
- package/one/things/claude/agents/content-calendar-planner.md +0 -473
- package/one/things/claude/agents/content-chapter-formatter.md +0 -513
- package/one/things/claude/agents/content-formatter.md +0 -571
- package/one/things/claude/agents/content-hook-specialist.md +0 -485
- package/one/things/claude/agents/content-image-formatter.md +0 -560
- package/one/things/claude/agents/content-introduction-formatter.md +0 -510
- package/one/things/claude/agents/content-multiplication-engine.md +0 -579
- package/one/things/claude/agents/content-playbook-writer.md +0 -473
- package/one/things/claude/agents/content-team-manager.md +0 -647
- package/one/things/claude/agents/content-toc-formatter.md +0 -547
- package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
- package/one/things/claude/agents/core-manager.md +0 -607
- package/one/things/claude/agents/core-master.md +0 -426
- package/one/things/claude/agents/cross-functional-manager.md +0 -476
- package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
- package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
- package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
- package/one/things/claude/agents/crypto-community-analyst.md +0 -314
- package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
- package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
- package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
- package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
- package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
- package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
- package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
- package/one/things/claude/agents/crypto-market-researcher.md +0 -307
- package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
- package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
- package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
- package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
- package/one/things/claude/agents/crypto-team-manager.md +0 -392
- package/one/things/claude/agents/crypto-token-analyst.md +0 -319
- package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
- package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
- package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
- package/one/things/claude/agents/customer-journey-designer.md +0 -474
- package/one/things/claude/agents/customer-success-manager.md +0 -574
- package/one/things/claude/agents/dev.md +0 -406
- package/one/things/claude/agents/documenter.md +0 -548
- package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
- package/one/things/claude/agents/engagement-specialist.md +0 -502
- package/one/things/claude/agents/engineering-architect.md +0 -387
- package/one/things/claude/agents/engineering-business-analyst.md +0 -527
- package/one/things/claude/agents/engineering-developer.md +0 -386
- package/one/things/claude/agents/engineering-director.md +0 -322
- package/one/things/claude/agents/engineering-ingestor.md +0 -659
- package/one/things/claude/agents/engineering-product-manager.md +0 -525
- package/one/things/claude/agents/engineering-product-owner.md +0 -527
- package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
- package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
- package/one/things/claude/agents/engineering-team-manager.md +0 -515
- package/one/things/claude/agents/engineering-user-experience.md +0 -386
- package/one/things/claude/agents/framework-elevate-manager.md +0 -309
- package/one/things/claude/agents/improver.md +0 -805
- package/one/things/claude/agents/intelligence-team-manager.md +0 -390
- package/one/things/claude/agents/lead-capture-expert.md +0 -459
- package/one/things/claude/agents/lead-magnet-creator.md +0 -446
- package/one/things/claude/agents/market-research-analyst.md +0 -435
- package/one/things/claude/agents/marketing-brand-identity.md +0 -344
- package/one/things/claude/agents/marketing-content-hooks.md +0 -455
- package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
- package/one/things/claude/agents/marketing-content-poster.md +0 -372
- package/one/things/claude/agents/marketing-customer-journey.md +0 -331
- package/one/things/claude/agents/marketing-director.md +0 -402
- package/one/things/claude/agents/marketing-engagement.md +0 -331
- package/one/things/claude/agents/marketing-lead-capture.md +0 -331
- package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
- package/one/things/claude/agents/marketing-network-effects.md +0 -331
- package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
- package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
- package/one/things/claude/agents/marketing-team-manager.md +0 -451
- package/one/things/claude/agents/marketing-viral-growth.md +0 -232
- package/one/things/claude/agents/mission-commander.md +0 -378
- package/one/things/claude/agents/network-effect-analyst.md +0 -604
- package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
- package/one/things/claude/agents/npx.md +0 -946
- package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
- package/one/things/claude/agents/one-master.md +0 -378
- package/one/things/claude/agents/one-orchestrator.md +0 -345
- package/one/things/claude/agents/one.md +0 -658
- package/one/things/claude/agents/playbook-generator.md +0 -526
- package/one/things/claude/agents/pm.md +0 -349
- package/one/things/claude/agents/po.md +0 -370
- package/one/things/claude/agents/qa.md +0 -361
- package/one/things/claude/agents/research-foundation-analyst.md +0 -324
- package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
- package/one/things/claude/agents/research-market-analyst.md +0 -324
- package/one/things/claude/agents/research-team-manager.md +0 -489
- package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
- package/one/things/claude/agents/sales-team-manager.md +0 -407
- package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
- package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
- package/one/things/claude/agents/service-advocacy-manager.md +0 -324
- package/one/things/claude/agents/service-success-manager.md +0 -324
- package/one/things/claude/agents/service-team-manager.md +0 -405
- package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
- package/one/things/claude/agents/share-optimization-specialist.md +0 -576
- package/one/things/claude/agents/sm.md +0 -352
- package/one/things/claude/agents/story-teller.md +0 -498
- package/one/things/claude/agents/task-master.md +0 -621
- package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
- package/one/things/claude/agents/tester.md +0 -595
- package/one/things/claude/agents/the-bull-character-manager.md +0 -603
- package/one/things/claude/agents/tools-playbook-generator.md +0 -492
- package/one/things/claude/agents/turbo-repo-builder.md +0 -346
- package/one/things/claude/agents/upsell-strategist.md +0 -503
- package/one/things/claude/agents/ux-expert.md +0 -360
- package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
- package/one/things/claude/claude-code-hooks-development.json +0 -21
- package/one/things/claude/claude-code-hooks-production.json +0 -21
- package/one/things/claude/claude-code-hooks.json +0 -25
- package/one/things/claude/commands/agent.md +0 -124
- package/one/things/claude/commands/cascade-status.md +0 -153
- package/one/things/claude/commands/ingest.md +0 -343
- package/one/things/claude/commands/ingestor.md +0 -158
- package/one/things/claude/commands/mission.md +0 -103
- package/one/things/claude/commands/npx.md +0 -156
- package/one/things/claude/commands/one.md +0 -486
- package/one/things/claude/commands/quality-check.md +0 -252
- package/one/things/claude/commands/smart-route.md +0 -261
- package/one/things/claude/commands/start.md +0 -139
- package/one/things/claude/commands/story.md +0 -103
- package/one/things/claude/commands/task.md +0 -193
- package/one/things/claude/hook-bypass.json +0 -32
- package/one/things/claude/hooks/agent-hook-config.json +0 -427
- package/one/things/claude/hooks/build-hook.sh +0 -156
- package/one/things/claude/hooks/cleanup-hook.sh +0 -201
- package/one/things/claude/hooks/file-organization-hook.sh +0 -80
- package/one/things/claude/hooks/format-hook.sh +0 -43
- package/one/things/claude/hooks/hook-bypass.sh +0 -293
- package/one/things/claude/hooks/hook-debouncer.sh +0 -62
- package/one/things/claude/hooks/hook-logger.sh +0 -89
- package/one/things/claude/hooks/lint-hook.sh +0 -140
- package/one/things/claude/hooks/notification-hook.sh +0 -204
- package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
- package/one/things/claude/hooks/performance-metrics.json +0 -25
- package/one/things/claude/hooks/security-hook.sh +0 -256
- package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
- package/one/things/claude/hooks/story-validation-hook.sh +0 -145
- package/one/things/claude/hooks/test-hook.sh +0 -145
- package/one/things/claude/hooks/test-story-validation.sh +0 -170
- package/one/things/claude/settings-local.json +0 -86
- package/one/things/cli/cli-code.md +0 -677
- package/one/things/cli/cli-compiler-code.md +0 -677
- package/one/things/cli/cli.md +0 -871
- package/one/things/components/card-shadcn.md +0 -953
- package/one/things/components/card.md +0 -1041
- package/one/things/components.md +0 -1743
- package/one/things/componets.md +0 -19
- package/one/things/contracts/Move.toml +0 -12
- package/one/things/contracts/README.md +0 -288
- package/one/things/contracts/one.move +0 -762
- package/one/things/contracts/sdk.ts +0 -578
- package/one/things/creator-diagram.md +0 -184
- package/one/things/crypto/FEATURES.md +0 -78
- package/one/things/crypto/ONECORE.md +0 -62
- package/one/things/crypto/ONECOREFAQ.md +0 -22
- package/one/things/crypto/ONECOREHOW.md +0 -46
- package/one/things/crypto/ONEENTERPRISE.md +0 -64
- package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
- package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
- package/one/things/crypto/ONEPRO.md +0 -60
- package/one/things/crypto/ONEPROFAQ.md +0 -22
- package/one/things/crypto/ONEPROHOW.md +0 -53
- package/one/things/crypto/READMEAGENCY.md +0 -64
- package/one/things/crypto/VSL.md +0 -45
- package/one/things/crypto/WebsiteCopy.md +0 -176
- package/one/things/demo-accessibility-animations.md +0 -1025
- package/one/things/demo-components.md +0 -1310
- package/one/things/demo-design-summary.md +0 -692
- package/one/things/demo-design-system.md +0 -973
- package/one/things/demo-page-layouts.md +0 -1016
- package/one/things/design-system.md +0 -832
- package/one/things/designs/accessibility-audit.md +0 -877
- package/one/things/designs/component-specifications.md +0 -855
- package/one/things/designs/design-overview.md +0 -377
- package/one/things/designs/design-tokens.md +0 -448
- package/one/things/designs/wireframes-dashboard.md +0 -710
- package/one/things/docs/api-requests.md +0 -987
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
- package/one/things/docs/ecommerce/QUICK-START.md +0 -405
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
- package/one/things/docs/ecommerce/demo.astro +0 -309
- package/one/things/examples/children/lemonade-stand.md +0 -404
- package/one/things/examples/enterprise/crm-saas.md +0 -1444
- package/one/things/features/1-1-agent-prompts.md +0 -562
- package/one/things/features/1-2-yaml-orchestrator.md +0 -548
- package/one/things/features/1-3-event-coordination.md +0 -547
- package/one/things/features/1-4-knowledge-management.md +0 -652
- package/one/things/features/1-5-quality-loops.md +0 -725
- package/one/things/features/1-6-numbering-structure.md +0 -639
- package/one/things/features/2-1-dataprovider-interface.md +0 -2583
- package/one/things/features/2-2-config-system.md +0 -3242
- package/one/things/features/2-3-effectts-services.md +0 -1645
- package/one/things/features/2-4-react-hooks.md +0 -2136
- package/one/things/features/2-5-auth-migration.md +0 -2144
- package/one/things/features/2-6-dashboard-migration.md +0 -2084
- package/one/things/features/2-7-alternative-providers.md +0 -2578
- package/one/things/features/2-7-implementation-report.md +0 -724
- package/one/things/features/2-cli.md +0 -1720
- package/one/things/features/2-design.md +0 -1770
- package/one/things/features/2-tests.md +0 -576
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
- package/one/things/features/DECOUPLING.md +0 -290
- package/one/things/features/DEPLOYMENT.md +0 -470
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
- package/one/things/features/improve.md +0 -861
- package/one/things/features/remove-convex-deps.md +0 -63
- package/one/things/features/top-features.md +0 -87
- package/one/things/features/use-one-backend.md +0 -1217
- package/one/things/features-in-english.md +0 -200
- package/one/things/files.yaml +0 -721
- package/one/things/ideas/1-create-workflow.md +0 -207
- package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
- package/one/things/implementation/backend-guide.md +0 -457
- package/one/things/interface.md +0 -257
- package/one/things/landing-page-implementation.md +0 -455
- package/one/things/legal/README.md +0 -234
- package/one/things/legal/privacy-policy.md +0 -1227
- package/one/things/legal/terms-of-service.md +0 -1432
- package/one/things/master-workflow-plan.md +0 -806
- package/one/things/pay.one.ie.md +0 -53
- package/one/things/plans/0-in-sync.md +0 -136
- package/one/things/plans/0-timeline.md +0 -36
- package/one/things/plans/1-create-workflow.md +0 -732
- package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
- package/one/things/plans/README-SIMPLIFICATION.md +0 -349
- package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
- package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
- package/one/things/plans/ai-elements-integration.md +0 -483
- package/one/things/plans/ai-elements.md +0 -1278
- package/one/things/plans/ai-integration-plan.md +0 -263
- package/one/things/plans/ai-integration.md +0 -996
- package/one/things/plans/ai-sdk.md +0 -798
- package/one/things/plans/ai-tools.md +0 -621
- package/one/things/plans/app.md +0 -832
- package/one/things/plans/architecture-summary.md +0 -312
- package/one/things/plans/async-ai-agents.md +0 -233
- package/one/things/plans/backend-agnostic-frontend.md +0 -390
- package/one/things/plans/backend-cleanup-quickstart.md +0 -380
- package/one/things/plans/backend-ontology-conformance.md +0 -475
- package/one/things/plans/backend-status.md +0 -599
- package/one/things/plans/backend-structure.md +0 -847
- package/one/things/plans/backend-target-structure.md +0 -482
- package/one/things/plans/backend.md +0 -1175
- package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
- package/one/things/plans/better-auth-any-backend.md +0 -1896
- package/one/things/plans/better-auth-available-features.md +0 -273
- package/one/things/plans/big-plan.md +0 -52
- package/one/things/plans/cli-updates-required.md +0 -320
- package/one/things/plans/complete-step-by-step.md +0 -1409
- package/one/things/plans/components.md +0 -709
- package/one/things/plans/convex-agents.md +0 -1034
- package/one/things/plans/convex-better-auth.md +0 -1141
- package/one/things/plans/convex-on-off.md +0 -407
- package/one/things/plans/crypto-token-researcher.md +0 -629
- package/one/things/plans/data-quality-metrics.md +0 -745
- package/one/things/plans/deep-researcher-agent.md +0 -466
- package/one/things/plans/deploy-to-cloudflare.md +0 -623
- package/one/things/plans/deployment-architecture.md +0 -469
- package/one/things/plans/desktop.md +0 -1139
- package/one/things/plans/development-plan.md +0 -1283
- package/one/things/plans/development-workflow-tldr.md +0 -207
- package/one/things/plans/development-workflow.md +0 -959
- package/one/things/plans/dsl-claude-code.md +0 -1011
- package/one/things/plans/effect-components.md +0 -1743
- package/one/things/plans/effect-patterns-reference.md +0 -2235
- package/one/things/plans/effect.md +0 -1806
- package/one/things/plans/email.md +0 -966
- package/one/things/plans/enhance-auth.md +0 -1692
- package/one/things/plans/execution-strategy.md +0 -1291
- package/one/things/plans/existing-infrastructure.md +0 -712
- package/one/things/plans/feature-based-sites.md +0 -894
- package/one/things/plans/frontend-effects.md +0 -1276
- package/one/things/plans/group-folder-multi-tenancy.md +0 -893
- package/one/things/plans/improve-codebase.md +0 -1811
- package/one/things/plans/install-components.md +0 -215
- package/one/things/plans/integrate-frontend-and-backend.md +0 -603
- package/one/things/plans/landing.md +0 -820
- package/one/things/plans/layout.md +0 -249
- package/one/things/plans/mail-backend.md +0 -1361
- package/one/things/plans/mail.md +0 -2677
- package/one/things/plans/mcp-clear-context-prompt.md +0 -81
- package/one/things/plans/mcp-simple.md +0 -248
- package/one/things/plans/multi-ontology-architecture.md +0 -885
- package/one/things/plans/next-features.md +0 -114
- package/one/things/plans/npx-agent-safety.md +0 -785
- package/one/things/plans/npx-agent.md +0 -1089
- package/one/things/plans/onboarding.md +0 -51
- package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
- package/one/things/plans/one.md +0 -677
- package/one/things/plans/ontology-6-dimensions.md +0 -2201
- package/one/things/plans/ontology-compliance-audit.md +0 -342
- package/one/things/plans/ontology-driven-strategy.md +0 -882
- package/one/things/plans/ontology-refine.md +0 -586
- package/one/things/plans/ontology-ui-approach.md +0 -375
- package/one/things/plans/open-agent.md +0 -840
- package/one/things/plans/performace.md +0 -122
- package/one/things/plans/phase-1-foundation.md +0 -620
- package/one/things/plans/phase-3-implementation.md +0 -1037
- package/one/things/plans/plan-connect-to-api.md +0 -146
- package/one/things/plans/quick-wins.md +0 -1428
- package/one/things/plans/r2.md +0 -777
- package/one/things/plans/readme-backend-cleanup.md +0 -402
- package/one/things/plans/release.md +0 -507
- package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
- package/one/things/plans/repos.md +0 -98
- package/one/things/plans/separate-copy-2.md +0 -1349
- package/one/things/plans/separate-copy-3.md +0 -2479
- package/one/things/plans/separate-copy.md +0 -1349
- package/one/things/plans/separate-demo.md +0 -864
- package/one/things/plans/separate.md +0 -1999
- package/one/things/plans/sequence.md +0 -2040
- package/one/things/plans/shadcn-integration-summary.md +0 -510
- package/one/things/plans/sidebar.md +0 -206
- package/one/things/plans/skills.md +0 -709
- package/one/things/plans/small-fixes.md +0 -23
- package/one/things/plans/start-new.md +0 -764
- package/one/things/plans/switch-off-auth.md +0 -42
- package/one/things/plans/sync-checklist.md +0 -351
- package/one/things/plans/test-backend-connection.md +0 -514
- package/one/things/plans/unified-implementation-plan.md +0 -934
- package/one/things/plans/update-demos.md +0 -581
- package/one/things/plans/use-our-backend.md +0 -572
- package/one/things/plans/video-backend.md +0 -638
- package/one/things/plans/video-frontend.md +0 -490
- package/one/things/plans/video-old-archived.md +0 -656
- package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
- package/one/things/plans/wave1-onboarding-vision.md +0 -744
- package/one/things/plans/wave1-orchestration-summary.md +0 -604
- package/one/things/plans/wave1-specialist-assignments.md +0 -1413
- package/one/things/plans/workflow-files.md +0 -1210
- package/one/things/plans/workflow.md +0 -1378
- package/one/things/plans-u.md +0 -905
- package/one/things/products/Blockchain Products.md +0 -6278
- package/one/things/products/cascade-landing-page.md +0 -841
- package/one/things/products/cascade.md +0 -1568
- package/one/things/products/context-engineering.md +0 -1488
- package/one/things/products/onthology.md +0 -15
- package/one/things/products/ontology-ui-shadcn.md +0 -1302
- package/one/things/products/ontology-ui.md +0 -1429
- package/one/things/products/ontology.md +0 -789
- package/one/things/products/sdk.md +0 -573
- package/one/things/promptkit.md +0 -930
- package/one/things/repos/all-repos.md +0 -0
- package/one/things/scripts-clean-mac.sh +0 -409
- package/one/things/service-providers-new.md +0 -1052
- package/one/things/service-providers.md +0 -1121
- package/one/things/structure.md +0 -532
- package/one/things/system.md +0 -618
- package/one/things/templates.md +0 -294
- package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
- package/one/things/tests/2-1-test-analysis.md +0 -544
- package/one/things/things.md +0 -384
- package/one/things/todo-acp-integration.md +0 -744
- package/one/things/todo-ai.md +0 -933
- package/one/things/todo-api.md +0 -1078
- package/one/things/todo-assignment.md +0 -580
- package/one/things/todo-buy-chatgpt.md +0 -1450
- package/one/things/todo-components.md +0 -1683
- package/one/things/todo-connections.md +0 -278
- package/one/things/todo-ecommerce-frontend.md +0 -1313
- package/one/things/todo-ecommerce.md +0 -569
- package/one/things/todo-effects.md +0 -1075
- package/one/things/todo-frontend-effects.md +0 -977
- package/one/things/todo-landing-page.md +0 -1091
- package/one/things/todo-mail.md +0 -1160
- package/one/things/todo-master-plan.md +0 -490
- package/one/things/todo-onboard.md +0 -666
- package/one/things/todo-one-ie.md +0 -538
- package/one/things/todo-page.md +0 -606
- package/one/things/todo-plans.md +0 -282
- package/one/things/todo-projects.md +0 -241
- package/one/things/todo-refactoring-plan.md +0 -366
- package/one/things/todo-release.md +0 -654
- package/one/things/todo-sequence.md +0 -1621
- package/one/things/todo-use-our-backend.md +0 -1908
- package/one/things/todo-workflow.md +0 -626
- package/one/things/todo-x402.md +0 -2047
- package/one/things/todo.md +0 -21
- package/one/things/video/scripts-crypto.md +0 -835
- package/one/things/video-script-backup.md +0 -318
- package/one/things/video-script-demo.md +0 -382
- package/one/things/video-script-ontology.md +0 -333
- package/one/things/video-script.md +0 -361
|
@@ -1,1806 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Effect
|
|
3
|
-
dimension: things
|
|
4
|
-
category: plans
|
|
5
|
-
tags: architecture, backend, frontend, cycle, ontology, testing
|
|
6
|
-
related_dimensions: connections, events, people
|
|
7
|
-
scope: global
|
|
8
|
-
created: 2025-11-03
|
|
9
|
-
updated: 2025-11-03
|
|
10
|
-
version: 1.0.0
|
|
11
|
-
ai_context: |
|
|
12
|
-
This document is part of the things dimension in the plans category.
|
|
13
|
-
Location: one/things/plans/effect.md
|
|
14
|
-
Purpose: Documents effect.ts integration plan: backend-agnostic architecture
|
|
15
|
-
Related dimensions: connections, events, people
|
|
16
|
-
For AI agents: Read this to understand effect.
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Effect.ts Integration Plan: Backend-Agnostic Architecture
|
|
20
|
-
|
|
21
|
-
**Status:** ✅ Phase 1-2 Complete (DataProvider + Services) | 🚧 Phases 3-7 In Progress
|
|
22
|
-
**Version:** 2.0.0 - Backend-Agnostic Edition
|
|
23
|
-
**Last Updated:** 2025-10-24
|
|
24
|
-
|
|
25
|
-
## Executive Summary
|
|
26
|
-
|
|
27
|
-
**Effect.ts powers the backend-agnostic architecture of ONE Platform** by providing type-safe, composable services that work with ANY backend (Convex, WordPress, Supabase, Notion, etc.). This document describes how Effect.ts integrates with the DataProvider pattern to enable:
|
|
28
|
-
|
|
29
|
-
1. **Backend Independence**: Frontend works with any backend that implements the 6-dimension ontology
|
|
30
|
-
2. **Type Safety**: Complete type cycle from database to UI with zero runtime overhead
|
|
31
|
-
3. **Composability**: Services compose via Layer.mergeAll for dependency injection
|
|
32
|
-
4. **Error Handling**: Tagged errors replace try/catch throughout the stack
|
|
33
|
-
5. **Testing**: Mock providers enable isolated service testing
|
|
34
|
-
|
|
35
|
-
**Key Principle:** Build the architecture right. Build features once. Never refactor for flexibility.
|
|
36
|
-
|
|
37
|
-
Based on production patterns from 14.ai (AI customer support) and the unified implementation plan (11 weeks to complete platform).
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Architecture Overview: The Three Layers
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
45
|
-
│ FRONTEND (Astro + React) │
|
|
46
|
-
│ - Backend-agnostic UI and pages │
|
|
47
|
-
│ - Uses services, never calls backend directly │
|
|
48
|
-
│ - Works with ANY backend via DataProvider │
|
|
49
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
50
|
-
↓
|
|
51
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
52
|
-
│ EFFECT.TS SERVICES (Backend-Agnostic) │
|
|
53
|
-
│ - ThingService (all 66 types) │
|
|
54
|
-
│ - ConnectionService (all 25 types) │
|
|
55
|
-
│ - EventService (all 67 events) │
|
|
56
|
-
│ - KnowledgeService (RAG + vectors) │
|
|
57
|
-
│ - GroupService, PeopleService │
|
|
58
|
-
│ │
|
|
59
|
-
│ ✅ Type-safe with tagged errors │
|
|
60
|
-
│ ✅ Composable via Layer.mergeAll │
|
|
61
|
-
│ ✅ Testable with mock providers │
|
|
62
|
-
│ ✅ Backend-agnostic via DataProvider │
|
|
63
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
64
|
-
↓
|
|
65
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
66
|
-
│ DATAPROVIDER INTERFACE (Universal Backend API) │
|
|
67
|
-
│ groups: { get, list, update } │
|
|
68
|
-
│ people: { get, list, create, update } │
|
|
69
|
-
│ things: { get, list, create, update, delete } │
|
|
70
|
-
│ connections: { create, getRelated, getCount } │
|
|
71
|
-
│ events: { log, query } │
|
|
72
|
-
│ knowledge: { embed, search } │
|
|
73
|
-
│ │
|
|
74
|
-
│ ✅ Implementation-agnostic interface │
|
|
75
|
-
│ ✅ 6-dimension ontology as contract │
|
|
76
|
-
│ ✅ Swap backends by changing ONE line │
|
|
77
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
78
|
-
↓
|
|
79
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
80
|
-
│ BACKEND PROVIDERS (Choose One - ONE Line Config!) │
|
|
81
|
-
│ │
|
|
82
|
-
│ ConvexProvider ✅ Complete │
|
|
83
|
-
│ WordPressProvider 🚧 Planned (Phase 7) │
|
|
84
|
-
│ SupabaseProvider 🚧 Planned (Phase 7) │
|
|
85
|
-
│ NotionProvider 🚧 Planned (Future) │
|
|
86
|
-
│ CustomProvider 🚧 Roll your own │
|
|
87
|
-
│ │
|
|
88
|
-
│ All implement the same DataProvider interface │
|
|
89
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Key Architectural Decisions
|
|
93
|
-
|
|
94
|
-
**1. Backend-Agnostic by Default**
|
|
95
|
-
|
|
96
|
-
- Services use `DataProvider`, not direct backend calls
|
|
97
|
-
- Frontend can work with Convex, WordPress, Supabase, etc.
|
|
98
|
-
- Change backend = edit ONE line in `astro.config.ts`
|
|
99
|
-
|
|
100
|
-
**2. 6-Dimension Ontology as Source of Truth**
|
|
101
|
-
|
|
102
|
-
- Every feature maps to: groups, people, things, connections, events, knowledge
|
|
103
|
-
- DataProvider interface enforces this structure
|
|
104
|
-
- Backends implement the ontology their own way (see `one/knowledge/ontology.md`)
|
|
105
|
-
|
|
106
|
-
**3. Effect.ts for Services, Not Everywhere**
|
|
107
|
-
|
|
108
|
-
- Backend: Effect.ts services with typed errors
|
|
109
|
-
- Frontend: Standard React hooks (useEffectRunner for complex flows)
|
|
110
|
-
- Keep it simple: Effect where it adds value, standard TypeScript elsewhere
|
|
111
|
-
|
|
112
|
-
**4. Separation Enables Installation**
|
|
113
|
-
|
|
114
|
-
- When users run `npx oneie`, they get frontend only
|
|
115
|
-
- Backend is OFF by default (users can connect their own)
|
|
116
|
-
- Organizations can use existing infrastructure (WordPress, Notion, etc.)
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Current Status (from unified-implementation-plan.md)
|
|
121
|
-
|
|
122
|
-
### ✅ COMPLETED (Phases 1-2: 4 weeks)
|
|
123
|
-
|
|
124
|
-
**Phase 1: DataProvider Foundation** ✅
|
|
125
|
-
|
|
126
|
-
- DataProvider interface complete: `/web/src/providers/DataProvider.ts`
|
|
127
|
-
- ConvexProvider implementation complete
|
|
128
|
-
- Typed errors (ThingNotFoundError, etc.)
|
|
129
|
-
- Backend swapping works (change ONE line)
|
|
130
|
-
|
|
131
|
-
**Phase 2: Effect.ts Service Layer** ✅
|
|
132
|
-
|
|
133
|
-
- All 6 dimension services complete:
|
|
134
|
-
- `/web/src/services/ThingService.ts` (66 types)
|
|
135
|
-
- `/web/src/services/ConnectionService.ts` (25 types)
|
|
136
|
-
- `/web/src/services/EventService.ts` (67 events)
|
|
137
|
-
- `/web/src/services/KnowledgeService.ts` (RAG)
|
|
138
|
-
- `/web/src/services/GroupService.ts`
|
|
139
|
-
- `/web/src/services/PeopleService.ts`
|
|
140
|
-
- React hooks: `useEffectRunner` in `/web/src/hooks/`
|
|
141
|
-
- Dependency injection via Layer.mergeAll
|
|
142
|
-
- Tagged errors throughout (no try/catch)
|
|
143
|
-
|
|
144
|
-
### 🚧 REMAINING (Phases 3-7: 7 weeks)
|
|
145
|
-
|
|
146
|
-
**Phase 3: Backend Implementation** (NOT STARTED)
|
|
147
|
-
|
|
148
|
-
- Implement CRUD mutations for all 66 thing types
|
|
149
|
-
- Add event logging to all mutations
|
|
150
|
-
- Enforce group scoping
|
|
151
|
-
- Add rate limiting
|
|
152
|
-
|
|
153
|
-
**Phase 4: Frontend Integration** (NOT STARTED)
|
|
154
|
-
|
|
155
|
-
- Multi-tenant dashboard
|
|
156
|
-
- Entity management UI (all 66 types)
|
|
157
|
-
- Connection visualization
|
|
158
|
-
- Real-time event timeline
|
|
159
|
-
|
|
160
|
-
**Phase 5: RAG & Knowledge** (NOT STARTED)
|
|
161
|
-
|
|
162
|
-
- Chunking service (800 tokens, 200 overlap)
|
|
163
|
-
- Embedding service (OpenAI integration)
|
|
164
|
-
- RAG ingestion pipeline
|
|
165
|
-
- Vector search
|
|
166
|
-
|
|
167
|
-
**Phase 6: Testing** (PARTIAL - auth tests exist)
|
|
168
|
-
|
|
169
|
-
- Backend service coverage (90%)
|
|
170
|
-
- Frontend coverage (70%)
|
|
171
|
-
- Multi-backend tests
|
|
172
|
-
- CI/CD pipeline
|
|
173
|
-
|
|
174
|
-
**Phase 7: Multi-Backend** (OPTIONAL)
|
|
175
|
-
|
|
176
|
-
- WordPressProvider
|
|
177
|
-
- SupabaseProvider
|
|
178
|
-
- CompositeProvider (multi-backend routing)
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Integration approaches
|
|
183
|
-
|
|
184
|
-
### Understanding confect's role (Optional - For Convex Backend Only)
|
|
185
|
-
|
|
186
|
-
Confect isn't just a thin wrapper—it's a comprehensive framework that **deeply integrates Effect.ts with Convex**. Created by RJ Dellecese, confect replaces Convex's native validator system with Effect's schema library and transforms all Convex APIs to return `Effect` types instead of `Promise`. Where Convex returns `A | null`, confect returns `Option<A>`, and errors become explicit in the Effect type signature. This provides end-to-end type safety from database operations through business logic to HTTP APIs with automatic OpenAPI documentation.
|
|
187
|
-
|
|
188
|
-
### Project structure with backend-agnostic Effect.ts
|
|
189
|
-
|
|
190
|
-
ONE Platform uses a clean separation between frontend (Effect.ts services) and backend (any provider):
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
ONE/
|
|
194
|
-
├── web/ # Frontend (Backend-Agnostic)
|
|
195
|
-
│ ├── src/
|
|
196
|
-
│ │ ├── pages/ # Astro pages (SSR)
|
|
197
|
-
│ │ ├── components/ # React components + shadcn/ui
|
|
198
|
-
│ │ ├── services/ # ✅ Effect.ts services (backend-agnostic)
|
|
199
|
-
│ │ │ ├── ThingService.ts
|
|
200
|
-
│ │ │ ├── ConnectionService.ts
|
|
201
|
-
│ │ │ ├── EventService.ts
|
|
202
|
-
│ │ │ ├── KnowledgeService.ts
|
|
203
|
-
│ │ │ ├── GroupService.ts
|
|
204
|
-
│ │ │ └── PeopleService.ts
|
|
205
|
-
│ │ ├── providers/ # ✅ DataProvider interface & implementations
|
|
206
|
-
│ │ │ ├── DataProvider.ts # Universal interface
|
|
207
|
-
│ │ │ ├── convex/
|
|
208
|
-
│ │ │ │ └── ConvexProvider.ts # Convex implementation
|
|
209
|
-
│ │ │ ├── wordpress/
|
|
210
|
-
│ │ │ │ └── WordPressProvider.ts # WordPress implementation (planned)
|
|
211
|
-
│ │ │ └── supabase/
|
|
212
|
-
│ │ │ └── SupabaseProvider.ts # Supabase implementation (planned)
|
|
213
|
-
│ │ ├── hooks/ # React hooks
|
|
214
|
-
│ │ │ ├── useEffectRunner.ts # Run Effect programs in React
|
|
215
|
-
│ │ │ └── useProvider.ts # Access current DataProvider
|
|
216
|
-
│ │ └── lib/
|
|
217
|
-
│ │ └── errors.ts # Tagged error types
|
|
218
|
-
│ └── astro.config.ts # ✅ Configure provider here (ONE LINE!)
|
|
219
|
-
│
|
|
220
|
-
├── backend/ # Backend (Convex - OPTIONAL)
|
|
221
|
-
│ └── convex/
|
|
222
|
-
│ ├── schema.ts # 6-dimension ontology (groups, entities, connections, events, knowledge)
|
|
223
|
-
│ ├── auth.ts # Better Auth configuration
|
|
224
|
-
│ ├── queries/ # Read operations
|
|
225
|
-
│ ├── mutations/ # Write operations
|
|
226
|
-
│ └── _generated/ # Auto-generated types
|
|
227
|
-
│
|
|
228
|
-
├── one/ # Platform documentation (41 files)
|
|
229
|
-
│ ├── knowledge/
|
|
230
|
-
│ │ ├── ontology.md # ✅ 6-dimension data model (source of truth)
|
|
231
|
-
│ │ └── todo.md # 100-cycle execution template
|
|
232
|
-
│ └── things/plans/
|
|
233
|
-
│ ├── effect.md # This file
|
|
234
|
-
│ ├── separate.md # Backend separation plan
|
|
235
|
-
│ └── unified-implementation-plan.md # Complete 11-week plan
|
|
236
|
-
│
|
|
237
|
-
└── apps/ # Distribution targets
|
|
238
|
-
├── oneie/ # Main site (one.ie) - backend ON
|
|
239
|
-
└── one/ # Demo site (demo.one.ie) - backend OFF
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**Key Differences from Standard Convex:**
|
|
243
|
-
|
|
244
|
-
1. Services live in `/web/src/services/` (not backend)
|
|
245
|
-
2. Services use `DataProvider` (not direct Convex calls)
|
|
246
|
-
3. Backend is optional (users can bring their own)
|
|
247
|
-
4. Frontend works standalone with mock providers for testing
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
## The Backend-Agnostic Pattern (Current Implementation)
|
|
252
|
-
|
|
253
|
-
### DataProvider Interface (Universal Contract)
|
|
254
|
-
|
|
255
|
-
```typescript
|
|
256
|
-
// web/src/providers/DataProvider.ts
|
|
257
|
-
import { Effect, Context } from "effect";
|
|
258
|
-
|
|
259
|
-
// Universal interface ALL backends implement
|
|
260
|
-
export interface DataProvider {
|
|
261
|
-
// Dimension 1: Groups
|
|
262
|
-
groups: {
|
|
263
|
-
get: (id: string) => Effect.Effect<Group, GroupNotFoundError>;
|
|
264
|
-
list: (params?: { status?: string }) => Effect.Effect<Group[], Error>;
|
|
265
|
-
update: (id: string, updates: Partial<Group>) => Effect.Effect<void, Error>;
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
// Dimension 2: People
|
|
269
|
-
people: {
|
|
270
|
-
get: (id: string) => Effect.Effect<Person, PersonNotFoundError>;
|
|
271
|
-
list: (params: {
|
|
272
|
-
groupId?: string;
|
|
273
|
-
role?: string;
|
|
274
|
-
}) => Effect.Effect<Person[], Error>;
|
|
275
|
-
create: (input: CreatePersonInput) => Effect.Effect<string, Error>;
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// Dimension 3: Things
|
|
279
|
-
things: {
|
|
280
|
-
get: (id: string) => Effect.Effect<Thing, ThingNotFoundError>;
|
|
281
|
-
list: (params: {
|
|
282
|
-
type: ThingType;
|
|
283
|
-
groupId?: string;
|
|
284
|
-
}) => Effect.Effect<Thing[], Error>;
|
|
285
|
-
create: (input: CreateThingInput) => Effect.Effect<string, Error>;
|
|
286
|
-
update: (id: string, updates: Partial<Thing>) => Effect.Effect<void, Error>;
|
|
287
|
-
delete: (id: string) => Effect.Effect<void, Error>;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
// Dimension 4: Connections
|
|
291
|
-
connections: {
|
|
292
|
-
create: (input: CreateConnectionInput) => Effect.Effect<string, Error>;
|
|
293
|
-
getRelated: (thingId: string) => Effect.Effect<Connection[], Error>;
|
|
294
|
-
getCount: (thingId: string) => Effect.Effect<number, Error>;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
// Dimension 5: Events
|
|
298
|
-
events: {
|
|
299
|
-
log: (event: LogEventInput) => Effect.Effect<void, Error>;
|
|
300
|
-
query: (params: QueryEventsInput) => Effect.Effect<Event[], Error>;
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// Dimension 6: Knowledge
|
|
304
|
-
knowledge: {
|
|
305
|
-
embed: (text: string) => Effect.Effect<number[], Error>;
|
|
306
|
-
search: (
|
|
307
|
-
params: SearchKnowledgeInput,
|
|
308
|
-
) => Effect.Effect<KnowledgeChunk[], Error>;
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
export const DataProvider = Context.GenericTag<DataProvider>("DataProvider");
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### Backend-Agnostic Service Example
|
|
316
|
-
|
|
317
|
-
```typescript
|
|
318
|
-
// web/src/services/ThingService.ts
|
|
319
|
-
import { Effect } from "effect";
|
|
320
|
-
import { DataProvider } from "@/providers/DataProvider";
|
|
321
|
-
|
|
322
|
-
export class ThingService extends Effect.Service<ThingService>()(
|
|
323
|
-
"ThingService",
|
|
324
|
-
{
|
|
325
|
-
effect: Effect.gen(function* () {
|
|
326
|
-
const provider = yield* DataProvider; // Backend-agnostic!
|
|
327
|
-
|
|
328
|
-
return {
|
|
329
|
-
// Create any of the 66 thing types
|
|
330
|
-
create: (type: ThingType, input: CreateThingInput) =>
|
|
331
|
-
Effect.gen(function* () {
|
|
332
|
-
// 1. Validate input (same for all backends)
|
|
333
|
-
yield* validateThingInput(type, input);
|
|
334
|
-
|
|
335
|
-
// 2. Create via provider (backend-specific implementation)
|
|
336
|
-
const thingId = yield* provider.things.create({
|
|
337
|
-
type,
|
|
338
|
-
name: input.name,
|
|
339
|
-
groupId: input.groupId,
|
|
340
|
-
properties: input.properties,
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
// 3. Log event automatically (via provider)
|
|
344
|
-
yield* provider.events.log({
|
|
345
|
-
type: "entity_created",
|
|
346
|
-
actorId: input.actorId,
|
|
347
|
-
targetId: thingId,
|
|
348
|
-
groupId: input.groupId,
|
|
349
|
-
metadata: { thingType: type },
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
return thingId;
|
|
353
|
-
}),
|
|
354
|
-
|
|
355
|
-
// Get thing by ID
|
|
356
|
-
get: (id: string) => provider.things.get(id),
|
|
357
|
-
|
|
358
|
-
// List things by type
|
|
359
|
-
list: (type: ThingType, groupId: string) =>
|
|
360
|
-
provider.things.list({ type, groupId }),
|
|
361
|
-
|
|
362
|
-
// Update thing
|
|
363
|
-
update: (id: string, updates: Partial<Thing>) =>
|
|
364
|
-
Effect.gen(function* () {
|
|
365
|
-
yield* provider.things.update(id, updates);
|
|
366
|
-
|
|
367
|
-
// Log event
|
|
368
|
-
yield* provider.events.log({
|
|
369
|
-
type: "entity_updated",
|
|
370
|
-
actorId: updates.actorId,
|
|
371
|
-
targetId: id,
|
|
372
|
-
groupId: updates.groupId,
|
|
373
|
-
metadata: { updates },
|
|
374
|
-
});
|
|
375
|
-
}),
|
|
376
|
-
};
|
|
377
|
-
}),
|
|
378
|
-
dependencies: [DataProvider], // Inject provider
|
|
379
|
-
},
|
|
380
|
-
) {}
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
### ConvexProvider Implementation
|
|
384
|
-
|
|
385
|
-
```typescript
|
|
386
|
-
// web/src/providers/convex/ConvexProvider.ts
|
|
387
|
-
import { Effect, Layer } from "effect";
|
|
388
|
-
import { ConvexHttpClient } from "convex/browser";
|
|
389
|
-
import { DataProvider } from "../DataProvider";
|
|
390
|
-
import { api } from "@/convex/_generated/api";
|
|
391
|
-
|
|
392
|
-
export class ConvexProvider implements DataProvider {
|
|
393
|
-
constructor(private client: ConvexHttpClient) {}
|
|
394
|
-
|
|
395
|
-
things = {
|
|
396
|
-
create: (input) =>
|
|
397
|
-
Effect.tryPromise({
|
|
398
|
-
try: () => this.client.mutation(api.mutations.things.create, input),
|
|
399
|
-
catch: (error) => new Error(String(error)),
|
|
400
|
-
}),
|
|
401
|
-
|
|
402
|
-
get: (id) =>
|
|
403
|
-
Effect.tryPromise({
|
|
404
|
-
try: () => this.client.query(api.queries.things.get, { id }),
|
|
405
|
-
catch: (error) => new ThingNotFoundError(id),
|
|
406
|
-
}),
|
|
407
|
-
|
|
408
|
-
list: (params) =>
|
|
409
|
-
Effect.tryPromise({
|
|
410
|
-
try: () => this.client.query(api.queries.things.list, params),
|
|
411
|
-
catch: (error) => new Error(String(error)),
|
|
412
|
-
}),
|
|
413
|
-
|
|
414
|
-
update: (id, updates) =>
|
|
415
|
-
Effect.tryPromise({
|
|
416
|
-
try: () =>
|
|
417
|
-
this.client.mutation(api.mutations.things.update, { id, ...updates }),
|
|
418
|
-
catch: (error) => new Error(String(error)),
|
|
419
|
-
}),
|
|
420
|
-
|
|
421
|
-
delete: (id) =>
|
|
422
|
-
Effect.tryPromise({
|
|
423
|
-
try: () => this.client.mutation(api.mutations.things.delete, { id }),
|
|
424
|
-
catch: (error) => new Error(String(error)),
|
|
425
|
-
}),
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// ... implement other dimensions (people, groups, connections, events, knowledge)
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
export const convexProvider = (config: { url: string }) =>
|
|
432
|
-
Layer.succeed(
|
|
433
|
-
DataProvider,
|
|
434
|
-
new ConvexProvider(new ConvexHttpClient(config.url)),
|
|
435
|
-
);
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
### Configure Provider (ONE LINE!)
|
|
439
|
-
|
|
440
|
-
```typescript
|
|
441
|
-
// web/astro.config.ts
|
|
442
|
-
import { defineConfig } from "astro/config";
|
|
443
|
-
import react from "@astrojs/react";
|
|
444
|
-
import { convexProvider } from "./src/providers/convex";
|
|
445
|
-
// import { wordpressProvider } from "./src/providers/wordpress"; // Alternative
|
|
446
|
-
// import { supabaseProvider } from "./src/providers/supabase"; // Alternative
|
|
447
|
-
|
|
448
|
-
export default defineConfig({
|
|
449
|
-
integrations: [
|
|
450
|
-
react(),
|
|
451
|
-
one({
|
|
452
|
-
// ✅ Change this ONE line to swap backends!
|
|
453
|
-
provider: convexProvider({ url: import.meta.env.PUBLIC_CONVEX_URL }),
|
|
454
|
-
|
|
455
|
-
// OR use WordPress:
|
|
456
|
-
// provider: wordpressProvider({ url: "https://blog.com", apiKey: env.WP_KEY }),
|
|
457
|
-
|
|
458
|
-
// OR use Supabase:
|
|
459
|
-
// provider: supabaseProvider({ url: env.SUPABASE_URL, key: env.SUPABASE_KEY }),
|
|
460
|
-
}),
|
|
461
|
-
],
|
|
462
|
-
});
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
### Frontend Usage (Completely Backend-Agnostic)
|
|
466
|
-
|
|
467
|
-
```tsx
|
|
468
|
-
// web/src/components/CreateCourse.tsx
|
|
469
|
-
import { useEffectRunner } from "@/hooks/useEffectRunner";
|
|
470
|
-
import { ThingService } from "@/services/ThingService";
|
|
471
|
-
import { Effect } from "effect";
|
|
472
|
-
|
|
473
|
-
export function CreateCourseForm() {
|
|
474
|
-
const { run, loading } = useEffectRunner();
|
|
475
|
-
|
|
476
|
-
const handleSubmit = async (formData: CourseFormData) => {
|
|
477
|
-
// Define Effect program
|
|
478
|
-
const program = Effect.gen(function* () {
|
|
479
|
-
const thingService = yield* ThingService;
|
|
480
|
-
|
|
481
|
-
// This works with ANY backend (Convex, WordPress, Supabase, etc.)!
|
|
482
|
-
const courseId = yield* thingService.create("course", {
|
|
483
|
-
name: formData.name,
|
|
484
|
-
groupId: currentGroup.id,
|
|
485
|
-
properties: {
|
|
486
|
-
description: formData.description,
|
|
487
|
-
price: formData.price,
|
|
488
|
-
duration: formData.duration,
|
|
489
|
-
},
|
|
490
|
-
actorId: currentUser.id,
|
|
491
|
-
});
|
|
492
|
-
|
|
493
|
-
return courseId;
|
|
494
|
-
});
|
|
495
|
-
|
|
496
|
-
// Run program (uses configured provider automatically)
|
|
497
|
-
const courseId = await run(program);
|
|
498
|
-
|
|
499
|
-
// Redirect to course page
|
|
500
|
-
navigate(`/courses/${courseId}`);
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
return <form onSubmit={handleSubmit}>...</form>;
|
|
504
|
-
}
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
### Benefits of This Architecture
|
|
508
|
-
|
|
509
|
-
**1. True Backend Independence**
|
|
510
|
-
|
|
511
|
-
- Frontend code never imports backend-specific modules
|
|
512
|
-
- Services use DataProvider interface only
|
|
513
|
-
- Swap backends without changing a single service or component
|
|
514
|
-
|
|
515
|
-
**2. Testing Without Backend**
|
|
516
|
-
|
|
517
|
-
```typescript
|
|
518
|
-
// web/src/services/__tests__/ThingService.test.ts
|
|
519
|
-
import { Effect, Layer } from "effect";
|
|
520
|
-
import { ThingService } from "../ThingService";
|
|
521
|
-
|
|
522
|
-
const MockProvider = Layer.succeed(
|
|
523
|
-
DataProvider,
|
|
524
|
-
{
|
|
525
|
-
things: {
|
|
526
|
-
create: (input) => Effect.succeed("mock-id-123"),
|
|
527
|
-
get: (id) => Effect.succeed({ _id: id, type: "course", name: "Test" }),
|
|
528
|
-
// ... other methods
|
|
529
|
-
},
|
|
530
|
-
// ... other dimensions
|
|
531
|
-
}
|
|
532
|
-
);
|
|
533
|
-
|
|
534
|
-
test("should create course", async () => {
|
|
535
|
-
const program = Effect.gen(function* () {
|
|
536
|
-
const service = yield* ThingService;
|
|
537
|
-
return yield* service.create("course", { ... });
|
|
538
|
-
});
|
|
539
|
-
|
|
540
|
-
const result = await Effect.runPromise(
|
|
541
|
-
program.pipe(Effect.provide(MockProvider))
|
|
542
|
-
);
|
|
543
|
-
|
|
544
|
-
expect(result).toBe("mock-id-123");
|
|
545
|
-
});
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
**3. Organizations Use Existing Infrastructure**
|
|
549
|
-
|
|
550
|
-
```typescript
|
|
551
|
-
// Organization A: Uses Convex (real-time)
|
|
552
|
-
provider: convexProvider({ url: "..." });
|
|
553
|
-
|
|
554
|
-
// Organization B: Uses WordPress (existing CMS)
|
|
555
|
-
provider: wordpressProvider({ url: "https://blog.org", apiKey: "..." });
|
|
556
|
-
|
|
557
|
-
// Organization C: Uses Supabase (PostgreSQL)
|
|
558
|
-
provider: supabaseProvider({ url: "...", key: "..." });
|
|
559
|
-
|
|
560
|
-
// Same frontend code works for all three!
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
**4. Deployment Flexibility**
|
|
564
|
-
|
|
565
|
-
```bash
|
|
566
|
-
# Development: Full stack
|
|
567
|
-
ONE_BACKEND=on
|
|
568
|
-
|
|
569
|
-
# Production (one.ie): Backend enabled
|
|
570
|
-
ONE_BACKEND=on
|
|
571
|
-
|
|
572
|
-
# Demo (demo.one.ie): Backend disabled
|
|
573
|
-
ONE_BACKEND=off
|
|
574
|
-
|
|
575
|
-
# User installation (npx oneie): Backend OFF by default
|
|
576
|
-
ONE_BACKEND=off
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
---
|
|
580
|
-
|
|
581
|
-
## Optional: Convex-Specific Integration with confect
|
|
582
|
-
|
|
583
|
-
**Note:** This section is only relevant if you're using Convex as your backend AND want deeper Effect.ts integration in the backend layer. For most use cases, the DataProvider pattern above is sufficient.
|
|
584
|
-
|
|
585
|
-
### Schema definition with confect
|
|
586
|
-
|
|
587
|
-
Replace Convex validators with Effect schemas for stronger type guarantees:
|
|
588
|
-
|
|
589
|
-
```typescript
|
|
590
|
-
// convex/schema.ts
|
|
591
|
-
import { Id, defineSchema, defineTable } from "@rjdellecese/confect/server";
|
|
592
|
-
import { Schema } from "effect";
|
|
593
|
-
|
|
594
|
-
export const confectSchema = defineSchema({
|
|
595
|
-
agents: defineTable(
|
|
596
|
-
Schema.Struct({
|
|
597
|
-
userId: Id.Id("users"),
|
|
598
|
-
name: Schema.String,
|
|
599
|
-
instructions: Schema.String,
|
|
600
|
-
model: Schema.Literal("gpt-4o", "claude-3-5-sonnet", "gemini-flash"),
|
|
601
|
-
status: Schema.Literal("active", "paused", "archived"),
|
|
602
|
-
metadata: Schema.optional(
|
|
603
|
-
Schema.Struct({
|
|
604
|
-
tags: Schema.Array(Schema.String),
|
|
605
|
-
lastActive: Schema.Number,
|
|
606
|
-
}),
|
|
607
|
-
),
|
|
608
|
-
}),
|
|
609
|
-
)
|
|
610
|
-
.index("by_user", ["userId"])
|
|
611
|
-
.index("by_status", ["status"]),
|
|
612
|
-
|
|
613
|
-
threads: defineTable(
|
|
614
|
-
Schema.Struct({
|
|
615
|
-
agentId: Id.Id("agents"),
|
|
616
|
-
userId: Id.Id("users"),
|
|
617
|
-
title: Schema.optional(Schema.String),
|
|
618
|
-
}),
|
|
619
|
-
)
|
|
620
|
-
.index("by_agent", ["agentId"])
|
|
621
|
-
.index("by_user", ["userId"]),
|
|
622
|
-
|
|
623
|
-
messages: defineTable(
|
|
624
|
-
Schema.Struct({
|
|
625
|
-
threadId: Id.Id("threads"),
|
|
626
|
-
role: Schema.Literal("user", "assistant", "system", "tool"),
|
|
627
|
-
content: Schema.String,
|
|
628
|
-
toolCalls: Schema.optional(
|
|
629
|
-
Schema.Array(
|
|
630
|
-
Schema.Struct({
|
|
631
|
-
name: Schema.String,
|
|
632
|
-
args: Schema.Record(Schema.String, Schema.Unknown),
|
|
633
|
-
result: Schema.optional(Schema.Unknown),
|
|
634
|
-
}),
|
|
635
|
-
),
|
|
636
|
-
),
|
|
637
|
-
embedding: Schema.optional(Schema.Array(Schema.Number)),
|
|
638
|
-
}),
|
|
639
|
-
)
|
|
640
|
-
.index("by_thread", ["threadId"])
|
|
641
|
-
.vectorIndex("embedding", {
|
|
642
|
-
vectorField: "embedding",
|
|
643
|
-
filterFields: ["threadId", "role"],
|
|
644
|
-
dimensions: 1536,
|
|
645
|
-
}),
|
|
646
|
-
});
|
|
647
|
-
|
|
648
|
-
export default confectSchema.convexSchemaDefinition;
|
|
649
|
-
```
|
|
650
|
-
|
|
651
|
-
### Function constructors with confect
|
|
652
|
-
|
|
653
|
-
Generate type-safe Effect-based function constructors:
|
|
654
|
-
|
|
655
|
-
```typescript
|
|
656
|
-
// convex/confect.ts
|
|
657
|
-
import {
|
|
658
|
-
ConfectActionCtx as ConfectActionCtxService,
|
|
659
|
-
type ConfectActionCtx as ConfectActionCtxType,
|
|
660
|
-
type ConfectDataModelFromConfectSchemaDefinition,
|
|
661
|
-
type ConfectDoc as ConfectDocType,
|
|
662
|
-
ConfectMutationCtx as ConfectMutationCtxService,
|
|
663
|
-
type ConfectMutationCtx as ConfectMutationCtxType,
|
|
664
|
-
ConfectQueryCtx as ConfectQueryCtxService,
|
|
665
|
-
type ConfectQueryCtx as ConfectQueryCtxType,
|
|
666
|
-
type TableNamesInConfectDataModel,
|
|
667
|
-
makeFunctions,
|
|
668
|
-
} from "@rjdellecese/confect/server";
|
|
669
|
-
import { confectSchema } from "./schema";
|
|
670
|
-
|
|
671
|
-
export const {
|
|
672
|
-
action,
|
|
673
|
-
internalAction,
|
|
674
|
-
internalMutation,
|
|
675
|
-
internalQuery,
|
|
676
|
-
mutation,
|
|
677
|
-
query,
|
|
678
|
-
} = makeFunctions(confectSchema);
|
|
679
|
-
|
|
680
|
-
type ConfectDataModel = ConfectDataModelFromConfectSchemaDefinition<
|
|
681
|
-
typeof confectSchema
|
|
682
|
-
>;
|
|
683
|
-
|
|
684
|
-
export type ConfectDoc<
|
|
685
|
-
TableName extends TableNamesInConfectDataModel<ConfectDataModel>,
|
|
686
|
-
> = ConfectDocType<ConfectDataModel, TableName>;
|
|
687
|
-
|
|
688
|
-
export const ConfectQueryCtx = ConfectQueryCtxService<ConfectDataModel>();
|
|
689
|
-
export type ConfectQueryCtx = ConfectQueryCtxType<ConfectDataModel>;
|
|
690
|
-
|
|
691
|
-
export const ConfectMutationCtx = ConfectMutationCtxService<ConfectDataModel>();
|
|
692
|
-
export type ConfectMutationCtx = ConfectMutationCtxType<ConfectDataModel>;
|
|
693
|
-
|
|
694
|
-
export const ConfectActionCtx = ConfectActionCtxService<ConfectDataModel>();
|
|
695
|
-
export type ConfectActionCtx = ConfectActionCtxType<ConfectDataModel>;
|
|
696
|
-
```
|
|
697
|
-
|
|
698
|
-
### Writing Effect-based Convex functions
|
|
699
|
-
|
|
700
|
-
Queries, mutations, and actions now use Effect patterns:
|
|
701
|
-
|
|
702
|
-
```typescript
|
|
703
|
-
// convex/functions.ts
|
|
704
|
-
import { Effect } from "effect";
|
|
705
|
-
import {
|
|
706
|
-
ConfectMutationCtx,
|
|
707
|
-
ConfectQueryCtx,
|
|
708
|
-
mutation,
|
|
709
|
-
query,
|
|
710
|
-
} from "./confect";
|
|
711
|
-
import { Schema } from "effect";
|
|
712
|
-
|
|
713
|
-
// Query: Read agent threads (reactive)
|
|
714
|
-
export const listThreads = query({
|
|
715
|
-
args: Schema.Struct({ userId: Schema.String }),
|
|
716
|
-
returns: Schema.Array(Schema.Unknown),
|
|
717
|
-
handler: ({ userId }) =>
|
|
718
|
-
Effect.gen(function* () {
|
|
719
|
-
const { db } = yield* ConfectQueryCtx;
|
|
720
|
-
return yield* db
|
|
721
|
-
.query("threads")
|
|
722
|
-
.withIndex("by_user", (q) => q.eq("userId", userId))
|
|
723
|
-
.order("desc")
|
|
724
|
-
.collect();
|
|
725
|
-
}),
|
|
726
|
-
});
|
|
727
|
-
|
|
728
|
-
// Mutation: Create thread (transactional)
|
|
729
|
-
export const createThread = mutation({
|
|
730
|
-
args: Schema.Struct({
|
|
731
|
-
agentId: Schema.String,
|
|
732
|
-
userId: Schema.String,
|
|
733
|
-
initialMessage: Schema.String,
|
|
734
|
-
}),
|
|
735
|
-
returns: Schema.String,
|
|
736
|
-
handler: ({ agentId, userId, initialMessage }) =>
|
|
737
|
-
Effect.gen(function* () {
|
|
738
|
-
const { db } = yield* ConfectMutationCtx;
|
|
739
|
-
|
|
740
|
-
// Create thread
|
|
741
|
-
const threadId = yield* db.insert("threads", {
|
|
742
|
-
agentId,
|
|
743
|
-
userId,
|
|
744
|
-
});
|
|
745
|
-
|
|
746
|
-
// Add first message
|
|
747
|
-
yield* db.insert("messages", {
|
|
748
|
-
threadId,
|
|
749
|
-
role: "user",
|
|
750
|
-
content: initialMessage,
|
|
751
|
-
});
|
|
752
|
-
|
|
753
|
-
return threadId;
|
|
754
|
-
}),
|
|
755
|
-
});
|
|
756
|
-
```
|
|
757
|
-
|
|
758
|
-
### Frontend integration with Astro and React
|
|
759
|
-
|
|
760
|
-
Keep frontend code simple with standard Convex hooks—Effect lives primarily in the backend:
|
|
761
|
-
|
|
762
|
-
```typescript
|
|
763
|
-
// src/lib/convex.tsx
|
|
764
|
-
import { ConvexReactClient } from "convex/react";
|
|
765
|
-
import { ConvexProvider } from "convex/react";
|
|
766
|
-
|
|
767
|
-
const CONVEX_URL = import.meta.env.PUBLIC_CONVEX_URL;
|
|
768
|
-
const client = new ConvexReactClient(CONVEX_URL);
|
|
769
|
-
|
|
770
|
-
export function ConvexClientProvider({ children }: { children: React.ReactNode }) {
|
|
771
|
-
return <ConvexProvider client={client}>{children}</ConvexProvider>;
|
|
772
|
-
}
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
```typescript
|
|
776
|
-
// src/components/AgentChat.tsx (React component)
|
|
777
|
-
import { useQuery, useMutation } from "convex/react";
|
|
778
|
-
import { api } from "../../convex/_generated/api";
|
|
779
|
-
|
|
780
|
-
export function AgentChat({ userId }: { userId: string }) {
|
|
781
|
-
const threads = useQuery(api.functions.listThreads, { userId });
|
|
782
|
-
const createThread = useMutation(api.functions.createThread);
|
|
783
|
-
|
|
784
|
-
// Reactive updates happen automatically
|
|
785
|
-
return (
|
|
786
|
-
<div>
|
|
787
|
-
{threads?.map(thread => (
|
|
788
|
-
<ThreadItem key={thread._id} thread={thread} />
|
|
789
|
-
))}
|
|
790
|
-
<button onClick={() => createThread({
|
|
791
|
-
agentId: "agent123",
|
|
792
|
-
userId,
|
|
793
|
-
initialMessage: "Hello!"
|
|
794
|
-
})}>
|
|
795
|
-
New Chat
|
|
796
|
-
</button>
|
|
797
|
-
</div>
|
|
798
|
-
);
|
|
799
|
-
}
|
|
800
|
-
```
|
|
801
|
-
|
|
802
|
-
```astro
|
|
803
|
-
---
|
|
804
|
-
// src/pages/index.astro
|
|
805
|
-
import Layout from '../layouts/Layout.astro';
|
|
806
|
-
import { AgentChat } from '../components/AgentChat';
|
|
807
|
-
import { ConvexClientProvider } from '../lib/convex';
|
|
808
|
-
---
|
|
809
|
-
|
|
810
|
-
<Layout>
|
|
811
|
-
<ConvexClientProvider client:load>
|
|
812
|
-
<AgentChat userId="user123" client:load />
|
|
813
|
-
</ConvexClientProvider>
|
|
814
|
-
</Layout>
|
|
815
|
-
```
|
|
816
|
-
|
|
817
|
-
### Build configuration requirements
|
|
818
|
-
|
|
819
|
-
Critical TypeScript settings for confect compatibility:
|
|
820
|
-
|
|
821
|
-
```json
|
|
822
|
-
// tsconfig.json (root)
|
|
823
|
-
{
|
|
824
|
-
"extends": "astro/tsconfigs/strict",
|
|
825
|
-
"compilerOptions": {
|
|
826
|
-
"exactOptionalPropertyTypes": false, // REQUIRED for Confect!
|
|
827
|
-
"strict": true,
|
|
828
|
-
"baseUrl": ".",
|
|
829
|
-
"paths": {
|
|
830
|
-
"@/*": ["./src/*"]
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
// convex/tsconfig.json
|
|
836
|
-
{
|
|
837
|
-
"compilerOptions": {
|
|
838
|
-
"exactOptionalPropertyTypes": false, // REQUIRED for Confect!
|
|
839
|
-
"moduleResolution": "Bundler",
|
|
840
|
-
"strict": true
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
```
|
|
844
|
-
|
|
845
|
-
```json
|
|
846
|
-
// convex.json
|
|
847
|
-
{
|
|
848
|
-
"functions": "convex/",
|
|
849
|
-
"node": {
|
|
850
|
-
"externalPackages": ["effect", "@effect/platform", "@effect/schema"],
|
|
851
|
-
"nodeVersion": "22"
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
```
|
|
855
|
-
|
|
856
|
-
## Benefits analysis
|
|
857
|
-
|
|
858
|
-
### Effect.ts advantages for AI agent systems
|
|
859
|
-
|
|
860
|
-
**Typed error handling eliminates silent failures.** Effect makes errors first-class citizens with explicit error channels in type signatures (`Effect<Success, Error, Requirements>`). For AI agents calling unreliable LLM APIs, this prevents cascading failures. The 14.ai production system (AI customer support platform) uses tagged errors like `RateLimitError`, `InvalidInputError`, and `NetworkError` to implement sophisticated fallback chains—when OpenAI rate limits, automatically switch to Gemini. You compose error recovery strategies declaratively rather than nested try-catch blocks.
|
|
861
|
-
|
|
862
|
-
**Structured concurrency simplifies multi-step agent workflows.** Effect's fiber-based concurrency model provides lightweight virtual threads that compose naturally. Execute multiple tool calls concurrently with bounded concurrency (`Effect.all(toolCalls, { concurrency: 5 })`), race providers for fastest response (`Effect.race(openai, anthropic, gemini)`), or implement complex retry policies with exponential backoff. Interruption propagates automatically through fiber trees—when a user cancels an agent request, all child operations (LLM calls, database queries, tool executions) clean up properly without manual cancellation logic.
|
|
863
|
-
|
|
864
|
-
**Dependency injection enables seamless testing and provider swapping.** Effect's Context and Layer system provides compile-time type-safe dependency injection. Define an `LLMProvider` service interface, implement `OpenAILive` and `AnthropicLive` layers, swap at runtime based on configuration. For testing, replace with `LLMProviderMock` that returns canned responses. The 14.ai team reports this drastically improved test coverage—they mock LLM providers completely, eliminating flaky integration tests and reducing test costs.
|
|
865
|
-
|
|
866
|
-
**Resource management prevents leaks in long-running agents.** Effect's Scope system automatically releases resources (database connections, WebSocket streams, file handles) regardless of success, failure, or interruption. For streaming LLM responses, wrap in `Effect.scoped` with `addFinalizer` to abort streams on user cancellation. For RAG agents processing documents, ensure file handles close even when errors occur mid-processing. Effect handles cleanup correctly across concurrent operations—critical for production systems running 24/7.
|
|
867
|
-
|
|
868
|
-
**Schema validation provides type-safe data transformation.** Effect's Schema library validates and transforms data with full type cycle. For AI agents, validate LLM function call outputs match expected schemas, parse structured responses, and enforce business rules. Schemas compose—define a base tool schema and extend it for specific tools. Transformations convert between API shapes and domain models. Combined with confect, your entire stack has end-to-end type safety from database to frontend.
|
|
869
|
-
|
|
870
|
-
### confect-specific benefits for Convex
|
|
871
|
-
|
|
872
|
-
**Effect schemas replace Convex validators with stronger guarantees.** Confect uses Effect's Schema library instead of Convex's built-in validators (`v.string()`, `v.object()`). Effect schemas provide more expressive validation—regex patterns, numeric ranges, conditional logic, recursive types, and custom refinements. Schemas also enable transformations (converting ISO date strings to Date objects automatically) and better error messages. The schema serves as single source of truth for types, validation, and documentation.
|
|
873
|
-
|
|
874
|
-
**Option types eliminate null-checking boilerplate.** Where standard Convex returns `User | null` from queries, confect returns `Option<User>`. Effect's Option type forces explicit handling with pattern matching, map operations, or `getOrElse` fallbacks. This prevents null reference errors—you can't accidentally forget to check if a query returned null. Combined with Effect's type system, your entire agent workflow has explicit handling for missing data.
|
|
875
|
-
|
|
876
|
-
**Automatic database operation encoding/decoding.** Confect automatically encodes and decodes data according to your Effect schemas when reading from and writing to Convex. Define a schema with transformations (like converting timestamps to Date objects), and confect handles the conversions transparently. This keeps business logic clean—work with proper domain types throughout your code, not raw database representations.
|
|
877
|
-
|
|
878
|
-
**Built-in HTTP API with OpenAPI documentation.** Confect includes Effect's HTTP API modules for defining REST endpoints with automatic OpenAPI documentation generation via Scalar. Define your agent API endpoints with Effect schemas for request/response validation, and confect generates interactive API documentation. Perfect for exposing agent functionality to external integrations or building admin dashboards.
|
|
879
|
-
|
|
880
|
-
### Synergy between Effect.ts and confect
|
|
881
|
-
|
|
882
|
-
These libraries work together seamlessly because confect is built on Effect.ts. When you write a confect function, you're writing Effect code—accessing the ConfectQueryCtx or ConfectMutationCtx returns an Effect that you compose with other Effects. Your agent service layers provide Effect-based operations, confect functions consume these services, and the entire stack maintains type safety with explicit error channels. The combination enables sophisticated patterns: query reactive agent state from Convex with ConfectQueryCtx, call external LLM APIs with Effect's retry/fallback logic, and save results transactionally with ConfectMutationCtx—all in a single composable workflow.
|
|
883
|
-
|
|
884
|
-
### Specific advantages for building AI agents
|
|
885
|
-
|
|
886
|
-
**Multi-provider fallback chains.** Production AI systems need resilience against provider outages and rate limits. Effect's error handling makes this trivial: `generateText(prompt).pipe(Effect.catchTag("RateLimitError", () => fallbackProvider))`. Chain multiple fallbacks with different retry policies. The 14.ai system implements execution plans that track which providers failed, avoiding repeated attempts against known-down services.
|
|
887
|
-
|
|
888
|
-
**Parallel tool execution with graceful degradation.** AI agents often execute multiple tools concurrently. Effect's `Effect.all()` with `{ concurrency: N, mode: "either" }` runs tools in parallel, continues on individual failures, and collects successes. Your agent can still respond even if some tools fail—critical for production reliability.
|
|
889
|
-
|
|
890
|
-
**Streaming response management.** LLM streaming requires careful resource management to prevent leaks when users cancel requests. Effect's Stream module with Scope-based cleanup handles this correctly. The 14.ai pattern duplicates streams—one sends tokens to the user, another stores for analytics—with automatic cleanup on interruption.
|
|
891
|
-
|
|
892
|
-
**State management for conversational agents.** Effect's Ref provides atomic concurrent state updates. Combined with Convex's reactive database for persistence, you get both in-memory performance and durable storage. Use Ref for short-term conversational state (current tool executions, working memory) and Convex for long-term persistence (conversation history, learned preferences).
|
|
893
|
-
|
|
894
|
-
**Type-safe agent workflows.** Define agent workflows as Effect programs with explicit dependencies. Your workflow requires `LLMProvider`, `VectorStore`, and `ToolRegistry` services—Effect verifies at compile time that you provide these dependencies. Impossible to accidentally run an agent without required services configured.
|
|
895
|
-
|
|
896
|
-
## Architecture patterns
|
|
897
|
-
|
|
898
|
-
### Where to use Effect vs plain TypeScript
|
|
899
|
-
|
|
900
|
-
**Use Effect in Convex functions** (queries, mutations, actions). This is where Effect provides maximum value—handling external API calls, complex error scenarios, and resource management. All your agent orchestration logic, LLM interactions, and database operations benefit from Effect's guarantees.
|
|
901
|
-
|
|
902
|
-
**Use Effect for agent service layers.** Implement your AI capabilities (vector search, LLM generation, tool registry, memory management) as Effect services with explicit error types. These services compose naturally in agent workflows.
|
|
903
|
-
|
|
904
|
-
**Keep frontend code simple.** React components should use standard Convex hooks (`useQuery`, `useMutation`). Optionally use Effect for complex client-side validation or local state management, but this isn't necessary. The reactive updates from Convex work automatically—no need to integrate Effect with React state management.
|
|
905
|
-
|
|
906
|
-
**Use plain TypeScript for utilities and helpers** that don't involve async operations, error handling, or external integrations. Simple data transformations, formatters, and pure functions don't benefit from Effect.
|
|
907
|
-
|
|
908
|
-
### Organizing Convex functions with Effect and confect
|
|
909
|
-
|
|
910
|
-
**Separate concerns into distinct function files:**
|
|
911
|
-
|
|
912
|
-
```
|
|
913
|
-
convex/
|
|
914
|
-
├── queries/ # Read-only operations
|
|
915
|
-
│ ├── threads.ts # Thread listing, filtering
|
|
916
|
-
│ ├── messages.ts # Message queries
|
|
917
|
-
│ └── agents.ts # Agent metadata
|
|
918
|
-
├── mutations/ # Write operations
|
|
919
|
-
│ ├── threads.ts # Create/update threads
|
|
920
|
-
│ ├── messages.ts # Save messages
|
|
921
|
-
│ └── agents.ts # Agent configuration
|
|
922
|
-
└── actions/ # External integrations
|
|
923
|
-
├── generate.ts # LLM generation
|
|
924
|
-
├── embedding.ts # Vector embedding
|
|
925
|
-
└── tools.ts # Tool execution
|
|
926
|
-
```
|
|
927
|
-
|
|
928
|
-
**Query pattern** (reactive, read-only):
|
|
929
|
-
|
|
930
|
-
```typescript
|
|
931
|
-
// convex/queries/threads.ts
|
|
932
|
-
import { Effect } from "effect";
|
|
933
|
-
import { ConfectQueryCtx, query } from "../confect";
|
|
934
|
-
import { Schema } from "effect";
|
|
935
|
-
|
|
936
|
-
export const get = query({
|
|
937
|
-
args: Schema.Struct({ threadId: Schema.String }),
|
|
938
|
-
returns: Schema.Unknown,
|
|
939
|
-
handler: ({ threadId }) =>
|
|
940
|
-
Effect.gen(function* () {
|
|
941
|
-
const { db } = yield* ConfectQueryCtx;
|
|
942
|
-
return yield* db.get(threadId);
|
|
943
|
-
}),
|
|
944
|
-
});
|
|
945
|
-
|
|
946
|
-
export const list = query({
|
|
947
|
-
args: Schema.Struct({ agentId: Schema.String }),
|
|
948
|
-
returns: Schema.Array(Schema.Unknown),
|
|
949
|
-
handler: ({ agentId }) =>
|
|
950
|
-
Effect.gen(function* () {
|
|
951
|
-
const { db } = yield* ConfectQueryCtx;
|
|
952
|
-
return yield* db
|
|
953
|
-
.query("threads")
|
|
954
|
-
.withIndex("by_agent", (q) => q.eq("agentId", agentId))
|
|
955
|
-
.order("desc")
|
|
956
|
-
.take(50)
|
|
957
|
-
.collect();
|
|
958
|
-
}),
|
|
959
|
-
});
|
|
960
|
-
```
|
|
961
|
-
|
|
962
|
-
**Mutation pattern** (transactional, write):
|
|
963
|
-
|
|
964
|
-
```typescript
|
|
965
|
-
// convex/mutations/messages.ts
|
|
966
|
-
import { Effect } from "effect";
|
|
967
|
-
import { ConfectMutationCtx, mutation } from "../confect";
|
|
968
|
-
import { Schema } from "effect";
|
|
969
|
-
|
|
970
|
-
export const save = mutation({
|
|
971
|
-
args: Schema.Struct({
|
|
972
|
-
threadId: Schema.String,
|
|
973
|
-
role: Schema.Literal("user", "assistant"),
|
|
974
|
-
content: Schema.String,
|
|
975
|
-
toolCalls: Schema.optional(Schema.Array(Schema.Unknown)),
|
|
976
|
-
}),
|
|
977
|
-
returns: Schema.String,
|
|
978
|
-
handler: (args) =>
|
|
979
|
-
Effect.gen(function* () {
|
|
980
|
-
const { db } = yield* ConfectMutationCtx;
|
|
981
|
-
|
|
982
|
-
// Validate thread exists
|
|
983
|
-
const thread = yield* db.get(args.threadId);
|
|
984
|
-
if (!thread) {
|
|
985
|
-
return yield* Effect.fail(new Error("Thread not found"));
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
// Insert message
|
|
989
|
-
const messageId = yield* db.insert("messages", {
|
|
990
|
-
threadId: args.threadId,
|
|
991
|
-
role: args.role,
|
|
992
|
-
content: args.content,
|
|
993
|
-
toolCalls: args.toolCalls,
|
|
994
|
-
});
|
|
995
|
-
|
|
996
|
-
return messageId;
|
|
997
|
-
}),
|
|
998
|
-
});
|
|
999
|
-
```
|
|
1000
|
-
|
|
1001
|
-
**Action pattern** (external calls, uses Effect heavily):
|
|
1002
|
-
|
|
1003
|
-
```typescript
|
|
1004
|
-
// convex/actions/generate.ts
|
|
1005
|
-
import { Effect, Schedule } from "effect";
|
|
1006
|
-
import { ConfectActionCtx, action } from "../confect";
|
|
1007
|
-
import { LLMProvider, VectorStore } from "../lib/services";
|
|
1008
|
-
import { Schema } from "effect";
|
|
1009
|
-
|
|
1010
|
-
export const generateResponse = action({
|
|
1011
|
-
args: Schema.Struct({
|
|
1012
|
-
threadId: Schema.String,
|
|
1013
|
-
prompt: Schema.String,
|
|
1014
|
-
}),
|
|
1015
|
-
returns: Schema.String,
|
|
1016
|
-
handler: (args) =>
|
|
1017
|
-
Effect.gen(function* () {
|
|
1018
|
-
const ctx = yield* ConfectActionCtx;
|
|
1019
|
-
const llm = yield* LLMProvider;
|
|
1020
|
-
const vectorStore = yield* VectorStore;
|
|
1021
|
-
|
|
1022
|
-
// 1. Retrieve conversation history (via query)
|
|
1023
|
-
const messages = yield* Effect.promise(() =>
|
|
1024
|
-
ctx.runQuery(api.queries.messages.list, { threadId: args.threadId }),
|
|
1025
|
-
);
|
|
1026
|
-
|
|
1027
|
-
// 2. Search for relevant context
|
|
1028
|
-
const context = yield* vectorStore.search(args.prompt).pipe(
|
|
1029
|
-
Effect.timeout("5 seconds"),
|
|
1030
|
-
Effect.catchAll(() => Effect.succeed([])), // Graceful degradation
|
|
1031
|
-
);
|
|
1032
|
-
|
|
1033
|
-
// 3. Generate response with retry logic
|
|
1034
|
-
const response = yield* llm
|
|
1035
|
-
.generate({
|
|
1036
|
-
messages: [...messages, { role: "user", content: args.prompt }],
|
|
1037
|
-
context,
|
|
1038
|
-
})
|
|
1039
|
-
.pipe(
|
|
1040
|
-
Effect.retry({
|
|
1041
|
-
times: 3,
|
|
1042
|
-
schedule: Schedule.exponential("1 second"),
|
|
1043
|
-
}),
|
|
1044
|
-
Effect.catchTags({
|
|
1045
|
-
RateLimitError: () => llm.generateWithFallback(args.prompt),
|
|
1046
|
-
NetworkError: (error) =>
|
|
1047
|
-
Effect.succeed(
|
|
1048
|
-
"I'm having trouble connecting. Please try again.",
|
|
1049
|
-
),
|
|
1050
|
-
}),
|
|
1051
|
-
);
|
|
1052
|
-
|
|
1053
|
-
// 4. Save response (via mutation)
|
|
1054
|
-
yield* Effect.promise(() =>
|
|
1055
|
-
ctx.runMutation(api.mutations.messages.save, {
|
|
1056
|
-
threadId: args.threadId,
|
|
1057
|
-
role: "assistant",
|
|
1058
|
-
content: response,
|
|
1059
|
-
}),
|
|
1060
|
-
);
|
|
1061
|
-
|
|
1062
|
-
return response;
|
|
1063
|
-
}).pipe(
|
|
1064
|
-
Effect.provide(AppLayer), // Provide service implementations
|
|
1065
|
-
),
|
|
1066
|
-
});
|
|
1067
|
-
```
|
|
1068
|
-
|
|
1069
|
-
### Agent-specific patterns
|
|
1070
|
-
|
|
1071
|
-
**Three-layer agent architecture** (from 14.ai production system):
|
|
1072
|
-
|
|
1073
|
-
**Layer 1: Actions** (atomic operations)
|
|
1074
|
-
|
|
1075
|
-
```typescript
|
|
1076
|
-
// convex/agents/actions/search.ts
|
|
1077
|
-
import { Effect } from "effect";
|
|
1078
|
-
import { VectorStore } from "../../lib/services";
|
|
1079
|
-
|
|
1080
|
-
export const searchKnowledgeBase = (query: string) =>
|
|
1081
|
-
Effect.gen(function* () {
|
|
1082
|
-
const vectorStore = yield* VectorStore;
|
|
1083
|
-
const results = yield* vectorStore.search(query, { limit: 5 });
|
|
1084
|
-
return results.map((r) => r.content).join("\n\n");
|
|
1085
|
-
});
|
|
1086
|
-
```
|
|
1087
|
-
|
|
1088
|
-
**Layer 2: Workflows** (multi-step processes)
|
|
1089
|
-
|
|
1090
|
-
```typescript
|
|
1091
|
-
// convex/agents/workflows/support.ts
|
|
1092
|
-
import { Effect, Schedule } from "effect";
|
|
1093
|
-
import { searchKnowledgeBase } from "../actions/search";
|
|
1094
|
-
import { generateResponse } from "../actions/generate";
|
|
1095
|
-
|
|
1096
|
-
export const handleSupportQuery = (query: string) =>
|
|
1097
|
-
Effect.gen(function* () {
|
|
1098
|
-
// Step 1: Search knowledge base
|
|
1099
|
-
const context = yield* searchKnowledgeBase(query).pipe(
|
|
1100
|
-
Effect.timeout("5 seconds"),
|
|
1101
|
-
Effect.retry({ times: 2 }),
|
|
1102
|
-
);
|
|
1103
|
-
|
|
1104
|
-
// Step 2: Generate response with context
|
|
1105
|
-
const response = yield* generateResponse({
|
|
1106
|
-
query,
|
|
1107
|
-
context,
|
|
1108
|
-
tone: "helpful and professional",
|
|
1109
|
-
});
|
|
1110
|
-
|
|
1111
|
-
// Step 3: If response is uncertain, escalate
|
|
1112
|
-
if (response.confidence < 0.7) {
|
|
1113
|
-
yield* escalateToHuman(query, response);
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
return response;
|
|
1117
|
-
});
|
|
1118
|
-
```
|
|
1119
|
-
|
|
1120
|
-
**Layer 3: Sub-agents** (domain-specific modules)
|
|
1121
|
-
|
|
1122
|
-
```typescript
|
|
1123
|
-
// convex/agents/sub-agents/billing.ts
|
|
1124
|
-
import { Effect } from "effect";
|
|
1125
|
-
import { handleSupportQuery } from "../workflows/support";
|
|
1126
|
-
|
|
1127
|
-
export class BillingAgent {
|
|
1128
|
-
static handle = (query: string) =>
|
|
1129
|
-
Effect.gen(function* () {
|
|
1130
|
-
// Billing-specific preprocessing
|
|
1131
|
-
const normalized = normalizeBillingQuery(query);
|
|
1132
|
-
|
|
1133
|
-
// Delegate to support workflow
|
|
1134
|
-
const response = yield* handleSupportQuery(normalized);
|
|
1135
|
-
|
|
1136
|
-
// Billing-specific postprocessing
|
|
1137
|
-
return formatBillingResponse(response);
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
```
|
|
1141
|
-
|
|
1142
|
-
**Service-oriented agent architecture:**
|
|
1143
|
-
|
|
1144
|
-
```typescript
|
|
1145
|
-
// convex/lib/services/AgentService.ts
|
|
1146
|
-
import { Context, Effect } from "effect";
|
|
1147
|
-
|
|
1148
|
-
export class AgentService extends Context.Tag("AgentService")<
|
|
1149
|
-
AgentService,
|
|
1150
|
-
{
|
|
1151
|
-
readonly executeWorkflow: (
|
|
1152
|
-
workflowId: string,
|
|
1153
|
-
input: unknown,
|
|
1154
|
-
) => Effect.Effect<string, AgentError>;
|
|
1155
|
-
|
|
1156
|
-
readonly registerTool: (tool: AgentTool) => Effect.Effect<void, never>;
|
|
1157
|
-
}
|
|
1158
|
-
>() {}
|
|
1159
|
-
|
|
1160
|
-
// convex/lib/layers/AgentLive.ts
|
|
1161
|
-
import { Layer, Effect } from "effect";
|
|
1162
|
-
import { AgentService } from "../services/AgentService";
|
|
1163
|
-
import { LLMProvider, ToolRegistry } from "../services";
|
|
1164
|
-
|
|
1165
|
-
export const AgentLive = Layer.effect(
|
|
1166
|
-
AgentService,
|
|
1167
|
-
Effect.gen(function* () {
|
|
1168
|
-
const llm = yield* LLMProvider;
|
|
1169
|
-
const tools = yield* ToolRegistry;
|
|
1170
|
-
|
|
1171
|
-
return {
|
|
1172
|
-
executeWorkflow: (workflowId, input) =>
|
|
1173
|
-
Effect.gen(function* () {
|
|
1174
|
-
const workflow = yield* loadWorkflow(workflowId);
|
|
1175
|
-
const result = yield* workflow.run(input, { llm, tools });
|
|
1176
|
-
return result;
|
|
1177
|
-
}),
|
|
1178
|
-
|
|
1179
|
-
registerTool: (tool) => tools.register(tool),
|
|
1180
|
-
};
|
|
1181
|
-
}),
|
|
1182
|
-
);
|
|
1183
|
-
```
|
|
1184
|
-
|
|
1185
|
-
**Tool registry pattern:**
|
|
1186
|
-
|
|
1187
|
-
```typescript
|
|
1188
|
-
// convex/lib/services/ToolRegistry.ts
|
|
1189
|
-
import { Context, Effect } from "effect";
|
|
1190
|
-
|
|
1191
|
-
export interface AgentTool {
|
|
1192
|
-
name: string;
|
|
1193
|
-
description: string;
|
|
1194
|
-
parameters: Schema.Schema<any>;
|
|
1195
|
-
execute: (args: any) => Effect.Effect<any, ToolError>;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
export class ToolRegistry extends Context.Tag("ToolRegistry")<
|
|
1199
|
-
ToolRegistry,
|
|
1200
|
-
{
|
|
1201
|
-
readonly register: (tool: AgentTool) => Effect.Effect<void, never>;
|
|
1202
|
-
readonly execute: (
|
|
1203
|
-
name: string,
|
|
1204
|
-
args: unknown,
|
|
1205
|
-
) => Effect.Effect<any, ToolError>;
|
|
1206
|
-
readonly list: () => Effect.Effect<AgentTool[], never>;
|
|
1207
|
-
}
|
|
1208
|
-
>() {}
|
|
1209
|
-
|
|
1210
|
-
// convex/agents/tools/search.ts
|
|
1211
|
-
import { Schema } from "effect";
|
|
1212
|
-
import { AgentTool } from "../../lib/services/ToolRegistry";
|
|
1213
|
-
|
|
1214
|
-
export const searchTool: AgentTool = {
|
|
1215
|
-
name: "search",
|
|
1216
|
-
description: "Search the knowledge base",
|
|
1217
|
-
parameters: Schema.Struct({
|
|
1218
|
-
query: Schema.String,
|
|
1219
|
-
limit: Schema.optional(Schema.Number),
|
|
1220
|
-
}),
|
|
1221
|
-
execute: ({ query, limit = 5 }) =>
|
|
1222
|
-
Effect.gen(function* () {
|
|
1223
|
-
const vectorStore = yield* VectorStore;
|
|
1224
|
-
return yield* vectorStore.search(query, { limit });
|
|
1225
|
-
}),
|
|
1226
|
-
};
|
|
1227
|
-
```
|
|
1228
|
-
|
|
1229
|
-
### Composing service layers
|
|
1230
|
-
|
|
1231
|
-
**Layer composition pattern:**
|
|
1232
|
-
|
|
1233
|
-
```typescript
|
|
1234
|
-
// convex/lib/layers/index.ts
|
|
1235
|
-
import { Layer } from "effect";
|
|
1236
|
-
import { DatabaseLive } from "./DatabaseLive";
|
|
1237
|
-
import { LLMProviderLive } from "./LLMProviderLive";
|
|
1238
|
-
import { VectorStoreLive } from "./VectorStoreLive";
|
|
1239
|
-
import { ToolRegistryLive } from "./ToolRegistryLive";
|
|
1240
|
-
import { AgentLive } from "./AgentLive";
|
|
1241
|
-
|
|
1242
|
-
// Compose layers with dependencies
|
|
1243
|
-
export const AppLayer = Layer.mergeAll(
|
|
1244
|
-
DatabaseLive,
|
|
1245
|
-
LLMProviderLive,
|
|
1246
|
-
VectorStoreLive,
|
|
1247
|
-
).pipe(
|
|
1248
|
-
Layer.provideMerge(ToolRegistryLive), // ToolRegistry depends on above
|
|
1249
|
-
Layer.provideMerge(AgentLive), // AgentService depends on all
|
|
1250
|
-
);
|
|
1251
|
-
|
|
1252
|
-
// Usage in actions
|
|
1253
|
-
export const myAction = action({
|
|
1254
|
-
handler: (args) =>
|
|
1255
|
-
Effect.gen(function* () {
|
|
1256
|
-
const agent = yield* AgentService;
|
|
1257
|
-
const result = yield* agent.executeWorkflow("support", args);
|
|
1258
|
-
return result;
|
|
1259
|
-
}).pipe(
|
|
1260
|
-
Effect.provide(AppLayer), // Provide all services
|
|
1261
|
-
),
|
|
1262
|
-
});
|
|
1263
|
-
```
|
|
1264
|
-
|
|
1265
|
-
## Practical considerations
|
|
1266
|
-
|
|
1267
|
-
### Learning curve and team adoption
|
|
1268
|
-
|
|
1269
|
-
**Effect.ts requires 2-4 weeks for proficiency.** The functional programming paradigm differs from standard TypeScript async/await. Developers need to understand Effect types, generator syntax (`Effect.gen`), error channels, and the pipe operator. Community feedback indicates initial frustration followed by productivity gains. Key insight from production teams: focus on learning 2-3 core modules (Effect, Schema, Layer) to achieve 80% productivity, then expand knowledge gradually.
|
|
1270
|
-
|
|
1271
|
-
**Mitigation strategy: incremental adoption.** Don't rewrite everything in Effect immediately. Start with error-prone areas like LLM API calls where Effect's retry/fallback logic provides immediate value. Use `Effect.runPromise()` at boundaries to integrate with existing code. Wrap external APIs as Effect services with mock implementations for testing. Gradually expand Effect usage as team confidence grows.
|
|
1272
|
-
|
|
1273
|
-
**Generator syntax bridges the gap.** Effect.gen looks similar to async/await, making it approachable for TypeScript developers:
|
|
1274
|
-
|
|
1275
|
-
```typescript
|
|
1276
|
-
// Familiar async/await
|
|
1277
|
-
async function fetchUser(id: string) {
|
|
1278
|
-
const user = await db.query("users").get(id);
|
|
1279
|
-
const posts = await db.query("posts").filter((p) => p.userId === user._id);
|
|
1280
|
-
return { user, posts };
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
// Similar Effect.gen
|
|
1284
|
-
const fetchUser = (id: string) =>
|
|
1285
|
-
Effect.gen(function* () {
|
|
1286
|
-
const { db } = yield* ConfectQueryCtx;
|
|
1287
|
-
const user = yield* db.query("users").get(id);
|
|
1288
|
-
const posts = yield* db.query("posts").filter((p) => p.userId === user._id);
|
|
1289
|
-
return { user, posts };
|
|
1290
|
-
});
|
|
1291
|
-
```
|
|
1292
|
-
|
|
1293
|
-
**Confect adds minimal learning overhead.** If you understand Effect, confect is straightforward—it's Effect patterns applied to Convex. The main new concepts are the Confect contexts (`ConfectQueryCtx`, `ConfectMutationCtx`, `ConfectActionCtx`) which replace standard Convex's `ctx` parameter.
|
|
1294
|
-
|
|
1295
|
-
**Convex itself has gentle learning curve.** Convex's reactive database model is intuitive—queries automatically update, mutations are transactional, actions call external APIs. Most developers become productive with Convex in days. The AI agent component (from `@convex-dev/agents`) provides high-level abstractions that work well out of the box.
|
|
1296
|
-
|
|
1297
|
-
### Performance implications
|
|
1298
|
-
|
|
1299
|
-
**Effect.ts performance is excellent.** Contrary to common misconceptions, Effect's core runtime adds minimal overhead (~15kb compressed). The generator-based syntax performs identically to async/await. Effect's structured concurrency actually improves performance by enabling fine-grained control over concurrent operations—you can easily limit concurrency to avoid overwhelming downstream services.
|
|
1300
|
-
|
|
1301
|
-
**Bundle size scales with usage.** Effect has aggressive tree-shaking. Only the functions you use get bundled. A typical agent application using Effect for error handling, concurrency, and schemas adds approximately 25-40kb to bundle size—negligible for modern applications.
|
|
1302
|
-
|
|
1303
|
-
**Convex performance characteristics.** Convex automatically caches query results and uses WebSocket-based subscriptions for efficient real-time updates. Database operations are fast (single-digit millisecond reads from cache). The main performance consideration: **use indexes for all queries**. Index-based queries scale to millions of documents; full table scans don't.
|
|
1304
|
-
|
|
1305
|
-
**Agent-specific performance patterns:**
|
|
1306
|
-
|
|
1307
|
-
1. **Cache embeddings aggressively.** Vector embedding generation is expensive. Store embeddings in Convex with the `vectorIndex` and reuse them.
|
|
1308
|
-
2. **Limit concurrent LLM calls.** Use `Effect.all(calls, { concurrency: 3 })` to avoid rate limits and manage costs.
|
|
1309
|
-
3. **Stream responses when possible.** For chat interfaces, stream LLM tokens as they arrive rather than waiting for complete responses. Effect's Stream module handles this efficiently.
|
|
1310
|
-
4. **Denormalize for read performance.** Convex doesn't support joins. Denormalize frequently-accessed data rather than making multiple queries.
|
|
1311
|
-
|
|
1312
|
-
### Debugging and tooling
|
|
1313
|
-
|
|
1314
|
-
**Effect DevTools provides runtime inspection.** Install the VS Code extension for Effect DevTools. It connects to your running application via WebSocket and shows real-time Effect execution, fiber traces, and structured logs. Critical for understanding complex agent workflows with multiple concurrent operations.
|
|
1315
|
-
|
|
1316
|
-
**Convex dashboard is comprehensive.** The Convex dashboard shows all database tables in real-time, function execution logs with timing, and a built-in Agent Playground for testing agent configurations. The Agent Playground lets you iterate on prompts, inspect tool calls, and tune context retrieval settings without writing code.
|
|
1317
|
-
|
|
1318
|
-
**Structured logging with Effect:**
|
|
1319
|
-
|
|
1320
|
-
```typescript
|
|
1321
|
-
import { Effect } from "effect";
|
|
1322
|
-
|
|
1323
|
-
const agentWorkflow = Effect.gen(function* () {
|
|
1324
|
-
yield* Effect.log("Starting agent workflow", { userId, threadId });
|
|
1325
|
-
|
|
1326
|
-
const result = yield* generateResponse(prompt).pipe(
|
|
1327
|
-
Effect.tap((response) =>
|
|
1328
|
-
Effect.log("Generated response", {
|
|
1329
|
-
length: response.length,
|
|
1330
|
-
model: "gpt-4o",
|
|
1331
|
-
}),
|
|
1332
|
-
),
|
|
1333
|
-
);
|
|
1334
|
-
|
|
1335
|
-
yield* Effect.log("Workflow complete", { result });
|
|
1336
|
-
return result;
|
|
1337
|
-
});
|
|
1338
|
-
```
|
|
1339
|
-
|
|
1340
|
-
Logs appear in Convex dashboard with structured metadata for filtering and analysis.
|
|
1341
|
-
|
|
1342
|
-
**OpenTelemetry integration** for production observability:
|
|
1343
|
-
|
|
1344
|
-
```typescript
|
|
1345
|
-
import { Tracer } from "effect";
|
|
1346
|
-
|
|
1347
|
-
const tracedGeneration = generateText(prompt).pipe(
|
|
1348
|
-
Effect.withSpan("llm-generation", {
|
|
1349
|
-
attributes: { model: "gpt-4o", promptLength: prompt.length },
|
|
1350
|
-
}),
|
|
1351
|
-
);
|
|
1352
|
-
```
|
|
1353
|
-
|
|
1354
|
-
Traces export to your observability platform (Datadog, Honeycomb, etc.) for production monitoring.
|
|
1355
|
-
|
|
1356
|
-
### Migration strategies
|
|
1357
|
-
|
|
1358
|
-
**For greenfield projects, start with Effect and confect from day one.** Structure your Convex backend with Effect patterns from the beginning. Use confect's schema-first approach for database definitions. Build agent services as Effect layers with dependency injection. This approach provides maximum benefit with minimal migration pain.
|
|
1359
|
-
|
|
1360
|
-
**For existing Convex projects, adopt incrementally:**
|
|
1361
|
-
|
|
1362
|
-
1. **Phase 1: Add confect and Effect to new features only.** Don't rewrite existing code. Implement new agent functionality using Effect patterns. This demonstrates value without disrupting working code.
|
|
1363
|
-
2. **Phase 2: Wrap high-value existing code.** Identify error-prone areas—typically external API calls and complex multi-step workflows. Wrap these in Effect with proper error handling and retries.
|
|
1364
|
-
3. **Phase 3: Migrate critical paths.** Once team is comfortable, migrate high-traffic or business-critical paths to Effect for improved reliability.
|
|
1365
|
-
|
|
1366
|
-
**Interoperability pattern** for gradual migration:
|
|
1367
|
-
|
|
1368
|
-
```typescript
|
|
1369
|
-
// Existing Convex function (standard)
|
|
1370
|
-
export const legacyFunction = query({
|
|
1371
|
-
handler: async (ctx, args) => {
|
|
1372
|
-
return await ctx.db.query("users").collect();
|
|
1373
|
-
},
|
|
1374
|
-
});
|
|
1375
|
-
|
|
1376
|
-
// New Effect-based function calling legacy code
|
|
1377
|
-
export const modernFunction = query({
|
|
1378
|
-
handler: (args) =>
|
|
1379
|
-
Effect.gen(function* () {
|
|
1380
|
-
const { runQuery } = yield* ConfectQueryCtx;
|
|
1381
|
-
|
|
1382
|
-
// Call legacy function via runQuery
|
|
1383
|
-
const users = yield* Effect.promise(() => runQuery(api.legacyFunction));
|
|
1384
|
-
|
|
1385
|
-
// Apply Effect-based processing
|
|
1386
|
-
const processed = yield* processUsers(users);
|
|
1387
|
-
return processed;
|
|
1388
|
-
}),
|
|
1389
|
-
});
|
|
1390
|
-
```
|
|
1391
|
-
|
|
1392
|
-
### Potential gotchas and limitations
|
|
1393
|
-
|
|
1394
|
-
**Confect requires `exactOptionalPropertyTypes: false`.** This is a Convex limitation, not confect's. Convex treats optional properties differently than TypeScript's strict mode expects. Set this in your tsconfig.json or confect won't compile.
|
|
1395
|
-
|
|
1396
|
-
**Effect error handling can create false confidence.** The 14.ai team warns: clean Effect code can create false sense of robustness. You must still rigorously test failure scenarios. Effect makes error handling explicit but doesn't automatically make your code correct.
|
|
1397
|
-
|
|
1398
|
-
**Convex actions don't retry automatically.** Unlike queries and mutations which Convex retries on transient failures, actions require manual retry logic. Use Effect's retry operators for actions that call external APIs.
|
|
1399
|
-
|
|
1400
|
-
**Schema restrictions for Convex.** Not every Effect Schema is valid for Convex database storage. Convex supports specific types (strings, numbers, booleans, arrays, objects, null). Complex Effect transformations work for validation but can't be persisted directly.
|
|
1401
|
-
|
|
1402
|
-
**Effect dependency injection can be hard to trace at scale.** As your application grows, tracking where services are provided becomes challenging. Document your layer composition clearly and use consistent patterns across your codebase.
|
|
1403
|
-
|
|
1404
|
-
**Learning both technologies simultaneously is demanding.** If your team is new to both Effect and Convex, the learning curve multiplies. Consider mastering Convex first with standard patterns, then introducing Effect incrementally.
|
|
1405
|
-
|
|
1406
|
-
### Production-ready patterns
|
|
1407
|
-
|
|
1408
|
-
**Service layer composition for agents:**
|
|
1409
|
-
|
|
1410
|
-
```typescript
|
|
1411
|
-
// convex/lib/layers/index.ts
|
|
1412
|
-
import { Layer, Config, Effect } from "effect";
|
|
1413
|
-
|
|
1414
|
-
// Environment-aware configuration
|
|
1415
|
-
const ConfigLive = Layer.effect(
|
|
1416
|
-
ConfigService,
|
|
1417
|
-
Effect.gen(function* () {
|
|
1418
|
-
const openaiKey = yield* Config.string("OPENAI_API_KEY");
|
|
1419
|
-
const anthropicKey = yield* Config.string("ANTHROPIC_API_KEY");
|
|
1420
|
-
return { openaiKey, anthropicKey };
|
|
1421
|
-
}),
|
|
1422
|
-
);
|
|
1423
|
-
|
|
1424
|
-
// LLM provider with fallback
|
|
1425
|
-
const LLMProviderLive = Layer.effect(
|
|
1426
|
-
LLMProvider,
|
|
1427
|
-
Effect.gen(function* () {
|
|
1428
|
-
const config = yield* ConfigService;
|
|
1429
|
-
|
|
1430
|
-
return {
|
|
1431
|
-
generate: (prompt) =>
|
|
1432
|
-
generateWithOpenAI(prompt, config.openaiKey).pipe(
|
|
1433
|
-
Effect.catchTags({
|
|
1434
|
-
RateLimitError: () =>
|
|
1435
|
-
generateWithAnthropic(prompt, config.anthropicKey),
|
|
1436
|
-
InvalidKeyError: (error) =>
|
|
1437
|
-
Effect.fail(new ConfigurationError({ cause: error })),
|
|
1438
|
-
}),
|
|
1439
|
-
Effect.retry({
|
|
1440
|
-
times: 3,
|
|
1441
|
-
schedule: Schedule.exponential("1 second"),
|
|
1442
|
-
}),
|
|
1443
|
-
Effect.timeout("30 seconds"),
|
|
1444
|
-
),
|
|
1445
|
-
};
|
|
1446
|
-
}),
|
|
1447
|
-
);
|
|
1448
|
-
|
|
1449
|
-
// Complete application layer
|
|
1450
|
-
export const AppLayer = Layer.mergeAll(
|
|
1451
|
-
ConfigLive,
|
|
1452
|
-
DatabaseLive,
|
|
1453
|
-
VectorStoreLive,
|
|
1454
|
-
).pipe(
|
|
1455
|
-
Layer.provideMerge(LLMProviderLive),
|
|
1456
|
-
Layer.provideMerge(ToolRegistryLive),
|
|
1457
|
-
Layer.provideMerge(AgentLive),
|
|
1458
|
-
);
|
|
1459
|
-
|
|
1460
|
-
// In production actions
|
|
1461
|
-
export const production = action({
|
|
1462
|
-
handler: (args) =>
|
|
1463
|
-
myAgentWorkflow(args).pipe(
|
|
1464
|
-
Effect.provide(AppLayer),
|
|
1465
|
-
Effect.catchAll((error) =>
|
|
1466
|
-
Effect.gen(function* () {
|
|
1467
|
-
yield* Effect.log("Agent workflow failed", { error });
|
|
1468
|
-
yield* notifyOperations(error); // Alert on-call
|
|
1469
|
-
return fallbackResponse;
|
|
1470
|
-
}),
|
|
1471
|
-
),
|
|
1472
|
-
),
|
|
1473
|
-
});
|
|
1474
|
-
```
|
|
1475
|
-
|
|
1476
|
-
**Error recovery strategy for agent workflows:**
|
|
1477
|
-
|
|
1478
|
-
```typescript
|
|
1479
|
-
const robustAgentGeneration = (prompt: string) =>
|
|
1480
|
-
Effect.gen(function* () {
|
|
1481
|
-
// Try primary approach with full context
|
|
1482
|
-
const fullResult = yield* generateWithContext(prompt, {
|
|
1483
|
-
contextLimit: 10000,
|
|
1484
|
-
}).pipe(
|
|
1485
|
-
Effect.timeout("30 seconds"),
|
|
1486
|
-
Effect.catchTag("TimeoutError", () =>
|
|
1487
|
-
Effect.fail({ _tag: "SlowGeneration" }),
|
|
1488
|
-
),
|
|
1489
|
-
);
|
|
1490
|
-
|
|
1491
|
-
return fullResult;
|
|
1492
|
-
}).pipe(
|
|
1493
|
-
// Fallback 1: Reduce context size
|
|
1494
|
-
Effect.catchTag("SlowGeneration", () =>
|
|
1495
|
-
generateWithContext(prompt, { contextLimit: 5000 }),
|
|
1496
|
-
),
|
|
1497
|
-
// Fallback 2: Switch to faster model
|
|
1498
|
-
Effect.catchTag("RateLimitError", () =>
|
|
1499
|
-
generateWithModel(prompt, "gpt-4o-mini"),
|
|
1500
|
-
),
|
|
1501
|
-
// Fallback 3: Cached response if available
|
|
1502
|
-
Effect.catchAll(() =>
|
|
1503
|
-
getCachedResponse(prompt).pipe(
|
|
1504
|
-
Effect.catchAll(() =>
|
|
1505
|
-
Effect.succeed(
|
|
1506
|
-
"I'm experiencing technical difficulties. Please try again.",
|
|
1507
|
-
),
|
|
1508
|
-
),
|
|
1509
|
-
),
|
|
1510
|
-
),
|
|
1511
|
-
);
|
|
1512
|
-
```
|
|
1513
|
-
|
|
1514
|
-
This integration of Effect.ts and confect into your Astro-shadcn-Convex stack provides industrial-strength reliability for production AI agents. The combination delivers type safety, robust error handling, and reactive data synchronization—critical capabilities for systems that users depend on. Start with confect for schema-first database design, introduce Effect for LLM integration with retry logic, and structure your agent logic as composable services. The learning investment pays dividends in reduced bugs, improved testability, and cleaner codebase architecture.
|
|
1515
|
-
|
|
1516
|
-
---
|
|
1517
|
-
|
|
1518
|
-
## Summary: How Everything Connects
|
|
1519
|
-
|
|
1520
|
-
### The Complete Picture
|
|
1521
|
-
|
|
1522
|
-
```
|
|
1523
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
1524
|
-
│ ONE Platform Architecture │
|
|
1525
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
1526
|
-
|
|
1527
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
1528
|
-
│ 1. SOURCE OF TRUTH: 6-Dimension Ontology (one/knowledge/) │
|
|
1529
|
-
│ - Groups (multi-tenant isolation, hierarchical nesting) │
|
|
1530
|
-
│ - People (authorization & governance) │
|
|
1531
|
-
│ - Things (66 types: creators, courses, tokens, agents...) │
|
|
1532
|
-
│ - Connections (25 types: owns, follows, enrolled_in...) │
|
|
1533
|
-
│ - Events (67 types: created, purchased, completed...) │
|
|
1534
|
-
│ - Knowledge (RAG: labels, chunks, vectors) │
|
|
1535
|
-
│ │
|
|
1536
|
-
│ ✅ Universal data model for ALL features │
|
|
1537
|
-
│ ✅ Scales from children to enterprises │
|
|
1538
|
-
│ ✅ Never needs breaking changes │
|
|
1539
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
1540
|
-
↓
|
|
1541
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
1542
|
-
│ 2. BACKEND-AGNOSTIC SERVICES: Effect.ts (web/src/services/) │
|
|
1543
|
-
│ - ThingService (create, get, list, update, delete) │
|
|
1544
|
-
│ - ConnectionService (create, getRelated, getCount) │
|
|
1545
|
-
│ - EventService (log, query) │
|
|
1546
|
-
│ - KnowledgeService (embed, search) │
|
|
1547
|
-
│ - GroupService, PeopleService │
|
|
1548
|
-
│ │
|
|
1549
|
-
│ ✅ Use DataProvider interface (not backend-specific) │
|
|
1550
|
-
│ ✅ Tagged errors (no try/catch) │
|
|
1551
|
-
│ ✅ Composable via Layer.mergeAll │
|
|
1552
|
-
│ ✅ Testable with mock providers │
|
|
1553
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
1554
|
-
↓
|
|
1555
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
1556
|
-
│ 3. DATAPROVIDER INTERFACE (web/src/providers/) │
|
|
1557
|
-
│ - Universal contract ALL backends implement │
|
|
1558
|
-
│ - Enforces 6-dimension ontology structure │
|
|
1559
|
-
│ - Swap backends by changing ONE line │
|
|
1560
|
-
│ │
|
|
1561
|
-
│ Current: ConvexProvider ✅ │
|
|
1562
|
-
│ Planned: WordPressProvider, SupabaseProvider 🚧 │
|
|
1563
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
1564
|
-
↓
|
|
1565
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
1566
|
-
│ 4. FRONTEND (web/src/) │
|
|
1567
|
-
│ - Astro 5 pages (SSR) │
|
|
1568
|
-
│ - React 19 components (islands) │
|
|
1569
|
-
│ - shadcn/ui (50+ components) │
|
|
1570
|
-
│ - Tailwind v4 (CSS config) │
|
|
1571
|
-
│ │
|
|
1572
|
-
│ ✅ Uses services, never calls backend directly │
|
|
1573
|
-
│ ✅ Works with ANY backend via DataProvider │
|
|
1574
|
-
│ ✅ Can run without backend (demo mode) │
|
|
1575
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
1576
|
-
↓
|
|
1577
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
1578
|
-
│ 5. DEPLOYMENT (Release Strategy) │
|
|
1579
|
-
│ │
|
|
1580
|
-
│ Development (/web) → git push │
|
|
1581
|
-
│ ↓ │
|
|
1582
|
-
│ one-ie/web (website source) │
|
|
1583
|
-
│ ↓ │
|
|
1584
|
-
│ ┌────────────────┬──────────────────┐ │
|
|
1585
|
-
│ ↓ ↓ ↓ │
|
|
1586
|
-
│ one.ie demo.one.ie npx oneie │
|
|
1587
|
-
│ (full) (demo) (install) │
|
|
1588
|
-
│ Backend ON Backend OFF Backend OFF │
|
|
1589
|
-
│ │
|
|
1590
|
-
│ ✅ Single codebase │
|
|
1591
|
-
│ ✅ Multiple deployments │
|
|
1592
|
-
│ ✅ Environment-based features │
|
|
1593
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
1594
|
-
```
|
|
1595
|
-
|
|
1596
|
-
### Key Principles Realized
|
|
1597
|
-
|
|
1598
|
-
**1. ONE Ontology = Universal Data Model**
|
|
1599
|
-
|
|
1600
|
-
- Every feature maps to 6 dimensions
|
|
1601
|
-
- DataProvider interface enforces this structure
|
|
1602
|
-
- Backends implement the ontology their way (Convex uses 5 tables, WordPress uses posts/meta, Supabase uses PostgreSQL schema)
|
|
1603
|
-
- Frontend doesn't care HOW data is stored, only THAT it follows the ontology
|
|
1604
|
-
|
|
1605
|
-
**2. Backend-Agnostic = Maximum Flexibility**
|
|
1606
|
-
|
|
1607
|
-
- Services use `DataProvider` (not Convex directly)
|
|
1608
|
-
- Organizations can use existing infrastructure (WordPress, Notion, etc.)
|
|
1609
|
-
- Frontend can run standalone (demo mode, testing, development)
|
|
1610
|
-
- Change backend = edit ONE line in `astro.config.ts`
|
|
1611
|
-
|
|
1612
|
-
**3. Effect.ts = Type-Safe Services**
|
|
1613
|
-
|
|
1614
|
-
- Tagged errors replace try/catch throughout services
|
|
1615
|
-
- Dependency injection via Layer.mergeAll
|
|
1616
|
-
- Testable with mock providers (no backend required)
|
|
1617
|
-
- Optional: Deep Convex integration with confect for advanced use cases
|
|
1618
|
-
|
|
1619
|
-
**4. Separation Enables Distribution**
|
|
1620
|
-
|
|
1621
|
-
```bash
|
|
1622
|
-
# When users run:
|
|
1623
|
-
npx oneie
|
|
1624
|
-
|
|
1625
|
-
# They get:
|
|
1626
|
-
- Frontend (web/) ✅
|
|
1627
|
-
- Documentation (one/) ✅
|
|
1628
|
-
- Claude config (.claude/) ✅
|
|
1629
|
-
- Backend OFF by default ✅
|
|
1630
|
-
|
|
1631
|
-
# Organizations can:
|
|
1632
|
-
- Use existing WordPress/Notion ✅
|
|
1633
|
-
- Connect their own Convex ✅
|
|
1634
|
-
- Build custom DataProvider ✅
|
|
1635
|
-
```
|
|
1636
|
-
|
|
1637
|
-
### Release Strategy (architecture-summary.md)
|
|
1638
|
-
|
|
1639
|
-
**Single Source → Multiple Targets**
|
|
1640
|
-
|
|
1641
|
-
```
|
|
1642
|
-
/web (development - full features)
|
|
1643
|
-
↓
|
|
1644
|
-
git push → one-ie/web (website source)
|
|
1645
|
-
↓
|
|
1646
|
-
./scripts/release.sh patch main
|
|
1647
|
-
→ apps/oneie/ → git push → one-ie/oneie → one.ie (backend ON)
|
|
1648
|
-
|
|
1649
|
-
./scripts/release.sh patch demo
|
|
1650
|
-
→ apps/one/ → git push → one-ie/one → demo.one.ie (backend OFF)
|
|
1651
|
-
```
|
|
1652
|
-
|
|
1653
|
-
**Environment Configuration:**
|
|
1654
|
-
|
|
1655
|
-
```bash
|
|
1656
|
-
# Development (.env.local)
|
|
1657
|
-
ONE_BACKEND=on
|
|
1658
|
-
ENABLE_ADMIN_FEATURES=true
|
|
1659
|
-
|
|
1660
|
-
# Production one.ie (.env.main)
|
|
1661
|
-
ONE_BACKEND=on
|
|
1662
|
-
ENABLE_ADMIN_FEATURES=false
|
|
1663
|
-
|
|
1664
|
-
# Demo demo.one.ie (.env.demo)
|
|
1665
|
-
ONE_BACKEND=off
|
|
1666
|
-
ENABLE_ADMIN_FEATURES=false
|
|
1667
|
-
|
|
1668
|
-
# User installation (npx oneie)
|
|
1669
|
-
ONE_BACKEND=off # Default
|
|
1670
|
-
```
|
|
1671
|
-
|
|
1672
|
-
### Implementation Status (unified-implementation-plan.md)
|
|
1673
|
-
|
|
1674
|
-
**✅ COMPLETE (Phases 1-2: 4 weeks)**
|
|
1675
|
-
|
|
1676
|
-
- DataProvider interface and ConvexProvider
|
|
1677
|
-
- All 6 Effect.ts services (Thing, Connection, Event, Knowledge, Group, People)
|
|
1678
|
-
- React hooks (useEffectRunner, useProvider)
|
|
1679
|
-
- Tagged errors throughout
|
|
1680
|
-
- Backend-agnostic architecture validated
|
|
1681
|
-
|
|
1682
|
-
**🚧 IN PROGRESS (Phases 3-7: 7 weeks remaining)**
|
|
1683
|
-
|
|
1684
|
-
- Phase 3: Backend implementation (66 thing types, event logging, group scoping)
|
|
1685
|
-
- Phase 4: Frontend integration (multi-tenant dashboard, entity management UI)
|
|
1686
|
-
- Phase 5: RAG & Knowledge (chunking, embedding, vector search)
|
|
1687
|
-
- Phase 6: Testing (90% backend coverage, 70% frontend coverage)
|
|
1688
|
-
- Phase 7: Multi-Backend (WordPress, Supabase, Composite providers) - OPTIONAL
|
|
1689
|
-
|
|
1690
|
-
### How to Use This Document
|
|
1691
|
-
|
|
1692
|
-
**For AI Agents:**
|
|
1693
|
-
|
|
1694
|
-
1. Read `one/knowledge/ontology.md` first (6-dimension model)
|
|
1695
|
-
2. Implement features using Effect.ts services (backend-agnostic)
|
|
1696
|
-
3. Services use DataProvider (never call backend directly)
|
|
1697
|
-
4. Follow the 100-cycle sequence in `one/knowledge/todo.md`
|
|
1698
|
-
|
|
1699
|
-
**For Developers:**
|
|
1700
|
-
|
|
1701
|
-
1. Frontend development: Use Effect.ts services via hooks
|
|
1702
|
-
2. Backend development: Implement DataProvider for your backend
|
|
1703
|
-
3. Testing: Use mock providers (no backend required)
|
|
1704
|
-
4. Deployment: Configure provider in `astro.config.ts` (ONE LINE!)
|
|
1705
|
-
|
|
1706
|
-
**For Organizations:**
|
|
1707
|
-
|
|
1708
|
-
1. Install: `npx oneie` (gets frontend only, backend OFF)
|
|
1709
|
-
2. Choose backend: Convex, WordPress, Supabase, or custom
|
|
1710
|
-
3. Implement DataProvider for your chosen backend
|
|
1711
|
-
4. Configure: Edit ONE line in `astro.config.ts`
|
|
1712
|
-
|
|
1713
|
-
### The Payoff
|
|
1714
|
-
|
|
1715
|
-
**Before Backend-Agnostic Architecture:**
|
|
1716
|
-
|
|
1717
|
-
- Frontend tightly coupled to Convex
|
|
1718
|
-
- Organizations must use Convex (no choice)
|
|
1719
|
-
- Can't test without backend
|
|
1720
|
-
- Can't use existing infrastructure
|
|
1721
|
-
- Hard to demo without signup
|
|
1722
|
-
|
|
1723
|
-
**After Backend-Agnostic Architecture:**
|
|
1724
|
-
|
|
1725
|
-
- Frontend works with ANY backend
|
|
1726
|
-
- Organizations use their existing systems
|
|
1727
|
-
- Test with mock providers (instant)
|
|
1728
|
-
- Leverage existing infrastructure investments
|
|
1729
|
-
- Demo works without backend
|
|
1730
|
-
|
|
1731
|
-
**Build Once. Deploy Anywhere. Connect Anything.**
|
|
1732
|
-
|
|
1733
|
-
---
|
|
1734
|
-
|
|
1735
|
-
## Next Steps
|
|
1736
|
-
|
|
1737
|
-
### For Immediate Implementation
|
|
1738
|
-
|
|
1739
|
-
**1. Complete Phase 3: Backend Implementation**
|
|
1740
|
-
|
|
1741
|
-
```bash
|
|
1742
|
-
# Backend mutations for all 66 thing types
|
|
1743
|
-
cd backend/convex/mutations/things.ts
|
|
1744
|
-
# Implement create/update/delete for each type
|
|
1745
|
-
# Add event logging to all mutations
|
|
1746
|
-
# Enforce group scoping
|
|
1747
|
-
```
|
|
1748
|
-
|
|
1749
|
-
**2. Complete Phase 4: Frontend Integration**
|
|
1750
|
-
|
|
1751
|
-
```bash
|
|
1752
|
-
# Multi-tenant dashboard
|
|
1753
|
-
cd web/src/pages/admin/
|
|
1754
|
-
# Build dashboard using ThingService
|
|
1755
|
-
# Add entity management UI
|
|
1756
|
-
# Visualize connections
|
|
1757
|
-
```
|
|
1758
|
-
|
|
1759
|
-
**3. Complete Phase 5: RAG & Knowledge**
|
|
1760
|
-
|
|
1761
|
-
```bash
|
|
1762
|
-
# Implement KnowledgeService features
|
|
1763
|
-
cd web/src/services/KnowledgeService.ts
|
|
1764
|
-
# Add chunking (800 tokens, 200 overlap)
|
|
1765
|
-
# Add embedding (OpenAI integration)
|
|
1766
|
-
# Add vector search
|
|
1767
|
-
```
|
|
1768
|
-
|
|
1769
|
-
### For Future Exploration
|
|
1770
|
-
|
|
1771
|
-
**1. Multi-Backend Support (Phase 7)**
|
|
1772
|
-
|
|
1773
|
-
- WordPressProvider (REST API + WP metadata)
|
|
1774
|
-
- SupabaseProvider (PostgreSQL queries)
|
|
1775
|
-
- CompositeProvider (route by feature)
|
|
1776
|
-
|
|
1777
|
-
**2. Advanced Effect.ts Features**
|
|
1778
|
-
|
|
1779
|
-
- Stream for real-time LLM responses
|
|
1780
|
-
- Fiber for advanced concurrency
|
|
1781
|
-
- STM for transactional memory
|
|
1782
|
-
|
|
1783
|
-
**3. Optional Convex Enhancements**
|
|
1784
|
-
|
|
1785
|
-
- confect integration (schema-first)
|
|
1786
|
-
- Effect.ts in Convex backend
|
|
1787
|
-
- Deep type safety end-to-end
|
|
1788
|
-
|
|
1789
|
-
---
|
|
1790
|
-
|
|
1791
|
-
## Related Documentation
|
|
1792
|
-
|
|
1793
|
-
- **`one/knowledge/ontology.md`** - 6-dimension data model (SOURCE OF TRUTH)
|
|
1794
|
-
- **`one/knowledge/todo.md`** - 100-cycle execution template
|
|
1795
|
-
- **`one/things/plans/separate.md`** - Backend separation strategy
|
|
1796
|
-
- **`one/things/plans/unified-implementation-plan.md`** - Complete 11-week plan
|
|
1797
|
-
- **`one/things/plans/improve-codebase.md`** - Alternative 14-week plan (backend-first)
|
|
1798
|
-
- **`one/things/plans/architecture-summary.md`** - Deployment architecture
|
|
1799
|
-
- **`CLAUDE.md`** - Development workflow and patterns
|
|
1800
|
-
- **`web/AGENTS.md`** - Quick reference for Convex patterns
|
|
1801
|
-
|
|
1802
|
-
---
|
|
1803
|
-
|
|
1804
|
-
**The architecture is sound. The foundation is complete. Phases 1-2 prove the concept works. Now we finish the implementation and ship the complete platform.**
|
|
1805
|
-
|
|
1806
|
-
**Build features once. Work with any backend. Scale infinitely.**
|