@gonzih/cc-discord 0.2.9 → 0.2.10

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/dist/bot.js CHANGED
@@ -443,6 +443,7 @@ export class CcDiscordBot {
443
443
  const loopState = this.loopManager.getState(parentId);
444
444
  if (loopState && loopState.threadId === effectiveChannelId) {
445
445
  const username = msg.member?.displayName ?? msg.author.username;
446
+ this.startMetaAgentTyping(effectiveChannelId, msg.channel);
446
447
  try {
447
448
  await routeToMetaAgent(loopState.namespace, stampPrompt(text, username, msg.createdAt), this.redis);
448
449
  }
package/dist/notifier.js CHANGED
@@ -203,7 +203,8 @@ export function startNotifier(bot, notifyChannelId, namespace, redis, handleUser
203
203
  // Buffer for meta-agent streaming output — debounced before sending to Discord
204
204
  const metaAgentBuffers = new Map();
205
205
  function flushMetaAgentBuffer(ns, targetChannelId) {
206
- bot.stopMetaAgentTyping(targetChannelId);
206
+ const loopThreadId = bot.getLoopThreadId(targetChannelId);
207
+ bot.stopMetaAgentTyping(loopThreadId ?? targetChannelId);
207
208
  const buf = metaAgentBuffers.get(ns);
208
209
  if (!buf || !buf.text.trim())
209
210
  return;
@@ -290,8 +291,8 @@ export function startNotifier(bot, notifyChannelId, namespace, redis, handleUser
290
291
  const mainChannelId = ns === namespace
291
292
  ? (resolveNotifyChannel(notification.chatId, notifyChannelId, getActiveChannelId, reverseSnowflakeLookup, ns, getChannelIdForNamespace) ?? targetChannelId)
292
293
  : targetChannelId;
293
- // If a loop is active for this channel, route to its thread
294
- const destChannelId = bot.getLoopThreadId(mainChannelId) ?? mainChannelId;
294
+ // If a loop is active for this channel, route to its thread (skip for cron notifications)
295
+ const destChannelId = (!notification.isCron && bot.getLoopThreadId(mainChannelId)) ? bot.getLoopThreadId(mainChannelId) : mainChannelId;
295
296
  // When an eval report is embedded, post a structured embed to the thread
296
297
  if (notification.evalReport) {
297
298
  bot.postEvalEmbed(mainChannelId, notification.evalReport).catch((err) => {
@@ -351,8 +352,8 @@ export function startNotifier(bot, notifyChannelId, namespace, redis, handleUser
351
352
  : routedChannelIds.get(ns);
352
353
  }
353
354
  if (mainChannelId != null) {
354
- // If a loop is active, route notification text to the thread
355
- const deliverTo = bot.getLoopThreadId(mainChannelId) ?? mainChannelId;
355
+ // If a loop is active, route notification text to the thread (skip for cron notifications)
356
+ const deliverTo = (!notification.isCron && bot.getLoopThreadId(mainChannelId)) ? bot.getLoopThreadId(mainChannelId) : mainChannelId;
356
357
  if (notification.evalReport) {
357
358
  bot.postEvalEmbed(mainChannelId, notification.evalReport).catch((err) => {
358
359
  log("warn", `postEvalEmbed failed (ns=${ns}):`, err.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-discord",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Claude Code Discord bot — chat with Claude Code via Discord",
5
5
  "type": "module",
6
6
  "bin": {