supercompat 4.0.0 → 4.0.1

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.
@@ -80396,7 +80396,9 @@ import { assign as assign5 } from "radash";
80396
80396
  // src/lib/sse/enqueueSSE.ts
80397
80397
  var encoder11 = new TextEncoder();
80398
80398
  var enqueueSSE = function(controller, event, data) {
80399
- controller.enqueue(encoder11.encode("event: ".concat(event, "\ndata: ").concat(JSON.stringify(data), "\n\n")));
80399
+ try {
80400
+ controller.enqueue(encoder11.encode("event: ".concat(event, "\ndata: ").concat(JSON.stringify(data), "\n\n")));
80401
+ } catch (unused) {}
80400
80402
  };
80401
80403
  // src/handlers/assistants/prismaStorageAdapter/threads/runs/onEvent/handlers/threadRunInProgress.ts
80402
80404
  var threadRunInProgress = function(param) {
@@ -89063,50 +89065,51 @@ import { assign as assign12 } from "radash";
89063
89065
  var serializeTools5 = function(param) {
89064
89066
  var tools = param.tools, useOpenaiComputerTool = param.useOpenaiComputerTool, toolResources = param.toolResources;
89065
89067
  if (!(tools === null || tools === void 0 ? void 0 : tools.length)) return {};
89066
- return {
89067
- tools: tools.map(function(tool) {
89068
- var toolType = tool.type;
89069
- if (toolType === "computer" || toolType === "computer_use_preview") {
89070
- var _serialized_computer_use_preview;
89071
- var serialized = serializeComputerUseTool({
89072
- useOpenaiComputerTool: useOpenaiComputerTool,
89073
- tool: tool
89074
- });
89075
- if (serialized.type === "computer") {
89076
- return {
89077
- type: "computer"
89078
- };
89079
- }
89080
- var config = (_serialized_computer_use_preview = serialized.computer_use_preview) !== null && _serialized_computer_use_preview !== void 0 ? _serialized_computer_use_preview : {};
89081
- return _object_spread({
89082
- type: "computer_use_preview"
89083
- }, config);
89084
- }
89085
- if (toolType === "code_interpreter") {
89086
- var _ref;
89087
- var _tool_code_interpreter;
89068
+ var mapped = tools.map(function(tool) {
89069
+ var toolType = tool.type;
89070
+ if (toolType === "computer" || toolType === "computer_use_preview") {
89071
+ var _serialized_computer_use_preview;
89072
+ var serialized = serializeComputerUseTool({
89073
+ useOpenaiComputerTool: useOpenaiComputerTool,
89074
+ tool: tool
89075
+ });
89076
+ if (serialized.type === "computer") {
89088
89077
  return {
89089
- type: "code_interpreter",
89090
- container: (_ref = (_tool_code_interpreter = tool.code_interpreter) === null || _tool_code_interpreter === void 0 ? void 0 : _tool_code_interpreter.container) !== null && _ref !== void 0 ? _ref : {
89091
- type: "auto"
89092
- }
89078
+ type: "computer"
89093
89079
  };
89094
89080
  }
89095
- if (toolType === "file_search") {
89096
- var _ref1;
89097
- var _toolResources_file_search;
89098
- var vectorStoreIds = (_ref1 = toolResources === null || toolResources === void 0 ? void 0 : (_toolResources_file_search = toolResources.file_search) === null || _toolResources_file_search === void 0 ? void 0 : _toolResources_file_search.vector_store_ids) !== null && _ref1 !== void 0 ? _ref1 : [];
89099
- return _object_spread({
89100
- type: "file_search"
89101
- }, vectorStoreIds.length > 0 ? {
89102
- vector_store_ids: vectorStoreIds
89103
- } : {});
89104
- }
89081
+ var config = (_serialized_computer_use_preview = serialized.computer_use_preview) !== null && _serialized_computer_use_preview !== void 0 ? _serialized_computer_use_preview : {};
89105
89082
  return _object_spread({
89106
- type: tool.type
89107
- }, tool[tool.type] || {});
89108
- })
89109
- };
89083
+ type: "computer_use_preview"
89084
+ }, config);
89085
+ }
89086
+ if (toolType === "code_interpreter") {
89087
+ var _ref;
89088
+ var _tool_code_interpreter;
89089
+ return {
89090
+ type: "code_interpreter",
89091
+ container: (_ref = (_tool_code_interpreter = tool.code_interpreter) === null || _tool_code_interpreter === void 0 ? void 0 : _tool_code_interpreter.container) !== null && _ref !== void 0 ? _ref : {
89092
+ type: "auto"
89093
+ }
89094
+ };
89095
+ }
89096
+ if (toolType === "file_search") {
89097
+ var _ref1;
89098
+ var _toolResources_file_search;
89099
+ var vectorStoreIds = (_ref1 = toolResources === null || toolResources === void 0 ? void 0 : (_toolResources_file_search = toolResources.file_search) === null || _toolResources_file_search === void 0 ? void 0 : _toolResources_file_search.vector_store_ids) !== null && _ref1 !== void 0 ? _ref1 : [];
89100
+ if (vectorStoreIds.length === 0) return null;
89101
+ return {
89102
+ type: "file_search",
89103
+ vector_store_ids: vectorStoreIds
89104
+ };
89105
+ }
89106
+ return _object_spread({
89107
+ type: tool.type
89108
+ }, tool[tool.type] || {});
89109
+ }).filter(Boolean);
89110
+ return mapped.length > 0 ? {
89111
+ tools: mapped
89112
+ } : {};
89110
89113
  };
89111
89114
  var truncation = function(param) {
89112
89115
  var truncation_strategy = param.truncation_strategy;