@integrity-labs/agt-cli 0.28.605 → 0.28.607

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.
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-4GJXG3PK.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-HOFUHGKI.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-DW3XFIV6.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-3Y6ZICI3.js.map
@@ -53,7 +53,7 @@ import {
53
53
  safeWriteJsonAtomic,
54
54
  setConfigHash,
55
55
  tripClass
56
- } from "../chunk-2NXKEFGS.js";
56
+ } from "../chunk-DYADWFBV.js";
57
57
  import {
58
58
  getProjectDir as getProjectDir2,
59
59
  getReadyTasks,
@@ -109,7 +109,7 @@ import {
109
109
  takeZombieDetection,
110
110
  toOpencodeModel,
111
111
  writeEgressAllowlist
112
- } from "../chunk-4MYANQKP.js";
112
+ } from "../chunk-DESCRVVM.js";
113
113
  import {
114
114
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
115
115
  AnchorSessionClient,
@@ -186,7 +186,7 @@ import {
186
186
  subagentActivityAgeSeconds,
187
187
  sumTranscriptUsageInWindow,
188
188
  transcriptActivityAgeSeconds
189
- } from "../chunk-7F64BKXG.js";
189
+ } from "../chunk-FF7H4K7I.js";
190
190
  import {
191
191
  reapOrphanChannelMcps
192
192
  } from "../chunk-XWVM4KPK.js";
@@ -11880,7 +11880,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
11880
11880
  var lastVersionCheckAt = 0;
11881
11881
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
11882
11882
  var lastResponsivenessProbeAt = 0;
11883
- var agtCliVersion = true ? "0.28.605" : "dev";
11883
+ var agtCliVersion = true ? "0.28.607" : "dev";
11884
11884
  function resolveBrewPath(execFileSync3) {
11885
11885
  try {
11886
11886
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13187,7 +13187,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13187
13187
  if (codeNames.length === 0) return;
13188
13188
  void (async () => {
13189
13189
  try {
13190
- const { collectDiagnostics } = await import("../persistent-session-4GJXG3PK.js");
13190
+ const { collectDiagnostics } = await import("../persistent-session-HOFUHGKI.js");
13191
13191
  await api.post("/host/heartbeat", {
13192
13192
  host_id: hostId,
13193
13193
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -13295,7 +13295,7 @@ async function pollCycle() {
13295
13295
  }
13296
13296
  try {
13297
13297
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
13298
- const { collectDiagnostics } = await import("../persistent-session-4GJXG3PK.js");
13298
+ const { collectDiagnostics } = await import("../persistent-session-HOFUHGKI.js");
13299
13299
  const diagCodeNames = [...agentState.persistentSessionAgents];
13300
13300
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
13301
13301
  let tailscaleHostname;
@@ -13418,7 +13418,7 @@ async function pollCycle() {
13418
13418
  collectPanelessActivityProbes,
13419
13419
  getResponsivenessIntervalMs,
13420
13420
  occupancyQualificationClassifications
13421
- } = await import("../responsiveness-probe-YXNVZ7SO.js");
13421
+ } = await import("../responsiveness-probe-KQGY6RMW.js");
13422
13422
  const probeIntervalMs = getResponsivenessIntervalMs();
13423
13423
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
13424
13424
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -13509,7 +13509,7 @@ async function pollCycle() {
13509
13509
  collectResponsivenessProbes,
13510
13510
  livePendingInboundOldestAgeSeconds,
13511
13511
  parkPendingInbound
13512
- } = await import("../responsiveness-probe-YXNVZ7SO.js");
13512
+ } = await import("../responsiveness-probe-KQGY6RMW.js");
13513
13513
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
13514
13514
  const wedgeNow = /* @__PURE__ */ new Date();
13515
13515
  const liveAgents = agentState.persistentSessionAgents;
@@ -13665,7 +13665,7 @@ async function pollCycle() {
13665
13665
  }
13666
13666
  try {
13667
13667
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
13668
- const { probeSessionAuth } = await import("../session-auth-dead-7DNO4XES.js");
13668
+ const { probeSessionAuth } = await import("../session-auth-dead-Q6AY5HC7.js");
13669
13669
  const observations = [];
13670
13670
  const pendingCacheCommits = [];
13671
13671
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -13823,6 +13823,7 @@ async function pollCycle() {
13823
13823
  const agentStates = [];
13824
13824
  const fastRespawn = hostFlagStore().getBoolean("fast-mcp-restart-respawn");
13825
13825
  const processOrder = fastRespawn ? reorderRestartedFirst(agents, new Set(restartAcks.keys())) : agents;
13826
+ const managedToolkits = createManagedToolkitReader(agents.map((a) => a.agent_id));
13826
13827
  for (const agent of processOrder) {
13827
13828
  if (restartInFlight.has(agent.agent_id)) {
13828
13829
  const existing = state7.agents.find((a) => a.agentId === agent.agent_id);
@@ -13832,7 +13833,7 @@ async function pollCycle() {
13832
13833
  }
13833
13834
  }
13834
13835
  try {
13835
- await processAgent(agent, agentStates);
13836
+ await processAgent(agent, agentStates, managedToolkits);
13836
13837
  } catch (err) {
13837
13838
  log(`Error processing agent '${agent.code_name}': ${err.message}`);
13838
13839
  const existing = state7.agents.find((a) => a.agentId === agent.agent_id);
@@ -14069,7 +14070,45 @@ async function getOrCacheRegisteredAgents(adapter, profile) {
14069
14070
  }
14070
14071
  return cached;
14071
14072
  }
14072
- async function processAgent(agent, agentStates) {
14073
+ async function fetchManagedToolkits(agentIds) {
14074
+ const data = await api.post(
14075
+ "/host/managed-toolkits",
14076
+ { agent_ids: [...agentIds] }
14077
+ );
14078
+ return data.toolkits ?? [];
14079
+ }
14080
+ function createManagedToolkitReader(agentIds, fetchToolkits = fetchManagedToolkits) {
14081
+ const requested = [...new Set(agentIds)];
14082
+ let batch = null;
14083
+ const loadBatch = () => {
14084
+ batch ??= (async () => {
14085
+ if (requested.length === 0) return /* @__PURE__ */ new Map();
14086
+ try {
14087
+ const toolkits = await fetchToolkits(requested);
14088
+ const byAgent = new Map(
14089
+ requested.map((id) => [id, []])
14090
+ );
14091
+ for (const tk of toolkits) byAgent.get(tk.agent_id)?.push(tk);
14092
+ return byAgent;
14093
+ } catch (err) {
14094
+ log(
14095
+ `[managed-toolkit] batch fetch for ${requested.length} agent(s) failed: ${err.message} \u2014 falling back to per-agent fetches this cycle (ENG-9057)`
14096
+ );
14097
+ return null;
14098
+ }
14099
+ })();
14100
+ return batch;
14101
+ };
14102
+ return {
14103
+ async forAgent(agentId) {
14104
+ const byAgent = await loadBatch();
14105
+ const fromBatch = byAgent?.get(agentId);
14106
+ if (fromBatch) return fromBatch;
14107
+ return (await fetchToolkits([agentId])).filter((tk) => tk.agent_id === agentId);
14108
+ }
14109
+ };
14110
+ }
14111
+ async function processAgent(agent, agentStates, managedToolkits) {
14073
14112
  if (!config) return;
14074
14113
  const renderIntegrationsSection = shouldRenderIntegrationsSection();
14075
14114
  syncAccountEnforcementMarker(
@@ -15353,8 +15392,7 @@ async function processAgent(agent, agentStates) {
15353
15392
  const fwForMcp = agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK;
15354
15393
  if (frameworkAdapter.writeMcpServer) {
15355
15394
  try {
15356
- const toolkitData = await api.post("/host/managed-toolkits", { agent_ids: [agent.agent_id] });
15357
- const agentToolkits = (toolkitData.toolkits ?? []).filter((tk) => tk.agent_id === agent.agent_id);
15395
+ const agentToolkits = await managedToolkits.forAgent(agent.agent_id);
15358
15396
  const expectedServerIds = /* @__PURE__ */ new Set();
15359
15397
  const desiredEntries = [];
15360
15398
  for (const tk of agentToolkits) {
@@ -17093,7 +17131,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
17093
17131
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
17094
17132
  void (async () => {
17095
17133
  try {
17096
- const { collectDiagnostics } = await import("../persistent-session-4GJXG3PK.js");
17134
+ const { collectDiagnostics } = await import("../persistent-session-HOFUHGKI.js");
17097
17135
  await api.post("/host/heartbeat", {
17098
17136
  host_id: hostId,
17099
17137
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17144,7 +17182,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
17144
17182
  }
17145
17183
  try {
17146
17184
  const hostId = await getHostId();
17147
- const { collectDiagnostics } = await import("../persistent-session-4GJXG3PK.js");
17185
+ const { collectDiagnostics } = await import("../persistent-session-HOFUHGKI.js");
17148
17186
  await api.post("/host/heartbeat", {
17149
17187
  host_id: hostId,
17150
17188
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17740,7 +17778,7 @@ async function processClaudePairSessions(agents) {
17740
17778
  killPairSession,
17741
17779
  pairTmuxSession,
17742
17780
  finalizeClaudePairOnboarding
17743
- } = await import("../claude-pair-runtime-DW3XFIV6.js");
17781
+ } = await import("../claude-pair-runtime-3Y6ZICI3.js");
17744
17782
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
17745
17783
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
17746
17784
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -18679,6 +18717,7 @@ export {
18679
18717
  claudeCodeUpgradeMarkerPath,
18680
18718
  claudeCodeUpgradeThrottled,
18681
18719
  claudeManagedSettingsPath,
18720
+ createManagedToolkitReader,
18682
18721
  dashboardRestartBreakerReason,
18683
18722
  decideDayRolloverAction,
18684
18723
  ensureClaudeManagedSettings,