@leo000001/claude-code-mcp 2.4.3 → 2.4.6

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
@@ -8,6 +8,8 @@
8
8
 
9
9
  ### Improvements
10
10
 
11
+ - Upgrade `@anthropic-ai/claude-agent-sdk` to `^0.2.49` and align MCP-facing schemas with the current SDK surface.
12
+ - Permission mode enum now follows SDK 0.2.49 (`default`, `acceptEdits`, `bypassPermissions`, `plan`, `dontAsk`; `delegate` removed).
11
13
  - Session cleanup now marks timed-out running/waiting sessions as `cancelled` for consistent status semantics.
12
14
  - `SessionManager.destroy()` now clears in-memory session/runtime maps after aborting active runs, so post-destroy reads are no longer stale.
13
15
  - Event buffer eviction now uses batch compaction (instead of repeated `findIndex` + `splice`) and `readEvents` now uses binary search for cursor start.
@@ -15,6 +17,8 @@
15
17
  - Runtime tool-discovery updates now notify both tools and resources (internal-tools resource change notification).
16
18
  - Enrich compatibility resources with package version, disk-resume diagnostics, and runtime limits.
17
19
  - Remove deprecated `claude_code` parameter aliases: top-level `sessionInitTimeoutMs` and `advanced.effort` / `advanced.thinking`.
20
+ - Add support for SDK `promptSuggestions` option passthrough and expose `promptSuggestions` in `advanced`/`diskResumeConfig`.
21
+ - Query consumer now maps additional SDK stream messages (`system/task_started`, `rate_limit`, `prompt_suggestion`) to progress events.
18
22
 
19
23
  ### Documentation
20
24
 
package/README.md CHANGED
@@ -117,7 +117,7 @@ Start a new Claude Code session. The agent autonomously performs coding tasks: r
117
117
  | `advanced` | object | No | Advanced/low-frequency parameters (see below) |
118
118
 
119
119
  <details>
120
- <summary><code>advanced</code> object parameters (20 low-frequency parameters)</summary>
120
+ <summary><code>advanced</code> object parameters (21 low-frequency parameters)</summary>
121
121
 
122
122
  | Parameter | Type | Description |
123
123
  | ------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -136,6 +136,7 @@ Start a new Claude Code session. The agent autonomously performs coding tasks: r
136
136
  | `advanced.fallbackModel` | string | Fallback model if the primary model fails or is unavailable. Default: none |
137
137
  | `advanced.enableFileCheckpointing` | boolean | Enable file checkpointing to track file changes during the session. Default: `false` |
138
138
  | `advanced.includePartialMessages` | boolean | When true, includes intermediate streaming messages in the response. Useful for real-time progress monitoring. Default: false |
139
+ | `advanced.promptSuggestions` | boolean | When true, emits post-turn prompt suggestion events (`prompt_suggestion`). Default: `false` |
139
140
  | `advanced.strictMcpConfig` | boolean | Enforce strict validation of MCP server configurations. Default: `false` |
140
141
  | `advanced.settingSources` | string[] | Which filesystem settings to load. Defaults to `["user", "project", "local"]` (loads all settings and CLAUDE.md). Pass `[]` for SDK isolation mode |
141
142
  | `advanced.debug` | boolean | Enable debug mode for verbose logging. Default: `false` |
@@ -177,7 +178,7 @@ Continue an existing session by sending a follow-up message. The agent retains f
177
178
  | `diskResumeConfig` | object | No | Disk resume parameters (see below). Used when `CLAUDE_CODE_MCP_ALLOW_DISK_RESUME=1` and in-memory session is missing |
178
179
 
179
180
  <details>
180
- <summary><code>diskResumeConfig</code> object parameters (28 disk-resume-only parameters)</summary>
181
+ <summary><code>diskResumeConfig</code> object parameters (31 disk-resume-only parameters)</summary>
181
182
 
182
183
  | Parameter | Type | Description |
183
184
  | --------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------- |
@@ -185,6 +186,7 @@ Continue an existing session by sending a follow-up message. The agent retains f
185
186
  | `diskResumeConfig.cwd` | string | Working directory. Required for disk resume. |
186
187
  | `diskResumeConfig.allowedTools` | string[] | Auto-approved tool names (see `claude_code`). Default: `[]` |
187
188
  | `diskResumeConfig.disallowedTools` | string[] | Forbidden tool names (see `claude_code`). Default: `[]` |
189
+ | `diskResumeConfig.strictAllowedTools` | boolean | Enforce strict allow-list behavior for `allowedTools`. Default: `false` |
188
190
  | `diskResumeConfig.tools` | string[] \| object | Base tool set (see `claude_code`). Default: SDK/Claude Code default |
189
191
  | `diskResumeConfig.persistSession` | boolean | Persist session history to disk. Default: `true` |
190
192
  | `diskResumeConfig.maxTurns` | number | Maximum number of agent reasoning steps. Default: SDK/Claude Code default |
@@ -205,6 +207,7 @@ Continue an existing session by sending a follow-up message. The agent retains f
205
207
  | `diskResumeConfig.fallbackModel` | string | Fallback model. Default: none |
206
208
  | `diskResumeConfig.enableFileCheckpointing` | boolean | Enable file checkpointing. Default: `false` |
207
209
  | `diskResumeConfig.includePartialMessages` | boolean | Include intermediate streaming messages. Default: `false` |
210
+ | `diskResumeConfig.promptSuggestions` | boolean | Emit post-turn prompt suggestion events (`prompt_suggestion`). Default: `false` |
208
211
  | `diskResumeConfig.strictMcpConfig` | boolean | Strict MCP config validation. Default: `false` |
209
212
  | `diskResumeConfig.settingSources` | string[] | Which filesystem settings to load. Default: `["user", "project", "local"]` |
210
213
  | `diskResumeConfig.debug` | boolean | Debug mode. Default: `false` |
package/dist/index.js CHANGED
@@ -232,6 +232,7 @@ var SessionManager = class _SessionManager {
232
232
  fallbackModel: params.fallbackModel,
233
233
  enableFileCheckpointing: params.enableFileCheckpointing,
234
234
  includePartialMessages: params.includePartialMessages,
235
+ promptSuggestions: params.promptSuggestions,
235
236
  strictMcpConfig: params.strictMcpConfig,
236
237
  settingSources: params.settingSources,
237
238
  debug: params.debug,
@@ -1236,6 +1237,26 @@ function messageToEvent(msg) {
1236
1237
  }
1237
1238
  };
1238
1239
  }
1240
+ if (msg.type === "system" && msg.subtype === "task_started") {
1241
+ return {
1242
+ type: "progress",
1243
+ data: {
1244
+ type: "task_started",
1245
+ task_id: msg.task_id,
1246
+ tool_use_id: msg.tool_use_id,
1247
+ description: msg.description,
1248
+ task_type: msg.task_type
1249
+ }
1250
+ };
1251
+ }
1252
+ if (msg.type === "rate_limit" || msg.type === "prompt_suggestion") {
1253
+ const rest = { ...msg };
1254
+ delete rest.type;
1255
+ return {
1256
+ type: "progress",
1257
+ data: { type: msg.type, ...rest }
1258
+ };
1259
+ }
1239
1260
  return null;
1240
1261
  }
1241
1262
  function consumeQuery(params) {
@@ -1401,6 +1422,7 @@ function consumeQuery(params) {
1401
1422
  let retryCount = 0;
1402
1423
  let currentStream = activeQuery;
1403
1424
  while (true) {
1425
+ let streamReceivedResult = false;
1404
1426
  try {
1405
1427
  for await (const message of currentStream) {
1406
1428
  if (isSystemInitMessage(message)) {
@@ -1441,6 +1463,7 @@ function consumeQuery(params) {
1441
1463
  continue;
1442
1464
  }
1443
1465
  if (message.type === "result") {
1466
+ streamReceivedResult = true;
1444
1467
  const sessionId2 = message.session_id ?? await getSessionId();
1445
1468
  const agentResult = sdkResultToAgentResult(message);
1446
1469
  const current = params.sessionManager.get(sessionId2);
@@ -1483,7 +1506,7 @@ function consumeQuery(params) {
1483
1506
  queryInterrupt: void 0
1484
1507
  });
1485
1508
  }
1486
- return;
1509
+ continue;
1487
1510
  }
1488
1511
  const sessionId = message.session_id ?? await getSessionId();
1489
1512
  const event = messageToEvent(message);
@@ -1501,7 +1524,7 @@ function consumeQuery(params) {
1501
1524
  `Error [${"INTERNAL" /* INTERNAL */}]: query stream ended before receiving session init.`
1502
1525
  )
1503
1526
  );
1504
- } else if (activeSessionId) {
1527
+ } else if (activeSessionId && !streamReceivedResult) {
1505
1528
  const sessionId = activeSessionId;
1506
1529
  const current = params.sessionManager.get(sessionId);
1507
1530
  if (current && current.status !== "cancelled") {
@@ -1548,6 +1571,9 @@ function consumeQuery(params) {
1548
1571
  );
1549
1572
  return;
1550
1573
  }
1574
+ if (streamReceivedResult) {
1575
+ return;
1576
+ }
1551
1577
  if (!activeSessionId) return;
1552
1578
  const sessionId = activeSessionId;
1553
1579
  if (errClass === "transient" && retryCount < MAX_TRANSIENT_RETRIES) {
@@ -1712,6 +1738,7 @@ function buildOptions(src) {
1712
1738
  opts.enableFileCheckpointing = src.enableFileCheckpointing;
1713
1739
  if (src.includePartialMessages !== void 0)
1714
1740
  opts.includePartialMessages = src.includePartialMessages;
1741
+ if (src.promptSuggestions !== void 0) opts.promptSuggestions = src.promptSuggestions;
1715
1742
  if (src.strictMcpConfig !== void 0) opts.strictMcpConfig = src.strictMcpConfig;
1716
1743
  if (src.settingSources !== void 0) opts.settingSources = src.settingSources;
1717
1744
  else opts.settingSources = DEFAULT_SETTING_SOURCES;
@@ -1750,6 +1777,7 @@ function toSessionCreateParams(input) {
1750
1777
  fallbackModel: src.fallbackModel,
1751
1778
  enableFileCheckpointing: src.enableFileCheckpointing,
1752
1779
  includePartialMessages: src.includePartialMessages,
1780
+ promptSuggestions: src.promptSuggestions,
1753
1781
  strictMcpConfig: src.strictMcpConfig,
1754
1782
  settingSources: src.settingSources ?? DEFAULT_SETTING_SOURCES,
1755
1783
  debug: src.debug,
@@ -3562,7 +3590,7 @@ function registerResources(server, deps) {
3562
3590
  }
3563
3591
 
3564
3592
  // src/server.ts
3565
- var SERVER_VERSION = true ? "2.4.3" : "0.0.0-dev";
3593
+ var SERVER_VERSION = true ? "2.4.6" : "0.0.0-dev";
3566
3594
  function createServerContext(serverCwd) {
3567
3595
  const sessionManager = new SessionManager();
3568
3596
  const server = new McpServer(
@@ -3652,6 +3680,7 @@ function createServerContext(serverCwd) {
3652
3680
  fallbackModel: z.string().optional().describe("Default: none"),
3653
3681
  enableFileCheckpointing: z.boolean().optional().describe("Default: false"),
3654
3682
  includePartialMessages: z.boolean().optional().describe("Default: false"),
3683
+ promptSuggestions: z.boolean().optional().describe("Default: false"),
3655
3684
  strictMcpConfig: z.boolean().optional().describe("Default: false"),
3656
3685
  settingSources: z.array(z.enum(["user", "project", "local"])).optional().describe("Default: ['user','project','local']. []=isolation"),
3657
3686
  debug: z.boolean().optional().describe("Default: false"),