claude-flow-novice 2.15.10 → 2.16.0
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/commands/cfn-loop-cli.md +158 -464
- package/.claude/commands/cfn-loop-trigger.md +114 -0
- 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 +22 -0
- 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/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-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-assets/skills/cfn-loop-orchestration → .claude/skills/cfn-loop-orchestration/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-assets/skills/cfn-product-owner-decision → .claude/skills/cfn-product-owner-decision/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/CLAUDE.md +9 -81
- package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +4 -4
- package/claude-assets/agents/cfn-dev-team/architecture/planner.md +4 -4
- package/claude-assets/agents/cfn-dev-team/architecture/system-architect.md +5 -5
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +1 -0
- package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +1 -0
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +1 -0
- 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 +14 -4
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +63 -70
- package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +50 -70
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +13 -4
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +27 -58
- 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 +18 -20
- package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +19 -28
- 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 +15 -10
- package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +15 -25
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +17 -21
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +17 -21
- package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +4 -4
- package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +4 -4
- package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +4 -4
- package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +19 -27
- 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 +23 -67
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +14 -70
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +25 -73
- package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +26 -65
- package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +5 -5
- package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +27 -67
- package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +16 -73
- package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +27 -67
- package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +27 -60
- package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +15 -74
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +14 -60
- package/claude-assets/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +5 -5
- package/claude-assets/agents/cfn-dev-team/testers/validation/validation-production-validator.md +4 -4
- package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +4 -4
- package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +16 -16
- package/claude-assets/agents/cfn-dev-team/utility/analyst.md +16 -32
- package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +17 -17
- package/claude-assets/agents/cfn-dev-team/utility/context-curator.md +10 -5
- package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +12 -102
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +127 -814
- package/claude-assets/agents/cfn-dev-team/utility/researcher.md +16 -25
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +157 -667
- package/claude-assets/agents/custom/cfn-docker-expert.md +102 -0
- package/claude-assets/agents/custom/cfn-loops-cli-expert.md +129 -0
- package/claude-assets/cfn-extras/agents/cfn-v3-coordinator.md +517 -0
- package/claude-assets/commands/cfn-loop-cli.md +158 -464
- package/claude-assets/commands/cfn-loop-trigger.md +114 -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 +22 -0
- 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/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-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 +369 -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/src/ingest-dependencies.ts +563 -0
- 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/skills/cfn-loop-orchestration → claude-assets/skills/cfn-loop-orchestration/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/skills/cfn-product-owner-decision → claude-assets/skills/cfn-product-owner-decision/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 +192 -0
- package/claude-assets/skills/cfn-provider-routing/resolve-provider-model.ts +223 -0
- 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/agents/agent-loader.js +146 -165
- package/dist/agents/agent-loader.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-definition-parser.js +37 -4
- package/dist/cli/agent-definition-parser.js.map +1 -1
- package/dist/cli/agent-executor.js +32 -2
- 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-spawner.js +499 -0
- package/dist/cli/agent-spawner.js.map +1 -0
- package/dist/cli/anthropic-client.js +10 -3
- package/dist/cli/anthropic-client.js.map +1 -1
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.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/spawn-agent-cli.js +209 -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/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/path-validator.js +14 -5
- package/dist/lib/path-validator.js.map +1 -1
- package/dist/lib/redis-queue-manager.js +5 -1
- package/dist/lib/redis-queue-manager.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 +13 -4
- package/scripts/compare-workflow-performance.sh +556 -0
- package/scripts/migrate-to-optimized-workflows.sh +438 -0
- package/scripts/organize-docs.sh +338 -0
- package/scripts/trigger-dev-setup.sh +267 -0
- 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 -976
- package/claude-assets/agents/typescript-specialist.md +0 -280
- 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/.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,273 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Agent Completion CLI
|
|
4
|
+
*
|
|
5
|
+
* Signal agent completion with confidence score and test metrics
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* agent-completion --task-id <id> --agent-id <id> --confidence <score> [options]
|
|
9
|
+
*
|
|
10
|
+
* Required Arguments:
|
|
11
|
+
* --task-id <id> Task identifier
|
|
12
|
+
* --agent-id <id> Agent identifier
|
|
13
|
+
* --confidence <score> Confidence score (0.0-1.0)
|
|
14
|
+
*
|
|
15
|
+
* Optional Arguments:
|
|
16
|
+
* --iteration <n> Iteration number (default: 1)
|
|
17
|
+
* --namespace <ns> Namespace: swarm | cfn_loop (default: swarm)
|
|
18
|
+
* --test-pass-rate <pct> Test pass rate (0.0-1.0)
|
|
19
|
+
* --tests-run <n> Total tests run
|
|
20
|
+
* --tests-passed <n> Tests passed
|
|
21
|
+
* --result <json> Result JSON (test pass rate preferred)
|
|
22
|
+
* --redis-host <h> Redis host (default: localhost)
|
|
23
|
+
* --redis-port <p> Redis port (default: 6379)
|
|
24
|
+
* --json Output result as JSON
|
|
25
|
+
* --help Show this help message
|
|
26
|
+
*
|
|
27
|
+
* Examples:
|
|
28
|
+
* # Simple completion with confidence
|
|
29
|
+
* agent-completion \
|
|
30
|
+
* --task-id task123 \
|
|
31
|
+
* --agent-id agent-loop3-1 \
|
|
32
|
+
* --confidence 0.92
|
|
33
|
+
*
|
|
34
|
+
* # Completion with test metrics (test-driven)
|
|
35
|
+
* agent-completion \
|
|
36
|
+
* --task-id task123 \
|
|
37
|
+
* --agent-id agent-loop3-1 \
|
|
38
|
+
* --confidence 0.95 \
|
|
39
|
+
* --test-pass-rate 0.98 \
|
|
40
|
+
* --tests-run 50 \
|
|
41
|
+
* --tests-passed 49
|
|
42
|
+
*
|
|
43
|
+
* # Validator consensus score
|
|
44
|
+
* agent-completion \
|
|
45
|
+
* --task-id task123 \
|
|
46
|
+
* --agent-id validator-1 \
|
|
47
|
+
* --confidence 0.88 \
|
|
48
|
+
* --iteration 1
|
|
49
|
+
*/ import { CoordinationWrapper } from '../coordination/coordination-wrapper.js';
|
|
50
|
+
import * as process from 'process';
|
|
51
|
+
/**
|
|
52
|
+
* Parse command line arguments
|
|
53
|
+
*/ function parseArgs() {
|
|
54
|
+
const args = process.argv.slice(2);
|
|
55
|
+
const options = {
|
|
56
|
+
namespace: 'swarm',
|
|
57
|
+
iteration: 1,
|
|
58
|
+
redisHost: process.env.CFN_REDIS_HOST || process.env.REDIS_HOST || 'localhost',
|
|
59
|
+
redisPort: parseInt(process.env.CFN_REDIS_PORT || process.env.REDIS_PORT || '6379'),
|
|
60
|
+
json: false
|
|
61
|
+
};
|
|
62
|
+
for(let i = 0; i < args.length; i++){
|
|
63
|
+
const arg = args[i];
|
|
64
|
+
switch(arg){
|
|
65
|
+
case '--task-id':
|
|
66
|
+
options.taskId = args[++i];
|
|
67
|
+
break;
|
|
68
|
+
case '--agent-id':
|
|
69
|
+
options.agentId = args[++i];
|
|
70
|
+
break;
|
|
71
|
+
case '--confidence':
|
|
72
|
+
options.confidence = parseFloat(args[++i]);
|
|
73
|
+
break;
|
|
74
|
+
case '--iteration':
|
|
75
|
+
options.iteration = parseInt(args[++i]);
|
|
76
|
+
break;
|
|
77
|
+
case '--namespace':
|
|
78
|
+
options.namespace = args[++i];
|
|
79
|
+
break;
|
|
80
|
+
case '--test-pass-rate':
|
|
81
|
+
options.testPassRate = parseFloat(args[++i]);
|
|
82
|
+
break;
|
|
83
|
+
case '--tests-run':
|
|
84
|
+
options.testsRun = parseInt(args[++i]);
|
|
85
|
+
break;
|
|
86
|
+
case '--tests-passed':
|
|
87
|
+
options.testsPassed = parseInt(args[++i]);
|
|
88
|
+
break;
|
|
89
|
+
case '--result':
|
|
90
|
+
options.result = args[++i];
|
|
91
|
+
break;
|
|
92
|
+
case '--redis-host':
|
|
93
|
+
options.redisHost = args[++i];
|
|
94
|
+
break;
|
|
95
|
+
case '--redis-port':
|
|
96
|
+
options.redisPort = parseInt(args[++i]);
|
|
97
|
+
break;
|
|
98
|
+
case '--json':
|
|
99
|
+
options.json = true;
|
|
100
|
+
break;
|
|
101
|
+
case '--help':
|
|
102
|
+
case '-h':
|
|
103
|
+
options.help = true;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return options;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Show help message
|
|
111
|
+
*/ function showHelp() {
|
|
112
|
+
console.log(`
|
|
113
|
+
Agent Completion CLI - Signal agent completion with test metrics
|
|
114
|
+
|
|
115
|
+
Usage:
|
|
116
|
+
agent-completion --task-id <id> --agent-id <id> --confidence <score> [options]
|
|
117
|
+
|
|
118
|
+
Required Arguments:
|
|
119
|
+
--task-id <id> Task identifier
|
|
120
|
+
--agent-id <id> Agent identifier
|
|
121
|
+
--confidence <score> Confidence score (0.0-1.0)
|
|
122
|
+
|
|
123
|
+
Optional Arguments:
|
|
124
|
+
--iteration <n> Iteration number (default: 1)
|
|
125
|
+
--namespace <ns> Namespace: swarm | cfn_loop (default: swarm)
|
|
126
|
+
--test-pass-rate <pct> Test pass rate (0.0-1.0, preferred over confidence)
|
|
127
|
+
--tests-run <n> Total tests run
|
|
128
|
+
--tests-passed <n> Tests passed
|
|
129
|
+
--result <json> Result JSON (for custom data)
|
|
130
|
+
--redis-host <h> Redis host (default: localhost or CFN_REDIS_HOST env)
|
|
131
|
+
--redis-port <p> Redis port (default: 6379 or CFN_REDIS_PORT env)
|
|
132
|
+
--json Output result as JSON
|
|
133
|
+
--help, -h Show this help message
|
|
134
|
+
|
|
135
|
+
Examples:
|
|
136
|
+
# Simple completion with confidence
|
|
137
|
+
agent-completion \\
|
|
138
|
+
--task-id task123 \\
|
|
139
|
+
--agent-id agent-loop3-1 \\
|
|
140
|
+
--confidence 0.92
|
|
141
|
+
|
|
142
|
+
# Test-driven completion with metrics
|
|
143
|
+
agent-completion \\
|
|
144
|
+
--task-id task123 \\
|
|
145
|
+
--agent-id agent-loop3-1 \\
|
|
146
|
+
--confidence 0.95 \\
|
|
147
|
+
--test-pass-rate 0.98 \\
|
|
148
|
+
--tests-run 50 \\
|
|
149
|
+
--tests-passed 49
|
|
150
|
+
|
|
151
|
+
# Validator consensus
|
|
152
|
+
agent-completion \\
|
|
153
|
+
--task-id task123 \\
|
|
154
|
+
--agent-id validator-1 \\
|
|
155
|
+
--confidence 0.88 \\
|
|
156
|
+
--iteration 1 \\
|
|
157
|
+
--json
|
|
158
|
+
|
|
159
|
+
Environment Variables:
|
|
160
|
+
CFN_REDIS_HOST Redis host
|
|
161
|
+
CFN_REDIS_PORT Redis port
|
|
162
|
+
REDIS_HOST Fallback Redis host
|
|
163
|
+
REDIS_PORT Fallback Redis port
|
|
164
|
+
`);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Validate confidence score
|
|
168
|
+
*/ function validateConfidence(score) {
|
|
169
|
+
return typeof score === 'number' && score >= 0 && score <= 1;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Validate test pass rate
|
|
173
|
+
*/ function validateTestPassRate(rate) {
|
|
174
|
+
return typeof rate === 'number' && rate >= 0 && rate <= 1;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Main function
|
|
178
|
+
*/ async function main() {
|
|
179
|
+
const options = parseArgs();
|
|
180
|
+
if (options.help) {
|
|
181
|
+
showHelp();
|
|
182
|
+
process.exit(0);
|
|
183
|
+
}
|
|
184
|
+
// Validate required arguments
|
|
185
|
+
if (!options.taskId || !options.agentId || options.confidence === undefined) {
|
|
186
|
+
console.error('Error: Missing required arguments');
|
|
187
|
+
console.error('Use --help for usage information');
|
|
188
|
+
process.exit(1);
|
|
189
|
+
}
|
|
190
|
+
// Validate confidence score
|
|
191
|
+
if (!validateConfidence(options.confidence)) {
|
|
192
|
+
console.error('Error: Confidence score must be between 0.0 and 1.0');
|
|
193
|
+
process.exit(1);
|
|
194
|
+
}
|
|
195
|
+
// Validate test pass rate if provided
|
|
196
|
+
if (options.testPassRate !== undefined && !validateTestPassRate(options.testPassRate)) {
|
|
197
|
+
console.error('Error: Test pass rate must be between 0.0 and 1.0');
|
|
198
|
+
process.exit(1);
|
|
199
|
+
}
|
|
200
|
+
try {
|
|
201
|
+
// Create coordination wrapper
|
|
202
|
+
const coordinator = new CoordinationWrapper({
|
|
203
|
+
taskId: options.taskId,
|
|
204
|
+
namespace: options.namespace || 'swarm',
|
|
205
|
+
redisHost: options.redisHost || 'localhost',
|
|
206
|
+
redisPort: options.redisPort || 6379
|
|
207
|
+
});
|
|
208
|
+
// Connect to Redis
|
|
209
|
+
await coordinator.connect();
|
|
210
|
+
// Build result object
|
|
211
|
+
let resultObj;
|
|
212
|
+
if (options.result) {
|
|
213
|
+
try {
|
|
214
|
+
resultObj = JSON.parse(options.result);
|
|
215
|
+
} catch {
|
|
216
|
+
// If result is not valid JSON, store as string
|
|
217
|
+
resultObj = {
|
|
218
|
+
result: options.result
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// Signal completion
|
|
223
|
+
await coordinator.signalCompletion(options.agentId, options.confidence, {
|
|
224
|
+
testPassRate: options.testPassRate,
|
|
225
|
+
testsRun: options.testsRun,
|
|
226
|
+
testsPassed: options.testsPassed,
|
|
227
|
+
result: resultObj,
|
|
228
|
+
iteration: options.iteration
|
|
229
|
+
});
|
|
230
|
+
// Output result
|
|
231
|
+
const output = {
|
|
232
|
+
taskId: options.taskId,
|
|
233
|
+
agentId: options.agentId,
|
|
234
|
+
confidence: options.confidence,
|
|
235
|
+
testPassRate: options.testPassRate,
|
|
236
|
+
testsRun: options.testsRun,
|
|
237
|
+
testsPassed: options.testsPassed,
|
|
238
|
+
iteration: options.iteration,
|
|
239
|
+
timestamp: new Date().toISOString(),
|
|
240
|
+
status: 'success'
|
|
241
|
+
};
|
|
242
|
+
if (options.json) {
|
|
243
|
+
console.log(JSON.stringify(output, null, 2));
|
|
244
|
+
} else {
|
|
245
|
+
console.log(`Agent ${options.agentId} completion reported`);
|
|
246
|
+
console.log(`Confidence: ${(options.confidence * 100).toFixed(1)}%`);
|
|
247
|
+
if (options.testPassRate !== undefined) {
|
|
248
|
+
console.log(`Test Pass Rate: ${(options.testPassRate * 100).toFixed(1)}%`);
|
|
249
|
+
}
|
|
250
|
+
if (options.testsRun !== undefined && options.testsPassed !== undefined) {
|
|
251
|
+
console.log(`Tests: ${options.testsPassed}/${options.testsRun}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// Disconnect
|
|
255
|
+
await coordinator.disconnect();
|
|
256
|
+
process.exit(0);
|
|
257
|
+
} catch (error) {
|
|
258
|
+
console.error('Error reporting agent completion:', error);
|
|
259
|
+
if (options.json) {
|
|
260
|
+
console.log(JSON.stringify({
|
|
261
|
+
taskId: options.taskId,
|
|
262
|
+
agentId: options.agentId,
|
|
263
|
+
status: 'error',
|
|
264
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
265
|
+
}, null, 2));
|
|
266
|
+
}
|
|
267
|
+
process.exit(1);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
// Run main function
|
|
271
|
+
main();
|
|
272
|
+
|
|
273
|
+
//# sourceMappingURL=agent-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/agent-completion.ts"],"sourcesContent":["#!/usr/bin/env node\r\n\r\n/**\r\n * Agent Completion CLI\r\n *\r\n * Signal agent completion with confidence score and test metrics\r\n *\r\n * Usage:\r\n * agent-completion --task-id <id> --agent-id <id> --confidence <score> [options]\r\n *\r\n * Required Arguments:\r\n * --task-id <id> Task identifier\r\n * --agent-id <id> Agent identifier\r\n * --confidence <score> Confidence score (0.0-1.0)\r\n *\r\n * Optional Arguments:\r\n * --iteration <n> Iteration number (default: 1)\r\n * --namespace <ns> Namespace: swarm | cfn_loop (default: swarm)\r\n * --test-pass-rate <pct> Test pass rate (0.0-1.0)\r\n * --tests-run <n> Total tests run\r\n * --tests-passed <n> Tests passed\r\n * --result <json> Result JSON (test pass rate preferred)\r\n * --redis-host <h> Redis host (default: localhost)\r\n * --redis-port <p> Redis port (default: 6379)\r\n * --json Output result as JSON\r\n * --help Show this help message\r\n *\r\n * Examples:\r\n * # Simple completion with confidence\r\n * agent-completion \\\r\n * --task-id task123 \\\r\n * --agent-id agent-loop3-1 \\\r\n * --confidence 0.92\r\n *\r\n * # Completion with test metrics (test-driven)\r\n * agent-completion \\\r\n * --task-id task123 \\\r\n * --agent-id agent-loop3-1 \\\r\n * --confidence 0.95 \\\r\n * --test-pass-rate 0.98 \\\r\n * --tests-run 50 \\\r\n * --tests-passed 49\r\n *\r\n * # Validator consensus score\r\n * agent-completion \\\r\n * --task-id task123 \\\r\n * --agent-id validator-1 \\\r\n * --confidence 0.88 \\\r\n * --iteration 1\r\n */\r\n\r\nimport { CoordinationWrapper } from '../coordination/coordination-wrapper.js';\r\nimport * as process from 'process';\r\n\r\ninterface Options {\r\n taskId: string;\r\n agentId: string;\r\n confidence: number;\r\n iteration?: number;\r\n namespace?: 'swarm' | 'cfn_loop';\r\n testPassRate?: number;\r\n testsRun?: number;\r\n testsPassed?: number;\r\n result?: string;\r\n redisHost?: string;\r\n redisPort?: number;\r\n json?: boolean;\r\n help?: boolean;\r\n}\r\n\r\n/**\r\n * Parse command line arguments\r\n */\r\nfunction parseArgs(): Options {\r\n const args = process.argv.slice(2);\r\n const options: Partial<Options> = {\r\n namespace: 'swarm',\r\n iteration: 1,\r\n redisHost: process.env.CFN_REDIS_HOST || process.env.REDIS_HOST || 'localhost',\r\n redisPort: parseInt(process.env.CFN_REDIS_PORT || process.env.REDIS_PORT || '6379'),\r\n json: false\r\n };\r\n\r\n for (let i = 0; i < args.length; i++) {\r\n const arg = args[i];\r\n\r\n switch (arg) {\r\n case '--task-id':\r\n options.taskId = args[++i];\r\n break;\r\n case '--agent-id':\r\n options.agentId = args[++i];\r\n break;\r\n case '--confidence':\r\n options.confidence = parseFloat(args[++i]);\r\n break;\r\n case '--iteration':\r\n options.iteration = parseInt(args[++i]);\r\n break;\r\n case '--namespace':\r\n options.namespace = args[++i] as 'swarm' | 'cfn_loop';\r\n break;\r\n case '--test-pass-rate':\r\n options.testPassRate = parseFloat(args[++i]);\r\n break;\r\n case '--tests-run':\r\n options.testsRun = parseInt(args[++i]);\r\n break;\r\n case '--tests-passed':\r\n options.testsPassed = parseInt(args[++i]);\r\n break;\r\n case '--result':\r\n options.result = args[++i];\r\n break;\r\n case '--redis-host':\r\n options.redisHost = args[++i];\r\n break;\r\n case '--redis-port':\r\n options.redisPort = parseInt(args[++i]);\r\n break;\r\n case '--json':\r\n options.json = true;\r\n break;\r\n case '--help':\r\n case '-h':\r\n options.help = true;\r\n break;\r\n }\r\n }\r\n\r\n return options as Options;\r\n}\r\n\r\n/**\r\n * Show help message\r\n */\r\nfunction showHelp(): void {\r\n console.log(`\r\nAgent Completion CLI - Signal agent completion with test metrics\r\n\r\nUsage:\r\n agent-completion --task-id <id> --agent-id <id> --confidence <score> [options]\r\n\r\nRequired Arguments:\r\n --task-id <id> Task identifier\r\n --agent-id <id> Agent identifier\r\n --confidence <score> Confidence score (0.0-1.0)\r\n\r\nOptional Arguments:\r\n --iteration <n> Iteration number (default: 1)\r\n --namespace <ns> Namespace: swarm | cfn_loop (default: swarm)\r\n --test-pass-rate <pct> Test pass rate (0.0-1.0, preferred over confidence)\r\n --tests-run <n> Total tests run\r\n --tests-passed <n> Tests passed\r\n --result <json> Result JSON (for custom data)\r\n --redis-host <h> Redis host (default: localhost or CFN_REDIS_HOST env)\r\n --redis-port <p> Redis port (default: 6379 or CFN_REDIS_PORT env)\r\n --json Output result as JSON\r\n --help, -h Show this help message\r\n\r\nExamples:\r\n # Simple completion with confidence\r\n agent-completion \\\\\r\n --task-id task123 \\\\\r\n --agent-id agent-loop3-1 \\\\\r\n --confidence 0.92\r\n\r\n # Test-driven completion with metrics\r\n agent-completion \\\\\r\n --task-id task123 \\\\\r\n --agent-id agent-loop3-1 \\\\\r\n --confidence 0.95 \\\\\r\n --test-pass-rate 0.98 \\\\\r\n --tests-run 50 \\\\\r\n --tests-passed 49\r\n\r\n # Validator consensus\r\n agent-completion \\\\\r\n --task-id task123 \\\\\r\n --agent-id validator-1 \\\\\r\n --confidence 0.88 \\\\\r\n --iteration 1 \\\\\r\n --json\r\n\r\nEnvironment Variables:\r\n CFN_REDIS_HOST Redis host\r\n CFN_REDIS_PORT Redis port\r\n REDIS_HOST Fallback Redis host\r\n REDIS_PORT Fallback Redis port\r\n`);\r\n}\r\n\r\n/**\r\n * Validate confidence score\r\n */\r\nfunction validateConfidence(score: number): boolean {\r\n return typeof score === 'number' && score >= 0 && score <= 1;\r\n}\r\n\r\n/**\r\n * Validate test pass rate\r\n */\r\nfunction validateTestPassRate(rate: number): boolean {\r\n return typeof rate === 'number' && rate >= 0 && rate <= 1;\r\n}\r\n\r\n/**\r\n * Main function\r\n */\r\nasync function main(): Promise<void> {\r\n const options = parseArgs();\r\n\r\n if (options.help) {\r\n showHelp();\r\n process.exit(0);\r\n }\r\n\r\n // Validate required arguments\r\n if (!options.taskId || !options.agentId || options.confidence === undefined) {\r\n console.error('Error: Missing required arguments');\r\n console.error('Use --help for usage information');\r\n process.exit(1);\r\n }\r\n\r\n // Validate confidence score\r\n if (!validateConfidence(options.confidence)) {\r\n console.error('Error: Confidence score must be between 0.0 and 1.0');\r\n process.exit(1);\r\n }\r\n\r\n // Validate test pass rate if provided\r\n if (options.testPassRate !== undefined && !validateTestPassRate(options.testPassRate)) {\r\n console.error('Error: Test pass rate must be between 0.0 and 1.0');\r\n process.exit(1);\r\n }\r\n\r\n try {\r\n // Create coordination wrapper\r\n const coordinator = new CoordinationWrapper({\r\n taskId: options.taskId,\r\n namespace: options.namespace || 'swarm',\r\n redisHost: options.redisHost || 'localhost',\r\n redisPort: options.redisPort || 6379\r\n });\r\n\r\n // Connect to Redis\r\n await coordinator.connect();\r\n\r\n // Build result object\r\n let resultObj: Record<string, unknown> | undefined;\r\n if (options.result) {\r\n try {\r\n resultObj = JSON.parse(options.result);\r\n } catch {\r\n // If result is not valid JSON, store as string\r\n resultObj = { result: options.result };\r\n }\r\n }\r\n\r\n // Signal completion\r\n await coordinator.signalCompletion(options.agentId, options.confidence, {\r\n testPassRate: options.testPassRate,\r\n testsRun: options.testsRun,\r\n testsPassed: options.testsPassed,\r\n result: resultObj,\r\n iteration: options.iteration\r\n });\r\n\r\n // Output result\r\n const output = {\r\n taskId: options.taskId,\r\n agentId: options.agentId,\r\n confidence: options.confidence,\r\n testPassRate: options.testPassRate,\r\n testsRun: options.testsRun,\r\n testsPassed: options.testsPassed,\r\n iteration: options.iteration,\r\n timestamp: new Date().toISOString(),\r\n status: 'success'\r\n };\r\n\r\n if (options.json) {\r\n console.log(JSON.stringify(output, null, 2));\r\n } else {\r\n console.log(`Agent ${options.agentId} completion reported`);\r\n console.log(`Confidence: ${(options.confidence * 100).toFixed(1)}%`);\r\n if (options.testPassRate !== undefined) {\r\n console.log(`Test Pass Rate: ${(options.testPassRate * 100).toFixed(1)}%`);\r\n }\r\n if (options.testsRun !== undefined && options.testsPassed !== undefined) {\r\n console.log(`Tests: ${options.testsPassed}/${options.testsRun}`);\r\n }\r\n }\r\n\r\n // Disconnect\r\n await coordinator.disconnect();\r\n\r\n process.exit(0);\r\n } catch (error) {\r\n console.error('Error reporting agent completion:', error);\r\n if (options.json) {\r\n console.log(\r\n JSON.stringify({\r\n taskId: options.taskId,\r\n agentId: options.agentId,\r\n status: 'error',\r\n error: error instanceof Error ? error.message : 'Unknown error'\r\n }, null, 2)\r\n );\r\n }\r\n process.exit(1);\r\n }\r\n}\r\n\r\n// Run main function\r\nmain();\r\n"],"names":["CoordinationWrapper","process","parseArgs","args","argv","slice","options","namespace","iteration","redisHost","env","CFN_REDIS_HOST","REDIS_HOST","redisPort","parseInt","CFN_REDIS_PORT","REDIS_PORT","json","i","length","arg","taskId","agentId","confidence","parseFloat","testPassRate","testsRun","testsPassed","result","help","showHelp","console","log","validateConfidence","score","validateTestPassRate","rate","main","exit","undefined","error","coordinator","connect","resultObj","JSON","parse","signalCompletion","output","timestamp","Date","toISOString","status","stringify","toFixed","disconnect","Error","message"],"mapp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AAY,EAAE,AAAC1B,CAAAA,QAAQiB,UAAU,GAAG,GAAE,EAAG8B,OAAO,CAAC,GAAG,CAAC,CAAC;YACnE,IAAI/C,QAAQmB,YAAY,KAAKc,WAAW;gBACtCR,QAAQC,GAAG,CAAC,CAAC,gBAAgB,EAAE,AAAC1B,CAAAA,QAAQmB,YAAY,GAAG,GAAE,EAAG4B,OAAO,CAAC,GAAG,CAAC,CAAC;YAC3E;YACA,IAAI/C,QAAQoB,QAAQ,KAAKa,aAAajC,QAAQqB,WAAW,KAAKY,WAAW;gBACvER,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAE1B,QAAQqB,WAAW,CAAC,CAAC,EAAErB,QAAQoB,QAAQ,EAAE;YACjE;QACF;QAEA,aAAa;QACb,MAAMe,YAAYa,UAAU;QAE5BrD,QAAQqC,IAAI,CAAC;IACf,EAAE,OAAOE,OAAO;QACdT,QAAQS,KAAK,CAAC,qCAAqCA;QACnD,IAAIlC,QAAQW,IAAI,EAAE;YAChBc,QAAQC,GAAG,CACTY,KAAKQ,SAAS,CAAC;gBACb/B,QAAQf,QAAQe,MAAM;gBACtBC,SAAShB,QAAQgB,OAAO;gBACxB6B,QAAQ;gBACRX,OAAOA,iBAAiBe,QAAQf,MAAMgB,OAAO,GAAG;YAClD,GAAG,MAAM;QAEb;QACAvD,QAAQqC,IAAI,CAAC;IACf;AACF;AAEA,oBAAoB;AACpBD"}
|
|
@@ -7,9 +7,39 @@
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
9
9
|
import { glob } from 'glob';
|
|
10
|
+
import { execSync } from 'child_process';
|
|
10
11
|
// ES Module compatibility
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = path.dirname(__filename);
|
|
14
|
+
/**
|
|
15
|
+
* Detect project root dynamically
|
|
16
|
+
* Uses PROJECT_ROOT env var if set, otherwise tries git, falls back to cwd
|
|
17
|
+
*/ function getProjectRoot() {
|
|
18
|
+
// 1. Check environment variable
|
|
19
|
+
if (process.env.PROJECT_ROOT) {
|
|
20
|
+
return process.env.PROJECT_ROOT;
|
|
21
|
+
}
|
|
22
|
+
// 2. Try git rev-parse (most reliable)
|
|
23
|
+
try {
|
|
24
|
+
const gitRoot = execSync('git rev-parse --show-toplevel', {
|
|
25
|
+
encoding: 'utf-8',
|
|
26
|
+
cwd: process.cwd(),
|
|
27
|
+
stdio: [
|
|
28
|
+
'pipe',
|
|
29
|
+
'pipe',
|
|
30
|
+
'ignore'
|
|
31
|
+
]
|
|
32
|
+
}).trim();
|
|
33
|
+
if (gitRoot) {
|
|
34
|
+
return gitRoot;
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
// Fall through to next method
|
|
38
|
+
}
|
|
39
|
+
// 3. Fall back to current working directory
|
|
40
|
+
return process.cwd();
|
|
41
|
+
}
|
|
42
|
+
const projectRoot = getProjectRoot();
|
|
13
43
|
/**
|
|
14
44
|
* Parse YAML frontmatter from markdown content
|
|
15
45
|
* Supports both Unix (LF) and Windows (CRLF) line endings
|
|
@@ -111,13 +141,15 @@ const __dirname = path.dirname(__filename);
|
|
|
111
141
|
/**
|
|
112
142
|
* Find agent definition file by agent type/name
|
|
113
143
|
* Searches multiple locations for agent definitions
|
|
114
|
-
*/ async function findAgentFile(agentType, baseDir
|
|
144
|
+
*/ async function findAgentFile(agentType, baseDir) {
|
|
115
145
|
// Normalize agent type (handle both kebab-case and underscores)
|
|
116
146
|
const normalizedType = agentType.toLowerCase().replace(/_/g, '-');
|
|
117
147
|
// Search locations (in order of priority)
|
|
148
|
+
// Use provided baseDir, or construct default path from project root
|
|
149
|
+
const defaultBaseDir = path.join(projectRoot, '.claude/agents');
|
|
118
150
|
const searchLocations = [
|
|
119
|
-
baseDir,
|
|
120
|
-
|
|
151
|
+
baseDir || defaultBaseDir,
|
|
152
|
+
defaultBaseDir,
|
|
121
153
|
path.join(__dirname, '../../.claude/agents'),
|
|
122
154
|
'/app/.claude/agents'
|
|
123
155
|
];
|
|
@@ -164,7 +196,8 @@ const __dirname = path.dirname(__filename);
|
|
|
164
196
|
// Parse frontmatter and body
|
|
165
197
|
const { frontmatter, body } = parseFrontmatter(content);
|
|
166
198
|
// Extract category from path
|
|
167
|
-
const
|
|
199
|
+
const agentsPath = path.join(projectRoot, '.claude/agents');
|
|
200
|
+
const relativePath = path.relative(agentsPath, filePath);
|
|
168
201
|
const category = relativePath.includes('/') ? relativePath.split('/')[0] : undefined;
|
|
169
202
|
// Build agent definition
|
|
170
203
|
const definition = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/agent-definition-parser.ts"],"sourcesContent":["/**\r\n * Agent Definition Parser\r\n *\r\n * Parses agent definition files (.md) with YAML frontmatter and markdown content.\r\n * Supports agent definitions in .claude/agents/ directory structure.\r\n */\r\n\r\nimport fs from 'fs/promises';\r\nimport path from 'path';\r\nimport { fileURLToPath } from 'url';\r\nimport { glob } from 'glob';\r\n\r\n// ES Module compatibility\r\nconst __filename = fileURLToPath(import.meta.url);\r\nconst __dirname = path.dirname(__filename);\r\n\r\nexport interface AgentDefinition {\r\n // YAML frontmatter fields\r\n name: string;\r\n description: string;\r\n tools: string[];\r\n model: 'haiku' | 'sonnet' | 'opus';\r\n type?: string;\r\n color?: string;\r\n acl_level?: number;\r\n capabilities?: string[];\r\n validation_hooks?: string[];\r\n lifecycle?: {\r\n pre_task?: string;\r\n post_task?: string;\r\n };\r\n\r\n // Parsed markdown content\r\n content: string;\r\n\r\n // File metadata\r\n filePath: string;\r\n category?: string; // e.g., 'core-agents', 'specialized', 'custom'\r\n}\r\n\r\n/**\r\n * Parse YAML frontmatter from markdown content\r\n * Supports both Unix (LF) and Windows (CRLF) line endings\r\n */\r\nfunction parseFrontmatter(content: string): { frontmatter: Record<string, any>; body: string } {\r\n const frontmatterRegex = /^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n([\\s\\S]*)$/;\r\n const match = content.match(frontmatterRegex);\r\n\r\n if (!match) {\r\n return { frontmatter: {}, body: content };\r\n }\r\n\r\n const [, yamlContent, body] = match;\r\n\r\n \r\n // Simple YAML parser (handles basic key-value pairs, arrays, and objects)\r\n const frontmatter: Record<string, any> = {};\r\n const lines = yamlContent.split('\\n');\r\n let currentKey = '';\r\n let currentArray: string[] = [];\r\n let isInArray = false;\r\n let isInObject = false;\r\n let currentObject: Record<string, string> = {};\r\n let objectKey = '';\r\n\r\n for (const line of lines) {\r\n const trimmed = line.trim();\r\n if (!trimmed || trimmed.startsWith('#')) continue;\r\n\r\n // Array item\r\n if (trimmed.startsWith('- ')) {\r\n if (!isInArray) {\r\n isInArray = true;\r\n currentArray = [];\r\n }\r\n currentArray.push(trimmed.substring(2).trim());\r\n continue;\r\n }\r\n\r\n // End of array\r\n if (isInArray && !trimmed.startsWith('- ')) {\r\n frontmatter[currentKey] = currentArray;\r\n isInArray = false;\r\n currentArray = [];\r\n }\r\n\r\n // Object field (indented key-value)\r\n if (trimmed.match(/^\\s+\\w+:/) && isInObject) {\r\n const [objKey, ...objValueParts] = trimmed.split(':');\r\n const objValue = objValueParts.join(':').trim().replace(/^[\"']|[\"']$/g, '');\r\n currentObject[objKey.trim()] = objValue;\r\n continue;\r\n }\r\n\r\n // Key-value pair\r\n const colonIndex = trimmed.indexOf(':');\r\n if (colonIndex !== -1) {\r\n const key = trimmed.substring(0, colonIndex).trim();\r\n const value = trimmed.substring(colonIndex + 1).trim();\r\n\r\n // Check if this starts an object\r\n if (value === '') {\r\n isInObject = true;\r\n currentObject = {};\r\n objectKey = key;\r\n continue;\r\n }\r\n\r\n // End previous object if any\r\n if (isInObject && !trimmed.match(/^\\s+/)) {\r\n frontmatter[objectKey] = currentObject;\r\n isInObject = false;\r\n currentObject = {};\r\n }\r\n\r\n currentKey = key;\r\n\r\n // Multi-line string (starts with |)\r\n if (value === '|') {\r\n continue; // Will be handled by next lines\r\n }\r\n\r\n // Inline array (e.g., [item1, item2, item3])\r\n if (value.startsWith('[') && value.endsWith(']')) {\r\n const arrayContent = value.substring(1, value.length - 1);\r\n const items = arrayContent.split(',').map(item => item.trim());\r\n frontmatter[key] = items;\r\n continue;\r\n }\r\n\r\n // Remove quotes\r\n const cleanValue = value.replace(/^[\"']|[\"']$/g, '');\r\n frontmatter[key] = cleanValue;\r\n } else if (currentKey && trimmed && !isInArray && !isInObject) {\r\n // Continuation of multi-line string\r\n const existingValue = frontmatter[currentKey];\r\n frontmatter[currentKey] = existingValue\r\n ? `${existingValue}\\n${trimmed}`\r\n : trimmed;\r\n }\r\n }\r\n\r\n // Handle trailing array or object\r\n if (isInArray) {\r\n frontmatter[currentKey] = currentArray;\r\n }\r\n if (isInObject) {\r\n frontmatter[objectKey] = currentObject;\r\n }\r\n\r\n return { frontmatter, body: body.trim() };\r\n}\r\n\r\n/**\r\n * Find agent definition file by agent type/name\r\n * Searches multiple locations for agent definitions\r\n */\r\nasync function findAgentFile(agentType: string, baseDir: string = '.claude/agents'): Promise<string | null> {\r\n // Normalize agent type (handle both kebab-case and underscores)\r\n const normalizedType = agentType.toLowerCase().replace(/_/g, '-');\r\n\r\n // Search locations (in order of priority)\r\n const searchLocations = [\r\n baseDir, // Current working directory\r\n '.claude/agents', // Standard location\r\n path.join(__dirname, '../../.claude/agents'), // CLI installation directory\r\n '/app/.claude/agents', // Docker container location\r\n ];\r\n\r\n // Search patterns (in order of priority)\r\n const searchPatterns = [\r\n // Exact match in any subdirectory\r\n (loc: string) => `${loc}/**/${normalizedType}.md`,\r\n // Match with different casing\r\n (loc: string) => `${loc}/**/*${normalizedType}*.md`,\r\n ];\r\n\r\n for (const location of searchLocations) {\r\n for (const patternFn of searchPatterns) {\r\n const pattern = patternFn(location);\r\n try {\r\n const files = await glob(pattern, { nodir: true, absolute: true });\r\n if (files.length > 0) {\r\n // Prefer exact match over partial match\r\n const exactMatch = files.find(f => {\r\n const basename = path.basename(f, '.md').toLowerCase();\r\n return basename === normalizedType;\r\n });\r\n return exactMatch || files[0];\r\n }\r\n } catch (error) {\r\n // Skip location if it doesn't exist\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Parse agent definition from file\r\n */\r\nexport async function parseAgentDefinition(agentType: string): Promise<AgentDefinition> {\r\n // Find agent file\r\n const filePath = await findAgentFile(agentType);\r\n\r\n if (!filePath) {\r\n throw new Error(`Agent definition not found: ${agentType}`);\r\n }\r\n\r\n // Read file content\r\n const content = await fs.readFile(filePath, 'utf-8');\r\n\r\n \r\n // Parse frontmatter and body\r\n const { frontmatter, body } = parseFrontmatter(content);\r\n\r\n // Extract category from path\r\n const relativePath = path.relative('.claude/agents', filePath);\r\n const category = relativePath.includes('/')\r\n ? relativePath.split('/')[0]\r\n : undefined;\r\n\r\n \r\n // Build agent definition\r\n const definition: AgentDefinition = {\r\n name: frontmatter.name || agentType,\r\n description: frontmatter.description || '',\r\n tools: Array.isArray(frontmatter.tools) ? frontmatter.tools : [],\r\n model: frontmatter.model || 'haiku',\r\n type: frontmatter.type,\r\n color: frontmatter.color,\r\n acl_level: frontmatter.acl_level ? parseInt(String(frontmatter.acl_level), 10) : undefined,\r\n capabilities: frontmatter.capabilities,\r\n validation_hooks: frontmatter.validation_hooks,\r\n lifecycle: frontmatter.lifecycle,\r\n content: body,\r\n filePath,\r\n category,\r\n };\r\n\r\n return definition;\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgentDefinitions(baseDir: string = '.claude/agents'): Promise<string[]> {\r\n const pattern = `${baseDir}/**/*.md`;\r\n const files = await glob(pattern, { nodir: true });\r\n\r\n return files.map(f => path.basename(f, '.md'));\r\n}\r\n\r\n/**\r\n * Check if agent definition includes CFN Loop protocol\r\n */\r\nexport function hasCFNLoopProtocol(definition: AgentDefinition): boolean {\r\n const content = definition.content.toLowerCase();\r\n return (\r\n content.includes('cfn loop') &&\r\n content.includes('redis completion protocol') ||\r\n content.includes('invoke-waiting-mode.sh')\r\n );\r\n}\r\n"],"names":["fs","path","fileURLToPath","glob","__filename","url","__dirname","dirname","parseFrontmatter","content","frontmatterRegex","match","frontmatter","body","yamlContent","lines","split","currentKey","currentArray","isInArray","isInObject","currentObject","objectKey","line","trimmed","trim","startsWith","push","substring","objKey","objValueParts","objValue","join","replace","colonIndex","indexOf","key","value","endsWith","arrayContent","length","items","map","item","cleanValue","existingValue","findAgentFile","agentType","baseDir","normalizedType","toLowerCase","searchLocations","searchPatterns","loc","location","patternFn","pattern","files","nodir","absolute","exactMatch","find","f","basename","error","parseAgentDefinition","filePath","Error","readFile","relativePath","relative","category","includes","undefined","definition","name","description","tools","Array","isArray","model","type","color","acl_level","parseInt","String","capabilities","validation_hooks","lifecycle","listAgentDefinitions","hasCFNLoopProtocol"],"mappings":"AAAA;;;;;CAKC,GAED,OAAOA,QAAQ,cAAc;AAC7B,OAAOC,UAAU,OAAO;AACxB,SAASC,aAAa,QAAQ,MAAM;AACpC,SAASC,IAAI,QAAQ,OAAO;AAE5B,0BAA0B;AAC1B,MAAMC,aAAaF,cAAc,YAAYG,GAAG;AAChD,MAAMC,YAAYL,KAAKM,OAAO,CAACH;AA0B/B;;;CAGC,GACD,SAASI,iBAAiBC,OAAe;IACvC,MAAMC,mBAAmB;IACzB,MAAMC,QAAQF,QAAQE,KAAK,CAACD;IAE5B,IAAI,CAACC,OAAO;QACV,OAAO;YAAEC,aAAa,CAAC;YAAGC,MAAMJ;QAAQ;IAC1C;IAEA,MAAM,GAAGK,aAAaD,KAAK,GAAGF;IAG9B,0EAA0E;IAC1E,MAAMC,cAAmC,CAAC;IAC1C,MAAMG,QAAQD,YAAYE,KAAK,CAAC;IAChC,IAAIC,aAAa;IACjB,IAAIC,eAAyB,EAAE;IAC/B,IAAIC,YAAY;IAChB,IAAIC,aAAa;IACjB,IAAIC,gBAAwC,CAAC;IAC7C,IAAIC,YAAY;IAEhB,KAAK,MAAMC,QAAQR,MAAO;QACxB,MAAMS,UAAUD,KAAKE,IAAI;QACzB,IAAI,CAACD,WAAWA,QA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,GAAGC,SAASC,OAAOzE,YAAYuE,SAAS,GAAG,MAAMV;QACjFa,cAAc1E,YAAY0E,YAAY;QACtCC,kBAAkB3E,YAAY2E,gBAAgB;QAC9CC,WAAW5E,YAAY4E,SAAS;QAChC/E,SAASI;QACTqD;QACAK;IACF;IAEA,OAAOG;AACT;AAEA;;CAEC,GACD,OAAO,eAAee,qBAAqBzC,UAAkB,gBAAgB;IAC3E,MAAMQ,UAAU,GAAGR,QAAQ,QAAQ,CAAC;IACpC,MAAMS,QAAQ,MAAMtD,KAAKqD,SAAS;QAAEE,OAAO;IAAK;IAEhD,OAAOD,MAAMf,GAAG,CAACoB,CAAAA,IAAK7D,KAAK8D,QAAQ,CAACD,GAAG;AACzC;AAEA;;CAEC,GACD,OAAO,SAAS4B,mBAAmBhB,UAA2B;IAC5D,MAAMjE,UAAUiE,WAAWjE,OAAO,CAACyC,WAAW;IAC9C,OACEzC,QAAQ+D,QAAQ,CAAC,eACjB/D,QAAQ+D,QAAQ,CAAC,gCACjB/D,QAAQ+D,QAAQ,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/agent-definition-parser.ts"],"sourcesContent":["/**\r\n * Agent Definition Parser\r\n *\r\n * Parses agent definition files (.md) with YAML frontmatter and markdown content.\r\n * Supports agent definitions in .claude/agents/ directory structure.\r\n */\r\n\r\nimport fs from 'fs/promises';\r\nimport path from 'path';\r\nimport { fileURLToPath } from 'url';\r\nimport { glob } from 'glob';\r\nimport { execSync } from 'child_process';\r\n\r\n// ES Module compatibility\r\nconst __filename = fileURLToPath(import.meta.url);\r\nconst __dirname = path.dirname(__filename);\r\n\r\n/**\r\n * Detect project root dynamically\r\n * Uses PROJECT_ROOT env var if set, otherwise tries git, falls back to cwd\r\n */\r\nfunction getProjectRoot(): string {\r\n // 1. Check environment variable\r\n if (process.env.PROJECT_ROOT) {\r\n return process.env.PROJECT_ROOT;\r\n }\r\n\r\n // 2. Try git rev-parse (most reliable)\r\n try {\r\n const gitRoot = execSync('git rev-parse --show-toplevel', {\r\n encoding: 'utf-8',\r\n cwd: process.cwd(),\r\n stdio: ['pipe', 'pipe', 'ignore']\r\n }).trim();\r\n if (gitRoot) {\r\n return gitRoot;\r\n }\r\n } catch {\r\n // Fall through to next method\r\n }\r\n\r\n // 3. Fall back to current working directory\r\n return process.cwd();\r\n}\r\n\r\nconst projectRoot = getProjectRoot();\r\n\r\nexport interface AgentDefinition {\r\n // YAML frontmatter fields\r\n name: string;\r\n description: string;\r\n tools: string[];\r\n model: 'haiku' | 'sonnet' | 'opus';\r\n type?: string;\r\n color?: string;\r\n acl_level?: number;\r\n capabilities?: string[];\r\n validation_hooks?: string[];\r\n lifecycle?: {\r\n pre_task?: string;\r\n post_task?: string;\r\n };\r\n\r\n // Parsed markdown content\r\n content: string;\r\n\r\n // File metadata\r\n filePath: string;\r\n category?: string; // e.g., 'core-agents', 'specialized', 'custom'\r\n}\r\n\r\n/**\r\n * Parse YAML frontmatter from markdown content\r\n * Supports both Unix (LF) and Windows (CRLF) line endings\r\n */\r\nfunction parseFrontmatter(content: string): { frontmatter: Record<string, any>; body: string } {\r\n const frontmatterRegex = /^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n([\\s\\S]*)$/;\r\n const match = content.match(frontmatterRegex);\r\n\r\n if (!match) {\r\n return { frontmatter: {}, body: content };\r\n }\r\n\r\n const [, yamlContent, body] = match;\r\n\r\n \r\n // Simple YAML parser (handles basic key-value pairs, arrays, and objects)\r\n const frontmatter: Record<string, any> = {};\r\n const lines = yamlContent.split('\\n');\r\n let currentKey = '';\r\n let currentArray: string[] = [];\r\n let isInArray = false;\r\n let isInObject = false;\r\n let currentObject: Record<string, string> = {};\r\n let objectKey = '';\r\n\r\n for (const line of lines) {\r\n const trimmed = line.trim();\r\n if (!trimmed || trimmed.startsWith('#')) continue;\r\n\r\n // Array item\r\n if (trimmed.startsWith('- ')) {\r\n if (!isInArray) {\r\n isInArray = true;\r\n currentArray = [];\r\n }\r\n currentArray.push(trimmed.substring(2).trim());\r\n continue;\r\n }\r\n\r\n // End of array\r\n if (isInArray && !trimmed.startsWith('- ')) {\r\n frontmatter[currentKey] = currentArray;\r\n isInArray = false;\r\n currentArray = [];\r\n }\r\n\r\n // Object field (indented key-value)\r\n if (trimmed.match(/^\\s+\\w+:/) && isInObject) {\r\n const [objKey, ...objValueParts] = trimmed.split(':');\r\n const objValue = objValueParts.join(':').trim().replace(/^[\"']|[\"']$/g, '');\r\n currentObject[objKey.trim()] = objValue;\r\n continue;\r\n }\r\n\r\n // Key-value pair\r\n const colonIndex = trimmed.indexOf(':');\r\n if (colonIndex !== -1) {\r\n const key = trimmed.substring(0, colonIndex).trim();\r\n const value = trimmed.substring(colonIndex + 1).trim();\r\n\r\n // Check if this starts an object\r\n if (value === '') {\r\n isInObject = true;\r\n currentObject = {};\r\n objectKey = key;\r\n continue;\r\n }\r\n\r\n // End previous object if any\r\n if (isInObject && !trimmed.match(/^\\s+/)) {\r\n frontmatter[objectKey] = currentObject;\r\n isInObject = false;\r\n currentObject = {};\r\n }\r\n\r\n currentKey = key;\r\n\r\n // Multi-line string (starts with |)\r\n if (value === '|') {\r\n continue; // Will be handled by next lines\r\n }\r\n\r\n // Inline array (e.g., [item1, item2, item3])\r\n if (value.startsWith('[') && value.endsWith(']')) {\r\n const arrayContent = value.substring(1, value.length - 1);\r\n const items = arrayContent.split(',').map(item => item.trim());\r\n frontmatter[key] = items;\r\n continue;\r\n }\r\n\r\n // Remove quotes\r\n const cleanValue = value.replace(/^[\"']|[\"']$/g, '');\r\n frontmatter[key] = cleanValue;\r\n } else if (currentKey && trimmed && !isInArray && !isInObject) {\r\n // Continuation of multi-line string\r\n const existingValue = frontmatter[currentKey];\r\n frontmatter[currentKey] = existingValue\r\n ? `${existingValue}\\n${trimmed}`\r\n : trimmed;\r\n }\r\n }\r\n\r\n // Handle trailing array or object\r\n if (isInArray) {\r\n frontmatter[currentKey] = currentArray;\r\n }\r\n if (isInObject) {\r\n frontmatter[objectKey] = currentObject;\r\n }\r\n\r\n return { frontmatter, body: body.trim() };\r\n}\r\n\r\n/**\r\n * Find agent definition file by agent type/name\r\n * Searches multiple locations for agent definitions\r\n */\r\nasync function findAgentFile(agentType: string, baseDir?: string): Promise<string | null> {\r\n // Normalize agent type (handle both kebab-case and underscores)\r\n const normalizedType = agentType.toLowerCase().replace(/_/g, '-');\r\n\r\n // Search locations (in order of priority)\r\n // Use provided baseDir, or construct default path from project root\r\n const defaultBaseDir = path.join(projectRoot, '.claude/agents');\r\n const searchLocations = [\r\n baseDir || defaultBaseDir, // Provided or default working directory\r\n defaultBaseDir, // Standard location relative to project root\r\n path.join(__dirname, '../../.claude/agents'), // CLI installation directory\r\n '/app/.claude/agents', // Docker container location\r\n ];\r\n\r\n // Search patterns (in order of priority)\r\n const searchPatterns = [\r\n // Exact match in any subdirectory\r\n (loc: string) => `${loc}/**/${normalizedType}.md`,\r\n // Match with different casing\r\n (loc: string) => `${loc}/**/*${normalizedType}*.md`,\r\n ];\r\n\r\n for (const location of searchLocations) {\r\n for (const patternFn of searchPatterns) {\r\n const pattern = patternFn(location);\r\n try {\r\n const files = await glob(pattern, { nodir: true, absolute: true });\r\n if (files.length > 0) {\r\n // Prefer exact match over partial match\r\n const exactMatch = files.find(f => {\r\n const basename = path.basename(f, '.md').toLowerCase();\r\n return basename === normalizedType;\r\n });\r\n return exactMatch || files[0];\r\n }\r\n } catch (error) {\r\n // Skip location if it doesn't exist\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Parse agent definition from file\r\n */\r\nexport async function parseAgentDefinition(agentType: string): Promise<AgentDefinition> {\r\n // Find agent file\r\n const filePath = await findAgentFile(agentType);\r\n\r\n if (!filePath) {\r\n throw new Error(`Agent definition not found: ${agentType}`);\r\n }\r\n\r\n // Read file content\r\n const content = await fs.readFile(filePath, 'utf-8');\r\n\r\n \r\n // Parse frontmatter and body\r\n const { frontmatter, body } = parseFrontmatter(content);\r\n\r\n // Extract category from path\r\n const agentsPath = path.join(projectRoot, '.claude/agents');\r\n const relativePath = path.relative(agentsPath, filePath);\r\n const category = relativePath.includes('/')\r\n ? relativePath.split('/')[0]\r\n : undefined;\r\n\r\n \r\n // Build agent definition\r\n const definition: AgentDefinition = {\r\n name: frontmatter.name || agentType,\r\n description: frontmatter.description || '',\r\n tools: Array.isArray(frontmatter.tools) ? frontmatter.tools : [],\r\n model: frontmatter.model || 'haiku',\r\n type: frontmatter.type,\r\n color: frontmatter.color,\r\n acl_level: frontmatter.acl_level ? parseInt(String(frontmatter.acl_level), 10) : undefined,\r\n capabilities: frontmatter.capabilities,\r\n validation_hooks: frontmatter.validation_hooks,\r\n lifecycle: frontmatter.lifecycle,\r\n content: body,\r\n filePath,\r\n category,\r\n };\r\n\r\n return definition;\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgentDefinitions(baseDir: string = '.claude/agents'): Promise<string[]> {\r\n const pattern = `${baseDir}/**/*.md`;\r\n const files = await glob(pattern, { nodir: true });\r\n\r\n return files.map(f => path.basename(f, '.md'));\r\n}\r\n\r\n/**\r\n * Check if agent definition includes CFN Loop protocol\r\n */\r\nexport function hasCFNLoopProtocol(definition: AgentDefinition): boolean {\r\n const content = definition.content.toLowerCase();\r\n return (\r\n content.includes('cfn loop') &&\r\n content.includes('redis completion protocol') ||\r\n content.includes('invoke-waiting-mode.sh')\r\n );\r\n}\r\n"],"names":["fs","path","fileURLToPath","glob","execSync","__filename","url","__dirname","dirname","getProjectRoot","process","env","PROJECT_ROOT","gitRoot","encoding","cwd","stdio","trim","projectRoot","parseFrontmatter","content","frontmatterRegex","match","frontmatter","body","yamlContent","lines","split","currentKey","currentArray","isInArray","isInObject","currentObject","objectKey","line","trimmed","startsWith","push","substring","objKey","objValueParts","objValue","join","replace","colonIndex","indexOf","key","value","endsWith","arrayContent","length","items","map","item","cleanValue","existingValue","findAgentFile","agentType","baseDir","normalizedType","toLowerCase","defaultBaseDir","searchLocations","searchPatterns","loc","location","patternFn","pattern","files","nodir","absolute","exactMatch","find","f","basename","error","parseAgentDefinition","filePath","Error","readFile","agentsPath","relativePath","relative","category","includes","undefined","definition","name","description","tools","Array","isArray","model","type","color","acl_level","parseInt","String","capabilities","validation_hooks","lifecycle","listAgentDefinitions","hasCFNLoopProtocol"],"mappings":"AAAA;;;;;CAKC,GAED,OAAOA,QAAQ,cAAc;AAC7B,OAAOC,UAAU,OAAO;AACxB,SAASC,aAAa,QAAQ,MAAM;AACpC,SAASC,IAAI,QAAQ,OAAO;AAC5B,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,0BAA0B;AAC1B,MAAMC,aAAaH,cAAc,YAAYI,GAAG;AAChD,MAAMC,YAAYN,KAAKO,OAAO,CAACH;AAE/B;;;CAGC,GACD,SAASI;IACP,gCAAgC;IAChC,IAAIC,QAAQC,GAAG,CAACC,YAAY,EAAE;QAC5B,OAAOF,QAAQC,GAAG,CAACC,YAAY;IACjC;IAEA,uCAAuC;IACvC,IAAI;QACF,MAAMC,UAAUT,SAAS,iCAAiC;YACxDU,UAAU;YACVC,KAAKL,QAAQK,GAAG;YAChBC,OAAO;gBAAC;gBAAQ;gBAAQ;aAAS;QACnC,GAAGC,IAAI;QACP,IAAIJ,SAAS;YACX,OAAOA;QACT;IACF,EAAE,OAAM;IACN,8BAA8B;IAChC;IAEA,4CAA4C;IAC5C,OAAOH,QAAQK,GAAG;AACpB;AAEA,MAAMG,cAAcT;AA0BpB;;;CAGC,GACD,SAASU,iBAAiBC,OAAe;IACvC,MAAMC,mBAAmB;IACzB,MAAMC,QAAQF,QAAQE,KAAK,CAACD;IAE5B,IAAI,CAACC,OAAO;QACV,OAAO;YAAEC,aAAa,CAAC;YAAGC,MAAMJ;QAAQ;IAC1C;IAEA,MAAM,GAAGK,aAAaD,KAAK,GAAGF;IAG9B,0EAA0E;IAC1E,MAAMC,cAAmC,CAAC;IAC1C,MAAMG,QAAQD,YAAYE,KAAK,CAAC;IAChC,IAAIC,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AC,EAAE,GAC1B0D;IAGJ,yBAAyB;IACzB,MAAMC,aAA8B;QAClCC,MAAMhE,YAAYgE,IAAI,IAAI9B;QAC1B+B,aAAajE,YAAYiE,WAAW,IAAI;QACxCC,OAAOC,MAAMC,OAAO,CAACpE,YAAYkE,KAAK,IAAIlE,YAAYkE,KAAK,GAAG,EAAE;QAChEG,OAAOrE,YAAYqE,KAAK,IAAI;QAC5BC,MAAMtE,YAAYsE,IAAI;QACtBC,OAAOvE,YAAYuE,KAAK;QACxBC,WAAWxE,YAAYwE,SAAS,GAAGC,SAASC,OAAO1E,YAAYwE,SAAS,GAAG,MAAMV;QACjFa,cAAc3E,YAAY2E,YAAY;QACtCC,kBAAkB5E,YAAY4E,gBAAgB;QAC9CC,WAAW7E,YAAY6E,SAAS;QAChChF,SAASI;QACTqD;QACAM;IACF;IAEA,OAAOG;AACT;AAEA;;CAEC,GACD,OAAO,eAAee,qBAAqB3C,UAAkB,gBAAgB;IAC3E,MAAMS,UAAU,GAAGT,QAAQ,QAAQ,CAAC;IACpC,MAAMU,QAAQ,MAAMjE,KAAKgE,SAAS;QAAEE,OAAO;IAAK;IAEhD,OAAOD,MAAMhB,GAAG,CAACqB,CAAAA,IAAKxE,KAAKyE,QAAQ,CAACD,GAAG;AACzC;AAEA;;CAEC,GACD,OAAO,SAAS6B,mBAAmBhB,UAA2B;IAC5D,MAAMlE,UAAUkE,WAAWlE,OAAO,CAACwC,WAAW;IAC9C,OACExC,QAAQgE,QAAQ,CAAC,eACjBhE,QAAQgE,QAAQ,CAAC,gCACjBhE,QAAQgE,QAAQ,CAAC;AAErB"}
|
|
@@ -15,7 +15,37 @@ import { convertToolNames } from './tool-definitions.js';
|
|
|
15
15
|
import fs from 'fs/promises';
|
|
16
16
|
import path from 'path';
|
|
17
17
|
import os from 'os';
|
|
18
|
+
import { execSync } from 'child_process';
|
|
18
19
|
const execAsync = promisify(exec);
|
|
20
|
+
/**
|
|
21
|
+
* Detect project root dynamically
|
|
22
|
+
* Uses PROJECT_ROOT env var if set, otherwise tries git, falls back to cwd
|
|
23
|
+
*/ function getProjectRoot() {
|
|
24
|
+
// 1. Check environment variable
|
|
25
|
+
if (process.env.PROJECT_ROOT) {
|
|
26
|
+
return process.env.PROJECT_ROOT;
|
|
27
|
+
}
|
|
28
|
+
// 2. Try git rev-parse (most reliable)
|
|
29
|
+
try {
|
|
30
|
+
const gitRoot = execSync('git rev-parse --show-toplevel', {
|
|
31
|
+
encoding: 'utf-8',
|
|
32
|
+
cwd: process.cwd(),
|
|
33
|
+
stdio: [
|
|
34
|
+
'pipe',
|
|
35
|
+
'pipe',
|
|
36
|
+
'ignore'
|
|
37
|
+
]
|
|
38
|
+
}).trim();
|
|
39
|
+
if (gitRoot) {
|
|
40
|
+
return gitRoot;
|
|
41
|
+
}
|
|
42
|
+
} catch {
|
|
43
|
+
// Fall through to next method
|
|
44
|
+
}
|
|
45
|
+
// 3. Fall back to current working directory
|
|
46
|
+
return process.cwd();
|
|
47
|
+
}
|
|
48
|
+
const projectRoot = getProjectRoot();
|
|
19
49
|
// Bug #6 Fix: Read Redis connection parameters from process.env
|
|
20
50
|
// ENV-001: Standardized environment variable naming (REDIS_PASSWORD for all deployments)
|
|
21
51
|
const redisHost = process.env.CFN_REDIS_HOST || 'cfn-redis';
|
|
@@ -124,7 +154,7 @@ const redisPassword = process.env.CFN_REDIS_PASSWORD || process.env.REDIS_PASSWO
|
|
|
124
154
|
}
|
|
125
155
|
// Check config file (.claude/config/api-provider.json)
|
|
126
156
|
try {
|
|
127
|
-
const configPath = path.join('.claude', 'config', 'api-provider.json');
|
|
157
|
+
const configPath = path.join(projectRoot, '.claude', 'config', 'api-provider.json');
|
|
128
158
|
const config = JSON.parse(await fs.readFile(configPath, 'utf-8'));
|
|
129
159
|
return config.provider === 'zai' || config.provider === 'z.ai';
|
|
130
160
|
} catch {
|
|
@@ -269,7 +299,7 @@ const redisPassword = process.env.CFN_REDIS_PASSWORD || process.env.REDIS_PASSWO
|
|
|
269
299
|
console.log(`[agent-executor] Model: ${definition.model}`);
|
|
270
300
|
console.log(`[agent-executor] Prompt file: ${promptFile}`);
|
|
271
301
|
return new Promise((resolve)=>{
|
|
272
|
-
const scriptPath = path.join('.claude', 'skills', 'agent-execution', 'execute-agent.sh');
|
|
302
|
+
const scriptPath = path.join(projectRoot, '.claude', 'skills', 'agent-execution', 'execute-agent.sh');
|
|
273
303
|
// Build environment variables - WHITELIST ONLY APPROACH
|
|
274
304
|
// SECURITY FIX: Do not use ...process.env spread which exposes ALL variables including secrets
|
|
275
305
|
// Instead, explicitly whitelist safe variables to pass to spawned process
|