oneie 2.0.1 → 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/README.md +61 -4
- 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,1050 @@
|
|
|
1
|
+
# Card Component
|
|
2
|
+
|
|
3
|
+
**Generic card component that renders ANY thing type from the ontology**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`Card` is a universal component that:
|
|
10
|
+
- ✅ Works with all 66 thing types
|
|
11
|
+
- ✅ Reads rendering instructions from ontology UI spec
|
|
12
|
+
- ✅ Eliminates need for type-specific components
|
|
13
|
+
- ✅ Consistent UI across platform (built on shadcn/ui)
|
|
14
|
+
- ✅ Customizable per organization
|
|
15
|
+
|
|
16
|
+
**Before (66 components):**
|
|
17
|
+
```tsx
|
|
18
|
+
<CourseCard course={course} />
|
|
19
|
+
<ProductCard product={product} />
|
|
20
|
+
<PostCard post={post} />
|
|
21
|
+
// ... 63 more type-specific components 😱
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**After (1 component):**
|
|
25
|
+
```tsx
|
|
26
|
+
<Card thing={course} />
|
|
27
|
+
<Card thing={product} />
|
|
28
|
+
<Card thing={post} />
|
|
29
|
+
// Works for ALL types! 🎉
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Architecture
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
┌─────────────────────────────────────────┐
|
|
38
|
+
│ Card (Generic Component) │
|
|
39
|
+
│ │
|
|
40
|
+
│ 1. Receives: thing (any type) │
|
|
41
|
+
│ 2. Reads: ontology UI config │
|
|
42
|
+
│ 3. Renders: fields + actions │
|
|
43
|
+
│ 4. Handles: user interactions │
|
|
44
|
+
└─────────────────────────────────────────┘
|
|
45
|
+
↓
|
|
46
|
+
┌─────────────────────────────────────────┐
|
|
47
|
+
│ Field (Generic Field Renderer) │
|
|
48
|
+
│ │
|
|
49
|
+
│ - Heading, Text, Price, Image, etc. │
|
|
50
|
+
│ - Reads field config from ontology │
|
|
51
|
+
│ - Renders appropriate component │
|
|
52
|
+
└─────────────────────────────────────────┘
|
|
53
|
+
↓
|
|
54
|
+
┌─────────────────────────────────────────┐
|
|
55
|
+
│ Actions (Generic Action Handler) │
|
|
56
|
+
│ │
|
|
57
|
+
│ - Reads actions from ontology │
|
|
58
|
+
│ - Renders buttons/links │
|
|
59
|
+
│ - Handles clicks → services │
|
|
60
|
+
└─────────────────────────────────────────┘
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Implementation
|
|
66
|
+
|
|
67
|
+
### Core Component
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
// frontend/src/components/generic/Card.tsx
|
|
71
|
+
import { type Thing } from '@oneie/core'
|
|
72
|
+
import { useThingConfig } from '@/ontology/hooks'
|
|
73
|
+
import { Card as ShadCard, CardContent, CardFooter, CardHeader } from '@/components/ui/card'
|
|
74
|
+
import { Separator } from '@/components/ui/separator'
|
|
75
|
+
import { Field } from './Field'
|
|
76
|
+
import { Actions } from './Actions'
|
|
77
|
+
import { ConnectionBadges } from './ConnectionBadges'
|
|
78
|
+
|
|
79
|
+
interface CardProps {
|
|
80
|
+
thing: Thing
|
|
81
|
+
view?: 'card' | 'list' | 'detail'
|
|
82
|
+
onClick?: (thing: Thing) => void
|
|
83
|
+
showActions?: boolean
|
|
84
|
+
showConnections?: boolean
|
|
85
|
+
className?: string
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function Card({
|
|
89
|
+
thing,
|
|
90
|
+
view = 'card',
|
|
91
|
+
onClick,
|
|
92
|
+
showActions = true,
|
|
93
|
+
showConnections = true,
|
|
94
|
+
className
|
|
95
|
+
}: CardProps) {
|
|
96
|
+
// Get UI config from ontology
|
|
97
|
+
const config = useThingConfig(thing.type)
|
|
98
|
+
|
|
99
|
+
// Get view configuration
|
|
100
|
+
const viewConfig = config.ui.views[view]
|
|
101
|
+
if (!viewConfig) {
|
|
102
|
+
console.warn(`View "${view}" not defined for type "${thing.type}"`)
|
|
103
|
+
return null
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Get fields to display
|
|
107
|
+
const fields = viewConfig.fields === '*'
|
|
108
|
+
? Object.keys(config.properties)
|
|
109
|
+
: viewConfig.fields
|
|
110
|
+
|
|
111
|
+
// Handle click
|
|
112
|
+
const handleClick = () => {
|
|
113
|
+
if (onClick) {
|
|
114
|
+
onClick(thing)
|
|
115
|
+
} else if (config.ui.actions.primary) {
|
|
116
|
+
// Execute primary action by default
|
|
117
|
+
handleAction(config.ui.actions.primary.action, thing)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<ShadCard
|
|
123
|
+
className={cn(
|
|
124
|
+
'cursor-pointer transition-all hover:shadow-lg',
|
|
125
|
+
className
|
|
126
|
+
)}
|
|
127
|
+
onClick={handleClick}
|
|
128
|
+
>
|
|
129
|
+
{/* Header: Typically thumbnail + title */}
|
|
130
|
+
<CardHeader>
|
|
131
|
+
{fields.slice(0, 2).map(fieldName => {
|
|
132
|
+
const fieldConfig = config.ui.fields[fieldName]
|
|
133
|
+
if (fieldConfig?.hidden) return null
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<Field
|
|
137
|
+
key={fieldName}
|
|
138
|
+
name={fieldName}
|
|
139
|
+
value={thing.properties[fieldName]}
|
|
140
|
+
config={fieldConfig}
|
|
141
|
+
thing={thing}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
})}
|
|
145
|
+
</CardHeader>
|
|
146
|
+
|
|
147
|
+
{/* Body: Description, price, badges, etc. */}
|
|
148
|
+
<CardContent className="space-y-3">
|
|
149
|
+
{fields.slice(2).map(fieldName => {
|
|
150
|
+
const fieldConfig = config.ui.fields[fieldName]
|
|
151
|
+
if (fieldConfig?.hidden) return null
|
|
152
|
+
if (fieldConfig?.showOnlyIf && !thing.properties[fieldName]) return null
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<Field
|
|
156
|
+
key={fieldName}
|
|
157
|
+
name={fieldName}
|
|
158
|
+
value={thing.properties[fieldName]}
|
|
159
|
+
config={fieldConfig}
|
|
160
|
+
thing={thing}
|
|
161
|
+
/>
|
|
162
|
+
)
|
|
163
|
+
})}
|
|
164
|
+
</CardContent>
|
|
165
|
+
|
|
166
|
+
{/* Connection badges */}
|
|
167
|
+
{showConnections && config.ui.connections && (
|
|
168
|
+
<>
|
|
169
|
+
<Separator />
|
|
170
|
+
<CardContent className="pt-3">
|
|
171
|
+
<ConnectionBadges
|
|
172
|
+
thing={thing}
|
|
173
|
+
config={config.ui.connections}
|
|
174
|
+
/>
|
|
175
|
+
</CardContent>
|
|
176
|
+
</>
|
|
177
|
+
)}
|
|
178
|
+
|
|
179
|
+
{/* Actions */}
|
|
180
|
+
{showActions && (
|
|
181
|
+
<>
|
|
182
|
+
<Separator />
|
|
183
|
+
<CardFooter className="pt-3">
|
|
184
|
+
<Actions
|
|
185
|
+
thing={thing}
|
|
186
|
+
primary={config.ui.actions.primary}
|
|
187
|
+
secondary={config.ui.actions.secondary}
|
|
188
|
+
/>
|
|
189
|
+
</CardFooter>
|
|
190
|
+
</>
|
|
191
|
+
)}
|
|
192
|
+
</ShadCard>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### Field Component
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
// frontend/src/components/generic/Field.tsx
|
|
203
|
+
import { type FieldUI } from '@/ontology/types'
|
|
204
|
+
import { type Thing } from '@oneie/core'
|
|
205
|
+
|
|
206
|
+
// shadcn/ui components
|
|
207
|
+
import { Badge } from '@/components/ui/badge'
|
|
208
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
|
|
209
|
+
import { Progress } from '@/components/ui/progress'
|
|
210
|
+
import { Separator } from '@/components/ui/separator'
|
|
211
|
+
|
|
212
|
+
// Custom field components
|
|
213
|
+
import { Heading } from '@/components/fields/Heading'
|
|
214
|
+
import { Text } from '@/components/fields/Text'
|
|
215
|
+
import { Price } from '@/components/fields/Price'
|
|
216
|
+
import { Image } from '@/components/fields/Image'
|
|
217
|
+
import { TagList } from '@/components/fields/TagList'
|
|
218
|
+
import { DateField } from '@/components/fields/DateField'
|
|
219
|
+
|
|
220
|
+
interface FieldProps {
|
|
221
|
+
name: string
|
|
222
|
+
value: any
|
|
223
|
+
config: FieldUI
|
|
224
|
+
thing: Thing
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function Field({ name, value, config, thing }: FieldProps) {
|
|
228
|
+
// Handle null/undefined values
|
|
229
|
+
if (value === null || value === undefined) {
|
|
230
|
+
return null
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Apply formatting function if provided
|
|
234
|
+
const formattedValue = config.format
|
|
235
|
+
? config.format(value, thing)
|
|
236
|
+
: value
|
|
237
|
+
|
|
238
|
+
// Render appropriate component based on config.component
|
|
239
|
+
switch (config.component) {
|
|
240
|
+
case 'Heading':
|
|
241
|
+
return (
|
|
242
|
+
<Heading
|
|
243
|
+
size={config.size}
|
|
244
|
+
weight={config.weight}
|
|
245
|
+
truncate={config.truncate}
|
|
246
|
+
>
|
|
247
|
+
{formattedValue}
|
|
248
|
+
</Heading>
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
case 'Text':
|
|
252
|
+
return (
|
|
253
|
+
<Text
|
|
254
|
+
size={config.size}
|
|
255
|
+
color={config.color}
|
|
256
|
+
lines={config.lines}
|
|
257
|
+
icon={config.icon}
|
|
258
|
+
italic={config.italic}
|
|
259
|
+
weight={config.weight}
|
|
260
|
+
expandable={config.expandable}
|
|
261
|
+
>
|
|
262
|
+
{formattedValue}
|
|
263
|
+
</Text>
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
case 'Price':
|
|
267
|
+
return (
|
|
268
|
+
<Price
|
|
269
|
+
value={formattedValue}
|
|
270
|
+
currency={config.currency}
|
|
271
|
+
format={config.format}
|
|
272
|
+
badge={config.badge}
|
|
273
|
+
size={config.size}
|
|
274
|
+
strikethrough={config.strikethrough}
|
|
275
|
+
free={config.free}
|
|
276
|
+
/>
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
case 'Image':
|
|
280
|
+
return (
|
|
281
|
+
<Image
|
|
282
|
+
src={formattedValue}
|
|
283
|
+
alt={thing.name}
|
|
284
|
+
aspect={config.aspect}
|
|
285
|
+
lazy={config.lazy}
|
|
286
|
+
placeholder={config.placeholder}
|
|
287
|
+
fallback={config.fallback}
|
|
288
|
+
sizes={config.sizes}
|
|
289
|
+
/>
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
case 'Badge':
|
|
293
|
+
const badgeLabel = config.labels?.[value] || config.label || value
|
|
294
|
+
|
|
295
|
+
return (
|
|
296
|
+
<Badge variant="secondary">
|
|
297
|
+
{badgeLabel}
|
|
298
|
+
</Badge>
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
case 'TagList':
|
|
302
|
+
return (
|
|
303
|
+
<TagList
|
|
304
|
+
tags={formattedValue}
|
|
305
|
+
max={config.max}
|
|
306
|
+
color={config.color}
|
|
307
|
+
moreLabel={config.moreLabel}
|
|
308
|
+
/>
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
case 'Date':
|
|
312
|
+
return (
|
|
313
|
+
<Date
|
|
314
|
+
value={formattedValue}
|
|
315
|
+
format={config.format} // 'relative' | 'full' | 'short'
|
|
316
|
+
icon={config.icon}
|
|
317
|
+
/>
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
case 'Markdown':
|
|
321
|
+
return (
|
|
322
|
+
<Markdown
|
|
323
|
+
content={formattedValue}
|
|
324
|
+
className={config.className}
|
|
325
|
+
lines={config.lines}
|
|
326
|
+
expandable={config.expandable}
|
|
327
|
+
/>
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
case 'Avatar':
|
|
331
|
+
return (
|
|
332
|
+
<Avatar>
|
|
333
|
+
<AvatarImage src={formattedValue} alt={thing.name} />
|
|
334
|
+
<AvatarFallback>
|
|
335
|
+
{config.fallback === 'initials'
|
|
336
|
+
? thing.name.split(' ').map(n => n[0]).join('').toUpperCase()
|
|
337
|
+
: config.fallback}
|
|
338
|
+
</AvatarFallback>
|
|
339
|
+
</Avatar>
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
case 'Link':
|
|
343
|
+
return (
|
|
344
|
+
<Link
|
|
345
|
+
href={formattedValue}
|
|
346
|
+
icon={config.icon}
|
|
347
|
+
external={config.external}
|
|
348
|
+
size={config.size}
|
|
349
|
+
>
|
|
350
|
+
{config.label || formattedValue}
|
|
351
|
+
</Link>
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
case 'ImageGallery':
|
|
355
|
+
return (
|
|
356
|
+
<ImageGallery
|
|
357
|
+
images={formattedValue}
|
|
358
|
+
aspect={config.aspect}
|
|
359
|
+
lazy={config.lazy}
|
|
360
|
+
zoom={config.zoom}
|
|
361
|
+
thumbnails={config.thumbnails}
|
|
362
|
+
/>
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
case 'Video':
|
|
366
|
+
return (
|
|
367
|
+
<Video
|
|
368
|
+
src={formattedValue}
|
|
369
|
+
controls={config.controls}
|
|
370
|
+
autoplay={config.autoplay}
|
|
371
|
+
muted={config.muted}
|
|
372
|
+
/>
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
case 'SocialLinks':
|
|
376
|
+
return (
|
|
377
|
+
<SocialLinks
|
|
378
|
+
links={formattedValue}
|
|
379
|
+
display={config.display}
|
|
380
|
+
size={config.size}
|
|
381
|
+
platforms={config.platforms}
|
|
382
|
+
/>
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
case 'Checkbox':
|
|
386
|
+
return (
|
|
387
|
+
<Checkbox
|
|
388
|
+
checked={formattedValue}
|
|
389
|
+
label={config.label}
|
|
390
|
+
checkedIcon={config.checkedIcon}
|
|
391
|
+
uncheckedIcon={config.uncheckedIcon}
|
|
392
|
+
onChange={(checked) => {
|
|
393
|
+
// Update thing property
|
|
394
|
+
updateThing(thing._id, { [name]: checked })
|
|
395
|
+
}}
|
|
396
|
+
/>
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
// Add more component types as needed
|
|
400
|
+
default:
|
|
401
|
+
console.warn(`Unknown field component: ${config.component}`)
|
|
402
|
+
return <Text>{String(formattedValue)}</Text>
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
### Actions Component
|
|
410
|
+
|
|
411
|
+
```tsx
|
|
412
|
+
// frontend/src/components/generic/Actions.tsx
|
|
413
|
+
import { type Thing } from '@oneie/core'
|
|
414
|
+
import { type ActionConfig } from '@/ontology/types'
|
|
415
|
+
import { Button } from '@/components/ui/button'
|
|
416
|
+
import { useAction } from '@/hooks/useAction'
|
|
417
|
+
|
|
418
|
+
interface ActionsProps {
|
|
419
|
+
thing: Thing
|
|
420
|
+
primary?: ActionConfig
|
|
421
|
+
secondary?: ActionConfig[]
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export function Actions({ thing, primary, secondary }: ActionsProps) {
|
|
425
|
+
const { executeAction, loading } = useAction()
|
|
426
|
+
|
|
427
|
+
const handleAction = async (action: string) => {
|
|
428
|
+
await executeAction(action, thing)
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return (
|
|
432
|
+
<div className="flex items-center gap-2 w-full">
|
|
433
|
+
{/* Primary action */}
|
|
434
|
+
{primary && (
|
|
435
|
+
<Button
|
|
436
|
+
variant={primary.variant === 'danger' ? 'destructive' : 'default'}
|
|
437
|
+
onClick={() => handleAction(primary.action)}
|
|
438
|
+
disabled={loading}
|
|
439
|
+
className="flex-1"
|
|
440
|
+
>
|
|
441
|
+
{loading ? 'Loading...' : primary.label}
|
|
442
|
+
</Button>
|
|
443
|
+
)}
|
|
444
|
+
|
|
445
|
+
{/* Secondary actions */}
|
|
446
|
+
{secondary?.map(action => (
|
|
447
|
+
<Button
|
|
448
|
+
key={action.action}
|
|
449
|
+
variant={action.variant === 'ghost' ? 'outline' : 'secondary'}
|
|
450
|
+
onClick={() => handleAction(action.action)}
|
|
451
|
+
disabled={loading}
|
|
452
|
+
>
|
|
453
|
+
{action.label}
|
|
454
|
+
</Button>
|
|
455
|
+
))}
|
|
456
|
+
</div>
|
|
457
|
+
)
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
### Connection Badges Component
|
|
464
|
+
|
|
465
|
+
```tsx
|
|
466
|
+
// frontend/src/components/generic/ConnectionBadges.tsx
|
|
467
|
+
import { type Thing } from '@oneie/core'
|
|
468
|
+
import { type ConnectionUI } from '@/ontology/types'
|
|
469
|
+
import { useConnections } from '@/hooks/useConnections'
|
|
470
|
+
import { Badge } from '@/components/ui/Badge'
|
|
471
|
+
import { Avatar } from '@/components/ui/Avatar'
|
|
472
|
+
|
|
473
|
+
interface ConnectionBadgesProps {
|
|
474
|
+
thing: Thing
|
|
475
|
+
config: Record<string, ConnectionUI>
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export function ConnectionBadges({ thing, config }: ConnectionBadgesProps) {
|
|
479
|
+
const connections = useConnections(thing._id)
|
|
480
|
+
|
|
481
|
+
return (
|
|
482
|
+
<div className="flex flex-wrap gap-2 mt-3">
|
|
483
|
+
{Object.entries(config).map(([type, connectionConfig]) => {
|
|
484
|
+
// Get connections of this type
|
|
485
|
+
const items = connections.filter(c => c.relationshipType === type)
|
|
486
|
+
|
|
487
|
+
if (items.length === 0) return null
|
|
488
|
+
|
|
489
|
+
// Format label with count or name
|
|
490
|
+
const label = connectionConfig.label
|
|
491
|
+
.replace('{count}', items.length.toString())
|
|
492
|
+
.replace('{name}', items[0]?.name || '')
|
|
493
|
+
|
|
494
|
+
// Render based on display type
|
|
495
|
+
switch (connectionConfig.display) {
|
|
496
|
+
case 'badge':
|
|
497
|
+
return (
|
|
498
|
+
<Badge
|
|
499
|
+
key={type}
|
|
500
|
+
icon={connectionConfig.icon}
|
|
501
|
+
link={connectionConfig.link ? `/connections/${type}` : undefined}
|
|
502
|
+
>
|
|
503
|
+
{label}
|
|
504
|
+
</Badge>
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
case 'avatar':
|
|
508
|
+
return (
|
|
509
|
+
<div key={type} className="flex items-center gap-2">
|
|
510
|
+
<Avatar
|
|
511
|
+
src={items[0]?.properties?.avatar}
|
|
512
|
+
name={items[0]?.name}
|
|
513
|
+
size="sm"
|
|
514
|
+
/>
|
|
515
|
+
<span className="text-sm text-muted">
|
|
516
|
+
{label}
|
|
517
|
+
</span>
|
|
518
|
+
</div>
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
case 'inline':
|
|
522
|
+
return (
|
|
523
|
+
<span key={type} className="text-sm text-muted">
|
|
524
|
+
{connectionConfig.icon && <Icon name={connectionConfig.icon} />}
|
|
525
|
+
{label}
|
|
526
|
+
</span>
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
case 'list':
|
|
530
|
+
return (
|
|
531
|
+
<div key={type} className="space-y-1">
|
|
532
|
+
{items.slice(0, connectionConfig.max || 5).map(item => (
|
|
533
|
+
<Badge key={item._id}>
|
|
534
|
+
{item.name}
|
|
535
|
+
</Badge>
|
|
536
|
+
))}
|
|
537
|
+
</div>
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
default:
|
|
541
|
+
return null
|
|
542
|
+
}
|
|
543
|
+
})}
|
|
544
|
+
</div>
|
|
545
|
+
)
|
|
546
|
+
}
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
---
|
|
550
|
+
|
|
551
|
+
## Hook: useThingConfig
|
|
552
|
+
|
|
553
|
+
```tsx
|
|
554
|
+
// frontend/src/ontology/hooks/useThingConfig.ts
|
|
555
|
+
import { type ThingType } from '@oneie/core'
|
|
556
|
+
import { ontologyUIConfig } from '@/ontology/config'
|
|
557
|
+
|
|
558
|
+
export function useThingConfig(type: ThingType) {
|
|
559
|
+
const config = ontologyUIConfig[type]
|
|
560
|
+
|
|
561
|
+
if (!config) {
|
|
562
|
+
console.error(`No UI config found for thing type: ${type}`)
|
|
563
|
+
// Return minimal fallback config
|
|
564
|
+
return {
|
|
565
|
+
type,
|
|
566
|
+
properties: {},
|
|
567
|
+
ui: {
|
|
568
|
+
component: 'Card',
|
|
569
|
+
layouts: { grid: { columns: 3, gap: 'md' } },
|
|
570
|
+
fields: {},
|
|
571
|
+
views: { card: { fields: ['name'] } },
|
|
572
|
+
actions: {},
|
|
573
|
+
connections: {},
|
|
574
|
+
empty: {
|
|
575
|
+
icon: 'box',
|
|
576
|
+
title: 'No items',
|
|
577
|
+
description: 'Get started by creating one'
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return config
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Hook: useAction
|
|
590
|
+
|
|
591
|
+
```tsx
|
|
592
|
+
// frontend/src/hooks/useAction.ts
|
|
593
|
+
import { useState } from 'react'
|
|
594
|
+
import { type Thing } from '@oneie/core'
|
|
595
|
+
import { Effect } from 'effect'
|
|
596
|
+
import { ThingService } from '@/services/ThingService'
|
|
597
|
+
import { useEffectRunner } from '@/hooks/useEffectRunner'
|
|
598
|
+
|
|
599
|
+
export function useAction() {
|
|
600
|
+
const [loading, setLoading] = useState(false)
|
|
601
|
+
const { run } = useEffectRunner()
|
|
602
|
+
|
|
603
|
+
const executeAction = async (action: string, thing: Thing) => {
|
|
604
|
+
setLoading(true)
|
|
605
|
+
|
|
606
|
+
const program = Effect.gen(function* () {
|
|
607
|
+
const service = yield* ThingService
|
|
608
|
+
|
|
609
|
+
// Handle different action types
|
|
610
|
+
switch (action) {
|
|
611
|
+
case 'enroll':
|
|
612
|
+
return yield* service.enroll(thing._id)
|
|
613
|
+
|
|
614
|
+
case 'purchase':
|
|
615
|
+
return yield* service.purchase(thing._id)
|
|
616
|
+
|
|
617
|
+
case 'preview':
|
|
618
|
+
// Navigate to preview page
|
|
619
|
+
window.location.href = `/preview/${thing.type}/${thing._id}`
|
|
620
|
+
break
|
|
621
|
+
|
|
622
|
+
case 'share':
|
|
623
|
+
// Open share dialog
|
|
624
|
+
await navigator.share({
|
|
625
|
+
title: thing.name,
|
|
626
|
+
url: window.location.href
|
|
627
|
+
})
|
|
628
|
+
break
|
|
629
|
+
|
|
630
|
+
case 'bookmark':
|
|
631
|
+
return yield* service.bookmark(thing._id)
|
|
632
|
+
|
|
633
|
+
case 'edit':
|
|
634
|
+
window.location.href = `/edit/${thing.type}/${thing._id}`
|
|
635
|
+
break
|
|
636
|
+
|
|
637
|
+
case 'delete':
|
|
638
|
+
if (confirm('Are you sure?')) {
|
|
639
|
+
return yield* service.delete(thing._id)
|
|
640
|
+
}
|
|
641
|
+
break
|
|
642
|
+
|
|
643
|
+
case 'addToCart':
|
|
644
|
+
return yield* service.addToCart(thing._id)
|
|
645
|
+
|
|
646
|
+
case 'wishlist':
|
|
647
|
+
return yield* service.addToWishlist(thing._id)
|
|
648
|
+
|
|
649
|
+
// Add more actions as needed
|
|
650
|
+
default:
|
|
651
|
+
console.warn(`Unknown action: ${action}`)
|
|
652
|
+
}
|
|
653
|
+
})
|
|
654
|
+
|
|
655
|
+
await run(program, {
|
|
656
|
+
onSuccess: () => {
|
|
657
|
+
setLoading(false)
|
|
658
|
+
},
|
|
659
|
+
onError: (error) => {
|
|
660
|
+
console.error('Action failed:', error)
|
|
661
|
+
setLoading(false)
|
|
662
|
+
}
|
|
663
|
+
})
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
return { executeAction, loading }
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
---
|
|
671
|
+
|
|
672
|
+
## Usage Examples
|
|
673
|
+
|
|
674
|
+
### Basic Usage
|
|
675
|
+
|
|
676
|
+
```tsx
|
|
677
|
+
// frontend/src/pages/courses/index.astro
|
|
678
|
+
---
|
|
679
|
+
import { getCourses } from '@/services/ThingService'
|
|
680
|
+
import Card from '@/components/generic/Card'
|
|
681
|
+
|
|
682
|
+
const courses = await getCourses()
|
|
683
|
+
---
|
|
684
|
+
|
|
685
|
+
<div class="grid grid-cols-3 gap-6">
|
|
686
|
+
{courses.map(course => (
|
|
687
|
+
<Card
|
|
688
|
+
thing={course}
|
|
689
|
+
client:load
|
|
690
|
+
/>
|
|
691
|
+
))}
|
|
692
|
+
</div>
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### Custom View
|
|
696
|
+
|
|
697
|
+
```tsx
|
|
698
|
+
// Use list view instead of card view
|
|
699
|
+
<Card
|
|
700
|
+
thing={course}
|
|
701
|
+
view="list"
|
|
702
|
+
client:load
|
|
703
|
+
/>
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### Custom Click Handler
|
|
707
|
+
|
|
708
|
+
```tsx
|
|
709
|
+
// Handle click manually
|
|
710
|
+
<Card
|
|
711
|
+
thing={course}
|
|
712
|
+
onClick={(thing) => {
|
|
713
|
+
console.log('Clicked:', thing)
|
|
714
|
+
router.push(`/courses/${thing._id}`)
|
|
715
|
+
}}
|
|
716
|
+
client:load
|
|
717
|
+
/>
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### Hide Actions
|
|
721
|
+
|
|
722
|
+
```tsx
|
|
723
|
+
// Show card without actions
|
|
724
|
+
<Card
|
|
725
|
+
thing={course}
|
|
726
|
+
showActions={false}
|
|
727
|
+
client:load
|
|
728
|
+
/>
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
### Hide Connections
|
|
732
|
+
|
|
733
|
+
```tsx
|
|
734
|
+
// Show card without connection badges
|
|
735
|
+
<Card
|
|
736
|
+
thing={course}
|
|
737
|
+
showConnections={false}
|
|
738
|
+
client:load
|
|
739
|
+
/>
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
---
|
|
743
|
+
|
|
744
|
+
## Variants
|
|
745
|
+
|
|
746
|
+
### ThingList
|
|
747
|
+
|
|
748
|
+
```tsx
|
|
749
|
+
// frontend/src/components/generic/ThingList.tsx
|
|
750
|
+
export function ThingList({ things, view = 'list' }) {
|
|
751
|
+
const config = useThingConfig(things[0]?.type)
|
|
752
|
+
|
|
753
|
+
return (
|
|
754
|
+
<div className="space-y-4">
|
|
755
|
+
{things.map(thing => (
|
|
756
|
+
<Card
|
|
757
|
+
key={thing._id}
|
|
758
|
+
thing={thing}
|
|
759
|
+
view={view}
|
|
760
|
+
/>
|
|
761
|
+
))}
|
|
762
|
+
</div>
|
|
763
|
+
)
|
|
764
|
+
}
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
### ThingGrid
|
|
768
|
+
|
|
769
|
+
```tsx
|
|
770
|
+
// frontend/src/components/generic/ThingGrid.tsx
|
|
771
|
+
export function ThingGrid({ things }) {
|
|
772
|
+
const config = useThingConfig(things[0]?.type)
|
|
773
|
+
const gridLayout = config.ui.layouts.grid
|
|
774
|
+
|
|
775
|
+
return (
|
|
776
|
+
<div
|
|
777
|
+
className="grid gap-6"
|
|
778
|
+
style={{
|
|
779
|
+
gridTemplateColumns: `repeat(${gridLayout.columns}, 1fr)`
|
|
780
|
+
}}
|
|
781
|
+
>
|
|
782
|
+
{things.map(thing => (
|
|
783
|
+
<Card
|
|
784
|
+
key={thing._id}
|
|
785
|
+
thing={thing}
|
|
786
|
+
view="card"
|
|
787
|
+
/>
|
|
788
|
+
))}
|
|
789
|
+
</div>
|
|
790
|
+
)
|
|
791
|
+
}
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
### ThingDetail
|
|
795
|
+
|
|
796
|
+
```tsx
|
|
797
|
+
// frontend/src/components/generic/ThingDetail.tsx
|
|
798
|
+
export function ThingDetail({ thing }) {
|
|
799
|
+
const config = useThingConfig(thing.type)
|
|
800
|
+
|
|
801
|
+
return (
|
|
802
|
+
<div className="max-w-prose mx-auto">
|
|
803
|
+
<Card
|
|
804
|
+
thing={thing}
|
|
805
|
+
view="detail"
|
|
806
|
+
showActions={true}
|
|
807
|
+
showConnections={true}
|
|
808
|
+
/>
|
|
809
|
+
</div>
|
|
810
|
+
)
|
|
811
|
+
}
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### ThingTable
|
|
815
|
+
|
|
816
|
+
```tsx
|
|
817
|
+
// frontend/src/components/generic/ThingTable.tsx
|
|
818
|
+
export function ThingTable({ things }) {
|
|
819
|
+
const config = useThingConfig(things[0]?.type)
|
|
820
|
+
const tableView = config.ui.views.table
|
|
821
|
+
|
|
822
|
+
return (
|
|
823
|
+
<table className="w-full">
|
|
824
|
+
<thead>
|
|
825
|
+
<tr>
|
|
826
|
+
{tableView.fields.map(fieldName => (
|
|
827
|
+
<th key={fieldName}>
|
|
828
|
+
{config.ui.fields[fieldName]?.label || fieldName}
|
|
829
|
+
</th>
|
|
830
|
+
))}
|
|
831
|
+
</tr>
|
|
832
|
+
</thead>
|
|
833
|
+
<tbody>
|
|
834
|
+
{things.map(thing => (
|
|
835
|
+
<tr key={thing._id}>
|
|
836
|
+
{tableView.fields.map(fieldName => (
|
|
837
|
+
<td key={fieldName}>
|
|
838
|
+
<Field
|
|
839
|
+
name={fieldName}
|
|
840
|
+
value={thing.properties[fieldName]}
|
|
841
|
+
config={config.ui.fields[fieldName]}
|
|
842
|
+
thing={thing}
|
|
843
|
+
/>
|
|
844
|
+
</td>
|
|
845
|
+
))}
|
|
846
|
+
</tr>
|
|
847
|
+
))}
|
|
848
|
+
</tbody>
|
|
849
|
+
</table>
|
|
850
|
+
)
|
|
851
|
+
}
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
---
|
|
855
|
+
|
|
856
|
+
## Empty State
|
|
857
|
+
|
|
858
|
+
```tsx
|
|
859
|
+
// frontend/src/components/generic/EmptyState.tsx
|
|
860
|
+
import { type EmptyStateConfig } from '@/ontology/types'
|
|
861
|
+
import { Button } from '@/components/ui/Button'
|
|
862
|
+
import { Icon } from '@/components/ui/Icon'
|
|
863
|
+
|
|
864
|
+
interface EmptyStateProps {
|
|
865
|
+
config: EmptyStateConfig
|
|
866
|
+
onAction?: () => void
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export function EmptyState({ config, onAction }: EmptyStateProps) {
|
|
870
|
+
return (
|
|
871
|
+
<div className="text-center py-12">
|
|
872
|
+
<Icon
|
|
873
|
+
name={config.icon}
|
|
874
|
+
size="3xl"
|
|
875
|
+
className="text-muted mb-4"
|
|
876
|
+
/>
|
|
877
|
+
<h3 className="text-xl font-semibold mb-2">
|
|
878
|
+
{config.title}
|
|
879
|
+
</h3>
|
|
880
|
+
<p className="text-muted mb-6">
|
|
881
|
+
{config.description}
|
|
882
|
+
</p>
|
|
883
|
+
{config.action && (
|
|
884
|
+
<Button
|
|
885
|
+
icon={config.action.icon}
|
|
886
|
+
variant={config.action.variant}
|
|
887
|
+
onClick={onAction}
|
|
888
|
+
>
|
|
889
|
+
{config.action.label}
|
|
890
|
+
</Button>
|
|
891
|
+
)}
|
|
892
|
+
</div>
|
|
893
|
+
)
|
|
894
|
+
}
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
**Usage:**
|
|
898
|
+
|
|
899
|
+
```tsx
|
|
900
|
+
// Show empty state when no things
|
|
901
|
+
{things.length === 0 ? (
|
|
902
|
+
<EmptyState
|
|
903
|
+
config={config.ui.empty}
|
|
904
|
+
onAction={() => router.push('/courses/new')}
|
|
905
|
+
/>
|
|
906
|
+
) : (
|
|
907
|
+
<ThingGrid things={things} />
|
|
908
|
+
)}
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
---
|
|
912
|
+
|
|
913
|
+
## Testing
|
|
914
|
+
|
|
915
|
+
### Unit Tests
|
|
916
|
+
|
|
917
|
+
```tsx
|
|
918
|
+
// frontend/src/components/generic/__tests__/Card.test.tsx
|
|
919
|
+
import { describe, it, expect } from 'vitest'
|
|
920
|
+
import { render, screen } from '@testing-library/react'
|
|
921
|
+
import { Card } from '../Card'
|
|
922
|
+
|
|
923
|
+
describe('Card', () => {
|
|
924
|
+
it('renders course card', () => {
|
|
925
|
+
const course = {
|
|
926
|
+
_id: '123',
|
|
927
|
+
type: 'course',
|
|
928
|
+
name: 'Test Course',
|
|
929
|
+
properties: {
|
|
930
|
+
title: 'Test Course',
|
|
931
|
+
description: 'A test course',
|
|
932
|
+
price: 99,
|
|
933
|
+
level: 'beginner'
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
render(<Card thing={course} />)
|
|
938
|
+
|
|
939
|
+
expect(screen.getByText('Test Course')).toBeInTheDocument()
|
|
940
|
+
expect(screen.getByText('A test course')).toBeInTheDocument()
|
|
941
|
+
expect(screen.getByText('$99')).toBeInTheDocument()
|
|
942
|
+
expect(screen.getByText('beginner')).toBeInTheDocument()
|
|
943
|
+
})
|
|
944
|
+
|
|
945
|
+
it('renders product card', () => {
|
|
946
|
+
const product = {
|
|
947
|
+
_id: '456',
|
|
948
|
+
type: 'product',
|
|
949
|
+
name: 'Test Product',
|
|
950
|
+
properties: {
|
|
951
|
+
name: 'Test Product',
|
|
952
|
+
price: 49,
|
|
953
|
+
inventory: 10
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
render(<Card thing={product} />)
|
|
958
|
+
|
|
959
|
+
expect(screen.getByText('Test Product')).toBeInTheDocument()
|
|
960
|
+
expect(screen.getByText('$49')).toBeInTheDocument()
|
|
961
|
+
expect(screen.getByText('10 in stock')).toBeInTheDocument()
|
|
962
|
+
})
|
|
963
|
+
|
|
964
|
+
it('handles click', () => {
|
|
965
|
+
const onClick = vi.fn()
|
|
966
|
+
const course = { /* ... */ }
|
|
967
|
+
|
|
968
|
+
render(<Card thing={course} onClick={onClick} />)
|
|
969
|
+
|
|
970
|
+
fireEvent.click(screen.getByRole('article'))
|
|
971
|
+
expect(onClick).toHaveBeenCalledWith(course)
|
|
972
|
+
})
|
|
973
|
+
})
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
---
|
|
977
|
+
|
|
978
|
+
## Performance Optimization
|
|
979
|
+
|
|
980
|
+
### Memoization
|
|
981
|
+
|
|
982
|
+
```tsx
|
|
983
|
+
// Memoize config lookup
|
|
984
|
+
import { useMemo } from 'react'
|
|
985
|
+
|
|
986
|
+
export function Card({ thing, ...props }) {
|
|
987
|
+
const config = useMemo(
|
|
988
|
+
() => getThingConfig(thing.type),
|
|
989
|
+
[thing.type]
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
// ... rest of component
|
|
993
|
+
}
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
### Lazy Loading
|
|
997
|
+
|
|
998
|
+
```tsx
|
|
999
|
+
// Lazy load images
|
|
1000
|
+
<Image
|
|
1001
|
+
src={thing.properties.thumbnail}
|
|
1002
|
+
lazy={true}
|
|
1003
|
+
loading="lazy"
|
|
1004
|
+
/>
|
|
1005
|
+
```
|
|
1006
|
+
|
|
1007
|
+
### Virtual Scrolling
|
|
1008
|
+
|
|
1009
|
+
```tsx
|
|
1010
|
+
// Use virtual scrolling for long lists
|
|
1011
|
+
import { VirtualList } from '@/components/ui/VirtualList'
|
|
1012
|
+
|
|
1013
|
+
<VirtualList
|
|
1014
|
+
items={things}
|
|
1015
|
+
renderItem={(thing) => <Card thing={thing} />}
|
|
1016
|
+
itemHeight={200}
|
|
1017
|
+
/>
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
---
|
|
1021
|
+
|
|
1022
|
+
## Next Steps
|
|
1023
|
+
|
|
1024
|
+
### Week 1
|
|
1025
|
+
- [ ] Implement Card core component
|
|
1026
|
+
- [ ] Implement Field component with 10 field types
|
|
1027
|
+
- [ ] Implement Actions component
|
|
1028
|
+
- [ ] Test with 3 thing types
|
|
1029
|
+
|
|
1030
|
+
### Week 2
|
|
1031
|
+
- [ ] Add all field component types (20+)
|
|
1032
|
+
- [ ] Implement ConnectionBadges
|
|
1033
|
+
- [ ] Implement EmptyState
|
|
1034
|
+
- [ ] Add responsive layouts
|
|
1035
|
+
|
|
1036
|
+
### Week 3
|
|
1037
|
+
- [ ] Build ThingList variant
|
|
1038
|
+
- [ ] Build ThingGrid variant
|
|
1039
|
+
- [ ] Build ThingDetail variant
|
|
1040
|
+
- [ ] Build ThingTable variant
|
|
1041
|
+
|
|
1042
|
+
### Week 4
|
|
1043
|
+
- [ ] Add customization API
|
|
1044
|
+
- [ ] Add theme support
|
|
1045
|
+
- [ ] Add accessibility features
|
|
1046
|
+
- [ ] Performance optimization
|
|
1047
|
+
|
|
1048
|
+
---
|
|
1049
|
+
|
|
1050
|
+
**With Card, you build ONE component and support 66 thing types automatically.**
|