agentic-qe 3.6.19 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/pr-review/SKILL.md +1 -1
- package/.claude/skills/skills-manifest.json +6 -6
- package/README.md +43 -7
- package/package.json +3 -2
- package/scripts/generate-opencode-agents.ts +523 -0
- package/scripts/generate-opencode-skills.ts +318 -0
- package/scripts/rvf-baseline-benchmark.ts +843 -0
- package/v3/CHANGELOG.md +56 -0
- package/v3/README.md +7 -7
- package/v3/assets/skills/pr-review/SKILL.md +1 -1
- package/v3/dist/adapters/a2a/notifications/retry-queue.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/notifications/retry-queue.js +2 -1
- package/v3/dist/adapters/a2a/notifications/retry-queue.js.map +1 -1
- package/v3/dist/adapters/a2a/notifications/subscription-store.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/notifications/subscription-store.js +2 -1
- package/v3/dist/adapters/a2a/notifications/subscription-store.js.map +1 -1
- package/v3/dist/adapters/a2a/tasks/task-manager.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/tasks/task-manager.js +4 -3
- package/v3/dist/adapters/a2a/tasks/task-manager.js.map +1 -1
- package/v3/dist/agents/claim-verifier/index.d.ts.map +1 -1
- package/v3/dist/agents/claim-verifier/index.js +2 -1
- package/v3/dist/agents/claim-verifier/index.js.map +1 -1
- package/v3/dist/audit/witness-chain.d.ts +148 -0
- package/v3/dist/audit/witness-chain.d.ts.map +1 -0
- package/v3/dist/audit/witness-chain.js +269 -0
- package/v3/dist/audit/witness-chain.js.map +1 -0
- package/v3/dist/cli/brain-commands.d.ts +39 -0
- package/v3/dist/cli/brain-commands.d.ts.map +1 -0
- package/v3/dist/cli/brain-commands.js +60 -0
- package/v3/dist/cli/brain-commands.js.map +1 -0
- package/v3/dist/cli/bundle.js +6790 -3274
- package/v3/dist/cli/command-registry.d.ts.map +1 -1
- package/v3/dist/cli/command-registry.js +3 -1
- package/v3/dist/cli/command-registry.js.map +1 -1
- package/v3/dist/cli/commands/hooks.d.ts.map +1 -1
- package/v3/dist/cli/commands/hooks.js +17 -2
- package/v3/dist/cli/commands/hooks.js.map +1 -1
- package/v3/dist/cli/commands/init.d.ts.map +1 -1
- package/v3/dist/cli/commands/init.js +2 -0
- package/v3/dist/cli/commands/init.js.map +1 -1
- package/v3/dist/cli/commands/learning-helpers.d.ts.map +1 -1
- package/v3/dist/cli/commands/learning-helpers.js +11 -0
- package/v3/dist/cli/commands/learning-helpers.js.map +1 -1
- package/v3/dist/cli/handlers/brain-handler.d.ts +22 -0
- package/v3/dist/cli/handlers/brain-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/brain-handler.js +148 -0
- package/v3/dist/cli/handlers/brain-handler.js.map +1 -0
- package/v3/dist/cli/handlers/index.d.ts +1 -0
- package/v3/dist/cli/handlers/index.d.ts.map +1 -1
- package/v3/dist/cli/handlers/index.js +1 -0
- package/v3/dist/cli/handlers/index.js.map +1 -1
- package/v3/dist/cli/handlers/init-handler.d.ts +1 -0
- package/v3/dist/cli/handlers/init-handler.d.ts.map +1 -1
- package/v3/dist/cli/handlers/init-handler.js +3 -0
- package/v3/dist/cli/handlers/init-handler.js.map +1 -1
- package/v3/dist/cli/scheduler/persistent-scheduler.d.ts.map +1 -1
- package/v3/dist/cli/scheduler/persistent-scheduler.js +2 -1
- package/v3/dist/cli/scheduler/persistent-scheduler.js.map +1 -1
- package/v3/dist/coordination/consensus/consensus-engine.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/consensus-engine.js +2 -1
- package/v3/dist/coordination/consensus/consensus-engine.js.map +1 -1
- package/v3/dist/coordination/cross-domain-router.d.ts.map +1 -1
- package/v3/dist/coordination/cross-domain-router.js +7 -8
- package/v3/dist/coordination/cross-domain-router.js.map +1 -1
- package/v3/dist/coordination/handlers/code-intelligence-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/code-intelligence-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/code-intelligence-handlers.js +203 -0
- package/v3/dist/coordination/handlers/code-intelligence-handlers.js.map +1 -0
- package/v3/dist/coordination/handlers/coverage-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/coverage-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/coverage-handlers.js +120 -0
- package/v3/dist/coordination/handlers/coverage-handlers.js.map +1 -0
- package/v3/dist/coordination/handlers/handler-types.d.ts +35 -0
- package/v3/dist/coordination/handlers/handler-types.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/handler-types.js +8 -0
- package/v3/dist/coordination/handlers/handler-types.js.map +1 -0
- package/v3/dist/coordination/handlers/handler-utils.d.ts +106 -0
- package/v3/dist/coordination/handlers/handler-utils.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/handler-utils.js +480 -0
- package/v3/dist/coordination/handlers/handler-utils.js.map +1 -0
- package/v3/dist/coordination/handlers/index.d.ts +15 -0
- package/v3/dist/coordination/handlers/index.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/index.js +14 -0
- package/v3/dist/coordination/handlers/index.js.map +1 -0
- package/v3/dist/coordination/handlers/misc-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/misc-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/misc-handlers.js +64 -0
- package/v3/dist/coordination/handlers/misc-handlers.js.map +1 -0
- package/v3/dist/coordination/handlers/quality-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/quality-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/quality-handlers.js +83 -0
- package/v3/dist/coordination/handlers/quality-handlers.js.map +1 -0
- package/v3/dist/coordination/handlers/requirements-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/requirements-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/requirements-handlers.js +95 -0
- package/v3/dist/coordination/handlers/requirements-handlers.js.map +1 -0
- package/v3/dist/coordination/handlers/security-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/security-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/security-handlers.js +255 -0
- package/v3/dist/coordination/handlers/security-handlers.js.map +1 -0
- package/v3/dist/coordination/handlers/test-execution-handlers.d.ts +9 -0
- package/v3/dist/coordination/handlers/test-execution-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/handlers/test-execution-handlers.js +153 -0
- package/v3/dist/coordination/handlers/test-execution-handlers.js.map +1 -0
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +28 -25
- package/v3/dist/coordination/queen-coordinator.js.map +1 -1
- package/v3/dist/coordination/task-executor.d.ts +25 -9
- package/v3/dist/coordination/task-executor.d.ts.map +1 -1
- package/v3/dist/coordination/task-executor.js +38 -1352
- package/v3/dist/coordination/task-executor.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.js +15 -9
- package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/hnsw-index.d.ts +31 -44
- package/v3/dist/domains/coverage-analysis/services/hnsw-index.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/hnsw-index.js +73 -178
- package/v3/dist/domains/coverage-analysis/services/hnsw-index.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +2 -1
- package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.js +8 -0
- package/v3/dist/domains/quality-assessment/coordinator.js.map +1 -1
- package/v3/dist/domains/requirements-validation/services/product-factors-assessment/types/index.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/product-factors-assessment/types/index.js +2 -1
- package/v3/dist/domains/requirements-validation/services/product-factors-assessment/types/index.js.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.d.ts +14 -0
- package/v3/dist/domains/test-execution/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.js +18 -0
- package/v3/dist/domains/test-execution/coordinator.js.map +1 -1
- package/v3/dist/domains/test-execution/services/index.d.ts +1 -0
- package/v3/dist/domains/test-execution/services/index.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/index.js +1 -0
- package/v3/dist/domains/test-execution/services/index.js.map +1 -1
- package/v3/dist/domains/test-execution/services/mincut-test-optimizer.d.ts +118 -0
- package/v3/dist/domains/test-execution/services/mincut-test-optimizer.d.ts.map +1 -0
- package/v3/dist/domains/test-execution/services/mincut-test-optimizer.js +358 -0
- package/v3/dist/domains/test-execution/services/mincut-test-optimizer.js.map +1 -0
- package/v3/dist/domains/test-execution/types/e2e-step.types.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/types/e2e-step.types.js +2 -1
- package/v3/dist/domains/test-execution/types/e2e-step.types.js.map +1 -1
- package/v3/dist/feedback/coverage-learner.d.ts.map +1 -1
- package/v3/dist/feedback/coverage-learner.js +2 -1
- package/v3/dist/feedback/coverage-learner.js.map +1 -1
- package/v3/dist/init/opencode-installer.d.ts +67 -0
- package/v3/dist/init/opencode-installer.d.ts.map +1 -0
- package/v3/dist/init/opencode-installer.js +267 -0
- package/v3/dist/init/opencode-installer.js.map +1 -0
- package/v3/dist/init/orchestrator.d.ts.map +1 -1
- package/v3/dist/init/orchestrator.js +1 -0
- package/v3/dist/init/orchestrator.js.map +1 -1
- package/v3/dist/init/phases/09-assets.d.ts +2 -0
- package/v3/dist/init/phases/09-assets.d.ts.map +1 -1
- package/v3/dist/init/phases/09-assets.js +26 -0
- package/v3/dist/init/phases/09-assets.js.map +1 -1
- package/v3/dist/init/phases/phase-interface.d.ts +2 -0
- package/v3/dist/init/phases/phase-interface.d.ts.map +1 -1
- package/v3/dist/init/phases/phase-interface.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.js +2 -1
- package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.js.map +1 -1
- package/v3/dist/integrations/n8n/agent-factory.d.ts.map +1 -1
- package/v3/dist/integrations/n8n/agent-factory.js +2 -1
- package/v3/dist/integrations/n8n/agent-factory.js.map +1 -1
- package/v3/dist/integrations/rl-suite/sona.d.ts.map +1 -1
- package/v3/dist/integrations/rl-suite/sona.js +2 -1
- package/v3/dist/integrations/rl-suite/sona.js.map +1 -1
- package/v3/dist/integrations/ruvector/brain-exporter.d.ts +66 -0
- package/v3/dist/integrations/ruvector/brain-exporter.d.ts.map +1 -0
- package/v3/dist/integrations/ruvector/brain-exporter.js +538 -0
- package/v3/dist/integrations/ruvector/brain-exporter.js.map +1 -0
- package/v3/dist/integrations/ruvector/hypergraph-schema.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/hypergraph-schema.js +7 -0
- package/v3/dist/integrations/ruvector/hypergraph-schema.js.map +1 -1
- package/v3/dist/integrations/ruvector/index.d.ts +5 -0
- package/v3/dist/integrations/ruvector/index.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/index.js +6 -0
- package/v3/dist/integrations/ruvector/index.js.map +1 -1
- package/v3/dist/integrations/ruvector/mincut-wrapper.d.ts +204 -0
- package/v3/dist/integrations/ruvector/mincut-wrapper.d.ts.map +1 -0
- package/v3/dist/integrations/ruvector/mincut-wrapper.js +310 -0
- package/v3/dist/integrations/ruvector/mincut-wrapper.js.map +1 -0
- package/v3/dist/integrations/ruvector/rvf-dual-writer.d.ts +141 -0
- package/v3/dist/integrations/ruvector/rvf-dual-writer.d.ts.map +1 -0
- package/v3/dist/integrations/ruvector/rvf-dual-writer.js +367 -0
- package/v3/dist/integrations/ruvector/rvf-dual-writer.js.map +1 -0
- package/v3/dist/integrations/ruvector/rvf-native-adapter.d.ts +60 -0
- package/v3/dist/integrations/ruvector/rvf-native-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/ruvector/rvf-native-adapter.js +240 -0
- package/v3/dist/integrations/ruvector/rvf-native-adapter.js.map +1 -0
- package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +41 -0
- package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts.map +1 -0
- package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.js +122 -0
- package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.js.map +1 -0
- package/v3/dist/integrations/ruvector/sona-wrapper.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/sona-wrapper.js +2 -1
- package/v3/dist/integrations/ruvector/sona-wrapper.js.map +1 -1
- package/v3/dist/integrations/vibium/client.d.ts.map +1 -1
- package/v3/dist/integrations/vibium/client.js +2 -1
- package/v3/dist/integrations/vibium/client.js.map +1 -1
- package/v3/dist/integrations/vibium/fallback.d.ts.map +1 -1
- package/v3/dist/integrations/vibium/fallback.js +2 -1
- package/v3/dist/integrations/vibium/fallback.js.map +1 -1
- package/v3/dist/kernel/hnsw-adapter.d.ts +99 -0
- package/v3/dist/kernel/hnsw-adapter.d.ts.map +1 -0
- package/v3/dist/kernel/hnsw-adapter.js +218 -0
- package/v3/dist/kernel/hnsw-adapter.js.map +1 -0
- package/v3/dist/kernel/hnsw-index-provider.d.ts +90 -0
- package/v3/dist/kernel/hnsw-index-provider.d.ts.map +1 -0
- package/v3/dist/kernel/hnsw-index-provider.js +23 -0
- package/v3/dist/kernel/hnsw-index-provider.js.map +1 -0
- package/v3/dist/kernel/kernel.d.ts.map +1 -1
- package/v3/dist/kernel/kernel.js +2 -1
- package/v3/dist/kernel/kernel.js.map +1 -1
- package/v3/dist/kernel/progressive-hnsw-backend.d.ts +67 -0
- package/v3/dist/kernel/progressive-hnsw-backend.d.ts.map +1 -0
- package/v3/dist/kernel/progressive-hnsw-backend.js +266 -0
- package/v3/dist/kernel/progressive-hnsw-backend.js.map +1 -0
- package/v3/dist/kernel/unified-memory-hnsw.d.ts +71 -0
- package/v3/dist/kernel/unified-memory-hnsw.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory-hnsw.js +87 -0
- package/v3/dist/kernel/unified-memory-hnsw.js.map +1 -1
- package/v3/dist/kernel/unified-memory-schemas.d.ts +1 -0
- package/v3/dist/kernel/unified-memory-schemas.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory-schemas.js +16 -0
- package/v3/dist/kernel/unified-memory-schemas.js.map +1 -1
- package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory.js +19 -9
- package/v3/dist/kernel/unified-memory.js.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.d.ts.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.js +14 -2
- package/v3/dist/learning/aqe-learning-engine.js.map +1 -1
- package/v3/dist/learning/dream/concept-graph.d.ts +10 -5
- package/v3/dist/learning/dream/concept-graph.d.ts.map +1 -1
- package/v3/dist/learning/dream/concept-graph.js +77 -25
- package/v3/dist/learning/dream/concept-graph.js.map +1 -1
- package/v3/dist/learning/dream/dream-engine.d.ts +16 -0
- package/v3/dist/learning/dream/dream-engine.d.ts.map +1 -1
- package/v3/dist/learning/dream/dream-engine.js +107 -29
- package/v3/dist/learning/dream/dream-engine.js.map +1 -1
- package/v3/dist/learning/dream/index.d.ts +2 -0
- package/v3/dist/learning/dream/index.d.ts.map +1 -1
- package/v3/dist/learning/dream/index.js +8 -0
- package/v3/dist/learning/dream/index.js.map +1 -1
- package/v3/dist/learning/dream/insight-generator.d.ts.map +1 -1
- package/v3/dist/learning/dream/insight-generator.js +2 -1
- package/v3/dist/learning/dream/insight-generator.js.map +1 -1
- package/v3/dist/learning/dream/rvcow-branch-manager.d.ts +170 -0
- package/v3/dist/learning/dream/rvcow-branch-manager.d.ts.map +1 -0
- package/v3/dist/learning/dream/rvcow-branch-manager.js +263 -0
- package/v3/dist/learning/dream/rvcow-branch-manager.js.map +1 -0
- package/v3/dist/learning/dream/speculative-dreamer.d.ts +129 -0
- package/v3/dist/learning/dream/speculative-dreamer.d.ts.map +1 -0
- package/v3/dist/learning/dream/speculative-dreamer.js +214 -0
- package/v3/dist/learning/dream/speculative-dreamer.js.map +1 -0
- package/v3/dist/learning/dream/spreading-activation.d.ts +1 -1
- package/v3/dist/learning/dream/spreading-activation.d.ts.map +1 -1
- package/v3/dist/learning/dream/spreading-activation.js +13 -5
- package/v3/dist/learning/dream/spreading-activation.js.map +1 -1
- package/v3/dist/learning/memory-auditor.d.ts.map +1 -1
- package/v3/dist/learning/memory-auditor.js +7 -4
- package/v3/dist/learning/memory-auditor.js.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.d.ts +9 -0
- package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.js +50 -1
- package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/real-embeddings.d.ts.map +1 -1
- package/v3/dist/learning/real-embeddings.js +26 -1
- package/v3/dist/learning/real-embeddings.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +13 -2
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/sqlite-persistence.d.ts +5 -0
- package/v3/dist/learning/sqlite-persistence.d.ts.map +1 -1
- package/v3/dist/learning/sqlite-persistence.js +47 -7
- package/v3/dist/learning/sqlite-persistence.js.map +1 -1
- package/v3/dist/mcp/bundle.js +5837 -2932
- package/v3/dist/mcp/connection-pool.d.ts.map +1 -1
- package/v3/dist/mcp/connection-pool.js +3 -2
- package/v3/dist/mcp/connection-pool.js.map +1 -1
- package/v3/dist/mcp/entry.js +12 -0
- package/v3/dist/mcp/entry.js.map +1 -1
- package/v3/dist/mcp/handlers/core-handlers.d.ts +28 -0
- package/v3/dist/mcp/handlers/core-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/core-handlers.js +117 -0
- package/v3/dist/mcp/handlers/core-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/index.d.ts +1 -1
- package/v3/dist/mcp/handlers/index.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/index.js +1 -1
- package/v3/dist/mcp/handlers/index.js.map +1 -1
- package/v3/dist/mcp/http-server.d.ts.map +1 -1
- package/v3/dist/mcp/http-server.js +12 -9
- package/v3/dist/mcp/http-server.js.map +1 -1
- package/v3/dist/mcp/middleware/output-compaction.d.ts +45 -0
- package/v3/dist/mcp/middleware/output-compaction.d.ts.map +1 -0
- package/v3/dist/mcp/middleware/output-compaction.js +279 -0
- package/v3/dist/mcp/middleware/output-compaction.js.map +1 -0
- package/v3/dist/mcp/protocol-server.d.ts.map +1 -1
- package/v3/dist/mcp/protocol-server.js +53 -41
- package/v3/dist/mcp/protocol-server.js.map +1 -1
- package/v3/dist/mcp/security/sampling-server.js +2 -2
- package/v3/dist/mcp/security/sampling-server.js.map +1 -1
- package/v3/dist/mcp/services/mincut-routing-service.d.ts +148 -0
- package/v3/dist/mcp/services/mincut-routing-service.d.ts.map +1 -0
- package/v3/dist/mcp/services/mincut-routing-service.js +198 -0
- package/v3/dist/mcp/services/mincut-routing-service.js.map +1 -0
- package/v3/dist/mcp/services/reasoning-bank-service.d.ts.map +1 -1
- package/v3/dist/mcp/services/reasoning-bank-service.js +4 -5
- package/v3/dist/mcp/services/reasoning-bank-service.js.map +1 -1
- package/v3/dist/mcp/services/task-router.d.ts +4 -0
- package/v3/dist/mcp/services/task-router.d.ts.map +1 -1
- package/v3/dist/mcp/services/task-router.js +57 -15
- package/v3/dist/mcp/services/task-router.js.map +1 -1
- package/v3/dist/mcp/tools/base.d.ts +5 -0
- package/v3/dist/mcp/tools/base.d.ts.map +1 -1
- package/v3/dist/mcp/tools/base.js +25 -1
- package/v3/dist/mcp/tools/base.js.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/dream.d.ts.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/dream.js +22 -0
- package/v3/dist/mcp/tools/learning-optimization/dream.js.map +1 -1
- package/v3/dist/mcp/tools/security-compliance/scan.d.ts.map +1 -1
- package/v3/dist/mcp/tools/security-compliance/scan.js +2 -1
- package/v3/dist/mcp/tools/security-compliance/scan.js.map +1 -1
- package/v3/dist/mcp/transport/index.d.ts +8 -6
- package/v3/dist/mcp/transport/index.d.ts.map +1 -1
- package/v3/dist/mcp/transport/index.js +10 -9
- package/v3/dist/mcp/transport/index.js.map +1 -1
- package/v3/dist/migrations/20260120_add_hypergraph_tables.d.ts.map +1 -1
- package/v3/dist/migrations/20260120_add_hypergraph_tables.js +7 -0
- package/v3/dist/migrations/20260120_add_hypergraph_tables.js.map +1 -1
- package/v3/dist/monitoring/structural-health.d.ts +142 -0
- package/v3/dist/monitoring/structural-health.d.ts.map +1 -0
- package/v3/dist/monitoring/structural-health.js +201 -0
- package/v3/dist/monitoring/structural-health.js.map +1 -0
- package/v3/dist/optimization/token-optimizer-service.d.ts.map +1 -1
- package/v3/dist/optimization/token-optimizer-service.js +2 -1
- package/v3/dist/optimization/token-optimizer-service.js.map +1 -1
- package/v3/dist/planning/goap-planner.d.ts.map +1 -1
- package/v3/dist/planning/goap-planner.js +2 -1
- package/v3/dist/planning/goap-planner.js.map +1 -1
- package/v3/dist/planning/plan-executor.d.ts +5 -1
- package/v3/dist/planning/plan-executor.d.ts.map +1 -1
- package/v3/dist/planning/plan-executor.js +16 -2
- package/v3/dist/planning/plan-executor.js.map +1 -1
- package/v3/dist/routing/routing-feedback.d.ts.map +1 -1
- package/v3/dist/routing/routing-feedback.js +2 -1
- package/v3/dist/routing/routing-feedback.js.map +1 -1
- package/v3/dist/shared/llm/cost-tracker.d.ts.map +1 -1
- package/v3/dist/shared/llm/cost-tracker.js +2 -1
- package/v3/dist/shared/llm/cost-tracker.js.map +1 -1
- package/v3/dist/shared/llm/metrics/router-metrics.d.ts.map +1 -1
- package/v3/dist/shared/llm/metrics/router-metrics.js +2 -1
- package/v3/dist/shared/llm/metrics/router-metrics.js.map +1 -1
- package/v3/dist/strange-loop/belief-reconciler.d.ts.map +1 -1
- package/v3/dist/strange-loop/belief-reconciler.js +2 -1
- package/v3/dist/strange-loop/belief-reconciler.js.map +1 -1
- package/v3/dist/sync/readers/json-reader.d.ts.map +1 -1
- package/v3/dist/sync/readers/json-reader.js +2 -1
- package/v3/dist/sync/readers/json-reader.js.map +1 -1
- package/v3/dist/types/cross-phase-signals.d.ts.map +1 -1
- package/v3/dist/types/cross-phase-signals.js +2 -1
- package/v3/dist/types/cross-phase-signals.js.map +1 -1
- package/v3/dist/validation/swarm-skill-validator.d.ts.map +1 -1
- package/v3/dist/validation/swarm-skill-validator.js +2 -1
- package/v3/dist/validation/swarm-skill-validator.js.map +1 -1
- package/v3/dist/workers/base-worker.d.ts.map +1 -1
- package/v3/dist/workers/base-worker.js +2 -1
- package/v3/dist/workers/base-worker.js.map +1 -1
- package/v3/package.json +5 -2
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate-opencode-agents.ts
|
|
3
|
+
*
|
|
4
|
+
* Reads all .claude/agents/v3/*.md agent definitions and generates
|
|
5
|
+
* .opencode/agents/{name}.yaml configs for the OpenCode platform.
|
|
6
|
+
*
|
|
7
|
+
* Agent .md files use YAML frontmatter + optional XML-tagged sections
|
|
8
|
+
* (<qe_agent_definition>) or markdown body for non-XML agents.
|
|
9
|
+
*
|
|
10
|
+
* Usage: npx tsx scripts/generate-opencode-agents.ts
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as fs from 'fs';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
|
|
16
|
+
interface AgentFrontmatter {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
domain?: string;
|
|
20
|
+
capabilities?: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface AgentConfig {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
model: string;
|
|
27
|
+
systemPrompt: string;
|
|
28
|
+
tools: string[];
|
|
29
|
+
permissions: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Platform infrastructure agents to exclude (not QE agents)
|
|
33
|
+
const EXCLUDED_PREFIXES = [
|
|
34
|
+
'v3-',
|
|
35
|
+
'adr-',
|
|
36
|
+
'claims-',
|
|
37
|
+
'sparc-',
|
|
38
|
+
'reasoningbank-',
|
|
39
|
+
'swarm-memory-',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
// Non-qe agent filenames that ARE QE-relevant and should be included
|
|
43
|
+
const INCLUDED_NON_QE = new Set([
|
|
44
|
+
'collective-intelligence-coordinator',
|
|
45
|
+
'ddd-domain-expert',
|
|
46
|
+
'memory-specialist',
|
|
47
|
+
'performance-engineer',
|
|
48
|
+
'security-architect',
|
|
49
|
+
'security-auditor',
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
function isIncluded(basename: string): boolean {
|
|
53
|
+
// Skip README
|
|
54
|
+
if (basename === 'README') return false;
|
|
55
|
+
|
|
56
|
+
// Include all qe-* agents
|
|
57
|
+
if (basename.startsWith('qe-')) return true;
|
|
58
|
+
|
|
59
|
+
// Include specific non-qe agents
|
|
60
|
+
if (INCLUDED_NON_QE.has(basename)) return true;
|
|
61
|
+
|
|
62
|
+
// Exclude platform infrastructure
|
|
63
|
+
if (EXCLUDED_PREFIXES.some((p) => basename.startsWith(p))) return false;
|
|
64
|
+
|
|
65
|
+
// Exclude anything else not in the include list
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function parseFrontmatter(content: string): AgentFrontmatter | null {
|
|
70
|
+
// Normalize CRLF to LF before parsing
|
|
71
|
+
const normalized = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
72
|
+
const match = normalized.match(/^---\n([\s\S]*?)\n---/);
|
|
73
|
+
if (!match) return null;
|
|
74
|
+
|
|
75
|
+
const yaml = match[1];
|
|
76
|
+
const result: Record<string, unknown> = {};
|
|
77
|
+
|
|
78
|
+
let currentArrayKey: string | null = null;
|
|
79
|
+
const arrayValues: string[] = [];
|
|
80
|
+
|
|
81
|
+
for (const line of yaml.split('\n')) {
|
|
82
|
+
const trimmed = line.trim();
|
|
83
|
+
if (!trimmed || trimmed.startsWith('#')) continue;
|
|
84
|
+
|
|
85
|
+
// Array item continuation
|
|
86
|
+
if (trimmed.startsWith('- ') && currentArrayKey) {
|
|
87
|
+
arrayValues.push(trimmed.slice(2).trim().replace(/['"]/g, ''));
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Flush previous array
|
|
92
|
+
if (currentArrayKey && arrayValues.length > 0) {
|
|
93
|
+
result[currentArrayKey] = [...arrayValues];
|
|
94
|
+
currentArrayKey = null;
|
|
95
|
+
arrayValues.length = 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const colonIdx = trimmed.indexOf(':');
|
|
99
|
+
if (colonIdx === -1) continue;
|
|
100
|
+
|
|
101
|
+
const key = trimmed.slice(0, colonIdx).trim();
|
|
102
|
+
let value = trimmed.slice(colonIdx + 1).trim();
|
|
103
|
+
|
|
104
|
+
// Remove quotes
|
|
105
|
+
if (
|
|
106
|
+
(value.startsWith('"') && value.endsWith('"')) ||
|
|
107
|
+
(value.startsWith("'") && value.endsWith("'"))
|
|
108
|
+
) {
|
|
109
|
+
value = value.slice(1, -1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Inline array
|
|
113
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
114
|
+
result[key] = value
|
|
115
|
+
.slice(1, -1)
|
|
116
|
+
.split(',')
|
|
117
|
+
.map((s: string) => s.trim().replace(/['"]/g, ''))
|
|
118
|
+
.filter(Boolean);
|
|
119
|
+
} else if (value === '' || value === '|') {
|
|
120
|
+
// Possible multi-line array starting next line
|
|
121
|
+
currentArrayKey = key;
|
|
122
|
+
} else {
|
|
123
|
+
result[key] = value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Flush final array
|
|
128
|
+
if (currentArrayKey && arrayValues.length > 0) {
|
|
129
|
+
result[currentArrayKey] = [...arrayValues];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return result as unknown as AgentFrontmatter;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Extract content of an XML section like <identity>...</identity> */
|
|
136
|
+
function extractXmlSection(content: string, tag: string): string | null {
|
|
137
|
+
const regex = new RegExp(`<${tag}>([\\s\\S]*?)<\\/${tag}>`);
|
|
138
|
+
const match = content.match(regex);
|
|
139
|
+
if (!match) return null;
|
|
140
|
+
return match[1].trim();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Extract the first meaningful paragraph after frontmatter (for non-XML agents) */
|
|
144
|
+
function extractFirstParagraph(content: string): string {
|
|
145
|
+
const afterFrontmatter = content.replace(/^---[\s\S]*?---\n*/, '');
|
|
146
|
+
const lines = afterFrontmatter.split('\n');
|
|
147
|
+
const paragraphs: string[] = [];
|
|
148
|
+
|
|
149
|
+
let inParagraph = false;
|
|
150
|
+
for (const line of lines) {
|
|
151
|
+
const trimmed = line.trim();
|
|
152
|
+
if (trimmed.startsWith('#')) {
|
|
153
|
+
if (inParagraph) break;
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (trimmed.startsWith('```') || trimmed.startsWith('<') || trimmed.startsWith('|')) {
|
|
157
|
+
if (inParagraph) break;
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (trimmed === '') {
|
|
161
|
+
if (inParagraph) break;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
inParagraph = true;
|
|
165
|
+
paragraphs.push(trimmed);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return paragraphs.join(' ').slice(0, 800);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Extract markdown sections (## headers) for non-XML agents */
|
|
172
|
+
function extractMarkdownSections(content: string): Map<string, string> {
|
|
173
|
+
const afterFrontmatter = content.replace(/^---[\s\S]*?---\n*/, '');
|
|
174
|
+
const sections = new Map<string, string>();
|
|
175
|
+
const regex = /^##\s+(.+)/gm;
|
|
176
|
+
const headers: Array<{ title: string; start: number }> = [];
|
|
177
|
+
|
|
178
|
+
let match: RegExpExecArray | null;
|
|
179
|
+
while ((match = regex.exec(afterFrontmatter)) !== null) {
|
|
180
|
+
headers.push({ title: match[1].trim(), start: match.index });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
for (let i = 0; i < headers.length; i++) {
|
|
184
|
+
const end = i + 1 < headers.length ? headers[i + 1].start : afterFrontmatter.length;
|
|
185
|
+
const body = afterFrontmatter
|
|
186
|
+
.slice(headers[i].start + headers[i].title.length + 3, end)
|
|
187
|
+
.trim();
|
|
188
|
+
// Take first ~500 chars, skip code blocks
|
|
189
|
+
const cleaned = body
|
|
190
|
+
.replace(/```[\s\S]*?```/g, '')
|
|
191
|
+
.replace(/\|[\s\S]*?\|/g, '')
|
|
192
|
+
.trim()
|
|
193
|
+
.slice(0, 500);
|
|
194
|
+
if (cleaned) {
|
|
195
|
+
sections.set(headers[i].title.toLowerCase(), cleaned);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return sections;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Summarize memory_namespace section — extract just the namespace keys */
|
|
203
|
+
function summarizeMemoryNamespace(raw: string): string {
|
|
204
|
+
const keys: string[] = [];
|
|
205
|
+
for (const line of raw.split('\n')) {
|
|
206
|
+
const trimmed = line.trim();
|
|
207
|
+
if (trimmed.startsWith('- aqe/') || trimmed.startsWith('- learning/')) {
|
|
208
|
+
// Extract the namespace path (before the description)
|
|
209
|
+
const parts = trimmed.slice(2).split(' - ');
|
|
210
|
+
keys.push(parts[0].trim());
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (keys.length === 0) return 'aqe/learning/*, aqe/patterns/*';
|
|
214
|
+
// Deduplicate and limit
|
|
215
|
+
const unique = [...new Set(keys)].slice(0, 6);
|
|
216
|
+
return unique.join(', ');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Map agent domain to relevant MCP tools */
|
|
220
|
+
function mapToolsFromDomain(domain: string | undefined, name: string): string[] {
|
|
221
|
+
const baseTools = ['read', 'edit', 'bash', 'grep', 'glob'];
|
|
222
|
+
const mcpTools = new Set<string>();
|
|
223
|
+
|
|
224
|
+
// Always include memory tools for learning
|
|
225
|
+
mcpTools.add('mcp:agentic-qe:memory_store');
|
|
226
|
+
mcpTools.add('mcp:agentic-qe:memory_query');
|
|
227
|
+
mcpTools.add('mcp:agentic-qe:memory_retrieve');
|
|
228
|
+
|
|
229
|
+
const d = (domain || '').toLowerCase();
|
|
230
|
+
const n = name.toLowerCase();
|
|
231
|
+
|
|
232
|
+
// Security
|
|
233
|
+
if (d.includes('security') || n.includes('security') || n.includes('pentest')) {
|
|
234
|
+
mcpTools.add('mcp:agentic-qe:security_scan_comprehensive');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Testing / test generation
|
|
238
|
+
if (
|
|
239
|
+
d.includes('test') ||
|
|
240
|
+
n.includes('test') ||
|
|
241
|
+
n.includes('tdd') ||
|
|
242
|
+
n.includes('mutation') ||
|
|
243
|
+
n.includes('property') ||
|
|
244
|
+
n.includes('bdd')
|
|
245
|
+
) {
|
|
246
|
+
mcpTools.add('mcp:agentic-qe:test_generate_enhanced');
|
|
247
|
+
mcpTools.add('mcp:agentic-qe:test_execute_parallel');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Coverage
|
|
251
|
+
if (d.includes('coverage') || n.includes('coverage') || n.includes('gap')) {
|
|
252
|
+
mcpTools.add('mcp:agentic-qe:coverage_analyze_sublinear');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Quality
|
|
256
|
+
if (d.includes('quality') || n.includes('quality') || n.includes('review') || n.includes('gate')) {
|
|
257
|
+
mcpTools.add('mcp:agentic-qe:quality_assess');
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// API / Contract
|
|
261
|
+
if (d.includes('contract') || n.includes('contract') || n.includes('graphql') || n.includes('odata') || n.includes('soap')) {
|
|
262
|
+
mcpTools.add('mcp:agentic-qe:contract_validate');
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Performance
|
|
266
|
+
if (d.includes('performance') || n.includes('performance') || n.includes('load')) {
|
|
267
|
+
mcpTools.add('mcp:agentic-qe:quality_assess');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Defect / debugging
|
|
271
|
+
if (d.includes('defect') || n.includes('defect') || n.includes('root-cause') || n.includes('debug')) {
|
|
272
|
+
mcpTools.add('mcp:agentic-qe:defect_predict');
|
|
273
|
+
mcpTools.add('mcp:agentic-qe:code_index');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Accessibility
|
|
277
|
+
if (d.includes('accessibility') || n.includes('accessibility') || n.includes('a11y') || n.includes('responsive') || n.includes('visual')) {
|
|
278
|
+
mcpTools.add('mcp:agentic-qe:accessibility_test');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Chaos / resilience
|
|
282
|
+
if (d.includes('chaos') || n.includes('chaos') || n.includes('resilience')) {
|
|
283
|
+
mcpTools.add('mcp:agentic-qe:chaos_test');
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Compliance
|
|
287
|
+
if (d.includes('compliance') || n.includes('compliance') || n.includes('sod')) {
|
|
288
|
+
mcpTools.add('mcp:agentic-qe:security_scan_comprehensive');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Requirements / BDD
|
|
292
|
+
if (d.includes('requirements') || n.includes('requirements') || n.includes('bdd')) {
|
|
293
|
+
mcpTools.add('mcp:agentic-qe:requirements_validate');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Code intelligence / knowledge graph
|
|
297
|
+
if (d.includes('code-intelligence') || n.includes('code-intelligence') || n.includes('kg-builder') || n.includes('dependency') || n.includes('complexity')) {
|
|
298
|
+
mcpTools.add('mcp:agentic-qe:code_index');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Fleet / coordination
|
|
302
|
+
if (n.includes('fleet') || n.includes('coordinator') || n.includes('queen') || n.includes('parallel')) {
|
|
303
|
+
mcpTools.add('mcp:agentic-qe:fleet_status');
|
|
304
|
+
mcpTools.add('mcp:agentic-qe:task_orchestrate');
|
|
305
|
+
mcpTools.add('mcp:agentic-qe:agent_spawn');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Learning / transfer / metrics / patterns
|
|
309
|
+
if (n.includes('learning') || n.includes('transfer') || n.includes('metrics') || n.includes('pattern')) {
|
|
310
|
+
mcpTools.add('mcp:agentic-qe:memory_share');
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Deployment
|
|
314
|
+
if (n.includes('deployment')) {
|
|
315
|
+
mcpTools.add('mcp:agentic-qe:quality_assess');
|
|
316
|
+
mcpTools.add('mcp:agentic-qe:security_scan_comprehensive');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return [...baseTools, ...Array.from(mcpTools)];
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** Build systemPrompt for agents with <qe_agent_definition> XML sections */
|
|
323
|
+
function buildXmlSystemPrompt(name: string, content: string, fm: AgentFrontmatter): string {
|
|
324
|
+
const identity = extractXmlSection(content, 'identity') || fm.description;
|
|
325
|
+
const capabilities = extractXmlSection(content, 'capabilities');
|
|
326
|
+
const defaultToAction = extractXmlSection(content, 'default_to_action');
|
|
327
|
+
const memoryNamespace = extractXmlSection(content, 'memory_namespace');
|
|
328
|
+
const outputFormat = extractXmlSection(content, 'output_format');
|
|
329
|
+
const coordinationNotes = extractXmlSection(content, 'coordination_notes');
|
|
330
|
+
|
|
331
|
+
const parts: string[] = [];
|
|
332
|
+
|
|
333
|
+
parts.push(`You are ${name}, a specialized QE agent in the Agentic QE v3 platform.\n`);
|
|
334
|
+
parts.push(identity);
|
|
335
|
+
|
|
336
|
+
if (capabilities) {
|
|
337
|
+
parts.push(`\nCore Capabilities:\n${capabilities}`);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (defaultToAction) {
|
|
341
|
+
parts.push(`\nOperating Principles:\n${defaultToAction}`);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Memory integration — summarized
|
|
345
|
+
const nsKeys = memoryNamespace ? summarizeMemoryNamespace(memoryNamespace) : 'aqe/learning/*, aqe/patterns/*';
|
|
346
|
+
parts.push(`\nMemory Integration:
|
|
347
|
+
- Query past patterns before starting: use mcp:agentic-qe:memory_query
|
|
348
|
+
- Store findings after completion: use mcp:agentic-qe:memory_store
|
|
349
|
+
- Namespaces: ${nsKeys}`);
|
|
350
|
+
|
|
351
|
+
// Learning protocol — summarized (not the full code blocks)
|
|
352
|
+
parts.push(`\nLearning Protocol:
|
|
353
|
+
After each task, store outcomes with reward scoring (0-1 scale) using
|
|
354
|
+
mcp:agentic-qe:memory_store. Query historical patterns with
|
|
355
|
+
mcp:agentic-qe:memory_query before starting new work.`);
|
|
356
|
+
|
|
357
|
+
if (outputFormat) {
|
|
358
|
+
parts.push(`\nOutput Format:\n${outputFormat}`);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (coordinationNotes) {
|
|
362
|
+
// Strip code blocks from coordination notes
|
|
363
|
+
const cleanNotes = coordinationNotes.replace(/```[\s\S]*?```/g, '').trim();
|
|
364
|
+
if (cleanNotes) {
|
|
365
|
+
parts.push(`\nArchitecture Notes:\n${cleanNotes}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return parts.join('\n');
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** Build systemPrompt for non-XML agents (markdown body with capabilities in frontmatter) */
|
|
373
|
+
function buildMarkdownSystemPrompt(name: string, content: string, fm: AgentFrontmatter): string {
|
|
374
|
+
const firstParagraph = extractFirstParagraph(content);
|
|
375
|
+
const sections = extractMarkdownSections(content);
|
|
376
|
+
|
|
377
|
+
const parts: string[] = [];
|
|
378
|
+
|
|
379
|
+
parts.push(`You are ${name}, a specialized agent in the Agentic QE v3 platform.\n`);
|
|
380
|
+
parts.push(firstParagraph);
|
|
381
|
+
|
|
382
|
+
// Capabilities from frontmatter
|
|
383
|
+
if (fm.capabilities && fm.capabilities.length > 0) {
|
|
384
|
+
const capList = fm.capabilities
|
|
385
|
+
.map((c) => `- ${c.replace(/_/g, ' ')}`)
|
|
386
|
+
.join('\n');
|
|
387
|
+
parts.push(`\nCore Capabilities:\n${capList}`);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Include relevant markdown sections
|
|
391
|
+
const relevantKeys = ['key responsibilities', 'core principles', 'workflow', 'approach', 'methodology'];
|
|
392
|
+
for (const [key, value] of sections) {
|
|
393
|
+
if (relevantKeys.some((r) => key.includes(r))) {
|
|
394
|
+
parts.push(`\n${key.charAt(0).toUpperCase() + key.slice(1)}:\n${value.slice(0, 400)}`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Memory integration
|
|
399
|
+
parts.push(`\nMemory Integration:
|
|
400
|
+
- Query past patterns before starting: use mcp:agentic-qe:memory_query
|
|
401
|
+
- Store findings after completion: use mcp:agentic-qe:memory_store
|
|
402
|
+
- Namespaces: aqe/learning/*, aqe/patterns/*`);
|
|
403
|
+
|
|
404
|
+
parts.push(`\nLearning Protocol:
|
|
405
|
+
After each task, store outcomes with reward scoring (0-1 scale) using
|
|
406
|
+
mcp:agentic-qe:memory_store. Query historical patterns with
|
|
407
|
+
mcp:agentic-qe:memory_query before starting new work.`);
|
|
408
|
+
|
|
409
|
+
return parts.join('\n');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function escapeYamlString(s: string): string {
|
|
413
|
+
return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function generateAgentYaml(config: AgentConfig): string {
|
|
417
|
+
const toolsList = config.tools.map((t) => ` - "${t}"`).join('\n');
|
|
418
|
+
const permsList = Object.entries(config.permissions)
|
|
419
|
+
.map(([k, v]) => ` ${k}: ${v}`)
|
|
420
|
+
.join('\n');
|
|
421
|
+
|
|
422
|
+
// Indent systemPrompt for YAML block scalar
|
|
423
|
+
const indentedPrompt = config.systemPrompt.replace(/\n/g, '\n ');
|
|
424
|
+
|
|
425
|
+
return `name: ${config.name}
|
|
426
|
+
description: "${escapeYamlString(config.description)}"
|
|
427
|
+
model: "${config.model}"
|
|
428
|
+
systemPrompt: |
|
|
429
|
+
${indentedPrompt}
|
|
430
|
+
|
|
431
|
+
Available MCP tools from agentic-qe server are listed in the tools section below.
|
|
432
|
+
Always store findings and patterns in memory using mcp:agentic-qe:memory_store for learning.
|
|
433
|
+
Query past patterns using mcp:agentic-qe:memory_query before starting work.
|
|
434
|
+
tools:
|
|
435
|
+
${toolsList}
|
|
436
|
+
permissions:
|
|
437
|
+
${permsList}
|
|
438
|
+
`;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
async function main(): Promise<void> {
|
|
442
|
+
const agentsDir = path.resolve(__dirname, '../.claude/agents/v3');
|
|
443
|
+
const outputDir = path.resolve(__dirname, '../.opencode/agents');
|
|
444
|
+
|
|
445
|
+
// Ensure output directory exists
|
|
446
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
447
|
+
|
|
448
|
+
// Clear existing generated agents
|
|
449
|
+
for (const existing of fs.readdirSync(outputDir)) {
|
|
450
|
+
if (existing.endsWith('.yaml')) {
|
|
451
|
+
fs.unlinkSync(path.join(outputDir, existing));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const files = fs.readdirSync(agentsDir).filter((f) => f.endsWith('.md'));
|
|
456
|
+
let generated = 0;
|
|
457
|
+
let skipped = 0;
|
|
458
|
+
|
|
459
|
+
for (const file of files) {
|
|
460
|
+
const basename = file.replace(/\.md$/, '');
|
|
461
|
+
if (!isIncluded(basename)) {
|
|
462
|
+
skipped++;
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
const filePath = path.join(agentsDir, file);
|
|
467
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
468
|
+
const frontmatter = parseFrontmatter(content);
|
|
469
|
+
|
|
470
|
+
if (!frontmatter || !frontmatter.name) {
|
|
471
|
+
console.warn(` SKIP (no frontmatter): ${file}`);
|
|
472
|
+
skipped++;
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// Normalize CRLF for consistent parsing
|
|
477
|
+
const normalizedContent = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
478
|
+
const hasXml = normalizedContent.includes('<qe_agent_definition>');
|
|
479
|
+
const agentName = frontmatter.name;
|
|
480
|
+
const description = (frontmatter.description || agentName).slice(0, 300);
|
|
481
|
+
const domain = frontmatter.domain;
|
|
482
|
+
|
|
483
|
+
// Build system prompt based on format
|
|
484
|
+
const systemPrompt = hasXml
|
|
485
|
+
? buildXmlSystemPrompt(agentName, normalizedContent, frontmatter)
|
|
486
|
+
: buildMarkdownSystemPrompt(agentName, normalizedContent, frontmatter);
|
|
487
|
+
|
|
488
|
+
// Map tools from domain and name
|
|
489
|
+
const tools = mapToolsFromDomain(domain, agentName);
|
|
490
|
+
|
|
491
|
+
// Model selection: default to sonnet
|
|
492
|
+
const model = 'claude-sonnet-4-6';
|
|
493
|
+
|
|
494
|
+
const config: AgentConfig = {
|
|
495
|
+
name: agentName,
|
|
496
|
+
description,
|
|
497
|
+
model,
|
|
498
|
+
systemPrompt,
|
|
499
|
+
tools,
|
|
500
|
+
permissions: {
|
|
501
|
+
read: 'allow',
|
|
502
|
+
grep: 'allow',
|
|
503
|
+
glob: 'allow',
|
|
504
|
+
edit: 'ask',
|
|
505
|
+
bash: 'ask',
|
|
506
|
+
'"mcp:agentic-qe:*"': 'allow',
|
|
507
|
+
},
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
const yaml = generateAgentYaml(config);
|
|
511
|
+
const outputPath = path.join(outputDir, `${agentName}.yaml`);
|
|
512
|
+
fs.writeFileSync(outputPath, yaml, 'utf-8');
|
|
513
|
+
generated++;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
console.log(`Agent generation complete: ${generated} generated, ${skipped} skipped`);
|
|
517
|
+
console.log(`Output directory: ${outputDir}`);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
main().catch((err) => {
|
|
521
|
+
console.error('Generation failed:', err);
|
|
522
|
+
process.exit(1);
|
|
523
|
+
});
|