@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.cjs CHANGED
@@ -2882,7 +2882,7 @@ var threadRunRequiresAction = /* @__PURE__ */ function() {
2882
2882
  4,
2883
2883
  (0, import_radash8.map)(toolCalls, /* @__PURE__ */ function() {
2884
2884
  var _ref3 = _asyncToGenerator3(function(toolCall) {
2885
- var fn, args, parsedArgs, output, error;
2885
+ var fn, args, parsedArgs, output, _yield$fn, error, serializedOutput;
2886
2886
  return _ts_generator(this, function(_state) {
2887
2887
  switch(_state.label){
2888
2888
  case 0:
@@ -2920,7 +2920,7 @@ var threadRunRequiresAction = /* @__PURE__ */ function() {
2920
2920
  fn(parsedArgs)
2921
2921
  ];
2922
2922
  case 2:
2923
- output = _state.sent();
2923
+ output = (_yield$fn = _state.sent()) !== null && _yield$fn !== void 0 ? _yield$fn : "";
2924
2924
  return [
2925
2925
  3,
2926
2926
  4
@@ -2933,11 +2933,20 @@ var threadRunRequiresAction = /* @__PURE__ */ function() {
2933
2933
  4
2934
2934
  ];
2935
2935
  case 4:
2936
+ try {
2937
+ if (typeof output === "string") {
2938
+ serializedOutput = output;
2939
+ } else {
2940
+ serializedOutput = JSON.stringify(output);
2941
+ }
2942
+ } catch (error) {
2943
+ serializedOutput = "Error: ".concat(error.message);
2944
+ }
2936
2945
  return [
2937
2946
  2,
2938
2947
  {
2939
2948
  toolCallId: toolCall.id,
2940
- output: output
2949
+ output: serializedOutput
2941
2950
  }
2942
2951
  ];
2943
2952
  }
@@ -4847,6 +4856,12 @@ var evaluate = /* @__PURE__ */ function() {
4847
4856
  return _ref2.apply(this, arguments);
4848
4857
  };
4849
4858
  }();
4859
+ var replaceExpressionsWithLiterals = function(_ref3) {
4860
+ var content = _ref3.content;
4861
+ return content.replace(/\{([^}]+)\}/g, function(_match, expression) {
4862
+ return "{'{'}".concat(expression, "{'}'}");
4863
+ });
4864
+ };
4850
4865
  var TextContent = function(t0) {
4851
4866
  var $ = (0, import_react_compiler_runtime23.c)(13);
4852
4867
  var content = t0.content;
@@ -4871,7 +4886,7 @@ var TextContent = function(t0) {
4871
4886
  if ($[3] !== content || $[4] !== remarkPlugins) {
4872
4887
  t3 = function() {
4873
4888
  var compileMDX = /* @__PURE__ */ function() {
4874
- var _ref3 = _asyncToGenerator5(function() {
4889
+ var _ref4 = _asyncToGenerator5(function() {
4875
4890
  var compiled, code, module2, MDXContent, t52, error;
4876
4891
  return _ts_generator(this, function(_state) {
4877
4892
  switch(_state.label){
@@ -4884,7 +4899,9 @@ var TextContent = function(t0) {
4884
4899
  ]);
4885
4900
  return [
4886
4901
  4,
4887
- (0, import_mdx.compile)(content.text.value, {
4902
+ (0, import_mdx.compile)(replaceExpressionsWithLiterals({
4903
+ content: content.text.value
4904
+ }), {
4888
4905
  outputFormat: "function-body",
4889
4906
  remarkPlugins: remarkPlugins,
4890
4907
  recmaPlugins: [
@@ -4927,7 +4944,7 @@ var TextContent = function(t0) {
4927
4944
  });
4928
4945
  });
4929
4946
  return function compileMDX2() {
4930
- return _ref3.apply(this, arguments);
4947
+ return _ref4.apply(this, arguments);
4931
4948
  };
4932
4949
  }();
4933
4950
  compileMDX();