@integrity-labs/agt-cli 0.28.436 → 0.28.437

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-W7T5YOS6.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-2TTEAJDH.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-SZVGJMGJ.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-QDNXOLED.js.map
@@ -42,7 +42,7 @@ import {
42
42
  resolveEffectivePinRaw,
43
43
  safeWriteJsonAtomic,
44
44
  setConfigHash
45
- } from "../chunk-DT6YHTVR.js";
45
+ } from "../chunk-7C3W6FP7.js";
46
46
  import {
47
47
  getProjectDir as getProjectDir2,
48
48
  getReadyTasks,
@@ -155,7 +155,7 @@ import {
155
155
  transcriptActivityAgeSeconds,
156
156
  writeEgressAllowlist,
157
157
  writeUsageLimitMarker
158
- } from "../chunk-IRFNOPFU.js";
158
+ } from "../chunk-MOASN7XT.js";
159
159
  import {
160
160
  reapOrphanChannelMcps
161
161
  } from "../chunk-XWVM4KPK.js";
@@ -9667,7 +9667,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9667
9667
  var lastVersionCheckAt = 0;
9668
9668
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9669
9669
  var lastResponsivenessProbeAt = 0;
9670
- var agtCliVersion = true ? "0.28.436" : "dev";
9670
+ var agtCliVersion = true ? "0.28.437" : "dev";
9671
9671
  function resolveBrewPath(execFileSync2) {
9672
9672
  try {
9673
9673
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -10825,7 +10825,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
10825
10825
  if (codeNames.length === 0) return;
10826
10826
  void (async () => {
10827
10827
  try {
10828
- const { collectDiagnostics } = await import("../persistent-session-W7T5YOS6.js");
10828
+ const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
10829
10829
  await api.post("/host/heartbeat", {
10830
10830
  host_id: hostId,
10831
10831
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor)
@@ -10932,7 +10932,7 @@ async function pollCycle() {
10932
10932
  }
10933
10933
  try {
10934
10934
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
10935
- const { collectDiagnostics } = await import("../persistent-session-W7T5YOS6.js");
10935
+ const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
10936
10936
  const diagCodeNames = [...agentState.persistentSessionAgents];
10937
10937
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor) : void 0;
10938
10938
  let tailscaleHostname;
@@ -11046,7 +11046,7 @@ async function pollCycle() {
11046
11046
  collectResponsivenessProbes,
11047
11047
  collectPanelessActivityProbes,
11048
11048
  getResponsivenessIntervalMs
11049
- } = await import("../responsiveness-probe-3NKR4QOX.js");
11049
+ } = await import("../responsiveness-probe-PMDNQ4J4.js");
11050
11050
  const probeIntervalMs = getResponsivenessIntervalMs();
11051
11051
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
11052
11052
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -11110,7 +11110,7 @@ async function pollCycle() {
11110
11110
  collectResponsivenessProbes,
11111
11111
  livePendingInboundOldestAgeSeconds,
11112
11112
  parkPendingInbound
11113
- } = await import("../responsiveness-probe-3NKR4QOX.js");
11113
+ } = await import("../responsiveness-probe-PMDNQ4J4.js");
11114
11114
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
11115
11115
  const wedgeNow = /* @__PURE__ */ new Date();
11116
11116
  const liveAgents = agentState.persistentSessionAgents;
@@ -14428,7 +14428,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
14428
14428
  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}`));
14429
14429
  void (async () => {
14430
14430
  try {
14431
- const { collectDiagnostics } = await import("../persistent-session-W7T5YOS6.js");
14431
+ const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
14432
14432
  await api.post("/host/heartbeat", {
14433
14433
  host_id: hostId,
14434
14434
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -14478,7 +14478,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
14478
14478
  }
14479
14479
  try {
14480
14480
  const hostId = await getHostId();
14481
- const { collectDiagnostics } = await import("../persistent-session-W7T5YOS6.js");
14481
+ const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
14482
14482
  await api.post("/host/heartbeat", {
14483
14483
  host_id: hostId,
14484
14484
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -14931,7 +14931,7 @@ async function processClaudePairSessions(agents) {
14931
14931
  killPairSession,
14932
14932
  pairTmuxSession,
14933
14933
  finalizeClaudePairOnboarding
14934
- } = await import("../claude-pair-runtime-SZVGJMGJ.js");
14934
+ } = await import("../claude-pair-runtime-QDNXOLED.js");
14935
14935
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
14936
14936
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
14937
14937
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -35658,18 +35658,39 @@ function createPeerRateLimiter(config2 = DEFAULT_RATE_LIMITER_CONFIG) {
35658
35658
  }
35659
35659
  };
35660
35660
  }
35661
- function createPresenceTracker() {
35661
+ function createPresenceTracker(opts = {}) {
35662
+ const retainMs = opts.retainMs ?? DAY_MS;
35662
35663
  const lastHumanByChat = /* @__PURE__ */ new Map();
35664
+ for (const [chatId, at] of Object.entries(opts.initial ?? {})) {
35665
+ if (typeof at === "number" && Number.isFinite(at)) lastHumanByChat.set(chatId, at);
35666
+ }
35667
+ const snapshot = (now = Date.now()) => {
35668
+ const out = {};
35669
+ for (const [chatId, at] of lastHumanByChat) {
35670
+ if (now - at < retainMs) out[chatId] = at;
35671
+ }
35672
+ return out;
35673
+ };
35663
35674
  return {
35664
35675
  noteInbound(chatId, kind, now) {
35665
- if (kind === "human") lastHumanByChat.set(chatId, now);
35676
+ if (kind !== "human") return;
35677
+ const prev = lastHumanByChat.get(chatId);
35678
+ if (prev !== void 0 && prev >= now) return;
35679
+ lastHumanByChat.set(chatId, now);
35680
+ if (opts.onChange) {
35681
+ try {
35682
+ opts.onChange(snapshot(now));
35683
+ } catch {
35684
+ }
35685
+ }
35666
35686
  },
35667
35687
  shouldDropOutgress(chatId, now, maxAgeMs = 30 * MINUTE_MS) {
35668
35688
  const last = lastHumanByChat.get(chatId);
35669
35689
  if (last === void 0) return "no_human_recent";
35670
35690
  if (now - last >= maxAgeMs) return "no_human_recent";
35671
35691
  return null;
35672
- }
35692
+ },
35693
+ snapshot
35673
35694
  };
35674
35695
  }
35675
35696
 
@@ -37950,6 +37971,10 @@ if (PEER_DISABLED_MODE !== "off") {
37950
37971
  );
37951
37972
  }
37952
37973
  PEER_CLASSIFIER_CONFIG.peer_disabled_mode = PEER_DISABLED_MODE;
37974
+ function peerSurfaceActiveOnChat(chatId) {
37975
+ if (!chatId.startsWith("-")) return false;
37976
+ return PEER_CLASSIFIER_CONFIG.peer_agent_mode !== "off" && PEER_CLASSIFIER_CONFIG.peer_group_ids.length > 0 && PEER_CLASSIFIER_CONFIG.peer_group_ids.includes(chatId);
37977
+ }
37953
37978
  var crossTeamPeerAuditClient = createCrossTeamPeerAuditClient({
37954
37979
  agtHost: AGT_HOST,
37955
37980
  agtApiKey: AGT_API_KEY,
@@ -38008,7 +38033,35 @@ var peerRateLimiter = peerRateApiClient && parsePeerAgentModeEnv(process.env.TEL
38008
38033
  log: (line) => process.stderr.write(`telegram-channel(${AGENT_CODE_NAME}): ${line}
38009
38034
  `)
38010
38035
  }) : createPeerRateLimiter();
38011
- var peerPresence = createPresenceTracker();
38036
+ var PEER_PRESENCE_STATE_FILE = TELEGRAM_AGENT_DIR ? join15(TELEGRAM_AGENT_DIR, "telegram-peer-presence.json") : null;
38037
+ function readPeerPresenceState() {
38038
+ if (!PEER_PRESENCE_STATE_FILE) return null;
38039
+ try {
38040
+ const parsed = JSON.parse(readFileSync15(PEER_PRESENCE_STATE_FILE, "utf-8"));
38041
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
38042
+ return parsed;
38043
+ } catch {
38044
+ return null;
38045
+ }
38046
+ }
38047
+ function writePeerPresenceState(snapshot) {
38048
+ if (!PEER_PRESENCE_STATE_FILE || !TELEGRAM_AGENT_DIR) return;
38049
+ const tmp = `${PEER_PRESENCE_STATE_FILE}.tmp`;
38050
+ try {
38051
+ mkdirSync9(TELEGRAM_AGENT_DIR, { recursive: true, mode: 448 });
38052
+ writeFileSync11(tmp, JSON.stringify(snapshot), { mode: 384 });
38053
+ renameSync7(tmp, PEER_PRESENCE_STATE_FILE);
38054
+ } catch (err) {
38055
+ process.stderr.write(
38056
+ `telegram-channel(${AGENT_CODE_NAME}): peer-presence persist failed: ${err.message}
38057
+ `
38058
+ );
38059
+ }
38060
+ }
38061
+ var peerPresence = createPresenceTracker({
38062
+ initial: readPeerPresenceState(),
38063
+ onChange: writePeerPresenceState
38064
+ });
38012
38065
  var dailyBudgetWarned = false;
38013
38066
  if (!BOT_TOKEN) {
38014
38067
  process.stderr.write(
@@ -40251,7 +40304,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
40251
40304
  isError: true
40252
40305
  };
40253
40306
  }
40254
- const peerActiveOnChat = PEER_CLASSIFIER_CONFIG.peer_agent_mode !== "off" && PEER_CLASSIFIER_CONFIG.peer_group_ids.length > 0 && PEER_CLASSIFIER_CONFIG.peer_group_ids.includes(chat_id);
40307
+ const peerActiveOnChat = peerSurfaceActiveOnChat(chat_id);
40255
40308
  if (peerActiveOnChat) {
40256
40309
  if (PEER_DISABLED_GLOBAL) {
40257
40310
  process.stderr.write(
@@ -40344,7 +40397,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
40344
40397
  isError: true
40345
40398
  };
40346
40399
  }
40347
- const peerActiveOnChat = PEER_CLASSIFIER_CONFIG.peer_agent_mode !== "off" && PEER_CLASSIFIER_CONFIG.peer_group_ids.length > 0 && PEER_CLASSIFIER_CONFIG.peer_group_ids.includes(chat_id);
40400
+ const peerActiveOnChat = peerSurfaceActiveOnChat(chat_id);
40348
40401
  if (peerActiveOnChat) {
40349
40402
  if (PEER_DISABLED_GLOBAL) {
40350
40403
  process.stderr.write(
@@ -40918,6 +40971,9 @@ async function replayPendingTelegramMarkers() {
40918
40971
  params: replayParams
40919
40972
  });
40920
40973
  seedTelegramProgressHeartbeat();
40974
+ if (replayPayload.meta?.["source_role"] !== "agent") {
40975
+ peerPresence.noteInbound(marker.chat_id, "human", now);
40976
+ }
40921
40977
  } catch (err) {
40922
40978
  process.stderr.write(
40923
40979
  `telegram-channel(${AGENT_CODE_NAME}): replay push failed: ${err.message}
@@ -36,7 +36,7 @@ import {
36
36
  writeDirectChatSessionState,
37
37
  writeEgressAllowlist,
38
38
  writePersistentClaudeWrapper
39
- } from "./chunk-IRFNOPFU.js";
39
+ } from "./chunk-MOASN7XT.js";
40
40
  import "./chunk-XWVM4KPK.js";
41
41
  export {
42
42
  EGRESS_BASELINE_DOMAINS,
@@ -77,4 +77,4 @@ export {
77
77
  writeEgressAllowlist,
78
78
  writePersistentClaudeWrapper
79
79
  };
80
- //# sourceMappingURL=persistent-session-W7T5YOS6.js.map
80
+ //# sourceMappingURL=persistent-session-2TTEAJDH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-IRFNOPFU.js";
3
+ } from "./chunk-MOASN7XT.js";
4
4
  import "./chunk-XWVM4KPK.js";
5
5
 
6
6
  // src/lib/responsiveness-probe.ts
@@ -471,4 +471,4 @@ export {
471
471
  readAndResetSlackReplyBindingClassifications,
472
472
  readAndResetSlackReplyTargetClassifications
473
473
  };
474
- //# sourceMappingURL=responsiveness-probe-3NKR4QOX.js.map
474
+ //# sourceMappingURL=responsiveness-probe-PMDNQ4J4.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.436",
3
+ "version": "0.28.437",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {