claude-flow-novice 2.15.11 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/cfn-extras/agents/cfn-v3-coordinator.md +517 -0
- package/.claude/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +1 -1
- package/.claude/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +1 -1
- package/.claude/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +1 -1
- package/.claude/cfn-extras/skills/google-sheets-progress/SKILL.md +1 -1
- package/.claude/commands/CFN_LOOP_FRONTEND.md +1 -1
- package/.claude/commands/cfn-loop-cli.md +214 -442
- package/.claude/commands/cfn-loop-frontend.md +1 -1
- package/.claude/commands/cfn-loop-task.md +2 -2
- package/.claude/commands/cfn-loop-trigger.md +114 -0
- package/.claude/commands/deprecated/cfn-loop.md +2 -2
- package/.claude/hooks/cfn-invoke-post-edit-ts.sh +100 -0
- package/.claude/hooks/cfn-invoke-post-edit-ts.sh.backup +78 -0
- package/.claude/hooks/cfn-invoke-post-edit.sh +53 -5
- package/.claude/hooks/cfn-invoke-post-edit.sh.backup +87 -0
- package/.claude/hooks/cfn-invoke-pre-edit-ts.sh +116 -0
- package/.claude/hooks/cfn-invoke-pre-edit-ts.sh.backup +94 -0
- package/.claude/hooks/cfn-invoke-pre-edit.sh +22 -0
- package/.claude/hooks/cfn-invoke-pre-edit.sh.backup +88 -0
- package/.claude/hooks/cfn-post-edit.config.json +9 -2
- package/.claude/root-claude-distribute/CFN-CLAUDE.md +1 -1
- package/.claude/skills/cfn-agent-spawning/SKILL.md +48 -1
- package/.claude/skills/cfn-agent-spawning/SKILL.md.backup +135 -0
- package/.claude/skills/cfn-agent-spawning/TYPESCRIPT_MIGRATION.md +567 -0
- package/.claude/skills/cfn-agent-spawning/check-dependencies.sh +22 -0
- package/.claude/skills/{cfn-redis-coordination/check-dependencies.sh → cfn-agent-spawning/check-dependencies.sh.backup} +3 -5
- package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -0
- package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh.backup +127 -0
- package/.claude/skills/cfn-agent-spawning/parse-agent-provider.sh +22 -0
- package/.claude/skills/cfn-agent-spawning/parse-agent-provider.sh.backup +59 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent-wrapper.sh +63 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent-wrapper.sh.backup +41 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +26 -1
- package/.claude/skills/cfn-agent-spawning/spawn-templates.sh +22 -0
- package/.claude/skills/cfn-agent-spawning/spawn-templates.sh.backup +613 -0
- package/.claude/skills/cfn-agent-spawning/spawn-worker.sh +22 -0
- package/.claude/skills/cfn-agent-spawning/spawn-worker.sh.backup +176 -0
- package/.claude/skills/cfn-backlog-management/SKILL.md +1 -1
- package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/metadata.json +8 -0
- package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/original +271 -0
- package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/revert.sh +7 -0
- package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/metadata.json +8 -0
- package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/original +325 -0
- package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/revert.sh +7 -0
- package/.claude/skills/cfn-loop-orchestration/CLI_IMPLEMENTATION_SUMMARY.md +330 -0
- package/.claude/skills/cfn-loop-orchestration/CONFIGURATION_IMPROVEMENTS.md +318 -0
- package/.claude/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_MIGRATION.md +308 -0
- package/.claude/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_QUICK_START.md +378 -0
- package/.claude/skills/cfn-loop-orchestration/E2E_VALIDATION_REPORT.md +262 -0
- package/.claude/skills/cfn-loop-orchestration/IMPLEMENTATION_SUMMARY.md +319 -519
- package/.claude/skills/cfn-loop-orchestration/NORTH_STAR_E2E_REPORT.md +299 -0
- package/.claude/skills/cfn-loop-orchestration/NORTH_STAR_EXECUTION_SUMMARY.md +403 -0
- package/.claude/skills/cfn-loop-orchestration/NORTH_STAR_INDEX.md +323 -0
- package/.claude/skills/cfn-loop-orchestration/SKILL.md +159 -48
- package/.claude/skills/cfn-loop-orchestration/SPAWN_AGENTS_IMPLEMENTATION.md +188 -0
- package/.claude/skills/cfn-loop-orchestration/TEST_COVERAGE_REPORT.md +335 -0
- package/.claude/skills/cfn-loop-orchestration/TEST_COVERAGE_SUMMARY.md +456 -0
- package/.claude/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_REPORT.md +709 -0
- package/.claude/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_SUMMARY.md +257 -0
- package/.claude/skills/cfn-loop-orchestration/VALIDATION_REPORT.md +572 -0
- package/.claude/skills/cfn-loop-orchestration/VALIDATION_SUMMARY.txt +196 -0
- package/.claude/skills/cfn-loop-orchestration/VALIDATOR_MODULE_GUIDE.md +526 -0
- package/.claude/skills/cfn-loop-orchestration/archive/legacy-bash/README.md +167 -0
- package/.claude/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate-enhanced.sh +548 -0
- package/.claude/skills/cfn-loop-orchestration/{orchestrate-wrapper.sh → archive/legacy-bash/orchestrate-wrapper.sh} +11 -1
- package/.claude/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate.sh +182 -0
- package/.claude/skills/cfn-loop-orchestration/e2e-validation-fixed.js +240 -0
- package/.claude/skills/cfn-loop-orchestration/e2e-validation.js +213 -0
- package/.claude/skills/cfn-loop-orchestration/package-lock.json +3 -0
- package/.claude/skills/cfn-loop-orchestration/package.json +4 -0
- package/.claude/skills/cfn-loop-orchestration/run-north-star-e2e.ts +210 -0
- package/.claude/skills/cfn-loop-orchestration/src/cli/orchestrator-cli.ts +396 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR.md +564 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR_QUICK_REF.md +241 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_IMPLEMENTATION.md +375 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_QUICK_REFERENCE.md +362 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_README.md +307 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_USAGE_GUIDE.md +508 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/confidence-aggregator.ts +473 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/consensus.ts +1 -1
- package/.claude/skills/cfn-loop-orchestration/src/helpers/context-injector.ts +349 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/context-lookup.ts +486 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +6 -2
- package/.claude/skills/cfn-loop-orchestration/src/helpers/gate-check.ts +1 -1
- package/.claude/skills/cfn-loop-orchestration/src/helpers/product-owner-decision.ts +316 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/spawn-agents.ts +357 -0
- package/.claude/skills/cfn-loop-orchestration/src/helpers/validator.ts +276 -0
- package/.claude/skills/cfn-loop-orchestration/src/index.ts +2 -0
- package/.claude/skills/cfn-loop-orchestration/src/orchestrate.ts +743 -2
- package/.claude/skills/cfn-loop-orchestration/src/types.ts +56 -0
- package/.claude/skills/cfn-loop-orchestration/test-cli.sh +92 -0
- package/.claude/skills/cfn-loop-orchestration/test-typescript-integration.sh +442 -0
- package/.claude/skills/cfn-loop-orchestration/tests/agent-spawner.test.ts +124 -0
- package/.claude/skills/cfn-loop-orchestration/tests/confidence-aggregator.test.ts +604 -0
- package/.claude/skills/cfn-loop-orchestration/tests/context-injector.test.ts +561 -0
- package/.claude/skills/cfn-loop-orchestration/tests/context-lookup.test.ts +661 -0
- package/.claude/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +2 -2
- package/.claude/skills/cfn-loop-orchestration/tests/gate-check-edge-cases.test.ts +422 -0
- package/.claude/skills/cfn-loop-orchestration/tests/gate-checker.test.ts +276 -0
- package/.claude/skills/cfn-loop-orchestration/tests/logger.test.ts +291 -0
- package/.claude/skills/cfn-loop-orchestration/tests/north-star-e2e.test.ts +334 -0
- package/.claude/skills/cfn-loop-orchestration/tests/redis-coordinator.test.ts +321 -0
- package/.claude/skills/cfn-loop-orchestration/tests/spawn-agents.test.ts +284 -0
- package/.claude/skills/cfn-loop-orchestration/tests/validator.test.ts +643 -0
- package/.claude/skills/cfn-loop-validation/IMPLEMENTATION_SUMMARY.md +672 -0
- package/.claude/skills/cfn-loop-validation/INDEX.md +531 -0
- package/.claude/skills/cfn-loop-validation/README_TYPESCRIPT.md +454 -0
- package/.claude/skills/cfn-loop-validation/SKILL.md +48 -1
- package/.claude/skills/cfn-loop-validation/SKILL.md.backup +353 -0
- package/.claude/skills/cfn-loop-validation/SKILL_TYPESCRIPT.md +782 -0
- package/.claude/skills/cfn-loop-validation/VAPOR_DETECTION_EXAMPLES.md +598 -0
- package/.claude/skills/cfn-loop-validation/check-dependencies.sh +22 -0
- package/{claude-assets/skills/cfn-redis-coordination/check-dependencies.sh → .claude/skills/cfn-loop-validation/check-dependencies.sh.backup} +4 -5
- package/.claude/skills/cfn-loop-validation/detect-vapor.sh +59 -0
- package/.claude/skills/cfn-loop-validation/detect-vapor.sh.backup +37 -0
- package/.claude/skills/cfn-loop-validation/dist/.tsbuildinfo +1 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts +14 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.js +185 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.js.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts +14 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.js +176 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.js.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts +19 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.js +123 -0
- package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.js.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/types.d.ts +156 -0
- package/.claude/skills/cfn-loop-validation/dist/types.d.ts.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/types.js +66 -0
- package/.claude/skills/cfn-loop-validation/dist/types.js.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/validator.d.ts +85 -0
- package/.claude/skills/cfn-loop-validation/dist/validator.d.ts.map +1 -0
- package/.claude/skills/cfn-loop-validation/dist/validator.js +411 -0
- package/.claude/skills/cfn-loop-validation/dist/validator.js.map +1 -0
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +22 -0
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh.backup +252 -0
- package/.claude/skills/cfn-loop-validation/package.json +93 -0
- package/.claude/skills/cfn-loop-validation/src/cli/detect-vapor.ts +177 -0
- package/.claude/skills/cfn-loop-validation/src/cli/validate-deliverables.ts +161 -0
- package/.claude/skills/cfn-loop-validation/src/cli/validate-gate.ts +139 -0
- package/.claude/skills/cfn-loop-validation/src/types.ts +215 -0
- package/.claude/skills/cfn-loop-validation/src/validator.ts +503 -0
- package/.claude/skills/cfn-loop-validation/tests/validator.test.ts +537 -0
- package/.claude/skills/{cfn-redis-coordination → cfn-loop-validation}/tsconfig.json +34 -31
- package/.claude/skills/cfn-loop-validation/validate-deliverables.sh +59 -0
- package/.claude/skills/cfn-loop-validation/validate-deliverables.sh.backup +37 -0
- package/.claude/skills/cfn-loop-validation/validate-gate.sh +63 -0
- package/.claude/skills/cfn-loop-validation/validate-gate.sh.backup +41 -0
- package/.claude/skills/cfn-loop-validation/validate-iteration.sh +22 -0
- package/.claude/skills/cfn-loop-validation/validate-iteration.sh.backup +134 -0
- package/.claude/skills/cfn-product-owner-decision/SKILL.md +479 -147
- package/.claude/skills/cfn-product-owner-decision/TYPESCRIPT_IMPLEMENTATION.md +653 -0
- package/.claude/skills/cfn-product-owner-decision/{execute-decision.sh → archive/legacy-bash/execute-decision.sh} +24 -2
- package/.claude/skills/pre-edit-backup/SKILL.md +324 -0
- package/.claude/skills/pre-edit-backup/SKILL.md.backup +277 -0
- package/.claude/skills/pre-edit-backup/backup.sh +22 -0
- package/.claude/skills/pre-edit-backup/backup.sh.backup +107 -0
- package/claude-assets/agents/cfn-dev-team/analysts/root-cause-analyst.md +2 -2
- package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +1 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +3 -2
- package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +1 -0
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +2 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +1 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +11 -1
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +58 -35
- package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +2 -2
- package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +47 -37
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +18 -18
- package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +40 -58
- package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +19 -21
- package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +20 -29
- package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +15 -19
- package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +15 -10
- package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +16 -11
- package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +16 -26
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +18 -22
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +17 -21
- package/claude-assets/agents/cfn-dev-team/documentation/pseudocode.md +1 -1
- package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +1 -1
- package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +1 -1
- package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +1 -1
- package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +1 -5
- package/claude-assets/agents/cfn-dev-team/reviewers/code-reviewer.md +20 -51
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +22 -71
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +21 -64
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +22 -67
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +24 -68
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +8 -36
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +9 -38
- package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +17 -55
- package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +1 -1
- package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +18 -56
- package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +9 -37
- package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +18 -56
- package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +18 -49
- package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +8 -37
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +7 -27
- package/claude-assets/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +1 -1
- package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +11 -0
- package/claude-assets/agents/cfn-dev-team/utility/analyst.md +13 -29
- package/claude-assets/agents/cfn-dev-team/utility/claude-code-expert.md +1 -1
- package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +13 -13
- package/claude-assets/agents/cfn-dev-team/utility/context-curator.md +7 -2
- package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +6 -11
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +121 -715
- package/claude-assets/agents/cfn-dev-team/utility/researcher.md +13 -22
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +147 -573
- package/claude-assets/agents/custom/cfn-docker-expert.md +103 -0
- package/claude-assets/agents/custom/cfn-loops-cli-expert.md +438 -0
- package/claude-assets/agents/custom/cfn-redis-operations.md +529 -529
- package/claude-assets/agents/custom/cfn-system-expert.md +1 -1
- package/claude-assets/agents/custom/trigger-dev-expert.md +369 -0
- package/claude-assets/agents/docker-team/micro-sprint-planner.md +747 -747
- package/claude-assets/agents/project-only-agents/npm-package-specialist.md +1 -1
- package/claude-assets/cfn-extras/agents/cfn-v3-coordinator.md +517 -0
- package/claude-assets/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +1 -1
- package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +1 -1
- package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +1 -1
- package/claude-assets/cfn-extras/skills/google-sheets-progress/SKILL.md +1 -1
- package/claude-assets/commands/CFN_LOOP_FRONTEND.md +1 -1
- package/claude-assets/commands/cfn-loop-cli.md +214 -442
- package/claude-assets/commands/cfn-loop-frontend.md +1 -1
- package/claude-assets/commands/cfn-loop-task.md +2 -2
- package/claude-assets/commands/cfn-loop-trigger.md +114 -0
- package/claude-assets/commands/deprecated/cfn-loop.md +2 -2
- package/claude-assets/hooks/GIT-HOOKS-USAGE-EXAMPLES.md +116 -0
- package/claude-assets/hooks/README-GIT-HOOKS.md +443 -0
- package/claude-assets/hooks/SKILL.md +518 -0
- package/claude-assets/hooks/SKILL.md.backup +471 -0
- package/claude-assets/hooks/cfn-invoke-post-edit-ts.sh +100 -0
- package/claude-assets/hooks/cfn-invoke-post-edit-ts.sh.backup +78 -0
- package/claude-assets/hooks/cfn-invoke-post-edit.sh +53 -5
- package/claude-assets/hooks/cfn-invoke-post-edit.sh.backup +87 -0
- package/claude-assets/hooks/cfn-invoke-pre-edit-ts.sh +116 -0
- package/claude-assets/hooks/cfn-invoke-pre-edit-ts.sh.backup +94 -0
- package/claude-assets/hooks/cfn-invoke-pre-edit.sh +22 -0
- package/claude-assets/hooks/cfn-invoke-pre-edit.sh.backup +88 -0
- package/claude-assets/hooks/cfn-post-edit.config.json +9 -2
- package/claude-assets/hooks/install-git-hooks.sh +243 -0
- package/claude-assets/hooks/subagent-start.sh +98 -0
- package/claude-assets/hooks/subagent-stop.sh +93 -0
- package/claude-assets/hooks/validators/credential-scanner.sh +172 -0
- package/claude-assets/root-claude-distribute/CFN-CLAUDE.md +1 -1
- package/claude-assets/skills/cfn-agent-selection-with-fallback/DELIVERABLES.md +409 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/IMPLEMENTATION_SUMMARY.md +396 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_GUIDE.md +308 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/QUICK_REFERENCE.md +239 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +107 -1
- package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md.backup +302 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/TYPESCRIPT_MIGRATION.md +295 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/agent-selector.cjs +297 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/agent-selector.js +297 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/cli.cjs +96 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/cli.js +96 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents-ts.sh +45 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents-ts.sh.backup +23 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +22 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh.backup +173 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/src/agent-selector.test.ts +357 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/src/agent-selector.ts +350 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/src/cli.ts +74 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +22 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh.backup +71 -0
- package/claude-assets/skills/cfn-agent-selection-with-fallback/tsconfig.json +18 -0
- package/claude-assets/skills/cfn-agent-spawning/SKILL.md +48 -1
- package/claude-assets/skills/cfn-agent-spawning/SKILL.md.backup +135 -0
- package/claude-assets/skills/cfn-agent-spawning/TYPESCRIPT_MIGRATION.md +567 -0
- package/claude-assets/skills/cfn-agent-spawning/check-dependencies.sh +22 -0
- package/claude-assets/skills/cfn-agent-spawning/check-dependencies.sh.backup +30 -0
- package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -0
- package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh.backup +127 -0
- package/claude-assets/skills/cfn-agent-spawning/parse-agent-provider.sh +22 -0
- package/claude-assets/skills/cfn-agent-spawning/parse-agent-provider.sh.backup +59 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent-wrapper.sh +63 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent-wrapper.sh.backup +41 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh +26 -1
- package/claude-assets/skills/cfn-agent-spawning/spawn-templates.sh +22 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-templates.sh.backup +613 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-worker.sh +22 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-worker.sh.backup +176 -0
- package/claude-assets/skills/cfn-backlog-management/SKILL.md +1 -1
- package/claude-assets/skills/cfn-coordination/agent-completion.sh.backup +36 -0
- package/claude-assets/skills/cfn-coordination/coordination-signal.sh.backup +36 -0
- package/claude-assets/skills/cfn-coordination/coordination-wait.sh.backup +36 -0
- package/claude-assets/skills/cfn-dependency-ingestion/README.md +101 -0
- package/claude-assets/skills/cfn-dependency-ingestion/SKILL.md +397 -0
- package/claude-assets/skills/cfn-dependency-ingestion/build.sh +23 -0
- package/claude-assets/skills/cfn-dependency-ingestion/dist/ingest-dependencies.js +478 -0
- package/claude-assets/skills/cfn-dependency-ingestion/ingest-dependencies.sh +295 -0
- package/claude-assets/skills/cfn-dependency-ingestion/ingest.sh +237 -0
- package/claude-assets/skills/cfn-dependency-ingestion/manifests/cli-mode-dependencies.txt +73 -0
- package/claude-assets/skills/cfn-dependency-ingestion/manifests/shared-dependencies.txt +57 -0
- package/claude-assets/skills/cfn-dependency-ingestion/manifests/trigger-dev-dependencies.txt +82 -0
- package/claude-assets/skills/cfn-dependency-ingestion/manifests/trigger-mode-dependencies.txt +80 -0
- package/claude-assets/skills/cfn-dependency-ingestion/src/ingest-dependencies.ts +563 -0
- package/claude-assets/skills/cfn-environment-sanitization/sanitize-environment.sh +14 -4
- package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/metadata.json +8 -0
- package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/original +271 -0
- package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/revert.sh +7 -0
- package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/metadata.json +8 -0
- package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/original +325 -0
- package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/revert.sh +7 -0
- package/claude-assets/skills/cfn-loop-orchestration/CLI_IMPLEMENTATION_SUMMARY.md +330 -0
- package/claude-assets/skills/cfn-loop-orchestration/CONFIGURATION_IMPROVEMENTS.md +318 -0
- package/claude-assets/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_MIGRATION.md +308 -0
- package/claude-assets/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_QUICK_START.md +378 -0
- package/claude-assets/skills/cfn-loop-orchestration/E2E_VALIDATION_REPORT.md +262 -0
- package/claude-assets/skills/cfn-loop-orchestration/IMPLEMENTATION_SUMMARY.md +319 -519
- package/claude-assets/skills/cfn-loop-orchestration/NORTH_STAR_E2E_REPORT.md +299 -0
- package/claude-assets/skills/cfn-loop-orchestration/NORTH_STAR_EXECUTION_SUMMARY.md +403 -0
- package/claude-assets/skills/cfn-loop-orchestration/NORTH_STAR_INDEX.md +323 -0
- package/claude-assets/skills/cfn-loop-orchestration/SKILL.md +159 -48
- package/claude-assets/skills/cfn-loop-orchestration/SPAWN_AGENTS_IMPLEMENTATION.md +188 -0
- package/claude-assets/skills/cfn-loop-orchestration/TEST_COVERAGE_REPORT.md +335 -0
- package/claude-assets/skills/cfn-loop-orchestration/TEST_COVERAGE_SUMMARY.md +456 -0
- package/claude-assets/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_REPORT.md +709 -0
- package/claude-assets/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_SUMMARY.md +257 -0
- package/claude-assets/skills/cfn-loop-orchestration/VALIDATION_REPORT.md +572 -0
- package/claude-assets/skills/cfn-loop-orchestration/VALIDATION_SUMMARY.txt +196 -0
- package/claude-assets/skills/cfn-loop-orchestration/VALIDATOR_MODULE_GUIDE.md +526 -0
- package/claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash/README.md +167 -0
- package/claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate-enhanced.sh +548 -0
- package/claude-assets/skills/cfn-loop-orchestration/{orchestrate-wrapper.sh → archive/legacy-bash/orchestrate-wrapper.sh} +11 -1
- package/claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate.sh +182 -0
- package/claude-assets/skills/cfn-loop-orchestration/e2e-validation-fixed.js +240 -0
- package/claude-assets/skills/cfn-loop-orchestration/e2e-validation.js +213 -0
- package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +3 -0
- package/claude-assets/skills/cfn-loop-orchestration/package.json +4 -0
- package/claude-assets/skills/cfn-loop-orchestration/run-north-star-e2e.ts +210 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/cli/orchestrator-cli.ts +396 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR.md +564 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR_QUICK_REF.md +241 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_IMPLEMENTATION.md +375 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_QUICK_REFERENCE.md +362 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_README.md +307 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_USAGE_GUIDE.md +508 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/confidence-aggregator.ts +473 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/consensus.ts +1 -1
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/context-injector.ts +349 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/context-lookup.ts +486 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +6 -2
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/gate-check.ts +1 -1
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/product-owner-decision.ts +316 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/spawn-agents.ts +357 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/helpers/validator.ts +276 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +2 -0
- package/claude-assets/skills/cfn-loop-orchestration/src/orchestrate.ts +743 -2
- package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +56 -0
- package/claude-assets/skills/cfn-loop-orchestration/test-cli.sh +92 -0
- package/claude-assets/skills/cfn-loop-orchestration/test-typescript-integration.sh +442 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/agent-spawner.test.ts +124 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/confidence-aggregator.test.ts +604 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/context-injector.test.ts +561 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/context-lookup.test.ts +661 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +2 -2
- package/claude-assets/skills/cfn-loop-orchestration/tests/gate-check-edge-cases.test.ts +422 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/gate-checker.test.ts +276 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/logger.test.ts +291 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/north-star-e2e.test.ts +334 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/redis-coordinator.test.ts +321 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/spawn-agents.test.ts +284 -0
- package/claude-assets/skills/cfn-loop-orchestration/tests/validator.test.ts +643 -0
- package/claude-assets/skills/cfn-loop-output-processing/.eslintrc.json +33 -0
- package/claude-assets/skills/cfn-loop-output-processing/DELIVERY_SUMMARY.txt +462 -0
- package/claude-assets/skills/cfn-loop-output-processing/DEPRECATION_NOTICE.md +183 -0
- package/claude-assets/skills/cfn-loop-output-processing/EXAMPLES.md +609 -0
- package/claude-assets/skills/cfn-loop-output-processing/IMPLEMENTATION_SUMMARY.md +418 -0
- package/claude-assets/skills/cfn-loop-output-processing/INDEX.md +531 -0
- package/claude-assets/skills/cfn-loop-output-processing/MIGRATION.md +362 -0
- package/claude-assets/skills/cfn-loop-output-processing/README.md +114 -0
- package/claude-assets/skills/cfn-loop-output-processing/SKILL.md +633 -0
- package/{.claude/skills/cfn-docker-redis-coordination → claude-assets/skills/cfn-loop-output-processing}/jest.config.js +7 -15
- package/claude-assets/skills/cfn-loop-output-processing/package.json +50 -0
- package/claude-assets/skills/cfn-loop-output-processing/src/cli/process-loop2.ts +195 -0
- package/claude-assets/skills/cfn-loop-output-processing/src/cli/process-loop3.ts +157 -0
- package/claude-assets/skills/cfn-loop-output-processing/src/output-processor.ts +632 -0
- package/claude-assets/skills/cfn-loop-output-processing/tests/output-processor.test.ts +617 -0
- package/claude-assets/skills/{cfn-docker-redis-coordination → cfn-loop-output-processing}/tsconfig.json +16 -7
- package/claude-assets/skills/cfn-loop-validation/IMPLEMENTATION_SUMMARY.md +672 -0
- package/claude-assets/skills/cfn-loop-validation/INDEX.md +531 -0
- package/claude-assets/skills/cfn-loop-validation/README_TYPESCRIPT.md +454 -0
- package/claude-assets/skills/cfn-loop-validation/SKILL.md +48 -1
- package/claude-assets/skills/cfn-loop-validation/SKILL.md.backup +353 -0
- package/claude-assets/skills/cfn-loop-validation/SKILL_TYPESCRIPT.md +782 -0
- package/claude-assets/skills/cfn-loop-validation/VAPOR_DETECTION_EXAMPLES.md +598 -0
- package/claude-assets/skills/cfn-loop-validation/check-dependencies.sh +22 -0
- package/claude-assets/skills/cfn-loop-validation/check-dependencies.sh.backup +31 -0
- package/claude-assets/skills/cfn-loop-validation/detect-vapor.sh +59 -0
- package/claude-assets/skills/cfn-loop-validation/detect-vapor.sh.backup +37 -0
- package/claude-assets/skills/cfn-loop-validation/dist/.tsbuildinfo +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts +14 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.js +185 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.js.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts +14 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.js +176 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.js.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts +19 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.js +123 -0
- package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.js.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/types.d.ts +156 -0
- package/claude-assets/skills/cfn-loop-validation/dist/types.d.ts.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/types.js +66 -0
- package/claude-assets/skills/cfn-loop-validation/dist/types.js.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/validator.d.ts +85 -0
- package/claude-assets/skills/cfn-loop-validation/dist/validator.d.ts.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/dist/validator.js +411 -0
- package/claude-assets/skills/cfn-loop-validation/dist/validator.js.map +1 -0
- package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +22 -0
- package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh.backup +252 -0
- package/claude-assets/skills/cfn-loop-validation/package.json +93 -0
- package/claude-assets/skills/cfn-loop-validation/src/cli/detect-vapor.ts +177 -0
- package/claude-assets/skills/cfn-loop-validation/src/cli/validate-deliverables.ts +161 -0
- package/claude-assets/skills/cfn-loop-validation/src/cli/validate-gate.ts +139 -0
- package/claude-assets/skills/cfn-loop-validation/src/types.ts +215 -0
- package/claude-assets/skills/cfn-loop-validation/src/validator.ts +503 -0
- package/claude-assets/skills/cfn-loop-validation/tests/validator.test.ts +537 -0
- package/claude-assets/skills/{cfn-redis-coordination → cfn-loop-validation}/tsconfig.json +34 -31
- package/claude-assets/skills/cfn-loop-validation/validate-deliverables.sh +59 -0
- package/claude-assets/skills/cfn-loop-validation/validate-deliverables.sh.backup +37 -0
- package/claude-assets/skills/cfn-loop-validation/validate-gate.sh +63 -0
- package/claude-assets/skills/cfn-loop-validation/validate-gate.sh.backup +41 -0
- package/claude-assets/skills/cfn-loop-validation/validate-iteration.sh +22 -0
- package/claude-assets/skills/cfn-loop-validation/validate-iteration.sh.backup +134 -0
- package/claude-assets/skills/cfn-product-owner-decision/SKILL.md +479 -147
- package/claude-assets/skills/cfn-product-owner-decision/TYPESCRIPT_IMPLEMENTATION.md +653 -0
- package/claude-assets/skills/cfn-product-owner-decision/{execute-decision.sh → archive/legacy-bash/execute-decision.sh} +24 -2
- package/claude-assets/skills/cfn-provider-routing/README.md +129 -0
- package/claude-assets/skills/cfn-provider-routing/SKILL.md +215 -0
- package/claude-assets/skills/cfn-provider-routing/resolve-provider-model.ts +223 -0
- package/claude-assets/skills/docker-build/build.sh +1 -1
- package/claude-assets/skills/pre-edit-backup/SKILL.md +324 -0
- package/claude-assets/skills/pre-edit-backup/SKILL.md.backup +277 -0
- package/claude-assets/skills/pre-edit-backup/backup.sh +22 -0
- package/claude-assets/skills/pre-edit-backup/backup.sh.backup +107 -0
- package/dist/agent/skill-mcp-selector.js +2 -1
- package/dist/agent/skill-mcp-selector.js.map +1 -1
- package/dist/api/auth-endpoints.js +415 -0
- package/dist/api/auth-endpoints.js.map +1 -0
- package/dist/api/task-endpoints.js +562 -0
- package/dist/api/task-endpoints.js.map +1 -0
- package/dist/backend/server.js +418 -0
- package/dist/backend/server.js.map +1 -0
- package/dist/cfn-loop/product-owner/decision-parser.js +356 -0
- package/dist/cfn-loop/product-owner/decision-parser.js.map +1 -0
- package/dist/cfn-loop/product-owner/index.js +1 -0
- package/dist/cfn-loop/product-owner/index.js.map +1 -1
- package/dist/cli/agent-command.js +1 -1
- package/dist/cli/agent-command.js.map +1 -1
- package/dist/cli/agent-completion.js +273 -0
- package/dist/cli/agent-completion.js.map +1 -0
- package/dist/cli/agent-executor.js +470 -26
- package/dist/cli/agent-executor.js.map +1 -1
- package/dist/cli/agent-prompt-builder.js +83 -48
- package/dist/cli/agent-prompt-builder.js.map +1 -1
- package/dist/cli/agent-spawn.js +7 -4
- package/dist/cli/agent-spawn.js.map +1 -1
- package/dist/cli/agent-spawner.js +546 -0
- package/dist/cli/agent-spawner.js.map +1 -0
- package/dist/cli/agent-token-manager.js +2 -1
- package/dist/cli/agent-token-manager.js.map +1 -1
- package/dist/cli/anthropic-client.js +127 -14
- package/dist/cli/anthropic-client.js.map +1 -1
- package/dist/cli/cfn-context.js +2 -1
- package/dist/cli/cfn-context.js.map +1 -1
- package/dist/cli/cfn-metrics.js +2 -1
- package/dist/cli/cfn-metrics.js.map +1 -1
- package/dist/cli/cfn-redis.js +2 -1
- package/dist/cli/cfn-redis.js.map +1 -1
- package/dist/cli/cli-agent-context.js +2 -0
- package/dist/cli/cli-agent-context.js.map +1 -1
- package/dist/cli/config-manager.js +90 -356
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/conversation-fork-cleanup.js +2 -1
- package/dist/cli/conversation-fork-cleanup.js.map +1 -1
- package/dist/cli/conversation-fork.js +2 -1
- package/dist/cli/conversation-fork.js.map +1 -1
- package/dist/cli/coordination/agent-messaging.js +415 -0
- package/dist/cli/coordination/agent-messaging.js.map +1 -0
- package/dist/cli/coordination/wait-for-threshold.js +232 -0
- package/dist/cli/coordination/wait-for-threshold.js.map +1 -0
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/iteration-history.js +2 -1
- package/dist/cli/iteration-history.js.map +1 -1
- package/dist/cli/parse-decision-cli.js +268 -0
- package/dist/cli/parse-decision-cli.js.map +1 -0
- package/dist/cli/post-edit-hook.js +83 -0
- package/dist/cli/post-edit-hook.js.map +1 -0
- package/dist/cli/pre-edit-hook.js +77 -0
- package/dist/cli/pre-edit-hook.js.map +1 -0
- package/dist/cli/process-lifecycle.js +5 -1
- package/dist/cli/process-lifecycle.js.map +1 -1
- package/dist/cli/spawn-agent-cli.js +244 -0
- package/dist/cli/spawn-agent-cli.js.map +1 -0
- package/dist/coordination/coordination-wrapper.js +383 -0
- package/dist/coordination/coordination-wrapper.js.map +1 -0
- package/dist/coordination/redis-waiting-mode.js +4 -0
- package/dist/coordination/redis-waiting-mode.js.map +1 -1
- package/dist/coordination/store-success-criteria.js +68 -0
- package/dist/coordination/store-success-criteria.js.map +1 -0
- package/dist/coordination/store-task-context.js +65 -0
- package/dist/coordination/store-task-context.js.map +1 -0
- package/dist/hooks/backup-manager.js +273 -0
- package/dist/hooks/backup-manager.js.map +1 -0
- package/dist/hooks/post-edit-validator.js +388 -0
- package/dist/hooks/post-edit-validator.js.map +1 -0
- package/dist/integration/index.js +19 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/integration/task-mode-adapter.js +297 -0
- package/dist/integration/task-mode-adapter.js.map +1 -0
- package/dist/integration/trigger-dev-client.js +253 -0
- package/dist/integration/trigger-dev-client.js.map +1 -0
- package/dist/integration/trigger-dev-webhooks.js +362 -0
- package/dist/integration/trigger-dev-webhooks.js.map +1 -0
- package/dist/lib/artifact-registry.js +4 -0
- package/dist/lib/artifact-registry.js.map +1 -1
- package/dist/lib/connection-pool.js +390 -0
- package/dist/lib/connection-pool.js.map +1 -0
- package/dist/lib/environment-contract.js +258 -0
- package/dist/lib/environment-contract.js.map +1 -0
- package/dist/lib/path-validator.js +14 -5
- package/dist/lib/path-validator.js.map +1 -1
- package/dist/lib/query-optimizer.js +388 -0
- package/dist/lib/query-optimizer.js.map +1 -0
- package/dist/lib/redis-queue-manager.js +5 -1
- package/dist/lib/redis-queue-manager.js.map +1 -1
- package/dist/lib/result-cache.js +285 -0
- package/dist/lib/result-cache.js.map +1 -0
- package/dist/mcp/auth-middleware.js +2 -1
- package/dist/mcp/auth-middleware.js.map +1 -1
- package/dist/mcp/playwright-mcp-server-auth.js +2 -1
- package/dist/mcp/playwright-mcp-server-auth.js.map +1 -1
- package/dist/middleware/authentication.js +317 -0
- package/dist/middleware/authentication.js.map +1 -0
- package/dist/services/authentication.js +669 -0
- package/dist/services/authentication.js.map +1 -0
- package/dist/services/session-management.js +436 -0
- package/dist/services/session-management.js.map +1 -0
- package/dist/services/skill-deployment.js +8 -6
- package/dist/services/skill-deployment.js.map +1 -1
- package/dist/services/user-service.js +710 -0
- package/dist/services/user-service.js.map +1 -0
- package/dist/types/trigger-dev-events.d.js +10 -0
- package/dist/types/trigger-dev-events.d.js.map +1 -0
- package/docs/README.md +240 -0
- package/package.json +15 -4
- package/scripts/build-agent-image.sh +1 -1
- package/scripts/compare-workflow-performance.sh +556 -0
- package/scripts/cost-allocation-tracker.sh +632 -0
- package/scripts/docker-rebuild-all-agents.sh +2 -2
- package/scripts/migrate-to-optimized-workflows.sh +438 -0
- package/scripts/organize-docs.sh +338 -0
- package/scripts/reorganize-tests.sh +280 -0
- package/scripts/trigger-dev-setup.sh +279 -0
- package/tests/README.md +45 -0
- package/.claude/commands/cost-savings-status.md +0 -34
- package/.claude/commands/metrics-summary.md +0 -58
- package/.claude/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +0 -348
- package/.claude/skills/cfn-docker-redis-coordination/README.md +0 -294
- package/.claude/skills/cfn-docker-redis-coordination/SKILL.md +0 -435
- package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh +0 -650
- package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh.backup-1763145142 +0 -641
- package/.claude/skills/cfn-docker-redis-coordination/package-lock.json +0 -5259
- package/.claude/skills/cfn-docker-redis-coordination/package.json +0 -40
- package/.claude/skills/cfn-docker-redis-coordination/src/coordinator.ts +0 -801
- package/.claude/skills/cfn-docker-redis-coordination/src/index.ts +0 -42
- package/.claude/skills/cfn-docker-redis-coordination/src/types.ts +0 -351
- package/.claude/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +0 -1464
- package/.claude/skills/cfn-docker-redis-coordination/tsconfig.json +0 -30
- package/.claude/skills/cfn-loop-orchestration/helpers/auto-tune-timeouts.sh +0 -228
- package/.claude/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +0 -104
- package/.claude/skills/cfn-loop-orchestration/helpers/consensus.sh +0 -94
- package/.claude/skills/cfn-loop-orchestration/helpers/context-injection.sh +0 -142
- package/.claude/skills/cfn-loop-orchestration/helpers/context-lookup.sh +0 -359
- package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +0 -123
- package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier.sh +0 -71
- package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +0 -56
- package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +0 -89
- package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager.sh +0 -87
- package/.claude/skills/cfn-loop-orchestration/helpers/orchestrate-ts.sh +0 -104
- package/.claude/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +0 -56
- package/.claude/skills/cfn-loop-orchestration/helpers/spawn-agents.sh +0 -290
- package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +0 -47
- package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator.sh +0 -51
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +0 -1345
- package/.claude/skills/cfn-redis-coordination/AGENT_LOGGING.md +0 -280
- package/.claude/skills/cfn-redis-coordination/BZPOPMIN_FIX_SUMMARY.md +0 -209
- package/.claude/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +0 -319
- package/.claude/skills/cfn-redis-coordination/agent-log.sh.bak +0 -124
- package/.claude/skills/cfn-redis-coordination/config.json +0 -61
- package/.claude/skills/cfn-redis-coordination/demos/phase4-wake-queue-test-report.md +0 -82
- package/.claude/skills/cfn-redis-coordination/demos/test-bzpopmin-fix.sh +0 -274
- package/.claude/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -0
- package/.claude/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +0 -553
- package/.claude/skills/cfn-redis-coordination/jest.config.js +0 -23
- package/.claude/skills/cfn-redis-coordination/package-lock.json +0 -5272
- package/.claude/skills/cfn-redis-coordination/package.json +0 -45
- package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +0 -446
- package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +0 -454
- package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +0 -396
- package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +0 -327
- package/.claude/skills/cfn-redis-coordination/src/index.ts +0 -82
- package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +0 -155
- package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +0 -305
- package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +0 -283
- package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +0 -654
- package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +0 -437
- package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +0 -494
- package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +0 -404
- package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +0 -423
- package/.claude/skills/cfn-redis-coordination/src/types.ts +0 -235
- package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +0 -587
- package/.claude/skills/cfn-redis-coordination/store-success-criteria.sh +0 -85
- package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +0 -70
- package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +0 -121
- package/.claude/skills/cfn-redis-coordination/test-redis-check.js +0 -84
- package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +0 -391
- package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +0 -788
- package/.claude/skills/cfn-redis-coordination/update-all-scripts.sh +0 -67
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +0 -980
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +0 -759
- package/claude-assets/agents/custom/test-mcp-access.md +0 -24
- package/claude-assets/agents/typescript-specialist.md +0 -280
- package/claude-assets/commands/cost-savings-status.md +0 -34
- package/claude-assets/commands/metrics-summary.md +0 -58
- package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +0 -348
- package/claude-assets/skills/cfn-docker-redis-coordination/README.md +0 -294
- package/claude-assets/skills/cfn-docker-redis-coordination/SKILL.md +0 -435
- package/claude-assets/skills/cfn-docker-redis-coordination/coordinate.sh +0 -650
- package/claude-assets/skills/cfn-docker-redis-coordination/coordinate.sh.backup-1763145142 +0 -641
- package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +0 -37
- package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +0 -5259
- package/claude-assets/skills/cfn-docker-redis-coordination/package.json +0 -40
- package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +0 -801
- package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +0 -42
- package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +0 -351
- package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +0 -1464
- package/claude-assets/skills/cfn-loop-orchestration/helpers/auto-tune-timeouts.sh +0 -228
- package/claude-assets/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +0 -104
- package/claude-assets/skills/cfn-loop-orchestration/helpers/consensus.sh +0 -94
- package/claude-assets/skills/cfn-loop-orchestration/helpers/context-injection.sh +0 -142
- package/claude-assets/skills/cfn-loop-orchestration/helpers/context-lookup.sh +0 -359
- package/claude-assets/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +0 -123
- package/claude-assets/skills/cfn-loop-orchestration/helpers/deliverable-verifier.sh +0 -71
- package/claude-assets/skills/cfn-loop-orchestration/helpers/gate-check.sh +0 -56
- package/claude-assets/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +0 -89
- package/claude-assets/skills/cfn-loop-orchestration/helpers/iteration-manager.sh +0 -87
- package/claude-assets/skills/cfn-loop-orchestration/helpers/orchestrate-ts.sh +0 -104
- package/claude-assets/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +0 -56
- package/claude-assets/skills/cfn-loop-orchestration/helpers/spawn-agents.sh +0 -290
- package/claude-assets/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +0 -47
- package/claude-assets/skills/cfn-loop-orchestration/helpers/timeout-calculator.sh +0 -51
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +0 -1345
- package/claude-assets/skills/cfn-redis-cleanup/cleanup-redis.sh +0 -130
- package/claude-assets/skills/cfn-redis-coordination/AGENT_LOGGING.md +0 -280
- package/claude-assets/skills/cfn-redis-coordination/BZPOPMIN_FIX_SUMMARY.md +0 -209
- package/claude-assets/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +0 -319
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh.bak +0 -124
- package/claude-assets/skills/cfn-redis-coordination/config.json +0 -61
- package/claude-assets/skills/cfn-redis-coordination/demos/phase4-wake-queue-test-report.md +0 -82
- package/claude-assets/skills/cfn-redis-coordination/demos/test-bzpopmin-fix.sh +0 -274
- package/claude-assets/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -0
- package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +0 -553
- package/claude-assets/skills/cfn-redis-coordination/jest.config.js +0 -23
- package/claude-assets/skills/cfn-redis-coordination/package-lock.json +0 -5272
- package/claude-assets/skills/cfn-redis-coordination/package.json +0 -45
- package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +0 -446
- package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +0 -454
- package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +0 -396
- package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +0 -327
- package/claude-assets/skills/cfn-redis-coordination/src/index.ts +0 -82
- package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +0 -155
- package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +0 -305
- package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +0 -283
- package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +0 -654
- package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +0 -437
- package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +0 -494
- package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +0 -404
- package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +0 -423
- package/claude-assets/skills/cfn-redis-coordination/src/types.ts +0 -235
- package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +0 -587
- package/claude-assets/skills/cfn-redis-coordination/store-success-criteria.sh +0 -85
- package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +0 -70
- package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +0 -121
- package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +0 -84
- package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +0 -391
- package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +0 -788
- package/claude-assets/skills/cfn-redis-coordination/update-all-scripts.sh +0 -67
- package/claude-assets/skills/cfn-redis-data-extraction/SKILL.md +0 -442
- package/claude-assets/skills/cfn-redis-data-extraction/extract.sh +0 -306
- package/dist/coordination/index.js +0 -25
- package/dist/coordination/index.js.map +0 -1
- package/docs/BUG_19_MEMORY_LEAK_TASK_MODE.md +0 -405
- package/docs/MEMORY_CLEANUP_GUIDE.md +0 -358
- package/docs/MEMORY_LEAK_FIX_SUMMARY.md +0 -322
- package/docs/REDIS_CLEANUP_EXECUTIVE_SUMMARY.md +0 -319
- package/docs/REDIS_CLEANUP_VERIFICATION_REPORT.md +0 -574
- package/tests/test-memory-leak-task-mode.sh +0 -435
- /package/.claude/skills/cfn-loop-orchestration/{inject-loop-context.sh → archive/legacy-bash/inject-loop-context.sh} +0 -0
- /package/.claude/skills/cfn-loop-orchestration/{monitor-execution.sh → archive/legacy-bash/monitor-execution.sh} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{agent-log.sh → agent-log.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{agent-recovery.sh → agent-recovery.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{analyze-task-complexity.sh → analyze-task-complexity.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/bash-wrappers/{store-context.sh → store-context.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{cancel-swarm.sh → cancel-swarm.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{cfn-loop-exec.sh → cfn-loop-exec.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{cfn-loop-relaunch.sh → cfn-loop-relaunch.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{collect-confidence-scores.sh → collect-confidence-scores.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{collect-results.sh → collect-results.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{complete-swarm.sh → complete-swarm.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{get-context.sh → get-context.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{get-success-criteria.sh → get-success-criteria.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{invoke-waiting-mode.sh → invoke-waiting-mode.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{redis-cli-wrapper.sh → redis-cli-wrapper.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{redis-functions.sh → redis-functions.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{report-completion.sh → report-completion.sh.backup} +0 -0
- /package/.claude/skills/cfn-redis-coordination/{store-context.sh → store-context.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-loop-orchestration/{inject-loop-context.sh → archive/legacy-bash/inject-loop-context.sh} +0 -0
- /package/claude-assets/skills/cfn-loop-orchestration/{monitor-execution.sh → archive/legacy-bash/monitor-execution.sh} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{agent-log.sh → agent-log.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{agent-recovery.sh → agent-recovery.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{analyze-task-complexity.sh → analyze-task-complexity.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/{store-context.sh → store-context.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{cancel-swarm.sh → cancel-swarm.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{cfn-loop-exec.sh → cfn-loop-exec.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{cfn-loop-relaunch.sh → cfn-loop-relaunch.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{collect-confidence-scores.sh → collect-confidence-scores.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{collect-results.sh → collect-results.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{complete-swarm.sh → complete-swarm.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{get-context.sh → get-context.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{get-success-criteria.sh → get-success-criteria.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{invoke-waiting-mode.sh → invoke-waiting-mode.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{redis-cli-wrapper.sh → redis-cli-wrapper.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{redis-functions.sh → redis-functions.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{report-completion.sh → report-completion.sh.backup} +0 -0
- /package/claude-assets/skills/cfn-redis-coordination/{store-context.sh → store-context.sh.backup} +0 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product Owner Decision Parser
|
|
3
|
+
* Parses Product Owner agent output to extract decision, reasoning, and validation
|
|
4
|
+
*
|
|
5
|
+
* Prevents "consensus on vapor" (claiming completion without deliverables)
|
|
6
|
+
* Handles multiple output formats with robust fallback patterns
|
|
7
|
+
*/ import { promises as fs } from 'fs';
|
|
8
|
+
import { execSync } from 'child_process';
|
|
9
|
+
/**
|
|
10
|
+
* Decision Parser Error
|
|
11
|
+
*/ export class DecisionParserError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
details;
|
|
14
|
+
constructor(message, code, details){
|
|
15
|
+
super(message), this.code = code, this.details = details;
|
|
16
|
+
this.name = 'DecisionParserError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Parse Product Owner output and extract decision
|
|
21
|
+
*/ export class DecisionParser {
|
|
22
|
+
strict;
|
|
23
|
+
validateDeliverables;
|
|
24
|
+
taskContext;
|
|
25
|
+
taskId;
|
|
26
|
+
constructor(options = {}){
|
|
27
|
+
this.strict = options.strict ?? true;
|
|
28
|
+
this.validateDeliverables = options.validateDeliverables ?? true;
|
|
29
|
+
this.taskContext = options.taskContext;
|
|
30
|
+
this.taskId = options.taskId;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parse decision from text output
|
|
34
|
+
*/ parse(output) {
|
|
35
|
+
if (!output || typeof output !== 'string') {
|
|
36
|
+
throw new DecisionParserError('Invalid output: must be non-empty string', 'INVALID_OUTPUT');
|
|
37
|
+
}
|
|
38
|
+
const decision = this.extractDecision(output);
|
|
39
|
+
const reasoning = this.extractReasoning(output);
|
|
40
|
+
const confidence = this.extractConfidence(output);
|
|
41
|
+
const deliverables = this.extractDeliverables(output);
|
|
42
|
+
const auditAnalysis = this.extractAuditAnalysis(output);
|
|
43
|
+
const agentPerformanceObservations = this.extractAgentPerformance(output);
|
|
44
|
+
// Validate decision
|
|
45
|
+
const validationErrors = this.validateDecision(decision, reasoning, deliverables, confidence);
|
|
46
|
+
// Prevent "consensus on vapor"
|
|
47
|
+
if (decision === 'PROCEED' && this.validateDeliverables) {
|
|
48
|
+
const vapourCheck = this.checkConsensusOnVapor(output, deliverables);
|
|
49
|
+
if (vapourCheck.isVapor) {
|
|
50
|
+
validationErrors.push(...vapourCheck.errors);
|
|
51
|
+
if (this.strict) {
|
|
52
|
+
return {
|
|
53
|
+
decision: 'ITERATE',
|
|
54
|
+
reasoning: `Override PROCEED → ITERATE: ${vapourCheck.errors.join('; ')}`,
|
|
55
|
+
deliverables: [],
|
|
56
|
+
confidence: Math.min(confidence, 0.7),
|
|
57
|
+
validationErrors: vapourCheck.errors,
|
|
58
|
+
raw: {
|
|
59
|
+
fullOutput: output,
|
|
60
|
+
decisionLine: this.findDecisionLine(output)
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
decision,
|
|
68
|
+
reasoning: reasoning || 'No reasoning provided',
|
|
69
|
+
deliverables,
|
|
70
|
+
confidence,
|
|
71
|
+
validationErrors,
|
|
72
|
+
auditAnalysis,
|
|
73
|
+
agentPerformanceObservations,
|
|
74
|
+
raw: {
|
|
75
|
+
fullOutput: output,
|
|
76
|
+
decisionLine: this.findDecisionLine(output)
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parse decision from file
|
|
82
|
+
*/ async parseFile(filePath) {
|
|
83
|
+
try {
|
|
84
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
85
|
+
return this.parse(content);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
throw new DecisionParserError(`Failed to read decision file: ${filePath}`, 'FILE_READ_ERROR', {
|
|
88
|
+
originalError: String(error)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Extract decision keyword (PROCEED, ITERATE, ABORT)
|
|
94
|
+
* Multiple fallback patterns for robustness
|
|
95
|
+
*/ extractDecision(output) {
|
|
96
|
+
// Pattern 1: Explicit "Decision: PROCEED"
|
|
97
|
+
let match = output.match(/Decision:\s*(PROCEED|ITERATE|ABORT)/i);
|
|
98
|
+
if (match) {
|
|
99
|
+
return match[1].toUpperCase();
|
|
100
|
+
}
|
|
101
|
+
// Pattern 2: Standalone keyword at start of line
|
|
102
|
+
match = output.match(/^(PROCEED|ITERATE|ABORT)/im);
|
|
103
|
+
if (match) {
|
|
104
|
+
return match[1].toUpperCase();
|
|
105
|
+
}
|
|
106
|
+
// Pattern 3: Decision in parentheses
|
|
107
|
+
match = output.match(/\((PROCEED|ITERATE|ABORT)\)/i);
|
|
108
|
+
if (match) {
|
|
109
|
+
return match[1].toUpperCase();
|
|
110
|
+
}
|
|
111
|
+
// Pattern 4: JSON format
|
|
112
|
+
try {
|
|
113
|
+
const jsonMatch = output.match(/\{[\s\S]*?"decision"\s*:\s*"(PROCEED|ITERATE|ABORT)"[\s\S]*?\}/i);
|
|
114
|
+
if (jsonMatch) {
|
|
115
|
+
const json = JSON.parse(jsonMatch[0]);
|
|
116
|
+
if (json.decision && /^(PROCEED|ITERATE|ABORT)$/i.test(json.decision)) {
|
|
117
|
+
return json.decision.toUpperCase();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} catch {
|
|
121
|
+
// JSON parse failed, continue to next pattern
|
|
122
|
+
}
|
|
123
|
+
// Pattern 5: First occurrence of keyword (case-insensitive)
|
|
124
|
+
const keywords = output.match(/\b(PROCEED|ITERATE|ABORT)\b/i);
|
|
125
|
+
if (keywords) {
|
|
126
|
+
return keywords[1].toUpperCase();
|
|
127
|
+
}
|
|
128
|
+
// Default: No decision found
|
|
129
|
+
if (this.strict) {
|
|
130
|
+
throw new DecisionParserError('Could not extract decision from Product Owner output', 'NO_DECISION_FOUND', {
|
|
131
|
+
availablePatterns: [
|
|
132
|
+
'Decision:',
|
|
133
|
+
'Standalone keyword',
|
|
134
|
+
'Parentheses',
|
|
135
|
+
'JSON',
|
|
136
|
+
'First keyword'
|
|
137
|
+
]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Non-strict: default to ITERATE (safe fallback)
|
|
141
|
+
return 'ITERATE';
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Extract reasoning explanation
|
|
145
|
+
*/ extractReasoning(output) {
|
|
146
|
+
// Pattern 1: Explicit "Reasoning: ..."
|
|
147
|
+
let match = output.match(/Reasoning:\s*(.+?)(?:\n[A-Z]|\$|$)/i);
|
|
148
|
+
if (match) {
|
|
149
|
+
return match[1].trim();
|
|
150
|
+
}
|
|
151
|
+
// Pattern 2: "Because" or "Explanation"
|
|
152
|
+
match = output.match(/(?:Because|Explanation):\s*(.+?)(?:\n[A-Z]|\$|$)/i);
|
|
153
|
+
if (match) {
|
|
154
|
+
return match[1].trim();
|
|
155
|
+
}
|
|
156
|
+
// Pattern 3: JSON format
|
|
157
|
+
try {
|
|
158
|
+
const jsonMatch = output.match(/\{[\s\S]*?"reasoning"\s*:\s*"(.+?)"[\s\S]*?\}/i);
|
|
159
|
+
if (jsonMatch) {
|
|
160
|
+
const json = JSON.parse(jsonMatch[0]);
|
|
161
|
+
if (json.reasoning) {
|
|
162
|
+
return json.reasoning;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
} catch {
|
|
166
|
+
// JSON parse failed
|
|
167
|
+
}
|
|
168
|
+
// Pattern 4: Extract paragraph after decision
|
|
169
|
+
const decisionIndex = output.search(/Decision:|PROCEED|ITERATE|ABORT/i);
|
|
170
|
+
if (decisionIndex !== -1) {
|
|
171
|
+
const afterDecision = output.substring(decisionIndex + 20);
|
|
172
|
+
match = afterDecision.match(/(.{20,500}?)(?:\n\n|Confidence|$)/);
|
|
173
|
+
if (match) {
|
|
174
|
+
return match[1].trim();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return '';
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Extract confidence score
|
|
181
|
+
*/ extractConfidence(output) {
|
|
182
|
+
// Pattern 1: Confidence as percentage (check first, more specific)
|
|
183
|
+
let match = output.match(/Confidence:\s*(\d+)%/i);
|
|
184
|
+
if (match) {
|
|
185
|
+
return parseFloat(match[1]) / 100;
|
|
186
|
+
}
|
|
187
|
+
// Pattern 2: "Confidence: 0.95" (decimal, must not be followed by %)
|
|
188
|
+
match = output.match(/Confidence:\s*(0?\.[0-9]+|[0-9]+\.[0-9]+)/i);
|
|
189
|
+
if (match) {
|
|
190
|
+
const value = parseFloat(match[1]);
|
|
191
|
+
return Math.min(Math.max(value, 0), 1); // Clamp to 0-1
|
|
192
|
+
}
|
|
193
|
+
// Pattern 3: JSON format
|
|
194
|
+
try {
|
|
195
|
+
const jsonMatch = output.match(/\{[\s\S]*?"confidence"\s*:\s*([0-9.]+)[\s\S]*?\}/i);
|
|
196
|
+
if (jsonMatch) {
|
|
197
|
+
const json = JSON.parse(jsonMatch[0]);
|
|
198
|
+
if (typeof json.confidence === 'number') {
|
|
199
|
+
return Math.min(Math.max(json.confidence, 0), 1);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
} catch {
|
|
203
|
+
// JSON parse failed
|
|
204
|
+
}
|
|
205
|
+
// Default: moderate confidence
|
|
206
|
+
return 0.75;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Extract deliverables mentioned in output
|
|
210
|
+
*/ extractDeliverables(output) {
|
|
211
|
+
const deliverables = [];
|
|
212
|
+
// Pattern 1: Bulleted lists after "Deliverables" section
|
|
213
|
+
const deliverablesSection = output.match(/(?:Deliverables|Deliverable|Outputs?):\s*([\s\S]*?)(?:\n\n|Confidence|$)/i);
|
|
214
|
+
if (deliverablesSection) {
|
|
215
|
+
const items = deliverablesSection[1].match(/[-*•]\s+(.+?)(?=\n|$)/gm);
|
|
216
|
+
if (items) {
|
|
217
|
+
items.forEach((item)=>{
|
|
218
|
+
const cleaned = item.replace(/^[-*•]\s+/, '').trim();
|
|
219
|
+
if (cleaned.length > 0) {
|
|
220
|
+
deliverables.push(cleaned);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Pattern 2: JSON array format
|
|
226
|
+
try {
|
|
227
|
+
const jsonMatch = output.match(/\{[\s\S]*?"deliverables"\s*:\s*\[([\s\S]*?)\][\s\S]*?\}/i);
|
|
228
|
+
if (jsonMatch) {
|
|
229
|
+
const json = JSON.parse(jsonMatch[0]);
|
|
230
|
+
if (Array.isArray(json.deliverables)) {
|
|
231
|
+
deliverables.push(...json.deliverables);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
} catch {
|
|
235
|
+
// JSON parse failed
|
|
236
|
+
}
|
|
237
|
+
// Remove duplicates using Set
|
|
238
|
+
const uniqueSet = new Set(deliverables);
|
|
239
|
+
return Array.from(uniqueSet);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Extract audit analysis section
|
|
243
|
+
*/ extractAuditAnalysis(output) {
|
|
244
|
+
// Match "Audit Analysis: ..." to end of line or next capital letter
|
|
245
|
+
const match = output.match(/Audit Analysis:\s*(.+?)(?:\n[A-Z]|\n$|$)/i);
|
|
246
|
+
if (match) {
|
|
247
|
+
return match[1].trim();
|
|
248
|
+
}
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Extract agent performance observations
|
|
253
|
+
*/ extractAgentPerformance(output) {
|
|
254
|
+
// Match "Agent Performance: ..." to end of line or end of string
|
|
255
|
+
const match = output.match(/Agent Performance:\s*(.+?)(?:\n|$)/i);
|
|
256
|
+
if (match) {
|
|
257
|
+
return match[1].trim();
|
|
258
|
+
}
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Find the line containing the decision
|
|
263
|
+
*/ findDecisionLine(output) {
|
|
264
|
+
const lines = output.split('\n');
|
|
265
|
+
for (const line of lines){
|
|
266
|
+
if (/Decision:|PROCEED|ITERATE|ABORT/i.test(line)) {
|
|
267
|
+
return line.trim();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return undefined;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Validate decision consistency
|
|
274
|
+
*/ validateDecision(decision, reasoning, deliverables, confidence) {
|
|
275
|
+
const errors = [];
|
|
276
|
+
// Check confidence is valid
|
|
277
|
+
if (confidence < 0 || confidence > 1) {
|
|
278
|
+
errors.push(`Invalid confidence score: ${confidence} (must be 0-1)`);
|
|
279
|
+
}
|
|
280
|
+
// ITERATE requires explanation
|
|
281
|
+
if (decision === 'ITERATE' && !reasoning) {
|
|
282
|
+
errors.push('ITERATE decision requires reasoning for improvements');
|
|
283
|
+
}
|
|
284
|
+
// ABORT requires strong reasoning
|
|
285
|
+
if (decision === 'ABORT' && confidence > 0.5) {
|
|
286
|
+
errors.push('ABORT decision should have lower confidence (indicates critical issue)');
|
|
287
|
+
}
|
|
288
|
+
// PROCEED with low confidence is suspicious
|
|
289
|
+
if (decision === 'PROCEED' && confidence < 0.6) {
|
|
290
|
+
errors.push('PROCEED decision with low confidence (<0.6) indicates uncertainty');
|
|
291
|
+
}
|
|
292
|
+
return errors;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Check for "consensus on vapor" (claims complete without deliverables)
|
|
296
|
+
*/ checkConsensusOnVapor(output, deliverables) {
|
|
297
|
+
const errors = [];
|
|
298
|
+
// Check if task requires files
|
|
299
|
+
if (!this.taskContext) {
|
|
300
|
+
return {
|
|
301
|
+
isVapor: false,
|
|
302
|
+
errors: []
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
const requiresImplementation = /create|build|implement|generate|write|add|code|file|component|module|test/i.test(this.taskContext);
|
|
306
|
+
if (!requiresImplementation) {
|
|
307
|
+
return {
|
|
308
|
+
isVapor: false,
|
|
309
|
+
errors: []
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
// Check actual file changes in git
|
|
313
|
+
try {
|
|
314
|
+
const changedFiles = execSync('git status --short 2>/dev/null | grep -E "^(A|M|\\?\\?)" | wc -l', {
|
|
315
|
+
encoding: 'utf-8'
|
|
316
|
+
}).trim();
|
|
317
|
+
const fileCount = parseInt(changedFiles, 10) || 0;
|
|
318
|
+
if (fileCount === 0 && deliverables.length === 0) {
|
|
319
|
+
errors.push('No files created despite implementation task - consensus on plans only (consensus on vapor)');
|
|
320
|
+
return {
|
|
321
|
+
isVapor: true,
|
|
322
|
+
errors
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
if (fileCount === 0 && deliverables.length > 0) {
|
|
326
|
+
errors.push('Deliverables claimed but no files created - high risk of vapor consensus');
|
|
327
|
+
return {
|
|
328
|
+
isVapor: true,
|
|
329
|
+
errors
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
} catch {
|
|
333
|
+
// Git command failed, skip vapor check
|
|
334
|
+
// This is non-critical in non-git environments
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
isVapor: false,
|
|
338
|
+
errors
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Parse decision from output string (convenience function)
|
|
344
|
+
*/ export async function parseDecision(output, options) {
|
|
345
|
+
const parser = new DecisionParser(options);
|
|
346
|
+
return parser.parse(output);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Parse decision from file (convenience function)
|
|
350
|
+
*/ export async function parseDecisionFile(filePath, options) {
|
|
351
|
+
const parser = new DecisionParser(options);
|
|
352
|
+
return parser.parseFile(filePath);
|
|
353
|
+
}
|
|
354
|
+
export default DecisionParser;
|
|
355
|
+
|
|
356
|
+
//# sourceMappingURL=decision-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cfn-loop/product-owner/decision-parser.ts"],"sourcesContent":["/**\r\n * Product Owner Decision Parser\r\n * Parses Product Owner agent output to extract decision, reasoning, and validation\r\n *\r\n * Prevents \"consensus on vapor\" (claiming completion without deliverables)\r\n * Handles multiple output formats with robust fallback patterns\r\n */\r\n\r\nimport { promises as fs } from 'fs';\r\nimport { execSync } from 'child_process';\r\n\r\n/**\r\n * Parsed decision from Product Owner output\r\n */\r\nexport interface ParsedDecision {\r\n decision: 'PROCEED' | 'ITERATE' | 'ABORT';\r\n reasoning: string;\r\n deliverables: string[];\r\n confidence: number;\r\n validationErrors: string[];\r\n auditAnalysis?: string;\r\n agentPerformanceObservations?: string;\r\n raw: {\r\n fullOutput: string;\r\n decisionLine?: string;\r\n };\r\n}\r\n\r\n/**\r\n * Decision Parser Options\r\n */\r\nexport interface DecisionParserOptions {\r\n strict?: boolean;\r\n validateDeliverables?: boolean;\r\n taskContext?: string;\r\n taskId?: string;\r\n}\r\n\r\n/**\r\n * Decision Parser Error\r\n */\r\nexport class DecisionParserError extends Error {\r\n constructor(\r\n message: string,\r\n public code: string,\r\n public details?: Record<string, any>\r\n ) {\r\n super(message);\r\n this.name = 'DecisionParserError';\r\n }\r\n}\r\n\r\n/**\r\n * Parse Product Owner output and extract decision\r\n */\r\nexport class DecisionParser {\r\n private strict: boolean;\r\n private validateDeliverables: boolean;\r\n private taskContext?: string;\r\n private taskId?: string;\r\n\r\n constructor(options: DecisionParserOptions = {}) {\r\n this.strict = options.strict ?? true;\r\n this.validateDeliverables = options.validateDeliverables ?? true;\r\n this.taskContext = options.taskContext;\r\n this.taskId = options.taskId;\r\n }\r\n\r\n /**\r\n * Parse decision from text output\r\n */\r\n public parse(output: string): ParsedDecision {\r\n if (!output || typeof output !== 'string') {\r\n throw new DecisionParserError(\r\n 'Invalid output: must be non-empty string',\r\n 'INVALID_OUTPUT'\r\n );\r\n }\r\n\r\n const decision = this.extractDecision(output);\r\n const reasoning = this.extractReasoning(output);\r\n const confidence = this.extractConfidence(output);\r\n const deliverables = this.extractDeliverables(output);\r\n const auditAnalysis = this.extractAuditAnalysis(output);\r\n const agentPerformanceObservations = this.extractAgentPerformance(output);\r\n\r\n // Validate decision\r\n const validationErrors = this.validateDecision(\r\n decision,\r\n reasoning,\r\n deliverables,\r\n confidence\r\n );\r\n\r\n // Prevent \"consensus on vapor\"\r\n if (decision === 'PROCEED' && this.validateDeliverables) {\r\n const vapourCheck = this.checkConsensusOnVapor(output, deliverables);\r\n if (vapourCheck.isVapor) {\r\n validationErrors.push(...vapourCheck.errors);\r\n if (this.strict) {\r\n return {\r\n decision: 'ITERATE',\r\n reasoning: `Override PROCEED → ITERATE: ${vapourCheck.errors.join('; ')}`,\r\n deliverables: [],\r\n confidence: Math.min(confidence, 0.7),\r\n validationErrors: vapourCheck.errors,\r\n raw: {\r\n fullOutput: output,\r\n decisionLine: this.findDecisionLine(output)\r\n }\r\n };\r\n }\r\n }\r\n }\r\n\r\n return {\r\n decision,\r\n reasoning: reasoning || 'No reasoning provided',\r\n deliverables,\r\n confidence,\r\n validationErrors,\r\n auditAnalysis,\r\n agentPerformanceObservations,\r\n raw: {\r\n fullOutput: output,\r\n decisionLine: this.findDecisionLine(output)\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Parse decision from file\r\n */\r\n public async parseFile(filePath: string): Promise<ParsedDecision> {\r\n try {\r\n const content = await fs.readFile(filePath, 'utf-8');\r\n return this.parse(content);\r\n } catch (error) {\r\n throw new DecisionParserError(\r\n `Failed to read decision file: ${filePath}`,\r\n 'FILE_READ_ERROR',\r\n { originalError: String(error) }\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Extract decision keyword (PROCEED, ITERATE, ABORT)\r\n * Multiple fallback patterns for robustness\r\n */\r\n private extractDecision(output: string): 'PROCEED' | 'ITERATE' | 'ABORT' {\r\n // Pattern 1: Explicit \"Decision: PROCEED\"\r\n let match = output.match(/Decision:\\s*(PROCEED|ITERATE|ABORT)/i);\r\n if (match) {\r\n return match[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Pattern 2: Standalone keyword at start of line\r\n match = output.match(/^(PROCEED|ITERATE|ABORT)/im);\r\n if (match) {\r\n return match[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Pattern 3: Decision in parentheses\r\n match = output.match(/\\((PROCEED|ITERATE|ABORT)\\)/i);\r\n if (match) {\r\n return match[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Pattern 4: JSON format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"decision\"\\s*:\\s*\"(PROCEED|ITERATE|ABORT)\"[\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (json.decision && /^(PROCEED|ITERATE|ABORT)$/i.test(json.decision)) {\r\n return json.decision.toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed, continue to next pattern\r\n }\r\n\r\n // Pattern 5: First occurrence of keyword (case-insensitive)\r\n const keywords = output.match(/\\b(PROCEED|ITERATE|ABORT)\\b/i);\r\n if (keywords) {\r\n return keywords[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Default: No decision found\r\n if (this.strict) {\r\n throw new DecisionParserError(\r\n 'Could not extract decision from Product Owner output',\r\n 'NO_DECISION_FOUND',\r\n { availablePatterns: ['Decision:', 'Standalone keyword', 'Parentheses', 'JSON', 'First keyword'] }\r\n );\r\n }\r\n\r\n // Non-strict: default to ITERATE (safe fallback)\r\n return 'ITERATE';\r\n }\r\n\r\n /**\r\n * Extract reasoning explanation\r\n */\r\n private extractReasoning(output: string): string {\r\n // Pattern 1: Explicit \"Reasoning: ...\"\r\n let match = output.match(/Reasoning:\\s*(.+?)(?:\\n[A-Z]|\\$|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n\r\n // Pattern 2: \"Because\" or \"Explanation\"\r\n match = output.match(/(?:Because|Explanation):\\s*(.+?)(?:\\n[A-Z]|\\$|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n\r\n // Pattern 3: JSON format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"reasoning\"\\s*:\\s*\"(.+?)\"[\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (json.reasoning) {\r\n return json.reasoning;\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed\r\n }\r\n\r\n // Pattern 4: Extract paragraph after decision\r\n const decisionIndex = output.search(/Decision:|PROCEED|ITERATE|ABORT/i);\r\n if (decisionIndex !== -1) {\r\n const afterDecision = output.substring(decisionIndex + 20);\r\n match = afterDecision.match(/(.{20,500}?)(?:\\n\\n|Confidence|$)/);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n }\r\n\r\n return '';\r\n }\r\n\r\n /**\r\n * Extract confidence score\r\n */\r\n private extractConfidence(output: string): number {\r\n // Pattern 1: Confidence as percentage (check first, more specific)\r\n let match = output.match(/Confidence:\\s*(\\d+)%/i);\r\n if (match) {\r\n return parseFloat(match[1]) / 100;\r\n }\r\n\r\n // Pattern 2: \"Confidence: 0.95\" (decimal, must not be followed by %)\r\n match = output.match(/Confidence:\\s*(0?\\.[0-9]+|[0-9]+\\.[0-9]+)/i);\r\n if (match) {\r\n const value = parseFloat(match[1]);\r\n return Math.min(Math.max(value, 0), 1); // Clamp to 0-1\r\n }\r\n\r\n // Pattern 3: JSON format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"confidence\"\\s*:\\s*([0-9.]+)[\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (typeof json.confidence === 'number') {\r\n return Math.min(Math.max(json.confidence, 0), 1);\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed\r\n }\r\n\r\n // Default: moderate confidence\r\n return 0.75;\r\n }\r\n\r\n /**\r\n * Extract deliverables mentioned in output\r\n */\r\n private extractDeliverables(output: string): string[] {\r\n const deliverables: string[] = [];\r\n\r\n // Pattern 1: Bulleted lists after \"Deliverables\" section\r\n const deliverablesSection = output.match(\r\n /(?:Deliverables|Deliverable|Outputs?):\\s*([\\s\\S]*?)(?:\\n\\n|Confidence|$)/i\r\n );\r\n\r\n if (deliverablesSection) {\r\n const items = deliverablesSection[1].match(/[-*•]\\s+(.+?)(?=\\n|$)/gm);\r\n if (items) {\r\n items.forEach(item => {\r\n const cleaned = item.replace(/^[-*•]\\s+/, '').trim();\r\n if (cleaned.length > 0) {\r\n deliverables.push(cleaned);\r\n }\r\n });\r\n }\r\n }\r\n\r\n // Pattern 2: JSON array format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"deliverables\"\\s*:\\s*\\[([\\s\\S]*?)\\][\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (Array.isArray(json.deliverables)) {\r\n deliverables.push(...json.deliverables);\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed\r\n }\r\n\r\n // Remove duplicates using Set\r\n const uniqueSet = new Set(deliverables);\r\n return Array.from(uniqueSet);\r\n }\r\n\r\n /**\r\n * Extract audit analysis section\r\n */\r\n private extractAuditAnalysis(output: string): string | undefined {\r\n // Match \"Audit Analysis: ...\" to end of line or next capital letter\r\n const match = output.match(/Audit Analysis:\\s*(.+?)(?:\\n[A-Z]|\\n$|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Extract agent performance observations\r\n */\r\n private extractAgentPerformance(output: string): string | undefined {\r\n // Match \"Agent Performance: ...\" to end of line or end of string\r\n const match = output.match(/Agent Performance:\\s*(.+?)(?:\\n|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Find the line containing the decision\r\n */\r\n private findDecisionLine(output: string): string | undefined {\r\n const lines = output.split('\\n');\r\n for (const line of lines) {\r\n if (/Decision:|PROCEED|ITERATE|ABORT/i.test(line)) {\r\n return line.trim();\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Validate decision consistency\r\n */\r\n private validateDecision(\r\n decision: string,\r\n reasoning: string,\r\n deliverables: string[],\r\n confidence: number\r\n ): string[] {\r\n const errors: string[] = [];\r\n\r\n // Check confidence is valid\r\n if (confidence < 0 || confidence > 1) {\r\n errors.push(`Invalid confidence score: ${confidence} (must be 0-1)`);\r\n }\r\n\r\n // ITERATE requires explanation\r\n if (decision === 'ITERATE' && !reasoning) {\r\n errors.push('ITERATE decision requires reasoning for improvements');\r\n }\r\n\r\n // ABORT requires strong reasoning\r\n if (decision === 'ABORT' && confidence > 0.5) {\r\n errors.push('ABORT decision should have lower confidence (indicates critical issue)');\r\n }\r\n\r\n // PROCEED with low confidence is suspicious\r\n if (decision === 'PROCEED' && confidence < 0.6) {\r\n errors.push('PROCEED decision with low confidence (<0.6) indicates uncertainty');\r\n }\r\n\r\n return errors;\r\n }\r\n\r\n /**\r\n * Check for \"consensus on vapor\" (claims complete without deliverables)\r\n */\r\n private checkConsensusOnVapor(\r\n output: string,\r\n deliverables: string[]\r\n ): { isVapor: boolean; errors: string[] } {\r\n const errors: string[] = [];\r\n\r\n // Check if task requires files\r\n if (!this.taskContext) {\r\n return { isVapor: false, errors: [] };\r\n }\r\n\r\n const requiresImplementation = /create|build|implement|generate|write|add|code|file|component|module|test/i.test(\r\n this.taskContext\r\n );\r\n\r\n if (!requiresImplementation) {\r\n return { isVapor: false, errors: [] };\r\n }\r\n\r\n // Check actual file changes in git\r\n try {\r\n const changedFiles = execSync('git status --short 2>/dev/null | grep -E \"^(A|M|\\\\?\\\\?)\" | wc -l', {\r\n encoding: 'utf-8'\r\n }).trim();\r\n\r\n const fileCount = parseInt(changedFiles, 10) || 0;\r\n\r\n if (fileCount === 0 && deliverables.length === 0) {\r\n errors.push('No files created despite implementation task - consensus on plans only (consensus on vapor)');\r\n return { isVapor: true, errors };\r\n }\r\n\r\n if (fileCount === 0 && deliverables.length > 0) {\r\n errors.push('Deliverables claimed but no files created - high risk of vapor consensus');\r\n return { isVapor: true, errors };\r\n }\r\n } catch {\r\n // Git command failed, skip vapor check\r\n // This is non-critical in non-git environments\r\n }\r\n\r\n return { isVapor: false, errors };\r\n }\r\n}\r\n\r\n/**\r\n * Parse decision from output string (convenience function)\r\n */\r\nexport async function parseDecision(\r\n output: string,\r\n options?: DecisionParserOptions\r\n): Promise<ParsedDecision> {\r\n const parser = new DecisionParser(options);\r\n return parser.parse(output);\r\n}\r\n\r\n/**\r\n * Parse decision from file (convenience function)\r\n */\r\nexport async function parseDecisionFile(\r\n filePath: string,\r\n options?: DecisionParserOptions\r\n): Promise<ParsedDecision> {\r\n const parser = new DecisionParser(options);\r\n return parser.parseFile(filePath);\r\n}\r\n\r\nexport default DecisionParser;\r\n"],"names":["promises","fs","execSync","DecisionParserError","Error","message","code","details","name","DecisionParser","strict","validateDeliverables","taskContext","taskId","options","parse","output","decision","extractDecision","reasoning","extractReasoning","confidence","extractConfidence","deliverables","extractDeliverables","auditAnalysis","extractAuditAnalysis","agentPerformanceObservations","extractAgentPerformance","validationErrors","validateDecision","vapourCheck","checkConsensusOnVapor","isVapor","push","errors","join","Math","min","raw","fullOutput","decisionLine","findDecisionLine","parseFile","filePath","content","readFile","error","originalError","String","match","toUpperCase","jsonMatch","json","JSON","test","keywords","availablePatterns","trim","decisionIndex","search","afterDecision","substring","parseFloat","value","max","deliverablesSection","items","forEach","item","cleaned","replace","length","Array","isArray","uniqueSet","Set","from","undefined","lines","split","line","requiresImplementation","changedFiles","encoding","fileCount","parseInt","parseDecision","parser","parseDecisionFile"],"mappings":"AAAA;;;;;;CAMC,GAED,SAASA,YAAYC,EAAE,QAAQ,KAAK;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AA6BzC;;CAEC,GACD,OAAO,MAAMC,4BAA4BC;;;IACvC,YACEC,OAAe,EACf,AAAOC,IAAY,EACnB,AAAOC,OAA6B,CACpC;QACA,KAAK,CAACF,eAHCC,OAAAA,WACAC,UAAAA;QAGP,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC;IACHC,OAAgB;IAChBC,qBAA8B;IAC9BC,YAAqB;IACrBC,OAAgB;IAExB,YAAYC,UAAiC,CAAC,CAAC,CAAE;QAC/C,IAAI,CAACJ,MAAM,GAAGI,QAAQJ,MAAM,IAAI;QAChC,IAAI,CAACC,oBAAoB,GAAGG,QAAQH,oBAAoB,IAAI;QAC5D,IAAI,CAACC,WAAW,GAAGE,QAAQF,WAAW;QACtC,IAAI,CAACC,MAAM,GAAGC,QAAQD,MAAM;IAC9B;IAEA;;GAEC,GACD,AAAOE,MAAMC,MAAc,EAAkB;QAC3C,IAAI,CAACA,UAAU,OAAOA,WAAW,UAAU;YACzC,MAAM,IAAIb,oBACR,4CACA;QAEJ;QAEA,MAAMc,WAAW,IAAI,CAACC,eAAe,CAACF;QACtC,MAAMG,YAAY,IAAI,CAACC,gBAAgB,CAACJ;QACxC,MAAMK,aAAa,IAAI,CA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E,QAAQ,EAAE;YAAC;QACtC;QAEA,mCAAmC;QACnC,IAAI;YACF,MAAMgD,eAAejF,SAAS,oEAAoE;gBAChGkF,UAAU;YACZ,GAAG1B,IAAI;YAEP,MAAM2B,YAAYC,SAASH,cAAc,OAAO;YAEhD,IAAIE,cAAc,KAAK9D,aAAaiD,MAAM,KAAK,GAAG;gBAChDrC,OAAOD,IAAI,CAAC;gBACZ,OAAO;oBAAED,SAAS;oBAAME;gBAAO;YACjC;YAEA,IAAIkD,cAAc,KAAK9D,aAAaiD,MAAM,GAAG,GAAG;gBAC9CrC,OAAOD,IAAI,CAAC;gBACZ,OAAO;oBAAED,SAAS;oBAAME;gBAAO;YACjC;QACF,EAAE,OAAM;QACN,uCAAuC;QACvC,+CAA+C;QACjD;QAEA,OAAO;YAAEF,SAAS;YAAOE;QAAO;IAClC;AACF;AAEA;;CAEC,GACD,OAAO,eAAeoD,cACpBvE,MAAc,EACdF,OAA+B;IAE/B,MAAM0E,SAAS,IAAI/E,eAAeK;IAClC,OAAO0E,OAAOzE,KAAK,CAACC;AACtB;AAEA;;CAEC,GACD,OAAO,eAAeyE,kBACpB7C,QAAgB,EAChB9B,OAA+B;IAE/B,MAAM0E,SAAS,IAAI/E,eAAeK;IAClC,OAAO0E,OAAO7C,SAAS,CAACC;AAC1B;AAEA,eAAenC,eAAe"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Centralized export of all product owner implementations
|
|
4
4
|
*/ export { MVPOwner } from './mvp-owner.js';
|
|
5
5
|
export { EnterpriseOwnerTeam } from './enterprise-owner-team.js';
|
|
6
|
+
export { DecisionParser, DecisionParserError, parseDecision, parseDecisionFile } from './decision-parser.js';
|
|
6
7
|
import { MVPOwner } from './mvp-owner.js';
|
|
7
8
|
import { EnterpriseOwnerTeam } from './enterprise-owner-team.js';
|
|
8
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cfn-loop/product-owner/index.ts"],"sourcesContent":["/**\r\n * Product Owner System Exports\r\n * Centralized export of all product owner implementations\r\n */\r\n\r\nexport { MVPOwner } from './mvp-owner.js';\r\nexport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\n\r\nexport type {\r\n POConfig,\r\n PODecision,\r\n PODecisionResult,\r\n GOAPState,\r\n GOAPAction,\r\n TeamVote,\r\n TeamDecisionResult,\r\n ProductOwner,\r\n} from './types.js';\r\n\r\nimport { MVPOwner } from './mvp-owner.js';\r\nimport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\nimport type { CFNLoopModeName } from '../modes/types.js';\r\nimport type { ProductOwner } from './types.js';\r\n\r\n/**\r\n * Get product owner implementation for mode\r\n */\r\nexport function getProductOwnerForMode(\r\n mode: CFNLoopModeName,\r\n memoryManager?: unknown\r\n): ProductOwner {\r\n switch (mode) {\r\n case 'mvp':\r\n case 'standard':\r\n return new MVPOwner(memoryManager);\r\n case 'enterprise':\r\n return new EnterpriseOwnerTeam(memoryManager);\r\n default:\r\n throw new Error(`Unknown mode for product owner: ${mode}`);\r\n }\r\n}\r\n\r\n/**\r\n * Execute MVP owner decision (legacy function wrapper)\r\n */\r\nexport async function executeMVPOwnerDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').PODecisionResult> {\r\n const owner = new MVPOwner(memoryManager);\r\n return owner.makeDecision(state);\r\n}\r\n\r\n/**\r\n * Execute Enterprise board decision (legacy function wrapper)\r\n */\r\nexport async function executeEnterpriseBoardDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').TeamDecisionResult> {\r\n const team = new EnterpriseOwnerTeam(memoryManager);\r\n return team.makeDecision(state);\r\n}\r\n"],"names":["MVPOwner","EnterpriseOwnerTeam","getProductOwnerForMode","mode","memoryManager","Error","executeMVPOwnerDecision","state","owner","makeDecision","executeEnterpriseBoardDecision","team"],"mappings":"AAAA;;;CAGC,GAED,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;
|
|
1
|
+
{"version":3,"sources":["../../../src/cfn-loop/product-owner/index.ts"],"sourcesContent":["/**\r\n * Product Owner System Exports\r\n * Centralized export of all product owner implementations\r\n */\r\n\r\nexport { MVPOwner } from './mvp-owner.js';\r\nexport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\nexport { DecisionParser, DecisionParserError, parseDecision, parseDecisionFile } from './decision-parser.js';\r\n\r\nexport type {\r\n POConfig,\r\n PODecision,\r\n PODecisionResult,\r\n GOAPState,\r\n GOAPAction,\r\n TeamVote,\r\n TeamDecisionResult,\r\n ProductOwner,\r\n} from './types.js';\r\n\r\nexport type { ParsedDecision, DecisionParserOptions } from './decision-parser.js';\r\n\r\nimport { MVPOwner } from './mvp-owner.js';\r\nimport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\nimport type { CFNLoopModeName } from '../modes/types.js';\r\nimport type { ProductOwner } from './types.js';\r\n\r\n/**\r\n * Get product owner implementation for mode\r\n */\r\nexport function getProductOwnerForMode(\r\n mode: CFNLoopModeName,\r\n memoryManager?: unknown\r\n): ProductOwner {\r\n switch (mode) {\r\n case 'mvp':\r\n case 'standard':\r\n return new MVPOwner(memoryManager);\r\n case 'enterprise':\r\n return new EnterpriseOwnerTeam(memoryManager);\r\n default:\r\n throw new Error(`Unknown mode for product owner: ${mode}`);\r\n }\r\n}\r\n\r\n/**\r\n * Execute MVP owner decision (legacy function wrapper)\r\n */\r\nexport async function executeMVPOwnerDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').PODecisionResult> {\r\n const owner = new MVPOwner(memoryManager);\r\n return owner.makeDecision(state);\r\n}\r\n\r\n/**\r\n * Execute Enterprise board decision (legacy function wrapper)\r\n */\r\nexport async function executeEnterpriseBoardDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').TeamDecisionResult> {\r\n const team = new EnterpriseOwnerTeam(memoryManager);\r\n return team.makeDecision(state);\r\n}\r\n"],"names":["MVPOwner","EnterpriseOwnerTeam","DecisionParser","DecisionParserError","parseDecision","parseDecisionFile","getProductOwnerForMode","mode","memoryManager","Error","executeMVPOwnerDecision","state","owner","makeDecision","executeEnterpriseBoardDecision","team"],"mappings":"AAAA;;;CAGC,GAED,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,cAAc,EAAEC,mBAAmB,EAAEC,aAAa,EAAEC,iBAAiB,QAAQ,uBAAuB;AAe7G,SAASL,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;AAIjE;;CAEC,GACD,OAAO,SAASK,uBACdC,IAAqB,EACrBC,aAAuB;IAEvB,OAAQD;QACN,KAAK;QACL,KAAK;YACH,OAAO,IAAIP,SAASQ;QACtB,KAAK;YACH,OAAO,IAAIP,oBAAoBO;QACjC;YACE,MAAM,IAAIC,MAAM,CAAC,gCAAgC,EAAEF,MAAM;IAC7D;AACF;AAEA;;CAEC,GACD,OAAO,eAAeG,wBACpBC,KAAqC,EACrCH,aAAuB;IAEvB,MAAMI,QAAQ,IAAIZ,SAASQ;IAC3B,OAAOI,MAAMC,YAAY,CAACF;AAC5B;AAEA;;CAEC,GACD,OAAO,eAAeG,+BACpBH,KAAqC,EACrCH,aAAuB;IAEvB,MAAMO,OAAO,IAAId,oBAAoBO;IACrC,OAAOO,KAAKF,YAAY,CAACF;AAC3B"}
|
|
@@ -166,7 +166,7 @@ Documentation:
|
|
|
166
166
|
};
|
|
167
167
|
const prompt = await buildAgentPrompt(definition, taskContext);
|
|
168
168
|
console.log(` ✓ Prompt size: ${prompt.length} characters`);
|
|
169
|
-
console.log(` ✓ CFN Loop protocol: ${prompt.includes('
|
|
169
|
+
console.log(` ✓ CFN Loop protocol: ${prompt.includes('CLI Mode Redis Completion Protocol') ? 'included' : 'not applicable'}`);
|
|
170
170
|
console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);
|
|
171
171
|
console.log('');
|
|
172
172
|
// Step 3: Execute agent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/agent-command.ts"],"sourcesContent":["/**\r\n * Agent Command Handler\r\n *\r\n * Handles `npx claude-flow-novice agent <type> [options]` commands.\r\n * Orchestrates agent definition parsing, prompt building, and execution.\r\n */\r\n\r\nimport { parseAgentDefinition, listAgentDefinitions } from './agent-definition-parser.js';\r\nimport { buildAgentPrompt, TaskContext } from './agent-prompt-builder.js';\r\nimport { executeAgent } from './agent-executor.js';\r\n\r\nexport interface AgentCommandOptions {\r\n taskId?: string;\r\n iteration?: number;\r\n context?: string;\r\n mode?: string;\r\n priority?: number;\r\n parentTaskId?: string;\r\n agentId?: string;\r\n list?: boolean;\r\n help?: boolean;\r\n memoryLimit?: number;\r\n enableProfiling?: boolean;\r\n debug?: boolean;\r\n}\r\n\r\n/**\r\n * Display agent command help\r\n */\r\nexport function displayAgentHelp(): void {\r\n console.log(`\r\nClaude Flow Novice - Agent Spawning\r\n\r\nUsage:\r\n npx claude-flow-novice agent <type> [options]\r\n\r\nArguments:\r\n <type> Agent type (e.g., rust-enterprise-developer, coder, reviewer)\r\n\r\nOptions:\r\n --task-id <id> Task identifier for CFN Loop coordination\r\n --iteration <n> Iteration number (default: 1)\r\n --agent-id <id> Explicit agent ID (overrides auto-generated ID)\r\n --context <text> Task context/description\r\n --mode <mode> Execution mode (cli, api, hybrid)\r\n --priority <n> Task priority (1-10)\r\n --parent-task-id <id> Parent task identifier\r\n --memory-limit <mb> Set memory limit in MB (default: 8192)\r\n --enable-profiling Enable heap profiling for debugging\r\n --debug Enable debug mode with profiling\r\n --list List all available agents\r\n --help Show this help message\r\n\r\nExamples:\r\n # Simple agent spawn\r\n npx claude-flow-novice agent coder --context \"Implement JWT auth\"\r\n\r\n # CFN Loop agent with memory limits\r\n npx claude-flow-novice agent rust-enterprise-developer \\\\\r\n --task-id task-123 \\\\\r\n --iteration 1 \\\\\r\n --mode standard \\\\\r\n --memory-limit 4096\r\n\r\n # Debug mode with profiling\r\n npx claude-flow-novice agent tester \\\\\r\n --context \"Test authentication system\" \\\\\r\n --debug \\\\\r\n --enable-profiling\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\nMemory Management:\r\n Claude automatically applies memory limits to prevent leaks:\r\n - Default limit: 8GB (reduced from 16GB)\r\n - Use --memory-limit to set custom limits\r\n - Use --debug to enable profiling and monitoring\r\n - Memory profiles saved to /tmp/claude-memory-profiles/\r\n\r\n For advanced memory management:\r\n ./scripts/memory-leak-prevention.sh --help\r\n\r\nAvailable Agents:\r\n Agents are defined in .claude/agents/ directory:\r\n - core-agents/ Production-ready core agents\r\n - specialized/ Domain-specific specialists\r\n - development/ Development-focused agents\r\n - security/ Security-focused agents\r\n - custom/ Your custom agents\r\n\r\nDocumentation:\r\n See .claude/agents/CLAUDE.md for agent creation guide\r\n`);\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgents(): Promise<void> {\r\n console.log('Searching for agent definitions...\\n');\r\n\r\n const agents = await listAgentDefinitions();\r\n\r\n if (agents.length === 0) {\r\n console.log('No agent definitions found in .claude/agents/');\r\n console.log('\\nTo create agents, see: .claude/agents/CLAUDE.md');\r\n return;\r\n }\r\n\r\n console.log(`Found ${agents.length} agent(s):\\n`);\r\n\r\n // Group by category\r\n const grouped: Record<string, string[]> = {};\r\n\r\n for (const agent of agents) {\r\n const parts = agent.split('/');\r\n const category = parts.length > 1 ? parts[0] : 'root';\r\n const name = parts.length > 1 ? parts.slice(1).join('/') : parts[0];\r\n\r\n if (!grouped[category]) {\r\n grouped[category] = [];\r\n }\r\n grouped[category].push(name);\r\n }\r\n\r\n // Display grouped agents\r\n for (const [category, names] of Object.entries(grouped).sort()) {\r\n console.log(`${category}/`);\r\n for (const name of names.sort()) {\r\n console.log(` - ${name}`);\r\n }\r\n console.log('');\r\n }\r\n\r\n console.log('Usage:');\r\n console.log(' npx claude-flow-novice agent <name> [options]');\r\n}\r\n\r\n/**\r\n * Execute agent command\r\n */\r\nexport async function agentCommand(\r\n agentType: string | undefined,\r\n options: AgentCommandOptions\r\n): Promise<void> {\r\n // Handle --list flag\r\n if (options.list) {\r\n await listAgents();\r\n return;\r\n }\r\n\r\n // Handle --help flag\r\n if (options.help || !agentType) {\r\n displayAgentHelp();\r\n return;\r\n }\r\n\r\n try {\r\n // Apply memory management options\r\n if (options.memoryLimit) {\r\n console.log(`[agent-command] Setting memory limit: ${options.memoryLimit}MB`);\r\n const currentOptions = process.env.NODE_OPTIONS || '';\r\n const newOptions = currentOptions.replace(/--max-old-space-size=\\d+/, `--max-old-space-size=${options.memoryLimit}`);\r\n process.env.NODE_OPTIONS = newOptions || `--max-old-space-size=${options.memoryLimit}`;\r\n }\r\n\r\n if (options.enableProfiling || options.debug) {\r\n console.log(`[agent-command] Enabling memory profiling`);\r\n if (!process.env.NODE_OPTIONS.includes('heap-prof')) {\r\n process.env.NODE_OPTIONS += ' --heap-prof';\r\n }\r\n if (!process.env.NODE_OPTIONS.includes('inspect') && options.debug) {\r\n process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';\r\n }\r\n }\r\n\r\n if (options.debug) {\r\n console.log(`[agent-command] Debug mode enabled`);\r\n process.env.CLAUDE_DEBUG = 'true';\r\n process.env.CLAUDE_MEMORY_MONITORING = 'true';\r\n }\r\n\r\n console.log(`[agent-command] Spawning agent: ${agentType}`);\r\n console.log(`[agent-command] Memory settings: ${process.env.NODE_OPTIONS}`);\r\n console.log('');\r\n\r\n // Step 1: Parse agent definition\r\n console.log('[1/3] Parsing agent definition...');\r\n const definition = await parseAgentDefinition(agentType);\r\n console.log(` ✓ Found: ${definition.name}`);\r\n console.log(` ✓ Type: ${definition.type || 'specialist'}`);\r\n console.log(` ✓ Model: ${definition.model}`);\r\n console.log(` ✓ Tools: ${definition.tools.join(', ')}`);\r\n console.log('');\r\n\r\n // Step 2: Build agent prompt\r\n console.log('[2/3] Building agent prompt...');\r\n const taskContext: TaskContext = {\r\n taskId: options.taskId,\r\n iteration: options.iteration,\r\n agentId: options.agentId,\r\n context: options.context,\r\n mode: options.mode,\r\n priority: options.priority,\r\n parentTaskId: options.parentTaskId,\r\n };\r\n\r\n const prompt = await buildAgentPrompt(definition, taskContext);\r\n console.log(` ✓ Prompt size: ${prompt.length} characters`);\r\n console.log(` ✓ CFN Loop protocol: ${prompt.includes('CFN Loop Redis Completion Protocol') ? 'included' : 'not applicable'}`);\r\n console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);\r\n console.log('');\r\n\r\n // Step 3: Execute agent\r\n console.log('[3/3] Executing agent...');\r\n const result = await executeAgent(definition, prompt, taskContext);\r\n\r\n console.log('');\r\n console.log('=== Execution Result ===');\r\n console.log(`Agent ID: ${result.agentId}`);\r\n console.log(`Status: ${result.success ? '✓ Success' : '✗ Failed'}`);\r\n console.log(`Exit Code: ${result.exitCode}`);\r\n\r\n if (result.error) {\r\n console.error(`Error: ${result.error}`);\r\n process.exit(1);\r\n }\r\n\r\n if (result.output) {\r\n console.log('\\nOutput:');\r\n console.log(result.output);\r\n }\r\n\r\n process.exit(result.exitCode);\r\n } catch (error) {\r\n console.error('\\n[agent-command] Error:', error instanceof Error ? error.message : String(error));\r\n process.exit(1);\r\n }\r\n}\r\n"],"names":["parseAgentDefinition","listAgentDefinitions","buildAgentPrompt","executeAgent","displayAgentHelp","console","log","listAgents","agents","length","grouped","agent","parts","split","category","name","slice","join","push","names","Object","entries","sort","agentCommand","agentType","options","list","help","memoryLimit","currentOptions","process","env","NODE_OPTIONS","newOptions","replace","enableProfiling","debug","includes","CLAUDE_DEBUG","CLAUDE_MEMORY_MONITORING","definition","type","model","tools","taskContext","taskId","iteration","agentId","context","mode","priority","parentTaskId","prompt","result","success","exitCode","error","exit","output","Error","message","String"],"mappings":"AAAA;;;;;CAKC,GA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QACZ,MAAM+C,SAAS,MAAMlD,aAAaqC,YAAYY,QAAQR;QAEtDvC,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC,CAAC,UAAU,EAAE+C,OAAON,OAAO,EAAE;QACzC1C,QAAQC,GAAG,CAAC,CAAC,QAAQ,EAAE+C,OAAOC,OAAO,GAAG,cAAc,YAAY;QAClEjD,QAAQC,GAAG,CAAC,CAAC,WAAW,EAAE+C,OAAOE,QAAQ,EAAE;QAE3C,IAAIF,OAAOG,KAAK,EAAE;YAChBnD,QAAQmD,KAAK,CAAC,CAAC,OAAO,EAAEH,OAAOG,KAAK,EAAE;YACtC1B,QAAQ2B,IAAI,CAAC;QACf;QAEA,IAAIJ,OAAOK,MAAM,EAAE;YACjBrD,QAAQC,GAAG,CAAC;YACZD,QAAQC,GAAG,CAAC+C,OAAOK,MAAM;QAC3B;QAEA5B,QAAQ2B,IAAI,CAACJ,OAAOE,QAAQ;IAC9B,EAAE,OAAOC,OAAO;QACdnD,QAAQmD,KAAK,CAAC,4BAA4BA,iBAAiBG,QAAQH,MAAMI,OAAO,GAAGC,OAAOL;QAC1F1B,QAAQ2B,IAAI,CAAC;IACf;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/agent-command.ts"],"sourcesContent":["/**\r\n * Agent Command Handler\r\n *\r\n * Handles `npx claude-flow-novice agent <type> [options]` commands.\r\n * Orchestrates agent definition parsing, prompt building, and execution.\r\n */\r\n\r\nimport { parseAgentDefinition, listAgentDefinitions } from './agent-definition-parser.js';\r\nimport { buildAgentPrompt, TaskContext } from './agent-prompt-builder.js';\r\nimport { executeAgent } from './agent-executor.js';\r\n\r\nexport interface AgentCommandOptions {\r\n taskId?: string;\r\n iteration?: number;\r\n context?: string;\r\n mode?: string;\r\n priority?: number;\r\n parentTaskId?: string;\r\n agentId?: string;\r\n list?: boolean;\r\n help?: boolean;\r\n memoryLimit?: number;\r\n enableProfiling?: boolean;\r\n debug?: boolean;\r\n}\r\n\r\n/**\r\n * Display agent command help\r\n */\r\nexport function displayAgentHelp(): void {\r\n console.log(`\r\nClaude Flow Novice - Agent Spawning\r\n\r\nUsage:\r\n npx claude-flow-novice agent <type> [options]\r\n\r\nArguments:\r\n <type> Agent type (e.g., rust-enterprise-developer, coder, reviewer)\r\n\r\nOptions:\r\n --task-id <id> Task identifier for CFN Loop coordination\r\n --iteration <n> Iteration number (default: 1)\r\n --agent-id <id> Explicit agent ID (overrides auto-generated ID)\r\n --context <text> Task context/description\r\n --mode <mode> Execution mode (cli, api, hybrid)\r\n --priority <n> Task priority (1-10)\r\n --parent-task-id <id> Parent task identifier\r\n --memory-limit <mb> Set memory limit in MB (default: 8192)\r\n --enable-profiling Enable heap profiling for debugging\r\n --debug Enable debug mode with profiling\r\n --list List all available agents\r\n --help Show this help message\r\n\r\nExamples:\r\n # Simple agent spawn\r\n npx claude-flow-novice agent coder --context \"Implement JWT auth\"\r\n\r\n # CFN Loop agent with memory limits\r\n npx claude-flow-novice agent rust-enterprise-developer \\\\\r\n --task-id task-123 \\\\\r\n --iteration 1 \\\\\r\n --mode standard \\\\\r\n --memory-limit 4096\r\n\r\n # Debug mode with profiling\r\n npx claude-flow-novice agent tester \\\\\r\n --context \"Test authentication system\" \\\\\r\n --debug \\\\\r\n --enable-profiling\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\nMemory Management:\r\n Claude automatically applies memory limits to prevent leaks:\r\n - Default limit: 8GB (reduced from 16GB)\r\n - Use --memory-limit to set custom limits\r\n - Use --debug to enable profiling and monitoring\r\n - Memory profiles saved to /tmp/claude-memory-profiles/\r\n\r\n For advanced memory management:\r\n ./scripts/memory-leak-prevention.sh --help\r\n\r\nAvailable Agents:\r\n Agents are defined in .claude/agents/ directory:\r\n - core-agents/ Production-ready core agents\r\n - specialized/ Domain-specific specialists\r\n - development/ Development-focused agents\r\n - security/ Security-focused agents\r\n - custom/ Your custom agents\r\n\r\nDocumentation:\r\n See .claude/agents/CLAUDE.md for agent creation guide\r\n`);\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgents(): Promise<void> {\r\n console.log('Searching for agent definitions...\\n');\r\n\r\n const agents = await listAgentDefinitions();\r\n\r\n if (agents.length === 0) {\r\n console.log('No agent definitions found in .claude/agents/');\r\n console.log('\\nTo create agents, see: .claude/agents/CLAUDE.md');\r\n return;\r\n }\r\n\r\n console.log(`Found ${agents.length} agent(s):\\n`);\r\n\r\n // Group by category\r\n const grouped: Record<string, string[]> = {};\r\n\r\n for (const agent of agents) {\r\n const parts = agent.split('/');\r\n const category = parts.length > 1 ? parts[0] : 'root';\r\n const name = parts.length > 1 ? parts.slice(1).join('/') : parts[0];\r\n\r\n if (!grouped[category]) {\r\n grouped[category] = [];\r\n }\r\n grouped[category].push(name);\r\n }\r\n\r\n // Display grouped agents\r\n for (const [category, names] of Object.entries(grouped).sort()) {\r\n console.log(`${category}/`);\r\n for (const name of names.sort()) {\r\n console.log(` - ${name}`);\r\n }\r\n console.log('');\r\n }\r\n\r\n console.log('Usage:');\r\n console.log(' npx claude-flow-novice agent <name> [options]');\r\n}\r\n\r\n/**\r\n * Execute agent command\r\n */\r\nexport async function agentCommand(\r\n agentType: string | undefined,\r\n options: AgentCommandOptions\r\n): Promise<void> {\r\n // Handle --list flag\r\n if (options.list) {\r\n await listAgents();\r\n return;\r\n }\r\n\r\n // Handle --help flag\r\n if (options.help || !agentType) {\r\n displayAgentHelp();\r\n return;\r\n }\r\n\r\n try {\r\n // Apply memory management options\r\n if (options.memoryLimit) {\r\n console.log(`[agent-command] Setting memory limit: ${options.memoryLimit}MB`);\r\n const currentOptions = process.env.NODE_OPTIONS || '';\r\n const newOptions = currentOptions.replace(/--max-old-space-size=\\d+/, `--max-old-space-size=${options.memoryLimit}`);\r\n process.env.NODE_OPTIONS = newOptions || `--max-old-space-size=${options.memoryLimit}`;\r\n }\r\n\r\n if (options.enableProfiling || options.debug) {\r\n console.log(`[agent-command] Enabling memory profiling`);\r\n if (!process.env.NODE_OPTIONS.includes('heap-prof')) {\r\n process.env.NODE_OPTIONS += ' --heap-prof';\r\n }\r\n if (!process.env.NODE_OPTIONS.includes('inspect') && options.debug) {\r\n process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';\r\n }\r\n }\r\n\r\n if (options.debug) {\r\n console.log(`[agent-command] Debug mode enabled`);\r\n process.env.CLAUDE_DEBUG = 'true';\r\n process.env.CLAUDE_MEMORY_MONITORING = 'true';\r\n }\r\n\r\n console.log(`[agent-command] Spawning agent: ${agentType}`);\r\n console.log(`[agent-command] Memory settings: ${process.env.NODE_OPTIONS}`);\r\n console.log('');\r\n\r\n // Step 1: Parse agent definition\r\n console.log('[1/3] Parsing agent definition...');\r\n const definition = await parseAgentDefinition(agentType);\r\n console.log(` ✓ Found: ${definition.name}`);\r\n console.log(` ✓ Type: ${definition.type || 'specialist'}`);\r\n console.log(` ✓ Model: ${definition.model}`);\r\n console.log(` ✓ Tools: ${definition.tools.join(', ')}`);\r\n console.log('');\r\n\r\n // Step 2: Build agent prompt\r\n console.log('[2/3] Building agent prompt...');\r\n const taskContext: TaskContext = {\r\n taskId: options.taskId,\r\n iteration: options.iteration,\r\n agentId: options.agentId,\r\n context: options.context,\r\n mode: options.mode,\r\n priority: options.priority,\r\n parentTaskId: options.parentTaskId,\r\n };\r\n\r\n const prompt = await buildAgentPrompt(definition, taskContext);\r\n console.log(` ✓ Prompt size: ${prompt.length} characters`);\r\n console.log(` ✓ CFN Loop protocol: ${prompt.includes('CLI Mode Redis Completion Protocol') ? 'included' : 'not applicable'}`);\r\n console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);\r\n console.log('');\r\n\r\n // Step 3: Execute agent\r\n console.log('[3/3] Executing agent...');\r\n const result = await executeAgent(definition, prompt, taskContext);\r\n\r\n console.log('');\r\n console.log('=== Execution Result ===');\r\n console.log(`Agent ID: ${result.agentId}`);\r\n console.log(`Status: ${result.success ? '✓ Success' : '✗ Failed'}`);\r\n console.log(`Exit Code: ${result.exitCode}`);\r\n\r\n if (result.error) {\r\n console.error(`Error: ${result.error}`);\r\n process.exit(1);\r\n }\r\n\r\n if (result.output) {\r\n console.log('\\nOutput:');\r\n console.log(result.output);\r\n }\r\n\r\n process.exit(result.exitCode);\r\n } catch (error) {\r\n console.error('\\n[agent-command] Error:', error instanceof Error ? error.message : String(error));\r\n process.exit(1);\r\n }\r\n}\r\n"],"names":["parseAgentDefinition","listAgentDefinitions","buildAgentPrompt","executeAgent","displayAgentHelp","console","log","listAgents","agents","length","grouped","agent","parts","split","category","name","slice","join","push","names","Object","entries","sort","agentCommand","agentType","options","list","help","memoryLimit","currentOptions","process","env","NODE_OPTIONS","newOptions","replace","enableProfiling","debug","includes","CLAUDE_DEBUG","CLAUDE_MEMORY_MONITORING","definition","type","model","tools","taskContext","taskId","iteration","agentId","context","mode","priority","parentTaskId","prompt","result","success","exitCode","error","exit","output","Error","message","String"],"mappings":"AAAA;;;;;CAKC,GAED,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,+BAA+B;AAC1F,SAASC,gBAAgB,QAAqB,4BAA4B;AAC1E,SAASC,YAAY,QAAQ,sBAAsB;AAiBnD;;CAEC,GACD,OAAO,SAASC;IACdC,QAAQC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Df,CAAC;AACD;AAEA;;CAEC,GACD,OAAO,eAAeC;IACpBF,QAAQC,GAAG,CAAC;IAEZ,MAAME,SAAS,MAAMP;IAErB,IAAIO,OAAOC,MAAM,KAAK,GAAG;QACvBJ,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZ;IACF;IAEAD,QAAQC,GAAG,CAAC,CAAC,MAAM,EAAEE,OAAOC,MAAM,CAAC,YAAY,CAAC;IAEhD,oBAAoB;IACpB,MAAMC,UAAoC,CAAC;IAE3C,KAAK,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