oneie 3.6.12 → 3.6.14
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/.claude/agents/AUDIT-agent-ops-alignment.md +379 -0
- package/.claude/agents/NEWS-QUICKSTART.md +321 -0
- package/.claude/agents/NEWS-README.md +353 -0
- package/.claude/agents/agent-backend.md +1 -1
- package/.claude/agents/agent-builder.md +220 -151
- package/.claude/agents/agent-clean.md +39 -31
- package/.claude/agents/agent-clone.md +107 -54
- package/.claude/agents/agent-designer.md +76 -71
- package/.claude/agents/agent-director.md +164 -1
- package/.claude/agents/agent-documenter.md +169 -132
- package/.claude/agents/agent-frontend.md +442 -446
- package/.claude/agents/agent-integrator.md +30 -23
- package/.claude/agents/agent-lawyer.md +145 -98
- package/.claude/agents/agent-news.md +363 -0
- package/.claude/agents/agent-onboard.md +99 -69
- package/.claude/agents/agent-ontology.md +585 -0
- package/.claude/agents/agent-ops.md +178 -171
- package/.claude/agents/agent-problem-solver.md +132 -115
- package/.claude/agents/agent-quality.md +94 -77
- package/.claude/agents/agent-sales.md +89 -67
- package/.claude/commands/release.md +3 -1
- package/.claude/commands/server.md +64 -5
- package/.claude/hooks/README-knowledge-hooks.md +266 -80
- package/.claude/hooks/README-root-cleanup.md +200 -0
- package/.claude/hooks/README.md +284 -0
- package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/check-filenames.py +169 -32
- package/.claude/hooks/clean-post.py +195 -28
- package/.claude/hooks/clean-pre.py +96 -11
- package/.claude/hooks/done.py +74 -13
- package/.claude/hooks/format-hook.sh +105 -17
- package/.claude/hooks/hook-logger.sh +121 -7
- package/.claude/hooks/knowledge-post.py +136 -32
- package/.claude/hooks/knowledge-pre.py +129 -34
- package/.claude/hooks/notification-hook.sh +184 -17
- package/.claude/hooks/root-cleanup.py +181 -39
- package/.claude/hooks/security-hook.sh +248 -8
- package/.claude/hooks/tag-all-docs.py +175 -49
- package/.claude/hooks/test-validate-ontology.sh +170 -0
- package/.claude/hooks/todo.py +92 -22
- package/.claude/hooks/validate-ontology-structure-summary.md +243 -0
- package/.claude/hooks/validate-ontology-structure.py +83 -20
- package/AGENTS.md +60 -245
- package/CLAUDE.md +70 -1
- package/README.md +25 -0
- package/folders.yaml +1 -1
- package/one/.claude/settings.local.json +11 -0
- package/one/.obsidian/community-plugins.json +3 -1
- package/one/.obsidian/plugins/editing-toolbar/data.json +328 -0
- package/one/.obsidian/plugins/editing-toolbar/main.js +12 -0
- package/one/.obsidian/plugins/editing-toolbar/manifest.json +10 -0
- package/one/.obsidian/plugins/editing-toolbar/styles.css +1338 -0
- package/one/.obsidian/plugins/terminal/data.json +154 -0
- package/one/.obsidian/plugins/terminal/main.js +197 -0
- package/one/.obsidian/plugins/terminal/manifest.json +14 -0
- package/one/.obsidian/plugins/terminal/styles.css +32 -0
- package/one/.obsidian/workspace.json +71 -45
- package/one/README.md +18 -0
- package/one/connections/a2a.md +49 -0
- package/one/connections/acp.md +47 -0
- package/one/connections/acps.md +18 -0
- package/one/connections/agentkit.md +18 -0
- package/one/connections/agui.md +18 -0
- package/one/connections/any-backend.md +39 -21
- package/one/connections/ap2.md +74 -0
- package/one/connections/api/queries-reference.md +18 -0
- package/one/connections/api-docs.md +18 -0
- package/one/connections/api-reference.md +18 -0
- package/one/connections/api.md +18 -0
- package/one/connections/architecture-diagram.md +18 -0
- package/one/connections/communications.md +18 -0
- package/one/connections/connections.md +18 -0
- package/one/connections/copilotkit.md +18 -0
- package/one/connections/cryptonetworks.md +18 -0
- package/one/connections/documentation.md +18 -0
- package/one/connections/effect.md +18 -0
- package/one/connections/elizaos.md +18 -0
- package/one/connections/groups.md +814 -0
- package/one/connections/inference.md +18 -0
- package/one/connections/integration-examples.md +18 -0
- package/one/connections/integration-guide.md +18 -0
- package/one/connections/integration-phase2.md +32 -14
- package/one/connections/kyc.md +18 -0
- package/one/connections/mcp.md +18 -0
- package/one/connections/membership.md +18 -0
- package/one/connections/middleware.md +18 -0
- package/one/connections/multitenant.md +18 -0
- package/one/connections/n8n.md +18 -0
- package/one/connections/patterns.md +18 -0
- package/one/connections/protocols.md +20 -2
- package/one/connections/relationships.md +18 -0
- package/one/connections/schema.md +18 -0
- package/one/connections/service-layer.md +18 -0
- package/one/connections/vectors.md +18 -0
- package/one/connections/wordpress.md +18 -0
- package/one/connections/workflow-copy.md +18 -0
- package/one/connections/workflow-examples.md +18 -0
- package/one/connections/workflow-onboarding.md +18 -0
- package/one/connections/workflow.md +18 -0
- package/one/connections/workflows/delegation.md +18 -0
- package/one/connections/workflows/frontend.md +18 -0
- package/one/connections/workflows/strategy.md +18 -0
- package/one/connections/workflows/tasks.md +18 -0
- package/one/connections/x402-baazar.md +131 -0
- package/one/connections/x402.md +268 -164
- package/one/events/2024-10-14-deployment-plan.md +15 -16
- package/one/events/2024-10-14-deployment-success.md +15 -16
- package/one/events/2024-10-14-final-sync-complete.md +15 -16
- package/one/events/2024-10-14-release-v2.0.6.md +15 -16
- package/one/events/2024-10-15-agent-clean-v2-summary.md +15 -16
- package/one/events/2024-10-15-handoff-to-clean.md +15 -16
- package/one/events/2024-10-15-package-manager-tests.md +15 -16
- package/one/events/2024-10-15-release-command-complete.md +15 -16
- package/one/events/2025-10-15-private-files-secured.md +18 -0
- package/one/events/2025-10-15-unignore-public-group-docs.md +18 -0
- package/one/events/ALIGNMENT_REPORT_PROBLEM_SOLVER.md +335 -0
- package/one/events/ALIGNMENT_SUMMARY.md +280 -0
- package/one/events/API_ROUTES_FIXES_SUMMARY.md +18 -0
- package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +18 -0
- package/one/events/AUDIT-ONTOLOGY-ALIGNMENT.md +598 -0
- package/one/events/BEFORE_AFTER_COMPARISON.md +18 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +18 -0
- package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +18 -0
- package/one/events/CLAUDE copy.md +897 -0
- package/one/events/CLEANUP-RELEASE-V2.0.8.md +18 -0
- package/one/events/CONNECTIONS_DEMO.md +18 -0
- package/one/events/CREATE-WEBSITE.md +18 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +18 -0
- package/one/events/CUSTOM-DOMAIN.md +18 -0
- package/one/events/DELIVERABLES.md +18 -0
- package/one/events/DEMO-GROUPS-PAGE.md +18 -0
- package/one/events/DEMO-TESTING-SUMMARY.md +18 -0
- package/one/events/DEMO_COMPONENTS.md +18 -0
- package/one/events/DEMO_HOOKS_INDEX.md +18 -0
- package/one/events/DEMO_INFRASTRUCTURE.md +18 -0
- package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +18 -0
- package/one/events/DEMO_INTEGRATION_CHECKLIST.md +18 -0
- package/one/events/DEMO_QUICK_REFERENCE.md +18 -0
- package/one/events/DEMO_SETUP.md +18 -0
- package/one/events/DEPLOYMENT copy.md +18 -0
- package/one/events/DEPLOYMENT.md +18 -0
- package/one/events/ECOMMERCE-BEFORE-AFTER.md +16 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +18 -0
- package/one/events/ECOMMERCE-ENHANCEMENTS.md +18 -0
- package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +18 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +18 -0
- package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +18 -0
- package/one/events/ECOMMERCE-SETUP-SUMMARY.md +18 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +18 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +18 -0
- package/one/events/EFFECT_TS_API_PATTERN.md +18 -0
- package/one/events/FEATURE-2-4-COMPLETE.md +18 -0
- package/one/events/FEATURE_2_3_COMPLETE.md +18 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +18 -0
- package/one/events/GROUPS-MIGRATION.md +18 -0
- package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +18 -0
- package/one/events/HANDOFF.md +18 -0
- package/one/events/HOOKS-DEMO.md +18 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +18 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +18 -0
- package/one/events/INSTALL-TESTS.md +18 -0
- package/one/events/INSTALLATION_FOLDERS.md +18 -0
- package/one/events/INSTALLATION_FOLDERS_FILES.md +18 -0
- package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +18 -0
- package/one/events/INTEGRATION-ARCHITECTURE.md +18 -0
- package/one/events/INTEGRATION-CHECKLIST.md +18 -0
- package/one/events/INTEGRATION-ORCHESTRATION.md +18 -0
- package/one/events/INTEGRATION-SUMMARY.md +18 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +18 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +18 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +18 -0
- package/one/events/LICENSE.md +18 -0
- package/one/events/MCP-CONFIGURATION.md +18 -0
- package/one/events/MCP-SETUP-COMPLETE.md +18 -0
- package/one/events/MIGRATION-REPORT.md +18 -0
- package/one/events/MIGRATION.md +18 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +18 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +18 -0
- package/one/events/NODE-UPGRADE.md +18 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +18 -0
- package/one/events/ONTOLOGY-HOOKS-README.md +18 -0
- package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +18 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +18 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +18 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +18 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +18 -0
- package/one/events/PACKAGE-STRUCTURE.md +18 -0
- package/one/events/PLAYBOOK-SETUP-SUMMARY.md +18 -0
- package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +18 -0
- package/one/events/QA-CHECKLIST.md +18 -0
- package/one/events/QUICK-START-ONTOLOGY.md +18 -0
- package/one/events/README-archived.md +18 -0
- package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +18 -0
- package/one/events/SEARCH_DEMO_DELIVERY.md +18 -0
- package/one/events/SEARCH_DEMO_SUMMARY.md +18 -0
- package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +18 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +18 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +18 -0
- package/one/events/SHOP-BUILD-STATUS.md +18 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +16 -0
- package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +18 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +18 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +18 -0
- package/one/events/STRIPE-INTEGRATION.md +18 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +18 -0
- package/one/events/STRIPE-SETUP-GUIDE.md +18 -0
- package/one/events/TEST-PLAN-INDEX.md +18 -0
- package/one/events/TEST-PLAN.md +18 -0
- package/one/events/TEST-SUMMARY.md +18 -0
- package/one/events/TESTS-QUICK-REF.md +18 -0
- package/one/events/TRANSITIONS-QUICK-START.md +18 -0
- package/one/events/TRANSPARENCY-FIXES.md +18 -0
- package/one/events/TYPESCRIPT_FIXES.md +18 -0
- package/one/events/TYPESCRIPT_FIXES_INDEX.md +18 -0
- package/one/events/VIEW-TRANSITIONS.md +18 -0
- package/one/events/agent-director-enhancement-summary.md +18 -0
- package/one/events/agent-onboard-implementation-summary.md +18 -0
- package/one/events/agent-ontology-alignment-completion.md +263 -0
- package/one/events/backend-integration-tests.md +18 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +18 -0
- package/one/events/clean-agent-todo-analysis-summary.md +336 -0
- package/one/events/cloudflare-automation-complete.md +18 -0
- package/one/events/cloudflare-pages-infrastructure-setup.md +18 -0
- package/one/events/contact-page-complete.md +18 -0
- package/one/events/convex-analysis-index.md +18 -0
- package/one/events/convex-structure-analysis.md +18 -0
- package/one/events/deployment-installation-folders.md +18 -0
- package/one/events/deployment-ops-summary.md +18 -0
- package/one/events/deployment-verification.md +18 -0
- package/one/events/design-spec-complete.md +18 -0
- package/one/events/documentation-audit-index.md +473 -0
- package/one/events/documentation-audit-summary.md +417 -0
- package/one/events/documentation-improvement-roadmap.md +906 -0
- package/one/events/documentation-standards-compliance-report.md +538 -0
- package/one/events/events.md +18 -0
- package/one/events/frontend-effects-complete.md +584 -0
- package/one/events/frontend-effects-orchestration.md +1356 -0
- package/one/events/frontend-effects-risk-register.md +1055 -0
- package/one/events/frontend-effects-week1-assignments.md +1594 -0
- package/one/events/hook-ontology-alignment-summary.md +528 -0
- package/one/events/installation-folders-workflow-integration.md +18 -0
- package/one/events/landing-page-generator.md +18 -0
- package/one/events/legal-assessment-2025-10-16.md +18 -0
- package/one/events/onboarding-implementation-complete.md +18 -0
- package/one/events/ontology-test-examples.md +18 -0
- package/one/events/phase1-backend-implementation-complete.md +18 -0
- package/one/events/release.md +18 -0
- package/one/events/root-cleanup-alignment-report.md +265 -0
- package/one/events/separate-implementation-status.md +18 -0
- package/one/events/session-summary-2025-10-18.md +18 -0
- package/one/events/skills-complete.md +18 -0
- package/one/events/skills-infer-6-10-summary.md +18 -0
- package/one/events/skills-phase1-complete.md +18 -0
- package/one/events/structural-analysis-architecture-vs-plans.md +559 -0
- package/one/events/test-dashboard.md +18 -0
- package/one/events/test-index.md +18 -0
- package/one/events/test-report-ontology.md +18 -0
- package/one/events/testing-summary.md +18 -0
- package/one/events/todo-refactoring-complete.md +408 -0
- package/one/events/wave1-backend-implementation-complete.md +698 -0
- package/one/groups/features.md +26 -0
- package/one/groups/groups.md +83 -39
- package/one/groups/one.md +47 -27
- package/one/groups/{strategy copy.md → strategy-copy.md} +23 -5
- package/one/knowledge/.obsidian/ecommerce-ontology.md +18 -0
- package/one/knowledge/100-inference-quick-reference.md +18 -0
- package/one/knowledge/agent-onboard-usage.md +18 -0
- package/one/knowledge/agentic-commerce.md +146 -0
- package/one/knowledge/ai-agents-vs-memecoins-thesis.md +683 -0
- package/one/knowledge/ai-platform.md +18 -0
- package/one/knowledge/ai-token-crypto-analysis-framework.md +1191 -0
- package/one/knowledge/ai-token-paradigm-shift-2025.md +732 -0
- package/one/knowledge/altcoin-cycle-prediction-ontology.md +884 -0
- package/one/knowledge/altcoin-cycle-trading-strategy.md +642 -0
- package/one/knowledge/architecture-any-backend.md +265 -42
- package/one/knowledge/architecture-diagram.md +404 -94
- package/one/knowledge/architecture-frontend.md +130 -51
- package/one/knowledge/architecture.md +1496 -1831
- package/one/knowledge/{ontology.md.backup → archived/ontology.old.md} +18 -0
- package/one/knowledge/astro-effect-complete-vision.md +2148 -0
- package/one/knowledge/astro-effect-simple-architecture.md +717 -0
- package/one/knowledge/audit-agent-onboard-alignment.md +481 -0
- package/one/knowledge/audit-agent-sales-alignment.md +444 -0
- package/one/knowledge/backend-api-reference.md +18 -0
- package/one/knowledge/cli-claude-handoff.md +18 -0
- package/one/knowledge/context-engineering.md +610 -0
- package/one/knowledge/crypto-analysis-strategy.md +1276 -0
- package/one/knowledge/crypto-cycle-2024-2025-analysis.md +44 -0
- package/one/knowledge/crypto.md +18 -0
- package/one/knowledge/docs.md +627 -0
- package/one/knowledge/dsl.md +18 -0
- package/one/knowledge/files.md +18 -0
- package/one/knowledge/frontend.md +18 -0
- package/one/knowledge/hono.md +18 -0
- package/one/knowledge/implementation-examples.md +18 -0
- package/one/knowledge/installation-folders.md +18 -0
- package/one/knowledge/institutional-cycle-paradigm-2025.md +555 -0
- package/one/knowledge/knowledge.md +18 -0
- package/one/knowledge/language.md +18 -0
- package/one/knowledge/lessons-learned.md +18 -0
- package/one/knowledge/lessons-website-building-focus.md +18 -0
- package/one/knowledge/merge-report.md +254 -0
- package/one/knowledge/nine-padel-playbook.md +18 -0
- package/one/knowledge/ontology-blog.yaml +42 -26
- package/one/knowledge/ontology-cheatsheet.md +18 -0
- package/one/knowledge/ontology-community.yaml +60 -37
- package/one/knowledge/ontology-core-universal.md +19 -1
- package/one/knowledge/ontology-core.yaml +58 -45
- package/one/knowledge/ontology-courses.yaml +71 -48
- package/one/knowledge/ontology-creator.md +30 -4
- package/one/knowledge/ontology-crypto.md +1603 -0
- package/one/knowledge/ontology-developer-guide.md +18 -0
- package/one/knowledge/ontology-documentation.md +46 -25
- package/one/knowledge/ontology-ecommerce.md +24 -6
- package/one/knowledge/ontology-education.md +18 -0
- package/one/knowledge/ontology-engineering-specification.md +22 -4
- package/one/knowledge/ontology-engineering.md +67 -43
- package/one/knowledge/ontology-files.yaml +525 -0
- package/one/knowledge/ontology-frontend-master.md +2898 -0
- package/one/knowledge/ontology-frontend-specifications.md +57 -49
- package/one/knowledge/ontology-frontend.md +40 -22
- package/one/knowledge/ontology-index.md +18 -0
- package/one/knowledge/ontology-minimal.yaml +18 -16
- package/one/knowledge/ontology-portfolio.yaml +40 -26
- package/one/knowledge/ontology-quickstart.md +18 -0
- package/one/knowledge/ontology-release.md +317 -0
- package/one/knowledge/ontology-shop.yaml +146 -119
- package/one/knowledge/ontology-tokens.yaml +46 -27
- package/one/knowledge/ontology-tutorial.md +18 -0
- package/one/knowledge/ontology-video-script.md +18 -0
- package/one/knowledge/ontology-visual-guide.md +20 -2
- package/one/knowledge/ontology.md +1329 -304
- package/one/knowledge/ontology.yaml +763 -275
- package/one/knowledge/patterns/backend/convex-mutation-pattern.md +48 -18
- package/one/knowledge/patterns/backend/convex-query-pattern.md +78 -23
- package/one/knowledge/patterns/backend/mutation-template.md +28 -10
- package/one/knowledge/patterns/backend/query-template.md +44 -25
- package/one/knowledge/patterns/backend/service-template.md +35 -14
- package/one/knowledge/patterns/design/component-architecture.md +45 -9
- package/one/knowledge/patterns/design/test-driven-design-pattern.md +37 -3
- package/one/knowledge/patterns/design/wireframe-template.md +36 -2
- package/one/knowledge/patterns/frontend/component-template.md +91 -40
- package/one/knowledge/patterns/frontend/form-template.md +131 -59
- package/one/knowledge/patterns/frontend/page-template.md +59 -28
- package/one/knowledge/patterns/frontend/react-component-pattern.md +87 -27
- package/one/knowledge/patterns/test/acceptance-criteria-template.md +28 -10
- package/one/knowledge/patterns/test/technical-test-template.md +48 -26
- package/one/knowledge/patterns/test/test-driven-pattern.md +25 -5
- package/one/knowledge/patterns/test/user-flow-template.md +18 -0
- package/one/knowledge/provider-agnostic-content.md +995 -0
- package/one/knowledge/provider-creation-guide.md +18 -0
- package/one/knowledge/quality-loop.md +18 -0
- package/one/knowledge/readme-architecture.md +158 -0
- package/one/knowledge/readme.md +18 -0
- package/one/knowledge/rules.md +18 -0
- package/one/knowledge/score.md +18 -0
- package/one/knowledge/specifications.md +18 -0
- package/one/knowledge/tags.md +18 -0
- package/one/knowledge/todo-template.md +18 -0
- package/one/knowledge/todo.md +18 -0
- package/one/knowledge/typescript-patterns.md +18 -0
- package/one/knowledge/universal-generation-language.md +827 -0
- package/one/knowledge/x402-research.md +104 -0
- package/one/license.md +18 -0
- package/one/people/anthony-o-connell.md +48 -19
- package/one/people/people.md +54 -31
- package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +401 -0
- package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +588 -0
- package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +461 -0
- package/one/things/CHECKLIST.md +51 -0
- package/one/things/IMPLEMENTATION_STATUS.md +379 -0
- package/one/things/ONE.md +19 -1
- package/one/things/agents/agent-backend.md +198 -98
- package/one/things/agents/agent-builder.md +267 -158
- package/one/things/agents/agent-clean.md +40 -15
- package/one/things/agents/agent-clone.md +33 -50
- package/one/things/agents/agent-deploy.md +59 -11
- package/one/things/agents/agent-designer.md +274 -146
- package/one/things/agents/agent-director.md +20 -2
- package/one/things/agents/agent-documenter.md +126 -46
- package/one/things/agents/agent-frontend.md +104 -22
- package/one/things/agents/agent-integrator.md +153 -76
- package/one/things/agents/agent-lawyer.md +197 -92
- package/one/things/agents/agent-problem-solver.md +302 -224
- package/one/things/agents/agent-quality.md +149 -19
- package/one/things/agents/agent-sales.md +95 -7
- package/one/things/cascade/cascade.yaml +20 -3
- package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +53 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +50 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts.md +76 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +49 -3
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +45 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +32 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +45 -3
- package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +44 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination.md +40 -1
- package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +81 -25
- package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +41 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management.md +91 -16
- package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +136 -73
- package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +43 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops.md +88 -4
- package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +52 -3
- package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +44 -1
- package/one/things/cascade/docs/examples/1-6-numbering-structure.md +78 -14
- package/one/things/cascade/docs/examples/readme.md +37 -0
- package/one/things/cascade/docs/getting-started.md +18 -0
- package/one/things/cascade/docs/workflow.md +18 -12
- package/one/things/cascade/readme.md +43 -0
- package/one/things/cascade/templates/feature-template.md +28 -6
- package/one/things/claude/agents/advocacy-activation-manager.md +64 -39
- package/one/things/claude/agents/advocacy-campaign-designer.md +64 -39
- package/one/things/claude/agents/analyst.md +64 -39
- package/one/things/claude/agents/architect.md +64 -39
- package/one/things/claude/agents/brand-identity-specialist.md +64 -39
- package/one/things/claude/agents/bstp-token-strategist.md +48 -25
- package/one/things/claude/agents/builder-repo.md +69 -26
- package/one/things/claude/agents/bullstamp-community-builder.md +48 -25
- package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +48 -25
- package/one/things/claude/agents/bulltilt-platform-growth.md +48 -25
- package/one/things/claude/agents/company-bullstamp-character.md +45 -30
- package/one/things/claude/agents/company-bullstamp-community.md +45 -30
- package/one/things/claude/agents/company-bullstamp-marketing.md +45 -30
- package/one/things/claude/agents/company-bullstamp-token.md +45 -30
- package/one/things/claude/agents/company-bulltilt-growth.md +45 -30
- package/one/things/claude/agents/content-bibliography-formatter.md +48 -25
- package/one/things/claude/agents/content-calendar-planner.md +59 -34
- package/one/things/claude/agents/content-chapter-formatter.md +60 -35
- package/one/things/claude/agents/content-formatter.md +59 -34
- package/one/things/claude/agents/content-hook-specialist.md +54 -31
- package/one/things/claude/agents/content-image-formatter.md +59 -34
- package/one/things/claude/agents/content-introduction-formatter.md +59 -34
- package/one/things/claude/agents/content-multiplication-engine.md +54 -31
- package/one/things/claude/agents/content-playbook-writer.md +60 -35
- package/one/things/claude/agents/content-team-manager.md +59 -34
- package/one/things/claude/agents/content-toc-formatter.md +60 -35
- package/one/things/claude/agents/convex-backend-specialist.md +380 -216
- package/one/things/claude/agents/core-manager.md +59 -34
- package/one/things/claude/agents/core-master.md +55 -32
- package/one/things/claude/agents/cross-functional-manager.md +46 -41
- package/one/things/claude/agents/crypto-airdrop-strategist.md +74 -54
- package/one/things/claude/agents/crypto-analytics-educator.md +73 -30
- package/one/things/claude/agents/crypto-architecture-specialist.md +70 -39
- package/one/things/claude/agents/crypto-community-analyst.md +47 -31
- package/one/things/claude/agents/crypto-community-psychologist.md +68 -31
- package/one/things/claude/agents/crypto-dex-optimization-expert.md +72 -31
- package/one/things/claude/agents/crypto-dex-optimizer.md +45 -30
- package/one/things/claude/agents/crypto-diamond-formation-specialist.md +69 -30
- package/one/things/claude/agents/crypto-diamond-hands.md +45 -30
- package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +73 -30
- package/one/things/claude/agents/crypto-engagement-specialist.md +71 -30
- package/one/things/claude/agents/crypto-market-researcher.md +45 -30
- package/one/things/claude/agents/crypto-marketing-orchestrator.md +74 -34
- package/one/things/claude/agents/crypto-network-effect-amplifier.md +75 -30
- package/one/things/claude/agents/crypto-optimization-analyst.md +73 -30
- package/one/things/claude/agents/crypto-strategic-synthesizer.md +69 -30
- package/one/things/claude/agents/crypto-team-manager.md +45 -40
- package/one/things/claude/agents/crypto-token-analyst.md +66 -25
- package/one/things/claude/agents/crypto-viral-content-creator.md +64 -61
- package/one/things/claude/agents/crypto-wallet-identification-expert.md +61 -51
- package/one/things/claude/agents/crypto-wallet-identifier.md +45 -30
- package/one/things/claude/agents/customer-journey-designer.md +51 -58
- package/one/things/claude/agents/customer-success-manager.md +51 -58
- package/one/things/claude/agents/dev.md +51 -58
- package/one/things/claude/agents/documenter.md +71 -69
- package/one/things/claude/agents/elevate-marketing-orchestrator.md +45 -52
- package/one/things/claude/agents/engagement-specialist.md +45 -52
- package/one/things/claude/agents/engineering-architect.md +54 -54
- package/one/things/claude/agents/engineering-business-analyst.md +46 -56
- package/one/things/claude/agents/engineering-developer.md +51 -52
- package/one/things/claude/agents/engineering-director.md +65 -25
- package/one/things/claude/agents/engineering-ingestor.md +110 -100
- package/one/things/claude/agents/engineering-product-manager.md +43 -55
- package/one/things/claude/agents/engineering-product-owner.md +46 -56
- package/one/things/claude/agents/engineering-project-coordinator.md +44 -56
- package/one/things/claude/agents/engineering-quality-assurance.md +53 -54
- package/one/things/claude/agents/engineering-team-manager.md +46 -43
- package/one/things/claude/agents/engineering-user-experience.md +51 -52
- package/one/things/claude/agents/framework-elevate-manager.md +45 -30
- package/one/things/claude/agents/improver.md +120 -78
- package/one/things/claude/agents/intelligence-team-manager.md +45 -40
- package/one/things/claude/agents/lead-capture-expert.md +45 -52
- package/one/things/claude/agents/lead-magnet-creator.md +45 -52
- package/one/things/claude/agents/market-research-analyst.md +48 -25
- package/one/things/claude/agents/marketing-brand-identity.md +57 -27
- package/one/things/claude/agents/marketing-content-hooks.md +45 -40
- package/one/things/claude/agents/marketing-content-multiplier.md +45 -40
- package/one/things/claude/agents/marketing-content-poster.md +71 -60
- package/one/things/claude/agents/marketing-customer-journey.md +45 -40
- package/one/things/claude/agents/marketing-director.md +46 -41
- package/one/things/claude/agents/marketing-engagement.md +45 -40
- package/one/things/claude/agents/marketing-lead-capture.md +45 -40
- package/one/things/claude/agents/marketing-lead-magnet.md +45 -40
- package/one/things/claude/agents/marketing-network-effects.md +45 -40
- package/one/things/claude/agents/marketing-nurture-campaigns.md +45 -40
- package/one/things/claude/agents/marketing-share-optimizer.md +45 -40
- package/one/things/claude/agents/marketing-team-manager.md +45 -40
- package/one/things/claude/agents/marketing-viral-growth.md +49 -18
- package/one/things/claude/agents/mission-commander.md +45 -40
- package/one/things/claude/agents/network-effect-analyst.md +48 -31
- package/one/things/claude/agents/nextjs-15-specialist.md +209 -122
- package/one/things/claude/agents/npx.md +126 -70
- package/one/things/claude/agents/nurture-campaign-manager.md +48 -25
- package/one/things/claude/agents/one-master.md +48 -25
- package/one/things/claude/agents/one-orchestrator.md +57 -27
- package/one/things/claude/agents/one.md +88 -31
- package/one/things/claude/agents/playbook-generator.md +48 -25
- package/one/things/claude/agents/pm.md +48 -25
- package/one/things/claude/agents/po.md +51 -26
- package/one/things/claude/agents/qa.md +50 -25
- package/one/things/claude/agents/research-foundation-analyst.md +48 -31
- package/one/things/claude/agents/research-intelligence-gatherer.md +59 -32
- package/one/things/claude/agents/research-market-analyst.md +47 -30
- package/one/things/claude/agents/research-team-manager.md +47 -40
- package/one/things/claude/agents/sales-environment-optimizer.md +50 -25
- package/one/things/claude/agents/sales-team-manager.md +47 -40
- package/one/things/claude/agents/sales-upsell-strategist.md +47 -30
- package/one/things/claude/agents/service-advocacy-campaigns.md +47 -30
- package/one/things/claude/agents/service-advocacy-manager.md +47 -30
- package/one/things/claude/agents/service-success-manager.md +47 -30
- package/one/things/claude/agents/service-team-manager.md +45 -40
- package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +85 -30
- package/one/things/claude/agents/share-optimization-specialist.md +50 -25
- package/one/things/claude/agents/sm.md +50 -25
- package/one/things/claude/agents/story-teller.md +51 -26
- package/one/things/claude/agents/task-master.md +52 -27
- package/one/things/claude/agents/tauri-cross-platform-specialist.md +201 -116
- package/one/things/claude/agents/tester.md +85 -46
- package/one/things/claude/agents/the-bull-character-manager.md +48 -25
- package/one/things/claude/agents/tools-playbook-generator.md +43 -40
- package/one/things/claude/agents/turbo-repo-builder.md +57 -27
- package/one/things/claude/agents/upsell-strategist.md +48 -25
- package/one/things/claude/agents/ux-expert.md +50 -25
- package/one/things/claude/agents/viral-growth-orchestrator.md +50 -27
- package/one/things/claude/commands/agent.md +25 -5
- package/one/things/claude/commands/cascade-status.md +33 -8
- package/one/things/claude/commands/ingest.md +64 -11
- package/one/things/claude/commands/ingestor.md +29 -7
- package/one/things/claude/commands/mission.md +24 -4
- package/one/things/claude/commands/npx.md +30 -7
- package/one/things/claude/commands/one.md +114 -68
- package/one/things/claude/commands/quality-check.md +72 -24
- package/one/things/claude/commands/smart-route.md +45 -4
- package/one/things/claude/commands/start.md +22 -4
- package/one/things/claude/commands/story.md +25 -5
- package/one/things/claude/commands/task.md +21 -1
- package/one/things/cli/cli-code.md +244 -219
- package/one/things/cli/cli-compiler-code.md +244 -219
- package/one/things/cli/cli.md +30 -6
- package/one/things/components/card-shadcn.md +252 -228
- package/one/things/components/card.md +315 -324
- package/one/things/components.md +667 -593
- package/one/things/componets.md +16 -1
- package/one/things/creator-diagram.md +23 -5
- package/one/things/demo-accessibility-animations.md +73 -47
- package/one/things/demo-components.md +225 -219
- package/one/things/demo-design-summary.md +89 -26
- package/one/things/demo-design-system.md +184 -130
- package/one/things/demo-page-layouts.md +52 -25
- package/one/things/designs/accessibility-audit.md +153 -66
- package/one/things/designs/component-specifications.md +163 -65
- package/one/things/designs/design-overview.md +81 -22
- package/one/things/designs/design-tokens.md +127 -93
- package/one/things/designs/wireframes-dashboard.md +64 -7
- package/one/things/docs/api-requests.md +75 -11
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +18 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +57 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +62 -6
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +60 -5
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +95 -27
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +130 -62
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +43 -19
- package/one/things/docs/ecommerce/QUICK-START.md +41 -4
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +75 -6
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +58 -24
- package/one/things/examples/children/lemonade-stand.md +52 -14
- package/one/things/examples/enterprise/crm-saas.md +43 -28
- package/one/things/features/1-1-agent-prompts.md +76 -0
- package/one/things/features/1-2-yaml-orchestrator.md +32 -0
- package/one/things/features/1-3-event-coordination.md +40 -1
- package/one/things/features/1-4-knowledge-management.md +91 -16
- package/one/things/features/1-5-quality-loops.md +88 -4
- package/one/things/features/1-6-numbering-structure.md +78 -14
- package/one/things/features/2-1-dataprovider-interface.md +311 -86
- package/one/things/features/2-2-config-system.md +307 -140
- package/one/things/features/2-3-effectts-services.md +263 -116
- package/one/things/features/2-4-react-hooks.md +217 -201
- package/one/things/features/2-5-auth-migration.md +406 -308
- package/one/things/features/2-6-dashboard-migration.md +112 -13
- package/one/things/features/2-7-alternative-providers.md +138 -65
- package/one/things/features/2-7-implementation-report.md +68 -24
- package/one/things/features/2-cli.md +88 -76
- package/one/things/features/2-design.md +112 -80
- package/one/things/features/2-tests.md +56 -0
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +91 -36
- package/one/things/features/DECOUPLING.md +36 -18
- package/one/things/features/DEPLOYMENT.md +22 -4
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +48 -2
- package/one/things/features/improve.md +47 -29
- package/one/things/features/remove-convex-deps.md +18 -0
- package/one/things/features/top-features.md +28 -20
- package/one/things/features/use-one-backend.md +210 -173
- package/one/things/features-in-english.md +19 -6
- package/one/things/files.yaml +721 -0
- package/one/things/ideas/1-create-workflow.md +18 -0
- package/one/things/ideas/2-backend-agnostic-frontend.md +57 -2
- package/one/things/implementation/backend-guide.md +64 -19
- package/one/things/interface.md +43 -0
- package/one/things/landing-page-implementation.md +455 -0
- package/one/things/legal/README.md +44 -0
- package/one/things/legal/privacy-policy.md +186 -23
- package/one/things/legal/terms-of-service.md +164 -3
- package/one/things/master-workflow-plan.md +806 -0
- package/one/things/plans/0-timeline.md +36 -0
- package/one/things/plans/1-create-workflow.md +19 -0
- package/one/things/plans/QUICK-START-SIMPLIFICATION.md +333 -0
- package/one/things/plans/README-SIMPLIFICATION.md +349 -0
- package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +16 -0
- package/one/things/plans/SIMPLIFICATION-SUMMARY.md +455 -0
- package/one/things/plans/ai-elements.md +21 -2
- package/one/things/plans/ai-integration.md +108 -59
- package/one/things/plans/ai-sdk.md +85 -48
- package/one/things/plans/ai-tools.md +621 -0
- package/one/things/plans/app.md +142 -71
- package/one/things/plans/architecture-summary.md +34 -5
- package/one/things/plans/async-ai-agents.md +19 -1
- package/one/things/plans/backend-agnostic-frontend.md +70 -8
- package/one/things/plans/backend-cleanup-quickstart.md +52 -18
- package/one/things/plans/backend-ontology-conformance.md +110 -51
- package/one/things/plans/backend-status.md +58 -0
- package/one/things/plans/backend-structure.md +103 -55
- package/one/things/plans/backend-target-structure.md +61 -17
- package/one/things/plans/backend.md +60 -18
- package/one/things/plans/better-auth-any-backend-revised.md +325 -287
- package/one/things/plans/better-auth-any-backend.md +575 -531
- package/one/things/plans/better-auth-available-features.md +43 -5
- package/one/things/plans/big-plan.md +20 -6
- package/one/things/plans/cli-updates-required.md +44 -4
- package/one/things/plans/complete-step-by-step.md +223 -116
- package/one/things/plans/components.md +709 -0
- package/one/things/plans/convex-agents.md +79 -50
- package/one/things/plans/convex-better-auth.md +186 -154
- package/one/things/plans/convex-on-off.md +47 -29
- package/one/things/plans/crypto-token-researcher.md +629 -0
- package/one/things/plans/data-quality-metrics.md +745 -0
- package/one/things/plans/deep-researcher-agent.md +466 -0
- package/one/things/plans/deploy-to-cloudflare.md +55 -13
- package/one/things/plans/deployment-architecture.md +54 -11
- package/one/things/plans/desktop.md +21 -3
- package/one/things/plans/development-plan.md +184 -121
- package/one/things/plans/development-workflow-tldr.md +207 -0
- package/one/things/plans/development-workflow.md +959 -0
- package/one/things/plans/effect-components.md +667 -593
- package/one/things/plans/effect-patterns-reference.md +2235 -0
- package/one/things/plans/effect.md +204 -131
- package/one/things/plans/email.md +21 -8
- package/one/things/plans/enhance-auth.md +64 -41
- package/one/things/plans/execution-strategy.md +1291 -0
- package/one/things/plans/existing-infrastructure.md +712 -0
- package/one/things/plans/feature-based-sites.md +124 -51
- package/one/things/plans/frontend-effects.md +1276 -0
- package/one/things/plans/group-folder-multi-tenancy.md +92 -29
- package/one/things/plans/improve-codebase.md +498 -421
- package/one/things/plans/install-components.md +18 -1
- package/one/things/plans/integrate-frontend-and-backend.md +68 -44
- package/one/things/plans/landing.md +92 -0
- package/one/things/plans/layout.md +45 -1
- package/one/things/plans/mail-backend.md +546 -493
- package/one/things/plans/mail.md +379 -326
- package/one/things/plans/mcp-clear-context-prompt.md +21 -0
- package/one/things/plans/mcp-simple.md +20 -0
- package/one/things/plans/multi-ontology-architecture.md +115 -66
- package/one/things/plans/next-features.md +31 -0
- package/one/things/plans/onboarding.md +20 -1
- package/one/things/plans/one.md +18 -0
- package/one/things/plans/ontology-6-dimensions.md +24 -45
- package/one/things/plans/ontology-compliance-audit.md +315 -0
- package/one/things/plans/ontology-driven-strategy.md +19 -3
- package/one/things/plans/ontology-refine.md +586 -0
- package/one/things/plans/ontology-ui-approach.md +18 -0
- package/one/things/plans/open-agent.md +152 -97
- package/one/things/plans/performace.md +32 -0
- package/one/things/plans/phase-1-foundation.md +620 -0
- package/one/things/plans/phase-3-implementation.md +1037 -0
- package/one/things/plans/quick-wins.md +342 -187
- package/one/things/plans/readme-backend-cleanup.md +54 -13
- package/one/things/plans/release.md +55 -2
- package/one/things/plans/repos.md +22 -0
- package/one/things/plans/separate-copy-2.md +127 -71
- package/one/things/plans/separate-copy-3.md +35 -14
- package/one/things/plans/separate-copy.md +127 -71
- package/one/things/plans/separate-demo.md +37 -3
- package/one/things/plans/separate.md +24 -6
- package/one/things/plans/sequence.md +155 -12
- package/one/things/plans/shadcn-integration-summary.md +104 -44
- package/one/things/plans/sidebar.md +44 -10
- package/one/things/plans/skills.md +103 -0
- package/one/things/plans/small-fixes.md +19 -1
- package/one/things/plans/start-new.md +34 -8
- package/one/things/plans/switch-off-auth.md +22 -0
- package/one/things/plans/sync-checklist.md +30 -0
- package/one/things/plans/test-backend-connection.md +38 -0
- package/one/things/plans/unified-implementation-plan.md +144 -62
- package/one/things/plans/update-demos.md +103 -35
- package/one/things/plans/use-our-backend.md +572 -0
- package/one/things/plans/wave1-onboarding-100-inferences.md +1686 -0
- package/one/things/plans/wave1-onboarding-vision.md +744 -0
- package/one/things/plans/wave1-orchestration-summary.md +604 -0
- package/one/things/plans/wave1-specialist-assignments.md +1413 -0
- package/one/things/plans/workflow-files.md +28 -14
- package/one/things/plans/workflow.md +18 -12
- package/one/things/products/cascade-landing-page.md +150 -46
- package/one/things/products/cascade.md +185 -135
- package/one/things/products/context-engineering.md +411 -350
- package/one/things/products/onthology.md +15 -0
- package/one/things/products/ontology-ui-shadcn.md +375 -353
- package/one/things/products/ontology-ui.md +101 -59
- package/one/things/products/ontology.md +90 -18
- package/one/things/products/sdk.md +181 -165
- package/one/things/promptkit.md +70 -43
- package/one/things/repos/all-repos.md +0 -0
- package/one/things/service-providers-new.md +95 -25
- package/one/things/service-providers.md +231 -202
- package/one/things/structure.md +532 -0
- package/one/things/system.md +18 -0
- package/one/things/templates.md +40 -0
- package/one/things/tests/2-1-dataprovider-interface.md +103 -31
- package/one/things/tests/2-1-test-analysis.md +65 -17
- package/one/things/things.md +48 -13
- package/one/things/todo-acp-integration.md +744 -0
- package/one/things/todo-ai.md +933 -0
- package/one/things/todo-api.md +1078 -0
- package/one/things/todo-assignment.md +580 -0
- package/one/things/todo-buy-chatgpt.md +1450 -0
- package/one/things/todo-components.md +1683 -0
- package/one/things/todo-connections.md +278 -0
- package/one/things/todo-ecommerce-frontend.md +1313 -0
- package/one/things/todo-ecommerce.md +569 -0
- package/one/things/todo-effects.md +1075 -0
- package/one/things/todo-frontend-effects.md +977 -0
- package/one/things/todo-landing-page.md +1091 -0
- package/one/things/todo-mail.md +1160 -0
- package/one/things/todo-master-plan.md +490 -0
- package/one/things/todo-onboard.md +666 -0
- package/one/things/todo-one-ie.md +538 -0
- package/one/things/todo-page.md +606 -0
- package/one/things/todo-plans.md +282 -0
- package/one/things/todo-projects.md +241 -0
- package/one/things/todo-refactoring-plan.md +366 -0
- package/one/things/todo-sequence.md +1621 -0
- package/one/things/todo-use-our-backend.md +1908 -0
- package/one/things/todo-workflow.md +626 -0
- package/one/things/todo-x402.md +2047 -0
- package/one/things/todo.md +459 -1075
- package/one/things/video/scripts-crypto.md +835 -0
- package/one/things/video-script-ontology.md +334 -0
- package/package.json +1 -1
- package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +0 -49
- package/one/knowledge/docs/flow.md +0 -0
- package/one/knowledge/documentation-summary.md +0 -285
- package/one/knowledge/inference-score.md +0 -159
- package/one/knowledge/ontology-frontend-copy-2.md +0 -1492
- package/one/knowledge/ontology-frontend-copy.md +0 -753
- package/one/knowledge/ontology-migration-guide.md +0 -811
- package/one/things/features/0 All Features.md +0 -2
- package/one/things/plans/1-create-workflow-status.md +0 -555
- package/one/things/plans/2-backend-agnostic-frontend.md +0 -546
- package/one/things/plans/2-sites.md +0 -895
- package/one/things/plans/3-groups.md +0 -735
- package/one/things/plans/5-build-frontend.md +0 -0
- package/one/things/plans/5-complete.md +0 -17
- package/one/things/plans/agent-director-100-inference-plans.md +0 -410
- package/one/things/plans/dual-website-strategy.md +0 -612
- package/one/things/plans/releases.md +0 -809
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 2 2 Config System
|
|
3
|
+
dimension: things
|
|
4
|
+
category: features
|
|
5
|
+
tags: backend, frontend
|
|
6
|
+
related_dimensions: connections, events, groups, knowledge, 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 features category.
|
|
13
|
+
Location: one/things/features/2-2-config-system.md
|
|
14
|
+
Purpose: Documents feature 2-2: configuration system
|
|
15
|
+
Related dimensions: connections, events, groups, knowledge, people
|
|
16
|
+
For AI agents: Read this to understand 2 2 config system.
|
|
17
|
+
---
|
|
18
|
+
|
|
1
19
|
# Feature 2-2: Configuration System
|
|
2
20
|
|
|
3
21
|
**Feature ID:** `feature_2_2_config_system`
|
|
@@ -15,6 +33,7 @@
|
|
|
15
33
|
The Configuration System enables ONE Platform to support multiple backend providers (Convex, WordPress, Notion, Supabase) with runtime provider switching, multi-tenant isolation, encrypted credential storage, and <30-second switchover times. Organizations configure their backend provider via environment variables or runtime API, with all credentials encrypted at rest and provider factories instantiating the correct implementation on demand.
|
|
16
34
|
|
|
17
35
|
**Key Features:**
|
|
36
|
+
|
|
18
37
|
- Environment-based configuration with Zod validation
|
|
19
38
|
- Runtime provider switching per organization
|
|
20
39
|
- Encrypted API key storage using AES-256-GCM
|
|
@@ -33,6 +52,7 @@ The Configuration System enables ONE Platform to support multiple backend provid
|
|
|
33
52
|
**Purpose:** Each organization has independent backend provider configuration.
|
|
34
53
|
|
|
35
54
|
**Schema Addition:**
|
|
55
|
+
|
|
36
56
|
```typescript
|
|
37
57
|
// entities table (type: "organization")
|
|
38
58
|
properties: {
|
|
@@ -47,6 +67,7 @@ properties: {
|
|
|
47
67
|
```
|
|
48
68
|
|
|
49
69
|
**Usage:**
|
|
70
|
+
|
|
50
71
|
- `org.properties.backendProvider.type` determines which provider to use
|
|
51
72
|
- `org.properties.backendProvider.configId` links to encrypted credentials
|
|
52
73
|
- Platform owner can switch providers for testing
|
|
@@ -57,12 +78,14 @@ properties: {
|
|
|
57
78
|
**Purpose:** Only org_owner and platform_owner can change backend providers.
|
|
58
79
|
|
|
59
80
|
**Roles with Config Access:**
|
|
81
|
+
|
|
60
82
|
- `platform_owner`: Can configure ANY organization's provider (for support/migration)
|
|
61
83
|
- `org_owner`: Can configure THEIR organization's provider
|
|
62
84
|
- `org_user`: Read-only access to provider type (not credentials)
|
|
63
85
|
- `customer`: No access to provider configuration
|
|
64
86
|
|
|
65
87
|
**Permission Check Pattern:**
|
|
88
|
+
|
|
66
89
|
```typescript
|
|
67
90
|
// Before allowing provider switch
|
|
68
91
|
const person = await getPerson(userId);
|
|
@@ -132,6 +155,7 @@ updatedAt: number
|
|
|
132
155
|
```
|
|
133
156
|
|
|
134
157
|
**Why This Design:**
|
|
158
|
+
|
|
135
159
|
- Reuses existing `external_connection` entity type (no new type needed)
|
|
136
160
|
- Encrypted credentials stored in properties (never in plaintext)
|
|
137
161
|
- Supports multiple configs per organization (dev, staging, prod)
|
|
@@ -141,6 +165,7 @@ updatedAt: number
|
|
|
141
165
|
### 1.4 Connections
|
|
142
166
|
|
|
143
167
|
**Organization → Backend Config:**
|
|
168
|
+
|
|
144
169
|
```typescript
|
|
145
170
|
{
|
|
146
171
|
fromEntityId: organizationId,
|
|
@@ -159,6 +184,7 @@ updatedAt: number
|
|
|
159
184
|
```
|
|
160
185
|
|
|
161
186
|
**Person → Backend Config (Who Created):**
|
|
187
|
+
|
|
162
188
|
```typescript
|
|
163
189
|
{
|
|
164
190
|
fromEntityId: personId,
|
|
@@ -262,6 +288,7 @@ updatedAt: number
|
|
|
262
288
|
```
|
|
263
289
|
|
|
264
290
|
**Why Labels:**
|
|
291
|
+
|
|
265
292
|
- Enables capability-based provider discovery
|
|
266
293
|
- Supports queries like "find backends with realtime capability"
|
|
267
294
|
- Allows filtering in UI (show only providers with auth support)
|
|
@@ -278,6 +305,7 @@ updatedAt: number
|
|
|
278
305
|
**So that** new organizations automatically use the configured backend
|
|
279
306
|
|
|
280
307
|
**Acceptance Criteria:**
|
|
308
|
+
|
|
281
309
|
- [ ] `.env.local` contains `BACKEND_PROVIDER=convex` variable
|
|
282
310
|
- [ ] `.env.local` contains provider-specific credentials (e.g., `CONVEX_DEPLOYMENT_URL`)
|
|
283
311
|
- [ ] Zod schema validates all required environment variables on startup
|
|
@@ -286,6 +314,7 @@ updatedAt: number
|
|
|
286
314
|
- [ ] Provider switch creates `settings_updated` event with platform_owner actorId
|
|
287
315
|
|
|
288
316
|
**Example Config:**
|
|
317
|
+
|
|
289
318
|
```bash
|
|
290
319
|
# .env.local
|
|
291
320
|
BACKEND_PROVIDER=convex
|
|
@@ -306,6 +335,7 @@ CONVEX_DEPLOYMENT_NAME=prod:shocking-falcon-870
|
|
|
306
335
|
**So that** I can use my existing WordPress infrastructure
|
|
307
336
|
|
|
308
337
|
**Acceptance Criteria:**
|
|
338
|
+
|
|
309
339
|
- [ ] Org owner can access "Backend Settings" page
|
|
310
340
|
- [ ] Page lists available provider types (Convex, WordPress, Notion, Supabase)
|
|
311
341
|
- [ ] Org owner enters WordPress credentials in form
|
|
@@ -317,6 +347,7 @@ CONVEX_DEPLOYMENT_NAME=prod:shocking-falcon-870
|
|
|
317
347
|
- [ ] Next API call uses new provider automatically
|
|
318
348
|
|
|
319
349
|
**Security Requirements:**
|
|
350
|
+
|
|
320
351
|
- [ ] API keys encrypted at rest using AES-256-GCM
|
|
321
352
|
- [ ] Credentials never logged or exposed in events
|
|
322
353
|
- [ ] Only org_owner and platform_owner can see credentials
|
|
@@ -329,6 +360,7 @@ CONVEX_DEPLOYMENT_NAME=prod:shocking-falcon-870
|
|
|
329
360
|
**So that** Org A using WordPress doesn't affect Org B using Convex
|
|
330
361
|
|
|
331
362
|
**Acceptance Criteria:**
|
|
363
|
+
|
|
332
364
|
- [ ] Each organization has independent `backendProvider` config
|
|
333
365
|
- [ ] Provider registry maintains per-org provider instances
|
|
334
366
|
- [ ] Queries automatically route to correct provider based on org context
|
|
@@ -337,6 +369,7 @@ CONVEX_DEPLOYMENT_NAME=prod:shocking-falcon-870
|
|
|
337
369
|
- [ ] Health checks run per organization, not globally
|
|
338
370
|
|
|
339
371
|
**Example:**
|
|
372
|
+
|
|
340
373
|
```typescript
|
|
341
374
|
// Org A uses Convex
|
|
342
375
|
const orgAProvider = await getProviderForOrg("org_a");
|
|
@@ -354,6 +387,7 @@ await orgBProvider.query("entities", { type: "creator" }); // WordPress REST API
|
|
|
354
387
|
**So that** I can detect and fix provider issues before users are affected
|
|
355
388
|
|
|
356
389
|
**Acceptance Criteria:**
|
|
390
|
+
|
|
357
391
|
- [ ] Health check runs every 5 minutes per active provider
|
|
358
392
|
- [ ] Health check creates `communication_event` with status
|
|
359
393
|
- [ ] Dashboard shows provider health status (online, degraded, offline)
|
|
@@ -362,6 +396,7 @@ await orgBProvider.query("entities", { type: "creator" }); // WordPress REST API
|
|
|
362
396
|
- [ ] Admins can manually trigger health check
|
|
363
397
|
|
|
364
398
|
**Health Check Endpoint Examples:**
|
|
399
|
+
|
|
365
400
|
- Convex: `/_system/health`
|
|
366
401
|
- WordPress: `/wp-json/`
|
|
367
402
|
- Notion: `/v1/users/me`
|
|
@@ -374,6 +409,7 @@ await orgBProvider.query("entities", { type: "creator" }); // WordPress REST API
|
|
|
374
409
|
**So that** users can choose from more backend options
|
|
375
410
|
|
|
376
411
|
**Acceptance Criteria:**
|
|
412
|
+
|
|
377
413
|
- [ ] Provider implements `DataProvider` interface
|
|
378
414
|
- [ ] Provider registered via `registerProvider()` function
|
|
379
415
|
- [ ] Factory creates provider instance with validated config
|
|
@@ -382,6 +418,7 @@ await orgBProvider.query("entities", { type: "creator" }); // WordPress REST API
|
|
|
382
418
|
- [ ] Provider factory lazy-initializes (only creates instance when needed)
|
|
383
419
|
|
|
384
420
|
**Registration Pattern:**
|
|
421
|
+
|
|
385
422
|
```typescript
|
|
386
423
|
// backend/convex/providers/supabase.ts
|
|
387
424
|
export const SupabaseProviderFactory: ProviderFactory = {
|
|
@@ -402,6 +439,7 @@ registerProvider(SupabaseProviderFactory);
|
|
|
402
439
|
**So that** my organization isn't stuck with a broken backend
|
|
403
440
|
|
|
404
441
|
**Acceptance Criteria:**
|
|
442
|
+
|
|
405
443
|
- [ ] Organization properties store `previousProvider` reference
|
|
406
444
|
- [ ] UI shows "Rollback to Convex" button when provider changed recently
|
|
407
445
|
- [ ] Rollback creates new connection with `validFrom` = now
|
|
@@ -410,6 +448,7 @@ registerProvider(SupabaseProviderFactory);
|
|
|
410
448
|
- [ ] Rollback creates `settings_updated` event with rollback metadata
|
|
411
449
|
|
|
412
450
|
**Example Rollback:**
|
|
451
|
+
|
|
413
452
|
```typescript
|
|
414
453
|
await rollbackProvider({
|
|
415
454
|
orgId: "org_123",
|
|
@@ -437,6 +476,7 @@ await rollbackProvider({
|
|
|
437
476
|
**So that** compromised database doesn't expose credentials
|
|
438
477
|
|
|
439
478
|
**Acceptance Criteria:**
|
|
479
|
+
|
|
440
480
|
- [ ] Encryption key stored in environment variable `ENCRYPTION_KEY`
|
|
441
481
|
- [ ] AES-256-GCM used for encryption (authenticated encryption)
|
|
442
482
|
- [ ] Each credential has unique IV (initialization vector)
|
|
@@ -446,6 +486,7 @@ await rollbackProvider({
|
|
|
446
486
|
- [ ] Encryption key rotation supported (future feature)
|
|
447
487
|
|
|
448
488
|
**Encryption Flow:**
|
|
489
|
+
|
|
449
490
|
```typescript
|
|
450
491
|
// On save
|
|
451
492
|
const encrypted = await encrypt(apiKey, process.env.ENCRYPTION_KEY);
|
|
@@ -455,7 +496,7 @@ await db.patch(externalConnectionId, {
|
|
|
455
496
|
apiKey: encrypted.ciphertext,
|
|
456
497
|
apiKeyIv: encrypted.iv,
|
|
457
498
|
apiKeyAuthTag: encrypted.authTag,
|
|
458
|
-
}
|
|
499
|
+
},
|
|
459
500
|
});
|
|
460
501
|
|
|
461
502
|
// On load
|
|
@@ -474,6 +515,7 @@ const decrypted = await decrypt({
|
|
|
474
515
|
**So that** invalid configs are caught early with helpful errors
|
|
475
516
|
|
|
476
517
|
**Acceptance Criteria:**
|
|
518
|
+
|
|
477
519
|
- [ ] Each provider type has dedicated Zod schema
|
|
478
520
|
- [ ] Schema validates required fields (e.g., `CONVEX_DEPLOYMENT_URL`)
|
|
479
521
|
- [ ] Schema validates field formats (URLs, API key patterns)
|
|
@@ -482,6 +524,7 @@ const decrypted = await decrypt({
|
|
|
482
524
|
- [ ] Invalid config prevents provider initialization
|
|
483
525
|
|
|
484
526
|
**Schema Examples:**
|
|
527
|
+
|
|
485
528
|
```typescript
|
|
486
529
|
// Convex config schema
|
|
487
530
|
export const ConvexConfigSchema = z.object({
|
|
@@ -506,6 +549,7 @@ export const WordPressConfigSchema = z.object({
|
|
|
506
549
|
**So that** my team isn't waiting for backend changes
|
|
507
550
|
|
|
508
551
|
**Acceptance Criteria:**
|
|
552
|
+
|
|
509
553
|
- [ ] Provider switch completes in <30 seconds (99th percentile)
|
|
510
554
|
- [ ] Switch includes: validate → encrypt → save → initialize → health check
|
|
511
555
|
- [ ] Progress indicator shows switch steps in UI
|
|
@@ -514,6 +558,7 @@ export const WordPressConfigSchema = z.object({
|
|
|
514
558
|
- [ ] Performance metrics tracked (P50, P95, P99)
|
|
515
559
|
|
|
516
560
|
**Target Timings:**
|
|
561
|
+
|
|
517
562
|
- Validate credentials: <2s
|
|
518
563
|
- Encrypt and save: <1s
|
|
519
564
|
- Initialize provider: <5s
|
|
@@ -527,6 +572,7 @@ export const WordPressConfigSchema = z.object({
|
|
|
527
572
|
**So that** I don't need technical knowledge to switch providers
|
|
528
573
|
|
|
529
574
|
**Acceptance Criteria:**
|
|
575
|
+
|
|
530
576
|
- [ ] Settings page at `/org/[orgId]/settings/backend`
|
|
531
577
|
- [ ] Current provider shown with status badge (online/offline)
|
|
532
578
|
- [ ] Dropdown to select new provider type
|
|
@@ -534,9 +580,10 @@ export const WordPressConfigSchema = z.object({
|
|
|
534
580
|
- [ ] "Test Connection" button validates credentials before saving
|
|
535
581
|
- [ ] Success notification shows "Provider switched to WordPress"
|
|
536
582
|
- [ ] Error messages are user-friendly (not raw error logs)
|
|
537
|
-
- [ ] Credentials masked in UI (show
|
|
583
|
+
- [ ] Credentials masked in UI (show **\*\*\*** for API keys)
|
|
538
584
|
|
|
539
585
|
**UI Flow:**
|
|
586
|
+
|
|
540
587
|
1. Org owner visits `/org/acme/settings/backend`
|
|
541
588
|
2. Sees "Current Provider: Convex (Online)"
|
|
542
589
|
3. Clicks "Change Provider"
|
|
@@ -555,6 +602,7 @@ export const WordPressConfigSchema = z.object({
|
|
|
555
602
|
### Phase 1: Schema and Types (Steps 1-10)
|
|
556
603
|
|
|
557
604
|
**Step 1:** Define `ProviderConfig` type
|
|
605
|
+
|
|
558
606
|
```typescript
|
|
559
607
|
// backend/convex/providers/types.ts
|
|
560
608
|
export type ProviderType = "convex" | "wordpress" | "notion" | "supabase";
|
|
@@ -574,6 +622,7 @@ export interface EncryptedCredentials {
|
|
|
574
622
|
```
|
|
575
623
|
|
|
576
624
|
**Step 2:** Add Zod schemas for each provider
|
|
625
|
+
|
|
577
626
|
```typescript
|
|
578
627
|
// backend/convex/providers/schemas.ts
|
|
579
628
|
import { z } from "zod";
|
|
@@ -613,6 +662,7 @@ export const ProviderConfigSchema = z.discriminatedUnion("type", [
|
|
|
613
662
|
```
|
|
614
663
|
|
|
615
664
|
**Step 3:** Update organization schema
|
|
665
|
+
|
|
616
666
|
```typescript
|
|
617
667
|
// backend/convex/schema.ts
|
|
618
668
|
entities: defineTable({
|
|
@@ -622,18 +672,22 @@ entities: defineTable({
|
|
|
622
672
|
status: v.optional(v.union(/* ... */)),
|
|
623
673
|
createdAt: v.number(),
|
|
624
674
|
updatedAt: v.number(),
|
|
625
|
-
})
|
|
675
|
+
});
|
|
626
676
|
```
|
|
627
677
|
|
|
628
678
|
**Step 4:** Add indexes for external_connection queries
|
|
679
|
+
|
|
629
680
|
```typescript
|
|
630
681
|
// backend/convex/schema.ts
|
|
631
|
-
entities: defineTable({
|
|
682
|
+
entities: defineTable({
|
|
683
|
+
/* ... */
|
|
684
|
+
})
|
|
632
685
|
.index("by_type", ["type"])
|
|
633
|
-
.index("by_type_status", ["type", "status"]) // NEW: Fast external_connection queries
|
|
686
|
+
.index("by_type_status", ["type", "status"]); // NEW: Fast external_connection queries
|
|
634
687
|
```
|
|
635
688
|
|
|
636
689
|
**Step 5:** Define `ProviderFactory` interface
|
|
690
|
+
|
|
637
691
|
```typescript
|
|
638
692
|
// backend/convex/providers/factory.ts
|
|
639
693
|
import { z } from "zod";
|
|
@@ -649,18 +703,19 @@ export interface ProviderFactory {
|
|
|
649
703
|
```
|
|
650
704
|
|
|
651
705
|
**Step 6:** Create encryption utility
|
|
706
|
+
|
|
652
707
|
```typescript
|
|
653
708
|
// backend/convex/lib/encryption.ts
|
|
654
709
|
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
|
|
655
710
|
|
|
656
711
|
const ALGORITHM = "aes-256-gcm";
|
|
657
712
|
const KEY_LENGTH = 32; // 256 bits
|
|
658
|
-
const IV_LENGTH = 16;
|
|
713
|
+
const IV_LENGTH = 16; // 128 bits
|
|
659
714
|
const AUTH_TAG_LENGTH = 16;
|
|
660
715
|
|
|
661
716
|
export async function encrypt(
|
|
662
717
|
plaintext: string,
|
|
663
|
-
key: string
|
|
718
|
+
key: string,
|
|
664
719
|
): Promise<EncryptedCredentials> {
|
|
665
720
|
const keyBuffer = Buffer.from(key, "hex");
|
|
666
721
|
if (keyBuffer.length !== KEY_LENGTH) {
|
|
@@ -683,7 +738,7 @@ export async function encrypt(
|
|
|
683
738
|
|
|
684
739
|
export async function decrypt(
|
|
685
740
|
encrypted: EncryptedCredentials,
|
|
686
|
-
key: string
|
|
741
|
+
key: string,
|
|
687
742
|
): Promise<string> {
|
|
688
743
|
const keyBuffer = Buffer.from(key, "hex");
|
|
689
744
|
const ivBuffer = Buffer.from(encrypted.iv, "hex");
|
|
@@ -700,6 +755,7 @@ export async function decrypt(
|
|
|
700
755
|
```
|
|
701
756
|
|
|
702
757
|
**Step 7:** Create environment variable loader
|
|
758
|
+
|
|
703
759
|
```typescript
|
|
704
760
|
// backend/convex/config/loader.ts
|
|
705
761
|
import { ProviderConfigSchema } from "../providers/schemas";
|
|
@@ -739,6 +795,7 @@ export function loadProviderConfig(): ProviderConfig {
|
|
|
739
795
|
```
|
|
740
796
|
|
|
741
797
|
**Step 8:** Add encryption key validation
|
|
798
|
+
|
|
742
799
|
```typescript
|
|
743
800
|
// backend/convex/config/loader.ts (continued)
|
|
744
801
|
export function validateEncryptionKey(): void {
|
|
@@ -761,6 +818,7 @@ export function generateEncryptionKey(): string {
|
|
|
761
818
|
```
|
|
762
819
|
|
|
763
820
|
**Step 9:** Create provider configuration service
|
|
821
|
+
|
|
764
822
|
```typescript
|
|
765
823
|
// backend/convex/services/config/provider.ts
|
|
766
824
|
import { Effect, Context } from "effect";
|
|
@@ -769,7 +827,9 @@ import type { Id } from "../../_generated/dataModel";
|
|
|
769
827
|
export class ProviderConfigService extends Context.Tag("ProviderConfigService")<
|
|
770
828
|
ProviderConfigService,
|
|
771
829
|
{
|
|
772
|
-
getForOrganization: (
|
|
830
|
+
getForOrganization: (
|
|
831
|
+
orgId: Id<"entities">,
|
|
832
|
+
) => Effect.Effect<
|
|
773
833
|
ProviderConfig | null,
|
|
774
834
|
ConfigNotFoundError | DecryptionError
|
|
775
835
|
>;
|
|
@@ -777,13 +837,15 @@ export class ProviderConfigService extends Context.Tag("ProviderConfigService")<
|
|
|
777
837
|
saveForOrganization: (
|
|
778
838
|
orgId: Id<"entities">,
|
|
779
839
|
config: ProviderConfig,
|
|
780
|
-
actorId: Id<"entities"
|
|
840
|
+
actorId: Id<"entities">,
|
|
781
841
|
) => Effect.Effect<
|
|
782
842
|
Id<"entities">, // externalConnectionId
|
|
783
843
|
ValidationError | EncryptionError | UnauthorizedError
|
|
784
844
|
>;
|
|
785
845
|
|
|
786
|
-
testConnection: (
|
|
846
|
+
testConnection: (
|
|
847
|
+
config: ProviderConfig,
|
|
848
|
+
) => Effect.Effect<
|
|
787
849
|
{ success: true; responseTime: number },
|
|
788
850
|
ConnectionTestError
|
|
789
851
|
>;
|
|
@@ -792,6 +854,7 @@ export class ProviderConfigService extends Context.Tag("ProviderConfigService")<
|
|
|
792
854
|
```
|
|
793
855
|
|
|
794
856
|
**Step 10:** Define error types
|
|
857
|
+
|
|
795
858
|
```typescript
|
|
796
859
|
// backend/convex/services/config/errors.ts
|
|
797
860
|
export class ConfigNotFoundError {
|
|
@@ -818,7 +881,7 @@ export class UnauthorizedError {
|
|
|
818
881
|
readonly _tag = "UnauthorizedError";
|
|
819
882
|
constructor(
|
|
820
883
|
readonly userId: string,
|
|
821
|
-
readonly requiredRole: string
|
|
884
|
+
readonly requiredRole: string,
|
|
822
885
|
) {}
|
|
823
886
|
}
|
|
824
887
|
|
|
@@ -827,7 +890,7 @@ export class ConnectionTestError {
|
|
|
827
890
|
constructor(
|
|
828
891
|
readonly provider: string,
|
|
829
892
|
readonly reason: string,
|
|
830
|
-
readonly httpStatus?: number
|
|
893
|
+
readonly httpStatus?: number,
|
|
831
894
|
) {}
|
|
832
895
|
}
|
|
833
896
|
```
|
|
@@ -835,6 +898,7 @@ export class ConnectionTestError {
|
|
|
835
898
|
### Phase 2: Provider Factory (Steps 11-20)
|
|
836
899
|
|
|
837
900
|
**Step 11:** Create provider registry
|
|
901
|
+
|
|
838
902
|
```typescript
|
|
839
903
|
// backend/convex/providers/registry.ts
|
|
840
904
|
const registeredProviders = new Map<ProviderType, ProviderFactory>();
|
|
@@ -843,7 +907,9 @@ export function registerProvider(factory: ProviderFactory): void {
|
|
|
843
907
|
registeredProviders.set(factory.type, factory);
|
|
844
908
|
}
|
|
845
909
|
|
|
846
|
-
export function getProviderFactory(
|
|
910
|
+
export function getProviderFactory(
|
|
911
|
+
type: ProviderType,
|
|
912
|
+
): ProviderFactory | undefined {
|
|
847
913
|
return registeredProviders.get(type);
|
|
848
914
|
}
|
|
849
915
|
|
|
@@ -857,6 +923,7 @@ export function getProviderCapabilities(type: ProviderType): string[] {
|
|
|
857
923
|
```
|
|
858
924
|
|
|
859
925
|
**Step 12:** Implement Convex provider factory
|
|
926
|
+
|
|
860
927
|
```typescript
|
|
861
928
|
// backend/convex/providers/convex/factory.ts
|
|
862
929
|
import { ConvexProvider } from "./provider";
|
|
@@ -875,13 +942,7 @@ export const ConvexProviderFactory: ProviderFactory = {
|
|
|
875
942
|
|
|
876
943
|
validate: ConvexConfigSchema,
|
|
877
944
|
|
|
878
|
-
capabilities: [
|
|
879
|
-
"auth",
|
|
880
|
-
"realtime",
|
|
881
|
-
"storage",
|
|
882
|
-
"functions",
|
|
883
|
-
"search",
|
|
884
|
-
],
|
|
945
|
+
capabilities: ["auth", "realtime", "storage", "functions", "search"],
|
|
885
946
|
|
|
886
947
|
healthCheckUrl: (config) => `${config.url}/_system/health`,
|
|
887
948
|
};
|
|
@@ -891,6 +952,7 @@ registerProvider(ConvexProviderFactory);
|
|
|
891
952
|
```
|
|
892
953
|
|
|
893
954
|
**Step 13:** Implement WordPress provider factory
|
|
955
|
+
|
|
894
956
|
```typescript
|
|
895
957
|
// backend/convex/providers/wordpress/factory.ts
|
|
896
958
|
import { WordPressProvider } from "./provider";
|
|
@@ -910,12 +972,7 @@ export const WordPressProviderFactory: ProviderFactory = {
|
|
|
910
972
|
|
|
911
973
|
validate: WordPressConfigSchema,
|
|
912
974
|
|
|
913
|
-
capabilities: [
|
|
914
|
-
"cms",
|
|
915
|
-
"rest_api",
|
|
916
|
-
"plugins",
|
|
917
|
-
"media_library",
|
|
918
|
-
],
|
|
975
|
+
capabilities: ["cms", "rest_api", "plugins", "media_library"],
|
|
919
976
|
|
|
920
977
|
healthCheckUrl: (config) => config.baseUrl,
|
|
921
978
|
};
|
|
@@ -924,6 +981,7 @@ registerProvider(WordPressProviderFactory);
|
|
|
924
981
|
```
|
|
925
982
|
|
|
926
983
|
**Step 14:** Create provider instance cache
|
|
984
|
+
|
|
927
985
|
```typescript
|
|
928
986
|
// backend/convex/providers/cache.ts
|
|
929
987
|
const providerCache = new Map<string, DataProvider>();
|
|
@@ -946,6 +1004,7 @@ export function clearAllProviders(): void {
|
|
|
946
1004
|
```
|
|
947
1005
|
|
|
948
1006
|
**Step 15:** Implement lazy provider initialization
|
|
1007
|
+
|
|
949
1008
|
```typescript
|
|
950
1009
|
// backend/convex/providers/initializer.ts
|
|
951
1010
|
import { Effect } from "effect";
|
|
@@ -954,7 +1013,7 @@ import { getProviderFactory } from "./registry";
|
|
|
954
1013
|
|
|
955
1014
|
export const initializeProvider = (
|
|
956
1015
|
orgId: Id<"entities">,
|
|
957
|
-
config: ProviderConfig
|
|
1016
|
+
config: ProviderConfig,
|
|
958
1017
|
): Effect.Effect<DataProvider, ProviderInitError> =>
|
|
959
1018
|
Effect.gen(function* () {
|
|
960
1019
|
// Check cache first
|
|
@@ -965,16 +1024,15 @@ export const initializeProvider = (
|
|
|
965
1024
|
const factory = getProviderFactory(config.type);
|
|
966
1025
|
if (!factory) {
|
|
967
1026
|
return yield* Effect.fail(
|
|
968
|
-
new ProviderInitError(`Unknown provider type: ${config.type}`)
|
|
1027
|
+
new ProviderInitError(`Unknown provider type: ${config.type}`),
|
|
969
1028
|
);
|
|
970
1029
|
}
|
|
971
1030
|
|
|
972
1031
|
// Create provider instance
|
|
973
1032
|
const provider = yield* Effect.tryPromise({
|
|
974
1033
|
try: () => factory.create(config),
|
|
975
|
-
catch: (error) =>
|
|
976
|
-
`Failed to initialize ${config.type}: ${error}`
|
|
977
|
-
),
|
|
1034
|
+
catch: (error) =>
|
|
1035
|
+
new ProviderInitError(`Failed to initialize ${config.type}: ${error}`),
|
|
978
1036
|
});
|
|
979
1037
|
|
|
980
1038
|
// Cache for future use
|
|
@@ -985,12 +1043,13 @@ export const initializeProvider = (
|
|
|
985
1043
|
```
|
|
986
1044
|
|
|
987
1045
|
**Step 16:** Create provider switcher service
|
|
1046
|
+
|
|
988
1047
|
```typescript
|
|
989
1048
|
// backend/convex/services/config/switcher.ts
|
|
990
1049
|
export const switchProvider = (
|
|
991
1050
|
orgId: Id<"entities">,
|
|
992
1051
|
newConfig: ProviderConfig,
|
|
993
|
-
actorId: Id<"entities"
|
|
1052
|
+
actorId: Id<"entities">,
|
|
994
1053
|
): Effect.Effect<
|
|
995
1054
|
{ switchDuration: number; configId: Id<"entities"> },
|
|
996
1055
|
ValidationError | EncryptionError | UnauthorizedError | ConnectionTestError
|
|
@@ -1002,7 +1061,7 @@ export const switchProvider = (
|
|
|
1002
1061
|
const factory = getProviderFactory(newConfig.type);
|
|
1003
1062
|
if (!factory) {
|
|
1004
1063
|
return yield* Effect.fail(
|
|
1005
|
-
new ValidationError(`Unknown provider: ${newConfig.type}`)
|
|
1064
|
+
new ValidationError(`Unknown provider: ${newConfig.type}`),
|
|
1006
1065
|
);
|
|
1007
1066
|
}
|
|
1008
1067
|
|
|
@@ -1032,10 +1091,11 @@ export const switchProvider = (
|
|
|
1032
1091
|
```
|
|
1033
1092
|
|
|
1034
1093
|
**Step 17:** Implement connection test
|
|
1094
|
+
|
|
1035
1095
|
```typescript
|
|
1036
1096
|
// backend/convex/services/config/tester.ts
|
|
1037
1097
|
export const testConnection = (
|
|
1038
|
-
config: ProviderConfig
|
|
1098
|
+
config: ProviderConfig,
|
|
1039
1099
|
): Effect.Effect<
|
|
1040
1100
|
{ success: true; responseTime: number },
|
|
1041
1101
|
ConnectionTestError
|
|
@@ -1052,11 +1112,12 @@ export const testConnection = (
|
|
|
1052
1112
|
|
|
1053
1113
|
const response = yield* Effect.tryPromise({
|
|
1054
1114
|
try: () => fetch(url, { method: "GET", timeout: 5000 }),
|
|
1055
|
-
catch: (error) =>
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1115
|
+
catch: (error) =>
|
|
1116
|
+
new ConnectionTestError(
|
|
1117
|
+
config.type,
|
|
1118
|
+
`Health check failed: ${error}`,
|
|
1119
|
+
undefined,
|
|
1120
|
+
),
|
|
1060
1121
|
});
|
|
1061
1122
|
|
|
1062
1123
|
if (!response.ok) {
|
|
@@ -1064,8 +1125,8 @@ export const testConnection = (
|
|
|
1064
1125
|
new ConnectionTestError(
|
|
1065
1126
|
config.type,
|
|
1066
1127
|
`Health check returned ${response.status}`,
|
|
1067
|
-
response.status
|
|
1068
|
-
)
|
|
1128
|
+
response.status,
|
|
1129
|
+
),
|
|
1069
1130
|
);
|
|
1070
1131
|
}
|
|
1071
1132
|
|
|
@@ -1075,16 +1136,17 @@ export const testConnection = (
|
|
|
1075
1136
|
```
|
|
1076
1137
|
|
|
1077
1138
|
**Step 18:** Implement credential encryption helper
|
|
1139
|
+
|
|
1078
1140
|
```typescript
|
|
1079
1141
|
// backend/convex/services/config/encryption.ts
|
|
1080
1142
|
export const encryptCredentials = (
|
|
1081
|
-
config: ProviderConfig
|
|
1143
|
+
config: ProviderConfig,
|
|
1082
1144
|
): Effect.Effect<EncryptedConfig, EncryptionError> =>
|
|
1083
1145
|
Effect.gen(function* () {
|
|
1084
1146
|
const key = process.env.ENCRYPTION_KEY;
|
|
1085
1147
|
if (!key) {
|
|
1086
1148
|
return yield* Effect.fail(
|
|
1087
|
-
new EncryptionError("ENCRYPTION_KEY not configured")
|
|
1149
|
+
new EncryptionError("ENCRYPTION_KEY not configured"),
|
|
1088
1150
|
);
|
|
1089
1151
|
}
|
|
1090
1152
|
|
|
@@ -1094,9 +1156,8 @@ export const encryptCredentials = (
|
|
|
1094
1156
|
for (const [field, value] of Object.entries(credentials)) {
|
|
1095
1157
|
encrypted[field] = yield* Effect.tryPromise({
|
|
1096
1158
|
try: () => encrypt(value, key),
|
|
1097
|
-
catch: (error) =>
|
|
1098
|
-
`Failed to encrypt ${field}: ${error}`
|
|
1099
|
-
),
|
|
1159
|
+
catch: (error) =>
|
|
1160
|
+
new EncryptionError(`Failed to encrypt ${field}: ${error}`),
|
|
1100
1161
|
});
|
|
1101
1162
|
}
|
|
1102
1163
|
|
|
@@ -1123,6 +1184,7 @@ function extractCredentials(config: ProviderConfig): Record<string, string> {
|
|
|
1123
1184
|
```
|
|
1124
1185
|
|
|
1125
1186
|
**Step 19:** Implement config save mutation
|
|
1187
|
+
|
|
1126
1188
|
```typescript
|
|
1127
1189
|
// backend/convex/mutations/config.ts
|
|
1128
1190
|
export const saveProviderConfig = mutation({
|
|
@@ -1145,14 +1207,15 @@ export const saveProviderConfig = mutation({
|
|
|
1145
1207
|
// Use Effect service
|
|
1146
1208
|
return await Effect.runPromise(
|
|
1147
1209
|
switchProvider(args.orgId, args.config, actor._id).pipe(
|
|
1148
|
-
Effect.provide(ConfigServiceLayer)
|
|
1149
|
-
)
|
|
1210
|
+
Effect.provide(ConfigServiceLayer),
|
|
1211
|
+
),
|
|
1150
1212
|
);
|
|
1151
1213
|
},
|
|
1152
1214
|
});
|
|
1153
1215
|
```
|
|
1154
1216
|
|
|
1155
1217
|
**Step 20:** Register all provider factories on startup
|
|
1218
|
+
|
|
1156
1219
|
```typescript
|
|
1157
1220
|
// backend/convex/providers/index.ts
|
|
1158
1221
|
import "./convex/factory";
|
|
@@ -1168,25 +1231,26 @@ export * from "./initializer";
|
|
|
1168
1231
|
### Phase 3: Multi-Tenant Provider Access (Steps 21-30)
|
|
1169
1232
|
|
|
1170
1233
|
**Step 21:** Create organization context service
|
|
1234
|
+
|
|
1171
1235
|
```typescript
|
|
1172
1236
|
// backend/convex/services/context/organization.ts
|
|
1173
1237
|
export class OrganizationContext extends Context.Tag("OrganizationContext")<
|
|
1174
1238
|
OrganizationContext,
|
|
1175
1239
|
{
|
|
1176
1240
|
getCurrentOrg: () => Effect.Effect<Id<"entities">, OrgNotFoundError>;
|
|
1177
|
-
getOrgProvider: (
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
>;
|
|
1241
|
+
getOrgProvider: (
|
|
1242
|
+
orgId: Id<"entities">,
|
|
1243
|
+
) => Effect.Effect<DataProvider, ConfigNotFoundError | ProviderInitError>;
|
|
1181
1244
|
}
|
|
1182
1245
|
>() {}
|
|
1183
1246
|
```
|
|
1184
1247
|
|
|
1185
1248
|
**Step 22:** Implement provider resolver
|
|
1249
|
+
|
|
1186
1250
|
```typescript
|
|
1187
1251
|
// backend/convex/services/context/resolver.ts
|
|
1188
1252
|
export const resolveProviderForOrg = (
|
|
1189
|
-
orgId: Id<"entities"
|
|
1253
|
+
orgId: Id<"entities">,
|
|
1190
1254
|
): Effect.Effect<DataProvider, ConfigNotFoundError | ProviderInitError> =>
|
|
1191
1255
|
Effect.gen(function* () {
|
|
1192
1256
|
// Check cache
|
|
@@ -1214,10 +1278,11 @@ export const resolveProviderForOrg = (
|
|
|
1214
1278
|
```
|
|
1215
1279
|
|
|
1216
1280
|
**Step 23:** Implement config loader from external_connection
|
|
1281
|
+
|
|
1217
1282
|
```typescript
|
|
1218
1283
|
// backend/convex/services/config/loader.ts
|
|
1219
1284
|
export const loadExternalConnection = (
|
|
1220
|
-
configId: Id<"entities"
|
|
1285
|
+
configId: Id<"entities">,
|
|
1221
1286
|
): Effect.Effect<ProviderConfig, ConfigNotFoundError | DecryptionError> =>
|
|
1222
1287
|
Effect.gen(function* () {
|
|
1223
1288
|
const config = yield* Effect.tryPromise(() => db.get(configId));
|
|
@@ -1228,7 +1293,7 @@ export const loadExternalConnection = (
|
|
|
1228
1293
|
|
|
1229
1294
|
if (config.status !== "active") {
|
|
1230
1295
|
return yield* Effect.fail(
|
|
1231
|
-
new ConfigNotFoundError(`Config ${configId} is inactive`)
|
|
1296
|
+
new ConfigNotFoundError(`Config ${configId} is inactive`),
|
|
1232
1297
|
);
|
|
1233
1298
|
}
|
|
1234
1299
|
|
|
@@ -1244,14 +1309,11 @@ export const loadExternalConnection = (
|
|
|
1244
1309
|
```
|
|
1245
1310
|
|
|
1246
1311
|
**Step 24:** Create scoped query wrapper
|
|
1312
|
+
|
|
1247
1313
|
```typescript
|
|
1248
1314
|
// backend/convex/queries/scoped.ts
|
|
1249
1315
|
export const createScopedQuery = <Args, Result>(
|
|
1250
|
-
fn: (
|
|
1251
|
-
ctx: QueryCtx,
|
|
1252
|
-
args: Args,
|
|
1253
|
-
provider: DataProvider
|
|
1254
|
-
) => Promise<Result>
|
|
1316
|
+
fn: (ctx: QueryCtx, args: Args, provider: DataProvider) => Promise<Result>,
|
|
1255
1317
|
) => {
|
|
1256
1318
|
return query({
|
|
1257
1319
|
handler: async (ctx, args) => {
|
|
@@ -1272,8 +1334,8 @@ export const createScopedQuery = <Args, Result>(
|
|
|
1272
1334
|
// Resolve provider for org
|
|
1273
1335
|
const provider = await Effect.runPromise(
|
|
1274
1336
|
resolveProviderForOrg(user.properties.organizationId).pipe(
|
|
1275
|
-
Effect.provide(ConfigServiceLayer)
|
|
1276
|
-
)
|
|
1337
|
+
Effect.provide(ConfigServiceLayer),
|
|
1338
|
+
),
|
|
1277
1339
|
);
|
|
1278
1340
|
|
|
1279
1341
|
// Execute query with scoped provider
|
|
@@ -1284,6 +1346,7 @@ export const createScopedQuery = <Args, Result>(
|
|
|
1284
1346
|
```
|
|
1285
1347
|
|
|
1286
1348
|
**Step 25:** Example scoped query usage
|
|
1349
|
+
|
|
1287
1350
|
```typescript
|
|
1288
1351
|
// backend/convex/queries/entities.ts
|
|
1289
1352
|
export const list = createScopedQuery(
|
|
@@ -1292,11 +1355,12 @@ export const list = createScopedQuery(
|
|
|
1292
1355
|
return await provider.query("entities", {
|
|
1293
1356
|
where: { type: args.type },
|
|
1294
1357
|
});
|
|
1295
|
-
}
|
|
1358
|
+
},
|
|
1296
1359
|
);
|
|
1297
1360
|
```
|
|
1298
1361
|
|
|
1299
1362
|
**Step 26:** Create scoped mutation wrapper
|
|
1363
|
+
|
|
1300
1364
|
```typescript
|
|
1301
1365
|
// backend/convex/mutations/scoped.ts
|
|
1302
1366
|
export const createScopedMutation = <Args, Result>(
|
|
@@ -1304,8 +1368,8 @@ export const createScopedMutation = <Args, Result>(
|
|
|
1304
1368
|
ctx: MutationCtx,
|
|
1305
1369
|
args: Args,
|
|
1306
1370
|
provider: DataProvider,
|
|
1307
|
-
orgId: Id<"entities"
|
|
1308
|
-
) => Promise<Result
|
|
1371
|
+
orgId: Id<"entities">,
|
|
1372
|
+
) => Promise<Result>,
|
|
1309
1373
|
) => {
|
|
1310
1374
|
return mutation({
|
|
1311
1375
|
handler: async (ctx, args) => {
|
|
@@ -1323,8 +1387,8 @@ export const createScopedMutation = <Args, Result>(
|
|
|
1323
1387
|
|
|
1324
1388
|
const provider = await Effect.runPromise(
|
|
1325
1389
|
resolveProviderForOrg(user.properties.organizationId).pipe(
|
|
1326
|
-
Effect.provide(ConfigServiceLayer)
|
|
1327
|
-
)
|
|
1390
|
+
Effect.provide(ConfigServiceLayer),
|
|
1391
|
+
),
|
|
1328
1392
|
);
|
|
1329
1393
|
|
|
1330
1394
|
return await fn(ctx, args, provider, user.properties.organizationId);
|
|
@@ -1334,10 +1398,11 @@ export const createScopedMutation = <Args, Result>(
|
|
|
1334
1398
|
```
|
|
1335
1399
|
|
|
1336
1400
|
**Step 27:** Implement provider health check
|
|
1401
|
+
|
|
1337
1402
|
```typescript
|
|
1338
1403
|
// backend/convex/services/health/checker.ts
|
|
1339
1404
|
export const checkProviderHealth = (
|
|
1340
|
-
configId: Id<"entities"
|
|
1405
|
+
configId: Id<"entities">,
|
|
1341
1406
|
): Effect.Effect<
|
|
1342
1407
|
{ status: "online" | "offline"; responseTime: number },
|
|
1343
1408
|
ConnectionTestError
|
|
@@ -1353,27 +1418,28 @@ export const checkProviderHealth = (
|
|
|
1353
1418
|
```
|
|
1354
1419
|
|
|
1355
1420
|
**Step 28:** Create scheduled health check action
|
|
1421
|
+
|
|
1356
1422
|
```typescript
|
|
1357
1423
|
// backend/convex/crons/health.ts
|
|
1358
1424
|
export const healthCheckCron = cronJobs.interval(
|
|
1359
1425
|
"provider-health-check",
|
|
1360
1426
|
{ minutes: 5 },
|
|
1361
|
-
internal.health.checkAllProviders
|
|
1427
|
+
internal.health.checkAllProviders,
|
|
1362
1428
|
);
|
|
1363
1429
|
|
|
1364
1430
|
export const checkAllProviders = internalAction({
|
|
1365
1431
|
handler: async (ctx) => {
|
|
1366
1432
|
// Get all active external_connection entities
|
|
1367
1433
|
const configs = await ctx.runQuery(
|
|
1368
|
-
internal.queries.config.listActiveConfigs
|
|
1434
|
+
internal.queries.config.listActiveConfigs,
|
|
1369
1435
|
);
|
|
1370
1436
|
|
|
1371
1437
|
for (const config of configs) {
|
|
1372
1438
|
try {
|
|
1373
1439
|
const health = await Effect.runPromise(
|
|
1374
1440
|
checkProviderHealth(config._id).pipe(
|
|
1375
|
-
Effect.provide(HealthCheckLayer)
|
|
1376
|
-
)
|
|
1441
|
+
Effect.provide(HealthCheckLayer),
|
|
1442
|
+
),
|
|
1377
1443
|
);
|
|
1378
1444
|
|
|
1379
1445
|
// Log health event
|
|
@@ -1396,12 +1462,13 @@ export const checkAllProviders = internalAction({
|
|
|
1396
1462
|
```
|
|
1397
1463
|
|
|
1398
1464
|
**Step 29:** Implement provider usage tracking
|
|
1465
|
+
|
|
1399
1466
|
```typescript
|
|
1400
1467
|
// backend/convex/services/usage/tracker.ts
|
|
1401
1468
|
export const trackProviderUsage = (
|
|
1402
1469
|
orgId: Id<"entities">,
|
|
1403
1470
|
operation: string,
|
|
1404
|
-
duration: number
|
|
1471
|
+
duration: number,
|
|
1405
1472
|
): Effect.Effect<void, never> =>
|
|
1406
1473
|
Effect.gen(function* () {
|
|
1407
1474
|
// Create usage event
|
|
@@ -1416,7 +1483,7 @@ export const trackProviderUsage = (
|
|
|
1416
1483
|
operation,
|
|
1417
1484
|
duration,
|
|
1418
1485
|
},
|
|
1419
|
-
})
|
|
1486
|
+
}),
|
|
1420
1487
|
);
|
|
1421
1488
|
|
|
1422
1489
|
// Update organization usage metrics (if needed)
|
|
@@ -1425,6 +1492,7 @@ export const trackProviderUsage = (
|
|
|
1425
1492
|
```
|
|
1426
1493
|
|
|
1427
1494
|
**Step 30:** Add provider metrics query
|
|
1495
|
+
|
|
1428
1496
|
```typescript
|
|
1429
1497
|
// backend/convex/queries/metrics.ts
|
|
1430
1498
|
export const getProviderMetrics = query({
|
|
@@ -1439,8 +1507,8 @@ export const getProviderMetrics = query({
|
|
|
1439
1507
|
q.and(
|
|
1440
1508
|
q.eq(q.field("type"), "communication_event"),
|
|
1441
1509
|
q.eq(q.field("actorId"), args.orgId),
|
|
1442
|
-
q.eq(q.field("metadata.protocol"), "provider_usage")
|
|
1443
|
-
)
|
|
1510
|
+
q.eq(q.field("metadata.protocol"), "provider_usage"),
|
|
1511
|
+
),
|
|
1444
1512
|
)
|
|
1445
1513
|
.collect();
|
|
1446
1514
|
|
|
@@ -1458,6 +1526,7 @@ export const getProviderMetrics = query({
|
|
|
1458
1526
|
### Phase 4: Frontend Integration (Steps 31-40)
|
|
1459
1527
|
|
|
1460
1528
|
**Step 31:** Create provider config form component
|
|
1529
|
+
|
|
1461
1530
|
```typescript
|
|
1462
1531
|
// frontend/src/components/features/config/ProviderConfigForm.tsx
|
|
1463
1532
|
import { useState } from "react";
|
|
@@ -1564,6 +1633,7 @@ export function ProviderConfigForm({ orgId }: { orgId: Id<"entities"> }) {
|
|
|
1564
1633
|
```
|
|
1565
1634
|
|
|
1566
1635
|
**Step 32:** Create provider status badge
|
|
1636
|
+
|
|
1567
1637
|
```typescript
|
|
1568
1638
|
// frontend/src/components/features/config/ProviderStatusBadge.tsx
|
|
1569
1639
|
import { useQuery } from "convex/react";
|
|
@@ -1584,6 +1654,7 @@ export function ProviderStatusBadge({ orgId }: { orgId: Id<"entities"> }) {
|
|
|
1584
1654
|
```
|
|
1585
1655
|
|
|
1586
1656
|
**Step 33:** Create settings page
|
|
1657
|
+
|
|
1587
1658
|
```typescript
|
|
1588
1659
|
// frontend/src/pages/org/[orgId]/settings/backend.astro
|
|
1589
1660
|
---
|
|
@@ -1607,6 +1678,7 @@ const { orgId } = Astro.params;
|
|
|
1607
1678
|
```
|
|
1608
1679
|
|
|
1609
1680
|
**Step 34:** Add provider metrics dashboard
|
|
1681
|
+
|
|
1610
1682
|
```typescript
|
|
1611
1683
|
// frontend/src/components/features/config/ProviderMetrics.tsx
|
|
1612
1684
|
import { useQuery } from "convex/react";
|
|
@@ -1649,6 +1721,7 @@ export function ProviderMetrics({ orgId }: { orgId: Id<"entities"> }) {
|
|
|
1649
1721
|
```
|
|
1650
1722
|
|
|
1651
1723
|
**Step 35:** Implement rollback UI
|
|
1724
|
+
|
|
1652
1725
|
```typescript
|
|
1653
1726
|
// frontend/src/components/features/config/ProviderRollback.tsx
|
|
1654
1727
|
import { useMutation, useQuery } from "convex/react";
|
|
@@ -1691,6 +1764,7 @@ export function ProviderRollback({ orgId }: { orgId: Id<"entities"> }) {
|
|
|
1691
1764
|
```
|
|
1692
1765
|
|
|
1693
1766
|
**Step 36:** Add provider switch confirmation dialog
|
|
1767
|
+
|
|
1694
1768
|
```typescript
|
|
1695
1769
|
// frontend/src/components/features/config/SwitchConfirmDialog.tsx
|
|
1696
1770
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
|
@@ -1752,6 +1826,7 @@ export function SwitchConfirmDialog({
|
|
|
1752
1826
|
```
|
|
1753
1827
|
|
|
1754
1828
|
**Step 37:** Create provider health monitoring page
|
|
1829
|
+
|
|
1755
1830
|
```typescript
|
|
1756
1831
|
// frontend/src/pages/admin/providers.astro
|
|
1757
1832
|
---
|
|
@@ -1774,6 +1849,7 @@ if (user?.role !== "platform_owner") {
|
|
|
1774
1849
|
```
|
|
1775
1850
|
|
|
1776
1851
|
**Step 38:** Implement health list component
|
|
1852
|
+
|
|
1777
1853
|
```typescript
|
|
1778
1854
|
// frontend/src/components/features/config/ProviderHealthList.tsx
|
|
1779
1855
|
import { useQuery } from "convex/react";
|
|
@@ -1821,6 +1897,7 @@ export function ProviderHealthList() {
|
|
|
1821
1897
|
```
|
|
1822
1898
|
|
|
1823
1899
|
**Step 39:** Add loading state during switch
|
|
1900
|
+
|
|
1824
1901
|
```typescript
|
|
1825
1902
|
// frontend/src/components/features/config/SwitchProgress.tsx
|
|
1826
1903
|
import { Progress } from "@/components/ui/progress";
|
|
@@ -1862,6 +1939,7 @@ export function SwitchProgress({ progress }: { progress: number }) {
|
|
|
1862
1939
|
```
|
|
1863
1940
|
|
|
1864
1941
|
**Step 40:** Add error boundary for provider errors
|
|
1942
|
+
|
|
1865
1943
|
```typescript
|
|
1866
1944
|
// frontend/src/components/features/config/ProviderErrorBoundary.tsx
|
|
1867
1945
|
import { Component, ReactNode } from "react";
|
|
@@ -1908,6 +1986,7 @@ export class ProviderErrorBoundary extends Component<Props, State> {
|
|
|
1908
1986
|
### Phase 5: Testing and Documentation (Steps 41-50)
|
|
1909
1987
|
|
|
1910
1988
|
**Step 41:** Write unit tests for encryption
|
|
1989
|
+
|
|
1911
1990
|
```typescript
|
|
1912
1991
|
// backend/convex/lib/encryption.test.ts
|
|
1913
1992
|
import { describe, it, expect } from "vitest";
|
|
@@ -1957,6 +2036,7 @@ describe("Encryption", () => {
|
|
|
1957
2036
|
```
|
|
1958
2037
|
|
|
1959
2038
|
**Step 42:** Write integration tests for provider switching
|
|
2039
|
+
|
|
1960
2040
|
```typescript
|
|
1961
2041
|
// backend/convex/services/config/switcher.test.ts
|
|
1962
2042
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
@@ -1979,8 +2059,8 @@ describe("Provider Switching", () => {
|
|
|
1979
2059
|
username: "admin",
|
|
1980
2060
|
applicationPassword: "xxxx xxxx xxxx xxxx",
|
|
1981
2061
|
},
|
|
1982
|
-
"user_456"
|
|
1983
|
-
).pipe(Effect.provide(TestLayer))
|
|
2062
|
+
"user_456",
|
|
2063
|
+
).pipe(Effect.provide(TestLayer)),
|
|
1984
2064
|
);
|
|
1985
2065
|
|
|
1986
2066
|
expect(result.switchDuration).toBeLessThan(30000);
|
|
@@ -1998,9 +2078,9 @@ describe("Provider Switching", () => {
|
|
|
1998
2078
|
username: "admin",
|
|
1999
2079
|
applicationPassword: "wrong",
|
|
2000
2080
|
},
|
|
2001
|
-
"user_456"
|
|
2002
|
-
).pipe(Effect.provide(TestLayer))
|
|
2003
|
-
)
|
|
2081
|
+
"user_456",
|
|
2082
|
+
).pipe(Effect.provide(TestLayer)),
|
|
2083
|
+
),
|
|
2004
2084
|
).rejects.toThrow("Connection test failed");
|
|
2005
2085
|
|
|
2006
2086
|
// Verify org still using old provider
|
|
@@ -2018,12 +2098,14 @@ describe("Provider Switching", () => {
|
|
|
2018
2098
|
username: "admin",
|
|
2019
2099
|
applicationPassword: "plaintext-password",
|
|
2020
2100
|
},
|
|
2021
|
-
"user_456"
|
|
2022
|
-
).pipe(Effect.provide(TestLayer))
|
|
2101
|
+
"user_456",
|
|
2102
|
+
).pipe(Effect.provide(TestLayer)),
|
|
2023
2103
|
);
|
|
2024
2104
|
|
|
2025
2105
|
const config = await getEntity(result.configId);
|
|
2026
|
-
expect(config.properties.config.applicationPassword).not.toBe(
|
|
2106
|
+
expect(config.properties.config.applicationPassword).not.toBe(
|
|
2107
|
+
"plaintext-password",
|
|
2108
|
+
);
|
|
2027
2109
|
expect(config.properties.apiKeyIv).toBeDefined();
|
|
2028
2110
|
expect(config.properties.apiKeyAuthTag).toBeDefined();
|
|
2029
2111
|
});
|
|
@@ -2031,6 +2113,7 @@ describe("Provider Switching", () => {
|
|
|
2031
2113
|
```
|
|
2032
2114
|
|
|
2033
2115
|
**Step 43:** Write E2E test for provider switch UI
|
|
2116
|
+
|
|
2034
2117
|
```typescript
|
|
2035
2118
|
// frontend/tests/e2e/provider-switch.test.ts
|
|
2036
2119
|
import { test, expect } from "@playwright/test";
|
|
@@ -2050,9 +2133,15 @@ test("org owner can switch backend provider", async ({ page }) => {
|
|
|
2050
2133
|
|
|
2051
2134
|
// Change to WordPress
|
|
2052
2135
|
await page.selectOption('select[name="providerType"]', "wordpress");
|
|
2053
|
-
await page.fill(
|
|
2136
|
+
await page.fill(
|
|
2137
|
+
'input[placeholder="WordPress URL"]',
|
|
2138
|
+
"https://example.com/wp-json",
|
|
2139
|
+
);
|
|
2054
2140
|
await page.fill('input[placeholder="Username"]', "admin");
|
|
2055
|
-
await page.fill(
|
|
2141
|
+
await page.fill(
|
|
2142
|
+
'input[placeholder="Application Password"]',
|
|
2143
|
+
"xxxx xxxx xxxx xxxx",
|
|
2144
|
+
);
|
|
2056
2145
|
|
|
2057
2146
|
// Test connection
|
|
2058
2147
|
await page.click("button:has-text('Test Connection')");
|
|
@@ -2067,13 +2156,17 @@ test("org owner can switch backend provider", async ({ page }) => {
|
|
|
2067
2156
|
});
|
|
2068
2157
|
|
|
2069
2158
|
// Verify rollback button appears
|
|
2070
|
-
await expect(
|
|
2159
|
+
await expect(
|
|
2160
|
+
page.locator("button:has-text('Rollback to Convex')"),
|
|
2161
|
+
).toBeVisible();
|
|
2071
2162
|
});
|
|
2072
2163
|
```
|
|
2073
2164
|
|
|
2074
2165
|
**Step 44:** Document environment variables
|
|
2166
|
+
|
|
2075
2167
|
```markdown
|
|
2076
2168
|
<!-- /Users/toc/Server/ONE/one/things/features/2-2-config-env-vars.md -->
|
|
2169
|
+
|
|
2077
2170
|
# Backend Provider Environment Variables
|
|
2078
2171
|
|
|
2079
2172
|
## Encryption
|
|
@@ -2081,7 +2174,9 @@ test("org owner can switch backend provider", async ({ page }) => {
|
|
|
2081
2174
|
Required for all configurations:
|
|
2082
2175
|
|
|
2083
2176
|
\`\`\`bash
|
|
2177
|
+
|
|
2084
2178
|
# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
|
|
2179
|
+
|
|
2085
2180
|
ENCRYPTION_KEY=64-character-hex-string
|
|
2086
2181
|
\`\`\`
|
|
2087
2182
|
|
|
@@ -2107,6 +2202,7 @@ WORDPRESS_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
|
|
2107
2202
|
\`\`\`
|
|
2108
2203
|
|
|
2109
2204
|
Generate WordPress Application Password:
|
|
2205
|
+
|
|
2110
2206
|
1. Login to WordPress admin
|
|
2111
2207
|
2. Users → Profile
|
|
2112
2208
|
3. Scroll to "Application Passwords"
|
|
@@ -2123,6 +2219,7 @@ NOTION_DATABASE_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
2123
2219
|
\`\`\`
|
|
2124
2220
|
|
|
2125
2221
|
Get Notion credentials:
|
|
2222
|
+
|
|
2126
2223
|
1. Go to https://www.notion.so/my-integrations
|
|
2127
2224
|
2. Create new integration
|
|
2128
2225
|
3. Copy "Internal Integration Token"
|
|
@@ -2146,13 +2243,16 @@ Runtime config stored in \`external_connection\` entities.
|
|
|
2146
2243
|
```
|
|
2147
2244
|
|
|
2148
2245
|
**Step 45:** Create configuration guide
|
|
2246
|
+
|
|
2149
2247
|
```markdown
|
|
2150
2248
|
<!-- /Users/toc/Server/ONE/one/things/features/2-2-config-guide.md -->
|
|
2249
|
+
|
|
2151
2250
|
# Backend Provider Configuration Guide
|
|
2152
2251
|
|
|
2153
2252
|
## Overview
|
|
2154
2253
|
|
|
2155
2254
|
ONE Platform supports multiple backend providers:
|
|
2255
|
+
|
|
2156
2256
|
- Convex (default, real-time database)
|
|
2157
2257
|
- WordPress (REST API, existing sites)
|
|
2158
2258
|
- Notion (databases as backend)
|
|
@@ -2203,26 +2303,31 @@ If new provider has issues:
|
|
|
2203
2303
|
### Troubleshooting
|
|
2204
2304
|
|
|
2205
2305
|
**Provider shows "Offline":**
|
|
2306
|
+
|
|
2206
2307
|
- Check credentials are correct
|
|
2207
2308
|
- Verify provider URL is accessible
|
|
2208
2309
|
- Check provider service status (e.g., WordPress site up?)
|
|
2209
2310
|
- View error details in provider settings
|
|
2210
2311
|
|
|
2211
2312
|
**Switch takes >30 seconds:**
|
|
2313
|
+
|
|
2212
2314
|
- Check network connection
|
|
2213
2315
|
- Verify provider responds to health checks
|
|
2214
2316
|
- Contact support if persists
|
|
2215
2317
|
|
|
2216
2318
|
**Can't save credentials:**
|
|
2319
|
+
|
|
2217
2320
|
- Verify you're org_owner (not org_user)
|
|
2218
2321
|
- Check credentials match expected format
|
|
2219
2322
|
- Ensure "Test Connection" passes first
|
|
2220
|
-
\`\`\`
|
|
2323
|
+
\`\`\`
|
|
2221
2324
|
```
|
|
2222
2325
|
|
|
2223
2326
|
**Step 46:** Add troubleshooting guide
|
|
2327
|
+
|
|
2224
2328
|
```markdown
|
|
2225
2329
|
<!-- /Users/toc/Server/ONE/one/things/features/2-2-troubleshooting.md -->
|
|
2330
|
+
|
|
2226
2331
|
# Provider Configuration Troubleshooting
|
|
2227
2332
|
|
|
2228
2333
|
## Common Issues
|
|
@@ -2232,6 +2337,7 @@ If new provider has issues:
|
|
|
2232
2337
|
**Error:** "ENCRYPTION_KEY not configured"
|
|
2233
2338
|
|
|
2234
2339
|
**Solution:**
|
|
2340
|
+
|
|
2235
2341
|
1. Generate key: \`node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"\`
|
|
2236
2342
|
2. Add to \`.env.local\`: \`ENCRYPTION_KEY=<generated-key>\`
|
|
2237
2343
|
3. Restart Convex
|
|
@@ -2241,13 +2347,15 @@ If new provider has issues:
|
|
|
2241
2347
|
**Error:** "Invalid WordPress URL"
|
|
2242
2348
|
|
|
2243
2349
|
**Solution:**
|
|
2350
|
+
|
|
2244
2351
|
- WordPress URL must end with \`/wp-json\`
|
|
2245
2352
|
- Example: \`https://example.com/wp-json\` (not \`https://example.com\`)
|
|
2246
2353
|
|
|
2247
2354
|
**Error:** "Invalid Notion token"
|
|
2248
2355
|
|
|
2249
2356
|
**Solution:**
|
|
2250
|
-
|
|
2357
|
+
|
|
2358
|
+
- Token must start with \`secret\_\`
|
|
2251
2359
|
- Regenerate token in Notion integrations if needed
|
|
2252
2360
|
|
|
2253
2361
|
### Connection Test Failed
|
|
@@ -2255,6 +2363,7 @@ If new provider has issues:
|
|
|
2255
2363
|
**Error:** "Health check returned 404"
|
|
2256
2364
|
|
|
2257
2365
|
**Solution (WordPress):**
|
|
2366
|
+
|
|
2258
2367
|
- Ensure WordPress site is accessible
|
|
2259
2368
|
- Verify REST API enabled (not disabled by security plugin)
|
|
2260
2369
|
- Test manually: \`curl https://example.com/wp-json/\`
|
|
@@ -2262,6 +2371,7 @@ If new provider has issues:
|
|
|
2262
2371
|
**Error:** "Unauthorized"
|
|
2263
2372
|
|
|
2264
2373
|
**Solution:**
|
|
2374
|
+
|
|
2265
2375
|
- Check credentials are correct
|
|
2266
2376
|
- WordPress: Regenerate application password
|
|
2267
2377
|
- Notion: Verify integration has database access
|
|
@@ -2272,6 +2382,7 @@ If new provider has issues:
|
|
|
2272
2382
|
**Error:** "Provider switch exceeded 30 seconds"
|
|
2273
2383
|
|
|
2274
2384
|
**Solution:**
|
|
2385
|
+
|
|
2275
2386
|
- Check network connection
|
|
2276
2387
|
- Verify provider responds quickly
|
|
2277
2388
|
- Try again (may be temporary network issue)
|
|
@@ -2298,16 +2409,18 @@ If new provider has issues:
|
|
|
2298
2409
|
4. Check event logs:
|
|
2299
2410
|
\`\`\`typescript
|
|
2300
2411
|
const events = await ctx.db.query("events")
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2412
|
+
.withIndex("by_type", q => q.eq("type", "settings_updated"))
|
|
2413
|
+
.order("desc")
|
|
2414
|
+
.take(10);
|
|
2415
|
+
\`\`\`
|
|
2304
2416
|
\`\`\`
|
|
2305
|
-
\`\`\`
|
|
2306
2417
|
```
|
|
2307
2418
|
|
|
2308
2419
|
**Step 47:** Write API reference
|
|
2420
|
+
|
|
2309
2421
|
```markdown
|
|
2310
2422
|
<!-- /Users/toc/Server/ONE/one/things/features/2-2-api-reference.md -->
|
|
2423
|
+
|
|
2311
2424
|
# Provider Configuration API Reference
|
|
2312
2425
|
|
|
2313
2426
|
## Mutations
|
|
@@ -2319,23 +2432,24 @@ Save new provider configuration for organization.
|
|
|
2319
2432
|
**Args:**
|
|
2320
2433
|
\`\`\`typescript
|
|
2321
2434
|
{
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2435
|
+
orgId: Id<"entities">,
|
|
2436
|
+
config: {
|
|
2437
|
+
type: "convex" | "wordpress" | "notion" | "supabase",
|
|
2438
|
+
// Provider-specific fields
|
|
2439
|
+
}
|
|
2327
2440
|
}
|
|
2328
2441
|
\`\`\`
|
|
2329
2442
|
|
|
2330
2443
|
**Returns:**
|
|
2331
2444
|
\`\`\`typescript
|
|
2332
2445
|
{
|
|
2333
|
-
|
|
2334
|
-
|
|
2446
|
+
switchDuration: number, // milliseconds
|
|
2447
|
+
configId: Id<"entities"> // external_connection entity
|
|
2335
2448
|
}
|
|
2336
2449
|
\`\`\`
|
|
2337
2450
|
|
|
2338
2451
|
**Errors:**
|
|
2452
|
+
|
|
2339
2453
|
- UnauthorizedError: Not org_owner
|
|
2340
2454
|
- ValidationError: Invalid config
|
|
2341
2455
|
- ConnectionTestError: Connection failed
|
|
@@ -2348,15 +2462,15 @@ Rollback to previous provider configuration.
|
|
|
2348
2462
|
**Args:**
|
|
2349
2463
|
\`\`\`typescript
|
|
2350
2464
|
{
|
|
2351
|
-
|
|
2465
|
+
orgId: Id<"entities">
|
|
2352
2466
|
}
|
|
2353
2467
|
\`\`\`
|
|
2354
2468
|
|
|
2355
2469
|
**Returns:**
|
|
2356
2470
|
\`\`\`typescript
|
|
2357
2471
|
{
|
|
2358
|
-
|
|
2359
|
-
|
|
2472
|
+
configId: Id<"entities">, // Previous config entity
|
|
2473
|
+
provider: string // Provider type
|
|
2360
2474
|
}
|
|
2361
2475
|
\`\`\`
|
|
2362
2476
|
|
|
@@ -2369,18 +2483,18 @@ Get current provider status for organization.
|
|
|
2369
2483
|
**Args:**
|
|
2370
2484
|
\`\`\`typescript
|
|
2371
2485
|
{
|
|
2372
|
-
|
|
2486
|
+
orgId: Id<"entities">
|
|
2373
2487
|
}
|
|
2374
2488
|
\`\`\`
|
|
2375
2489
|
|
|
2376
2490
|
**Returns:**
|
|
2377
2491
|
\`\`\`typescript
|
|
2378
2492
|
{
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2493
|
+
type: ProviderType,
|
|
2494
|
+
online: boolean,
|
|
2495
|
+
lastCheckedAt: number,
|
|
2496
|
+
responseTime: number, // milliseconds
|
|
2497
|
+
error?: string
|
|
2384
2498
|
}
|
|
2385
2499
|
\`\`\`
|
|
2386
2500
|
|
|
@@ -2391,12 +2505,12 @@ List all active provider configurations (platform_owner only).
|
|
|
2391
2505
|
**Returns:**
|
|
2392
2506
|
\`\`\`typescript
|
|
2393
2507
|
Array<{
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2508
|
+
\_id: Id<"entities">,
|
|
2509
|
+
name: string,
|
|
2510
|
+
platform: ProviderType,
|
|
2511
|
+
status: "active" | "inactive" | "error",
|
|
2512
|
+
lastConnectedAt: number,
|
|
2513
|
+
lastError?: string
|
|
2400
2514
|
}>
|
|
2401
2515
|
\`\`\`
|
|
2402
2516
|
|
|
@@ -2407,23 +2521,24 @@ Get usage metrics for organization's provider.
|
|
|
2407
2521
|
**Args:**
|
|
2408
2522
|
\`\`\`typescript
|
|
2409
2523
|
{
|
|
2410
|
-
|
|
2411
|
-
|
|
2524
|
+
orgId: Id<"entities">,
|
|
2525
|
+
days: number // Look back period
|
|
2412
2526
|
}
|
|
2413
2527
|
\`\`\`
|
|
2414
2528
|
|
|
2415
2529
|
**Returns:**
|
|
2416
2530
|
\`\`\`typescript
|
|
2417
2531
|
{
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2532
|
+
totalOperations: number,
|
|
2533
|
+
averageDuration: number,
|
|
2534
|
+
operationsByType: Record<string, number>
|
|
2421
2535
|
}
|
|
2422
2536
|
\`\`\`
|
|
2423
2537
|
\`\`\`
|
|
2424
2538
|
```
|
|
2425
2539
|
|
|
2426
2540
|
**Step 48:** Create performance benchmarks
|
|
2541
|
+
|
|
2427
2542
|
```typescript
|
|
2428
2543
|
// backend/convex/benchmarks/provider-switch.bench.ts
|
|
2429
2544
|
import { describe, bench } from "vitest";
|
|
@@ -2442,14 +2557,14 @@ describe("Provider Switch Performance", () => {
|
|
|
2442
2557
|
username: "admin",
|
|
2443
2558
|
applicationPassword: "xxxx xxxx xxxx xxxx",
|
|
2444
2559
|
},
|
|
2445
|
-
"user_bench"
|
|
2446
|
-
).pipe(Effect.provide(BenchmarkLayer))
|
|
2560
|
+
"user_bench",
|
|
2561
|
+
).pipe(Effect.provide(BenchmarkLayer)),
|
|
2447
2562
|
);
|
|
2448
2563
|
});
|
|
2449
2564
|
|
|
2450
2565
|
bench("encrypt 100 credentials", async () => {
|
|
2451
2566
|
const promises = Array.from({ length: 100 }, (_, i) =>
|
|
2452
|
-
encrypt(`api-key-${i}`, process.env.ENCRYPTION_KEY!)
|
|
2567
|
+
encrypt(`api-key-${i}`, process.env.ENCRYPTION_KEY!),
|
|
2453
2568
|
);
|
|
2454
2569
|
await Promise.all(promises);
|
|
2455
2570
|
});
|
|
@@ -2457,8 +2572,8 @@ describe("Provider Switch Performance", () => {
|
|
|
2457
2572
|
bench("resolve provider for 100 orgs", async () => {
|
|
2458
2573
|
const promises = Array.from({ length: 100 }, (_, i) =>
|
|
2459
2574
|
Effect.runPromise(
|
|
2460
|
-
resolveProviderForOrg(`org_${i}`).pipe(Effect.provide(BenchmarkLayer))
|
|
2461
|
-
)
|
|
2575
|
+
resolveProviderForOrg(`org_${i}`).pipe(Effect.provide(BenchmarkLayer)),
|
|
2576
|
+
),
|
|
2462
2577
|
);
|
|
2463
2578
|
await Promise.all(promises);
|
|
2464
2579
|
});
|
|
@@ -2471,8 +2586,10 @@ describe("Provider Switch Performance", () => {
|
|
|
2471
2586
|
```
|
|
2472
2587
|
|
|
2473
2588
|
**Step 49:** Add migration guide for existing users
|
|
2589
|
+
|
|
2474
2590
|
```markdown
|
|
2475
2591
|
<!-- /Users/toc/Server/ONE/one/things/features/2-2-migration-guide.md -->
|
|
2592
|
+
|
|
2476
2593
|
# Migrating to Configuration System
|
|
2477
2594
|
|
|
2478
2595
|
## For Existing ONE Platform Deployments
|
|
@@ -2487,7 +2604,9 @@ describe("Provider Switch Performance", () => {
|
|
|
2487
2604
|
|
|
2488
2605
|
1. **Update environment variables**
|
|
2489
2606
|
\`\`\`bash
|
|
2607
|
+
|
|
2490
2608
|
# Add to backend/.env.local
|
|
2609
|
+
|
|
2491
2610
|
ENCRYPTION_KEY=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
|
|
2492
2611
|
BACKEND_PROVIDER=convex
|
|
2493
2612
|
CONVEX_DEPLOYMENT_URL=https://shocking-falcon-870.convex.cloud
|
|
@@ -2527,49 +2646,55 @@ Rollback time: <5 minutes
|
|
|
2527
2646
|
```
|
|
2528
2647
|
|
|
2529
2648
|
**Step 50:** Create provider comparison matrix
|
|
2649
|
+
|
|
2530
2650
|
```markdown
|
|
2531
2651
|
<!-- /Users/toc/Server/ONE/one/things/features/2-2-provider-comparison.md -->
|
|
2652
|
+
|
|
2532
2653
|
# Backend Provider Comparison
|
|
2533
2654
|
|
|
2534
|
-
| Feature
|
|
2535
|
-
|
|
2536
|
-
| **Real-time**
|
|
2537
|
-
| **Authentication** | ✅ Built-in
|
|
2538
|
-
| **Storage**
|
|
2539
|
-
| **Functions**
|
|
2540
|
-
| **Search**
|
|
2541
|
-
| **Cost**
|
|
2542
|
-
| **Setup Time**
|
|
2543
|
-
| **Scalability**
|
|
2544
|
-
| **Data Model**
|
|
2545
|
-
| **Best For**
|
|
2655
|
+
| Feature | Convex | WordPress | Notion | Supabase |
|
|
2656
|
+
| ------------------ | -------------------- | ----------------- | ------------------- | ------------------ |
|
|
2657
|
+
| **Real-time** | ✅ Native | ❌ Polling only | ❌ Polling only | ✅ Native |
|
|
2658
|
+
| **Authentication** | ✅ Built-in | ✅ Via plugins | ❌ External | ✅ Built-in |
|
|
2659
|
+
| **Storage** | ✅ Built-in | ✅ Media library | ✅ Files | ✅ Storage buckets |
|
|
2660
|
+
| **Functions** | ✅ Mutations/Actions | ✅ PHP endpoints | ❌ External | ✅ Edge Functions |
|
|
2661
|
+
| **Search** | ✅ Full-text | ✅ Via plugins | ✅ Database filters | ✅ PostgreSQL FTS |
|
|
2662
|
+
| **Cost** | Usage-based | Hosting + plugins | Per-seat | Usage-based |
|
|
2663
|
+
| **Setup Time** | Minutes | Hours (install) | Minutes | Minutes |
|
|
2664
|
+
| **Scalability** | Auto | Manual | Limited | Auto |
|
|
2665
|
+
| **Data Model** | JSON documents | MySQL tables | Databases | PostgreSQL |
|
|
2666
|
+
| **Best For** | Modern apps | Existing WP sites | Internal tools | SQL-heavy apps |
|
|
2546
2667
|
|
|
2547
2668
|
## When to Use Each Provider
|
|
2548
2669
|
|
|
2549
2670
|
### Convex (Default)
|
|
2671
|
+
|
|
2550
2672
|
- New projects
|
|
2551
2673
|
- Real-time features needed
|
|
2552
2674
|
- Automatic scaling required
|
|
2553
2675
|
- Simple data model (JSON)
|
|
2554
2676
|
|
|
2555
2677
|
### WordPress
|
|
2678
|
+
|
|
2556
2679
|
- Existing WordPress site
|
|
2557
2680
|
- Content-heavy site
|
|
2558
2681
|
- Need plugins ecosystem
|
|
2559
2682
|
- Team familiar with WordPress
|
|
2560
2683
|
|
|
2561
2684
|
### Notion
|
|
2685
|
+
|
|
2562
2686
|
- Internal tools/dashboards
|
|
2563
2687
|
- Simple CRUD operations
|
|
2564
2688
|
- No real-time needed
|
|
2565
2689
|
- Notion-first workflow
|
|
2566
2690
|
|
|
2567
2691
|
### Supabase
|
|
2692
|
+
|
|
2568
2693
|
- Complex SQL queries needed
|
|
2569
2694
|
- PostgreSQL familiarity
|
|
2570
2695
|
- Edge functions required
|
|
2571
2696
|
- Full control over database
|
|
2572
|
-
\`\`\`
|
|
2697
|
+
\`\`\`
|
|
2573
2698
|
```
|
|
2574
2699
|
|
|
2575
2700
|
---
|
|
@@ -2579,6 +2704,7 @@ Rollback time: <5 minutes
|
|
|
2579
2704
|
### Unit Tests
|
|
2580
2705
|
|
|
2581
2706
|
**Encryption (10 tests):**
|
|
2707
|
+
|
|
2582
2708
|
- ✅ Encrypt and decrypt correctly
|
|
2583
2709
|
- ✅ Different ciphertexts for same plaintext (unique IV)
|
|
2584
2710
|
- ✅ Fail with wrong key
|
|
@@ -2591,12 +2717,13 @@ Rollback time: <5 minutes
|
|
|
2591
2717
|
- ✅ Key generation produces valid keys
|
|
2592
2718
|
|
|
2593
2719
|
**Config Validation (15 tests):**
|
|
2720
|
+
|
|
2594
2721
|
- ✅ Validate Convex config (valid)
|
|
2595
2722
|
- ✅ Reject invalid Convex URL
|
|
2596
2723
|
- ✅ Validate WordPress config (valid)
|
|
2597
2724
|
- ✅ Reject WordPress URL without /wp-json
|
|
2598
2725
|
- ✅ Validate Notion config (valid)
|
|
2599
|
-
- ✅ Reject Notion token without
|
|
2726
|
+
- ✅ Reject Notion token without secret\_ prefix
|
|
2600
2727
|
- ✅ Validate Supabase config (valid)
|
|
2601
2728
|
- ✅ Reject invalid Supabase URL
|
|
2602
2729
|
- ✅ Handle optional service key
|
|
@@ -2608,6 +2735,7 @@ Rollback time: <5 minutes
|
|
|
2608
2735
|
- ✅ Provide helpful error messages
|
|
2609
2736
|
|
|
2610
2737
|
**Provider Factory (8 tests):**
|
|
2738
|
+
|
|
2611
2739
|
- ✅ Register provider
|
|
2612
2740
|
- ✅ Get provider factory
|
|
2613
2741
|
- ✅ List provider types
|
|
@@ -2620,6 +2748,7 @@ Rollback time: <5 minutes
|
|
|
2620
2748
|
### Integration Tests
|
|
2621
2749
|
|
|
2622
2750
|
**Provider Switching (12 tests):**
|
|
2751
|
+
|
|
2623
2752
|
- ✅ Switch from Convex to WordPress
|
|
2624
2753
|
- ✅ Switch from WordPress to Notion
|
|
2625
2754
|
- ✅ Rollback on connection failure
|
|
@@ -2634,6 +2763,7 @@ Rollback time: <5 minutes
|
|
|
2634
2763
|
- ✅ Validate actor permissions
|
|
2635
2764
|
|
|
2636
2765
|
**Multi-Tenant Isolation (6 tests):**
|
|
2766
|
+
|
|
2637
2767
|
- ✅ Each org has independent provider
|
|
2638
2768
|
- ✅ Org A using WordPress doesn't affect Org B using Convex
|
|
2639
2769
|
- ✅ Provider failure isolated to org
|
|
@@ -2642,6 +2772,7 @@ Rollback time: <5 minutes
|
|
|
2642
2772
|
- ✅ Health checks per org
|
|
2643
2773
|
|
|
2644
2774
|
**Health Monitoring (5 tests):**
|
|
2775
|
+
|
|
2645
2776
|
- ✅ Health check creates communication_event
|
|
2646
2777
|
- ✅ Failed health check logs error
|
|
2647
2778
|
- ✅ Health check runs every 5 minutes
|
|
@@ -2651,6 +2782,7 @@ Rollback time: <5 minutes
|
|
|
2651
2782
|
### E2E Tests
|
|
2652
2783
|
|
|
2653
2784
|
**Provider Switch UI (8 tests):**
|
|
2785
|
+
|
|
2654
2786
|
- ✅ Org owner can access backend settings
|
|
2655
2787
|
- ✅ Current provider displayed correctly
|
|
2656
2788
|
- ✅ Select new provider from dropdown
|
|
@@ -2661,12 +2793,14 @@ Rollback time: <5 minutes
|
|
|
2661
2793
|
- ✅ Success notification displayed
|
|
2662
2794
|
|
|
2663
2795
|
**Rollback UI (4 tests):**
|
|
2796
|
+
|
|
2664
2797
|
- ✅ Rollback button appears after switch
|
|
2665
2798
|
- ✅ Rollback confirmation dialog shown
|
|
2666
2799
|
- ✅ Rollback completes quickly (<10s)
|
|
2667
2800
|
- ✅ Previous provider restored
|
|
2668
2801
|
|
|
2669
2802
|
**Error Handling (6 tests):**
|
|
2803
|
+
|
|
2670
2804
|
- ✅ Invalid credentials show error message
|
|
2671
2805
|
- ✅ Network error handled gracefully
|
|
2672
2806
|
- ✅ Provider timeout handled
|
|
@@ -2677,6 +2811,7 @@ Rollback time: <5 minutes
|
|
|
2677
2811
|
### Security Tests
|
|
2678
2812
|
|
|
2679
2813
|
**Authorization (5 tests):**
|
|
2814
|
+
|
|
2680
2815
|
- ✅ platform_owner can configure any org
|
|
2681
2816
|
- ✅ org_owner can configure their org only
|
|
2682
2817
|
- ✅ org_user cannot configure provider
|
|
@@ -2684,6 +2819,7 @@ Rollback time: <5 minutes
|
|
|
2684
2819
|
- ✅ Unauthorized access returns 403
|
|
2685
2820
|
|
|
2686
2821
|
**Credential Protection (6 tests):**
|
|
2822
|
+
|
|
2687
2823
|
- ✅ API keys never logged
|
|
2688
2824
|
- ✅ API keys never in event metadata
|
|
2689
2825
|
- ✅ API keys never in error messages
|
|
@@ -2694,6 +2830,7 @@ Rollback time: <5 minutes
|
|
|
2694
2830
|
### Performance Tests
|
|
2695
2831
|
|
|
2696
2832
|
**Benchmarks (5 tests):**
|
|
2833
|
+
|
|
2697
2834
|
- ✅ Provider switch <30s (P99)
|
|
2698
2835
|
- ✅ Provider switch <15s (P50)
|
|
2699
2836
|
- ✅ Encrypt 100 credentials <500ms
|
|
@@ -2701,6 +2838,7 @@ Rollback time: <5 minutes
|
|
|
2701
2838
|
- ✅ Health check <3s per provider
|
|
2702
2839
|
|
|
2703
2840
|
**Load Tests (3 tests):**
|
|
2841
|
+
|
|
2704
2842
|
- ✅ 100 concurrent provider switches
|
|
2705
2843
|
- ✅ 1000 provider resolutions/second
|
|
2706
2844
|
- ✅ Cache hit rate >90%
|
|
@@ -2733,18 +2871,21 @@ Before marking Feature 2-2 complete:
|
|
|
2733
2871
|
## 6. Dependencies
|
|
2734
2872
|
|
|
2735
2873
|
**Required (Blocking):**
|
|
2874
|
+
|
|
2736
2875
|
- ✅ Feature 2-1: DataProvider Interface MUST be complete
|
|
2737
2876
|
- All 4 providers implement DataProvider
|
|
2738
2877
|
- query(), mutation(), healthCheck() methods
|
|
2739
2878
|
- Type signatures match interface
|
|
2740
2879
|
|
|
2741
2880
|
**Schema Changes:**
|
|
2881
|
+
|
|
2742
2882
|
- ✅ `external_connection` entity type exists
|
|
2743
2883
|
- ✅ `configured_by` connection type defined
|
|
2744
2884
|
- ✅ `settings_updated` event type defined
|
|
2745
2885
|
- ✅ Organizations table includes `properties.backendProvider`
|
|
2746
2886
|
|
|
2747
2887
|
**Environment:**
|
|
2888
|
+
|
|
2748
2889
|
- ✅ Node.js crypto module available
|
|
2749
2890
|
- ✅ Convex supports environment variables
|
|
2750
2891
|
- ✅ Frontend can call Convex mutations
|
|
@@ -2754,6 +2895,7 @@ Before marking Feature 2-2 complete:
|
|
|
2754
2895
|
## 7. Rollback Plan
|
|
2755
2896
|
|
|
2756
2897
|
### Pre-Rollback Checklist
|
|
2898
|
+
|
|
2757
2899
|
- [ ] Identify issue requiring rollback
|
|
2758
2900
|
- [ ] Notify affected organizations
|
|
2759
2901
|
- [ ] Backup current configs
|
|
@@ -2761,6 +2903,7 @@ Before marking Feature 2-2 complete:
|
|
|
2761
2903
|
### Rollback Steps (Target: <5 minutes)
|
|
2762
2904
|
|
|
2763
2905
|
1. **Disable provider switching UI** (1 min)
|
|
2906
|
+
|
|
2764
2907
|
```typescript
|
|
2765
2908
|
// Hide provider config page
|
|
2766
2909
|
// frontend/src/pages/org/[orgId]/settings/backend.astro
|
|
@@ -2768,6 +2911,7 @@ Before marking Feature 2-2 complete:
|
|
|
2768
2911
|
```
|
|
2769
2912
|
|
|
2770
2913
|
2. **Revert to hardcoded provider** (2 min)
|
|
2914
|
+
|
|
2771
2915
|
```typescript
|
|
2772
2916
|
// backend/convex/providers/default.ts
|
|
2773
2917
|
export function getProvider(): DataProvider {
|
|
@@ -2780,12 +2924,14 @@ Before marking Feature 2-2 complete:
|
|
|
2780
2924
|
```
|
|
2781
2925
|
|
|
2782
2926
|
3. **Clear provider cache** (30 sec)
|
|
2927
|
+
|
|
2783
2928
|
```typescript
|
|
2784
2929
|
// backend/convex/providers/cache.ts
|
|
2785
2930
|
clearAllProviders();
|
|
2786
2931
|
```
|
|
2787
2932
|
|
|
2788
2933
|
4. **Deploy rollback** (1 min)
|
|
2934
|
+
|
|
2789
2935
|
```bash
|
|
2790
2936
|
cd backend
|
|
2791
2937
|
npx convex deploy --prod
|
|
@@ -2797,12 +2943,14 @@ Before marking Feature 2-2 complete:
|
|
|
2797
2943
|
- Verify no provider errors
|
|
2798
2944
|
|
|
2799
2945
|
### Post-Rollback
|
|
2946
|
+
|
|
2800
2947
|
- [ ] Document rollback reason
|
|
2801
2948
|
- [ ] Fix root cause
|
|
2802
2949
|
- [ ] Test fix on staging
|
|
2803
2950
|
- [ ] Re-enable with fix
|
|
2804
2951
|
|
|
2805
2952
|
### Rollback Triggers
|
|
2953
|
+
|
|
2806
2954
|
- Provider switch failures >10%
|
|
2807
2955
|
- P99 switch time >60s
|
|
2808
2956
|
- Credential decryption errors
|
|
@@ -2814,6 +2962,7 @@ Before marking Feature 2-2 complete:
|
|
|
2814
2962
|
## 8. Documentation Requirements
|
|
2815
2963
|
|
|
2816
2964
|
**User Documentation:**
|
|
2965
|
+
|
|
2817
2966
|
- [x] Configuration guide (Step 45)
|
|
2818
2967
|
- [x] Environment variables reference (Step 44)
|
|
2819
2968
|
- [x] Troubleshooting guide (Step 46)
|
|
@@ -2821,6 +2970,7 @@ Before marking Feature 2-2 complete:
|
|
|
2821
2970
|
- [x] Migration guide (Step 49)
|
|
2822
2971
|
|
|
2823
2972
|
**Developer Documentation:**
|
|
2973
|
+
|
|
2824
2974
|
- [x] API reference (Step 47)
|
|
2825
2975
|
- [x] Provider registration guide
|
|
2826
2976
|
- [x] Encryption implementation notes
|
|
@@ -2828,6 +2978,7 @@ Before marking Feature 2-2 complete:
|
|
|
2828
2978
|
- [x] Architecture decision records
|
|
2829
2979
|
|
|
2830
2980
|
**Examples:**
|
|
2981
|
+
|
|
2831
2982
|
- [x] WordPress setup example
|
|
2832
2983
|
- [x] Notion setup example
|
|
2833
2984
|
- [x] Supabase setup example
|
|
@@ -2838,6 +2989,7 @@ Before marking Feature 2-2 complete:
|
|
|
2838
2989
|
## 9. Success Criteria
|
|
2839
2990
|
|
|
2840
2991
|
### Functional Requirements
|
|
2992
|
+
|
|
2841
2993
|
- [x] Organizations configure backend via .env or UI
|
|
2842
2994
|
- [x] Runtime provider switching works (<30s)
|
|
2843
2995
|
- [x] Multi-tenant isolation maintained (each org independent)
|
|
@@ -2847,6 +2999,7 @@ Before marking Feature 2-2 complete:
|
|
|
2847
2999
|
- [x] Support 4 provider types (Convex, WordPress, Notion, Supabase)
|
|
2848
3000
|
|
|
2849
3001
|
### Non-Functional Requirements
|
|
3002
|
+
|
|
2850
3003
|
- [x] Switch duration P99 <30s
|
|
2851
3004
|
- [x] Switch duration P50 <15s
|
|
2852
3005
|
- [x] Health check response time <3s
|
|
@@ -2857,6 +3010,7 @@ Before marking Feature 2-2 complete:
|
|
|
2857
3010
|
- [x] Helpful error messages (not raw exceptions)
|
|
2858
3011
|
|
|
2859
3012
|
### Security Requirements
|
|
3013
|
+
|
|
2860
3014
|
- [x] API keys encrypted at rest
|
|
2861
3015
|
- [x] Unique IV per encryption
|
|
2862
3016
|
- [x] Authenticated encryption (GCM mode)
|
|
@@ -2866,6 +3020,7 @@ Before marking Feature 2-2 complete:
|
|
|
2866
3020
|
- [x] Encryption key validation on startup
|
|
2867
3021
|
|
|
2868
3022
|
### Documentation Requirements
|
|
3023
|
+
|
|
2869
3024
|
- [x] 5 user guides written
|
|
2870
3025
|
- [x] API reference complete
|
|
2871
3026
|
- [x] Troubleshooting guide with solutions
|
|
@@ -2873,6 +3028,7 @@ Before marking Feature 2-2 complete:
|
|
|
2873
3028
|
- [x] Provider comparison matrix
|
|
2874
3029
|
|
|
2875
3030
|
### Testing Requirements
|
|
3031
|
+
|
|
2876
3032
|
- [x] 80+ tests passing
|
|
2877
3033
|
- [x] Unit tests (33 tests)
|
|
2878
3034
|
- [x] Integration tests (23 tests)
|
|
@@ -2885,6 +3041,7 @@ Before marking Feature 2-2 complete:
|
|
|
2885
3041
|
## 10. Related Files
|
|
2886
3042
|
|
|
2887
3043
|
**Implementation Files:**
|
|
3044
|
+
|
|
2888
3045
|
- `backend/convex/schema.ts` - Schema updates
|
|
2889
3046
|
- `backend/convex/providers/factory.ts` - Provider factory
|
|
2890
3047
|
- `backend/convex/providers/registry.ts` - Provider registration
|
|
@@ -2895,12 +3052,14 @@ Before marking Feature 2-2 complete:
|
|
|
2895
3052
|
- `frontend/src/pages/org/[orgId]/settings/backend.astro` - Settings page
|
|
2896
3053
|
|
|
2897
3054
|
**Test Files:**
|
|
3055
|
+
|
|
2898
3056
|
- `backend/convex/lib/encryption.test.ts` - Encryption tests
|
|
2899
3057
|
- `backend/convex/services/config/switcher.test.ts` - Switch tests
|
|
2900
3058
|
- `frontend/tests/e2e/provider-switch.test.ts` - E2E tests
|
|
2901
3059
|
- `backend/convex/benchmarks/provider-switch.bench.ts` - Benchmarks
|
|
2902
3060
|
|
|
2903
3061
|
**Documentation Files:**
|
|
3062
|
+
|
|
2904
3063
|
- `/Users/toc/Server/ONE/one/things/features/2-2-config-system.md` - This file
|
|
2905
3064
|
- `/Users/toc/Server/ONE/one/things/features/2-2-config-env-vars.md` - Env vars
|
|
2906
3065
|
- `/Users/toc/Server/ONE/one/things/features/2-2-config-guide.md` - User guide
|
|
@@ -2910,6 +3069,7 @@ Before marking Feature 2-2 complete:
|
|
|
2910
3069
|
- `/Users/toc/Server/ONE/one/things/features/2-2-provider-comparison.md` - Comparison
|
|
2911
3070
|
|
|
2912
3071
|
**Related Features:**
|
|
3072
|
+
|
|
2913
3073
|
- Feature 2-1: DataProvider Interface (dependency)
|
|
2914
3074
|
- Feature 2-3: Convex Implementation (uses config system)
|
|
2915
3075
|
- Feature 2-4: WordPress Implementation (uses config system)
|
|
@@ -2930,12 +3090,14 @@ Before marking Feature 2-2 complete:
|
|
|
2930
3090
|
### Example: Org Owner Switches to WordPress
|
|
2931
3091
|
|
|
2932
3092
|
**Step 1: User visits settings**
|
|
3093
|
+
|
|
2933
3094
|
```typescript
|
|
2934
3095
|
// GET /org/acme/settings/backend
|
|
2935
3096
|
// User sees: "Current Provider: Convex (Online)"
|
|
2936
3097
|
```
|
|
2937
3098
|
|
|
2938
3099
|
**Step 2: User selects WordPress**
|
|
3100
|
+
|
|
2939
3101
|
```typescript
|
|
2940
3102
|
// Form shows WordPress-specific fields
|
|
2941
3103
|
<Input placeholder="WordPress URL" />
|
|
@@ -2944,6 +3106,7 @@ Before marking Feature 2-2 complete:
|
|
|
2944
3106
|
```
|
|
2945
3107
|
|
|
2946
3108
|
**Step 3: User tests connection**
|
|
3109
|
+
|
|
2947
3110
|
```typescript
|
|
2948
3111
|
// POST /api/config/test
|
|
2949
3112
|
const result = await testConnection({
|
|
@@ -2956,6 +3119,7 @@ const result = await testConnection({
|
|
|
2956
3119
|
```
|
|
2957
3120
|
|
|
2958
3121
|
**Step 4: User saves configuration**
|
|
3122
|
+
|
|
2959
3123
|
```typescript
|
|
2960
3124
|
// POST /api/config/save
|
|
2961
3125
|
const { switchDuration, configId } = await saveProviderConfig({
|
|
@@ -2971,6 +3135,7 @@ const { switchDuration, configId } = await saveProviderConfig({
|
|
|
2971
3135
|
```
|
|
2972
3136
|
|
|
2973
3137
|
**Step 5: Backend processes switch**
|
|
3138
|
+
|
|
2974
3139
|
```typescript
|
|
2975
3140
|
// 1. Validate config with Zod schema
|
|
2976
3141
|
const validated = WordPressConfigSchema.parse(config);
|
|
@@ -3054,12 +3219,14 @@ await db.insert("events", {
|
|
|
3054
3219
|
```
|
|
3055
3220
|
|
|
3056
3221
|
**Step 6: User sees success**
|
|
3222
|
+
|
|
3057
3223
|
```typescript
|
|
3058
3224
|
// UI updates: "Current Provider: WordPress (Online)"
|
|
3059
3225
|
// Rollback button appears: "Rollback to Convex"
|
|
3060
3226
|
```
|
|
3061
3227
|
|
|
3062
3228
|
**Step 7: Next query uses WordPress**
|
|
3229
|
+
|
|
3063
3230
|
```typescript
|
|
3064
3231
|
// GET /api/entities?type=creator
|
|
3065
3232
|
const provider = await resolveProviderForOrg("org_acme");
|