@syengup/friday-channel-next 0.0.21 → 0.0.23
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 +31 -18
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -198,6 +198,18 @@ if (!config.plugins.entries["friday-next"]) {
|
|
|
198
198
|
console.log(" + Enabled friday-next in plugins.entries");
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
if (!config.plugins.allow.includes("canvas")) {
|
|
202
|
+
config.plugins.allow.push("canvas");
|
|
203
|
+
console.log(" + Added canvas to plugins.allow");
|
|
204
|
+
}
|
|
205
|
+
if (!config.plugins.entries["canvas"]) {
|
|
206
|
+
config.plugins.entries["canvas"] = { enabled: true };
|
|
207
|
+
console.log(" + Added canvas to plugins.entries (enabled)");
|
|
208
|
+
} else if (!config.plugins.entries["canvas"].enabled) {
|
|
209
|
+
config.plugins.entries["canvas"].enabled = true;
|
|
210
|
+
console.log(" + Enabled canvas in plugins.entries");
|
|
211
|
+
}
|
|
212
|
+
|
|
201
213
|
if (!config.channels) config.channels = {};
|
|
202
214
|
if (!config.channels["friday-next"]) {
|
|
203
215
|
config.channels["friday-next"] = { enabled: true, transport: "http+sse" };
|
|
@@ -219,27 +231,28 @@ if (config.gateway.bind !== "lan") {
|
|
|
219
231
|
console.log(" + Set gateway.bind to lan");
|
|
220
232
|
}
|
|
221
233
|
|
|
222
|
-
// Ensure canvas and nodes are in agent tools.alsoAllow
|
|
234
|
+
// Ensure canvas and nodes are in the main agent's tools.alsoAllow (not deny)
|
|
223
235
|
if (!config.agents) config.agents = {};
|
|
224
236
|
if (!Array.isArray(config.agents.list)) config.agents.list = [];
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
let mainAgent = config.agents.list.find((a) => a.id === "main");
|
|
238
|
+
if (!mainAgent) {
|
|
239
|
+
mainAgent = { id: "main" };
|
|
240
|
+
config.agents.list.push(mainAgent);
|
|
241
|
+
}
|
|
242
|
+
if (!mainAgent.tools) mainAgent.tools = {};
|
|
243
|
+
if (!Array.isArray(mainAgent.tools.alsoAllow)) mainAgent.tools.alsoAllow = [];
|
|
244
|
+
for (const tool of ["canvas", "nodes"]) {
|
|
245
|
+
if (!mainAgent.tools.alsoAllow.includes(tool)) {
|
|
246
|
+
mainAgent.tools.alsoAllow.push(tool);
|
|
247
|
+
console.log(" + Added " + tool + " to agent 'main' tools.alsoAllow");
|
|
234
248
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
249
|
+
}
|
|
250
|
+
if (Array.isArray(mainAgent.tools.deny)) {
|
|
251
|
+
for (const tool of ["canvas", "nodes"]) {
|
|
252
|
+
const idx = mainAgent.tools.deny.indexOf(tool);
|
|
253
|
+
if (idx !== -1) {
|
|
254
|
+
mainAgent.tools.deny.splice(idx, 1);
|
|
255
|
+
console.log(" - Removed " + tool + " from agent 'main' tools.deny");
|
|
243
256
|
}
|
|
244
257
|
}
|
|
245
258
|
}
|