@integrity-labs/agt-cli 0.8.1 → 0.8.3

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.8.1" : "dev";
3414
+ var cliVersion = true ? "0.8.3" : "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.8.1" : "dev";
3530
+ var cliVersion2 = true ? "0.8.3" : "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) => {
@@ -438,7 +438,7 @@ function spawnSession(config2, session) {
438
438
  const value = line.slice(eqIdx + 1);
439
439
  return `${key}=${JSON.stringify(value)}`;
440
440
  }).join(" ");
441
- if (envVars) envPrefix = `env ${envVars} `;
441
+ if (envVars) envPrefix = `CLAUDE_CODE_SIMPLE=1 ${envVars} `;
442
442
  } catch {
443
443
  }
444
444
  }
@@ -521,9 +521,12 @@ async function acceptDialogs(tmuxSession, codeName, log2) {
521
521
  }
522
522
  }
523
523
  }
524
- async function injectMessage(codeName, type, content, meta) {
524
+ async function injectMessage(codeName, type, content, meta, log2) {
525
+ const _log = log2 ?? ((_) => {
526
+ });
525
527
  const session = sessions.get(codeName);
526
528
  if (!session || session.status !== "running") {
529
+ _log(`[inject] SKIP '${codeName}' \u2014 session ${session ? `status=${session.status}` : "not found in Map"}`);
527
530
  return false;
528
531
  }
529
532
  const prefix = meta?.task_name ? `[Task: ${meta.task_name}] ` : "";
@@ -536,11 +539,10 @@ async function injectMessage(codeName, type, content, meta) {
536
539
  mkdirSync(tmpDir, { recursive: true });
537
540
  const tmpFile = join(tmpDir, ".agt-inject-prompt.txt");
538
541
  writeFileSync2(tmpFile, text);
542
+ _log(`[inject] acpx exec: cwd=${projectDir}, file=${tmpFile}, bin=${acpx}`);
539
543
  execFileSync(acpx, [
540
544
  "claude",
541
545
  "exec",
542
- "--cwd",
543
- projectDir,
544
546
  "-f",
545
547
  tmpFile
546
548
  ], {
@@ -550,13 +552,18 @@ async function injectMessage(codeName, type, content, meta) {
550
552
  stdio: "ignore"
551
553
  });
552
554
  return true;
553
- } catch {
555
+ } catch (err) {
556
+ _log(`[inject] acpx exec failed for '${codeName}': ${err.message}`);
554
557
  }
558
+ } else {
559
+ _log(`[inject] acpx binary not found \u2014 falling back to tmux send-keys`);
555
560
  }
556
561
  try {
557
562
  execFileSync("tmux", ["send-keys", "-t", `agt-${codeName}`, text, "Enter"], { stdio: "ignore" });
563
+ _log(`[inject] tmux send-keys sent for '${codeName}' \u2014 unverified (returning false)`);
558
564
  return false;
559
- } catch {
565
+ } catch (err) {
566
+ _log(`[inject] tmux send-keys failed for '${codeName}': ${err.message}`);
560
567
  return false;
561
568
  }
562
569
  }
@@ -1926,7 +1933,7 @@ async function processAgent(agent, agentStates) {
1926
1933
  const names = integrations.map((i) => i.display_name || i.definition_id).join(", ");
1927
1934
  injectMessage(agent.code_name, "system", `Your integrations have been updated. You now have access to: ${names}. Re-read your CLAUDE.md for details.`, {
1928
1935
  task_name: "integration-update"
1929
- }).catch(() => {
1936
+ }, log).catch(() => {
1930
1937
  });
1931
1938
  }
1932
1939
  const managedIntegrations = integrations.filter((i) => i.auth_type === "managed");
@@ -2222,7 +2229,7 @@ async function processAgent(agent, agentStates) {
2222
2229
  const taskHint = todayItem ? ` Top item: "${todayItem.title}" (priority ${todayItem.priority}).` : "";
2223
2230
  injectMessage(agent.code_name, "task", `New work triggered. Check your kanban board with kanban_list and pick up the next item.${taskHint}`, {
2224
2231
  task_name: "kanban-work-trigger"
2225
- });
2232
+ }, log);
2226
2233
  log(`[persistent-session] Work trigger injected for '${agent.code_name}'`);
2227
2234
  } else {
2228
2235
  log(`[persistent-session] Work trigger skipped for '${agent.code_name}' \u2014 session not yet healthy`);
@@ -2767,7 +2774,7 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
2767
2774
  task_id: task.taskId,
2768
2775
  template_id: task.templateId,
2769
2776
  task_name: task.name
2770
- });
2777
+ }, log);
2771
2778
  if (injected) {
2772
2779
  const updated = markTaskFired(codeName, task.taskId, "ok");
2773
2780
  claudeSchedulerStates.set(codeName, updated);
@@ -2950,7 +2957,7 @@ function ensureRealtimeKanbanStarted(agentStates) {
2950
2957
  if (isSessionHealthy(agent.codeName)) {
2951
2958
  injectMessage(agent.codeName, "task", `New task added to your board: "${item.title}" (priority ${item.priority}). Pick it up \u2014 move to in_progress and start working.`, {
2952
2959
  task_name: "kanban-work-trigger"
2953
- });
2960
+ }, log);
2954
2961
  log(`[realtime] Injected kanban-work trigger for '${agent.codeName}': "${item.title}"`);
2955
2962
  } else {
2956
2963
  fireClaudeWorkTrigger(agent.codeName, agent.agentId, boardItems);