@leo000001/claude-code-mcp 2.5.0 → 2.8.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 +12 -1
- package/NOTICE.md +1 -1
- package/README.md +90 -22
- package/dist/index.js +132 -23
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -231,12 +231,16 @@ var SessionManager = class _SessionManager {
|
|
|
231
231
|
sandbox: params.sandbox,
|
|
232
232
|
fallbackModel: params.fallbackModel,
|
|
233
233
|
enableFileCheckpointing: params.enableFileCheckpointing,
|
|
234
|
+
toolConfig: params.toolConfig,
|
|
234
235
|
includePartialMessages: params.includePartialMessages,
|
|
235
236
|
promptSuggestions: params.promptSuggestions,
|
|
237
|
+
agentProgressSummaries: params.agentProgressSummaries,
|
|
236
238
|
strictMcpConfig: params.strictMcpConfig,
|
|
239
|
+
settings: params.settings,
|
|
237
240
|
settingSources: params.settingSources,
|
|
238
241
|
debug: params.debug,
|
|
239
242
|
debugFile: params.debugFile,
|
|
243
|
+
fastModeState: params.fastModeState,
|
|
240
244
|
env: params.env,
|
|
241
245
|
abortController: params.abortController,
|
|
242
246
|
queryInterrupt: params.queryInterrupt
|
|
@@ -753,7 +757,8 @@ var SessionManager = class _SessionManager {
|
|
|
753
757
|
cwd: info.cwd,
|
|
754
758
|
systemPrompt: info.systemPrompt,
|
|
755
759
|
agents: info.agents,
|
|
756
|
-
additionalDirectories: info.additionalDirectories
|
|
760
|
+
additionalDirectories: info.additionalDirectories,
|
|
761
|
+
toolConfig: info.toolConfig
|
|
757
762
|
};
|
|
758
763
|
}
|
|
759
764
|
/** Serialize session info for listing/inspection (redacts sensitive fields) */
|
|
@@ -766,8 +771,10 @@ var SessionManager = class _SessionManager {
|
|
|
766
771
|
agents: _agents,
|
|
767
772
|
additionalDirectories: _additionalDirectories,
|
|
768
773
|
pathToClaudeCodeExecutable: _pathToClaudeCodeExecutable,
|
|
774
|
+
toolConfig: _toolConfig,
|
|
769
775
|
mcpServers: _mcpServers,
|
|
770
776
|
sandbox: _sandbox,
|
|
777
|
+
settings: _settings,
|
|
771
778
|
settingSources: _settingSources,
|
|
772
779
|
debugFile: _debugFile,
|
|
773
780
|
env: _env,
|
|
@@ -844,7 +851,7 @@ var SessionManager = class _SessionManager {
|
|
|
844
851
|
const isNoisyProgressEvent = (event) => {
|
|
845
852
|
if (event.type !== "progress") return false;
|
|
846
853
|
const t = event.data?.type;
|
|
847
|
-
return t === "tool_progress" || t === "auth_status" || t === "task_progress" || t === "hook_progress";
|
|
854
|
+
return t === "tool_progress" || t === "auth_status" || t === "api_retry" || t === "task_progress" || t === "hook_progress";
|
|
848
855
|
};
|
|
849
856
|
let toDropForSoftLimit = remaining - buffer.maxSize;
|
|
850
857
|
if (toDropForSoftLimit > 0) {
|
|
@@ -911,7 +918,6 @@ import { existsSync as existsSync2, statSync } from "fs";
|
|
|
911
918
|
|
|
912
919
|
// src/types.ts
|
|
913
920
|
var EFFORT_LEVELS = ["low", "medium", "high", "max"];
|
|
914
|
-
var AGENT_MODELS = ["sonnet", "opus", "haiku", "inherit"];
|
|
915
921
|
var SESSION_ACTIONS = ["list", "get", "cancel", "interrupt"];
|
|
916
922
|
var DEFAULT_SETTING_SOURCES = ["user", "project", "local"];
|
|
917
923
|
var CHECK_ACTIONS = ["poll", "respond_permission"];
|
|
@@ -1161,6 +1167,7 @@ function sdkResultToAgentResult(result) {
|
|
|
1161
1167
|
sessionTotalTurns: typeof sessionTotalTurns === "number" ? sessionTotalTurns : void 0,
|
|
1162
1168
|
sessionTotalCostUsd: typeof sessionTotalCostUsd === "number" ? sessionTotalCostUsd : void 0,
|
|
1163
1169
|
stopReason: result.stop_reason,
|
|
1170
|
+
fastModeState: result.fast_mode_state,
|
|
1164
1171
|
usage: result.usage,
|
|
1165
1172
|
modelUsage: result.modelUsage,
|
|
1166
1173
|
permissionDenials: result.permission_denials
|
|
@@ -1204,9 +1211,28 @@ function messageToEvent(msg) {
|
|
|
1204
1211
|
}
|
|
1205
1212
|
};
|
|
1206
1213
|
}
|
|
1214
|
+
if (msg.type === "stream_event") {
|
|
1215
|
+
return {
|
|
1216
|
+
type: "output",
|
|
1217
|
+
data: {
|
|
1218
|
+
type: "stream_event",
|
|
1219
|
+
event: msg.event,
|
|
1220
|
+
parent_tool_use_id: msg.parent_tool_use_id
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1207
1224
|
if (msg.type === "tool_use_summary") {
|
|
1208
1225
|
return { type: "progress", data: { type: "tool_use_summary", summary: msg.summary } };
|
|
1209
1226
|
}
|
|
1227
|
+
if (msg.type === "system" && msg.subtype === "local_command_output") {
|
|
1228
|
+
return {
|
|
1229
|
+
type: "output",
|
|
1230
|
+
data: {
|
|
1231
|
+
type: "local_command_output",
|
|
1232
|
+
content: msg.content
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1210
1236
|
if (msg.type === "tool_progress") {
|
|
1211
1237
|
return {
|
|
1212
1238
|
type: "progress",
|
|
@@ -1237,6 +1263,15 @@ function messageToEvent(msg) {
|
|
|
1237
1263
|
data: { type: "status", status: msg.status, permissionMode: msg.permissionMode }
|
|
1238
1264
|
};
|
|
1239
1265
|
}
|
|
1266
|
+
if (msg.type === "system" && msg.subtype === "compact_boundary") {
|
|
1267
|
+
return {
|
|
1268
|
+
type: "progress",
|
|
1269
|
+
data: {
|
|
1270
|
+
type: "compact_boundary",
|
|
1271
|
+
compact_metadata: msg.compact_metadata
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1240
1275
|
if (msg.type === "system" && msg.subtype === "hook_started") {
|
|
1241
1276
|
return {
|
|
1242
1277
|
type: "progress",
|
|
@@ -1289,6 +1324,19 @@ function messageToEvent(msg) {
|
|
|
1289
1324
|
}
|
|
1290
1325
|
};
|
|
1291
1326
|
}
|
|
1327
|
+
if (msg.type === "system" && msg.subtype === "api_retry") {
|
|
1328
|
+
return {
|
|
1329
|
+
type: "progress",
|
|
1330
|
+
data: {
|
|
1331
|
+
type: "api_retry",
|
|
1332
|
+
attempt: msg.attempt,
|
|
1333
|
+
max_retries: msg.max_retries,
|
|
1334
|
+
retry_delay_ms: msg.retry_delay_ms,
|
|
1335
|
+
error_status: msg.error_status,
|
|
1336
|
+
error: msg.error
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1292
1340
|
if (msg.type === "system" && msg.subtype === "task_started") {
|
|
1293
1341
|
return {
|
|
1294
1342
|
type: "progress",
|
|
@@ -1297,7 +1345,8 @@ function messageToEvent(msg) {
|
|
|
1297
1345
|
task_id: msg.task_id,
|
|
1298
1346
|
tool_use_id: msg.tool_use_id,
|
|
1299
1347
|
description: msg.description,
|
|
1300
|
-
task_type: msg.task_type
|
|
1348
|
+
task_type: msg.task_type,
|
|
1349
|
+
prompt: msg.prompt
|
|
1301
1350
|
}
|
|
1302
1351
|
};
|
|
1303
1352
|
}
|
|
@@ -1310,7 +1359,8 @@ function messageToEvent(msg) {
|
|
|
1310
1359
|
tool_use_id: msg.tool_use_id,
|
|
1311
1360
|
description: msg.description,
|
|
1312
1361
|
usage: msg.usage,
|
|
1313
|
-
last_tool_name: msg.last_tool_name
|
|
1362
|
+
last_tool_name: msg.last_tool_name,
|
|
1363
|
+
summary: msg.summary
|
|
1314
1364
|
}
|
|
1315
1365
|
};
|
|
1316
1366
|
}
|
|
@@ -1328,7 +1378,17 @@ function messageToEvent(msg) {
|
|
|
1328
1378
|
}
|
|
1329
1379
|
};
|
|
1330
1380
|
}
|
|
1331
|
-
if (msg.type === "
|
|
1381
|
+
if (msg.type === "system" && msg.subtype === "elicitation_complete") {
|
|
1382
|
+
return {
|
|
1383
|
+
type: "progress",
|
|
1384
|
+
data: {
|
|
1385
|
+
type: "elicitation_complete",
|
|
1386
|
+
mcp_server_name: msg.mcp_server_name,
|
|
1387
|
+
elicitation_id: msg.elicitation_id
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
if (msg.type === "rate_limit_event" || msg.type === "prompt_suggestion") {
|
|
1332
1392
|
const rest = { ...msg };
|
|
1333
1393
|
delete rest.type;
|
|
1334
1394
|
delete rest.uuid;
|
|
@@ -1416,8 +1476,10 @@ function consumeQuery(params) {
|
|
|
1416
1476
|
requestId,
|
|
1417
1477
|
toolName,
|
|
1418
1478
|
input: normalizedInput,
|
|
1419
|
-
summary: summarizePermission(toolName, normalizedInput),
|
|
1420
|
-
|
|
1479
|
+
summary: options2.title ?? summarizePermission(toolName, normalizedInput),
|
|
1480
|
+
title: options2.title,
|
|
1481
|
+
displayName: options2.displayName,
|
|
1482
|
+
description: options2.description ?? describeTool(toolName, params.toolCache),
|
|
1421
1483
|
decisionReason: options2.decisionReason,
|
|
1422
1484
|
blockedPath: options2.blockedPath,
|
|
1423
1485
|
toolUseID: options2.toolUseID,
|
|
@@ -1514,6 +1576,11 @@ function consumeQuery(params) {
|
|
|
1514
1576
|
params.toolCache?.updateFromInit(message.tools);
|
|
1515
1577
|
params.onInit?.(message);
|
|
1516
1578
|
params.sessionManager.setInitTools(message.session_id, message.tools);
|
|
1579
|
+
params.sessionManager.update(message.session_id, {
|
|
1580
|
+
model: message.model,
|
|
1581
|
+
permissionMode: message.permissionMode,
|
|
1582
|
+
fastModeState: message.fast_mode_state
|
|
1583
|
+
});
|
|
1517
1584
|
activeSessionId = message.session_id;
|
|
1518
1585
|
if (!sessionIdResolved && shouldWaitForInit) {
|
|
1519
1586
|
sessionIdResolved = true;
|
|
@@ -1580,6 +1647,7 @@ function consumeQuery(params) {
|
|
|
1580
1647
|
status: agentResult.isError ? "error" : "idle",
|
|
1581
1648
|
totalTurns: sessionTotalTurns,
|
|
1582
1649
|
totalCostUsd: sessionTotalCostUsd,
|
|
1650
|
+
fastModeState: agentResult.fastModeState,
|
|
1583
1651
|
abortController: void 0,
|
|
1584
1652
|
queryInterrupt: void 0
|
|
1585
1653
|
});
|
|
@@ -1587,6 +1655,7 @@ function consumeQuery(params) {
|
|
|
1587
1655
|
params.sessionManager.update(sessionId2, {
|
|
1588
1656
|
totalTurns: sessionTotalTurns,
|
|
1589
1657
|
totalCostUsd: sessionTotalCostUsd,
|
|
1658
|
+
fastModeState: agentResult.fastModeState,
|
|
1590
1659
|
abortController: void 0,
|
|
1591
1660
|
queryInterrupt: void 0
|
|
1592
1661
|
});
|
|
@@ -1821,10 +1890,14 @@ function buildOptions(src) {
|
|
|
1821
1890
|
if (src.fallbackModel !== void 0) opts.fallbackModel = src.fallbackModel;
|
|
1822
1891
|
if (src.enableFileCheckpointing !== void 0)
|
|
1823
1892
|
opts.enableFileCheckpointing = src.enableFileCheckpointing;
|
|
1893
|
+
if (src.toolConfig !== void 0) opts.toolConfig = src.toolConfig;
|
|
1824
1894
|
if (src.includePartialMessages !== void 0)
|
|
1825
1895
|
opts.includePartialMessages = src.includePartialMessages;
|
|
1826
1896
|
if (src.promptSuggestions !== void 0) opts.promptSuggestions = src.promptSuggestions;
|
|
1897
|
+
if (src.agentProgressSummaries !== void 0)
|
|
1898
|
+
opts.agentProgressSummaries = src.agentProgressSummaries;
|
|
1827
1899
|
if (src.strictMcpConfig !== void 0) opts.strictMcpConfig = src.strictMcpConfig;
|
|
1900
|
+
if (src.settings !== void 0) opts.settings = src.settings;
|
|
1828
1901
|
if (src.settingSources !== void 0) opts.settingSources = src.settingSources;
|
|
1829
1902
|
else opts.settingSources = DEFAULT_SETTING_SOURCES;
|
|
1830
1903
|
if (src.debug !== void 0) opts.debug = src.debug;
|
|
@@ -1861,9 +1934,12 @@ function toSessionCreateParams(input) {
|
|
|
1861
1934
|
sandbox: src.sandbox,
|
|
1862
1935
|
fallbackModel: src.fallbackModel,
|
|
1863
1936
|
enableFileCheckpointing: src.enableFileCheckpointing,
|
|
1937
|
+
toolConfig: src.toolConfig,
|
|
1864
1938
|
includePartialMessages: src.includePartialMessages,
|
|
1865
1939
|
promptSuggestions: src.promptSuggestions,
|
|
1940
|
+
agentProgressSummaries: src.agentProgressSummaries,
|
|
1866
1941
|
strictMcpConfig: src.strictMcpConfig,
|
|
1942
|
+
settings: src.settings,
|
|
1867
1943
|
settingSources: src.settingSources ?? DEFAULT_SETTING_SOURCES,
|
|
1868
1944
|
debug: src.debug,
|
|
1869
1945
|
debugFile: src.debugFile,
|
|
@@ -2477,7 +2553,7 @@ function groupByCategory(tools) {
|
|
|
2477
2553
|
function buildInternalToolsDescription(tools) {
|
|
2478
2554
|
const grouped = groupByCategory(tools);
|
|
2479
2555
|
const categories = Object.keys(grouped).sort((a, b) => a.localeCompare(b));
|
|
2480
|
-
let desc = "Start a Claude Code session and return sessionId.\nUse claude_code_check to poll events/results and handle permissions.\n\n";
|
|
2556
|
+
let desc = "Start a Claude Code session and return sessionId.\nUse claude_code_check to poll events/results and handle permissions.\nAdjust polling cadence to progress: poll faster while new events/actions are arriving, and slower when the session is quietly thinking.\nLong-running work is normal: Claude Code can keep working for 10+ minutes, especially with high/max effort, so wait for polling to settle before assuming it is stuck.\nIf you want to continue after a run pauses or finishes, use claude_code_reply with the same sessionId instead of starting a brand-new claude_code session.\n\n";
|
|
2481
2557
|
desc += "Internal tools (authoritative list: includeTools=true in claude_code_check):\n";
|
|
2482
2558
|
for (const category of categories) {
|
|
2483
2559
|
desc += `
|
|
@@ -2512,11 +2588,15 @@ function toPermissionResult(params) {
|
|
|
2512
2588
|
interrupt: params.interrupt
|
|
2513
2589
|
};
|
|
2514
2590
|
}
|
|
2515
|
-
function appendAllowForSessionUpdate(updates, toolName) {
|
|
2591
|
+
function appendAllowForSessionUpdate(updates, suggestions, toolName) {
|
|
2592
|
+
const merged = [...updates ?? []];
|
|
2593
|
+
if (Array.isArray(suggestions) && suggestions.length > 0) {
|
|
2594
|
+
return [...merged, ...suggestions];
|
|
2595
|
+
}
|
|
2516
2596
|
const normalizedToolName = toolName?.trim();
|
|
2517
|
-
if (!normalizedToolName) return
|
|
2597
|
+
if (!normalizedToolName) return merged.length > 0 ? merged : void 0;
|
|
2518
2598
|
return [
|
|
2519
|
-
...
|
|
2599
|
+
...merged,
|
|
2520
2600
|
{
|
|
2521
2601
|
type: "addRules",
|
|
2522
2602
|
behavior: "allow",
|
|
@@ -2754,7 +2834,7 @@ function buildResult(sessionManager, toolCache, input) {
|
|
|
2754
2834
|
if (e.type !== "progress") return true;
|
|
2755
2835
|
const d = e.data;
|
|
2756
2836
|
const progressType = d?.type;
|
|
2757
|
-
return progressType !== "tool_progress" && progressType !== "auth_status" && progressType !== "task_progress" && progressType !== "hook_progress";
|
|
2837
|
+
return progressType !== "tool_progress" && progressType !== "auth_status" && progressType !== "api_retry" && progressType !== "task_progress" && progressType !== "hook_progress";
|
|
2758
2838
|
});
|
|
2759
2839
|
}
|
|
2760
2840
|
return filtered;
|
|
@@ -2804,6 +2884,8 @@ function buildResult(sessionManager, toolCache, input) {
|
|
|
2804
2884
|
toolName: req.toolName,
|
|
2805
2885
|
input: req.input,
|
|
2806
2886
|
summary: req.summary,
|
|
2887
|
+
title: req.title,
|
|
2888
|
+
displayName: req.displayName,
|
|
2807
2889
|
decisionReason: req.decisionReason,
|
|
2808
2890
|
blockedPath: req.blockedPath,
|
|
2809
2891
|
toolUseID: req.toolUseID,
|
|
@@ -2897,6 +2979,7 @@ function executeClaudeCodeCheck(input, sessionManager, toolCache, requestSignal)
|
|
|
2897
2979
|
const pendingRequest = input.decision === "allow_for_session" ? sessionManager.getPendingPermission(input.sessionId, input.requestId) : void 0;
|
|
2898
2980
|
const updatedPermissions = input.decision === "allow_for_session" ? appendAllowForSessionUpdate(
|
|
2899
2981
|
input.permissionOptions?.updatedPermissions,
|
|
2982
|
+
pendingRequest?.suggestions,
|
|
2900
2983
|
pendingRequest?.toolName
|
|
2901
2984
|
) : input.permissionOptions?.updatedPermissions;
|
|
2902
2985
|
const ok = sessionManager.finishRequest(
|
|
@@ -2929,6 +3012,7 @@ var ALWAYS_REDACTED_FIELDS = [
|
|
|
2929
3012
|
"env",
|
|
2930
3013
|
"mcpServers",
|
|
2931
3014
|
"sandbox",
|
|
3015
|
+
"settings",
|
|
2932
3016
|
"debugFile",
|
|
2933
3017
|
"pathToClaudeCodeExecutable"
|
|
2934
3018
|
];
|
|
@@ -2936,7 +3020,8 @@ var CONDITIONAL_REDACTED_FIELDS = [
|
|
|
2936
3020
|
"cwd",
|
|
2937
3021
|
"systemPrompt",
|
|
2938
3022
|
"agents",
|
|
2939
|
-
"additionalDirectories"
|
|
3023
|
+
"additionalDirectories",
|
|
3024
|
+
"toolConfig"
|
|
2940
3025
|
];
|
|
2941
3026
|
function buildRedactions(includeSensitive) {
|
|
2942
3027
|
const redactions = [];
|
|
@@ -3121,6 +3206,7 @@ function buildSessionRedactions(includeSensitive) {
|
|
|
3121
3206
|
{ field: "env", reason: "secret_or_internal" },
|
|
3122
3207
|
{ field: "mcpServers", reason: "secret_or_internal" },
|
|
3123
3208
|
{ field: "sandbox", reason: "secret_or_internal" },
|
|
3209
|
+
{ field: "settings", reason: "secret_or_internal" },
|
|
3124
3210
|
{ field: "debugFile", reason: "secret_or_internal" },
|
|
3125
3211
|
{ field: "pathToClaudeCodeExecutable", reason: "secret_or_internal" }
|
|
3126
3212
|
];
|
|
@@ -3129,7 +3215,8 @@ function buildSessionRedactions(includeSensitive) {
|
|
|
3129
3215
|
{ field: "cwd", reason: "sensitive_by_default" },
|
|
3130
3216
|
{ field: "systemPrompt", reason: "sensitive_by_default" },
|
|
3131
3217
|
{ field: "agents", reason: "sensitive_by_default" },
|
|
3132
|
-
{ field: "additionalDirectories", reason: "sensitive_by_default" }
|
|
3218
|
+
{ field: "additionalDirectories", reason: "sensitive_by_default" },
|
|
3219
|
+
{ field: "toolConfig", reason: "sensitive_by_default" }
|
|
3133
3220
|
);
|
|
3134
3221
|
}
|
|
3135
3222
|
return redactions;
|
|
@@ -3350,9 +3437,22 @@ function registerResources(server, deps) {
|
|
|
3350
3437
|
"3. If actions are returned, respond with `claude_code_check(action='respond_permission')`.",
|
|
3351
3438
|
"4. Continue polling until status becomes `idle` / `error` / `cancelled`.",
|
|
3352
3439
|
"",
|
|
3440
|
+
"Usage reminders:",
|
|
3441
|
+
"- Claude Code may keep working for 10+ minutes on larger tasks, especially with `effort='high'` or `effort='max'`; keep polling and be patient before treating it as stuck.",
|
|
3442
|
+
"- Adjust poll intervals to the current progress: poll faster while new events or permission actions are arriving, and slower while the session is quietly thinking with no new output.",
|
|
3443
|
+
"- If Claude Code stops and you want to keep going, call `claude_code_reply` with the existing `sessionId` instead of starting a fresh `claude_code` session.",
|
|
3444
|
+
"",
|
|
3445
|
+
"Common mistakes:",
|
|
3446
|
+
"- Do not call `claude_code_reply` on a non-persistent session; if you plan to continue later, start with `advanced.persistSession=true`.",
|
|
3447
|
+
"- `model` is optional. If omitted, Claude Code chooses the effective model from its own defaults/settings.",
|
|
3448
|
+
"- Store `nextCursor` and feed it back into the next `claude_code_check(action='poll')`; otherwise you will keep replaying old events.",
|
|
3449
|
+
"- On Windows, set `CLAUDE_CODE_GIT_BASH_PATH` or Claude Code may fail before the session starts.",
|
|
3450
|
+
"- If `decision='allow_for_session'` still shows a permission request, inspect `actions[].suggestions` / `blockedPath`; directory access may need a more specific permission update.",
|
|
3451
|
+
"",
|
|
3353
3452
|
"Notes:",
|
|
3354
3453
|
"- `respond_user_input` is not supported on this backend.",
|
|
3355
3454
|
"- `allowedTools` is pre-approval by default; set `strictAllowedTools=true` for strict allowlist behavior.",
|
|
3455
|
+
"- OpenCode/Codex-style clients usually work best when they store `sessionId` + `nextCursor` and answer approvals with `decision=allow_for_session`.",
|
|
3356
3456
|
"- Prefer `responseMode='delta_compact'` for high-frequency polling."
|
|
3357
3457
|
].join("\n"),
|
|
3358
3458
|
"text/markdown"
|
|
@@ -3695,7 +3795,7 @@ function registerResources(server, deps) {
|
|
|
3695
3795
|
}
|
|
3696
3796
|
|
|
3697
3797
|
// src/server.ts
|
|
3698
|
-
var SERVER_VERSION = true ? "2.
|
|
3798
|
+
var SERVER_VERSION = true ? "2.8.1" : "0.0.0-dev";
|
|
3699
3799
|
function createServerContext(serverCwd) {
|
|
3700
3800
|
const sessionManager = new SessionManager();
|
|
3701
3801
|
const server = new McpServer(
|
|
@@ -3735,7 +3835,7 @@ function createServerContext(serverCwd) {
|
|
|
3735
3835
|
prompt: z.string(),
|
|
3736
3836
|
tools: z.array(z.string()).optional().describe("Default: inherit"),
|
|
3737
3837
|
disallowedTools: z.array(z.string()).optional().describe("Default: none"),
|
|
3738
|
-
model: z.
|
|
3838
|
+
model: z.string().optional().describe("Default: inherit"),
|
|
3739
3839
|
maxTurns: z.number().int().positive().optional().describe("Default: none"),
|
|
3740
3840
|
mcpServers: z.array(z.union([z.string(), z.record(z.string(), z.unknown())])).optional().describe("Default: inherit"),
|
|
3741
3841
|
skills: z.array(z.string()).optional().describe("Default: none"),
|
|
@@ -3784,9 +3884,12 @@ function createServerContext(serverCwd) {
|
|
|
3784
3884
|
sandbox: z.record(z.string(), z.unknown()).optional().describe("Default: none"),
|
|
3785
3885
|
fallbackModel: z.string().optional().describe("Default: none"),
|
|
3786
3886
|
enableFileCheckpointing: z.boolean().optional().describe("Default: false"),
|
|
3887
|
+
toolConfig: z.record(z.string(), z.unknown()).optional().describe("Default: none"),
|
|
3787
3888
|
includePartialMessages: z.boolean().optional().describe("Default: false"),
|
|
3788
3889
|
promptSuggestions: z.boolean().optional().describe("Default: false"),
|
|
3890
|
+
agentProgressSummaries: z.boolean().optional().describe("Default: false"),
|
|
3789
3891
|
strictMcpConfig: z.boolean().optional().describe("Default: false"),
|
|
3892
|
+
settings: z.union([z.string(), z.record(z.string(), z.unknown())]).optional().describe("Default: none"),
|
|
3790
3893
|
settingSources: z.array(z.enum(["user", "project", "local"])).optional().describe("Default: ['user','project','local']. []=isolation"),
|
|
3791
3894
|
debug: z.boolean().optional().describe("Default: false"),
|
|
3792
3895
|
debugFile: z.string().optional().describe("Default: none"),
|
|
@@ -3873,7 +3976,9 @@ function createServerContext(serverCwd) {
|
|
|
3873
3976
|
{
|
|
3874
3977
|
description: buildInternalToolsDescription(toolCache.getTools()),
|
|
3875
3978
|
inputSchema: {
|
|
3876
|
-
prompt: z.string().describe(
|
|
3979
|
+
prompt: z.string().describe(
|
|
3980
|
+
"Prompt. Long runs are normal; keep polling, adapt poll cadence to current progress, and reuse sessionId with claude_code_reply if you want to continue."
|
|
3981
|
+
),
|
|
3877
3982
|
cwd: z.string().optional().describe("Working dir. Default: server cwd"),
|
|
3878
3983
|
allowedTools: z.array(z.string()).optional().describe("Default: []"),
|
|
3879
3984
|
disallowedTools: z.array(z.string()).optional().describe("Default: []"),
|
|
@@ -3937,10 +4042,12 @@ function createServerContext(serverCwd) {
|
|
|
3937
4042
|
server.registerTool(
|
|
3938
4043
|
"claude_code_reply",
|
|
3939
4044
|
{
|
|
3940
|
-
description: "Send a follow-up to an existing session. Returns immediately; use claude_code_check to poll.",
|
|
4045
|
+
description: "Send a follow-up to an existing session. Reuse the same sessionId instead of starting a new claude_code session when you want to continue. Returns immediately; use claude_code_check to poll, and adjust poll cadence to current progress.",
|
|
3941
4046
|
inputSchema: {
|
|
3942
|
-
sessionId: z.string().describe(
|
|
3943
|
-
|
|
4047
|
+
sessionId: z.string().describe(
|
|
4048
|
+
"Session ID from the existing conversation you want to continue; prefer this over starting a fresh claude_code session."
|
|
4049
|
+
),
|
|
4050
|
+
prompt: z.string().describe("Follow-up prompt for the existing session."),
|
|
3944
4051
|
forkSession: z.boolean().optional().describe("Default: false"),
|
|
3945
4052
|
effort: effortOptionSchema.describe("Default: SDK"),
|
|
3946
4053
|
thinking: thinkingOptionSchema.describe("Default: SDK"),
|
|
@@ -4043,12 +4150,14 @@ function createServerContext(serverCwd) {
|
|
|
4043
4150
|
server.registerTool(
|
|
4044
4151
|
"claude_code_check",
|
|
4045
4152
|
{
|
|
4046
|
-
description: "Poll session events or respond to permission requests.",
|
|
4153
|
+
description: "Poll session events or respond to permission requests. Long Claude Code runs are normal, especially with high/max effort; poll faster when progress is active and slower when the session is quietly thinking.",
|
|
4047
4154
|
inputSchema: {
|
|
4048
4155
|
action: z.enum(CHECK_ACTIONS),
|
|
4049
4156
|
sessionId: z.string().describe("Session ID"),
|
|
4050
4157
|
cursor: z.number().int().nonnegative().optional().describe("Default: 0"),
|
|
4051
|
-
responseMode: z.enum(CHECK_RESPONSE_MODES).optional().describe(
|
|
4158
|
+
responseMode: z.enum(CHECK_RESPONSE_MODES).optional().describe(
|
|
4159
|
+
"Default: 'minimal'. Use 'delta_compact' for lightweight polling, especially for faster adaptive polling loops."
|
|
4160
|
+
),
|
|
4052
4161
|
maxEvents: z.number().int().positive().optional().describe("Default: 200 (minimal), unlimited (full/delta_compact)"),
|
|
4053
4162
|
requestId: z.string().optional().describe("Default: none"),
|
|
4054
4163
|
decision: z.enum(["allow", "deny", "allow_for_session"]).optional().describe("Default: none"),
|