@rayu-dev/rayu-cli 1.7.23 → 2.0.0
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 +571 -290
- package/package.json +1 -1
package/dist/rayu.js
CHANGED
|
@@ -656,6 +656,7 @@ __export(exports_envUtils, {
|
|
|
656
656
|
resolveConfigHomeDir: () => resolveConfigHomeDir,
|
|
657
657
|
parseEnvVars: () => parseEnvVars,
|
|
658
658
|
loadDotEnv: () => loadDotEnv,
|
|
659
|
+
isUnsandboxedTestConfigAccess: () => isUnsandboxedTestConfigAccess,
|
|
659
660
|
isRunningOnHomespace: () => isRunningOnHomespace,
|
|
660
661
|
isInProtectedNamespace: () => isInProtectedNamespace,
|
|
661
662
|
isEnvTruthyWithLegacyAlias: () => isEnvTruthyWithLegacyAlias,
|
|
@@ -802,6 +803,11 @@ function resolveRayuConfigHomeDir(home, envDir, _dirExists) {
|
|
|
802
803
|
const rayu = join(home, ".rayu");
|
|
803
804
|
return rayu;
|
|
804
805
|
}
|
|
806
|
+
function isUnsandboxedTestConfigAccess() {
|
|
807
|
+
if (!process.env.BUN_TEST)
|
|
808
|
+
return false;
|
|
809
|
+
return !process.env.RAYU_CONFIG_DIR && !process.env.RAYU_AUTH_CONFIG_DIR;
|
|
810
|
+
}
|
|
805
811
|
function getTeamsDir() {
|
|
806
812
|
return join(getRayuConfigHomeDir(), "teams");
|
|
807
813
|
}
|
|
@@ -42088,6 +42094,7 @@ var exports_rayuModelCatalog = {};
|
|
|
42088
42094
|
__export(exports_rayuModelCatalog, {
|
|
42089
42095
|
pickRayuDefaultModels: () => pickRayuDefaultModels,
|
|
42090
42096
|
hostedModelLabels: () => hostedModelLabels,
|
|
42097
|
+
hostedModelDescriptions: () => hostedModelDescriptions,
|
|
42091
42098
|
hostedModelCapabilities: () => hostedModelCapabilities,
|
|
42092
42099
|
hostedContextWindows: () => hostedContextWindows,
|
|
42093
42100
|
catalogSignature: () => catalogSignature
|
|
@@ -42102,6 +42109,15 @@ function hostedModelLabels(catalog) {
|
|
|
42102
42109
|
}
|
|
42103
42110
|
return out;
|
|
42104
42111
|
}
|
|
42112
|
+
function hostedModelDescriptions(catalog) {
|
|
42113
|
+
const out = {};
|
|
42114
|
+
for (const m2 of catalog) {
|
|
42115
|
+
const description = typeof m2.description === "string" ? m2.description.trim() : "";
|
|
42116
|
+
if (description)
|
|
42117
|
+
out[m2.code] = description;
|
|
42118
|
+
}
|
|
42119
|
+
return out;
|
|
42120
|
+
}
|
|
42105
42121
|
function hostedContextWindows(catalog) {
|
|
42106
42122
|
const out = {};
|
|
42107
42123
|
for (const m2 of catalog) {
|
|
@@ -42112,8 +42128,8 @@ function hostedContextWindows(catalog) {
|
|
|
42112
42128
|
}
|
|
42113
42129
|
return out;
|
|
42114
42130
|
}
|
|
42115
|
-
function catalogSignature(models, labels, windows2) {
|
|
42116
|
-
return models.map((m2) => `${m2}|${labels?.[m2] ?? ""}|${windows2?.[m2] ?? ""}`).join(",");
|
|
42131
|
+
function catalogSignature(models, labels, windows2, descriptions) {
|
|
42132
|
+
return models.map((m2) => `${m2}|${labels?.[m2] ?? ""}|${descriptions?.[m2] ?? ""}|${windows2?.[m2] ?? ""}`).join(",");
|
|
42117
42133
|
}
|
|
42118
42134
|
function pickRayuDefaultModels(models) {
|
|
42119
42135
|
if (models.length === 0)
|
|
@@ -61315,7 +61331,7 @@ function lazySchema(factory) {
|
|
|
61315
61331
|
}
|
|
61316
61332
|
|
|
61317
61333
|
// src/protocol/coreSchemas.ts
|
|
61318
|
-
var ModelUsageSchema, OutputFormatTypeSchema, BaseOutputFormatSchema, JsonSchemaOutputFormatSchema, OutputFormatSchema, ApiKeySourceSchema, ConfigScopeSchema, SdkBetaSchema, ThinkingAdaptiveSchema, ThinkingEnabledSchema, ThinkingDisabledSchema, ThinkingConfigSchema, McpStdioServerConfigSchema, McpSSEServerConfigSchema, McpHttpServerConfigSchema, McpSdkServerConfigSchema, McpServerConfigForProcessTransportSchema, McpServerStatusConfigSchema, McpServerStatusSchema, McpSetServersResultSchema, PermissionUpdateDestinationSchema, PermissionBehaviorSchema, PermissionRuleValueSchema, PermissionUpdateSchema, PermissionDecisionClassificationSchema, PermissionResultSchema, PermissionModeSchema, HOOK_EVENTS, HookEventSchema, BaseHookInputSchema, PreToolUseHookInputSchema, PermissionRequestHookInputSchema, PostToolUseHookInputSchema, PostToolUseFailureHookInputSchema, PermissionDeniedHookInputSchema, NotificationHookInputSchema, UserPromptSubmitHookInputSchema, SessionStartHookInputSchema, SetupHookInputSchema, StopHookInputSchema, StopFailureHookInputSchema, SubagentStartHookInputSchema, SubagentStopHookInputSchema, PreCompactHookInputSchema, PostCompactHookInputSchema, TeammateIdleHookInputSchema, TaskCreatedHookInputSchema, TaskCompletedHookInputSchema, ElicitationHookInputSchema, ElicitationResultHookInputSchema, CONFIG_CHANGE_SOURCES, ConfigChangeHookInputSchema, INSTRUCTIONS_LOAD_REASONS, INSTRUCTIONS_MEMORY_TYPES, InstructionsLoadedHookInputSchema, WorktreeCreateHookInputSchema, WorktreeRemoveHookInputSchema, CwdChangedHookInputSchema, FileChangedHookInputSchema, EXIT_REASONS, ExitReasonSchema, SessionEndHookInputSchema, HookInputSchema, AsyncHookJSONOutputSchema, PreToolUseHookSpecificOutputSchema, UserPromptSubmitHookSpecificOutputSchema, SessionStartHookSpecificOutputSchema, SetupHookSpecificOutputSchema, SubagentStartHookSpecificOutputSchema, PostToolUseHookSpecificOutputSchema, PostToolUseFailureHookSpecificOutputSchema, PermissionDeniedHookSpecificOutputSchema, NotificationHookSpecificOutputSchema, PermissionRequestHookSpecificOutputSchema, CwdChangedHookSpecificOutputSchema, FileChangedHookSpecificOutputSchema, SyncHookJSONOutputSchema, ElicitationHookSpecificOutputSchema, ElicitationResultHookSpecificOutputSchema, WorktreeCreateHookSpecificOutputSchema, HookJSONOutputSchema, PromptRequestOptionSchema, PromptRequestSchema, PromptResponseSchema, SlashCommandSchema, AgentInfoSchema, ModelInfoSchema, AccountInfoSchema, AgentMcpServerSpecSchema, AgentDefinitionSchema, SettingSourceSchema, SdkPluginConfigSchema, RewindFilesResultSchema, APIUserMessagePlaceholder, APIAssistantMessagePlaceholder, RawMessageStreamEventPlaceholder, NonNullableUsagePlaceholder, UUIDPlaceholder, SDKAssistantMessageErrorSchema, SDKStatusSchema, SDKUserMessageContentSchema, SDKUserMessageSchema, SDKUserMessageReplaySchema, SDKRateLimitInfoSchema, SDKAssistantMessageSchema, SDKRateLimitEventSchema, SDKStreamlinedTextMessageSchema, SDKStreamlinedToolUseSummaryMessageSchema, SDKPermissionDenialSchema, SDKResultSuccessSchema, SDKResultErrorSchema, SDKResultMessageSchema, SDKSystemMessageSchema, SDKPartialAssistantMessageSchema, SDKCompactBoundaryMessageSchema, SDKStatusMessageSchema, SDKPostTurnSummaryMessageSchema, SDKAPIRetryMessageSchema, SDKLocalCommandOutputMessageSchema, SDKHookStartedMessageSchema, SDKHookProgressMessageSchema, SDKHookResponseMessageSchema, SDKToolProgressMessageSchema, SDKAuthStatusMessageSchema, SDKFilesPersistedEventSchema, FileChangeReviewFileSchema, FileChangeReviewSummarySchema, SDKFileChangeReviewMessageSchema, SDKTaskNotificationMessageSchema, SDKTaskStartedMessageSchema, SDKSessionStateChangedMessageSchema, SDKTaskProgressMessageSchema, SDKToolUseSummaryMessageSchema, SDKElicitationCompleteMessageSchema, SDKPromptSuggestionMessageSchema, SDKSessionInfoSchema, SDKMessageSchema, FastModeStateSchema;
|
|
61334
|
+
var ModelUsageSchema, OutputFormatTypeSchema, BaseOutputFormatSchema, JsonSchemaOutputFormatSchema, OutputFormatSchema, ApiKeySourceSchema, ConfigScopeSchema, SdkBetaSchema, ThinkingAdaptiveSchema, ThinkingEnabledSchema, ThinkingDisabledSchema, ThinkingConfigSchema, McpStdioServerConfigSchema, McpSSEServerConfigSchema, McpHttpServerConfigSchema, McpSdkServerConfigSchema, McpServerConfigForProcessTransportSchema, McpServerStatusConfigSchema, McpServerStatusSchema, McpSetServersResultSchema, PermissionUpdateDestinationSchema, PermissionBehaviorSchema, PermissionRuleValueSchema, PermissionUpdateSchema, PermissionDecisionClassificationSchema, PermissionResultSchema, PermissionModeSchema, HOOK_EVENTS, HookEventSchema, BaseHookInputSchema, PreToolUseHookInputSchema, PermissionRequestHookInputSchema, PostToolUseHookInputSchema, PostToolUseFailureHookInputSchema, PermissionDeniedHookInputSchema, NotificationHookInputSchema, UserPromptSubmitHookInputSchema, SessionStartHookInputSchema, SetupHookInputSchema, StopHookInputSchema, StopFailureHookInputSchema, SubagentStartHookInputSchema, SubagentStopHookInputSchema, PreCompactHookInputSchema, PostCompactHookInputSchema, TeammateIdleHookInputSchema, TaskCreatedHookInputSchema, TaskCompletedHookInputSchema, ElicitationHookInputSchema, ElicitationResultHookInputSchema, CONFIG_CHANGE_SOURCES, ConfigChangeHookInputSchema, INSTRUCTIONS_LOAD_REASONS, INSTRUCTIONS_MEMORY_TYPES, InstructionsLoadedHookInputSchema, WorktreeCreateHookInputSchema, WorktreeRemoveHookInputSchema, CwdChangedHookInputSchema, FileChangedHookInputSchema, EXIT_REASONS, ExitReasonSchema, SessionEndHookInputSchema, HookInputSchema, AsyncHookJSONOutputSchema, PreToolUseHookSpecificOutputSchema, UserPromptSubmitHookSpecificOutputSchema, SessionStartHookSpecificOutputSchema, SetupHookSpecificOutputSchema, SubagentStartHookSpecificOutputSchema, PostToolUseHookSpecificOutputSchema, PostToolUseFailureHookSpecificOutputSchema, PermissionDeniedHookSpecificOutputSchema, NotificationHookSpecificOutputSchema, PermissionRequestHookSpecificOutputSchema, CwdChangedHookSpecificOutputSchema, FileChangedHookSpecificOutputSchema, SyncHookJSONOutputSchema, ElicitationHookSpecificOutputSchema, ElicitationResultHookSpecificOutputSchema, WorktreeCreateHookSpecificOutputSchema, HookJSONOutputSchema, PromptRequestOptionSchema, PromptRequestSchema, PromptResponseSchema, SlashCommandSchema, AgentInfoSchema, ModelInfoSchema, AccountInfoSchema, AgentMcpServerSpecSchema, AgentDefinitionSchema, SettingSourceSchema, SdkPluginConfigSchema, RewindFilesResultSchema, APIUserMessagePlaceholder, APIAssistantMessagePlaceholder, RawMessageStreamEventPlaceholder, NonNullableUsagePlaceholder, UUIDPlaceholder, SDKAssistantMessageErrorSchema, SDKStatusSchema, SDKUserMessageContentSchema, SDKUserMessageSchema, SDKUserMessageReplaySchema, SDKRateLimitInfoSchema, SDKAssistantMessageSchema, SDKRateLimitEventSchema, SDKStreamlinedTextMessageSchema, SDKStreamlinedToolUseSummaryMessageSchema, SDKPermissionDenialSchema, SDKResultSuccessSchema, SDKResultErrorSchema, SDKResultMessageSchema, SDKSystemMessageSchema, SDKPartialAssistantMessageSchema, SDKCompactBoundaryMessageSchema, SDKInformationalMessageSchema, SDKStatusMessageSchema, SDKPostTurnSummaryMessageSchema, SDKAPIRetryMessageSchema, SDKLocalCommandOutputMessageSchema, SDKHookStartedMessageSchema, SDKHookProgressMessageSchema, SDKHookResponseMessageSchema, SDKToolProgressMessageSchema, SDKToolOutputMessageSchema, SDKAuthStatusMessageSchema, SDKFilesPersistedEventSchema, FileChangeReviewFileSchema, FileChangeReviewSummarySchema, SDKFileChangeReviewMessageSchema, SDKTaskNotificationMessageSchema, SDKTaskStartedMessageSchema, SDKSessionStateChangedMessageSchema, SDKTaskProgressMessageSchema, SDKToolUseSummaryMessageSchema, SDKElicitationCompleteMessageSchema, SDKPromptSuggestionMessageSchema, SDKSessionInfoSchema, SDKMessageSchema, FastModeStateSchema;
|
|
61319
61335
|
var init_coreSchemas = __esm(() => {
|
|
61320
61336
|
init_v4();
|
|
61321
61337
|
ModelUsageSchema = lazySchema(() => exports_external.object({
|
|
@@ -62120,6 +62136,17 @@ var init_coreSchemas = __esm(() => {
|
|
|
62120
62136
|
uuid: UUIDPlaceholder(),
|
|
62121
62137
|
session_id: exports_external.string()
|
|
62122
62138
|
}));
|
|
62139
|
+
SDKInformationalMessageSchema = lazySchema(() => exports_external.object({
|
|
62140
|
+
type: exports_external.literal("system"),
|
|
62141
|
+
subtype: exports_external.literal("informational"),
|
|
62142
|
+
content: exports_external.string(),
|
|
62143
|
+
level: exports_external.enum(["info", "warning", "error"]),
|
|
62144
|
+
isMeta: exports_external.boolean(),
|
|
62145
|
+
timestamp: exports_external.string(),
|
|
62146
|
+
uuid: UUIDPlaceholder(),
|
|
62147
|
+
toolUseID: exports_external.string().optional(),
|
|
62148
|
+
preventContinuation: exports_external.boolean().optional()
|
|
62149
|
+
}));
|
|
62123
62150
|
SDKStatusMessageSchema = lazySchema(() => exports_external.object({
|
|
62124
62151
|
type: exports_external.literal("system"),
|
|
62125
62152
|
subtype: exports_external.literal("status"),
|
|
@@ -62212,6 +62239,17 @@ var init_coreSchemas = __esm(() => {
|
|
|
62212
62239
|
uuid: UUIDPlaceholder(),
|
|
62213
62240
|
session_id: exports_external.string()
|
|
62214
62241
|
}));
|
|
62242
|
+
SDKToolOutputMessageSchema = lazySchema(() => exports_external.object({
|
|
62243
|
+
type: exports_external.literal("tool_output"),
|
|
62244
|
+
tool_use_id: exports_external.string(),
|
|
62245
|
+
tool_name: exports_external.string(),
|
|
62246
|
+
parent_tool_use_id: exports_external.string().nullable(),
|
|
62247
|
+
text: exports_external.string(),
|
|
62248
|
+
elapsed_time_seconds: exports_external.number(),
|
|
62249
|
+
total_bytes: exports_external.number().optional(),
|
|
62250
|
+
uuid: UUIDPlaceholder(),
|
|
62251
|
+
session_id: exports_external.string()
|
|
62252
|
+
}).describe("A running tool's output so far. `text` is a CUMULATIVE SNAPSHOT of the bounded " + "tail the tool already computes for its own display — not an incremental chunk — " + "so a consumer REPLACES what it holds rather than appending. That makes a dropped " + "or duplicated frame harmless, which an append-based delta could not be, and keeps " + "the per-frame size bounded by construction rather than by the consumer remembering " + "to cap it. Emitted for tools that stream (Bash, PowerShell); throttled, and " + "additive, so a consumer that ignores it behaves exactly as before."));
|
|
62215
62253
|
SDKAuthStatusMessageSchema = lazySchema(() => exports_external.object({
|
|
62216
62254
|
type: exports_external.literal("auth_status"),
|
|
62217
62255
|
isAuthenticating: exports_external.boolean(),
|
|
@@ -62292,6 +62330,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
62292
62330
|
task_type: exports_external.string().optional(),
|
|
62293
62331
|
workflow_name: exports_external.string().optional().describe("meta.name from the workflow script (e.g. 'spec'). Only set when task_type is 'local_workflow'."),
|
|
62294
62332
|
prompt: exports_external.string().optional(),
|
|
62333
|
+
execution_mode: exports_external.enum(["foreground", "background"]).optional().describe("Whether the task runs inside the turn or detached from it. Absent when the task type has no such distinction."),
|
|
62295
62334
|
uuid: UUIDPlaceholder(),
|
|
62296
62335
|
session_id: exports_external.string()
|
|
62297
62336
|
}));
|
|
@@ -62307,7 +62346,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
62307
62346
|
subtype: exports_external.literal("task_progress"),
|
|
62308
62347
|
task_id: exports_external.string(),
|
|
62309
62348
|
tool_use_id: exports_external.string().optional(),
|
|
62310
|
-
description: exports_external.string(),
|
|
62349
|
+
description: exports_external.string().describe("The task's CURRENT ACTIVITY, not its name — emitters send the resolved activity description (e.g. 'Reading src/index.ts') and fall back to the task description only when no activity is known. The name is in the task_started frame."),
|
|
62311
62350
|
usage: exports_external.object({
|
|
62312
62351
|
total_tokens: exports_external.number(),
|
|
62313
62352
|
tool_uses: exports_external.number(),
|
|
@@ -62360,6 +62399,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
62360
62399
|
SDKFileChangeReviewMessageSchema(),
|
|
62361
62400
|
SDKPartialAssistantMessageSchema(),
|
|
62362
62401
|
SDKCompactBoundaryMessageSchema(),
|
|
62402
|
+
SDKInformationalMessageSchema(),
|
|
62363
62403
|
SDKStatusMessageSchema(),
|
|
62364
62404
|
SDKAPIRetryMessageSchema(),
|
|
62365
62405
|
SDKLocalCommandOutputMessageSchema(),
|
|
@@ -62367,6 +62407,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
62367
62407
|
SDKHookProgressMessageSchema(),
|
|
62368
62408
|
SDKHookResponseMessageSchema(),
|
|
62369
62409
|
SDKToolProgressMessageSchema(),
|
|
62410
|
+
SDKToolOutputMessageSchema(),
|
|
62370
62411
|
SDKAuthStatusMessageSchema(),
|
|
62371
62412
|
SDKTaskNotificationMessageSchema(),
|
|
62372
62413
|
SDKTaskStartedMessageSchema(),
|
|
@@ -62382,7 +62423,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
62382
62423
|
});
|
|
62383
62424
|
|
|
62384
62425
|
// src/protocol/controlSchemas.ts
|
|
62385
|
-
var JSONRPCMessagePlaceholder, SDKHookCallbackMatcherSchema, SDKControlInitializeRequestSchema, SDKControlInitializeResponseSchema, SDKControlInterruptRequestSchema, SDKControlPermissionRequestSchema, SDKControlSetPermissionModeRequestSchema, SDKControlSetModelRequestSchema, SDKControlSetMaxThinkingTokensRequestSchema, SDKControlMcpStatusRequestSchema, SDKControlMcpStatusResponseSchema, SDKControlGetContextUsageRequestSchema, ContextCategorySchema, ContextGridSquareSchema, SDKControlGetContextUsageResponseSchema, SDKControlRewindFilesRequestSchema, SDKControlRewindFilesResponseSchema, SDKControlCancelAsyncMessageRequestSchema, SDKControlCancelAsyncMessageResponseSchema, SDKControlSeedReadStateRequestSchema, SDKHookCallbackRequestSchema, SDKControlMcpMessageRequestSchema, SDKControlMcpSetServersRequestSchema, SDKControlMcpSetServersResponseSchema, SDKControlReloadPluginsRequestSchema, SDKControlReloadPluginsResponseSchema, SDKControlMcpReconnectRequestSchema, SDKControlMcpToggleRequestSchema, SDKControlStopTaskRequestSchema, SDKControlApplyFlagSettingsRequestSchema, SDKControlSetEffortRequestSchema, SDKControlGetSettingsRequestSchema, SDKControlGetSettingsResponseSchema, SDKControlElicitationRequestSchema, SDKControlElicitationResponseSchema, SDKControlRequestInnerSchema, SDKControlRequestSchema, ControlResponseSchema, ControlErrorResponseSchema, SDKControlResponseSchema, SDKControlCancelRequestSchema, SDKKeepAliveMessageSchema, SDKUpdateEnvironmentVariablesMessageSchema, StdoutMessageSchema, StdinMessageSchema;
|
|
62426
|
+
var JSONRPCMessagePlaceholder, SDKHookCallbackMatcherSchema, SDKControlInitializeRequestSchema, SDKControlInitializeResponseSchema, SDKControlInterruptRequestSchema, SDKControlPermissionRequestSchema, SDKControlSetPermissionModeRequestSchema, SDKControlSetModelRequestSchema, SDKControlSetMaxThinkingTokensRequestSchema, SDKControlMcpStatusRequestSchema, SDKControlMcpStatusResponseSchema, SDKControlGetContextUsageRequestSchema, ContextCategorySchema, ContextGridSquareSchema, SDKControlGetContextUsageResponseSchema, SDKControlRewindFilesRequestSchema, SDKControlRewindFilesResponseSchema, SDKControlCancelAsyncMessageRequestSchema, SDKControlCancelAsyncMessageResponseSchema, SDKControlSeedReadStateRequestSchema, SDKHookCallbackRequestSchema, SDKControlMcpMessageRequestSchema, SDKControlMcpSetServersRequestSchema, SDKControlMcpSetServersResponseSchema, SDKControlReloadPluginsRequestSchema, SDKControlReloadPluginsResponseSchema, SDKControlMcpReconnectRequestSchema, SDKControlMcpToggleRequestSchema, SDKControlStopTaskRequestSchema, SDKControlTaskOutputRequestSchema, SDKControlTaskOutputResponseSchema, SDKControlApplyFlagSettingsRequestSchema, SDKControlSetEffortRequestSchema, SDKControlGetSettingsRequestSchema, SDKControlGetSettingsResponseSchema, SDKControlElicitationRequestSchema, SDKControlElicitationResponseSchema, SDKControlRequestInnerSchema, SDKControlRequestSchema, ControlResponseSchema, ControlErrorResponseSchema, SDKControlResponseSchema, SDKControlCancelRequestSchema, SDKKeepAliveMessageSchema, SDKUpdateEnvironmentVariablesMessageSchema, StdoutMessageSchema, StdinMessageSchema;
|
|
62386
62427
|
var init_controlSchemas = __esm(() => {
|
|
62387
62428
|
init_v4();
|
|
62388
62429
|
init_coreSchemas();
|
|
@@ -62604,6 +62645,17 @@ var init_controlSchemas = __esm(() => {
|
|
|
62604
62645
|
subtype: exports_external.literal("stop_task"),
|
|
62605
62646
|
task_id: exports_external.string()
|
|
62606
62647
|
}).describe("Stops a running task."));
|
|
62648
|
+
SDKControlTaskOutputRequestSchema = lazySchema(() => exports_external.object({
|
|
62649
|
+
subtype: exports_external.literal("task_output"),
|
|
62650
|
+
task_id: exports_external.string(),
|
|
62651
|
+
max_bytes: exports_external.number().optional().describe("Cap on the tail returned. Defaults to the reader's own cap.")
|
|
62652
|
+
}).describe("Returns the tail of a task's recorded output. Works for any task type: shells and workflows record their stdout, while an agent's output path is a symlink to its transcript, so the response says which of the two it is."));
|
|
62653
|
+
SDKControlTaskOutputResponseSchema = lazySchema(() => exports_external.object({
|
|
62654
|
+
content: exports_external.string().describe("Empty when the task recorded nothing, which is not an error."),
|
|
62655
|
+
format: exports_external.enum(["text", "transcript"]).describe("'transcript' means the content is JSONL conversation records (an agent), not console output."),
|
|
62656
|
+
truncated: exports_external.boolean().describe("True when earlier output was omitted to stay under the cap."),
|
|
62657
|
+
size: exports_external.number().describe("Total bytes on disk, so a client can tell how much it is missing.")
|
|
62658
|
+
}));
|
|
62607
62659
|
SDKControlApplyFlagSettingsRequestSchema = lazySchema(() => exports_external.object({
|
|
62608
62660
|
subtype: exports_external.literal("apply_flag_settings"),
|
|
62609
62661
|
settings: exports_external.record(exports_external.string(), exports_external.unknown())
|
|
@@ -62672,6 +62724,7 @@ var init_controlSchemas = __esm(() => {
|
|
|
62672
62724
|
SDKControlMcpReconnectRequestSchema(),
|
|
62673
62725
|
SDKControlMcpToggleRequestSchema(),
|
|
62674
62726
|
SDKControlStopTaskRequestSchema(),
|
|
62727
|
+
SDKControlTaskOutputRequestSchema(),
|
|
62675
62728
|
SDKControlApplyFlagSettingsRequestSchema(),
|
|
62676
62729
|
SDKControlGetSettingsRequestSchema(),
|
|
62677
62730
|
SDKControlSetEffortRequestSchema(),
|
|
@@ -80726,6 +80779,9 @@ function updateSettingsForSource(source, settings) {
|
|
|
80726
80779
|
if (!filePath) {
|
|
80727
80780
|
return { error: null };
|
|
80728
80781
|
}
|
|
80782
|
+
if (source === "userSettings" && isUnsandboxedTestConfigAccess()) {
|
|
80783
|
+
return { error: null };
|
|
80784
|
+
}
|
|
80729
80785
|
try {
|
|
80730
80786
|
getFsImplementation().mkdirSync(dirname10(filePath));
|
|
80731
80787
|
let existingSettings = getSettingsForSourceUncached(source);
|
|
@@ -138243,7 +138299,7 @@ var init_isEqual = __esm(() => {
|
|
|
138243
138299
|
|
|
138244
138300
|
// src/utils/userAgent.ts
|
|
138245
138301
|
function getRayuUserAgent() {
|
|
138246
|
-
return `rayu/${"
|
|
138302
|
+
return `rayu/${"2.0.0"}`;
|
|
138247
138303
|
}
|
|
138248
138304
|
var getClaudeCodeUserAgent;
|
|
138249
138305
|
var init_userAgent = __esm(() => {
|
|
@@ -138269,7 +138325,7 @@ function getUserAgent() {
|
|
|
138269
138325
|
const clientApp = process.env.RAYU_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}` : "";
|
|
138270
138326
|
const workload = getWorkload();
|
|
138271
138327
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
138272
|
-
return `rayu/${"
|
|
138328
|
+
return `rayu/${"2.0.0"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
138273
138329
|
}
|
|
138274
138330
|
function getMCPUserAgent() {
|
|
138275
138331
|
const parts = [];
|
|
@@ -138283,7 +138339,7 @@ function getMCPUserAgent() {
|
|
|
138283
138339
|
parts.push(`client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}`);
|
|
138284
138340
|
}
|
|
138285
138341
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
138286
|
-
return `rayu/${"
|
|
138342
|
+
return `rayu/${"2.0.0"}${suffix}`;
|
|
138287
138343
|
}
|
|
138288
138344
|
function getWebFetchUserAgent() {
|
|
138289
138345
|
return `Rayu-User (${getRayuUserAgent()})`;
|
|
@@ -138581,6 +138637,7 @@ function syncRayuHostedProvider(ent, opts) {
|
|
|
138581
138637
|
smallFastModel: inCatalog(existing?.smallFastModel) ? existing?.smallFastModel : preferredCode,
|
|
138582
138638
|
modelContextWindows: hostedContextWindows(catalog),
|
|
138583
138639
|
modelLabels: hostedModelLabels(catalog),
|
|
138640
|
+
modelDescriptions: hostedModelDescriptions(catalog),
|
|
138584
138641
|
...hostedModelCapabilities(catalog)
|
|
138585
138642
|
};
|
|
138586
138643
|
if (idx >= 0)
|
|
@@ -138617,7 +138674,7 @@ function hostedModelSignature() {
|
|
|
138617
138674
|
const p = loadRayuConfig().providers.find((x2) => x2.id === RAYU_HOSTED_PROVIDER_ID);
|
|
138618
138675
|
if (!p)
|
|
138619
138676
|
return "";
|
|
138620
|
-
return catalogSignature(p.models ?? [], p.modelLabels, p.modelContextWindows) + JSON.stringify([p.modelSupportsThinking, p.modelSupportsImage, p.modelSupportsTools]);
|
|
138677
|
+
return catalogSignature(p.models ?? [], p.modelLabels, p.modelContextWindows, p.modelDescriptions) + JSON.stringify([p.modelSupportsThinking, p.modelSupportsImage, p.modelSupportsTools]);
|
|
138621
138678
|
} catch {
|
|
138622
138679
|
return "";
|
|
138623
138680
|
}
|
|
@@ -139632,14 +139689,14 @@ function rememberModelRejectedImages(providerId, model) {
|
|
|
139632
139689
|
return;
|
|
139633
139690
|
sessionTextOnly.add(stripRoutingPrefix(model));
|
|
139634
139691
|
}
|
|
139635
|
-
function notePendingImageDropNotice(model) {
|
|
139692
|
+
function notePendingImageDropNotice(model, discoveredFromProvider = false) {
|
|
139636
139693
|
if (model)
|
|
139637
|
-
pendingImageDropNotices.
|
|
139694
|
+
pendingImageDropNotices.set(stripRoutingPrefix(model), discoveredFromProvider);
|
|
139638
139695
|
}
|
|
139639
139696
|
function drainImageDropNotices() {
|
|
139640
139697
|
if (pendingImageDropNotices.size === 0)
|
|
139641
139698
|
return [];
|
|
139642
|
-
const out = [...pendingImageDropNotices].map((model) => imageDroppedWarning(model, { discoveredFromProvider
|
|
139699
|
+
const out = [...pendingImageDropNotices].map(([model, discoveredFromProvider]) => imageDroppedWarning(model, { discoveredFromProvider }));
|
|
139643
139700
|
pendingImageDropNotices.clear();
|
|
139644
139701
|
return out;
|
|
139645
139702
|
}
|
|
@@ -139741,7 +139798,7 @@ var init_imageCapability = __esm(() => {
|
|
|
139741
139798
|
[/embed|rerank|moderation|whisper|tts/i]
|
|
139742
139799
|
].map(([re]) => re);
|
|
139743
139800
|
sessionTextOnly = new Set;
|
|
139744
|
-
pendingImageDropNotices = new
|
|
139801
|
+
pendingImageDropNotices = new Map;
|
|
139745
139802
|
});
|
|
139746
139803
|
|
|
139747
139804
|
// src/utils/model/providerCapabilities.ts
|
|
@@ -149229,7 +149286,7 @@ var init_metadata = __esm(() => {
|
|
|
149229
149286
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
149230
149287
|
WHITESPACE_REGEX = /\s+/;
|
|
149231
149288
|
getVersionBase = memoize_default(() => {
|
|
149232
|
-
const match = "
|
|
149289
|
+
const match = "2.0.0".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
149233
149290
|
return match ? match[0] : undefined;
|
|
149234
149291
|
});
|
|
149235
149292
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -149268,7 +149325,7 @@ var init_metadata = __esm(() => {
|
|
|
149268
149325
|
},
|
|
149269
149326
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
149270
149327
|
isRayuAction: isEnvTruthy(process.env.RAYU_ACTION),
|
|
149271
|
-
version: "
|
|
149328
|
+
version: "2.0.0",
|
|
149272
149329
|
versionBase: getVersionBase(),
|
|
149273
149330
|
buildTime: "",
|
|
149274
149331
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
@@ -156662,7 +156719,7 @@ function getAttributionHeader(fingerprint2) {
|
|
|
156662
156719
|
if (!isAttributionHeaderEnabled()) {
|
|
156663
156720
|
return "";
|
|
156664
156721
|
}
|
|
156665
|
-
const version2 = `${"
|
|
156722
|
+
const version2 = `${"2.0.0"}.${fingerprint2}`;
|
|
156666
156723
|
const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
|
|
156667
156724
|
const cch = "";
|
|
156668
156725
|
const workload = getWorkload();
|
|
@@ -318080,7 +318137,7 @@ function getTelemetryAttributes() {
|
|
|
318080
318137
|
attributes["session.id"] = sessionId;
|
|
318081
318138
|
}
|
|
318082
318139
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
318083
|
-
attributes["app.version"] = "
|
|
318140
|
+
attributes["app.version"] = "2.0.0";
|
|
318084
318141
|
}
|
|
318085
318142
|
const oauthAccount = getOauthAccountInfo();
|
|
318086
318143
|
if (oauthAccount) {
|
|
@@ -361603,9 +361660,42 @@ var init_IdeOnboardingDialog = __esm(() => {
|
|
|
361603
361660
|
});
|
|
361604
361661
|
|
|
361605
361662
|
// src/utils/ide.ts
|
|
361663
|
+
var exports_ide = {};
|
|
361664
|
+
__export(exports_ide, {
|
|
361665
|
+
toIDEDisplayName: () => toIDEDisplayName,
|
|
361666
|
+
resetDetectRunningIDEs: () => resetDetectRunningIDEs,
|
|
361667
|
+
maybeNotifyIDEConnected: () => maybeNotifyIDEConnected,
|
|
361668
|
+
maybeInstallIDEExtension: () => maybeInstallIDEExtension,
|
|
361669
|
+
isWindsurfInstalled: () => isWindsurfInstalled,
|
|
361670
|
+
isVSCodeInstalled: () => isVSCodeInstalled,
|
|
361671
|
+
isVSCodeIde: () => isVSCodeIde,
|
|
361672
|
+
isSupportedVSCodeTerminal: () => isSupportedVSCodeTerminal,
|
|
361673
|
+
isSupportedTerminal: () => isSupportedTerminal,
|
|
361674
|
+
isSupportedJetBrainsTerminal: () => isSupportedJetBrainsTerminal,
|
|
361675
|
+
isRayuNativeLockfile: () => isRayuNativeLockfile,
|
|
361676
|
+
isJetBrainsIde: () => isJetBrainsIde,
|
|
361677
|
+
isIDEExtensionInstalled: () => isIDEExtensionInstalled,
|
|
361678
|
+
isCursorInstalled: () => isCursorInstalled,
|
|
361679
|
+
initializeIdeIntegration: () => initializeIdeIntegration,
|
|
361680
|
+
ideMcpServerConfig: () => ideMcpServerConfig,
|
|
361681
|
+
hasAccessToIDEExtensionDiffFeature: () => hasAccessToIDEExtensionDiffFeature,
|
|
361682
|
+
getTerminalIdeType: () => getTerminalIdeType,
|
|
361683
|
+
getSortedIdeLockfiles: () => getSortedIdeLockfiles,
|
|
361684
|
+
getIdeLockfilesPaths: () => getIdeLockfilesPaths,
|
|
361685
|
+
getIdeClientName: () => getIdeClientName,
|
|
361686
|
+
getConnectedIdeName: () => getConnectedIdeName,
|
|
361687
|
+
getConnectedIdeClient: () => getConnectedIdeClient,
|
|
361688
|
+
findAvailableIDE: () => findAvailableIDE,
|
|
361689
|
+
detectRunningIDEsCached: () => detectRunningIDEsCached,
|
|
361690
|
+
detectRunningIDEs: () => detectRunningIDEs,
|
|
361691
|
+
detectIDEs: () => detectIDEs,
|
|
361692
|
+
closeOpenDiffs: () => closeOpenDiffs,
|
|
361693
|
+
cleanupStaleIdeLockfiles: () => cleanupStaleIdeLockfiles,
|
|
361694
|
+
callIdeRpc: () => callIdeRpc
|
|
361695
|
+
});
|
|
361606
361696
|
import { createConnection } from "net";
|
|
361607
361697
|
import * as os6 from "os";
|
|
361608
|
-
import { basename as basename13, join as join63, sep as pathSeparator, resolve as resolve23 } from "path";
|
|
361698
|
+
import { basename as basename13, dirname as dirname26, join as join63, sep as pathSeparator, resolve as resolve23 } from "path";
|
|
361609
361699
|
function isProcessRunning2(pid) {
|
|
361610
361700
|
try {
|
|
361611
361701
|
process.kill(pid, 0);
|
|
@@ -361641,6 +361731,9 @@ function getTerminalIdeType() {
|
|
|
361641
361731
|
}
|
|
361642
361732
|
return env4.terminal;
|
|
361643
361733
|
}
|
|
361734
|
+
function isRayuNativeLockfile(lockfilePath) {
|
|
361735
|
+
return dirname26(lockfilePath) === join63(getRayuConfigHomeDir(), "ide");
|
|
361736
|
+
}
|
|
361644
361737
|
async function getSortedIdeLockfiles() {
|
|
361645
361738
|
try {
|
|
361646
361739
|
const ideLockFilePaths = await getIdeLockfilesPaths();
|
|
@@ -361665,7 +361758,11 @@ async function getSortedIdeLockfiles() {
|
|
|
361665
361758
|
return [];
|
|
361666
361759
|
}
|
|
361667
361760
|
}));
|
|
361668
|
-
return allLockfiles.flat().sort((a2, b3) =>
|
|
361761
|
+
return allLockfiles.flat().sort((a2, b3) => {
|
|
361762
|
+
const aNative = isRayuNativeLockfile(a2.path) ? 0 : 1;
|
|
361763
|
+
const bNative = isRayuNativeLockfile(b3.path) ? 0 : 1;
|
|
361764
|
+
return aNative - bNative || b3.mtime.getTime() - a2.mtime.getTime();
|
|
361765
|
+
}).map((file2) => file2.path);
|
|
361669
361766
|
} catch (error52) {
|
|
361670
361767
|
logError2(error52);
|
|
361671
361768
|
return [];
|
|
@@ -361707,7 +361804,8 @@ async function readIdeLockfile(path14) {
|
|
|
361707
361804
|
ideName,
|
|
361708
361805
|
useWebSocket,
|
|
361709
361806
|
runningInWindows,
|
|
361710
|
-
authToken
|
|
361807
|
+
authToken,
|
|
361808
|
+
isRayuNative: isRayuNativeLockfile(path14)
|
|
361711
361809
|
};
|
|
361712
361810
|
} catch (error52) {
|
|
361713
361811
|
logError2(error52);
|
|
@@ -361865,6 +361963,10 @@ async function findAvailableIDE() {
|
|
|
361865
361963
|
if (ides.length === 1) {
|
|
361866
361964
|
return ides[0];
|
|
361867
361965
|
}
|
|
361966
|
+
const natives = ides.filter((ide) => ide.isRayuNative);
|
|
361967
|
+
if (natives.length === 1) {
|
|
361968
|
+
return natives[0];
|
|
361969
|
+
}
|
|
361868
361970
|
await sleep3(1000, signal);
|
|
361869
361971
|
}
|
|
361870
361972
|
return null;
|
|
@@ -361944,7 +362046,8 @@ async function detectIDEs(includeInvalid) {
|
|
|
361944
362046
|
port: lockfileInfo.port,
|
|
361945
362047
|
isValid: isValid3,
|
|
361946
362048
|
authToken: lockfileInfo.authToken,
|
|
361947
|
-
ideRunningInWindows: lockfileInfo.runningInWindows
|
|
362049
|
+
ideRunningInWindows: lockfileInfo.runningInWindows,
|
|
362050
|
+
isRayuNative: lockfileInfo.isRayuNative
|
|
361948
362051
|
});
|
|
361949
362052
|
}
|
|
361950
362053
|
if (!includeInvalid && envPort) {
|
|
@@ -362018,7 +362121,7 @@ function getInstallationEnv() {
|
|
|
362018
362121
|
return;
|
|
362019
362122
|
}
|
|
362020
362123
|
function getClaudeCodeVersion() {
|
|
362021
|
-
return "
|
|
362124
|
+
return "2.0.0";
|
|
362022
362125
|
}
|
|
362023
362126
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
362024
362127
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -362167,6 +362270,9 @@ async function detectRunningIDEsCached() {
|
|
|
362167
362270
|
}
|
|
362168
362271
|
return cachedRunningIDEs;
|
|
362169
362272
|
}
|
|
362273
|
+
function resetDetectRunningIDEs() {
|
|
362274
|
+
cachedRunningIDEs = null;
|
|
362275
|
+
}
|
|
362170
362276
|
function getConnectedIdeName(mcpClients) {
|
|
362171
362277
|
const ideClient = mcpClients.find((client) => client.type === "connected" && client.name === "ide");
|
|
362172
362278
|
return getIdeClientName(ideClient);
|
|
@@ -362197,6 +362303,16 @@ function toIDEDisplayName(terminal) {
|
|
|
362197
362303
|
}
|
|
362198
362304
|
return capitalize_default(terminal);
|
|
362199
362305
|
}
|
|
362306
|
+
function ideMcpServerConfig(ide) {
|
|
362307
|
+
return {
|
|
362308
|
+
type: ide.url.startsWith("ws:") ? "ws-ide" : "sse-ide",
|
|
362309
|
+
url: ide.url,
|
|
362310
|
+
ideName: ide.name,
|
|
362311
|
+
authToken: ide.authToken,
|
|
362312
|
+
ideRunningInWindows: ide.ideRunningInWindows,
|
|
362313
|
+
scope: "dynamic"
|
|
362314
|
+
};
|
|
362315
|
+
}
|
|
362200
362316
|
function getConnectedIdeClient(mcpClients) {
|
|
362201
362317
|
if (!mcpClients) {
|
|
362202
362318
|
return;
|
|
@@ -364331,7 +364447,8 @@ function registerTask(task, setAppState) {
|
|
|
364331
364447
|
description: task.description,
|
|
364332
364448
|
task_type: task.type,
|
|
364333
364449
|
workflow_name: "workflowName" in task ? task.workflowName : undefined,
|
|
364334
|
-
prompt: "prompt" in task ? task.prompt : undefined
|
|
364450
|
+
prompt: "prompt" in task ? task.prompt : undefined,
|
|
364451
|
+
execution_mode: "isBackgrounded" in task ? task.isBackgrounded === true ? "background" : "foreground" : undefined
|
|
364335
364452
|
});
|
|
364336
364453
|
}
|
|
364337
364454
|
function evictTerminalTask(taskId, setAppState) {
|
|
@@ -364980,7 +365097,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
364980
365097
|
}
|
|
364981
365098
|
function computeFingerprintFromMessages(messages) {
|
|
364982
365099
|
const firstMessageText = extractFirstMessageText(messages);
|
|
364983
|
-
return computeFingerprint(firstMessageText, "
|
|
365100
|
+
return computeFingerprint(firstMessageText, "2.0.0");
|
|
364984
365101
|
}
|
|
364985
365102
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
364986
365103
|
var init_fingerprint = () => {};
|
|
@@ -365022,7 +365139,7 @@ async function sideQuery(opts) {
|
|
|
365022
365139
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
365023
365140
|
}
|
|
365024
365141
|
const messageText = extractFirstUserMessageText(messages);
|
|
365025
|
-
const fingerprint2 = computeFingerprint(messageText, "
|
|
365142
|
+
const fingerprint2 = computeFingerprint(messageText, "2.0.0");
|
|
365026
365143
|
const attributionHeader = getAttributionHeader(fingerprint2);
|
|
365027
365144
|
const systemBlocks = [
|
|
365028
365145
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -369481,7 +369598,7 @@ var init_compact = __esm(() => {
|
|
|
369481
369598
|
// src/services/api/dumpPrompts.ts
|
|
369482
369599
|
import { createHash as createHash9 } from "crypto";
|
|
369483
369600
|
import { promises as fs9 } from "fs";
|
|
369484
|
-
import { dirname as
|
|
369601
|
+
import { dirname as dirname27, join as join66 } from "path";
|
|
369485
369602
|
function hashString3(str3) {
|
|
369486
369603
|
return createHash9("sha256").update(str3).digest("hex");
|
|
369487
369604
|
}
|
|
@@ -369508,7 +369625,7 @@ function getDumpPromptsPath(agentIdOrSessionId) {
|
|
|
369508
369625
|
function appendToFile(filePath, entries) {
|
|
369509
369626
|
if (entries.length === 0)
|
|
369510
369627
|
return;
|
|
369511
|
-
fs9.mkdir(
|
|
369628
|
+
fs9.mkdir(dirname27(filePath), { recursive: true }).then(() => fs9.appendFile(filePath, entries.join(`
|
|
369512
369629
|
`) + `
|
|
369513
369630
|
`)).catch(() => {});
|
|
369514
369631
|
}
|
|
@@ -386856,7 +386973,7 @@ var init_teamHelpers = __esm(() => {
|
|
|
386856
386973
|
|
|
386857
386974
|
// src/utils/attachments.ts
|
|
386858
386975
|
import { readdir as readdir12, stat as stat18 } from "fs/promises";
|
|
386859
|
-
import { dirname as
|
|
386976
|
+
import { dirname as dirname28, parse as parse9, relative as relative10, resolve as resolve25 } from "path";
|
|
386860
386977
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
386861
386978
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
|
|
386862
386979
|
if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
|
|
@@ -387243,21 +387360,21 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
|
|
|
387243
387360
|
];
|
|
387244
387361
|
}
|
|
387245
387362
|
function getDirectoriesToProcess(targetPath, originalCwd) {
|
|
387246
|
-
const targetDir =
|
|
387363
|
+
const targetDir = dirname28(resolve25(targetPath));
|
|
387247
387364
|
const nestedDirs = [];
|
|
387248
387365
|
let currentDir = targetDir;
|
|
387249
387366
|
while (currentDir !== originalCwd && currentDir !== parse9(currentDir).root) {
|
|
387250
387367
|
if (currentDir.startsWith(originalCwd)) {
|
|
387251
387368
|
nestedDirs.push(currentDir);
|
|
387252
387369
|
}
|
|
387253
|
-
currentDir =
|
|
387370
|
+
currentDir = dirname28(currentDir);
|
|
387254
387371
|
}
|
|
387255
387372
|
nestedDirs.reverse();
|
|
387256
387373
|
const cwdLevelDirs = [];
|
|
387257
387374
|
currentDir = originalCwd;
|
|
387258
387375
|
while (currentDir !== parse9(currentDir).root) {
|
|
387259
387376
|
cwdLevelDirs.push(currentDir);
|
|
387260
|
-
currentDir =
|
|
387377
|
+
currentDir = dirname28(currentDir);
|
|
387261
387378
|
}
|
|
387262
387379
|
cwdLevelDirs.reverse();
|
|
387263
387380
|
return { nestedDirs, cwdLevelDirs };
|
|
@@ -388512,21 +388629,21 @@ var init_attachments = __esm(() => {
|
|
|
388512
388629
|
});
|
|
388513
388630
|
|
|
388514
388631
|
// src/utils/plugins/loadPluginCommands.ts
|
|
388515
|
-
import { basename as basename19, dirname as
|
|
388632
|
+
import { basename as basename19, dirname as dirname29, join as join69 } from "path";
|
|
388516
388633
|
function isSkillFile(filePath) {
|
|
388517
388634
|
return /^skill\.md$/i.test(basename19(filePath));
|
|
388518
388635
|
}
|
|
388519
388636
|
function getCommandNameFromFile(filePath, baseDir, pluginName) {
|
|
388520
388637
|
const isSkill = isSkillFile(filePath);
|
|
388521
388638
|
if (isSkill) {
|
|
388522
|
-
const skillDirectory =
|
|
388523
|
-
const parentOfSkillDir =
|
|
388639
|
+
const skillDirectory = dirname29(filePath);
|
|
388640
|
+
const parentOfSkillDir = dirname29(skillDirectory);
|
|
388524
388641
|
const commandBaseName = basename19(skillDirectory);
|
|
388525
388642
|
const relativePath = parentOfSkillDir.startsWith(baseDir) ? parentOfSkillDir.slice(baseDir.length).replace(/^\//, "") : "";
|
|
388526
388643
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
388527
388644
|
return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
|
|
388528
388645
|
} else {
|
|
388529
|
-
const fileDirectory =
|
|
388646
|
+
const fileDirectory = dirname29(filePath);
|
|
388530
388647
|
const commandBaseName = basename19(filePath).replace(/\.md$/, "");
|
|
388531
388648
|
const relativePath = fileDirectory.startsWith(baseDir) ? fileDirectory.slice(baseDir.length).replace(/^\//, "") : "";
|
|
388532
388649
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
@@ -388553,7 +388670,7 @@ async function collectMarkdownFiles(dirPath, baseDir, loadedPaths) {
|
|
|
388553
388670
|
function transformPluginSkillFiles(files2) {
|
|
388554
388671
|
const filesByDir = new Map;
|
|
388555
388672
|
for (const file2 of files2) {
|
|
388556
|
-
const dir =
|
|
388673
|
+
const dir = dirname29(file2.filePath);
|
|
388557
388674
|
const dirFiles = filesByDir.get(dir) ?? [];
|
|
388558
388675
|
dirFiles.push(file2);
|
|
388559
388676
|
filesByDir.set(dir, dirFiles);
|
|
@@ -388642,7 +388759,7 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
388642
388759
|
return displayName || commandName;
|
|
388643
388760
|
},
|
|
388644
388761
|
async getPromptForCommand(args, context) {
|
|
388645
|
-
let finalContent = config4.isSkillMode ? `Base directory for this skill: ${
|
|
388762
|
+
let finalContent = config4.isSkillMode ? `Base directory for this skill: ${dirname29(file2.filePath)}
|
|
388646
388763
|
|
|
388647
388764
|
${content}` : content;
|
|
388648
388765
|
finalContent = substituteArguments(finalContent, args, true, argumentNames);
|
|
@@ -388654,7 +388771,7 @@ ${content}` : content;
|
|
|
388654
388771
|
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
388655
388772
|
}
|
|
388656
388773
|
if (config4.isSkillMode) {
|
|
388657
|
-
const rawSkillDir =
|
|
388774
|
+
const rawSkillDir = dirname29(file2.filePath);
|
|
388658
388775
|
const skillDir = process.platform === "win32" ? rawSkillDir.replace(/\\/g, "/") : rawSkillDir;
|
|
388659
388776
|
finalContent = finalContent.replace(/\$\{CLAUDE_SKILL_DIR\}/g, skillDir);
|
|
388660
388777
|
}
|
|
@@ -388714,7 +388831,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
388714
388831
|
const skillName = `${pluginName}:${basename19(skillsPath)}`;
|
|
388715
388832
|
const file2 = {
|
|
388716
388833
|
filePath: directSkillPath,
|
|
388717
|
-
baseDir:
|
|
388834
|
+
baseDir: dirname29(directSkillPath),
|
|
388718
388835
|
frontmatter,
|
|
388719
388836
|
content: markdownContent
|
|
388720
388837
|
};
|
|
@@ -388763,7 +388880,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
388763
388880
|
const skillName = `${pluginName}:${entry.name}`;
|
|
388764
388881
|
const file2 = {
|
|
388765
388882
|
filePath: skillFilePath,
|
|
388766
|
-
baseDir:
|
|
388883
|
+
baseDir: dirname29(skillFilePath),
|
|
388767
388884
|
frontmatter,
|
|
388768
388885
|
content: markdownContent
|
|
388769
388886
|
};
|
|
@@ -388876,7 +388993,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
388876
388993
|
} : frontmatter;
|
|
388877
388994
|
const file2 = {
|
|
388878
388995
|
filePath: commandPath,
|
|
388879
|
-
baseDir:
|
|
388996
|
+
baseDir: dirname29(commandPath),
|
|
388880
388997
|
frontmatter: finalFrontmatter,
|
|
388881
388998
|
content: markdownContent
|
|
388882
388999
|
};
|
|
@@ -389100,7 +389217,7 @@ import {
|
|
|
389100
389217
|
writeFile as writeFile11
|
|
389101
389218
|
} from "fs/promises";
|
|
389102
389219
|
import { tmpdir as tmpdir9 } from "os";
|
|
389103
|
-
import { basename as basename21, dirname as
|
|
389220
|
+
import { basename as basename21, dirname as dirname30, join as join70 } from "path";
|
|
389104
389221
|
function isPluginZipCacheEnabled() {
|
|
389105
389222
|
return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE);
|
|
389106
389223
|
}
|
|
@@ -389163,7 +389280,7 @@ async function cleanupSessionPluginCache() {
|
|
|
389163
389280
|
}
|
|
389164
389281
|
}
|
|
389165
389282
|
async function atomicWriteToZipCache(targetPath, data) {
|
|
389166
|
-
const dir =
|
|
389283
|
+
const dir = dirname30(targetPath);
|
|
389167
389284
|
await getFsImplementation().mkdir(dir);
|
|
389168
389285
|
const tmpName = `.${basename21(targetPath)}.tmp.${randomBytes5(4).toString("hex")}`;
|
|
389169
389286
|
const tmpPath = join70(dir, tmpName);
|
|
@@ -389260,7 +389377,7 @@ async function extractZipToDirectory(zipPath, targetDir) {
|
|
|
389260
389377
|
continue;
|
|
389261
389378
|
}
|
|
389262
389379
|
const fullPath = join70(targetDir, relPath);
|
|
389263
|
-
await getFsImplementation().mkdir(
|
|
389380
|
+
await getFsImplementation().mkdir(dirname30(fullPath));
|
|
389264
389381
|
await writeFile11(fullPath, data);
|
|
389265
389382
|
const mode = modes[relPath];
|
|
389266
389383
|
if (mode && mode & 73) {
|
|
@@ -389752,7 +389869,7 @@ var init_marketplaceHelpers = __esm(() => {
|
|
|
389752
389869
|
|
|
389753
389870
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
389754
389871
|
import { chmod as chmod3, mkdir as mkdir12, readFile as readFile18, rename as rename2, rm as rm8, writeFile as writeFile13 } from "fs/promises";
|
|
389755
|
-
import { dirname as
|
|
389872
|
+
import { dirname as dirname31, join as join72, resolve as resolve26, sep as sep12 } from "path";
|
|
389756
389873
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
389757
389874
|
const cacheDir = resolve26(marketplacesCacheDir);
|
|
389758
389875
|
const resolvedLoc = resolve26(installLocation);
|
|
@@ -389799,7 +389916,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
389799
389916
|
if (!rel || rel.endsWith("/"))
|
|
389800
389917
|
continue;
|
|
389801
389918
|
const dest = join72(staging, rel);
|
|
389802
|
-
await mkdir12(
|
|
389919
|
+
await mkdir12(dirname31(dest), { recursive: true });
|
|
389803
389920
|
await writeFile13(dest, data);
|
|
389804
389921
|
const mode = modes[arcPath];
|
|
389805
389922
|
if (mode && mode & 73) {
|
|
@@ -389873,7 +389990,7 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
389873
389990
|
|
|
389874
389991
|
// src/utils/plugins/marketplaceManager.ts
|
|
389875
389992
|
import { writeFile as writeFile14 } from "fs/promises";
|
|
389876
|
-
import { basename as basename22, dirname as
|
|
389993
|
+
import { basename as basename22, dirname as dirname32, isAbsolute as isAbsolute14, join as join73, resolve as resolve27, sep as sep13 } from "path";
|
|
389877
389994
|
function getKnownMarketplacesFile() {
|
|
389878
389995
|
return join73(getPluginsDirectory(), "known_marketplaces.json");
|
|
389879
389996
|
}
|
|
@@ -390553,7 +390670,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
390553
390670
|
case "file": {
|
|
390554
390671
|
const absPath = resolve27(source.path);
|
|
390555
390672
|
marketplacePath = absPath;
|
|
390556
|
-
temporaryCachePath =
|
|
390673
|
+
temporaryCachePath = dirname32(dirname32(absPath));
|
|
390557
390674
|
cleanupNeeded = false;
|
|
390558
390675
|
break;
|
|
390559
390676
|
}
|
|
@@ -390568,7 +390685,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
390568
390685
|
temporaryCachePath = join73(cacheDir, source.name);
|
|
390569
390686
|
marketplacePath = join73(temporaryCachePath, ".claude-plugin", "marketplace.json");
|
|
390570
390687
|
cleanupNeeded = false;
|
|
390571
|
-
await fs10.mkdir(
|
|
390688
|
+
await fs10.mkdir(dirname32(marketplacePath));
|
|
390572
390689
|
await writeFile14(marketplacePath, jsonStringify({
|
|
390573
390690
|
name: source.name,
|
|
390574
390691
|
owner: source.owner ?? { name: "settings" },
|
|
@@ -391062,7 +391179,7 @@ var init_marketplaceManager = __esm(() => {
|
|
|
391062
391179
|
});
|
|
391063
391180
|
|
|
391064
391181
|
// src/utils/plugins/installedPluginsManager.ts
|
|
391065
|
-
import { dirname as
|
|
391182
|
+
import { dirname as dirname33, join as join74 } from "path";
|
|
391066
391183
|
function getInstalledPluginsFilePath() {
|
|
391067
391184
|
return join74(getPluginsDirectory(), "installed_plugins.json");
|
|
391068
391185
|
}
|
|
@@ -391637,7 +391754,7 @@ var init_pluginVersioning = __esm(() => {
|
|
|
391637
391754
|
// src/utils/plugins/pluginInstallationHelpers.ts
|
|
391638
391755
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
391639
391756
|
import { rename as rename3, rm as rm9 } from "fs/promises";
|
|
391640
|
-
import { dirname as
|
|
391757
|
+
import { dirname as dirname34, join as join75, resolve as resolve28, sep as sep14 } from "path";
|
|
391641
391758
|
function getCurrentTimestamp() {
|
|
391642
391759
|
return new Date().toISOString();
|
|
391643
391760
|
}
|
|
@@ -391661,14 +391778,14 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa
|
|
|
391661
391778
|
const versionedPath = getVersionedCachePath(pluginId, version2);
|
|
391662
391779
|
let finalPath = cacheResult.path;
|
|
391663
391780
|
if (cacheResult.path !== versionedPath) {
|
|
391664
|
-
await getFsImplementation().mkdir(
|
|
391781
|
+
await getFsImplementation().mkdir(dirname34(versionedPath));
|
|
391665
391782
|
await rm9(versionedPath, { recursive: true, force: true });
|
|
391666
391783
|
const normalizedCachePath = cacheResult.path.endsWith(sep14) ? cacheResult.path : cacheResult.path + sep14;
|
|
391667
391784
|
const isSubdirectory = versionedPath.startsWith(normalizedCachePath);
|
|
391668
391785
|
if (isSubdirectory) {
|
|
391669
|
-
const tempPath = join75(
|
|
391786
|
+
const tempPath = join75(dirname34(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes6(4).toString("hex")}`);
|
|
391670
391787
|
await rename3(cacheResult.path, tempPath);
|
|
391671
|
-
await getFsImplementation().mkdir(
|
|
391788
|
+
await getFsImplementation().mkdir(dirname34(versionedPath));
|
|
391672
391789
|
await rename3(tempPath, versionedPath);
|
|
391673
391790
|
} else {
|
|
391674
391791
|
await rename3(cacheResult.path, versionedPath);
|
|
@@ -391897,7 +392014,7 @@ import {
|
|
|
391897
392014
|
stat as stat21,
|
|
391898
392015
|
symlink as symlink2
|
|
391899
392016
|
} from "fs/promises";
|
|
391900
|
-
import { basename as basename23, dirname as
|
|
392017
|
+
import { basename as basename23, dirname as dirname35, join as join76, relative as relative11, resolve as resolve29, sep as sep15 } from "path";
|
|
391901
392018
|
function getPluginCachePath() {
|
|
391902
392019
|
return join76(getPluginsDirectory(), "cache");
|
|
391903
392020
|
}
|
|
@@ -391927,7 +392044,7 @@ async function probeSeedCache(pluginId, version2) {
|
|
|
391927
392044
|
}
|
|
391928
392045
|
async function probeSeedCacheAnyVersion(pluginId) {
|
|
391929
392046
|
for (const seedDir of getPluginSeedDirs()) {
|
|
391930
|
-
const pluginDir =
|
|
392047
|
+
const pluginDir = dirname35(getVersionedCachePathIn(seedDir, pluginId, "_"));
|
|
391931
392048
|
try {
|
|
391932
392049
|
const versions2 = await readdir15(pluginDir);
|
|
391933
392050
|
if (versions2.length !== 1)
|
|
@@ -391969,7 +392086,7 @@ async function copyDir(src, dest) {
|
|
|
391969
392086
|
if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) {
|
|
391970
392087
|
const targetRelativeToSrc = relative11(resolvedSrc, resolvedTarget);
|
|
391971
392088
|
const destTargetPath = join76(dest, targetRelativeToSrc);
|
|
391972
|
-
const relativeLinkPath = relative11(
|
|
392089
|
+
const relativeLinkPath = relative11(dirname35(destPath), destTargetPath);
|
|
391973
392090
|
await symlink2(relativeLinkPath, destPath);
|
|
391974
392091
|
} else {
|
|
391975
392092
|
await symlink2(resolvedTarget, destPath);
|
|
@@ -392000,7 +392117,7 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version2, entry,
|
|
|
392000
392117
|
logForDebugging(`Using seed cache for ${pluginId}@${version2} at ${seedPath}`);
|
|
392001
392118
|
return seedPath;
|
|
392002
392119
|
}
|
|
392003
|
-
await getFsImplementation().mkdir(
|
|
392120
|
+
await getFsImplementation().mkdir(dirname35(cachePath));
|
|
392004
392121
|
if (entry && typeof entry.source === "string" && marketplaceDir) {
|
|
392005
392122
|
const sourceDir = validatePathWithinBase(marketplaceDir, entry.source);
|
|
392006
392123
|
logForDebugging(`Copying source directory ${entry.source} for plugin ${pluginId}`);
|
|
@@ -393437,7 +393554,7 @@ var init_pluginLoader = __esm(() => {
|
|
|
393437
393554
|
// src/services/mcp/config.ts
|
|
393438
393555
|
import { chmod as chmod4, open as open6, rename as rename5, stat as stat22, unlink as unlink6 } from "fs/promises";
|
|
393439
393556
|
import { homedir as homedir20 } from "os";
|
|
393440
|
-
import { dirname as
|
|
393557
|
+
import { dirname as dirname36, join as join77, parse as parse10 } from "path";
|
|
393441
393558
|
function getEnterpriseMcpFilePath() {
|
|
393442
393559
|
return join77(getManagedFilePath(), "managed-mcp.json");
|
|
393443
393560
|
}
|
|
@@ -393910,7 +394027,7 @@ function getMcpConfigsByScope(scope) {
|
|
|
393910
394027
|
let currentDir = getCwd();
|
|
393911
394028
|
while (currentDir !== parse10(currentDir).root) {
|
|
393912
394029
|
dirs.push(currentDir);
|
|
393913
|
-
currentDir =
|
|
394030
|
+
currentDir = dirname36(currentDir);
|
|
393914
394031
|
}
|
|
393915
394032
|
for (const dir of dirs.reverse()) {
|
|
393916
394033
|
const mcpJsonPath = join77(dir, ".mcp.json");
|
|
@@ -401088,7 +401205,7 @@ var init_wrapper = __esm(() => {
|
|
|
401088
401205
|
|
|
401089
401206
|
// src/services/mcp/client.ts
|
|
401090
401207
|
import { mkdir as mkdir14, readFile as readFile20, unlink as unlink7, writeFile as writeFile16 } from "fs/promises";
|
|
401091
|
-
import { dirname as
|
|
401208
|
+
import { dirname as dirname37, join as join81 } from "path";
|
|
401092
401209
|
function isMcpSessionExpiredError(error52) {
|
|
401093
401210
|
const httpStatus = "code" in error52 ? error52.code : undefined;
|
|
401094
401211
|
if (httpStatus !== 404) {
|
|
@@ -401121,7 +401238,7 @@ function setMcpAuthCacheEntry(serverId) {
|
|
|
401121
401238
|
const cache6 = await getMcpAuthCache();
|
|
401122
401239
|
cache6[serverId] = { timestamp: Date.now() };
|
|
401123
401240
|
const cachePath = getMcpAuthCachePath();
|
|
401124
|
-
await mkdir14(
|
|
401241
|
+
await mkdir14(dirname37(cachePath), { recursive: true });
|
|
401125
401242
|
await writeFile16(cachePath, jsonStringify(cache6));
|
|
401126
401243
|
authCachePromise = null;
|
|
401127
401244
|
}).catch(() => {});
|
|
@@ -401890,7 +402007,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
401890
402007
|
const client = new Client({
|
|
401891
402008
|
name: "claude-code",
|
|
401892
402009
|
title: "RAYU",
|
|
401893
|
-
version: "
|
|
402010
|
+
version: "2.0.0",
|
|
401894
402011
|
description: "Anthropic's agentic coding tool",
|
|
401895
402012
|
websiteUrl: PRODUCT_URL
|
|
401896
402013
|
}, {
|
|
@@ -402207,7 +402324,7 @@ var init_client5 = __esm(() => {
|
|
|
402207
402324
|
const client = new Client({
|
|
402208
402325
|
name: "claude-code",
|
|
402209
402326
|
title: "RAYU",
|
|
402210
|
-
version: "
|
|
402327
|
+
version: "2.0.0",
|
|
402211
402328
|
description: "Anthropic's agentic coding tool",
|
|
402212
402329
|
websiteUrl: PRODUCT_URL
|
|
402213
402330
|
}, {
|
|
@@ -407536,7 +407653,7 @@ import {
|
|
|
407536
407653
|
stat as stat23,
|
|
407537
407654
|
unlink as unlink8
|
|
407538
407655
|
} from "fs/promises";
|
|
407539
|
-
import { dirname as
|
|
407656
|
+
import { dirname as dirname38, isAbsolute as isAbsolute15, join as join83, relative as relative13 } from "path";
|
|
407540
407657
|
import { inspect as inspect3 } from "util";
|
|
407541
407658
|
function fileHistoryEnabled() {
|
|
407542
407659
|
if (getIsNonInteractiveSession()) {
|
|
@@ -407977,7 +408094,7 @@ async function createBackup(filePath, version2) {
|
|
|
407977
408094
|
} catch (e2) {
|
|
407978
408095
|
if (!isENOENT(e2))
|
|
407979
408096
|
throw e2;
|
|
407980
|
-
await mkdir15(
|
|
408097
|
+
await mkdir15(dirname38(backupPath), { recursive: true });
|
|
407981
408098
|
await copyFile4(filePath, backupPath);
|
|
407982
408099
|
}
|
|
407983
408100
|
await chmod5(backupPath, srcStats.mode);
|
|
@@ -408009,7 +408126,7 @@ async function restoreBackup(filePath, backupFileName) {
|
|
|
408009
408126
|
} catch (e2) {
|
|
408010
408127
|
if (!isENOENT(e2))
|
|
408011
408128
|
throw e2;
|
|
408012
|
-
await mkdir15(
|
|
408129
|
+
await mkdir15(dirname38(filePath), { recursive: true });
|
|
408013
408130
|
await copyFile4(backupPath, filePath);
|
|
408014
408131
|
}
|
|
408015
408132
|
await chmod5(filePath, backupStats.mode);
|
|
@@ -408300,7 +408417,7 @@ var init_detectRepository = __esm(() => {
|
|
|
408300
408417
|
|
|
408301
408418
|
// src/utils/gitDiff.ts
|
|
408302
408419
|
import { access as access2, readFile as readFile23 } from "fs/promises";
|
|
408303
|
-
import { dirname as
|
|
408420
|
+
import { dirname as dirname39, join as join84, relative as relative14, sep as sep16 } from "path";
|
|
408304
408421
|
async function fetchGitDiff() {
|
|
408305
408422
|
const isGit = await getIsGit();
|
|
408306
408423
|
if (!isGit)
|
|
@@ -408484,7 +408601,7 @@ function parseShortstat(stdout) {
|
|
|
408484
408601
|
};
|
|
408485
408602
|
}
|
|
408486
408603
|
async function fetchSingleFileGitDiff(absoluteFilePath) {
|
|
408487
|
-
const gitRoot = findGitRoot(
|
|
408604
|
+
const gitRoot = findGitRoot(dirname39(absoluteFilePath));
|
|
408488
408605
|
if (!gitRoot)
|
|
408489
408606
|
return null;
|
|
408490
408607
|
const gitPath = relative14(gitRoot, absoluteFilePath).split(sep16).join("/");
|
|
@@ -410483,7 +410600,7 @@ var init_UI6 = __esm(() => {
|
|
|
410483
410600
|
});
|
|
410484
410601
|
|
|
410485
410602
|
// src/tools/FileEditTool/FileEditTool.ts
|
|
410486
|
-
import { dirname as
|
|
410603
|
+
import { dirname as dirname40, isAbsolute as isAbsolute16, sep as sep17 } from "path";
|
|
410487
410604
|
function readFileForEdit(absoluteFilePath) {
|
|
410488
410605
|
try {
|
|
410489
410606
|
const meta3 = readFileSyncWithMetadata(absoluteFilePath);
|
|
@@ -410778,7 +410895,7 @@ String: ${old_string}`,
|
|
|
410778
410895
|
activateConditionalSkillsForPaths([absoluteFilePath], cwd2);
|
|
410779
410896
|
}
|
|
410780
410897
|
await diagnosticTracker.beforeFileEdited(absoluteFilePath);
|
|
410781
|
-
await fs10.mkdir(
|
|
410898
|
+
await fs10.mkdir(dirname40(absoluteFilePath));
|
|
410782
410899
|
if (fileHistoryEnabled()) {
|
|
410783
410900
|
await fileHistoryTrackEdit(updateFileHistoryState, absoluteFilePath, parentMessage.uuid);
|
|
410784
410901
|
}
|
|
@@ -411362,7 +411479,7 @@ var init_UI7 = __esm(() => {
|
|
|
411362
411479
|
});
|
|
411363
411480
|
|
|
411364
411481
|
// src/tools/FileWriteTool/FileWriteTool.ts
|
|
411365
|
-
import { dirname as
|
|
411482
|
+
import { dirname as dirname41, sep as sep18 } from "path";
|
|
411366
411483
|
var WRITE_RETRY_HINT = "retry Write with the complete new file content. Existing-file Write requires a fresh full Read even when edit permission is already granted.", inputSchema11, outputSchema8, FileWriteTool;
|
|
411367
411484
|
var init_FileWriteTool = __esm(() => {
|
|
411368
411485
|
init_analytics();
|
|
@@ -411511,7 +411628,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
411511
411628
|
async call({ file_path, content }, context, _2, parentMessage) {
|
|
411512
411629
|
const { readFileState, updateFileHistoryState, dynamicSkillDirTriggers } = context;
|
|
411513
411630
|
const fullFilePath = expandPath(file_path);
|
|
411514
|
-
const dir =
|
|
411631
|
+
const dir = dirname41(fullFilePath);
|
|
411515
411632
|
const cwd2 = getCwd();
|
|
411516
411633
|
const newSkillDirs = await discoverSkillDirsForPaths([fullFilePath], cwd2);
|
|
411517
411634
|
if (newSkillDirs.length > 0) {
|
|
@@ -411677,7 +411794,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
411677
411794
|
});
|
|
411678
411795
|
|
|
411679
411796
|
// src/utils/plugins/orphanedPluginFilter.ts
|
|
411680
|
-
import { dirname as
|
|
411797
|
+
import { dirname as dirname42, isAbsolute as isAbsolute18, join as join85, normalize as normalize12, relative as relative17, sep as sep19 } from "path";
|
|
411681
411798
|
async function getGlobExclusionsForPluginCache(searchPath) {
|
|
411682
411799
|
const cachePath = normalize12(join85(getPluginsDirectory(), "cache"));
|
|
411683
411800
|
if (searchPath && !pathsOverlap(searchPath, cachePath)) {
|
|
@@ -411697,7 +411814,7 @@ async function getGlobExclusionsForPluginCache(searchPath) {
|
|
|
411697
411814
|
ORPHANED_AT_FILENAME2
|
|
411698
411815
|
], cachePath, new AbortController().signal);
|
|
411699
411816
|
cachedExclusions = markers.map((markerPath) => {
|
|
411700
|
-
const versionDir =
|
|
411817
|
+
const versionDir = dirname42(markerPath);
|
|
411701
411818
|
const rel = isAbsolute18(versionDir) ? relative17(cachePath, versionDir) : versionDir;
|
|
411702
411819
|
const posixRelative = rel.replace(/\\/g, "/");
|
|
411703
411820
|
return `!**/${posixRelative}/**`;
|
|
@@ -411727,12 +411844,12 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
411727
411844
|
});
|
|
411728
411845
|
|
|
411729
411846
|
// src/utils/glob.ts
|
|
411730
|
-
import { basename as basename25, dirname as
|
|
411847
|
+
import { basename as basename25, dirname as dirname43, isAbsolute as isAbsolute19, join as join86, sep as sep20 } from "path";
|
|
411731
411848
|
function extractGlobBaseDirectory(pattern) {
|
|
411732
411849
|
const globChars = /[*?[{]/;
|
|
411733
411850
|
const match = pattern.match(globChars);
|
|
411734
411851
|
if (!match || match.index === undefined) {
|
|
411735
|
-
const dir =
|
|
411852
|
+
const dir = dirname43(pattern);
|
|
411736
411853
|
const file2 = basename25(pattern);
|
|
411737
411854
|
return { baseDir: dir, relativePattern: file2 };
|
|
411738
411855
|
}
|
|
@@ -413854,13 +413971,16 @@ function createProgressTracker() {
|
|
|
413854
413971
|
function getTokenCountFromTracker(tracker) {
|
|
413855
413972
|
return tracker.latestInputTokens + tracker.cumulativeOutputTokens;
|
|
413856
413973
|
}
|
|
413974
|
+
function finiteTokenCount(value) {
|
|
413975
|
+
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
413976
|
+
}
|
|
413857
413977
|
function updateProgressFromMessage(tracker, message, resolveActivityDescription, tools) {
|
|
413858
413978
|
if (message.type !== "assistant") {
|
|
413859
413979
|
return;
|
|
413860
413980
|
}
|
|
413861
413981
|
const usage = message.message.usage;
|
|
413862
|
-
tracker.latestInputTokens = usage.input_tokens + (usage.cache_creation_input_tokens
|
|
413863
|
-
tracker.cumulativeOutputTokens += usage.output_tokens;
|
|
413982
|
+
tracker.latestInputTokens = finiteTokenCount(usage.input_tokens) + finiteTokenCount(usage.cache_creation_input_tokens) + finiteTokenCount(usage.cache_read_input_tokens);
|
|
413983
|
+
tracker.cumulativeOutputTokens += finiteTokenCount(usage.output_tokens);
|
|
413864
413984
|
tracker.isThinking = message.message.content.some((c4) => c4.type === "thinking" || c4.type === "redacted_thinking") && !message.message.content.some((c4) => c4.type === "tool_use");
|
|
413865
413985
|
for (const content of message.message.content) {
|
|
413866
413986
|
if (content.type === "tool_use") {
|
|
@@ -445916,10 +446036,10 @@ var init_schemas6 = __esm(() => {
|
|
|
445916
446036
|
|
|
445917
446037
|
// src/externalAgents/persistence/agentStore.ts
|
|
445918
446038
|
import { mkdir as mkdir19, readdir as readdir18, readFile as readFile27, rename as rename7, rm as rm12, writeFile as writeFile21 } from "fs/promises";
|
|
445919
|
-
import { basename as basename30, dirname as
|
|
446039
|
+
import { basename as basename30, dirname as dirname45, join as join95 } from "path";
|
|
445920
446040
|
import { randomBytes as randomBytes11 } from "crypto";
|
|
445921
446041
|
async function writeJsonAtomic(path17, value) {
|
|
445922
|
-
const dir =
|
|
446042
|
+
const dir = dirname45(path17);
|
|
445923
446043
|
await mkdir19(dir, { recursive: true, mode: DIR_MODE });
|
|
445924
446044
|
const tmpPath = join95(dir, `.${basename30(path17)}.tmp.${process.pid}.${randomBytes11(4).toString("hex")}`);
|
|
445925
446045
|
try {
|
|
@@ -452371,7 +452491,7 @@ var init_UI16 = __esm(() => {
|
|
|
452371
452491
|
|
|
452372
452492
|
// src/tools/ImageGenTool/ImageGenTool.ts
|
|
452373
452493
|
import { mkdir as mkdir20, readFile as readFile28, writeFile as writeFile22 } from "fs/promises";
|
|
452374
|
-
import { dirname as
|
|
452494
|
+
import { dirname as dirname46, isAbsolute as isAbsolute23, relative as relative20 } from "path";
|
|
452375
452495
|
function defaultOutputPath(ext = "png") {
|
|
452376
452496
|
return `./generated-image-${Date.now()}.${ext}`;
|
|
452377
452497
|
}
|
|
@@ -452572,7 +452692,7 @@ var init_ImageGenTool = __esm(() => {
|
|
|
452572
452692
|
signal: context.abortController.signal
|
|
452573
452693
|
});
|
|
452574
452694
|
const { path: path17 } = resolveOutputPath(input.output_path ?? defaultOutputPath(extForMedia(mediaType)));
|
|
452575
|
-
await mkdir20(
|
|
452695
|
+
await mkdir20(dirname46(path17), { recursive: true });
|
|
452576
452696
|
await writeFile22(path17, buffer);
|
|
452577
452697
|
let inlineB64 = buffer.toString("base64");
|
|
452578
452698
|
let inlineMedia = mediaType;
|
|
@@ -453238,7 +453358,7 @@ var init_UI17 = __esm(() => {
|
|
|
453238
453358
|
|
|
453239
453359
|
// src/tools/VideoGenTool/VideoGenTool.ts
|
|
453240
453360
|
import { mkdir as mkdir21, readFile as readFile30, writeFile as writeFile23 } from "fs/promises";
|
|
453241
|
-
import { dirname as
|
|
453361
|
+
import { dirname as dirname47, isAbsolute as isAbsolute24, relative as relative21 } from "path";
|
|
453242
453362
|
function defaultOutputPath2() {
|
|
453243
453363
|
return `./generated-video-${Date.now()}.mp4`;
|
|
453244
453364
|
}
|
|
@@ -453415,7 +453535,7 @@ var init_VideoGenTool = __esm(() => {
|
|
|
453415
453535
|
params: vparams,
|
|
453416
453536
|
signal: context.abortController.signal
|
|
453417
453537
|
});
|
|
453418
|
-
await mkdir21(
|
|
453538
|
+
await mkdir21(dirname47(path17), { recursive: true });
|
|
453419
453539
|
await writeFile23(path17, buffer);
|
|
453420
453540
|
const preview = await extractPreviewFrame(path17);
|
|
453421
453541
|
bumpFeatureUsage(VIDEO_GEN_FEATURE);
|
|
@@ -462410,7 +462530,7 @@ async function handshake(peer) {
|
|
|
462410
462530
|
clientInfo: {
|
|
462411
462531
|
name: "rayu_cli",
|
|
462412
462532
|
title: "RAYU CLI",
|
|
462413
|
-
version: typeof MACRO !== "undefined" ? "
|
|
462533
|
+
version: typeof MACRO !== "undefined" ? "2.0.0" : "0.0.0"
|
|
462414
462534
|
},
|
|
462415
462535
|
capabilities: { experimentalApi: false }
|
|
462416
462536
|
};
|
|
@@ -475901,6 +476021,17 @@ function isResultSuccessful(message, stopReason = null) {
|
|
|
475901
476021
|
}
|
|
475902
476022
|
return stopReason === "end_turn";
|
|
475903
476023
|
}
|
|
476024
|
+
function throttleAllows(tracker, key2, intervalMs, now2) {
|
|
476025
|
+
if (now2 - (tracker.get(key2) ?? 0) < intervalMs)
|
|
476026
|
+
return false;
|
|
476027
|
+
if (tracker.size >= MAX_TOOL_PROGRESS_TRACKING_ENTRIES) {
|
|
476028
|
+
const oldest = tracker.keys().next().value;
|
|
476029
|
+
if (oldest !== undefined)
|
|
476030
|
+
tracker.delete(oldest);
|
|
476031
|
+
}
|
|
476032
|
+
tracker.set(key2, now2);
|
|
476033
|
+
return true;
|
|
476034
|
+
}
|
|
475904
476035
|
function* normalizeMessage(message) {
|
|
475905
476036
|
switch (message.type) {
|
|
475906
476037
|
case "assistant":
|
|
@@ -475950,25 +476081,31 @@ function* normalizeMessage(message) {
|
|
|
475950
476081
|
}
|
|
475951
476082
|
}
|
|
475952
476083
|
} else if (message.data.type === "bash_progress" || message.data.type === "powershell_progress") {
|
|
476084
|
+
const toolName = message.data.type === "bash_progress" ? "Bash" : "PowerShell";
|
|
476085
|
+
const trackingKey = message.parentToolUseID;
|
|
476086
|
+
const now2 = Date.now();
|
|
476087
|
+
const streamed = message.data.output;
|
|
476088
|
+
if (typeof streamed === "string" && streamed.length > 0 && throttleAllows(toolOutputLastSentTime, trackingKey, TOOL_OUTPUT_THROTTLE_MS, now2)) {
|
|
476089
|
+
yield {
|
|
476090
|
+
type: "tool_output",
|
|
476091
|
+
tool_use_id: message.toolUseID,
|
|
476092
|
+
tool_name: toolName,
|
|
476093
|
+
parent_tool_use_id: message.parentToolUseID,
|
|
476094
|
+
text: streamed,
|
|
476095
|
+
elapsed_time_seconds: message.data.elapsedTimeSeconds,
|
|
476096
|
+
...typeof message.data.totalBytes === "number" ? { total_bytes: message.data.totalBytes } : {},
|
|
476097
|
+
session_id: getSessionId(),
|
|
476098
|
+
uuid: message.uuid
|
|
476099
|
+
};
|
|
476100
|
+
}
|
|
475953
476101
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) && !process.env.CLAUDE_CODE_CONTAINER_ID) {
|
|
475954
476102
|
break;
|
|
475955
476103
|
}
|
|
475956
|
-
|
|
475957
|
-
const now2 = Date.now();
|
|
475958
|
-
const lastSent = toolProgressLastSentTime.get(trackingKey) || 0;
|
|
475959
|
-
const timeSinceLastSent = now2 - lastSent;
|
|
475960
|
-
if (timeSinceLastSent >= TOOL_PROGRESS_THROTTLE_MS) {
|
|
475961
|
-
if (toolProgressLastSentTime.size >= MAX_TOOL_PROGRESS_TRACKING_ENTRIES) {
|
|
475962
|
-
const firstKey = toolProgressLastSentTime.keys().next().value;
|
|
475963
|
-
if (firstKey !== undefined) {
|
|
475964
|
-
toolProgressLastSentTime.delete(firstKey);
|
|
475965
|
-
}
|
|
475966
|
-
}
|
|
475967
|
-
toolProgressLastSentTime.set(trackingKey, now2);
|
|
476104
|
+
if (throttleAllows(toolProgressLastSentTime, trackingKey, TOOL_PROGRESS_THROTTLE_MS, now2)) {
|
|
475968
476105
|
yield {
|
|
475969
476106
|
type: "tool_progress",
|
|
475970
476107
|
tool_use_id: message.toolUseID,
|
|
475971
|
-
tool_name:
|
|
476108
|
+
tool_name: toolName,
|
|
475972
476109
|
parent_tool_use_id: message.parentToolUseID,
|
|
475973
476110
|
elapsed_time_seconds: message.data.elapsedTimeSeconds,
|
|
475974
476111
|
task_id: message.data.taskId,
|
|
@@ -476185,7 +476322,7 @@ function extractCliName(command) {
|
|
|
476185
476322
|
}
|
|
476186
476323
|
return;
|
|
476187
476324
|
}
|
|
476188
|
-
var ASK_READ_FILE_STATE_CACHE_SIZE = 10, MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
476325
|
+
var ASK_READ_FILE_STATE_CACHE_SIZE = 10, MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, TOOL_OUTPUT_THROTTLE_MS = 1000, toolOutputLastSentTime, STRIPPED_COMMANDS;
|
|
476189
476326
|
var init_queryHelpers = __esm(() => {
|
|
476190
476327
|
init_last();
|
|
476191
476328
|
init_state();
|
|
@@ -476203,6 +476340,7 @@ var init_queryHelpers = __esm(() => {
|
|
|
476203
476340
|
init_path();
|
|
476204
476341
|
init_sessionStorage();
|
|
476205
476342
|
toolProgressLastSentTime = new Map;
|
|
476343
|
+
toolOutputLastSentTime = new Map;
|
|
476206
476344
|
STRIPPED_COMMANDS = new Set(["sudo"]);
|
|
476207
476345
|
});
|
|
476208
476346
|
|
|
@@ -476210,7 +476348,7 @@ var init_queryHelpers = __esm(() => {
|
|
|
476210
476348
|
import { randomUUID as randomUUID20 } from "crypto";
|
|
476211
476349
|
import { rm as rm14 } from "fs";
|
|
476212
476350
|
import { appendFile as appendFile3, copyFile as copyFile6, mkdir as mkdir24 } from "fs/promises";
|
|
476213
|
-
import { dirname as
|
|
476351
|
+
import { dirname as dirname48, isAbsolute as isAbsolute26, join as join103, relative as relative23 } from "path";
|
|
476214
476352
|
function safeRemoveOverlay(overlayPath) {
|
|
476215
476353
|
rm14(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
|
|
476216
476354
|
}
|
|
@@ -476230,7 +476368,7 @@ async function copyOverlayToMain(overlayPath, writtenPaths, cwd2) {
|
|
|
476230
476368
|
const src = join103(overlayPath, rel);
|
|
476231
476369
|
const dest = join103(cwd2, rel);
|
|
476232
476370
|
try {
|
|
476233
|
-
await mkdir24(
|
|
476371
|
+
await mkdir24(dirname48(dest), { recursive: true });
|
|
476234
476372
|
await copyFile6(src, dest);
|
|
476235
476373
|
} catch {
|
|
476236
476374
|
allCopied = false;
|
|
@@ -476479,7 +476617,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline
|
|
|
476479
476617
|
if (isWriteTool) {
|
|
476480
476618
|
if (!writtenPathsRef.current.has(rel)) {
|
|
476481
476619
|
const overlayFile = join103(overlayPath, rel);
|
|
476482
|
-
await mkdir24(
|
|
476620
|
+
await mkdir24(dirname48(overlayFile), { recursive: true });
|
|
476483
476621
|
try {
|
|
476484
476622
|
await copyFile6(join103(cwd2, rel), overlayFile);
|
|
476485
476623
|
} catch {}
|
|
@@ -479231,7 +479369,7 @@ var builders = null;
|
|
|
479231
479369
|
import { realpath as realpath7 } from "fs/promises";
|
|
479232
479370
|
import {
|
|
479233
479371
|
basename as basename33,
|
|
479234
|
-
dirname as
|
|
479372
|
+
dirname as dirname49,
|
|
479235
479373
|
isAbsolute as isAbsolute28,
|
|
479236
479374
|
join as join105,
|
|
479237
479375
|
sep as pathSep,
|
|
@@ -479456,7 +479594,7 @@ function isSkillFile2(filePath) {
|
|
|
479456
479594
|
function transformSkillFiles(files2) {
|
|
479457
479595
|
const filesByDir = new Map;
|
|
479458
479596
|
for (const file2 of files2) {
|
|
479459
|
-
const dir =
|
|
479597
|
+
const dir = dirname49(file2.filePath);
|
|
479460
479598
|
const dirFiles = filesByDir.get(dir) ?? [];
|
|
479461
479599
|
dirFiles.push(file2);
|
|
479462
479600
|
filesByDir.set(dir, dirFiles);
|
|
@@ -479485,15 +479623,15 @@ function buildNamespace(targetDir, baseDir) {
|
|
|
479485
479623
|
return relativePath ? relativePath.split(pathSep).join(":") : "";
|
|
479486
479624
|
}
|
|
479487
479625
|
function getSkillCommandName(filePath, baseDir) {
|
|
479488
|
-
const skillDirectory =
|
|
479489
|
-
const parentOfSkillDir =
|
|
479626
|
+
const skillDirectory = dirname49(filePath);
|
|
479627
|
+
const parentOfSkillDir = dirname49(skillDirectory);
|
|
479490
479628
|
const commandBaseName = basename33(skillDirectory);
|
|
479491
479629
|
const namespace = buildNamespace(parentOfSkillDir, baseDir);
|
|
479492
479630
|
return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
|
|
479493
479631
|
}
|
|
479494
479632
|
function getRegularCommandName(filePath, baseDir) {
|
|
479495
479633
|
const fileName = basename33(filePath);
|
|
479496
|
-
const fileDirectory =
|
|
479634
|
+
const fileDirectory = dirname49(filePath);
|
|
479497
479635
|
const commandBaseName = fileName.replace(/\.md$/, "");
|
|
479498
479636
|
const namespace = buildNamespace(fileDirectory, baseDir);
|
|
479499
479637
|
return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
|
|
@@ -479516,7 +479654,7 @@ async function loadSkillsFromCommandsDir(cwd2) {
|
|
|
479516
479654
|
} of processedFiles) {
|
|
479517
479655
|
try {
|
|
479518
479656
|
const isSkillFormat = isSkillFile2(filePath);
|
|
479519
|
-
const skillDirectory = isSkillFormat ?
|
|
479657
|
+
const skillDirectory = isSkillFormat ? dirname49(filePath) : undefined;
|
|
479520
479658
|
const cmdName = getCommandName2({
|
|
479521
479659
|
baseDir,
|
|
479522
479660
|
filePath,
|
|
@@ -479568,7 +479706,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
479568
479706
|
const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2;
|
|
479569
479707
|
const newDirs = [];
|
|
479570
479708
|
for (const filePath of filePaths) {
|
|
479571
|
-
let currentDir =
|
|
479709
|
+
let currentDir = dirname49(filePath);
|
|
479572
479710
|
while (currentDir.startsWith(resolvedCwd + pathSep)) {
|
|
479573
479711
|
const skillDir = join105(currentDir, ".rayu", "skills");
|
|
479574
479712
|
if (!dynamicSkillDirs.has(skillDir)) {
|
|
@@ -479582,7 +479720,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
479582
479720
|
newDirs.push(skillDir);
|
|
479583
479721
|
} catch {}
|
|
479584
479722
|
}
|
|
479585
|
-
const parent =
|
|
479723
|
+
const parent = dirname49(currentDir);
|
|
479586
479724
|
if (parent === currentDir)
|
|
479587
479725
|
break;
|
|
479588
479726
|
currentDir = parent;
|
|
@@ -480843,7 +480981,7 @@ var init_toolSearch = __esm(() => {
|
|
|
480843
480981
|
// src/services/vcr.ts
|
|
480844
480982
|
import { createHash as createHash21, randomUUID as randomUUID22 } from "crypto";
|
|
480845
480983
|
import { mkdir as mkdir25, readFile as readFile34, writeFile as writeFile27 } from "fs/promises";
|
|
480846
|
-
import { dirname as
|
|
480984
|
+
import { dirname as dirname50, join as join106 } from "path";
|
|
480847
480985
|
function shouldUseVCR() {
|
|
480848
480986
|
if (false) {}
|
|
480849
480987
|
if (false) {}
|
|
@@ -480868,7 +481006,7 @@ async function withFixture(input, fixtureName, f3) {
|
|
|
480868
481006
|
throw new Error(`Fixture missing: ${filename}. Re-run tests with VCR_RECORD=1, then commit the result.`);
|
|
480869
481007
|
}
|
|
480870
481008
|
const result = await f3();
|
|
480871
|
-
await mkdir25(
|
|
481009
|
+
await mkdir25(dirname50(filename), { recursive: true });
|
|
480872
481010
|
await writeFile27(filename, jsonStringify(result, null, 2), {
|
|
480873
481011
|
encoding: "utf8"
|
|
480874
481012
|
});
|
|
@@ -480907,7 +481045,7 @@ ${jsonStringify(dehydratedInput, null, 2)}`);
|
|
|
480907
481045
|
if (env4.isCI && !isEnvTruthy(process.env.VCR_RECORD)) {
|
|
480908
481046
|
return results;
|
|
480909
481047
|
}
|
|
480910
|
-
await mkdir25(
|
|
481048
|
+
await mkdir25(dirname50(filename), { recursive: true });
|
|
480911
481049
|
await writeFile27(filename, jsonStringify({
|
|
480912
481050
|
input: dehydratedInput,
|
|
480913
481051
|
output: results.map((message, index) => mapMessage(message, dehydrateValue, index))
|
|
@@ -486333,7 +486471,7 @@ __export(exports_terminalSetup, {
|
|
|
486333
486471
|
import { randomBytes as randomBytes13 } from "crypto";
|
|
486334
486472
|
import { copyFile as copyFile8, mkdir as mkdir26, readFile as readFile36, writeFile as writeFile28 } from "fs/promises";
|
|
486335
486473
|
import { homedir as homedir25, platform as platform3 } from "os";
|
|
486336
|
-
import { dirname as
|
|
486474
|
+
import { dirname as dirname51, join as join110 } from "path";
|
|
486337
486475
|
import { pathToFileURL as pathToFileURL7 } from "url";
|
|
486338
486476
|
function isVSCodeRemoteSSH() {
|
|
486339
486477
|
const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? "";
|
|
@@ -486655,7 +486793,7 @@ chars = "\\u001B\\r"`;
|
|
|
486655
486793
|
return `${color("warning", theme)("Error backing up existing Alacritty config. Bailing out.")}${EOL6}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL6}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL6}`;
|
|
486656
486794
|
}
|
|
486657
486795
|
} else {
|
|
486658
|
-
await mkdir26(
|
|
486796
|
+
await mkdir26(dirname51(configPath), {
|
|
486659
486797
|
recursive: true
|
|
486660
486798
|
});
|
|
486661
486799
|
}
|
|
@@ -489159,7 +489297,7 @@ var init_TextInput = __esm(() => {
|
|
|
489159
489297
|
});
|
|
489160
489298
|
|
|
489161
489299
|
// src/utils/suggestions/directoryCompletion.ts
|
|
489162
|
-
import { basename as basename35, dirname as
|
|
489300
|
+
import { basename as basename35, dirname as dirname52, join as join113, sep as sep26 } from "path";
|
|
489163
489301
|
function parsePartialPath(partialPath, basePath) {
|
|
489164
489302
|
if (!partialPath) {
|
|
489165
489303
|
const directory2 = basePath || getCwd();
|
|
@@ -489169,7 +489307,7 @@ function parsePartialPath(partialPath, basePath) {
|
|
|
489169
489307
|
if (partialPath.endsWith("/") || partialPath.endsWith(sep26)) {
|
|
489170
489308
|
return { directory: resolved, prefix: "" };
|
|
489171
489309
|
}
|
|
489172
|
-
const directory =
|
|
489310
|
+
const directory = dirname52(resolved);
|
|
489173
489311
|
const prefix = basename35(partialPath);
|
|
489174
489312
|
return { directory, prefix };
|
|
489175
489313
|
}
|
|
@@ -493730,9 +493868,9 @@ async function assertMinVersion() {
|
|
|
493730
493868
|
if (false) {}
|
|
493731
493869
|
try {
|
|
493732
493870
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
493733
|
-
if (versionConfig.minVersion && lt("
|
|
493871
|
+
if (versionConfig.minVersion && lt("2.0.0", versionConfig.minVersion)) {
|
|
493734
493872
|
console.error(`
|
|
493735
|
-
It looks like your version of RAYU (${"
|
|
493873
|
+
It looks like your version of RAYU (${"2.0.0"}) needs an update.
|
|
493736
493874
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
493737
493875
|
|
|
493738
493876
|
To update, please run:
|
|
@@ -493896,7 +494034,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
493896
494034
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
493897
494035
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
493898
494036
|
pid: process.pid,
|
|
493899
|
-
currentVersion: "
|
|
494037
|
+
currentVersion: "2.0.0"
|
|
493900
494038
|
});
|
|
493901
494039
|
return "in_progress";
|
|
493902
494040
|
}
|
|
@@ -493905,7 +494043,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
493905
494043
|
if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
|
|
493906
494044
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
493907
494045
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
493908
|
-
currentVersion: "
|
|
494046
|
+
currentVersion: "2.0.0"
|
|
493909
494047
|
});
|
|
493910
494048
|
console.error(`
|
|
493911
494049
|
Error: Windows NPM detected in WSL
|
|
@@ -494554,7 +494692,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
494554
494692
|
}
|
|
494555
494693
|
async function getDoctorDiagnostic() {
|
|
494556
494694
|
const installationType = await getCurrentInstallationType();
|
|
494557
|
-
const version2 = typeof MACRO !== "undefined" ? "
|
|
494695
|
+
const version2 = typeof MACRO !== "undefined" ? "2.0.0" : "unknown";
|
|
494558
494696
|
const installationPath = await getInstallationPath();
|
|
494559
494697
|
const invokedBinary = getInvokedBinary();
|
|
494560
494698
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -495083,7 +495221,7 @@ import {
|
|
|
495083
495221
|
writeFile as writeFile35
|
|
495084
495222
|
} from "fs/promises";
|
|
495085
495223
|
import { homedir as homedir30 } from "os";
|
|
495086
|
-
import { basename as basename37, delimiter as delimiter3, dirname as
|
|
495224
|
+
import { basename as basename37, delimiter as delimiter3, dirname as dirname54, join as join126, resolve as resolve40 } from "path";
|
|
495087
495225
|
function getPlatform3() {
|
|
495088
495226
|
const os7 = env4.platform;
|
|
495089
495227
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -495130,7 +495268,7 @@ async function getVersionPaths(version2) {
|
|
|
495130
495268
|
const dirs = getBaseDirectories();
|
|
495131
495269
|
const dirsToCreate = [dirs.versions, dirs.staging, dirs.locks];
|
|
495132
495270
|
await Promise.all(dirsToCreate.map((dir) => mkdir30(dir, { recursive: true })));
|
|
495133
|
-
const executableParentDir =
|
|
495271
|
+
const executableParentDir = dirname54(dirs.executable);
|
|
495134
495272
|
await mkdir30(executableParentDir, { recursive: true });
|
|
495135
495273
|
const installPath = join126(dirs.versions, version2);
|
|
495136
495274
|
try {
|
|
@@ -495224,7 +495362,7 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) {
|
|
|
495224
495362
|
}
|
|
495225
495363
|
}
|
|
495226
495364
|
async function atomicMoveToInstallPath(stagedBinaryPath, installPath) {
|
|
495227
|
-
await mkdir30(
|
|
495365
|
+
await mkdir30(dirname54(installPath), { recursive: true });
|
|
495228
495366
|
const tempInstallPath = `${installPath}.tmp.${process.pid}.${Date.now()}`;
|
|
495229
495367
|
try {
|
|
495230
495368
|
await copyFile9(stagedBinaryPath, tempInstallPath);
|
|
@@ -495350,8 +495488,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
495350
495488
|
const maxVersion = await getMaxVersion();
|
|
495351
495489
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
495352
495490
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
495353
|
-
if (gte("
|
|
495354
|
-
logForDebugging(`Native installer: current version ${"
|
|
495491
|
+
if (gte("2.0.0", maxVersion)) {
|
|
495492
|
+
logForDebugging(`Native installer: current version ${"2.0.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
495355
495493
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
495356
495494
|
latency_ms: Date.now() - startTime2,
|
|
495357
495495
|
max_version: maxVersion,
|
|
@@ -495362,7 +495500,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
495362
495500
|
version2 = maxVersion;
|
|
495363
495501
|
}
|
|
495364
495502
|
}
|
|
495365
|
-
if (!forceReinstall && version2 === "
|
|
495503
|
+
if (!forceReinstall && version2 === "2.0.0" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
|
|
495366
495504
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
495367
495505
|
logEvent("tengu_native_update_complete", {
|
|
495368
495506
|
latency_ms: Date.now() - startTime2,
|
|
@@ -495438,7 +495576,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
495438
495576
|
const isWindows2 = platform4.startsWith("win32");
|
|
495439
495577
|
if (isWindows2) {
|
|
495440
495578
|
try {
|
|
495441
|
-
const parentDir2 =
|
|
495579
|
+
const parentDir2 = dirname54(symlinkPath);
|
|
495442
495580
|
await mkdir30(parentDir2, { recursive: true });
|
|
495443
495581
|
let existingStats;
|
|
495444
495582
|
try {
|
|
@@ -495484,7 +495622,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
495484
495622
|
return false;
|
|
495485
495623
|
}
|
|
495486
495624
|
}
|
|
495487
|
-
const parentDir =
|
|
495625
|
+
const parentDir = dirname54(symlinkPath);
|
|
495488
495626
|
try {
|
|
495489
495627
|
await mkdir30(parentDir, { recursive: true });
|
|
495490
495628
|
logForDebugging(`Created directory ${parentDir} for symlink`);
|
|
@@ -495501,7 +495639,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
495501
495639
|
if (symlinkExists) {
|
|
495502
495640
|
try {
|
|
495503
495641
|
const currentTarget = await readlink2(symlinkPath);
|
|
495504
|
-
const resolvedCurrentTarget = resolve40(
|
|
495642
|
+
const resolvedCurrentTarget = resolve40(dirname54(symlinkPath), currentTarget);
|
|
495505
495643
|
const resolvedTargetPath = resolve40(targetPath);
|
|
495506
495644
|
if (resolvedCurrentTarget === resolvedTargetPath) {
|
|
495507
495645
|
return false;
|
|
@@ -495541,7 +495679,7 @@ async function checkInstall(force = false) {
|
|
|
495541
495679
|
}
|
|
495542
495680
|
const dirs = getBaseDirectories();
|
|
495543
495681
|
const messages = [];
|
|
495544
|
-
const localBinDir =
|
|
495682
|
+
const localBinDir = dirname54(dirs.executable);
|
|
495545
495683
|
const resolvedLocalBinPath = resolve40(localBinDir);
|
|
495546
495684
|
const platform4 = getPlatform3();
|
|
495547
495685
|
const isWindows2 = platform4.startsWith("win32");
|
|
@@ -495565,7 +495703,7 @@ async function checkInstall(force = false) {
|
|
|
495565
495703
|
} else {
|
|
495566
495704
|
try {
|
|
495567
495705
|
const target = await readlink2(dirs.executable);
|
|
495568
|
-
const absoluteTarget = resolve40(
|
|
495706
|
+
const absoluteTarget = resolve40(dirname54(dirs.executable), target);
|
|
495569
495707
|
if (!await isPossibleClaudeBinary(absoluteTarget)) {
|
|
495570
495708
|
messages.push({
|
|
495571
495709
|
message: `Claude symlink points to missing or invalid binary: ${target}`,
|
|
@@ -495672,7 +495810,7 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) {
|
|
|
495672
495810
|
async function getVersionFromSymlink(symlinkPath) {
|
|
495673
495811
|
try {
|
|
495674
495812
|
const target = await readlink2(symlinkPath);
|
|
495675
|
-
const absoluteTarget = resolve40(
|
|
495813
|
+
const absoluteTarget = resolve40(dirname54(symlinkPath), target);
|
|
495676
495814
|
if (await isPossibleClaudeBinary(absoluteTarget)) {
|
|
495677
495815
|
return absoluteTarget;
|
|
495678
495816
|
}
|
|
@@ -495767,7 +495905,7 @@ async function cleanupOldVersions() {
|
|
|
495767
495905
|
const dirs = getBaseDirectories();
|
|
495768
495906
|
const oneHourAgo = Date.now() - 3600000;
|
|
495769
495907
|
if (getPlatform3().startsWith("win32")) {
|
|
495770
|
-
const executableDir =
|
|
495908
|
+
const executableDir = dirname54(dirs.executable);
|
|
495771
495909
|
try {
|
|
495772
495910
|
const files2 = await readdir23(executableDir);
|
|
495773
495911
|
let cleanedCount = 0;
|
|
@@ -496570,7 +496708,7 @@ function buildPrimarySection() {
|
|
|
496570
496708
|
});
|
|
496571
496709
|
return [{
|
|
496572
496710
|
label: "Version",
|
|
496573
|
-
value: "
|
|
496711
|
+
value: "2.0.0"
|
|
496574
496712
|
}, {
|
|
496575
496713
|
label: "Session name",
|
|
496576
496714
|
value: nameValue
|
|
@@ -500253,7 +500391,7 @@ function Config({
|
|
|
500253
500391
|
}
|
|
500254
500392
|
})
|
|
500255
500393
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime168.jsx(ChannelDowngradeDialog, {
|
|
500256
|
-
currentVersion: "
|
|
500394
|
+
currentVersion: "2.0.0",
|
|
500257
500395
|
onChoice: (choice) => {
|
|
500258
500396
|
setShowSubmenu(null);
|
|
500259
500397
|
setTabsHidden(false);
|
|
@@ -500265,7 +500403,7 @@ function Config({
|
|
|
500265
500403
|
autoUpdatesChannel: "stable"
|
|
500266
500404
|
};
|
|
500267
500405
|
if (choice === "stay") {
|
|
500268
|
-
newSettings.minimumVersion = "
|
|
500406
|
+
newSettings.minimumVersion = "2.0.0";
|
|
500269
500407
|
}
|
|
500270
500408
|
updateSettingsForSource("userSettings", newSettings);
|
|
500271
500409
|
setSettingsData((prev_27) => ({
|
|
@@ -508326,7 +508464,7 @@ function HelpV2(t0) {
|
|
|
508326
508464
|
let t6;
|
|
508327
508465
|
if ($3[31] !== tabs) {
|
|
508328
508466
|
t6 = /* @__PURE__ */ jsx_runtime195.jsx(Tabs, {
|
|
508329
|
-
title: `Rayu-CLI v${"
|
|
508467
|
+
title: `Rayu-CLI v${"2.0.0"}`,
|
|
508330
508468
|
color: "professionalBlue",
|
|
508331
508469
|
defaultTab: "general",
|
|
508332
508470
|
children: tabs
|
|
@@ -508640,8 +508778,8 @@ var init_IdeAutoConnectDialog = __esm(() => {
|
|
|
508640
508778
|
});
|
|
508641
508779
|
|
|
508642
508780
|
// src/commands/ide/ide.tsx
|
|
508643
|
-
var
|
|
508644
|
-
__export(
|
|
508781
|
+
var exports_ide2 = {};
|
|
508782
|
+
__export(exports_ide2, {
|
|
508645
508783
|
formatWorkspaceFolders: () => formatWorkspaceFolders,
|
|
508646
508784
|
call: () => call15
|
|
508647
508785
|
});
|
|
@@ -509272,15 +509410,7 @@ function IDECommandFlow({
|
|
|
509272
509410
|
onDone(currentIDE ? `Disconnected from ${currentIDE.name}.` : "No IDE selected.");
|
|
509273
509411
|
return;
|
|
509274
509412
|
}
|
|
509275
|
-
|
|
509276
|
-
newConfig.ide = {
|
|
509277
|
-
type: url3.startsWith("ws:") ? "ws-ide" : "sse-ide",
|
|
509278
|
-
url: url3,
|
|
509279
|
-
ideName: selectedIDE.name,
|
|
509280
|
-
authToken: selectedIDE.authToken,
|
|
509281
|
-
ideRunningInWindows: selectedIDE.ideRunningInWindows,
|
|
509282
|
-
scope: "dynamic"
|
|
509283
|
-
};
|
|
509413
|
+
newConfig.ide = ideMcpServerConfig(selectedIDE);
|
|
509284
509414
|
isFirstCheckRef.current = true;
|
|
509285
509415
|
setConnectingIDE(selectedIDE);
|
|
509286
509416
|
onChangeDynamicMcpConfig(newConfig);
|
|
@@ -509359,7 +509489,7 @@ var init_ide3 = __esm(() => {
|
|
|
509359
509489
|
name: "ide",
|
|
509360
509490
|
description: "Manage IDE integrations and show status",
|
|
509361
509491
|
argumentHint: "[open]",
|
|
509362
|
-
load: () => Promise.resolve().then(() => (init_ide2(),
|
|
509492
|
+
load: () => Promise.resolve().then(() => (init_ide2(), exports_ide2))
|
|
509363
509493
|
};
|
|
509364
509494
|
ide_default = ide;
|
|
509365
509495
|
});
|
|
@@ -509862,7 +509992,7 @@ __export(exports_keybindings, {
|
|
|
509862
509992
|
call: () => call17
|
|
509863
509993
|
});
|
|
509864
509994
|
import { mkdir as mkdir33, writeFile as writeFile37 } from "fs/promises";
|
|
509865
|
-
import { dirname as
|
|
509995
|
+
import { dirname as dirname55 } from "path";
|
|
509866
509996
|
async function call17() {
|
|
509867
509997
|
if (!isKeybindingCustomizationEnabled()) {
|
|
509868
509998
|
return {
|
|
@@ -509872,7 +510002,7 @@ async function call17() {
|
|
|
509872
510002
|
}
|
|
509873
510003
|
const keybindingsPath = getKeybindingsPath();
|
|
509874
510004
|
let fileExists2 = false;
|
|
509875
|
-
await mkdir33(
|
|
510005
|
+
await mkdir33(dirname55(keybindingsPath), { recursive: true });
|
|
509876
510006
|
try {
|
|
509877
510007
|
await writeFile37(keybindingsPath, generateKeybindingsTemplate(), {
|
|
509878
510008
|
encoding: "utf-8",
|
|
@@ -516982,7 +517112,7 @@ var init_DiscoverPlugins = __esm(() => {
|
|
|
516982
517112
|
});
|
|
516983
517113
|
|
|
516984
517114
|
// src/services/plugins/pluginOperations.ts
|
|
516985
|
-
import { dirname as
|
|
517115
|
+
import { dirname as dirname56, join as join132 } from "path";
|
|
516986
517116
|
function assertInstallableScope(scope) {
|
|
516987
517117
|
if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
|
|
516988
517118
|
throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
|
|
@@ -517459,7 +517589,7 @@ async function performPluginUpdate({
|
|
|
517459
517589
|
}
|
|
517460
517590
|
throw e2;
|
|
517461
517591
|
}
|
|
517462
|
-
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation :
|
|
517592
|
+
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname56(marketplaceInstallLocation);
|
|
517463
517593
|
sourcePath = join132(marketplaceDir, entry.source);
|
|
517464
517594
|
try {
|
|
517465
517595
|
await fs11.stat(sourcePath);
|
|
@@ -529542,7 +529672,7 @@ var init_transcriptSearch = __esm(() => {
|
|
|
529542
529672
|
|
|
529543
529673
|
// src/utils/releaseNotes.ts
|
|
529544
529674
|
import { mkdir as mkdir34, readFile as readFile47, writeFile as writeFile40 } from "fs/promises";
|
|
529545
|
-
import { dirname as
|
|
529675
|
+
import { dirname as dirname58, join as join137 } from "path";
|
|
529546
529676
|
function getChangelogCachePath() {
|
|
529547
529677
|
return join137(getRayuConfigHomeDir(), "cache", "changelog.md");
|
|
529548
529678
|
}
|
|
@@ -529553,7 +529683,7 @@ async function migrateChangelogFromConfig() {
|
|
|
529553
529683
|
}
|
|
529554
529684
|
const cachePath = getChangelogCachePath();
|
|
529555
529685
|
try {
|
|
529556
|
-
await mkdir34(
|
|
529686
|
+
await mkdir34(dirname58(cachePath), { recursive: true });
|
|
529557
529687
|
await writeFile40(cachePath, config5.cachedChangelog, {
|
|
529558
529688
|
encoding: "utf-8",
|
|
529559
529689
|
flag: "wx"
|
|
@@ -529575,7 +529705,7 @@ async function fetchAndStoreChangelog() {
|
|
|
529575
529705
|
return;
|
|
529576
529706
|
}
|
|
529577
529707
|
const cachePath = getChangelogCachePath();
|
|
529578
|
-
await mkdir34(
|
|
529708
|
+
await mkdir34(dirname58(cachePath), { recursive: true });
|
|
529579
529709
|
await writeFile40(cachePath, changelogContent, { encoding: "utf-8" });
|
|
529580
529710
|
changelogMemoryCache = changelogContent;
|
|
529581
529711
|
const changelogLastFetched = Date.now();
|
|
@@ -529644,7 +529774,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
|
|
|
529644
529774
|
}
|
|
529645
529775
|
return [];
|
|
529646
529776
|
}
|
|
529647
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "
|
|
529777
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.0.0") {
|
|
529648
529778
|
if (false) {}
|
|
529649
529779
|
const cachedChangelog = await getStoredChangelog();
|
|
529650
529780
|
if (lastSeenVersion !== currentVersion || !cachedChangelog) {
|
|
@@ -529657,7 +529787,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.7.23")
|
|
|
529657
529787
|
releaseNotes
|
|
529658
529788
|
};
|
|
529659
529789
|
}
|
|
529660
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "
|
|
529790
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "2.0.0") {
|
|
529661
529791
|
if (false) {}
|
|
529662
529792
|
const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
|
|
529663
529793
|
return {
|
|
@@ -529785,7 +529915,7 @@ function getRecentActivitySync() {
|
|
|
529785
529915
|
return cachedActivity;
|
|
529786
529916
|
}
|
|
529787
529917
|
function getLogoDisplayData() {
|
|
529788
|
-
const version2 = process.env.DEMO_VERSION ?? "
|
|
529918
|
+
const version2 = process.env.DEMO_VERSION ?? "2.0.0";
|
|
529789
529919
|
const serverUrl = getDirectConnectServerUrl();
|
|
529790
529920
|
const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
|
|
529791
529921
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -529863,12 +529993,12 @@ var RAYU_BANNER_CLAWD, RAYU_BANNER_WELCOME, BANNERS, ACTIVE_BANNER_ID = "rayu";
|
|
|
529863
529993
|
var init_bannerConfig = __esm(() => {
|
|
529864
529994
|
RAYU_BANNER_CLAWD = {
|
|
529865
529995
|
lines: [
|
|
529866
|
-
["██████╗ █████╗ ██╗ ██╗██╗ ██╗", "#
|
|
529867
|
-
["██╔══██╗██╔══██╗╚██╗ ██╔╝██║ ██║", "#
|
|
529868
|
-
["██████╔╝███████║ ╚████╔╝ ██║ ██║", "#
|
|
529869
|
-
["██╔══██╗██╔══██║ ╚██╔╝ ██║ ██║", "#
|
|
529870
|
-
["██║ ██║██║ ██║ ██║ ╚██████╔╝", "#
|
|
529871
|
-
["╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ", "#
|
|
529996
|
+
["██████╗ █████╗ ██╗ ██╗██╗ ██╗", "#22d3ee"],
|
|
529997
|
+
["██╔══██╗██╔══██╗╚██╗ ██╔╝██║ ██║", "#38bdf8"],
|
|
529998
|
+
["██████╔╝███████║ ╚████╔╝ ██║ ██║", "#60a5fa"],
|
|
529999
|
+
["██╔══██╗██╔══██║ ╚██╔╝ ██║ ██║", "#818cf8"],
|
|
530000
|
+
["██║ ██║██║ ██║ ██║ ╚██████╔╝", "#a78bfa"],
|
|
530001
|
+
["╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ", "#c084fc"]
|
|
529872
530002
|
]
|
|
529873
530003
|
};
|
|
529874
530004
|
RAYU_BANNER_WELCOME = {
|
|
@@ -530997,7 +531127,7 @@ function LogoV2() {
|
|
|
530997
531127
|
if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
530998
531128
|
t2 = () => {
|
|
530999
531129
|
const currentConfig = getGlobalConfig();
|
|
531000
|
-
if (currentConfig.lastReleaseNotesSeen === "
|
|
531130
|
+
if (currentConfig.lastReleaseNotesSeen === "2.0.0") {
|
|
531001
531131
|
return;
|
|
531002
531132
|
}
|
|
531003
531133
|
saveGlobalConfig(_temp327);
|
|
@@ -531476,7 +531606,7 @@ function LogoV2() {
|
|
|
531476
531606
|
t24 = $3[61];
|
|
531477
531607
|
}
|
|
531478
531608
|
const _latestNpm = getCachedLatestNpmVersionSync();
|
|
531479
|
-
const _updateFeeds = _latestNpm && gt(_latestNpm, "
|
|
531609
|
+
const _updateFeeds = _latestNpm && gt(_latestNpm, "2.0.0") ? [createUpdateAvailableFeed("2.0.0", _latestNpm)] : [];
|
|
531480
531610
|
const t25 = layoutMode === "horizontal" && /* @__PURE__ */ jsx_runtime236.jsx(FeedColumn, {
|
|
531481
531611
|
feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), ..._updateFeeds, createWhatsNewFeed(changelog)],
|
|
531482
531612
|
maxWidth: rightWidth
|
|
@@ -531676,12 +531806,12 @@ function LogoV2() {
|
|
|
531676
531806
|
return t41;
|
|
531677
531807
|
}
|
|
531678
531808
|
function _temp327(current) {
|
|
531679
|
-
if (current.lastReleaseNotesSeen === "
|
|
531809
|
+
if (current.lastReleaseNotesSeen === "2.0.0") {
|
|
531680
531810
|
return current;
|
|
531681
531811
|
}
|
|
531682
531812
|
return {
|
|
531683
531813
|
...current,
|
|
531684
|
-
lastReleaseNotesSeen: "
|
|
531814
|
+
lastReleaseNotesSeen: "2.0.0"
|
|
531685
531815
|
};
|
|
531686
531816
|
}
|
|
531687
531817
|
function _temp241(s_0) {
|
|
@@ -556401,7 +556531,7 @@ var init_authGate = __esm(() => {
|
|
|
556401
556531
|
// src/plugins/installers/fileEdits.ts
|
|
556402
556532
|
import { existsSync as existsSync35 } from "fs";
|
|
556403
556533
|
import { copyFile as copyFile10, mkdir as mkdir37, readFile as readFile50, rename as rename12, unlink as unlink21, writeFile as writeFile42 } from "fs/promises";
|
|
556404
|
-
import { basename as basename41, dirname as
|
|
556534
|
+
import { basename as basename41, dirname as dirname59, join as join141 } from "path";
|
|
556405
556535
|
function getHostBackupDir() {
|
|
556406
556536
|
return join141(getRayuConfigHomeDir(), HOST_BACKUP_DIR);
|
|
556407
556537
|
}
|
|
@@ -556425,7 +556555,7 @@ async function backupFile(path22) {
|
|
|
556425
556555
|
return target;
|
|
556426
556556
|
}
|
|
556427
556557
|
async function writeTextFileAtomic(path22, content, mode = 384) {
|
|
556428
|
-
const dir =
|
|
556558
|
+
const dir = dirname59(path22);
|
|
556429
556559
|
await mkdir37(dir, { recursive: true });
|
|
556430
556560
|
const tmp = join141(dir, `.${basename41(path22)}.rayu-${process.pid}.tmp`);
|
|
556431
556561
|
try {
|
|
@@ -557715,7 +557845,7 @@ function createRayuMcpServer(options) {
|
|
|
557715
557845
|
commandsPromise ??= getCommands(options.cwd);
|
|
557716
557846
|
return commandsPromise;
|
|
557717
557847
|
};
|
|
557718
|
-
const server = new Server({ name: RAYU_MCP_SERVER_NAME, version: "
|
|
557848
|
+
const server = new Server({ name: RAYU_MCP_SERVER_NAME, version: "2.0.0" }, { capabilities: { tools: {}, prompts: {} } });
|
|
557719
557849
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
557720
557850
|
const toolPermissionContext = getEmptyToolPermissionContext();
|
|
557721
557851
|
const allTools = getTools(toolPermissionContext);
|
|
@@ -557815,7 +557945,7 @@ async function pingRayuMcpServer(cwd2) {
|
|
|
557815
557945
|
const server = createRayuMcpServer2({ cwd: cwd2, debug: false, verbose: false });
|
|
557816
557946
|
const [clientTransport, serverTransport] = createLinkedTransportPair();
|
|
557817
557947
|
await server.connect(serverTransport);
|
|
557818
|
-
client = new Client({ name: `${RAYU_MCP_SERVER_NAME}-healthcheck`, version: "
|
|
557948
|
+
client = new Client({ name: `${RAYU_MCP_SERVER_NAME}-healthcheck`, version: "2.0.0" });
|
|
557819
557949
|
await client.connect(clientTransport);
|
|
557820
557950
|
const tools = await client.listTools();
|
|
557821
557951
|
let promptCount = 0;
|
|
@@ -558519,7 +558649,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
558519
558649
|
smapsRollup,
|
|
558520
558650
|
platform: process.platform,
|
|
558521
558651
|
nodeVersion: process.version,
|
|
558522
|
-
ccVersion: "
|
|
558652
|
+
ccVersion: "2.0.0"
|
|
558523
558653
|
};
|
|
558524
558654
|
}
|
|
558525
558655
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -559041,7 +559171,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
559041
559171
|
var call53 = async () => {
|
|
559042
559172
|
return {
|
|
559043
559173
|
type: "text",
|
|
559044
|
-
value: "
|
|
559174
|
+
value: "2.0.0"
|
|
559045
559175
|
};
|
|
559046
559176
|
}, version2, version_default;
|
|
559047
559177
|
var init_version = __esm(() => {
|
|
@@ -560898,9 +561028,9 @@ function TopupFlow({
|
|
|
560898
561028
|
finish(total != null ? `Payment received — ${granted.toLocaleString()} credits added. Top-up balance: ${total.toLocaleString()} credits.` : `Payment received — ${granted.toLocaleString()} credits added.`);
|
|
560899
561029
|
return;
|
|
560900
561030
|
}
|
|
560901
|
-
if (
|
|
561031
|
+
if (["failed", "expired", "canceled", "refunded"].includes(status2.status)) {
|
|
560902
561032
|
setPhase("done");
|
|
560903
|
-
finish(`
|
|
561033
|
+
finish(`Payment ${status2.status}. Run /topup to start a new ABA payment.`);
|
|
560904
561034
|
}
|
|
560905
561035
|
})();
|
|
560906
561036
|
}, POLL_INTERVAL_MS3);
|
|
@@ -560981,9 +561111,9 @@ function TopupFlow({
|
|
|
560981
561111
|
" credits"
|
|
560982
561112
|
]
|
|
560983
561113
|
}),
|
|
560984
|
-
|
|
560985
|
-
|
|
560986
|
-
children: "
|
|
561114
|
+
/* @__PURE__ */ jsx_runtime318.jsx(ThemedText, {
|
|
561115
|
+
dimColor: true,
|
|
561116
|
+
children: "PAYG credits never expire and do not change your plan."
|
|
560987
561117
|
})
|
|
560988
561118
|
]
|
|
560989
561119
|
});
|
|
@@ -561109,7 +561239,7 @@ function TopupFlow({
|
|
|
561109
561239
|
children: [
|
|
561110
561240
|
/* @__PURE__ */ jsx_runtime318.jsx(ThemedText, {
|
|
561111
561241
|
dimColor: true,
|
|
561112
|
-
children: "Could not draw the QR here — paste this
|
|
561242
|
+
children: "Could not draw the QR here — paste this ABA QR payload into ABA Mobile:"
|
|
561113
561243
|
}),
|
|
561114
561244
|
/* @__PURE__ */ jsx_runtime318.jsx(ThemedText, {
|
|
561115
561245
|
children: purchase.qr ?? ""
|
|
@@ -561118,7 +561248,7 @@ function TopupFlow({
|
|
|
561118
561248
|
}),
|
|
561119
561249
|
/* @__PURE__ */ jsx_runtime318.jsx(ThemedText, {
|
|
561120
561250
|
dimColor: true,
|
|
561121
|
-
children: purchase.method === "stripe" ? `Waiting for payment confirmation${".".repeat(1 + waited / POLL_INTERVAL_MS3 % 3)}` : `Scan with
|
|
561251
|
+
children: purchase.method === "stripe" ? `Waiting for payment confirmation${".".repeat(1 + waited / POLL_INTERVAL_MS3 % 3)}` : `Scan with ABA Mobile · waiting for payment${".".repeat(1 + waited / POLL_INTERVAL_MS3 % 3)}`
|
|
561122
561252
|
}),
|
|
561123
561253
|
purchase.expiresAt && /* @__PURE__ */ jsx_runtime318.jsxs(ThemedText, {
|
|
561124
561254
|
dimColor: true,
|
|
@@ -561167,7 +561297,6 @@ var init_topup = __esm(() => {
|
|
|
561167
561297
|
jsx_runtime318 = __toESM(require_jsx_runtime(), 1);
|
|
561168
561298
|
RAIL_OPTIONS = [
|
|
561169
561299
|
{ value: "aba", label: "ABA", description: "Scan with ABA Mobile" },
|
|
561170
|
-
{ value: "bakong", label: "Bakong KHQR", description: "Any KHQR-capable wallet" },
|
|
561171
561300
|
{ value: "stripe", label: "Card (Stripe)", description: "Pay by card in your browser" }
|
|
561172
561301
|
];
|
|
561173
561302
|
});
|
|
@@ -561324,7 +561453,7 @@ var init_advisor2 = __esm(() => {
|
|
|
561324
561453
|
// src/skills/bundledSkills.ts
|
|
561325
561454
|
import { constants as fsConstants5 } from "fs";
|
|
561326
561455
|
import { mkdir as mkdir38, open as open11 } from "fs/promises";
|
|
561327
|
-
import { dirname as
|
|
561456
|
+
import { dirname as dirname60, isAbsolute as isAbsolute29, join as join144, normalize as normalize14, sep as pathSep2 } from "path";
|
|
561328
561457
|
function registerBundledSkill(definition) {
|
|
561329
561458
|
const { files: files3 } = definition;
|
|
561330
561459
|
let skillRoot;
|
|
@@ -561388,7 +561517,7 @@ async function writeSkillFiles(dir, files3) {
|
|
|
561388
561517
|
const byParent = new Map;
|
|
561389
561518
|
for (const [relPath, content] of Object.entries(files3)) {
|
|
561390
561519
|
const target = resolveSkillFilePath(dir, relPath);
|
|
561391
|
-
const parent2 =
|
|
561520
|
+
const parent2 = dirname60(target);
|
|
561392
561521
|
const entry = [target, content];
|
|
561393
561522
|
const group = byParent.get(parent2);
|
|
561394
561523
|
if (group)
|
|
@@ -565850,7 +565979,7 @@ function SearchableModelPicker({
|
|
|
565850
565979
|
const filtered = React103.useMemo(() => {
|
|
565851
565980
|
const q2 = query3.toLowerCase().trim();
|
|
565852
565981
|
const list = !q2 ? all4 : all4.filter((o2) => {
|
|
565853
|
-
const hay = `${o2.providerId} ${o2.model} ${o2.label ?? ""}`.toLowerCase();
|
|
565982
|
+
const hay = `${o2.providerId} ${o2.model} ${o2.label ?? ""} ${o2.description ?? ""}`.toLowerCase();
|
|
565854
565983
|
return q2.split(/\s+/).every((t2) => hay.includes(t2));
|
|
565855
565984
|
});
|
|
565856
565985
|
return list.map((o2) => ({
|
|
@@ -565937,7 +566066,7 @@ function SearchableModelPicker({
|
|
|
565937
566066
|
});
|
|
565938
566067
|
}
|
|
565939
566068
|
function describeModelChoice(choice) {
|
|
565940
|
-
const parts = [choice.providerId];
|
|
566069
|
+
const parts = [choice.description, choice.providerId].filter((part) => Boolean(part));
|
|
565941
566070
|
if (choice.label)
|
|
565942
566071
|
parts.push(choice.label);
|
|
565943
566072
|
if (choice.contextWindow && choice.contextWindow > 0) {
|
|
@@ -567230,7 +567359,7 @@ var init_user = __esm(() => {
|
|
|
567230
567359
|
deviceId,
|
|
567231
567360
|
sessionId: getSessionId(),
|
|
567232
567361
|
email: getEmail(),
|
|
567233
|
-
appVersion: "
|
|
567362
|
+
appVersion: "2.0.0",
|
|
567234
567363
|
platform: getHostPlatformForAnalytics(),
|
|
567235
567364
|
organizationUuid,
|
|
567236
567365
|
accountUuid,
|
|
@@ -574898,7 +575027,7 @@ function generateHtmlReport(data, insights) {
|
|
|
574898
575027
|
</html>`;
|
|
574899
575028
|
}
|
|
574900
575029
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
574901
|
-
const version3 = typeof MACRO !== "undefined" ? "
|
|
575030
|
+
const version3 = typeof MACRO !== "undefined" ? "2.0.0" : "unknown";
|
|
574902
575031
|
const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
|
|
574903
575032
|
const facets_summary = {
|
|
574904
575033
|
total: facets.size,
|
|
@@ -576000,7 +576129,7 @@ import {
|
|
|
576000
576129
|
unlink as unlink26,
|
|
576001
576130
|
writeFile as writeFile46
|
|
576002
576131
|
} from "fs/promises";
|
|
576003
|
-
import { basename as basename43, dirname as
|
|
576132
|
+
import { basename as basename43, dirname as dirname62, join as join155 } from "path";
|
|
576004
576133
|
function isTranscriptMessage(entry) {
|
|
576005
576134
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
576006
576135
|
}
|
|
@@ -576045,7 +576174,7 @@ function getAgentMetadataPath(agentId) {
|
|
|
576045
576174
|
}
|
|
576046
576175
|
async function writeAgentMetadata(agentId, metadata) {
|
|
576047
576176
|
const path22 = getAgentMetadataPath(agentId);
|
|
576048
|
-
await mkdir42(
|
|
576177
|
+
await mkdir42(dirname62(path22), { recursive: true });
|
|
576049
576178
|
await writeFile46(path22, JSON.stringify(metadata));
|
|
576050
576179
|
}
|
|
576051
576180
|
async function readAgentMetadata(agentId) {
|
|
@@ -576068,7 +576197,7 @@ function getRemoteAgentMetadataPath(taskId) {
|
|
|
576068
576197
|
}
|
|
576069
576198
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
576070
576199
|
const path22 = getRemoteAgentMetadataPath(taskId);
|
|
576071
|
-
await mkdir42(
|
|
576200
|
+
await mkdir42(dirname62(path22), { recursive: true });
|
|
576072
576201
|
await writeFile46(path22, JSON.stringify(metadata));
|
|
576073
576202
|
}
|
|
576074
576203
|
async function readRemoteAgentMetadata(taskId) {
|
|
@@ -576257,7 +576386,7 @@ class Project {
|
|
|
576257
576386
|
try {
|
|
576258
576387
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
576259
576388
|
} catch {
|
|
576260
|
-
await mkdir42(
|
|
576389
|
+
await mkdir42(dirname62(filePath), { recursive: true, mode: 448 });
|
|
576261
576390
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
576262
576391
|
}
|
|
576263
576392
|
}
|
|
@@ -576856,7 +576985,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
576856
576985
|
}
|
|
576857
576986
|
for (const [agentId, entries] of byAgent2) {
|
|
576858
576987
|
const agentFile = getAgentTranscriptPath(asAgentId(agentId));
|
|
576859
|
-
await mkdir42(
|
|
576988
|
+
await mkdir42(dirname62(agentFile), { recursive: true, mode: 448 });
|
|
576860
576989
|
const agentContent = entries.map((p) => jsonStringify(p) + `
|
|
576861
576990
|
`).join("");
|
|
576862
576991
|
await writeFile46(agentFile, agentContent, {
|
|
@@ -577393,7 +577522,7 @@ function appendEntryToFile(fullPath, entry) {
|
|
|
577393
577522
|
try {
|
|
577394
577523
|
fs12.appendFileSync(fullPath, line, { mode: 384 });
|
|
577395
577524
|
} catch {
|
|
577396
|
-
fs12.mkdirSync(
|
|
577525
|
+
fs12.mkdirSync(dirname62(fullPath), { mode: 448 });
|
|
577397
577526
|
fs12.appendFileSync(fullPath, line, { mode: 384 });
|
|
577398
577527
|
}
|
|
577399
577528
|
}
|
|
@@ -578822,7 +578951,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
578822
578951
|
init_settings2();
|
|
578823
578952
|
init_slowOperations();
|
|
578824
578953
|
init_uuid();
|
|
578825
|
-
VERSION5 = typeof MACRO !== "undefined" ? "
|
|
578954
|
+
VERSION5 = typeof MACRO !== "undefined" ? "2.0.0" : "unknown";
|
|
578826
578955
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
578827
578956
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
578828
578957
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -580040,7 +580169,7 @@ var init_filesystem = __esm(() => {
|
|
|
580040
580169
|
});
|
|
580041
580170
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
580042
580171
|
const nonce = randomBytes20(16).toString("hex");
|
|
580043
|
-
return join157(getClaudeTempDir(), "bundled-skills", "
|
|
580172
|
+
return join157(getClaudeTempDir(), "bundled-skills", "2.0.0", nonce);
|
|
580044
580173
|
});
|
|
580045
580174
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
580046
580175
|
});
|
|
@@ -580228,6 +580357,18 @@ ${content}`;
|
|
|
580228
580357
|
return "";
|
|
580229
580358
|
}
|
|
580230
580359
|
}
|
|
580360
|
+
async function getTaskOutputSize(taskId) {
|
|
580361
|
+
try {
|
|
580362
|
+
return (await stat42(getTaskOutputPath(taskId))).size;
|
|
580363
|
+
} catch (e2) {
|
|
580364
|
+
const code = getErrnoCode(e2);
|
|
580365
|
+
if (code === "ENOENT") {
|
|
580366
|
+
return 0;
|
|
580367
|
+
}
|
|
580368
|
+
logError2(e2);
|
|
580369
|
+
return 0;
|
|
580370
|
+
}
|
|
580371
|
+
}
|
|
580231
580372
|
function initTaskOutput(taskId) {
|
|
580232
580373
|
return track((async () => {
|
|
580233
580374
|
await ensureOutputDir();
|
|
@@ -584336,7 +584477,7 @@ import {
|
|
|
584336
584477
|
symlink as symlink5,
|
|
584337
584478
|
utimes as utimes2
|
|
584338
584479
|
} from "fs/promises";
|
|
584339
|
-
import { basename as basename45, dirname as
|
|
584480
|
+
import { basename as basename45, dirname as dirname63, join as join159 } from "path";
|
|
584340
584481
|
function validateWorktreeSlug(slug) {
|
|
584341
584482
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
584342
584483
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -584532,7 +584673,7 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
584532
584673
|
const srcPath = join159(repoRoot, relativePath2);
|
|
584533
584674
|
const destPath = join159(worktreePath, relativePath2);
|
|
584534
584675
|
try {
|
|
584535
|
-
await mkdir44(
|
|
584676
|
+
await mkdir44(dirname63(destPath), { recursive: true });
|
|
584536
584677
|
await copyFile12(srcPath, destPath);
|
|
584537
584678
|
copied.push(relativePath2);
|
|
584538
584679
|
} catch (e2) {
|
|
@@ -584549,7 +584690,7 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
584549
584690
|
const sourceSettingsLocal = join159(repoRoot, localSettingsRelativePath);
|
|
584550
584691
|
try {
|
|
584551
584692
|
const destSettingsLocal = join159(worktreePath, localSettingsRelativePath);
|
|
584552
|
-
await mkdirRecursive(
|
|
584693
|
+
await mkdirRecursive(dirname63(destSettingsLocal));
|
|
584553
584694
|
await copyFile12(sourceSettingsLocal, destSettingsLocal);
|
|
584554
584695
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
584555
584696
|
} catch (e2) {
|
|
@@ -586820,6 +586961,11 @@ async function* queryModel(messages, systemPrompt, thinkingConfig, tools, signal
|
|
|
586820
586961
|
messagesForAPI = stripExcessMediaItems(messagesForAPI, API_MAX_MEDIA_PER_REQUEST);
|
|
586821
586962
|
if (!providerAcceptsImages(options.model)) {
|
|
586822
586963
|
const { stripImagesFromMessages: stripImagesFromMessages2 } = (init_compact(), __toCommonJS(exports_compact));
|
|
586964
|
+
const { contentHasImage: contentHasImage2, notePendingImageDropNotice: notePendingImageDropNotice2, rememberModelRejectedImages: rememberModelRejectedImages2 } = (init_imageCapability(), __toCommonJS(exports_imageCapability));
|
|
586965
|
+
if (messagesForAPI.some((m3) => m3.type === "user" && contentHasImage2(m3.message.content))) {
|
|
586966
|
+
rememberModelRejectedImages2(undefined, options.model);
|
|
586967
|
+
notePendingImageDropNotice2(options.model, false);
|
|
586968
|
+
}
|
|
586823
586969
|
messagesForAPI = stripImagesFromMessages2(messagesForAPI);
|
|
586824
586970
|
}
|
|
586825
586971
|
logEvent("tengu_api_after_normalize", {
|
|
@@ -590043,7 +590189,7 @@ var init_permissionSetup = __esm(() => {
|
|
|
590043
590189
|
import { statSync as statSync12 } from "fs";
|
|
590044
590190
|
import { lstat as lstat5, readdir as readdir32, readFile as readFile57, realpath as realpath10, stat as stat45 } from "fs/promises";
|
|
590045
590191
|
import { homedir as homedir36 } from "os";
|
|
590046
|
-
import { dirname as
|
|
590192
|
+
import { dirname as dirname64, join as join160, resolve as resolve46, sep as sep35 } from "path";
|
|
590047
590193
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
590048
590194
|
const lines2 = content.split(`
|
|
590049
590195
|
`);
|
|
@@ -590146,7 +590292,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
590146
590292
|
if (gitRoot && normalizePathForComparison(current) === normalizePathForComparison(gitRoot)) {
|
|
590147
590293
|
break;
|
|
590148
590294
|
}
|
|
590149
|
-
const parent2 =
|
|
590295
|
+
const parent2 = dirname64(current);
|
|
590150
590296
|
if (parent2 === current) {
|
|
590151
590297
|
break;
|
|
590152
590298
|
}
|
|
@@ -595342,7 +595488,7 @@ function withoutImages(req) {
|
|
|
595342
595488
|
}
|
|
595343
595489
|
function noteImageUnsupported(providerId, model) {
|
|
595344
595490
|
rememberModelRejectedImages(providerId, model);
|
|
595345
|
-
notePendingImageDropNotice(model);
|
|
595491
|
+
notePendingImageDropNotice(model, true);
|
|
595346
595492
|
reportIssue("openai_adapter.model_image_unsupported", "model rejected image input; retried without images", { model, status: 400 }, "low");
|
|
595347
595493
|
}
|
|
595348
595494
|
function isToolUnsupported(e2, req) {
|
|
@@ -599668,12 +599814,14 @@ function parseRayuCatalog(payload) {
|
|
|
599668
599814
|
entries.push({
|
|
599669
599815
|
code,
|
|
599670
599816
|
label: typeof item.label === "string" ? item.label : null,
|
|
599817
|
+
description: typeof item.description === "string" ? item.description : null,
|
|
599671
599818
|
contextWindow: typeof item.contextWindow === "number" ? item.contextWindow : null
|
|
599672
599819
|
});
|
|
599673
599820
|
}
|
|
599674
599821
|
return {
|
|
599675
599822
|
models: entries.map((e2) => e2.code),
|
|
599676
599823
|
modelLabels: hostedModelLabels(entries),
|
|
599824
|
+
modelDescriptions: hostedModelDescriptions(entries),
|
|
599677
599825
|
modelContextWindows: hostedContextWindows(entries)
|
|
599678
599826
|
};
|
|
599679
599827
|
}
|
|
@@ -599779,6 +599927,10 @@ function maybeWarnInsecurePermissions(path22) {
|
|
|
599779
599927
|
function loadRayuConfig() {
|
|
599780
599928
|
if (cache9)
|
|
599781
599929
|
return cache9;
|
|
599930
|
+
if (isUnsandboxedTestConfigAccess()) {
|
|
599931
|
+
cache9 = { providers: [] };
|
|
599932
|
+
return cache9;
|
|
599933
|
+
}
|
|
599782
599934
|
const path22 = configPath2();
|
|
599783
599935
|
if (existsSync38(path22)) {
|
|
599784
599936
|
try {
|
|
@@ -599805,6 +599957,11 @@ function loadRayuConfig() {
|
|
|
599805
599957
|
return cache9;
|
|
599806
599958
|
}
|
|
599807
599959
|
function saveRayuConfig(config5) {
|
|
599960
|
+
if (isUnsandboxedTestConfigAccess()) {
|
|
599961
|
+
cache9 = config5;
|
|
599962
|
+
clearContextPrepCache("rayu-config-save");
|
|
599963
|
+
return;
|
|
599964
|
+
}
|
|
599808
599965
|
const dir = getRayuAuthConfigDir();
|
|
599809
599966
|
if (!existsSync38(dir))
|
|
599810
599967
|
mkdirSync17(dir, { recursive: true });
|
|
@@ -600044,7 +600201,9 @@ function getRayuModelContextWindow(model) {
|
|
|
600044
600201
|
const envOverride3 = parseInt(process.env.RAYU_CONTEXT_TOKENS || "", 10);
|
|
600045
600202
|
if (!isNaN(envOverride3) && envOverride3 > 0)
|
|
600046
600203
|
return envOverride3;
|
|
600047
|
-
const
|
|
600204
|
+
const decoded = decodeModelProvider(model);
|
|
600205
|
+
model = decoded.model;
|
|
600206
|
+
const p = decoded.providerId ? loadRayuConfig().providers.find((provider) => provider.id === decoded.providerId) ?? getActiveProvider() : getActiveProvider();
|
|
600048
600207
|
if (p?.kind === "kiro") {
|
|
600049
600208
|
const perModel2 = p.modelContextWindows?.[model];
|
|
600050
600209
|
if (perModel2 && perModel2 > 0)
|
|
@@ -600439,8 +600598,8 @@ async function refreshRayuApiKeyCatalog() {
|
|
|
600439
600598
|
if (!result.ok || result.models.length === 0) {
|
|
600440
600599
|
return { models: provider.models ?? [], changed: false };
|
|
600441
600600
|
}
|
|
600442
|
-
const before = catalogSignature2(provider.models ?? [], provider.modelLabels, provider.modelContextWindows);
|
|
600443
|
-
const after = catalogSignature2(result.models, result.modelLabels, result.modelContextWindows);
|
|
600601
|
+
const before = catalogSignature2(provider.models ?? [], provider.modelLabels, provider.modelContextWindows, provider.modelDescriptions);
|
|
600602
|
+
const after = catalogSignature2(result.models, result.modelLabels, result.modelContextWindows, result.modelDescriptions);
|
|
600444
600603
|
const cfg = loadRayuConfig();
|
|
600445
600604
|
const cur = cfg.providers.find((p) => p.id === RAYU_API_PROVIDER_ID2);
|
|
600446
600605
|
if (!cur)
|
|
@@ -600448,6 +600607,7 @@ async function refreshRayuApiKeyCatalog() {
|
|
|
600448
600607
|
cur.models = result.models;
|
|
600449
600608
|
cur.fetchedModels = result.models;
|
|
600450
600609
|
cur.modelLabels = result.modelLabels;
|
|
600610
|
+
cur.modelDescriptions = result.modelDescriptions;
|
|
600451
600611
|
cur.modelContextWindows = result.modelContextWindows;
|
|
600452
600612
|
const fallback = pickRayuDefaultModels2(result.models);
|
|
600453
600613
|
if (!cur.defaultModel || !result.models.includes(cur.defaultModel)) {
|
|
@@ -600514,6 +600674,7 @@ function getAllProviderModelOptions() {
|
|
|
600514
600674
|
continue;
|
|
600515
600675
|
seen.add(value);
|
|
600516
600676
|
const label = p.modelLabels?.[model];
|
|
600677
|
+
const description = p.modelDescriptions?.[model];
|
|
600517
600678
|
const contextWindow = p.modelContextWindows?.[model];
|
|
600518
600679
|
out.push({
|
|
600519
600680
|
value,
|
|
@@ -600523,6 +600684,7 @@ function getAllProviderModelOptions() {
|
|
|
600523
600684
|
supportsImage: p.modelSupportsImage?.[model],
|
|
600524
600685
|
supportsTools: p.modelSupportsTools?.[model],
|
|
600525
600686
|
...label ? { label } : {},
|
|
600687
|
+
...description ? { description } : {},
|
|
600526
600688
|
...contextWindow && contextWindow > 0 ? { contextWindow } : {}
|
|
600527
600689
|
});
|
|
600528
600690
|
}
|
|
@@ -600978,7 +601140,7 @@ __export(exports_git, {
|
|
|
600978
601140
|
import { createHash as createHash29 } from "crypto";
|
|
600979
601141
|
import { readFileSync as readFileSync32, realpathSync as realpathSync6, statSync as statSync14 } from "fs";
|
|
600980
601142
|
import { open as open16, readFile as readFile58, realpath as realpath11, stat as stat46 } from "fs/promises";
|
|
600981
|
-
import { basename as basename47, dirname as
|
|
601143
|
+
import { basename as basename47, dirname as dirname65, join as join164, resolve as resolve47, sep as sep36 } from "path";
|
|
600982
601144
|
function createFindGitRoot() {
|
|
600983
601145
|
function wrapper(startPath) {
|
|
600984
601146
|
const result = findGitRootImpl(startPath);
|
|
@@ -601409,7 +601571,7 @@ var init_git = __esm(() => {
|
|
|
601409
601571
|
return current.normalize("NFC");
|
|
601410
601572
|
}
|
|
601411
601573
|
} catch {}
|
|
601412
|
-
const parent2 =
|
|
601574
|
+
const parent2 = dirname65(current);
|
|
601413
601575
|
if (parent2 === current) {
|
|
601414
601576
|
break;
|
|
601415
601577
|
}
|
|
@@ -601444,7 +601606,7 @@ var init_git = __esm(() => {
|
|
|
601444
601606
|
}
|
|
601445
601607
|
const worktreeGitDir = resolve47(gitRoot, gitContent.slice("gitdir:".length).trim());
|
|
601446
601608
|
const commonDir = resolve47(worktreeGitDir, readFileSync32(join164(worktreeGitDir, "commondir"), "utf-8").trim());
|
|
601447
|
-
if (resolve47(
|
|
601609
|
+
if (resolve47(dirname65(worktreeGitDir)) !== join164(commonDir, "worktrees")) {
|
|
601448
601610
|
return gitRoot;
|
|
601449
601611
|
}
|
|
601450
601612
|
const backlink = realpathSync6(readFileSync32(join164(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
@@ -601454,7 +601616,7 @@ var init_git = __esm(() => {
|
|
|
601454
601616
|
if (basename47(commonDir) !== ".git") {
|
|
601455
601617
|
return commonDir.normalize("NFC");
|
|
601456
601618
|
}
|
|
601457
|
-
return
|
|
601619
|
+
return dirname65(commonDir).normalize("NFC");
|
|
601458
601620
|
} catch {
|
|
601459
601621
|
return gitRoot;
|
|
601460
601622
|
}
|
|
@@ -601599,7 +601761,7 @@ __export(exports_config2, {
|
|
|
601599
601761
|
});
|
|
601600
601762
|
import { randomBytes as randomBytes23 } from "crypto";
|
|
601601
601763
|
import { unwatchFile as unwatchFile3, watchFile as watchFile3 } from "fs";
|
|
601602
|
-
import { basename as basename48, dirname as
|
|
601764
|
+
import { basename as basename48, dirname as dirname66, join as join166, resolve as resolve48 } from "path";
|
|
601603
601765
|
function createDefaultGlobalConfig() {
|
|
601604
601766
|
return {
|
|
601605
601767
|
numStartups: 0,
|
|
@@ -601876,7 +602038,7 @@ function getCustomApiKeyStatus(truncatedApiKey) {
|
|
|
601876
602038
|
return "new";
|
|
601877
602039
|
}
|
|
601878
602040
|
function saveConfig(file2, config5, defaultConfig) {
|
|
601879
|
-
const dir =
|
|
602041
|
+
const dir = dirname66(file2);
|
|
601880
602042
|
const fs12 = getFsImplementation();
|
|
601881
602043
|
fs12.mkdirSync(dir);
|
|
601882
602044
|
const filteredConfig = pickBy_default(config5, (value, key2) => jsonStringify(value) !== jsonStringify(defaultConfig[key2]));
|
|
@@ -601890,7 +602052,7 @@ function saveConfig(file2, config5, defaultConfig) {
|
|
|
601890
602052
|
}
|
|
601891
602053
|
function saveConfigWithLock(file2, createDefault, mergeFn) {
|
|
601892
602054
|
const defaultConfig = createDefault();
|
|
601893
|
-
const dir =
|
|
602055
|
+
const dir = dirname66(file2);
|
|
601894
602056
|
const fs12 = getFsImplementation();
|
|
601895
602057
|
fs12.mkdirSync(dir);
|
|
601896
602058
|
let release2;
|
|
@@ -602014,7 +602176,7 @@ function findMostRecentBackup(file2) {
|
|
|
602014
602176
|
return join166(backupDir, mostRecent);
|
|
602015
602177
|
}
|
|
602016
602178
|
} catch {}
|
|
602017
|
-
const fileDir =
|
|
602179
|
+
const fileDir = dirname66(file2);
|
|
602018
602180
|
try {
|
|
602019
602181
|
const backups = fs12.readdirStringSync(fileDir).filter((f3) => f3.startsWith(`${fileBase}.backup.`)).sort();
|
|
602020
602182
|
const mostRecent = backups.at(-1);
|
|
@@ -602394,7 +602556,7 @@ __export(exports_update, {
|
|
|
602394
602556
|
});
|
|
602395
602557
|
import { spawnSync as spawnSync10 } from "child_process";
|
|
602396
602558
|
async function update() {
|
|
602397
|
-
writeToStdout(`Current version: ${"
|
|
602559
|
+
writeToStdout(`Current version: ${"2.0.0"}
|
|
602398
602560
|
`);
|
|
602399
602561
|
if (await updateInstallerManaged())
|
|
602400
602562
|
return;
|
|
@@ -602490,18 +602652,18 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
|
|
|
602490
602652
|
process.exit(1);
|
|
602491
602653
|
return;
|
|
602492
602654
|
}
|
|
602493
|
-
if (latestVersion === "
|
|
602655
|
+
if (latestVersion === "2.0.0") {
|
|
602494
602656
|
writeToStdout(source_default.green(`
|
|
602495
|
-
Rayu CLI is up to date (${"
|
|
602657
|
+
Rayu CLI is up to date (${"2.0.0"})
|
|
602496
602658
|
`));
|
|
602497
602659
|
process.exit(0);
|
|
602498
602660
|
}
|
|
602499
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"
|
|
602661
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"2.0.0"})
|
|
602500
602662
|
`);
|
|
602501
602663
|
writeToStdout(`Installing update...
|
|
602502
602664
|
|
|
602503
602665
|
`);
|
|
602504
|
-
const versionBeforeInstall = getInstalledVersion() ?? "
|
|
602666
|
+
const versionBeforeInstall = getInstalledVersion() ?? "2.0.0";
|
|
602505
602667
|
const installSpec = buildPinnedSpec("@rayu-dev/rayu-cli", latestVersion) ?? `${"@rayu-dev/rayu-cli"}@latest`;
|
|
602506
602668
|
if (!await acquireUpdateLock()) {
|
|
602507
602669
|
process.stderr.write(source_default.yellow(`
|
|
@@ -602619,14 +602781,14 @@ async function updateNativeBinary() {
|
|
|
602619
602781
|
} catch {
|
|
602620
602782
|
latestVersion = "";
|
|
602621
602783
|
}
|
|
602622
|
-
if (latestVersion && latestVersion === "
|
|
602784
|
+
if (latestVersion && latestVersion === "2.0.0") {
|
|
602623
602785
|
writeToStdout(source_default.green(`
|
|
602624
|
-
Rayu CLI is up to date (
|
|
602786
|
+
Rayu CLI is up to date (2.0.0)
|
|
602625
602787
|
`));
|
|
602626
602788
|
process.exit(0);
|
|
602627
602789
|
}
|
|
602628
602790
|
if (latestVersion) {
|
|
602629
|
-
writeToStdout(`New version available: ${latestVersion} (current:
|
|
602791
|
+
writeToStdout(`New version available: ${latestVersion} (current: 2.0.0)
|
|
602630
602792
|
`);
|
|
602631
602793
|
}
|
|
602632
602794
|
writeToStdout(`Downloading and installing update...
|
|
@@ -602641,13 +602803,13 @@ Rayu CLI is up to date (1.7.23)
|
|
|
602641
602803
|
return;
|
|
602642
602804
|
}
|
|
602643
602805
|
writeToStdout(source_default.green(`
|
|
602644
|
-
Rayu CLI is up to date (
|
|
602806
|
+
Rayu CLI is up to date (2.0.0)
|
|
602645
602807
|
`));
|
|
602646
602808
|
process.exit(0);
|
|
602647
602809
|
}
|
|
602648
602810
|
const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
|
|
602649
602811
|
writeToStdout(source_default.green(`
|
|
602650
|
-
Successfully updated from
|
|
602812
|
+
Successfully updated from 2.0.0 to ${updatedTo}
|
|
602651
602813
|
`));
|
|
602652
602814
|
writeToStdout(`Restart your terminal to use the new version.
|
|
602653
602815
|
`);
|
|
@@ -603119,7 +603281,7 @@ async function uninstall(args = []) {
|
|
|
603119
603281
|
const keepData = args.includes("--keep-data");
|
|
603120
603282
|
const dryRun = args.includes("--dry-run");
|
|
603121
603283
|
const plan2 = await planUninstall({ keepData });
|
|
603122
|
-
writeToStdout(`Rayu CLI ${"
|
|
603284
|
+
writeToStdout(`Rayu CLI ${"2.0.0"}
|
|
603123
603285
|
|
|
603124
603286
|
`);
|
|
603125
603287
|
for (const line of describePlan(plan2))
|
|
@@ -603442,7 +603604,7 @@ function showFirstRunWelcome() {
|
|
|
603442
603604
|
`);
|
|
603443
603605
|
try {
|
|
603444
603606
|
mkdirSync19(getRayuConfigHomeDir(), { recursive: true });
|
|
603445
|
-
writeFileSync22(markerPath(), "
|
|
603607
|
+
writeFileSync22(markerPath(), "2.0.0", "utf8");
|
|
603446
603608
|
} catch {}
|
|
603447
603609
|
}
|
|
603448
603610
|
var init_firstRun = __esm(() => {
|
|
@@ -618512,7 +618674,7 @@ async function initializeBetaTracing(resource) {
|
|
|
618512
618674
|
});
|
|
618513
618675
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
618514
618676
|
setLoggerProvider(loggerProvider);
|
|
618515
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "
|
|
618677
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "2.0.0");
|
|
618516
618678
|
setEventLogger(eventLogger);
|
|
618517
618679
|
process.on("beforeExit", async () => {
|
|
618518
618680
|
await loggerProvider?.forceFlush();
|
|
@@ -618552,7 +618714,7 @@ async function initializeTelemetry() {
|
|
|
618552
618714
|
const platform4 = getPlatform();
|
|
618553
618715
|
const baseAttributes = {
|
|
618554
618716
|
[import_semantic_conventions.ATTR_SERVICE_NAME]: "claude-code",
|
|
618555
|
-
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "
|
|
618717
|
+
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "2.0.0"
|
|
618556
618718
|
};
|
|
618557
618719
|
if (platform4 === "wsl") {
|
|
618558
618720
|
const wslVersion = getWslVersion();
|
|
@@ -618597,7 +618759,7 @@ async function initializeTelemetry() {
|
|
|
618597
618759
|
} catch {}
|
|
618598
618760
|
};
|
|
618599
618761
|
registerCleanup(shutdownTelemetry2);
|
|
618600
|
-
return meterProvider2.getMeter("com.anthropic.claude_code", "
|
|
618762
|
+
return meterProvider2.getMeter("com.anthropic.claude_code", "2.0.0");
|
|
618601
618763
|
}
|
|
618602
618764
|
const meterProvider = new import_sdk_metrics2.MeterProvider({
|
|
618603
618765
|
resource,
|
|
@@ -618617,7 +618779,7 @@ async function initializeTelemetry() {
|
|
|
618617
618779
|
});
|
|
618618
618780
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
618619
618781
|
setLoggerProvider(loggerProvider);
|
|
618620
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "
|
|
618782
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "2.0.0");
|
|
618621
618783
|
setEventLogger(eventLogger);
|
|
618622
618784
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
618623
618785
|
process.on("beforeExit", async () => {
|
|
@@ -618679,7 +618841,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
618679
618841
|
}
|
|
618680
618842
|
};
|
|
618681
618843
|
registerCleanup(shutdownTelemetry);
|
|
618682
|
-
return meterProvider.getMeter("com.anthropic.claude_code", "
|
|
618844
|
+
return meterProvider.getMeter("com.anthropic.claude_code", "2.0.0");
|
|
618683
618845
|
}
|
|
618684
618846
|
async function flushTelemetry() {
|
|
618685
618847
|
const meterProvider = getMeterProvider();
|
|
@@ -620187,7 +620349,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
620187
620349
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
620188
620350
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
620189
620351
|
betas: getSdkBetas(),
|
|
620190
|
-
claude_code_version: "
|
|
620352
|
+
claude_code_version: "2.0.0",
|
|
620191
620353
|
output_style: outputStyle2,
|
|
620192
620354
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
620193
620355
|
skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -623486,7 +623648,7 @@ function getDeviceFacts() {
|
|
|
623486
623648
|
return {
|
|
623487
623649
|
platform: process.platform,
|
|
623488
623650
|
arch: process.arch,
|
|
623489
|
-
version: "
|
|
623651
|
+
version: "2.0.0"
|
|
623490
623652
|
};
|
|
623491
623653
|
}
|
|
623492
623654
|
var cached3 = null;
|
|
@@ -629320,7 +629482,7 @@ import { randomBytes as randomBytes28 } from "node:crypto";
|
|
|
629320
629482
|
import { hostname as hostname6 } from "node:os";
|
|
629321
629483
|
import { existsSync as existsSync48, mkdirSync as mkdirSync24, readFileSync as readFileSync38, writeFileSync as writeFileSync28 } from "node:fs";
|
|
629322
629484
|
import { homedir as homedir38 } from "node:os";
|
|
629323
|
-
import { dirname as
|
|
629485
|
+
import { dirname as dirname67, join as join176 } from "node:path";
|
|
629324
629486
|
function defaultStateDir() {
|
|
629325
629487
|
return join176(homedir38(), ".rayu");
|
|
629326
629488
|
}
|
|
@@ -629339,7 +629501,7 @@ function resolveMachineId(stateDir = defaultStateDir()) {
|
|
|
629339
629501
|
} catch {}
|
|
629340
629502
|
const machineId = generateMachineId();
|
|
629341
629503
|
try {
|
|
629342
|
-
mkdirSync24(
|
|
629504
|
+
mkdirSync24(dirname67(path22), { recursive: true });
|
|
629343
629505
|
writeFileSync28(path22, JSON.stringify({ machineId }, null, 2), { mode: 384 });
|
|
629344
629506
|
} catch {}
|
|
629345
629507
|
return machineId;
|
|
@@ -629380,6 +629542,9 @@ function blocksOf4(message) {
|
|
|
629380
629542
|
}
|
|
629381
629543
|
return Array.isArray(content) ? content : [];
|
|
629382
629544
|
}
|
|
629545
|
+
function isSyntheticUserText(text4) {
|
|
629546
|
+
return SYNTHETIC_USER_TEXT_TAGS.some((tag2) => text4.includes(`<${tag2}`));
|
|
629547
|
+
}
|
|
629383
629548
|
function resultText(content) {
|
|
629384
629549
|
if (typeof content === "string")
|
|
629385
629550
|
return content;
|
|
@@ -629422,7 +629587,20 @@ function summariseInput(input) {
|
|
|
629422
629587
|
return "";
|
|
629423
629588
|
}
|
|
629424
629589
|
}
|
|
629425
|
-
var MAX_SUMMARY_CHARS = 4000;
|
|
629590
|
+
var MAX_SUMMARY_CHARS = 4000, SYNTHETIC_USER_TEXT_TAGS;
|
|
629591
|
+
var init_activityBlocks = __esm(() => {
|
|
629592
|
+
init_xml();
|
|
629593
|
+
SYNTHETIC_USER_TEXT_TAGS = [
|
|
629594
|
+
TASK_NOTIFICATION_TAG,
|
|
629595
|
+
LOCAL_COMMAND_STDOUT_TAG,
|
|
629596
|
+
LOCAL_COMMAND_STDERR_TAG,
|
|
629597
|
+
LOCAL_COMMAND_CAVEAT_TAG,
|
|
629598
|
+
BASH_STDOUT_TAG,
|
|
629599
|
+
BASH_STDERR_TAG,
|
|
629600
|
+
TICK_TAG,
|
|
629601
|
+
TEAMMATE_MESSAGE_TAG
|
|
629602
|
+
];
|
|
629603
|
+
});
|
|
629426
629604
|
|
|
629427
629605
|
// src/webBridge/formatActivityForWeb.ts
|
|
629428
629606
|
function formatMessageForWeb(message) {
|
|
@@ -629435,6 +629613,8 @@ function formatMessageForWeb(message) {
|
|
|
629435
629613
|
const text4 = block.text ?? "";
|
|
629436
629614
|
if (!text4.trim())
|
|
629437
629615
|
break;
|
|
629616
|
+
if (message.type === "user" && isSyntheticUserText(text4))
|
|
629617
|
+
break;
|
|
629438
629618
|
lines2.push({
|
|
629439
629619
|
kind: message.type === "user" ? "prompt" : "assistant",
|
|
629440
629620
|
summary: truncate4(text4)
|
|
@@ -629469,7 +629649,9 @@ function formatMessageForWeb(message) {
|
|
|
629469
629649
|
function formatActivityForWeb(messages) {
|
|
629470
629650
|
return messages.flatMap(formatMessageForWeb);
|
|
629471
629651
|
}
|
|
629472
|
-
var init_formatActivityForWeb = () => {
|
|
629652
|
+
var init_formatActivityForWeb = __esm(() => {
|
|
629653
|
+
init_activityBlocks();
|
|
629654
|
+
});
|
|
629473
629655
|
|
|
629474
629656
|
// src/webBridge/webBridgePermissions.ts
|
|
629475
629657
|
function createWebBridgePermissionCallbacks(relay) {
|
|
@@ -644527,7 +644709,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
644527
644709
|
function getSemverPart(version3) {
|
|
644528
644710
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
644529
644711
|
}
|
|
644530
|
-
function useUpdateNotification(updatedVersion, initialVersion = "
|
|
644712
|
+
function useUpdateNotification(updatedVersion, initialVersion = "2.0.0") {
|
|
644531
644713
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react223.useState(() => getSemverPart(initialVersion));
|
|
644532
644714
|
if (!updatedVersion) {
|
|
644533
644715
|
return null;
|
|
@@ -644567,7 +644749,7 @@ function AutoUpdater({
|
|
|
644567
644749
|
return;
|
|
644568
644750
|
}
|
|
644569
644751
|
if (false) {}
|
|
644570
|
-
const currentVersion = "
|
|
644752
|
+
const currentVersion = "2.0.0";
|
|
644571
644753
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
644572
644754
|
let latestVersion = await getLatestVersion(channel2);
|
|
644573
644755
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -644785,12 +644967,12 @@ function NativeAutoUpdater({
|
|
|
644785
644967
|
logEvent("tengu_native_auto_updater_start", {});
|
|
644786
644968
|
try {
|
|
644787
644969
|
const maxVersion = await getMaxVersion();
|
|
644788
|
-
if (maxVersion && gt("
|
|
644970
|
+
if (maxVersion && gt("2.0.0", maxVersion)) {
|
|
644789
644971
|
const msg = await getMaxVersionMessage();
|
|
644790
644972
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
644791
644973
|
}
|
|
644792
644974
|
const result = await installLatest(channel2);
|
|
644793
|
-
const currentVersion = "
|
|
644975
|
+
const currentVersion = "2.0.0";
|
|
644794
644976
|
const latencyMs = Date.now() - startTime2;
|
|
644795
644977
|
if (result.lockFailed) {
|
|
644796
644978
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -644927,17 +645109,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
644927
645109
|
const maxVersion = await getMaxVersion();
|
|
644928
645110
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
644929
645111
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
644930
|
-
if (gte("
|
|
644931
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"
|
|
645112
|
+
if (gte("2.0.0", maxVersion)) {
|
|
645113
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"2.0.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
644932
645114
|
setUpdateAvailable(false);
|
|
644933
645115
|
return;
|
|
644934
645116
|
}
|
|
644935
645117
|
latest = maxVersion;
|
|
644936
645118
|
}
|
|
644937
|
-
const hasUpdate = latest && !gte("
|
|
645119
|
+
const hasUpdate = latest && !gte("2.0.0", latest) && !shouldSkipVersion(latest);
|
|
644938
645120
|
setUpdateAvailable(!!hasUpdate);
|
|
644939
645121
|
if (hasUpdate) {
|
|
644940
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"
|
|
645122
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"2.0.0"} -> ${latest}`);
|
|
644941
645123
|
}
|
|
644942
645124
|
};
|
|
644943
645125
|
$3[0] = t1;
|
|
@@ -644971,7 +645153,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
644971
645153
|
wrap: "truncate",
|
|
644972
645154
|
children: [
|
|
644973
645155
|
"currentVersion: ",
|
|
644974
|
-
"
|
|
645156
|
+
"2.0.0"
|
|
644975
645157
|
]
|
|
644976
645158
|
});
|
|
644977
645159
|
$3[3] = verbose;
|
|
@@ -645374,7 +645556,7 @@ function readNoticeEnvironment() {
|
|
|
645374
645556
|
function UpdateAvailableNotice({
|
|
645375
645557
|
detectInstallationType = getCurrentInstallationType,
|
|
645376
645558
|
fetchLatestVersion,
|
|
645377
|
-
currentVersion = "
|
|
645559
|
+
currentVersion = "2.0.0",
|
|
645378
645560
|
readEnvironment = readNoticeEnvironment
|
|
645379
645561
|
} = {}) {
|
|
645380
645562
|
const [latestVersion, setLatestVersion] = import_react230.useState(() => getCachedLatestNpmVersionSync());
|
|
@@ -653226,7 +653408,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
653226
653408
|
project_dir: getOriginalCwd(),
|
|
653227
653409
|
added_dirs: addedDirs
|
|
653228
653410
|
},
|
|
653229
|
-
version: "
|
|
653411
|
+
version: "2.0.0",
|
|
653230
653412
|
output_style: {
|
|
653231
653413
|
name: outputStyleName
|
|
653232
653414
|
},
|
|
@@ -662889,7 +663071,7 @@ var init_TeammateViewHeader = __esm(() => {
|
|
|
662889
663071
|
jsx_runtime431 = __toESM(require_jsx_runtime(), 1);
|
|
662890
663072
|
});
|
|
662891
663073
|
|
|
662892
|
-
// src/
|
|
663074
|
+
// src/utils/ideSelection.ts
|
|
662893
663075
|
function toIdeSelection(data) {
|
|
662894
663076
|
if (data.selection?.start && data.selection?.end) {
|
|
662895
663077
|
const { start, end } = data.selection;
|
|
@@ -662911,6 +663093,8 @@ function toIdeSelection(data) {
|
|
|
662911
663093
|
filePath: data.filePath
|
|
662912
663094
|
};
|
|
662913
663095
|
}
|
|
663096
|
+
|
|
663097
|
+
// src/hooks/useIdeSelection.ts
|
|
662914
663098
|
function useIdeSelection(mcpClients, onSelect) {
|
|
662915
663099
|
const handlersRegistered = import_react280.useRef(false);
|
|
662916
663100
|
const currentIDERef = import_react280.useRef(null);
|
|
@@ -663085,7 +663269,7 @@ __export(exports_asciicast, {
|
|
|
663085
663269
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
663086
663270
|
});
|
|
663087
663271
|
import { appendFile as appendFile6, rename as rename15 } from "fs/promises";
|
|
663088
|
-
import { basename as basename62, dirname as
|
|
663272
|
+
import { basename as basename62, dirname as dirname68, join as join180 } from "path";
|
|
663089
663273
|
function getRecordFilePath() {
|
|
663090
663274
|
if (recordingState.filePath !== null) {
|
|
663091
663275
|
return recordingState.filePath;
|
|
@@ -663167,7 +663351,7 @@ function installAsciicastRecorder() {
|
|
|
663167
663351
|
}
|
|
663168
663352
|
});
|
|
663169
663353
|
try {
|
|
663170
|
-
getFsImplementation().mkdirSync(
|
|
663354
|
+
getFsImplementation().mkdirSync(dirname68(filePath));
|
|
663171
663355
|
} catch {}
|
|
663172
663356
|
getFsImplementation().appendFileSync(filePath, header + `
|
|
663173
663357
|
`, { mode: 384 });
|
|
@@ -663236,7 +663420,7 @@ var init_asciicast = __esm(() => {
|
|
|
663236
663420
|
});
|
|
663237
663421
|
|
|
663238
663422
|
// src/utils/sessionRestore.ts
|
|
663239
|
-
import { dirname as
|
|
663423
|
+
import { dirname as dirname69 } from "path";
|
|
663240
663424
|
function extractTodosFromTranscript(messages) {
|
|
663241
663425
|
for (let i4 = messages.length - 1;i4 >= 0; i4--) {
|
|
663242
663426
|
const msg = messages[i4];
|
|
@@ -663361,7 +663545,7 @@ async function processResumedConversation(result, opts, context2) {
|
|
|
663361
663545
|
if (!opts.forkSession) {
|
|
663362
663546
|
const sid = opts.sessionIdOverride ?? result.sessionId;
|
|
663363
663547
|
if (sid) {
|
|
663364
|
-
switchSession(asSessionId(sid), opts.transcriptPath ?
|
|
663548
|
+
switchSession(asSessionId(sid), opts.transcriptPath ? dirname69(opts.transcriptPath) : null);
|
|
663365
663549
|
await renameRecordingForSession();
|
|
663366
663550
|
await resetSessionFilePointer();
|
|
663367
663551
|
restoreCostStateForSession(sid);
|
|
@@ -664044,14 +664228,7 @@ function useIDEIntegration(t0) {
|
|
|
664044
664228
|
}
|
|
664045
664229
|
return {
|
|
664046
664230
|
...prev,
|
|
664047
|
-
ide:
|
|
664048
|
-
type: ide2.url.startsWith("ws:") ? "ws-ide" : "sse-ide",
|
|
664049
|
-
url: ide2.url,
|
|
664050
|
-
ideName: ide2.name,
|
|
664051
|
-
authToken: ide2.authToken,
|
|
664052
|
-
ideRunningInWindows: ide2.ideRunningInWindows,
|
|
664053
|
-
scope: "dynamic"
|
|
664054
|
-
}
|
|
664231
|
+
ide: ideMcpServerConfig(ide2)
|
|
664055
664232
|
};
|
|
664056
664233
|
});
|
|
664057
664234
|
};
|
|
@@ -664747,7 +664924,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
664747
664924
|
} catch {}
|
|
664748
664925
|
const data = {
|
|
664749
664926
|
trigger,
|
|
664750
|
-
version: "
|
|
664927
|
+
version: "2.0.0",
|
|
664751
664928
|
platform: process.platform,
|
|
664752
664929
|
transcript,
|
|
664753
664930
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -672197,7 +672374,7 @@ var exports_REPL = {};
|
|
|
672197
672374
|
__export(exports_REPL, {
|
|
672198
672375
|
REPL: () => REPL
|
|
672199
672376
|
});
|
|
672200
|
-
import { dirname as
|
|
672377
|
+
import { dirname as dirname70, join as join184 } from "path";
|
|
672201
672378
|
import { tmpdir as tmpdir19 } from "os";
|
|
672202
672379
|
import { writeFile as writeFile49 } from "fs/promises";
|
|
672203
672380
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
@@ -673135,7 +673312,7 @@ function REPL({
|
|
|
673135
673312
|
const targetSessionCosts = getStoredSessionCosts(sessionId);
|
|
673136
673313
|
saveCurrentSessionCosts();
|
|
673137
673314
|
resetCostState();
|
|
673138
|
-
switchSession(asSessionId(sessionId), log2.fullPath ?
|
|
673315
|
+
switchSession(asSessionId(sessionId), log2.fullPath ? dirname70(log2.fullPath) : null);
|
|
673139
673316
|
const {
|
|
673140
673317
|
renameRecordingForSession: renameRecordingForSession2
|
|
673141
673318
|
} = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast));
|
|
@@ -676805,7 +676982,7 @@ function WelcomeV2() {
|
|
|
676805
676982
|
dimColor: true,
|
|
676806
676983
|
children: [
|
|
676807
676984
|
"v",
|
|
676808
|
-
"
|
|
676985
|
+
"2.0.0"
|
|
676809
676986
|
]
|
|
676810
676987
|
})
|
|
676811
676988
|
]
|
|
@@ -677812,7 +677989,7 @@ function completeOnboarding() {
|
|
|
677812
677989
|
saveGlobalConfig((current) => ({
|
|
677813
677990
|
...current,
|
|
677814
677991
|
hasCompletedOnboarding: true,
|
|
677815
|
-
lastOnboardingVersion: "
|
|
677992
|
+
lastOnboardingVersion: "2.0.0"
|
|
677816
677993
|
}));
|
|
677817
677994
|
}
|
|
677818
677995
|
function showDialog(root2, renderer) {
|
|
@@ -678966,7 +679143,7 @@ var exports_ResumeConversation = {};
|
|
|
678966
679143
|
__export(exports_ResumeConversation, {
|
|
678967
679144
|
ResumeConversation: () => ResumeConversation
|
|
678968
679145
|
});
|
|
678969
|
-
import { dirname as
|
|
679146
|
+
import { dirname as dirname71 } from "path";
|
|
678970
679147
|
function parsePrIdentifier(value2) {
|
|
678971
679148
|
const directNumber = parseInt(value2, 10);
|
|
678972
679149
|
if (!isNaN(directNumber) && directNumber > 0) {
|
|
@@ -679098,7 +679275,7 @@ function ResumeConversation({
|
|
|
679098
679275
|
}
|
|
679099
679276
|
if (false) {}
|
|
679100
679277
|
if (result_3.sessionId && !forkSession) {
|
|
679101
|
-
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ?
|
|
679278
|
+
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname71(log_0.fullPath) : null);
|
|
679102
679279
|
await renameRecordingForSession();
|
|
679103
679280
|
await resetSessionFilePointer();
|
|
679104
679281
|
restoreCostStateForSession(result_3.sessionId);
|
|
@@ -682831,7 +683008,7 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
682831
683008
|
});
|
|
682832
683009
|
|
|
682833
683010
|
// src/utils/errorLogSink.ts
|
|
682834
|
-
import { dirname as
|
|
683011
|
+
import { dirname as dirname72, join as join186 } from "path";
|
|
682835
683012
|
function getErrorsPath() {
|
|
682836
683013
|
return join186(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
682837
683014
|
}
|
|
@@ -682852,7 +683029,7 @@ function createJsonlWriter(options) {
|
|
|
682852
683029
|
function getLogWriter(path24) {
|
|
682853
683030
|
let writer = logWriters.get(path24);
|
|
682854
683031
|
if (!writer) {
|
|
682855
|
-
const dir =
|
|
683032
|
+
const dir = dirname72(path24);
|
|
682856
683033
|
writer = createJsonlWriter({
|
|
682857
683034
|
writeFn: (content) => {
|
|
682858
683035
|
try {
|
|
@@ -682880,7 +683057,7 @@ function appendToLog(path24, message) {
|
|
|
682880
683057
|
cwd: getFsImplementation().cwd(),
|
|
682881
683058
|
userType: "external",
|
|
682882
683059
|
sessionId: getSessionId(),
|
|
682883
|
-
version: "
|
|
683060
|
+
version: "2.0.0"
|
|
682884
683061
|
};
|
|
682885
683062
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
682886
683063
|
}
|
|
@@ -685639,6 +685816,55 @@ var init_streamJsonStdoutGuard = __esm(() => {
|
|
|
685639
685816
|
init_debug();
|
|
685640
685817
|
});
|
|
685641
685818
|
|
|
685819
|
+
// src/utils/ideSelectionTracker.ts
|
|
685820
|
+
function getCurrentIdeSelection() {
|
|
685821
|
+
return currentSelection;
|
|
685822
|
+
}
|
|
685823
|
+
function clearIdeSelection() {
|
|
685824
|
+
currentSelection = undefined;
|
|
685825
|
+
}
|
|
685826
|
+
function trackIdeSelection(mcpClients) {
|
|
685827
|
+
const ideClient = getConnectedIdeClient(mcpClients);
|
|
685828
|
+
if (registeredClient !== ideClient) {
|
|
685829
|
+
registeredClient = ideClient;
|
|
685830
|
+
clearIdeSelection();
|
|
685831
|
+
}
|
|
685832
|
+
if (!ideClient)
|
|
685833
|
+
return;
|
|
685834
|
+
ideClient.client.setNotificationHandler(SelectionChangedSchema2(), (notification) => {
|
|
685835
|
+
if (registeredClient !== ideClient)
|
|
685836
|
+
return;
|
|
685837
|
+
try {
|
|
685838
|
+
const data = notification.params;
|
|
685839
|
+
currentSelection = toIdeSelection({
|
|
685840
|
+
selection: data.selection ?? null,
|
|
685841
|
+
text: data.text,
|
|
685842
|
+
filePath: data.filePath
|
|
685843
|
+
});
|
|
685844
|
+
} catch (error52) {
|
|
685845
|
+
logError2(error52);
|
|
685846
|
+
}
|
|
685847
|
+
});
|
|
685848
|
+
}
|
|
685849
|
+
var SelectionChangedSchema2, currentSelection, registeredClient;
|
|
685850
|
+
var init_ideSelectionTracker = __esm(() => {
|
|
685851
|
+
init_v4();
|
|
685852
|
+
init_log3();
|
|
685853
|
+
init_lazySchema();
|
|
685854
|
+
init_ide();
|
|
685855
|
+
SelectionChangedSchema2 = lazySchema(() => exports_external.object({
|
|
685856
|
+
method: exports_external.literal("selection_changed"),
|
|
685857
|
+
params: exports_external.object({
|
|
685858
|
+
selection: exports_external.object({
|
|
685859
|
+
start: exports_external.object({ line: exports_external.number(), character: exports_external.number() }),
|
|
685860
|
+
end: exports_external.object({ line: exports_external.number(), character: exports_external.number() })
|
|
685861
|
+
}).nullable().optional(),
|
|
685862
|
+
text: exports_external.string().optional(),
|
|
685863
|
+
filePath: exports_external.string().optional()
|
|
685864
|
+
})
|
|
685865
|
+
}));
|
|
685866
|
+
});
|
|
685867
|
+
|
|
685642
685868
|
// src/utils/queryContext.ts
|
|
685643
685869
|
async function fetchSystemPromptParts({
|
|
685644
685870
|
tools,
|
|
@@ -685897,6 +686123,7 @@ class QueryEngine {
|
|
|
685897
686123
|
yield message;
|
|
685898
686124
|
}
|
|
685899
686125
|
}
|
|
686126
|
+
trackIdeSelection(processUserInputContext.options?.mcpClients);
|
|
685900
686127
|
const {
|
|
685901
686128
|
messages: messagesFromUserInput,
|
|
685902
686129
|
shouldQuery,
|
|
@@ -685912,6 +686139,7 @@ class QueryEngine {
|
|
|
685912
686139
|
messages: this.mutableMessages
|
|
685913
686140
|
},
|
|
685914
686141
|
messages: this.mutableMessages,
|
|
686142
|
+
ideSelection: getCurrentIdeSelection(),
|
|
685915
686143
|
uuid: options?.uuid,
|
|
685916
686144
|
isMeta: options?.isMeta,
|
|
685917
686145
|
querySource: "sdk"
|
|
@@ -686503,6 +686731,7 @@ var init_QueryEngine = __esm(() => {
|
|
|
686503
686731
|
init_model3();
|
|
686504
686732
|
init_pluginLoader();
|
|
686505
686733
|
init_processUserInput();
|
|
686734
|
+
init_ideSelectionTracker();
|
|
686506
686735
|
init_queryContext();
|
|
686507
686736
|
init_Shell();
|
|
686508
686737
|
init_sessionStorage();
|
|
@@ -686890,8 +687119,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
686890
687119
|
}
|
|
686891
687120
|
async function checkEnvLessBridgeMinVersion() {
|
|
686892
687121
|
const cfg = await getEnvLessBridgeConfig();
|
|
686893
|
-
if (cfg.min_version && lt("
|
|
686894
|
-
return `Your version of RAYU (${"
|
|
687122
|
+
if (cfg.min_version && lt("2.0.0", cfg.min_version)) {
|
|
687123
|
+
return `Your version of RAYU (${"2.0.0"}) is too old for Remote Control.
|
|
686895
687124
|
Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
|
|
686896
687125
|
}
|
|
686897
687126
|
return null;
|
|
@@ -687219,14 +687448,14 @@ __export(exports_bridgePointer, {
|
|
|
687219
687448
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
687220
687449
|
});
|
|
687221
687450
|
import { mkdir as mkdir48, readFile as readFile62, stat as stat50, unlink as unlink28, writeFile as writeFile52 } from "fs/promises";
|
|
687222
|
-
import { dirname as
|
|
687451
|
+
import { dirname as dirname73, join as join190 } from "path";
|
|
687223
687452
|
function getBridgePointerPath(dir) {
|
|
687224
687453
|
return join190(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
687225
687454
|
}
|
|
687226
687455
|
async function writeBridgePointer(dir, pointer) {
|
|
687227
687456
|
const path24 = getBridgePointerPath(dir);
|
|
687228
687457
|
try {
|
|
687229
|
-
await mkdir48(
|
|
687458
|
+
await mkdir48(dirname73(path24), { recursive: true });
|
|
687230
687459
|
await writeFile52(path24, jsonStringify(pointer), "utf8");
|
|
687231
687460
|
logForDebugging(`[bridge:pointer] wrote ${path24}`);
|
|
687232
687461
|
} catch (err2) {
|
|
@@ -687366,7 +687595,7 @@ async function initBridgeCore(params) {
|
|
|
687366
687595
|
const rawApi = createBridgeApiClient({
|
|
687367
687596
|
baseUrl,
|
|
687368
687597
|
getAccessToken,
|
|
687369
|
-
runnerVersion: "
|
|
687598
|
+
runnerVersion: "2.0.0",
|
|
687370
687599
|
onDebug: logForDebugging,
|
|
687371
687600
|
onAuth401,
|
|
687372
687601
|
getTrustedDeviceToken
|
|
@@ -689204,9 +689433,25 @@ __export(exports_print, {
|
|
|
689204
689433
|
canBatchWith: () => canBatchWith
|
|
689205
689434
|
});
|
|
689206
689435
|
import { readFile as readFile63, stat as stat51 } from "fs/promises";
|
|
689207
|
-
import { dirname as
|
|
689436
|
+
import { dirname as dirname74 } from "path";
|
|
689208
689437
|
import { cwd as cwd2 } from "process";
|
|
689209
689438
|
import { randomUUID as randomUUID56 } from "crypto";
|
|
689439
|
+
function looksLikeTranscript(content) {
|
|
689440
|
+
for (const line of content.split(`
|
|
689441
|
+
`, 8)) {
|
|
689442
|
+
const trimmed = line.trim();
|
|
689443
|
+
if (!trimmed)
|
|
689444
|
+
continue;
|
|
689445
|
+
if (!trimmed.startsWith("{"))
|
|
689446
|
+
continue;
|
|
689447
|
+
try {
|
|
689448
|
+
const parsed = JSON.parse(trimmed);
|
|
689449
|
+
if (typeof parsed?.type === "string")
|
|
689450
|
+
return true;
|
|
689451
|
+
} catch {}
|
|
689452
|
+
}
|
|
689453
|
+
return false;
|
|
689454
|
+
}
|
|
689210
689455
|
function trackReceivedMessageUuid(uuid5) {
|
|
689211
689456
|
if (receivedMessageUuids.has(uuid5)) {
|
|
689212
689457
|
return false;
|
|
@@ -689470,7 +689715,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
|
|
|
689470
689715
|
} else if (options.outputFormat === "stream-json" && options.verbose) {
|
|
689471
689716
|
await structuredIO.write(message);
|
|
689472
689717
|
}
|
|
689473
|
-
if (message.type !== "control_response" && message.type !== "control_request" && message.type !== "control_cancel_request" && !(message.type === "system" && (message.subtype === "session_state_changed" || message.subtype === "task_notification" || message.subtype === "task_started" || message.subtype === "task_progress" || message.subtype === "post_turn_summary")) && message.type !== "stream_event" && message.type !== "keep_alive" && message.type !== "streamlined_text" && message.type !== "streamlined_tool_use_summary" && message.type !== "prompt_suggestion") {
|
|
689718
|
+
if (message.type !== "control_response" && message.type !== "control_request" && message.type !== "control_cancel_request" && !(message.type === "system" && (message.subtype === "session_state_changed" || message.subtype === "task_notification" || message.subtype === "task_started" || message.subtype === "task_progress" || message.subtype === "post_turn_summary")) && message.type !== "stream_event" && message.type !== "tool_output" && message.type !== "keep_alive" && message.type !== "streamlined_text" && message.type !== "streamlined_tool_use_summary" && message.type !== "prompt_suggestion") {
|
|
689474
689719
|
if (needsFullArray) {
|
|
689475
689720
|
messages.push(message);
|
|
689476
689721
|
}
|
|
@@ -690990,6 +691235,25 @@ ${m3.text}
|
|
|
690990
691235
|
} catch (error52) {
|
|
690991
691236
|
sendControlResponseError(message, errorMessage(error52));
|
|
690992
691237
|
}
|
|
691238
|
+
} else if (message.request.subtype === "task_output") {
|
|
691239
|
+
const { task_id: taskId, max_bytes: maxBytes } = message.request;
|
|
691240
|
+
try {
|
|
691241
|
+
const cap = typeof maxBytes === "number" && Number.isFinite(maxBytes) && maxBytes > 0 ? Math.min(maxBytes, MAX_CONTROL_TASK_OUTPUT_BYTES) : MAX_CONTROL_TASK_OUTPUT_BYTES;
|
|
691242
|
+
const [content, size] = await Promise.all([
|
|
691243
|
+
getTaskOutput(taskId, cap),
|
|
691244
|
+
getTaskOutputSize(taskId)
|
|
691245
|
+
]);
|
|
691246
|
+
const task = getAppState().tasks?.[taskId];
|
|
691247
|
+
const isTranscript = task?.type === "local_agent" || task?.type === "in_process_teammate" || task === undefined && looksLikeTranscript(content);
|
|
691248
|
+
sendControlResponseSuccess(message, {
|
|
691249
|
+
content,
|
|
691250
|
+
format: isTranscript ? "transcript" : "text",
|
|
691251
|
+
truncated: size > cap,
|
|
691252
|
+
size
|
|
691253
|
+
});
|
|
691254
|
+
} catch (error52) {
|
|
691255
|
+
sendControlResponseError(message, errorMessage(error52));
|
|
691256
|
+
}
|
|
690993
691257
|
} else if (message.request.subtype === "generate_session_title") {
|
|
690994
691258
|
const { description, persist: persist4 } = message.request;
|
|
690995
691259
|
const titleSignal = (abortController && !abortController.signal.aborted ? abortController : createAbortController()).signal;
|
|
@@ -691626,7 +691890,7 @@ async function loadInitialMessages(setAppState, options) {
|
|
|
691626
691890
|
if (false) {}
|
|
691627
691891
|
if (!options.forkSession) {
|
|
691628
691892
|
if (result.sessionId) {
|
|
691629
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
691893
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname74(result.fullPath) : null);
|
|
691630
691894
|
if (persistSession) {
|
|
691631
691895
|
await resetSessionFilePointer();
|
|
691632
691896
|
}
|
|
@@ -691724,7 +691988,7 @@ async function loadInitialMessages(setAppState, options) {
|
|
|
691724
691988
|
}
|
|
691725
691989
|
if (false) {}
|
|
691726
691990
|
if (!options.forkSession && result.sessionId) {
|
|
691727
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
691991
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname74(result.fullPath) : null);
|
|
691728
691992
|
if (persistSession) {
|
|
691729
691993
|
await resetSessionFilePointer();
|
|
691730
691994
|
}
|
|
@@ -691993,7 +692257,7 @@ You MUST shut down your team before preparing your final response:
|
|
|
691993
692257
|
The user cannot receive your response until the team is completely shut down.
|
|
691994
692258
|
</system-reminder>
|
|
691995
692259
|
|
|
691996
|
-
Shut down your team and prepare your final response for the user.`, MAX_RECEIVED_UUIDS = 1e4, receivedMessageUuids, receivedMessageUuidsOrder;
|
|
692260
|
+
Shut down your team and prepare your final response for the user.`, MAX_RECEIVED_UUIDS = 1e4, receivedMessageUuids, receivedMessageUuidsOrder, MAX_CONTROL_TASK_OUTPUT_BYTES;
|
|
691997
692261
|
var init_print = __esm(() => {
|
|
691998
692262
|
init_settingsSync();
|
|
691999
692263
|
init_remoteManagedSettings();
|
|
@@ -692109,11 +692373,13 @@ var init_print = __esm(() => {
|
|
|
692109
692373
|
init_tasks();
|
|
692110
692374
|
init_framework();
|
|
692111
692375
|
init_stopTask();
|
|
692376
|
+
init_diskOutput();
|
|
692112
692377
|
init_sdkEventQueue();
|
|
692113
692378
|
init_errors();
|
|
692114
692379
|
init_paths2();
|
|
692115
692380
|
receivedMessageUuids = new Set;
|
|
692116
692381
|
receivedMessageUuidsOrder = [];
|
|
692382
|
+
MAX_CONTROL_TASK_OUTPUT_BYTES = 512 * 1024;
|
|
692117
692383
|
});
|
|
692118
692384
|
|
|
692119
692385
|
// src/components/TeleportProgress.tsx
|
|
@@ -692608,7 +692874,7 @@ __export(exports_plugins, {
|
|
|
692608
692874
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
692609
692875
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
692610
692876
|
});
|
|
692611
|
-
import { basename as basename64, dirname as
|
|
692877
|
+
import { basename as basename64, dirname as dirname75 } from "path";
|
|
692612
692878
|
function handleMarketplaceError(error52, action2) {
|
|
692613
692879
|
logError2(error52);
|
|
692614
692880
|
cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error52)}`);
|
|
@@ -692641,9 +692907,9 @@ async function pluginValidateHandler(manifestPath, options) {
|
|
|
692641
692907
|
printValidationResult(result);
|
|
692642
692908
|
let contentResults = [];
|
|
692643
692909
|
if (result.fileType === "plugin") {
|
|
692644
|
-
const manifestDir =
|
|
692910
|
+
const manifestDir = dirname75(result.filePath);
|
|
692645
692911
|
if (basename64(manifestDir) === ".claude-plugin") {
|
|
692646
|
-
contentResults = await validatePluginContents(
|
|
692912
|
+
contentResults = await validatePluginContents(dirname75(manifestDir));
|
|
692647
692913
|
for (const r2 of contentResults) {
|
|
692648
692914
|
console.log(`Validating ${r2.fileType}: ${r2.filePath}
|
|
692649
692915
|
`);
|
|
@@ -694325,6 +694591,21 @@ ${formattedErrors}
|
|
|
694325
694591
|
}
|
|
694326
694592
|
}
|
|
694327
694593
|
if (false) {}
|
|
694594
|
+
if (getIsNonInteractiveSession() && !isEnvDefinedFalsy(process.env.CLAUDE_CODE_AUTO_CONNECT_IDE)) {
|
|
694595
|
+
try {
|
|
694596
|
+
const { findAvailableIDE: findAvailableIDE2, ideMcpServerConfig: ideMcpServerConfig2 } = await Promise.resolve().then(() => (init_ide(), exports_ide));
|
|
694597
|
+
const ide3 = await findAvailableIDE2();
|
|
694598
|
+
if (ide3) {
|
|
694599
|
+
dynamicMcpConfig = {
|
|
694600
|
+
...dynamicMcpConfig,
|
|
694601
|
+
ide: ideMcpServerConfig2(ide3)
|
|
694602
|
+
};
|
|
694603
|
+
logForDebugging(`[ide] headless session connected to ${ide3.name} on port ${ide3.port}`);
|
|
694604
|
+
}
|
|
694605
|
+
} catch (error52) {
|
|
694606
|
+
logForDebugging(`[ide] headless discovery failed: ${errorMessage(error52)}`);
|
|
694607
|
+
}
|
|
694608
|
+
}
|
|
694328
694609
|
setAdditionalDirectoriesForClaudeMd(addDir2);
|
|
694329
694610
|
let devChannels;
|
|
694330
694611
|
if (false) {}
|
|
@@ -694723,7 +695004,7 @@ ${customInstructions}` : customInstructions;
|
|
|
694723
695004
|
}
|
|
694724
695005
|
}
|
|
694725
695006
|
logForDiagnosticsNoPII("info", "started", {
|
|
694726
|
-
version: "
|
|
695007
|
+
version: "2.0.0",
|
|
694727
695008
|
is_native_binary: isInBundledMode()
|
|
694728
695009
|
});
|
|
694729
695010
|
registerCleanup(async () => {
|
|
@@ -695446,7 +695727,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
695446
695727
|
pendingHookMessages
|
|
695447
695728
|
}, renderAndRun);
|
|
695448
695729
|
}
|
|
695449
|
-
}).version(`
|
|
695730
|
+
}).version(`2.0.0 (${PRODUCT_NAME})`, "-v, --version", "Output the version number");
|
|
695450
695731
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
695451
695732
|
program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
695452
695733
|
if (canUserConfigureAdvisor()) {
|
|
@@ -695911,7 +696192,7 @@ if (false) {}
|
|
|
695911
696192
|
async function main2() {
|
|
695912
696193
|
const args = process.argv.slice(2);
|
|
695913
696194
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
695914
|
-
console.log(`${"
|
|
696195
|
+
console.log(`${"2.0.0"} (Beta-Rayu-CLI)`);
|
|
695915
696196
|
return;
|
|
695916
696197
|
}
|
|
695917
696198
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)) {
|