@warlock.js/ai-openai 5.30.0 → 5.32.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.
- package/CHANGELOG.md +42 -1
- package/README.md +3 -3
- package/cjs/index.cjs +715 -51
- package/cjs/index.cjs.map +1 -1
- package/esm/config.type.d.mts +13 -13
- package/esm/config.type.d.mts.map +1 -1
- package/esm/embedder.d.mts +1 -3
- package/esm/embedder.d.mts.map +1 -1
- package/esm/embedder.mjs.map +1 -1
- package/esm/image.d.mts +1 -3
- package/esm/image.d.mts.map +1 -1
- package/esm/index.d.mts +4 -1
- package/esm/index.mjs +3 -1
- package/esm/kimi-tools.d.mts +69 -0
- package/esm/kimi-tools.d.mts.map +1 -0
- package/esm/kimi-tools.mjs +256 -0
- package/esm/kimi-tools.mjs.map +1 -0
- package/esm/known-pricing.d.mts +39 -0
- package/esm/known-pricing.d.mts.map +1 -0
- package/esm/known-pricing.mjs +121 -0
- package/esm/known-pricing.mjs.map +1 -0
- package/esm/model.mjs +82 -23
- package/esm/model.mjs.map +1 -1
- package/esm/provider-options.d.mts +13 -0
- package/esm/provider-options.d.mts.map +1 -0
- package/esm/provider-options.mjs +56 -0
- package/esm/provider-options.mjs.map +1 -0
- package/esm/responses-model.mjs +125 -19
- package/esm/responses-model.mjs.map +1 -1
- package/esm/sdk.d.mts +4 -5
- package/esm/sdk.d.mts.map +1 -1
- package/esm/sdk.mjs +5 -3
- package/esm/sdk.mjs.map +1 -1
- package/esm/speech.d.mts +1 -3
- package/esm/speech.d.mts.map +1 -1
- package/esm/transcription.d.mts +1 -3
- package/esm/transcription.d.mts.map +1 -1
- package/esm/transcription.mjs.map +1 -1
- package/esm/utils/build-usage.mjs +14 -2
- package/esm/utils/build-usage.mjs.map +1 -1
- package/esm/utils/hosted-output.mjs +22 -0
- package/esm/utils/hosted-output.mjs.map +1 -0
- package/esm/utils/index.mjs +2 -2
- package/esm/utils/map-responses-status.mjs.map +1 -1
- package/esm/utils/prompt-cache-params.mjs +25 -6
- package/esm/utils/prompt-cache-params.mjs.map +1 -1
- package/esm/utils/reasoning-replay.mjs +23 -1
- package/esm/utils/reasoning-replay.mjs.map +1 -1
- package/esm/utils/structured-output.mjs +1 -1
- package/esm/utils/structured-output.mjs.map +1 -1
- package/esm/utils/to-openai-messages.mjs.map +1 -1
- package/esm/utils/to-openai-tools.mjs.map +1 -1
- package/esm/utils/wrap-openai-error.mjs +6 -1
- package/esm/utils/wrap-openai-error.mjs.map +1 -1
- package/llms-full.txt +235 -37
- package/llms.txt +1 -1
- package/package.json +3 -3
- package/skills/setup-openai/SKILL.md +235 -37
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,46 @@ 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.32.0 - 2026-10-18
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Remove the unreleased Kimi/Moonshot `$web_search` builtin echo path; reject declarations of the builtin retiring on 20 October 2026 and document migration to standalone REST tools.
|
|
12
|
+
|
|
13
|
+
- Pin the package development compiler to TypeScript 7.0.2 and use explicit Node types and source roots with supported module resolution.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Verified that Responses native token counting preserves the shared unsupported-count signal for `countInputTokens` estimation while authentication errors propagate.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Export `kimiSearchTool()` (Basic/Pro), `kimiFetchTool()` and verified `KIMI_SERVER_TOOL_PRICING`: authenticated, cancellable first-party REST calls with compact results, mapped errors, no automatic retries, and billable response usage/costs aggregated into agent reports.
|
|
22
|
+
|
|
23
|
+
- Retain Responses hosted output/actions/sources and count web-search calls without double-counting stream snapshots. Export opt-in `OPENAI_SERVER_TOOL_PRICING`. Support typed Qwen/DashScope `enableSearch` flags.
|
|
24
|
+
|
|
25
|
+
## 5.31.0 - 2026-10-18
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Provider body objects replace the adapter-built object when their string `type` discriminator changes, so format and tool-choice overrides do not retain incompatible fields from the old variant. Same-type and undiscriminated objects keep the one-level merge.
|
|
30
|
+
- Provider body options merge plain-object fields one level deep, preserving neutral reasoning, generation and structured-output settings unless the caller overrides their keys.
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- Built-in OpenAI list prices (`OPENAI_MODEL_PRICING`, `openAIPricingFor`) for flat-priced models, from OpenAI's pricing page as of 2026-10-17, applied only on the `"openai"` provider label and exact ids. Models priced by prompt length stay unpriced.
|
|
35
|
+
- Usage is marked `inputIncludesCache: true`, reports Chat Completions `prompt_tokens_details.cache_write_tokens`, and `complete()` / the streaming `done` chunk attach `usage.cost` when priced.
|
|
36
|
+
- 503 / `server_is_overloaded` throws `ProviderOverloadedError`; wrapped errors carry `status`, `billed` and `retryable`.
|
|
37
|
+
- An adapter contract test verifies that aborting `signal` rejects `complete()` and `stream()` on the Chat Completions and Responses models and cancels the HTTP request.
|
|
38
|
+
- With `streamChunks`, the Responses model yields `reasoning` for reasoning-summary / reasoning-text deltas and `tool-args` for `response.function_call_arguments.delta`; the Chat model yields `tool-args` for tool-call argument fragments and `reasoning` for a compatible vendor's `reasoning_content` / `reasoning` delta field (DeepSeek, Groq).
|
|
39
|
+
- `ai.providerTool({ provider: "openai", definition })` adds Responses built-in tools (`web_search`, `file_search`, `code_interpreter`, …) verbatim. A reasoning item that led into a hosted tool call is left out of the stateless replay, and built-in calls the caller would have to execute (`shell_call`, `apply_patch_call`, `computer_call`, `custom_tool_call`, …) throw `InvalidRequestError` instead of being dropped. Chat Completions sends a provider tool only when its `provider` equals the model's provider label (e.g. `"groq"`).
|
|
40
|
+
- `providerOptions.openai.body` forwards native per-call request options for completions and streams while protecting the model, conversation and tool definitions.
|
|
41
|
+
- Responses models expose native input-token preflight through `countTokens()`; Chat Completions keeps offline estimates separate.
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- `promptCacheKey` is sent as `prompt_cache_key` for the `"xai"` and `"mistral"` provider labels as well, since both endpoints document the field. `prompt_cache_retention` and explicit cache breakpoints stay OpenAI-only; other labels receive no cache fields.
|
|
46
|
+
|
|
7
47
|
## 5.30.0 - 2026-10-16
|
|
8
48
|
|
|
9
49
|
### Changed
|
|
@@ -91,6 +131,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
91
131
|
### Changed
|
|
92
132
|
|
|
93
133
|
- Lockstep release maintenance and dependency refresh.
|
|
134
|
+
|
|
94
135
|
## 5.20.0 - 2026-09-24
|
|
95
136
|
|
|
96
137
|
### Changed
|
|
@@ -161,7 +202,7 @@ changelogs.
|
|
|
161
202
|
|
|
162
203
|
### Changed
|
|
163
204
|
|
|
164
|
-
- **`openai` moves from `^6.34.0` to `^7.4.0`.** The runtime was unaffected: the full suite — 13 files / 208 tests — passed on 7.4.0
|
|
205
|
+
- **`openai` moves from `^6.34.0` to `^7.4.0`.** The runtime was unaffected: the full suite — 13 files / 208 tests — passed on 7.4.0 _before_ any of the type fixes below were made, so nothing about the wire shape this adapter sends or the responses it reads changed across the major. Every fix in this release is a compile-time one.
|
|
165
206
|
- **`OpenAI.Images.ImageGenerateParamsBase` is no longer reachable upstream** — openai 7 split image generation into `ImageGenerateParamsNonStreaming` / `ImageGenerateParamsStreaming` and stopped re-exporting the shared `Base` interface from the `Images` namespace. `image.ts` now sources its `quality` / `output_format` / `background` value types from `ImageGenerateParamsNonStreaming`, which is what the request body was already typed as and what the non-streaming `images.generate` overload accepts. The three fields are inherited from `Base` unchanged, so the accepted values are identical.
|
|
166
207
|
- **`ChatCompletionTool` became a union** (`ChatCompletionFunctionTool | ChatCompletionCustomTool`) now that Chat Completions carries custom tools. `.function` is no longer reachable without the `type` discriminant, so the tool-conversion specs narrow on `type === "function"` and throw on anything else — a custom-tool regression fails loudly rather than silently skipping the assertion it used to make.
|
|
167
208
|
|
package/README.md
CHANGED
|
@@ -68,9 +68,9 @@ openai.embedder({ name: "text-embedding-3-large", dimensions: 256 });
|
|
|
68
68
|
|
|
69
69
|
`OpenAIModel` declares:
|
|
70
70
|
|
|
71
|
-
| Capability | Default
|
|
72
|
-
| ------------------ |
|
|
73
|
-
| `structuredOutput` | `true` — schemas forwarded as `response_format: json_schema, strict`
|
|
71
|
+
| Capability | Default |
|
|
72
|
+
| ------------------ | ----------------------------------------------------------------------- |
|
|
73
|
+
| `structuredOutput` | `true` — schemas forwarded as `response_format: json_schema, strict` |
|
|
74
74
|
| `vision` | Auto-inferred from model name; pass `vision: true \| false` to override |
|
|
75
75
|
|
|
76
76
|
Vision auto-inference matches model name prefixes: `gpt-4o`, `gpt-4-turbo`, `gpt-4.1`, `o1`, `o3`, `chatgpt-4o`. Unknown models default to `vision: false` so unsupported requests fail with a clear capability error rather than an opaque OpenAI 400.
|