@anvia/core 0.13.4 → 0.13.5

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 (68) hide show
  1. package/dist/agent/index.d.ts +11 -11
  2. package/dist/agent/index.js +8 -8
  3. package/dist/{agent-DJr2ITZY.d.ts → agent-W8sT6P5T.d.ts} +8 -7
  4. package/dist/audio-generation/index.d.ts +1 -1
  5. package/dist/{chunk-HRZV6BQL.js → chunk-3LB36HON.js} +26 -11
  6. package/dist/chunk-3LB36HON.js.map +1 -0
  7. package/dist/{chunk-NS7W4G26.js → chunk-3LMKHICK.js} +2 -2
  8. package/dist/{chunk-IWVNXLGQ.js → chunk-6FLW6XS6.js} +3 -3
  9. package/dist/{chunk-DC2GJDPR.js → chunk-77D7XBWL.js} +2 -2
  10. package/dist/{chunk-I7TM7TKX.js → chunk-F3C5653H.js} +4 -4
  11. package/dist/{chunk-CNTGKNZ3.js → chunk-FE5QL4G3.js} +32 -1
  12. package/dist/chunk-FE5QL4G3.js.map +1 -0
  13. package/dist/{chunk-YTF65GYU.js → chunk-IBKCOBAS.js} +2 -2
  14. package/dist/{chunk-BKKHXEWS.js → chunk-LJT67CFB.js} +5 -5
  15. package/dist/{chunk-TPFK5YJG.js → chunk-TTKCFLW6.js} +6 -6
  16. package/dist/{chunk-WHHQWT7D.js → chunk-XH6LZMGH.js} +6 -6
  17. package/dist/completion/index.d.ts +3 -3
  18. package/dist/completion/index.js +4 -2
  19. package/dist/evals/index.d.ts +8 -8
  20. package/dist/evals/index.js +9 -9
  21. package/dist/extractor/index.d.ts +8 -8
  22. package/dist/extractor/index.js +9 -9
  23. package/dist/guardrails/index.d.ts +1 -1
  24. package/dist/hooks/index.d.ts +3 -3
  25. package/dist/image-generation/index.d.ts +1 -1
  26. package/dist/{index-ZQAiHW5Q.d.ts → index-BtyK30mL.d.ts} +2 -2
  27. package/dist/index.d.ts +12 -12
  28. package/dist/index.js +13 -11
  29. package/dist/internal/agent.d.ts +8 -8
  30. package/dist/internal/agent.js +7 -7
  31. package/dist/{json-C5a6auAm.d.ts → json-BOHFS4AG.d.ts} +1 -1
  32. package/dist/loaders/index.d.ts +1 -1
  33. package/dist/mcp/index.d.ts +4 -4
  34. package/dist/memory/index.d.ts +3 -3
  35. package/dist/{middleware-Cc_-sosu.d.ts → middleware-D6p0Uzky.d.ts} +3 -3
  36. package/dist/observability/index.d.ts +3 -3
  37. package/dist/pipeline/index.d.ts +8 -8
  38. package/dist/request/index.d.ts +8 -8
  39. package/dist/request/index.js +6 -6
  40. package/dist/skills/index.d.ts +4 -4
  41. package/dist/skills/index.js +5 -5
  42. package/dist/{think-tool-DvhOlrL8.d.ts → think-tool-B7p_7_5P.d.ts} +1 -1
  43. package/dist/tool/index.d.ts +5 -5
  44. package/dist/tool/index.js +5 -5
  45. package/dist/{tool-6f9bK92X.d.ts → tool-DhT6kR0Z.d.ts} +1 -1
  46. package/dist/transcription/index.d.ts +1 -1
  47. package/dist/{types-C708DOhL.d.ts → types-9TeQF79I.d.ts} +1 -1
  48. package/dist/{types-DzdJOf35.d.ts → types-BNq9tWdA.d.ts} +7 -1
  49. package/dist/{types-BaYwqozV.d.ts → types-BjPcB4PA.d.ts} +1 -1
  50. package/dist/types-CaXSh3vK.d.ts +72 -0
  51. package/dist/{types-BG3s2WzI.d.ts → types-CibT6_rS.d.ts} +2 -2
  52. package/dist/{types-BZQlZ4Vs.d.ts → types-Cz24JCei.d.ts} +1 -1
  53. package/dist/ui/index.d.ts +1 -1
  54. package/dist/ui/index.js +2 -2
  55. package/dist/vector-store/index.d.ts +4 -4
  56. package/dist/vector-store/index.js +2 -2
  57. package/package.json +1 -1
  58. package/dist/chunk-CNTGKNZ3.js.map +0 -1
  59. package/dist/chunk-HRZV6BQL.js.map +0 -1
  60. package/dist/types-CNeDsGjw.d.ts +0 -42
  61. /package/dist/{chunk-NS7W4G26.js.map → chunk-3LMKHICK.js.map} +0 -0
  62. /package/dist/{chunk-IWVNXLGQ.js.map → chunk-6FLW6XS6.js.map} +0 -0
  63. /package/dist/{chunk-DC2GJDPR.js.map → chunk-77D7XBWL.js.map} +0 -0
  64. /package/dist/{chunk-I7TM7TKX.js.map → chunk-F3C5653H.js.map} +0 -0
  65. /package/dist/{chunk-YTF65GYU.js.map → chunk-IBKCOBAS.js.map} +0 -0
  66. /package/dist/{chunk-BKKHXEWS.js.map → chunk-LJT67CFB.js.map} +0 -0
  67. /package/dist/{chunk-TPFK5YJG.js.map → chunk-TTKCFLW6.js.map} +0 -0
  68. /package/dist/{chunk-WHHQWT7D.js.map → chunk-XH6LZMGH.js.map} +0 -0
@@ -1,10 +1,10 @@
1
- import {
2
- toProviderJsonSchema
3
- } from "./chunk-WQKHFADH.js";
4
1
  import {
5
2
  cosineSimilarity,
6
3
  embedText
7
4
  } from "./chunk-YBBD4HZ3.js";
5
+ import {
6
+ toProviderJsonSchema
7
+ } from "./chunk-WQKHFADH.js";
8
8
 
9
9
  // src/vector-store/index.ts
10
10
  import { z } from "zod";
@@ -334,4 +334,4 @@ export {
334
334
  InMemoryVectorIndex,
335
335
  createVectorSearchTool
336
336
  };
337
- //# sourceMappingURL=chunk-I7TM7TKX.js.map
337
+ //# sourceMappingURL=chunk-F3C5653H.js.map
@@ -279,6 +279,36 @@ var Usage = {
279
279
  };
280
280
  }
281
281
  };
282
+ function getAssistantGenerationMetadata(message) {
283
+ if (message.role !== "assistant" || !isJsonObjectValue(message.metadata)) {
284
+ return void 0;
285
+ }
286
+ const frameworkMetadata = message.metadata.anvia;
287
+ if (!isJsonObjectValue(frameworkMetadata)) {
288
+ return void 0;
289
+ }
290
+ const generation = frameworkMetadata.generation;
291
+ if (!isJsonObjectValue(generation) || typeof generation.provider !== "string" || typeof generation.model !== "string" || !isUsageValue(generation.usage)) {
292
+ return void 0;
293
+ }
294
+ return {
295
+ provider: generation.provider,
296
+ model: generation.model,
297
+ usage: { ...generation.usage }
298
+ };
299
+ }
300
+ function isJsonObjectValue(value) {
301
+ return typeof value === "object" && value !== null && !Array.isArray(value);
302
+ }
303
+ function isUsageValue(value) {
304
+ if (!isJsonObjectValue(value)) {
305
+ return false;
306
+ }
307
+ return isNonnegativeFiniteNumber(value.inputTokens) && isNonnegativeFiniteNumber(value.outputTokens) && isNonnegativeFiniteNumber(value.totalTokens) && isNonnegativeFiniteNumber(value.cachedInputTokens) && isNonnegativeFiniteNumber(value.cacheCreationInputTokens);
308
+ }
309
+ function isNonnegativeFiniteNumber(value) {
310
+ return typeof value === "number" && Number.isFinite(value) && value >= 0;
311
+ }
282
312
  var CompletionCapabilityError = class extends Error {
283
313
  constructor(message) {
284
314
  super(message);
@@ -333,8 +363,9 @@ export {
333
363
  reasoningDisplayText,
334
364
  Message,
335
365
  Usage,
366
+ getAssistantGenerationMetadata,
336
367
  CompletionCapabilityError,
337
368
  assertCompletionRequestSupported,
338
369
  textFromAssistantContent
339
370
  };
340
- //# sourceMappingURL=chunk-CNTGKNZ3.js.map
371
+ //# sourceMappingURL=chunk-FE5QL4G3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/completion/json.ts","../src/completion/types.ts"],"sourcesContent":["import type { JsonValue } from \"./types\";\n\nexport function isJsonValue(value: unknown): value is JsonValue {\n return isJsonValueWithAncestors(value, new WeakSet<object>());\n}\n\nfunction isJsonValueWithAncestors(value: unknown, ancestors: WeakSet<object>): value is JsonValue {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return true;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value);\n }\n if (typeof value !== \"object\" || ancestors.has(value)) {\n return false;\n }\n\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n if (!hasOnlyDenseArrayProperties(value)) {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n if (!isJsonValueWithAncestors(value[index], ancestors)) {\n return false;\n }\n }\n return true;\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n return false;\n }\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\") {\n return false;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (\n descriptor === undefined ||\n !descriptor.enumerable ||\n !(\"value\" in descriptor) ||\n !isJsonValueWithAncestors(descriptor.value, ancestors)\n ) {\n return false;\n }\n }\n return true;\n } catch {\n return false;\n } finally {\n ancestors.delete(value);\n }\n}\n\nfunction hasOnlyDenseArrayProperties(value: unknown[]): boolean {\n const keys = Reflect.ownKeys(value);\n if (keys.length !== value.length + 1 || keys.at(-1) !== \"length\") {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n const key = String(index);\n if (keys[index] !== key) {\n return false;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor)) {\n return false;\n }\n }\n return true;\n}\n","import { isJsonValue } from \"./json\";\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue = JsonPrimitive | JsonObject | JsonValue[];\nexport type JsonObject = { [key: string]: JsonValue | undefined };\n\nexport type Document = {\n id: string;\n text: string;\n additionalProps?: Record<string, string>;\n};\n\nexport type Text = {\n type: \"text\";\n text: string;\n signature?: string;\n};\n\nexport type ImageDetail = \"auto\" | \"low\" | \"high\";\n\nexport type ImageContent = {\n type: \"image\";\n source:\n | {\n type: \"url\";\n url: string;\n }\n | {\n type: \"base64\";\n data: string;\n mediaType: string;\n };\n detail?: ImageDetail;\n};\n\nexport type DocumentContent = {\n type: \"document\";\n source:\n | {\n type: \"url\";\n url: string;\n mediaType: string;\n filename?: string;\n }\n | {\n type: \"base64\";\n data: string;\n mediaType: string;\n filename?: string;\n }\n | {\n type: \"text\";\n text: string;\n mediaType?: string;\n filename?: string;\n };\n};\n\nexport type Reasoning = {\n type: \"reasoning\";\n text: string;\n id?: string;\n content?: ReasoningContent[];\n};\n\nexport type ReasoningContent =\n | {\n type: \"text\";\n text: string;\n signature?: string;\n }\n | {\n type: \"summary\";\n text: string;\n }\n | {\n type: \"encrypted\";\n data: string;\n }\n | {\n type: \"redacted\";\n data: string;\n };\n\nexport type ReasoningContentType = ReasoningContent[\"type\"];\n\nexport type ToolFunction = {\n name: string;\n arguments: JsonValue;\n};\n\nexport type ToolCall = {\n type: \"tool_call\";\n id: string;\n callId?: string;\n function: ToolFunction;\n signature?: string;\n additionalParams?: JsonValue;\n};\n\nexport type ToolResultContent =\n | { type: \"text\"; text: string }\n | { type: \"image\"; data: string; mediaType?: string };\n\nexport type ToolResult = {\n type: \"tool_result\";\n id: string;\n callId?: string;\n toolName?: string;\n content: ToolResultContent[];\n};\n\nexport type MessageOptions = {\n metadata?: JsonValue | undefined;\n};\n\nexport type AssistantMessageOptions = MessageOptions & {\n id?: string | undefined;\n};\n\nexport type ToolResultOptions = {\n callId?: string | undefined;\n toolName?: string | undefined;\n};\n\nexport type ToolResultMessageOptions = ToolResultOptions & MessageOptions;\n\nexport type UserContent = Text | ImageContent | DocumentContent;\nexport type AssistantContent = Text | ToolCall | Reasoning | ImageContent;\nexport type ToolContent = ToolResult;\n\nexport type SystemMessage = {\n role: \"system\";\n content: string;\n metadata?: JsonValue;\n};\n\nexport type UserMessage = {\n role: \"user\";\n content: UserContent[];\n metadata?: JsonValue;\n};\n\nexport type AssistantMessage = {\n role: \"assistant\";\n id?: string;\n content: AssistantContent[];\n metadata?: JsonValue;\n};\n\nexport type ToolMessage = {\n role: \"tool\";\n content: ToolContent[];\n metadata?: JsonValue;\n};\n\nexport type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;\n\nexport const UserContent = {\n text(text: string): Text {\n return { type: \"text\", text };\n },\n imageUrl(url: string, options: { detail?: ImageDetail } = {}): ImageContent {\n const image: ImageContent = { type: \"image\", source: { type: \"url\", url } };\n if (options.detail !== undefined) {\n image.detail = options.detail;\n }\n return image;\n },\n imageBase64(\n data: string,\n mediaType: string,\n options: { detail?: ImageDetail } = {},\n ): ImageContent {\n const image: ImageContent = {\n type: \"image\",\n source: { type: \"base64\", data, mediaType },\n };\n if (options.detail !== undefined) {\n image.detail = options.detail;\n }\n return image;\n },\n documentUrl(\n url: string,\n mediaType: string,\n options: { filename?: string | undefined } = {},\n ): DocumentContent {\n return {\n type: \"document\",\n source:\n options.filename === undefined\n ? { type: \"url\", url, mediaType }\n : { type: \"url\", url, mediaType, filename: options.filename },\n };\n },\n documentBase64(\n data: string,\n mediaType: string,\n options: { filename?: string | undefined } = {},\n ): DocumentContent {\n return {\n type: \"document\",\n source:\n options.filename === undefined\n ? { type: \"base64\", data, mediaType }\n : { type: \"base64\", data, mediaType, filename: options.filename },\n };\n },\n documentText(text: string): Text {\n return { type: \"text\", text };\n },\n};\n\nexport const ToolContent = {\n toolResult(\n id: string,\n content: string | ToolResultContent[],\n callIdOrOptions?: string | ToolResultOptions,\n toolName?: string,\n ): ToolResult {\n const normalized =\n typeof content === \"string\" ? [{ type: \"text\" as const, text: content }] : content;\n const options = normalizeToolResultOptions(callIdOrOptions, toolName);\n const result: ToolResult = { type: \"tool_result\", id, content: normalized };\n if (options.callId !== undefined) {\n result.callId = options.callId;\n }\n if (options.toolName !== undefined) {\n result.toolName = options.toolName;\n }\n return result;\n },\n};\n\nfunction normalizeToolResultOptions(\n callIdOrOptions?: string | ToolResultOptions,\n toolName?: string,\n): ToolResultOptions {\n if (callIdOrOptions === undefined) {\n return toolName === undefined ? {} : { toolName };\n }\n if (typeof callIdOrOptions === \"string\") {\n return toolName === undefined\n ? { callId: callIdOrOptions }\n : { callId: callIdOrOptions, toolName };\n }\n return toolName === undefined ? callIdOrOptions : { ...callIdOrOptions, toolName };\n}\n\nexport function serializeToolResultOutput(output: unknown): string {\n if (typeof output === \"string\") {\n return output;\n }\n\n try {\n const serialized = JSON.stringify(output);\n return serialized === undefined ? String(output) : serialized;\n } catch {\n return String(output);\n }\n}\n\nexport function isToolResultContentArray(value: unknown): value is ToolResultContent[] {\n return (\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((item) => {\n if (typeof item !== \"object\" || item === null || !(\"type\" in item)) {\n return false;\n }\n if (item.type === \"text\") {\n return \"text\" in item && typeof item.text === \"string\";\n }\n if (item.type === \"image\") {\n return (\n \"data\" in item &&\n typeof item.data === \"string\" &&\n (!(\"mediaType\" in item) ||\n item.mediaType === undefined ||\n typeof item.mediaType === \"string\")\n );\n }\n return false;\n })\n );\n}\n\nexport const AssistantContent = {\n text(text: string): Text {\n return { type: \"text\", text };\n },\n imageUrl(url: string, options: { detail?: ImageDetail } = {}): ImageContent {\n const image: ImageContent = { type: \"image\", source: { type: \"url\", url } };\n if (options.detail !== undefined) {\n image.detail = options.detail;\n }\n return image;\n },\n imageBase64(\n data: string,\n mediaType: string,\n options: { detail?: ImageDetail } = {},\n ): ImageContent {\n const image: ImageContent = {\n type: \"image\",\n source: { type: \"base64\", data, mediaType },\n };\n if (options.detail !== undefined) {\n image.detail = options.detail;\n }\n return image;\n },\n reasoning(text: string, id?: string): Reasoning {\n return id === undefined ? { type: \"reasoning\", text } : { type: \"reasoning\", text, id };\n },\n reasoningFromContent(content: ReasoningContent[], id?: string): Reasoning {\n const text = reasoningDisplayText(content);\n const reasoning: Reasoning = { type: \"reasoning\", text, content };\n return id === undefined ? reasoning : { ...reasoning, id };\n },\n reasoningSummary(text: string, id?: string): Reasoning {\n return AssistantContent.reasoningFromContent([{ type: \"summary\", text }], id);\n },\n reasoningEncrypted(data: string, id?: string): Reasoning {\n return AssistantContent.reasoningFromContent([{ type: \"encrypted\", data }], id);\n },\n reasoningRedacted(data: string, id?: string): Reasoning {\n return AssistantContent.reasoningFromContent([{ type: \"redacted\", data }], id);\n },\n toolCall(id: string, name: string, args: JsonValue, callId?: string): ToolCall {\n const base: ToolCall = {\n type: \"tool_call\",\n id,\n function: {\n name,\n arguments: args,\n },\n };\n return callId === undefined ? base : { ...base, callId };\n },\n};\n\nexport function reasoningDisplayText(reasoning: Reasoning | ReasoningContent[]): string {\n const content = Array.isArray(reasoning) ? reasoning : reasoning.content;\n if (content === undefined) {\n return Array.isArray(reasoning) ? \"\" : reasoning.text;\n }\n return content\n .flatMap((item) => {\n if (item.type === \"text\" || item.type === \"summary\") {\n return [item.text];\n }\n return [];\n })\n .join(\"\");\n}\n\nexport const Message = {\n system(content: string, options: MessageOptions = {}): Message {\n return { role: \"system\", content, ...messageMetadata(options) };\n },\n user(content: string | UserContent[], options: MessageOptions = {}): Message {\n return {\n role: \"user\",\n content: typeof content === \"string\" ? [UserContent.text(content)] : content,\n ...messageMetadata(options),\n };\n },\n assistant(\n content: string | AssistantContent[],\n idOrOptions?: string | AssistantMessageOptions,\n ): Message {\n const normalized = typeof content === \"string\" ? [AssistantContent.text(content)] : content;\n const options = typeof idOrOptions === \"string\" ? { id: idOrOptions } : (idOrOptions ?? {});\n const metadata = messageMetadata(options).metadata;\n const message: AssistantMessage =\n options.id === undefined\n ? { role: \"assistant\", content: normalized }\n : { role: \"assistant\", id: options.id, content: normalized };\n if (metadata !== undefined) {\n message.metadata = metadata;\n }\n return message;\n },\n tool(content: ToolContent | ToolContent[], options: MessageOptions = {}): Message {\n return {\n role: \"tool\",\n content: Array.isArray(content) ? content : [content],\n ...messageMetadata(options),\n };\n },\n toolResult(id: string, output: unknown, options: ToolResultMessageOptions = {}): Message {\n const content = isToolResultContentArray(output) ? output : serializeToolResultOutput(output);\n return Message.tool(\n ToolContent.toolResult(id, content, {\n callId: options.callId,\n toolName: options.toolName,\n }),\n { metadata: options.metadata },\n );\n },\n};\n\nfunction messageMetadata(options: MessageOptions): { metadata?: JsonValue } {\n if (options.metadata === undefined) {\n return {};\n }\n if (!isJsonValue(options.metadata)) {\n throw new TypeError(\"Message metadata must be a strict JSON value.\");\n }\n return { metadata: options.metadata };\n}\n\nexport type ToolChoice =\n | \"auto\"\n | \"required\"\n | \"none\"\n | {\n type: \"function\";\n name: string;\n };\n\nexport type ToolDefinition = {\n name: string;\n description: string;\n parameters: JsonObject;\n};\n\nexport type Usage = {\n inputTokens: number;\n outputTokens: number;\n totalTokens: number;\n cachedInputTokens: number;\n cacheCreationInputTokens: number;\n};\n\nexport type AssistantGenerationMetadata = {\n provider: string;\n model: string;\n usage: Usage;\n};\n\nexport const Usage = {\n empty(): Usage {\n return {\n inputTokens: 0,\n outputTokens: 0,\n totalTokens: 0,\n cachedInputTokens: 0,\n cacheCreationInputTokens: 0,\n };\n },\n add(left: Usage, right: Usage): Usage {\n return {\n inputTokens: left.inputTokens + right.inputTokens,\n outputTokens: left.outputTokens + right.outputTokens,\n totalTokens: left.totalTokens + right.totalTokens,\n cachedInputTokens: left.cachedInputTokens + right.cachedInputTokens,\n cacheCreationInputTokens: left.cacheCreationInputTokens + right.cacheCreationInputTokens,\n };\n },\n};\n\nexport function getAssistantGenerationMetadata(\n message: Message,\n): AssistantGenerationMetadata | undefined {\n if (message.role !== \"assistant\" || !isJsonObjectValue(message.metadata)) {\n return undefined;\n }\n const frameworkMetadata = message.metadata.anvia;\n if (!isJsonObjectValue(frameworkMetadata)) {\n return undefined;\n }\n const generation = frameworkMetadata.generation;\n if (\n !isJsonObjectValue(generation) ||\n typeof generation.provider !== \"string\" ||\n typeof generation.model !== \"string\" ||\n !isUsageValue(generation.usage)\n ) {\n return undefined;\n }\n return {\n provider: generation.provider,\n model: generation.model,\n usage: { ...generation.usage },\n };\n}\n\nfunction isJsonObjectValue(value: JsonValue | undefined): value is JsonObject {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isUsageValue(value: JsonValue | undefined): value is JsonObject & Usage {\n if (!isJsonObjectValue(value)) {\n return false;\n }\n return (\n isNonnegativeFiniteNumber(value.inputTokens) &&\n isNonnegativeFiniteNumber(value.outputTokens) &&\n isNonnegativeFiniteNumber(value.totalTokens) &&\n isNonnegativeFiniteNumber(value.cachedInputTokens) &&\n isNonnegativeFiniteNumber(value.cacheCreationInputTokens)\n );\n}\n\nfunction isNonnegativeFiniteNumber(value: JsonValue | undefined): value is number {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0;\n}\n\nexport type CompletionRequest<ModelName extends string = string> = {\n model?: ModelName;\n instructions?: string;\n chatHistory: Message[];\n documents: Document[];\n tools: ToolDefinition[];\n temperature?: number;\n maxTokens?: number;\n toolChoice?: ToolChoice;\n additionalParams?: JsonValue;\n outputSchema?: JsonObject;\n};\n\nexport type CompletionResponse<RawResponse = unknown> = {\n choice: AssistantContent[];\n usage: Usage;\n rawResponse: RawResponse;\n messageId?: string;\n};\n\nexport type CompletionModelCapabilities = {\n streaming: boolean;\n tools: boolean;\n toolChoice: boolean;\n imageInput: boolean;\n documentInput: boolean;\n outputSchema: boolean;\n reasoning: boolean;\n};\n\nexport interface CompletionModel<RawResponse = unknown, ModelName extends string = string> {\n readonly provider: string;\n readonly defaultModel: ModelName;\n readonly capabilities: CompletionModelCapabilities;\n traceRequest?(\n request: CompletionRequest<ModelName>,\n options?: { stream?: boolean | undefined },\n ): JsonObject | undefined;\n completion(request: CompletionRequest<ModelName>): Promise<CompletionResponse<RawResponse>>;\n}\n\nexport type CompletionStreamEvent<RawResponse = unknown> =\n | {\n type: \"text_delta\";\n delta: string;\n }\n | {\n type: \"reasoning_delta\";\n delta: string;\n id?: string;\n contentType?: ReasoningContentType;\n signature?: string;\n }\n | {\n type: \"tool_call_delta\";\n id: string;\n callId?: string;\n name?: string;\n argumentsDelta?: string;\n signature?: string;\n }\n | {\n type: \"tool_call\";\n toolCall: ToolCall;\n }\n | {\n type: \"message_id\";\n id: string;\n }\n | {\n type: \"final\";\n response: CompletionResponse<RawResponse>;\n }\n | {\n type: \"error\";\n error: unknown;\n };\n\nexport interface StreamingCompletionModel<RawResponse = unknown, ModelName extends string = string>\n extends CompletionModel<RawResponse, ModelName> {\n streamCompletion(\n request: CompletionRequest<ModelName>,\n ): AsyncIterable<CompletionStreamEvent<RawResponse>>;\n}\n\nexport class CompletionCapabilityError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"CompletionCapabilityError\";\n }\n}\n\nexport function assertCompletionRequestSupported(\n model: CompletionModel,\n request: CompletionRequest,\n options: { streaming?: boolean | undefined } = {},\n): void {\n const modelLabel = `${model.provider}:${request.model ?? model.defaultModel}`;\n const capabilities = model.capabilities;\n\n if (options.streaming === true && !capabilities.streaming) {\n throw new CompletionCapabilityError(`${modelLabel} does not support streaming completions.`);\n }\n\n if (request.tools.length > 0 && !capabilities.tools) {\n throw new CompletionCapabilityError(`${modelLabel} does not support tool definitions.`);\n }\n\n if (request.toolChoice !== undefined && !capabilities.toolChoice) {\n throw new CompletionCapabilityError(`${modelLabel} does not support tool choice.`);\n }\n\n if (request.outputSchema !== undefined && !capabilities.outputSchema) {\n throw new CompletionCapabilityError(`${modelLabel} does not support output schemas.`);\n }\n\n if (!capabilities.imageInput && requestHasImageInput(request)) {\n throw new CompletionCapabilityError(`${modelLabel} does not support image input.`);\n }\n\n if (!capabilities.documentInput && requestHasFileDocumentInput(request)) {\n throw new CompletionCapabilityError(`${modelLabel} does not support document file input.`);\n }\n}\n\nexport function textFromAssistantContent(content: AssistantContent[]): string {\n return content.flatMap((item) => (item.type === \"text\" ? [item.text] : [])).join(\"\\n\");\n}\n\nfunction requestHasImageInput(request: CompletionRequest): boolean {\n return request.chatHistory.some((message) =>\n message.role === \"system\" ? false : message.content.some((content) => content.type === \"image\"),\n );\n}\n\nfunction requestHasFileDocumentInput(request: CompletionRequest): boolean {\n return request.chatHistory.some((message) =>\n message.role === \"user\"\n ? message.content.some(\n (content) => content.type === \"document\" && content.source.type !== \"text\",\n )\n : false,\n );\n}\n"],"mappings":";AAEO,SAAS,YAAY,OAAoC;AAC9D,SAAO,yBAAyB,OAAO,oBAAI,QAAgB,CAAC;AAC9D;AAEA,SAAS,yBAAyB,OAAgB,WAAgD;AAChG,MAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW;AAC7E,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,OAAO,SAAS,KAAK;AAAA,EAC9B;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,IAAI,KAAK,GAAG;AACrD,WAAO;A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TGKNZ3.js";
5
+ } from "./chunk-FE5QL4G3.js";
6
6
  import {
7
7
  toProviderJsonSchema
8
8
  } from "./chunk-WQKHFADH.js";
@@ -335,4 +335,4 @@ export {
335
335
  formatDocument,
336
336
  CompletionRequestBuilder
337
337
  };
338
- //# sourceMappingURL=chunk-YTF65GYU.js.map
338
+ //# sourceMappingURL=chunk-IBKCOBAS.js.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  PromptRequest
3
- } from "./chunk-HRZV6BQL.js";
3
+ } from "./chunk-3LB36HON.js";
4
4
  import {
5
5
  isSkillTool
6
6
  } from "./chunk-YK4WAAS4.js";
7
7
  import {
8
8
  ToolSet
9
- } from "./chunk-WHHQWT7D.js";
9
+ } from "./chunk-XH6LZMGH.js";
10
10
  import {
11
11
  createTool
12
- } from "./chunk-I7TM7TKX.js";
12
+ } from "./chunk-F3C5653H.js";
13
13
  import {
14
14
  isStreamingCompletionModel
15
- } from "./chunk-YTF65GYU.js";
15
+ } from "./chunk-IBKCOBAS.js";
16
16
 
17
17
  // src/agent/agent.ts
18
18
  import { z } from "zod";
@@ -207,4 +207,4 @@ export {
207
207
  Agent,
208
208
  AgentSession
209
209
  };
210
- //# sourceMappingURL=chunk-BKKHXEWS.js.map
210
+ //# sourceMappingURL=chunk-LJT67CFB.js.map
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  AgentBuilder
3
- } from "./chunk-IWVNXLGQ.js";
3
+ } from "./chunk-6FLW6XS6.js";
4
4
  import {
5
5
  extractRagText
6
- } from "./chunk-HRZV6BQL.js";
6
+ } from "./chunk-3LB36HON.js";
7
7
  import {
8
8
  createTool
9
- } from "./chunk-I7TM7TKX.js";
9
+ } from "./chunk-F3C5653H.js";
10
10
  import {
11
11
  CompletionRequestBuilder
12
- } from "./chunk-YTF65GYU.js";
12
+ } from "./chunk-IBKCOBAS.js";
13
13
  import {
14
14
  CompletionCapabilityError,
15
15
  Message,
16
16
  Usage
17
- } from "./chunk-CNTGKNZ3.js";
17
+ } from "./chunk-FE5QL4G3.js";
18
18
 
19
19
  // src/extractor/extractor.ts
20
20
  var SUBMIT_TOOL_NAME = "submit";
@@ -138,4 +138,4 @@ export {
138
138
  Extractor,
139
139
  ExtractorBuilder
140
140
  };
141
- //# sourceMappingURL=chunk-TPFK5YJG.js.map
141
+ //# sourceMappingURL=chunk-TTKCFLW6.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  InMemoryVectorStore,
3
3
  createTool
4
- } from "./chunk-I7TM7TKX.js";
5
- import {
6
- isToolResultContentArray,
7
- serializeToolResultOutput
8
- } from "./chunk-CNTGKNZ3.js";
4
+ } from "./chunk-F3C5653H.js";
9
5
  import {
10
6
  embedDocuments
11
7
  } from "./chunk-YBBD4HZ3.js";
8
+ import {
9
+ isToolResultContentArray,
10
+ serializeToolResultOutput
11
+ } from "./chunk-FE5QL4G3.js";
12
12
 
13
13
  // src/tool/errors.ts
14
14
  var ToolCallError = class extends Error {
@@ -224,4 +224,4 @@ export {
224
224
  createToolMiddleware,
225
225
  createThinkTool
226
226
  };
227
- //# sourceMappingURL=chunk-WHHQWT7D.js.map
227
+ //# sourceMappingURL=chunk-XH6LZMGH.js.map
@@ -1,6 +1,6 @@
1
- export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue, k as isStreamingCompletionModel } from '../json-C5a6auAm.js';
2
- import { D as Document, M as Message, C as CompletionModel, j as ToolDefinition, t as ToolChoice, f as JsonValue, J as JsonObject, c as CompletionRequest, d as CompletionResponse } from '../types-DzdJOf35.js';
3
- export { A as AssistantContent, a as AssistantMessage, b as AssistantMessageOptions, u as CompletionCapabilityError, v as CompletionModelCapabilities, w as CompletionStreamEvent, x as DocumentContent, I as ImageContent, y as ImageDetail, e as JsonPrimitive, g as MessageOptions, R as Reasoning, z as ReasoningContent, B as ReasoningContentType, E as StreamingCompletionModel, S as SystemMessage, T as Text, h as ToolCall, i as ToolContent, F as ToolFunction, k as ToolMessage, l as ToolResult, m as ToolResultContent, n as ToolResultMessageOptions, o as ToolResultOptions, U as Usage, p as UserContent, q as UserMessage, G as assertCompletionRequestSupported, r as isToolResultContentArray, H as reasoningDisplayText, s as serializeToolResultOutput, K as textFromAssistantContent } from '../types-DzdJOf35.js';
1
+ export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue, k as isStreamingCompletionModel } from '../json-BOHFS4AG.js';
2
+ import { D as Document, M as Message, C as CompletionModel, k as ToolDefinition, v as ToolChoice, g as JsonValue, J as JsonObject, d as CompletionRequest, e as CompletionResponse } from '../types-BNq9tWdA.js';
3
+ export { A as AssistantContent, a as AssistantGenerationMetadata, b as AssistantMessage, c as AssistantMessageOptions, w as CompletionCapabilityError, x as CompletionModelCapabilities, y as CompletionStreamEvent, z as DocumentContent, I as ImageContent, B as ImageDetail, f as JsonPrimitive, h as MessageOptions, R as Reasoning, E as ReasoningContent, F as ReasoningContentType, G as StreamingCompletionModel, S as SystemMessage, T as Text, i as ToolCall, j as ToolContent, H as ToolFunction, l as ToolMessage, m as ToolResult, n as ToolResultContent, o as ToolResultMessageOptions, p as ToolResultOptions, U as Usage, q as UserContent, r as UserMessage, K as assertCompletionRequestSupported, s as getAssistantGenerationMetadata, t as isToolResultContentArray, L as reasoningDisplayText, u as serializeToolResultOutput, N as textFromAssistantContent } from '../types-BNq9tWdA.js';
4
4
  import '../zod-schema-C7F4clpm.js';
5
5
  import 'zod';
6
6
 
@@ -6,7 +6,7 @@ import {
6
6
  formatDocument,
7
7
  isStreamingCompletionModel,
8
8
  normalizeDocuments
9
- } from "../chunk-YTF65GYU.js";
9
+ } from "../chunk-IBKCOBAS.js";
10
10
  import {
11
11
  AssistantContent,
12
12
  CompletionCapabilityError,
@@ -15,12 +15,13 @@ import {
15
15
  Usage,
16
16
  UserContent,
17
17
  assertCompletionRequestSupported,
18
+ getAssistantGenerationMetadata,
18
19
  isJsonValue,
19
20
  isToolResultContentArray,
20
21
  reasoningDisplayText,
21
22
  serializeToolResultOutput,
22
23
  textFromAssistantContent
23
- } from "../chunk-CNTGKNZ3.js";
24
+ } from "../chunk-FE5QL4G3.js";
24
25
  import "../chunk-WQKHFADH.js";
25
26
  export {
26
27
  AssistantContent,
@@ -35,6 +36,7 @@ export {
35
36
  createCompletionStream,
36
37
  createParsedCompletion,
37
38
  formatDocument,
39
+ getAssistantGenerationMetadata,
38
40
  isJsonValue,
39
41
  isStreamingCompletionModel,
40
42
  isToolResultContentArray,
@@ -1,14 +1,14 @@
1
- import { A as Agent } from '../agent-DJr2ITZY.js';
2
- import { f as JsonValue, M as Message, C as CompletionModel } from '../types-DzdJOf35.js';
3
- import { P as PromptResponse } from '../index-ZQAiHW5Q.js';
1
+ import { A as Agent } from '../agent-W8sT6P5T.js';
2
+ import { g as JsonValue, M as Message, C as CompletionModel } from '../types-BNq9tWdA.js';
3
+ import { P as PromptResponse } from '../index-BtyK30mL.js';
4
4
  import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
5
5
  import { E as EmbeddingModel } from '../types-DHHZztGO.js';
6
6
  import '../guardrails/index.js';
7
- import '../types-BaYwqozV.js';
8
- import '../types-CNeDsGjw.js';
9
- import '../tool-6f9bK92X.js';
10
- import '../middleware-Cc_-sosu.js';
11
- import '../types-C708DOhL.js';
7
+ import '../types-BjPcB4PA.js';
8
+ import '../types-CaXSh3vK.js';
9
+ import '../tool-DhT6kR0Z.js';
10
+ import '../middleware-D6p0Uzky.js';
11
+ import '../types-9TeQF79I.js';
12
12
  import 'zod';
13
13
 
14
14
  type EvalOutcome<Score = unknown> = {
@@ -1,18 +1,15 @@
1
1
  import {
2
2
  ExtractorBuilder
3
- } from "../chunk-TPFK5YJG.js";
4
- import "../chunk-IWVNXLGQ.js";
5
- import "../chunk-BKKHXEWS.js";
6
- import "../chunk-HRZV6BQL.js";
3
+ } from "../chunk-TTKCFLW6.js";
4
+ import "../chunk-6FLW6XS6.js";
5
+ import "../chunk-LJT67CFB.js";
6
+ import "../chunk-3LB36HON.js";
7
7
  import "../chunk-YK4WAAS4.js";
8
8
  import "../chunk-XUUY2L2D.js";
9
- import "../chunk-WHHQWT7D.js";
10
- import "../chunk-I7TM7TKX.js";
9
+ import "../chunk-XH6LZMGH.js";
10
+ import "../chunk-F3C5653H.js";
11
11
  import "../chunk-2ODTMRHP.js";
12
12
  import "../chunk-M6RPFHG7.js";
13
- import "../chunk-YTF65GYU.js";
14
- import "../chunk-CNTGKNZ3.js";
15
- import "../chunk-WQKHFADH.js";
16
13
  import {
17
14
  cosineSimilarity,
18
15
  embedText
@@ -20,6 +17,9 @@ import {
20
17
  import {
21
18
  mapWithConcurrency
22
19
  } from "../chunk-OIMLU4SF.js";
20
+ import "../chunk-IBKCOBAS.js";
21
+ import "../chunk-FE5QL4G3.js";
22
+ import "../chunk-WQKHFADH.js";
23
23
  import "../chunk-CWUJUSOS.js";
24
24
 
25
25
  // src/evals/agent-target.ts
@@ -1,14 +1,14 @@
1
- import { A as Agent } from '../agent-DJr2ITZY.js';
1
+ import { A as Agent } from '../agent-W8sT6P5T.js';
2
2
  import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
3
- import { U as Usage, M as Message, C as CompletionModel, f as JsonValue, t as ToolChoice } from '../types-DzdJOf35.js';
3
+ import { U as Usage, M as Message, C as CompletionModel, g as JsonValue, v as ToolChoice } from '../types-BNq9tWdA.js';
4
4
  import '../guardrails/index.js';
5
- import '../types-BaYwqozV.js';
6
- import '../types-CNeDsGjw.js';
7
- import '../index-ZQAiHW5Q.js';
8
- import '../tool-6f9bK92X.js';
9
- import '../middleware-Cc_-sosu.js';
5
+ import '../types-BjPcB4PA.js';
6
+ import '../types-CaXSh3vK.js';
7
+ import '../index-BtyK30mL.js';
8
+ import '../tool-DhT6kR0Z.js';
9
+ import '../middleware-D6p0Uzky.js';
10
10
  import '../types-DHHZztGO.js';
11
- import '../types-C708DOhL.js';
11
+ import '../types-9TeQF79I.js';
12
12
  import 'zod';
13
13
 
14
14
  type ExtractionResponse<T> = {
@@ -2,21 +2,21 @@ import {
2
2
  ExtractionError,
3
3
  Extractor,
4
4
  ExtractorBuilder
5
- } from "../chunk-TPFK5YJG.js";
6
- import "../chunk-IWVNXLGQ.js";
7
- import "../chunk-BKKHXEWS.js";
8
- import "../chunk-HRZV6BQL.js";
5
+ } from "../chunk-TTKCFLW6.js";
6
+ import "../chunk-6FLW6XS6.js";
7
+ import "../chunk-LJT67CFB.js";
8
+ import "../chunk-3LB36HON.js";
9
9
  import "../chunk-YK4WAAS4.js";
10
10
  import "../chunk-XUUY2L2D.js";
11
- import "../chunk-WHHQWT7D.js";
12
- import "../chunk-I7TM7TKX.js";
11
+ import "../chunk-XH6LZMGH.js";
12
+ import "../chunk-F3C5653H.js";
13
13
  import "../chunk-2ODTMRHP.js";
14
14
  import "../chunk-M6RPFHG7.js";
15
- import "../chunk-YTF65GYU.js";
16
- import "../chunk-CNTGKNZ3.js";
17
- import "../chunk-WQKHFADH.js";
18
15
  import "../chunk-YBBD4HZ3.js";
19
16
  import "../chunk-OIMLU4SF.js";
17
+ import "../chunk-IBKCOBAS.js";
18
+ import "../chunk-FE5QL4G3.js";
19
+ import "../chunk-WQKHFADH.js";
20
20
  import "../chunk-CWUJUSOS.js";
21
21
  export {
22
22
  ExtractionError,
@@ -1,4 +1,4 @@
1
- import { M as Message, J as JsonObject, U as Usage } from '../types-DzdJOf35.js';
1
+ import { M as Message, J as JsonObject, U as Usage } from '../types-BNq9tWdA.js';
2
2
 
3
3
  type MaybePromise<T> = T | Promise<T>;
4
4
  type GuardrailMode = "enforce" | "observe";
@@ -1,6 +1,6 @@
1
- import { H as HookAction, P as PromptHook, T as ToolApprovalRequestOptions, a as ToolCallHookAction, R as RunControl, b as ToolCallControl } from '../types-BaYwqozV.js';
2
- export { C as CompletionCallHookArgs, c as CompletionErrorHookArgs, d as CompletionResponseHookArgs, e as HookResult, f as RunEndHookArgs, g as RunErrorHookArgs, h as RunStartHookArgs, i as ToolCallHookArgs, j as ToolCallHookResult, k as ToolErrorHookArgs, l as ToolHookArgs, m as ToolResultHookArgs, n as TurnEndHookArgs, o as TurnStartHookArgs } from '../types-BaYwqozV.js';
3
- import '../types-DzdJOf35.js';
1
+ import { H as HookAction, P as PromptHook, T as ToolApprovalRequestOptions, a as ToolCallHookAction, R as RunControl, b as ToolCallControl } from '../types-BjPcB4PA.js';
2
+ export { C as CompletionCallHookArgs, c as CompletionErrorHookArgs, d as CompletionResponseHookArgs, e as HookResult, f as RunEndHookArgs, g as RunErrorHookArgs, h as RunStartHookArgs, i as ToolCallHookArgs, j as ToolCallHookResult, k as ToolErrorHookArgs, l as ToolHookArgs, m as ToolResultHookArgs, n as TurnEndHookArgs, o as TurnStartHookArgs } from '../types-BjPcB4PA.js';
3
+ import '../types-BNq9tWdA.js';
4
4
 
5
5
  declare function createHook<RawResponse = unknown>(hook: PromptHook<RawResponse>): PromptHook<RawResponse>;
6
6
  declare function cancelPrompt(reason: string): HookAction;
@@ -1,4 +1,4 @@
1
- import { f as JsonValue } from '../types-DzdJOf35.js';
1
+ import { g as JsonValue } from '../types-BNq9tWdA.js';
2
2
 
3
3
  type ImageGenerationRequest = {
4
4
  prompt: string;
@@ -1,6 +1,6 @@
1
- import { B as ReasoningContentType, h as ToolCall, U as Usage, M as Message, m as ToolResultContent, d as CompletionResponse, c as CompletionRequest, J as JsonObject, v as CompletionModelCapabilities, j as ToolDefinition, f as JsonValue } from './types-DzdJOf35.js';
1
+ import { F as ReasoningContentType, i as ToolCall, U as Usage, M as Message, n as ToolResultContent, e as CompletionResponse, d as CompletionRequest, J as JsonObject, x as CompletionModelCapabilities, k as ToolDefinition, g as JsonValue } from './types-BNq9tWdA.js';
2
2
  import { GuardrailDecisionRecord } from './guardrails/index.js';
3
- import { g as ToolCallStreamEvent } from './tool-6f9bK92X.js';
3
+ import { g as ToolCallStreamEvent } from './tool-DhT6kR0Z.js';
4
4
 
5
5
  type PromptResponse = {
6
6
  output: string;
package/dist/index.d.ts CHANGED
@@ -1,24 +1,24 @@
1
1
  export { AgentBuilder } from './agent/index.js';
2
- export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue } from './json-C5a6auAm.js';
3
- export { A as AssistantContent, a as AssistantMessage, b as AssistantMessageOptions, C as CompletionModel, c as CompletionRequest, d as CompletionResponse, D as Document, I as ImageContent, J as JsonObject, e as JsonPrimitive, f as JsonValue, M as Message, g as MessageOptions, S as SystemMessage, T as Text, h as ToolCall, i as ToolContent, j as ToolDefinition, k as ToolMessage, l as ToolResult, m as ToolResultContent, n as ToolResultMessageOptions, o as ToolResultOptions, U as Usage, p as UserContent, q as UserMessage } from './types-DzdJOf35.js';
2
+ export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue } from './json-BOHFS4AG.js';
3
+ export { A as AssistantContent, a as AssistantGenerationMetadata, b as AssistantMessage, c as AssistantMessageOptions, C as CompletionModel, d as CompletionRequest, e as CompletionResponse, D as Document, I as ImageContent, J as JsonObject, f as JsonPrimitive, g as JsonValue, M as Message, h as MessageOptions, S as SystemMessage, T as Text, i as ToolCall, j as ToolContent, k as ToolDefinition, l as ToolMessage, m as ToolResult, n as ToolResultContent, o as ToolResultMessageOptions, p as ToolResultOptions, U as Usage, q as UserContent, r as UserMessage, s as getAssistantGenerationMetadata } from './types-BNq9tWdA.js';
4
4
  export { GuardrailBoundary, GuardrailDecisionRecord, GuardrailMode, GuardrailPolicy, GuardrailPolicyInput, GuardrailPolicyOptions, InputGuardrail, InputGuardrailActions, InputGuardrailContext, OutputGuardrail, OutputGuardrailActions, OutputGuardrailContext, allow, block, defineGuardrailPolicy, defineInputGuardrail, defineOutputGuardrail, guardrails } from './guardrails/index.js';
5
5
  export { cancelPrompt, createHook, requestToolApproval, runControl, skipTool, toolCallControl } from './hooks/index.js';
6
- export { M as MemoryStore } from './types-CNeDsGjw.js';
6
+ export { M as MemoryConversation, a as MemoryConversationListOptions, b as MemoryConversationMessage, c as MemoryConversationSummary, d as MemoryInspector, e as MemoryStore } from './types-CaXSh3vK.js';
7
7
  export { MaxTurnsError, PromptCancelledError, ToolApprovalRequiredError } from './request/index.js';
8
- export { C as CompletionRetryContext, a as CompletionRetryOptions } from './agent-DJr2ITZY.js';
9
- export { A as AgentChildStreamEvent, a as AgentStreamEvent, P as PromptResponse } from './index-ZQAiHW5Q.js';
8
+ export { C as CompletionRetryContext, a as CompletionRetryOptions } from './agent-W8sT6P5T.js';
9
+ export { A as AgentChildStreamEvent, a as AgentStreamEvent, P as PromptResponse } from './index-BtyK30mL.js';
10
10
  export { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
11
11
  export { loadSkills, skill } from './skills/index.js';
12
- export { S as SkillValidationError } from './types-BZQlZ4Vs.js';
13
- export { C as CreateToolOptions, c as createThinkTool, a as createTool } from './think-tool-DvhOlrL8.js';
14
- export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalDecision, c as ToolApprovalPolicy, d as ToolApprovalRequest, e as ToolApprovalsOptions, f as ToolCallContext, g as ToolCallStreamEvent } from './tool-6f9bK92X.js';
15
- export { A as AgentMiddleware, C as CompletionRequestMiddlewareArgs, a as CompletionRequestMiddlewareResult, b as CompletionResponseMiddlewareArgs, c as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, d as ToolInputMiddlewareResult, e as ToolMiddleware, f as ToolOutputMiddlewareArgs, g as ToolOutputMiddlewareResult, h as ToolResultMiddlewareArgs, i as createMiddleware, j as createToolMiddleware } from './middleware-Cc_-sosu.js';
12
+ export { S as SkillValidationError } from './types-Cz24JCei.js';
13
+ export { C as CreateToolOptions, c as createThinkTool, a as createTool } from './think-tool-B7p_7_5P.js';
14
+ export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalDecision, c as ToolApprovalPolicy, d as ToolApprovalRequest, e as ToolApprovalsOptions, f as ToolCallContext, g as ToolCallStreamEvent } from './tool-DhT6kR0Z.js';
15
+ export { A as AgentMiddleware, C as CompletionRequestMiddlewareArgs, a as CompletionRequestMiddlewareResult, b as CompletionResponseMiddlewareArgs, c as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, d as ToolInputMiddlewareResult, e as ToolMiddleware, f as ToolOutputMiddlewareArgs, g as ToolOutputMiddlewareResult, h as ToolResultMiddlewareArgs, i as createMiddleware, j as createToolMiddleware } from './middleware-D6p0Uzky.js';
16
16
  export { CreateUIAttachment, UIAttachment, UIError, UIMessage, UIMessagePart, UIMessageRole, UIStreamEvent, UIStreamRequest, coreMessagesToUIMessages, uiMessagesToCoreMessages } from './ui/index.js';
17
- import './types-BaYwqozV.js';
18
- import './types-BG3s2WzI.js';
17
+ import './types-BjPcB4PA.js';
18
+ import './types-CibT6_rS.js';
19
19
  import '@modelcontextprotocol/sdk/client/sse.js';
20
20
  import '@modelcontextprotocol/sdk/client/stdio.js';
21
21
  import '@modelcontextprotocol/sdk/client/streamableHttp.js';
22
- import './types-C708DOhL.js';
22
+ import './types-9TeQF79I.js';
23
23
  import './types-DHHZztGO.js';
24
24
  import 'zod';
package/dist/index.js CHANGED
@@ -2,31 +2,31 @@ import {
2
2
  SkillValidationError,
3
3
  loadSkills,
4
4
  skill
5
- } from "./chunk-DC2GJDPR.js";
5
+ } from "./chunk-77D7XBWL.js";
6
6
  import {
7
7
  coreMessagesToUIMessages,
8
8
  uiMessagesToCoreMessages
9
- } from "./chunk-NS7W4G26.js";
9
+ } from "./chunk-3LMKHICK.js";
10
10
  import "./chunk-CQNNSZPG.js";
11
11
  import {
12
12
  AgentBuilder
13
- } from "./chunk-IWVNXLGQ.js";
14
- import "./chunk-BKKHXEWS.js";
13
+ } from "./chunk-6FLW6XS6.js";
14
+ import "./chunk-LJT67CFB.js";
15
15
  import {
16
16
  MaxTurnsError,
17
17
  PromptCancelledError,
18
18
  ToolApprovalRequiredError
19
- } from "./chunk-HRZV6BQL.js";
19
+ } from "./chunk-3LB36HON.js";
20
20
  import "./chunk-YK4WAAS4.js";
21
21
  import "./chunk-XUUY2L2D.js";
22
22
  import {
23
23
  createMiddleware,
24
24
  createThinkTool,
25
25
  createToolMiddleware
26
- } from "./chunk-WHHQWT7D.js";
26
+ } from "./chunk-XH6LZMGH.js";
27
27
  import {
28
28
  createTool
29
- } from "./chunk-I7TM7TKX.js";
29
+ } from "./chunk-F3C5653H.js";
30
30
  import {
31
31
  cancelPrompt,
32
32
  createHook,
@@ -36,22 +36,23 @@ import {
36
36
  toolCallControl
37
37
  } from "./chunk-2ODTMRHP.js";
38
38
  import "./chunk-M6RPFHG7.js";
39
+ import "./chunk-YBBD4HZ3.js";
40
+ import "./chunk-OIMLU4SF.js";
39
41
  import {
40
42
  createCompletion,
41
43
  createCompletionStream,
42
44
  createParsedCompletion
43
- } from "./chunk-YTF65GYU.js";
45
+ } from "./chunk-IBKCOBAS.js";
44
46
  import {
45
47
  AssistantContent,
46
48
  Message,
47
49
  ToolContent,
48
50
  Usage,
49
51
  UserContent,
52
+ getAssistantGenerationMetadata,
50
53
  isJsonValue
51
- } from "./chunk-CNTGKNZ3.js";
54
+ } from "./chunk-FE5QL4G3.js";
52
55
  import "./chunk-WQKHFADH.js";
53
- import "./chunk-YBBD4HZ3.js";
54
- import "./chunk-OIMLU4SF.js";
55
56
  import {
56
57
  allow,
57
58
  block,
@@ -86,6 +87,7 @@ export {
86
87
  defineGuardrailPolicy,
87
88
  defineInputGuardrail,
88
89
  defineOutputGuardrail,
90
+ getAssistantGenerationMetadata,
89
91
  guardrails,
90
92
  isJsonValue,
91
93
  loadSkills,
@@ -1,10 +1,10 @@
1
- export { A as Agent, e as AgentEventAppendInput, f as AgentEventRecord, c as AgentEventStore, g as AgentEventStoreInclude, d as AgentEventStoreOptions, j as AgentEventStoreRegistration, k as AgentOptions, h as AgentSession, i as AgentToolOptions, l as DEFAULT_MAX_TURNS, D as DynamicContextOptions, m as DynamicContextRegistration, b as DynamicToolOptions, n as DynamicToolRegistration } from '../agent-DJr2ITZY.js';
2
- import '../types-DzdJOf35.js';
1
+ export { A as Agent, e as AgentEventAppendInput, f as AgentEventRecord, c as AgentEventStore, g as AgentEventStoreInclude, d as AgentEventStoreOptions, j as AgentEventStoreRegistration, k as AgentOptions, h as AgentSession, i as AgentToolOptions, l as DEFAULT_MAX_TURNS, D as DynamicContextOptions, m as DynamicContextRegistration, b as DynamicToolOptions, n as DynamicToolRegistration } from '../agent-W8sT6P5T.js';
2
+ import '../types-BNq9tWdA.js';
3
3
  import '../guardrails/index.js';
4
- import '../types-BaYwqozV.js';
5
- import '../types-CNeDsGjw.js';
6
- import '../index-ZQAiHW5Q.js';
7
- import '../tool-6f9bK92X.js';
8
- import '../middleware-Cc_-sosu.js';
4
+ import '../types-BjPcB4PA.js';
5
+ import '../types-CaXSh3vK.js';
6
+ import '../index-BtyK30mL.js';
7
+ import '../tool-DhT6kR0Z.js';
8
+ import '../middleware-D6p0Uzky.js';
9
9
  import '../types-DHHZztGO.js';
10
- import '../types-C708DOhL.js';
10
+ import '../types-9TeQF79I.js';
@@ -2,18 +2,18 @@ import {
2
2
  Agent,
3
3
  AgentSession,
4
4
  DEFAULT_MAX_TURNS
5
- } from "../chunk-BKKHXEWS.js";
6
- import "../chunk-HRZV6BQL.js";
5
+ } from "../chunk-LJT67CFB.js";
6
+ import "../chunk-3LB36HON.js";
7
7
  import "../chunk-YK4WAAS4.js";
8
8
  import "../chunk-XUUY2L2D.js";
9
- import "../chunk-WHHQWT7D.js";
10
- import "../chunk-I7TM7TKX.js";
9
+ import "../chunk-XH6LZMGH.js";
10
+ import "../chunk-F3C5653H.js";
11
11
  import "../chunk-2ODTMRHP.js";
12
- import "../chunk-YTF65GYU.js";
13
- import "../chunk-CNTGKNZ3.js";
14
- import "../chunk-WQKHFADH.js";
15
12
  import "../chunk-YBBD4HZ3.js";
16
13
  import "../chunk-OIMLU4SF.js";
14
+ import "../chunk-IBKCOBAS.js";
15
+ import "../chunk-FE5QL4G3.js";
16
+ import "../chunk-WQKHFADH.js";
17
17
  import "../chunk-CWUJUSOS.js";
18
18
  export {
19
19
  Agent,
@@ -1,5 +1,5 @@
1
1
  import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
2
- import { M as Message, D as Document, j as ToolDefinition, t as ToolChoice, J as JsonObject, f as JsonValue, A as AssistantContent, U as Usage, d as CompletionResponse, C as CompletionModel, E as StreamingCompletionModel, w as CompletionStreamEvent } from './types-DzdJOf35.js';
2
+ import { M as Message, D as Document, k as ToolDefinition, v as ToolChoice, J as JsonObject, g as JsonValue, A as AssistantContent, U as Usage, e as CompletionResponse, C as CompletionModel, G as StreamingCompletionModel, y as CompletionStreamEvent } from './types-BNq9tWdA.js';
3
3
 
4
4
  type CreateCompletionInput = string | Message | Message[];
5
5
  type CreateCompletionBaseOptions = {
@@ -1,4 +1,4 @@
1
- import { D as Document } from '../types-DzdJOf35.js';
1
+ import { D as Document } from '../types-BNq9tWdA.js';
2
2
 
3
3
  type LoaderResult<T> = {
4
4
  ok: true;