@integrity-labs/agt-cli 0.28.1280 → 0.28.1281

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 (28) hide show
  1. package/dist/{api-client-QEV6AB73.js → api-client-UW5GPDR5.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-BJKY5764.js → chunk-A26WJ7TB.js} +2 -2
  4. package/dist/{chunk-HHEN4FTL.js → chunk-CCWVPE2F.js} +3 -3
  5. package/dist/{chunk-FVW5O7NY.js → chunk-FQMFWJUD.js} +2 -2
  6. package/dist/{chunk-47ARAO23.js → chunk-O5D6I72R.js} +7 -1
  7. package/dist/{chunk-47ARAO23.js.map → chunk-O5D6I72R.js.map} +1 -1
  8. package/dist/{chunk-TICHDHYF.js → chunk-SHBU7NAQ.js} +5 -5
  9. package/dist/{chunk-5MI3GRHT.js → chunk-XNHTH267.js} +6 -3
  10. package/dist/{chunk-5MI3GRHT.js.map → chunk-XNHTH267.js.map} +1 -1
  11. package/dist/{claude-code-updater-BHSYASF3.js → claude-code-updater-L3NMDSSG.js} +3 -3
  12. package/dist/{claude-pair-runtime-27FK2QO2.js → claude-pair-runtime-TUVLJDJZ.js} +3 -3
  13. package/dist/lib/manager-worker.js +82 -25
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/{persistent-session-WBWYC4XL.js → persistent-session-LMR3WHVO.js} +4 -4
  16. package/dist/{responsiveness-probe-BLLWDXE4.js → responsiveness-probe-FWPQTPQ5.js} +4 -4
  17. package/dist/{session-auth-dead-NJR7X5T6.js → session-auth-dead-5PNG5ILK.js} +3 -3
  18. package/package.json +1 -1
  19. /package/dist/{api-client-QEV6AB73.js.map → api-client-UW5GPDR5.js.map} +0 -0
  20. /package/dist/{chunk-BJKY5764.js.map → chunk-A26WJ7TB.js.map} +0 -0
  21. /package/dist/{chunk-HHEN4FTL.js.map → chunk-CCWVPE2F.js.map} +0 -0
  22. /package/dist/{chunk-FVW5O7NY.js.map → chunk-FQMFWJUD.js.map} +0 -0
  23. /package/dist/{chunk-TICHDHYF.js.map → chunk-SHBU7NAQ.js.map} +0 -0
  24. /package/dist/{claude-code-updater-BHSYASF3.js.map → claude-code-updater-L3NMDSSG.js.map} +0 -0
  25. /package/dist/{claude-pair-runtime-27FK2QO2.js.map → claude-pair-runtime-TUVLJDJZ.js.map} +0 -0
  26. /package/dist/{persistent-session-WBWYC4XL.js.map → persistent-session-LMR3WHVO.js.map} +0 -0
  27. /package/dist/{responsiveness-probe-BLLWDXE4.js.map → responsiveness-probe-FWPQTPQ5.js.map} +0 -0
  28. /package/dist/{session-auth-dead-NJR7X5T6.js.map → session-auth-dead-5PNG5ILK.js.map} +0 -0
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-BJKY5764.js";
16
+ } from "./chunk-A26WJ7TB.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-47ARAO23.js";
18
+ import "./chunk-O5D6I72R.js";
19
19
  import "./chunk-AIUIMEUS.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -34,4 +34,4 @@ export {
34
34
  readsAsNativeInstall,
35
35
  shouldRunClaudeCodeUpdater
36
36
  };
37
- //# sourceMappingURL=claude-code-updater-BHSYASF3.js.map
37
+ //# sourceMappingURL=claude-code-updater-L3NMDSSG.js.map
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  redactPaneFrame,
12
12
  sanitizeTerminalFrame
13
- } from "./chunk-47ARAO23.js";
13
+ } from "./chunk-O5D6I72R.js";
14
14
  import {
15
15
  CLAUDE_CONFIG_DIR_ENV,
16
16
  claudeConfigDirFor,
@@ -323,7 +323,7 @@ async function spawnPairSession(session) {
323
323
  return { ok: true };
324
324
  } catch {
325
325
  }
326
- const { resolveClaudeBinary } = await import("./persistent-session-WBWYC4XL.js");
326
+ const { resolveClaudeBinary } = await import("./persistent-session-LMR3WHVO.js");
327
327
  const claudeBin = resolveClaudeBinary();
328
328
  const pairEnv = {
329
329
  ...process.env,
@@ -838,4 +838,4 @@ export {
838
838
  startClaudePair,
839
839
  submitClaudePairCode
840
840
  };
841
- //# sourceMappingURL=claude-pair-runtime-27FK2QO2.js.map
841
+ //# sourceMappingURL=claude-pair-runtime-TUVLJDJZ.js.map
@@ -70,7 +70,7 @@ import {
70
70
  tripClass,
71
71
  writeEtcEnvironment,
72
72
  writeProfileDScript
73
- } from "../chunk-TICHDHYF.js";
73
+ } from "../chunk-SHBU7NAQ.js";
74
74
  import {
75
75
  ApiError,
76
76
  adoptHostKeyInProcess,
@@ -88,7 +88,7 @@ import {
88
88
  probeHostKey,
89
89
  requireHost,
90
90
  setConfigHash
91
- } from "../chunk-HHEN4FTL.js";
91
+ } from "../chunk-CCWVPE2F.js";
92
92
  import {
93
93
  BLOCKED_ON_PROMPT_DECISION,
94
94
  CHANNEL_SECRET_ENV_KEYS,
@@ -180,7 +180,7 @@ import {
180
180
  webFetchBaselineValue,
181
181
  webFetchRestartNeeded,
182
182
  writeEgressAllowlist
183
- } from "../chunk-5MI3GRHT.js";
183
+ } from "../chunk-XNHTH267.js";
184
184
  import {
185
185
  isAgentIdle,
186
186
  isStaleForToday,
@@ -191,7 +191,7 @@ import {
191
191
  subagentActivityAgeSeconds,
192
192
  subagentTranscriptDir,
193
193
  transcriptActivityAgeSeconds
194
- } from "../chunk-FVW5O7NY.js";
194
+ } from "../chunk-FQMFWJUD.js";
195
195
  import {
196
196
  classifyUnanswerablePane,
197
197
  focusedConfirmDialogBlock,
@@ -217,7 +217,7 @@ import {
217
217
  runSafeCleanup,
218
218
  tightestDiskStat,
219
219
  withPackageCacheLock
220
- } from "../chunk-BJKY5764.js";
220
+ } from "../chunk-A26WJ7TB.js";
221
221
  import {
222
222
  parsePsRows,
223
223
  reapOrphanChannelMcps
@@ -346,7 +346,7 @@ import {
346
346
  stabiliseResetInstant,
347
347
  sumTranscriptUsageInWindow,
348
348
  summarizeTranscriptActivity
349
- } from "../chunk-47ARAO23.js";
349
+ } from "../chunk-O5D6I72R.js";
350
350
  import {
351
351
  CLAUDE_CONFIG_DIR_ENV,
352
352
  claudeConfigDirFor,
@@ -467,6 +467,14 @@ var ConfigReloadLedger = class {
467
467
  * b4cfce82 hit). Cleared whenever the reload is re-torn-down or acked.
468
468
  */
469
469
  freshRenderAt = /* @__PURE__ */ new Map();
470
+ /**
471
+ * ENG-12141: the RENDER REVISION of that fresh render, i.e. a hash of the
472
+ * `.mcp.json` exactly as a spawn would load it (`projectMcpHash`, spawn view).
473
+ * A later fresh render with a different revision is a different config, so the
474
+ * marker moves to it; one with the same revision is the same config, so the
475
+ * earliest stays. See `noteFreshRender`.
476
+ */
477
+ freshRenderRevision = /* @__PURE__ */ new Map();
470
478
  /** What the poll does with this agent's integration-change request. Records a teardown. */
471
479
  service(agentId, requested) {
472
480
  const action = configReloadAction({ requested, pendingRequested: this.pending.get(agentId) });
@@ -474,12 +482,59 @@ var ConfigReloadLedger = class {
474
482
  this.pending.set(agentId, requested);
475
483
  this.confirmed.delete(agentId);
476
484
  this.freshRenderAt.delete(agentId);
485
+ this.freshRenderRevision.delete(agentId);
477
486
  }
478
487
  return action;
479
488
  }
480
- /** ENG-12052: a fresh render landed for the pending reload; keeps the earliest. */
481
- noteFreshRender(agentId, atMs) {
482
- if (this.pending.has(agentId) && !this.freshRenderAt.has(agentId)) this.freshRenderAt.set(agentId, atMs);
489
+ /**
490
+ * ENG-12052: a fresh render landed for the pending reload. Keeps the EARLIEST
491
+ * render of a given config.
492
+ *
493
+ * ENG-12141: `revision` is what the spawn will actually read, hashed: the
494
+ * spawn-view `.mcp.json` (`projectMcpHash`). When it differs from the revision
495
+ * the marker was set at, the rendered config CHANGED during the pending reload
496
+ * (a new `remoteMcp.url`, a tool-tier change, a server added or removed), so a
497
+ * session started from the earlier render is now stale and the marker moves to
498
+ * this render. Same revision: same config, earliest kept, so a session started
499
+ * from it is still fresh and is never restarted.
500
+ *
501
+ * INVARIANT (Sherlock, ENG-12141): anything that changes WHICH servers or tools a
502
+ * session gets must live in .mcp.json; .env holds live values only and is
503
+ * deliberately not hashed. Pinned by eng-12141-fresh-render-revision.test.ts.
504
+ *
505
+ * Why the rendered `.mcp.json` and nothing else. It is template-only: every
506
+ * writer emits `${VAR}` references and the ENG-5901 literal-secret lint refuses
507
+ * a write carrying a literal secret. So the values a reload must NOT restart
508
+ * for live outside it by construction: credentials and OAuth tokens (ENG-6918)
509
+ * in `.env.integrations` / the proxy token file, which the proxy re-reads per
510
+ * request or the hot-reload reap applies, and the Anchor `session_id`, which
511
+ * lands as `ANCHOR_BROWSER_SESSION_ID` and is read live per request. The
512
+ * values a reload MUST act on are spawn-fixed and live inside it: the server
513
+ * set, each URL (`AGT_REMOTE_MCP_URL`), and the tool tiers
514
+ * (`AGT_REMOTE_MCP_TOOL_TIERS`, read once at proxy start). No input allowlist,
515
+ * no deny list (the approach reverted on #7666).
516
+ *
517
+ * A `null`/absent revision (the file could not be read) can't be compared, so
518
+ * it keeps the earliest, which is the pre-ENG-12141 behaviour and fails safe:
519
+ * at worst it misses a rare reload, it never stops a fresh session.
520
+ */
521
+ noteFreshRender(agentId, atMs, revision = null) {
522
+ if (!this.pending.has(agentId)) return;
523
+ if (!this.freshRenderAt.has(agentId)) {
524
+ this.freshRenderAt.set(agentId, atMs);
525
+ this.freshRenderRevision.set(agentId, revision);
526
+ return;
527
+ }
528
+ const was = this.freshRenderRevision.get(agentId) ?? null;
529
+ if (revision === null) return;
530
+ if (was === null) {
531
+ this.freshRenderRevision.set(agentId, revision);
532
+ return;
533
+ }
534
+ if (revision !== was) {
535
+ this.freshRenderAt.set(agentId, atMs);
536
+ this.freshRenderRevision.set(agentId, revision);
537
+ }
483
538
  }
484
539
  /** ENG-12052: when the pending reload's first fresh render landed, or null. */
485
540
  freshRenderedAt(agentId) {
@@ -501,6 +556,7 @@ var ConfigReloadLedger = class {
501
556
  this.confirmed.delete(agentId);
502
557
  this.pending.delete(agentId);
503
558
  this.freshRenderAt.delete(agentId);
559
+ this.freshRenderRevision.delete(agentId);
504
560
  if (requestedAt) out.push({ agentId, requestedAt });
505
561
  }
506
562
  return out;
@@ -510,6 +566,7 @@ var ConfigReloadLedger = class {
510
566
  this.pending.delete(agentId);
511
567
  this.confirmed.delete(agentId);
512
568
  this.freshRenderAt.delete(agentId);
569
+ this.freshRenderRevision.delete(agentId);
513
570
  }
514
571
  };
515
572
  function stampIsOlder(a, b) {
@@ -15228,7 +15285,7 @@ function createFileMigrationReportIO(codeName, log2) {
15228
15285
  };
15229
15286
  }
15230
15287
  var managerHostPost = async (path, body) => {
15231
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-QEV6AB73.js");
15288
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-UW5GPDR5.js");
15232
15289
  try {
15233
15290
  const json = await api2.post(path, body);
15234
15291
  return { status: 200, json };
@@ -17283,7 +17340,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
17283
17340
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
17284
17341
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
17285
17342
  async function channelInboundActivityAgeSecondsFor(codeName) {
17286
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-BLLWDXE4.js");
17343
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-FWPQTPQ5.js");
17287
17344
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
17288
17345
  if (newest === null) return null;
17289
17346
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -18164,7 +18221,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
18164
18221
  var lastVersionCheckAt = 0;
18165
18222
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
18166
18223
  var lastResponsivenessProbeAt = 0;
18167
- var agtCliVersion = true ? "0.28.1280" : "dev";
18224
+ var agtCliVersion = true ? "0.28.1281" : "dev";
18168
18225
  function resolveBrewPath(execFileSync5) {
18169
18226
  try {
18170
18227
  const out = execFileSync5("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -20178,7 +20235,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
20178
20235
  if (codeNames.length === 0) return;
20179
20236
  void (async () => {
20180
20237
  try {
20181
- const { collectDiagnostics } = await import("../persistent-session-WBWYC4XL.js");
20238
+ const { collectDiagnostics } = await import("../persistent-session-LMR3WHVO.js");
20182
20239
  await api.post("/host/heartbeat", {
20183
20240
  host_id: hostId,
20184
20241
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -20321,7 +20378,7 @@ async function pollCycleInner() {
20321
20378
  }
20322
20379
  try {
20323
20380
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
20324
- const { collectDiagnostics } = await import("../persistent-session-WBWYC4XL.js");
20381
+ const { collectDiagnostics } = await import("../persistent-session-LMR3WHVO.js");
20325
20382
  const diagCodeNames = [...agentState.persistentSessionAgents];
20326
20383
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
20327
20384
  let tailscaleHostname;
@@ -20614,7 +20671,7 @@ async function pollCycleInner() {
20614
20671
  }
20615
20672
  try {
20616
20673
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
20617
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-BHSYASF3.js");
20674
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-L3NMDSSG.js");
20618
20675
  const securityFloor = currentSecurityFloor();
20619
20676
  claudeUpdaterInFlight = true;
20620
20677
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -20649,7 +20706,7 @@ async function pollCycleInner() {
20649
20706
  collectPanelessActivityProbes,
20650
20707
  getResponsivenessIntervalMs,
20651
20708
  occupancyQualificationClassifications
20652
- } = await import("../responsiveness-probe-BLLWDXE4.js");
20709
+ } = await import("../responsiveness-probe-FWPQTPQ5.js");
20653
20710
  const probeIntervalMs = getResponsivenessIntervalMs();
20654
20711
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
20655
20712
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -20766,7 +20823,7 @@ async function pollCycleInner() {
20766
20823
  collectResponsivenessProbes,
20767
20824
  livePendingInboundOldestAgeSeconds,
20768
20825
  parkPendingInbound
20769
- } = await import("../responsiveness-probe-BLLWDXE4.js");
20826
+ } = await import("../responsiveness-probe-FWPQTPQ5.js");
20770
20827
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-5PCBGRNY.js");
20771
20828
  const wedgeNow = /* @__PURE__ */ new Date();
20772
20829
  const liveAgents = agentState.persistentSessionAgents;
@@ -21052,7 +21109,7 @@ async function pollCycleInner() {
21052
21109
  }
21053
21110
  }
21054
21111
  );
21055
- const { parkPendingInbound } = await import("../responsiveness-probe-BLLWDXE4.js");
21112
+ const { parkPendingInbound } = await import("../responsiveness-probe-FWPQTPQ5.js");
21056
21113
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
21057
21114
  paneFatalStreak.delete(codeName);
21058
21115
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -21083,7 +21140,7 @@ async function pollCycleInner() {
21083
21140
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
21084
21141
  bindSourceEscalations
21085
21142
  } = await import("../transcript-mount-health-OHE6IVJV.js");
21086
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-WBWYC4XL.js");
21143
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-LMR3WHVO.js");
21087
21144
  const mountConfig = resolveTranscriptMountConfig();
21088
21145
  const liveAgents = agentState.persistentSessionAgents;
21089
21146
  for (const tracked of [
@@ -21248,7 +21305,7 @@ async function pollCycleInner() {
21248
21305
  }
21249
21306
  try {
21250
21307
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
21251
- const { probeSessionAuth } = await import("../session-auth-dead-NJR7X5T6.js");
21308
+ const { probeSessionAuth } = await import("../session-auth-dead-5PNG5ILK.js");
21252
21309
  const observations = [];
21253
21310
  const pendingCacheCommits = [];
21254
21311
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -23845,7 +23902,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
23845
23902
  }
23846
23903
  const reloadRendered = rotationHandled && !orphanPruneFailed && !mcpWriteFailed;
23847
23904
  if (configReloads.isPending(agent.agent_id) && integrationsFresh && reloadRendered) {
23848
- configReloads.noteFreshRender(agent.agent_id, Date.now());
23905
+ configReloads.noteFreshRender(agent.agent_id, Date.now(), projectMcpHash(agent.code_name, getProjectDir(agent.code_name)));
23849
23906
  }
23850
23907
  confirmConfigReload(
23851
23908
  {
@@ -26317,7 +26374,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
26317
26374
  if (!refreshData) return;
26318
26375
  const framework = refreshData.agent?.framework ?? agentFrameworkCache.get(codeName) ?? DEFAULT_FRAMEWORK;
26319
26376
  const hostId = await getHostId();
26320
- const parkForRestart = await import("../responsiveness-probe-BLLWDXE4.js").then(
26377
+ const parkForRestart = await import("../responsiveness-probe-FWPQTPQ5.js").then(
26321
26378
  (m) => m.parkPendingInbound,
26322
26379
  (err) => err
26323
26380
  );
@@ -26394,7 +26451,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
26394
26451
  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}`));
26395
26452
  void (async () => {
26396
26453
  try {
26397
- const { collectDiagnostics } = await import("../persistent-session-WBWYC4XL.js");
26454
+ const { collectDiagnostics } = await import("../persistent-session-LMR3WHVO.js");
26398
26455
  await api.post("/host/heartbeat", {
26399
26456
  host_id: hostId,
26400
26457
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -26447,7 +26504,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
26447
26504
  }
26448
26505
  try {
26449
26506
  const hostId = await getHostId();
26450
- const { collectDiagnostics } = await import("../persistent-session-WBWYC4XL.js");
26507
+ const { collectDiagnostics } = await import("../persistent-session-LMR3WHVO.js");
26451
26508
  await api.post("/host/heartbeat", {
26452
26509
  host_id: hostId,
26453
26510
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -27174,7 +27231,7 @@ async function processClaudePairSessions(agents) {
27174
27231
  snapshotPairConfig,
27175
27232
  // ENG-11659: result -> report body + the manager.log line that records it.
27176
27233
  planPairStartReport
27177
- } = await import("../claude-pair-runtime-27FK2QO2.js");
27234
+ } = await import("../claude-pair-runtime-TUVLJDJZ.js");
27178
27235
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
27179
27236
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
27180
27237
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);