oneie 2.0.2 → 2.0.3
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/AGENTS.md +245 -0
- package/CLAUDE.md +534 -0
- package/one/.obsidian/app.json +1 -0
- package/one/.obsidian/appearance.json +1 -0
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/workspace.json +211 -0
- package/one/connections/a2a.md +551 -0
- package/one/connections/acp.md +761 -0
- package/one/connections/acps.md +731 -0
- package/one/connections/agui.md +767 -0
- package/one/connections/any-backend.md +1702 -0
- package/one/connections/ap2.md +998 -0
- package/one/connections/api-docs.md +1891 -0
- package/one/connections/api.md +2190 -0
- package/one/connections/architecture-diagram.md +94 -0
- package/one/connections/communications.md +449 -0
- package/one/connections/connections.md +339 -0
- package/one/connections/cryptonetworks.md +781 -0
- package/one/connections/documentation.md +1120 -0
- package/one/connections/effect.md +279 -0
- package/one/connections/elizaos.md +1290 -0
- package/one/connections/inference.md +58 -0
- package/one/connections/kyc.md +632 -0
- package/one/connections/mcp.md +842 -0
- package/one/connections/membership.md +1152 -0
- package/one/connections/middleware.md +1067 -0
- package/one/connections/multitenant.md +1341 -0
- package/one/connections/n8n.md +1015 -0
- package/one/connections/patterns.md +89 -0
- package/one/connections/protocols.md +279 -0
- package/one/connections/relationships.md +107 -0
- package/one/connections/schema.md +587 -0
- package/one/connections/service-layer.md +550 -0
- package/one/connections/structure.md +0 -0
- package/one/connections/vectors.md +207 -0
- package/one/connections/wordpress.md +1302 -0
- package/one/connections/workflow-copy.md +905 -0
- package/one/connections/workflow-examples.md +741 -0
- package/one/connections/workflow.md +905 -0
- package/one/connections/workflows/delegation.md +885 -0
- package/one/connections/workflows/frontend.md +1037 -0
- package/one/connections/workflows/strategy.md +903 -0
- package/one/connections/workflows/tasks.md +698 -0
- package/one/connections/x402.md +1249 -0
- package/one/events/events.md +545 -0
- package/one/knowledge/ai-platform.md +305 -0
- package/one/knowledge/architecture-diagram.md +94 -0
- package/one/knowledge/architecture-frontend.md +930 -0
- package/one/knowledge/architecture.md +2077 -0
- package/one/knowledge/crypto.md +960 -0
- package/one/knowledge/dsl.md +1660 -0
- package/one/knowledge/files.md +2471 -0
- package/one/knowledge/frontend.md +1038 -0
- package/one/knowledge/hono.md +2109 -0
- package/one/knowledge/implementation-examples.md +2536 -0
- package/one/knowledge/inference-score.md +159 -0
- package/one/knowledge/knowledge.md +642 -0
- package/one/knowledge/language.md +980 -0
- package/one/knowledge/lessons-learned.md +70 -0
- package/one/knowledge/ontology-6-dimensions.md +0 -0
- package/one/knowledge/ontology-documentation.md +356 -0
- package/one/knowledge/ontology-engineering-specification.md +1292 -0
- package/one/knowledge/ontology-engineering.md +1652 -0
- package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
- package/one/knowledge/ontology-frontend-copy.md +753 -0
- package/one/knowledge/ontology-frontend-specifications.md +2188 -0
- package/one/knowledge/ontology-frontend.md +2427 -0
- package/one/knowledge/ontology-minimal.yaml +299 -0
- package/one/knowledge/ontology.md +2819 -0
- package/one/knowledge/ontology.yaml +1165 -0
- package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
- package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
- package/one/knowledge/patterns/backend/mutation-template.md +231 -0
- package/one/knowledge/patterns/backend/query-template.md +267 -0
- package/one/knowledge/patterns/backend/service-template.md +237 -0
- package/one/knowledge/patterns/design/component-architecture.md +399 -0
- package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
- package/one/knowledge/patterns/design/wireframe-template.md +216 -0
- package/one/knowledge/patterns/frontend/component-template.md +195 -0
- package/one/knowledge/patterns/frontend/form-template.md +276 -0
- package/one/knowledge/patterns/frontend/page-template.md +178 -0
- package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
- package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
- package/one/knowledge/patterns/test/technical-test-template.md +544 -0
- package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
- package/one/knowledge/patterns/test/user-flow-template.md +254 -0
- package/one/knowledge/quality-loop.md +401 -0
- package/one/knowledge/readme.md +131 -0
- package/one/knowledge/rules.md +626 -0
- package/one/knowledge/score.md +67 -0
- package/one/knowledge/specifications.md +855 -0
- package/one/knowledge/tags.md +130 -0
- package/one/organisation/one.md +599 -0
- package/one/organisation/organisation.md +438 -0
- package/one/organisation/revenue.md +673 -0
- package/one/organisation/strategy.md +869 -0
- package/one/organisation/vision.md +98 -0
- package/one/people/anthony-o-connell.md +440 -0
- package/one/people/people.md +567 -0
- package/one/repomix-output.md +92634 -0
- package/one/things/agentkit.md +349 -0
- package/one/things/agents/agent-backend.md +1401 -0
- package/one/things/agents/agent-builder.md +955 -0
- package/one/things/agents/agent-clean.md +709 -0
- package/one/things/agents/agent-clone.md +1341 -0
- package/one/things/agents/agent-designer.md +2177 -0
- package/one/things/agents/agent-director.md +1508 -0
- package/one/things/agents/agent-documenter.md +1049 -0
- package/one/things/agents/agent-frontend.md +1119 -0
- package/one/things/agents/agent-integrator.md +1192 -0
- package/one/things/agents/agent-problem-solver.md +1379 -0
- package/one/things/agents/agent-quality.md +1353 -0
- package/one/things/agents/agent-sales.md +986 -0
- package/one/things/cascade/cascade.yaml +464 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
- package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
- package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
- package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
- package/one/things/cascade/docs/examples/readme.md +222 -0
- package/one/things/cascade/docs/getting-started.md +515 -0
- package/one/things/cascade/docs/workflow.md +1372 -0
- package/one/things/cascade/readme.md +336 -0
- package/one/things/cascade/templates/feature-template.md +267 -0
- package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
- package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
- package/one/things/claude/agents/analyst.md +483 -0
- package/one/things/claude/agents/architect.md +480 -0
- package/one/things/claude/agents/brand-identity-specialist.md +513 -0
- package/one/things/claude/agents/bstp-token-strategist.md +667 -0
- package/one/things/claude/agents/builder-repo.md +489 -0
- package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
- package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
- package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
- package/one/things/claude/agents/company-bullstamp-character.md +587 -0
- package/one/things/claude/agents/company-bullstamp-community.md +292 -0
- package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
- package/one/things/claude/agents/company-bullstamp-token.md +292 -0
- package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
- package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
- package/one/things/claude/agents/content-calendar-planner.md +448 -0
- package/one/things/claude/agents/content-chapter-formatter.md +488 -0
- package/one/things/claude/agents/content-formatter.md +546 -0
- package/one/things/claude/agents/content-hook-specialist.md +462 -0
- package/one/things/claude/agents/content-image-formatter.md +535 -0
- package/one/things/claude/agents/content-introduction-formatter.md +485 -0
- package/one/things/claude/agents/content-multiplication-engine.md +556 -0
- package/one/things/claude/agents/content-playbook-writer.md +448 -0
- package/one/things/claude/agents/content-team-manager.md +622 -0
- package/one/things/claude/agents/content-toc-formatter.md +522 -0
- package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
- package/one/things/claude/agents/core-manager.md +582 -0
- package/one/things/claude/agents/core-master.md +403 -0
- package/one/things/claude/agents/cross-functional-manager.md +471 -0
- package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
- package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
- package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
- package/one/things/claude/agents/crypto-community-analyst.md +298 -0
- package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
- package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
- package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
- package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
- package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
- package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
- package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
- package/one/things/claude/agents/crypto-market-researcher.md +292 -0
- package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
- package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
- package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
- package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
- package/one/things/claude/agents/crypto-team-manager.md +387 -0
- package/one/things/claude/agents/crypto-token-analyst.md +278 -0
- package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
- package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
- package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
- package/one/things/claude/agents/customer-journey-designer.md +481 -0
- package/one/things/claude/agents/customer-success-manager.md +581 -0
- package/one/things/claude/agents/dev.md +413 -0
- package/one/things/claude/agents/documenter.md +546 -0
- package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
- package/one/things/claude/agents/engagement-specialist.md +509 -0
- package/one/things/claude/agents/engineering-architect.md +387 -0
- package/one/things/claude/agents/engineering-business-analyst.md +537 -0
- package/one/things/claude/agents/engineering-developer.md +387 -0
- package/one/things/claude/agents/engineering-director.md +282 -0
- package/one/things/claude/agents/engineering-ingestor.md +649 -0
- package/one/things/claude/agents/engineering-product-manager.md +537 -0
- package/one/things/claude/agents/engineering-product-owner.md +537 -0
- package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
- package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
- package/one/things/claude/agents/engineering-team-manager.md +512 -0
- package/one/things/claude/agents/engineering-user-experience.md +387 -0
- package/one/things/claude/agents/framework-elevate-manager.md +294 -0
- package/one/things/claude/agents/improver.md +763 -0
- package/one/things/claude/agents/intelligence-team-manager.md +385 -0
- package/one/things/claude/agents/lead-capture-expert.md +466 -0
- package/one/things/claude/agents/lead-magnet-creator.md +453 -0
- package/one/things/claude/agents/market-research-analyst.md +412 -0
- package/one/things/claude/agents/marketing-brand-identity.md +314 -0
- package/one/things/claude/agents/marketing-content-hooks.md +450 -0
- package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
- package/one/things/claude/agents/marketing-content-poster.md +361 -0
- package/one/things/claude/agents/marketing-customer-journey.md +326 -0
- package/one/things/claude/agents/marketing-director.md +397 -0
- package/one/things/claude/agents/marketing-engagement.md +326 -0
- package/one/things/claude/agents/marketing-lead-capture.md +326 -0
- package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
- package/one/things/claude/agents/marketing-network-effects.md +326 -0
- package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
- package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
- package/one/things/claude/agents/marketing-team-manager.md +446 -0
- package/one/things/claude/agents/marketing-viral-growth.md +201 -0
- package/one/things/claude/agents/mission-commander.md +373 -0
- package/one/things/claude/agents/network-effect-analyst.md +587 -0
- package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
- package/one/things/claude/agents/npx.md +890 -0
- package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
- package/one/things/claude/agents/one-master.md +355 -0
- package/one/things/claude/agents/one-orchestrator.md +315 -0
- package/one/things/claude/agents/one.md +601 -0
- package/one/things/claude/agents/playbook-generator.md +503 -0
- package/one/things/claude/agents/pm.md +326 -0
- package/one/things/claude/agents/po.md +345 -0
- package/one/things/claude/agents/qa.md +336 -0
- package/one/things/claude/agents/research-foundation-analyst.md +307 -0
- package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
- package/one/things/claude/agents/research-market-analyst.md +307 -0
- package/one/things/claude/agents/research-team-manager.md +482 -0
- package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
- package/one/things/claude/agents/sales-team-manager.md +400 -0
- package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
- package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
- package/one/things/claude/agents/service-advocacy-manager.md +307 -0
- package/one/things/claude/agents/service-success-manager.md +307 -0
- package/one/things/claude/agents/service-team-manager.md +400 -0
- package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
- package/one/things/claude/agents/share-optimization-specialist.md +551 -0
- package/one/things/claude/agents/sm.md +327 -0
- package/one/things/claude/agents/story-teller.md +473 -0
- package/one/things/claude/agents/task-master.md +596 -0
- package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
- package/one/things/claude/agents/tester.md +556 -0
- package/one/things/claude/agents/the-bull-character-manager.md +580 -0
- package/one/things/claude/agents/tools-playbook-generator.md +489 -0
- package/one/things/claude/agents/turbo-repo-builder.md +316 -0
- package/one/things/claude/agents/upsell-strategist.md +480 -0
- package/one/things/claude/agents/ux-expert.md +335 -0
- package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
- package/one/things/claude/claude-code-hooks-development.json +21 -0
- package/one/things/claude/claude-code-hooks-production.json +21 -0
- package/one/things/claude/claude-code-hooks.json +25 -0
- package/one/things/claude/commands/agent.md +104 -0
- package/one/things/claude/commands/cascade-status.md +128 -0
- package/one/things/claude/commands/ingest.md +290 -0
- package/one/things/claude/commands/ingestor.md +136 -0
- package/one/things/claude/commands/mission.md +83 -0
- package/one/things/claude/commands/npx.md +133 -0
- package/one/things/claude/commands/one.md +440 -0
- package/one/things/claude/commands/quality-check.md +204 -0
- package/one/things/claude/commands/smart-route.md +220 -0
- package/one/things/claude/commands/start.md +121 -0
- package/one/things/claude/commands/story.md +83 -0
- package/one/things/claude/commands/task.md +173 -0
- package/one/things/claude/hook-bypass.json +32 -0
- package/one/things/claude/hooks/agent-hook-config.json +427 -0
- package/one/things/claude/hooks/agent-hook-manager.js +525 -0
- package/one/things/claude/hooks/agent-load-balancer.js +271 -0
- package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
- package/one/things/claude/hooks/build-hook.sh +156 -0
- package/one/things/claude/hooks/cascade-feedback.js +297 -0
- package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
- package/one/things/claude/hooks/cleanup-hook.sh +201 -0
- package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
- package/one/things/claude/hooks/file-organization-engine.js +427 -0
- package/one/things/claude/hooks/file-organization-hook.sh +80 -0
- package/one/things/claude/hooks/file-organization-monitor.js +269 -0
- package/one/things/claude/hooks/format-hook.sh +43 -0
- package/one/things/claude/hooks/hook-bypass.sh +293 -0
- package/one/things/claude/hooks/hook-config-manager.js +202 -0
- package/one/things/claude/hooks/hook-debouncer.sh +62 -0
- package/one/things/claude/hooks/hook-logger.sh +89 -0
- package/one/things/claude/hooks/hook-orchestrator.js +662 -0
- package/one/things/claude/hooks/hook-performance-report.js +120 -0
- package/one/things/claude/hooks/lint-hook.sh +140 -0
- package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
- package/one/things/claude/hooks/memory-optimizer.js +510 -0
- package/one/things/claude/hooks/notification-hook.sh +204 -0
- package/one/things/claude/hooks/ontology-compliance.js +394 -0
- package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
- package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
- package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
- package/one/things/claude/hooks/performance-metrics.json +25 -0
- package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
- package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
- package/one/things/claude/hooks/security-hook.sh +256 -0
- package/one/things/claude/hooks/simple-load-balancer.js +238 -0
- package/one/things/claude/hooks/startup-optimizer.js +625 -0
- package/one/things/claude/hooks/story-scoring-system.js +445 -0
- package/one/things/claude/hooks/story-validation-engine.js +473 -0
- package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
- package/one/things/claude/hooks/story-validation-hook.sh +145 -0
- package/one/things/claude/hooks/structure-synchronizer.js +194 -0
- package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
- package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
- package/one/things/claude/hooks/test-hook.sh +145 -0
- package/one/things/claude/hooks/test-story-validation.sh +170 -0
- package/one/things/claude/hooks/trinity-validation-system.js +392 -0
- package/one/things/claude/settings-local.json +86 -0
- package/one/things/cli-code.md +652 -0
- package/one/things/cli-compiler-code.md +652 -0
- package/one/things/cli.md +1045 -0
- package/one/things/components/card-shadcn.md +929 -0
- package/one/things/components/card.md +1050 -0
- package/one/things/components.md +1669 -0
- package/one/things/componets.md +4 -0
- package/one/things/copilotkit.md +1559 -0
- package/one/things/creator-diagram.md +166 -0
- package/one/things/examples/children/lemonade-stand.md +366 -0
- package/one/things/examples/enterprise/crm-saas.md +1429 -0
- package/one/things/features/1-1-agent-prompts/design.md +470 -0
- package/one/things/features/1-1-agent-prompts/tests.md +264 -0
- package/one/things/features/1-1-agent-prompts.md +486 -0
- package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
- package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
- package/one/things/features/1-2-yaml-orchestrator.md +516 -0
- package/one/things/features/1-3-event-coordination/design.md +544 -0
- package/one/things/features/1-3-event-coordination/tests.md +223 -0
- package/one/things/features/1-3-event-coordination.md +508 -0
- package/one/things/features/1-4-knowledge-management/design.md +609 -0
- package/one/things/features/1-4-knowledge-management/tests.md +195 -0
- package/one/things/features/1-4-knowledge-management.md +577 -0
- package/one/things/features/1-5-quality-loops/design.md +797 -0
- package/one/things/features/1-5-quality-loops/tests.md +212 -0
- package/one/things/features/1-5-quality-loops.md +641 -0
- package/one/things/features/1-6-numbering-structure/design.md +610 -0
- package/one/things/features/1-6-numbering-structure/tests.md +213 -0
- package/one/things/features/1-6-numbering-structure.md +575 -0
- package/one/things/features/2-cli.md +1235 -0
- package/one/things/features/use-one-backend.md +1180 -0
- package/one/things/ideas/1-create-workflow.md +189 -0
- package/one/things/plans/1-create-workflow-status.md +555 -0
- package/one/things/plans/1-create-workflow.md +713 -0
- package/one/things/plans/app.md +761 -0
- package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
- package/one/things/plans/better-auth-any-backend.md +1852 -0
- package/one/things/plans/better-auth-available-features.md +235 -0
- package/one/things/plans/big-plan.md +38 -0
- package/one/things/plans/convex-better-auth.md +1109 -0
- package/one/things/plans/convex-on-off.md +389 -0
- package/one/things/plans/desktop.md +1121 -0
- package/one/things/plans/effect-components.md +1669 -0
- package/one/things/plans/effect.md +973 -0
- package/one/things/plans/email.md +953 -0
- package/one/things/plans/enhance-auth.md +1669 -0
- package/one/things/plans/install-components.md +198 -0
- package/one/things/plans/landing.md +728 -0
- package/one/things/plans/layout.md +205 -0
- package/one/things/plans/mail-backend.md +1308 -0
- package/one/things/plans/mail.md +2624 -0
- package/one/things/plans/next-features.md +83 -0
- package/one/things/plans/one.md +658 -0
- package/one/things/plans/ontology-6-dimensions.md +2216 -0
- package/one/things/plans/ontology-driven-strategy.md +866 -0
- package/one/things/plans/ontology-ui-approach.md +357 -0
- package/one/things/plans/open-agent.md +785 -0
- package/one/things/plans/performace.md +90 -0
- package/one/things/plans/releases.md +809 -0
- package/one/things/plans/repos.md +76 -0
- package/one/things/plans/separate-copy-2.md +1293 -0
- package/one/things/plans/separate-copy-3.md +2458 -0
- package/one/things/plans/separate-copy.md +1293 -0
- package/one/things/plans/separate.md +1983 -0
- package/one/things/plans/shadcn-integration-summary.md +450 -0
- package/one/things/plans/sidebar.md +172 -0
- package/one/things/plans/small-fixes.md +5 -0
- package/one/things/plans/test-backend-connection.md +476 -0
- package/one/things/plans/workflow-files.md +1196 -0
- package/one/things/plans/workflow.md +1372 -0
- package/one/things/products/cascade-landing-page.md +737 -0
- package/one/things/products/cascade.md +1518 -0
- package/one/things/products/context-engineering.md +1427 -0
- package/one/things/products/onthology.md +0 -0
- package/one/things/products/ontology-ui-shadcn.md +1280 -0
- package/one/things/products/ontology-ui.md +1387 -0
- package/one/things/products/ontology.md +717 -0
- package/one/things/products/sdk.md +557 -0
- package/one/things/promptkit.md +903 -0
- package/one/things/service-providers-new.md +982 -0
- package/one/things/service-providers.md +1092 -0
- package/one/things/things.md +349 -0
- package/one/things/todo.md +1248 -0
- package/package.json +5 -2
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// src/commands/create-feature.ts
|
|
3
|
+
// Command: one create-feature <file>
|
|
4
|
+
// ============================================================================
|
|
5
|
+
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import chalk from "chalk";
|
|
10
|
+
import ora from "ora";
|
|
11
|
+
import { PlainEnglishParser } from "../compiler/parser";
|
|
12
|
+
import { ONEValidator } from "../compiler/validator";
|
|
13
|
+
import { ONECompiler } from "../compiler/compiler";
|
|
14
|
+
import { TestGenerator } from "../compiler/test-generator";
|
|
15
|
+
import { loadOntology } from "../utils/ontology-loader";
|
|
16
|
+
|
|
17
|
+
export const createFeatureCommand = new Command("create-feature")
|
|
18
|
+
.description("Create a new feature from Plain English DSL")
|
|
19
|
+
.argument("<file>", "Path to .english or .one file")
|
|
20
|
+
.option("-v, --validate-only", "Only validate, don't generate code")
|
|
21
|
+
.option("-o, --output <dir>", "Output directory", "./generated")
|
|
22
|
+
.option("--no-tests", "Skip test generation")
|
|
23
|
+
.option("--dry-run", "Show what would be generated without writing files")
|
|
24
|
+
.action(async (file: string, options) => {
|
|
25
|
+
const spinner = ora("Loading feature spec...").start();
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
// Step 1: Read Plain English file
|
|
29
|
+
const englishSpec = fs.readFileSync(file, "utf-8");
|
|
30
|
+
spinner.succeed(`Loaded ${chalk.cyan(file)}`);
|
|
31
|
+
|
|
32
|
+
// Step 2: Parse Plain English → Technical DSL
|
|
33
|
+
spinner.start("Parsing Plain English...");
|
|
34
|
+
const parser = new PlainEnglishParser();
|
|
35
|
+
const technicalDSL = parser.parse(englishSpec);
|
|
36
|
+
spinner.succeed(
|
|
37
|
+
`Parsed into Technical DSL (${technicalDSL.flow.length} steps)`
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Step 3: Load ontology
|
|
41
|
+
spinner.start("Loading ontology...");
|
|
42
|
+
const ontology = await loadOntology();
|
|
43
|
+
spinner.succeed("Ontology loaded");
|
|
44
|
+
|
|
45
|
+
// Step 4: Validate against ontology
|
|
46
|
+
spinner.start("Validating against ontology...");
|
|
47
|
+
const validator = new ONEValidator(ontology);
|
|
48
|
+
const validation = validator.validate(technicalDSL);
|
|
49
|
+
|
|
50
|
+
if (!validation.valid) {
|
|
51
|
+
spinner.fail("Validation failed");
|
|
52
|
+
console.log(chalk.red("\nValidation Errors:"));
|
|
53
|
+
validation.errors.forEach((error, i) => {
|
|
54
|
+
console.log(chalk.red(` ${i + 1}. ${error}`));
|
|
55
|
+
});
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
spinner.succeed("Validation passed");
|
|
60
|
+
|
|
61
|
+
if (options.validateOnly) {
|
|
62
|
+
console.log(chalk.green("\n✓ Feature is valid!"));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Step 5: Compile to TypeScript
|
|
67
|
+
spinner.start("Compiling to TypeScript...");
|
|
68
|
+
const compiler = new ONECompiler();
|
|
69
|
+
const generatedCode = compiler.compile(technicalDSL);
|
|
70
|
+
spinner.succeed("TypeScript generated");
|
|
71
|
+
|
|
72
|
+
// Step 6: Generate tests
|
|
73
|
+
let testCode = "";
|
|
74
|
+
if (options.tests) {
|
|
75
|
+
spinner.start("Generating tests...");
|
|
76
|
+
const testGen = new TestGenerator();
|
|
77
|
+
testCode = testGen.generate(technicalDSL);
|
|
78
|
+
spinner.succeed("Tests generated");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Step 7: Write files
|
|
82
|
+
if (options.dryRun) {
|
|
83
|
+
console.log(chalk.yellow("\n=== DRY RUN - Files that would be created ===\n"));
|
|
84
|
+
console.log(chalk.cyan("Service:"));
|
|
85
|
+
console.log(` ${getServicePath(technicalDSL.feature, options.output)}`);
|
|
86
|
+
|
|
87
|
+
if (options.tests) {
|
|
88
|
+
console.log(chalk.cyan("\nTests:"));
|
|
89
|
+
console.log(` ${getTestPath(technicalDSL.feature, options.output)}`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log(chalk.cyan("\nMutation:"));
|
|
93
|
+
console.log(` ${getMutationPath(technicalDSL.feature, options.output)}`);
|
|
94
|
+
|
|
95
|
+
console.log(chalk.cyan("\nComponent:"));
|
|
96
|
+
console.log(` ${getComponentPath(technicalDSL.feature, options.output)}`);
|
|
97
|
+
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
spinner.start("Writing files...");
|
|
102
|
+
|
|
103
|
+
// Write service
|
|
104
|
+
const servicePath = getServicePath(technicalDSL.feature, options.output);
|
|
105
|
+
writeFile(servicePath, generatedCode.service);
|
|
106
|
+
|
|
107
|
+
// Write mutation
|
|
108
|
+
const mutationPath = getMutationPath(technicalDSL.feature, options.output);
|
|
109
|
+
writeFile(mutationPath, generatedCode.mutation);
|
|
110
|
+
|
|
111
|
+
// Write component
|
|
112
|
+
const componentPath = getComponentPath(technicalDSL.feature, options.output);
|
|
113
|
+
writeFile(componentPath, generatedCode.component);
|
|
114
|
+
|
|
115
|
+
// Write tests
|
|
116
|
+
if (options.tests) {
|
|
117
|
+
const testPath = getTestPath(technicalDSL.feature, options.output);
|
|
118
|
+
writeFile(testPath, testCode);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
spinner.succeed("Files written");
|
|
122
|
+
|
|
123
|
+
// Success summary
|
|
124
|
+
console.log(chalk.green("\n✓ Feature created successfully!\n"));
|
|
125
|
+
console.log(chalk.bold("Generated files:"));
|
|
126
|
+
console.log(` ${chalk.cyan(servicePath)}`);
|
|
127
|
+
console.log(` ${chalk.cyan(mutationPath)}`);
|
|
128
|
+
console.log(` ${chalk.cyan(componentPath)}`);
|
|
129
|
+
if (options.tests) {
|
|
130
|
+
console.log(` ${chalk.cyan(testPath)}`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
console.log(chalk.bold("\nNext steps:"));
|
|
134
|
+
console.log(` 1. Review generated code`);
|
|
135
|
+
console.log(` 2. Run tests: ${chalk.cyan("npm test")}`);
|
|
136
|
+
console.log(` 3. Deploy: ${chalk.cyan("convex deploy")}`);
|
|
137
|
+
} catch (error: any) {
|
|
138
|
+
spinner.fail("Failed to create feature");
|
|
139
|
+
console.error(chalk.red(`\n${error.message}`));
|
|
140
|
+
if (error.stack) {
|
|
141
|
+
console.error(chalk.gray(error.stack));
|
|
142
|
+
}
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// src/compiler/parser.ts
|
|
149
|
+
// Parses Plain English → Technical DSL
|
|
150
|
+
// ============================================================================
|
|
151
|
+
|
|
152
|
+
export class PlainEnglishParser {
|
|
153
|
+
parse(englishSpec: string): any {
|
|
154
|
+
const lines = englishSpec.split("\n").map((l) => l.trim());
|
|
155
|
+
|
|
156
|
+
let feature = "";
|
|
157
|
+
let input: any = {};
|
|
158
|
+
let output: any = {};
|
|
159
|
+
let flow: any[] = [];
|
|
160
|
+
|
|
161
|
+
let currentSection = "";
|
|
162
|
+
let currentStep: any = {};
|
|
163
|
+
|
|
164
|
+
for (let i = 0; i < lines.length; i++) {
|
|
165
|
+
const line = lines[i];
|
|
166
|
+
|
|
167
|
+
// Skip empty lines and comments
|
|
168
|
+
if (!line || line.startsWith("//")) continue;
|
|
169
|
+
|
|
170
|
+
// Parse FEATURE
|
|
171
|
+
if (line.startsWith("FEATURE:")) {
|
|
172
|
+
feature = line.replace("FEATURE:", "").trim();
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Parse INPUT section
|
|
177
|
+
if (line === "INPUT:") {
|
|
178
|
+
currentSection = "input";
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Parse OUTPUT section
|
|
183
|
+
if (line === "OUTPUT:") {
|
|
184
|
+
currentSection = "output";
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Parse FLOW section
|
|
189
|
+
if (line === "FLOW:") {
|
|
190
|
+
currentSection = "flow";
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Parse input/output items
|
|
195
|
+
if (currentSection === "input" && line.startsWith("-")) {
|
|
196
|
+
const [name, description] = this.parseListItem(line);
|
|
197
|
+
input[name] = description;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (currentSection === "output" && line.startsWith("-")) {
|
|
202
|
+
const [name, description] = this.parseListItem(line);
|
|
203
|
+
output[name] = description;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Parse flow commands
|
|
208
|
+
if (currentSection === "flow") {
|
|
209
|
+
const step = this.parseFlowCommand(line, lines, i);
|
|
210
|
+
if (step) {
|
|
211
|
+
flow.push(step);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
feature,
|
|
218
|
+
input,
|
|
219
|
+
output,
|
|
220
|
+
flow,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private parseListItem(line: string): [string, string] {
|
|
225
|
+
// "- name: description"
|
|
226
|
+
const match = line.match(/^-\s*([^:]+):\s*(.+)$/);
|
|
227
|
+
if (match) {
|
|
228
|
+
return [match[1].trim(), match[2].trim()];
|
|
229
|
+
}
|
|
230
|
+
return ["", ""];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
private parseFlowCommand(line: string, lines: string[], index: number): any {
|
|
234
|
+
// CHECK
|
|
235
|
+
if (line.startsWith("CHECK ")) {
|
|
236
|
+
const condition = line.replace("CHECK ", "").trim();
|
|
237
|
+
const otherwiseLine = lines[index + 1];
|
|
238
|
+
let otherwise = null;
|
|
239
|
+
|
|
240
|
+
if (otherwiseLine && otherwiseLine.trim().startsWith("OTHERWISE")) {
|
|
241
|
+
otherwise = otherwiseLine.replace("OTHERWISE", "").trim();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return {
|
|
245
|
+
validate: this.parseCondition(condition),
|
|
246
|
+
onError: otherwise ? { return: { error: otherwise } } : undefined,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// CREATE
|
|
251
|
+
if (line.startsWith("CREATE ")) {
|
|
252
|
+
const match = line.match(/CREATE\s+(\w+)\s+called\s+"([^"]+)"/);
|
|
253
|
+
if (match) {
|
|
254
|
+
return {
|
|
255
|
+
entity: {
|
|
256
|
+
type: this.normalizeEntityType(match[1]),
|
|
257
|
+
name: match[2],
|
|
258
|
+
properties: {},
|
|
259
|
+
status: "active",
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// CONNECT
|
|
266
|
+
if (line.startsWith("CONNECT ")) {
|
|
267
|
+
const match = line.match(/CONNECT\s+(.+)\s+to\s+(.+)\s+as\s+(\w+)/);
|
|
268
|
+
if (match) {
|
|
269
|
+
return {
|
|
270
|
+
connect: {
|
|
271
|
+
from: this.parseReference(match[1]),
|
|
272
|
+
to: this.parseReference(match[2]),
|
|
273
|
+
type: this.normalizeConnectionType(match[3]),
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// RECORD
|
|
280
|
+
if (line.startsWith("RECORD ")) {
|
|
281
|
+
const match = line.match(/RECORD\s+(.+?)(\s+BY\s+(.+))?$/);
|
|
282
|
+
if (match) {
|
|
283
|
+
return {
|
|
284
|
+
event: {
|
|
285
|
+
type: this.normalizeEventType(match[1]),
|
|
286
|
+
actor: match[3] ? this.parseReference(match[3]) : undefined,
|
|
287
|
+
metadata: {},
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// CALL
|
|
294
|
+
if (line.startsWith("CALL ")) {
|
|
295
|
+
const match = line.match(/CALL\s+(\w+)\s+to\s+(.+?)(\s+WITH\s+(.+?))?(\s+SAVE AS\s+(.+))?$/);
|
|
296
|
+
if (match) {
|
|
297
|
+
return {
|
|
298
|
+
service: {
|
|
299
|
+
provider: match[1].toLowerCase(),
|
|
300
|
+
method: this.toMethodName(match[2]),
|
|
301
|
+
params: match[4] ? this.parseParams(match[4]) : {},
|
|
302
|
+
output: match[6] ? match[6].trim() : undefined,
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// GET
|
|
309
|
+
if (line.startsWith("GET ")) {
|
|
310
|
+
const match = line.match(/GET\s+(.+?)\s+WHERE\s+(.+?)(\s+SAVE AS\s+(.+))?$/);
|
|
311
|
+
if (match) {
|
|
312
|
+
return {
|
|
313
|
+
query: {
|
|
314
|
+
from: this.inferTableFromQuery(match[1]),
|
|
315
|
+
where: this.parseWhereConditions(match[2]),
|
|
316
|
+
output: match[4] ? match[4].trim() : undefined,
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// IF
|
|
323
|
+
if (line.startsWith("IF ")) {
|
|
324
|
+
const condition = line.replace("IF ", "").trim();
|
|
325
|
+
return {
|
|
326
|
+
if: {
|
|
327
|
+
condition: this.parseCondition(condition),
|
|
328
|
+
then: [],
|
|
329
|
+
else: [],
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// GIVE (return)
|
|
335
|
+
if (line.startsWith("GIVE ")) {
|
|
336
|
+
const results = line.replace("GIVE ", "").trim();
|
|
337
|
+
return {
|
|
338
|
+
return: this.parseReturnValue(results),
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// WAIT
|
|
343
|
+
if (line.startsWith("WAIT ")) {
|
|
344
|
+
const duration = line.replace("WAIT ", "").trim();
|
|
345
|
+
return {
|
|
346
|
+
wait: this.parseDuration(duration),
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
private normalizeEntityType(type: string): string {
|
|
354
|
+
const map: Record<string, string> = {
|
|
355
|
+
"ai clone": "ai_clone",
|
|
356
|
+
"audience member": "audience_member",
|
|
357
|
+
token: "token",
|
|
358
|
+
creator: "creator",
|
|
359
|
+
course: "course",
|
|
360
|
+
content: "blog_post",
|
|
361
|
+
};
|
|
362
|
+
return map[type.toLowerCase()] || type.toLowerCase();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
private normalizeConnectionType(type: string): string {
|
|
366
|
+
const map: Record<string, string> = {
|
|
367
|
+
owner: "owns",
|
|
368
|
+
holder: "holds_tokens",
|
|
369
|
+
enrolled: "enrolled_in",
|
|
370
|
+
author: "authored",
|
|
371
|
+
};
|
|
372
|
+
return map[type.toLowerCase()] || type.toLowerCase();
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
private normalizeEventType(type: string): string {
|
|
376
|
+
const map: Record<string, string> = {
|
|
377
|
+
"clone created": "clone_created",
|
|
378
|
+
"tokens purchased": "tokens_purchased",
|
|
379
|
+
"course enrolled": "course_enrolled",
|
|
380
|
+
"content published": "content_published",
|
|
381
|
+
};
|
|
382
|
+
return map[type.toLowerCase()] || type.toLowerCase().replace(/\s+/g, "_");
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
private parseReference(ref: string): string {
|
|
386
|
+
// "creator" → "$input.creatorId"
|
|
387
|
+
// "clone ID" → "$cloneId"
|
|
388
|
+
return `$${ref.replace(/\s+/g, "")}`;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
private parseCondition(condition: string): any {
|
|
392
|
+
// "creator exists" → { creatorId: { exists: true } }
|
|
393
|
+
// "balance > 0" → { balance: { gt: 0 } }
|
|
394
|
+
return { parsed: condition };
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
private parseParams(params: string): any {
|
|
398
|
+
// "amount $100" → { amount: 100 }
|
|
399
|
+
return { raw: params };
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
private parseWhereConditions(conditions: string): any[] {
|
|
403
|
+
return [{ field: "parsed", operator: "eq", value: conditions }];
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
private inferTableFromQuery(query: string): string {
|
|
407
|
+
if (query.includes("balance")) return "connections";
|
|
408
|
+
if (query.includes("content")) return "entities";
|
|
409
|
+
return "entities";
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
private parseReturnValue(results: string): any {
|
|
413
|
+
return { value: results };
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
private parseDuration(duration: string): string {
|
|
417
|
+
const map: Record<string, string> = {
|
|
418
|
+
"24 hours": "24h",
|
|
419
|
+
"5 minutes": "5m",
|
|
420
|
+
"1 hour": "1h",
|
|
421
|
+
};
|
|
422
|
+
return map[duration.toLowerCase()] || duration;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
private toMethodName(method: string): string {
|
|
426
|
+
return method.replace(/\s+/g, "");
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// ============================================================================
|
|
431
|
+
// src/compiler/compiler.ts
|
|
432
|
+
// Compiles Technical DSL → TypeScript
|
|
433
|
+
// ============================================================================
|
|
434
|
+
|
|
435
|
+
export class ONECompiler {
|
|
436
|
+
compile(dsl: any): { service: string; mutation: string; component: string } {
|
|
437
|
+
const featureName = this.toCamelCase(dsl.feature);
|
|
438
|
+
const FeatureName = this.toPascalCase(dsl.feature);
|
|
439
|
+
|
|
440
|
+
// Generate service
|
|
441
|
+
const service = this.generateService(featureName, FeatureName, dsl);
|
|
442
|
+
|
|
443
|
+
// Generate mutation
|
|
444
|
+
const mutation = this.generateMutation(featureName, FeatureName, dsl);
|
|
445
|
+
|
|
446
|
+
// Generate component
|
|
447
|
+
const component = this.generateComponent(featureName, FeatureName, dsl);
|
|
448
|
+
|
|
449
|
+
return { service, mutation, component };
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
private generateService(
|
|
453
|
+
featureName: string,
|
|
454
|
+
FeatureName: string,
|
|
455
|
+
dsl: any
|
|
456
|
+
): string {
|
|
457
|
+
const inputParams = Object.entries(dsl.input)
|
|
458
|
+
.map(([name, _]) => `${this.toCamelCase(name)}: Id<"entities">`)
|
|
459
|
+
.join(", ");
|
|
460
|
+
|
|
461
|
+
return `// convex/services/${featureName}.ts
|
|
462
|
+
// Generated from ONE DSL
|
|
463
|
+
import { Effect } from "effect";
|
|
464
|
+
import { ConvexDatabase } from "./core/database";
|
|
465
|
+
import { OpenAIProvider, ElevenLabsProvider, StripeProvider } from "./providers";
|
|
466
|
+
|
|
467
|
+
export class ${FeatureName}Service extends Effect.Service<${FeatureName}Service>()(
|
|
468
|
+
"${FeatureName}Service",
|
|
469
|
+
{
|
|
470
|
+
effect: Effect.gen(function* () {
|
|
471
|
+
const db = yield* ConvexDatabase;
|
|
472
|
+
|
|
473
|
+
return {
|
|
474
|
+
execute: (${inputParams}) =>
|
|
475
|
+
Effect.gen(function* () {
|
|
476
|
+
// TODO: Implement flow steps
|
|
477
|
+
${dsl.flow.map((step: any) => this.generateStep(step)).join("\n ")}
|
|
478
|
+
|
|
479
|
+
return { success: true };
|
|
480
|
+
})
|
|
481
|
+
};
|
|
482
|
+
}),
|
|
483
|
+
dependencies: [ConvexDatabase.Default]
|
|
484
|
+
}
|
|
485
|
+
) {}
|
|
486
|
+
`;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
private generateMutation(
|
|
490
|
+
featureName: string,
|
|
491
|
+
FeatureName: string,
|
|
492
|
+
dsl: any
|
|
493
|
+
): string {
|
|
494
|
+
const inputArgs = Object.entries(dsl.input)
|
|
495
|
+
.map(([name, _]) => `${this.toCamelCase(name)}: v.id("entities")`)
|
|
496
|
+
.join(",\n ");
|
|
497
|
+
|
|
498
|
+
return `// convex/mutations/${featureName}.ts
|
|
499
|
+
import { mutation } from "./_generated/server";
|
|
500
|
+
import { confect } from "confect";
|
|
501
|
+
import { v } from "convex/values";
|
|
502
|
+
import { ${FeatureName}Service } from "../services/${featureName}";
|
|
503
|
+
import { MainLayer } from "../services";
|
|
504
|
+
|
|
505
|
+
export const execute = confect.mutation({
|
|
506
|
+
args: {
|
|
507
|
+
${inputArgs}
|
|
508
|
+
},
|
|
509
|
+
handler: (ctx, args) =>
|
|
510
|
+
Effect.gen(function* () {
|
|
511
|
+
const service = yield* ${FeatureName}Service;
|
|
512
|
+
return yield* service.execute(${Object.keys(dsl.input).map((k) => `args.${this.toCamelCase(k)}`).join(", ")});
|
|
513
|
+
}).pipe(Effect.provide(MainLayer))
|
|
514
|
+
});
|
|
515
|
+
`;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
private generateComponent(
|
|
519
|
+
featureName: string,
|
|
520
|
+
FeatureName: string,
|
|
521
|
+
dsl: any
|
|
522
|
+
): string {
|
|
523
|
+
return `// src/components/features/${featureName}/${FeatureName}.tsx
|
|
524
|
+
import { useMutation } from "convex/react";
|
|
525
|
+
import { api } from "@/convex/_generated/api";
|
|
526
|
+
import { Button } from "@/components/ui/button";
|
|
527
|
+
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
|
|
528
|
+
|
|
529
|
+
export function ${FeatureName}() {
|
|
530
|
+
const execute = useMutation(api.${featureName}.execute);
|
|
531
|
+
|
|
532
|
+
const handleExecute = async () => {
|
|
533
|
+
try {
|
|
534
|
+
const result = await execute({
|
|
535
|
+
// TODO: Add input parameters
|
|
536
|
+
});
|
|
537
|
+
console.log("Success:", result);
|
|
538
|
+
} catch (error) {
|
|
539
|
+
console.error("Error:", error);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
return (
|
|
544
|
+
<Card>
|
|
545
|
+
<CardHeader>
|
|
546
|
+
<CardTitle>${dsl.feature}</CardTitle>
|
|
547
|
+
</CardHeader>
|
|
548
|
+
<CardContent>
|
|
549
|
+
<Button onClick={handleExecute}>Execute</Button>
|
|
550
|
+
</CardContent>
|
|
551
|
+
</Card>
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
`;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
private generateStep(step: any): string {
|
|
558
|
+
if (step.entity) {
|
|
559
|
+
return `// Create entity: ${step.entity.type}`;
|
|
560
|
+
}
|
|
561
|
+
if (step.connect) {
|
|
562
|
+
return `// Create connection: ${step.connect.type}`;
|
|
563
|
+
}
|
|
564
|
+
if (step.event) {
|
|
565
|
+
return `// Log event: ${step.event.type}`;
|
|
566
|
+
}
|
|
567
|
+
return "// Step";
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
private toCamelCase(str: string): string {
|
|
571
|
+
return str
|
|
572
|
+
.toLowerCase()
|
|
573
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
private toPascalCase(str: string): string {
|
|
577
|
+
const camel = this.toCamelCase(str);
|
|
578
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// ============================================================================
|
|
583
|
+
// src/utils/file-helpers.ts
|
|
584
|
+
// ============================================================================
|
|
585
|
+
|
|
586
|
+
function getServicePath(feature: string, outputDir: string): string {
|
|
587
|
+
const name = feature.toLowerCase().replace(/\s+/g, "-");
|
|
588
|
+
return path.join(outputDir, "convex", "services", `${name}.ts`);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function getMutationPath(feature: string, outputDir: string): string {
|
|
592
|
+
const name = feature.toLowerCase().replace(/\s+/g, "-");
|
|
593
|
+
return path.join(outputDir, "convex", "mutations", `${name}.ts`);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
function getComponentPath(feature: string, outputDir: string): string {
|
|
597
|
+
const name = feature
|
|
598
|
+
.split(/\s+/)
|
|
599
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
600
|
+
.join("");
|
|
601
|
+
return path.join(outputDir, "src", "components", "features", name, `${name}.tsx`);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function getTestPath(feature: string, outputDir: string): string {
|
|
605
|
+
const name = feature.toLowerCase().replace(/\s+/g, "-");
|
|
606
|
+
return path.join(outputDir, "tests", "unit", "services", `${name}.test.ts`);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
function writeFile(filePath: string, content: string): void {
|
|
610
|
+
const dir = path.dirname(filePath);
|
|
611
|
+
if (!fs.existsSync(dir)) {
|
|
612
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
613
|
+
}
|
|
614
|
+
fs.writeFileSync(filePath, content);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// ============================================================================
|
|
618
|
+
// src/cli.ts
|
|
619
|
+
// Main CLI entry point
|
|
620
|
+
// ============================================================================
|
|
621
|
+
|
|
622
|
+
import { Command } from "commander";
|
|
623
|
+
import { createFeatureCommand } from "./commands/create-feature";
|
|
624
|
+
|
|
625
|
+
const program = new Command();
|
|
626
|
+
|
|
627
|
+
program
|
|
628
|
+
.name("one")
|
|
629
|
+
.description("ONE Platform CLI - Build features in Plain English")
|
|
630
|
+
.version("2.0.0");
|
|
631
|
+
|
|
632
|
+
// Add commands
|
|
633
|
+
program.addCommand(createFeatureCommand);
|
|
634
|
+
|
|
635
|
+
// Other commands can be added here
|
|
636
|
+
program
|
|
637
|
+
.command("validate <file>")
|
|
638
|
+
.description("Validate a feature spec without generating code")
|
|
639
|
+
.action((file) => {
|
|
640
|
+
// Delegate to create-feature with --validate-only
|
|
641
|
+
createFeatureCommand.parse(["node", "one", file, "--validate-only"]);
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
program
|
|
645
|
+
.command("list-features")
|
|
646
|
+
.description("List all available features")
|
|
647
|
+
.action(() => {
|
|
648
|
+
console.log("Available features:");
|
|
649
|
+
// TODO: List features from generated directory
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
program.parse();
|