@stackmemoryai/stackmemory 0.5.59 → 0.5.61
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/README.md +105 -1
- package/dist/src/cli/claude-sm.js +130 -50
- package/dist/src/cli/claude-sm.js.map +2 -2
- package/dist/src/cli/index.js +18 -3
- package/dist/src/cli/index.js.map +3 -3
- package/dist/src/core/extensions/custom-tools.js +567 -0
- package/dist/src/core/extensions/custom-tools.js.map +7 -0
- package/dist/src/core/extensions/index.js +55 -0
- package/dist/src/core/extensions/index.js.map +7 -0
- package/dist/src/core/extensions/loader.js +709 -0
- package/dist/src/core/extensions/loader.js.map +7 -0
- package/dist/src/core/extensions/plugin-system.js +506 -0
- package/dist/src/core/extensions/plugin-system.js.map +7 -0
- package/dist/src/core/extensions/provider-adapter.js +617 -0
- package/dist/src/core/extensions/provider-adapter.js.map +7 -0
- package/dist/src/core/extensions/sandbox-runtime.js +664 -0
- package/dist/src/core/extensions/sandbox-runtime.js.map +7 -0
- package/dist/src/core/storage/chromadb-adapter.js +32 -6
- package/dist/src/core/storage/chromadb-adapter.js.map +2 -2
- package/dist/src/skills/repo-ingestion-skill.js +35 -12
- package/dist/src/skills/repo-ingestion-skill.js.map +2 -2
- package/package.json +11 -7
- package/scripts/background-sync-manager.js +145 -83
- package/scripts/claude-sm-autostart.js +17 -12
- package/scripts/gepa/README.md +275 -0
- package/scripts/gepa/config.json +53 -0
- package/scripts/gepa/evals/coding-tasks.jsonl +5 -0
- package/scripts/gepa/evals/fixtures/buggy-loop.js +18 -0
- package/scripts/gepa/evals/fixtures/callback-hell.js +53 -0
- package/scripts/gepa/generations/gen-000/baseline.md +124 -0
- package/scripts/gepa/hooks/auto-optimize.js +494 -0
- package/scripts/gepa/hooks/eval-tracker.js +203 -0
- package/scripts/gepa/hooks/reflect.js +311 -0
- package/scripts/gepa/optimize.js +611 -0
- package/scripts/gepa/state.json +14 -0
- package/scripts/test-pre-publish-quick.sh +1 -1
- package/dist/agents/core/agent-task-manager.js +0 -527
- package/dist/agents/core/agent-task-manager.js.map +0 -7
- package/dist/agents/testing-agent.js +0 -614
- package/dist/agents/testing-agent.js.map +0 -7
- package/dist/agents/verifiers/base-verifier.js +0 -133
- package/dist/agents/verifiers/base-verifier.js.map +0 -7
- package/dist/agents/verifiers/formatter-verifier.js +0 -130
- package/dist/agents/verifiers/formatter-verifier.js.map +0 -7
- package/dist/agents/verifiers/llm-judge.js +0 -252
- package/dist/agents/verifiers/llm-judge.js.map +0 -7
- package/dist/cli/auto-detect.js +0 -321
- package/dist/cli/auto-detect.js.map +0 -7
- package/dist/cli/browser-test.js +0 -33
- package/dist/cli/browser-test.js.map +0 -7
- package/dist/cli/claude-sm-danger.js +0 -21
- package/dist/cli/claude-sm-danger.js.map +0 -7
- package/dist/cli/claude-sm.js +0 -1156
- package/dist/cli/claude-sm.js.map +0 -7
- package/dist/cli/codex-sm-danger.js +0 -21
- package/dist/cli/codex-sm-danger.js.map +0 -7
- package/dist/cli/codex-sm.js +0 -349
- package/dist/cli/codex-sm.js.map +0 -7
- package/dist/cli/commands/api.js +0 -232
- package/dist/cli/commands/api.js.map +0 -7
- package/dist/cli/commands/auto-background.js +0 -180
- package/dist/cli/commands/auto-background.js.map +0 -7
- package/dist/cli/commands/cleanup-processes.js +0 -68
- package/dist/cli/commands/cleanup-processes.js.map +0 -7
- package/dist/cli/commands/clear.js +0 -202
- package/dist/cli/commands/clear.js.map +0 -7
- package/dist/cli/commands/config.js +0 -445
- package/dist/cli/commands/config.js.map +0 -7
- package/dist/cli/commands/context-rehydrate.js +0 -751
- package/dist/cli/commands/context-rehydrate.js.map +0 -7
- package/dist/cli/commands/context.js +0 -343
- package/dist/cli/commands/context.js.map +0 -7
- package/dist/cli/commands/daemon.js +0 -392
- package/dist/cli/commands/daemon.js.map +0 -7
- package/dist/cli/commands/dashboard.js +0 -210
- package/dist/cli/commands/dashboard.js.map +0 -7
- package/dist/cli/commands/db.js +0 -147
- package/dist/cli/commands/db.js.map +0 -7
- package/dist/cli/commands/decision.js +0 -266
- package/dist/cli/commands/decision.js.map +0 -7
- package/dist/cli/commands/discovery.js +0 -279
- package/dist/cli/commands/discovery.js.map +0 -7
- package/dist/cli/commands/handoff.js +0 -624
- package/dist/cli/commands/handoff.js.map +0 -7
- package/dist/cli/commands/hooks.js +0 -298
- package/dist/cli/commands/hooks.js.map +0 -7
- package/dist/cli/commands/linear-unified.js +0 -353
- package/dist/cli/commands/linear-unified.js.map +0 -7
- package/dist/cli/commands/linear.js +0 -529
- package/dist/cli/commands/linear.js.map +0 -7
- package/dist/cli/commands/log.js +0 -169
- package/dist/cli/commands/log.js.map +0 -7
- package/dist/cli/commands/login.js +0 -172
- package/dist/cli/commands/login.js.map +0 -7
- package/dist/cli/commands/migrate.js +0 -240
- package/dist/cli/commands/migrate.js.map +0 -7
- package/dist/cli/commands/model.js +0 -533
- package/dist/cli/commands/model.js.map +0 -7
- package/dist/cli/commands/monitor.js +0 -313
- package/dist/cli/commands/monitor.js.map +0 -7
- package/dist/cli/commands/onboard.js +0 -536
- package/dist/cli/commands/onboard.js.map +0 -7
- package/dist/cli/commands/projects.js +0 -199
- package/dist/cli/commands/projects.js.map +0 -7
- package/dist/cli/commands/quality.js +0 -413
- package/dist/cli/commands/quality.js.map +0 -7
- package/dist/cli/commands/ralph.js +0 -909
- package/dist/cli/commands/ralph.js.map +0 -7
- package/dist/cli/commands/retrieval.js +0 -248
- package/dist/cli/commands/retrieval.js.map +0 -7
- package/dist/cli/commands/search.js +0 -173
- package/dist/cli/commands/search.js.map +0 -7
- package/dist/cli/commands/service.js +0 -749
- package/dist/cli/commands/service.js.map +0 -7
- package/dist/cli/commands/session.js +0 -200
- package/dist/cli/commands/session.js.map +0 -7
- package/dist/cli/commands/settings.js +0 -306
- package/dist/cli/commands/settings.js.map +0 -7
- package/dist/cli/commands/setup.js +0 -701
- package/dist/cli/commands/setup.js.map +0 -7
- package/dist/cli/commands/shell.js +0 -249
- package/dist/cli/commands/shell.js.map +0 -7
- package/dist/cli/commands/signup.js +0 -50
- package/dist/cli/commands/signup.js.map +0 -7
- package/dist/cli/commands/skills.js +0 -470
- package/dist/cli/commands/skills.js.map +0 -7
- package/dist/cli/commands/sms-notify.js +0 -795
- package/dist/cli/commands/sms-notify.js.map +0 -7
- package/dist/cli/commands/storage-tier.js +0 -183
- package/dist/cli/commands/storage-tier.js.map +0 -7
- package/dist/cli/commands/storage.js +0 -360
- package/dist/cli/commands/storage.js.map +0 -7
- package/dist/cli/commands/sweep.js +0 -249
- package/dist/cli/commands/sweep.js.map +0 -7
- package/dist/cli/commands/tasks.js +0 -213
- package/dist/cli/commands/tasks.js.map +0 -7
- package/dist/cli/commands/test.js +0 -286
- package/dist/cli/commands/test.js.map +0 -7
- package/dist/cli/commands/workflow.js +0 -142
- package/dist/cli/commands/workflow.js.map +0 -7
- package/dist/cli/commands/worktree.js +0 -319
- package/dist/cli/commands/worktree.js.map +0 -7
- package/dist/cli/index.js +0 -594
- package/dist/cli/index.js.map +0 -7
- package/dist/cli/opencode-sm.js +0 -448
- package/dist/cli/opencode-sm.js.map +0 -7
- package/dist/cli/utils/viewer.js +0 -96
- package/dist/cli/utils/viewer.js.map +0 -7
- package/dist/core/analytics/team-analytics.js +0 -378
- package/dist/core/analytics/team-analytics.js.map +0 -7
- package/dist/core/config/config-manager.js +0 -398
- package/dist/core/config/config-manager.js.map +0 -7
- package/dist/core/config/feature-flags.js +0 -76
- package/dist/core/config/feature-flags.js.map +0 -7
- package/dist/core/config/storage-config.js +0 -115
- package/dist/core/config/storage-config.js.map +0 -7
- package/dist/core/config/types.js +0 -144
- package/dist/core/config/types.js.map +0 -7
- package/dist/core/context/auto-context.js +0 -80
- package/dist/core/context/auto-context.js.map +0 -7
- package/dist/core/context/dual-stack-manager.js +0 -870
- package/dist/core/context/dual-stack-manager.js.map +0 -7
- package/dist/core/context/enhanced-rehydration.js +0 -994
- package/dist/core/context/enhanced-rehydration.js.map +0 -7
- package/dist/core/context/frame-database.js +0 -479
- package/dist/core/context/frame-database.js.map +0 -7
- package/dist/core/context/frame-digest.js +0 -250
- package/dist/core/context/frame-digest.js.map +0 -7
- package/dist/core/context/frame-handoff-manager.js +0 -778
- package/dist/core/context/frame-handoff-manager.js.map +0 -7
- package/dist/core/context/frame-lifecycle-hooks.js +0 -119
- package/dist/core/context/frame-lifecycle-hooks.js.map +0 -7
- package/dist/core/context/frame-manager.js +0 -1069
- package/dist/core/context/frame-manager.js.map +0 -7
- package/dist/core/context/frame-recovery.js +0 -302
- package/dist/core/context/frame-recovery.js.map +0 -7
- package/dist/core/context/frame-stack.js +0 -314
- package/dist/core/context/frame-stack.js.map +0 -7
- package/dist/core/context/frame-types.js +0 -5
- package/dist/core/context/frame-types.js.map +0 -7
- package/dist/core/context/incremental-gc.js +0 -290
- package/dist/core/context/incremental-gc.js.map +0 -7
- package/dist/core/context/index.js +0 -25
- package/dist/core/context/index.js.map +0 -7
- package/dist/core/context/model-aware-compaction.js +0 -623
- package/dist/core/context/model-aware-compaction.js.map +0 -7
- package/dist/core/context/permission-manager.js +0 -185
- package/dist/core/context/permission-manager.js.map +0 -7
- package/dist/core/context/recursive-context-manager.js +0 -592
- package/dist/core/context/recursive-context-manager.js.map +0 -7
- package/dist/core/context/refactored-frame-manager.js +0 -754
- package/dist/core/context/refactored-frame-manager.js.map +0 -7
- package/dist/core/context/shared-context-layer.js +0 -621
- package/dist/core/context/shared-context-layer.js.map +0 -7
- package/dist/core/context/stack-merge-resolver.js +0 -749
- package/dist/core/context/stack-merge-resolver.js.map +0 -7
- package/dist/core/context/validation.js +0 -130
- package/dist/core/context/validation.js.map +0 -7
- package/dist/core/database/batch-operations.js +0 -384
- package/dist/core/database/batch-operations.js.map +0 -7
- package/dist/core/database/connection-pool.js +0 -330
- package/dist/core/database/connection-pool.js.map +0 -7
- package/dist/core/database/database-adapter.js +0 -60
- package/dist/core/database/database-adapter.js.map +0 -7
- package/dist/core/database/migration-manager.js +0 -614
- package/dist/core/database/migration-manager.js.map +0 -7
- package/dist/core/database/paradedb-adapter.js +0 -990
- package/dist/core/database/paradedb-adapter.js.map +0 -7
- package/dist/core/database/query-cache.js +0 -298
- package/dist/core/database/query-cache.js.map +0 -7
- package/dist/core/database/query-router.js +0 -430
- package/dist/core/database/query-router.js.map +0 -7
- package/dist/core/database/sqlite-adapter.js +0 -738
- package/dist/core/database/sqlite-adapter.js.map +0 -7
- package/dist/core/digest/enhanced-hybrid-digest.js +0 -277
- package/dist/core/digest/enhanced-hybrid-digest.js.map +0 -7
- package/dist/core/digest/frame-digest-integration.js +0 -176
- package/dist/core/digest/frame-digest-integration.js.map +0 -7
- package/dist/core/digest/hybrid-digest-generator.js +0 -553
- package/dist/core/digest/hybrid-digest-generator.js.map +0 -7
- package/dist/core/digest/index.js +0 -9
- package/dist/core/digest/index.js.map +0 -7
- package/dist/core/digest/types.js +0 -25
- package/dist/core/digest/types.js.map +0 -7
- package/dist/core/errors/error-utils.js +0 -208
- package/dist/core/errors/error-utils.js.map +0 -7
- package/dist/core/errors/index.js +0 -521
- package/dist/core/errors/index.js.map +0 -7
- package/dist/core/errors/recovery.js +0 -269
- package/dist/core/errors/recovery.js.map +0 -7
- package/dist/core/execution/parallel-executor.js +0 -258
- package/dist/core/execution/parallel-executor.js.map +0 -7
- package/dist/core/frame/workflow-templates.js +0 -319
- package/dist/core/frame/workflow-templates.js.map +0 -7
- package/dist/core/merge/conflict-detector.js +0 -431
- package/dist/core/merge/conflict-detector.js.map +0 -7
- package/dist/core/merge/index.js +0 -9
- package/dist/core/merge/index.js.map +0 -7
- package/dist/core/merge/resolution-engine.js +0 -558
- package/dist/core/merge/resolution-engine.js.map +0 -7
- package/dist/core/merge/stack-diff.js +0 -532
- package/dist/core/merge/stack-diff.js.map +0 -7
- package/dist/core/merge/unified-merge-resolver.js +0 -303
- package/dist/core/merge/unified-merge-resolver.js.map +0 -7
- package/dist/core/models/fallback-monitor.js +0 -232
- package/dist/core/models/fallback-monitor.js.map +0 -7
- package/dist/core/models/model-router.js +0 -340
- package/dist/core/models/model-router.js.map +0 -7
- package/dist/core/monitoring/error-handler.js +0 -49
- package/dist/core/monitoring/error-handler.js.map +0 -7
- package/dist/core/monitoring/logger.js +0 -202
- package/dist/core/monitoring/logger.js.map +0 -7
- package/dist/core/monitoring/metrics.js +0 -172
- package/dist/core/monitoring/metrics.js.map +0 -7
- package/dist/core/monitoring/progress-tracker.js +0 -189
- package/dist/core/monitoring/progress-tracker.js.map +0 -7
- package/dist/core/monitoring/session-monitor.js +0 -300
- package/dist/core/monitoring/session-monitor.js.map +0 -7
- package/dist/core/performance/context-cache.js +0 -273
- package/dist/core/performance/context-cache.js.map +0 -7
- package/dist/core/performance/index.js +0 -11
- package/dist/core/performance/index.js.map +0 -7
- package/dist/core/performance/lazy-context-loader.js +0 -327
- package/dist/core/performance/lazy-context-loader.js.map +0 -7
- package/dist/core/performance/monitor.js +0 -221
- package/dist/core/performance/monitor.js.map +0 -7
- package/dist/core/performance/optimized-frame-context.js +0 -345
- package/dist/core/performance/optimized-frame-context.js.map +0 -7
- package/dist/core/performance/performance-benchmark.js +0 -277
- package/dist/core/performance/performance-benchmark.js.map +0 -7
- package/dist/core/performance/performance-profiler.js +0 -370
- package/dist/core/performance/performance-profiler.js.map +0 -7
- package/dist/core/performance/streaming-jsonl-parser.js +0 -195
- package/dist/core/performance/streaming-jsonl-parser.js.map +0 -7
- package/dist/core/persistence/postgres-adapter.js +0 -349
- package/dist/core/persistence/postgres-adapter.js.map +0 -7
- package/dist/core/projects/project-isolation.js +0 -201
- package/dist/core/projects/project-isolation.js.map +0 -7
- package/dist/core/projects/project-manager.js +0 -697
- package/dist/core/projects/project-manager.js.map +0 -7
- package/dist/core/query/query-parser.js +0 -370
- package/dist/core/query/query-parser.js.map +0 -7
- package/dist/core/query/query-templates.js +0 -321
- package/dist/core/query/query-templates.js.map +0 -7
- package/dist/core/retrieval/context-retriever.js +0 -479
- package/dist/core/retrieval/context-retriever.js.map +0 -7
- package/dist/core/retrieval/graph-retrieval.js +0 -662
- package/dist/core/retrieval/graph-retrieval.js.map +0 -7
- package/dist/core/retrieval/hierarchical-retrieval.js +0 -656
- package/dist/core/retrieval/hierarchical-retrieval.js.map +0 -7
- package/dist/core/retrieval/index.js +0 -8
- package/dist/core/retrieval/index.js.map +0 -7
- package/dist/core/retrieval/llm-context-retrieval.js +0 -613
- package/dist/core/retrieval/llm-context-retrieval.js.map +0 -7
- package/dist/core/retrieval/llm-provider.js +0 -151
- package/dist/core/retrieval/llm-provider.js.map +0 -7
- package/dist/core/retrieval/retrieval-audit.js +0 -236
- package/dist/core/retrieval/retrieval-audit.js.map +0 -7
- package/dist/core/retrieval/retrieval-benchmarks.js +0 -521
- package/dist/core/retrieval/retrieval-benchmarks.js.map +0 -7
- package/dist/core/retrieval/summary-generator.js +0 -589
- package/dist/core/retrieval/summary-generator.js.map +0 -7
- package/dist/core/retrieval/types.js +0 -21
- package/dist/core/retrieval/types.js.map +0 -7
- package/dist/core/security/index.js +0 -35
- package/dist/core/security/index.js.map +0 -7
- package/dist/core/security/input-sanitizer.js +0 -321
- package/dist/core/security/input-sanitizer.js.map +0 -7
- package/dist/core/session/clear-survival.js +0 -465
- package/dist/core/session/clear-survival.js.map +0 -7
- package/dist/core/session/enhanced-handoff.js +0 -792
- package/dist/core/session/enhanced-handoff.js.map +0 -7
- package/dist/core/session/handoff-generator.js +0 -343
- package/dist/core/session/handoff-generator.js.map +0 -7
- package/dist/core/session/index.js +0 -15
- package/dist/core/session/index.js.map +0 -7
- package/dist/core/session/session-manager.js +0 -347
- package/dist/core/session/session-manager.js.map +0 -7
- package/dist/core/skills/index.js +0 -7
- package/dist/core/skills/index.js.map +0 -7
- package/dist/core/skills/skill-storage.js +0 -764
- package/dist/core/skills/skill-storage.js.map +0 -7
- package/dist/core/skills/types.js +0 -193
- package/dist/core/skills/types.js.map +0 -7
- package/dist/core/storage/chromadb-adapter.js +0 -354
- package/dist/core/storage/chromadb-adapter.js.map +0 -7
- package/dist/core/storage/infinite-storage.js +0 -510
- package/dist/core/storage/infinite-storage.js.map +0 -7
- package/dist/core/storage/railway-optimized-storage.js +0 -591
- package/dist/core/storage/railway-optimized-storage.js.map +0 -7
- package/dist/core/storage/remote-storage.js +0 -489
- package/dist/core/storage/remote-storage.js.map +0 -7
- package/dist/core/storage/two-tier-storage.js +0 -766
- package/dist/core/storage/two-tier-storage.js.map +0 -7
- package/dist/core/trace/cli-trace-wrapper.js +0 -132
- package/dist/core/trace/cli-trace-wrapper.js.map +0 -7
- package/dist/core/trace/db-trace-wrapper.js +0 -247
- package/dist/core/trace/db-trace-wrapper.js.map +0 -7
- package/dist/core/trace/debug-trace.js +0 -417
- package/dist/core/trace/debug-trace.js.map +0 -7
- package/dist/core/trace/index.js +0 -109
- package/dist/core/trace/index.js.map +0 -7
- package/dist/core/trace/linear-api-wrapper.js +0 -178
- package/dist/core/trace/linear-api-wrapper.js.map +0 -7
- package/dist/core/trace/trace-demo.js +0 -154
- package/dist/core/trace/trace-demo.js.map +0 -7
- package/dist/core/trace/trace-detector.demo.js +0 -142
- package/dist/core/trace/trace-detector.demo.js.map +0 -7
- package/dist/core/trace/trace-detector.js +0 -528
- package/dist/core/trace/trace-detector.js.map +0 -7
- package/dist/core/trace/trace-store.js +0 -345
- package/dist/core/trace/trace-store.js.map +0 -7
- package/dist/core/trace/types.js +0 -77
- package/dist/core/trace/types.js.map +0 -7
- package/dist/core/types.js +0 -5
- package/dist/core/types.js.map +0 -7
- package/dist/core/utils/async-mutex.js +0 -114
- package/dist/core/utils/async-mutex.js.map +0 -7
- package/dist/core/utils/compression.js +0 -83
- package/dist/core/utils/compression.js.map +0 -7
- package/dist/core/utils/update-checker.js +0 -218
- package/dist/core/utils/update-checker.js.map +0 -7
- package/dist/core/worktree/worktree-manager.js +0 -465
- package/dist/core/worktree/worktree-manager.js.map +0 -7
- package/dist/daemon/daemon-config.js +0 -149
- package/dist/daemon/daemon-config.js.map +0 -7
- package/dist/daemon/services/context-service.js +0 -122
- package/dist/daemon/services/context-service.js.map +0 -7
- package/dist/daemon/services/linear-service.js +0 -136
- package/dist/daemon/services/linear-service.js.map +0 -7
- package/dist/daemon/session-daemon.js +0 -312
- package/dist/daemon/session-daemon.js.map +0 -7
- package/dist/daemon/unified-daemon.js +0 -276
- package/dist/daemon/unified-daemon.js.map +0 -7
- package/dist/features/analytics/api/analytics-api.js +0 -287
- package/dist/features/analytics/api/analytics-api.js.map +0 -7
- package/dist/features/analytics/core/analytics-service.js +0 -282
- package/dist/features/analytics/core/analytics-service.js.map +0 -7
- package/dist/features/analytics/index.js +0 -18
- package/dist/features/analytics/index.js.map +0 -7
- package/dist/features/analytics/queries/metrics-queries.js +0 -277
- package/dist/features/analytics/queries/metrics-queries.js.map +0 -7
- package/dist/features/analytics/types/metrics.js +0 -5
- package/dist/features/analytics/types/metrics.js.map +0 -7
- package/dist/features/browser/browser-mcp.js +0 -492
- package/dist/features/browser/browser-mcp.js.map +0 -7
- package/dist/features/sweep/index.js +0 -20
- package/dist/features/sweep/index.js.map +0 -7
- package/dist/features/sweep/prediction-client.js +0 -155
- package/dist/features/sweep/prediction-client.js.map +0 -7
- package/dist/features/sweep/prompt-builder.js +0 -85
- package/dist/features/sweep/prompt-builder.js.map +0 -7
- package/dist/features/sweep/pty-wrapper.js +0 -171
- package/dist/features/sweep/pty-wrapper.js.map +0 -7
- package/dist/features/sweep/state-watcher.js +0 -87
- package/dist/features/sweep/state-watcher.js.map +0 -7
- package/dist/features/sweep/status-bar.js +0 -88
- package/dist/features/sweep/status-bar.js.map +0 -7
- package/dist/features/sweep/sweep-server-manager.js +0 -226
- package/dist/features/sweep/sweep-server-manager.js.map +0 -7
- package/dist/features/sweep/tab-interceptor.js +0 -38
- package/dist/features/sweep/tab-interceptor.js.map +0 -7
- package/dist/features/sweep/types.js +0 -18
- package/dist/features/sweep/types.js.map +0 -7
- package/dist/features/tasks/linear-task-manager.js +0 -487
- package/dist/features/tasks/linear-task-manager.js.map +0 -7
- package/dist/features/tasks/task-aware-context.js +0 -410
- package/dist/features/tasks/task-aware-context.js.map +0 -7
- package/dist/features/tui/simple-monitor.js +0 -116
- package/dist/features/tui/simple-monitor.js.map +0 -7
- package/dist/features/tui/swarm-monitor.js +0 -648
- package/dist/features/tui/swarm-monitor.js.map +0 -7
- package/dist/features/web/client/stores/task-store.js +0 -26
- package/dist/features/web/client/stores/task-store.js.map +0 -7
- package/dist/features/web/server/index.js +0 -194
- package/dist/features/web/server/index.js.map +0 -7
- package/dist/hooks/auto-background.js +0 -151
- package/dist/hooks/auto-background.js.map +0 -7
- package/dist/hooks/claude-code-whatsapp-hook.js +0 -197
- package/dist/hooks/claude-code-whatsapp-hook.js.map +0 -7
- package/dist/hooks/config.js +0 -150
- package/dist/hooks/config.js.map +0 -7
- package/dist/hooks/daemon.js +0 -364
- package/dist/hooks/daemon.js.map +0 -7
- package/dist/hooks/events.js +0 -58
- package/dist/hooks/events.js.map +0 -7
- package/dist/hooks/index.js +0 -12
- package/dist/hooks/index.js.map +0 -7
- package/dist/hooks/linear-task-picker.js +0 -186
- package/dist/hooks/linear-task-picker.js.map +0 -7
- package/dist/hooks/schemas.js +0 -197
- package/dist/hooks/schemas.js.map +0 -7
- package/dist/hooks/secure-fs.js +0 -49
- package/dist/hooks/secure-fs.js.map +0 -7
- package/dist/hooks/security-logger.js +0 -155
- package/dist/hooks/security-logger.js.map +0 -7
- package/dist/hooks/session-summary.js +0 -222
- package/dist/hooks/session-summary.js.map +0 -7
- package/dist/hooks/sms-action-runner.js +0 -371
- package/dist/hooks/sms-action-runner.js.map +0 -7
- package/dist/hooks/sms-notify.js +0 -506
- package/dist/hooks/sms-notify.js.map +0 -7
- package/dist/hooks/sms-watcher.js +0 -93
- package/dist/hooks/sms-watcher.js.map +0 -7
- package/dist/hooks/sms-webhook.js +0 -555
- package/dist/hooks/sms-webhook.js.map +0 -7
- package/dist/hooks/whatsapp-commands.js +0 -479
- package/dist/hooks/whatsapp-commands.js.map +0 -7
- package/dist/hooks/whatsapp-scheduler.js +0 -317
- package/dist/hooks/whatsapp-scheduler.js.map +0 -7
- package/dist/hooks/whatsapp-sync.js +0 -409
- package/dist/hooks/whatsapp-sync.js.map +0 -7
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -7
- package/dist/integrations/anthropic/client.js +0 -263
- package/dist/integrations/anthropic/client.js.map +0 -7
- package/dist/integrations/claude-code/agent-bridge.js +0 -768
- package/dist/integrations/claude-code/agent-bridge.js.map +0 -7
- package/dist/integrations/claude-code/enhanced-pre-clear-hooks.js +0 -459
- package/dist/integrations/claude-code/enhanced-pre-clear-hooks.js.map +0 -7
- package/dist/integrations/claude-code/lifecycle-hooks.js +0 -254
- package/dist/integrations/claude-code/lifecycle-hooks.js.map +0 -7
- package/dist/integrations/claude-code/post-task-hooks.js +0 -545
- package/dist/integrations/claude-code/post-task-hooks.js.map +0 -7
- package/dist/integrations/claude-code/subagent-client-stub.js +0 -20
- package/dist/integrations/claude-code/subagent-client-stub.js.map +0 -7
- package/dist/integrations/claude-code/subagent-client.js +0 -511
- package/dist/integrations/claude-code/subagent-client.js.map +0 -7
- package/dist/integrations/claude-code/task-coordinator.js +0 -360
- package/dist/integrations/claude-code/task-coordinator.js.map +0 -7
- package/dist/integrations/linear/auth.js +0 -337
- package/dist/integrations/linear/auth.js.map +0 -7
- package/dist/integrations/linear/auto-sync.js +0 -258
- package/dist/integrations/linear/auto-sync.js.map +0 -7
- package/dist/integrations/linear/client.js +0 -634
- package/dist/integrations/linear/client.js.map +0 -7
- package/dist/integrations/linear/config.js +0 -130
- package/dist/integrations/linear/config.js.map +0 -7
- package/dist/integrations/linear/migration.js +0 -361
- package/dist/integrations/linear/migration.js.map +0 -7
- package/dist/integrations/linear/oauth-server.js +0 -454
- package/dist/integrations/linear/oauth-server.js.map +0 -7
- package/dist/integrations/linear/rest-client.js +0 -213
- package/dist/integrations/linear/rest-client.js.map +0 -7
- package/dist/integrations/linear/sync-manager.js +0 -236
- package/dist/integrations/linear/sync-manager.js.map +0 -7
- package/dist/integrations/linear/sync-service.js +0 -231
- package/dist/integrations/linear/sync-service.js.map +0 -7
- package/dist/integrations/linear/sync.js +0 -782
- package/dist/integrations/linear/sync.js.map +0 -7
- package/dist/integrations/linear/types.js +0 -5
- package/dist/integrations/linear/types.js.map +0 -7
- package/dist/integrations/linear/unified-sync.js +0 -589
- package/dist/integrations/linear/unified-sync.js.map +0 -7
- package/dist/integrations/linear/webhook-handler.js +0 -219
- package/dist/integrations/linear/webhook-handler.js.map +0 -7
- package/dist/integrations/linear/webhook-server.js +0 -218
- package/dist/integrations/linear/webhook-server.js.map +0 -7
- package/dist/integrations/linear/webhook.js +0 -291
- package/dist/integrations/linear/webhook.js.map +0 -7
- package/dist/integrations/mcp/handlers/code-execution-handlers.js +0 -266
- package/dist/integrations/mcp/handlers/code-execution-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/context-handlers.js +0 -257
- package/dist/integrations/mcp/handlers/context-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/discovery-handlers.js +0 -497
- package/dist/integrations/mcp/handlers/discovery-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/index.js +0 -166
- package/dist/integrations/mcp/handlers/index.js.map +0 -7
- package/dist/integrations/mcp/handlers/linear-handlers.js +0 -247
- package/dist/integrations/mcp/handlers/linear-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/skill-handlers.js +0 -529
- package/dist/integrations/mcp/handlers/skill-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/task-handlers.js +0 -239
- package/dist/integrations/mcp/handlers/task-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/trace-handlers.js +0 -308
- package/dist/integrations/mcp/handlers/trace-handlers.js.map +0 -7
- package/dist/integrations/mcp/index.js +0 -23
- package/dist/integrations/mcp/index.js.map +0 -7
- package/dist/integrations/mcp/middleware/tool-scoring.js +0 -356
- package/dist/integrations/mcp/middleware/tool-scoring.js.map +0 -7
- package/dist/integrations/mcp/refactored-server.js +0 -374
- package/dist/integrations/mcp/refactored-server.js.map +0 -7
- package/dist/integrations/mcp/remote-server.js +0 -682
- package/dist/integrations/mcp/remote-server.js.map +0 -7
- package/dist/integrations/mcp/schemas.js +0 -147
- package/dist/integrations/mcp/schemas.js.map +0 -7
- package/dist/integrations/mcp/server.js +0 -1975
- package/dist/integrations/mcp/server.js.map +0 -7
- package/dist/integrations/mcp/tool-definitions-code.js +0 -125
- package/dist/integrations/mcp/tool-definitions-code.js.map +0 -7
- package/dist/integrations/mcp/tool-definitions.js +0 -702
- package/dist/integrations/mcp/tool-definitions.js.map +0 -7
- package/dist/integrations/mcp/trace-test.js +0 -48
- package/dist/integrations/mcp/trace-test.js.map +0 -7
- package/dist/integrations/pg-aiguide/embedding-provider.js +0 -189
- package/dist/integrations/pg-aiguide/embedding-provider.js.map +0 -7
- package/dist/integrations/pg-aiguide/semantic-search.js +0 -187
- package/dist/integrations/pg-aiguide/semantic-search.js.map +0 -7
- package/dist/integrations/pg-aiguide/timescale-analytics.js +0 -224
- package/dist/integrations/pg-aiguide/timescale-analytics.js.map +0 -7
- package/dist/integrations/ralph/bridge/ralph-stackmemory-bridge.js +0 -860
- package/dist/integrations/ralph/bridge/ralph-stackmemory-bridge.js.map +0 -7
- package/dist/integrations/ralph/context/context-budget-manager.js +0 -301
- package/dist/integrations/ralph/context/context-budget-manager.js.map +0 -7
- package/dist/integrations/ralph/context/stackmemory-context-loader.js +0 -360
- package/dist/integrations/ralph/context/stackmemory-context-loader.js.map +0 -7
- package/dist/integrations/ralph/coordination/enhanced-coordination.js +0 -410
- package/dist/integrations/ralph/coordination/enhanced-coordination.js.map +0 -7
- package/dist/integrations/ralph/index.js +0 -18
- package/dist/integrations/ralph/index.js.map +0 -7
- package/dist/integrations/ralph/learning/pattern-learner.js +0 -401
- package/dist/integrations/ralph/learning/pattern-learner.js.map +0 -7
- package/dist/integrations/ralph/lifecycle/iteration-lifecycle.js +0 -448
- package/dist/integrations/ralph/lifecycle/iteration-lifecycle.js.map +0 -7
- package/dist/integrations/ralph/monitoring/swarm-dashboard.js +0 -294
- package/dist/integrations/ralph/monitoring/swarm-dashboard.js.map +0 -7
- package/dist/integrations/ralph/monitoring/swarm-registry.js +0 -108
- package/dist/integrations/ralph/monitoring/swarm-registry.js.map +0 -7
- package/dist/integrations/ralph/orchestration/multi-loop-orchestrator.js +0 -463
- package/dist/integrations/ralph/orchestration/multi-loop-orchestrator.js.map +0 -7
- package/dist/integrations/ralph/patterns/compounding-engineering-pattern.js +0 -400
- package/dist/integrations/ralph/patterns/compounding-engineering-pattern.js.map +0 -7
- package/dist/integrations/ralph/patterns/extended-coherence-sessions.js +0 -473
- package/dist/integrations/ralph/patterns/extended-coherence-sessions.js.map +0 -7
- package/dist/integrations/ralph/patterns/oracle-worker-pattern.js +0 -388
- package/dist/integrations/ralph/patterns/oracle-worker-pattern.js.map +0 -7
- package/dist/integrations/ralph/performance/performance-optimizer.js +0 -358
- package/dist/integrations/ralph/performance/performance-optimizer.js.map +0 -7
- package/dist/integrations/ralph/ralph-integration-demo.js +0 -182
- package/dist/integrations/ralph/ralph-integration-demo.js.map +0 -7
- package/dist/integrations/ralph/recovery/crash-recovery.js +0 -462
- package/dist/integrations/ralph/recovery/crash-recovery.js.map +0 -7
- package/dist/integrations/ralph/state/state-reconciler.js +0 -404
- package/dist/integrations/ralph/state/state-reconciler.js.map +0 -7
- package/dist/integrations/ralph/swarm/git-workflow-manager.js +0 -428
- package/dist/integrations/ralph/swarm/git-workflow-manager.js.map +0 -7
- package/dist/integrations/ralph/swarm/swarm-coordinator.js +0 -996
- package/dist/integrations/ralph/swarm/swarm-coordinator.js.map +0 -7
- package/dist/integrations/ralph/types.js +0 -5
- package/dist/integrations/ralph/types.js.map +0 -7
- package/dist/integrations/ralph/visualization/ralph-debugger.js +0 -585
- package/dist/integrations/ralph/visualization/ralph-debugger.js.map +0 -7
- package/dist/mcp/stackmemory-mcp-server.js +0 -554
- package/dist/mcp/stackmemory-mcp-server.js.map +0 -7
- package/dist/middleware/exponential-rate-limiter.js +0 -289
- package/dist/middleware/exponential-rate-limiter.js.map +0 -7
- package/dist/models/user.model.js +0 -358
- package/dist/models/user.model.js.map +0 -7
- package/dist/servers/production/auth-middleware.js +0 -528
- package/dist/servers/production/auth-middleware.js.map +0 -7
- package/dist/servers/railway/config.js +0 -55
- package/dist/servers/railway/config.js.map +0 -7
- package/dist/servers/railway/index-enhanced.js +0 -160
- package/dist/servers/railway/index-enhanced.js.map +0 -7
- package/dist/servers/railway/index.js +0 -1349
- package/dist/servers/railway/index.js.map +0 -7
- package/dist/servers/railway/simple.js +0 -64
- package/dist/servers/railway/simple.js.map +0 -7
- package/dist/servers/railway/storage-test.js +0 -459
- package/dist/servers/railway/storage-test.js.map +0 -7
- package/dist/services/config-service.js +0 -65
- package/dist/services/config-service.js.map +0 -7
- package/dist/services/context-service.js +0 -194
- package/dist/services/context-service.js.map +0 -7
- package/dist/skills/api-discovery.js +0 -354
- package/dist/skills/api-discovery.js.map +0 -7
- package/dist/skills/api-skill.js +0 -475
- package/dist/skills/api-skill.js.map +0 -7
- package/dist/skills/claude-skills.js +0 -1061
- package/dist/skills/claude-skills.js.map +0 -7
- package/dist/skills/dashboard-launcher.js +0 -216
- package/dist/skills/dashboard-launcher.js.map +0 -7
- package/dist/skills/recursive-agent-orchestrator.js +0 -575
- package/dist/skills/recursive-agent-orchestrator.js.map +0 -7
- package/dist/skills/repo-ingestion-skill.js +0 -609
- package/dist/skills/repo-ingestion-skill.js.map +0 -7
- package/dist/skills/security-secrets-scanner.js +0 -284
- package/dist/skills/security-secrets-scanner.js.map +0 -7
- package/dist/skills/unified-rlm-orchestrator.js +0 -404
- package/dist/skills/unified-rlm-orchestrator.js.map +0 -7
- package/dist/types/task.js +0 -5
- package/dist/types/task.js.map +0 -7
- package/dist/utils/env.js +0 -50
- package/dist/utils/env.js.map +0 -7
- package/dist/utils/formatting.js +0 -62
- package/dist/utils/formatting.js.map +0 -7
- package/dist/utils/process-cleanup.js +0 -136
- package/dist/utils/process-cleanup.js.map +0 -7
- package/dist/validation/schemas.js +0 -222
- package/dist/validation/schemas.js.map +0 -7
- /package/dist/{core/merge → src/core/extensions}/types.js +0 -0
- /package/dist/{core/merge → src/core/extensions}/types.js.map +0 -0
|
@@ -1,768 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
2
|
-
import { dirname as __pathDirname } from 'path';
|
|
3
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
4
|
-
const __dirname = __pathDirname(__filename);
|
|
5
|
-
import { v4 as uuidv4 } from "uuid";
|
|
6
|
-
import { logger } from "../../core/monitoring/logger.js";
|
|
7
|
-
import {
|
|
8
|
-
OracleWorkerCoordinator
|
|
9
|
-
} from "../ralph/patterns/oracle-worker-pattern.js";
|
|
10
|
-
import { ClaudeCodeTaskCoordinator } from "./task-coordinator.js";
|
|
11
|
-
const CLAUDE_CODE_AGENTS = {
|
|
12
|
-
// Oracle-level agents (strategic, high-level)
|
|
13
|
-
"staff-architect": {
|
|
14
|
-
name: "staff-architect",
|
|
15
|
-
type: "oracle",
|
|
16
|
-
description: "Strategic technical leadership, architectural guidance, and engineering direction",
|
|
17
|
-
capabilities: [
|
|
18
|
-
"system_design",
|
|
19
|
-
"architectural_planning",
|
|
20
|
-
"technical_strategy",
|
|
21
|
-
"scalability_analysis",
|
|
22
|
-
"technology_selection",
|
|
23
|
-
"team_organization"
|
|
24
|
-
],
|
|
25
|
-
costMultiplier: 1,
|
|
26
|
-
// Oracle pricing
|
|
27
|
-
complexity: "very_high",
|
|
28
|
-
specializations: ["architecture", "strategy", "leadership"]
|
|
29
|
-
},
|
|
30
|
-
"product-manager": {
|
|
31
|
-
name: "product-manager",
|
|
32
|
-
type: "oracle",
|
|
33
|
-
description: "Strategic planning, roadmap development, and market analysis",
|
|
34
|
-
capabilities: [
|
|
35
|
-
"product_strategy",
|
|
36
|
-
"roadmap_planning",
|
|
37
|
-
"market_analysis",
|
|
38
|
-
"feature_prioritization",
|
|
39
|
-
"stakeholder_alignment",
|
|
40
|
-
"business_requirements"
|
|
41
|
-
],
|
|
42
|
-
costMultiplier: 1,
|
|
43
|
-
complexity: "high",
|
|
44
|
-
specializations: ["strategy", "planning", "business"]
|
|
45
|
-
},
|
|
46
|
-
// Worker-level agents (execution, focused tasks)
|
|
47
|
-
"general-purpose": {
|
|
48
|
-
name: "general-purpose",
|
|
49
|
-
type: "worker",
|
|
50
|
-
description: "General-purpose agent for researching, coding, and multi-step tasks",
|
|
51
|
-
capabilities: [
|
|
52
|
-
"code_implementation",
|
|
53
|
-
"research",
|
|
54
|
-
"debugging",
|
|
55
|
-
"file_operations",
|
|
56
|
-
"testing",
|
|
57
|
-
"documentation"
|
|
58
|
-
],
|
|
59
|
-
costMultiplier: 0.2,
|
|
60
|
-
// Worker pricing
|
|
61
|
-
complexity: "medium",
|
|
62
|
-
specializations: ["development", "research", "general"]
|
|
63
|
-
},
|
|
64
|
-
"code-reviewer": {
|
|
65
|
-
name: "code-reviewer",
|
|
66
|
-
type: "reviewer",
|
|
67
|
-
description: "Reviews code against standards, checks for issues and best practices",
|
|
68
|
-
capabilities: [
|
|
69
|
-
"code_review",
|
|
70
|
-
"quality_assessment",
|
|
71
|
-
"security_analysis",
|
|
72
|
-
"performance_review",
|
|
73
|
-
"best_practices_enforcement",
|
|
74
|
-
"typescript_validation"
|
|
75
|
-
],
|
|
76
|
-
costMultiplier: 0.3,
|
|
77
|
-
// Slightly more expensive worker
|
|
78
|
-
complexity: "medium",
|
|
79
|
-
specializations: ["quality", "security", "standards"]
|
|
80
|
-
},
|
|
81
|
-
debugger: {
|
|
82
|
-
name: "debugger",
|
|
83
|
-
type: "worker",
|
|
84
|
-
description: "Specialized debugging for errors, test failures, and unexpected behavior",
|
|
85
|
-
capabilities: [
|
|
86
|
-
"error_analysis",
|
|
87
|
-
"debugging",
|
|
88
|
-
"log_analysis",
|
|
89
|
-
"performance_debugging",
|
|
90
|
-
"test_failure_analysis",
|
|
91
|
-
"root_cause_analysis"
|
|
92
|
-
],
|
|
93
|
-
costMultiplier: 0.25,
|
|
94
|
-
complexity: "medium",
|
|
95
|
-
specializations: ["debugging", "analysis", "troubleshooting"]
|
|
96
|
-
},
|
|
97
|
-
"qa-workflow-validator": {
|
|
98
|
-
name: "qa-workflow-validator",
|
|
99
|
-
type: "worker",
|
|
100
|
-
description: "Comprehensive QA testing, workflow validation, and UI testing",
|
|
101
|
-
capabilities: [
|
|
102
|
-
"workflow_validation",
|
|
103
|
-
"test_execution",
|
|
104
|
-
"ui_testing",
|
|
105
|
-
"integration_testing",
|
|
106
|
-
"log_analysis",
|
|
107
|
-
"quality_assurance"
|
|
108
|
-
],
|
|
109
|
-
costMultiplier: 0.3,
|
|
110
|
-
complexity: "medium",
|
|
111
|
-
specializations: ["testing", "validation", "quality"]
|
|
112
|
-
},
|
|
113
|
-
"merge-coordinator": {
|
|
114
|
-
name: "merge-coordinator",
|
|
115
|
-
type: "worker",
|
|
116
|
-
description: "Coordinates merge requests and handles code integration",
|
|
117
|
-
capabilities: [
|
|
118
|
-
"merge_coordination",
|
|
119
|
-
"conflict_resolution",
|
|
120
|
-
"code_integration",
|
|
121
|
-
"branch_management",
|
|
122
|
-
"review_coordination",
|
|
123
|
-
"git_workflow"
|
|
124
|
-
],
|
|
125
|
-
costMultiplier: 0.2,
|
|
126
|
-
complexity: "low",
|
|
127
|
-
specializations: ["git", "coordination", "integration"]
|
|
128
|
-
},
|
|
129
|
-
"github-workflow": {
|
|
130
|
-
name: "github-workflow",
|
|
131
|
-
type: "worker",
|
|
132
|
-
description: "Git workflow management for commits, branches, and PRs",
|
|
133
|
-
capabilities: [
|
|
134
|
-
"git_operations",
|
|
135
|
-
"branch_management",
|
|
136
|
-
"commit_management",
|
|
137
|
-
"pr_creation",
|
|
138
|
-
"workflow_automation",
|
|
139
|
-
"repository_management"
|
|
140
|
-
],
|
|
141
|
-
costMultiplier: 0.15,
|
|
142
|
-
complexity: "low",
|
|
143
|
-
specializations: ["git", "automation", "workflow"]
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
class ClaudeCodeAgentBridge extends OracleWorkerCoordinator {
|
|
147
|
-
claudeAgents = /* @__PURE__ */ new Map();
|
|
148
|
-
activeAgentSessions = /* @__PURE__ */ new Map();
|
|
149
|
-
taskCoordinator;
|
|
150
|
-
constructor() {
|
|
151
|
-
const oracleConfigs = ClaudeCodeAgentBridge.createOracleConfigs();
|
|
152
|
-
const workerConfigs = ClaudeCodeAgentBridge.createWorkerConfigs();
|
|
153
|
-
const reviewerConfigs = ClaudeCodeAgentBridge.createReviewerConfigs();
|
|
154
|
-
super({
|
|
155
|
-
oracle: oracleConfigs[0],
|
|
156
|
-
workers: workerConfigs,
|
|
157
|
-
reviewers: reviewerConfigs,
|
|
158
|
-
maxWorkers: 8,
|
|
159
|
-
// Allow more workers for Claude Code agents
|
|
160
|
-
coordinationInterval: 3e4,
|
|
161
|
-
costBudget: 15
|
|
162
|
-
// Higher budget for Claude Code integration
|
|
163
|
-
});
|
|
164
|
-
this.taskCoordinator = new ClaudeCodeTaskCoordinator();
|
|
165
|
-
this.loadClaudeCodeAgents();
|
|
166
|
-
logger.info("Claude Code Agent Bridge initialized", {
|
|
167
|
-
oracleAgents: oracleConfigs.length,
|
|
168
|
-
workerAgents: workerConfigs.length,
|
|
169
|
-
reviewerAgents: reviewerConfigs.length
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Launch Oracle/Worker swarm using Claude Code agents
|
|
174
|
-
*/
|
|
175
|
-
async launchClaudeCodeSwarm(projectDescription, options = {}) {
|
|
176
|
-
const {
|
|
177
|
-
oracleAgent = "staff-architect",
|
|
178
|
-
workerAgents = ["general-purpose", "code-reviewer"],
|
|
179
|
-
reviewerAgents = ["code-reviewer"],
|
|
180
|
-
budget = 10,
|
|
181
|
-
complexity = "medium"
|
|
182
|
-
} = options;
|
|
183
|
-
logger.info("Launching Claude Code swarm", {
|
|
184
|
-
project: projectDescription.substring(0, 100),
|
|
185
|
-
oracleAgent,
|
|
186
|
-
workerAgents,
|
|
187
|
-
budget
|
|
188
|
-
});
|
|
189
|
-
this.validateAgentSelection(oracleAgent, workerAgents, reviewerAgents);
|
|
190
|
-
const swarmId = uuidv4();
|
|
191
|
-
try {
|
|
192
|
-
const oracleTaskId = await this.createClaudeOracleTask(
|
|
193
|
-
oracleAgent,
|
|
194
|
-
projectDescription,
|
|
195
|
-
complexity
|
|
196
|
-
);
|
|
197
|
-
const decomposition = await this.executeClaudeOracleTask(
|
|
198
|
-
oracleTaskId,
|
|
199
|
-
oracleAgent
|
|
200
|
-
);
|
|
201
|
-
const workerTasks = await this.allocateTasksToClaudeWorkers(
|
|
202
|
-
decomposition,
|
|
203
|
-
workerAgents
|
|
204
|
-
);
|
|
205
|
-
const workerPromises = workerTasks.map(
|
|
206
|
-
(task) => this.executeClaudeWorkerTask(task)
|
|
207
|
-
);
|
|
208
|
-
const reviewPromises = reviewerAgents.map(
|
|
209
|
-
(reviewer) => this.executeClaudeReviewTask(reviewer, decomposition, workerTasks)
|
|
210
|
-
);
|
|
211
|
-
const [workerResults, reviewResults] = await Promise.all([
|
|
212
|
-
Promise.allSettled(workerPromises),
|
|
213
|
-
Promise.allSettled(reviewPromises)
|
|
214
|
-
]);
|
|
215
|
-
await this.integrateClaudeResults(swarmId, workerResults, reviewResults);
|
|
216
|
-
this.logClaudeCodeCostAnalysis();
|
|
217
|
-
return swarmId;
|
|
218
|
-
} catch (error) {
|
|
219
|
-
logger.error("Claude Code swarm failed", error);
|
|
220
|
-
throw error;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Load Claude Code agents into the bridge
|
|
225
|
-
*/
|
|
226
|
-
loadClaudeCodeAgents() {
|
|
227
|
-
for (const [agentName, agentConfig] of Object.entries(CLAUDE_CODE_AGENTS)) {
|
|
228
|
-
this.claudeAgents.set(agentName, agentConfig);
|
|
229
|
-
}
|
|
230
|
-
logger.info("Claude Code agents loaded", {
|
|
231
|
-
totalAgents: this.claudeAgents.size,
|
|
232
|
-
oracles: Array.from(this.claudeAgents.values()).filter(
|
|
233
|
-
(a) => a.type === "oracle"
|
|
234
|
-
).length,
|
|
235
|
-
workers: Array.from(this.claudeAgents.values()).filter(
|
|
236
|
-
(a) => a.type === "worker"
|
|
237
|
-
).length,
|
|
238
|
-
reviewers: Array.from(this.claudeAgents.values()).filter(
|
|
239
|
-
(a) => a.type === "reviewer"
|
|
240
|
-
).length
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Create Oracle model configurations from Claude Code agents
|
|
245
|
-
*/
|
|
246
|
-
static createOracleConfigs() {
|
|
247
|
-
return Object.values(CLAUDE_CODE_AGENTS).filter((agent) => agent.type === "oracle").map((agent) => ({
|
|
248
|
-
tier: "oracle",
|
|
249
|
-
provider: "claude",
|
|
250
|
-
model: `claude-code-${agent.name}`,
|
|
251
|
-
costPerToken: 0.015 * agent.costMultiplier,
|
|
252
|
-
// Base Oracle cost with multiplier
|
|
253
|
-
capabilities: agent.capabilities
|
|
254
|
-
}));
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Create Worker model configurations from Claude Code agents
|
|
258
|
-
*/
|
|
259
|
-
static createWorkerConfigs() {
|
|
260
|
-
return Object.values(CLAUDE_CODE_AGENTS).filter((agent) => agent.type === "worker").map((agent) => ({
|
|
261
|
-
tier: "worker",
|
|
262
|
-
provider: "claude",
|
|
263
|
-
model: `claude-code-${agent.name}`,
|
|
264
|
-
costPerToken: 25e-5 * agent.costMultiplier,
|
|
265
|
-
// Base worker cost with multiplier
|
|
266
|
-
capabilities: agent.capabilities
|
|
267
|
-
}));
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Create Reviewer model configurations from Claude Code agents
|
|
271
|
-
*/
|
|
272
|
-
static createReviewerConfigs() {
|
|
273
|
-
return Object.values(CLAUDE_CODE_AGENTS).filter((agent) => agent.type === "reviewer").map((agent) => ({
|
|
274
|
-
tier: "reviewer",
|
|
275
|
-
provider: "claude",
|
|
276
|
-
model: `claude-code-${agent.name}`,
|
|
277
|
-
costPerToken: 3e-3 * agent.costMultiplier,
|
|
278
|
-
// Base reviewer cost with multiplier
|
|
279
|
-
capabilities: agent.capabilities
|
|
280
|
-
}));
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Validate that selected agents exist and are appropriate
|
|
284
|
-
*/
|
|
285
|
-
validateAgentSelection(oracleAgent, workerAgents, reviewerAgents) {
|
|
286
|
-
const oracle = this.claudeAgents.get(oracleAgent);
|
|
287
|
-
if (!oracle) {
|
|
288
|
-
throw new Error(`Oracle agent '${oracleAgent}' not found`);
|
|
289
|
-
}
|
|
290
|
-
if (oracle.type !== "oracle") {
|
|
291
|
-
throw new Error(`Agent '${oracleAgent}' is not an Oracle-level agent`);
|
|
292
|
-
}
|
|
293
|
-
for (const workerAgent of workerAgents) {
|
|
294
|
-
const worker = this.claudeAgents.get(workerAgent);
|
|
295
|
-
if (!worker) {
|
|
296
|
-
throw new Error(`Worker agent '${workerAgent}' not found`);
|
|
297
|
-
}
|
|
298
|
-
if (worker.type !== "worker") {
|
|
299
|
-
throw new Error(`Agent '${workerAgent}' is not a Worker-level agent`);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
for (const reviewerAgent of reviewerAgents) {
|
|
303
|
-
const reviewer = this.claudeAgents.get(reviewerAgent);
|
|
304
|
-
if (!reviewer) {
|
|
305
|
-
throw new Error(`Reviewer agent '${reviewerAgent}' not found`);
|
|
306
|
-
}
|
|
307
|
-
if (reviewer.type !== "reviewer") {
|
|
308
|
-
throw new Error(
|
|
309
|
-
`Agent '${reviewerAgent}' is not a Reviewer-level agent`
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Create Oracle task with Claude Code agent capabilities
|
|
316
|
-
*/
|
|
317
|
-
async createClaudeOracleTask(agentName, projectDescription, complexity) {
|
|
318
|
-
const taskId = uuidv4();
|
|
319
|
-
const agent = this.claudeAgents.get(agentName);
|
|
320
|
-
logger.info("Creating Claude Oracle task", {
|
|
321
|
-
taskId,
|
|
322
|
-
agent: agentName,
|
|
323
|
-
complexity
|
|
324
|
-
});
|
|
325
|
-
this.activeAgentSessions.set(taskId, {
|
|
326
|
-
agentName,
|
|
327
|
-
agentType: "oracle",
|
|
328
|
-
projectDescription,
|
|
329
|
-
complexity,
|
|
330
|
-
capabilities: agent.capabilities
|
|
331
|
-
});
|
|
332
|
-
return taskId;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Execute Oracle task using Claude Code agent
|
|
336
|
-
*/
|
|
337
|
-
async executeClaudeOracleTask(taskId, agentName) {
|
|
338
|
-
const session = this.activeAgentSessions.get(taskId);
|
|
339
|
-
if (!session) {
|
|
340
|
-
throw new Error(`Oracle task session ${taskId} not found`);
|
|
341
|
-
}
|
|
342
|
-
logger.info("Executing Claude Oracle task", {
|
|
343
|
-
taskId,
|
|
344
|
-
agent: agentName
|
|
345
|
-
});
|
|
346
|
-
const oraclePrompt = this.buildClaudeOraclePrompt(session);
|
|
347
|
-
const result = await this.invokeClaudeCodeAgent(agentName, oraclePrompt, {
|
|
348
|
-
type: "oracle",
|
|
349
|
-
maxTokens: 4e3,
|
|
350
|
-
temperature: 0.7
|
|
351
|
-
});
|
|
352
|
-
const decomposition = this.parseClaudeTaskDecomposition(result);
|
|
353
|
-
return decomposition;
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Build Oracle prompt optimized for Claude Code capabilities
|
|
357
|
-
*/
|
|
358
|
-
buildClaudeOraclePrompt(session) {
|
|
359
|
-
const agent = this.claudeAgents.get(session.agentName);
|
|
360
|
-
return `
|
|
361
|
-
# CLAUDE CODE ORACLE: ${agent.name.toUpperCase()}
|
|
362
|
-
|
|
363
|
-
## Your Role & Capabilities
|
|
364
|
-
You are a **${agent.description}** acting as the Oracle in an Oracle/Worker pattern.
|
|
365
|
-
|
|
366
|
-
**Your Specialized Capabilities:**
|
|
367
|
-
${agent.capabilities.map((cap) => `- ${cap.replace(/_/g, " ")}`).join("\n")}
|
|
368
|
-
|
|
369
|
-
**Your Specializations:**
|
|
370
|
-
${agent.specializations.map((spec) => `- ${spec}`).join("\n")}
|
|
371
|
-
|
|
372
|
-
## Project Context
|
|
373
|
-
${session.projectDescription}
|
|
374
|
-
|
|
375
|
-
**Complexity Level:** ${session.complexity}
|
|
376
|
-
|
|
377
|
-
## Oracle Responsibilities
|
|
378
|
-
As the Oracle, you provide strategic oversight while specialized Claude Code workers handle execution:
|
|
379
|
-
|
|
380
|
-
1. **Strategic Decomposition**: Break down the project into tasks optimized for Claude Code agents
|
|
381
|
-
2. **Agent Selection**: Recommend which Claude Code agents should handle each task
|
|
382
|
-
3. **Quality Standards**: Define acceptance criteria that leverage Claude Code capabilities
|
|
383
|
-
4. **Coordination Plan**: Plan how agents should collaborate and integrate work
|
|
384
|
-
|
|
385
|
-
## Available Claude Code Workers
|
|
386
|
-
${this.getAvailableWorkersDescription()}
|
|
387
|
-
|
|
388
|
-
## Output Required
|
|
389
|
-
Provide a detailed strategic plan in JSON format:
|
|
390
|
-
|
|
391
|
-
\`\`\`json
|
|
392
|
-
{
|
|
393
|
-
"project_analysis": {
|
|
394
|
-
"complexity_assessment": "low|medium|high|very_high",
|
|
395
|
-
"key_challenges": ["challenge 1", "challenge 2"],
|
|
396
|
-
"success_criteria": ["criterion 1", "criterion 2"]
|
|
397
|
-
},
|
|
398
|
-
"task_decomposition": [
|
|
399
|
-
{
|
|
400
|
-
"id": "task-1",
|
|
401
|
-
"title": "Task name",
|
|
402
|
-
"description": "Detailed description",
|
|
403
|
-
"recommended_agent": "agent-name",
|
|
404
|
-
"agent_rationale": "Why this agent is optimal",
|
|
405
|
-
"complexity": "low|medium|high",
|
|
406
|
-
"estimated_effort": "1-5 scale",
|
|
407
|
-
"dependencies": ["task-id"],
|
|
408
|
-
"acceptance_criteria": ["criterion 1", "criterion 2"],
|
|
409
|
-
"claude_code_integration": {
|
|
410
|
-
"tools_needed": ["tool1", "tool2"],
|
|
411
|
-
"validation_method": "how to verify completion"
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
],
|
|
415
|
-
"coordination_strategy": {
|
|
416
|
-
"integration_points": ["when agents should sync"],
|
|
417
|
-
"quality_gates": ["checkpoints for review"],
|
|
418
|
-
"risk_mitigation": ["potential issues and solutions"],
|
|
419
|
-
"success_metrics": ["how to measure overall success"]
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
\`\`\`
|
|
423
|
-
|
|
424
|
-
Focus on strategic thinking that maximizes Claude Code's specialized capabilities.
|
|
425
|
-
`;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Get description of available Claude Code workers
|
|
429
|
-
*/
|
|
430
|
-
getAvailableWorkersDescription() {
|
|
431
|
-
const workers = Array.from(this.claudeAgents.values()).filter(
|
|
432
|
-
(agent) => agent.type === "worker" || agent.type === "reviewer"
|
|
433
|
-
);
|
|
434
|
-
return workers.map(
|
|
435
|
-
(worker) => `**${worker.name}**: ${worker.description}
|
|
436
|
-
Capabilities: ${worker.capabilities.join(", ")}`
|
|
437
|
-
).join("\n\n");
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Allocate tasks to Claude Code worker agents
|
|
441
|
-
*/
|
|
442
|
-
async allocateTasksToClaudeWorkers(decomposition, workerAgents) {
|
|
443
|
-
const allocatedTasks = [];
|
|
444
|
-
for (const task of decomposition.task_decomposition || []) {
|
|
445
|
-
const recommendedAgent = task.recommended_agent;
|
|
446
|
-
const selectedAgent = workerAgents.includes(recommendedAgent) ? recommendedAgent : this.selectOptimalClaudeWorker(task, workerAgents);
|
|
447
|
-
const claudeAgent = this.claudeAgents.get(selectedAgent);
|
|
448
|
-
allocatedTasks.push({
|
|
449
|
-
...task,
|
|
450
|
-
assignedAgent: selectedAgent,
|
|
451
|
-
agentCapabilities: claudeAgent.capabilities,
|
|
452
|
-
agentType: claudeAgent.type
|
|
453
|
-
});
|
|
454
|
-
logger.debug("Task allocated to Claude Code agent", {
|
|
455
|
-
taskId: task.id,
|
|
456
|
-
agent: selectedAgent,
|
|
457
|
-
rationale: task.agent_rationale || "Auto-selected based on capabilities"
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
return allocatedTasks;
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* Select optimal Claude Code worker for a task
|
|
464
|
-
*/
|
|
465
|
-
selectOptimalClaudeWorker(task, availableWorkers) {
|
|
466
|
-
let bestAgent = availableWorkers[0];
|
|
467
|
-
let bestScore = 0;
|
|
468
|
-
for (const workerName of availableWorkers) {
|
|
469
|
-
const worker = this.claudeAgents.get(workerName);
|
|
470
|
-
let score = 0;
|
|
471
|
-
const taskKeywords = (task.description || "").toLowerCase().split(" ");
|
|
472
|
-
for (const capability of worker.capabilities) {
|
|
473
|
-
const capabilityKeywords = capability.replace(/_/g, " ").toLowerCase();
|
|
474
|
-
if (taskKeywords.some((keyword) => capabilityKeywords.includes(keyword))) {
|
|
475
|
-
score += 2;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
for (const specialization of worker.specializations) {
|
|
479
|
-
if (taskKeywords.some((keyword) => keyword.includes(specialization))) {
|
|
480
|
-
score += 3;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
score -= worker.costMultiplier;
|
|
484
|
-
if (score > bestScore) {
|
|
485
|
-
bestScore = score;
|
|
486
|
-
bestAgent = workerName;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
return bestAgent;
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Execute worker task using Claude Code agent
|
|
493
|
-
*/
|
|
494
|
-
async executeClaudeWorkerTask(task) {
|
|
495
|
-
const agentName = task.assignedAgent;
|
|
496
|
-
const agent = this.claudeAgents.get(agentName);
|
|
497
|
-
logger.info("Executing Claude Code worker task", {
|
|
498
|
-
taskId: task.id,
|
|
499
|
-
agent: agentName
|
|
500
|
-
});
|
|
501
|
-
const workerPrompt = this.buildClaudeWorkerPrompt(task, agent);
|
|
502
|
-
const result = await this.invokeClaudeCodeAgent(agentName, workerPrompt, {
|
|
503
|
-
type: "worker",
|
|
504
|
-
maxTokens: 2e3,
|
|
505
|
-
temperature: 0.3
|
|
506
|
-
});
|
|
507
|
-
return {
|
|
508
|
-
taskId: task.id,
|
|
509
|
-
agentName,
|
|
510
|
-
result,
|
|
511
|
-
success: true
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Execute review task using Claude Code reviewer
|
|
516
|
-
*/
|
|
517
|
-
async executeClaudeReviewTask(reviewerName, decomposition, workerTasks) {
|
|
518
|
-
const agent = this.claudeAgents.get(reviewerName);
|
|
519
|
-
logger.info("Executing Claude Code review task", {
|
|
520
|
-
reviewer: reviewerName,
|
|
521
|
-
tasksToReview: workerTasks.length
|
|
522
|
-
});
|
|
523
|
-
const reviewPrompt = this.buildClaudeReviewPrompt(
|
|
524
|
-
agent,
|
|
525
|
-
decomposition,
|
|
526
|
-
workerTasks
|
|
527
|
-
);
|
|
528
|
-
const result = await this.invokeClaudeCodeAgent(
|
|
529
|
-
reviewerName,
|
|
530
|
-
reviewPrompt,
|
|
531
|
-
{
|
|
532
|
-
type: "reviewer",
|
|
533
|
-
maxTokens: 3e3,
|
|
534
|
-
temperature: 0.2
|
|
535
|
-
}
|
|
536
|
-
);
|
|
537
|
-
return {
|
|
538
|
-
reviewerId: reviewerName,
|
|
539
|
-
result,
|
|
540
|
-
success: true
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Build worker prompt for Claude Code agent
|
|
545
|
-
*/
|
|
546
|
-
buildClaudeWorkerPrompt(task, agent) {
|
|
547
|
-
return `
|
|
548
|
-
# CLAUDE CODE WORKER: ${agent.name.toUpperCase()}
|
|
549
|
-
|
|
550
|
-
## Your Specialized Role
|
|
551
|
-
You are a **${agent.description}** executing a focused task as part of a larger project.
|
|
552
|
-
|
|
553
|
-
**Your Capabilities:**
|
|
554
|
-
${agent.capabilities.map((cap) => `- ${cap.replace(/_/g, " ")}`).join("\n")}
|
|
555
|
-
|
|
556
|
-
## Your Task
|
|
557
|
-
**${task.title}**
|
|
558
|
-
|
|
559
|
-
${task.description}
|
|
560
|
-
|
|
561
|
-
## Success Criteria
|
|
562
|
-
${(task.acceptance_criteria || []).map((c) => `- ${c}`).join("\n")}
|
|
563
|
-
|
|
564
|
-
## Integration Requirements
|
|
565
|
-
${task.claude_code_integration ? `
|
|
566
|
-
**Tools Needed:** ${task.claude_code_integration.tools_needed?.join(", ") || "Standard tools"}
|
|
567
|
-
**Validation Method:** ${task.claude_code_integration.validation_method || "Standard validation"}
|
|
568
|
-
` : ""}
|
|
569
|
-
|
|
570
|
-
## Worker Guidelines
|
|
571
|
-
- **Focus** on this specific task only
|
|
572
|
-
- **Execute** using your specialized capabilities
|
|
573
|
-
- **Communicate** progress clearly
|
|
574
|
-
- **Deliver** according to the acceptance criteria
|
|
575
|
-
- **Coordinate** with other agents through shared context
|
|
576
|
-
|
|
577
|
-
Execute your specialized task now, leveraging your Claude Code capabilities.
|
|
578
|
-
`;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Build review prompt for Claude Code reviewer
|
|
582
|
-
*/
|
|
583
|
-
buildClaudeReviewPrompt(agent, decomposition, workerTasks) {
|
|
584
|
-
return `
|
|
585
|
-
# CLAUDE CODE REVIEWER: ${agent.name.toUpperCase()}
|
|
586
|
-
|
|
587
|
-
## Your Review Role
|
|
588
|
-
You are a **${agent.description}** conducting comprehensive review of completed work.
|
|
589
|
-
|
|
590
|
-
**Your Review Capabilities:**
|
|
591
|
-
${agent.capabilities.map((cap) => `- ${cap.replace(/_/g, " ")}`).join("\n")}
|
|
592
|
-
|
|
593
|
-
## Project Context
|
|
594
|
-
${JSON.stringify(decomposition.project_analysis || {}, null, 2)}
|
|
595
|
-
|
|
596
|
-
## Completed Tasks to Review
|
|
597
|
-
${workerTasks.map(
|
|
598
|
-
(task, i) => `
|
|
599
|
-
### Task ${i + 1}: ${task.title}
|
|
600
|
-
- **Agent:** ${task.agentName}
|
|
601
|
-
- **Status:** ${task.success ? "Completed" : "Failed"}
|
|
602
|
-
- **Acceptance Criteria:** ${(task.acceptance_criteria || []).join(", ")}
|
|
603
|
-
`
|
|
604
|
-
).join("\n")}
|
|
605
|
-
|
|
606
|
-
## Review Requirements
|
|
607
|
-
1. **Quality Assessment**: Evaluate if each task meets its acceptance criteria
|
|
608
|
-
2. **Integration Check**: Verify tasks work together cohesively
|
|
609
|
-
3. **Standards Compliance**: Ensure code/work follows best practices
|
|
610
|
-
4. **Risk Analysis**: Identify potential issues or improvements needed
|
|
611
|
-
5. **Final Recommendation**: Approve, request changes, or flag for re-work
|
|
612
|
-
|
|
613
|
-
## Output Format
|
|
614
|
-
Provide structured review in JSON:
|
|
615
|
-
|
|
616
|
-
\`\`\`json
|
|
617
|
-
{
|
|
618
|
-
"overall_assessment": "pass|conditional_pass|fail",
|
|
619
|
-
"task_reviews": [
|
|
620
|
-
{
|
|
621
|
-
"task_id": "task-id",
|
|
622
|
-
"status": "approved|changes_requested|rejected",
|
|
623
|
-
"issues": ["issue 1", "issue 2"],
|
|
624
|
-
"recommendations": ["recommendation 1"]
|
|
625
|
-
}
|
|
626
|
-
],
|
|
627
|
-
"integration_review": {
|
|
628
|
-
"cohesion_score": "1-10",
|
|
629
|
-
"integration_issues": ["issue 1"],
|
|
630
|
-
"recommended_improvements": ["improvement 1"]
|
|
631
|
-
},
|
|
632
|
-
"final_recommendation": "deploy|fix_and_redeploy|major_rework_needed"
|
|
633
|
-
}
|
|
634
|
-
\`\`\`
|
|
635
|
-
|
|
636
|
-
Conduct thorough review using your specialized Claude Code capabilities.
|
|
637
|
-
`;
|
|
638
|
-
}
|
|
639
|
-
/**
|
|
640
|
-
* Invoke Claude Code agent (integration point)
|
|
641
|
-
*/
|
|
642
|
-
async invokeClaudeCodeAgent(agentName, prompt, options) {
|
|
643
|
-
const agent = this.claudeAgents.get(agentName);
|
|
644
|
-
return await this.taskCoordinator.executeTask(agentName, agent, prompt, {
|
|
645
|
-
maxRetries: options.type === "oracle" ? 1 : 2,
|
|
646
|
-
// Oracle tasks are more expensive, fewer retries
|
|
647
|
-
timeout: options.type === "oracle" ? 6e5 : 3e5,
|
|
648
|
-
// Oracle gets more time
|
|
649
|
-
priority: options.type === "oracle" ? "high" : "medium"
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Generate mock response (to be replaced with real Claude Code integration)
|
|
654
|
-
*/
|
|
655
|
-
generateMockResponse(agentName, type) {
|
|
656
|
-
const agent = this.claudeAgents.get(agentName);
|
|
657
|
-
if (type === "oracle") {
|
|
658
|
-
return JSON.stringify(
|
|
659
|
-
{
|
|
660
|
-
project_analysis: {
|
|
661
|
-
complexity_assessment: "medium",
|
|
662
|
-
key_challenges: [
|
|
663
|
-
"Integration complexity",
|
|
664
|
-
"Performance requirements"
|
|
665
|
-
],
|
|
666
|
-
success_criteria: ["All tests pass", "Performance benchmarks met"]
|
|
667
|
-
},
|
|
668
|
-
task_decomposition: [
|
|
669
|
-
{
|
|
670
|
-
id: "task-1",
|
|
671
|
-
title: "Core Implementation",
|
|
672
|
-
description: "Implement main functionality",
|
|
673
|
-
recommended_agent: "general-purpose",
|
|
674
|
-
agent_rationale: "Best suited for general development tasks",
|
|
675
|
-
complexity: "medium",
|
|
676
|
-
estimated_effort: "3",
|
|
677
|
-
dependencies: [],
|
|
678
|
-
acceptance_criteria: ["Feature works correctly", "Tests pass"],
|
|
679
|
-
claude_code_integration: {
|
|
680
|
-
tools_needed: ["Write", "Edit", "Bash"],
|
|
681
|
-
validation_method: "Run tests and verify functionality"
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
],
|
|
685
|
-
coordination_strategy: {
|
|
686
|
-
integration_points: ["After core implementation"],
|
|
687
|
-
quality_gates: ["Code review", "Testing"],
|
|
688
|
-
risk_mitigation: ["Regular checkpoints", "Incremental delivery"]
|
|
689
|
-
}
|
|
690
|
-
},
|
|
691
|
-
null,
|
|
692
|
-
2
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
return `Claude Code agent ${agentName} completed ${type} task successfully using capabilities: ${agent.capabilities.join(", ")}`;
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Parse task decomposition from Claude Code response
|
|
699
|
-
*/
|
|
700
|
-
parseClaudeTaskDecomposition(response) {
|
|
701
|
-
try {
|
|
702
|
-
return JSON.parse(response);
|
|
703
|
-
} catch {
|
|
704
|
-
return {
|
|
705
|
-
task_decomposition: [
|
|
706
|
-
{
|
|
707
|
-
id: "task-1",
|
|
708
|
-
title: "Implementation Task",
|
|
709
|
-
description: response.substring(0, 200),
|
|
710
|
-
complexity: "medium",
|
|
711
|
-
acceptance_criteria: ["Task completed successfully"]
|
|
712
|
-
}
|
|
713
|
-
]
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
/**
|
|
718
|
-
* Integrate results from Claude Code agents
|
|
719
|
-
*/
|
|
720
|
-
async integrateClaudeResults(swarmId, workerResults, reviewResults) {
|
|
721
|
-
const successfulWorkers = workerResults.filter(
|
|
722
|
-
(r) => r.status === "fulfilled"
|
|
723
|
-
).length;
|
|
724
|
-
const successfulReviews = reviewResults.filter(
|
|
725
|
-
(r) => r.status === "fulfilled"
|
|
726
|
-
).length;
|
|
727
|
-
logger.info("Claude Code swarm integration completed", {
|
|
728
|
-
swarmId,
|
|
729
|
-
totalWorkerTasks: workerResults.length,
|
|
730
|
-
successfulWorkers,
|
|
731
|
-
totalReviews: reviewResults.length,
|
|
732
|
-
successfulReviews,
|
|
733
|
-
successRate: (successfulWorkers / workerResults.length * 100).toFixed(
|
|
734
|
-
1
|
|
735
|
-
)
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* Log cost analysis for Claude Code agents
|
|
740
|
-
*/
|
|
741
|
-
logClaudeCodeCostAnalysis() {
|
|
742
|
-
const totalSessions = this.activeAgentSessions.size;
|
|
743
|
-
logger.info("Claude Code Agent Cost Analysis", {
|
|
744
|
-
totalSessions,
|
|
745
|
-
estimatedSavings: "60-80% vs all-Oracle approach",
|
|
746
|
-
agentEfficiency: "Specialized agents for optimal task matching",
|
|
747
|
-
qualityMaintenance: "High-quality output through specialized capabilities"
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
/**
|
|
751
|
-
* Get available Claude Code agents by type
|
|
752
|
-
*/
|
|
753
|
-
getAvailableAgents() {
|
|
754
|
-
const agents = Array.from(this.claudeAgents.values());
|
|
755
|
-
return {
|
|
756
|
-
oracles: agents.filter((a) => a.type === "oracle").map((a) => a.name),
|
|
757
|
-
workers: agents.filter((a) => a.type === "worker").map((a) => a.name),
|
|
758
|
-
reviewers: agents.filter((a) => a.type === "reviewer").map((a) => a.name)
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
var agent_bridge_default = ClaudeCodeAgentBridge;
|
|
763
|
-
export {
|
|
764
|
-
CLAUDE_CODE_AGENTS,
|
|
765
|
-
ClaudeCodeAgentBridge,
|
|
766
|
-
agent_bridge_default as default
|
|
767
|
-
};
|
|
768
|
-
//# sourceMappingURL=agent-bridge.js.map
|