@prestyj/ai 5.4.0 → 5.4.1

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/index.js CHANGED
@@ -2135,6 +2135,10 @@ function extractRequestIdFromMessage(message) {
2135
2135
 
2136
2136
  // src/providers/openai-codex.ts
2137
2137
  var DEFAULT_BASE_URL = "https://chatgpt.com/backend-api";
2138
+ var CODEX_CLIENT_VERSION = "0.144.1";
2139
+ function usesResponsesLite(model) {
2140
+ return model.startsWith("gpt-5.6-");
2141
+ }
2138
2142
  function outputTextKey(itemId, contentIndex) {
2139
2143
  return `${itemId ?? ""}:${contentIndex ?? 0}`;
2140
2144
  }
@@ -2150,6 +2154,7 @@ async function* runStream3(options) {
2150
2154
  const downgradedImages = downgradeUnsupportedImages(options.messages, options.supportsImages);
2151
2155
  const downgraded = downgradeUnsupportedVideos(downgradedImages, options.supportsVideo);
2152
2156
  const { system, input } = toCodexInput(downgraded, { supportsImages: options.supportsImages });
2157
+ const responsesLite = usesResponsesLite(options.model);
2153
2158
  const body = {
2154
2159
  model: options.model,
2155
2160
  store: false,
@@ -2157,7 +2162,7 @@ async function* runStream3(options) {
2157
2162
  instructions: system,
2158
2163
  input,
2159
2164
  tool_choice: "auto",
2160
- parallel_tool_calls: true,
2165
+ parallel_tool_calls: !responsesLite,
2161
2166
  include: ["reasoning.encrypted_content"]
2162
2167
  };
2163
2168
  if (options.tools?.length) {
@@ -2169,15 +2174,20 @@ async function* runStream3(options) {
2169
2174
  }
2170
2175
  body.reasoning = {
2171
2176
  effort: options.thinking ?? "none",
2172
- summary: "auto"
2177
+ summary: "auto",
2178
+ ...responsesLite ? { context: "all_turns" } : {}
2173
2179
  };
2174
2180
  const headers = {
2175
2181
  "Content-Type": "application/json",
2176
2182
  Accept: "text/event-stream",
2177
2183
  Authorization: `Bearer ${options.apiKey}`,
2178
2184
  "OpenAI-Beta": "responses=experimental",
2179
- originator: "ezcoder",
2180
- "User-Agent": `ezcoder (${os.platform()} ${os.release()}; ${os.arch()})`
2185
+ originator: responsesLite ? "codex_cli_rs" : "ezcoder",
2186
+ "User-Agent": responsesLite ? `codex_cli_rs/${CODEX_CLIENT_VERSION}` : `ezcoder (${os.platform()} ${os.release()}; ${os.arch()})`,
2187
+ ...responsesLite ? {
2188
+ version: CODEX_CLIENT_VERSION,
2189
+ "X-OpenAI-Internal-Codex-Responses-Lite": "true"
2190
+ } : {}
2181
2191
  };
2182
2192
  if (options.accountId) {
2183
2193
  headers["chatgpt-account-id"] = options.accountId;