@soft-boy/agentschema 0.3.5 → 0.3.6

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/lib/channels.js +4 -2
  2. package/package.json +1 -1
package/lib/channels.js CHANGED
@@ -87,13 +87,13 @@ export const CHANNEL_TYPES = {
87
87
  secrets: ["bot_token"],
88
88
  scopes: ["sender", "room"],
89
89
  approvals: ["deny", "sender"],
90
- // Reading ordinary messages takes an always-on connection, so people talk to it with a slash command.
91
- hasGroups: false,
90
+ hasGroups: true,
92
91
  allow: matches(DISCORD_ID, "a numeric user ID"),
93
92
  fields: {
94
93
  application_id: { required: true, check: matches(DISCORD_ID, "a numeric application ID") },
95
94
  public_key: { required: true, check: matches(/^[0-9a-f]{64}$/, "the 64-character public key") },
96
95
  guilds: { check: listOf(matches(DISCORD_ID, "a numeric server ID")) },
96
+ channels: { check: listOf(matches(DISCORD_ID, "a numeric channel ID")) },
97
97
  command: { check: matches(/^[a-z0-9_-]{1,32}$/, "a slash command's name, like ask") },
98
98
  },
99
99
  identity: ({ application_id: id }) => id,
@@ -208,6 +208,8 @@ function checkShared(data, type, err, warn) {
208
208
  err("`respond_to`: `all` already covers the others, so list it on its own");
209
209
  } else if (!type.hasGroups) {
210
210
  warn(`\`respond_to\` has no effect on ${data.type}`);
211
+ } else if (list.includes("all") && Object.hasOwn(type.fields, "channels") && data.channels === undefined) {
212
+ warn("`respond_to: [all]` answers every message in every channel it can see, and each one costs you a turn; list the ones you mean under `channels`");
211
213
  }
212
214
  }
213
215
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soft-boy/agentschema",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Markdown based AI agent schema",
5
5
  "type": "module",
6
6
  "bin": {