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: Improve Codebase
|
|
3
|
+
dimension: things
|
|
4
|
+
category: plans
|
|
5
|
+
tags: backend, connections, events, frontend, ontology, protocol
|
|
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 plans category.
|
|
13
|
+
Location: one/things/plans/improve-codebase.md
|
|
14
|
+
Purpose: Documents codebase improvement plan: full integration & accuracy
|
|
15
|
+
Related dimensions: connections, events, groups, knowledge, people
|
|
16
|
+
For AI agents: Read this to understand improve codebase.
|
|
17
|
+
---
|
|
18
|
+
|
|
1
19
|
# Codebase Improvement Plan: Full Integration & Accuracy
|
|
2
20
|
|
|
3
21
|
**Status:** Draft
|
|
@@ -12,11 +30,13 @@
|
|
|
12
30
|
The ONE platform has a **world-class ontology** (6 dimensions, 66 thing types, 25 connections, 67 events) but **incomplete implementation**. This plan identifies 47 specific improvements across backend, frontend, integration, and operations to achieve 100% ontology coverage and production readiness.
|
|
13
31
|
|
|
14
32
|
**Current State:**
|
|
33
|
+
|
|
15
34
|
- ✅ Excellent: Ontology design, schema definition, documentation
|
|
16
35
|
- ⚠️ Partial: Backend mutations/queries, frontend integration, auth linkage
|
|
17
36
|
- ❌ Missing: Effect.ts glue layer, protocol integration, RAG implementation, multi-tenant UI
|
|
18
37
|
|
|
19
38
|
**Target State:**
|
|
39
|
+
|
|
20
40
|
- 100% ontology coverage in backend (all 66 thing types, 25 connections, 67 events)
|
|
21
41
|
- Complete Effect.ts glue layer with typed errors and service composition
|
|
22
42
|
- Full multi-tenant frontend with group hierarchy navigation
|
|
@@ -40,6 +60,7 @@ The ONE platform has a **world-class ontology** (6 dimensions, 66 thing types, 2
|
|
|
40
60
|
<summary>📋 Click to expand: Missing Backend Operations</summary>
|
|
41
61
|
|
|
42
62
|
**Priority 1 (Core Entities):**
|
|
63
|
+
|
|
43
64
|
```typescript
|
|
44
65
|
// backend/convex/mutations/entities.ts
|
|
45
66
|
export const createCreator = mutation({ ... })
|
|
@@ -49,6 +70,7 @@ export const updateCreator = mutation({ ... })
|
|
|
49
70
|
```
|
|
50
71
|
|
|
51
72
|
**Priority 2 (Content & Products):**
|
|
73
|
+
|
|
52
74
|
```typescript
|
|
53
75
|
// backend/convex/mutations/content.ts
|
|
54
76
|
export const createBlogPost = mutation({ ... })
|
|
@@ -58,6 +80,7 @@ export const publishContent = mutation({ ... })
|
|
|
58
80
|
```
|
|
59
81
|
|
|
60
82
|
**Priority 3 (Tokens & Commerce):**
|
|
83
|
+
|
|
61
84
|
```typescript
|
|
62
85
|
// backend/convex/mutations/tokens.ts
|
|
63
86
|
export const createToken = mutation({ ... })
|
|
@@ -66,6 +89,7 @@ export const transferTokens = mutation({ ... })
|
|
|
66
89
|
```
|
|
67
90
|
|
|
68
91
|
**Priority 4 (Agents & AI):**
|
|
92
|
+
|
|
69
93
|
```typescript
|
|
70
94
|
// backend/convex/mutations/agents.ts
|
|
71
95
|
export const createStrategyAgent = mutation({ ... })
|
|
@@ -74,6 +98,7 @@ export const executeAgent = mutation({ ... })
|
|
|
74
98
|
```
|
|
75
99
|
|
|
76
100
|
**Priority 5 (Auth & Session):**
|
|
101
|
+
|
|
77
102
|
```typescript
|
|
78
103
|
// backend/convex/mutations/auth.ts
|
|
79
104
|
export const createSession = mutation({ ... })
|
|
@@ -84,6 +109,7 @@ export const create2FA = mutation({ ... })
|
|
|
84
109
|
</details>
|
|
85
110
|
|
|
86
111
|
**Acceptance Criteria:**
|
|
112
|
+
|
|
87
113
|
- [ ] All 66 thing types have create/update/archive mutations
|
|
88
114
|
- [ ] All 25 connection types have create/update/delete mutations
|
|
89
115
|
- [ ] All mutations log appropriate events
|
|
@@ -106,79 +132,83 @@ export const create2FA = mutation({ ... })
|
|
|
106
132
|
<summary>📋 Click to expand: Effect.ts Architecture</summary>
|
|
107
133
|
|
|
108
134
|
**Service Structure:**
|
|
135
|
+
|
|
109
136
|
```typescript
|
|
110
137
|
// backend/convex/services/entities/creator.service.ts
|
|
111
|
-
import { Effect, Layer } from "effect"
|
|
112
|
-
|
|
113
|
-
export class CreatorService extends Effect.Service<CreatorService>()(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
138
|
+
import { Effect, Layer } from "effect";
|
|
139
|
+
|
|
140
|
+
export class CreatorService extends Effect.Service<CreatorService>()(
|
|
141
|
+
"CreatorService",
|
|
142
|
+
{
|
|
143
|
+
effect: Effect.gen(function* () {
|
|
144
|
+
const db = yield* DatabaseService;
|
|
145
|
+
const events = yield* EventLogService;
|
|
146
|
+
|
|
147
|
+
const create = (input: CreateCreatorInput) =>
|
|
148
|
+
Effect.gen(function* () {
|
|
149
|
+
// 1. Validate input
|
|
150
|
+
yield* validateCreatorInput(input);
|
|
151
|
+
|
|
152
|
+
// 2. Check permissions
|
|
153
|
+
yield* checkGroupOwnership(input.groupId);
|
|
154
|
+
|
|
155
|
+
// 3. Create entity
|
|
156
|
+
const creatorId = yield* db.insert("entities", {
|
|
157
|
+
groupId: input.groupId,
|
|
158
|
+
type: "creator",
|
|
159
|
+
name: input.name,
|
|
160
|
+
properties: input.properties,
|
|
161
|
+
status: "active",
|
|
162
|
+
createdAt: Date.now(),
|
|
163
|
+
updatedAt: Date.now(),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// 4. Log event
|
|
167
|
+
yield* events.log({
|
|
168
|
+
groupId: input.groupId,
|
|
169
|
+
type: "entity_created",
|
|
170
|
+
actorId: input.actorId,
|
|
171
|
+
targetId: creatorId,
|
|
172
|
+
timestamp: Date.now(),
|
|
173
|
+
metadata: { entityType: "creator" },
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
return creatorId;
|
|
177
|
+
}).pipe(Effect.mapError((e) => new CreatorCreationError(e)));
|
|
178
|
+
|
|
179
|
+
return { create, update, archive, get, list } as const;
|
|
180
|
+
}),
|
|
181
|
+
},
|
|
182
|
+
) {}
|
|
155
183
|
```
|
|
156
184
|
|
|
157
185
|
**Error Hierarchy:**
|
|
186
|
+
|
|
158
187
|
```typescript
|
|
159
188
|
// backend/convex/services/errors.ts
|
|
160
189
|
export class EntityError extends Data.TaggedClass("EntityError")<{
|
|
161
|
-
message: string
|
|
162
|
-
entityType: string
|
|
190
|
+
message: string;
|
|
191
|
+
entityType: string;
|
|
163
192
|
}> {}
|
|
164
193
|
|
|
165
194
|
export class CreatorCreationError extends EntityError {
|
|
166
|
-
readonly _tag = "CreatorCreationError"
|
|
195
|
+
readonly _tag = "CreatorCreationError";
|
|
167
196
|
}
|
|
168
197
|
|
|
169
198
|
export class ValidationError extends Data.TaggedClass("ValidationError")<{
|
|
170
|
-
field: string
|
|
171
|
-
reason: string
|
|
199
|
+
field: string;
|
|
200
|
+
reason: string;
|
|
172
201
|
}> {}
|
|
173
202
|
|
|
174
203
|
export class PermissionError extends Data.TaggedClass("PermissionError")<{
|
|
175
|
-
userId: string
|
|
176
|
-
groupId: string
|
|
177
|
-
action: string
|
|
204
|
+
userId: string;
|
|
205
|
+
groupId: string;
|
|
206
|
+
action: string;
|
|
178
207
|
}> {}
|
|
179
208
|
```
|
|
180
209
|
|
|
181
210
|
**Service Composition:**
|
|
211
|
+
|
|
182
212
|
```typescript
|
|
183
213
|
// backend/convex/services/layers.ts
|
|
184
214
|
export const ServicesLayer = Layer.mergeAll(
|
|
@@ -209,6 +239,7 @@ export const createCreator = mutation({
|
|
|
209
239
|
</details>
|
|
210
240
|
|
|
211
241
|
**Acceptance Criteria:**
|
|
242
|
+
|
|
212
243
|
- [ ] All 66 thing types have Effect.ts services
|
|
213
244
|
- [ ] All services use tagged errors (no try/catch)
|
|
214
245
|
- [ ] All services compose via Layer.mergeAll
|
|
@@ -231,73 +262,79 @@ export const createCreator = mutation({
|
|
|
231
262
|
<summary>📋 Click to expand: Event Logging Strategy</summary>
|
|
232
263
|
|
|
233
264
|
**EventLogService:**
|
|
265
|
+
|
|
234
266
|
```typescript
|
|
235
267
|
// backend/convex/services/events/event-log.service.ts
|
|
236
|
-
export class EventLogService extends Effect.Service<EventLogService>()(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
268
|
+
export class EventLogService extends Effect.Service<EventLogService>()(
|
|
269
|
+
"EventLogService",
|
|
270
|
+
{
|
|
271
|
+
effect: Effect.gen(function* () {
|
|
272
|
+
const db = yield* DatabaseService;
|
|
273
|
+
|
|
274
|
+
const log = (event: EventInput) =>
|
|
275
|
+
Effect.gen(function* () {
|
|
276
|
+
// Validate event structure
|
|
277
|
+
yield* validateEvent(event);
|
|
278
|
+
|
|
279
|
+
// Insert event
|
|
280
|
+
const eventId = yield* db.insert("events", {
|
|
281
|
+
groupId: event.groupId,
|
|
282
|
+
type: event.type,
|
|
283
|
+
actorId: event.actorId,
|
|
284
|
+
targetId: event.targetId,
|
|
285
|
+
timestamp: event.timestamp,
|
|
286
|
+
metadata: event.metadata,
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
// Trigger real-time subscriptions (Convex handles this)
|
|
290
|
+
return eventId;
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
const query = (filters: EventFilters) =>
|
|
294
|
+
Effect.gen(function* () {
|
|
295
|
+
const events = yield* db
|
|
296
|
+
.query("events")
|
|
297
|
+
.withIndex("group_type", (q) =>
|
|
298
|
+
q.eq("groupId", filters.groupId).eq("type", filters.type),
|
|
299
|
+
)
|
|
300
|
+
.collect();
|
|
301
|
+
|
|
302
|
+
return events;
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
return { log, query, getByActor, getByTarget } as const;
|
|
306
|
+
}),
|
|
307
|
+
},
|
|
308
|
+
) {}
|
|
274
309
|
```
|
|
275
310
|
|
|
276
311
|
**Automatic Event Logging:**
|
|
312
|
+
|
|
277
313
|
```typescript
|
|
278
314
|
// Wrap every mutation with event logging
|
|
279
315
|
const withEventLogging = <T>(
|
|
280
316
|
operation: Effect.Effect<T, any, any>,
|
|
281
317
|
eventType: EventType,
|
|
282
|
-
metadata?: Record<string, any
|
|
318
|
+
metadata?: Record<string, any>,
|
|
283
319
|
) =>
|
|
284
320
|
Effect.gen(function* () {
|
|
285
|
-
const result = yield* operation
|
|
286
|
-
const events = yield* EventLogService
|
|
321
|
+
const result = yield* operation;
|
|
322
|
+
const events = yield* EventLogService;
|
|
287
323
|
|
|
288
324
|
yield* events.log({
|
|
289
325
|
type: eventType,
|
|
290
326
|
actorId: metadata.actorId,
|
|
291
327
|
targetId: result,
|
|
292
328
|
timestamp: Date.now(),
|
|
293
|
-
metadata
|
|
294
|
-
})
|
|
329
|
+
metadata,
|
|
330
|
+
});
|
|
295
331
|
|
|
296
|
-
return result
|
|
297
|
-
})
|
|
332
|
+
return result;
|
|
333
|
+
});
|
|
298
334
|
```
|
|
299
335
|
|
|
300
336
|
**Coverage Matrix:**
|
|
337
|
+
|
|
301
338
|
```typescript
|
|
302
339
|
// Ensure every mutation logs the right event
|
|
303
340
|
const EVENT_COVERAGE = {
|
|
@@ -320,12 +357,13 @@ const EVENT_COVERAGE = {
|
|
|
320
357
|
"tokens.transfer": "tokens_transferred",
|
|
321
358
|
|
|
322
359
|
// ... (67 total event types)
|
|
323
|
-
}
|
|
360
|
+
};
|
|
324
361
|
```
|
|
325
362
|
|
|
326
363
|
</details>
|
|
327
364
|
|
|
328
365
|
**Acceptance Criteria:**
|
|
366
|
+
|
|
329
367
|
- [ ] All 67 event types are logged automatically
|
|
330
368
|
- [ ] EventLogService uses Effect.ts with typed errors
|
|
331
369
|
- [ ] Events include proper groupId scoping
|
|
@@ -348,15 +386,16 @@ const EVENT_COVERAGE = {
|
|
|
348
386
|
<summary>📋 Click to expand: Connection Services</summary>
|
|
349
387
|
|
|
350
388
|
**Ownership Connections:**
|
|
389
|
+
|
|
351
390
|
```typescript
|
|
352
391
|
// backend/convex/services/connections/ownership.service.ts
|
|
353
392
|
export const createOwnership = (input: OwnershipInput) =>
|
|
354
393
|
Effect.gen(function* () {
|
|
355
|
-
const connections = yield* ConnectionService
|
|
394
|
+
const connections = yield* ConnectionService;
|
|
356
395
|
|
|
357
396
|
// Validate ownership rules
|
|
358
397
|
if (input.metadata?.revenueShare) {
|
|
359
|
-
yield* validateRevenueShare(input.metadata.revenueShare)
|
|
398
|
+
yield* validateRevenueShare(input.metadata.revenueShare);
|
|
360
399
|
}
|
|
361
400
|
|
|
362
401
|
// Create connection
|
|
@@ -364,24 +403,25 @@ export const createOwnership = (input: OwnershipInput) =>
|
|
|
364
403
|
fromEntityId: input.ownerId,
|
|
365
404
|
toEntityId: input.ownedEntityId,
|
|
366
405
|
relationshipType: "owns",
|
|
367
|
-
metadata: input.metadata
|
|
368
|
-
})
|
|
369
|
-
})
|
|
406
|
+
metadata: input.metadata,
|
|
407
|
+
});
|
|
408
|
+
});
|
|
370
409
|
```
|
|
371
410
|
|
|
372
411
|
**Token Holdings:**
|
|
412
|
+
|
|
373
413
|
```typescript
|
|
374
414
|
// backend/convex/services/connections/token-holdings.service.ts
|
|
375
415
|
export const updateTokenBalance = (input: TokenBalanceInput) =>
|
|
376
416
|
Effect.gen(function* () {
|
|
377
|
-
const connections = yield* ConnectionService
|
|
417
|
+
const connections = yield* ConnectionService;
|
|
378
418
|
|
|
379
419
|
// Get existing holding connection
|
|
380
420
|
const existing = yield* connections.getByType({
|
|
381
421
|
fromEntityId: input.userId,
|
|
382
422
|
toEntityId: input.tokenId,
|
|
383
|
-
relationshipType: "holds_tokens"
|
|
384
|
-
})
|
|
423
|
+
relationshipType: "holds_tokens",
|
|
424
|
+
});
|
|
385
425
|
|
|
386
426
|
if (existing) {
|
|
387
427
|
// Update balance
|
|
@@ -389,41 +429,42 @@ export const updateTokenBalance = (input: TokenBalanceInput) =>
|
|
|
389
429
|
connectionId: existing._id,
|
|
390
430
|
metadata: {
|
|
391
431
|
...existing.metadata,
|
|
392
|
-
balance: input.newBalance
|
|
393
|
-
}
|
|
394
|
-
})
|
|
432
|
+
balance: input.newBalance,
|
|
433
|
+
},
|
|
434
|
+
});
|
|
395
435
|
} else {
|
|
396
436
|
// Create new holding
|
|
397
437
|
yield* connections.create({
|
|
398
438
|
fromEntityId: input.userId,
|
|
399
439
|
toEntityId: input.tokenId,
|
|
400
440
|
relationshipType: "holds_tokens",
|
|
401
|
-
metadata: { balance: input.newBalance }
|
|
402
|
-
})
|
|
441
|
+
metadata: { balance: input.newBalance },
|
|
442
|
+
});
|
|
403
443
|
}
|
|
404
|
-
})
|
|
444
|
+
});
|
|
405
445
|
```
|
|
406
446
|
|
|
407
447
|
**Group Membership with Roles:**
|
|
448
|
+
|
|
408
449
|
```typescript
|
|
409
450
|
// backend/convex/services/connections/membership.service.ts
|
|
410
451
|
export const addGroupMember = (input: MembershipInput) =>
|
|
411
452
|
Effect.gen(function* () {
|
|
412
|
-
const connections = yield* ConnectionService
|
|
413
|
-
const events = yield* EventLogService
|
|
453
|
+
const connections = yield* ConnectionService;
|
|
454
|
+
const events = yield* EventLogService;
|
|
414
455
|
|
|
415
456
|
// Validate role
|
|
416
|
-
yield* validateGroupRole(input.role)
|
|
457
|
+
yield* validateGroupRole(input.role);
|
|
417
458
|
|
|
418
459
|
// Check if already member
|
|
419
460
|
const existing = yield* connections.getByType({
|
|
420
461
|
fromEntityId: input.userId,
|
|
421
462
|
toEntityId: input.groupId,
|
|
422
|
-
relationshipType: "member_of"
|
|
423
|
-
})
|
|
463
|
+
relationshipType: "member_of",
|
|
464
|
+
});
|
|
424
465
|
|
|
425
466
|
if (existing) {
|
|
426
|
-
return yield* new MembershipError({ message: "Already a member" })
|
|
467
|
+
return yield* new MembershipError({ message: "Already a member" });
|
|
427
468
|
}
|
|
428
469
|
|
|
429
470
|
// Create membership connection
|
|
@@ -434,9 +475,9 @@ export const addGroupMember = (input: MembershipInput) =>
|
|
|
434
475
|
metadata: {
|
|
435
476
|
role: input.role,
|
|
436
477
|
invitedBy: input.inviterId,
|
|
437
|
-
joinedAt: Date.now()
|
|
438
|
-
}
|
|
439
|
-
})
|
|
478
|
+
joinedAt: Date.now(),
|
|
479
|
+
},
|
|
480
|
+
});
|
|
440
481
|
|
|
441
482
|
// Log event
|
|
442
483
|
yield* events.log({
|
|
@@ -445,16 +486,17 @@ export const addGroupMember = (input: MembershipInput) =>
|
|
|
445
486
|
actorId: input.userId,
|
|
446
487
|
targetId: input.groupId,
|
|
447
488
|
timestamp: Date.now(),
|
|
448
|
-
metadata: { role: input.role }
|
|
449
|
-
})
|
|
489
|
+
metadata: { role: input.role },
|
|
490
|
+
});
|
|
450
491
|
|
|
451
|
-
return connectionId
|
|
452
|
-
})
|
|
492
|
+
return connectionId;
|
|
493
|
+
});
|
|
453
494
|
```
|
|
454
495
|
|
|
455
496
|
</details>
|
|
456
497
|
|
|
457
498
|
**Acceptance Criteria:**
|
|
499
|
+
|
|
458
500
|
- [ ] All 25 connection types have specialized services
|
|
459
501
|
- [ ] Connection rules are enforced (revenue shares, balances, etc.)
|
|
460
502
|
- [ ] Bidirectional queries work (fromEntity and toEntity)
|
|
@@ -477,135 +519,148 @@ export const addGroupMember = (input: MembershipInput) =>
|
|
|
477
519
|
<summary>📋 Click to expand: RAG Implementation</summary>
|
|
478
520
|
|
|
479
521
|
**Chunking Service:**
|
|
522
|
+
|
|
480
523
|
```typescript
|
|
481
524
|
// backend/convex/services/knowledge/chunking.service.ts
|
|
482
|
-
export class ChunkingService extends Effect.Service<ChunkingService>()(
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
525
|
+
export class ChunkingService extends Effect.Service<ChunkingService>()(
|
|
526
|
+
"ChunkingService",
|
|
527
|
+
{
|
|
528
|
+
effect: Effect.gen(function* () {
|
|
529
|
+
const chunk = (text: string, options: ChunkOptions) =>
|
|
530
|
+
Effect.gen(function* () {
|
|
531
|
+
const windowSize = options.windowSize || 800;
|
|
532
|
+
const overlap = options.overlap || 200;
|
|
533
|
+
|
|
534
|
+
// Smart sentence-aware chunking
|
|
535
|
+
const sentences = text.split(/[.!?]+/);
|
|
536
|
+
const chunks: Chunk[] = [];
|
|
537
|
+
let currentChunk = "";
|
|
538
|
+
let tokenCount = 0;
|
|
539
|
+
|
|
540
|
+
for (const sentence of sentences) {
|
|
541
|
+
const sentenceTokens = estimateTokens(sentence);
|
|
542
|
+
|
|
543
|
+
if (
|
|
544
|
+
tokenCount + sentenceTokens > windowSize &&
|
|
545
|
+
currentChunk.length > 0
|
|
546
|
+
) {
|
|
547
|
+
chunks.push({
|
|
548
|
+
text: currentChunk.trim(),
|
|
549
|
+
tokenCount,
|
|
550
|
+
index: chunks.length,
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
// Keep overlap for context
|
|
554
|
+
const overlapText = currentChunk.slice(-overlap);
|
|
555
|
+
currentChunk = overlapText + sentence;
|
|
556
|
+
tokenCount = estimateTokens(currentChunk);
|
|
557
|
+
} else {
|
|
558
|
+
currentChunk += sentence;
|
|
559
|
+
tokenCount += sentenceTokens;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// Add final chunk
|
|
564
|
+
if (currentChunk.length > 0) {
|
|
499
565
|
chunks.push({
|
|
500
566
|
text: currentChunk.trim(),
|
|
501
567
|
tokenCount,
|
|
502
|
-
index: chunks.length
|
|
503
|
-
})
|
|
504
|
-
|
|
505
|
-
// Keep overlap for context
|
|
506
|
-
const overlapText = currentChunk.slice(-overlap)
|
|
507
|
-
currentChunk = overlapText + sentence
|
|
508
|
-
tokenCount = estimateTokens(currentChunk)
|
|
509
|
-
} else {
|
|
510
|
-
currentChunk += sentence
|
|
511
|
-
tokenCount += sentenceTokens
|
|
568
|
+
index: chunks.length,
|
|
569
|
+
});
|
|
512
570
|
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
// Add final chunk
|
|
516
|
-
if (currentChunk.length > 0) {
|
|
517
|
-
chunks.push({
|
|
518
|
-
text: currentChunk.trim(),
|
|
519
|
-
tokenCount,
|
|
520
|
-
index: chunks.length
|
|
521
|
-
})
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
return chunks
|
|
525
|
-
})
|
|
526
571
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
572
|
+
return chunks;
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
return { chunk } as const;
|
|
576
|
+
}),
|
|
577
|
+
},
|
|
578
|
+
) {}
|
|
530
579
|
```
|
|
531
580
|
|
|
532
581
|
**Embedding Service:**
|
|
582
|
+
|
|
533
583
|
```typescript
|
|
534
584
|
// backend/convex/services/knowledge/embedding.service.ts
|
|
535
|
-
export class EmbeddingService extends Effect.Service<EmbeddingService>()(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
"
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
585
|
+
export class EmbeddingService extends Effect.Service<EmbeddingService>()(
|
|
586
|
+
"EmbeddingService",
|
|
587
|
+
{
|
|
588
|
+
effect: Effect.gen(function* () {
|
|
589
|
+
const config = yield* ConfigService;
|
|
590
|
+
|
|
591
|
+
const embed = (text: string) =>
|
|
592
|
+
Effect.gen(function* () {
|
|
593
|
+
const model = config.embeddingModel || "text-embedding-3-large";
|
|
594
|
+
|
|
595
|
+
// Call OpenAI API
|
|
596
|
+
const response = yield* Effect.tryPromise({
|
|
597
|
+
try: () =>
|
|
598
|
+
fetch("https://api.openai.com/v1/embeddings", {
|
|
599
|
+
method: "POST",
|
|
600
|
+
headers: {
|
|
601
|
+
Authorization: `Bearer ${config.openaiApiKey}`,
|
|
602
|
+
"Content-Type": "application/json",
|
|
603
|
+
},
|
|
604
|
+
body: JSON.stringify({ model, input: text }),
|
|
605
|
+
}),
|
|
606
|
+
catch: (e) => new EmbeddingError({ message: String(e) }),
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
const data = yield* Effect.tryPromise({
|
|
610
|
+
try: () => response.json(),
|
|
611
|
+
catch: (e) => new EmbeddingError({ message: String(e) }),
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
return {
|
|
615
|
+
embedding: data.data[0].embedding,
|
|
616
|
+
model,
|
|
617
|
+
dim: data.data[0].embedding.length,
|
|
618
|
+
};
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
return { embed, embedBatch } as const;
|
|
622
|
+
}),
|
|
623
|
+
},
|
|
624
|
+
) {}
|
|
571
625
|
```
|
|
572
626
|
|
|
573
627
|
**RAG Ingestion Pipeline:**
|
|
628
|
+
|
|
574
629
|
```typescript
|
|
575
630
|
// backend/convex/services/knowledge/rag-ingestion.service.ts
|
|
576
631
|
export const ingestThing = (thingId: string, fields?: string[]) =>
|
|
577
632
|
Effect.gen(function* () {
|
|
578
|
-
const entities = yield* EntityService
|
|
579
|
-
const chunking = yield* ChunkingService
|
|
580
|
-
const embedding = yield* EmbeddingService
|
|
581
|
-
const knowledge = yield* KnowledgeService
|
|
633
|
+
const entities = yield* EntityService;
|
|
634
|
+
const chunking = yield* ChunkingService;
|
|
635
|
+
const embedding = yield* EmbeddingService;
|
|
636
|
+
const knowledge = yield* KnowledgeService;
|
|
582
637
|
|
|
583
638
|
// 1. Get thing
|
|
584
|
-
const thing = yield* entities.get(thingId)
|
|
639
|
+
const thing = yield* entities.get(thingId);
|
|
585
640
|
|
|
586
641
|
// 2. Extract text from specified fields
|
|
587
|
-
const texts = yield* extractTexts(thing, fields)
|
|
642
|
+
const texts = yield* extractTexts(thing, fields);
|
|
588
643
|
|
|
589
644
|
// 3. Chunk each text
|
|
590
|
-
const allChunks = []
|
|
645
|
+
const allChunks = [];
|
|
591
646
|
for (const { field, text, labels } of texts) {
|
|
592
647
|
const chunks = yield* chunking.chunk(text, {
|
|
593
648
|
windowSize: 800,
|
|
594
|
-
overlap: 200
|
|
595
|
-
})
|
|
649
|
+
overlap: 200,
|
|
650
|
+
});
|
|
596
651
|
|
|
597
|
-
allChunks.push(...chunks.map(c => ({ ...c, field, labels })))
|
|
652
|
+
allChunks.push(...chunks.map((c) => ({ ...c, field, labels })));
|
|
598
653
|
}
|
|
599
654
|
|
|
600
655
|
// 4. Embed chunks (batch for efficiency)
|
|
601
656
|
const embeddings = yield* embedding.embedBatch(
|
|
602
|
-
allChunks.map(c => c.text)
|
|
603
|
-
)
|
|
657
|
+
allChunks.map((c) => c.text),
|
|
658
|
+
);
|
|
604
659
|
|
|
605
660
|
// 5. Store knowledge items
|
|
606
661
|
for (let i = 0; i < allChunks.length; i++) {
|
|
607
|
-
const chunk = allChunks[i]
|
|
608
|
-
const { embedding: vector, model, dim } = embeddings[i]
|
|
662
|
+
const chunk = allChunks[i];
|
|
663
|
+
const { embedding: vector, model, dim } = embeddings[i];
|
|
609
664
|
|
|
610
665
|
const knowledgeId = yield* knowledge.create({
|
|
611
666
|
groupId: thing.groupId,
|
|
@@ -619,33 +674,34 @@ export const ingestThing = (thingId: string, fields?: string[]) =>
|
|
|
619
674
|
chunk: {
|
|
620
675
|
index: chunk.index,
|
|
621
676
|
tokenCount: chunk.tokenCount,
|
|
622
|
-
overlap: 200
|
|
677
|
+
overlap: 200,
|
|
623
678
|
},
|
|
624
|
-
labels: chunk.labels
|
|
625
|
-
})
|
|
679
|
+
labels: chunk.labels,
|
|
680
|
+
});
|
|
626
681
|
|
|
627
682
|
// 6. Link to thing via junction table
|
|
628
683
|
yield* knowledge.linkToThing({
|
|
629
684
|
thingId,
|
|
630
685
|
knowledgeId,
|
|
631
|
-
role: "chunk_of"
|
|
632
|
-
})
|
|
686
|
+
role: "chunk_of",
|
|
687
|
+
});
|
|
633
688
|
}
|
|
634
689
|
|
|
635
|
-
return allChunks.length
|
|
636
|
-
})
|
|
690
|
+
return allChunks.length;
|
|
691
|
+
});
|
|
637
692
|
```
|
|
638
693
|
|
|
639
694
|
**Vector Search:**
|
|
695
|
+
|
|
640
696
|
```typescript
|
|
641
697
|
// backend/convex/services/knowledge/vector-search.service.ts
|
|
642
698
|
export const search = (query: string, options: SearchOptions) =>
|
|
643
699
|
Effect.gen(function* () {
|
|
644
|
-
const embedding = yield* EmbeddingService
|
|
645
|
-
const knowledge = yield* KnowledgeService
|
|
700
|
+
const embedding = yield* EmbeddingService;
|
|
701
|
+
const knowledge = yield* KnowledgeService;
|
|
646
702
|
|
|
647
703
|
// 1. Embed query
|
|
648
|
-
const { embedding: queryVector } = yield* embedding.embed(query)
|
|
704
|
+
const { embedding: queryVector } = yield* embedding.embed(query);
|
|
649
705
|
|
|
650
706
|
// 2. Vector search (use Convex vector search when available)
|
|
651
707
|
const results = yield* knowledge.vectorSearch({
|
|
@@ -653,24 +709,25 @@ export const search = (query: string, options: SearchOptions) =>
|
|
|
653
709
|
query: queryVector,
|
|
654
710
|
filter: {
|
|
655
711
|
groupId: options.groupId,
|
|
656
|
-
knowledgeType: "chunk"
|
|
712
|
+
knowledgeType: "chunk",
|
|
657
713
|
},
|
|
658
|
-
k: options.k || 10
|
|
659
|
-
})
|
|
714
|
+
k: options.k || 10,
|
|
715
|
+
});
|
|
660
716
|
|
|
661
717
|
// 3. Hybrid scoring with lexical signals
|
|
662
|
-
const scored = results.map(r => ({
|
|
718
|
+
const scored = results.map((r) => ({
|
|
663
719
|
...r,
|
|
664
|
-
hybridScore: r.similarity * 0.7 + lexicalScore(query, r.text) * 0.3
|
|
665
|
-
}))
|
|
720
|
+
hybridScore: r.similarity * 0.7 + lexicalScore(query, r.text) * 0.3,
|
|
721
|
+
}));
|
|
666
722
|
|
|
667
|
-
return scored.sort((a, b) => b.hybridScore - a.hybridScore)
|
|
668
|
-
})
|
|
723
|
+
return scored.sort((a, b) => b.hybridScore - a.hybridScore);
|
|
724
|
+
});
|
|
669
725
|
```
|
|
670
726
|
|
|
671
727
|
</details>
|
|
672
728
|
|
|
673
729
|
**Acceptance Criteria:**
|
|
730
|
+
|
|
674
731
|
- [ ] Chunking service handles 800-token windows with 200-token overlap
|
|
675
732
|
- [ ] Embedding service integrates with OpenAI API
|
|
676
733
|
- [ ] RAG ingestion pipeline processes all content types
|
|
@@ -696,15 +753,16 @@ export const search = (query: string, options: SearchOptions) =>
|
|
|
696
753
|
<summary>📋 Click to expand: Dashboard Components</summary>
|
|
697
754
|
|
|
698
755
|
**Group Selector:**
|
|
756
|
+
|
|
699
757
|
```tsx
|
|
700
758
|
// web/src/components/groups/GroupSelector.tsx
|
|
701
759
|
export function GroupSelector() {
|
|
702
760
|
const currentGroup = useQuery(api.queries.groups.getById, {
|
|
703
|
-
groupId: useGroupId()
|
|
704
|
-
})
|
|
761
|
+
groupId: useGroupId(),
|
|
762
|
+
});
|
|
705
763
|
const hierarchy = useQuery(api.queries.groups.getHierarchy, {
|
|
706
|
-
rootGroupId: currentGroup?._id
|
|
707
|
-
})
|
|
764
|
+
rootGroupId: currentGroup?._id,
|
|
765
|
+
});
|
|
708
766
|
|
|
709
767
|
return (
|
|
710
768
|
<Select value={currentGroup?._id} onValueChange={switchGroup}>
|
|
@@ -714,43 +772,37 @@ export function GroupSelector() {
|
|
|
714
772
|
</SelectValue>
|
|
715
773
|
</SelectTrigger>
|
|
716
774
|
<SelectContent>
|
|
717
|
-
{hierarchy?.map(group => (
|
|
775
|
+
{hierarchy?.map((group) => (
|
|
718
776
|
<SelectItem key={group._id} value={group._id}>
|
|
719
|
-
{" ".repeat(group.depth)}
|
|
777
|
+
{" ".repeat(group.depth)}
|
|
778
|
+
{group.name}
|
|
720
779
|
</SelectItem>
|
|
721
780
|
))}
|
|
722
781
|
</SelectContent>
|
|
723
782
|
</Select>
|
|
724
|
-
)
|
|
783
|
+
);
|
|
725
784
|
}
|
|
726
785
|
```
|
|
727
786
|
|
|
728
787
|
**Ontology Browser:**
|
|
788
|
+
|
|
729
789
|
```tsx
|
|
730
790
|
// web/src/components/ontology/OntologyBrowser.tsx
|
|
731
791
|
export function OntologyBrowser({ groupId }: { groupId: string }) {
|
|
732
|
-
const [dimension, setDimension] = useState<Dimension>("things")
|
|
792
|
+
const [dimension, setDimension] = useState<Dimension>("things");
|
|
733
793
|
|
|
734
794
|
return (
|
|
735
795
|
<div className="grid grid-cols-[250px_1fr]">
|
|
736
796
|
{/* Sidebar: 6 Dimensions */}
|
|
737
797
|
<aside>
|
|
738
798
|
<nav>
|
|
739
|
-
<button onClick={() => setDimension("groups")}>
|
|
740
|
-
|
|
741
|
-
</button>
|
|
742
|
-
<button onClick={() => setDimension("people")}>
|
|
743
|
-
2. People
|
|
744
|
-
</button>
|
|
745
|
-
<button onClick={() => setDimension("things")}>
|
|
746
|
-
3. Things
|
|
747
|
-
</button>
|
|
799
|
+
<button onClick={() => setDimension("groups")}>1. Groups</button>
|
|
800
|
+
<button onClick={() => setDimension("people")}>2. People</button>
|
|
801
|
+
<button onClick={() => setDimension("things")}>3. Things</button>
|
|
748
802
|
<button onClick={() => setDimension("connections")}>
|
|
749
803
|
4. Connections
|
|
750
804
|
</button>
|
|
751
|
-
<button onClick={() => setDimension("events")}>
|
|
752
|
-
5. Events
|
|
753
|
-
</button>
|
|
805
|
+
<button onClick={() => setDimension("events")}>5. Events</button>
|
|
754
806
|
<button onClick={() => setDimension("knowledge")}>
|
|
755
807
|
6. Knowledge
|
|
756
808
|
</button>
|
|
@@ -765,49 +817,39 @@ export function OntologyBrowser({ groupId }: { groupId: string }) {
|
|
|
765
817
|
{/* ... */}
|
|
766
818
|
</main>
|
|
767
819
|
</div>
|
|
768
|
-
)
|
|
820
|
+
);
|
|
769
821
|
}
|
|
770
822
|
```
|
|
771
823
|
|
|
772
824
|
**Real-Time Stats:**
|
|
825
|
+
|
|
773
826
|
```tsx
|
|
774
827
|
// web/src/components/dashboard/DashboardStats.tsx
|
|
775
828
|
export function DashboardStats({ groupId }: { groupId: string }) {
|
|
776
829
|
const stats = useQuery(api.queries.groups.getStats, {
|
|
777
830
|
groupId,
|
|
778
|
-
includeSubgroups: true
|
|
779
|
-
})
|
|
831
|
+
includeSubgroups: true,
|
|
832
|
+
});
|
|
780
833
|
|
|
781
834
|
return (
|
|
782
835
|
<div className="grid grid-cols-4 gap-4">
|
|
783
|
-
<StatsCard
|
|
784
|
-
|
|
785
|
-
value={stats?.stats.members}
|
|
786
|
-
icon={Users}
|
|
787
|
-
/>
|
|
788
|
-
<StatsCard
|
|
789
|
-
title="Entities"
|
|
790
|
-
value={stats?.stats.entities}
|
|
791
|
-
icon={Box}
|
|
792
|
-
/>
|
|
836
|
+
<StatsCard title="Members" value={stats?.stats.members} icon={Users} />
|
|
837
|
+
<StatsCard title="Entities" value={stats?.stats.entities} icon={Box} />
|
|
793
838
|
<StatsCard
|
|
794
839
|
title="Connections"
|
|
795
840
|
value={stats?.stats.connections}
|
|
796
841
|
icon={Link}
|
|
797
842
|
/>
|
|
798
|
-
<StatsCard
|
|
799
|
-
title="Events"
|
|
800
|
-
value={stats?.stats.events}
|
|
801
|
-
icon={Activity}
|
|
802
|
-
/>
|
|
843
|
+
<StatsCard title="Events" value={stats?.stats.events} icon={Activity} />
|
|
803
844
|
</div>
|
|
804
|
-
)
|
|
845
|
+
);
|
|
805
846
|
}
|
|
806
847
|
```
|
|
807
848
|
|
|
808
849
|
</details>
|
|
809
850
|
|
|
810
851
|
**Acceptance Criteria:**
|
|
852
|
+
|
|
811
853
|
- [ ] Group selector shows full hierarchy with nesting
|
|
812
854
|
- [ ] Dashboard scopes all data to selected group
|
|
813
855
|
- [ ] Real-time stats update via Convex subscriptions
|
|
@@ -830,15 +872,12 @@ export function DashboardStats({ groupId }: { groupId: string }) {
|
|
|
830
872
|
<summary>📋 Click to expand: Entity UI Components</summary>
|
|
831
873
|
|
|
832
874
|
**Generic Entity Form:**
|
|
875
|
+
|
|
833
876
|
```tsx
|
|
834
877
|
// web/src/components/entities/EntityForm.tsx
|
|
835
|
-
export function EntityForm({
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
initialData
|
|
839
|
-
}: EntityFormProps) {
|
|
840
|
-
const createEntity = useMutation(api.mutations.entities.create)
|
|
841
|
-
const schema = getSchemaForType(type)
|
|
878
|
+
export function EntityForm({ type, groupId, initialData }: EntityFormProps) {
|
|
879
|
+
const createEntity = useMutation(api.mutations.entities.create);
|
|
880
|
+
const schema = getSchemaForType(type);
|
|
842
881
|
|
|
843
882
|
return (
|
|
844
883
|
<Form schema={schema} onSubmit={handleSubmit}>
|
|
@@ -863,21 +902,19 @@ export function EntityForm({
|
|
|
863
902
|
|
|
864
903
|
<Button type="submit">Create {type}</Button>
|
|
865
904
|
</Form>
|
|
866
|
-
)
|
|
905
|
+
);
|
|
867
906
|
}
|
|
868
907
|
```
|
|
869
908
|
|
|
870
909
|
**Entity List View:**
|
|
910
|
+
|
|
871
911
|
```tsx
|
|
872
912
|
// web/src/components/entities/EntityList.tsx
|
|
873
|
-
export function EntityList({
|
|
874
|
-
groupId,
|
|
875
|
-
type
|
|
876
|
-
}: EntityListProps) {
|
|
913
|
+
export function EntityList({ groupId, type }: EntityListProps) {
|
|
877
914
|
const entities = useQuery(api.queries.entities.list, {
|
|
878
915
|
groupId,
|
|
879
|
-
type
|
|
880
|
-
})
|
|
916
|
+
type,
|
|
917
|
+
});
|
|
881
918
|
|
|
882
919
|
return (
|
|
883
920
|
<Table>
|
|
@@ -891,7 +928,7 @@ export function EntityList({
|
|
|
891
928
|
</TableRow>
|
|
892
929
|
</TableHeader>
|
|
893
930
|
<TableBody>
|
|
894
|
-
{entities?.map(entity => (
|
|
931
|
+
{entities?.map((entity) => (
|
|
895
932
|
<TableRow key={entity._id}>
|
|
896
933
|
<TableCell>{entity.name}</TableCell>
|
|
897
934
|
<TableCell>
|
|
@@ -900,9 +937,7 @@ export function EntityList({
|
|
|
900
937
|
<TableCell>
|
|
901
938
|
<StatusBadge status={entity.status} />
|
|
902
939
|
</TableCell>
|
|
903
|
-
<TableCell>
|
|
904
|
-
{formatDate(entity.createdAt)}
|
|
905
|
-
</TableCell>
|
|
940
|
+
<TableCell>{formatDate(entity.createdAt)}</TableCell>
|
|
906
941
|
<TableCell>
|
|
907
942
|
<EntityActions entity={entity} />
|
|
908
943
|
</TableCell>
|
|
@@ -910,13 +945,14 @@ export function EntityList({
|
|
|
910
945
|
))}
|
|
911
946
|
</TableBody>
|
|
912
947
|
</Table>
|
|
913
|
-
)
|
|
948
|
+
);
|
|
914
949
|
}
|
|
915
950
|
```
|
|
916
951
|
|
|
917
952
|
</details>
|
|
918
953
|
|
|
919
954
|
**Acceptance Criteria:**
|
|
955
|
+
|
|
920
956
|
- [ ] Entity forms for all 66 thing types
|
|
921
957
|
- [ ] Type-specific property editors (JSON + structured)
|
|
922
958
|
- [ ] Entity list views with filtering and sorting
|
|
@@ -939,49 +975,47 @@ export function EntityList({
|
|
|
939
975
|
<summary>📋 Click to expand: Connection Visualization</summary>
|
|
940
976
|
|
|
941
977
|
**Graph View:**
|
|
978
|
+
|
|
942
979
|
```tsx
|
|
943
980
|
// web/src/components/connections/ConnectionGraph.tsx
|
|
944
|
-
import ReactFlow from
|
|
981
|
+
import ReactFlow from "reactflow";
|
|
945
982
|
|
|
946
983
|
export function ConnectionGraph({ groupId }: { groupId: string }) {
|
|
947
|
-
const connections = useQuery(api.queries.connections.list, { groupId })
|
|
948
|
-
const entities = useQuery(api.queries.entities.list, { groupId })
|
|
984
|
+
const connections = useQuery(api.queries.connections.list, { groupId });
|
|
985
|
+
const entities = useQuery(api.queries.entities.list, { groupId });
|
|
949
986
|
|
|
950
|
-
const nodes = entities?.map(e => ({
|
|
987
|
+
const nodes = entities?.map((e) => ({
|
|
951
988
|
id: e._id,
|
|
952
|
-
type:
|
|
989
|
+
type: "entity",
|
|
953
990
|
data: { label: e.name, type: e.type },
|
|
954
|
-
position: calculatePosition(e) // Use force-directed layout
|
|
955
|
-
}))
|
|
991
|
+
position: calculatePosition(e), // Use force-directed layout
|
|
992
|
+
}));
|
|
956
993
|
|
|
957
|
-
const edges = connections?.map(c => ({
|
|
994
|
+
const edges = connections?.map((c) => ({
|
|
958
995
|
id: c._id,
|
|
959
996
|
source: c.fromEntityId,
|
|
960
997
|
target: c.toEntityId,
|
|
961
998
|
label: c.relationshipType,
|
|
962
|
-
type:
|
|
963
|
-
}))
|
|
999
|
+
type: "smoothstep",
|
|
1000
|
+
}));
|
|
964
1001
|
|
|
965
1002
|
return (
|
|
966
|
-
<ReactFlow
|
|
967
|
-
nodes={nodes}
|
|
968
|
-
edges={edges}
|
|
969
|
-
fitView
|
|
970
|
-
>
|
|
1003
|
+
<ReactFlow nodes={nodes} edges={edges} fitView>
|
|
971
1004
|
<Controls />
|
|
972
1005
|
<Background />
|
|
973
1006
|
</ReactFlow>
|
|
974
|
-
)
|
|
1007
|
+
);
|
|
975
1008
|
}
|
|
976
1009
|
```
|
|
977
1010
|
|
|
978
1011
|
**Relationship Explorer:**
|
|
1012
|
+
|
|
979
1013
|
```tsx
|
|
980
1014
|
// web/src/components/connections/RelationshipExplorer.tsx
|
|
981
1015
|
export function RelationshipExplorer({ entityId }: { entityId: string }) {
|
|
982
|
-
const entity = useQuery(api.queries.entities.get, { entityId })
|
|
983
|
-
const outgoing = useQuery(api.queries.connections.getOutgoing, { entityId })
|
|
984
|
-
const incoming = useQuery(api.queries.connections.getIncoming, { entityId })
|
|
1016
|
+
const entity = useQuery(api.queries.entities.get, { entityId });
|
|
1017
|
+
const outgoing = useQuery(api.queries.connections.getOutgoing, { entityId });
|
|
1018
|
+
const incoming = useQuery(api.queries.connections.getIncoming, { entityId });
|
|
985
1019
|
|
|
986
1020
|
return (
|
|
987
1021
|
<div>
|
|
@@ -989,7 +1023,7 @@ export function RelationshipExplorer({ entityId }: { entityId: string }) {
|
|
|
989
1023
|
|
|
990
1024
|
<section>
|
|
991
1025
|
<h3>Outgoing ({outgoing?.length})</h3>
|
|
992
|
-
{outgoing?.map(conn => (
|
|
1026
|
+
{outgoing?.map((conn) => (
|
|
993
1027
|
<RelationshipCard
|
|
994
1028
|
key={conn._id}
|
|
995
1029
|
type={conn.relationshipType}
|
|
@@ -1001,7 +1035,7 @@ export function RelationshipExplorer({ entityId }: { entityId: string }) {
|
|
|
1001
1035
|
|
|
1002
1036
|
<section>
|
|
1003
1037
|
<h3>Incoming ({incoming?.length})</h3>
|
|
1004
|
-
{incoming?.map(conn => (
|
|
1038
|
+
{incoming?.map((conn) => (
|
|
1005
1039
|
<RelationshipCard
|
|
1006
1040
|
key={conn._id}
|
|
1007
1041
|
type={conn.relationshipType}
|
|
@@ -1011,13 +1045,14 @@ export function RelationshipExplorer({ entityId }: { entityId: string }) {
|
|
|
1011
1045
|
))}
|
|
1012
1046
|
</section>
|
|
1013
1047
|
</div>
|
|
1014
|
-
)
|
|
1048
|
+
);
|
|
1015
1049
|
}
|
|
1016
1050
|
```
|
|
1017
1051
|
|
|
1018
1052
|
</details>
|
|
1019
1053
|
|
|
1020
1054
|
**Acceptance Criteria:**
|
|
1055
|
+
|
|
1021
1056
|
- [ ] Interactive graph view with zoom/pan
|
|
1022
1057
|
- [ ] Filter connections by relationship type
|
|
1023
1058
|
- [ ] Click entity to see details
|
|
@@ -1044,12 +1079,12 @@ export function RelationshipExplorer({ entityId }: { entityId: string }) {
|
|
|
1044
1079
|
export function EventTimeline({ groupId }: { groupId: string }) {
|
|
1045
1080
|
const events = useQuery(api.queries.events.getRecent, {
|
|
1046
1081
|
groupId,
|
|
1047
|
-
limit: 100
|
|
1048
|
-
})
|
|
1082
|
+
limit: 100,
|
|
1083
|
+
});
|
|
1049
1084
|
|
|
1050
1085
|
return (
|
|
1051
1086
|
<div className="space-y-4">
|
|
1052
|
-
{events?.map(event => (
|
|
1087
|
+
{events?.map((event) => (
|
|
1053
1088
|
<EventCard
|
|
1054
1089
|
key={event._id}
|
|
1055
1090
|
type={event.type}
|
|
@@ -1060,12 +1095,18 @@ export function EventTimeline({ groupId }: { groupId: string }) {
|
|
|
1060
1095
|
/>
|
|
1061
1096
|
))}
|
|
1062
1097
|
</div>
|
|
1063
|
-
)
|
|
1098
|
+
);
|
|
1064
1099
|
}
|
|
1065
1100
|
|
|
1066
|
-
function EventCard({
|
|
1067
|
-
|
|
1068
|
-
|
|
1101
|
+
function EventCard({
|
|
1102
|
+
type,
|
|
1103
|
+
actor,
|
|
1104
|
+
target,
|
|
1105
|
+
timestamp,
|
|
1106
|
+
metadata,
|
|
1107
|
+
}: EventCardProps) {
|
|
1108
|
+
const actorEntity = useQuery(api.queries.entities.get, { entityId: actor });
|
|
1109
|
+
const targetEntity = useQuery(api.queries.entities.get, { entityId: target });
|
|
1069
1110
|
|
|
1070
1111
|
return (
|
|
1071
1112
|
<Card>
|
|
@@ -1078,7 +1119,8 @@ function EventCard({ type, actor, target, timestamp, metadata }: EventCardProps)
|
|
|
1078
1119
|
</CardHeader>
|
|
1079
1120
|
<CardContent>
|
|
1080
1121
|
<p>
|
|
1081
|
-
<EntityLink entity={actorEntity} /> {getEventVerb(type)}
|
|
1122
|
+
<EntityLink entity={actorEntity} /> {getEventVerb(type)}{" "}
|
|
1123
|
+
<EntityLink entity={targetEntity} />
|
|
1082
1124
|
</p>
|
|
1083
1125
|
{metadata && (
|
|
1084
1126
|
<pre className="text-xs mt-2">
|
|
@@ -1087,13 +1129,14 @@ function EventCard({ type, actor, target, timestamp, metadata }: EventCardProps)
|
|
|
1087
1129
|
)}
|
|
1088
1130
|
</CardContent>
|
|
1089
1131
|
</Card>
|
|
1090
|
-
)
|
|
1132
|
+
);
|
|
1091
1133
|
}
|
|
1092
1134
|
```
|
|
1093
1135
|
|
|
1094
1136
|
</details>
|
|
1095
1137
|
|
|
1096
1138
|
**Acceptance Criteria:**
|
|
1139
|
+
|
|
1097
1140
|
- [ ] Real-time event stream (Convex subscription)
|
|
1098
1141
|
- [ ] Filter by event type, actor, target
|
|
1099
1142
|
- [ ] Group events by time period (hour, day, week)
|
|
@@ -1122,53 +1165,56 @@ function EventCard({ type, actor, target, timestamp, metadata }: EventCardProps)
|
|
|
1122
1165
|
|
|
1123
1166
|
// Base protocol metadata
|
|
1124
1167
|
export interface ProtocolMetadata {
|
|
1125
|
-
protocol: "a2a" | "acp" | "ap2" | "x402" | "ag-ui"
|
|
1168
|
+
protocol: "a2a" | "acp" | "ap2" | "x402" | "ag-ui";
|
|
1126
1169
|
}
|
|
1127
1170
|
|
|
1128
1171
|
// A2A: Agent-to-Agent Communication
|
|
1129
1172
|
export interface A2AMetadata extends ProtocolMetadata {
|
|
1130
|
-
protocol: "a2a"
|
|
1131
|
-
messageType: "task_delegation" | "status_update" | "result"
|
|
1132
|
-
agentPlatform: "elizaos" | "autogen" | "crewai" | "custom"
|
|
1133
|
-
taskId?: string
|
|
1134
|
-
conversationId?: string
|
|
1173
|
+
protocol: "a2a";
|
|
1174
|
+
messageType: "task_delegation" | "status_update" | "result";
|
|
1175
|
+
agentPlatform: "elizaos" | "autogen" | "crewai" | "custom";
|
|
1176
|
+
taskId?: string;
|
|
1177
|
+
conversationId?: string;
|
|
1135
1178
|
}
|
|
1136
1179
|
|
|
1137
1180
|
// ACP: Agentic Commerce Protocol
|
|
1138
1181
|
export interface ACPMetadata extends ProtocolMetadata {
|
|
1139
|
-
protocol: "acp"
|
|
1140
|
-
eventType:
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1182
|
+
protocol: "acp";
|
|
1183
|
+
eventType:
|
|
1184
|
+
| "purchase_initiated"
|
|
1185
|
+
| "merchant_approved"
|
|
1186
|
+
| "transaction_completed";
|
|
1187
|
+
agentPlatform: "chatgpt" | "claude" | "gemini" | "custom";
|
|
1188
|
+
productId: string;
|
|
1189
|
+
amount: number;
|
|
1190
|
+
currency: string;
|
|
1145
1191
|
}
|
|
1146
1192
|
|
|
1147
1193
|
// AP2: Agent Payments Protocol
|
|
1148
1194
|
export interface AP2Metadata extends ProtocolMetadata {
|
|
1149
|
-
protocol: "ap2"
|
|
1150
|
-
mandateType: "intent" | "cart"
|
|
1151
|
-
autoExecute: boolean
|
|
1152
|
-
maxBudget?: number
|
|
1153
|
-
criteria?: Record<string, any
|
|
1195
|
+
protocol: "ap2";
|
|
1196
|
+
mandateType: "intent" | "cart";
|
|
1197
|
+
autoExecute: boolean;
|
|
1198
|
+
maxBudget?: number;
|
|
1199
|
+
criteria?: Record<string, any>;
|
|
1154
1200
|
}
|
|
1155
1201
|
|
|
1156
1202
|
// X402: HTTP Micropayments
|
|
1157
1203
|
export interface X402Metadata extends ProtocolMetadata {
|
|
1158
|
-
protocol: "x402"
|
|
1159
|
-
scheme: "permit" | "invoice"
|
|
1160
|
-
network: "base" | "ethereum" | "polygon"
|
|
1161
|
-
txHash?: string
|
|
1162
|
-
amount: string
|
|
1163
|
-
resource: string
|
|
1204
|
+
protocol: "x402";
|
|
1205
|
+
scheme: "permit" | "invoice";
|
|
1206
|
+
network: "base" | "ethereum" | "polygon";
|
|
1207
|
+
txHash?: string;
|
|
1208
|
+
amount: string;
|
|
1209
|
+
resource: string;
|
|
1164
1210
|
}
|
|
1165
1211
|
|
|
1166
1212
|
// AG-UI: Generative UI (CopilotKit)
|
|
1167
1213
|
export interface AGUIMetadata extends ProtocolMetadata {
|
|
1168
|
-
protocol: "ag-ui"
|
|
1169
|
-
messageType: "text" | "ui" | "action"
|
|
1170
|
-
component?: string
|
|
1171
|
-
props?: Record<string, any
|
|
1214
|
+
protocol: "ag-ui";
|
|
1215
|
+
messageType: "text" | "ui" | "action";
|
|
1216
|
+
component?: string;
|
|
1217
|
+
props?: Record<string, any>;
|
|
1172
1218
|
}
|
|
1173
1219
|
|
|
1174
1220
|
// Union type for all protocols
|
|
@@ -1177,32 +1223,35 @@ export type AnyProtocolMetadata =
|
|
|
1177
1223
|
| ACPMetadata
|
|
1178
1224
|
| AP2Metadata
|
|
1179
1225
|
| X402Metadata
|
|
1180
|
-
| AGUIMetadata
|
|
1226
|
+
| AGUIMetadata;
|
|
1181
1227
|
|
|
1182
1228
|
// Validation function
|
|
1183
|
-
export const validateProtocolMetadata = (
|
|
1184
|
-
|
|
1229
|
+
export const validateProtocolMetadata = (
|
|
1230
|
+
metadata: any,
|
|
1231
|
+
): metadata is AnyProtocolMetadata => {
|
|
1232
|
+
if (!metadata.protocol) return false;
|
|
1185
1233
|
|
|
1186
1234
|
switch (metadata.protocol) {
|
|
1187
1235
|
case "a2a":
|
|
1188
|
-
return !!metadata.messageType && !!metadata.agentPlatform
|
|
1236
|
+
return !!metadata.messageType && !!metadata.agentPlatform;
|
|
1189
1237
|
case "acp":
|
|
1190
|
-
return !!metadata.eventType && !!metadata.productId
|
|
1238
|
+
return !!metadata.eventType && !!metadata.productId;
|
|
1191
1239
|
case "ap2":
|
|
1192
|
-
return !!metadata.mandateType
|
|
1240
|
+
return !!metadata.mandateType;
|
|
1193
1241
|
case "x402":
|
|
1194
|
-
return !!metadata.scheme && !!metadata.network
|
|
1242
|
+
return !!metadata.scheme && !!metadata.network;
|
|
1195
1243
|
case "ag-ui":
|
|
1196
|
-
return !!metadata.messageType
|
|
1244
|
+
return !!metadata.messageType;
|
|
1197
1245
|
default:
|
|
1198
|
-
return false
|
|
1246
|
+
return false;
|
|
1199
1247
|
}
|
|
1200
|
-
}
|
|
1248
|
+
};
|
|
1201
1249
|
```
|
|
1202
1250
|
|
|
1203
1251
|
</details>
|
|
1204
1252
|
|
|
1205
1253
|
**Acceptance Criteria:**
|
|
1254
|
+
|
|
1206
1255
|
- [ ] TypeScript schemas for all 5 protocols
|
|
1207
1256
|
- [ ] Validation functions enforce schema compliance
|
|
1208
1257
|
- [ ] Backend mutations reject invalid protocol metadata
|
|
@@ -1227,7 +1276,9 @@ export const validateProtocolMetadata = (metadata: any): metadata is AnyProtocol
|
|
|
1227
1276
|
```tsx
|
|
1228
1277
|
// web/src/components/analytics/ProtocolDashboard.tsx
|
|
1229
1278
|
export function ProtocolDashboard({ groupId }: { groupId: string }) {
|
|
1230
|
-
const analytics = useQuery(api.queries.analytics.getProtocolStats, {
|
|
1279
|
+
const analytics = useQuery(api.queries.analytics.getProtocolStats, {
|
|
1280
|
+
groupId,
|
|
1281
|
+
});
|
|
1231
1282
|
|
|
1232
1283
|
return (
|
|
1233
1284
|
<div className="grid grid-cols-2 gap-6">
|
|
@@ -1269,7 +1320,7 @@ export function ProtocolDashboard({ groupId }: { groupId: string }) {
|
|
|
1269
1320
|
<CardContent>
|
|
1270
1321
|
<Table>
|
|
1271
1322
|
<TableBody>
|
|
1272
|
-
{analytics?.topEntities.map(entity => (
|
|
1323
|
+
{analytics?.topEntities.map((entity) => (
|
|
1273
1324
|
<TableRow key={entity._id}>
|
|
1274
1325
|
<TableCell>{entity.name}</TableCell>
|
|
1275
1326
|
<TableCell>${entity.revenue}</TableCell>
|
|
@@ -1280,11 +1331,12 @@ export function ProtocolDashboard({ groupId }: { groupId: string }) {
|
|
|
1280
1331
|
</CardContent>
|
|
1281
1332
|
</Card>
|
|
1282
1333
|
</div>
|
|
1283
|
-
)
|
|
1334
|
+
);
|
|
1284
1335
|
}
|
|
1285
1336
|
```
|
|
1286
1337
|
|
|
1287
1338
|
**Backend Query:**
|
|
1339
|
+
|
|
1288
1340
|
```typescript
|
|
1289
1341
|
// backend/convex/queries/analytics.ts
|
|
1290
1342
|
export const getProtocolStats = query({
|
|
@@ -1293,31 +1345,35 @@ export const getProtocolStats = query({
|
|
|
1293
1345
|
// Get all payment events
|
|
1294
1346
|
const paymentEvents = await ctx.db
|
|
1295
1347
|
.query("events")
|
|
1296
|
-
.withIndex("group_type", q =>
|
|
1297
|
-
q.eq("groupId", groupId).eq("type", "payment_event")
|
|
1348
|
+
.withIndex("group_type", (q) =>
|
|
1349
|
+
q.eq("groupId", groupId).eq("type", "payment_event"),
|
|
1298
1350
|
)
|
|
1299
|
-
.collect()
|
|
1351
|
+
.collect();
|
|
1300
1352
|
|
|
1301
1353
|
// Aggregate by protocol
|
|
1302
|
-
const revenueByProtocol = paymentEvents.reduce(
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1354
|
+
const revenueByProtocol = paymentEvents.reduce(
|
|
1355
|
+
(acc, e) => {
|
|
1356
|
+
const protocol = e.metadata?.protocol || "traditional";
|
|
1357
|
+
acc[protocol] = (acc[protocol] || 0) + (e.metadata?.amount || 0);
|
|
1358
|
+
return acc;
|
|
1359
|
+
},
|
|
1360
|
+
{} as Record<string, number>,
|
|
1361
|
+
);
|
|
1307
1362
|
|
|
1308
1363
|
return {
|
|
1309
1364
|
revenueByProtocol,
|
|
1310
1365
|
volumeOverTime: groupByTime(paymentEvents),
|
|
1311
1366
|
usageByProtocol: countByProtocol(paymentEvents),
|
|
1312
|
-
topEntities: getTopRevenue(paymentEvents)
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
})
|
|
1367
|
+
topEntities: getTopRevenue(paymentEvents),
|
|
1368
|
+
};
|
|
1369
|
+
},
|
|
1370
|
+
});
|
|
1316
1371
|
```
|
|
1317
1372
|
|
|
1318
1373
|
</details>
|
|
1319
1374
|
|
|
1320
1375
|
**Acceptance Criteria:**
|
|
1376
|
+
|
|
1321
1377
|
- [ ] Revenue breakdown by protocol (X402, ACP, AP2, traditional)
|
|
1322
1378
|
- [ ] Transaction volume over time (daily, weekly, monthly)
|
|
1323
1379
|
- [ ] Protocol usage pie chart
|
|
@@ -1419,6 +1475,7 @@ describe("CreatorService", () => {
|
|
|
1419
1475
|
```
|
|
1420
1476
|
|
|
1421
1477
|
**Coverage Goals:**
|
|
1478
|
+
|
|
1422
1479
|
- Unit tests: All Effect.ts services (90%+ coverage)
|
|
1423
1480
|
- Integration tests: Mutations + queries (80%+ coverage)
|
|
1424
1481
|
- E2E tests: Critical user flows (50%+ coverage)
|
|
@@ -1426,6 +1483,7 @@ describe("CreatorService", () => {
|
|
|
1426
1483
|
</details>
|
|
1427
1484
|
|
|
1428
1485
|
**Acceptance Criteria:**
|
|
1486
|
+
|
|
1429
1487
|
- [ ] 90%+ test coverage for services
|
|
1430
1488
|
- [ ] All 66 thing types have create/update tests
|
|
1431
1489
|
- [ ] All 25 connection types have tests
|
|
@@ -1492,6 +1550,7 @@ describe("EntityForm", () => {
|
|
|
1492
1550
|
</details>
|
|
1493
1551
|
|
|
1494
1552
|
**Acceptance Criteria:**
|
|
1553
|
+
|
|
1495
1554
|
- [ ] 70%+ test coverage for components
|
|
1496
1555
|
- [ ] Mock Convex queries/mutations
|
|
1497
1556
|
- [ ] Test real-time updates (subscriptions)
|
|
@@ -1516,71 +1575,79 @@ describe("EntityForm", () => {
|
|
|
1516
1575
|
<summary>📋 Click to expand: Monitoring Setup</summary>
|
|
1517
1576
|
|
|
1518
1577
|
**Error Tracking (Sentry):**
|
|
1578
|
+
|
|
1519
1579
|
```typescript
|
|
1520
1580
|
// backend/convex/lib/sentry.ts
|
|
1521
|
-
import * as Sentry from "@sentry/node"
|
|
1581
|
+
import * as Sentry from "@sentry/node";
|
|
1522
1582
|
|
|
1523
1583
|
Sentry.init({
|
|
1524
1584
|
dsn: process.env.SENTRY_DSN,
|
|
1525
1585
|
environment: process.env.CONVEX_DEPLOYMENT,
|
|
1526
|
-
integrations: [new Sentry.Integrations.Http({ tracing: true })]
|
|
1527
|
-
})
|
|
1586
|
+
integrations: [new Sentry.Integrations.Http({ tracing: true })],
|
|
1587
|
+
});
|
|
1528
1588
|
|
|
1529
|
-
export const withErrorTracking = <T>(
|
|
1530
|
-
operation: Effect.Effect<T, any, any>
|
|
1531
|
-
) =>
|
|
1589
|
+
export const withErrorTracking = <T>(operation: Effect.Effect<T, any, any>) =>
|
|
1532
1590
|
operation.pipe(
|
|
1533
|
-
Effect.tapError(error => {
|
|
1534
|
-
Sentry.captureException(error)
|
|
1535
|
-
return Effect.unit
|
|
1536
|
-
})
|
|
1537
|
-
)
|
|
1591
|
+
Effect.tapError((error) => {
|
|
1592
|
+
Sentry.captureException(error);
|
|
1593
|
+
return Effect.unit;
|
|
1594
|
+
}),
|
|
1595
|
+
);
|
|
1538
1596
|
```
|
|
1539
1597
|
|
|
1540
1598
|
**Metrics (Prometheus):**
|
|
1599
|
+
|
|
1541
1600
|
```typescript
|
|
1542
1601
|
// backend/convex/lib/metrics.ts
|
|
1543
|
-
import { Counter, Histogram } from "prom-client"
|
|
1602
|
+
import { Counter, Histogram } from "prom-client";
|
|
1544
1603
|
|
|
1545
1604
|
export const entityCreationCounter = new Counter({
|
|
1546
1605
|
name: "entity_created_total",
|
|
1547
1606
|
help: "Total entities created",
|
|
1548
|
-
labelNames: ["type", "groupId"]
|
|
1549
|
-
})
|
|
1607
|
+
labelNames: ["type", "groupId"],
|
|
1608
|
+
});
|
|
1550
1609
|
|
|
1551
1610
|
export const mutationDuration = new Histogram({
|
|
1552
1611
|
name: "mutation_duration_seconds",
|
|
1553
1612
|
help: "Mutation execution time",
|
|
1554
|
-
labelNames: ["operation"]
|
|
1555
|
-
})
|
|
1613
|
+
labelNames: ["operation"],
|
|
1614
|
+
});
|
|
1556
1615
|
```
|
|
1557
1616
|
|
|
1558
1617
|
**Logging (Structured):**
|
|
1618
|
+
|
|
1559
1619
|
```typescript
|
|
1560
1620
|
// backend/convex/lib/logger.ts
|
|
1561
|
-
import pino from "pino"
|
|
1621
|
+
import pino from "pino";
|
|
1562
1622
|
|
|
1563
1623
|
export const logger = pino({
|
|
1564
1624
|
level: process.env.LOG_LEVEL || "info",
|
|
1565
1625
|
formatters: {
|
|
1566
1626
|
level: (label) => ({ level: label }),
|
|
1567
|
-
bindings: (bindings) => ({
|
|
1568
|
-
|
|
1569
|
-
|
|
1627
|
+
bindings: (bindings) => ({
|
|
1628
|
+
pid: bindings.pid,
|
|
1629
|
+
hostname: bindings.hostname,
|
|
1630
|
+
}),
|
|
1631
|
+
},
|
|
1632
|
+
});
|
|
1570
1633
|
|
|
1571
1634
|
export const logEvent = (event: Event) => {
|
|
1572
|
-
logger.info(
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1635
|
+
logger.info(
|
|
1636
|
+
{
|
|
1637
|
+
event: event.type,
|
|
1638
|
+
groupId: event.groupId,
|
|
1639
|
+
actorId: event.actorId,
|
|
1640
|
+
timestamp: event.timestamp,
|
|
1641
|
+
},
|
|
1642
|
+
"Event logged",
|
|
1643
|
+
);
|
|
1644
|
+
};
|
|
1579
1645
|
```
|
|
1580
1646
|
|
|
1581
1647
|
</details>
|
|
1582
1648
|
|
|
1583
1649
|
**Acceptance Criteria:**
|
|
1650
|
+
|
|
1584
1651
|
- [ ] Sentry error tracking in production
|
|
1585
1652
|
- [ ] Prometheus metrics exported
|
|
1586
1653
|
- [ ] Structured logging to Cloudflare
|
|
@@ -1610,33 +1677,34 @@ export const migration001 = {
|
|
|
1610
1677
|
// Get all entities without groupId
|
|
1611
1678
|
const entities = await ctx.db
|
|
1612
1679
|
.query("entities")
|
|
1613
|
-
.filter(q => q.eq(q.field("groupId"), undefined))
|
|
1614
|
-
.collect()
|
|
1680
|
+
.filter((q) => q.eq(q.field("groupId"), undefined))
|
|
1681
|
+
.collect();
|
|
1615
1682
|
|
|
1616
1683
|
// Assign to default group
|
|
1617
1684
|
const defaultGroup = await ctx.db
|
|
1618
1685
|
.query("groups")
|
|
1619
|
-
.withIndex("by_slug", q => q.eq("slug", "default"))
|
|
1620
|
-
.first()
|
|
1686
|
+
.withIndex("by_slug", (q) => q.eq("slug", "default"))
|
|
1687
|
+
.first();
|
|
1621
1688
|
|
|
1622
1689
|
for (const entity of entities) {
|
|
1623
1690
|
await ctx.db.patch(entity._id, {
|
|
1624
|
-
groupId: defaultGroup._id
|
|
1625
|
-
})
|
|
1691
|
+
groupId: defaultGroup._id,
|
|
1692
|
+
});
|
|
1626
1693
|
}
|
|
1627
1694
|
|
|
1628
|
-
logger.info(`Migrated ${entities.length} entities to default group`)
|
|
1695
|
+
logger.info(`Migrated ${entities.length} entities to default group`);
|
|
1629
1696
|
},
|
|
1630
1697
|
|
|
1631
1698
|
down: async (ctx: MigrationContext) => {
|
|
1632
1699
|
// Rollback logic
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1700
|
+
},
|
|
1701
|
+
};
|
|
1635
1702
|
```
|
|
1636
1703
|
|
|
1637
1704
|
</details>
|
|
1638
1705
|
|
|
1639
1706
|
**Acceptance Criteria:**
|
|
1707
|
+
|
|
1640
1708
|
- [ ] Versioned migration system
|
|
1641
1709
|
- [ ] Automatic backups before migration
|
|
1642
1710
|
- [ ] Rollback capability
|
|
@@ -1651,29 +1719,32 @@ export const migration001 = {
|
|
|
1651
1719
|
|
|
1652
1720
|
### Total Effort Estimate
|
|
1653
1721
|
|
|
1654
|
-
| Category
|
|
1655
|
-
|
|
1656
|
-
| Backend Integration
|
|
1657
|
-
| Frontend Integration | 2.1-2.4
|
|
1658
|
-
| Protocol Integration | 3.1-3.2
|
|
1659
|
-
| Testing & Quality
|
|
1660
|
-
| Operations
|
|
1661
|
-
| **TOTAL**
|
|
1722
|
+
| Category | Tasks | Effort | Priority |
|
|
1723
|
+
| -------------------- | ------------ | ----------------------- | -------- |
|
|
1724
|
+
| Backend Integration | 1.1-1.5 | 236 hours (29.5 days) | P0 |
|
|
1725
|
+
| Frontend Integration | 2.1-2.4 | 156 hours (19.5 days) | P1 |
|
|
1726
|
+
| Protocol Integration | 3.1-3.2 | 40 hours (5 days) | P2 |
|
|
1727
|
+
| Testing & Quality | 4.1-4.2 | 120 hours (15 days) | P0 |
|
|
1728
|
+
| Operations | 5.1-5.2 | 40 hours (5 days) | P2 |
|
|
1729
|
+
| **TOTAL** | **47 tasks** | **592 hours (74 days)** | |
|
|
1662
1730
|
|
|
1663
1731
|
### Recommended Phases
|
|
1664
1732
|
|
|
1665
1733
|
**Phase 1: Core Backend (Weeks 1-4)**
|
|
1734
|
+
|
|
1666
1735
|
- Complete 1.1: Missing backend mutations/queries
|
|
1667
1736
|
- Complete 1.2: Effect.ts glue layer
|
|
1668
1737
|
- Complete 1.3: Event logging
|
|
1669
1738
|
- **Deliverable:** All 66 thing types operational
|
|
1670
1739
|
|
|
1671
1740
|
**Phase 2: Testing & Quality (Weeks 5-6)**
|
|
1741
|
+
|
|
1672
1742
|
- Complete 4.1: Backend test suite
|
|
1673
1743
|
- Complete 4.2: Frontend integration tests
|
|
1674
1744
|
- **Deliverable:** 90% test coverage
|
|
1675
1745
|
|
|
1676
1746
|
**Phase 3: Frontend (Weeks 7-10)**
|
|
1747
|
+
|
|
1677
1748
|
- Complete 2.1: Multi-tenant dashboard
|
|
1678
1749
|
- Complete 2.2: Entity management UI
|
|
1679
1750
|
- Complete 2.3: Connection visualization
|
|
@@ -1681,12 +1752,14 @@ export const migration001 = {
|
|
|
1681
1752
|
- **Deliverable:** Production-ready UI
|
|
1682
1753
|
|
|
1683
1754
|
**Phase 4: Advanced Features (Weeks 11-12)**
|
|
1755
|
+
|
|
1684
1756
|
- Complete 1.4: Connection management
|
|
1685
1757
|
- Complete 1.5: RAG implementation
|
|
1686
1758
|
- Complete 3.1-3.2: Protocol integration
|
|
1687
1759
|
- **Deliverable:** Full protocol support + RAG
|
|
1688
1760
|
|
|
1689
1761
|
**Phase 5: Production Ready (Weeks 13-14)**
|
|
1762
|
+
|
|
1690
1763
|
- Complete 5.1: Monitoring
|
|
1691
1764
|
- Complete 5.2: Migrations
|
|
1692
1765
|
- Load testing
|
|
@@ -1698,24 +1771,28 @@ export const migration001 = {
|
|
|
1698
1771
|
## Key Metrics for Success
|
|
1699
1772
|
|
|
1700
1773
|
**Backend Completeness:**
|
|
1774
|
+
|
|
1701
1775
|
- ✅ 66/66 thing types have CRUD operations
|
|
1702
1776
|
- ✅ 25/25 connection types implemented
|
|
1703
1777
|
- ✅ 67/67 event types logged
|
|
1704
1778
|
- ✅ 100% Effect.ts coverage
|
|
1705
1779
|
|
|
1706
1780
|
**Frontend Completeness:**
|
|
1781
|
+
|
|
1707
1782
|
- ✅ Multi-tenant dashboard with hierarchy
|
|
1708
1783
|
- ✅ Entity forms for all types
|
|
1709
1784
|
- ✅ Real-time subscriptions working
|
|
1710
1785
|
- ✅ Graph visualization
|
|
1711
1786
|
|
|
1712
1787
|
**Quality:**
|
|
1788
|
+
|
|
1713
1789
|
- ✅ 90%+ backend test coverage
|
|
1714
1790
|
- ✅ 70%+ frontend test coverage
|
|
1715
1791
|
- ✅ Zero TypeScript errors
|
|
1716
1792
|
- ✅ Sub-200ms mutation latency
|
|
1717
1793
|
|
|
1718
1794
|
**Production Readiness:**
|
|
1795
|
+
|
|
1719
1796
|
- ✅ Error tracking live
|
|
1720
1797
|
- ✅ Metrics dashboards
|
|
1721
1798
|
- ✅ Automated backups
|