@integrity-labs/agt-cli 0.27.82 → 0.27.83

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
@@ -28,7 +28,7 @@ import {
28
28
  success,
29
29
  table,
30
30
  warn
31
- } from "../chunk-AN5X6CN2.js";
31
+ } from "../chunk-HTXXJBB7.js";
32
32
  import {
33
33
  CHANNEL_REGISTRY,
34
34
  DEPLOYMENT_TEMPLATES,
@@ -4930,7 +4930,7 @@ import { execFileSync, execSync } from "child_process";
4930
4930
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4931
4931
  import chalk18 from "chalk";
4932
4932
  import ora16 from "ora";
4933
- var cliVersion = true ? "0.27.82" : "dev";
4933
+ var cliVersion = true ? "0.27.83" : "dev";
4934
4934
  async function fetchLatestVersion() {
4935
4935
  const host2 = getHost();
4936
4936
  if (!host2) return null;
@@ -5853,7 +5853,7 @@ function handleError(err) {
5853
5853
  }
5854
5854
 
5855
5855
  // src/bin/agt.ts
5856
- var cliVersion2 = true ? "0.27.82" : "dev";
5856
+ var cliVersion2 = true ? "0.27.83" : "dev";
5857
5857
  var program = new Command();
5858
5858
  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");
5859
5859
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -2369,8 +2369,12 @@ var LITERAL_SECRET_PATTERNS = [
2369
2369
  { name: "agt_host_api_key", re: /^tlk_/ },
2370
2370
  // Composio / generic api-key prefix — `ak_<...>`
2371
2371
  { name: "composio_api_key", re: /^ak_/ },
2372
- // Telegram bot token — `<10-digit bot id>:AAE<...>` (BotFather format).
2373
- { name: "telegram_bot_token", re: /^\d{10}:AAE/ },
2372
+ // Telegram bot token — `<bot id>:AA<...>` (BotFather format). ENG-5901
2373
+ // PR 4: the original `\d{10}:AAE` (from the issue AC) was too narrow —
2374
+ // live tokens on agt-aws-1 carry `AA` + a varying third character
2375
+ // (don/scout/stirling all had AA-not-E tokens the lint and migration
2376
+ // missed). Bot ids are 8–12 digits; the token part always starts `AA`.
2377
+ { name: "telegram_bot_token", re: /^\d{8,12}:AA[A-Za-z0-9_-]/ },
2374
2378
  // ENG-5901 extension beyond the original AC's five patterns: a literal
2375
2379
  // JWT (`eyJ...`) is the shape of a leaked AGT_API_KEY, which the
2376
2380
  // value-prefix patterns above would otherwise miss. Header values often
@@ -3963,27 +3967,30 @@ function migrateExistingLiteralSecrets(codeName) {
3963
3967
  existingEnvKeys = new Set(parseEnvFileEntries(readFileSync5(join4(getAgentDir(codeName), ".env.integrations"), "utf-8")).keys());
3964
3968
  } catch {
3965
3969
  }
3966
- const findings = scanConfigForLiteralSecrets(config);
3967
- if (findings.length === 0)
3968
- return;
3969
3970
  const updates = {};
3970
- const unmapped = [];
3971
3971
  let hoisted = 0;
3972
- for (const f of findings) {
3973
- const entry = config.mcpServers?.[f.server];
3974
- const block = f.location === "env" ? entry?.env : entry?.headers;
3975
- const envVar = MIGRATABLE_FIELD_TO_ENV_VAR[f.field];
3976
- const value = block?.[f.field];
3977
- if (!block || !envVar || typeof value !== "string") {
3978
- unmapped.push(`${f.server}.${f.field}`);
3972
+ for (const raw of Object.values(config.mcpServers ?? {})) {
3973
+ if (typeof raw !== "object" || raw === null)
3979
3974
  continue;
3975
+ const entry = raw;
3976
+ for (const block of [entry.env, entry.headers]) {
3977
+ if (!block)
3978
+ continue;
3979
+ for (const [field, envVar] of Object.entries(MIGRATABLE_FIELD_TO_ENV_VAR)) {
3980
+ const value = block[field];
3981
+ if (typeof value !== "string" || value.length === 0 || value.includes("${"))
3982
+ continue;
3983
+ if (envVar !== "AGT_API_KEY" && !existingEnvKeys.has(envVar)) {
3984
+ updates[envVar] = value;
3985
+ }
3986
+ block[field] = `\${${envVar}}`;
3987
+ hoisted++;
3988
+ }
3980
3989
  }
3981
- if (envVar !== "AGT_API_KEY" && !existingEnvKeys.has(envVar)) {
3982
- updates[envVar] = value;
3983
- }
3984
- block[f.field] = `\${${envVar}}`;
3985
- hoisted++;
3986
3990
  }
3991
+ const unmapped = scanConfigForLiteralSecrets(config).map((f) => `${f.server}.${f.field}`);
3992
+ if (hoisted === 0 && unmapped.length === 0)
3993
+ return;
3987
3994
  if (hoisted === 0) {
3988
3995
  process.stderr.write(`[mcp-migrate] [no-mappable-literals] agent=${codeName} unmapped=${unmapped.join(",")}
3989
3996
  `);
@@ -7557,4 +7564,4 @@ export {
7557
7564
  managerInstallSystemUnitCommand,
7558
7565
  managerUninstallSystemUnitCommand
7559
7566
  };
7560
- //# sourceMappingURL=chunk-AN5X6CN2.js.map
7567
+ //# sourceMappingURL=chunk-HTXXJBB7.js.map