@integrity-labs/agt-cli 0.28.1177 → 0.28.1179

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.
Files changed (38) hide show
  1. package/dist/bin/agt.js +104 -417
  2. package/dist/bin/agt.js.map +1 -1
  3. package/dist/{chunk-DJNCIWVG.js → chunk-2FHYCFZM.js} +2 -2
  4. package/dist/{chunk-H37WRW2E.js → chunk-GJD536LU.js} +9 -6
  5. package/dist/chunk-GJD536LU.js.map +1 -0
  6. package/dist/{manager-supervisor-KIFBGETA.js → chunk-H3JMPEH7.js} +176 -8
  7. package/dist/chunk-H3JMPEH7.js.map +1 -0
  8. package/dist/{chunk-NHUXO5H2.js → chunk-KDYZNWZW.js} +2 -2
  9. package/dist/{chunk-45UH24I2.js → chunk-O5P2OS36.js} +435 -56
  10. package/dist/chunk-O5P2OS36.js.map +1 -0
  11. package/dist/{chunk-47P33SZF.js → chunk-PINFVWGX.js} +120 -3
  12. package/dist/chunk-PINFVWGX.js.map +1 -0
  13. package/dist/{claude-code-updater-H7RNX6M7.js → claude-code-updater-LL7KVAU3.js} +3 -3
  14. package/dist/{claude-pair-runtime-53JY6TQX.js → claude-pair-runtime-R5MNSUM7.js} +3 -3
  15. package/dist/lib/manager-worker.js +636 -262
  16. package/dist/lib/manager-worker.js.map +1 -1
  17. package/dist/manager-supervisor-TD7E6FPC.js +26 -0
  18. package/dist/mcp/direct-chat-channel.js +18 -1
  19. package/dist/mcp/index.js +151 -63
  20. package/dist/mcp/origami.js +18 -1
  21. package/dist/mcp/slack-channel.js +18 -1
  22. package/dist/mcp/telegram-channel.js +18 -1
  23. package/dist/{persistent-session-HVYGIS5C.js → persistent-session-34QXCPJK.js} +4 -4
  24. package/dist/persistent-session-34QXCPJK.js.map +1 -0
  25. package/dist/{responsiveness-probe-OGZ6ADVR.js → responsiveness-probe-ZT6ITMYI.js} +4 -4
  26. package/dist/{session-auth-dead-2JJLKURE.js → session-auth-dead-KAHV2ES2.js} +3 -3
  27. package/package.json +1 -1
  28. package/dist/chunk-45UH24I2.js.map +0 -1
  29. package/dist/chunk-47P33SZF.js.map +0 -1
  30. package/dist/chunk-H37WRW2E.js.map +0 -1
  31. package/dist/manager-supervisor-KIFBGETA.js.map +0 -1
  32. /package/dist/{chunk-DJNCIWVG.js.map → chunk-2FHYCFZM.js.map} +0 -0
  33. /package/dist/{chunk-NHUXO5H2.js.map → chunk-KDYZNWZW.js.map} +0 -0
  34. /package/dist/{claude-code-updater-H7RNX6M7.js.map → claude-code-updater-LL7KVAU3.js.map} +0 -0
  35. /package/dist/{claude-pair-runtime-53JY6TQX.js.map → claude-pair-runtime-R5MNSUM7.js.map} +0 -0
  36. /package/dist/{persistent-session-HVYGIS5C.js.map → manager-supervisor-TD7E6FPC.js.map} +0 -0
  37. /package/dist/{responsiveness-probe-OGZ6ADVR.js.map → responsiveness-probe-ZT6ITMYI.js.map} +0 -0
  38. /package/dist/{session-auth-dead-2JJLKURE.js.map → session-auth-dead-KAHV2ES2.js.map} +0 -0
package/dist/bin/agt.js CHANGED
@@ -36,21 +36,21 @@ import {
36
36
  resolveFlagFromLayers,
37
37
  setActiveTeam,
38
38
  setJsonMode,
39
- startWatchdog,
39
+ setupCommand,
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-45UH24I2.js";
43
+ } from "../chunk-O5P2OS36.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-H37WRW2E.js";
48
+ } from "../chunk-GJD536LU.js";
49
49
  import {
50
50
  markDailySessionSpawn,
51
51
  sessionFileExists,
52
52
  sessionTranscriptDir
53
- } from "../chunk-DJNCIWVG.js";
53
+ } from "../chunk-2FHYCFZM.js";
54
54
  import "../chunk-OO36JBFI.js";
55
55
  import "../chunk-6HBXEJHO.js";
56
56
  import "../chunk-XWVM4KPK.js";
@@ -64,7 +64,6 @@ import {
64
64
  SLACK_SCOPE_PRESETS,
65
65
  SlackApiError,
66
66
  createSlackApp,
67
- deriveConsoleUrl,
68
67
  detectDrift,
69
68
  extractFrontmatter,
70
69
  generateCharterMd,
@@ -84,13 +83,13 @@ import {
84
83
  requiredMcpWildcard,
85
84
  resolveChannels,
86
85
  serializeManifestForSlackCli
87
- } from "../chunk-47P33SZF.js";
86
+ } from "../chunk-PINFVWGX.js";
88
87
  import "../chunk-AIUIMEUS.js";
89
88
  import "../chunk-DGUM43GV.js";
90
89
 
91
90
  // src/bin/agt.ts
92
- import { join as join24 } from "path";
93
- import { homedir as homedir12 } from "os";
91
+ import { join as join23 } from "path";
92
+ import { homedir as homedir11 } from "os";
94
93
  import { Command } from "commander";
95
94
 
96
95
  // src/commands/whoami.ts
@@ -4903,321 +4902,9 @@ async function kanbanRecurringDisableCommand(titleOrId, opts) {
4903
4902
  }
4904
4903
  }
4905
4904
 
4906
- // src/commands/setup.ts
4907
- import { existsSync as existsSync10, readFileSync as readFileSync9, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, accessSync, constants as fsConstants } from "fs";
4908
- import { join as join17, dirname as dirname6 } from "path";
4909
- import { homedir as homedir7 } from "os";
4905
+ // src/commands/kanban.ts
4910
4906
  import chalk16 from "chalk";
4911
4907
  import ora14 from "ora";
4912
- function detectShellProfile() {
4913
- const shell = process.env["SHELL"] ?? "";
4914
- const home = homedir7();
4915
- if (shell.includes("zsh")) {
4916
- return join17(home, ".zshrc");
4917
- }
4918
- if (shell.includes("fish")) {
4919
- const fishConfig = join17(home, ".config", "fish", "config.fish");
4920
- return fishConfig;
4921
- }
4922
- const bashrc = join17(home, ".bashrc");
4923
- if (existsSync10(bashrc)) return bashrc;
4924
- return join17(home, ".bash_profile");
4925
- }
4926
- function maybeWriteSystemWideEnv(apiUrl, apiKey, consoleUrl) {
4927
- const empty = { etcEnvironment: false, profileD: false, bashrc: false };
4928
- if (process.platform === "win32") return empty;
4929
- if (typeof process.getuid !== "function" || process.getuid() !== 0) return empty;
4930
- return {
4931
- etcEnvironment: writeEtcEnvironment(apiUrl, apiKey, consoleUrl),
4932
- profileD: writeProfileDScript(apiUrl, apiKey, consoleUrl),
4933
- // Run for its side-effect (wiring /etc/bashrc to source agt.sh) but
4934
- // treat it as a supporting channel, not proof that env values were
4935
- // persisted. Success reporting should reflect actual value writes.
4936
- bashrc: ensureBashrcSourcesProfileD()
4937
- };
4938
- }
4939
- function quoteForEtcEnvironment(value) {
4940
- return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\r?\n/g, "\\n")}"`;
4941
- }
4942
- function quoteForPosixShell(value) {
4943
- return `'${value.replace(/'/g, `'\\''`)}'`;
4944
- }
4945
- function quoteForFishShell(value) {
4946
- return `'${value.replace(/\\/g, "\\\\").replace(/'/g, `\\'`)}'`;
4947
- }
4948
- function writeEtcEnvironment(apiUrl, apiKey, consoleUrl) {
4949
- const envPath = "/etc/environment";
4950
- if (!existsSync10(envPath)) return false;
4951
- try {
4952
- accessSync(envPath, fsConstants.W_OK);
4953
- } catch {
4954
- return false;
4955
- }
4956
- try {
4957
- const current = readFileSync9(envPath, "utf-8");
4958
- const stripped = current.split(/\r?\n/).filter((line) => !/^\s*(?:export\s+)?AGT_(?:HOST|API_KEY|CONSOLE_URL)=/.test(line)).join("\n");
4959
- const base = stripped.endsWith("\n") || stripped.length === 0 ? stripped : `${stripped}
4960
- `;
4961
- const lines = [
4962
- `AGT_HOST=${quoteForEtcEnvironment(apiUrl)}`,
4963
- `AGT_API_KEY=${quoteForEtcEnvironment(apiKey)}`
4964
- ];
4965
- if (consoleUrl) lines.push(`AGT_CONSOLE_URL=${quoteForEtcEnvironment(consoleUrl)}`);
4966
- const appended = `${base}${lines.join("\n")}
4967
- `;
4968
- writeFileSync8(envPath, appended, { mode: 420 });
4969
- return true;
4970
- } catch {
4971
- return false;
4972
- }
4973
- }
4974
- function writeProfileDScript(apiUrl, apiKey, consoleUrl) {
4975
- const profileD = "/etc/profile.d";
4976
- if (!existsSync10(profileD)) return false;
4977
- try {
4978
- accessSync(profileD, fsConstants.W_OK);
4979
- } catch {
4980
- return false;
4981
- }
4982
- try {
4983
- const scriptPath = `${profileD}/agt.sh`;
4984
- const lines = [
4985
- "# Augmented \u2014 auto-generated by `agt setup`. Do not edit.",
4986
- `export AGT_HOST=${quoteForPosixShell(apiUrl)}`,
4987
- `export AGT_API_KEY=${quoteForPosixShell(apiKey)}`
4988
- ];
4989
- if (consoleUrl) lines.push(`export AGT_CONSOLE_URL=${quoteForPosixShell(consoleUrl)}`);
4990
- lines.push("");
4991
- writeFileSync8(scriptPath, lines.join("\n"), { mode: 420 });
4992
- return true;
4993
- } catch {
4994
- return false;
4995
- }
4996
- }
4997
- function ensureBashrcSourcesProfileD() {
4998
- const bashrc = "/etc/bashrc";
4999
- if (!existsSync10(bashrc)) return false;
5000
- try {
5001
- accessSync(bashrc, fsConstants.W_OK);
5002
- } catch {
5003
- return false;
5004
- }
5005
- try {
5006
- const current = readFileSync9(bashrc, "utf-8");
5007
- const marker = "# Augmented (agt) \u2014 source system-wide AGT env";
5008
- if (current.includes(marker)) return true;
5009
- const snippet = [
5010
- "",
5011
- marker,
5012
- "if [ -r /etc/profile.d/agt.sh ]; then",
5013
- " . /etc/profile.d/agt.sh",
5014
- "fi",
5015
- ""
5016
- ].join("\n");
5017
- writeFileSync8(bashrc, current + snippet);
5018
- return true;
5019
- } catch {
5020
- return false;
5021
- }
5022
- }
5023
- function buildExportLines(shell, apiUrl, apiKey, consoleUrl) {
5024
- if (shell.includes("fish")) {
5025
- const lines2 = [
5026
- "",
5027
- "# Augmented (agt) host configuration",
5028
- `set -gx AGT_HOST ${quoteForFishShell(apiUrl)}`,
5029
- `set -gx AGT_API_KEY ${quoteForFishShell(apiKey)}`
5030
- ];
5031
- if (consoleUrl) lines2.push(`set -gx AGT_CONSOLE_URL ${quoteForFishShell(consoleUrl)}`);
5032
- lines2.push("");
5033
- return lines2.join("\n");
5034
- }
5035
- const lines = [
5036
- "",
5037
- "# Augmented (agt) host configuration",
5038
- `export AGT_HOST=${quoteForPosixShell(apiUrl)}`,
5039
- `export AGT_API_KEY=${quoteForPosixShell(apiKey)}`
5040
- ];
5041
- if (consoleUrl) lines.push(`export AGT_CONSOLE_URL=${quoteForPosixShell(consoleUrl)}`);
5042
- lines.push("");
5043
- return lines.join("\n");
5044
- }
5045
- async function setupCommand(token, options = {}) {
5046
- const json = isJsonMode();
5047
- const shortTokenPattern = /^[A-HJ-NP-Z2-9]{4}-[A-HJ-NP-Z2-9]{4}$/i;
5048
- const legacyTokenPattern = /^prov_[a-f0-9]{64}$/i;
5049
- if (!token || !shortTokenPattern.test(token) && !legacyTokenPattern.test(token)) {
5050
- if (json) {
5051
- jsonOutput({ ok: false, error: "Invalid provisioning token. Expected format: XXXX-XXXX or prov_<64 hex>" });
5052
- } else {
5053
- error("Invalid provisioning token. Expected format: XXXX-XXXX or prov_<64 hex>");
5054
- info("Get a provisioning token from the Augmented dashboard after creating a host.");
5055
- }
5056
- process.exitCode = 1;
5057
- return;
5058
- }
5059
- const normalizedToken = shortTokenPattern.test(token) ? token.toUpperCase() : token.toLowerCase();
5060
- const apiHostFlag = options.apiHost?.trim();
5061
- const envHost = process.env["AGT_HOST"]?.trim();
5062
- const apiUrl = apiHostFlag || envHost;
5063
- if (!apiUrl) {
5064
- const msg = "Cannot determine API host for token exchange. Pass --api-host <url> or set AGT_HOST before running `agt setup`.\n Production: --api-host https://api.augmented.team\n Non-prod stage: --api-host https://<stage>.api.staging.augmented.team\n Local development: --api-host http://api.agt.localhost:1355";
5065
- if (json) {
5066
- jsonOutput({ ok: false, error: msg });
5067
- } else {
5068
- error(msg);
5069
- }
5070
- process.exitCode = 1;
5071
- return;
5072
- }
5073
- if (!json) {
5074
- if (apiHostFlag) {
5075
- info(`Exchanging token against ${chalk16.bold(apiUrl)} (from --api-host)`);
5076
- } else {
5077
- info(`Exchanging token against ${chalk16.bold(apiUrl)} (from AGT_HOST)`);
5078
- }
5079
- }
5080
- const spinner = ora14({ text: "Exchanging provisioning token\u2026", isSilent: json });
5081
- spinner.start();
5082
- let setupResult;
5083
- try {
5084
- const res = await fetch(`${apiUrl}/host/setup`, {
5085
- method: "POST",
5086
- headers: { "Content-Type": "application/json" },
5087
- body: JSON.stringify({ token: normalizedToken })
5088
- });
5089
- if (!res.ok) {
5090
- const body = await res.json().catch(() => ({}));
5091
- throw new Error(body["error"] ?? `Setup failed: HTTP ${res.status}`);
5092
- }
5093
- setupResult = await res.json();
5094
- spinner.succeed("Provisioning token accepted");
5095
- } catch (err) {
5096
- spinner.fail("Failed to exchange provisioning token");
5097
- if (json) {
5098
- jsonOutput({ ok: false, error: err.message });
5099
- } else {
5100
- error(err.message);
5101
- }
5102
- process.exitCode = 1;
5103
- return;
5104
- }
5105
- const finalApiUrl = setupResult.api_url || apiUrl;
5106
- process.env["AGT_HOST"] = finalApiUrl;
5107
- process.env["AGT_API_KEY"] = setupResult.api_key;
5108
- const verifySpinner = ora14({ text: "Verifying connection\u2026", isSilent: json });
5109
- verifySpinner.start();
5110
- try {
5111
- const exchange = await exchangeApiKey(setupResult.api_key);
5112
- verifySpinner.succeed("Connection verified");
5113
- if (!json) {
5114
- info(`Host: ${chalk16.bold(setupResult.host_name)}`);
5115
- info(`Host ID: ${exchange.hostId}`);
5116
- info(`Team: ${chalk16.bold(exchange.teamSlug ?? setupResult.team_slug ?? "unknown")}`);
5117
- if (exchange.userEmail) {
5118
- info(`User: ${chalk16.bold(exchange.userEmail)}`);
5119
- }
5120
- }
5121
- } catch (err) {
5122
- verifySpinner.fail("Connection verification failed");
5123
- if (json) {
5124
- jsonOutput({ ok: false, error: err.message });
5125
- } else {
5126
- error(err.message);
5127
- info("Connection could not be verified. No changes were written to your shell profile.");
5128
- info("Check your network connection and try: agt whoami");
5129
- }
5130
- process.exitCode = 1;
5131
- return;
5132
- }
5133
- const profilePath = detectShellProfile();
5134
- const shell = process.env["SHELL"] ?? "bash";
5135
- const consoleUrl = deriveConsoleUrl(finalApiUrl);
5136
- if (consoleUrl) {
5137
- process.env["AGT_CONSOLE_URL"] = consoleUrl;
5138
- }
5139
- if (!json && !consoleUrl) {
5140
- warn(
5141
- `Could not derive AGT_CONSOLE_URL from ${finalApiUrl} \u2014 scheduled-delivery deep links will be disabled until you set it manually.`
5142
- );
5143
- }
5144
- const exportLines = buildExportLines(shell, finalApiUrl, setupResult.api_key, consoleUrl);
5145
- const profileDir = dirname6(profilePath);
5146
- if (!existsSync10(profileDir)) {
5147
- mkdirSync8(profileDir, { recursive: true });
5148
- }
5149
- const marker = "# Augmented (agt) host configuration";
5150
- const current = existsSync10(profilePath) ? readFileSync9(profilePath, "utf-8") : "";
5151
- let updated;
5152
- if (current.includes(marker)) {
5153
- updated = current.replace(
5154
- /\n?# Augmented \(agt\) host configuration\n(?:(?:export\s+AGT_\w+=.*|set\s+-gx\s+AGT_\w+\s+.*)\n)*\n?/,
5155
- exportLines
5156
- );
5157
- if (!json) {
5158
- info("Replacing existing Augmented config block in shell profile.");
5159
- }
5160
- } else {
5161
- updated = current + exportLines;
5162
- }
5163
- writeFileSync8(profilePath, updated.endsWith("\n") ? updated : `${updated}
5164
- `);
5165
- if (!json) {
5166
- success(`Environment variables written to ${chalk16.bold(profilePath)}`);
5167
- }
5168
- const sys = maybeWriteSystemWideEnv(finalApiUrl, setupResult.api_key, consoleUrl);
5169
- const valueChannelsWritten = sys.etcEnvironment || sys.profileD;
5170
- if (!json && valueChannelsWritten) {
5171
- const channels2 = [
5172
- sys.etcEnvironment ? "/etc/environment" : null,
5173
- sys.profileD ? "/etc/profile.d/agt.sh" : null,
5174
- sys.bashrc ? "/etc/bashrc" : null
5175
- ].filter(Boolean).join(" + ");
5176
- success(`System-wide env updated: ${channels2}`);
5177
- }
5178
- const managerSpinner = ora14({ text: "Starting manager daemon\u2026", isSilent: json });
5179
- managerSpinner.start();
5180
- try {
5181
- const configDir = join17(homedir7(), ".augmented");
5182
- const { pid } = startWatchdog({ intervalMs: 1e4, configDir, detached: true });
5183
- managerSpinner.succeed(`Manager started (PID ${pid})`);
5184
- } catch (err) {
5185
- managerSpinner.warn("Could not start manager daemon");
5186
- if (!json) {
5187
- warn(err.message);
5188
- info("Start it manually with: agt manager start");
5189
- }
5190
- }
5191
- const includeApiKey = process.env["AGT_SETUP_INCLUDE_API_KEY"] === "1";
5192
- if (json) {
5193
- jsonOutput({
5194
- ok: true,
5195
- host_name: setupResult.host_name,
5196
- host_id: setupResult.host_id,
5197
- team_slug: setupResult.team_slug,
5198
- api_url: finalApiUrl,
5199
- ...includeApiKey ? { api_key: setupResult.api_key } : {},
5200
- agents: setupResult.agents,
5201
- profile: profilePath
5202
- });
5203
- process.exit(0);
5204
- } else {
5205
- console.log();
5206
- console.log(chalk16.green.bold(" Setup complete!"));
5207
- console.log();
5208
- if (setupResult.agents.length > 0) {
5209
- info(`Agents: ${setupResult.agents.map((a) => chalk16.cyan(a)).join(", ")}`);
5210
- } else {
5211
- info("No agents assigned yet. Assign agents in the dashboard or with: agt host assign");
5212
- }
5213
- console.log();
5214
- info(`Restart your shell or run: ${chalk16.bold(`source ${profilePath}`)}`);
5215
- }
5216
- }
5217
-
5218
- // src/commands/kanban.ts
5219
- import chalk17 from "chalk";
5220
- import ora15 from "ora";
5221
4908
  function kanbanListJson(data) {
5222
4909
  return {
5223
4910
  ok: true,
@@ -5250,14 +4937,14 @@ async function resolveAgentId2(codeName) {
5250
4937
  }
5251
4938
  }
5252
4939
  function priorityLabel2(p) {
5253
- return p === 1 ? chalk17.red("HIGH") : p === 3 ? chalk17.dim("LOW") : chalk17.yellow("MED");
4940
+ return p === 1 ? chalk16.red("HIGH") : p === 3 ? chalk16.dim("LOW") : chalk16.yellow("MED");
5254
4941
  }
5255
4942
  function statusLabel(s) {
5256
4943
  const map = {
5257
- in_progress: chalk17.blue("In Progress"),
5258
- todo: chalk17.green("To Do"),
5259
- backlog: chalk17.dim("Backlog"),
5260
- done: chalk17.gray("Done")
4944
+ in_progress: chalk16.blue("In Progress"),
4945
+ todo: chalk16.green("To Do"),
4946
+ backlog: chalk16.dim("Backlog"),
4947
+ done: chalk16.gray("Done")
5261
4948
  };
5262
4949
  return map[s] ?? s;
5263
4950
  }
@@ -5265,7 +4952,7 @@ async function kanbanListCommand(opts) {
5265
4952
  const teamSlug = requireTeam();
5266
4953
  if (!teamSlug) return;
5267
4954
  const json = isJsonMode();
5268
- const spinner = ora15({ text: "Fetching kanban board\u2026", isSilent: json });
4955
+ const spinner = ora14({ text: "Fetching kanban board\u2026", isSilent: json });
5269
4956
  spinner.start();
5270
4957
  const agentId = await resolveAgentId2(opts.agent);
5271
4958
  if (!agentId) {
@@ -5295,7 +4982,7 @@ async function kanbanListCommand(opts) {
5295
4982
  item.estimated_minutes ? `~${item.estimated_minutes}min` : "",
5296
4983
  item.id.slice(0, 8)
5297
4984
  ]);
5298
- console.log(chalk17.bold(`
4985
+ console.log(chalk16.bold(`
5299
4986
  Kanban: ${opts.agent}
5300
4987
  `));
5301
4988
  table(["Pri", "Status", "Title", "Est", "ID"], rows);
@@ -5510,10 +5197,10 @@ async function kanbanDoneCommand(titleOrId, opts) {
5510
5197
 
5511
5198
  // src/commands/update.ts
5512
5199
  import { execFileSync, execSync } from "child_process";
5513
- import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5514
- import chalk18 from "chalk";
5515
- import ora16 from "ora";
5516
- var cliVersion = true ? "0.28.1177" : "dev";
5200
+ import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5201
+ import chalk17 from "chalk";
5202
+ import ora15 from "ora";
5203
+ var cliVersion = true ? "0.28.1179" : "dev";
5517
5204
  async function fetchLatestVersion() {
5518
5205
  const host2 = getHost();
5519
5206
  if (!host2) return null;
@@ -5617,7 +5304,7 @@ function performUpdate(version) {
5617
5304
  function detectBrewOwner() {
5618
5305
  for (const prefix of ["/home/linuxbrew/.linuxbrew", "/opt/homebrew", "/usr/local"]) {
5619
5306
  const cellar = `${prefix}/Cellar`;
5620
- if (!existsSync11(cellar)) continue;
5307
+ if (!existsSync10(cellar)) continue;
5621
5308
  try {
5622
5309
  return execSync(`stat -c %U "${cellar}" 2>/dev/null || stat -f %Su "${cellar}"`, { encoding: "utf-8" }).trim() || null;
5623
5310
  } catch {
@@ -5631,16 +5318,16 @@ function reportActiveSessionsBlocked(json, current, target) {
5631
5318
  if (!json) {
5632
5319
  warn("Active processes detected:");
5633
5320
  if (managerPid) {
5634
- console.error(chalk18.yellow(` \u2022 Manager process running (PID ${managerPid})`));
5321
+ console.error(chalk17.yellow(` \u2022 Manager process running (PID ${managerPid})`));
5635
5322
  }
5636
5323
  if (tmuxSessions.length > 0) {
5637
- console.error(chalk18.yellow(` \u2022 ${tmuxSessions.length} active agent session(s): ${tmuxSessions.join(", ")}`));
5324
+ console.error(chalk17.yellow(` \u2022 ${tmuxSessions.length} active agent session(s): ${tmuxSessions.join(", ")}`));
5638
5325
  }
5639
5326
  console.error();
5640
5327
  warn("Updating while the manager is running will leave it on the old version until restarted.");
5641
5328
  warn("Active agent sessions will continue with stale MCP servers.");
5642
5329
  console.error();
5643
- info(`Run ${chalk18.bold("agt update --force")} to update anyway, then restart the manager.`);
5330
+ info(`Run ${chalk17.bold("agt update --force")} to update anyway, then restart the manager.`);
5644
5331
  } else {
5645
5332
  jsonOutput({
5646
5333
  ok: false,
@@ -5657,7 +5344,7 @@ function reportActiveSessionsBlocked(json, current, target) {
5657
5344
  return true;
5658
5345
  }
5659
5346
  function runInstall(target, json, current) {
5660
- const updateSpinner = ora16({ text: "Installing update\u2026", isSilent: json });
5347
+ const updateSpinner = ora15({ text: "Installing update\u2026", isSilent: json });
5661
5348
  updateSpinner.start();
5662
5349
  try {
5663
5350
  performUpdate(target);
@@ -5671,8 +5358,8 @@ function runInstall(target, json, current) {
5671
5358
  updated: true
5672
5359
  });
5673
5360
  } else {
5674
- success(`Updated to ${chalk18.bold(target)}`);
5675
- info(`If you have a running manager, restart it: ${chalk18.bold("agt manager stop && agt manager start")}`);
5361
+ success(`Updated to ${chalk17.bold(target)}`);
5362
+ info(`If you have a running manager, restart it: ${chalk17.bold("agt manager stop && agt manager start")}`);
5676
5363
  }
5677
5364
  } catch (err) {
5678
5365
  updateSpinner.fail("Update failed");
@@ -5715,7 +5402,7 @@ async function updateCommand(opts = {}) {
5715
5402
  if (json) {
5716
5403
  jsonOutput({ ok: true, current: cliVersion, latest: target, update_available: false });
5717
5404
  } else {
5718
- success(`Already on ${chalk18.bold(cliVersion)}.`);
5405
+ success(`Already on ${chalk17.bold(cliVersion)}.`);
5719
5406
  }
5720
5407
  return;
5721
5408
  }
@@ -5734,7 +5421,7 @@ async function updateCommand(opts = {}) {
5734
5421
  return;
5735
5422
  }
5736
5423
  if (!json) {
5737
- info(`Installing ${chalk18.bold(target)} (was ${chalk18.dim(cliVersion)}).`);
5424
+ info(`Installing ${chalk17.bold(target)} (was ${chalk17.dim(cliVersion)}).`);
5738
5425
  if (pinned && pinned !== target) {
5739
5426
  warn(`This host is pinned to ${pinned} via AGT_CLI_PIN_VERSION; the manager will reconcile back to the pin on its next poll unless you also update the pin.`);
5740
5427
  }
@@ -5757,12 +5444,12 @@ async function updateCommand(opts = {}) {
5757
5444
  error: "Host is pinned via AGT_CLI_PIN_VERSION. Use `agt update --version <v>` to change it, or `agt update --force` to update to latest."
5758
5445
  });
5759
5446
  } else {
5760
- warn(`This host is pinned to ${chalk18.bold(pinned)} via AGT_CLI_PIN_VERSION.`);
5761
- info(`To change it deliberately, run ${chalk18.bold("agt update --version <version>")}; to update to latest anyway, run ${chalk18.bold("agt update --force")}.`);
5447
+ warn(`This host is pinned to ${chalk17.bold(pinned)} via AGT_CLI_PIN_VERSION.`);
5448
+ info(`To change it deliberately, run ${chalk17.bold("agt update --version <version>")}; to update to latest anyway, run ${chalk17.bold("agt update --force")}.`);
5762
5449
  }
5763
5450
  return;
5764
5451
  }
5765
- const spinner = ora16({ text: "Checking for updates\u2026", isSilent: json });
5452
+ const spinner = ora15({ text: "Checking for updates\u2026", isSilent: json });
5766
5453
  spinner.start();
5767
5454
  const versionInfo = await fetchLatestVersion();
5768
5455
  if (!versionInfo) {
@@ -5781,13 +5468,13 @@ async function updateCommand(opts = {}) {
5781
5468
  if (json) {
5782
5469
  jsonOutput({ ok: true, current: cliVersion, latest: versionInfo.latest, update_available: false });
5783
5470
  } else {
5784
- success(`You're on the latest version (${chalk18.bold(cliVersion)})`);
5471
+ success(`You're on the latest version (${chalk17.bold(cliVersion)})`);
5785
5472
  }
5786
5473
  return;
5787
5474
  }
5788
5475
  spinner.stop();
5789
5476
  if (!json) {
5790
- info(`Update available: ${chalk18.dim(cliVersion)} \u2192 ${chalk18.bold.green(versionInfo.latest)}`);
5477
+ info(`Update available: ${chalk17.dim(cliVersion)} \u2192 ${chalk17.bold.green(versionInfo.latest)}`);
5791
5478
  if (versionInfo.changelog_url) {
5792
5479
  info(`Changelog: ${versionInfo.changelog_url}`);
5793
5480
  }
@@ -5804,8 +5491,8 @@ async function checkForUpdateOnStartup() {
5804
5491
  if (!versionInfo) return;
5805
5492
  if (isNewerVersion(cliVersion, versionInfo.latest)) {
5806
5493
  console.error(
5807
- chalk18.yellow(`
5808
- Update available: ${cliVersion} \u2192 ${versionInfo.latest}. Run ${chalk18.bold("agt update")} to install.`) + chalk18.dim("\n Note: Restart the manager after updating.\n")
5494
+ chalk17.yellow(`
5495
+ Update available: ${cliVersion} \u2192 ${versionInfo.latest}. Run ${chalk17.bold("agt update")} to install.`) + chalk17.dim("\n Note: Restart the manager after updating.\n")
5809
5496
  );
5810
5497
  }
5811
5498
  } catch {
@@ -5813,12 +5500,12 @@ async function checkForUpdateOnStartup() {
5813
5500
  }
5814
5501
 
5815
5502
  // src/commands/audit-subagents.ts
5816
- import { homedir as homedir8 } from "os";
5817
- import { join as join19 } from "path";
5503
+ import { homedir as homedir7 } from "os";
5504
+ import { join as join18 } from "path";
5818
5505
 
5819
5506
  // src/lib/subagent-mcp-audit.ts
5820
- import { readdirSync as readdirSync4, readFileSync as readFileSync10, statSync as statSync3 } from "fs";
5821
- import { join as join18 } from "path";
5507
+ import { readdirSync as readdirSync4, readFileSync as readFileSync9, statSync as statSync3 } from "fs";
5508
+ import { join as join17 } from "path";
5822
5509
  function parseFrontmatter(content) {
5823
5510
  const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
5824
5511
  if (!match) return null;
@@ -5868,7 +5555,7 @@ function findSubagentFiles(dir, depth = 0) {
5868
5555
  const out = [];
5869
5556
  const isAgentsDir = dir.endsWith("/agents") || dir.endsWith("\\agents");
5870
5557
  for (const entry of entries) {
5871
- const full = join18(dir, entry);
5558
+ const full = join17(dir, entry);
5872
5559
  let s;
5873
5560
  try {
5874
5561
  s = statSync3(full);
@@ -5892,7 +5579,7 @@ function auditSubagentMcpBindings(rootDirs) {
5892
5579
  seen.add(file);
5893
5580
  let content;
5894
5581
  try {
5895
- content = readFileSync10(file, "utf-8");
5582
+ content = readFileSync9(file, "utf-8");
5896
5583
  } catch {
5897
5584
  continue;
5898
5585
  }
@@ -5915,11 +5602,11 @@ function formatFinding(f) {
5915
5602
 
5916
5603
  // src/commands/audit-subagents.ts
5917
5604
  function defaultRoots() {
5918
- const home = homedir8();
5605
+ const home = homedir7();
5919
5606
  return [
5920
- join19(home, ".claude", "agents"),
5921
- join19(home, ".claude", "plugins"),
5922
- join19(process.cwd(), ".claude", "agents")
5607
+ join18(home, ".claude", "agents"),
5608
+ join18(home, ".claude", "plugins"),
5609
+ join18(process.cwd(), ".claude", "agents")
5923
5610
  ];
5924
5611
  }
5925
5612
  async function auditSubagentsCommand(options = {}) {
@@ -5954,9 +5641,9 @@ async function auditSubagentsCommand(options = {}) {
5954
5641
  }
5955
5642
 
5956
5643
  // src/lib/mcp-render-allowlist-audit.ts
5957
- import { readdirSync as readdirSync5, readFileSync as readFileSync11, statSync as statSync4 } from "fs";
5958
- import { homedir as homedir9 } from "os";
5959
- import { join as join20 } from "path";
5644
+ import { readdirSync as readdirSync5, readFileSync as readFileSync10, statSync as statSync4 } from "fs";
5645
+ import { homedir as homedir8 } from "os";
5646
+ import { join as join19 } from "path";
5960
5647
  function expectedWildcard(serverKey) {
5961
5648
  return requiredMcpWildcard(serverKey);
5962
5649
  }
@@ -5969,13 +5656,13 @@ function parseMcpWildcardsFromToolsLine(content) {
5969
5656
  }
5970
5657
  function readMcpServerKeys(mcpJsonPath) {
5971
5658
  try {
5972
- const config = JSON.parse(readFileSync11(mcpJsonPath, "utf-8"));
5659
+ const config = JSON.parse(readFileSync10(mcpJsonPath, "utf-8"));
5973
5660
  return Object.keys(config.mcpServers ?? {});
5974
5661
  } catch {
5975
5662
  return null;
5976
5663
  }
5977
5664
  }
5978
- function auditMcpRenderAllowlist(rootDir = join20(homedir9(), ".augmented")) {
5665
+ function auditMcpRenderAllowlist(rootDir = join19(homedir8(), ".augmented")) {
5979
5666
  const findings = [];
5980
5667
  let entries;
5981
5668
  try {
@@ -5984,7 +5671,7 @@ function auditMcpRenderAllowlist(rootDir = join20(homedir9(), ".augmented")) {
5984
5671
  return findings;
5985
5672
  }
5986
5673
  for (const entry of entries) {
5987
- const agentDir = join20(rootDir, entry);
5674
+ const agentDir = join19(rootDir, entry);
5988
5675
  let s;
5989
5676
  try {
5990
5677
  s = statSync4(agentDir);
@@ -5993,15 +5680,15 @@ function auditMcpRenderAllowlist(rootDir = join20(homedir9(), ".augmented")) {
5993
5680
  }
5994
5681
  if (!s.isDirectory() || entry.startsWith("_") || entry.startsWith(".")) continue;
5995
5682
  for (const scope of ["provision", "project"]) {
5996
- const mcpJsonPath = scope === "provision" ? join20(agentDir, "provision", ".mcp.json") : join20(agentDir, "project", ".mcp.json");
5683
+ const mcpJsonPath = scope === "provision" ? join19(agentDir, "provision", ".mcp.json") : join19(agentDir, "project", ".mcp.json");
5997
5684
  const keys = readMcpServerKeys(mcpJsonPath);
5998
5685
  if (keys === null || keys.length === 0) continue;
5999
5686
  const expected = new Set(keys.map(expectedWildcard));
6000
5687
  for (const subagent of ["channel-message-handler", "augmented-worker"]) {
6001
- const mdPath = scope === "provision" ? join20(agentDir, ".claude", "agents", `${subagent}.md`) : join20(agentDir, "project", ".claude", "agents", `${subagent}.md`);
5688
+ const mdPath = scope === "provision" ? join19(agentDir, ".claude", "agents", `${subagent}.md`) : join19(agentDir, "project", ".claude", "agents", `${subagent}.md`);
6002
5689
  let content;
6003
5690
  try {
6004
- content = readFileSync11(mdPath, "utf-8");
5691
+ content = readFileSync10(mdPath, "utf-8");
6005
5692
  } catch {
6006
5693
  continue;
6007
5694
  }
@@ -6059,12 +5746,12 @@ async function auditMcpRenderCommand(options = {}) {
6059
5746
  }
6060
5747
 
6061
5748
  // src/commands/audit-secrets.ts
6062
- import { homedir as homedir10 } from "os";
6063
- import { join as join22 } from "path";
5749
+ import { homedir as homedir9 } from "os";
5750
+ import { join as join21 } from "path";
6064
5751
 
6065
5752
  // src/lib/secret-leak-audit.ts
6066
- import { readdirSync as readdirSync6, readFileSync as readFileSync12, statSync as statSync5 } from "fs";
6067
- import { join as join21 } from "path";
5753
+ import { readdirSync as readdirSync6, readFileSync as readFileSync11, statSync as statSync5 } from "fs";
5754
+ import { join as join20 } from "path";
6068
5755
  var SECRET_KEY_NAME_RE = /TOKEN|KEY|SECRET|BEARER|PASSWORD/i;
6069
5756
  function isTemplated(value) {
6070
5757
  return value.includes("${");
@@ -6090,7 +5777,7 @@ function scanMcpFile(file, agent2, findings) {
6090
5777
  }
6091
5778
  let parsed;
6092
5779
  try {
6093
- parsed = JSON.parse(readFileSync12(file, "utf-8"));
5780
+ parsed = JSON.parse(readFileSync11(file, "utf-8"));
6094
5781
  } catch {
6095
5782
  return;
6096
5783
  }
@@ -6134,15 +5821,15 @@ function auditSecretLeaks(augmentedRoot) {
6134
5821
  return findings;
6135
5822
  }
6136
5823
  for (const agent2 of agents) {
6137
- const agentDir = join21(augmentedRoot, agent2);
5824
+ const agentDir = join20(augmentedRoot, agent2);
6138
5825
  try {
6139
5826
  if (!statSync5(agentDir).isDirectory()) continue;
6140
5827
  } catch {
6141
5828
  continue;
6142
5829
  }
6143
- scanMcpFile(join21(agentDir, "provision", ".mcp.json"), agent2, findings);
6144
- scanMcpFile(join21(agentDir, "project", ".mcp.json"), agent2, findings);
6145
- scanEnvIntegrations(join21(agentDir, ".env.integrations"), agent2, findings);
5830
+ scanMcpFile(join20(agentDir, "provision", ".mcp.json"), agent2, findings);
5831
+ scanMcpFile(join20(agentDir, "project", ".mcp.json"), agent2, findings);
5832
+ scanEnvIntegrations(join20(agentDir, ".env.integrations"), agent2, findings);
6146
5833
  }
6147
5834
  return findings;
6148
5835
  }
@@ -6168,7 +5855,7 @@ function describe(f) {
6168
5855
  return `secret file is mode ${f.mode} (expected 0600)`;
6169
5856
  }
6170
5857
  async function auditSecretsCommand(options = {}) {
6171
- const root = options.root ?? join22(homedir10(), ".augmented");
5858
+ const root = options.root ?? join21(homedir9(), ".augmented");
6172
5859
  const findings = auditSecretLeaks(root);
6173
5860
  if (options.json) {
6174
5861
  process.stdout.write(`${JSON.stringify({ findings, root }, null, 2)}
@@ -6291,10 +5978,10 @@ async function anchorOnboardCommand(profile, options) {
6291
5978
  }
6292
5979
 
6293
5980
  // src/commands/integration.ts
6294
- import { homedir as homedir11 } from "os";
6295
- import { join as join23 } from "path";
6296
- import chalk19 from "chalk";
6297
- import ora17 from "ora";
5981
+ import { homedir as homedir10 } from "os";
5982
+ import { join as join22 } from "path";
5983
+ import chalk18 from "chalk";
5984
+ import ora16 from "ora";
6298
5985
 
6299
5986
  // src/lib/integration-provisioned-message.ts
6300
5987
  function notProvisionedMessage(input4) {
@@ -6349,7 +6036,7 @@ async function fetchAgents() {
6349
6036
  }
6350
6037
  async function integrationListCommand() {
6351
6038
  const json = isJsonMode();
6352
- const spinner = ora17({ text: "Fetching integrations\u2026", isSilent: json }).start();
6039
+ const spinner = ora16({ text: "Fetching integrations\u2026", isSilent: json }).start();
6353
6040
  try {
6354
6041
  const data = await api.get("/integrations/installs");
6355
6042
  spinner.stop();
@@ -6361,11 +6048,11 @@ async function integrationListCommand() {
6361
6048
  info("No integrations found for this team.");
6362
6049
  return;
6363
6050
  }
6364
- console.log(chalk19.bold("\nAvailable Integrations:\n"));
6051
+ console.log(chalk18.bold("\nAvailable Integrations:\n"));
6365
6052
  for (const p of data) {
6366
- const statusColor = p.status === "published" ? chalk19.green : p.status === "archived" ? chalk19.gray : chalk19.yellow;
6053
+ const statusColor = p.status === "published" ? chalk18.green : p.status === "archived" ? chalk18.gray : chalk18.yellow;
6367
6054
  console.log(
6368
- ` ${chalk19.bold(p.name)} ${chalk19.dim(`(${p.slug})`)} ${statusColor(p.status)} v${p.version} ${chalk19.dim(`${p.skills?.length ?? 0} skills, ${p.defined_scopes?.length ?? 0} scopes`)}`
6055
+ ` ${chalk18.bold(p.name)} ${chalk18.dim(`(${p.slug})`)} ${statusColor(p.status)} v${p.version} ${chalk18.dim(`${p.skills?.length ?? 0} skills, ${p.defined_scopes?.length ?? 0} scopes`)}`
6369
6056
  );
6370
6057
  }
6371
6058
  console.log();
@@ -6376,7 +6063,7 @@ async function integrationListCommand() {
6376
6063
  }
6377
6064
  async function integrationShowCommand(slug) {
6378
6065
  const json = isJsonMode();
6379
- const spinner = ora17({ text: "Fetching integration\u2026", isSilent: json }).start();
6066
+ const spinner = ora16({ text: "Fetching integration\u2026", isSilent: json }).start();
6380
6067
  try {
6381
6068
  const all = await api.get("/integrations/installs");
6382
6069
  const integration2 = all.find((p) => p.slug === slug);
@@ -6392,21 +6079,21 @@ async function integrationShowCommand(slug) {
6392
6079
  jsonOutput({ integration: integration2, scopes });
6393
6080
  return;
6394
6081
  }
6395
- console.log(chalk19.bold(`
6396
- ${integration2.name}`), chalk19.dim(`(${integration2.slug})`));
6397
- if (integration2.description) console.log(chalk19.dim(integration2.description));
6082
+ console.log(chalk18.bold(`
6083
+ ${integration2.name}`), chalk18.dim(`(${integration2.slug})`));
6084
+ if (integration2.description) console.log(chalk18.dim(integration2.description));
6398
6085
  console.log();
6399
6086
  console.log(` Status: ${integration2.status} v${integration2.version}`);
6400
6087
  console.log(` Category: ${integration2.category}`);
6401
6088
  console.log(` Toolkits: ${integration2.required_toolkits.join(", ") || "none"}`);
6402
6089
  console.log(` Skills: ${integration2.skills?.length ?? 0}`);
6403
6090
  if (scopes.length > 0) {
6404
- console.log(chalk19.bold("\n Permission Scopes:\n"));
6091
+ console.log(chalk18.bold("\n Permission Scopes:\n"));
6405
6092
  for (const s of scopes) {
6406
- const roleColor = s.can_grant ? chalk19.green : chalk19.red;
6407
- const overrideTag = s.is_overridden ? chalk19.cyan(" [team override]") : "";
6093
+ const roleColor = s.can_grant ? chalk18.green : chalk18.red;
6094
+ const overrideTag = s.is_overridden ? chalk18.cyan(" [team override]") : "";
6408
6095
  console.log(
6409
- ` ${chalk19.bold(s.id)} ${s.name} min: ${roleColor(s.effective_min_role)}${overrideTag} ${s.can_grant ? chalk19.green("\u2713 grantable") : chalk19.red("\u2717 needs approval")}`
6096
+ ` ${chalk18.bold(s.id)} ${s.name} min: ${roleColor(s.effective_min_role)}${overrideTag} ${s.can_grant ? chalk18.green("\u2713 grantable") : chalk18.red("\u2717 needs approval")}`
6410
6097
  );
6411
6098
  }
6412
6099
  }
@@ -6448,7 +6135,7 @@ function buildForcedProbeTarget(row, ctx) {
6448
6135
  }
6449
6136
  async function integrationProbeCommand(agentCodeName, slug) {
6450
6137
  const json = isJsonMode();
6451
- const spinner = ora17({ text: `Probing ${slug} on ${agentCodeName}\u2026`, isSilent: json }).start();
6138
+ const spinner = ora16({ text: `Probing ${slug} on ${agentCodeName}\u2026`, isSilent: json }).start();
6452
6139
  try {
6453
6140
  const agents = await fetchAgents();
6454
6141
  const agent2 = agents.find((a) => a.code_name === agentCodeName);
@@ -6479,7 +6166,7 @@ async function integrationProbeCommand(agentCodeName, slug) {
6479
6166
  process.exitCode = 1;
6480
6167
  return;
6481
6168
  }
6482
- const projectDir = join23(homedir11(), ".augmented", agentCodeName, "project");
6169
+ const projectDir = join22(homedir10(), ".augmented", agentCodeName, "project");
6483
6170
  const probeEnv = buildProbeEnv(projectDir, agent2.agent_id);
6484
6171
  const probeDeps = buildConnectivityProbeDeps(projectDir, probeEnv);
6485
6172
  const sourceType = integ.source_type ?? null;
@@ -6513,7 +6200,7 @@ async function integrationProbeCommand(agentCodeName, slug) {
6513
6200
  return;
6514
6201
  }
6515
6202
  info(`${integ.definition_id}: not probeable (no probe wired for this integration kind)`);
6516
- console.log(chalk19.dim(scopeNote.split("\n").map((l) => l ? ` ${l}` : "").join("\n")));
6203
+ console.log(chalk18.dim(scopeNote.split("\n").map((l) => l ? ` ${l}` : "").join("\n")));
6517
6204
  return;
6518
6205
  }
6519
6206
  const result = {
@@ -6533,12 +6220,12 @@ async function integrationProbeCommand(agentCodeName, slug) {
6533
6220
  jsonOutput(result);
6534
6221
  return;
6535
6222
  }
6536
- const color = outcome.status === "ok" ? chalk19.green : outcome.status === "down" ? chalk19.red : chalk19.yellow;
6223
+ const color = outcome.status === "ok" ? chalk18.green : outcome.status === "down" ? chalk18.red : chalk18.yellow;
6537
6224
  console.log(
6538
- `${chalk19.bold(integ.definition_id)} on ${chalk19.bold(agentCodeName)}: ${color(outcome.status)}`
6225
+ `${chalk18.bold(integ.definition_id)} on ${chalk18.bold(agentCodeName)}: ${color(outcome.status)}`
6539
6226
  );
6540
- if (outcome.message) console.log(chalk19.dim(` ${outcome.message}`));
6541
- console.log(chalk19.dim(scopeNote.split("\n").map((l) => l ? ` ${l}` : "").join("\n")));
6227
+ if (outcome.message) console.log(chalk18.dim(` ${outcome.message}`));
6228
+ console.log(chalk18.dim(scopeNote.split("\n").map((l) => l ? ` ${l}` : "").join("\n")));
6542
6229
  } catch (err) {
6543
6230
  spinner.stop();
6544
6231
  handleError(err);
@@ -6546,7 +6233,7 @@ async function integrationProbeCommand(agentCodeName, slug) {
6546
6233
  }
6547
6234
  async function integrationInstallCommand(slug, options) {
6548
6235
  const json = isJsonMode();
6549
- const spinner = ora17({ text: "Installing integration\u2026", isSilent: json }).start();
6236
+ const spinner = ora16({ text: "Installing integration\u2026", isSilent: json }).start();
6550
6237
  try {
6551
6238
  const all = await api.get("/integrations/installs");
6552
6239
  const integration2 = all.find((p) => p.slug === slug);
@@ -6585,7 +6272,7 @@ async function integrationInstallCommand(slug, options) {
6585
6272
  const needsApproval = err.body["needs_approval"];
6586
6273
  error("Some scopes exceed your role ceiling:");
6587
6274
  for (const s of needsApproval) {
6588
- console.log(chalk19.yellow(` - ${s}`));
6275
+ console.log(chalk18.yellow(` - ${s}`));
6589
6276
  }
6590
6277
  info("To request elevated scopes, use the web dashboard or contact your team admin.");
6591
6278
  process.exitCode = 1;
@@ -6596,7 +6283,7 @@ async function integrationInstallCommand(slug, options) {
6596
6283
  }
6597
6284
  async function integrationUninstallCommand(slug, options) {
6598
6285
  const json = isJsonMode();
6599
- const spinner = ora17({ text: "Uninstalling integration\u2026", isSilent: json }).start();
6286
+ const spinner = ora16({ text: "Uninstalling integration\u2026", isSilent: json }).start();
6600
6287
  try {
6601
6288
  const all = await api.get("/integrations/installs");
6602
6289
  const integration2 = all.find((p) => p.slug === slug);
@@ -6627,7 +6314,7 @@ async function integrationUninstallCommand(slug, options) {
6627
6314
  }
6628
6315
  async function integrationRequestsCommand() {
6629
6316
  const json = isJsonMode();
6630
- const spinner = ora17({ text: "Fetching scope requests\u2026", isSilent: json }).start();
6317
+ const spinner = ora16({ text: "Fetching scope requests\u2026", isSilent: json }).start();
6631
6318
  try {
6632
6319
  const requests = await api.get("/integrations/installs/scope-requests");
6633
6320
  spinner.stop();
@@ -6639,10 +6326,10 @@ async function integrationRequestsCommand() {
6639
6326
  info("No pending scope requests.");
6640
6327
  return;
6641
6328
  }
6642
- console.log(chalk19.bold("\nPending Scope Requests:\n"));
6329
+ console.log(chalk18.bold("\nPending Scope Requests:\n"));
6643
6330
  for (const r of requests) {
6644
- console.log(` ${chalk19.bold(r.id)} scopes: ${r.requested_scopes.join(", ")}`);
6645
- if (r.reason) console.log(` reason: ${chalk19.dim(r.reason)}`);
6331
+ console.log(` ${chalk18.bold(r.id)} scopes: ${r.requested_scopes.join(", ")}`);
6332
+ if (r.reason) console.log(` reason: ${chalk18.dim(r.reason)}`);
6646
6333
  console.log(` status: ${r.status} requested: ${r.created_at}`);
6647
6334
  console.log();
6648
6335
  }
@@ -6653,7 +6340,7 @@ async function integrationRequestsCommand() {
6653
6340
  }
6654
6341
  async function integrationApproveCommand(requestId, options) {
6655
6342
  const json = isJsonMode();
6656
- const spinner = ora17({ text: "Approving request\u2026", isSilent: json }).start();
6343
+ const spinner = ora16({ text: "Approving request\u2026", isSilent: json }).start();
6657
6344
  try {
6658
6345
  const result = await api.put(`/integrations/installs/scope-requests/${requestId}`, {
6659
6346
  status: "approved",
@@ -6672,7 +6359,7 @@ async function integrationApproveCommand(requestId, options) {
6672
6359
  }
6673
6360
  async function integrationDenyCommand(requestId, options) {
6674
6361
  const json = isJsonMode();
6675
- const spinner = ora17({ text: "Denying request\u2026", isSilent: json }).start();
6362
+ const spinner = ora16({ text: "Denying request\u2026", isSilent: json }).start();
6676
6363
  try {
6677
6364
  const result = await api.put(`/integrations/installs/scope-requests/${requestId}`, {
6678
6365
  status: "denied",
@@ -6714,7 +6401,7 @@ async function integrationEnrolCommand(options) {
6714
6401
  const [secretKey, secretValue] = secrets[0];
6715
6402
  const credentials = { [secretKey]: secretValue };
6716
6403
  const authType = options.authType ?? (options.webhookSecret ? "webhook" : options.apiKey ? "api_key" : "oauth2");
6717
- const spinner = ora17({ text: `Enrolling ${options.def} at ${apiScope} scope\u2026`, isSilent: json }).start();
6404
+ const spinner = ora16({ text: `Enrolling ${options.def} at ${apiScope} scope\u2026`, isSilent: json }).start();
6718
6405
  try {
6719
6406
  let agentId;
6720
6407
  if (apiScope === "agent") {
@@ -6773,7 +6460,7 @@ function handleError(err) {
6773
6460
  }
6774
6461
 
6775
6462
  // src/bin/agt.ts
6776
- var cliVersion2 = true ? "0.28.1177" : "dev";
6463
+ var cliVersion2 = true ? "0.28.1179" : "dev";
6777
6464
  var program = new Command();
6778
6465
  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");
6779
6466
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6873,11 +6560,11 @@ host.command("pair <host-name>").description("Start an SSM port-forward + shell
6873
6560
  })
6874
6561
  );
6875
6562
  var manager = program.command("manager").description("Host config sync daemon \u2014 keeps local agent files in sync with API");
6876
- manager.command("start").description("Start the manager daemon (polls API for config changes and detects local drift)").option("--interval <seconds>", "Poll interval in seconds (min 5)", "10").option("--config-dir <dir>", "Config directory for agent files", join24(homedir12(), ".augmented")).option("--supervise", "Wrap the manager in a respawn-on-clean-exit loop so auto-upgrades can restart it transparently (ENG-4488)", false).action(managerStartCommand);
6877
- manager.command("stop").description("Stop the running manager daemon").option("--config-dir <dir>", "Config directory for agent files", join24(homedir12(), ".augmented")).action(managerStopCommand);
6878
- manager.command("status").description("Show the current manager daemon status and discovered agents").option("--config-dir <dir>", "Config directory for agent files", join24(homedir12(), ".augmented")).action(managerStatusCommand);
6879
- manager.command("watch").description("Live TUI dashboard \u2014 per-agent boxes, drill-in, log tail. Read-only (ENG-4555).").option("--config-dir <dir>", "Config directory for agent files", join24(homedir12(), ".augmented")).option("--no-tui", "Skip the TUI and stream the manager log to stdout instead (CI / scripts)").action(managerWatchCommand);
6880
- manager.command("install").description("Install OS-level supervisor (launchd LaunchAgent on macOS) so the manager auto-restarts after crash, reboot, or self-update (ENG-4593)").option("--interval <seconds>", "Poll interval in seconds (min 5)", "10").option("--config-dir <dir>", "Config directory for agent files", join24(homedir12(), ".augmented")).action(managerInstallCommand);
6563
+ manager.command("start").description("Start the manager daemon (polls API for config changes and detects local drift)").option("--interval <seconds>", "Poll interval in seconds (min 5)", "10").option("--config-dir <dir>", "Config directory for agent files", join23(homedir11(), ".augmented")).option("--supervise", "Wrap the manager in a respawn-on-clean-exit loop so auto-upgrades can restart it transparently (ENG-4488)", false).action(managerStartCommand);
6564
+ manager.command("stop").description("Stop the running manager daemon").option("--config-dir <dir>", "Config directory for agent files", join23(homedir11(), ".augmented")).action(managerStopCommand);
6565
+ manager.command("status").description("Show the current manager daemon status and discovered agents").option("--config-dir <dir>", "Config directory for agent files", join23(homedir11(), ".augmented")).action(managerStatusCommand);
6566
+ manager.command("watch").description("Live TUI dashboard \u2014 per-agent boxes, drill-in, log tail. Read-only (ENG-4555).").option("--config-dir <dir>", "Config directory for agent files", join23(homedir11(), ".augmented")).option("--no-tui", "Skip the TUI and stream the manager log to stdout instead (CI / scripts)").action(managerWatchCommand);
6567
+ manager.command("install").description("Install OS-level supervisor (launchd LaunchAgent on macOS) so the manager auto-restarts after crash, reboot, or self-update (ENG-4593)").option("--interval <seconds>", "Poll interval in seconds (min 5)", "10").option("--config-dir <dir>", "Config directory for agent files", join23(homedir11(), ".augmented")).action(managerInstallCommand);
6881
6568
  manager.command("uninstall").description("Remove the OS-level supervisor (launchctl unload + delete plist on macOS). Idempotent.").action(managerUninstallCommand);
6882
6569
  manager.command("install-system-unit").description("Install a system-level systemd unit (Linux, root) so the manager auto-starts on every boot. For headless EC2 hosts \u2014 survives reboot without `loginctl enable-linger`. (ENG-4706)").option("--interval <seconds>", "Poll interval in seconds (min 5)", "10").option("--config-dir <dir>", "Config directory for agent files (defaults to /root/.augmented or /home/<user>/.augmented)").option("--user <name>", "Unix user the manager runs as", "root").action(managerInstallSystemUnitCommand);
6883
6570
  manager.command("uninstall-system-unit").description("Remove the system-level systemd unit (Linux, root). Idempotent. (ENG-4706)").action(managerUninstallSystemUnitCommand);
@@ -6885,7 +6572,7 @@ var agent = program.command("agent").description("Inspect and manage agents");
6885
6572
  agent.command("restore-transcripts <code-name>").description(
6886
6573
  "Place a migrated agent's archived transcripts on this host and re-pin its conversation (ENG-9567)"
6887
6574
  ).option("--from <host>", "Source host to restore from \u2014 its name or uuid").option("--bucket <bucket>", "Source bucket, when no address is recorded for the host").option("--key-prefix <prefix>", "Source key prefix, when no address is recorded for the host").option("--region <region>", "Bucket region").option("--timezone <iana>", "The agent's IANA timezone, so the restored pin is dated as the spawner will read it").option("--json", "Emit the result as JSON").action(agentRestoreTranscriptsCommand);
6888
- agent.command("show <code-name>").description("Display an agent's provisioned configuration").option("--config-dir <dir>", "Config directory", join24(homedir12(), ".augmented")).option("--all-channels", "Show all channels (including disabled)").action(agentShowCommand);
6575
+ agent.command("show <code-name>").description("Display an agent's provisioned configuration").option("--config-dir <dir>", "Config directory", join23(homedir11(), ".augmented")).option("--all-channels", "Show all channels (including disabled)").action(agentShowCommand);
6889
6576
  var kanban = program.command("kanban").description("Manage agent kanban boards");
6890
6577
  kanban.command("list").description("List kanban board items for an agent").requiredOption("--agent <code-name>", "Agent code name").action(kanbanListCommand);
6891
6578
  kanban.command("add <title>").description("Add a new item to an agent kanban board").requiredOption("--agent <code-name>", "Agent code name").option("--priority <1|2|3>", "Priority: 1=high, 2=medium, 3=low", "2").option("--status <status>", "Initial status: backlog | todo | in_progress", "todo").option("--description <text>", "Item description").option("--estimate <minutes>", "Estimated time in minutes").option("--deliverable <text>", "Expected output/deliverable").action(kanbanAddCommand);