@integrity-labs/agt-cli 0.28.485 → 0.28.486

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.
package/dist/bin/agt.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-QFQTGSXQ.js";
43
+ } from "../chunk-XP53UXQR.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -4830,7 +4830,7 @@ import { execFileSync, execSync } from "child_process";
4830
4830
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4831
4831
  import chalk18 from "chalk";
4832
4832
  import ora16 from "ora";
4833
- var cliVersion = true ? "0.28.485" : "dev";
4833
+ var cliVersion = true ? "0.28.486" : "dev";
4834
4834
  async function fetchLatestVersion() {
4835
4835
  const host2 = getHost();
4836
4836
  if (!host2) return null;
@@ -6002,7 +6002,7 @@ function handleError(err) {
6002
6002
  }
6003
6003
 
6004
6004
  // src/bin/agt.ts
6005
- var cliVersion2 = true ? "0.28.485" : "dev";
6005
+ var cliVersion2 = true ? "0.28.486" : "dev";
6006
6006
  var program = new Command();
6007
6007
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6008
6008
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -4938,7 +4938,7 @@ function exchangeFailureKind(err) {
4938
4938
  }
4939
4939
 
4940
4940
  // src/lib/api-client.ts
4941
- var agtCliVersion = true ? "0.28.485" : "dev";
4941
+ var agtCliVersion = true ? "0.28.486" : "dev";
4942
4942
  var lastConfigHash = null;
4943
4943
  function setConfigHash(hash) {
4944
4944
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -7667,4 +7667,4 @@ export {
7667
7667
  managerInstallSystemUnitCommand,
7668
7668
  managerUninstallSystemUnitCommand
7669
7669
  };
7670
- //# sourceMappingURL=chunk-QFQTGSXQ.js.map
7670
+ //# sourceMappingURL=chunk-XP53UXQR.js.map
@@ -44,7 +44,7 @@ import {
44
44
  resolveEffectivePinRaw,
45
45
  safeWriteJsonAtomic,
46
46
  setConfigHash
47
- } from "../chunk-QFQTGSXQ.js";
47
+ } from "../chunk-XP53UXQR.js";
48
48
  import {
49
49
  getProjectDir as getProjectDir2,
50
50
  getReadyTasks,
@@ -9355,7 +9355,23 @@ function restartReasonBindsNewMcp(breakerReason) {
9355
9355
  function dashboardRestartBreakerReason(restartReason) {
9356
9356
  return restartReason === "integration-change" ? "integration-change" : void 0;
9357
9357
  }
9358
- function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-reload-mcp", beforeStop) {
9358
+ function shouldReportRestartToAudit(breakerReason) {
9359
+ return !!breakerReason && breakerReason !== "agent-requested" && breakerReason !== "channel-restart-flag" && breakerReason !== "integration-change";
9360
+ }
9361
+ function reportRestartEvent(codeName, breakerReason, auditDetail) {
9362
+ if (!shouldReportRestartToAudit(breakerReason)) return;
9363
+ const restartAgentId = agentState.codeNameToAgentId.get(codeName);
9364
+ if (!restartAgentId) return;
9365
+ void api.post("/host/restart-event", {
9366
+ agent_id: restartAgentId,
9367
+ source: breakerReason,
9368
+ // ENG-8293: fall back to the source string (the pre-ENG-8293 shape)
9369
+ // only when the caller supplied nothing better.
9370
+ reason: auditDetail?.reason ?? breakerReason,
9371
+ ...auditDetail?.detail ? { detail: auditDetail.detail } : {}
9372
+ }).catch((err) => log(`[restart-event] report failed for '${codeName}': ${err.message}`));
9373
+ }
9374
+ function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-reload-mcp", beforeStop, auditDetail) {
9359
9375
  const existing = pendingSessionRestarts.get(codeName);
9360
9376
  if (existing) {
9361
9377
  const keepExistingWindowExempt = isWindowExemptRestartReason(existing.breakerReason) && !isWindowExemptRestartReason(breakerReason);
@@ -9379,7 +9395,17 @@ function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-
9379
9395
  );
9380
9396
  deferLogThrottle.set(codeName, Date.now());
9381
9397
  }
9382
- scheduleSessionRestart(codeName, RESTART_DEFER_RECHECK_MS, reason, breakerReason, beforeStop);
9398
+ scheduleSessionRestart(
9399
+ codeName,
9400
+ RESTART_DEFER_RECHECK_MS,
9401
+ reason,
9402
+ breakerReason,
9403
+ beforeStop,
9404
+ // Carry the audit detail across the re-arm: a restart held for the
9405
+ // maintenance window must still be able to say what changed when it
9406
+ // finally fires.
9407
+ auditDetail
9408
+ );
9383
9409
  return;
9384
9410
  }
9385
9411
  deferLogThrottle.delete(codeName);
@@ -9422,6 +9448,7 @@ function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-
9422
9448
  sessionLaunchManagedStructure.delete(codeName);
9423
9449
  recordRestartForBreaker(codeName, breakerReason);
9424
9450
  log(`[hot-reload] Session stopped for '${codeName}' \u2014 will respawn with ${reason}`);
9451
+ reportRestartEvent(codeName, breakerReason, { reason, detail: auditDetail });
9425
9452
  const bindsNewMcp = restartReasonBindsNewMcp(breakerReason);
9426
9453
  if (bindsNewMcp) {
9427
9454
  const prior = pendingRestartVerifications.get(codeName);
@@ -9435,7 +9462,7 @@ function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-
9435
9462
  }
9436
9463
  }, delayMs);
9437
9464
  timer2.unref?.();
9438
- pendingSessionRestarts.set(codeName, { timer: timer2, reason, breakerReason, beforeStop });
9465
+ pendingSessionRestarts.set(codeName, { timer: timer2, reason, breakerReason, beforeStop, auditDetail });
9439
9466
  }
9440
9467
  function cancelPendingSessionRestart(codeName) {
9441
9468
  pendingRestartVerifications.delete(codeName);
@@ -9861,19 +9888,7 @@ function stopPersistentSessionAndForgetMcpBaseline(codeName, breakerReason, gate
9861
9888
  if (breakerReason) {
9862
9889
  recordRestartForBreaker(codeName, breakerReason);
9863
9890
  }
9864
- if (breakerReason && breakerReason !== "agent-requested" && breakerReason !== "channel-restart-flag" && breakerReason !== "integration-change") {
9865
- const restartAgentId = agentState.codeNameToAgentId.get(codeName);
9866
- if (restartAgentId) {
9867
- void api.post("/host/restart-event", {
9868
- agent_id: restartAgentId,
9869
- source: breakerReason,
9870
- // ENG-8293: fall back to the source string (the pre-ENG-8293 shape)
9871
- // only when the caller supplied nothing better.
9872
- reason: auditDetail?.reason ?? breakerReason,
9873
- ...auditDetail?.detail ? { detail: auditDetail.detail } : {}
9874
- }).catch((err) => log(`[restart-event] report failed for '${codeName}': ${err.message}`));
9875
- }
9876
- }
9891
+ reportRestartEvent(codeName, breakerReason, auditDetail);
9877
9892
  }
9878
9893
  var agentRuntimeTeardownDeps = {
9879
9894
  stopOpencodeServe: (codeName, teardownLog) => stopOpencodeSession(codeName, teardownLog),
@@ -10064,7 +10079,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
10064
10079
  var lastVersionCheckAt = 0;
10065
10080
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
10066
10081
  var lastResponsivenessProbeAt = 0;
10067
- var agtCliVersion = true ? "0.28.485" : "dev";
10082
+ var agtCliVersion = true ? "0.28.486" : "dev";
10068
10083
  function resolveBrewPath(execFileSync2) {
10069
10084
  try {
10070
10085
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13283,7 +13298,13 @@ async function processAgent(agent, agentStates) {
13283
13298
  agent.code_name,
13284
13299
  0,
13285
13300
  `env-only integration change (${respawnVars.join(", ")})`,
13286
- envRespawnReason
13301
+ envRespawnReason,
13302
+ void 0,
13303
+ // Structured "what changed" for the audit row. Var NAMES only —
13304
+ // never values — and carried as string values under neutral
13305
+ // keys, because the audit scrubber redacts by key name and
13306
+ // would blank a key like `github_access_token` (ENG-8293).
13307
+ { env_only_change: { vars: respawnVars, kind: envRespawnReason } }
13287
13308
  );
13288
13309
  log(
13289
13310
  `[hot-reload] Scheduled respawn for '${agent.code_name}' to apply env-only integration change (no MCP child to reap): ${respawnVars.join(", ")} [reason=${envRespawnReason}] (ENG-7510/ENG-7541)`
@@ -16436,6 +16457,7 @@ export {
16436
16457
  reorderRestartedFirst,
16437
16458
  resolveManagedMcpServerId,
16438
16459
  restartReasonBindsNewMcp,
16460
+ shouldReportRestartToAudit,
16439
16461
  shouldSkipRevokedCleanup,
16440
16462
  shouldUpdateOnLatest,
16441
16463
  stampClaudeCodeUpgradeMarker,