@rayu-dev/rayu-cli 1.4.479 → 1.4.480
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rayu.js +736 -341
- 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.
|
|
149025
|
+
return `rayu/${"1.4.480"}`;
|
|
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.
|
|
149051
|
+
return `rayu/${"1.4.480"} (${"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.
|
|
149065
|
+
return `rayu/${"1.4.480"}${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.
|
|
205509
|
+
const version2 = `${"1.4.480"}.${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.
|
|
259480
|
+
const match = "1.4.480".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.
|
|
259519
|
+
version: "1.4.480",
|
|
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.
|
|
291635
|
+
attributes["app.version"] = "1.4.480";
|
|
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.
|
|
401992
|
+
return "1.4.480";
|
|
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.
|
|
407230
|
+
version: "1.4.480",
|
|
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.
|
|
407547
|
+
version: "1.4.480",
|
|
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.
|
|
422366
|
+
return computeFingerprint(firstMessageText, "1.4.480");
|
|
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.
|
|
422408
|
+
const fingerprint = computeFingerprint(messageText, "1.4.480");
|
|
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.
|
|
521931
|
+
if (versionConfig.minVersion && lt("1.4.480", versionConfig.minVersion)) {
|
|
521932
521932
|
console.error(`
|
|
521933
|
-
It looks like your version of RAYU (${"1.4.
|
|
521933
|
+
It looks like your version of RAYU (${"1.4.480"}) 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.
|
|
522159
|
+
currentVersion: "1.4.480"
|
|
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.
|
|
522168
|
+
currentVersion: "1.4.480"
|
|
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.
|
|
522696
|
+
const version2 = typeof MACRO !== "undefined" ? "1.4.480" : "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.
|
|
523488
|
-
logForDebugging(`Native installer: current version ${"1.4.
|
|
523491
|
+
if (gte("1.4.480", maxVersion)) {
|
|
523492
|
+
logForDebugging(`Native installer: current version ${"1.4.480"} 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.
|
|
523503
|
+
if (!forceReinstall && version2 === "1.4.480" && 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 (
|
|
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.
|
|
524711
|
+
value: "1.4.480"
|
|
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.
|
|
528382
|
+
currentVersion: "1.4.480",
|
|
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.
|
|
528394
|
+
newSettings.minimumVersion = "1.4.480";
|
|
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.
|
|
536455
|
+
title: `Rayu-CLI v${"1.4.480"}`,
|
|
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
|
|
554602
|
+
cfg.botToken = normalizeBotToken(token);
|
|
554586
554603
|
writeTelegramConfig(cfg);
|
|
554587
554604
|
}
|
|
554588
554605
|
function clearBotToken() {
|
|
@@ -554634,11 +554651,17 @@ function consumePendingToken(token, chatId, username) {
|
|
|
554634
554651
|
return next;
|
|
554635
554652
|
}
|
|
554636
554653
|
function unlink18() {
|
|
554637
|
-
const
|
|
554638
|
-
|
|
554654
|
+
const next = { ...readTelegramConfig() };
|
|
554655
|
+
delete next.linkedChatId;
|
|
554656
|
+
delete next.linkedUsername;
|
|
554657
|
+
delete next.linkedBotUsername;
|
|
554658
|
+
delete next.pendingToken;
|
|
554659
|
+
writeTelegramConfig(next);
|
|
554639
554660
|
}
|
|
554661
|
+
var BOT_TOKEN_RE;
|
|
554640
554662
|
var init_telegramConfig = __esm(() => {
|
|
554641
554663
|
init_envUtils();
|
|
554664
|
+
BOT_TOKEN_RE = /^\d+:[A-Za-z0-9_-]{10,}$/;
|
|
554642
554665
|
});
|
|
554643
554666
|
|
|
554644
554667
|
// src/telegram/telegramApi.ts
|
|
@@ -554964,27 +554987,41 @@ __export(exports_telegram_bot, {
|
|
|
554964
554987
|
});
|
|
554965
554988
|
import { randomUUID as randomUUID29 } from "crypto";
|
|
554966
554989
|
function useKeyPress(target, handler) {
|
|
554967
|
-
|
|
554968
|
-
|
|
554969
|
-
|
|
554970
|
-
|
|
554971
|
-
|
|
554972
|
-
|
|
554973
|
-
|
|
554974
|
-
|
|
554975
|
-
|
|
554976
|
-
|
|
554977
|
-
|
|
554990
|
+
use_input_default((input) => {
|
|
554991
|
+
if (input.trim().toLowerCase() === target)
|
|
554992
|
+
handler();
|
|
554993
|
+
});
|
|
554994
|
+
}
|
|
554995
|
+
function useEscapeToCancel(onCancel) {
|
|
554996
|
+
use_input_default((_input, key2) => {
|
|
554997
|
+
if (key2.escape)
|
|
554998
|
+
onCancel();
|
|
554999
|
+
});
|
|
555000
|
+
}
|
|
555001
|
+
function CancelHint() {
|
|
555002
|
+
return /* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555003
|
+
dimColor: true,
|
|
555004
|
+
children: [
|
|
555005
|
+
"Press ",
|
|
555006
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555007
|
+
bold: true,
|
|
555008
|
+
children: "Esc"
|
|
555009
|
+
}),
|
|
555010
|
+
" to cancel."
|
|
555011
|
+
]
|
|
555012
|
+
});
|
|
554978
555013
|
}
|
|
554979
555014
|
function HostedStep({
|
|
554980
555015
|
onDone,
|
|
554981
|
-
onUseByo
|
|
555016
|
+
onUseByo,
|
|
555017
|
+
onCancel
|
|
554982
555018
|
}) {
|
|
554983
555019
|
const [status, setStatus] = import_react132.useState("loading");
|
|
554984
555020
|
const [pairing, setPairing] = import_react132.useState(null);
|
|
554985
555021
|
const [qr, setQr] = import_react132.useState("");
|
|
554986
555022
|
const setAppState = useSetAppState();
|
|
554987
555023
|
useKeyPress("b", onUseByo);
|
|
555024
|
+
useEscapeToCancel(onCancel);
|
|
554988
555025
|
import_react132.useEffect(() => {
|
|
554989
555026
|
let cancelled = false;
|
|
554990
555027
|
(async () => {
|
|
@@ -555028,14 +555065,17 @@ function HostedStep({
|
|
|
555028
555065
|
if (!link5.linked)
|
|
555029
555066
|
return;
|
|
555030
555067
|
clearInterval(timer);
|
|
555031
|
-
if (link5.chatId)
|
|
555032
|
-
setLinkedChat(Number(link5.chatId), link5.username ?? undefined);
|
|
555068
|
+
if (link5.chatId) {
|
|
555069
|
+
setLinkedChat(Number(link5.chatId), link5.username ?? undefined, pairing?.botUsername ?? undefined);
|
|
555070
|
+
} else if (pairing?.botUsername) {
|
|
555071
|
+
setLinkedBotUsername(pairing.botUsername);
|
|
555072
|
+
}
|
|
555033
555073
|
setAppState((prev) => ({ ...prev, telegramBridgeActive: true }));
|
|
555034
555074
|
onDone();
|
|
555035
555075
|
});
|
|
555036
555076
|
}, 1500);
|
|
555037
555077
|
return () => clearInterval(timer);
|
|
555038
|
-
}, [status, onDone, setAppState]);
|
|
555078
|
+
}, [status, onDone, setAppState, pairing]);
|
|
555039
555079
|
if (status === "loading") {
|
|
555040
555080
|
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555041
555081
|
children: /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
@@ -555073,7 +555113,8 @@ function HostedStep({
|
|
|
555073
555113
|
}),
|
|
555074
555114
|
" to connect your own bot token instead."
|
|
555075
555115
|
]
|
|
555076
|
-
})
|
|
555116
|
+
}),
|
|
555117
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555077
555118
|
]
|
|
555078
555119
|
})
|
|
555079
555120
|
});
|
|
@@ -555106,7 +555147,8 @@ function HostedStep({
|
|
|
555106
555147
|
}),
|
|
555107
555148
|
" to connect your own bot token instead."
|
|
555108
555149
|
]
|
|
555109
|
-
})
|
|
555150
|
+
}),
|
|
555151
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555110
555152
|
]
|
|
555111
555153
|
})
|
|
555112
555154
|
});
|
|
@@ -555162,48 +555204,155 @@ function HostedStep({
|
|
|
555162
555204
|
}),
|
|
555163
555205
|
" to use your own bot token instead."
|
|
555164
555206
|
]
|
|
555165
|
-
})
|
|
555207
|
+
}),
|
|
555208
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555166
555209
|
]
|
|
555167
555210
|
})
|
|
555168
555211
|
});
|
|
555169
555212
|
}
|
|
555170
|
-
function TokenInputStep({
|
|
555213
|
+
function TokenInputStep({
|
|
555214
|
+
onReady,
|
|
555215
|
+
onCancel
|
|
555216
|
+
}) {
|
|
555171
555217
|
const [existing, setExisting] = import_react132.useState(() => getBotToken());
|
|
555218
|
+
const [editing, setEditing] = import_react132.useState(() => getBotToken() === undefined);
|
|
555219
|
+
const connect5 = import_react132.useCallback(() => {
|
|
555220
|
+
setTelegramMode("byo");
|
|
555221
|
+
onReady();
|
|
555222
|
+
}, [onReady]);
|
|
555223
|
+
if (existing && !editing) {
|
|
555224
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(ExistingTokenMenu, {
|
|
555225
|
+
token: existing,
|
|
555226
|
+
onConnect: connect5,
|
|
555227
|
+
onReplace: () => setEditing(true),
|
|
555228
|
+
onDelete: () => {
|
|
555229
|
+
clearBotToken();
|
|
555230
|
+
setExisting(undefined);
|
|
555231
|
+
setEditing(true);
|
|
555232
|
+
},
|
|
555233
|
+
onCancel
|
|
555234
|
+
});
|
|
555235
|
+
}
|
|
555236
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(TokenPrompt, {
|
|
555237
|
+
hasExisting: existing !== undefined,
|
|
555238
|
+
onSaved: connect5,
|
|
555239
|
+
onCancel,
|
|
555240
|
+
onCancelReplace: existing !== undefined ? () => setEditing(false) : undefined
|
|
555241
|
+
});
|
|
555242
|
+
}
|
|
555243
|
+
function ExistingTokenMenu({
|
|
555244
|
+
token,
|
|
555245
|
+
onConnect,
|
|
555246
|
+
onReplace,
|
|
555247
|
+
onDelete,
|
|
555248
|
+
onCancel
|
|
555249
|
+
}) {
|
|
555250
|
+
useEscapeToCancel(onCancel);
|
|
555251
|
+
use_input_default((input, key2) => {
|
|
555252
|
+
if (key2.return) {
|
|
555253
|
+
onConnect();
|
|
555254
|
+
return;
|
|
555255
|
+
}
|
|
555256
|
+
const ch2 = input.trim().toLowerCase();
|
|
555257
|
+
if (ch2 === "1")
|
|
555258
|
+
onConnect();
|
|
555259
|
+
else if (ch2 === "2" || ch2 === "r")
|
|
555260
|
+
onReplace();
|
|
555261
|
+
else if (ch2 === "3" || ch2 === "d")
|
|
555262
|
+
onDelete();
|
|
555263
|
+
});
|
|
555264
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555265
|
+
children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555266
|
+
flexDirection: "column",
|
|
555267
|
+
children: [
|
|
555268
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555269
|
+
bold: true,
|
|
555270
|
+
children: "\uD83D\uDCF1 Your Telegram bot token"
|
|
555271
|
+
}),
|
|
555272
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555273
|
+
children: " "
|
|
555274
|
+
}),
|
|
555275
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555276
|
+
children: [
|
|
555277
|
+
"A bot token is already saved (…",
|
|
555278
|
+
token.slice(-6),
|
|
555279
|
+
")."
|
|
555280
|
+
]
|
|
555281
|
+
}),
|
|
555282
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555283
|
+
children: " "
|
|
555284
|
+
}),
|
|
555285
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555286
|
+
children: [
|
|
555287
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555288
|
+
bold: true,
|
|
555289
|
+
children: "Enter"
|
|
555290
|
+
}),
|
|
555291
|
+
" connect with it",
|
|
555292
|
+
" ",
|
|
555293
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555294
|
+
bold: true,
|
|
555295
|
+
children: "r"
|
|
555296
|
+
}),
|
|
555297
|
+
" replace it",
|
|
555298
|
+
" ",
|
|
555299
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555300
|
+
bold: true,
|
|
555301
|
+
children: "d"
|
|
555302
|
+
}),
|
|
555303
|
+
" remove it"
|
|
555304
|
+
]
|
|
555305
|
+
}),
|
|
555306
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555307
|
+
]
|
|
555308
|
+
})
|
|
555309
|
+
});
|
|
555310
|
+
}
|
|
555311
|
+
function TokenPrompt({
|
|
555312
|
+
hasExisting,
|
|
555313
|
+
onSaved,
|
|
555314
|
+
onCancel,
|
|
555315
|
+
onCancelReplace
|
|
555316
|
+
}) {
|
|
555317
|
+
const [value, setValue] = import_react132.useState("");
|
|
555318
|
+
const [cursorOffset, setCursorOffset] = import_react132.useState(0);
|
|
555172
555319
|
const [error54, setError] = import_react132.useState("");
|
|
555173
|
-
const [
|
|
555174
|
-
|
|
555175
|
-
|
|
555176
|
-
|
|
555177
|
-
|
|
555178
|
-
|
|
555179
|
-
|
|
555180
|
-
|
|
555181
|
-
|
|
555182
|
-
|
|
555183
|
-
|
|
555184
|
-
|
|
555185
|
-
|
|
555186
|
-
|
|
555187
|
-
|
|
555188
|
-
|
|
555189
|
-
|
|
555190
|
-
|
|
555320
|
+
const [status, setStatus] = import_react132.useState("idle");
|
|
555321
|
+
use_input_default((_input, key2) => {
|
|
555322
|
+
if (!key2.escape)
|
|
555323
|
+
return;
|
|
555324
|
+
if (onCancelReplace)
|
|
555325
|
+
onCancelReplace();
|
|
555326
|
+
else
|
|
555327
|
+
onCancel();
|
|
555328
|
+
}, { isActive: status === "idle" });
|
|
555329
|
+
const handleSubmit = import_react132.useCallback((submitted) => {
|
|
555330
|
+
if (status !== "idle")
|
|
555331
|
+
return;
|
|
555332
|
+
const token = normalizeBotToken(submitted);
|
|
555333
|
+
if (!token) {
|
|
555334
|
+
setError("Paste the token from @BotFather, then press Enter.");
|
|
555335
|
+
return;
|
|
555336
|
+
}
|
|
555337
|
+
if (!isValidBotToken(token)) {
|
|
555338
|
+
setError("That doesn't look like a bot token. It should be like: 123456789:ABCDefGHI…");
|
|
555339
|
+
return;
|
|
555340
|
+
}
|
|
555341
|
+
setError("");
|
|
555342
|
+
setStatus("verifying");
|
|
555343
|
+
getBotUsername(token).then((username) => {
|
|
555344
|
+
if (!username) {
|
|
555345
|
+
setStatus("idle");
|
|
555346
|
+
setError("Telegram rejected this token. Check it in @BotFather (or /revoke and paste the new one).");
|
|
555191
555347
|
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
555348
|
}
|
|
555200
|
-
|
|
555201
|
-
|
|
555202
|
-
|
|
555203
|
-
|
|
555204
|
-
};
|
|
555205
|
-
}, [
|
|
555206
|
-
if (
|
|
555349
|
+
saveBotToken(token);
|
|
555350
|
+
setTelegramMode("byo");
|
|
555351
|
+
setStatus("saved");
|
|
555352
|
+
setTimeout(onSaved, 300);
|
|
555353
|
+
});
|
|
555354
|
+
}, [status, onSaved]);
|
|
555355
|
+
if (status === "saved") {
|
|
555207
555356
|
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555208
555357
|
children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555209
555358
|
flexDirection: "column",
|
|
@@ -555220,65 +555369,13 @@ function TokenInputStep({ onReady }) {
|
|
|
555220
555369
|
})
|
|
555221
555370
|
});
|
|
555222
555371
|
}
|
|
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
555372
|
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555276
555373
|
children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555277
555374
|
flexDirection: "column",
|
|
555278
555375
|
children: [
|
|
555279
555376
|
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555280
555377
|
bold: true,
|
|
555281
|
-
children: "\uD83D\uDCF1 Connect your own Telegram bot"
|
|
555378
|
+
children: hasExisting ? "\uD83D\uDCF1 Replace your Telegram bot token" : "\uD83D\uDCF1 Connect your own Telegram bot"
|
|
555282
555379
|
}),
|
|
555283
555380
|
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555284
555381
|
children: " "
|
|
@@ -555309,31 +555406,64 @@ function TokenInputStep({ onReady }) {
|
|
|
555309
555406
|
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555310
555407
|
children: " 3. Copy the bot token (looks like: 123456789:ABCDef...)"
|
|
555311
555408
|
}),
|
|
555312
|
-
/* @__PURE__ */ jsx_runtime222.
|
|
555313
|
-
children:
|
|
555409
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555410
|
+
children: [
|
|
555411
|
+
" 4. Paste it below and press ",
|
|
555412
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555413
|
+
bold: true,
|
|
555414
|
+
children: "Enter"
|
|
555415
|
+
}),
|
|
555416
|
+
":"
|
|
555417
|
+
]
|
|
555314
555418
|
}),
|
|
555315
555419
|
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555316
555420
|
children: " "
|
|
555317
555421
|
}),
|
|
555318
|
-
/* @__PURE__ */ jsx_runtime222.
|
|
555319
|
-
|
|
555320
|
-
|
|
555321
|
-
|
|
555422
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555423
|
+
children: [
|
|
555424
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555425
|
+
bold: true,
|
|
555426
|
+
color: "cyan",
|
|
555427
|
+
children: "⌨ Bot token: "
|
|
555428
|
+
}),
|
|
555429
|
+
/* @__PURE__ */ jsx_runtime222.jsx(TextInput, {
|
|
555430
|
+
value,
|
|
555431
|
+
onChange: setValue,
|
|
555432
|
+
onSubmit: handleSubmit,
|
|
555433
|
+
cursorOffset,
|
|
555434
|
+
onChangeCursorOffset: setCursorOffset,
|
|
555435
|
+
columns: 80,
|
|
555436
|
+
focus: status === "idle",
|
|
555437
|
+
showCursor: true
|
|
555438
|
+
})
|
|
555439
|
+
]
|
|
555322
555440
|
}),
|
|
555441
|
+
status === "verifying" ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555442
|
+
dimColor: true,
|
|
555443
|
+
children: "Checking the token with Telegram…"
|
|
555444
|
+
}) : null,
|
|
555323
555445
|
error54 ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555324
555446
|
color: "red",
|
|
555325
555447
|
children: error54
|
|
555326
|
-
}) : null
|
|
555448
|
+
}) : null,
|
|
555449
|
+
onCancelReplace ? /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555450
|
+
dimColor: true,
|
|
555451
|
+
children: "Press Esc to keep the token you already have."
|
|
555452
|
+
}) : /* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555327
555453
|
]
|
|
555328
555454
|
})
|
|
555329
555455
|
});
|
|
555330
555456
|
}
|
|
555331
|
-
function LinkStep({
|
|
555457
|
+
function LinkStep({
|
|
555458
|
+
onDone,
|
|
555459
|
+
onCancel
|
|
555460
|
+
}) {
|
|
555332
555461
|
const token = getBotToken();
|
|
555333
555462
|
const [pairToken] = import_react132.useState(() => randomUUID29().slice(0, 8));
|
|
555334
555463
|
const [qr, setQr] = import_react132.useState("");
|
|
555335
555464
|
const [botUsername, setBotUsername] = import_react132.useState(undefined);
|
|
555336
555465
|
const setAppState = useSetAppState();
|
|
555466
|
+
useEscapeToCancel(onCancel);
|
|
555337
555467
|
import_react132.useEffect(() => {
|
|
555338
555468
|
saveBotToken(token);
|
|
555339
555469
|
setAppState((prev) => ({ ...prev, telegramBridgeActive: true }));
|
|
@@ -555350,11 +555480,13 @@ function LinkStep({ onDone }) {
|
|
|
555350
555480
|
const timer = setInterval(() => {
|
|
555351
555481
|
if (readTelegramConfig().linkedChatId !== undefined) {
|
|
555352
555482
|
clearInterval(timer);
|
|
555483
|
+
if (botUsername)
|
|
555484
|
+
setLinkedBotUsername(botUsername);
|
|
555353
555485
|
onDone();
|
|
555354
555486
|
}
|
|
555355
555487
|
}, 1500);
|
|
555356
555488
|
return () => clearInterval(timer);
|
|
555357
|
-
}, [onDone]);
|
|
555489
|
+
}, [onDone, botUsername]);
|
|
555358
555490
|
const lines2 = qr.split(`
|
|
555359
555491
|
`).filter((l3) => l3.length > 0);
|
|
555360
555492
|
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
@@ -555387,35 +555519,30 @@ function LinkStep({ onDone }) {
|
|
|
555387
555519
|
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555388
555520
|
dimColor: true,
|
|
555389
555521
|
children: "Waiting for link… (token valid 10 min)"
|
|
555390
|
-
})
|
|
555522
|
+
}),
|
|
555523
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555391
555524
|
]
|
|
555392
555525
|
})
|
|
555393
555526
|
});
|
|
555394
555527
|
}
|
|
555395
555528
|
function ChooseModeStep({
|
|
555396
|
-
onChoose
|
|
555529
|
+
onChoose,
|
|
555530
|
+
onCancel
|
|
555397
555531
|
}) {
|
|
555398
555532
|
const [sel, setSel] = import_react132.useState(0);
|
|
555399
|
-
|
|
555400
|
-
|
|
555401
|
-
|
|
555402
|
-
|
|
555403
|
-
|
|
555404
|
-
|
|
555405
|
-
|
|
555406
|
-
|
|
555407
|
-
|
|
555408
|
-
|
|
555409
|
-
|
|
555410
|
-
|
|
555411
|
-
|
|
555412
|
-
}
|
|
555413
|
-
};
|
|
555414
|
-
process.stdin.on("data", onData);
|
|
555415
|
-
return () => {
|
|
555416
|
-
process.stdin.off("data", onData);
|
|
555417
|
-
};
|
|
555418
|
-
}, [onChoose, sel]);
|
|
555533
|
+
useEscapeToCancel(onCancel);
|
|
555534
|
+
use_input_default((input, key2) => {
|
|
555535
|
+
const t2 = input.trim();
|
|
555536
|
+
if (t2 === "1")
|
|
555537
|
+
onChoose("hosted");
|
|
555538
|
+
else if (t2 === "2")
|
|
555539
|
+
onChoose("byo");
|
|
555540
|
+
else if (key2.return)
|
|
555541
|
+
onChoose(sel === 0 ? "hosted" : "byo");
|
|
555542
|
+
else if (key2.upArrow || key2.downArrow || t2 === "j" || t2 === "k") {
|
|
555543
|
+
setSel((p) => p === 0 ? 1 : 0);
|
|
555544
|
+
}
|
|
555545
|
+
});
|
|
555419
555546
|
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555420
555547
|
children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555421
555548
|
flexDirection: "column",
|
|
@@ -555457,22 +555584,66 @@ function ChooseModeStep({
|
|
|
555457
555584
|
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555458
555585
|
dimColor: true,
|
|
555459
555586
|
children: "Press 1 or 2 (or ↑/↓ then Enter). Enter = shared bot."
|
|
555460
|
-
})
|
|
555587
|
+
}),
|
|
555588
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555461
555589
|
]
|
|
555462
555590
|
})
|
|
555463
555591
|
});
|
|
555464
555592
|
}
|
|
555465
|
-
function
|
|
555466
|
-
|
|
555467
|
-
|
|
555468
|
-
|
|
555469
|
-
|
|
555470
|
-
|
|
555471
|
-
|
|
555472
|
-
|
|
555593
|
+
async function resolveCurrentBotUsername() {
|
|
555594
|
+
if (getTelegramMode() === "hosted") {
|
|
555595
|
+
if (!hasRayuSession())
|
|
555596
|
+
return;
|
|
555597
|
+
const info = await getHostedBotInfo();
|
|
555598
|
+
return info.username ?? undefined;
|
|
555599
|
+
}
|
|
555600
|
+
const token = getBotToken();
|
|
555601
|
+
return token ? await getBotUsername(token) : undefined;
|
|
555602
|
+
}
|
|
555603
|
+
function VerifyLinkStep({
|
|
555604
|
+
onReconnect,
|
|
555605
|
+
onRepair,
|
|
555606
|
+
onCancel
|
|
555607
|
+
}) {
|
|
555608
|
+
const [check3, setCheck] = import_react132.useState({ kind: "checking" });
|
|
555609
|
+
useEscapeToCancel(onCancel);
|
|
555610
|
+
use_input_default((input, key2) => {
|
|
555611
|
+
if (check3.kind === "checking")
|
|
555612
|
+
return;
|
|
555613
|
+
if (key2.return) {
|
|
555614
|
+
if (check3.kind === "changed")
|
|
555615
|
+
onRepair();
|
|
555616
|
+
else {
|
|
555617
|
+
setLinkedBotUsername(check3.current);
|
|
555618
|
+
onReconnect();
|
|
555619
|
+
}
|
|
555620
|
+
return;
|
|
555473
555621
|
}
|
|
555474
|
-
|
|
555475
|
-
|
|
555622
|
+
if (input.trim().toLowerCase() === "r")
|
|
555623
|
+
onRepair();
|
|
555624
|
+
}, { isActive: check3.kind !== "checking" });
|
|
555625
|
+
import_react132.useEffect(() => {
|
|
555626
|
+
let cancelled = false;
|
|
555627
|
+
(async () => {
|
|
555628
|
+
const recorded = readTelegramConfig().linkedBotUsername;
|
|
555629
|
+
const current = await resolveCurrentBotUsername();
|
|
555630
|
+
if (cancelled)
|
|
555631
|
+
return;
|
|
555632
|
+
if (!current) {
|
|
555633
|
+
onReconnect();
|
|
555634
|
+
return;
|
|
555635
|
+
}
|
|
555636
|
+
if (recorded && recorded.toLowerCase() === current.toLowerCase()) {
|
|
555637
|
+
onReconnect();
|
|
555638
|
+
return;
|
|
555639
|
+
}
|
|
555640
|
+
setCheck(recorded ? { kind: "changed", linkedTo: recorded, current } : { kind: "unverifiable", current });
|
|
555641
|
+
})();
|
|
555642
|
+
return () => {
|
|
555643
|
+
cancelled = true;
|
|
555644
|
+
};
|
|
555645
|
+
}, [onReconnect]);
|
|
555646
|
+
if (check3.kind === "checking") {
|
|
555476
555647
|
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555477
555648
|
children: /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555478
555649
|
dimColor: true,
|
|
@@ -555480,8 +555651,153 @@ function TelegramBotConnect({ onDone }) {
|
|
|
555480
555651
|
})
|
|
555481
555652
|
});
|
|
555482
555653
|
}
|
|
555654
|
+
if (check3.kind === "changed") {
|
|
555655
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555656
|
+
children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555657
|
+
flexDirection: "column",
|
|
555658
|
+
children: [
|
|
555659
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555660
|
+
bold: true,
|
|
555661
|
+
children: "\uD83D\uDCF1 Telegram bot changed"
|
|
555662
|
+
}),
|
|
555663
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555664
|
+
children: " "
|
|
555665
|
+
}),
|
|
555666
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555667
|
+
children: [
|
|
555668
|
+
"Your saved link points at ",
|
|
555669
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555670
|
+
bold: true,
|
|
555671
|
+
children: [
|
|
555672
|
+
"@",
|
|
555673
|
+
check3.linkedTo
|
|
555674
|
+
]
|
|
555675
|
+
}),
|
|
555676
|
+
", but Rayu now uses ",
|
|
555677
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555678
|
+
bold: true,
|
|
555679
|
+
children: [
|
|
555680
|
+
"@",
|
|
555681
|
+
check3.current
|
|
555682
|
+
]
|
|
555683
|
+
}),
|
|
555684
|
+
"."
|
|
555685
|
+
]
|
|
555686
|
+
}),
|
|
555687
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555688
|
+
dimColor: true,
|
|
555689
|
+
children: "The old link can't receive messages from the new bot."
|
|
555690
|
+
}),
|
|
555691
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555692
|
+
children: " "
|
|
555693
|
+
}),
|
|
555694
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555695
|
+
children: [
|
|
555696
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555697
|
+
bold: true,
|
|
555698
|
+
children: "Enter"
|
|
555699
|
+
}),
|
|
555700
|
+
" link with @",
|
|
555701
|
+
check3.current
|
|
555702
|
+
]
|
|
555703
|
+
}),
|
|
555704
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555705
|
+
]
|
|
555706
|
+
})
|
|
555707
|
+
});
|
|
555708
|
+
}
|
|
555709
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555710
|
+
children: /* @__PURE__ */ jsx_runtime222.jsxs(ThemedBox_default, {
|
|
555711
|
+
flexDirection: "column",
|
|
555712
|
+
children: [
|
|
555713
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555714
|
+
bold: true,
|
|
555715
|
+
children: "\uD83D\uDCF1 Telegram is already linked"
|
|
555716
|
+
}),
|
|
555717
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555718
|
+
children: " "
|
|
555719
|
+
}),
|
|
555720
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555721
|
+
children: [
|
|
555722
|
+
"Rayu currently uses ",
|
|
555723
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555724
|
+
bold: true,
|
|
555725
|
+
children: [
|
|
555726
|
+
"@",
|
|
555727
|
+
check3.current
|
|
555728
|
+
]
|
|
555729
|
+
}),
|
|
555730
|
+
"."
|
|
555731
|
+
]
|
|
555732
|
+
}),
|
|
555733
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555734
|
+
dimColor: true,
|
|
555735
|
+
children: "This link was saved before Rayu recorded which bot it belongs to, so it may point at an older bot."
|
|
555736
|
+
}),
|
|
555737
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555738
|
+
children: " "
|
|
555739
|
+
}),
|
|
555740
|
+
/* @__PURE__ */ jsx_runtime222.jsxs(ThemedText, {
|
|
555741
|
+
children: [
|
|
555742
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555743
|
+
bold: true,
|
|
555744
|
+
children: "Enter"
|
|
555745
|
+
}),
|
|
555746
|
+
" reconnect with the saved link",
|
|
555747
|
+
" ",
|
|
555748
|
+
/* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555749
|
+
bold: true,
|
|
555750
|
+
children: "r"
|
|
555751
|
+
}),
|
|
555752
|
+
" re-link with @",
|
|
555753
|
+
check3.current
|
|
555754
|
+
]
|
|
555755
|
+
}),
|
|
555756
|
+
/* @__PURE__ */ jsx_runtime222.jsx(CancelHint, {})
|
|
555757
|
+
]
|
|
555758
|
+
})
|
|
555759
|
+
});
|
|
555760
|
+
}
|
|
555761
|
+
function TelegramBotConnect({ onDone }) {
|
|
555762
|
+
const setAppState = useSetAppState();
|
|
555763
|
+
const [screen, setScreen] = import_react132.useState(() => readTelegramConfig().linkedChatId === undefined ? "choose" : "verify");
|
|
555764
|
+
const [unlinking, setUnlinking] = import_react132.useState(false);
|
|
555765
|
+
const reconnect = import_react132.useCallback(() => {
|
|
555766
|
+
setAppState((prev) => ({ ...prev, telegramBridgeActive: true }));
|
|
555767
|
+
onDone();
|
|
555768
|
+
}, [onDone, setAppState]);
|
|
555769
|
+
const repair = import_react132.useCallback(() => {
|
|
555770
|
+
setUnlinking(true);
|
|
555771
|
+
(async () => {
|
|
555772
|
+
if (getTelegramMode() === "hosted")
|
|
555773
|
+
await deleteHostedLink();
|
|
555774
|
+
unlink18();
|
|
555775
|
+
setUnlinking(false);
|
|
555776
|
+
setScreen("choose");
|
|
555777
|
+
})();
|
|
555778
|
+
}, []);
|
|
555779
|
+
const cancel = import_react132.useCallback(() => {
|
|
555780
|
+
setAppState((prev) => ({ ...prev, telegramBridgeActive: false }));
|
|
555781
|
+
onDone();
|
|
555782
|
+
}, [onDone, setAppState]);
|
|
555783
|
+
if (unlinking) {
|
|
555784
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(Pane, {
|
|
555785
|
+
children: /* @__PURE__ */ jsx_runtime222.jsx(ThemedText, {
|
|
555786
|
+
dimColor: true,
|
|
555787
|
+
children: "Removing the old Telegram link…"
|
|
555788
|
+
})
|
|
555789
|
+
});
|
|
555790
|
+
}
|
|
555791
|
+
if (screen === "verify") {
|
|
555792
|
+
return /* @__PURE__ */ jsx_runtime222.jsx(VerifyLinkStep, {
|
|
555793
|
+
onReconnect: reconnect,
|
|
555794
|
+
onRepair: repair,
|
|
555795
|
+
onCancel: cancel
|
|
555796
|
+
});
|
|
555797
|
+
}
|
|
555483
555798
|
if (screen === "choose") {
|
|
555484
555799
|
return /* @__PURE__ */ jsx_runtime222.jsx(ChooseModeStep, {
|
|
555800
|
+
onCancel: cancel,
|
|
555485
555801
|
onChoose: (mode) => {
|
|
555486
555802
|
if (mode === "hosted") {
|
|
555487
555803
|
setTelegramMode("hosted");
|
|
@@ -555496,16 +555812,19 @@ function TelegramBotConnect({ onDone }) {
|
|
|
555496
555812
|
if (screen === "hosted") {
|
|
555497
555813
|
return /* @__PURE__ */ jsx_runtime222.jsx(HostedStep, {
|
|
555498
555814
|
onDone,
|
|
555499
|
-
onUseByo: () => setScreen("byo-token")
|
|
555815
|
+
onUseByo: () => setScreen("byo-token"),
|
|
555816
|
+
onCancel: cancel
|
|
555500
555817
|
});
|
|
555501
555818
|
}
|
|
555502
555819
|
if (screen === "byo-token") {
|
|
555503
555820
|
return /* @__PURE__ */ jsx_runtime222.jsx(TokenInputStep, {
|
|
555504
|
-
onReady: () => setScreen("byo-link")
|
|
555821
|
+
onReady: () => setScreen("byo-link"),
|
|
555822
|
+
onCancel: cancel
|
|
555505
555823
|
});
|
|
555506
555824
|
}
|
|
555507
555825
|
return /* @__PURE__ */ jsx_runtime222.jsx(LinkStep, {
|
|
555508
|
-
onDone
|
|
555826
|
+
onDone,
|
|
555827
|
+
onCancel: cancel
|
|
555509
555828
|
});
|
|
555510
555829
|
}
|
|
555511
555830
|
async function call20(onDone) {
|
|
@@ -555517,6 +555836,7 @@ var import_react132, jsx_runtime222, TOKEN_TTL_MS;
|
|
|
555517
555836
|
var init_telegram_bot = __esm(() => {
|
|
555518
555837
|
init_server();
|
|
555519
555838
|
init_Pane();
|
|
555839
|
+
init_TextInput();
|
|
555520
555840
|
init_ink2();
|
|
555521
555841
|
init_telegramConfig();
|
|
555522
555842
|
init_telegramApi();
|
|
@@ -557026,7 +557346,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
|
|
|
557026
557346
|
}
|
|
557027
557347
|
return [];
|
|
557028
557348
|
}
|
|
557029
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.
|
|
557349
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.480") {
|
|
557030
557350
|
if (false) {}
|
|
557031
557351
|
const cachedChangelog = await getStoredChangelog();
|
|
557032
557352
|
if (lastSeenVersion !== currentVersion || !cachedChangelog) {
|
|
@@ -557039,7 +557359,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.4.479")
|
|
|
557039
557359
|
releaseNotes
|
|
557040
557360
|
};
|
|
557041
557361
|
}
|
|
557042
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.
|
|
557362
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.4.480") {
|
|
557043
557363
|
if (false) {}
|
|
557044
557364
|
const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
|
|
557045
557365
|
return {
|
|
@@ -557167,7 +557487,7 @@ function getRecentActivitySync() {
|
|
|
557167
557487
|
return cachedActivity;
|
|
557168
557488
|
}
|
|
557169
557489
|
function getLogoDisplayData() {
|
|
557170
|
-
const version2 = process.env.DEMO_VERSION ?? "1.4.
|
|
557490
|
+
const version2 = process.env.DEMO_VERSION ?? "1.4.480";
|
|
557171
557491
|
const serverUrl = getDirectConnectServerUrl();
|
|
557172
557492
|
const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
|
|
557173
557493
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -558332,7 +558652,7 @@ function LogoV2() {
|
|
|
558332
558652
|
if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
558333
558653
|
t2 = () => {
|
|
558334
558654
|
const currentConfig = getGlobalConfig();
|
|
558335
|
-
if (currentConfig.lastReleaseNotesSeen === "1.4.
|
|
558655
|
+
if (currentConfig.lastReleaseNotesSeen === "1.4.480") {
|
|
558336
558656
|
return;
|
|
558337
558657
|
}
|
|
558338
558658
|
saveGlobalConfig(_temp327);
|
|
@@ -558811,7 +559131,7 @@ function LogoV2() {
|
|
|
558811
559131
|
t24 = $3[61];
|
|
558812
559132
|
}
|
|
558813
559133
|
const _latestNpm = getCachedLatestNpmVersionSync();
|
|
558814
|
-
const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.
|
|
559134
|
+
const _updateFeeds = _latestNpm && gt(_latestNpm, "1.4.480") ? [createUpdateAvailableFeed("1.4.480", _latestNpm)] : [];
|
|
558815
559135
|
const t25 = layoutMode === "horizontal" && /* @__PURE__ */ jsx_runtime236.jsx(FeedColumn, {
|
|
558816
559136
|
feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), ..._updateFeeds, createWhatsNewFeed(changelog)],
|
|
558817
559137
|
maxWidth: rightWidth
|
|
@@ -559011,12 +559331,12 @@ function LogoV2() {
|
|
|
559011
559331
|
return t41;
|
|
559012
559332
|
}
|
|
559013
559333
|
function _temp327(current) {
|
|
559014
|
-
if (current.lastReleaseNotesSeen === "1.4.
|
|
559334
|
+
if (current.lastReleaseNotesSeen === "1.4.480") {
|
|
559015
559335
|
return current;
|
|
559016
559336
|
}
|
|
559017
559337
|
return {
|
|
559018
559338
|
...current,
|
|
559019
|
-
lastReleaseNotesSeen: "1.4.
|
|
559339
|
+
lastReleaseNotesSeen: "1.4.480"
|
|
559020
559340
|
};
|
|
559021
559341
|
}
|
|
559022
559342
|
function _temp241(s_0) {
|
|
@@ -584015,7 +584335,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
584015
584335
|
smapsRollup,
|
|
584016
584336
|
platform: process.platform,
|
|
584017
584337
|
nodeVersion: process.version,
|
|
584018
|
-
ccVersion: "1.4.
|
|
584338
|
+
ccVersion: "1.4.480"
|
|
584019
584339
|
};
|
|
584020
584340
|
}
|
|
584021
584341
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -584537,7 +584857,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
584537
584857
|
var call50 = async () => {
|
|
584538
584858
|
return {
|
|
584539
584859
|
type: "text",
|
|
584540
|
-
value: "1.4.
|
|
584860
|
+
value: "1.4.480"
|
|
584541
584861
|
};
|
|
584542
584862
|
}, version2, version_default;
|
|
584543
584863
|
var init_version = __esm(() => {
|
|
@@ -595033,7 +595353,7 @@ function generateHtmlReport(data, insights) {
|
|
|
595033
595353
|
</html>`;
|
|
595034
595354
|
}
|
|
595035
595355
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
595036
|
-
const version3 = typeof MACRO !== "undefined" ? "1.4.
|
|
595356
|
+
const version3 = typeof MACRO !== "undefined" ? "1.4.480" : "unknown";
|
|
595037
595357
|
const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
|
|
595038
595358
|
const facets_summary = {
|
|
595039
595359
|
total: facets.size,
|
|
@@ -598947,7 +599267,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
598947
599267
|
init_settings2();
|
|
598948
599268
|
init_slowOperations();
|
|
598949
599269
|
init_uuid();
|
|
598950
|
-
VERSION6 = typeof MACRO !== "undefined" ? "1.4.
|
|
599270
|
+
VERSION6 = typeof MACRO !== "undefined" ? "1.4.480" : "unknown";
|
|
598951
599271
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
598952
599272
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
598953
599273
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -600165,7 +600485,7 @@ var init_filesystem = __esm(() => {
|
|
|
600165
600485
|
});
|
|
600166
600486
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
600167
600487
|
const nonce = randomBytes19(16).toString("hex");
|
|
600168
|
-
return join153(getClaudeTempDir(), "bundled-skills", "1.4.
|
|
600488
|
+
return join153(getClaudeTempDir(), "bundled-skills", "1.4.480", nonce);
|
|
600169
600489
|
});
|
|
600170
600490
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
600171
600491
|
});
|
|
@@ -605273,8 +605593,10 @@ var init_worktree = __esm(() => {
|
|
|
605273
605593
|
});
|
|
605274
605594
|
|
|
605275
605595
|
// src/utils/npmExec.ts
|
|
605276
|
-
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
605277
|
-
import {
|
|
605596
|
+
import { spawn as spawn13, execFileSync as execFileSync3 } from "node:child_process";
|
|
605597
|
+
import { writeFileSync as writeFileSync18 } from "node:fs";
|
|
605598
|
+
import { homedir as homedir35, tmpdir as tmpdir16 } from "os";
|
|
605599
|
+
import { join as join156 } from "path";
|
|
605278
605600
|
function execNpmSync(npmArgs, options) {
|
|
605279
605601
|
if (IS_WINDOWS2) {
|
|
605280
605602
|
for (const a2 of npmArgs) {
|
|
@@ -605298,6 +605620,16 @@ function execNpmSync(npmArgs, options) {
|
|
|
605298
605620
|
stdio: options.stdio
|
|
605299
605621
|
});
|
|
605300
605622
|
}
|
|
605623
|
+
function stderrOf(err2) {
|
|
605624
|
+
if (!(err2 instanceof Error))
|
|
605625
|
+
return "";
|
|
605626
|
+
const anyErr = err2;
|
|
605627
|
+
if (typeof anyErr.stderr === "string")
|
|
605628
|
+
return anyErr.stderr;
|
|
605629
|
+
if (Buffer.isBuffer(anyErr.stderr))
|
|
605630
|
+
return anyErr.stderr.toString("utf8");
|
|
605631
|
+
return "";
|
|
605632
|
+
}
|
|
605301
605633
|
function describeNpmError(err2) {
|
|
605302
605634
|
if (!(err2 instanceof Error))
|
|
605303
605635
|
return String(err2);
|
|
@@ -605305,8 +605637,7 @@ function describeNpmError(err2) {
|
|
|
605305
605637
|
const parts = [];
|
|
605306
605638
|
if (anyErr.code)
|
|
605307
605639
|
parts.push(`code: ${anyErr.code}`);
|
|
605308
|
-
const
|
|
605309
|
-
const trimmedStderr = stderrText.trim();
|
|
605640
|
+
const trimmedStderr = stderrOf(err2).trim();
|
|
605310
605641
|
if (trimmedStderr) {
|
|
605311
605642
|
parts.push(trimmedStderr);
|
|
605312
605643
|
} else if (err2.message) {
|
|
@@ -605321,9 +605652,96 @@ function isLikelyEacces(err2) {
|
|
|
605321
605652
|
const anyErr = err2;
|
|
605322
605653
|
if (anyErr.code === "EACCES" || anyErr.code === "EPERM")
|
|
605323
605654
|
return true;
|
|
605324
|
-
const stderrText =
|
|
605655
|
+
const stderrText = stderrOf(err2);
|
|
605325
605656
|
return /EACCES|permission denied/i.test(stderrText) || /EACCES|permission denied/i.test(err2.message);
|
|
605326
605657
|
}
|
|
605658
|
+
function isLikelyWindowsFileLock(err2) {
|
|
605659
|
+
if (!(err2 instanceof Error))
|
|
605660
|
+
return false;
|
|
605661
|
+
const code = err2.code;
|
|
605662
|
+
if (code === "EBUSY" || code === "ETXTBSY")
|
|
605663
|
+
return true;
|
|
605664
|
+
const haystack = `${stderrOf(err2)}
|
|
605665
|
+
${err2.message}`;
|
|
605666
|
+
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);
|
|
605667
|
+
}
|
|
605668
|
+
function buildNpmRemediation(action2, packageSpec, err2, platform4 = process.platform) {
|
|
605669
|
+
const isWin = platform4 === "win32";
|
|
605670
|
+
const cmd = `npm ${action2} -g ${packageSpec}`;
|
|
605671
|
+
const lines2 = ["", "Try manually:", ` ${cmd}`];
|
|
605672
|
+
if (isWin) {
|
|
605673
|
+
if (isLikelyWindowsFileLock(err2)) {
|
|
605674
|
+
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");
|
|
605675
|
+
} else {
|
|
605676
|
+
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)");
|
|
605677
|
+
}
|
|
605678
|
+
return lines2.join(`
|
|
605679
|
+
`);
|
|
605680
|
+
}
|
|
605681
|
+
if (isLikelyEacces(err2)) {
|
|
605682
|
+
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}`);
|
|
605683
|
+
} else {
|
|
605684
|
+
lines2.push("", "Or with sudo if you have permission issues:", ` sudo ${cmd}`);
|
|
605685
|
+
}
|
|
605686
|
+
return lines2.join(`
|
|
605687
|
+
`);
|
|
605688
|
+
}
|
|
605689
|
+
function buildWindowsDeferredInstallScript(packageSpec, pid) {
|
|
605690
|
+
if (!Number.isInteger(pid) || pid <= 0) {
|
|
605691
|
+
throw new Error(`buildWindowsDeferredInstallScript: invalid pid ${pid}`);
|
|
605692
|
+
}
|
|
605693
|
+
if (packageSpec.includes('"')) {
|
|
605694
|
+
throw new Error(`buildWindowsDeferredInstallScript: refusing to quote a spec containing a double quote: ${JSON.stringify(packageSpec)}`);
|
|
605695
|
+
}
|
|
605696
|
+
return [
|
|
605697
|
+
"@echo off",
|
|
605698
|
+
"title Rayu update",
|
|
605699
|
+
"echo Waiting for Rayu to exit...",
|
|
605700
|
+
"set /a _tries=0",
|
|
605701
|
+
":wait",
|
|
605702
|
+
`tasklist /FI "PID eq ${pid}" /NH 2>nul | find "${pid}" >nul`,
|
|
605703
|
+
"if errorlevel 1 goto run",
|
|
605704
|
+
"set /a _tries+=1",
|
|
605705
|
+
"if %_tries% GEQ 60 goto run",
|
|
605706
|
+
"timeout /t 1 /nobreak >nul 2>&1 || ping -n 2 127.0.0.1 >nul",
|
|
605707
|
+
"goto wait",
|
|
605708
|
+
":run",
|
|
605709
|
+
"echo Installing Rayu CLI...",
|
|
605710
|
+
"echo.",
|
|
605711
|
+
`call npm install -g "${packageSpec}"`,
|
|
605712
|
+
"if errorlevel 1 (",
|
|
605713
|
+
" echo.",
|
|
605714
|
+
" echo Update FAILED. Close all Rayu windows and run this in a new terminal:",
|
|
605715
|
+
` echo npm install -g ${packageSpec}`,
|
|
605716
|
+
" echo If npm cannot write to its global folder, run that terminal as Administrator.",
|
|
605717
|
+
") else (",
|
|
605718
|
+
" echo.",
|
|
605719
|
+
" echo Rayu CLI updated successfully.",
|
|
605720
|
+
")",
|
|
605721
|
+
"echo.",
|
|
605722
|
+
"echo Press any key to close this window.",
|
|
605723
|
+
"pause >nul",
|
|
605724
|
+
""
|
|
605725
|
+
].join(`\r
|
|
605726
|
+
`);
|
|
605727
|
+
}
|
|
605728
|
+
function scheduleWindowsDeferredInstall(packageSpec) {
|
|
605729
|
+
if (!IS_WINDOWS2)
|
|
605730
|
+
return false;
|
|
605731
|
+
try {
|
|
605732
|
+
const scriptPath = join156(tmpdir16(), `rayu-update-${process.pid}.cmd`);
|
|
605733
|
+
writeFileSync18(scriptPath, buildWindowsDeferredInstallScript(packageSpec, process.pid), "utf8");
|
|
605734
|
+
const child = spawn13("cmd.exe", ["/d", "/s", "/c", "start", "", scriptPath], {
|
|
605735
|
+
detached: true,
|
|
605736
|
+
stdio: "ignore",
|
|
605737
|
+
windowsHide: false
|
|
605738
|
+
});
|
|
605739
|
+
child.unref();
|
|
605740
|
+
return true;
|
|
605741
|
+
} catch {
|
|
605742
|
+
return false;
|
|
605743
|
+
}
|
|
605744
|
+
}
|
|
605327
605745
|
var IS_WINDOWS2;
|
|
605328
605746
|
var init_npmExec = __esm(() => {
|
|
605329
605747
|
IS_WINDOWS2 = process.platform === "win32";
|
|
@@ -605335,7 +605753,7 @@ __export(exports_update, {
|
|
|
605335
605753
|
update: () => update
|
|
605336
605754
|
});
|
|
605337
605755
|
async function update() {
|
|
605338
|
-
writeToStdout(`Current version: ${"1.4.
|
|
605756
|
+
writeToStdout(`Current version: ${"1.4.480"}
|
|
605339
605757
|
`);
|
|
605340
605758
|
const isBundled = isInBundledMode();
|
|
605341
605759
|
if (isBundled) {
|
|
@@ -605366,13 +605784,13 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
|
|
|
605366
605784
|
process.exit(1);
|
|
605367
605785
|
return;
|
|
605368
605786
|
}
|
|
605369
|
-
if (latestVersion === "1.4.
|
|
605787
|
+
if (latestVersion === "1.4.480") {
|
|
605370
605788
|
writeToStdout(source_default.green(`
|
|
605371
|
-
Rayu CLI is up to date (${"1.4.
|
|
605789
|
+
Rayu CLI is up to date (${"1.4.480"})
|
|
605372
605790
|
`));
|
|
605373
605791
|
process.exit(0);
|
|
605374
605792
|
}
|
|
605375
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.
|
|
605793
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"1.4.480"})
|
|
605376
605794
|
`);
|
|
605377
605795
|
writeToStdout(`Installing update...
|
|
605378
605796
|
|
|
@@ -605387,31 +605805,21 @@ Failed to install update
|
|
|
605387
605805
|
if (detail)
|
|
605388
605806
|
process.stderr.write(`${detail}
|
|
605389
605807
|
`);
|
|
605390
|
-
|
|
605391
|
-
|
|
605392
|
-
|
|
605393
|
-
|
|
605808
|
+
if (IS_WINDOWS2 && isLikelyWindowsFileLock(err2)) {
|
|
605809
|
+
const spec = `${"@rayu-dev/rayu-cli"}@latest`;
|
|
605810
|
+
if (scheduleWindowsDeferredInstall(spec)) {
|
|
605811
|
+
process.stderr.write(source_default.yellow(`
|
|
605812
|
+
Rayu could not replace its own files while it is running.
|
|
605394
605813
|
`));
|
|
605395
|
-
|
|
605396
|
-
|
|
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:
|
|
605814
|
+
writeToStdout(`A new window has opened to finish the update as soon as Rayu exits.
|
|
605815
|
+
` + `Leave it open until it reports success, then reopen your terminal.
|
|
605411
605816
|
`);
|
|
605412
|
-
|
|
605413
|
-
|
|
605817
|
+
process.exit(1);
|
|
605818
|
+
return;
|
|
605819
|
+
}
|
|
605414
605820
|
}
|
|
605821
|
+
process.stderr.write(`${buildNpmRemediation("install", `${"@rayu-dev/rayu-cli"}@latest`, err2)}
|
|
605822
|
+
`);
|
|
605415
605823
|
process.exit(1);
|
|
605416
605824
|
return;
|
|
605417
605825
|
}
|
|
@@ -605439,14 +605847,14 @@ async function updateNativeBinary() {
|
|
|
605439
605847
|
} catch {
|
|
605440
605848
|
latestVersion = "";
|
|
605441
605849
|
}
|
|
605442
|
-
if (latestVersion && latestVersion === "1.4.
|
|
605850
|
+
if (latestVersion && latestVersion === "1.4.480") {
|
|
605443
605851
|
writeToStdout(source_default.green(`
|
|
605444
|
-
Rayu CLI is up to date (1.4.
|
|
605852
|
+
Rayu CLI is up to date (1.4.480)
|
|
605445
605853
|
`));
|
|
605446
605854
|
process.exit(0);
|
|
605447
605855
|
}
|
|
605448
605856
|
if (latestVersion) {
|
|
605449
|
-
writeToStdout(`New version available: ${latestVersion} (current: 1.4.
|
|
605857
|
+
writeToStdout(`New version available: ${latestVersion} (current: 1.4.480)
|
|
605450
605858
|
`);
|
|
605451
605859
|
}
|
|
605452
605860
|
writeToStdout(`Downloading and installing update...
|
|
@@ -605461,13 +605869,13 @@ Rayu CLI is up to date (1.4.479)
|
|
|
605461
605869
|
return;
|
|
605462
605870
|
}
|
|
605463
605871
|
writeToStdout(source_default.green(`
|
|
605464
|
-
Rayu CLI is up to date (1.4.
|
|
605872
|
+
Rayu CLI is up to date (1.4.480)
|
|
605465
605873
|
`));
|
|
605466
605874
|
process.exit(0);
|
|
605467
605875
|
}
|
|
605468
605876
|
const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
|
|
605469
605877
|
writeToStdout(source_default.green(`
|
|
605470
|
-
Successfully updated from 1.4.
|
|
605878
|
+
Successfully updated from 1.4.480 to ${updatedTo}
|
|
605471
605879
|
`));
|
|
605472
605880
|
writeToStdout(`Restart your terminal to use the new version.
|
|
605473
605881
|
`);
|
|
@@ -605532,7 +605940,7 @@ async function removeDataDir(dir) {
|
|
|
605532
605940
|
async function uninstall(args = []) {
|
|
605533
605941
|
const yes = args.includes("--yes") || args.includes("-y");
|
|
605534
605942
|
const keepData = args.includes("--keep-data");
|
|
605535
|
-
writeToStdout(`Uninstalling Rayu CLI (${"1.4.
|
|
605943
|
+
writeToStdout(`Uninstalling Rayu CLI (${"1.4.480"})...
|
|
605536
605944
|
`);
|
|
605537
605945
|
writeToStdout(`Running: npm uninstall -g ${"@rayu-dev/rayu-cli"}
|
|
605538
605946
|
|
|
@@ -605543,30 +605951,17 @@ async function uninstall(args = []) {
|
|
|
605543
605951
|
process.stderr.write(source_default.red(`
|
|
605544
605952
|
Failed to uninstall ${"@rayu-dev/rayu-cli"}
|
|
605545
605953
|
`));
|
|
605546
|
-
|
|
605547
|
-
|
|
605954
|
+
const detail = describeNpmError(err2);
|
|
605955
|
+
if (detail)
|
|
605956
|
+
process.stderr.write(`${detail}
|
|
605548
605957
|
`);
|
|
605549
|
-
process.stderr.write(
|
|
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"}
|
|
605958
|
+
process.stderr.write(`${buildNpmRemediation("uninstall", "@rayu-dev/rayu-cli", err2)}
|
|
605558
605959
|
`);
|
|
605559
|
-
} else {
|
|
605560
|
-
process.stderr.write(`Or with sudo if you installed with elevated permissions:
|
|
605561
|
-
`);
|
|
605562
|
-
process.stderr.write(source_default.bold(` sudo npm uninstall -g ${"@rayu-dev/rayu-cli"}
|
|
605563
|
-
`));
|
|
605564
|
-
}
|
|
605565
605960
|
process.exit(1);
|
|
605566
605961
|
return;
|
|
605567
605962
|
}
|
|
605568
605963
|
writeToStdout(source_default.green(`
|
|
605569
|
-
Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.
|
|
605964
|
+
Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.4.480"}
|
|
605570
605965
|
`));
|
|
605571
605966
|
const configDir = getRayuConfigHomeDir();
|
|
605572
605967
|
const dataExists = existsSync28(configDir);
|
|
@@ -605612,10 +606007,10 @@ var exports_firstRun = {};
|
|
|
605612
606007
|
__export(exports_firstRun, {
|
|
605613
606008
|
showFirstRunWelcome: () => showFirstRunWelcome
|
|
605614
606009
|
});
|
|
605615
|
-
import { existsSync as existsSync29, mkdirSync as mkdirSync16, writeFileSync as
|
|
605616
|
-
import { join as
|
|
606010
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync16, writeFileSync as writeFileSync19 } from "node:fs";
|
|
606011
|
+
import { join as join157 } from "node:path";
|
|
605617
606012
|
function markerPath() {
|
|
605618
|
-
return
|
|
606013
|
+
return join157(getRayuConfigHomeDir(), ".installed");
|
|
605619
606014
|
}
|
|
605620
606015
|
function showFirstRunWelcome() {
|
|
605621
606016
|
try {
|
|
@@ -605649,7 +606044,7 @@ function showFirstRunWelcome() {
|
|
|
605649
606044
|
`);
|
|
605650
606045
|
try {
|
|
605651
606046
|
mkdirSync16(getRayuConfigHomeDir(), { recursive: true });
|
|
605652
|
-
|
|
606047
|
+
writeFileSync19(markerPath(), "1.4.480", "utf8");
|
|
605653
606048
|
} catch {}
|
|
605654
606049
|
}
|
|
605655
606050
|
var init_firstRun = __esm(() => {
|
|
@@ -621835,7 +622230,7 @@ async function initializeBetaTracing(resource) {
|
|
|
621835
622230
|
});
|
|
621836
622231
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
621837
622232
|
setLoggerProvider(loggerProvider);
|
|
621838
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.
|
|
622233
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.480");
|
|
621839
622234
|
setEventLogger(eventLogger);
|
|
621840
622235
|
process.on("beforeExit", async () => {
|
|
621841
622236
|
await loggerProvider?.forceFlush();
|
|
@@ -621875,7 +622270,7 @@ async function initializeTelemetry() {
|
|
|
621875
622270
|
const platform4 = getPlatform();
|
|
621876
622271
|
const baseAttributes = {
|
|
621877
622272
|
[import_semantic_conventions.ATTR_SERVICE_NAME]: "claude-code",
|
|
621878
|
-
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.
|
|
622273
|
+
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.4.480"
|
|
621879
622274
|
};
|
|
621880
622275
|
if (platform4 === "wsl") {
|
|
621881
622276
|
const wslVersion = getWslVersion();
|
|
@@ -621920,7 +622315,7 @@ async function initializeTelemetry() {
|
|
|
621920
622315
|
} catch {}
|
|
621921
622316
|
};
|
|
621922
622317
|
registerCleanup(shutdownTelemetry2);
|
|
621923
|
-
return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.
|
|
622318
|
+
return meterProvider2.getMeter("com.anthropic.claude_code", "1.4.480");
|
|
621924
622319
|
}
|
|
621925
622320
|
const meterProvider = new import_sdk_metrics2.MeterProvider({
|
|
621926
622321
|
resource,
|
|
@@ -621940,7 +622335,7 @@ async function initializeTelemetry() {
|
|
|
621940
622335
|
});
|
|
621941
622336
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
621942
622337
|
setLoggerProvider(loggerProvider);
|
|
621943
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.
|
|
622338
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.4.480");
|
|
621944
622339
|
setEventLogger(eventLogger);
|
|
621945
622340
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
621946
622341
|
process.on("beforeExit", async () => {
|
|
@@ -622002,7 +622397,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
622002
622397
|
}
|
|
622003
622398
|
};
|
|
622004
622399
|
registerCleanup(shutdownTelemetry);
|
|
622005
|
-
return meterProvider.getMeter("com.anthropic.claude_code", "1.4.
|
|
622400
|
+
return meterProvider.getMeter("com.anthropic.claude_code", "1.4.480");
|
|
622006
622401
|
}
|
|
622007
622402
|
async function flushTelemetry() {
|
|
622008
622403
|
const meterProvider = getMeterProvider();
|
|
@@ -623012,7 +623407,7 @@ var init_notifier = __esm(() => {
|
|
|
623012
623407
|
});
|
|
623013
623408
|
|
|
623014
623409
|
// src/services/preventSleep.ts
|
|
623015
|
-
import { spawn as
|
|
623410
|
+
import { spawn as spawn14 } from "child_process";
|
|
623016
623411
|
function startPreventSleep() {
|
|
623017
623412
|
refCount++;
|
|
623018
623413
|
if (refCount === 1) {
|
|
@@ -623070,7 +623465,7 @@ function spawnCaffeinate() {
|
|
|
623070
623465
|
});
|
|
623071
623466
|
}
|
|
623072
623467
|
try {
|
|
623073
|
-
caffeinateProcess =
|
|
623468
|
+
caffeinateProcess = spawn14("caffeinate", ["-i", "-t", String(CAFFEINATE_TIMEOUT_SECONDS)], {
|
|
623074
623469
|
stdio: "ignore"
|
|
623075
623470
|
});
|
|
623076
623471
|
caffeinateProcess.unref();
|
|
@@ -623504,7 +623899,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
623504
623899
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
623505
623900
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
623506
623901
|
betas: getSdkBetas(),
|
|
623507
|
-
claude_code_version: "1.4.
|
|
623902
|
+
claude_code_version: "1.4.480",
|
|
623508
623903
|
output_style: outputStyle2,
|
|
623509
623904
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
623510
623905
|
skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -624383,8 +624778,8 @@ var init_streamingMirror = __esm(() => {
|
|
|
624383
624778
|
|
|
624384
624779
|
// src/telegram/telegramBridge.ts
|
|
624385
624780
|
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
|
|
624387
|
-
import { join as
|
|
624781
|
+
import { closeSync as closeSync5, existsSync as existsSync30, openSync as openSync6, readFileSync as readFileSync30, unlinkSync as unlinkSync4, writeFileSync as writeFileSync20, writeSync as writeSync3 } from "fs";
|
|
624782
|
+
import { join as join158 } from "path";
|
|
624388
624783
|
function linkedChatId() {
|
|
624389
624784
|
return readTelegramConfig().linkedChatId;
|
|
624390
624785
|
}
|
|
@@ -624612,7 +625007,7 @@ async function registerCommandsWithTelegram(token) {
|
|
|
624612
625007
|
} catch {}
|
|
624613
625008
|
}
|
|
624614
625009
|
function lockFilePath() {
|
|
624615
|
-
return
|
|
625010
|
+
return join158(getRayuConfigHomeDir(), "telegram-bridge.lock");
|
|
624616
625011
|
}
|
|
624617
625012
|
function isPidAlive(pid) {
|
|
624618
625013
|
try {
|
|
@@ -624673,7 +625068,7 @@ function acquireBridgeLock() {
|
|
|
624673
625068
|
return false;
|
|
624674
625069
|
}
|
|
624675
625070
|
}
|
|
624676
|
-
|
|
625071
|
+
writeFileSync20(path27, content, { mode: 384 });
|
|
624677
625072
|
} catch {}
|
|
624678
625073
|
return true;
|
|
624679
625074
|
}
|
|
@@ -624685,7 +625080,7 @@ function updateHeartbeat() {
|
|
|
624685
625080
|
const raw = readFileSync30(path27, "utf8").trim();
|
|
624686
625081
|
const pid = parseInt(raw.split(":")[0] ?? "", 10);
|
|
624687
625082
|
if (pid === process.pid) {
|
|
624688
|
-
|
|
625083
|
+
writeFileSync20(path27, buildLockContent(), { mode: 384 });
|
|
624689
625084
|
}
|
|
624690
625085
|
} catch {}
|
|
624691
625086
|
}
|
|
@@ -631271,7 +631666,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
631271
631666
|
|
|
631272
631667
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
631273
631668
|
import { homedir as homedir36 } from "os";
|
|
631274
|
-
import { basename as basename52, join as
|
|
631669
|
+
import { basename as basename52, join as join159, sep as sep40 } from "path";
|
|
631275
631670
|
function isInRayuFolder(filePath) {
|
|
631276
631671
|
const absolutePath = expandPath(filePath);
|
|
631277
631672
|
const rayuFolderPath = expandPath(`${getOriginalCwd()}/.rayu`);
|
|
@@ -631281,7 +631676,7 @@ function isInRayuFolder(filePath) {
|
|
|
631281
631676
|
}
|
|
631282
631677
|
function isInGlobalRayuFolder(filePath) {
|
|
631283
631678
|
const absolutePath = expandPath(filePath);
|
|
631284
|
-
const globalRayuFolderPath =
|
|
631679
|
+
const globalRayuFolderPath = join159(homedir36(), ".rayu");
|
|
631285
631680
|
const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
|
|
631286
631681
|
const normalizedGlobalRayuFolderPath = normalizeCaseForComparison2(globalRayuFolderPath);
|
|
631287
631682
|
return normalizedAbsolutePath.startsWith(normalizedGlobalRayuFolderPath + sep40.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalRayuFolderPath + "/");
|
|
@@ -639878,7 +640273,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
639878
640273
|
function getSemverPart(version3) {
|
|
639879
640274
|
return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
|
|
639880
640275
|
}
|
|
639881
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.4.
|
|
640276
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.4.480") {
|
|
639882
640277
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react217.useState(() => getSemverPart(initialVersion));
|
|
639883
640278
|
if (!updatedVersion) {
|
|
639884
640279
|
return null;
|
|
@@ -639918,7 +640313,7 @@ function AutoUpdater({
|
|
|
639918
640313
|
return;
|
|
639919
640314
|
}
|
|
639920
640315
|
if (false) {}
|
|
639921
|
-
const currentVersion = "1.4.
|
|
640316
|
+
const currentVersion = "1.4.480";
|
|
639922
640317
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
639923
640318
|
let latestVersion = await getLatestVersion(channel2);
|
|
639924
640319
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -640131,12 +640526,12 @@ function NativeAutoUpdater({
|
|
|
640131
640526
|
logEvent("tengu_native_auto_updater_start", {});
|
|
640132
640527
|
try {
|
|
640133
640528
|
const maxVersion = await getMaxVersion();
|
|
640134
|
-
if (maxVersion && gt("1.4.
|
|
640529
|
+
if (maxVersion && gt("1.4.480", maxVersion)) {
|
|
640135
640530
|
const msg = await getMaxVersionMessage();
|
|
640136
640531
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
640137
640532
|
}
|
|
640138
640533
|
const result = await installLatest(channel2);
|
|
640139
|
-
const currentVersion = "1.4.
|
|
640534
|
+
const currentVersion = "1.4.480";
|
|
640140
640535
|
const latencyMs = Date.now() - startTime2;
|
|
640141
640536
|
if (result.lockFailed) {
|
|
640142
640537
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -640273,17 +640668,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
640273
640668
|
const maxVersion = await getMaxVersion();
|
|
640274
640669
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
640275
640670
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
640276
|
-
if (gte("1.4.
|
|
640277
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.
|
|
640671
|
+
if (gte("1.4.480", maxVersion)) {
|
|
640672
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.4.480"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
640278
640673
|
setUpdateAvailable(false);
|
|
640279
640674
|
return;
|
|
640280
640675
|
}
|
|
640281
640676
|
latest = maxVersion;
|
|
640282
640677
|
}
|
|
640283
|
-
const hasUpdate = latest && !gte("1.4.
|
|
640678
|
+
const hasUpdate = latest && !gte("1.4.480", latest) && !shouldSkipVersion(latest);
|
|
640284
640679
|
setUpdateAvailable(!!hasUpdate);
|
|
640285
640680
|
if (hasUpdate) {
|
|
640286
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.
|
|
640681
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.4.480"} -> ${latest}`);
|
|
640287
640682
|
}
|
|
640288
640683
|
};
|
|
640289
640684
|
$3[0] = t1;
|
|
@@ -640317,7 +640712,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
640317
640712
|
wrap: "truncate",
|
|
640318
640713
|
children: [
|
|
640319
640714
|
"currentVersion: ",
|
|
640320
|
-
"1.4.
|
|
640715
|
+
"1.4.480"
|
|
640321
640716
|
]
|
|
640322
640717
|
});
|
|
640323
640718
|
$3[3] = verbose;
|
|
@@ -648481,7 +648876,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
648481
648876
|
project_dir: getOriginalCwd(),
|
|
648482
648877
|
added_dirs: addedDirs
|
|
648483
648878
|
},
|
|
648484
|
-
version: "1.4.
|
|
648879
|
+
version: "1.4.480",
|
|
648485
648880
|
output_style: {
|
|
648486
648881
|
name: outputStyleName
|
|
648487
648882
|
},
|
|
@@ -650660,7 +651055,7 @@ var init_user = __esm(() => {
|
|
|
650660
651055
|
deviceId,
|
|
650661
651056
|
sessionId: getSessionId(),
|
|
650662
651057
|
email: getEmail(),
|
|
650663
|
-
appVersion: "1.4.
|
|
651058
|
+
appVersion: "1.4.480",
|
|
650664
651059
|
platform: getHostPlatformForAnalytics(),
|
|
650665
651060
|
organizationUuid,
|
|
650666
651061
|
accountUuid,
|
|
@@ -654697,9 +655092,9 @@ function initSkillImprovement() {
|
|
|
654697
655092
|
async function applySkillImprovement(skillName, updates) {
|
|
654698
655093
|
if (!skillName)
|
|
654699
655094
|
return;
|
|
654700
|
-
const { join:
|
|
655095
|
+
const { join: join160 } = await import("path");
|
|
654701
655096
|
const fs15 = await import("fs/promises");
|
|
654702
|
-
const filePath =
|
|
655097
|
+
const filePath = join160(getCwd(), ".rayu", "skills", skillName, "SKILL.md");
|
|
654703
655098
|
let currentContent;
|
|
654704
655099
|
try {
|
|
654705
655100
|
currentContent = await fs15.readFile(filePath, "utf-8");
|
|
@@ -654850,7 +655245,7 @@ function useMoreRight(_args) {
|
|
|
654850
655245
|
}
|
|
654851
655246
|
|
|
654852
655247
|
// src/utils/cleanup.ts
|
|
654853
|
-
import { join as
|
|
655248
|
+
import { join as join160 } from "path";
|
|
654854
655249
|
function getCutoffDate() {
|
|
654855
655250
|
const settings = getSettings_DEPRECATED() || {};
|
|
654856
655251
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -654875,7 +655270,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
654875
655270
|
try {
|
|
654876
655271
|
const timestamp = convertFileNameToDate(file2.name);
|
|
654877
655272
|
if (timestamp < cutoffDate) {
|
|
654878
|
-
await getFsImplementation().unlink(
|
|
655273
|
+
await getFsImplementation().unlink(join160(dirPath, file2.name));
|
|
654879
655274
|
if (isMessagePath) {
|
|
654880
655275
|
result.messages++;
|
|
654881
655276
|
} else {
|
|
@@ -654906,7 +655301,7 @@ async function cleanupOldMessageFiles() {
|
|
|
654906
655301
|
} catch {
|
|
654907
655302
|
return result;
|
|
654908
655303
|
}
|
|
654909
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
655304
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join160(baseCachePath, dirent.name));
|
|
654910
655305
|
for (const mcpLogDir of mcpLogDirs) {
|
|
654911
655306
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
654912
655307
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -654945,7 +655340,7 @@ async function cleanupOldSessionFiles() {
|
|
|
654945
655340
|
for (const projectDirent of projectDirents) {
|
|
654946
655341
|
if (!projectDirent.isDirectory())
|
|
654947
655342
|
continue;
|
|
654948
|
-
const projectDir =
|
|
655343
|
+
const projectDir = join160(projectsDir, projectDirent.name);
|
|
654949
655344
|
let entries;
|
|
654950
655345
|
try {
|
|
654951
655346
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -654959,15 +655354,15 @@ async function cleanupOldSessionFiles() {
|
|
|
654959
655354
|
continue;
|
|
654960
655355
|
}
|
|
654961
655356
|
try {
|
|
654962
|
-
if (await unlinkIfOld(
|
|
655357
|
+
if (await unlinkIfOld(join160(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
654963
655358
|
result.messages++;
|
|
654964
655359
|
}
|
|
654965
655360
|
} catch {
|
|
654966
655361
|
result.errors++;
|
|
654967
655362
|
}
|
|
654968
655363
|
} else if (entry.isDirectory()) {
|
|
654969
|
-
const sessionDir =
|
|
654970
|
-
const toolResultsDir =
|
|
655364
|
+
const sessionDir = join160(projectDir, entry.name);
|
|
655365
|
+
const toolResultsDir = join160(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
654971
655366
|
let toolDirs;
|
|
654972
655367
|
try {
|
|
654973
655368
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -654978,14 +655373,14 @@ async function cleanupOldSessionFiles() {
|
|
|
654978
655373
|
for (const toolEntry of toolDirs) {
|
|
654979
655374
|
if (toolEntry.isFile()) {
|
|
654980
655375
|
try {
|
|
654981
|
-
if (await unlinkIfOld(
|
|
655376
|
+
if (await unlinkIfOld(join160(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
654982
655377
|
result.messages++;
|
|
654983
655378
|
}
|
|
654984
655379
|
} catch {
|
|
654985
655380
|
result.errors++;
|
|
654986
655381
|
}
|
|
654987
655382
|
} else if (toolEntry.isDirectory()) {
|
|
654988
|
-
const toolDirPath =
|
|
655383
|
+
const toolDirPath = join160(toolResultsDir, toolEntry.name);
|
|
654989
655384
|
let toolFiles;
|
|
654990
655385
|
try {
|
|
654991
655386
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -654996,7 +655391,7 @@ async function cleanupOldSessionFiles() {
|
|
|
654996
655391
|
if (!tf.isFile())
|
|
654997
655392
|
continue;
|
|
654998
655393
|
try {
|
|
654999
|
-
if (await unlinkIfOld(
|
|
655394
|
+
if (await unlinkIfOld(join160(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
655000
655395
|
result.messages++;
|
|
655001
655396
|
}
|
|
655002
655397
|
} catch {
|
|
@@ -655028,7 +655423,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
655028
655423
|
if (!dirent.isFile() || !dirent.name.endsWith(extension2))
|
|
655029
655424
|
continue;
|
|
655030
655425
|
try {
|
|
655031
|
-
if (await unlinkIfOld(
|
|
655426
|
+
if (await unlinkIfOld(join160(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
655032
655427
|
result.messages++;
|
|
655033
655428
|
}
|
|
655034
655429
|
} catch {
|
|
@@ -655041,7 +655436,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
655041
655436
|
return result;
|
|
655042
655437
|
}
|
|
655043
655438
|
function cleanupOldPlanFiles() {
|
|
655044
|
-
const plansDir =
|
|
655439
|
+
const plansDir = join160(getRayuConfigHomeDir(), "plans");
|
|
655045
655440
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
655046
655441
|
}
|
|
655047
655442
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -655050,14 +655445,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
655050
655445
|
const fsImpl = getFsImplementation();
|
|
655051
655446
|
try {
|
|
655052
655447
|
const configDir = getRayuConfigHomeDir();
|
|
655053
|
-
const fileHistoryStorageDir =
|
|
655448
|
+
const fileHistoryStorageDir = join160(configDir, "file-history");
|
|
655054
655449
|
let dirents;
|
|
655055
655450
|
try {
|
|
655056
655451
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
655057
655452
|
} catch {
|
|
655058
655453
|
return result;
|
|
655059
655454
|
}
|
|
655060
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
655455
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join160(fileHistoryStorageDir, dirent.name));
|
|
655061
655456
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
655062
655457
|
try {
|
|
655063
655458
|
const stats3 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -655084,14 +655479,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
655084
655479
|
const fsImpl = getFsImplementation();
|
|
655085
655480
|
try {
|
|
655086
655481
|
const configDir = getRayuConfigHomeDir();
|
|
655087
|
-
const sessionEnvBaseDir =
|
|
655482
|
+
const sessionEnvBaseDir = join160(configDir, "session-env");
|
|
655088
655483
|
let dirents;
|
|
655089
655484
|
try {
|
|
655090
655485
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
655091
655486
|
} catch {
|
|
655092
655487
|
return result;
|
|
655093
655488
|
}
|
|
655094
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
655489
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join160(sessionEnvBaseDir, dirent.name));
|
|
655095
655490
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
655096
655491
|
try {
|
|
655097
655492
|
const stats3 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -655113,7 +655508,7 @@ async function cleanupOldDebugLogs() {
|
|
|
655113
655508
|
const cutoffDate = getCutoffDate();
|
|
655114
655509
|
const result = { messages: 0, errors: 0 };
|
|
655115
655510
|
const fsImpl = getFsImplementation();
|
|
655116
|
-
const debugDir =
|
|
655511
|
+
const debugDir = join160(getRayuConfigHomeDir(), "debug");
|
|
655117
655512
|
let dirents;
|
|
655118
655513
|
try {
|
|
655119
655514
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -655125,7 +655520,7 @@ async function cleanupOldDebugLogs() {
|
|
|
655125
655520
|
continue;
|
|
655126
655521
|
}
|
|
655127
655522
|
try {
|
|
655128
|
-
if (await unlinkIfOld(
|
|
655523
|
+
if (await unlinkIfOld(join160(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
655129
655524
|
result.messages++;
|
|
655130
655525
|
}
|
|
655131
655526
|
} catch {
|
|
@@ -658437,7 +658832,7 @@ __export(exports_asciicast, {
|
|
|
658437
658832
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
658438
658833
|
});
|
|
658439
658834
|
import { appendFile as appendFile5, rename as rename13 } from "fs/promises";
|
|
658440
|
-
import { basename as basename61, dirname as dirname67, join as
|
|
658835
|
+
import { basename as basename61, dirname as dirname67, join as join162 } from "path";
|
|
658441
658836
|
function getRecordFilePath() {
|
|
658442
658837
|
if (recordingState.filePath !== null) {
|
|
658443
658838
|
return recordingState.filePath;
|
|
@@ -658448,10 +658843,10 @@ function getRecordFilePath() {
|
|
|
658448
658843
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
|
|
658449
658844
|
return null;
|
|
658450
658845
|
}
|
|
658451
|
-
const projectsDir =
|
|
658452
|
-
const projectDir =
|
|
658846
|
+
const projectsDir = join162(getRayuConfigHomeDir(), "projects");
|
|
658847
|
+
const projectDir = join162(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
658453
658848
|
recordingState.timestamp = Date.now();
|
|
658454
|
-
recordingState.filePath =
|
|
658849
|
+
recordingState.filePath = join162(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
658455
658850
|
return recordingState.filePath;
|
|
658456
658851
|
}
|
|
658457
658852
|
function _resetRecordingStateForTesting() {
|
|
@@ -658460,13 +658855,13 @@ function _resetRecordingStateForTesting() {
|
|
|
658460
658855
|
}
|
|
658461
658856
|
function getSessionRecordingPaths() {
|
|
658462
658857
|
const sessionId = getSessionId();
|
|
658463
|
-
const projectsDir =
|
|
658464
|
-
const projectDir =
|
|
658858
|
+
const projectsDir = join162(getRayuConfigHomeDir(), "projects");
|
|
658859
|
+
const projectDir = join162(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
658465
658860
|
try {
|
|
658466
658861
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
658467
658862
|
const names = typeof entries[0] === "string" ? entries : entries.map((e2) => e2.name);
|
|
658468
658863
|
const files3 = names.filter((f3) => f3.startsWith(sessionId) && f3.endsWith(".cast")).sort();
|
|
658469
|
-
return files3.map((f3) =>
|
|
658864
|
+
return files3.map((f3) => join162(projectDir, f3));
|
|
658470
658865
|
} catch {
|
|
658471
658866
|
return [];
|
|
658472
658867
|
}
|
|
@@ -658476,9 +658871,9 @@ async function renameRecordingForSession() {
|
|
|
658476
658871
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
658477
658872
|
return;
|
|
658478
658873
|
}
|
|
658479
|
-
const projectsDir =
|
|
658480
|
-
const projectDir =
|
|
658481
|
-
const newPath =
|
|
658874
|
+
const projectsDir = join162(getRayuConfigHomeDir(), "projects");
|
|
658875
|
+
const projectDir = join162(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
658876
|
+
const newPath = join162(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
658482
658877
|
if (oldPath === newPath) {
|
|
658483
658878
|
return;
|
|
658484
658879
|
}
|
|
@@ -660099,7 +660494,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
660099
660494
|
} catch {}
|
|
660100
660495
|
const data = {
|
|
660101
660496
|
trigger,
|
|
660102
|
-
version: "1.4.
|
|
660497
|
+
version: "1.4.480",
|
|
660103
660498
|
platform: process.platform,
|
|
660104
660499
|
transcript,
|
|
660105
660500
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -661321,7 +661716,7 @@ var init_useAwaySummary = __esm(() => {
|
|
|
661321
661716
|
});
|
|
661322
661717
|
|
|
661323
661718
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
661324
|
-
import { join as
|
|
661719
|
+
import { join as join163 } from "path";
|
|
661325
661720
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
661326
661721
|
return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
661327
661722
|
}
|
|
@@ -661404,7 +661799,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
661404
661799
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
661405
661800
|
}
|
|
661406
661801
|
const cacheDir = getMarketplacesCacheDir();
|
|
661407
|
-
const installLocation =
|
|
661802
|
+
const installLocation = join163(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
661408
661803
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
661409
661804
|
if (gcsSha !== null) {
|
|
661410
661805
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -661661,7 +662056,7 @@ var init_tipHistory = __esm(() => {
|
|
|
661661
662056
|
|
|
661662
662057
|
// src/utils/desktopDeepLink.ts
|
|
661663
662058
|
import { readdir as readdir30 } from "fs/promises";
|
|
661664
|
-
import { join as
|
|
662059
|
+
import { join as join164 } from "path";
|
|
661665
662060
|
function isDevMode() {
|
|
661666
662061
|
if (false) {}
|
|
661667
662062
|
const pathsToCheck = [process.argv[1] || "", process.execPath || ""];
|
|
@@ -661722,7 +662117,7 @@ async function getDesktopVersion() {
|
|
|
661722
662117
|
if (!localAppData) {
|
|
661723
662118
|
return null;
|
|
661724
662119
|
}
|
|
661725
|
-
const installDir =
|
|
662120
|
+
const installDir = join164(localAppData, "AnthropicClaude");
|
|
661726
662121
|
try {
|
|
661727
662122
|
const entries = await readdir30(installDir);
|
|
661728
662123
|
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 +665111,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
664716
665111
|
});
|
|
664717
665112
|
|
|
664718
665113
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
664719
|
-
import { extname as extname15, join as
|
|
665114
|
+
import { extname as extname15, join as join165 } from "path";
|
|
664720
665115
|
function useLspPluginRecommendation() {
|
|
664721
665116
|
const $3 = import_compiler_runtime328.c(12);
|
|
664722
665117
|
const trackedFiles = useAppState(_temp201);
|
|
@@ -664801,7 +665196,7 @@ function useLspPluginRecommendation() {
|
|
|
664801
665196
|
case "yes": {
|
|
664802
665197
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
664803
665198
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
664804
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
665199
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join165(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
664805
665200
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
664806
665201
|
const settings = getSettingsForSource("userSettings");
|
|
664807
665202
|
updateSettingsForSource("userSettings", {
|
|
@@ -667569,8 +667964,8 @@ var exports_REPL = {};
|
|
|
667569
667964
|
__export(exports_REPL, {
|
|
667570
667965
|
REPL: () => REPL
|
|
667571
667966
|
});
|
|
667572
|
-
import { dirname as dirname69, join as
|
|
667573
|
-
import { tmpdir as
|
|
667967
|
+
import { dirname as dirname69, join as join166 } from "path";
|
|
667968
|
+
import { tmpdir as tmpdir17 } from "os";
|
|
667574
667969
|
import { writeFile as writeFile45 } from "fs/promises";
|
|
667575
667970
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
667576
667971
|
function TranscriptModeFooter(t0) {
|
|
@@ -670171,7 +670566,7 @@ Note: ctrl + z now suspends RAYU, ctrl + _ undoes input.
|
|
|
670171
670566
|
const w2 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
670172
670567
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w2);
|
|
670173
670568
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
670174
|
-
const path29 =
|
|
670569
|
+
const path29 = join166(tmpdir17(), `cc-transcript-${Date.now()}.txt`);
|
|
670175
670570
|
await writeFile45(path29, text2);
|
|
670176
670571
|
const opened = openFileInExternalEditor(path29);
|
|
670177
670572
|
setStatus(opened ? `opening ${path29}` : `wrote ${path29} · no $VISUAL/$EDITOR set`);
|
|
@@ -672068,7 +672463,7 @@ function WelcomeV2() {
|
|
|
672068
672463
|
dimColor: true,
|
|
672069
672464
|
children: [
|
|
672070
672465
|
"v",
|
|
672071
|
-
"1.4.
|
|
672466
|
+
"1.4.480"
|
|
672072
672467
|
]
|
|
672073
672468
|
})
|
|
672074
672469
|
]
|
|
@@ -673075,7 +673470,7 @@ function completeOnboarding() {
|
|
|
673075
673470
|
saveGlobalConfig((current) => ({
|
|
673076
673471
|
...current,
|
|
673077
673472
|
hasCompletedOnboarding: true,
|
|
673078
|
-
lastOnboardingVersion: "1.4.
|
|
673473
|
+
lastOnboardingVersion: "1.4.480"
|
|
673079
673474
|
}));
|
|
673080
673475
|
}
|
|
673081
673476
|
function showDialog(root2, renderer) {
|
|
@@ -677959,12 +678354,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
677959
678354
|
});
|
|
677960
678355
|
|
|
677961
678356
|
// src/utils/errorLogSink.ts
|
|
677962
|
-
import { dirname as dirname71, join as
|
|
678357
|
+
import { dirname as dirname71, join as join167 } from "path";
|
|
677963
678358
|
function getErrorsPath() {
|
|
677964
|
-
return
|
|
678359
|
+
return join167(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
677965
678360
|
}
|
|
677966
678361
|
function getMCPLogsPath(serverName) {
|
|
677967
|
-
return
|
|
678362
|
+
return join167(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
677968
678363
|
}
|
|
677969
678364
|
function createJsonlWriter(options) {
|
|
677970
678365
|
const writer = createBufferedWriter(options);
|
|
@@ -678008,7 +678403,7 @@ function appendToLog(path29, message) {
|
|
|
678008
678403
|
cwd: getFsImplementation().cwd(),
|
|
678009
678404
|
userType: "external",
|
|
678010
678405
|
sessionId: getSessionId(),
|
|
678011
|
-
version: "1.4.
|
|
678406
|
+
version: "1.4.480"
|
|
678012
678407
|
};
|
|
678013
678408
|
getLogWriter(path29).write(messageWithTimestamp);
|
|
678014
678409
|
}
|
|
@@ -678299,7 +678694,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
678299
678694
|
// src/utils/iTermBackup.ts
|
|
678300
678695
|
import { copyFile as copyFile12, stat as stat47 } from "fs/promises";
|
|
678301
678696
|
import { homedir as homedir38 } from "os";
|
|
678302
|
-
import { join as
|
|
678697
|
+
import { join as join168 } from "path";
|
|
678303
678698
|
function markITerm2SetupComplete() {
|
|
678304
678699
|
saveGlobalConfig((current) => ({
|
|
678305
678700
|
...current,
|
|
@@ -678314,7 +678709,7 @@ function getIterm2RecoveryInfo() {
|
|
|
678314
678709
|
};
|
|
678315
678710
|
}
|
|
678316
678711
|
function getITerm2PlistPath() {
|
|
678317
|
-
return
|
|
678712
|
+
return join168(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
678318
678713
|
}
|
|
678319
678714
|
async function checkAndRestoreITerm2Backup() {
|
|
678320
678715
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -681807,7 +682202,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
681807
682202
|
// src/bridge/inboundAttachments.ts
|
|
681808
682203
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
681809
682204
|
import { mkdir as mkdir43, writeFile as writeFile47 } from "fs/promises";
|
|
681810
|
-
import { basename as basename62, join as
|
|
682205
|
+
import { basename as basename62, join as join169 } from "path";
|
|
681811
682206
|
function debug3(msg) {
|
|
681812
682207
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
681813
682208
|
}
|
|
@@ -681823,7 +682218,7 @@ function sanitizeFileName(name) {
|
|
|
681823
682218
|
return base2 || "attachment";
|
|
681824
682219
|
}
|
|
681825
682220
|
function uploadsDir() {
|
|
681826
|
-
return
|
|
682221
|
+
return join169(getRayuConfigHomeDir(), "uploads", getSessionId());
|
|
681827
682222
|
}
|
|
681828
682223
|
async function resolveOne(att) {
|
|
681829
682224
|
const token = getBridgeAccessToken();
|
|
@@ -681852,7 +682247,7 @@ async function resolveOne(att) {
|
|
|
681852
682247
|
const safeName = sanitizeFileName(att.file_name);
|
|
681853
682248
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
681854
682249
|
const dir = uploadsDir();
|
|
681855
|
-
const outPath =
|
|
682250
|
+
const outPath = join169(dir, `${prefix}-${safeName}`);
|
|
681856
682251
|
try {
|
|
681857
682252
|
await mkdir43(dir, { recursive: true });
|
|
681858
682253
|
await writeFile47(outPath, data);
|
|
@@ -681952,7 +682347,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
681952
682347
|
|
|
681953
682348
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
681954
682349
|
import { readFile as readFile54 } from "fs/promises";
|
|
681955
|
-
import { join as
|
|
682350
|
+
import { join as join170 } from "path";
|
|
681956
682351
|
async function readZipCacheKnownMarketplaces() {
|
|
681957
682352
|
try {
|
|
681958
682353
|
const content = await readFile54(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -681977,13 +682372,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
681977
682372
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
681978
682373
|
if (content !== null) {
|
|
681979
682374
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
681980
|
-
await atomicWriteToZipCache(
|
|
682375
|
+
await atomicWriteToZipCache(join170(zipCachePath, relPath), content);
|
|
681981
682376
|
}
|
|
681982
682377
|
}
|
|
681983
682378
|
async function readMarketplaceJsonContent(dir) {
|
|
681984
682379
|
const candidates = [
|
|
681985
|
-
|
|
681986
|
-
|
|
682380
|
+
join170(dir, ".claude-plugin", "marketplace.json"),
|
|
682381
|
+
join170(dir, "marketplace.json"),
|
|
681987
682382
|
dir
|
|
681988
682383
|
];
|
|
681989
682384
|
for (const candidate of candidates) {
|
|
@@ -682113,8 +682508,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
682113
682508
|
}
|
|
682114
682509
|
async function checkEnvLessBridgeMinVersion() {
|
|
682115
682510
|
const cfg = await getEnvLessBridgeConfig();
|
|
682116
|
-
if (cfg.min_version && lt("1.4.
|
|
682117
|
-
return `Your version of RAYU (${"1.4.
|
|
682511
|
+
if (cfg.min_version && lt("1.4.480", cfg.min_version)) {
|
|
682512
|
+
return `Your version of RAYU (${"1.4.480"}) is too old for Remote Control.
|
|
682118
682513
|
Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
|
|
682119
682514
|
}
|
|
682120
682515
|
return null;
|
|
@@ -682441,9 +682836,9 @@ __export(exports_bridgePointer, {
|
|
|
682441
682836
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
682442
682837
|
});
|
|
682443
682838
|
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
|
|
682839
|
+
import { dirname as dirname72, join as join171 } from "path";
|
|
682445
682840
|
function getBridgePointerPath(dir) {
|
|
682446
|
-
return
|
|
682841
|
+
return join171(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
682447
682842
|
}
|
|
682448
682843
|
async function writeBridgePointer(dir, pointer) {
|
|
682449
682844
|
const path29 = getBridgePointerPath(dir);
|
|
@@ -682587,7 +682982,7 @@ async function initBridgeCore(params) {
|
|
|
682587
682982
|
const rawApi = createBridgeApiClient({
|
|
682588
682983
|
baseUrl,
|
|
682589
682984
|
getAccessToken,
|
|
682590
|
-
runnerVersion: "1.4.
|
|
682985
|
+
runnerVersion: "1.4.480",
|
|
682591
682986
|
onDebug: logForDebugging,
|
|
682592
682987
|
onAuth401,
|
|
682593
682988
|
getTrustedDeviceToken
|
|
@@ -687942,7 +688337,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
|
|
|
687942
688337
|
setCwd(cwd3);
|
|
687943
688338
|
const server = new Server({
|
|
687944
688339
|
name: "claude/tengu",
|
|
687945
|
-
version: "1.4.
|
|
688340
|
+
version: "1.4.480"
|
|
687946
688341
|
}, {
|
|
687947
688342
|
capabilities: {
|
|
687948
688343
|
tools: {}
|
|
@@ -688924,12 +689319,12 @@ __export(exports_install, {
|
|
|
688924
689319
|
install: () => install
|
|
688925
689320
|
});
|
|
688926
689321
|
import { homedir as homedir39 } from "node:os";
|
|
688927
|
-
import { join as
|
|
689322
|
+
import { join as join172 } from "node:path";
|
|
688928
689323
|
function getInstallationPath2() {
|
|
688929
689324
|
const isWindows2 = env3.platform === "win32";
|
|
688930
689325
|
const homeDir = homedir39();
|
|
688931
689326
|
if (isWindows2) {
|
|
688932
|
-
const windowsPath =
|
|
689327
|
+
const windowsPath = join172(homeDir, ".local", "bin", "claude.exe");
|
|
688933
689328
|
return windowsPath.replace(/\//g, "\\");
|
|
688934
689329
|
}
|
|
688935
689330
|
return "~/.local/bin/claude";
|
|
@@ -690471,7 +690866,7 @@ ${customInstructions}` : customInstructions;
|
|
|
690471
690866
|
}
|
|
690472
690867
|
}
|
|
690473
690868
|
logForDiagnosticsNoPII("info", "started", {
|
|
690474
|
-
version: "1.4.
|
|
690869
|
+
version: "1.4.480",
|
|
690475
690870
|
is_native_binary: isInBundledMode()
|
|
690476
690871
|
});
|
|
690477
690872
|
registerCleanup(async () => {
|
|
@@ -691190,7 +691585,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
691190
691585
|
pendingHookMessages
|
|
691191
691586
|
}, renderAndRun);
|
|
691192
691587
|
}
|
|
691193
|
-
}).version(`1.4.
|
|
691588
|
+
}).version(`1.4.480 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
|
|
691194
691589
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
691195
691590
|
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
691591
|
if (canUserConfigureAdvisor()) {
|
|
@@ -691650,7 +692045,7 @@ if (false) {}
|
|
|
691650
692045
|
async function main2() {
|
|
691651
692046
|
const args = process.argv.slice(2);
|
|
691652
692047
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
691653
|
-
console.log(`${"1.4.
|
|
692048
|
+
console.log(`${"1.4.480"} (Rayu-CLI)`);
|
|
691654
692049
|
return;
|
|
691655
692050
|
}
|
|
691656
692051
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)) {
|