@superinterface/react 3.6.2 → 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
  }
@@ -4694,6 +4703,12 @@ var evaluate = /* @__PURE__ */ function() {
4694
4703
  return _ref2.apply(this, arguments);
4695
4704
  };
4696
4705
  }();
4706
+ var replaceExpressionsWithLiterals = function(_ref3) {
4707
+ var content = _ref3.content;
4708
+ return content.replace(/\{([^}]+)\}/g, function(_match, expression) {
4709
+ return "{'{'}".concat(expression, "{'}'}");
4710
+ });
4711
+ };
4697
4712
  var TextContent = function(t0) {
4698
4713
  var $ = _c23(13);
4699
4714
  var content = t0.content;
@@ -4718,7 +4733,7 @@ var TextContent = function(t0) {
4718
4733
  if ($[3] !== content || $[4] !== remarkPlugins) {
4719
4734
  t3 = function() {
4720
4735
  var compileMDX = /* @__PURE__ */ function() {
4721
- var _ref3 = _asyncToGenerator5(function() {
4736
+ var _ref4 = _asyncToGenerator5(function() {
4722
4737
  var compiled, code, module, MDXContent, t52, error;
4723
4738
  return _ts_generator(this, function(_state) {
4724
4739
  switch(_state.label){
@@ -4731,7 +4746,9 @@ var TextContent = function(t0) {
4731
4746
  ]);
4732
4747
  return [
4733
4748
  4,
4734
- compile(content.text.value, {
4749
+ compile(replaceExpressionsWithLiterals({
4750
+ content: content.text.value
4751
+ }), {
4735
4752
  outputFormat: "function-body",
4736
4753
  remarkPlugins: remarkPlugins,
4737
4754
  recmaPlugins: [
@@ -4774,7 +4791,7 @@ var TextContent = function(t0) {
4774
4791
  });
4775
4792
  });
4776
4793
  return function compileMDX2() {
4777
- return _ref3.apply(this, arguments);
4794
+ return _ref4.apply(this, arguments);
4778
4795
  };
4779
4796
  }();
4780
4797
  compileMDX();