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
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StandardAdapter.ts - Reference implementation of standardized integration patterns
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Standard data envelope (wrap/unwrap)
|
|
6
|
+
* - Standard error handling (try/catch/log/rethrow)
|
|
7
|
+
* - Standard logging (structured JSON)
|
|
8
|
+
* - Standard retry logic (exponential backoff)
|
|
9
|
+
* - Standard correlation tracking (task_id, agent_id)
|
|
10
|
+
*/ import { createHash } from 'crypto';
|
|
11
|
+
/**
|
|
12
|
+
* Default JSON logger implementation
|
|
13
|
+
*/ export class JSONLogger {
|
|
14
|
+
formatLog(level, message, context) {
|
|
15
|
+
return JSON.stringify({
|
|
16
|
+
level,
|
|
17
|
+
message,
|
|
18
|
+
timestamp: new Date().toISOString(),
|
|
19
|
+
...context
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
info(message, context) {
|
|
23
|
+
console.log(this.formatLog('INFO', message, context));
|
|
24
|
+
}
|
|
25
|
+
warn(message, context) {
|
|
26
|
+
console.warn(this.formatLog('WARN', message, context));
|
|
27
|
+
}
|
|
28
|
+
error(message, context) {
|
|
29
|
+
console.error(this.formatLog('ERROR', message, context));
|
|
30
|
+
}
|
|
31
|
+
debug(message, context) {
|
|
32
|
+
console.debug(this.formatLog('DEBUG', message, context));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* StandardAdapter - Reference implementation for integration patterns
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const adapter = new StandardAdapter({
|
|
41
|
+
* task_id: 'task-123',
|
|
42
|
+
* agent_id: 'agent-456',
|
|
43
|
+
* logger: new JSONLogger(),
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Wrap data
|
|
47
|
+
* const envelope = adapter.wrap({ user: 'john', action: 'login' });
|
|
48
|
+
*
|
|
49
|
+
* // Unwrap data with validation
|
|
50
|
+
* const data = adapter.unwrap(envelope);
|
|
51
|
+
*
|
|
52
|
+
* // Execute with retry
|
|
53
|
+
* const result = await adapter.withRetry(async () => {
|
|
54
|
+
* return await externalApiCall();
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/ export class StandardAdapter {
|
|
58
|
+
task_id;
|
|
59
|
+
agent_id;
|
|
60
|
+
logger;
|
|
61
|
+
default_retry_config;
|
|
62
|
+
constructor(config){
|
|
63
|
+
this.task_id = config.task_id;
|
|
64
|
+
this.agent_id = config.agent_id;
|
|
65
|
+
this.logger = config.logger || new JSONLogger();
|
|
66
|
+
this.default_retry_config = {
|
|
67
|
+
max_attempts: 3,
|
|
68
|
+
initial_delay_ms: 100,
|
|
69
|
+
max_delay_ms: 10000,
|
|
70
|
+
backoff_multiplier: 2,
|
|
71
|
+
jitter_factor: 0.1,
|
|
72
|
+
...config.retry_config
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Wrap payload in standard data envelope
|
|
77
|
+
*
|
|
78
|
+
* @param payload - Data to wrap
|
|
79
|
+
* @param metadata - Optional metadata
|
|
80
|
+
* @returns Standardized data envelope
|
|
81
|
+
*/ wrap(payload, metadata) {
|
|
82
|
+
const correlation_id = this.generateCorrelationId();
|
|
83
|
+
const timestamp = new Date().toISOString();
|
|
84
|
+
const content_hash = this.generateContentHash(payload);
|
|
85
|
+
const envelope = {
|
|
86
|
+
correlation_id,
|
|
87
|
+
task_id: this.task_id,
|
|
88
|
+
agent_id: this.agent_id,
|
|
89
|
+
timestamp,
|
|
90
|
+
payload,
|
|
91
|
+
metadata,
|
|
92
|
+
content_hash
|
|
93
|
+
};
|
|
94
|
+
this.logger.debug('Data wrapped in envelope', {
|
|
95
|
+
correlation_id,
|
|
96
|
+
task_id: this.task_id,
|
|
97
|
+
content_hash
|
|
98
|
+
});
|
|
99
|
+
return envelope;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unwrap and validate data envelope
|
|
103
|
+
*
|
|
104
|
+
* @param envelope - Data envelope to unwrap
|
|
105
|
+
* @returns Validated payload
|
|
106
|
+
* @throws Error if envelope is invalid or hash mismatch
|
|
107
|
+
*/ unwrap(envelope) {
|
|
108
|
+
try {
|
|
109
|
+
// Validate required fields
|
|
110
|
+
if (!envelope.correlation_id || !envelope.task_id || !envelope.payload) {
|
|
111
|
+
throw new Error('Invalid envelope: missing required fields');
|
|
112
|
+
}
|
|
113
|
+
// Verify content hash
|
|
114
|
+
const computed_hash = this.generateContentHash(envelope.payload);
|
|
115
|
+
if (computed_hash !== envelope.content_hash) {
|
|
116
|
+
throw new Error(`Content hash mismatch: expected ${envelope.content_hash}, got ${computed_hash}`);
|
|
117
|
+
}
|
|
118
|
+
this.logger.debug('Data unwrapped from envelope', {
|
|
119
|
+
correlation_id: envelope.correlation_id,
|
|
120
|
+
task_id: envelope.task_id
|
|
121
|
+
});
|
|
122
|
+
return envelope.payload;
|
|
123
|
+
} catch (error) {
|
|
124
|
+
this.logger.error('Failed to unwrap envelope', {
|
|
125
|
+
error: error instanceof Error ? error.message : String(error),
|
|
126
|
+
correlation_id: envelope.correlation_id
|
|
127
|
+
});
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Execute function with retry logic and exponential backoff
|
|
133
|
+
*
|
|
134
|
+
* @param fn - Function to execute
|
|
135
|
+
* @param config - Optional retry configuration
|
|
136
|
+
* @returns Result from successful execution
|
|
137
|
+
* @throws Error if all retry attempts fail
|
|
138
|
+
*/ async withRetry(fn, config) {
|
|
139
|
+
const retry_config = {
|
|
140
|
+
...this.default_retry_config,
|
|
141
|
+
...config
|
|
142
|
+
};
|
|
143
|
+
let last_error = null;
|
|
144
|
+
let attempt = 0;
|
|
145
|
+
while(attempt < retry_config.max_attempts){
|
|
146
|
+
try {
|
|
147
|
+
attempt++;
|
|
148
|
+
this.logger.debug('Executing with retry', {
|
|
149
|
+
task_id: this.task_id,
|
|
150
|
+
attempt,
|
|
151
|
+
max_attempts: retry_config.max_attempts
|
|
152
|
+
});
|
|
153
|
+
const result = await fn();
|
|
154
|
+
if (attempt > 1) {
|
|
155
|
+
this.logger.info('Retry succeeded', {
|
|
156
|
+
task_id: this.task_id,
|
|
157
|
+
attempt
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
last_error = error instanceof Error ? error : new Error(String(error));
|
|
163
|
+
this.logger.warn('Execution failed, will retry', {
|
|
164
|
+
task_id: this.task_id,
|
|
165
|
+
attempt,
|
|
166
|
+
max_attempts: retry_config.max_attempts,
|
|
167
|
+
error: last_error.message
|
|
168
|
+
});
|
|
169
|
+
// Don't delay after the last attempt
|
|
170
|
+
if (attempt < retry_config.max_attempts) {
|
|
171
|
+
const delay = this.calculateBackoffDelay(attempt, retry_config);
|
|
172
|
+
await this.sleep(delay);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// All retries exhausted
|
|
177
|
+
this.logger.error('All retry attempts exhausted', {
|
|
178
|
+
task_id: this.task_id,
|
|
179
|
+
attempts: retry_config.max_attempts,
|
|
180
|
+
error: last_error?.message
|
|
181
|
+
});
|
|
182
|
+
throw last_error || new Error('All retry attempts failed');
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Execute function with standard error handling
|
|
186
|
+
* Catches errors, logs them, and rethrows with additional context
|
|
187
|
+
*
|
|
188
|
+
* @param fn - Function to execute
|
|
189
|
+
* @param context - Error context information
|
|
190
|
+
* @returns Result from successful execution
|
|
191
|
+
* @throws Error with enriched context
|
|
192
|
+
*/ async withErrorHandling(fn, context = {}) {
|
|
193
|
+
try {
|
|
194
|
+
return await fn();
|
|
195
|
+
} catch (error) {
|
|
196
|
+
const error_envelope = {
|
|
197
|
+
correlation_id: this.generateCorrelationId(),
|
|
198
|
+
task_id: this.task_id,
|
|
199
|
+
error_code: 'EXECUTION_ERROR',
|
|
200
|
+
error_message: error instanceof Error ? error.message : String(error),
|
|
201
|
+
error_stack: error instanceof Error ? error.stack : undefined,
|
|
202
|
+
timestamp: new Date().toISOString(),
|
|
203
|
+
metadata: context
|
|
204
|
+
};
|
|
205
|
+
this.logger.error('Execution failed with error', error_envelope);
|
|
206
|
+
// Rethrow with enriched context
|
|
207
|
+
const enriched_error = new Error(error_envelope.error_message);
|
|
208
|
+
enriched_error.envelope = error_envelope;
|
|
209
|
+
throw enriched_error;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Generate unique correlation ID for request tracking
|
|
214
|
+
* Format: {task_id}-{timestamp}-{random}
|
|
215
|
+
*/ generateCorrelationId() {
|
|
216
|
+
const timestamp = Date.now();
|
|
217
|
+
const random = Math.random().toString(36).substring(2, 10);
|
|
218
|
+
return `${this.task_id}-${timestamp}-${random}`;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Generate SHA256 hash of payload for integrity verification
|
|
222
|
+
*/ generateContentHash(payload) {
|
|
223
|
+
const content = JSON.stringify(payload);
|
|
224
|
+
return createHash('sha256').update(content).digest('hex');
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Calculate exponential backoff delay with jitter
|
|
228
|
+
*/ calculateBackoffDelay(attempt, config) {
|
|
229
|
+
// Exponential backoff: initial_delay * (multiplier ^ (attempt - 1))
|
|
230
|
+
const base_delay = config.initial_delay_ms * Math.pow(config.backoff_multiplier, attempt - 1);
|
|
231
|
+
// Cap at max delay
|
|
232
|
+
const capped_delay = Math.min(base_delay, config.max_delay_ms);
|
|
233
|
+
// Add jitter to prevent thundering herd
|
|
234
|
+
const jitter = capped_delay * config.jitter_factor * Math.random();
|
|
235
|
+
return Math.floor(capped_delay + jitter);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Sleep for specified milliseconds
|
|
239
|
+
*/ sleep(ms) {
|
|
240
|
+
return new Promise((resolve)=>setTimeout(resolve, ms));
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get current task context
|
|
244
|
+
*/ getContext() {
|
|
245
|
+
return {
|
|
246
|
+
task_id: this.task_id,
|
|
247
|
+
agent_id: this.agent_id
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
} /**
|
|
251
|
+
* USAGE EXAMPLE - Before (Ad-hoc pattern):
|
|
252
|
+
*
|
|
253
|
+
* ```typescript
|
|
254
|
+
* // ❌ Ad-hoc error handling, no correlation, no retry
|
|
255
|
+
* async function processData(data: any) {
|
|
256
|
+
* try {
|
|
257
|
+
* const result = await externalApi.send(data);
|
|
258
|
+
* console.log('Success:', result);
|
|
259
|
+
* return result;
|
|
260
|
+
* } catch (err) {
|
|
261
|
+
* console.error('Error:', err);
|
|
262
|
+
* throw err;
|
|
263
|
+
* }
|
|
264
|
+
* }
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* USAGE EXAMPLE - After (Standardized pattern):
|
|
268
|
+
*
|
|
269
|
+
* ```typescript
|
|
270
|
+
* // ✅ Standardized with correlation, retry, structured logging
|
|
271
|
+
* const adapter = new StandardAdapter({
|
|
272
|
+
* task_id: 'data-processing-123',
|
|
273
|
+
* agent_id: 'processor-agent-1',
|
|
274
|
+
* });
|
|
275
|
+
*
|
|
276
|
+
* async function processData(data: any) {
|
|
277
|
+
* const envelope = adapter.wrap(data, { source: 'user_input' });
|
|
278
|
+
*
|
|
279
|
+
* const result = await adapter.withRetry(async () => {
|
|
280
|
+
* return await adapter.withErrorHandling(
|
|
281
|
+
* async () => externalApi.send(envelope),
|
|
282
|
+
* { operation: 'external_api_call' }
|
|
283
|
+
* );
|
|
284
|
+
* });
|
|
285
|
+
*
|
|
286
|
+
* return adapter.unwrap(result);
|
|
287
|
+
* }
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
//# sourceMappingURL=StandardAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/integration/StandardAdapter.ts"],"sourcesContent":["/**\r\n * StandardAdapter.ts - Reference implementation of standardized integration patterns\r\n *\r\n * Features:\r\n * - Standard data envelope (wrap/unwrap)\r\n * - Standard error handling (try/catch/log/rethrow)\r\n * - Standard logging (structured JSON)\r\n * - Standard retry logic (exponential backoff)\r\n * - Standard correlation tracking (task_id, agent_id)\r\n */\r\n\r\nimport { createHash } from 'crypto';\r\n\r\n/**\r\n * Standard data envelope for all integrations\r\n */\r\nexport interface DataEnvelope<T> {\r\n /** Unique correlation ID for request tracking */\r\n correlation_id: string;\r\n /** Task ID for workflow correlation */\r\n task_id: string;\r\n /** Agent ID for agent correlation */\r\n agent_id?: string;\r\n /** ISO 8601 timestamp */\r\n timestamp: string;\r\n /** Actual payload data */\r\n payload: T;\r\n /** Optional metadata for extensibility */\r\n metadata?: Record<string, unknown>;\r\n /** Content hash for integrity verification */\r\n content_hash: string;\r\n}\r\n\r\n/**\r\n * Standard error envelope for consistent error handling\r\n */\r\nexport interface ErrorEnvelope {\r\n correlation_id: string;\r\n task_id: string;\r\n error_code: string;\r\n error_message: string;\r\n error_stack?: string;\r\n timestamp: string;\r\n retry_count?: number;\r\n metadata?: Record<string, unknown>;\r\n}\r\n\r\n/**\r\n * Configuration for retry logic\r\n */\r\nexport interface RetryConfig {\r\n /** Maximum number of retry attempts */\r\n max_attempts: number;\r\n /** Initial backoff delay in milliseconds */\r\n initial_delay_ms: number;\r\n /** Maximum backoff delay in milliseconds */\r\n max_delay_ms: number;\r\n /** Backoff multiplier (exponential growth) */\r\n backoff_multiplier: number;\r\n /** Jitter factor (0-1) to prevent thundering herd */\r\n jitter_factor: number;\r\n}\r\n\r\n/**\r\n * Standard logger interface for structured logging\r\n */\r\nexport interface Logger {\r\n info(message: string, context?: Record<string, unknown>): void;\r\n warn(message: string, context?: Record<string, unknown>): void;\r\n error(message: string, context?: Record<string, unknown>): void;\r\n debug(message: string, context?: Record<string, unknown>): void;\r\n}\r\n\r\n/**\r\n * Default JSON logger implementation\r\n */\r\nexport class JSONLogger implements Logger {\r\n private formatLog(level: string, message: string, context?: Record<string, unknown>): string {\r\n return JSON.stringify({\r\n level,\r\n message,\r\n timestamp: new Date().toISOString(),\r\n ...context,\r\n });\r\n }\r\n\r\n info(message: string, context?: Record<string, unknown>): void {\r\n console.log(this.formatLog('INFO', message, context));\r\n }\r\n\r\n warn(message: string, context?: Record<string, unknown>): void {\r\n console.warn(this.formatLog('WARN', message, context));\r\n }\r\n\r\n error(message: string, context?: Record<string, unknown>): void {\r\n console.error(this.formatLog('ERROR', message, context));\r\n }\r\n\r\n debug(message: string, context?: Record<string, unknown>): void {\r\n console.debug(this.formatLog('DEBUG', message, context));\r\n }\r\n}\r\n\r\n/**\r\n * StandardAdapter - Reference implementation for integration patterns\r\n *\r\n * @example\r\n * ```typescript\r\n * const adapter = new StandardAdapter({\r\n * task_id: 'task-123',\r\n * agent_id: 'agent-456',\r\n * logger: new JSONLogger(),\r\n * });\r\n *\r\n * // Wrap data\r\n * const envelope = adapter.wrap({ user: 'john', action: 'login' });\r\n *\r\n * // Unwrap data with validation\r\n * const data = adapter.unwrap(envelope);\r\n *\r\n * // Execute with retry\r\n * const result = await adapter.withRetry(async () => {\r\n * return await externalApiCall();\r\n * });\r\n * ```\r\n */\r\nexport class StandardAdapter {\r\n private task_id: string;\r\n private agent_id?: string;\r\n private logger: Logger;\r\n private default_retry_config: RetryConfig;\r\n\r\n constructor(config: {\r\n task_id: string;\r\n agent_id?: string;\r\n logger?: Logger;\r\n retry_config?: Partial<RetryConfig>;\r\n }) {\r\n this.task_id = config.task_id;\r\n this.agent_id = config.agent_id;\r\n this.logger = config.logger || new JSONLogger();\r\n this.default_retry_config = {\r\n max_attempts: 3,\r\n initial_delay_ms: 100,\r\n max_delay_ms: 10000,\r\n backoff_multiplier: 2,\r\n jitter_factor: 0.1,\r\n ...config.retry_config,\r\n };\r\n }\r\n\r\n /**\r\n * Wrap payload in standard data envelope\r\n *\r\n * @param payload - Data to wrap\r\n * @param metadata - Optional metadata\r\n * @returns Standardized data envelope\r\n */\r\n wrap<T>(payload: T, metadata?: Record<string, unknown>): DataEnvelope<T> {\r\n const correlation_id = this.generateCorrelationId();\r\n const timestamp = new Date().toISOString();\r\n const content_hash = this.generateContentHash(payload);\r\n\r\n const envelope: DataEnvelope<T> = {\r\n correlation_id,\r\n task_id: this.task_id,\r\n agent_id: this.agent_id,\r\n timestamp,\r\n payload,\r\n metadata,\r\n content_hash,\r\n };\r\n\r\n this.logger.debug('Data wrapped in envelope', {\r\n correlation_id,\r\n task_id: this.task_id,\r\n content_hash,\r\n });\r\n\r\n return envelope;\r\n }\r\n\r\n /**\r\n * Unwrap and validate data envelope\r\n *\r\n * @param envelope - Data envelope to unwrap\r\n * @returns Validated payload\r\n * @throws Error if envelope is invalid or hash mismatch\r\n */\r\n unwrap<T>(envelope: DataEnvelope<T>): T {\r\n try {\r\n // Validate required fields\r\n if (!envelope.correlation_id || !envelope.task_id || !envelope.payload) {\r\n throw new Error('Invalid envelope: missing required fields');\r\n }\r\n\r\n // Verify content hash\r\n const computed_hash = this.generateContentHash(envelope.payload);\r\n if (computed_hash !== envelope.content_hash) {\r\n throw new Error(\r\n `Content hash mismatch: expected ${envelope.content_hash}, got ${computed_hash}`\r\n );\r\n }\r\n\r\n this.logger.debug('Data unwrapped from envelope', {\r\n correlation_id: envelope.correlation_id,\r\n task_id: envelope.task_id,\r\n });\r\n\r\n return envelope.payload;\r\n } catch (error) {\r\n this.logger.error('Failed to unwrap envelope', {\r\n error: error instanceof Error ? error.message : String(error),\r\n correlation_id: envelope.correlation_id,\r\n });\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Execute function with retry logic and exponential backoff\r\n *\r\n * @param fn - Function to execute\r\n * @param config - Optional retry configuration\r\n * @returns Result from successful execution\r\n * @throws Error if all retry attempts fail\r\n */\r\n async withRetry<T>(\r\n fn: () => Promise<T>,\r\n config?: Partial<RetryConfig>\r\n ): Promise<T> {\r\n const retry_config = { ...this.default_retry_config, ...config };\r\n let last_error: Error | null = null;\r\n let attempt = 0;\r\n\r\n while (attempt < retry_config.max_attempts) {\r\n try {\r\n attempt++;\r\n this.logger.debug('Executing with retry', {\r\n task_id: this.task_id,\r\n attempt,\r\n max_attempts: retry_config.max_attempts,\r\n });\r\n\r\n const result = await fn();\r\n\r\n if (attempt > 1) {\r\n this.logger.info('Retry succeeded', {\r\n task_id: this.task_id,\r\n attempt,\r\n });\r\n }\r\n\r\n return result;\r\n } catch (error) {\r\n last_error = error instanceof Error ? error : new Error(String(error));\r\n\r\n this.logger.warn('Execution failed, will retry', {\r\n task_id: this.task_id,\r\n attempt,\r\n max_attempts: retry_config.max_attempts,\r\n error: last_error.message,\r\n });\r\n\r\n // Don't delay after the last attempt\r\n if (attempt < retry_config.max_attempts) {\r\n const delay = this.calculateBackoffDelay(attempt, retry_config);\r\n await this.sleep(delay);\r\n }\r\n }\r\n }\r\n\r\n // All retries exhausted\r\n this.logger.error('All retry attempts exhausted', {\r\n task_id: this.task_id,\r\n attempts: retry_config.max_attempts,\r\n error: last_error?.message,\r\n });\r\n\r\n throw last_error || new Error('All retry attempts failed');\r\n }\r\n\r\n /**\r\n * Execute function with standard error handling\r\n * Catches errors, logs them, and rethrows with additional context\r\n *\r\n * @param fn - Function to execute\r\n * @param context - Error context information\r\n * @returns Result from successful execution\r\n * @throws Error with enriched context\r\n */\r\n async withErrorHandling<T>(\r\n fn: () => Promise<T>,\r\n context: Record<string, unknown> = {}\r\n ): Promise<T> {\r\n try {\r\n return await fn();\r\n } catch (error) {\r\n const error_envelope: ErrorEnvelope = {\r\n correlation_id: this.generateCorrelationId(),\r\n task_id: this.task_id,\r\n error_code: 'EXECUTION_ERROR',\r\n error_message: error instanceof Error ? error.message : String(error),\r\n error_stack: error instanceof Error ? error.stack : undefined,\r\n timestamp: new Date().toISOString(),\r\n metadata: context,\r\n };\r\n\r\n this.logger.error('Execution failed with error', error_envelope);\r\n\r\n // Rethrow with enriched context\r\n const enriched_error = new Error(error_envelope.error_message);\r\n (enriched_error as any).envelope = error_envelope;\r\n throw enriched_error;\r\n }\r\n }\r\n\r\n /**\r\n * Generate unique correlation ID for request tracking\r\n * Format: {task_id}-{timestamp}-{random}\r\n */\r\n private generateCorrelationId(): string {\r\n const timestamp = Date.now();\r\n const random = Math.random().toString(36).substring(2, 10);\r\n return `${this.task_id}-${timestamp}-${random}`;\r\n }\r\n\r\n /**\r\n * Generate SHA256 hash of payload for integrity verification\r\n */\r\n private generateContentHash<T>(payload: T): string {\r\n const content = JSON.stringify(payload);\r\n return createHash('sha256').update(content).digest('hex');\r\n }\r\n\r\n /**\r\n * Calculate exponential backoff delay with jitter\r\n */\r\n private calculateBackoffDelay(attempt: number, config: RetryConfig): number {\r\n // Exponential backoff: initial_delay * (multiplier ^ (attempt - 1))\r\n const base_delay = config.initial_delay_ms * Math.pow(config.backoff_multiplier, attempt - 1);\r\n\r\n // Cap at max delay\r\n const capped_delay = Math.min(base_delay, config.max_delay_ms);\r\n\r\n // Add jitter to prevent thundering herd\r\n const jitter = capped_delay * config.jitter_factor * Math.random();\r\n\r\n return Math.floor(capped_delay + jitter);\r\n }\r\n\r\n /**\r\n * Sleep for specified milliseconds\r\n */\r\n private sleep(ms: number): Promise<void> {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n }\r\n\r\n /**\r\n * Get current task context\r\n */\r\n getContext(): { task_id: string; agent_id?: string } {\r\n return {\r\n task_id: this.task_id,\r\n agent_id: this.agent_id,\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * USAGE EXAMPLE - Before (Ad-hoc pattern):\r\n *\r\n * ```typescript\r\n * // ❌ Ad-hoc error handling, no correlation, no retry\r\n * async function processData(data: any) {\r\n * try {\r\n * const result = await externalApi.send(data);\r\n * console.log('Success:', result);\r\n * return result;\r\n * } catch (err) {\r\n * console.error('Error:', err);\r\n * throw err;\r\n * }\r\n * }\r\n * ```\r\n *\r\n * USAGE EXAMPLE - After (Standardized pattern):\r\n *\r\n * ```typescript\r\n * // ✅ Standardized with correlation, retry, structured logging\r\n * const adapter = new StandardAdapter({\r\n * task_id: 'data-processing-123',\r\n * agent_id: 'processor-agent-1',\r\n * });\r\n *\r\n * async function processData(data: any) {\r\n * const envelope = adapter.wrap(data, { source: 'user_input' });\r\n *\r\n * const result = await adapter.withRetry(async () => {\r\n * return await adapter.withErrorHandling(\r\n * async () => externalApi.send(envelope),\r\n * { operation: 'external_api_call' }\r\n * );\r\n * });\r\n *\r\n * return adapter.unwrap(result);\r\n * }\r\n * ```\r\n */\r\n"],"names":["createHash","JSONLogger","formatLog","level","message","context","JSON","stringify","timestamp","Date","toISOString","info","console","log","warn","error","debug","StandardAdapter","task_id","agent_id","logger","default_retry_config","config","max_attempts","initial_delay_ms","max_delay_ms","backoff_multiplier","jitter_factor","retry_config","wrap","payload","metadata","correlation_id","generateCorrelationId","content_hash","generateContentHash","envelope","unwrap","Error","computed_hash","String","withRetry","fn","last_error","attempt","result","delay","calculateBackoffDelay","sleep","attempts","withErrorHandling","error_envelope","error_code","error_message","error_stack","stack","undefined","enriched_error","now","random","Math","toString","substring","content","update","digest","base_delay","pow","capped_delay","min","jitter","floor","ms","Promise","resolve","setTim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