claude-threads 1.22.0 → 1.22.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.22.1] - 2026-08-08
9
+
10
+ ### Fixed
11
+ - **Permission prompts work in source/dev mode (`bun run dev`).** The per-session MCP config pointed at `mcp/mcp-server.js`, which only exists in a dist build — running the bot from source gave every session an MCP server path that could never spawn, silently breaking interactive permissions, `send_file`, and the decision bridge in dev mode. The path resolution now falls back to the TypeScript source and runs it under the current runtime (bun) instead of node. Built installs are unaffected.
12
+
13
+ ### Changed
14
+ - **The integration-test mock Claude CLI now speaks the modern CLI dialect, verified against verbatim real-CLI captures.** The old mock emitted an event protocol modern CLIs no longer use (top-level `tool_result` events, `TodoWrite` task lists, plan/question tools that never touched the permission system, a process that died after every turn) — so ~120 integration tests were exercising a dialect the real CLI abandoned, and the last three releases' bugs lived exactly in that blind spot. The mock was rewritten against 15 captured reference flows from the real CLI (2.1.225), committed under `tests/integration/fixtures/real-cli-captures/` with a re-capture harness (`tests/e2e-real-cli/capture-events.ts`): `system/init` and `rate_limit_event` at startup, tool results as `tool_result` blocks in `user` events, TaskCreate/TaskUpdate task tracking with result-text id resolution, one `result` per turn with the process staying alive, and SIGINT aborting in-flight tools before exiting — all shapes taken from the captures. **Interactive scenarios now spawn the real MCP permission server and block ExitPlanMode/AskUserQuestion on `permission_prompt`, so the integration suite exercises the production permission-prompt → decision-bridge → reaction-UI path end to end** — including new regression tests pinning that no duplicate generic permission prompt appears next to the plan/question UI (the 1.21.2 bug class). Captures also documented that bypass mode exposes neither ExitPlanMode nor AskUserQuestion on modern CLIs, so the plan/question suites now run with interactive permissions like production. All 21 integration suites pass against the new mock.
15
+
8
16
  ## [1.22.0] - 2026-08-08
9
17
 
10
18
  ### Changed
package/dist/index.js CHANGED
@@ -55998,6 +55998,9 @@ function buildClaudeChildEnv(parentEnv, account, opts) {
55998
55998
  }
55999
55999
  return env;
56000
56000
  }
56001
+ function runtimeForScriptPath(scriptPath) {
56002
+ return scriptPath.endsWith(".ts") ? process.execPath : "node";
56003
+ }
56001
56004
  function isErrorResultEvent(event) {
56002
56005
  const ev = event;
56003
56006
  if (typeof ev.subtype === "string" && ev.subtype.startsWith("error"))
@@ -56060,7 +56063,7 @@ function buildPermissionArgs(opts) {
56060
56063
  mcpServers: {
56061
56064
  "claude-threads-mcp": {
56062
56065
  type: "stdio",
56063
- command: "node",
56066
+ command: runtimeForScriptPath(opts.mcpServerPath),
56064
56067
  args: [opts.mcpServerPath],
56065
56068
  env: mcpEnv
56066
56069
  }
@@ -56195,10 +56198,11 @@ class ClaudeCli extends EventEmitter2 {
56195
56198
  if (this.options.sessionId) {
56196
56199
  this.statusFilePath = join5(tmpdir(), `claude-threads-status-${this.options.sessionId}.json`);
56197
56200
  const statusLineWriterPath = this.getStatusLineWriterPath();
56201
+ const runtime = runtimeForScriptPath(statusLineWriterPath);
56198
56202
  const statusLineSettings = {
56199
56203
  statusLine: {
56200
56204
  type: "command",
56201
- command: `node ${statusLineWriterPath} ${this.options.sessionId}`,
56205
+ command: `${runtime} ${statusLineWriterPath} ${this.options.sessionId}`,
56202
56206
  padding: 0
56203
56207
  }
56204
56208
  };
@@ -56427,7 +56431,15 @@ class ClaudeCli extends EventEmitter2 {
56427
56431
  if (existsSync7(bundledPath)) {
56428
56432
  return bundledPath;
56429
56433
  }
56430
- return resolve3(__dirname4, "..", "mcp", "mcp-server.js");
56434
+ const sourceLayoutPath = resolve3(__dirname4, "..", "mcp", "mcp-server.js");
56435
+ if (existsSync7(sourceLayoutPath)) {
56436
+ return sourceLayoutPath;
56437
+ }
56438
+ const tsPath = resolve3(__dirname4, "..", "mcp", "mcp-server.ts");
56439
+ if (existsSync7(tsPath)) {
56440
+ return tsPath;
56441
+ }
56442
+ return sourceLayoutPath;
56431
56443
  }
56432
56444
  getStatusLineWriterPath() {
56433
56445
  const __filename2 = fileURLToPath3(import.meta.url);
@@ -56436,7 +56448,15 @@ class ClaudeCli extends EventEmitter2 {
56436
56448
  if (existsSync7(bundledPath)) {
56437
56449
  return bundledPath;
56438
56450
  }
56439
- return resolve3(__dirname4, "..", "statusline", "writer.js");
56451
+ const sourceLayoutPath = resolve3(__dirname4, "..", "statusline", "writer.js");
56452
+ if (existsSync7(sourceLayoutPath)) {
56453
+ return sourceLayoutPath;
56454
+ }
56455
+ const tsPath = resolve3(__dirname4, "..", "statusline", "writer.ts");
56456
+ if (existsSync7(tsPath)) {
56457
+ return tsPath;
56458
+ }
56459
+ return sourceLayoutPath;
56440
56460
  }
56441
56461
  }
56442
56462
 
@@ -56106,6 +56106,9 @@ function buildClaudeChildEnv(parentEnv, account, opts) {
56106
56106
  }
56107
56107
  return env;
56108
56108
  }
56109
+ function runtimeForScriptPath(scriptPath) {
56110
+ return scriptPath.endsWith(".ts") ? process.execPath : "node";
56111
+ }
56109
56112
  function isErrorResultEvent(event) {
56110
56113
  const ev = event;
56111
56114
  if (typeof ev.subtype === "string" && ev.subtype.startsWith("error"))
@@ -56168,7 +56171,7 @@ function buildPermissionArgs(opts) {
56168
56171
  mcpServers: {
56169
56172
  "claude-threads-mcp": {
56170
56173
  type: "stdio",
56171
- command: "node",
56174
+ command: runtimeForScriptPath(opts.mcpServerPath),
56172
56175
  args: [opts.mcpServerPath],
56173
56176
  env: mcpEnv
56174
56177
  }
@@ -56303,10 +56306,11 @@ class ClaudeCli extends EventEmitter2 {
56303
56306
  if (this.options.sessionId) {
56304
56307
  this.statusFilePath = join4(tmpdir2(), `claude-threads-status-${this.options.sessionId}.json`);
56305
56308
  const statusLineWriterPath = this.getStatusLineWriterPath();
56309
+ const runtime = runtimeForScriptPath(statusLineWriterPath);
56306
56310
  const statusLineSettings = {
56307
56311
  statusLine: {
56308
56312
  type: "command",
56309
- command: `node ${statusLineWriterPath} ${this.options.sessionId}`,
56313
+ command: `${runtime} ${statusLineWriterPath} ${this.options.sessionId}`,
56310
56314
  padding: 0
56311
56315
  }
56312
56316
  };
@@ -56535,7 +56539,15 @@ class ClaudeCli extends EventEmitter2 {
56535
56539
  if (existsSync4(bundledPath)) {
56536
56540
  return bundledPath;
56537
56541
  }
56538
- return resolve4(__dirname4, "..", "mcp", "mcp-server.js");
56542
+ const sourceLayoutPath = resolve4(__dirname4, "..", "mcp", "mcp-server.js");
56543
+ if (existsSync4(sourceLayoutPath)) {
56544
+ return sourceLayoutPath;
56545
+ }
56546
+ const tsPath = resolve4(__dirname4, "..", "mcp", "mcp-server.ts");
56547
+ if (existsSync4(tsPath)) {
56548
+ return tsPath;
56549
+ }
56550
+ return sourceLayoutPath;
56539
56551
  }
56540
56552
  getStatusLineWriterPath() {
56541
56553
  const __filename2 = fileURLToPath3(import.meta.url);
@@ -56544,7 +56556,15 @@ class ClaudeCli extends EventEmitter2 {
56544
56556
  if (existsSync4(bundledPath)) {
56545
56557
  return bundledPath;
56546
56558
  }
56547
- return resolve4(__dirname4, "..", "statusline", "writer.js");
56559
+ const sourceLayoutPath = resolve4(__dirname4, "..", "statusline", "writer.js");
56560
+ if (existsSync4(sourceLayoutPath)) {
56561
+ return sourceLayoutPath;
56562
+ }
56563
+ const tsPath = resolve4(__dirname4, "..", "statusline", "writer.ts");
56564
+ if (existsSync4(tsPath)) {
56565
+ return tsPath;
56566
+ }
56567
+ return sourceLayoutPath;
56548
56568
  }
56549
56569
  }
56550
56570
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-threads",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "Run Claude Code from Slack or Mattermost. Sessions stream live into threads where your whole team can watch and steer.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",