@integrity-labs/agt-cli 0.7.10 → 0.7.11

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
@@ -3411,7 +3411,7 @@ async function acpxCloseCommand(agent2, _opts, cmd) {
3411
3411
  import { execSync } from "child_process";
3412
3412
  import chalk19 from "chalk";
3413
3413
  import ora15 from "ora";
3414
- var cliVersion = true ? "0.7.10" : "dev";
3414
+ var cliVersion = true ? "0.7.11" : "dev";
3415
3415
  async function fetchLatestVersion() {
3416
3416
  const host2 = AGT_HOST;
3417
3417
  if (!host2) return null;
@@ -3527,7 +3527,7 @@ async function checkForUpdateOnStartup() {
3527
3527
  }
3528
3528
 
3529
3529
  // src/bin/agt.ts
3530
- var cliVersion2 = true ? "0.7.10" : "dev";
3530
+ var cliVersion2 = true ? "0.7.11" : "dev";
3531
3531
  var program = new Command();
3532
3532
  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");
3533
3533
  program.hook("preAction", (thisCommand) => {
@@ -21,7 +21,7 @@ import {
21
21
 
22
22
  // src/lib/manager-worker.ts
23
23
  import { createHash } from "crypto";
24
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2, existsSync as existsSync2, rmSync, readdirSync, statSync, unlinkSync } from "fs";
24
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync, existsSync as existsSync2, rmSync, readdirSync, statSync, unlinkSync } from "fs";
25
25
  import https from "https";
26
26
  import { join as join2 } from "path";
27
27
 
@@ -327,10 +327,33 @@ var GatewayClientPool = class extends EventEmitter {
327
327
  };
328
328
 
329
329
  // src/lib/persistent-session.ts
330
- import { execFileSync } from "child_process";
331
- import { join } from "path";
330
+ import { execFileSync, execSync } from "child_process";
331
+ import { join, dirname } from "path";
332
332
  import { homedir } from "os";
333
333
  import { existsSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
334
+ import { fileURLToPath } from "url";
335
+ var _acpxBin = null;
336
+ function getAcpxBin() {
337
+ if (_acpxBin) return _acpxBin;
338
+ const localBin = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "node_modules", ".bin", "acpx");
339
+ if (existsSync(localBin)) {
340
+ _acpxBin = localBin;
341
+ return _acpxBin;
342
+ }
343
+ try {
344
+ execSync("which acpx", { stdio: "ignore" });
345
+ _acpxBin = "acpx";
346
+ return _acpxBin;
347
+ } catch {
348
+ }
349
+ try {
350
+ execSync("npm install -g acpx@latest", { stdio: "ignore", timeout: 6e4 });
351
+ _acpxBin = "acpx";
352
+ return _acpxBin;
353
+ } catch {
354
+ throw new Error("acpx not found and auto-install failed. Run: npm install -g acpx");
355
+ }
356
+ }
334
357
  var sessions = /* @__PURE__ */ new Map();
335
358
  function writeAcpxConfig(config2) {
336
359
  const { projectDir, mcpConfigPath, claudeMdPath, channels, devChannels } = config2;
@@ -407,7 +430,7 @@ function spawnSession(config2, session) {
407
430
  try {
408
431
  sanitizeMcpJson(mcpConfigPath, apiHost);
409
432
  writeAcpxConfig(config2);
410
- execFileSync("acpx", [
433
+ execFileSync(getAcpxBin(), [
411
434
  "claude",
412
435
  "sessions",
413
436
  "ensure",
@@ -418,7 +441,7 @@ function spawnSession(config2, session) {
418
441
  timeout: 3e4,
419
442
  stdio: "ignore"
420
443
  });
421
- execFileSync("acpx", [
444
+ execFileSync(getAcpxBin(), [
422
445
  "claude",
423
446
  "-s",
424
447
  sessionName,
@@ -448,7 +471,7 @@ function stopPersistentSession(codeName, log2) {
448
471
  session.status = "stopped";
449
472
  const projectDir = getProjectDir2(codeName);
450
473
  try {
451
- execFileSync("acpx", ["claude", "sessions", "close", `agt-${codeName}`], {
474
+ execFileSync(getAcpxBin(), ["claude", "sessions", "close", `agt-${codeName}`], {
452
475
  cwd: projectDir,
453
476
  timeout: 1e4,
454
477
  stdio: "ignore"
@@ -471,7 +494,7 @@ async function injectMessage(codeName, type, content, meta) {
471
494
  const prefix = meta?.task_name ? `[Task: ${meta.task_name}] ` : "";
472
495
  const text = prefix + content;
473
496
  try {
474
- execFileSync("acpx", [
497
+ execFileSync(getAcpxBin(), [
475
498
  "claude",
476
499
  "-s",
477
500
  sessionName,
@@ -493,7 +516,7 @@ function isSessionHealthy(codeName) {
493
516
  if (!session || session.status !== "running") return false;
494
517
  const projectDir = getProjectDir2(codeName);
495
518
  try {
496
- const output = execFileSync("acpx", [
519
+ const output = execFileSync(getAcpxBin(), [
497
520
  "claude",
498
521
  "-s",
499
522
  `agt-${codeName}`,
@@ -973,7 +996,7 @@ function loadGatewayPorts() {
973
996
  }
974
997
  }
975
998
  function saveGatewayPorts(ports) {
976
- mkdirSync2(AUGMENTED_DIR, { recursive: true });
999
+ mkdirSync(AUGMENTED_DIR, { recursive: true });
977
1000
  writeFileSync3(GATEWAY_PORTS_FILE, JSON.stringify(ports, null, 2));
978
1001
  }
979
1002
  function allocatePort(codeName) {
@@ -1056,7 +1079,7 @@ async function migrateToProfiles() {
1056
1079
  const profileAuthDir = join2(profileDir, "agents", codeName, "agent");
1057
1080
  const authFile = join2(sharedAuthDir, "auth-profiles.json");
1058
1081
  if (existsSync2(authFile)) {
1059
- mkdirSync2(profileAuthDir, { recursive: true });
1082
+ mkdirSync(profileAuthDir, { recursive: true });
1060
1083
  const authContent = readFileSync3(authFile, "utf-8");
1061
1084
  writeFileSync3(join2(profileAuthDir, "auth-profiles.json"), authContent);
1062
1085
  }
@@ -1563,7 +1586,7 @@ async function processAgent(agent, agentStates) {
1563
1586
  try {
1564
1587
  const artifacts = generateArtifacts(agent, refreshData, frameworkAdapter);
1565
1588
  const changedFiles = [];
1566
- mkdirSync2(agentDir, { recursive: true });
1589
+ mkdirSync(agentDir, { recursive: true });
1567
1590
  for (const artifact of artifacts) {
1568
1591
  const filePath = join2(agentDir, artifact.relativePath);
1569
1592
  const newHash = sha256(artifact.content);
@@ -2624,7 +2647,7 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
2624
2647
  const markerDir = join2(projectDir2, ".claude");
2625
2648
  const markerPath = join2(markerDir, ".agt-pending-task.json");
2626
2649
  try {
2627
- mkdirSync2(markerDir, { recursive: true });
2650
+ mkdirSync(markerDir, { recursive: true });
2628
2651
  writeFileSync3(markerPath, JSON.stringify({
2629
2652
  agent_id: agent.agent_id,
2630
2653
  task_id: task.taskId,