@integrity-labs/agt-cli 0.28.680 → 0.28.681

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
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-4JTDWOBW.js";
43
+ } from "../chunk-Q44TIWZN.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
46
  } from "../chunk-ZKNKHAHX.js";
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
4909
4909
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4910
4910
  import chalk18 from "chalk";
4911
4911
  import ora16 from "ora";
4912
- var cliVersion = true ? "0.28.680" : "dev";
4912
+ var cliVersion = true ? "0.28.681" : "dev";
4913
4913
  async function fetchLatestVersion() {
4914
4914
  const host2 = getHost();
4915
4915
  if (!host2) return null;
@@ -6089,7 +6089,7 @@ function handleError(err) {
6089
6089
  }
6090
6090
 
6091
6091
  // src/bin/agt.ts
6092
- var cliVersion2 = true ? "0.28.680" : "dev";
6092
+ var cliVersion2 = true ? "0.28.681" : "dev";
6093
6093
  var program = new Command();
6094
6094
  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");
6095
6095
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -370,7 +370,7 @@ function formatMirrorMismatch(m) {
370
370
  }
371
371
 
372
372
  // ../../packages/core/dist/provisioning/secret-file-tmpfs.js
373
- import { statfsSync, accessSync, constants as fsConstants, lstatSync, readlinkSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync, chmodSync as chmodSync2, rmSync, symlinkSync } from "fs";
373
+ import { statfsSync, accessSync, constants as fsConstants, lstatSync, readlinkSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync, chmodSync as chmodSync2, rmSync, symlinkSync, existsSync as existsSync2 } from "fs";
374
374
  import { dirname, join } from "path";
375
375
  var SECRET_FILE_MODE = 384;
376
376
  var TMPFS_MAGIC = 16914836;
@@ -432,16 +432,32 @@ function ensureSafeSecretsRoot(base) {
432
432
  }
433
433
  return root;
434
434
  }
435
+ function ensureTmpfsTargetSeeded(tmpfsTarget, migratedContent, mode) {
436
+ let exists = true;
437
+ let empty = false;
438
+ try {
439
+ empty = readFileSync2(tmpfsTarget, "utf-8").length === 0;
440
+ } catch {
441
+ exists = false;
442
+ }
443
+ if (!exists) {
444
+ writeFileSync2(tmpfsTarget, migratedContent ?? "", { mode });
445
+ } else if (empty && migratedContent !== null) {
446
+ writeFileSync2(tmpfsTarget, migratedContent, { mode });
447
+ }
448
+ }
435
449
  function ensureSecretFileTmpfsBacked(persistentPath, tmpfsTarget, mode = SECRET_FILE_MODE) {
436
450
  mkdirSync(dirname(tmpfsTarget), { recursive: true, mode: 448 });
437
451
  let migratedContent = null;
452
+ let alreadyLinked = false;
438
453
  try {
439
454
  const st = lstatSync(persistentPath);
440
455
  if (st.isSymbolicLink()) {
441
456
  if (readlinkSync(persistentPath) === tmpfsTarget) {
442
- return { backed: true, migrated: false };
457
+ alreadyLinked = true;
458
+ } else {
459
+ rmSync(persistentPath, { force: true });
443
460
  }
444
- rmSync(persistentPath, { force: true });
445
461
  } else {
446
462
  try {
447
463
  migratedContent = readFileSync2(persistentPath, "utf-8");
@@ -452,20 +468,42 @@ function ensureSecretFileTmpfsBacked(persistentPath, tmpfsTarget, mode = SECRET_
452
468
  }
453
469
  } catch {
454
470
  }
455
- if (migratedContent !== null) {
456
- let targetEmpty = true;
457
- try {
458
- targetEmpty = readFileSync2(tmpfsTarget, "utf-8").length === 0;
459
- } catch {
460
- targetEmpty = true;
461
- }
462
- if (targetEmpty)
463
- writeFileSync2(tmpfsTarget, migratedContent, { mode });
464
- }
471
+ ensureTmpfsTargetSeeded(tmpfsTarget, migratedContent, mode);
472
+ if (alreadyLinked)
473
+ return { backed: true, migrated: false };
465
474
  mkdirSync(dirname(persistentPath), { recursive: true });
466
475
  symlinkSync(tmpfsTarget, persistentPath);
467
476
  return { backed: true, migrated: migratedContent !== null };
468
477
  }
478
+ function healTmpfsSecretSymlink(persistentPath, expectedTarget) {
479
+ let target;
480
+ try {
481
+ if (!lstatSync(persistentPath).isSymbolicLink())
482
+ return false;
483
+ target = readlinkSync(persistentPath);
484
+ } catch {
485
+ return false;
486
+ }
487
+ if (target !== expectedTarget)
488
+ return false;
489
+ if (existsSync2(target))
490
+ return false;
491
+ try {
492
+ mkdirSync(dirname(target), { recursive: true, mode: 448 });
493
+ writeFileSync2(target, "", { mode: SECRET_FILE_MODE });
494
+ return true;
495
+ } catch {
496
+ return false;
497
+ }
498
+ }
499
+ function healAgentTmpfsSecretSymlinks(agentDir, projectDir, agentKey) {
500
+ const base = resolveTmpfsBase();
501
+ if (base === null)
502
+ return;
503
+ const agentRamDir = join(base, TMPFS_SECRETS_SUBDIR, agentKey);
504
+ healTmpfsSecretSymlink(join(agentDir, ".env.integrations"), join(agentRamDir, "env.integrations"));
505
+ healTmpfsSecretSymlink(join(projectDir, ".env.integrations"), join(agentRamDir, "project.env.integrations"));
506
+ }
469
507
  function ensureSecretFileNotTmpfsBacked(persistentPath) {
470
508
  let st;
471
509
  try {
@@ -547,13 +585,13 @@ function extractCommandNotFound(stderr) {
547
585
  }
548
586
 
549
587
  // ../../packages/core/dist/provisioning/frameworks/claudecode/index.js
550
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, existsSync as existsSync4, chmodSync as chmodSync5, readdirSync, rmSync as rmSync3, copyFileSync, lstatSync as lstatSync2, realpathSync, symlinkSync as symlinkSync2, readlinkSync as readlinkSync2, renameSync as renameSync4, opendirSync } from "fs";
588
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, existsSync as existsSync5, chmodSync as chmodSync5, readdirSync, rmSync as rmSync3, copyFileSync, lstatSync as lstatSync2, realpathSync, symlinkSync as symlinkSync2, readlinkSync as readlinkSync2, renameSync as renameSync4, opendirSync } from "fs";
551
589
  import { join as join4, relative, dirname as dirname4, basename } from "path";
552
590
  import { homedir as homedir3 } from "os";
553
591
  import { execFile } from "child_process";
554
592
 
555
593
  // ../../packages/core/dist/integrations/xurl-config.js
556
- import { chmodSync as chmodSync3, existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync3, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "fs";
594
+ import { chmodSync as chmodSync3, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "fs";
557
595
  import { homedir } from "os";
558
596
  import { dirname as dirname2, join as join2 } from "path";
559
597
  import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
@@ -681,7 +719,7 @@ function writeXurlStoreForIntegrations(integrations, filePath = getXurlStorePath
681
719
  if (Object.keys(agtApps).length === 0)
682
720
  return null;
683
721
  let existing = null;
684
- if (existsSync2(filePath)) {
722
+ if (existsSync3(filePath)) {
685
723
  let raw;
686
724
  try {
687
725
  raw = readFileSync3(filePath, "utf-8");
@@ -715,7 +753,7 @@ function writeXurlStoreForIntegrations(integrations, filePath = getXurlStorePath
715
753
  }
716
754
 
717
755
  // ../../packages/core/dist/integrations/framer-credentials.js
718
- import { chmodSync as chmodSync4, existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync3, rmSync as rmSync2, statSync, unlinkSync as unlinkSync3, writeFileSync as writeFileSync4 } from "fs";
756
+ import { chmodSync as chmodSync4, existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync3, rmSync as rmSync2, statSync, unlinkSync as unlinkSync3, writeFileSync as writeFileSync4 } from "fs";
719
757
  import { homedir as homedir2 } from "os";
720
758
  import { dirname as dirname3, join as join3 } from "path";
721
759
  var FRAMER_PROJECTS_CONFIG_VERSION = 2;
@@ -923,7 +961,7 @@ function writeFramerStoreForIntegrations(integrations, filePath = getFramerProje
923
961
  if (inputs.length === 0 && previouslyManagedIds.length === 0)
924
962
  return null;
925
963
  let existing = null;
926
- if (existsSync3(filePath)) {
964
+ if (existsSync4(filePath)) {
927
965
  try {
928
966
  existing = readFileSync4(filePath, "utf-8");
929
967
  } catch {
@@ -1658,6 +1696,12 @@ function writeEnvIntegrationsForAgent(codeName, args) {
1658
1696
  existing = readFileSync5(envPath, "utf-8");
1659
1697
  } catch {
1660
1698
  }
1699
+ if (isSecretFileTmpfsBackingEnabled()) {
1700
+ try {
1701
+ healAgentTmpfsSecretSymlinks(agentDir, join4(agentDir, "project"), basename(agentDir));
1702
+ } catch {
1703
+ }
1704
+ }
1661
1705
  if (existing === null && Object.keys(args.updates).length === 0)
1662
1706
  return;
1663
1707
  if (isSecretFileTmpfsBackingEnabled()) {
@@ -1866,7 +1910,7 @@ function migrateAgentDirToIdKeyed(codeName, agentId, opts = {}) {
1866
1910
  } catch {
1867
1911
  codeNameKind = "absent";
1868
1912
  }
1869
- const idExists = existsSync4(idPath);
1913
+ const idExists = existsSync5(idPath);
1870
1914
  if (codeNameKind === "symlink") {
1871
1915
  const target = readlinkSync2(codeNamePath);
1872
1916
  if (target !== agentId) {
@@ -1904,7 +1948,7 @@ function migrateLegacyClaudecodeDir(codeName, log2) {
1904
1948
  if (migratedCodeNames.has(codeName))
1905
1949
  return;
1906
1950
  const legacyRoot = join4(getHomeDir(), ".augmented", codeName, "claudecode");
1907
- if (!existsSync4(legacyRoot)) {
1951
+ if (!existsSync5(legacyRoot)) {
1908
1952
  migratedCodeNames.add(codeName);
1909
1953
  return;
1910
1954
  }
@@ -1922,7 +1966,7 @@ function migrateLegacyClaudecodeDir(codeName, log2) {
1922
1966
  walkAndMigrate(src, dest);
1923
1967
  continue;
1924
1968
  }
1925
- if (entry.name === ".mcp.json" && existsSync4(dest)) {
1969
+ if (entry.name === ".mcp.json" && existsSync5(dest)) {
1926
1970
  try {
1927
1971
  const oldCfg = JSON.parse(readFileSync5(src, "utf-8"));
1928
1972
  const newCfg = JSON.parse(readFileSync5(dest, "utf-8"));
@@ -1934,7 +1978,7 @@ function migrateLegacyClaudecodeDir(codeName, log2) {
1934
1978
  }
1935
1979
  continue;
1936
1980
  }
1937
- if (!existsSync4(dest)) {
1981
+ if (!existsSync5(dest)) {
1938
1982
  copyFileSync(src, dest);
1939
1983
  continue;
1940
1984
  }
@@ -2172,7 +2216,7 @@ function deployArtifactsToProject(codeName, provisionDir) {
2172
2216
  const dest = join4(projectDir, file);
2173
2217
  try {
2174
2218
  const srcContent = readFileSync5(src, "utf-8");
2175
- if (file === "CLAUDE.md" && existsSync4(dest)) {
2219
+ if (file === "CLAUDE.md" && existsSync5(dest)) {
2176
2220
  const destContent = readFileSync5(dest, "utf-8");
2177
2221
  const stripIndex = (s) => s.replace(new RegExp(`${SKILLS_START}[\\s\\S]*?${SKILLS_END}`), "").trimEnd();
2178
2222
  if (stripIndex(srcContent) === stripIndex(destContent))
@@ -2198,8 +2242,8 @@ function deployArtifactsToProject(codeName, provisionDir) {
2198
2242
  const skillsDir = join4(provisionDir, ".claude", "skills");
2199
2243
  const destSkillsDir = join4(projectDir, ".claude", "skills");
2200
2244
  try {
2201
- if (existsSync4(destSkillsDir)) {
2202
- const srcFolders = existsSync4(skillsDir) ? new Set(readdirSync(skillsDir)) : /* @__PURE__ */ new Set();
2245
+ if (existsSync5(destSkillsDir)) {
2246
+ const srcFolders = existsSync5(skillsDir) ? new Set(readdirSync(skillsDir)) : /* @__PURE__ */ new Set();
2203
2247
  for (const folder of readdirSync(destSkillsDir)) {
2204
2248
  if (folder.startsWith("knowledge-") || folder === "core-knowledge" && !srcFolders.has(folder)) {
2205
2249
  try {
@@ -2209,16 +2253,16 @@ function deployArtifactsToProject(codeName, provisionDir) {
2209
2253
  }
2210
2254
  }
2211
2255
  }
2212
- if (existsSync4(skillsDir)) {
2256
+ if (existsSync5(skillsDir)) {
2213
2257
  for (const skillFolder of readdirSync(skillsDir)) {
2214
2258
  const srcSkillFile = join4(skillsDir, skillFolder, "SKILL.md");
2215
- if (!existsSync4(srcSkillFile))
2259
+ if (!existsSync5(srcSkillFile))
2216
2260
  continue;
2217
2261
  const destFolder = join4(destSkillsDir, skillFolder);
2218
2262
  const destFile = join4(destFolder, "SKILL.md");
2219
2263
  const srcContent = readFileSync5(srcSkillFile, "utf-8");
2220
2264
  try {
2221
- if (existsSync4(destFile) && readFileSync5(destFile, "utf-8") === srcContent)
2265
+ if (existsSync5(destFile) && readFileSync5(destFile, "utf-8") === srcContent)
2222
2266
  continue;
2223
2267
  } catch {
2224
2268
  }
@@ -2231,9 +2275,9 @@ function deployArtifactsToProject(codeName, provisionDir) {
2231
2275
  const agentsDir = join4(provisionDir, ".claude", "agents");
2232
2276
  const destAgentsDir = join4(projectDir, ".claude", "agents");
2233
2277
  try {
2234
- if (existsSync4(agentsDir)) {
2278
+ if (existsSync5(agentsDir)) {
2235
2279
  const sourceAgentFiles = new Set(readdirSync(agentsDir).filter((f) => f.endsWith(".md")));
2236
- if (existsSync4(destAgentsDir)) {
2280
+ if (existsSync5(destAgentsDir)) {
2237
2281
  for (const destFile of readdirSync(destAgentsDir)) {
2238
2282
  if (!destFile.endsWith(".md"))
2239
2283
  continue;
@@ -2250,7 +2294,7 @@ function deployArtifactsToProject(codeName, provisionDir) {
2250
2294
  const destPath = join4(destAgentsDir, agentFile);
2251
2295
  const srcContent = readFileSync5(srcPath, "utf-8");
2252
2296
  try {
2253
- if (existsSync4(destPath) && readFileSync5(destPath, "utf-8") === srcContent)
2297
+ if (existsSync5(destPath) && readFileSync5(destPath, "utf-8") === srcContent)
2254
2298
  continue;
2255
2299
  } catch {
2256
2300
  }
@@ -2263,8 +2307,8 @@ function deployArtifactsToProject(codeName, provisionDir) {
2263
2307
  const workflowsDir = join4(provisionDir, ".claude", "workflows");
2264
2308
  const destWorkflowsDir = join4(projectDir, ".claude", "workflows");
2265
2309
  try {
2266
- const sourceWorkflowFiles = existsSync4(workflowsDir) ? new Set(readdirSync(workflowsDir).filter((f) => f.endsWith(".js"))) : /* @__PURE__ */ new Set();
2267
- if (existsSync4(destWorkflowsDir)) {
2310
+ const sourceWorkflowFiles = existsSync5(workflowsDir) ? new Set(readdirSync(workflowsDir).filter((f) => f.endsWith(".js"))) : /* @__PURE__ */ new Set();
2311
+ if (existsSync5(destWorkflowsDir)) {
2268
2312
  for (const destFile of readdirSync(destWorkflowsDir)) {
2269
2313
  if (!destFile.endsWith(".js"))
2270
2314
  continue;
@@ -2281,7 +2325,7 @@ function deployArtifactsToProject(codeName, provisionDir) {
2281
2325
  const destPath = join4(destWorkflowsDir, workflowFile);
2282
2326
  const srcContent = readFileSync5(srcPath, "utf-8");
2283
2327
  try {
2284
- if (existsSync4(destPath) && readFileSync5(destPath, "utf-8") === srcContent)
2328
+ if (existsSync5(destPath) && readFileSync5(destPath, "utf-8") === srcContent)
2285
2329
  continue;
2286
2330
  } catch {
2287
2331
  }
@@ -2330,12 +2374,12 @@ function deployArtifactsToProject(codeName, provisionDir) {
2330
2374
  try {
2331
2375
  const gitDir = join4(projectDir, ".git");
2332
2376
  const hookSrc = join4(provisionDir, ".git-hooks", "pre-commit");
2333
- if (existsSync4(gitDir) && existsSync4(hookSrc)) {
2377
+ if (existsSync5(gitDir) && existsSync5(hookSrc)) {
2334
2378
  const hooksDir = join4(gitDir, "hooks");
2335
2379
  mkdirSync4(hooksDir, { recursive: true });
2336
2380
  const hookDest = join4(hooksDir, "pre-commit");
2337
2381
  const srcContent = readFileSync5(hookSrc, "utf-8");
2338
- const upToDate = existsSync4(hookDest) && readFileSync5(hookDest, "utf-8") === srcContent;
2382
+ const upToDate = existsSync5(hookDest) && readFileSync5(hookDest, "utf-8") === srcContent;
2339
2383
  if (!upToDate)
2340
2384
  writeFileSync5(hookDest, srcContent);
2341
2385
  chmodSync5(hookDest, 493);
@@ -4888,7 +4932,7 @@ ${sections}`
4888
4932
  }
4889
4933
  if (st.isSymbolicLink() || !st.isDirectory())
4890
4934
  continue;
4891
- if (!existsSync4(join4(agentRoot, "registration.json")))
4935
+ if (!existsSync5(join4(agentRoot, "registration.json")))
4892
4936
  continue;
4893
4937
  let codeName = entry;
4894
4938
  try {
@@ -4921,7 +4965,7 @@ ${sections}`
4921
4965
  framework: "claude-code",
4922
4966
  registered_at: (/* @__PURE__ */ new Date()).toISOString()
4923
4967
  }, null, 2));
4924
- if (existsSync4(teamDir)) {
4968
+ if (existsSync5(teamDir)) {
4925
4969
  deployArtifactsToProject(codeName, teamDir);
4926
4970
  }
4927
4971
  return true;
@@ -4933,7 +4977,7 @@ ${sections}`
4933
4977
  try {
4934
4978
  const agentDir = getAgentDir(codeName);
4935
4979
  const regFile = join4(agentDir, "registration.json");
4936
- if (existsSync4(regFile)) {
4980
+ if (existsSync5(regFile)) {
4937
4981
  const { unlinkSync: unlinkSync5 } = await import("fs");
4938
4982
  unlinkSync5(regFile);
4939
4983
  }
@@ -5174,8 +5218,8 @@ ${sections}`
5174
5218
  const localSlackChannel = join4(getHomeDir(), ".augmented", "_mcp", "slack-channel.js");
5175
5219
  const slackAvatarEnvUrl = resolveAvatarEnvUrl(options?.agentAvatarUrl).url;
5176
5220
  const slackEntry = {
5177
- command: existsSync4(localSlackChannel) ? "node" : "npx",
5178
- args: existsSync4(localSlackChannel) ? [localSlackChannel] : ["-y", "@augmented/claude-code-channel-slack"],
5221
+ command: existsSync5(localSlackChannel) ? "node" : "npx",
5222
+ args: existsSync5(localSlackChannel) ? [localSlackChannel] : ["-y", "@augmented/claude-code-channel-slack"],
5179
5223
  env: {
5180
5224
  SLACK_BOT_TOKEN: "${SLACK_BOT_TOKEN}",
5181
5225
  ...appToken ? { SLACK_APP_TOKEN: "${SLACK_APP_TOKEN}" } : {},
@@ -5275,7 +5319,7 @@ ${sections}`
5275
5319
  }
5276
5320
  syncMcpToProject(codeName);
5277
5321
  const staleChannelsPath = join4(getProjectDir(codeName), ".mcp-channels.json");
5278
- if (existsSync4(staleChannelsPath)) {
5322
+ if (existsSync5(staleChannelsPath)) {
5279
5323
  try {
5280
5324
  rmSync3(staleChannelsPath, { force: true });
5281
5325
  } catch {
@@ -5383,7 +5427,7 @@ ${sections}`
5383
5427
  }, ["SLACK_BOT_TOKEN", "SLACK_APP_TOKEN"])
5384
5428
  });
5385
5429
  const slackAvatarEnvUrl = resolveAvatarEnvUrl(options?.agentAvatarUrl).url;
5386
- if (isPersistent && existsSync4(localSlackChannel)) {
5430
+ if (isPersistent && existsSync5(localSlackChannel)) {
5387
5431
  mcpServers["slack"] = {
5388
5432
  command: "node",
5389
5433
  args: [localSlackChannel],
@@ -5506,7 +5550,7 @@ ${sections}`
5506
5550
  ...senderPolicyInternalOnly ? { MSTEAMS_INTERNAL_ONLY: "true" } : {},
5507
5551
  ...senderPolicyInternalOnly && tenantId !== "common" ? { MSTEAMS_HOME_TENANT_ID: tenantId } : {}
5508
5552
  };
5509
- if (isPersistent && existsSync4(localTeamsChannel)) {
5553
+ if (isPersistent && existsSync5(localTeamsChannel)) {
5510
5554
  mcpServers["msteams"] = {
5511
5555
  command: "node",
5512
5556
  args: [localTeamsChannel],
@@ -5570,7 +5614,7 @@ ${sections}`
5570
5614
  },
5571
5615
  hasChannelCredentials(codeName, channelId) {
5572
5616
  const provisionMcpPath = join4(getAgentDir(codeName), "provision", ".mcp.json");
5573
- if (!existsSync4(provisionMcpPath))
5617
+ if (!existsSync5(provisionMcpPath))
5574
5618
  return false;
5575
5619
  try {
5576
5620
  const parsed = JSON.parse(readFileSync5(provisionMcpPath, "utf-8"));
@@ -6133,7 +6177,7 @@ ${sections}`
6133
6177
  throw new Error(`Path traversal detected: ${file.relativePath} resolves outside ${skillDir}`);
6134
6178
  }
6135
6179
  mkdirSync4(join4(filePath, ".."), { recursive: true });
6136
- if (isPluginManaged && existsSync4(filePath)) {
6180
+ if (isPluginManaged && existsSync5(filePath)) {
6137
6181
  try {
6138
6182
  chmodSync5(filePath, READ_WRITE_MODE);
6139
6183
  } catch {
@@ -6345,13 +6389,13 @@ function jsonOutput(data) {
6345
6389
  }
6346
6390
 
6347
6391
  // src/lib/config.ts
6348
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync5 } from "fs";
6392
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync6 } from "fs";
6349
6393
  import { join as join5 } from "path";
6350
6394
  import { homedir as homedir4 } from "os";
6351
6395
  var AUGMENTED_DIR = join5(homedir4(), ".augmented");
6352
6396
  var CONFIG_PATH = join5(AUGMENTED_DIR, "config.json");
6353
6397
  function ensureAugmentedDir() {
6354
- if (!existsSync5(AUGMENTED_DIR)) {
6398
+ if (!existsSync6(AUGMENTED_DIR)) {
6355
6399
  mkdirSync5(AUGMENTED_DIR, { recursive: true });
6356
6400
  }
6357
6401
  }
@@ -6445,7 +6489,7 @@ function exchangeFailureKind(err) {
6445
6489
  }
6446
6490
 
6447
6491
  // src/lib/api-client.ts
6448
- var agtCliVersion = true ? "0.28.680" : "dev";
6492
+ var agtCliVersion = true ? "0.28.681" : "dev";
6449
6493
  var lastConfigHash = null;
6450
6494
  function setConfigHash(hash) {
6451
6495
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -6727,14 +6771,14 @@ function atomicWriteFileSync(path, data) {
6727
6771
  }
6728
6772
 
6729
6773
  // src/lib/feature-flags-host.ts
6730
- import { existsSync as existsSync6, readFileSync as readFileSync7, statSync as statSync2 } from "fs";
6774
+ import { existsSync as existsSync7, readFileSync as readFileSync7, statSync as statSync2 } from "fs";
6731
6775
  import { join as join6 } from "path";
6732
6776
  function defaultFlagsCachePath(configDir) {
6733
6777
  return join6(configDir, "flags-cache.json");
6734
6778
  }
6735
6779
  function readFlagsCache(path) {
6736
6780
  try {
6737
- if (!existsSync6(path)) return null;
6781
+ if (!existsSync7(path)) return null;
6738
6782
  const parsed = JSON.parse(readFileSync7(path, "utf8"));
6739
6783
  if (!parsed || typeof parsed !== "object") return null;
6740
6784
  const obj = parsed;
@@ -8362,7 +8406,7 @@ function verdictForUnavailableMcpConfig(cause, ctx) {
8362
8406
 
8363
8407
  // src/lib/connectivity-probe-context.ts
8364
8408
  import { delimiter as pathDelimiter, join as join7 } from "path";
8365
- import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
8409
+ import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
8366
8410
 
8367
8411
  // src/lib/mcp-stdio-probe.ts
8368
8412
  import { spawn } from "child_process";
@@ -8954,7 +8998,7 @@ function buildProbeEnv(projectDir, agentId) {
8954
8998
  const probeEnv = { ...process.env };
8955
8999
  try {
8956
9000
  const envIntPath = join7(projectDir, ".env.integrations");
8957
- if (existsSync7(envIntPath)) {
9001
+ if (existsSync8(envIntPath)) {
8958
9002
  Object.assign(probeEnv, parseEnvIntegrations(readFileSync8(envIntPath, "utf-8")));
8959
9003
  }
8960
9004
  } catch {
@@ -8964,7 +9008,7 @@ function buildProbeEnv(projectDir, agentId) {
8964
9008
  }
8965
9009
  try {
8966
9010
  const agentBinDir = join7(projectDir, ".claude", "agt-bin");
8967
- if (existsSync7(agentBinDir)) {
9011
+ if (existsSync8(agentBinDir)) {
8968
9012
  probeEnv.PATH = probeEnv.PATH ? `${agentBinDir}${pathDelimiter}${probeEnv.PATH}` : agentBinDir;
8969
9013
  }
8970
9014
  } catch {
@@ -9324,13 +9368,13 @@ function decidePin(opts) {
9324
9368
 
9325
9369
  // src/commands/manager.ts
9326
9370
  import chalk3 from "chalk";
9327
- import { existsSync as existsSync9, realpathSync as realpathSync2 } from "fs";
9371
+ import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
9328
9372
  import { join as join10 } from "path";
9329
9373
  import { homedir as homedir5, userInfo } from "os";
9330
9374
  import { spawn as spawn3 } from "child_process";
9331
9375
 
9332
9376
  // src/lib/watchdog.ts
9333
- import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, unlinkSync as unlinkSync4, existsSync as existsSync8, mkdirSync as mkdirSync7, openSync as openSync2, closeSync as closeSync2, chmodSync as chmodSync6 } from "fs";
9377
+ import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, unlinkSync as unlinkSync4, existsSync as existsSync9, mkdirSync as mkdirSync7, openSync as openSync2, closeSync as closeSync2, chmodSync as chmodSync6 } from "fs";
9334
9378
  import { join as join9 } from "path";
9335
9379
  import { spawn as spawn2, execFileSync as execFileSync3 } from "child_process";
9336
9380
  var DEFAULT_CONFIG_DIR = join9(process.env["HOME"] ?? "/tmp", ".augmented");
@@ -9342,7 +9386,7 @@ function getManagerPaths(configDir) {
9342
9386
  };
9343
9387
  }
9344
9388
  function ensureDir(configDir) {
9345
- if (!existsSync8(configDir)) {
9389
+ if (!existsSync9(configDir)) {
9346
9390
  mkdirSync7(configDir, { recursive: true });
9347
9391
  }
9348
9392
  }
@@ -9454,7 +9498,7 @@ function startWatchdog(opts) {
9454
9498
  const deadline = Date.now() + 5e3;
9455
9499
  const sleepBuf = new Int32Array(new SharedArrayBuffer(4));
9456
9500
  while (Date.now() < deadline) {
9457
- if (existsSync8(pidFile)) {
9501
+ if (existsSync9(pidFile)) {
9458
9502
  return { pid: child.pid };
9459
9503
  }
9460
9504
  if (child.exitCode !== null) {
@@ -9790,7 +9834,7 @@ function resolveStableAgtBin(rawPath) {
9790
9834
  if (!prefix || !formula) return rawPath;
9791
9835
  const candidates = [`${prefix}/bin/${formula}`, `${prefix}/bin/agt`];
9792
9836
  for (const candidate of candidates) {
9793
- if (!existsSync9(candidate)) continue;
9837
+ if (!existsSync10(candidate)) continue;
9794
9838
  try {
9795
9839
  realpathSync2(candidate);
9796
9840
  return candidate;
@@ -10187,4 +10231,4 @@ export {
10187
10231
  managerInstallSystemUnitCommand,
10188
10232
  managerUninstallSystemUnitCommand
10189
10233
  };
10190
- //# sourceMappingURL=chunk-4JTDWOBW.js.map
10234
+ //# sourceMappingURL=chunk-Q44TIWZN.js.map