@integrity-labs/agt-cli 0.28.812 → 0.28.814

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.
Files changed (25) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-GBSP65E7.js → chunk-IABI5AX5.js} +6 -6
  3. package/dist/chunk-IABI5AX5.js.map +1 -0
  4. package/dist/{chunk-SBRKT2AV.js → chunk-Y33QUAGQ.js} +3 -3
  5. package/dist/{chunk-SBRKT2AV.js.map → chunk-Y33QUAGQ.js.map} +1 -1
  6. package/dist/{chunk-NKFM5VY3.js → chunk-ZBKYMWD4.js} +5 -5
  7. package/dist/chunk-ZBKYMWD4.js.map +1 -0
  8. package/dist/{claude-pair-runtime-WAXQINIW.js → claude-pair-runtime-HFNDYS4V.js} +2 -2
  9. package/dist/lib/manager-worker.js +71 -57
  10. package/dist/lib/manager-worker.js.map +1 -1
  11. package/dist/mcp/augmented-support.js +4 -4
  12. package/dist/mcp/direct-chat-channel.js +1 -1
  13. package/dist/mcp/index.js +4 -4
  14. package/dist/mcp/slack-channel.js +8 -8
  15. package/dist/mcp/telegram-channel.js +3 -3
  16. package/dist/{persistent-session-LYJCGKH3.js → persistent-session-5XVEPXBT.js} +3 -3
  17. package/dist/{responsiveness-probe-XRSACVMN.js → responsiveness-probe-7LZMXEWA.js} +3 -3
  18. package/dist/{session-auth-dead-Y6MASYWN.js → session-auth-dead-CDFUCZPH.js} +2 -2
  19. package/package.json +1 -1
  20. package/dist/chunk-GBSP65E7.js.map +0 -1
  21. package/dist/chunk-NKFM5VY3.js.map +0 -1
  22. /package/dist/{claude-pair-runtime-WAXQINIW.js.map → claude-pair-runtime-HFNDYS4V.js.map} +0 -0
  23. /package/dist/{persistent-session-LYJCGKH3.js.map → persistent-session-5XVEPXBT.js.map} +0 -0
  24. /package/dist/{responsiveness-probe-XRSACVMN.js.map → responsiveness-probe-7LZMXEWA.js.map} +0 -0
  25. /package/dist/{session-auth-dead-Y6MASYWN.js.map → session-auth-dead-CDFUCZPH.js.map} +0 -0
@@ -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-LYJCGKH3.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-5XVEPXBT.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-WAXQINIW.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-HFNDYS4V.js.map
@@ -58,7 +58,7 @@ import {
58
58
  safeWriteJsonAtomic,
59
59
  setConfigHash,
60
60
  tripClass
61
- } from "../chunk-NKFM5VY3.js";
61
+ } from "../chunk-ZBKYMWD4.js";
62
62
  import {
63
63
  getProjectDir as getProjectDir2,
64
64
  getReadyTasks,
@@ -123,7 +123,7 @@ import {
123
123
  takeZombieDetection,
124
124
  toOpencodeModel,
125
125
  writeEgressAllowlist
126
- } from "../chunk-SBRKT2AV.js";
126
+ } from "../chunk-Y33QUAGQ.js";
127
127
  import {
128
128
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
129
129
  AnchorSessionClient,
@@ -215,7 +215,7 @@ import {
215
215
  subagentActivityAgeSeconds,
216
216
  sumTranscriptUsageInWindow,
217
217
  transcriptActivityAgeSeconds
218
- } from "../chunk-GBSP65E7.js";
218
+ } from "../chunk-IABI5AX5.js";
219
219
  import {
220
220
  reapOrphanChannelMcps
221
221
  } from "../chunk-XWVM4KPK.js";
@@ -12918,7 +12918,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
12918
12918
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
12919
12919
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
12920
12920
  async function channelInboundActivityAgeSecondsFor(codeName) {
12921
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-XRSACVMN.js");
12921
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-7LZMXEWA.js");
12922
12922
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
12923
12923
  if (newest === null) return null;
12924
12924
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -13542,6 +13542,8 @@ function clearAgentCaches(agentId, codeName) {
13542
13542
  boardTokenCache.forget(agentId);
13543
13543
  refreshFetchGate.forget(agentId);
13544
13544
  memoriesFetchGate.forget(agentId);
13545
+ secretsFetchGate.forget(agentId);
13546
+ defaultSchedulesFetchGate.forget(agentId);
13545
13547
  forgetRealtimeRebindState(agentId);
13546
13548
  forgetChannelSyncState(agentId);
13547
13549
  sharedBusyBuckets.reset(codeName);
@@ -13578,7 +13580,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
13578
13580
  var lastVersionCheckAt = 0;
13579
13581
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13580
13582
  var lastResponsivenessProbeAt = 0;
13581
- var agtCliVersion = true ? "0.28.812" : "dev";
13583
+ var agtCliVersion = true ? "0.28.814" : "dev";
13582
13584
  function resolveBrewPath(execFileSync2) {
13583
13585
  try {
13584
13586
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -15100,6 +15102,8 @@ var DESIRED_STATE_FETCH_TTL_MS = 6e4;
15100
15102
  var refreshFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15101
15103
  var lastRefreshPayload = /* @__PURE__ */ new Map();
15102
15104
  var memoriesFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15105
+ var secretsFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15106
+ var defaultSchedulesFetchGate = createFetchGate(DESIRED_STATE_FETCH_TTL_MS);
15103
15107
  var pollCycleFetches = 0;
15104
15108
  var pollCycleFetchSkips = 0;
15105
15109
  var pollCycleMemoriesUnchanged = 0;
@@ -15107,6 +15111,8 @@ var pollCycleMemoriesFull = 0;
15107
15111
  function forceRefreshFetch() {
15108
15112
  refreshFetchGate.forceAll();
15109
15113
  memoriesFetchGate.forceAll();
15114
+ secretsFetchGate.forceAll();
15115
+ defaultSchedulesFetchGate.forceAll();
15110
15116
  }
15111
15117
  var consecutivePollFailures = 0;
15112
15118
  function reorderRestartedFirst(agents, restartedIds) {
@@ -15125,7 +15131,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
15125
15131
  if (codeNames.length === 0) return;
15126
15132
  void (async () => {
15127
15133
  try {
15128
- const { collectDiagnostics } = await import("../persistent-session-LYJCGKH3.js");
15134
+ const { collectDiagnostics } = await import("../persistent-session-5XVEPXBT.js");
15129
15135
  await api.post("/host/heartbeat", {
15130
15136
  host_id: hostId,
15131
15137
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -15266,7 +15272,7 @@ async function pollCycleInner() {
15266
15272
  }
15267
15273
  try {
15268
15274
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
15269
- const { collectDiagnostics } = await import("../persistent-session-LYJCGKH3.js");
15275
+ const { collectDiagnostics } = await import("../persistent-session-5XVEPXBT.js");
15270
15276
  const diagCodeNames = [...agentState.persistentSessionAgents];
15271
15277
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor) : void 0;
15272
15278
  let tailscaleHostname;
@@ -15435,7 +15441,7 @@ async function pollCycleInner() {
15435
15441
  collectPanelessActivityProbes,
15436
15442
  getResponsivenessIntervalMs,
15437
15443
  occupancyQualificationClassifications
15438
- } = await import("../responsiveness-probe-XRSACVMN.js");
15444
+ } = await import("../responsiveness-probe-7LZMXEWA.js");
15439
15445
  const probeIntervalMs = getResponsivenessIntervalMs();
15440
15446
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
15441
15447
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -15552,7 +15558,7 @@ async function pollCycleInner() {
15552
15558
  collectResponsivenessProbes,
15553
15559
  livePendingInboundOldestAgeSeconds,
15554
15560
  parkPendingInbound
15555
- } = await import("../responsiveness-probe-XRSACVMN.js");
15561
+ } = await import("../responsiveness-probe-7LZMXEWA.js");
15556
15562
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
15557
15563
  const wedgeNow = /* @__PURE__ */ new Date();
15558
15564
  const liveAgents = agentState.persistentSessionAgents;
@@ -15708,7 +15714,7 @@ async function pollCycleInner() {
15708
15714
  }
15709
15715
  try {
15710
15716
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
15711
- const { probeSessionAuth } = await import("../session-auth-dead-Y6MASYWN.js");
15717
+ const { probeSessionAuth } = await import("../session-auth-dead-CDFUCZPH.js");
15712
15718
  const observations = [];
15713
15719
  const pendingCacheCommits = [];
15714
15720
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -17526,24 +17532,28 @@ async function processAgent(agent, agentStates, managedToolkits) {
17526
17532
  }
17527
17533
  let lastSecretsProvisionAt = state8.agents.find((a) => a.agentId === agent.agent_id)?.lastSecretsProvisionAt ?? null;
17528
17534
  let secretsHash = agentState.knownSecretsHashes.get(agent.agent_id) ?? null;
17529
- try {
17530
- const secretsData = await api.post("/host/secrets", { agent_id: agent.agent_id });
17531
- const newHash = secretsData.secrets_hash;
17532
- const hashChanged = newHash !== secretsHash;
17533
- if (hashChanged && secretsData.profiles.length > 0) {
17534
- frameworkAdapter.writeAuthProfiles(agent.code_name, secretsData.profiles);
17535
- lastSecretsProvisionAt = (/* @__PURE__ */ new Date()).toISOString();
17536
- log(`Secrets updated for '${agent.code_name}'`);
17537
- }
17538
- if (newHash) {
17539
- agentState.knownSecretsHashes.set(agent.agent_id, newHash);
17540
- secretsHash = newHash;
17541
- } else {
17542
- agentState.knownSecretsHashes.delete(agent.agent_id);
17543
- secretsHash = null;
17535
+ const secretsToken = secretsFetchGate.beginFetch(agent.agent_id);
17536
+ if (secretsFetchGate.shouldFetch(agent.agent_id)) {
17537
+ try {
17538
+ const secretsData = await api.post("/host/secrets", { agent_id: agent.agent_id });
17539
+ const newHash = secretsData.secrets_hash;
17540
+ const hashChanged = newHash !== secretsHash;
17541
+ if (hashChanged && secretsData.profiles.length > 0) {
17542
+ frameworkAdapter.writeAuthProfiles(agent.code_name, secretsData.profiles);
17543
+ lastSecretsProvisionAt = (/* @__PURE__ */ new Date()).toISOString();
17544
+ log(`Secrets updated for '${agent.code_name}'`);
17545
+ }
17546
+ if (newHash) {
17547
+ agentState.knownSecretsHashes.set(agent.agent_id, newHash);
17548
+ secretsHash = newHash;
17549
+ } else {
17550
+ agentState.knownSecretsHashes.delete(agent.agent_id);
17551
+ secretsHash = null;
17552
+ }
17553
+ secretsFetchGate.markFetched(agent.agent_id, secretsToken);
17554
+ } catch (err) {
17555
+ log(`Secrets fetch failed for '${agent.code_name}': ${err.message}`);
17544
17556
  }
17545
- } catch (err) {
17546
- log(`Secrets fetch failed for '${agent.code_name}': ${err.message}`);
17547
17557
  }
17548
17558
  try {
17549
17559
  const integrationsData = await api.post("/host/agent-integrations", { agent_id: agent.agent_id });
@@ -17953,35 +17963,39 @@ async function processAgent(agent, agentStates, managedToolkits) {
17953
17963
  let tasks = refreshData.scheduled_tasks ?? [];
17954
17964
  const existingTemplateIds = new Set(tasks.map((t) => t.template_id));
17955
17965
  const kanbanWorkRetired = (agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK) === "claude-code" && agentSessionMode === "persistent";
17956
- try {
17957
- const defaultsData = await api.post("/host/resolve-default-schedules", { agent_id: agent.agent_id });
17958
- const allSchedules = (defaultsData.schedules ?? []).filter(
17959
- (s) => !(kanbanWorkRetired && s.template_id === "kanban-work")
17960
- );
17961
- const missing = allSchedules.filter(
17962
- (s) => !existingTemplateIds.has(s.template_id)
17963
- );
17964
- if (allSchedules.length > 0) {
17965
- await api.post("/host/ensure-default-schedules", {
17966
- agent_id: agent.agent_id,
17967
- team_id: defaultsData.team_id,
17968
- timezone: defaultsData.timezone,
17969
- schedules: allSchedules
17970
- });
17971
- if (missing.length > 0) {
17972
- log(`Auto-provisioned ${missing.length} default schedule(s) for '${agent.code_name}': ${missing.map((s) => s.template_id).join(", ")}`);
17966
+ const defaultSchedulesToken = defaultSchedulesFetchGate.beginFetch(agent.agent_id);
17967
+ if (defaultSchedulesFetchGate.shouldFetch(agent.agent_id)) {
17968
+ try {
17969
+ const defaultsData = await api.post("/host/resolve-default-schedules", { agent_id: agent.agent_id });
17970
+ const allSchedules = (defaultsData.schedules ?? []).filter(
17971
+ (s) => !(kanbanWorkRetired && s.template_id === "kanban-work")
17972
+ );
17973
+ const missing = allSchedules.filter(
17974
+ (s) => !existingTemplateIds.has(s.template_id)
17975
+ );
17976
+ if (allSchedules.length > 0) {
17977
+ await api.post("/host/ensure-default-schedules", {
17978
+ agent_id: agent.agent_id,
17979
+ team_id: defaultsData.team_id,
17980
+ timezone: defaultsData.timezone,
17981
+ schedules: allSchedules
17982
+ });
17983
+ if (missing.length > 0) {
17984
+ log(`Auto-provisioned ${missing.length} default schedule(s) for '${agent.code_name}': ${missing.map((s) => s.template_id).join(", ")}`);
17985
+ }
17986
+ const freshData = await api.post("/host/refresh", {
17987
+ agent_id: agent.agent_id,
17988
+ // Only `scheduled_tasks` is read here, so ask for the manifest shape on
17989
+ // every lane — nothing in this branch consumes a skill body, and the
17990
+ // skill lanes are the largest part of the payload being discarded.
17991
+ ...REFRESH_MANIFEST_FLAGS
17992
+ });
17993
+ tasks = freshData.scheduled_tasks ?? tasks;
17973
17994
  }
17974
- const freshData = await api.post("/host/refresh", {
17975
- agent_id: agent.agent_id,
17976
- // Only `scheduled_tasks` is read here, so ask for the manifest shape on
17977
- // every lane — nothing in this branch consumes a skill body, and the
17978
- // skill lanes are the largest part of the payload being discarded.
17979
- ...REFRESH_MANIFEST_FLAGS
17980
- });
17981
- tasks = freshData.scheduled_tasks ?? tasks;
17995
+ defaultSchedulesFetchGate.markFetched(agent.agent_id, defaultSchedulesToken);
17996
+ } catch (err) {
17997
+ log(`Default schedule provisioning failed for '${agent.code_name}': ${err.message}`);
17982
17998
  }
17983
- } catch (err) {
17984
- log(`Default schedule provisioning failed for '${agent.code_name}': ${err.message}`);
17985
17999
  }
17986
18000
  if (kanbanWorkRetired) {
17987
18001
  tasks = tasks.filter((t) => t.template_id !== "kanban-work");
@@ -19868,7 +19882,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
19868
19882
  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}`));
19869
19883
  void (async () => {
19870
19884
  try {
19871
- const { collectDiagnostics } = await import("../persistent-session-LYJCGKH3.js");
19885
+ const { collectDiagnostics } = await import("../persistent-session-5XVEPXBT.js");
19872
19886
  await api.post("/host/heartbeat", {
19873
19887
  host_id: hostId,
19874
19888
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -19914,7 +19928,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
19914
19928
  }
19915
19929
  try {
19916
19930
  const hostId = await getHostId();
19917
- const { collectDiagnostics } = await import("../persistent-session-LYJCGKH3.js");
19931
+ const { collectDiagnostics } = await import("../persistent-session-5XVEPXBT.js");
19918
19932
  await api.post("/host/heartbeat", {
19919
19933
  host_id: hostId,
19920
19934
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -20550,7 +20564,7 @@ async function processClaudePairSessions(agents) {
20550
20564
  killPairSession,
20551
20565
  pairTmuxSession,
20552
20566
  finalizeClaudePairOnboarding
20553
- } = await import("../claude-pair-runtime-WAXQINIW.js");
20567
+ } = await import("../claude-pair-runtime-HFNDYS4V.js");
20554
20568
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
20555
20569
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
20556
20570
  const killed = await killPairSession(pairTmuxSession(pairId));