@integrity-labs/agt-cli 0.28.354 → 0.28.356

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-4ITNBU3K.js";
43
+ } from "../chunk-3OVI7DRG.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -4829,7 +4829,7 @@ import { execFileSync, execSync } from "child_process";
4829
4829
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4830
4830
  import chalk18 from "chalk";
4831
4831
  import ora16 from "ora";
4832
- var cliVersion = true ? "0.28.354" : "dev";
4832
+ var cliVersion = true ? "0.28.356" : "dev";
4833
4833
  async function fetchLatestVersion() {
4834
4834
  const host2 = getHost();
4835
4835
  if (!host2) return null;
@@ -6001,7 +6001,7 @@ function handleError(err) {
6001
6001
  }
6002
6002
 
6003
6003
  // src/bin/agt.ts
6004
- var cliVersion2 = true ? "0.28.354" : "dev";
6004
+ var cliVersion2 = true ? "0.28.356" : "dev";
6005
6005
  var program = new Command();
6006
6006
  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");
6007
6007
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -7146,7 +7146,7 @@ function requireHost() {
7146
7146
  }
7147
7147
 
7148
7148
  // src/lib/api-client.ts
7149
- var agtCliVersion = true ? "0.28.354" : "dev";
7149
+ var agtCliVersion = true ? "0.28.356" : "dev";
7150
7150
  var lastConfigHash = null;
7151
7151
  function setConfigHash(hash) {
7152
7152
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -9597,4 +9597,4 @@ export {
9597
9597
  managerInstallSystemUnitCommand,
9598
9598
  managerUninstallSystemUnitCommand
9599
9599
  };
9600
- //# sourceMappingURL=chunk-4ITNBU3K.js.map
9600
+ //# sourceMappingURL=chunk-3OVI7DRG.js.map
@@ -48,7 +48,7 @@ import {
48
48
  safeWriteJsonAtomic,
49
49
  setConfigHash,
50
50
  toOpencodeModel
51
- } from "../chunk-4ITNBU3K.js";
51
+ } from "../chunk-3OVI7DRG.js";
52
52
  import {
53
53
  getProjectDir as getProjectDir2,
54
54
  getReadyTasks,
@@ -146,9 +146,9 @@ import {
146
146
 
147
147
  // src/lib/manager-worker.ts
148
148
  import { createHash as createHash14 } from "crypto";
149
- import { readFileSync as readFileSync19, writeFileSync as writeFileSync12, mkdirSync as mkdirSync10, existsSync as existsSync13, rmSync as rmSync5, readdirSync as readdirSync5, statSync as statSync4, copyFileSync } from "fs";
149
+ import { readFileSync as readFileSync19, writeFileSync as writeFileSync12, mkdirSync as mkdirSync10, existsSync as existsSync13, rmSync as rmSync6, readdirSync as readdirSync5, statSync as statSync4, copyFileSync } from "fs";
150
150
  import { execFileSync as syncExecFile } from "child_process";
151
- import { join as join23, dirname as dirname7, delimiter as pathDelimiter } from "path";
151
+ import { join as join23, dirname as dirname6, delimiter as pathDelimiter } from "path";
152
152
  import { homedir as homedir12 } from "os";
153
153
  import { fileURLToPath } from "url";
154
154
 
@@ -5637,9 +5637,9 @@ async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData
5637
5637
  import { spawn, execSync } from "child_process";
5638
5638
  import { createServer } from "net";
5639
5639
  import { randomBytes } from "crypto";
5640
- import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync16, writeFileSync as writeFileSync9 } from "fs";
5640
+ import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync16, writeFileSync as writeFileSync9, rmSync as rmSync4, chmodSync as chmodSync2 } from "fs";
5641
5641
  import { homedir as homedir10, userInfo } from "os";
5642
- import { join as join20, dirname as dirname6 } from "path";
5642
+ import { join as join20 } from "path";
5643
5643
  var OPENCODE_BIN = process.env["AGT_OPENCODE_BIN"]?.trim() || "opencode";
5644
5644
  var sessions = /* @__PURE__ */ new Map();
5645
5645
  var bridges = /* @__PURE__ */ new Map();
@@ -5669,23 +5669,30 @@ function materializeEnvPlaceholders(raw, env) {
5669
5669
  return typeof v === "string" && v.length > 0 ? v : whole;
5670
5670
  });
5671
5671
  }
5672
- function deliverOpencodeConfigToXdg(codeName, projectDir, serveEnv, log2) {
5672
+ var MATERIALIZED_CONFIG_BASENAME = "opencode.jsonc";
5673
+ function writeMaterializedOpencodeConfig(codeName, projectDir, serveEnv, log2) {
5674
+ const target = join20(projectDir, MATERIALIZED_CONFIG_BASENAME);
5673
5675
  let raw;
5674
5676
  try {
5675
5677
  raw = readFileSync16(join20(projectDir, "opencode.json"), "utf-8");
5676
5678
  } catch {
5677
- return null;
5679
+ try {
5680
+ if (existsSync10(target)) rmSync4(target);
5681
+ } catch {
5682
+ }
5683
+ return true;
5678
5684
  }
5679
- const materialized = materializeEnvPlaceholders(raw, serveEnv);
5680
- const xdgConfigHome = join20(dirname6(projectDir), "opencode-xdg");
5681
5685
  try {
5682
- mkdirSync7(join20(xdgConfigHome, "opencode"), { recursive: true });
5683
- writeFileSync9(join20(xdgConfigHome, "opencode", "opencode.json"), materialized, { mode: 384 });
5684
- return xdgConfigHome;
5686
+ writeFileSync9(target, materializeEnvPlaceholders(raw, serveEnv), { mode: 384 });
5685
5687
  } catch (err) {
5686
- log2(`[opencode-session] failed to deliver opencode config to XDG for '${codeName}': ${err.message}`);
5687
- return null;
5688
+ log2(`[opencode-session] failed to write materialized opencode.jsonc for '${codeName}': ${err.message}`);
5689
+ return false;
5690
+ }
5691
+ try {
5692
+ chmodSync2(target, 384);
5693
+ } catch {
5688
5694
  }
5695
+ return true;
5689
5696
  }
5690
5697
  function baseUrlFor(port) {
5691
5698
  return `http://127.0.0.1:${port}`;
@@ -5778,8 +5785,9 @@ async function spawnServe(config2, session) {
5778
5785
  };
5779
5786
  if (config2.runId) serveEnv["AGT_RUN_ID"] = config2.runId;
5780
5787
  if (config2.agentTimezone) serveEnv["TZ"] = config2.agentTimezone;
5781
- const xdgConfigHome = deliverOpencodeConfigToXdg(codeName, projectDir, serveEnv, log2);
5782
- if (xdgConfigHome) serveEnv["XDG_CONFIG_HOME"] = xdgConfigHome;
5788
+ if (!writeMaterializedOpencodeConfig(codeName, projectDir, serveEnv, log2)) {
5789
+ throw new Error("failed to write materialized opencode.jsonc (serve would 401 on the {env:\u2026} template)");
5790
+ }
5783
5791
  const serveCmd = `${OPENCODE_BIN} serve --hostname 127.0.0.1 --port ${port} --print-logs`;
5784
5792
  log2(`[opencode-session] starting '${tmuxSession}' for '${codeName}' on 127.0.0.1:${port}`);
5785
5793
  const child = spawn(
@@ -7822,7 +7830,7 @@ function partitionActionableByPoison(actionable, states, config2) {
7822
7830
  }
7823
7831
 
7824
7832
  // src/lib/restart-flags.ts
7825
- import { existsSync as existsSync12, mkdirSync as mkdirSync9, readdirSync as readdirSync4, readFileSync as readFileSync18, renameSync as renameSync3, rmSync as rmSync4, writeFileSync as writeFileSync11 } from "fs";
7833
+ import { existsSync as existsSync12, mkdirSync as mkdirSync9, readdirSync as readdirSync4, readFileSync as readFileSync18, renameSync as renameSync3, rmSync as rmSync5, writeFileSync as writeFileSync11 } from "fs";
7826
7834
  import { homedir as homedir11 } from "os";
7827
7835
  import { join as join22 } from "path";
7828
7836
  import { randomUUID as randomUUID2 } from "crypto";
@@ -7858,7 +7866,7 @@ function readRestartFlags() {
7858
7866
  function deleteRestartFlag(codeName) {
7859
7867
  const path = flagPath(codeName);
7860
7868
  if (existsSync12(path)) {
7861
- rmSync4(path, { force: true });
7869
+ rmSync5(path, { force: true });
7862
7870
  }
7863
7871
  }
7864
7872
 
@@ -9452,7 +9460,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9452
9460
  var lastVersionCheckAt = 0;
9453
9461
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9454
9462
  var lastResponsivenessProbeAt = 0;
9455
- var agtCliVersion = true ? "0.28.354" : "dev";
9463
+ var agtCliVersion = true ? "0.28.356" : "dev";
9456
9464
  function resolveBrewPath(execFileSync2) {
9457
9465
  try {
9458
9466
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -9547,7 +9555,7 @@ async function ensureToolkitCli(toolkitSlug) {
9547
9555
  toolkitCliEnsured.add(toolkitSlug);
9548
9556
  return;
9549
9557
  }
9550
- brewBinDir = dirname7(brewPath);
9558
+ brewBinDir = dirname6(brewPath);
9551
9559
  const isRoot = typeof process.getuid === "function" && process.getuid() === 0;
9552
9560
  log(`[toolkit-install] ${toolkitSlug}: installing via brew (${pkg})\u2026`);
9553
9561
  if (isRoot) {
@@ -9647,7 +9655,7 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
9647
9655
  }
9648
9656
  if (settings.channelsEnabled === true) return "ok";
9649
9657
  settings.channelsEnabled = true;
9650
- mkdirSync10(dirname7(path), { recursive: true });
9658
+ mkdirSync10(dirname6(path), { recursive: true });
9651
9659
  writeFileSync12(path, `${JSON.stringify(settings, null, 2)}
9652
9660
  `);
9653
9661
  log(`[managed-settings] set channelsEnabled:true in ${path} (ENG-5786 \u2014 unblocks Claude Code channels)`);
@@ -9743,7 +9751,7 @@ async function ensureFrameworkBinary(frameworkId) {
9743
9751
  log(`Claude Code install failed: ${err.message}`);
9744
9752
  return;
9745
9753
  }
9746
- const brewBinDir = dirname7(brewPath);
9754
+ const brewBinDir = dirname6(brewPath);
9747
9755
  if (!process.env.PATH?.split(":").includes(brewBinDir)) {
9748
9756
  process.env.PATH = `${brewBinDir}:${process.env.PATH ?? ""}`;
9749
9757
  }
@@ -11627,7 +11635,7 @@ async function processAgent(agent, agentStates) {
11627
11635
  log(`${verb} '${agent.code_name}': ${fileNames}`);
11628
11636
  for (const file of changedFiles) {
11629
11637
  const filePath = join23(agentDir, file.relativePath);
11630
- mkdirSync10(dirname7(filePath), { recursive: true });
11638
+ mkdirSync10(dirname6(filePath), { recursive: true });
11631
11639
  if (file.relativePath === ".mcp.json") {
11632
11640
  safeWriteJsonAtomic(filePath, file.content, { mode: 384 });
11633
11641
  } else {
@@ -11640,7 +11648,7 @@ async function processAgent(agent, agentStates) {
11640
11648
  for (const folder of readdirSync5(provSkillsDir)) {
11641
11649
  if (folder.startsWith("knowledge-")) {
11642
11650
  try {
11643
- rmSync5(join23(provSkillsDir, folder), { recursive: true });
11651
+ rmSync6(join23(provSkillsDir, folder), { recursive: true });
11644
11652
  } catch {
11645
11653
  }
11646
11654
  }
@@ -11678,7 +11686,7 @@ async function processAgent(agent, agentStates) {
11678
11686
  if (!file.endsWith(".js")) continue;
11679
11687
  if (expected.has(file)) continue;
11680
11688
  try {
11681
- rmSync5(join23(provWorkflowsDir, file));
11689
+ rmSync6(join23(provWorkflowsDir, file));
11682
11690
  } catch {
11683
11691
  }
11684
11692
  }
@@ -12215,7 +12223,7 @@ async function processAgent(agent, agentStates) {
12215
12223
  const staleChannelsPath = join23(projectDir, ".mcp-channels.json");
12216
12224
  if (existsSync13(staleChannelsPath)) {
12217
12225
  try {
12218
- rmSync5(staleChannelsPath, { force: true });
12226
+ rmSync6(staleChannelsPath, { force: true });
12219
12227
  } catch {
12220
12228
  }
12221
12229
  }
@@ -12635,7 +12643,7 @@ async function processAgent(agent, agentStates) {
12635
12643
  }
12636
12644
  }
12637
12645
  try {
12638
- const { readdirSync: readdirSync6, rmSync: rmSync6 } = await import("fs");
12646
+ const { readdirSync: readdirSync6, rmSync: rmSync7 } = await import("fs");
12639
12647
  const { homedir: homedir13 } = await import("os");
12640
12648
  const frameworkId2 = frameworkAdapter.id;
12641
12649
  const candidateSkillDirs = [
@@ -12663,7 +12671,7 @@ async function processAgent(agent, agentStates) {
12663
12671
  for (const dir of existingDirs) {
12664
12672
  const p = join23(dir, entry);
12665
12673
  if (existsSync13(p)) {
12666
- rmSync6(p, { recursive: true, force: true });
12674
+ rmSync7(p, { recursive: true, force: true });
12667
12675
  }
12668
12676
  }
12669
12677
  log(`Removed ${reason} '${entry}' for '${agent.code_name}' (framework=${frameworkId2})`);
@@ -12710,7 +12718,7 @@ async function processAgent(agent, agentStates) {
12710
12718
  for (const dir of globalSkillDirs) {
12711
12719
  const p = join23(dir, id);
12712
12720
  if (existsSync13(p) && existsSync13(join23(p, "SKILL.md"))) {
12713
- rmSync5(p, { recursive: true, force: true });
12721
+ rmSync6(p, { recursive: true, force: true });
12714
12722
  prunedAny = true;
12715
12723
  }
12716
12724
  }
@@ -14248,7 +14256,7 @@ async function processDirectChatMessage(agent, msg) {
14248
14256
  if (useDoorbell) {
14249
14257
  try {
14250
14258
  const doorbell = directChatDoorbellPath(agent.agentId, homedir12());
14251
- mkdirSync10(dirname7(doorbell), { recursive: true });
14259
+ mkdirSync10(dirname6(doorbell), { recursive: true });
14252
14260
  writeFileSync12(doorbell, String(Date.now()));
14253
14261
  log(`[direct-chat] Doorbell rung for '${agent.codeName}' (msg=${msg.id}) \u2014 in-session MCP will pull via the cursor`);
14254
14262
  return;
@@ -14358,7 +14366,7 @@ ${formatRunMarker(run_id)}` : KANBAN_CHECK_COMMAND;
14358
14366
  if (run_id) openInjectedRunByCode.set(codeName, run_id);
14359
14367
  try {
14360
14368
  const doorbell = directChatDoorbellPath(agentId, homedir12());
14361
- mkdirSync10(dirname7(doorbell), { recursive: true });
14369
+ mkdirSync10(dirname6(doorbell), { recursive: true });
14362
14370
  writeFileSync12(doorbell, String(Date.now()));
14363
14371
  } catch (err) {
14364
14372
  log(`[kanban] doorbell ring failed for '${codeName}': ${err.message} (notice still queued)`);
@@ -14827,7 +14835,7 @@ ${mem.content}
14827
14835
  async function cleanupAgentFiles(codeName, agentDir) {
14828
14836
  if (existsSync13(agentDir)) {
14829
14837
  try {
14830
- rmSync5(agentDir, { recursive: true, force: true });
14838
+ rmSync6(agentDir, { recursive: true, force: true });
14831
14839
  log(`Removed provision directory for '${codeName}'`);
14832
14840
  } catch (err) {
14833
14841
  log(`Failed to remove provision dir for '${codeName}': ${err.message}`);
@@ -15210,7 +15218,7 @@ function restartRunningChannelMcps(basenames) {
15210
15218
  function deployMcpAssets() {
15211
15219
  const targetDir = join23(homedir12(), ".augmented", "_mcp");
15212
15220
  mkdirSync10(targetDir, { recursive: true });
15213
- const moduleDir = dirname7(fileURLToPath(import.meta.url));
15221
+ const moduleDir = dirname6(fileURLToPath(import.meta.url));
15214
15222
  let mcpSourceDir = "";
15215
15223
  let dir = moduleDir;
15216
15224
  for (let i = 0; i < 6; i++) {
@@ -15219,7 +15227,7 @@ function deployMcpAssets() {
15219
15227
  mcpSourceDir = candidate;
15220
15228
  break;
15221
15229
  }
15222
- const parent = dirname7(dir);
15230
+ const parent = dirname6(dir);
15223
15231
  if (parent === dir) break;
15224
15232
  dir = parent;
15225
15233
  }