@integrity-labs/agt-cli 0.28.243 → 0.28.245

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
@@ -38,7 +38,7 @@ import {
38
38
  success,
39
39
  table,
40
40
  warn
41
- } from "../chunk-U2WPXD6Q.js";
41
+ } from "../chunk-NMSN674U.js";
42
42
  import {
43
43
  CHANNEL_REGISTRY,
44
44
  DEFAULT_FRAMEWORK,
@@ -4826,7 +4826,7 @@ import { execFileSync, execSync } from "child_process";
4826
4826
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4827
4827
  import chalk18 from "chalk";
4828
4828
  import ora16 from "ora";
4829
- var cliVersion = true ? "0.28.243" : "dev";
4829
+ var cliVersion = true ? "0.28.245" : "dev";
4830
4830
  async function fetchLatestVersion() {
4831
4831
  const host2 = getHost();
4832
4832
  if (!host2) return null;
@@ -5840,7 +5840,7 @@ function handleError(err) {
5840
5840
  }
5841
5841
 
5842
5842
  // src/bin/agt.ts
5843
- var cliVersion2 = true ? "0.28.243" : "dev";
5843
+ var cliVersion2 = true ? "0.28.245" : "dev";
5844
5844
  var program = new Command();
5845
5845
  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");
5846
5846
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -5832,7 +5832,7 @@ function requireHost() {
5832
5832
  }
5833
5833
 
5834
5834
  // src/lib/api-client.ts
5835
- var agtCliVersion = true ? "0.28.243" : "dev";
5835
+ var agtCliVersion = true ? "0.28.245" : "dev";
5836
5836
  var lastConfigHash = null;
5837
5837
  function setConfigHash(hash) {
5838
5838
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8102,4 +8102,4 @@ export {
8102
8102
  managerInstallSystemUnitCommand,
8103
8103
  managerUninstallSystemUnitCommand
8104
8104
  };
8105
- //# sourceMappingURL=chunk-U2WPXD6Q.js.map
8105
+ //# sourceMappingURL=chunk-NMSN674U.js.map
@@ -37,7 +37,7 @@ import {
37
37
  requireHost,
38
38
  safeWriteJsonAtomic,
39
39
  setConfigHash
40
- } from "../chunk-U2WPXD6Q.js";
40
+ } from "../chunk-NMSN674U.js";
41
41
  import {
42
42
  getProjectDir as getProjectDir2,
43
43
  getReadyTasks,
@@ -6509,7 +6509,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6509
6509
  var lastVersionCheckAt = 0;
6510
6510
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6511
6511
  var lastResponsivenessProbeAt = 0;
6512
- var agtCliVersion = true ? "0.28.243" : "dev";
6512
+ var agtCliVersion = true ? "0.28.245" : "dev";
6513
6513
  function resolveBrewPath(execFileSync2) {
6514
6514
  try {
6515
6515
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7355,6 +7355,20 @@ function reorderRestartedFirst(agents, restartedIds) {
7355
7355
  }
7356
7356
  return [...restarted, ...rest];
7357
7357
  }
7358
+ function flushRestartedAgentDiagnostics(hostId, codeNames) {
7359
+ if (codeNames.length === 0) return;
7360
+ void (async () => {
7361
+ try {
7362
+ const { collectDiagnostics } = await import("../persistent-session-X427LHOW.js");
7363
+ await api.post("/host/heartbeat", {
7364
+ host_id: hostId,
7365
+ agent_diagnostics: collectDiagnostics(codeNames)
7366
+ });
7367
+ } catch (err) {
7368
+ log(`[restart] post-respawn diagnostics flush failed: ${err.message}`);
7369
+ }
7370
+ })();
7371
+ }
7358
7372
  async function pollCycle() {
7359
7373
  if (!config) return;
7360
7374
  if (restartAfterUpgrade) return;
@@ -7868,7 +7882,8 @@ async function pollCycle() {
7868
7882
  }
7869
7883
  activeChannels.clear();
7870
7884
  const agentStates = [];
7871
- const processOrder = hostFlagStore().getBoolean("fast-mcp-restart-respawn") ? reorderRestartedFirst(agents, new Set(restartAcks.keys())) : agents;
7885
+ const fastRespawn = hostFlagStore().getBoolean("fast-mcp-restart-respawn");
7886
+ const processOrder = fastRespawn ? reorderRestartedFirst(agents, new Set(restartAcks.keys())) : agents;
7872
7887
  for (const agent of processOrder) {
7873
7888
  if (restartInFlight.has(agent.agent_id)) {
7874
7889
  const existing = state6.agents.find((a) => a.agentId === agent.agent_id);
@@ -7900,6 +7915,9 @@ async function pollCycle() {
7900
7915
  });
7901
7916
  }
7902
7917
  }
7918
+ if (fastRespawn && restartAcks.has(agent.agent_id) && isSessionHealthy(agent.code_name)) {
7919
+ flushRestartedAgentDiagnostics(hostId, [agent.code_name]);
7920
+ }
7903
7921
  }
7904
7922
  void maybeReportActivityCache({ api, log });
7905
7923
  const restartAckStateChanged = applyRestartAcks({
@@ -7917,20 +7935,7 @@ async function pollCycle() {
7917
7935
  }
7918
7936
  if (restartAcks.size > 0) {
7919
7937
  const restartedCodeNames = agents.filter((a) => restartAcks.has(a.agent_id)).map((a) => a.code_name);
7920
- if (restartedCodeNames.length > 0) {
7921
- void (async () => {
7922
- try {
7923
- const { collectDiagnostics } = await import("../persistent-session-X427LHOW.js");
7924
- const freshDiagnostics = collectDiagnostics(restartedCodeNames);
7925
- await api.post("/host/heartbeat", {
7926
- host_id: hostId,
7927
- agent_diagnostics: freshDiagnostics
7928
- });
7929
- } catch (err) {
7930
- log(`[restart] post-respawn diagnostics flush failed: ${err.message}`);
7931
- }
7932
- })();
7933
- }
7938
+ flushRestartedAgentDiagnostics(hostId, restartedCodeNames);
7934
7939
  }
7935
7940
  try {
7936
7941
  for (const [channelId, codeNames] of activeChannels) {