@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.
Files changed (2) hide show
  1. package/install.js +31 -18
  2. 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
- if (config.agents.list.length === 0) config.agents.list.push({ id: "main" });
226
- for (const agent of config.agents.list) {
227
- if (!agent.tools) agent.tools = {};
228
- if (!Array.isArray(agent.tools.alsoAllow)) agent.tools.alsoAllow = [];
229
- for (const tool of ["canvas", "nodes"]) {
230
- if (!agent.tools.alsoAllow.includes(tool)) {
231
- agent.tools.alsoAllow.push(tool);
232
- console.log(" + Added " + tool + " to agent '" + (agent.id || "?") + "' tools.alsoAllow");
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
- // Remove canvas and nodes from deny list if present
236
- if (Array.isArray(agent.tools.deny)) {
237
- for (const tool of ["canvas", "nodes"]) {
238
- const idx = agent.tools.deny.indexOf(tool);
239
- if (idx !== -1) {
240
- agent.tools.deny.splice(idx, 1);
241
- console.log(" - Removed " + tool + " from agent '" + (agent.id || "?") + "' tools.deny");
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syengup/friday-channel-next",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "type": "module",
6
6
  "files": [