claude-code-openai 0.1.3 → 0.1.4
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 +54 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -186172,6 +186172,9 @@ function getContextWindowForModel(model, betas) {
|
|
|
186172
186172
|
return override;
|
|
186173
186173
|
}
|
|
186174
186174
|
}
|
|
186175
|
+
if (isOpenAIProvider() && model.startsWith("gpt-")) {
|
|
186176
|
+
return 128000;
|
|
186177
|
+
}
|
|
186175
186178
|
if (has1mContext(model)) {
|
|
186176
186179
|
return 1e6;
|
|
186177
186180
|
}
|
|
@@ -186280,6 +186283,7 @@ var init_context = __esm(() => {
|
|
|
186280
186283
|
init_envUtils();
|
|
186281
186284
|
init_model();
|
|
186282
186285
|
init_modelCapabilities();
|
|
186286
|
+
init_providers();
|
|
186283
186287
|
});
|
|
186284
186288
|
|
|
186285
186289
|
// src/utils/model/modelSupportOverrides.ts
|
|
@@ -204204,7 +204208,7 @@ var init_metadata = __esm(() => {
|
|
|
204204
204208
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
204205
204209
|
version: "2.1.88-rebuild",
|
|
204206
204210
|
versionBase: getVersionBase(),
|
|
204207
|
-
buildTime: "2026-04-01T08:
|
|
204211
|
+
buildTime: "2026-04-01T08:38:53.515Z",
|
|
204208
204212
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
204209
204213
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
204210
204214
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -256480,6 +256484,9 @@ function modelSupportsThinking(model) {
|
|
|
256480
256484
|
}
|
|
256481
256485
|
const canonical = getCanonicalName(model);
|
|
256482
256486
|
const provider = getAPIProvider();
|
|
256487
|
+
if (provider === "openai") {
|
|
256488
|
+
return /^(gpt-5|o[1-9]|o3)/.test(canonical);
|
|
256489
|
+
}
|
|
256483
256490
|
if (provider === "foundry" || provider === "firstParty") {
|
|
256484
256491
|
return !canonical.includes("claude-3-");
|
|
256485
256492
|
}
|
|
@@ -256498,6 +256505,9 @@ function modelSupportsAdaptiveThinking(model) {
|
|
|
256498
256505
|
return false;
|
|
256499
256506
|
}
|
|
256500
256507
|
const provider = getAPIProvider();
|
|
256508
|
+
if (provider === "openai") {
|
|
256509
|
+
return /^(gpt-5|o[1-9]|o3)/.test(canonical);
|
|
256510
|
+
}
|
|
256501
256511
|
return provider === "firstParty" || provider === "foundry";
|
|
256502
256512
|
}
|
|
256503
256513
|
function shouldEnableThinkingByDefault() {
|
|
@@ -592566,7 +592576,7 @@ function getAnthropicEnvMetadata() {
|
|
|
592566
592576
|
function getBuildAgeMinutes() {
|
|
592567
592577
|
if (false)
|
|
592568
592578
|
;
|
|
592569
|
-
const buildTime = new Date("2026-04-01T08:
|
|
592579
|
+
const buildTime = new Date("2026-04-01T08:38:53.515Z").getTime();
|
|
592570
592580
|
if (isNaN(buildTime))
|
|
592571
592581
|
return;
|
|
592572
592582
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -594657,6 +594667,33 @@ function convertAssistantMessage(msg, items) {
|
|
|
594657
594667
|
`) });
|
|
594658
594668
|
}
|
|
594659
594669
|
}
|
|
594670
|
+
function enforceStrictSchema(schema) {
|
|
594671
|
+
const out = { ...schema };
|
|
594672
|
+
for (const keyword of ["anyOf", "oneOf", "allOf"]) {
|
|
594673
|
+
if (Array.isArray(out[keyword])) {
|
|
594674
|
+
out[keyword] = out[keyword].map((s2) => enforceStrictSchema(s2));
|
|
594675
|
+
}
|
|
594676
|
+
}
|
|
594677
|
+
if (out.type === "object") {
|
|
594678
|
+
out.additionalProperties = false;
|
|
594679
|
+
if (out.properties && typeof out.properties === "object") {
|
|
594680
|
+
const props = out.properties;
|
|
594681
|
+
const newProps = {};
|
|
594682
|
+
for (const [key2, val] of Object.entries(props)) {
|
|
594683
|
+
newProps[key2] = enforceStrictSchema(val);
|
|
594684
|
+
}
|
|
594685
|
+
out.properties = newProps;
|
|
594686
|
+
const allKeys = Object.keys(newProps);
|
|
594687
|
+
if (allKeys.length > 0) {
|
|
594688
|
+
out.required = allKeys;
|
|
594689
|
+
}
|
|
594690
|
+
}
|
|
594691
|
+
}
|
|
594692
|
+
if (out.type === "array" && out.items && typeof out.items === "object") {
|
|
594693
|
+
out.items = enforceStrictSchema(out.items);
|
|
594694
|
+
}
|
|
594695
|
+
return out;
|
|
594696
|
+
}
|
|
594660
594697
|
function convertToolSchemas(tools) {
|
|
594661
594698
|
const oaiTools = [];
|
|
594662
594699
|
for (const t2 of tools) {
|
|
@@ -594666,12 +594703,13 @@ function convertToolSchemas(tools) {
|
|
|
594666
594703
|
}
|
|
594667
594704
|
if (t2.type === "custom" || !("type" in t2) || t2.type === undefined) {
|
|
594668
594705
|
const tool = t2;
|
|
594706
|
+
const strictParams = enforceStrictSchema(tool.input_schema);
|
|
594669
594707
|
oaiTools.push({
|
|
594670
594708
|
type: "function",
|
|
594671
594709
|
name: tool.name,
|
|
594672
594710
|
description: tool.description ?? "",
|
|
594673
|
-
parameters:
|
|
594674
|
-
strict:
|
|
594711
|
+
parameters: strictParams,
|
|
594712
|
+
strict: true
|
|
594675
594713
|
});
|
|
594676
594714
|
}
|
|
594677
594715
|
}
|
|
@@ -594740,6 +594778,7 @@ function convertThinkingConfig(thinkingConfig) {
|
|
|
594740
594778
|
// src/services/api/openai-query.ts
|
|
594741
594779
|
var exports_openai_query = {};
|
|
594742
594780
|
__export(exports_openai_query, {
|
|
594781
|
+
resolveOpenAIModel: () => resolveOpenAIModel,
|
|
594743
594782
|
queryModelOpenAINonStreaming: () => queryModelOpenAINonStreaming,
|
|
594744
594783
|
queryModelOpenAI: () => queryModelOpenAI,
|
|
594745
594784
|
getLastOpenAIResponseId: () => getLastOpenAIResponseId,
|
|
@@ -594764,6 +594803,13 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
|
|
|
594764
594803
|
model: options.model,
|
|
594765
594804
|
source: options.querySource
|
|
594766
594805
|
});
|
|
594806
|
+
if (!client3.apiKey) {
|
|
594807
|
+
yield createAssistantAPIErrorMessage({
|
|
594808
|
+
content: "OPENAI_API_KEY is not set. Please set the OPENAI_API_KEY environment variable.",
|
|
594809
|
+
error: "authentication_failed"
|
|
594810
|
+
});
|
|
594811
|
+
return;
|
|
594812
|
+
}
|
|
594767
594813
|
const openaiModel = resolveOpenAIModel(options.model);
|
|
594768
594814
|
const instructions = convertSystemPrompt(systemPrompt.filter(Boolean).map((text2) => ({ type: "text", text: text2 })));
|
|
594769
594815
|
const oaiTools = convertToolSchemas(tools);
|
|
@@ -678989,7 +679035,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
678989
679035
|
var call56 = async () => {
|
|
678990
679036
|
return {
|
|
678991
679037
|
type: "text",
|
|
678992
|
-
value: `${"2.1.88-rebuild"} (built ${"2026-04-01T08:
|
|
679038
|
+
value: `${"2.1.88-rebuild"} (built ${"2026-04-01T08:38:53.515Z"})`
|
|
678993
679039
|
};
|
|
678994
679040
|
}, version6, version_default;
|
|
678995
679041
|
var init_version = __esm(() => {
|
|
@@ -700492,7 +700538,7 @@ async function sideQueryOpenAI(opts) {
|
|
|
700492
700538
|
stop_sequences
|
|
700493
700539
|
} = opts;
|
|
700494
700540
|
const client3 = await getOpenAIClient({ model, source: "side_query" });
|
|
700495
|
-
const openaiModel =
|
|
700541
|
+
const openaiModel = resolveOpenAIModel(model);
|
|
700496
700542
|
const instructions = Array.isArray(system) ? system.map((b5) => b5.text).join(`
|
|
700497
700543
|
|
|
700498
700544
|
`) : system || "";
|
|
@@ -700599,6 +700645,7 @@ var init_sideQuery = __esm(() => {
|
|
|
700599
700645
|
init_fingerprint();
|
|
700600
700646
|
init_model();
|
|
700601
700647
|
init_providers();
|
|
700648
|
+
init_openai_query();
|
|
700602
700649
|
});
|
|
700603
700650
|
|
|
700604
700651
|
// src/utils/claudeInChrome/mcpServer.ts
|
|
@@ -776945,4 +776992,4 @@ async function main2() {
|
|
|
776945
776992
|
}
|
|
776946
776993
|
main2();
|
|
776947
776994
|
|
|
776948
|
-
//# debugId=
|
|
776995
|
+
//# debugId=B6963C77F1D1E9E764756E2164756E21
|