@integrity-labs/agt-cli 0.28.816 → 0.28.817

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-PNHF5TJN.js";
43
+ } from "../chunk-356JFTPK.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  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.816" : "dev";
5470
+ var cliVersion = true ? "0.28.817" : "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.816" : "dev";
6661
+ var cliVersion2 = true ? "0.28.817" : "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) => {
@@ -6523,7 +6523,7 @@ function exchangeFailureKind(err) {
6523
6523
  }
6524
6524
 
6525
6525
  // src/lib/api-client.ts
6526
- var agtCliVersion = true ? "0.28.816" : "dev";
6526
+ var agtCliVersion = true ? "0.28.817" : "dev";
6527
6527
  var lastConfigHash = null;
6528
6528
  function setConfigHash(hash) {
6529
6529
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10818,4 +10818,4 @@ export {
10818
10818
  managerInstallSystemUnitCommand,
10819
10819
  managerUninstallSystemUnitCommand
10820
10820
  };
10821
- //# sourceMappingURL=chunk-PNHF5TJN.js.map
10821
+ //# sourceMappingURL=chunk-356JFTPK.js.map
@@ -58,7 +58,7 @@ import {
58
58
  safeWriteJsonAtomic,
59
59
  setConfigHash,
60
60
  tripClass
61
- } from "../chunk-PNHF5TJN.js";
61
+ } from "../chunk-356JFTPK.js";
62
62
  import {
63
63
  getProjectDir as getProjectDir2,
64
64
  getReadyTasks,
@@ -13276,6 +13276,7 @@ async function runAgentConnectivityProbes(agent, integrations, projectDir) {
13276
13276
  agent_id: agent.agent_id,
13277
13277
  results: result.reports
13278
13278
  });
13279
+ forceIntegrationsFetch(agent.agent_id);
13279
13280
  const labelById = new Map(integrations.map((i) => [i.id, i.definition_id]));
13280
13281
  dependencyRecoveryLedger.record(
13281
13282
  agent.code_name,
@@ -13317,6 +13318,7 @@ async function runAgentSessionToolBindProbes(agent, integrations, projectDir, op
13317
13318
  agent_id: agent.agent_id,
13318
13319
  results: result.reports
13319
13320
  });
13321
+ forceIntegrationsFetch(agent.agent_id);
13320
13322
  }
13321
13323
  const naCount = result.reports.filter((r) => r.status === "not_applicable").length;
13322
13324
  const skipSummary = result.skippedDetail.length > 0 ? ` skipped=[${result.skippedDetail.map((s) => `${s.definition_id}:${s.reason}`).join(" ")}]` : "";
@@ -13544,6 +13546,10 @@ function clearAgentCaches(agentId, codeName) {
13544
13546
  memoriesFetchGate.forget(agentId);
13545
13547
  secretsFetchGate.forget(agentId);
13546
13548
  defaultSchedulesFetchGate.forget(agentId);
13549
+ integrationsFetchGate.forget(agentId);
13550
+ quarantinedFetchGate.forget(agentId);
13551
+ lastIntegrationsPayload.delete(agentId);
13552
+ lastQuarantinedPayload.delete(agentId);
13547
13553
  forgetRealtimeRebindState(agentId);
13548
13554
  forgetChannelSyncState(agentId);
13549
13555
  sharedBusyBuckets.reset(codeName);
@@ -13580,7 +13586,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
13580
13586
  var lastVersionCheckAt = 0;
13581
13587
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13582
13588
  var lastResponsivenessProbeAt = 0;
13583
- var agtCliVersion = true ? "0.28.816" : "dev";
13589
+ var agtCliVersion = true ? "0.28.817" : "dev";
13584
13590
  function resolveBrewPath(execFileSync2) {
13585
13591
  try {
13586
13592
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -15104,8 +15110,20 @@ var lastRefreshPayload = /* @__PURE__ */ new Map();
15104
15110
  var memoriesFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15105
15111
  var secretsFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15106
15112
  var defaultSchedulesFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15113
+ var integrationsFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15114
+ var lastIntegrationsPayload = /* @__PURE__ */ new Map();
15115
+ var quarantinedFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15116
+ var lastQuarantinedPayload = /* @__PURE__ */ new Map();
15117
+ function forceIntegrationsFetch(agentId) {
15118
+ integrationsFetchGate.forceNext(agentId);
15119
+ quarantinedFetchGate.forceNext(agentId);
15120
+ }
15107
15121
  var pollCycleFetches = 0;
15108
15122
  var pollCycleFetchSkips = 0;
15123
+ var pollCycleIntegrationsFetches = 0;
15124
+ var pollCycleIntegrationsSkips = 0;
15125
+ var pollCycleQuarantinedFetches = 0;
15126
+ var pollCycleQuarantinedSkips = 0;
15109
15127
  var pollCycleMemoriesUnchanged = 0;
15110
15128
  var pollCycleMemoriesFull = 0;
15111
15129
  function forceRefreshFetch() {
@@ -15113,6 +15131,8 @@ function forceRefreshFetch() {
15113
15131
  memoriesFetchGate.forceAll();
15114
15132
  secretsFetchGate.forceAll();
15115
15133
  defaultSchedulesFetchGate.forceAll();
15134
+ integrationsFetchGate.forceAll();
15135
+ quarantinedFetchGate.forceAll();
15116
15136
  }
15117
15137
  var consecutivePollFailures = 0;
15118
15138
  function reorderRestartedFirst(agents, restartedIds) {
@@ -15877,6 +15897,10 @@ async function pollCycleInner() {
15877
15897
  const cycleStartedAt = Date.now();
15878
15898
  pollCycleFetches = 0;
15879
15899
  pollCycleFetchSkips = 0;
15900
+ pollCycleIntegrationsFetches = 0;
15901
+ pollCycleIntegrationsSkips = 0;
15902
+ pollCycleQuarantinedFetches = 0;
15903
+ pollCycleQuarantinedSkips = 0;
15880
15904
  pollCycleMemoriesUnchanged = 0;
15881
15905
  pollCycleMemoriesFull = 0;
15882
15906
  boardTokenCache.resetStats();
@@ -15920,7 +15944,7 @@ async function pollCycleInner() {
15920
15944
  }
15921
15945
  const boardStats = boardTokenCache.stats();
15922
15946
  log(
15923
- `[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}`
15947
+ `[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} integrations_fetched=${pollCycleIntegrationsFetches} integrations_skipped=${pollCycleIntegrationsSkips} quarantined_fetched=${pollCycleQuarantinedFetches} quarantined_skipped=${pollCycleQuarantinedSkips} duration_ms=${Date.now() - cycleStartedAt}`
15924
15948
  );
15925
15949
  void maybeReportActivityCache({ api, log });
15926
15950
  const crossAgentPrune = managedPruneLedger.summarize();
@@ -17556,8 +17580,22 @@ async function processAgent(agent, agentStates, managedToolkits) {
17556
17580
  }
17557
17581
  }
17558
17582
  try {
17559
- const integrationsData = await api.post("/host/agent-integrations", { agent_id: agent.agent_id });
17560
- const integrations = (integrationsData.integrations ?? []).map(withResolvedRemoteMcp);
17583
+ const fetchIntegrations = async () => {
17584
+ const integrationsData = await api.post("/host/agent-integrations", { agent_id: agent.agent_id });
17585
+ return (integrationsData.integrations ?? []).map(withResolvedRemoteMcp);
17586
+ };
17587
+ const integrationsToken = integrationsFetchGate.beginFetch(agent.agent_id);
17588
+ const cachedIntegrations = lastIntegrationsPayload.get(agent.agent_id);
17589
+ let integrations;
17590
+ if (cachedIntegrations !== void 0 && !integrationsFetchGate.shouldFetch(agent.agent_id)) {
17591
+ integrations = cachedIntegrations;
17592
+ pollCycleIntegrationsSkips += 1;
17593
+ } else {
17594
+ integrations = await fetchIntegrations();
17595
+ lastIntegrationsPayload.set(agent.agent_id, integrations);
17596
+ integrationsFetchGate.markFetched(agent.agent_id, integrationsToken);
17597
+ pollCycleIntegrationsFetches += 1;
17598
+ }
17561
17599
  recordEffectiveIntegrationIds(
17562
17600
  effectiveIntegrationObservations,
17563
17601
  agent.agent_id,
@@ -17620,9 +17658,23 @@ async function processAgent(agent, agentStates, managedToolkits) {
17620
17658
  try {
17621
17659
  const probeProjectDir = join41(homedir17(), ".augmented", agent.code_name, "project");
17622
17660
  let probeSet = integrations;
17623
- try {
17661
+ const fetchQuarantined = async () => {
17624
17662
  const quarantined = await api.post("/host/agent-integrations/quarantined", { agent_id: agent.agent_id });
17625
- const qRows = quarantined.integrations ?? [];
17663
+ return quarantined.integrations ?? [];
17664
+ };
17665
+ try {
17666
+ const quarantinedToken = quarantinedFetchGate.beginFetch(agent.agent_id);
17667
+ const cachedQuarantined = lastQuarantinedPayload.get(agent.agent_id);
17668
+ let qRows;
17669
+ if (cachedQuarantined !== void 0 && !quarantinedFetchGate.shouldFetch(agent.agent_id)) {
17670
+ qRows = cachedQuarantined;
17671
+ pollCycleQuarantinedSkips += 1;
17672
+ } else {
17673
+ qRows = await fetchQuarantined();
17674
+ lastQuarantinedPayload.set(agent.agent_id, qRows);
17675
+ quarantinedFetchGate.markFetched(agent.agent_id, quarantinedToken);
17676
+ pollCycleQuarantinedFetches += 1;
17677
+ }
17626
17678
  if (qRows.length > 0) {
17627
17679
  for (const q of qRows) {
17628
17680
  if (q.inline_server_entry) continue;