agentic-qe 3.7.19 → 3.7.21

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.
Files changed (77) hide show
  1. package/.claude/agents/v3/qe-deployment-advisor.md +14 -0
  2. package/.claude/agents/v3/qe-gap-detector.md +8 -0
  3. package/.claude/agents/v3/qe-impact-analyzer.md +11 -0
  4. package/.claude/agents/v3/qe-queen-coordinator.md +45 -0
  5. package/.claude/agents/v3/qe-root-cause-analyzer.md +11 -0
  6. package/.claude/agents/v3/qe-security-scanner.md +25 -16
  7. package/.claude/helpers/brain-checkpoint.cjs +3 -3
  8. package/.claude/helpers/statusline-v3.cjs +4 -3
  9. package/.claude/skills/skills-manifest.json +1 -1
  10. package/CHANGELOG.md +27 -0
  11. package/assets/agents/v3/qe-deployment-advisor.md +14 -0
  12. package/assets/agents/v3/qe-gap-detector.md +8 -0
  13. package/assets/agents/v3/qe-impact-analyzer.md +11 -0
  14. package/assets/agents/v3/qe-queen-coordinator.md +45 -0
  15. package/assets/agents/v3/qe-root-cause-analyzer.md +11 -0
  16. package/assets/agents/v3/qe-security-scanner.md +25 -16
  17. package/assets/helpers/statusline-v3.cjs +4 -3
  18. package/dist/adapters/claude-flow/model-router-bridge.d.ts +0 -6
  19. package/dist/adapters/claude-flow/model-router-bridge.js +4 -17
  20. package/dist/adapters/claude-flow/pretrain-bridge.d.ts +0 -6
  21. package/dist/adapters/claude-flow/pretrain-bridge.js +6 -19
  22. package/dist/adapters/claude-flow/trajectory-bridge.d.ts +0 -6
  23. package/dist/adapters/claude-flow/trajectory-bridge.js +21 -23
  24. package/dist/cli/bundle.js +1821 -986
  25. package/dist/coordination/protocols/security-audit.d.ts +3 -6
  26. package/dist/coordination/protocols/security-audit.js +8 -88
  27. package/dist/coordination/queen-coordinator.d.ts +13 -0
  28. package/dist/coordination/queen-coordinator.js +76 -0
  29. package/dist/coordination/queen-task-management.d.ts +2 -0
  30. package/dist/coordination/queen-task-management.js +10 -0
  31. package/dist/coordination/queen-types.d.ts +3 -0
  32. package/dist/coordination/task-executor.js +7 -5
  33. package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +25 -1
  34. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +140 -11
  35. package/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +2 -0
  36. package/dist/domains/security-compliance/services/scanners/scanner-types.js +1 -0
  37. package/dist/domains/test-execution/services/mincut-test-optimizer.js +2 -0
  38. package/dist/governance/continue-gate-integration.js +1 -1
  39. package/dist/governance/feature-flags.js +2 -2
  40. package/dist/init/agents-installer.d.ts +2 -0
  41. package/dist/init/agents-installer.js +13 -0
  42. package/dist/init/enhancements/claude-flow-adapter.js +51 -24
  43. package/dist/init/init-wizard.js +1 -1
  44. package/dist/init/phases/07-hooks.js +6 -6
  45. package/dist/init/settings-merge.js +2 -0
  46. package/dist/integrations/ruvector/brain-rvf-exporter.js +14 -2
  47. package/dist/learning/experience-capture-middleware.js +3 -1
  48. package/dist/learning/qe-reasoning-bank.js +3 -3
  49. package/dist/learning/sqlite-persistence.js +16 -0
  50. package/dist/learning/token-tracker.js +4 -2
  51. package/dist/mcp/bundle.js +1183 -504
  52. package/dist/routing/agent-dependency-graph.d.ts +77 -0
  53. package/dist/routing/agent-dependency-graph.js +359 -0
  54. package/dist/routing/co-execution-repository.d.ts +68 -0
  55. package/dist/routing/co-execution-repository.js +184 -0
  56. package/dist/routing/index.d.ts +6 -0
  57. package/dist/routing/index.js +6 -0
  58. package/dist/routing/qe-task-router.d.ts +7 -0
  59. package/dist/routing/qe-task-router.js +63 -1
  60. package/dist/routing/signal-merger.d.ts +81 -0
  61. package/dist/routing/signal-merger.js +136 -0
  62. package/dist/routing/types.d.ts +1 -0
  63. package/dist/shared/llm/providers/azure-openai.js +3 -2
  64. package/dist/shared/llm/providers/bedrock.js +3 -2
  65. package/dist/shared/llm/providers/claude.js +3 -2
  66. package/dist/shared/llm/providers/gemini.js +3 -2
  67. package/dist/shared/llm/providers/openai.js +3 -2
  68. package/dist/shared/llm/providers/openrouter.js +3 -2
  69. package/dist/shared/llm/retry.d.ts +10 -0
  70. package/dist/shared/llm/retry.js +16 -0
  71. package/dist/shared/llm/router/agent-router-config.d.ts +2 -1
  72. package/dist/shared/llm/router/agent-router-config.js +38 -88
  73. package/dist/validation/index.d.ts +2 -0
  74. package/dist/validation/index.js +4 -0
  75. package/dist/validation/steps/agent-mcp-validator.d.ts +88 -0
  76. package/dist/validation/steps/agent-mcp-validator.js +254 -0
  77. package/package.json +1 -1
@@ -49,8 +49,8 @@ export class PretrainBridge {
49
49
  }
50
50
  if (this.claudeFlowAvailable) {
51
51
  try {
52
- const { execSync } = await import('child_process');
53
- const result = execSync(`npx --no-install @claude-flow/cli hooks pretrain --path ${this.escapeArg(targetPath)} --depth ${depth}`, { encoding: 'utf-8', timeout: 120000, cwd: this.options.projectRoot });
52
+ const { execFileSync } = await import('child_process');
53
+ const result = execFileSync('npx', ['--no-install', '@claude-flow/cli', 'hooks', 'pretrain', '--path', targetPath, '--depth', depth], { encoding: 'utf-8', timeout: 120000, cwd: this.options.projectRoot });
54
54
  // Try to parse JSON result
55
55
  try {
56
56
  const parsed = safeJsonParse(result);
@@ -87,8 +87,8 @@ export class PretrainBridge {
87
87
  async generateAgentConfigs(format = 'yaml') {
88
88
  if (this.claudeFlowAvailable) {
89
89
  try {
90
- const { execSync } = await import('child_process');
91
- const result = execSync(`npx --no-install @claude-flow/cli hooks build-agents --format ${format}`, { encoding: 'utf-8', timeout: 60000, cwd: this.options.projectRoot });
90
+ const { execFileSync } = await import('child_process');
91
+ const result = execFileSync('npx', ['--no-install', '@claude-flow/cli', 'hooks', 'build-agents', '--format', format], { encoding: 'utf-8', timeout: 60000, cwd: this.options.projectRoot });
92
92
  try {
93
93
  return safeJsonParse(result);
94
94
  }
@@ -111,8 +111,8 @@ export class PretrainBridge {
111
111
  async transferPatterns(sourcePath, minConfidence = 0.7) {
112
112
  if (this.claudeFlowAvailable) {
113
113
  try {
114
- const { execSync } = await import('child_process');
115
- const result = execSync(`npx --no-install @claude-flow/cli hooks transfer --source-path ${this.escapeArg(sourcePath)} --min-confidence ${minConfidence}`, { encoding: 'utf-8', timeout: 60000, cwd: this.options.projectRoot });
114
+ const { execFileSync } = await import('child_process');
115
+ const result = execFileSync('npx', ['--no-install', '@claude-flow/cli', 'hooks', 'transfer', '--source-path', sourcePath, '--min-confidence', String(minConfidence)], { encoding: 'utf-8', timeout: 60000, cwd: this.options.projectRoot });
116
116
  const transferredMatch = result.match(/transferred[:\s]+(\d+)/i);
117
117
  const skippedMatch = result.match(/skipped[:\s]+(\d+)/i);
118
118
  return {
@@ -133,19 +133,6 @@ export class PretrainBridge {
133
133
  isClaudeFlowAvailable() {
134
134
  return this.claudeFlowAvailable;
135
135
  }
136
- /**
137
- * Escape shell argument using $'...' syntax for complete safety
138
- * This ANSI-C quoting handles ALL special characters including backslashes
139
- * CodeQL: js/incomplete-sanitization - Fixed by escaping backslashes AND quotes
140
- */
141
- escapeArg(arg) {
142
- // Escape backslashes first, then single quotes, using ANSI-C quoting
143
- // $'...' syntax interprets escape sequences like \\ and \'
144
- const escaped = arg
145
- .replace(/\\/g, '\\\\') // Escape backslashes first
146
- .replace(/'/g, "\\'"); // Then escape single quotes
147
- return "$'" + escaped + "'";
148
- }
149
136
  /**
150
137
  * Local analysis using file system scanning
151
138
  */
@@ -54,12 +54,6 @@ export declare class TrajectoryBridge {
54
54
  * Persist trajectory to local SQLite
55
55
  */
56
56
  private persistTrajectory;
57
- /**
58
- * Escape shell argument using $'...' syntax for complete safety
59
- * This ANSI-C quoting handles ALL special characters including backslashes
60
- * CodeQL: js/incomplete-sanitization - Fixed by escaping backslashes AND quotes
61
- */
62
- private escapeArg;
63
57
  }
64
58
  /**
65
59
  * Create trajectory bridge
@@ -29,9 +29,12 @@ export class TrajectoryBridge {
29
29
  const id = `trajectory-${randomUUID()}`;
30
30
  if (this.claudeFlowAvailable) {
31
31
  try {
32
- const { execSync } = await import('child_process');
33
- const agentArg = agent ? `--agent ${this.escapeArg(agent)}` : '';
34
- const result = execSync(`npx --no-install @claude-flow/cli hooks intelligence trajectory-start --task ${this.escapeArg(task)} ${agentArg}`, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
32
+ const { execFileSync } = await import('child_process');
33
+ const args = ['--no-install', '@claude-flow/cli', 'hooks', 'intelligence', 'trajectory-start', '--task', task];
34
+ if (agent) {
35
+ args.push('--agent', agent);
36
+ }
37
+ const result = execFileSync('npx', args, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
35
38
  // Parse trajectory ID from result
36
39
  const match = result.match(/trajectoryId[:\s]+["']?([^"'\s,}]+)/i);
37
40
  if (match?.[1]) {
@@ -59,10 +62,15 @@ export class TrajectoryBridge {
59
62
  async recordStep(trajectoryId, action, result, quality) {
60
63
  if (this.claudeFlowAvailable) {
61
64
  try {
62
- const { execSync } = await import('child_process');
63
- const resultArg = result ? `--result ${this.escapeArg(result)}` : '';
64
- const qualityArg = quality !== undefined ? `--quality ${quality}` : '';
65
- execSync(`npx --no-install @claude-flow/cli hooks intelligence trajectory-step --trajectory-id ${this.escapeArg(trajectoryId)} --action ${this.escapeArg(action)} ${resultArg} ${qualityArg}`, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
65
+ const { execFileSync } = await import('child_process');
66
+ const args = ['--no-install', '@claude-flow/cli', 'hooks', 'intelligence', 'trajectory-step', '--trajectory-id', trajectoryId, '--action', action];
67
+ if (result) {
68
+ args.push('--result', result);
69
+ }
70
+ if (quality !== undefined) {
71
+ args.push('--quality', String(quality));
72
+ }
73
+ execFileSync('npx', args, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
66
74
  return;
67
75
  }
68
76
  catch (error) {
@@ -88,9 +96,12 @@ export class TrajectoryBridge {
88
96
  async endTrajectory(trajectoryId, success, feedback) {
89
97
  if (this.claudeFlowAvailable) {
90
98
  try {
91
- const { execSync } = await import('child_process');
92
- const feedbackArg = feedback ? `--feedback ${this.escapeArg(feedback)}` : '';
93
- execSync(`npx --no-install @claude-flow/cli hooks intelligence trajectory-end --trajectory-id ${this.escapeArg(trajectoryId)} --success ${success} ${feedbackArg}`, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
99
+ const { execFileSync } = await import('child_process');
100
+ const args = ['--no-install', '@claude-flow/cli', 'hooks', 'intelligence', 'trajectory-end', '--trajectory-id', trajectoryId, '--success', String(success)];
101
+ if (feedback) {
102
+ args.push('--feedback', feedback);
103
+ }
104
+ execFileSync('npx', args, { encoding: 'utf-8', timeout: 10000, cwd: this.options.projectRoot });
94
105
  }
95
106
  catch {
96
107
  // Continue to return local trajectory
@@ -163,19 +174,6 @@ export class TrajectoryBridge {
163
174
  console.debug('[TrajectoryBridge] Trajectory persistence failed:', error instanceof Error ? error.message : error);
164
175
  }
165
176
  }
166
- /**
167
- * Escape shell argument using $'...' syntax for complete safety
168
- * This ANSI-C quoting handles ALL special characters including backslashes
169
- * CodeQL: js/incomplete-sanitization - Fixed by escaping backslashes AND quotes
170
- */
171
- escapeArg(arg) {
172
- // Escape backslashes first, then single quotes, using ANSI-C quoting
173
- // $'...' syntax interprets escape sequences like \\ and \'
174
- const escaped = arg
175
- .replace(/\\/g, '\\\\') // Escape backslashes first
176
- .replace(/'/g, "\\'"); // Then escape single quotes
177
- return "$'" + escaped + "'";
178
- }
179
177
  }
180
178
  /**
181
179
  * Create trajectory bridge