clementine-agent 1.0.90 → 1.0.91
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.
|
@@ -63,8 +63,15 @@ export declare class AgentBotClient {
|
|
|
63
63
|
*
|
|
64
64
|
* Priority:
|
|
65
65
|
* 1. Explicit channelIds from config (e.g. discordChannelId in agent.md)
|
|
66
|
-
* 2. Match by channelName in any guild the bot is in
|
|
67
|
-
* 3.
|
|
66
|
+
* 2. Match by channelName in any guild the bot is in (single name or array)
|
|
67
|
+
* 3. **DM-only.** If neither is configured, the bot does not subscribe to any
|
|
68
|
+
* text channel — it only responds in DMs. Each agent has its own bot
|
|
69
|
+
* token specifically so it has its own DM lane to the owner; spamming
|
|
70
|
+
* every visible channel by default is the opposite of what users want.
|
|
71
|
+
*
|
|
72
|
+
* Previously this fell back to "all visible text channels," which made
|
|
73
|
+
* Ross + Nora respond everywhere in guild because they had no channelName
|
|
74
|
+
* set. Opt-in is the correct default.
|
|
68
75
|
*/
|
|
69
76
|
private discoverChannels;
|
|
70
77
|
/**
|
|
@@ -200,8 +200,15 @@ export class AgentBotClient {
|
|
|
200
200
|
*
|
|
201
201
|
* Priority:
|
|
202
202
|
* 1. Explicit channelIds from config (e.g. discordChannelId in agent.md)
|
|
203
|
-
* 2. Match by channelName in any guild the bot is in
|
|
204
|
-
* 3.
|
|
203
|
+
* 2. Match by channelName in any guild the bot is in (single name or array)
|
|
204
|
+
* 3. **DM-only.** If neither is configured, the bot does not subscribe to any
|
|
205
|
+
* text channel — it only responds in DMs. Each agent has its own bot
|
|
206
|
+
* token specifically so it has its own DM lane to the owner; spamming
|
|
207
|
+
* every visible channel by default is the opposite of what users want.
|
|
208
|
+
*
|
|
209
|
+
* Previously this fell back to "all visible text channels," which made
|
|
210
|
+
* Ross + Nora respond everywhere in guild because they had no channelName
|
|
211
|
+
* set. Opt-in is the correct default.
|
|
205
212
|
*/
|
|
206
213
|
discoverChannels() {
|
|
207
214
|
// 1. Explicit IDs
|
|
@@ -225,19 +232,13 @@ export class AgentBotClient {
|
|
|
225
232
|
logger.info({ slug: this.config.slug, channelNames, matched }, 'Auto-discovered channels by name');
|
|
226
233
|
return matched;
|
|
227
234
|
}
|
|
228
|
-
logger.warn({ slug: this.config.slug, channelNames }, 'No channels found matching channelName(s) — falling back to
|
|
229
|
-
}
|
|
230
|
-
// 3. Fallback: all text channels the bot can see
|
|
231
|
-
const all = [];
|
|
232
|
-
for (const guild of this.client.guilds.cache.values()) {
|
|
233
|
-
for (const channel of guild.channels.cache.values()) {
|
|
234
|
-
if (channel.type === ChannelType.GuildText) {
|
|
235
|
-
all.push(channel.id);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
235
|
+
logger.warn({ slug: this.config.slug, channelNames }, 'No channels found matching channelName(s) — falling back to DM-only');
|
|
238
236
|
}
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
// 3. DM-only. Bot will still respond to DMs (handleMessage checks isDMBased
|
|
238
|
+
// before consulting resolvedChannelIds), so this is the right "no channels"
|
|
239
|
+
// default — not silence.
|
|
240
|
+
logger.info({ slug: this.config.slug }, 'Bot in DM-only mode (no channelName configured)');
|
|
241
|
+
return [];
|
|
241
242
|
}
|
|
242
243
|
/**
|
|
243
244
|
* Send a notification to the owner's DMs on behalf of this agent bot.
|