@gonzih/cc-discord 0.2.19 → 0.2.21

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/claude.js CHANGED
@@ -182,9 +182,12 @@ export function extractText(msg) {
182
182
  }
183
183
  /**
184
184
  * Resolve the claude CLI binary path.
185
- * Checks PATH entries + common npm global install locations.
185
+ * Checks CLAUDE_BIN env var first, then PATH entries + common npm global install locations.
186
186
  */
187
187
  function resolveClaude(pathEnv) {
188
+ // Allow test/operator override via CLAUDE_BIN
189
+ if (process.env.CLAUDE_BIN)
190
+ return process.env.CLAUDE_BIN;
188
191
  // Try PATH entries first
189
192
  const dirs = (pathEnv ?? process.env.PATH ?? "").split(":");
190
193
  for (const dir of dirs) {
@@ -92,8 +92,12 @@ export function injectMcp(ns, wsPath, token) {
92
92
  }
93
93
  /**
94
94
  * Resolve claude binary — same logic as claude.ts resolveClaude.
95
+ * Checks CLAUDE_BIN env var first, then PATH + common fallback locations.
95
96
  */
96
97
  function resolveClaude() {
98
+ // Allow test/operator override via CLAUDE_BIN
99
+ if (process.env.CLAUDE_BIN)
100
+ return process.env.CLAUDE_BIN;
97
101
  const dirs = (process.env.PATH ?? "").split(":");
98
102
  for (const dir of dirs) {
99
103
  const c = `${dir}/claude`;
package/dist/notifier.js CHANGED
@@ -97,8 +97,6 @@ export function parseNotification(raw) {
97
97
  }
98
98
  if (parsed.is_cron === true)
99
99
  return null;
100
- if (parsed.text?.startsWith("⏰"))
101
- return null;
102
100
  if (parsed.text)
103
101
  text = parsed.text;
104
102
  driver = parsed.driver;
@@ -111,8 +109,10 @@ export function parseNotification(raw) {
111
109
  isCron = parsed.is_cron;
112
110
  }
113
111
  catch {
114
- return { text, isCron };
112
+ // non-JSON: fall through to text-based check below
115
113
  }
114
+ if (text.startsWith("⏰"))
115
+ return null;
116
116
  // Parse eval_report if present — this field is non-standard and not in NotificationPayload type
117
117
  const evalReport = parseEvalReport(raw);
118
118
  if (!driver)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-discord",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "description": "Claude Code Discord bot — chat with Claude Code via Discord",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,8 @@
12
12
  "dev": "node --loader ts-node/esm src/index.ts",
13
13
  "test": "vitest run",
14
14
  "test:watch": "vitest",
15
- "test:coverage": "vitest run --coverage"
15
+ "test:coverage": "vitest run --coverage",
16
+ "test:integration": "CLAUDE_BIN=./test/fixtures/mock-claude.js vitest run test/integration/"
16
17
  },
17
18
  "files": [
18
19
  "dist/"