@integrity-labs/agt-cli 0.12.1 → 0.12.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
@@ -3717,7 +3717,7 @@ import { execFileSync, execSync } from "child_process";
3717
3717
  import { existsSync as existsSync5, realpathSync } from "fs";
3718
3718
  import chalk20 from "chalk";
3719
3719
  import ora15 from "ora";
3720
- var cliVersion = true ? "0.12.1" : "dev";
3720
+ var cliVersion = true ? "0.12.3" : "dev";
3721
3721
  async function fetchLatestVersion() {
3722
3722
  const host2 = getHost();
3723
3723
  if (!host2) return null;
@@ -4166,7 +4166,7 @@ function handleError(err) {
4166
4166
  }
4167
4167
 
4168
4168
  // src/bin/agt.ts
4169
- var cliVersion2 = true ? "0.12.1" : "dev";
4169
+ var cliVersion2 = true ? "0.12.3" : "dev";
4170
4170
  var program = new Command();
4171
4171
  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");
4172
4172
  program.hook("preAction", (thisCommand) => {
@@ -1776,6 +1776,7 @@ async function processAgent(agent, agentStates) {
1776
1776
  const filePath = join2(agentDir, artifact.relativePath);
1777
1777
  let existingHash;
1778
1778
  let newHash;
1779
+ let writeContent = artifact.content;
1779
1780
  if (artifact.relativePath === "CLAUDE.md") {
1780
1781
  const stripDynamicSections = (s) => {
1781
1782
  let out = s.replace(new RegExp(`${SKILLS_INDEX_START}[\\s\\S]*?${SKILLS_INDEX_END}`), "");
@@ -1790,12 +1791,38 @@ async function processAgent(agent, agentStates) {
1790
1791
  } catch {
1791
1792
  existingHash = null;
1792
1793
  }
1794
+ } else if (artifact.relativePath === ".mcp.json") {
1795
+ const parseMcp = (raw) => {
1796
+ try {
1797
+ const parsed = JSON.parse(raw);
1798
+ return parsed.mcpServers ?? {};
1799
+ } catch {
1800
+ return {};
1801
+ }
1802
+ };
1803
+ const generatorServers = parseMcp(artifact.content);
1804
+ const generatorKeys = Object.keys(generatorServers);
1805
+ let existingRaw = "";
1806
+ try {
1807
+ existingRaw = readFileSync(filePath, "utf-8");
1808
+ } catch {
1809
+ }
1810
+ const existingServers = parseMcp(existingRaw);
1811
+ const merged = { mcpServers: { ...existingServers, ...generatorServers } };
1812
+ writeContent = JSON.stringify(merged, null, 2);
1813
+ const sliceGeneratorKeys = (src) => {
1814
+ const out = {};
1815
+ for (const k of generatorKeys) if (k in src) out[k] = src[k];
1816
+ return out;
1817
+ };
1818
+ newHash = sha256(JSON.stringify(generatorServers));
1819
+ existingHash = existingRaw ? sha256(JSON.stringify(sliceGeneratorKeys(existingServers))) : null;
1793
1820
  } else {
1794
1821
  newHash = sha256(artifact.content);
1795
1822
  existingHash = hashFile(filePath);
1796
1823
  }
1797
1824
  if (newHash !== existingHash) {
1798
- changedFiles.push(artifact);
1825
+ changedFiles.push({ relativePath: artifact.relativePath, content: writeContent });
1799
1826
  }
1800
1827
  }
1801
1828
  if (changedFiles.length > 0) {