@rayss-dev/openclaude 0.28.1-by-rayss → 0.28.3-by-rayss

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 (5) hide show
  1. package/README.md +525 -513
  2. package/dist/acp.mjs +10231 -8141
  3. package/dist/cli.mjs +368 -374
  4. package/dist/sdk.mjs +654 -392
  5. package/package.json +1 -1
package/dist/sdk.mjs CHANGED
@@ -15018,14 +15018,117 @@ var init_venice = __esm(() => {
15018
15018
  });
15019
15019
 
15020
15020
  // src/integrations/vendors/xai.ts
15021
- var xai_default;
15021
+ function isPositiveFiniteNumber(value) {
15022
+ return typeof value === "number" && Number.isFinite(value) && value > 0;
15023
+ }
15024
+ var XAI_NON_CHAT_PATTERN, XAI_CURATED_MODELS, XAI_DISCOVERY_SUPPRESSED_IDS, xai_default;
15022
15025
  var init_xai = __esm(() => {
15026
+ XAI_NON_CHAT_PATTERN = /(imagine|voice|tts|stt|whisper|embed|speech-to-speech|speech-to-text|text-to-speech|multi-agent)/i;
15027
+ XAI_CURATED_MODELS = [
15028
+ {
15029
+ id: "grok-4.6",
15030
+ apiName: "grok-4.6",
15031
+ aliases: ["grok-4.6-latest"],
15032
+ label: "Grok 4.6",
15033
+ modelDescriptorId: "grok-4.6",
15034
+ contextWindow: 500000,
15035
+ reasoning: {
15036
+ mode: "levels",
15037
+ levels: ["low", "medium", "high", "xhigh"],
15038
+ defaultLevel: "high",
15039
+ wireFormat: "reasoning_effort"
15040
+ }
15041
+ },
15042
+ {
15043
+ id: "grok-4.5",
15044
+ apiName: "grok-4.5",
15045
+ aliases: ["grok-4.5-latest", "grok-build-latest"],
15046
+ label: "Grok 4.5",
15047
+ modelDescriptorId: "grok-4.5",
15048
+ contextWindow: 500000,
15049
+ maxOutputTokens: 32768,
15050
+ reasoning: {
15051
+ mode: "levels",
15052
+ levels: ["low", "medium", "high"],
15053
+ defaultLevel: "high",
15054
+ wireFormat: "reasoning_effort"
15055
+ }
15056
+ },
15057
+ {
15058
+ id: "grok-4.3",
15059
+ apiName: "grok-4.3",
15060
+ aliases: ["grok-4.3-latest", "grok-latest", "grok-4", "grok-3"],
15061
+ label: "Grok 4.3",
15062
+ modelDescriptorId: "grok-4.3",
15063
+ contextWindow: 1e6,
15064
+ maxOutputTokens: 32768,
15065
+ reasoning: { mode: "levels", levels: ["low", "medium", "high"], wireFormat: "reasoning_effort" }
15066
+ },
15067
+ {
15068
+ id: "grok-build-0.1",
15069
+ apiName: "grok-build-0.1",
15070
+ aliases: ["grok-code-fast-1", "grok-code-fast", "grok-code-fast-1-0825"],
15071
+ label: "Grok Build 0.1",
15072
+ modelDescriptorId: "xai/grok-build-0.1",
15073
+ contextWindow: 256000,
15074
+ maxOutputTokens: 64000,
15075
+ capabilities: { supportsReasoning: false },
15076
+ transportOverrides: { openaiShim: { endpointPath: "/responses", removeBodyFields: ["reasoning_effort"] } }
15077
+ },
15078
+ {
15079
+ id: "grok-4.20-0309-reasoning",
15080
+ apiName: "grok-4.20-0309-reasoning",
15081
+ aliases: [
15082
+ "grok-4.20-reasoning-latest",
15083
+ "grok-4.20",
15084
+ "grok-4.20-reasoning",
15085
+ "grok-4.20-0309",
15086
+ "grok-4.20-beta-0309-reasoning",
15087
+ "grok-4.20-beta",
15088
+ "grok-4.20-beta-0309",
15089
+ "grok-4.20-beta-latest",
15090
+ "grok-4.20-beta-latest-reasoning",
15091
+ "grok-4.20-beta-reasoning",
15092
+ "grok-4.20-experimental-beta-0304-reasoning",
15093
+ "grok-4.20-experimental-beta-0304",
15094
+ "grok-4.20-experimental-beta-reasoning-latest",
15095
+ "grok-4.20-experimental-beta-latest",
15096
+ "grok-4.20-reasoning-gv2"
15097
+ ],
15098
+ label: "Grok 4.20 Reasoning",
15099
+ modelDescriptorId: "grok-4.20-0309-reasoning",
15100
+ contextWindow: 1e6,
15101
+ maxOutputTokens: 32768,
15102
+ reasoning: { mode: "always-on", wireFormat: "none" },
15103
+ transportOverrides: { openaiShim: { endpointPath: "/responses", removeBodyFields: ["reasoning_effort"] } }
15104
+ },
15105
+ {
15106
+ id: "grok-4.20-0309-non-reasoning",
15107
+ apiName: "grok-4.20-0309-non-reasoning",
15108
+ aliases: [
15109
+ "grok-4.20-non-reasoning",
15110
+ "grok-4.20-non-reasoning-latest",
15111
+ "grok-4.20-beta-non-reasoning",
15112
+ "grok-4.20-beta-latest-non-reasoning",
15113
+ "grok-4.20-experimental-beta-0304-non-reasoning",
15114
+ "grok-4.20-experimental-beta-non-reasoning-latest",
15115
+ "grok-4.20-beta-0309-non-reasoning",
15116
+ "grok-4.20-non-reasoning-gv2"
15117
+ ],
15118
+ label: "Grok 4.20 Non-Reasoning",
15119
+ modelDescriptorId: "grok-4.20-0309-non-reasoning",
15120
+ contextWindow: 1e6,
15121
+ maxOutputTokens: 32768,
15122
+ capabilities: { supportsReasoning: false }
15123
+ }
15124
+ ];
15125
+ XAI_DISCOVERY_SUPPRESSED_IDS = new Set(["latest", ...XAI_CURATED_MODELS.flatMap((model) => model.aliases ?? [])].map((id) => id.toLowerCase()));
15023
15126
  xai_default = defineVendor({
15024
15127
  id: "xai",
15025
15128
  label: "xAI",
15026
15129
  classification: "openai-compatible",
15027
15130
  defaultBaseUrl: "https://api.x.ai/v1",
15028
- defaultModel: "grok-4.3",
15131
+ defaultModel: "grok-4.6",
15029
15132
  requiredEnvVars: ["XAI_API_KEY"],
15030
15133
  setup: {
15031
15134
  requiresAuth: true,
@@ -15054,76 +15157,39 @@ var init_xai = __esm(() => {
15054
15157
  missingCredentialMessage: "XAI_API_KEY is required, or sign in with `openclaude auth xai login` (browser OAuth) or `openclaude auth xai device` (remote hosts)."
15055
15158
  },
15056
15159
  catalog: {
15057
- source: "static",
15058
- models: [
15059
- {
15060
- id: "grok-4.3",
15061
- apiName: "grok-4.3",
15062
- aliases: ["grok-4.3-latest", "grok-latest", "grok-4", "grok-3"],
15063
- label: "Grok 4.3",
15064
- modelDescriptorId: "grok-4.3",
15065
- contextWindow: 1e6,
15066
- maxOutputTokens: 32768,
15067
- reasoning: { mode: "levels", levels: ["low", "medium", "high"], wireFormat: "reasoning_effort" }
15068
- },
15069
- {
15070
- id: "grok-build-0.1",
15071
- apiName: "grok-build-0.1",
15072
- aliases: ["grok-code-fast-1", "grok-code-fast", "grok-code-fast-1-0825"],
15073
- label: "Grok Build 0.1",
15074
- modelDescriptorId: "xai/grok-build-0.1",
15075
- contextWindow: 256000,
15076
- maxOutputTokens: 64000,
15077
- capabilities: { supportsReasoning: false },
15078
- transportOverrides: { openaiShim: { endpointPath: "/responses", removeBodyFields: ["reasoning_effort"] } }
15079
- },
15080
- {
15081
- id: "grok-4.20-0309-reasoning",
15082
- apiName: "grok-4.20-0309-reasoning",
15083
- aliases: [
15084
- "grok-4.20-reasoning-latest",
15085
- "grok-4.20",
15086
- "grok-4.20-reasoning",
15087
- "grok-4.20-0309",
15088
- "grok-4.20-beta-0309-reasoning",
15089
- "grok-4.20-beta",
15090
- "grok-4.20-beta-0309",
15091
- "grok-4.20-beta-latest",
15092
- "grok-4.20-beta-latest-reasoning",
15093
- "grok-4.20-beta-reasoning",
15094
- "grok-4.20-experimental-beta-0304-reasoning",
15095
- "grok-4.20-experimental-beta-0304",
15096
- "grok-4.20-experimental-beta-reasoning-latest",
15097
- "grok-4.20-experimental-beta-latest",
15098
- "grok-4.20-reasoning-gv2"
15099
- ],
15100
- label: "Grok 4.20 Reasoning",
15101
- modelDescriptorId: "grok-4.20-0309-reasoning",
15102
- contextWindow: 1e6,
15103
- maxOutputTokens: 32768,
15104
- reasoning: { mode: "always-on", wireFormat: "none" },
15105
- transportOverrides: { openaiShim: { endpointPath: "/responses", removeBodyFields: ["reasoning_effort"] } }
15106
- },
15107
- {
15108
- id: "grok-4.20-0309-non-reasoning",
15109
- apiName: "grok-4.20-0309-non-reasoning",
15110
- aliases: [
15111
- "grok-4.20-non-reasoning",
15112
- "grok-4.20-non-reasoning-latest",
15113
- "grok-4.20-beta-non-reasoning",
15114
- "grok-4.20-beta-latest-non-reasoning",
15115
- "grok-4.20-experimental-beta-0304-non-reasoning",
15116
- "grok-4.20-experimental-beta-non-reasoning-latest",
15117
- "grok-4.20-beta-0309-non-reasoning",
15118
- "grok-4.20-non-reasoning-gv2"
15119
- ],
15120
- label: "Grok 4.20 Non-Reasoning",
15121
- modelDescriptorId: "grok-4.20-0309-non-reasoning",
15122
- contextWindow: 1e6,
15123
- maxOutputTokens: 32768,
15124
- capabilities: { supportsReasoning: false }
15160
+ source: "hybrid",
15161
+ discovery: {
15162
+ kind: "openai-compatible",
15163
+ mapModel(raw) {
15164
+ if (!raw || typeof raw !== "object") {
15165
+ return null;
15166
+ }
15167
+ const model = raw;
15168
+ const id = typeof model.id === "string" ? model.id.trim() : "";
15169
+ if (!id || model.active === false) {
15170
+ return null;
15171
+ }
15172
+ if (XAI_NON_CHAT_PATTERN.test(id)) {
15173
+ return null;
15174
+ }
15175
+ if (!/^grok/i.test(id)) {
15176
+ return null;
15177
+ }
15178
+ if (XAI_DISCOVERY_SUPPRESSED_IDS.has(id.toLowerCase())) {
15179
+ return null;
15180
+ }
15181
+ return {
15182
+ id,
15183
+ apiName: id,
15184
+ label: id,
15185
+ ...isPositiveFiniteNumber(model.context_length) ? { contextWindow: model.context_length } : {}
15186
+ };
15125
15187
  }
15126
- ]
15188
+ },
15189
+ discoveryCacheTtl: "1d",
15190
+ discoveryRefreshMode: "background-if-stale",
15191
+ allowManualRefresh: true,
15192
+ models: XAI_CURATED_MODELS
15127
15193
  },
15128
15194
  usage: { supported: false }
15129
15195
  });
@@ -17092,7 +17158,7 @@ var init_version = __esm(() => {
17092
17158
  import_semver = __toESM(require_semver2(), 1);
17093
17159
  fallbackBuildVersion = (() => {
17094
17160
  try {
17095
- return "0.28.1-by-rayss";
17161
+ return "0.28.3-by-rayss";
17096
17162
  } catch {
17097
17163
  return "0.0.0";
17098
17164
  }
@@ -17101,22 +17167,27 @@ var init_version = __esm(() => {
17101
17167
  });
17102
17168
 
17103
17169
  // src/integrations/aimlapi/config.ts
17104
- function resolvePartnerId(explicit) {
17105
- return explicit?.trim() || process.env.AIMLAPI_PARTNER_ID?.trim() || DEFAULT_PARTNER_ID;
17170
+ function resolvePartnerId() {
17171
+ return DEFAULT_PARTNER_ID;
17106
17172
  }
17107
- function withResolvedPartnerHeader(headers, explicit) {
17173
+ function withResolvedPartnerHeader(headers) {
17108
17174
  const resolved = {};
17109
17175
  for (const [name, value] of Object.entries(headers)) {
17110
17176
  if (name.trim().toLowerCase() === PARTNER_HEADER_NAME.toLowerCase())
17111
17177
  continue;
17112
17178
  resolved[name] = value;
17113
17179
  }
17114
- resolved[PARTNER_HEADER_NAME] = resolvePartnerId(explicit);
17180
+ resolved[PARTNER_HEADER_NAME] = resolvePartnerId();
17115
17181
  return resolved;
17116
17182
  }
17117
17183
  function parseCanonicalUrl(value) {
17118
17184
  try {
17119
- const url = new URL(value.trim());
17185
+ const trimmed = value.trim();
17186
+ const url = new URL(trimmed);
17187
+ if (url.username || url.password)
17188
+ return null;
17189
+ if (trimmed.includes("?") || trimmed.includes("#"))
17190
+ return null;
17120
17191
  return { origin: url.origin, pathname: url.pathname.replace(/\/$/, "") };
17121
17192
  } catch {
17122
17193
  return null;
@@ -17129,19 +17200,22 @@ function isCanonicalAimlapiInferenceBaseUrl(value) {
17129
17200
  }
17130
17201
  function resolveAimlapiAttributionHeaders(headers, baseUrl) {
17131
17202
  if (!baseUrl || isCanonicalAimlapiInferenceBaseUrl(baseUrl)) {
17132
- return withResolvedPartnerHeader(headers);
17203
+ return { ...withResolvedPartnerHeader(headers), [SOURCE_HEADER_NAME]: AIMLAPI_SOURCE };
17133
17204
  }
17134
17205
  return Object.fromEntries(Object.entries(headers).filter(([name]) => !CATALOG_ATTRIBUTION_HEADER_NAMES.has(name.trim().toLowerCase())));
17135
17206
  }
17136
- var DEFAULT_ENDPOINTS, DEFAULT_PARTNER_ID = "part_62yQoGYDq4Yqnrj2R1iGrDNJ", PARTNER_HEADER_NAME = "X-AIMLAPI-Partner-ID", CATALOG_ATTRIBUTION_HEADER_NAMES;
17207
+ var DEFAULT_ENDPOINTS, DEFAULT_PARTNER_ID = "part_62yQoGYDq4Yqnrj2R1iGrDNJ", PARTNER_HEADER_NAME = "X-AIMLAPI-Partner-ID", SOURCE_HEADER_NAME = "X-AIMLAPI-Source", AIMLAPI_SOURCE = "agent/openclaude", CATALOG_ATTRIBUTION_HEADER_NAMES;
17137
17208
  var init_config = __esm(() => {
17138
17209
  DEFAULT_ENDPOINTS = {
17139
17210
  authBaseUrl: "https://auth.aimlapi.com",
17140
17211
  appBaseUrl: "https://app.aimlapi.com",
17141
- inferenceBaseUrl: "https://api.aimlapi.com/v1"
17212
+ payBaseUrl: "https://pay.aimlapi.com",
17213
+ inferenceBaseUrl: "https://api.aimlapi.com/v1",
17214
+ verificationBaseUrl: "https://aimlapi.com/app"
17142
17215
  };
17143
17216
  CATALOG_ATTRIBUTION_HEADER_NAMES = new Set([
17144
17217
  PARTNER_HEADER_NAME.toLowerCase(),
17218
+ SOURCE_HEADER_NAME.toLowerCase(),
17145
17219
  "x-aimlapi-integration-repo",
17146
17220
  "x-aimlapi-integration-version",
17147
17221
  "http-referer",
@@ -17531,6 +17605,8 @@ var init_atlas_cloud = __esm(() => {
17531
17605
  { id: "google/gemini-3.5-flash", apiName: "google/gemini-3.5-flash", aliases: ["gemini-3.5-flash"], modelDescriptorId: "gemini-3.5-flash", label: "Gemini 3.5 Flash", contextWindow: 1048576, maxOutputTokens: 65536, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], wireFormat: "reasoning_effort" } },
17532
17606
  { id: "google/gemini-3.1-pro-preview", apiName: "google/gemini-3.1-pro-preview", modelDescriptorId: "google/gemini-3.1-pro-preview", label: "Gemini 3.1 Pro Preview", contextWindow: 1e6, maxOutputTokens: 64000, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], wireFormat: "reasoning_effort" } },
17533
17607
  { id: "google/gemini-3.1-flash-lite", apiName: "google/gemini-3.1-flash-lite", modelDescriptorId: "google/gemini-3.1-flash-lite", label: "Gemini 3.1 Flash Lite", contextWindow: 1048576, maxOutputTokens: 65536 },
17608
+ { id: "xai/grok-4.6", apiName: "xai/grok-4.6", aliases: ["grok-4.6", "grok-4.6-latest"], modelDescriptorId: "grok-4.6", label: "Grok 4.6", contextWindow: 500000, maxOutputTokens: 32768, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], defaultLevel: "high", wireFormat: "reasoning_effort" } },
17609
+ { id: "xai/grok-4.5", apiName: "xai/grok-4.5", aliases: ["grok-4.5", "grok-4.5-latest", "grok-build-latest"], modelDescriptorId: "grok-4.5", label: "Grok 4.5", contextWindow: 500000, maxOutputTokens: 32768, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high"], defaultLevel: "high", wireFormat: "reasoning_effort" } },
17534
17610
  { id: "xai/grok-4.3", apiName: "xai/grok-4.3", aliases: ["grok-4.3", "grok-4.3-latest", "grok-latest", "grok-4", "grok-3"], modelDescriptorId: "grok-4.3", label: "Grok 4.3", contextWindow: 1e6, maxOutputTokens: 32768, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high"], wireFormat: "reasoning_effort" } },
17535
17611
  { id: "xai/grok-build-0.1", apiName: "xai/grok-build-0.1", aliases: ["grok-build-0.1", "grok-code-fast-1", "grok-code-fast", "grok-code-fast-1-0825"], modelDescriptorId: "xai/grok-build-0.1", label: "Grok Build 0.1", contextWindow: 256000, maxOutputTokens: 64000, capabilities: { supportsReasoning: false }, transportOverrides: { openaiShim: { removeBodyFields: ["reasoning_effort"] } } },
17536
17612
  { id: "moonshotai/kimi-k2.7-code", apiName: "moonshotai/kimi-k2.7-code", aliases: ["kimi-k2.7-code"], modelDescriptorId: "kimi-k2.7-code", label: "Kimi K2.7 Code", contextWindow: 262144, maxOutputTokens: 32768, capabilities: { supportsVision: true, supportsFunctionCalling: true, supportsJsonMode: true, supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high"], defaultLevel: "medium", wireFormat: "reasoning_effort" } },
@@ -18817,6 +18893,8 @@ var init_hicap = __esm(() => {
18817
18893
  { id: "hicap-glm-5.2", apiName: "glm-5.2", aliases: ["zai-org/glm-5.2"], label: "GLM 5.2", modelDescriptorId: "glm-5.2", contextWindow: 1e6, maxOutputTokens: 131072, capabilities: { supportsFunctionCalling: true, supportsJsonMode: true, supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], defaultLevel: "high", wireFormat: "zai_compatible" }, transportOverrides: { openaiShim: { preserveReasoningContent: true, requireReasoningContentOnAssistantMessages: true, reasoningContentFallback: "", thinkingRequestFormat: "zai-compatible", maxTokensField: "max_tokens", removeBodyFields: ["store"], enableToolStreaming: true } } },
18818
18894
  { id: "hicap-gpt-5.4", apiName: "gpt-5.4", label: "GPT-5.4", modelDescriptorId: "gpt-5.4", contextWindow: 1050000, maxOutputTokens: 128000, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], defaultLevel: "high", wireFormat: "reasoning_effort" }, transportOverrides: { openaiShim: { requiredApiFormat: "responses", maxTokensField: "max_completion_tokens" } } },
18819
18895
  { id: "hicap-gpt-5.5", apiName: "gpt-5.5", label: "GPT-5.5", modelDescriptorId: "gpt-5.5", contextWindow: 1050000, maxOutputTokens: 128000, capabilities: { supportsReasoning: true }, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], defaultLevel: "high", wireFormat: "reasoning_effort" }, transportOverrides: { openaiShim: { requiredApiFormat: "responses", maxTokensField: "max_completion_tokens" } } },
18896
+ { id: "hicap-grok-4.6", apiName: "grok-4.6", aliases: ["grok-4.6-latest"], label: "Grok 4.6", modelDescriptorId: "grok-4.6", contextWindow: 500000, maxOutputTokens: 32768, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh"], defaultLevel: "high", wireFormat: "reasoning_effort" } },
18897
+ { id: "hicap-grok-4.5", apiName: "grok-4.5", aliases: ["grok-4.5-latest", "grok-build-latest"], label: "Grok 4.5", modelDescriptorId: "grok-4.5", contextWindow: 500000, maxOutputTokens: 32768, reasoning: { mode: "levels", levels: ["low", "medium", "high"], defaultLevel: "high", wireFormat: "reasoning_effort" } },
18820
18898
  { id: "hicap-grok-4.3", apiName: "grok-4.3", label: "Grok 4.3", modelDescriptorId: "grok-4.3", contextWindow: 1e6, maxOutputTokens: 32768, reasoning: { mode: "levels", levels: ["low", "medium", "high"], defaultLevel: "high", wireFormat: "reasoning_effort" } },
18821
18899
  { id: "hicap-kimi-k2.7-code", apiName: "kimi-k2.7-code", label: "Kimi K2.7 Code", modelDescriptorId: "kimi-k2.7-code", contextWindow: 262144, maxOutputTokens: 262144, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh", "max"], defaultLevel: "high", wireFormat: "reasoning_effort" } },
18822
18900
  { id: "hicap-minimax-m3", apiName: "minimax-m3", label: "MiniMax M3", modelDescriptorId: "minimax-m3", contextWindow: 1048576, maxOutputTokens: 131072, reasoning: { mode: "levels", levels: ["low", "medium", "high", "xhigh", "max"], defaultLevel: "high", wireFormat: "reasoning_effort" } }
@@ -19353,7 +19431,9 @@ var init_openrouter = __esm(() => {
19353
19431
  discoveryRefreshMode: "background-if-stale",
19354
19432
  allowManualRefresh: true,
19355
19433
  models: [
19356
- { id: "openrouter-gpt-5-mini", apiName: "openai/gpt-5-mini", label: "GPT-5 Mini (via OpenRouter)", modelDescriptorId: "gpt-5-mini" }
19434
+ { id: "openrouter-gpt-5-mini", apiName: "openai/gpt-5-mini", label: "GPT-5 Mini (via OpenRouter)", modelDescriptorId: "gpt-5-mini" },
19435
+ { id: "openrouter-grok-4.6", apiName: "x-ai/grok-4.6", label: "Grok 4.6 (via OpenRouter)", modelDescriptorId: "grok-4.6" },
19436
+ { id: "openrouter-grok-4.5", apiName: "x-ai/grok-4.5", label: "Grok 4.5 (via OpenRouter)", modelDescriptorId: "grok-4.5" }
19357
19437
  ]
19358
19438
  },
19359
19439
  usage: { supported: false }
@@ -20298,6 +20378,8 @@ var init_xai2 = __esm(() => {
20298
20378
  supportsPreciseTokenCount: false
20299
20379
  },
20300
20380
  modelIds: [
20381
+ "grok-4.6",
20382
+ "grok-4.5",
20301
20383
  "grok-4.3",
20302
20384
  "xai/grok-build-0.1",
20303
20385
  "grok-4.20-0309-reasoning",
@@ -26151,6 +26233,49 @@ var init_xai3 = __esm(() => {
26151
26233
  supportsPreciseTokenCount: false
26152
26234
  };
26153
26235
  xai_default3 = [
26236
+ defineModel({
26237
+ id: "grok-4.6",
26238
+ label: "Grok 4.6",
26239
+ brandId: "xai",
26240
+ vendorId: "xai",
26241
+ classification: ["chat", "reasoning", "vision", "coding"],
26242
+ defaultModel: "grok-4.6",
26243
+ providerModelMap: {
26244
+ openrouter: "x-ai/grok-4.6",
26245
+ "atlas-cloud": "xai/grok-4.6",
26246
+ hicap: "grok-4.6"
26247
+ },
26248
+ capabilities: grokCapabilities,
26249
+ reasoning: {
26250
+ mode: "levels",
26251
+ levels: ["low", "medium", "high", "xhigh"],
26252
+ defaultLevel: "high",
26253
+ wireFormat: "reasoning_effort"
26254
+ },
26255
+ contextWindow: 500000
26256
+ }),
26257
+ defineModel({
26258
+ id: "grok-4.5",
26259
+ label: "Grok 4.5",
26260
+ brandId: "xai",
26261
+ vendorId: "xai",
26262
+ classification: ["chat", "reasoning", "vision", "coding"],
26263
+ defaultModel: "grok-4.5",
26264
+ providerModelMap: {
26265
+ openrouter: "x-ai/grok-4.5",
26266
+ "atlas-cloud": "xai/grok-4.5",
26267
+ hicap: "grok-4.5"
26268
+ },
26269
+ capabilities: grokCapabilities,
26270
+ reasoning: {
26271
+ mode: "levels",
26272
+ levels: ["low", "medium", "high"],
26273
+ defaultLevel: "high",
26274
+ wireFormat: "reasoning_effort"
26275
+ },
26276
+ contextWindow: 500000,
26277
+ maxOutputTokens: 32768
26278
+ }),
26154
26279
  defineModel({
26155
26280
  id: "grok-4.3",
26156
26281
  label: "Grok 4.3",
@@ -27869,7 +27994,15 @@ var init_linuxSecretStorage = __esm(() => {
27869
27994
  return null;
27870
27995
  },
27871
27996
  async readAsync() {
27872
- return this.read();
27997
+ try {
27998
+ const username = getUsername();
27999
+ const serviceName = getSecureStorageServiceName(CREDENTIALS_SERVICE_SUFFIX);
28000
+ const result = await execa("secret-tool", ["lookup", "service", serviceName, "account", username], { reject: false });
28001
+ if (result.exitCode === 0 && result.stdout) {
28002
+ return jsonParse(result.stdout);
28003
+ }
28004
+ } catch {}
28005
+ return null;
27873
28006
  },
27874
28007
  update(data) {
27875
28008
  try {
@@ -27931,6 +28064,16 @@ function runPowerShell(script, options) {
27931
28064
  return null;
27932
28065
  }
27933
28066
  }
28067
+ async function runPowerShellAsync(script, options) {
28068
+ try {
28069
+ return await execa("powershell.exe", ["-Command", script], {
28070
+ input: options?.input,
28071
+ reject: false
28072
+ });
28073
+ } catch {
28074
+ return null;
28075
+ }
28076
+ }
27934
28077
  function commandOutputToString(output) {
27935
28078
  if (typeof output === "string") {
27936
28079
  return output;
@@ -27954,13 +28097,10 @@ function getFailureWarning(result, fallback) {
27954
28097
  }
27955
28098
  return fallback;
27956
28099
  }
27957
- function readLegacyPasswordVault() {
27958
- if (!shouldUseLegacyPasswordVault()) {
27959
- return null;
27960
- }
28100
+ function getLegacyPasswordVaultScript() {
27961
28101
  const resourceName = getLegacyResourceName().replace(/"/g, '`"');
27962
28102
  const username = getUsername().replace(/"/g, '`"');
27963
- const script = `
28103
+ return `
27964
28104
  Add-Type -AssemblyName System.Runtime.WindowsRuntime
27965
28105
  try {
27966
28106
  $vault = New-Object Windows.Security.Credentials.PasswordVault
@@ -27971,7 +28111,8 @@ function readLegacyPasswordVault() {
27971
28111
  exit 1
27972
28112
  }
27973
28113
  `;
27974
- const result = runPowerShell(script);
28114
+ }
28115
+ function parseCredentialOutput(result) {
27975
28116
  const stdout = commandOutputToString(result?.stdout);
27976
28117
  if (result?.exitCode === 0 && stdout) {
27977
28118
  try {
@@ -27982,6 +28123,50 @@ function readLegacyPasswordVault() {
27982
28123
  }
27983
28124
  return null;
27984
28125
  }
28126
+ function readLegacyPasswordVault() {
28127
+ if (!shouldUseLegacyPasswordVault()) {
28128
+ return null;
28129
+ }
28130
+ return parseCredentialOutput(runPowerShell(getLegacyPasswordVaultScript()));
28131
+ }
28132
+ async function readLegacyPasswordVaultAsync() {
28133
+ if (!shouldUseLegacyPasswordVault()) {
28134
+ return null;
28135
+ }
28136
+ return parseCredentialOutput(await runPowerShellAsync(getLegacyPasswordVaultScript()));
28137
+ }
28138
+ function getDpapiReadScript() {
28139
+ const filePath = escapePowerShellSingleQuoted(getWindowsSecureStorageFilePath());
28140
+ const entropy = escapePowerShellSingleQuoted(getWindowsSecureStorageEntropy());
28141
+ return `
28142
+ try {
28143
+ Add-Type -AssemblyName System.Security
28144
+ $path = '${filePath}'
28145
+ if (!(Test-Path -LiteralPath $path)) {
28146
+ exit 1
28147
+ }
28148
+
28149
+ $protectedBase64 = [System.IO.File]::ReadAllText(
28150
+ $path,
28151
+ [System.Text.Encoding]::UTF8
28152
+ ).Trim()
28153
+ if (-not $protectedBase64) {
28154
+ exit 1
28155
+ }
28156
+
28157
+ $protectedBytes = [Convert]::FromBase64String($protectedBase64)
28158
+ $entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${entropy}')
28159
+ $bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
28160
+ $protectedBytes,
28161
+ $entropyBytes,
28162
+ [System.Security.Cryptography.DataProtectionScope]::CurrentUser
28163
+ )
28164
+ [Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
28165
+ } catch {
28166
+ exit 1
28167
+ }
28168
+ `;
28169
+ }
27985
28170
  var windowsCredentialStorage;
27986
28171
  var init_windowsCredentialStorage = __esm(() => {
27987
28172
  init_execa();
@@ -27991,49 +28176,10 @@ var init_windowsCredentialStorage = __esm(() => {
27991
28176
  windowsCredentialStorage = {
27992
28177
  name: "credential-locker-dpapi",
27993
28178
  read() {
27994
- const filePath = escapePowerShellSingleQuoted(getWindowsSecureStorageFilePath());
27995
- const entropy = escapePowerShellSingleQuoted(getWindowsSecureStorageEntropy());
27996
- const script = `
27997
- try {
27998
- Add-Type -AssemblyName System.Security
27999
- $path = '${filePath}'
28000
- if (!(Test-Path -LiteralPath $path)) {
28001
- exit 1
28002
- }
28003
-
28004
- $protectedBase64 = [System.IO.File]::ReadAllText(
28005
- $path,
28006
- [System.Text.Encoding]::UTF8
28007
- ).Trim()
28008
- if (-not $protectedBase64) {
28009
- exit 1
28010
- }
28011
-
28012
- $protectedBytes = [Convert]::FromBase64String($protectedBase64)
28013
- $entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${entropy}')
28014
- $bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
28015
- $protectedBytes,
28016
- $entropyBytes,
28017
- [System.Security.Cryptography.DataProtectionScope]::CurrentUser
28018
- )
28019
- [Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
28020
- } catch {
28021
- exit 1
28022
- }
28023
- `;
28024
- const result = runPowerShell(script);
28025
- const stdout = commandOutputToString(result?.stdout);
28026
- if (result?.exitCode === 0 && stdout) {
28027
- try {
28028
- return jsonParse(stdout);
28029
- } catch {
28030
- return readLegacyPasswordVault();
28031
- }
28032
- }
28033
- return readLegacyPasswordVault();
28179
+ return parseCredentialOutput(runPowerShell(getDpapiReadScript())) ?? readLegacyPasswordVault();
28034
28180
  },
28035
28181
  async readAsync() {
28036
- return this.read();
28182
+ return parseCredentialOutput(await runPowerShellAsync(getDpapiReadScript())) ?? await readLegacyPasswordVaultAsync();
28037
28183
  },
28038
28184
  update(data) {
28039
28185
  const filePath = escapePowerShellSingleQuoted(getWindowsSecureStorageFilePath());
@@ -30085,6 +30231,16 @@ function isXaiBaseUrl(value) {
30085
30231
  return false;
30086
30232
  }
30087
30233
  }
30234
+ function isCanonicalXaiInferenceBaseUrl(value) {
30235
+ if (!value?.trim())
30236
+ return true;
30237
+ try {
30238
+ const parsed = new URL(value);
30239
+ return parsed.protocol === "https:" && parsed.hostname.toLowerCase() === "api.x.ai";
30240
+ } catch {
30241
+ return false;
30242
+ }
30243
+ }
30088
30244
  function isXiaomiMimoBaseUrl(value) {
30089
30245
  const trimmed = value?.trim();
30090
30246
  if (!trimmed) {
@@ -46925,6 +47081,7 @@ function normalizeXaiCredentialBlob(value) {
46925
47081
  return {
46926
47082
  accessToken,
46927
47083
  refreshToken,
47084
+ cacheIdentity: asTrimmedString2(record.cacheIdentity),
46928
47085
  tokenEndpoint,
46929
47086
  idToken: asTrimmedString2(record.idToken),
46930
47087
  email: asTrimmedString2(record.email),
@@ -46935,6 +47092,21 @@ function normalizeXaiCredentialBlob(value) {
46935
47092
  lastRefreshFailureAt: typeof record.lastRefreshFailureAt === "number" && Number.isFinite(record.lastRefreshFailureAt) ? record.lastRefreshFailureAt : undefined
46936
47093
  };
46937
47094
  }
47095
+ function cacheXaiCredentials(credentials) {
47096
+ cachedXaiCredentials = credentials;
47097
+ cachedXaiCredentialsAt = credentials ? Date.now() : 0;
47098
+ xaiCredentialsGeneration++;
47099
+ return credentials;
47100
+ }
47101
+ function hasFreshCachedXaiCredentials() {
47102
+ return cachedXaiCredentials !== undefined && Date.now() - cachedXaiCredentialsAt < XAI_CREDENTIAL_CACHE_TTL_MS;
47103
+ }
47104
+ function getCachedXaiCredentials() {
47105
+ return hasFreshCachedXaiCredentials() ? cachedXaiCredentials : undefined;
47106
+ }
47107
+ function getXaiDiscoveryCacheIdentity(credentials) {
47108
+ return credentials?.cacheIdentity ?? credentials?.accountId ?? credentials?.refreshToken ?? credentials?.accessToken;
47109
+ }
46938
47110
  function effectiveExpiresAt(blob) {
46939
47111
  return blob.expiresAt ?? deriveExpiresMsFromJwt(blob.accessToken);
46940
47112
  }
@@ -46953,12 +47125,29 @@ function isWithinRefreshFailureCooldown2(blob, now = Date.now()) {
46953
47125
  async function readXaiCredentialsAsync() {
46954
47126
  if (isBareMode())
46955
47127
  return;
46956
- try {
46957
- const data = await getXaiSecureStorage().readAsync();
46958
- return normalizeXaiCredentialBlob(data?.[XAI_STORAGE_KEY]);
46959
- } catch {
47128
+ const cached = getCachedXaiCredentials();
47129
+ if (cached)
47130
+ return cached;
47131
+ if (inFlightXaiCredentialRead) {
47132
+ return inFlightXaiCredentialRead;
47133
+ }
47134
+ const generation = xaiCredentialsGeneration;
47135
+ const read = getXaiSecureStorage().readAsync().then((data) => {
47136
+ const credentials = normalizeXaiCredentialBlob(data?.[XAI_STORAGE_KEY]);
47137
+ if (generation !== xaiCredentialsGeneration) {
47138
+ return getCachedXaiCredentials();
47139
+ }
47140
+ return credentials ? cacheXaiCredentials(credentials) : undefined;
47141
+ }).catch(() => {
46960
47142
  return;
46961
- }
47143
+ });
47144
+ inFlightXaiCredentialRead = read;
47145
+ read.finally(() => {
47146
+ if (inFlightXaiCredentialRead === read) {
47147
+ inFlightXaiCredentialRead = null;
47148
+ }
47149
+ });
47150
+ return read;
46962
47151
  }
46963
47152
  function saveXaiCredentials(blob) {
46964
47153
  if (isBareMode()) {
@@ -46983,6 +47172,7 @@ function saveXaiCredentials(blob) {
46983
47172
  const result = storage.update(next);
46984
47173
  if (result.success) {
46985
47174
  const stored = normalizeXaiCredentialBlob(next[XAI_STORAGE_KEY]);
47175
+ cacheXaiCredentials(stored);
46986
47176
  inMemoryLastRefreshFailureAt2 = stored?.lastRefreshFailureAt ?? null;
46987
47177
  }
46988
47178
  return result;
@@ -46995,10 +47185,11 @@ function persistRefreshFailure(blob, occurredAt) {
46995
47185
  if (!result.success)
46996
47186
  inMemoryLastRefreshFailureAt2 = occurredAt;
46997
47187
  }
46998
- function toBlob(tokens, previous) {
47188
+ function toBlob(tokens, previous, options) {
46999
47189
  return {
47000
47190
  accessToken: tokens.accessToken,
47001
47191
  refreshToken: tokens.refreshToken || previous?.refreshToken || "",
47192
+ cacheIdentity: options?.preserveCacheIdentity ? getXaiDiscoveryCacheIdentity(previous) : tokens.accountId ?? tokens.refreshToken,
47002
47193
  tokenEndpoint: tokens.tokenEndpoint,
47003
47194
  idToken: tokens.idToken ?? previous?.idToken,
47004
47195
  email: tokens.email ?? previous?.email,
@@ -47031,7 +47222,7 @@ async function refreshXaiAccessTokenIfNeeded(options) {
47031
47222
  refreshToken: current.refreshToken,
47032
47223
  tokenEndpoint: current.tokenEndpoint
47033
47224
  });
47034
- const next = toBlob(tokens, current);
47225
+ const next = toBlob(tokens, current, { preserveCacheIdentity: true });
47035
47226
  const save = saveXaiCredentials(next);
47036
47227
  if (!save.success) {
47037
47228
  throw new Error(save.warning ?? "xAI token refresh succeeded but credentials could not be saved.");
@@ -47058,7 +47249,7 @@ async function resolveXaiAccessToken() {
47058
47249
  return blob?.accessToken;
47059
47250
  }
47060
47251
  }
47061
- var XAI_STORAGE_KEY = "xai", XAI_TOKEN_REFRESH_SKEW_MS = 60000, XAI_TOKEN_REFRESH_RETRY_COOLDOWN_MS = 60000, inFlightXaiRefresh = null, inMemoryLastRefreshFailureAt2 = null;
47252
+ var XAI_STORAGE_KEY = "xai", XAI_TOKEN_REFRESH_SKEW_MS = 60000, XAI_TOKEN_REFRESH_RETRY_COOLDOWN_MS = 60000, XAI_CREDENTIAL_CACHE_TTL_MS = 30000, inFlightXaiRefresh = null, inMemoryLastRefreshFailureAt2 = null, cachedXaiCredentials, cachedXaiCredentialsAt = 0, xaiCredentialsGeneration = 0, inFlightXaiCredentialRead = null;
47062
47253
  var init_xaiCredentials = __esm(() => {
47063
47254
  init_envUtils();
47064
47255
  init_secureStorage();
@@ -47451,7 +47642,7 @@ function createProfileFile(profile, env3) {
47451
47642
  function buildXaiOAuthProfileEnv(options) {
47452
47643
  return {
47453
47644
  OPENAI_BASE_URL: XAI_OAUTH_DEFAULT_BASE_URL,
47454
- OPENAI_MODEL: options.model ?? "grok-4.3",
47645
+ OPENAI_MODEL: options.model ?? "grok-4.6",
47455
47646
  XAI_CREDENTIAL_SOURCE: "oauth"
47456
47647
  };
47457
47648
  }
@@ -65343,7 +65534,6 @@ var init_providerCustomHeaders = __esm(() => {
65343
65534
  });
65344
65535
 
65345
65536
  // src/integrations/discoveryService.ts
65346
- import { createHash as createHash2 } from "node:crypto";
65347
65537
  function shouldSkipNonessentialDiscoveryTraffic() {
65348
65538
  return isEssentialTrafficOnly() || Boolean(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC);
65349
65539
  }
@@ -65376,17 +65566,24 @@ function normalizeDiscoveryCacheHeaders(headers) {
65376
65566
  value.trim()
65377
65567
  ]).filter(([name, value]) => name && value).sort(([leftName], [rightName]) => leftName.localeCompare(rightName));
65378
65568
  }
65379
- function hashDiscoveryCachePartition(value) {
65380
- return createHash2("sha256").update(JSON.stringify(value)).digest("hex").slice(0, 16);
65569
+ function fingerprintDiscoveryCachePartition(value) {
65570
+ let fingerprint = FNV1A_128_OFFSET_BASIS;
65571
+ const serialized = JSON.stringify(value) ?? "";
65572
+ for (const byte of new TextEncoder().encode(serialized)) {
65573
+ fingerprint ^= BigInt(byte);
65574
+ fingerprint = BigInt.asUintN(128, fingerprint * FNV1A_128_PRIME);
65575
+ }
65576
+ return fingerprint.toString(16).padStart(32, "0");
65381
65577
  }
65382
65578
  function getDiscoveryCacheKey(routeId, options) {
65383
65579
  const discoveryApiKey = getRouteDiscoveryApiKey(routeId, options);
65580
+ const cacheIdentity = options?.cacheKey ?? discoveryApiKey;
65384
65581
  const partition = {
65385
65582
  baseUrl: normalizeDiscoveryCacheBaseUrl(getRouteBaseUrl(routeId, options)),
65386
- apiKeyHash: discoveryApiKey ? hashDiscoveryCachePartition(discoveryApiKey) : "",
65583
+ apiKeyHash: cacheIdentity ? fingerprintDiscoveryCachePartition(cacheIdentity) : "",
65387
65584
  headers: normalizeDiscoveryCacheHeaders(getRouteDiscoveryHeaders(routeId, options))
65388
65585
  };
65389
- return `${routeId}:${hashDiscoveryCachePartition(partition)}`;
65586
+ return `${routeId}:${fingerprintDiscoveryCachePartition(partition)}`;
65390
65587
  }
65391
65588
  function getRouteBaseUrl(routeId, options) {
65392
65589
  return options?.baseUrl ?? getRouteDescriptor(routeId)?.defaultBaseUrl;
@@ -65412,6 +65609,26 @@ function getRouteDiscoveryApiKey(routeId, options) {
65412
65609
  processEnv: process.env
65413
65610
  }));
65414
65611
  }
65612
+ async function resolveDiscoveryRequestOptions(routeId, options, resolverOptions) {
65613
+ const next = { ...options ?? {} };
65614
+ if (getRouteDiscoveryApiKey(routeId, next) || routeId !== "xai") {
65615
+ return next;
65616
+ }
65617
+ if (!isCanonicalXaiInferenceBaseUrl(getRouteBaseUrl(routeId, next))) {
65618
+ return next;
65619
+ }
65620
+ let credentials = await readXaiCredentialsAsync();
65621
+ const cacheOnly = shouldSkipNonessentialDiscoveryTraffic() || resolverOptions?.refreshXaiOAuth === false;
65622
+ const token = firstUsableCredential(cacheOnly ? credentials?.accessToken : await resolveXaiAccessToken());
65623
+ if (!cacheOnly) {
65624
+ credentials = await readXaiCredentialsAsync() ?? credentials;
65625
+ }
65626
+ if (token) {
65627
+ next.apiKey = token;
65628
+ next.cacheKey = getXaiDiscoveryCacheIdentity(credentials) ?? token;
65629
+ }
65630
+ return next;
65631
+ }
65415
65632
  function getRouteDiscoveryHeaders(routeId, options) {
65416
65633
  const transportConfig = getRouteDescriptor(routeId)?.transportConfig;
65417
65634
  const acceptsCallerHeaders = getRouteCatalog(routeId)?.discovery?.requiresAuth !== false;
@@ -65527,8 +65744,11 @@ async function discoverModelsForRoute(routeId, options) {
65527
65744
  };
65528
65745
  }
65529
65746
  const ttlMs = getDiscoveryCacheTtlMs(routeId);
65530
- const cacheKey = getDiscoveryCacheKey(routeId, options);
65531
- if (!options?.forceRefresh && ttlMs > 0) {
65747
+ const cachedOptions = await resolveDiscoveryRequestOptions(routeId, options, {
65748
+ refreshXaiOAuth: false
65749
+ });
65750
+ const cacheKey = getDiscoveryCacheKey(routeId, cachedOptions);
65751
+ if (!cachedOptions.forceRefresh && ttlMs > 0) {
65532
65752
  const cached2 = await getCachedModels(cacheKey, ttlMs);
65533
65753
  if (cached2) {
65534
65754
  return {
@@ -65565,11 +65785,13 @@ async function discoverModelsForRoute(routeId, options) {
65565
65785
  };
65566
65786
  }
65567
65787
  try {
65568
- const discovered = await runDiscovery(routeId, options);
65788
+ const discoveryOptions = await resolveDiscoveryRequestOptions(routeId, options);
65789
+ const discoveryCacheKey = getDiscoveryCacheKey(routeId, discoveryOptions);
65790
+ const discovered = await runDiscovery(routeId, discoveryOptions);
65569
65791
  if (discovered === null) {
65570
65792
  throw new Error(`Discovery failed for route ${routeId}`);
65571
65793
  }
65572
- await setCachedModels(cacheKey, { models: discovered });
65794
+ await setCachedModels(discoveryCacheKey, { models: discovered });
65573
65795
  return {
65574
65796
  routeId,
65575
65797
  models: mergeCatalogEntries(staticEntries, discovered),
@@ -65611,7 +65833,10 @@ async function refreshStartupDiscoveryForRoute(routeId, options) {
65611
65833
  return null;
65612
65834
  }
65613
65835
  const ttlMs = getDiscoveryCacheTtlMs(routeId);
65614
- const cacheKey = getDiscoveryCacheKey(routeId, options);
65836
+ const cachedOptions = await resolveDiscoveryRequestOptions(routeId, options, {
65837
+ refreshXaiOAuth: false
65838
+ });
65839
+ const cacheKey = getDiscoveryCacheKey(routeId, cachedOptions);
65615
65840
  if (ttlMs > 0) {
65616
65841
  const cached2 = await getCachedModels(cacheKey, ttlMs);
65617
65842
  if (cached2) {
@@ -65629,6 +65854,7 @@ async function refreshStartupDiscoveryForRoute(routeId, options) {
65629
65854
  forceRefresh: true
65630
65855
  });
65631
65856
  }
65857
+ var FNV1A_128_OFFSET_BASIS = 0x6c62272e07bb014262b821756295c58dn, FNV1A_128_PRIME = 0x0000000001000000000000000000013bn;
65632
65858
  var init_discoveryService = __esm(() => {
65633
65859
  init_discoveryCache();
65634
65860
  init_integrations();
@@ -65637,6 +65863,7 @@ var init_discoveryService = __esm(() => {
65637
65863
  init_credentialPool();
65638
65864
  init_providerCustomHeaders();
65639
65865
  init_config();
65866
+ init_xaiCredentials();
65640
65867
  });
65641
65868
 
65642
65869
  // src/integrations/runtimeMetadata.ts
@@ -65875,13 +66102,17 @@ function findCachedCatalogEntryForApiName(routeId, modelApiName, runtimeEnv) {
65875
66102
  return null;
65876
66103
  }
65877
66104
  const baseUrl = runtimeEnv.OPENAI_BASE_URL ?? runtimeEnv.OPENAI_API_BASE;
66105
+ let apiKey = firstUsableCredential(resolveRouteCredentialValue({ routeId, baseUrl, processEnv: runtimeEnv }));
66106
+ let cacheIdentity;
66107
+ if (!apiKey && routeId === "xai" && isCanonicalXaiInferenceBaseUrl(baseUrl)) {
66108
+ const credentials = getCachedXaiCredentials();
66109
+ apiKey = firstUsableCredential(credentials?.accessToken);
66110
+ cacheIdentity = getXaiDiscoveryCacheIdentity(credentials) ?? apiKey;
66111
+ }
65878
66112
  const cacheKey = getDiscoveryCacheKey(routeId, {
65879
66113
  baseUrl,
65880
- apiKey: firstUsableCredential(resolveRouteCredentialValue({
65881
- routeId,
65882
- baseUrl,
65883
- processEnv: runtimeEnv
65884
- })),
66114
+ apiKey,
66115
+ cacheKey: cacheIdentity,
65885
66116
  headers: parseCustomHeadersEnv(runtimeEnv.ANTHROPIC_CUSTOM_HEADERS)
65886
66117
  });
65887
66118
  const cached2 = getCachedModelsSync(cacheKey, getDiscoveryCacheTtlMs(routeId));
@@ -65942,6 +66173,7 @@ var init_runtimeMetadata = __esm(() => {
65942
66173
  init_credentialPool();
65943
66174
  init_zaiGlmShim();
65944
66175
  init_settings2();
66176
+ init_xaiCredentials();
65945
66177
  init_config();
65946
66178
  });
65947
66179
 
@@ -66950,7 +67182,7 @@ function getAttributionHeader(fingerprint) {
66950
67182
  if (!isAttributionHeaderEnabled()) {
66951
67183
  return "";
66952
67184
  }
66953
- const version2 = `${"0.28.1-by-rayss"}.${fingerprint}`;
67185
+ const version2 = `${"0.28.3-by-rayss"}.${fingerprint}`;
66954
67186
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
66955
67187
  const cch = "";
66956
67188
  const workload = getWorkload();
@@ -70653,7 +70885,8 @@ var init_config2 = __esm(() => {
70653
70885
  "logoColor",
70654
70886
  "maxMessagesCompactionThreshold",
70655
70887
  "compactModel",
70656
- "disabledMcpServers"
70888
+ "disabledMcpServers",
70889
+ "enabledMcpServers"
70657
70890
  ];
70658
70891
  PROJECT_CONFIG_KEYS = [
70659
70892
  "allowedTools",
@@ -94718,7 +94951,7 @@ var init_configs = __esm(() => {
94718
94951
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94719
94952
  minimax: "MiniMax-M2.5",
94720
94953
  "xiaomi-mimo": "mimo-v2.5-pro",
94721
- xai: "grok-4.3"
94954
+ xai: "grok-4.6"
94722
94955
  };
94723
94956
  CLAUDE_3_5_V2_SONNET_CONFIG = {
94724
94957
  firstParty: "claude-3-5-sonnet-20241022",
@@ -94733,7 +94966,7 @@ var init_configs = __esm(() => {
94733
94966
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94734
94967
  minimax: "MiniMax-M2.5",
94735
94968
  "xiaomi-mimo": "mimo-v2.5-pro",
94736
- xai: "grok-4.3"
94969
+ xai: "grok-4.6"
94737
94970
  };
94738
94971
  CLAUDE_3_5_HAIKU_CONFIG = {
94739
94972
  firstParty: "claude-3-5-haiku-20241022",
@@ -94748,7 +94981,7 @@ var init_configs = __esm(() => {
94748
94981
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94749
94982
  minimax: "MiniMax-M2.5",
94750
94983
  "xiaomi-mimo": "mimo-v2.5-pro",
94751
- xai: "grok-4.3"
94984
+ xai: "grok-4.6"
94752
94985
  };
94753
94986
  CLAUDE_HAIKU_4_5_CONFIG = {
94754
94987
  firstParty: "claude-haiku-4-5-20251001",
@@ -94763,7 +94996,7 @@ var init_configs = __esm(() => {
94763
94996
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94764
94997
  minimax: "MiniMax-M2.5",
94765
94998
  "xiaomi-mimo": "mimo-v2.5-pro",
94766
- xai: "grok-4.3"
94999
+ xai: "grok-4.6"
94767
95000
  };
94768
95001
  CLAUDE_SONNET_4_CONFIG = {
94769
95002
  firstParty: "claude-sonnet-4-20250514",
@@ -94778,7 +95011,7 @@ var init_configs = __esm(() => {
94778
95011
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94779
95012
  minimax: "MiniMax-M2.5",
94780
95013
  "xiaomi-mimo": "mimo-v2.5-pro",
94781
- xai: "grok-4.3"
95014
+ xai: "grok-4.6"
94782
95015
  };
94783
95016
  CLAUDE_SONNET_4_5_CONFIG = {
94784
95017
  firstParty: "claude-sonnet-4-5-20250929",
@@ -94793,7 +95026,7 @@ var init_configs = __esm(() => {
94793
95026
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94794
95027
  minimax: "MiniMax-M2.5",
94795
95028
  "xiaomi-mimo": "mimo-v2.5-pro",
94796
- xai: "grok-4.3"
95029
+ xai: "grok-4.6"
94797
95030
  };
94798
95031
  CLAUDE_OPUS_4_CONFIG = {
94799
95032
  firstParty: "claude-opus-4-20250514",
@@ -94808,7 +95041,7 @@ var init_configs = __esm(() => {
94808
95041
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94809
95042
  minimax: "MiniMax-M2.5",
94810
95043
  "xiaomi-mimo": "mimo-v2.5-pro",
94811
- xai: "grok-4.3"
95044
+ xai: "grok-4.6"
94812
95045
  };
94813
95046
  CLAUDE_OPUS_4_1_CONFIG = {
94814
95047
  firstParty: "claude-opus-4-1-20250805",
@@ -94823,7 +95056,7 @@ var init_configs = __esm(() => {
94823
95056
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94824
95057
  minimax: "MiniMax-M2.5",
94825
95058
  "xiaomi-mimo": "mimo-v2.5-pro",
94826
- xai: "grok-4.3"
95059
+ xai: "grok-4.6"
94827
95060
  };
94828
95061
  CLAUDE_OPUS_4_5_CONFIG = {
94829
95062
  firstParty: "claude-opus-4-5-20251101",
@@ -94838,7 +95071,7 @@ var init_configs = __esm(() => {
94838
95071
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94839
95072
  minimax: "MiniMax-M2.5",
94840
95073
  "xiaomi-mimo": "mimo-v2.5-pro",
94841
- xai: "grok-4.3"
95074
+ xai: "grok-4.6"
94842
95075
  };
94843
95076
  CLAUDE_OPUS_4_6_CONFIG = {
94844
95077
  firstParty: "claude-opus-4-6",
@@ -94853,7 +95086,7 @@ var init_configs = __esm(() => {
94853
95086
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94854
95087
  minimax: "MiniMax-M2.5",
94855
95088
  "xiaomi-mimo": "mimo-v2.5-pro",
94856
- xai: "grok-4.3"
95089
+ xai: "grok-4.6"
94857
95090
  };
94858
95091
  CLAUDE_OPUS_4_7_CONFIG = {
94859
95092
  firstParty: "claude-opus-4-7",
@@ -94868,7 +95101,7 @@ var init_configs = __esm(() => {
94868
95101
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94869
95102
  minimax: "MiniMax-M2.5",
94870
95103
  "xiaomi-mimo": "mimo-v2.5-pro",
94871
- xai: "grok-4.3"
95104
+ xai: "grok-4.6"
94872
95105
  };
94873
95106
  CLAUDE_OPUS_4_8_CONFIG = {
94874
95107
  firstParty: "claude-opus-4-8",
@@ -94883,7 +95116,7 @@ var init_configs = __esm(() => {
94883
95116
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94884
95117
  minimax: "MiniMax-M2.5",
94885
95118
  "xiaomi-mimo": "mimo-v2.5-pro",
94886
- xai: "grok-4.3"
95119
+ xai: "grok-4.6"
94887
95120
  };
94888
95121
  CLAUDE_SONNET_4_6_CONFIG = {
94889
95122
  firstParty: "claude-sonnet-4-6",
@@ -94898,7 +95131,7 @@ var init_configs = __esm(() => {
94898
95131
  "nvidia-nim": "nvidia/llama-3.1-nemotron-70b-instruct",
94899
95132
  minimax: "MiniMax-M2.5",
94900
95133
  "xiaomi-mimo": "mimo-v2.5-pro",
94901
- xai: "grok-4.3"
95134
+ xai: "grok-4.6"
94902
95135
  };
94903
95136
  LEGACY_PROVIDER_MODEL_CONFIGS = {
94904
95137
  haiku35: CLAUDE_3_5_HAIKU_CONFIG,
@@ -95721,7 +95954,7 @@ function getSmallFastModel() {
95721
95954
  return process.env.OPENAI_MODEL || "mimo-v2-flash";
95722
95955
  }
95723
95956
  if (getAPIProvider() === "xai") {
95724
- return process.env.OPENAI_MODEL || "grok-4.3";
95957
+ return process.env.OPENAI_MODEL || getRouteDefaultModel("xai") || "grok-4.6";
95725
95958
  }
95726
95959
  return getDefaultHaikuModel();
95727
95960
  }
@@ -95784,7 +96017,7 @@ function getDefaultOpusModel() {
95784
96017
  return process.env.OPENAI_MODEL || "mimo-v2.5-pro";
95785
96018
  }
95786
96019
  if (getAPIProvider() === "xai") {
95787
- return process.env.OPENAI_MODEL || "grok-4.3";
96020
+ return process.env.OPENAI_MODEL || getRouteDefaultModel("xai") || "grok-4.6";
95788
96021
  }
95789
96022
  if (!isFirstPartyAnthropicProvider()) {
95790
96023
  return getModelStrings2().opus47;
@@ -95820,7 +96053,7 @@ function getDefaultSonnetModel() {
95820
96053
  return process.env.OPENAI_MODEL || "mimo-v2.5-pro";
95821
96054
  }
95822
96055
  if (getAPIProvider() === "xai") {
95823
- return process.env.OPENAI_MODEL || "grok-4.3";
96056
+ return process.env.OPENAI_MODEL || getRouteDefaultModel("xai") || "grok-4.6";
95824
96057
  }
95825
96058
  if (!isFirstPartyAnthropicProvider()) {
95826
96059
  return getModelStrings2().sonnet45;
@@ -95856,7 +96089,7 @@ function getDefaultHaikuModel() {
95856
96089
  return process.env.OPENAI_MODEL || "mimo-v2-flash";
95857
96090
  }
95858
96091
  if (getAPIProvider() === "xai") {
95859
- return process.env.OPENAI_MODEL || "grok-4.3";
96092
+ return process.env.OPENAI_MODEL || getRouteDefaultModel("xai") || "grok-4.6";
95860
96093
  }
95861
96094
  return getModelStrings2().haiku45;
95862
96095
  }
@@ -95894,7 +96127,7 @@ function getDefaultMainLoopModelSetting() {
95894
96127
  return process.env.OPENAI_MODEL || getRouteDefaultModel("nvidia-nim") || "nvidia/llama-3.1-nemotron-70b-instruct";
95895
96128
  }
95896
96129
  if (getAPIProvider() === "xai") {
95897
- return process.env.OPENAI_MODEL || "grok-4.3";
96130
+ return process.env.OPENAI_MODEL || getRouteDefaultModel("xai") || "grok-4.6";
95898
96131
  }
95899
96132
  if (getAPIProvider() === "minimax") {
95900
96133
  return getMiniMaxModelEnv() || "MiniMax-M3";
@@ -100280,7 +100513,7 @@ var init_metadata = __esm(() => {
100280
100513
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
100281
100514
  WHITESPACE_REGEX = /\s+/;
100282
100515
  getVersionBase = memoize_default(() => {
100283
- const match = "0.28.1-by-rayss".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
100516
+ const match = "0.28.3-by-rayss".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
100284
100517
  return match ? match[0] : undefined;
100285
100518
  });
100286
100519
  buildEnvContext = memoize_default(async () => {
@@ -100320,9 +100553,9 @@ var init_metadata = __esm(() => {
100320
100553
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
100321
100554
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
100322
100555
  isClaudeAiAuth: isClaudeAISubscriber(),
100323
- version: "0.28.1-by-rayss",
100556
+ version: "0.28.3-by-rayss",
100324
100557
  versionBase: getVersionBase(),
100325
- buildTime: "2026-08-13T14:38:49.133Z",
100558
+ buildTime: "2026-08-15T18:49:57.132Z",
100326
100559
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
100327
100560
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
100328
100561
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -108609,7 +108842,7 @@ function legacyModelSupportsEffort(model, context) {
108609
108842
  if (m.includes("haiku") || m.includes("sonnet") || m.includes("opus")) {
108610
108843
  return false;
108611
108844
  }
108612
- return getReasoningApiProvider(context) === "firstParty";
108845
+ return getReasoningApiProvider(context) === "firstParty" || getReasoningApiProvider(context) === "openai" && context?.routeId === "custom";
108613
108846
  }
108614
108847
  function resolveLegacyReasoningControl(model, context) {
108615
108848
  if (!legacyModelSupportsEffort(model, context)) {
@@ -108856,7 +109089,7 @@ function resolveAppliedEffort(model, appStateEffortValue, context) {
108856
109089
  if (envOverride === null) {
108857
109090
  return;
108858
109091
  }
108859
- if (!modelSupportsEffort(model, context)) {
109092
+ if (envOverride === undefined && appStateEffortValue === undefined && !modelSupportsEffort(model, context)) {
108860
109093
  return;
108861
109094
  }
108862
109095
  const resolved = envOverride ?? appStateEffortValue ?? getDefaultEffortForModel(model, context);
@@ -108983,7 +109216,7 @@ var init_effort = __esm(() => {
108983
109216
 
108984
109217
  // src/utils/userAgent.ts
108985
109218
  function getClaudeCodeUserAgent() {
108986
- return `claude-code/${"0.28.1-by-rayss"}`;
109219
+ return `claude-code/${"0.28.3-by-rayss"}`;
108987
109220
  }
108988
109221
 
108989
109222
  // src/utils/http.ts
@@ -108992,7 +109225,7 @@ function getUserAgent() {
108992
109225
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
108993
109226
  const workload = getWorkload();
108994
109227
  const workloadSuffix = workload ? `, workload/${workload}` : "";
108995
- return `claude-cli/${"0.28.1-by-rayss"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
109228
+ return `claude-cli/${"0.28.3-by-rayss"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
108996
109229
  }
108997
109230
  function getMCPUserAgent() {
108998
109231
  const parts = [];
@@ -109006,7 +109239,7 @@ function getMCPUserAgent() {
109006
109239
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
109007
109240
  }
109008
109241
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
109009
- return `claude-code/${"0.28.1-by-rayss"}${suffix}`;
109242
+ return `claude-code/${"0.28.3-by-rayss"}${suffix}`;
109010
109243
  }
109011
109244
  function getWebFetchUserAgent() {
109012
109245
  const supportUrl = isFirstPartyAnthropicProvider() ? "https://support.anthropic.com/" : "https://github.com/rayss868/openclaude";
@@ -121290,12 +121523,12 @@ function memoryFreshnessNote(mtimeMs) {
121290
121523
  }
121291
121524
 
121292
121525
  // src/utils/fileOperationAnalytics.ts
121293
- import { createHash as createHash3 } from "crypto";
121526
+ import { createHash as createHash2 } from "crypto";
121294
121527
  function hashFilePath(filePath) {
121295
- return createHash3("sha256").update(filePath).digest("hex").slice(0, 16);
121528
+ return createHash2("sha256").update(filePath).digest("hex").slice(0, 16);
121296
121529
  }
121297
121530
  function hashFileContent(content) {
121298
- return createHash3("sha256").update(content).digest("hex");
121531
+ return createHash2("sha256").update(content).digest("hex");
121299
121532
  }
121300
121533
  function logFileOperation(params) {
121301
121534
  const metadata = {
@@ -141252,10 +141485,10 @@ var init_managedPlugins = __esm(() => {
141252
141485
  });
141253
141486
 
141254
141487
  // src/utils/telemetry/pluginTelemetry.ts
141255
- import { createHash as createHash4 } from "crypto";
141488
+ import { createHash as createHash3 } from "crypto";
141256
141489
  function hashPluginId(name, marketplace) {
141257
141490
  const key = marketplace ? `${name}@${marketplace.toLowerCase()}` : name;
141258
- return createHash4("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16);
141491
+ return createHash3("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16);
141259
141492
  }
141260
141493
  function getTelemetryPluginScope(name, marketplace, managedNames) {
141261
141494
  if (marketplace === BUILTIN_MARKETPLACE_NAME2)
@@ -141296,7 +141529,7 @@ var init_pluginPolicy = __esm(() => {
141296
141529
  });
141297
141530
 
141298
141531
  // src/utils/plugins/pluginVersioning.ts
141299
- import { createHash as createHash5 } from "crypto";
141532
+ import { createHash as createHash4 } from "crypto";
141300
141533
  async function calculatePluginVersion(pluginId, source, manifest, installPath, providedVersion, gitCommitSha) {
141301
141534
  if (manifest?.version) {
141302
141535
  logForDebugging(`Using manifest version for ${pluginId}: ${manifest.version}`);
@@ -141310,7 +141543,7 @@ async function calculatePluginVersion(pluginId, source, manifest, installPath, p
141310
141543
  const shortSha = gitCommitSha.substring(0, 12);
141311
141544
  if (typeof source === "object" && source.source === "git-subdir") {
141312
141545
  const normPath = source.path.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
141313
- const pathHash = createHash5("sha256").update(normPath).digest("hex").substring(0, 8);
141546
+ const pathHash = createHash4("sha256").update(normPath).digest("hex").substring(0, 8);
141314
141547
  const v = `${shortSha}-${pathHash}`;
141315
141548
  logForDebugging(`Using git-subdir SHA+path version for ${pluginId}: ${v} (path=${normPath})`);
141316
141549
  return v;
@@ -143171,7 +143404,7 @@ var init_claudeai = __esm(() => {
143171
143404
  });
143172
143405
 
143173
143406
  // src/services/mcp/config.ts
143174
- import { dirname as dirname28, join as join59, parse as parse7 } from "path";
143407
+ import { join as join59 } from "path";
143175
143408
  function getEnterpriseMcpFilePath() {
143176
143409
  return join59(getManagedFilePath(), "managed-mcp.json");
143177
143410
  }
@@ -143243,40 +143476,7 @@ function getMcpConfigsByScope(scope) {
143243
143476
  }
143244
143477
  switch (scope) {
143245
143478
  case "project": {
143246
- const allServers = {};
143247
- const allErrors = [];
143248
- const dirs = [];
143249
- let currentDir = getCwd();
143250
- while (currentDir !== parse7(currentDir).root) {
143251
- dirs.push(currentDir);
143252
- currentDir = dirname28(currentDir);
143253
- }
143254
- for (const dir of dirs.reverse()) {
143255
- const mcpJsonPath = join59(dir, ".mcp.json");
143256
- const { config: config2, errors: errors3 } = parseMcpConfigFromFilePath({
143257
- filePath: mcpJsonPath,
143258
- expandVars: true,
143259
- scope: "project"
143260
- });
143261
- if (!config2) {
143262
- const nonMissingErrors = errors3.filter((e) => !e.message.startsWith("MCP config file not found"));
143263
- if (nonMissingErrors.length > 0) {
143264
- logForDebugging(`MCP config errors for ${mcpJsonPath}: ${jsonStringify(nonMissingErrors.map((e) => e.message))}`, { level: "error" });
143265
- allErrors.push(...nonMissingErrors);
143266
- }
143267
- continue;
143268
- }
143269
- if (config2.mcpServers) {
143270
- Object.assign(allServers, addScopeToServers(config2.mcpServers, scope));
143271
- }
143272
- if (errors3.length > 0) {
143273
- allErrors.push(...errors3);
143274
- }
143275
- }
143276
- return {
143277
- servers: allServers,
143278
- errors: allErrors
143279
- };
143479
+ return { servers: {}, errors: [] };
143280
143480
  }
143281
143481
  case "user": {
143282
143482
  const mcpServers = getGlobalConfig().mcpServers;
@@ -143294,19 +143494,7 @@ function getMcpConfigsByScope(scope) {
143294
143494
  };
143295
143495
  }
143296
143496
  case "local": {
143297
- const mcpServers = getCurrentProjectConfig().mcpServers;
143298
- if (!mcpServers) {
143299
- return { servers: {}, errors: [] };
143300
- }
143301
- const { config: config2, errors: errors3 } = parseMcpConfig({
143302
- configObject: { mcpServers },
143303
- expandVars: true,
143304
- scope: "local"
143305
- });
143306
- return {
143307
- servers: addScopeToServers(config2?.mcpServers, scope),
143308
- errors: errors3
143309
- };
143497
+ return { servers: {}, errors: [] };
143310
143498
  }
143311
143499
  case "enterprise": {
143312
143500
  const enterpriseMcpPath = getEnterpriseMcpFilePath();
@@ -143485,7 +143673,6 @@ var init_config4 = __esm(() => {
143485
143673
  init_platform2();
143486
143674
  init_common2();
143487
143675
  init_config2();
143488
- init_cwd2();
143489
143676
  init_debug();
143490
143677
  init_errors();
143491
143678
  init_fsOperations();
@@ -143791,11 +143978,11 @@ var init_xaa = __esm(() => {
143791
143978
  });
143792
143979
 
143793
143980
  // src/services/mcp/refreshLock.ts
143794
- import { createHash as createHash6 } from "crypto";
143981
+ import { createHash as createHash5 } from "crypto";
143795
143982
  import { mkdir as mkdir14 } from "fs/promises";
143796
143983
  import { join as join60 } from "path";
143797
143984
  function getMcpRefreshLockIdentity(serverKey) {
143798
- return createHash6("sha256").update(serverKey).digest("hex").substring(0, 32);
143985
+ return createHash5("sha256").update(serverKey).digest("hex").substring(0, 32);
143799
143986
  }
143800
143987
  function logRefreshWarning(lockIdentity, message) {
143801
143988
  try {
@@ -144048,7 +144235,7 @@ import {
144048
144235
  OAuthMetadataSchema,
144049
144236
  OAuthTokensSchema
144050
144237
  } from "@modelcontextprotocol/sdk/shared/auth.js";
144051
- import { createHash as createHash7, randomBytes as randomBytes6, randomUUID as randomUUID6 } from "crypto";
144238
+ import { createHash as createHash6, randomBytes as randomBytes6, randomUUID as randomUUID6 } from "crypto";
144052
144239
  function redactSensitiveUrlParams(url3) {
144053
144240
  try {
144054
144241
  const parsedUrl = new URL(url3);
@@ -144144,7 +144331,7 @@ function getServerKey(serverName, serverConfig) {
144144
144331
  url: serverConfig.url,
144145
144332
  headers: serverConfig.headers || {}
144146
144333
  });
144147
- const hash = createHash7("sha256").update(configJson).digest("hex").substring(0, 16);
144334
+ const hash = createHash6("sha256").update(configJson).digest("hex").substring(0, 16);
144148
144335
  return `${serverName}|${hash}`;
144149
144336
  }
144150
144337
  function wrapFetchWithStepUpDetection(baseFetch, provider, options) {
@@ -147957,7 +148144,7 @@ var require_extension = __commonJS((exports, module) => {
147957
148144
  else
147958
148145
  dest[name].push(elem);
147959
148146
  }
147960
- function parse8(header) {
148147
+ function parse7(header) {
147961
148148
  const offers = Object.create(null);
147962
148149
  let params = Object.create(null);
147963
148150
  let mustUnescape = false;
@@ -148110,7 +148297,7 @@ var require_extension = __commonJS((exports, module) => {
148110
148297
  }).join(", ");
148111
148298
  }).join(", ");
148112
148299
  }
148113
- module.exports = { format: format3, parse: parse8 };
148300
+ module.exports = { format: format3, parse: parse7 };
148114
148301
  });
148115
148302
 
148116
148303
  // node_modules/ws/lib/websocket.js
@@ -148120,7 +148307,7 @@ var require_websocket2 = __commonJS((exports, module) => {
148120
148307
  var http3 = __require("http");
148121
148308
  var net = __require("net");
148122
148309
  var tls = __require("tls");
148123
- var { randomBytes: randomBytes7, createHash: createHash8 } = __require("crypto");
148310
+ var { randomBytes: randomBytes7, createHash: createHash7 } = __require("crypto");
148124
148311
  var { Duplex: Duplex4, Readable: Readable6 } = __require("stream");
148125
148312
  var { URL: URL2 } = __require("url");
148126
148313
  var PerMessageDeflate = require_permessage_deflate2();
@@ -148141,7 +148328,7 @@ var require_websocket2 = __commonJS((exports, module) => {
148141
148328
  var {
148142
148329
  EventTarget: { addEventListener, removeEventListener }
148143
148330
  } = require_event_target();
148144
- var { format: format3, parse: parse8 } = require_extension();
148331
+ var { format: format3, parse: parse7 } = require_extension();
148145
148332
  var { toBuffer } = require_buffer_util();
148146
148333
  var kAborted = Symbol("kAborted");
148147
148334
  var protocolVersions = [8, 13];
@@ -148663,7 +148850,7 @@ var require_websocket2 = __commonJS((exports, module) => {
148663
148850
  abortHandshake(websocket, socket, "Invalid Upgrade header");
148664
148851
  return;
148665
148852
  }
148666
- const digest = createHash8("sha1").update(key + GUID).digest("base64");
148853
+ const digest = createHash7("sha1").update(key + GUID).digest("base64");
148667
148854
  if (res.headers["sec-websocket-accept"] !== digest) {
148668
148855
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
148669
148856
  return;
@@ -148694,7 +148881,7 @@ var require_websocket2 = __commonJS((exports, module) => {
148694
148881
  }
148695
148882
  let extensions;
148696
148883
  try {
148697
- extensions = parse8(secWebSocketExtensions);
148884
+ extensions = parse7(secWebSocketExtensions);
148698
148885
  } catch (err2) {
148699
148886
  const message = "Invalid Sec-WebSocket-Extensions header";
148700
148887
  abortHandshake(websocket, socket, message);
@@ -148991,7 +149178,7 @@ var require_stream = __commonJS((exports, module) => {
148991
149178
  // node_modules/ws/lib/subprotocol.js
148992
149179
  var require_subprotocol = __commonJS((exports, module) => {
148993
149180
  var { tokenChars } = require_validation3();
148994
- function parse8(header) {
149181
+ function parse7(header) {
148995
149182
  const protocols = new Set;
148996
149183
  let start = -1;
148997
149184
  let end = -1;
@@ -149030,7 +149217,7 @@ var require_subprotocol = __commonJS((exports, module) => {
149030
149217
  protocols.add(protocol);
149031
149218
  return protocols;
149032
149219
  }
149033
- module.exports = { parse: parse8 };
149220
+ module.exports = { parse: parse7 };
149034
149221
  });
149035
149222
 
149036
149223
  // node_modules/ws/lib/websocket-server.js
@@ -149038,7 +149225,7 @@ var require_websocket_server = __commonJS((exports, module) => {
149038
149225
  var EventEmitter4 = __require("events");
149039
149226
  var http3 = __require("http");
149040
149227
  var { Duplex: Duplex4 } = __require("stream");
149041
- var { createHash: createHash8 } = __require("crypto");
149228
+ var { createHash: createHash7 } = __require("crypto");
149042
149229
  var extension = require_extension();
149043
149230
  var PerMessageDeflate = require_permessage_deflate2();
149044
149231
  var subprotocol = require_subprotocol();
@@ -149253,7 +149440,7 @@ var require_websocket_server = __commonJS((exports, module) => {
149253
149440
  }
149254
149441
  if (this._state > RUNNING)
149255
149442
  return abortHandshake(socket, 503);
149256
- const digest = createHash8("sha1").update(key + GUID).digest("base64");
149443
+ const digest = createHash7("sha1").update(key + GUID).digest("base64");
149257
149444
  const headers = [
149258
149445
  "HTTP/1.1 101 Switching Protocols",
149259
149446
  "Upgrade: websocket",
@@ -149394,7 +149581,7 @@ var init_claude_for_chrome_mcp = __esm(() => {
149394
149581
  function initializeAnalyticsSink() {}
149395
149582
 
149396
149583
  // src/utils/fingerprint.ts
149397
- import { createHash as createHash8 } from "crypto";
149584
+ import { createHash as createHash7 } from "crypto";
149398
149585
  function extractFirstMessageText(messages) {
149399
149586
  const firstUserMessage = messages.find((msg) => msg.type === "user" && !msg.isMeta) ?? messages.find((msg) => msg.type === "user");
149400
149587
  if (!firstUserMessage) {
@@ -149416,12 +149603,12 @@ function computeFingerprint(messageText, version2) {
149416
149603
  const indices = [4, 7, 20];
149417
149604
  const chars = indices.map((i3) => messageText[i3] || "0").join("");
149418
149605
  const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version2}`;
149419
- const hash = createHash8("sha256").update(fingerprintInput).digest("hex");
149606
+ const hash = createHash7("sha256").update(fingerprintInput).digest("hex");
149420
149607
  return hash.slice(0, 3);
149421
149608
  }
149422
149609
  function computeFingerprintFromMessages(messages) {
149423
149610
  const firstMessageText = extractFirstMessageText(messages);
149424
- return computeFingerprint(firstMessageText, "0.28.1-by-rayss");
149611
+ return computeFingerprint(firstMessageText, "0.28.3-by-rayss");
149425
149612
  }
149426
149613
  var FINGERPRINT_SALT = "59cf53e54c78";
149427
149614
  var init_fingerprint = () => {};
@@ -149463,7 +149650,7 @@ async function sideQuery(opts) {
149463
149650
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
149464
149651
  }
149465
149652
  const messageText = extractFirstUserMessageText(messages);
149466
- const fingerprint = computeFingerprint(messageText, "0.28.1-by-rayss");
149653
+ const fingerprint = computeFingerprint(messageText, "0.28.3-by-rayss");
149467
149654
  const attributionHeader = getAttributionHeader(fingerprint);
149468
149655
  const systemBlocks = [
149469
149656
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -149787,7 +149974,7 @@ import {
149787
149974
  } from "@modelcontextprotocol/sdk/types.js";
149788
149975
  import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
149789
149976
  import { mkdir as mkdir15, readFile as readFile15, unlink as unlink6, writeFile as writeFile13 } from "fs/promises";
149790
- import { dirname as dirname29, join as join62 } from "path";
149977
+ import { dirname as dirname28, join as join62 } from "path";
149791
149978
  function isMcpSessionExpiredError(error40) {
149792
149979
  const httpStatus = "code" in error40 ? error40.code : undefined;
149793
149980
  if (httpStatus !== 404) {
@@ -149812,7 +149999,7 @@ function setMcpAuthCacheEntry(serverId) {
149812
149999
  const cache = await getMcpAuthCache();
149813
150000
  cache[serverId] = { timestamp: Date.now() };
149814
150001
  const cachePath = getMcpAuthCachePath();
149815
- await mkdir15(dirname29(cachePath), { recursive: true });
150002
+ await mkdir15(dirname28(cachePath), { recursive: true });
149816
150003
  await writeFile13(cachePath, jsonStringify(cache));
149817
150004
  authCachePromise = null;
149818
150005
  }).catch(() => {});
@@ -150783,7 +150970,7 @@ var init_client2 = __esm(() => {
150783
150970
  const client = new Client({
150784
150971
  name: "claude-code",
150785
150972
  title: "OpenClaude",
150786
- version: "0.28.1-by-rayss",
150973
+ version: "0.28.3-by-rayss",
150787
150974
  description: "OpenClaude — coding-agent CLI for any LLM provider",
150788
150975
  websiteUrl: PRODUCT_URL
150789
150976
  }, {
@@ -154687,7 +154874,7 @@ var require_parse5 = __commonJS((exports, module) => {
154687
154874
  }
154688
154875
  return { risky: false };
154689
154876
  };
154690
- var parse8 = (input, options2) => {
154877
+ var parse7 = (input, options2) => {
154691
154878
  if (typeof input !== "string") {
154692
154879
  throw new TypeError("Expected a string");
154693
154880
  }
@@ -154858,7 +155045,7 @@ var require_parse5 = __commonJS((exports, module) => {
154858
155045
  output = token.close = `)$))${extglobStar}`;
154859
155046
  }
154860
155047
  if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
154861
- const expression = parse8(rest, { ...options2, fastpaths: false }).output;
155048
+ const expression = parse7(rest, { ...options2, fastpaths: false }).output;
154862
155049
  output = token.close = `)${expression})${extglobStar})`;
154863
155050
  }
154864
155051
  if (token.prev.type === "bos") {
@@ -155384,7 +155571,7 @@ var require_parse5 = __commonJS((exports, module) => {
155384
155571
  }
155385
155572
  return state;
155386
155573
  };
155387
- parse8.fastpaths = (input, options2) => {
155574
+ parse7.fastpaths = (input, options2) => {
155388
155575
  const opts = { ...options2 };
155389
155576
  const max2 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
155390
155577
  const len = input.length;
@@ -155452,13 +155639,13 @@ var require_parse5 = __commonJS((exports, module) => {
155452
155639
  }
155453
155640
  return source;
155454
155641
  };
155455
- module.exports = parse8;
155642
+ module.exports = parse7;
155456
155643
  });
155457
155644
 
155458
155645
  // node_modules/picomatch/lib/picomatch.js
155459
155646
  var require_picomatch = __commonJS((exports, module) => {
155460
155647
  var scan = require_scan();
155461
- var parse8 = require_parse5();
155648
+ var parse7 = require_parse5();
155462
155649
  var utils = require_utils3();
155463
155650
  var constants5 = require_constants8();
155464
155651
  var isObject5 = (val) => val && typeof val === "object" && !Array.isArray(val);
@@ -155548,7 +155735,7 @@ var require_picomatch = __commonJS((exports, module) => {
155548
155735
  picomatch.parse = (pattern, options2) => {
155549
155736
  if (Array.isArray(pattern))
155550
155737
  return pattern.map((p) => picomatch.parse(p, options2));
155551
- return parse8(pattern, { ...options2, fastpaths: false });
155738
+ return parse7(pattern, { ...options2, fastpaths: false });
155552
155739
  };
155553
155740
  picomatch.scan = (input, options2) => scan(input, options2);
155554
155741
  picomatch.compileRe = (state, options2, returnOutput = false, returnState = false) => {
@@ -155574,10 +155761,10 @@ var require_picomatch = __commonJS((exports, module) => {
155574
155761
  }
155575
155762
  let parsed = { negated: false, fastpaths: true };
155576
155763
  if (options2.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
155577
- parsed.output = parse8.fastpaths(input, options2);
155764
+ parsed.output = parse7.fastpaths(input, options2);
155578
155765
  }
155579
155766
  if (!parsed.output) {
155580
- parsed = parse8(input, options2);
155767
+ parsed = parse7(input, options2);
155581
155768
  }
155582
155769
  return picomatch.compileRe(parsed, options2, returnOutput, returnState);
155583
155770
  };
@@ -155707,11 +155894,11 @@ __export(exports_claudemd, {
155707
155894
  });
155708
155895
  import {
155709
155896
  basename as basename17,
155710
- dirname as dirname30,
155897
+ dirname as dirname29,
155711
155898
  extname as extname5,
155712
155899
  isAbsolute as isAbsolute13,
155713
155900
  join as join64,
155714
- parse as parse8,
155901
+ parse as parse7,
155715
155902
  relative as relative6,
155716
155903
  sep as sep13
155717
155904
  } from "path";
@@ -155836,7 +156023,7 @@ function extractIncludePathsFromTokens(tokens, basePath) {
155836
156023
  if (path11) {
155837
156024
  const isValidPath = path11.startsWith("./") || path11.startsWith("~/") || path11.startsWith("/") && path11 !== "/" || !path11.startsWith("@") && !path11.match(/^[#%^&*()]+/) && path11.match(/^[a-zA-Z0-9._-]/);
155838
156025
  if (isValidPath) {
155839
- const resolvedPath = expandPath(path11, dirname30(basePath));
156026
+ const resolvedPath = expandPath(path11, dirname29(basePath));
155840
156027
  absolutePaths.add(resolvedPath);
155841
156028
  }
155842
156029
  }
@@ -155897,7 +156084,7 @@ function resolveExcludePatterns(patterns) {
155897
156084
  }
155898
156085
  const globStart = normalized.search(/[*?{[]/);
155899
156086
  const staticPrefix = globStart === -1 ? normalized : normalized.slice(0, globStart);
155900
- const dirToResolve = dirname30(staticPrefix);
156087
+ const dirToResolve = dirname29(staticPrefix);
155901
156088
  try {
155902
156089
  const resolvedDir = fs2.realpathSync(dirToResolve).replaceAll("\\", "/");
155903
156090
  if (resolvedDir !== dirToResolve) {
@@ -156083,7 +156270,7 @@ async function processConditionedMdRules(targetPath, rulesDir, type, processedPa
156083
156270
  if (!file2.globs || file2.globs.length === 0) {
156084
156271
  return false;
156085
156272
  }
156086
- const baseDir = type === "Project" ? dirname30(dirname30(rulesDir)) : getOriginalCwd();
156273
+ const baseDir = type === "Project" ? dirname29(dirname29(rulesDir)) : getOriginalCwd();
156087
156274
  const relativePath = isAbsolute13(targetPath) ? relative6(baseDir, targetPath) : targetPath;
156088
156275
  if (!relativePath || relativePath.startsWith("..") || isAbsolute13(relativePath)) {
156089
156276
  return false;
@@ -156341,9 +156528,9 @@ var init_claudemd = __esm(() => {
156341
156528
  const dirs = [];
156342
156529
  const originalCwd = getOriginalCwd();
156343
156530
  let currentDir = originalCwd;
156344
- while (currentDir !== parse8(currentDir).root) {
156531
+ while (currentDir !== parse7(currentDir).root) {
156345
156532
  dirs.push(currentDir);
156346
- currentDir = dirname30(currentDir);
156533
+ currentDir = dirname29(currentDir);
156347
156534
  }
156348
156535
  const gitRoot = findGitRoot(originalCwd);
156349
156536
  const canonicalRoot = findCanonicalGitRoot(originalCwd);
@@ -159066,7 +159253,7 @@ var permissions_anthropic_default = "";
159066
159253
 
159067
159254
  // src/utils/permissions/yoloClassifier.ts
159068
159255
  import { mkdir as mkdir16, writeFile as writeFile14 } from "fs/promises";
159069
- import { dirname as dirname31, join as join65 } from "path";
159256
+ import { dirname as dirname30, join as join65 } from "path";
159070
159257
  function txtRequire(mod) {
159071
159258
  return typeof mod === "string" ? mod : mod.default;
159072
159259
  }
@@ -159098,7 +159285,7 @@ function getAutoModeClassifierErrorDumpPath() {
159098
159285
  async function dumpErrorPrompts(systemPrompt, userPrompt, error40, contextInfo) {
159099
159286
  try {
159100
159287
  const path11 = getAutoModeClassifierErrorDumpPath();
159101
- await mkdir16(dirname31(path11), { recursive: true });
159288
+ await mkdir16(dirname30(path11), { recursive: true });
159102
159289
  const content = `=== ERROR ===
159103
159290
  ${errorMessage(error40)}
159104
159291
 
@@ -162262,7 +162449,7 @@ function isSkillSearchEnabled() {
162262
162449
  }
162263
162450
 
162264
162451
  // src/tools/SkillTool/SkillTool.ts
162265
- import { dirname as dirname32 } from "path";
162452
+ import { dirname as dirname31 } from "path";
162266
162453
  async function getAllCommands(context2) {
162267
162454
  const mcpSkills = context2.getAppState().mcp.commands.filter((cmd) => cmd.type === "prompt" && cmd.loadedFrom === "mcp");
162268
162455
  if (mcpSkills.length === 0)
@@ -162466,7 +162653,7 @@ async function executeRemoteSkill(slug, commandName, parentMessage, context2) {
162466
162653
  recordSkillUsage(commandName);
162467
162654
  logForDebugging(`SkillTool loaded remote skill ${slug} (cacheHit=${cacheHit}, ${latencyMs}ms, ${content.length} chars)`);
162468
162655
  const { content: bodyContent } = parseFrontmatter(content, skillPath);
162469
- const skillDir = dirname32(skillPath);
162656
+ const skillDir = dirname31(skillPath);
162470
162657
  const normalizedDir = process.platform === "win32" ? skillDir.replace(/\\/g, "/") : skillDir;
162471
162658
  let finalContent = `Base directory for this skill: ${normalizedDir}
162472
162659
 
@@ -163701,7 +163888,7 @@ function checkTeamMemSecrets(filePath, content) {
163701
163888
  }
163702
163889
 
163703
163890
  // src/utils/fileHistory.ts
163704
- import { createHash as createHash9 } from "crypto";
163891
+ import { createHash as createHash8 } from "crypto";
163705
163892
  import {
163706
163893
  chmod as chmod3,
163707
163894
  copyFile as copyFile3,
@@ -163711,7 +163898,7 @@ import {
163711
163898
  stat as stat18,
163712
163899
  unlink as unlink7
163713
163900
  } from "fs/promises";
163714
- import { dirname as dirname33, isAbsolute as isAbsolute14, join as join66, relative as relative7 } from "path";
163901
+ import { dirname as dirname32, isAbsolute as isAbsolute14, join as join66, relative as relative7 } from "path";
163715
163902
  function fileHistoryEnabled() {
163716
163903
  if (getIsNonInteractiveSession()) {
163717
163904
  return fileHistoryEnabledSdk();
@@ -164093,7 +164280,7 @@ async function computeDiffStatsForFile(originalFile, backupFileName) {
164093
164280
  };
164094
164281
  }
164095
164282
  function getBackupFileName(filePath, version2) {
164096
- const fileNameHash = createHash9("sha256").update(filePath).digest("hex").slice(0, 16);
164283
+ const fileNameHash = createHash8("sha256").update(filePath).digest("hex").slice(0, 16);
164097
164284
  return `${fileNameHash}@v${version2}`;
164098
164285
  }
164099
164286
  function resolveBackupPath(backupFileName, sessionId) {
@@ -164120,7 +164307,7 @@ async function createBackup(filePath, version2) {
164120
164307
  } catch (e) {
164121
164308
  if (!isENOENT(e))
164122
164309
  throw e;
164123
- await mkdir17(dirname33(backupPath), { recursive: true });
164310
+ await mkdir17(dirname32(backupPath), { recursive: true });
164124
164311
  await copyFile3(filePath, backupPath);
164125
164312
  }
164126
164313
  await chmod3(backupPath, srcStats.mode);
@@ -164152,7 +164339,7 @@ async function restoreBackup(filePath, backupFileName) {
164152
164339
  } catch (e) {
164153
164340
  if (!isENOENT(e))
164154
164341
  throw e;
164155
- await mkdir17(dirname33(filePath), { recursive: true });
164342
+ await mkdir17(dirname32(filePath), { recursive: true });
164156
164343
  await copyFile3(backupPath, filePath);
164157
164344
  }
164158
164345
  await chmod3(filePath, backupStats.mode);
@@ -164233,9 +164420,9 @@ var init_fileHistory = __esm(() => {
164233
164420
 
164234
164421
  // src/utils/gitDiff.ts
164235
164422
  import { access as access2, readFile as readFile17 } from "fs/promises";
164236
- import { dirname as dirname34, join as join67, relative as relative8, sep as sep14 } from "path";
164423
+ import { dirname as dirname33, join as join67, relative as relative8, sep as sep14 } from "path";
164237
164424
  async function fetchSingleFileGitDiff(absoluteFilePath) {
164238
- const gitRoot = findGitRoot(dirname34(absoluteFilePath));
164425
+ const gitRoot = findGitRoot(dirname33(absoluteFilePath));
164239
164426
  if (!gitRoot)
164240
164427
  return null;
164241
164428
  const gitPath = relative8(gitRoot, absoluteFilePath).split(sep14).join("/");
@@ -164437,7 +164624,7 @@ var init_types4 = __esm(() => {
164437
164624
  });
164438
164625
 
164439
164626
  // src/tools/FileEditTool/FileEditTool.ts
164440
- import { dirname as dirname35, isAbsolute as isAbsolute15, sep as sep15 } from "path";
164627
+ import { dirname as dirname34, isAbsolute as isAbsolute15, sep as sep15 } from "path";
164441
164628
  function readFileForEdit(absoluteFilePath) {
164442
164629
  try {
164443
164630
  const meta = readFileSyncWithMetadata(absoluteFilePath);
@@ -164737,7 +164924,7 @@ String: ${old_string}`,
164737
164924
  activateConditionalSkillsForPaths([absoluteFilePath], cwd2);
164738
164925
  }
164739
164926
  await diagnosticTracker.beforeFileEditedCompat(absoluteFilePath);
164740
- await fs2.mkdir(dirname35(absoluteFilePath));
164927
+ await fs2.mkdir(dirname34(absoluteFilePath));
164741
164928
  if (fileHistoryEnabled()) {
164742
164929
  await fileHistoryTrackEdit(updateFileHistoryState, absoluteFilePath, parentMessage.uuid);
164743
164930
  }
@@ -164847,7 +165034,7 @@ String: ${old_string}`,
164847
165034
  });
164848
165035
 
164849
165036
  // src/tools/FileWriteTool/FileWriteTool.ts
164850
- import { dirname as dirname36, sep as sep16 } from "path";
165037
+ import { dirname as dirname35, sep as sep16 } from "path";
164851
165038
  var inputSchema11, outputSchema9, FileWriteTool;
164852
165039
  var init_FileWriteTool = __esm(() => {
164853
165040
  init_v4();
@@ -164986,7 +165173,7 @@ var init_FileWriteTool = __esm(() => {
164986
165173
  },
164987
165174
  async call({ file_path, content }, { readFileState, updateFileHistoryState, dynamicSkillDirTriggers }, _, parentMessage) {
164988
165175
  const fullFilePath = expandPath(file_path);
164989
- const dir = dirname36(fullFilePath);
165176
+ const dir = dirname35(fullFilePath);
164990
165177
  const cwd2 = getCwd();
164991
165178
  const newSkillDirs = await discoverSkillDirsForPaths([fullFilePath], cwd2);
164992
165179
  if (newSkillDirs.length > 0) {
@@ -165128,7 +165315,7 @@ var init_FileWriteTool = __esm(() => {
165128
165315
  });
165129
165316
 
165130
165317
  // src/utils/plugins/orphanedPluginFilter.ts
165131
- import { dirname as dirname37, isAbsolute as isAbsolute16, join as join68, normalize as normalize11, relative as relative9, sep as sep17 } from "path";
165318
+ import { dirname as dirname36, isAbsolute as isAbsolute16, join as join68, normalize as normalize11, relative as relative9, sep as sep17 } from "path";
165132
165319
  async function getGlobExclusionsForPluginCache(searchPath) {
165133
165320
  const cachePath = normalize11(join68(getPluginsDirectory(), "cache"));
165134
165321
  if (searchPath && !pathsOverlap(searchPath, cachePath)) {
@@ -165148,7 +165335,7 @@ async function getGlobExclusionsForPluginCache(searchPath) {
165148
165335
  ORPHANED_AT_FILENAME
165149
165336
  ], cachePath, new AbortController().signal);
165150
165337
  cachedExclusions = markers.map((markerPath) => {
165151
- const versionDir = dirname37(markerPath);
165338
+ const versionDir = dirname36(markerPath);
165152
165339
  const rel = isAbsolute16(versionDir) ? relative9(cachePath, versionDir) : versionDir;
165153
165340
  const posixRelative = rel.replace(/\\/g, "/");
165154
165341
  return `!**/${posixRelative}/**`;
@@ -165175,12 +165362,12 @@ var init_orphanedPluginFilter = __esm(() => {
165175
165362
  });
165176
165363
 
165177
165364
  // src/utils/glob.ts
165178
- import { basename as basename19, dirname as dirname38, isAbsolute as isAbsolute17, join as join69, sep as sep18 } from "path";
165365
+ import { basename as basename19, dirname as dirname37, isAbsolute as isAbsolute17, join as join69, sep as sep18 } from "path";
165179
165366
  function extractGlobBaseDirectory(pattern) {
165180
165367
  const globChars = /[*?[{]/;
165181
165368
  const match = pattern.match(globChars);
165182
165369
  if (!match || match.index === undefined) {
165183
- const dir = dirname38(pattern);
165370
+ const dir = dirname37(pattern);
165184
165371
  const file2 = basename19(pattern);
165185
165372
  return { baseDir: dir, relativePattern: file2 };
165186
165373
  }
@@ -170677,7 +170864,7 @@ var require_events2 = __commonJS((exports, module) => {
170677
170864
  var require_style_parser = __commonJS((exports) => {
170678
170865
  Object.defineProperty(exports, "__esModule", { value: true });
170679
170866
  exports.hyphenate = exports.parse = undefined;
170680
- function parse9(value) {
170867
+ function parse8(value) {
170681
170868
  const styles4 = [];
170682
170869
  let i3 = 0;
170683
170870
  let parenDepth = 0;
@@ -170731,7 +170918,7 @@ var require_style_parser = __commonJS((exports) => {
170731
170918
  }
170732
170919
  return styles4;
170733
170920
  }
170734
- exports.parse = parse9;
170921
+ exports.parse = parse8;
170735
170922
  function hyphenate(value) {
170736
170923
  return value.replace(/[a-z][A-Z]/g, (v) => {
170737
170924
  return v.charAt(0) + "-" + v.charAt(1);
@@ -170742,7 +170929,7 @@ var require_style_parser = __commonJS((exports) => {
170742
170929
 
170743
170930
  // node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js
170744
170931
  var require_CSSStyleDeclaration = __commonJS((exports, module) => {
170745
- var { parse: parse9 } = require_style_parser();
170932
+ var { parse: parse8 } = require_style_parser();
170746
170933
  module.exports = function(elt) {
170747
170934
  const style = new CSSStyleDeclaration(elt);
170748
170935
  const handler = {
@@ -170778,7 +170965,7 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => {
170778
170965
  if (!value) {
170779
170966
  return result;
170780
170967
  }
170781
- const styleValues = parse9(value);
170968
+ const styleValues = parse8(value);
170782
170969
  if (styleValues.length < 2) {
170783
170970
  return result;
170784
170971
  }
@@ -186061,6 +186248,10 @@ var init_types7 = __esm(() => {
186061
186248
  });
186062
186249
 
186063
186250
  // src/tools/WebSearchTool/providers/custom.ts
186251
+ function readPositiveEnvNumber(raw, fallback) {
186252
+ const parsed = Number(raw);
186253
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
186254
+ }
186064
186255
  function ipv4DottedToInt(ip) {
186065
186256
  const parts = ip.split(".");
186066
186257
  if (parts.length !== 4)
@@ -186317,7 +186508,7 @@ function buildRequest(query3) {
186317
186508
  const bodyTemplate = process.env.WEB_BODY_TEMPLATE;
186318
186509
  if (bodyTemplate) {
186319
186510
  const body = bodyTemplate.replace(/\{query\}/g, query3);
186320
- const maxBodyBytes = (Number(process.env.WEB_CUSTOM_MAX_BODY_KB) || DEFAULT_MAX_BODY_KB) * 1024;
186511
+ const maxBodyBytes = readPositiveEnvNumber(process.env.WEB_CUSTOM_MAX_BODY_KB, DEFAULT_MAX_BODY_KB) * 1024;
186321
186512
  if (Buffer.byteLength(body) > maxBodyBytes) {
186322
186513
  throw new Error(`POST body exceeds ${maxBodyBytes} bytes. ` + `Increase WEB_CUSTOM_MAX_BODY_KB if needed.`);
186323
186514
  }
@@ -186375,7 +186566,7 @@ function extractHits(raw, jsonPath) {
186375
186566
  return [];
186376
186567
  }
186377
186568
  async function fetchWithRetry(url3, init, signal) {
186378
- const timeoutSec = Number(process.env.WEB_CUSTOM_TIMEOUT_SEC) || DEFAULT_TIMEOUT_SECONDS;
186569
+ const timeoutSec = readPositiveEnvNumber(process.env.WEB_CUSTOM_TIMEOUT_SEC, DEFAULT_TIMEOUT_SECONDS);
186379
186570
  const timeoutMs = timeoutSec * 1000;
186380
186571
  let lastErr;
186381
186572
  let lastStatus;
@@ -186963,7 +187154,7 @@ var require_multipart = __commonJS((exports) => {
186963
187154
 
186964
187155
  // node_modules/needle/lib/auth.js
186965
187156
  var require_auth = __commonJS((exports, module) => {
186966
- var createHash10 = __require("crypto").createHash;
187157
+ var createHash9 = __require("crypto").createHash;
186967
187158
  function get_header(header, credentials, opts) {
186968
187159
  var type = header.split(" ")[0], user = credentials[0], pass = credentials[1];
186969
187160
  if (type == "Digest") {
@@ -186973,7 +187164,7 @@ var require_auth = __commonJS((exports, module) => {
186973
187164
  }
186974
187165
  }
186975
187166
  function md5(string4) {
186976
- return createHash10("md5").update(string4).digest("hex");
187167
+ return createHash9("md5").update(string4).digest("hex");
186977
187168
  }
186978
187169
  function basic(user, pass) {
186979
187170
  var str = typeof pass == "undefined" ? user : [user, pass].join(":");
@@ -217983,7 +218174,7 @@ async function getTurnZeroSkillDiscovery(_input, _messages, _context) {
217983
218174
 
217984
218175
  // src/utils/attachments.ts
217985
218176
  import { readdir as readdir15, stat as stat22 } from "fs/promises";
217986
- import nodePath2, { dirname as dirname39, parse as parse9, relative as relative11, resolve as resolve26 } from "path";
218177
+ import nodePath2, { dirname as dirname38, parse as parse8, relative as relative11, resolve as resolve26 } from "path";
217987
218178
  import { randomUUID as randomUUID11 } from "crypto";
217988
218179
  function shouldIncludeSkillListingAttachment(querySource) {
217989
218180
  return !(typeof querySource === "string" && SKILL_LISTING_SUPPRESSED_QUERY_SOURCES.has(querySource));
@@ -218462,21 +218653,21 @@ function isPathUnder(child, parent, pathApi = nodePath2) {
218462
218653
  return stripTrailingSep(pathApi.join(parent, rel)) === stripTrailingSep(pathApi.normalize(child));
218463
218654
  }
218464
218655
  function getDirectoriesToProcess(targetPath, originalCwd) {
218465
- const targetDir = dirname39(resolve26(targetPath));
218656
+ const targetDir = dirname38(resolve26(targetPath));
218466
218657
  const nestedDirs = [];
218467
218658
  let currentDir = targetDir;
218468
- while (currentDir !== originalCwd && currentDir !== parse9(currentDir).root) {
218659
+ while (currentDir !== originalCwd && currentDir !== parse8(currentDir).root) {
218469
218660
  if (isPathUnder(currentDir, originalCwd)) {
218470
218661
  nestedDirs.push(currentDir);
218471
218662
  }
218472
- currentDir = dirname39(currentDir);
218663
+ currentDir = dirname38(currentDir);
218473
218664
  }
218474
218665
  nestedDirs.reverse();
218475
218666
  const cwdLevelDirs = [];
218476
218667
  currentDir = originalCwd;
218477
- while (currentDir !== parse9(currentDir).root) {
218668
+ while (currentDir !== parse8(currentDir).root) {
218478
218669
  cwdLevelDirs.push(currentDir);
218479
- currentDir = dirname39(currentDir);
218670
+ currentDir = dirname38(currentDir);
218480
218671
  }
218481
218672
  cwdLevelDirs.reverse();
218482
218673
  return { nestedDirs, cwdLevelDirs };
@@ -219143,7 +219334,7 @@ async function* getAttachmentMessages(input, toolUseContext, ideSelection, queue
219143
219334
  }
219144
219335
  }
219145
219336
  async function tryGetPDFReference(filename) {
219146
- const ext = parse9(filename).ext.toLowerCase();
219337
+ const ext = parse8(filename).ext.toLowerCase();
219147
219338
  if (!isPDFExtension(ext)) {
219148
219339
  return null;
219149
219340
  }
@@ -219177,7 +219368,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
219177
219368
  return null;
219178
219369
  }
219179
219370
  if (mode === "at-mention" && !isFileWithinReadSizeLimit(filename, getDefaultFileReadingLimits().maxSizeBytes)) {
219180
- const ext = parse9(filename).ext.toLowerCase();
219371
+ const ext = parse8(filename).ext.toLowerCase();
219181
219372
  if (!isPDFExtension(ext)) {
219182
219373
  try {
219183
219374
  const stats = await getFsImplementation().stat(filename);
@@ -221179,7 +221370,8 @@ function isWaitingForAgent(input) {
221179
221370
  return false;
221180
221371
  return !STRONG_WAIT_OVERRIDE.test(lastText);
221181
221372
  }
221182
- function analyzeContinuationIntent(text) {
221373
+ function analyzeContinuationIntent(text, options2 = {}) {
221374
+ const { alreadyNudged = false } = options2;
221183
221375
  const lastText = text.trim();
221184
221376
  if (lastText.length === 0)
221185
221377
  return { shouldNudge: false };
@@ -221213,7 +221405,7 @@ function analyzeContinuationIntent(text) {
221213
221405
  if (hasLateContinuationSignal) {
221214
221406
  const hasTerminalPunctuation2 = /[.!??"'`)\]]\s*$/.test(lastText) || lastText.endsWith("`");
221215
221407
  if (hasTerminalPunctuation2) {
221216
- const strongIntent = /\b(i (will|shall|need to|must|should|now)|let (me|us)|je (vais|reviens)|passons à|moving on to|continuing with|proceeding to|next step is to)\b/i.test(lowerText) || /\b(saya (akan|ingin|mau|harus|perlu|sedang|cek|periksa|lihat|baca)|mari (kita)?|lalu (saya|kita)|langkah (berikutnya|selanjutnya)|mulai|melanjutkan|lanjut)\b/i.test(lowerText) || /je suis en train d'/i.test(lowerText) || /◻/.test(lastText);
221408
+ const strongIntent = STRONG_CONTINUATION_INTENT.test(lowerText) || STRONG_INDONESIAN_INTENT.test(lowerText) || /je suis en train d'/i.test(lowerText) || /◻/.test(lastText);
221217
221409
  const presentProgressive = new RegExp(`\\bnow (?:${VERB_ING})\\b`, "i").test(lateText) || new RegExp(`\\bsedang (?:${INDONESIAN_VERB_ALT})\\b`, "i").test(lateText);
221218
221410
  const hasImperativeSignal = new RegExp(`(?<!\\b(?:you|i|we|they|he|she|it)\\s+)\\bneed to (?:${VERB_ALT})\\b`, "i").test(lateText) || new RegExp(`\\bnow (?:${VERB_ALT})\\b(?!\\s+you\\b)`, "i").test(lateText) || new RegExp(`\\bnext (?:i|we)\\s+(?:need to|will|shall|should|must)?\\s*(?:${VERB_ALT})\\b`, "i").test(lateText) || new RegExp(`\\b(?:lanjut|lanjutkan|melanjutkan|mulai)\\b`, "i").test(lateText);
221219
221411
  const endsWithColon = /:\s*$/.test(lastText);
@@ -221221,19 +221413,28 @@ function analyzeContinuationIntent(text) {
221221
221413
  return { shouldNudge: true, reason: "continuation_signal" };
221222
221414
  }
221223
221415
  } else {
221224
- return { shouldNudge: true, reason: "continuation_signal" };
221416
+ const hasProgressivePrefix = new RegExp(`\\bnow (?:${VERB_ING})\\b`, "i").test(lateText) || new RegExp(`\\bsedang (?:${INDONESIAN_VERB_ALT})\\b`, "i").test(lateText);
221417
+ if (COMPLETION_MARKERS.test(lateText) && !hasProgressivePrefix && !STRONG_CONTINUATION_INTENT.test(lowerText) && !STRONG_INDONESIAN_INTENT.test(lowerText) && !/je suis en train d'/i.test(lowerText) && !/◻/.test(lastText)) {} else {
221418
+ return { shouldNudge: true, reason: "continuation_signal" };
221419
+ }
221225
221420
  }
221226
221421
  }
221422
+ if (alreadyNudged && COMPLETION_MARKERS.test(lowerText) && !STRONG_CONTINUATION_INTENT.test(lowerText) && !STRONG_INDONESIAN_INTENT.test(lowerText) && !/je suis en train d'/i.test(lowerText) && !/◻/.test(lastText)) {
221423
+ return { shouldNudge: false };
221424
+ }
221227
221425
  if (COMPLETION_MARKERS.test(lowerText) && !hasLateContinuationSignal && !CONTINUATION_SIGNALS.some((re) => re.test(lowerText))) {
221228
221426
  return { shouldNudge: false };
221229
221427
  }
221230
221428
  const hasTerminalPunctuation = /[.!??"'`)\]]\s*$/.test(lastText) || lastText.endsWith("`");
221231
221429
  if (CONTINUATION_SIGNALS.some((re) => re.test(lowerText)) && !hasTerminalPunctuation) {
221232
- return { shouldNudge: true, reason: "continuation_signal" };
221430
+ const strongIntent = STRONG_CONTINUATION_INTENT.test(lowerText) || STRONG_INDONESIAN_INTENT.test(lowerText) || /je suis en train d'/i.test(lowerText) || /◻/.test(lastText);
221431
+ if (!COMPLETION_MARKERS.test(lowerText) || strongIntent) {
221432
+ return { shouldNudge: true, reason: "continuation_signal" };
221433
+ }
221233
221434
  }
221234
221435
  return { shouldNudge: false };
221235
221436
  }
221236
- var ACTION_VERBS2, INDONESIAN_VERBS, INDONESIAN_VERB_ALT, VERB_ALT, VERB_ING, CONTINUATION_SIGNALS, COMPLETION_MARKERS, WAITING_MARKERS, STRONG_WAIT_OVERRIDE, UNFINISHED_SENTIMENT_SIGNALS;
221437
+ var ACTION_VERBS2, INDONESIAN_VERBS, INDONESIAN_VERB_ALT, VERB_ALT, VERB_ING, CONTINUATION_SIGNALS, COMPLETION_MARKERS, STRONG_CONTINUATION_INTENT, STRONG_INDONESIAN_INTENT, WAITING_MARKERS, STRONG_WAIT_OVERRIDE, UNFINISHED_SENTIMENT_SIGNALS;
221237
221438
  var init_continuation = __esm(() => {
221238
221439
  ACTION_VERBS2 = [
221239
221440
  "do",
@@ -221334,6 +221535,8 @@ var init_continuation = __esm(() => {
221334
221535
  }).join("|");
221335
221536
  CONTINUATION_SIGNALS = buildContinuationSignals();
221336
221537
  COMPLETION_MARKERS = /\b(done|finished|completed|complete|summary|that's all|that is all|all set|hope this helps|let me know if|no issues|lgtm|selesai|lengkap|beres|tuntas)\b/i;
221538
+ STRONG_CONTINUATION_INTENT = /\b(i (will|shall|need to|must|should|now)|let (me|us)|je (vais|reviens)|passons à|moving on to|continuing with|proceeding to|next step is to)\b/i;
221539
+ STRONG_INDONESIAN_INTENT = /\b(saya (akan|ingin|mau|harus|perlu|sedang|cek|periksa|lihat|baca)|mari (kita)?|lalu (saya|kita)|langkah (berikutnya|selanjutnya)|mulai|melanjutkan|lanjut)\b/i;
221337
221540
  WAITING_MARKERS = [
221338
221541
  /\bsaya (?:akan )?(?:menunggu|nunggu|tunggu)\b/i,
221339
221542
  /\b(?:menunggu|nunggu|tunggu)\s+(?:hasil|hasilnya|notifikasi|verifik|agent|subagent|proses|verifikasi)\b/i,
@@ -221513,7 +221716,7 @@ __export(exports_doomLoop, {
221513
221716
  getDoomLoopState: () => getDoomLoopState,
221514
221717
  checkDoomLoop: () => checkDoomLoop
221515
221718
  });
221516
- import { createHash as createHash10 } from "crypto";
221719
+ import { createHash as createHash9 } from "crypto";
221517
221720
  function getState(agentKey) {
221518
221721
  let state2 = stateByAgent.get(agentKey);
221519
221722
  if (!state2) {
@@ -221524,7 +221727,7 @@ function getState(agentKey) {
221524
221727
  }
221525
221728
  function computeSignature(toolName, input) {
221526
221729
  const inputStr = typeof input === "string" ? input : JSON.stringify(input) ?? "";
221527
- const digest = createHash10("sha256").update(inputStr).digest("hex");
221730
+ const digest = createHash9("sha256").update(inputStr).digest("hex");
221528
221731
  return `${toolName}::${digest}`;
221529
221732
  }
221530
221733
  function checkDoomLoop(toolName, input, options2 = {}) {
@@ -223141,32 +223344,81 @@ function normalizeToolInputForValidation(tool2, input) {
223141
223344
  if (tool2.name === FILE_READ_TOOL_NAME) {
223142
223345
  const pages = input.pages;
223143
223346
  if (pages === null || typeof pages === "string" && pages.trim() === "") {
223144
- const { pages: _pages, ...rest2 } = input;
223145
- return rest2;
223347
+ const { pages: _pages, ...rest } = input;
223348
+ return rest;
223146
223349
  }
223147
223350
  return input;
223148
223351
  }
223352
+ if (tool2.name === TASK_COMPLETE_TOOL_NAME) {
223353
+ return {};
223354
+ }
223149
223355
  if (tool2.name !== ASK_USER_QUESTION_TOOL_NAME) {
223150
223356
  return input;
223151
223357
  }
223358
+ return normalizeAskUserQuestionInput(input);
223359
+ }
223360
+ function normalizeAskUserQuestionInput(input) {
223361
+ const isOptionLike = (value) => typeof value === "string" || isRecord5(value) && typeof value.label === "string";
223362
+ const normalizeOptions2 = (options2) => {
223363
+ if (!Array.isArray(options2) || options2.length === 0)
223364
+ return null;
223365
+ if (!options2.every(isOptionLike))
223366
+ return null;
223367
+ return options2.map((option) => {
223368
+ if (typeof option === "string") {
223369
+ return { label: option, description: option };
223370
+ }
223371
+ const record2 = option;
223372
+ const label = record2.label;
223373
+ const description = typeof record2.description === "string" ? record2.description : label;
223374
+ return {
223375
+ ...record2,
223376
+ label,
223377
+ description,
223378
+ ...typeof record2.preview === "string" ? { preview: record2.preview } : {}
223379
+ };
223380
+ });
223381
+ };
223382
+ const buildQuestion = (raw) => {
223383
+ if (typeof raw.question !== "string" || typeof raw.header !== "string") {
223384
+ return null;
223385
+ }
223386
+ const options2 = normalizeOptions2(raw.options);
223387
+ if (!options2)
223388
+ return null;
223389
+ return {
223390
+ question: raw.question,
223391
+ header: raw.header,
223392
+ options: options2,
223393
+ ...typeof raw.multiSelect === "boolean" ? { multiSelect: raw.multiSelect } : {}
223394
+ };
223395
+ };
223396
+ if (typeof input.questions === "string") {
223397
+ try {
223398
+ const parsed = JSON.parse(input.questions);
223399
+ if (parsed !== null && typeof parsed === "object") {
223400
+ return normalizeAskUserQuestionInput({ ...input, questions: parsed });
223401
+ }
223402
+ } catch {}
223403
+ }
223152
223404
  if (Array.isArray(input.questions)) {
223153
223405
  return input;
223154
223406
  }
223155
- const { question, header, options: options2, multiSelect, ...rest } = input;
223156
- if (typeof question !== "string" || typeof header !== "string" || !Array.isArray(options2)) {
223157
- return input;
223407
+ if (buildQuestion(input)) {
223408
+ const { question: _q, header: _h, options: _o, multiSelect: _m, ...rest } = input;
223409
+ const question = buildQuestion(input);
223410
+ return {
223411
+ ...rest,
223412
+ questions: [question]
223413
+ };
223158
223414
  }
223159
- return {
223160
- ...rest,
223161
- questions: [
223162
- {
223163
- question,
223164
- header,
223165
- options: options2,
223166
- ...typeof multiSelect === "boolean" ? { multiSelect } : {}
223167
- }
223168
- ]
223169
- };
223415
+ if (isRecord5(input.questions) && buildQuestion(input.questions)) {
223416
+ return {
223417
+ ...input,
223418
+ questions: [buildQuestion(input.questions)]
223419
+ };
223420
+ }
223421
+ return input;
223170
223422
  }
223171
223423
  async function checkPermissionsAndCallTool(tool2, toolUseID, input, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl, onToolProgress) {
223172
223424
  const normalizedInput = normalizeToolInputForValidation(tool2, input);
@@ -227351,7 +227603,7 @@ async function* queryLoop(params, consumedCommandUuids) {
227351
227603
  state2 = next2;
227352
227604
  continue;
227353
227605
  }
227354
- const { shouldNudge, reason: nudgeReason } = analyzeContinuationIntent(lastText);
227606
+ const { shouldNudge, reason: nudgeReason } = analyzeContinuationIntent(lastText, { alreadyNudged: state2.continuationNudgeCount > 0 });
227355
227607
  if (shouldNudge) {
227356
227608
  const nudgeCount = state2.continuationNudgeCount + 1;
227357
227609
  logForDebugging(`Continuation nudge triggered (${nudgeCount}/${MAX_CONTINUATION_NUDGES}): ${nudgeReason} detected in "${lastText.slice(-120)}" without tool calls`);
@@ -228040,7 +228292,7 @@ function getAnthropicEnvMetadata() {
228040
228292
  function getBuildAgeMinutes() {
228041
228293
  if (false)
228042
228294
  ;
228043
- const buildTime = new Date("2026-08-13T14:38:49.133Z").getTime();
228295
+ const buildTime = new Date("2026-08-15T18:49:57.132Z").getTime();
228044
228296
  if (isNaN(buildTime))
228045
228297
  return;
228046
228298
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -229469,7 +229721,7 @@ var init_queryHelpers = __esm(() => {
229469
229721
  import { randomUUID as randomUUID14 } from "crypto";
229470
229722
  import { rm as rm4 } from "fs";
229471
229723
  import { copyFile as copyFile4, mkdir as mkdir21 } from "fs/promises";
229472
- import { dirname as dirname40, isAbsolute as isAbsolute21, join as join76, relative as relative12 } from "path";
229724
+ import { dirname as dirname39, isAbsolute as isAbsolute21, join as join76, relative as relative12 } from "path";
229473
229725
  function safeRemoveOverlay(overlayPath) {
229474
229726
  rm4(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
229475
229727
  }
@@ -229687,7 +229939,7 @@ async function startSpeculation(suggestionText, context2, setAppState, isPipelin
229687
229939
  if (isWriteTool) {
229688
229940
  if (!writtenPathsRef.current.has(rel)) {
229689
229941
  const overlayFile = join76(overlayPath, rel);
229690
- await mkdir21(dirname40(overlayFile), { recursive: true });
229942
+ await mkdir21(dirname39(overlayFile), { recursive: true });
229691
229943
  try {
229692
229944
  await copyFile4(join76(cwd2, rel), overlayFile);
229693
229945
  } catch {}
@@ -230913,7 +231165,7 @@ var init_types9 = __esm(() => {
230913
231165
  });
230914
231166
 
230915
231167
  // src/services/teamMemorySync/index.ts
230916
- import { createHash as createHash11 } from "crypto";
231168
+ import { createHash as createHash10 } from "crypto";
230917
231169
  import { mkdir as mkdir22, readdir as readdir16, readFile as readFile21, stat as stat24, writeFile as writeFile19 } from "fs/promises";
230918
231170
  import { join as join77, relative as relative13, sep as sep19 } from "path";
230919
231171
  function createSyncState() {
@@ -230924,7 +231176,7 @@ function createSyncState() {
230924
231176
  };
230925
231177
  }
230926
231178
  function hashContent(content) {
230927
- return "sha256:" + createHash11("sha256").update(content, "utf8").digest("hex");
231179
+ return "sha256:" + createHash10("sha256").update(content, "utf8").digest("hex");
230928
231180
  }
230929
231181
  function isErrnoException2(e) {
230930
231182
  return e instanceof Error && "code" in e && typeof e.code === "string";
@@ -233847,7 +234099,7 @@ var init_promptShellExecution = __esm(() => {
233847
234099
  import { realpath as realpath8 } from "fs/promises";
233848
234100
  import {
233849
234101
  basename as basename22,
233850
- dirname as dirname41,
234102
+ dirname as dirname40,
233851
234103
  isAbsolute as isAbsolute22,
233852
234104
  join as join79,
233853
234105
  sep as pathSep,
@@ -234114,7 +234366,7 @@ async function loadSkillsFromSkillsDir(basePath, source) {
234114
234366
  const skillFiles = await findSkillMarkdownFiles(basePath);
234115
234367
  const results = await Promise.all(skillFiles.map(async (skillFilePath) => {
234116
234368
  try {
234117
- const skillDirPath = dirname41(skillFilePath);
234369
+ const skillDirPath = dirname40(skillFilePath);
234118
234370
  let content;
234119
234371
  try {
234120
234372
  content = await fs2.readFile(skillFilePath, { encoding: "utf-8" });
@@ -234158,7 +234410,7 @@ function isSkillFile2(filePath) {
234158
234410
  function transformSkillFiles(files) {
234159
234411
  const filesByDir = new Map;
234160
234412
  for (const file2 of files) {
234161
- const dir = dirname41(file2.filePath);
234413
+ const dir = dirname40(file2.filePath);
234162
234414
  const dirFiles = filesByDir.get(dir) ?? [];
234163
234415
  dirFiles.push(file2);
234164
234416
  filesByDir.set(dir, dirFiles);
@@ -234187,15 +234439,15 @@ function buildNamespace(targetDir, baseDir) {
234187
234439
  return relativePath ? relativePath.split(pathSep).join(":") : "";
234188
234440
  }
234189
234441
  function getSkillCommandName(filePath, baseDir) {
234190
- const skillDirectory = dirname41(filePath);
234191
- const parentOfSkillDir = dirname41(skillDirectory);
234442
+ const skillDirectory = dirname40(filePath);
234443
+ const parentOfSkillDir = dirname40(skillDirectory);
234192
234444
  const commandBaseName = basename22(skillDirectory);
234193
234445
  const namespace = buildNamespace(parentOfSkillDir, baseDir);
234194
234446
  return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
234195
234447
  }
234196
234448
  function getRegularCommandName(filePath, baseDir) {
234197
234449
  const fileName = basename22(filePath);
234198
- const fileDirectory = dirname41(filePath);
234450
+ const fileDirectory = dirname40(filePath);
234199
234451
  const commandBaseName = fileName.replace(/\.md$/, "");
234200
234452
  const namespace = buildNamespace(fileDirectory, baseDir);
234201
234453
  return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
@@ -234218,7 +234470,7 @@ async function loadSkillsFromCommandsDir(cwd2) {
234218
234470
  } of processedFiles) {
234219
234471
  try {
234220
234472
  const isSkillFormat = isSkillFile2(filePath);
234221
- const skillDirectory = isSkillFormat ? dirname41(filePath) : undefined;
234473
+ const skillDirectory = isSkillFormat ? dirname40(filePath) : undefined;
234222
234474
  const cmdName = getCommandName2({
234223
234475
  baseDir,
234224
234476
  filePath,
@@ -234263,7 +234515,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
234263
234515
  const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2;
234264
234516
  const newDirs = [];
234265
234517
  for (const filePath of filePaths) {
234266
- let currentDir = dirname41(filePath);
234518
+ let currentDir = dirname40(filePath);
234267
234519
  while (currentDir.startsWith(resolvedCwd + pathSep)) {
234268
234520
  for (const skillDir of getProjectSkillsPaths(currentDir)) {
234269
234521
  if (!dynamicSkillDirs.has(skillDir)) {
@@ -234278,7 +234530,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
234278
234530
  } catch {}
234279
234531
  }
234280
234532
  }
234281
- const parent = dirname41(currentDir);
234533
+ const parent = dirname40(currentDir);
234282
234534
  if (parent === currentDir)
234283
234535
  break;
234284
234536
  currentDir = parent;
@@ -235572,9 +235824,9 @@ var init_toolSearch = __esm(() => {
235572
235824
  });
235573
235825
 
235574
235826
  // src/services/vcr.ts
235575
- import { createHash as createHash12, randomUUID as randomUUID16 } from "crypto";
235827
+ import { createHash as createHash11, randomUUID as randomUUID16 } from "crypto";
235576
235828
  import { mkdir as mkdir24, readFile as readFile22, writeFile as writeFile20 } from "fs/promises";
235577
- import { dirname as dirname42, join as join80 } from "path";
235829
+ import { dirname as dirname41, join as join80 } from "path";
235578
235830
  function shouldUseVCR() {
235579
235831
  if (false) {}
235580
235832
  if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.FORCE_VCR)) {
@@ -235586,7 +235838,7 @@ async function withFixture(input, fixtureName, f) {
235586
235838
  if (!shouldUseVCR()) {
235587
235839
  return await f();
235588
235840
  }
235589
- const hash = createHash12("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
235841
+ const hash = createHash11("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
235590
235842
  const filename = join80(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash}.json`);
235591
235843
  try {
235592
235844
  const cached3 = jsonParse(await readFile22(filename, { encoding: "utf8" }));
@@ -235601,7 +235853,7 @@ async function withFixture(input, fixtureName, f) {
235601
235853
  throw new Error(`Fixture missing: ${filename}. Re-run tests with VCR_RECORD=1, then commit the result.`);
235602
235854
  }
235603
235855
  const result = await f();
235604
- await mkdir24(dirname42(filename), { recursive: true });
235856
+ await mkdir24(dirname41(filename), { recursive: true });
235605
235857
  await writeFile20(filename, jsonStringify(result, null, 2), {
235606
235858
  encoding: "utf8"
235607
235859
  });
@@ -235621,7 +235873,7 @@ async function withVCR(messages, f) {
235621
235873
  return true;
235622
235874
  }));
235623
235875
  const dehydratedInput = mapMessages(messagesForAPI.map((_) => _.message.content), dehydrateValue);
235624
- const filename = join80(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_) => createHash12("sha1").update(jsonStringify(_)).digest("hex").slice(0, 6)).join("-")}.json`);
235876
+ const filename = join80(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_) => createHash11("sha1").update(jsonStringify(_)).digest("hex").slice(0, 6)).join("-")}.json`);
235625
235877
  try {
235626
235878
  const cached3 = jsonParse(await readFile22(filename, { encoding: "utf8" }));
235627
235879
  cached3.output.forEach(addCachedCostToTotalSessionCost);
@@ -235640,7 +235892,7 @@ ${jsonStringify(dehydratedInput, null, 2)}`);
235640
235892
  if (env2.isCI && !isEnvTruthy(process.env.VCR_RECORD)) {
235641
235893
  return results;
235642
235894
  }
235643
- await mkdir24(dirname42(filename), { recursive: true });
235895
+ await mkdir24(dirname41(filename), { recursive: true });
235644
235896
  await writeFile20(filename, jsonStringify({
235645
235897
  input: dehydratedInput,
235646
235898
  output: results.map((message, index) => mapMessage(message, dehydrateValue, index))
@@ -236118,7 +236370,7 @@ var init_tokenEstimation = __esm(() => {
236118
236370
  });
236119
236371
 
236120
236372
  // src/utils/incrementalTokenCounter.ts
236121
- import { createHash as createHash13 } from "crypto";
236373
+ import { createHash as createHash12 } from "crypto";
236122
236374
  function getMessageHash(messages) {
236123
236375
  if (messages.length === 0)
236124
236376
  return "empty";
@@ -236127,7 +236379,7 @@ function getMessageHash(messages) {
236127
236379
  content: m.message?.content ?? null,
236128
236380
  attachment: m.attachment ?? null
236129
236381
  }));
236130
- return createHash13("sha256").update(JSON.stringify(tokenRelevantInput)).digest("hex").slice(0, 16);
236382
+ return createHash12("sha256").update(JSON.stringify(tokenRelevantInput)).digest("hex").slice(0, 16);
236131
236383
  }
236132
236384
 
236133
236385
  class IncrementalTokenCounter {
@@ -242089,6 +242341,7 @@ async function executeOpenAIRequest(context2) {
242089
242341
  const attemptedLocalRequestUrls = new Set([requestUrl]);
242090
242342
  let didRetryWithoutTools = false;
242091
242343
  let didRetryWithoutToolStream = false;
242344
+ let didRetryWithoutReasoningEffort = false;
242092
242345
  let retryCredentialLease = null;
242093
242346
  let didRefreshCopilotToken = false;
242094
242347
  let refreshedCopilotToken;
@@ -242355,6 +242608,15 @@ async function executeOpenAIRequest(context2) {
242355
242608
  continue;
242356
242609
  }
242357
242610
  const hasToolsPayload = effectiveTransport === "responses" || effectiveTransport === "responses_compat" || effectiveTransport === "anthropic_messages" || effectiveTransport === "gemini" ? Array.isArray(params.tools) && params.tools.length > 0 : Array.isArray(body.tools) && body.tools.length > 0;
242611
+ if (!didRetryWithoutReasoningEffort && (response.status === 400 || response.status === 422) && /reasoning[_\s-]?effort/i.test(errorBody) && /unsupported|unknown|invalid|not supported|unrecognized|unexpected/i.test(errorBody) && Object.prototype.hasOwnProperty.call(body, "reasoning_effort")) {
242612
+ didRetryWithoutReasoningEffort = true;
242613
+ maxAttempts += 1;
242614
+ delete body.reasoning_effort;
242615
+ refreshSerializedBody();
242616
+ retryCredentialLease = credentialLease;
242617
+ logForDebugging3(`[OpenAIShim] self-heal retry reason=reasoning_effort_unsupported method=POST url=${redactUrlForDiagnostics2(requestUrl)} model=${request.resolvedModel}`, { level: "warn" });
242618
+ continue;
242619
+ }
242358
242620
  if (!didRetryWithoutTools && failure.category === "tool_call_incompatible" && shouldAttemptLocalToollessRetry2({
242359
242621
  baseUrl: activeBaseUrl,
242360
242622
  hasTools: hasToolsPayload
@@ -243488,7 +243750,7 @@ async function getAnthropicClient({
243488
243750
  processEnv: effortProcessEnv,
243489
243751
  apiProvider: effortRuntimeContext.routeId === "openai" ? "openai" : effortRuntimeContext.routeId === "codex" ? "codex" : undefined
243490
243752
  } : undefined;
243491
- const supportsShimReasoningEffort = effortModel ? effortShimConfig ? modelSupportsShimReasoningEffort(effortModel, effortShimConfig.thinkingRequestFormat, effortShimConfig.removeBodyFields, effortContext) : modelSupportsWireEffort(effortModel) : false;
243753
+ const supportsShimReasoningEffort = effortModel ? effortValue !== undefined ? !effortShimConfig?.removeBodyFields?.includes("reasoning_effort") : effortShimConfig ? modelSupportsShimReasoningEffort(effortModel, effortShimConfig.thinkingRequestFormat, effortShimConfig.removeBodyFields, effortContext) : modelSupportsWireEffort(effortModel) : false;
243492
243754
  const reasoningControl = effortModel ? resolveModelReasoningControl(effortModel, effortContext) : undefined;
243493
243755
  const k3ReasoningControl = reasoningControl?.source === "metadata" && reasoningControl.wireFormat === "reasoning_effort" && reasoningControl.levels.length === 3 && reasoningControl.levels.includes("low") && reasoningControl.levels.includes("high") && reasoningControl.levels.includes("max");
243494
243756
  const appliedEffort = effortModel && effortValue !== undefined ? resolveAppliedEffort(effortModel, effortValue, effortContext) : undefined;
@@ -249958,7 +250220,7 @@ var init_permissionSetup = __esm(() => {
249958
250220
  import { statSync as statSync6 } from "fs";
249959
250221
  import { lstat as lstat6, readdir as readdir17, readFile as readFile24, realpath as realpath9, stat as stat26 } from "fs/promises";
249960
250222
  import { homedir as homedir21 } from "os";
249961
- import { dirname as dirname43, join as join82, resolve as resolve28, sep as sep20 } from "path";
250223
+ import { dirname as dirname42, join as join82, resolve as resolve28, sep as sep20 } from "path";
249962
250224
  function getMaxMarkdownFileSizeBytes() {
249963
250225
  const raw = process.env.CLAUDE_CODE_MAX_MARKDOWN_FILE_SIZE_BYTES;
249964
250226
  if (!raw)
@@ -250078,7 +250340,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
250078
250340
  if (gitRoot && normalizePathForComparison(current) === normalizePathForComparison(gitRoot)) {
250079
250341
  break;
250080
250342
  }
250081
- const parent = dirname43(current);
250343
+ const parent = dirname42(current);
250082
250344
  if (parent === current) {
250083
250345
  break;
250084
250346
  }
@@ -254720,7 +254982,7 @@ var init_messages = __esm(() => {
254720
254982
  // src/utils/transcriptFileLock.ts
254721
254983
  import { lstatSync as lstatSync2, readlinkSync as readlinkSync2 } from "node:fs";
254722
254984
  import { lstat as lstat7, readlink as readlink3 } from "node:fs/promises";
254723
- import { dirname as dirname44, isAbsolute as isAbsolute23, resolve as resolve29 } from "node:path";
254985
+ import { dirname as dirname43, isAbsolute as isAbsolute23, resolve as resolve29 } from "node:path";
254724
254986
  async function resolveTranscriptMutationTarget(requestedPath) {
254725
254987
  let currentPath = resolve29(requestedPath);
254726
254988
  const visited = new Set;
@@ -254740,7 +255002,7 @@ async function resolveTranscriptMutationTarget(requestedPath) {
254740
255002
  if (!fileStat.isSymbolicLink())
254741
255003
  return currentPath;
254742
255004
  const linkTarget = await readlink3(currentPath);
254743
- currentPath = isAbsolute23(linkTarget) ? linkTarget : resolve29(dirname44(currentPath), linkTarget);
255005
+ currentPath = isAbsolute23(linkTarget) ? linkTarget : resolve29(dirname43(currentPath), linkTarget);
254744
255006
  }
254745
255007
  throw new Error(`Cannot lock transcript symlink chain: ${requestedPath}`);
254746
255008
  }
@@ -254763,7 +255025,7 @@ function resolveTranscriptMutationTargetSync(requestedPath) {
254763
255025
  if (!fileStat.isSymbolicLink())
254764
255026
  return currentPath;
254765
255027
  const linkTarget = readlinkSync2(currentPath);
254766
- currentPath = isAbsolute23(linkTarget) ? linkTarget : resolve29(dirname44(currentPath), linkTarget);
255028
+ currentPath = isAbsolute23(linkTarget) ? linkTarget : resolve29(dirname43(currentPath), linkTarget);
254767
255029
  }
254768
255030
  throw new Error(`Cannot lock transcript symlink chain: ${requestedPath}`);
254769
255031
  }
@@ -254871,9 +255133,9 @@ __export(exports_replayIndex, {
254871
255133
  fileExists: () => fileExists
254872
255134
  });
254873
255135
  import { chmod as chmod4, readFile as readFile25, writeFile as writeFile21, stat as stat27 } from "fs/promises";
254874
- import { join as join83, dirname as dirname45 } from "path";
255136
+ import { join as join83, dirname as dirname44 } from "path";
254875
255137
  function getReplayIndexPath(sessionId, transcriptPath) {
254876
- return join83(dirname45(transcriptPath), `${sessionId}.replay.json`);
255138
+ return join83(dirname44(transcriptPath), `${sessionId}.replay.json`);
254877
255139
  }
254878
255140
  async function fileExists(path13) {
254879
255141
  try {
@@ -254938,7 +255200,7 @@ async function loadReplayIndex(sessionId, transcriptPath) {
254938
255200
  async function writeReplayIndex(sessionId, transcriptPath, index) {
254939
255201
  const replayPath = getReplayIndexPath(sessionId, transcriptPath);
254940
255202
  try {
254941
- const dir = dirname45(replayPath);
255203
+ const dir = dirname44(replayPath);
254942
255204
  try {
254943
255205
  await stat27(dir);
254944
255206
  } catch {
@@ -255071,7 +255333,7 @@ import {
255071
255333
  unlink as unlink10,
255072
255334
  writeFile as writeFile22
255073
255335
  } from "fs/promises";
255074
- import { basename as basename24, dirname as dirname46, join as join84 } from "path";
255336
+ import { basename as basename24, dirname as dirname45, join as join84 } from "path";
255075
255337
  function getBuiltInCommandNames() {
255076
255338
  if (builtInCommandNamesCache)
255077
255339
  return builtInCommandNamesCache;
@@ -255307,7 +255569,7 @@ function getAgentMetadataPath(agentId) {
255307
255569
  }
255308
255570
  async function writeAgentMetadata(agentId, metadata) {
255309
255571
  const path13 = getAgentMetadataPath(agentId);
255310
- await mkdir25(dirname46(path13), { recursive: true });
255572
+ await mkdir25(dirname45(path13), { recursive: true });
255311
255573
  await writeFile22(path13, JSON.stringify(metadata));
255312
255574
  }
255313
255575
  async function readAgentMetadata(agentId) {
@@ -255330,7 +255592,7 @@ function getRemoteAgentMetadataPath(taskId) {
255330
255592
  }
255331
255593
  async function writeRemoteAgentMetadata(taskId, metadata) {
255332
255594
  const path13 = getRemoteAgentMetadataPath(taskId);
255333
- await mkdir25(dirname46(path13), { recursive: true });
255595
+ await mkdir25(dirname45(path13), { recursive: true });
255334
255596
  await writeFile22(path13, JSON.stringify(metadata));
255335
255597
  }
255336
255598
  async function readRemoteAgentMetadata(taskId) {
@@ -255565,7 +255827,7 @@ class Project {
255565
255827
  }
255566
255828
  async appendDirectlyToFile(filePath, data) {
255567
255829
  transcriptRewriteHooksForTesting.beforeFileAppend?.(filePath);
255568
- await mkdir25(dirname46(filePath), { recursive: true, mode: 448 });
255830
+ await mkdir25(dirname45(filePath), { recursive: true, mode: 448 });
255569
255831
  await withTranscriptFileLock(filePath, async (signal) => {
255570
255832
  signal.throwIfAborted();
255571
255833
  await fsAppendFile(filePath, data, { mode: 384 });
@@ -256357,7 +256619,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
256357
256619
  await Promise.all(Array.from(byAgent, async ([agentId, entries]) => {
256358
256620
  const agentFile = getAgentTranscriptPath(asAgentId(agentId));
256359
256621
  try {
256360
- await mkdir25(dirname46(agentFile), { recursive: true, mode: 448 });
256622
+ await mkdir25(dirname45(agentFile), { recursive: true, mode: 448 });
256361
256623
  await project2.replaceTranscriptFile(agentFile, serializeTranscriptEntries(entries));
256362
256624
  } catch {
256363
256625
  subagentWriteFailures++;
@@ -257115,7 +257377,7 @@ function appendEntryToFile(fullPath, entry) {
257115
257377
  `;
257116
257378
  if (project?._deferSynchronousAppend(fullPath, line))
257117
257379
  return;
257118
- fs2.mkdirSync(dirname46(fullPath), { mode: 448 });
257380
+ fs2.mkdirSync(dirname45(fullPath), { mode: 448 });
257119
257381
  withTranscriptFileLockSync(fullPath, () => {
257120
257382
  fs2.appendFileSync(fullPath, line, { mode: 384 });
257121
257383
  });
@@ -258614,7 +258876,7 @@ var init_sessionStorage = __esm(() => {
258614
258876
  init_slowOperations();
258615
258877
  init_transcriptFileLock();
258616
258878
  init_uuid();
258617
- VERSION3 = typeof MACRO !== "undefined" ? "0.28.1-by-rayss" : "unknown";
258879
+ VERSION3 = typeof MACRO !== "undefined" ? "0.28.3-by-rayss" : "unknown";
258618
258880
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
258619
258881
  TRANSCRIPT_COPY_CHUNK_BYTES = 64 * 1024;
258620
258882
  transcriptRewriteHooksForTesting = {};
@@ -260081,7 +260343,7 @@ var init_filesystem = __esm(() => {
260081
260343
  });
260082
260344
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
260083
260345
  const nonce = randomBytes10(16).toString("hex");
260084
- return join86(getClaudeTempDir(), "bundled-skills", "0.28.1-by-rayss", nonce);
260346
+ return join86(getClaudeTempDir(), "bundled-skills", "0.28.3-by-rayss", nonce);
260085
260347
  });
260086
260348
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
260087
260349
  });
@@ -261399,7 +261661,7 @@ __export(exports_hookChains, {
261399
261661
  emitHookChainActionExecuted: () => emitHookChainActionExecuted,
261400
261662
  dispatchHookChainsForEvent: () => dispatchHookChainsForEvent
261401
261663
  });
261402
- import { createHash as createHash14 } from "crypto";
261664
+ import { createHash as createHash13 } from "crypto";
261403
261665
  import { statSync as statSync7 } from "fs";
261404
261666
  import { join as join88, resolve as resolve30 } from "path";
261405
261667
  function asAnalyticsString(value) {
@@ -261658,7 +261920,7 @@ function buildEventIdentity(event) {
261658
261920
  sessionId: readStringField(payload, ["session_id", "sessionId"]),
261659
261921
  error: readStringField(payload, ["error", "reason"])
261660
261922
  };
261661
- const digest = createHash14("sha1").update(stableFingerprint({ coreIdentity, payload })).digest("hex");
261923
+ const digest = createHash13("sha1").update(stableFingerprint({ coreIdentity, payload })).digest("hex");
261662
261924
  return digest;
261663
261925
  }
261664
261926
  function pruneGuardState(nowMs) {
@@ -262109,7 +262371,7 @@ function buildActionDedupKey(args) {
262109
262371
  eventIdentity: buildEventIdentity(event),
262110
262372
  scope: runtime.dedupScope ?? ""
262111
262373
  };
262112
- return createHash14("sha1").update(stableFingerprint(identity4)).digest("hex");
262374
+ return createHash13("sha1").update(stableFingerprint(identity4)).digest("hex");
262113
262375
  }
262114
262376
  async function dispatchHookChainsForEvent(args) {
262115
262377
  const runtime = args.runtime ?? {};
@@ -265468,7 +265730,7 @@ import {
265468
265730
  symlink as symlink4,
265469
265731
  utimes as utimes2
265470
265732
  } from "fs/promises";
265471
- import { basename as basename26, dirname as dirname48, join as join89 } from "path";
265733
+ import { basename as basename26, dirname as dirname47, join as join89 } from "path";
265472
265734
  function validateWorktreeSlug(slug) {
265473
265735
  if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
265474
265736
  throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
@@ -265715,7 +265977,7 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
265715
265977
  const srcPath = join89(repoRoot, relativePath2);
265716
265978
  const destPath = join89(worktreePath, relativePath2);
265717
265979
  try {
265718
- await mkdir27(dirname48(destPath), { recursive: true });
265980
+ await mkdir27(dirname47(destPath), { recursive: true });
265719
265981
  await copyFile6(srcPath, destPath);
265720
265982
  copied.push(relativePath2);
265721
265983
  } catch (e) {
@@ -265732,7 +265994,7 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
265732
265994
  const sourceSettingsLocal = join89(repoRoot, localSettingsRelativePath);
265733
265995
  try {
265734
265996
  const destSettingsLocal = join89(worktreePath, localSettingsRelativePath);
265735
- await mkdirRecursive(dirname48(destSettingsLocal));
265997
+ await mkdirRecursive(dirname47(destSettingsLocal));
265736
265998
  await copyFile6(sourceSettingsLocal, destSettingsLocal);
265737
265999
  logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
265738
266000
  } catch (e) {
@@ -266480,9 +266742,9 @@ var init_prompts3 = __esm(() => {
266480
266742
  var init_config8 = () => {};
266481
266743
 
266482
266744
  // src/utils/api.ts
266483
- import { createHash as createHash15 } from "crypto";
266745
+ import { createHash as createHash14 } from "crypto";
266484
266746
  function filterSwarmFieldsFromSchema(toolName, schema) {
266485
- const fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName];
266747
+ const fieldsToRemove = Object.hasOwn(SWARM_FIELDS_BY_TOOL, toolName) ? SWARM_FIELDS_BY_TOOL[toolName] : undefined;
266486
266748
  if (!fieldsToRemove || fieldsToRemove.length === 0) {
266487
266749
  return schema;
266488
266750
  }
@@ -266593,7 +266855,7 @@ function logAPIPrefix(systemPrompt) {
266593
266855
  logEvent("tengu_sysprompt_block", {
266594
266856
  snippet: firstSystemPrompt?.slice(0, 20),
266595
266857
  length: firstSystemPrompt?.length ?? 0,
266596
- hash: firstSystemPrompt ? createHash15("sha256").update(firstSystemPrompt).digest("hex") : ""
266858
+ hash: firstSystemPrompt ? createHash14("sha256").update(firstSystemPrompt).digest("hex") : ""
266597
266859
  });
266598
266860
  }
266599
266861
  function splitSysPromptPrefix(systemPrompt, options2) {
@@ -274477,7 +274739,7 @@ function buildSystemInitMessage(inputs) {
274477
274739
  slash_commands: inputs.commands.filter((c7) => c7.userInvocable !== false).map((c7) => c7.name),
274478
274740
  apiKeySource: getAnthropicApiKeyWithSource().source,
274479
274741
  betas: getSdkBetas(),
274480
- claude_code_version: "0.28.1-by-rayss",
274742
+ claude_code_version: "0.28.3-by-rayss",
274481
274743
  output_style: outputStyle,
274482
274744
  agents: inputs.agents.map((agent) => agent.agentType),
274483
274745
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -276049,7 +276311,7 @@ function applyProviderFlag(provider, args) {
276049
276311
  case "xai":
276050
276312
  process.env.CLAUDE_CODE_USE_OPENAI = "1";
276051
276313
  process.env.OPENAI_BASE_URL ??= "https://api.x.ai/v1";
276052
- process.env.OPENAI_MODEL ??= defaultModel ?? "grok-4.3";
276314
+ process.env.OPENAI_MODEL ??= defaultModel ?? "grok-4.6";
276053
276315
  if (model)
276054
276316
  process.env.OPENAI_MODEL = model;
276055
276317
  if (process.env.XAI_API_KEY && !process.env.OPENAI_API_KEY) {
@@ -276780,7 +277042,7 @@ var init_InvalidConfigDialog = __esm(() => {
276780
277042
 
276781
277043
  // src/entrypoints/init.ts
276782
277044
  import { existsSync as existsSync8, mkdirSync as mkdirSync6, copyFileSync as copyFileSync2 } from "fs";
276783
- import { join as join92, dirname as dirname49 } from "path";
277045
+ import { join as join92, dirname as dirname48 } from "path";
276784
277046
  import { fileURLToPath as fileURLToPath4 } from "url";
276785
277047
  function copyDefaultConfigFiles() {
276786
277048
  try {
@@ -276790,7 +277052,7 @@ function copyDefaultConfigFiles() {
276790
277052
  mkdirSync6(configDir, { recursive: true });
276791
277053
  }
276792
277054
  const __filename2 = fileURLToPath4(import.meta.url);
276793
- const packageDir = join92(dirname49(__filename2), "..");
277055
+ const packageDir = join92(dirname48(__filename2), "..");
276794
277056
  const defaultsDir = join92(packageDir, "config", "defaults");
276795
277057
  const claudeMdPath = join92(configDir, "CLAUDE.md");
276796
277058
  const defaultClaudeMd = join92(defaultsDir, "CLAUDE.md");
@@ -277035,7 +277297,7 @@ var init_shared2 = __esm(() => {
277035
277297
  // src/entrypoints/sdk/sessions.ts
277036
277298
  import { randomUUID as randomUUID31 } from "crypto";
277037
277299
  import { appendFile as appendFile3, mkdir as mkdir30, unlink as unlink14, writeFile as writeFile24 } from "fs/promises";
277038
- import { dirname as dirname50, join as join93 } from "path";
277300
+ import { dirname as dirname49, join as join93 } from "path";
277039
277301
  function toSDKSessionInfo(info) {
277040
277302
  return {
277041
277303
  sessionId: info.sessionId,
@@ -277151,7 +277413,7 @@ async function getSessionMessages(sessionId, options2) {
277151
277413
  async function appendJsonlEntry(filePath, entry) {
277152
277414
  const line = JSON.stringify(entry) + `
277153
277415
  `;
277154
- await mkdir30(dirname50(filePath), { mode: 448, recursive: true });
277416
+ await mkdir30(dirname49(filePath), { mode: 448, recursive: true });
277155
277417
  await withTranscriptFileLock(filePath, async (signal) => {
277156
277418
  signal.throwIfAborted();
277157
277419
  await appendFile3(filePath, line, { mode: 384 });
@@ -277200,7 +277462,7 @@ async function forkSession(sessionId, options2) {
277200
277462
  throw new Error(`Session is empty: ${sessionId}`);
277201
277463
  }
277202
277464
  const forkSessionId = randomUUID31();
277203
- const targetDir = dirname50(resolved.filePath);
277465
+ const targetDir = dirname49(resolved.filePath);
277204
277466
  const forkPath = join93(targetDir, `${forkSessionId}.jsonl`);
277205
277467
  const uuidMap = new Map;
277206
277468
  const mainEntries = [];
@@ -277744,13 +278006,13 @@ var init_agentDefinitions = __esm(() => {
277744
278006
 
277745
278007
  // src/entrypoints/sdk/query.ts
277746
278008
  import { randomUUID as randomUUID33 } from "crypto";
277747
- import { dirname as dirname51 } from "path";
278009
+ import { dirname as dirname50 } from "path";
277748
278010
  import { stat as stat32 } from "fs/promises";
277749
278011
  async function loadAndInjectSessionMessages(sessionId, cwd2, engine, upToUuid) {
277750
278012
  const resolved = await resolveSessionFilePath(sessionId, cwd2);
277751
278013
  if (!resolved)
277752
278014
  return { loaded: false, transcriptDir: null };
277753
- const transcriptDir = dirname51(resolved.filePath);
278015
+ const transcriptDir = dirname50(resolved.filePath);
277754
278016
  let entries;
277755
278017
  let preservedSegment = null;
277756
278018
  let boundaryIndex = -1;
@@ -278420,7 +278682,7 @@ var init_query2 = __esm(() => {
278420
278682
 
278421
278683
  // src/entrypoints/sdk/v2.ts
278422
278684
  import { randomUUID as randomUUID34 } from "crypto";
278423
- import { dirname as dirname52 } from "path";
278685
+ import { dirname as dirname51 } from "path";
278424
278686
  import { stat as stat33 } from "fs/promises";
278425
278687
 
278426
278688
  class SDKSessionImpl {
@@ -278831,7 +279093,7 @@ async function unstable_v2_resumeSession(sessionId, options2) {
278831
279093
  session.setAppStateStore(appStateStore);
278832
279094
  session.setAbortController(abortController);
278833
279095
  if (resolved) {
278834
- const transcriptDir = dirname52(resolved.filePath);
279096
+ const transcriptDir = dirname51(resolved.filePath);
278835
279097
  session.setSessionProjectDir(transcriptDir);
278836
279098
  switchSession(sessionId, transcriptDir);
278837
279099
  }
@@ -278943,4 +279205,4 @@ export {
278943
279205
  AbortError
278944
279206
  };
278945
279207
 
278946
- //# debugId=F48A846A1F06A7D464756E2164756E21
279208
+ //# debugId=4B094686A75A913D64756E2164756E21