@integrity-labs/agt-cli 0.28.1051 → 0.28.1053

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.
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvFileEntries,
17
17
  parseEnvIntegrations,
18
18
  shellQuote
19
- } from "./chunk-FNUTMHWV.js";
19
+ } from "./chunk-4ZH75WMF.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -7122,7 +7122,7 @@ function exchangeFailureKind(err) {
7122
7122
  }
7123
7123
 
7124
7124
  // src/lib/api-client.ts
7125
- var agtCliVersion = true ? "0.28.1051" : "dev";
7125
+ var agtCliVersion = true ? "0.28.1053" : "dev";
7126
7126
  var lastConfigHash = null;
7127
7127
  function setConfigHash(hash) {
7128
7128
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -12079,4 +12079,4 @@ export {
12079
12079
  managerInstallSystemUnitCommand,
12080
12080
  managerUninstallSystemUnitCommand
12081
12081
  };
12082
- //# sourceMappingURL=chunk-RE4DLJBA.js.map
12082
+ //# sourceMappingURL=chunk-Z45XEW4H.js.map
@@ -266,7 +266,7 @@ async function spawnPairSession(session) {
266
266
  return { ok: true };
267
267
  } catch {
268
268
  }
269
- const { resolveClaudeBinary } = await import("./persistent-session-3FT727PQ.js");
269
+ const { resolveClaudeBinary } = await import("./persistent-session-5RX4P7GP.js");
270
270
  const claudeBin = resolveClaudeBinary();
271
271
  const pairEnv = {
272
272
  ...process.env,
@@ -734,4 +734,4 @@ export {
734
734
  startClaudePair,
735
735
  submitClaudePairCode
736
736
  };
737
- //# sourceMappingURL=claude-pair-runtime-53UOTF6V.js.map
737
+ //# sourceMappingURL=claude-pair-runtime-KMPRE2ZJ.js.map
@@ -66,7 +66,7 @@ import {
66
66
  safeWriteJsonAtomic,
67
67
  setConfigHash,
68
68
  tripClass
69
- } from "../chunk-RE4DLJBA.js";
69
+ } from "../chunk-Z45XEW4H.js";
70
70
  import {
71
71
  getProjectDir as getProjectDir2,
72
72
  getReadyTasks,
@@ -88,6 +88,7 @@ import {
88
88
  collectChannelSpawnSecrets,
89
89
  creditWatchdogGiveUpCount,
90
90
  creditWatchdogUnclaimedDialogCount,
91
+ denyWebFetchForToolsContent,
91
92
  effectiveIsolationMode,
92
93
  egressMode,
93
94
  execFilePromiseLong,
@@ -129,6 +130,7 @@ import {
129
130
  resetRestartCount,
130
131
  resolveClaudeBinary,
131
132
  resolveContainerMemory,
133
+ resolveWebFetchBaseline,
132
134
  restartEgressSidecar,
133
135
  rotatePaneLogForDayRollover,
134
136
  rotateSessionForWedge,
@@ -148,8 +150,10 @@ import {
148
150
  takeWatchdogUnclaimedDialogCount,
149
151
  takeZombieDetection,
150
152
  toOpencodeModel,
153
+ webFetchBaselineValue,
154
+ webFetchRestartNeeded,
151
155
  writeEgressAllowlist
152
- } from "../chunk-FNUTMHWV.js";
156
+ } from "../chunk-4ZH75WMF.js";
153
157
  import {
154
158
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
155
159
  AnchorSessionClient,
@@ -6723,7 +6727,15 @@ var BASELINE_CONCERNS = [
6723
6727
  // telegramPolicy baseline and take the whole fleet through a fail-closed
6724
6728
  // restart round to add a key — the precedent set when telegramPolicy itself
6725
6729
  // was added.
6726
- "agentRules"
6730
+ "agentRules",
6731
+ // ENG-11168 (Obi Wan 218694c47fe3 on #6601): the WebFetch decision a running
6732
+ // session was SPAWNED with ('deny' | 'allow'). `--disallowedTools WebFetch` is
6733
+ // a spawn flag, so a network-policy change reaches a session only by respawn,
6734
+ // and the manager has to remember across its own restarts what each surviving
6735
+ // session actually has. Written only at spawn, where the flag is a fact; never
6736
+ // when a respawn is merely scheduled (the ENG-7771 lesson). Additive, so no
6737
+ // version bump - same reasoning as agentRules above.
6738
+ "webFetch"
6727
6739
  ];
6728
6740
  function createDeliveryBaselineMaps() {
6729
6741
  return {
@@ -6731,7 +6743,8 @@ function createDeliveryBaselineMaps() {
6731
6743
  slackBehaviour: /* @__PURE__ */ new Map(),
6732
6744
  msteamsBehaviour: /* @__PURE__ */ new Map(),
6733
6745
  telegramPolicy: /* @__PURE__ */ new Map(),
6734
- agentRules: /* @__PURE__ */ new Map()
6746
+ agentRules: /* @__PURE__ */ new Map(),
6747
+ webFetch: /* @__PURE__ */ new Map()
6735
6748
  };
6736
6749
  }
6737
6750
  function getSenderPolicyBaselineFile(configDir) {
@@ -14040,7 +14053,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
14040
14053
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
14041
14054
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
14042
14055
  async function channelInboundActivityAgeSecondsFor(codeName) {
14043
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-DEG3SWG3.js");
14056
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-C75AUK6I.js");
14044
14057
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
14045
14058
  if (newest === null) return null;
14046
14059
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -14786,7 +14799,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
14786
14799
  var lastVersionCheckAt = 0;
14787
14800
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
14788
14801
  var lastResponsivenessProbeAt = 0;
14789
- var agtCliVersion = true ? "0.28.1051" : "dev";
14802
+ var agtCliVersion = true ? "0.28.1053" : "dev";
14790
14803
  function resolveBrewPath(execFileSync3) {
14791
14804
  try {
14792
14805
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -16421,7 +16434,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
16421
16434
  if (codeNames.length === 0) return;
16422
16435
  void (async () => {
16423
16436
  try {
16424
- const { collectDiagnostics } = await import("../persistent-session-3FT727PQ.js");
16437
+ const { collectDiagnostics } = await import("../persistent-session-5RX4P7GP.js");
16425
16438
  await api.post("/host/heartbeat", {
16426
16439
  host_id: hostId,
16427
16440
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -16563,7 +16576,7 @@ async function pollCycleInner() {
16563
16576
  }
16564
16577
  try {
16565
16578
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
16566
- const { collectDiagnostics } = await import("../persistent-session-3FT727PQ.js");
16579
+ const { collectDiagnostics } = await import("../persistent-session-5RX4P7GP.js");
16567
16580
  const diagCodeNames = [...agentState.persistentSessionAgents];
16568
16581
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor) : void 0;
16569
16582
  let tailscaleHostname;
@@ -16748,7 +16761,7 @@ async function pollCycleInner() {
16748
16761
  collectPanelessActivityProbes,
16749
16762
  getResponsivenessIntervalMs,
16750
16763
  occupancyQualificationClassifications
16751
- } = await import("../responsiveness-probe-DEG3SWG3.js");
16764
+ } = await import("../responsiveness-probe-C75AUK6I.js");
16752
16765
  const probeIntervalMs = getResponsivenessIntervalMs();
16753
16766
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
16754
16767
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -16865,7 +16878,7 @@ async function pollCycleInner() {
16865
16878
  collectResponsivenessProbes,
16866
16879
  livePendingInboundOldestAgeSeconds,
16867
16880
  parkPendingInbound
16868
- } = await import("../responsiveness-probe-DEG3SWG3.js");
16881
+ } = await import("../responsiveness-probe-C75AUK6I.js");
16869
16882
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
16870
16883
  const wedgeNow = /* @__PURE__ */ new Date();
16871
16884
  const liveAgents = agentState.persistentSessionAgents;
@@ -20606,6 +20619,7 @@ function clearSessionPolicyBaseline(codeName) {
20606
20619
  }
20607
20620
  var opencodeCredentialFingerprintBySession = /* @__PURE__ */ new Map();
20608
20621
  var egressAllowlistBySession = /* @__PURE__ */ new Map();
20622
+ var denyWebFetchBySession = /* @__PURE__ */ new Map();
20609
20623
  function deriveEgressAllowlist(toolsRaw, policy) {
20610
20624
  return buildEgressAllowlist(
20611
20625
  toolsRaw ? extractFrontmatter(toolsRaw).frontmatter : null,
@@ -21087,10 +21101,9 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
21087
21101
  });
21088
21102
  trackSessionRun(codeName, sessionRunResult.run_id);
21089
21103
  const spawnPrimaryModel = resolveModelChain(refreshData).primary ?? refreshData.agent?.["primary_model"] ?? null;
21090
- const egressAllowlist = deriveEgressAllowlist(
21091
- refreshData.tools?.raw_content,
21092
- modelPolicy
21093
- );
21104
+ const spawnToolsRaw = refreshData.tools?.raw_content;
21105
+ const egressAllowlist = deriveEgressAllowlist(spawnToolsRaw, modelPolicy);
21106
+ const spawnDenyWebFetch = denyWebFetchForToolsContent(spawnToolsRaw);
21094
21107
  egressAllowlistBySession.set(codeName, egressAllowlist);
21095
21108
  const spawnAgentClass = refreshData.agent?.["agent_class"];
21096
21109
  let perAgentApiKey = null;
@@ -21184,6 +21197,11 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
21184
21197
  // this the flip reaches nothing running under Docker isolation.
21185
21198
  turnFailureNoticeEnabled: hostFlagStore().getBoolean("wedge-transient-notice"),
21186
21199
  egressAllowlist,
21200
+ // ENG-11168: WebFetch follows the agent's network policy, from the SAME
21201
+ // trusted control-plane tools content the egress allowlist uses (never the
21202
+ // agent's on-disk TOOLS.md). Recomputed on every spawn, so a policy change
21203
+ // applies at the next restart rather than being ratcheted in forever.
21204
+ denyWebFetch: spawnDenyWebFetch,
21187
21205
  // ADR-0042 pt3b (ENG-7607 / ENG-8992): this agent's own org-scoped key
21188
21206
  // (null when unarmed). The spawn env carries it as this agent's AGT_API_KEY.
21189
21207
  perAgentApiKey,
@@ -21199,6 +21217,8 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
21199
21217
  agentState.persistentSessionAgents.add(codeName);
21200
21218
  claudeAuthTupleBySession.set(codeName, currentAuthTuple);
21201
21219
  recordSessionPolicyBaseline(codeName, currentPolicyModel, currentPolicyId);
21220
+ denyWebFetchBySession.set(codeName, spawnDenyWebFetch);
21221
+ persistDeliveryBaselineEntry("webFetch", agent.agent_id, webFetchBaselineValue(spawnDenyWebFetch));
21202
21222
  seedSessionLaunchBaselines(codeName, projectDir);
21203
21223
  if (effectiveIsolationMode(codeName) === "docker") {
21204
21224
  seedContainerMemory(codeName, resolveContainerMemory(spawnAgentClass));
@@ -21211,6 +21231,20 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
21211
21231
  };
21212
21232
  }
21213
21233
  resetRestartCount(codeName);
21234
+ const liveDenyWebFetch = denyWebFetchForToolsContent(
21235
+ refreshData.tools?.raw_content
21236
+ );
21237
+ const spawnedDenyWebFetch = resolveWebFetchBaseline(
21238
+ denyWebFetchBySession.get(codeName),
21239
+ persistedDeliveryBaseline.webFetch.get(agent.agent_id)
21240
+ );
21241
+ if (webFetchRestartNeeded(spawnedDenyWebFetch, liveDenyWebFetch)) {
21242
+ log(
21243
+ `[persistent-session] default_network_policy for '${codeName}' changed: WebFetch now ${liveDenyWebFetch ? "withheld" : "allowed"} - respawning to apply it (ENG-11168)`
21244
+ );
21245
+ scheduleSessionRestart(codeName, 0, "network policy change (ENG-11168)");
21246
+ }
21247
+ denyWebFetchBySession.set(codeName, liveDenyWebFetch);
21214
21248
  if (egressMode(codeName) === "allowlist") {
21215
21249
  const allowlist = deriveEgressAllowlist(
21216
21250
  refreshData.tools?.raw_content,
@@ -21565,7 +21599,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
21565
21599
  try {
21566
21600
  const freshId = rotateSessionForWedge(codeName);
21567
21601
  consecutiveWedgeCycles.delete(codeName);
21568
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-DEG3SWG3.js");
21602
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-C75AUK6I.js");
21569
21603
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
21570
21604
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
21571
21605
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -21608,7 +21642,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
21608
21642
  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}`));
21609
21643
  void (async () => {
21610
21644
  try {
21611
- const { collectDiagnostics } = await import("../persistent-session-3FT727PQ.js");
21645
+ const { collectDiagnostics } = await import("../persistent-session-5RX4P7GP.js");
21612
21646
  await api.post("/host/heartbeat", {
21613
21647
  host_id: hostId,
21614
21648
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -21659,7 +21693,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
21659
21693
  }
21660
21694
  try {
21661
21695
  const hostId = await getHostId();
21662
- const { collectDiagnostics } = await import("../persistent-session-3FT727PQ.js");
21696
+ const { collectDiagnostics } = await import("../persistent-session-5RX4P7GP.js");
21663
21697
  await api.post("/host/heartbeat", {
21664
21698
  host_id: hostId,
21665
21699
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -22331,7 +22365,7 @@ async function processClaudePairSessions(agents) {
22331
22365
  // cannot take it for itself — by the time it runs, the write it is looking
22332
22366
  // for may already have happened.
22333
22367
  snapshotPairConfig
22334
- } = await import("../claude-pair-runtime-53UOTF6V.js");
22368
+ } = await import("../claude-pair-runtime-KMPRE2ZJ.js");
22335
22369
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
22336
22370
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
22337
22371
  const killed = await killPairSession(pairTmuxSession(pairId));