@anvia/core 0.26.0 → 1.0.0-rc.10

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 (184) hide show
  1. package/README.md +400 -94
  2. package/dist/agent/index.d.ts +67 -71
  3. package/dist/agent/index.js +36 -18
  4. package/dist/agent/interactions/index.d.ts +122 -0
  5. package/dist/agent/interactions/index.js +20 -0
  6. package/dist/agent-DWzW9SoH.d.ts +150 -0
  7. package/dist/chunk-3RM57ZT2.js +31 -0
  8. package/dist/chunk-3RM57ZT2.js.map +1 -0
  9. package/dist/chunk-3RWESPUG.js +331 -0
  10. package/dist/chunk-3RWESPUG.js.map +1 -0
  11. package/dist/{chunk-NCPN4SJR.js → chunk-3SKZ2BKP.js} +15 -13
  12. package/dist/chunk-3SKZ2BKP.js.map +1 -0
  13. package/dist/chunk-3XQGVDU5.js +69 -0
  14. package/dist/chunk-3XQGVDU5.js.map +1 -0
  15. package/dist/{chunk-MRQLEK2B.js → chunk-5C6B6ZRH.js} +69 -51
  16. package/dist/chunk-5C6B6ZRH.js.map +1 -0
  17. package/dist/chunk-6BBOCFHV.js +323 -0
  18. package/dist/chunk-6BBOCFHV.js.map +1 -0
  19. package/dist/chunk-7JLAIN6E.js +15 -0
  20. package/dist/chunk-7JLAIN6E.js.map +1 -0
  21. package/dist/chunk-7PHMK7W4.js +1516 -0
  22. package/dist/chunk-7PHMK7W4.js.map +1 -0
  23. package/dist/{chunk-CWUJUSOS.js → chunk-AZB6N7P4.js} +94 -65
  24. package/dist/chunk-AZB6N7P4.js.map +1 -0
  25. package/dist/chunk-D4PACGPA.js +37 -0
  26. package/dist/chunk-D4PACGPA.js.map +1 -0
  27. package/dist/chunk-EFLT7XZD.js +51 -0
  28. package/dist/chunk-EFLT7XZD.js.map +1 -0
  29. package/dist/chunk-EMZKPRE6.js +667 -0
  30. package/dist/chunk-EMZKPRE6.js.map +1 -0
  31. package/dist/chunk-I3Q7XSBB.js +59 -0
  32. package/dist/chunk-I3Q7XSBB.js.map +1 -0
  33. package/dist/chunk-J6LVLV6P.js +13 -0
  34. package/dist/chunk-J6LVLV6P.js.map +1 -0
  35. package/dist/chunk-LTXABCOO.js +127 -0
  36. package/dist/chunk-LTXABCOO.js.map +1 -0
  37. package/dist/chunk-OJBFDBLG.js +164 -0
  38. package/dist/chunk-OJBFDBLG.js.map +1 -0
  39. package/dist/chunk-QGX73TSQ.js +177 -0
  40. package/dist/chunk-QGX73TSQ.js.map +1 -0
  41. package/dist/chunk-QOUPWOGW.js +29 -0
  42. package/dist/chunk-QOUPWOGW.js.map +1 -0
  43. package/dist/chunk-SJMSS5SI.js +171 -0
  44. package/dist/chunk-SJMSS5SI.js.map +1 -0
  45. package/dist/chunk-T2C3CGDQ.js +56 -0
  46. package/dist/chunk-T2C3CGDQ.js.map +1 -0
  47. package/dist/chunk-VX3HS6PE.js +4569 -0
  48. package/dist/chunk-VX3HS6PE.js.map +1 -0
  49. package/dist/chunk-X4LK4ODN.js +86 -0
  50. package/dist/chunk-X4LK4ODN.js.map +1 -0
  51. package/dist/chunk-ZA564323.js +331 -0
  52. package/dist/chunk-ZA564323.js.map +1 -0
  53. package/dist/completion/index.d.ts +6 -36
  54. package/dist/completion/index.js +34 -29
  55. package/dist/documents/index.d.ts +34 -0
  56. package/dist/documents/index.js +340 -0
  57. package/dist/documents/index.js.map +1 -0
  58. package/dist/dynamic-tools-aIZlg5x1.d.ts +45 -0
  59. package/dist/embeddings/index.d.ts +11 -9
  60. package/dist/embeddings/index.js +3 -4
  61. package/dist/evals/index.d.ts +57 -21
  62. package/dist/evals/index.js +209 -104
  63. package/dist/evals/index.js.map +1 -1
  64. package/dist/extractor/index.d.ts +27 -42
  65. package/dist/extractor/index.js +9 -22
  66. package/dist/guardrails/index.d.ts +7 -129
  67. package/dist/guardrails/index.js +1 -1
  68. package/dist/image-generation/index.d.ts +23 -23
  69. package/dist/image-generation/index.js +7 -39
  70. package/dist/image-generation/index.js.map +1 -1
  71. package/dist/index.d.ts +24 -22
  72. package/dist/index.js +85 -68
  73. package/dist/internal/agent.d.ts +156 -10
  74. package/dist/internal/agent.js +58 -18
  75. package/dist/internal/agent.js.map +1 -1
  76. package/dist/mcp/index.d.ts +7 -15
  77. package/dist/mcp/index.js +3 -348
  78. package/dist/mcp/index.js.map +1 -1
  79. package/dist/memory/index.d.ts +20 -6
  80. package/dist/memory/index.js +11 -10
  81. package/dist/middleware-kcF8AusP.d.ts +59 -0
  82. package/dist/model-call-options-CZkSw_xN.d.ts +6 -0
  83. package/dist/model-listing/index.d.ts +3 -1
  84. package/dist/observability/index.d.ts +23 -4
  85. package/dist/observability/index.js +10 -5
  86. package/dist/observability/index.js.map +1 -1
  87. package/dist/pipeline/index.d.ts +111 -73
  88. package/dist/pipeline/index.js +471 -286
  89. package/dist/pipeline/index.js.map +1 -1
  90. package/dist/provider-output-error-BEwDgVv3.d.ts +99 -0
  91. package/dist/retry-CjvSlKGW.d.ts +16 -0
  92. package/dist/skills/index.d.ts +5 -4
  93. package/dist/skills/index.js +8 -8
  94. package/dist/speech-generation/index.d.ts +37 -0
  95. package/dist/speech-generation/index.js +10 -0
  96. package/dist/streaming/index.js +37 -3
  97. package/dist/streaming/index.js.map +1 -1
  98. package/dist/text-ZLECpQE7.d.ts +32 -0
  99. package/dist/think-tool-BwCsJ365.d.ts +40 -0
  100. package/dist/tool/index.d.ts +11 -6
  101. package/dist/tool/index.js +21 -21
  102. package/dist/tool-BpqpoRSE.d.ts +58 -0
  103. package/dist/transcription/index.d.ts +29 -22
  104. package/dist/transcription/index.js +7 -57
  105. package/dist/transcription/index.js.map +1 -1
  106. package/dist/type-utils-CtHVDRn_.d.ts +6 -0
  107. package/dist/types-CXNE592e.d.ts +130 -0
  108. package/dist/types-Cr4uiYo5.d.ts +99 -0
  109. package/dist/{types-04LqWrmy.d.ts → types-DC1U1XwW.d.ts} +1 -1
  110. package/dist/types-DKOXVTcq.d.ts +155 -0
  111. package/dist/types-DgvozfPc.d.ts +349 -0
  112. package/dist/types-DhkodEft.d.ts +105 -0
  113. package/dist/types-DjqRHeAi.d.ts +31 -0
  114. package/dist/types-Sue2hb_L.d.ts +403 -0
  115. package/dist/vector-store/index.d.ts +34 -34
  116. package/dist/vector-store/index.js +10 -6
  117. package/package.json +22 -24
  118. package/dist/agent-x3YTyv5i.d.ts +0 -222
  119. package/dist/audio-generation/index.d.ts +0 -33
  120. package/dist/audio-generation/index.js +0 -42
  121. package/dist/audio-generation/index.js.map +0 -1
  122. package/dist/chunk-2ODTMRHP.js +0 -54
  123. package/dist/chunk-2ODTMRHP.js.map +0 -1
  124. package/dist/chunk-ADH7NNCS.js +0 -512
  125. package/dist/chunk-ADH7NNCS.js.map +0 -1
  126. package/dist/chunk-BALBBVI3.js +0 -2732
  127. package/dist/chunk-BALBBVI3.js.map +0 -1
  128. package/dist/chunk-CQNNSZPG.js +0 -9
  129. package/dist/chunk-CQNNSZPG.js.map +0 -1
  130. package/dist/chunk-CWUJUSOS.js.map +0 -1
  131. package/dist/chunk-DALYP4PX.js +0 -225
  132. package/dist/chunk-DALYP4PX.js.map +0 -1
  133. package/dist/chunk-HYUYZEAJ.js +0 -223
  134. package/dist/chunk-HYUYZEAJ.js.map +0 -1
  135. package/dist/chunk-I6XOQ4LK.js +0 -466
  136. package/dist/chunk-I6XOQ4LK.js.map +0 -1
  137. package/dist/chunk-JI5YZWNT.js +0 -220
  138. package/dist/chunk-JI5YZWNT.js.map +0 -1
  139. package/dist/chunk-MC3CCKEB.js +0 -221
  140. package/dist/chunk-MC3CCKEB.js.map +0 -1
  141. package/dist/chunk-MELYDKWQ.js +0 -337
  142. package/dist/chunk-MELYDKWQ.js.map +0 -1
  143. package/dist/chunk-MNWK2USR.js +0 -243
  144. package/dist/chunk-MNWK2USR.js.map +0 -1
  145. package/dist/chunk-MRQLEK2B.js.map +0 -1
  146. package/dist/chunk-NCPN4SJR.js.map +0 -1
  147. package/dist/chunk-OIMLU4SF.js +0 -20
  148. package/dist/chunk-OIMLU4SF.js.map +0 -1
  149. package/dist/chunk-Q25IWLBT.js +0 -138
  150. package/dist/chunk-Q25IWLBT.js.map +0 -1
  151. package/dist/chunk-UQX6EXWG.js +0 -33
  152. package/dist/chunk-UQX6EXWG.js.map +0 -1
  153. package/dist/chunk-WQKHFADH.js +0 -12
  154. package/dist/chunk-WQKHFADH.js.map +0 -1
  155. package/dist/chunk-XUUY2L2D.js +0 -42
  156. package/dist/chunk-XUUY2L2D.js.map +0 -1
  157. package/dist/chunk-XWUC7CIT.js +0 -1
  158. package/dist/chunk-XWUC7CIT.js.map +0 -1
  159. package/dist/chunk-YLMDBQO4.js +0 -141
  160. package/dist/chunk-YLMDBQO4.js.map +0 -1
  161. package/dist/errors-2moLDuuN.d.ts +0 -17
  162. package/dist/hooks/index.d.ts +0 -12
  163. package/dist/hooks/index.js +0 -17
  164. package/dist/index-BxSbmOMr.d.ts +0 -257
  165. package/dist/json-BVPssigK.d.ts +0 -39
  166. package/dist/loaders/index.d.ts +0 -91
  167. package/dist/loaders/index.js +0 -299
  168. package/dist/loaders/index.js.map +0 -1
  169. package/dist/middleware-Dp3d_pxi.d.ts +0 -90
  170. package/dist/request/index.d.ts +0 -28
  171. package/dist/request/index.js +0 -25
  172. package/dist/think-tool-DfCMuO8e.d.ts +0 -26
  173. package/dist/tool-Cohdv5GC.d.ts +0 -65
  174. package/dist/types-BCTRUGex.d.ts +0 -47
  175. package/dist/types-BrLbKnEz.d.ts +0 -119
  176. package/dist/types-D9JpeAPF.d.ts +0 -114
  177. package/dist/types-G12i56s2.d.ts +0 -354
  178. package/dist/types-JJCxRnaZ.d.ts +0 -70
  179. package/dist/types-O-abTIin.d.ts +0 -79
  180. package/dist/ui/index.d.ts +0 -107
  181. package/dist/ui/index.js +0 -10
  182. package/dist/ui/index.js.map +0 -1
  183. /package/dist/{hooks → agent/interactions}/index.js.map +0 -0
  184. /package/dist/{request → speech-generation}/index.js.map +0 -0
@@ -1,354 +0,0 @@
1
- type JsonPrimitive = string | number | boolean | null;
2
- type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
3
- type JsonObject = {
4
- [key: string]: JsonValue | undefined;
5
- };
6
- type Document = {
7
- id: string;
8
- text: string;
9
- additionalProps?: Record<string, string>;
10
- };
11
- type Text = {
12
- type: "text";
13
- text: string;
14
- signature?: string;
15
- };
16
- type ImageDetail = "auto" | "low" | "high";
17
- type ImageContent = {
18
- type: "image";
19
- source: {
20
- type: "url";
21
- url: string;
22
- } | {
23
- type: "base64";
24
- data: string;
25
- mediaType: string;
26
- };
27
- detail?: ImageDetail;
28
- };
29
- type DocumentContent = {
30
- type: "document";
31
- source: {
32
- type: "url";
33
- url: string;
34
- mediaType: string;
35
- filename?: string;
36
- } | {
37
- type: "base64";
38
- data: string;
39
- mediaType: string;
40
- filename?: string;
41
- } | {
42
- type: "text";
43
- text: string;
44
- mediaType?: string;
45
- filename?: string;
46
- };
47
- };
48
- type Reasoning = {
49
- type: "reasoning";
50
- text: string;
51
- id?: string;
52
- content?: ReasoningContent[];
53
- };
54
- type ReasoningContent = {
55
- type: "text";
56
- text: string;
57
- signature?: string;
58
- } | {
59
- type: "summary";
60
- text: string;
61
- } | {
62
- type: "encrypted";
63
- data: string;
64
- } | {
65
- type: "redacted";
66
- data: string;
67
- };
68
- type ReasoningContentType = ReasoningContent["type"];
69
- type ToolFunction = {
70
- name: string;
71
- arguments: JsonValue;
72
- };
73
- type ToolCall = {
74
- type: "tool_call";
75
- id: string;
76
- callId?: string;
77
- function: ToolFunction;
78
- signature?: string;
79
- additionalParams?: JsonValue;
80
- };
81
- type ToolResultContent = {
82
- type: "text";
83
- text: string;
84
- } | {
85
- type: "image";
86
- data: string;
87
- mediaType?: string;
88
- };
89
- type ToolResult = {
90
- type: "tool_result";
91
- id: string;
92
- callId?: string;
93
- toolName?: string;
94
- content: ToolResultContent[];
95
- };
96
- type MessageOptions = {
97
- metadata?: JsonValue | undefined;
98
- };
99
- type AssistantMessageOptions = MessageOptions & {
100
- id?: string | undefined;
101
- };
102
- type ToolResultOptions = {
103
- callId?: string | undefined;
104
- toolName?: string | undefined;
105
- };
106
- type ToolResultMessageOptions = ToolResultOptions & MessageOptions;
107
- type SystemMessage = {
108
- role: "system";
109
- content: string;
110
- metadata?: JsonValue;
111
- };
112
- type UserMessage = {
113
- role: "user";
114
- content: UserContent[];
115
- metadata?: JsonValue;
116
- };
117
- type AssistantMessage = {
118
- role: "assistant";
119
- id?: string;
120
- content: AssistantContent[];
121
- metadata?: JsonValue;
122
- };
123
- type ToolMessage = {
124
- role: "tool";
125
- content: ToolContent[];
126
- metadata?: JsonValue;
127
- };
128
- type UserContent = Text | ImageContent | DocumentContent;
129
- declare const UserContent: {
130
- text(text: string): Text;
131
- imageUrl(url: string, options?: {
132
- detail?: ImageDetail;
133
- }): ImageContent;
134
- imageBase64(data: string, mediaType: string, options?: {
135
- detail?: ImageDetail;
136
- }): ImageContent;
137
- documentUrl(url: string, mediaType: string, options?: {
138
- filename?: string | undefined;
139
- }): DocumentContent;
140
- documentBase64(data: string, mediaType: string, options?: {
141
- filename?: string | undefined;
142
- }): DocumentContent;
143
- documentText(text: string): Text;
144
- };
145
- type ToolContent = ToolResult;
146
- declare const ToolContent: {
147
- toolResult(id: string, content: string | ToolResultContent[], callIdOrOptions?: string | ToolResultOptions, toolName?: string): ToolResult;
148
- };
149
- declare function serializeToolResultOutput(output: unknown): string;
150
- declare function isToolResultContentArray(value: unknown): value is ToolResultContent[];
151
- type AssistantContent = Text | ToolCall | Reasoning | ImageContent;
152
- declare const AssistantContent: {
153
- text(text: string): Text;
154
- imageUrl(url: string, options?: {
155
- detail?: ImageDetail;
156
- }): ImageContent;
157
- imageBase64(data: string, mediaType: string, options?: {
158
- detail?: ImageDetail;
159
- }): ImageContent;
160
- reasoning(text: string, id?: string): Reasoning;
161
- reasoningFromContent(content: ReasoningContent[], id?: string): Reasoning;
162
- reasoningSummary(text: string, id?: string): Reasoning;
163
- reasoningEncrypted(data: string, id?: string): Reasoning;
164
- reasoningRedacted(data: string, id?: string): Reasoning;
165
- toolCall(id: string, name: string, args: JsonValue, callId?: string): ToolCall;
166
- };
167
- declare function reasoningDisplayText(reasoning: Reasoning | ReasoningContent[]): string;
168
- type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;
169
- declare const Message: {
170
- system(content: string, options?: MessageOptions): Message;
171
- user(content: string | UserContent[], options?: MessageOptions): Message;
172
- assistant(content: string | AssistantContent[], idOrOptions?: string | AssistantMessageOptions): Message;
173
- tool(content: ToolContent | ToolContent[], options?: MessageOptions): Message;
174
- toolResult(id: string, output: unknown, options?: ToolResultMessageOptions): Message;
175
- };
176
- type ToolChoice = "auto" | "required" | "none" | {
177
- type: "function";
178
- name: string;
179
- };
180
- type ToolDefinition = {
181
- name: string;
182
- description: string;
183
- parameters: JsonObject;
184
- };
185
- /**
186
- * A tool executed by the model provider rather than by Anvia's local tool runtime.
187
- *
188
- * Provider packages expose typed factories for these values. Application code can
189
- * pass them through the same high-level `tools` APIs used for local tools.
190
- */
191
- type ProviderTool = {
192
- kind: "provider";
193
- provider: string;
194
- name: string;
195
- configuration?: JsonObject;
196
- };
197
- type CompletionTool = ToolDefinition | ProviderTool;
198
- declare function isProviderTool(value: unknown): value is ProviderTool;
199
- type CompletionSource = {
200
- type: "url";
201
- url: string;
202
- title?: string;
203
- id?: string;
204
- startIndex?: number;
205
- endIndex?: number;
206
- };
207
- type ProviderToolCall = {
208
- id: string;
209
- name: string;
210
- status?: string;
211
- details?: JsonObject;
212
- };
213
- /**
214
- * Provider-normalized, mutually exclusive usage buckets.
215
- *
216
- * Every token should appear in exactly one non-total bucket. `total` is the
217
- * only aggregate key and should equal the sum of the other buckets.
218
- */
219
- type UsageDetails = Record<string, number>;
220
- type ModelContextLimits = {
221
- contextWindow: number;
222
- maxInputTokens?: number;
223
- maxOutputTokens?: number;
224
- };
225
- type CompletionModelInfo<ModelName extends string = string> = {
226
- id: ModelName;
227
- context: ModelContextLimits;
228
- };
229
- type CompletionModelMetadataOptions = {
230
- modelOverrides?: Readonly<Record<string, ModelContextLimits>>;
231
- };
232
- type ContextUsage<ModelName extends string = string> = {
233
- model: CompletionModelInfo<ModelName>;
234
- usedTokens: number;
235
- remainingTokens: number;
236
- usedPercent: number;
237
- remainingPercent: number;
238
- };
239
- declare function calculateContextUsage<ModelName extends string>(usage: Usage, model: CompletionModelInfo<ModelName> | undefined): ContextUsage<ModelName> | undefined;
240
- declare function withContextUsage<RawResponse, ModelName extends string>(response: CompletionResponse<RawResponse>, model: CompletionModelInfo<ModelName> | undefined): CompletionResponse<RawResponse>;
241
- declare function resolveCompletionModelInfo<ModelName extends string>(model: ModelName, catalog: Readonly<Record<string, ModelContextLimits>>, overrides?: Readonly<Record<string, ModelContextLimits>>): CompletionModelInfo<ModelName> | undefined;
242
- type AssistantGenerationMetadata = {
243
- provider: string;
244
- model: string;
245
- usage: Usage;
246
- contextUsage?: ContextUsage;
247
- sources?: CompletionSource[];
248
- providerToolCalls?: ProviderToolCall[];
249
- };
250
- type Usage = {
251
- inputTokens: number;
252
- outputTokens: number;
253
- totalTokens: number;
254
- cachedInputTokens: number;
255
- cacheCreationInputTokens: number;
256
- details?: UsageDetails;
257
- };
258
- declare const Usage: {
259
- empty(): Usage;
260
- add(left: Usage, right: Usage): Usage;
261
- };
262
- declare function getAssistantGenerationMetadata(message: Message): AssistantGenerationMetadata | undefined;
263
- type CompletionRequest<ModelName extends string = string> = {
264
- model?: ModelName;
265
- instructions?: string;
266
- chatHistory: Message[];
267
- documents: Document[];
268
- tools: ToolDefinition[];
269
- providerTools?: ProviderTool[];
270
- temperature?: number;
271
- maxTokens?: number;
272
- toolChoice?: ToolChoice;
273
- additionalParams?: JsonValue;
274
- outputSchema?: JsonObject;
275
- };
276
- type CompletionResponse<RawResponse = unknown> = {
277
- choice: AssistantContent[];
278
- usage: Usage;
279
- contextUsage?: ContextUsage;
280
- rawResponse: RawResponse;
281
- messageId?: string;
282
- sources?: CompletionSource[];
283
- providerToolCalls?: ProviderToolCall[];
284
- };
285
- type CompletionModelCapabilities = {
286
- streaming: boolean;
287
- tools: boolean;
288
- toolChoice: boolean;
289
- imageInput: boolean;
290
- documentInput: boolean;
291
- outputSchema: boolean;
292
- reasoning: boolean;
293
- providerTools?: boolean;
294
- };
295
- interface CompletionModel<RawResponse = unknown, ModelName extends string = string> {
296
- readonly provider: string;
297
- readonly defaultModel: ModelName;
298
- readonly capabilities: CompletionModelCapabilities;
299
- getModelInfo?(model?: ModelName): CompletionModelInfo<ModelName> | undefined;
300
- traceRequest?(request: CompletionRequest<ModelName>, options?: {
301
- stream?: boolean | undefined;
302
- }): JsonObject | undefined;
303
- completion(request: CompletionRequest<ModelName>): Promise<CompletionResponse<RawResponse>>;
304
- }
305
- type ToolCallArgumentsMode = "append" | "replace";
306
- type CompletionStreamEvent<RawResponse = unknown> = {
307
- type: "text_delta";
308
- delta: string;
309
- } | {
310
- type: "reasoning_delta";
311
- delta: string;
312
- id?: string;
313
- contentType?: ReasoningContentType;
314
- signature?: string;
315
- } | {
316
- type: "tool_call_delta";
317
- id: string;
318
- callId?: string;
319
- name?: string;
320
- argumentsDelta?: string;
321
- argumentsMode?: ToolCallArgumentsMode;
322
- signature?: string;
323
- } | {
324
- type: "tool_call";
325
- toolCall: ToolCall;
326
- } | {
327
- type: "source";
328
- source: CompletionSource;
329
- } | {
330
- type: "provider_tool_call";
331
- toolCall: ProviderToolCall;
332
- } | {
333
- type: "message_id";
334
- id: string;
335
- } | {
336
- type: "final";
337
- response: CompletionResponse<RawResponse>;
338
- } | {
339
- type: "error";
340
- error: unknown;
341
- usage?: Usage;
342
- };
343
- interface StreamingCompletionModel<RawResponse = unknown, ModelName extends string = string> extends CompletionModel<RawResponse, ModelName> {
344
- streamCompletion(request: CompletionRequest<ModelName>): AsyncIterable<CompletionStreamEvent<RawResponse>>;
345
- }
346
- declare class CompletionCapabilityError extends Error {
347
- constructor(message: string);
348
- }
349
- declare function assertCompletionRequestSupported(model: CompletionModel, request: CompletionRequest, options?: {
350
- streaming?: boolean | undefined;
351
- }): void;
352
- declare function textFromAssistantContent(content: AssistantContent[]): string;
353
-
354
- export { type ToolFunction as $, AssistantContent as A, getAssistantGenerationMetadata as B, type CompletionModel as C, type Document as D, isProviderTool as E, resolveCompletionModelInfo as F, withContextUsage as G, isToolResultContentArray as H, type ImageContent as I, type JsonObject as J, serializeToolResultOutput as K, type ToolChoice as L, Message as M, CompletionCapabilityError as N, type CompletionModelCapabilities as O, type ProviderTool as P, type CompletionStreamEvent as Q, type DocumentContent as R, type SystemMessage as S, type Text as T, Usage as U, type ImageDetail as V, type Reasoning as W, type ReasoningContent as X, type ReasoningContentType as Y, type StreamingCompletionModel as Z, type ToolCallArgumentsMode as _, type AssistantGenerationMetadata as a, type UsageDetails as a0, assertCompletionRequestSupported as a1, reasoningDisplayText as a2, textFromAssistantContent as a3, type AssistantMessage as b, type AssistantMessageOptions as c, type CompletionModelInfo as d, type CompletionModelMetadataOptions as e, type CompletionRequest as f, type CompletionResponse as g, type CompletionSource as h, type CompletionTool as i, type ContextUsage as j, type JsonPrimitive as k, type JsonValue as l, type MessageOptions as m, type ModelContextLimits as n, type ProviderToolCall as o, type ToolCall as p, ToolContent as q, type ToolDefinition as r, type ToolMessage as s, type ToolResult as t, type ToolResultContent as u, type ToolResultMessageOptions as v, type ToolResultOptions as w, UserContent as x, type UserMessage as y, calculateContextUsage as z };
@@ -1,70 +0,0 @@
1
- import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
2
- import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
3
- import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
4
- import { J as JsonObject } from './types-G12i56s2.js';
5
- import { A as AnyTool } from './tool-Cohdv5GC.js';
6
-
7
- type McpToolDefinition = {
8
- name: string;
9
- description?: string | undefined;
10
- inputSchema: JsonObject;
11
- };
12
- type McpToolCallContent = {
13
- type: "text";
14
- text: string;
15
- } | {
16
- type: "image";
17
- data: string;
18
- mimeType: string;
19
- } | {
20
- type: "resource";
21
- resource: {
22
- uri: string;
23
- text: string;
24
- mimeType?: string | undefined;
25
- } | {
26
- uri: string;
27
- blob: string;
28
- mimeType?: string | undefined;
29
- };
30
- };
31
- type McpToolCallResult = {
32
- content: McpToolCallContent[];
33
- isError?: boolean | undefined;
34
- } | {
35
- toolResult: unknown;
36
- };
37
- type McpClient = {
38
- listTools(): Promise<{
39
- tools: McpToolDefinition[];
40
- }>;
41
- callTool(params: {
42
- name: string;
43
- arguments?: Record<string, unknown>;
44
- }): Promise<McpToolCallResult>;
45
- close(): Promise<void>;
46
- };
47
- type McpConnection = {
48
- readonly name: string;
49
- connect(): Promise<McpClient>;
50
- };
51
- type McpServer = {
52
- readonly name: string;
53
- readonly tools: AnyTool[];
54
- close(): Promise<void>;
55
- };
56
- type McpStdioOptions = StdioServerParameters & {
57
- name: string;
58
- };
59
- type McpHttpOptions = {
60
- name: string;
61
- url: string | URL;
62
- transport?: StreamableHTTPClientTransportOptions | undefined;
63
- };
64
- type McpSseOptions = {
65
- name: string;
66
- url: string | URL;
67
- transport?: SSEClientTransportOptions | undefined;
68
- };
69
-
70
- export type { McpConnection as M, McpServer as a, McpStdioOptions as b, McpHttpOptions as c, McpSseOptions as d, McpClient as e, McpToolCallContent as f, McpToolCallResult as g, McpToolDefinition as h };
@@ -1,79 +0,0 @@
1
- import { V as VectorMetadata, a as VectorMetadataValue } from './types-BCTRUGex.js';
2
- import { T as Tool } from './tool-Cohdv5GC.js';
3
-
4
- type VectorFilter = {
5
- type: "eq";
6
- key: string;
7
- value: VectorMetadataValue;
8
- } | {
9
- type: "gt";
10
- key: string;
11
- value: VectorMetadataValue;
12
- } | {
13
- type: "lt";
14
- key: string;
15
- value: VectorMetadataValue;
16
- } | {
17
- type: "and";
18
- filters: [VectorFilter, VectorFilter];
19
- } | {
20
- type: "or";
21
- filters: [VectorFilter, VectorFilter];
22
- };
23
- type LshOptions = {
24
- type: "lsh";
25
- numTables: number;
26
- numHyperplanes: number;
27
- seed?: number | undefined;
28
- };
29
- type IndexStrategy = {
30
- type: "bruteForce";
31
- } | LshOptions;
32
- type VectorSearchRequest = {
33
- query: string;
34
- topK: number;
35
- threshold?: number | undefined;
36
- filter?: VectorFilter | undefined;
37
- };
38
- type VectorSearchResult<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = {
39
- score: number;
40
- id: string;
41
- document: T;
42
- metadata?: Metadata | undefined;
43
- };
44
- type VectorInspectRequest = {
45
- limit: number;
46
- cursor?: string | undefined;
47
- filter?: VectorFilter | undefined;
48
- };
49
- type VectorInspectItem<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = {
50
- id: string;
51
- document: T;
52
- metadata?: Metadata | undefined;
53
- };
54
- type VectorInspectPage<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = {
55
- items: Array<VectorInspectItem<T, Metadata>>;
56
- nextCursor?: string | undefined;
57
- totalCount?: number | undefined;
58
- };
59
- interface VectorSearchIndex<T = unknown, Metadata extends VectorMetadata = VectorMetadata> {
60
- search(request: VectorSearchRequest): Promise<Array<VectorSearchResult<T, Metadata>>>;
61
- searchIds(request: VectorSearchRequest): Promise<Array<{
62
- score: number;
63
- id: string;
64
- }>>;
65
- asTool(options: VectorSearchToolOptions): Tool<{
66
- query: string;
67
- topK?: number;
68
- }, unknown>;
69
- inspect?(request: VectorInspectRequest): Promise<VectorInspectPage<T, Metadata>>;
70
- }
71
- type VectorSearchToolOptions = {
72
- name: string;
73
- description?: string | undefined;
74
- topK?: number | undefined;
75
- threshold?: number | undefined;
76
- filter?: VectorFilter | undefined;
77
- };
78
-
79
- export type { IndexStrategy as I, LshOptions as L, VectorFilter as V, VectorSearchIndex as a, VectorSearchRequest as b, VectorSearchResult as c, VectorInspectRequest as d, VectorInspectPage as e, VectorSearchToolOptions as f, VectorInspectItem as g };
@@ -1,107 +0,0 @@
1
- import { V as ImageDetail, l as JsonValue, U as Usage, j as ContextUsage, M as Message } from '../types-G12i56s2.js';
2
-
3
- type UIMessageRole = "system" | "user" | "assistant" | "tool";
4
- type UIError = {
5
- name?: string;
6
- message: string;
7
- };
8
- type UIMessage = {
9
- id: string;
10
- role: UIMessageRole;
11
- parts: UIMessagePart[];
12
- metadata?: JsonValue;
13
- };
14
- type UIAttachment = {
15
- id: string;
16
- type: "image" | "document" | "file";
17
- name?: string;
18
- mediaType?: string;
19
- url?: string;
20
- data?: string;
21
- text?: string;
22
- detail?: ImageDetail;
23
- metadata?: JsonValue;
24
- };
25
- type CreateUIAttachment = Omit<UIAttachment, "id"> & {
26
- id?: string;
27
- };
28
- type UIMessagePart = {
29
- id: string;
30
- type: "text";
31
- text: string;
32
- } | {
33
- id: string;
34
- type: "reasoning";
35
- text: string;
36
- reasoningId?: string;
37
- } | {
38
- id: string;
39
- type: "tool";
40
- toolName: string;
41
- toolCallId: string;
42
- callId?: string;
43
- turn?: number;
44
- state: "input-streaming" | "input-available" | "output-available" | "error";
45
- input?: JsonValue;
46
- output?: JsonValue;
47
- error?: UIError;
48
- } | {
49
- id: string;
50
- type: "data";
51
- name: string;
52
- data: JsonValue;
53
- } | {
54
- id: string;
55
- type: "attachment";
56
- attachment: UIAttachment;
57
- } | {
58
- id: string;
59
- type: "error";
60
- error: UIError;
61
- };
62
- type UIToolMessagePart = Extract<UIMessagePart, {
63
- type: "tool";
64
- }>;
65
- type UIStreamResume = {
66
- streamId: string;
67
- after: number;
68
- };
69
- type UIStreamRequest = {
70
- messages: Message[];
71
- stream: true;
72
- metadata?: JsonValue;
73
- resume?: UIStreamResume;
74
- };
75
- type UIStreamEvent = {
76
- type: "message_start";
77
- message: UIMessage;
78
- } | {
79
- type: "text_delta";
80
- messageId: string;
81
- partId: string;
82
- delta: string;
83
- } | {
84
- type: "reasoning_delta";
85
- messageId: string;
86
- partId: string;
87
- delta: string;
88
- } | {
89
- type: "tool_update";
90
- messageId: string;
91
- partId: string;
92
- part: UIToolMessagePart;
93
- } | {
94
- type: "message_end";
95
- messageId: string;
96
- usage?: Usage;
97
- contextUsage?: ContextUsage;
98
- metadata?: JsonValue;
99
- } | {
100
- type: "error";
101
- error: UIError;
102
- };
103
-
104
- declare function uiMessagesToCoreMessages(messages: UIMessage[]): Message[];
105
- declare function coreMessagesToUIMessages(messages: Message[]): UIMessage[];
106
-
107
- export { type CreateUIAttachment, type UIAttachment, type UIError, type UIMessage, type UIMessagePart, type UIMessageRole, type UIStreamEvent, type UIStreamRequest, type UIStreamResume, coreMessagesToUIMessages, uiMessagesToCoreMessages };
package/dist/ui/index.js DELETED
@@ -1,10 +0,0 @@
1
- import {
2
- coreMessagesToUIMessages,
3
- uiMessagesToCoreMessages
4
- } from "../chunk-I6XOQ4LK.js";
5
- import "../chunk-ADH7NNCS.js";
6
- export {
7
- coreMessagesToUIMessages,
8
- uiMessagesToCoreMessages
9
- };
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
File without changes