@oh-my-pi/pi-ai 16.3.5 → 16.3.7

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 (236) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/types/api-registry.d.ts +1 -1
  3. package/dist/types/auth-broker/client.d.ts +4 -2
  4. package/dist/types/auth-broker/discover.d.ts +1 -1
  5. package/dist/types/auth-broker/index.d.ts +7 -7
  6. package/dist/types/auth-broker/refresher.d.ts +1 -1
  7. package/dist/types/auth-broker/remote-store.d.ts +11 -6
  8. package/dist/types/auth-broker/server.d.ts +1 -1
  9. package/dist/types/auth-broker/snapshot-cache.d.ts +1 -1
  10. package/dist/types/auth-broker/types.d.ts +14 -2
  11. package/dist/types/auth-broker/wire-schemas.d.ts +46 -0
  12. package/dist/types/auth-gateway/index.d.ts +3 -3
  13. package/dist/types/auth-gateway/server.d.ts +3 -3
  14. package/dist/types/auth-gateway/types.d.ts +1 -1
  15. package/dist/types/auth-retry.d.ts +2 -2
  16. package/dist/types/auth-storage.d.ts +44 -6
  17. package/dist/types/dialect/anthropic.d.ts +1 -1
  18. package/dist/types/dialect/catalog.d.ts +1 -1
  19. package/dist/types/dialect/coercion.d.ts +1 -1
  20. package/dist/types/dialect/deepseek.d.ts +1 -1
  21. package/dist/types/dialect/demotion.d.ts +16 -14
  22. package/dist/types/dialect/examples.d.ts +1 -1
  23. package/dist/types/dialect/factory.d.ts +1 -1
  24. package/dist/types/dialect/gemini.d.ts +1 -1
  25. package/dist/types/dialect/gemma.d.ts +1 -1
  26. package/dist/types/dialect/glm.d.ts +1 -1
  27. package/dist/types/dialect/harmony.d.ts +1 -1
  28. package/dist/types/dialect/hermes.d.ts +1 -1
  29. package/dist/types/dialect/history.d.ts +2 -2
  30. package/dist/types/dialect/index.d.ts +11 -11
  31. package/dist/types/dialect/inventory.d.ts +1 -1
  32. package/dist/types/dialect/kimi.d.ts +1 -1
  33. package/dist/types/dialect/minimax.d.ts +1 -1
  34. package/dist/types/dialect/owned-stream.d.ts +2 -2
  35. package/dist/types/dialect/qwen3.d.ts +1 -1
  36. package/dist/types/dialect/rendering.d.ts +2 -2
  37. package/dist/types/dialect/thinking.d.ts +1 -1
  38. package/dist/types/dialect/types.d.ts +1 -1
  39. package/dist/types/dialect/xml.d.ts +1 -1
  40. package/dist/types/error/classes.d.ts +1 -1
  41. package/dist/types/error/finalize.d.ts +3 -3
  42. package/dist/types/error/flags.d.ts +1 -1
  43. package/dist/types/error/format.d.ts +1 -1
  44. package/dist/types/error/index.d.ts +13 -13
  45. package/dist/types/error/provider.d.ts +1 -1
  46. package/dist/types/error/rate-limit.d.ts +1 -1
  47. package/dist/types/index.d.ts +47 -47
  48. package/dist/types/provider-details.d.ts +1 -1
  49. package/dist/types/providers/amazon-bedrock.d.ts +1 -1
  50. package/dist/types/providers/anthropic-client.d.ts +3 -3
  51. package/dist/types/providers/anthropic-messages-server-schema.d.ts +1 -1
  52. package/dist/types/providers/anthropic-messages-server.d.ts +2 -2
  53. package/dist/types/providers/anthropic-wire.d.ts +1 -1
  54. package/dist/types/providers/anthropic.d.ts +3 -3
  55. package/dist/types/providers/aws-credentials.d.ts +2 -2
  56. package/dist/types/providers/azure-openai-responses.d.ts +2 -2
  57. package/dist/types/providers/cursor.d.ts +18 -3
  58. package/dist/types/providers/devin.d.ts +1 -1
  59. package/dist/types/providers/error-message.d.ts +1 -1
  60. package/dist/types/providers/github-copilot-headers.d.ts +1 -1
  61. package/dist/types/providers/gitlab-duo-workflow.d.ts +2 -2
  62. package/dist/types/providers/gitlab-duo.d.ts +2 -2
  63. package/dist/types/providers/google-auth.d.ts +1 -1
  64. package/dist/types/providers/google-gemini-cli.d.ts +6 -4
  65. package/dist/types/providers/google-interactions.d.ts +3 -3
  66. package/dist/types/providers/google-shared.d.ts +7 -5
  67. package/dist/types/providers/google-vertex.d.ts +2 -2
  68. package/dist/types/providers/google.d.ts +2 -2
  69. package/dist/types/providers/kimi.d.ts +3 -3
  70. package/dist/types/providers/mock.d.ts +2 -2
  71. package/dist/types/providers/ollama.d.ts +1 -1
  72. package/dist/types/providers/openai-anthropic-shim.d.ts +2 -2
  73. package/dist/types/providers/openai-chat-server-schema.d.ts +1 -1
  74. package/dist/types/providers/openai-chat-server.d.ts +2 -2
  75. package/dist/types/providers/openai-codex/request-transformer.d.ts +1 -1
  76. package/dist/types/providers/openai-codex/response-handler.d.ts +1 -1
  77. package/dist/types/providers/openai-codex-responses.d.ts +3 -3
  78. package/dist/types/providers/openai-completions.d.ts +3 -3
  79. package/dist/types/providers/openai-reasoning-fallback.d.ts +1 -1
  80. package/dist/types/providers/openai-responses-server-schema.d.ts +1 -1
  81. package/dist/types/providers/openai-responses-server.d.ts +2 -2
  82. package/dist/types/providers/openai-responses.d.ts +5 -5
  83. package/dist/types/providers/openai-shared.d.ts +10 -9
  84. package/dist/types/providers/pi-native-client.d.ts +1 -1
  85. package/dist/types/providers/pi-native-server.d.ts +2 -2
  86. package/dist/types/providers/register-builtins.d.ts +3 -3
  87. package/dist/types/providers/synthetic.d.ts +3 -3
  88. package/dist/types/providers/transform-messages.d.ts +1 -1
  89. package/dist/types/providers/vision-guard.d.ts +1 -1
  90. package/dist/types/registry/alibaba-coding-plan.d.ts +1 -1
  91. package/dist/types/registry/anthropic.d.ts +1 -1
  92. package/dist/types/registry/api-key-login.d.ts +1 -1
  93. package/dist/types/registry/api-key-validation.d.ts +1 -1
  94. package/dist/types/registry/baseten.d.ts +2 -2
  95. package/dist/types/registry/cerebras.d.ts +2 -2
  96. package/dist/types/registry/cloudflare-ai-gateway.d.ts +1 -1
  97. package/dist/types/registry/coreweave.d.ts +2 -2
  98. package/dist/types/registry/cursor.d.ts +1 -1
  99. package/dist/types/registry/deepseek.d.ts +1 -1
  100. package/dist/types/registry/devin.d.ts +1 -1
  101. package/dist/types/registry/firepass.d.ts +2 -2
  102. package/dist/types/registry/fireworks.d.ts +2 -2
  103. package/dist/types/registry/github-copilot.d.ts +1 -1
  104. package/dist/types/registry/gitlab-duo-workflow.d.ts +1 -1
  105. package/dist/types/registry/gitlab-duo.d.ts +1 -1
  106. package/dist/types/registry/google-antigravity.d.ts +1 -1
  107. package/dist/types/registry/google-gemini-cli.d.ts +1 -1
  108. package/dist/types/registry/huggingface.d.ts +2 -2
  109. package/dist/types/registry/index.d.ts +4 -4
  110. package/dist/types/registry/kagi.d.ts +1 -1
  111. package/dist/types/registry/kilo.d.ts +1 -1
  112. package/dist/types/registry/kimi-code.d.ts +1 -1
  113. package/dist/types/registry/litellm.d.ts +1 -1
  114. package/dist/types/registry/llama-cpp.d.ts +1 -1
  115. package/dist/types/registry/lm-studio.d.ts +1 -1
  116. package/dist/types/registry/minimax-code-cn.d.ts +1 -1
  117. package/dist/types/registry/minimax-code.d.ts +1 -1
  118. package/dist/types/registry/moonshot.d.ts +2 -2
  119. package/dist/types/registry/nanogpt.d.ts +2 -2
  120. package/dist/types/registry/nvidia.d.ts +1 -1
  121. package/dist/types/registry/oauth/anthropic.d.ts +3 -3
  122. package/dist/types/registry/oauth/callback-server.d.ts +1 -1
  123. package/dist/types/registry/oauth/cursor.d.ts +1 -1
  124. package/dist/types/registry/oauth/devin.d.ts +1 -1
  125. package/dist/types/registry/oauth/github-copilot.d.ts +2 -2
  126. package/dist/types/registry/oauth/gitlab-duo-workflow.d.ts +2 -2
  127. package/dist/types/registry/oauth/gitlab-duo.d.ts +1 -1
  128. package/dist/types/registry/oauth/google-antigravity.d.ts +1 -1
  129. package/dist/types/registry/oauth/google-gemini-cli.d.ts +1 -1
  130. package/dist/types/registry/oauth/google-oauth-shared.d.ts +2 -2
  131. package/dist/types/registry/oauth/index.d.ts +2 -2
  132. package/dist/types/registry/oauth/kimi.d.ts +1 -1
  133. package/dist/types/registry/oauth/minimax-code.d.ts +2 -2
  134. package/dist/types/registry/oauth/openai-codex.d.ts +1 -1
  135. package/dist/types/registry/oauth/opencode.d.ts +1 -1
  136. package/dist/types/registry/oauth/perplexity.d.ts +1 -1
  137. package/dist/types/registry/oauth/types.d.ts +2 -2
  138. package/dist/types/registry/oauth/wafer.d.ts +1 -1
  139. package/dist/types/registry/oauth/xai-oauth.d.ts +3 -3
  140. package/dist/types/registry/oauth/xiaomi.d.ts +1 -1
  141. package/dist/types/registry/ollama-cloud.d.ts +1 -1
  142. package/dist/types/registry/ollama.d.ts +1 -1
  143. package/dist/types/registry/openai-codex-device.d.ts +1 -1
  144. package/dist/types/registry/openai-codex.d.ts +1 -1
  145. package/dist/types/registry/opencode-go.d.ts +1 -1
  146. package/dist/types/registry/opencode-zen.d.ts +1 -1
  147. package/dist/types/registry/openrouter.d.ts +2 -2
  148. package/dist/types/registry/parallel.d.ts +1 -1
  149. package/dist/types/registry/perplexity.d.ts +2 -2
  150. package/dist/types/registry/qianfan.d.ts +2 -2
  151. package/dist/types/registry/qwen-portal.d.ts +1 -1
  152. package/dist/types/registry/registry.d.ts +69 -69
  153. package/dist/types/registry/sakana.d.ts +2 -2
  154. package/dist/types/registry/synthetic.d.ts +2 -2
  155. package/dist/types/registry/tavily.d.ts +1 -1
  156. package/dist/types/registry/together.d.ts +1 -1
  157. package/dist/types/registry/types.d.ts +1 -1
  158. package/dist/types/registry/umans.d.ts +2 -2
  159. package/dist/types/registry/venice.d.ts +2 -2
  160. package/dist/types/registry/vercel-ai-gateway.d.ts +1 -1
  161. package/dist/types/registry/vllm.d.ts +1 -1
  162. package/dist/types/registry/wafer-serverless.d.ts +1 -1
  163. package/dist/types/registry/xai-oauth.d.ts +1 -1
  164. package/dist/types/registry/xiaomi-token-plan-ams.d.ts +1 -1
  165. package/dist/types/registry/xiaomi-token-plan-cn.d.ts +1 -1
  166. package/dist/types/registry/xiaomi-token-plan-sgp.d.ts +1 -1
  167. package/dist/types/registry/xiaomi.d.ts +1 -1
  168. package/dist/types/registry/zai.d.ts +2 -2
  169. package/dist/types/registry/zenmux.d.ts +2 -2
  170. package/dist/types/registry/zhipu-coding-plan.d.ts +2 -2
  171. package/dist/types/stream.d.ts +6 -6
  172. package/dist/types/types.d.ts +40 -21
  173. package/dist/types/usage/claude.d.ts +1 -1
  174. package/dist/types/usage/gemini.d.ts +1 -1
  175. package/dist/types/usage/github-copilot.d.ts +1 -1
  176. package/dist/types/usage/google-antigravity.d.ts +1 -1
  177. package/dist/types/usage/kimi.d.ts +1 -1
  178. package/dist/types/usage/minimax-code.d.ts +1 -1
  179. package/dist/types/usage/ollama.d.ts +1 -1
  180. package/dist/types/usage/openai-codex-reset.d.ts +1 -1
  181. package/dist/types/usage/openai-codex.d.ts +1 -1
  182. package/dist/types/usage/opencode-go.d.ts +1 -1
  183. package/dist/types/usage/zai.d.ts +1 -1
  184. package/dist/types/usage.d.ts +1 -1
  185. package/dist/types/utils/block-symbols.d.ts +15 -0
  186. package/dist/types/utils/empty-completion-retry.d.ts +2 -2
  187. package/dist/types/utils/event-stream.d.ts +1 -1
  188. package/dist/types/utils/harmony-leak.d.ts +1 -1
  189. package/dist/types/utils/http-inspector.d.ts +19 -0
  190. package/dist/types/utils/leaked-thinking-stream.d.ts +1 -1
  191. package/dist/types/utils/openai-http.d.ts +3 -9
  192. package/dist/types/utils/provider-response.d.ts +1 -1
  193. package/dist/types/utils/proxy.d.ts +1 -1
  194. package/dist/types/utils/request-debug.d.ts +1 -1
  195. package/dist/types/utils/retry.d.ts +1 -1
  196. package/dist/types/utils/schema/equality.d.ts +1 -1
  197. package/dist/types/utils/schema/index.d.ts +15 -15
  198. package/dist/types/utils/schema/normalize.d.ts +7 -2
  199. package/dist/types/utils/schema/spill.d.ts +1 -1
  200. package/dist/types/utils/schema/wire.d.ts +1 -1
  201. package/dist/types/utils/sse-debug.d.ts +1 -1
  202. package/dist/types/utils/thinking-loop.d.ts +2 -2
  203. package/dist/types/utils/tool-call-loop-guard.d.ts +1 -1
  204. package/dist/types/utils/tool-choice.d.ts +1 -1
  205. package/dist/types/utils/validation.d.ts +1 -1
  206. package/dist/types/utils.d.ts +14 -2
  207. package/package.json +4 -4
  208. package/src/auth-broker/client.ts +41 -12
  209. package/src/auth-broker/remote-store.ts +189 -9
  210. package/src/auth-broker/server.ts +109 -7
  211. package/src/auth-broker/types.ts +22 -1
  212. package/src/auth-broker/wire-schemas.ts +22 -0
  213. package/src/auth-storage.ts +292 -22
  214. package/src/dialect/demotion.ts +18 -19
  215. package/src/error/rate-limit.ts +1 -1
  216. package/src/providers/azure-openai-responses.ts +3 -2
  217. package/src/providers/cursor.ts +36 -0
  218. package/src/providers/google-gemini-cli.ts +12 -3
  219. package/src/providers/google-shared.ts +3 -1
  220. package/src/providers/mock.ts +10 -3
  221. package/src/providers/ollama.ts +2 -2
  222. package/src/providers/openai-codex-responses.ts +47 -39
  223. package/src/providers/openai-completions.ts +48 -9
  224. package/src/providers/openai-responses.ts +37 -23
  225. package/src/providers/openai-shared.ts +145 -26
  226. package/src/providers/transform-messages.ts +63 -9
  227. package/src/registry/oauth/wafer.ts +1 -1
  228. package/src/stream.ts +6 -0
  229. package/src/types.ts +45 -3
  230. package/src/usage/claude.ts +28 -8
  231. package/src/utils/block-symbols.ts +18 -0
  232. package/src/utils/http-inspector.ts +32 -4
  233. package/src/utils/openai-http.ts +6 -9
  234. package/src/utils/retry-after.ts +12 -1
  235. package/src/utils/schema/normalize.ts +131 -0
  236. package/src/utils.ts +78 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.3.7] - 2026-07-05
6
+
7
+ ### Fixed
8
+
9
+ - Fixed formatting of demoted reasoning blocks to prevent accidental concatenation with prose
10
+ - Fixed terminal whitespace issues in assistant messages that caused rejections by Anthropic API
11
+ - Fixed Cursor provider handling of empty-pattern grep arguments to return a clear, actionable error instead of a generic error and a broken TUI rendering.
12
+ - Fixed Google Cloud Code Assist API (Antigravity) and Gemini CLI to immediately bubble up underlying API errors (such as safety or recitation blocks) instead of incorrectly retrying and hiding them behind a generic empty-response message.
13
+ - Fixed GitHub Copilot OpenAI Responses replay to prevent empty reasoning-only assistant turns from being persisted in history and poisoning subsequent requests.
14
+ - Fixed classification of provider gateway quota-insufficient errors so they are correctly identified as usage-limit errors rather than generic 403 failures.
15
+ - Fixed OpenAI-compatible Responses models (such as DeepSeek endpoints) to preserve user-configured tool strictness settings unless strict mode is explicitly unsupported.
16
+ - Fixed custom openai-codex-responses providers failing when no ChatGPT account ID claim is present by omitting the header when it cannot be derived.
17
+ - Fixed token accounting for OpenAI Responses and Codex providers to correctly include provider-side orchestration tokens in billing totals without misclassifying them as uncached prompt input.
18
+ - Fixed Google Gemini and Cloud Code Assist providers to preserve the requested reasoning tier when sending requests with hidden thinking summaries.
19
+ - Fixed parallel OpenAI-compatible tool-call streaming to prevent argument data from bleeding across concurrent commands when identifiers are missing.
20
+ - Fixed Anthropic Claude reasoning and thinking replay handling. Same-model replays now drop unsigned prior reasoning blocks to prevent reasoning-extraction refusals, while cross-model replays (including Bedrock cross-region profiles) correctly demote reasoning without emitting raw thinking tags or causing text-flattening formatting issues.
21
+ - Fixed custom OpenAI-compatible relays serving standard OpenAI model IDs to be correctly classified as OpenAI-family targets for fast mode.
22
+
23
+ ## [16.3.6] - 2026-07-04
24
+
25
+ ### Added
26
+
27
+ - Persisted credential rate-limit blocks across processes: `auth_credential_blocks` (auth schema v5) stores per-credential blocks keyed by row id + provider key + block scope with MAX-upsert semantics, `AuthStorage` merges persisted and in-memory blocks on read, and auth-broker snapshots/SSE carry per-entry blocks with `POST /v1/credential/:id/block` and `DELETE /v1/credential/:id/blocks` endpoints so gateway and sibling omp processes stop re-discovering exhausted accounts by burning a 429 each.
28
+
29
+ ### Fixed
30
+
31
+ - Fixed Anthropic credential selection sampling Fable/Mythos-exhausted accounts on every new session: a Fable/Mythos weekly cap now proactively hard-blocks the credential when confirmed exhausted (server `exhausted` status or used fraction >= 1) with a live `resetsAt`, and a live Fable 429 extends the reactive block to the confirmed tier reset instead of the 60s default. Unconfirmed rows (missing/expired reset, below cap) remain ranking hints only, preserving the false-100% guard.
32
+ - Fixed Ollama/Ollama Cloud tool requests failing with HTTP 400 by rewriting boolean subschemas (`true`/`false`) into a value-widening `anyOf` union of primitive types, stripping boolean `additionalProperties`/`unevaluatedProperties`, and flattening nullable `type` arrays before serializing tool parameters, so unconstrained fields still advertise "any JSON value" to grammar-constrained samplers (llama.cpp) instead of collapsing to an empty object. ([#4488](https://github.com/can1357/oh-my-pi/issues/4488))
33
+
5
34
  ## [16.3.5] - 2026-07-04
6
35
 
7
36
  ### Added
@@ -4,7 +4,7 @@
4
4
  * Allows extensions to register streaming functions for custom API types
5
5
  * (e.g., "vertex-claude-api") that are not built into stream.ts.
6
6
  */
7
- import type { Api, AssistantMessageEventStream, Context, Model, SimpleStreamOptions, StreamOptions } from "./types";
7
+ import type { Api, AssistantMessageEventStream, Context, Model, SimpleStreamOptions, StreamOptions } from "./types.js";
8
8
  export type CustomStreamFn = (model: Model<Api>, context: Context, options?: StreamOptions) => AssistantMessageEventStream;
9
9
  export type CustomStreamSimpleFn = (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;
10
10
  export interface RegisteredCustomApi {
@@ -1,5 +1,5 @@
1
- import type { AuthCredential } from "../auth-storage";
2
- import type { CredentialDisableResponse, CredentialRefreshResponse, CredentialUploadResponse, HealthzResponse, SnapshotResponse, SnapshotStreamEvent, UsageResponse } from "./types";
1
+ import type { AuthCredential } from "../auth-storage.js";
2
+ import type { CredentialBlockRequest, CredentialBlockResponse, CredentialBlocksDeleteResponse, CredentialDisableResponse, CredentialRefreshResponse, CredentialUploadResponse, HealthzResponse, SnapshotResponse, SnapshotStreamEvent, UsageResponse } from "./types.js";
3
3
  export interface AuthBrokerClientOptions {
4
4
  /** Base URL (e.g. `https://broker.tailnet:8765`). Trailing slashes are trimmed. */
5
5
  url: string;
@@ -63,4 +63,6 @@ export declare class AuthBrokerClient {
63
63
  refreshCredential(id: number, signal?: AbortSignal): Promise<CredentialRefreshResponse>;
64
64
  disableCredential(id: number, cause: string, signal?: AbortSignal): Promise<CredentialDisableResponse>;
65
65
  uploadCredential(provider: string, credential: AuthCredential, signal?: AbortSignal): Promise<CredentialUploadResponse>;
66
+ upsertCredentialBlock(id: number, block: CredentialBlockRequest, signal?: AbortSignal): Promise<CredentialBlockResponse>;
67
+ deleteCredentialBlocks(id: number, signal?: AbortSignal): Promise<CredentialBlocksDeleteResponse>;
66
68
  }
@@ -1,4 +1,4 @@
1
- import { AuthStorage } from "../auth-storage";
1
+ import { AuthStorage } from "../auth-storage.js";
2
2
  export interface AuthBrokerClientConfig {
3
3
  url: string;
4
4
  token: string;
@@ -1,7 +1,7 @@
1
- export * from "./client";
2
- export * from "./discover";
3
- export * from "./refresher";
4
- export * from "./remote-store";
5
- export * from "./server";
6
- export * from "./snapshot-cache";
7
- export * from "./types";
1
+ export * from "./client.js";
2
+ export * from "./discover.js";
3
+ export * from "./refresher.js";
4
+ export * from "./remote-store.js";
5
+ export * from "./server.js";
6
+ export * from "./snapshot-cache.js";
7
+ export * from "./types.js";
@@ -1,4 +1,4 @@
1
- import { type AuthStorage } from "../auth-storage";
1
+ import { type AuthStorage } from "../auth-storage.js";
2
2
  export interface AuthBrokerRefresherOptions {
3
3
  storage: AuthStorage;
4
4
  /** Refresh credentials expiring within this window. Default 5 min. */
@@ -1,9 +1,9 @@
1
- import { type AuthCredential, type AuthCredentialStore, type OAuthCredential, type StoredAuthCredential } from "../auth-storage";
2
- import type { OAuthCredentials } from "../registry/oauth/types";
3
- import type { Provider } from "../types";
4
- import type { UsageReport } from "../usage";
5
- import { type AuthBrokerClient } from "./client";
6
- import type { SnapshotResponse } from "./types";
1
+ import { type AuthCredential, type AuthCredentialStore, type OAuthCredential, type StoredAuthCredential, type StoredCredentialBlock } from "../auth-storage.js";
2
+ import type { OAuthCredentials } from "../registry/oauth/types.js";
3
+ import type { Provider } from "../types.js";
4
+ import type { UsageReport } from "../usage.js";
5
+ import { type AuthBrokerClient } from "./client.js";
6
+ import type { SnapshotResponse } from "./types.js";
7
7
  export interface RemoteAuthCredentialStoreOptions {
8
8
  client: AuthBrokerClient;
9
9
  /**
@@ -30,6 +30,11 @@ export declare class RemoteAuthCredentialStore implements AuthCredentialStore {
30
30
  /** Re-hydrate the in-memory snapshot from the broker. */
31
31
  refreshSnapshot(): Promise<SnapshotResponse>;
32
32
  listAuthCredentials(provider?: string): StoredAuthCredential[];
33
+ getCredentialBlock(credentialId: number, providerKey: string, blockScope: string): number | undefined;
34
+ listCredentialBlocks(credentialIds: readonly number[]): StoredCredentialBlock[];
35
+ upsertCredentialBlock(block: StoredCredentialBlock): void;
36
+ deleteCredentialBlocks(credentialId: number): void;
37
+ cleanExpiredCredentialBlocks(nowMs: number): void;
33
38
  /**
34
39
  * In-memory update from a successful refresh through the broker. AuthStorage
35
40
  * calls this after `#replaceCredentialAt`; the broker already persisted the
@@ -1,4 +1,4 @@
1
- import type { AuthStorage } from "../auth-storage";
1
+ import type { AuthStorage } from "../auth-storage.js";
2
2
  export interface AuthBrokerServerOptions {
3
3
  /** Underlying credential storage (wraps the local SQLite store on the broker). */
4
4
  storage: AuthStorage;
@@ -1,4 +1,4 @@
1
- import type { SnapshotResponse } from "./types";
1
+ import type { SnapshotResponse } from "./types.js";
2
2
  export interface ReadAuthBrokerSnapshotCacheOptions {
3
3
  path: string;
4
4
  token: string;
@@ -5,8 +5,8 @@
5
5
  * clients use `access` tokens directly and call back to the broker when a
6
6
  * credential expires or a 401 surfaces on a supposedly-fresh credential.
7
7
  */
8
- import type { AuthCredential, AuthCredentialSnapshot, AuthCredentialSnapshotEntry } from "../auth-storage";
9
- import type { UsageReport } from "../usage";
8
+ import type { AuthCredential, AuthCredentialSnapshot, AuthCredentialSnapshotEntry, StoredCredentialBlock } from "../auth-storage.js";
9
+ import type { UsageReport } from "../usage.js";
10
10
  /** GET /v1/healthz response body. */
11
11
  export interface HealthzResponse {
12
12
  ok: boolean;
@@ -18,8 +18,10 @@ export interface RefresherSchedule {
18
18
  skewMs: number;
19
19
  nextSweepInMs: number;
20
20
  }
21
+ export type CredentialBlockSnapshot = Omit<StoredCredentialBlock, "credentialId">;
21
22
  export type SnapshotEntry = AuthCredentialSnapshotEntry & {
22
23
  rotatesInMs: number | null;
24
+ blocks?: CredentialBlockSnapshot[];
23
25
  };
24
26
  /** GET /v1/snapshot response body. */
25
27
  export interface SnapshotResponse extends Omit<AuthCredentialSnapshot, "credentials"> {
@@ -44,6 +46,16 @@ export interface CredentialDisableRequest {
44
46
  export interface CredentialDisableResponse {
45
47
  ok: boolean;
46
48
  }
49
+ /** POST /v1/credential/:id/block request body. */
50
+ export type CredentialBlockRequest = CredentialBlockSnapshot;
51
+ /** POST /v1/credential/:id/block response body. */
52
+ export interface CredentialBlockResponse {
53
+ ok: boolean;
54
+ }
55
+ /** DELETE /v1/credential/:id/blocks response body. */
56
+ export interface CredentialBlocksDeleteResponse {
57
+ ok: boolean;
58
+ }
47
59
  /**
48
60
  * POST /v1/credential request body. The OAuth `refresh` must be the *real*
49
61
  * refresh token (not the sentinel) — the broker is the canonical writer.
@@ -75,6 +75,11 @@ export declare const credentialSnapshotEntrySchema: import("arktype/internal/var
75
75
  };
76
76
  identityKey: string | null;
77
77
  }, {}>;
78
+ export declare const credentialBlockSnapshotSchema: import("arktype/internal/variants/object.ts").ObjectType<{
79
+ providerKey: string;
80
+ blockScope: string;
81
+ blockedUntilMs: number;
82
+ }, {}>;
78
83
  export declare const snapshotEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
79
84
  id: number;
80
85
  provider: string;
@@ -94,6 +99,11 @@ export declare const snapshotEntrySchema: import("arktype/internal/variants/obje
94
99
  };
95
100
  identityKey: string | null;
96
101
  rotatesInMs: number | null;
102
+ blocks?: {
103
+ providerKey: string;
104
+ blockScope: string;
105
+ blockedUntilMs: number;
106
+ }[] | undefined;
97
107
  }, {}>;
98
108
  export declare const refresherScheduleSchema: import("arktype/internal/variants/object.ts").ObjectType<{
99
109
  enabled: boolean;
@@ -130,6 +140,11 @@ export declare const snapshotResponseSchema: import("arktype/internal/variants/o
130
140
  };
131
141
  identityKey: string | null;
132
142
  rotatesInMs: number | null;
143
+ blocks?: {
144
+ providerKey: string;
145
+ blockScope: string;
146
+ blockedUntilMs: number;
147
+ }[] | undefined;
133
148
  }[];
134
149
  }, {}>;
135
150
  /** First frame on connect — full snapshot embedded inline with a `kind` tag. */
@@ -162,6 +177,11 @@ export declare const snapshotStreamSnapshotEventSchema: import("arktype/internal
162
177
  };
163
178
  identityKey: string | null;
164
179
  rotatesInMs: number | null;
180
+ blocks?: {
181
+ providerKey: string;
182
+ blockScope: string;
183
+ blockedUntilMs: number;
184
+ }[] | undefined;
165
185
  }[];
166
186
  kind: "snapshot";
167
187
  }, {}>;
@@ -195,6 +215,11 @@ export declare const snapshotStreamEntryEventSchema: import("arktype/internal/va
195
215
  };
196
216
  identityKey: string | null;
197
217
  rotatesInMs: number | null;
218
+ blocks?: {
219
+ providerKey: string;
220
+ blockScope: string;
221
+ blockedUntilMs: number;
222
+ }[] | undefined;
198
223
  };
199
224
  }, {}>;
200
225
  /** Per-credential delete delta. */
@@ -240,6 +265,11 @@ export declare const snapshotStreamEventSchema: import("arktype/internal/variant
240
265
  };
241
266
  identityKey: string | null;
242
267
  rotatesInMs: number | null;
268
+ blocks?: {
269
+ providerKey: string;
270
+ blockScope: string;
271
+ blockedUntilMs: number;
272
+ }[] | undefined;
243
273
  }[];
244
274
  kind: "snapshot";
245
275
  } | {
@@ -271,6 +301,11 @@ export declare const snapshotStreamEventSchema: import("arktype/internal/variant
271
301
  };
272
302
  identityKey: string | null;
273
303
  rotatesInMs: number | null;
304
+ blocks?: {
305
+ providerKey: string;
306
+ blockScope: string;
307
+ blockedUntilMs: number;
308
+ }[] | undefined;
274
309
  };
275
310
  } | {
276
311
  kind: "removed";
@@ -371,6 +406,17 @@ export declare const credentialDisableRequestSchema: import("arktype/internal/va
371
406
  export declare const credentialDisableResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
372
407
  ok: boolean;
373
408
  }, {}>;
409
+ export declare const credentialBlockRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
410
+ providerKey: string;
411
+ blockScope: string;
412
+ blockedUntilMs: number;
413
+ }, {}>;
414
+ export declare const credentialBlockResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
415
+ ok: boolean;
416
+ }, {}>;
417
+ export declare const credentialBlocksDeleteResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
418
+ ok: boolean;
419
+ }, {}>;
374
420
  export declare const credentialUploadRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
375
421
  provider: string;
376
422
  credential: {
@@ -1,3 +1,3 @@
1
- export * from "./http";
2
- export * from "./server";
3
- export * from "./types";
1
+ export * from "./http.js";
2
+ export * from "./server.js";
3
+ export * from "./types.js";
@@ -17,9 +17,9 @@
17
17
  * POST /v1/messages → Anthropic messages in/out
18
18
  * POST /v1/responses → OpenAI Responses in/out
19
19
  */
20
- import type { AuthStorage } from "../auth-storage";
21
- import type { Api, Model } from "../types";
22
- import type { AuthGatewayServerHandle, AuthGatewayServerOptions } from "./types";
20
+ import type { AuthStorage } from "../auth-storage.js";
21
+ import type { Api, Model } from "../types.js";
22
+ import type { AuthGatewayServerHandle, AuthGatewayServerOptions } from "./types.js";
23
23
  export type ModelResolver = (modelId: string) => Model<Api> | undefined;
24
24
  export interface AuthGatewayBootOptions extends AuthGatewayServerOptions {
25
25
  /** Source of credentials. Caller wires this to a broker-backed AuthStorage. */
@@ -1,5 +1,5 @@
1
1
  import type { Effort } from "@oh-my-pi/pi-catalog/effort";
2
- import type { AssistantMessage, AssistantMessageEventStream, CacheRetention, Context, ServiceTier, TokenTaskBudget } from "../types";
2
+ import type { AssistantMessage, AssistantMessageEventStream, CacheRetention, Context, ServiceTier, TokenTaskBudget } from "../types.js";
3
3
  /**
4
4
  * Wire types for the omp auth-gateway.
5
5
  *
@@ -1,5 +1,5 @@
1
- import type { OAuthAccess } from "./auth-storage";
2
- import { isAuthRetryableError } from "./error/auth-classify";
1
+ import type { OAuthAccess } from "./auth-storage.js";
2
+ import { isAuthRetryableError } from "./error/auth-classify.js";
3
3
  /**
4
4
  * Context passed to an {@link ApiKeyResolver} on each resolution attempt.
5
5
  *
@@ -8,11 +8,11 @@
8
8
  * - `SqliteAuthCredentialStore`: concrete SQLite-backed implementation
9
9
  */
10
10
  import { Database } from "bun:sqlite";
11
- import type { ApiKeyResolver } from "./auth-retry";
12
- import type { OAuthAuthInfo, OAuthController, OAuthCredentials, OAuthProviderId } from "./registry/oauth/types";
13
- import type { Provider } from "./types";
14
- import type { CredentialRankingStrategy, UsageCostHistoryEntry, UsageCostHistoryQuery, UsageHistoryEntry, UsageHistoryQuery, UsageLogger, UsageProvider, UsageReport } from "./usage";
15
- import { type CodexResetConsumeCode, type CodexResetCredit } from "./usage/openai-codex-reset";
11
+ import type { ApiKeyResolver } from "./auth-retry.js";
12
+ import type { OAuthAuthInfo, OAuthController, OAuthCredentials, OAuthProviderId } from "./registry/oauth/types.js";
13
+ import type { Provider } from "./types.js";
14
+ import type { CredentialRankingStrategy, UsageCostHistoryEntry, UsageCostHistoryQuery, UsageHistoryEntry, UsageHistoryQuery, UsageLogger, UsageProvider, UsageReport } from "./usage.js";
15
+ import { type CodexResetConsumeCode, type CodexResetCredit } from "./usage/openai-codex-reset.js";
16
16
  export type ApiKeyCredential = {
17
17
  type: "api_key";
18
18
  key: string;
@@ -61,6 +61,17 @@ export interface StoredAuthCredential {
61
61
  credential: AuthCredential;
62
62
  disabledCause: string | null;
63
63
  }
64
+ /** One persisted rate-limit block: credential row id + provider-type key + optional scope. */
65
+ export interface StoredCredentialBlock {
66
+ /** SQLite row id of the credential (auth_credentials.id). */
67
+ credentialId: number;
68
+ /** `${provider}:${credentialType}` — same value as AuthStorage's in-memory providerKey. */
69
+ providerKey: string;
70
+ /** Block scope (e.g. "tier:fable"); empty string = unscoped. Never NUL-delimited. */
71
+ blockScope: string;
72
+ /** Epoch milliseconds. */
73
+ blockedUntilMs: number;
74
+ }
64
75
  /**
65
76
  * Per-credential health record returned by {@link AuthStorage.checkCredentials}.
66
77
  *
@@ -227,6 +238,16 @@ export interface AuthCredentialStore {
227
238
  }): string | null;
228
239
  setCache(key: string, value: string, expiresAtSec: number): void;
229
240
  cleanExpiredCache(): void;
241
+ /** Non-expired block for one (credential, providerKey, scope) key, or undefined. */
242
+ getCredentialBlock?(credentialId: number, providerKey: string, blockScope: string): number | undefined;
243
+ /** Upsert with MAX semantics: keep the later blockedUntilMs on conflict. */
244
+ upsertCredentialBlock?(block: StoredCredentialBlock): void;
245
+ /** Drop every block row for a credential (all providerKeys/scopes). */
246
+ deleteCredentialBlocks?(credentialId: number): void;
247
+ /** Prune rows with blocked_until_ms <= nowMs. */
248
+ cleanExpiredCredentialBlocks?(nowMs: number): void;
249
+ /** List non-expired blocks for broker snapshots. */
250
+ listCredentialBlocks?(credentialIds: readonly number[]): StoredCredentialBlock[];
230
251
  /**
231
252
  * Append usage-limit snapshots for trend history. Optional: stores without
232
253
  * durable storage (e.g. the broker remote store) omit it and recording is
@@ -398,7 +419,7 @@ export type AuthStorageOptions = {
398
419
  */
399
420
  fetchUsageReports?: (signal?: AbortSignal) => Promise<UsageReport[] | null>;
400
421
  };
401
- export { isDefinitiveOAuthFailure } from "./error/auth-classify";
422
+ export { isDefinitiveOAuthFailure } from "./error/auth-classify.js";
402
423
  /**
403
424
  * Outcome of {@link AuthStorage.markUsageLimitReached}.
404
425
  *
@@ -946,6 +967,18 @@ export declare class AuthStorage {
946
967
  * the existing row instead of inserting a duplicate.
947
968
  */
948
969
  upsertCredential(provider: string, credential: AuthCredential): AuthCredentialSnapshotEntry[];
970
+ /**
971
+ * Broker-server seam: list non-expired persisted blocks for snapshot entries.
972
+ */
973
+ listCredentialBlocks(credentialIds: readonly number[]): StoredCredentialBlock[];
974
+ /**
975
+ * Broker-server seam: persist one credential block and notify snapshot waiters.
976
+ */
977
+ upsertCredentialBlock(block: StoredCredentialBlock): void;
978
+ /**
979
+ * Broker-server seam: clear all persisted blocks for one credential and notify snapshot waiters.
980
+ */
981
+ deleteCredentialBlocks(credentialId: number): void;
949
982
  /**
950
983
  * Describe where the active credential for a provider came from.
951
984
  *
@@ -997,6 +1030,11 @@ export declare class SqliteAuthCredentialStore implements AuthCredentialStore {
997
1030
  }): string | null;
998
1031
  setCache(key: string, value: string, expiresAtSec: number): void;
999
1032
  cleanExpiredCache(): void;
1033
+ getCredentialBlock(credentialId: number, providerKey: string, blockScope: string): number | undefined;
1034
+ upsertCredentialBlock(block: StoredCredentialBlock): void;
1035
+ deleteCredentialBlocks(credentialId: number): void;
1036
+ cleanExpiredCredentialBlocks(nowMs: number): void;
1037
+ listCredentialBlocks(credentialIds: readonly number[]): StoredCredentialBlock[];
1000
1038
  recordUsageSnapshots(entries: UsageHistoryEntry[]): void;
1001
1039
  listUsageHistory(query?: UsageHistoryQuery): UsageHistoryEntry[];
1002
1040
  recordUsageCosts(entries: UsageCostHistoryEntry[]): void;
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare const ANTHROPIC_THINKING_TAG_PREFIXES: readonly ["<thinking", "</thinking", "<think", "</think", "<scratchpad", "</scratchpad", "<antml:thinking", "</antml:thinking", "<antml:think", "</antml:think", "<antml:scratchpad", "</antml:scratchpad"];
3
3
  export interface AnthropicInbandScannerConfig {
4
4
  readonly wrapperTags?: Readonly<Record<string, true>>;
@@ -1,3 +1,3 @@
1
- import type { Dialect, InbandTool } from "./types";
1
+ import type { Dialect, InbandTool } from "./types.js";
2
2
  export declare function renderToolCatalog(tools: readonly InbandTool[]): string;
3
3
  export declare function renderInbandToolPrompt(tools: readonly InbandTool[], dialect: Dialect): string;
@@ -1,4 +1,4 @@
1
- import type { InbandTool } from "./types";
1
+ import type { InbandTool } from "./types.js";
2
2
  export interface ToolArgShape {
3
3
  stringArgs: Set<string>;
4
4
  properties: Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare const DEEPSEEK_TOOL_CALLS_BEGIN = "<\uFF5Ctool\u2581calls\u2581begin\uFF5C>";
3
3
  export declare const DEEPSEEK_TOOL_CALLS_END = "<\uFF5Ctool\u2581calls\u2581end\uFF5C>";
4
4
  export declare const DEEPSEEK_TOOL_CALL_BEGIN = "<\uFF5Ctool\u2581call\u2581begin\uFF5C>";
@@ -1,23 +1,25 @@
1
1
  /**
2
2
  * Wrap a prior-turn reasoning string for demotion into native conversation
3
- * history — the cross-provider / cross-model case where the target cannot replay
4
- * it as a structured thinking block (verified end-to-end against Gemini 3: a
5
- * replayed unsigned `thought` part is schema-accepted but silently discarded —
6
- * neither recalled nor influencing generation).
3
+ * history — the cross-provider / cross-model case where the target cannot
4
+ * replay it as a structured thinking block (verified end-to-end against Gemini
5
+ * 3: a replayed unsigned `thought` part is schema-accepted but silently
6
+ * discarded — neither recalled nor influencing generation).
7
7
  *
8
- * Fable is the exception: Anthropic's `reasoning_extraction` classifier blocks
9
- * requests that replay prior reasoning inside `<thinking>` / `antml:thinking`
10
- * tags OR the older `_Hmm. …_` italic envelope — it reads the wrapped
11
- * chain-of-thought as an attempt to duplicate model outputs and refuses the
12
- * whole turn. Fable therefore receives prior reasoning as bare assistant prose:
13
- * no tag, no `_Hmm.` wrapper, no trailing newline.
8
+ * The Anthropic/Claude dialect is the primary exception: Anthropic's
9
+ * `reasoning_extraction` classifier blocks requests that replay prior
10
+ * reasoning inside `<thinking>` / `antml:thinking` tags — it reads the
11
+ * wrapped chain-of-thought as an attempt to duplicate model outputs and
12
+ * refuses (Fable) or leaks it as visible reasoning (Opus / Sonnet / Haiku /
13
+ * Mythos). Every Anthropic-dialect Claude model therefore receives prior
14
+ * reasoning as bare assistant prose: no tag, no wrapper, no trailing newline.
14
15
  * Heat is cumulative (block count and early-conversation position also raise
15
16
  * it), so this lowers per-block signal but does not license unbounded replay.
16
- * Harmony and Gemma are also exceptions: their `renderThinking` emits
17
+ *
18
+ * Harmony and Gemma are the other exceptions: their `renderThinking` emits
17
19
  * chat-template control tokens (`<|channel|>analysis`, `<|channel>thought`)
18
- * that must not appear inside a structured native message, so they fall back to
19
- * a plain `<think>` block. Every other dialect's thinking form is inline-safe
20
- * XML tags or a markdown fence.
20
+ * that must not appear inside a structured native message, so they fall back
21
+ * to a plain `<think>` block. Every other dialect's thinking form is
22
+ * inline-safe XML tags or a markdown fence.
21
23
  *
22
24
  * The result does not append a delimiter; callers that flatten adjacent blocks
23
25
  * into a single string must insert their own separator.
@@ -1,2 +1,2 @@
1
- import type { Dialect, InbandTool } from "./types";
1
+ import type { Dialect, InbandTool } from "./types.js";
2
2
  export declare function renderToolExamples(tool: InbandTool, dialect: Dialect, intentField?: string): string;
@@ -1,3 +1,3 @@
1
- import type { Dialect, DialectDefinition, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { Dialect, DialectDefinition, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare function getDialectDefinition(dialect: Dialect): DialectDefinition;
3
3
  export declare function createInbandScanner(dialect: Dialect, options?: InbandScannerOptions): InbandScanner;
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  /**
3
3
  * Scanner for the hosted-Gemini / Gemma 3 Pythonic tool-calling convention
4
4
  * (see `docs/toolconv/gemini.md`). Tool calls arrive as a ```` ```tool_code ````
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  /**
3
3
  * Scanner for the Gemma 4 token-delimited tool-calling convention (see
4
4
  * `docs/toolconv/gemma.md`). Each call is one `<|tool_call>call:NAME{…}<tool_call|>`
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare class GLMInbandScanner implements InbandScanner {
3
3
  #private;
4
4
  constructor(options?: InbandScannerOptions);
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner } from "./types.js";
2
2
  export declare class HarmonyInbandScanner implements InbandScanner {
3
3
  #private;
4
4
  feed(text: string): InbandScanEvent[];
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare class HermesInbandScanner implements InbandScanner {
3
3
  #private;
4
4
  constructor(options?: InbandScannerOptions);
@@ -1,3 +1,3 @@
1
- import type { Context } from "../types";
2
- import type { Dialect, InbandTool } from "./types";
1
+ import type { Context } from "../types.js";
2
+ import type { Dialect, InbandTool } from "./types.js";
3
3
  export declare function encodeInbandToolHistory(messages: Context["messages"], dialect: Dialect, tools?: readonly InbandTool[]): Context["messages"];
@@ -1,11 +1,11 @@
1
- export * from "./catalog";
2
- export * from "./coercion";
3
- export * from "./demotion";
4
- export * from "./examples";
5
- export * from "./factory";
6
- export * from "./history";
7
- export * from "./inventory";
8
- export * from "./owned-stream";
9
- export { renderDelimitedThinking } from "./rendering";
10
- export * from "./thinking";
11
- export * from "./types";
1
+ export * from "./catalog.js";
2
+ export * from "./coercion.js";
3
+ export * from "./demotion.js";
4
+ export * from "./examples.js";
5
+ export * from "./factory.js";
6
+ export * from "./history.js";
7
+ export * from "./inventory.js";
8
+ export * from "./owned-stream.js";
9
+ export { renderDelimitedThinking } from "./rendering.js";
10
+ export * from "./thinking.js";
11
+ export * from "./types.js";
@@ -1,4 +1,4 @@
1
- import type { InbandTool } from "./types";
1
+ import type { InbandTool } from "./types.js";
2
2
  /**
3
3
  * Human-readable per-tool inventory: each tool renders as a `# Tool: <name>`
4
4
  * section with its description, a simplified TypeScript-style parameter
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare const KIMI_SECTION_BEGIN = "<|tool_calls_section_begin|>";
3
3
  export declare const KIMI_SECTION_END = "<|tool_calls_section_end|>";
4
4
  export declare const KIMI_CALL_BEGIN = "<|tool_call_begin|>";
@@ -1,3 +1,3 @@
1
- import type { DialectDefinition } from "./types";
1
+ import type { DialectDefinition } from "./types.js";
2
2
  declare const definition: DialectDefinition;
3
3
  export default definition;
@@ -1,4 +1,4 @@
1
- import type { AssistantMessage, AssistantMessageEventStream as AssistantMessageEventStreamType } from "../types";
2
- import type { Dialect, InbandTool } from "./types";
1
+ import type { AssistantMessage, AssistantMessageEventStream as AssistantMessageEventStreamType } from "../types.js";
2
+ import type { Dialect, InbandTool } from "./types.js";
3
3
  export declare function parseInbandToolMessage(message: AssistantMessage, dialect: Dialect, tools: readonly InbandTool[]): AssistantMessage;
4
4
  export declare function wrapInbandToolStream(inner: AssistantMessageEventStreamType, tools: readonly InbandTool[], dialect: Dialect, onAbort?: () => void, abortOnFabrication?: boolean): AssistantMessageEventStreamType;
@@ -1,4 +1,4 @@
1
- import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types";
1
+ import type { DialectDefinition, InbandScanEvent, InbandScanner, InbandScannerOptions } from "./types.js";
2
2
  export declare class Qwen3InbandScanner implements InbandScanner {
3
3
  #private;
4
4
  constructor(options?: InbandScannerOptions);
@@ -1,5 +1,5 @@
1
- import type { AssistantMessage, Message, ToolCall } from "../types";
2
- import type { DialectRenderOptions, DialectToolResult } from "./types";
1
+ import type { AssistantMessage, Message, ToolCall } from "../types.js";
2
+ import type { DialectRenderOptions, DialectToolResult } from "./types.js";
3
3
  export declare function renderToolResponseResults(results: readonly DialectToolResult[]): string;
4
4
  export declare function kimiCallId(name: string, id: string, index: number): string;
5
5
  export declare function harmonyRecipient(name: string): string;
@@ -1,4 +1,4 @@
1
- import type { InbandScanEvent, InbandScanner } from "./types";
1
+ import type { InbandScanEvent, InbandScanner } from "./types.js";
2
2
  export declare class ThinkingInbandScanner implements InbandScanner {
3
3
  #private;
4
4
  feed(text: string): InbandScanEvent[];
@@ -1,5 +1,5 @@
1
1
  import type { Dialect as CatalogDialect } from "@oh-my-pi/pi-catalog/identity";
2
- import type { Context, Message, ToolCall } from "../types";
2
+ import type { Context, Message, ToolCall } from "../types.js";
3
3
  export type { Dialect } from "@oh-my-pi/pi-catalog/identity";
4
4
  export type InbandScanEvent = {
5
5
  type: "text";