@integrity-labs/agt-cli 0.8.8 → 0.9.0

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.8" : "dev";
3414
+ var cliVersion = true ? "0.9.0" : "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.8" : "dev";
3530
+ var cliVersion2 = true ? "0.9.0" : "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,9 +21,11 @@ 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 as mkdirSync2, existsSync as existsSync2, rmSync, readdirSync, statSync, unlinkSync, copyFileSync } from "fs";
25
25
  import https from "https";
26
- import { join as join2 } from "path";
26
+ import { join as join2, dirname as dirname2 } from "path";
27
+ import { homedir as homedir2 } from "os";
28
+ import { fileURLToPath as fileURLToPath2 } from "url";
27
29
 
28
30
  // src/lib/mcp-sanitize.ts
29
31
  import { readFileSync, writeFileSync } from "fs";
@@ -1051,9 +1053,9 @@ async function checkAndUpdateCli() {
1051
1053
  const isDevMode = cliPath.includes("/src/") || cliPath.includes("tsx");
1052
1054
  if (isDevMode) return;
1053
1055
  if (!isHomebrew && !cliPath.includes("node_modules")) return;
1054
- const { homedir: homedir2 } = await import("os");
1056
+ const { homedir: homedir3 } = await import("os");
1055
1057
  const { readFileSync: readF, writeFileSync: writeF } = await import("fs");
1056
- const markerPath = join2(homedir2(), ".augmented", ".last-update-check");
1058
+ const markerPath = join2(homedir3(), ".augmented", ".last-update-check");
1057
1059
  try {
1058
1060
  const lastCheck = parseInt(readF(markerPath, "utf-8").trim(), 10);
1059
1061
  if (Date.now() - lastCheck < UPDATE_CHECK_INTERVAL_MS) return;
@@ -1952,8 +1954,8 @@ async function processAgent(agent, agentStates) {
1952
1954
  try {
1953
1955
  const { readFileSync: readFileSync4 } = await import("fs");
1954
1956
  const { join: join3 } = await import("path");
1955
- const { homedir: homedir2 } = await import("os");
1956
- const mcpPath = join3(homedir2(), ".augmented", "agents", agent.code_name, "provision", ".mcp.json");
1957
+ const { homedir: homedir3 } = await import("os");
1958
+ const mcpPath = join3(homedir3(), ".augmented", "agents", agent.code_name, "provision", ".mcp.json");
1957
1959
  const mcpConfig = JSON.parse(readFileSync4(mcpPath, "utf-8"));
1958
1960
  if (mcpConfig.mcpServers) {
1959
1961
  const managedPrefixes = ["composio-", "one-", "nango-", "paragon-"];
@@ -3898,8 +3900,41 @@ async function stopPolling() {
3898
3900
  }
3899
3901
  function startManager(opts) {
3900
3902
  config = opts;
3903
+ deployMcpAssets();
3901
3904
  startPolling();
3902
3905
  }
3906
+ function deployMcpAssets() {
3907
+ const targetDir = join2(homedir2(), ".augmented", "_mcp");
3908
+ mkdirSync2(targetDir, { recursive: true });
3909
+ const moduleDir = dirname2(fileURLToPath2(import.meta.url));
3910
+ let mcpSourceDir = "";
3911
+ let dir = moduleDir;
3912
+ for (let i = 0; i < 6; i++) {
3913
+ const candidate = join2(dir, "mcp");
3914
+ if (existsSync2(join2(candidate, "index.js"))) {
3915
+ mcpSourceDir = candidate;
3916
+ break;
3917
+ }
3918
+ const parent = dirname2(dir);
3919
+ if (parent === dir) break;
3920
+ dir = parent;
3921
+ }
3922
+ if (!mcpSourceDir) {
3923
+ log("[manager] MCP assets not found in CLI package \u2014 skipping deployment");
3924
+ return;
3925
+ }
3926
+ for (const file of ["index.js", "slack-channel.js"]) {
3927
+ const src = join2(mcpSourceDir, file);
3928
+ const dst = join2(targetDir, file);
3929
+ if (!existsSync2(src)) continue;
3930
+ try {
3931
+ copyFileSync(src, dst);
3932
+ } catch (err) {
3933
+ log(`[manager] Failed to deploy ${file}: ${err.message}`);
3934
+ }
3935
+ }
3936
+ log(`[manager] MCP assets deployed to ${targetDir}`);
3937
+ }
3903
3938
  async function stopManager() {
3904
3939
  await stopPolling();
3905
3940
  }