@integrity-labs/agt-cli 0.16.2 → 0.16.6
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.
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveChannels,
|
|
23
23
|
resolveDmTarget,
|
|
24
24
|
wrapScheduledTaskPrompt
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-PBHUXNV6.js";
|
|
26
26
|
import {
|
|
27
27
|
findTaskByTemplate,
|
|
28
28
|
getProjectDir,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
|
|
52
52
|
// src/lib/manager-worker.ts
|
|
53
53
|
import { createHash } from "crypto";
|
|
54
|
-
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, chmodSync, existsSync as existsSync2, rmSync as rmSync2, readdirSync as readdirSync2, statSync, unlinkSync, copyFileSync } from "fs";
|
|
54
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, appendFileSync, mkdirSync as mkdirSync2, chmodSync, existsSync as existsSync2, rmSync as rmSync2, readdirSync as readdirSync2, statSync, unlinkSync, copyFileSync } from "fs";
|
|
55
55
|
import https from "https";
|
|
56
56
|
import { execFileSync as syncExecFile } from "child_process";
|
|
57
57
|
import { join as join3, dirname } from "path";
|
|
@@ -1484,7 +1484,7 @@ function clearAgentCaches(agentId, codeName) {
|
|
|
1484
1484
|
var cachedFrameworkVersion = null;
|
|
1485
1485
|
var lastVersionCheckAt = 0;
|
|
1486
1486
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
1487
|
-
var agtCliVersion = true ? "0.16.
|
|
1487
|
+
var agtCliVersion = true ? "0.16.6" : "dev";
|
|
1488
1488
|
function resolveBrewPath(execFileSync2) {
|
|
1489
1489
|
try {
|
|
1490
1490
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -1956,6 +1956,7 @@ function send(msg) {
|
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
1958
|
var managerLogPath = null;
|
|
1959
|
+
var managerLogWritable = true;
|
|
1959
1960
|
function redactForDiskLog(value) {
|
|
1960
1961
|
try {
|
|
1961
1962
|
return value.replace(/\b(Bearer\s+)[A-Za-z0-9._-]+\b/gi, "$1[REDACTED]").replace(/\bxox[baprs]-[A-Za-z0-9-]+\b/g, "[REDACTED-SLACK]").replace(/\btlk_[A-Za-z0-9._-]+\b/g, "[REDACTED-HOST]").replace(/\bsk-ant-[A-Za-z0-9_-]+\b/g, "[REDACTED-ANTHROPIC]").replace(/\b\d{8,12}:[A-Za-z0-9_-]{30,}\b/g, "[REDACTED-TELEGRAM]").replace(
|
|
@@ -1969,8 +1970,8 @@ function redactForDiskLog(value) {
|
|
|
1969
1970
|
function log(msg) {
|
|
1970
1971
|
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
1971
1972
|
const safeMsg = redactForDiskLog(msg);
|
|
1972
|
-
|
|
1973
|
-
|
|
1973
|
+
const line = `[manager-worker ${ts}] ${safeMsg}
|
|
1974
|
+
`;
|
|
1974
1975
|
if (!managerLogPath) {
|
|
1975
1976
|
try {
|
|
1976
1977
|
managerLogPath = join3(homedir3(), ".augmented", "manager.log");
|
|
@@ -1981,6 +1982,22 @@ function log(msg) {
|
|
|
1981
1982
|
} catch {
|
|
1982
1983
|
}
|
|
1983
1984
|
}
|
|
1985
|
+
let appendedToFile = false;
|
|
1986
|
+
if (managerLogPath && managerLogWritable) {
|
|
1987
|
+
try {
|
|
1988
|
+
appendFileSync(managerLogPath, line, { encoding: "utf-8", mode: 384 });
|
|
1989
|
+
appendedToFile = true;
|
|
1990
|
+
} catch (err) {
|
|
1991
|
+
managerLogWritable = false;
|
|
1992
|
+
process.stderr.write(
|
|
1993
|
+
`[manager-worker ${ts}] [log] manager.log append failed; falling back to stderr-only: ${err.message}
|
|
1994
|
+
`
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
if (!appendedToFile || process.stderr.isTTY === true) {
|
|
1999
|
+
process.stderr.write(line);
|
|
2000
|
+
}
|
|
1984
2001
|
}
|
|
1985
2002
|
function sha256(content) {
|
|
1986
2003
|
return createHash("sha256").update(content, "utf8").digest("hex");
|
|
@@ -6035,6 +6052,9 @@ async function stopPolling(opts = {}) {
|
|
|
6035
6052
|
}
|
|
6036
6053
|
function startManager(opts) {
|
|
6037
6054
|
config = opts;
|
|
6055
|
+
log(
|
|
6056
|
+
`[startup] worker pid=${process.pid} ppid=${process.ppid} node=${process.version} log=${join3(homedir3(), ".augmented", "manager.log")}`
|
|
6057
|
+
);
|
|
6038
6058
|
deployMcpAssets();
|
|
6039
6059
|
void ensureHostFrameworkBinaries();
|
|
6040
6060
|
startPolling();
|