@superinterface/react 3.6.3 → 3.7.0

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.js CHANGED
@@ -2728,7 +2728,7 @@ var threadRunRequiresAction = /* @__PURE__ */ function() {
2728
2728
  4,
2729
2729
  map(toolCalls, /* @__PURE__ */ function() {
2730
2730
  var _ref3 = _asyncToGenerator3(function(toolCall) {
2731
- var fn, args, parsedArgs, output, error;
2731
+ var fn, args, parsedArgs, output, _yield$fn, error, serializedOutput;
2732
2732
  return _ts_generator(this, function(_state) {
2733
2733
  switch(_state.label){
2734
2734
  case 0:
@@ -2766,7 +2766,7 @@ var threadRunRequiresAction = /* @__PURE__ */ function() {
2766
2766
  fn(parsedArgs)
2767
2767
  ];
2768
2768
  case 2:
2769
- output = _state.sent();
2769
+ output = (_yield$fn = _state.sent()) !== null && _yield$fn !== void 0 ? _yield$fn : "";
2770
2770
  return [
2771
2771
  3,
2772
2772
  4
@@ -2779,11 +2779,20 @@ var threadRunRequiresAction = /* @__PURE__ */ function() {
2779
2779
  4
2780
2780
  ];
2781
2781
  case 4:
2782
+ try {
2783
+ if (typeof output === "string") {
2784
+ serializedOutput = output;
2785
+ } else {
2786
+ serializedOutput = JSON.stringify(output);
2787
+ }
2788
+ } catch (error) {
2789
+ serializedOutput = "Error: ".concat(error.message);
2790
+ }
2782
2791
  return [
2783
2792
  2,
2784
2793
  {
2785
2794
  toolCallId: toolCall.id,
2786
- output: output
2795
+ output: serializedOutput
2787
2796
  }
2788
2797
  ];
2789
2798
  }