@rayu-dev/rayu-cli 1.4.476 → 1.4.478

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rayu.js CHANGED
@@ -144577,6 +144577,24 @@ var init_bedrock = __esm(() => {
144577
144577
  });
144578
144578
 
144579
144579
  // src/utils/model/configs.ts
144580
+ function modelFamilyOf(model) {
144581
+ const m2 = model.toLowerCase();
144582
+ if (m2.includes("opus"))
144583
+ return "opus";
144584
+ if (m2.includes("sonnet"))
144585
+ return "sonnet";
144586
+ if (m2.includes("haiku"))
144587
+ return "haiku";
144588
+ return "other";
144589
+ }
144590
+ function isFamilyConsistentOverride(canonicalId, override) {
144591
+ const keyFamily = modelFamilyOf(canonicalId);
144592
+ const valueFamily = modelFamilyOf(override);
144593
+ if (keyFamily === "other" || valueFamily === "other") {
144594
+ return true;
144595
+ }
144596
+ return keyFamily === valueFamily;
144597
+ }
144580
144598
  var CLAUDE_3_7_SONNET_CONFIG, CLAUDE_3_5_V2_SONNET_CONFIG, CLAUDE_3_5_HAIKU_CONFIG, CLAUDE_HAIKU_4_5_CONFIG, CLAUDE_SONNET_4_CONFIG, CLAUDE_SONNET_4_5_CONFIG, CLAUDE_OPUS_4_CONFIG, CLAUDE_OPUS_4_1_CONFIG, CLAUDE_OPUS_4_5_CONFIG, CLAUDE_OPUS_4_6_CONFIG, CLAUDE_SONNET_4_6_CONFIG, ALL_MODEL_CONFIGS, CANONICAL_MODEL_IDS, CANONICAL_ID_TO_KEY;
144581
144599
  var init_configs = __esm(() => {
144582
144600
  CLAUDE_3_7_SONNET_CONFIG = {
@@ -144641,7 +144659,7 @@ var init_configs = __esm(() => {
144641
144659
  };
144642
144660
  CLAUDE_SONNET_4_6_CONFIG = {
144643
144661
  anthropic: "claude-sonnet-4-6",
144644
- bedrock: "us.anthropic.claude-sonnet-4-6",
144662
+ bedrock: "us.anthropic.claude-sonnet-4-6-v1",
144645
144663
  vertex: "claude-sonnet-4-6",
144646
144664
  foundry: "claude-sonnet-4-6"
144647
144665
  };
@@ -144689,6 +144707,17 @@ async function getBedrockModelStrings() {
144689
144707
  }
144690
144708
  return out;
144691
144709
  }
144710
+ function overridePassesFidelity(canonicalId, override) {
144711
+ if (isFamilyConsistentOverride(canonicalId, override)) {
144712
+ return true;
144713
+ }
144714
+ const sig = `${canonicalId}\x00${override}`;
144715
+ if (!warnedMismatchedOverrides.has(sig)) {
144716
+ warnedMismatchedOverrides.add(sig);
144717
+ logError2(new Error(`Ignoring cross-family modelOverride "${canonicalId}" -> "${override}": ` + `the override targets a different model family than the model it overrides. ` + `Falling back to the default wire model for "${canonicalId}" to preserve model fidelity.`));
144718
+ }
144719
+ return false;
144720
+ }
144692
144721
  function applyModelOverrides(ms) {
144693
144722
  const overrides = getInitialSettings().modelOverrides;
144694
144723
  if (!overrides) {
@@ -144697,7 +144726,7 @@ function applyModelOverrides(ms) {
144697
144726
  const out = { ...ms };
144698
144727
  for (const [canonicalId, override] of Object.entries(overrides)) {
144699
144728
  const key = CANONICAL_ID_TO_KEY[canonicalId];
144700
- if (key && override) {
144729
+ if (key && override && overridePassesFidelity(canonicalId, override)) {
144701
144730
  out[key] = override;
144702
144731
  }
144703
144732
  }
@@ -144714,7 +144743,7 @@ function resolveOverriddenModel(modelId) {
144714
144743
  return modelId;
144715
144744
  }
144716
144745
  for (const [canonicalId, override] of Object.entries(overrides)) {
144717
- if (override === modelId) {
144746
+ if (override === modelId && isFamilyConsistentOverride(canonicalId, override)) {
144718
144747
  return canonicalId;
144719
144748
  }
144720
144749
  }
@@ -144750,7 +144779,7 @@ async function ensureModelStringsInitialized() {
144750
144779
  }
144751
144780
  await updateBedrockModelStrings();
144752
144781
  }
144753
- var MODEL_KEYS, updateBedrockModelStrings;
144782
+ var MODEL_KEYS, warnedMismatchedOverrides, updateBedrockModelStrings;
144754
144783
  var init_modelStrings = __esm(() => {
144755
144784
  init_state();
144756
144785
  init_log2();
@@ -144759,6 +144788,7 @@ var init_modelStrings = __esm(() => {
144759
144788
  init_configs();
144760
144789
  init_providers();
144761
144790
  MODEL_KEYS = Object.keys(ALL_MODEL_CONFIGS);
144791
+ warnedMismatchedOverrides = new Set;
144762
144792
  updateBedrockModelStrings = sequential(async () => {
144763
144793
  if (getModelStrings() !== null) {
144764
144794
  return;
@@ -148992,7 +149022,7 @@ var init_isEqual = __esm(() => {
148992
149022
 
148993
149023
  // src/utils/userAgent.ts
148994
149024
  function getRayuUserAgent() {
148995
- return `rayu/${"1.4.476"}`;
149025
+ return `rayu/${"1.4.478"}`;
148996
149026
  }
148997
149027
  var getClaudeCodeUserAgent;
148998
149028
  var init_userAgent = __esm(() => {
@@ -149018,7 +149048,7 @@ function getUserAgent() {
149018
149048
  const clientApp = process.env.RAYU_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}` : "";
149019
149049
  const workload = getWorkload();
149020
149050
  const workloadSuffix = workload ? `, workload/${workload}` : "";
149021
- return `rayu/${"1.4.476"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
149051
+ return `rayu/${"1.4.478"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
149022
149052
  }
149023
149053
  function getMCPUserAgent() {
149024
149054
  const parts = [];
@@ -149032,7 +149062,7 @@ function getMCPUserAgent() {
149032
149062
  parts.push(`client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}`);
149033
149063
  }
149034
149064
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
149035
- return `rayu/${"1.4.476"}${suffix}`;
149065
+ return `rayu/${"1.4.478"}${suffix}`;
149036
149066
  }
149037
149067
  function getWebFetchUserAgent() {
149038
149068
  return `Rayu-User (${getRayuUserAgent()})`;
@@ -158000,6 +158030,55 @@ var init_rayuSession = __esm(() => {
158000
158030
  REFRESH_SKEW_MS = 60 * 1000;
158001
158031
  });
158002
158032
 
158033
+ // src/services/api/rayuHosted/gatewayHeaders.ts
158034
+ function modelFromBedrockUrl(url3) {
158035
+ const m2 = url3.match(/\/model\/([^/]+)\/invoke(?:-with-response-stream)?(?:$|\?|#)/);
158036
+ return m2?.[1] ? decodeURIComponent(m2[1]) : "";
158037
+ }
158038
+ function modelFromBody(body) {
158039
+ if (typeof body !== "string" || body.length === 0) {
158040
+ return "";
158041
+ }
158042
+ try {
158043
+ const parsed = JSON.parse(body);
158044
+ return typeof parsed.model === "string" ? parsed.model : "";
158045
+ } catch {
158046
+ return "";
158047
+ }
158048
+ }
158049
+ function resolvedModelFromRequest(upstreamUrl, body) {
158050
+ return modelFromBedrockUrl(upstreamUrl) || modelFromBody(body);
158051
+ }
158052
+ function buildModelMetadataHeaders(params) {
158053
+ const resolved = resolvedModelFromRequest(params.upstreamUrl, params.body);
158054
+ const canonical = resolved ? safeCanonical(resolved) : "";
158055
+ const intended = (params.intended || canonical || resolved || "").trim();
158056
+ const out = {
158057
+ [RAYU_REQUEST_ID_HEADER]: params.requestId,
158058
+ [RAYU_LOGICAL_REQUEST_ID_HEADER]: (params.logicalRequestId || params.requestId).trim()
158059
+ };
158060
+ if (resolved)
158061
+ out[RAYU_RESOLVED_MODEL_HEADER] = resolved;
158062
+ if (canonical)
158063
+ out[RAYU_CANONICAL_MODEL_HEADER] = canonical;
158064
+ if (intended)
158065
+ out[RAYU_INTENDED_MODEL_HEADER] = intended;
158066
+ if (params.querySource)
158067
+ out[RAYU_QUERY_SOURCE_HEADER] = params.querySource;
158068
+ return out;
158069
+ }
158070
+ function safeCanonical(model) {
158071
+ try {
158072
+ return getCanonicalName(model);
158073
+ } catch {
158074
+ return "";
158075
+ }
158076
+ }
158077
+ var RAYU_REQUEST_ID_HEADER = "x-rayu-request-id", RAYU_LOGICAL_REQUEST_ID_HEADER = "x-rayu-logical-request-id", RAYU_INTENDED_MODEL_HEADER = "x-rayu-intended-model", RAYU_RESOLVED_MODEL_HEADER = "x-rayu-resolved-model", RAYU_CANONICAL_MODEL_HEADER = "x-rayu-canonical-model", RAYU_QUERY_SOURCE_HEADER = "x-rayu-query-source";
158078
+ var init_gatewayHeaders = __esm(() => {
158079
+ init_model();
158080
+ });
158081
+
158003
158082
  // src/services/api/rayuHosted/rayuHostedAuth.ts
158004
158083
  function rayuHostedBaseURL() {
158005
158084
  return `${getRayuGatewayBaseUrl()}/v1`;
@@ -158026,12 +158105,24 @@ function makeRayuHostedFetch() {
158026
158105
  }
158027
158106
  const headers = new Headers(init?.headers);
158028
158107
  headers.set("Authorization", `Bearer ${token}`);
158108
+ const meta3 = buildModelMetadataHeaders({
158109
+ upstreamUrl: url3,
158110
+ body: init?.body,
158111
+ requestId: globalThis.crypto.randomUUID(),
158112
+ intended: headers.get(RAYU_INTENDED_MODEL_HEADER),
158113
+ logicalRequestId: headers.get(RAYU_LOGICAL_REQUEST_ID_HEADER),
158114
+ querySource: headers.get(RAYU_QUERY_SOURCE_HEADER)
158115
+ });
158116
+ for (const [k2, v] of Object.entries(meta3)) {
158117
+ headers.set(k2, v);
158118
+ }
158029
158119
  return inner(input, { ...init, headers });
158030
158120
  };
158031
158121
  return wrapped;
158032
158122
  }
158033
158123
  var init_rayuHostedAuth = __esm(() => {
158034
158124
  init_rayuSession();
158125
+ init_gatewayHeaders();
158035
158126
  });
158036
158127
 
158037
158128
  // src/services/rayuAuth/rayuHostedProvider.ts
@@ -158348,6 +158439,17 @@ function makeGatewayRoutingFetch(provider, inner = globalThis.fetch) {
158348
158439
  headers.set("X-Rayu-Token", token);
158349
158440
  headers.set("X-Rayu-Upstream-URL", originalUrl);
158350
158441
  headers.set("X-Rayu-Provider", provider.id);
158442
+ const meta3 = buildModelMetadataHeaders({
158443
+ upstreamUrl: originalUrl,
158444
+ body: init?.body,
158445
+ requestId: globalThis.crypto.randomUUID(),
158446
+ intended: headers.get(RAYU_INTENDED_MODEL_HEADER),
158447
+ logicalRequestId: headers.get(RAYU_LOGICAL_REQUEST_ID_HEADER),
158448
+ querySource: headers.get(RAYU_QUERY_SOURCE_HEADER)
158449
+ });
158450
+ for (const [k2, v] of Object.entries(meta3)) {
158451
+ headers.set(k2, v);
158452
+ }
158351
158453
  const callbackToDirect = isGatewayCallbackEnabled();
158352
158454
  try {
158353
158455
  const res = await inner(gatewayUrl, { ...init, headers });
@@ -158371,6 +158473,7 @@ var init_gatewayRouting = __esm(() => {
158371
158473
  init_rayuSession();
158372
158474
  init_rayuEntitlements();
158373
158475
  init_envUtils();
158476
+ init_gatewayHeaders();
158374
158477
  P2P_ELIGIBLE_PLAN_CODES = new Set([
158375
158478
  "basic",
158376
158479
  "pro",
@@ -176835,8 +176938,11 @@ __export(exports_model, {
176835
176938
  getBestModel: () => getBestModel,
176836
176939
  anthropicNameToCanonical: () => anthropicNameToCanonical
176837
176940
  });
176941
+ function activeProviderUsesOwnModelStrings() {
176942
+ return isRayuNonAnthropicActive() && getAPIProvider() === "anthropic";
176943
+ }
176838
176944
  function getSmallFastModel() {
176839
- if (isOpenAICompatibleActive()) {
176945
+ if (activeProviderUsesOwnModelStrings()) {
176840
176946
  const { getActiveProvider: getActiveProvider2, getValidDefaultModel: getValidDefaultModel2 } = (init_rayuConfig(), __toCommonJS(exports_rayuConfig));
176841
176947
  const p = getActiveProvider2();
176842
176948
  if (process.env.ANTHROPIC_SMALL_FAST_MODEL) {
@@ -176925,7 +177031,7 @@ function getRuntimeMainLoopModel(params) {
176925
177031
  return mainLoopModel;
176926
177032
  }
176927
177033
  function getDefaultMainLoopModelSetting() {
176928
- if (isOpenAICompatibleActive() || getAPIProvider() === "bedrock") {
177034
+ if (activeProviderUsesOwnModelStrings() || getAPIProvider() === "bedrock") {
176929
177035
  try {
176930
177036
  const { getActiveProvider: getActiveProvider2, getValidDefaultModel: getValidDefaultModel2 } = (init_rayuConfig(), __toCommonJS(exports_rayuConfig));
176931
177037
  const m2 = getValidDefaultModel2(getActiveProvider2());
@@ -205400,7 +205506,7 @@ function getAttributionHeader(fingerprint) {
205400
205506
  if (!isAttributionHeaderEnabled()) {
205401
205507
  return "";
205402
205508
  }
205403
- const version2 = `${"1.4.476"}.${fingerprint}`;
205509
+ const version2 = `${"1.4.478"}.${fingerprint}`;
205404
205510
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
205405
205511
  const cch = "";
205406
205512
  const workload = getWorkload();
@@ -240456,7 +240562,7 @@ function modelSupportsThinking(model) {
240456
240562
  if (supported3P !== undefined) {
240457
240563
  return supported3P;
240458
240564
  }
240459
- if (isOpenAICompatibleActive() || isRayuNonAnthropicActive()) {
240565
+ if (isOpenAICompatibleActive() || isRayuNonAnthropicActive() && !isClaudeModelOrAlias(model)) {
240460
240566
  return true;
240461
240567
  }
240462
240568
  if (false) {}
@@ -240478,7 +240584,7 @@ function modelSupportsAdaptiveThinking(model) {
240478
240584
  if (isRayuAnthropicCompatibleActive()) {
240479
240585
  return false;
240480
240586
  }
240481
- if (isRayuNonAnthropicActive()) {
240587
+ if (isRayuNonAnthropicActive() && !isClaudeModelOrAlias(model)) {
240482
240588
  return true;
240483
240589
  }
240484
240590
  const canonical = getCanonicalName(model);
@@ -240508,6 +240614,7 @@ function shouldEnableThinkingByDefault() {
240508
240614
  var RAINBOW_COLORS, RAINBOW_SHIMMER_COLORS;
240509
240615
  var init_thinking = __esm(() => {
240510
240616
  init_model();
240617
+ init_aliases();
240511
240618
  init_antModels();
240512
240619
  init_modelSupportOverrides();
240513
240620
  init_providers();
@@ -240534,7 +240641,7 @@ var init_thinking = __esm(() => {
240534
240641
 
240535
240642
  // src/utils/effort.ts
240536
240643
  function modelSupportsEffort(model) {
240537
- if (isOpenAICompatibleActive() || isRayuNonAnthropicActive()) {
240644
+ if (isOpenAICompatibleActive() || isRayuNonAnthropicActive() && !isClaudeModelOrAlias(model)) {
240538
240645
  return true;
240539
240646
  }
240540
240647
  const m2 = model.toLowerCase();
@@ -240554,7 +240661,7 @@ function modelSupportsEffort(model) {
240554
240661
  return getAPIProvider() === "anthropic";
240555
240662
  }
240556
240663
  function modelSupportsMaxEffort(model) {
240557
- if (isOpenAICompatibleActive() || isRayuNonAnthropicActive()) {
240664
+ if (isOpenAICompatibleActive() || isRayuNonAnthropicActive() && !isClaudeModelOrAlias(model)) {
240558
240665
  return true;
240559
240666
  }
240560
240667
  const supported3P = get3PModelCapabilityOverride(model, "max_effort");
@@ -240685,6 +240792,7 @@ var init_effort = __esm(() => {
240685
240792
  init_settings2();
240686
240793
  init_auth();
240687
240794
  init_providers();
240795
+ init_aliases();
240688
240796
  init_antModels();
240689
240797
  init_modelSupportOverrides();
240690
240798
  init_envUtils();
@@ -259369,7 +259477,7 @@ var init_metadata = __esm(() => {
259369
259477
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
259370
259478
  WHITESPACE_REGEX = /\s+/;
259371
259479
  getVersionBase = memoize_default(() => {
259372
- const match = "1.4.476".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
259480
+ const match = "1.4.478".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
259373
259481
  return match ? match[0] : undefined;
259374
259482
  });
259375
259483
  buildEnvContext = memoize_default(async () => {
@@ -259408,7 +259516,7 @@ var init_metadata = __esm(() => {
259408
259516
  },
259409
259517
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
259410
259518
  isRayuAction: isEnvTruthy(process.env.RAYU_ACTION),
259411
- version: "1.4.476",
259519
+ version: "1.4.478",
259412
259520
  versionBase: getVersionBase(),
259413
259521
  buildTime: "",
259414
259522
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
@@ -260728,6 +260836,17 @@ function formatAPIError(error54) {
260728
260836
  return `Unable to connect to API: SSL error (${code})`;
260729
260837
  }
260730
260838
  }
260839
+ switch (code) {
260840
+ case "ECONNREFUSED":
260841
+ return "Unable to connect to the API — the connection was refused. Check your network, VPN, or proxy, then try again";
260842
+ case "ECONNRESET":
260843
+ case "EPIPE":
260844
+ case "ECONNABORTED":
260845
+ return "The connection dropped mid-request (a network blip, a proxy, or the server closing the connection). Retrying usually works";
260846
+ case "ENOTFOUND":
260847
+ case "EAI_AGAIN":
260848
+ return "DNS lookup failed — the API hostname could not be resolved. Check your network/DNS or proxy settings";
260849
+ }
260731
260850
  }
260732
260851
  if (error54.message === "Connection error.") {
260733
260852
  if (connectionDetails?.code) {
@@ -260969,6 +261088,22 @@ function isRayuCreditLimitError(error54) {
260969
261088
  }
260970
261089
  return /credit limit reached|period_limit/i.test(error54.message ?? "");
260971
261090
  }
261091
+ function isRayuDailyTurnLimitError(error54) {
261092
+ if (!(error54 instanceof import_sdk11.APIError) || error54.status !== 429) {
261093
+ return false;
261094
+ }
261095
+ const limitHeader = error54.headers?.get?.("x-rayu-limit");
261096
+ if (String(limitHeader ?? "") === "daily_turn_limit") {
261097
+ return true;
261098
+ }
261099
+ const body = error54.error;
261100
+ if (body && typeof body === "object") {
261101
+ if ("reason" in body && String(body.reason ?? "") === "daily_turn_limit") {
261102
+ return true;
261103
+ }
261104
+ }
261105
+ return /daily[ _]turn[ _]limit/i.test(error54.message ?? "");
261106
+ }
260972
261107
  function getRayuCreditResetSeconds(error54) {
260973
261108
  const body = error54.error;
260974
261109
  if (body && typeof body === "object" && "resetSeconds" in body) {
@@ -260994,6 +261129,29 @@ function formatCreditResetHint(seconds) {
260994
261129
  const mins = Math.max(1, Math.round(seconds / 60));
260995
261130
  return `in about ${mins} minute${mins === 1 ? "" : "s"}`;
260996
261131
  }
261132
+ function isRayuHostedActive() {
261133
+ try {
261134
+ return getActiveProvider()?.kind === "rayu-hosted";
261135
+ } catch {
261136
+ return false;
261137
+ }
261138
+ }
261139
+ function isRayuHostedProviderUnavailable(error54) {
261140
+ if (!(error54 instanceof import_sdk11.APIError) || !isRayuHostedActive())
261141
+ return false;
261142
+ if (typeof error54.status === "number" && error54.status >= 500)
261143
+ return true;
261144
+ const body = error54.error;
261145
+ if (body && typeof body === "object") {
261146
+ if (String(body.type ?? "") === "provider_unavailable")
261147
+ return true;
261148
+ const nested = body.error;
261149
+ if (nested && typeof nested === "object" && String(nested.type ?? "") === "provider_unavailable") {
261150
+ return true;
261151
+ }
261152
+ }
261153
+ return /provider_unavailable/i.test(error54.message ?? "");
261154
+ }
260997
261155
  function getAssistantMessageFromError(error54, model, options) {
260998
261156
  if (error54 instanceof import_sdk11.APIConnectionTimeoutError || error54 instanceof import_sdk11.APIConnectionError && error54.message.toLowerCase().includes("timeout")) {
260999
261157
  return createAssistantAPIErrorMessage({
@@ -261001,6 +261159,21 @@ function getAssistantMessageFromError(error54, model, options) {
261001
261159
  error: "unknown"
261002
261160
  });
261003
261161
  }
261162
+ if (isRayuHostedActive()) {
261163
+ const switchCmd = getIsNonInteractiveSession() ? "--model" : "/model";
261164
+ if (error54 instanceof import_sdk11.APIConnectionError && !(error54 instanceof import_sdk11.APIConnectionTimeoutError)) {
261165
+ return createAssistantAPIErrorMessage({
261166
+ error: "unknown",
261167
+ content: `⚠️ Can't reach Rayu right now — the service may be temporarily down, or your connection dropped. Please try again in a little while.`
261168
+ });
261169
+ }
261170
+ if (isRayuHostedProviderUnavailable(error54)) {
261171
+ return createAssistantAPIErrorMessage({
261172
+ error: "invalid_request",
261173
+ content: `⚠️ Rayu's AI provider for "${model}" is temporarily unavailable. Try a smaller model with ${switchCmd}, or try again in a little while.`
261174
+ });
261175
+ }
261176
+ }
261004
261177
  if (error54 instanceof ImageSizeError || error54 instanceof ImageResizeError) {
261005
261178
  return createAssistantAPIErrorMessage({
261006
261179
  content: getImageTooLargeErrorMessage()
@@ -261022,6 +261195,15 @@ function getAssistantMessageFromError(error54, model, options) {
261022
261195
  content: `\uD83D\uDCB3 You've reached your plan's credit limit for this billing period.${resetHint} Renew or upgrade your plan, or add more credits, to keep using Rayu-hosted models: ${plansUrl}${switchHint}`
261023
261196
  });
261024
261197
  }
261198
+ if (isRayuDailyTurnLimitError(error54)) {
261199
+ const plansUrl = `${getRayuWebBaseUrl()}/plans`;
261200
+ const resetSeconds = getRayuCreditResetSeconds(error54);
261201
+ const resetHint = resetSeconds ? ` It resets ${formatCreditResetHint(resetSeconds)}.` : " It resets at the start of the next day (UTC).";
261202
+ return createAssistantAPIErrorMessage({
261203
+ error: "rate_limit",
261204
+ content: `\uD83D\uDEA6 You've reached your plan's daily request limit.${resetHint} Upgrade for a higher daily limit: ${plansUrl}`
261205
+ });
261206
+ }
261025
261207
  if (error54 instanceof import_sdk11.APIError && error54.status === 429 && shouldProcessRateLimits(false)) {
261026
261208
  const rateLimitType = error54.headers?.get?.("anthropic-ratelimit-unified-representative-claim");
261027
261209
  const overageStatus = error54.headers?.get?.("anthropic-ratelimit-unified-overage-status");
@@ -261360,7 +261542,21 @@ function classifyAPIError(error54) {
261360
261542
  if (connectionDetails?.isSSLError) {
261361
261543
  return "ssl_cert_error";
261362
261544
  }
261363
- return "connection_error";
261545
+ switch (connectionDetails?.code) {
261546
+ case "ENOTFOUND":
261547
+ case "EAI_AGAIN":
261548
+ return "dns_error";
261549
+ case "ECONNREFUSED":
261550
+ return "connection_refused";
261551
+ case "ECONNRESET":
261552
+ case "EPIPE":
261553
+ case "ECONNABORTED":
261554
+ return "connection_reset";
261555
+ case "ETIMEDOUT":
261556
+ return "api_timeout";
261557
+ default:
261558
+ return "connection_error";
261559
+ }
261364
261560
  }
261365
261561
  return "unknown";
261366
261562
  }
@@ -261895,6 +262091,12 @@ async function* withRetry(getClient, operation, options) {
261895
262091
  });
261896
262092
  throw new CannotRetryError(error54, retryContext);
261897
262093
  }
262094
+ if (isRayuDailyTurnLimitError(error54)) {
262095
+ logEvent("tengu_api_rayu_daily_turn_limit_reached", {
262096
+ provider: getAPIProviderForStatsig()
262097
+ });
262098
+ throw new CannotRetryError(error54, retryContext);
262099
+ }
261898
262100
  if (wasFastModeActive && !isPersistentRetryEnabled() && error54 instanceof import_sdk12.APIError && (error54.status === 429 || is529Error(error54))) {
261899
262101
  const overageReason = error54.headers?.get("anthropic-ratelimit-unified-overage-disabled-reason");
261900
262102
  if (overageReason !== null && overageReason !== undefined) {
@@ -261926,6 +262128,12 @@ async function* withRetry(getClient, operation, options) {
261926
262128
  });
261927
262129
  throw new CannotRetryError(error54, retryContext);
261928
262130
  }
262131
+ if (error54 instanceof import_sdk12.APIError && error54.status === 429 && !shouldRetry529(options.querySource)) {
262132
+ logEvent("tengu_api_429_background_dropped", {
262133
+ query_source: options.querySource
262134
+ });
262135
+ throw new CannotRetryError(error54, retryContext);
262136
+ }
261929
262137
  if (is529Error(error54) && (process.env.FALLBACK_FOR_ALL_PRIMARY_MODELS || isNonCustomOpusModel(options.model))) {
261930
262138
  consecutive529Errors++;
261931
262139
  if (consecutive529Errors >= MAX_529_RETRIES) {
@@ -291424,7 +291632,7 @@ function getTelemetryAttributes() {
291424
291632
  attributes["session.id"] = sessionId;
291425
291633
  }
291426
291634
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
291427
- attributes["app.version"] = "1.4.476";
291635
+ attributes["app.version"] = "1.4.478";
291428
291636
  }
291429
291637
  const oauthAccount = getOauthAccountInfo();
291430
291638
  if (oauthAccount) {
@@ -401781,7 +401989,7 @@ function getInstallationEnv() {
401781
401989
  return;
401782
401990
  }
401783
401991
  function getClaudeCodeVersion() {
401784
- return "1.4.476";
401992
+ return "1.4.478";
401785
401993
  }
401786
401994
  async function getInstalledVSCodeExtensionVersion(command) {
401787
401995
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -407019,7 +407227,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
407019
407227
  const client3 = new Client({
407020
407228
  name: "claude-code",
407021
407229
  title: "RAYU",
407022
- version: "1.4.476",
407230
+ version: "1.4.478",
407023
407231
  description: "Anthropic's agentic coding tool",
407024
407232
  websiteUrl: PRODUCT_URL
407025
407233
  }, {
@@ -407336,7 +407544,7 @@ var init_client7 = __esm(() => {
407336
407544
  const client3 = new Client({
407337
407545
  name: "claude-code",
407338
407546
  title: "RAYU",
407339
- version: "1.4.476",
407547
+ version: "1.4.478",
407340
407548
  description: "Anthropic's agentic coding tool",
407341
407549
  websiteUrl: PRODUCT_URL
407342
407550
  }, {
@@ -422155,7 +422363,7 @@ function computeFingerprint(messageText, version2) {
422155
422363
  }
422156
422364
  function computeFingerprintFromMessages(messages) {
422157
422365
  const firstMessageText = extractFirstMessageText(messages);
422158
- return computeFingerprint(firstMessageText, "1.4.476");
422366
+ return computeFingerprint(firstMessageText, "1.4.478");
422159
422367
  }
422160
422368
  var FINGERPRINT_SALT = "59cf53e54c78";
422161
422369
  var init_fingerprint = () => {};
@@ -422197,7 +422405,7 @@ async function sideQuery(opts) {
422197
422405
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
422198
422406
  }
422199
422407
  const messageText = extractFirstUserMessageText(messages);
422200
- const fingerprint = computeFingerprint(messageText, "1.4.476");
422408
+ const fingerprint = computeFingerprint(messageText, "1.4.478");
422201
422409
  const attributionHeader = getAttributionHeader(fingerprint);
422202
422410
  const systemBlocks = [
422203
422411
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -510113,6 +510321,66 @@ async function logContextMetrics(mcpConfigs, toolPermissionContext) {
510113
510321
  non_mcp_tools_tokens: nonMcpToolsTokens
510114
510322
  });
510115
510323
  }
510324
+ function firstNonEmptyString(o2, keys2) {
510325
+ for (const k2 of keys2) {
510326
+ const v2 = o2[k2];
510327
+ if (typeof v2 === "string" && v2.trim().length > 0)
510328
+ return v2;
510329
+ }
510330
+ return;
510331
+ }
510332
+ function deriveAskQuestionHeader(question, maxWidth) {
510333
+ const cleaned = question.replace(/[?.!\s]+$/g, "").trim();
510334
+ if (cleaned.length <= maxWidth)
510335
+ return cleaned || "Question";
510336
+ let out = "";
510337
+ for (const word of cleaned.split(/\s+/)) {
510338
+ if ((out ? out.length + 1 : 0) + word.length > maxWidth)
510339
+ break;
510340
+ out = out ? `${out} ${word}` : word;
510341
+ }
510342
+ return out || cleaned.slice(0, maxWidth);
510343
+ }
510344
+ function coerceAskUserQuestionInput(input) {
510345
+ if (!Array.isArray(input.questions))
510346
+ return input;
510347
+ const questions = input.questions.map((rawQ) => {
510348
+ const q2 = typeof rawQ === "string" ? { question: rawQ } : rawQ && typeof rawQ === "object" ? { ...rawQ } : rawQ;
510349
+ if (!q2 || typeof q2 !== "object")
510350
+ return rawQ;
510351
+ const question = firstNonEmptyString(q2, ASK_Q_TEXT_KEYS);
510352
+ if (question !== undefined)
510353
+ q2.question = question;
510354
+ let header = firstNonEmptyString(q2, ASK_Q_HEADER_KEYS);
510355
+ if (header === undefined && question !== undefined) {
510356
+ header = deriveAskQuestionHeader(question, ASK_USER_QUESTION_TOOL_CHIP_WIDTH);
510357
+ }
510358
+ if (header !== undefined)
510359
+ q2.header = header;
510360
+ const rawOptions = Array.isArray(q2.options) ? q2.options : Array.isArray(q2.choices) ? q2.choices : undefined;
510361
+ if (Array.isArray(rawOptions)) {
510362
+ q2.options = rawOptions.map((rawOpt) => {
510363
+ if (typeof rawOpt === "string") {
510364
+ return { label: rawOpt, description: rawOpt };
510365
+ }
510366
+ if (!rawOpt || typeof rawOpt !== "object")
510367
+ return rawOpt;
510368
+ const opt = { ...rawOpt };
510369
+ const label = firstNonEmptyString(opt, ASK_OPT_LABEL_KEYS);
510370
+ const description = firstNonEmptyString(opt, ASK_OPT_DESC_KEYS);
510371
+ const finalLabel = label ?? description;
510372
+ const finalDescription = description ?? label;
510373
+ if (finalLabel !== undefined)
510374
+ opt.label = finalLabel;
510375
+ if (finalDescription !== undefined)
510376
+ opt.description = finalDescription;
510377
+ return opt;
510378
+ });
510379
+ }
510380
+ return q2;
510381
+ });
510382
+ return { ...input, questions };
510383
+ }
510116
510384
  function normalizeToolInput(tool, input, agentId) {
510117
510385
  switch (tool.name) {
510118
510386
  case EXIT_PLAN_MODE_V2_TOOL_NAME: {
@@ -510182,6 +510450,9 @@ function normalizeToolInput(tool, input, agentId) {
510182
510450
  timeout: timeout ?? 30000
510183
510451
  };
510184
510452
  }
510453
+ case ASK_USER_QUESTION_TOOL_NAME: {
510454
+ return coerceAskUserQuestionInput(input);
510455
+ }
510185
510456
  default:
510186
510457
  return input;
510187
510458
  }
@@ -510206,7 +510477,7 @@ function normalizeToolInputForAPI(tool, input) {
510206
510477
  return input;
510207
510478
  }
510208
510479
  }
510209
- var SWARM_FIELDS_BY_TOOL, loggedStrip = false;
510480
+ var SWARM_FIELDS_BY_TOOL, loggedStrip = false, ASK_Q_TEXT_KEYS, ASK_Q_HEADER_KEYS, ASK_OPT_LABEL_KEYS, ASK_OPT_DESC_KEYS;
510210
510481
  var init_api3 = __esm(() => {
510211
510482
  init_prompts3();
510212
510483
  init_context2();
@@ -510221,6 +510492,7 @@ var init_api3 = __esm(() => {
510221
510492
  init_system();
510222
510493
  init_tokenEstimation();
510223
510494
  init_constants2();
510495
+ init_prompt7();
510224
510496
  init_agentSwarmsEnabled();
510225
510497
  init_betas2();
510226
510498
  init_cwd();
@@ -510240,6 +510512,26 @@ var init_api3 = __esm(() => {
510240
510512
  [EXIT_PLAN_MODE_V2_TOOL_NAME]: ["launchSwarm", "teammateCount"],
510241
510513
  [AGENT_TOOL_NAME]: ["name", "team_name", "mode"]
510242
510514
  };
510515
+ ASK_Q_TEXT_KEYS = ["question", "q", "prompt", "query", "text", "title"];
510516
+ ASK_Q_HEADER_KEYS = ["header", "label", "tag", "category", "topic", "title"];
510517
+ ASK_OPT_LABEL_KEYS = [
510518
+ "label",
510519
+ "title",
510520
+ "text",
510521
+ "name",
510522
+ "value",
510523
+ "option",
510524
+ "choice"
510525
+ ];
510526
+ ASK_OPT_DESC_KEYS = [
510527
+ "description",
510528
+ "desc",
510529
+ "detail",
510530
+ "details",
510531
+ "explanation",
510532
+ "subtitle",
510533
+ "summary"
510534
+ ];
510243
510535
  });
510244
510536
 
510245
510537
  // src/services/compact/apiMicrocompact.ts
@@ -510925,6 +511217,7 @@ ${deferredToolList}
510925
511217
  let stream4 = undefined;
510926
511218
  let streamRequestId = undefined;
510927
511219
  let clientRequestId = undefined;
511220
+ const logicalRequestId = randomUUID27();
510928
511221
  let streamResponse = undefined;
510929
511222
  function releaseStreamResources() {
510930
511223
  cleanupStream(stream4);
@@ -511112,10 +511405,30 @@ ${deferredToolList}
511112
511405
  headlessProfilerCheckpoint("api_request_sent");
511113
511406
  }
511114
511407
  clientRequestId = getAPIProvider() === "anthropic" && !isOpenAICompatibleActive() && isFirstPartyAnthropicBaseUrl() ? randomUUID27() : undefined;
511408
+ const rayuMetaHeaders = {
511409
+ [RAYU_LOGICAL_REQUEST_ID_HEADER]: logicalRequestId
511410
+ };
511411
+ {
511412
+ let intendedCanonical = "";
511413
+ try {
511414
+ intendedCanonical = getCanonicalName(options.model);
511415
+ } catch {
511416
+ intendedCanonical = "";
511417
+ }
511418
+ if (intendedCanonical) {
511419
+ rayuMetaHeaders[RAYU_INTENDED_MODEL_HEADER] = intendedCanonical;
511420
+ }
511421
+ if (options.querySource) {
511422
+ rayuMetaHeaders[RAYU_QUERY_SOURCE_HEADER] = options.querySource;
511423
+ }
511424
+ }
511115
511425
  const result = await anthropic.beta.messages.create({ ...params, stream: true }, {
511116
511426
  signal,
511117
- ...clientRequestId && {
511118
- headers: { [CLIENT_REQUEST_ID_HEADER]: clientRequestId }
511427
+ headers: {
511428
+ ...rayuMetaHeaders,
511429
+ ...clientRequestId && {
511430
+ [CLIENT_REQUEST_ID_HEADER]: clientRequestId
511431
+ }
511119
511432
  }
511120
511433
  }).withResponse();
511121
511434
  queryCheckpoint("query_response_headers_received");
@@ -512028,6 +512341,7 @@ var init_claude = __esm(() => {
512028
512341
  init_manager();
512029
512342
  init_vcr();
512030
512343
  init_client4();
512344
+ init_gatewayHeaders();
512031
512345
  init_errors7();
512032
512346
  init_logging();
512033
512347
  init_promptCacheBreakDetection();
@@ -521606,9 +521920,9 @@ async function assertMinVersion() {
521606
521920
  if (false) {}
521607
521921
  try {
521608
521922
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
521609
- if (versionConfig.minVersion && lt("1.4.476", versionConfig.minVersion)) {
521923
+ if (versionConfig.minVersion && lt("1.4.478", versionConfig.minVersion)) {
521610
521924
  console.error(`
521611
- It looks like your version of RAYU (${"1.4.476"}) needs an update.
521925
+ It looks like your version of RAYU (${"1.4.478"}) needs an update.
521612
521926
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
521613
521927
 
521614
521928
  To update, please run:
@@ -521834,7 +522148,7 @@ async function installGlobalPackage(specificVersion) {
521834
522148
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
521835
522149
  logEvent("tengu_auto_updater_lock_contention", {
521836
522150
  pid: process.pid,
521837
- currentVersion: "1.4.476"
522151
+ currentVersion: "1.4.478"
521838
522152
  });
521839
522153
  return "in_progress";
521840
522154
  }
@@ -521843,7 +522157,7 @@ async function installGlobalPackage(specificVersion) {
521843
522157
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
521844
522158
  logError2(new Error("Windows NPM detected in WSL environment"));
521845
522159
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
521846
- currentVersion: "1.4.476"
522160
+ currentVersion: "1.4.478"
521847
522161
  });
521848
522162
  console.error(`
521849
522163
  Error: Windows NPM detected in WSL
@@ -522371,7 +522685,7 @@ function detectLinuxGlobPatternWarnings() {
522371
522685
  }
522372
522686
  async function getDoctorDiagnostic() {
522373
522687
  const installationType = await getCurrentInstallationType();
522374
- const version2 = typeof MACRO !== "undefined" ? "1.4.476" : "unknown";
522688
+ const version2 = typeof MACRO !== "undefined" ? "1.4.478" : "unknown";
522375
522689
  const installationPath = await getInstallationPath();
522376
522690
  const invokedBinary = getInvokedBinary();
522377
522691
  const multipleInstallations = await detectMultipleInstallations();
@@ -523162,8 +523476,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
523162
523476
  const maxVersion = await getMaxVersion();
523163
523477
  if (maxVersion && gt(version2, maxVersion)) {
523164
523478
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
523165
- if (gte("1.4.476", maxVersion)) {
523166
- logForDebugging(`Native installer: current version ${"1.4.476"} is already at or above maxVersion ${maxVersion}, skipping update`);
523479
+ if (gte("1.4.478", maxVersion)) {
523480
+ logForDebugging(`Native installer: current version ${"1.4.478"} is already at or above maxVersion ${maxVersion}, skipping update`);
523167
523481
  logEvent("tengu_native_update_skipped_max_version", {
523168
523482
  latency_ms: Date.now() - startTime2,
523169
523483
  max_version: maxVersion,
@@ -523174,7 +523488,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
523174
523488
  version2 = maxVersion;
523175
523489
  }
523176
523490
  }
523177
- if (!forceReinstall && version2 === "1.4.476" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
523491
+ if (!forceReinstall && version2 === "1.4.478" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
523178
523492
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
523179
523493
  logEvent("tengu_native_update_complete", {
523180
523494
  latency_ms: Date.now() - startTime2,
@@ -524382,7 +524696,7 @@ function buildPrimarySection() {
524382
524696
  });
524383
524697
  return [{
524384
524698
  label: "Version",
524385
- value: "1.4.476"
524699
+ value: "1.4.478"
524386
524700
  }, {
524387
524701
  label: "Session name",
524388
524702
  value: nameValue
@@ -528053,7 +528367,7 @@ function Config({
528053
528367
  }
528054
528368
  })
528055
528369
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime168.jsx(ChannelDowngradeDialog, {
528056
- currentVersion: "1.4.476",
528370
+ currentVersion: "1.4.478",
528057
528371
  onChoice: (choice) => {
528058
528372
  setShowSubmenu(null);
528059
528373
  setTabsHidden(false);
@@ -528065,7 +528379,7 @@ function Config({
528065
528379
  autoUpdatesChannel: "stable"
528066
528380
  };
528067
528381
  if (choice === "stay") {
528068
- newSettings.minimumVersion = "1.4.476";
528382
+ newSettings.minimumVersion = "1.4.478";
528069
528383
  }
528070
528384
  updateSettingsForSource("userSettings", newSettings);
528071
528385
  setSettingsData((prev_27) => ({
@@ -536126,7 +536440,7 @@ function HelpV2(t0) {
536126
536440
  let t6;
536127
536441
  if ($3[31] !== tabs) {
536128
536442
  t6 = /* @__PURE__ */ jsx_runtime195.jsx(Tabs, {
536129
- title: `Rayu-CLI v${"1.4.476"}`,
536443
+ title: `Rayu-CLI v${"1.4.478"}`,
536130
536444
  color: "professionalBlue",
536131
536445
  defaultTab: "general",
536132
536446
  children: tabs
@@ -556704,7 +557018,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
556704
557018
  }
556705
557019
  return [];
556706
557020
  }
556707
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.476") {
557021
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.478") {
556708
557022
  if (false) {}
556709
557023
  const cachedChangelog = await getStoredChangelog();
556710
557024
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -556717,7 +557031,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.476")
556717
557031
  releaseNotes
556718
557032
  };
556719
557033
  }
556720
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.476") {
557034
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.478") {
556721
557035
  if (false) {}
556722
557036
  const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
556723
557037
  return {
@@ -556845,7 +557159,7 @@ function getRecentActivitySync() {
556845
557159
  return cachedActivity;
556846
557160
  }
556847
557161
  function getLogoDisplayData() {
556848
- const version2 = process.env.DEMO_VERSION ?? "1.4.476";
557162
+ const version2 = process.env.DEMO_VERSION ?? "1.4.478";
556849
557163
  const serverUrl = getDirectConnectServerUrl();
556850
557164
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
556851
557165
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -558010,7 +558324,7 @@ function LogoV2() {
558010
558324
  if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
558011
558325
  t2 = () => {
558012
558326
  const currentConfig = getGlobalConfig();
558013
- if (currentConfig.lastReleaseNotesSeen === "1.4.476") {
558327
+ if (currentConfig.lastReleaseNotesSeen === "1.4.478") {
558014
558328
  return;
558015
558329
  }
558016
558330
  saveGlobalConfig(_temp327);
@@ -558489,7 +558803,7 @@ function LogoV2() {
558489
558803
  t24 = $3[61];
558490
558804
  }
558491
558805
  const _latestNpm = getCachedLatestNpmVersionSync();
558492
- const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.476") ? [createUpdateAvailableFeed("1.4.476", _latestNpm)] : [];
558806
+ const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.478") ? [createUpdateAvailableFeed("1.4.478", _latestNpm)] : [];
558493
558807
  const t25 = layoutMode === "horizontal" && /* @__PURE__ */ jsx_runtime236.jsx(FeedColumn, {
558494
558808
  feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), ..._updateFeeds, createWhatsNewFeed(changelog)],
558495
558809
  maxWidth: rightWidth
@@ -558689,12 +559003,12 @@ function LogoV2() {
558689
559003
  return t41;
558690
559004
  }
558691
559005
  function _temp327(current) {
558692
- if (current.lastReleaseNotesSeen === "1.4.476") {
559006
+ if (current.lastReleaseNotesSeen === "1.4.478") {
558693
559007
  return current;
558694
559008
  }
558695
559009
  return {
558696
559010
  ...current,
558697
- lastReleaseNotesSeen: "1.4.476"
559011
+ lastReleaseNotesSeen: "1.4.478"
558698
559012
  };
558699
559013
  }
558700
559014
  function _temp241(s_0) {
@@ -583693,7 +584007,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
583693
584007
  smapsRollup,
583694
584008
  platform: process.platform,
583695
584009
  nodeVersion: process.version,
583696
- ccVersion: "1.4.476"
584010
+ ccVersion: "1.4.478"
583697
584011
  };
583698
584012
  }
583699
584013
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -584215,7 +584529,7 @@ var init_bridge_kick = __esm(() => {
584215
584529
  var call50 = async () => {
584216
584530
  return {
584217
584531
  type: "text",
584218
- value: "1.4.476"
584532
+ value: "1.4.478"
584219
584533
  };
584220
584534
  }, version2, version_default;
584221
584535
  var init_version = __esm(() => {
@@ -594711,7 +595025,7 @@ function generateHtmlReport(data, insights) {
594711
595025
  </html>`;
594712
595026
  }
594713
595027
  function buildExportData(data, insights, facets, remoteStats) {
594714
- const version3 = typeof MACRO !== "undefined" ? "1.4.476" : "unknown";
595028
+ const version3 = typeof MACRO !== "undefined" ? "1.4.478" : "unknown";
594715
595029
  const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
594716
595030
  const facets_summary = {
594717
595031
  total: facets.size,
@@ -598625,7 +598939,7 @@ var init_sessionStorage = __esm(() => {
598625
598939
  init_settings2();
598626
598940
  init_slowOperations();
598627
598941
  init_uuid();
598628
- VERSION6 = typeof MACRO !== "undefined" ? "1.4.476" : "unknown";
598942
+ VERSION6 = typeof MACRO !== "undefined" ? "1.4.478" : "unknown";
598629
598943
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
598630
598944
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
598631
598945
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -599843,7 +600157,7 @@ var init_filesystem = __esm(() => {
599843
600157
  });
599844
600158
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
599845
600159
  const nonce = randomBytes19(16).toString("hex");
599846
- return join153(getClaudeTempDir(), "bundled-skills", "1.4.476", nonce);
600160
+ return join153(getClaudeTempDir(), "bundled-skills", "1.4.478", nonce);
599847
600161
  });
599848
600162
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
599849
600163
  });
@@ -605013,7 +605327,7 @@ __export(exports_update, {
605013
605327
  update: () => update
605014
605328
  });
605015
605329
  async function update() {
605016
- writeToStdout(`Current version: ${"1.4.476"}
605330
+ writeToStdout(`Current version: ${"1.4.478"}
605017
605331
  `);
605018
605332
  const isBundled = isInBundledMode();
605019
605333
  if (isBundled) {
@@ -605044,13 +605358,13 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
605044
605358
  process.exit(1);
605045
605359
  return;
605046
605360
  }
605047
- if (latestVersion === "1.4.476") {
605361
+ if (latestVersion === "1.4.478") {
605048
605362
  writeToStdout(source_default.green(`
605049
- Rayu CLI is up to date (${"1.4.476"})
605363
+ Rayu CLI is up to date (${"1.4.478"})
605050
605364
  `));
605051
605365
  process.exit(0);
605052
605366
  }
605053
- writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.476"})
605367
+ writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.478"})
605054
605368
  `);
605055
605369
  writeToStdout(`Installing update...
605056
605370
 
@@ -605117,14 +605431,14 @@ async function updateNativeBinary() {
605117
605431
  } catch {
605118
605432
  latestVersion = "";
605119
605433
  }
605120
- if (latestVersion && latestVersion === "1.4.476") {
605434
+ if (latestVersion && latestVersion === "1.4.478") {
605121
605435
  writeToStdout(source_default.green(`
605122
- Rayu CLI is up to date (1.4.476)
605436
+ Rayu CLI is up to date (1.4.478)
605123
605437
  `));
605124
605438
  process.exit(0);
605125
605439
  }
605126
605440
  if (latestVersion) {
605127
- writeToStdout(`New version available: ${latestVersion} (current: 1.4.476)
605441
+ writeToStdout(`New version available: ${latestVersion} (current: 1.4.478)
605128
605442
  `);
605129
605443
  }
605130
605444
  writeToStdout(`Downloading and installing update...
@@ -605139,13 +605453,13 @@ Rayu CLI is up to date (1.4.476)
605139
605453
  return;
605140
605454
  }
605141
605455
  writeToStdout(source_default.green(`
605142
- Rayu CLI is up to date (1.4.476)
605456
+ Rayu CLI is up to date (1.4.478)
605143
605457
  `));
605144
605458
  process.exit(0);
605145
605459
  }
605146
605460
  const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
605147
605461
  writeToStdout(source_default.green(`
605148
- Successfully updated from 1.4.476 to ${updatedTo}
605462
+ Successfully updated from 1.4.478 to ${updatedTo}
605149
605463
  `));
605150
605464
  writeToStdout(`Restart your terminal to use the new version.
605151
605465
  `);
@@ -605210,7 +605524,7 @@ async function removeDataDir(dir) {
605210
605524
  async function uninstall(args = []) {
605211
605525
  const yes = args.includes("--yes") || args.includes("-y");
605212
605526
  const keepData = args.includes("--keep-data");
605213
- writeToStdout(`Uninstalling Rayu CLI (${"1.4.476"})...
605527
+ writeToStdout(`Uninstalling Rayu CLI (${"1.4.478"})...
605214
605528
  `);
605215
605529
  writeToStdout(`Running: npm uninstall -g ${"@rayu-dev/rayu-cli"}
605216
605530
 
@@ -605244,7 +605558,7 @@ This looks like a permissions error on npm's global install
605244
605558
  return;
605245
605559
  }
605246
605560
  writeToStdout(source_default.green(`
605247
- Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.476"}
605561
+ Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.478"}
605248
605562
  `));
605249
605563
  const configDir = getRayuConfigHomeDir();
605250
605564
  const dataExists = existsSync28(configDir);
@@ -605327,7 +605641,7 @@ function showFirstRunWelcome() {
605327
605641
  `);
605328
605642
  try {
605329
605643
  mkdirSync16(getRayuConfigHomeDir(), { recursive: true });
605330
- writeFileSync18(markerPath(), "1.4.476", "utf8");
605644
+ writeFileSync18(markerPath(), "1.4.478", "utf8");
605331
605645
  } catch {}
605332
605646
  }
605333
605647
  var init_firstRun = __esm(() => {
@@ -621513,7 +621827,7 @@ async function initializeBetaTracing(resource) {
621513
621827
  });
621514
621828
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
621515
621829
  setLoggerProvider(loggerProvider);
621516
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.476");
621830
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.478");
621517
621831
  setEventLogger(eventLogger);
621518
621832
  process.on("beforeExit", async () => {
621519
621833
  await loggerProvider?.forceFlush();
@@ -621553,7 +621867,7 @@ async function initializeTelemetry() {
621553
621867
  const platform4 = getPlatform();
621554
621868
  const baseAttributes = {
621555
621869
  [import_semantic_conventions.ATTR_SERVICE_NAME]: "claude-code",
621556
- [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.476"
621870
+ [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.478"
621557
621871
  };
621558
621872
  if (platform4 === "wsl") {
621559
621873
  const wslVersion = getWslVersion();
@@ -621598,7 +621912,7 @@ async function initializeTelemetry() {
621598
621912
  } catch {}
621599
621913
  };
621600
621914
  registerCleanup(shutdownTelemetry2);
621601
- return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.476");
621915
+ return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.478");
621602
621916
  }
621603
621917
  const meterProvider = new import_sdk_metrics2.MeterProvider({
621604
621918
  resource,
@@ -621618,7 +621932,7 @@ async function initializeTelemetry() {
621618
621932
  });
621619
621933
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
621620
621934
  setLoggerProvider(loggerProvider);
621621
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.476");
621935
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.478");
621622
621936
  setEventLogger(eventLogger);
621623
621937
  logForDebugging("[3P telemetry] Event logger set successfully");
621624
621938
  process.on("beforeExit", async () => {
@@ -621680,7 +621994,7 @@ Current timeout: ${timeoutMs}ms
621680
621994
  }
621681
621995
  };
621682
621996
  registerCleanup(shutdownTelemetry);
621683
- return meterProvider.getMeter("com.anthropic.claude_code", "1.4.476");
621997
+ return meterProvider.getMeter("com.anthropic.claude_code", "1.4.478");
621684
621998
  }
621685
621999
  async function flushTelemetry() {
621686
622000
  const meterProvider = getMeterProvider();
@@ -623182,7 +623496,7 @@ function buildSystemInitMessage(inputs) {
623182
623496
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
623183
623497
  apiKeySource: getAnthropicApiKeyWithSource().source,
623184
623498
  betas: getSdkBetas(),
623185
- claude_code_version: "1.4.476",
623499
+ claude_code_version: "1.4.478",
623186
623500
  output_style: outputStyle2,
623187
623501
  agents: inputs.agents.map((agent) => agent.agentType),
623188
623502
  skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
@@ -639556,7 +639870,7 @@ var init_useVoiceEnabled = __esm(() => {
639556
639870
  function getSemverPart(version3) {
639557
639871
  return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
639558
639872
  }
639559
- function useUpdateNotification(updatedVersion, initialVersion = "1.4.476") {
639873
+ function useUpdateNotification(updatedVersion, initialVersion = "1.4.478") {
639560
639874
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react217.useState(() => getSemverPart(initialVersion));
639561
639875
  if (!updatedVersion) {
639562
639876
  return null;
@@ -639596,7 +639910,7 @@ function AutoUpdater({
639596
639910
  return;
639597
639911
  }
639598
639912
  if (false) {}
639599
- const currentVersion = "1.4.476";
639913
+ const currentVersion = "1.4.478";
639600
639914
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
639601
639915
  let latestVersion = await getLatestVersion(channel2);
639602
639916
  const isDisabled = isAutoUpdaterDisabled();
@@ -639809,12 +640123,12 @@ function NativeAutoUpdater({
639809
640123
  logEvent("tengu_native_auto_updater_start", {});
639810
640124
  try {
639811
640125
  const maxVersion = await getMaxVersion();
639812
- if (maxVersion && gt("1.4.476", maxVersion)) {
640126
+ if (maxVersion && gt("1.4.478", maxVersion)) {
639813
640127
  const msg = await getMaxVersionMessage();
639814
640128
  setMaxVersionIssue(msg ?? "affects your version");
639815
640129
  }
639816
640130
  const result = await installLatest(channel2);
639817
- const currentVersion = "1.4.476";
640131
+ const currentVersion = "1.4.478";
639818
640132
  const latencyMs = Date.now() - startTime2;
639819
640133
  if (result.lockFailed) {
639820
640134
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -639951,17 +640265,17 @@ function PackageManagerAutoUpdater(t0) {
639951
640265
  const maxVersion = await getMaxVersion();
639952
640266
  if (maxVersion && latest && gt(latest, maxVersion)) {
639953
640267
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
639954
- if (gte("1.4.476", maxVersion)) {
639955
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.476"} is already at or above maxVersion ${maxVersion}, skipping update`);
640268
+ if (gte("1.4.478", maxVersion)) {
640269
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.478"} is already at or above maxVersion ${maxVersion}, skipping update`);
639956
640270
  setUpdateAvailable(false);
639957
640271
  return;
639958
640272
  }
639959
640273
  latest = maxVersion;
639960
640274
  }
639961
- const hasUpdate = latest && !gte("1.4.476", latest) && !shouldSkipVersion(latest);
640275
+ const hasUpdate = latest && !gte("1.4.478", latest) && !shouldSkipVersion(latest);
639962
640276
  setUpdateAvailable(!!hasUpdate);
639963
640277
  if (hasUpdate) {
639964
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.476"} -> ${latest}`);
640278
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.478"} -> ${latest}`);
639965
640279
  }
639966
640280
  };
639967
640281
  $3[0] = t1;
@@ -639995,7 +640309,7 @@ function PackageManagerAutoUpdater(t0) {
639995
640309
  wrap: "truncate",
639996
640310
  children: [
639997
640311
  "currentVersion: ",
639998
- "1.4.476"
640312
+ "1.4.478"
639999
640313
  ]
640000
640314
  });
640001
640315
  $3[3] = verbose;
@@ -648159,7 +648473,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
648159
648473
  project_dir: getOriginalCwd(),
648160
648474
  added_dirs: addedDirs
648161
648475
  },
648162
- version: "1.4.476",
648476
+ version: "1.4.478",
648163
648477
  output_style: {
648164
648478
  name: outputStyleName
648165
648479
  },
@@ -650338,7 +650652,7 @@ var init_user = __esm(() => {
650338
650652
  deviceId,
650339
650653
  sessionId: getSessionId(),
650340
650654
  email: getEmail(),
650341
- appVersion: "1.4.476",
650655
+ appVersion: "1.4.478",
650342
650656
  platform: getHostPlatformForAnalytics(),
650343
650657
  organizationUuid,
650344
650658
  accountUuid,
@@ -659777,7 +660091,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
659777
660091
  } catch {}
659778
660092
  const data = {
659779
660093
  trigger,
659780
- version: "1.4.476",
660094
+ version: "1.4.478",
659781
660095
  platform: process.platform,
659782
660096
  transcript,
659783
660097
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -671746,7 +672060,7 @@ function WelcomeV2() {
671746
672060
  dimColor: true,
671747
672061
  children: [
671748
672062
  "v",
671749
- "1.4.476"
672063
+ "1.4.478"
671750
672064
  ]
671751
672065
  })
671752
672066
  ]
@@ -672753,7 +673067,7 @@ function completeOnboarding() {
672753
673067
  saveGlobalConfig((current) => ({
672754
673068
  ...current,
672755
673069
  hasCompletedOnboarding: true,
672756
- lastOnboardingVersion: "1.4.476"
673070
+ lastOnboardingVersion: "1.4.478"
672757
673071
  }));
672758
673072
  }
672759
673073
  function showDialog(root2, renderer) {
@@ -677686,7 +678000,7 @@ function appendToLog(path29, message) {
677686
678000
  cwd: getFsImplementation().cwd(),
677687
678001
  userType: "external",
677688
678002
  sessionId: getSessionId(),
677689
- version: "1.4.476"
678003
+ version: "1.4.478"
677690
678004
  };
677691
678005
  getLogWriter(path29).write(messageWithTimestamp);
677692
678006
  }
@@ -681791,8 +682105,8 @@ async function getEnvLessBridgeConfig() {
681791
682105
  }
681792
682106
  async function checkEnvLessBridgeMinVersion() {
681793
682107
  const cfg = await getEnvLessBridgeConfig();
681794
- if (cfg.min_version && lt("1.4.476", cfg.min_version)) {
681795
- return `Your version of RAYU (${"1.4.476"}) is too old for Remote Control.
682108
+ if (cfg.min_version && lt("1.4.478", cfg.min_version)) {
682109
+ return `Your version of RAYU (${"1.4.478"}) is too old for Remote Control.
681796
682110
  Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
681797
682111
  }
681798
682112
  return null;
@@ -682265,7 +682579,7 @@ async function initBridgeCore(params) {
682265
682579
  const rawApi = createBridgeApiClient({
682266
682580
  baseUrl,
682267
682581
  getAccessToken,
682268
- runnerVersion: "1.4.476",
682582
+ runnerVersion: "1.4.478",
682269
682583
  onDebug: logForDebugging,
682270
682584
  onAuth401,
682271
682585
  getTrustedDeviceToken
@@ -687620,7 +687934,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
687620
687934
  setCwd(cwd3);
687621
687935
  const server = new Server({
687622
687936
  name: "claude/tengu",
687623
- version: "1.4.476"
687937
+ version: "1.4.478"
687624
687938
  }, {
687625
687939
  capabilities: {
687626
687940
  tools: {}
@@ -690149,7 +690463,7 @@ ${customInstructions}` : customInstructions;
690149
690463
  }
690150
690464
  }
690151
690465
  logForDiagnosticsNoPII("info", "started", {
690152
- version: "1.4.476",
690466
+ version: "1.4.478",
690153
690467
  is_native_binary: isInBundledMode()
690154
690468
  });
690155
690469
  registerCleanup(async () => {
@@ -690868,7 +691182,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
690868
691182
  pendingHookMessages
690869
691183
  }, renderAndRun);
690870
691184
  }
690871
- }).version(`1.4.476 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
691185
+ }).version(`1.4.478 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
690872
691186
  program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
690873
691187
  program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
690874
691188
  if (canUserConfigureAdvisor()) {
@@ -691328,7 +691642,7 @@ if (false) {}
691328
691642
  async function main2() {
691329
691643
  const args = process.argv.slice(2);
691330
691644
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
691331
- console.log(`${"1.4.476"} (Rayu-CLI)`);
691645
+ console.log(`${"1.4.478"} (Rayu-CLI)`);
691332
691646
  return;
691333
691647
  }
691334
691648
  if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayu-dev/rayu-cli",
3
- "version": "1.4.476",
3
+ "version": "1.4.478",
4
4
  "description": "Rayu-CLI — a multi-provider AI coding CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,9 +23,9 @@ const message = [
23
23
  ' Docs & issues: https://github.com/Choeng-Rayu/rayu-cli',
24
24
  '',
25
25
  'Whats new?:',
26
- ' - We Have restructure the rayu subagents, and added a new one for asset generation!',
27
- ' - Add new agent callaborator agent that can call other agents as tools, and manage the conversation between them.',
28
- ' - Try it by /collaborator_swarm and also /collaborator_model in the agent playground!',
26
+ ' - Improve the ask user question tool for all LLMs providers.',
27
+ ' - Fix the Gateway upstream error.',
28
+ ' - Fix the bug for plan credit calculation.',
29
29
  '',
30
30
  ].join('\n') + '\n';
31
31