@molecule/api-ai 1.3.0 → 1.3.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/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -34,21 +35,33 @@
34
35
 
35
36
  "Work" shall mean the work of authorship, whether in Source or
36
37
  Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work.
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
38
40
 
39
41
  "Derivative Works" shall mean any work, whether in Source or Object
40
42
  form, that is based on (or derived from) the Work and for which the
41
43
  editorial revisions, annotations, elaborations, or other modifications
42
- represent, as a whole, an original work of authorship.
43
-
44
- "Contribution" shall mean any work of authorship, including the
45
- original version of the Work and any modifications or additions
46
- to that Work, that is intentionally submitted to the Licensor for
47
- inclusion in the Work by the copyright owner or by an individual or
48
- Legal Entity authorized to submit on behalf of the copyright owner.
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
49
62
 
50
63
  "Contributor" shall mean Licensor and any individual or Legal Entity
51
- on behalf of whom a Contribution has been received by the Licensor and
64
+ on behalf of whom a Contribution has been received by Licensor and
52
65
  subsequently incorporated within the Work.
53
66
 
54
67
  2. Grant of Copyright License. Subject to the terms and conditions of
@@ -61,8 +74,18 @@
61
74
  3. Grant of Patent License. Subject to the terms and conditions of
62
75
  this License, each Contributor hereby grants to You a perpetual,
63
76
  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
64
- patent license to make, have made, use, offer to sell, sell, import,
65
- and otherwise transfer the Work.
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
66
89
 
67
90
  4. Redistribution. You may reproduce and distribute copies of the
68
91
  Work or Derivative Works thereof in any medium, with or without
@@ -84,23 +107,87 @@
84
107
  (d) If the Work includes a "NOTICE" text file as part of its
85
108
  distribution, then any Derivative Works that You distribute must
86
109
  include a readable copy of the attribution notices contained
87
- within such NOTICE file.
88
-
89
- 5. Submission of Contributions.
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
90
138
 
91
139
  6. Trademarks. This License does not grant permission to use the trade
92
- names, trademarks, service marks, or product names of the Licensor.
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
93
143
 
94
144
  7. Disclaimer of Warranty. Unless required by applicable law or
95
- agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
96
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
97
-
98
- 8. Limitation of Liability. In no event and under no legal theory shall
99
- any Contributor be liable to You for damages.
100
-
101
- 9. Accepting Warranty or Additional Liability.
102
-
103
- Copyright 2026 Molecule Dev, Inc.
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
104
191
 
105
192
  Licensed under the Apache License, Version 2.0 (the "License");
106
193
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-09-25T13:04:35.037Z
6
+ Generated: 2026-10-16T10:23:41.676Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-ai
@@ -49,40 +49,59 @@ npm install @molecule/api-ai @molecule/api-bond @molecule/api-i18n
49
49
 
50
50
  ### Interfaces
51
51
 
52
- #### `AIConfig`
52
+ #### `ChatMessage`
53
53
 
54
- AI provider configuration.
54
+ Chat message in a conversation.
55
55
 
56
56
  ```typescript
57
- interface AIConfig {
58
- /** Default model to use when not specified in ChatParams. */
59
- defaultModel?: string
60
- /** Maximum tokens for completions. */
61
- maxTokens?: number
62
- /** Default temperature. */
63
- temperature?: number
57
+ interface ChatMessage {
58
+ role: 'user' | 'assistant' | 'system'
59
+ content: string | ContentBlock[]
60
+ /**
61
+ * Model-native reasoning text produced alongside this (assistant) message —
62
+ * e.g. an OpenAI-compatible provider's `reasoning_content`. Some providers
63
+ * (Moonshot's Kimi K3 / k2.7-code and other preserved-thinking models)
64
+ * require it to be replayed verbatim on subsequent requests within a
65
+ * tool-call loop to keep reasoning continuity; callers that captured
66
+ * `thinking` stream events should set it when rebuilding history. Bonds
67
+ * whose provider has no such requirement ignore it.
68
+ */
69
+ reasoning?: string
64
70
  }
65
71
  ```
66
72
 
67
- #### `AIProvider`
68
-
69
- AI provider interface.
73
+ #### `TokenUsage`
70
74
 
71
- Each bond package (Anthropic, OpenAI, Gemini, etc.) implements
72
- this interface to provide model-specific chat functionality.
75
+ Token usage from a chat completion.
73
76
 
74
77
  ```typescript
75
- interface AIProvider {
76
- readonly name: string
77
-
78
+ interface TokenUsage {
79
+ inputTokens: number
80
+ outputTokens: number
81
+ /** Number of input tokens written to the prompt cache. */
82
+ cacheCreationInputTokens?: number
83
+ /** Number of input tokens read from the prompt cache. */
84
+ cacheReadInputTokens?: number
78
85
  /**
79
- * Send a chat request and stream back events.
80
- *
81
- * Returns an async iterable of ChatEvent objects.
82
- * Always yields a final 'done' event with token usage.
83
- * @returns An async iterable that yields `ChatEvent` objects (text chunks, tool calls, done, or error).
86
+ * Number of web searches the provider ran for this request through a server
87
+ * tool (`ServerTool`, e.g. web search / search grounding). Providers bill
88
+ * these per search, on top of tokens, so bonds MUST report every search the
89
+ * provider executed — absent means none ran. Counted the way the provider
90
+ * bills: Anthropic reports it (`server_tool_use.web_search_requests`),
91
+ * OpenAI bills per `web_search_call`, Gemini per search query issued.
84
92
  */
85
- chat(params: ChatParams): AsyncIterable<ChatEvent>
93
+ webSearchRequests?: number
94
+ /**
95
+ * The speed tier the provider REPORTS the request ran at (Anthropic wires it
96
+ * as `usage.speed` per the fast-mode docs, and as `usage.service_tier` on
97
+ * observed live responses — bonds read both). Only set by bonds whose
98
+ * provider has a fast/priority tier — absent means unreported. Metering
99
+ * prefers THIS field over the requested `ChatParams.speed`; when a
100
+ * fast-requested turn succeeds with no report, callers may conservatively
101
+ * bill the requested tier (Anthropic enforces fast-mode entitlement with a
102
+ * hard 429, so a successful fast request was served fast).
103
+ */
104
+ speed?: 'standard' | 'fast'
86
105
  }
87
106
  ```
88
107
 
@@ -114,6 +133,72 @@ interface AiRateLimitEvent {
114
133
  }
115
134
  ```
116
135
 
136
+ #### `AiStreamStallEvent`
137
+
138
+ Details of one upstream stream that accepted the request and then produced no
139
+ CONTENT for the whole first-token window — reported via a provider config's
140
+ `onStreamStall` callback the moment the provider's first-token watchdog gives
141
+ up on that attempt.
142
+
143
+ A stall is NOT an HTTP failure and NOT a rate limit: the provider answered
144
+ 200 and opened a stream, then sat there. It is invisible to every other
145
+ signal the platform has — a 200 with no content looks like a healthy request
146
+ until the bytes stop — so without this callback a multi-minute pause cannot
147
+ be told apart from a long think, a platform hold, or a retry backoff after
148
+ the fact (X0 xr-molecule-flash-m71, 2026-10-16: a 3 min 15 s gap that
149
+ production could not classify).
150
+
151
+ ```typescript
152
+ interface AiStreamStallEvent {
153
+ /** Provider name (e.g. 'deepseek'). */
154
+ provider: string
155
+ /** Model the stalled request targeted. */
156
+ model: string
157
+ /**
158
+ * Which bound the stream broke: `before_content` is the first-token window
159
+ * (retryable — the reply never started), `after_content` is the inter-chunk
160
+ * silence window (not retryable — a partial reply is already on the wire).
161
+ */
162
+ phase: 'before_content' | 'after_content'
163
+ /** How long the attempt waited for its first content event, in milliseconds. */
164
+ stallMs: number
165
+ /** 1-based attempt number that stalled. */
166
+ attempt: number
167
+ /** Whether the provider retries this request with a fresh stream. */
168
+ willRetry: boolean
169
+ /**
170
+ * Content characters the stalled attempt streamed before it was abandoned —
171
+ * always 0 for a first-token stall, and non-zero only for a post-content
172
+ * stall, where a retry is impossible and the partial reply is kept.
173
+ */
174
+ streamedChars: number
175
+ /**
176
+ * Liveness frames the attempt received, counted as data arrived that carried
177
+ * no content. Distinguishes the two stall shapes: 0 is a stream that went
178
+ * completely silent, a high count is an upstream that is OPEN and dripping
179
+ * empty frames (DeepSeek's `: keep-alive` comments during a long prefill),
180
+ * which no byte-level idle timeout can see.
181
+ */
182
+ keepAlives: number
183
+ }
184
+ ```
185
+
186
+ #### `JSONSchema`
187
+
188
+ JSON Schema subset for tool parameter definitions.
189
+
190
+ ```typescript
191
+ interface JSONSchema {
192
+ type: string
193
+ properties?: Record<string, JSONSchema>
194
+ items?: JSONSchema
195
+ required?: string[]
196
+ description?: string
197
+ enum?: unknown[]
198
+ [key: string]: unknown
199
+ }
200
+ ```
201
+
117
202
  #### `AITool`
118
203
 
119
204
  Tool definition that the AI model can invoke.
@@ -127,24 +212,27 @@ interface AITool {
127
212
  }
128
213
  ```
129
214
 
130
- #### `ChatMessage`
215
+ #### `ServerTool`
131
216
 
132
- Chat message in a conversation.
217
+ Provider-native tool handled server-side (e.g., Anthropic's `web_search`).
218
+
219
+ Unlike `AITool`, server tools are executed by the AI provider itself —
220
+ no client-side `execute` callback is needed. The provider passes them
221
+ through to the API alongside custom tools.
133
222
 
134
223
  ```typescript
135
- interface ChatMessage {
136
- role: 'user' | 'assistant' | 'system'
137
- content: string | ContentBlock[]
224
+ interface ServerTool {
138
225
  /**
139
- * Model-native reasoning text produced alongside this (assistant) message —
140
- * e.g. an OpenAI-compatible provider's `reasoning_content`. Some providers
141
- * (Moonshot's Kimi K3 / k2.7-code and other preserved-thinking models)
142
- * require it to be replayed verbatim on subsequent requests within a
143
- * tool-call loop to keep reasoning continuity; callers that captured
144
- * `thinking` stream events should set it when rebuilding history. Bonds
145
- * whose provider has no such requirement ignore it.
226
+ * Provider-specific tool type identifier — a VERSIONED string the provider
227
+ * publishes (e.g. Anthropic's `"web_search_20260209"` on current models;
228
+ * older models use earlier variants like `"web_search_20250305"`). Copy the
229
+ * exact value from the provider's docs for the model in use.
146
230
  */
147
- reasoning?: string
231
+ type: string
232
+ /** Tool name. */
233
+ name: string
234
+ /** Allow additional provider-specific fields (max_uses, etc.). */
235
+ [key: string]: unknown
148
236
  }
149
237
  ```
150
238
 
@@ -241,90 +329,68 @@ interface ChatParams {
241
329
  }
242
330
  ```
243
331
 
244
- #### `JSONSchema`
245
-
246
- JSON Schema subset for tool parameter definitions.
247
-
248
- ```typescript
249
- interface JSONSchema {
250
- type: string
251
- properties?: Record<string, JSONSchema>
252
- items?: JSONSchema
253
- required?: string[]
254
- description?: string
255
- enum?: unknown[]
256
- [key: string]: unknown
257
- }
258
- ```
259
-
260
- #### `ServerTool`
332
+ #### `AIProvider`
261
333
 
262
- Provider-native tool handled server-side (e.g., Anthropic's `web_search`).
334
+ AI provider interface.
263
335
 
264
- Unlike `AITool`, server tools are executed by the AI provider itself —
265
- no client-side `execute` callback is needed. The provider passes them
266
- through to the API alongside custom tools.
336
+ Each bond package (Anthropic, OpenAI, Gemini, etc.) implements
337
+ this interface to provide model-specific chat functionality.
267
338
 
268
339
  ```typescript
269
- interface ServerTool {
340
+ interface AIProvider {
341
+ readonly name: string
342
+
270
343
  /**
271
- * Provider-specific tool type identifier — a VERSIONED string the provider
272
- * publishes (e.g. Anthropic's `"web_search_20260209"` on current models;
273
- * older models use earlier variants like `"web_search_20250305"`). Copy the
274
- * exact value from the provider's docs for the model in use.
344
+ * Send a chat request and stream back events.
345
+ *
346
+ * Returns an async iterable of ChatEvent objects.
347
+ * Always yields a final 'done' event with token usage.
348
+ * @returns An async iterable that yields `ChatEvent` objects (text chunks, tool calls, done, or error).
275
349
  */
276
- type: string
277
- /** Tool name. */
278
- name: string
279
- /** Allow additional provider-specific fields (max_uses, etc.). */
280
- [key: string]: unknown
350
+ chat(params: ChatParams): AsyncIterable<ChatEvent>
281
351
  }
282
352
  ```
283
353
 
284
- #### `TokenUsage`
354
+ #### `AIConfig`
285
355
 
286
- Token usage from a chat completion.
356
+ AI provider configuration.
287
357
 
288
358
  ```typescript
289
- interface TokenUsage {
290
- inputTokens: number
291
- outputTokens: number
292
- /** Number of input tokens written to the prompt cache. */
293
- cacheCreationInputTokens?: number
294
- /** Number of input tokens read from the prompt cache. */
295
- cacheReadInputTokens?: number
296
- /**
297
- * Number of web searches the provider ran for this request through a server
298
- * tool (`ServerTool`, e.g. web search / search grounding). Providers bill
299
- * these per search, on top of tokens, so bonds MUST report every search the
300
- * provider executed — absent means none ran. Counted the way the provider
301
- * bills: Anthropic reports it (`server_tool_use.web_search_requests`),
302
- * OpenAI bills per `web_search_call`, Gemini per search query issued.
303
- */
304
- webSearchRequests?: number
305
- /**
306
- * The speed tier the provider REPORTS the request ran at (Anthropic wires it
307
- * as `usage.speed` per the fast-mode docs, and as `usage.service_tier` on
308
- * observed live responses — bonds read both). Only set by bonds whose
309
- * provider has a fast/priority tier — absent means unreported. Metering
310
- * prefers THIS field over the requested `ChatParams.speed`; when a
311
- * fast-requested turn succeeds with no report, callers may conservatively
312
- * bill the requested tier (Anthropic enforces fast-mode entitlement with a
313
- * hard 429, so a successful fast request was served fast).
314
- */
315
- speed?: 'standard' | 'fast'
359
+ interface AIConfig {
360
+ /** Default model to use when not specified in ChatParams. */
361
+ defaultModel?: string
362
+ /** Maximum tokens for completions. */
363
+ maxTokens?: number
364
+ /** Default temperature. */
365
+ temperature?: number
316
366
  }
317
367
  ```
318
368
 
319
369
  ### Types
320
370
 
321
- #### `AiRateLimitCallback`
371
+ #### `ContentBlock`
322
372
 
323
- Callback invoked on each rate-limited/overloaded upstream response. Must not
324
- throw (providers guard it anyway); keep it fast — it runs on the request path.
373
+ Rich content block within a message.
374
+
375
+ Includes text, tool interactions, and file attachments (images, documents,
376
+ audio, video). Provider bonds map these generic blocks to their native API
377
+ format (e.g., Anthropic base64 source, OpenAI image_url, etc.).
325
378
 
326
379
  ```typescript
327
- type AiRateLimitCallback = (event: AiRateLimitEvent) => void
380
+ type ContentBlock =
381
+ | { type: 'text'; text: string }
382
+ | { type: 'image'; mediaType: string; data: string }
383
+ | { type: 'document'; mediaType: string; data: string; filename?: string }
384
+ | { type: 'audio'; mediaType: string; data: string }
385
+ | { type: 'video'; mediaType: string; data: string }
386
+ // `signature` is a provider-opaque replay token attached to the tool call
387
+ // (Gemini 3.x `thoughtSignature`). Callers that persist tool calls and replay
388
+ // them in later requests MUST carry it back on the replayed block verbatim —
389
+ // Gemini rejects a replayed functionCall without it (400 "Function call is
390
+ // missing a thought_signature"). Providers without such a token omit it, and
391
+ // every bond ignores it when it has no native equivalent.
392
+ | { type: 'tool_use'; id: string; name: string; input: unknown; signature?: string }
393
+ | { type: 'tool_result'; tool_use_id: string; content: string | unknown }
328
394
  ```
329
395
 
330
396
  #### `ChatEvent`
@@ -381,42 +447,37 @@ type ChatEvent =
381
447
  | { type: 'keep_alive' }
382
448
  ```
383
449
 
384
- #### `ContentBlock`
450
+ #### `AiRateLimitCallback`
385
451
 
386
- Rich content block within a message.
452
+ Callback invoked on each rate-limited/overloaded upstream response. Must not
453
+ throw (providers guard it anyway); keep it fast — it runs on the request path.
387
454
 
388
- Includes text, tool interactions, and file attachments (images, documents,
389
- audio, video). Provider bonds map these generic blocks to their native API
390
- format (e.g., Anthropic base64 source, OpenAI image_url, etc.).
455
+ ```typescript
456
+ type AiRateLimitCallback = (event: AiRateLimitEvent) => void
457
+ ```
458
+
459
+ #### `AiStreamStallCallback`
460
+
461
+ Callback invoked on each stalled upstream stream. Must not throw (providers
462
+ guard it anyway); keep it fast — it runs on the request path.
391
463
 
392
464
  ```typescript
393
- type ContentBlock =
394
- | { type: 'text'; text: string }
395
- | { type: 'image'; mediaType: string; data: string }
396
- | { type: 'document'; mediaType: string; data: string; filename?: string }
397
- | { type: 'audio'; mediaType: string; data: string }
398
- | { type: 'video'; mediaType: string; data: string }
399
- // `signature` is a provider-opaque replay token attached to the tool call
400
- // (Gemini 3.x `thoughtSignature`). Callers that persist tool calls and replay
401
- // them in later requests MUST carry it back on the replayed block verbatim —
402
- // Gemini rejects a replayed functionCall without it (400 "Function call is
403
- // missing a thought_signature"). Providers without such a token omit it, and
404
- // every bond ignores it when it has no native equivalent.
405
- | { type: 'tool_use'; id: string; name: string; input: unknown; signature?: string }
406
- | { type: 'tool_result'; tool_use_id: string; content: string | unknown }
465
+ type AiStreamStallCallback = (event: AiStreamStallEvent) => void
407
466
  ```
408
467
 
409
468
  ### Functions
410
469
 
411
- #### `getAllProviders()`
470
+ #### `setProvider(provider)`
412
471
 
413
- Retrieves all named AI providers as a Map keyed by provider name.
472
+ Registers an AI provider in singleton mode.
473
+
474
+ - **Singleton**: `setProvider(provider)` — bonds a single default provider.
414
475
 
415
476
  ```typescript
416
- function getAllProviders(): Map<string, AIProvider>
477
+ function setProvider(provider: AIProvider): void
417
478
  ```
418
479
 
419
- **Returns:** Map of provider name → AIProvider.
480
+ - `provider` — The default provider implementation for this process.
420
481
 
421
482
  #### `getProvider()`
422
483
 
@@ -455,6 +516,16 @@ function getProviderByName(name: string): AIProvider | null
455
516
 
456
517
  **Returns:** The named AI provider, or `null`.
457
518
 
519
+ #### `getAllProviders()`
520
+
521
+ Retrieves all named AI providers as a Map keyed by provider name.
522
+
523
+ ```typescript
524
+ function getAllProviders(): Map<string, AIProvider>
525
+ ```
526
+
527
+ **Returns:** Map of provider name → AIProvider.
528
+
458
529
  #### `hasProvider(name)`
459
530
 
460
531
  Checks whether an AI provider is currently bonded.
@@ -486,32 +557,20 @@ function requireProvider(): AIProvider
486
557
 
487
558
  **Returns:** The bonded AI provider.
488
559
 
489
- #### `setProvider(provider)`
490
-
491
- Registers an AI provider in singleton mode.
492
-
493
- - **Singleton**: `setProvider(provider)` — bonds a single default provider.
494
-
495
- ```typescript
496
- function setProvider(provider: AIProvider): void
497
- ```
498
-
499
- - `provider` — The default provider implementation for this process.
500
-
501
560
  ## Available Providers
502
561
 
503
- | Provider | Package |
504
- | ------------ | ---------------------------- |
505
- | Alibaba Qwen | `@molecule/api-ai-alibaba` |
506
- | Anthropic | `@molecule/api-ai-anthropic` |
507
- | Ai | `@molecule/api-ai-deepseek` |
508
- | Ai | `@molecule/api-ai-google` |
509
- | Ai | `@molecule/api-ai-local` |
510
- | MiniMax | `@molecule/api-ai-minimax` |
511
- | Moonshot | `@molecule/api-ai-moonshot` |
512
- | Ai | `@molecule/api-ai-openai` |
513
- | xAI | `@molecule/api-ai-xai` |
514
- | Zhipu GLM | `@molecule/api-ai-zhipu` |
562
+ | Provider | Package |
563
+ | ------------------- | ---------------------------- |
564
+ | Alibaba Qwen | `@molecule/api-ai-alibaba` |
565
+ | Anthropic | `@molecule/api-ai-anthropic` |
566
+ | DeepSeek | `@molecule/api-ai-deepseek` |
567
+ | Google Gemini | `@molecule/api-ai-google` |
568
+ | Local (self-hosted) | `@molecule/api-ai-local` |
569
+ | MiniMax | `@molecule/api-ai-minimax` |
570
+ | Moonshot | `@molecule/api-ai-moonshot` |
571
+ | OpenAI | `@molecule/api-ai-openai` |
572
+ | xAI | `@molecule/api-ai-xai` |
573
+ | Zhipu GLM | `@molecule/api-ai-zhipu` |
515
574
 
516
575
  ## Injection Notes
517
576
 
package/dist/types.d.ts CHANGED
@@ -158,6 +158,57 @@ export interface AiRateLimitEvent {
158
158
  * throw (providers guard it anyway); keep it fast — it runs on the request path.
159
159
  */
160
160
  export type AiRateLimitCallback = (event: AiRateLimitEvent) => void;
161
+ /**
162
+ * Details of one upstream stream that accepted the request and then produced no
163
+ * CONTENT for the whole first-token window — reported via a provider config's
164
+ * `onStreamStall` callback the moment the provider's first-token watchdog gives
165
+ * up on that attempt.
166
+ *
167
+ * A stall is NOT an HTTP failure and NOT a rate limit: the provider answered
168
+ * 200 and opened a stream, then sat there. It is invisible to every other
169
+ * signal the platform has — a 200 with no content looks like a healthy request
170
+ * until the bytes stop — so without this callback a multi-minute pause cannot
171
+ * be told apart from a long think, a platform hold, or a retry backoff after
172
+ * the fact (X0 xr-molecule-flash-m71, 2026-10-16: a 3 min 15 s gap that
173
+ * production could not classify).
174
+ */
175
+ export interface AiStreamStallEvent {
176
+ /** Provider name (e.g. 'deepseek'). */
177
+ provider: string;
178
+ /** Model the stalled request targeted. */
179
+ model: string;
180
+ /**
181
+ * Which bound the stream broke: `before_content` is the first-token window
182
+ * (retryable — the reply never started), `after_content` is the inter-chunk
183
+ * silence window (not retryable — a partial reply is already on the wire).
184
+ */
185
+ phase: 'before_content' | 'after_content';
186
+ /** How long the attempt waited for its first content event, in milliseconds. */
187
+ stallMs: number;
188
+ /** 1-based attempt number that stalled. */
189
+ attempt: number;
190
+ /** Whether the provider retries this request with a fresh stream. */
191
+ willRetry: boolean;
192
+ /**
193
+ * Content characters the stalled attempt streamed before it was abandoned —
194
+ * always 0 for a first-token stall, and non-zero only for a post-content
195
+ * stall, where a retry is impossible and the partial reply is kept.
196
+ */
197
+ streamedChars: number;
198
+ /**
199
+ * Liveness frames the attempt received, counted as data arrived that carried
200
+ * no content. Distinguishes the two stall shapes: 0 is a stream that went
201
+ * completely silent, a high count is an upstream that is OPEN and dripping
202
+ * empty frames (DeepSeek's `: keep-alive` comments during a long prefill),
203
+ * which no byte-level idle timeout can see.
204
+ */
205
+ keepAlives: number;
206
+ }
207
+ /**
208
+ * Callback invoked on each stalled upstream stream. Must not throw (providers
209
+ * guard it anyway); keep it fast — it runs on the request path.
210
+ */
211
+ export type AiStreamStallCallback = (event: AiStreamStallEvent) => void;
161
212
  /**
162
213
  * JSON Schema subset for tool parameter definitions.
163
214
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;IACrC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CAAA;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AAE,OAAO,CAAC,CAAA;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAA;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-ai",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Model-agnostic AI provider interface with streaming chat and tool use",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",