@bastani/atomic-ai 0.9.89-alpha.2 → 0.9.90-alpha.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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ This package is Atomic's fork of `@earendil-works/pi-ai`, published as `@bastani
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.9.89] - 2026-11-18
8
+
9
+ ### Added
10
+
11
+ - `getEnvApiKeyAsync()` checks environment-provided credentials without synchronous file access. `getEnvApiKey()` remains synchronous and recognizes a passed credentials file on its first call. The compatibility entry point also exports `getDirectEnvApiKey()` for environment-only lookups that never inspect a file
12
+ - Added GPT-6.2 Astra and GPT-6.2 Sol to the OpenAI (`openai`, `openai-api`), Azure OpenAI Responses and OpenAI Codex catalogs with OpenAI's published prices (Astra: $8 input, $0.40 cached input, $10 cache writes, $40 output per million tokens; Sol: $2, $0.10, $2.50, $10), the request-wide tier above 272K input tokens, Fast at 2x Standard, Ultrafast at 3x Standard (OpenAI's rate until March 1, 2027), tool search, additional tools, and mid-conversation effort changes. Both reject reasoning effort `none` and `minimal`, so `off` is unavailable. Azure serves them with a 1.05M context window; Codex and a ChatGPT sign-in on `openai` serve GPT-6.2 Sol with 500K and GPT-6.2 Astra with 272K (upstream [e56d35c](https://github.com/earendil-works/pi/commit/e56d35ce5eceedfa16eaf13a5f01a1f7b7271253), [cead615](https://github.com/earendil-works/pi/commit/cead615b48b80d1c61eecab2f0b576d16eeaf4c5))
13
+
7
14
  ## [0.9.89-alpha.1] - 2026-11-18
8
15
 
9
16
  ### Added
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAkD,MAAM,mBAAmB,CAAC;AAqBnF,OAAO,KAAK,EASX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAMb,MAAM,aAAa,CAAC;AA4LrB,MAA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IACtD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAkOD,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CA4bzE,CAAC;AA+CF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,oBAAoB,EAAE,mBAAmB,CAgDlF,CAAC"}
@@ -27,6 +27,7 @@ import { getSystemMessageText, renderSystemMessageUpdate } from "../utils/text.j
27
27
  import { appendThinkingOffFallbackDiagnostic, getThinkingOffFallbackLevel } from "../utils/thinking-off.js";
28
28
  import { getCurrentTools, getInitialSystemMessage, resolveTranscript, } from "../utils/transcript.js";
29
29
  import { convertAnthropicAssistantContent } from "./anthropic-assistant-content.js";
30
+ import { takeAnthropicSerializedBody } from "./anthropic-serialized-body.js";
30
31
  import { ANTHROPIC_STRICT_JSON_SCHEMA_PROFILE, getJsonSchemaToolParameters, prefersJsonSchemaStrictSampling, resolveJsonSchemaStrictSampling, } from "./constrained-sampling.js";
31
32
  import { buildCopilotDynamicHeaders, hasCopilotVisionInput, preserveCopilotIntegrationHeader, } from "./github-copilot-headers.js";
32
33
  import { adjustMaxTokensForThinking, buildBaseOptions, clampMaxTokensToContext } from "./simple-options.js";
@@ -795,9 +796,12 @@ export const stream = (model, context, options) => {
795
796
  ...(options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {}),
796
797
  maxRetries: 0,
797
798
  };
799
+ let serializedBody;
798
800
  const send = (body) => retryProviderRequest(() => {
799
801
  streamAttempt.begin();
800
- return client.beta.messages.create({ ...body, stream: true }, requestOptions).asResponse();
802
+ const transport = serializedBody ? { ...requestOptions, middleware: [serializedBody] } : requestOptions;
803
+ serializedBody = undefined;
804
+ return client.beta.messages.create({ ...body, stream: true }, transport).asResponse();
801
805
  }, {
802
806
  maxRetries: options?.maxRetries,
803
807
  maxRetryDelayMs: options?.maxRetryDelayMs,
@@ -818,6 +822,7 @@ export const stream = (model, context, options) => {
818
822
  output.providerThinkingLevel = built.providerThinkingLevel;
819
823
  params = built.params;
820
824
  const nextParams = await options?.onPayload?.(params, model);
825
+ serializedBody = takeAnthropicSerializedBody(params);
821
826
  if (nextParams !== undefined)
822
827
  params = nextParams;
823
828
  assertPayloadPreservesFastRoute(model, params);