@bastani/pi-ai 0.9.20-alpha.9 → 0.9.20

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 CHANGED
@@ -4,6 +4,54 @@ This package is a Bastani fork of `@earendil-works/pi-ai`. Upstream history at t
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.9.20] - 2026-09-24
8
+
9
+ ### Breaking Changes
10
+
11
+ - Image generation now uses `ImageModel` entries in the regular `Provider` and `Models` collection instead of the separate `ImagesModels`/`ImagesProvider` collection. Replace `createImagesModels()`, `createImagesProvider()`, `builtinImagesModels()`, and `openrouterImagesProvider()` with `createModels()`/`builtinModels()` and `models.getModelOfType("image", ...)`/`models.generateImages()`. The old plural image type names are removed; generated image catalog data now ships alongside chat and classifier entries.
12
+ - Provider implementations and direct API modules now consume `TranscriptContext`; use `normalizeContext()` at direct-call boundaries and replay helpers to read prompt/tool state. Durable tool arguments and results use JSON-value types.
13
+
14
+ ### Added
15
+
16
+ - Added `onProviderStreamEvent` to observe parsed provider stream events before normalization, including provider-specific fields not retained in assistant messages ([#9784](https://github.com/earendil-works/pi/issues/9784)).
17
+ - Added operation-specific model accessors (`getModelsOfType()`, `getModelOfType()`, `getAvailableOfType()`, `getAllModels()`, `getAllAvailable()`), image and classifier dispatch on providers, and `classify()` for structured choice, score, and bool questions. The built-in TypeSafe `jev-latest` classifier uses `TYPESAFE_API_KEY`; OpenRouter image models share OpenRouter authentication. Chat-only reads and models with no `type` continue to mean chat.
18
+ - Added typed JSON catalog variants (`models.all.json` and `providers/{id}.all.json`) alongside the existing chat-only variants for clients that request all operation types.
19
+ - Added Jev classifier models on OpenRouter (`typesafe/jev-1.13`, `~typesafe/jev-latest`) through its TypeSafe-compatible System One endpoint, and on Cloudflare Workers AI (`typesafe/jev`) through the new `cloudflare-workers-ai-system-one` classifier API.
20
+ - Added Claude Opus 5.5, GPT-6 Sol, and GPT-6 Luna to the GitHub Copilot catalog.
21
+ - Added GPT-6 Sol and GPT-6 Luna for OpenAI API keys and OpenAI Codex subscriptions, with full reasoning-effort, prompt-caching, tool-search, long-context pricing, and official cost metadata.
22
+ - Added `getDecisionModels()` and a generated models.dev decision-model catalog (`type: "decision"`, fetched from `https://models.dev/api.json?type=all` by `npm run generate-decision-models`) listing TypeSafe Jev on the gateways that resell it, with context limits and prices.
23
+ - Added Claude Opus 5.5 to the built-in Anthropic model catalog with adaptive thinking, 1M context, and official pricing metadata.
24
+ - Added Anthropic fast mode for models whose `fastRoute` declares `speed: "fast"`: the Anthropic Messages adapter sends the route's upstream model with `speed: "fast"` and the `fast-mode-2026-02-01` beta, prices responses reporting fast speed at the 2x fast-mode rates, and rejects payload hooks that change the route-owned model or speed.
25
+ - Added Meta provider (Model API key and Muse subscription OAuth) with Muse Spark models.
26
+ - Added model image-input limit and cache-safe resize metadata (`inputLimits`) to the `Model` type and the generated catalog ([#9631](https://github.com/earendil-works/pi/issues/9631)).
27
+ - Added Grok 4.7 to the built-in xAI model catalog with long-context pricing metadata.
28
+ - Chronological system messages with named prompt patches and tool additions/removals, including native provider transitions where supported and replay checkpoints elsewhere.
29
+ - A static Radius catalog with authenticated dynamic refresh, refreshed image models, and prompt-cache lifetime metadata for direct Anthropic models.
30
+
31
+ ### Fixed
32
+
33
+ - Fixed Claude Opus 5.5 on GitHub Copilot offering thinking levels other than low, medium, high, xhigh, and max when models.dev lists the model before its effort metadata is complete.
34
+ - Fixed 1-hour Anthropic cache writes reported by Vercel AI Gateway in streaming deltas being priced at the 5-minute rate ([#9210](https://github.com/earendil-works/pi/issues/9210)).
35
+ - Rejected malformed TypeSafe classifier answers when the returned choice, score, confidence, or probability falls outside the submitted question's bounds.
36
+ - Fixed Anthropic and Bedrock Claude requests failing with HTTP 400 when a tool opted into `strict: "prefer"` JSON-schema constrained sampling with numeric, string-length, or `maxItems`/`minItems` constraints that Claude's strict mode rejects. These tools now fall back to non-strict tool use, and `strict: "require"` reports the unsupported keyword.
37
+ - Fixed Anthropic OAuth requests for Claude Opus 5.5 rejected with `claude_code_version_too_old` by advertising Claude Code version `2.1.280`, the minimum the API requires.
38
+ - Fixed Fast-mode usage costs for GPT-6 models being recorded at standard rates when OpenAI reports the tier as `service_tier: "fast"` instead of `priority`.
39
+ - Fixed Claude Opus 5.5 offering thinking levels other than low, medium, high, xhigh, and max when models.dev lists the model before its effort metadata is complete.
40
+ - Fixed unknown OpenAI-compatible Chat Completions endpoints receiving strict tool schemas unless they explicitly advertise support (`compat.supportsStrictMode` now defaults to `false`), while preserving strict tools for capable built-in models ([#9816](https://github.com/earendil-works/pi/issues/9816)).
41
+ - Fixed image-only user messages being rejected by some OpenAI-compatible providers because they included an empty text part ([#9797](https://github.com/earendil-works/pi/issues/9797)).
42
+ - Derive Gemini thinking levels from model metadata, preserve renamed Anthropic/Vercel unsigned thinking replay and DeepSeek V4 effort, retry Cloudflare 520 and Azure peak-load errors, and scope bodyless overflow detection to Cerebras.
43
+ - Documented Fireworks deferred tool loading against chronological system-message `toolsAdded`/`toolsRemoved` instead of the removed tool-result `addedToolNames` field.
44
+ - Request-auth preparation now times out after 15 seconds when OAuth refresh, credential-store reads, or auth derivation ignore cancellation, and late refresh results cannot overwrite stored credentials. The timeout diagnostic is source-neutral and does not instruct you to log in ([#3085](https://github.com/bastani-inc/atomic/issues/3085), [#3087](https://github.com/bastani-inc/atomic/pull/3087)).
45
+ - Bedrock requests now honor explicit `maxRetries`, including zero for a single transport attempt, instead of silently using the AWS SDK retry default. Omitting the option preserves SDK/environment configuration ([#3089](https://github.com/bastani-inc/atomic/issues/3089), [#3090](https://github.com/bastani-inc/atomic/issues/3090)).
46
+ - Kept Kimi Coding models available after the upstream catalog split into regional coding plans, preserving Atomic's existing kimi.com endpoint.
47
+ - Model catalog declarations preserve JSON import attributes for strict NodeNext consumers without requiring `skipLibCheck` ([#3105](https://github.com/bastani-inc/atomic/issues/3105)).
48
+ - Credential screening now recognizes `TYPESAFE_API_KEY` instead of `TYPESAFE_AI_API_KEY`, matching the renamed TypeSafe Jev environment variable.
49
+ - Fixed z.ai `Prompt too long` errors not being recognized as context overflow ([earendil-works/pi#9805](https://github.com/earendil-works/pi/issues/9805)).
50
+ - Fixed Cerebras models advertising unsupported strict tool schemas, which caused HTTP 400 errors when strict and non-strict tools were mixed ([earendil-works/pi#9804](https://github.com/earendil-works/pi/pull/9804) by [@EdenGottlieb](https://github.com/EdenGottlieb)).
51
+ - Fixed OpenAI-compatible Responses errors to identify the actual provider instead of always labeling them as OpenAI errors ([#9298](https://github.com/earendil-works/pi/issues/9298)).
52
+ - Fixed Amazon Bedrock one-hour cache writes being priced at the five-minute rate ([#9457](https://github.com/earendil-works/pi/issues/9457)).
53
+ - Fixed Baseten requests to send session-affinity headers from `sessionId` for automatic prompt-cache routing ([#9629](https://github.com/earendil-works/pi/issues/9629)).
54
+
7
55
  ## [0.9.20-alpha.9] - 2026-09-24
8
56
 
9
57
  ### Breaking Changes
@@ -1 +1 @@
1
- {"schemaVersion":6,"generatedAt":"2026-09-24T18:43:56.935Z","structureHash":"b87f23819ea04e458a3ef30b1190f4f0b4ff078480b08403d131fd980375f2b9","files":{"amazon-bedrock.json":"4aaaacf510450685dd0959e679c277251ae6897f8b96a6f4a0a7a67ea608efde","ant-ling.json":"628feab3ef6c7d80ce96f75999804e1d9f05fec3851e5302e30fff3b69db90f6","anthropic.json":"a0d4e7cd3acbce548f310c5149ee2a8aed6d19657849d19d1aa829c4da0700c1","azure-openai-responses.json":"02cf256c8c3536e81704aac20929266635220ae10a695771d6bd90abb250f5df","baseten.json":"883cdb952fd9eb8d8e3605c460744af36802d325f9a38f75998365e2871a5bcc","cerebras.json":"599b8885cea721d0e18912141cb83f0c861b92ef2a889ad680cf9e880ee8345f","cloudflare-ai-gateway.json":"67aa638885159c307561c908c218734c17ecbf541a509481b9774f9257faaa9a","cloudflare-workers-ai.json":"3f0a7654180c72fce112986567bb899f4a19815a9e8655e95876729b67e9529e","deepseek.json":"10a296fb3e898f7715c80890c8af0af4f5fd58f22dbcd6612fdc5d762157ccdc","fireworks.json":"9efd5fd4f42999d170d07f4a13b9c69ef9224742185bf8bba6d558282a4dd776","github-copilot.json":"38caa1163101094b640032e2896c17861bee3f30aa4a4bf6b1de0a276df56358","google-vertex.json":"40090c680538bc867f2624d986a449f361be4dfa6ba96d7a27402050f036e009","google.json":"c0f5a633e5e5a5044432db3e537f4bc674d4de18df09325c6349547fcc13cabe","groq.json":"910952ad9dad07856983459d63fce0148dba1203edd7b10d801a77c5824f3405","huggingface.json":"1b8604bd31a5e05fe43a40ec1ec6dfc1a51a28b0b020151ef057fab43f57c923","kimi-coding.json":"582250b920454d98940da3e7e99d30b807edbea28f2eb8ac15f658d2ef41e8fc","meta.json":"0c7e9a370a7005c5a89dc94f0f93bc67b8935c3f802de324f11af6ff56fff429","minimax-cn.json":"f962c20ee6a6a342820f778e9dc363a18a524bf11998f6e2c57f2989915d62e5","minimax.json":"17a432f80d0ea6dd26eade80a4314250d3a855678601728a5f70dd8fa0d21dd2","mistral.json":"790517a3abf5f652251f42658d6b285ecebe5a653bebe1fe69887caa1dd05f1d","moonshotai-cn.json":"79c9585dc84ee525ebaebbc78b3c55f3d369ec884d4f943488f1e0b14e3587f5","moonshotai.json":"1da2c4e34f22aef17a07c974d85bdee8e1b68b6dc712e3769c935b3f1e7dadca","nvidia.json":"3b4e7b799bf3eaacd1af0491eef77fe33147ea7f72a3a9fa54d77af0e7eacf4c","openai-codex.json":"3c45b36f6f0bcaf4b171f573492513d86873b19d20e4b90bb5612c529d91def5","openai.json":"c38b47e2e10a81ef308a9777c7e85fc52df24d2db13028e3f5b40e9c1e00a6ff","opencode-go.json":"41db161844de0829193e41c3a8bcea2277e68265de53304478d7ac831141a3db","opencode.json":"ea07ed309674da088bfbe67cb2c3abc17e8fbf8897c98936aaf8b078cb682e5e","openrouter.json":"c2b215c47aee97a715c44ddfbf9bf93cd314e8a0cccbc028e45227ab0e016fdb","qwen-token-plan-cn.json":"2469a4091c474ec3db0a49a9962d8d2726c074ad9065b96bc4e0c87861c4c6c5","qwen-token-plan-individual.json":"0fb7cf64faf39d1a3b0a884210a86c87084b805eda15644f5f39293287b959dd","qwen-token-plan.json":"eff10620cb577142de4ec02698d5961a71fda2fe4f6ae7ea9432bad9d6844176","radius.json":"834a2315ceaab47b333967ae63abf906bde6520ea1d4427bc44f7b5a5848348e","together.json":"9b801ea54d982885f94ca16fa054a85a80c083653ac19fc9e741e73478dd78d4","typesafe.json":"a4429a2f696d5cc5273969af61a7310bda07d6bdcd27bf9ac9c76c534cc43716","vercel-ai-gateway.json":"b9306e07a8e100cac8c81f229dc317355d7a8961c0be680d4803c7ddb3dda38a","xai.json":"879c49b78b663a52a220ac4ee013e726b10c4f50aaa03bc58ee53a4b54c76928","xiaomi-token-plan-ams.json":"ca65178f4525d9705bc8d085ed136cecbe149c4080e857ea6a64ae643d2ac00a","xiaomi-token-plan-cn.json":"b065326926681c2262084e59c1c19ebdaf146c07107b5242c76b456becf74db0","xiaomi-token-plan-sgp.json":"92c3d6d707f81fd9cd2b6d1fb57dc431d90ba51e10fe49d97bc8806035c23492","xiaomi.json":"b81d01a374f7b558728c78d81f4168efa9c8996e6e2b5618409a8094b083c759","zai-coding-cn.json":"ee5ee705fb6e413a6088db5e3616c27fce802a8ece6c355f1db35490d787f610","zai.json":"58e6642fdfb736f0b9a4a277c760c536a3cea66a030abbfb2615f7b2851d5c6f"}}
1
+ {"schemaVersion":6,"generatedAt":"2026-09-25T05:37:42.149Z","structureHash":"53bd702a6ccbfeb008647e6877695ba61a46d215161cc11be0cdcb09785845b1","files":{"amazon-bedrock.json":"4aaaacf510450685dd0959e679c277251ae6897f8b96a6f4a0a7a67ea608efde","ant-ling.json":"628feab3ef6c7d80ce96f75999804e1d9f05fec3851e5302e30fff3b69db90f6","anthropic.json":"a0d4e7cd3acbce548f310c5149ee2a8aed6d19657849d19d1aa829c4da0700c1","azure-openai-responses.json":"02cf256c8c3536e81704aac20929266635220ae10a695771d6bd90abb250f5df","baseten.json":"883cdb952fd9eb8d8e3605c460744af36802d325f9a38f75998365e2871a5bcc","cerebras.json":"c07ed7880030c5c85a89520ec4e0fceaf2b2988356345cb1287538337971badd","cloudflare-ai-gateway.json":"67aa638885159c307561c908c218734c17ecbf541a509481b9774f9257faaa9a","cloudflare-workers-ai.json":"3f0a7654180c72fce112986567bb899f4a19815a9e8655e95876729b67e9529e","deepseek.json":"10a296fb3e898f7715c80890c8af0af4f5fd58f22dbcd6612fdc5d762157ccdc","fireworks.json":"9efd5fd4f42999d170d07f4a13b9c69ef9224742185bf8bba6d558282a4dd776","github-copilot.json":"38caa1163101094b640032e2896c17861bee3f30aa4a4bf6b1de0a276df56358","google-vertex.json":"40090c680538bc867f2624d986a449f361be4dfa6ba96d7a27402050f036e009","google.json":"c0f5a633e5e5a5044432db3e537f4bc674d4de18df09325c6349547fcc13cabe","groq.json":"910952ad9dad07856983459d63fce0148dba1203edd7b10d801a77c5824f3405","huggingface.json":"1b8604bd31a5e05fe43a40ec1ec6dfc1a51a28b0b020151ef057fab43f57c923","kimi-coding.json":"582250b920454d98940da3e7e99d30b807edbea28f2eb8ac15f658d2ef41e8fc","meta.json":"0c7e9a370a7005c5a89dc94f0f93bc67b8935c3f802de324f11af6ff56fff429","minimax-cn.json":"f962c20ee6a6a342820f778e9dc363a18a524bf11998f6e2c57f2989915d62e5","minimax.json":"17a432f80d0ea6dd26eade80a4314250d3a855678601728a5f70dd8fa0d21dd2","mistral.json":"790517a3abf5f652251f42658d6b285ecebe5a653bebe1fe69887caa1dd05f1d","moonshotai-cn.json":"79c9585dc84ee525ebaebbc78b3c55f3d369ec884d4f943488f1e0b14e3587f5","moonshotai.json":"1da2c4e34f22aef17a07c974d85bdee8e1b68b6dc712e3769c935b3f1e7dadca","nvidia.json":"3b4e7b799bf3eaacd1af0491eef77fe33147ea7f72a3a9fa54d77af0e7eacf4c","openai-codex.json":"3c45b36f6f0bcaf4b171f573492513d86873b19d20e4b90bb5612c529d91def5","openai.json":"c38b47e2e10a81ef308a9777c7e85fc52df24d2db13028e3f5b40e9c1e00a6ff","opencode-go.json":"41db161844de0829193e41c3a8bcea2277e68265de53304478d7ac831141a3db","opencode.json":"ea07ed309674da088bfbe67cb2c3abc17e8fbf8897c98936aaf8b078cb682e5e","openrouter.json":"bb908eb70d92dcc43ddabc839c47ac39160b9c5f2e1f855c44d60a35be542928","qwen-token-plan-cn.json":"2469a4091c474ec3db0a49a9962d8d2726c074ad9065b96bc4e0c87861c4c6c5","qwen-token-plan-individual.json":"0fb7cf64faf39d1a3b0a884210a86c87084b805eda15644f5f39293287b959dd","qwen-token-plan.json":"eff10620cb577142de4ec02698d5961a71fda2fe4f6ae7ea9432bad9d6844176","radius.json":"834a2315ceaab47b333967ae63abf906bde6520ea1d4427bc44f7b5a5848348e","together.json":"9b801ea54d982885f94ca16fa054a85a80c083653ac19fc9e741e73478dd78d4","typesafe.json":"a4429a2f696d5cc5273969af61a7310bda07d6bdcd27bf9ac9c76c534cc43716","vercel-ai-gateway.json":"3e2322c0ec84279f91aaa6282e4a71d9c987380839ece3a73b5f13768ee98a33","xai.json":"879c49b78b663a52a220ac4ee013e726b10c4f50aaa03bc58ee53a4b54c76928","xiaomi-token-plan-ams.json":"ca65178f4525d9705bc8d085ed136cecbe149c4080e857ea6a64ae643d2ac00a","xiaomi-token-plan-cn.json":"b065326926681c2262084e59c1c19ebdaf146c07107b5242c76b456becf74db0","xiaomi-token-plan-sgp.json":"92c3d6d707f81fd9cd2b6d1fb57dc431d90ba51e10fe49d97bc8806035c23492","xiaomi.json":"b81d01a374f7b558728c78d81f4168efa9c8996e6e2b5618409a8094b083c759","zai-coding-cn.json":"ee5ee705fb6e413a6088db5e3616c27fce802a8ece6c355f1db35490d787f610","zai.json":"58e6642fdfb736f0b9a4a277c760c536a3cea66a030abbfb2615f7b2851d5c6f"}}
@@ -1 +1 @@
1
- {"openai-completions":{"chat:gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.35,"output":0.75,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"type":"chat"},"chat:qwen-3.8-27b":{"id":"qwen-3.8-27b","name":"Qwen3.8 27B","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.99,"output":1.49,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":32768,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
1
+ {"openai-completions":{"chat:gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.35,"output":0.75,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"type":"chat"},"chat:qwen-3.8-27b":{"id":"qwen-3.8-27b","name":"Qwen3.8 27B","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.99,"output":1.49,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}