@warlock.js/ai-openai 5.26.0 → 5.27.0

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 (38) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/cjs/index.cjs +958 -280
  3. package/cjs/index.cjs.map +1 -1
  4. package/esm/config.type.d.mts +22 -0
  5. package/esm/config.type.d.mts.map +1 -1
  6. package/esm/model.mjs +26 -119
  7. package/esm/model.mjs.map +1 -1
  8. package/esm/responses-model.mjs +329 -0
  9. package/esm/responses-model.mjs.map +1 -0
  10. package/esm/sdk.d.mts +7 -0
  11. package/esm/sdk.d.mts.map +1 -1
  12. package/esm/sdk.mjs +21 -1
  13. package/esm/sdk.mjs.map +1 -1
  14. package/esm/utils/build-usage.mjs +23 -0
  15. package/esm/utils/build-usage.mjs.map +1 -0
  16. package/esm/utils/index.mjs +9 -1
  17. package/esm/utils/map-responses-status.mjs +54 -0
  18. package/esm/utils/map-responses-status.mjs.map +1 -0
  19. package/esm/utils/prompt-cache-params.mjs +17 -0
  20. package/esm/utils/prompt-cache-params.mjs.map +1 -0
  21. package/esm/utils/reasoning-effort.mjs +35 -0
  22. package/esm/utils/reasoning-effort.mjs.map +1 -0
  23. package/esm/utils/reasoning-replay.mjs +85 -0
  24. package/esm/utils/reasoning-replay.mjs.map +1 -0
  25. package/esm/utils/structured-output.mjs +84 -0
  26. package/esm/utils/structured-output.mjs.map +1 -0
  27. package/esm/utils/to-openai-messages.mjs +9 -2
  28. package/esm/utils/to-openai-messages.mjs.map +1 -1
  29. package/esm/utils/to-openai-tools.mjs +3 -3
  30. package/esm/utils/to-openai-tools.mjs.map +1 -1
  31. package/esm/utils/to-responses-input.mjs +112 -0
  32. package/esm/utils/to-responses-input.mjs.map +1 -0
  33. package/esm/utils/to-responses-tools.mjs +51 -0
  34. package/esm/utils/to-responses-tools.mjs.map +1 -0
  35. package/llms-full.txt +20 -3
  36. package/llms.txt +1 -1
  37. package/package.json +3 -3
  38. package/skills/setup-openai/SKILL.md +20 -3
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to `@warlock.js/ai-openai` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.27.0 - 2026-10-01
8
+
9
+ ### Added
10
+
11
+ - **Responses API (opt-in).** `sdk.model({ name, api: "responses" })` routes an OpenAI model through `/v1/responses`, so a reasoning model (gpt-5 family, o-series, gpt-6) can use function tools with reasoning on. Chat Completions stays the default and is unchanged. Under `api: "responses"` reasoning uses the provider default even when tools are attached (more reasoning tokens and latency than the Chat path, which forces reasoning off with tools); the system prompt is sent as `instructions`; requests use `store: false`; `pdf`/`audio` inputs are off. Only the `openai` provider accepts it: the DeepSeek, Groq, xAI and Mistral adapters reject `api: "responses"`.
12
+ - **Responses streaming.** `stream()` works under `api: "responses"` and yields the same chunks as the Chat path: text deltas (refusal text included), then the tool calls, then one `done` with the finish reason and usage. A `response.failed` or `error` event mid-stream throws the same typed error as a failed request.
13
+ - **Reasoning replay across tool turns.** Every Responses request asks for `include: ["reasoning.encrypted_content"]`. The reasoning items of a tool-calling turn are saved on the first tool call (`providerMetadata.openaiResponses = { model, reasoningItems }`) and sent back before that turn's function calls on the next request, so the model keeps its own reasoning while it works through tools, with nothing stored on OpenAI's side. Replay is skipped when the model changed, and turns without a tool call are not replayed. **The encrypted reasoning items are stored with the conversation history** (memory or session store), so expect larger stored messages; there is no size cap. The Chat path and the other adapters ignore the key.
14
+
7
15
  ## 5.26.0 - 2026-09-30
8
16
 
9
17
  ### Changed