claude-code-openai 0.1.8 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +70 -45
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -204603,7 +204603,7 @@ var init_metadata = __esm(() => {
204603
204603
  isClaudeAiAuth: isClaudeAISubscriber(),
204604
204604
  version: "2.1.88-rebuild",
204605
204605
  versionBase: getVersionBase(),
204606
- buildTime: "2026-04-01T09:41:25.751Z",
204606
+ buildTime: "2026-04-01T09:46:44.490Z",
204607
204607
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
204608
204608
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
204609
204609
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -592889,7 +592889,7 @@ function getAnthropicEnvMetadata() {
592889
592889
  function getBuildAgeMinutes() {
592890
592890
  if (false)
592891
592891
  ;
592892
- const buildTime = new Date("2026-04-01T09:41:25.751Z").getTime();
592892
+ const buildTime = new Date("2026-04-01T09:46:44.490Z").getTime();
592893
592893
  if (isNaN(buildTime))
592894
592894
  return;
592895
592895
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -679360,7 +679360,7 @@ var init_bridge_kick = __esm(() => {
679360
679360
  var call56 = async () => {
679361
679361
  return {
679362
679362
  type: "text",
679363
- value: `${"2.1.88-rebuild"} (built ${"2026-04-01T09:41:25.751Z"})`
679363
+ value: `${"2.1.88-rebuild"} (built ${"2026-04-01T09:46:44.490Z"})`
679364
679364
  };
679365
679365
  }, version6, version_default;
679366
679366
  var init_version = __esm(() => {
@@ -741119,10 +741119,25 @@ var init_useDeferredHookMessages = __esm(() => {
741119
741119
  });
741120
741120
 
741121
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
+ }
741122
741137
  function useApiKeyVerification() {
741123
741138
  const [status2, setStatus] = import_react383.useState(() => {
741124
741139
  if (getAPIProvider() === "openai") {
741125
- return process.env.OPENAI_API_KEY ? "valid" : "missing";
741140
+ return hasOpenAIAuth() ? "loading" : "missing";
741126
741141
  }
741127
741142
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
741128
741143
  return "valid";
@@ -741138,7 +741153,16 @@ function useApiKeyVerification() {
741138
741153
  const [error42, setError] = import_react383.useState(null);
741139
741154
  const verify = import_react383.useCallback(async () => {
741140
741155
  if (getAPIProvider() === "openai") {
741141
- setStatus(process.env.OPENAI_API_KEY ? "valid" : "missing");
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
+ }
741142
741166
  return;
741143
741167
  }
741144
741168
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
@@ -741180,6 +741204,7 @@ var init_useApiKeyVerification = __esm(() => {
741180
741204
  init_state();
741181
741205
  init_claude();
741182
741206
  init_auth2();
741207
+ init_envUtils();
741183
741208
  init_providers();
741184
741209
  import_react383 = __toESM(require_react(), 1);
741185
741210
  });
@@ -744129,7 +744154,7 @@ __export(exports_asciicast, {
744129
744154
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
744130
744155
  });
744131
744156
  import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
744132
- import { basename as basename57, dirname as dirname59, join as join148 } from "path";
744157
+ import { basename as basename57, dirname as dirname59, join as join149 } from "path";
744133
744158
  function getRecordFilePath() {
744134
744159
  if (recordingState.filePath !== null) {
744135
744160
  return recordingState.filePath;
@@ -744140,10 +744165,10 @@ function getRecordFilePath() {
744140
744165
  if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
744141
744166
  return null;
744142
744167
  }
744143
- const projectsDir = join148(getClaudeConfigHomeDir(), "projects");
744144
- const projectDir = join148(projectsDir, sanitizePath2(getOriginalCwd()));
744168
+ const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
744169
+ const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
744145
744170
  recordingState.timestamp = Date.now();
744146
- recordingState.filePath = join148(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
744171
+ recordingState.filePath = join149(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
744147
744172
  return recordingState.filePath;
744148
744173
  }
744149
744174
  function _resetRecordingStateForTesting() {
@@ -744152,13 +744177,13 @@ function _resetRecordingStateForTesting() {
744152
744177
  }
744153
744178
  function getSessionRecordingPaths() {
744154
744179
  const sessionId = getSessionId();
744155
- const projectsDir = join148(getClaudeConfigHomeDir(), "projects");
744156
- const projectDir = join148(projectsDir, sanitizePath2(getOriginalCwd()));
744180
+ const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
744181
+ const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
744157
744182
  try {
744158
744183
  const entries = getFsImplementation().readdirSync(projectDir);
744159
744184
  const names = typeof entries[0] === "string" ? entries : entries.map((e2) => e2.name);
744160
744185
  const files3 = names.filter((f2) => f2.startsWith(sessionId) && f2.endsWith(".cast")).sort();
744161
- return files3.map((f2) => join148(projectDir, f2));
744186
+ return files3.map((f2) => join149(projectDir, f2));
744162
744187
  } catch {
744163
744188
  return [];
744164
744189
  }
@@ -744168,9 +744193,9 @@ async function renameRecordingForSession() {
744168
744193
  if (!oldPath || recordingState.timestamp === 0) {
744169
744194
  return;
744170
744195
  }
744171
- const projectsDir = join148(getClaudeConfigHomeDir(), "projects");
744172
- const projectDir = join148(projectsDir, sanitizePath2(getOriginalCwd()));
744173
- const newPath = join148(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
744196
+ const projectsDir = join149(getClaudeConfigHomeDir(), "projects");
744197
+ const projectDir = join149(projectsDir, sanitizePath2(getOriginalCwd()));
744198
+ const newPath = join149(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
744174
744199
  if (oldPath === newPath) {
744175
744200
  return;
744176
744201
  }
@@ -746933,7 +746958,7 @@ var init_useChromeExtensionNotification = __esm(() => {
746933
746958
  });
746934
746959
 
746935
746960
  // src/utils/plugins/officialMarketplaceStartupCheck.ts
746936
- import { join as join149 } from "path";
746961
+ import { join as join150 } from "path";
746937
746962
  function isOfficialMarketplaceAutoInstallDisabled() {
746938
746963
  return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
746939
746964
  }
@@ -747016,7 +747041,7 @@ async function checkAndInstallOfficialMarketplace() {
747016
747041
  return { installed: false, skipped: true, reason: "policy_blocked" };
747017
747042
  }
747018
747043
  const cacheDir = getMarketplacesCacheDir();
747019
- const installLocation = join149(cacheDir, OFFICIAL_MARKETPLACE_NAME);
747044
+ const installLocation = join150(cacheDir, OFFICIAL_MARKETPLACE_NAME);
747020
747045
  const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
747021
747046
  if (gcsSha !== null) {
747022
747047
  const known = await loadKnownMarketplacesConfig();
@@ -749888,7 +749913,7 @@ var init_usePluginRecommendationBase = __esm(() => {
749888
749913
  });
749889
749914
 
749890
749915
  // src/hooks/useLspPluginRecommendation.tsx
749891
- import { extname as extname15, join as join150 } from "path";
749916
+ import { extname as extname15, join as join151 } from "path";
749892
749917
  function useLspPluginRecommendation() {
749893
749918
  const $4 = import_react_compiler_runtime356.c(12);
749894
749919
  const trackedFiles = useAppState(_temp224);
@@ -749973,7 +749998,7 @@ function useLspPluginRecommendation() {
749973
749998
  case "yes": {
749974
749999
  installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
749975
750000
  logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
749976
- const localSourcePath = typeof pluginData.entry.source === "string" ? join150(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
750001
+ const localSourcePath = typeof pluginData.entry.source === "string" ? join151(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
749977
750002
  await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
749978
750003
  const settings = getSettingsForSource("userSettings");
749979
750004
  updateSettingsForSource("userSettings", {
@@ -752628,7 +752653,7 @@ var exports_REPL = {};
752628
752653
  __export(exports_REPL, {
752629
752654
  REPL: () => REPL
752630
752655
  });
752631
- import { dirname as dirname61, join as join151 } from "path";
752656
+ import { dirname as dirname61, join as join152 } from "path";
752632
752657
  import { tmpdir as tmpdir14 } from "os";
752633
752658
  import { writeFile as writeFile46 } from "fs/promises";
752634
752659
  import { randomUUID as randomUUID50 } from "crypto";
@@ -755111,7 +755136,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.
755111
755136
  const w3 = Math.max(80, (process.stdout.columns ?? 80) - 6);
755112
755137
  const raw = await renderMessagesToPlainText(deferredMessages, tools, w3);
755113
755138
  const text2 = raw.replace(/[ \t]+$/gm, "");
755114
- const path27 = join151(tmpdir14(), `cc-transcript-${Date.now()}.txt`);
755139
+ const path27 = join152(tmpdir14(), `cc-transcript-${Date.now()}.txt`);
755115
755140
  await writeFile46(path27, text2);
755116
755141
  const opened = openFileInExternalEditor(path27);
755117
755142
  setStatus(opened ? `opening ${path27}` : `wrote ${path27} · no $VISUAL/$EDITOR set`);
@@ -762792,12 +762817,12 @@ var init_createDirectConnectSession = __esm(() => {
762792
762817
  });
762793
762818
 
762794
762819
  // src/utils/errorLogSink.ts
762795
- import { dirname as dirname63, join as join152 } from "path";
762820
+ import { dirname as dirname63, join as join153 } from "path";
762796
762821
  function getErrorsPath() {
762797
- return join152(CACHE_PATHS.errors(), DATE + ".jsonl");
762822
+ return join153(CACHE_PATHS.errors(), DATE + ".jsonl");
762798
762823
  }
762799
762824
  function getMCPLogsPath(serverName) {
762800
- return join152(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
762825
+ return join153(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
762801
762826
  }
762802
762827
  function createJsonlWriter(options) {
762803
762828
  const writer = createBufferedWriter(options);
@@ -763140,7 +763165,7 @@ var init_sessionMemory = __esm(() => {
763140
763165
  // src/utils/iTermBackup.ts
763141
763166
  import { copyFile as copyFile12, stat as stat49 } from "fs/promises";
763142
763167
  import { homedir as homedir39 } from "os";
763143
- import { join as join153 } from "path";
763168
+ import { join as join154 } from "path";
763144
763169
  function markITerm2SetupComplete() {
763145
763170
  saveGlobalConfig((current) => ({
763146
763171
  ...current,
@@ -763155,7 +763180,7 @@ function getIterm2RecoveryInfo() {
763155
763180
  };
763156
763181
  }
763157
763182
  function getITerm2PlistPath() {
763158
- return join153(homedir39(), "Library", "Preferences", "com.googlecode.iterm2.plist");
763183
+ return join154(homedir39(), "Library", "Preferences", "com.googlecode.iterm2.plist");
763159
763184
  }
763160
763185
  async function checkAndRestoreITerm2Backup() {
763161
763186
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -766520,7 +766545,7 @@ var init_idleTimeout = __esm(() => {
766520
766545
  // src/bridge/inboundAttachments.ts
766521
766546
  import { randomUUID as randomUUID53 } from "crypto";
766522
766547
  import { mkdir as mkdir43, writeFile as writeFile48 } from "fs/promises";
766523
- import { basename as basename58, join as join154 } from "path";
766548
+ import { basename as basename58, join as join155 } from "path";
766524
766549
  function debug4(msg) {
766525
766550
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
766526
766551
  }
@@ -766536,7 +766561,7 @@ function sanitizeFileName(name3) {
766536
766561
  return base2 || "attachment";
766537
766562
  }
766538
766563
  function uploadsDir() {
766539
- return join154(getClaudeConfigHomeDir(), "uploads", getSessionId());
766564
+ return join155(getClaudeConfigHomeDir(), "uploads", getSessionId());
766540
766565
  }
766541
766566
  async function resolveOne(att) {
766542
766567
  const token = getBridgeAccessToken();
@@ -766565,7 +766590,7 @@ async function resolveOne(att) {
766565
766590
  const safeName = sanitizeFileName(att.file_name);
766566
766591
  const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
766567
766592
  const dir = uploadsDir();
766568
- const outPath = join154(dir, `${prefix}-${safeName}`);
766593
+ const outPath = join155(dir, `${prefix}-${safeName}`);
766569
766594
  try {
766570
766595
  await mkdir43(dir, { recursive: true });
766571
766596
  await writeFile48(outPath, data);
@@ -766665,7 +766690,7 @@ var init_sessionUrl = __esm(() => {
766665
766690
 
766666
766691
  // src/utils/plugins/zipCacheAdapters.ts
766667
766692
  import { readFile as readFile55 } from "fs/promises";
766668
- import { join as join155 } from "path";
766693
+ import { join as join156 } from "path";
766669
766694
  async function readZipCacheKnownMarketplaces() {
766670
766695
  try {
766671
766696
  const content = await readFile55(getZipCacheKnownMarketplacesPath(), "utf-8");
@@ -766690,13 +766715,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
766690
766715
  const content = await readMarketplaceJsonContent(installLocation);
766691
766716
  if (content !== null) {
766692
766717
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
766693
- await atomicWriteToZipCache(join155(zipCachePath, relPath), content);
766718
+ await atomicWriteToZipCache(join156(zipCachePath, relPath), content);
766694
766719
  }
766695
766720
  }
766696
766721
  async function readMarketplaceJsonContent(dir) {
766697
766722
  const candidates = [
766698
- join155(dir, ".claude-plugin", "marketplace.json"),
766699
- join155(dir, "marketplace.json"),
766723
+ join156(dir, ".claude-plugin", "marketplace.json"),
766724
+ join156(dir, "marketplace.json"),
766700
766725
  dir
766701
766726
  ];
766702
766727
  for (const candidate of candidates) {
@@ -767155,9 +767180,9 @@ __export(exports_bridgePointer, {
767155
767180
  BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
767156
767181
  });
767157
767182
  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 join156 } from "path";
767183
+ import { dirname as dirname64, join as join157 } from "path";
767159
767184
  function getBridgePointerPath(dir) {
767160
- return join156(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
767185
+ return join157(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
767161
767186
  }
767162
767187
  async function writeBridgePointer(dir, pointer) {
767163
767188
  const path27 = getBridgePointerPath(dir);
@@ -773055,14 +773080,14 @@ __export(exports_claudeDesktop, {
773055
773080
  });
773056
773081
  import { readdir as readdir31, readFile as readFile58, stat as stat52 } from "fs/promises";
773057
773082
  import { homedir as homedir40 } from "os";
773058
- import { join as join157 } from "path";
773083
+ import { join as join158 } from "path";
773059
773084
  async function getClaudeDesktopConfigPath() {
773060
773085
  const platform7 = getPlatform();
773061
773086
  if (!SUPPORTED_PLATFORMS.includes(platform7)) {
773062
773087
  throw new Error(`Unsupported platform: ${platform7} - Claude Desktop integration only works on macOS and WSL.`);
773063
773088
  }
773064
773089
  if (platform7 === "macos") {
773065
- return join157(homedir40(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
773090
+ return join158(homedir40(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
773066
773091
  }
773067
773092
  const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
773068
773093
  if (windowsHome) {
@@ -773081,7 +773106,7 @@ async function getClaudeDesktopConfigPath() {
773081
773106
  if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
773082
773107
  continue;
773083
773108
  }
773084
- const potentialConfigPath = join157(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json");
773109
+ const potentialConfigPath = join158(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json");
773085
773110
  try {
773086
773111
  await stat52(potentialConfigPath);
773087
773112
  return potentialConfigPath;
@@ -773986,12 +774011,12 @@ __export(exports_install, {
773986
774011
  install: () => install
773987
774012
  });
773988
774013
  import { homedir as homedir41 } from "node:os";
773989
- import { join as join158 } from "node:path";
774014
+ import { join as join159 } from "node:path";
773990
774015
  function getInstallationPath2() {
773991
774016
  const isWindows3 = env4.platform === "win32";
773992
774017
  const homeDir = homedir41();
773993
774018
  if (isWindows3) {
773994
- const windowsPath = join158(homeDir, ".local", "bin", "claude.exe");
774019
+ const windowsPath = join159(homeDir, ".local", "bin", "claude.exe");
773995
774020
  return windowsPath.replace(/\//g, "\\");
773996
774021
  }
773997
774022
  return "~/.local/bin/claude";
@@ -774778,7 +774803,7 @@ __export(exports_main, {
774778
774803
  startDeferredPrefetches: () => startDeferredPrefetches,
774779
774804
  main: () => main
774780
774805
  });
774781
- import { readFileSync as readFileSync20 } from "fs";
774806
+ import { readFileSync as readFileSync21 } from "fs";
774782
774807
  import { resolve as resolve46 } from "path";
774783
774808
  function logManagedSettings() {
774784
774809
  try {
@@ -774934,7 +774959,7 @@ function loadSettingsFromFlag(settingsFile) {
774934
774959
  resolvedPath: resolvedSettingsPath
774935
774960
  } = safeResolvePath(getFsImplementation(), settingsFile);
774936
774961
  try {
774937
- readFileSync20(resolvedSettingsPath, "utf8");
774962
+ readFileSync21(resolvedSettingsPath, "utf8");
774938
774963
  } catch (e2) {
774939
774964
  if (isENOENT(e2)) {
774940
774965
  process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
@@ -775339,7 +775364,7 @@ ${getTmuxInstallInstructions2()}
775339
775364
  }
775340
775365
  try {
775341
775366
  const filePath = resolve46(options.systemPromptFile);
775342
- systemPrompt = readFileSync20(filePath, "utf8");
775367
+ systemPrompt = readFileSync21(filePath, "utf8");
775343
775368
  } catch (error42) {
775344
775369
  const code = getErrnoCode(error42);
775345
775370
  if (code === "ENOENT") {
@@ -775361,7 +775386,7 @@ ${getTmuxInstallInstructions2()}
775361
775386
  }
775362
775387
  try {
775363
775388
  const filePath = resolve46(options.appendSystemPromptFile);
775364
- appendSystemPrompt = readFileSync20(filePath, "utf8");
775389
+ appendSystemPrompt = readFileSync21(filePath, "utf8");
775365
775390
  } catch (error42) {
775366
775391
  const code = getErrnoCode(error42);
775367
775392
  if (code === "ENOENT") {
@@ -777340,4 +777365,4 @@ async function main2() {
777340
777365
  }
777341
777366
  main2();
777342
777367
 
777343
- //# debugId=277F4AA9D69C767064756E2164756E21
777368
+ //# debugId=DACEE88BBB4178C864756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-openai",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Claude Code CLI with OpenAI GPT-5.4 backend support",
5
5
  "type": "module",
6
6
  "bin": {