@integrity-labs/agt-cli 0.28.350 → 0.28.351

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-CBWLRSM5.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-KFR2GLKC.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-FCW6HWAR.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-NUGUTMMT.js.map
@@ -46,7 +46,7 @@ import {
46
46
  resolveEffectivePinRaw,
47
47
  safeWriteJsonAtomic,
48
48
  setConfigHash
49
- } from "../chunk-LM2RJRAT.js";
49
+ } from "../chunk-F2TH5XVJ.js";
50
50
  import {
51
51
  getProjectDir as getProjectDir2,
52
52
  getReadyTasks,
@@ -137,7 +137,7 @@ import {
137
137
  takeZombieDetection,
138
138
  transcriptActivityAgeSeconds,
139
139
  writeEgressAllowlist
140
- } from "../chunk-EUDBJHMA.js";
140
+ } from "../chunk-OEJ35WXL.js";
141
141
  import {
142
142
  reapOrphanChannelMcps
143
143
  } from "../chunk-XWVM4KPK.js";
@@ -146,7 +146,7 @@ import {
146
146
  import { createHash as createHash14 } from "crypto";
147
147
  import { readFileSync as readFileSync19, writeFileSync as writeFileSync11, mkdirSync as mkdirSync10, existsSync as existsSync13, rmSync as rmSync5, readdirSync as readdirSync5, statSync as statSync4, copyFileSync } from "fs";
148
148
  import { execFileSync as syncExecFile } from "child_process";
149
- import { join as join23, dirname as dirname6 } from "path";
149
+ import { join as join23, dirname as dirname6, delimiter as pathDelimiter } from "path";
150
150
  import { homedir as homedir12 } from "os";
151
151
  import { fileURLToPath } from "url";
152
152
 
@@ -9263,6 +9263,7 @@ var registeredAgentsCache = /* @__PURE__ */ new Map();
9263
9263
  var agentFrameworkCache = /* @__PURE__ */ new Map();
9264
9264
  var migratedSecretStorage = /* @__PURE__ */ new Set();
9265
9265
  var frameworkBinaryChecked = /* @__PURE__ */ new Set();
9266
+ var frameworkBinaryInflight = /* @__PURE__ */ new Map();
9266
9267
  var agentRuntimeAuthenticated = false;
9267
9268
  var lastManagedSettingsStatus = null;
9268
9269
  function resolveAgentFramework(codeName) {
@@ -9303,7 +9304,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9303
9304
  var lastVersionCheckAt = 0;
9304
9305
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9305
9306
  var lastResponsivenessProbeAt = 0;
9306
- var agtCliVersion = true ? "0.28.350" : "dev";
9307
+ var agtCliVersion = true ? "0.28.351" : "dev";
9307
9308
  function resolveBrewPath(execFileSync2) {
9308
9309
  try {
9309
9310
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -9508,9 +9509,63 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
9508
9509
  return "write_failed";
9509
9510
  }
9510
9511
  }
9512
+ var OPENCODE_NPM_VERSION = "1.18.3";
9513
+ async function ensureOpencodeBinary() {
9514
+ const { execFileSync: execFileSync2 } = await import("child_process");
9515
+ const bin = process.env["AGT_OPENCODE_BIN"]?.trim() || "opencode";
9516
+ const probe = () => {
9517
+ try {
9518
+ execFileSync2(bin, ["--version"], { stdio: "ignore", timeout: 1e4 });
9519
+ return true;
9520
+ } catch {
9521
+ return false;
9522
+ }
9523
+ };
9524
+ if (probe()) return true;
9525
+ log("[framework-install] opencode binary not found - installing opencode-ai via npm...");
9526
+ try {
9527
+ const r = await runAsync("npm", ["install", "-g", `opencode-ai@${OPENCODE_NPM_VERSION}`], { timeout: 18e4 });
9528
+ if (r.code !== 0) {
9529
+ log(
9530
+ `[framework-install] opencode install failed (exit ${r.code}): ${(r.stderr || r.stdout).trim().slice(0, 300)} - install manually: npm i -g opencode-ai@${OPENCODE_NPM_VERSION}`
9531
+ );
9532
+ return false;
9533
+ }
9534
+ } catch (err) {
9535
+ log(`[framework-install] opencode install threw: ${err.message} - install manually: npm i -g opencode-ai@${OPENCODE_NPM_VERSION}`);
9536
+ return false;
9537
+ }
9538
+ try {
9539
+ const prefix = execFileSync2("npm", ["prefix", "-g"], { encoding: "utf-8", timeout: 1e4 }).trim();
9540
+ if (prefix) {
9541
+ const npmBin = join23(prefix, "bin");
9542
+ const current = (process.env.PATH ?? "").split(pathDelimiter);
9543
+ if (!current.includes(npmBin)) {
9544
+ process.env.PATH = [npmBin, ...current.filter(Boolean)].join(pathDelimiter);
9545
+ }
9546
+ }
9547
+ } catch {
9548
+ }
9549
+ if (!probe()) {
9550
+ log(`[framework-install] opencode installed but '${bin} --version' still fails to resolve - will retry next cycle`);
9551
+ return false;
9552
+ }
9553
+ log("[framework-install] opencode installed");
9554
+ return true;
9555
+ }
9511
9556
  async function ensureFrameworkBinary(frameworkId) {
9512
- if (frameworkId !== "claude-code") return;
9557
+ if (frameworkId !== "claude-code" && frameworkId !== "opencode") return;
9513
9558
  if (frameworkBinaryChecked.has(frameworkId)) return;
9559
+ if (frameworkId === "opencode") {
9560
+ const inflight = frameworkBinaryInflight.get(frameworkId);
9561
+ if (inflight) return inflight;
9562
+ const attempt = (async () => {
9563
+ const ok = await ensureOpencodeBinary();
9564
+ if (ok) frameworkBinaryChecked.add(frameworkId);
9565
+ })().finally(() => frameworkBinaryInflight.delete(frameworkId));
9566
+ frameworkBinaryInflight.set(frameworkId, attempt);
9567
+ return attempt;
9568
+ }
9514
9569
  frameworkBinaryChecked.add(frameworkId);
9515
9570
  lastManagedSettingsStatus = ensureClaudeManagedSettings();
9516
9571
  const { execFileSync: execFileSync2 } = await import("child_process");
@@ -10268,7 +10323,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
10268
10323
  if (codeNames.length === 0) return;
10269
10324
  void (async () => {
10270
10325
  try {
10271
- const { collectDiagnostics } = await import("../persistent-session-CBWLRSM5.js");
10326
+ const { collectDiagnostics } = await import("../persistent-session-KFR2GLKC.js");
10272
10327
  await api.post("/host/heartbeat", {
10273
10328
  host_id: hostId,
10274
10329
  agent_diagnostics: collectDiagnostics(codeNames)
@@ -10367,7 +10422,7 @@ async function pollCycle() {
10367
10422
  }
10368
10423
  try {
10369
10424
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
10370
- const { collectDiagnostics } = await import("../persistent-session-CBWLRSM5.js");
10425
+ const { collectDiagnostics } = await import("../persistent-session-KFR2GLKC.js");
10371
10426
  const diagCodeNames = [...agentState.persistentSessionAgents];
10372
10427
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
10373
10428
  let tailscaleHostname;
@@ -10522,7 +10577,7 @@ async function pollCycle() {
10522
10577
  const {
10523
10578
  collectResponsivenessProbes,
10524
10579
  getResponsivenessIntervalMs
10525
- } = await import("../responsiveness-probe-56WUFX3U.js");
10580
+ } = await import("../responsiveness-probe-PFPXYTL2.js");
10526
10581
  const probeIntervalMs = getResponsivenessIntervalMs();
10527
10582
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
10528
10583
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -10554,7 +10609,7 @@ async function pollCycle() {
10554
10609
  collectResponsivenessProbes,
10555
10610
  livePendingInboundOldestAgeSeconds,
10556
10611
  parkPendingInbound
10557
- } = await import("../responsiveness-probe-56WUFX3U.js");
10612
+ } = await import("../responsiveness-probe-PFPXYTL2.js");
10558
10613
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-HYOOQV4A.js");
10559
10614
  const wedgeNow = /* @__PURE__ */ new Date();
10560
10615
  const liveAgents = agentState.persistentSessionAgents;
@@ -13668,7 +13723,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
13668
13723
  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}`));
13669
13724
  void (async () => {
13670
13725
  try {
13671
- const { collectDiagnostics } = await import("../persistent-session-CBWLRSM5.js");
13726
+ const { collectDiagnostics } = await import("../persistent-session-KFR2GLKC.js");
13672
13727
  await api.post("/host/heartbeat", {
13673
13728
  host_id: hostId,
13674
13729
  agent_diagnostics: collectDiagnostics([codeName])
@@ -13718,7 +13773,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
13718
13773
  }
13719
13774
  try {
13720
13775
  const hostId = await getHostId();
13721
- const { collectDiagnostics } = await import("../persistent-session-CBWLRSM5.js");
13776
+ const { collectDiagnostics } = await import("../persistent-session-KFR2GLKC.js");
13722
13777
  await api.post("/host/heartbeat", {
13723
13778
  host_id: hostId,
13724
13779
  agent_diagnostics: collectDiagnostics([codeName])
@@ -14216,7 +14271,7 @@ async function processClaudePairSessions(agents) {
14216
14271
  killPairSession,
14217
14272
  pairTmuxSession,
14218
14273
  finalizeClaudePairOnboarding
14219
- } = await import("../claude-pair-runtime-FCW6HWAR.js");
14274
+ } = await import("../claude-pair-runtime-NUGUTMMT.js");
14220
14275
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
14221
14276
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
14222
14277
  const killed = await killPairSession(pairTmuxSession(pairId));