@integrity-labs/agt-cli 0.27.82 → 0.27.84

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.
@@ -9,7 +9,7 @@ import {
9
9
  parseDeliveryTarget,
10
10
  registerFramework,
11
11
  wrapScheduledTaskPrompt
12
- } from "./chunk-GNIA4KN5.js";
12
+ } from "./chunk-TXE2LLKI.js";
13
13
 
14
14
  // ../../packages/core/dist/integrations/registry.js
15
15
  var INTEGRATION_REGISTRY = [
@@ -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-WISOJYIV.js.map