@code-yeongyu/senpi-ai 2026.8.30-3 → 2026.8.31

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/README.md CHANGED
@@ -97,6 +97,9 @@ Unified LLM API with provider collections, automatic auth resolution, token and
97
97
 
98
98
  ```bash
99
99
  npm install @earendil-works/pi-ai
100
+
101
+ # Bun alternative
102
+ bun add @earendil-works/pi-ai
100
103
  ```
101
104
 
102
105
  TypeBox exports are re-exported from `@earendil-works/pi-ai`: `Type`, `Static`, and `TSchema`.
@@ -1552,9 +1555,9 @@ Official docs: [Application Default Credentials](https://cloud.google.com/docs/a
1552
1555
  The quickest way to authenticate:
1553
1556
 
1554
1557
  ```bash
1555
- npx @earendil-works/pi-ai login # interactive provider selection
1556
- npx @earendil-works/pi-ai login anthropic # login to specific provider
1557
- npx @earendil-works/pi-ai list # list available providers
1558
+ bunx @earendil-works/pi-ai login # interactive provider selection
1559
+ bunx @earendil-works/pi-ai login anthropic # login to specific provider
1560
+ bunx @earendil-works/pi-ai list # list available providers
1558
1561
  ```
1559
1562
 
1560
1563
  Credentials are saved to `auth.json` in the current directory.
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAGX,+BAA+B,EAK/B,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACX,wBAAwB,EAKxB,OAAO,EAGP,KAAK,EAGL,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAOb,MAAM,aAAa,CAAC;AAqCrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AA6JlE,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAA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EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AA6JlE,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,SAAS,CAAC;AAuFhE,MAAM,WAAW,gBAAiB,SAAQ,aAAa;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,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,wBAAwB,CAAC;IAC5C;;;;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;AAo4BD,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CAqbzE,CAAC;AA0FF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,oBAAoB,EAAE,mBAAmB,CA+ClF,CAAC;AA6IF,wBAAgB,mCAAmC,CAClD,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,EAClC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,gBAAgB,GACxB,+BAA+B,CAkBjC"}
@@ -1,5 +1,6 @@
1
1
  import Anthropic from "@anthropic-ai/sdk";
2
2
  import { calculateCost } from "../models.js";
3
+ import { registerSessionResourceCleanup } from "../session-resources.js";
3
4
  import { isVideoMimeType } from "../types.js";
4
5
  import { combineAbortSignals } from "../utils/abort-signals.js";
5
6
  import { splitDeferredTools } from "../utils/deferred-tools.js";
@@ -181,6 +182,20 @@ const SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
181
182
  // A provider can reject its own empty signatures. Learn that capability for one
182
183
  // conversation without changing the shared model definition used by other sessions.
183
184
  const unsignedThinkingTextReplayFallbacks = new Set();
185
+ registerSessionResourceCleanup((sessionId) => {
186
+ // One small entry per (session, base URL, model) that ever hit the fallback;
187
+ // drop the session's entries at teardown so long-lived hosts do not collect
188
+ // them for every session that ever ran.
189
+ if (sessionId === undefined) {
190
+ unsignedThinkingTextReplayFallbacks.clear();
191
+ return;
192
+ }
193
+ const prefix = `${sessionId}\u0000`;
194
+ for (const key of unsignedThinkingTextReplayFallbacks) {
195
+ if (key.startsWith(prefix))
196
+ unsignedThinkingTextReplayFallbacks.delete(key);
197
+ }
198
+ });
184
199
  function unsignedThinkingFallbackKey(model, sessionId) {
185
200
  return sessionId === undefined ? undefined : `${sessionId}\u0000${model.baseUrl}\u0000${model.id}`;
186
201
  }