@anvia/core 0.12.3 → 0.12.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 (65) hide show
  1. package/README.md +8 -2
  2. package/dist/agent/index.d.ts +11 -11
  3. package/dist/agent/index.js +6 -6
  4. package/dist/{agent-BBj3jvBi.d.ts → agent-BB9vVH6P.d.ts} +7 -7
  5. package/dist/audio-generation/index.d.ts +1 -1
  6. package/dist/{chunk-4NCRFQHS.js → chunk-5MUPA66B.js} +172 -86
  7. package/dist/chunk-5MUPA66B.js.map +1 -0
  8. package/dist/{chunk-SRBW3LD7.js → chunk-FUJ3POKH.js} +3 -3
  9. package/dist/chunk-FUJ3POKH.js.map +1 -0
  10. package/dist/{chunk-FBN6IEZA.js → chunk-JJ3JGL5D.js} +3 -3
  11. package/dist/{chunk-3CPOJSKK.js → chunk-N3I6HH2J.js} +4 -4
  12. package/dist/{chunk-LKLKEECY.js → chunk-PHCPUMAV.js} +33 -13
  13. package/dist/chunk-PHCPUMAV.js.map +1 -0
  14. package/dist/{chunk-5LFGEMIW.js → chunk-QVFOCNF6.js} +21 -4
  15. package/dist/chunk-QVFOCNF6.js.map +1 -0
  16. package/dist/{chunk-LLA7EW5W.js → chunk-TD6A4RYQ.js} +5 -5
  17. package/dist/{chunk-YVQBC3SJ.js → chunk-YZLOFKTT.js} +2 -2
  18. package/dist/completion/index.d.ts +3 -3
  19. package/dist/completion/index.js +2 -2
  20. package/dist/{create-completion-Y6YsYbQB.d.ts → create-completion-CC8-Ep3w.d.ts} +1 -1
  21. package/dist/evals/index.d.ts +8 -8
  22. package/dist/evals/index.js +7 -7
  23. package/dist/extractor/index.d.ts +8 -8
  24. package/dist/extractor/index.js +7 -7
  25. package/dist/guardrails/index.d.ts +1 -1
  26. package/dist/hooks/index.d.ts +3 -3
  27. package/dist/image-generation/index.d.ts +1 -1
  28. package/dist/{index-Oucb3Ljj.d.ts → index-CM-V4LS3.d.ts} +2 -2
  29. package/dist/index.d.ts +12 -12
  30. package/dist/index.js +7 -7
  31. package/dist/internal/agent.d.ts +8 -8
  32. package/dist/internal/agent.js +5 -5
  33. package/dist/loaders/index.d.ts +1 -1
  34. package/dist/mcp/index.d.ts +4 -4
  35. package/dist/memory/index.d.ts +3 -3
  36. package/dist/{middleware-ByyL6Rj0.d.ts → middleware-i-jLsLom.d.ts} +3 -3
  37. package/dist/observability/index.d.ts +3 -3
  38. package/dist/pipeline/index.d.ts +8 -8
  39. package/dist/request/index.d.ts +8 -8
  40. package/dist/request/index.js +4 -4
  41. package/dist/skills/index.d.ts +4 -4
  42. package/dist/skills/index.js +2 -2
  43. package/dist/{think-tool-B065hm73.d.ts → think-tool-BKDCOJh5.d.ts} +1 -1
  44. package/dist/tool/index.d.ts +5 -5
  45. package/dist/tool/index.js +2 -2
  46. package/dist/{tool-B8K543oQ.d.ts → tool-f2stpvUP.d.ts} +1 -1
  47. package/dist/transcription/index.d.ts +1 -1
  48. package/dist/{types-7F_IKQQW.d.ts → types-5JgWDgaM.d.ts} +2 -2
  49. package/dist/{types-q9G7Bvwl.d.ts → types-C15r7N_4.d.ts} +7 -4
  50. package/dist/{types-CGML74sE.d.ts → types-Dh7gfoGw.d.ts} +1 -1
  51. package/dist/{types-Pl4PFQWL.d.ts → types-DmvXANwl.d.ts} +1 -1
  52. package/dist/{types-BzUuhjKr.d.ts → types-b6fOVoW1.d.ts} +1 -1
  53. package/dist/{types-CqG6d7Ce.d.ts → types-bNDxj4Tt.d.ts} +1 -1
  54. package/dist/ui/index.d.ts +1 -1
  55. package/dist/ui/index.js +2 -2
  56. package/dist/vector-store/index.d.ts +4 -4
  57. package/package.json +1 -1
  58. package/dist/chunk-4NCRFQHS.js.map +0 -1
  59. package/dist/chunk-5LFGEMIW.js.map +0 -1
  60. package/dist/chunk-LKLKEECY.js.map +0 -1
  61. package/dist/chunk-SRBW3LD7.js.map +0 -1
  62. /package/dist/{chunk-FBN6IEZA.js.map → chunk-JJ3JGL5D.js.map} +0 -0
  63. /package/dist/{chunk-3CPOJSKK.js.map → chunk-N3I6HH2J.js.map} +0 -0
  64. /package/dist/{chunk-LLA7EW5W.js.map → chunk-TD6A4RYQ.js.map} +0 -0
  65. /package/dist/{chunk-YVQBC3SJ.js.map → chunk-YZLOFKTT.js.map} +0 -0
@@ -37,11 +37,28 @@ var UserContent = {
37
37
  }
38
38
  };
39
39
  var ToolContent = {
40
- toolResult(id, content, callId) {
40
+ toolResult(id, content, callIdOrOptions, toolName) {
41
41
  const normalized = typeof content === "string" ? [{ type: "text", text: content }] : content;
42
- return callId === void 0 ? { type: "tool_result", id, content: normalized } : { type: "tool_result", id, callId, content: normalized };
42
+ const options = normalizeToolResultOptions(callIdOrOptions, toolName);
43
+ const result = { type: "tool_result", id, content: normalized };
44
+ if (options.callId !== void 0) {
45
+ result.callId = options.callId;
46
+ }
47
+ if (options.toolName !== void 0) {
48
+ result.toolName = options.toolName;
49
+ }
50
+ return result;
43
51
  }
44
52
  };
53
+ function normalizeToolResultOptions(callIdOrOptions, toolName) {
54
+ if (callIdOrOptions === void 0) {
55
+ return toolName === void 0 ? {} : { toolName };
56
+ }
57
+ if (typeof callIdOrOptions === "string") {
58
+ return toolName === void 0 ? { callId: callIdOrOptions } : { callId: callIdOrOptions, toolName };
59
+ }
60
+ return toolName === void 0 ? callIdOrOptions : { ...callIdOrOptions, toolName };
61
+ }
45
62
  function serializeToolResultOutput(output) {
46
63
  if (typeof output === "string") {
47
64
  return output;
@@ -151,7 +168,7 @@ var Message = {
151
168
  },
152
169
  toolResult(id, output, options = {}) {
153
170
  const content = isToolResultContentArray(output) ? output : serializeToolResultOutput(output);
154
- return Message.tool(ToolContent.toolResult(id, content, options.callId));
171
+ return Message.tool(ToolContent.toolResult(id, content, options));
155
172
  }
156
173
  };
157
174
  var Usage = {
@@ -231,4 +248,4 @@ export {
231
248
  assertCompletionRequestSupported,
232
249
  textFromAssistantContent
233
250
  };
234
- //# sourceMappingURL=chunk-5LFGEMIW.js.map
251
+ //# sourceMappingURL=chunk-QVFOCNF6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/completion/types.ts"],"sourcesContent":["export 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\ntype ToolResultOptions = {\n callId?: string | undefined;\n toolName?: string | undefined;\n};\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};\n\nexport type UserMessage = {\n role: \"user\";\n content: UserContent[];\n};\n\nexport type AssistantMessage = {\n role: \"assistant\";\n id?: string;\n content: AssistantContent[];\n};\n\nexport type ToolMessage = {\n role: \"tool\";\n content: ToolContent[];\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): Message {\n return { role: \"system\", content };\n },\n user(content: string | UserContent[]): Message {\n return {\n role: \"user\",\n content: typeof content === \"string\" ? [UserContent.text(content)] : content,\n };\n },\n assistant(content: string | AssistantContent[], id?: string): Message {\n const normalized = typeof content === \"string\" ? [AssistantContent.text(content)] : content;\n return id === undefined\n ? { role: \"assistant\", content: normalized }\n : { role: \"assistant\", id, content: normalized };\n },\n tool(content: ToolContent | ToolContent[]): Message {\n return {\n role: \"tool\",\n content: Array.isArray(content) ? content : [content],\n };\n },\n toolResult(id: string, output: unknown, options: ToolResultOptions = {}): Message {\n const content = isToolResultContentArray(output) ? output : serializeToolResultOutput(output);\n return Message.tool(ToolContent.toolResult(id, content, options));\n },\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 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 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":";AA8IO,IAAM,cAAc;AAAA,EACzB,KAAK,MAAoB;AACvB,WAAO,EAAE,MAAM,QAAQ,KAAK;AAAA,EAC9B;AAAA,EACA,SAAS,KAAa,UAAoC,CAAC,GAAiB;AAC1E,UAAM,QAAsB,EAAE,MAAM,SAAS,QAAQ,EAAE,MAAM,OAAO,IAAI,EAAE;AAC1E,QAAI,QAAQ,WAAW,QAAW;AAChC,YAAM,SAAS,QAAQ;AAAA,IACzB;AACA,WAAO;AAAA,EACT;AAAA,EACA,YACE,MACA,WACA,UAAoC,CAAC,GACvB;AACd,UAAM,QAAsB;AAAA,MAC1B,MAAM;AAAA,MACN,QAAQ,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,IAC5C;AACA,QAAI,QAAQ,WAAW,QAAW;AAChC,YAAM,SAAS,QAAQ;AAAA,IACzB;AACA,WAAO;AAAA,EACT;AAAA,EACA,YACE,KACA,WACA,UAA6C,CAAC,GAC7B;AACjB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,QACE,QAAQ,aAAa,SACjB,EAAE,MAAM,OAAO,KAAK,UAAU,IAC9B,EAAE,MAAM,OAAO,KAAK,WAAW,UAAU,QAAQ,SAAS;AAAA,IAClE;AAAA,EACF;AAAA,EACA,eACE,MACA,WACA,UAA6C,CAAC,GAC7B;AACjB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,QACE,QAAQ,aAAa,SACjB,EAAE,MAAM,UAAU,MAAM,UAAU,IAClC,EAAE,MAAM,UAAU,MAAM,WAAW,UAAU,QAAQ,SAAS;AAAA,IACtE;AAAA,EACF;AAAA,EACA,aAAa,MAAoB;AAC/B,WAAO,EAAE,MAAM,QAAQ,KAAK;AAAA,EAC9B;AACF;AAE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AAI,0BAA0B,GAAG,UAAU,gCAAgC;AAAA,EACnF;AAEA,MAAI,QAAQ,iBAAiB,UAAa,CAAC,aAAa,cAAc;AACpE,UAAM,IAAI,0BAA0B,GAAG,UAAU,mCAAmC;AAAA,EACtF;AAEA,MAAI,CAAC,aAAa,cAAc,qBAAqB,OAAO,GAAG;AAC7D,UAAM,IAAI,0BAA0B,GAAG,UAAU,gCAAgC;AAAA,EACnF;AAEA,MAAI,CAAC,aAAa,iBAAiB,4BAA4B,OAAO,GAAG;AACvE,UAAM,IAAI,0BAA0B,GAAG,UAAU,wCAAwC;AAAA,EAC3F;AACF;AAEO,SAAS,yBAAyB,SAAqC;AAC5E,SAAO,QAAQ,QAAQ,CAAC,SAAU,KAAK,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,CAAE,EAAE,KAAK,IAAI;AACvF;AAEA,SAAS,qBAAqB,SAAqC;AACjE,SAAO,QAAQ,YAAY;AAAA,IAAK,CAAC,YAC/B,QAAQ,SAAS,WAAW,QAAQ,QAAQ,QAAQ,KAAK,CAAC,YAAY,QAAQ,SAAS,OAAO;AAAA,EAChG;AACF;AAEA,SAAS,4BAA4B,SAAqC;AACxE,SAAO,QAAQ,YAAY;AAAA,IAAK,CAAC,YAC/B,QAAQ,SAAS,SACb,QAAQ,QAAQ;AAAA,MACd,CAAC,YAAY,QAAQ,SAAS,cAAc,QAAQ,OAAO,SAAS;AAAA,IACtE,IACA;AAAA,EACN;AACF;","names":[]}
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  AgentBuilder
3
- } from "./chunk-FBN6IEZA.js";
3
+ } from "./chunk-JJ3JGL5D.js";
4
4
  import {
5
5
  extractRagText
6
- } from "./chunk-4NCRFQHS.js";
6
+ } from "./chunk-5MUPA66B.js";
7
7
  import {
8
8
  createTool
9
9
  } from "./chunk-QKA6OQTH.js";
10
10
  import {
11
11
  CompletionRequestBuilder
12
- } from "./chunk-SRBW3LD7.js";
12
+ } from "./chunk-FUJ3POKH.js";
13
13
  import {
14
14
  CompletionCapabilityError,
15
15
  Message,
16
16
  Usage
17
- } from "./chunk-5LFGEMIW.js";
17
+ } from "./chunk-QVFOCNF6.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-LLA7EW5W.js.map
141
+ //# sourceMappingURL=chunk-TD6A4RYQ.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  isToolResultContentArray,
10
10
  serializeToolResultOutput
11
- } from "./chunk-5LFGEMIW.js";
11
+ } from "./chunk-QVFOCNF6.js";
12
12
  import {
13
13
  embedDocuments
14
14
  } from "./chunk-JS5MGVNM.js";
@@ -225,4 +225,4 @@ export {
225
225
  createToolMiddleware,
226
226
  createThinkTool
227
227
  };
228
- //# sourceMappingURL=chunk-YVQBC3SJ.js.map
228
+ //# sourceMappingURL=chunk-YZLOFKTT.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 isStreamingCompletionModel } from '../create-completion-Y6YsYbQB.js';
2
- import { D as Document, M as Message, C as CompletionModel, h as ToolDefinition, n as ToolChoice, e as JsonValue, J as JsonObject, b as CompletionRequest, c as CompletionResponse } from '../types-q9G7Bvwl.js';
3
- export { A as AssistantContent, a as AssistantMessage, r as CompletionCapabilityError, t as CompletionModelCapabilities, p as CompletionStreamEvent, u as DocumentContent, I as ImageContent, v as ImageDetail, d as JsonPrimitive, R as Reasoning, w as ReasoningContent, x as ReasoningContentType, o as StreamingCompletionModel, S as SystemMessage, T as Text, f as ToolCall, g as ToolContent, y as ToolFunction, i as ToolMessage, j as ToolResult, k as ToolResultContent, U as Usage, l as UserContent, m as UserMessage, z as assertCompletionRequestSupported, q as isToolResultContentArray, B as reasoningDisplayText, s as serializeToolResultOutput, E as textFromAssistantContent } from '../types-q9G7Bvwl.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 isStreamingCompletionModel } from '../create-completion-CC8-Ep3w.js';
2
+ import { D as Document, M as Message, C as CompletionModel, h as ToolDefinition, n as ToolChoice, e as JsonValue, J as JsonObject, b as CompletionRequest, c as CompletionResponse } from '../types-C15r7N_4.js';
3
+ export { A as AssistantContent, a as AssistantMessage, r as CompletionCapabilityError, t as CompletionModelCapabilities, p as CompletionStreamEvent, u as DocumentContent, I as ImageContent, v as ImageDetail, d as JsonPrimitive, R as Reasoning, w as ReasoningContent, x as ReasoningContentType, o as StreamingCompletionModel, S as SystemMessage, T as Text, f as ToolCall, g as ToolContent, y as ToolFunction, i as ToolMessage, j as ToolResult, k as ToolResultContent, U as Usage, l as UserContent, m as UserMessage, z as assertCompletionRequestSupported, q as isToolResultContentArray, B as reasoningDisplayText, s as serializeToolResultOutput, E as textFromAssistantContent } from '../types-C15r7N_4.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-SRBW3LD7.js";
9
+ } from "../chunk-FUJ3POKH.js";
10
10
  import {
11
11
  AssistantContent,
12
12
  CompletionCapabilityError,
@@ -19,7 +19,7 @@ import {
19
19
  reasoningDisplayText,
20
20
  serializeToolResultOutput,
21
21
  textFromAssistantContent
22
- } from "../chunk-5LFGEMIW.js";
22
+ } from "../chunk-QVFOCNF6.js";
23
23
  import "../chunk-WQKHFADH.js";
24
24
  export {
25
25
  AssistantContent,
@@ -1,5 +1,5 @@
1
1
  import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
2
- import { M as Message, D as Document, h as ToolDefinition, n as ToolChoice, J as JsonObject, e as JsonValue, A as AssistantContent, U as Usage, c as CompletionResponse, C as CompletionModel, o as StreamingCompletionModel, p as CompletionStreamEvent } from './types-q9G7Bvwl.js';
2
+ import { M as Message, D as Document, h as ToolDefinition, n as ToolChoice, J as JsonObject, e as JsonValue, A as AssistantContent, U as Usage, c as CompletionResponse, C as CompletionModel, o as StreamingCompletionModel, p as CompletionStreamEvent } from './types-C15r7N_4.js';
3
3
 
4
4
  type CreateCompletionInput = string | Message | Message[];
5
5
  type CreateCompletionBaseOptions = {
@@ -1,14 +1,14 @@
1
- import { A as Agent } from '../agent-BBj3jvBi.js';
2
- import { e as JsonValue, M as Message, C as CompletionModel } from '../types-q9G7Bvwl.js';
3
- import { P as PromptResponse } from '../index-Oucb3Ljj.js';
1
+ import { A as Agent } from '../agent-BB9vVH6P.js';
2
+ import { e as JsonValue, M as Message, C as CompletionModel } from '../types-C15r7N_4.js';
3
+ import { P as PromptResponse } from '../index-CM-V4LS3.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-CGML74sE.js';
8
- import '../types-CqG6d7Ce.js';
9
- import '../tool-B8K543oQ.js';
10
- import '../middleware-ByyL6Rj0.js';
11
- import '../types-Pl4PFQWL.js';
7
+ import '../types-Dh7gfoGw.js';
8
+ import '../types-bNDxj4Tt.js';
9
+ import '../tool-f2stpvUP.js';
10
+ import '../middleware-i-jLsLom.js';
11
+ import '../types-DmvXANwl.js';
12
12
  import 'zod';
13
13
 
14
14
  type EvalOutcome<Score = unknown> = {
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  ExtractorBuilder
3
- } from "../chunk-LLA7EW5W.js";
4
- import "../chunk-FBN6IEZA.js";
5
- import "../chunk-3CPOJSKK.js";
6
- import "../chunk-4NCRFQHS.js";
3
+ } from "../chunk-TD6A4RYQ.js";
4
+ import "../chunk-JJ3JGL5D.js";
5
+ import "../chunk-N3I6HH2J.js";
6
+ import "../chunk-5MUPA66B.js";
7
7
  import "../chunk-YK4WAAS4.js";
8
8
  import "../chunk-XUUY2L2D.js";
9
- import "../chunk-YVQBC3SJ.js";
9
+ import "../chunk-YZLOFKTT.js";
10
10
  import "../chunk-QKA6OQTH.js";
11
11
  import "../chunk-NPZDYOE6.js";
12
12
  import {
13
13
  compact
14
14
  } from "../chunk-MMHG7WAM.js";
15
15
  import "../chunk-M6RPFHG7.js";
16
- import "../chunk-SRBW3LD7.js";
17
- import "../chunk-5LFGEMIW.js";
16
+ import "../chunk-FUJ3POKH.js";
17
+ import "../chunk-QVFOCNF6.js";
18
18
  import "../chunk-WQKHFADH.js";
19
19
  import {
20
20
  cosineSimilarity,
@@ -1,14 +1,14 @@
1
- import { A as Agent } from '../agent-BBj3jvBi.js';
1
+ import { A as Agent } from '../agent-BB9vVH6P.js';
2
2
  import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
3
- import { U as Usage, M as Message, C as CompletionModel, e as JsonValue, n as ToolChoice } from '../types-q9G7Bvwl.js';
3
+ import { U as Usage, M as Message, C as CompletionModel, e as JsonValue, n as ToolChoice } from '../types-C15r7N_4.js';
4
4
  import '../guardrails/index.js';
5
- import '../types-CGML74sE.js';
6
- import '../types-CqG6d7Ce.js';
7
- import '../index-Oucb3Ljj.js';
8
- import '../tool-B8K543oQ.js';
9
- import '../middleware-ByyL6Rj0.js';
5
+ import '../types-Dh7gfoGw.js';
6
+ import '../types-bNDxj4Tt.js';
7
+ import '../index-CM-V4LS3.js';
8
+ import '../tool-f2stpvUP.js';
9
+ import '../middleware-i-jLsLom.js';
10
10
  import '../types-DHHZztGO.js';
11
- import '../types-Pl4PFQWL.js';
11
+ import '../types-DmvXANwl.js';
12
12
  import 'zod';
13
13
 
14
14
  type ExtractionResponse<T> = {
@@ -2,19 +2,19 @@ import {
2
2
  ExtractionError,
3
3
  Extractor,
4
4
  ExtractorBuilder
5
- } from "../chunk-LLA7EW5W.js";
6
- import "../chunk-FBN6IEZA.js";
7
- import "../chunk-3CPOJSKK.js";
8
- import "../chunk-4NCRFQHS.js";
5
+ } from "../chunk-TD6A4RYQ.js";
6
+ import "../chunk-JJ3JGL5D.js";
7
+ import "../chunk-N3I6HH2J.js";
8
+ import "../chunk-5MUPA66B.js";
9
9
  import "../chunk-YK4WAAS4.js";
10
10
  import "../chunk-XUUY2L2D.js";
11
- import "../chunk-YVQBC3SJ.js";
11
+ import "../chunk-YZLOFKTT.js";
12
12
  import "../chunk-QKA6OQTH.js";
13
13
  import "../chunk-NPZDYOE6.js";
14
14
  import "../chunk-MMHG7WAM.js";
15
15
  import "../chunk-M6RPFHG7.js";
16
- import "../chunk-SRBW3LD7.js";
17
- import "../chunk-5LFGEMIW.js";
16
+ import "../chunk-FUJ3POKH.js";
17
+ import "../chunk-QVFOCNF6.js";
18
18
  import "../chunk-WQKHFADH.js";
19
19
  import "../chunk-JS5MGVNM.js";
20
20
  import "../chunk-OIMLU4SF.js";
@@ -1,4 +1,4 @@
1
- import { M as Message, J as JsonObject, U as Usage } from '../types-q9G7Bvwl.js';
1
+ import { M as Message, J as JsonObject, U as Usage } from '../types-C15r7N_4.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-CGML74sE.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-CGML74sE.js';
3
- import '../types-q9G7Bvwl.js';
1
+ import { H as HookAction, P as PromptHook, T as ToolApprovalRequestOptions, a as ToolCallHookAction, R as RunControl, b as ToolCallControl } from '../types-Dh7gfoGw.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-Dh7gfoGw.js';
3
+ import '../types-C15r7N_4.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 { e as JsonValue } from '../types-q9G7Bvwl.js';
1
+ import { e as JsonValue } from '../types-C15r7N_4.js';
2
2
 
3
3
  type ImageGenerationRequest = {
4
4
  prompt: string;
@@ -1,6 +1,6 @@
1
- import { x as ReasoningContentType, f as ToolCall, U as Usage, M as Message, k as ToolResultContent, c as CompletionResponse, b as CompletionRequest, J as JsonObject, t as CompletionModelCapabilities, h as ToolDefinition, e as JsonValue } from './types-q9G7Bvwl.js';
1
+ import { x as ReasoningContentType, f as ToolCall, U as Usage, M as Message, k as ToolResultContent, c as CompletionResponse, b as CompletionRequest, J as JsonObject, t as CompletionModelCapabilities, h as ToolDefinition, e as JsonValue } from './types-C15r7N_4.js';
2
2
  import { GuardrailDecisionRecord } from './guardrails/index.js';
3
- import { g as ToolCallStreamEvent } from './tool-B8K543oQ.js';
3
+ import { g as ToolCallStreamEvent } from './tool-f2stpvUP.js';
4
4
 
5
5
  type PromptResponse = {
6
6
  output: string;
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
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 } from './create-completion-Y6YsYbQB.js';
3
- export { A as AssistantContent, a as AssistantMessage, C as CompletionModel, b as CompletionRequest, c as CompletionResponse, D as Document, I as ImageContent, J as JsonObject, d as JsonPrimitive, e as JsonValue, M as Message, S as SystemMessage, T as Text, f as ToolCall, g as ToolContent, h as ToolDefinition, i as ToolMessage, j as ToolResult, k as ToolResultContent, U as Usage, l as UserContent, m as UserMessage } from './types-q9G7Bvwl.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 } from './create-completion-CC8-Ep3w.js';
3
+ export { A as AssistantContent, a as AssistantMessage, C as CompletionModel, b as CompletionRequest, c as CompletionResponse, D as Document, I as ImageContent, J as JsonObject, d as JsonPrimitive, e as JsonValue, M as Message, S as SystemMessage, T as Text, f as ToolCall, g as ToolContent, h as ToolDefinition, i as ToolMessage, j as ToolResult, k as ToolResultContent, U as Usage, l as UserContent, m as UserMessage } from './types-C15r7N_4.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-CqG6d7Ce.js';
6
+ export { M as MemoryStore } from './types-bNDxj4Tt.js';
7
7
  export { MaxTurnsError, PromptCancelledError, ToolApprovalRequiredError } from './request/index.js';
8
- export { A as AgentChildStreamEvent, a as AgentStreamEvent, P as PromptResponse } from './index-Oucb3Ljj.js';
8
+ export { A as AgentChildStreamEvent, a as AgentStreamEvent, P as PromptResponse } from './index-CM-V4LS3.js';
9
9
  export { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
10
10
  export { loadSkills, skill } from './skills/index.js';
11
- export { S as SkillValidationError } from './types-BzUuhjKr.js';
12
- export { C as CreateToolOptions, c as createThinkTool, a as createTool } from './think-tool-B065hm73.js';
13
- 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-B8K543oQ.js';
14
- 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-ByyL6Rj0.js';
11
+ export { S as SkillValidationError } from './types-b6fOVoW1.js';
12
+ export { C as CreateToolOptions, c as createThinkTool, a as createTool } from './think-tool-BKDCOJh5.js';
13
+ 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-f2stpvUP.js';
14
+ 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-i-jLsLom.js';
15
15
  export { CreateUIAttachment, UIAttachment, UIError, UIMessage, UIMessagePart, UIMessageRole, UIStreamEvent, UIStreamRequest, coreMessagesToUIMessages, uiMessagesToCoreMessages } from './ui/index.js';
16
- import './agent-BBj3jvBi.js';
17
- import './types-CGML74sE.js';
18
- import './types-Pl4PFQWL.js';
16
+ import './agent-BB9vVH6P.js';
17
+ import './types-Dh7gfoGw.js';
18
+ import './types-DmvXANwl.js';
19
19
  import './types-DHHZztGO.js';
20
- import './types-7F_IKQQW.js';
20
+ import './types-5JgWDgaM.js';
21
21
  import '@modelcontextprotocol/sdk/client/sse.js';
22
22
  import '@modelcontextprotocol/sdk/client/stdio.js';
23
23
  import '@modelcontextprotocol/sdk/client/streamableHttp.js';
package/dist/index.js CHANGED
@@ -6,23 +6,23 @@ import {
6
6
  import {
7
7
  coreMessagesToUIMessages,
8
8
  uiMessagesToCoreMessages
9
- } from "./chunk-LKLKEECY.js";
9
+ } from "./chunk-PHCPUMAV.js";
10
10
  import {
11
11
  AgentBuilder
12
- } from "./chunk-FBN6IEZA.js";
13
- import "./chunk-3CPOJSKK.js";
12
+ } from "./chunk-JJ3JGL5D.js";
13
+ import "./chunk-N3I6HH2J.js";
14
14
  import {
15
15
  MaxTurnsError,
16
16
  PromptCancelledError,
17
17
  ToolApprovalRequiredError
18
- } from "./chunk-4NCRFQHS.js";
18
+ } from "./chunk-5MUPA66B.js";
19
19
  import "./chunk-YK4WAAS4.js";
20
20
  import "./chunk-XUUY2L2D.js";
21
21
  import {
22
22
  createMiddleware,
23
23
  createThinkTool,
24
24
  createToolMiddleware
25
- } from "./chunk-YVQBC3SJ.js";
25
+ } from "./chunk-YZLOFKTT.js";
26
26
  import {
27
27
  createTool
28
28
  } from "./chunk-QKA6OQTH.js";
@@ -40,14 +40,14 @@ import {
40
40
  createCompletion,
41
41
  createCompletionStream,
42
42
  createParsedCompletion
43
- } from "./chunk-SRBW3LD7.js";
43
+ } from "./chunk-FUJ3POKH.js";
44
44
  import {
45
45
  AssistantContent,
46
46
  Message,
47
47
  ToolContent,
48
48
  Usage,
49
49
  UserContent
50
- } from "./chunk-5LFGEMIW.js";
50
+ } from "./chunk-QVFOCNF6.js";
51
51
  import "./chunk-WQKHFADH.js";
52
52
  import "./chunk-JS5MGVNM.js";
53
53
  import "./chunk-OIMLU4SF.js";
@@ -1,10 +1,10 @@
1
- export { A as Agent, d as AgentEventAppendInput, e as AgentEventRecord, b as AgentEventStore, f as AgentEventStoreInclude, c as AgentEventStoreOptions, i as AgentEventStoreRegistration, j as AgentOptions, g as AgentSession, h as AgentToolOptions, k as DEFAULT_MAX_TURNS, D as DynamicContextOptions, l as DynamicContextRegistration, a as DynamicToolOptions, m as DynamicToolRegistration } from '../agent-BBj3jvBi.js';
2
- import '../types-q9G7Bvwl.js';
1
+ export { A as Agent, d as AgentEventAppendInput, e as AgentEventRecord, b as AgentEventStore, f as AgentEventStoreInclude, c as AgentEventStoreOptions, i as AgentEventStoreRegistration, j as AgentOptions, g as AgentSession, h as AgentToolOptions, k as DEFAULT_MAX_TURNS, D as DynamicContextOptions, l as DynamicContextRegistration, a as DynamicToolOptions, m as DynamicToolRegistration } from '../agent-BB9vVH6P.js';
2
+ import '../types-C15r7N_4.js';
3
3
  import '../guardrails/index.js';
4
- import '../types-CGML74sE.js';
5
- import '../types-CqG6d7Ce.js';
6
- import '../index-Oucb3Ljj.js';
7
- import '../tool-B8K543oQ.js';
8
- import '../middleware-ByyL6Rj0.js';
4
+ import '../types-Dh7gfoGw.js';
5
+ import '../types-bNDxj4Tt.js';
6
+ import '../index-CM-V4LS3.js';
7
+ import '../tool-f2stpvUP.js';
8
+ import '../middleware-i-jLsLom.js';
9
9
  import '../types-DHHZztGO.js';
10
- import '../types-Pl4PFQWL.js';
10
+ import '../types-DmvXANwl.js';
@@ -2,16 +2,16 @@ import {
2
2
  Agent,
3
3
  AgentSession,
4
4
  DEFAULT_MAX_TURNS
5
- } from "../chunk-3CPOJSKK.js";
6
- import "../chunk-4NCRFQHS.js";
5
+ } from "../chunk-N3I6HH2J.js";
6
+ import "../chunk-5MUPA66B.js";
7
7
  import "../chunk-YK4WAAS4.js";
8
8
  import "../chunk-XUUY2L2D.js";
9
- import "../chunk-YVQBC3SJ.js";
9
+ import "../chunk-YZLOFKTT.js";
10
10
  import "../chunk-QKA6OQTH.js";
11
11
  import "../chunk-NPZDYOE6.js";
12
12
  import "../chunk-MMHG7WAM.js";
13
- import "../chunk-SRBW3LD7.js";
14
- import "../chunk-5LFGEMIW.js";
13
+ import "../chunk-FUJ3POKH.js";
14
+ import "../chunk-QVFOCNF6.js";
15
15
  import "../chunk-WQKHFADH.js";
16
16
  import "../chunk-JS5MGVNM.js";
17
17
  import "../chunk-OIMLU4SF.js";
@@ -1,4 +1,4 @@
1
- import { D as Document } from '../types-q9G7Bvwl.js';
1
+ import { D as Document } from '../types-C15r7N_4.js';
2
2
 
3
3
  type LoaderResult<T> = {
4
4
  ok: true;
@@ -1,10 +1,10 @@
1
- import { M as McpConnection, a as McpServer, b as McpStdioOptions, c as McpHttpOptions, d as McpSseOptions } from '../types-7F_IKQQW.js';
2
- export { e as McpClient, f as McpToolCallContent, g as McpToolCallResult, h as McpToolDefinition } from '../types-7F_IKQQW.js';
1
+ import { M as McpConnection, a as McpServer, b as McpStdioOptions, c as McpHttpOptions, d as McpSseOptions } from '../types-5JgWDgaM.js';
2
+ export { e as McpClient, f as McpToolCallContent, g as McpToolCallResult, h as McpToolDefinition } from '../types-5JgWDgaM.js';
3
3
  import '@modelcontextprotocol/sdk/client/sse.js';
4
4
  import '@modelcontextprotocol/sdk/client/stdio.js';
5
5
  import '@modelcontextprotocol/sdk/client/streamableHttp.js';
6
- import '../types-q9G7Bvwl.js';
7
- import '../tool-B8K543oQ.js';
6
+ import '../types-C15r7N_4.js';
7
+ import '../tool-f2stpvUP.js';
8
8
 
9
9
  declare function connectMcp(connection: McpConnection): Promise<McpServer>;
10
10
 
@@ -1,6 +1,6 @@
1
- import { a as MemoryOptions, R as ResolvedMemoryOptions } from '../types-CqG6d7Ce.js';
2
- export { b as MemoryAppendInput, c as MemoryContext, d as MemoryErrorInput, e as MemoryRegistration, f as MemorySavePolicy, M as MemoryStore, S as SessionOptions } from '../types-CqG6d7Ce.js';
3
- import '../types-q9G7Bvwl.js';
1
+ import { a as MemoryOptions, R as ResolvedMemoryOptions } from '../types-bNDxj4Tt.js';
2
+ export { b as MemoryAppendInput, c as MemoryContext, d as MemoryErrorInput, e as MemoryRegistration, f as MemorySavePolicy, M as MemoryStore, S as SessionOptions } from '../types-bNDxj4Tt.js';
3
+ import '../types-C15r7N_4.js';
4
4
 
5
5
  declare function resolveMemoryOptions(options?: MemoryOptions): ResolvedMemoryOptions;
6
6
 
@@ -1,7 +1,7 @@
1
- import { h as ToolDefinition, b as CompletionRequest, c as CompletionResponse, e as JsonValue, k as ToolResultContent } from './types-q9G7Bvwl.js';
1
+ import { h as ToolDefinition, b as CompletionRequest, c as CompletionResponse, e as JsonValue, k as ToolResultContent } from './types-C15r7N_4.js';
2
2
  import { V as VectorMetadata, E as EmbeddingModel, c as EmbeddedDocument } from './types-DHHZztGO.js';
3
- import { A as AnyTool, f as ToolCallContext, N as NormalizedToolOutput } from './tool-B8K543oQ.js';
4
- import { a as VectorSearchIndex } from './types-Pl4PFQWL.js';
3
+ import { A as AnyTool, f as ToolCallContext, N as NormalizedToolOutput } from './tool-f2stpvUP.js';
4
+ import { a as VectorSearchIndex } from './types-DmvXANwl.js';
5
5
 
6
6
  declare class ToolSet {
7
7
  private readonly tools;
@@ -1,4 +1,4 @@
1
- export { f as AgentGenerationEndArgs, g as AgentGenerationErrorArgs, h as AgentGenerationObserver, i as AgentGenerationStartArgs, j as AgentGenerationUpdateArgs, b as AgentObserver, d as AgentObserverRegistration, k as AgentRunEndArgs, l as AgentRunErrorArgs, m as AgentRunEventArgs, n as AgentRunObserver, o as AgentRunPromptRef, p as AgentRunStartArgs, q as AgentToolEndArgs, r as AgentToolErrorArgs, s as AgentToolObserver, t as AgentToolStartArgs, u as AgentToolStreamEventArgs, v as AgentTraceInfo, c as AgentTraceOptions, O as ObserveOptions, w as createObserver } from '../index-Oucb3Ljj.js';
2
- import '../types-q9G7Bvwl.js';
1
+ export { f as AgentGenerationEndArgs, g as AgentGenerationErrorArgs, h as AgentGenerationObserver, i as AgentGenerationStartArgs, j as AgentGenerationUpdateArgs, b as AgentObserver, d as AgentObserverRegistration, k as AgentRunEndArgs, l as AgentRunErrorArgs, m as AgentRunEventArgs, n as AgentRunObserver, o as AgentRunPromptRef, p as AgentRunStartArgs, q as AgentToolEndArgs, r as AgentToolErrorArgs, s as AgentToolObserver, t as AgentToolStartArgs, u as AgentToolStreamEventArgs, v as AgentTraceInfo, c as AgentTraceOptions, O as ObserveOptions, w as createObserver } from '../index-CM-V4LS3.js';
2
+ import '../types-C15r7N_4.js';
3
3
  import '../guardrails/index.js';
4
- import '../tool-B8K543oQ.js';
4
+ import '../tool-f2stpvUP.js';
@@ -1,15 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { A as Agent } from '../agent-BBj3jvBi.js';
3
- import { J as JsonObject, C as CompletionModel } from '../types-q9G7Bvwl.js';
2
+ import { A as Agent } from '../agent-BB9vVH6P.js';
3
+ import { J as JsonObject, C as CompletionModel } from '../types-C15r7N_4.js';
4
4
  import { Extractor } from '../extractor/index.js';
5
5
  import '../guardrails/index.js';
6
- import '../types-CGML74sE.js';
7
- import '../types-CqG6d7Ce.js';
8
- import '../index-Oucb3Ljj.js';
9
- import '../tool-B8K543oQ.js';
10
- import '../middleware-ByyL6Rj0.js';
6
+ import '../types-Dh7gfoGw.js';
7
+ import '../types-bNDxj4Tt.js';
8
+ import '../index-CM-V4LS3.js';
9
+ import '../tool-f2stpvUP.js';
10
+ import '../middleware-i-jLsLom.js';
11
11
  import '../types-DHHZztGO.js';
12
- import '../types-Pl4PFQWL.js';
12
+ import '../types-DmvXANwl.js';
13
13
  import '../zod-schema-C7F4clpm.js';
14
14
 
15
15
  /** Minimal interface for anything that can run as a pipeline stage. */
@@ -1,13 +1,13 @@
1
- import { M as Message } from '../types-q9G7Bvwl.js';
2
- import { d as ToolApprovalRequest } from '../tool-B8K543oQ.js';
3
- export { P as PromptRequest } from '../agent-BBj3jvBi.js';
4
- export { A as AgentChildStreamEvent, e as AgentDeltaEvent, a as AgentStreamEvent, P as PromptResponse } from '../index-Oucb3Ljj.js';
1
+ import { M as Message } from '../types-C15r7N_4.js';
2
+ import { d as ToolApprovalRequest } from '../tool-f2stpvUP.js';
3
+ export { P as PromptRequest } from '../agent-BB9vVH6P.js';
4
+ export { A as AgentChildStreamEvent, e as AgentDeltaEvent, a as AgentStreamEvent, P as PromptResponse } from '../index-CM-V4LS3.js';
5
5
  import '../guardrails/index.js';
6
- import '../types-CGML74sE.js';
7
- import '../types-CqG6d7Ce.js';
8
- import '../middleware-ByyL6Rj0.js';
6
+ import '../types-Dh7gfoGw.js';
7
+ import '../types-bNDxj4Tt.js';
8
+ import '../middleware-i-jLsLom.js';
9
9
  import '../types-DHHZztGO.js';
10
- import '../types-Pl4PFQWL.js';
10
+ import '../types-DmvXANwl.js';
11
11
 
12
12
  declare class MaxTurnsError extends Error {
13
13
  readonly maxTurns: number;
@@ -3,14 +3,14 @@ import {
3
3
  PromptCancelledError,
4
4
  PromptRequest,
5
5
  ToolApprovalRequiredError
6
- } from "../chunk-4NCRFQHS.js";
6
+ } from "../chunk-5MUPA66B.js";
7
7
  import "../chunk-XUUY2L2D.js";
8
- import "../chunk-YVQBC3SJ.js";
8
+ import "../chunk-YZLOFKTT.js";
9
9
  import "../chunk-QKA6OQTH.js";
10
10
  import "../chunk-NPZDYOE6.js";
11
11
  import "../chunk-MMHG7WAM.js";
12
- import "../chunk-SRBW3LD7.js";
13
- import "../chunk-5LFGEMIW.js";
12
+ import "../chunk-FUJ3POKH.js";
13
+ import "../chunk-QVFOCNF6.js";
14
14
  import "../chunk-WQKHFADH.js";
15
15
  import "../chunk-JS5MGVNM.js";
16
16
  import "../chunk-OIMLU4SF.js";
@@ -1,7 +1,7 @@
1
- import { b as SkillLoader, a as SkillSet } from '../types-BzUuhjKr.js';
2
- export { c as Skill, S as SkillValidationError, d as SkillValidationIssue } from '../types-BzUuhjKr.js';
3
- import '../tool-B8K543oQ.js';
4
- import '../types-q9G7Bvwl.js';
1
+ import { b as SkillLoader, a as SkillSet } from '../types-b6fOVoW1.js';
2
+ export { c as Skill, S as SkillValidationError, d as SkillValidationIssue } from '../types-b6fOVoW1.js';
3
+ import '../tool-f2stpvUP.js';
4
+ import '../types-C15r7N_4.js';
5
5
 
6
6
  declare function loadSkills(loaders: SkillLoader | SkillLoader[]): Promise<SkillSet>;
7
7
 
@@ -4,10 +4,10 @@ import {
4
4
  skill
5
5
  } from "../chunk-J3ROUB3P.js";
6
6
  import "../chunk-YK4WAAS4.js";
7
- import "../chunk-YVQBC3SJ.js";
7
+ import "../chunk-YZLOFKTT.js";
8
8
  import "../chunk-QKA6OQTH.js";
9
9
  import "../chunk-MMHG7WAM.js";
10
- import "../chunk-5LFGEMIW.js";
10
+ import "../chunk-QVFOCNF6.js";
11
11
  import "../chunk-WQKHFADH.js";
12
12
  import "../chunk-JS5MGVNM.js";
13
13
  import "../chunk-OIMLU4SF.js";