@integrity-labs/agt-cli 0.7.10 → 0.7.12

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.12" : "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.12" : "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,27 @@ 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
+ throw new Error("acpx not found. Run: npm install -g acpx");
349
+ }
350
+ }
334
351
  var sessions = /* @__PURE__ */ new Map();
335
352
  function writeAcpxConfig(config2) {
336
353
  const { projectDir, mcpConfigPath, claudeMdPath, channels, devChannels } = config2;
@@ -407,7 +424,7 @@ function spawnSession(config2, session) {
407
424
  try {
408
425
  sanitizeMcpJson(mcpConfigPath, apiHost);
409
426
  writeAcpxConfig(config2);
410
- execFileSync("acpx", [
427
+ execFileSync(getAcpxBin(), [
411
428
  "claude",
412
429
  "sessions",
413
430
  "ensure",
@@ -418,7 +435,7 @@ function spawnSession(config2, session) {
418
435
  timeout: 3e4,
419
436
  stdio: "ignore"
420
437
  });
421
- execFileSync("acpx", [
438
+ execFileSync(getAcpxBin(), [
422
439
  "claude",
423
440
  "-s",
424
441
  sessionName,
@@ -448,7 +465,7 @@ function stopPersistentSession(codeName, log2) {
448
465
  session.status = "stopped";
449
466
  const projectDir = getProjectDir2(codeName);
450
467
  try {
451
- execFileSync("acpx", ["claude", "sessions", "close", `agt-${codeName}`], {
468
+ execFileSync(getAcpxBin(), ["claude", "sessions", "close", `agt-${codeName}`], {
452
469
  cwd: projectDir,
453
470
  timeout: 1e4,
454
471
  stdio: "ignore"
@@ -471,7 +488,7 @@ async function injectMessage(codeName, type, content, meta) {
471
488
  const prefix = meta?.task_name ? `[Task: ${meta.task_name}] ` : "";
472
489
  const text = prefix + content;
473
490
  try {
474
- execFileSync("acpx", [
491
+ execFileSync(getAcpxBin(), [
475
492
  "claude",
476
493
  "-s",
477
494
  sessionName,
@@ -493,7 +510,7 @@ function isSessionHealthy(codeName) {
493
510
  if (!session || session.status !== "running") return false;
494
511
  const projectDir = getProjectDir2(codeName);
495
512
  try {
496
- const output = execFileSync("acpx", [
513
+ const output = execFileSync(getAcpxBin(), [
497
514
  "claude",
498
515
  "-s",
499
516
  `agt-${codeName}`,
@@ -973,7 +990,7 @@ function loadGatewayPorts() {
973
990
  }
974
991
  }
975
992
  function saveGatewayPorts(ports) {
976
- mkdirSync2(AUGMENTED_DIR, { recursive: true });
993
+ mkdirSync(AUGMENTED_DIR, { recursive: true });
977
994
  writeFileSync3(GATEWAY_PORTS_FILE, JSON.stringify(ports, null, 2));
978
995
  }
979
996
  function allocatePort(codeName) {
@@ -1056,7 +1073,7 @@ async function migrateToProfiles() {
1056
1073
  const profileAuthDir = join2(profileDir, "agents", codeName, "agent");
1057
1074
  const authFile = join2(sharedAuthDir, "auth-profiles.json");
1058
1075
  if (existsSync2(authFile)) {
1059
- mkdirSync2(profileAuthDir, { recursive: true });
1076
+ mkdirSync(profileAuthDir, { recursive: true });
1060
1077
  const authContent = readFileSync3(authFile, "utf-8");
1061
1078
  writeFileSync3(join2(profileAuthDir, "auth-profiles.json"), authContent);
1062
1079
  }
@@ -1563,7 +1580,7 @@ async function processAgent(agent, agentStates) {
1563
1580
  try {
1564
1581
  const artifacts = generateArtifacts(agent, refreshData, frameworkAdapter);
1565
1582
  const changedFiles = [];
1566
- mkdirSync2(agentDir, { recursive: true });
1583
+ mkdirSync(agentDir, { recursive: true });
1567
1584
  for (const artifact of artifacts) {
1568
1585
  const filePath = join2(agentDir, artifact.relativePath);
1569
1586
  const newHash = sha256(artifact.content);
@@ -2624,7 +2641,7 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
2624
2641
  const markerDir = join2(projectDir2, ".claude");
2625
2642
  const markerPath = join2(markerDir, ".agt-pending-task.json");
2626
2643
  try {
2627
- mkdirSync2(markerDir, { recursive: true });
2644
+ mkdirSync(markerDir, { recursive: true });
2628
2645
  writeFileSync3(markerPath, JSON.stringify({
2629
2646
  agent_id: agent.agent_id,
2630
2647
  task_id: task.taskId,