@yourgpt/llm-sdk 2.1.0 → 2.1.2

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.mjs CHANGED
@@ -964,6 +964,25 @@ var StreamResult = class {
964
964
  case "tool_calls":
965
965
  collected.toolCalls.push(...event.toolCalls);
966
966
  break;
967
+ case "action:start":
968
+ collected.toolCalls.push({
969
+ id: event.id,
970
+ name: event.name,
971
+ args: {},
972
+ hidden: event.hidden
973
+ });
974
+ break;
975
+ case "action:args": {
976
+ const tc = collected.toolCalls.find((t) => t.id === event.id);
977
+ if (tc) {
978
+ try {
979
+ tc.args = JSON.parse(event.args || "{}");
980
+ } catch {
981
+ tc.args = {};
982
+ }
983
+ }
984
+ break;
985
+ }
967
986
  case "done":
968
987
  if (event.messages) {
969
988
  collected.messages.push(...event.messages);
@@ -1975,10 +1994,12 @@ var Runtime = class {
1975
1994
  }
1976
1995
  }
1977
1996
  for (const tc of result.toolCalls) {
1997
+ const tool2 = allTools.find((t) => t.name === tc.name);
1978
1998
  yield {
1979
1999
  type: "action:start",
1980
2000
  id: tc.id,
1981
- name: tc.name
2001
+ name: tc.name,
2002
+ hidden: tool2?.hidden ?? false
1982
2003
  };
1983
2004
  yield {
1984
2005
  type: "action:args",
@@ -3012,7 +3033,8 @@ async function executeToolCalls(toolCalls, tools, executeServerTool, waitForClie
3012
3033
  emitEvent?.({
3013
3034
  type: "action:start",
3014
3035
  id: toolCall.id,
3015
- name: toolCall.name
3036
+ name: toolCall.name,
3037
+ hidden: tool2.hidden ?? false
3016
3038
  });
3017
3039
  emitEvent?.({
3018
3040
  type: "action:args",