agentlife 1.5.2 → 1.5.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1812,6 +1812,27 @@ async function provisionAgents(state, cfg, runtime, log) {
1812
1812
  rawCfgForVisibility.tools.sessions.visibility = "all";
1813
1813
  visibilityWritten = true;
1814
1814
  }
1815
+ const currentA2A = rawCfgForVisibility?.tools?.agentToAgent?.enabled;
1816
+ let a2aWritten = false;
1817
+ if (currentA2A !== true) {
1818
+ try {
1819
+ let backup = {};
1820
+ try {
1821
+ backup = JSON.parse(readFileSync(backupPath, "utf-8"));
1822
+ } catch {}
1823
+ if (backup.agentToAgentEnabled === undefined) {
1824
+ backup.agentToAgentEnabled = currentA2A ?? null;
1825
+ writeFileSync(backupPath, JSON.stringify(backup, null, 2) + `
1826
+ `, "utf-8");
1827
+ }
1828
+ } catch {}
1829
+ if (!rawCfgForVisibility.tools)
1830
+ rawCfgForVisibility.tools = {};
1831
+ if (!rawCfgForVisibility.tools.agentToAgent)
1832
+ rawCfgForVisibility.tools.agentToAgent = {};
1833
+ rawCfgForVisibility.tools.agentToAgent.enabled = true;
1834
+ a2aWritten = true;
1835
+ }
1815
1836
  const currentAllow = rawCfgForVisibility?.tools?.allow;
1816
1837
  let globalAllowWritten = false;
1817
1838
  if (Array.isArray(currentAllow) && currentAllow.length > 0 && !currentAllow.includes("*")) {
@@ -1832,12 +1853,14 @@ async function provisionAgents(state, cfg, runtime, log) {
1832
1853
  globalAllowWritten = true;
1833
1854
  }
1834
1855
  }
1835
- if (visibilityWritten || globalAllowWritten) {
1856
+ if (visibilityWritten || a2aWritten || globalAllowWritten) {
1836
1857
  writeFileSync(configPath, JSON.stringify(rawCfgForVisibility, null, 2) + `
1837
1858
  `, "utf-8");
1838
1859
  configChanged = true;
1839
1860
  if (visibilityWritten)
1840
1861
  log("[agentlife] set tools.sessions.visibility=all (cross-agent delegation)");
1862
+ if (a2aWritten)
1863
+ log("[agentlife] set tools.agentToAgent.enabled=true (cross-agent sends)");
1841
1864
  if (globalAllowWritten)
1842
1865
  log('[agentlife] added "*" to tools.allow (unblock exec/read/write for provisioned agents)');
1843
1866
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlife",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "bun build index.ts --outfile dist/index.js --target node --external openclaw/plugin-sdk",