claude-flow-novice 2.15.2 → 2.15.4
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/skills/advanced-features/cfn-agent-swap/recommend-swap.sh +59 -59
- package/.claude/cfn-extras/skills/analytics/cfn-improvement-recommender/recommend-improvements.sh +91 -91
- package/.claude/cfn-extras/skills/analytics/cfn-pattern-extraction/extract-patterns.sh +79 -79
- package/.claude/cfn-extras/skills/analytics/cfn-retrospective-report/generate-report.sh +100 -100
- package/.claude/cfn-extras/skills/analytics/cfn-telemetry/start-telemetry.sh +110 -110
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/add-bullet.sh +145 -145
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/log-merge.sh +67 -67
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/monitor-injection-performance.sh +137 -137
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/optimize-injection-pipeline.sh +168 -168
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/query-reflections.sh +35 -35
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/store-reflection.sh +45 -45
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/track-ab-test.sh +41 -41
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/update-reflection.sh +41 -41
- package/.claude/cfn-extras/skills/deprecated/cfn-cli-setup/validate-cli-environment.sh +191 -191
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/create-campaign.sh +231 -231
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/get-campaign-performance.sh +190 -190
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/pause-campaign.sh +142 -142
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/set-budget.sh +181 -181
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/update-bid-strategy.sh +133 -133
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/get-conversation-history.sh +121 -121
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/qualify-lead.sh +156 -156
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/schedule-demo.sh +181 -181
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/send-message.sh +137 -137
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/transfer-to-human.sh +179 -179
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/create-campaign.sh +183 -183
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/get-delivery-status.sh +139 -139
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/opt-out.sh +150 -150
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/schedule-campaign.sh +187 -187
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/send-sms.sh +181 -181
- package/.claude/cfn-extras/skills/ui-portal/cfn-web-portal/test-web-portal-skill.sh +50 -50
- package/.claude/cfn-extras/skills/ui-portal/cfn-web-portal/validate-deployment.sh +84 -84
- package/.claude/cfn-extras/skills/utility/cfn-environment-sanitization/sanitize-environment.sh +243 -243
- package/.claude/commands/cfn-loop-cli.md +16 -2
- package/.claude/commands/switch-api.md +31 -10
- package/.claude/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/.claude/hooks/cfn-invoke-security-validation.sh +69 -69
- package/.claude/hooks/cfn-lint-sql-injection.sh +61 -0
- package/.claude/hooks/cfn-post-edit-cfn-retrospective.sh +109 -78
- package/.claude/hooks/cfn-post-edit.config.json +44 -44
- package/.claude/hooks/cfn-pre-edit-security-warning.sh +40 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +22 -24
- package/.claude/skills/cfn-docker-agent-spawning/SKILL.md +28 -4
- package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +3 -1
- package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +224 -20
- package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +550 -46
- package/.claude/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +277 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +184 -23
- package/.claude/skills/cfn-loop-orchestration/security_utils.sh +24 -0
- package/.claude/skills/cfn-loop-orchestration/test-iteration-context-injection.sh +366 -0
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/.claude/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +319 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh.bak +124 -0
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/.claude/skills/cfn-redis-coordination/collect-confidence-scores.sh +30 -0
- package/.claude/skills/cfn-redis-coordination/get-context.sh +145 -112
- package/.claude/skills/cfn-redis-coordination/get-success-criteria.sh +54 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -0
- package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/.claude/skills/cfn-redis-coordination/redis-functions.sh +33 -0
- package/.claude/skills/cfn-redis-coordination/report-completion.sh +24 -31
- package/.claude/skills/cfn-redis-coordination/store-context.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/store-success-criteria.sh +85 -0
- package/.claude/skills/cfn-redis-coordination/update-all-scripts.sh +67 -0
- package/.claude/skills/cfn-sqlite-memory/ttl-cleanup.sh +17 -25
- package/.claude/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
- package/.claude/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
- package/.claude/skills/cfn-transparency-middleware/test-e2e.sh +15 -0
- package/.claude/skills/cfn-transparency-middleware/test-integration.sh +161 -161
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
- package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +107 -92
- package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/README.md +116 -475
- package/claude-assets/agents/cfn-dev-team/README.md +103 -0
- package/claude-assets/agents/cfn-dev-team/architecture/goal-planner.md +1 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +77 -15
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +355 -6
- package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +82 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +82 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +77 -15
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +99 -12
- package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +1 -1
- package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +97 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +20 -1
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +97 -0
- package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +110 -13
- package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +106 -15
- package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +115 -11
- package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +94 -7
- package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +87 -9
- package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +85 -7
- package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +160 -28
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +101 -19
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +108 -14
- package/claude-assets/agents/cfn-dev-team/reviewers/{reviewer.md → code-reviewer.md} +95 -8
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +107 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +98 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +95 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +136 -9
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +108 -1
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +107 -13
- package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +737 -0
- package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +1 -1
- package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +828 -0
- package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +106 -7
- package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +77 -0
- package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +684 -0
- package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +110 -1
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +94 -7
- package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +1 -3
- package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +87 -13
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +103 -7
- package/claude-assets/agents/cfn-dev-team/utility/researcher.md +1 -3
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +94 -7
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +46 -0
- package/claude-assets/agents/project-only-agents/npm-package-specialist.md +1 -1
- package/claude-assets/cfn-extras/skills/advanced-features/cfn-agent-swap/recommend-swap.sh +59 -59
- package/claude-assets/cfn-extras/skills/analytics/cfn-improvement-recommender/recommend-improvements.sh +91 -91
- package/claude-assets/cfn-extras/skills/analytics/cfn-pattern-extraction/extract-patterns.sh +79 -79
- package/claude-assets/cfn-extras/skills/analytics/cfn-retrospective-report/generate-report.sh +100 -100
- package/claude-assets/cfn-extras/skills/analytics/cfn-telemetry/start-telemetry.sh +110 -110
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/add-bullet.sh +145 -145
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/log-merge.sh +67 -67
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/monitor-injection-performance.sh +137 -137
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/optimize-injection-pipeline.sh +168 -168
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/query-reflections.sh +35 -35
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/store-reflection.sh +45 -45
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/track-ab-test.sh +41 -41
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/update-reflection.sh +41 -41
- package/claude-assets/cfn-extras/skills/deprecated/cfn-cli-setup/validate-cli-environment.sh +191 -191
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/create-campaign.sh +231 -231
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/get-campaign-performance.sh +190 -190
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/pause-campaign.sh +142 -142
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/set-budget.sh +181 -181
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/update-bid-strategy.sh +133 -133
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/get-conversation-history.sh +121 -121
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/qualify-lead.sh +156 -156
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/schedule-demo.sh +181 -181
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/send-message.sh +137 -137
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/transfer-to-human.sh +179 -179
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/create-campaign.sh +183 -183
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/get-delivery-status.sh +139 -139
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/opt-out.sh +150 -150
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/schedule-campaign.sh +187 -187
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/send-sms.sh +181 -181
- package/claude-assets/cfn-extras/skills/ui-portal/cfn-web-portal/test-web-portal-skill.sh +50 -50
- package/claude-assets/cfn-extras/skills/ui-portal/cfn-web-portal/validate-deployment.sh +84 -84
- package/claude-assets/cfn-extras/skills/utility/cfn-environment-sanitization/sanitize-environment.sh +243 -243
- package/claude-assets/commands/cfn-loop-cli.md +16 -2
- package/claude-assets/commands/switch-api.md +31 -10
- package/claude-assets/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/claude-assets/hooks/cfn-invoke-security-validation.sh +69 -69
- package/claude-assets/hooks/cfn-lint-sql-injection.sh +61 -0
- package/claude-assets/hooks/cfn-post-edit-cfn-retrospective.sh +109 -78
- package/claude-assets/hooks/cfn-post-edit.config.json +44 -44
- package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +19 -19
- package/claude-assets/hooks/cfn-pre-edit-security-warning.sh +40 -0
- package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +19 -19
- package/claude-assets/hooks/detect-hardcoded-credentials.sh +212 -0
- package/claude-assets/skills/SKILL_TEMPLATE.md +774 -0
- package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +543 -572
- package/claude-assets/skills/agent-lifecycle/simple-audit.sh +57 -30
- package/claude-assets/skills/agent-template-generator/SKILL.md +440 -0
- package/claude-assets/skills/agent-template-generator/generate-agent.sh +405 -0
- package/claude-assets/skills/agent-validation-linter/SKILL.md +589 -0
- package/claude-assets/skills/agent-validation-linter/lint-agents.sh +271 -0
- package/claude-assets/skills/bootstrap/bash-fundamentals.md +786 -0
- package/claude-assets/skills/bootstrap/database-connection.md +464 -0
- package/claude-assets/skills/bootstrap/error-handling.md +580 -0
- package/claude-assets/skills/bootstrap/file-operations.md +699 -0
- package/claude-assets/skills/bootstrap/skill-loader.md +616 -0
- package/claude-assets/skills/bootstrap/sqlite-params.sh +287 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh +22 -24
- package/claude-assets/skills/cfn-automatic-memory-persistence/persist-agent-output.sh +48 -48
- package/claude-assets/skills/cfn-automatic-memory-persistence/query-agent-history.sh +34 -34
- package/claude-assets/skills/cfn-automatic-memory-persistence/test-memory-persistence.sh +17 -16
- package/claude-assets/skills/cfn-deliverable-validation/confidence-calculator.sh +261 -261
- package/claude-assets/skills/cfn-deployment/SKILL.md +293 -0
- package/claude-assets/skills/cfn-deployment/execute.sh +21 -0
- package/claude-assets/skills/cfn-docker-agent-spawning/SKILL.md +28 -4
- package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +3 -1
- package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +224 -20
- package/claude-assets/skills/cfn-environment-sanitization/sanitize-environment.sh +38 -0
- package/claude-assets/skills/cfn-error-batching-strategy/lib/core-functions.sh +47 -47
- package/claude-assets/skills/cfn-expert-update/update-expert.sh +345 -345
- package/claude-assets/skills/cfn-file-operations/SKILL.md +290 -0
- package/claude-assets/skills/cfn-file-operations/execute.sh +129 -0
- package/claude-assets/skills/cfn-file-operations/lib/atomic-write.sh +294 -0
- package/claude-assets/skills/cfn-file-operations/lib/lock.sh +361 -0
- package/claude-assets/skills/cfn-file-operations/test.sh +369 -0
- package/claude-assets/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/claude-assets/skills/cfn-intervention-detector/detect-intervention.sh +110 -110
- package/claude-assets/skills/cfn-intervention-orchestrator/execute-intervention.sh +58 -58
- package/claude-assets/skills/cfn-log-operations/SKILL.md +308 -0
- package/claude-assets/skills/cfn-log-operations/execute.sh +420 -0
- package/claude-assets/skills/cfn-log-operations/lib/rotate.sh +406 -0
- package/claude-assets/skills/cfn-log-operations/lib/search.sh +448 -0
- package/claude-assets/skills/cfn-log-operations/test.sh +394 -0
- package/claude-assets/skills/cfn-loop-orchestration/helpers/gate-check.sh +550 -46
- package/claude-assets/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +277 -0
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +184 -23
- package/claude-assets/skills/cfn-loop-orchestration/security_utils.sh +24 -0
- package/claude-assets/skills/cfn-loop-orchestration/test-iteration-context-injection.sh +366 -0
- package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/claude-assets/skills/cfn-loop2-output-processing/process-validator-output.sh +275 -275
- package/claude-assets/skills/cfn-memory-management/check-memory.sh +159 -159
- package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +196 -196
- package/claude-assets/skills/cfn-node-heap-sizer/task-mode-heap-limiter.sh +325 -325
- package/claude-assets/skills/cfn-parameterized-queries/SKILL.md +339 -0
- package/claude-assets/skills/cfn-playbook/query-playbook.sh +19 -15
- package/claude-assets/skills/cfn-playbook/update-playbook.sh +25 -14
- package/claude-assets/skills/cfn-playbook-auto-update/auto-update-playbook.sh +85 -85
- package/claude-assets/skills/cfn-process-instrumentation/instrument-process.sh +44 -0
- package/claude-assets/skills/cfn-promotion/SKILL.md +305 -0
- package/claude-assets/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +319 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh +4 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh.bak +124 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/claude-assets/skills/cfn-redis-coordination/collect-confidence-scores.sh +30 -0
- package/claude-assets/skills/cfn-redis-coordination/get-context.sh +145 -112
- package/claude-assets/skills/cfn-redis-coordination/get-success-criteria.sh +54 -0
- package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -0
- package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/claude-assets/skills/cfn-redis-coordination/redis-functions.sh +33 -0
- package/claude-assets/skills/cfn-redis-coordination/report-completion.sh +24 -31
- package/claude-assets/skills/cfn-redis-coordination/store-context.sh +4 -0
- package/claude-assets/skills/cfn-redis-coordination/store-success-criteria.sh +85 -0
- package/claude-assets/skills/cfn-redis-coordination/update-all-scripts.sh +67 -0
- package/claude-assets/skills/cfn-scope-simplifier/simplify-scope.sh +67 -67
- package/claude-assets/skills/cfn-skill-loader/SKILL.md +466 -0
- package/claude-assets/skills/cfn-skill-loader/execute.sh +344 -0
- package/claude-assets/skills/cfn-specialist-injection/recommend-specialist.sh +56 -56
- package/claude-assets/skills/cfn-sqlite-memory/ttl-cleanup.sh +17 -25
- package/claude-assets/skills/cfn-standardized-error-handling/capture-agent-error.sh +86 -86
- package/claude-assets/skills/cfn-standardized-error-handling/test-error-handling.sh +165 -165
- package/claude-assets/skills/cfn-task-audit/get-audit-data.sh +42 -21
- package/claude-assets/skills/cfn-task-audit/store-task-audit.sh +17 -10
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +264 -264
- package/claude-assets/skills/cfn-task-decomposition/task-decomposer.sh +278 -278
- package/claude-assets/skills/cfn-test-runner/detect-regressions.sh +17 -14
- package/claude-assets/skills/cfn-test-runner/detect-regressions.sh.backup-1763392821 +55 -0
- package/claude-assets/skills/cfn-test-runner/store-benchmarks.sh +17 -19
- package/claude-assets/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
- package/claude-assets/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
- package/claude-assets/skills/cfn-transparency-middleware/test-e2e.sh +15 -0
- package/claude-assets/skills/cfn-transparency-middleware/test-integration.sh +161 -161
- package/claude-assets/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
- package/claude-assets/skills/cfn-transparency-middleware/tests/input-validation.sh +107 -92
- package/claude-assets/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/claude-assets/skills/cfn-utilities/SKILL.md +237 -0
- package/claude-assets/skills/cfn-utilities/execute.sh +32 -0
- package/claude-assets/skills/cfn-utilities/lib/errors.sh +56 -0
- package/claude-assets/skills/cfn-utilities/lib/file-ops.sh +164 -0
- package/claude-assets/skills/cfn-utilities/lib/logging.sh +77 -0
- package/claude-assets/skills/cfn-utilities/lib/retry.sh +127 -0
- package/claude-assets/skills/cfn-utilities/test.sh +317 -0
- package/claude-assets/skills/docker-build/SKILL.md +96 -203
- package/claude-assets/skills/docker-build/build.sh +73 -73
- package/claude-assets/skills/integration/agent-handoff.sh +492 -0
- package/claude-assets/skills/integration/file-operations.sh +414 -0
- package/claude-assets/skills/json-validation/SKILL.md +431 -0
- package/claude-assets/skills/json-validation/test-validate-success-criteria.sh +421 -0
- package/claude-assets/skills/json-validation/validate-success-criteria.sh +197 -0
- package/claude-assets/skills/redis-coordination/validate-parameters.sh +34 -0
- package/claude-assets/skills/workflow-codification/APPROVAL_WORKFLOW.md +806 -0
- package/claude-assets/skills/workflow-codification/COST_TRACKING.md +637 -0
- package/claude-assets/skills/workflow-codification/DEPLOY_QUICK_REFERENCE.md +106 -0
- package/claude-assets/skills/workflow-codification/EDGE_CASE_TRACKING.md +404 -0
- package/claude-assets/skills/workflow-codification/PROPAGATE_UPDATE_QUICK_REFERENCE.md +366 -0
- package/claude-assets/skills/workflow-codification/README_PHASE4.md +457 -0
- package/claude-assets/skills/workflow-codification/SKILL.md +110 -0
- package/claude-assets/skills/workflow-codification/analyze-patterns.sh +899 -0
- package/claude-assets/skills/workflow-codification/approval-workflow.sh +514 -0
- package/claude-assets/skills/workflow-codification/deploy-approved-skill.sh +481 -0
- package/claude-assets/skills/workflow-codification/deploy-approved-skill.sh.backup-1763392820 +512 -0
- package/claude-assets/skills/workflow-codification/generate-skill-update.sh +525 -0
- package/claude-assets/skills/workflow-codification/lib/security-utils.sh +204 -0
- package/claude-assets/skills/workflow-codification/propagate-skill-update.sh +648 -0
- package/claude-assets/skills/workflow-codification/propagate-skill-update.sh.backup-1763392820 +664 -0
- package/claude-assets/skills/workflow-codification/review-skill.sh +643 -0
- package/claude-assets/skills/workflow-codification/templates/email-notification.txt +114 -0
- package/claude-assets/skills/workflow-codification/templates/slack-notification.md +85 -0
- package/claude-assets/skills/workflow-codification/test-integration.sh +296 -0
- package/claude-assets/skills/workflow-codification/test-metadata-update.sh +350 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh +486 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh.backup-1763392821 +445 -0
- package/claude-assets/skills/workflow-codification/track-edge-case.sh +290 -0
- package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
- package/dist/ace/ace-curator.js +10 -2
- package/dist/ace/ace-curator.js.map +1 -1
- package/dist/ace/ace-generator.js +4 -0
- package/dist/ace/ace-generator.js.map +1 -1
- package/dist/ace/ace-reflector.js +1 -1
- package/dist/ace/ace-reflector.js.map +1 -1
- package/dist/ace/context-injection.js +24 -2
- package/dist/ace/context-injection.js.map +1 -1
- package/dist/agents/agent-loader.js +146 -165
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/agents/task-agent-integration.js +1 -1
- package/dist/agents/task-agent-integration.js.map +1 -1
- package/dist/api/health-endpoints.js +390 -0
- package/dist/api/health-endpoints.js.map +1 -0
- package/dist/cli/agent-executor.js +4 -1
- package/dist/cli/agent-executor.js.map +1 -1
- package/dist/cli/agent-prompt-builder.js +89 -1
- package/dist/cli/agent-prompt-builder.js.map +1 -1
- package/dist/cli/agent-spawn.js +130 -37
- package/dist/cli/agent-spawn.js.map +1 -1
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/skill-cache-validator.js +412 -0
- package/dist/cli/skill-cache-validator.js.map +1 -0
- package/dist/cli/skill-cli.js +991 -0
- package/dist/cli/skill-cli.js.map +1 -0
- package/dist/cli/skill-execution-logger.js +284 -0
- package/dist/cli/skill-execution-logger.js.map +1 -0
- package/dist/cli/skill-loader.js +457 -0
- package/dist/cli/skill-loader.js.map +1 -0
- package/dist/coordination/event-bus.js +2 -2
- package/dist/coordination/event-bus.js.map +1 -1
- package/dist/coordination/fleet-manager.js +1 -1
- package/dist/coordination/fleet-manager.js.map +1 -1
- package/dist/coordination/index.js +23 -9
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/types/fleet-manager.types.js.map +1 -1
- package/dist/db/migration-manager.js +483 -0
- package/dist/db/migration-manager.js.map +1 -0
- package/dist/db/skills-query.js +535 -0
- package/dist/db/skills-query.js.map +1 -0
- package/dist/integration/DatabaseHandoff.js +507 -0
- package/dist/integration/DatabaseHandoff.js.map +1 -0
- package/dist/integration/StandardAdapter.js +291 -0
- package/dist/integration/StandardAdapter.js.map +1 -0
- package/dist/jobs/edge-case-analyzer.js +367 -0
- package/dist/jobs/edge-case-analyzer.js.map +1 -0
- package/dist/jobs/promotion-sla-enforcer.js +288 -0
- package/dist/jobs/promotion-sla-enforcer.js.map +1 -0
- package/dist/lib/agent-output-parser.js +518 -0
- package/dist/lib/agent-output-parser.js.map +1 -0
- package/dist/lib/agent-output-validator.js +950 -0
- package/dist/lib/agent-output-validator.js.map +1 -0
- package/dist/lib/agent-workspace.js +281 -0
- package/dist/lib/agent-workspace.js.map +1 -0
- package/dist/lib/artifact-registry.js +443 -0
- package/dist/lib/artifact-registry.js.map +1 -0
- package/dist/lib/atomic-file-writer.js +377 -0
- package/dist/lib/atomic-file-writer.js.map +1 -0
- package/dist/lib/backup-manager.js +779 -0
- package/dist/lib/backup-manager.js.map +1 -0
- package/dist/lib/checkpoint-manager.js +837 -0
- package/dist/lib/checkpoint-manager.js.map +1 -0
- package/dist/lib/circuit-breaker.js +340 -0
- package/dist/lib/circuit-breaker.js.map +1 -0
- package/dist/lib/completion-signal-handler.js +243 -0
- package/dist/lib/completion-signal-handler.js.map +1 -0
- package/dist/lib/config-manager.js +312 -0
- package/dist/lib/config-manager.js.map +1 -0
- package/dist/lib/config-migrator.js +386 -0
- package/dist/lib/config-migrator.js.map +1 -0
- package/dist/lib/config-validator.js +687 -0
- package/dist/lib/config-validator.js.map +1 -0
- package/dist/lib/correlation-cache.js +311 -0
- package/dist/lib/correlation-cache.js.map +1 -0
- package/dist/lib/correlation.js +263 -0
- package/dist/lib/correlation.js.map +1 -0
- package/dist/lib/database-service/connection-pool-manager.js +520 -0
- package/dist/lib/database-service/connection-pool-manager.js.map +1 -0
- package/dist/lib/database-service/correlation.js +329 -0
- package/dist/lib/database-service/correlation.js.map +1 -0
- package/dist/lib/database-service/errors.js +120 -0
- package/dist/lib/database-service/errors.js.map +1 -0
- package/dist/lib/database-service/index.js +168 -0
- package/dist/lib/database-service/index.js.map +1 -0
- package/dist/lib/database-service/postgres-adapter.js +526 -0
- package/dist/lib/database-service/postgres-adapter.js.map +1 -0
- package/dist/lib/database-service/redis-adapter.js +360 -0
- package/dist/lib/database-service/redis-adapter.js.map +1 -0
- package/dist/lib/database-service/sqlite-adapter.js +544 -0
- package/dist/lib/database-service/sqlite-adapter.js.map +1 -0
- package/dist/lib/database-service/transaction-manager.js +773 -0
- package/dist/lib/database-service/transaction-manager.js.map +1 -0
- package/dist/lib/database-service/types.js +23 -0
- package/dist/lib/database-service/types.js.map +1 -0
- package/dist/lib/deadlock-resolver.js +292 -0
- package/dist/lib/deadlock-resolver.js.map +1 -0
- package/dist/lib/distributed-lock.js +451 -0
- package/dist/lib/distributed-lock.js.map +1 -0
- package/dist/lib/edge-case-deduplicator.js +227 -0
- package/dist/lib/edge-case-deduplicator.js.map +1 -0
- package/dist/lib/encryption-manager.js +322 -0
- package/dist/lib/encryption-manager.js.map +1 -0
- package/dist/lib/error-aggregator.js +234 -0
- package/dist/lib/error-aggregator.js.map +1 -0
- package/dist/lib/errors.js +287 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/file-lock-manager.js +578 -0
- package/dist/lib/file-lock-manager.js.map +1 -0
- package/dist/lib/file-operations.js +367 -0
- package/dist/lib/file-operations.js.map +1 -0
- package/dist/lib/idempotent-write.js +237 -0
- package/dist/lib/idempotent-write.js.map +1 -0
- package/dist/lib/integration-schema-validator.js +522 -0
- package/dist/lib/integration-schema-validator.js.map +1 -0
- package/dist/lib/lock-health-monitor.js +298 -0
- package/dist/lib/lock-health-monitor.js.map +1 -0
- package/dist/lib/log-shipper.js +422 -0
- package/dist/lib/log-shipper.js.map +1 -0
- package/dist/lib/logging.js +146 -0
- package/dist/lib/logging.js.map +1 -0
- package/dist/lib/message-deduplicator.js +439 -0
- package/dist/lib/message-deduplicator.js.map +1 -0
- package/dist/lib/multi-system-query.js +604 -0
- package/dist/lib/multi-system-query.js.map +1 -0
- package/dist/lib/orphan-detector.js +332 -0
- package/dist/lib/orphan-detector.js.map +1 -0
- package/dist/lib/password-generator.js +166 -0
- package/dist/lib/password-generator.js.map +1 -0
- package/dist/lib/path-validator.js +429 -0
- package/dist/lib/path-validator.js.map +1 -0
- package/dist/lib/query-translator.js +905 -0
- package/dist/lib/query-translator.js.map +1 -0
- package/dist/lib/queue-recovery.js +469 -0
- package/dist/lib/queue-recovery.js.map +1 -0
- package/dist/lib/redis-queue-manager.js +512 -0
- package/dist/lib/redis-queue-manager.js.map +1 -0
- package/dist/lib/reflection-archiver.js +272 -0
- package/dist/lib/reflection-archiver.js.map +1 -0
- package/dist/lib/retry-manager.js +453 -0
- package/dist/lib/retry-manager.js.map +1 -0
- package/dist/lib/retry.js +262 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/schema-transform.js +695 -0
- package/dist/lib/schema-transform.js.map +1 -0
- package/dist/lib/schema-validator.js +491 -0
- package/dist/lib/schema-validator.js.map +1 -0
- package/dist/lib/skill-cache.js +297 -0
- package/dist/lib/skill-cache.js.map +1 -0
- package/dist/lib/skill-content-manager.js +337 -0
- package/dist/lib/skill-content-manager.js.map +1 -0
- package/dist/lib/skill-frontmatter-parser.js +237 -0
- package/dist/lib/skill-frontmatter-parser.js.map +1 -0
- package/dist/lib/skill-git-integration.js +275 -0
- package/dist/lib/skill-git-integration.js.map +1 -0
- package/dist/lib/skill-markdown-validator.js +396 -0
- package/dist/lib/skill-markdown-validator.js.map +1 -0
- package/dist/lib/skill-output-parser.js +312 -0
- package/dist/lib/skill-output-parser.js.map +1 -0
- package/dist/lib/unified-query-api.js +467 -0
- package/dist/lib/unified-query-api.js.map +1 -0
- package/dist/middleware/auth-middleware.js +350 -0
- package/dist/middleware/auth-middleware.js.map +1 -0
- package/dist/middleware/schema-validation.js +347 -0
- package/dist/middleware/schema-validation.js.map +1 -0
- package/dist/providers/anthropic-provider.js +1 -1
- package/dist/providers/anthropic-provider.js.map +1 -1
- package/dist/providers/provider-factory.js +2 -2
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/services/edge-case-analyzer.js +321 -0
- package/dist/services/edge-case-analyzer.js.map +1 -0
- package/dist/services/edge-case-deduplicator.js +266 -0
- package/dist/services/edge-case-deduplicator.js.map +1 -0
- package/dist/services/edge-case-detector.js +337 -0
- package/dist/services/edge-case-detector.js.map +1 -0
- package/dist/services/edge-case-tracker.js +547 -0
- package/dist/services/edge-case-tracker.js.map +1 -0
- package/dist/services/health-check-system.js +586 -0
- package/dist/services/health-check-system.js.map +1 -0
- package/dist/services/metrics-logger.js +412 -0
- package/dist/services/metrics-logger.js.map +1 -0
- package/dist/services/patch-generator.js +378 -0
- package/dist/services/patch-generator.js.map +1 -0
- package/dist/services/patch-validator.js +337 -0
- package/dist/services/patch-validator.js.map +1 -0
- package/dist/services/performance-monitor.js +811 -0
- package/dist/services/performance-monitor.js.map +1 -0
- package/dist/services/promotion-pipeline.js +918 -0
- package/dist/services/promotion-pipeline.js.map +1 -0
- package/dist/services/promotion-validator.js +394 -0
- package/dist/services/promotion-validator.js.map +1 -0
- package/dist/services/reflection-logger.js +388 -0
- package/dist/services/reflection-logger.js.map +1 -0
- package/dist/services/skill-deployment.js +472 -0
- package/dist/services/skill-deployment.js.map +1 -0
- package/dist/services/skill-loader.js +427 -0
- package/dist/services/skill-loader.js.map +1 -0
- package/dist/services/skill-promotion.js +372 -0
- package/dist/services/skill-promotion.js.map +1 -0
- package/dist/services/skill-validator.js +454 -0
- package/dist/services/skill-validator.js.map +1 -0
- package/dist/services/skill-versioning.js +244 -0
- package/dist/services/skill-versioning.js.map +1 -0
- package/dist/services/workspace-supervisor.js +597 -0
- package/dist/services/workspace-supervisor.js.map +1 -0
- package/dist/types/agent-output.js +44 -0
- package/dist/types/agent-output.js.map +1 -0
- package/dist/types/config.js +28 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/edge-case.js +45 -0
- package/dist/types/edge-case.js.map +1 -0
- package/package.json +201 -176
- package/readme/README.md +19 -4
- package/scripts/artifact-cleanup.sh +392 -0
- package/scripts/backup-cleanup.sh +627 -0
- package/scripts/cleanup-workspaces.sh +412 -0
- package/scripts/cleanup-yaml-configs.sh +141 -0
- package/scripts/deploy-approved-skills.sh +263 -0
- package/scripts/deploy-production.sh +355 -355
- package/scripts/docker-playwright-fix.sh +311 -311
- package/scripts/docker-rebuild-all-agents.sh +127 -127
- package/scripts/health-check.sh +447 -0
- package/scripts/log-aggregator.sh +554 -0
- package/scripts/log-monitor.sh +629 -0
- package/scripts/manage-agent-workspaces.sh +434 -0
- package/scripts/memory-leak-prevention.sh +305 -305
- package/scripts/migrate-artifacts.sh +563 -0
- package/scripts/migrate-schema.sh +533 -0
- package/scripts/migrate-yaml-to-json.sh +465 -0
- package/scripts/promote-staged-skills.sh +423 -0
- package/scripts/run-marketing-tests.sh +42 -42
- package/scripts/update_paths.sh +46 -46
- package/scripts/verify-no-secrets.sh +88 -35
- package/.claude/cfn-extras/agents/deprecated-coordinators/adaptive-coordinator.md.backup +0 -161
- package/.claude/cfn-extras/agents/deprecated-coordinators/blocking-coordinator-example.md.backup +0 -728
- package/.claude/cfn-extras/agents/deprecated-coordinators/mesh-coordinator.md.backup +0 -131
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh.backup +0 -273
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -949
- package/README.md.backup_before_replace +0 -781
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/adaptive-coordinator.md.backup +0 -161
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/blocking-coordinator-example.md.backup +0 -728
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/mesh-coordinator.md.backup +0 -131
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh.backup +0 -273
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -949
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Docker Build Skill - Fast builds using Linux native storage
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
|
|
5
|
-
# Defaults
|
|
6
|
-
DOCKERFILE="Dockerfile.agent"
|
|
7
|
-
TAG="claude-flow-novice:agent"
|
|
8
|
-
NO_CACHE=""
|
|
9
|
-
|
|
10
|
-
# Parse arguments
|
|
11
|
-
while [[ $# -gt 0 ]]; do
|
|
12
|
-
case $1 in
|
|
13
|
-
--dockerfile)
|
|
14
|
-
DOCKERFILE="$2"
|
|
15
|
-
shift 2
|
|
16
|
-
;;
|
|
17
|
-
--tag)
|
|
18
|
-
TAG="$2"
|
|
19
|
-
shift 2
|
|
20
|
-
;;
|
|
21
|
-
--no-cache)
|
|
22
|
-
NO_CACHE="--no-cache"
|
|
23
|
-
shift
|
|
24
|
-
;;
|
|
25
|
-
*)
|
|
26
|
-
echo "Unknown option: $1"
|
|
27
|
-
echo "Usage: $0 [--dockerfile <path>] [--tag <name>] [--no-cache]"
|
|
28
|
-
exit 1
|
|
29
|
-
;;
|
|
30
|
-
esac
|
|
31
|
-
done
|
|
32
|
-
|
|
33
|
-
echo "🐳 Docker Build Skill"
|
|
34
|
-
echo "===================="
|
|
35
|
-
echo "Dockerfile: $DOCKERFILE"
|
|
36
|
-
echo "Tag: $TAG"
|
|
37
|
-
echo "No Cache: ${NO_CACHE:-false}"
|
|
38
|
-
echo ""
|
|
39
|
-
|
|
40
|
-
# Get project root (skill is in .claude/skills/docker-build/)
|
|
41
|
-
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
42
|
-
PROJECT_ROOT="$(cd "$SKILL_DIR/../../.." && pwd)"
|
|
43
|
-
|
|
44
|
-
cd "$PROJECT_ROOT"
|
|
45
|
-
|
|
46
|
-
# Check if Linux build script exists
|
|
47
|
-
if [ ! -f "./scripts/docker/build-from-linux.sh" ]; then
|
|
48
|
-
echo "❌ Error: scripts/docker/build-from-linux.sh not found"
|
|
49
|
-
exit 1
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
# Export settings for build script
|
|
53
|
-
export DOCKERFILE
|
|
54
|
-
export TAG
|
|
55
|
-
export DOCKER_BUILD_ARGS="$NO_CACHE"
|
|
56
|
-
|
|
57
|
-
# Run the build
|
|
58
|
-
echo "🚀 Starting build process..."
|
|
59
|
-
./scripts/docker/build-from-linux.sh
|
|
60
|
-
|
|
61
|
-
BUILD_EXIT=$?
|
|
62
|
-
|
|
63
|
-
if [ $BUILD_EXIT -eq 0 ]; then
|
|
64
|
-
echo ""
|
|
65
|
-
echo "✅ Build complete!"
|
|
66
|
-
echo " Image: $TAG"
|
|
67
|
-
echo ""
|
|
68
|
-
docker images | grep "$(echo $TAG | cut -d: -f1)" | head -3
|
|
69
|
-
else
|
|
70
|
-
echo ""
|
|
71
|
-
echo "❌ Build failed with exit code $BUILD_EXIT"
|
|
72
|
-
exit $BUILD_EXIT
|
|
73
|
-
fi
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Docker Build Skill - Fast builds using Linux native storage
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
# Defaults
|
|
6
|
+
DOCKERFILE="Dockerfile.agent"
|
|
7
|
+
TAG="claude-flow-novice:agent"
|
|
8
|
+
NO_CACHE=""
|
|
9
|
+
|
|
10
|
+
# Parse arguments
|
|
11
|
+
while [[ $# -gt 0 ]]; do
|
|
12
|
+
case $1 in
|
|
13
|
+
--dockerfile)
|
|
14
|
+
DOCKERFILE="$2"
|
|
15
|
+
shift 2
|
|
16
|
+
;;
|
|
17
|
+
--tag)
|
|
18
|
+
TAG="$2"
|
|
19
|
+
shift 2
|
|
20
|
+
;;
|
|
21
|
+
--no-cache)
|
|
22
|
+
NO_CACHE="--no-cache"
|
|
23
|
+
shift
|
|
24
|
+
;;
|
|
25
|
+
*)
|
|
26
|
+
echo "Unknown option: $1"
|
|
27
|
+
echo "Usage: $0 [--dockerfile <path>] [--tag <name>] [--no-cache]"
|
|
28
|
+
exit 1
|
|
29
|
+
;;
|
|
30
|
+
esac
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
echo "🐳 Docker Build Skill"
|
|
34
|
+
echo "===================="
|
|
35
|
+
echo "Dockerfile: $DOCKERFILE"
|
|
36
|
+
echo "Tag: $TAG"
|
|
37
|
+
echo "No Cache: ${NO_CACHE:-false}"
|
|
38
|
+
echo ""
|
|
39
|
+
|
|
40
|
+
# Get project root (skill is in .claude/skills/docker-build/)
|
|
41
|
+
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
42
|
+
PROJECT_ROOT="$(cd "$SKILL_DIR/../../.." && pwd)"
|
|
43
|
+
|
|
44
|
+
cd "$PROJECT_ROOT"
|
|
45
|
+
|
|
46
|
+
# Check if Linux build script exists
|
|
47
|
+
if [ ! -f "./scripts/docker/build-from-linux.sh" ]; then
|
|
48
|
+
echo "❌ Error: scripts/docker/build-from-linux.sh not found"
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Export settings for build script
|
|
53
|
+
export DOCKERFILE
|
|
54
|
+
export TAG
|
|
55
|
+
export DOCKER_BUILD_ARGS="$NO_CACHE"
|
|
56
|
+
|
|
57
|
+
# Run the build
|
|
58
|
+
echo "🚀 Starting build process..."
|
|
59
|
+
./scripts/docker/build-from-linux.sh
|
|
60
|
+
|
|
61
|
+
BUILD_EXIT=$?
|
|
62
|
+
|
|
63
|
+
if [ $BUILD_EXIT -eq 0 ]; then
|
|
64
|
+
echo ""
|
|
65
|
+
echo "✅ Build complete!"
|
|
66
|
+
echo " Image: $TAG"
|
|
67
|
+
echo ""
|
|
68
|
+
docker images | grep "$(echo $TAG | cut -d: -f1)" | head -3
|
|
69
|
+
else
|
|
70
|
+
echo ""
|
|
71
|
+
echo "❌ Build failed with exit code $BUILD_EXIT"
|
|
72
|
+
exit $BUILD_EXIT
|
|
73
|
+
fi
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# agent-handoff.sh - Standard agent handoff protocol
|
|
3
|
+
#
|
|
4
|
+
# Features:
|
|
5
|
+
# - Spawn protocol (standard parameters)
|
|
6
|
+
# - Completion protocol (exit codes, output format)
|
|
7
|
+
# - Heartbeat mechanism (Redis/SQLite)
|
|
8
|
+
# - Timeout handling (graceful termination)
|
|
9
|
+
#
|
|
10
|
+
# Usage:
|
|
11
|
+
# source agent-handoff.sh
|
|
12
|
+
# agent_spawn "agent-type" "task-description" "task-123" 3600
|
|
13
|
+
# agent_heartbeat "agent-456" "task-123"
|
|
14
|
+
# agent_complete "agent-456" "task-123" 0.85 '{"result": "success"}'
|
|
15
|
+
# agent_wait_for_completion "agent-456" "task-123" 300
|
|
16
|
+
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
|
|
19
|
+
# Source parameterized query library for SQL injection prevention
|
|
20
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
21
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
22
|
+
source "$PROJECT_ROOT/.claude/skills/bootstrap/sqlite-params.sh"
|
|
23
|
+
|
|
24
|
+
# Configuration
|
|
25
|
+
AGENT_STATE_DB="${AGENT_STATE_DB:-./.claude/agents/state/agent-state.db}"
|
|
26
|
+
HEARTBEAT_INTERVAL="${HEARTBEAT_INTERVAL:-30}"
|
|
27
|
+
COMPLETION_TIMEOUT="${COMPLETION_TIMEOUT:-300}"
|
|
28
|
+
LOG_FILE="${LOG_FILE:-/tmp/agent-handoff.log}"
|
|
29
|
+
|
|
30
|
+
# Ensure state database directory exists
|
|
31
|
+
mkdir -p "$(dirname "$AGENT_STATE_DB")"
|
|
32
|
+
|
|
33
|
+
# --- Logging Functions ---
|
|
34
|
+
|
|
35
|
+
log_structured() {
|
|
36
|
+
local level="$1"
|
|
37
|
+
local message="$2"
|
|
38
|
+
shift 2
|
|
39
|
+
local context="$*"
|
|
40
|
+
|
|
41
|
+
local timestamp
|
|
42
|
+
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
43
|
+
|
|
44
|
+
local log_entry
|
|
45
|
+
log_entry=$(cat <<EOF
|
|
46
|
+
{"level":"$level","message":"$message","timestamp":"$timestamp"${context:+,"context":$context}}
|
|
47
|
+
EOF
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
echo "$log_entry" >> "$LOG_FILE"
|
|
51
|
+
|
|
52
|
+
if [[ "$level" == "ERROR" ]] || [[ "$level" == "WARN" ]]; then
|
|
53
|
+
echo "$log_entry" >&2
|
|
54
|
+
fi
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
log_info() {
|
|
58
|
+
log_structured "INFO" "$1" "${2:-}"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
log_warn() {
|
|
62
|
+
log_structured "WARN" "$1" "${2:-}"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
log_error() {
|
|
66
|
+
log_structured "ERROR" "$1" "${2:-}"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
log_debug() {
|
|
70
|
+
log_structured "DEBUG" "$1" "${2:-}"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# --- Database Initialization ---
|
|
74
|
+
|
|
75
|
+
agent_init_db() {
|
|
76
|
+
sqlite3 "$AGENT_STATE_DB" <<'SQL'
|
|
77
|
+
CREATE TABLE IF NOT EXISTS agents (
|
|
78
|
+
agent_id TEXT PRIMARY KEY,
|
|
79
|
+
agent_type TEXT NOT NULL,
|
|
80
|
+
task_id TEXT NOT NULL,
|
|
81
|
+
status TEXT NOT NULL,
|
|
82
|
+
pid INTEGER,
|
|
83
|
+
spawned_at TEXT NOT NULL,
|
|
84
|
+
last_heartbeat TEXT,
|
|
85
|
+
completed_at TEXT,
|
|
86
|
+
confidence REAL,
|
|
87
|
+
result TEXT,
|
|
88
|
+
timeout_seconds INTEGER,
|
|
89
|
+
metadata TEXT
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
CREATE INDEX IF NOT EXISTS idx_agents_task_id ON agents(task_id);
|
|
93
|
+
CREATE INDEX IF NOT EXISTS idx_agents_status ON agents(status);
|
|
94
|
+
CREATE INDEX IF NOT EXISTS idx_agents_spawned_at ON agents(spawned_at);
|
|
95
|
+
|
|
96
|
+
CREATE TABLE IF NOT EXISTS heartbeats (
|
|
97
|
+
heartbeat_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
98
|
+
agent_id TEXT NOT NULL,
|
|
99
|
+
task_id TEXT NOT NULL,
|
|
100
|
+
timestamp TEXT NOT NULL,
|
|
101
|
+
metadata TEXT,
|
|
102
|
+
FOREIGN KEY (agent_id) REFERENCES agents(agent_id)
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
CREATE INDEX IF NOT EXISTS idx_heartbeats_agent_id ON heartbeats(agent_id);
|
|
106
|
+
CREATE INDEX IF NOT EXISTS idx_heartbeats_timestamp ON heartbeats(timestamp);
|
|
107
|
+
SQL
|
|
108
|
+
|
|
109
|
+
log_debug "Agent state database initialized" "{\"db\":\"$AGENT_STATE_DB\"}"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
# Initialize DB on first use
|
|
113
|
+
if [[ ! -f "$AGENT_STATE_DB" ]]; then
|
|
114
|
+
agent_init_db
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# --- Agent Spawn Protocol ---
|
|
118
|
+
|
|
119
|
+
# Spawn agent with standard parameters
|
|
120
|
+
# Args: $1=agent_type, $2=task_description, $3=task_id, $4=timeout_seconds, $5=metadata (JSON)
|
|
121
|
+
# Returns: agent_id
|
|
122
|
+
agent_spawn() {
|
|
123
|
+
local agent_type="$1"
|
|
124
|
+
local task_description="$2"
|
|
125
|
+
local task_id="$3"
|
|
126
|
+
local timeout_seconds="${4:-3600}"
|
|
127
|
+
local metadata="${5:-{}}"
|
|
128
|
+
|
|
129
|
+
# Generate agent ID
|
|
130
|
+
local agent_id="${agent_type}-$(date +%s)-$$"
|
|
131
|
+
|
|
132
|
+
# Validate parameters
|
|
133
|
+
if [[ -z "$agent_type" ]] || [[ -z "$task_description" ]] || [[ -z "$task_id" ]]; then
|
|
134
|
+
log_error "Invalid spawn parameters" "{\"agent_type\":\"$agent_type\",\"task_id\":\"$task_id\"}"
|
|
135
|
+
return 1
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
log_info "Spawning agent" "{\"agent_id\":\"$agent_id\",\"agent_type\":\"$agent_type\",\"task_id\":\"$task_id\"}"
|
|
139
|
+
|
|
140
|
+
# Register agent in database - using parameterized query
|
|
141
|
+
local spawned_timestamp
|
|
142
|
+
spawned_timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
143
|
+
sqlite_insert "$AGENT_STATE_DB" \
|
|
144
|
+
"INSERT INTO agents (agent_id, agent_type, task_id, status, spawned_at, timeout_seconds, metadata) VALUES (?1, ?2, ?3, 'spawned', ?4, ?5, ?6);" \
|
|
145
|
+
"$agent_id" "$agent_type" "$task_id" "$spawned_timestamp" "$timeout_seconds" "$metadata"
|
|
146
|
+
|
|
147
|
+
# Standard agent spawn command (customizable via environment)
|
|
148
|
+
local spawn_cmd="${AGENT_SPAWN_CMD:-cfn-spawn agent}"
|
|
149
|
+
|
|
150
|
+
# Spawn agent in background (example - replace with actual spawn mechanism)
|
|
151
|
+
(
|
|
152
|
+
# Set agent context
|
|
153
|
+
export AGENT_ID="$agent_id"
|
|
154
|
+
export TASK_ID="$task_id"
|
|
155
|
+
export AGENT_TYPE="$agent_type"
|
|
156
|
+
|
|
157
|
+
# Update status to running - using parameterized query
|
|
158
|
+
sqlite_update "$AGENT_STATE_DB" \
|
|
159
|
+
"UPDATE agents SET status = 'running', pid = ?1 WHERE agent_id = ?2;" \
|
|
160
|
+
"$$" "$agent_id"
|
|
161
|
+
|
|
162
|
+
# Start heartbeat in background
|
|
163
|
+
agent_heartbeat_loop "$agent_id" "$task_id" &
|
|
164
|
+
local heartbeat_pid=$!
|
|
165
|
+
|
|
166
|
+
# Execute agent task (placeholder - replace with actual agent execution)
|
|
167
|
+
log_info "Agent executing task" "{\"agent_id\":\"$agent_id\",\"task_id\":\"$task_id\"}"
|
|
168
|
+
|
|
169
|
+
# Simulate agent work (replace with actual task execution)
|
|
170
|
+
# In real implementation, this would call the agent framework
|
|
171
|
+
# $spawn_cmd --agent-type "$agent_type" --task-id "$task_id" --task "$task_description"
|
|
172
|
+
|
|
173
|
+
# For demo purposes, sleep and complete
|
|
174
|
+
sleep 2
|
|
175
|
+
|
|
176
|
+
# Kill heartbeat process
|
|
177
|
+
kill "$heartbeat_pid" 2>/dev/null || true
|
|
178
|
+
|
|
179
|
+
# Mark completion (normally done by agent itself)
|
|
180
|
+
# agent_complete "$agent_id" "$task_id" 0.90 '{"status": "success"}'
|
|
181
|
+
|
|
182
|
+
) &
|
|
183
|
+
|
|
184
|
+
local agent_pid=$!
|
|
185
|
+
|
|
186
|
+
# Update PID in database - using parameterized query
|
|
187
|
+
sqlite_update "$AGENT_STATE_DB" \
|
|
188
|
+
"UPDATE agents SET pid = ?1 WHERE agent_id = ?2;" \
|
|
189
|
+
"$agent_pid" "$agent_id"
|
|
190
|
+
|
|
191
|
+
log_info "Agent spawned successfully" "{\"agent_id\":\"$agent_id\",\"pid\":$agent_pid}"
|
|
192
|
+
|
|
193
|
+
echo "$agent_id"
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
# --- Heartbeat Mechanism ---
|
|
197
|
+
|
|
198
|
+
# Send single heartbeat for agent
|
|
199
|
+
# Args: $1=agent_id, $2=task_id, $3=metadata (JSON, optional)
|
|
200
|
+
agent_heartbeat() {
|
|
201
|
+
local agent_id="$1"
|
|
202
|
+
local task_id="$2"
|
|
203
|
+
local metadata="${3:-{}}"
|
|
204
|
+
|
|
205
|
+
local timestamp
|
|
206
|
+
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
207
|
+
|
|
208
|
+
# Update last heartbeat in agents table - using parameterized queries
|
|
209
|
+
sqlite_update "$AGENT_STATE_DB" \
|
|
210
|
+
"UPDATE agents SET last_heartbeat = ?1 WHERE agent_id = ?2;" \
|
|
211
|
+
"$timestamp" "$agent_id"
|
|
212
|
+
sqlite_insert "$AGENT_STATE_DB" \
|
|
213
|
+
"INSERT INTO heartbeats (agent_id, task_id, timestamp, metadata) VALUES (?1, ?2, ?3, ?4);" \
|
|
214
|
+
"$agent_id" "$task_id" "$timestamp" "$metadata"
|
|
215
|
+
|
|
216
|
+
log_debug "Heartbeat sent" "{\"agent_id\":\"$agent_id\",\"task_id\":\"$task_id\"}"
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
# Continuous heartbeat loop (run in background)
|
|
220
|
+
# Args: $1=agent_id, $2=task_id
|
|
221
|
+
agent_heartbeat_loop() {
|
|
222
|
+
local agent_id="$1"
|
|
223
|
+
local task_id="$2"
|
|
224
|
+
|
|
225
|
+
while true; do
|
|
226
|
+
agent_heartbeat "$agent_id" "$task_id" || break
|
|
227
|
+
sleep "$HEARTBEAT_INTERVAL"
|
|
228
|
+
|
|
229
|
+
# Check if agent is still alive - using parameterized query
|
|
230
|
+
local status
|
|
231
|
+
status=$(sqlite_select "$AGENT_STATE_DB" "SELECT status FROM agents WHERE agent_id = ?1;" "$agent_id" || echo "unknown")
|
|
232
|
+
|
|
233
|
+
if [[ "$status" == "completed" ]] || [[ "$status" == "failed" ]] || [[ "$status" == "timeout" ]]; then
|
|
234
|
+
log_debug "Heartbeat loop stopping" "{\"agent_id\":\"$agent_id\",\"status\":\"$status\"}"
|
|
235
|
+
break
|
|
236
|
+
fi
|
|
237
|
+
done
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
# --- Completion Protocol ---
|
|
241
|
+
|
|
242
|
+
# Mark agent as completed
|
|
243
|
+
# Args: $1=agent_id, $2=task_id, $3=confidence, $4=result (JSON)
|
|
244
|
+
agent_complete() {
|
|
245
|
+
local agent_id="$1"
|
|
246
|
+
local task_id="$2"
|
|
247
|
+
local confidence="$3"
|
|
248
|
+
local result="$4"
|
|
249
|
+
|
|
250
|
+
local timestamp
|
|
251
|
+
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
252
|
+
|
|
253
|
+
# Update agent status - using parameterized query
|
|
254
|
+
sqlite_update "$AGENT_STATE_DB" \
|
|
255
|
+
"UPDATE agents SET status = 'completed', completed_at = ?1, confidence = ?2, result = ?3 WHERE agent_id = ?4;" \
|
|
256
|
+
"$timestamp" "$confidence" "$result" "$agent_id"
|
|
257
|
+
|
|
258
|
+
log_info "Agent completed" "{\"agent_id\":\"$agent_id\",\"task_id\":\"$task_id\",\"confidence\":$confidence}"
|
|
259
|
+
|
|
260
|
+
# Standard completion output format
|
|
261
|
+
cat <<EOF
|
|
262
|
+
{
|
|
263
|
+
"agent_id": "$agent_id",
|
|
264
|
+
"task_id": "$task_id",
|
|
265
|
+
"status": "completed",
|
|
266
|
+
"confidence": $confidence,
|
|
267
|
+
"completed_at": "$timestamp",
|
|
268
|
+
"result": $result
|
|
269
|
+
}
|
|
270
|
+
EOF
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
# Mark agent as failed
|
|
274
|
+
# Args: $1=agent_id, $2=task_id, $3=error_message
|
|
275
|
+
agent_fail() {
|
|
276
|
+
local agent_id="$1"
|
|
277
|
+
local task_id="$2"
|
|
278
|
+
local error_message="$3"
|
|
279
|
+
|
|
280
|
+
local timestamp
|
|
281
|
+
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
282
|
+
|
|
283
|
+
local error_result
|
|
284
|
+
error_result=$(cat <<EOF
|
|
285
|
+
{"error": "$error_message", "failed_at": "$timestamp"}
|
|
286
|
+
EOF
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
# Update agent status for failure - using parameterized query
|
|
290
|
+
sqlite_update "$AGENT_STATE_DB" \
|
|
291
|
+
"UPDATE agents SET status = 'failed', completed_at = ?1, confidence = 0.0, result = ?2 WHERE agent_id = ?3;" \
|
|
292
|
+
"$timestamp" "$error_result" "$agent_id"
|
|
293
|
+
|
|
294
|
+
log_error "Agent failed" "{\"agent_id\":\"$agent_id\",\"task_id\":\"$task_id\",\"error\":\"$error_message\"}"
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
# --- Timeout Handling ---
|
|
298
|
+
|
|
299
|
+
# Check for agent timeout and handle gracefully
|
|
300
|
+
# Args: $1=agent_id
|
|
301
|
+
# Returns: 0 if not timeout, 1 if timeout
|
|
302
|
+
agent_check_timeout() {
|
|
303
|
+
local agent_id="$1"
|
|
304
|
+
|
|
305
|
+
# Get agent data - using parameterized query
|
|
306
|
+
local agent_data
|
|
307
|
+
agent_data=$(sqlite_select "$AGENT_STATE_DB" "SELECT spawned_at, timeout_seconds, status, pid FROM agents WHERE agent_id = ?1;" "$agent_id" | tr '|' ' ')
|
|
308
|
+
|
|
309
|
+
read -r spawned_at timeout_seconds status pid <<< "$agent_data"
|
|
310
|
+
|
|
311
|
+
# Skip if already completed/failed
|
|
312
|
+
if [[ "$status" == "completed" ]] || [[ "$status" == "failed" ]] || [[ "$status" == "timeout" ]]; then
|
|
313
|
+
return 0
|
|
314
|
+
fi
|
|
315
|
+
|
|
316
|
+
# Calculate elapsed time
|
|
317
|
+
local spawned_epoch
|
|
318
|
+
spawned_epoch=$(date -d "$spawned_at" +%s)
|
|
319
|
+
local current_epoch
|
|
320
|
+
current_epoch=$(date +%s)
|
|
321
|
+
local elapsed=$((current_epoch - spawned_epoch))
|
|
322
|
+
|
|
323
|
+
if [[ $elapsed -gt $timeout_seconds ]]; then
|
|
324
|
+
log_warn "Agent timeout detected" "{\"agent_id\":\"$agent_id\",\"elapsed\":$elapsed,\"timeout\":$timeout_seconds}"
|
|
325
|
+
|
|
326
|
+
# Graceful termination: send SIGTERM
|
|
327
|
+
if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then
|
|
328
|
+
log_info "Sending SIGTERM to agent" "{\"agent_id\":\"$agent_id\",\"pid\":$pid}"
|
|
329
|
+
kill -TERM "$pid" || true
|
|
330
|
+
|
|
331
|
+
# Wait 5 seconds for graceful shutdown
|
|
332
|
+
sleep 5
|
|
333
|
+
|
|
334
|
+
# Force kill if still alive
|
|
335
|
+
if kill -0 "$pid" 2>/dev/null; then
|
|
336
|
+
log_warn "Force killing agent" "{\"agent_id\":\"$agent_id\",\"pid\":$pid}"
|
|
337
|
+
kill -KILL "$pid" || true
|
|
338
|
+
fi
|
|
339
|
+
fi
|
|
340
|
+
|
|
341
|
+
# Mark as timeout - using parameterized query
|
|
342
|
+
local timeout_timestamp
|
|
343
|
+
timeout_timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
344
|
+
local timeout_result
|
|
345
|
+
timeout_result="{\"error\": \"Agent exceeded timeout\", \"elapsed_seconds\": $elapsed}"
|
|
346
|
+
sqlite_update "$AGENT_STATE_DB" \
|
|
347
|
+
"UPDATE agents SET status = 'timeout', completed_at = ?1, result = ?2 WHERE agent_id = ?3;" \
|
|
348
|
+
"$timeout_timestamp" "$timeout_result" "$agent_id"
|
|
349
|
+
|
|
350
|
+
return 1
|
|
351
|
+
fi
|
|
352
|
+
|
|
353
|
+
return 0
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
# --- Wait for Completion ---
|
|
357
|
+
|
|
358
|
+
# Wait for agent to complete (with timeout)
|
|
359
|
+
# Args: $1=agent_id, $2=task_id, $3=timeout_seconds
|
|
360
|
+
# Returns: 0 if completed, 1 if timeout/failed
|
|
361
|
+
agent_wait_for_completion() {
|
|
362
|
+
local agent_id="$1"
|
|
363
|
+
local task_id="$2"
|
|
364
|
+
local timeout_seconds="${3:-$COMPLETION_TIMEOUT}"
|
|
365
|
+
|
|
366
|
+
log_info "Waiting for agent completion" "{\"agent_id\":\"$agent_id\",\"timeout\":$timeout_seconds}"
|
|
367
|
+
|
|
368
|
+
local start_time
|
|
369
|
+
start_time=$(date +%s)
|
|
370
|
+
|
|
371
|
+
while true; do
|
|
372
|
+
# Check status - using parameterized query
|
|
373
|
+
local status
|
|
374
|
+
status=$(sqlite_select "$AGENT_STATE_DB" "SELECT status FROM agents WHERE agent_id = ?1;" "$agent_id" || echo "unknown")
|
|
375
|
+
|
|
376
|
+
if [[ "$status" == "completed" ]]; then
|
|
377
|
+
log_info "Agent completed successfully" "{\"agent_id\":\"$agent_id\"}"
|
|
378
|
+
return 0
|
|
379
|
+
elif [[ "$status" == "failed" ]] || [[ "$status" == "timeout" ]]; then
|
|
380
|
+
log_error "Agent did not complete successfully" "{\"agent_id\":\"$agent_id\",\"status\":\"$status\"}"
|
|
381
|
+
return 1
|
|
382
|
+
fi
|
|
383
|
+
|
|
384
|
+
# Check timeout
|
|
385
|
+
local elapsed
|
|
386
|
+
elapsed=$(($(date +%s) - start_time))
|
|
387
|
+
if [[ $elapsed -gt $timeout_seconds ]]; then
|
|
388
|
+
log_error "Wait timeout exceeded" "{\"agent_id\":\"$agent_id\",\"elapsed\":$elapsed}"
|
|
389
|
+
return 1
|
|
390
|
+
fi
|
|
391
|
+
|
|
392
|
+
# Check agent timeout
|
|
393
|
+
agent_check_timeout "$agent_id" || return 1
|
|
394
|
+
|
|
395
|
+
# Sleep before next check
|
|
396
|
+
sleep 2
|
|
397
|
+
done
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
# --- Query Functions ---
|
|
401
|
+
|
|
402
|
+
# Get agent status
|
|
403
|
+
# Args: $1=agent_id
|
|
404
|
+
# Returns: JSON status
|
|
405
|
+
agent_get_status() {
|
|
406
|
+
local agent_id="$1"
|
|
407
|
+
|
|
408
|
+
# Get status - using parameterized query (manual JSON mode as sqlite_select doesn't support -json flag)
|
|
409
|
+
local status_json
|
|
410
|
+
status_json=$(sqlite3 -json "$AGENT_STATE_DB" ".parameter init
|
|
411
|
+
.parameter set ?1 \"$agent_id\"
|
|
412
|
+
SELECT * FROM agents WHERE agent_id = ?1;" | jq '.[0]')
|
|
413
|
+
|
|
414
|
+
echo "$status_json"
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
# Get all agents for task
|
|
418
|
+
# Args: $1=task_id
|
|
419
|
+
# Returns: JSON array
|
|
420
|
+
agent_get_by_task() {
|
|
421
|
+
local task_id="$1"
|
|
422
|
+
|
|
423
|
+
# Get agents by task - using parameterized query (manual JSON mode)
|
|
424
|
+
local agents_json
|
|
425
|
+
agents_json=$(sqlite3 -json "$AGENT_STATE_DB" ".parameter init
|
|
426
|
+
.parameter set ?1 \"$task_id\"
|
|
427
|
+
SELECT * FROM agents WHERE task_id = ?1 ORDER BY spawned_at DESC;")
|
|
428
|
+
|
|
429
|
+
echo "$agents_json"
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
# Get agent heartbeat history
|
|
433
|
+
# Args: $1=agent_id
|
|
434
|
+
# Returns: JSON array
|
|
435
|
+
agent_get_heartbeats() {
|
|
436
|
+
local agent_id="$1"
|
|
437
|
+
|
|
438
|
+
# Get heartbeats - using parameterized query (manual JSON mode)
|
|
439
|
+
local heartbeats_json
|
|
440
|
+
heartbeats_json=$(sqlite3 -json "$AGENT_STATE_DB" ".parameter init
|
|
441
|
+
.parameter set ?1 \"$agent_id\"
|
|
442
|
+
SELECT * FROM heartbeats WHERE agent_id = ?1 ORDER BY timestamp DESC LIMIT 100;")
|
|
443
|
+
|
|
444
|
+
echo "$heartbeats_json"
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
# --- Main Execution (if run directly) ---
|
|
448
|
+
|
|
449
|
+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
450
|
+
cat <<'EOF'
|
|
451
|
+
agent-handoff.sh - Standard agent handoff protocol
|
|
452
|
+
|
|
453
|
+
USAGE EXAMPLES:
|
|
454
|
+
|
|
455
|
+
# Spawn agent
|
|
456
|
+
agent_id=$(agent_spawn "backend-developer" "Implement API endpoint" "task-123" 3600)
|
|
457
|
+
|
|
458
|
+
# Send heartbeat
|
|
459
|
+
agent_heartbeat "$agent_id" "task-123"
|
|
460
|
+
|
|
461
|
+
# Wait for completion
|
|
462
|
+
agent_wait_for_completion "$agent_id" "task-123" 300
|
|
463
|
+
|
|
464
|
+
# Get status
|
|
465
|
+
agent_get_status "$agent_id"
|
|
466
|
+
|
|
467
|
+
# Mark as complete (normally done by agent itself)
|
|
468
|
+
agent_complete "$agent_id" "task-123" 0.90 '{"deliverables": ["api.ts"]}'
|
|
469
|
+
|
|
470
|
+
# Get all agents for task
|
|
471
|
+
agent_get_by_task "task-123"
|
|
472
|
+
|
|
473
|
+
CONFIGURATION:
|
|
474
|
+
AGENT_STATE_DB - SQLite database path (default: ./.claude/agents/state/agent-state.db)
|
|
475
|
+
HEARTBEAT_INTERVAL - Heartbeat frequency in seconds (default: 30)
|
|
476
|
+
COMPLETION_TIMEOUT - Default completion timeout (default: 300)
|
|
477
|
+
LOG_FILE - Structured log file (default: /tmp/agent-handoff.log)
|
|
478
|
+
AGENT_SPAWN_CMD - Agent spawn command (default: cfn-spawn agent)
|
|
479
|
+
|
|
480
|
+
BEFORE (Ad-hoc):
|
|
481
|
+
# ❌ No correlation, no heartbeat, no timeout handling
|
|
482
|
+
some-agent "do work" &
|
|
483
|
+
wait $!
|
|
484
|
+
|
|
485
|
+
AFTER (Standardized):
|
|
486
|
+
# ✅ Full protocol: spawn, heartbeat, timeout, completion
|
|
487
|
+
agent_id=$(agent_spawn "agent-type" "task description" "task-123" 3600)
|
|
488
|
+
agent_wait_for_completion "$agent_id" "task-123" 300
|
|
489
|
+
result=$(agent_get_status "$agent_id")
|
|
490
|
+
|
|
491
|
+
EOF
|
|
492
|
+
fi
|