@gonzih/cc-discord 0.2.29 → 0.2.31

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.
@@ -301,10 +301,10 @@ function spawnPersistentSession(ns, token, wire, onExit) {
301
301
  const proc = spawn(claudeBin, [
302
302
  "--continue",
303
303
  "--output-format", "stream-json",
304
+ "--input-format", "stream-json",
304
305
  "--verbose",
305
306
  "--dangerously-skip-permissions",
306
307
  ], { cwd: wsPath, env, stdio: ["pipe", "pipe", "pipe"] });
307
- // Set stdin encoding so we can write strings directly
308
308
  proc.stdin.setDefaultEncoding("utf8");
309
309
  wireStdoutToRedis(proc, ns, wire);
310
310
  proc.on("exit", (code) => {
@@ -347,7 +347,9 @@ export function createMetaAgentManager() {
347
347
  if (!session)
348
348
  return;
349
349
  try {
350
- session.proc.stdin.write(`${line}\n`);
350
+ // --input-format stream-json expects JSON lines: {"type":"user","message":"..."}
351
+ const payload = JSON.stringify({ type: "user", message: line });
352
+ session.proc.stdin.write(`${payload}\n`);
351
353
  }
352
354
  catch (err) {
353
355
  console.warn(`[meta-agent-manager] stdin write failed (ns=${ns}):`, err.message);
package/dist/notifier.js CHANGED
@@ -112,14 +112,17 @@ export function parseNotification(raw) {
112
112
  let isCron = false;
113
113
  try {
114
114
  const parsed = JSON.parse(raw);
115
+ // Accept 'targets' as alias for 'routing' (coordinator sessions use this format)
116
+ const routingArr = parsed.routing ?? parsed.targets;
115
117
  // routing: absent/empty → all transports; non-empty → only listed transports
116
- if (parsed.routing && parsed.routing.length > 0 && !parsed.routing.includes("discord")) {
118
+ if (routingArr && routingArr.length > 0 && !routingArr.includes("discord")) {
117
119
  return null;
118
120
  }
119
121
  if (parsed.is_cron === true)
120
122
  return null;
121
- if (parsed.text)
122
- text = parsed.text;
123
+ // Accept 'message' as alias for 'text'
124
+ if (parsed.text ?? parsed.message)
125
+ text = (parsed.text ?? parsed.message);
123
126
  driver = parsed.driver;
124
127
  model = parsed.model;
125
128
  if (typeof parsed.cost === "number")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-discord",
3
- "version": "0.2.29",
3
+ "version": "0.2.31",
4
4
  "description": "Claude Code Discord bot — chat with Claude Code via Discord",
5
5
  "type": "module",
6
6
  "bin": {