claude-code-openai 0.1.26 → 0.1.28

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 +28 -25
  2. package/package.json +9 -2
package/dist/cli.js CHANGED
@@ -204660,7 +204660,7 @@ var init_metadata = __esm(() => {
204660
204660
  isClaudeAiAuth: isClaudeAISubscriber(),
204661
204661
  version: "2.1.88-rebuild",
204662
204662
  versionBase: getVersionBase(),
204663
- buildTime: "2026-04-01T21:04:34.601Z",
204663
+ buildTime: "2026-04-01T21:15:06.587Z",
204664
204664
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
204665
204665
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
204666
204666
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -592955,7 +592955,7 @@ function getAnthropicEnvMetadata() {
592955
592955
  function getBuildAgeMinutes() {
592956
592956
  if (false)
592957
592957
  ;
592958
- const buildTime = new Date("2026-04-01T21:04:34.601Z").getTime();
592958
+ const buildTime = new Date("2026-04-01T21:15:06.587Z").getTime();
592959
592959
  if (isNaN(buildTime))
592960
592960
  return;
592961
592961
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -595215,7 +595215,7 @@ __export(exports_openai_query, {
595215
595215
  getLastOpenAIResponseId: () => getLastOpenAIResponseId,
595216
595216
  clearLastOpenAIResponseId: () => clearLastOpenAIResponseId
595217
595217
  });
595218
- import { randomUUID as randomUUID23 } from "crypto";
595218
+ import { createHash as createHash22, randomUUID as randomUUID23 } from "crypto";
595219
595219
  function resolveOpenAIModel(anthropicModel) {
595220
595220
  if (process.env.OPENAI_MODEL) {
595221
595221
  return process.env.OPENAI_MODEL;
@@ -595254,13 +595254,12 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
595254
595254
  }
595255
595255
  const toolChoice = convertToolChoice(options.toolChoice);
595256
595256
  const supportsReasoning = /^(gpt-5|o[1-9]|o3)/.test(openaiModel);
595257
- let reasoning = supportsReasoning ? convertThinkingConfig(thinkingConfig) : undefined;
595258
- if (reasoning && options.effortValue) {
595259
- const effortStr = typeof options.effortValue === "string" ? options.effortValue : "medium";
595260
- const mapped = effortStr === "max" ? "high" : effortStr;
595261
- if (["high", "medium", "low"].includes(mapped)) {
595262
- reasoning = { ...reasoning, effort: mapped };
595263
- }
595257
+ let reasoning = undefined;
595258
+ if (supportsReasoning && thinkingConfig.type !== "disabled") {
595259
+ const resolved = resolveAppliedEffort(options.model, options.effortValue);
595260
+ const level = resolved ? convertEffortValueToLevel(resolved) : "medium";
595261
+ const effort = level === "max" ? "high" : level;
595262
+ reasoning = { effort, summary: "auto" };
595264
595263
  }
595265
595264
  let input;
595266
595265
  const usePreviousResponseId = !client3.isOAuthChatgpt && _lastResponseId != null;
@@ -595279,6 +595278,7 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
595279
595278
  }
595280
595279
  const hasFunctionTools = oaiTools.some((t2) => t2.type === "function");
595281
595280
  let params;
595281
+ const promptCacheKey = instructions ? createHash22("sha256").update(instructions).digest("hex").slice(0, 16) : undefined;
595282
595282
  if (client3.isOAuthChatgpt) {
595283
595283
  params = {
595284
595284
  model: openaiModel,
@@ -595290,7 +595290,8 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
595290
595290
  reasoning,
595291
595291
  store: false,
595292
595292
  stream: true,
595293
- include: reasoning ? ["reasoning.encrypted_content"] : []
595293
+ include: reasoning ? ["reasoning.encrypted_content"] : [],
595294
+ prompt_cache_key: promptCacheKey
595294
595295
  };
595295
595296
  } else {
595296
595297
  const maxOutputTokens = options.maxOutputTokensOverride || MAX_OUTPUT_TOKENS[openaiModel] || 16384;
@@ -595306,7 +595307,8 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
595306
595307
  temperature: options.temperatureOverride ?? 1,
595307
595308
  reasoning,
595308
595309
  previous_response_id: usePreviousResponseId ? _lastResponseId : undefined,
595309
- store: true
595310
+ store: true,
595311
+ prompt_cache_key: promptCacheKey
595310
595312
  };
595311
595313
  }
595312
595314
  logForDebugging(`[OpenAI] Request: model=${openaiModel} input=${input.length} items (${usePreviousResponseId ? "incremental, chain=" + _lastResponseId : "full"}) tools=${oaiTools.length}`);
@@ -595840,6 +595842,7 @@ var init_openai_query = __esm(() => {
595840
595842
  init_debug();
595841
595843
  init_client5();
595842
595844
  init_openai_adapter();
595845
+ init_effort();
595843
595846
  OPENAI_MODEL_MAP = {
595844
595847
  "claude-opus-4-6-20260401": "gpt-5.4",
595845
595848
  "claude-opus-4-5-20250918": "gpt-5.4",
@@ -597569,7 +597572,7 @@ var init_toolSearch = __esm(() => {
597569
597572
  });
597570
597573
 
597571
597574
  // src/services/vcr.ts
597572
- import { createHash as createHash22, randomUUID as randomUUID24 } from "crypto";
597575
+ import { createHash as createHash23, randomUUID as randomUUID24 } from "crypto";
597573
597576
  import { mkdir as mkdir22, readFile as readFile33, writeFile as writeFile24 } from "fs/promises";
597574
597577
  import { dirname as dirname38, join as join94 } from "path";
597575
597578
  function shouldUseVCR() {
@@ -597583,7 +597586,7 @@ async function withFixture(input, fixtureName, f2) {
597583
597586
  if (!shouldUseVCR()) {
597584
597587
  return await f2();
597585
597588
  }
597586
- const hash2 = createHash22("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
597589
+ const hash2 = createHash23("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
597587
597590
  const filename = join94(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash2}.json`);
597588
597591
  try {
597589
597592
  const cached3 = jsonParse(await readFile33(filename, { encoding: "utf8" }));
@@ -597618,7 +597621,7 @@ async function withVCR(messages, f2) {
597618
597621
  return true;
597619
597622
  }));
597620
597623
  const dehydratedInput = mapMessages(messagesForAPI.map((_3) => _3.message.content), dehydrateValue);
597621
- const filename = join94(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_3) => createHash22("sha1").update(jsonStringify(_3)).digest("hex").slice(0, 6)).join("-")}.json`);
597624
+ const filename = join94(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_3) => createHash23("sha1").update(jsonStringify(_3)).digest("hex").slice(0, 6)).join("-")}.json`);
597622
597625
  try {
597623
597626
  const cached3 = jsonParse(await readFile33(filename, { encoding: "utf8" }));
597624
597627
  cached3.output.forEach(addCachedCostToTotalSessionCost);
@@ -604304,7 +604307,7 @@ var init_managedPlugins = __esm(() => {
604304
604307
  });
604305
604308
 
604306
604309
  // src/utils/plugins/pluginVersioning.ts
604307
- import { createHash as createHash23 } from "crypto";
604310
+ import { createHash as createHash24 } from "crypto";
604308
604311
  async function calculatePluginVersion(pluginId, source, manifest, installPath, providedVersion, gitCommitSha) {
604309
604312
  if (manifest?.version) {
604310
604313
  logForDebugging(`Using manifest version for ${pluginId}: ${manifest.version}`);
@@ -604318,7 +604321,7 @@ async function calculatePluginVersion(pluginId, source, manifest, installPath, p
604318
604321
  const shortSha = gitCommitSha.substring(0, 12);
604319
604322
  if (typeof source === "object" && source.source === "git-subdir") {
604320
604323
  const normPath = source.path.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
604321
- const pathHash = createHash23("sha256").update(normPath).digest("hex").substring(0, 8);
604324
+ const pathHash = createHash24("sha256").update(normPath).digest("hex").substring(0, 8);
604322
604325
  const v6 = `${shortSha}-${pathHash}`;
604323
604326
  logForDebugging(`Using git-subdir SHA+path version for ${pluginId}: ${v6} (path=${normPath})`);
604324
604327
  return v6;
@@ -613441,14 +613444,14 @@ var init_terminalSetup = __esm(() => {
613441
613444
  });
613442
613445
 
613443
613446
  // src/utils/pasteStore.ts
613444
- import { createHash as createHash24 } from "crypto";
613447
+ import { createHash as createHash25 } from "crypto";
613445
613448
  import { mkdir as mkdir26, readdir as readdir21, readFile as readFile39, stat as stat37, unlink as unlink15, writeFile as writeFile30 } from "fs/promises";
613446
613449
  import { join as join109 } from "path";
613447
613450
  function getPasteStoreDir() {
613448
613451
  return join109(getClaudeConfigHomeDir(), PASTE_STORE_DIR);
613449
613452
  }
613450
613453
  function hashPastedText(content) {
613451
- return createHash24("sha256").update(content).digest("hex").slice(0, 16);
613454
+ return createHash25("sha256").update(content).digest("hex").slice(0, 16);
613452
613455
  }
613453
613456
  function getPastePath(hash2) {
613454
613457
  return join109(getPasteStoreDir(), `${hash2}.txt`);
@@ -679559,7 +679562,7 @@ var init_bridge_kick = __esm(() => {
679559
679562
  var call56 = async () => {
679560
679563
  return {
679561
679564
  type: "text",
679562
- value: `${"2.1.88-rebuild"} (built ${"2026-04-01T21:04:34.601Z"})`
679565
+ value: `${"2.1.88-rebuild"} (built ${"2026-04-01T21:15:06.587Z"})`
679563
679566
  };
679564
679567
  }, version6, version_default;
679565
679568
  var init_version = __esm(() => {
@@ -698649,7 +698652,7 @@ var init_prompts4 = __esm(() => {
698649
698652
  });
698650
698653
 
698651
698654
  // src/utils/api.ts
698652
- import { createHash as createHash25 } from "crypto";
698655
+ import { createHash as createHash26 } from "crypto";
698653
698656
  function filterSwarmFieldsFromSchema(toolName, schema) {
698654
698657
  const fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName];
698655
698658
  if (!fieldsToRemove || fieldsToRemove.length === 0) {
@@ -698739,7 +698742,7 @@ function logAPIPrefix(systemPrompt) {
698739
698742
  logEvent("tengu_sysprompt_block", {
698740
698743
  snippet: firstSystemPrompt?.slice(0, 20),
698741
698744
  length: firstSystemPrompt?.length ?? 0,
698742
- hash: firstSystemPrompt ? createHash25("sha256").update(firstSystemPrompt).digest("hex") : ""
698745
+ hash: firstSystemPrompt ? createHash26("sha256").update(firstSystemPrompt).digest("hex") : ""
698743
698746
  });
698744
698747
  }
698745
698748
  function splitSysPromptPrefix(systemPrompt, options) {
@@ -699065,7 +699068,7 @@ var init_api3 = __esm(() => {
699065
699068
  });
699066
699069
 
699067
699070
  // src/utils/fingerprint.ts
699068
- import { createHash as createHash26 } from "crypto";
699071
+ import { createHash as createHash27 } from "crypto";
699069
699072
  function extractFirstMessageText(messages) {
699070
699073
  const firstUserMessage = messages.find((msg) => msg.type === "user");
699071
699074
  if (!firstUserMessage) {
@@ -699087,7 +699090,7 @@ function computeFingerprint(messageText, version7) {
699087
699090
  const indices = [4, 7, 20];
699088
699091
  const chars = indices.map((i4) => messageText[i4] || "0").join("");
699089
699092
  const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version7}`;
699090
- const hash2 = createHash26("sha256").update(fingerprintInput).digest("hex");
699093
+ const hash2 = createHash27("sha256").update(fingerprintInput).digest("hex");
699091
699094
  return hash2.slice(0, 3);
699092
699095
  }
699093
699096
  function computeFingerprintFromMessages(messages) {
@@ -777570,4 +777573,4 @@ async function main2() {
777570
777573
  }
777571
777574
  main2();
777572
777575
 
777573
- //# debugId=F97171E9D2513B5D64756E2164756E21
777576
+ //# debugId=5C9DD16DE124AF3464756E2164756E21
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "claude-code-openai",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "Claude Code CLI with OpenAI GPT-5.4 backend support",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "claude-openai": "./dist/claude-openai.js"
8
8
  },
9
- "keywords": ["claude", "openai", "gpt-5.4", "cli", "ai", "coding-assistant"],
9
+ "keywords": [
10
+ "claude",
11
+ "openai",
12
+ "gpt-5.4",
13
+ "cli",
14
+ "ai",
15
+ "coding-assistant"
16
+ ],
10
17
  "license": "MIT",
11
18
  "repository": {
12
19
  "type": "git",