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,698 @@
|
|
|
1
|
+
# Task Organization System
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Purpose:** Define how the director agent assigns, tracks, and completes tasks using the 6-dimension ontology
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The task organization system enables the director agent to break down strategic goals (OKRs) into actionable tasks, delegate them to business agents, track progress, and ensure completion. Every task is a **thing** with **delegated** connections and **task_event** logging.
|
|
11
|
+
|
|
12
|
+
**Key Principle:** Tasks are entities in the ontology, not custom tables. This ensures consistency, auditability, and alignment with the 6-dimension universe.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Task Thing Structure
|
|
17
|
+
|
|
18
|
+
### Thing Type: `task`
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
{
|
|
22
|
+
_id: Id<"things">,
|
|
23
|
+
type: "task",
|
|
24
|
+
name: string, // Task title (e.g., "Research quantum computing trends")
|
|
25
|
+
properties: {
|
|
26
|
+
taskType: "research" | "strategy" | "marketing" | "sales" | "service" | "design" | "engineering" | "finance" | "legal" | "intelligence",
|
|
27
|
+
description: string, // Detailed task description
|
|
28
|
+
priority: "low" | "medium" | "high" | "critical",
|
|
29
|
+
status: "pending" | "assigned" | "in_progress" | "blocked" | "completed" | "failed",
|
|
30
|
+
deadline?: number, // Unix timestamp
|
|
31
|
+
estimatedDuration?: number, // Minutes
|
|
32
|
+
actualDuration?: number, // Minutes (completed tasks)
|
|
33
|
+
parameters: Record<string, any>, // Task-specific parameters
|
|
34
|
+
result?: { // Task result (when completed)
|
|
35
|
+
status: "success" | "partial" | "failed",
|
|
36
|
+
data: any,
|
|
37
|
+
summary: string,
|
|
38
|
+
confidence?: number,
|
|
39
|
+
},
|
|
40
|
+
blockers?: { // If status is "blocked"
|
|
41
|
+
reason: string,
|
|
42
|
+
blockedBy?: Id<"things">, // Blocking task ID
|
|
43
|
+
unblockEstimate?: number,
|
|
44
|
+
},
|
|
45
|
+
parentTaskId?: Id<"things">, // Parent task (for subtasks)
|
|
46
|
+
organizationId: Id<"things">, // Organization this task belongs to
|
|
47
|
+
creatorId: Id<"things">, // User who created/requested this task
|
|
48
|
+
},
|
|
49
|
+
status: "active" | "archived",
|
|
50
|
+
createdAt: number,
|
|
51
|
+
updatedAt: number,
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Task Types Match Agent Types
|
|
56
|
+
|
|
57
|
+
The 10 business agent types determine task types:
|
|
58
|
+
|
|
59
|
+
1. **strategy** - Strategic planning, OKR creation, vision
|
|
60
|
+
2. **research** - Market research, competitive analysis, trends
|
|
61
|
+
3. **marketing** - Content strategy, SEO, campaigns
|
|
62
|
+
4. **sales** - Lead generation, funnel optimization, conversions
|
|
63
|
+
5. **service** - Customer support, onboarding, success
|
|
64
|
+
6. **design** - Brand identity, UI/UX, creative assets
|
|
65
|
+
7. **engineering** - Technical implementation, automation, integrations
|
|
66
|
+
8. **finance** - Revenue tracking, forecasting, budgeting
|
|
67
|
+
9. **legal** - Compliance, contracts, IP protection
|
|
68
|
+
10. **intelligence** - Analytics, insights, predictions
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Connections: Task Delegation
|
|
73
|
+
|
|
74
|
+
### Connection Type: `delegated`
|
|
75
|
+
|
|
76
|
+
Links director/user to agent via task:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
{
|
|
80
|
+
_id: Id<"connections">,
|
|
81
|
+
fromThingId: Id<"things">, // Director agent or user
|
|
82
|
+
toThingId: Id<"things">, // Business agent (assignee)
|
|
83
|
+
relationshipType: "delegated",
|
|
84
|
+
metadata: {
|
|
85
|
+
protocol: "a2a", // Agent-to-Agent protocol
|
|
86
|
+
taskId: Id<"things">, // Task entity ID
|
|
87
|
+
taskType: string, // research, marketing, etc.
|
|
88
|
+
assignedAt: number,
|
|
89
|
+
deadline?: number,
|
|
90
|
+
priority: string,
|
|
91
|
+
status: "pending" | "accepted" | "rejected" | "in_progress" | "completed",
|
|
92
|
+
acceptedAt?: number,
|
|
93
|
+
rejectedReason?: string,
|
|
94
|
+
completedAt?: number,
|
|
95
|
+
},
|
|
96
|
+
createdAt: number,
|
|
97
|
+
updatedAt: number,
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Key Points:**
|
|
102
|
+
- Director creates task → assigns to agent via `delegated` connection
|
|
103
|
+
- Agent accepts/rejects via connection metadata update
|
|
104
|
+
- Progress tracked through connection status updates
|
|
105
|
+
- A2A protocol metadata enables cross-agent communication
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Events: Task Lifecycle
|
|
110
|
+
|
|
111
|
+
### Event Types
|
|
112
|
+
|
|
113
|
+
All task events use the consolidated `task_event` type with `metadata.action`:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
type TaskAction =
|
|
117
|
+
| "created" // Task created
|
|
118
|
+
| "assigned" // Task delegated to agent
|
|
119
|
+
| "accepted" // Agent accepted task
|
|
120
|
+
| "rejected" // Agent rejected task
|
|
121
|
+
| "started" // Agent started working
|
|
122
|
+
| "progressed" // Progress update
|
|
123
|
+
| "blocked" // Task blocked
|
|
124
|
+
| "unblocked" // Blocker resolved
|
|
125
|
+
| "completed" // Task completed successfully
|
|
126
|
+
| "failed" // Task failed
|
|
127
|
+
| "archived"; // Task archived
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Event Structure
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
{
|
|
134
|
+
_id: Id<"events">,
|
|
135
|
+
type: "task_event",
|
|
136
|
+
actorId: Id<"things">, // Director or agent
|
|
137
|
+
targetId: Id<"things">, // Task entity ID
|
|
138
|
+
timestamp: number,
|
|
139
|
+
metadata: {
|
|
140
|
+
action: TaskAction,
|
|
141
|
+
protocol: "a2a", // For agent communication
|
|
142
|
+
taskType: string,
|
|
143
|
+
priority: string,
|
|
144
|
+
status: string,
|
|
145
|
+
progress?: number, // 0-100
|
|
146
|
+
message?: string, // Status message
|
|
147
|
+
result?: any, // Completion result
|
|
148
|
+
error?: {
|
|
149
|
+
code: string,
|
|
150
|
+
message: string,
|
|
151
|
+
},
|
|
152
|
+
estimatedCompletion?: number, // Timestamp
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Task Creation Pattern
|
|
160
|
+
|
|
161
|
+
### From Director Agent
|
|
162
|
+
|
|
163
|
+
**Scenario:** Director breaks down an OKR into tasks for business agents.
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// convex/services/agents/director.ts
|
|
167
|
+
export class DirectorService extends Effect.Service<DirectorService>()(
|
|
168
|
+
"DirectorService",
|
|
169
|
+
{
|
|
170
|
+
effect: Effect.gen(function* () {
|
|
171
|
+
const db = yield* ConvexDatabase;
|
|
172
|
+
const a2a = yield* A2AService;
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
createTask: (args: CreateTaskArgs) =>
|
|
176
|
+
Effect.gen(function* () {
|
|
177
|
+
// 1. Create task entity
|
|
178
|
+
const taskId = yield* Effect.tryPromise(() =>
|
|
179
|
+
db.insert("things", {
|
|
180
|
+
type: "task",
|
|
181
|
+
name: args.title,
|
|
182
|
+
properties: {
|
|
183
|
+
taskType: args.taskType,
|
|
184
|
+
description: args.description,
|
|
185
|
+
priority: args.priority,
|
|
186
|
+
status: "pending",
|
|
187
|
+
deadline: args.deadline,
|
|
188
|
+
parameters: args.parameters,
|
|
189
|
+
organizationId: args.organizationId,
|
|
190
|
+
creatorId: args.creatorId,
|
|
191
|
+
},
|
|
192
|
+
status: "active",
|
|
193
|
+
createdAt: Date.now(),
|
|
194
|
+
updatedAt: Date.now(),
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
// 2. Log task_event (created)
|
|
199
|
+
yield* Effect.tryPromise(() =>
|
|
200
|
+
db.insert("events", {
|
|
201
|
+
type: "task_event",
|
|
202
|
+
actorId: args.directorId,
|
|
203
|
+
targetId: taskId,
|
|
204
|
+
timestamp: Date.now(),
|
|
205
|
+
metadata: {
|
|
206
|
+
action: "created",
|
|
207
|
+
protocol: "a2a",
|
|
208
|
+
taskType: args.taskType,
|
|
209
|
+
priority: args.priority,
|
|
210
|
+
status: "pending",
|
|
211
|
+
},
|
|
212
|
+
})
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
// 3. Find appropriate agent for taskType
|
|
216
|
+
const agent = yield* findAgentForTask(args.taskType, args.organizationId);
|
|
217
|
+
|
|
218
|
+
// 4. Delegate to agent via A2A
|
|
219
|
+
yield* a2a.delegateTask({
|
|
220
|
+
fromAgentId: args.directorId,
|
|
221
|
+
toAgentId: agent._id,
|
|
222
|
+
taskId,
|
|
223
|
+
taskType: args.taskType,
|
|
224
|
+
deadline: args.deadline,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
return { success: true, taskId };
|
|
228
|
+
}),
|
|
229
|
+
};
|
|
230
|
+
}),
|
|
231
|
+
dependencies: [ConvexDatabase.Default, A2AService.Default],
|
|
232
|
+
}
|
|
233
|
+
) {}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Task Delegation Pattern
|
|
239
|
+
|
|
240
|
+
### A2A Protocol Integration
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
// convex/services/protocols/a2a.ts
|
|
244
|
+
export class A2AService extends Effect.Service<A2AService>()(
|
|
245
|
+
"A2AService",
|
|
246
|
+
{
|
|
247
|
+
effect: Effect.gen(function* () {
|
|
248
|
+
const db = yield* ConvexDatabase;
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
delegateTask: (args: DelegateTaskArgs) =>
|
|
252
|
+
Effect.gen(function* () {
|
|
253
|
+
// 1. Create delegated connection
|
|
254
|
+
const connectionId = yield* Effect.tryPromise(() =>
|
|
255
|
+
db.insert("connections", {
|
|
256
|
+
fromThingId: args.fromAgentId,
|
|
257
|
+
toThingId: args.toAgentId,
|
|
258
|
+
relationshipType: "delegated",
|
|
259
|
+
metadata: {
|
|
260
|
+
protocol: "a2a",
|
|
261
|
+
taskId: args.taskId,
|
|
262
|
+
taskType: args.taskType,
|
|
263
|
+
assignedAt: Date.now(),
|
|
264
|
+
deadline: args.deadline,
|
|
265
|
+
priority: args.priority,
|
|
266
|
+
status: "pending",
|
|
267
|
+
},
|
|
268
|
+
createdAt: Date.now(),
|
|
269
|
+
})
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
// 2. Log task_event (assigned)
|
|
273
|
+
yield* Effect.tryPromise(() =>
|
|
274
|
+
db.insert("events", {
|
|
275
|
+
type: "task_event",
|
|
276
|
+
actorId: args.fromAgentId,
|
|
277
|
+
targetId: args.taskId,
|
|
278
|
+
timestamp: Date.now(),
|
|
279
|
+
metadata: {
|
|
280
|
+
action: "assigned",
|
|
281
|
+
protocol: "a2a",
|
|
282
|
+
taskType: args.taskType,
|
|
283
|
+
assigneeId: args.toAgentId,
|
|
284
|
+
message: `Task delegated to ${args.taskType} agent`,
|
|
285
|
+
},
|
|
286
|
+
})
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
// 3. Send A2A message to agent
|
|
290
|
+
yield* sendA2AMessage({
|
|
291
|
+
from: args.fromAgentId,
|
|
292
|
+
to: args.toAgentId,
|
|
293
|
+
messageType: "task_delegation",
|
|
294
|
+
payload: {
|
|
295
|
+
taskId: args.taskId,
|
|
296
|
+
taskType: args.taskType,
|
|
297
|
+
deadline: args.deadline,
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
return { success: true, connectionId };
|
|
302
|
+
}),
|
|
303
|
+
};
|
|
304
|
+
}),
|
|
305
|
+
dependencies: [ConvexDatabase.Default],
|
|
306
|
+
}
|
|
307
|
+
) {}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Task Acceptance/Rejection
|
|
313
|
+
|
|
314
|
+
### Agent Accepts Task
|
|
315
|
+
|
|
316
|
+
```typescript
|
|
317
|
+
// Agent accepts task
|
|
318
|
+
export const acceptTask = confect.mutation({
|
|
319
|
+
args: {
|
|
320
|
+
taskId: v.id("things"),
|
|
321
|
+
agentId: v.id("things"),
|
|
322
|
+
},
|
|
323
|
+
handler: (ctx, args) =>
|
|
324
|
+
Effect.gen(function* () {
|
|
325
|
+
const db = yield* ConvexDatabase;
|
|
326
|
+
|
|
327
|
+
// 1. Find delegation connection
|
|
328
|
+
const connection = yield* Effect.tryPromise(() =>
|
|
329
|
+
ctx.db
|
|
330
|
+
.query("connections")
|
|
331
|
+
.withIndex("to_type", (q) =>
|
|
332
|
+
q
|
|
333
|
+
.eq("toThingId", args.agentId)
|
|
334
|
+
.eq("relationshipType", "delegated")
|
|
335
|
+
)
|
|
336
|
+
.filter((q) => q.eq(q.field("metadata.taskId"), args.taskId))
|
|
337
|
+
.first()
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
if (!connection) {
|
|
341
|
+
return yield* Effect.fail(new TaskNotFoundError());
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// 2. Update connection status
|
|
345
|
+
yield* Effect.tryPromise(() =>
|
|
346
|
+
ctx.db.patch(connection._id, {
|
|
347
|
+
metadata: {
|
|
348
|
+
...connection.metadata,
|
|
349
|
+
status: "accepted",
|
|
350
|
+
acceptedAt: Date.now(),
|
|
351
|
+
},
|
|
352
|
+
updatedAt: Date.now(),
|
|
353
|
+
})
|
|
354
|
+
);
|
|
355
|
+
|
|
356
|
+
// 3. Update task status
|
|
357
|
+
yield* Effect.tryPromise(() =>
|
|
358
|
+
ctx.db.patch(args.taskId, {
|
|
359
|
+
properties: {
|
|
360
|
+
...task.properties,
|
|
361
|
+
status: "in_progress",
|
|
362
|
+
},
|
|
363
|
+
updatedAt: Date.now(),
|
|
364
|
+
})
|
|
365
|
+
);
|
|
366
|
+
|
|
367
|
+
// 4. Log task_event (accepted)
|
|
368
|
+
yield* Effect.tryPromise(() =>
|
|
369
|
+
ctx.db.insert("events", {
|
|
370
|
+
type: "task_event",
|
|
371
|
+
actorId: args.agentId,
|
|
372
|
+
targetId: args.taskId,
|
|
373
|
+
timestamp: Date.now(),
|
|
374
|
+
metadata: {
|
|
375
|
+
action: "accepted",
|
|
376
|
+
protocol: "a2a",
|
|
377
|
+
status: "in_progress",
|
|
378
|
+
message: "Agent accepted task and started work",
|
|
379
|
+
},
|
|
380
|
+
})
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
return { success: true };
|
|
384
|
+
}).pipe(Effect.provide(MainLayer)),
|
|
385
|
+
});
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Task Completion Pattern
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
// Agent completes task
|
|
394
|
+
export const completeTask = confect.mutation({
|
|
395
|
+
args: {
|
|
396
|
+
taskId: v.id("things"),
|
|
397
|
+
agentId: v.id("things"),
|
|
398
|
+
result: v.object({
|
|
399
|
+
status: v.union(v.literal("success"), v.literal("partial"), v.literal("failed")),
|
|
400
|
+
data: v.any(),
|
|
401
|
+
summary: v.string(),
|
|
402
|
+
confidence: v.optional(v.number()),
|
|
403
|
+
}),
|
|
404
|
+
},
|
|
405
|
+
handler: (ctx, args) =>
|
|
406
|
+
Effect.gen(function* () {
|
|
407
|
+
const db = yield* ConvexDatabase;
|
|
408
|
+
|
|
409
|
+
// 1. Update task with result
|
|
410
|
+
const task = yield* Effect.tryPromise(() => ctx.db.get(args.taskId));
|
|
411
|
+
|
|
412
|
+
yield* Effect.tryPromise(() =>
|
|
413
|
+
ctx.db.patch(args.taskId, {
|
|
414
|
+
properties: {
|
|
415
|
+
...task.properties,
|
|
416
|
+
status: "completed",
|
|
417
|
+
result: args.result,
|
|
418
|
+
actualDuration: Date.now() - task.createdAt,
|
|
419
|
+
},
|
|
420
|
+
updatedAt: Date.now(),
|
|
421
|
+
})
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
// 2. Update delegation connection
|
|
425
|
+
const connection = yield* Effect.tryPromise(() =>
|
|
426
|
+
ctx.db
|
|
427
|
+
.query("connections")
|
|
428
|
+
.withIndex("to_type", (q) =>
|
|
429
|
+
q
|
|
430
|
+
.eq("toThingId", args.agentId)
|
|
431
|
+
.eq("relationshipType", "delegated")
|
|
432
|
+
)
|
|
433
|
+
.filter((q) => q.eq(q.field("metadata.taskId"), args.taskId))
|
|
434
|
+
.first()
|
|
435
|
+
);
|
|
436
|
+
|
|
437
|
+
yield* Effect.tryPromise(() =>
|
|
438
|
+
ctx.db.patch(connection._id, {
|
|
439
|
+
metadata: {
|
|
440
|
+
...connection.metadata,
|
|
441
|
+
status: "completed",
|
|
442
|
+
completedAt: Date.now(),
|
|
443
|
+
},
|
|
444
|
+
updatedAt: Date.now(),
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
|
|
448
|
+
// 3. Log task_event (completed)
|
|
449
|
+
yield* Effect.tryPromise(() =>
|
|
450
|
+
ctx.db.insert("events", {
|
|
451
|
+
type: "task_event",
|
|
452
|
+
actorId: args.agentId,
|
|
453
|
+
targetId: args.taskId,
|
|
454
|
+
timestamp: Date.now(),
|
|
455
|
+
metadata: {
|
|
456
|
+
action: "completed",
|
|
457
|
+
protocol: "a2a",
|
|
458
|
+
status: "completed",
|
|
459
|
+
result: args.result,
|
|
460
|
+
message: args.result.summary,
|
|
461
|
+
},
|
|
462
|
+
})
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
return { success: true };
|
|
466
|
+
}).pipe(Effect.provide(MainLayer)),
|
|
467
|
+
});
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
## Querying Tasks
|
|
473
|
+
|
|
474
|
+
### Get All Tasks for Organization
|
|
475
|
+
|
|
476
|
+
```typescript
|
|
477
|
+
export const getOrganizationTasks = confect.query({
|
|
478
|
+
args: {
|
|
479
|
+
organizationId: v.id("things"),
|
|
480
|
+
status: v.optional(v.string()),
|
|
481
|
+
},
|
|
482
|
+
handler: (ctx, args) =>
|
|
483
|
+
Effect.gen(function* () {
|
|
484
|
+
let query = ctx.db
|
|
485
|
+
.query("things")
|
|
486
|
+
.withIndex("by_type", (q) => q.eq("type", "task"))
|
|
487
|
+
.filter((q) =>
|
|
488
|
+
q.eq(q.field("properties.organizationId"), args.organizationId)
|
|
489
|
+
);
|
|
490
|
+
|
|
491
|
+
if (args.status) {
|
|
492
|
+
query = query.filter((q) =>
|
|
493
|
+
q.eq(q.field("properties.status"), args.status)
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const tasks = yield* Effect.tryPromise(() => query.collect());
|
|
498
|
+
|
|
499
|
+
return tasks;
|
|
500
|
+
}).pipe(Effect.provide(MainLayer)),
|
|
501
|
+
});
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### Get Tasks by Agent
|
|
505
|
+
|
|
506
|
+
```typescript
|
|
507
|
+
export const getAgentTasks = confect.query({
|
|
508
|
+
args: {
|
|
509
|
+
agentId: v.id("things"),
|
|
510
|
+
status: v.optional(v.string()),
|
|
511
|
+
},
|
|
512
|
+
handler: (ctx, args) =>
|
|
513
|
+
Effect.gen(function* () {
|
|
514
|
+
// Find delegated connections
|
|
515
|
+
const connections = yield* Effect.tryPromise(() =>
|
|
516
|
+
ctx.db
|
|
517
|
+
.query("connections")
|
|
518
|
+
.withIndex("to_type", (q) =>
|
|
519
|
+
q
|
|
520
|
+
.eq("toThingId", args.agentId)
|
|
521
|
+
.eq("relationshipType", "delegated")
|
|
522
|
+
)
|
|
523
|
+
.collect()
|
|
524
|
+
);
|
|
525
|
+
|
|
526
|
+
// Get task IDs
|
|
527
|
+
const taskIds = connections.map((c) => c.metadata.taskId);
|
|
528
|
+
|
|
529
|
+
// Fetch tasks
|
|
530
|
+
const tasks = yield* Effect.tryPromise(() =>
|
|
531
|
+
Promise.all(taskIds.map((id) => ctx.db.get(id)))
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
// Filter by status if provided
|
|
535
|
+
const filtered = args.status
|
|
536
|
+
? tasks.filter((t) => t?.properties.status === args.status)
|
|
537
|
+
: tasks;
|
|
538
|
+
|
|
539
|
+
return filtered.filter(Boolean);
|
|
540
|
+
}).pipe(Effect.provide(MainLayer)),
|
|
541
|
+
});
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
## Task Analytics
|
|
547
|
+
|
|
548
|
+
### Get Task Statistics
|
|
549
|
+
|
|
550
|
+
```typescript
|
|
551
|
+
export const getTaskStats = confect.query({
|
|
552
|
+
args: {
|
|
553
|
+
organizationId: v.id("things"),
|
|
554
|
+
period: v.optional(v.number()), // Days
|
|
555
|
+
},
|
|
556
|
+
handler: (ctx, args) =>
|
|
557
|
+
Effect.gen(function* () {
|
|
558
|
+
const since = args.period
|
|
559
|
+
? Date.now() - args.period * 24 * 60 * 60 * 1000
|
|
560
|
+
: 0;
|
|
561
|
+
|
|
562
|
+
// Get all tasks
|
|
563
|
+
const tasks = yield* Effect.tryPromise(() =>
|
|
564
|
+
ctx.db
|
|
565
|
+
.query("things")
|
|
566
|
+
.withIndex("by_type", (q) => q.eq("type", "task"))
|
|
567
|
+
.filter((q) =>
|
|
568
|
+
q
|
|
569
|
+
.eq(q.field("properties.organizationId"), args.organizationId)
|
|
570
|
+
.gte(q.field("createdAt"), since)
|
|
571
|
+
)
|
|
572
|
+
.collect()
|
|
573
|
+
);
|
|
574
|
+
|
|
575
|
+
// Calculate stats
|
|
576
|
+
const stats = {
|
|
577
|
+
total: tasks.length,
|
|
578
|
+
pending: tasks.filter((t) => t.properties.status === "pending").length,
|
|
579
|
+
inProgress: tasks.filter((t) => t.properties.status === "in_progress")
|
|
580
|
+
.length,
|
|
581
|
+
completed: tasks.filter((t) => t.properties.status === "completed")
|
|
582
|
+
.length,
|
|
583
|
+
failed: tasks.filter((t) => t.properties.status === "failed").length,
|
|
584
|
+
blocked: tasks.filter((t) => t.properties.status === "blocked").length,
|
|
585
|
+
byType: tasks.reduce((acc, t) => {
|
|
586
|
+
const type = t.properties.taskType;
|
|
587
|
+
acc[type] = (acc[type] || 0) + 1;
|
|
588
|
+
return acc;
|
|
589
|
+
}, {} as Record<string, number>),
|
|
590
|
+
averageCompletionTime:
|
|
591
|
+
tasks
|
|
592
|
+
.filter((t) => t.properties.actualDuration)
|
|
593
|
+
.reduce((sum, t) => sum + t.properties.actualDuration, 0) /
|
|
594
|
+
tasks.filter((t) => t.properties.actualDuration).length,
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
return stats;
|
|
598
|
+
}).pipe(Effect.provide(MainLayer)),
|
|
599
|
+
});
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## Best Practices
|
|
605
|
+
|
|
606
|
+
### 1. Always Use Ontology
|
|
607
|
+
- Tasks are things, not custom tables
|
|
608
|
+
- Use `delegated` connections for assignment
|
|
609
|
+
- Log all lifecycle events with `task_event`
|
|
610
|
+
|
|
611
|
+
### 2. Protocol Metadata
|
|
612
|
+
- Always include `metadata.protocol: "a2a"` for agent communication
|
|
613
|
+
- Store task-specific data in connection metadata
|
|
614
|
+
|
|
615
|
+
### 3. Status Transitions
|
|
616
|
+
- Track status changes through events
|
|
617
|
+
- Update both task and connection when status changes
|
|
618
|
+
- Include timestamps for audit trails
|
|
619
|
+
|
|
620
|
+
### 4. Error Handling
|
|
621
|
+
- Log `task_event` with `action: "failed"` on errors
|
|
622
|
+
- Store error details in event metadata
|
|
623
|
+
- Update task status to "failed" or "blocked"
|
|
624
|
+
|
|
625
|
+
### 5. Subtask Hierarchy
|
|
626
|
+
- Use `properties.parentTaskId` for task breakdown
|
|
627
|
+
- Maintain parent-child relationships
|
|
628
|
+
- Complete parent only when all subtasks complete
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
## Example: Complete Task Flow
|
|
633
|
+
|
|
634
|
+
```typescript
|
|
635
|
+
// Director creates task
|
|
636
|
+
const { taskId } = await directorService.createTask({
|
|
637
|
+
title: "Research quantum computing trends",
|
|
638
|
+
taskType: "research",
|
|
639
|
+
description: "Analyze current trends in quantum computing",
|
|
640
|
+
priority: "high",
|
|
641
|
+
deadline: Date.now() + 7 * 24 * 60 * 60 * 1000, // 7 days
|
|
642
|
+
parameters: {
|
|
643
|
+
topics: ["quantum algorithms", "error correction", "hardware"],
|
|
644
|
+
depth: "detailed",
|
|
645
|
+
sources: ["academic", "industry"],
|
|
646
|
+
},
|
|
647
|
+
organizationId: "org_123",
|
|
648
|
+
creatorId: "user_456",
|
|
649
|
+
directorId: "director_789",
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
// A2A service delegates to research agent
|
|
653
|
+
// Research agent receives task via A2A protocol
|
|
654
|
+
// Agent accepts task
|
|
655
|
+
await acceptTask({
|
|
656
|
+
taskId,
|
|
657
|
+
agentId: "research_agent_001",
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
// Agent works on task
|
|
661
|
+
// ... performs research ...
|
|
662
|
+
|
|
663
|
+
// Agent completes task
|
|
664
|
+
await completeTask({
|
|
665
|
+
taskId,
|
|
666
|
+
agentId: "research_agent_001",
|
|
667
|
+
result: {
|
|
668
|
+
status: "success",
|
|
669
|
+
data: {
|
|
670
|
+
findings: [...],
|
|
671
|
+
sources: [...],
|
|
672
|
+
trends: [...],
|
|
673
|
+
},
|
|
674
|
+
summary: "Identified 5 key trends in quantum computing...",
|
|
675
|
+
confidence: 0.92,
|
|
676
|
+
},
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
// Query completed tasks
|
|
680
|
+
const completed = await getOrganizationTasks({
|
|
681
|
+
organizationId: "org_123",
|
|
682
|
+
status: "completed",
|
|
683
|
+
});
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
---
|
|
687
|
+
|
|
688
|
+
## Summary
|
|
689
|
+
|
|
690
|
+
The task organization system provides:
|
|
691
|
+
|
|
692
|
+
1. **Ontology-aligned** - Tasks are things, delegation is connections, lifecycle is events
|
|
693
|
+
2. **A2A protocol** - Cross-agent communication via standard protocol
|
|
694
|
+
3. **Complete auditability** - Every action logged as event
|
|
695
|
+
4. **Flexible** - Supports all 10 agent types
|
|
696
|
+
5. **Scalable** - Efficient queries, proper indexes
|
|
697
|
+
|
|
698
|
+
**This system enables the director to orchestrate complex workflows across business agents while maintaining complete transparency and traceability.**
|