@syengup/friday-channel-next 0.0.21 → 0.0.22
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/install.js +19 -18
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -219,27 +219,28 @@ if (config.gateway.bind !== "lan") {
|
|
|
219
219
|
console.log(" + Set gateway.bind to lan");
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
// Ensure canvas and nodes are in agent tools.alsoAllow
|
|
222
|
+
// Ensure canvas and nodes are in the main agent's tools.alsoAllow (not deny)
|
|
223
223
|
if (!config.agents) config.agents = {};
|
|
224
224
|
if (!Array.isArray(config.agents.list)) config.agents.list = [];
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
let mainAgent = config.agents.list.find((a) => a.id === "main");
|
|
226
|
+
if (!mainAgent) {
|
|
227
|
+
mainAgent = { id: "main" };
|
|
228
|
+
config.agents.list.push(mainAgent);
|
|
229
|
+
}
|
|
230
|
+
if (!mainAgent.tools) mainAgent.tools = {};
|
|
231
|
+
if (!Array.isArray(mainAgent.tools.alsoAllow)) mainAgent.tools.alsoAllow = [];
|
|
232
|
+
for (const tool of ["canvas", "nodes"]) {
|
|
233
|
+
if (!mainAgent.tools.alsoAllow.includes(tool)) {
|
|
234
|
+
mainAgent.tools.alsoAllow.push(tool);
|
|
235
|
+
console.log(" + Added " + tool + " to agent 'main' tools.alsoAllow");
|
|
234
236
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
237
|
+
}
|
|
238
|
+
if (Array.isArray(mainAgent.tools.deny)) {
|
|
239
|
+
for (const tool of ["canvas", "nodes"]) {
|
|
240
|
+
const idx = mainAgent.tools.deny.indexOf(tool);
|
|
241
|
+
if (idx !== -1) {
|
|
242
|
+
mainAgent.tools.deny.splice(idx, 1);
|
|
243
|
+
console.log(" - Removed " + tool + " from agent 'main' tools.deny");
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
}
|