@integrity-labs/agt-cli 0.28.708 → 0.28.709

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,10 +40,10 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-7ZW4P5EU.js";
43
+ } from "../chunk-EPBHR2XN.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
- } from "../chunk-VYG4CTEQ.js";
46
+ } from "../chunk-QKEWEV6X.js";
47
47
  import {
48
48
  AnchorSessionClient,
49
49
  CHANNEL_REGISTRY,
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
4909
4909
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4910
4910
  import chalk18 from "chalk";
4911
4911
  import ora16 from "ora";
4912
- var cliVersion = true ? "0.28.708" : "dev";
4912
+ var cliVersion = true ? "0.28.709" : "dev";
4913
4913
  async function fetchLatestVersion() {
4914
4914
  const host2 = getHost();
4915
4915
  if (!host2) return null;
@@ -6089,7 +6089,7 @@ function handleError(err) {
6089
6089
  }
6090
6090
 
6091
6091
  // src/bin/agt.ts
6092
- var cliVersion2 = true ? "0.28.708" : "dev";
6092
+ var cliVersion2 = true ? "0.28.709" : "dev";
6093
6093
  var program = new Command();
6094
6094
  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");
6095
6095
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -12,7 +12,7 @@ import {
12
12
  parseEnvFileEntries,
13
13
  parseEnvIntegrations,
14
14
  shellQuote
15
- } from "./chunk-VYG4CTEQ.js";
15
+ } from "./chunk-QKEWEV6X.js";
16
16
  import {
17
17
  BIND_FAILURE_QUARANTINE_THRESHOLD,
18
18
  INTEGRATIONS_SECTION_END,
@@ -6396,7 +6396,7 @@ function exchangeFailureKind(err) {
6396
6396
  }
6397
6397
 
6398
6398
  // src/lib/api-client.ts
6399
- var agtCliVersion = true ? "0.28.708" : "dev";
6399
+ var agtCliVersion = true ? "0.28.709" : "dev";
6400
6400
  var lastConfigHash = null;
6401
6401
  function setConfigHash(hash) {
6402
6402
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10137,4 +10137,4 @@ export {
10137
10137
  managerInstallSystemUnitCommand,
10138
10138
  managerUninstallSystemUnitCommand
10139
10139
  };
10140
- //# sourceMappingURL=chunk-7ZW4P5EU.js.map
10140
+ //# sourceMappingURL=chunk-EPBHR2XN.js.map
@@ -2620,6 +2620,52 @@ function findUsageLimitSafeOption(screen) {
2620
2620
  function findUsageLimitSafeOptionKey(screen) {
2621
2621
  return findUsageLimitSafeOption(screen)?.key ?? null;
2622
2622
  }
2623
+ var CONSENT_BLOCK_LINES = 12;
2624
+ function lastIndexWhere(xs, pred) {
2625
+ for (let i = xs.length - 1; i >= 0; i--) {
2626
+ if (pred(xs[i])) return i;
2627
+ }
2628
+ return -1;
2629
+ }
2630
+ function isCursorRow(line2) {
2631
+ return /^[^\S\n]*❯[^\S\n]+\S/.test(line2);
2632
+ }
2633
+ function isOptionRowFor(line2, label) {
2634
+ const escaped = label.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
2635
+ return new RegExp(
2636
+ String.raw`^[^\S\n]*(?:❯[^\S\n]*)?(?:\d\.[^\S\n]*)?` + escaped + String.raw`[^\S\n]*$`
2637
+ ).test(line2);
2638
+ }
2639
+ function selectRowKeys(screen, label) {
2640
+ const block = focusedModalBlock(screen, CONSENT_BLOCK_LINES);
2641
+ if (!block) return null;
2642
+ const target = lastIndexWhere(block, (l) => isOptionRowFor(l, label));
2643
+ if (target < 0) return null;
2644
+ const digit = optionRowDigit(block[target], label);
2645
+ if (digit !== null) return [digit, "Enter"];
2646
+ const cursors = [];
2647
+ for (let i = 0; i < block.length; i++) {
2648
+ if (isCursorRow(block[i])) cursors.push(i);
2649
+ }
2650
+ if (cursors.length === 0) return null;
2651
+ let cursor = cursors[0];
2652
+ let tied = false;
2653
+ for (const i of cursors.slice(1)) {
2654
+ const d = Math.abs(i - target);
2655
+ const best = Math.abs(cursor - target);
2656
+ if (d < best) {
2657
+ cursor = i;
2658
+ tied = false;
2659
+ } else if (d === best) {
2660
+ tied = true;
2661
+ }
2662
+ }
2663
+ if (tied) return null;
2664
+ const distance = target - cursor;
2665
+ if (distance === 0) return ["Enter"];
2666
+ const step = distance > 0 ? "Down" : "Up";
2667
+ return [...Array(Math.abs(distance)).fill(step), "Enter"];
2668
+ }
2623
2669
  function findUsageLimitResetHint(screen) {
2624
2670
  const block = usageLimitModalBlock(screen);
2625
2671
  if (!block) return null;
@@ -2659,18 +2705,20 @@ function sweepDialogs(screen) {
2659
2705
  logMessage: "Auto-accepted theme picker"
2660
2706
  };
2661
2707
  }
2662
- if (screen.includes("Yes, I trust this folder")) {
2708
+ const trustKeys = screen.includes("Yes, I trust this folder") ? selectRowKeys(screen, "Yes, I trust this folder") : null;
2709
+ if (trustKeys) {
2663
2710
  return {
2664
2711
  kind: "folder-trust",
2665
- keys: ["Enter"],
2666
- interKeyDelayMs: 0,
2712
+ keys: trustKeys,
2713
+ interKeyDelayMs: 300,
2667
2714
  logMessage: "Auto-accepted folder trust"
2668
2715
  };
2669
2716
  }
2670
- if (isResumeModeDialogVisible(screen)) {
2717
+ const resumeKeys = isResumeModeDialogVisible(screen) ? selectRowKeys(screen, "Don't ask me again") : null;
2718
+ if (resumeKeys) {
2671
2719
  return {
2672
2720
  kind: "resume-mode",
2673
- keys: ["3", "Enter"],
2721
+ keys: resumeKeys,
2674
2722
  interKeyDelayMs: 300,
2675
2723
  logMessage: "Auto-dismissed resume-mode dialog (picked 'Don't ask me again')"
2676
2724
  };
@@ -2691,10 +2739,11 @@ function sweepDialogs(screen) {
2691
2739
  logMessage: "Auto-accepted MCP servers"
2692
2740
  };
2693
2741
  }
2694
- if (screen.includes("Yes, I accept") && screen.includes("Bypass Permissions")) {
2742
+ const bypassKeys = screen.includes("Yes, I accept") && screen.includes("Bypass Permissions") ? selectRowKeys(screen, "Yes, I accept") : null;
2743
+ if (bypassKeys) {
2695
2744
  return {
2696
2745
  kind: "bypass-permissions",
2697
- keys: ["2", "Enter"],
2746
+ keys: bypassKeys,
2698
2747
  interKeyDelayMs: 300,
2699
2748
  logMessage: "Auto-accepted bypass permissions"
2700
2749
  };
@@ -4540,4 +4589,4 @@ export {
4540
4589
  stopAllSessionsAndWait,
4541
4590
  getProjectDir
4542
4591
  };
4543
- //# sourceMappingURL=chunk-VYG4CTEQ.js.map
4592
+ //# sourceMappingURL=chunk-QKEWEV6X.js.map