@anvia/core 1.0.0-rc.1 → 1.0.0-rc.3

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 (151) hide show
  1. package/README.md +344 -85
  2. package/dist/agent/index.d.ts +33 -18
  3. package/dist/agent/index.js +42 -17
  4. package/dist/agent-CXScUOpX.d.ts +150 -0
  5. package/dist/{chunk-R2LJSQUW.js → chunk-3CMWKK32.js} +260 -104
  6. package/dist/chunk-3CMWKK32.js.map +1 -0
  7. package/dist/chunk-3RM57ZT2.js +31 -0
  8. package/dist/chunk-3RM57ZT2.js.map +1 -0
  9. package/dist/chunk-5MK3BISB.js +704 -0
  10. package/dist/chunk-5MK3BISB.js.map +1 -0
  11. package/dist/chunk-AI5JMUW7.js +45 -0
  12. package/dist/chunk-AI5JMUW7.js.map +1 -0
  13. package/dist/{chunk-FNQB2JEH.js → chunk-AZB6N7P4.js} +94 -65
  14. package/dist/chunk-AZB6N7P4.js.map +1 -0
  15. package/dist/chunk-BEYBU7VJ.js +53 -0
  16. package/dist/chunk-BEYBU7VJ.js.map +1 -0
  17. package/dist/chunk-BY4OMNIU.js +4699 -0
  18. package/dist/chunk-BY4OMNIU.js.map +1 -0
  19. package/dist/chunk-D2ECOWN5.js +515 -0
  20. package/dist/chunk-D2ECOWN5.js.map +1 -0
  21. package/dist/{chunk-A3UBYTJT.js → chunk-FN7HLLAZ.js} +60 -6
  22. package/dist/chunk-FN7HLLAZ.js.map +1 -0
  23. package/dist/chunk-GKDERULJ.js +50 -0
  24. package/dist/chunk-GKDERULJ.js.map +1 -0
  25. package/dist/chunk-GQL5KRAH.js +331 -0
  26. package/dist/chunk-GQL5KRAH.js.map +1 -0
  27. package/dist/{chunk-5XKDW36Z.js → chunk-KFR4CDGK.js} +70 -75
  28. package/dist/chunk-KFR4CDGK.js.map +1 -0
  29. package/dist/chunk-KV6QCRQ4.js +171 -0
  30. package/dist/chunk-KV6QCRQ4.js.map +1 -0
  31. package/dist/{chunk-DMPUP4R3.js → chunk-LXMAFD23.js} +5 -5
  32. package/dist/{chunk-I6G7BC42.js → chunk-MGNTXGTX.js} +2 -6
  33. package/dist/chunk-MGNTXGTX.js.map +1 -0
  34. package/dist/chunk-PK5LKOFL.js +239 -0
  35. package/dist/chunk-PK5LKOFL.js.map +1 -0
  36. package/dist/chunk-QOUPWOGW.js +29 -0
  37. package/dist/chunk-QOUPWOGW.js.map +1 -0
  38. package/dist/chunk-TRQ3XRFD.js +54 -0
  39. package/dist/chunk-TRQ3XRFD.js.map +1 -0
  40. package/dist/chunk-VKYZZXP5.js +323 -0
  41. package/dist/chunk-VKYZZXP5.js.map +1 -0
  42. package/dist/chunk-ZCPOIDAQ.js +127 -0
  43. package/dist/chunk-ZCPOIDAQ.js.map +1 -0
  44. package/dist/client-DvUatElp.d.ts +84 -0
  45. package/dist/completion/index.d.ts +5 -4
  46. package/dist/completion/index.js +25 -28
  47. package/dist/documents/index.d.ts +34 -0
  48. package/dist/documents/index.js +315 -0
  49. package/dist/documents/index.js.map +1 -0
  50. package/dist/{dynamic-tools-i9woysFa.d.ts → dynamic-tools-AEBOTgu1.d.ts} +21 -9
  51. package/dist/embeddings/index.d.ts +11 -9
  52. package/dist/embeddings/index.js +3 -3
  53. package/dist/evals/index.d.ts +53 -25
  54. package/dist/evals/index.js +153 -103
  55. package/dist/evals/index.js.map +1 -1
  56. package/dist/extractor/index.d.ts +23 -26
  57. package/dist/extractor/index.js +7 -8
  58. package/dist/guardrails/index.d.ts +7 -129
  59. package/dist/guardrails/index.js +1 -1
  60. package/dist/image-generation/index.d.ts +18 -16
  61. package/dist/image-generation/index.js +2 -2
  62. package/dist/index.d.ts +26 -23
  63. package/dist/index.js +71 -48
  64. package/dist/interactions-csssHYcN.d.ts +174 -0
  65. package/dist/internal/agent.d.ts +36 -29
  66. package/dist/internal/agent.js +48 -15
  67. package/dist/internal/agent.js.map +1 -1
  68. package/dist/mcp/index.d.ts +19 -13
  69. package/dist/mcp/index.js +14 -348
  70. package/dist/mcp/index.js.map +1 -1
  71. package/dist/memory/index.d.ts +20 -6
  72. package/dist/memory/index.js +10 -10
  73. package/dist/message-schema-B2M7AYzR.d.ts +52 -0
  74. package/dist/model-call-options-CZkSw_xN.d.ts +6 -0
  75. package/dist/model-listing/index.d.ts +3 -1
  76. package/dist/observability/index.d.ts +21 -6
  77. package/dist/observability/index.js +8 -5
  78. package/dist/observability/index.js.map +1 -1
  79. package/dist/pipeline/index.d.ts +106 -57
  80. package/dist/pipeline/index.js +419 -236
  81. package/dist/pipeline/index.js.map +1 -1
  82. package/dist/{retry-D3Ruy-ba.d.ts → retry-CjvSlKGW.d.ts} +2 -1
  83. package/dist/skills/index.d.ts +5 -4
  84. package/dist/skills/index.js +8 -7
  85. package/dist/speech-generation/index.d.ts +37 -0
  86. package/dist/speech-generation/index.js +8 -0
  87. package/dist/text-C_6eKrbC.d.ts +32 -0
  88. package/dist/{think-tool-DZqZj2LV.d.ts → think-tool-D8frXxwV.d.ts} +16 -2
  89. package/dist/tool/index.d.ts +9 -7
  90. package/dist/tool/index.js +12 -10
  91. package/dist/{tool-C_8GudXn.d.ts → tool-r62gf3QY.d.ts} +17 -8
  92. package/dist/transcription/index.d.ts +23 -14
  93. package/dist/transcription/index.js +2 -2
  94. package/dist/types-C3gv9EX6.d.ts +130 -0
  95. package/dist/{index-DxB74ybJ.d.ts → types-CElwurHZ.d.ts} +139 -88
  96. package/dist/types-CIPaIbZo.d.ts +105 -0
  97. package/dist/types-Cr4uiYo5.d.ts +99 -0
  98. package/dist/types-D9rKQ_as.d.ts +341 -0
  99. package/dist/types-DbolvLtZ.d.ts +155 -0
  100. package/dist/{types-DhQfwiZn.d.ts → types-RT3cuyRk.d.ts} +1 -1
  101. package/dist/vector-store/index.d.ts +33 -34
  102. package/dist/vector-store/index.js +7 -6
  103. package/package.json +10 -14
  104. package/dist/agent-DGYY_onS.d.ts +0 -145
  105. package/dist/audio-generation/index.d.ts +0 -31
  106. package/dist/audio-generation/index.js +0 -8
  107. package/dist/chunk-5XKDW36Z.js.map +0 -1
  108. package/dist/chunk-6WGGTJE6.js +0 -139
  109. package/dist/chunk-6WGGTJE6.js.map +0 -1
  110. package/dist/chunk-A3UBYTJT.js.map +0 -1
  111. package/dist/chunk-ADH7NNCS.js +0 -512
  112. package/dist/chunk-ADH7NNCS.js.map +0 -1
  113. package/dist/chunk-DZ3CKYTH.js +0 -267
  114. package/dist/chunk-DZ3CKYTH.js.map +0 -1
  115. package/dist/chunk-FNQB2JEH.js.map +0 -1
  116. package/dist/chunk-I6G7BC42.js.map +0 -1
  117. package/dist/chunk-IL3ZSNJI.js +0 -3748
  118. package/dist/chunk-IL3ZSNJI.js.map +0 -1
  119. package/dist/chunk-J6GNQART.js +0 -122
  120. package/dist/chunk-J6GNQART.js.map +0 -1
  121. package/dist/chunk-M3IOWB4Y.js +0 -280
  122. package/dist/chunk-M3IOWB4Y.js.map +0 -1
  123. package/dist/chunk-QY5GZ7HR.js +0 -39
  124. package/dist/chunk-QY5GZ7HR.js.map +0 -1
  125. package/dist/chunk-R2LJSQUW.js.map +0 -1
  126. package/dist/chunk-RFDVKCIE.js +0 -12
  127. package/dist/chunk-RFDVKCIE.js.map +0 -1
  128. package/dist/chunk-RMUBRRSK.js +0 -34
  129. package/dist/chunk-RMUBRRSK.js.map +0 -1
  130. package/dist/chunk-RXKHOYEH.js +0 -466
  131. package/dist/chunk-RXKHOYEH.js.map +0 -1
  132. package/dist/chunk-XDRSPSR7.js +0 -38
  133. package/dist/chunk-XDRSPSR7.js.map +0 -1
  134. package/dist/chunk-XWUC7CIT.js +0 -1
  135. package/dist/chunk-XWUC7CIT.js.map +0 -1
  136. package/dist/errors-CYKUcU89.d.ts +0 -17
  137. package/dist/json-Zo7K3xmt.d.ts +0 -40
  138. package/dist/loaders/index.d.ts +0 -86
  139. package/dist/loaders/index.js +0 -299
  140. package/dist/loaders/index.js.map +0 -1
  141. package/dist/middleware-KynLg_RW.d.ts +0 -56
  142. package/dist/types-B3A4YxaA.d.ts +0 -354
  143. package/dist/types-BBEGKB9m.d.ts +0 -119
  144. package/dist/types-DT3nEemY.d.ts +0 -79
  145. package/dist/types-DulRCYdB.d.ts +0 -70
  146. package/dist/types-p55Jc-sr.d.ts +0 -47
  147. package/dist/ui/index.d.ts +0 -107
  148. package/dist/ui/index.js +0 -10
  149. package/dist/ui/index.js.map +0 -1
  150. /package/dist/{chunk-DMPUP4R3.js.map → chunk-LXMAFD23.js.map} +0 -0
  151. /package/dist/{audio-generation → 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 { assertCompletionRequestSupported as $, AssistantContent as A, getAssistantGenerationMetadata as B, type CompletionModel as C, type Document as D, isProviderTool as E, resolveCompletionModelInfo as F, withContextUsage as G, CompletionCapabilityError as H, type ImageContent as I, type JsonObject as J, type CompletionModelCapabilities as K, type CompletionStreamEvent as L, Message as M, type DocumentContent as N, type ImageDetail as O, type ProviderTool as P, type ReasoningContent as Q, type Reasoning as R, type SystemMessage as S, type Text as T, Usage as U, type ReasoningContentType as V, type StreamingCompletionModel as W, type ToolCallArgumentsMode as X, type ToolChoice as Y, type ToolFunction as Z, type UsageDetails as _, type AssistantGenerationMetadata as a, isToolResultContentArray as a0, reasoningDisplayText as a1, serializeToolResultOutput 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,119 +0,0 @@
1
- import { J as JsonObject, M as Message, S as SystemMessage, U as Usage } from './types-B3A4YxaA.js';
2
-
3
- type MemorySavePolicy = "message" | "turn" | "run";
4
- type MemoryContext = {
5
- sessionId: string;
6
- userId?: string | undefined;
7
- metadata?: JsonObject | undefined;
8
- };
9
- type MemoryAppendInput = {
10
- context: MemoryContext;
11
- runId: string;
12
- turn: number;
13
- messages: Message[];
14
- };
15
- type MemoryErrorInput = {
16
- context: MemoryContext;
17
- runId: string;
18
- error: unknown;
19
- messages: Message[];
20
- };
21
- type MemoryConversationListOptions = {
22
- limit: number;
23
- userId?: string | undefined;
24
- };
25
- type MemoryConversationSummary = {
26
- /** Opaque, store-specific reference used to retrieve this exact conversation. */
27
- ref: string;
28
- sessionId: string;
29
- userId?: string | undefined;
30
- metadata?: JsonObject | undefined;
31
- createdAt: string;
32
- updatedAt: string;
33
- messageCount: number;
34
- };
35
- type MemoryConversationMessage = {
36
- position: number;
37
- runId: string;
38
- turn: number;
39
- createdAt: string;
40
- message: Message;
41
- };
42
- type MemoryConversation = MemoryConversationSummary & {
43
- messages: MemoryConversationMessage[];
44
- };
45
- /** Optional, read-only discovery surface for developer tooling such as Studio. */
46
- interface MemoryInspector {
47
- listConversations(options: MemoryConversationListOptions): Promise<MemoryConversationSummary[]>;
48
- getConversation(ref: string): Promise<MemoryConversation | undefined>;
49
- }
50
- interface MemoryStore {
51
- readonly inspector?: MemoryInspector | undefined;
52
- readonly compaction?: MemoryCompactionStore | undefined;
53
- load(context: MemoryContext): Promise<Message[]>;
54
- append(input: MemoryAppendInput): Promise<void>;
55
- clear(context: MemoryContext): Promise<void>;
56
- recordError?(input: MemoryErrorInput): Promise<void>;
57
- }
58
- type MemoryCompactionSnapshot = {
59
- /** Opaque store revision used to reject stale compaction commits. */
60
- revision: string;
61
- messages: Message[];
62
- };
63
- type MemoryCompactionCommitInput = {
64
- context: MemoryContext;
65
- revision: string;
66
- compactedMessageCount: number;
67
- summary: SystemMessage;
68
- runId: string;
69
- };
70
- type MemoryCompactionCommitResult = "committed" | "conflict";
71
- /** Optional durable prefix-replacement capability used by automatic memory compaction. */
72
- interface MemoryCompactionStore {
73
- load(context: MemoryContext): Promise<MemoryCompactionSnapshot>;
74
- commit(input: MemoryCompactionCommitInput): Promise<MemoryCompactionCommitResult>;
75
- }
76
- type MemoryCompactorInput = {
77
- context: MemoryContext;
78
- messages: Message[];
79
- };
80
- type MemoryCompactorResult = {
81
- summary: string;
82
- usage?: Usage | undefined;
83
- };
84
- type MemoryCompactor = (input: MemoryCompactorInput) => Promise<MemoryCompactorResult>;
85
- type SummaryMemoryCompactorOptions = {
86
- instructions?: string | undefined;
87
- maxTokens?: number | undefined;
88
- temperature?: number | undefined;
89
- };
90
- type MemoryCompactionOptions = {
91
- maxMessages: number;
92
- keepRecentUserTurns?: number | undefined;
93
- compactor: MemoryCompactor;
94
- conflictRetries?: number | undefined;
95
- };
96
- type ResolvedMemoryCompactionOptions = {
97
- maxMessages: number;
98
- keepRecentUserTurns: number;
99
- compactor: MemoryCompactor;
100
- conflictRetries: number;
101
- };
102
- type MemoryOptions = {
103
- savePolicy?: MemorySavePolicy | undefined;
104
- compaction?: MemoryCompactionOptions | undefined;
105
- };
106
- type ResolvedMemoryOptions = {
107
- savePolicy: MemorySavePolicy;
108
- compaction?: ResolvedMemoryCompactionOptions | undefined;
109
- };
110
- type MemoryRegistration = {
111
- store: MemoryStore;
112
- options: ResolvedMemoryOptions;
113
- };
114
- type SessionOptions = {
115
- userId?: string | undefined;
116
- metadata?: JsonObject | undefined;
117
- };
118
-
119
- export type { MemoryCompactionCommitInput as M, ResolvedMemoryCompactionOptions as R, SummaryMemoryCompactorOptions as S, MemoryCompactionCommitResult as a, MemoryCompactionOptions as b, MemoryCompactionSnapshot as c, MemoryCompactionStore as d, MemoryCompactor as e, MemoryCompactorInput as f, MemoryCompactorResult as g, MemoryConversation as h, MemoryConversationListOptions as i, MemoryConversationMessage as j, MemoryConversationSummary as k, MemoryInspector as l, MemoryStore as m, MemoryOptions as n, ResolvedMemoryOptions as o, MemoryAppendInput as p, MemoryContext as q, MemoryErrorInput as r, MemoryRegistration as s, MemorySavePolicy as t, SessionOptions as u };
@@ -1,79 +0,0 @@
1
- import { b as VectorMetadataValue, V as VectorMetadata } from './types-p55Jc-sr.js';
2
- import { T as Tool } from './tool-C_8GudXn.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, VectorSearchIndex as V, VectorFilter as a, VectorSearchRequest as b, VectorSearchResult as c, VectorInspectRequest as d, VectorInspectPage as e, VectorSearchToolOptions as f, VectorInspectItem as g };
@@ -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-B3A4YxaA.js';
5
- import { A as AnyTool } from './tool-C_8GudXn.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,47 +0,0 @@
1
- type Embedding = {
2
- document: string;
3
- vector: number[];
4
- };
5
- type SparseVector = {
6
- indices: number[];
7
- values: number[];
8
- };
9
- type SparseEmbedding = {
10
- document: string;
11
- vector: SparseVector;
12
- };
13
- interface EmbeddingModel {
14
- readonly dimensions?: number | undefined;
15
- readonly maxBatchSize?: number | undefined;
16
- embedTexts(texts: string[]): Promise<Embedding[]>;
17
- }
18
- /** Sparse lexical/neural encoder used for hybrid retrieval channels. */
19
- interface SparseEmbeddingModel {
20
- readonly maxBatchSize?: number | undefined;
21
- /** Embed passage/document texts for indexing. */
22
- embedTexts(texts: string[]): Promise<SparseEmbedding[]>;
23
- /** Embed a search query (may differ from passage encoding for models like SPLADE). */
24
- embedQuery(query: string): Promise<SparseEmbedding>;
25
- }
26
- type EmbeddedDocument<T, Metadata extends VectorMetadata = VectorMetadata> = {
27
- id: string;
28
- document: T;
29
- metadata?: Metadata | undefined;
30
- embeddings: Embedding[];
31
- /** Optional sparse vectors aligned 1:1 with `embeddings` by chunk index. */
32
- sparseEmbeddings?: SparseEmbedding[] | undefined;
33
- };
34
- type VectorMetadataValue = string | number | boolean | null;
35
- type VectorMetadata = Record<string, VectorMetadataValue>;
36
- type EmbedDocumentsOptions<T, Metadata extends VectorMetadata = VectorMetadata> = {
37
- id?: ((document: T, index: number) => string) | undefined;
38
- content(document: T, index: number): string | string[];
39
- metadata?: ((document: T, index: number) => Metadata | undefined) | undefined;
40
- concurrency?: number | undefined;
41
- };
42
- type EmbedHybridDocumentsOptions = {
43
- dense: EmbeddingModel;
44
- sparse: SparseEmbeddingModel;
45
- };
46
-
47
- export type { EmbeddingModel as E, SparseEmbeddingModel as S, VectorMetadata as V, EmbeddedDocument as a, VectorMetadataValue as b, EmbedDocumentsOptions as c, EmbedHybridDocumentsOptions as d, SparseEmbedding as e, Embedding as f, SparseVector as g };