@integrity-labs/agt-cli 0.28.1266 → 0.28.1268
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/{api-client-5CNPCJKS.js → api-client-MH7MLGTA.js} +2 -2
- package/dist/bin/agt.js +5 -5
- package/dist/{chunk-SGYCPC5K.js → chunk-EHZQAT3Q.js} +2 -2
- package/dist/{chunk-WJUGK4R5.js → chunk-ERO3R3Z7.js} +85 -2
- package/dist/chunk-ERO3R3Z7.js.map +1 -0
- package/dist/{chunk-7Z3N4G2Y.js → chunk-TMZDRXAK.js} +3 -3
- package/dist/{claude-pair-runtime-2XKML4U6.js → claude-pair-runtime-3PHBCCUP.js} +2 -2
- package/dist/lib/manager-worker.js +1009 -451
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +6 -1
- package/dist/mcp/slack-channel.js +6 -1
- package/dist/mcp/telegram-channel.js +6 -1
- package/dist/{persistent-session-YBCMFF7T.js → persistent-session-BLZPYHBE.js} +16 -2
- package/dist/{responsiveness-probe-ZOCD6UYO.js → responsiveness-probe-T6O4V2XZ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-WJUGK4R5.js.map +0 -1
- /package/dist/{api-client-5CNPCJKS.js.map → api-client-MH7MLGTA.js.map} +0 -0
- /package/dist/{chunk-SGYCPC5K.js.map → chunk-EHZQAT3Q.js.map} +0 -0
- /package/dist/{chunk-7Z3N4G2Y.js.map → chunk-TMZDRXAK.js.map} +0 -0
- /package/dist/{claude-pair-runtime-2XKML4U6.js.map → claude-pair-runtime-3PHBCCUP.js.map} +0 -0
- /package/dist/{persistent-session-YBCMFF7T.js.map → persistent-session-BLZPYHBE.js.map} +0 -0
- /package/dist/{responsiveness-probe-ZOCD6UYO.js.map → responsiveness-probe-T6O4V2XZ.js.map} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
mintRotatedHostKey,
|
|
16
16
|
probeHostKey,
|
|
17
17
|
setConfigHash
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EHZQAT3Q.js";
|
|
19
19
|
import "./chunk-W2GHPRPZ.js";
|
|
20
20
|
import "./chunk-DGUM43GV.js";
|
|
21
21
|
export {
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
probeHostKey,
|
|
37
37
|
setConfigHash
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=api-client-
|
|
39
|
+
//# sourceMappingURL=api-client-MH7MLGTA.js.map
|
package/dist/bin/agt.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
success,
|
|
32
32
|
table,
|
|
33
33
|
warn
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-TMZDRXAK.js";
|
|
35
35
|
import {
|
|
36
36
|
ApiError,
|
|
37
37
|
PROD_AGT_HOST,
|
|
@@ -42,12 +42,12 @@ import {
|
|
|
42
42
|
getHost,
|
|
43
43
|
getHostId,
|
|
44
44
|
setActiveTeam
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-EHZQAT3Q.js";
|
|
46
46
|
import {
|
|
47
47
|
getProjectDir,
|
|
48
48
|
isSessionResumeDisabled,
|
|
49
49
|
readDirectChatSessionState
|
|
50
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-ERO3R3Z7.js";
|
|
51
51
|
import {
|
|
52
52
|
markDailySessionSpawn,
|
|
53
53
|
sessionFileExists,
|
|
@@ -5207,7 +5207,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
5207
5207
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
5208
5208
|
import chalk17 from "chalk";
|
|
5209
5209
|
import ora15 from "ora";
|
|
5210
|
-
var cliVersion = true ? "0.28.
|
|
5210
|
+
var cliVersion = true ? "0.28.1268" : "dev";
|
|
5211
5211
|
async function fetchLatestVersion() {
|
|
5212
5212
|
const host2 = getHost();
|
|
5213
5213
|
if (!host2) return null;
|
|
@@ -6467,7 +6467,7 @@ function handleError(err) {
|
|
|
6467
6467
|
}
|
|
6468
6468
|
|
|
6469
6469
|
// src/bin/agt.ts
|
|
6470
|
-
var cliVersion2 = true ? "0.28.
|
|
6470
|
+
var cliVersion2 = true ? "0.28.1268" : "dev";
|
|
6471
6471
|
var program = new Command();
|
|
6472
6472
|
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");
|
|
6473
6473
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -103,7 +103,7 @@ function exchangeFailureKind(err) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// src/lib/api-client.ts
|
|
106
|
-
var agtCliVersion = true ? "0.28.
|
|
106
|
+
var agtCliVersion = true ? "0.28.1268" : "dev";
|
|
107
107
|
var lastConfigHash = null;
|
|
108
108
|
function setConfigHash(hash) {
|
|
109
109
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -468,4 +468,4 @@ export {
|
|
|
468
468
|
api,
|
|
469
469
|
getHostId
|
|
470
470
|
};
|
|
471
|
-
//# sourceMappingURL=chunk-
|
|
471
|
+
//# sourceMappingURL=chunk-EHZQAT3Q.js.map
|
|
@@ -2997,10 +2997,11 @@ function tmuxSessionTarget2(session) {
|
|
|
2997
2997
|
n = n.slice(0, -1);
|
|
2998
2998
|
return `=${n}`;
|
|
2999
2999
|
}
|
|
3000
|
+
var TMUX_SESSION_ABSENT = /can't find session|no server running|error connecting to .* \(No such file or directory\)/i;
|
|
3000
3001
|
function probeTmuxSession(tmuxSession) {
|
|
3001
3002
|
try {
|
|
3002
3003
|
execFileSync2("tmux", ["has-session", "-t", tmuxSessionTarget2(tmuxSession)], {
|
|
3003
|
-
stdio: "ignore",
|
|
3004
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
3004
3005
|
timeout: 3e3
|
|
3005
3006
|
});
|
|
3006
3007
|
return "alive";
|
|
@@ -3009,6 +3010,12 @@ function probeTmuxSession(tmuxSession) {
|
|
|
3009
3010
|
const timedOut = e?.code === "ETIMEDOUT" || e?.error?.code === "ETIMEDOUT";
|
|
3010
3011
|
if (e?.code === "ENOENT" || e?.error?.code === "ENOENT" || timedOut)
|
|
3011
3012
|
return "unknown";
|
|
3013
|
+
const status = e.status;
|
|
3014
|
+
if (typeof status !== "number")
|
|
3015
|
+
return "unknown";
|
|
3016
|
+
const stderr = String(e.stderr ?? "").trim();
|
|
3017
|
+
if (stderr && !TMUX_SESSION_ABSENT.test(stderr))
|
|
3018
|
+
return "unknown";
|
|
3012
3019
|
return "dead";
|
|
3013
3020
|
}
|
|
3014
3021
|
}
|
|
@@ -6010,6 +6017,74 @@ function isClaudeProcessAliveInTmux(tmuxSession) {
|
|
|
6010
6017
|
}
|
|
6011
6018
|
return probeClaudeProcessInTmux(tmuxSession) === "alive";
|
|
6012
6019
|
}
|
|
6020
|
+
function dockerPgrepVerdict(stdout) {
|
|
6021
|
+
const m = /pgrep_rc=(\d+)\s*$/.exec(stdout.trim());
|
|
6022
|
+
if (!m) return "unknown";
|
|
6023
|
+
if (m[1] === "0") return "alive";
|
|
6024
|
+
if (m[1] === "1") return "dead";
|
|
6025
|
+
return "unknown";
|
|
6026
|
+
}
|
|
6027
|
+
function dockerContainerStateVerdict(r) {
|
|
6028
|
+
if (r.kind === "ok") return r.stdout.trim() === "false" ? "dead" : "unknown";
|
|
6029
|
+
if (r.kind === "failed" && /No such (object|container)/i.test(r.message)) return "dead";
|
|
6030
|
+
return "unknown";
|
|
6031
|
+
}
|
|
6032
|
+
function parseEtimeSeconds(etime) {
|
|
6033
|
+
const m = /^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/.exec(etime.trim());
|
|
6034
|
+
if (!m) return null;
|
|
6035
|
+
const [, d, h, mm, ss] = m;
|
|
6036
|
+
return (Number(d ?? 0) * 24 + Number(h ?? 0)) * 3600 + Number(mm) * 60 + Number(ss);
|
|
6037
|
+
}
|
|
6038
|
+
function olderSessionProcessFromPs(psOut, tmuxSession, olderThanSeconds) {
|
|
6039
|
+
const needle = new RegExp(`(^|\\s)--name ${escapePgrepRegex(tmuxSession)}(\\s|$)`);
|
|
6040
|
+
let unreadable = false;
|
|
6041
|
+
for (const line2 of psOut.split("\n")) {
|
|
6042
|
+
const m = /^\s*(\d+)\s+(\S+)\s+(.*)$/.exec(line2);
|
|
6043
|
+
if (!m || !needle.test(m[3])) continue;
|
|
6044
|
+
const age = parseEtimeSeconds(m[2]);
|
|
6045
|
+
if (age === null) unreadable = true;
|
|
6046
|
+
else if (age > olderThanSeconds) return "alive";
|
|
6047
|
+
}
|
|
6048
|
+
return unreadable ? "unknown" : "dead";
|
|
6049
|
+
}
|
|
6050
|
+
function probeSessionProcess(codeName) {
|
|
6051
|
+
if (effectiveIsolationMode(codeName) === "docker") {
|
|
6052
|
+
const r = hardBoundedExecFile(
|
|
6053
|
+
"docker",
|
|
6054
|
+
// "[c]laude" (CodeRabbit on #7630): the probe's own `sh -c` command line
|
|
6055
|
+
// contains the pattern text, and procps pgrep does not skip ancestors, so
|
|
6056
|
+
// a plain "claude" matches this shell and reads alive in an empty
|
|
6057
|
+
// container. The bracket class still matches a real claude command line.
|
|
6058
|
+
["exec", `agt-${codeName}`, "sh", "-c", 'pgrep -f "[c]laude" >/dev/null 2>&1; echo "pgrep_rc=$?"'],
|
|
6059
|
+
{ timeoutMs: 8e3 }
|
|
6060
|
+
);
|
|
6061
|
+
const verdict = dockerPgrepVerdict(r.kind === "ok" ? r.stdout : "");
|
|
6062
|
+
if (verdict !== "unknown") return verdict;
|
|
6063
|
+
return dockerContainerStateVerdict(
|
|
6064
|
+
hardBoundedExecFile("docker", ["inspect", "-f", "{{.State.Running}}", `agt-${codeName}`], { timeoutMs: 8e3 })
|
|
6065
|
+
);
|
|
6066
|
+
}
|
|
6067
|
+
return probeClaudeProcessInTmux(`agt-${codeName}`);
|
|
6068
|
+
}
|
|
6069
|
+
function probeSessionProcessOlderThan(codeName, olderThanSeconds) {
|
|
6070
|
+
if (effectiveIsolationMode(codeName) === "docker") return "unknown";
|
|
6071
|
+
try {
|
|
6072
|
+
const out = execFileSync3("ps", ["-A", "-ww", "-o", "pid=,etime=,command="], { encoding: "utf-8", timeout: 3e3, maxBuffer: 16 * 1024 * 1024 });
|
|
6073
|
+
return olderSessionProcessFromPs(out, `agt-${codeName}`, olderThanSeconds);
|
|
6074
|
+
} catch {
|
|
6075
|
+
return "unknown";
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
function killStragglerProcess(codeName, signal = "TERM") {
|
|
6079
|
+
if (effectiveIsolationMode(codeName) === "docker") return false;
|
|
6080
|
+
const pattern = `(^|[[:space:]])--name ${escapePgrepRegex(`agt-${codeName}`)}([[:space:]]|$)`;
|
|
6081
|
+
try {
|
|
6082
|
+
execFileSync3("pkill", [`-${signal}`, "-f", "--", pattern], { stdio: "ignore", timeout: 3e3 });
|
|
6083
|
+
return true;
|
|
6084
|
+
} catch {
|
|
6085
|
+
return false;
|
|
6086
|
+
}
|
|
6087
|
+
}
|
|
6013
6088
|
function takeZombieDetection(codeName) {
|
|
6014
6089
|
const record = pendingZombieDetections.get(codeName);
|
|
6015
6090
|
if (record) pendingZombieDetections.delete(codeName);
|
|
@@ -6294,6 +6369,7 @@ export {
|
|
|
6294
6369
|
resolveContainerMemory,
|
|
6295
6370
|
seedContainerMemory,
|
|
6296
6371
|
syncContainerMemory,
|
|
6372
|
+
sanitizeMcpJson,
|
|
6297
6373
|
denyWebFetchForToolsContent,
|
|
6298
6374
|
webFetchRestartNeeded,
|
|
6299
6375
|
webFetchBaselineValue,
|
|
@@ -6405,6 +6481,13 @@ export {
|
|
|
6405
6481
|
injectMessageWithStatus,
|
|
6406
6482
|
stopPersistentSession,
|
|
6407
6483
|
getSessionState,
|
|
6484
|
+
dockerPgrepVerdict,
|
|
6485
|
+
dockerContainerStateVerdict,
|
|
6486
|
+
parseEtimeSeconds,
|
|
6487
|
+
olderSessionProcessFromPs,
|
|
6488
|
+
probeSessionProcess,
|
|
6489
|
+
probeSessionProcessOlderThan,
|
|
6490
|
+
killStragglerProcess,
|
|
6408
6491
|
takeZombieDetection,
|
|
6409
6492
|
isSessionHealthy,
|
|
6410
6493
|
resetRestartCount,
|
|
@@ -6413,4 +6496,4 @@ export {
|
|
|
6413
6496
|
stopAllSessionsAndWait,
|
|
6414
6497
|
getProjectDir
|
|
6415
6498
|
};
|
|
6416
|
-
//# sourceMappingURL=chunk-
|
|
6499
|
+
//# sourceMappingURL=chunk-ERO3R3Z7.js.map
|