@costrict/csc 4.2.35 → 4.2.37

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.
Files changed (2) hide show
  1. package/dist/cli.js +641 -283
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -31759,8 +31759,8 @@ function getClientVersion() {
31759
31759
  if (cached)
31760
31760
  return cached;
31761
31761
  try {
31762
- if ("4.2.35") {
31763
- cached = "4.2.35";
31762
+ if ("4.2.37") {
31763
+ cached = "4.2.37";
31764
31764
  return cached;
31765
31765
  }
31766
31766
  } catch {}
@@ -31810,7 +31810,8 @@ __export(exports_token, {
31810
31810
  refreshCoStrictToken: () => refreshCoStrictToken,
31811
31811
  parseJWT: () => parseJWT,
31812
31812
  isCoStrictTokenValid: () => isCoStrictTokenValid,
31813
- extractExpiryFromJWT: () => extractExpiryFromJWT
31813
+ extractExpiryFromJWT: () => extractExpiryFromJWT,
31814
+ CoStrictAuthTerminalError: () => CoStrictAuthTerminalError
31814
31815
  });
31815
31816
  function parseJWT(token) {
31816
31817
  const parts = token.split(".");
@@ -31881,22 +31882,28 @@ async function refreshCoStrictToken(params) {
31881
31882
  try {
31882
31883
  parsed = JSON.parse(raw);
31883
31884
  } catch {
31884
- throw new Error(formatRefreshError(response.status, null, raw));
31885
+ throw new CoStrictAuthTerminalError(formatRefreshError(response.status, null, raw));
31885
31886
  }
31886
31887
  const tokens = unwrapCoStrictRefreshResponse(parsed);
31887
31888
  if (!tokens) {
31888
31889
  const serverFailed = isRecord(parsed) && parsed.success === false;
31889
- throw new Error(formatRefreshError(response.status, parsed, raw) + (serverFailed ? "" : ": Token refresh response is missing required fields"));
31890
+ throw new CoStrictAuthTerminalError(formatRefreshError(response.status, parsed, raw) + (serverFailed ? "" : ": Token refresh response is missing required fields"));
31890
31891
  }
31891
31892
  if (!response.ok) {
31892
- throw new Error(formatRefreshError(response.status, parsed, raw));
31893
+ throw new CoStrictAuthTerminalError(formatRefreshError(response.status, parsed, raw));
31893
31894
  }
31894
31895
  return tokens;
31895
31896
  }
31896
- var ACCESS_TOKEN_REFRESH_BUFFER_MS;
31897
+ var ACCESS_TOKEN_REFRESH_BUFFER_MS, CoStrictAuthTerminalError;
31897
31898
  var init_token = __esm(() => {
31898
31899
  init_oauth_params();
31899
31900
  ACCESS_TOKEN_REFRESH_BUFFER_MS = 30 * 60 * 1000;
31901
+ CoStrictAuthTerminalError = class CoStrictAuthTerminalError extends Error {
31902
+ constructor(message) {
31903
+ super(message);
31904
+ this.name = "CoStrictAuthTerminalError";
31905
+ }
31906
+ };
31900
31907
  });
31901
31908
 
31902
31909
  // src/costrict/provider/auth.ts
@@ -224369,7 +224376,7 @@ async function fetchCoStrictModels(baseUrl, accessToken) {
224369
224376
  headers: {
224370
224377
  Authorization: `Bearer ${accessToken}`,
224371
224378
  Accept: "application/json",
224372
- "User-Agent": `csc/${"4.2.35"}`
224379
+ "User-Agent": `csc/${"4.2.37"}`
224373
224380
  },
224374
224381
  signal: controller.signal
224375
224382
  });
@@ -226409,7 +226416,7 @@ var init_auth7 = __esm(() => {
226409
226416
 
226410
226417
  // src/utils/userAgent.ts
226411
226418
  function getClaudeCodeUserAgent() {
226412
- return `costrict/${"4.2.35"}`;
226419
+ return `costrict/${"4.2.37"}`;
226413
226420
  }
226414
226421
 
226415
226422
  // src/utils/workloadContext.ts
@@ -226431,7 +226438,7 @@ function getUserAgent() {
226431
226438
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
226432
226439
  const workload = getWorkload();
226433
226440
  const workloadSuffix = workload ? `, workload/${workload}` : "";
226434
- return `csc/${"4.2.35"}`;
226441
+ return `csc/${"4.2.37"}`;
226435
226442
  }
226436
226443
  function getMCPUserAgent() {
226437
226444
  const parts = [];
@@ -226445,7 +226452,7 @@ function getMCPUserAgent() {
226445
226452
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
226446
226453
  }
226447
226454
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
226448
- return `csc/${"4.2.35"}${suffix}`;
226455
+ return `csc/${"4.2.37"}${suffix}`;
226449
226456
  }
226450
226457
  function getWebFetchUserAgent() {
226451
226458
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -226565,7 +226572,7 @@ var init_user = __esm(() => {
226565
226572
  deviceId,
226566
226573
  sessionId: getSessionId(),
226567
226574
  email: getEmail(),
226568
- appVersion: "4.2.35",
226575
+ appVersion: "4.2.37",
226569
226576
  platform: getHostPlatformForAnalytics(),
226570
226577
  organizationUuid,
226571
226578
  accountUuid,
@@ -237613,7 +237620,7 @@ var init_metadata = __esm(() => {
237613
237620
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
237614
237621
  WHITESPACE_REGEX = /\s+/;
237615
237622
  getVersionBase = memoize_default(() => {
237616
- const match = "4.2.35".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
237623
+ const match = "4.2.37".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
237617
237624
  return match ? match[0] : undefined;
237618
237625
  });
237619
237626
  buildEnvContext = memoize_default(async () => {
@@ -237653,9 +237660,9 @@ var init_metadata = __esm(() => {
237653
237660
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
237654
237661
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
237655
237662
  isClaudeAiAuth: isClaudeAISubscriber(),
237656
- version: "4.2.35",
237663
+ version: "4.2.37",
237657
237664
  versionBase: getVersionBase(),
237658
- buildTime: "2026-09-04T09:22:28.856Z",
237665
+ buildTime: "2026-09-09T12:10:12.753Z",
237659
237666
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
237660
237667
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
237661
237668
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -238326,7 +238333,7 @@ function initialize1PEventLogging() {
238326
238333
  const platform3 = getPlatform();
238327
238334
  const attributes = {
238328
238335
  [import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
238329
- [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.35"
238336
+ [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.37"
238330
238337
  };
238331
238338
  if (platform3 === "wsl") {
238332
238339
  const wslVersion = getWslVersion();
@@ -238353,7 +238360,7 @@ function initialize1PEventLogging() {
238353
238360
  })
238354
238361
  ]
238355
238362
  });
238356
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.35");
238363
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.37");
238357
238364
  }
238358
238365
  async function reinitialize1PEventLoggingIfConfigChanged() {
238359
238366
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -278274,7 +278281,8 @@ var exports_tokenManager = {};
278274
278281
  __export(exports_tokenManager, {
278275
278282
  recoverFrom401: () => recoverFrom401,
278276
278283
  ensureValidCredentials: () => ensureValidCredentials,
278277
- _resetInflightRefresh: () => _resetInflightRefresh
278284
+ _resetInflightRefresh: () => _resetInflightRefresh,
278285
+ CoStrictAuthTerminalError: () => CoStrictAuthTerminalError
278278
278286
  });
278279
278287
  function resolveBaseUrl(credentialsBaseUrl) {
278280
278288
  const envUrl = process.env.COSTRICT_BASE_URL;
@@ -278300,25 +278308,25 @@ async function ensureValidCredentials(forceRefresh = false) {
278300
278308
  async function doRefresh(forceRefresh = false) {
278301
278309
  const decision = await updateCredentialsAtomically((creds) => {
278302
278310
  if (!creds) {
278303
- throw new Error(t("errors.costrict.credentialsNotFound"));
278311
+ throw new CoStrictAuthTerminalError(t("errors.costrict.credentialsNotFound"));
278304
278312
  }
278305
278313
  if (!forceRefresh && isCoStrictTokenValid(creds)) {
278306
278314
  return null;
278307
278315
  }
278308
278316
  if (!creds.refresh_token) {
278309
- throw new Error(t("errors.costrict.noRefreshToken"));
278317
+ throw new CoStrictAuthTerminalError(t("errors.costrict.noRefreshToken"));
278310
278318
  }
278311
278319
  return creds;
278312
278320
  });
278313
278321
  if (!decision) {
278314
278322
  const finalCreds = await loadCoStrictCredentials();
278315
278323
  if (!finalCreds) {
278316
- throw new Error(t("errors.costrict.refreshFailed"));
278324
+ throw new CoStrictAuthTerminalError(t("errors.costrict.refreshFailed"));
278317
278325
  }
278318
278326
  return { credentials: finalCreds, refreshed: false };
278319
278327
  }
278320
278328
  if (!decision.refresh_token) {
278321
- throw new Error(t("errors.costrict.noRefreshToken"));
278329
+ throw new CoStrictAuthTerminalError(t("errors.costrict.noRefreshToken"));
278322
278330
  }
278323
278331
  const baseUrl = resolveBaseUrl(decision.base_url);
278324
278332
  const refreshed2 = await refreshCoStrictToken({
@@ -306327,6 +306335,36 @@ async function* adaptOpenAIStreamToAnthropic(stream7, model) {
306327
306335
  const openBlockIndices = new Set;
306328
306336
  let pendingFinishReason = null;
306329
306337
  let pendingHasToolCalls = false;
306338
+ const ARGS_BATCH_SIZE = 32;
306339
+ const ARGS_FLUSH_INTERVAL_MS = 100;
306340
+ let lastArgsFlushAt = performance.now();
306341
+ let pendingArgFrags = [];
306342
+ const flushArgFrags = function* () {
306343
+ if (pendingArgFrags.length === 0)
306344
+ return;
306345
+ if (pendingArgFrags.length >= ARGS_BATCH_SIZE) {
306346
+ const merged = new Map;
306347
+ for (const { contentIndex, frag } of pendingArgFrags) {
306348
+ merged.set(contentIndex, (merged.get(contentIndex) ?? "") + frag);
306349
+ }
306350
+ for (const [contentIndex, joined] of merged) {
306351
+ yield {
306352
+ type: "content_block_delta",
306353
+ index: contentIndex,
306354
+ delta: { type: "input_json_delta", partial_json: joined }
306355
+ };
306356
+ }
306357
+ } else {
306358
+ for (const { contentIndex, frag } of pendingArgFrags) {
306359
+ yield {
306360
+ type: "content_block_delta",
306361
+ index: contentIndex,
306362
+ delta: { type: "input_json_delta", partial_json: frag }
306363
+ };
306364
+ }
306365
+ }
306366
+ pendingArgFrags = [];
306367
+ };
306330
306368
  for await (const chunk of stream7) {
306331
306369
  const choice = chunk.choices?.[0];
306332
306370
  const delta = choice?.delta;
@@ -306436,6 +306474,7 @@ async function* adaptOpenAIStreamToAnthropic(stream7, model) {
306436
306474
  const existingBlock = toolBlocks.get(tcIndex);
306437
306475
  const hasNewToolIdentity = existingBlock && (tc.id && existingBlock.idFromProvider && tc.id !== existingBlock.id || tc.function?.name && existingBlock.name && tc.function.name !== existingBlock.name);
306438
306476
  if (hasNewToolIdentity) {
306477
+ yield* flushArgFrags();
306439
306478
  if (openBlockIndices.has(existingBlock.contentIndex)) {
306440
306479
  yield {
306441
306480
  type: "content_block_stop",
@@ -306496,18 +306535,17 @@ async function* adaptOpenAIStreamToAnthropic(stream7, model) {
306496
306535
  }
306497
306536
  if (!deltaFragment)
306498
306537
  continue;
306499
- yield {
306500
- type: "content_block_delta",
306501
- index: block2.contentIndex,
306502
- delta: {
306503
- type: "input_json_delta",
306504
- partial_json: deltaFragment
306505
- }
306506
- };
306538
+ pendingArgFrags.push({ contentIndex: block2.contentIndex, frag: deltaFragment });
306539
+ if (pendingArgFrags.length >= ARGS_BATCH_SIZE || performance.now() - lastArgsFlushAt >= ARGS_FLUSH_INTERVAL_MS) {
306540
+ yield* flushArgFrags();
306541
+ lastArgsFlushAt = performance.now();
306542
+ await new Promise((resolve24) => setImmediate(resolve24));
306543
+ }
306507
306544
  }
306508
306545
  }
306509
306546
  }
306510
306547
  if (choice?.finish_reason) {
306548
+ yield* flushArgFrags();
306511
306549
  if (thinkingBlockOpen) {
306512
306550
  yield {
306513
306551
  type: "content_block_stop",
@@ -306537,6 +306575,7 @@ async function* adaptOpenAIStreamToAnthropic(stream7, model) {
306537
306575
  pendingHasToolCalls = toolBlocks.size > 0;
306538
306576
  }
306539
306577
  }
306578
+ yield* flushArgFrags();
306540
306579
  for (const idx of openBlockIndices) {
306541
306580
  yield {
306542
306581
  type: "content_block_stop",
@@ -354126,7 +354165,7 @@ function getTelemetryAttributes() {
354126
354165
  attributes["session.id"] = sessionId;
354127
354166
  }
354128
354167
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
354129
- attributes["app.version"] = "4.2.35";
354168
+ attributes["app.version"] = "4.2.37";
354130
354169
  }
354131
354170
  const oauthAccount = getOauthAccountInfo();
354132
354171
  if (oauthAccount) {
@@ -469252,7 +469291,7 @@ function getInstallationEnv() {
469252
469291
  return;
469253
469292
  }
469254
469293
  function getClaudeCodeVersion() {
469255
- return "4.2.35";
469294
+ return "4.2.37";
469256
469295
  }
469257
469296
  async function getInstalledVSCodeExtensionVersion(command4) {
469258
469297
  const { stdout } = await execFileNoThrow(command4, ["--list-extensions", "--show-versions"], {
@@ -470156,6 +470195,83 @@ var init_elicitationHandler = __esm(() => {
470156
470195
  init_analytics();
470157
470196
  });
470158
470197
 
470198
+ // src/server/ideCapability.ts
470199
+ var IDE_MCP_SERVER = "costrict-jetbrains", IDE_MCP_TOOLS, transport, IdeCapabilitySchema = () => exports_external.object({
470200
+ generation: exports_external.string().uuid(),
470201
+ transport,
470202
+ tools: exports_external.array(exports_external.string()).refine((values4) => new Set(values4).size === values4.length, "duplicate IDE MCP tool").refine((values4) => values4.length <= IDE_MCP_TOOLS.size && values4.every((v2) => IDE_MCP_TOOLS.has(v2)), "invalid IDE MCP tool"),
470203
+ approval: exports_external.object({
470204
+ build_project: exports_external.literal("control_plane"),
470205
+ execute_run_configuration: exports_external.literal("jetbrains_ask")
470206
+ })
470207
+ });
470208
+ var init_ideCapability = __esm(() => {
470209
+ init_v4();
470210
+ IDE_MCP_TOOLS = new Set([
470211
+ "analyze_calls",
470212
+ "get_file_problems",
470213
+ "lint_files",
470214
+ "get_project_dependencies",
470215
+ "get_project_modules",
470216
+ "get_symbol_info",
470217
+ "search_file",
470218
+ "search_regex",
470219
+ "search_symbol",
470220
+ "search_text",
470221
+ "read_file",
470222
+ "list_directory_tree",
470223
+ "get_all_open_file_paths",
470224
+ "open_file_in_editor",
470225
+ "build_project",
470226
+ "get_run_configurations",
470227
+ "execute_run_configuration"
470228
+ ]);
470229
+ transport = exports_external.object({
470230
+ type: exports_external.literal("streamable_http"),
470231
+ url: exports_external.string().refine((value) => {
470232
+ try {
470233
+ const parsed = new URL(value);
470234
+ return parsed.protocol === "http:" && ["127.0.0.1", "localhost", "[::1]"].includes(parsed.hostname) && parsed.pathname === "/stream" && !parsed.username && !parsed.password && !parsed.search && !parsed.hash;
470235
+ } catch {
470236
+ return false;
470237
+ }
470238
+ }, "transport must be loopback http /stream"),
470239
+ headers: exports_external.record(exports_external.string().min(1), exports_external.string().min(1))
470240
+ });
470241
+ });
470242
+
470243
+ // src/services/mcp/idePolicy.ts
470244
+ function getIdeMcpPolicy() {
470245
+ return { generation, tools: new Set(allowed) };
470246
+ }
470247
+ function setIdeMcpPolicy(value, tools) {
470248
+ generation = value;
470249
+ allowed = new Set(tools);
470250
+ }
470251
+ function clearIdeMcpPolicy(value) {
470252
+ if (value !== generation)
470253
+ return false;
470254
+ generation = "";
470255
+ allowed = new Set;
470256
+ return true;
470257
+ }
470258
+ function filterIdeMcpTools(server, tools) {
470259
+ return server === IDE_MCP_SERVER ? tools.filter((tool) => !!tool.mcpInfo?.toolName && allowed.has(tool.mcpInfo.toolName)) : tools;
470260
+ }
470261
+ function ideMcpPermission(server, tool) {
470262
+ if (server !== IDE_MCP_SERVER || !IDE_MCP_TOOLS.has(tool) || !allowed.has(tool))
470263
+ return;
470264
+ return tool === "build_project" ? "control_plane" : "allow";
470265
+ }
470266
+ function mcpCallRetries(server) {
470267
+ return server === IDE_MCP_SERVER ? 0 : 1;
470268
+ }
470269
+ var generation = "", allowed;
470270
+ var init_idePolicy = __esm(() => {
470271
+ init_ideCapability();
470272
+ allowed = new Set;
470273
+ });
470274
+
470159
470275
  // node_modules/.bun/zod@3.25.76/node_modules/zod/v4/core/core.js
470160
470276
  function $constructor3(name3, initializer5, params) {
470161
470277
  function init2(inst, def) {
@@ -484506,15 +484622,15 @@ async function handleOpenApplication(adapter2, args, overrides) {
484506
484622
  const app = requireString(args, "app");
484507
484623
  if (app instanceof Error)
484508
484624
  return errorResult(app.message, "bad_args");
484509
- const allowed = new Set(overrides.allowedApps.map((g8) => g8.bundleId));
484625
+ const allowed2 = new Set(overrides.allowedApps.map((g8) => g8.bundleId));
484510
484626
  let targetBundleId;
484511
- if (looksLikeBundleId(app) && allowed.has(app)) {
484627
+ if (looksLikeBundleId(app) && allowed2.has(app)) {
484512
484628
  targetBundleId = app;
484513
484629
  } else {
484514
484630
  const match = overrides.allowedApps.find((g8) => g8.displayName.toLowerCase() === app.toLowerCase());
484515
484631
  targetBundleId = match?.bundleId;
484516
484632
  }
484517
- if (!targetBundleId || !allowed.has(targetBundleId)) {
484633
+ if (!targetBundleId || !allowed2.has(targetBundleId)) {
484518
484634
  return errorResult(`"${app}" is not granted for this session. Call request_access first.`, "app_not_granted");
484519
484635
  }
484520
484636
  await adapter2.executor.openApp(targetBundleId);
@@ -495321,7 +495437,7 @@ function createCliExecutor(opts) {
495321
495437
  const { getMouseAnimationEnabled, getHideBeforeActionEnabled } = opts;
495322
495438
  const terminalBundleId = getTerminalBundleId();
495323
495439
  const surrogateHost = terminalBundleId ?? CLI_HOST_BUNDLE_ID;
495324
- const withoutTerminal = (allowed) => terminalBundleId === null ? [...allowed] : allowed.filter((id) => id !== terminalBundleId);
495440
+ const withoutTerminal = (allowed2) => terminalBundleId === null ? [...allowed2] : allowed2.filter((id) => id !== terminalBundleId);
495325
495441
  logForDebugging(terminalBundleId ? `[computer-use] terminal ${terminalBundleId} \u2192 surrogate host (hide-exempt, activate-skip, screenshot-excluded)` : "[computer-use] terminal not detected; falling back to sentinel host");
495326
495442
  return {
495327
495443
  capabilities: {
@@ -496787,19 +496903,19 @@ class BridgeClient {
496787
496903
  actionData: message2.action_data
496788
496904
  };
496789
496905
  try {
496790
- const allowed = await pending2.onPermissionRequest(request2);
496791
- this.sendPermissionResponse(requestId2, allowed);
496906
+ const allowed2 = await pending2.onPermissionRequest(request2);
496907
+ this.sendPermissionResponse(requestId2, allowed2);
496792
496908
  } catch (error98) {
496793
496909
  logger30.error(`[${serverName}] Error handling permission request:`, error98);
496794
496910
  this.sendPermissionResponse(requestId2, false);
496795
496911
  }
496796
496912
  }
496797
- sendPermissionResponse(requestId2, allowed) {
496913
+ sendPermissionResponse(requestId2, allowed2) {
496798
496914
  if (this.ws?.readyState === WebSocket2.OPEN) {
496799
496915
  const message2 = {
496800
496916
  type: "permission_response",
496801
496917
  request_id: requestId2,
496802
- allowed
496918
+ allowed: allowed2
496803
496919
  };
496804
496920
  if (this.selectedDeviceId) {
496805
496921
  message2.target_device_id = this.selectedDeviceId;
@@ -508556,8 +508672,8 @@ var require_otlp_export_delegate = __commonJS((exports) => {
508556
508672
  _responseHandler;
508557
508673
  _promiseQueue;
508558
508674
  _timeout;
508559
- constructor(transport, serializer, responseHandler, promiseQueue, timeout2) {
508560
- this._transport = transport;
508675
+ constructor(transport2, serializer, responseHandler, promiseQueue, timeout2) {
508676
+ this._transport = transport2;
508561
508677
  this._serializer = serializer;
508562
508678
  this._responseHandler = responseHandler;
508563
508679
  this._promiseQueue = promiseQueue;
@@ -508639,9 +508755,9 @@ var require_otlp_network_export_delegate = __commonJS((exports) => {
508639
508755
  exports.createOtlpNetworkExportDelegate = undefined;
508640
508756
  var bounded_queue_export_promise_handler_1 = require_bounded_queue_export_promise_handler();
508641
508757
  var otlp_export_delegate_1 = require_otlp_export_delegate();
508642
- function createOtlpNetworkExportDelegate(options, serializer, transport) {
508758
+ function createOtlpNetworkExportDelegate(options, serializer, transport2) {
508643
508759
  return (0, otlp_export_delegate_1.createOtlpExportDelegate)({
508644
- transport,
508760
+ transport: transport2,
508645
508761
  serializer,
508646
508762
  promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options)
508647
508763
  }, { timeout: options.timeoutMillis });
@@ -521682,8 +521798,8 @@ var require_retrying_transport = __commonJS((exports) => {
521682
521798
 
521683
521799
  class RetryingTransport {
521684
521800
  _transport;
521685
- constructor(transport) {
521686
- this._transport = transport;
521801
+ constructor(transport2) {
521802
+ this._transport = transport2;
521687
521803
  }
521688
521804
  retry(data, timeoutMillis, inMillis) {
521689
521805
  return new Promise((resolve31, reject2) => {
@@ -522892,7 +523008,7 @@ function initLangfuse() {
522892
523008
  flushInterval: parseInt(process.env.LANGFUSE_FLUSH_INTERVAL ?? "10", 10),
522893
523009
  mask: maskFn,
522894
523010
  environment: process.env.LANGFUSE_TRACING_ENVIRONMENT ?? "development",
522895
- release: "4.2.35",
523011
+ release: "4.2.37",
522896
523012
  exportMode: process.env.LANGFUSE_EXPORT_MODE ?? "batched",
522897
523013
  timeout: parseInt(process.env.LANGFUSE_TIMEOUT ?? "5", 10)
522898
523014
  });
@@ -523451,7 +523567,7 @@ function computeFingerprint(messageText2, version11) {
523451
523567
  }
523452
523568
  function computeFingerprintFromMessages(messages) {
523453
523569
  const firstMessageText = extractFirstMessageText(messages);
523454
- return computeFingerprint(firstMessageText, "4.2.35");
523570
+ return computeFingerprint(firstMessageText, "4.2.37");
523455
523571
  }
523456
523572
  var FINGERPRINT_SALT = "59cf53e54c78";
523457
523573
  var init_fingerprint = () => {};
@@ -523894,7 +524010,27 @@ function toKebabCase(s) {
523894
524010
  function createCoStrictFetch(options) {
523895
524011
  const agentType = toKebabCase(options?.agentType) || "build";
523896
524012
  const costrictFetch = async (input4, init2) => {
523897
- const { credentials: creds } = await ensureValidCredentials();
524013
+ let creds;
524014
+ try {
524015
+ ({ credentials: creds } = await ensureValidCredentials());
524016
+ } catch (authError) {
524017
+ if (authError instanceof CoStrictAuthTerminalError) {
524018
+ logError2(authError);
524019
+ return new Response(JSON.stringify({
524020
+ error: {
524021
+ message: authError.message,
524022
+ type: "authentication_error"
524023
+ }
524024
+ }), {
524025
+ status: 401,
524026
+ headers: {
524027
+ "content-type": "application/json",
524028
+ "x-should-retry": "false"
524029
+ }
524030
+ });
524031
+ }
524032
+ throw authError;
524033
+ }
523898
524034
  const headers = new Headers(init2?.headers);
523899
524035
  headers.set("Authorization", `Bearer ${creds.access_token}`);
523900
524036
  headers.set("User-Agent", `csc/${VERSION9}`);
@@ -523937,6 +524073,7 @@ function createCoStrictFetch(options) {
523937
524073
  var VERSION9;
523938
524074
  var init_fetch2 = __esm(() => {
523939
524075
  init_tokenManager();
524076
+ init_log3();
523940
524077
  init_uuid();
523941
524078
  init_clientVersion();
523942
524079
  VERSION9 = getClientVersion();
@@ -524003,7 +524140,7 @@ async function sideQuery(opts) {
524003
524140
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
524004
524141
  }
524005
524142
  const messageText2 = extractFirstUserMessageText(messages);
524006
- const fingerprint = computeFingerprint(messageText2, "4.2.35");
524143
+ const fingerprint = computeFingerprint(messageText2, "4.2.37");
524007
524144
  const attributionHeader = getAttributionHeader(fingerprint);
524008
524145
  const systemBlocks = [
524009
524146
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -524279,7 +524416,7 @@ async function runClaudeInChromeMcpServer() {
524279
524416
  initializeAnalyticsSink();
524280
524417
  const context7 = createChromeContext();
524281
524418
  const server = createClaudeForChromeMcpServer(context7);
524282
- const transport = new StdioServerTransport;
524419
+ const transport2 = new StdioServerTransport;
524283
524420
  let exiting = false;
524284
524421
  const shutdownAndExit = async () => {
524285
524422
  if (exiting) {
@@ -524293,7 +524430,7 @@ async function runClaudeInChromeMcpServer() {
524293
524430
  process.stdin.on("end", () => void shutdownAndExit());
524294
524431
  process.stdin.on("error", () => void shutdownAndExit());
524295
524432
  logForDebugging("[Chrome MCP] Starting MCP server");
524296
- await server.connect(transport);
524433
+ await server.connect(transport2);
524297
524434
  logForDebugging("[Chrome MCP] MCP server started");
524298
524435
  }
524299
524436
 
@@ -524531,7 +524668,7 @@ async function runComputerUseMcpServer() {
524531
524668
  enableConfigs();
524532
524669
  initializeAnalyticsSink();
524533
524670
  const server = await createComputerUseMcpServerForCli();
524534
- const transport = new StdioServerTransport;
524671
+ const transport2 = new StdioServerTransport;
524535
524672
  let exiting = false;
524536
524673
  const shutdownAndExit = async () => {
524537
524674
  if (exiting)
@@ -524543,7 +524680,7 @@ async function runComputerUseMcpServer() {
524543
524680
  process.stdin.on("end", () => void shutdownAndExit());
524544
524681
  process.stdin.on("error", () => void shutdownAndExit());
524545
524682
  logForDebugging("[Computer Use MCP] Starting MCP server");
524546
- await server.connect(transport);
524683
+ await server.connect(transport2);
524547
524684
  logForDebugging("[Computer Use MCP] MCP server started");
524548
524685
  }
524549
524686
  var APP_ENUM_TIMEOUT_MS = 1000;
@@ -525426,18 +525563,18 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
525426
525563
  const clients = [];
525427
525564
  const tools = [];
525428
525565
  const results = await Promise.allSettled(Object.entries(sdkMcpConfigs).map(async ([name3, config10]) => {
525429
- const transport = new SdkControlClientTransport(name3, sendMcpMessage);
525566
+ const transport2 = new SdkControlClientTransport(name3, sendMcpMessage);
525430
525567
  const client10 = new Client({
525431
525568
  name: "claude-code",
525432
525569
  title: "CoStrict",
525433
- version: "4.2.35",
525570
+ version: "4.2.37",
525434
525571
  description: "CoStrict agentic coding tool",
525435
525572
  websiteUrl: PRODUCT_URL
525436
525573
  }, {
525437
525574
  capabilities: {}
525438
525575
  });
525439
525576
  try {
525440
- await client10.connect(transport);
525577
+ await client10.connect(transport2);
525441
525578
  const capabilities = client10.getServerCapabilities();
525442
525579
  const connectedClient = {
525443
525580
  type: "connected",
@@ -525524,6 +525661,7 @@ var init_client17 = __esm(() => {
525524
525661
  init_mcpStringUtils();
525525
525662
  init_normalization();
525526
525663
  init_utils13();
525664
+ init_idePolicy();
525527
525665
  init_src4();
525528
525666
  init_src4();
525529
525667
  init_auth10();
@@ -525573,7 +525711,7 @@ var init_client17 = __esm(() => {
525573
525711
  const connectStartTime = Date.now();
525574
525712
  let inProcessServer;
525575
525713
  try {
525576
- let transport;
525714
+ let transport2;
525577
525715
  const sessionIngressToken = getSessionIngressAuthToken();
525578
525716
  if (serverRef.type === "sse") {
525579
525717
  const authProvider = new ClaudeAuthProvider(name3, serverRef);
@@ -525609,7 +525747,7 @@ var init_client17 = __esm(() => {
525609
525747
  });
525610
525748
  }
525611
525749
  };
525612
- transport = new SSEClientTransport(new URL(serverRef.url), transportOptions);
525750
+ transport2 = new SSEClientTransport(new URL(serverRef.url), transportOptions);
525613
525751
  logMCPDebug(name3, `SSE transport initialized, awaiting connection`);
525614
525752
  } else if (serverRef.type === "sse-ide") {
525615
525753
  logMCPDebug(name3, `Setting up SSE-IDE transport to ${serverRef.url}`);
@@ -525628,7 +525766,7 @@ var init_client17 = __esm(() => {
525628
525766
  }
525629
525767
  }
525630
525768
  } : {};
525631
- transport = new SSEClientTransport(new URL(serverRef.url), Object.keys(transportOptions).length > 0 ? transportOptions : undefined);
525769
+ transport2 = new SSEClientTransport(new URL(serverRef.url), Object.keys(transportOptions).length > 0 ? transportOptions : undefined);
525632
525770
  } else if (serverRef.type === "ws-ide") {
525633
525771
  const tlsOptions = getWebSocketTLSOptions();
525634
525772
  const wsHeaders = {
@@ -525652,7 +525790,7 @@ var init_client17 = __esm(() => {
525652
525790
  ...tlsOptions || {}
525653
525791
  });
525654
525792
  }
525655
- transport = new WebSocketTransport(wsClient);
525793
+ transport2 = new WebSocketTransport(wsClient);
525656
525794
  } else if (serverRef.type === "ws") {
525657
525795
  logMCPDebug(name3, `Initializing WebSocket transport to ${serverRef.url}`);
525658
525796
  const combinedHeaders = await getMcpServerHeaders(name3, serverRef);
@@ -525685,7 +525823,7 @@ var init_client17 = __esm(() => {
525685
525823
  ...tlsOptions || {}
525686
525824
  });
525687
525825
  }
525688
- transport = new WebSocketTransport(wsClient);
525826
+ transport2 = new WebSocketTransport(wsClient);
525689
525827
  } else if (serverRef.type === "http") {
525690
525828
  logMCPDebug(name3, `Initializing HTTP transport to ${serverRef.url}`);
525691
525829
  logMCPDebug(name3, `Node version: ${process.version}, Platform: ${process.platform}`);
@@ -525722,7 +525860,7 @@ var init_client17 = __esm(() => {
525722
525860
  hasAuthProvider: !!authProvider,
525723
525861
  timeoutMs: MCP_REQUEST_TIMEOUT_MS
525724
525862
  })}`);
525725
- transport = new StreamableHTTPClientTransport(new URL(serverRef.url), transportOptions);
525863
+ transport2 = new StreamableHTTPClientTransport(new URL(serverRef.url), transportOptions);
525726
525864
  logMCPDebug(name3, `HTTP transport created successfully`);
525727
525865
  } else if (serverRef.type === "sdk") {
525728
525866
  throw new Error("SDK servers should be handled in print.ts");
@@ -525747,7 +525885,7 @@ var init_client17 = __esm(() => {
525747
525885
  }
525748
525886
  }
525749
525887
  };
525750
- transport = new StreamableHTTPClientTransport(new URL(proxyUrl), transportOptions);
525888
+ transport2 = new StreamableHTTPClientTransport(new URL(proxyUrl), transportOptions);
525751
525889
  logMCPDebug(name3, `costrict.ai proxy transport created successfully`);
525752
525890
  } else if ((serverRef.type === "stdio" || !serverRef.type) && isClaudeInChromeMCPServer(name3)) {
525753
525891
  const { createChromeContext: createChromeContext2 } = await Promise.resolve().then(() => (init_mcpServer3(), exports_mcpServer));
@@ -525757,7 +525895,7 @@ var init_client17 = __esm(() => {
525757
525895
  inProcessServer = createClaudeForChromeMcpServer2(context7);
525758
525896
  const [clientTransport, serverTransport] = createLinkedTransportPair3();
525759
525897
  await inProcessServer.connect(serverTransport);
525760
- transport = clientTransport;
525898
+ transport2 = clientTransport;
525761
525899
  logMCPDebug(name3, `In-process Chrome MCP server started`);
525762
525900
  } else if ((serverRef.type === "stdio" || !serverRef.type) && isComputerUseMCPServer2(name3)) {
525763
525901
  const { createComputerUseMcpServerForCli: createComputerUseMcpServerForCli2 } = await Promise.resolve().then(() => (init_mcpServer4(), exports_mcpServer2));
@@ -525765,13 +525903,13 @@ var init_client17 = __esm(() => {
525765
525903
  inProcessServer = await createComputerUseMcpServerForCli2();
525766
525904
  const [clientTransport, serverTransport] = createLinkedTransportPair3();
525767
525905
  await inProcessServer.connect(serverTransport);
525768
- transport = clientTransport;
525906
+ transport2 = clientTransport;
525769
525907
  logMCPDebug(name3, `In-process Computer Use MCP server started`);
525770
525908
  } else if (serverRef.type === "stdio" || !serverRef.type) {
525771
525909
  const stdioRef = serverRef;
525772
525910
  const finalCommand = process.env.CLAUDE_CODE_SHELL_PREFIX || stdioRef.command;
525773
525911
  const finalArgs = process.env.CLAUDE_CODE_SHELL_PREFIX ? [[stdioRef.command, ...stdioRef.args].join(" ")] : stdioRef.args;
525774
- transport = new StdioClientTransport({
525912
+ transport2 = new StdioClientTransport({
525775
525913
  command: finalCommand,
525776
525914
  args: finalArgs,
525777
525915
  env: {
@@ -525786,7 +525924,7 @@ var init_client17 = __esm(() => {
525786
525924
  let stderrHandler;
525787
525925
  let stderrOutput = "";
525788
525926
  if (serverRef.type === "stdio" || !serverRef.type) {
525789
- const stdioTransport = transport;
525927
+ const stdioTransport = transport2;
525790
525928
  if (stdioTransport.stderr) {
525791
525929
  stderrHandler = (data) => {
525792
525930
  if (stderrOutput.length < 67108864) {
@@ -525801,7 +525939,7 @@ var init_client17 = __esm(() => {
525801
525939
  const client10 = new Client({
525802
525940
  name: "claude-code",
525803
525941
  title: "CoStrict",
525804
- version: "4.2.35",
525942
+ version: "4.2.37",
525805
525943
  description: "CoStrict agentic coding tool",
525806
525944
  websiteUrl: PRODUCT_URL
525807
525945
  }, {
@@ -525836,7 +525974,7 @@ var init_client17 = __esm(() => {
525836
525974
  logMCPDebug(name3, `Failed to parse URL: ${urlError}`);
525837
525975
  }
525838
525976
  }
525839
- const connectPromise = client10.connect(transport);
525977
+ const connectPromise = client10.connect(transport2);
525840
525978
  const timeoutPromise = new Promise((_2, reject2) => {
525841
525979
  const timeoutId = setTimeout(() => {
525842
525980
  const elapsed = Date.now() - connectStartTime;
@@ -525844,7 +525982,7 @@ var init_client17 = __esm(() => {
525844
525982
  if (inProcessServer) {
525845
525983
  inProcessServer.close().catch(() => {});
525846
525984
  }
525847
- transport.close().catch(() => {});
525985
+ transport2.close().catch(() => {});
525848
525986
  reject2(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name3}" connection timed out after ${getConnectionTimeoutMs()}ms`, "MCP connection timeout"));
525849
525987
  }, getConnectionTimeoutMs());
525850
525988
  connectPromise.then(() => {
@@ -525896,7 +526034,7 @@ var init_client17 = __esm(() => {
525896
526034
  if (inProcessServer) {
525897
526035
  inProcessServer.close().catch(() => {});
525898
526036
  }
525899
- transport.close().catch(() => {});
526037
+ transport2.close().catch(() => {});
525900
526038
  if (stderrOutput) {
525901
526039
  logMCPError(name3, `Server stderr: ${stderrOutput}`);
525902
526040
  }
@@ -526038,12 +526176,12 @@ var init_client17 = __esm(() => {
526038
526176
  return;
526039
526177
  }
526040
526178
  if (stderrHandler && (serverRef.type === "stdio" || !serverRef.type)) {
526041
- const stdioTransport = transport;
526179
+ const stdioTransport = transport2;
526042
526180
  stdioTransport.stderr?.off("data", stderrHandler);
526043
526181
  }
526044
526182
  if (serverRef.type === "stdio") {
526045
526183
  try {
526046
- const stdioTransport = transport;
526184
+ const stdioTransport = transport2;
526047
526185
  const childPid = stdioTransport.pid;
526048
526186
  if (childPid) {
526049
526187
  logMCPDebug(name3, "Sending SIGINT to MCP server process");
@@ -526206,7 +526344,7 @@ var init_client17 = __esm(() => {
526206
526344
  const result = await client10.client.request({ method: "tools/list" }, ListToolsResultSchema);
526207
526345
  const toolsToProcess = recursivelySanitizeUnicode(result.tools);
526208
526346
  const skipPrefix = client10.config.type === "sdk" && isEnvTruthy(process.env.CLAUDE_AGENT_SDK_MCP_NO_PREFIX);
526209
- return toolsToProcess.map((tool) => {
526347
+ const converted = toolsToProcess.map((tool) => {
526210
526348
  const fullyQualifiedName = buildMcpToolName(client10.name, tool.name);
526211
526349
  return {
526212
526350
  ...MCPTool,
@@ -526228,6 +526366,9 @@ var init_client17 = __esm(() => {
526228
526366
  isReadOnly() {
526229
526367
  return tool.annotations?.readOnlyHint ?? false;
526230
526368
  },
526369
+ requiresUserInteraction() {
526370
+ return ideMcpPermission(client10.name, tool.name) === "control_plane";
526371
+ },
526231
526372
  toAutoClassifierInput(input4) {
526232
526373
  return mcpToolInputToAutoClassifierInput(input4, tool.name);
526233
526374
  },
@@ -526242,6 +526383,9 @@ var init_client17 = __esm(() => {
526242
526383
  },
526243
526384
  inputJSONSchema: tool.inputSchema,
526244
526385
  async checkPermissions() {
526386
+ const policy = ideMcpPermission(client10.name, tool.name);
526387
+ if (policy === "allow")
526388
+ return { behavior: "allow" };
526245
526389
  return {
526246
526390
  behavior: "passthrough",
526247
526391
  message: t("errors.mcp.requiresPermission"),
@@ -526275,7 +526419,7 @@ var init_client17 = __esm(() => {
526275
526419
  });
526276
526420
  }
526277
526421
  const startTime2 = Date.now();
526278
- const MAX_SESSION_RETRIES = 1;
526422
+ const retries = mcpCallRetries(client10.name);
526279
526423
  for (let attempt = 0;; attempt++) {
526280
526424
  try {
526281
526425
  const connectedClient = await ensureConnectedClient(client10);
@@ -526321,7 +526465,7 @@ var init_client17 = __esm(() => {
526321
526465
  }
526322
526466
  };
526323
526467
  } catch (error98) {
526324
- if (error98 instanceof McpSessionExpiredError2 && attempt < MAX_SESSION_RETRIES) {
526468
+ if (error98 instanceof McpSessionExpiredError2 && attempt < retries) {
526325
526469
  logMCPDebug(client10.name, `Retrying tool '${tool.name}' after session recovery`);
526326
526470
  continue;
526327
526471
  }
@@ -526357,7 +526501,8 @@ var init_client17 = __esm(() => {
526357
526501
  ...isClaudeInChromeMCPServer(client10.name) && (client10.config.type === "stdio" || !client10.config.type) ? claudeInChromeToolRendering().getClaudeInChromeMCPToolOverrides(tool.name) : {},
526358
526502
  ...(client10.config.type === "stdio" || !client10.config.type) && isComputerUseMCPServer2(client10.name) ? computerUseWrapper().getComputerUseMCPToolOverrides(tool.name) : {}
526359
526503
  };
526360
- }).filter(isIncludedMcpTool);
526504
+ });
526505
+ return filterIdeMcpTools(client10.name, converted).filter(isIncludedMcpTool);
526361
526506
  } catch (error98) {
526362
526507
  logMCPError(client10.name, `Failed to fetch tools: ${errorMessage(error98)}`);
526363
526508
  return [];
@@ -606625,13 +606770,13 @@ class Client2 {
606625
606770
  return this._transport;
606626
606771
  }
606627
606772
  async flush(timeout2) {
606628
- const transport = this._transport;
606773
+ const transport2 = this._transport;
606629
606774
  this.emit("flush");
606630
- if (!transport) {
606775
+ if (!transport2) {
606631
606776
  return true;
606632
606777
  }
606633
606778
  const clientFinished = await this._isClientDoneProcessing(timeout2);
606634
- const transportFlushed = await transport.flush(timeout2);
606779
+ const transportFlushed = await transport2.flush(timeout2);
606635
606780
  return clientFinished && transportFlushed;
606636
606781
  }
606637
606782
  async close(timeout2) {
@@ -608035,13 +608180,13 @@ function getOutgoingRequestSpanData(request2) {
608035
608180
  }
608036
608181
  function setIncomingResponseSpanData(response3, span) {
608037
608182
  const { statusCode, statusMessage, httpVersion, socket } = response3;
608038
- const transport = httpVersion?.toUpperCase() !== "QUIC" ? "ip_tcp" : "ip_udp";
608183
+ const transport2 = httpVersion?.toUpperCase() !== "QUIC" ? "ip_tcp" : "ip_udp";
608039
608184
  span.setAttributes({
608040
608185
  "http.response.status_code": statusCode,
608041
608186
  "network.protocol.version": httpVersion,
608042
608187
  "http.flavor": httpVersion,
608043
- "network.transport": transport,
608044
- "net.transport": transport,
608188
+ "network.transport": transport2,
608189
+ "net.transport": transport2,
608045
608190
  "http.status_text": statusMessage?.toUpperCase(),
608046
608191
  "http.status_code": statusCode,
608047
608192
  ...getResponseContentLengthAttributes(response3),
@@ -624696,7 +624841,7 @@ function initSentry() {
624696
624841
  }
624697
624842
  init3({
624698
624843
  dsn,
624699
- release: typeof MACRO !== "undefined" ? "4.2.35" : undefined,
624844
+ release: typeof MACRO !== "undefined" ? "4.2.37" : undefined,
624700
624845
  environment: typeof BUILD_ENV !== "undefined" ? BUILD_ENV : "production",
624701
624846
  maxBreadcrumbs: 20,
624702
624847
  sampleRate: 1,
@@ -642586,13 +642731,13 @@ var require_subchannel = __commonJS((exports) => {
642586
642731
  const adjustedKeepaliveTime = Math.min(this.keepaliveTime, KEEPALIVE_MAX_TIME_MS);
642587
642732
  options = Object.assign(Object.assign({}, options), { "grpc.keepalive_time_ms": adjustedKeepaliveTime });
642588
642733
  }
642589
- this.connector.connect(this.subchannelAddress, this.secureConnector, options).then((transport) => {
642734
+ this.connector.connect(this.subchannelAddress, this.secureConnector, options).then((transport2) => {
642590
642735
  if (this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.READY)) {
642591
- this.transport = transport;
642736
+ this.transport = transport2;
642592
642737
  if (this.channelzEnabled) {
642593
- this.childrenTracker.refChild(transport.getChannelzRef());
642738
+ this.childrenTracker.refChild(transport2.getChannelzRef());
642594
642739
  }
642595
- transport.addDisconnectListener((tooManyPings) => {
642740
+ transport2.addDisconnectListener((tooManyPings) => {
642596
642741
  this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE);
642597
642742
  if (tooManyPings && this.keepaliveTime > 0) {
642598
642743
  this.keepaliveTime *= 2;
@@ -642600,7 +642745,7 @@ var require_subchannel = __commonJS((exports) => {
642600
642745
  }
642601
642746
  });
642602
642747
  } else {
642603
- transport.shutdown();
642748
+ transport2.shutdown();
642604
642749
  }
642605
642750
  }, (error100) => {
642606
642751
  this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, `${error100}`);
@@ -643400,12 +643545,12 @@ var require_subchannel_call = __commonJS((exports) => {
643400
643545
  }
643401
643546
 
643402
643547
  class Http2SubchannelCall {
643403
- constructor(http2Stream, callEventTracker, listener2, transport, callId) {
643548
+ constructor(http2Stream, callEventTracker, listener2, transport2, callId) {
643404
643549
  var _a18;
643405
643550
  this.http2Stream = http2Stream;
643406
643551
  this.callEventTracker = callEventTracker;
643407
643552
  this.listener = listener2;
643408
- this.transport = transport;
643553
+ this.transport = transport2;
643409
643554
  this.callId = callId;
643410
643555
  this.isReadFilterPending = false;
643411
643556
  this.isPushPending = false;
@@ -643417,7 +643562,7 @@ var require_subchannel_call = __commonJS((exports) => {
643417
643562
  this.internalError = null;
643418
643563
  this.serverEndedCall = false;
643419
643564
  this.connectionDropped = false;
643420
- const maxReceiveMessageLength = (_a18 = transport.getOptions()["grpc.max_receive_message_length"]) !== null && _a18 !== undefined ? _a18 : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;
643565
+ const maxReceiveMessageLength = (_a18 = transport2.getOptions()["grpc.max_receive_message_length"]) !== null && _a18 !== undefined ? _a18 : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;
643421
643566
  this.decoder = new stream_decoder_1.StreamDecoder(maxReceiveMessageLength);
643422
643567
  http2Stream.on("response", (headers, flags) => {
643423
643568
  let headersString = "";
@@ -652345,7 +652490,7 @@ async function initializeBetaTracing(resource) {
652345
652490
  });
652346
652491
  logs.setGlobalLoggerProvider(loggerProvider);
652347
652492
  setLoggerProvider(loggerProvider);
652348
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.35");
652493
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.37");
652349
652494
  setEventLogger(eventLogger);
652350
652495
  process.on("beforeExit", async () => {
652351
652496
  await loggerProvider?.forceFlush();
@@ -652385,7 +652530,7 @@ async function initializeTelemetry() {
652385
652530
  const platform10 = getPlatform();
652386
652531
  const baseAttributes = {
652387
652532
  [import_semantic_conventions29.ATTR_SERVICE_NAME]: "claude-code",
652388
- [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.35"
652533
+ [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.37"
652389
652534
  };
652390
652535
  if (platform10 === "wsl") {
652391
652536
  const wslVersion = getWslVersion();
@@ -652430,7 +652575,7 @@ async function initializeTelemetry() {
652430
652575
  } catch {}
652431
652576
  };
652432
652577
  registerCleanup(shutdownTelemetry2);
652433
- return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.35");
652578
+ return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.37");
652434
652579
  }
652435
652580
  const meterProvider = new import_sdk_metrics2.MeterProvider({
652436
652581
  resource,
@@ -652450,7 +652595,7 @@ async function initializeTelemetry() {
652450
652595
  });
652451
652596
  logs.setGlobalLoggerProvider(loggerProvider);
652452
652597
  setLoggerProvider(loggerProvider);
652453
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.35");
652598
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.37");
652454
652599
  setEventLogger(eventLogger);
652455
652600
  logForDebugging("[3P telemetry] Event logger set successfully");
652456
652601
  process.on("beforeExit", async () => {
@@ -652512,7 +652657,7 @@ Current timeout: ${timeoutMs}ms
652512
652657
  }
652513
652658
  };
652514
652659
  registerCleanup(shutdownTelemetry);
652515
- return meterProvider.getMeter("com.anthropic.claude_code", "4.2.35");
652660
+ return meterProvider.getMeter("com.anthropic.claude_code", "4.2.37");
652516
652661
  }
652517
652662
  async function flushTelemetry() {
652518
652663
  const meterProvider = getMeterProvider();
@@ -653482,7 +653627,7 @@ async function installGlobalPackage(specificVersion) {
653482
653627
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
653483
653628
  logEvent("tengu_auto_updater_lock_contention", {
653484
653629
  pid: process.pid,
653485
- currentVersion: "4.2.35"
653630
+ currentVersion: "4.2.37"
653486
653631
  });
653487
653632
  return { status: "in_progress" };
653488
653633
  }
@@ -653491,7 +653636,7 @@ async function installGlobalPackage(specificVersion) {
653491
653636
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
653492
653637
  logError2(new Error("Windows NPM detected in WSL environment"));
653493
653638
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
653494
- currentVersion: "4.2.35"
653639
+ currentVersion: "4.2.37"
653495
653640
  });
653496
653641
  return {
653497
653642
  status: "install_failed",
@@ -654037,7 +654182,7 @@ function detectLinuxGlobPatternWarnings() {
654037
654182
  }
654038
654183
  async function getDoctorDiagnostic() {
654039
654184
  const installationType = await getCurrentInstallationType();
654040
- const version11 = typeof MACRO !== "undefined" ? "4.2.35" : "unknown";
654185
+ const version11 = typeof MACRO !== "undefined" ? "4.2.37" : "unknown";
654041
654186
  const installationPath = await getInstallationPath();
654042
654187
  const invokedBinary = getInvokedBinary();
654043
654188
  const multipleInstallations = await detectMultipleInstallations();
@@ -654979,8 +655124,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
654979
655124
  const maxVersion = await getMaxVersion();
654980
655125
  if (maxVersion && gt(version11, maxVersion)) {
654981
655126
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version11} to ${maxVersion}`);
654982
- if (gte2("4.2.35", maxVersion)) {
654983
- logForDebugging(`Native installer: current version ${"4.2.35"} is already at or above maxVersion ${maxVersion}, skipping update`);
655127
+ if (gte2("4.2.37", maxVersion)) {
655128
+ logForDebugging(`Native installer: current version ${"4.2.37"} is already at or above maxVersion ${maxVersion}, skipping update`);
654984
655129
  logEvent("tengu_native_update_skipped_max_version", {
654985
655130
  latency_ms: Date.now() - startTime2,
654986
655131
  max_version: maxVersion,
@@ -654991,7 +655136,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
654991
655136
  version11 = maxVersion;
654992
655137
  }
654993
655138
  }
654994
- if (!forceReinstall && version11 === "4.2.35" && await versionIsAvailable(version11) && await isPossibleClaudeBinary(executablePath)) {
655139
+ if (!forceReinstall && version11 === "4.2.37" && await versionIsAvailable(version11) && await isPossibleClaudeBinary(executablePath)) {
654995
655140
  logForDebugging(`Found ${version11} at ${executablePath}, skipping install`);
654996
655141
  logEvent("tengu_native_update_complete", {
654997
655142
  latency_ms: Date.now() - startTime2,
@@ -723451,6 +723596,7 @@ var init_ExecuteTool = __esm(() => {
723451
723596
  init_Tool();
723452
723597
  init_messages9();
723453
723598
  init_prompt5();
723599
+ init_ideCapability();
723454
723600
  DENIED_PROXY_TARGETS = new Set([ASK_USER_QUESTION_TOOL_NAME]);
723455
723601
  inputSchema27 = lazySchema(() => exports_external.object({
723456
723602
  tool_name: exports_external.string().describe('The exact name of the target tool to execute (e.g., "CronCreate", "mcp__server__action")'),
@@ -723579,7 +723725,7 @@ ${exports_external.prettifyError(parsed.error)}`
723579
723725
  }
723580
723726
  };
723581
723727
  },
723582
- async checkPermissions(input4) {
723728
+ async checkPermissions(input4, context40) {
723583
723729
  if (input4 && DENIED_PROXY_TARGETS.has(input4.tool_name)) {
723584
723730
  return {
723585
723731
  behavior: "deny",
@@ -723590,6 +723736,18 @@ ${exports_external.prettifyError(parsed.error)}`
723590
723736
  }
723591
723737
  };
723592
723738
  }
723739
+ const tools = context40.options.tools ?? [];
723740
+ const target = findToolByName(tools, input4.tool_name);
723741
+ if (target?.mcpInfo?.serverName === IDE_MCP_SERVER && target.checkPermissions) {
723742
+ const result = await target.checkPermissions(input4.params, context40);
723743
+ if ((result.behavior === "allow" || result.behavior === "ask") && result.updatedInput) {
723744
+ return {
723745
+ ...result,
723746
+ updatedInput: input4
723747
+ };
723748
+ }
723749
+ return result;
723750
+ }
723593
723751
  return {
723594
723752
  behavior: "passthrough",
723595
723753
  message: "ExecuteExtraTool delegates permission to the target tool."
@@ -733551,6 +733709,43 @@ function isSkillLearningEnabled() {
733551
733709
  return false;
733552
733710
  }
733553
733711
 
733712
+ // src/services/tools/legacyToolUse.ts
733713
+ function parse25(value) {
733714
+ try {
733715
+ return JSON.parse(value);
733716
+ } catch {
733717
+ return value;
733718
+ }
733719
+ }
733720
+ function repairToolUse(block2, tools) {
733721
+ const names = tools.flatMap((tool) => [tool.name, ...tool.aliases ?? []]);
733722
+ const name3 = names.sort((a8, b9) => b9.length - a8.length).find((value) => block2.name.startsWith(`${value} `));
733723
+ if (!name3)
733724
+ return block2;
733725
+ const suffix = block2.name.slice(name3.length + 1);
733726
+ const pattern = /\s*([A-Za-z_][\w.-]*)<\/arg_key><arg_value>([\s\S]*?)<\/arg_value>/gy;
733727
+ const input4 = {};
733728
+ let matched = false;
733729
+ let end = 0;
733730
+ let match;
733731
+ while ((match = pattern.exec(suffix)) !== null) {
733732
+ matched = true;
733733
+ end = pattern.lastIndex;
733734
+ input4[match[1]] = parse25(match[2]);
733735
+ }
733736
+ if (!matched || end !== suffix.length) {
733737
+ return block2;
733738
+ }
733739
+ const original = typeof block2.input === "object" && block2.input !== null && !Array.isArray(block2.input) ? block2.input : {};
733740
+ const source = block2;
733741
+ const { invalidToolCallError: _invalidToolCallError, ...clean } = source;
733742
+ return {
733743
+ ...clean,
733744
+ name: name3,
733745
+ input: { ...original, ...input4 }
733746
+ };
733747
+ }
733748
+
733554
733749
  // src/services/skillLearning/observationStore.ts
733555
733750
  import { mkdir as mkdir35, readFile as readFile48, rename as rename5, stat as stat33, writeFile as writeFile37 } from "fs/promises";
733556
733751
  import { dirname as dirname62, join as join136 } from "path";
@@ -736388,10 +736583,11 @@ function getMcpServerBaseUrlFromToolName(toolName, mcpClients) {
736388
736583
  return getLoggingSafeMcpBaseUrl(serverConnection.config);
736389
736584
  }
736390
736585
  async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext) {
736391
- const toolName = toolUse.name;
736392
- const invalidToolCallError = getInvalidToolCallError(toolUse);
736586
+ const block2 = repairToolUse(toolUse, toolUseContext.options.tools);
736587
+ const toolName = block2.name;
736588
+ const invalidToolCallError = getInvalidToolCallError(block2);
736393
736589
  if (invalidToolCallError) {
736394
- logForDebugging(`Invalid tool call ${toolName}: ${toolUse.id}`);
736590
+ logForDebugging(`Invalid tool call ${toolName}: ${block2.id}`);
736395
736591
  yield {
736396
736592
  message: createUserMessage({
736397
736593
  content: [
@@ -736399,7 +736595,7 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736399
736595
  type: "tool_result",
736400
736596
  content: `<tool_use_error>${invalidToolCallError}</tool_use_error>`,
736401
736597
  is_error: true,
736402
- tool_use_id: toolUse.id
736598
+ tool_use_id: block2.id
736403
736599
  }
736404
736600
  ],
736405
736601
  toolUseResult: invalidToolCallError,
@@ -736421,11 +736617,11 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736421
736617
  const mcpServerBaseUrl = getMcpServerBaseUrlFromToolName(toolName, toolUseContext.options.mcpClients);
736422
736618
  if (!tool) {
736423
736619
  const sanitizedToolName = sanitizeToolNameForAnalytics(toolName);
736424
- logForDebugging(`Unknown tool ${toolName}: ${toolUse.id}`);
736620
+ logForDebugging(`Unknown tool ${toolName}: ${block2.id}`);
736425
736621
  logEvent("tengu_tool_use_error", {
736426
736622
  error: `No such tool available: ${sanitizedToolName}`,
736427
736623
  toolName: sanitizedToolName,
736428
- toolUseID: toolUse.id,
736624
+ toolUseID: block2.id,
736429
736625
  isMcp: toolName.startsWith("mcp__"),
736430
736626
  queryChainId: toolUseContext.queryTracking?.chainId,
736431
736627
  queryDepth: toolUseContext.queryTracking?.depth,
@@ -736447,7 +736643,7 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736447
736643
  type: "tool_result",
736448
736644
  content: `<tool_use_error>Error: No such tool available: ${toolName}</tool_use_error>`,
736449
736645
  is_error: true,
736450
- tool_use_id: toolUse.id
736646
+ tool_use_id: block2.id
736451
736647
  }
736452
736648
  ],
736453
736649
  toolUseResult: `Error: No such tool available: ${toolName}`,
@@ -736456,12 +736652,12 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736456
736652
  };
736457
736653
  return;
736458
736654
  }
736459
- const toolInput = toolUse.input;
736655
+ const toolInput = block2.input;
736460
736656
  try {
736461
736657
  if (toolUseContext.abortController.signal.aborted) {
736462
736658
  logEvent("tengu_tool_use_cancelled", {
736463
736659
  toolName: sanitizeToolNameForAnalytics(tool.name),
736464
- toolUseID: toolUse.id,
736660
+ toolUseID: block2.id,
736465
736661
  isMcp: tool.isMcp ?? false,
736466
736662
  queryChainId: toolUseContext.queryTracking?.chainId,
736467
736663
  queryDepth: toolUseContext.queryTracking?.depth,
@@ -736476,7 +736672,7 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736476
736672
  },
736477
736673
  ...mcpToolDetailsForAnalytics(tool.name, mcpServerType, mcpServerBaseUrl)
736478
736674
  });
736479
- const content = createToolResultStopMessage(toolUse.id);
736675
+ const content = createToolResultStopMessage(block2.id);
736480
736676
  content.content = withMemoryCorrectionHint(CANCEL_MESSAGE);
736481
736677
  yield {
736482
736678
  message: createUserMessage({
@@ -736487,7 +736683,7 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736487
736683
  };
736488
736684
  return;
736489
736685
  }
736490
- for await (const update of streamedCheckPermissionsAndCallTool(tool, toolUse.id, toolInput, toolUseContext, canUseTool, assistantMessage, messageId, requestId2, mcpServerType, mcpServerBaseUrl)) {
736686
+ for await (const update of streamedCheckPermissionsAndCallTool(tool, block2.id, toolInput, toolUseContext, canUseTool, assistantMessage, messageId, requestId2, mcpServerType, mcpServerBaseUrl)) {
736491
736687
  yield update;
736492
736688
  }
736493
736689
  } catch (error100) {
@@ -736502,7 +736698,7 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext
736502
736698
  type: "tool_result",
736503
736699
  content: `<tool_use_error>${detailedError}</tool_use_error>`,
736504
736700
  is_error: true,
736505
- tool_use_id: toolUse.id
736701
+ tool_use_id: block2.id
736506
736702
  }
736507
736703
  ],
736508
736704
  toolUseResult: detailedError,
@@ -737327,6 +737523,7 @@ class StreamingToolExecutor {
737327
737523
  }
737328
737524
  }
737329
737525
  addTool(block2, assistantMessage) {
737526
+ const repaired = repairToolUse(block2, this.toolDefinitions);
737330
737527
  if (this.tools.length === 0 && this.turnSpan === null) {
737331
737528
  this.turnSpan = createToolBatchSpan(this.toolUseContext.langfuseTrace ?? null, { toolNames: [block2.name], batchIndex: 0 });
737332
737529
  if (this.turnSpan) {
@@ -737336,12 +737533,12 @@ class StreamingToolExecutor {
737336
737533
  };
737337
737534
  }
737338
737535
  }
737339
- const toolDefinition = findToolByName(this.toolDefinitions, block2.name);
737340
- const invalidToolCallError = getInvalidToolCallError(block2);
737536
+ const toolDefinition = findToolByName(this.toolDefinitions, repaired.name);
737537
+ const invalidToolCallError = getInvalidToolCallError(repaired);
737341
737538
  if (invalidToolCallError) {
737342
737539
  this.tools.push({
737343
- id: block2.id,
737344
- block: block2,
737540
+ id: repaired.id,
737541
+ block: repaired,
737345
737542
  assistantMessage,
737346
737543
  status: "completed",
737347
737544
  isConcurrencySafe: true,
@@ -737353,7 +737550,7 @@ class StreamingToolExecutor {
737353
737550
  type: "tool_result",
737354
737551
  content: `<tool_use_error>${invalidToolCallError}</tool_use_error>`,
737355
737552
  is_error: true,
737356
- tool_use_id: block2.id
737553
+ tool_use_id: repaired.id
737357
737554
  }
737358
737555
  ],
737359
737556
  toolUseResult: invalidToolCallError,
@@ -737365,8 +737562,8 @@ class StreamingToolExecutor {
737365
737562
  }
737366
737563
  if (!toolDefinition) {
737367
737564
  this.tools.push({
737368
- id: block2.id,
737369
- block: block2,
737565
+ id: repaired.id,
737566
+ block: repaired,
737370
737567
  assistantMessage,
737371
737568
  status: "completed",
737372
737569
  isConcurrencySafe: true,
@@ -737376,19 +737573,19 @@ class StreamingToolExecutor {
737376
737573
  content: [
737377
737574
  {
737378
737575
  type: "tool_result",
737379
- content: `<tool_use_error>Error: No such tool available: ${block2.name}</tool_use_error>`,
737576
+ content: `<tool_use_error>Error: No such tool available: ${repaired.name}</tool_use_error>`,
737380
737577
  is_error: true,
737381
- tool_use_id: block2.id
737578
+ tool_use_id: repaired.id
737382
737579
  }
737383
737580
  ],
737384
- toolUseResult: `Error: No such tool available: ${block2.name}`,
737581
+ toolUseResult: `Error: No such tool available: ${repaired.name}`,
737385
737582
  sourceToolAssistantUUID: assistantMessage.uuid
737386
737583
  })
737387
737584
  ]
737388
737585
  });
737389
737586
  return;
737390
737587
  }
737391
- const parsedInput = toolDefinition.inputSchema.safeParse(block2.input);
737588
+ const parsedInput = toolDefinition.inputSchema.safeParse(repaired.input);
737392
737589
  const isConcurrencySafe = parsedInput?.success ? (() => {
737393
737590
  try {
737394
737591
  return Boolean(toolDefinition.isConcurrencySafe(parsedInput.data));
@@ -737397,8 +737594,8 @@ class StreamingToolExecutor {
737397
737594
  }
737398
737595
  })() : false;
737399
737596
  this.tools.push({
737400
- id: block2.id,
737401
- block: block2,
737597
+ id: repaired.id,
737598
+ block: repaired,
737402
737599
  assistantMessage,
737403
737600
  status: "queued",
737404
737601
  isConcurrencySafe,
@@ -749235,11 +749432,11 @@ function extractTag(html2, tagName) {
749235
749432
  return null;
749236
749433
  }
749237
749434
  const escapedTag = escapeRegExp(tagName);
749238
- const pattern = new RegExp(`<${escapedTag}(?:\\s+[^>]*)?>` + "([\\s\\S]*?)" + `<\\/${escapedTag}>`, "gi");
749435
+ const pattern = new RegExp(`<${escapedTag}(?:\\s[^>]*)?>` + "([\\s\\S]*?)" + `<\\/${escapedTag}>`, "gi");
749239
749436
  let match;
749240
749437
  let depth = 0;
749241
749438
  let lastIndex = 0;
749242
- const openingTag = new RegExp(`<${escapedTag}(?:\\s+[^>]*?)?>`, "gi");
749439
+ const openingTag = new RegExp(`<${escapedTag}(?:\\s[^>]*?)?>`, "gi");
749243
749440
  const closingTag = new RegExp(`<\\/${escapedTag}>`, "gi");
749244
749441
  while ((match = pattern.exec(html2)) !== null) {
749245
749442
  const content = match[1];
@@ -755043,7 +755240,7 @@ var init_findRelevantMemories = __esm(() => {
755043
755240
 
755044
755241
  // src/utils/attachments.ts
755045
755242
  import { readdir as readdir25, stat as stat39 } from "fs/promises";
755046
- import { dirname as dirname68, parse as parse25, relative as relative34, resolve as resolve52 } from "path";
755243
+ import { dirname as dirname68, parse as parse26, relative as relative34, resolve as resolve52 } from "path";
755047
755244
  import { randomUUID as randomUUID43 } from "crypto";
755048
755245
  async function getAttachments(input4, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
755049
755246
  if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
@@ -755510,7 +755707,7 @@ function getDirectoriesToProcess(targetPath, originalCwd) {
755510
755707
  const targetDir = dirname68(resolve52(targetPath));
755511
755708
  const nestedDirs = [];
755512
755709
  let currentDir = targetDir;
755513
- while (currentDir !== originalCwd && currentDir !== parse25(currentDir).root) {
755710
+ while (currentDir !== originalCwd && currentDir !== parse26(currentDir).root) {
755514
755711
  if (currentDir.startsWith(originalCwd)) {
755515
755712
  nestedDirs.push(currentDir);
755516
755713
  }
@@ -755519,7 +755716,7 @@ function getDirectoriesToProcess(targetPath, originalCwd) {
755519
755716
  nestedDirs.reverse();
755520
755717
  const cwdLevelDirs = [];
755521
755718
  currentDir = originalCwd;
755522
- while (currentDir !== parse25(currentDir).root) {
755719
+ while (currentDir !== parse26(currentDir).root) {
755523
755720
  cwdLevelDirs.push(currentDir);
755524
755721
  currentDir = dirname68(currentDir);
755525
755722
  }
@@ -756166,7 +756363,7 @@ async function* getAttachmentMessages(input4, toolUseContext, ideSelection, queu
756166
756363
  }
756167
756364
  }
756168
756365
  async function tryGetPDFReference(filename) {
756169
- const ext = parse25(filename).ext.toLowerCase();
756366
+ const ext = parse26(filename).ext.toLowerCase();
756170
756367
  if (!isPDFExtension(ext)) {
756171
756368
  return null;
756172
756369
  }
@@ -756200,7 +756397,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
756200
756397
  return null;
756201
756398
  }
756202
756399
  if (mode === "at-mention" && !isFileWithinReadSizeLimit(filename, getDefaultFileReadingLimits().maxSizeBytes)) {
756203
- const ext = parse25(filename).ext.toLowerCase();
756400
+ const ext = parse26(filename).ext.toLowerCase();
756204
756401
  if (!isPDFExtension(ext)) {
756205
756402
  try {
756206
756403
  const stats3 = await getFsImplementation().stat(filename);
@@ -757894,14 +758091,14 @@ function isSourceAllowedByPolicy(source) {
757894
758091
  if (allowlist === null) {
757895
758092
  return true;
757896
758093
  }
757897
- return allowlist.some((allowed) => {
757898
- if (allowed.source === "hostPattern") {
757899
- return doesSourceMatchHostPattern(source, allowed);
758094
+ return allowlist.some((allowed2) => {
758095
+ if (allowed2.source === "hostPattern") {
758096
+ return doesSourceMatchHostPattern(source, allowed2);
757900
758097
  }
757901
- if (allowed.source === "pathPattern") {
757902
- return doesSourceMatchPathPattern(source, allowed);
758098
+ if (allowed2.source === "pathPattern") {
758099
+ return doesSourceMatchPathPattern(source, allowed2);
757903
758100
  }
757904
- return areSourcesEqual(source, allowed);
758101
+ return areSourcesEqual(source, allowed2);
757905
758102
  });
757906
758103
  }
757907
758104
  function formatSourceForDisplay(source) {
@@ -762849,13 +763046,13 @@ async function toolToAPISchema(tool, options) {
762849
763046
  schema3.cache_control = options.cacheControl;
762850
763047
  }
762851
763048
  if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)) {
762852
- const allowed = new Set([
763049
+ const allowed2 = new Set([
762853
763050
  "name",
762854
763051
  "description",
762855
763052
  "input_schema",
762856
763053
  "cache_control"
762857
763054
  ]);
762858
- const stripped = Object.keys(schema3).filter((k9) => !allowed.has(k9));
763055
+ const stripped = Object.keys(schema3).filter((k9) => !allowed2.has(k9));
762859
763056
  if (stripped.length > 0) {
762860
763057
  logStripOnce(stripped);
762861
763058
  return {
@@ -763744,7 +763941,7 @@ function getAnthropicEnvMetadata() {
763744
763941
  function getBuildAgeMinutes() {
763745
763942
  if (false)
763746
763943
  ;
763747
- const buildTime = new Date("2026-09-04T09:22:28.856Z").getTime();
763944
+ const buildTime = new Date("2026-09-09T12:10:12.753Z").getTime();
763748
763945
  if (isNaN(buildTime))
763749
763946
  return;
763750
763947
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -766540,8 +766737,8 @@ var require_dist10 = __commonJS((exports) => {
766540
766737
  };
766541
766738
  return parseAny();
766542
766739
  };
766543
- var parse26 = parseJSON2;
766544
- exports.parse = parse26;
766740
+ var parse27 = parseJSON2;
766741
+ exports.parse = parse27;
766545
766742
  });
766546
766743
 
766547
766744
  // src/costrict/provider/index.ts
@@ -767058,10 +767255,12 @@ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, optio
767058
767255
  const state3 = toolCallStates.get(idx);
767059
767256
  if (state3) {
767060
767257
  state3.rawInput += fragment;
767061
- const partialInput = tryParsePartialToolInput(state3.rawInput);
767062
- if (partialInput) {
767063
- state3.partialInput = partialInput;
767064
- delta.parsed_tool_input = partialInput;
767258
+ if (state3.rawInput.length <= PARTIAL_INPUT_PARSE_MAX_CHARS) {
767259
+ const partialInput = tryParsePartialToolInput(state3.rawInput);
767260
+ if (partialInput) {
767261
+ state3.partialInput = partialInput;
767262
+ delta.parsed_tool_input = partialInput;
767263
+ }
767065
767264
  }
767066
767265
  }
767067
767266
  } else if (delta.type === "thinking_delta") {
@@ -767405,7 +767604,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767405
767604
  });
767406
767605
  }
767407
767606
  }
767408
- var import_partial_json, MAX_STREAM_RECONNECT_ATTEMPTS2 = 3, MAX_PREFILL_ROUNDS = 4, MAX_STITCHED_CHARS = 2000000;
767607
+ var import_partial_json, MAX_STREAM_RECONNECT_ATTEMPTS2 = 3, MAX_PREFILL_ROUNDS = 4, MAX_STITCHED_CHARS = 2000000, PARTIAL_INPUT_PARSE_MAX_CHARS = 8192;
767409
767608
  var init_provider3 = __esm(() => {
767410
767609
  init_openai();
767411
767610
  init_sdk();
@@ -778240,7 +778439,7 @@ function Feedback({
778240
778439
  platform: env4.platform,
778241
778440
  gitRepo: envInfo.isGit,
778242
778441
  terminal: env4.terminal,
778243
- version: "4.2.35",
778442
+ version: "4.2.37",
778244
778443
  transcript: normalizeMessagesForAPI(messages),
778245
778444
  errors: sanitizedErrors,
778246
778445
  lastApiRequest: getLastAPIRequest(),
@@ -778423,7 +778622,7 @@ function Feedback({
778423
778622
  ", ",
778424
778623
  env4.terminal,
778425
778624
  ", v",
778426
- "4.2.35"
778625
+ "4.2.37"
778427
778626
  ]
778428
778627
  })
778429
778628
  ]
@@ -778520,7 +778719,7 @@ ${sanitizedDescription}
778520
778719
  ` + `**Environment Info**
778521
778720
  ` + `- Platform: ${env4.platform}
778522
778721
  ` + `- Terminal: ${env4.terminal}
778523
- ` + `- Version: ${"4.2.35"}
778722
+ ` + `- Version: ${"4.2.37"}
778524
778723
  ` + `- Feedback ID: ${feedbackId}
778525
778724
  ` + `
778526
778725
  **Errors**
@@ -779170,12 +779369,12 @@ async function getFilesUsingGit(abortSignal, respectGitignore) {
779170
779369
  "--others",
779171
779370
  "--exclude-standard"
779172
779371
  ] : ["-c", "core.quotepath=false", "ls-files", "--others"];
779173
- const generation = cacheGeneration;
779372
+ const generation2 = cacheGeneration;
779174
779373
  untrackedFetchPromise = execFileNoThrowWithCwd(gitExe(), untrackedArgs, {
779175
779374
  timeout: 1e4,
779176
779375
  cwd: repoRoot2
779177
779376
  }).then(async (untrackedResult) => {
779178
- if (generation !== cacheGeneration) {
779377
+ if (generation2 !== cacheGeneration) {
779179
779378
  return;
779180
779379
  }
779181
779380
  if (untrackedResult.code === 0) {
@@ -779345,11 +779544,11 @@ function startBackgroundCacheRefresh() {
779345
779544
  return;
779346
779545
  }
779347
779546
  }
779348
- const generation = cacheGeneration;
779547
+ const generation2 = cacheGeneration;
779349
779548
  const refreshStart = Date.now();
779350
779549
  getFileIndex();
779351
779550
  fileListRefreshPromise = getPathsForSuggestions().then((result) => {
779352
- if (generation !== cacheGeneration) {
779551
+ if (generation2 !== cacheGeneration) {
779353
779552
  return result;
779354
779553
  }
779355
779554
  fileListRefreshPromise = null;
@@ -779361,7 +779560,7 @@ function startBackgroundCacheRefresh() {
779361
779560
  }).catch((error100) => {
779362
779561
  logForDebugging(`[FileIndex] Cache refresh failed: ${errorMessage(error100)}`);
779363
779562
  logError2(error100);
779364
- if (generation === cacheGeneration) {
779563
+ if (generation2 === cacheGeneration) {
779365
779564
  fileListRefreshPromise = null;
779366
779565
  }
779367
779566
  return getFileIndex();
@@ -780759,7 +780958,7 @@ function buildPrimarySection() {
780759
780958
  children: t("settings.status.renameHint")
780760
780959
  });
780761
780960
  return [
780762
- { label: t("settings.status.version"), value: "4.2.35" },
780961
+ { label: t("settings.status.version"), value: "4.2.37" },
780763
780962
  { label: t("settings.status.sessionName"), value: nameValue },
780764
780963
  { label: t("settings.status.sessionId"), value: sessionId },
780765
780964
  { label: t("settings.status.cwd"), value: getCwd() },
@@ -783637,7 +783836,7 @@ function Config({
783637
783836
  }
783638
783837
  })
783639
783838
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime192.jsx(ChannelDowngradeDialog, {
783640
- currentVersion: "4.2.35",
783839
+ currentVersion: "4.2.37",
783641
783840
  onChoice: (choice) => {
783642
783841
  setShowSubmenu(null);
783643
783842
  setTabsHidden(false);
@@ -783649,7 +783848,7 @@ function Config({
783649
783848
  autoUpdatesChannel: "stable"
783650
783849
  };
783651
783850
  if (choice === "stay") {
783652
- newSettings.minimumVersion = "4.2.35";
783851
+ newSettings.minimumVersion = "4.2.37";
783653
783852
  }
783654
783853
  updateSettingsForSource("userSettings", newSettings);
783655
783854
  setSettingsData((prev) => ({
@@ -789118,7 +789317,7 @@ function HelpV2({ onClose, commands: commands11 }) {
789118
789317
  color: "professionalBlue",
789119
789318
  children: [
789120
789319
  /* @__PURE__ */ jsx_runtime219.jsx(Tabs, {
789121
- title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.35"}`,
789320
+ title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.37"}`,
789122
789321
  color: "professionalBlue",
789123
789322
  defaultTab: "general",
789124
789323
  children: tabs
@@ -811833,7 +812032,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
811833
812032
  return [];
811834
812033
  }
811835
812034
  }
811836
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.35") {
812035
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.37") {
811837
812036
  if (process.env.USER_TYPE === "sf") {
811838
812037
  const changelog = "";
811839
812038
  if (changelog) {
@@ -811860,7 +812059,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.35")
811860
812059
  releaseNotes
811861
812060
  };
811862
812061
  }
811863
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.35") {
812062
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.37") {
811864
812063
  if (process.env.USER_TYPE === "sf") {
811865
812064
  const changelog = "";
811866
812065
  if (changelog) {
@@ -812533,7 +812732,7 @@ function createSearcher(pattern, options) {
812533
812732
  }
812534
812733
  return new BitapSearch(pattern, options);
812535
812734
  }
812536
- function parse26(query5, options, { auto = true } = {}) {
812735
+ function parse27(query5, options, { auto = true } = {}) {
812537
812736
  const next2 = (query6) => {
812538
812737
  if (isString3(query6)) {
812539
812738
  const obj = {
@@ -813413,7 +813612,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
813413
813612
  return results;
813414
813613
  }
813415
813614
  _searchLogical(query5) {
813416
- const expression = parse26(query5, this.options);
813615
+ const expression = parse27(query5, this.options);
813417
813616
  const evaluate = (node2, item, idx) => {
813418
813617
  if (!("children" in node2)) {
813419
813618
  const { keyId, searcher } = node2;
@@ -813810,7 +814009,7 @@ var init_fuse = __esm(() => {
813810
814009
  ...options
813811
814010
  }).searchIn(text2);
813812
814011
  };
813813
- Fuse.parseQuery = parse26;
814012
+ Fuse.parseQuery = parse27;
813814
814013
  register2(ExtendedSearch);
813815
814014
  register2(TokenSearch);
813816
814015
  Fuse.use = function(...plugins) {
@@ -814373,7 +814572,7 @@ function isNotLoggedIn() {
814373
814572
  return true;
814374
814573
  }
814375
814574
  function getLogoDisplayData() {
814376
- const version11 = process.env.DEMO_VERSION ?? "4.2.35";
814575
+ const version11 = process.env.DEMO_VERSION ?? "4.2.37";
814377
814576
  const serverUrl = getDirectConnectServerUrl();
814378
814577
  const displayPath2 = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
814379
814578
  const cwd2 = serverUrl ? `${displayPath2} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath2;
@@ -814951,7 +815150,7 @@ var init_MatrixMessageLine = __esm(() => {
814951
815150
  // src/components/matrix-tactical/MatrixWelcome.tsx
814952
815151
  import { basename as basename48 } from "path";
814953
815152
  function MatrixWelcome({
814954
- version: version11 = "4.2.35",
815153
+ version: version11 = "4.2.37",
814955
815154
  projectName,
814956
815155
  cwd: cwd2,
814957
815156
  modelDisplayName,
@@ -815586,13 +815785,13 @@ function LogoV2() {
815586
815785
  const { hasReleaseNotes } = checkForReleaseNotesSync(config13.lastReleaseNotesSeen);
815587
815786
  import_react167.useEffect(() => {
815588
815787
  const currentConfig = getGlobalConfig();
815589
- if (currentConfig.lastReleaseNotesSeen === "4.2.35") {
815788
+ if (currentConfig.lastReleaseNotesSeen === "4.2.37") {
815590
815789
  return;
815591
815790
  }
815592
815791
  saveGlobalConfig((current2) => {
815593
- if (current2.lastReleaseNotesSeen === "4.2.35")
815792
+ if (current2.lastReleaseNotesSeen === "4.2.37")
815594
815793
  return current2;
815595
- return { ...current2, lastReleaseNotesSeen: "4.2.35" };
815794
+ return { ...current2, lastReleaseNotesSeen: "4.2.37" };
815596
815795
  });
815597
815796
  if (showOnboarding) {
815598
815797
  incrementProjectOnboardingSeenCount();
@@ -824314,10 +824513,10 @@ var require_packer_sync = __commonJS((exports, module) => {
824314
824513
 
824315
824514
  // node_modules/.bun/pngjs@5.0.0/node_modules/pngjs/lib/png-sync.js
824316
824515
  var require_png_sync = __commonJS((exports) => {
824317
- var parse27 = require_parser_sync();
824516
+ var parse28 = require_parser_sync();
824318
824517
  var pack2 = require_packer_sync();
824319
824518
  exports.read = function(buffer2, options) {
824320
- return parse27(buffer2, options || {});
824519
+ return parse28(buffer2, options || {});
824321
824520
  };
824322
824521
  exports.write = function(png2, options) {
824323
824522
  return pack2(png2, options);
@@ -839157,7 +839356,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
839157
839356
  smapsRollup,
839158
839357
  platform: process.platform,
839159
839358
  nodeVersion: process.version,
839160
- ccVersion: "4.2.35"
839359
+ ccVersion: "4.2.37"
839161
839360
  };
839162
839361
  }
839163
839362
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -839273,7 +839472,7 @@ var init_mock_limits = __esm(() => {
839273
839472
  var call56 = async () => {
839274
839473
  return {
839275
839474
  type: "text",
839276
- value: `${"4.2.35"} (built ${"2026-09-04T09:22:28.856Z"})`
839475
+ value: `${"4.2.37"} (built ${"2026-09-09T12:10:12.753Z"})`
839277
839476
  };
839278
839477
  }, version11, version_default;
839279
839478
  var init_version2 = __esm(() => {
@@ -855848,7 +856047,7 @@ __export(exports_createWorkflowCommand, {
855848
856047
  getWorkflowCommands: () => getWorkflowCommands
855849
856048
  });
855850
856049
  import { readdir as readdir43 } from "fs/promises";
855851
- import { join as join211, parse as parse27 } from "path";
856050
+ import { join as join211, parse as parse28 } from "path";
855852
856051
  async function getWorkflowCommands(cwd2) {
855853
856052
  const workflowDir = join211(cwd2, WORKFLOW_DIR_NAME);
855854
856053
  let files3;
@@ -855858,11 +856057,11 @@ async function getWorkflowCommands(cwd2) {
855858
856057
  return [];
855859
856058
  }
855860
856059
  const workflowFiles = files3.filter((f7) => {
855861
- const ext = parse27(f7).ext.toLowerCase();
856060
+ const ext = parse28(f7).ext.toLowerCase();
855862
856061
  return WORKFLOW_FILE_EXTENSIONS.includes(ext);
855863
856062
  });
855864
856063
  return workflowFiles.map((file3) => {
855865
- const name3 = parse27(file3).name;
856064
+ const name3 = parse28(file3).name;
855866
856065
  return {
855867
856066
  type: "prompt",
855868
856067
  name: name3,
@@ -859153,7 +859352,7 @@ function generateHtmlReport(data, insights) {
859153
859352
  </html>`;
859154
859353
  }
859155
859354
  function buildExportData(data, insights, facets, remoteStats) {
859156
- const version12 = typeof MACRO !== "undefined" ? "4.2.35" : "unknown";
859355
+ const version12 = typeof MACRO !== "undefined" ? "4.2.37" : "unknown";
859157
859356
  const remote_hosts_collected = remoteStats?.hosts.filter((h8) => h8.sessionCount > 0).map((h8) => h8.name);
859158
859357
  const facets_summary = {
859159
859358
  total: facets.size,
@@ -863645,7 +863844,7 @@ var init_sessionStorage = __esm(() => {
863645
863844
  init_settings2();
863646
863845
  init_slowOperations();
863647
863846
  init_uuid();
863648
- VERSION11 = typeof MACRO !== "undefined" ? "4.2.35" : "unknown";
863847
+ VERSION11 = typeof MACRO !== "undefined" ? "4.2.37" : "unknown";
863649
863848
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
863650
863849
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
863651
863850
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -864986,7 +865185,7 @@ var init_filesystem = __esm(() => {
864986
865185
  });
864987
865186
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
864988
865187
  const nonce = randomBytes24(16).toString("hex");
864989
- return join219(getCostrictTempDir(), "bundled-skills", "4.2.35", nonce);
865188
+ return join219(getCostrictTempDir(), "bundled-skills", "4.2.37", nonce);
864990
865189
  });
864991
865190
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
864992
865191
  });
@@ -876484,7 +876683,7 @@ function buildSystemInitMessage(inputs) {
876484
876683
  slash_commands: inputs.commands.filter((c10) => c10.userInvocable !== false).map((c10) => c10.name),
876485
876684
  apiKeySource: getAnthropicApiKeyWithSource().source,
876486
876685
  betas: getSdkBetas(),
876487
- claude_code_version: "4.2.35",
876686
+ claude_code_version: "4.2.37",
876488
876687
  output_style: outputStyle2,
876489
876688
  agents: inputs.agents.map((agent) => agent.agentType),
876490
876689
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -878361,10 +878560,10 @@ function toolInfoFromToolUse(toolUse, _supportsTerminalOutput = false, cwd2) {
878361
878560
  case "WebSearch": {
878362
878561
  const query5 = input5?.query ?? "Web search";
878363
878562
  let label = `"${query5}"`;
878364
- const allowed = input5?.allowed_domains;
878563
+ const allowed2 = input5?.allowed_domains;
878365
878564
  const blocked = input5?.blocked_domains;
878366
- if (allowed && allowed.length > 0)
878367
- label += ` (allowed: ${allowed.join(", ")})`;
878565
+ if (allowed2 && allowed2.length > 0)
878566
+ label += ` (allowed: ${allowed2.join(", ")})`;
878368
878567
  if (blocked && blocked.length > 0)
878369
878568
  label += ` (blocked: ${blocked.join(", ")})`;
878370
878569
  return {
@@ -880028,7 +880227,7 @@ function appendToLog(path61, message2) {
880028
880227
  cwd: getFsImplementation().cwd(),
880029
880228
  userType: process.env.USER_TYPE,
880030
880229
  sessionId: getSessionId(),
880031
- version: "4.2.35"
880230
+ version: "4.2.37"
880032
880231
  };
880033
880232
  getLogWriter(path61).write(messageWithTimestamp);
880034
880233
  }
@@ -884247,8 +884446,8 @@ class QueryGuard {
884247
884446
  this._notify();
884248
884447
  return this._generation;
884249
884448
  }
884250
- end(generation) {
884251
- if (this._generation !== generation)
884449
+ end(generation2) {
884450
+ if (this._generation !== generation2)
884252
884451
  return false;
884253
884452
  if (this._status !== "running")
884254
884453
  return false;
@@ -901089,7 +901288,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
901089
901288
  project_dir: getOriginalCwd(),
901090
901289
  added_dirs: addedDirs
901091
901290
  },
901092
- version: "4.2.35",
901291
+ version: "4.2.37",
901093
901292
  output_style: {
901094
901293
  name: outputStyleName
901095
901294
  },
@@ -907876,7 +908075,7 @@ var require_lib16 = __commonJS((exports, module) => {
907876
908075
  this.hashes = this.algorithms.map(crypto8.createHash);
907877
908076
  }
907878
908077
  #getOptions() {
907879
- this.sri = this.opts?.integrity ? parse28(this.opts?.integrity, this.opts) : null;
908078
+ this.sri = this.opts?.integrity ? parse29(this.opts?.integrity, this.opts) : null;
907880
908079
  this.expectedSize = this.opts?.size;
907881
908080
  if (!this.sri) {
907882
908081
  this.algorithm = null;
@@ -907917,7 +908116,7 @@ var require_lib16 = __commonJS((exports, module) => {
907917
908116
  if (!this.goodSri) {
907918
908117
  this.#getOptions();
907919
908118
  }
907920
- const newSri = parse28(this.hashes.map((h8, i10) => {
908119
+ const newSri = parse29(this.hashes.map((h8, i10) => {
907921
908120
  return `${this.algorithms[i10]}-${h8.digest("base64")}${this.optString}`;
907922
908121
  }).join(" "), this.opts);
907923
908122
  const match = this.goodSri && newSri.match(this.sri, this.opts);
@@ -907985,7 +908184,7 @@ var require_lib16 = __commonJS((exports, module) => {
907985
908184
  return this.toString();
907986
908185
  }
907987
908186
  match(integrity, opts) {
907988
- const other = parse28(integrity, opts);
908187
+ const other = parse29(integrity, opts);
907989
908188
  if (!other) {
907990
908189
  return false;
907991
908190
  }
@@ -908064,13 +908263,13 @@ var require_lib16 = __commonJS((exports, module) => {
908064
908263
  }
908065
908264
  concat(integrity, opts) {
908066
908265
  const other = typeof integrity === "string" ? integrity : stringify5(integrity, opts);
908067
- return parse28(`${this.toString(opts)} ${other}`, opts);
908266
+ return parse29(`${this.toString(opts)} ${other}`, opts);
908068
908267
  }
908069
908268
  hexDigest() {
908070
- return parse28(this, { single: true }).hexDigest();
908269
+ return parse29(this, { single: true }).hexDigest();
908071
908270
  }
908072
908271
  merge(integrity, opts) {
908073
- const other = parse28(integrity, opts);
908272
+ const other = parse29(integrity, opts);
908074
908273
  for (const algo in other) {
908075
908274
  if (this[algo]) {
908076
908275
  if (!this[algo].find((hash4) => other[algo].find((otherhash) => hash4.digest === otherhash.digest))) {
@@ -908082,7 +908281,7 @@ var require_lib16 = __commonJS((exports, module) => {
908082
908281
  }
908083
908282
  }
908084
908283
  match(integrity, opts) {
908085
- const other = parse28(integrity, opts);
908284
+ const other = parse29(integrity, opts);
908086
908285
  if (!other) {
908087
908286
  return false;
908088
908287
  }
@@ -908101,8 +908300,8 @@ var require_lib16 = __commonJS((exports, module) => {
908101
908300
  return null;
908102
908301
  }
908103
908302
  }
908104
- exports.parse = parse28;
908105
- function parse28(sri, opts) {
908303
+ exports.parse = parse29;
908304
+ function parse29(sri, opts) {
908106
908305
  if (!sri) {
908107
908306
  return null;
908108
908307
  }
@@ -908138,7 +908337,7 @@ var require_lib16 = __commonJS((exports, module) => {
908138
908337
  if (obj.algorithm && obj.digest) {
908139
908338
  return Hash7.prototype.toString.call(obj, opts);
908140
908339
  } else if (typeof obj === "string") {
908141
- return stringify5(parse28(obj, opts), opts);
908340
+ return stringify5(parse29(obj, opts), opts);
908142
908341
  } else {
908143
908342
  return Integrity.prototype.toString.call(obj, opts);
908144
908343
  }
@@ -908146,7 +908345,7 @@ var require_lib16 = __commonJS((exports, module) => {
908146
908345
  exports.fromHex = fromHex4;
908147
908346
  function fromHex4(hexDigest, algorithm, opts) {
908148
908347
  const optString = getOptString(opts?.options);
908149
- return parse28(`${algorithm}-${Buffer.from(hexDigest, "hex").toString("base64")}${optString}`, opts);
908348
+ return parse29(`${algorithm}-${Buffer.from(hexDigest, "hex").toString("base64")}${optString}`, opts);
908150
908349
  }
908151
908350
  exports.fromData = fromData;
908152
908351
  function fromData(data, opts) {
@@ -908182,7 +908381,7 @@ var require_lib16 = __commonJS((exports, module) => {
908182
908381
  }
908183
908382
  exports.checkData = checkData;
908184
908383
  function checkData(data, sri, opts) {
908185
- sri = parse28(sri, opts);
908384
+ sri = parse29(sri, opts);
908186
908385
  if (!sri || !Object.keys(sri).length) {
908187
908386
  if (opts?.error) {
908188
908387
  throw Object.assign(new Error("No valid integrity hashes to check against"), {
@@ -908194,7 +908393,7 @@ var require_lib16 = __commonJS((exports, module) => {
908194
908393
  }
908195
908394
  const algorithm = sri.pickAlgorithm(opts);
908196
908395
  const digest = crypto8.createHash(algorithm).update(data).digest("base64");
908197
- const newSri = parse28({ algorithm, digest });
908396
+ const newSri = parse29({ algorithm, digest });
908198
908397
  const match = newSri.match(sri, opts);
908199
908398
  opts = opts || {};
908200
908399
  if (match || !opts.error) {
@@ -908222,7 +908421,7 @@ var require_lib16 = __commonJS((exports, module) => {
908222
908421
  function checkStream(stream8, sri, opts) {
908223
908422
  opts = opts || Object.create(null);
908224
908423
  opts.integrity = sri;
908225
- sri = parse28(sri, opts);
908424
+ sri = parse29(sri, opts);
908226
908425
  if (!sri || !Object.keys(sri).length) {
908227
908426
  return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"), {
908228
908427
  code: "EINTEGRITY"
@@ -908458,7 +908657,7 @@ var require_polyfill = __commonJS((exports, module) => {
908458
908657
  dirname: dirname96,
908459
908658
  isAbsolute: isAbsolute42,
908460
908659
  join: join237,
908461
- parse: parse28,
908660
+ parse: parse29,
908462
908661
  resolve: resolve72,
908463
908662
  sep: sep46,
908464
908663
  toNamespacedPath
@@ -908563,7 +908762,7 @@ var require_polyfill = __commonJS((exports, module) => {
908563
908762
  async function checkParentPaths(src, srcStat, dest) {
908564
908763
  const srcParent = resolve72(dirname96(src));
908565
908764
  const destParent = resolve72(dirname96(dest));
908566
- if (destParent === srcParent || destParent === parse28(destParent).root) {
908765
+ if (destParent === srcParent || destParent === parse29(destParent).root) {
908567
908766
  return;
908568
908767
  }
908569
908768
  let destStat;
@@ -915295,10 +915494,66 @@ var init_useAfterFirstRender = __esm(() => {
915295
915494
  import_react307 = __toESM(require_react(), 1);
915296
915495
  });
915297
915496
 
915497
+ // src/hooks/deferredHookMessagesGate.ts
915498
+ class DeferredHookGate {
915499
+ pending;
915500
+ resolved = false;
915501
+ constructor(pending3) {
915502
+ this.pending = pending3 ?? null;
915503
+ if (!pending3)
915504
+ this.resolved = true;
915505
+ }
915506
+ async wait(timeoutMs = HOOK_WAIT_TIMEOUT_MS) {
915507
+ const promise4 = this.pending;
915508
+ if (this.resolved || !promise4)
915509
+ return null;
915510
+ let timer3;
915511
+ const timeout3 = new Promise((resolve72) => {
915512
+ timer3 = setTimeout(() => resolve72("timeout"), timeoutMs);
915513
+ });
915514
+ try {
915515
+ const outcome = await Promise.race([
915516
+ promise4.then(() => "done"),
915517
+ timeout3
915518
+ ]);
915519
+ if (outcome === "timeout") {
915520
+ if (this.resolved)
915521
+ return null;
915522
+ this.resolved = true;
915523
+ this.pending = null;
915524
+ logForDebugging(`SessionStart hooks did not complete within ${timeoutMs}ms; proceeding without hook context`, { level: "warn" });
915525
+ return null;
915526
+ }
915527
+ if (this.resolved)
915528
+ return null;
915529
+ this.resolved = true;
915530
+ this.pending = null;
915531
+ return await promise4;
915532
+ } finally {
915533
+ if (timer3)
915534
+ clearTimeout(timer3);
915535
+ }
915536
+ }
915537
+ takeBackgroundMessages(msgs) {
915538
+ if (this.resolved)
915539
+ return null;
915540
+ this.resolved = true;
915541
+ this.pending = null;
915542
+ return msgs;
915543
+ }
915544
+ }
915545
+ var HOOK_WAIT_TIMEOUT_MS = 3000;
915546
+ var init_deferredHookMessagesGate = __esm(() => {
915547
+ init_debug();
915548
+ });
915549
+
915298
915550
  // src/hooks/useDeferredHookMessages.ts
915299
915551
  function useDeferredHookMessages(pendingHookMessages, setMessages) {
915300
915552
  const pendingRef = import_react308.useRef(pendingHookMessages ?? null);
915301
- const resolvedRef = import_react308.useRef(!pendingHookMessages);
915553
+ const gateRef = import_react308.useRef(null);
915554
+ if (gateRef.current === null) {
915555
+ gateRef.current = new DeferredHookGate(pendingRef.current ?? undefined);
915556
+ }
915302
915557
  import_react308.useEffect(() => {
915303
915558
  const promise4 = pendingRef.current;
915304
915559
  if (!promise4)
@@ -915307,10 +915562,9 @@ function useDeferredHookMessages(pendingHookMessages, setMessages) {
915307
915562
  promise4.then((msgs) => {
915308
915563
  if (cancelled)
915309
915564
  return;
915310
- resolvedRef.current = true;
915311
- pendingRef.current = null;
915312
- if (msgs.length > 0) {
915313
- setMessages((prev) => [...msgs, ...prev]);
915565
+ const inject = gateRef.current.takeBackgroundMessages(msgs);
915566
+ if (inject && inject.length > 0) {
915567
+ setMessages((prev) => [...inject, ...prev]);
915314
915568
  }
915315
915569
  });
915316
915570
  return () => {
@@ -915318,20 +915572,15 @@ function useDeferredHookMessages(pendingHookMessages, setMessages) {
915318
915572
  };
915319
915573
  }, [setMessages]);
915320
915574
  return import_react308.useCallback(async () => {
915321
- if (resolvedRef.current || !pendingRef.current)
915322
- return;
915323
- const msgs = await pendingRef.current;
915324
- if (resolvedRef.current)
915325
- return;
915326
- resolvedRef.current = true;
915327
- pendingRef.current = null;
915328
- if (msgs.length > 0) {
915329
- setMessages((prev) => [...msgs, ...prev]);
915575
+ const inject = await gateRef.current.wait();
915576
+ if (inject && inject.length > 0) {
915577
+ setMessages((prev) => [...inject, ...prev]);
915330
915578
  }
915331
915579
  }, [setMessages]);
915332
915580
  }
915333
915581
  var import_react308;
915334
915582
  var init_useDeferredHookMessages = __esm(() => {
915583
+ init_deferredHookMessagesGate();
915335
915584
  import_react308 = __toESM(require_react(), 1);
915336
915585
  });
915337
915586
 
@@ -919705,7 +919954,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
919705
919954
  } catch {}
919706
919955
  const data = {
919707
919956
  trigger,
919708
- version: "4.2.35",
919957
+ version: "4.2.37",
919709
919958
  platform: process.platform,
919710
919959
  transcript,
919711
919960
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -920960,7 +921209,7 @@ function getReleaseType(current2, latest) {
920960
921209
  return "patch";
920961
921210
  }
920962
921211
  async function checkNewAutoUpdate(callbacks) {
920963
- const currentVersion = "4.2.35";
921212
+ const currentVersion = "4.2.37";
920964
921213
  logForDebugging(`[newAutoUpdater] checking, current: ${currentVersion}`);
920965
921214
  if (isNewAutoUpdaterDisabled()) {
920966
921215
  return { action: "skip", currentVersion, latestVersion: null };
@@ -924009,9 +924258,9 @@ function parseManifest(page) {
924009
924258
  throw new SnapshotInvalid(`unsupported contract version ${contractVersion}, expected ${SNAPSHOT_CONTRACT_VERSION}`);
924010
924259
  }
924011
924260
  const snapshotId = requireNonEmptyString(page, "snapshotId", "snapshot");
924012
- const generation = requireInteger(page, "generation", "snapshot");
924013
- if (generation < 1) {
924014
- throw new SnapshotInvalid(`generation ${generation} must be >= 1`);
924261
+ const generation2 = requireInteger(page, "generation", "snapshot");
924262
+ if (generation2 < 1) {
924263
+ throw new SnapshotInvalid(`generation ${generation2} must be >= 1`);
924015
924264
  }
924016
924265
  const generatedAt = requireString2(page, "generatedAt", "snapshot");
924017
924266
  const pageCount = requireInteger(page, "pageCount", "snapshot");
@@ -924033,7 +924282,7 @@ function parseManifest(page) {
924033
924282
  return {
924034
924283
  contractVersion,
924035
924284
  snapshotId,
924036
- generation,
924285
+ generation: generation2,
924037
924286
  generatedAt,
924038
924287
  pageCount,
924039
924288
  itemCount,
@@ -924277,15 +924526,15 @@ function parseConsumerMarker(value) {
924277
924526
  if (typeof value !== "object" || value === null)
924278
924527
  return;
924279
924528
  const record5 = value;
924280
- const generation = record5.generation;
924529
+ const generation2 = record5.generation;
924281
924530
  const snapshotId = record5.snapshotId;
924282
- if (typeof generation !== "number" || !Number.isSafeInteger(generation)) {
924531
+ if (typeof generation2 !== "number" || !Number.isSafeInteger(generation2)) {
924283
924532
  return;
924284
924533
  }
924285
924534
  if (typeof snapshotId !== "string" || snapshotId.length === 0)
924286
924535
  return;
924287
924536
  return {
924288
- generation,
924537
+ generation: generation2,
924289
924538
  snapshotId,
924290
924539
  appliedAt: typeof record5.appliedAt === "string" ? record5.appliedAt : "",
924291
924540
  everApplied: record5.everApplied === true
@@ -933217,7 +933466,7 @@ function WelcomeV2() {
933217
933466
  dimColor: true,
933218
933467
  children: [
933219
933468
  "v",
933220
- "4.2.35",
933469
+ "4.2.37",
933221
933470
  " "
933222
933471
  ]
933223
933472
  })
@@ -933283,7 +933532,7 @@ function WelcomeV2() {
933283
933532
  dimColor: true,
933284
933533
  children: [
933285
933534
  "v",
933286
- "4.2.35",
933535
+ "4.2.37",
933287
933536
  " "
933288
933537
  ]
933289
933538
  })
@@ -933385,7 +933634,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
933385
933634
  dimColor: true,
933386
933635
  children: [
933387
933636
  "v",
933388
- "4.2.35",
933637
+ "4.2.37",
933389
933638
  " "
933390
933639
  ]
933391
933640
  })
@@ -933451,7 +933700,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
933451
933700
  dimColor: true,
933452
933701
  children: [
933453
933702
  "v",
933454
- "4.2.35",
933703
+ "4.2.37",
933455
933704
  " "
933456
933705
  ]
933457
933706
  })
@@ -934391,7 +934640,7 @@ function completeOnboarding() {
934391
934640
  saveGlobalConfig((current2) => ({
934392
934641
  ...current2,
934393
934642
  hasCompletedOnboarding: true,
934394
- lastOnboardingVersion: "4.2.35"
934643
+ lastOnboardingVersion: "4.2.37"
934395
934644
  }));
934396
934645
  }
934397
934646
  function showDialog(root9, renderer) {
@@ -939852,7 +940101,7 @@ function registerMcpAddCommand(mcp2) {
939852
940101
  }
939853
940102
  try {
939854
940103
  const scope = ensureConfigScope(options.scope);
939855
- const transport = ensureTransport(options.transport);
940104
+ const transport2 = ensureTransport(options.transport);
939856
940105
  if (options.xaa && !isXaaEnabled()) {
939857
940106
  cliError(t("mcp.addErrorXaa"));
939858
940107
  }
@@ -939873,14 +940122,14 @@ function registerMcpAddCommand(mcp2) {
939873
940122
  const transportExplicit = options.transport !== undefined;
939874
940123
  const looksLikeUrl = actualCommand.startsWith("http://") || actualCommand.startsWith("https://") || actualCommand.startsWith("localhost") || actualCommand.endsWith("/sse") || actualCommand.endsWith("/mcp");
939875
940124
  logEvent("tengu_mcp_add", {
939876
- type: transport,
940125
+ type: transport2,
939877
940126
  scope,
939878
940127
  source: "command",
939879
- transport,
940128
+ transport: transport2,
939880
940129
  transportExplicit,
939881
940130
  looksLikeUrl
939882
940131
  });
939883
- if (transport === "sse") {
940132
+ if (transport2 === "sse") {
939884
940133
  if (!actualCommand) {
939885
940134
  cliError(t("mcp.addErrorSseUrlRequired"));
939886
940135
  }
@@ -939908,7 +940157,7 @@ function registerMcpAddCommand(mcp2) {
939908
940157
  process.stdout.write(t("mcp.addLabelHeaders", { json: jsonStringify(headers, null, 2) }) + `
939909
940158
  `);
939910
940159
  }
939911
- } else if (transport === "http") {
940160
+ } else if (transport2 === "http") {
939912
940161
  if (!actualCommand) {
939913
940162
  cliError(t("mcp.addErrorHttpUrlRequired"));
939914
940163
  }
@@ -941958,7 +942207,7 @@ function peekTable(key6, table, meta6, type) {
941958
942207
  }
941959
942208
  return [k9, t2, state4.c];
941960
942209
  }
941961
- function parse28(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
942210
+ function parse29(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
941962
942211
  let res = {};
941963
942212
  let meta6 = {};
941964
942213
  let tbl = res;
@@ -942139,7 +942388,7 @@ async function validateSyntax(absPath, deps = prodDeps2) {
942139
942388
  }
942140
942389
  if (ext === ".toml") {
942141
942390
  try {
942142
- parse28(readFileSync47(absPath, "utf8"));
942391
+ parse29(readFileSync47(absPath, "utf8"));
942143
942392
  } catch (error100) {
942144
942393
  const { line, column } = error100;
942145
942394
  const position3 = typeof line === "number" && typeof column === "number" ? `line ${line}, col ${column}: ` : "";
@@ -943740,10 +943989,11 @@ var startSdkMemoryMonitor = () => {};
943740
943989
  var init_sdkHeapDumpMonitor = () => {};
943741
943990
 
943742
943991
  // src/entrypoints/sdk/controlSchemas.ts
943743
- var JSONRPCMessagePlaceholder, SDKHookCallbackMatcherSchema, SDKControlInitializeRequestSchema, SDKControlInitializeResponseSchema, SDKControlInterruptRequestSchema, SDKControlPermissionRequestSchema, SDKControlSetPermissionModeRequestSchema, SDKControlSetModelRequestSchema, SDKControlSetAgentRequestSchema, SDKControlSetMaxThinkingTokensRequestSchema, SDKControlMcpStatusRequestSchema, SDKControlMcpStatusResponseSchema, SDKControlGetContextUsageRequestSchema, ContextCategorySchema, ContextGridSquareSchema, SDKControlGetContextUsageResponseSchema, SDKControlRewindFilesRequestSchema, SDKControlRewindFilesResponseSchema, SDKControlCancelAsyncMessageRequestSchema, SDKControlCancelAsyncMessageResponseSchema, SDKControlSeedReadStateRequestSchema, SDKHookCallbackRequestSchema, SDKControlMcpMessageRequestSchema, SDKControlMcpSetServersRequestSchema, SDKControlMcpSetServersResponseSchema, SDKControlReloadPluginsRequestSchema, SDKControlReloadPluginsResponseSchema, SDKControlMcpReconnectRequestSchema, SDKControlMcpToggleRequestSchema, SDKControlStopTaskRequestSchema, SDKControlApplyFlagSettingsRequestSchema, SDKControlGetSettingsRequestSchema, SDKControlGetSettingsResponseSchema, SDKControlElicitationRequestSchema, SDKControlElicitationResponseSchema, SDKControlRequestInnerSchema, SDKControlRequestSchema, ControlResponseSchema, ControlErrorResponseSchema, SDKControlResponseSchema, SDKControlCancelRequestSchema, SDKKeepAliveMessageSchema, SDKUpdateEnvironmentVariablesMessageSchema, StdoutMessageSchema, StdinMessageSchema;
943992
+ var JSONRPCMessagePlaceholder, SDKHookCallbackMatcherSchema, SDKControlInitializeRequestSchema, SDKControlInitializeResponseSchema, SDKControlInterruptRequestSchema, SDKControlPermissionRequestSchema, SDKControlSetPermissionModeRequestSchema, SDKControlSetModelRequestSchema, SDKControlSetAgentRequestSchema, SDKControlSetMaxThinkingTokensRequestSchema, SDKControlMcpStatusRequestSchema, SDKControlMcpStatusResponseSchema, SDKControlGetContextUsageRequestSchema, ContextCategorySchema, ContextGridSquareSchema, SDKControlGetContextUsageResponseSchema, SDKControlRewindFilesRequestSchema, SDKControlRewindFilesResponseSchema, SDKControlCancelAsyncMessageRequestSchema, SDKControlCancelAsyncMessageResponseSchema, SDKControlSeedReadStateRequestSchema, SDKHookCallbackRequestSchema, SDKControlMcpMessageRequestSchema, SDKControlMcpSetServersRequestSchema, SDKControlIdeMcpSetRequestSchema, SDKControlIdeMcpClearRequestSchema, SDKControlMcpSetServersResponseSchema, SDKControlReloadPluginsRequestSchema, SDKControlReloadPluginsResponseSchema, SDKControlMcpReconnectRequestSchema, SDKControlMcpToggleRequestSchema, SDKControlStopTaskRequestSchema, SDKControlApplyFlagSettingsRequestSchema, SDKControlGetSettingsRequestSchema, SDKControlGetSettingsResponseSchema, SDKControlElicitationRequestSchema, SDKControlElicitationResponseSchema, SDKControlRequestInnerSchema, SDKControlRequestSchema, ControlResponseSchema, ControlErrorResponseSchema, SDKControlResponseSchema, SDKControlCancelRequestSchema, SDKKeepAliveMessageSchema, SDKUpdateEnvironmentVariablesMessageSchema, StdoutMessageSchema, StdinMessageSchema;
943744
943993
  var init_controlSchemas = __esm(() => {
943745
943994
  init_v4();
943746
943995
  init_coreSchemas();
943996
+ init_ideCapability();
943747
943997
  JSONRPCMessagePlaceholder = lazySchema(() => exports_external.unknown());
943748
943998
  SDKHookCallbackMatcherSchema = lazySchema(() => exports_external.object({
943749
943999
  matcher: exports_external.string().optional(),
@@ -943934,6 +944184,8 @@ var init_controlSchemas = __esm(() => {
943934
944184
  subtype: exports_external.literal("mcp_set_servers"),
943935
944185
  servers: exports_external.record(exports_external.string(), McpServerConfigForProcessTransportSchema())
943936
944186
  }).describe("Replaces the set of dynamically managed MCP servers."));
944187
+ SDKControlIdeMcpSetRequestSchema = lazySchema(() => exports_external.object({ subtype: exports_external.literal("ide_mcp_set"), capability: IdeCapabilitySchema() }));
944188
+ SDKControlIdeMcpClearRequestSchema = lazySchema(() => exports_external.object({ subtype: exports_external.literal("ide_mcp_clear"), generation: exports_external.string().uuid() }));
943937
944189
  SDKControlMcpSetServersResponseSchema = lazySchema(() => exports_external.object({
943938
944190
  added: exports_external.array(exports_external.string()),
943939
944191
  removed: exports_external.array(exports_external.string()),
@@ -944019,6 +944271,8 @@ var init_controlSchemas = __esm(() => {
944019
944271
  SDKControlCancelAsyncMessageRequestSchema(),
944020
944272
  SDKControlSeedReadStateRequestSchema(),
944021
944273
  SDKControlMcpSetServersRequestSchema(),
944274
+ SDKControlIdeMcpSetRequestSchema(),
944275
+ SDKControlIdeMcpClearRequestSchema(),
944022
944276
  SDKControlReloadPluginsRequestSchema(),
944023
944277
  SDKControlMcpReconnectRequestSchema(),
944024
944278
  SDKControlMcpToggleRequestSchema(),
@@ -944988,7 +945242,7 @@ class CCRClient {
944988
945242
  deliveryUploader;
944989
945243
  onEpochMismatch;
944990
945244
  getAuthHeaders;
944991
- constructor(transport, sessionUrl, opts) {
945245
+ constructor(transport2, sessionUrl, opts) {
944992
945246
  this.onEpochMismatch = opts?.onEpochMismatch ?? (() => {
944993
945247
  process.exit(1);
944994
945248
  });
@@ -945054,7 +945308,7 @@ class CCRClient {
945054
945308
  maxDelayMs: 30000,
945055
945309
  jitterMs: 500
945056
945310
  });
945057
- transport.setOnEvent((event) => {
945311
+ transport2.setOnEvent((event) => {
945058
945312
  this.reportDelivery(event.event_id, "received");
945059
945313
  });
945060
945314
  }
@@ -947187,10 +947441,11 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands11, tools, initi
947187
947441
  tools: [],
947188
947442
  configs: {}
947189
947443
  };
947444
+ let ideMcpState = { tools: [] };
947190
947445
  let warnedInvalidInitJsonSchema = false;
947191
947446
  const buildAllTools = (appState) => {
947192
947447
  const assembledTools = assembleToolPool(appState.toolPermissionContext, appState.mcp.tools);
947193
- let allTools = uniqBy_default(mergeAndFilterTools([...tools, ...sdkTools, ...dynamicMcpState.tools], assembledTools, appState.toolPermissionContext.mode), "name");
947448
+ let allTools = uniqBy_default(mergeAndFilterTools([...tools, ...sdkTools, ...dynamicMcpState.tools, ...ideMcpState.tools], assembledTools, appState.toolPermissionContext.mode), "name");
947194
947449
  if (options.permissionPromptToolName) {
947195
947450
  allTools = allTools.filter((tool) => !toolMatchesName(tool, options.permissionPromptToolName));
947196
947451
  }
@@ -948202,6 +948457,38 @@ ${m4.text}
948202
948457
  if (sdkServersChanged) {
948203
948458
  updateSdkMcp();
948204
948459
  }
948460
+ } else if (msg.request.subtype === "ide_mcp_set") {
948461
+ const capability = msg.request.capability;
948462
+ const policy = getIdeMcpPolicy();
948463
+ setIdeMcpPolicy(capability.generation, new Set(capability.tools));
948464
+ const config13 = { type: "http", url: capability.transport.url, headers: capability.transport.headers, scope: "dynamic" };
948465
+ const staged = await prefetchAllMcpResources({ [IDE_MCP_SERVER]: config13 });
948466
+ const client10 = staged.clients.find((value) => value.name === IDE_MCP_SERVER && value.type === "connected");
948467
+ if (!client10) {
948468
+ setIdeMcpPolicy(policy.generation, policy.tools);
948469
+ sendControlResponseSuccess(msg, { generation: capability.generation, accepted: false, tools: [], errors: ["connection_failed"] });
948470
+ } else {
948471
+ const previous = ideMcpState;
948472
+ const accepted = staged.tools.map((tool) => tool.mcpInfo?.toolName).filter((name3) => !!name3);
948473
+ ideMcpState = { generation: capability.generation, config: config13, client: client10, tools: staged.tools };
948474
+ sendControlResponseSuccess(msg, { generation: capability.generation, accepted: true, tools: accepted, errors: [] });
948475
+ if (previous.client?.type === "connected")
948476
+ await previous.client.cleanup();
948477
+ if (previous.config)
948478
+ await clearServerCache(IDE_MCP_SERVER, previous.config);
948479
+ }
948480
+ } else if (msg.request.subtype === "ide_mcp_clear") {
948481
+ const generation2 = msg.request.generation;
948482
+ const cleared = ideMcpState.generation === generation2 && clearIdeMcpPolicy(generation2);
948483
+ if (cleared) {
948484
+ const previous = ideMcpState;
948485
+ ideMcpState = { tools: [] };
948486
+ if (previous.client?.type === "connected")
948487
+ await previous.client.cleanup();
948488
+ if (previous.config)
948489
+ await clearServerCache(IDE_MCP_SERVER, previous.config);
948490
+ }
948491
+ sendControlResponseSuccess(msg, { generation: generation2, cleared });
948205
948492
  } else if (msg.request.subtype === "reload_plugins") {
948206
948493
  try {
948207
948494
  if (false) {}
@@ -949677,6 +949964,8 @@ var init_print = __esm(() => {
949677
949964
  init_hooks5();
949678
949965
  init_types16();
949679
949966
  init_mcpStringUtils();
949967
+ init_idePolicy();
949968
+ init_ideCapability();
949680
949969
  init_utils13();
949681
949970
  init_vscodeSdkMcp();
949682
949971
  init_config5();
@@ -950818,7 +951107,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
950818
951107
  setCwd(cwd3);
950819
951108
  const server2 = new Server({
950820
951109
  name: "claude/tengu",
950821
- version: "4.2.35"
951110
+ version: "4.2.37"
950822
951111
  }, {
950823
951112
  capabilities: {
950824
951113
  tools: {}
@@ -950915,8 +951204,8 @@ async function startMCPServer(cwd3, debug5, verbose) {
950915
951204
  }
950916
951205
  });
950917
951206
  async function runServer() {
950918
- const transport = new StdioServerTransport;
950919
- await server2.connect(transport);
951207
+ const transport2 = new StdioServerTransport;
951208
+ await server2.connect(transport2);
950920
951209
  }
950921
951210
  return await runServer();
950922
951211
  }
@@ -953103,7 +953392,7 @@ function createHealthRoutes(sessionManager) {
953103
953392
  const uptime2 = process.uptime() * 1000;
953104
953393
  return c10.json({
953105
953394
  status: "ok",
953106
- version: "4.2.35",
953395
+ version: "4.2.37",
953107
953396
  uptime_ms: Math.round(uptime2),
953108
953397
  active_sessions: sessionManager.getActiveCount()
953109
953398
  });
@@ -953375,7 +953664,7 @@ function getMacroDefines() {
953375
953664
  commit = execSync3("git rev-parse --short HEAD", { encoding: "utf-8", cwd: __dirname }).trim();
953376
953665
  } catch {}
953377
953666
  return {
953378
- "MACRO.VERSION": JSON.stringify("4.2.35"),
953667
+ "MACRO.VERSION": JSON.stringify("4.2.37"),
953379
953668
  "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
953380
953669
  "MACRO.COMMIT": JSON.stringify(commit),
953381
953670
  "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),
@@ -954323,6 +954612,7 @@ function createSessionRoutes(sessionManager, eventBus) {
954323
954612
  resumeSessionAt: body.resume_session_at,
954324
954613
  hooks: body.hooks,
954325
954614
  env: env9,
954615
+ client: c10.req.header("x-csc-session-client"),
954326
954616
  execPath: process.execPath,
954327
954617
  scriptArgs: getScriptArgsForChild()
954328
954618
  });
@@ -954349,6 +954639,7 @@ function createSessionRoutes(sessionManager, eventBus) {
954349
954639
  const limit2 = parseInt(url5.searchParams.get("limit") ?? "50", 10);
954350
954640
  const offset = parseInt(url5.searchParams.get("offset") ?? "0", 10);
954351
954641
  const headerDir = c10.req.header("x-csc-directory");
954642
+ const client10 = c10.req.header("x-csc-session-client");
954352
954643
  const dir = (headerDir ? decodeURIComponent(headerDir) : undefined) ?? url5.searchParams.get("dir") ?? undefined;
954353
954644
  const canonicalDir = dir ? await canonicalizePath(dir).catch(() => dir) : undefined;
954354
954645
  let historySessions = [];
@@ -954356,7 +954647,10 @@ function createSessionRoutes(sessionManager, eventBus) {
954356
954647
  historySessions = await listSessionsImpl({ dir, limit: limit2 + offset });
954357
954648
  } catch {}
954358
954649
  const handleMap = new Map(sessionManager.getAllSessions().map((h8) => [h8.sessionId, h8]));
954359
- const merged = historySessions.map((s) => {
954650
+ const entries = sessionManager.getIndexEntries();
954651
+ const indexMap = new Map(entries.map((entry) => [entry.sessionId, entry]));
954652
+ const owned = (id) => !client10 || handleMap.get(id)?.client === client10 || indexMap.get(id)?.client === client10;
954653
+ const merged = historySessions.filter((s) => owned(s.sessionId)).map((s) => {
954360
954654
  const handle = handleMap.get(s.sessionId);
954361
954655
  const info2 = handle?.getInfo();
954362
954656
  return {
@@ -954388,6 +954682,8 @@ function createSessionRoutes(sessionManager, eventBus) {
954388
954682
  for (const handle of sessionManager.getAllSessions()) {
954389
954683
  if (!handle.prompted)
954390
954684
  continue;
954685
+ if (!owned(handle.sessionId))
954686
+ continue;
954391
954687
  if (!historyIds.has(handle.sessionId)) {
954392
954688
  if (canonicalDir) {
954393
954689
  const handleCwd = await canonicalizePath(handle.cwd).catch(() => handle.cwd);
@@ -954404,9 +954700,11 @@ function createSessionRoutes(sessionManager, eventBus) {
954404
954700
  historyIds.add(handle.sessionId);
954405
954701
  }
954406
954702
  }
954407
- for (const entry of sessionManager.getIndexEntries()) {
954703
+ for (const entry of entries) {
954408
954704
  if (historyIds.has(entry.sessionId))
954409
954705
  continue;
954706
+ if (!owned(entry.sessionId))
954707
+ continue;
954410
954708
  if (canonicalDir) {
954411
954709
  const entryCwd = await canonicalizePath(entry.cwd).catch(() => entry.cwd);
954412
954710
  if (entryCwd !== canonicalDir)
@@ -954605,7 +954903,9 @@ function createSessionRoutes(sessionManager, eventBus) {
954605
954903
  if (!transcriptPath) {
954606
954904
  for (const projectsDir of getAllProjectsDirs()) {
954607
954905
  try {
954608
- const dirents = await readdir55(projectsDir, { withFileTypes: true });
954906
+ const dirents = await readdir55(projectsDir, {
954907
+ withFileTypes: true
954908
+ });
954609
954909
  for (const dirent of dirents) {
954610
954910
  if (!dirent.isDirectory())
954611
954911
  continue;
@@ -957673,6 +957973,38 @@ var init_config13 = __esm(() => {
957673
957973
  DEFAULT_OUTPUT_STYLE_OPTIONS = ["default", "Explanatory", "Learning"];
957674
957974
  });
957675
957975
 
957976
+ // src/server/routes/ideCapability.ts
957977
+ function createIdeCapabilityRoutes(manager3) {
957978
+ return new Hono2().put("/session/:sessionID/capabilities/ide", async (c10) => {
957979
+ const handle = manager3.getSession(c10.req.param("sessionID"));
957980
+ if (!handle)
957981
+ return c10.json({ error: "Session not found" }, 404);
957982
+ const parsed = IdeCapabilitySchema().safeParse(await c10.req.json().catch(() => null));
957983
+ if (!parsed.success)
957984
+ return c10.json({ error: parsed.error.message }, 400);
957985
+ try {
957986
+ return c10.json(await handle.setIdeCapability(parsed.data));
957987
+ } catch (error100) {
957988
+ return c10.json({ error: error100 instanceof Error ? error100.message : String(error100) }, 502);
957989
+ }
957990
+ }).delete("/session/:sessionID/capabilities/ide", async (c10) => {
957991
+ const generation2 = c10.req.query("generation");
957992
+ if (!generation2)
957993
+ return c10.json({ error: "generation is required" }, 400);
957994
+ if (!manager3.getSession(c10.req.param("sessionID")))
957995
+ return c10.json({ generation: generation2, cleared: false });
957996
+ try {
957997
+ return c10.json(await manager3.getSession(c10.req.param("sessionID")).clearIdeCapability(generation2));
957998
+ } catch (error100) {
957999
+ return c10.json({ error: error100 instanceof Error ? error100.message : String(error100) }, 502);
958000
+ }
958001
+ });
958002
+ }
958003
+ var init_ideCapability2 = __esm(() => {
958004
+ init_dist17();
958005
+ init_ideCapability();
958006
+ });
958007
+
957676
958008
  // src/server/server.ts
957677
958009
  var exports_server = {};
957678
958010
  __export(exports_server, {
@@ -957706,6 +958038,7 @@ function startServer(config13, sessionManager, eventBus) {
957706
958038
  app.route("/", createFindRoutes());
957707
958039
  app.route("/", createFavoriteRoutes());
957708
958040
  app.route("/", createConfigRoutes({ initDataProvider: sessionManager }));
958041
+ app.route("/", createIdeCapabilityRoutes(sessionManager));
957709
958042
  const server2 = Bun.serve({
957710
958043
  hostname: config13.host,
957711
958044
  port: config13.port,
@@ -957730,6 +958063,7 @@ var init_server5 = __esm(() => {
957730
958063
  init_find();
957731
958064
  init_favorite2();
957732
958065
  init_config13();
958066
+ init_ideCapability2();
957733
958067
  });
957734
958068
 
957735
958069
  // src/server/eventBus.ts
@@ -958104,6 +958438,7 @@ var init_sessionHandle = __esm(() => {
958104
958438
  return this._sessionId;
958105
958439
  }
958106
958440
  cwd;
958441
+ client;
958107
958442
  _silent;
958108
958443
  _prompted = false;
958109
958444
  _spawnCwd;
@@ -958270,6 +958605,7 @@ var init_sessionHandle = __esm(() => {
958270
958605
  this.opts = opts;
958271
958606
  this._sessionId = opts.sessionId;
958272
958607
  this.cwd = opts.cwd;
958608
+ this.client = opts.client;
958273
958609
  this._silent = opts.silent ?? false;
958274
958610
  this.eventBus = opts.eventBus;
958275
958611
  this._model = opts.model;
@@ -958719,6 +959055,25 @@ ${stderrTail}` : baseMessage;
958719
959055
  const response3 = await this.sendControlRequest({ subtype: "mcp_status" });
958720
959056
  return response3.mcpServers ?? [];
958721
959057
  }
959058
+ async setIdeCapability(input5) {
959059
+ const response3 = await this.sendControlRequest({
959060
+ subtype: "ide_mcp_set",
959061
+ capability: input5
959062
+ });
959063
+ return {
959064
+ generation: input5.generation,
959065
+ accepted: response3.accepted === true,
959066
+ tools: Array.isArray(response3.tools) ? response3.tools : [],
959067
+ errors: Array.isArray(response3.errors) ? response3.errors : []
959068
+ };
959069
+ }
959070
+ async clearIdeCapability(generation2) {
959071
+ const response3 = await this.sendControlRequest({
959072
+ subtype: "ide_mcp_clear",
959073
+ generation: generation2
959074
+ });
959075
+ return { generation: generation2, cleared: response3.cleared === true };
959076
+ }
958722
959077
  async prompt(content, opts) {
958723
959078
  if (this._status === "stopped") {
958724
959079
  throw new Error(`Session ${this.sessionId} is stopped`);
@@ -959158,7 +959513,8 @@ class SessionManager {
959158
959513
  permissionMode: info2.permission_mode,
959159
959514
  createdAt: info2.created_at,
959160
959515
  lastActiveAt: info2.last_active_at,
959161
- customTitle: handle.title
959516
+ customTitle: handle.title,
959517
+ client: handle.client
959162
959518
  };
959163
959519
  }
959164
959520
  reapHandle(handle) {
@@ -959350,6 +959706,7 @@ class SessionManager {
959350
959706
  }
959351
959707
  const realSessionId = warm.sessionId;
959352
959708
  warm.claimFromWarmPool();
959709
+ warm.client = opts.client;
959353
959710
  this.sessions.set(realSessionId, warm);
959354
959711
  this.eventBus.registerSessionCwd(realSessionId, canonicalCwd);
959355
959712
  this.eventBus.publishSessionEvent(realSessionId, "created", {
@@ -959380,6 +959737,7 @@ class SessionManager {
959380
959737
  scriptArgs: opts.scriptArgs,
959381
959738
  silent: opts.silent,
959382
959739
  customTitle: this.loadedIndex.get(sessionId2)?.customTitle,
959740
+ client: opts.client ?? this.loadedIndex.get(sessionId2)?.client,
959383
959741
  onInit: (data) => {
959384
959742
  this._cachedInitData = data;
959385
959743
  this._resolveInitDataReady?.();
@@ -960444,7 +960802,7 @@ __export(exports_update, {
960444
960802
  });
960445
960803
  async function update() {
960446
960804
  logEvent("tengu_update_check", {});
960447
- writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.35"}
960805
+ writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.37"}
960448
960806
  `);
960449
960807
  const channel5 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
960450
960808
  writeToStdout(`${t("cli.update.checkingUpdates", { channel: channel5 }, "Checking for updates to {channel} version...")}
@@ -960519,8 +960877,8 @@ async function update() {
960519
960877
  writeToStdout(`${t("cli.update.managedByHomebrew", "CoStrict is managed by Homebrew.")}
960520
960878
  `);
960521
960879
  const latest = await getLatestVersion(channel5);
960522
- if (latest && !gte2("4.2.35", latest)) {
960523
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.35", latest }, "Update available: {current} \u2192 {latest}")}
960880
+ if (latest && !gte2("4.2.37", latest)) {
960881
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.37", latest }, "Update available: {current} \u2192 {latest}")}
960524
960882
  `);
960525
960883
  writeToStdout(`
960526
960884
  `);
@@ -960536,8 +960894,8 @@ async function update() {
960536
960894
  writeToStdout(`${t("cli.update.managedByWinget", "CoStrict is managed by winget.")}
960537
960895
  `);
960538
960896
  const latest = await getLatestVersion(channel5);
960539
- if (latest && !gte2("4.2.35", latest)) {
960540
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.35", latest }, "Update available: {current} \u2192 {latest}")}
960897
+ if (latest && !gte2("4.2.37", latest)) {
960898
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.37", latest }, "Update available: {current} \u2192 {latest}")}
960541
960899
  `);
960542
960900
  writeToStdout(`
960543
960901
  `);
@@ -960553,8 +960911,8 @@ async function update() {
960553
960911
  writeToStdout(`${t("cli.update.managedByApk", "CoStrict is managed by apk.")}
960554
960912
  `);
960555
960913
  const latest = await getLatestVersion(channel5);
960556
- if (latest && !gte2("4.2.35", latest)) {
960557
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.35", latest }, "Update available: {current} \u2192 {latest}")}
960914
+ if (latest && !gte2("4.2.37", latest)) {
960915
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.37", latest }, "Update available: {current} \u2192 {latest}")}
960558
960916
  `);
960559
960917
  writeToStdout(`
960560
960918
  `);
@@ -960619,11 +960977,11 @@ async function update() {
960619
960977
  `);
960620
960978
  await gracefulShutdown(1);
960621
960979
  }
960622
- if (result2.latestVersion === "4.2.35") {
960623
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.35" }, "CoStrict is up to date ({version})")) + `
960980
+ if (result2.latestVersion === "4.2.37") {
960981
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.37" }, "CoStrict is up to date ({version})")) + `
960624
960982
  `);
960625
960983
  } else {
960626
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.35", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960984
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.37", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960627
960985
  `);
960628
960986
  regenerateCompletionCache();
960629
960987
  }
@@ -960683,12 +961041,12 @@ async function update() {
960683
961041
  `);
960684
961042
  await gracefulShutdown(1);
960685
961043
  }
960686
- if (latestVersion === "4.2.35") {
960687
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.35" }, "CoStrict is up to date ({version})")) + `
961044
+ if (latestVersion === "4.2.37") {
961045
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.37" }, "CoStrict is up to date ({version})")) + `
960688
961046
  `);
960689
961047
  await gracefulShutdown(0);
960690
961048
  }
960691
- writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.35" }, "New version available: {latest} (current: {current})")}
961049
+ writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.37" }, "New version available: {latest} (current: {current})")}
960692
961050
  `);
960693
961051
  writeToStdout(`${t("cli.update.installing", "Installing update...")}
960694
961052
  `);
@@ -960733,7 +961091,7 @@ async function update() {
960733
961091
  logForDebugging(`update: Installation status: ${result.status}`);
960734
961092
  switch (result.status) {
960735
961093
  case "success":
960736
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.35", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
961094
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.37", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960737
961095
  `);
960738
961096
  regenerateCompletionCache();
960739
961097
  break;
@@ -962028,9 +962386,9 @@ async function run5() {
962028
962386
  return Number.isFinite(n3) ? n3 : undefined;
962029
962387
  }).hideHelp()).addOption(new Option("--from-pr [value]", cliDesc("cli.option.fromPr", "Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term")).argParser((value) => value || true).hideHelp()).addOption(new Option("--no-session-persistence", cliDesc("cli.option.noSessionPersistence", "Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)")).hideHelp()).addOption(new Option("--resume-session-at <message id>", cliDesc("cli.option.resumeSessionAt", "When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)")).argParser(String).hideHelp()).addOption(new Option("--rewind-files <user-message-id>", cliDesc("cli.option.rewindFiles", "Restore files to state at the specified user message and exit (requires --resume)")).hideHelp()).option("--model <model>", cliDesc("cli.option.model", `Model for the current session. Provide a model's full name (e.g. 'GLM-5.1').`)).addOption(new Option("--effort <level>", cliDesc("cli.option.effortArg", "Effort level for the current session (low, medium, high, max)")).argParser((rawValue) => {
962030
962388
  const value = rawValue.toLowerCase();
962031
- const allowed = ["low", "medium", "high", "max"];
962032
- if (!allowed.includes(value)) {
962033
- throw new InvalidArgumentError(`It must be one of: ${allowed.join(", ")}`);
962389
+ const allowed2 = ["low", "medium", "high", "max"];
962390
+ if (!allowed2.includes(value)) {
962391
+ throw new InvalidArgumentError(`It must be one of: ${allowed2.join(", ")}`);
962034
962392
  }
962035
962393
  return value;
962036
962394
  }).hideHelp()).option("--agent <agent>", cliDesc("cli.option.agent", `Agent for the current session. Overrides the 'agent' setting.`)).addOption(new Option("--betas <betas...>", cliDesc("cli.option.betas", "Beta headers to include in API requests (API key users only)")).hideHelp()).addOption(new Option("--fallback-model <model>", cliDesc("cli.option.fallbackModel", "Enable automatic fallback to specified model when default model is overloaded (only works with --print)")).hideHelp()).addOption(new Option("--workload <tag>", cliDesc("cli.option.workload", "Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)")).hideHelp()).option("--settings <file-or-json>", cliDesc("cli.option.settings", "Path to a settings JSON file or a JSON string to load additional settings from")).option("--add-dir <directories...>", cliDesc("cli.option.addDir", "Additional directories to allow tool access to")).addOption(new Option("--ide", cliDesc("cli.option.ide", "Automatically connect to IDE on startup if exactly one valid IDE is available")).argParser(() => true).hideHelp()).addOption(new Option("--strict-mcp-config", cliDesc("cli.option.strictMcpConfig", "Only use MCP servers from --mcp-config, ignoring all other MCP configurations")).argParser(() => true).hideHelp()).addOption(new Option("--session-id <uuid>", cliDesc("cli.option.sessionIdArg", "Use a specific session ID for the conversation (must be a valid UUID)")).hideHelp()).addOption(new Option("-n, --name <name>", cliDesc("cli.option.name", "Set a display name for this session (shown in /resume and terminal title)")).hideHelp()).addOption(new Option("--agents <json>", cliDesc("cli.option.agents", `JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`)).hideHelp()).addOption(new Option("--setting-sources <sources>", cliDesc("cli.option.settingSources", "Comma-separated list of setting sources to load (user, project, local).")).hideHelp()).addOption(new Option("--plugin-dir <path>", cliDesc("cli.option.pluginDir", "Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)")).argParser((val, prev) => [...prev, val]).default([]).hideHelp()).addOption(new Option("-H, --header <header>", cliDesc("cli.option.header", 'Add a custom HTTP header to model API requests, format "Name: Value" (repeatable: -H "X-API-Key: sk-..." -H "X-Task-Id: task-..."). Also configurable via the COSTRICT_CUSTOM_HEADERS env var')).argParser((val, prev) => [...prev, val]).default([])).addOption(new Option("--disable-slash-commands", cliDesc("cli.option.disableSlashCommands", "Disable all skills")).argParser(() => true).hideHelp()).addOption(new Option("--chrome", cliDesc("cli.option.chrome", "Enable Chrome MCP integration")).hideHelp()).addOption(new Option("--no-chrome", cliDesc("cli.option.noChrome", "Disable Chrome MCP integration")).hideHelp()).addOption(new Option("--file <specs...>", cliDesc("cli.option.file", "File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)")).hideHelp()).action(async (prompt, options) => {
@@ -962380,13 +962738,13 @@ ${addendum}` : addendum;
962380
962738
  ...config13,
962381
962739
  scope: "dynamic"
962382
962740
  }));
962383
- const { allowed, blocked } = filterMcpServersByPolicy(scopedConfigs);
962741
+ const { allowed: allowed2, blocked } = filterMcpServersByPolicy(scopedConfigs);
962384
962742
  if (blocked.length > 0) {
962385
962743
  process.stderr.write(cliDesc("errors.cli.mcpBlockedByPolicy", `Warning: MCP ${plural(blocked.length, "server")} blocked by enterprise policy: ${blocked.join(", ")}
962386
962744
  `).replace("{serverOrServers}", plural(blocked.length, "server")).replace("{servers}", blocked.join(", ")));
962387
962745
  }
962388
- dynamicMcpConfig = { ...dynamicMcpConfig, ...allowed };
962389
- const dynamicServerNames = Object.keys(allowed);
962746
+ dynamicMcpConfig = { ...dynamicMcpConfig, ...allowed2 };
962747
+ const dynamicServerNames = Object.keys(allowed2);
962390
962748
  logForDebugging(`[MCP] Loaded ${dynamicServerNames.length} dynamic server(s) from --mcp-config: ${dynamicServerNames.length > 0 ? dynamicServerNames.join(", ") : "(none)"}`, { level: "info" });
962391
962749
  }
962392
962750
  } else {
@@ -962952,7 +963310,7 @@ ${assistantAddendum}` : assistantAddendum;
962952
963310
  }
962953
963311
  }
962954
963312
  logForDiagnosticsNoPII("info", "started", {
962955
- version: "4.2.35",
963313
+ version: "4.2.37",
962956
963314
  is_native_binary: isInBundledMode()
962957
963315
  });
962958
963316
  registerCleanup(async () => {
@@ -963443,7 +963801,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
963443
963801
  sshSession = await createSSHSession2({
963444
963802
  host: _pendingSSH.host,
963445
963803
  cwd: _pendingSSH.cwd,
963446
- localVersion: "4.2.35",
963804
+ localVersion: "4.2.37",
963447
963805
  permissionMode: _pendingSSH.permissionMode,
963448
963806
  dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
963449
963807
  extraCliArgs: _pendingSSH.extraCliArgs,
@@ -963912,7 +964270,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
963912
964270
  pendingHookMessages
963913
964271
  }, renderAndRun);
963914
964272
  }
963915
- }).version("4.2.35 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
964273
+ }).version("4.2.37 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
963916
964274
  program2.addOption(new Option("-w, --worktree [name]", cliDesc("cli.option.worktree", "Create a new git worktree for this session (optionally specify a name)")).hideHelp());
963917
964275
  program2.addOption(new Option("--tmux", cliDesc("cli.option.tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.")).hideHelp());
963918
964276
  if (canUserConfigureAdvisor()) {
@@ -964681,10 +965039,10 @@ function getCouncilArgs(args) {
964681
965039
  async function main2() {
964682
965040
  const args = process.argv.slice(2);
964683
965041
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
964684
- const d7 = new Date("2026-09-04T09:22:28.856Z");
965042
+ const d7 = new Date("2026-09-09T12:10:12.753Z");
964685
965043
  const p2 = (n3) => String(n3).padStart(2, "0");
964686
965044
  const buildTime = `${d7.getFullYear()}/${p2(d7.getMonth() + 1)}/${p2(d7.getDate())} ${p2(d7.getHours())}:${p2(d7.getMinutes())}:${p2(d7.getSeconds())}`;
964687
- console.log(`${"4.2.35"} (commit: ${"11636320f"}, built: ${buildTime})`);
965045
+ console.log(`${"4.2.37"} (commit: ${"f32f6afe3"}, built: ${buildTime})`);
964688
965046
  return;
964689
965047
  }
964690
965048
  if (true) {
@@ -964865,5 +965223,5 @@ async function main2() {
964865
965223
  }
964866
965224
  main2();
964867
965225
 
964868
- //# debugId=50C2294727C10C3464756E2164756E21
965226
+ //# debugId=A9AB373C0DE5E63864756E2164756E21
964869
965227