@integrity-labs/agt-cli 0.8.3 → 0.8.5
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/dist/bin/agt.js +2 -2
- package/dist/lib/manager-worker.js +30 -17
- package/dist/lib/manager-worker.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/agt.js
CHANGED
|
@@ -3411,7 +3411,7 @@ async function acpxCloseCommand(agent2, _opts, cmd) {
|
|
|
3411
3411
|
import { execSync } from "child_process";
|
|
3412
3412
|
import chalk19 from "chalk";
|
|
3413
3413
|
import ora15 from "ora";
|
|
3414
|
-
var cliVersion = true ? "0.8.
|
|
3414
|
+
var cliVersion = true ? "0.8.5" : "dev";
|
|
3415
3415
|
async function fetchLatestVersion() {
|
|
3416
3416
|
const host2 = AGT_HOST;
|
|
3417
3417
|
if (!host2) return null;
|
|
@@ -3527,7 +3527,7 @@ async function checkForUpdateOnStartup() {
|
|
|
3527
3527
|
}
|
|
3528
3528
|
|
|
3529
3529
|
// src/bin/agt.ts
|
|
3530
|
-
var cliVersion2 = true ? "0.8.
|
|
3530
|
+
var cliVersion2 = true ? "0.8.5" : "dev";
|
|
3531
3531
|
var program = new Command();
|
|
3532
3532
|
program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
|
|
3533
3533
|
program.hook("preAction", (thisCommand) => {
|
|
@@ -351,14 +351,16 @@ var _acpxBin = null;
|
|
|
351
351
|
function getAcpxBin() {
|
|
352
352
|
if (_acpxBin) return _acpxBin;
|
|
353
353
|
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
]) {
|
|
354
|
+
let dir = moduleDir;
|
|
355
|
+
for (let i = 0; i < 6; i++) {
|
|
356
|
+
const candidate = join(dir, "node_modules", ".bin", "acpx");
|
|
358
357
|
if (existsSync(candidate)) {
|
|
359
358
|
_acpxBin = candidate;
|
|
360
359
|
return _acpxBin;
|
|
361
360
|
}
|
|
361
|
+
const parent = dirname(dir);
|
|
362
|
+
if (parent === dir) break;
|
|
363
|
+
dir = parent;
|
|
362
364
|
}
|
|
363
365
|
try {
|
|
364
366
|
execSync("which acpx", { stdio: "ignore" });
|
|
@@ -540,18 +542,29 @@ async function injectMessage(codeName, type, content, meta, log2) {
|
|
|
540
542
|
const tmpFile = join(tmpDir, ".agt-inject-prompt.txt");
|
|
541
543
|
writeFileSync2(tmpFile, text);
|
|
542
544
|
_log(`[inject] acpx exec: cwd=${projectDir}, file=${tmpFile}, bin=${acpx}`);
|
|
543
|
-
|
|
544
|
-
"claude",
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
545
|
+
const ok = await new Promise((resolve) => {
|
|
546
|
+
const child = spawn(acpx, ["claude", "exec", "-f", tmpFile], {
|
|
547
|
+
cwd: projectDir,
|
|
548
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
549
|
+
});
|
|
550
|
+
let stderr = "";
|
|
551
|
+
child.stderr?.on("data", (d) => {
|
|
552
|
+
stderr += d.toString();
|
|
553
|
+
});
|
|
554
|
+
child.on("error", (err) => {
|
|
555
|
+
_log(`[inject] acpx spawn error for '${codeName}': ${err.message}`);
|
|
556
|
+
resolve(false);
|
|
557
|
+
});
|
|
558
|
+
child.on("close", (code) => {
|
|
559
|
+
if (code === 0) {
|
|
560
|
+
resolve(true);
|
|
561
|
+
} else {
|
|
562
|
+
_log(`[inject] acpx exec exited ${code} for '${codeName}': ${stderr.trim()}`);
|
|
563
|
+
resolve(false);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
553
566
|
});
|
|
554
|
-
return true;
|
|
567
|
+
if (ok) return true;
|
|
555
568
|
} catch (err) {
|
|
556
569
|
_log(`[inject] acpx exec failed for '${codeName}': ${err.message}`);
|
|
557
570
|
}
|
|
@@ -644,7 +657,7 @@ function writeAcpxConfig(config2) {
|
|
|
644
657
|
const mcpPatterns2 = mcpServerNames2.map((name) => `mcp__${name.replace(/-/g, "_")}__*`);
|
|
645
658
|
const allowedTools2 = [...mcpPatterns2, "Bash", "Read", "Write", "Edit", "Grep", "Glob", "Agent", "Skill"].join(",");
|
|
646
659
|
claudeArgs.push("--allowedTools", allowedTools2);
|
|
647
|
-
let envPrefix = "";
|
|
660
|
+
let envPrefix = "CLAUDE_CODE_SIMPLE=1 ";
|
|
648
661
|
const envIntegrationsPath = join(projectDir, ".env.integrations");
|
|
649
662
|
if (existsSync(envIntegrationsPath)) {
|
|
650
663
|
try {
|
|
@@ -655,7 +668,7 @@ function writeAcpxConfig(config2) {
|
|
|
655
668
|
const value = line.slice(eqIdx + 1);
|
|
656
669
|
return `${key}=${JSON.stringify(value)}`;
|
|
657
670
|
}).join(" ");
|
|
658
|
-
if (envVars) envPrefix = `
|
|
671
|
+
if (envVars) envPrefix = `CLAUDE_CODE_SIMPLE=1 ${envVars} `;
|
|
659
672
|
} catch {
|
|
660
673
|
}
|
|
661
674
|
}
|