claude-code-openai 0.1.7 → 0.1.9
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 +116 -70
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -186080,18 +186080,27 @@ function clearOpenAITokens() {
|
|
|
186080
186080
|
}
|
|
186081
186081
|
async function refreshOpenAIToken(refreshToken) {
|
|
186082
186082
|
logForDebugging("[OpenAI OAuth] Refreshing token...");
|
|
186083
|
-
const
|
|
186084
|
-
|
|
186085
|
-
|
|
186086
|
-
|
|
186087
|
-
|
|
186088
|
-
|
|
186089
|
-
|
|
186090
|
-
|
|
186091
|
-
|
|
186092
|
-
|
|
186083
|
+
const controller = new AbortController;
|
|
186084
|
+
const timer = setTimeout(() => controller.abort(), 15000);
|
|
186085
|
+
let response;
|
|
186086
|
+
try {
|
|
186087
|
+
response = await fetch(OPENAI_OAUTH_CONFIG.TOKEN_URL, {
|
|
186088
|
+
method: "POST",
|
|
186089
|
+
headers: { "Content-Type": "application/json" },
|
|
186090
|
+
body: JSON.stringify({
|
|
186091
|
+
grant_type: "refresh_token",
|
|
186092
|
+
refresh_token: refreshToken,
|
|
186093
|
+
client_id: OPENAI_OAUTH_CONFIG.CLIENT_ID
|
|
186094
|
+
}),
|
|
186095
|
+
signal: controller.signal
|
|
186096
|
+
});
|
|
186097
|
+
} finally {
|
|
186098
|
+
clearTimeout(timer);
|
|
186093
186099
|
}
|
|
186094
|
-
|
|
186100
|
+
if (!response.ok) {
|
|
186101
|
+
throw new Error(`OpenAI token refresh failed: ${response.status} ${response.statusText}`);
|
|
186102
|
+
}
|
|
186103
|
+
const data = await response.json();
|
|
186095
186104
|
const tokens = {
|
|
186096
186105
|
access_token: data.access_token,
|
|
186097
186106
|
refresh_token: data.refresh_token || refreshToken,
|
|
@@ -186162,20 +186171,29 @@ async function startOpenAIOAuthFlow(options) {
|
|
|
186162
186171
|
`);
|
|
186163
186172
|
});
|
|
186164
186173
|
logForDebugging("[OpenAI OAuth] Exchanging authorization code for tokens...");
|
|
186165
|
-
const
|
|
186166
|
-
|
|
186167
|
-
|
|
186168
|
-
|
|
186169
|
-
|
|
186170
|
-
|
|
186171
|
-
|
|
186172
|
-
|
|
186173
|
-
|
|
186174
|
-
|
|
186175
|
-
|
|
186176
|
-
|
|
186174
|
+
const tokenController = new AbortController;
|
|
186175
|
+
const tokenTimer = setTimeout(() => tokenController.abort(), 15000);
|
|
186176
|
+
let tokenResponse;
|
|
186177
|
+
try {
|
|
186178
|
+
tokenResponse = await fetch(OPENAI_OAUTH_CONFIG.TOKEN_URL, {
|
|
186179
|
+
method: "POST",
|
|
186180
|
+
headers: { "Content-Type": "application/json" },
|
|
186181
|
+
body: JSON.stringify({
|
|
186182
|
+
grant_type: "authorization_code",
|
|
186183
|
+
code: authorizationCode,
|
|
186184
|
+
redirect_uri: redirectUri,
|
|
186185
|
+
client_id: OPENAI_OAUTH_CONFIG.CLIENT_ID,
|
|
186186
|
+
code_verifier: codeVerifier
|
|
186187
|
+
}),
|
|
186188
|
+
signal: tokenController.signal
|
|
186189
|
+
});
|
|
186190
|
+
} finally {
|
|
186191
|
+
clearTimeout(tokenTimer);
|
|
186177
186192
|
}
|
|
186178
|
-
|
|
186193
|
+
if (!tokenResponse.ok) {
|
|
186194
|
+
throw new Error(`Token exchange failed: ${tokenResponse.status} ${tokenResponse.statusText}`);
|
|
186195
|
+
}
|
|
186196
|
+
const data = await tokenResponse.json();
|
|
186179
186197
|
const tokens = {
|
|
186180
186198
|
access_token: data.access_token,
|
|
186181
186199
|
refresh_token: data.refresh_token || null,
|
|
@@ -186191,7 +186209,6 @@ async function startOpenAIOAuthFlow(options) {
|
|
|
186191
186209
|
}
|
|
186192
186210
|
var OPENAI_OAUTH_CONFIG;
|
|
186193
186211
|
var init_openai_oauth = __esm(() => {
|
|
186194
|
-
init_axios2();
|
|
186195
186212
|
init_browser();
|
|
186196
186213
|
init_envUtils();
|
|
186197
186214
|
init_debug();
|
|
@@ -204586,7 +204603,7 @@ var init_metadata = __esm(() => {
|
|
|
204586
204603
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
204587
204604
|
version: "2.1.88-rebuild",
|
|
204588
204605
|
versionBase: getVersionBase(),
|
|
204589
|
-
buildTime: "2026-04-01T09:
|
|
204606
|
+
buildTime: "2026-04-01T09:46:44.490Z",
|
|
204590
204607
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
204591
204608
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
204592
204609
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -520909,6 +520926,10 @@ function OpenAIOAuthFlow({ onDone }) {
|
|
|
520909
520926
|
logForDebugging(`[OpenAI OAuth] Flow error: ${message}`);
|
|
520910
520927
|
if (!cancelled) {
|
|
520911
520928
|
setFlowState({ state: "error", message });
|
|
520929
|
+
setTimeout(() => {
|
|
520930
|
+
if (!cancelled)
|
|
520931
|
+
onDone(false);
|
|
520932
|
+
}, 3000);
|
|
520912
520933
|
}
|
|
520913
520934
|
}
|
|
520914
520935
|
}
|
|
@@ -592868,7 +592889,7 @@ function getAnthropicEnvMetadata() {
|
|
|
592868
592889
|
function getBuildAgeMinutes() {
|
|
592869
592890
|
if (false)
|
|
592870
592891
|
;
|
|
592871
|
-
const buildTime = new Date("2026-04-01T09:
|
|
592892
|
+
const buildTime = new Date("2026-04-01T09:46:44.490Z").getTime();
|
|
592872
592893
|
if (isNaN(buildTime))
|
|
592873
592894
|
return;
|
|
592874
592895
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -679339,7 +679360,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
679339
679360
|
var call56 = async () => {
|
|
679340
679361
|
return {
|
|
679341
679362
|
type: "text",
|
|
679342
|
-
value: `${"2.1.88-rebuild"} (built ${"2026-04-01T09:
|
|
679363
|
+
value: `${"2.1.88-rebuild"} (built ${"2026-04-01T09:46:44.490Z"})`
|
|
679343
679364
|
};
|
|
679344
679365
|
}, version6, version_default;
|
|
679345
679366
|
var init_version = __esm(() => {
|
|
@@ -741098,10 +741119,25 @@ var init_useDeferredHookMessages = __esm(() => {
|
|
|
741098
741119
|
});
|
|
741099
741120
|
|
|
741100
741121
|
// src/hooks/useApiKeyVerification.ts
|
|
741122
|
+
import { existsSync as existsSync12, readFileSync as readFileSync20 } from "fs";
|
|
741123
|
+
import { join as join147 } from "path";
|
|
741124
|
+
function hasOpenAIAuth() {
|
|
741125
|
+
if (process.env.OPENAI_API_KEY)
|
|
741126
|
+
return true;
|
|
741127
|
+
try {
|
|
741128
|
+
const tokenPath = join147(getClaudeConfigHomeDir(), ".openai-oauth.json");
|
|
741129
|
+
if (!existsSync12(tokenPath))
|
|
741130
|
+
return false;
|
|
741131
|
+
const data = JSON.parse(readFileSync20(tokenPath, "utf-8"));
|
|
741132
|
+
return !!data.access_token;
|
|
741133
|
+
} catch {
|
|
741134
|
+
return false;
|
|
741135
|
+
}
|
|
741136
|
+
}
|
|
741101
741137
|
function useApiKeyVerification() {
|
|
741102
741138
|
const [status2, setStatus] = import_react383.useState(() => {
|
|
741103
741139
|
if (getAPIProvider() === "openai") {
|
|
741104
|
-
return
|
|
741140
|
+
return hasOpenAIAuth() ? "loading" : "missing";
|
|
741105
741141
|
}
|
|
741106
741142
|
if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
|
|
741107
741143
|
return "valid";
|
|
@@ -741117,7 +741153,16 @@ function useApiKeyVerification() {
|
|
|
741117
741153
|
const [error42, setError] = import_react383.useState(null);
|
|
741118
741154
|
const verify = import_react383.useCallback(async () => {
|
|
741119
741155
|
if (getAPIProvider() === "openai") {
|
|
741120
|
-
|
|
741156
|
+
if (!hasOpenAIAuth()) {
|
|
741157
|
+
setStatus("missing");
|
|
741158
|
+
return;
|
|
741159
|
+
}
|
|
741160
|
+
try {
|
|
741161
|
+
const isValid2 = await verifyApiKey("", false);
|
|
741162
|
+
setStatus(isValid2 ? "valid" : "invalid");
|
|
741163
|
+
} catch {
|
|
741164
|
+
setStatus("error");
|
|
741165
|
+
}
|
|
741121
741166
|
return;
|
|
741122
741167
|
}
|
|
741123
741168
|
if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
|
|
@@ -741159,6 +741204,7 @@ var init_useApiKeyVerification = __esm(() => {
|
|
|
741159
741204
|
init_state();
|
|
741160
741205
|
init_claude();
|
|
741161
741206
|
init_auth2();
|
|
741207
|
+
init_envUtils();
|
|
741162
741208
|
init_providers();
|
|
741163
741209
|
import_react383 = __toESM(require_react(), 1);
|
|
741164
741210
|
});
|
|
@@ -744108,7 +744154,7 @@ __export(exports_asciicast, {
|
|
|
744108
744154
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
744109
744155
|
});
|
|
744110
744156
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
744111
|
-
import { basename as basename57, dirname as dirname59, join as
|
|
744157
|
+
import { basename as basename57, dirname as dirname59, join as join149 } from "path";
|
|
744112
744158
|
function getRecordFilePath() {
|
|
744113
744159
|
if (recordingState.filePath !== null) {
|
|
744114
744160
|
return recordingState.filePath;
|
|
@@ -744119,10 +744165,10 @@ function getRecordFilePath() {
|
|
|
744119
744165
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
|
|
744120
744166
|
return null;
|
|
744121
744167
|
}
|
|
744122
|
-
const projectsDir =
|
|
744123
|
-
const projectDir =
|
|
744168
|
+
const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
|
|
744169
|
+
const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
744124
744170
|
recordingState.timestamp = Date.now();
|
|
744125
|
-
recordingState.filePath =
|
|
744171
|
+
recordingState.filePath = join149(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
744126
744172
|
return recordingState.filePath;
|
|
744127
744173
|
}
|
|
744128
744174
|
function _resetRecordingStateForTesting() {
|
|
@@ -744131,13 +744177,13 @@ function _resetRecordingStateForTesting() {
|
|
|
744131
744177
|
}
|
|
744132
744178
|
function getSessionRecordingPaths() {
|
|
744133
744179
|
const sessionId = getSessionId();
|
|
744134
|
-
const projectsDir =
|
|
744135
|
-
const projectDir =
|
|
744180
|
+
const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
|
|
744181
|
+
const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
744136
744182
|
try {
|
|
744137
744183
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
744138
744184
|
const names = typeof entries[0] === "string" ? entries : entries.map((e2) => e2.name);
|
|
744139
744185
|
const files3 = names.filter((f2) => f2.startsWith(sessionId) && f2.endsWith(".cast")).sort();
|
|
744140
|
-
return files3.map((f2) =>
|
|
744186
|
+
return files3.map((f2) => join149(projectDir, f2));
|
|
744141
744187
|
} catch {
|
|
744142
744188
|
return [];
|
|
744143
744189
|
}
|
|
@@ -744147,9 +744193,9 @@ async function renameRecordingForSession() {
|
|
|
744147
744193
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
744148
744194
|
return;
|
|
744149
744195
|
}
|
|
744150
|
-
const projectsDir =
|
|
744151
|
-
const projectDir =
|
|
744152
|
-
const newPath =
|
|
744196
|
+
const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
|
|
744197
|
+
const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
744198
|
+
const newPath = join149(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
744153
744199
|
if (oldPath === newPath) {
|
|
744154
744200
|
return;
|
|
744155
744201
|
}
|
|
@@ -746912,7 +746958,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
746912
746958
|
});
|
|
746913
746959
|
|
|
746914
746960
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
746915
|
-
import { join as
|
|
746961
|
+
import { join as join150 } from "path";
|
|
746916
746962
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
746917
746963
|
return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
746918
746964
|
}
|
|
@@ -746995,7 +747041,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
746995
747041
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
746996
747042
|
}
|
|
746997
747043
|
const cacheDir = getMarketplacesCacheDir();
|
|
746998
|
-
const installLocation =
|
|
747044
|
+
const installLocation = join150(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
746999
747045
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
747000
747046
|
if (gcsSha !== null) {
|
|
747001
747047
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -749867,7 +749913,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
749867
749913
|
});
|
|
749868
749914
|
|
|
749869
749915
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
749870
|
-
import { extname as extname15, join as
|
|
749916
|
+
import { extname as extname15, join as join151 } from "path";
|
|
749871
749917
|
function useLspPluginRecommendation() {
|
|
749872
749918
|
const $4 = import_react_compiler_runtime356.c(12);
|
|
749873
749919
|
const trackedFiles = useAppState(_temp224);
|
|
@@ -749952,7 +749998,7 @@ function useLspPluginRecommendation() {
|
|
|
749952
749998
|
case "yes": {
|
|
749953
749999
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
749954
750000
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
749955
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
750001
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join151(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
749956
750002
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
749957
750003
|
const settings = getSettingsForSource("userSettings");
|
|
749958
750004
|
updateSettingsForSource("userSettings", {
|
|
@@ -752607,7 +752653,7 @@ var exports_REPL = {};
|
|
|
752607
752653
|
__export(exports_REPL, {
|
|
752608
752654
|
REPL: () => REPL
|
|
752609
752655
|
});
|
|
752610
|
-
import { dirname as dirname61, join as
|
|
752656
|
+
import { dirname as dirname61, join as join152 } from "path";
|
|
752611
752657
|
import { tmpdir as tmpdir14 } from "os";
|
|
752612
752658
|
import { writeFile as writeFile46 } from "fs/promises";
|
|
752613
752659
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
@@ -755090,7 +755136,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.
|
|
|
755090
755136
|
const w3 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
755091
755137
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w3);
|
|
755092
755138
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
755093
|
-
const path27 =
|
|
755139
|
+
const path27 = join152(tmpdir14(), `cc-transcript-${Date.now()}.txt`);
|
|
755094
755140
|
await writeFile46(path27, text2);
|
|
755095
755141
|
const opened = openFileInExternalEditor(path27);
|
|
755096
755142
|
setStatus(opened ? `opening ${path27}` : `wrote ${path27} · no $VISUAL/$EDITOR set`);
|
|
@@ -762771,12 +762817,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
762771
762817
|
});
|
|
762772
762818
|
|
|
762773
762819
|
// src/utils/errorLogSink.ts
|
|
762774
|
-
import { dirname as dirname63, join as
|
|
762820
|
+
import { dirname as dirname63, join as join153 } from "path";
|
|
762775
762821
|
function getErrorsPath() {
|
|
762776
|
-
return
|
|
762822
|
+
return join153(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
762777
762823
|
}
|
|
762778
762824
|
function getMCPLogsPath(serverName) {
|
|
762779
|
-
return
|
|
762825
|
+
return join153(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
762780
762826
|
}
|
|
762781
762827
|
function createJsonlWriter(options) {
|
|
762782
762828
|
const writer = createBufferedWriter(options);
|
|
@@ -763119,7 +763165,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
763119
763165
|
// src/utils/iTermBackup.ts
|
|
763120
763166
|
import { copyFile as copyFile12, stat as stat49 } from "fs/promises";
|
|
763121
763167
|
import { homedir as homedir39 } from "os";
|
|
763122
|
-
import { join as
|
|
763168
|
+
import { join as join154 } from "path";
|
|
763123
763169
|
function markITerm2SetupComplete() {
|
|
763124
763170
|
saveGlobalConfig((current) => ({
|
|
763125
763171
|
...current,
|
|
@@ -763134,7 +763180,7 @@ function getIterm2RecoveryInfo() {
|
|
|
763134
763180
|
};
|
|
763135
763181
|
}
|
|
763136
763182
|
function getITerm2PlistPath() {
|
|
763137
|
-
return
|
|
763183
|
+
return join154(homedir39(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
763138
763184
|
}
|
|
763139
763185
|
async function checkAndRestoreITerm2Backup() {
|
|
763140
763186
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -766499,7 +766545,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
766499
766545
|
// src/bridge/inboundAttachments.ts
|
|
766500
766546
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
766501
766547
|
import { mkdir as mkdir43, writeFile as writeFile48 } from "fs/promises";
|
|
766502
|
-
import { basename as basename58, join as
|
|
766548
|
+
import { basename as basename58, join as join155 } from "path";
|
|
766503
766549
|
function debug4(msg) {
|
|
766504
766550
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
766505
766551
|
}
|
|
@@ -766515,7 +766561,7 @@ function sanitizeFileName(name3) {
|
|
|
766515
766561
|
return base2 || "attachment";
|
|
766516
766562
|
}
|
|
766517
766563
|
function uploadsDir() {
|
|
766518
|
-
return
|
|
766564
|
+
return join155(getClaudeConfigHomeDir(), "uploads", getSessionId());
|
|
766519
766565
|
}
|
|
766520
766566
|
async function resolveOne(att) {
|
|
766521
766567
|
const token = getBridgeAccessToken();
|
|
@@ -766544,7 +766590,7 @@ async function resolveOne(att) {
|
|
|
766544
766590
|
const safeName = sanitizeFileName(att.file_name);
|
|
766545
766591
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
766546
766592
|
const dir = uploadsDir();
|
|
766547
|
-
const outPath =
|
|
766593
|
+
const outPath = join155(dir, `${prefix}-${safeName}`);
|
|
766548
766594
|
try {
|
|
766549
766595
|
await mkdir43(dir, { recursive: true });
|
|
766550
766596
|
await writeFile48(outPath, data);
|
|
@@ -766644,7 +766690,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
766644
766690
|
|
|
766645
766691
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
766646
766692
|
import { readFile as readFile55 } from "fs/promises";
|
|
766647
|
-
import { join as
|
|
766693
|
+
import { join as join156 } from "path";
|
|
766648
766694
|
async function readZipCacheKnownMarketplaces() {
|
|
766649
766695
|
try {
|
|
766650
766696
|
const content = await readFile55(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -766669,13 +766715,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
766669
766715
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
766670
766716
|
if (content !== null) {
|
|
766671
766717
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
766672
|
-
await atomicWriteToZipCache(
|
|
766718
|
+
await atomicWriteToZipCache(join156(zipCachePath, relPath), content);
|
|
766673
766719
|
}
|
|
766674
766720
|
}
|
|
766675
766721
|
async function readMarketplaceJsonContent(dir) {
|
|
766676
766722
|
const candidates = [
|
|
766677
|
-
|
|
766678
|
-
|
|
766723
|
+
join156(dir, ".claude-plugin", "marketplace.json"),
|
|
766724
|
+
join156(dir, "marketplace.json"),
|
|
766679
766725
|
dir
|
|
766680
766726
|
];
|
|
766681
766727
|
for (const candidate of candidates) {
|
|
@@ -767134,9 +767180,9 @@ __export(exports_bridgePointer, {
|
|
|
767134
767180
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
767135
767181
|
});
|
|
767136
767182
|
import { mkdir as mkdir44, readFile as readFile56, stat as stat50, unlink as unlink25, writeFile as writeFile49 } from "fs/promises";
|
|
767137
|
-
import { dirname as dirname64, join as
|
|
767183
|
+
import { dirname as dirname64, join as join157 } from "path";
|
|
767138
767184
|
function getBridgePointerPath(dir) {
|
|
767139
|
-
return
|
|
767185
|
+
return join157(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
767140
767186
|
}
|
|
767141
767187
|
async function writeBridgePointer(dir, pointer) {
|
|
767142
767188
|
const path27 = getBridgePointerPath(dir);
|
|
@@ -773034,14 +773080,14 @@ __export(exports_claudeDesktop, {
|
|
|
773034
773080
|
});
|
|
773035
773081
|
import { readdir as readdir31, readFile as readFile58, stat as stat52 } from "fs/promises";
|
|
773036
773082
|
import { homedir as homedir40 } from "os";
|
|
773037
|
-
import { join as
|
|
773083
|
+
import { join as join158 } from "path";
|
|
773038
773084
|
async function getClaudeDesktopConfigPath() {
|
|
773039
773085
|
const platform7 = getPlatform();
|
|
773040
773086
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
773041
773087
|
throw new Error(`Unsupported platform: ${platform7} - Claude Desktop integration only works on macOS and WSL.`);
|
|
773042
773088
|
}
|
|
773043
773089
|
if (platform7 === "macos") {
|
|
773044
|
-
return
|
|
773090
|
+
return join158(homedir40(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
773045
773091
|
}
|
|
773046
773092
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
773047
773093
|
if (windowsHome) {
|
|
@@ -773060,7 +773106,7 @@ async function getClaudeDesktopConfigPath() {
|
|
|
773060
773106
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
773061
773107
|
continue;
|
|
773062
773108
|
}
|
|
773063
|
-
const potentialConfigPath =
|
|
773109
|
+
const potentialConfigPath = join158(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json");
|
|
773064
773110
|
try {
|
|
773065
773111
|
await stat52(potentialConfigPath);
|
|
773066
773112
|
return potentialConfigPath;
|
|
@@ -773965,12 +774011,12 @@ __export(exports_install, {
|
|
|
773965
774011
|
install: () => install
|
|
773966
774012
|
});
|
|
773967
774013
|
import { homedir as homedir41 } from "node:os";
|
|
773968
|
-
import { join as
|
|
774014
|
+
import { join as join159 } from "node:path";
|
|
773969
774015
|
function getInstallationPath2() {
|
|
773970
774016
|
const isWindows3 = env4.platform === "win32";
|
|
773971
774017
|
const homeDir = homedir41();
|
|
773972
774018
|
if (isWindows3) {
|
|
773973
|
-
const windowsPath =
|
|
774019
|
+
const windowsPath = join159(homeDir, ".local", "bin", "claude.exe");
|
|
773974
774020
|
return windowsPath.replace(/\//g, "\\");
|
|
773975
774021
|
}
|
|
773976
774022
|
return "~/.local/bin/claude";
|
|
@@ -774757,7 +774803,7 @@ __export(exports_main, {
|
|
|
774757
774803
|
startDeferredPrefetches: () => startDeferredPrefetches,
|
|
774758
774804
|
main: () => main
|
|
774759
774805
|
});
|
|
774760
|
-
import { readFileSync as
|
|
774806
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
774761
774807
|
import { resolve as resolve46 } from "path";
|
|
774762
774808
|
function logManagedSettings() {
|
|
774763
774809
|
try {
|
|
@@ -774913,7 +774959,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
774913
774959
|
resolvedPath: resolvedSettingsPath
|
|
774914
774960
|
} = safeResolvePath(getFsImplementation(), settingsFile);
|
|
774915
774961
|
try {
|
|
774916
|
-
|
|
774962
|
+
readFileSync21(resolvedSettingsPath, "utf8");
|
|
774917
774963
|
} catch (e2) {
|
|
774918
774964
|
if (isENOENT(e2)) {
|
|
774919
774965
|
process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
|
|
@@ -775318,7 +775364,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
775318
775364
|
}
|
|
775319
775365
|
try {
|
|
775320
775366
|
const filePath = resolve46(options.systemPromptFile);
|
|
775321
|
-
systemPrompt =
|
|
775367
|
+
systemPrompt = readFileSync21(filePath, "utf8");
|
|
775322
775368
|
} catch (error42) {
|
|
775323
775369
|
const code = getErrnoCode(error42);
|
|
775324
775370
|
if (code === "ENOENT") {
|
|
@@ -775340,7 +775386,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
775340
775386
|
}
|
|
775341
775387
|
try {
|
|
775342
775388
|
const filePath = resolve46(options.appendSystemPromptFile);
|
|
775343
|
-
appendSystemPrompt =
|
|
775389
|
+
appendSystemPrompt = readFileSync21(filePath, "utf8");
|
|
775344
775390
|
} catch (error42) {
|
|
775345
775391
|
const code = getErrnoCode(error42);
|
|
775346
775392
|
if (code === "ENOENT") {
|
|
@@ -777319,4 +777365,4 @@ async function main2() {
|
|
|
777319
777365
|
}
|
|
777320
777366
|
main2();
|
|
777321
777367
|
|
|
777322
|
-
//# debugId=
|
|
777368
|
+
//# debugId=DACEE88BBB4178C864756E2164756E21
|