@rayu-dev/rayu-cli 1.3.443 → 1.3.444
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 +839 -675
- package/package.json +1 -1
package/dist/rayu.js
CHANGED
|
@@ -19134,7 +19134,7 @@ var init_contextPrepCache = __esm(() => {
|
|
|
19134
19134
|
});
|
|
19135
19135
|
|
|
19136
19136
|
// src/utils/curatedProviderModels.ts
|
|
19137
|
-
var DOUBLEWORD_MODELS, FUGU_MODELS, CURATED_PROVIDER_MODELS;
|
|
19137
|
+
var DOUBLEWORD_MODELS, FUGU_MODELS, GLM_MODELS, MINIMAX_MODELS, CURATED_PROVIDER_MODELS;
|
|
19138
19138
|
var init_curatedProviderModels = __esm(() => {
|
|
19139
19139
|
DOUBLEWORD_MODELS = [
|
|
19140
19140
|
"Qwen/Qwen3-14B-FP8",
|
|
@@ -19156,9 +19156,42 @@ var init_curatedProviderModels = __esm(() => {
|
|
|
19156
19156
|
"zai-org/GLM-5.1-FP8"
|
|
19157
19157
|
];
|
|
19158
19158
|
FUGU_MODELS = ["fugu", "fugu-ultra"];
|
|
19159
|
+
GLM_MODELS = [
|
|
19160
|
+
"glm-5.2",
|
|
19161
|
+
"glm-5.1",
|
|
19162
|
+
"glm-5",
|
|
19163
|
+
"glm-5-turbo",
|
|
19164
|
+
"glm-4.7",
|
|
19165
|
+
"glm-4.7-flash",
|
|
19166
|
+
"glm-4.7-flashx",
|
|
19167
|
+
"glm-4.6",
|
|
19168
|
+
"glm-4.5",
|
|
19169
|
+
"glm-4.5-air",
|
|
19170
|
+
"glm-4.5-x",
|
|
19171
|
+
"glm-4.5-airx",
|
|
19172
|
+
"glm-4.5-flash",
|
|
19173
|
+
"glm-4-32b-0414-128k",
|
|
19174
|
+
"glm-5v-turbo",
|
|
19175
|
+
"glm-4.6v",
|
|
19176
|
+
"glm-4.6v-flashx",
|
|
19177
|
+
"glm-4.6v-flash",
|
|
19178
|
+
"glm-4.5v"
|
|
19179
|
+
];
|
|
19180
|
+
MINIMAX_MODELS = [
|
|
19181
|
+
"MiniMax-M3",
|
|
19182
|
+
"MiniMax-M2.7",
|
|
19183
|
+
"MiniMax-M2.7-highspeed",
|
|
19184
|
+
"MiniMax-M2.5",
|
|
19185
|
+
"MiniMax-M2.5-highspeed",
|
|
19186
|
+
"MiniMax-M2.1",
|
|
19187
|
+
"MiniMax-M2.1-highspeed",
|
|
19188
|
+
"MiniMax-M2"
|
|
19189
|
+
];
|
|
19159
19190
|
CURATED_PROVIDER_MODELS = {
|
|
19160
19191
|
doubleword: DOUBLEWORD_MODELS,
|
|
19161
|
-
fugu: FUGU_MODELS
|
|
19192
|
+
fugu: FUGU_MODELS,
|
|
19193
|
+
glm: GLM_MODELS,
|
|
19194
|
+
minimax: MINIMAX_MODELS
|
|
19162
19195
|
};
|
|
19163
19196
|
});
|
|
19164
19197
|
|
|
@@ -35783,6 +35816,14 @@ var init_rayuProviders = __esm(() => {
|
|
|
35783
35816
|
{ id: "asia-southeast1", label: "Asia Southeast (Singapore) · asia-southeast1" }
|
|
35784
35817
|
];
|
|
35785
35818
|
PROVIDER_PRESETS = [
|
|
35819
|
+
{
|
|
35820
|
+
id: "anthropic",
|
|
35821
|
+
label: "Anthropic — Claude (console.anthropic.com API key) · native thinking + context",
|
|
35822
|
+
kind: "anthropic",
|
|
35823
|
+
defaultModel: "claude-sonnet-4-6",
|
|
35824
|
+
smallFastModel: "claude-haiku-4-5-20251001",
|
|
35825
|
+
envKeys: ["ANTHROPIC_API_KEY"]
|
|
35826
|
+
},
|
|
35786
35827
|
{
|
|
35787
35828
|
id: "nvidia",
|
|
35788
35829
|
label: "NVIDIA NIM (integrate.api.nvidia.com)",
|
|
@@ -35810,6 +35851,24 @@ var init_rayuProviders = __esm(() => {
|
|
|
35810
35851
|
smallFastModel: "deepseek-v4-flash",
|
|
35811
35852
|
envKeys: ["DEEPSEEK_API_KEY"]
|
|
35812
35853
|
},
|
|
35854
|
+
{
|
|
35855
|
+
id: "glm",
|
|
35856
|
+
label: "GLM — Z.ai (api.z.ai) · GLM-5.2 1M ctx / GLM-4.6 200K · native thinking",
|
|
35857
|
+
kind: "openai-compatible",
|
|
35858
|
+
baseURL: "https://api.z.ai/api/paas/v4",
|
|
35859
|
+
defaultModel: "glm-5.2",
|
|
35860
|
+
smallFastModel: "glm-4.5-air",
|
|
35861
|
+
envKeys: ["ZAI_API_KEY", "ZHIPUAI_API_KEY", "GLM_API_KEY"]
|
|
35862
|
+
},
|
|
35863
|
+
{
|
|
35864
|
+
id: "minimax",
|
|
35865
|
+
label: "MiniMax (api.minimax.io) · M3 1M ctx / M2 reasoning · native thinking",
|
|
35866
|
+
kind: "openai-compatible",
|
|
35867
|
+
baseURL: "https://api.minimax.io/v1",
|
|
35868
|
+
defaultModel: "MiniMax-M2",
|
|
35869
|
+
smallFastModel: "MiniMax-M2",
|
|
35870
|
+
envKeys: ["MINIMAX_API_KEY"]
|
|
35871
|
+
},
|
|
35813
35872
|
{
|
|
35814
35873
|
id: "kimi-moonshot",
|
|
35815
35874
|
label: "Kimi / Moonshot (api.moonshot.ai)",
|
|
@@ -35990,6 +36049,8 @@ var init_rayuProviders = __esm(() => {
|
|
|
35990
36049
|
nvidia: "NVIDIA",
|
|
35991
36050
|
doubleword: "Doubleword",
|
|
35992
36051
|
deepseek: "DeepSeek",
|
|
36052
|
+
glm: "GLM",
|
|
36053
|
+
minimax: "MiniMax",
|
|
35993
36054
|
"kimi-moonshot": "Kimi",
|
|
35994
36055
|
"kimi-for-code": "Kimi for Code",
|
|
35995
36056
|
fugu: "Fugu",
|
|
@@ -36799,7 +36860,8 @@ var init_rayuConfig = __esm(() => {
|
|
|
36799
36860
|
[/gemini[-.]?(1\.5|2|2\.5|3)/i, 1048576],
|
|
36800
36861
|
[/gemini/i, 1048576],
|
|
36801
36862
|
[/deepseek[-/]?v4[-/]?(flash|pro)/i, 1e6],
|
|
36802
|
-
[/minimax/i, 1e6],
|
|
36863
|
+
[/minimax[-_.]?m3/i, 1e6],
|
|
36864
|
+
[/glm-5\.2/i, 1e6],
|
|
36803
36865
|
[/fugu/i, 1e6],
|
|
36804
36866
|
[/kimi-k1|kimi.*long/i, 200000],
|
|
36805
36867
|
[/kimi[-_.]?k2[-_.]?(thinking|\d{4}|[5-9])/i, 256000],
|
|
@@ -36808,13 +36870,16 @@ var init_rayuConfig = __esm(() => {
|
|
|
36808
36870
|
[/jamba/i, 256000],
|
|
36809
36871
|
[/step[-_.]?3\.7/i, 256000],
|
|
36810
36872
|
[/claude/i, 200000],
|
|
36873
|
+
[/minimax/i, 204800],
|
|
36811
36874
|
[/deepseek-(chat|reasoner|v3|coder)/i, 131072],
|
|
36812
36875
|
[/deepseek-r1/i, 131072],
|
|
36813
36876
|
[/llama-3\.[1-3]|llama-3-70b|llama-4|nemotron/i, 131072],
|
|
36814
36877
|
[/qwen[-_.]?[23]|qwq/i, 131072],
|
|
36815
36878
|
[/gemma-[234]/i, 131072],
|
|
36816
36879
|
[/mixtral|mistral|ministral|codestral|devstral/i, 131072],
|
|
36817
|
-
[/glm-[
|
|
36880
|
+
[/glm-(4\.[56]v|5v)/i, 65536],
|
|
36881
|
+
[/glm-4\.[67]|glm-5/i, 200000],
|
|
36882
|
+
[/glm-4/i, 131072],
|
|
36818
36883
|
[/gpt-oss/i, 131072],
|
|
36819
36884
|
[/phi-[34]/i, 131072],
|
|
36820
36885
|
[/command-r|c4ai/i, 131072],
|
|
@@ -148302,7 +148367,7 @@ var init_auth = __esm(() => {
|
|
|
148302
148367
|
|
|
148303
148368
|
// src/utils/userAgent.ts
|
|
148304
148369
|
function getRayuUserAgent() {
|
|
148305
|
-
return `rayu/${"1.3.
|
|
148370
|
+
return `rayu/${"1.3.444"}`;
|
|
148306
148371
|
}
|
|
148307
148372
|
var getClaudeCodeUserAgent;
|
|
148308
148373
|
var init_userAgent = __esm(() => {
|
|
@@ -148328,7 +148393,7 @@ function getUserAgent() {
|
|
|
148328
148393
|
const clientApp = process.env.RAYU_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}` : "";
|
|
148329
148394
|
const workload = getWorkload();
|
|
148330
148395
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
148331
|
-
return `rayu/${"1.3.
|
|
148396
|
+
return `rayu/${"1.3.444"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
148332
148397
|
}
|
|
148333
148398
|
function getMCPUserAgent() {
|
|
148334
148399
|
const parts = [];
|
|
@@ -148342,7 +148407,7 @@ function getMCPUserAgent() {
|
|
|
148342
148407
|
parts.push(`client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}`);
|
|
148343
148408
|
}
|
|
148344
148409
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
148345
|
-
return `rayu/${"1.3.
|
|
148410
|
+
return `rayu/${"1.3.444"}${suffix}`;
|
|
148346
148411
|
}
|
|
148347
148412
|
function getWebFetchUserAgent() {
|
|
148348
148413
|
return `Rayu-User (${getRayuUserAgent()})`;
|
|
@@ -148465,7 +148530,7 @@ var init_user = __esm(() => {
|
|
|
148465
148530
|
deviceId,
|
|
148466
148531
|
sessionId: getSessionId(),
|
|
148467
148532
|
email: getEmail(),
|
|
148468
|
-
appVersion: "1.3.
|
|
148533
|
+
appVersion: "1.3.444",
|
|
148469
148534
|
platform: getHostPlatformForAnalytics(),
|
|
148470
148535
|
organizationUuid,
|
|
148471
148536
|
accountUuid,
|
|
@@ -165435,18 +165500,18 @@ function isUseRayuOAuthEnabled() {
|
|
|
165435
165500
|
const env6 = process.env.USE_RAYU_OAUTH;
|
|
165436
165501
|
if (env6 !== undefined && env6 !== "")
|
|
165437
165502
|
return isEnvTruthy(env6);
|
|
165438
|
-
return isEnvTruthy("
|
|
165503
|
+
return isEnvTruthy("true");
|
|
165439
165504
|
}
|
|
165440
165505
|
function getRayuApiBaseUrl() {
|
|
165441
|
-
const base2 = process.env.RAYU_API_URL || "
|
|
165506
|
+
const base2 = process.env.RAYU_API_URL || "https://yv1a421c60jt40wplrsy6tsu.159.223.65.23.sslip.io/api";
|
|
165442
165507
|
return base2.replace(/\/$/, "");
|
|
165443
165508
|
}
|
|
165444
165509
|
function getRayuWebBaseUrl() {
|
|
165445
|
-
const base2 = process.env.RAYU_WEB_URL || "
|
|
165510
|
+
const base2 = process.env.RAYU_WEB_URL || "https://k10i9pvfj8xxnocpcotds9zu.159.223.65.23.sslip.io";
|
|
165446
165511
|
return base2.replace(/\/$/, "");
|
|
165447
165512
|
}
|
|
165448
165513
|
function getRayuGatewayBaseUrl() {
|
|
165449
|
-
const base2 = process.env.RAYU_GATEWAY_URL || "
|
|
165514
|
+
const base2 = process.env.RAYU_GATEWAY_URL || "https://rgiaetulv4f5kov17vmo5gkn.159.223.65.23.sslip.io";
|
|
165450
165515
|
return base2.replace(/\/$/, "");
|
|
165451
165516
|
}
|
|
165452
165517
|
function sessionPath() {
|
|
@@ -165574,6 +165639,12 @@ function isGatewayRoutingEnabled() {
|
|
|
165574
165639
|
return isEnvTruthy(v);
|
|
165575
165640
|
return true;
|
|
165576
165641
|
}
|
|
165642
|
+
function isGatewayCallbackEnabled() {
|
|
165643
|
+
const v = process.env.RAYU_GATEWAY_CALLBACK;
|
|
165644
|
+
if (v !== undefined && v !== "")
|
|
165645
|
+
return isEnvTruthy(v);
|
|
165646
|
+
return true;
|
|
165647
|
+
}
|
|
165577
165648
|
function isRoutableKind(provider) {
|
|
165578
165649
|
switch (provider.kind) {
|
|
165579
165650
|
case "openai-compatible":
|
|
@@ -165645,17 +165716,20 @@ function makeGatewayRoutingFetch(provider, inner = globalThis.fetch) {
|
|
|
165645
165716
|
headers.set("X-Rayu-Token", token);
|
|
165646
165717
|
headers.set("X-Rayu-Upstream-URL", originalUrl);
|
|
165647
165718
|
headers.set("X-Rayu-Provider", provider.id);
|
|
165719
|
+
const callbackToDirect = isGatewayCallbackEnabled();
|
|
165648
165720
|
try {
|
|
165649
165721
|
const res = await inner(gatewayUrl, { ...init, headers });
|
|
165650
165722
|
if (res.headers.get(LIMIT_HEADER)) {
|
|
165651
165723
|
return res;
|
|
165652
165724
|
}
|
|
165653
165725
|
if (!res.headers.get(PROXIED_HEADER)) {
|
|
165654
|
-
return inner(input, init);
|
|
165726
|
+
return callbackToDirect ? inner(input, init) : res;
|
|
165655
165727
|
}
|
|
165656
165728
|
return res;
|
|
165657
|
-
} catch {
|
|
165658
|
-
|
|
165729
|
+
} catch (err) {
|
|
165730
|
+
if (callbackToDirect)
|
|
165731
|
+
return inner(input, init);
|
|
165732
|
+
throw err;
|
|
165659
165733
|
}
|
|
165660
165734
|
};
|
|
165661
165735
|
return wrapped;
|
|
@@ -182832,6 +182906,186 @@ var init_copilotClient = __esm(() => {
|
|
|
182832
182906
|
init_copilotAuth();
|
|
182833
182907
|
});
|
|
182834
182908
|
|
|
182909
|
+
// src/services/rayuAuth/rayuHostedProvider.ts
|
|
182910
|
+
function syncRayuHostedProvider(ent, opts) {
|
|
182911
|
+
try {
|
|
182912
|
+
const cfg = loadRayuConfig();
|
|
182913
|
+
const catalog = ent?.hostedModels ?? ent?.allowedModels ?? [];
|
|
182914
|
+
const entitled = ent?.allowedModels ?? [];
|
|
182915
|
+
const models = catalog.map((m2) => m2.code);
|
|
182916
|
+
const idx = cfg.providers.findIndex((p) => p.id === RAYU_HOSTED_PROVIDER_ID);
|
|
182917
|
+
if (models.length > 0) {
|
|
182918
|
+
const existing = idx >= 0 ? cfg.providers[idx] : undefined;
|
|
182919
|
+
const preferredCode = entitled[0]?.code ?? catalog[0]?.code;
|
|
182920
|
+
const provider = {
|
|
182921
|
+
...existing,
|
|
182922
|
+
id: RAYU_HOSTED_PROVIDER_ID,
|
|
182923
|
+
kind: "rayu-hosted",
|
|
182924
|
+
baseURL: rayuHostedBaseURL(),
|
|
182925
|
+
models,
|
|
182926
|
+
fetchedModels: models,
|
|
182927
|
+
defaultModel: existing?.defaultModel ?? preferredCode,
|
|
182928
|
+
smallFastModel: existing?.smallFastModel ?? preferredCode
|
|
182929
|
+
};
|
|
182930
|
+
if (idx >= 0)
|
|
182931
|
+
cfg.providers[idx] = provider;
|
|
182932
|
+
else
|
|
182933
|
+
cfg.providers.push(provider);
|
|
182934
|
+
if (opts?.activate && entitled.length > 0) {
|
|
182935
|
+
cfg.activeProvider = RAYU_HOSTED_PROVIDER_ID;
|
|
182936
|
+
}
|
|
182937
|
+
saveRayuConfig(cfg);
|
|
182938
|
+
return;
|
|
182939
|
+
}
|
|
182940
|
+
if (idx >= 0) {
|
|
182941
|
+
cfg.providers.splice(idx, 1);
|
|
182942
|
+
if (cfg.activeProvider === RAYU_HOSTED_PROVIDER_ID) {
|
|
182943
|
+
cfg.activeProvider = cfg.providers[0]?.id;
|
|
182944
|
+
}
|
|
182945
|
+
saveRayuConfig(cfg);
|
|
182946
|
+
}
|
|
182947
|
+
} catch {}
|
|
182948
|
+
}
|
|
182949
|
+
var init_rayuHostedProvider = __esm(() => {
|
|
182950
|
+
init_rayuConfig();
|
|
182951
|
+
init_rayuProviders();
|
|
182952
|
+
init_rayuHostedAuth();
|
|
182953
|
+
});
|
|
182954
|
+
|
|
182955
|
+
// src/services/rayuAuth/rayuEntitlements.ts
|
|
182956
|
+
var exports_rayuEntitlements = {};
|
|
182957
|
+
__export(exports_rayuEntitlements, {
|
|
182958
|
+
refreshRayuEntitlements: () => refreshRayuEntitlements,
|
|
182959
|
+
rayuFeatureAllowed: () => rayuFeatureAllowed,
|
|
182960
|
+
isHostedModelEntitled: () => isHostedModelEntitled,
|
|
182961
|
+
hostedModelUpgradeMessage: () => hostedModelUpgradeMessage,
|
|
182962
|
+
getCachedEntitlements: () => getCachedEntitlements,
|
|
182963
|
+
clearRayuEntitlements: () => clearRayuEntitlements,
|
|
182964
|
+
_setRayuEntitlementsForTesting: () => _setRayuEntitlementsForTesting,
|
|
182965
|
+
_resetRayuEntitlementsForTesting: () => _resetRayuEntitlementsForTesting
|
|
182966
|
+
});
|
|
182967
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync7, readFileSync as readFileSync12, rmSync as rmSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
182968
|
+
import { join as join30 } from "path";
|
|
182969
|
+
function entitlementsPath() {
|
|
182970
|
+
return join30(getRayuConfigHomeDir(), FILE);
|
|
182971
|
+
}
|
|
182972
|
+
function currentUserId() {
|
|
182973
|
+
return readRayuSession()?.user?.id ?? null;
|
|
182974
|
+
}
|
|
182975
|
+
function loadFromDiskOnce() {
|
|
182976
|
+
if (loadedFromDisk)
|
|
182977
|
+
return;
|
|
182978
|
+
loadedFromDisk = true;
|
|
182979
|
+
try {
|
|
182980
|
+
const p = entitlementsPath();
|
|
182981
|
+
if (existsSync11(p)) {
|
|
182982
|
+
cache3 = JSON.parse(readFileSync12(p, "utf8"));
|
|
182983
|
+
}
|
|
182984
|
+
} catch {
|
|
182985
|
+
cache3 = null;
|
|
182986
|
+
}
|
|
182987
|
+
}
|
|
182988
|
+
function persist(ent) {
|
|
182989
|
+
try {
|
|
182990
|
+
const dir = getRayuConfigHomeDir();
|
|
182991
|
+
if (!existsSync11(dir))
|
|
182992
|
+
mkdirSync7(dir, { recursive: true });
|
|
182993
|
+
const p = entitlementsPath();
|
|
182994
|
+
if (ent)
|
|
182995
|
+
writeFileSync5(p, JSON.stringify(ent, null, 2), { mode: 384 });
|
|
182996
|
+
else
|
|
182997
|
+
rmSync4(p, { force: true });
|
|
182998
|
+
} catch {}
|
|
182999
|
+
}
|
|
183000
|
+
function getCachedEntitlements() {
|
|
183001
|
+
loadFromDiskOnce();
|
|
183002
|
+
if (cache3 && cache3.userId != null) {
|
|
183003
|
+
const uid = currentUserId();
|
|
183004
|
+
if (uid != null && uid !== cache3.userId) {
|
|
183005
|
+
cache3 = null;
|
|
183006
|
+
}
|
|
183007
|
+
}
|
|
183008
|
+
if (isUseRayuOAuthEnabled() && hasRayuSession() && !fetching && Date.now() - lastAttempt > REFRESH_COOLDOWN_MS) {
|
|
183009
|
+
refreshRayuEntitlements();
|
|
183010
|
+
}
|
|
183011
|
+
return cache3;
|
|
183012
|
+
}
|
|
183013
|
+
async function refreshRayuEntitlements() {
|
|
183014
|
+
if (!isUseRayuOAuthEnabled() || !hasRayuSession())
|
|
183015
|
+
return null;
|
|
183016
|
+
if (fetching)
|
|
183017
|
+
return cache3;
|
|
183018
|
+
fetching = true;
|
|
183019
|
+
lastAttempt = Date.now();
|
|
183020
|
+
try {
|
|
183021
|
+
const token = await getValidRayuAccessToken();
|
|
183022
|
+
if (!token)
|
|
183023
|
+
return cache3;
|
|
183024
|
+
const res = await globalThis.fetch(`${getRayuApiBaseUrl()}/me/entitlements`, { headers: { Authorization: `Bearer ${token}` } });
|
|
183025
|
+
if (!res.ok)
|
|
183026
|
+
return cache3;
|
|
183027
|
+
const data = await res.json();
|
|
183028
|
+
data.userId = currentUserId();
|
|
183029
|
+
cache3 = data;
|
|
183030
|
+
loadedFromDisk = true;
|
|
183031
|
+
persist(data);
|
|
183032
|
+
syncRayuHostedProvider(data);
|
|
183033
|
+
return data;
|
|
183034
|
+
} catch {
|
|
183035
|
+
return cache3;
|
|
183036
|
+
} finally {
|
|
183037
|
+
fetching = false;
|
|
183038
|
+
}
|
|
183039
|
+
}
|
|
183040
|
+
function clearRayuEntitlements() {
|
|
183041
|
+
cache3 = null;
|
|
183042
|
+
loadedFromDisk = true;
|
|
183043
|
+
lastAttempt = 0;
|
|
183044
|
+
persist(null);
|
|
183045
|
+
syncRayuHostedProvider(null);
|
|
183046
|
+
}
|
|
183047
|
+
function rayuFeatureAllowed(featureKey) {
|
|
183048
|
+
if (!isUseRayuOAuthEnabled())
|
|
183049
|
+
return true;
|
|
183050
|
+
const ent = getCachedEntitlements();
|
|
183051
|
+
if (ent && ent.features) {
|
|
183052
|
+
const f3 = ent.features[featureKey];
|
|
183053
|
+
if (!f3)
|
|
183054
|
+
return true;
|
|
183055
|
+
return f3.enabled !== false;
|
|
183056
|
+
}
|
|
183057
|
+
return !hasRayuSession();
|
|
183058
|
+
}
|
|
183059
|
+
function isHostedModelEntitled(modelCode) {
|
|
183060
|
+
if (!isUseRayuOAuthEnabled())
|
|
183061
|
+
return true;
|
|
183062
|
+
const ent = getCachedEntitlements();
|
|
183063
|
+
if (!ent)
|
|
183064
|
+
return true;
|
|
183065
|
+
const allowed = ent.allowedModels ?? [];
|
|
183066
|
+
return allowed.some((m2) => m2.code === modelCode);
|
|
183067
|
+
}
|
|
183068
|
+
function hostedModelUpgradeMessage() {
|
|
183069
|
+
const url3 = `${getRayuWebBaseUrl()}/plans`;
|
|
183070
|
+
return `\uD83D\uDD12 Rayu-hosted models are a paid feature. Please upgrade your plan to use them: ${url3}`;
|
|
183071
|
+
}
|
|
183072
|
+
function _setRayuEntitlementsForTesting(ent) {
|
|
183073
|
+
cache3 = ent;
|
|
183074
|
+
loadedFromDisk = true;
|
|
183075
|
+
}
|
|
183076
|
+
function _resetRayuEntitlementsForTesting() {
|
|
183077
|
+
cache3 = null;
|
|
183078
|
+
loadedFromDisk = false;
|
|
183079
|
+
fetching = false;
|
|
183080
|
+
lastAttempt = 0;
|
|
183081
|
+
}
|
|
183082
|
+
var FILE = "rayu-entitlements.json", REFRESH_COOLDOWN_MS = 30000, cache3 = null, loadedFromDisk = false, fetching = false, lastAttempt = 0;
|
|
183083
|
+
var init_rayuEntitlements = __esm(() => {
|
|
183084
|
+
init_envUtils();
|
|
183085
|
+
init_rayuHostedProvider();
|
|
183086
|
+
init_rayuSession();
|
|
183087
|
+
});
|
|
183088
|
+
|
|
182835
183089
|
// src/services/api/rayuHosted/rayuHostedAuth.ts
|
|
182836
183090
|
function rayuHostedBaseURL() {
|
|
182837
183091
|
return `${getRayuGatewayBaseUrl()}/v1`;
|
|
@@ -182839,6 +183093,25 @@ function rayuHostedBaseURL() {
|
|
|
182839
183093
|
function makeRayuHostedFetch() {
|
|
182840
183094
|
const inner = globalThis.fetch;
|
|
182841
183095
|
const wrapped = async (input, init = {}) => {
|
|
183096
|
+
const url3 = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
183097
|
+
if ((init?.method ?? "GET").toUpperCase() === "POST" && url3.includes("/chat/completions") && typeof init?.body === "string") {
|
|
183098
|
+
const model = (() => {
|
|
183099
|
+
try {
|
|
183100
|
+
return JSON.parse(init.body).model;
|
|
183101
|
+
} catch {
|
|
183102
|
+
return;
|
|
183103
|
+
}
|
|
183104
|
+
})();
|
|
183105
|
+
if (model) {
|
|
183106
|
+
const { isHostedModelEntitled: isHostedModelEntitled2, hostedModelUpgradeMessage: hostedModelUpgradeMessage2 } = await Promise.resolve().then(() => (init_rayuEntitlements(), exports_rayuEntitlements));
|
|
183107
|
+
if (!isHostedModelEntitled2(model)) {
|
|
183108
|
+
const message = hostedModelUpgradeMessage2();
|
|
183109
|
+
return new Response(JSON.stringify({
|
|
183110
|
+
error: { message, type: "upgrade_required", code: "plan_upgrade_required" }
|
|
183111
|
+
}), { status: 403, headers: { "content-type": "application/json" } });
|
|
183112
|
+
}
|
|
183113
|
+
}
|
|
183114
|
+
}
|
|
182842
183115
|
const token = await getValidRayuAccessToken();
|
|
182843
183116
|
if (!token) {
|
|
182844
183117
|
throw new Error("Not signed in to Rayu. Run /login to use Rayu-hosted models.");
|
|
@@ -183214,14 +183487,14 @@ var init_client4 = __esm(() => {
|
|
|
183214
183487
|
});
|
|
183215
183488
|
|
|
183216
183489
|
// src/utils/model/modelCapabilities.ts
|
|
183217
|
-
import { readFileSync as
|
|
183490
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
183218
183491
|
import { mkdir as mkdir5, writeFile as writeFile2 } from "fs/promises";
|
|
183219
|
-
import { join as
|
|
183492
|
+
import { join as join31 } from "path";
|
|
183220
183493
|
function getCacheDir() {
|
|
183221
|
-
return
|
|
183494
|
+
return join31(getRayuConfigHomeDir(), "cache");
|
|
183222
183495
|
}
|
|
183223
183496
|
function getCachePath() {
|
|
183224
|
-
return
|
|
183497
|
+
return join31(getCacheDir(), "model-capabilities.json");
|
|
183225
183498
|
}
|
|
183226
183499
|
function isModelCapabilitiesEligible() {
|
|
183227
183500
|
if (true)
|
|
@@ -183304,7 +183577,7 @@ var init_modelCapabilities = __esm(() => {
|
|
|
183304
183577
|
}));
|
|
183305
183578
|
loadCache = memoize_default((path14) => {
|
|
183306
183579
|
try {
|
|
183307
|
-
const raw =
|
|
183580
|
+
const raw = readFileSync13(path14, "utf-8");
|
|
183308
183581
|
const parsed = CacheFileSchema().safeParse(safeParseJSON(raw, false));
|
|
183309
183582
|
return parsed.success ? parsed.data.models : null;
|
|
183310
183583
|
} catch {
|
|
@@ -184352,7 +184625,7 @@ var init_metadata = __esm(() => {
|
|
|
184352
184625
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
184353
184626
|
WHITESPACE_REGEX = /\s+/;
|
|
184354
184627
|
getVersionBase = memoize_default(() => {
|
|
184355
|
-
const match = "1.3.
|
|
184628
|
+
const match = "1.3.444".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
184356
184629
|
return match ? match[0] : undefined;
|
|
184357
184630
|
});
|
|
184358
184631
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -184391,7 +184664,7 @@ var init_metadata = __esm(() => {
|
|
|
184391
184664
|
},
|
|
184392
184665
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
184393
184666
|
isRayuAction: isEnvTruthy(process.env.RAYU_ACTION),
|
|
184394
|
-
version: "1.3.
|
|
184667
|
+
version: "1.3.444",
|
|
184395
184668
|
versionBase: getVersionBase(),
|
|
184396
184669
|
buildTime: "",
|
|
184397
184670
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
@@ -185003,7 +185276,7 @@ function initialize1PEventLogging() {
|
|
|
185003
185276
|
const platform2 = getPlatform();
|
|
185004
185277
|
const attributes = {
|
|
185005
185278
|
[import_semantic_conventions.ATTR_SERVICE_NAME]: "rayu",
|
|
185006
|
-
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.3.
|
|
185279
|
+
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.3.444"
|
|
185007
185280
|
};
|
|
185008
185281
|
if (platform2 === "wsl") {
|
|
185009
185282
|
const wslVersion = getWslVersion();
|
|
@@ -185030,7 +185303,7 @@ function initialize1PEventLogging() {
|
|
|
185030
185303
|
})
|
|
185031
185304
|
]
|
|
185032
185305
|
});
|
|
185033
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("io.rayu.events", "1.3.
|
|
185306
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("io.rayu.events", "1.3.444");
|
|
185034
185307
|
}
|
|
185035
185308
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
185036
185309
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -185649,7 +185922,7 @@ var init_growthbook = __esm(() => {
|
|
|
185649
185922
|
|
|
185650
185923
|
// src/memdir/paths.ts
|
|
185651
185924
|
import { homedir as homedir10 } from "os";
|
|
185652
|
-
import { isAbsolute as isAbsolute7, join as
|
|
185925
|
+
import { isAbsolute as isAbsolute7, join as join33, normalize as normalize5, sep as sep7 } from "path";
|
|
185653
185926
|
function isAutoMemoryEnabled() {
|
|
185654
185927
|
const envVal = process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;
|
|
185655
185928
|
if (isEnvTruthy(envVal)) {
|
|
@@ -185687,7 +185960,7 @@ function validateMemoryPath(raw, expandTilde) {
|
|
|
185687
185960
|
if (restNorm === "." || restNorm === "..") {
|
|
185688
185961
|
return;
|
|
185689
185962
|
}
|
|
185690
|
-
candidate =
|
|
185963
|
+
candidate = join33(homedir10(), rest);
|
|
185691
185964
|
}
|
|
185692
185965
|
const normalized = normalize5(candidate).replace(/[/\\]+$/, "");
|
|
185693
185966
|
if (!isAbsolute7(normalized) || normalized.length < 3 || /^[A-Za-z]:$/.test(normalized) || normalized.startsWith("\\\\") || normalized.startsWith("//") || normalized.includes("\x00")) {
|
|
@@ -185709,7 +185982,7 @@ function getAutoMemBase() {
|
|
|
185709
185982
|
return findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot();
|
|
185710
185983
|
}
|
|
185711
185984
|
function getAutoMemEntrypoint() {
|
|
185712
|
-
return
|
|
185985
|
+
return join33(getAutoMemPath(), AUTO_MEM_ENTRYPOINT_NAME);
|
|
185713
185986
|
}
|
|
185714
185987
|
function isAutoMemPath(absolutePath) {
|
|
185715
185988
|
const normalizedPath = normalize5(absolutePath);
|
|
@@ -185729,8 +186002,8 @@ var init_paths = __esm(() => {
|
|
|
185729
186002
|
if (override) {
|
|
185730
186003
|
return override;
|
|
185731
186004
|
}
|
|
185732
|
-
const projectsDir =
|
|
185733
|
-
return (
|
|
186005
|
+
const projectsDir = join33(getMemoryBaseDir(), "projects");
|
|
186006
|
+
return (join33(projectsDir, sanitizePath2(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep7).normalize("NFC");
|
|
185734
186007
|
}, () => getProjectRoot());
|
|
185735
186008
|
});
|
|
185736
186009
|
|
|
@@ -187326,7 +187599,7 @@ __export(exports_config, {
|
|
|
187326
187599
|
});
|
|
187327
187600
|
import { randomBytes } from "crypto";
|
|
187328
187601
|
import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
|
|
187329
|
-
import { basename as basename8, dirname as dirname15, join as
|
|
187602
|
+
import { basename as basename8, dirname as dirname15, join as join34, resolve as resolve11 } from "path";
|
|
187330
187603
|
function createDefaultGlobalConfig() {
|
|
187331
187604
|
return {
|
|
187332
187605
|
numStartups: 0,
|
|
@@ -187681,14 +187954,14 @@ function saveConfigWithLock(file2, createDefault, mergeFn) {
|
|
|
187681
187954
|
const mostRecentTimestamp = mostRecentBackup ? Number(mostRecentBackup.split(".backup.").pop()) : 0;
|
|
187682
187955
|
const shouldCreateBackup = Number.isNaN(mostRecentTimestamp) || Date.now() - mostRecentTimestamp >= MIN_BACKUP_INTERVAL_MS;
|
|
187683
187956
|
if (shouldCreateBackup) {
|
|
187684
|
-
const backupPath =
|
|
187957
|
+
const backupPath = join34(backupDir, `${fileBase}.backup.${Date.now()}`);
|
|
187685
187958
|
fs6.copyFileSync(file2, backupPath);
|
|
187686
187959
|
}
|
|
187687
187960
|
const MAX_BACKUPS = 5;
|
|
187688
187961
|
const backupsForCleanup = shouldCreateBackup ? fs6.readdirStringSync(backupDir).filter((f3) => f3.startsWith(`${fileBase}.backup.`)).sort().reverse() : existingBackups;
|
|
187689
187962
|
for (const oldBackup of backupsForCleanup.slice(MAX_BACKUPS)) {
|
|
187690
187963
|
try {
|
|
187691
|
-
fs6.unlinkSync(
|
|
187964
|
+
fs6.unlinkSync(join34(backupDir, oldBackup));
|
|
187692
187965
|
} catch {}
|
|
187693
187966
|
}
|
|
187694
187967
|
} catch (e2) {
|
|
@@ -187726,7 +187999,7 @@ function enableConfigs() {
|
|
|
187726
187999
|
});
|
|
187727
188000
|
}
|
|
187728
188001
|
function getConfigBackupDir() {
|
|
187729
|
-
return
|
|
188002
|
+
return join34(getRayuConfigHomeDir(), "backups");
|
|
187730
188003
|
}
|
|
187731
188004
|
function findMostRecentBackup(file2) {
|
|
187732
188005
|
const fs6 = getFsImplementation();
|
|
@@ -187736,7 +188009,7 @@ function findMostRecentBackup(file2) {
|
|
|
187736
188009
|
const backups = fs6.readdirStringSync(backupDir).filter((f3) => f3.startsWith(`${fileBase}.backup.`)).sort();
|
|
187737
188010
|
const mostRecent = backups.at(-1);
|
|
187738
188011
|
if (mostRecent) {
|
|
187739
|
-
return
|
|
188012
|
+
return join34(backupDir, mostRecent);
|
|
187740
188013
|
}
|
|
187741
188014
|
} catch {}
|
|
187742
188015
|
const fileDir = dirname15(file2);
|
|
@@ -187744,7 +188017,7 @@ function findMostRecentBackup(file2) {
|
|
|
187744
188017
|
const backups = fs6.readdirStringSync(fileDir).filter((f3) => f3.startsWith(`${fileBase}.backup.`)).sort();
|
|
187745
188018
|
const mostRecent = backups.at(-1);
|
|
187746
188019
|
if (mostRecent) {
|
|
187747
|
-
return
|
|
188020
|
+
return join34(fileDir, mostRecent);
|
|
187748
188021
|
}
|
|
187749
188022
|
const legacyBackup = `${file2}.backup`;
|
|
187750
188023
|
try {
|
|
@@ -187827,7 +188100,7 @@ Claude configuration file at ${file2} is corrupted: ${error54.message}
|
|
|
187827
188100
|
const currentContent = fs6.readFileSync(file2, { encoding: "utf-8" });
|
|
187828
188101
|
for (const backup of existingCorruptedBackups) {
|
|
187829
188102
|
try {
|
|
187830
|
-
const backupContent = fs6.readFileSync(
|
|
188103
|
+
const backupContent = fs6.readFileSync(join34(corruptedBackupDir, backup), { encoding: "utf-8" });
|
|
187831
188104
|
if (currentContent === backupContent) {
|
|
187832
188105
|
alreadyBackedUp = true;
|
|
187833
188106
|
break;
|
|
@@ -187835,7 +188108,7 @@ Claude configuration file at ${file2} is corrupted: ${error54.message}
|
|
|
187835
188108
|
} catch {}
|
|
187836
188109
|
}
|
|
187837
188110
|
if (!alreadyBackedUp) {
|
|
187838
|
-
corruptedBackupPath =
|
|
188111
|
+
corruptedBackupPath = join34(corruptedBackupDir, `${fileBase}.corrupted.${Date.now()}`);
|
|
187839
188112
|
try {
|
|
187840
188113
|
fs6.copyFileSync(file2, corruptedBackupPath);
|
|
187841
188114
|
logForDebugging(`Corrupted config backed up to: ${corruptedBackupPath}`, {
|
|
@@ -187980,13 +188253,13 @@ function getMemoryPath(memoryType) {
|
|
|
187980
188253
|
const cwd2 = getOriginalCwd();
|
|
187981
188254
|
switch (memoryType) {
|
|
187982
188255
|
case "User":
|
|
187983
|
-
return
|
|
188256
|
+
return join34(getRayuConfigHomeDir(), "RAYU.md");
|
|
187984
188257
|
case "Local":
|
|
187985
|
-
return
|
|
188258
|
+
return join34(cwd2, "RAYU.local.md");
|
|
187986
188259
|
case "Project":
|
|
187987
|
-
return
|
|
188260
|
+
return join34(cwd2, "RAYU.md");
|
|
187988
188261
|
case "Managed":
|
|
187989
|
-
return
|
|
188262
|
+
return join34(getManagedFilePath(), "RAYU.md");
|
|
187990
188263
|
case "AutoMem":
|
|
187991
188264
|
return getAutoMemEntrypoint();
|
|
187992
188265
|
}
|
|
@@ -187994,10 +188267,10 @@ function getMemoryPath(memoryType) {
|
|
|
187994
188267
|
return "";
|
|
187995
188268
|
}
|
|
187996
188269
|
function getManagedClaudeRulesDir() {
|
|
187997
|
-
return
|
|
188270
|
+
return join34(getManagedFilePath(), ".rayu", "rules");
|
|
187998
188271
|
}
|
|
187999
188272
|
function getUserClaudeRulesDir() {
|
|
188000
|
-
return
|
|
188273
|
+
return join34(getRayuConfigHomeDir(), "rules");
|
|
188001
188274
|
}
|
|
188002
188275
|
function _setGlobalConfigCacheForTesting(config2) {
|
|
188003
188276
|
globalConfigCache.config = config2;
|
|
@@ -188382,10 +188655,10 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
188382
188655
|
addPattern(pattern) {
|
|
188383
188656
|
return this.add(pattern);
|
|
188384
188657
|
}
|
|
188385
|
-
_test(originalPath,
|
|
188658
|
+
_test(originalPath, cache4, checkUnignored, slices) {
|
|
188386
188659
|
const path15 = originalPath && checkPath.convert(originalPath);
|
|
188387
188660
|
checkPath(path15, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE);
|
|
188388
|
-
return this._t(path15,
|
|
188661
|
+
return this._t(path15, cache4, checkUnignored, slices);
|
|
188389
188662
|
}
|
|
188390
188663
|
checkIgnore(path15) {
|
|
188391
188664
|
if (!REGEX_TEST_TRAILING_SLASH.test(path15)) {
|
|
@@ -188401,19 +188674,19 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
188401
188674
|
}
|
|
188402
188675
|
return this._rules.test(path15, false, MODE_CHECK_IGNORE);
|
|
188403
188676
|
}
|
|
188404
|
-
_t(path15,
|
|
188405
|
-
if (path15 in
|
|
188406
|
-
return
|
|
188677
|
+
_t(path15, cache4, checkUnignored, slices) {
|
|
188678
|
+
if (path15 in cache4) {
|
|
188679
|
+
return cache4[path15];
|
|
188407
188680
|
}
|
|
188408
188681
|
if (!slices) {
|
|
188409
188682
|
slices = path15.split(SLASH).filter(Boolean);
|
|
188410
188683
|
}
|
|
188411
188684
|
slices.pop();
|
|
188412
188685
|
if (!slices.length) {
|
|
188413
|
-
return
|
|
188686
|
+
return cache4[path15] = this._rules.test(path15, checkUnignored, MODE_IGNORE);
|
|
188414
188687
|
}
|
|
188415
|
-
const parent = this._t(slices.join(SLASH) + SLASH,
|
|
188416
|
-
return
|
|
188688
|
+
const parent = this._t(slices.join(SLASH) + SLASH, cache4, checkUnignored, slices);
|
|
188689
|
+
return cache4[path15] = parent.ignored ? parent : this._rules.test(path15, checkUnignored, MODE_IGNORE);
|
|
188417
188690
|
}
|
|
188418
188691
|
ignores(path15) {
|
|
188419
188692
|
return this._test(path15, this._ignoreCache, false).ignored;
|
|
@@ -193815,10 +194088,10 @@ Error generating stack: ` + x2.message + `
|
|
|
193815
194088
|
refCount: 0
|
|
193816
194089
|
};
|
|
193817
194090
|
}
|
|
193818
|
-
function releaseCache(
|
|
193819
|
-
|
|
193820
|
-
|
|
193821
|
-
|
|
194091
|
+
function releaseCache(cache4) {
|
|
194092
|
+
cache4.refCount--;
|
|
194093
|
+
cache4.refCount === 0 && scheduleCallback$2(NormalPriority, function() {
|
|
194094
|
+
cache4.controller.abort();
|
|
193822
194095
|
});
|
|
193823
194096
|
}
|
|
193824
194097
|
function noop$1() {}
|
|
@@ -197940,23 +198213,23 @@ Error generating stack: ` + x2.message + `
|
|
|
197940
198213
|
case 23:
|
|
197941
198214
|
case 22:
|
|
197942
198215
|
if (fiber.memoizedState !== null && fiber.memoizedState.cachePool !== null) {
|
|
197943
|
-
var
|
|
197944
|
-
|
|
198216
|
+
var cache4 = fiber.memoizedState.cachePool.pool;
|
|
198217
|
+
cache4 != null && cache4.refCount++;
|
|
197945
198218
|
}
|
|
197946
198219
|
break;
|
|
197947
198220
|
case 24:
|
|
197948
198221
|
releaseCache(fiber.memoizedState.cache);
|
|
197949
198222
|
}
|
|
197950
|
-
|
|
197951
|
-
if (
|
|
197952
|
-
|
|
198223
|
+
cache4 = fiber.child;
|
|
198224
|
+
if (cache4 !== null)
|
|
198225
|
+
cache4.return = fiber, nextEffect = cache4;
|
|
197953
198226
|
else
|
|
197954
198227
|
a:
|
|
197955
198228
|
for (fiber = deletedSubtreeRoot;nextEffect !== null; ) {
|
|
197956
|
-
|
|
197957
|
-
var { sibling, return: returnFiber } =
|
|
197958
|
-
detachFiberAfterEffects(
|
|
197959
|
-
if (
|
|
198229
|
+
cache4 = nextEffect;
|
|
198230
|
+
var { sibling, return: returnFiber } = cache4;
|
|
198231
|
+
detachFiberAfterEffects(cache4);
|
|
198232
|
+
if (cache4 === fiber) {
|
|
197960
198233
|
nextEffect = null;
|
|
197961
198234
|
break a;
|
|
197962
198235
|
}
|
|
@@ -199418,8 +199691,8 @@ Error generating stack: ` + x2.message + `
|
|
|
199418
199691
|
hydrationErrors: null
|
|
199419
199692
|
}, offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set, nextEffect = null, hostParent = null, hostParentIsContainer = false, currentHoistableRoot = null, suspenseyCommitFlag = 8192, DefaultAsyncDispatcher = {
|
|
199420
199693
|
getCacheForType: function(resourceType) {
|
|
199421
|
-
var
|
|
199422
|
-
cacheForType === undefined && (cacheForType = resourceType(),
|
|
199694
|
+
var cache4 = readContext(CacheContext), cacheForType = cache4.data.get(resourceType);
|
|
199695
|
+
cacheForType === undefined && (cacheForType = resourceType(), cache4.data.set(resourceType, cacheForType));
|
|
199423
199696
|
return cacheForType;
|
|
199424
199697
|
},
|
|
199425
199698
|
cacheSignal: function() {
|
|
@@ -200024,20 +200297,20 @@ var init_engine = __esm(() => {
|
|
|
200024
200297
|
|
|
200025
200298
|
// src/ink/line-width-cache.ts
|
|
200026
200299
|
function lineWidth(line) {
|
|
200027
|
-
const cached2 =
|
|
200300
|
+
const cached2 = cache4.get(line);
|
|
200028
200301
|
if (cached2 !== undefined)
|
|
200029
200302
|
return cached2;
|
|
200030
200303
|
const width = stringWidth(line);
|
|
200031
|
-
if (
|
|
200032
|
-
|
|
200304
|
+
if (cache4.size >= MAX_CACHE_SIZE2) {
|
|
200305
|
+
cache4.clear();
|
|
200033
200306
|
}
|
|
200034
|
-
|
|
200307
|
+
cache4.set(line, width);
|
|
200035
200308
|
return width;
|
|
200036
200309
|
}
|
|
200037
|
-
var
|
|
200310
|
+
var cache4, MAX_CACHE_SIZE2 = 4096;
|
|
200038
200311
|
var init_line_width_cache = __esm(() => {
|
|
200039
200312
|
init_stringWidth();
|
|
200040
|
-
|
|
200313
|
+
cache4 = new Map;
|
|
200041
200314
|
});
|
|
200042
200315
|
|
|
200043
200316
|
// src/ink/measure-text.ts
|
|
@@ -204545,7 +204818,7 @@ var require_range2 = __commonJS((exports, module) => {
|
|
|
204545
204818
|
range = range.replace(BUILDSTRIPRE, "");
|
|
204546
204819
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
204547
204820
|
const memoKey = memoOpts + ":" + range;
|
|
204548
|
-
const cached2 =
|
|
204821
|
+
const cached2 = cache5.get(memoKey);
|
|
204549
204822
|
if (cached2) {
|
|
204550
204823
|
return cached2;
|
|
204551
204824
|
}
|
|
@@ -204579,7 +204852,7 @@ var require_range2 = __commonJS((exports, module) => {
|
|
|
204579
204852
|
rangeMap.delete("");
|
|
204580
204853
|
}
|
|
204581
204854
|
const result = [...rangeMap.values()];
|
|
204582
|
-
|
|
204855
|
+
cache5.set(memoKey, result);
|
|
204583
204856
|
return result;
|
|
204584
204857
|
}
|
|
204585
204858
|
intersects(range, options) {
|
|
@@ -204617,7 +204890,7 @@ var require_range2 = __commonJS((exports, module) => {
|
|
|
204617
204890
|
}
|
|
204618
204891
|
module.exports = Range;
|
|
204619
204892
|
var LRU = require_lrucache();
|
|
204620
|
-
var
|
|
204893
|
+
var cache5 = new LRU;
|
|
204621
204894
|
var parseOptions = require_parse_options();
|
|
204622
204895
|
var Comparator = require_comparator();
|
|
204623
204896
|
var debug3 = require_debug2();
|
|
@@ -206964,7 +207237,7 @@ var init_Text = __esm(() => {
|
|
|
206964
207237
|
});
|
|
206965
207238
|
|
|
206966
207239
|
// src/ink/components/ErrorOverview.tsx
|
|
206967
|
-
import { readFileSync as
|
|
207240
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
206968
207241
|
function getStackUtils() {
|
|
206969
207242
|
return stackUtils ??= new import_stack_utils.default({
|
|
206970
207243
|
cwd: process.cwd(),
|
|
@@ -206982,7 +207255,7 @@ function ErrorOverview({
|
|
|
206982
207255
|
let lineWidth2 = 0;
|
|
206983
207256
|
if (filePath && origin2?.line) {
|
|
206984
207257
|
try {
|
|
206985
|
-
const sourceCode =
|
|
207258
|
+
const sourceCode = readFileSync14(filePath, "utf8");
|
|
206986
207259
|
excerpt = dist_default3(sourceCode, origin2.line);
|
|
206987
207260
|
if (excerpt) {
|
|
206988
207261
|
for (const {
|
|
@@ -207851,6 +208124,15 @@ class LogUpdate {
|
|
|
207851
208124
|
}
|
|
207852
208125
|
currentStyleId = transitionStyle(screen.diff, stylePool, currentStyleId, stylePool.none);
|
|
207853
208126
|
currentHyperlink = transitionHyperlink(screen.diff, currentHyperlink, undefined);
|
|
208127
|
+
if (!altScreen && prev.screen.height > 0) {
|
|
208128
|
+
const w = next.screen.width;
|
|
208129
|
+
const lastExistingRow = Math.min(prev.screen.height, next.screen.height);
|
|
208130
|
+
for (let y = Math.max(0, viewportY);y < lastExistingRow; y++) {
|
|
208131
|
+
if (!modifiedRows.has(y) && rowContentEnd(prev.screen, y, w) > rowContentEnd(next.screen, y, w)) {
|
|
208132
|
+
modifiedRows.add(y);
|
|
208133
|
+
}
|
|
208134
|
+
}
|
|
208135
|
+
}
|
|
207854
208136
|
if (!altScreen && modifiedRows.size > 0) {
|
|
207855
208137
|
const w = next.screen.width;
|
|
207856
208138
|
for (const y of modifiedRows) {
|
|
@@ -207925,6 +208207,14 @@ function readLine(screen, y) {
|
|
|
207925
208207
|
}
|
|
207926
208208
|
return line.trimEnd();
|
|
207927
208209
|
}
|
|
208210
|
+
function rowContentEnd(screen, y, width) {
|
|
208211
|
+
for (let x2 = width - 1;x2 >= 0; x2--) {
|
|
208212
|
+
if (!isEmptyCellAt(screen, x2, y)) {
|
|
208213
|
+
return x2;
|
|
208214
|
+
}
|
|
208215
|
+
}
|
|
208216
|
+
return -1;
|
|
208217
|
+
}
|
|
207928
208218
|
function fullResetSequence_CAUSES_FLICKER(frame, reason, stylePool, debug3) {
|
|
207929
208219
|
const screen = new VirtualScreen({ x: 0, y: 0 }, frame.viewport.width);
|
|
207930
208220
|
renderFrame(screen, frame, stylePool);
|
|
@@ -216649,7 +216939,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
216649
216939
|
if (!isAttributionHeaderEnabled()) {
|
|
216650
216940
|
return "";
|
|
216651
216941
|
}
|
|
216652
|
-
const version2 = `${"1.3.
|
|
216942
|
+
const version2 = `${"1.3.444"}.${fingerprint}`;
|
|
216653
216943
|
const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
|
|
216654
216944
|
const cch = "";
|
|
216655
216945
|
const workload = getWorkload();
|
|
@@ -223918,7 +224208,7 @@ var init_frontmatterParser = __esm(() => {
|
|
|
223918
224208
|
|
|
223919
224209
|
// src/utils/ripgrep.ts
|
|
223920
224210
|
import { execFile as execFile4, spawn as spawn3 } from "child_process";
|
|
223921
|
-
import { existsSync as
|
|
224211
|
+
import { existsSync as existsSync12 } from "fs";
|
|
223922
224212
|
import { homedir as homedir11 } from "os";
|
|
223923
224213
|
import * as path15 from "path";
|
|
223924
224214
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
@@ -224197,7 +224487,7 @@ var init_ripgrep = __esm(() => {
|
|
|
224197
224487
|
}
|
|
224198
224488
|
const rgRoot = path15.resolve(__dirname2, "vendor", "ripgrep");
|
|
224199
224489
|
const command = process.platform === "win32" ? path15.resolve(rgRoot, `${process.arch}-win32`, "rg.exe") : path15.resolve(rgRoot, `${process.arch}-${process.platform}`, "rg");
|
|
224200
|
-
if (!
|
|
224490
|
+
if (!existsSync12(command)) {
|
|
224201
224491
|
const { cmd: systemPath } = findExecutable2("rg", []);
|
|
224202
224492
|
if (systemPath !== "rg") {
|
|
224203
224493
|
return { mode: "system", command: "rg", args: [] };
|
|
@@ -224309,7 +224599,7 @@ var init_pluginOnlyPolicy = __esm(() => {
|
|
|
224309
224599
|
import { statSync as statSync6 } from "fs";
|
|
224310
224600
|
import { lstat as lstat4, readdir as readdir9, readFile as readFile8, realpath as realpath6, stat as stat14 } from "fs/promises";
|
|
224311
224601
|
import { homedir as homedir12 } from "os";
|
|
224312
|
-
import { dirname as dirname20, join as
|
|
224602
|
+
import { dirname as dirname20, join as join38, resolve as resolve16, sep as sep9 } from "path";
|
|
224313
224603
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
224314
224604
|
const lines = content.split(`
|
|
224315
224605
|
`);
|
|
@@ -224400,7 +224690,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
224400
224690
|
break;
|
|
224401
224691
|
}
|
|
224402
224692
|
for (const cfgDir of ALL_CONFIG_DIRS) {
|
|
224403
|
-
const configSubdir =
|
|
224693
|
+
const configSubdir = join38(current, cfgDir, subdir);
|
|
224404
224694
|
try {
|
|
224405
224695
|
statSync6(configSubdir);
|
|
224406
224696
|
dirs.push(configSubdir);
|
|
@@ -224448,7 +224738,7 @@ async function findMarkdownFilesNative(dir, signal) {
|
|
|
224448
224738
|
if (signal.aborted) {
|
|
224449
224739
|
break;
|
|
224450
224740
|
}
|
|
224451
|
-
const fullPath =
|
|
224741
|
+
const fullPath = join38(currentDir, entry.name);
|
|
224452
224742
|
try {
|
|
224453
224743
|
if (entry.isSymbolicLink()) {
|
|
224454
224744
|
try {
|
|
@@ -224535,16 +224825,16 @@ var init_markdownConfigLoader = __esm(() => {
|
|
|
224535
224825
|
ALL_CONFIG_DIRS = [".rayu", ".agents"];
|
|
224536
224826
|
loadMarkdownFilesForSubdir = memoize_default(async function(subdir, cwd2) {
|
|
224537
224827
|
const searchStartTime = Date.now();
|
|
224538
|
-
const userDir =
|
|
224539
|
-
const managedDir =
|
|
224828
|
+
const userDir = join38(getRayuConfigHomeDir(), subdir);
|
|
224829
|
+
const managedDir = join38(getManagedFilePath(), ".rayu", subdir);
|
|
224540
224830
|
const projectDirs = getProjectDirsUpToHome(subdir, cwd2);
|
|
224541
224831
|
const gitRoot = findGitRoot(cwd2);
|
|
224542
224832
|
const canonicalRoot = findCanonicalGitRoot(cwd2);
|
|
224543
224833
|
if (gitRoot && canonicalRoot && canonicalRoot !== gitRoot) {
|
|
224544
|
-
const worktreeSubdir = normalizePathForComparison(
|
|
224834
|
+
const worktreeSubdir = normalizePathForComparison(join38(gitRoot, ".rayu", subdir));
|
|
224545
224835
|
const worktreeHasSubdir = projectDirs.some((dir) => normalizePathForComparison(dir) === worktreeSubdir);
|
|
224546
224836
|
if (!worktreeHasSubdir) {
|
|
224547
|
-
const mainRayuSubdir =
|
|
224837
|
+
const mainRayuSubdir = join38(canonicalRoot, ".rayu", subdir);
|
|
224548
224838
|
if (!projectDirs.includes(mainRayuSubdir)) {
|
|
224549
224839
|
projectDirs.push(mainRayuSubdir);
|
|
224550
224840
|
}
|
|
@@ -224753,12 +225043,12 @@ var init_builtinPlugins = __esm(() => {
|
|
|
224753
225043
|
});
|
|
224754
225044
|
|
|
224755
225045
|
// src/utils/plugins/addDirPluginSettings.ts
|
|
224756
|
-
import { join as
|
|
225046
|
+
import { join as join39 } from "path";
|
|
224757
225047
|
function getAddDirEnabledPlugins() {
|
|
224758
225048
|
const result = {};
|
|
224759
225049
|
for (const dir of getAdditionalDirectoriesForClaudeMd()) {
|
|
224760
225050
|
for (const file2 of SETTINGS_FILES) {
|
|
224761
|
-
const { settings } = parseSettingsFile(
|
|
225051
|
+
const { settings } = parseSettingsFile(join39(dir, CONFIG_DIR, file2));
|
|
224762
225052
|
if (!settings?.enabledPlugins) {
|
|
224763
225053
|
continue;
|
|
224764
225054
|
}
|
|
@@ -224771,7 +225061,7 @@ function getAddDirExtraMarketplaces() {
|
|
|
224771
225061
|
const result = {};
|
|
224772
225062
|
for (const dir of getAdditionalDirectoriesForClaudeMd()) {
|
|
224773
225063
|
for (const file2 of SETTINGS_FILES) {
|
|
224774
|
-
const { settings } = parseSettingsFile(
|
|
225064
|
+
const { settings } = parseSettingsFile(join39(dir, CONFIG_DIR, file2));
|
|
224775
225065
|
if (!settings?.extraKnownMarketplaces) {
|
|
224776
225066
|
continue;
|
|
224777
225067
|
}
|
|
@@ -238506,20 +238796,20 @@ var require_tls = __commonJS((exports, module) => {
|
|
|
238506
238796
|
}
|
|
238507
238797
|
return !c3.fail;
|
|
238508
238798
|
};
|
|
238509
|
-
tls2.createSessionCache = function(
|
|
238799
|
+
tls2.createSessionCache = function(cache5, capacity) {
|
|
238510
238800
|
var rval = null;
|
|
238511
|
-
if (
|
|
238512
|
-
rval =
|
|
238801
|
+
if (cache5 && cache5.getSession && cache5.setSession && cache5.order) {
|
|
238802
|
+
rval = cache5;
|
|
238513
238803
|
} else {
|
|
238514
238804
|
rval = {};
|
|
238515
|
-
rval.cache =
|
|
238805
|
+
rval.cache = cache5 || {};
|
|
238516
238806
|
rval.capacity = Math.max(capacity || 100, 1);
|
|
238517
238807
|
rval.order = [];
|
|
238518
|
-
for (var key2 in
|
|
238808
|
+
for (var key2 in cache5) {
|
|
238519
238809
|
if (rval.order.length <= capacity) {
|
|
238520
238810
|
rval.order.push(key2);
|
|
238521
238811
|
} else {
|
|
238522
|
-
delete
|
|
238812
|
+
delete cache5[key2];
|
|
238523
238813
|
}
|
|
238524
238814
|
}
|
|
238525
238815
|
rval.getSession = function(sessionId) {
|
|
@@ -241969,7 +242259,7 @@ import { createServer as createHttpsServer, request as httpsRequest } from "node
|
|
|
241969
242259
|
import { connect as connect3, isIP as isIP5 } from "node:net";
|
|
241970
242260
|
import { unlink as unlink4 } from "node:fs";
|
|
241971
242261
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
241972
|
-
import { join as
|
|
242262
|
+
import { join as join40 } from "node:path";
|
|
241973
242263
|
function looksLikeClientHello(buf) {
|
|
241974
242264
|
return buf.length >= 3 && buf[0] === 22 && buf[1] === 3 && buf[2] <= 3;
|
|
241975
242265
|
}
|
|
@@ -242095,7 +242385,7 @@ async function forwardUpstream(filterRequest, req, res, target) {
|
|
|
242095
242385
|
body.pipe(upstream);
|
|
242096
242386
|
}
|
|
242097
242387
|
function innerSocketPath() {
|
|
242098
|
-
return
|
|
242388
|
+
return join40(tmpdir2(), `srt-tt-${process.pid}-${(sockSeq++).toString(36)}.sock`);
|
|
242099
242389
|
}
|
|
242100
242390
|
var sockSeq = 0;
|
|
242101
242391
|
var init_tls_terminate_proxy = __esm(() => {
|
|
@@ -242801,10 +243091,10 @@ var init_socks_proxy = __esm(() => {
|
|
|
242801
243091
|
});
|
|
242802
243092
|
|
|
242803
243093
|
// node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js
|
|
242804
|
-
import { mkdtempSync, readFileSync as
|
|
243094
|
+
import { mkdtempSync, readFileSync as readFileSync15, writeFileSync as writeFileSync6 } from "node:fs";
|
|
242805
243095
|
import { rm as rm2 } from "node:fs/promises";
|
|
242806
243096
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
242807
|
-
import { join as
|
|
243097
|
+
import { join as join41, dirname as dirname21 } from "node:path";
|
|
242808
243098
|
function createMitmCA(opts) {
|
|
242809
243099
|
if (opts.caCertPath && opts.caKeyPath) {
|
|
242810
243100
|
return loadCA(opts.caCertPath, opts.caKeyPath);
|
|
@@ -242879,11 +243169,11 @@ function generateEphemeralCA() {
|
|
|
242879
243169
|
cert.sign(keys2.privateKey, md2.sha256.create());
|
|
242880
243170
|
const certPem = pki2.certificateToPem(cert);
|
|
242881
243171
|
const keyPem = pki2.privateKeyToPem(keys2.privateKey);
|
|
242882
|
-
const dir = mkdtempSync(
|
|
242883
|
-
const certPath =
|
|
242884
|
-
const keyPath =
|
|
242885
|
-
|
|
242886
|
-
|
|
243172
|
+
const dir = mkdtempSync(join41(tmpdir3(), "srt-ca-"));
|
|
243173
|
+
const certPath = join41(dir, "ca.crt");
|
|
243174
|
+
const keyPath = join41(dir, "ca.key");
|
|
243175
|
+
writeFileSync6(certPath, certPem, { mode: 420 });
|
|
243176
|
+
writeFileSync6(keyPath, keyPem, { mode: 384 });
|
|
242887
243177
|
logForDebugging5(`[mitm-ca] generated ephemeral CA at ${certPath}`);
|
|
242888
243178
|
return {
|
|
242889
243179
|
certPath,
|
|
@@ -242900,7 +243190,7 @@ function generateEphemeralCA() {
|
|
|
242900
243190
|
function readPem(path16, label, field) {
|
|
242901
243191
|
let pem;
|
|
242902
243192
|
try {
|
|
242903
|
-
pem =
|
|
243193
|
+
pem = readFileSync15(path16, "utf8");
|
|
242904
243194
|
} catch (err) {
|
|
242905
243195
|
const code = err.code ?? String(err);
|
|
242906
243196
|
throw new Error(`${field}: cannot read ${path16} (${code})`);
|
|
@@ -243513,7 +243803,7 @@ var init_sandbox_utils = __esm(() => {
|
|
|
243513
243803
|
});
|
|
243514
243804
|
|
|
243515
243805
|
// node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js
|
|
243516
|
-
import { join as
|
|
243806
|
+
import { join as join43, dirname as dirname23 } from "node:path";
|
|
243517
243807
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
243518
243808
|
import * as fs8 from "node:fs";
|
|
243519
243809
|
import { execSync } from "node:child_process";
|
|
@@ -243529,11 +243819,11 @@ function getGlobalNpmPaths() {
|
|
|
243529
243819
|
stdio: ["pipe", "pipe", "ignore"]
|
|
243530
243820
|
}).trim();
|
|
243531
243821
|
if (npmRoot) {
|
|
243532
|
-
paths2.push(
|
|
243822
|
+
paths2.push(join43(npmRoot, "@anthropic-ai", "sandbox-runtime"));
|
|
243533
243823
|
}
|
|
243534
243824
|
} catch {}
|
|
243535
243825
|
const home = homedir14();
|
|
243536
|
-
paths2.push(
|
|
243826
|
+
paths2.push(join43("/usr", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join43("/usr", "local", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join43("/opt", "homebrew", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join43(home, ".npm", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join43(home, ".npm-global", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"));
|
|
243537
243827
|
cachedGlobalNpmPaths = paths2;
|
|
243538
243828
|
return paths2;
|
|
243539
243829
|
}
|
|
@@ -243560,11 +243850,11 @@ function getLocalSeccompPaths(filename) {
|
|
|
243560
243850
|
if (!arch)
|
|
243561
243851
|
return [];
|
|
243562
243852
|
const baseDir = dirname23(fileURLToPath4(import.meta.url));
|
|
243563
|
-
const relativePath =
|
|
243853
|
+
const relativePath = join43("vendor", "seccomp", arch, filename);
|
|
243564
243854
|
return [
|
|
243565
|
-
|
|
243566
|
-
|
|
243567
|
-
|
|
243855
|
+
join43(baseDir, relativePath),
|
|
243856
|
+
join43(baseDir, "..", "..", relativePath),
|
|
243857
|
+
join43(baseDir, "..", relativePath)
|
|
243568
243858
|
];
|
|
243569
243859
|
}
|
|
243570
243860
|
function getApplySeccompBinaryPath(seccompBinaryPath) {
|
|
@@ -243597,7 +243887,7 @@ function findApplySeccompPath(seccompBinaryPath) {
|
|
|
243597
243887
|
}
|
|
243598
243888
|
}
|
|
243599
243889
|
for (const globalBase of getGlobalNpmPaths()) {
|
|
243600
|
-
const binaryPath =
|
|
243890
|
+
const binaryPath = join43(globalBase, "vendor", "seccomp", arch, "apply-seccomp");
|
|
243601
243891
|
if (fs8.existsSync(binaryPath)) {
|
|
243602
243892
|
logForDebugging5(`[SeccompFilter] Found apply-seccomp binary in global install: ${binaryPath} (${arch})`);
|
|
243603
243893
|
return binaryPath;
|
|
@@ -243616,7 +243906,7 @@ import { randomBytes as randomBytes2 } from "node:crypto";
|
|
|
243616
243906
|
import * as fs9 from "fs";
|
|
243617
243907
|
import { spawn as spawn5 } from "node:child_process";
|
|
243618
243908
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
243619
|
-
import path17, { join as
|
|
243909
|
+
import path17, { join as join44 } from "node:path";
|
|
243620
243910
|
function findSymlinkInPath(targetPath, allowedWritePaths) {
|
|
243621
243911
|
const parts = targetPath.split(path17.sep);
|
|
243622
243912
|
let currentPath = "";
|
|
@@ -243815,8 +244105,8 @@ function checkLinuxDependencies(opts) {
|
|
|
243815
244105
|
async function initializeLinuxNetworkBridge(httpProxyPort, socksProxyPort, socatPath) {
|
|
243816
244106
|
const socat = socatPath ?? "socat";
|
|
243817
244107
|
const socketId = randomBytes2(8).toString("hex");
|
|
243818
|
-
const httpSocketPath =
|
|
243819
|
-
const socksSocketPath =
|
|
244108
|
+
const httpSocketPath = join44(tmpdir4(), `claude-http-${socketId}.sock`);
|
|
244109
|
+
const socksSocketPath = join44(tmpdir4(), `claude-socks-${socketId}.sock`);
|
|
243820
244110
|
const httpSocatArgs = [
|
|
243821
244111
|
`UNIX-LISTEN:${httpSocketPath},fork,reuseaddr`,
|
|
243822
244112
|
`TCP:localhost:${httpProxyPort},keepalive,keepidle=10,keepintvl=5,keepcnt=3`
|
|
@@ -249491,9 +249781,9 @@ __export(exports_sandbox_adapter, {
|
|
|
249491
249781
|
SandboxRuntimeConfigSchema: () => SandboxRuntimeConfigSchema,
|
|
249492
249782
|
SandboxManager: () => SandboxManager2
|
|
249493
249783
|
});
|
|
249494
|
-
import { rmSync as
|
|
249784
|
+
import { rmSync as rmSync6, statSync as statSync8 } from "fs";
|
|
249495
249785
|
import { readFile as readFile9 } from "fs/promises";
|
|
249496
|
-
import { join as
|
|
249786
|
+
import { join as join45, resolve as resolve19, sep as sep10 } from "path";
|
|
249497
249787
|
function permissionRuleValueFromString2(ruleString) {
|
|
249498
249788
|
const matches = ruleString.match(/^([^(]+)\(([^)]+)\)$/);
|
|
249499
249789
|
if (!matches) {
|
|
@@ -249669,13 +249959,13 @@ function convertToSandboxRuntimeConfig(settings) {
|
|
|
249669
249959
|
function scrubBareGitRepoFiles() {
|
|
249670
249960
|
for (const p of bareGitRepoScrubPaths) {
|
|
249671
249961
|
try {
|
|
249672
|
-
|
|
249962
|
+
rmSync6(p, { recursive: true });
|
|
249673
249963
|
logForDebugging(`[Sandbox] scrubbed planted bare-repo file: ${p}`);
|
|
249674
249964
|
} catch {}
|
|
249675
249965
|
}
|
|
249676
249966
|
}
|
|
249677
249967
|
async function detectWorktreeMainRepoPath(cwd2) {
|
|
249678
|
-
const gitPath =
|
|
249968
|
+
const gitPath = join45(cwd2, ".git");
|
|
249679
249969
|
try {
|
|
249680
249970
|
const gitContent = await readFile9(gitPath, { encoding: "utf8" });
|
|
249681
249971
|
const gitdirMatch = gitContent.match(/^gitdir:\s*(.+)$/m);
|
|
@@ -251553,9 +251843,9 @@ var init_pathValidation = __esm(() => {
|
|
|
251553
251843
|
});
|
|
251554
251844
|
|
|
251555
251845
|
// src/utils/plugins/pluginDirectories.ts
|
|
251556
|
-
import { mkdirSync as
|
|
251846
|
+
import { mkdirSync as mkdirSync8 } from "fs";
|
|
251557
251847
|
import { readdir as readdir10, rm as rm3, stat as stat15 } from "fs/promises";
|
|
251558
|
-
import { delimiter as delimiter2, join as
|
|
251848
|
+
import { delimiter as delimiter2, join as join46 } from "path";
|
|
251559
251849
|
function getPluginsDirectoryName() {
|
|
251560
251850
|
if (getUseCoworkPlugins()) {
|
|
251561
251851
|
return COWORK_PLUGINS_DIR;
|
|
@@ -251570,7 +251860,7 @@ function getPluginsDirectory() {
|
|
|
251570
251860
|
if (envOverride) {
|
|
251571
251861
|
return expandTilde(envOverride);
|
|
251572
251862
|
}
|
|
251573
|
-
return
|
|
251863
|
+
return join46(getRayuConfigHomeDir(), getPluginsDirectoryName());
|
|
251574
251864
|
}
|
|
251575
251865
|
function getPluginSeedDirs() {
|
|
251576
251866
|
const raw = process.env.CLAUDE_CODE_PLUGIN_SEED_DIR;
|
|
@@ -251582,11 +251872,11 @@ function sanitizePluginId(pluginId) {
|
|
|
251582
251872
|
return pluginId.replace(/[^a-zA-Z0-9\-_]/g, "-");
|
|
251583
251873
|
}
|
|
251584
251874
|
function pluginDataDirPath(pluginId) {
|
|
251585
|
-
return
|
|
251875
|
+
return join46(getPluginsDirectory(), "data", sanitizePluginId(pluginId));
|
|
251586
251876
|
}
|
|
251587
251877
|
function getPluginDataDir(pluginId) {
|
|
251588
251878
|
const dir = pluginDataDirPath(pluginId);
|
|
251589
|
-
|
|
251879
|
+
mkdirSync8(dir, { recursive: true });
|
|
251590
251880
|
return dir;
|
|
251591
251881
|
}
|
|
251592
251882
|
async function getPluginDataDirSize(pluginId) {
|
|
@@ -251594,7 +251884,7 @@ async function getPluginDataDirSize(pluginId) {
|
|
|
251594
251884
|
let bytes = 0;
|
|
251595
251885
|
const walk2 = async (p) => {
|
|
251596
251886
|
for (const entry of await readdir10(p, { withFileTypes: true })) {
|
|
251597
|
-
const full =
|
|
251887
|
+
const full = join46(p, entry.name);
|
|
251598
251888
|
if (entry.isDirectory()) {
|
|
251599
251889
|
await walk2(full);
|
|
251600
251890
|
} else {
|
|
@@ -252098,11 +252388,11 @@ var init_macOsKeychainStorage = __esm(() => {
|
|
|
252098
252388
|
|
|
252099
252389
|
// src/utils/secureStorage/plainTextStorage.ts
|
|
252100
252390
|
import { chmodSync as chmodSync4 } from "fs";
|
|
252101
|
-
import { join as
|
|
252391
|
+
import { join as join47 } from "path";
|
|
252102
252392
|
function getStoragePath() {
|
|
252103
252393
|
const storageDir = getRayuConfigHomeDir();
|
|
252104
252394
|
const storageFileName = ".credentials.json";
|
|
252105
|
-
return { storageDir, storagePath:
|
|
252395
|
+
return { storageDir, storagePath: join47(storageDir, storageFileName) };
|
|
252106
252396
|
}
|
|
252107
252397
|
var plainTextStorage;
|
|
252108
252398
|
var init_plainTextStorage = __esm(() => {
|
|
@@ -259929,13 +260219,13 @@ var init_constants6 = __esm(() => {
|
|
|
259929
260219
|
});
|
|
259930
260220
|
|
|
259931
260221
|
// node_modules/@anthropic-ai/mcpb/dist/cli/init.js
|
|
259932
|
-
import { existsSync as
|
|
259933
|
-
import { basename as basename11, join as
|
|
260222
|
+
import { existsSync as existsSync16, readFileSync as readFileSync17, writeFileSync as writeFileSync7 } from "fs";
|
|
260223
|
+
import { basename as basename11, join as join48, resolve as resolve21 } from "path";
|
|
259934
260224
|
function readPackageJson(dirPath) {
|
|
259935
|
-
const packageJsonPath =
|
|
259936
|
-
if (
|
|
260225
|
+
const packageJsonPath = join48(dirPath, "package.json");
|
|
260226
|
+
if (existsSync16(packageJsonPath)) {
|
|
259937
260227
|
try {
|
|
259938
|
-
return JSON.parse(
|
|
260228
|
+
return JSON.parse(readFileSync17(packageJsonPath, "utf-8"));
|
|
259939
260229
|
} catch (e2) {}
|
|
259940
260230
|
}
|
|
259941
260231
|
return {};
|
|
@@ -260622,8 +260912,8 @@ Next steps:`);
|
|
|
260622
260912
|
}
|
|
260623
260913
|
async function initExtension(targetPath = process.cwd(), nonInteractive = false) {
|
|
260624
260914
|
const resolvedPath = resolve21(targetPath);
|
|
260625
|
-
const manifestPath =
|
|
260626
|
-
if (
|
|
260915
|
+
const manifestPath = join48(resolvedPath, "manifest.json");
|
|
260916
|
+
if (existsSync16(manifestPath)) {
|
|
260627
260917
|
if (nonInteractive) {
|
|
260628
260918
|
console.log("manifest.json already exists. Use --force to overwrite in non-interactive mode.");
|
|
260629
260919
|
return false;
|
|
@@ -260658,7 +260948,7 @@ async function initExtension(targetPath = process.cwd(), nonInteractive = false)
|
|
|
260658
260948
|
const userConfig = nonInteractive ? {} : await promptUserConfig();
|
|
260659
260949
|
const optionalFields = nonInteractive ? getDefaultOptionalFields(packageData) : await promptOptionalFields(packageData);
|
|
260660
260950
|
const manifest = buildManifest(basicInfo, longDescription, authorInfo, urls, visualAssets, serverConfig, toolsData.tools, toolsData.toolsGenerated, promptsData.prompts, promptsData.promptsGenerated, compatibility, userConfig, optionalFields);
|
|
260661
|
-
|
|
260951
|
+
writeFileSync7(manifestPath, JSON.stringify(manifest, null, 2) + `
|
|
260662
260952
|
`);
|
|
260663
260953
|
console.log(`
|
|
260664
260954
|
Created manifest.json at ${manifestPath}`);
|
|
@@ -262903,15 +263193,15 @@ var init_esm8 = __esm(() => {
|
|
|
262903
263193
|
});
|
|
262904
263194
|
|
|
262905
263195
|
// node_modules/@anthropic-ai/mcpb/dist/node/files.js
|
|
262906
|
-
import { existsSync as
|
|
262907
|
-
import { join as
|
|
263196
|
+
import { existsSync as existsSync17, readdirSync as readdirSync4, readFileSync as readFileSync18, statSync as statSync9 } from "fs";
|
|
263197
|
+
import { join as join49, relative as relative6, sep as sep11 } from "path";
|
|
262908
263198
|
function readMcpbIgnorePatterns(baseDir) {
|
|
262909
|
-
const mcpbIgnorePath =
|
|
262910
|
-
if (!
|
|
263199
|
+
const mcpbIgnorePath = join49(baseDir, ".mcpbignore");
|
|
263200
|
+
if (!existsSync17(mcpbIgnorePath)) {
|
|
262911
263201
|
return [];
|
|
262912
263202
|
}
|
|
262913
263203
|
try {
|
|
262914
|
-
const content =
|
|
263204
|
+
const content = readFileSync18(mcpbIgnorePath, "utf-8");
|
|
262915
263205
|
return content.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
262916
263206
|
} catch (error54) {
|
|
262917
263207
|
console.warn(`Warning: Could not read .mcpbignore file: ${error54 instanceof Error ? error54.message : "Unknown error"}`);
|
|
@@ -262928,7 +263218,7 @@ function getAllFiles(dirPath, baseDir = dirPath, fileList = {}, additionalPatter
|
|
|
262928
263218
|
const files = readdirSync4(dirPath);
|
|
262929
263219
|
const ignoreChecker = buildIgnoreChecker(additionalPatterns);
|
|
262930
263220
|
for (const file2 of files) {
|
|
262931
|
-
const filePath =
|
|
263221
|
+
const filePath = join49(dirPath, file2);
|
|
262932
263222
|
const relativePath = relative6(baseDir, filePath);
|
|
262933
263223
|
if (ignoreChecker.ignores(relativePath)) {
|
|
262934
263224
|
continue;
|
|
@@ -262938,7 +263228,7 @@ function getAllFiles(dirPath, baseDir = dirPath, fileList = {}, additionalPatter
|
|
|
262938
263228
|
getAllFiles(filePath, baseDir, fileList, additionalPatterns);
|
|
262939
263229
|
} else {
|
|
262940
263230
|
const zipPath = relativePath.split(sep11).join("/");
|
|
262941
|
-
fileList[zipPath] =
|
|
263231
|
+
fileList[zipPath] = readFileSync18(filePath);
|
|
262942
263232
|
}
|
|
262943
263233
|
}
|
|
262944
263234
|
return fileList;
|
|
@@ -262947,7 +263237,7 @@ function getAllFilesWithCount(dirPath, baseDir = dirPath, fileList = {}, additio
|
|
|
262947
263237
|
const files = readdirSync4(dirPath);
|
|
262948
263238
|
const ignoreChecker = buildIgnoreChecker(additionalPatterns);
|
|
262949
263239
|
for (const file2 of files) {
|
|
262950
|
-
const filePath =
|
|
263240
|
+
const filePath = join49(dirPath, file2);
|
|
262951
263241
|
const relativePath = relative6(baseDir, filePath);
|
|
262952
263242
|
if (ignoreChecker.ignores(relativePath)) {
|
|
262953
263243
|
ignoredCount++;
|
|
@@ -262960,7 +263250,7 @@ function getAllFilesWithCount(dirPath, baseDir = dirPath, fileList = {}, additio
|
|
|
262960
263250
|
} else {
|
|
262961
263251
|
const zipPath = relativePath.split(sep11).join("/");
|
|
262962
263252
|
fileList[zipPath] = {
|
|
262963
|
-
data:
|
|
263253
|
+
data: readFileSync18(filePath),
|
|
262964
263254
|
mode: stat16.mode
|
|
262965
263255
|
};
|
|
262966
263256
|
}
|
|
@@ -264426,7 +264716,7 @@ var require_jsonfile = __commonJS((exports, module) => {
|
|
|
264426
264716
|
return obj;
|
|
264427
264717
|
}
|
|
264428
264718
|
var readFile10 = universalify.fromPromise(_readFile);
|
|
264429
|
-
function
|
|
264719
|
+
function readFileSync19(file2, options = {}) {
|
|
264430
264720
|
if (typeof options === "string") {
|
|
264431
264721
|
options = { encoding: options };
|
|
264432
264722
|
}
|
|
@@ -264451,16 +264741,16 @@ var require_jsonfile = __commonJS((exports, module) => {
|
|
|
264451
264741
|
await universalify.fromCallback(fs11.writeFile)(file2, str2, options);
|
|
264452
264742
|
}
|
|
264453
264743
|
var writeFile4 = universalify.fromPromise(_writeFile);
|
|
264454
|
-
function
|
|
264744
|
+
function writeFileSync8(file2, obj, options = {}) {
|
|
264455
264745
|
const fs11 = options.fs || _fs;
|
|
264456
264746
|
const str2 = stringify3(obj, options);
|
|
264457
264747
|
return fs11.writeFileSync(file2, str2, options);
|
|
264458
264748
|
}
|
|
264459
264749
|
module.exports = {
|
|
264460
264750
|
readFile: readFile10,
|
|
264461
|
-
readFileSync:
|
|
264751
|
+
readFileSync: readFileSync19,
|
|
264462
264752
|
writeFile: writeFile4,
|
|
264463
|
-
writeFileSync:
|
|
264753
|
+
writeFileSync: writeFileSync8
|
|
264464
264754
|
};
|
|
264465
264755
|
});
|
|
264466
264756
|
|
|
@@ -265168,16 +265458,16 @@ var require_pretty_bytes = __commonJS((exports, module) => {
|
|
|
265168
265458
|
|
|
265169
265459
|
// node_modules/@anthropic-ai/mcpb/dist/node/sign.js
|
|
265170
265460
|
import { execFile as execFile5 } from "child_process";
|
|
265171
|
-
import { readFileSync as
|
|
265461
|
+
import { readFileSync as readFileSync19, writeFileSync as writeFileSync8 } from "fs";
|
|
265172
265462
|
import { mkdtemp, rm as rm4, writeFile as writeFile4 } from "fs/promises";
|
|
265173
265463
|
import { tmpdir as tmpdir5 } from "os";
|
|
265174
|
-
import { join as
|
|
265464
|
+
import { join as join50 } from "path";
|
|
265175
265465
|
import { promisify as promisify6 } from "util";
|
|
265176
265466
|
function signMcpbFile(mcpbPath, certPath, keyPath, intermediates) {
|
|
265177
|
-
const mcpbContent =
|
|
265178
|
-
const certificatePem =
|
|
265179
|
-
const privateKeyPem =
|
|
265180
|
-
const intermediatePems = intermediates?.map((path19) =>
|
|
265467
|
+
const mcpbContent = readFileSync19(mcpbPath);
|
|
265468
|
+
const certificatePem = readFileSync19(certPath, "utf-8");
|
|
265469
|
+
const privateKeyPem = readFileSync19(keyPath, "utf-8");
|
|
265470
|
+
const intermediatePems = intermediates?.map((path19) => readFileSync19(path19, "utf-8"));
|
|
265181
265471
|
const p7 = import_node_forge3.default.pkcs7.createSignedData();
|
|
265182
265472
|
p7.content = import_node_forge3.default.util.createBuffer(mcpbContent);
|
|
265183
265473
|
const signingCert = import_node_forge3.default.pki.certificateFromPem(certificatePem);
|
|
@@ -265210,11 +265500,11 @@ function signMcpbFile(mcpbPath, certPath, keyPath, intermediates) {
|
|
|
265210
265500
|
const pkcs7Signature = Buffer.from(asn1.getBytes(), "binary");
|
|
265211
265501
|
const signatureBlock = createSignatureBlock(pkcs7Signature);
|
|
265212
265502
|
const signedContent = Buffer.concat([mcpbContent, signatureBlock]);
|
|
265213
|
-
|
|
265503
|
+
writeFileSync8(mcpbPath, signedContent);
|
|
265214
265504
|
}
|
|
265215
265505
|
async function verifyMcpbFile(mcpbPath) {
|
|
265216
265506
|
try {
|
|
265217
|
-
const fileContent =
|
|
265507
|
+
const fileContent = readFileSync19(mcpbPath);
|
|
265218
265508
|
const { originalContent, pkcs7Signature } = extractSignatureBlock(fileContent);
|
|
265219
265509
|
if (!pkcs7Signature) {
|
|
265220
265510
|
return { status: "unsigned" };
|
|
@@ -265316,8 +265606,8 @@ function extractSignatureBlock(fileContent) {
|
|
|
265316
265606
|
async function verifyCertificateChain(certificate, intermediates) {
|
|
265317
265607
|
let tempDir = null;
|
|
265318
265608
|
try {
|
|
265319
|
-
tempDir = await mkdtemp(
|
|
265320
|
-
const certChainPath =
|
|
265609
|
+
tempDir = await mkdtemp(join50(tmpdir5(), "mcpb-verify-"));
|
|
265610
|
+
const certChainPath = join50(tempDir, "chain.pem");
|
|
265321
265611
|
const certChain = [certificate, ...intermediates || []].join(`
|
|
265322
265612
|
`);
|
|
265323
265613
|
await writeFile4(certChainPath, certChain);
|
|
@@ -265407,9 +265697,9 @@ async function verifyCertificateChain(certificate, intermediates) {
|
|
|
265407
265697
|
}
|
|
265408
265698
|
}
|
|
265409
265699
|
function unsignMcpbFile(mcpbPath) {
|
|
265410
|
-
const fileContent =
|
|
265700
|
+
const fileContent = readFileSync19(mcpbPath);
|
|
265411
265701
|
const { originalContent } = extractSignatureBlock(fileContent);
|
|
265412
|
-
|
|
265702
|
+
writeFileSync8(mcpbPath, originalContent);
|
|
265413
265703
|
}
|
|
265414
265704
|
var import_node_forge3, SIGNATURE_HEADER2 = "MCPB_SIG_V1", SIGNATURE_FOOTER = "MCPB_SIG_END", execFileAsync3;
|
|
265415
265705
|
var init_sign = __esm(() => {
|
|
@@ -265449,21 +265739,21 @@ function getLogger({ silent = false } = {}) {
|
|
|
265449
265739
|
}
|
|
265450
265740
|
|
|
265451
265741
|
// node_modules/@anthropic-ai/mcpb/dist/cli/unpack.js
|
|
265452
|
-
import { chmodSync as chmodSync5, existsSync as
|
|
265453
|
-
import { join as
|
|
265742
|
+
import { chmodSync as chmodSync5, existsSync as existsSync18, mkdirSync as mkdirSync9, readFileSync as readFileSync20, writeFileSync as writeFileSync9 } from "fs";
|
|
265743
|
+
import { join as join51, resolve as resolve22, sep as sep12 } from "path";
|
|
265454
265744
|
async function unpackExtension({ mcpbPath, outputDir, silent }) {
|
|
265455
265745
|
const logger = getLogger({ silent });
|
|
265456
265746
|
const resolvedMcpbPath = resolve22(mcpbPath);
|
|
265457
|
-
if (!
|
|
265747
|
+
if (!existsSync18(resolvedMcpbPath)) {
|
|
265458
265748
|
logger.error(`ERROR: MCPB file not found: ${mcpbPath}`);
|
|
265459
265749
|
return false;
|
|
265460
265750
|
}
|
|
265461
265751
|
const finalOutputDir = outputDir ? resolve22(outputDir) : process.cwd();
|
|
265462
|
-
if (!
|
|
265463
|
-
|
|
265752
|
+
if (!existsSync18(finalOutputDir)) {
|
|
265753
|
+
mkdirSync9(finalOutputDir, { recursive: true });
|
|
265464
265754
|
}
|
|
265465
265755
|
try {
|
|
265466
|
-
const fileContent =
|
|
265756
|
+
const fileContent = readFileSync20(resolvedMcpbPath);
|
|
265467
265757
|
const { originalContent } = extractSignatureBlock(fileContent);
|
|
265468
265758
|
const fileAttributes = new Map;
|
|
265469
265759
|
const isUnix = process.platform !== "win32";
|
|
@@ -265502,17 +265792,17 @@ async function unpackExtension({ mcpbPath, outputDir, silent }) {
|
|
|
265502
265792
|
for (const relativePath in decompressed) {
|
|
265503
265793
|
if (Object.prototype.hasOwnProperty.call(decompressed, relativePath)) {
|
|
265504
265794
|
const data = decompressed[relativePath];
|
|
265505
|
-
const fullPath =
|
|
265795
|
+
const fullPath = join51(finalOutputDir, relativePath);
|
|
265506
265796
|
const normalizedPath = resolve22(fullPath);
|
|
265507
265797
|
const normalizedOutputDir = resolve22(finalOutputDir);
|
|
265508
265798
|
if (!normalizedPath.startsWith(normalizedOutputDir + sep12) && normalizedPath !== normalizedOutputDir) {
|
|
265509
265799
|
throw new Error(`Path traversal attempt detected: ${relativePath}`);
|
|
265510
265800
|
}
|
|
265511
|
-
const dir =
|
|
265512
|
-
if (!
|
|
265513
|
-
|
|
265801
|
+
const dir = join51(fullPath, "..");
|
|
265802
|
+
if (!existsSync18(dir)) {
|
|
265803
|
+
mkdirSync9(dir, { recursive: true });
|
|
265514
265804
|
}
|
|
265515
|
-
|
|
265805
|
+
writeFileSync9(fullPath, data);
|
|
265516
265806
|
if (isUnix && fileAttributes.has(relativePath)) {
|
|
265517
265807
|
try {
|
|
265518
265808
|
const mode = fileAttributes.get(relativePath);
|
|
@@ -265554,10 +265844,10 @@ var init_manifestVersionResolve = __esm(() => {
|
|
|
265554
265844
|
});
|
|
265555
265845
|
|
|
265556
265846
|
// node_modules/@anthropic-ai/mcpb/dist/node/validate.js
|
|
265557
|
-
import { existsSync as
|
|
265847
|
+
import { existsSync as existsSync19, readFileSync as readFileSync21, statSync as statSync10 } from "fs";
|
|
265558
265848
|
import * as fs11 from "fs/promises";
|
|
265559
265849
|
import * as os4 from "os";
|
|
265560
|
-
import { dirname as dirname26, isAbsolute as isAbsolute12, join as
|
|
265850
|
+
import { dirname as dirname26, isAbsolute as isAbsolute12, join as join52, resolve as resolve23 } from "path";
|
|
265561
265851
|
function isPNG(buffer) {
|
|
265562
265852
|
return buffer.length >= 8 && buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78 && buffer[3] === 71 && buffer[4] === 13 && buffer[5] === 10 && buffer[6] === 26 && buffer[7] === 10;
|
|
265563
265853
|
}
|
|
@@ -265577,12 +265867,12 @@ function validateIcon(iconPath, baseDir) {
|
|
|
265577
265867
|
errors6.push("Icon path must be relative to the bundle root, not an absolute path. " + `Found: "${iconPath}"`);
|
|
265578
265868
|
}
|
|
265579
265869
|
if (!isRemoteUrl && !isAbsolutePath && !hasVariableSubstitution) {
|
|
265580
|
-
const fullIconPath =
|
|
265581
|
-
if (!
|
|
265870
|
+
const fullIconPath = join52(baseDir, iconPath);
|
|
265871
|
+
if (!existsSync19(fullIconPath)) {
|
|
265582
265872
|
errors6.push(`Icon file not found at path: ${iconPath}`);
|
|
265583
265873
|
} else {
|
|
265584
265874
|
try {
|
|
265585
|
-
const buffer =
|
|
265875
|
+
const buffer = readFileSync21(fullIconPath);
|
|
265586
265876
|
if (!isPNG(buffer)) {
|
|
265587
265877
|
errors6.push(`Icon file must be PNG format. The file at "${iconPath}" does not appear to be a valid PNG file.`);
|
|
265588
265878
|
} else {
|
|
@@ -265603,10 +265893,10 @@ function validateManifest(inputPath) {
|
|
|
265603
265893
|
try {
|
|
265604
265894
|
const resolvedPath = resolve23(inputPath);
|
|
265605
265895
|
let manifestPath = resolvedPath;
|
|
265606
|
-
if (
|
|
265607
|
-
manifestPath =
|
|
265896
|
+
if (existsSync19(resolvedPath) && statSync10(resolvedPath).isDirectory()) {
|
|
265897
|
+
manifestPath = join52(resolvedPath, "manifest.json");
|
|
265608
265898
|
}
|
|
265609
|
-
const manifestContent =
|
|
265899
|
+
const manifestContent = readFileSync21(manifestPath, "utf-8");
|
|
265610
265900
|
const manifestData = JSON.parse(manifestContent);
|
|
265611
265901
|
const manifestVersion = getManifestVersionFromRawData(manifestData);
|
|
265612
265902
|
if (!manifestVersion) {
|
|
@@ -265651,7 +265941,7 @@ Icon validation warnings:
|
|
|
265651
265941
|
if (error54 instanceof Error) {
|
|
265652
265942
|
if (error54.message.includes("ENOENT")) {
|
|
265653
265943
|
console.error(`ERROR: File not found: ${inputPath}`);
|
|
265654
|
-
if (
|
|
265944
|
+
if (existsSync19(resolve23(inputPath)) && statSync10(resolve23(inputPath)).isDirectory()) {
|
|
265655
265945
|
console.error(` (No manifest.json found in directory)`);
|
|
265656
265946
|
}
|
|
265657
265947
|
} else if (error54.message.includes("JSON")) {
|
|
@@ -265692,7 +265982,7 @@ async function cleanMcpb(inputPath) {
|
|
|
265692
265982
|
console.log(" -- Manifest already valid per MCPB schema");
|
|
265693
265983
|
}
|
|
265694
265984
|
const nodeModulesPath = resolve23(unpackPath, "node_modules");
|
|
265695
|
-
if (
|
|
265985
|
+
if (existsSync19(nodeModulesPath)) {
|
|
265696
265986
|
console.log(" -- node_modules found, deleting development dependencies");
|
|
265697
265987
|
const destroyer = new import_galactus.DestroyerOfModules({
|
|
265698
265988
|
rootDirectory: unpackPath
|
|
@@ -265744,8 +266034,8 @@ __export(exports_pack, {
|
|
|
265744
266034
|
packExtension: () => packExtension
|
|
265745
266035
|
});
|
|
265746
266036
|
import { createHash as createHash5 } from "crypto";
|
|
265747
|
-
import { existsSync as
|
|
265748
|
-
import { basename as basename12, join as
|
|
266037
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync10, readFileSync as readFileSync22, statSync as statSync11, writeFileSync as writeFileSync10 } from "fs";
|
|
266038
|
+
import { basename as basename12, join as join53, relative as relative7, resolve as resolve24, sep as sep13 } from "path";
|
|
265749
266039
|
function formatFileSize2(bytes) {
|
|
265750
266040
|
if (bytes < 1024) {
|
|
265751
266041
|
return `${bytes}B`;
|
|
@@ -265761,12 +266051,12 @@ function sanitizeNameForFilename(name) {
|
|
|
265761
266051
|
async function packExtension({ extensionPath, outputPath, silent }) {
|
|
265762
266052
|
const resolvedPath = resolve24(extensionPath);
|
|
265763
266053
|
const logger = getLogger({ silent });
|
|
265764
|
-
if (!
|
|
266054
|
+
if (!existsSync20(resolvedPath) || !statSync11(resolvedPath).isDirectory()) {
|
|
265765
266055
|
logger.error(`ERROR: Directory not found: ${extensionPath}`);
|
|
265766
266056
|
return false;
|
|
265767
266057
|
}
|
|
265768
|
-
const manifestPath =
|
|
265769
|
-
if (!
|
|
266058
|
+
const manifestPath = join53(resolvedPath, "manifest.json");
|
|
266059
|
+
if (!existsSync20(manifestPath)) {
|
|
265770
266060
|
logger.log(`No manifest.json found in ${extensionPath}`);
|
|
265771
266061
|
const shouldInit = await esm_default2({
|
|
265772
266062
|
message: "Would you like to create a manifest.json file?",
|
|
@@ -265790,7 +266080,7 @@ async function packExtension({ extensionPath, outputPath, silent }) {
|
|
|
265790
266080
|
}
|
|
265791
266081
|
let manifest;
|
|
265792
266082
|
try {
|
|
265793
|
-
const manifestContent =
|
|
266083
|
+
const manifestContent = readFileSync22(manifestPath, "utf-8");
|
|
265794
266084
|
const manifestData = JSON.parse(manifestContent);
|
|
265795
266085
|
const manifestVersion = getManifestVersionFromRawData(manifestData);
|
|
265796
266086
|
if (!manifestVersion) {
|
|
@@ -265808,8 +266098,8 @@ async function packExtension({ extensionPath, outputPath, silent }) {
|
|
|
265808
266098
|
}
|
|
265809
266099
|
const extensionName = basename12(resolvedPath);
|
|
265810
266100
|
const finalOutputPath = outputPath ? resolve24(outputPath) : resolve24(`${extensionName}.mcpb`);
|
|
265811
|
-
const outputDir =
|
|
265812
|
-
|
|
266101
|
+
const outputDir = join53(finalOutputPath, "..");
|
|
266102
|
+
mkdirSync10(outputDir, { recursive: true });
|
|
265813
266103
|
try {
|
|
265814
266104
|
const mcpbIgnorePatterns = readMcpbIgnorePatterns(resolvedPath);
|
|
265815
266105
|
const { files, ignoredCount } = getAllFilesWithCount(resolvedPath, resolvedPath, {}, mcpbIgnorePatterns);
|
|
@@ -265867,7 +266157,7 @@ async function packExtension({ extensionPath, outputPath, silent }) {
|
|
|
265867
266157
|
level: 9,
|
|
265868
266158
|
mtime: new Date
|
|
265869
266159
|
});
|
|
265870
|
-
|
|
266160
|
+
writeFileSync10(finalOutputPath, zipData);
|
|
265871
266161
|
const shasum = createHash5("sha1").update(zipData).digest("hex");
|
|
265872
266162
|
const sanitizedName = sanitizeNameForFilename(manifest.name);
|
|
265873
266163
|
const archiveName = `${sanitizedName}-${manifest.version}.mcpb`;
|
|
@@ -266285,25 +266575,25 @@ var init_zip = __esm(() => {
|
|
|
266285
266575
|
|
|
266286
266576
|
// src/utils/systemDirectories.ts
|
|
266287
266577
|
import { homedir as homedir16 } from "os";
|
|
266288
|
-
import { join as
|
|
266578
|
+
import { join as join54 } from "path";
|
|
266289
266579
|
function getSystemDirectories(options) {
|
|
266290
266580
|
const platform2 = options?.platform ?? getPlatform();
|
|
266291
266581
|
const homeDir = options?.homedir ?? homedir16();
|
|
266292
266582
|
const env7 = options?.env ?? process.env;
|
|
266293
266583
|
const defaults4 = {
|
|
266294
266584
|
HOME: homeDir,
|
|
266295
|
-
DESKTOP:
|
|
266296
|
-
DOCUMENTS:
|
|
266297
|
-
DOWNLOADS:
|
|
266585
|
+
DESKTOP: join54(homeDir, "Desktop"),
|
|
266586
|
+
DOCUMENTS: join54(homeDir, "Documents"),
|
|
266587
|
+
DOWNLOADS: join54(homeDir, "Downloads")
|
|
266298
266588
|
};
|
|
266299
266589
|
switch (platform2) {
|
|
266300
266590
|
case "windows": {
|
|
266301
266591
|
const userProfile = env7.USERPROFILE || homeDir;
|
|
266302
266592
|
return {
|
|
266303
266593
|
HOME: homeDir,
|
|
266304
|
-
DESKTOP:
|
|
266305
|
-
DOCUMENTS:
|
|
266306
|
-
DOWNLOADS:
|
|
266594
|
+
DESKTOP: join54(userProfile, "Desktop"),
|
|
266595
|
+
DOCUMENTS: join54(userProfile, "Documents"),
|
|
266596
|
+
DOWNLOADS: join54(userProfile, "Downloads")
|
|
266307
266597
|
};
|
|
266308
266598
|
}
|
|
266309
266599
|
case "linux":
|
|
@@ -266332,7 +266622,7 @@ var init_systemDirectories = __esm(() => {
|
|
|
266332
266622
|
// src/utils/plugins/mcpbHandler.ts
|
|
266333
266623
|
import { createHash as createHash6 } from "crypto";
|
|
266334
266624
|
import { chmod, writeFile as writeFile6 } from "fs/promises";
|
|
266335
|
-
import { dirname as dirname27, join as
|
|
266625
|
+
import { dirname as dirname27, join as join55 } from "path";
|
|
266336
266626
|
function isMcpbSource(source) {
|
|
266337
266627
|
return source.endsWith(".mcpb") || source.endsWith(".dxt");
|
|
266338
266628
|
}
|
|
@@ -266343,11 +266633,11 @@ function generateContentHash(data) {
|
|
|
266343
266633
|
return createHash6("sha256").update(data).digest("hex").substring(0, 16);
|
|
266344
266634
|
}
|
|
266345
266635
|
function getMcpbCacheDir(pluginPath) {
|
|
266346
|
-
return
|
|
266636
|
+
return join55(pluginPath, ".mcpb-cache");
|
|
266347
266637
|
}
|
|
266348
266638
|
function getMetadataPath(cacheDir, source) {
|
|
266349
266639
|
const sourceHash = createHash6("md5").update(source).digest("hex").substring(0, 8);
|
|
266350
|
-
return
|
|
266640
|
+
return join55(cacheDir, `${sourceHash}.metadata.json`);
|
|
266351
266641
|
}
|
|
266352
266642
|
function serverSecretsKey(pluginId, serverName) {
|
|
266353
266643
|
return `${pluginId}/${serverName}`;
|
|
@@ -266567,7 +266857,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
266567
266857
|
const entries = Object.entries(unzipped).filter(([k2]) => !k2.endsWith("/"));
|
|
266568
266858
|
const totalFiles = entries.length;
|
|
266569
266859
|
for (const [filePath, fileData] of entries) {
|
|
266570
|
-
const fullPath =
|
|
266860
|
+
const fullPath = join55(extractPath, filePath);
|
|
266571
266861
|
const dir = dirname27(fullPath);
|
|
266572
266862
|
if (dir !== extractPath) {
|
|
266573
266863
|
await getFsImplementation().mkdir(dir);
|
|
@@ -266612,7 +266902,7 @@ async function checkMcpbChanged(source, pluginPath) {
|
|
|
266612
266902
|
return true;
|
|
266613
266903
|
}
|
|
266614
266904
|
if (!isUrl2(source)) {
|
|
266615
|
-
const localPath =
|
|
266905
|
+
const localPath = join55(pluginPath, source);
|
|
266616
266906
|
let stats2;
|
|
266617
266907
|
try {
|
|
266618
266908
|
stats2 = await fs12.stat(localPath);
|
|
@@ -266642,7 +266932,7 @@ async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUs
|
|
|
266642
266932
|
const metadata = await loadCacheMetadata(cacheDir, source);
|
|
266643
266933
|
if (metadata && !await checkMcpbChanged(source, pluginPath)) {
|
|
266644
266934
|
logForDebugging(`Using cached MCPB from ${metadata.extractedPath} (hash: ${metadata.contentHash})`);
|
|
266645
|
-
const manifestPath =
|
|
266935
|
+
const manifestPath = join55(metadata.extractedPath, "manifest.json");
|
|
266646
266936
|
let manifestContent;
|
|
266647
266937
|
try {
|
|
266648
266938
|
manifestContent = await fs12.readFile(manifestPath, { encoding: "utf-8" });
|
|
@@ -266695,10 +266985,10 @@ async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUs
|
|
|
266695
266985
|
let mcpbFilePath;
|
|
266696
266986
|
if (isUrl2(source)) {
|
|
266697
266987
|
const sourceHash = createHash6("md5").update(source).digest("hex").substring(0, 8);
|
|
266698
|
-
mcpbFilePath =
|
|
266988
|
+
mcpbFilePath = join55(cacheDir, `${sourceHash}.mcpb`);
|
|
266699
266989
|
mcpbData = await downloadMcpb(source, mcpbFilePath, onProgress);
|
|
266700
266990
|
} else {
|
|
266701
|
-
const localPath =
|
|
266991
|
+
const localPath = join55(pluginPath, source);
|
|
266702
266992
|
if (onProgress) {
|
|
266703
266993
|
onProgress(`Loading ${source}...`);
|
|
266704
266994
|
}
|
|
@@ -266734,7 +267024,7 @@ async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUs
|
|
|
266734
267024
|
logError2(error54);
|
|
266735
267025
|
throw error54;
|
|
266736
267026
|
}
|
|
266737
|
-
const extractPath =
|
|
267027
|
+
const extractPath = join55(cacheDir, contentHash);
|
|
266738
267028
|
await extractMcpbContents(unzipped, extractPath, modes, onProgress);
|
|
266739
267029
|
if (manifest.user_config && Object.keys(manifest.user_config).length > 0) {
|
|
266740
267030
|
const serverName = manifest.name;
|
|
@@ -266980,7 +267270,7 @@ var init_pluginOptionsStorage = __esm(() => {
|
|
|
266980
267270
|
});
|
|
266981
267271
|
|
|
266982
267272
|
// src/utils/plugins/walkPluginMarkdown.ts
|
|
266983
|
-
import { join as
|
|
267273
|
+
import { join as join56 } from "path";
|
|
266984
267274
|
async function walkPluginMarkdown(rootDir, onFile, opts = {}) {
|
|
266985
267275
|
const fs12 = getFsImplementation();
|
|
266986
267276
|
const label = opts.logLabel ?? "plugin";
|
|
@@ -266988,11 +267278,11 @@ async function walkPluginMarkdown(rootDir, onFile, opts = {}) {
|
|
|
266988
267278
|
try {
|
|
266989
267279
|
const entries = await fs12.readdir(dirPath);
|
|
266990
267280
|
if (opts.stopAtSkillDir && entries.some((e2) => e2.isFile() && SKILL_MD_RE.test(e2.name))) {
|
|
266991
|
-
await Promise.all(entries.map((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".md") ? onFile(
|
|
267281
|
+
await Promise.all(entries.map((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".md") ? onFile(join56(dirPath, entry.name), namespace) : undefined));
|
|
266992
267282
|
return;
|
|
266993
267283
|
}
|
|
266994
267284
|
await Promise.all(entries.map((entry) => {
|
|
266995
|
-
const fullPath =
|
|
267285
|
+
const fullPath = join56(dirPath, entry.name);
|
|
266996
267286
|
if (entry.isDirectory()) {
|
|
266997
267287
|
return scan(fullPath, [...namespace, entry.name]);
|
|
266998
267288
|
}
|
|
@@ -267645,8 +267935,8 @@ var init_backend_design = __esm(() => {
|
|
|
267645
267935
|
});
|
|
267646
267936
|
|
|
267647
267937
|
// src/tools/AgentTool/swarmContext.ts
|
|
267648
|
-
import { existsSync as
|
|
267649
|
-
import { dirname as dirname28, join as
|
|
267938
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync11, readFileSync as readFileSync23, writeFileSync as writeFileSync11 } from "fs";
|
|
267939
|
+
import { dirname as dirname28, join as join57 } from "path";
|
|
267650
267940
|
function truncateToTokens(text2, maxTokens) {
|
|
267651
267941
|
const maxChars = Math.max(0, maxTokens) * CHARS_PER_TOKEN;
|
|
267652
267942
|
if (text2.length <= maxChars)
|
|
@@ -267657,13 +267947,13 @@ function truncateToTokens(text2, maxTokens) {
|
|
|
267657
267947
|
…[truncated]`;
|
|
267658
267948
|
}
|
|
267659
267949
|
function getSwarmDir() {
|
|
267660
|
-
return
|
|
267950
|
+
return join57(getCwd(), ".rayu", "swarm");
|
|
267661
267951
|
}
|
|
267662
267952
|
function getSharedPath() {
|
|
267663
|
-
return
|
|
267953
|
+
return join57(getSwarmDir(), "shared.json");
|
|
267664
267954
|
}
|
|
267665
267955
|
function getDomainPath(domain2) {
|
|
267666
|
-
return
|
|
267956
|
+
return join57(getSwarmDir(), `${normalizeDomain(domain2)}.md`);
|
|
267667
267957
|
}
|
|
267668
267958
|
function normalizeDomain(domain2) {
|
|
267669
267959
|
return domain2.trim().toUpperCase().replace(/-AGENT$/, "");
|
|
@@ -267710,10 +268000,10 @@ function parseSlices(raw) {
|
|
|
267710
268000
|
}
|
|
267711
268001
|
function readShared() {
|
|
267712
268002
|
const p = getSharedPath();
|
|
267713
|
-
if (!
|
|
268003
|
+
if (!existsSync21(p))
|
|
267714
268004
|
return;
|
|
267715
268005
|
try {
|
|
267716
|
-
const parsed = JSON.parse(
|
|
268006
|
+
const parsed = JSON.parse(readFileSync23(p, "utf8"));
|
|
267717
268007
|
if (!parsed || typeof parsed !== "object")
|
|
267718
268008
|
return;
|
|
267719
268009
|
const slices = parseSlices(parsed.slices);
|
|
@@ -267734,10 +268024,10 @@ function readShared() {
|
|
|
267734
268024
|
}
|
|
267735
268025
|
function readDomainSection(domain2) {
|
|
267736
268026
|
const p = getDomainPath(domain2);
|
|
267737
|
-
if (!
|
|
268027
|
+
if (!existsSync21(p))
|
|
267738
268028
|
return;
|
|
267739
268029
|
try {
|
|
267740
|
-
const text2 =
|
|
268030
|
+
const text2 = readFileSync23(p, "utf8").trim();
|
|
267741
268031
|
return text2.length > 0 ? text2 : undefined;
|
|
267742
268032
|
} catch {
|
|
267743
268033
|
return;
|
|
@@ -267746,8 +268036,8 @@ function readDomainSection(domain2) {
|
|
|
267746
268036
|
function writeDomainSection(domain2, content) {
|
|
267747
268037
|
const p = getDomainPath(domain2);
|
|
267748
268038
|
try {
|
|
267749
|
-
|
|
267750
|
-
|
|
268039
|
+
mkdirSync11(dirname28(p), { recursive: true });
|
|
268040
|
+
writeFileSync11(p, content.endsWith(`
|
|
267751
268041
|
`) ? content : content + `
|
|
267752
268042
|
`, "utf8");
|
|
267753
268043
|
} catch {}
|
|
@@ -268007,11 +268297,11 @@ var init_linter = __esm(() => {
|
|
|
268007
268297
|
});
|
|
268008
268298
|
|
|
268009
268299
|
// src/utils/stackDetector.ts
|
|
268010
|
-
import { existsSync as
|
|
268011
|
-
import { join as
|
|
268300
|
+
import { existsSync as existsSync22, readFileSync as readFileSync24 } from "fs";
|
|
268301
|
+
import { join as join58 } from "path";
|
|
268012
268302
|
function readFileSafe2(path19) {
|
|
268013
268303
|
try {
|
|
268014
|
-
return
|
|
268304
|
+
return readFileSync24(path19, "utf8");
|
|
268015
268305
|
} catch {
|
|
268016
268306
|
return null;
|
|
268017
268307
|
}
|
|
@@ -268026,27 +268316,27 @@ function parseJsonSafe(text2) {
|
|
|
268026
268316
|
}
|
|
268027
268317
|
}
|
|
268028
268318
|
function detectPackageManager(cwd2) {
|
|
268029
|
-
if (
|
|
268319
|
+
if (existsSync22(join58(cwd2, "bun.lockb")) || existsSync22(join58(cwd2, "bun.lock")))
|
|
268030
268320
|
return "bun";
|
|
268031
|
-
if (
|
|
268321
|
+
if (existsSync22(join58(cwd2, "pnpm-lock.yaml")))
|
|
268032
268322
|
return "pnpm";
|
|
268033
|
-
if (
|
|
268323
|
+
if (existsSync22(join58(cwd2, "yarn.lock")))
|
|
268034
268324
|
return "yarn";
|
|
268035
|
-
if (
|
|
268325
|
+
if (existsSync22(join58(cwd2, "package-lock.json")))
|
|
268036
268326
|
return "npm";
|
|
268037
|
-
if (
|
|
268327
|
+
if (existsSync22(join58(cwd2, "Cargo.lock")))
|
|
268038
268328
|
return "cargo";
|
|
268039
|
-
if (
|
|
268329
|
+
if (existsSync22(join58(cwd2, "poetry.lock")))
|
|
268040
268330
|
return "poetry";
|
|
268041
|
-
if (
|
|
268331
|
+
if (existsSync22(join58(cwd2, "Pipfile.lock")))
|
|
268042
268332
|
return "pipenv";
|
|
268043
|
-
if (
|
|
268333
|
+
if (existsSync22(join58(cwd2, "go.sum")))
|
|
268044
268334
|
return "go";
|
|
268045
268335
|
return;
|
|
268046
268336
|
}
|
|
268047
268337
|
function detectDatabaseFromInfra(cwd2) {
|
|
268048
268338
|
for (const f3 of ["docker-compose.yml", "docker-compose.yaml", "compose.yml"]) {
|
|
268049
|
-
const text2 = readFileSafe2(
|
|
268339
|
+
const text2 = readFileSafe2(join58(cwd2, f3));
|
|
268050
268340
|
if (!text2)
|
|
268051
268341
|
continue;
|
|
268052
268342
|
if (/postgres|pgvector/i.test(text2))
|
|
@@ -268058,7 +268348,7 @@ function detectDatabaseFromInfra(cwd2) {
|
|
|
268058
268348
|
if (/redis/i.test(text2))
|
|
268059
268349
|
return "redis";
|
|
268060
268350
|
}
|
|
268061
|
-
const prisma = readFileSafe2(
|
|
268351
|
+
const prisma = readFileSafe2(join58(cwd2, "prisma", "schema.prisma"));
|
|
268062
268352
|
if (prisma) {
|
|
268063
268353
|
const m2 = prisma.match(/provider\s*=\s*"(\w+)"/);
|
|
268064
268354
|
if (m2) {
|
|
@@ -268079,7 +268369,7 @@ function detectStack(cwd2) {
|
|
|
268079
268369
|
const frameworks = [];
|
|
268080
268370
|
const manifests = [];
|
|
268081
268371
|
let database;
|
|
268082
|
-
const pkgText = readFileSafe2(
|
|
268372
|
+
const pkgText = readFileSafe2(join58(cwd2, "package.json"));
|
|
268083
268373
|
if (pkgText !== null) {
|
|
268084
268374
|
manifests.push("package.json");
|
|
268085
268375
|
const pkg = parseJsonSafe(pkgText);
|
|
@@ -268088,7 +268378,7 @@ function detectStack(cwd2) {
|
|
|
268088
268378
|
...pkg?.devDependencies ?? {}
|
|
268089
268379
|
};
|
|
268090
268380
|
const depNames = Object.keys(deps);
|
|
268091
|
-
const isTs =
|
|
268381
|
+
const isTs = existsSync22(join58(cwd2, "tsconfig.json")) || depNames.includes("typescript");
|
|
268092
268382
|
languages.push(isTs ? "typescript" : "javascript");
|
|
268093
268383
|
for (const name of depNames) {
|
|
268094
268384
|
for (const [re, label] of JS_FRAMEWORKS) {
|
|
@@ -268102,11 +268392,11 @@ function detectStack(cwd2) {
|
|
|
268102
268392
|
}
|
|
268103
268393
|
if (depNames.includes("drizzle-orm") && !database)
|
|
268104
268394
|
database = "sql (drizzle)";
|
|
268105
|
-
} else if (
|
|
268395
|
+
} else if (existsSync22(join58(cwd2, "tsconfig.json"))) {
|
|
268106
268396
|
manifests.push("tsconfig.json");
|
|
268107
268397
|
languages.push("typescript");
|
|
268108
268398
|
}
|
|
268109
|
-
const goMod = readFileSafe2(
|
|
268399
|
+
const goMod = readFileSafe2(join58(cwd2, "go.mod"));
|
|
268110
268400
|
if (goMod !== null) {
|
|
268111
268401
|
manifests.push("go.mod");
|
|
268112
268402
|
languages.push("go");
|
|
@@ -268119,7 +268409,7 @@ function detectStack(cwd2) {
|
|
|
268119
268409
|
if (/go-chi\/chi/.test(goMod))
|
|
268120
268410
|
frameworks.push("chi");
|
|
268121
268411
|
}
|
|
268122
|
-
const cargo = readFileSafe2(
|
|
268412
|
+
const cargo = readFileSafe2(join58(cwd2, "Cargo.toml"));
|
|
268123
268413
|
if (cargo !== null) {
|
|
268124
268414
|
manifests.push("Cargo.toml");
|
|
268125
268415
|
languages.push("rust");
|
|
@@ -268132,8 +268422,8 @@ function detectStack(cwd2) {
|
|
|
268132
268422
|
if (/\bwarp\b/.test(cargo))
|
|
268133
268423
|
frameworks.push("warp");
|
|
268134
268424
|
}
|
|
268135
|
-
const pyproject = readFileSafe2(
|
|
268136
|
-
const requirements = readFileSafe2(
|
|
268425
|
+
const pyproject = readFileSafe2(join58(cwd2, "pyproject.toml"));
|
|
268426
|
+
const requirements = readFileSafe2(join58(cwd2, "requirements.txt"));
|
|
268137
268427
|
if (pyproject !== null || requirements !== null) {
|
|
268138
268428
|
manifests.push(pyproject !== null ? "pyproject.toml" : "requirements.txt");
|
|
268139
268429
|
languages.push("python");
|
|
@@ -268146,23 +268436,23 @@ ${requirements ?? ""}`;
|
|
|
268146
268436
|
if (/\bfastapi\b/i.test(pyText))
|
|
268147
268437
|
frameworks.push("fastapi");
|
|
268148
268438
|
}
|
|
268149
|
-
if (
|
|
268439
|
+
if (existsSync22(join58(cwd2, "pom.xml"))) {
|
|
268150
268440
|
manifests.push("pom.xml");
|
|
268151
268441
|
languages.push("java");
|
|
268152
|
-
const pom = readFileSafe2(
|
|
268442
|
+
const pom = readFileSafe2(join58(cwd2, "pom.xml"));
|
|
268153
268443
|
if (pom && /spring-boot|springframework/.test(pom))
|
|
268154
268444
|
frameworks.push("spring");
|
|
268155
268445
|
}
|
|
268156
268446
|
for (const g of ["build.gradle", "build.gradle.kts"]) {
|
|
268157
|
-
if (
|
|
268447
|
+
if (existsSync22(join58(cwd2, g))) {
|
|
268158
268448
|
manifests.push(g);
|
|
268159
268449
|
languages.push(g.endsWith(".kts") ? "kotlin" : "java");
|
|
268160
|
-
const gradle = readFileSafe2(
|
|
268450
|
+
const gradle = readFileSafe2(join58(cwd2, g));
|
|
268161
268451
|
if (gradle && /spring-boot|springframework/.test(gradle))
|
|
268162
268452
|
frameworks.push("spring");
|
|
268163
268453
|
}
|
|
268164
268454
|
}
|
|
268165
|
-
const composer = readFileSafe2(
|
|
268455
|
+
const composer = readFileSafe2(join58(cwd2, "composer.json"));
|
|
268166
268456
|
if (composer !== null) {
|
|
268167
268457
|
manifests.push("composer.json");
|
|
268168
268458
|
languages.push("php");
|
|
@@ -268171,7 +268461,7 @@ ${requirements ?? ""}`;
|
|
|
268171
268461
|
if (/symfony\//.test(composer))
|
|
268172
268462
|
frameworks.push("symfony");
|
|
268173
268463
|
}
|
|
268174
|
-
const gemfile = readFileSafe2(
|
|
268464
|
+
const gemfile = readFileSafe2(join58(cwd2, "Gemfile"));
|
|
268175
268465
|
if (gemfile !== null) {
|
|
268176
268466
|
manifests.push("Gemfile");
|
|
268177
268467
|
languages.push("ruby");
|
|
@@ -276797,15 +277087,15 @@ class FileStateCache {
|
|
|
276797
277087
|
function createFileStateCacheWithSizeLimit(maxEntries, maxSizeBytes = DEFAULT_MAX_CACHE_SIZE_BYTES) {
|
|
276798
277088
|
return new FileStateCache(maxEntries, maxSizeBytes);
|
|
276799
277089
|
}
|
|
276800
|
-
function cacheToObject(
|
|
276801
|
-
return Object.fromEntries(
|
|
277090
|
+
function cacheToObject(cache5) {
|
|
277091
|
+
return Object.fromEntries(cache5.entries());
|
|
276802
277092
|
}
|
|
276803
|
-
function cacheKeys(
|
|
276804
|
-
return Array.from(
|
|
277093
|
+
function cacheKeys(cache5) {
|
|
277094
|
+
return Array.from(cache5.keys());
|
|
276805
277095
|
}
|
|
276806
|
-
function cloneFileStateCache(
|
|
276807
|
-
const cloned = createFileStateCacheWithSizeLimit(
|
|
276808
|
-
cloned.load(
|
|
277096
|
+
function cloneFileStateCache(cache5) {
|
|
277097
|
+
const cloned = createFileStateCacheWithSizeLimit(cache5.max, cache5.maxSize);
|
|
277098
|
+
cloned.load(cache5.dump());
|
|
276809
277099
|
return cloned;
|
|
276810
277100
|
}
|
|
276811
277101
|
function mergeFileStateCaches(first, second) {
|
|
@@ -276830,7 +277120,7 @@ import {
|
|
|
276830
277120
|
dirname as dirname29,
|
|
276831
277121
|
extname as extname4,
|
|
276832
277122
|
isAbsolute as isAbsolute14,
|
|
276833
|
-
join as
|
|
277123
|
+
join as join59,
|
|
276834
277124
|
parse as parse8,
|
|
276835
277125
|
relative as relative8,
|
|
276836
277126
|
sep as sep14
|
|
@@ -277075,7 +277365,7 @@ async function processMdRules({
|
|
|
277075
277365
|
throw e2;
|
|
277076
277366
|
}
|
|
277077
277367
|
for (const entry of entries) {
|
|
277078
|
-
const entryPath =
|
|
277368
|
+
const entryPath = join59(rulesDir, entry.name);
|
|
277079
277369
|
const { resolvedPath: resolvedEntryPath, isSymlink: isSymlink2 } = safeResolvePath(fs12, entryPath);
|
|
277080
277370
|
const stats2 = isSymlink2 ? await fs12.stat(resolvedEntryPath) : null;
|
|
277081
277371
|
const isDirectory = stats2 ? stats2.isDirectory() : entry.isDirectory();
|
|
@@ -277147,22 +277437,22 @@ async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths)
|
|
|
277147
277437
|
const result = [];
|
|
277148
277438
|
if (isSettingSourceEnabled("projectSettings")) {
|
|
277149
277439
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277150
|
-
result.push(...await processMemoryFile(
|
|
277440
|
+
result.push(...await processMemoryFile(join59(dir, memName), "Project", processedPaths, false));
|
|
277151
277441
|
}
|
|
277152
277442
|
for (const cfgDir of PROJECT_CONFIG_DIRS) {
|
|
277153
277443
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277154
|
-
result.push(...await processMemoryFile(
|
|
277444
|
+
result.push(...await processMemoryFile(join59(dir, cfgDir, memName), "Project", processedPaths, false));
|
|
277155
277445
|
}
|
|
277156
277446
|
}
|
|
277157
277447
|
}
|
|
277158
277448
|
if (isSettingSourceEnabled("localSettings")) {
|
|
277159
|
-
const localPath =
|
|
277449
|
+
const localPath = join59(dir, "RAYU.local.md");
|
|
277160
277450
|
result.push(...await processMemoryFile(localPath, "Local", processedPaths, false));
|
|
277161
277451
|
}
|
|
277162
277452
|
const unconditionalProcessedPaths = new Set(processedPaths);
|
|
277163
277453
|
for (const cfgDir of PROJECT_CONFIG_DIRS) {
|
|
277164
277454
|
result.push(...await processMdRules({
|
|
277165
|
-
rulesDir:
|
|
277455
|
+
rulesDir: join59(dir, cfgDir, "rules"),
|
|
277166
277456
|
type: "Project",
|
|
277167
277457
|
processedPaths: unconditionalProcessedPaths,
|
|
277168
277458
|
includeExternal: false,
|
|
@@ -277170,7 +277460,7 @@ async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths)
|
|
|
277170
277460
|
}));
|
|
277171
277461
|
}
|
|
277172
277462
|
for (const cfgDir of PROJECT_CONFIG_DIRS) {
|
|
277173
|
-
result.push(...await processConditionedMdRules(targetPath,
|
|
277463
|
+
result.push(...await processConditionedMdRules(targetPath, join59(dir, cfgDir, "rules"), "Project", processedPaths, false));
|
|
277174
277464
|
}
|
|
277175
277465
|
for (const path19 of unconditionalProcessedPaths) {
|
|
277176
277466
|
processedPaths.add(path19);
|
|
@@ -277180,7 +277470,7 @@ async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths)
|
|
|
277180
277470
|
async function getConditionalRulesForCwdLevelDirectory(dir, targetPath, processedPaths) {
|
|
277181
277471
|
const result = [];
|
|
277182
277472
|
for (const cfgDir of PROJECT_CONFIG_DIRS) {
|
|
277183
|
-
result.push(...await processConditionedMdRules(targetPath,
|
|
277473
|
+
result.push(...await processConditionedMdRules(targetPath, join59(dir, cfgDir, "rules"), "Project", processedPaths, false));
|
|
277184
277474
|
}
|
|
277185
277475
|
return result;
|
|
277186
277476
|
}
|
|
@@ -277411,7 +277701,7 @@ var init_claudemd = __esm(() => {
|
|
|
277411
277701
|
}));
|
|
277412
277702
|
if (isSettingSourceEnabled("userSettings")) {
|
|
277413
277703
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277414
|
-
result.push(...await processMemoryFile(
|
|
277704
|
+
result.push(...await processMemoryFile(join59(getRayuConfigHomeDir(), memName), "User", processedPaths, true));
|
|
277415
277705
|
}
|
|
277416
277706
|
const userClaudeRulesDir = getUserClaudeRulesDir();
|
|
277417
277707
|
result.push(...await processMdRules({
|
|
@@ -277436,14 +277726,14 @@ var init_claudemd = __esm(() => {
|
|
|
277436
277726
|
const skipProject = isNestedWorktree && pathInWorkingPath(dir, canonicalRoot) && !pathInWorkingPath(dir, gitRoot);
|
|
277437
277727
|
if (isSettingSourceEnabled("projectSettings") && !skipProject) {
|
|
277438
277728
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277439
|
-
result.push(...await processMemoryFile(
|
|
277729
|
+
result.push(...await processMemoryFile(join59(dir, memName), "Project", processedPaths, includeExternal));
|
|
277440
277730
|
}
|
|
277441
277731
|
for (const cfgDir of PROJECT_CONFIG_DIRS) {
|
|
277442
277732
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277443
|
-
result.push(...await processMemoryFile(
|
|
277733
|
+
result.push(...await processMemoryFile(join59(dir, cfgDir, memName), "Project", processedPaths, includeExternal));
|
|
277444
277734
|
}
|
|
277445
277735
|
result.push(...await processMdRules({
|
|
277446
|
-
rulesDir:
|
|
277736
|
+
rulesDir: join59(dir, cfgDir, "rules"),
|
|
277447
277737
|
type: "Project",
|
|
277448
277738
|
processedPaths,
|
|
277449
277739
|
includeExternal,
|
|
@@ -277452,7 +277742,7 @@ var init_claudemd = __esm(() => {
|
|
|
277452
277742
|
}
|
|
277453
277743
|
}
|
|
277454
277744
|
if (isSettingSourceEnabled("localSettings")) {
|
|
277455
|
-
const localPath =
|
|
277745
|
+
const localPath = join59(dir, "RAYU.local.md");
|
|
277456
277746
|
result.push(...await processMemoryFile(localPath, "Local", processedPaths, includeExternal));
|
|
277457
277747
|
}
|
|
277458
277748
|
}
|
|
@@ -277460,14 +277750,14 @@ var init_claudemd = __esm(() => {
|
|
|
277460
277750
|
const additionalDirs = getAdditionalDirectoriesForClaudeMd();
|
|
277461
277751
|
for (const dir of additionalDirs) {
|
|
277462
277752
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277463
|
-
result.push(...await processMemoryFile(
|
|
277753
|
+
result.push(...await processMemoryFile(join59(dir, memName), "Project", processedPaths, includeExternal));
|
|
277464
277754
|
}
|
|
277465
277755
|
for (const cfgDir of PROJECT_CONFIG_DIRS) {
|
|
277466
277756
|
for (const memName of PROJECT_MEMORY_FILENAMES) {
|
|
277467
|
-
result.push(...await processMemoryFile(
|
|
277757
|
+
result.push(...await processMemoryFile(join59(dir, cfgDir, memName), "Project", processedPaths, includeExternal));
|
|
277468
277758
|
}
|
|
277469
277759
|
result.push(...await processMdRules({
|
|
277470
|
-
rulesDir:
|
|
277760
|
+
rulesDir: join59(dir, cfgDir, "rules"),
|
|
277471
277761
|
type: "Project",
|
|
277472
277762
|
processedPaths,
|
|
277473
277763
|
includeExternal,
|
|
@@ -277657,7 +277947,7 @@ ${log3}`
|
|
|
277657
277947
|
|
|
277658
277948
|
// src/utils/externalSkillDiscovery.ts
|
|
277659
277949
|
import { homedir as homedir17 } from "os";
|
|
277660
|
-
import { join as
|
|
277950
|
+
import { join as join60, resolve as resolve25 } from "path";
|
|
277661
277951
|
function dirExists(p) {
|
|
277662
277952
|
const fs12 = getFsImplementation();
|
|
277663
277953
|
try {
|
|
@@ -277671,7 +277961,7 @@ function existingDir(p) {
|
|
|
277671
277961
|
return dirExists(p) ? p : undefined;
|
|
277672
277962
|
}
|
|
277673
277963
|
function getAgentFrameworkSkillsDir() {
|
|
277674
|
-
return existingDir(
|
|
277964
|
+
return existingDir(join60(homedir17(), ".agents", "skills"));
|
|
277675
277965
|
}
|
|
277676
277966
|
function getAgentSkillsDirIfEnabled() {
|
|
277677
277967
|
const settings = getInitialSettings();
|
|
@@ -277681,7 +277971,7 @@ function getAgentSkillsDirIfEnabled() {
|
|
|
277681
277971
|
return getAgentFrameworkSkillsDir();
|
|
277682
277972
|
}
|
|
277683
277973
|
function getClaudeCodeSkillsDir() {
|
|
277684
|
-
return existingDir(
|
|
277974
|
+
return existingDir(join60(homedir17(), ".claude", "skills"));
|
|
277685
277975
|
}
|
|
277686
277976
|
function getClaudeCodeSkillsDirIfEnabled() {
|
|
277687
277977
|
const settings = getInitialSettings();
|
|
@@ -277695,7 +277985,7 @@ function getProjectClaudeSkillsDirIfEnabled() {
|
|
|
277695
277985
|
const enabled2 = settings.claudeSkillsEnabled !== false;
|
|
277696
277986
|
if (!enabled2)
|
|
277697
277987
|
return;
|
|
277698
|
-
return existingDir(
|
|
277988
|
+
return existingDir(join60(getCwd(), ".claude", "skills"));
|
|
277699
277989
|
}
|
|
277700
277990
|
function getExtraSkillDirsFromSettings() {
|
|
277701
277991
|
const settings = getInitialSettings();
|
|
@@ -277808,7 +278098,7 @@ var init_argumentSubstitution = __esm(() => {
|
|
|
277808
278098
|
|
|
277809
278099
|
// src/utils/toolResultStorage.ts
|
|
277810
278100
|
import { mkdir as mkdir7, writeFile as writeFile7 } from "fs/promises";
|
|
277811
|
-
import { join as
|
|
278101
|
+
import { join as join61 } from "path";
|
|
277812
278102
|
function getPersistenceThreshold(toolName2, declaredMaxResultSizeChars) {
|
|
277813
278103
|
if (!Number.isFinite(declaredMaxResultSizeChars)) {
|
|
277814
278104
|
return declaredMaxResultSizeChars;
|
|
@@ -277821,14 +278111,14 @@ function getPersistenceThreshold(toolName2, declaredMaxResultSizeChars) {
|
|
|
277821
278111
|
return Math.min(declaredMaxResultSizeChars, DEFAULT_MAX_RESULT_SIZE_CHARS);
|
|
277822
278112
|
}
|
|
277823
278113
|
function getSessionDir() {
|
|
277824
|
-
return
|
|
278114
|
+
return join61(getProjectDir2(getOriginalCwd()), getSessionId());
|
|
277825
278115
|
}
|
|
277826
278116
|
function getToolResultsDir() {
|
|
277827
|
-
return
|
|
278117
|
+
return join61(getSessionDir(), TOOL_RESULTS_SUBDIR);
|
|
277828
278118
|
}
|
|
277829
278119
|
function getToolResultPath(id, isJson) {
|
|
277830
278120
|
const ext = isJson ? "json" : "txt";
|
|
277831
|
-
return
|
|
278121
|
+
return join61(getToolResultsDir(), `${id}.${ext}`);
|
|
277832
278122
|
}
|
|
277833
278123
|
async function ensureToolResultsDir() {
|
|
277834
278124
|
try {
|
|
@@ -278758,21 +279048,21 @@ Output truncated (${sizeKB}KB total). Full output saved to: ${this.path}`;
|
|
|
278758
279048
|
|
|
278759
279049
|
// src/utils/sessionEnvironment.ts
|
|
278760
279050
|
import { mkdir as mkdir8, readdir as readdir11, readFile as readFile11, writeFile as writeFile8 } from "fs/promises";
|
|
278761
|
-
import { join as
|
|
279051
|
+
import { join as join62 } from "path";
|
|
278762
279052
|
async function getSessionEnvDirPath() {
|
|
278763
|
-
const sessionEnvDir =
|
|
279053
|
+
const sessionEnvDir = join62(getRayuConfigHomeDir(), "session-env", getSessionId());
|
|
278764
279054
|
await mkdir8(sessionEnvDir, { recursive: true });
|
|
278765
279055
|
return sessionEnvDir;
|
|
278766
279056
|
}
|
|
278767
279057
|
async function getHookEnvFilePath(hookEvent, hookIndex) {
|
|
278768
279058
|
const prefix = hookEvent.toLowerCase();
|
|
278769
|
-
return
|
|
279059
|
+
return join62(await getSessionEnvDirPath(), `${prefix}-hook-${hookIndex}.sh`);
|
|
278770
279060
|
}
|
|
278771
279061
|
async function clearCwdEnvFiles() {
|
|
278772
279062
|
try {
|
|
278773
279063
|
const dir = await getSessionEnvDirPath();
|
|
278774
279064
|
const files2 = await readdir11(dir);
|
|
278775
|
-
await Promise.all(files2.filter((f3) => (f3.startsWith("filechanged-hook-") || f3.startsWith("cwdchanged-hook-")) && HOOK_ENV_REGEX.test(f3)).map((f3) => writeFile8(
|
|
279065
|
+
await Promise.all(files2.filter((f3) => (f3.startsWith("filechanged-hook-") || f3.startsWith("cwdchanged-hook-")) && HOOK_ENV_REGEX.test(f3)).map((f3) => writeFile8(join62(dir, f3), "")));
|
|
278776
279066
|
} catch (e2) {
|
|
278777
279067
|
const code = getErrnoCode(e2);
|
|
278778
279068
|
if (code !== "ENOENT") {
|
|
@@ -278813,7 +279103,7 @@ async function getSessionEnvironmentScript() {
|
|
|
278813
279103
|
const files2 = await readdir11(sessionEnvDir);
|
|
278814
279104
|
const hookFiles = files2.filter((f3) => HOOK_ENV_REGEX.test(f3)).sort(sortHookEnvFiles);
|
|
278815
279105
|
for (const file2 of hookFiles) {
|
|
278816
|
-
const filePath =
|
|
279106
|
+
const filePath = join62(sessionEnvDir, file2);
|
|
278817
279107
|
try {
|
|
278818
279108
|
const content = (await readFile11(filePath, "utf8")).trim();
|
|
278819
279109
|
if (content) {
|
|
@@ -278926,7 +279216,7 @@ var init_hooksConfigSnapshot = __esm(() => {
|
|
|
278926
279216
|
});
|
|
278927
279217
|
|
|
278928
279218
|
// src/utils/hooks/fileChangedWatcher.ts
|
|
278929
|
-
import { isAbsolute as isAbsolute15, join as
|
|
279219
|
+
import { isAbsolute as isAbsolute15, join as join63 } from "path";
|
|
278930
279220
|
function setEnvHookNotifier(cb) {
|
|
278931
279221
|
notifyCallback = cb;
|
|
278932
279222
|
}
|
|
@@ -278954,7 +279244,7 @@ function resolveWatchPaths(config4) {
|
|
|
278954
279244
|
for (const name of m3.matcher.split("|").map((s2) => s2.trim())) {
|
|
278955
279245
|
if (!name)
|
|
278956
279246
|
continue;
|
|
278957
|
-
staticPaths.push(isAbsolute15(name) ? name :
|
|
279247
|
+
staticPaths.push(isAbsolute15(name) ? name : join63(currentCwd, name));
|
|
278958
279248
|
}
|
|
278959
279249
|
}
|
|
278960
279250
|
return [...new Set([...staticPaths, ...dynamicWatchPaths])];
|
|
@@ -279265,7 +279555,7 @@ var init_subprocessEnv = __esm(() => {
|
|
|
279265
279555
|
import { execFile as execFile6 } from "child_process";
|
|
279266
279556
|
import { mkdir as mkdir9, stat as stat17 } from "fs/promises";
|
|
279267
279557
|
import * as os5 from "os";
|
|
279268
|
-
import { join as
|
|
279558
|
+
import { join as join64 } from "path";
|
|
279269
279559
|
function createArgv0ShellFunction(funcName, argv0, binaryPath, prependArgs = []) {
|
|
279270
279560
|
const quotedPath = quote([binaryPath]);
|
|
279271
279561
|
const argSuffix = prependArgs.length > 0 ? `${prependArgs.join(" ")} "$@"` : '"$@"';
|
|
@@ -279321,7 +279611,7 @@ function createFindGrepShellIntegration() {
|
|
|
279321
279611
|
}
|
|
279322
279612
|
function getConfigFile(shellPath) {
|
|
279323
279613
|
const fileName = shellPath.includes("zsh") ? ".zshrc" : shellPath.includes("bash") ? ".bashrc" : ".profile";
|
|
279324
|
-
const configPath2 =
|
|
279614
|
+
const configPath2 = join64(os5.homedir(), fileName);
|
|
279325
279615
|
return configPath2;
|
|
279326
279616
|
}
|
|
279327
279617
|
function getUserSnapshotContent(configFile) {
|
|
@@ -279475,9 +279765,9 @@ var LITERAL_BACKSLASH = "\\", SNAPSHOT_CREATION_TIMEOUT = 1e4, VCS_DIRECTORIES_T
|
|
|
279475
279765
|
}
|
|
279476
279766
|
const timestamp = Date.now();
|
|
279477
279767
|
const randomId = Math.random().toString(36).substring(2, 8);
|
|
279478
|
-
const snapshotsDir =
|
|
279768
|
+
const snapshotsDir = join64(getRayuConfigHomeDir(), "shell-snapshots");
|
|
279479
279769
|
logForDebugging(`Snapshots directory: ${snapshotsDir}`);
|
|
279480
|
-
const shellSnapshotPath =
|
|
279770
|
+
const shellSnapshotPath = join64(snapshotsDir, `snapshot-${shellType}-${timestamp}-${randomId}.sh`);
|
|
279481
279771
|
await mkdir9(snapshotsDir, { recursive: true });
|
|
279482
279772
|
const snapshotScript = await getSnapshotScript(binShell, shellSnapshotPath, configFileExists);
|
|
279483
279773
|
logForDebugging(`Creating snapshot at: ${shellSnapshotPath}`);
|
|
@@ -279855,7 +280145,7 @@ var init_powershellDetection = __esm(() => {
|
|
|
279855
280145
|
|
|
279856
280146
|
// src/utils/shell/powershellProvider.ts
|
|
279857
280147
|
import { tmpdir as tmpdir7 } from "os";
|
|
279858
|
-
import { join as
|
|
280148
|
+
import { join as join65 } from "path";
|
|
279859
280149
|
import { join as posixJoin2 } from "path/posix";
|
|
279860
280150
|
function buildPowerShellArgs(cmd) {
|
|
279861
280151
|
return ["-NoProfile", "-NonInteractive", "-Command", cmd];
|
|
@@ -279871,7 +280161,7 @@ function createPowerShellProvider(shellPath) {
|
|
|
279871
280161
|
detached: false,
|
|
279872
280162
|
async buildExecCommand(command, opts) {
|
|
279873
280163
|
currentSandboxTmpDir = opts.useSandbox ? opts.sandboxTmpDir : undefined;
|
|
279874
|
-
const cwdFilePath = opts.useSandbox && opts.sandboxTmpDir ? posixJoin2(opts.sandboxTmpDir, `claude-pwd-ps-${opts.id}`) :
|
|
280164
|
+
const cwdFilePath = opts.useSandbox && opts.sandboxTmpDir ? posixJoin2(opts.sandboxTmpDir, `claude-pwd-ps-${opts.id}`) : join65(tmpdir7(), `claude-pwd-ps-${opts.id}`);
|
|
279875
280165
|
const escapedCwdFilePath = cwdFilePath.replace(/'/g, "''");
|
|
279876
280166
|
const cwdTracking = `
|
|
279877
280167
|
; $_ec = if ($null -ne $LASTEXITCODE) { $LASTEXITCODE } elseif ($?) { 0 } else { 1 }
|
|
@@ -279909,7 +280199,7 @@ var init_powershellProvider = __esm(() => {
|
|
|
279909
280199
|
|
|
279910
280200
|
// src/utils/Shell.ts
|
|
279911
280201
|
import { execFileSync, spawn as spawn7 } from "child_process";
|
|
279912
|
-
import { constants as fsConstants2, readFileSync as
|
|
280202
|
+
import { constants as fsConstants2, readFileSync as readFileSync25, unlinkSync as unlinkSync3 } from "fs";
|
|
279913
280203
|
import { mkdir as mkdir10, open as open7, realpath as realpath8 } from "fs/promises";
|
|
279914
280204
|
import { isAbsolute as isAbsolute16, resolve as resolve26 } from "path";
|
|
279915
280205
|
import { join as posixJoin3 } from "path/posix";
|
|
@@ -280068,7 +280358,7 @@ async function exec3(command, abortSignal, shellType, options) {
|
|
|
280068
280358
|
}
|
|
280069
280359
|
if (result && !preventCwdChanges && !result.backgroundTaskId) {
|
|
280070
280360
|
try {
|
|
280071
|
-
let newCwd =
|
|
280361
|
+
let newCwd = readFileSync25(nativeCwdFilePath, {
|
|
280072
280362
|
encoding: "utf8"
|
|
280073
280363
|
}).trim();
|
|
280074
280364
|
if (getPlatform() === "windows") {
|
|
@@ -280921,9 +281211,9 @@ var init_validate3 = __esm(() => {
|
|
|
280921
281211
|
});
|
|
280922
281212
|
|
|
280923
281213
|
// src/keybindings/loadUserBindings.ts
|
|
280924
|
-
import { readFileSync as
|
|
281214
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
280925
281215
|
import { readFile as readFile12, stat as stat19 } from "fs/promises";
|
|
280926
|
-
import { dirname as dirname30, join as
|
|
281216
|
+
import { dirname as dirname30, join as join66 } from "path";
|
|
280927
281217
|
function isKeybindingCustomizationEnabled() {
|
|
280928
281218
|
return getFeatureValue_CACHED_MAY_BE_STALE("tengu_keybinding_customization_release", false);
|
|
280929
281219
|
}
|
|
@@ -280946,7 +281236,7 @@ function isKeybindingBlockArray2(arr) {
|
|
|
280946
281236
|
return Array.isArray(arr) && arr.every(isKeybindingBlock2);
|
|
280947
281237
|
}
|
|
280948
281238
|
function getKeybindingsPath() {
|
|
280949
|
-
return
|
|
281239
|
+
return join66(getRayuConfigHomeDir(), "keybindings.json");
|
|
280950
281240
|
}
|
|
280951
281241
|
function getDefaultParsedBindings() {
|
|
280952
281242
|
return parseBindings(DEFAULT_BINDINGS);
|
|
@@ -281044,7 +281334,7 @@ function loadKeybindingsSyncWithWarnings() {
|
|
|
281044
281334
|
}
|
|
281045
281335
|
const userPath = getKeybindingsPath();
|
|
281046
281336
|
try {
|
|
281047
|
-
const content =
|
|
281337
|
+
const content = readFileSync26(userPath, "utf-8");
|
|
281048
281338
|
const parsed = jsonParse(content);
|
|
281049
281339
|
let userBlocks;
|
|
281050
281340
|
if (typeof parsed === "object" && parsed !== null && "bindings" in parsed) {
|
|
@@ -290537,16 +290827,16 @@ import {
|
|
|
290537
290827
|
basename as basename17,
|
|
290538
290828
|
dirname as dirname31,
|
|
290539
290829
|
isAbsolute as isAbsolute18,
|
|
290540
|
-
join as
|
|
290830
|
+
join as join67,
|
|
290541
290831
|
sep as pathSep,
|
|
290542
290832
|
relative as relative9
|
|
290543
290833
|
} from "path";
|
|
290544
290834
|
function getSkillsPath(source, dir) {
|
|
290545
290835
|
switch (source) {
|
|
290546
290836
|
case "policySettings":
|
|
290547
|
-
return
|
|
290837
|
+
return join67(getManagedFilePath(), ".rayu", dir);
|
|
290548
290838
|
case "userSettings":
|
|
290549
|
-
return
|
|
290839
|
+
return join67(getRayuConfigHomeDir(), dir);
|
|
290550
290840
|
case "projectSettings":
|
|
290551
290841
|
return `.rayu/${dir}`;
|
|
290552
290842
|
case "plugin":
|
|
@@ -290718,8 +291008,8 @@ async function loadSkillsFromSkillsDir(basePath, source) {
|
|
|
290718
291008
|
if (!entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
290719
291009
|
return null;
|
|
290720
291010
|
}
|
|
290721
|
-
const skillDirPath =
|
|
290722
|
-
const skillFilePath =
|
|
291011
|
+
const skillDirPath = join67(basePath, entry.name);
|
|
291012
|
+
const skillFilePath = join67(skillDirPath, "SKILL.md");
|
|
290723
291013
|
let content;
|
|
290724
291014
|
try {
|
|
290725
291015
|
content = await fs12.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -290874,7 +291164,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
290874
291164
|
for (const filePath of filePaths) {
|
|
290875
291165
|
let currentDir = dirname31(filePath);
|
|
290876
291166
|
while (currentDir.startsWith(resolvedCwd + pathSep)) {
|
|
290877
|
-
const skillDir =
|
|
291167
|
+
const skillDir = join67(currentDir, ".rayu", "skills");
|
|
290878
291168
|
if (!dynamicSkillDirs.has(skillDir)) {
|
|
290879
291169
|
dynamicSkillDirs.add(skillDir);
|
|
290880
291170
|
try {
|
|
@@ -290998,8 +291288,8 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
290998
291288
|
init_types2();
|
|
290999
291289
|
import_ignore3 = __toESM(require_ignore(), 1);
|
|
291000
291290
|
getSkillDirCommands = memoize_default(async (cwd2) => {
|
|
291001
|
-
const userSkillsDir =
|
|
291002
|
-
const managedSkillsDir =
|
|
291291
|
+
const userSkillsDir = join67(getRayuConfigHomeDir(), "skills");
|
|
291292
|
+
const managedSkillsDir = join67(getManagedFilePath(), ".rayu", "skills");
|
|
291003
291293
|
const projectSkillsDirs = getProjectDirsUpToHome("skills", cwd2);
|
|
291004
291294
|
logForDebugging(`Loading skills from: managed=${managedSkillsDir}, user=${userSkillsDir}, project=[${projectSkillsDirs.join(", ")}]`);
|
|
291005
291295
|
const additionalDirs = getAdditionalDirectoriesForClaudeMd();
|
|
@@ -291010,7 +291300,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
291010
291300
|
logForDebugging(`[bare] Skipping skill dir discovery (${additionalDirs.length === 0 ? "no --add-dir" : "projectSettings disabled or skillsLocked"})`);
|
|
291011
291301
|
return [];
|
|
291012
291302
|
}
|
|
291013
|
-
const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(
|
|
291303
|
+
const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join67(dir, ".rayu", "skills"), "projectSettings")));
|
|
291014
291304
|
return additionalSkillsNested2.flat().map((s2) => s2.skill);
|
|
291015
291305
|
}
|
|
291016
291306
|
const externalSkillDirs = isSettingSourceEnabled("userSettings") && !skillsLocked ? getExternalSkillDirs() : [];
|
|
@@ -291026,7 +291316,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
291026
291316
|
isEnvTruthy(process.env.RAYU_DISABLE_POLICY_SKILLS) ? Promise.resolve([]) : loadSkillsFromSkillsDir(managedSkillsDir, "policySettings"),
|
|
291027
291317
|
isSettingSourceEnabled("userSettings") && !skillsLocked ? loadSkillsFromSkillsDir(userSkillsDir, "userSettings") : Promise.resolve([]),
|
|
291028
291318
|
projectSettingsEnabled ? Promise.all(projectSkillsDirs.map((dir) => loadSkillsFromSkillsDir(dir, "projectSettings"))) : Promise.resolve([]),
|
|
291029
|
-
projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(
|
|
291319
|
+
projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join67(dir, ".rayu", "skills"), "projectSettings"))) : Promise.resolve([]),
|
|
291030
291320
|
isSettingSourceEnabled("userSettings") && !skillsLocked && externalSkillDirs.length > 0 ? Promise.all(externalSkillDirs.map((dir) => loadSkillsFromSkillsDir(dir, "userSettings"))) : Promise.resolve([]),
|
|
291031
291321
|
skillsLocked ? Promise.resolve([]) : loadSkillsFromCommandsDir(cwd2)
|
|
291032
291322
|
]);
|
|
@@ -291815,17 +292105,17 @@ var init_analyzeContext = __esm(() => {
|
|
|
291815
292105
|
|
|
291816
292106
|
// src/utils/zodToJsonSchema.ts
|
|
291817
292107
|
function zodToJsonSchema(schema) {
|
|
291818
|
-
const hit =
|
|
292108
|
+
const hit = cache5.get(schema);
|
|
291819
292109
|
if (hit)
|
|
291820
292110
|
return hit;
|
|
291821
292111
|
const result = toJSONSchema(schema);
|
|
291822
|
-
|
|
292112
|
+
cache5.set(schema, result);
|
|
291823
292113
|
return result;
|
|
291824
292114
|
}
|
|
291825
|
-
var
|
|
292115
|
+
var cache5;
|
|
291826
292116
|
var init_zodToJsonSchema = __esm(() => {
|
|
291827
292117
|
init_v4();
|
|
291828
|
-
|
|
292118
|
+
cache5 = new WeakMap;
|
|
291829
292119
|
});
|
|
291830
292120
|
|
|
291831
292121
|
// src/utils/toolSearch.ts
|
|
@@ -293365,21 +293655,21 @@ var init_words = __esm(() => {
|
|
|
293365
293655
|
// src/utils/plans.ts
|
|
293366
293656
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
293367
293657
|
import { copyFile as copyFile3, writeFile as writeFile9 } from "fs/promises";
|
|
293368
|
-
import { join as
|
|
293658
|
+
import { join as join68, resolve as resolve30, sep as sep16 } from "path";
|
|
293369
293659
|
function getPlanSlug(sessionId) {
|
|
293370
293660
|
const id = sessionId ?? getSessionId();
|
|
293371
|
-
const
|
|
293372
|
-
let slug =
|
|
293661
|
+
const cache6 = getPlanSlugCache();
|
|
293662
|
+
let slug = cache6.get(id);
|
|
293373
293663
|
if (!slug) {
|
|
293374
293664
|
const plansDir = getPlansDirectory();
|
|
293375
293665
|
for (let i4 = 0;i4 < MAX_SLUG_RETRIES; i4++) {
|
|
293376
293666
|
slug = generateWordSlug();
|
|
293377
|
-
const filePath =
|
|
293667
|
+
const filePath = join68(plansDir, `${slug}.md`);
|
|
293378
293668
|
if (!getFsImplementation().existsSync(filePath)) {
|
|
293379
293669
|
break;
|
|
293380
293670
|
}
|
|
293381
293671
|
}
|
|
293382
|
-
|
|
293672
|
+
cache6.set(id, slug);
|
|
293383
293673
|
}
|
|
293384
293674
|
return slug;
|
|
293385
293675
|
}
|
|
@@ -293392,9 +293682,9 @@ function clearAllPlanSlugs() {
|
|
|
293392
293682
|
function getPlanFilePath(agentId) {
|
|
293393
293683
|
const planSlug = getPlanSlug(getSessionId());
|
|
293394
293684
|
if (!agentId) {
|
|
293395
|
-
return
|
|
293685
|
+
return join68(getPlansDirectory(), `${planSlug}.md`);
|
|
293396
293686
|
}
|
|
293397
|
-
return
|
|
293687
|
+
return join68(getPlansDirectory(), `${planSlug}-agent-${agentId}.md`);
|
|
293398
293688
|
}
|
|
293399
293689
|
function getPlan(agentId) {
|
|
293400
293690
|
const filePath = getPlanFilePath(agentId);
|
|
@@ -293417,7 +293707,7 @@ async function copyPlanForResume(log3, targetSessionId) {
|
|
|
293417
293707
|
}
|
|
293418
293708
|
const sessionId = targetSessionId ?? getSessionId();
|
|
293419
293709
|
setPlanSlug(sessionId, slug);
|
|
293420
|
-
const planPath =
|
|
293710
|
+
const planPath = join68(getPlansDirectory(), `${slug}.md`);
|
|
293421
293711
|
try {
|
|
293422
293712
|
await getFsImplementation().readFile(planPath, { encoding: "utf-8" });
|
|
293423
293713
|
return true;
|
|
@@ -293460,9 +293750,9 @@ async function copyPlanForFork(log3, targetSessionId) {
|
|
|
293460
293750
|
return false;
|
|
293461
293751
|
}
|
|
293462
293752
|
const plansDir = getPlansDirectory();
|
|
293463
|
-
const originalPlanPath =
|
|
293753
|
+
const originalPlanPath = join68(plansDir, `${originalSlug}.md`);
|
|
293464
293754
|
const newSlug = getPlanSlug(targetSessionId);
|
|
293465
|
-
const newPlanPath =
|
|
293755
|
+
const newPlanPath = join68(plansDir, `${newSlug}.md`);
|
|
293466
293756
|
try {
|
|
293467
293757
|
await copyFile3(originalPlanPath, newPlanPath);
|
|
293468
293758
|
return true;
|
|
@@ -293577,12 +293867,12 @@ var init_plans = __esm(() => {
|
|
|
293577
293867
|
const resolved = resolve30(cwd2, settingsDir);
|
|
293578
293868
|
if (!resolved.startsWith(cwd2 + sep16) && resolved !== cwd2) {
|
|
293579
293869
|
logError2(new Error(`plansDirectory must be within project root: ${settingsDir}`));
|
|
293580
|
-
plansPath =
|
|
293870
|
+
plansPath = join68(getRayuConfigHomeDir(), "plans");
|
|
293581
293871
|
} else {
|
|
293582
293872
|
plansPath = resolved;
|
|
293583
293873
|
}
|
|
293584
293874
|
} else {
|
|
293585
|
-
plansPath =
|
|
293875
|
+
plansPath = join68(getRayuConfigHomeDir(), "plans");
|
|
293586
293876
|
}
|
|
293587
293877
|
try {
|
|
293588
293878
|
getFsImplementation().mkdirSync(plansPath);
|
|
@@ -295265,10 +295555,10 @@ function DANGEROUS_uncachedSystemPromptSection(name, compute, _reason) {
|
|
|
295265
295555
|
return { name, compute, cacheBreak: true };
|
|
295266
295556
|
}
|
|
295267
295557
|
async function resolveSystemPromptSections(sections) {
|
|
295268
|
-
const
|
|
295558
|
+
const cache6 = getSystemPromptSectionCache();
|
|
295269
295559
|
return Promise.all(sections.map(async (s2) => {
|
|
295270
|
-
if (!s2.cacheBreak &&
|
|
295271
|
-
return
|
|
295560
|
+
if (!s2.cacheBreak && cache6.has(s2.name)) {
|
|
295561
|
+
return cache6.get(s2.name) ?? null;
|
|
295272
295562
|
}
|
|
295273
295563
|
const value = await s2.compute();
|
|
295274
295564
|
setSystemPromptSectionCacheEntry(s2.name, value);
|
|
@@ -301569,7 +301859,7 @@ function getTelemetryAttributes() {
|
|
|
301569
301859
|
attributes["session.id"] = sessionId;
|
|
301570
301860
|
}
|
|
301571
301861
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
301572
|
-
attributes["app.version"] = "1.3.
|
|
301862
|
+
attributes["app.version"] = "1.3.444";
|
|
301573
301863
|
}
|
|
301574
301864
|
const oauthAccount = getOauthAccountInfo();
|
|
301575
301865
|
if (oauthAccount) {
|
|
@@ -301935,7 +302225,7 @@ var init_postCompactCleanup = __esm(() => {
|
|
|
301935
302225
|
|
|
301936
302226
|
// src/services/SessionMemory/prompts.ts
|
|
301937
302227
|
import { readFile as readFile15 } from "fs/promises";
|
|
301938
|
-
import { join as
|
|
302228
|
+
import { join as join69 } from "path";
|
|
301939
302229
|
function getDefaultUpdatePrompt() {
|
|
301940
302230
|
return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
|
|
301941
302231
|
|
|
@@ -301976,7 +302266,7 @@ You ONLY update the actual content that comes AFTER these two preserved lines. T
|
|
|
301976
302266
|
REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edits. Only include insights from the actual user conversation, never from these note-taking instructions. Do not delete or change section headers or italic _section descriptions_.`;
|
|
301977
302267
|
}
|
|
301978
302268
|
async function loadSessionMemoryTemplate() {
|
|
301979
|
-
const templatePath =
|
|
302269
|
+
const templatePath = join69(getRayuConfigHomeDir(), "session-memory", "config", "template.md");
|
|
301980
302270
|
try {
|
|
301981
302271
|
return await readFile15(templatePath, { encoding: "utf-8" });
|
|
301982
302272
|
} catch (e2) {
|
|
@@ -301989,7 +302279,7 @@ async function loadSessionMemoryTemplate() {
|
|
|
301989
302279
|
}
|
|
301990
302280
|
}
|
|
301991
302281
|
async function loadSessionMemoryPrompt() {
|
|
301992
|
-
const promptPath =
|
|
302282
|
+
const promptPath = join69(getRayuConfigHomeDir(), "session-memory", "config", "prompt.md");
|
|
301993
302283
|
try {
|
|
301994
302284
|
return await readFile15(promptPath, { encoding: "utf-8" });
|
|
301995
302285
|
} catch (e2) {
|
|
@@ -302591,6 +302881,14 @@ var init_autoCompact = __esm(() => {
|
|
|
302591
302881
|
init_sessionMemoryCompact();
|
|
302592
302882
|
});
|
|
302593
302883
|
|
|
302884
|
+
// src/query/interruptMessage.ts
|
|
302885
|
+
function isUserAbortRenderedMessage(msg) {
|
|
302886
|
+
return msg?.isApiErrorMessage === true && Array.isArray(msg.message?.content) && msg.message.content.some((block) => block.type === "text" && block.text === ERROR_MESSAGE_USER_ABORT);
|
|
302887
|
+
}
|
|
302888
|
+
var init_interruptMessage = __esm(() => {
|
|
302889
|
+
init_compact();
|
|
302890
|
+
});
|
|
302891
|
+
|
|
302594
302892
|
// src/constants/errorIds.ts
|
|
302595
302893
|
var E_TOOL_USE_SUMMARY_GENERATION_FAILED = 344;
|
|
302596
302894
|
|
|
@@ -303074,7 +303372,7 @@ var init_postSamplingHooks = __esm(() => {
|
|
|
303074
303372
|
// src/services/api/dumpPrompts.ts
|
|
303075
303373
|
import { createHash as createHash8 } from "crypto";
|
|
303076
303374
|
import { promises as fs12 } from "fs";
|
|
303077
|
-
import { dirname as dirname32, join as
|
|
303375
|
+
import { dirname as dirname32, join as join70 } from "path";
|
|
303078
303376
|
function hashString3(str3) {
|
|
303079
303377
|
return createHash8("sha256").update(str3).digest("hex");
|
|
303080
303378
|
}
|
|
@@ -303096,7 +303394,7 @@ function addApiRequestToCache(requestData) {
|
|
|
303096
303394
|
}
|
|
303097
303395
|
}
|
|
303098
303396
|
function getDumpPromptsPath(agentIdOrSessionId) {
|
|
303099
|
-
return
|
|
303397
|
+
return join70(getRayuConfigHomeDir(), "dump-prompts", `${agentIdOrSessionId ?? getSessionId()}.jsonl`);
|
|
303100
303398
|
}
|
|
303101
303399
|
function appendToFile(filePath, entries) {
|
|
303102
303400
|
if (entries.length === 0)
|
|
@@ -303379,7 +303677,7 @@ var require_core = __commonJS((exports, module) => {
|
|
|
303379
303677
|
return match && match.index === 0;
|
|
303380
303678
|
}
|
|
303381
303679
|
var BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
303382
|
-
function
|
|
303680
|
+
function join71(regexps, separator = "|") {
|
|
303383
303681
|
let numCaptures = 0;
|
|
303384
303682
|
return regexps.map((regex2) => {
|
|
303385
303683
|
numCaptures += 1;
|
|
@@ -303662,7 +303960,7 @@ var require_core = __commonJS((exports, module) => {
|
|
|
303662
303960
|
this.exec = () => null;
|
|
303663
303961
|
}
|
|
303664
303962
|
const terminators = this.regexes.map((el) => el[1]);
|
|
303665
|
-
this.matcherRe = langRe(
|
|
303963
|
+
this.matcherRe = langRe(join71(terminators), true);
|
|
303666
303964
|
this.lastIndex = 0;
|
|
303667
303965
|
}
|
|
303668
303966
|
exec(s2) {
|
|
@@ -399209,7 +399507,7 @@ var EXIT_WORKTREE_TOOL_NAME = "ExitWorktree";
|
|
|
399209
399507
|
var init_cron = () => {};
|
|
399210
399508
|
|
|
399211
399509
|
// src/utils/cronTasks.ts
|
|
399212
|
-
import { dirname as dirname33, join as
|
|
399510
|
+
import { dirname as dirname33, join as join71 } from "path";
|
|
399213
399511
|
var CRON_FILE_REL, DEFAULT_CRON_JITTER_CONFIG;
|
|
399214
399512
|
var init_cronTasks = __esm(() => {
|
|
399215
399513
|
init_state();
|
|
@@ -399220,7 +399518,7 @@ var init_cronTasks = __esm(() => {
|
|
|
399220
399518
|
init_json();
|
|
399221
399519
|
init_log2();
|
|
399222
399520
|
init_slowOperations();
|
|
399223
|
-
CRON_FILE_REL =
|
|
399521
|
+
CRON_FILE_REL = join71(".rayu", "scheduled_tasks.json");
|
|
399224
399522
|
DEFAULT_CRON_JITTER_CONFIG = {
|
|
399225
399523
|
recurringFrac: 0.1,
|
|
399226
399524
|
recurringCapMs: 15 * 60 * 1000,
|
|
@@ -406501,7 +406799,7 @@ function expandEnvVarsInString(value) {
|
|
|
406501
406799
|
}
|
|
406502
406800
|
|
|
406503
406801
|
// src/utils/plugins/mcpPluginIntegration.ts
|
|
406504
|
-
import { join as
|
|
406802
|
+
import { join as join72 } from "path";
|
|
406505
406803
|
async function loadMcpServersFromMcpb(plugin, mcpbPath, errors6) {
|
|
406506
406804
|
try {
|
|
406507
406805
|
logForDebugging(`Loading MCP servers from MCPB: ${mcpbPath}`);
|
|
@@ -406600,7 +406898,7 @@ async function loadPluginMcpServers(plugin, errors6 = []) {
|
|
|
406600
406898
|
}
|
|
406601
406899
|
async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
406602
406900
|
const fs13 = getFsImplementation();
|
|
406603
|
-
const filePath =
|
|
406901
|
+
const filePath = join72(pluginPath, relativePath);
|
|
406604
406902
|
let content;
|
|
406605
406903
|
try {
|
|
406606
406904
|
content = await fs13.readFile(filePath, { encoding: "utf-8" });
|
|
@@ -406796,9 +407094,9 @@ var init_mcpPluginIntegration = __esm(() => {
|
|
|
406796
407094
|
// src/services/mcp/config.ts
|
|
406797
407095
|
import { chmod as chmod2, open as open8, rename as rename3, stat as stat21, unlink as unlink6 } from "fs/promises";
|
|
406798
407096
|
import { homedir as homedir21 } from "os";
|
|
406799
|
-
import { dirname as dirname34, join as
|
|
407097
|
+
import { dirname as dirname34, join as join73, parse as parse10 } from "path";
|
|
406800
407098
|
function getEnterpriseMcpFilePath() {
|
|
406801
|
-
return
|
|
407099
|
+
return join73(getManagedFilePath(), "managed-mcp.json");
|
|
406802
407100
|
}
|
|
406803
407101
|
function addScopeToServers(servers, scope) {
|
|
406804
407102
|
if (!servers) {
|
|
@@ -406811,7 +407109,7 @@ function addScopeToServers(servers, scope) {
|
|
|
406811
407109
|
return scopedServers;
|
|
406812
407110
|
}
|
|
406813
407111
|
async function writeMcpjsonFile(config4) {
|
|
406814
|
-
const mcpJsonPath =
|
|
407112
|
+
const mcpJsonPath = join73(getCwd(), ".mcp.json");
|
|
406815
407113
|
let existingMode;
|
|
406816
407114
|
try {
|
|
406817
407115
|
const stats2 = await stat21(mcpJsonPath);
|
|
@@ -407233,7 +407531,7 @@ function getProjectMcpConfigsFromCwd() {
|
|
|
407233
407531
|
if (!isSettingSourceEnabled("projectSettings")) {
|
|
407234
407532
|
return { servers: {}, errors: [] };
|
|
407235
407533
|
}
|
|
407236
|
-
const mcpJsonPath =
|
|
407534
|
+
const mcpJsonPath = join73(getCwd(), ".mcp.json");
|
|
407237
407535
|
const { config: config4, errors: errors6 } = parseMcpConfigFromFilePath({
|
|
407238
407536
|
filePath: mcpJsonPath,
|
|
407239
407537
|
expandVars: true,
|
|
@@ -407272,7 +407570,7 @@ function getMcpConfigsByScope(scope) {
|
|
|
407272
407570
|
currentDir = dirname34(currentDir);
|
|
407273
407571
|
}
|
|
407274
407572
|
for (const dir of dirs.reverse()) {
|
|
407275
|
-
const mcpJsonPath =
|
|
407573
|
+
const mcpJsonPath = join73(dir, ".mcp.json");
|
|
407276
407574
|
const { config: config4, errors: errors6 } = parseMcpConfigFromFilePath({
|
|
407277
407575
|
filePath: mcpJsonPath,
|
|
407278
407576
|
expandVars: true,
|
|
@@ -407388,15 +407686,15 @@ function getClaudeFallbackMcpServers() {
|
|
|
407388
407686
|
}
|
|
407389
407687
|
};
|
|
407390
407688
|
const rawSources = [];
|
|
407391
|
-
const claudeJson = readJson(
|
|
407689
|
+
const claudeJson = readJson(join73(home, ".claude.json"));
|
|
407392
407690
|
if (claudeJson) {
|
|
407393
407691
|
rawSources.push(claudeJson.mcpServers);
|
|
407394
407692
|
const projects = claudeJson.projects;
|
|
407395
407693
|
rawSources.push(projects?.[cwd2]?.mcpServers);
|
|
407396
407694
|
}
|
|
407397
407695
|
for (const p of [
|
|
407398
|
-
|
|
407399
|
-
|
|
407696
|
+
join73(cwd2, ".claude", "settings.json"),
|
|
407697
|
+
join73(home, ".claude", "settings.json")
|
|
407400
407698
|
]) {
|
|
407401
407699
|
const s2 = readJson(p);
|
|
407402
407700
|
if (s2)
|
|
@@ -407726,7 +408024,7 @@ var init_config3 = __esm(() => {
|
|
|
407726
408024
|
|
|
407727
408025
|
// src/services/mcp/utils.ts
|
|
407728
408026
|
import { createHash as createHash9 } from "crypto";
|
|
407729
|
-
import { join as
|
|
408027
|
+
import { join as join74 } from "path";
|
|
407730
408028
|
function filterToolsByServer(tools, serverName) {
|
|
407731
408029
|
const prefix = `mcp__${normalizeNameForMCP(serverName)}__`;
|
|
407732
408030
|
return tools.filter((tool) => tool.name?.startsWith(prefix));
|
|
@@ -407800,7 +408098,7 @@ function describeMcpConfigFilePath(scope) {
|
|
|
407800
408098
|
case "user":
|
|
407801
408099
|
return getGlobalRayuFile();
|
|
407802
408100
|
case "project":
|
|
407803
|
-
return
|
|
408101
|
+
return join74(getCwd(), ".mcp.json");
|
|
407804
408102
|
case "local":
|
|
407805
408103
|
return `${getGlobalRayuFile()} [project: ${getCwd()}]`;
|
|
407806
408104
|
case "dynamic":
|
|
@@ -408479,7 +408777,7 @@ var init_xaaIdpLogin = __esm(() => {
|
|
|
408479
408777
|
import { createHash as createHash10, randomBytes as randomBytes7, randomUUID as randomUUID10 } from "crypto";
|
|
408480
408778
|
import { mkdir as mkdir11 } from "fs/promises";
|
|
408481
408779
|
import { createServer as createServer6 } from "http";
|
|
408482
|
-
import { join as
|
|
408780
|
+
import { join as join75 } from "path";
|
|
408483
408781
|
import { parse as parse12 } from "url";
|
|
408484
408782
|
function redactSensitiveUrlParams(url3) {
|
|
408485
408783
|
try {
|
|
@@ -409591,7 +409889,7 @@ class RayuMcpOAuthProvider {
|
|
|
409591
409889
|
const rayuDir = getRayuConfigHomeDir();
|
|
409592
409890
|
await mkdir11(rayuDir, { recursive: true });
|
|
409593
409891
|
const sanitizedKey = serverKey.replace(/[^a-zA-Z0-9]/g, "_");
|
|
409594
|
-
const lockfilePath =
|
|
409892
|
+
const lockfilePath = join75(rayuDir, `mcp-refresh-${sanitizedKey}.lock`);
|
|
409595
409893
|
let release;
|
|
409596
409894
|
for (let retry = 0;retry < MAX_LOCK_RETRIES; retry++) {
|
|
409597
409895
|
try {
|
|
@@ -410002,7 +410300,7 @@ var init_McpAuthTool = __esm(() => {
|
|
|
410002
410300
|
|
|
410003
410301
|
// src/utils/mcpOutputStorage.ts
|
|
410004
410302
|
import { writeFile as writeFile10 } from "fs/promises";
|
|
410005
|
-
import { join as
|
|
410303
|
+
import { join as join76 } from "path";
|
|
410006
410304
|
function getFormatDescription(type, schema) {
|
|
410007
410305
|
switch (type) {
|
|
410008
410306
|
case "toolResult":
|
|
@@ -410099,7 +410397,7 @@ function isBinaryContentType(contentType) {
|
|
|
410099
410397
|
async function persistBinaryContent(bytes, mimeType, persistId) {
|
|
410100
410398
|
await ensureToolResultsDir();
|
|
410101
410399
|
const ext = extensionForMimeType(mimeType);
|
|
410102
|
-
const filepath =
|
|
410400
|
+
const filepath = join76(getToolResultsDir(), `${persistId}.${ext}`);
|
|
410103
410401
|
try {
|
|
410104
410402
|
await writeFile10(filepath, bytes);
|
|
410105
410403
|
} catch (error54) {
|
|
@@ -410498,7 +410796,7 @@ var init_capitalize = __esm(() => {
|
|
|
410498
410796
|
|
|
410499
410797
|
// src/utils/jetbrains.ts
|
|
410500
410798
|
import { homedir as homedir22, platform as platform2 } from "os";
|
|
410501
|
-
import { join as
|
|
410799
|
+
import { join as join77 } from "path";
|
|
410502
410800
|
function buildCommonPluginDirectoryPaths(ideName) {
|
|
410503
410801
|
const homeDir = homedir22();
|
|
410504
410802
|
const directories = [];
|
|
@@ -410506,28 +410804,28 @@ function buildCommonPluginDirectoryPaths(ideName) {
|
|
|
410506
410804
|
if (!idePatterns) {
|
|
410507
410805
|
return directories;
|
|
410508
410806
|
}
|
|
410509
|
-
const appData = process.env.APPDATA ||
|
|
410510
|
-
const localAppData = process.env.LOCALAPPDATA ||
|
|
410807
|
+
const appData = process.env.APPDATA || join77(homeDir, "AppData", "Roaming");
|
|
410808
|
+
const localAppData = process.env.LOCALAPPDATA || join77(homeDir, "AppData", "Local");
|
|
410511
410809
|
switch (platform2()) {
|
|
410512
410810
|
case "darwin":
|
|
410513
|
-
directories.push(
|
|
410811
|
+
directories.push(join77(homeDir, "Library", "Application Support", "JetBrains"), join77(homeDir, "Library", "Application Support"));
|
|
410514
410812
|
if (ideName.toLowerCase() === "androidstudio") {
|
|
410515
|
-
directories.push(
|
|
410813
|
+
directories.push(join77(homeDir, "Library", "Application Support", "Google"));
|
|
410516
410814
|
}
|
|
410517
410815
|
break;
|
|
410518
410816
|
case "win32":
|
|
410519
|
-
directories.push(
|
|
410817
|
+
directories.push(join77(appData, "JetBrains"), join77(localAppData, "JetBrains"), join77(appData));
|
|
410520
410818
|
if (ideName.toLowerCase() === "androidstudio") {
|
|
410521
|
-
directories.push(
|
|
410819
|
+
directories.push(join77(localAppData, "Google"));
|
|
410522
410820
|
}
|
|
410523
410821
|
break;
|
|
410524
410822
|
case "linux":
|
|
410525
|
-
directories.push(
|
|
410823
|
+
directories.push(join77(homeDir, ".config", "JetBrains"), join77(homeDir, ".local", "share", "JetBrains"));
|
|
410526
410824
|
for (const pattern of idePatterns) {
|
|
410527
|
-
directories.push(
|
|
410825
|
+
directories.push(join77(homeDir, "." + pattern));
|
|
410528
410826
|
}
|
|
410529
410827
|
if (ideName.toLowerCase() === "androidstudio") {
|
|
410530
|
-
directories.push(
|
|
410828
|
+
directories.push(join77(homeDir, ".config", "Google"));
|
|
410531
410829
|
}
|
|
410532
410830
|
break;
|
|
410533
410831
|
default:
|
|
@@ -410553,12 +410851,12 @@ async function detectPluginDirectories(ideName) {
|
|
|
410553
410851
|
continue;
|
|
410554
410852
|
if (!entry.isDirectory() && !entry.isSymbolicLink())
|
|
410555
410853
|
continue;
|
|
410556
|
-
const dir =
|
|
410854
|
+
const dir = join77(baseDir, entry.name);
|
|
410557
410855
|
if (platform2() === "linux") {
|
|
410558
410856
|
foundDirectories.push(dir);
|
|
410559
410857
|
continue;
|
|
410560
410858
|
}
|
|
410561
|
-
const pluginDir =
|
|
410859
|
+
const pluginDir = join77(dir, "plugins");
|
|
410562
410860
|
try {
|
|
410563
410861
|
await fs13.stat(pluginDir);
|
|
410564
410862
|
foundDirectories.push(pluginDir);
|
|
@@ -410574,7 +410872,7 @@ async function detectPluginDirectories(ideName) {
|
|
|
410574
410872
|
async function isJetBrainsPluginInstalled(ideType) {
|
|
410575
410873
|
const pluginDirs = await detectPluginDirectories(ideType);
|
|
410576
410874
|
for (const dir of pluginDirs) {
|
|
410577
|
-
const pluginPath =
|
|
410875
|
+
const pluginPath = join77(dir, PLUGIN_PREFIX);
|
|
410578
410876
|
try {
|
|
410579
410877
|
await getFsImplementation().stat(pluginPath);
|
|
410580
410878
|
return true;
|
|
@@ -411511,7 +411809,7 @@ var init_IdeOnboardingDialog = __esm(() => {
|
|
|
411511
411809
|
// src/utils/ide.ts
|
|
411512
411810
|
import { createConnection } from "net";
|
|
411513
411811
|
import * as os6 from "os";
|
|
411514
|
-
import { basename as basename18, join as
|
|
411812
|
+
import { basename as basename18, join as join78, sep as pathSeparator, resolve as resolve32 } from "path";
|
|
411515
411813
|
function isProcessRunning2(pid) {
|
|
411516
411814
|
try {
|
|
411517
411815
|
process.kill(pid, 0);
|
|
@@ -411555,7 +411853,7 @@ async function getSortedIdeLockfiles() {
|
|
|
411555
411853
|
const entries = await getFsImplementation().readdir(ideLockFilePath);
|
|
411556
411854
|
const lockEntries = entries.filter((file2) => file2.name.endsWith(".lock"));
|
|
411557
411855
|
const stats2 = await Promise.all(lockEntries.map(async (file2) => {
|
|
411558
|
-
const fullPath =
|
|
411856
|
+
const fullPath = join78(ideLockFilePath, file2.name);
|
|
411559
411857
|
try {
|
|
411560
411858
|
const fileStat = await getFsImplementation().stat(fullPath);
|
|
411561
411859
|
return { path: fullPath, mtime: fileStat.mtime };
|
|
@@ -411646,8 +411944,8 @@ async function checkIdeConnection(host, port2, timeout = 500) {
|
|
|
411646
411944
|
}
|
|
411647
411945
|
async function getIdeLockfilesPaths() {
|
|
411648
411946
|
const paths2 = [
|
|
411649
|
-
|
|
411650
|
-
|
|
411947
|
+
join78(getRayuConfigHomeDir(), "ide"),
|
|
411948
|
+
join78(os6.homedir(), ".claude", "ide")
|
|
411651
411949
|
];
|
|
411652
411950
|
if (getPlatform() !== "wsl") {
|
|
411653
411951
|
return paths2;
|
|
@@ -411669,8 +411967,8 @@ async function getIdeLockfilesPaths() {
|
|
|
411669
411967
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
411670
411968
|
continue;
|
|
411671
411969
|
}
|
|
411672
|
-
paths2.push(
|
|
411673
|
-
paths2.push(
|
|
411970
|
+
paths2.push(join78(usersDir, user.name, ".rayu", "ide"));
|
|
411971
|
+
paths2.push(join78(usersDir, user.name, ".claude", "ide"));
|
|
411674
411972
|
}
|
|
411675
411973
|
} catch (error54) {
|
|
411676
411974
|
if (isFsInaccessible(error54)) {
|
|
@@ -411924,7 +412222,7 @@ function getInstallationEnv() {
|
|
|
411924
412222
|
return;
|
|
411925
412223
|
}
|
|
411926
412224
|
function getClaudeCodeVersion() {
|
|
411927
|
-
return "1.3.
|
|
412225
|
+
return "1.3.444";
|
|
411928
412226
|
}
|
|
411929
412227
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
411930
412228
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -412553,14 +412851,14 @@ function recursivelySanitizeUnicode(value) {
|
|
|
412553
412851
|
}
|
|
412554
412852
|
|
|
412555
412853
|
// src/utils/authFileDescriptor.ts
|
|
412556
|
-
import { mkdirSync as
|
|
412854
|
+
import { mkdirSync as mkdirSync12, writeFileSync as writeFileSync12 } from "fs";
|
|
412557
412855
|
function maybePersistTokenForSubprocesses(path19, token, tokenName) {
|
|
412558
412856
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {
|
|
412559
412857
|
return;
|
|
412560
412858
|
}
|
|
412561
412859
|
try {
|
|
412562
|
-
|
|
412563
|
-
|
|
412860
|
+
mkdirSync12(CCR_TOKEN_DIR, { recursive: true, mode: 448 });
|
|
412861
|
+
writeFileSync12(path19, token, { encoding: "utf8", mode: 384 });
|
|
412564
412862
|
logForDebugging(`Persisted ${tokenName} to ${path19} for subprocess access`);
|
|
412565
412863
|
} catch (error54) {
|
|
412566
412864
|
logForDebugging(`Failed to persist ${tokenName} to disk (non-fatal): ${errorMessage(error54)}`, { level: "error" });
|
|
@@ -416360,7 +416658,7 @@ var init_wrapper = __esm(() => {
|
|
|
416360
416658
|
|
|
416361
416659
|
// src/services/mcp/client.ts
|
|
416362
416660
|
import { mkdir as mkdir12, readFile as readFile16, unlink as unlink7, writeFile as writeFile11 } from "fs/promises";
|
|
416363
|
-
import { dirname as dirname35, join as
|
|
416661
|
+
import { dirname as dirname35, join as join79 } from "path";
|
|
416364
416662
|
function isMcpSessionExpiredError(error54) {
|
|
416365
416663
|
const httpStatus = "code" in error54 ? error54.code : undefined;
|
|
416366
416664
|
if (httpStatus !== 404) {
|
|
@@ -416372,7 +416670,7 @@ function getMcpToolTimeoutMs() {
|
|
|
416372
416670
|
return parseInt(process.env.MCP_TOOL_TIMEOUT || "", 10) || DEFAULT_MCP_TOOL_TIMEOUT_MS;
|
|
416373
416671
|
}
|
|
416374
416672
|
function getMcpAuthCachePath() {
|
|
416375
|
-
return
|
|
416673
|
+
return join79(getRayuConfigHomeDir(), "mcp-needs-auth-cache.json");
|
|
416376
416674
|
}
|
|
416377
416675
|
function getMcpAuthCache() {
|
|
416378
416676
|
if (!authCachePromise) {
|
|
@@ -416381,8 +416679,8 @@ function getMcpAuthCache() {
|
|
|
416381
416679
|
return authCachePromise;
|
|
416382
416680
|
}
|
|
416383
416681
|
async function isMcpAuthCached(serverId) {
|
|
416384
|
-
const
|
|
416385
|
-
const entry =
|
|
416682
|
+
const cache6 = await getMcpAuthCache();
|
|
416683
|
+
const entry = cache6[serverId];
|
|
416386
416684
|
if (!entry) {
|
|
416387
416685
|
return false;
|
|
416388
416686
|
}
|
|
@@ -416390,11 +416688,11 @@ async function isMcpAuthCached(serverId) {
|
|
|
416390
416688
|
}
|
|
416391
416689
|
function setMcpAuthCacheEntry(serverId) {
|
|
416392
416690
|
writeChain = writeChain.then(async () => {
|
|
416393
|
-
const
|
|
416394
|
-
|
|
416691
|
+
const cache6 = await getMcpAuthCache();
|
|
416692
|
+
cache6[serverId] = { timestamp: Date.now() };
|
|
416395
416693
|
const cachePath = getMcpAuthCachePath();
|
|
416396
416694
|
await mkdir12(dirname35(cachePath), { recursive: true });
|
|
416397
|
-
await writeFile11(cachePath, jsonStringify(
|
|
416695
|
+
await writeFile11(cachePath, jsonStringify(cache6));
|
|
416398
416696
|
authCachePromise = null;
|
|
416399
416697
|
}).catch(() => {});
|
|
416400
416698
|
}
|
|
@@ -417162,7 +417460,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
417162
417460
|
const client4 = new Client({
|
|
417163
417461
|
name: "claude-code",
|
|
417164
417462
|
title: "RAYU",
|
|
417165
|
-
version: "1.3.
|
|
417463
|
+
version: "1.3.444",
|
|
417166
417464
|
description: "Anthropic's agentic coding tool",
|
|
417167
417465
|
websiteUrl: PRODUCT_URL
|
|
417168
417466
|
}, {
|
|
@@ -417479,7 +417777,7 @@ var init_client7 = __esm(() => {
|
|
|
417479
417777
|
const client4 = new Client({
|
|
417480
417778
|
name: "claude-code",
|
|
417481
417779
|
title: "RAYU",
|
|
417482
|
-
version: "1.3.
|
|
417780
|
+
version: "1.3.444",
|
|
417483
417781
|
description: "Anthropic's agentic coding tool",
|
|
417484
417782
|
websiteUrl: PRODUCT_URL
|
|
417485
417783
|
}, {
|
|
@@ -418481,7 +418779,7 @@ var init_LSPDiagnosticRegistry = __esm(() => {
|
|
|
418481
418779
|
|
|
418482
418780
|
// src/utils/plugins/lspPluginIntegration.ts
|
|
418483
418781
|
import { readFile as readFile17 } from "fs/promises";
|
|
418484
|
-
import { join as
|
|
418782
|
+
import { join as join80, relative as relative10, resolve as resolve33 } from "path";
|
|
418485
418783
|
function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
418486
418784
|
const resolvedPluginPath = resolve33(pluginPath);
|
|
418487
418785
|
const resolvedFilePath = resolve33(pluginPath, relativePath);
|
|
@@ -418493,7 +418791,7 @@ function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
|
418493
418791
|
}
|
|
418494
418792
|
async function loadPluginLspServers(plugin, errors6 = []) {
|
|
418495
418793
|
const servers = {};
|
|
418496
|
-
const lspJsonPath =
|
|
418794
|
+
const lspJsonPath = join80(plugin.path, ".lsp.json");
|
|
418497
418795
|
try {
|
|
418498
418796
|
const content = await readFile17(lspJsonPath, "utf-8");
|
|
418499
418797
|
const parsed = jsonParse(content);
|
|
@@ -423260,7 +423558,7 @@ import {
|
|
|
423260
423558
|
stat as stat22,
|
|
423261
423559
|
unlink as unlink8
|
|
423262
423560
|
} from "fs/promises";
|
|
423263
|
-
import { dirname as dirname36, isAbsolute as isAbsolute20, join as
|
|
423561
|
+
import { dirname as dirname36, isAbsolute as isAbsolute20, join as join81, relative as relative11 } from "path";
|
|
423264
423562
|
import { inspect as inspect3 } from "util";
|
|
423265
423563
|
function fileHistoryEnabled() {
|
|
423266
423564
|
if (getIsNonInteractiveSession()) {
|
|
@@ -423679,7 +423977,7 @@ function getBackupFileName(filePath, version2) {
|
|
|
423679
423977
|
}
|
|
423680
423978
|
function resolveBackupPath(backupFileName, sessionId) {
|
|
423681
423979
|
const configDir = getRayuConfigHomeDir();
|
|
423682
|
-
return
|
|
423980
|
+
return join81(configDir, "file-history", sessionId || getSessionId(), backupFileName);
|
|
423683
423981
|
}
|
|
423684
423982
|
async function createBackup(filePath, version2) {
|
|
423685
423983
|
if (filePath === null) {
|
|
@@ -423761,7 +424059,7 @@ function maybeExpandFilePath(filePath) {
|
|
|
423761
424059
|
if (isAbsolute20(filePath)) {
|
|
423762
424060
|
return filePath;
|
|
423763
424061
|
}
|
|
423764
|
-
return
|
|
424062
|
+
return join81(getOriginalCwd(), filePath);
|
|
423765
424063
|
}
|
|
423766
424064
|
function fileHistoryRestoreStateFromLog(fileHistorySnapshots, onUpdateState) {
|
|
423767
424065
|
if (!fileHistoryEnabled()) {
|
|
@@ -423807,14 +424105,14 @@ async function copyFileHistoryForResume(log3) {
|
|
|
423807
424105
|
return;
|
|
423808
424106
|
}
|
|
423809
424107
|
try {
|
|
423810
|
-
const newBackupDir =
|
|
424108
|
+
const newBackupDir = join81(getRayuConfigHomeDir(), "file-history", sessionId);
|
|
423811
424109
|
await mkdir13(newBackupDir, { recursive: true });
|
|
423812
424110
|
let failedSnapshots = 0;
|
|
423813
424111
|
await Promise.allSettled(fileHistorySnapshots.map(async (snapshot2) => {
|
|
423814
424112
|
const backupEntries = Object.values(snapshot2.trackedFileBackups).filter((backup) => backup.backupFileName !== null);
|
|
423815
424113
|
const results = await Promise.allSettled(backupEntries.map(async ({ backupFileName }) => {
|
|
423816
424114
|
const oldBackupPath = resolveBackupPath(backupFileName, previousSessionId);
|
|
423817
|
-
const newBackupPath =
|
|
424115
|
+
const newBackupPath = join81(newBackupDir, backupFileName);
|
|
423818
424116
|
try {
|
|
423819
424117
|
await link3(oldBackupPath, newBackupPath);
|
|
423820
424118
|
} catch (e2) {
|
|
@@ -423940,7 +424238,7 @@ var init_fileOperationAnalytics = __esm(() => {
|
|
|
423940
424238
|
|
|
423941
424239
|
// src/utils/gitDiff.ts
|
|
423942
424240
|
import { access as access3, readFile as readFile19 } from "fs/promises";
|
|
423943
|
-
import { dirname as dirname37, join as
|
|
424241
|
+
import { dirname as dirname37, join as join82, relative as relative12, sep as sep17 } from "path";
|
|
423944
424242
|
async function fetchGitDiff() {
|
|
423945
424243
|
const isGit = await getIsGit();
|
|
423946
424244
|
if (!isGit)
|
|
@@ -424091,7 +424389,7 @@ async function isInTransientGitState() {
|
|
|
424091
424389
|
"CHERRY_PICK_HEAD",
|
|
424092
424390
|
"REVERT_HEAD"
|
|
424093
424391
|
];
|
|
424094
|
-
const results = await Promise.all(transientFiles.map((file2) => access3(
|
|
424392
|
+
const results = await Promise.all(transientFiles.map((file2) => access3(join82(gitDir, file2)).then(() => true).catch(() => false)));
|
|
424095
424393
|
return results.some(Boolean);
|
|
424096
424394
|
}
|
|
424097
424395
|
async function fetchUntrackedFiles(maxFiles) {
|
|
@@ -428102,9 +428400,9 @@ var init_FileWriteTool = __esm(() => {
|
|
|
428102
428400
|
});
|
|
428103
428401
|
|
|
428104
428402
|
// src/utils/plugins/orphanedPluginFilter.ts
|
|
428105
|
-
import { dirname as dirname40, isAbsolute as isAbsolute23, join as
|
|
428403
|
+
import { dirname as dirname40, isAbsolute as isAbsolute23, join as join83, normalize as normalize13, relative as relative16, sep as sep20 } from "path";
|
|
428106
428404
|
async function getGlobExclusionsForPluginCache(searchPath) {
|
|
428107
|
-
const cachePath = normalize13(
|
|
428405
|
+
const cachePath = normalize13(join83(getPluginsDirectory(), "cache"));
|
|
428108
428406
|
if (searchPath && !pathsOverlap(searchPath, cachePath)) {
|
|
428109
428407
|
return [];
|
|
428110
428408
|
}
|
|
@@ -428152,7 +428450,7 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
428152
428450
|
});
|
|
428153
428451
|
|
|
428154
428452
|
// src/utils/glob.ts
|
|
428155
|
-
import { basename as basename21, dirname as dirname41, isAbsolute as isAbsolute24, join as
|
|
428453
|
+
import { basename as basename21, dirname as dirname41, isAbsolute as isAbsolute24, join as join84, sep as sep21 } from "path";
|
|
428156
428454
|
function extractGlobBaseDirectory(pattern) {
|
|
428157
428455
|
const globChars = /[*?[{]/;
|
|
428158
428456
|
const match = pattern.match(globChars);
|
|
@@ -428204,7 +428502,7 @@ async function glob2(filePattern, cwd2, { limit: limit3, offset }, abortSignal,
|
|
|
428204
428502
|
args.push("--glob", exclusion);
|
|
428205
428503
|
}
|
|
428206
428504
|
const allPaths = await ripGrep(args, searchDir, abortSignal);
|
|
428207
|
-
const absolutePaths = allPaths.map((p) => isAbsolute24(p) ? p :
|
|
428505
|
+
const absolutePaths = allPaths.map((p) => isAbsolute24(p) ? p : join84(searchDir, p));
|
|
428208
428506
|
const truncated = absolutePaths.length > offset + limit3;
|
|
428209
428507
|
const files2 = absolutePaths.slice(offset, offset + limit3);
|
|
428210
428508
|
return { files: files2, truncated };
|
|
@@ -432284,7 +432582,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
432284
432582
|
}
|
|
432285
432583
|
function computeFingerprintFromMessages(messages) {
|
|
432286
432584
|
const firstMessageText = extractFirstMessageText(messages);
|
|
432287
|
-
return computeFingerprint(firstMessageText, "1.3.
|
|
432585
|
+
return computeFingerprint(firstMessageText, "1.3.444");
|
|
432288
432586
|
}
|
|
432289
432587
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
432290
432588
|
var init_fingerprint = () => {};
|
|
@@ -432326,7 +432624,7 @@ async function sideQuery(opts) {
|
|
|
432326
432624
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
432327
432625
|
}
|
|
432328
432626
|
const messageText = extractFirstUserMessageText(messages);
|
|
432329
|
-
const fingerprint = computeFingerprint(messageText, "1.3.
|
|
432627
|
+
const fingerprint = computeFingerprint(messageText, "1.3.444");
|
|
432330
432628
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
432331
432629
|
const systemBlocks = [
|
|
432332
432630
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -438011,8 +438309,8 @@ var TEAM_LEAD_NAME = "team-lead", SWARM_SESSION_NAME = "claude-swarm", SWARM_VIE
|
|
|
438011
438309
|
|
|
438012
438310
|
// src/utils/tasks.ts
|
|
438013
438311
|
import { mkdir as mkdir14, readdir as readdir12, readFile as readFile20, unlink as unlink9, writeFile as writeFile12 } from "fs/promises";
|
|
438014
|
-
import { existsSync as
|
|
438015
|
-
import { join as
|
|
438312
|
+
import { existsSync as existsSync23, readdirSync as readdirSync5 } from "fs";
|
|
438313
|
+
import { join as join85 } from "path";
|
|
438016
438314
|
function setLeaderTeamName(teamName) {
|
|
438017
438315
|
if (leaderTeamName === teamName)
|
|
438018
438316
|
return;
|
|
@@ -438031,7 +438329,7 @@ function notifyTasksUpdated() {
|
|
|
438031
438329
|
} catch {}
|
|
438032
438330
|
}
|
|
438033
438331
|
function getHighWaterMarkPath(taskListId) {
|
|
438034
|
-
return
|
|
438332
|
+
return join85(getTasksDir(taskListId), HIGH_WATER_MARK_FILE);
|
|
438035
438333
|
}
|
|
438036
438334
|
async function readHighWaterMark(taskListId) {
|
|
438037
438335
|
const path21 = getHighWaterMarkPath(taskListId);
|
|
@@ -438074,7 +438372,7 @@ async function resetTaskList(taskListId) {
|
|
|
438074
438372
|
}
|
|
438075
438373
|
for (const file2 of files2) {
|
|
438076
438374
|
if (file2.endsWith(".json") && !file2.startsWith(".")) {
|
|
438077
|
-
const filePath =
|
|
438375
|
+
const filePath = join85(dir, file2);
|
|
438078
438376
|
try {
|
|
438079
438377
|
await unlink9(filePath);
|
|
438080
438378
|
} catch {}
|
|
@@ -438101,15 +438399,15 @@ function sanitizePathComponent(input) {
|
|
|
438101
438399
|
return input.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
438102
438400
|
}
|
|
438103
438401
|
function getTasksDir(taskListId) {
|
|
438104
|
-
return
|
|
438402
|
+
return join85(getRayuConfigHomeDir(), "tasks", sanitizePathComponent(taskListId));
|
|
438105
438403
|
}
|
|
438106
438404
|
function getTaskPath(taskListId, taskId) {
|
|
438107
|
-
return
|
|
438405
|
+
return join85(getTasksDir(taskListId), `${sanitizePathComponent(taskId)}.json`);
|
|
438108
438406
|
}
|
|
438109
438407
|
function resolveTaskListId(preferred, taskId) {
|
|
438110
|
-
if (
|
|
438408
|
+
if (existsSync23(getTaskPath(preferred, taskId)))
|
|
438111
438409
|
return preferred;
|
|
438112
|
-
const base2 =
|
|
438410
|
+
const base2 = join85(getRayuConfigHomeDir(), "tasks");
|
|
438113
438411
|
const fileName = `${sanitizePathComponent(taskId)}.json`;
|
|
438114
438412
|
const preferredDir = sanitizePathComponent(preferred);
|
|
438115
438413
|
let entries;
|
|
@@ -438121,7 +438419,7 @@ function resolveTaskListId(preferred, taskId) {
|
|
|
438121
438419
|
for (const entry of entries) {
|
|
438122
438420
|
if (entry === preferredDir)
|
|
438123
438421
|
continue;
|
|
438124
|
-
if (
|
|
438422
|
+
if (existsSync23(join85(base2, entry, fileName)))
|
|
438125
438423
|
return entry;
|
|
438126
438424
|
}
|
|
438127
438425
|
return preferred;
|
|
@@ -438295,7 +438593,7 @@ async function blockTask(taskListId, fromTaskId, toTaskId) {
|
|
|
438295
438593
|
return true;
|
|
438296
438594
|
}
|
|
438297
438595
|
function getTaskListLockPath(taskListId) {
|
|
438298
|
-
return
|
|
438596
|
+
return join85(getTasksDir(taskListId), ".lock");
|
|
438299
438597
|
}
|
|
438300
438598
|
async function ensureTaskListLockFile(taskListId) {
|
|
438301
438599
|
await ensureTasksDir(taskListId);
|
|
@@ -438493,20 +438791,20 @@ __export(exports_teammateMailbox, {
|
|
|
438493
438791
|
ModeSetRequestMessageSchema: () => ModeSetRequestMessageSchema
|
|
438494
438792
|
});
|
|
438495
438793
|
import { mkdir as mkdir15, readFile as readFile21, writeFile as writeFile13 } from "fs/promises";
|
|
438496
|
-
import { join as
|
|
438794
|
+
import { join as join86 } from "path";
|
|
438497
438795
|
function getInboxPath(agentName, teamName) {
|
|
438498
438796
|
const team = teamName || getTeamName() || "default";
|
|
438499
438797
|
const safeTeam = sanitizePathComponent(team);
|
|
438500
438798
|
const safeAgentName = sanitizePathComponent(agentName);
|
|
438501
|
-
const inboxDir =
|
|
438502
|
-
const fullPath =
|
|
438799
|
+
const inboxDir = join86(getTeamsDir(), safeTeam, "inboxes");
|
|
438800
|
+
const fullPath = join86(inboxDir, `${safeAgentName}.json`);
|
|
438503
438801
|
logForDebugging(`[TeammateMailbox] getInboxPath: agent=${agentName}, team=${team}, fullPath=${fullPath}`);
|
|
438504
438802
|
return fullPath;
|
|
438505
438803
|
}
|
|
438506
438804
|
async function ensureInboxDir(teamName) {
|
|
438507
438805
|
const team = teamName || getTeamName() || "default";
|
|
438508
438806
|
const safeTeam = sanitizePathComponent(team);
|
|
438509
|
-
const inboxDir =
|
|
438807
|
+
const inboxDir = join86(getTeamsDir(), safeTeam, "inboxes");
|
|
438510
438808
|
await mkdir15(inboxDir, { recursive: true });
|
|
438511
438809
|
logForDebugging(`[TeammateMailbox] Ensured inbox directory: ${inboxDir}`);
|
|
438512
438810
|
}
|
|
@@ -440209,9 +440507,9 @@ var init_DiagnosticsDisplay = __esm(() => {
|
|
|
440209
440507
|
|
|
440210
440508
|
// src/utils/imageStore.ts
|
|
440211
440509
|
import { mkdir as mkdir16, open as open10 } from "fs/promises";
|
|
440212
|
-
import { join as
|
|
440510
|
+
import { join as join87 } from "path";
|
|
440213
440511
|
function getImageStoreDir() {
|
|
440214
|
-
return
|
|
440512
|
+
return join87(getRayuConfigHomeDir(), IMAGE_STORE_DIR, getSessionId());
|
|
440215
440513
|
}
|
|
440216
440514
|
async function ensureImageStoreDir() {
|
|
440217
440515
|
const dir = getImageStoreDir();
|
|
@@ -440219,7 +440517,7 @@ async function ensureImageStoreDir() {
|
|
|
440219
440517
|
}
|
|
440220
440518
|
function getImagePath(imageId, mediaType) {
|
|
440221
440519
|
const extension2 = mediaType.split("/")[1] || "png";
|
|
440222
|
-
return
|
|
440520
|
+
return join87(getImageStoreDir(), `${imageId}.${extension2}`);
|
|
440223
440521
|
}
|
|
440224
440522
|
function cacheImagePath(content) {
|
|
440225
440523
|
if (content.type !== "image") {
|
|
@@ -440283,7 +440581,7 @@ function evictOldestIfAtCap() {
|
|
|
440283
440581
|
}
|
|
440284
440582
|
async function cleanupOldImageCaches() {
|
|
440285
440583
|
const fsImpl = getFsImplementation();
|
|
440286
|
-
const baseDir =
|
|
440584
|
+
const baseDir = join87(getRayuConfigHomeDir(), IMAGE_STORE_DIR);
|
|
440287
440585
|
const currentSessionId = getSessionId();
|
|
440288
440586
|
try {
|
|
440289
440587
|
let sessionDirs;
|
|
@@ -440296,7 +440594,7 @@ async function cleanupOldImageCaches() {
|
|
|
440296
440594
|
if (sessionDir.name === currentSessionId) {
|
|
440297
440595
|
continue;
|
|
440298
440596
|
}
|
|
440299
|
-
const sessionPath2 =
|
|
440597
|
+
const sessionPath2 = join87(baseDir, sessionDir.name);
|
|
440300
440598
|
try {
|
|
440301
440599
|
await fsImpl.rm(sessionPath2, { recursive: true, force: true });
|
|
440302
440600
|
logForDebugging(`Cleaned up old image cache: ${sessionPath2}`);
|
|
@@ -447483,7 +447781,7 @@ var init_types12 = __esm(() => {
|
|
|
447483
447781
|
import { createHash as createHash15 } from "crypto";
|
|
447484
447782
|
import { readFileSync as fsReadFileSync } from "fs";
|
|
447485
447783
|
import { unlink as unlink10, writeFile as writeFile14 } from "fs/promises";
|
|
447486
|
-
import { join as
|
|
447784
|
+
import { join as join88 } from "path";
|
|
447487
447785
|
function isNodeError(e2) {
|
|
447488
447786
|
return e2 instanceof Error;
|
|
447489
447787
|
}
|
|
@@ -447505,7 +447803,7 @@ function initializePolicyLimitsLoadingPromise() {
|
|
|
447505
447803
|
}
|
|
447506
447804
|
}
|
|
447507
447805
|
function getCachePath2() {
|
|
447508
|
-
return
|
|
447806
|
+
return join88(getRayuConfigHomeDir(), CACHE_FILENAME);
|
|
447509
447807
|
}
|
|
447510
447808
|
function getPolicyLimitsEndpoint() {
|
|
447511
447809
|
return `${getOauthConfig().BASE_API_URL}/api/claude_code/policy_limits`;
|
|
@@ -449037,15 +449335,15 @@ var init_gracefulShutdown = __esm(() => {
|
|
|
449037
449335
|
|
|
449038
449336
|
// src/utils/imagePaste.ts
|
|
449039
449337
|
import { randomBytes as randomBytes9 } from "crypto";
|
|
449040
|
-
import { basename as basename25, extname as extname9, isAbsolute as isAbsolute26, join as
|
|
449338
|
+
import { basename as basename25, extname as extname9, isAbsolute as isAbsolute26, join as join89 } from "path";
|
|
449041
449339
|
function getClipboardCommands() {
|
|
449042
449340
|
const platform3 = process.platform;
|
|
449043
449341
|
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (platform3 === "win32" ? process.env.TEMP || "C:\\Temp" : "/tmp");
|
|
449044
449342
|
const screenshotFilename = "claude_cli_latest_screenshot.png";
|
|
449045
449343
|
const tempPaths = {
|
|
449046
|
-
darwin:
|
|
449047
|
-
linux:
|
|
449048
|
-
win32:
|
|
449344
|
+
darwin: join89(baseTmpDir, screenshotFilename),
|
|
449345
|
+
linux: join89(baseTmpDir, screenshotFilename),
|
|
449346
|
+
win32: join89(baseTmpDir, screenshotFilename)
|
|
449049
449347
|
};
|
|
449050
449348
|
const screenshotPath = tempPaths[platform3] || tempPaths.linux;
|
|
449051
449349
|
const commands = {
|
|
@@ -456586,9 +456884,9 @@ __export(exports_teamHelpers, {
|
|
|
456586
456884
|
cleanupSessionTeams: () => cleanupSessionTeams,
|
|
456587
456885
|
addHiddenPaneId: () => addHiddenPaneId
|
|
456588
456886
|
});
|
|
456589
|
-
import { mkdirSync as
|
|
456887
|
+
import { mkdirSync as mkdirSync13, readFileSync as readFileSync27, writeFileSync as writeFileSync13 } from "fs";
|
|
456590
456888
|
import { mkdir as mkdir17, readFile as readFile22, rm as rm6, writeFile as writeFile15 } from "fs/promises";
|
|
456591
|
-
import { join as
|
|
456889
|
+
import { join as join90 } from "path";
|
|
456592
456890
|
function sanitizeName(name) {
|
|
456593
456891
|
return name.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
456594
456892
|
}
|
|
@@ -456596,14 +456894,14 @@ function sanitizeAgentName(name) {
|
|
|
456596
456894
|
return name.replace(/@/g, "-");
|
|
456597
456895
|
}
|
|
456598
456896
|
function getTeamDir(teamName) {
|
|
456599
|
-
return
|
|
456897
|
+
return join90(getTeamsDir(), sanitizeName(teamName));
|
|
456600
456898
|
}
|
|
456601
456899
|
function getTeamFilePath(teamName) {
|
|
456602
|
-
return
|
|
456900
|
+
return join90(getTeamDir(teamName), "config.json");
|
|
456603
456901
|
}
|
|
456604
456902
|
function readTeamFile(teamName) {
|
|
456605
456903
|
try {
|
|
456606
|
-
const content =
|
|
456904
|
+
const content = readFileSync27(getTeamFilePath(teamName), "utf-8");
|
|
456607
456905
|
return jsonParse(content);
|
|
456608
456906
|
} catch (e2) {
|
|
456609
456907
|
if (getErrnoCode(e2) === "ENOENT")
|
|
@@ -456625,8 +456923,8 @@ async function readTeamFileAsync(teamName) {
|
|
|
456625
456923
|
}
|
|
456626
456924
|
function writeTeamFile(teamName, teamFile) {
|
|
456627
456925
|
const teamDir = getTeamDir(teamName);
|
|
456628
|
-
|
|
456629
|
-
|
|
456926
|
+
mkdirSync13(teamDir, { recursive: true });
|
|
456927
|
+
writeFileSync13(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2));
|
|
456630
456928
|
}
|
|
456631
456929
|
async function writeTeamFileAsync(teamName, teamFile) {
|
|
456632
456930
|
const teamDir = getTeamDir(teamName);
|
|
@@ -456790,15 +457088,15 @@ async function setMemberActive(teamName, memberName, isActive) {
|
|
|
456790
457088
|
logForDebugging(`[TeammateTool] Set member ${memberName} in team ${teamName} to ${isActive ? "active" : "idle"}`);
|
|
456791
457089
|
}
|
|
456792
457090
|
async function destroyWorktree(worktreePath) {
|
|
456793
|
-
const gitFilePath =
|
|
457091
|
+
const gitFilePath = join90(worktreePath, ".git");
|
|
456794
457092
|
let mainRepoPath = null;
|
|
456795
457093
|
try {
|
|
456796
457094
|
const gitFileContent = (await readFile22(gitFilePath, "utf-8")).trim();
|
|
456797
457095
|
const match = gitFileContent.match(/^gitdir:\s*(.+)$/);
|
|
456798
457096
|
if (match && match[1]) {
|
|
456799
457097
|
const worktreeGitDir = match[1];
|
|
456800
|
-
const mainGitDir =
|
|
456801
|
-
mainRepoPath =
|
|
457098
|
+
const mainGitDir = join90(worktreeGitDir, "..", "..");
|
|
457099
|
+
mainRepoPath = join90(mainGitDir, "..");
|
|
456802
457100
|
}
|
|
456803
457101
|
} catch {}
|
|
456804
457102
|
if (mainRepoPath) {
|
|
@@ -459540,10 +459838,10 @@ var init_filesApi = __esm(() => {
|
|
|
459540
459838
|
// src/utils/tempfile.ts
|
|
459541
459839
|
import { createHash as createHash17, randomUUID as randomUUID18 } from "crypto";
|
|
459542
459840
|
import { tmpdir as tmpdir9 } from "os";
|
|
459543
|
-
import { join as
|
|
459841
|
+
import { join as join92 } from "path";
|
|
459544
459842
|
function generateTempFilePath(prefix = "claude-prompt", extension2 = ".md", options) {
|
|
459545
459843
|
const id = options?.contentHash ? createHash17("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID18();
|
|
459546
|
-
return
|
|
459844
|
+
return join92(tmpdir9(), `${prefix}-${id}${extension2}`);
|
|
459547
459845
|
}
|
|
459548
459846
|
var init_tempfile = () => {};
|
|
459549
459847
|
|
|
@@ -464131,7 +464429,7 @@ ${result.result}`
|
|
|
464131
464429
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
464132
464430
|
import { cp as cp2, mkdir as mkdir19, mkdtemp as mkdtemp3, readFile as readFile24, readdir as readdir13, rename as rename4, rm as rm7, stat as stat24, writeFile as writeFile17 } from "fs/promises";
|
|
464133
464431
|
import { homedir as homedir25, tmpdir as tmpdir10 } from "os";
|
|
464134
|
-
import { basename as basename27, isAbsolute as isAbsolute27, join as
|
|
464432
|
+
import { basename as basename27, isAbsolute as isAbsolute27, join as join93, resolve as resolve38, sep as sep25 } from "path";
|
|
464135
464433
|
function sanitizeSkillName(raw) {
|
|
464136
464434
|
const name = raw.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[-.]+|[-.]+$/g, "");
|
|
464137
464435
|
if (!name || name === "." || name === ".." || name.includes("/")) {
|
|
@@ -464140,7 +464438,7 @@ function sanitizeSkillName(raw) {
|
|
|
464140
464438
|
return name;
|
|
464141
464439
|
}
|
|
464142
464440
|
function getUserSkillsDir() {
|
|
464143
|
-
return
|
|
464441
|
+
return join93(getRayuConfigHomeDir(), "skills");
|
|
464144
464442
|
}
|
|
464145
464443
|
function classifySource(rawSource, localExists) {
|
|
464146
464444
|
const source = rawSource.trim();
|
|
@@ -464184,9 +464482,9 @@ function classifySource(rawSource, localExists) {
|
|
|
464184
464482
|
return { type: "local", path: source };
|
|
464185
464483
|
}
|
|
464186
464484
|
async function locateSkillDirs(root2) {
|
|
464187
|
-
if (await fileExists(
|
|
464485
|
+
if (await fileExists(join93(root2, "SKILL.md")))
|
|
464188
464486
|
return [root2];
|
|
464189
|
-
const skillsContainer =
|
|
464487
|
+
const skillsContainer = join93(root2, "skills");
|
|
464190
464488
|
if (await fileExists(skillsContainer)) {
|
|
464191
464489
|
const collected = await collectSkillDirs(skillsContainer, 0, 4, []);
|
|
464192
464490
|
if (collected.length > 0)
|
|
@@ -464200,7 +464498,7 @@ async function locateSkillDirs(root2) {
|
|
|
464200
464498
|
async function collectSkillDirs(dir, depth, maxDepth, out) {
|
|
464201
464499
|
if (depth > maxDepth)
|
|
464202
464500
|
return out;
|
|
464203
|
-
if (await fileExists(
|
|
464501
|
+
if (await fileExists(join93(dir, "SKILL.md"))) {
|
|
464204
464502
|
out.push(dir);
|
|
464205
464503
|
return out;
|
|
464206
464504
|
}
|
|
@@ -464215,7 +464513,7 @@ async function collectSkillDirs(dir, depth, maxDepth, out) {
|
|
|
464215
464513
|
continue;
|
|
464216
464514
|
if (e2.name.startsWith(".") || e2.name === "node_modules")
|
|
464217
464515
|
continue;
|
|
464218
|
-
await collectSkillDirs(
|
|
464516
|
+
await collectSkillDirs(join93(dir, e2.name), depth + 1, maxDepth, out);
|
|
464219
464517
|
}
|
|
464220
464518
|
return out;
|
|
464221
464519
|
}
|
|
@@ -464248,24 +464546,24 @@ async function installSkillFromSource(rawSource, options = {}) {
|
|
|
464248
464546
|
throw new InstallSkillError("No skill source provided.");
|
|
464249
464547
|
const localExists = await fileExists(expandHome(source));
|
|
464250
464548
|
const kind = classifySource(source, localExists);
|
|
464251
|
-
const staging = await mkdtemp3(
|
|
464549
|
+
const staging = await mkdtemp3(join93(tmpdir10(), "rayu-skill-"));
|
|
464252
464550
|
try {
|
|
464253
464551
|
let scanRoot;
|
|
464254
464552
|
if (kind.type === "local") {
|
|
464255
464553
|
scanRoot = expandHome(kind.path);
|
|
464256
464554
|
} else if (kind.type === "github") {
|
|
464257
|
-
const cloneDir =
|
|
464555
|
+
const cloneDir = join93(staging, "repo");
|
|
464258
464556
|
await cloneGitHub(kind.owner, kind.repo, cloneDir);
|
|
464259
|
-
const root2 = kind.subdir ?
|
|
464557
|
+
const root2 = kind.subdir ? join93(cloneDir, kind.subdir) : cloneDir;
|
|
464260
464558
|
if (!resolve38(root2).startsWith(resolve38(cloneDir))) {
|
|
464261
464559
|
throw new InstallSkillError("Invalid subdir in GitHub source.");
|
|
464262
464560
|
}
|
|
464263
464561
|
scanRoot = root2;
|
|
464264
464562
|
} else {
|
|
464265
|
-
const dlDir =
|
|
464563
|
+
const dlDir = join93(staging, "dl");
|
|
464266
464564
|
await mkdir19(dlDir, { recursive: true });
|
|
464267
464565
|
const md3 = await downloadText(kind.url);
|
|
464268
|
-
await writeFile17(
|
|
464566
|
+
await writeFile17(join93(dlDir, "SKILL.md"), md3, "utf-8");
|
|
464269
464567
|
scanRoot = dlDir;
|
|
464270
464568
|
}
|
|
464271
464569
|
const skillDirs = await locateSkillDirs(scanRoot);
|
|
@@ -464273,7 +464571,7 @@ async function installSkillFromSource(rawSource, options = {}) {
|
|
|
464273
464571
|
const planned = [];
|
|
464274
464572
|
const seenNames = new Set;
|
|
464275
464573
|
for (const skillDir of skillDirs) {
|
|
464276
|
-
const skillFile =
|
|
464574
|
+
const skillFile = join93(skillDir, "SKILL.md");
|
|
464277
464575
|
let content;
|
|
464278
464576
|
try {
|
|
464279
464577
|
content = await readFile24(skillFile, { encoding: "utf-8" });
|
|
@@ -464287,7 +464585,7 @@ async function installSkillFromSource(rawSource, options = {}) {
|
|
|
464287
464585
|
continue;
|
|
464288
464586
|
seenNames.add(name);
|
|
464289
464587
|
const description = (frontmatter.description != null ? String(frontmatter.description) : "") || firstLine(markdown) || "Installed skill";
|
|
464290
|
-
const dest =
|
|
464588
|
+
const dest = join93(skillsRoot, name);
|
|
464291
464589
|
if (!resolve38(dest).startsWith(resolve38(skillsRoot) + sep25)) {
|
|
464292
464590
|
throw new InstallSkillError(`Refusing to install outside ${skillsRoot}.`);
|
|
464293
464591
|
}
|
|
@@ -464297,7 +464595,7 @@ async function installSkillFromSource(rawSource, options = {}) {
|
|
|
464297
464595
|
const installed = [];
|
|
464298
464596
|
for (const p of planned) {
|
|
464299
464597
|
const replaced = await fileExists(p.dest);
|
|
464300
|
-
const tmpDest =
|
|
464598
|
+
const tmpDest = join93(skillsRoot, `.${p.name}.installing-${randomUUID21()}`);
|
|
464301
464599
|
await cp2(p.skillDir, tmpDest, { recursive: true });
|
|
464302
464600
|
await rm7(p.dest, { recursive: true, force: true });
|
|
464303
464601
|
await rename4(tmpDest, p.dest);
|
|
@@ -464319,7 +464617,7 @@ function expandHome(p) {
|
|
|
464319
464617
|
if (p === "~")
|
|
464320
464618
|
return homedir25();
|
|
464321
464619
|
if (p.startsWith("~/"))
|
|
464322
|
-
return
|
|
464620
|
+
return join93(homedir25(), p.slice(2));
|
|
464323
464621
|
return p;
|
|
464324
464622
|
}
|
|
464325
464623
|
function firstLine(markdown) {
|
|
@@ -481158,14 +481456,14 @@ var require_turndown_cjs = __commonJS((exports, module) => {
|
|
|
481158
481456
|
} else if (node.nodeType === 1) {
|
|
481159
481457
|
replacement = replacementForNode.call(self2, node);
|
|
481160
481458
|
}
|
|
481161
|
-
return
|
|
481459
|
+
return join94(output, replacement);
|
|
481162
481460
|
}, "");
|
|
481163
481461
|
}
|
|
481164
481462
|
function postProcess(output) {
|
|
481165
481463
|
var self2 = this;
|
|
481166
481464
|
this.rules.forEach(function(rule) {
|
|
481167
481465
|
if (typeof rule.append === "function") {
|
|
481168
|
-
output =
|
|
481466
|
+
output = join94(output, rule.append(self2.options));
|
|
481169
481467
|
}
|
|
481170
481468
|
});
|
|
481171
481469
|
return output.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
|
|
@@ -481178,7 +481476,7 @@ var require_turndown_cjs = __commonJS((exports, module) => {
|
|
|
481178
481476
|
content = content.trim();
|
|
481179
481477
|
return whitespace.leading + rule.replacement(content, node, this.options) + whitespace.trailing;
|
|
481180
481478
|
}
|
|
481181
|
-
function
|
|
481479
|
+
function join94(output, replacement) {
|
|
481182
481480
|
var s1 = trimTrailingNewlines(output);
|
|
481183
481481
|
var s2 = trimLeadingNewlines(replacement);
|
|
481184
481482
|
var nls = Math.max(output.length - s1.length, replacement.length - s2.length);
|
|
@@ -481721,7 +482019,7 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
481721
482019
|
|
|
481722
482020
|
// src/utils/listSessionsImpl.ts
|
|
481723
482021
|
import { readdir as readdir14, stat as stat25 } from "fs/promises";
|
|
481724
|
-
import { basename as basename28, join as
|
|
482022
|
+
import { basename as basename28, join as join94 } from "path";
|
|
481725
482023
|
async function listCandidates(projectDir, doStat, projectPath) {
|
|
481726
482024
|
let names;
|
|
481727
482025
|
try {
|
|
@@ -481735,7 +482033,7 @@ async function listCandidates(projectDir, doStat, projectPath) {
|
|
|
481735
482033
|
const sessionId = validateUuid(name.slice(0, -6));
|
|
481736
482034
|
if (!sessionId)
|
|
481737
482035
|
return null;
|
|
481738
|
-
const filePath =
|
|
482036
|
+
const filePath = join94(projectDir, name);
|
|
481739
482037
|
if (!doStat)
|
|
481740
482038
|
return { sessionId, filePath, mtime: 0, projectPath };
|
|
481741
482039
|
try {
|
|
@@ -481754,9 +482052,9 @@ var init_listSessionsImpl = __esm(() => {
|
|
|
481754
482052
|
|
|
481755
482053
|
// src/services/autoDream/consolidationLock.ts
|
|
481756
482054
|
import { mkdir as mkdir20, readFile as readFile25, stat as stat26, unlink as unlink12, utimes, writeFile as writeFile18 } from "fs/promises";
|
|
481757
|
-
import { join as
|
|
482055
|
+
import { join as join95 } from "path";
|
|
481758
482056
|
function lockPath() {
|
|
481759
|
-
return
|
|
482057
|
+
return join95(getAutoMemPath(), LOCK_FILE);
|
|
481760
482058
|
}
|
|
481761
482059
|
async function readLastConsolidatedAt() {
|
|
481762
482060
|
try {
|
|
@@ -486876,150 +487174,6 @@ var init_UI16 = __esm(() => {
|
|
|
486876
487174
|
jsx_runtime134 = __toESM(require_jsx_runtime(), 1);
|
|
486877
487175
|
});
|
|
486878
487176
|
|
|
486879
|
-
// src/services/rayuAuth/rayuHostedProvider.ts
|
|
486880
|
-
function syncRayuHostedProvider(ent, opts) {
|
|
486881
|
-
try {
|
|
486882
|
-
const cfg = loadRayuConfig();
|
|
486883
|
-
const allowed = ent?.allowedModels ?? [];
|
|
486884
|
-
const models = allowed.map((m3) => m3.code);
|
|
486885
|
-
const idx = cfg.providers.findIndex((p) => p.id === RAYU_HOSTED_PROVIDER_ID);
|
|
486886
|
-
if (models.length > 0) {
|
|
486887
|
-
const existing = idx >= 0 ? cfg.providers[idx] : undefined;
|
|
486888
|
-
const firstCode = allowed[0]?.code;
|
|
486889
|
-
const provider = {
|
|
486890
|
-
...existing,
|
|
486891
|
-
id: RAYU_HOSTED_PROVIDER_ID,
|
|
486892
|
-
kind: "rayu-hosted",
|
|
486893
|
-
baseURL: rayuHostedBaseURL(),
|
|
486894
|
-
models,
|
|
486895
|
-
fetchedModels: models,
|
|
486896
|
-
defaultModel: existing?.defaultModel ?? firstCode,
|
|
486897
|
-
smallFastModel: existing?.smallFastModel ?? firstCode
|
|
486898
|
-
};
|
|
486899
|
-
if (idx >= 0)
|
|
486900
|
-
cfg.providers[idx] = provider;
|
|
486901
|
-
else
|
|
486902
|
-
cfg.providers.push(provider);
|
|
486903
|
-
if (opts?.activate)
|
|
486904
|
-
cfg.activeProvider = RAYU_HOSTED_PROVIDER_ID;
|
|
486905
|
-
saveRayuConfig(cfg);
|
|
486906
|
-
return;
|
|
486907
|
-
}
|
|
486908
|
-
if (idx >= 0) {
|
|
486909
|
-
cfg.providers.splice(idx, 1);
|
|
486910
|
-
if (cfg.activeProvider === RAYU_HOSTED_PROVIDER_ID) {
|
|
486911
|
-
cfg.activeProvider = cfg.providers[0]?.id;
|
|
486912
|
-
}
|
|
486913
|
-
saveRayuConfig(cfg);
|
|
486914
|
-
}
|
|
486915
|
-
} catch {}
|
|
486916
|
-
}
|
|
486917
|
-
var init_rayuHostedProvider = __esm(() => {
|
|
486918
|
-
init_rayuConfig();
|
|
486919
|
-
init_rayuProviders();
|
|
486920
|
-
init_rayuHostedAuth();
|
|
486921
|
-
});
|
|
486922
|
-
|
|
486923
|
-
// src/services/rayuAuth/rayuEntitlements.ts
|
|
486924
|
-
import { existsSync as existsSync23, mkdirSync as mkdirSync13, readFileSync as readFileSync27, rmSync as rmSync6, writeFileSync as writeFileSync13 } from "fs";
|
|
486925
|
-
import { join as join95 } from "path";
|
|
486926
|
-
function entitlementsPath() {
|
|
486927
|
-
return join95(getRayuConfigHomeDir(), FILE);
|
|
486928
|
-
}
|
|
486929
|
-
function currentUserId() {
|
|
486930
|
-
return readRayuSession()?.user?.id ?? null;
|
|
486931
|
-
}
|
|
486932
|
-
function loadFromDiskOnce() {
|
|
486933
|
-
if (loadedFromDisk)
|
|
486934
|
-
return;
|
|
486935
|
-
loadedFromDisk = true;
|
|
486936
|
-
try {
|
|
486937
|
-
const p = entitlementsPath();
|
|
486938
|
-
if (existsSync23(p)) {
|
|
486939
|
-
cache5 = JSON.parse(readFileSync27(p, "utf8"));
|
|
486940
|
-
}
|
|
486941
|
-
} catch {
|
|
486942
|
-
cache5 = null;
|
|
486943
|
-
}
|
|
486944
|
-
}
|
|
486945
|
-
function persist(ent) {
|
|
486946
|
-
try {
|
|
486947
|
-
const dir = getRayuConfigHomeDir();
|
|
486948
|
-
if (!existsSync23(dir))
|
|
486949
|
-
mkdirSync13(dir, { recursive: true });
|
|
486950
|
-
const p = entitlementsPath();
|
|
486951
|
-
if (ent)
|
|
486952
|
-
writeFileSync13(p, JSON.stringify(ent, null, 2), { mode: 384 });
|
|
486953
|
-
else
|
|
486954
|
-
rmSync6(p, { force: true });
|
|
486955
|
-
} catch {}
|
|
486956
|
-
}
|
|
486957
|
-
function getCachedEntitlements() {
|
|
486958
|
-
loadFromDiskOnce();
|
|
486959
|
-
if (cache5 && cache5.userId != null) {
|
|
486960
|
-
const uid = currentUserId();
|
|
486961
|
-
if (uid != null && uid !== cache5.userId) {
|
|
486962
|
-
cache5 = null;
|
|
486963
|
-
}
|
|
486964
|
-
}
|
|
486965
|
-
if (isUseRayuOAuthEnabled() && hasRayuSession() && !fetching && Date.now() - lastAttempt > REFRESH_COOLDOWN_MS) {
|
|
486966
|
-
refreshRayuEntitlements();
|
|
486967
|
-
}
|
|
486968
|
-
return cache5;
|
|
486969
|
-
}
|
|
486970
|
-
async function refreshRayuEntitlements() {
|
|
486971
|
-
if (!isUseRayuOAuthEnabled() || !hasRayuSession())
|
|
486972
|
-
return null;
|
|
486973
|
-
if (fetching)
|
|
486974
|
-
return cache5;
|
|
486975
|
-
fetching = true;
|
|
486976
|
-
lastAttempt = Date.now();
|
|
486977
|
-
try {
|
|
486978
|
-
const token = await getValidRayuAccessToken();
|
|
486979
|
-
if (!token)
|
|
486980
|
-
return cache5;
|
|
486981
|
-
const res = await globalThis.fetch(`${getRayuApiBaseUrl()}/me/entitlements`, { headers: { Authorization: `Bearer ${token}` } });
|
|
486982
|
-
if (!res.ok)
|
|
486983
|
-
return cache5;
|
|
486984
|
-
const data = await res.json();
|
|
486985
|
-
data.userId = currentUserId();
|
|
486986
|
-
cache5 = data;
|
|
486987
|
-
loadedFromDisk = true;
|
|
486988
|
-
persist(data);
|
|
486989
|
-
syncRayuHostedProvider(data);
|
|
486990
|
-
return data;
|
|
486991
|
-
} catch {
|
|
486992
|
-
return cache5;
|
|
486993
|
-
} finally {
|
|
486994
|
-
fetching = false;
|
|
486995
|
-
}
|
|
486996
|
-
}
|
|
486997
|
-
function clearRayuEntitlements() {
|
|
486998
|
-
cache5 = null;
|
|
486999
|
-
loadedFromDisk = true;
|
|
487000
|
-
lastAttempt = 0;
|
|
487001
|
-
persist(null);
|
|
487002
|
-
syncRayuHostedProvider(null);
|
|
487003
|
-
}
|
|
487004
|
-
function rayuFeatureAllowed(featureKey) {
|
|
487005
|
-
if (!isUseRayuOAuthEnabled())
|
|
487006
|
-
return true;
|
|
487007
|
-
const ent = getCachedEntitlements();
|
|
487008
|
-
if (ent && ent.features) {
|
|
487009
|
-
const f3 = ent.features[featureKey];
|
|
487010
|
-
if (!f3)
|
|
487011
|
-
return true;
|
|
487012
|
-
return f3.enabled !== false;
|
|
487013
|
-
}
|
|
487014
|
-
return !hasRayuSession();
|
|
487015
|
-
}
|
|
487016
|
-
var FILE = "rayu-entitlements.json", REFRESH_COOLDOWN_MS = 30000, cache5 = null, loadedFromDisk = false, fetching = false, lastAttempt = 0;
|
|
487017
|
-
var init_rayuEntitlements = __esm(() => {
|
|
487018
|
-
init_envUtils();
|
|
487019
|
-
init_rayuHostedProvider();
|
|
487020
|
-
init_rayuSession();
|
|
487021
|
-
});
|
|
487022
|
-
|
|
487023
487177
|
// src/services/rayuAuth/rayuFeatureUsage.ts
|
|
487024
487178
|
function getFeatureUsage(featureKey) {
|
|
487025
487179
|
maybeRefreshFeatureUsage();
|
|
@@ -499762,7 +499916,9 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
499762
499916
|
yield* yieldMissingToolResultBlocks(assistantMessages, userInitiated ? "Interrupted by user" : "Tool execution was cancelled (a parallel tool failed or timed out)");
|
|
499763
499917
|
}
|
|
499764
499918
|
if (false) {}
|
|
499765
|
-
|
|
499919
|
+
const lastAssistant = assistantMessages.at(-1);
|
|
499920
|
+
const abortAlreadyRendered = isUserAbortRenderedMessage(lastAssistant);
|
|
499921
|
+
if (abortReason !== "interrupt" && userInitiated && !abortAlreadyRendered) {
|
|
499766
499922
|
yield createUserInterruptionMessage({
|
|
499767
499923
|
toolUse: false
|
|
499768
499924
|
});
|
|
@@ -500146,6 +500302,7 @@ var init_query3 = __esm(() => {
|
|
|
500146
500302
|
init_withRetry();
|
|
500147
500303
|
init_autoCompact();
|
|
500148
500304
|
init_compact();
|
|
500305
|
+
init_interruptMessage();
|
|
500149
500306
|
init_analytics();
|
|
500150
500307
|
init_imageValidation();
|
|
500151
500308
|
init_imageResizer();
|
|
@@ -527799,7 +527956,7 @@ function Feedback({
|
|
|
527799
527956
|
platform: env4.platform,
|
|
527800
527957
|
gitRepo: envInfo.isGit,
|
|
527801
527958
|
terminal: env4.terminal,
|
|
527802
|
-
version: "1.3.
|
|
527959
|
+
version: "1.3.444",
|
|
527803
527960
|
transcript: normalizeMessagesForAPI(messages),
|
|
527804
527961
|
errors: sanitizedErrors,
|
|
527805
527962
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -527991,7 +528148,7 @@ function Feedback({
|
|
|
527991
528148
|
", ",
|
|
527992
528149
|
env4.terminal,
|
|
527993
528150
|
", v",
|
|
527994
|
-
"1.3.
|
|
528151
|
+
"1.3.444"
|
|
527995
528152
|
]
|
|
527996
528153
|
})
|
|
527997
528154
|
]
|
|
@@ -528097,7 +528254,7 @@ ${sanitizedDescription}
|
|
|
528097
528254
|
` + `**Environment Info**
|
|
528098
528255
|
` + `- Platform: ${env4.platform}
|
|
528099
528256
|
` + `- Terminal: ${env4.terminal}
|
|
528100
|
-
` + `- Version: ${"1.3.
|
|
528257
|
+
` + `- Version: ${"1.3.444"}
|
|
528101
528258
|
` + `- Feedback ID: ${feedbackId}
|
|
528102
528259
|
` + `
|
|
528103
528260
|
**Errors**
|
|
@@ -530937,9 +531094,9 @@ async function assertMinVersion() {
|
|
|
530937
531094
|
if (false) {}
|
|
530938
531095
|
try {
|
|
530939
531096
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
530940
|
-
if (versionConfig.minVersion && lt("1.3.
|
|
531097
|
+
if (versionConfig.minVersion && lt("1.3.444", versionConfig.minVersion)) {
|
|
530941
531098
|
console.error(`
|
|
530942
|
-
It looks like your version of RAYU (${"1.3.
|
|
531099
|
+
It looks like your version of RAYU (${"1.3.444"}) needs an update.
|
|
530943
531100
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
530944
531101
|
|
|
530945
531102
|
To update, please run:
|
|
@@ -531165,7 +531322,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
531165
531322
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
531166
531323
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
531167
531324
|
pid: process.pid,
|
|
531168
|
-
currentVersion: "1.3.
|
|
531325
|
+
currentVersion: "1.3.444"
|
|
531169
531326
|
});
|
|
531170
531327
|
return "in_progress";
|
|
531171
531328
|
}
|
|
@@ -531174,7 +531331,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
531174
531331
|
if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
|
|
531175
531332
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
531176
531333
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
531177
|
-
currentVersion: "1.3.
|
|
531334
|
+
currentVersion: "1.3.444"
|
|
531178
531335
|
});
|
|
531179
531336
|
console.error(`
|
|
531180
531337
|
Error: Windows NPM detected in WSL
|
|
@@ -531706,7 +531863,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
531706
531863
|
}
|
|
531707
531864
|
async function getDoctorDiagnostic() {
|
|
531708
531865
|
const installationType = await getCurrentInstallationType();
|
|
531709
|
-
const version2 = typeof MACRO !== "undefined" ? "1.3.
|
|
531866
|
+
const version2 = typeof MACRO !== "undefined" ? "1.3.444" : "unknown";
|
|
531710
531867
|
const installationPath = await getInstallationPath();
|
|
531711
531868
|
const invokedBinary = getInvokedBinary();
|
|
531712
531869
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -532501,8 +532658,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
532501
532658
|
const maxVersion = await getMaxVersion();
|
|
532502
532659
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
532503
532660
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
532504
|
-
if (gte("1.3.
|
|
532505
|
-
logForDebugging(`Native installer: current version ${"1.3.
|
|
532661
|
+
if (gte("1.3.444", maxVersion)) {
|
|
532662
|
+
logForDebugging(`Native installer: current version ${"1.3.444"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
532506
532663
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
532507
532664
|
latency_ms: Date.now() - startTime2,
|
|
532508
532665
|
max_version: maxVersion,
|
|
@@ -532513,7 +532670,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
532513
532670
|
version2 = maxVersion;
|
|
532514
532671
|
}
|
|
532515
532672
|
}
|
|
532516
|
-
if (!forceReinstall && version2 === "1.3.
|
|
532673
|
+
if (!forceReinstall && version2 === "1.3.444" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
|
|
532517
532674
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
532518
532675
|
logEvent("tengu_native_update_complete", {
|
|
532519
532676
|
latency_ms: Date.now() - startTime2,
|
|
@@ -533709,7 +533866,7 @@ function buildPrimarySection() {
|
|
|
533709
533866
|
});
|
|
533710
533867
|
return [{
|
|
533711
533868
|
label: "Version",
|
|
533712
|
-
value: "1.3.
|
|
533869
|
+
value: "1.3.444"
|
|
533713
533870
|
}, {
|
|
533714
533871
|
label: "Session name",
|
|
533715
533872
|
value: nameValue
|
|
@@ -537400,7 +537557,7 @@ function Config({
|
|
|
537400
537557
|
}
|
|
537401
537558
|
})
|
|
537402
537559
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime170.jsx(ChannelDowngradeDialog, {
|
|
537403
|
-
currentVersion: "1.3.
|
|
537560
|
+
currentVersion: "1.3.444",
|
|
537404
537561
|
onChoice: (choice) => {
|
|
537405
537562
|
setShowSubmenu(null);
|
|
537406
537563
|
setTabsHidden(false);
|
|
@@ -537412,7 +537569,7 @@ function Config({
|
|
|
537412
537569
|
autoUpdatesChannel: "stable"
|
|
537413
537570
|
};
|
|
537414
537571
|
if (choice === "stay") {
|
|
537415
|
-
newSettings.minimumVersion = "1.3.
|
|
537572
|
+
newSettings.minimumVersion = "1.3.444";
|
|
537416
537573
|
}
|
|
537417
537574
|
updateSettingsForSource("userSettings", newSettings);
|
|
537418
537575
|
setSettingsData((prev_27) => ({
|
|
@@ -545474,7 +545631,7 @@ function HelpV2(t0) {
|
|
|
545474
545631
|
let t6;
|
|
545475
545632
|
if ($3[31] !== tabs) {
|
|
545476
545633
|
t6 = /* @__PURE__ */ jsx_runtime197.jsx(Tabs, {
|
|
545477
|
-
title: `Rayu-CLI v${"1.3.
|
|
545634
|
+
title: `Rayu-CLI v${"1.3.444"}`,
|
|
545478
545635
|
color: "professionalBlue",
|
|
545479
545636
|
defaultTab: "general",
|
|
545480
545637
|
children: tabs
|
|
@@ -565561,7 +565718,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
|
|
|
565561
565718
|
}
|
|
565562
565719
|
return [];
|
|
565563
565720
|
}
|
|
565564
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.3.
|
|
565721
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.3.444") {
|
|
565565
565722
|
if (false) {}
|
|
565566
565723
|
const cachedChangelog = await getStoredChangelog();
|
|
565567
565724
|
if (lastSeenVersion !== currentVersion || !cachedChangelog) {
|
|
@@ -565574,7 +565731,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.3.443")
|
|
|
565574
565731
|
releaseNotes
|
|
565575
565732
|
};
|
|
565576
565733
|
}
|
|
565577
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.3.
|
|
565734
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.3.444") {
|
|
565578
565735
|
if (false) {}
|
|
565579
565736
|
const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
|
|
565580
565737
|
return {
|
|
@@ -565702,7 +565859,7 @@ function getRecentActivitySync() {
|
|
|
565702
565859
|
return cachedActivity;
|
|
565703
565860
|
}
|
|
565704
565861
|
function getLogoDisplayData() {
|
|
565705
|
-
const version2 = process.env.DEMO_VERSION ?? "1.3.
|
|
565862
|
+
const version2 = process.env.DEMO_VERSION ?? "1.3.444";
|
|
565706
565863
|
const serverUrl = getDirectConnectServerUrl();
|
|
565707
565864
|
const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
|
|
565708
565865
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -566949,7 +567106,7 @@ function LogoV2() {
|
|
|
566949
567106
|
if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
566950
567107
|
t2 = () => {
|
|
566951
567108
|
const currentConfig = getGlobalConfig();
|
|
566952
|
-
if (currentConfig.lastReleaseNotesSeen === "1.3.
|
|
567109
|
+
if (currentConfig.lastReleaseNotesSeen === "1.3.444") {
|
|
566953
567110
|
return;
|
|
566954
567111
|
}
|
|
566955
567112
|
saveGlobalConfig(_temp327);
|
|
@@ -567427,7 +567584,7 @@ function LogoV2() {
|
|
|
567427
567584
|
t24 = $3[61];
|
|
567428
567585
|
}
|
|
567429
567586
|
const _latestNpm = getCachedLatestNpmVersionSync();
|
|
567430
|
-
const _updateFeeds = _latestNpm && gt(_latestNpm, "1.3.
|
|
567587
|
+
const _updateFeeds = _latestNpm && gt(_latestNpm, "1.3.444") ? [createUpdateAvailableFeed("1.3.444", _latestNpm)] : [];
|
|
567431
567588
|
const t25 = layoutMode === "horizontal" && /* @__PURE__ */ jsx_runtime239.jsx(FeedColumn, {
|
|
567432
567589
|
feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), ..._updateFeeds, createWhatsNewFeed(changelog)],
|
|
567433
567590
|
maxWidth: rightWidth
|
|
@@ -567627,12 +567784,12 @@ function LogoV2() {
|
|
|
567627
567784
|
return t41;
|
|
567628
567785
|
}
|
|
567629
567786
|
function _temp327(current) {
|
|
567630
|
-
if (current.lastReleaseNotesSeen === "1.3.
|
|
567787
|
+
if (current.lastReleaseNotesSeen === "1.3.444") {
|
|
567631
567788
|
return current;
|
|
567632
567789
|
}
|
|
567633
567790
|
return {
|
|
567634
567791
|
...current,
|
|
567635
|
-
lastReleaseNotesSeen: "1.3.
|
|
567792
|
+
lastReleaseNotesSeen: "1.3.444"
|
|
567636
567793
|
};
|
|
567637
567794
|
}
|
|
567638
567795
|
function _temp241(s_0) {
|
|
@@ -592541,7 +592698,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
592541
592698
|
smapsRollup,
|
|
592542
592699
|
platform: process.platform,
|
|
592543
592700
|
nodeVersion: process.version,
|
|
592544
|
-
ccVersion: "1.3.
|
|
592701
|
+
ccVersion: "1.3.444"
|
|
592545
592702
|
};
|
|
592546
592703
|
}
|
|
592547
592704
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -593063,7 +593220,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
593063
593220
|
var call49 = async () => {
|
|
593064
593221
|
return {
|
|
593065
593222
|
type: "text",
|
|
593066
|
-
value: "1.3.
|
|
593223
|
+
value: "1.3.444"
|
|
593067
593224
|
};
|
|
593068
593225
|
}, version2, version_default;
|
|
593069
593226
|
var init_version = __esm(() => {
|
|
@@ -594459,7 +594616,7 @@ var init_rayuLogin = __esm(() => {
|
|
|
594459
594616
|
init_rayuEntitlements();
|
|
594460
594617
|
init_rayuHostedProvider();
|
|
594461
594618
|
init_rayuSession();
|
|
594462
|
-
RAYU_SUCCESS_HTML = '<html><body style="font-family:sans-serif"><h3>Signed in to Rayu.</h3>' + "<p>You can close this tab and return to your terminal.</p></body></html>";
|
|
594619
|
+
RAYU_SUCCESS_HTML = '<html><body style="font-family:sans-serif"><h3>Signed in to Rayu.</h3>' + "<p>You can close this tab and return to your terminal.</p></body></html>" + '<p>View Your dashboard: <a href="' + getRayuWebBaseUrl() + '/dashboard" target="_blank">here</a></p></body></html>';
|
|
594463
594620
|
LOGIN_TIMEOUT_MS2 = 5 * 60 * 1000;
|
|
594464
594621
|
});
|
|
594465
594622
|
|
|
@@ -603016,7 +603173,7 @@ function generateHtmlReport(data, insights) {
|
|
|
603016
603173
|
</html>`;
|
|
603017
603174
|
}
|
|
603018
603175
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
603019
|
-
const version3 = typeof MACRO !== "undefined" ? "1.3.
|
|
603176
|
+
const version3 = typeof MACRO !== "undefined" ? "1.3.444" : "unknown";
|
|
603020
603177
|
const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
|
|
603021
603178
|
const facets_summary = {
|
|
603022
603179
|
total: facets.size,
|
|
@@ -606926,7 +607083,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
606926
607083
|
init_settings2();
|
|
606927
607084
|
init_slowOperations();
|
|
606928
607085
|
init_uuid();
|
|
606929
|
-
VERSION6 = typeof MACRO !== "undefined" ? "1.3.
|
|
607086
|
+
VERSION6 = typeof MACRO !== "undefined" ? "1.3.444" : "unknown";
|
|
606930
607087
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
606931
607088
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
606932
607089
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -608146,7 +608303,7 @@ var init_filesystem = __esm(() => {
|
|
|
608146
608303
|
});
|
|
608147
608304
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
608148
608305
|
const nonce = randomBytes19(16).toString("hex");
|
|
608149
|
-
return join154(getClaudeTempDir(), "bundled-skills", "1.3.
|
|
608306
|
+
return join154(getClaudeTempDir(), "bundled-skills", "1.3.444", nonce);
|
|
608150
608307
|
});
|
|
608151
608308
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
608152
608309
|
});
|
|
@@ -613261,7 +613418,7 @@ __export(exports_update, {
|
|
|
613261
613418
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
613262
613419
|
import { homedir as homedir35 } from "os";
|
|
613263
613420
|
async function update() {
|
|
613264
|
-
writeToStdout(`Current version: ${"1.3.
|
|
613421
|
+
writeToStdout(`Current version: ${"1.3.444"}
|
|
613265
613422
|
`);
|
|
613266
613423
|
const isBundled = isInBundledMode();
|
|
613267
613424
|
if (isBundled) {
|
|
@@ -613287,13 +613444,13 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
|
|
|
613287
613444
|
process.exit(1);
|
|
613288
613445
|
return;
|
|
613289
613446
|
}
|
|
613290
|
-
if (latestVersion === "1.3.
|
|
613447
|
+
if (latestVersion === "1.3.444") {
|
|
613291
613448
|
writeToStdout(source_default.green(`
|
|
613292
|
-
Rayu CLI is up to date (${"1.3.
|
|
613449
|
+
Rayu CLI is up to date (${"1.3.444"})
|
|
613293
613450
|
`));
|
|
613294
613451
|
process.exit(0);
|
|
613295
613452
|
}
|
|
613296
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"1.3.
|
|
613453
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"1.3.444"})
|
|
613297
613454
|
`);
|
|
613298
613455
|
writeToStdout(`Installing update...
|
|
613299
613456
|
|
|
@@ -613317,7 +613474,7 @@ Try manually:
|
|
|
613317
613474
|
return;
|
|
613318
613475
|
}
|
|
613319
613476
|
writeToStdout(source_default.green(`
|
|
613320
|
-
Successfully updated from ${"1.3.
|
|
613477
|
+
Successfully updated from ${"1.3.444"} to ${latestVersion}
|
|
613321
613478
|
`));
|
|
613322
613479
|
process.exit(0);
|
|
613323
613480
|
}
|
|
@@ -613331,14 +613488,14 @@ async function updateNativeBinary() {
|
|
|
613331
613488
|
} catch {
|
|
613332
613489
|
latestVersion = "";
|
|
613333
613490
|
}
|
|
613334
|
-
if (latestVersion && latestVersion === "1.3.
|
|
613491
|
+
if (latestVersion && latestVersion === "1.3.444") {
|
|
613335
613492
|
writeToStdout(source_default.green(`
|
|
613336
|
-
Rayu CLI is up to date (1.3.
|
|
613493
|
+
Rayu CLI is up to date (1.3.444)
|
|
613337
613494
|
`));
|
|
613338
613495
|
process.exit(0);
|
|
613339
613496
|
}
|
|
613340
613497
|
if (latestVersion) {
|
|
613341
|
-
writeToStdout(`New version available: ${latestVersion} (current: 1.3.
|
|
613498
|
+
writeToStdout(`New version available: ${latestVersion} (current: 1.3.444)
|
|
613342
613499
|
`);
|
|
613343
613500
|
}
|
|
613344
613501
|
writeToStdout(`Downloading and installing update...
|
|
@@ -613353,13 +613510,13 @@ Rayu CLI is up to date (1.3.443)
|
|
|
613353
613510
|
return;
|
|
613354
613511
|
}
|
|
613355
613512
|
writeToStdout(source_default.green(`
|
|
613356
|
-
Rayu CLI is up to date (1.3.
|
|
613513
|
+
Rayu CLI is up to date (1.3.444)
|
|
613357
613514
|
`));
|
|
613358
613515
|
process.exit(0);
|
|
613359
613516
|
}
|
|
613360
613517
|
const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
|
|
613361
613518
|
writeToStdout(source_default.green(`
|
|
613362
|
-
Successfully updated from 1.3.
|
|
613519
|
+
Successfully updated from 1.3.444 to ${updatedTo}
|
|
613363
613520
|
`));
|
|
613364
613521
|
writeToStdout(`Restart your terminal to use the new version.
|
|
613365
613522
|
`);
|
|
@@ -613390,7 +613547,7 @@ __export(exports_uninstall, {
|
|
|
613390
613547
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
613391
613548
|
import { homedir as homedir36 } from "os";
|
|
613392
613549
|
async function uninstall() {
|
|
613393
|
-
writeToStdout(`Uninstalling Rayu CLI (${"1.3.
|
|
613550
|
+
writeToStdout(`Uninstalling Rayu CLI (${"1.3.444"})...
|
|
613394
613551
|
`);
|
|
613395
613552
|
writeToStdout(`Running: npm uninstall -g ${"@rayu-dev/rayu-cli"}
|
|
613396
613553
|
|
|
@@ -613413,7 +613570,7 @@ Try running manually:
|
|
|
613413
613570
|
process.exit(1);
|
|
613414
613571
|
}
|
|
613415
613572
|
writeToStdout(source_default.green(`
|
|
613416
|
-
Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.3.
|
|
613573
|
+
Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.3.444"}
|
|
613417
613574
|
`));
|
|
613418
613575
|
writeToStdout(`Thanks for using Rayu CLI!
|
|
613419
613576
|
`);
|
|
@@ -613465,7 +613622,7 @@ function showFirstRunWelcome() {
|
|
|
613465
613622
|
`);
|
|
613466
613623
|
try {
|
|
613467
613624
|
mkdirSync16(getRayuConfigHomeDir(), { recursive: true });
|
|
613468
|
-
writeFileSync18(markerPath(), "1.3.
|
|
613625
|
+
writeFileSync18(markerPath(), "1.3.444", "utf8");
|
|
613469
613626
|
} catch {}
|
|
613470
613627
|
}
|
|
613471
613628
|
var init_firstRun = __esm(() => {
|
|
@@ -625308,7 +625465,7 @@ async function initializeBetaTracing(resource) {
|
|
|
625308
625465
|
});
|
|
625309
625466
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
625310
625467
|
setLoggerProvider(loggerProvider);
|
|
625311
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.3.
|
|
625468
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.3.444");
|
|
625312
625469
|
setEventLogger(eventLogger);
|
|
625313
625470
|
process.on("beforeExit", async () => {
|
|
625314
625471
|
await loggerProvider?.forceFlush();
|
|
@@ -625348,7 +625505,7 @@ async function initializeTelemetry() {
|
|
|
625348
625505
|
const platform4 = getPlatform();
|
|
625349
625506
|
const baseAttributes = {
|
|
625350
625507
|
[import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
|
|
625351
|
-
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.3.
|
|
625508
|
+
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.3.444"
|
|
625352
625509
|
};
|
|
625353
625510
|
if (platform4 === "wsl") {
|
|
625354
625511
|
const wslVersion = getWslVersion();
|
|
@@ -625393,7 +625550,7 @@ async function initializeTelemetry() {
|
|
|
625393
625550
|
} catch {}
|
|
625394
625551
|
};
|
|
625395
625552
|
registerCleanup(shutdownTelemetry2);
|
|
625396
|
-
return meterProvider2.getMeter("com.anthropic.claude_code", "1.3.
|
|
625553
|
+
return meterProvider2.getMeter("com.anthropic.claude_code", "1.3.444");
|
|
625397
625554
|
}
|
|
625398
625555
|
const meterProvider = new import_sdk_metrics2.MeterProvider({
|
|
625399
625556
|
resource,
|
|
@@ -625413,7 +625570,7 @@ async function initializeTelemetry() {
|
|
|
625413
625570
|
});
|
|
625414
625571
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
625415
625572
|
setLoggerProvider(loggerProvider);
|
|
625416
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.3.
|
|
625573
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.3.444");
|
|
625417
625574
|
setEventLogger(eventLogger);
|
|
625418
625575
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
625419
625576
|
process.on("beforeExit", async () => {
|
|
@@ -625475,7 +625632,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
625475
625632
|
}
|
|
625476
625633
|
};
|
|
625477
625634
|
registerCleanup(shutdownTelemetry);
|
|
625478
|
-
return meterProvider.getMeter("com.anthropic.claude_code", "1.3.
|
|
625635
|
+
return meterProvider.getMeter("com.anthropic.claude_code", "1.3.444");
|
|
625479
625636
|
}
|
|
625480
625637
|
async function flushTelemetry() {
|
|
625481
625638
|
const meterProvider = getMeterProvider();
|
|
@@ -626988,7 +627145,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
626988
627145
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
626989
627146
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
626990
627147
|
betas: getSdkBetas(),
|
|
626991
|
-
claude_code_version: "1.3.
|
|
627148
|
+
claude_code_version: "1.3.444",
|
|
626992
627149
|
output_style: outputStyle2,
|
|
626993
627150
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
626994
627151
|
skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -643322,7 +643479,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
643322
643479
|
function getSemverPart(version3) {
|
|
643323
643480
|
return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
|
|
643324
643481
|
}
|
|
643325
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.3.
|
|
643482
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.3.444") {
|
|
643326
643483
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react217.useState(() => getSemverPart(initialVersion));
|
|
643327
643484
|
if (!updatedVersion) {
|
|
643328
643485
|
return null;
|
|
@@ -643362,7 +643519,7 @@ function AutoUpdater({
|
|
|
643362
643519
|
return;
|
|
643363
643520
|
}
|
|
643364
643521
|
if (false) {}
|
|
643365
|
-
const currentVersion = "1.3.
|
|
643522
|
+
const currentVersion = "1.3.444";
|
|
643366
643523
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
643367
643524
|
let latestVersion = await getLatestVersion(channel2);
|
|
643368
643525
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -643575,12 +643732,12 @@ function NativeAutoUpdater({
|
|
|
643575
643732
|
logEvent("tengu_native_auto_updater_start", {});
|
|
643576
643733
|
try {
|
|
643577
643734
|
const maxVersion = await getMaxVersion();
|
|
643578
|
-
if (maxVersion && gt("1.3.
|
|
643735
|
+
if (maxVersion && gt("1.3.444", maxVersion)) {
|
|
643579
643736
|
const msg = await getMaxVersionMessage();
|
|
643580
643737
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
643581
643738
|
}
|
|
643582
643739
|
const result = await installLatest(channel2);
|
|
643583
|
-
const currentVersion = "1.3.
|
|
643740
|
+
const currentVersion = "1.3.444";
|
|
643584
643741
|
const latencyMs = Date.now() - startTime2;
|
|
643585
643742
|
if (result.lockFailed) {
|
|
643586
643743
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -643717,17 +643874,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
643717
643874
|
const maxVersion = await getMaxVersion();
|
|
643718
643875
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
643719
643876
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
643720
|
-
if (gte("1.3.
|
|
643721
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.3.
|
|
643877
|
+
if (gte("1.3.444", maxVersion)) {
|
|
643878
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.3.444"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
643722
643879
|
setUpdateAvailable(false);
|
|
643723
643880
|
return;
|
|
643724
643881
|
}
|
|
643725
643882
|
latest = maxVersion;
|
|
643726
643883
|
}
|
|
643727
|
-
const hasUpdate = latest && !gte("1.3.
|
|
643884
|
+
const hasUpdate = latest && !gte("1.3.444", latest) && !shouldSkipVersion(latest);
|
|
643728
643885
|
setUpdateAvailable(!!hasUpdate);
|
|
643729
643886
|
if (hasUpdate) {
|
|
643730
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.3.
|
|
643887
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.3.444"} -> ${latest}`);
|
|
643731
643888
|
}
|
|
643732
643889
|
};
|
|
643733
643890
|
$3[0] = t1;
|
|
@@ -643761,7 +643918,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
643761
643918
|
wrap: "truncate",
|
|
643762
643919
|
children: [
|
|
643763
643920
|
"currentVersion: ",
|
|
643764
|
-
"1.3.
|
|
643921
|
+
"1.3.444"
|
|
643765
643922
|
]
|
|
643766
643923
|
});
|
|
643767
643924
|
$3[3] = verbose;
|
|
@@ -651926,7 +652083,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
651926
652083
|
project_dir: getOriginalCwd(),
|
|
651927
652084
|
added_dirs: addedDirs
|
|
651928
652085
|
},
|
|
651929
|
-
version: "1.3.
|
|
652086
|
+
version: "1.3.444",
|
|
651930
652087
|
output_style: {
|
|
651931
652088
|
name: outputStyleName
|
|
651932
652089
|
},
|
|
@@ -653732,7 +653889,7 @@ function PromptChar(t0) {
|
|
|
653732
653889
|
themeColor
|
|
653733
653890
|
} = t0;
|
|
653734
653891
|
const teammateColor = themeColor;
|
|
653735
|
-
const color3 = teammateColor ??
|
|
653892
|
+
const color3 = teammateColor ?? "#00ff88";
|
|
653736
653893
|
let t1;
|
|
653737
653894
|
if ($3[0] !== color3 || $3[1] !== isLoading) {
|
|
653738
653895
|
t1 = /* @__PURE__ */ jsx_runtime418.jsxs(ThemedText, {
|
|
@@ -663424,7 +663581,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
663424
663581
|
} catch {}
|
|
663425
663582
|
const data = {
|
|
663426
663583
|
trigger,
|
|
663427
|
-
version: "1.3.
|
|
663584
|
+
version: "1.3.444",
|
|
663428
663585
|
platform: process.platform,
|
|
663429
663586
|
transcript,
|
|
663430
663587
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -671459,6 +671616,8 @@ function REPL({
|
|
|
671459
671616
|
const haikuTitleAttemptedRef = import_react309.useRef((initialMessages?.length ?? 0) > 0);
|
|
671460
671617
|
const agentTitle = mainThreadAgentDefinition?.agentType;
|
|
671461
671618
|
const terminalTitle = sessionTitle ?? agentTitle ?? haikuTitle ?? "Rayu-CLI";
|
|
671619
|
+
const terminalTabDetail = sessionTitle ?? agentTitle ?? haikuTitle;
|
|
671620
|
+
const terminalTabTitle = terminalTabDetail ? `rayu — ${terminalTabDetail}` : "rayu";
|
|
671462
671621
|
const isWaitingForApproval = toolUseConfirmQueue.length > 0 || promptQueue.length > 0 || pendingWorkerRequest || pendingSandboxRequest;
|
|
671463
671622
|
const isShowingLocalJSXCommand = toolJSX?.isLocalJSXCommand === true && toolJSX?.jsx != null;
|
|
671464
671623
|
const titleIsAnimating = isLoading && !isWaitingForApproval && !isShowingLocalJSXCommand;
|
|
@@ -673589,7 +673748,7 @@ Note: ctrl + z now suspends RAYU, ctrl + _ undoes input.
|
|
|
673589
673748
|
children: [
|
|
673590
673749
|
/* @__PURE__ */ jsx_runtime451.jsx(AnimatedTerminalTitle, {
|
|
673591
673750
|
isAnimating: titleIsAnimating,
|
|
673592
|
-
title:
|
|
673751
|
+
title: terminalTabTitle,
|
|
673593
673752
|
disabled: titleDisabled,
|
|
673594
673753
|
noPrefix: showStatusInTerminalTab
|
|
673595
673754
|
}),
|
|
@@ -673695,7 +673854,7 @@ Note: ctrl + z now suspends RAYU, ctrl + _ undoes input.
|
|
|
673695
673854
|
children: [
|
|
673696
673855
|
/* @__PURE__ */ jsx_runtime451.jsx(AnimatedTerminalTitle, {
|
|
673697
673856
|
isAnimating: titleIsAnimating,
|
|
673698
|
-
title:
|
|
673857
|
+
title: terminalTabTitle,
|
|
673699
673858
|
disabled: titleDisabled,
|
|
673700
673859
|
noPrefix: showStatusInTerminalTab
|
|
673701
673860
|
}),
|
|
@@ -675609,7 +675768,7 @@ function WelcomeV2() {
|
|
|
675609
675768
|
dimColor: true,
|
|
675610
675769
|
children: [
|
|
675611
675770
|
"v",
|
|
675612
|
-
"1.3.
|
|
675771
|
+
"1.3.444"
|
|
675613
675772
|
]
|
|
675614
675773
|
})
|
|
675615
675774
|
]
|
|
@@ -677343,7 +677502,7 @@ function completeOnboarding() {
|
|
|
677343
677502
|
saveGlobalConfig((current) => ({
|
|
677344
677503
|
...current,
|
|
677345
677504
|
hasCompletedOnboarding: true,
|
|
677346
|
-
lastOnboardingVersion: "1.3.
|
|
677505
|
+
lastOnboardingVersion: "1.3.444"
|
|
677347
677506
|
}));
|
|
677348
677507
|
}
|
|
677349
677508
|
function showDialog(root2, renderer) {
|
|
@@ -682293,7 +682452,7 @@ function appendToLog(path30, message) {
|
|
|
682293
682452
|
cwd: getFsImplementation().cwd(),
|
|
682294
682453
|
userType: "external",
|
|
682295
682454
|
sessionId: getSessionId(),
|
|
682296
|
-
version: "1.3.
|
|
682455
|
+
version: "1.3.444"
|
|
682297
682456
|
};
|
|
682298
682457
|
getLogWriter(path30).write(messageWithTimestamp);
|
|
682299
682458
|
}
|
|
@@ -686401,8 +686560,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
686401
686560
|
}
|
|
686402
686561
|
async function checkEnvLessBridgeMinVersion() {
|
|
686403
686562
|
const cfg = await getEnvLessBridgeConfig();
|
|
686404
|
-
if (cfg.min_version && lt("1.3.
|
|
686405
|
-
return `Your version of RAYU (${"1.3.
|
|
686563
|
+
if (cfg.min_version && lt("1.3.444", cfg.min_version)) {
|
|
686564
|
+
return `Your version of RAYU (${"1.3.444"}) is too old for Remote Control.
|
|
686406
686565
|
Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
|
|
686407
686566
|
}
|
|
686408
686567
|
return null;
|
|
@@ -686876,7 +687035,7 @@ async function initBridgeCore(params) {
|
|
|
686876
687035
|
const rawApi = createBridgeApiClient({
|
|
686877
687036
|
baseUrl,
|
|
686878
687037
|
getAccessToken,
|
|
686879
|
-
runnerVersion: "1.3.
|
|
687038
|
+
runnerVersion: "1.3.444",
|
|
686880
687039
|
onDebug: logForDebugging,
|
|
686881
687040
|
onAuth401,
|
|
686882
687041
|
getTrustedDeviceToken
|
|
@@ -692238,7 +692397,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
|
|
|
692238
692397
|
setCwd(cwd3);
|
|
692239
692398
|
const server = new Server({
|
|
692240
692399
|
name: "claude/tengu",
|
|
692241
|
-
version: "1.3.
|
|
692400
|
+
version: "1.3.444"
|
|
692242
692401
|
}, {
|
|
692243
692402
|
capabilities: {
|
|
692244
692403
|
tools: {}
|
|
@@ -694764,7 +694923,7 @@ ${customInstructions}` : customInstructions;
|
|
|
694764
694923
|
}
|
|
694765
694924
|
}
|
|
694766
694925
|
logForDiagnosticsNoPII("info", "started", {
|
|
694767
|
-
version: "1.3.
|
|
694926
|
+
version: "1.3.444",
|
|
694768
694927
|
is_native_binary: isInBundledMode()
|
|
694769
694928
|
});
|
|
694770
694929
|
registerCleanup(async () => {
|
|
@@ -695483,7 +695642,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
695483
695642
|
pendingHookMessages
|
|
695484
695643
|
}, renderAndRun);
|
|
695485
695644
|
}
|
|
695486
|
-
}).version("1.3.
|
|
695645
|
+
}).version("1.3.444 (Rayu-CLI)", "-v, --version", "Output the version number");
|
|
695487
695646
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
695488
695647
|
program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
695489
695648
|
if (canUserConfigureAdvisor()) {
|
|
@@ -695945,9 +696104,14 @@ if (false) {}
|
|
|
695945
696104
|
async function main2() {
|
|
695946
696105
|
const args = process.argv.slice(2);
|
|
695947
696106
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
695948
|
-
console.log(`${"1.3.
|
|
696107
|
+
console.log(`${"1.3.444"} (Rayu-CLI)`);
|
|
695949
696108
|
return;
|
|
695950
696109
|
}
|
|
696110
|
+
if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)) {
|
|
696111
|
+
try {
|
|
696112
|
+
process.title = "rayu";
|
|
696113
|
+
} catch {}
|
|
696114
|
+
}
|
|
695951
696115
|
const { maybeReexecForHeapLimit: maybeReexecForHeapLimit2 } = await Promise.resolve().then(() => (init_heapLimitReexec(), exports_heapLimitReexec));
|
|
695952
696116
|
maybeReexecForHeapLimit2();
|
|
695953
696117
|
const {
|