@integrity-labs/agt-cli 0.10.13 → 0.10.15
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 +33 -17
- package/dist/bin/agt.js.map +1 -1
- package/dist/{chunk-KZ7Y55HJ.js → chunk-XTETZ2D5.js} +4 -1
- package/dist/{chunk-KZ7Y55HJ.js.map → chunk-XTETZ2D5.js.map} +1 -1
- package/dist/lib/manager-worker.js +56 -25
- package/dist/lib/manager-worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
provisionStopHook,
|
|
11
11
|
requireHost,
|
|
12
12
|
resolveChannels
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-XTETZ2D5.js";
|
|
14
14
|
import {
|
|
15
15
|
findTaskByTemplate,
|
|
16
16
|
getProjectDir,
|
|
@@ -781,48 +781,60 @@ function clearAgentCaches(agentId, codeName) {
|
|
|
781
781
|
var cachedFrameworkVersion = null;
|
|
782
782
|
var lastVersionCheckAt = 0;
|
|
783
783
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
784
|
+
function resolveBrewPath(execFileSync) {
|
|
785
|
+
try {
|
|
786
|
+
const out = execFileSync("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
787
|
+
if (out) return out;
|
|
788
|
+
} catch {
|
|
789
|
+
}
|
|
790
|
+
const fallback = "/home/linuxbrew/.linuxbrew/bin/brew";
|
|
791
|
+
if (existsSync(fallback)) return fallback;
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
784
794
|
async function ensureFrameworkBinary(frameworkId) {
|
|
785
795
|
if (frameworkId !== "claude-code") return;
|
|
786
796
|
if (frameworkBinaryChecked.has(frameworkId)) return;
|
|
787
797
|
frameworkBinaryChecked.add(frameworkId);
|
|
788
798
|
const { execFileSync } = await import("child_process");
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
} catch {
|
|
793
|
-
log("Homebrew not found \u2014 cannot auto-install/upgrade Claude Code. Install manually: https://claude.ai/download");
|
|
799
|
+
const brewPath = resolveBrewPath(execFileSync);
|
|
800
|
+
if (!brewPath) {
|
|
801
|
+
log("Homebrew not found (no `brew` on PATH, no /home/linuxbrew/.linuxbrew/bin/brew). Cannot auto-install Claude Code. Install manually: https://claude.ai/download");
|
|
794
802
|
return;
|
|
795
803
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
804
|
+
log(`Using brew at ${brewPath}`);
|
|
805
|
+
const isRoot = typeof process.getuid === "function" && process.getuid() === 0;
|
|
806
|
+
const runBrew = (args, opts) => {
|
|
807
|
+
if (isRoot) {
|
|
808
|
+
const sudoArgs = ["-u", "ec2-user", "-H", brewPath, ...args];
|
|
809
|
+
return execFileSync("sudo", sudoArgs, { ...opts, stdio: "pipe" }).toString();
|
|
810
|
+
}
|
|
811
|
+
return execFileSync(brewPath, args, { ...opts, stdio: "pipe" }).toString();
|
|
812
|
+
};
|
|
813
|
+
let claudeExists = existsSync("/home/linuxbrew/.linuxbrew/bin/claude");
|
|
814
|
+
if (!claudeExists) {
|
|
815
|
+
try {
|
|
816
|
+
execFileSync("which", ["claude"], { timeout: 5e3 });
|
|
817
|
+
claudeExists = true;
|
|
818
|
+
} catch {
|
|
819
|
+
}
|
|
801
820
|
}
|
|
802
821
|
if (!claudeExists) {
|
|
803
|
-
log(
|
|
822
|
+
log(`Claude Code binary not found \u2014 installing via Homebrew${isRoot ? " (as ec2-user via sudo)" : ""}...`);
|
|
804
823
|
try {
|
|
805
|
-
|
|
806
|
-
timeout: 12e4,
|
|
807
|
-
stdio: "pipe"
|
|
808
|
-
});
|
|
824
|
+
runBrew(["install", "--cask", "claude-code"], { timeout: 12e4 });
|
|
809
825
|
} catch (err) {
|
|
810
826
|
log(`Claude Code install failed: ${err.message}`);
|
|
811
827
|
return;
|
|
812
828
|
}
|
|
813
|
-
|
|
814
|
-
execFileSync("which", ["claude"], { timeout: 5e3 });
|
|
829
|
+
if (existsSync("/home/linuxbrew/.linuxbrew/bin/claude")) {
|
|
815
830
|
log("Claude Code installed successfully");
|
|
816
|
-
}
|
|
817
|
-
log("Claude Code install completed but binary not found
|
|
831
|
+
} else {
|
|
832
|
+
log("Claude Code install completed but binary not found at expected path \u2014 check brew logs");
|
|
818
833
|
}
|
|
819
834
|
} else {
|
|
820
|
-
log(
|
|
835
|
+
log(`Checking for Claude Code updates${isRoot ? " (as ec2-user via sudo)" : ""}...`);
|
|
821
836
|
try {
|
|
822
|
-
const output =
|
|
823
|
-
timeout: 12e4,
|
|
824
|
-
stdio: "pipe"
|
|
825
|
-
}).toString();
|
|
837
|
+
const output = runBrew(["upgrade", "--cask", "claude-code"], { timeout: 12e4 });
|
|
826
838
|
if (output.includes("already installed") || output.includes("up-to-date")) {
|
|
827
839
|
log("Claude Code is already up to date");
|
|
828
840
|
} else {
|
|
@@ -4213,8 +4225,27 @@ async function stopPolling() {
|
|
|
4213
4225
|
function startManager(opts) {
|
|
4214
4226
|
config = opts;
|
|
4215
4227
|
deployMcpAssets();
|
|
4228
|
+
void ensureHostFrameworkBinaries();
|
|
4216
4229
|
startPolling();
|
|
4217
4230
|
}
|
|
4231
|
+
async function ensureHostFrameworkBinaries() {
|
|
4232
|
+
const apiKey = getApiKey();
|
|
4233
|
+
if (!apiKey) {
|
|
4234
|
+
log("[framework-install] AGT_API_KEY not set \u2014 skipping host framework binary check");
|
|
4235
|
+
return;
|
|
4236
|
+
}
|
|
4237
|
+
try {
|
|
4238
|
+
const exchange = await exchangeApiKey(apiKey);
|
|
4239
|
+
if (!exchange.framework) {
|
|
4240
|
+
log("[framework-install] host has no framework set \u2014 skipping");
|
|
4241
|
+
return;
|
|
4242
|
+
}
|
|
4243
|
+
log(`[framework-install] host framework = ${exchange.framework}`);
|
|
4244
|
+
await ensureFrameworkBinary(exchange.framework);
|
|
4245
|
+
} catch (err) {
|
|
4246
|
+
log(`[framework-install] failed: ${err.message}`);
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4218
4249
|
function deployMcpAssets() {
|
|
4219
4250
|
const targetDir = join2(homedir2(), ".augmented", "_mcp");
|
|
4220
4251
|
mkdirSync(targetDir, { recursive: true });
|