@integrity-labs/agt-cli 0.28.742 → 0.28.744

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
@@ -41,7 +41,7 @@ import {
41
41
  success,
42
42
  table,
43
43
  warn
44
- } from "../chunk-KRP35BSK.js";
44
+ } from "../chunk-LQMOIY3W.js";
45
45
  import {
46
46
  getProjectDir,
47
47
  isSessionResumeDisabled,
@@ -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.742" : "dev";
5470
+ var cliVersion = true ? "0.28.744" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6654,7 +6654,7 @@ function handleError(err) {
6654
6654
  }
6655
6655
 
6656
6656
  // src/bin/agt.ts
6657
- var cliVersion2 = true ? "0.28.742" : "dev";
6657
+ var cliVersion2 = true ? "0.28.744" : "dev";
6658
6658
  var program = new Command();
6659
6659
  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");
6660
6660
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6430,7 +6430,7 @@ function exchangeFailureKind(err) {
6430
6430
  }
6431
6431
 
6432
6432
  // src/lib/api-client.ts
6433
- var agtCliVersion = true ? "0.28.742" : "dev";
6433
+ var agtCliVersion = true ? "0.28.744" : "dev";
6434
6434
  var lastConfigHash = null;
6435
6435
  function setConfigHash(hash) {
6436
6436
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10476,4 +10476,4 @@ export {
10476
10476
  managerInstallSystemUnitCommand,
10477
10477
  managerUninstallSystemUnitCommand
10478
10478
  };
10479
- //# sourceMappingURL=chunk-KRP35BSK.js.map
10479
+ //# sourceMappingURL=chunk-LQMOIY3W.js.map
@@ -57,7 +57,7 @@ import {
57
57
  safeWriteJsonAtomic,
58
58
  setConfigHash,
59
59
  tripClass
60
- } from "../chunk-KRP35BSK.js";
60
+ } from "../chunk-LQMOIY3W.js";
61
61
  import {
62
62
  getProjectDir as getProjectDir2,
63
63
  getReadyTasks,
@@ -5600,6 +5600,22 @@ function createTickBoardFetcher(fetchBoard) {
5600
5600
  // src/lib/kanban-board-token.ts
5601
5601
  var BoardTokenCache = class {
5602
5602
  entries = /* @__PURE__ */ new Map();
5603
+ counts = { unchanged: 0, full: 0, refetch: 0 };
5604
+ /**
5605
+ * Counts since the last {@link resetStats}. Read once per poll cycle for the
5606
+ * `[poll-cycle]` log line — the ONLY place this feature's hit rate is
5607
+ * visible. Server-side it is unmeasurable: in the API Gateway access log an
5608
+ * `{ unchanged: true }` response and a genuinely empty board are the same
5609
+ * ~90 bytes, so a token that never matched would present as a fleet of agents
5610
+ * with empty boards rather than as a saving that is not being taken.
5611
+ */
5612
+ stats() {
5613
+ return { ...this.counts };
5614
+ }
5615
+ /** Zero the counters. Called at the top of each poll cycle. */
5616
+ resetStats() {
5617
+ this.counts = { unchanged: 0, full: 0, refetch: 0 };
5618
+ }
5603
5619
  /** The token to send as `known_token`, or undefined when we hold no board. */
5604
5620
  tokenFor(agentId) {
5605
5621
  return this.entries.get(agentId)?.token;
@@ -5619,15 +5635,20 @@ var BoardTokenCache = class {
5619
5635
  resolve(agentId, res) {
5620
5636
  if (res.unchanged === true) {
5621
5637
  const held = this.entries.get(agentId);
5622
- if (!held) return null;
5623
- if (typeof res.board_token === "string" && res.board_token.length > 0) {
5624
- this.entries.set(agentId, { token: res.board_token, rows: held.rows });
5638
+ if (!held) {
5639
+ this.counts.refetch += 1;
5640
+ return null;
5641
+ }
5642
+ this.counts.unchanged += 1;
5643
+ if (typeof res.payload_token === "string" && res.payload_token.length > 0) {
5644
+ this.entries.set(agentId, { token: res.payload_token, rows: held.rows });
5625
5645
  }
5626
5646
  return held.rows;
5627
5647
  }
5648
+ this.counts.full += 1;
5628
5649
  const rows = res.items ?? [];
5629
- if (typeof res.board_token === "string" && res.board_token.length > 0) {
5630
- this.entries.set(agentId, { token: res.board_token, rows });
5650
+ if (typeof res.payload_token === "string" && res.payload_token.length > 0) {
5651
+ this.entries.set(agentId, { token: res.payload_token, rows });
5631
5652
  } else {
5632
5653
  this.entries.delete(agentId);
5633
5654
  }
@@ -5716,7 +5737,7 @@ function resolveConditionalResponse(wire, hasCachedBody) {
5716
5737
  if (wire.unchanged === true) {
5717
5738
  return hasCachedBody ? { use: "cached" } : { use: "no-body" };
5718
5739
  }
5719
- const token = wire.payload_hash;
5740
+ const token = wire.payload_token;
5720
5741
  return {
5721
5742
  use: "wire",
5722
5743
  // An empty string is rejected as well as a non-string: it would round-trip
@@ -13154,7 +13175,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
13154
13175
  var lastVersionCheckAt = 0;
13155
13176
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13156
13177
  var lastResponsivenessProbeAt = 0;
13157
- var agtCliVersion = true ? "0.28.742" : "dev";
13178
+ var agtCliVersion = true ? "0.28.744" : "dev";
13158
13179
  function resolveBrewPath(execFileSync3) {
13159
13180
  try {
13160
13181
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -15436,6 +15457,7 @@ async function pollCycleInner() {
15436
15457
  pollCycleFetchSkips = 0;
15437
15458
  pollCycleMemoriesUnchanged = 0;
15438
15459
  pollCycleMemoriesFull = 0;
15460
+ boardTokenCache.resetStats();
15439
15461
  for (const agent of processOrder) {
15440
15462
  if (restartInFlight.has(agent.agent_id)) {
15441
15463
  const existing = state8.agents.find((a) => a.agentId === agent.agent_id);
@@ -15474,8 +15496,9 @@ async function pollCycleInner() {
15474
15496
  promptBindProbeAttempts.set(agent.code_name, PROMPT_BIND_PROBE_ATTEMPTS);
15475
15497
  }
15476
15498
  }
15499
+ const boardStats = boardTokenCache.stats();
15477
15500
  log(
15478
- `[poll-cycle] agents=${processOrder.length} refresh_fetched=${pollCycleFetches} refresh_skipped=${pollCycleFetchSkips} memories_unchanged=${pollCycleMemoriesUnchanged} memories_full=${pollCycleMemoriesFull} duration_ms=${Date.now() - cycleStartedAt}`
15501
+ `[poll-cycle] agents=${processOrder.length} refresh_fetched=${pollCycleFetches} refresh_skipped=${pollCycleFetchSkips} memories_unchanged=${pollCycleMemoriesUnchanged} memories_full=${pollCycleMemoriesFull} board_unchanged=${boardStats.unchanged} board_full=${boardStats.full} board_refetch=${boardStats.refetch} duration_ms=${Date.now() - cycleStartedAt}`
15479
15502
  );
15480
15503
  void maybeReportActivityCache({ api, log });
15481
15504
  const crossAgentPrune = managedPruneLedger.summarize();
@@ -20429,7 +20452,7 @@ async function downloadMemories(agent, memoryDir, log2, { force, configDir }) {
20429
20452
  const quoted = lastMemoriesBody.get(agent.agent_id);
20430
20453
  let wire = await api.post("/host/memories", {
20431
20454
  agent_id: agent.agent_id,
20432
- ...quoted ? { known_hash: quoted.hash } : {}
20455
+ ...quoted ? { known_token: quoted.hash } : {}
20433
20456
  });
20434
20457
  memoriesFetchGate.markFetched(agent.agent_id, memoriesToken);
20435
20458
  let held = stillHeld(quoted, lastMemoriesBody.get(agent.agent_id));