@integrity-labs/agt-cli 0.12.6 → 0.12.7

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 CHANGED
@@ -3717,7 +3717,7 @@ import { execFileSync, execSync } from "child_process";
3717
3717
  import { existsSync as existsSync5, realpathSync } from "fs";
3718
3718
  import chalk20 from "chalk";
3719
3719
  import ora15 from "ora";
3720
- var cliVersion = true ? "0.12.6" : "dev";
3720
+ var cliVersion = true ? "0.12.7" : "dev";
3721
3721
  async function fetchLatestVersion() {
3722
3722
  const host2 = getHost();
3723
3723
  if (!host2) return null;
@@ -4166,7 +4166,7 @@ function handleError(err) {
4166
4166
  }
4167
4167
 
4168
4168
  // src/bin/agt.ts
4169
- var cliVersion2 = true ? "0.12.6" : "dev";
4169
+ var cliVersion2 = true ? "0.12.7" : "dev";
4170
4170
  var program = new Command();
4171
4171
  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");
4172
4172
  program.hook("preAction", (thisCommand) => {
@@ -40,7 +40,7 @@ import {
40
40
 
41
41
  // src/lib/manager-worker.ts
42
42
  import { createHash } from "crypto";
43
- import { readFileSync, writeFileSync, mkdirSync, existsSync, rmSync, readdirSync, statSync, unlinkSync, copyFileSync } from "fs";
43
+ import { readFileSync, writeFileSync, appendFileSync, mkdirSync, chmodSync, existsSync, rmSync, readdirSync, statSync, unlinkSync, copyFileSync } from "fs";
44
44
  import https from "https";
45
45
  import { join as join2, dirname } from "path";
46
46
  import { homedir as homedir2 } from "os";
@@ -1119,10 +1119,35 @@ function send(msg) {
1119
1119
  log(`Error: ${msg.message}`);
1120
1120
  }
1121
1121
  }
1122
+ var managerLogPath = null;
1123
+ function redactForDiskLog(value) {
1124
+ try {
1125
+ 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(/\b([A-Z0-9_]*(?:TOKEN|SECRET|API[_-]?KEY|PASSWORD)[A-Z0-9_]*)=\S+/gi, "$1=[REDACTED]");
1126
+ } catch {
1127
+ return "[REDACTED]";
1128
+ }
1129
+ }
1122
1130
  function log(msg) {
1123
1131
  const ts = (/* @__PURE__ */ new Date()).toISOString();
1124
- process.stderr.write(`[manager-worker ${ts}] ${msg}
1132
+ const safeMsg = redactForDiskLog(msg);
1133
+ const rawStderrOptIn = process.env["AGT_LOG_RAW_SECRETS"] === "1" && process.stderr.isTTY;
1134
+ const stderrMsg = rawStderrOptIn ? msg : safeMsg;
1135
+ process.stderr.write(`[manager-worker ${ts}] ${stderrMsg}
1125
1136
  `);
1137
+ try {
1138
+ if (!managerLogPath) {
1139
+ managerLogPath = join2(homedir2(), ".augmented", "manager.log");
1140
+ mkdirSync(dirname(managerLogPath), { recursive: true });
1141
+ if (!existsSync(managerLogPath)) {
1142
+ appendFileSync(managerLogPath, "", { mode: 384 });
1143
+ } else {
1144
+ chmodSync(managerLogPath, 384);
1145
+ }
1146
+ }
1147
+ appendFileSync(managerLogPath, `[manager-worker ${ts}] ${safeMsg}
1148
+ `);
1149
+ } catch {
1150
+ }
1126
1151
  }
1127
1152
  function sha256(content) {
1128
1153
  return createHash("sha256").update(content, "utf8").digest("hex");