@molecule/api-ai 1.3.0 → 1.3.2
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 +111 -24
- package/README.md +209 -148
- package/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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-
|
|
6
|
+
Generated: 2026-10-16T11:11:52.088Z
|
|
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
|
-
#### `
|
|
52
|
+
#### `ChatMessage`
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Chat message in a conversation.
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
interface
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
#### `
|
|
68
|
-
|
|
69
|
-
AI provider interface.
|
|
73
|
+
#### `TokenUsage`
|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
this interface to provide model-specific chat functionality.
|
|
75
|
+
Token usage from a chat completion.
|
|
73
76
|
|
|
74
77
|
```typescript
|
|
75
|
-
interface
|
|
76
|
-
|
|
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
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
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
|
-
|
|
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,74 @@ 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 with any record it had — this callback is
|
|
150
|
+
what makes the provider side of that question answerable, one way or the
|
|
151
|
+
other).
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
interface AiStreamStallEvent {
|
|
155
|
+
/** Provider name (e.g. 'deepseek'). */
|
|
156
|
+
provider: string
|
|
157
|
+
/** Model the stalled request targeted. */
|
|
158
|
+
model: string
|
|
159
|
+
/**
|
|
160
|
+
* Which bound the stream broke: `before_content` is the first-token window
|
|
161
|
+
* (retryable — the reply never started), `after_content` is the inter-chunk
|
|
162
|
+
* silence window (not retryable — a partial reply is already on the wire).
|
|
163
|
+
*/
|
|
164
|
+
phase: 'before_content' | 'after_content'
|
|
165
|
+
/** How long the attempt waited for its first content event, in milliseconds. */
|
|
166
|
+
stallMs: number
|
|
167
|
+
/** 1-based attempt number that stalled. */
|
|
168
|
+
attempt: number
|
|
169
|
+
/** Whether the provider retries this request with a fresh stream. */
|
|
170
|
+
willRetry: boolean
|
|
171
|
+
/**
|
|
172
|
+
* Content characters the stalled attempt streamed before it was abandoned —
|
|
173
|
+
* always 0 for a first-token stall, and non-zero only for a post-content
|
|
174
|
+
* stall, where a retry is impossible and the partial reply is kept.
|
|
175
|
+
*/
|
|
176
|
+
streamedChars: number
|
|
177
|
+
/**
|
|
178
|
+
* Liveness frames the attempt received, counted as data arrived that carried
|
|
179
|
+
* no content. Distinguishes the two stall shapes: 0 is a stream that went
|
|
180
|
+
* completely silent, a high count is an upstream that is OPEN and dripping
|
|
181
|
+
* empty frames (DeepSeek's `: keep-alive` comments during a long prefill),
|
|
182
|
+
* which no byte-level idle timeout can see.
|
|
183
|
+
*/
|
|
184
|
+
keepAlives: number
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### `JSONSchema`
|
|
189
|
+
|
|
190
|
+
JSON Schema subset for tool parameter definitions.
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
interface JSONSchema {
|
|
194
|
+
type: string
|
|
195
|
+
properties?: Record<string, JSONSchema>
|
|
196
|
+
items?: JSONSchema
|
|
197
|
+
required?: string[]
|
|
198
|
+
description?: string
|
|
199
|
+
enum?: unknown[]
|
|
200
|
+
[key: string]: unknown
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
117
204
|
#### `AITool`
|
|
118
205
|
|
|
119
206
|
Tool definition that the AI model can invoke.
|
|
@@ -127,24 +214,27 @@ interface AITool {
|
|
|
127
214
|
}
|
|
128
215
|
```
|
|
129
216
|
|
|
130
|
-
#### `
|
|
217
|
+
#### `ServerTool`
|
|
131
218
|
|
|
132
|
-
|
|
219
|
+
Provider-native tool handled server-side (e.g., Anthropic's `web_search`).
|
|
220
|
+
|
|
221
|
+
Unlike `AITool`, server tools are executed by the AI provider itself —
|
|
222
|
+
no client-side `execute` callback is needed. The provider passes them
|
|
223
|
+
through to the API alongside custom tools.
|
|
133
224
|
|
|
134
225
|
```typescript
|
|
135
|
-
interface
|
|
136
|
-
role: 'user' | 'assistant' | 'system'
|
|
137
|
-
content: string | ContentBlock[]
|
|
226
|
+
interface ServerTool {
|
|
138
227
|
/**
|
|
139
|
-
*
|
|
140
|
-
* e.g.
|
|
141
|
-
*
|
|
142
|
-
*
|
|
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.
|
|
228
|
+
* Provider-specific tool type identifier — a VERSIONED string the provider
|
|
229
|
+
* publishes (e.g. Anthropic's `"web_search_20260209"` on current models;
|
|
230
|
+
* older models use earlier variants like `"web_search_20250305"`). Copy the
|
|
231
|
+
* exact value from the provider's docs for the model in use.
|
|
146
232
|
*/
|
|
147
|
-
|
|
233
|
+
type: string
|
|
234
|
+
/** Tool name. */
|
|
235
|
+
name: string
|
|
236
|
+
/** Allow additional provider-specific fields (max_uses, etc.). */
|
|
237
|
+
[key: string]: unknown
|
|
148
238
|
}
|
|
149
239
|
```
|
|
150
240
|
|
|
@@ -241,90 +331,68 @@ interface ChatParams {
|
|
|
241
331
|
}
|
|
242
332
|
```
|
|
243
333
|
|
|
244
|
-
#### `
|
|
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`
|
|
334
|
+
#### `AIProvider`
|
|
261
335
|
|
|
262
|
-
|
|
336
|
+
AI provider interface.
|
|
263
337
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
through to the API alongside custom tools.
|
|
338
|
+
Each bond package (Anthropic, OpenAI, Gemini, etc.) implements
|
|
339
|
+
this interface to provide model-specific chat functionality.
|
|
267
340
|
|
|
268
341
|
```typescript
|
|
269
|
-
interface
|
|
342
|
+
interface AIProvider {
|
|
343
|
+
readonly name: string
|
|
344
|
+
|
|
270
345
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
346
|
+
* Send a chat request and stream back events.
|
|
347
|
+
*
|
|
348
|
+
* Returns an async iterable of ChatEvent objects.
|
|
349
|
+
* Always yields a final 'done' event with token usage.
|
|
350
|
+
* @returns An async iterable that yields `ChatEvent` objects (text chunks, tool calls, done, or error).
|
|
275
351
|
*/
|
|
276
|
-
|
|
277
|
-
/** Tool name. */
|
|
278
|
-
name: string
|
|
279
|
-
/** Allow additional provider-specific fields (max_uses, etc.). */
|
|
280
|
-
[key: string]: unknown
|
|
352
|
+
chat(params: ChatParams): AsyncIterable<ChatEvent>
|
|
281
353
|
}
|
|
282
354
|
```
|
|
283
355
|
|
|
284
|
-
#### `
|
|
356
|
+
#### `AIConfig`
|
|
285
357
|
|
|
286
|
-
|
|
358
|
+
AI provider configuration.
|
|
287
359
|
|
|
288
360
|
```typescript
|
|
289
|
-
interface
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
|
|
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'
|
|
361
|
+
interface AIConfig {
|
|
362
|
+
/** Default model to use when not specified in ChatParams. */
|
|
363
|
+
defaultModel?: string
|
|
364
|
+
/** Maximum tokens for completions. */
|
|
365
|
+
maxTokens?: number
|
|
366
|
+
/** Default temperature. */
|
|
367
|
+
temperature?: number
|
|
316
368
|
}
|
|
317
369
|
```
|
|
318
370
|
|
|
319
371
|
### Types
|
|
320
372
|
|
|
321
|
-
#### `
|
|
373
|
+
#### `ContentBlock`
|
|
322
374
|
|
|
323
|
-
|
|
324
|
-
|
|
375
|
+
Rich content block within a message.
|
|
376
|
+
|
|
377
|
+
Includes text, tool interactions, and file attachments (images, documents,
|
|
378
|
+
audio, video). Provider bonds map these generic blocks to their native API
|
|
379
|
+
format (e.g., Anthropic base64 source, OpenAI image_url, etc.).
|
|
325
380
|
|
|
326
381
|
```typescript
|
|
327
|
-
type
|
|
382
|
+
type ContentBlock =
|
|
383
|
+
| { type: 'text'; text: string }
|
|
384
|
+
| { type: 'image'; mediaType: string; data: string }
|
|
385
|
+
| { type: 'document'; mediaType: string; data: string; filename?: string }
|
|
386
|
+
| { type: 'audio'; mediaType: string; data: string }
|
|
387
|
+
| { type: 'video'; mediaType: string; data: string }
|
|
388
|
+
// `signature` is a provider-opaque replay token attached to the tool call
|
|
389
|
+
// (Gemini 3.x `thoughtSignature`). Callers that persist tool calls and replay
|
|
390
|
+
// them in later requests MUST carry it back on the replayed block verbatim —
|
|
391
|
+
// Gemini rejects a replayed functionCall without it (400 "Function call is
|
|
392
|
+
// missing a thought_signature"). Providers without such a token omit it, and
|
|
393
|
+
// every bond ignores it when it has no native equivalent.
|
|
394
|
+
| { type: 'tool_use'; id: string; name: string; input: unknown; signature?: string }
|
|
395
|
+
| { type: 'tool_result'; tool_use_id: string; content: string | unknown }
|
|
328
396
|
```
|
|
329
397
|
|
|
330
398
|
#### `ChatEvent`
|
|
@@ -381,42 +449,37 @@ type ChatEvent =
|
|
|
381
449
|
| { type: 'keep_alive' }
|
|
382
450
|
```
|
|
383
451
|
|
|
384
|
-
#### `
|
|
452
|
+
#### `AiRateLimitCallback`
|
|
385
453
|
|
|
386
|
-
|
|
454
|
+
Callback invoked on each rate-limited/overloaded upstream response. Must not
|
|
455
|
+
throw (providers guard it anyway); keep it fast — it runs on the request path.
|
|
387
456
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
457
|
+
```typescript
|
|
458
|
+
type AiRateLimitCallback = (event: AiRateLimitEvent) => void
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
#### `AiStreamStallCallback`
|
|
462
|
+
|
|
463
|
+
Callback invoked on each stalled upstream stream. Must not throw (providers
|
|
464
|
+
guard it anyway); keep it fast — it runs on the request path.
|
|
391
465
|
|
|
392
466
|
```typescript
|
|
393
|
-
type
|
|
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 }
|
|
467
|
+
type AiStreamStallCallback = (event: AiStreamStallEvent) => void
|
|
407
468
|
```
|
|
408
469
|
|
|
409
470
|
### Functions
|
|
410
471
|
|
|
411
|
-
#### `
|
|
472
|
+
#### `setProvider(provider)`
|
|
412
473
|
|
|
413
|
-
|
|
474
|
+
Registers an AI provider in singleton mode.
|
|
475
|
+
|
|
476
|
+
- **Singleton**: `setProvider(provider)` — bonds a single default provider.
|
|
414
477
|
|
|
415
478
|
```typescript
|
|
416
|
-
function
|
|
479
|
+
function setProvider(provider: AIProvider): void
|
|
417
480
|
```
|
|
418
481
|
|
|
419
|
-
|
|
482
|
+
- `provider` — The default provider implementation for this process.
|
|
420
483
|
|
|
421
484
|
#### `getProvider()`
|
|
422
485
|
|
|
@@ -455,6 +518,16 @@ function getProviderByName(name: string): AIProvider | null
|
|
|
455
518
|
|
|
456
519
|
**Returns:** The named AI provider, or `null`.
|
|
457
520
|
|
|
521
|
+
#### `getAllProviders()`
|
|
522
|
+
|
|
523
|
+
Retrieves all named AI providers as a Map keyed by provider name.
|
|
524
|
+
|
|
525
|
+
```typescript
|
|
526
|
+
function getAllProviders(): Map<string, AIProvider>
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**Returns:** Map of provider name → AIProvider.
|
|
530
|
+
|
|
458
531
|
#### `hasProvider(name)`
|
|
459
532
|
|
|
460
533
|
Checks whether an AI provider is currently bonded.
|
|
@@ -486,32 +559,20 @@ function requireProvider(): AIProvider
|
|
|
486
559
|
|
|
487
560
|
**Returns:** The bonded AI provider.
|
|
488
561
|
|
|
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
562
|
## Available Providers
|
|
502
563
|
|
|
503
|
-
| Provider
|
|
504
|
-
|
|
|
505
|
-
| Alibaba Qwen
|
|
506
|
-
| Anthropic
|
|
507
|
-
|
|
|
508
|
-
|
|
|
509
|
-
|
|
|
510
|
-
| MiniMax
|
|
511
|
-
| Moonshot
|
|
512
|
-
|
|
|
513
|
-
| xAI
|
|
514
|
-
| Zhipu GLM
|
|
564
|
+
| Provider | Package |
|
|
565
|
+
| ------------------- | ---------------------------- |
|
|
566
|
+
| Alibaba Qwen | `@molecule/api-ai-alibaba` |
|
|
567
|
+
| Anthropic | `@molecule/api-ai-anthropic` |
|
|
568
|
+
| DeepSeek | `@molecule/api-ai-deepseek` |
|
|
569
|
+
| Google Gemini | `@molecule/api-ai-google` |
|
|
570
|
+
| Local (self-hosted) | `@molecule/api-ai-local` |
|
|
571
|
+
| MiniMax | `@molecule/api-ai-minimax` |
|
|
572
|
+
| Moonshot | `@molecule/api-ai-moonshot` |
|
|
573
|
+
| OpenAI | `@molecule/api-ai-openai` |
|
|
574
|
+
| xAI | `@molecule/api-ai-xai` |
|
|
575
|
+
| Zhipu GLM | `@molecule/api-ai-zhipu` |
|
|
515
576
|
|
|
516
577
|
## Injection Notes
|
|
517
578
|
|
package/dist/types.d.ts
CHANGED
|
@@ -158,6 +158,59 @@ 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 with any record it had — this callback is
|
|
174
|
+
* what makes the provider side of that question answerable, one way or the
|
|
175
|
+
* other).
|
|
176
|
+
*/
|
|
177
|
+
export interface AiStreamStallEvent {
|
|
178
|
+
/** Provider name (e.g. 'deepseek'). */
|
|
179
|
+
provider: string;
|
|
180
|
+
/** Model the stalled request targeted. */
|
|
181
|
+
model: string;
|
|
182
|
+
/**
|
|
183
|
+
* Which bound the stream broke: `before_content` is the first-token window
|
|
184
|
+
* (retryable — the reply never started), `after_content` is the inter-chunk
|
|
185
|
+
* silence window (not retryable — a partial reply is already on the wire).
|
|
186
|
+
*/
|
|
187
|
+
phase: 'before_content' | 'after_content';
|
|
188
|
+
/** How long the attempt waited for its first content event, in milliseconds. */
|
|
189
|
+
stallMs: number;
|
|
190
|
+
/** 1-based attempt number that stalled. */
|
|
191
|
+
attempt: number;
|
|
192
|
+
/** Whether the provider retries this request with a fresh stream. */
|
|
193
|
+
willRetry: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Content characters the stalled attempt streamed before it was abandoned —
|
|
196
|
+
* always 0 for a first-token stall, and non-zero only for a post-content
|
|
197
|
+
* stall, where a retry is impossible and the partial reply is kept.
|
|
198
|
+
*/
|
|
199
|
+
streamedChars: number;
|
|
200
|
+
/**
|
|
201
|
+
* Liveness frames the attempt received, counted as data arrived that carried
|
|
202
|
+
* no content. Distinguishes the two stall shapes: 0 is a stream that went
|
|
203
|
+
* completely silent, a high count is an upstream that is OPEN and dripping
|
|
204
|
+
* empty frames (DeepSeek's `: keep-alive` comments during a long prefill),
|
|
205
|
+
* which no byte-level idle timeout can see.
|
|
206
|
+
*/
|
|
207
|
+
keepAlives: number;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Callback invoked on each stalled upstream stream. Must not throw (providers
|
|
211
|
+
* guard it anyway); keep it fast — it runs on the request path.
|
|
212
|
+
*/
|
|
213
|
+
export type AiStreamStallCallback = (event: AiStreamStallEvent) => void;
|
|
161
214
|
/**
|
|
162
215
|
* JSON Schema subset for tool parameter definitions.
|
|
163
216
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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;IAChC;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAA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