oneie 2.0.2 → 2.0.5
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 +725 -0
- package/LICENSE.md +84 -0
- package/README.md +489 -931
- package/folders.yaml +78 -17
- 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/agentkit.md +349 -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/copilotkit.md +1559 -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/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
- package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
- package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
- package/one/events/GROUPS-MIGRATION.md +625 -0
- package/one/events/INSTALL-TESTS.md +293 -0
- package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
- package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
- package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
- package/one/events/INTEGRATION-SUMMARY.md +653 -0
- package/one/events/MIGRATION-REPORT.md +435 -0
- package/one/events/MIGRATION.md +69 -0
- package/one/events/README-archived.md +519 -0
- package/one/events/TEST-SUMMARY.md +393 -0
- package/one/events/TESTS-QUICK-REF.md +262 -0
- package/one/events/events.md +545 -0
- package/one/groups/groups.md +543 -0
- package/one/groups/one.md +599 -0
- package/one/groups/revenue.md +673 -0
- package/one/groups/strategy.md +869 -0
- package/one/groups/vision.md +98 -0
- package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
- package/one/knowledge/ai-platform.md +305 -0
- package/one/knowledge/architecture-any-backend.md +1366 -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/docs/flow.md +0 -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 +2830 -0
- package/one/knowledge/ontology.md.backup +2822 -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/provider-creation-guide.md +1064 -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/knowledge/todo.md +251 -0
- package/one/license.md +84 -0
- package/one/people/anthony-o-connell.md +440 -0
- package/one/people/people.md +567 -0
- package/one/things/CHECKLIST.md +356 -0
- package/one/things/ONE.md +510 -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/cli-code.md +652 -0
- package/one/things/cli/cli-compiler-code.md +652 -0
- package/one/things/cli/cli.md +1068 -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/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-1-dataprovider-interface.md +2358 -0
- package/one/things/features/2-2-config-system.md +3075 -0
- package/one/things/features/2-3-effectts-services.md +1498 -0
- package/one/things/features/2-4-react-hooks.md +2120 -0
- package/one/things/features/2-5-auth-migration.md +2046 -0
- package/one/things/features/2-6-dashboard-migration.md +1985 -0
- package/one/things/features/2-7-alternative-providers.md +2505 -0
- package/one/things/features/2-7-implementation-report.md +680 -0
- package/one/things/features/2-cli.md +1235 -0
- package/one/things/features/2-design.md +1738 -0
- package/one/things/features/2-tests.md +520 -0
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
- package/one/things/features/DECOUPLING.md +272 -0
- package/one/things/features/DEPLOYMENT.md +452 -0
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
- package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
- package/one/things/features/improve.md +843 -0
- package/one/things/features/remove-convex-deps.md +45 -0
- package/one/things/features/top-features.md +79 -0
- package/one/things/features/use-one-backend.md +1180 -0
- package/one/things/ideas/1-create-workflow.md +189 -0
- package/one/things/ideas/2-backend-agnostic-frontend.md +384 -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/2-backend-agnostic-frontend.md +543 -0
- package/one/things/plans/3-groups.md +502 -0
- package/one/things/plans/app.md +761 -0
- package/one/things/plans/backend-agnostic-frontend.md +323 -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/deploy-to-cloudflare.md +581 -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/organizations-to-groups.md +705 -0
- package/one/things/plans/performace.md +90 -0
- package/one/things/plans/release.md +432 -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/system.md +600 -0
- package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
- package/one/things/tests/2-1-test-analysis.md +496 -0
- package/one/things/things.md +349 -0
- package/one/things/todo.md +1248 -0
- package/one/things/vision/elegant-interface.md +214 -0
- package/package.json +5 -2
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Advanced Hook Orchestration and Coordination System
|
|
5
|
+
* Manages complex workflows, parallel execution, and hook dependencies
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import { EventEmitter } from 'events';
|
|
11
|
+
import AgentHookManager from './agent-hook-manager.js';
|
|
12
|
+
import QualityScoringEngine from './quality-scoring-engine.js';
|
|
13
|
+
import { PerformanceMonitor } from './performance-monitoring-hook.js';
|
|
14
|
+
|
|
15
|
+
class HookOrchestrator extends EventEmitter {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.agentHookManager = new AgentHookManager();
|
|
19
|
+
this.qualityEngine = new QualityScoringEngine();
|
|
20
|
+
this.performanceMonitor = new PerformanceMonitor();
|
|
21
|
+
|
|
22
|
+
this.activeExecutions = new Map(); // executionId -> execution context
|
|
23
|
+
this.executionQueue = [];
|
|
24
|
+
this.maxConcurrentExecutions = 3;
|
|
25
|
+
this.executionHistory = [];
|
|
26
|
+
this.dependencies = new Map(); // hookType -> dependencies
|
|
27
|
+
|
|
28
|
+
this.initializeDependencies();
|
|
29
|
+
this.startExecutionProcessor();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
initializeDependencies() {
|
|
33
|
+
// Define hook execution dependencies
|
|
34
|
+
this.dependencies.set('securityValidation', []);
|
|
35
|
+
this.dependencies.set('storyValidation', ['securityValidation']);
|
|
36
|
+
this.dependencies.set('qualityScoring', ['storyValidation']);
|
|
37
|
+
this.dependencies.set('performanceMonitoring', []);
|
|
38
|
+
this.dependencies.set('notifications', ['qualityScoring', 'performanceMonitoring']);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
startExecutionProcessor() {
|
|
42
|
+
// Process execution queue every 100ms
|
|
43
|
+
setInterval(() => {
|
|
44
|
+
this.processExecutionQueue();
|
|
45
|
+
}, 100);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async orchestrateAgentWorkflow(agentName, workflowContext = {}) {
|
|
49
|
+
const executionId = this.generateExecutionId();
|
|
50
|
+
const startTime = Date.now();
|
|
51
|
+
|
|
52
|
+
const execution = {
|
|
53
|
+
id: executionId,
|
|
54
|
+
agentName,
|
|
55
|
+
context: workflowContext,
|
|
56
|
+
status: 'pending',
|
|
57
|
+
startTime,
|
|
58
|
+
endTime: null,
|
|
59
|
+
results: {},
|
|
60
|
+
dependencies: new Map(),
|
|
61
|
+
completedHooks: new Set(),
|
|
62
|
+
failedHooks: new Set(),
|
|
63
|
+
totalDuration: 0
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this.activeExecutions.set(executionId, execution);
|
|
67
|
+
this.emit('executionStarted', { executionId, agentName });
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
// Get hook execution order based on dependencies
|
|
71
|
+
const executionPlan = this.createExecutionPlan(agentName);
|
|
72
|
+
execution.executionPlan = executionPlan;
|
|
73
|
+
|
|
74
|
+
// Execute hooks according to plan
|
|
75
|
+
const results = await this.executeWorkflowPlan(execution);
|
|
76
|
+
|
|
77
|
+
execution.status = results.success ? 'completed' : 'failed';
|
|
78
|
+
execution.endTime = Date.now();
|
|
79
|
+
execution.totalDuration = execution.endTime - execution.startTime;
|
|
80
|
+
execution.results = results;
|
|
81
|
+
|
|
82
|
+
this.executionHistory.push({
|
|
83
|
+
executionId,
|
|
84
|
+
agentName,
|
|
85
|
+
success: results.success,
|
|
86
|
+
duration: execution.totalDuration,
|
|
87
|
+
timestamp: new Date().toISOString()
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
this.emit('executionCompleted', { executionId, agentName, results });
|
|
91
|
+
return results;
|
|
92
|
+
|
|
93
|
+
} catch (error) {
|
|
94
|
+
execution.status = 'error';
|
|
95
|
+
execution.endTime = Date.now();
|
|
96
|
+
execution.totalDuration = execution.endTime - execution.startTime;
|
|
97
|
+
execution.error = error.message;
|
|
98
|
+
|
|
99
|
+
this.emit('executionError', { executionId, agentName, error });
|
|
100
|
+
throw error;
|
|
101
|
+
} finally {
|
|
102
|
+
this.activeExecutions.delete(executionId);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
createExecutionPlan(agentName) {
|
|
107
|
+
const config = this.agentHookManager.getAgentConfiguration(agentName);
|
|
108
|
+
const enabledHooks = Object.keys(config.hooks).filter(
|
|
109
|
+
hookType => config.hooks[hookType].enabled
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
// Create dependency graph
|
|
113
|
+
const dependencyGraph = new Map();
|
|
114
|
+
const inDegree = new Map();
|
|
115
|
+
|
|
116
|
+
// Initialize graph
|
|
117
|
+
enabledHooks.forEach(hook => {
|
|
118
|
+
dependencyGraph.set(hook, []);
|
|
119
|
+
inDegree.set(hook, 0);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Build dependency edges
|
|
123
|
+
enabledHooks.forEach(hook => {
|
|
124
|
+
const deps = this.dependencies.get(hook) || [];
|
|
125
|
+
deps.forEach(dep => {
|
|
126
|
+
if (enabledHooks.includes(dep)) {
|
|
127
|
+
dependencyGraph.get(dep).push(hook);
|
|
128
|
+
inDegree.set(hook, inDegree.get(hook) + 1);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// Topological sort to determine execution order
|
|
134
|
+
const executionOrder = [];
|
|
135
|
+
const queue = [];
|
|
136
|
+
|
|
137
|
+
// Find hooks with no dependencies
|
|
138
|
+
inDegree.forEach((degree, hook) => {
|
|
139
|
+
if (degree === 0) {
|
|
140
|
+
queue.push(hook);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
while (queue.length > 0) {
|
|
145
|
+
const currentHook = queue.shift();
|
|
146
|
+
executionOrder.push(currentHook);
|
|
147
|
+
|
|
148
|
+
// Update dependent hooks
|
|
149
|
+
dependencyGraph.get(currentHook).forEach(dependentHook => {
|
|
150
|
+
inDegree.set(dependentHook, inDegree.get(dependentHook) - 1);
|
|
151
|
+
if (inDegree.get(dependentHook) === 0) {
|
|
152
|
+
queue.push(dependentHook);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Check for circular dependencies
|
|
158
|
+
if (executionOrder.length !== enabledHooks.length) {
|
|
159
|
+
throw new Error(`Circular dependency detected in hooks for agent ${agentName}`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
hooks: executionOrder,
|
|
164
|
+
parallelGroups: this.identifyParallelGroups(executionOrder, dependencyGraph),
|
|
165
|
+
estimatedDuration: this.estimateExecutionDuration(agentName, executionOrder)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
identifyParallelGroups(executionOrder, dependencyGraph) {
|
|
170
|
+
const parallelGroups = [];
|
|
171
|
+
let currentGroup = [];
|
|
172
|
+
const processed = new Set();
|
|
173
|
+
|
|
174
|
+
for (const hook of executionOrder) {
|
|
175
|
+
const deps = this.dependencies.get(hook) || [];
|
|
176
|
+
const hasUnmetDependencies = deps.some(dep => !processed.has(dep));
|
|
177
|
+
|
|
178
|
+
if (!hasUnmetDependencies && currentGroup.length === 0) {
|
|
179
|
+
currentGroup.push(hook);
|
|
180
|
+
} else if (!hasUnmetDependencies) {
|
|
181
|
+
// Can run in parallel with current group
|
|
182
|
+
currentGroup.push(hook);
|
|
183
|
+
} else {
|
|
184
|
+
// Start new group
|
|
185
|
+
if (currentGroup.length > 0) {
|
|
186
|
+
parallelGroups.push([...currentGroup]);
|
|
187
|
+
currentGroup.forEach(h => processed.add(h));
|
|
188
|
+
currentGroup = [];
|
|
189
|
+
}
|
|
190
|
+
currentGroup.push(hook);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (currentGroup.length > 0) {
|
|
195
|
+
parallelGroups.push(currentGroup);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return parallelGroups;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
estimateExecutionDuration(agentName, hooks) {
|
|
202
|
+
const baseDurations = {
|
|
203
|
+
'securityValidation': 200,
|
|
204
|
+
'storyValidation': 1500,
|
|
205
|
+
'qualityScoring': 800,
|
|
206
|
+
'performanceMonitoring': 100,
|
|
207
|
+
'notifications': 300
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
let totalEstimate = 0;
|
|
211
|
+
hooks.forEach(hook => {
|
|
212
|
+
totalEstimate += baseDurations[hook] || 500;
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
return totalEstimate;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async executeWorkflowPlan(execution) {
|
|
219
|
+
const { agentName, context, executionPlan } = execution;
|
|
220
|
+
const results = {
|
|
221
|
+
executionId: execution.id,
|
|
222
|
+
agentName,
|
|
223
|
+
success: true,
|
|
224
|
+
hookResults: {},
|
|
225
|
+
parallelGroupResults: [],
|
|
226
|
+
totalDuration: 0,
|
|
227
|
+
errors: []
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const startTime = Date.now();
|
|
231
|
+
|
|
232
|
+
try {
|
|
233
|
+
// Execute hooks in parallel groups
|
|
234
|
+
for (let i = 0; i < executionPlan.parallelGroups.length; i++) {
|
|
235
|
+
const group = executionPlan.parallelGroups[i];
|
|
236
|
+
const groupResults = await this.executeParallelGroup(agentName, group, context);
|
|
237
|
+
|
|
238
|
+
results.parallelGroupResults.push({
|
|
239
|
+
groupIndex: i,
|
|
240
|
+
hooks: group,
|
|
241
|
+
results: groupResults,
|
|
242
|
+
success: groupResults.every(r => r.success)
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// Update execution tracking
|
|
246
|
+
group.forEach(hook => {
|
|
247
|
+
const hookResult = groupResults.find(r => r.hookType === hook);
|
|
248
|
+
if (hookResult) {
|
|
249
|
+
results.hookResults[hook] = hookResult;
|
|
250
|
+
if (hookResult.success) {
|
|
251
|
+
execution.completedHooks.add(hook);
|
|
252
|
+
} else {
|
|
253
|
+
execution.failedHooks.add(hook);
|
|
254
|
+
results.errors.push(`${hook}: ${hookResult.error || hookResult.message}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// Check if we should continue after failures
|
|
260
|
+
const groupSuccess = results.parallelGroupResults[i].success;
|
|
261
|
+
if (!groupSuccess) {
|
|
262
|
+
const criticalFailures = groupResults.filter(r => !r.success && r.blocking);
|
|
263
|
+
if (criticalFailures.length > 0) {
|
|
264
|
+
results.success = false;
|
|
265
|
+
this.emit('executionBlocked', {
|
|
266
|
+
executionId: execution.id,
|
|
267
|
+
agentName,
|
|
268
|
+
blockingHooks: criticalFailures.map(f => f.hookType)
|
|
269
|
+
});
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
results.totalDuration = Date.now() - startTime;
|
|
276
|
+
|
|
277
|
+
// Update performance metrics
|
|
278
|
+
this.performanceMonitor.recordAgentMetrics(agentName, {
|
|
279
|
+
responseTime: results.totalDuration,
|
|
280
|
+
error: !results.success,
|
|
281
|
+
qualityScore: results.hookResults.qualityScoring?.score,
|
|
282
|
+
delegated: context.delegated || false
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
return results;
|
|
286
|
+
|
|
287
|
+
} catch (error) {
|
|
288
|
+
results.success = false;
|
|
289
|
+
results.error = error.message;
|
|
290
|
+
results.totalDuration = Date.now() - startTime;
|
|
291
|
+
results.errors.push(`Execution error: ${error.message}`);
|
|
292
|
+
|
|
293
|
+
throw error;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async executeParallelGroup(agentName, hooks, context) {
|
|
298
|
+
const promises = hooks.map(async (hookType) => {
|
|
299
|
+
const hookStartTime = Date.now();
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
const result = await this.executeHook(agentName, hookType, context);
|
|
303
|
+
return {
|
|
304
|
+
hookType,
|
|
305
|
+
success: true,
|
|
306
|
+
result,
|
|
307
|
+
duration: Date.now() - hookStartTime,
|
|
308
|
+
blocking: result.blocking || false
|
|
309
|
+
};
|
|
310
|
+
} catch (error) {
|
|
311
|
+
return {
|
|
312
|
+
hookType,
|
|
313
|
+
success: false,
|
|
314
|
+
error: error.message,
|
|
315
|
+
duration: Date.now() - hookStartTime,
|
|
316
|
+
blocking: true
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
return await Promise.all(promises);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
async executeHook(agentName, hookType, context) {
|
|
325
|
+
const config = this.agentHookManager.getHookConfiguration(agentName, hookType);
|
|
326
|
+
|
|
327
|
+
// Route to appropriate hook implementation
|
|
328
|
+
switch (hookType) {
|
|
329
|
+
case 'securityValidation':
|
|
330
|
+
return await this.executeSecurityValidation(agentName, config, context);
|
|
331
|
+
case 'storyValidation':
|
|
332
|
+
return await this.executeStoryValidation(agentName, config, context);
|
|
333
|
+
case 'qualityScoring':
|
|
334
|
+
return await this.executeQualityScoring(agentName, config, context);
|
|
335
|
+
case 'performanceMonitoring':
|
|
336
|
+
return await this.executePerformanceMonitoring(agentName, config, context);
|
|
337
|
+
case 'notifications':
|
|
338
|
+
return await this.executeNotifications(agentName, config, context);
|
|
339
|
+
default:
|
|
340
|
+
throw new Error(`Unknown hook type: ${hookType}`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
async executeSecurityValidation(agentName, config, context) {
|
|
345
|
+
// Tool validation
|
|
346
|
+
if (context.toolRequested) {
|
|
347
|
+
const validation = this.agentHookManager.validateToolUsage(agentName, context.toolRequested);
|
|
348
|
+
if (!validation.allowed) {
|
|
349
|
+
return {
|
|
350
|
+
success: false,
|
|
351
|
+
message: validation.reason,
|
|
352
|
+
blocking: true,
|
|
353
|
+
allowedTools: validation.allowedTools
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Path validation
|
|
359
|
+
if (context.filePath) {
|
|
360
|
+
const sensitivePatterns = [
|
|
361
|
+
/.*\/secrets\/.*/,
|
|
362
|
+
/.*\.env.*/,
|
|
363
|
+
/.*\/credentials\/.*/,
|
|
364
|
+
/.*private.*key.*/
|
|
365
|
+
];
|
|
366
|
+
|
|
367
|
+
const isSensitive = sensitivePatterns.some(pattern => pattern.test(context.filePath));
|
|
368
|
+
if (isSensitive && !config.allowSensitiveFiles) {
|
|
369
|
+
return {
|
|
370
|
+
success: false,
|
|
371
|
+
message: `Access to sensitive file blocked: ${context.filePath}`,
|
|
372
|
+
blocking: true
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
return {
|
|
378
|
+
success: true,
|
|
379
|
+
message: 'Security validation passed',
|
|
380
|
+
blocking: false
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async executeStoryValidation(agentName, config, context) {
|
|
385
|
+
if (!context.storyContent) {
|
|
386
|
+
return {
|
|
387
|
+
success: true,
|
|
388
|
+
message: 'No story content to validate',
|
|
389
|
+
blocking: false
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// Simulate story validation with R.O.C.K.E.T. framework
|
|
394
|
+
const score = this.calculateStoryScore(context.storyContent, agentName);
|
|
395
|
+
const threshold = config.qualityThreshold || 7.0;
|
|
396
|
+
|
|
397
|
+
return {
|
|
398
|
+
success: score >= threshold,
|
|
399
|
+
message: `Story validation ${score >= threshold ? 'passed' : 'failed'}: ${score}/${threshold}`,
|
|
400
|
+
score,
|
|
401
|
+
threshold,
|
|
402
|
+
blocking: score < 5.0 // Block if critically poor
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
async executeQualityScoring(agentName, config, context) {
|
|
407
|
+
if (!context.content) {
|
|
408
|
+
return {
|
|
409
|
+
success: true,
|
|
410
|
+
message: 'No content to score',
|
|
411
|
+
score: 0,
|
|
412
|
+
blocking: false
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
try {
|
|
417
|
+
const contentType = context.contentType || 'general';
|
|
418
|
+
const scoreResult = await this.qualityEngine.scoreOutput(context.content, {
|
|
419
|
+
agentType: agentName,
|
|
420
|
+
contentType
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
const threshold = config.qualityThreshold || 7.0;
|
|
424
|
+
|
|
425
|
+
return {
|
|
426
|
+
success: scoreResult.adjustedScore >= threshold,
|
|
427
|
+
message: `Quality score: ${scoreResult.adjustedScore.toFixed(1)}/${threshold}`,
|
|
428
|
+
score: scoreResult.adjustedScore,
|
|
429
|
+
threshold,
|
|
430
|
+
qualityBand: scoreResult.qualityBand,
|
|
431
|
+
blocking: scoreResult.adjustedScore < 5.0
|
|
432
|
+
};
|
|
433
|
+
} catch (error) {
|
|
434
|
+
return {
|
|
435
|
+
success: false,
|
|
436
|
+
message: `Quality scoring failed: ${error.message}`,
|
|
437
|
+
blocking: false
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
async executePerformanceMonitoring(agentName, config, context) {
|
|
443
|
+
const responseTime = context.responseTime || Date.now() - (context.startTime || Date.now());
|
|
444
|
+
const threshold = config.responseTimeThreshold || 2000;
|
|
445
|
+
|
|
446
|
+
// Record metrics
|
|
447
|
+
this.performanceMonitor.recordAgentMetrics(agentName, {
|
|
448
|
+
responseTime,
|
|
449
|
+
error: context.hasError || false,
|
|
450
|
+
qualityScore: context.qualityScore,
|
|
451
|
+
toolUsed: context.toolUsed,
|
|
452
|
+
delegated: context.delegated
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
return {
|
|
456
|
+
success: responseTime <= threshold,
|
|
457
|
+
message: `Performance: ${responseTime}ms (threshold: ${threshold}ms)`,
|
|
458
|
+
responseTime,
|
|
459
|
+
threshold,
|
|
460
|
+
blocking: false
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
async executeNotifications(agentName, config, context) {
|
|
465
|
+
const channels = config.channels || ['console'];
|
|
466
|
+
|
|
467
|
+
if (context.notifications && context.notifications.length > 0) {
|
|
468
|
+
for (const notification of context.notifications) {
|
|
469
|
+
if (channels.includes('console')) {
|
|
470
|
+
console.log(`[${agentName.toUpperCase()}] ${notification.message}`);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (channels.includes('file')) {
|
|
474
|
+
const logPath = path.join(__dirname, 'notifications.log');
|
|
475
|
+
const timestamp = new Date().toISOString();
|
|
476
|
+
const logEntry = `[${timestamp}] [${agentName}] ${notification.message}\n`;
|
|
477
|
+
fs.appendFileSync(logPath, logEntry);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
return {
|
|
483
|
+
success: true,
|
|
484
|
+
message: `Notifications sent via: ${channels.join(', ')}`,
|
|
485
|
+
blocking: false
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
calculateStoryScore(content, agentName) {
|
|
490
|
+
let score = 7.0; // Base score
|
|
491
|
+
|
|
492
|
+
// Check for user story format
|
|
493
|
+
if (/\*\*As a\*\*.*\*\*I want\*\*.*\*\*so that\*\*/i.test(content)) {
|
|
494
|
+
score += 1.0;
|
|
495
|
+
} else {
|
|
496
|
+
score -= 1.5;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// Check for acceptance criteria
|
|
500
|
+
if (/acceptance criteria/i.test(content) && /\d+\./g.test(content)) {
|
|
501
|
+
score += 0.5;
|
|
502
|
+
} else {
|
|
503
|
+
score -= 1.0;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Check for tasks/subtasks
|
|
507
|
+
if (/- \[ \]/g.test(content)) {
|
|
508
|
+
score += 0.5;
|
|
509
|
+
} else {
|
|
510
|
+
score -= 0.5;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// Agent-specific scoring adjustments
|
|
514
|
+
const agentConfig = this.agentHookManager.getAgentConfiguration(agentName);
|
|
515
|
+
if (agentConfig.specialization === 'technical-leadership' && /architecture|technical/i.test(content)) {
|
|
516
|
+
score += 0.5;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (agentConfig.specialization === 'strategic-marketing' && /strategy|marketing|campaign/i.test(content)) {
|
|
520
|
+
score += 0.5;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return Math.max(0, Math.min(10, score));
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
processExecutionQueue() {
|
|
527
|
+
// Process queued executions if we have capacity
|
|
528
|
+
while (this.executionQueue.length > 0 && this.activeExecutions.size < this.maxConcurrentExecutions) {
|
|
529
|
+
const queuedExecution = this.executionQueue.shift();
|
|
530
|
+
this.orchestrateAgentWorkflow(queuedExecution.agentName, queuedExecution.context)
|
|
531
|
+
.then(queuedExecution.resolve)
|
|
532
|
+
.catch(queuedExecution.reject);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
async queueExecution(agentName, context = {}) {
|
|
537
|
+
return new Promise((resolve, reject) => {
|
|
538
|
+
this.executionQueue.push({
|
|
539
|
+
agentName,
|
|
540
|
+
context,
|
|
541
|
+
resolve,
|
|
542
|
+
reject,
|
|
543
|
+
queuedAt: Date.now()
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
generateExecutionId() {
|
|
549
|
+
return `exec_${Date.now()}_${Math.random().toString(36).substring(7)}`;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
getExecutionStatus(executionId) {
|
|
553
|
+
const execution = this.activeExecutions.get(executionId);
|
|
554
|
+
if (!execution) {
|
|
555
|
+
return null;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return {
|
|
559
|
+
id: execution.id,
|
|
560
|
+
agentName: execution.agentName,
|
|
561
|
+
status: execution.status,
|
|
562
|
+
progress: {
|
|
563
|
+
completed: execution.completedHooks.size,
|
|
564
|
+
failed: execution.failedHooks.size,
|
|
565
|
+
total: execution.executionPlan?.hooks.length || 0
|
|
566
|
+
},
|
|
567
|
+
duration: execution.endTime ?
|
|
568
|
+
execution.totalDuration :
|
|
569
|
+
Date.now() - execution.startTime
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
getSystemMetrics() {
|
|
574
|
+
return {
|
|
575
|
+
activeExecutions: this.activeExecutions.size,
|
|
576
|
+
queuedExecutions: this.executionQueue.length,
|
|
577
|
+
maxConcurrentExecutions: this.maxConcurrentExecutions,
|
|
578
|
+
totalExecutionsCompleted: this.executionHistory.length,
|
|
579
|
+
averageExecutionTime: this.executionHistory.length > 0 ?
|
|
580
|
+
this.executionHistory.reduce((sum, exec) => sum + exec.duration, 0) / this.executionHistory.length :
|
|
581
|
+
0,
|
|
582
|
+
successRate: this.executionHistory.length > 0 ?
|
|
583
|
+
this.executionHistory.filter(exec => exec.success).length / this.executionHistory.length :
|
|
584
|
+
0
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
emergencyStop() {
|
|
589
|
+
// Cancel all active executions
|
|
590
|
+
this.activeExecutions.forEach((execution, executionId) => {
|
|
591
|
+
execution.status = 'cancelled';
|
|
592
|
+
execution.endTime = Date.now();
|
|
593
|
+
execution.totalDuration = execution.endTime - execution.startTime;
|
|
594
|
+
this.emit('executionCancelled', { executionId, agentName: execution.agentName });
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
this.activeExecutions.clear();
|
|
598
|
+
this.executionQueue.length = 0;
|
|
599
|
+
|
|
600
|
+
this.emit('emergencyStop', { timestamp: new Date().toISOString() });
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// CLI interface
|
|
605
|
+
async function main() {
|
|
606
|
+
const orchestrator = new HookOrchestrator();
|
|
607
|
+
const command = process.argv[2];
|
|
608
|
+
|
|
609
|
+
switch (command) {
|
|
610
|
+
case 'execute':
|
|
611
|
+
const agentName = process.argv[3];
|
|
612
|
+
const contextStr = process.argv[4] || '{}';
|
|
613
|
+
|
|
614
|
+
if (!agentName) {
|
|
615
|
+
console.error('Agent name required');
|
|
616
|
+
process.exit(1);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
try {
|
|
620
|
+
const context = JSON.parse(contextStr);
|
|
621
|
+
const results = await orchestrator.orchestrateAgentWorkflow(agentName, context);
|
|
622
|
+
console.log(JSON.stringify(results, null, 2));
|
|
623
|
+
} catch (error) {
|
|
624
|
+
console.error('Execution failed:', error.message);
|
|
625
|
+
process.exit(1);
|
|
626
|
+
}
|
|
627
|
+
break;
|
|
628
|
+
|
|
629
|
+
case 'status':
|
|
630
|
+
const executionId = process.argv[3];
|
|
631
|
+
if (executionId) {
|
|
632
|
+
const status = orchestrator.getExecutionStatus(executionId);
|
|
633
|
+
console.log(JSON.stringify(status, null, 2));
|
|
634
|
+
} else {
|
|
635
|
+
const metrics = orchestrator.getSystemMetrics();
|
|
636
|
+
console.log(JSON.stringify(metrics, null, 2));
|
|
637
|
+
}
|
|
638
|
+
break;
|
|
639
|
+
|
|
640
|
+
case 'metrics':
|
|
641
|
+
const systemMetrics = orchestrator.getSystemMetrics();
|
|
642
|
+
console.log(JSON.stringify(systemMetrics, null, 2));
|
|
643
|
+
break;
|
|
644
|
+
|
|
645
|
+
default:
|
|
646
|
+
console.log('Usage: hook-orchestrator.js <command> [args...]');
|
|
647
|
+
console.log('Commands:');
|
|
648
|
+
console.log(' execute <agent-name> [context-json] - Execute workflow for agent');
|
|
649
|
+
console.log(' status [execution-id] - Get execution status or system metrics');
|
|
650
|
+
console.log(' metrics - Get system performance metrics');
|
|
651
|
+
process.exit(1);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
656
|
+
main().catch(error => {
|
|
657
|
+
console.error('Error:', error);
|
|
658
|
+
process.exit(1);
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export default HookOrchestrator;
|