claude-code-openai 0.1.8 → 0.1.10
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/cli.js +120 -47
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -186389,6 +186389,9 @@ function getCustomHeaders() {
|
|
|
186389
186389
|
}
|
|
186390
186390
|
return customHeaders;
|
|
186391
186391
|
}
|
|
186392
|
+
function clearOpenAIClientCache() {
|
|
186393
|
+
_cachedOpenAIClient = null;
|
|
186394
|
+
}
|
|
186392
186395
|
async function getOpenAIClient({
|
|
186393
186396
|
apiKey
|
|
186394
186397
|
}) {
|
|
@@ -204603,7 +204606,7 @@ var init_metadata = __esm(() => {
|
|
|
204603
204606
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
204604
204607
|
version: "2.1.88-rebuild",
|
|
204605
204608
|
versionBase: getVersionBase(),
|
|
204606
|
-
buildTime: "2026-04-01T09:
|
|
204609
|
+
buildTime: "2026-04-01T09:59:26.964Z",
|
|
204607
204610
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
204608
204611
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
204609
204612
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -592889,7 +592892,7 @@ function getAnthropicEnvMetadata() {
|
|
|
592889
592892
|
function getBuildAgeMinutes() {
|
|
592890
592893
|
if (false)
|
|
592891
592894
|
;
|
|
592892
|
-
const buildTime = new Date("2026-04-01T09:
|
|
592895
|
+
const buildTime = new Date("2026-04-01T09:59:26.964Z").getTime();
|
|
592893
592896
|
if (isNaN(buildTime))
|
|
592894
592897
|
return;
|
|
592895
592898
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -595165,6 +595168,15 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
|
|
|
595165
595168
|
const MAX_RETRIES4 = 3;
|
|
595166
595169
|
const BASE_DELAY_MS4 = 500;
|
|
595167
595170
|
try {
|
|
595171
|
+
let resetWatchdog = function() {
|
|
595172
|
+
if (watchdogTimer)
|
|
595173
|
+
clearTimeout(watchdogTimer);
|
|
595174
|
+
watchdogTimer = setTimeout(() => {
|
|
595175
|
+
logForDebugging(`[OpenAI] Stream watchdog triggered — no data for ${STREAM_WATCHDOG_MS / 1000}s, aborting`);
|
|
595176
|
+
watchdogController.abort();
|
|
595177
|
+
reader.cancel().catch(() => {});
|
|
595178
|
+
}, STREAM_WATCHDOG_MS);
|
|
595179
|
+
};
|
|
595168
595180
|
let response;
|
|
595169
595181
|
let lastErrorMessage = "";
|
|
595170
595182
|
let lastStatus = 0;
|
|
@@ -595222,8 +595234,30 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
|
|
|
595222
595234
|
error: "rate_limit"
|
|
595223
595235
|
});
|
|
595224
595236
|
} else if (status === 401 || status === 403) {
|
|
595237
|
+
clearOpenAIClientCache();
|
|
595238
|
+
if (!_auth401RetryInProgress) {
|
|
595239
|
+
try {
|
|
595240
|
+
const { loadOpenAITokens: loadOpenAITokens2, refreshOpenAIToken: refreshOpenAIToken2 } = await Promise.resolve().then(() => (init_openai_oauth(), exports_openai_oauth));
|
|
595241
|
+
const tokens = loadOpenAITokens2();
|
|
595242
|
+
if (tokens?.refresh_token) {
|
|
595243
|
+
logForDebugging("[OpenAI] 401 received — attempting OAuth token refresh...");
|
|
595244
|
+
_auth401RetryInProgress = true;
|
|
595245
|
+
try {
|
|
595246
|
+
await refreshOpenAIToken2(tokens.refresh_token);
|
|
595247
|
+
logForDebugging("[OpenAI] Token refreshed, retrying request...");
|
|
595248
|
+
yield* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools, signal, options);
|
|
595249
|
+
return;
|
|
595250
|
+
} finally {
|
|
595251
|
+
_auth401RetryInProgress = false;
|
|
595252
|
+
}
|
|
595253
|
+
}
|
|
595254
|
+
} catch (refreshErr) {
|
|
595255
|
+
_auth401RetryInProgress = false;
|
|
595256
|
+
logForDebugging(`[OpenAI] OAuth token refresh failed: ${refreshErr instanceof Error ? refreshErr.message : String(refreshErr)}`);
|
|
595257
|
+
}
|
|
595258
|
+
}
|
|
595225
595259
|
yield createAssistantAPIErrorMessage({
|
|
595226
|
-
content: `Authentication error: ${lastErrorMessage}.
|
|
595260
|
+
content: `Authentication error: ${lastErrorMessage}. Run /login to re-authenticate or check your OPENAI_API_KEY.`,
|
|
595227
595261
|
error: "authentication_failed"
|
|
595228
595262
|
});
|
|
595229
595263
|
} else if (status === 400 && lastErrorMessage.includes("context_length_exceeded")) {
|
|
@@ -595281,11 +595315,16 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
|
|
|
595281
595315
|
const reader = response.body.getReader();
|
|
595282
595316
|
const decoder = new TextDecoder;
|
|
595283
595317
|
let buffer = "";
|
|
595318
|
+
const STREAM_WATCHDOG_MS = 90000;
|
|
595319
|
+
let watchdogTimer = null;
|
|
595320
|
+
const watchdogController = new AbortController;
|
|
595321
|
+
resetWatchdog();
|
|
595284
595322
|
try {
|
|
595285
595323
|
while (true) {
|
|
595286
595324
|
const { done, value } = await reader.read();
|
|
595287
595325
|
if (done)
|
|
595288
595326
|
break;
|
|
595327
|
+
resetWatchdog();
|
|
595289
595328
|
buffer += decoder.decode(value, { stream: true });
|
|
595290
595329
|
const lines2 = buffer.split(`
|
|
595291
595330
|
`);
|
|
@@ -595525,8 +595564,17 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
|
|
|
595525
595564
|
}
|
|
595526
595565
|
}
|
|
595527
595566
|
} finally {
|
|
595567
|
+
if (watchdogTimer)
|
|
595568
|
+
clearTimeout(watchdogTimer);
|
|
595528
595569
|
reader.releaseLock();
|
|
595529
595570
|
}
|
|
595571
|
+
if (watchdogController.signal.aborted) {
|
|
595572
|
+
yield createAssistantAPIErrorMessage({
|
|
595573
|
+
content: `Stream timed out — no data received for ${STREAM_WATCHDOG_MS / 1000} seconds. The server may be overloaded. Please try again.`,
|
|
595574
|
+
error: "unknown"
|
|
595575
|
+
});
|
|
595576
|
+
return;
|
|
595577
|
+
}
|
|
595530
595578
|
if (pendingAnnotations.size > 0) {
|
|
595531
595579
|
for (const [outputIdx, annotations] of pendingAnnotations) {
|
|
595532
595580
|
const blockIdx = findBlockIndex(contentBlocks, outputIdx, "text", textState, functionCallState, reasoningState);
|
|
@@ -595636,7 +595684,7 @@ async function queryModelOpenAINonStreaming(messages, systemPrompt, thinkingConf
|
|
|
595636
595684
|
}
|
|
595637
595685
|
return result;
|
|
595638
595686
|
}
|
|
595639
|
-
var OPENAI_MODEL_MAP, MAX_OUTPUT_TOKENS, _lastResponseId = null;
|
|
595687
|
+
var OPENAI_MODEL_MAP, MAX_OUTPUT_TOKENS, _lastResponseId = null, _auth401RetryInProgress = false;
|
|
595640
595688
|
var init_openai_query = __esm(() => {
|
|
595641
595689
|
init_messages7();
|
|
595642
595690
|
init_debug();
|
|
@@ -679360,7 +679408,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
679360
679408
|
var call56 = async () => {
|
|
679361
679409
|
return {
|
|
679362
679410
|
type: "text",
|
|
679363
|
-
value: `${"2.1.88-rebuild"} (built ${"2026-04-01T09:
|
|
679411
|
+
value: `${"2.1.88-rebuild"} (built ${"2026-04-01T09:59:26.964Z"})`
|
|
679364
679412
|
};
|
|
679365
679413
|
}, version6, version_default;
|
|
679366
679414
|
var init_version = __esm(() => {
|
|
@@ -741119,10 +741167,25 @@ var init_useDeferredHookMessages = __esm(() => {
|
|
|
741119
741167
|
});
|
|
741120
741168
|
|
|
741121
741169
|
// src/hooks/useApiKeyVerification.ts
|
|
741170
|
+
import { existsSync as existsSync12, readFileSync as readFileSync20 } from "fs";
|
|
741171
|
+
import { join as join147 } from "path";
|
|
741172
|
+
function hasOpenAIAuth() {
|
|
741173
|
+
if (process.env.OPENAI_API_KEY)
|
|
741174
|
+
return true;
|
|
741175
|
+
try {
|
|
741176
|
+
const tokenPath = join147(getClaudeConfigHomeDir(), ".openai-oauth.json");
|
|
741177
|
+
if (!existsSync12(tokenPath))
|
|
741178
|
+
return false;
|
|
741179
|
+
const data = JSON.parse(readFileSync20(tokenPath, "utf-8"));
|
|
741180
|
+
return !!data.access_token;
|
|
741181
|
+
} catch {
|
|
741182
|
+
return false;
|
|
741183
|
+
}
|
|
741184
|
+
}
|
|
741122
741185
|
function useApiKeyVerification() {
|
|
741123
741186
|
const [status2, setStatus] = import_react383.useState(() => {
|
|
741124
741187
|
if (getAPIProvider() === "openai") {
|
|
741125
|
-
return
|
|
741188
|
+
return hasOpenAIAuth() ? "loading" : "missing";
|
|
741126
741189
|
}
|
|
741127
741190
|
if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
|
|
741128
741191
|
return "valid";
|
|
@@ -741138,7 +741201,16 @@ function useApiKeyVerification() {
|
|
|
741138
741201
|
const [error42, setError] = import_react383.useState(null);
|
|
741139
741202
|
const verify = import_react383.useCallback(async () => {
|
|
741140
741203
|
if (getAPIProvider() === "openai") {
|
|
741141
|
-
|
|
741204
|
+
if (!hasOpenAIAuth()) {
|
|
741205
|
+
setStatus("missing");
|
|
741206
|
+
return;
|
|
741207
|
+
}
|
|
741208
|
+
try {
|
|
741209
|
+
const isValid2 = await verifyApiKey("", false);
|
|
741210
|
+
setStatus(isValid2 ? "valid" : "invalid");
|
|
741211
|
+
} catch {
|
|
741212
|
+
setStatus("error");
|
|
741213
|
+
}
|
|
741142
741214
|
return;
|
|
741143
741215
|
}
|
|
741144
741216
|
if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
|
|
@@ -741180,6 +741252,7 @@ var init_useApiKeyVerification = __esm(() => {
|
|
|
741180
741252
|
init_state();
|
|
741181
741253
|
init_claude();
|
|
741182
741254
|
init_auth2();
|
|
741255
|
+
init_envUtils();
|
|
741183
741256
|
init_providers();
|
|
741184
741257
|
import_react383 = __toESM(require_react(), 1);
|
|
741185
741258
|
});
|
|
@@ -744129,7 +744202,7 @@ __export(exports_asciicast, {
|
|
|
744129
744202
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
744130
744203
|
});
|
|
744131
744204
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
744132
|
-
import { basename as basename57, dirname as dirname59, join as
|
|
744205
|
+
import { basename as basename57, dirname as dirname59, join as join149 } from "path";
|
|
744133
744206
|
function getRecordFilePath() {
|
|
744134
744207
|
if (recordingState.filePath !== null) {
|
|
744135
744208
|
return recordingState.filePath;
|
|
@@ -744140,10 +744213,10 @@ function getRecordFilePath() {
|
|
|
744140
744213
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
|
|
744141
744214
|
return null;
|
|
744142
744215
|
}
|
|
744143
|
-
const projectsDir =
|
|
744144
|
-
const projectDir =
|
|
744216
|
+
const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
|
|
744217
|
+
const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
744145
744218
|
recordingState.timestamp = Date.now();
|
|
744146
|
-
recordingState.filePath =
|
|
744219
|
+
recordingState.filePath = join149(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
744147
744220
|
return recordingState.filePath;
|
|
744148
744221
|
}
|
|
744149
744222
|
function _resetRecordingStateForTesting() {
|
|
@@ -744152,13 +744225,13 @@ function _resetRecordingStateForTesting() {
|
|
|
744152
744225
|
}
|
|
744153
744226
|
function getSessionRecordingPaths() {
|
|
744154
744227
|
const sessionId = getSessionId();
|
|
744155
|
-
const projectsDir =
|
|
744156
|
-
const projectDir =
|
|
744228
|
+
const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
|
|
744229
|
+
const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
744157
744230
|
try {
|
|
744158
744231
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
744159
744232
|
const names = typeof entries[0] === "string" ? entries : entries.map((e2) => e2.name);
|
|
744160
744233
|
const files3 = names.filter((f2) => f2.startsWith(sessionId) && f2.endsWith(".cast")).sort();
|
|
744161
|
-
return files3.map((f2) =>
|
|
744234
|
+
return files3.map((f2) => join149(projectDir, f2));
|
|
744162
744235
|
} catch {
|
|
744163
744236
|
return [];
|
|
744164
744237
|
}
|
|
@@ -744168,9 +744241,9 @@ async function renameRecordingForSession() {
|
|
|
744168
744241
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
744169
744242
|
return;
|
|
744170
744243
|
}
|
|
744171
|
-
const projectsDir =
|
|
744172
|
-
const projectDir =
|
|
744173
|
-
const newPath =
|
|
744244
|
+
const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
|
|
744245
|
+
const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
744246
|
+
const newPath = join149(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
744174
744247
|
if (oldPath === newPath) {
|
|
744175
744248
|
return;
|
|
744176
744249
|
}
|
|
@@ -746933,7 +747006,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
746933
747006
|
});
|
|
746934
747007
|
|
|
746935
747008
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
746936
|
-
import { join as
|
|
747009
|
+
import { join as join150 } from "path";
|
|
746937
747010
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
746938
747011
|
return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
746939
747012
|
}
|
|
@@ -747016,7 +747089,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
747016
747089
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
747017
747090
|
}
|
|
747018
747091
|
const cacheDir = getMarketplacesCacheDir();
|
|
747019
|
-
const installLocation =
|
|
747092
|
+
const installLocation = join150(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
747020
747093
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
747021
747094
|
if (gcsSha !== null) {
|
|
747022
747095
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -749888,7 +749961,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
749888
749961
|
});
|
|
749889
749962
|
|
|
749890
749963
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
749891
|
-
import { extname as extname15, join as
|
|
749964
|
+
import { extname as extname15, join as join151 } from "path";
|
|
749892
749965
|
function useLspPluginRecommendation() {
|
|
749893
749966
|
const $4 = import_react_compiler_runtime356.c(12);
|
|
749894
749967
|
const trackedFiles = useAppState(_temp224);
|
|
@@ -749973,7 +750046,7 @@ function useLspPluginRecommendation() {
|
|
|
749973
750046
|
case "yes": {
|
|
749974
750047
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
749975
750048
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
749976
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
750049
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join151(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
749977
750050
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
749978
750051
|
const settings = getSettingsForSource("userSettings");
|
|
749979
750052
|
updateSettingsForSource("userSettings", {
|
|
@@ -752628,7 +752701,7 @@ var exports_REPL = {};
|
|
|
752628
752701
|
__export(exports_REPL, {
|
|
752629
752702
|
REPL: () => REPL
|
|
752630
752703
|
});
|
|
752631
|
-
import { dirname as dirname61, join as
|
|
752704
|
+
import { dirname as dirname61, join as join152 } from "path";
|
|
752632
752705
|
import { tmpdir as tmpdir14 } from "os";
|
|
752633
752706
|
import { writeFile as writeFile46 } from "fs/promises";
|
|
752634
752707
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
@@ -755111,7 +755184,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.
|
|
|
755111
755184
|
const w3 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
755112
755185
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w3);
|
|
755113
755186
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
755114
|
-
const path27 =
|
|
755187
|
+
const path27 = join152(tmpdir14(), `cc-transcript-${Date.now()}.txt`);
|
|
755115
755188
|
await writeFile46(path27, text2);
|
|
755116
755189
|
const opened = openFileInExternalEditor(path27);
|
|
755117
755190
|
setStatus(opened ? `opening ${path27}` : `wrote ${path27} · no $VISUAL/$EDITOR set`);
|
|
@@ -762792,12 +762865,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
762792
762865
|
});
|
|
762793
762866
|
|
|
762794
762867
|
// src/utils/errorLogSink.ts
|
|
762795
|
-
import { dirname as dirname63, join as
|
|
762868
|
+
import { dirname as dirname63, join as join153 } from "path";
|
|
762796
762869
|
function getErrorsPath() {
|
|
762797
|
-
return
|
|
762870
|
+
return join153(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
762798
762871
|
}
|
|
762799
762872
|
function getMCPLogsPath(serverName) {
|
|
762800
|
-
return
|
|
762873
|
+
return join153(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
762801
762874
|
}
|
|
762802
762875
|
function createJsonlWriter(options) {
|
|
762803
762876
|
const writer = createBufferedWriter(options);
|
|
@@ -763140,7 +763213,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
763140
763213
|
// src/utils/iTermBackup.ts
|
|
763141
763214
|
import { copyFile as copyFile12, stat as stat49 } from "fs/promises";
|
|
763142
763215
|
import { homedir as homedir39 } from "os";
|
|
763143
|
-
import { join as
|
|
763216
|
+
import { join as join154 } from "path";
|
|
763144
763217
|
function markITerm2SetupComplete() {
|
|
763145
763218
|
saveGlobalConfig((current) => ({
|
|
763146
763219
|
...current,
|
|
@@ -763155,7 +763228,7 @@ function getIterm2RecoveryInfo() {
|
|
|
763155
763228
|
};
|
|
763156
763229
|
}
|
|
763157
763230
|
function getITerm2PlistPath() {
|
|
763158
|
-
return
|
|
763231
|
+
return join154(homedir39(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
763159
763232
|
}
|
|
763160
763233
|
async function checkAndRestoreITerm2Backup() {
|
|
763161
763234
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -766520,7 +766593,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
766520
766593
|
// src/bridge/inboundAttachments.ts
|
|
766521
766594
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
766522
766595
|
import { mkdir as mkdir43, writeFile as writeFile48 } from "fs/promises";
|
|
766523
|
-
import { basename as basename58, join as
|
|
766596
|
+
import { basename as basename58, join as join155 } from "path";
|
|
766524
766597
|
function debug4(msg) {
|
|
766525
766598
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
766526
766599
|
}
|
|
@@ -766536,7 +766609,7 @@ function sanitizeFileName(name3) {
|
|
|
766536
766609
|
return base2 || "attachment";
|
|
766537
766610
|
}
|
|
766538
766611
|
function uploadsDir() {
|
|
766539
|
-
return
|
|
766612
|
+
return join155(getClaudeConfigHomeDir(), "uploads", getSessionId());
|
|
766540
766613
|
}
|
|
766541
766614
|
async function resolveOne(att) {
|
|
766542
766615
|
const token = getBridgeAccessToken();
|
|
@@ -766565,7 +766638,7 @@ async function resolveOne(att) {
|
|
|
766565
766638
|
const safeName = sanitizeFileName(att.file_name);
|
|
766566
766639
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
766567
766640
|
const dir = uploadsDir();
|
|
766568
|
-
const outPath =
|
|
766641
|
+
const outPath = join155(dir, `${prefix}-${safeName}`);
|
|
766569
766642
|
try {
|
|
766570
766643
|
await mkdir43(dir, { recursive: true });
|
|
766571
766644
|
await writeFile48(outPath, data);
|
|
@@ -766665,7 +766738,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
766665
766738
|
|
|
766666
766739
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
766667
766740
|
import { readFile as readFile55 } from "fs/promises";
|
|
766668
|
-
import { join as
|
|
766741
|
+
import { join as join156 } from "path";
|
|
766669
766742
|
async function readZipCacheKnownMarketplaces() {
|
|
766670
766743
|
try {
|
|
766671
766744
|
const content = await readFile55(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -766690,13 +766763,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
766690
766763
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
766691
766764
|
if (content !== null) {
|
|
766692
766765
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
766693
|
-
await atomicWriteToZipCache(
|
|
766766
|
+
await atomicWriteToZipCache(join156(zipCachePath, relPath), content);
|
|
766694
766767
|
}
|
|
766695
766768
|
}
|
|
766696
766769
|
async function readMarketplaceJsonContent(dir) {
|
|
766697
766770
|
const candidates = [
|
|
766698
|
-
|
|
766699
|
-
|
|
766771
|
+
join156(dir, ".claude-plugin", "marketplace.json"),
|
|
766772
|
+
join156(dir, "marketplace.json"),
|
|
766700
766773
|
dir
|
|
766701
766774
|
];
|
|
766702
766775
|
for (const candidate of candidates) {
|
|
@@ -767155,9 +767228,9 @@ __export(exports_bridgePointer, {
|
|
|
767155
767228
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
767156
767229
|
});
|
|
767157
767230
|
import { mkdir as mkdir44, readFile as readFile56, stat as stat50, unlink as unlink25, writeFile as writeFile49 } from "fs/promises";
|
|
767158
|
-
import { dirname as dirname64, join as
|
|
767231
|
+
import { dirname as dirname64, join as join157 } from "path";
|
|
767159
767232
|
function getBridgePointerPath(dir) {
|
|
767160
|
-
return
|
|
767233
|
+
return join157(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
767161
767234
|
}
|
|
767162
767235
|
async function writeBridgePointer(dir, pointer) {
|
|
767163
767236
|
const path27 = getBridgePointerPath(dir);
|
|
@@ -773055,14 +773128,14 @@ __export(exports_claudeDesktop, {
|
|
|
773055
773128
|
});
|
|
773056
773129
|
import { readdir as readdir31, readFile as readFile58, stat as stat52 } from "fs/promises";
|
|
773057
773130
|
import { homedir as homedir40 } from "os";
|
|
773058
|
-
import { join as
|
|
773131
|
+
import { join as join158 } from "path";
|
|
773059
773132
|
async function getClaudeDesktopConfigPath() {
|
|
773060
773133
|
const platform7 = getPlatform();
|
|
773061
773134
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
773062
773135
|
throw new Error(`Unsupported platform: ${platform7} - Claude Desktop integration only works on macOS and WSL.`);
|
|
773063
773136
|
}
|
|
773064
773137
|
if (platform7 === "macos") {
|
|
773065
|
-
return
|
|
773138
|
+
return join158(homedir40(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
773066
773139
|
}
|
|
773067
773140
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
773068
773141
|
if (windowsHome) {
|
|
@@ -773081,7 +773154,7 @@ async function getClaudeDesktopConfigPath() {
|
|
|
773081
773154
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
773082
773155
|
continue;
|
|
773083
773156
|
}
|
|
773084
|
-
const potentialConfigPath =
|
|
773157
|
+
const potentialConfigPath = join158(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json");
|
|
773085
773158
|
try {
|
|
773086
773159
|
await stat52(potentialConfigPath);
|
|
773087
773160
|
return potentialConfigPath;
|
|
@@ -773986,12 +774059,12 @@ __export(exports_install, {
|
|
|
773986
774059
|
install: () => install
|
|
773987
774060
|
});
|
|
773988
774061
|
import { homedir as homedir41 } from "node:os";
|
|
773989
|
-
import { join as
|
|
774062
|
+
import { join as join159 } from "node:path";
|
|
773990
774063
|
function getInstallationPath2() {
|
|
773991
774064
|
const isWindows3 = env4.platform === "win32";
|
|
773992
774065
|
const homeDir = homedir41();
|
|
773993
774066
|
if (isWindows3) {
|
|
773994
|
-
const windowsPath =
|
|
774067
|
+
const windowsPath = join159(homeDir, ".local", "bin", "claude.exe");
|
|
773995
774068
|
return windowsPath.replace(/\//g, "\\");
|
|
773996
774069
|
}
|
|
773997
774070
|
return "~/.local/bin/claude";
|
|
@@ -774778,7 +774851,7 @@ __export(exports_main, {
|
|
|
774778
774851
|
startDeferredPrefetches: () => startDeferredPrefetches,
|
|
774779
774852
|
main: () => main
|
|
774780
774853
|
});
|
|
774781
|
-
import { readFileSync as
|
|
774854
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
774782
774855
|
import { resolve as resolve46 } from "path";
|
|
774783
774856
|
function logManagedSettings() {
|
|
774784
774857
|
try {
|
|
@@ -774934,7 +775007,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
774934
775007
|
resolvedPath: resolvedSettingsPath
|
|
774935
775008
|
} = safeResolvePath(getFsImplementation(), settingsFile);
|
|
774936
775009
|
try {
|
|
774937
|
-
|
|
775010
|
+
readFileSync21(resolvedSettingsPath, "utf8");
|
|
774938
775011
|
} catch (e2) {
|
|
774939
775012
|
if (isENOENT(e2)) {
|
|
774940
775013
|
process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
|
|
@@ -775339,7 +775412,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
775339
775412
|
}
|
|
775340
775413
|
try {
|
|
775341
775414
|
const filePath = resolve46(options.systemPromptFile);
|
|
775342
|
-
systemPrompt =
|
|
775415
|
+
systemPrompt = readFileSync21(filePath, "utf8");
|
|
775343
775416
|
} catch (error42) {
|
|
775344
775417
|
const code = getErrnoCode(error42);
|
|
775345
775418
|
if (code === "ENOENT") {
|
|
@@ -775361,7 +775434,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
775361
775434
|
}
|
|
775362
775435
|
try {
|
|
775363
775436
|
const filePath = resolve46(options.appendSystemPromptFile);
|
|
775364
|
-
appendSystemPrompt =
|
|
775437
|
+
appendSystemPrompt = readFileSync21(filePath, "utf8");
|
|
775365
775438
|
} catch (error42) {
|
|
775366
775439
|
const code = getErrnoCode(error42);
|
|
775367
775440
|
if (code === "ENOENT") {
|
|
@@ -777340,4 +777413,4 @@ async function main2() {
|
|
|
777340
777413
|
}
|
|
777341
777414
|
main2();
|
|
777342
777415
|
|
|
777343
|
-
//# debugId=
|
|
777416
|
+
//# debugId=F1DED8B8A2869D0864756E2164756E21
|