@integrity-labs/agt-cli 0.28.615 → 0.28.616

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-T5ATAUEE.js";
43
+ } from "../chunk-BGZOJTLR.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
46
  } from "../chunk-6SJJM4FT.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.615" : "dev";
4912
+ var cliVersion = true ? "0.28.616" : "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.615" : "dev";
6092
+ var cliVersion2 = true ? "0.28.616" : "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) => {
@@ -6030,7 +6030,7 @@ function exchangeFailureKind(err) {
6030
6030
  }
6031
6031
 
6032
6032
  // src/lib/api-client.ts
6033
- var agtCliVersion = true ? "0.28.615" : "dev";
6033
+ var agtCliVersion = true ? "0.28.616" : "dev";
6034
6034
  var lastConfigHash = null;
6035
6035
  function setConfigHash(hash) {
6036
6036
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -9505,4 +9505,4 @@ export {
9505
9505
  managerInstallSystemUnitCommand,
9506
9506
  managerUninstallSystemUnitCommand
9507
9507
  };
9508
- //# sourceMappingURL=chunk-T5ATAUEE.js.map
9508
+ //# sourceMappingURL=chunk-BGZOJTLR.js.map
@@ -53,7 +53,7 @@ import {
53
53
  safeWriteJsonAtomic,
54
54
  setConfigHash,
55
55
  tripClass
56
- } from "../chunk-T5ATAUEE.js";
56
+ } from "../chunk-BGZOJTLR.js";
57
57
  import {
58
58
  getProjectDir as getProjectDir2,
59
59
  getReadyTasks,
@@ -199,6 +199,44 @@ import { join as join34, dirname as dirname9, delimiter as pathDelimiter } from
199
199
  import { homedir as homedir16 } from "os";
200
200
  import { fileURLToPath } from "url";
201
201
 
202
+ // src/lib/single-flight.ts
203
+ function createSingleFlight(task, opts = {}) {
204
+ let running2 = false;
205
+ let rerunRequested = false;
206
+ let coalesced = 0;
207
+ let settled = null;
208
+ function run() {
209
+ if (running2) {
210
+ rerunRequested = true;
211
+ coalesced += 1;
212
+ opts.onCoalesce?.(coalesced);
213
+ return settled ?? Promise.resolve();
214
+ }
215
+ running2 = true;
216
+ let markSettled;
217
+ settled = new Promise((resolve) => {
218
+ markSettled = resolve;
219
+ });
220
+ const primary = (async () => {
221
+ try {
222
+ do {
223
+ rerunRequested = false;
224
+ await task();
225
+ } while (rerunRequested);
226
+ } finally {
227
+ running2 = false;
228
+ markSettled();
229
+ }
230
+ })();
231
+ return primary;
232
+ }
233
+ return {
234
+ run,
235
+ isRunning: () => running2,
236
+ coalescedCount: () => coalesced
237
+ };
238
+ }
239
+
202
240
  // src/lib/claude-code-upgrade-throttle.ts
203
241
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
204
242
  import { dirname, join } from "path";
@@ -11931,7 +11969,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
11931
11969
  var lastVersionCheckAt = 0;
11932
11970
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
11933
11971
  var lastResponsivenessProbeAt = 0;
11934
- var agtCliVersion = true ? "0.28.615" : "dev";
11972
+ var agtCliVersion = true ? "0.28.616" : "dev";
11935
11973
  function resolveBrewPath(execFileSync3) {
11936
11974
  try {
11937
11975
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13248,7 +13286,15 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13248
13286
  }
13249
13287
  })();
13250
13288
  }
13251
- async function pollCycle() {
13289
+ var pollCycleGuard = createSingleFlight(() => pollCycleInner(), {
13290
+ onCoalesce: (total) => {
13291
+ log(`[poll-cycle] coalesced an early-poll trigger into the in-flight cycle (total=${total})`);
13292
+ }
13293
+ });
13294
+ function pollCycle() {
13295
+ return pollCycleGuard.run();
13296
+ }
13297
+ async function pollCycleInner() {
13252
13298
  if (!config) return;
13253
13299
  if (restartAfterUpgrade) return;
13254
13300
  flushDeliveryBaselineIfDirty();