@integrity-labs/agt-cli 0.28.822 → 0.28.824

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,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-IVR3UH5Z.js";
43
+ } from "../chunk-LPCKIZS4.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-KHCJT45W.js";
48
+ } from "../chunk-2DT4VGWU.js";
49
49
  import {
50
50
  AnchorSessionClient,
51
51
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-5RMHCQ3H.js";
82
+ } from "../chunk-PVPLNARY.js";
83
83
  import "../chunk-XWVM4KPK.js";
84
84
 
85
85
  // src/bin/agt.ts
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.822" : "dev";
5470
+ var cliVersion = true ? "0.28.824" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6658,7 +6658,7 @@ function handleError(err) {
6658
6658
  }
6659
6659
 
6660
6660
  // src/bin/agt.ts
6661
- var cliVersion2 = true ? "0.28.822" : "dev";
6661
+ var cliVersion2 = true ? "0.28.824" : "dev";
6662
6662
  var program = new Command();
6663
6663
  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");
6664
6664
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -18,7 +18,7 @@ import {
18
18
  rotateDailySession,
19
19
  sessionFileExists,
20
20
  todayLocalIso
21
- } from "./chunk-5RMHCQ3H.js";
21
+ } from "./chunk-PVPLNARY.js";
22
22
  import {
23
23
  reapOrphanChannelMcps
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -5312,4 +5312,4 @@ export {
5312
5312
  stopAllSessionsAndWait,
5313
5313
  getProjectDir
5314
5314
  };
5315
- //# sourceMappingURL=chunk-KHCJT45W.js.map
5315
+ //# sourceMappingURL=chunk-2DT4VGWU.js.map
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvIntegrations,
17
17
  shellQuote,
18
18
  summarizeUnanswerablePane
19
- } from "./chunk-KHCJT45W.js";
19
+ } from "./chunk-2DT4VGWU.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -71,7 +71,7 @@ import {
71
71
  sessionTranscriptDir,
72
72
  worseConnectivityOutcome,
73
73
  wrapScheduledTaskPrompt
74
- } from "./chunk-5RMHCQ3H.js";
74
+ } from "./chunk-PVPLNARY.js";
75
75
  import {
76
76
  parsePsRows
77
77
  } from "./chunk-XWVM4KPK.js";
@@ -6523,13 +6523,18 @@ function exchangeFailureKind(err) {
6523
6523
  }
6524
6524
 
6525
6525
  // src/lib/api-client.ts
6526
- var agtCliVersion = true ? "0.28.822" : "dev";
6526
+ var agtCliVersion = true ? "0.28.824" : "dev";
6527
6527
  var lastConfigHash = null;
6528
6528
  function setConfigHash(hash) {
6529
6529
  lastConfigHash = hash && hash.length > 0 ? hash : null;
6530
6530
  }
6531
6531
  var cachedExchange = null;
6532
6532
  var exchangeInFlight = null;
6533
+ var exchangeForceCount = 0;
6534
+ var consumedExchangeForceCount = 0;
6535
+ function forceNextExchange() {
6536
+ exchangeForceCount += 1;
6537
+ }
6533
6538
  function getCachedClaudeAuthMode() {
6534
6539
  return cachedExchange?.claudeAuthMode ?? null;
6535
6540
  }
@@ -6538,7 +6543,9 @@ function invalidateExchange() {
6538
6543
  lastConfigHash = null;
6539
6544
  }
6540
6545
  async function exchangeApiKey(rawKey, retried = false, opts = {}) {
6541
- if (!opts.forceRefresh && cachedExchange && Date.now() < cachedExchange.expiresAt - 6e4) {
6546
+ const withinMaxAge = opts.maxAgeMs === void 0 || cachedExchange !== null && Date.now() - cachedExchange.fetchedAt < opts.maxAgeMs;
6547
+ const forcePending = exchangeForceCount > consumedExchangeForceCount;
6548
+ if (!opts.forceRefresh && !forcePending && withinMaxAge && cachedExchange && Date.now() < cachedExchange.expiresAt - 6e4) {
6542
6549
  return {
6543
6550
  token: cachedExchange.token,
6544
6551
  hostId: cachedExchange.hostId,
@@ -6555,12 +6562,15 @@ async function exchangeApiKey(rawKey, retried = false, opts = {}) {
6555
6562
  supabaseAnonKey: cachedExchange.supabaseAnonKey
6556
6563
  };
6557
6564
  }
6565
+ const observedForceCount = exchangeForceCount;
6558
6566
  if (exchangeInFlight) {
6559
6567
  return exchangeInFlight;
6560
6568
  }
6561
6569
  exchangeInFlight = doExchange(rawKey, retried);
6562
6570
  try {
6563
- return await exchangeInFlight;
6571
+ const result = await exchangeInFlight;
6572
+ consumedExchangeForceCount = observedForceCount;
6573
+ return result;
6564
6574
  } finally {
6565
6575
  exchangeInFlight = null;
6566
6576
  }
@@ -6651,7 +6661,8 @@ async function attemptExchange(rawKey, retried) {
6651
6661
  userEmail: data.user_email,
6652
6662
  supabaseUrl: data.supabase_url,
6653
6663
  supabaseAnonKey: data.supabase_anon_key,
6654
- expiresAt: new Date(data.expires_at).getTime()
6664
+ expiresAt: new Date(data.expires_at).getTime(),
6665
+ fetchedAt: Date.now()
6655
6666
  };
6656
6667
  return {
6657
6668
  token: data.token,
@@ -10753,6 +10764,7 @@ export {
10753
10764
  isTransientAuthFailure,
10754
10765
  exchangeFailureKind,
10755
10766
  setConfigHash,
10767
+ forceNextExchange,
10756
10768
  getCachedClaudeAuthMode,
10757
10769
  exchangeApiKey,
10758
10770
  mintAgentKey,
@@ -10818,4 +10830,4 @@ export {
10818
10830
  managerInstallSystemUnitCommand,
10819
10831
  managerUninstallSystemUnitCommand
10820
10832
  };
10821
- //# sourceMappingURL=chunk-IVR3UH5Z.js.map
10833
+ //# sourceMappingURL=chunk-LPCKIZS4.js.map