agentlife 2.4.1 → 2.4.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/index.js +23 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1245,7 +1245,7 @@ var PROVISIONED_AGENTS = [
|
|
|
1245
1245
|
id: "agentlife-builder",
|
|
1246
1246
|
name: "AgentLife Builder",
|
|
1247
1247
|
agentsMd: BUILDER_AGENTS_MD,
|
|
1248
|
-
tools: {
|
|
1248
|
+
tools: { allow: ["*", "agentlife_push"] }
|
|
1249
1249
|
},
|
|
1250
1250
|
{
|
|
1251
1251
|
id: "supervisor",
|
|
@@ -1438,7 +1438,26 @@ async function provisionAgents(state, cfg, runtime, log) {
|
|
|
1438
1438
|
globalAllowWritten = true;
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
|
|
1441
|
+
const currentAlsoAllow = Array.isArray(rawCfgForVisibility?.tools?.alsoAllow) ? rawCfgForVisibility.tools.alsoAllow : [];
|
|
1442
|
+
let alsoAllowWritten = false;
|
|
1443
|
+
if (!currentAlsoAllow.includes("agentlife_push")) {
|
|
1444
|
+
try {
|
|
1445
|
+
let backup = {};
|
|
1446
|
+
try {
|
|
1447
|
+
backup = JSON.parse(readFileSync(backupPath, "utf-8"));
|
|
1448
|
+
} catch {}
|
|
1449
|
+
if (backup.toolsAlsoAllow === undefined) {
|
|
1450
|
+
backup.toolsAlsoAllow = [...currentAlsoAllow];
|
|
1451
|
+
writeFileSync(backupPath, JSON.stringify(backup, null, 2) + `
|
|
1452
|
+
`, "utf-8");
|
|
1453
|
+
}
|
|
1454
|
+
} catch {}
|
|
1455
|
+
if (!rawCfgForVisibility.tools)
|
|
1456
|
+
rawCfgForVisibility.tools = {};
|
|
1457
|
+
rawCfgForVisibility.tools.alsoAllow = [...currentAlsoAllow, "agentlife_push"];
|
|
1458
|
+
alsoAllowWritten = true;
|
|
1459
|
+
}
|
|
1460
|
+
if (visibilityWritten || a2aWritten || globalAllowWritten || alsoAllowWritten) {
|
|
1442
1461
|
writeFileSync(configPath, JSON.stringify(rawCfgForVisibility, null, 2) + `
|
|
1443
1462
|
`, "utf-8");
|
|
1444
1463
|
configChanged = true;
|
|
@@ -1448,6 +1467,8 @@ async function provisionAgents(state, cfg, runtime, log) {
|
|
|
1448
1467
|
log("[agentlife] set tools.agentToAgent.enabled=true (cross-agent sends)");
|
|
1449
1468
|
if (globalAllowWritten)
|
|
1450
1469
|
log('[agentlife] added "*" to tools.allow (unblock exec/read/write for provisioned agents)');
|
|
1470
|
+
if (alsoAllowWritten)
|
|
1471
|
+
log("[agentlife] added agentlife_push to tools.alsoAllow (tool-policy pipeline intersection pass-through)");
|
|
1451
1472
|
}
|
|
1452
1473
|
if (configChanged) {
|
|
1453
1474
|
const configPath2 = path3.join(os.homedir(), ".openclaw", "openclaw.json");
|