@rayu-dev/rayu-cli 1.4.476 → 1.4.477

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/rayu.js +319 -89
  2. package/package.json +1 -1
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.477"}`;
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.477"} (${"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.477"}${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.477"}.${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.477".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.477",
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.477";
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.477";
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.477",
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.477",
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.477");
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.477");
422201
422409
  const attributionHeader = getAttributionHeader(fingerprint);
422202
422410
  const systemBlocks = [
422203
422411
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -510925,6 +511133,7 @@ ${deferredToolList}
510925
511133
  let stream4 = undefined;
510926
511134
  let streamRequestId = undefined;
510927
511135
  let clientRequestId = undefined;
511136
+ const logicalRequestId = randomUUID27();
510928
511137
  let streamResponse = undefined;
510929
511138
  function releaseStreamResources() {
510930
511139
  cleanupStream(stream4);
@@ -511112,10 +511321,30 @@ ${deferredToolList}
511112
511321
  headlessProfilerCheckpoint("api_request_sent");
511113
511322
  }
511114
511323
  clientRequestId = getAPIProvider() === "anthropic" && !isOpenAICompatibleActive() && isFirstPartyAnthropicBaseUrl() ? randomUUID27() : undefined;
511324
+ const rayuMetaHeaders = {
511325
+ [RAYU_LOGICAL_REQUEST_ID_HEADER]: logicalRequestId
511326
+ };
511327
+ {
511328
+ let intendedCanonical = "";
511329
+ try {
511330
+ intendedCanonical = getCanonicalName(options.model);
511331
+ } catch {
511332
+ intendedCanonical = "";
511333
+ }
511334
+ if (intendedCanonical) {
511335
+ rayuMetaHeaders[RAYU_INTENDED_MODEL_HEADER] = intendedCanonical;
511336
+ }
511337
+ if (options.querySource) {
511338
+ rayuMetaHeaders[RAYU_QUERY_SOURCE_HEADER] = options.querySource;
511339
+ }
511340
+ }
511115
511341
  const result = await anthropic.beta.messages.create({ ...params, stream: true }, {
511116
511342
  signal,
511117
- ...clientRequestId && {
511118
- headers: { [CLIENT_REQUEST_ID_HEADER]: clientRequestId }
511343
+ headers: {
511344
+ ...rayuMetaHeaders,
511345
+ ...clientRequestId && {
511346
+ [CLIENT_REQUEST_ID_HEADER]: clientRequestId
511347
+ }
511119
511348
  }
511120
511349
  }).withResponse();
511121
511350
  queryCheckpoint("query_response_headers_received");
@@ -512028,6 +512257,7 @@ var init_claude = __esm(() => {
512028
512257
  init_manager();
512029
512258
  init_vcr();
512030
512259
  init_client4();
512260
+ init_gatewayHeaders();
512031
512261
  init_errors7();
512032
512262
  init_logging();
512033
512263
  init_promptCacheBreakDetection();
@@ -521606,9 +521836,9 @@ async function assertMinVersion() {
521606
521836
  if (false) {}
521607
521837
  try {
521608
521838
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
521609
- if (versionConfig.minVersion && lt("1.4.476", versionConfig.minVersion)) {
521839
+ if (versionConfig.minVersion && lt("1.4.477", versionConfig.minVersion)) {
521610
521840
  console.error(`
521611
- It looks like your version of RAYU (${"1.4.476"}) needs an update.
521841
+ It looks like your version of RAYU (${"1.4.477"}) needs an update.
521612
521842
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
521613
521843
 
521614
521844
  To update, please run:
@@ -521834,7 +522064,7 @@ async function installGlobalPackage(specificVersion) {
521834
522064
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
521835
522065
  logEvent("tengu_auto_updater_lock_contention", {
521836
522066
  pid: process.pid,
521837
- currentVersion: "1.4.476"
522067
+ currentVersion: "1.4.477"
521838
522068
  });
521839
522069
  return "in_progress";
521840
522070
  }
@@ -521843,7 +522073,7 @@ async function installGlobalPackage(specificVersion) {
521843
522073
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
521844
522074
  logError2(new Error("Windows NPM detected in WSL environment"));
521845
522075
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
521846
- currentVersion: "1.4.476"
522076
+ currentVersion: "1.4.477"
521847
522077
  });
521848
522078
  console.error(`
521849
522079
  Error: Windows NPM detected in WSL
@@ -522371,7 +522601,7 @@ function detectLinuxGlobPatternWarnings() {
522371
522601
  }
522372
522602
  async function getDoctorDiagnostic() {
522373
522603
  const installationType = await getCurrentInstallationType();
522374
- const version2 = typeof MACRO !== "undefined" ? "1.4.476" : "unknown";
522604
+ const version2 = typeof MACRO !== "undefined" ? "1.4.477" : "unknown";
522375
522605
  const installationPath = await getInstallationPath();
522376
522606
  const invokedBinary = getInvokedBinary();
522377
522607
  const multipleInstallations = await detectMultipleInstallations();
@@ -523162,8 +523392,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
523162
523392
  const maxVersion = await getMaxVersion();
523163
523393
  if (maxVersion && gt(version2, maxVersion)) {
523164
523394
  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`);
523395
+ if (gte("1.4.477", maxVersion)) {
523396
+ logForDebugging(`Native installer: current version ${"1.4.477"} is already at or above maxVersion ${maxVersion}, skipping update`);
523167
523397
  logEvent("tengu_native_update_skipped_max_version", {
523168
523398
  latency_ms: Date.now() - startTime2,
523169
523399
  max_version: maxVersion,
@@ -523174,7 +523404,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
523174
523404
  version2 = maxVersion;
523175
523405
  }
523176
523406
  }
523177
- if (!forceReinstall && version2 === "1.4.476" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
523407
+ if (!forceReinstall && version2 === "1.4.477" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
523178
523408
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
523179
523409
  logEvent("tengu_native_update_complete", {
523180
523410
  latency_ms: Date.now() - startTime2,
@@ -524382,7 +524612,7 @@ function buildPrimarySection() {
524382
524612
  });
524383
524613
  return [{
524384
524614
  label: "Version",
524385
- value: "1.4.476"
524615
+ value: "1.4.477"
524386
524616
  }, {
524387
524617
  label: "Session name",
524388
524618
  value: nameValue
@@ -528053,7 +528283,7 @@ function Config({
528053
528283
  }
528054
528284
  })
528055
528285
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime168.jsx(ChannelDowngradeDialog, {
528056
- currentVersion: "1.4.476",
528286
+ currentVersion: "1.4.477",
528057
528287
  onChoice: (choice) => {
528058
528288
  setShowSubmenu(null);
528059
528289
  setTabsHidden(false);
@@ -528065,7 +528295,7 @@ function Config({
528065
528295
  autoUpdatesChannel: "stable"
528066
528296
  };
528067
528297
  if (choice === "stay") {
528068
- newSettings.minimumVersion = "1.4.476";
528298
+ newSettings.minimumVersion = "1.4.477";
528069
528299
  }
528070
528300
  updateSettingsForSource("userSettings", newSettings);
528071
528301
  setSettingsData((prev_27) => ({
@@ -536126,7 +536356,7 @@ function HelpV2(t0) {
536126
536356
  let t6;
536127
536357
  if ($3[31] !== tabs) {
536128
536358
  t6 = /* @__PURE__ */ jsx_runtime195.jsx(Tabs, {
536129
- title: `Rayu-CLI v${"1.4.476"}`,
536359
+ title: `Rayu-CLI v${"1.4.477"}`,
536130
536360
  color: "professionalBlue",
536131
536361
  defaultTab: "general",
536132
536362
  children: tabs
@@ -556704,7 +556934,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
556704
556934
  }
556705
556935
  return [];
556706
556936
  }
556707
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.476") {
556937
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.477") {
556708
556938
  if (false) {}
556709
556939
  const cachedChangelog = await getStoredChangelog();
556710
556940
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -556717,7 +556947,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.476")
556717
556947
  releaseNotes
556718
556948
  };
556719
556949
  }
556720
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.476") {
556950
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.477") {
556721
556951
  if (false) {}
556722
556952
  const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
556723
556953
  return {
@@ -556845,7 +557075,7 @@ function getRecentActivitySync() {
556845
557075
  return cachedActivity;
556846
557076
  }
556847
557077
  function getLogoDisplayData() {
556848
- const version2 = process.env.DEMO_VERSION ?? "1.4.476";
557078
+ const version2 = process.env.DEMO_VERSION ?? "1.4.477";
556849
557079
  const serverUrl = getDirectConnectServerUrl();
556850
557080
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
556851
557081
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -558010,7 +558240,7 @@ function LogoV2() {
558010
558240
  if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
558011
558241
  t2 = () => {
558012
558242
  const currentConfig = getGlobalConfig();
558013
- if (currentConfig.lastReleaseNotesSeen === "1.4.476") {
558243
+ if (currentConfig.lastReleaseNotesSeen === "1.4.477") {
558014
558244
  return;
558015
558245
  }
558016
558246
  saveGlobalConfig(_temp327);
@@ -558489,7 +558719,7 @@ function LogoV2() {
558489
558719
  t24 = $3[61];
558490
558720
  }
558491
558721
  const _latestNpm = getCachedLatestNpmVersionSync();
558492
- const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.476") ? [createUpdateAvailableFeed("1.4.476", _latestNpm)] : [];
558722
+ const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.477") ? [createUpdateAvailableFeed("1.4.477", _latestNpm)] : [];
558493
558723
  const t25 = layoutMode === "horizontal" && /* @__PURE__ */ jsx_runtime236.jsx(FeedColumn, {
558494
558724
  feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), ..._updateFeeds, createWhatsNewFeed(changelog)],
558495
558725
  maxWidth: rightWidth
@@ -558689,12 +558919,12 @@ function LogoV2() {
558689
558919
  return t41;
558690
558920
  }
558691
558921
  function _temp327(current) {
558692
- if (current.lastReleaseNotesSeen === "1.4.476") {
558922
+ if (current.lastReleaseNotesSeen === "1.4.477") {
558693
558923
  return current;
558694
558924
  }
558695
558925
  return {
558696
558926
  ...current,
558697
- lastReleaseNotesSeen: "1.4.476"
558927
+ lastReleaseNotesSeen: "1.4.477"
558698
558928
  };
558699
558929
  }
558700
558930
  function _temp241(s_0) {
@@ -583693,7 +583923,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
583693
583923
  smapsRollup,
583694
583924
  platform: process.platform,
583695
583925
  nodeVersion: process.version,
583696
- ccVersion: "1.4.476"
583926
+ ccVersion: "1.4.477"
583697
583927
  };
583698
583928
  }
583699
583929
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -584215,7 +584445,7 @@ var init_bridge_kick = __esm(() => {
584215
584445
  var call50 = async () => {
584216
584446
  return {
584217
584447
  type: "text",
584218
- value: "1.4.476"
584448
+ value: "1.4.477"
584219
584449
  };
584220
584450
  }, version2, version_default;
584221
584451
  var init_version = __esm(() => {
@@ -594711,7 +594941,7 @@ function generateHtmlReport(data, insights) {
594711
594941
  </html>`;
594712
594942
  }
594713
594943
  function buildExportData(data, insights, facets, remoteStats) {
594714
- const version3 = typeof MACRO !== "undefined" ? "1.4.476" : "unknown";
594944
+ const version3 = typeof MACRO !== "undefined" ? "1.4.477" : "unknown";
594715
594945
  const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
594716
594946
  const facets_summary = {
594717
594947
  total: facets.size,
@@ -598625,7 +598855,7 @@ var init_sessionStorage = __esm(() => {
598625
598855
  init_settings2();
598626
598856
  init_slowOperations();
598627
598857
  init_uuid();
598628
- VERSION6 = typeof MACRO !== "undefined" ? "1.4.476" : "unknown";
598858
+ VERSION6 = typeof MACRO !== "undefined" ? "1.4.477" : "unknown";
598629
598859
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
598630
598860
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
598631
598861
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -599843,7 +600073,7 @@ var init_filesystem = __esm(() => {
599843
600073
  });
599844
600074
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
599845
600075
  const nonce = randomBytes19(16).toString("hex");
599846
- return join153(getClaudeTempDir(), "bundled-skills", "1.4.476", nonce);
600076
+ return join153(getClaudeTempDir(), "bundled-skills", "1.4.477", nonce);
599847
600077
  });
599848
600078
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
599849
600079
  });
@@ -605013,7 +605243,7 @@ __export(exports_update, {
605013
605243
  update: () => update
605014
605244
  });
605015
605245
  async function update() {
605016
- writeToStdout(`Current version: ${"1.4.476"}
605246
+ writeToStdout(`Current version: ${"1.4.477"}
605017
605247
  `);
605018
605248
  const isBundled = isInBundledMode();
605019
605249
  if (isBundled) {
@@ -605044,13 +605274,13 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
605044
605274
  process.exit(1);
605045
605275
  return;
605046
605276
  }
605047
- if (latestVersion === "1.4.476") {
605277
+ if (latestVersion === "1.4.477") {
605048
605278
  writeToStdout(source_default.green(`
605049
- Rayu CLI is up to date (${"1.4.476"})
605279
+ Rayu CLI is up to date (${"1.4.477"})
605050
605280
  `));
605051
605281
  process.exit(0);
605052
605282
  }
605053
- writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.476"})
605283
+ writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.477"})
605054
605284
  `);
605055
605285
  writeToStdout(`Installing update...
605056
605286
 
@@ -605117,14 +605347,14 @@ async function updateNativeBinary() {
605117
605347
  } catch {
605118
605348
  latestVersion = "";
605119
605349
  }
605120
- if (latestVersion && latestVersion === "1.4.476") {
605350
+ if (latestVersion && latestVersion === "1.4.477") {
605121
605351
  writeToStdout(source_default.green(`
605122
- Rayu CLI is up to date (1.4.476)
605352
+ Rayu CLI is up to date (1.4.477)
605123
605353
  `));
605124
605354
  process.exit(0);
605125
605355
  }
605126
605356
  if (latestVersion) {
605127
- writeToStdout(`New version available: ${latestVersion} (current: 1.4.476)
605357
+ writeToStdout(`New version available: ${latestVersion} (current: 1.4.477)
605128
605358
  `);
605129
605359
  }
605130
605360
  writeToStdout(`Downloading and installing update...
@@ -605139,13 +605369,13 @@ Rayu CLI is up to date (1.4.476)
605139
605369
  return;
605140
605370
  }
605141
605371
  writeToStdout(source_default.green(`
605142
- Rayu CLI is up to date (1.4.476)
605372
+ Rayu CLI is up to date (1.4.477)
605143
605373
  `));
605144
605374
  process.exit(0);
605145
605375
  }
605146
605376
  const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
605147
605377
  writeToStdout(source_default.green(`
605148
- Successfully updated from 1.4.476 to ${updatedTo}
605378
+ Successfully updated from 1.4.477 to ${updatedTo}
605149
605379
  `));
605150
605380
  writeToStdout(`Restart your terminal to use the new version.
605151
605381
  `);
@@ -605210,7 +605440,7 @@ async function removeDataDir(dir) {
605210
605440
  async function uninstall(args = []) {
605211
605441
  const yes = args.includes("--yes") || args.includes("-y");
605212
605442
  const keepData = args.includes("--keep-data");
605213
- writeToStdout(`Uninstalling Rayu CLI (${"1.4.476"})...
605443
+ writeToStdout(`Uninstalling Rayu CLI (${"1.4.477"})...
605214
605444
  `);
605215
605445
  writeToStdout(`Running: npm uninstall -g ${"@rayu-dev/rayu-cli"}
605216
605446
 
@@ -605244,7 +605474,7 @@ This looks like a permissions error on npm's global install
605244
605474
  return;
605245
605475
  }
605246
605476
  writeToStdout(source_default.green(`
605247
- Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.476"}
605477
+ Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.477"}
605248
605478
  `));
605249
605479
  const configDir = getRayuConfigHomeDir();
605250
605480
  const dataExists = existsSync28(configDir);
@@ -605327,7 +605557,7 @@ function showFirstRunWelcome() {
605327
605557
  `);
605328
605558
  try {
605329
605559
  mkdirSync16(getRayuConfigHomeDir(), { recursive: true });
605330
- writeFileSync18(markerPath(), "1.4.476", "utf8");
605560
+ writeFileSync18(markerPath(), "1.4.477", "utf8");
605331
605561
  } catch {}
605332
605562
  }
605333
605563
  var init_firstRun = __esm(() => {
@@ -621513,7 +621743,7 @@ async function initializeBetaTracing(resource) {
621513
621743
  });
621514
621744
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
621515
621745
  setLoggerProvider(loggerProvider);
621516
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.476");
621746
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.477");
621517
621747
  setEventLogger(eventLogger);
621518
621748
  process.on("beforeExit", async () => {
621519
621749
  await loggerProvider?.forceFlush();
@@ -621553,7 +621783,7 @@ async function initializeTelemetry() {
621553
621783
  const platform4 = getPlatform();
621554
621784
  const baseAttributes = {
621555
621785
  [import_semantic_conventions.ATTR_SERVICE_NAME]: "claude-code",
621556
- [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.476"
621786
+ [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.477"
621557
621787
  };
621558
621788
  if (platform4 === "wsl") {
621559
621789
  const wslVersion = getWslVersion();
@@ -621598,7 +621828,7 @@ async function initializeTelemetry() {
621598
621828
  } catch {}
621599
621829
  };
621600
621830
  registerCleanup(shutdownTelemetry2);
621601
- return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.476");
621831
+ return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.477");
621602
621832
  }
621603
621833
  const meterProvider = new import_sdk_metrics2.MeterProvider({
621604
621834
  resource,
@@ -621618,7 +621848,7 @@ async function initializeTelemetry() {
621618
621848
  });
621619
621849
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
621620
621850
  setLoggerProvider(loggerProvider);
621621
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.476");
621851
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.477");
621622
621852
  setEventLogger(eventLogger);
621623
621853
  logForDebugging("[3P telemetry] Event logger set successfully");
621624
621854
  process.on("beforeExit", async () => {
@@ -621680,7 +621910,7 @@ Current timeout: ${timeoutMs}ms
621680
621910
  }
621681
621911
  };
621682
621912
  registerCleanup(shutdownTelemetry);
621683
- return meterProvider.getMeter("com.anthropic.claude_code", "1.4.476");
621913
+ return meterProvider.getMeter("com.anthropic.claude_code", "1.4.477");
621684
621914
  }
621685
621915
  async function flushTelemetry() {
621686
621916
  const meterProvider = getMeterProvider();
@@ -623182,7 +623412,7 @@ function buildSystemInitMessage(inputs) {
623182
623412
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
623183
623413
  apiKeySource: getAnthropicApiKeyWithSource().source,
623184
623414
  betas: getSdkBetas(),
623185
- claude_code_version: "1.4.476",
623415
+ claude_code_version: "1.4.477",
623186
623416
  output_style: outputStyle2,
623187
623417
  agents: inputs.agents.map((agent) => agent.agentType),
623188
623418
  skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
@@ -639556,7 +639786,7 @@ var init_useVoiceEnabled = __esm(() => {
639556
639786
  function getSemverPart(version3) {
639557
639787
  return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
639558
639788
  }
639559
- function useUpdateNotification(updatedVersion, initialVersion = "1.4.476") {
639789
+ function useUpdateNotification(updatedVersion, initialVersion = "1.4.477") {
639560
639790
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react217.useState(() => getSemverPart(initialVersion));
639561
639791
  if (!updatedVersion) {
639562
639792
  return null;
@@ -639596,7 +639826,7 @@ function AutoUpdater({
639596
639826
  return;
639597
639827
  }
639598
639828
  if (false) {}
639599
- const currentVersion = "1.4.476";
639829
+ const currentVersion = "1.4.477";
639600
639830
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
639601
639831
  let latestVersion = await getLatestVersion(channel2);
639602
639832
  const isDisabled = isAutoUpdaterDisabled();
@@ -639809,12 +640039,12 @@ function NativeAutoUpdater({
639809
640039
  logEvent("tengu_native_auto_updater_start", {});
639810
640040
  try {
639811
640041
  const maxVersion = await getMaxVersion();
639812
- if (maxVersion && gt("1.4.476", maxVersion)) {
640042
+ if (maxVersion && gt("1.4.477", maxVersion)) {
639813
640043
  const msg = await getMaxVersionMessage();
639814
640044
  setMaxVersionIssue(msg ?? "affects your version");
639815
640045
  }
639816
640046
  const result = await installLatest(channel2);
639817
- const currentVersion = "1.4.476";
640047
+ const currentVersion = "1.4.477";
639818
640048
  const latencyMs = Date.now() - startTime2;
639819
640049
  if (result.lockFailed) {
639820
640050
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -639951,17 +640181,17 @@ function PackageManagerAutoUpdater(t0) {
639951
640181
  const maxVersion = await getMaxVersion();
639952
640182
  if (maxVersion && latest && gt(latest, maxVersion)) {
639953
640183
  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`);
640184
+ if (gte("1.4.477", maxVersion)) {
640185
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.477"} is already at or above maxVersion ${maxVersion}, skipping update`);
639956
640186
  setUpdateAvailable(false);
639957
640187
  return;
639958
640188
  }
639959
640189
  latest = maxVersion;
639960
640190
  }
639961
- const hasUpdate = latest && !gte("1.4.476", latest) && !shouldSkipVersion(latest);
640191
+ const hasUpdate = latest && !gte("1.4.477", latest) && !shouldSkipVersion(latest);
639962
640192
  setUpdateAvailable(!!hasUpdate);
639963
640193
  if (hasUpdate) {
639964
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.476"} -> ${latest}`);
640194
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.477"} -> ${latest}`);
639965
640195
  }
639966
640196
  };
639967
640197
  $3[0] = t1;
@@ -639995,7 +640225,7 @@ function PackageManagerAutoUpdater(t0) {
639995
640225
  wrap: "truncate",
639996
640226
  children: [
639997
640227
  "currentVersion: ",
639998
- "1.4.476"
640228
+ "1.4.477"
639999
640229
  ]
640000
640230
  });
640001
640231
  $3[3] = verbose;
@@ -648159,7 +648389,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
648159
648389
  project_dir: getOriginalCwd(),
648160
648390
  added_dirs: addedDirs
648161
648391
  },
648162
- version: "1.4.476",
648392
+ version: "1.4.477",
648163
648393
  output_style: {
648164
648394
  name: outputStyleName
648165
648395
  },
@@ -650338,7 +650568,7 @@ var init_user = __esm(() => {
650338
650568
  deviceId,
650339
650569
  sessionId: getSessionId(),
650340
650570
  email: getEmail(),
650341
- appVersion: "1.4.476",
650571
+ appVersion: "1.4.477",
650342
650572
  platform: getHostPlatformForAnalytics(),
650343
650573
  organizationUuid,
650344
650574
  accountUuid,
@@ -659777,7 +660007,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
659777
660007
  } catch {}
659778
660008
  const data = {
659779
660009
  trigger,
659780
- version: "1.4.476",
660010
+ version: "1.4.477",
659781
660011
  platform: process.platform,
659782
660012
  transcript,
659783
660013
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -671746,7 +671976,7 @@ function WelcomeV2() {
671746
671976
  dimColor: true,
671747
671977
  children: [
671748
671978
  "v",
671749
- "1.4.476"
671979
+ "1.4.477"
671750
671980
  ]
671751
671981
  })
671752
671982
  ]
@@ -672753,7 +672983,7 @@ function completeOnboarding() {
672753
672983
  saveGlobalConfig((current) => ({
672754
672984
  ...current,
672755
672985
  hasCompletedOnboarding: true,
672756
- lastOnboardingVersion: "1.4.476"
672986
+ lastOnboardingVersion: "1.4.477"
672757
672987
  }));
672758
672988
  }
672759
672989
  function showDialog(root2, renderer) {
@@ -677686,7 +677916,7 @@ function appendToLog(path29, message) {
677686
677916
  cwd: getFsImplementation().cwd(),
677687
677917
  userType: "external",
677688
677918
  sessionId: getSessionId(),
677689
- version: "1.4.476"
677919
+ version: "1.4.477"
677690
677920
  };
677691
677921
  getLogWriter(path29).write(messageWithTimestamp);
677692
677922
  }
@@ -681791,8 +682021,8 @@ async function getEnvLessBridgeConfig() {
681791
682021
  }
681792
682022
  async function checkEnvLessBridgeMinVersion() {
681793
682023
  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.
682024
+ if (cfg.min_version && lt("1.4.477", cfg.min_version)) {
682025
+ return `Your version of RAYU (${"1.4.477"}) is too old for Remote Control.
681796
682026
  Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
681797
682027
  }
681798
682028
  return null;
@@ -682265,7 +682495,7 @@ async function initBridgeCore(params) {
682265
682495
  const rawApi = createBridgeApiClient({
682266
682496
  baseUrl,
682267
682497
  getAccessToken,
682268
- runnerVersion: "1.4.476",
682498
+ runnerVersion: "1.4.477",
682269
682499
  onDebug: logForDebugging,
682270
682500
  onAuth401,
682271
682501
  getTrustedDeviceToken
@@ -687620,7 +687850,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
687620
687850
  setCwd(cwd3);
687621
687851
  const server = new Server({
687622
687852
  name: "claude/tengu",
687623
- version: "1.4.476"
687853
+ version: "1.4.477"
687624
687854
  }, {
687625
687855
  capabilities: {
687626
687856
  tools: {}
@@ -690149,7 +690379,7 @@ ${customInstructions}` : customInstructions;
690149
690379
  }
690150
690380
  }
690151
690381
  logForDiagnosticsNoPII("info", "started", {
690152
- version: "1.4.476",
690382
+ version: "1.4.477",
690153
690383
  is_native_binary: isInBundledMode()
690154
690384
  });
690155
690385
  registerCleanup(async () => {
@@ -690868,7 +691098,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
690868
691098
  pendingHookMessages
690869
691099
  }, renderAndRun);
690870
691100
  }
690871
- }).version(`1.4.476 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
691101
+ }).version(`1.4.477 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
690872
691102
  program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
690873
691103
  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
691104
  if (canUserConfigureAdvisor()) {
@@ -691328,7 +691558,7 @@ if (false) {}
691328
691558
  async function main2() {
691329
691559
  const args = process.argv.slice(2);
691330
691560
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
691331
- console.log(`${"1.4.476"} (Rayu-CLI)`);
691561
+ console.log(`${"1.4.477"} (Rayu-CLI)`);
691332
691562
  return;
691333
691563
  }
691334
691564
  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.477",
4
4
  "description": "Rayu-CLI — a multi-provider AI coding CLI",
5
5
  "type": "module",
6
6
  "bin": {