@yourgpt/llm-sdk 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-C_f95PKp.mjs';
2
- export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-C_f95PKp.mjs';
1
+ import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-D20jKwJW.mjs';
2
+ export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-D20jKwJW.mjs';
3
3
  import { z } from 'zod';
4
4
  import * as hono from 'hono';
5
5
  import { Hono } from 'hono';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-C_f95PKp.js';
2
- export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-C_f95PKp.js';
1
+ import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-D20jKwJW.js';
2
+ export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-D20jKwJW.js';
3
3
  import { z } from 'zod';
4
4
  import * as hono from 'hono';
5
5
  import { Hono } from 'hono';
package/dist/index.js CHANGED
@@ -966,6 +966,25 @@ var StreamResult = class {
966
966
  case "tool_calls":
967
967
  collected.toolCalls.push(...event.toolCalls);
968
968
  break;
969
+ case "action:start":
970
+ collected.toolCalls.push({
971
+ id: event.id,
972
+ name: event.name,
973
+ args: {},
974
+ hidden: event.hidden
975
+ });
976
+ break;
977
+ case "action:args": {
978
+ const tc = collected.toolCalls.find((t) => t.id === event.id);
979
+ if (tc) {
980
+ try {
981
+ tc.args = JSON.parse(event.args || "{}");
982
+ } catch {
983
+ tc.args = {};
984
+ }
985
+ }
986
+ break;
987
+ }
969
988
  case "done":
970
989
  if (event.messages) {
971
990
  collected.messages.push(...event.messages);
@@ -1817,6 +1836,7 @@ var Runtime = class {
1817
1836
  ...request,
1818
1837
  messages: messagesWithResults
1819
1838
  };
1839
+ yield { type: "message:end" };
1820
1840
  for await (const event of this.processChatWithLoop(
1821
1841
  nextRequest,
1822
1842
  signal,
@@ -1977,10 +1997,12 @@ var Runtime = class {
1977
1997
  }
1978
1998
  }
1979
1999
  for (const tc of result.toolCalls) {
2000
+ const tool2 = allTools.find((t) => t.name === tc.name);
1980
2001
  yield {
1981
2002
  type: "action:start",
1982
2003
  id: tc.id,
1983
- name: tc.name
2004
+ name: tc.name,
2005
+ hidden: tool2?.hidden ?? false
1984
2006
  };
1985
2007
  yield {
1986
2008
  type: "action:args",
@@ -3014,7 +3036,8 @@ async function executeToolCalls(toolCalls, tools, executeServerTool, waitForClie
3014
3036
  emitEvent?.({
3015
3037
  type: "action:start",
3016
3038
  id: toolCall.id,
3017
- name: toolCall.name
3039
+ name: toolCall.name,
3040
+ hidden: tool2.hidden ?? false
3018
3041
  });
3019
3042
  emitEvent?.({
3020
3043
  type: "action:args",