agentic-qe 3.5.2 → 3.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/v3/dist/cli/bundle.js +204 -173
- package/v3/dist/init/init-wizard.js +2 -2
- package/v3/dist/init/init-wizard.js.map +1 -1
- package/v3/dist/init/migration/config-migrator.d.ts.map +1 -1
- package/v3/dist/init/migration/config-migrator.js +2 -1
- package/v3/dist/init/migration/config-migrator.js.map +1 -1
- package/v3/dist/init/phases/04-database.d.ts.map +1 -1
- package/v3/dist/init/phases/04-database.js +2 -1
- package/v3/dist/init/phases/04-database.js.map +1 -1
- package/v3/dist/init/phases/05-learning.d.ts.map +1 -1
- package/v3/dist/init/phases/05-learning.js +2 -1
- package/v3/dist/init/phases/05-learning.js.map +1 -1
- package/v3/dist/init/phases/09-assets.d.ts +5 -0
- package/v3/dist/init/phases/09-assets.d.ts.map +1 -1
- package/v3/dist/init/phases/09-assets.js +31 -2
- package/v3/dist/init/phases/09-assets.js.map +1 -1
- package/v3/dist/init/phases/10-workers.d.ts.map +1 -1
- package/v3/dist/init/phases/10-workers.js +5 -2
- package/v3/dist/init/phases/10-workers.js.map +1 -1
- package/v3/dist/init/phases/12-verification.d.ts.map +1 -1
- package/v3/dist/init/phases/12-verification.js +7 -2
- package/v3/dist/init/phases/12-verification.js.map +1 -1
- package/v3/dist/init/self-configurator.d.ts.map +1 -1
- package/v3/dist/init/self-configurator.js +2 -2
- package/v3/dist/init/self-configurator.js.map +1 -1
- package/v3/dist/init/types.d.ts +4 -0
- package/v3/dist/init/types.d.ts.map +1 -1
- package/v3/dist/init/types.js +7 -1
- package/v3/dist/init/types.js.map +1 -1
- package/v3/package.json +1 -1
package/v3/dist/cli/bundle.js
CHANGED
|
@@ -101742,9 +101742,12 @@ var ALL_DOMAINS2 = [
|
|
|
101742
101742
|
"chaos-resilience",
|
|
101743
101743
|
"learning-optimization"
|
|
101744
101744
|
];
|
|
101745
|
+
function getAQEVersion() {
|
|
101746
|
+
return true ? "3.5.4" : "3.0.0";
|
|
101747
|
+
}
|
|
101745
101748
|
function createDefaultConfig(projectName, projectRoot) {
|
|
101746
101749
|
return {
|
|
101747
|
-
version:
|
|
101750
|
+
version: getAQEVersion(),
|
|
101748
101751
|
project: {
|
|
101749
101752
|
name: projectName,
|
|
101750
101753
|
root: projectRoot,
|
|
@@ -102478,7 +102481,7 @@ var SelfConfigurator = class {
|
|
|
102478
102481
|
*/
|
|
102479
102482
|
recommend(analysis) {
|
|
102480
102483
|
const config = {
|
|
102481
|
-
version:
|
|
102484
|
+
version: getAQEVersion(),
|
|
102482
102485
|
project: {
|
|
102483
102486
|
name: analysis.projectName,
|
|
102484
102487
|
root: analysis.projectRoot,
|
|
@@ -104352,7 +104355,7 @@ var InitOrchestrator = class {
|
|
|
104352
104355
|
const improvementConfig = this.readJsonSafe(join20(v2ConfigDir, "improvement.json"));
|
|
104353
104356
|
const codeIntelConfig = this.readJsonSafe(join20(v2ConfigDir, "code-intelligence.json"));
|
|
104354
104357
|
const v3Config = {
|
|
104355
|
-
version:
|
|
104358
|
+
version: getAQEVersion(),
|
|
104356
104359
|
migratedFrom: v2Detection.version || "2.x.x",
|
|
104357
104360
|
migratedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
104358
104361
|
project: {
|
|
@@ -105810,7 +105813,7 @@ var DatabasePhase = class extends BasePhase {
|
|
|
105810
105813
|
await unifiedMemory.kvSet("_init_marker", {
|
|
105811
105814
|
initialized: (/* @__PURE__ */ new Date()).toISOString(),
|
|
105812
105815
|
projectRoot,
|
|
105813
|
-
version:
|
|
105816
|
+
version: getAQEVersion()
|
|
105814
105817
|
}, "_system");
|
|
105815
105818
|
const db = unifiedMemory.getDatabase();
|
|
105816
105819
|
const versionRow = db.prepare("SELECT version FROM schema_version WHERE id = 1").get();
|
|
@@ -105904,7 +105907,7 @@ var LearningPhase = class extends BasePhase {
|
|
|
105904
105907
|
const indexPath = join23(patternsDir, "index.json");
|
|
105905
105908
|
if (!existsSync21(indexPath)) {
|
|
105906
105909
|
writeFileSync6(indexPath, JSON.stringify({
|
|
105907
|
-
version:
|
|
105910
|
+
version: getAQEVersion(),
|
|
105908
105911
|
domains: [],
|
|
105909
105912
|
loadedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
105910
105913
|
}, null, 2), "utf-8");
|
|
@@ -106315,6 +106318,8 @@ var MCPPhase = class extends BasePhase {
|
|
|
106315
106318
|
};
|
|
106316
106319
|
|
|
106317
106320
|
// src/init/phases/09-assets.ts
|
|
106321
|
+
import { existsSync as existsSync25, readFileSync as readFileSync18 } from "fs";
|
|
106322
|
+
import { join as join27 } from "path";
|
|
106318
106323
|
var AssetsPhase = class extends BasePhase {
|
|
106319
106324
|
name = "assets";
|
|
106320
106325
|
description = "Install skills and agents";
|
|
@@ -106324,13 +106329,16 @@ var AssetsPhase = class extends BasePhase {
|
|
|
106324
106329
|
async run(context2) {
|
|
106325
106330
|
const config = context2.config;
|
|
106326
106331
|
const { projectRoot, options } = context2;
|
|
106327
|
-
const
|
|
106332
|
+
const isVersionUpgrade = this.detectVersionUpgrade(context2);
|
|
106333
|
+
const shouldOverwrite = options.upgrade || config.skills.overwrite || options.autoMode && isVersionUpgrade;
|
|
106328
106334
|
let skillsInstalled = 0;
|
|
106329
106335
|
let agentsInstalled = 0;
|
|
106330
106336
|
let n8nAgents = 0;
|
|
106331
106337
|
let n8nSkills = 0;
|
|
106332
106338
|
if (options.upgrade) {
|
|
106333
106339
|
context2.services.log(` Upgrade mode: overwriting existing files`);
|
|
106340
|
+
} else if (options.autoMode && isVersionUpgrade) {
|
|
106341
|
+
context2.services.log(` Version upgrade detected: updating skills and agents`);
|
|
106334
106342
|
}
|
|
106335
106343
|
if (config.skills.install) {
|
|
106336
106344
|
const skillsInstaller = createSkillsInstaller({
|
|
@@ -106384,11 +106392,30 @@ var AssetsPhase = class extends BasePhase {
|
|
|
106384
106392
|
n8nSkills
|
|
106385
106393
|
};
|
|
106386
106394
|
}
|
|
106395
|
+
/**
|
|
106396
|
+
* Detect if this is a version upgrade by comparing existing config version
|
|
106397
|
+
* with the new version being installed
|
|
106398
|
+
*/
|
|
106399
|
+
detectVersionUpgrade(context2) {
|
|
106400
|
+
const configPath = join27(context2.projectRoot, ".agentic-qe", "config.yaml");
|
|
106401
|
+
if (!existsSync25(configPath)) {
|
|
106402
|
+
return false;
|
|
106403
|
+
}
|
|
106404
|
+
try {
|
|
106405
|
+
const content = readFileSync18(configPath, "utf-8");
|
|
106406
|
+
const versionMatch = content.match(/version:\s*"?([^"\n]+)"?/);
|
|
106407
|
+
const existingVersion = versionMatch?.[1];
|
|
106408
|
+
const newVersion = context2.config.version;
|
|
106409
|
+
return existingVersion !== void 0 && existingVersion !== newVersion;
|
|
106410
|
+
} catch {
|
|
106411
|
+
return false;
|
|
106412
|
+
}
|
|
106413
|
+
}
|
|
106387
106414
|
};
|
|
106388
106415
|
|
|
106389
106416
|
// src/init/phases/10-workers.ts
|
|
106390
|
-
import { existsSync as
|
|
106391
|
-
import { join as
|
|
106417
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync13, writeFileSync as writeFileSync9, readFileSync as readFileSync19 } from "fs";
|
|
106418
|
+
import { join as join28 } from "path";
|
|
106392
106419
|
import { spawn as spawn5 } from "child_process";
|
|
106393
106420
|
var WorkersPhase = class extends BasePhase {
|
|
106394
106421
|
name = "workers";
|
|
@@ -106412,8 +106439,8 @@ var WorkersPhase = class extends BasePhase {
|
|
|
106412
106439
|
daemonPid: null
|
|
106413
106440
|
};
|
|
106414
106441
|
}
|
|
106415
|
-
const workersDir =
|
|
106416
|
-
if (!
|
|
106442
|
+
const workersDir = join28(projectRoot, ".agentic-qe", "workers");
|
|
106443
|
+
if (!existsSync26(workersDir)) {
|
|
106417
106444
|
mkdirSync13(workersDir, { recursive: true });
|
|
106418
106445
|
}
|
|
106419
106446
|
const defaultIntervals = {
|
|
@@ -106464,7 +106491,7 @@ var WorkersPhase = class extends BasePhase {
|
|
|
106464
106491
|
status: "pending"
|
|
106465
106492
|
};
|
|
106466
106493
|
}
|
|
106467
|
-
const registryPath =
|
|
106494
|
+
const registryPath = join28(workersDir, "registry.json");
|
|
106468
106495
|
const registryData = {
|
|
106469
106496
|
version: config.version,
|
|
106470
106497
|
maxConcurrent: config.workers.maxConcurrent,
|
|
@@ -106474,18 +106501,18 @@ var WorkersPhase = class extends BasePhase {
|
|
|
106474
106501
|
};
|
|
106475
106502
|
writeFileSync9(registryPath, JSON.stringify(registryData, null, 2), "utf-8");
|
|
106476
106503
|
for (const workerName of config.workers.enabled) {
|
|
106477
|
-
const workerConfigPath =
|
|
106504
|
+
const workerConfigPath = join28(workersDir, `${workerName}.json`);
|
|
106478
106505
|
const workerConfig = {
|
|
106479
106506
|
name: workerName,
|
|
106480
106507
|
enabled: true,
|
|
106481
106508
|
interval: config.workers.intervals[workerName] || defaultIntervals[workerName] || 6e4,
|
|
106482
106509
|
projectRoot,
|
|
106483
|
-
dataDir:
|
|
106510
|
+
dataDir: join28(projectRoot, ".agentic-qe", "data"),
|
|
106484
106511
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
106485
106512
|
};
|
|
106486
106513
|
writeFileSync9(workerConfigPath, JSON.stringify(workerConfig, null, 2), "utf-8");
|
|
106487
106514
|
}
|
|
106488
|
-
const daemonScriptPath =
|
|
106515
|
+
const daemonScriptPath = join28(workersDir, "start-daemon.sh");
|
|
106489
106516
|
const daemonScript = `#!/bin/bash
|
|
106490
106517
|
# AQE v3 Worker Daemon Startup Script
|
|
106491
106518
|
# Generated by aqe init
|
|
@@ -106553,7 +106580,7 @@ echo "To stop: kill $DAEMON_PID"
|
|
|
106553
106580
|
echo "To view logs: tail -f $LOG_FILE"
|
|
106554
106581
|
`;
|
|
106555
106582
|
writeFileSync9(daemonScriptPath, daemonScript, { mode: 493 });
|
|
106556
|
-
const stopScriptPath =
|
|
106583
|
+
const stopScriptPath = join28(workersDir, "stop-daemon.sh");
|
|
106557
106584
|
const stopScript = `#!/bin/bash
|
|
106558
106585
|
# AQE v3 Worker Daemon Stop Script
|
|
106559
106586
|
# Generated by aqe init
|
|
@@ -106595,11 +106622,12 @@ fi
|
|
|
106595
106622
|
if (daemonStarted) {
|
|
106596
106623
|
context2.services.log(` MCP daemon started (PID: ${daemonPid})`);
|
|
106597
106624
|
} else if (daemonError) {
|
|
106598
|
-
context2.services.log(` MCP daemon
|
|
106625
|
+
context2.services.log(` MCP daemon: skipped (will start via Claude Code)`);
|
|
106626
|
+
context2.services.log(` Note: ${daemonError}`);
|
|
106599
106627
|
}
|
|
106600
106628
|
} catch (error) {
|
|
106601
106629
|
daemonError = error instanceof Error ? error.message : "Unknown error";
|
|
106602
|
-
context2.services.log(` MCP daemon
|
|
106630
|
+
context2.services.log(` MCP daemon: skipped (Claude Code will start it)`);
|
|
106603
106631
|
}
|
|
106604
106632
|
}
|
|
106605
106633
|
return {
|
|
@@ -106615,11 +106643,11 @@ fi
|
|
|
106615
106643
|
* Start the MCP daemon in the background
|
|
106616
106644
|
*/
|
|
106617
106645
|
async startDaemon(workersDir, projectRoot, context2) {
|
|
106618
|
-
const pidFile =
|
|
106619
|
-
const logFile =
|
|
106620
|
-
if (
|
|
106646
|
+
const pidFile = join28(workersDir, "daemon.pid");
|
|
106647
|
+
const logFile = join28(workersDir, "daemon.log");
|
|
106648
|
+
if (existsSync26(pidFile)) {
|
|
106621
106649
|
try {
|
|
106622
|
-
const existingPid = parseInt(
|
|
106650
|
+
const existingPid = parseInt(readFileSync19(pidFile, "utf-8").trim(), 10);
|
|
106623
106651
|
process.kill(existingPid, 0);
|
|
106624
106652
|
return { started: true, pid: existingPid, error: "Already running" };
|
|
106625
106653
|
} catch {
|
|
@@ -106708,16 +106736,16 @@ fi
|
|
|
106708
106736
|
* 4. npx fallback (uses aqe mcp subcommand)
|
|
106709
106737
|
*/
|
|
106710
106738
|
async findMcpCommand(projectRoot) {
|
|
106711
|
-
const localMcpBin =
|
|
106712
|
-
if (
|
|
106739
|
+
const localMcpBin = join28(projectRoot, "node_modules", ".bin", "aqe-mcp");
|
|
106740
|
+
if (existsSync26(localMcpBin)) {
|
|
106713
106741
|
return { command: localMcpBin, args: [] };
|
|
106714
106742
|
}
|
|
106715
|
-
const localBundle =
|
|
106716
|
-
if (
|
|
106743
|
+
const localBundle = join28(projectRoot, "node_modules", "agentic-qe", "v3", "dist", "mcp", "bundle.js");
|
|
106744
|
+
if (existsSync26(localBundle)) {
|
|
106717
106745
|
return { command: "node", args: [localBundle] };
|
|
106718
106746
|
}
|
|
106719
|
-
const localAqeBin =
|
|
106720
|
-
if (
|
|
106747
|
+
const localAqeBin = join28(projectRoot, "node_modules", ".bin", "aqe");
|
|
106748
|
+
if (existsSync26(localAqeBin)) {
|
|
106721
106749
|
return { command: localAqeBin, args: ["mcp"] };
|
|
106722
106750
|
}
|
|
106723
106751
|
return { command: "npx", args: ["--yes", "agentic-qe", "mcp"] };
|
|
@@ -106725,8 +106753,8 @@ fi
|
|
|
106725
106753
|
};
|
|
106726
106754
|
|
|
106727
106755
|
// src/init/phases/11-claude-md.ts
|
|
106728
|
-
import { existsSync as
|
|
106729
|
-
import { join as
|
|
106756
|
+
import { existsSync as existsSync27, readFileSync as readFileSync20, writeFileSync as writeFileSync10 } from "fs";
|
|
106757
|
+
import { join as join29 } from "path";
|
|
106730
106758
|
var ClaudeMdPhase = class extends BasePhase {
|
|
106731
106759
|
name = "claude-md";
|
|
106732
106760
|
description = "Generate CLAUDE.md";
|
|
@@ -106736,16 +106764,16 @@ var ClaudeMdPhase = class extends BasePhase {
|
|
|
106736
106764
|
async run(context2) {
|
|
106737
106765
|
const config = context2.config;
|
|
106738
106766
|
const { projectRoot } = context2;
|
|
106739
|
-
const claudeMdPath =
|
|
106767
|
+
const claudeMdPath = join29(projectRoot, "CLAUDE.md");
|
|
106740
106768
|
const content = this.generateContent(config);
|
|
106741
106769
|
let backupCreated = false;
|
|
106742
|
-
if (
|
|
106743
|
-
const existing =
|
|
106770
|
+
if (existsSync27(claudeMdPath)) {
|
|
106771
|
+
const existing = readFileSync20(claudeMdPath, "utf-8");
|
|
106744
106772
|
if (existing.includes("## Agentic QE v3")) {
|
|
106745
106773
|
context2.services.log(" CLAUDE.md already has AQE section");
|
|
106746
106774
|
return { generated: false, path: claudeMdPath, backupCreated: false };
|
|
106747
106775
|
}
|
|
106748
|
-
const backupPath =
|
|
106776
|
+
const backupPath = join29(projectRoot, "CLAUDE.md.backup");
|
|
106749
106777
|
writeFileSync10(backupPath, existing, "utf-8");
|
|
106750
106778
|
backupCreated = true;
|
|
106751
106779
|
writeFileSync10(claudeMdPath, existing + "\n\n" + content, "utf-8");
|
|
@@ -106857,8 +106885,8 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
|
|
|
106857
106885
|
};
|
|
106858
106886
|
|
|
106859
106887
|
// src/init/phases/12-verification.ts
|
|
106860
|
-
import { existsSync as
|
|
106861
|
-
import { join as
|
|
106888
|
+
import { existsSync as existsSync28, readFileSync as readFileSync21 } from "fs";
|
|
106889
|
+
import { join as join30, dirname as dirname9 } from "path";
|
|
106862
106890
|
import { mkdirSync as mkdirSync14, writeFileSync as writeFileSync11 } from "fs";
|
|
106863
106891
|
import { createRequire as createRequire3 } from "module";
|
|
106864
106892
|
var require4 = createRequire3(import.meta.url);
|
|
@@ -106872,20 +106900,20 @@ var VerificationPhase = class extends BasePhase {
|
|
|
106872
106900
|
const config = context2.config;
|
|
106873
106901
|
const { projectRoot } = context2;
|
|
106874
106902
|
const checks = [];
|
|
106875
|
-
const dbPath =
|
|
106903
|
+
const dbPath = join30(projectRoot, ".agentic-qe", "memory.db");
|
|
106876
106904
|
checks.push({
|
|
106877
106905
|
name: "Database exists",
|
|
106878
|
-
passed:
|
|
106906
|
+
passed: existsSync28(dbPath)
|
|
106879
106907
|
});
|
|
106880
106908
|
checks.push({
|
|
106881
106909
|
name: ".agentic-qe directory",
|
|
106882
|
-
passed:
|
|
106910
|
+
passed: existsSync28(join30(projectRoot, ".agentic-qe"))
|
|
106883
106911
|
});
|
|
106884
|
-
const configPath =
|
|
106912
|
+
const configPath = join30(projectRoot, ".agentic-qe", "config.yaml");
|
|
106885
106913
|
await this.saveConfig(config, projectRoot);
|
|
106886
106914
|
checks.push({
|
|
106887
106915
|
name: "Config saved",
|
|
106888
|
-
passed:
|
|
106916
|
+
passed: existsSync28(configPath)
|
|
106889
106917
|
});
|
|
106890
106918
|
const versionWritten = await this.writeVersionToDb(config.version, projectRoot);
|
|
106891
106919
|
checks.push({
|
|
@@ -106896,12 +106924,15 @@ var VerificationPhase = class extends BasePhase {
|
|
|
106896
106924
|
const allCriticalPassed = checks.filter((c2) => criticalChecks.includes(c2.name)).every((c2) => c2.passed);
|
|
106897
106925
|
context2.services.log(" Verification checks:");
|
|
106898
106926
|
for (const check of checks) {
|
|
106899
|
-
|
|
106927
|
+
const isCritical = criticalChecks.includes(check.name);
|
|
106928
|
+
const icon = check.passed ? "\u2713" : isCritical ? "\u2717" : "\u26A0";
|
|
106929
|
+
const suffix = !isCritical && !check.passed ? " (optional)" : "";
|
|
106930
|
+
context2.services.log(` ${icon} ${check.name}${suffix}`);
|
|
106900
106931
|
}
|
|
106901
106932
|
return {
|
|
106902
106933
|
verified: allCriticalPassed,
|
|
106903
106934
|
versionWritten,
|
|
106904
|
-
configSaved:
|
|
106935
|
+
configSaved: existsSync28(configPath),
|
|
106905
106936
|
checks
|
|
106906
106937
|
};
|
|
106907
106938
|
}
|
|
@@ -106909,10 +106940,10 @@ var VerificationPhase = class extends BasePhase {
|
|
|
106909
106940
|
* Write AQE version to memory.db
|
|
106910
106941
|
*/
|
|
106911
106942
|
async writeVersionToDb(version, projectRoot) {
|
|
106912
|
-
const memoryDbPath =
|
|
106943
|
+
const memoryDbPath = join30(projectRoot, ".agentic-qe", "memory.db");
|
|
106913
106944
|
try {
|
|
106914
106945
|
const dir = dirname9(memoryDbPath);
|
|
106915
|
-
if (!
|
|
106946
|
+
if (!existsSync28(dir)) {
|
|
106916
106947
|
mkdirSync14(dir, { recursive: true });
|
|
106917
106948
|
}
|
|
106918
106949
|
const Database8 = require4("better-sqlite3");
|
|
@@ -106952,12 +106983,12 @@ var VerificationPhase = class extends BasePhase {
|
|
|
106952
106983
|
* Preserves user customizations from existing config (Issue #206)
|
|
106953
106984
|
*/
|
|
106954
106985
|
async saveConfig(config, projectRoot) {
|
|
106955
|
-
const configDir =
|
|
106956
|
-
if (!
|
|
106986
|
+
const configDir = join30(projectRoot, ".agentic-qe");
|
|
106987
|
+
if (!existsSync28(configDir)) {
|
|
106957
106988
|
mkdirSync14(configDir, { recursive: true });
|
|
106958
106989
|
}
|
|
106959
|
-
const configPath =
|
|
106960
|
-
if (
|
|
106990
|
+
const configPath = join30(configDir, "config.yaml");
|
|
106991
|
+
if (existsSync28(configPath)) {
|
|
106961
106992
|
const existingConfig = this.loadExistingConfig(configPath);
|
|
106962
106993
|
if (existingConfig) {
|
|
106963
106994
|
config = this.mergeConfigs(config, existingConfig);
|
|
@@ -106972,7 +107003,7 @@ var VerificationPhase = class extends BasePhase {
|
|
|
106972
107003
|
*/
|
|
106973
107004
|
loadExistingConfig(configPath) {
|
|
106974
107005
|
try {
|
|
106975
|
-
const content =
|
|
107006
|
+
const content = readFileSync21(configPath, "utf-8");
|
|
106976
107007
|
return this.parseYAML(content);
|
|
106977
107008
|
} catch {
|
|
106978
107009
|
return null;
|
|
@@ -107180,18 +107211,18 @@ var VerificationPhase = class extends BasePhase {
|
|
|
107180
107211
|
};
|
|
107181
107212
|
|
|
107182
107213
|
// src/init/governance-installer.ts
|
|
107183
|
-
import { existsSync as
|
|
107184
|
-
import { join as
|
|
107214
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync15, readdirSync as readdirSync9, copyFileSync as copyFileSync6 } from "fs";
|
|
107215
|
+
import { join as join31, dirname as dirname10 } from "path";
|
|
107185
107216
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
107186
107217
|
var __filename3 = fileURLToPath4(import.meta.url);
|
|
107187
107218
|
var __dirname3 = dirname10(__filename3);
|
|
107188
107219
|
function getGovernanceAssetsPath() {
|
|
107189
|
-
const devPath =
|
|
107190
|
-
const prodPath =
|
|
107191
|
-
if (
|
|
107192
|
-
if (
|
|
107193
|
-
const fallbackPath =
|
|
107194
|
-
if (
|
|
107220
|
+
const devPath = join31(__dirname3, "../../assets/governance");
|
|
107221
|
+
const prodPath = join31(__dirname3, "../assets/governance");
|
|
107222
|
+
if (existsSync29(devPath)) return devPath;
|
|
107223
|
+
if (existsSync29(prodPath)) return prodPath;
|
|
107224
|
+
const fallbackPath = join31(process.cwd(), "v3/assets/governance");
|
|
107225
|
+
if (existsSync29(fallbackPath)) return fallbackPath;
|
|
107195
107226
|
throw new Error("Governance assets not found. Package may be corrupted.");
|
|
107196
107227
|
}
|
|
107197
107228
|
var GovernanceInstaller = class {
|
|
@@ -107212,8 +107243,8 @@ var GovernanceInstaller = class {
|
|
|
107212
107243
|
const installed = [];
|
|
107213
107244
|
const skipped = [];
|
|
107214
107245
|
const errors = [];
|
|
107215
|
-
const governanceDir =
|
|
107216
|
-
const shardsDir =
|
|
107246
|
+
const governanceDir = join31(this.projectRoot, ".claude", "guidance");
|
|
107247
|
+
const shardsDir = join31(governanceDir, "shards");
|
|
107217
107248
|
try {
|
|
107218
107249
|
mkdirSync15(governanceDir, { recursive: true });
|
|
107219
107250
|
if (!this.skipShards) {
|
|
@@ -107231,11 +107262,11 @@ var GovernanceInstaller = class {
|
|
|
107231
107262
|
};
|
|
107232
107263
|
}
|
|
107233
107264
|
let constitutionInstalled = false;
|
|
107234
|
-
const constitutionSrc =
|
|
107235
|
-
const constitutionDest =
|
|
107236
|
-
if (
|
|
107265
|
+
const constitutionSrc = join31(this.assetsPath, "constitution.md");
|
|
107266
|
+
const constitutionDest = join31(governanceDir, "constitution.md");
|
|
107267
|
+
if (existsSync29(constitutionSrc)) {
|
|
107237
107268
|
try {
|
|
107238
|
-
if (!
|
|
107269
|
+
if (!existsSync29(constitutionDest) || this.overwrite) {
|
|
107239
107270
|
copyFileSync6(constitutionSrc, constitutionDest);
|
|
107240
107271
|
installed.push("constitution.md");
|
|
107241
107272
|
constitutionInstalled = true;
|
|
@@ -107250,15 +107281,15 @@ var GovernanceInstaller = class {
|
|
|
107250
107281
|
}
|
|
107251
107282
|
let shardsInstalled = 0;
|
|
107252
107283
|
if (!this.skipShards) {
|
|
107253
|
-
const shardsSrcDir =
|
|
107254
|
-
if (
|
|
107284
|
+
const shardsSrcDir = join31(this.assetsPath, "shards");
|
|
107285
|
+
if (existsSync29(shardsSrcDir)) {
|
|
107255
107286
|
try {
|
|
107256
107287
|
const shardFiles = readdirSync9(shardsSrcDir).filter((f3) => f3.endsWith(".shard.md"));
|
|
107257
107288
|
for (const shardFile of shardFiles) {
|
|
107258
|
-
const shardSrc =
|
|
107259
|
-
const shardDest =
|
|
107289
|
+
const shardSrc = join31(shardsSrcDir, shardFile);
|
|
107290
|
+
const shardDest = join31(shardsDir, shardFile);
|
|
107260
107291
|
try {
|
|
107261
|
-
if (!
|
|
107292
|
+
if (!existsSync29(shardDest) || this.overwrite) {
|
|
107262
107293
|
copyFileSync6(shardSrc, shardDest);
|
|
107263
107294
|
installed.push(`shards/${shardFile}`);
|
|
107264
107295
|
shardsInstalled++;
|
|
@@ -107289,15 +107320,15 @@ var GovernanceInstaller = class {
|
|
|
107289
107320
|
* Check if governance is already installed
|
|
107290
107321
|
*/
|
|
107291
107322
|
isInstalled() {
|
|
107292
|
-
const constitutionPath =
|
|
107293
|
-
return
|
|
107323
|
+
const constitutionPath = join31(this.projectRoot, ".claude", "guidance", "constitution.md");
|
|
107324
|
+
return existsSync29(constitutionPath);
|
|
107294
107325
|
}
|
|
107295
107326
|
/**
|
|
107296
107327
|
* Get list of installed shards
|
|
107297
107328
|
*/
|
|
107298
107329
|
getInstalledShards() {
|
|
107299
|
-
const shardsDir =
|
|
107300
|
-
if (!
|
|
107330
|
+
const shardsDir = join31(this.projectRoot, ".claude", "guidance", "shards");
|
|
107331
|
+
if (!existsSync29(shardsDir)) return [];
|
|
107301
107332
|
try {
|
|
107302
107333
|
return readdirSync9(shardsDir).filter((f3) => f3.endsWith(".shard.md"));
|
|
107303
107334
|
} catch {
|
|
@@ -107576,14 +107607,14 @@ function createModularInitOrchestrator(options) {
|
|
|
107576
107607
|
}
|
|
107577
107608
|
|
|
107578
107609
|
// src/cli/commands/claude-flow-setup.ts
|
|
107579
|
-
import { existsSync as
|
|
107580
|
-
import { join as
|
|
107610
|
+
import { existsSync as existsSync30, writeFileSync as writeFileSync13, readFileSync as readFileSync23 } from "node:fs";
|
|
107611
|
+
import { join as join32 } from "node:path";
|
|
107581
107612
|
import { execSync as execSync6 } from "node:child_process";
|
|
107582
107613
|
async function detectClaudeFlow(projectRoot, debug) {
|
|
107583
|
-
const claudeSettingsPath =
|
|
107584
|
-
if (
|
|
107614
|
+
const claudeSettingsPath = join32(projectRoot, ".claude", "settings.json");
|
|
107615
|
+
if (existsSync30(claudeSettingsPath)) {
|
|
107585
107616
|
try {
|
|
107586
|
-
const settings = JSON.parse(
|
|
107617
|
+
const settings = JSON.parse(readFileSync23(claudeSettingsPath, "utf-8"));
|
|
107587
107618
|
const mcpServers = settings.mcpServers || settings.mcp?.servers || {};
|
|
107588
107619
|
if (mcpServers["claude-flow"] || mcpServers["@anthropic/claude-flow"]) {
|
|
107589
107620
|
if (debug) console.log("[ClaudeFlow] Detected via MCP settings");
|
|
@@ -107604,9 +107635,9 @@ async function detectClaudeFlow(projectRoot, debug) {
|
|
|
107604
107635
|
} catch {
|
|
107605
107636
|
}
|
|
107606
107637
|
try {
|
|
107607
|
-
const packageJsonPath =
|
|
107608
|
-
if (
|
|
107609
|
-
const pkg = JSON.parse(
|
|
107638
|
+
const packageJsonPath = join32(projectRoot, "package.json");
|
|
107639
|
+
if (existsSync30(packageJsonPath)) {
|
|
107640
|
+
const pkg = JSON.parse(readFileSync23(packageJsonPath, "utf-8"));
|
|
107610
107641
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
107611
107642
|
if (deps["@claude-flow/cli"] || deps["claude-flow"]) {
|
|
107612
107643
|
if (debug) console.log("[ClaudeFlow] Detected via package.json");
|
|
@@ -107686,11 +107717,11 @@ function generateClaudeFlowConfig(projectRoot, features) {
|
|
|
107686
107717
|
};
|
|
107687
107718
|
}
|
|
107688
107719
|
function updateMCPConfig(projectRoot) {
|
|
107689
|
-
const claudeSettingsPath =
|
|
107720
|
+
const claudeSettingsPath = join32(projectRoot, ".claude", "settings.json");
|
|
107690
107721
|
let settings = {};
|
|
107691
|
-
if (
|
|
107722
|
+
if (existsSync30(claudeSettingsPath)) {
|
|
107692
107723
|
try {
|
|
107693
|
-
settings = JSON.parse(
|
|
107724
|
+
settings = JSON.parse(readFileSync23(claudeSettingsPath, "utf-8"));
|
|
107694
107725
|
} catch {
|
|
107695
107726
|
}
|
|
107696
107727
|
}
|
|
@@ -107746,8 +107777,8 @@ async function setupClaudeFlowIntegration(options) {
|
|
|
107746
107777
|
features
|
|
107747
107778
|
};
|
|
107748
107779
|
}
|
|
107749
|
-
const aqeDir =
|
|
107750
|
-
const configPath =
|
|
107780
|
+
const aqeDir = join32(projectRoot, ".agentic-qe");
|
|
107781
|
+
const configPath = join32(aqeDir, "claude-flow-integration.json");
|
|
107751
107782
|
try {
|
|
107752
107783
|
const config = generateClaudeFlowConfig(projectRoot, features);
|
|
107753
107784
|
writeFileSync13(configPath, JSON.stringify(config, null, 2));
|
|
@@ -108233,8 +108264,8 @@ import cliProgress, { MultiBar, Presets } from "cli-progress";
|
|
|
108233
108264
|
import ora from "ora";
|
|
108234
108265
|
|
|
108235
108266
|
// src/cli/config/cli-config.ts
|
|
108236
|
-
import { existsSync as
|
|
108237
|
-
import { join as
|
|
108267
|
+
import { existsSync as existsSync31, readFileSync as readFileSync24, writeFileSync as writeFileSync14, mkdirSync as mkdirSync16, unlinkSync as unlinkSync3 } from "fs";
|
|
108268
|
+
import { join as join33 } from "path";
|
|
108238
108269
|
import { homedir as homedir2 } from "os";
|
|
108239
108270
|
var DEFAULT_CLI_CONFIG = {
|
|
108240
108271
|
wizards: {
|
|
@@ -108261,10 +108292,10 @@ var DEFAULT_CLI_CONFIG = {
|
|
|
108261
108292
|
}
|
|
108262
108293
|
};
|
|
108263
108294
|
function getConfigDir() {
|
|
108264
|
-
return
|
|
108295
|
+
return join33(homedir2(), ".aqe");
|
|
108265
108296
|
}
|
|
108266
108297
|
function getConfigPath() {
|
|
108267
|
-
return
|
|
108298
|
+
return join33(getConfigDir(), "cli-config.json");
|
|
108268
108299
|
}
|
|
108269
108300
|
var cachedConfig = null;
|
|
108270
108301
|
var cacheTimestamp = 0;
|
|
@@ -108418,11 +108449,11 @@ function deepMerge(target, source) {
|
|
|
108418
108449
|
}
|
|
108419
108450
|
function loadCLIConfig() {
|
|
108420
108451
|
const configPath = getConfigPath();
|
|
108421
|
-
if (!
|
|
108452
|
+
if (!existsSync31(configPath)) {
|
|
108422
108453
|
return { ...DEFAULT_CLI_CONFIG };
|
|
108423
108454
|
}
|
|
108424
108455
|
try {
|
|
108425
|
-
const content =
|
|
108456
|
+
const content = readFileSync24(configPath, "utf-8");
|
|
108426
108457
|
const parsed = JSON.parse(content);
|
|
108427
108458
|
const validation = validateConfig(parsed);
|
|
108428
108459
|
if (!validation.valid) {
|
|
@@ -109446,12 +109477,12 @@ var BaseWizardCommand = class {
|
|
|
109446
109477
|
};
|
|
109447
109478
|
|
|
109448
109479
|
// src/cli/wizards/core/wizard-step.ts
|
|
109449
|
-
import { existsSync as
|
|
109480
|
+
import { existsSync as existsSync33 } from "fs";
|
|
109450
109481
|
import { resolve as resolve7 } from "path";
|
|
109451
109482
|
|
|
109452
109483
|
// src/cli/wizards/core/wizard-utils.ts
|
|
109453
|
-
import { existsSync as
|
|
109454
|
-
import { join as
|
|
109484
|
+
import { existsSync as existsSync32, statSync as statSync8 } from "fs";
|
|
109485
|
+
import { join as join34, relative as relative6 } from "path";
|
|
109455
109486
|
var WizardPrompt = class {
|
|
109456
109487
|
/**
|
|
109457
109488
|
* Generic prompt helper - wraps readline.question in a Promise
|
|
@@ -109542,8 +109573,8 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
109542
109573
|
const suggestions = [];
|
|
109543
109574
|
const commonDirs = ["src", "lib", "app", "packages", "api"];
|
|
109544
109575
|
for (const dir of commonDirs) {
|
|
109545
|
-
const dirPath =
|
|
109546
|
-
if (
|
|
109576
|
+
const dirPath = join34(cwd, dir);
|
|
109577
|
+
if (existsSync32(dirPath) && statSync8(dirPath).isDirectory()) {
|
|
109547
109578
|
suggestions.push(dir);
|
|
109548
109579
|
}
|
|
109549
109580
|
}
|
|
@@ -109561,8 +109592,8 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
109561
109592
|
".nyc_output"
|
|
109562
109593
|
];
|
|
109563
109594
|
for (const loc of coverageLocations) {
|
|
109564
|
-
const locPath =
|
|
109565
|
-
if (
|
|
109595
|
+
const locPath = join34(cwd, loc);
|
|
109596
|
+
if (existsSync32(locPath)) {
|
|
109566
109597
|
suggestions.push(loc);
|
|
109567
109598
|
}
|
|
109568
109599
|
}
|
|
@@ -109584,8 +109615,8 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
109584
109615
|
"Dockerfile"
|
|
109585
109616
|
];
|
|
109586
109617
|
for (const file of securityFiles) {
|
|
109587
|
-
const filePath =
|
|
109588
|
-
if (
|
|
109618
|
+
const filePath = join34(cwd, file);
|
|
109619
|
+
if (existsSync32(filePath)) {
|
|
109589
109620
|
suggestions.push(file);
|
|
109590
109621
|
}
|
|
109591
109622
|
}
|
|
@@ -109598,13 +109629,13 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
109598
109629
|
const suggestions = [];
|
|
109599
109630
|
const commonDirs = ["src", "lib", "app", "packages"];
|
|
109600
109631
|
for (const dir of commonDirs) {
|
|
109601
|
-
const dirPath =
|
|
109602
|
-
if (
|
|
109632
|
+
const dirPath = join34(cwd, dir);
|
|
109633
|
+
if (existsSync32(dirPath) && statSync8(dirPath).isDirectory()) {
|
|
109603
109634
|
suggestions.push(`${dir}/**/*.ts`);
|
|
109604
109635
|
suggestions.push(dir);
|
|
109605
109636
|
}
|
|
109606
109637
|
}
|
|
109607
|
-
if (
|
|
109638
|
+
if (existsSync32(join34(cwd, "src"))) {
|
|
109608
109639
|
suggestions.push("src/services/**/*.ts");
|
|
109609
109640
|
suggestions.push("src/utils/**/*.ts");
|
|
109610
109641
|
suggestions.push("src/components/**/*.tsx");
|
|
@@ -109616,12 +109647,12 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
109616
109647
|
*/
|
|
109617
109648
|
static checkPatternsExist(cwd) {
|
|
109618
109649
|
const patternLocations = [
|
|
109619
|
-
|
|
109620
|
-
|
|
109621
|
-
|
|
109622
|
-
|
|
109650
|
+
join34(cwd, ".agentic-qe", "patterns"),
|
|
109651
|
+
join34(cwd, ".agentic-qe", "memory.db"),
|
|
109652
|
+
join34(cwd, ".aqe", "patterns"),
|
|
109653
|
+
join34(cwd, "data", "patterns")
|
|
109623
109654
|
];
|
|
109624
|
-
return patternLocations.some((loc) =>
|
|
109655
|
+
return patternLocations.some((loc) => existsSync32(loc));
|
|
109625
109656
|
}
|
|
109626
109657
|
};
|
|
109627
109658
|
var WizardFormat = class {
|
|
@@ -109898,7 +109929,7 @@ var PathInputStep = class extends BaseWizardCommand {
|
|
|
109898
109929
|
async execute(context2) {
|
|
109899
109930
|
if (context2.nonInteractive) {
|
|
109900
109931
|
const resolved2 = resolve7(context2.cwd, this.defaultValue);
|
|
109901
|
-
return this.success(
|
|
109932
|
+
return this.success(existsSync33(resolved2) ? resolved2 : context2.cwd);
|
|
109902
109933
|
}
|
|
109903
109934
|
WizardPrompt.printStepHeader(this.stepNumber, this.title, this.description);
|
|
109904
109935
|
if (this.examples) {
|
|
@@ -109921,7 +109952,7 @@ var PathInputStep = class extends BaseWizardCommand {
|
|
|
109921
109952
|
);
|
|
109922
109953
|
const value = input.trim() || this.defaultValue;
|
|
109923
109954
|
const resolved = resolve7(context2.cwd, value);
|
|
109924
|
-
if (this.validatePath && !
|
|
109955
|
+
if (this.validatePath && !existsSync33(resolved)) {
|
|
109925
109956
|
console.log(source_default.yellow(` Warning: '${value}' does not exist, using current directory.`));
|
|
109926
109957
|
return this.success(context2.cwd);
|
|
109927
109958
|
}
|
|
@@ -112973,8 +113004,8 @@ import { Command as Command8 } from "commander";
|
|
|
112973
113004
|
init_types();
|
|
112974
113005
|
|
|
112975
113006
|
// src/init/fleet-integration.ts
|
|
112976
|
-
import { existsSync as
|
|
112977
|
-
import { join as
|
|
113007
|
+
import { existsSync as existsSync34 } from "fs";
|
|
113008
|
+
import { join as join36 } from "path";
|
|
112978
113009
|
var FleetInitEnhancer = class {
|
|
112979
113010
|
projectRoot;
|
|
112980
113011
|
options;
|
|
@@ -113086,7 +113117,7 @@ var FleetInitEnhancer = class {
|
|
|
113086
113117
|
});
|
|
113087
113118
|
console.log(source_default.gray(` Indexing ${files.length} files...`));
|
|
113088
113119
|
const result = await kgService.index({
|
|
113089
|
-
paths: files.map((f3) =>
|
|
113120
|
+
paths: files.map((f3) => join36(this.projectRoot, f3)),
|
|
113090
113121
|
incremental: false,
|
|
113091
113122
|
includeTests: true
|
|
113092
113123
|
});
|
|
@@ -113121,8 +113152,8 @@ var FleetInitEnhancer = class {
|
|
|
113121
113152
|
* Checks the memory database for code-intelligence:kg namespace entries
|
|
113122
113153
|
*/
|
|
113123
113154
|
async hasCodeIntelligenceIndex() {
|
|
113124
|
-
const dbPath =
|
|
113125
|
-
if (!
|
|
113155
|
+
const dbPath = join36(this.projectRoot, ".agentic-qe", "memory.db");
|
|
113156
|
+
if (!existsSync34(dbPath)) {
|
|
113126
113157
|
return false;
|
|
113127
113158
|
}
|
|
113128
113159
|
try {
|
|
@@ -113142,7 +113173,7 @@ var FleetInitEnhancer = class {
|
|
|
113142
113173
|
* Get count of knowledge graph entries
|
|
113143
113174
|
*/
|
|
113144
113175
|
async getKGEntryCount() {
|
|
113145
|
-
const dbPath =
|
|
113176
|
+
const dbPath = join36(this.projectRoot, ".agentic-qe", "memory.db");
|
|
113146
113177
|
try {
|
|
113147
113178
|
const Database8 = (await import("better-sqlite3")).default;
|
|
113148
113179
|
const db = new Database8(dbPath);
|
|
@@ -114623,7 +114654,7 @@ function createParallelEvalRunner(skillValidationLearner, config = {}, executor2
|
|
|
114623
114654
|
}
|
|
114624
114655
|
|
|
114625
114656
|
// src/validation/validation-result-aggregator.ts
|
|
114626
|
-
import { readFileSync as
|
|
114657
|
+
import { readFileSync as readFileSync26, writeFileSync as writeFileSync15, existsSync as existsSync36 } from "fs";
|
|
114627
114658
|
var DEFAULT_CONFIG59 = {
|
|
114628
114659
|
varianceThreshold: 0.04,
|
|
114629
114660
|
// ~20% standard deviation
|
|
@@ -114968,10 +114999,10 @@ var ValidationResultAggregator = class {
|
|
|
114968
114999
|
* Update trust tier manifest with new pass rates
|
|
114969
115000
|
*/
|
|
114970
115001
|
async updateManifest(report) {
|
|
114971
|
-
if (!
|
|
115002
|
+
if (!existsSync36(this.manifestPath)) {
|
|
114972
115003
|
throw new Error(`Manifest file not found: ${this.manifestPath}`);
|
|
114973
115004
|
}
|
|
114974
|
-
const manifest = JSON.parse(
|
|
115005
|
+
const manifest = JSON.parse(readFileSync26(this.manifestPath, "utf-8"));
|
|
114975
115006
|
for (const [skillName, summary] of report.skillResults.entries()) {
|
|
114976
115007
|
if (manifest.skills && manifest.skills[skillName]) {
|
|
114977
115008
|
const skill = manifest.skills[skillName];
|
|
@@ -117682,20 +117713,20 @@ function formatDuration2(ms) {
|
|
|
117682
117713
|
|
|
117683
117714
|
// src/cli/commands/validate.ts
|
|
117684
117715
|
import { Command as Command10 } from "commander";
|
|
117685
|
-
import { readFileSync as
|
|
117686
|
-
import { join as
|
|
117716
|
+
import { readFileSync as readFileSync27, writeFileSync as writeFileSync16, existsSync as existsSync37, readdirSync as readdirSync10, statSync as statSync10 } from "fs";
|
|
117717
|
+
import { join as join38, resolve as resolve8, basename as basename7 } from "path";
|
|
117687
117718
|
function loadValidationResults(inputPath) {
|
|
117688
117719
|
const resolvedPath = resolve8(inputPath);
|
|
117689
|
-
if (!
|
|
117720
|
+
if (!existsSync37(resolvedPath)) {
|
|
117690
117721
|
throw new Error(`Input path not found: ${resolvedPath}`);
|
|
117691
117722
|
}
|
|
117692
117723
|
const stat4 = statSync10(resolvedPath);
|
|
117693
117724
|
if (stat4.isDirectory()) {
|
|
117694
117725
|
const results = [];
|
|
117695
|
-
const files = readdirSync10(resolvedPath).filter((f3) => f3.endsWith(".json")).map((f3) =>
|
|
117726
|
+
const files = readdirSync10(resolvedPath).filter((f3) => f3.endsWith(".json")).map((f3) => join38(resolvedPath, f3));
|
|
117696
117727
|
for (const file of files) {
|
|
117697
117728
|
try {
|
|
117698
|
-
const content = JSON.parse(
|
|
117729
|
+
const content = JSON.parse(readFileSync27(file, "utf-8"));
|
|
117699
117730
|
if (isValidationRunResult(content)) {
|
|
117700
117731
|
results.push(content);
|
|
117701
117732
|
} else if (Array.isArray(content)) {
|
|
@@ -117711,7 +117742,7 @@ function loadValidationResults(inputPath) {
|
|
|
117711
117742
|
}
|
|
117712
117743
|
return results;
|
|
117713
117744
|
} else {
|
|
117714
|
-
const content = JSON.parse(
|
|
117745
|
+
const content = JSON.parse(readFileSync27(resolvedPath, "utf-8"));
|
|
117715
117746
|
if (isValidationRunResult(content)) {
|
|
117716
117747
|
return [content];
|
|
117717
117748
|
} else if (Array.isArray(content)) {
|
|
@@ -117742,15 +117773,15 @@ function createMockLearner() {
|
|
|
117742
117773
|
function getDefaultManifestPath() {
|
|
117743
117774
|
const cwd = process.cwd();
|
|
117744
117775
|
const candidates = [
|
|
117745
|
-
|
|
117746
|
-
|
|
117776
|
+
join38(cwd, ".claude/skills/trust-tier-manifest.json"),
|
|
117777
|
+
join38(cwd, ".claude/skills/skills-manifest.json")
|
|
117747
117778
|
];
|
|
117748
117779
|
for (const candidate of candidates) {
|
|
117749
|
-
if (
|
|
117780
|
+
if (existsSync37(candidate)) {
|
|
117750
117781
|
return candidate;
|
|
117751
117782
|
}
|
|
117752
117783
|
}
|
|
117753
|
-
return
|
|
117784
|
+
return join38(cwd, ".claude/skills/trust-tier-manifest.json");
|
|
117754
117785
|
}
|
|
117755
117786
|
function writeReport(report, aggregator, options) {
|
|
117756
117787
|
const format = options.format || "markdown";
|
|
@@ -124809,8 +124840,8 @@ async function createCoherenceService(wasmLoader2, config, logger) {
|
|
|
124809
124840
|
// src/integrations/coherence/wasm-loader.ts
|
|
124810
124841
|
import { createRequire as createRequire4 } from "node:module";
|
|
124811
124842
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
124812
|
-
import { dirname as dirname13, join as
|
|
124813
|
-
import { readFileSync as
|
|
124843
|
+
import { dirname as dirname13, join as join40 } from "node:path";
|
|
124844
|
+
import { readFileSync as readFileSync30, existsSync as existsSync40 } from "node:fs";
|
|
124814
124845
|
var FALLBACK_RETRY_DELAYS_MS = [1e3, 2e3, 4e3];
|
|
124815
124846
|
var WasmLoader = class {
|
|
124816
124847
|
state = "unloaded";
|
|
@@ -125068,15 +125099,15 @@ var WasmLoader = class {
|
|
|
125068
125099
|
(() => {
|
|
125069
125100
|
try {
|
|
125070
125101
|
const modulePath = require5.resolve("prime-radiant-advanced-wasm");
|
|
125071
|
-
return
|
|
125102
|
+
return join40(dirname13(modulePath), "prime_radiant_advanced_wasm_bg.wasm");
|
|
125072
125103
|
} catch {
|
|
125073
125104
|
return null;
|
|
125074
125105
|
}
|
|
125075
125106
|
})(),
|
|
125076
|
-
|
|
125107
|
+
join40(process.cwd(), "node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm")
|
|
125077
125108
|
].filter((p3) => p3 !== null);
|
|
125078
125109
|
for (const path23 of wasmPaths) {
|
|
125079
|
-
if (
|
|
125110
|
+
if (existsSync40(path23)) {
|
|
125080
125111
|
return true;
|
|
125081
125112
|
}
|
|
125082
125113
|
}
|
|
@@ -125327,19 +125358,19 @@ var WasmLoader = class {
|
|
|
125327
125358
|
(() => {
|
|
125328
125359
|
try {
|
|
125329
125360
|
const modulePath = require5.resolve("prime-radiant-advanced-wasm");
|
|
125330
|
-
return
|
|
125361
|
+
return join40(dirname13(modulePath), "prime_radiant_advanced_wasm_bg.wasm");
|
|
125331
125362
|
} catch {
|
|
125332
125363
|
return null;
|
|
125333
125364
|
}
|
|
125334
125365
|
})(),
|
|
125335
125366
|
// Direct node_modules path from current file
|
|
125336
|
-
|
|
125367
|
+
join40(dirname13(fileURLToPath6(import.meta.url)), "../../../../node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm"),
|
|
125337
125368
|
// Workspace root
|
|
125338
|
-
|
|
125369
|
+
join40(process.cwd(), "node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm")
|
|
125339
125370
|
].filter((p3) => p3 !== null);
|
|
125340
125371
|
let wasmPath = null;
|
|
125341
125372
|
for (const path23 of wasmPaths) {
|
|
125342
|
-
if (
|
|
125373
|
+
if (existsSync40(path23)) {
|
|
125343
125374
|
wasmPath = path23;
|
|
125344
125375
|
break;
|
|
125345
125376
|
}
|
|
@@ -125351,7 +125382,7 @@ ${wasmPaths.join("\n")}
|
|
|
125351
125382
|
Ensure prime-radiant-advanced-wasm is installed.`
|
|
125352
125383
|
);
|
|
125353
125384
|
}
|
|
125354
|
-
const wasmBytes =
|
|
125385
|
+
const wasmBytes = readFileSync30(wasmPath);
|
|
125355
125386
|
if (wasmModule.initSync && typeof wasmModule.initSync === "function") {
|
|
125356
125387
|
wasmModule.initSync({ module: wasmBytes });
|
|
125357
125388
|
} else {
|
|
@@ -126166,7 +126197,7 @@ Registered: ${events.length}/${Object.keys(QE_HOOK_EVENTS).length}`)
|
|
|
126166
126197
|
// src/cli/commands/learning.ts
|
|
126167
126198
|
import { Command as Command16 } from "commander";
|
|
126168
126199
|
import path22 from "node:path";
|
|
126169
|
-
import { existsSync as
|
|
126200
|
+
import { existsSync as existsSync42, writeFileSync as writeFileSync20, readFileSync as readFileSync31, mkdirSync as mkdirSync17, copyFileSync as copyFileSync7 } from "node:fs";
|
|
126170
126201
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
126171
126202
|
import { stat as stat3, unlink } from "node:fs/promises";
|
|
126172
126203
|
import { createGzip, createGunzip } from "node:zlib";
|
|
@@ -126175,7 +126206,7 @@ import { pipeline as pipeline3 } from "node:stream/promises";
|
|
|
126175
126206
|
// src/learning/metrics-tracker.ts
|
|
126176
126207
|
import Database7 from "better-sqlite3";
|
|
126177
126208
|
import path21 from "node:path";
|
|
126178
|
-
import { existsSync as
|
|
126209
|
+
import { existsSync as existsSync41 } from "node:fs";
|
|
126179
126210
|
var LearningMetricsTracker = class {
|
|
126180
126211
|
db = null;
|
|
126181
126212
|
dbPath;
|
|
@@ -126188,7 +126219,7 @@ var LearningMetricsTracker = class {
|
|
|
126188
126219
|
*/
|
|
126189
126220
|
async initialize() {
|
|
126190
126221
|
if (this.initialized) return;
|
|
126191
|
-
if (!
|
|
126222
|
+
if (!existsSync41(this.dbPath)) {
|
|
126192
126223
|
throw new Error(`Database not found: ${this.dbPath}. Run "aqe init --auto" first.`);
|
|
126193
126224
|
}
|
|
126194
126225
|
this.db = new Database7(this.dbPath, { readonly: false });
|
|
@@ -126887,10 +126918,10 @@ Examples:
|
|
|
126887
126918
|
learning.command("import").description("Import patterns from file").requiredOption("-i, --input <file>", "Input file path").option("--dry-run", "Show what would be imported without making changes").option("--json", "Output as JSON").action(async (options) => {
|
|
126888
126919
|
try {
|
|
126889
126920
|
const inputPath = path22.resolve(options.input);
|
|
126890
|
-
if (!
|
|
126921
|
+
if (!existsSync42(inputPath)) {
|
|
126891
126922
|
throw new Error(`File not found: ${inputPath}`);
|
|
126892
126923
|
}
|
|
126893
|
-
const content =
|
|
126924
|
+
const content = readFileSync31(inputPath, "utf-8");
|
|
126894
126925
|
const importData = JSON.parse(content);
|
|
126895
126926
|
if (!importData.patterns || !Array.isArray(importData.patterns)) {
|
|
126896
126927
|
throw new Error("Invalid pattern file format");
|
|
@@ -126970,7 +127001,7 @@ Examples:
|
|
|
126970
127001
|
}
|
|
126971
127002
|
console.log(source_default.bold("\n\u{1F5D1}\uFE0F Resetting Learning Data\n"));
|
|
126972
127003
|
for (const file of filesToReset) {
|
|
126973
|
-
if (
|
|
127004
|
+
if (existsSync42(file)) {
|
|
126974
127005
|
console.log(source_default.dim(` Removing: ${path22.relative(cwd, file)}`));
|
|
126975
127006
|
}
|
|
126976
127007
|
}
|
|
@@ -126986,7 +127017,7 @@ Examples:
|
|
|
126986
127017
|
try {
|
|
126987
127018
|
const cwd = process.cwd();
|
|
126988
127019
|
const dbPath = path22.join(cwd, ".agentic-qe", "memory.db");
|
|
126989
|
-
if (!
|
|
127020
|
+
if (!existsSync42(dbPath)) {
|
|
126990
127021
|
throw new Error('No memory database found. Run "aqe init --auto" first.');
|
|
126991
127022
|
}
|
|
126992
127023
|
const minReward = parseFloat(options.minReward);
|
|
@@ -127242,28 +127273,28 @@ Examples:
|
|
|
127242
127273
|
learning.command("backup").description("Backup learning database to a file").option("-o, --output <path>", "Output file path").option("--compress", "Compress backup with gzip").option("--verify", "Verify backup integrity after creation").option("--json", "Output as JSON").action(async (options) => {
|
|
127243
127274
|
try {
|
|
127244
127275
|
const dbPath = getDbPath();
|
|
127245
|
-
if (!
|
|
127276
|
+
if (!existsSync42(dbPath)) {
|
|
127246
127277
|
throw new Error(`No learning database found at: ${dbPath}`);
|
|
127247
127278
|
}
|
|
127248
127279
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
127249
127280
|
const defaultOutput = path22.join(process.cwd(), "backups", `learning-${timestamp}.db`);
|
|
127250
127281
|
let outputPath = options.output ? path22.resolve(options.output) : defaultOutput;
|
|
127251
127282
|
const backupDir = path22.dirname(outputPath);
|
|
127252
|
-
if (!
|
|
127283
|
+
if (!existsSync42(backupDir)) {
|
|
127253
127284
|
mkdirSync17(backupDir, { recursive: true });
|
|
127254
127285
|
}
|
|
127255
127286
|
const sourceStats = await stat3(dbPath);
|
|
127256
127287
|
const sourceSizeKB = (sourceStats.size / 1024).toFixed(2);
|
|
127257
127288
|
copyFileSync7(dbPath, outputPath);
|
|
127258
127289
|
const walPath = `${dbPath}-wal`;
|
|
127259
|
-
if (
|
|
127290
|
+
if (existsSync42(walPath)) {
|
|
127260
127291
|
copyFileSync7(walPath, `${outputPath}-wal`);
|
|
127261
127292
|
}
|
|
127262
127293
|
let finalPath = outputPath;
|
|
127263
127294
|
if (options.compress) {
|
|
127264
127295
|
finalPath = await compressFile(outputPath);
|
|
127265
127296
|
await unlink(outputPath);
|
|
127266
|
-
if (
|
|
127297
|
+
if (existsSync42(`${outputPath}-wal`)) {
|
|
127267
127298
|
await unlink(`${outputPath}-wal`);
|
|
127268
127299
|
}
|
|
127269
127300
|
}
|
|
@@ -127317,7 +127348,7 @@ Examples:
|
|
|
127317
127348
|
try {
|
|
127318
127349
|
const inputPath = path22.resolve(options.input);
|
|
127319
127350
|
const dbPath = getDbPath();
|
|
127320
|
-
if (!
|
|
127351
|
+
if (!existsSync42(inputPath)) {
|
|
127321
127352
|
throw new Error(`Backup file not found: ${inputPath}`);
|
|
127322
127353
|
}
|
|
127323
127354
|
const isCompressed = inputPath.endsWith(".gz");
|
|
@@ -127330,35 +127361,35 @@ Examples:
|
|
|
127330
127361
|
if (options.verify) {
|
|
127331
127362
|
const verificationResult = await verifyDatabaseIntegrity(restorePath);
|
|
127332
127363
|
if (!verificationResult.valid) {
|
|
127333
|
-
if (isCompressed &&
|
|
127364
|
+
if (isCompressed && existsSync42(restorePath)) {
|
|
127334
127365
|
await unlink(restorePath);
|
|
127335
127366
|
}
|
|
127336
127367
|
throw new Error(`Backup verification failed: ${verificationResult.message}`);
|
|
127337
127368
|
}
|
|
127338
127369
|
}
|
|
127339
|
-
if (
|
|
127370
|
+
if (existsSync42(dbPath) && !options.force) {
|
|
127340
127371
|
printError2(`Database already exists at: ${dbPath}`);
|
|
127341
127372
|
console.log(source_default.yellow(" Use --force to overwrite"));
|
|
127342
|
-
if (isCompressed &&
|
|
127373
|
+
if (isCompressed && existsSync42(restorePath)) {
|
|
127343
127374
|
await unlink(restorePath);
|
|
127344
127375
|
}
|
|
127345
127376
|
process.exit(1);
|
|
127346
127377
|
}
|
|
127347
127378
|
const targetDir = path22.dirname(dbPath);
|
|
127348
|
-
if (!
|
|
127379
|
+
if (!existsSync42(targetDir)) {
|
|
127349
127380
|
mkdirSync17(targetDir, { recursive: true });
|
|
127350
127381
|
}
|
|
127351
|
-
if (
|
|
127382
|
+
if (existsSync42(dbPath)) {
|
|
127352
127383
|
await unlink(dbPath);
|
|
127353
127384
|
}
|
|
127354
|
-
if (
|
|
127385
|
+
if (existsSync42(`${dbPath}-wal`)) {
|
|
127355
127386
|
await unlink(`${dbPath}-wal`);
|
|
127356
127387
|
}
|
|
127357
|
-
if (
|
|
127388
|
+
if (existsSync42(`${dbPath}-shm`)) {
|
|
127358
127389
|
await unlink(`${dbPath}-shm`);
|
|
127359
127390
|
}
|
|
127360
127391
|
copyFileSync7(restorePath, dbPath);
|
|
127361
|
-
if (isCompressed &&
|
|
127392
|
+
if (isCompressed && existsSync42(restorePath)) {
|
|
127362
127393
|
await unlink(restorePath);
|
|
127363
127394
|
}
|
|
127364
127395
|
const restoredStats = await stat3(dbPath);
|
|
@@ -127391,7 +127422,7 @@ Examples:
|
|
|
127391
127422
|
learning.command("verify").description("Verify learning database integrity").option("-f, --file <path>", "Database file to verify (defaults to current)").option("--json", "Output as JSON").action(async (options) => {
|
|
127392
127423
|
try {
|
|
127393
127424
|
const dbPath = options.file ? path22.resolve(options.file) : getDbPath();
|
|
127394
|
-
if (!
|
|
127425
|
+
if (!existsSync42(dbPath)) {
|
|
127395
127426
|
throw new Error(`Database file not found: ${dbPath}`);
|
|
127396
127427
|
}
|
|
127397
127428
|
const verificationResult = await verifyDatabaseIntegrity(dbPath);
|
|
@@ -127449,7 +127480,7 @@ Examples:
|
|
|
127449
127480
|
learning.command("export-full").description("Export all learning data including patterns, trajectories, and experiences").option("-o, --output <file>", "Output file path", "aqe-learning-export.json").option("--compress", "Compress output with gzip").option("--include-trajectories", "Include learning trajectories").option("--include-experiences", "Include learning experiences").option("--json", "Output as JSON (to stdout)").action(async (options) => {
|
|
127450
127481
|
try {
|
|
127451
127482
|
const dbPath = getDbPath();
|
|
127452
|
-
if (!
|
|
127483
|
+
if (!existsSync42(dbPath)) {
|
|
127453
127484
|
throw new Error('No learning database found. Run "aqe init --auto" first.');
|
|
127454
127485
|
}
|
|
127455
127486
|
const reasoningBank = await initializeLearningSystem();
|
|
@@ -127564,17 +127595,17 @@ Examples:
|
|
|
127564
127595
|
learning.command("import-merge").description("Import and merge patterns from export file (preserves existing data)").requiredOption("-i, --input <file>", "Input file path").option("--skip-duplicates", "Skip patterns with matching names (default: update)").option("--dry-run", "Show what would be imported without making changes").option("--json", "Output as JSON").action(async (options) => {
|
|
127565
127596
|
try {
|
|
127566
127597
|
let inputPath = path22.resolve(options.input);
|
|
127567
|
-
if (!
|
|
127598
|
+
if (!existsSync42(inputPath)) {
|
|
127568
127599
|
throw new Error(`File not found: ${inputPath}`);
|
|
127569
127600
|
}
|
|
127570
127601
|
let content;
|
|
127571
127602
|
if (inputPath.endsWith(".gz")) {
|
|
127572
127603
|
const tempPath = inputPath.replace(".gz", ".tmp.json");
|
|
127573
127604
|
await decompressFile(inputPath, tempPath);
|
|
127574
|
-
content =
|
|
127605
|
+
content = readFileSync31(tempPath, "utf-8");
|
|
127575
127606
|
await unlink(tempPath);
|
|
127576
127607
|
} else {
|
|
127577
|
-
content =
|
|
127608
|
+
content = readFileSync31(inputPath, "utf-8");
|
|
127578
127609
|
}
|
|
127579
127610
|
const importData = JSON.parse(content);
|
|
127580
127611
|
if (!importData.patterns || !Array.isArray(importData.patterns)) {
|
|
@@ -127684,8 +127715,8 @@ Examples:
|
|
|
127684
127715
|
// src/cli/commands/mcp.ts
|
|
127685
127716
|
import { Command as Command17 } from "commander";
|
|
127686
127717
|
import { spawn as spawn7 } from "child_process";
|
|
127687
|
-
import { join as
|
|
127688
|
-
import { existsSync as
|
|
127718
|
+
import { join as join41, dirname as dirname14 } from "path";
|
|
127719
|
+
import { existsSync as existsSync43 } from "fs";
|
|
127689
127720
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
127690
127721
|
function createMcpCommand() {
|
|
127691
127722
|
const cmd = new Command17("mcp").description("Start the MCP protocol server for Claude Code integration").option("--http <port>", "Also start HTTP server for AG-UI/A2A protocols", "0").option("--verbose", "Enable verbose logging").action(async (options) => {
|
|
@@ -127727,17 +127758,17 @@ function findMcpEntry() {
|
|
|
127727
127758
|
const __dirname5 = dirname14(__filename5);
|
|
127728
127759
|
const candidates = [
|
|
127729
127760
|
// 1. Bundled dist (production)
|
|
127730
|
-
|
|
127761
|
+
join41(__dirname5, "..", "..", "mcp", "bundle.js"),
|
|
127731
127762
|
// 2. Compiled dist
|
|
127732
|
-
|
|
127763
|
+
join41(__dirname5, "..", "..", "mcp", "entry.js"),
|
|
127733
127764
|
// 3. Source (development with tsx)
|
|
127734
|
-
|
|
127765
|
+
join41(__dirname5, "..", "..", "mcp", "entry.ts"),
|
|
127735
127766
|
// 4. From node_modules (when used as dependency)
|
|
127736
|
-
|
|
127737
|
-
|
|
127767
|
+
join41(process.cwd(), "node_modules", "agentic-qe", "v3", "dist", "mcp", "bundle.js"),
|
|
127768
|
+
join41(process.cwd(), "node_modules", "agentic-qe", "v3", "dist", "mcp", "entry.js")
|
|
127738
127769
|
];
|
|
127739
127770
|
for (const candidate of candidates) {
|
|
127740
|
-
if (
|
|
127771
|
+
if (existsSync43(candidate)) {
|
|
127741
127772
|
return candidate;
|
|
127742
127773
|
}
|
|
127743
127774
|
}
|
|
@@ -127859,7 +127890,7 @@ async function cleanupAndExit(code = 0) {
|
|
|
127859
127890
|
process.exit(code);
|
|
127860
127891
|
}
|
|
127861
127892
|
var program = new Command18();
|
|
127862
|
-
var VERSION = true ? "3.5.
|
|
127893
|
+
var VERSION = true ? "3.5.4" : "0.0.0-dev";
|
|
127863
127894
|
program.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(VERSION);
|
|
127864
127895
|
var registry = createCommandRegistry(context, cleanupAndExit, ensureInitialized);
|
|
127865
127896
|
registry.registerAll(program);
|