@integrity-labs/agt-cli 0.12.2 → 0.12.4

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.
@@ -15,8 +15,9 @@ import {
15
15
  provisionStopHook,
16
16
  requireHost,
17
17
  resolveChannels,
18
- resolveDmTarget
19
- } from "../chunk-S5VHDDAJ.js";
18
+ resolveDmTarget,
19
+ wrapScheduledTaskPrompt
20
+ } from "../chunk-UMDIT5CP.js";
20
21
  import {
21
22
  findTaskByTemplate,
22
23
  getProjectDir,
@@ -1776,6 +1777,7 @@ async function processAgent(agent, agentStates) {
1776
1777
  const filePath = join2(agentDir, artifact.relativePath);
1777
1778
  let existingHash;
1778
1779
  let newHash;
1780
+ let writeContent = artifact.content;
1779
1781
  if (artifact.relativePath === "CLAUDE.md") {
1780
1782
  const stripDynamicSections = (s) => {
1781
1783
  let out = s.replace(new RegExp(`${SKILLS_INDEX_START}[\\s\\S]*?${SKILLS_INDEX_END}`), "");
@@ -1790,12 +1792,38 @@ async function processAgent(agent, agentStates) {
1790
1792
  } catch {
1791
1793
  existingHash = null;
1792
1794
  }
1795
+ } else if (artifact.relativePath === ".mcp.json") {
1796
+ const parseMcp = (raw) => {
1797
+ try {
1798
+ const parsed = JSON.parse(raw);
1799
+ return parsed.mcpServers ?? {};
1800
+ } catch {
1801
+ return {};
1802
+ }
1803
+ };
1804
+ const generatorServers = parseMcp(artifact.content);
1805
+ const generatorKeys = Object.keys(generatorServers);
1806
+ let existingRaw = "";
1807
+ try {
1808
+ existingRaw = readFileSync(filePath, "utf-8");
1809
+ } catch {
1810
+ }
1811
+ const existingServers = parseMcp(existingRaw);
1812
+ const merged = { mcpServers: { ...existingServers, ...generatorServers } };
1813
+ writeContent = JSON.stringify(merged, null, 2);
1814
+ const sliceGeneratorKeys = (src) => {
1815
+ const out = {};
1816
+ for (const k of generatorKeys) if (k in src) out[k] = src[k];
1817
+ return out;
1818
+ };
1819
+ newHash = sha256(JSON.stringify(generatorServers));
1820
+ existingHash = existingRaw ? sha256(JSON.stringify(sliceGeneratorKeys(existingServers))) : null;
1793
1821
  } else {
1794
1822
  newHash = sha256(artifact.content);
1795
1823
  existingHash = hashFile(filePath);
1796
1824
  }
1797
1825
  if (newHash !== existingHash) {
1798
- changedFiles.push(artifact);
1826
+ changedFiles.push({ relativePath: artifact.relativePath, content: writeContent });
1799
1827
  }
1800
1828
  }
1801
1829
  if (changedFiles.length > 0) {
@@ -2797,6 +2825,7 @@ async function executeAndProcessClaudeTask(codeName, agentId, task, prompt) {
2797
2825
  const projectDir = getProjectDir(codeName);
2798
2826
  const mcpConfigPath = join2(projectDir, ".mcp.json");
2799
2827
  sanitizeMcpJson(mcpConfigPath, requireHost());
2828
+ prompt = wrapScheduledTaskPrompt(prompt);
2800
2829
  try {
2801
2830
  const claudeMdPath = join2(projectDir, "CLAUDE.md");
2802
2831
  const serverNames = [];