@rayu-dev/rayu-cli 1.4.479 → 1.4.481

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 +809 -359
  2. package/package.json +1 -1
package/dist/rayu.js CHANGED
@@ -149022,7 +149022,7 @@ var init_isEqual = __esm(() => {
149022
149022
 
149023
149023
  // src/utils/userAgent.ts
149024
149024
  function getRayuUserAgent() {
149025
- return `rayu/${"1.4.479"}`;
149025
+ return `rayu/${"1.4.481"}`;
149026
149026
  }
149027
149027
  var getClaudeCodeUserAgent;
149028
149028
  var init_userAgent = __esm(() => {
@@ -149048,7 +149048,7 @@ function getUserAgent() {
149048
149048
  const clientApp = process.env.RAYU_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}` : "";
149049
149049
  const workload = getWorkload();
149050
149050
  const workloadSuffix = workload ? `, workload/${workload}` : "";
149051
- return `rayu/${"1.4.479"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
149051
+ return `rayu/${"1.4.481"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
149052
149052
  }
149053
149053
  function getMCPUserAgent() {
149054
149054
  const parts = [];
@@ -149062,7 +149062,7 @@ function getMCPUserAgent() {
149062
149062
  parts.push(`client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}`);
149063
149063
  }
149064
149064
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
149065
- return `rayu/${"1.4.479"}${suffix}`;
149065
+ return `rayu/${"1.4.481"}${suffix}`;
149066
149066
  }
149067
149067
  function getWebFetchUserAgent() {
149068
149068
  return `Rayu-User (${getRayuUserAgent()})`;
@@ -205506,7 +205506,7 @@ function getAttributionHeader(fingerprint) {
205506
205506
  if (!isAttributionHeaderEnabled()) {
205507
205507
  return "";
205508
205508
  }
205509
- const version2 = `${"1.4.479"}.${fingerprint}`;
205509
+ const version2 = `${"1.4.481"}.${fingerprint}`;
205510
205510
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
205511
205511
  const cch = "";
205512
205512
  const workload = getWorkload();
@@ -259477,7 +259477,7 @@ var init_metadata = __esm(() => {
259477
259477
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
259478
259478
  WHITESPACE_REGEX = /\s+/;
259479
259479
  getVersionBase = memoize_default(() => {
259480
- const match = "1.4.479".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
259480
+ const match = "1.4.481".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
259481
259481
  return match ? match[0] : undefined;
259482
259482
  });
259483
259483
  buildEnvContext = memoize_default(async () => {
@@ -259516,7 +259516,7 @@ var init_metadata = __esm(() => {
259516
259516
  },
259517
259517
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
259518
259518
  isRayuAction: isEnvTruthy(process.env.RAYU_ACTION),
259519
- version: "1.4.479",
259519
+ version: "1.4.481",
259520
259520
  versionBase: getVersionBase(),
259521
259521
  buildTime: "",
259522
259522
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
@@ -291632,7 +291632,7 @@ function getTelemetryAttributes() {
291632
291632
  attributes["session.id"] = sessionId;
291633
291633
  }
291634
291634
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
291635
- attributes["app.version"] = "1.4.479";
291635
+ attributes["app.version"] = "1.4.481";
291636
291636
  }
291637
291637
  const oauthAccount = getOauthAccountInfo();
291638
291638
  if (oauthAccount) {
@@ -401989,7 +401989,7 @@ function getInstallationEnv() {
401989
401989
  return;
401990
401990
  }
401991
401991
  function getClaudeCodeVersion() {
401992
- return "1.4.479";
401992
+ return "1.4.481";
401993
401993
  }
401994
401994
  async function getInstalledVSCodeExtensionVersion(command) {
401995
401995
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -407227,7 +407227,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
407227
407227
  const client3 = new Client({
407228
407228
  name: "claude-code",
407229
407229
  title: "RAYU",
407230
- version: "1.4.479",
407230
+ version: "1.4.481",
407231
407231
  description: "Anthropic's agentic coding tool",
407232
407232
  websiteUrl: PRODUCT_URL
407233
407233
  }, {
@@ -407544,7 +407544,7 @@ var init_client7 = __esm(() => {
407544
407544
  const client3 = new Client({
407545
407545
  name: "claude-code",
407546
407546
  title: "RAYU",
407547
- version: "1.4.479",
407547
+ version: "1.4.481",
407548
407548
  description: "Anthropic's agentic coding tool",
407549
407549
  websiteUrl: PRODUCT_URL
407550
407550
  }, {
@@ -422363,7 +422363,7 @@ function computeFingerprint(messageText, version2) {
422363
422363
  }
422364
422364
  function computeFingerprintFromMessages(messages) {
422365
422365
  const firstMessageText = extractFirstMessageText(messages);
422366
- return computeFingerprint(firstMessageText, "1.4.479");
422366
+ return computeFingerprint(firstMessageText, "1.4.481");
422367
422367
  }
422368
422368
  var FINGERPRINT_SALT = "59cf53e54c78";
422369
422369
  var init_fingerprint = () => {};
@@ -422405,7 +422405,7 @@ async function sideQuery(opts) {
422405
422405
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
422406
422406
  }
422407
422407
  const messageText = extractFirstUserMessageText(messages);
422408
- const fingerprint = computeFingerprint(messageText, "1.4.479");
422408
+ const fingerprint = computeFingerprint(messageText, "1.4.481");
422409
422409
  const attributionHeader = getAttributionHeader(fingerprint);
422410
422410
  const systemBlocks = [
422411
422411
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -521928,9 +521928,9 @@ async function assertMinVersion() {
521928
521928
  if (false) {}
521929
521929
  try {
521930
521930
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
521931
- if (versionConfig.minVersion && lt("1.4.479", versionConfig.minVersion)) {
521931
+ if (versionConfig.minVersion && lt("1.4.481", versionConfig.minVersion)) {
521932
521932
  console.error(`
521933
- It looks like your version of RAYU (${"1.4.479"}) needs an update.
521933
+ It looks like your version of RAYU (${"1.4.481"}) needs an update.
521934
521934
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
521935
521935
 
521936
521936
  To update, please run:
@@ -522156,7 +522156,7 @@ async function installGlobalPackage(specificVersion) {
522156
522156
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
522157
522157
  logEvent("tengu_auto_updater_lock_contention", {
522158
522158
  pid: process.pid,
522159
- currentVersion: "1.4.479"
522159
+ currentVersion: "1.4.481"
522160
522160
  });
522161
522161
  return "in_progress";
522162
522162
  }
@@ -522165,7 +522165,7 @@ async function installGlobalPackage(specificVersion) {
522165
522165
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
522166
522166
  logError2(new Error("Windows NPM detected in WSL environment"));
522167
522167
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
522168
- currentVersion: "1.4.479"
522168
+ currentVersion: "1.4.481"
522169
522169
  });
522170
522170
  console.error(`
522171
522171
  Error: Windows NPM detected in WSL
@@ -522693,7 +522693,7 @@ function detectLinuxGlobPatternWarnings() {
522693
522693
  }
522694
522694
  async function getDoctorDiagnostic() {
522695
522695
  const installationType = await getCurrentInstallationType();
522696
- const version2 = typeof MACRO !== "undefined" ? "1.4.479" : "unknown";
522696
+ const version2 = typeof MACRO !== "undefined" ? "1.4.481" : "unknown";
522697
522697
  const installationPath = await getInstallationPath();
522698
522698
  const invokedBinary = getInvokedBinary();
522699
522699
  const multipleInstallations = await detectMultipleInstallations();
@@ -523238,6 +523238,10 @@ function getPlatform3() {
523238
523238
  function getBinaryName(platform4) {
523239
523239
  return platform4.startsWith("win32") ? "rayu.exe" : "rayu";
523240
523240
  }
523241
+ function isStaleWindowsExecutable(fileName, binaryName) {
523242
+ const escaped = binaryName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
523243
+ return new RegExp(`^${escaped}\\.old\\.\\d+$`).test(fileName);
523244
+ }
523241
523245
  function getBaseDirectories() {
523242
523246
  const platform4 = getPlatform3();
523243
523247
  const executableName = getBinaryName(platform4);
@@ -523484,8 +523488,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
523484
523488
  const maxVersion = await getMaxVersion();
523485
523489
  if (maxVersion && gt(version2, maxVersion)) {
523486
523490
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
523487
- if (gte("1.4.479", maxVersion)) {
523488
- logForDebugging(`Native installer: current version ${"1.4.479"} is already at or above maxVersion ${maxVersion}, skipping update`);
523491
+ if (gte("1.4.481", maxVersion)) {
523492
+ logForDebugging(`Native installer: current version ${"1.4.481"} is already at or above maxVersion ${maxVersion}, skipping update`);
523489
523493
  logEvent("tengu_native_update_skipped_max_version", {
523490
523494
  latency_ms: Date.now() - startTime2,
523491
523495
  max_version: maxVersion,
@@ -523496,7 +523500,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
523496
523500
  version2 = maxVersion;
523497
523501
  }
523498
523502
  }
523499
- if (!forceReinstall && version2 === "1.4.479" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
523503
+ if (!forceReinstall && version2 === "1.4.481" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
523500
523504
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
523501
523505
  logEvent("tengu_native_update_complete", {
523502
523506
  latency_ms: Date.now() - startTime2,
@@ -523906,7 +523910,7 @@ async function cleanupOldVersions() {
523906
523910
  const files2 = await readdir23(executableDir);
523907
523911
  let cleanedCount = 0;
523908
523912
  for (const file2 of files2) {
523909
- if (!/^claude\.exe\.old\.\d+$/.test(file2))
523913
+ if (!isStaleWindowsExecutable(file2, getBinaryName(getPlatform3())))
523910
523914
  continue;
523911
523915
  try {
523912
523916
  await unlink15(join127(executableDir, file2));
@@ -524704,7 +524708,7 @@ function buildPrimarySection() {
524704
524708
  });
524705
524709
  return [{
524706
524710
  label: "Version",
524707
- value: "1.4.479"
524711
+ value: "1.4.481"
524708
524712
  }, {
524709
524713
  label: "Session name",
524710
524714
  value: nameValue
@@ -528375,7 +528379,7 @@ function Config({
528375
528379
  }
528376
528380
  })
528377
528381
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime168.jsx(ChannelDowngradeDialog, {
528378
- currentVersion: "1.4.479",
528382
+ currentVersion: "1.4.481",
528379
528383
  onChoice: (choice) => {
528380
528384
  setShowSubmenu(null);
528381
528385
  setTabsHidden(false);
@@ -528387,7 +528391,7 @@ function Config({
528387
528391
  autoUpdatesChannel: "stable"
528388
528392
  };
528389
528393
  if (choice === "stay") {
528390
- newSettings.minimumVersion = "1.4.479";
528394
+ newSettings.minimumVersion = "1.4.481";
528391
528395
  }
528392
528396
  updateSettingsForSource("userSettings", newSettings);
528393
528397
  setSettingsData((prev_27) => ({
@@ -536448,7 +536452,7 @@ function HelpV2(t0) {
536448
536452
  let t6;
536449
536453
  if ($3[31] !== tabs) {
536450
536454
  t6 = /* @__PURE__ */ jsx_runtime195.jsx(Tabs, {
536451
- title: `Rayu-CLI v${"1.4.479"}`,
536455
+ title: `Rayu-CLI v${"1.4.481"}`,
536452
536456
  color: "professionalBlue",
536453
536457
  defaultTab: "general",
536454
536458
  children: tabs
@@ -554567,12 +554571,25 @@ function setTelegramMode(mode) {
554567
554571
  cfg.mode = mode;
554568
554572
  writeTelegramConfig(cfg);
554569
554573
  }
554570
- function setLinkedChat(chatId, username) {
554574
+ function setLinkedChat(chatId, username, botUsername) {
554571
554575
  const cfg = readTelegramConfig();
554572
554576
  cfg.linkedChatId = chatId;
554573
554577
  cfg.linkedUsername = username;
554578
+ if (botUsername)
554579
+ cfg.linkedBotUsername = botUsername;
554580
+ writeTelegramConfig(cfg);
554581
+ }
554582
+ function setLinkedBotUsername(botUsername) {
554583
+ const cfg = readTelegramConfig();
554584
+ cfg.linkedBotUsername = botUsername;
554574
554585
  writeTelegramConfig(cfg);
554575
554586
  }
554587
+ function normalizeBotToken(raw) {
554588
+ return raw.replace(/\u001b\[20[01]~/g, "").replace(/\u001b\[[0-9;?]*[ -/]*[@-~]/g, "").replace(/[\u0000-\u001f\u007f]/g, "").replace(/\s+/g, "").replace(/^["']|["']$/g, "").trim();
554589
+ }
554590
+ function isValidBotToken(raw) {
554591
+ return BOT_TOKEN_RE.test(normalizeBotToken(raw));
554592
+ }
554576
554593
  function getBotToken() {
554577
554594
  const cfg = readTelegramConfig();
554578
554595
  if (cfg.botToken && cfg.botToken.trim().length > 0)
@@ -554582,7 +554599,7 @@ function getBotToken() {
554582
554599
  }
554583
554600
  function saveBotToken(token) {
554584
554601
  const cfg = readTelegramConfig();
554585
- cfg.botToken = token.trim();
554602
+ cfg.botToken = normalizeBotToken(token);
554586
554603
  writeTelegramConfig(cfg);
554587
554604
  }
554588
554605
  function clearBotToken() {
@@ -554633,12 +554650,23 @@ function consumePendingToken(token, chatId, username) {
554633
554650
  writeTelegramConfig(next);
554634
554651
  return next;
554635
554652
  }
554653
+ function telegramTransportKey() {
554654
+ const cfg = readTelegramConfig();
554655
+ const mode = getTelegramMode();
554656
+ return mode === "hosted" ? `hosted:${cfg.linkedBotUsername ?? "shared"}` : `byo:${getBotToken()?.split(":")[0] ?? "none"}`;
554657
+ }
554636
554658
  function unlink18() {
554637
- const current = readTelegramConfig();
554638
- writeTelegramConfig({ botToken: current.botToken });
554659
+ const next = { ...readTelegramConfig() };
554660
+ delete next.linkedChatId;
554661
+ delete next.linkedUsername;
554662
+ delete next.linkedBotUsername;
554663
+ delete next.pendingToken;
554664
+ writeTelegramConfig(next);
554639
554665
  }
554666
+ var BOT_TOKEN_RE;
554640
554667
  var init_telegramConfig = __esm(() => {
554641
554668
  init_envUtils();
554669
+ BOT_TOKEN_RE = /^\d+:[A-Za-z0-9_-]{10,}$/;
554642
554670
  });
554643
554671
 
554644
554672
  // src/telegram/telegramApi.ts
@@ -554963,28 +554991,50 @@ __export(exports_telegram_bot, {
554963
554991
  call: () => call20
554964
554992
  });
554965
554993
  import { randomUUID as randomUUID29 } from "crypto";
554994
+ function activateBridge(setAppState) {
554995
+ const key2 = telegramTransportKey();
554996
+ setAppState((prev) => ({
554997
+ ...prev,
554998
+ telegramBridgeActive: true,
554999
+ telegramTransportKey: key2
555000
+ }));
555001
+ }
554966
555002
  function useKeyPress(target, handler) {
554967
- import_react132.useEffect(() => {
554968
- const onData = (data) => {
554969
- const ch2 = data.toString().trim().toLowerCase();
554970
- if (ch2 === target)
554971
- handler();
554972
- };
554973
- process.stdin.on("data", onData);
554974
- return () => {
554975
- process.stdin.off("data", onData);
554976
- };
554977
- }, [target, handler]);
555003
+ use_input_default((input) => {
555004
+ if (input.trim().toLowerCase() === target)
555005
+ handler();
555006
+ });
555007
+ }
555008
+ function useEscapeToCancel(onCancel) {
555009
+ use_input_default((_input, key2) => {
555010
+ if (key2.escape)
555011
+ onCancel();
555012
+ });
555013
+ }
555014
+ function CancelHint() {
555015
+ return /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555016
+ dimColor: true,
555017
+ children: [
555018
+ "Press ",
555019
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555020
+ bold: true,
555021
+ children: "Esc"
555022
+ }),
555023
+ " to cancel."
555024
+ ]
555025
+ });
554978
555026
  }
554979
555027
  function HostedStep({
554980
555028
  onDone,
554981
- onUseByo
555029
+ onUseByo,
555030
+ onCancel
554982
555031
  }) {
554983
555032
  const [status, setStatus] = import_react132.useState("loading");
554984
555033
  const [pairing, setPairing] = import_react132.useState(null);
554985
555034
  const [qr, setQr] = import_react132.useState("");
554986
555035
  const setAppState = useSetAppState();
554987
555036
  useKeyPress("b", onUseByo);
555037
+ useEscapeToCancel(onCancel);
554988
555038
  import_react132.useEffect(() => {
554989
555039
  let cancelled = false;
554990
555040
  (async () => {
@@ -555028,14 +555078,17 @@ function HostedStep({
555028
555078
  if (!link5.linked)
555029
555079
  return;
555030
555080
  clearInterval(timer);
555031
- if (link5.chatId)
555032
- setLinkedChat(Number(link5.chatId), link5.username ?? undefined);
555033
- setAppState((prev) => ({ ...prev, telegramBridgeActive: true }));
555081
+ if (link5.chatId) {
555082
+ setLinkedChat(Number(link5.chatId), link5.username ?? undefined, pairing?.botUsername ?? undefined);
555083
+ } else if (pairing?.botUsername) {
555084
+ setLinkedBotUsername(pairing.botUsername);
555085
+ }
555086
+ activateBridge(setAppState);
555034
555087
  onDone();
555035
555088
  });
555036
555089
  }, 1500);
555037
555090
  return () => clearInterval(timer);
555038
- }, [status, onDone, setAppState]);
555091
+ }, [status, onDone, setAppState, pairing]);
555039
555092
  if (status === "loading") {
555040
555093
  return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555041
555094
  children: /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
@@ -555073,7 +555126,8 @@ function HostedStep({
555073
555126
  }),
555074
555127
  " to connect your own bot token instead."
555075
555128
  ]
555076
- })
555129
+ }),
555130
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555077
555131
  ]
555078
555132
  })
555079
555133
  });
@@ -555106,7 +555160,8 @@ function HostedStep({
555106
555160
  }),
555107
555161
  " to connect your own bot token instead."
555108
555162
  ]
555109
- })
555163
+ }),
555164
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555110
555165
  ]
555111
555166
  })
555112
555167
  });
@@ -555162,48 +555217,155 @@ function HostedStep({
555162
555217
  }),
555163
555218
  " to use your own bot token instead."
555164
555219
  ]
555165
- })
555220
+ }),
555221
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555166
555222
  ]
555167
555223
  })
555168
555224
  });
555169
555225
  }
555170
- function TokenInputStep({ onReady }) {
555226
+ function TokenInputStep({
555227
+ onReady,
555228
+ onCancel
555229
+ }) {
555171
555230
  const [existing, setExisting] = import_react132.useState(() => getBotToken());
555231
+ const [editing, setEditing] = import_react132.useState(() => getBotToken() === undefined);
555232
+ const connect5 = import_react132.useCallback(() => {
555233
+ setTelegramMode("byo");
555234
+ onReady();
555235
+ }, [onReady]);
555236
+ if (existing && !editing) {
555237
+ return /* @__PURE__ */ jsx_runtime222.jsx(ExistingTokenMenu, {
555238
+ token: existing,
555239
+ onConnect: connect5,
555240
+ onReplace: () => setEditing(true),
555241
+ onDelete: () => {
555242
+ clearBotToken();
555243
+ setExisting(undefined);
555244
+ setEditing(true);
555245
+ },
555246
+ onCancel
555247
+ });
555248
+ }
555249
+ return /* @__PURE__ */ jsx_runtime222.jsx(TokenPrompt, {
555250
+ hasExisting: existing !== undefined,
555251
+ onSaved: connect5,
555252
+ onCancel,
555253
+ onCancelReplace: existing !== undefined ? () => setEditing(false) : undefined
555254
+ });
555255
+ }
555256
+ function ExistingTokenMenu({
555257
+ token,
555258
+ onConnect,
555259
+ onReplace,
555260
+ onDelete,
555261
+ onCancel
555262
+ }) {
555263
+ useEscapeToCancel(onCancel);
555264
+ use_input_default((input, key2) => {
555265
+ if (key2.return) {
555266
+ onConnect();
555267
+ return;
555268
+ }
555269
+ const ch2 = input.trim().toLowerCase();
555270
+ if (ch2 === "1")
555271
+ onConnect();
555272
+ else if (ch2 === "2" || ch2 === "r")
555273
+ onReplace();
555274
+ else if (ch2 === "3" || ch2 === "d")
555275
+ onDelete();
555276
+ });
555277
+ return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555278
+ children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555279
+ flexDirection: "column",
555280
+ children: [
555281
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555282
+ bold: true,
555283
+ children: "\uD83D\uDCF1 Your Telegram bot token"
555284
+ }),
555285
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555286
+ children: " "
555287
+ }),
555288
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555289
+ children: [
555290
+ "A bot token is already saved (…",
555291
+ token.slice(-6),
555292
+ ")."
555293
+ ]
555294
+ }),
555295
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555296
+ children: " "
555297
+ }),
555298
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555299
+ children: [
555300
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555301
+ bold: true,
555302
+ children: "Enter"
555303
+ }),
555304
+ " connect with it",
555305
+ " ",
555306
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555307
+ bold: true,
555308
+ children: "r"
555309
+ }),
555310
+ " replace it",
555311
+ " ",
555312
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555313
+ bold: true,
555314
+ children: "d"
555315
+ }),
555316
+ " remove it"
555317
+ ]
555318
+ }),
555319
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555320
+ ]
555321
+ })
555322
+ });
555323
+ }
555324
+ function TokenPrompt({
555325
+ hasExisting,
555326
+ onSaved,
555327
+ onCancel,
555328
+ onCancelReplace
555329
+ }) {
555330
+ const [value, setValue] = import_react132.useState("");
555331
+ const [cursorOffset, setCursorOffset] = import_react132.useState(0);
555172
555332
  const [error54, setError] = import_react132.useState("");
555173
- const [waiting, setWaiting] = import_react132.useState(false);
555174
- import_react132.useEffect(() => {
555175
- const handler = (data) => {
555176
- const line = data.toString().trim();
555177
- if (existing) {
555178
- if (line === "") {
555179
- setTelegramMode("byo");
555180
- onReady();
555181
- return;
555182
- }
555183
- if (line.toLowerCase() === "d") {
555184
- clearBotToken();
555185
- setExisting(undefined);
555186
- setError("");
555187
- return;
555188
- }
555189
- }
555190
- if (!line)
555333
+ const [status, setStatus] = import_react132.useState("idle");
555334
+ use_input_default((_input, key2) => {
555335
+ if (!key2.escape)
555336
+ return;
555337
+ if (onCancelReplace)
555338
+ onCancelReplace();
555339
+ else
555340
+ onCancel();
555341
+ }, { isActive: status === "idle" });
555342
+ const handleSubmit = import_react132.useCallback((submitted) => {
555343
+ if (status !== "idle")
555344
+ return;
555345
+ const token = normalizeBotToken(submitted);
555346
+ if (!token) {
555347
+ setError("Paste the token from @BotFather, then press Enter.");
555348
+ return;
555349
+ }
555350
+ if (!isValidBotToken(token)) {
555351
+ setError("That doesn't look like a bot token. It should be like: 123456789:ABCDefGHI…");
555352
+ return;
555353
+ }
555354
+ setError("");
555355
+ setStatus("verifying");
555356
+ getBotUsername(token).then((username) => {
555357
+ if (!username) {
555358
+ setStatus("idle");
555359
+ setError("Telegram rejected this token. Check it in @BotFather (or /revoke and paste the new one).");
555191
555360
  return;
555192
- if (/^\d+:[A-Za-z0-9_-]+$/.test(line)) {
555193
- saveBotToken(line);
555194
- setTelegramMode("byo");
555195
- setWaiting(true);
555196
- setTimeout(() => onReady(), 300);
555197
- } else {
555198
- setError("That doesn't look like a valid bot token. It should be like: 123456789:ABCDefGHI...");
555199
555361
  }
555200
- };
555201
- process.stdin.on("data", handler);
555202
- return () => {
555203
- process.stdin.off("data", handler);
555204
- };
555205
- }, [existing, onReady]);
555206
- if (waiting) {
555362
+ saveBotToken(token);
555363
+ setTelegramMode("byo");
555364
+ setStatus("saved");
555365
+ setTimeout(onSaved, 300);
555366
+ });
555367
+ }, [status, onSaved]);
555368
+ if (status === "saved") {
555207
555369
  return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555208
555370
  children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555209
555371
  flexDirection: "column",
@@ -555220,65 +555382,13 @@ function TokenInputStep({ onReady }) {
555220
555382
  })
555221
555383
  });
555222
555384
  }
555223
- if (existing) {
555224
- return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555225
- children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555226
- flexDirection: "column",
555227
- children: [
555228
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555229
- bold: true,
555230
- children: "\uD83D\uDCF1 Your Telegram bot token"
555231
- }),
555232
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555233
- children: " "
555234
- }),
555235
- /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555236
- children: [
555237
- "A bot token is already saved (…",
555238
- existing.slice(-6),
555239
- ")."
555240
- ]
555241
- }),
555242
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555243
- children: " "
555244
- }),
555245
- /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555246
- children: [
555247
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555248
- bold: true,
555249
- children: "Enter"
555250
- }),
555251
- " connect with it",
555252
- " ",
555253
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555254
- bold: true,
555255
- children: "d"
555256
- }),
555257
- " remove it",
555258
- " ",
555259
- "or paste a ",
555260
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555261
- bold: true,
555262
- children: "new"
555263
- }),
555264
- " token to replace it."
555265
- ]
555266
- }),
555267
- error54 ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555268
- color: "red",
555269
- children: error54
555270
- }) : null
555271
- ]
555272
- })
555273
- });
555274
- }
555275
555385
  return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555276
555386
  children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555277
555387
  flexDirection: "column",
555278
555388
  children: [
555279
555389
  /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555280
555390
  bold: true,
555281
- children: "\uD83D\uDCF1 Connect your own Telegram bot"
555391
+ children: hasExisting ? "\uD83D\uDCF1 Replace your Telegram bot token" : "\uD83D\uDCF1 Connect your own Telegram bot"
555282
555392
  }),
555283
555393
  /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555284
555394
  children: " "
@@ -555309,34 +555419,67 @@ function TokenInputStep({ onReady }) {
555309
555419
  /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555310
555420
  children: " 3. Copy the bot token (looks like: 123456789:ABCDef...)"
555311
555421
  }),
555312
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555313
- children: " 4. Paste it below:"
555422
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555423
+ children: [
555424
+ " 4. Paste it below and press ",
555425
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555426
+ bold: true,
555427
+ children: "Enter"
555428
+ }),
555429
+ ":"
555430
+ ]
555314
555431
  }),
555315
555432
  /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555316
555433
  children: " "
555317
555434
  }),
555318
- /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555319
- bold: true,
555320
- color: "cyan",
555321
- children: "⌨ Paste your bot token: "
555435
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555436
+ children: [
555437
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555438
+ bold: true,
555439
+ color: "cyan",
555440
+ children: "⌨ Bot token: "
555441
+ }),
555442
+ /* @__PURE__ */ jsx_runtime222.jsx(TextInput, {
555443
+ value,
555444
+ onChange: setValue,
555445
+ onSubmit: handleSubmit,
555446
+ cursorOffset,
555447
+ onChangeCursorOffset: setCursorOffset,
555448
+ columns: 80,
555449
+ focus: status === "idle",
555450
+ showCursor: true
555451
+ })
555452
+ ]
555322
555453
  }),
555454
+ status === "verifying" ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555455
+ dimColor: true,
555456
+ children: "Checking the token with Telegram…"
555457
+ }) : null,
555323
555458
  error54 ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555324
555459
  color: "red",
555325
555460
  children: error54
555326
- }) : null
555461
+ }) : null,
555462
+ onCancelReplace ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555463
+ dimColor: true,
555464
+ children: "Press Esc to keep the token you already have."
555465
+ }) : /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555327
555466
  ]
555328
555467
  })
555329
555468
  });
555330
555469
  }
555331
- function LinkStep({ onDone }) {
555470
+ function LinkStep({
555471
+ onDone,
555472
+ onCancel
555473
+ }) {
555332
555474
  const token = getBotToken();
555333
555475
  const [pairToken] = import_react132.useState(() => randomUUID29().slice(0, 8));
555334
555476
  const [qr, setQr] = import_react132.useState("");
555335
555477
  const [botUsername, setBotUsername] = import_react132.useState(undefined);
555336
555478
  const setAppState = useSetAppState();
555479
+ useEscapeToCancel(onCancel);
555337
555480
  import_react132.useEffect(() => {
555338
555481
  saveBotToken(token);
555339
- setAppState((prev) => ({ ...prev, telegramBridgeActive: true }));
555482
+ activateBridge(setAppState);
555340
555483
  setPendingToken(pairToken, TOKEN_TTL_MS);
555341
555484
  getBotUsername(token).then(async (name) => {
555342
555485
  setBotUsername(name);
@@ -555350,11 +555493,13 @@ function LinkStep({ onDone }) {
555350
555493
  const timer = setInterval(() => {
555351
555494
  if (readTelegramConfig().linkedChatId !== undefined) {
555352
555495
  clearInterval(timer);
555496
+ if (botUsername)
555497
+ setLinkedBotUsername(botUsername);
555353
555498
  onDone();
555354
555499
  }
555355
555500
  }, 1500);
555356
555501
  return () => clearInterval(timer);
555357
- }, [onDone]);
555502
+ }, [onDone, botUsername]);
555358
555503
  const lines2 = qr.split(`
555359
555504
  `).filter((l3) => l3.length > 0);
555360
555505
  return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
@@ -555387,35 +555532,30 @@ function LinkStep({ onDone }) {
555387
555532
  /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555388
555533
  dimColor: true,
555389
555534
  children: "Waiting for link… (token valid 10 min)"
555390
- })
555535
+ }),
555536
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555391
555537
  ]
555392
555538
  })
555393
555539
  });
555394
555540
  }
555395
555541
  function ChooseModeStep({
555396
- onChoose
555542
+ onChoose,
555543
+ onCancel
555397
555544
  }) {
555398
555545
  const [sel, setSel] = import_react132.useState(0);
555399
- import_react132.useEffect(() => {
555400
- const onData = (data) => {
555401
- const s2 = data.toString();
555402
- const t2 = s2.trim();
555403
- if (t2 === "1")
555404
- onChoose("hosted");
555405
- else if (t2 === "2")
555406
- onChoose("byo");
555407
- else if (s2 === "\r" || s2 === `
555408
- ` || t2 === "")
555409
- onChoose(sel === 0 ? "hosted" : "byo");
555410
- else if (s2 === "\x1B[A" || s2 === "\x1B[B" || t2 === "j" || t2 === "k") {
555411
- setSel((p) => p === 0 ? 1 : 0);
555412
- }
555413
- };
555414
- process.stdin.on("data", onData);
555415
- return () => {
555416
- process.stdin.off("data", onData);
555417
- };
555418
- }, [onChoose, sel]);
555546
+ useEscapeToCancel(onCancel);
555547
+ use_input_default((input, key2) => {
555548
+ const t2 = input.trim();
555549
+ if (t2 === "1")
555550
+ onChoose("hosted");
555551
+ else if (t2 === "2")
555552
+ onChoose("byo");
555553
+ else if (key2.return)
555554
+ onChoose(sel === 0 ? "hosted" : "byo");
555555
+ else if (key2.upArrow || key2.downArrow || t2 === "j" || t2 === "k") {
555556
+ setSel((p) => p === 0 ? 1 : 0);
555557
+ }
555558
+ });
555419
555559
  return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555420
555560
  children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555421
555561
  flexDirection: "column",
@@ -555457,22 +555597,66 @@ function ChooseModeStep({
555457
555597
  /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555458
555598
  dimColor: true,
555459
555599
  children: "Press 1 or 2 (or ↑/↓ then Enter). Enter = shared bot."
555460
- })
555600
+ }),
555601
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555461
555602
  ]
555462
555603
  })
555463
555604
  });
555464
555605
  }
555465
- function TelegramBotConnect({ onDone }) {
555466
- const alreadyLinked = readTelegramConfig().linkedChatId !== undefined;
555467
- const setAppState = useSetAppState();
555468
- const [screen, setScreen] = import_react132.useState("choose");
555469
- import_react132.useEffect(() => {
555470
- if (alreadyLinked) {
555471
- setAppState((prev) => ({ ...prev, telegramBridgeActive: true }));
555472
- onDone();
555606
+ async function resolveCurrentBotUsername() {
555607
+ if (getTelegramMode() === "hosted") {
555608
+ if (!hasRayuSession())
555609
+ return;
555610
+ const info = await getHostedBotInfo();
555611
+ return info.username ?? undefined;
555612
+ }
555613
+ const token = getBotToken();
555614
+ return token ? await getBotUsername(token) : undefined;
555615
+ }
555616
+ function VerifyLinkStep({
555617
+ onReconnect,
555618
+ onRepair,
555619
+ onCancel
555620
+ }) {
555621
+ const [check3, setCheck] = import_react132.useState({ kind: "checking" });
555622
+ useEscapeToCancel(onCancel);
555623
+ use_input_default((input, key2) => {
555624
+ if (check3.kind === "checking")
555625
+ return;
555626
+ if (key2.return) {
555627
+ if (check3.kind === "changed")
555628
+ onRepair();
555629
+ else {
555630
+ setLinkedBotUsername(check3.current);
555631
+ onReconnect();
555632
+ }
555633
+ return;
555473
555634
  }
555474
- }, [alreadyLinked, onDone, setAppState]);
555475
- if (alreadyLinked) {
555635
+ if (input.trim().toLowerCase() === "r")
555636
+ onRepair();
555637
+ }, { isActive: check3.kind !== "checking" });
555638
+ import_react132.useEffect(() => {
555639
+ let cancelled = false;
555640
+ (async () => {
555641
+ const recorded = readTelegramConfig().linkedBotUsername;
555642
+ const current = await resolveCurrentBotUsername();
555643
+ if (cancelled)
555644
+ return;
555645
+ if (!current) {
555646
+ onReconnect();
555647
+ return;
555648
+ }
555649
+ if (recorded && recorded.toLowerCase() === current.toLowerCase()) {
555650
+ onReconnect();
555651
+ return;
555652
+ }
555653
+ setCheck(recorded ? { kind: "changed", linkedTo: recorded, current } : { kind: "unverifiable", current });
555654
+ })();
555655
+ return () => {
555656
+ cancelled = true;
555657
+ };
555658
+ }, [onReconnect]);
555659
+ if (check3.kind === "checking") {
555476
555660
  return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555477
555661
  children: /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555478
555662
  dimColor: true,
@@ -555480,8 +555664,153 @@ function TelegramBotConnect({ onDone }) {
555480
555664
  })
555481
555665
  });
555482
555666
  }
555667
+ if (check3.kind === "changed") {
555668
+ return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555669
+ children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555670
+ flexDirection: "column",
555671
+ children: [
555672
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555673
+ bold: true,
555674
+ children: "\uD83D\uDCF1 Telegram bot changed"
555675
+ }),
555676
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555677
+ children: " "
555678
+ }),
555679
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555680
+ children: [
555681
+ "Your saved link points at ",
555682
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555683
+ bold: true,
555684
+ children: [
555685
+ "@",
555686
+ check3.linkedTo
555687
+ ]
555688
+ }),
555689
+ ", but Rayu now uses ",
555690
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555691
+ bold: true,
555692
+ children: [
555693
+ "@",
555694
+ check3.current
555695
+ ]
555696
+ }),
555697
+ "."
555698
+ ]
555699
+ }),
555700
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555701
+ dimColor: true,
555702
+ children: "The old link can't receive messages from the new bot."
555703
+ }),
555704
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555705
+ children: " "
555706
+ }),
555707
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555708
+ children: [
555709
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555710
+ bold: true,
555711
+ children: "Enter"
555712
+ }),
555713
+ " link with @",
555714
+ check3.current
555715
+ ]
555716
+ }),
555717
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555718
+ ]
555719
+ })
555720
+ });
555721
+ }
555722
+ return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555723
+ children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
555724
+ flexDirection: "column",
555725
+ children: [
555726
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555727
+ bold: true,
555728
+ children: "\uD83D\uDCF1 Telegram is already linked"
555729
+ }),
555730
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555731
+ children: " "
555732
+ }),
555733
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555734
+ children: [
555735
+ "Rayu currently uses ",
555736
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555737
+ bold: true,
555738
+ children: [
555739
+ "@",
555740
+ check3.current
555741
+ ]
555742
+ }),
555743
+ "."
555744
+ ]
555745
+ }),
555746
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555747
+ dimColor: true,
555748
+ children: "This link was saved before Rayu recorded which bot it belongs to, so it may point at an older bot."
555749
+ }),
555750
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555751
+ children: " "
555752
+ }),
555753
+ /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
555754
+ children: [
555755
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555756
+ bold: true,
555757
+ children: "Enter"
555758
+ }),
555759
+ " reconnect with the saved link",
555760
+ " ",
555761
+ /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555762
+ bold: true,
555763
+ children: "r"
555764
+ }),
555765
+ " re-link with @",
555766
+ check3.current
555767
+ ]
555768
+ }),
555769
+ /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
555770
+ ]
555771
+ })
555772
+ });
555773
+ }
555774
+ function TelegramBotConnect({ onDone }) {
555775
+ const setAppState = useSetAppState();
555776
+ const [screen, setScreen] = import_react132.useState(() => readTelegramConfig().linkedChatId === undefined ? "choose" : "verify");
555777
+ const [unlinking, setUnlinking] = import_react132.useState(false);
555778
+ const reconnect = import_react132.useCallback(() => {
555779
+ activateBridge(setAppState);
555780
+ onDone();
555781
+ }, [onDone, setAppState]);
555782
+ const repair = import_react132.useCallback(() => {
555783
+ setUnlinking(true);
555784
+ (async () => {
555785
+ if (getTelegramMode() === "hosted")
555786
+ await deleteHostedLink();
555787
+ unlink18();
555788
+ setUnlinking(false);
555789
+ setScreen("choose");
555790
+ })();
555791
+ }, []);
555792
+ const cancel = import_react132.useCallback(() => {
555793
+ setAppState((prev) => ({ ...prev, telegramBridgeActive: false }));
555794
+ onDone();
555795
+ }, [onDone, setAppState]);
555796
+ if (unlinking) {
555797
+ return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
555798
+ children: /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
555799
+ dimColor: true,
555800
+ children: "Removing the old Telegram link…"
555801
+ })
555802
+ });
555803
+ }
555804
+ if (screen === "verify") {
555805
+ return /* @__PURE__ */ jsx_runtime222.jsx(VerifyLinkStep, {
555806
+ onReconnect: reconnect,
555807
+ onRepair: repair,
555808
+ onCancel: cancel
555809
+ });
555810
+ }
555483
555811
  if (screen === "choose") {
555484
555812
  return /* @__PURE__ */ jsx_runtime222.jsx(ChooseModeStep, {
555813
+ onCancel: cancel,
555485
555814
  onChoose: (mode) => {
555486
555815
  if (mode === "hosted") {
555487
555816
  setTelegramMode("hosted");
@@ -555496,16 +555825,19 @@ function TelegramBotConnect({ onDone }) {
555496
555825
  if (screen === "hosted") {
555497
555826
  return /* @__PURE__ */ jsx_runtime222.jsx(HostedStep, {
555498
555827
  onDone,
555499
- onUseByo: () => setScreen("byo-token")
555828
+ onUseByo: () => setScreen("byo-token"),
555829
+ onCancel: cancel
555500
555830
  });
555501
555831
  }
555502
555832
  if (screen === "byo-token") {
555503
555833
  return /* @__PURE__ */ jsx_runtime222.jsx(TokenInputStep, {
555504
- onReady: () => setScreen("byo-link")
555834
+ onReady: () => setScreen("byo-link"),
555835
+ onCancel: cancel
555505
555836
  });
555506
555837
  }
555507
555838
  return /* @__PURE__ */ jsx_runtime222.jsx(LinkStep, {
555508
- onDone
555839
+ onDone,
555840
+ onCancel: cancel
555509
555841
  });
555510
555842
  }
555511
555843
  async function call20(onDone) {
@@ -555517,6 +555849,7 @@ var import_react132, jsx_runtime222, TOKEN_TTL_MS;
555517
555849
  var init_telegram_bot = __esm(() => {
555518
555850
  init_server();
555519
555851
  init_Pane();
555852
+ init_TextInput();
555520
555853
  init_ink2();
555521
555854
  init_telegramConfig();
555522
555855
  init_telegramApi();
@@ -555546,7 +555879,7 @@ var exports_disconnect = {};
555546
555879
  __export(exports_disconnect, {
555547
555880
  call: () => call21
555548
555881
  });
555549
- async function call21() {
555882
+ var call21 = async (_args, context2) => {
555550
555883
  const config5 = readTelegramConfig();
555551
555884
  if (!config5.linkedChatId) {
555552
555885
  return { type: "text", value: "Telegram bot is not currently linked." };
@@ -555560,12 +555893,18 @@ async function call21() {
555560
555893
  } else {
555561
555894
  const token = getBotToken();
555562
555895
  if (token) {
555563
- sendMessage3(token, config5.linkedChatId, "\uD83D\uDD0C CLI disconnected. Run `/telegram-bot` to link again.").catch(() => {});
555896
+ await sendMessage3(token, config5.linkedChatId, "\uD83D\uDD0C CLI disconnected. Run `/telegram-bot` to link again in your rayu cli session.").catch(() => {});
555564
555897
  }
555565
555898
  }
555566
555899
  unlink18();
555900
+ context2.setAppState((prev) => ({
555901
+ ...prev,
555902
+ telegramBridgeActive: false,
555903
+ telegramTransportKey: undefined,
555904
+ telegramPermissionCallbacks: undefined
555905
+ }));
555567
555906
  return { type: "text", value: `Disconnected Telegram bot (was linked to ${username}).` };
555568
- }
555907
+ };
555569
555908
  var init_disconnect = __esm(() => {
555570
555909
  init_telegramConfig();
555571
555910
  init_telegramApi();
@@ -557026,7 +557365,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
557026
557365
  }
557027
557366
  return [];
557028
557367
  }
557029
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.479") {
557368
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.481") {
557030
557369
  if (false) {}
557031
557370
  const cachedChangelog = await getStoredChangelog();
557032
557371
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -557039,7 +557378,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.479")
557039
557378
  releaseNotes
557040
557379
  };
557041
557380
  }
557042
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.479") {
557381
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.481") {
557043
557382
  if (false) {}
557044
557383
  const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
557045
557384
  return {
@@ -557167,7 +557506,7 @@ function getRecentActivitySync() {
557167
557506
  return cachedActivity;
557168
557507
  }
557169
557508
  function getLogoDisplayData() {
557170
- const version2 = process.env.DEMO_VERSION ?? "1.4.479";
557509
+ const version2 = process.env.DEMO_VERSION ?? "1.4.481";
557171
557510
  const serverUrl = getDirectConnectServerUrl();
557172
557511
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
557173
557512
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -558332,7 +558671,7 @@ function LogoV2() {
558332
558671
  if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
558333
558672
  t2 = () => {
558334
558673
  const currentConfig = getGlobalConfig();
558335
- if (currentConfig.lastReleaseNotesSeen === "1.4.479") {
558674
+ if (currentConfig.lastReleaseNotesSeen === "1.4.481") {
558336
558675
  return;
558337
558676
  }
558338
558677
  saveGlobalConfig(_temp327);
@@ -558811,7 +559150,7 @@ function LogoV2() {
558811
559150
  t24 = $3[61];
558812
559151
  }
558813
559152
  const _latestNpm = getCachedLatestNpmVersionSync();
558814
- const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.479") ? [createUpdateAvailableFeed("1.4.479", _latestNpm)] : [];
559153
+ const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.481") ? [createUpdateAvailableFeed("1.4.481", _latestNpm)] : [];
558815
559154
  const t25 = layoutMode === "horizontal" && /* @__PURE__ */ jsx_runtime236.jsx(FeedColumn, {
558816
559155
  feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), ..._updateFeeds, createWhatsNewFeed(changelog)],
558817
559156
  maxWidth: rightWidth
@@ -559011,12 +559350,12 @@ function LogoV2() {
559011
559350
  return t41;
559012
559351
  }
559013
559352
  function _temp327(current) {
559014
- if (current.lastReleaseNotesSeen === "1.4.479") {
559353
+ if (current.lastReleaseNotesSeen === "1.4.481") {
559015
559354
  return current;
559016
559355
  }
559017
559356
  return {
559018
559357
  ...current,
559019
- lastReleaseNotesSeen: "1.4.479"
559358
+ lastReleaseNotesSeen: "1.4.481"
559020
559359
  };
559021
559360
  }
559022
559361
  function _temp241(s_0) {
@@ -584015,7 +584354,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
584015
584354
  smapsRollup,
584016
584355
  platform: process.platform,
584017
584356
  nodeVersion: process.version,
584018
- ccVersion: "1.4.479"
584357
+ ccVersion: "1.4.481"
584019
584358
  };
584020
584359
  }
584021
584360
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -584537,7 +584876,7 @@ var init_bridge_kick = __esm(() => {
584537
584876
  var call50 = async () => {
584538
584877
  return {
584539
584878
  type: "text",
584540
- value: "1.4.479"
584879
+ value: "1.4.481"
584541
584880
  };
584542
584881
  }, version2, version_default;
584543
584882
  var init_version = __esm(() => {
@@ -595033,7 +595372,7 @@ function generateHtmlReport(data, insights) {
595033
595372
  </html>`;
595034
595373
  }
595035
595374
  function buildExportData(data, insights, facets, remoteStats) {
595036
- const version3 = typeof MACRO !== "undefined" ? "1.4.479" : "unknown";
595375
+ const version3 = typeof MACRO !== "undefined" ? "1.4.481" : "unknown";
595037
595376
  const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
595038
595377
  const facets_summary = {
595039
595378
  total: facets.size,
@@ -598947,7 +599286,7 @@ var init_sessionStorage = __esm(() => {
598947
599286
  init_settings2();
598948
599287
  init_slowOperations();
598949
599288
  init_uuid();
598950
- VERSION6 = typeof MACRO !== "undefined" ? "1.4.479" : "unknown";
599289
+ VERSION6 = typeof MACRO !== "undefined" ? "1.4.481" : "unknown";
598951
599290
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
598952
599291
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
598953
599292
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -600165,7 +600504,7 @@ var init_filesystem = __esm(() => {
600165
600504
  });
600166
600505
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
600167
600506
  const nonce = randomBytes19(16).toString("hex");
600168
- return join153(getClaudeTempDir(), "bundled-skills", "1.4.479", nonce);
600507
+ return join153(getClaudeTempDir(), "bundled-skills", "1.4.481", nonce);
600169
600508
  });
600170
600509
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
600171
600510
  });
@@ -605273,8 +605612,10 @@ var init_worktree = __esm(() => {
605273
605612
  });
605274
605613
 
605275
605614
  // src/utils/npmExec.ts
605276
- import { execFileSync as execFileSync3 } from "node:child_process";
605277
- import { homedir as homedir35 } from "os";
605615
+ import { spawn as spawn13, execFileSync as execFileSync3 } from "node:child_process";
605616
+ import { writeFileSync as writeFileSync18 } from "node:fs";
605617
+ import { homedir as homedir35, tmpdir as tmpdir16 } from "os";
605618
+ import { join as join156 } from "path";
605278
605619
  function execNpmSync(npmArgs, options) {
605279
605620
  if (IS_WINDOWS2) {
605280
605621
  for (const a2 of npmArgs) {
@@ -605298,6 +605639,16 @@ function execNpmSync(npmArgs, options) {
605298
605639
  stdio: options.stdio
605299
605640
  });
605300
605641
  }
605642
+ function stderrOf(err2) {
605643
+ if (!(err2 instanceof Error))
605644
+ return "";
605645
+ const anyErr = err2;
605646
+ if (typeof anyErr.stderr === "string")
605647
+ return anyErr.stderr;
605648
+ if (Buffer.isBuffer(anyErr.stderr))
605649
+ return anyErr.stderr.toString("utf8");
605650
+ return "";
605651
+ }
605301
605652
  function describeNpmError(err2) {
605302
605653
  if (!(err2 instanceof Error))
605303
605654
  return String(err2);
@@ -605305,8 +605656,7 @@ function describeNpmError(err2) {
605305
605656
  const parts = [];
605306
605657
  if (anyErr.code)
605307
605658
  parts.push(`code: ${anyErr.code}`);
605308
- const stderrText = typeof anyErr.stderr === "string" ? anyErr.stderr : Buffer.isBuffer(anyErr.stderr) ? anyErr.stderr.toString("utf8") : "";
605309
- const trimmedStderr = stderrText.trim();
605659
+ const trimmedStderr = stderrOf(err2).trim();
605310
605660
  if (trimmedStderr) {
605311
605661
  parts.push(trimmedStderr);
605312
605662
  } else if (err2.message) {
@@ -605321,9 +605671,96 @@ function isLikelyEacces(err2) {
605321
605671
  const anyErr = err2;
605322
605672
  if (anyErr.code === "EACCES" || anyErr.code === "EPERM")
605323
605673
  return true;
605324
- const stderrText = typeof anyErr.stderr === "string" ? anyErr.stderr : Buffer.isBuffer(anyErr.stderr) ? anyErr.stderr.toString("utf8") : "";
605674
+ const stderrText = stderrOf(err2);
605325
605675
  return /EACCES|permission denied/i.test(stderrText) || /EACCES|permission denied/i.test(err2.message);
605326
605676
  }
605677
+ function isLikelyWindowsFileLock(err2) {
605678
+ if (!(err2 instanceof Error))
605679
+ return false;
605680
+ const code = err2.code;
605681
+ if (code === "EBUSY" || code === "ETXTBSY")
605682
+ return true;
605683
+ const haystack = `${stderrOf(err2)}
605684
+ ${err2.message}`;
605685
+ return /\bEBUSY\b|\bETXTBSY\b/i.test(haystack) || /\bEPERM\b/i.test(haystack) || /operation not permitted/i.test(haystack) || /being used by another process/i.test(haystack) || /cannot access the file/i.test(haystack) || /resource busy or locked/i.test(haystack);
605686
+ }
605687
+ function buildNpmRemediation(action2, packageSpec, err2, platform4 = process.platform) {
605688
+ const isWin = platform4 === "win32";
605689
+ const cmd = `npm ${action2} -g ${packageSpec}`;
605690
+ const lines2 = ["", "Try manually:", ` ${cmd}`];
605691
+ if (isWin) {
605692
+ if (isLikelyWindowsFileLock(err2)) {
605693
+ lines2.push("", "Windows could not replace the Rayu files because they are still in", 'use. This happens when npm rewrites the "rayu" launcher while the', "terminal that started it (cmd.exe in particular) still holds it open.", "", "Fix it by running the command from a shell that is NOT running Rayu:", " 1. Close every terminal that has Rayu running", " 2. Open a new PowerShell or Command Prompt", ` 3. Run: ${cmd}`, "", "If it still fails, an antivirus or a stray rayu.exe/node.exe may be", "holding the file. Check with:", " tasklist | findstr /i rayu");
605694
+ } else {
605695
+ lines2.push("", "If npm could not write to its global folder, run the command from an", "elevated (Administrator) terminal, or move npm's global prefix", "somewhere you own:", " npm config set prefix %LOCALAPPDATA%\\npm-global", ' setx PATH "%LOCALAPPDATA%\\npm-global;%PATH%"', " (then open a NEW terminal so the PATH change is picked up)");
605696
+ }
605697
+ return lines2.join(`
605698
+ `);
605699
+ }
605700
+ if (isLikelyEacces(err2)) {
605701
+ lines2.push("", "This looks like a permissions error on npm's global install", "directory. If Node was installed via nvm, Homebrew, Volta, or fnm,", "do NOT use sudo — it installs into a root-owned path that will", "conflict with your user-owned Node version. Instead fix npm's", "global prefix, e.g.:", " mkdir -p ~/.npm-global", " npm config set prefix ~/.npm-global", " export PATH=~/.npm-global/bin:$PATH # add to your shell rc file", "Only use sudo if Node was installed system-wide (e.g. via apt/yum", "or the nodejs.org installer):", ` sudo ${cmd}`);
605702
+ } else {
605703
+ lines2.push("", "Or with sudo if you have permission issues:", ` sudo ${cmd}`);
605704
+ }
605705
+ return lines2.join(`
605706
+ `);
605707
+ }
605708
+ function buildWindowsDeferredInstallScript(packageSpec, pid) {
605709
+ if (!Number.isInteger(pid) || pid <= 0) {
605710
+ throw new Error(`buildWindowsDeferredInstallScript: invalid pid ${pid}`);
605711
+ }
605712
+ if (packageSpec.includes('"')) {
605713
+ throw new Error(`buildWindowsDeferredInstallScript: refusing to quote a spec containing a double quote: ${JSON.stringify(packageSpec)}`);
605714
+ }
605715
+ return [
605716
+ "@echo off",
605717
+ "title Rayu update",
605718
+ "echo Waiting for Rayu to exit...",
605719
+ "set /a _tries=0",
605720
+ ":wait",
605721
+ `tasklist /FI "PID eq ${pid}" /NH 2>nul | find "${pid}" >nul`,
605722
+ "if errorlevel 1 goto run",
605723
+ "set /a _tries+=1",
605724
+ "if %_tries% GEQ 60 goto run",
605725
+ "timeout /t 1 /nobreak >nul 2>&1 || ping -n 2 127.0.0.1 >nul",
605726
+ "goto wait",
605727
+ ":run",
605728
+ "echo Installing Rayu CLI...",
605729
+ "echo.",
605730
+ `call npm install -g "${packageSpec}"`,
605731
+ "if errorlevel 1 (",
605732
+ " echo.",
605733
+ " echo Update FAILED. Close all Rayu windows and run this in a new terminal:",
605734
+ ` echo npm install -g ${packageSpec}`,
605735
+ " echo If npm cannot write to its global folder, run that terminal as Administrator.",
605736
+ ") else (",
605737
+ " echo.",
605738
+ " echo Rayu CLI updated successfully.",
605739
+ ")",
605740
+ "echo.",
605741
+ "echo Press any key to close this window.",
605742
+ "pause >nul",
605743
+ ""
605744
+ ].join(`\r
605745
+ `);
605746
+ }
605747
+ function scheduleWindowsDeferredInstall(packageSpec) {
605748
+ if (!IS_WINDOWS2)
605749
+ return false;
605750
+ try {
605751
+ const scriptPath = join156(tmpdir16(), `rayu-update-${process.pid}.cmd`);
605752
+ writeFileSync18(scriptPath, buildWindowsDeferredInstallScript(packageSpec, process.pid), "utf8");
605753
+ const child = spawn13("cmd.exe", ["/d", "/s", "/c", "start", "", scriptPath], {
605754
+ detached: true,
605755
+ stdio: "ignore",
605756
+ windowsHide: false
605757
+ });
605758
+ child.unref();
605759
+ return true;
605760
+ } catch {
605761
+ return false;
605762
+ }
605763
+ }
605327
605764
  var IS_WINDOWS2;
605328
605765
  var init_npmExec = __esm(() => {
605329
605766
  IS_WINDOWS2 = process.platform === "win32";
@@ -605335,7 +605772,7 @@ __export(exports_update, {
605335
605772
  update: () => update
605336
605773
  });
605337
605774
  async function update() {
605338
- writeToStdout(`Current version: ${"1.4.479"}
605775
+ writeToStdout(`Current version: ${"1.4.481"}
605339
605776
  `);
605340
605777
  const isBundled = isInBundledMode();
605341
605778
  if (isBundled) {
@@ -605366,13 +605803,13 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
605366
605803
  process.exit(1);
605367
605804
  return;
605368
605805
  }
605369
- if (latestVersion === "1.4.479") {
605806
+ if (latestVersion === "1.4.481") {
605370
605807
  writeToStdout(source_default.green(`
605371
- Rayu CLI is up to date (${"1.4.479"})
605808
+ Rayu CLI is up to date (${"1.4.481"})
605372
605809
  `));
605373
605810
  process.exit(0);
605374
605811
  }
605375
- writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.479"})
605812
+ writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.481"})
605376
605813
  `);
605377
605814
  writeToStdout(`Installing update...
605378
605815
 
@@ -605387,31 +605824,21 @@ Failed to install update
605387
605824
  if (detail)
605388
605825
  process.stderr.write(`${detail}
605389
605826
  `);
605390
- process.stderr.write(`
605391
- Try manually:
605392
- `);
605393
- process.stderr.write(source_default.bold(` npm install -g ${"@rayu-dev/rayu-cli"}@latest
605827
+ if (IS_WINDOWS2 && isLikelyWindowsFileLock(err2)) {
605828
+ const spec = `${"@rayu-dev/rayu-cli"}@latest`;
605829
+ if (scheduleWindowsDeferredInstall(spec)) {
605830
+ process.stderr.write(source_default.yellow(`
605831
+ Rayu could not replace its own files while it is running.
605394
605832
  `));
605395
- if (isLikelyEacces(err2)) {
605396
- process.stderr.write(`
605397
- This looks like a permissions error on npm's global install
605398
- ` + `directory. If Node was installed via nvm, Homebrew, Volta, or fnm,
605399
- ` + `do NOT use sudo — it installs into a root-owned path that will
605400
- ` + `conflict with your user-owned Node version. Instead fix npm's
605401
- ` + `global prefix, e.g.:
605402
- ` + ` mkdir -p ~/.npm-global
605403
- ` + ` npm config set prefix ~/.npm-global
605404
- ` + ` export PATH=~/.npm-global/bin:$PATH # add to your shell rc file
605405
- ` + `Only use sudo if Node was installed system-wide (e.g. via apt/yum
605406
- ` + `or the nodejs.org installer):
605407
- ` + ` sudo npm install -g ${"@rayu-dev/rayu-cli"}@latest
605408
- `);
605409
- } else {
605410
- process.stderr.write(`Or with sudo if you have permission issues:
605833
+ writeToStdout(`A new window has opened to finish the update as soon as Rayu exits.
605834
+ ` + `Leave it open until it reports success, then reopen your terminal.
605411
605835
  `);
605412
- process.stderr.write(source_default.bold(` sudo npm install -g ${"@rayu-dev/rayu-cli"}@latest
605413
- `));
605836
+ process.exit(1);
605837
+ return;
605838
+ }
605414
605839
  }
605840
+ process.stderr.write(`${buildNpmRemediation("install", `${"@rayu-dev/rayu-cli"}@latest`, err2)}
605841
+ `);
605415
605842
  process.exit(1);
605416
605843
  return;
605417
605844
  }
@@ -605439,14 +605866,14 @@ async function updateNativeBinary() {
605439
605866
  } catch {
605440
605867
  latestVersion = "";
605441
605868
  }
605442
- if (latestVersion && latestVersion === "1.4.479") {
605869
+ if (latestVersion && latestVersion === "1.4.481") {
605443
605870
  writeToStdout(source_default.green(`
605444
- Rayu CLI is up to date (1.4.479)
605871
+ Rayu CLI is up to date (1.4.481)
605445
605872
  `));
605446
605873
  process.exit(0);
605447
605874
  }
605448
605875
  if (latestVersion) {
605449
- writeToStdout(`New version available: ${latestVersion} (current: 1.4.479)
605876
+ writeToStdout(`New version available: ${latestVersion} (current: 1.4.481)
605450
605877
  `);
605451
605878
  }
605452
605879
  writeToStdout(`Downloading and installing update...
@@ -605461,13 +605888,13 @@ Rayu CLI is up to date (1.4.479)
605461
605888
  return;
605462
605889
  }
605463
605890
  writeToStdout(source_default.green(`
605464
- Rayu CLI is up to date (1.4.479)
605891
+ Rayu CLI is up to date (1.4.481)
605465
605892
  `));
605466
605893
  process.exit(0);
605467
605894
  }
605468
605895
  const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
605469
605896
  writeToStdout(source_default.green(`
605470
- Successfully updated from 1.4.479 to ${updatedTo}
605897
+ Successfully updated from 1.4.481 to ${updatedTo}
605471
605898
  `));
605472
605899
  writeToStdout(`Restart your terminal to use the new version.
605473
605900
  `);
@@ -605532,7 +605959,7 @@ async function removeDataDir(dir) {
605532
605959
  async function uninstall(args = []) {
605533
605960
  const yes = args.includes("--yes") || args.includes("-y");
605534
605961
  const keepData = args.includes("--keep-data");
605535
- writeToStdout(`Uninstalling Rayu CLI (${"1.4.479"})...
605962
+ writeToStdout(`Uninstalling Rayu CLI (${"1.4.481"})...
605536
605963
  `);
605537
605964
  writeToStdout(`Running: npm uninstall -g ${"@rayu-dev/rayu-cli"}
605538
605965
 
@@ -605543,30 +605970,17 @@ async function uninstall(args = []) {
605543
605970
  process.stderr.write(source_default.red(`
605544
605971
  Failed to uninstall ${"@rayu-dev/rayu-cli"}
605545
605972
  `));
605546
- process.stderr.write(`
605547
- Try running manually:
605548
- `);
605549
- process.stderr.write(source_default.bold(` npm uninstall -g ${"@rayu-dev/rayu-cli"}
605550
- `));
605551
- if (isLikelyEacces(err2)) {
605552
- process.stderr.write(`
605553
- This looks like a permissions error on npm's global install
605554
- ` + `directory. If Node was installed via nvm, Homebrew, Volta, or fnm,
605555
- ` + `do NOT use sudo. Only use sudo if Node was installed system-wide
605556
- ` + `(e.g. via apt/yum or the nodejs.org installer):
605557
- ` + ` sudo npm uninstall -g ${"@rayu-dev/rayu-cli"}
605973
+ const detail = describeNpmError(err2);
605974
+ if (detail)
605975
+ process.stderr.write(`${detail}
605558
605976
  `);
605559
- } else {
605560
- process.stderr.write(`Or with sudo if you installed with elevated permissions:
605977
+ process.stderr.write(`${buildNpmRemediation("uninstall", "@rayu-dev/rayu-cli", err2)}
605561
605978
  `);
605562
- process.stderr.write(source_default.bold(` sudo npm uninstall -g ${"@rayu-dev/rayu-cli"}
605563
- `));
605564
- }
605565
605979
  process.exit(1);
605566
605980
  return;
605567
605981
  }
605568
605982
  writeToStdout(source_default.green(`
605569
- Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.479"}
605983
+ Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.481"}
605570
605984
  `));
605571
605985
  const configDir = getRayuConfigHomeDir();
605572
605986
  const dataExists = existsSync28(configDir);
@@ -605612,10 +606026,10 @@ var exports_firstRun = {};
605612
606026
  __export(exports_firstRun, {
605613
606027
  showFirstRunWelcome: () => showFirstRunWelcome
605614
606028
  });
605615
- import { existsSync as existsSync29, mkdirSync as mkdirSync16, writeFileSync as writeFileSync18 } from "node:fs";
605616
- import { join as join156 } from "node:path";
606029
+ import { existsSync as existsSync29, mkdirSync as mkdirSync16, writeFileSync as writeFileSync19 } from "node:fs";
606030
+ import { join as join157 } from "node:path";
605617
606031
  function markerPath() {
605618
- return join156(getRayuConfigHomeDir(), ".installed");
606032
+ return join157(getRayuConfigHomeDir(), ".installed");
605619
606033
  }
605620
606034
  function showFirstRunWelcome() {
605621
606035
  try {
@@ -605649,7 +606063,7 @@ function showFirstRunWelcome() {
605649
606063
  `);
605650
606064
  try {
605651
606065
  mkdirSync16(getRayuConfigHomeDir(), { recursive: true });
605652
- writeFileSync18(markerPath(), "1.4.479", "utf8");
606066
+ writeFileSync19(markerPath(), "1.4.481", "utf8");
605653
606067
  } catch {}
605654
606068
  }
605655
606069
  var init_firstRun = __esm(() => {
@@ -621835,7 +622249,7 @@ async function initializeBetaTracing(resource) {
621835
622249
  });
621836
622250
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
621837
622251
  setLoggerProvider(loggerProvider);
621838
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.479");
622252
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.481");
621839
622253
  setEventLogger(eventLogger);
621840
622254
  process.on("beforeExit", async () => {
621841
622255
  await loggerProvider?.forceFlush();
@@ -621875,7 +622289,7 @@ async function initializeTelemetry() {
621875
622289
  const platform4 = getPlatform();
621876
622290
  const baseAttributes = {
621877
622291
  [import_semantic_conventions.ATTR_SERVICE_NAME]: "claude-code",
621878
- [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.479"
622292
+ [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.481"
621879
622293
  };
621880
622294
  if (platform4 === "wsl") {
621881
622295
  const wslVersion = getWslVersion();
@@ -621920,7 +622334,7 @@ async function initializeTelemetry() {
621920
622334
  } catch {}
621921
622335
  };
621922
622336
  registerCleanup(shutdownTelemetry2);
621923
- return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.479");
622337
+ return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.481");
621924
622338
  }
621925
622339
  const meterProvider = new import_sdk_metrics2.MeterProvider({
621926
622340
  resource,
@@ -621940,7 +622354,7 @@ async function initializeTelemetry() {
621940
622354
  });
621941
622355
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
621942
622356
  setLoggerProvider(loggerProvider);
621943
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.479");
622357
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.481");
621944
622358
  setEventLogger(eventLogger);
621945
622359
  logForDebugging("[3P telemetry] Event logger set successfully");
621946
622360
  process.on("beforeExit", async () => {
@@ -622002,7 +622416,7 @@ Current timeout: ${timeoutMs}ms
622002
622416
  }
622003
622417
  };
622004
622418
  registerCleanup(shutdownTelemetry);
622005
- return meterProvider.getMeter("com.anthropic.claude_code", "1.4.479");
622419
+ return meterProvider.getMeter("com.anthropic.claude_code", "1.4.481");
622006
622420
  }
622007
622421
  async function flushTelemetry() {
622008
622422
  const meterProvider = getMeterProvider();
@@ -623012,7 +623426,7 @@ var init_notifier = __esm(() => {
623012
623426
  });
623013
623427
 
623014
623428
  // src/services/preventSleep.ts
623015
- import { spawn as spawn13 } from "child_process";
623429
+ import { spawn as spawn14 } from "child_process";
623016
623430
  function startPreventSleep() {
623017
623431
  refCount++;
623018
623432
  if (refCount === 1) {
@@ -623070,7 +623484,7 @@ function spawnCaffeinate() {
623070
623484
  });
623071
623485
  }
623072
623486
  try {
623073
- caffeinateProcess = spawn13("caffeinate", ["-i", "-t", String(CAFFEINATE_TIMEOUT_SECONDS)], {
623487
+ caffeinateProcess = spawn14("caffeinate", ["-i", "-t", String(CAFFEINATE_TIMEOUT_SECONDS)], {
623074
623488
  stdio: "ignore"
623075
623489
  });
623076
623490
  caffeinateProcess.unref();
@@ -623504,7 +623918,7 @@ function buildSystemInitMessage(inputs) {
623504
623918
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
623505
623919
  apiKeySource: getAnthropicApiKeyWithSource().source,
623506
623920
  betas: getSdkBetas(),
623507
- claude_code_version: "1.4.479",
623921
+ claude_code_version: "1.4.481",
623508
623922
  output_style: outputStyle2,
623509
623923
  agents: inputs.agents.map((agent) => agent.agentType),
623510
623924
  skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
@@ -624383,17 +624797,44 @@ var init_streamingMirror = __esm(() => {
624383
624797
 
624384
624798
  // src/telegram/telegramBridge.ts
624385
624799
  import { hostname as hostname3 } from "os";
624386
- import { closeSync as closeSync5, existsSync as existsSync30, openSync as openSync6, readFileSync as readFileSync30, unlinkSync as unlinkSync4, writeFileSync as writeFileSync19, writeSync as writeSync3 } from "fs";
624387
- import { join as join157 } from "path";
624800
+ import { closeSync as closeSync5, existsSync as existsSync30, openSync as openSync6, readFileSync as readFileSync30, unlinkSync as unlinkSync4, writeFileSync as writeFileSync20, writeSync as writeSync3 } from "fs";
624801
+ import { join as join158 } from "path";
624388
624802
  function linkedChatId() {
624389
624803
  return readTelegramConfig().linkedChatId;
624390
624804
  }
624391
624805
  function parseCommand3(text2) {
624392
624806
  const trimmed = text2.trim();
624393
624807
  const space = trimmed.indexOf(" ");
624394
- if (space === -1)
624395
- return { cmd: trimmed, arg: "" };
624396
- return { cmd: trimmed.slice(0, space), arg: trimmed.slice(space + 1).trim() };
624808
+ const rawCmd = space === -1 ? trimmed : trimmed.slice(0, space);
624809
+ const arg = space === -1 ? "" : trimmed.slice(space + 1).trim();
624810
+ const cmd = rawCmd.startsWith("/") ? rawCmd.split("@")[0] ?? rawCmd : rawCmd;
624811
+ return { cmd, arg };
624812
+ }
624813
+ function toTelegramCommandName(name) {
624814
+ return name.replace(/-/g, "_").replace(/[^a-z0-9_]/gi, "").toLowerCase().slice(0, 32);
624815
+ }
624816
+ function buildTelegramCommandAliases(names) {
624817
+ const aliases = new Map;
624818
+ for (const name of names) {
624819
+ const safe = toTelegramCommandName(name);
624820
+ if (safe && safe !== name && !aliases.has(safe))
624821
+ aliases.set(safe, name);
624822
+ }
624823
+ return aliases;
624824
+ }
624825
+ function loadCommandAliases() {
624826
+ if (!commandAliasesPromise) {
624827
+ commandAliasesPromise = (async () => {
624828
+ try {
624829
+ const { getCommands: getCommands2 } = await Promise.resolve().then(() => (init_commands2(), exports_commands));
624830
+ const { getCwd: getCwd4 } = await Promise.resolve().then(() => (init_cwd(), exports_cwd));
624831
+ return buildTelegramCommandAliases((await getCommands2(getCwd4())).map((c4) => c4.name));
624832
+ } catch {
624833
+ return new Map;
624834
+ }
624835
+ })();
624836
+ }
624837
+ return commandAliasesPromise;
624397
624838
  }
624398
624839
  function extractImages(message) {
624399
624840
  const content = message.message?.content;
@@ -624542,7 +624983,7 @@ async function handleUpdate(update2, options) {
624542
624983
  Send any message to drive the CLI. Use /disconnect to unlink.
624543
624984
 
624544
624985
  Tip: Use /connect to set up your AI provider.`);
624545
- } else {
624986
+ } else if (chatId === linkedChatId()) {} else {
624546
624987
  await sendMessage3(options.token, chatId, "❌ Invalid or expired token.");
624547
624988
  }
624548
624989
  return;
@@ -624576,14 +625017,15 @@ Tip: Use /connect to set up your AI provider.`);
624576
625017
  return;
624577
625018
  }
624578
625019
  if (text2.startsWith("/")) {
624579
- const cmdName = cmd.slice(1);
625020
+ const typed = cmd.slice(1).toLowerCase();
625021
+ const cmdName = (await loadCommandAliases()).get(typed) ?? typed;
624580
625022
  if (TELEGRAM_BLOCKED_COMMANDS.has(cmdName)) {
624581
- await sendMessage3(options.token, chatId, `⚠️ \`${cmd}\` requires the terminal UI and cannot be used from Telegram.
625023
+ await sendMessage3(options.token, chatId, `⚠️ \`/${cmdName}\` requires the terminal UI and cannot be used from Telegram.
624582
625024
 
624583
625025
  Please run it directly in rayu-cli.`);
624584
625026
  return;
624585
625027
  }
624586
- enqueue({ value: text2, mode: "prompt" });
625028
+ enqueue({ value: arg ? `/${cmdName} ${arg}` : `/${cmdName}`, mode: "prompt" });
624587
625029
  return;
624588
625030
  }
624589
625031
  enqueue({ value: text2, mode: "prompt" });
@@ -624600,7 +625042,7 @@ async function registerCommandsWithTelegram(token) {
624600
625042
  { command: "disconnect", description: "Unlink this Telegram chat from the CLI" }
624601
625043
  ];
624602
625044
  const fromCli = allCommands.filter((cmd) => !cmd.isHidden).map((cmd) => ({
624603
- command: cmd.name.replace(/-/g, "_").replace(/[^a-z0-9_]/gi, "").toLowerCase().slice(0, 32),
625045
+ command: toTelegramCommandName(cmd.name),
624604
625046
  description: (cmd.description || cmd.name).slice(0, 256)
624605
625047
  })).filter((c4) => c4.command.length >= 1);
624606
625048
  const builtinNames = new Set(builtins.map((b3) => b3.command));
@@ -624612,7 +625054,7 @@ async function registerCommandsWithTelegram(token) {
624612
625054
  } catch {}
624613
625055
  }
624614
625056
  function lockFilePath() {
624615
- return join157(getRayuConfigHomeDir(), "telegram-bridge.lock");
625057
+ return join158(getRayuConfigHomeDir(), "telegram-bridge.lock");
624616
625058
  }
624617
625059
  function isPidAlive(pid) {
624618
625060
  try {
@@ -624673,7 +625115,7 @@ function acquireBridgeLock() {
624673
625115
  return false;
624674
625116
  }
624675
625117
  }
624676
- writeFileSync19(path27, content, { mode: 384 });
625118
+ writeFileSync20(path27, content, { mode: 384 });
624677
625119
  } catch {}
624678
625120
  return true;
624679
625121
  }
@@ -624685,7 +625127,7 @@ function updateHeartbeat() {
624685
625127
  const raw = readFileSync30(path27, "utf8").trim();
624686
625128
  const pid = parseInt(raw.split(":")[0] ?? "", 10);
624687
625129
  if (pid === process.pid) {
624688
- writeFileSync19(path27, buildLockContent(), { mode: 384 });
625130
+ writeFileSync20(path27, buildLockContent(), { mode: 384 });
624689
625131
  }
624690
625132
  } catch {}
624691
625133
  }
@@ -624745,6 +625187,7 @@ function initTelegramBridge(options) {
624745
625187
  sendChatAction: (chatId, action2) => sendChatAction(options.token, chatId, action2 ?? "typing")
624746
625188
  };
624747
625189
  registerCommandsWithTelegram(options.token);
625190
+ loadCommandAliases();
624748
625191
  const poll = async () => {
624749
625192
  while (running) {
624750
625193
  const updates = await getUpdates(options.token, offset);
@@ -624847,7 +625290,7 @@ function initTelegramBridge(options) {
624847
625290
  }
624848
625291
  };
624849
625292
  }
624850
- var TELEGRAM_BLOCKED_COMMANDS, HEARTBEAT_INTERVAL_MS2 = 1e4, HEARTBEAT_STALE_MS = 30000, _exitListenerRegistered = false;
625293
+ var commandAliasesPromise = null, TELEGRAM_BLOCKED_COMMANDS, HEARTBEAT_INTERVAL_MS2 = 1e4, HEARTBEAT_STALE_MS = 30000, _exitListenerRegistered = false;
624851
625294
  var init_telegramBridge = __esm(() => {
624852
625295
  init_envUtils();
624853
625296
  init_formatActivity();
@@ -624963,29 +625406,36 @@ function useTelegramBridge(messages) {
624963
625406
  const inTurnRef = import_react187.useRef(false);
624964
625407
  const setAppState = useSetAppState();
624965
625408
  const bridgeActive = useAppState((s2) => s2.telegramBridgeActive);
625409
+ const transportKey = useAppState((s2) => s2.telegramTransportKey);
624966
625410
  import_react187.useEffect(() => {
624967
625411
  if (!bridgeActive)
624968
625412
  return;
624969
625413
  const mode = getTelegramMode();
624970
625414
  let token;
624971
625415
  if (mode === "hosted") {
624972
- if (!hasRayuSession())
625416
+ if (!hasRayuSession()) {
625417
+ setAppState((prev) => ({ ...prev, telegramBridgeActive: false }));
624973
625418
  return;
625419
+ }
624974
625420
  setHostedRouter(createHostedRouter());
624975
625421
  token = "hosted";
624976
625422
  } else {
624977
625423
  const byo = getBotToken();
624978
- if (!byo)
625424
+ if (!byo) {
625425
+ setAppState((prev) => ({ ...prev, telegramBridgeActive: false }));
624979
625426
  return;
625427
+ }
624980
625428
  setHostedRouter(null);
624981
625429
  token = byo;
624982
625430
  }
624983
625431
  const handle = initTelegramBridge({ token });
624984
625432
  handleRef.current = handle;
624985
625433
  setAppState((prev) => ({ ...prev, telegramPermissionCallbacks: handle.permissionCallbacks }));
625434
+ const builtTransport = telegramTransportKey();
624986
625435
  return () => {
624987
625436
  handle.endTurn();
624988
625437
  const chatId = readTelegramConfig().linkedChatId;
625438
+ const isHandoff = telegramTransportKey() !== builtTransport;
624989
625439
  const notice = chatId !== undefined ? sendMessage3(token, chatId, "\uD83D\uDD0C Session closed — rayu-cli disconnected.").catch(() => {}) : Promise.resolve();
624990
625440
  handle.stop();
624991
625441
  notice.finally(() => setHostedRouter(null));
@@ -624995,10 +625445,10 @@ function useTelegramBridge(messages) {
624995
625445
  setAppState((prev) => ({
624996
625446
  ...prev,
624997
625447
  telegramPermissionCallbacks: undefined,
624998
- telegramBridgeActive: false
625448
+ ...isHandoff ? {} : { telegramBridgeActive: false }
624999
625449
  }));
625000
625450
  };
625001
- }, [bridgeActive, setAppState]);
625451
+ }, [bridgeActive, transportKey, setAppState]);
625002
625452
  import_react187.useEffect(() => {
625003
625453
  const handle = handleRef.current;
625004
625454
  if (!handle || handle.isNoOp)
@@ -631271,7 +631721,7 @@ var init_ShowInIDEPrompt = __esm(() => {
631271
631721
 
631272
631722
  // src/components/permissions/FilePermissionDialog/permissionOptions.tsx
631273
631723
  import { homedir as homedir36 } from "os";
631274
- import { basename as basename52, join as join158, sep as sep40 } from "path";
631724
+ import { basename as basename52, join as join159, sep as sep40 } from "path";
631275
631725
  function isInRayuFolder(filePath) {
631276
631726
  const absolutePath = expandPath(filePath);
631277
631727
  const rayuFolderPath = expandPath(`${getOriginalCwd()}/.rayu`);
@@ -631281,7 +631731,7 @@ function isInRayuFolder(filePath) {
631281
631731
  }
631282
631732
  function isInGlobalRayuFolder(filePath) {
631283
631733
  const absolutePath = expandPath(filePath);
631284
- const globalRayuFolderPath = join158(homedir36(), ".rayu");
631734
+ const globalRayuFolderPath = join159(homedir36(), ".rayu");
631285
631735
  const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
631286
631736
  const normalizedGlobalRayuFolderPath = normalizeCaseForComparison2(globalRayuFolderPath);
631287
631737
  return normalizedAbsolutePath.startsWith(normalizedGlobalRayuFolderPath + sep40.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalRayuFolderPath + "/");
@@ -639878,7 +640328,7 @@ var init_useVoiceEnabled = __esm(() => {
639878
640328
  function getSemverPart(version3) {
639879
640329
  return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
639880
640330
  }
639881
- function useUpdateNotification(updatedVersion, initialVersion = "1.4.479") {
640331
+ function useUpdateNotification(updatedVersion, initialVersion = "1.4.481") {
639882
640332
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react217.useState(() => getSemverPart(initialVersion));
639883
640333
  if (!updatedVersion) {
639884
640334
  return null;
@@ -639918,7 +640368,7 @@ function AutoUpdater({
639918
640368
  return;
639919
640369
  }
639920
640370
  if (false) {}
639921
- const currentVersion = "1.4.479";
640371
+ const currentVersion = "1.4.481";
639922
640372
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
639923
640373
  let latestVersion = await getLatestVersion(channel2);
639924
640374
  const isDisabled = isAutoUpdaterDisabled();
@@ -640131,12 +640581,12 @@ function NativeAutoUpdater({
640131
640581
  logEvent("tengu_native_auto_updater_start", {});
640132
640582
  try {
640133
640583
  const maxVersion = await getMaxVersion();
640134
- if (maxVersion && gt("1.4.479", maxVersion)) {
640584
+ if (maxVersion && gt("1.4.481", maxVersion)) {
640135
640585
  const msg = await getMaxVersionMessage();
640136
640586
  setMaxVersionIssue(msg ?? "affects your version");
640137
640587
  }
640138
640588
  const result = await installLatest(channel2);
640139
- const currentVersion = "1.4.479";
640589
+ const currentVersion = "1.4.481";
640140
640590
  const latencyMs = Date.now() - startTime2;
640141
640591
  if (result.lockFailed) {
640142
640592
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -640273,17 +640723,17 @@ function PackageManagerAutoUpdater(t0) {
640273
640723
  const maxVersion = await getMaxVersion();
640274
640724
  if (maxVersion && latest && gt(latest, maxVersion)) {
640275
640725
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
640276
- if (gte("1.4.479", maxVersion)) {
640277
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.479"} is already at or above maxVersion ${maxVersion}, skipping update`);
640726
+ if (gte("1.4.481", maxVersion)) {
640727
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.481"} is already at or above maxVersion ${maxVersion}, skipping update`);
640278
640728
  setUpdateAvailable(false);
640279
640729
  return;
640280
640730
  }
640281
640731
  latest = maxVersion;
640282
640732
  }
640283
- const hasUpdate = latest && !gte("1.4.479", latest) && !shouldSkipVersion(latest);
640733
+ const hasUpdate = latest && !gte("1.4.481", latest) && !shouldSkipVersion(latest);
640284
640734
  setUpdateAvailable(!!hasUpdate);
640285
640735
  if (hasUpdate) {
640286
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.479"} -> ${latest}`);
640736
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.481"} -> ${latest}`);
640287
640737
  }
640288
640738
  };
640289
640739
  $3[0] = t1;
@@ -640317,7 +640767,7 @@ function PackageManagerAutoUpdater(t0) {
640317
640767
  wrap: "truncate",
640318
640768
  children: [
640319
640769
  "currentVersion: ",
640320
- "1.4.479"
640770
+ "1.4.481"
640321
640771
  ]
640322
640772
  });
640323
640773
  $3[3] = verbose;
@@ -648481,7 +648931,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
648481
648931
  project_dir: getOriginalCwd(),
648482
648932
  added_dirs: addedDirs
648483
648933
  },
648484
- version: "1.4.479",
648934
+ version: "1.4.481",
648485
648935
  output_style: {
648486
648936
  name: outputStyleName
648487
648937
  },
@@ -650660,7 +651110,7 @@ var init_user = __esm(() => {
650660
651110
  deviceId,
650661
651111
  sessionId: getSessionId(),
650662
651112
  email: getEmail(),
650663
- appVersion: "1.4.479",
651113
+ appVersion: "1.4.481",
650664
651114
  platform: getHostPlatformForAnalytics(),
650665
651115
  organizationUuid,
650666
651116
  accountUuid,
@@ -654697,9 +655147,9 @@ function initSkillImprovement() {
654697
655147
  async function applySkillImprovement(skillName, updates) {
654698
655148
  if (!skillName)
654699
655149
  return;
654700
- const { join: join159 } = await import("path");
655150
+ const { join: join160 } = await import("path");
654701
655151
  const fs15 = await import("fs/promises");
654702
- const filePath = join159(getCwd(), ".rayu", "skills", skillName, "SKILL.md");
655152
+ const filePath = join160(getCwd(), ".rayu", "skills", skillName, "SKILL.md");
654703
655153
  let currentContent;
654704
655154
  try {
654705
655155
  currentContent = await fs15.readFile(filePath, "utf-8");
@@ -654850,7 +655300,7 @@ function useMoreRight(_args) {
654850
655300
  }
654851
655301
 
654852
655302
  // src/utils/cleanup.ts
654853
- import { join as join159 } from "path";
655303
+ import { join as join160 } from "path";
654854
655304
  function getCutoffDate() {
654855
655305
  const settings = getSettings_DEPRECATED() || {};
654856
655306
  const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
@@ -654875,7 +655325,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
654875
655325
  try {
654876
655326
  const timestamp = convertFileNameToDate(file2.name);
654877
655327
  if (timestamp < cutoffDate) {
654878
- await getFsImplementation().unlink(join159(dirPath, file2.name));
655328
+ await getFsImplementation().unlink(join160(dirPath, file2.name));
654879
655329
  if (isMessagePath) {
654880
655330
  result.messages++;
654881
655331
  } else {
@@ -654906,7 +655356,7 @@ async function cleanupOldMessageFiles() {
654906
655356
  } catch {
654907
655357
  return result;
654908
655358
  }
654909
- const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join159(baseCachePath, dirent.name));
655359
+ const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join160(baseCachePath, dirent.name));
654910
655360
  for (const mcpLogDir of mcpLogDirs) {
654911
655361
  result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
654912
655362
  await tryRmdir(mcpLogDir, fsImpl);
@@ -654945,7 +655395,7 @@ async function cleanupOldSessionFiles() {
654945
655395
  for (const projectDirent of projectDirents) {
654946
655396
  if (!projectDirent.isDirectory())
654947
655397
  continue;
654948
- const projectDir = join159(projectsDir, projectDirent.name);
655398
+ const projectDir = join160(projectsDir, projectDirent.name);
654949
655399
  let entries;
654950
655400
  try {
654951
655401
  entries = await fsImpl.readdir(projectDir);
@@ -654959,15 +655409,15 @@ async function cleanupOldSessionFiles() {
654959
655409
  continue;
654960
655410
  }
654961
655411
  try {
654962
- if (await unlinkIfOld(join159(projectDir, entry.name), cutoffDate, fsImpl)) {
655412
+ if (await unlinkIfOld(join160(projectDir, entry.name), cutoffDate, fsImpl)) {
654963
655413
  result.messages++;
654964
655414
  }
654965
655415
  } catch {
654966
655416
  result.errors++;
654967
655417
  }
654968
655418
  } else if (entry.isDirectory()) {
654969
- const sessionDir = join159(projectDir, entry.name);
654970
- const toolResultsDir = join159(sessionDir, TOOL_RESULTS_SUBDIR);
655419
+ const sessionDir = join160(projectDir, entry.name);
655420
+ const toolResultsDir = join160(sessionDir, TOOL_RESULTS_SUBDIR);
654971
655421
  let toolDirs;
654972
655422
  try {
654973
655423
  toolDirs = await fsImpl.readdir(toolResultsDir);
@@ -654978,14 +655428,14 @@ async function cleanupOldSessionFiles() {
654978
655428
  for (const toolEntry of toolDirs) {
654979
655429
  if (toolEntry.isFile()) {
654980
655430
  try {
654981
- if (await unlinkIfOld(join159(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
655431
+ if (await unlinkIfOld(join160(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
654982
655432
  result.messages++;
654983
655433
  }
654984
655434
  } catch {
654985
655435
  result.errors++;
654986
655436
  }
654987
655437
  } else if (toolEntry.isDirectory()) {
654988
- const toolDirPath = join159(toolResultsDir, toolEntry.name);
655438
+ const toolDirPath = join160(toolResultsDir, toolEntry.name);
654989
655439
  let toolFiles;
654990
655440
  try {
654991
655441
  toolFiles = await fsImpl.readdir(toolDirPath);
@@ -654996,7 +655446,7 @@ async function cleanupOldSessionFiles() {
654996
655446
  if (!tf.isFile())
654997
655447
  continue;
654998
655448
  try {
654999
- if (await unlinkIfOld(join159(toolDirPath, tf.name), cutoffDate, fsImpl)) {
655449
+ if (await unlinkIfOld(join160(toolDirPath, tf.name), cutoffDate, fsImpl)) {
655000
655450
  result.messages++;
655001
655451
  }
655002
655452
  } catch {
@@ -655028,7 +655478,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
655028
655478
  if (!dirent.isFile() || !dirent.name.endsWith(extension2))
655029
655479
  continue;
655030
655480
  try {
655031
- if (await unlinkIfOld(join159(dirPath, dirent.name), cutoffDate, fsImpl)) {
655481
+ if (await unlinkIfOld(join160(dirPath, dirent.name), cutoffDate, fsImpl)) {
655032
655482
  result.messages++;
655033
655483
  }
655034
655484
  } catch {
@@ -655041,7 +655491,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
655041
655491
  return result;
655042
655492
  }
655043
655493
  function cleanupOldPlanFiles() {
655044
- const plansDir = join159(getRayuConfigHomeDir(), "plans");
655494
+ const plansDir = join160(getRayuConfigHomeDir(), "plans");
655045
655495
  return cleanupSingleDirectory(plansDir, ".md");
655046
655496
  }
655047
655497
  async function cleanupOldFileHistoryBackups() {
@@ -655050,14 +655500,14 @@ async function cleanupOldFileHistoryBackups() {
655050
655500
  const fsImpl = getFsImplementation();
655051
655501
  try {
655052
655502
  const configDir = getRayuConfigHomeDir();
655053
- const fileHistoryStorageDir = join159(configDir, "file-history");
655503
+ const fileHistoryStorageDir = join160(configDir, "file-history");
655054
655504
  let dirents;
655055
655505
  try {
655056
655506
  dirents = await fsImpl.readdir(fileHistoryStorageDir);
655057
655507
  } catch {
655058
655508
  return result;
655059
655509
  }
655060
- const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join159(fileHistoryStorageDir, dirent.name));
655510
+ const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join160(fileHistoryStorageDir, dirent.name));
655061
655511
  await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
655062
655512
  try {
655063
655513
  const stats3 = await fsImpl.stat(fileHistorySessionDir);
@@ -655084,14 +655534,14 @@ async function cleanupOldSessionEnvDirs() {
655084
655534
  const fsImpl = getFsImplementation();
655085
655535
  try {
655086
655536
  const configDir = getRayuConfigHomeDir();
655087
- const sessionEnvBaseDir = join159(configDir, "session-env");
655537
+ const sessionEnvBaseDir = join160(configDir, "session-env");
655088
655538
  let dirents;
655089
655539
  try {
655090
655540
  dirents = await fsImpl.readdir(sessionEnvBaseDir);
655091
655541
  } catch {
655092
655542
  return result;
655093
655543
  }
655094
- const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join159(sessionEnvBaseDir, dirent.name));
655544
+ const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join160(sessionEnvBaseDir, dirent.name));
655095
655545
  for (const sessionEnvDir of sessionEnvDirs) {
655096
655546
  try {
655097
655547
  const stats3 = await fsImpl.stat(sessionEnvDir);
@@ -655113,7 +655563,7 @@ async function cleanupOldDebugLogs() {
655113
655563
  const cutoffDate = getCutoffDate();
655114
655564
  const result = { messages: 0, errors: 0 };
655115
655565
  const fsImpl = getFsImplementation();
655116
- const debugDir = join159(getRayuConfigHomeDir(), "debug");
655566
+ const debugDir = join160(getRayuConfigHomeDir(), "debug");
655117
655567
  let dirents;
655118
655568
  try {
655119
655569
  dirents = await fsImpl.readdir(debugDir);
@@ -655125,7 +655575,7 @@ async function cleanupOldDebugLogs() {
655125
655575
  continue;
655126
655576
  }
655127
655577
  try {
655128
- if (await unlinkIfOld(join159(debugDir, dirent.name), cutoffDate, fsImpl)) {
655578
+ if (await unlinkIfOld(join160(debugDir, dirent.name), cutoffDate, fsImpl)) {
655129
655579
  result.messages++;
655130
655580
  }
655131
655581
  } catch {
@@ -658437,7 +658887,7 @@ __export(exports_asciicast, {
658437
658887
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
658438
658888
  });
658439
658889
  import { appendFile as appendFile5, rename as rename13 } from "fs/promises";
658440
- import { basename as basename61, dirname as dirname67, join as join161 } from "path";
658890
+ import { basename as basename61, dirname as dirname67, join as join162 } from "path";
658441
658891
  function getRecordFilePath() {
658442
658892
  if (recordingState.filePath !== null) {
658443
658893
  return recordingState.filePath;
@@ -658448,10 +658898,10 @@ function getRecordFilePath() {
658448
658898
  if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
658449
658899
  return null;
658450
658900
  }
658451
- const projectsDir = join161(getRayuConfigHomeDir(), "projects");
658452
- const projectDir = join161(projectsDir, sanitizePath2(getOriginalCwd()));
658901
+ const projectsDir = join162(getRayuConfigHomeDir(), "projects");
658902
+ const projectDir = join162(projectsDir, sanitizePath2(getOriginalCwd()));
658453
658903
  recordingState.timestamp = Date.now();
658454
- recordingState.filePath = join161(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
658904
+ recordingState.filePath = join162(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
658455
658905
  return recordingState.filePath;
658456
658906
  }
658457
658907
  function _resetRecordingStateForTesting() {
@@ -658460,13 +658910,13 @@ function _resetRecordingStateForTesting() {
658460
658910
  }
658461
658911
  function getSessionRecordingPaths() {
658462
658912
  const sessionId = getSessionId();
658463
- const projectsDir = join161(getRayuConfigHomeDir(), "projects");
658464
- const projectDir = join161(projectsDir, sanitizePath2(getOriginalCwd()));
658913
+ const projectsDir = join162(getRayuConfigHomeDir(), "projects");
658914
+ const projectDir = join162(projectsDir, sanitizePath2(getOriginalCwd()));
658465
658915
  try {
658466
658916
  const entries = getFsImplementation().readdirSync(projectDir);
658467
658917
  const names = typeof entries[0] === "string" ? entries : entries.map((e2) => e2.name);
658468
658918
  const files3 = names.filter((f3) => f3.startsWith(sessionId) && f3.endsWith(".cast")).sort();
658469
- return files3.map((f3) => join161(projectDir, f3));
658919
+ return files3.map((f3) => join162(projectDir, f3));
658470
658920
  } catch {
658471
658921
  return [];
658472
658922
  }
@@ -658476,9 +658926,9 @@ async function renameRecordingForSession() {
658476
658926
  if (!oldPath || recordingState.timestamp === 0) {
658477
658927
  return;
658478
658928
  }
658479
- const projectsDir = join161(getRayuConfigHomeDir(), "projects");
658480
- const projectDir = join161(projectsDir, sanitizePath2(getOriginalCwd()));
658481
- const newPath = join161(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
658929
+ const projectsDir = join162(getRayuConfigHomeDir(), "projects");
658930
+ const projectDir = join162(projectsDir, sanitizePath2(getOriginalCwd()));
658931
+ const newPath = join162(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
658482
658932
  if (oldPath === newPath) {
658483
658933
  return;
658484
658934
  }
@@ -660099,7 +660549,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
660099
660549
  } catch {}
660100
660550
  const data = {
660101
660551
  trigger,
660102
- version: "1.4.479",
660552
+ version: "1.4.481",
660103
660553
  platform: process.platform,
660104
660554
  transcript,
660105
660555
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -661321,7 +661771,7 @@ var init_useAwaySummary = __esm(() => {
661321
661771
  });
661322
661772
 
661323
661773
  // src/utils/plugins/officialMarketplaceStartupCheck.ts
661324
- import { join as join162 } from "path";
661774
+ import { join as join163 } from "path";
661325
661775
  function isOfficialMarketplaceAutoInstallDisabled() {
661326
661776
  return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
661327
661777
  }
@@ -661404,7 +661854,7 @@ async function checkAndInstallOfficialMarketplace() {
661404
661854
  return { installed: false, skipped: true, reason: "policy_blocked" };
661405
661855
  }
661406
661856
  const cacheDir = getMarketplacesCacheDir();
661407
- const installLocation = join162(cacheDir, OFFICIAL_MARKETPLACE_NAME);
661857
+ const installLocation = join163(cacheDir, OFFICIAL_MARKETPLACE_NAME);
661408
661858
  const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
661409
661859
  if (gcsSha !== null) {
661410
661860
  const known = await loadKnownMarketplacesConfig();
@@ -661661,7 +662111,7 @@ var init_tipHistory = __esm(() => {
661661
662111
 
661662
662112
  // src/utils/desktopDeepLink.ts
661663
662113
  import { readdir as readdir30 } from "fs/promises";
661664
- import { join as join163 } from "path";
662114
+ import { join as join164 } from "path";
661665
662115
  function isDevMode() {
661666
662116
  if (false) {}
661667
662117
  const pathsToCheck = [process.argv[1] || "", process.execPath || ""];
@@ -661722,7 +662172,7 @@ async function getDesktopVersion() {
661722
662172
  if (!localAppData) {
661723
662173
  return null;
661724
662174
  }
661725
- const installDir = join163(localAppData, "AnthropicClaude");
662175
+ const installDir = join164(localAppData, "AnthropicClaude");
661726
662176
  try {
661727
662177
  const entries = await readdir30(installDir);
661728
662178
  const versions2 = entries.filter((e2) => e2.startsWith("app-")).map((e2) => e2.slice(4)).filter((v2) => import_semver16.coerce(v2) !== null).sort((a2, b3) => {
@@ -664716,7 +665166,7 @@ var init_usePluginRecommendationBase = __esm(() => {
664716
665166
  });
664717
665167
 
664718
665168
  // src/hooks/useLspPluginRecommendation.tsx
664719
- import { extname as extname15, join as join164 } from "path";
665169
+ import { extname as extname15, join as join165 } from "path";
664720
665170
  function useLspPluginRecommendation() {
664721
665171
  const $3 = import_compiler_runtime328.c(12);
664722
665172
  const trackedFiles = useAppState(_temp201);
@@ -664801,7 +665251,7 @@ function useLspPluginRecommendation() {
664801
665251
  case "yes": {
664802
665252
  installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
664803
665253
  logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
664804
- const localSourcePath = typeof pluginData.entry.source === "string" ? join164(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
665254
+ const localSourcePath = typeof pluginData.entry.source === "string" ? join165(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
664805
665255
  await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
664806
665256
  const settings = getSettingsForSource("userSettings");
664807
665257
  updateSettingsForSource("userSettings", {
@@ -667569,8 +668019,8 @@ var exports_REPL = {};
667569
668019
  __export(exports_REPL, {
667570
668020
  REPL: () => REPL
667571
668021
  });
667572
- import { dirname as dirname69, join as join165 } from "path";
667573
- import { tmpdir as tmpdir16 } from "os";
668022
+ import { dirname as dirname69, join as join166 } from "path";
668023
+ import { tmpdir as tmpdir17 } from "os";
667574
668024
  import { writeFile as writeFile45 } from "fs/promises";
667575
668025
  import { randomUUID as randomUUID50 } from "crypto";
667576
668026
  function TranscriptModeFooter(t0) {
@@ -670171,7 +670621,7 @@ Note: ctrl + z now suspends RAYU, ctrl + _ undoes input.
670171
670621
  const w2 = Math.max(80, (process.stdout.columns ?? 80) - 6);
670172
670622
  const raw = await renderMessagesToPlainText(deferredMessages, tools, w2);
670173
670623
  const text2 = raw.replace(/[ \t]+$/gm, "");
670174
- const path29 = join165(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
670624
+ const path29 = join166(tmpdir17(), `cc-transcript-${Date.now()}.txt`);
670175
670625
  await writeFile45(path29, text2);
670176
670626
  const opened = openFileInExternalEditor(path29);
670177
670627
  setStatus(opened ? `opening ${path29}` : `wrote ${path29} · no $VISUAL/$EDITOR set`);
@@ -672068,7 +672518,7 @@ function WelcomeV2() {
672068
672518
  dimColor: true,
672069
672519
  children: [
672070
672520
  "v",
672071
- "1.4.479"
672521
+ "1.4.481"
672072
672522
  ]
672073
672523
  })
672074
672524
  ]
@@ -673075,7 +673525,7 @@ function completeOnboarding() {
673075
673525
  saveGlobalConfig((current) => ({
673076
673526
  ...current,
673077
673527
  hasCompletedOnboarding: true,
673078
- lastOnboardingVersion: "1.4.479"
673528
+ lastOnboardingVersion: "1.4.481"
673079
673529
  }));
673080
673530
  }
673081
673531
  function showDialog(root2, renderer) {
@@ -677959,12 +678409,12 @@ var init_createDirectConnectSession = __esm(() => {
677959
678409
  });
677960
678410
 
677961
678411
  // src/utils/errorLogSink.ts
677962
- import { dirname as dirname71, join as join166 } from "path";
678412
+ import { dirname as dirname71, join as join167 } from "path";
677963
678413
  function getErrorsPath() {
677964
- return join166(CACHE_PATHS.errors(), DATE + ".jsonl");
678414
+ return join167(CACHE_PATHS.errors(), DATE + ".jsonl");
677965
678415
  }
677966
678416
  function getMCPLogsPath(serverName) {
677967
- return join166(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
678417
+ return join167(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
677968
678418
  }
677969
678419
  function createJsonlWriter(options) {
677970
678420
  const writer = createBufferedWriter(options);
@@ -678008,7 +678458,7 @@ function appendToLog(path29, message) {
678008
678458
  cwd: getFsImplementation().cwd(),
678009
678459
  userType: "external",
678010
678460
  sessionId: getSessionId(),
678011
- version: "1.4.479"
678461
+ version: "1.4.481"
678012
678462
  };
678013
678463
  getLogWriter(path29).write(messageWithTimestamp);
678014
678464
  }
@@ -678299,7 +678749,7 @@ var init_sessionMemory = __esm(() => {
678299
678749
  // src/utils/iTermBackup.ts
678300
678750
  import { copyFile as copyFile12, stat as stat47 } from "fs/promises";
678301
678751
  import { homedir as homedir38 } from "os";
678302
- import { join as join167 } from "path";
678752
+ import { join as join168 } from "path";
678303
678753
  function markITerm2SetupComplete() {
678304
678754
  saveGlobalConfig((current) => ({
678305
678755
  ...current,
@@ -678314,7 +678764,7 @@ function getIterm2RecoveryInfo() {
678314
678764
  };
678315
678765
  }
678316
678766
  function getITerm2PlistPath() {
678317
- return join167(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
678767
+ return join168(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
678318
678768
  }
678319
678769
  async function checkAndRestoreITerm2Backup() {
678320
678770
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -681807,7 +682257,7 @@ var init_idleTimeout = __esm(() => {
681807
682257
  // src/bridge/inboundAttachments.ts
681808
682258
  import { randomUUID as randomUUID53 } from "crypto";
681809
682259
  import { mkdir as mkdir43, writeFile as writeFile47 } from "fs/promises";
681810
- import { basename as basename62, join as join168 } from "path";
682260
+ import { basename as basename62, join as join169 } from "path";
681811
682261
  function debug3(msg) {
681812
682262
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
681813
682263
  }
@@ -681823,7 +682273,7 @@ function sanitizeFileName(name) {
681823
682273
  return base2 || "attachment";
681824
682274
  }
681825
682275
  function uploadsDir() {
681826
- return join168(getRayuConfigHomeDir(), "uploads", getSessionId());
682276
+ return join169(getRayuConfigHomeDir(), "uploads", getSessionId());
681827
682277
  }
681828
682278
  async function resolveOne(att) {
681829
682279
  const token = getBridgeAccessToken();
@@ -681852,7 +682302,7 @@ async function resolveOne(att) {
681852
682302
  const safeName = sanitizeFileName(att.file_name);
681853
682303
  const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
681854
682304
  const dir = uploadsDir();
681855
- const outPath = join168(dir, `${prefix}-${safeName}`);
682305
+ const outPath = join169(dir, `${prefix}-${safeName}`);
681856
682306
  try {
681857
682307
  await mkdir43(dir, { recursive: true });
681858
682308
  await writeFile47(outPath, data);
@@ -681952,7 +682402,7 @@ var init_sessionUrl = __esm(() => {
681952
682402
 
681953
682403
  // src/utils/plugins/zipCacheAdapters.ts
681954
682404
  import { readFile as readFile54 } from "fs/promises";
681955
- import { join as join169 } from "path";
682405
+ import { join as join170 } from "path";
681956
682406
  async function readZipCacheKnownMarketplaces() {
681957
682407
  try {
681958
682408
  const content = await readFile54(getZipCacheKnownMarketplacesPath(), "utf-8");
@@ -681977,13 +682427,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
681977
682427
  const content = await readMarketplaceJsonContent(installLocation);
681978
682428
  if (content !== null) {
681979
682429
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
681980
- await atomicWriteToZipCache(join169(zipCachePath, relPath), content);
682430
+ await atomicWriteToZipCache(join170(zipCachePath, relPath), content);
681981
682431
  }
681982
682432
  }
681983
682433
  async function readMarketplaceJsonContent(dir) {
681984
682434
  const candidates = [
681985
- join169(dir, ".claude-plugin", "marketplace.json"),
681986
- join169(dir, "marketplace.json"),
682435
+ join170(dir, ".claude-plugin", "marketplace.json"),
682436
+ join170(dir, "marketplace.json"),
681987
682437
  dir
681988
682438
  ];
681989
682439
  for (const candidate of candidates) {
@@ -682113,8 +682563,8 @@ async function getEnvLessBridgeConfig() {
682113
682563
  }
682114
682564
  async function checkEnvLessBridgeMinVersion() {
682115
682565
  const cfg = await getEnvLessBridgeConfig();
682116
- if (cfg.min_version && lt("1.4.479", cfg.min_version)) {
682117
- return `Your version of RAYU (${"1.4.479"}) is too old for Remote Control.
682566
+ if (cfg.min_version && lt("1.4.481", cfg.min_version)) {
682567
+ return `Your version of RAYU (${"1.4.481"}) is too old for Remote Control.
682118
682568
  Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
682119
682569
  }
682120
682570
  return null;
@@ -682441,9 +682891,9 @@ __export(exports_bridgePointer, {
682441
682891
  BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
682442
682892
  });
682443
682893
  import { mkdir as mkdir44, readFile as readFile55, stat as stat48, unlink as unlink25, writeFile as writeFile48 } from "fs/promises";
682444
- import { dirname as dirname72, join as join170 } from "path";
682894
+ import { dirname as dirname72, join as join171 } from "path";
682445
682895
  function getBridgePointerPath(dir) {
682446
- return join170(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
682896
+ return join171(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
682447
682897
  }
682448
682898
  async function writeBridgePointer(dir, pointer) {
682449
682899
  const path29 = getBridgePointerPath(dir);
@@ -682587,7 +683037,7 @@ async function initBridgeCore(params) {
682587
683037
  const rawApi = createBridgeApiClient({
682588
683038
  baseUrl,
682589
683039
  getAccessToken,
682590
- runnerVersion: "1.4.479",
683040
+ runnerVersion: "1.4.481",
682591
683041
  onDebug: logForDebugging,
682592
683042
  onAuth401,
682593
683043
  getTrustedDeviceToken
@@ -687942,7 +688392,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
687942
688392
  setCwd(cwd3);
687943
688393
  const server = new Server({
687944
688394
  name: "claude/tengu",
687945
- version: "1.4.479"
688395
+ version: "1.4.481"
687946
688396
  }, {
687947
688397
  capabilities: {
687948
688398
  tools: {}
@@ -688924,12 +689374,12 @@ __export(exports_install, {
688924
689374
  install: () => install
688925
689375
  });
688926
689376
  import { homedir as homedir39 } from "node:os";
688927
- import { join as join171 } from "node:path";
689377
+ import { join as join172 } from "node:path";
688928
689378
  function getInstallationPath2() {
688929
689379
  const isWindows2 = env3.platform === "win32";
688930
689380
  const homeDir = homedir39();
688931
689381
  if (isWindows2) {
688932
- const windowsPath = join171(homeDir, ".local", "bin", "claude.exe");
689382
+ const windowsPath = join172(homeDir, ".local", "bin", "claude.exe");
688933
689383
  return windowsPath.replace(/\//g, "\\");
688934
689384
  }
688935
689385
  return "~/.local/bin/claude";
@@ -690471,7 +690921,7 @@ ${customInstructions}` : customInstructions;
690471
690921
  }
690472
690922
  }
690473
690923
  logForDiagnosticsNoPII("info", "started", {
690474
- version: "1.4.479",
690924
+ version: "1.4.481",
690475
690925
  is_native_binary: isInBundledMode()
690476
690926
  });
690477
690927
  registerCleanup(async () => {
@@ -691190,7 +691640,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
691190
691640
  pendingHookMessages
691191
691641
  }, renderAndRun);
691192
691642
  }
691193
- }).version(`1.4.479 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
691643
+ }).version(`1.4.481 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
691194
691644
  program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
691195
691645
  program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
691196
691646
  if (canUserConfigureAdvisor()) {
@@ -691650,7 +692100,7 @@ if (false) {}
691650
692100
  async function main2() {
691651
692101
  const args = process.argv.slice(2);
691652
692102
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
691653
- console.log(`${"1.4.479"} (Rayu-CLI)`);
692103
+ console.log(`${"1.4.481"} (Rayu-CLI)`);
691654
692104
  return;
691655
692105
  }
691656
692106
  if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)) {