supercompat 3.12.1 → 3.13.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
@@ -93,6 +93,13 @@ function _define_property(obj, key, value) {
93
93
  }
94
94
  return obj;
95
95
  }
96
+ function _instanceof(left, right) {
97
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
98
+ return !!right[Symbol.hasInstance](left);
99
+ } else {
100
+ return left instanceof right;
101
+ }
102
+ }
96
103
  function _iterable_to_array(iter) {
97
104
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
98
105
  }
@@ -10078,6 +10085,300 @@ var assistants3 = function(param) {
10078
10085
  })
10079
10086
  };
10080
10087
  };
10088
+ // src/lib/files/fileRegexp.ts
10089
+ var fileRegexp = "^/(?:v1|/?openai)/files/([^/]+)$";
10090
+ // src/lib/files/fileContentRegexp.ts
10091
+ var fileContentRegexp = "^/(?:v1|/?openai)/files/([^/]+)/content$";
10092
+ // src/lib/files/transformAzureFile.ts
10093
+ var import_dayjs28 = __toESM(require("dayjs"), 1);
10094
+ var toUnixSeconds = function(value) {
10095
+ if (!value) return void 0;
10096
+ if (_instanceof(value, Date)) {
10097
+ return (0, import_dayjs28.default)(value).unix();
10098
+ }
10099
+ if (typeof value === "number") {
10100
+ if (value > 9999999999) {
10101
+ return (0, import_dayjs28.default)(value).unix();
10102
+ }
10103
+ return Math.floor(value);
10104
+ }
10105
+ var parsed = (0, import_dayjs28.default)(value);
10106
+ return parsed.isValid() ? parsed.unix() : void 0;
10107
+ };
10108
+ var transformAzureFile = function(file2) {
10109
+ var _toUnixSeconds;
10110
+ var createdAtUnix = (_toUnixSeconds = toUnixSeconds(file2.createdAt)) !== null && _toUnixSeconds !== void 0 ? _toUnixSeconds : (0, import_dayjs28.default)().unix();
10111
+ var expiresAtUnix = toUnixSeconds(file2.expiresAt);
10112
+ var _file2_bytes;
10113
+ var openaiFile = {
10114
+ id: file2.id,
10115
+ object: file2.object || "file",
10116
+ bytes: (_file2_bytes = file2.bytes) !== null && _file2_bytes !== void 0 ? _file2_bytes : 0,
10117
+ created_at: createdAtUnix,
10118
+ filename: file2.filename || "file",
10119
+ purpose: file2.purpose || "assistants",
10120
+ status: file2.status || "processed"
10121
+ };
10122
+ if (expiresAtUnix !== void 0) {
10123
+ openaiFile.expires_at = expiresAtUnix;
10124
+ }
10125
+ if (file2.statusDetails) {
10126
+ openaiFile.status_details = file2.statusDetails;
10127
+ }
10128
+ return openaiFile;
10129
+ };
10130
+ // src/adapters/storage/azureAgentsStorageAdapter/files/get.ts
10131
+ var file = function(param) {
10132
+ var azureAiProject = param.azureAiProject;
10133
+ return {
10134
+ get: function(url) {
10135
+ return _async_to_generator(function() {
10136
+ var pathname, match, _match, fileId, azureFile, openaiFile;
10137
+ return _ts_generator(this, function(_state) {
10138
+ switch(_state.label){
10139
+ case 0:
10140
+ pathname = new URL(url).pathname;
10141
+ match = pathname.match(new RegExp(fileRegexp));
10142
+ if (!match) {
10143
+ return [
10144
+ 2,
10145
+ new Response("Not Found", {
10146
+ status: 404
10147
+ })
10148
+ ];
10149
+ }
10150
+ _match = _sliced_to_array(match, 2), fileId = _match[1];
10151
+ return [
10152
+ 4,
10153
+ azureAiProject.agents.files.get(fileId)
10154
+ ];
10155
+ case 1:
10156
+ azureFile = _state.sent();
10157
+ openaiFile = transformAzureFile(azureFile);
10158
+ return [
10159
+ 2,
10160
+ new Response(JSON.stringify(openaiFile), {
10161
+ status: 200,
10162
+ headers: {
10163
+ "Content-Type": "application/json"
10164
+ }
10165
+ })
10166
+ ];
10167
+ }
10168
+ });
10169
+ })();
10170
+ }
10171
+ };
10172
+ };
10173
+ // src/adapters/storage/azureAgentsStorageAdapter/files/content.ts
10174
+ var import_node_stream = require("stream");
10175
+ var headersToRecord = function(headers) {
10176
+ if (!headers) return {};
10177
+ if (typeof headers.get === "function") {
10178
+ var result = {};
10179
+ for(var _i = 0, _iter = [
10180
+ "content-type",
10181
+ "content-length"
10182
+ ]; _i < _iter.length; _i++){
10183
+ var headerName = _iter[_i];
10184
+ var value = headers.get(headerName);
10185
+ if (value) {
10186
+ result[headerName] = value;
10187
+ }
10188
+ }
10189
+ return result;
10190
+ }
10191
+ var json = typeof headers.toJSON === "function" ? headers.toJSON() : headers;
10192
+ return (typeof json === "undefined" ? "undefined" : _type_of(json)) === "object" && json !== null ? json : {};
10193
+ };
10194
+ var toBody = function(nodeStream) {
10195
+ return _async_to_generator(function() {
10196
+ var chunks, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
10197
+ return _ts_generator(this, function(_state) {
10198
+ switch(_state.label){
10199
+ case 0:
10200
+ if (typeof import_node_stream.Readable.toWeb === "function") {
10201
+ return [
10202
+ 2,
10203
+ import_node_stream.Readable.toWeb(nodeStream)
10204
+ ];
10205
+ }
10206
+ chunks = [];
10207
+ _iteratorAbruptCompletion = false, _didIteratorError = false;
10208
+ _state.label = 1;
10209
+ case 1:
10210
+ _state.trys.push([
10211
+ 1,
10212
+ 6,
10213
+ 7,
10214
+ 12
10215
+ ]);
10216
+ _iterator = _async_iterator(nodeStream);
10217
+ _state.label = 2;
10218
+ case 2:
10219
+ return [
10220
+ 4,
10221
+ _iterator.next()
10222
+ ];
10223
+ case 3:
10224
+ if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
10225
+ 3,
10226
+ 5
10227
+ ];
10228
+ _value = _step.value;
10229
+ chunk = _value;
10230
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
10231
+ _state.label = 4;
10232
+ case 4:
10233
+ _iteratorAbruptCompletion = false;
10234
+ return [
10235
+ 3,
10236
+ 2
10237
+ ];
10238
+ case 5:
10239
+ return [
10240
+ 3,
10241
+ 12
10242
+ ];
10243
+ case 6:
10244
+ err = _state.sent();
10245
+ _didIteratorError = true;
10246
+ _iteratorError = err;
10247
+ return [
10248
+ 3,
10249
+ 12
10250
+ ];
10251
+ case 7:
10252
+ _state.trys.push([
10253
+ 7,
10254
+ ,
10255
+ 10,
10256
+ 11
10257
+ ]);
10258
+ if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
10259
+ 3,
10260
+ 9
10261
+ ];
10262
+ return [
10263
+ 4,
10264
+ _iterator.return()
10265
+ ];
10266
+ case 8:
10267
+ _state.sent();
10268
+ _state.label = 9;
10269
+ case 9:
10270
+ return [
10271
+ 3,
10272
+ 11
10273
+ ];
10274
+ case 10:
10275
+ if (_didIteratorError) {
10276
+ throw _iteratorError;
10277
+ }
10278
+ return [
10279
+ 7
10280
+ ];
10281
+ case 11:
10282
+ return [
10283
+ 7
10284
+ ];
10285
+ case 12:
10286
+ return [
10287
+ 2,
10288
+ Buffer.concat(chunks)
10289
+ ];
10290
+ }
10291
+ });
10292
+ })();
10293
+ };
10294
+ var fileContent = function(param) {
10295
+ var azureAiProject = param.azureAiProject;
10296
+ return {
10297
+ get: function(url) {
10298
+ return _async_to_generator(function() {
10299
+ var pathname, match, _match, fileId, streamable, nodeResponse, nodeStream, headerRecord, headers, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, key, value, body, _nodeResponse_status;
10300
+ return _ts_generator(this, function(_state) {
10301
+ switch(_state.label){
10302
+ case 0:
10303
+ pathname = new URL(url).pathname;
10304
+ match = pathname.match(new RegExp(fileContentRegexp));
10305
+ if (!match) {
10306
+ return [
10307
+ 2,
10308
+ new Response("Not Found", {
10309
+ status: 404
10310
+ })
10311
+ ];
10312
+ }
10313
+ _match = _sliced_to_array(match, 2), fileId = _match[1];
10314
+ streamable = azureAiProject.agents.files.getContent(fileId);
10315
+ if (!streamable || typeof streamable.asNodeStream !== "function") {
10316
+ return [
10317
+ 2,
10318
+ new Response("File content unavailable", {
10319
+ status: 500
10320
+ })
10321
+ ];
10322
+ }
10323
+ return [
10324
+ 4,
10325
+ streamable.asNodeStream()
10326
+ ];
10327
+ case 1:
10328
+ nodeResponse = _state.sent();
10329
+ nodeStream = nodeResponse.body;
10330
+ if (!nodeStream) {
10331
+ return [
10332
+ 2,
10333
+ new Response("", {
10334
+ status: 204
10335
+ })
10336
+ ];
10337
+ }
10338
+ headerRecord = headersToRecord(nodeResponse.headers);
10339
+ headers = new Headers();
10340
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
10341
+ try {
10342
+ for(_iterator = Object.entries(headerRecord)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
10343
+ _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1];
10344
+ headers.set(key, value);
10345
+ }
10346
+ } catch (err) {
10347
+ _didIteratorError = true;
10348
+ _iteratorError = err;
10349
+ } finally{
10350
+ try {
10351
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
10352
+ _iterator.return();
10353
+ }
10354
+ } finally{
10355
+ if (_didIteratorError) {
10356
+ throw _iteratorError;
10357
+ }
10358
+ }
10359
+ }
10360
+ if (!headers.has("content-type")) {
10361
+ headers.set("Content-Type", "application/octet-stream");
10362
+ }
10363
+ return [
10364
+ 4,
10365
+ toBody(nodeStream)
10366
+ ];
10367
+ case 2:
10368
+ body = _state.sent();
10369
+ return [
10370
+ 2,
10371
+ new Response(body, {
10372
+ status: (_nodeResponse_status = nodeResponse.status) !== null && _nodeResponse_status !== void 0 ? _nodeResponse_status : 200,
10373
+ headers: headers
10374
+ })
10375
+ ];
10376
+ }
10377
+ });
10378
+ })();
10379
+ }
10380
+ };
10381
+ };
10081
10382
  // src/adapters/storage/azureAgentsStorageAdapter/index.ts
10082
10383
  var azureAgentsStorageAdapter = function(param) {
10083
10384
  var azureAiProject = param.azureAiProject;
@@ -10107,12 +10408,16 @@ var azureAgentsStorageAdapter = function(param) {
10107
10408
  })), _define_property(_obj, submitToolOutputsRegexp, submitToolOutputs3({
10108
10409
  azureAiProject: azureAiProject,
10109
10410
  runAdapter: runAdapter
10411
+ })), _define_property(_obj, fileRegexp, file({
10412
+ azureAiProject: azureAiProject
10413
+ })), _define_property(_obj, fileContentRegexp, fileContent({
10414
+ azureAiProject: azureAiProject
10110
10415
  })), _obj)
10111
10416
  };
10112
10417
  };
10113
10418
  };
10114
10419
  // src/adapters/run/responsesRunAdapter/index.ts
10115
- var import_dayjs28 = __toESM(require("dayjs"), 1);
10420
+ var import_dayjs29 = __toESM(require("dayjs"), 1);
10116
10421
  var import_radash24 = require("radash");
10117
10422
  var serializeToolCalls2 = function(param) {
10118
10423
  var toolCalls = param.toolCalls;
@@ -10460,7 +10765,7 @@ var responsesRunAdapter = function(param) {
10460
10765
  4,
10461
10766
  onEvent2.apply(void 0, [
10462
10767
  (_tmp6.data = serializeItemAsMessage.apply(void 0, [
10463
- (_tmp7.openaiAssistant = _state.sent(), _tmp7.createdAt = (0, import_dayjs28.default)().unix(), _tmp7.runId = responseCreatedResponse.id, _tmp7.status = "in_progress", _tmp7)
10768
+ (_tmp7.openaiAssistant = _state.sent(), _tmp7.createdAt = (0, import_dayjs29.default)().unix(), _tmp7.runId = responseCreatedResponse.id, _tmp7.status = "in_progress", _tmp7)
10464
10769
  ]), _tmp6)
10465
10770
  ])
10466
10771
  ];
@@ -10557,7 +10862,7 @@ var responsesRunAdapter = function(param) {
10557
10862
  4,
10558
10863
  onEvent2.apply(void 0, [
10559
10864
  (_tmp12.data = serializeItemAsMessage.apply(void 0, [
10560
- (_tmp13.openaiAssistant = _state.sent(), _tmp13.createdAt = (0, import_dayjs28.default)().unix(), _tmp13.runId = responseCreatedResponse.id, _tmp13.status = "in_progress", _tmp13)
10865
+ (_tmp13.openaiAssistant = _state.sent(), _tmp13.createdAt = (0, import_dayjs29.default)().unix(), _tmp13.runId = responseCreatedResponse.id, _tmp13.status = "in_progress", _tmp13)
10561
10866
  ]), _tmp12)
10562
10867
  ])
10563
10868
  ];
@@ -10644,7 +10949,7 @@ var responsesRunAdapter = function(param) {
10644
10949
  4,
10645
10950
  onEvent2.apply(void 0, [
10646
10951
  (_tmp18.data = serializeItemAsMessage.apply(void 0, [
10647
- (_tmp19.openaiAssistant = _state.sent(), _tmp19.createdAt = (0, import_dayjs28.default)().unix(), _tmp19.runId = responseCreatedResponse.id, _tmp19.status = "in_progress", _tmp19)
10952
+ (_tmp19.openaiAssistant = _state.sent(), _tmp19.createdAt = (0, import_dayjs29.default)().unix(), _tmp19.runId = responseCreatedResponse.id, _tmp19.status = "in_progress", _tmp19)
10648
10953
  ]), _tmp18)
10649
10954
  ])
10650
10955
  ];
@@ -10730,7 +11035,7 @@ var responsesRunAdapter = function(param) {
10730
11035
  4,
10731
11036
  onEvent2.apply(void 0, [
10732
11037
  (_tmp24.data = serializeItemAsMessage.apply(void 0, [
10733
- (_tmp25.openaiAssistant = _state.sent(), _tmp25.createdAt = (0, import_dayjs28.default)().unix(), _tmp25.runId = responseCreatedResponse.id, _tmp25.status = "in_progress", _tmp25)
11038
+ (_tmp25.openaiAssistant = _state.sent(), _tmp25.createdAt = (0, import_dayjs29.default)().unix(), _tmp25.runId = responseCreatedResponse.id, _tmp25.status = "in_progress", _tmp25)
10734
11039
  ]), _tmp24)
10735
11040
  ])
10736
11041
  ];
@@ -10816,7 +11121,7 @@ var responsesRunAdapter = function(param) {
10816
11121
  4,
10817
11122
  onEvent2.apply(void 0, [
10818
11123
  (_tmp30.data = serializeItemAsMessage.apply(void 0, [
10819
- (_tmp31.openaiAssistant = _state.sent(), _tmp31.createdAt = (0, import_dayjs28.default)().unix(), _tmp31.runId = responseCreatedResponse.id, _tmp31.status = "in_progress", _tmp31)
11124
+ (_tmp31.openaiAssistant = _state.sent(), _tmp31.createdAt = (0, import_dayjs29.default)().unix(), _tmp31.runId = responseCreatedResponse.id, _tmp31.status = "in_progress", _tmp31)
10820
11125
  ]), _tmp30)
10821
11126
  ])
10822
11127
  ];
@@ -10902,7 +11207,7 @@ var responsesRunAdapter = function(param) {
10902
11207
  4,
10903
11208
  onEvent2.apply(void 0, [
10904
11209
  (_tmp36.data = serializeItemAsMessage.apply(void 0, [
10905
- (_tmp37.openaiAssistant = _state.sent(), _tmp37.createdAt = (0, import_dayjs28.default)().unix(), _tmp37.runId = responseCreatedResponse.id, _tmp37.status = "in_progress", _tmp37)
11210
+ (_tmp37.openaiAssistant = _state.sent(), _tmp37.createdAt = (0, import_dayjs29.default)().unix(), _tmp37.runId = responseCreatedResponse.id, _tmp37.status = "in_progress", _tmp37)
10906
11211
  ]), _tmp36)
10907
11212
  ])
10908
11213
  ];
@@ -10989,7 +11294,7 @@ var responsesRunAdapter = function(param) {
10989
11294
  4,
10990
11295
  onEvent2.apply(void 0, [
10991
11296
  (_tmp42.data = serializeItemAsMessage.apply(void 0, [
10992
- (_tmp43.openaiAssistant = _state.sent(), _tmp43.createdAt = (0, import_dayjs28.default)().unix(), _tmp43.runId = responseCreatedResponse.id, _tmp43.status = "in_progress", _tmp43)
11297
+ (_tmp43.openaiAssistant = _state.sent(), _tmp43.createdAt = (0, import_dayjs29.default)().unix(), _tmp43.runId = responseCreatedResponse.id, _tmp43.status = "in_progress", _tmp43)
10993
11298
  ]), _tmp42)
10994
11299
  ])
10995
11300
  ];
@@ -11076,7 +11381,7 @@ var responsesRunAdapter = function(param) {
11076
11381
  4,
11077
11382
  onEvent2.apply(void 0, [
11078
11383
  (_tmp48.data = serializeItemAsMessage.apply(void 0, [
11079
- (_tmp49.openaiAssistant = _state.sent(), _tmp49.createdAt = (0, import_dayjs28.default)().unix(), _tmp49.runId = responseCreatedResponse.id, _tmp49.status = "in_progress", _tmp49)
11384
+ (_tmp49.openaiAssistant = _state.sent(), _tmp49.createdAt = (0, import_dayjs29.default)().unix(), _tmp49.runId = responseCreatedResponse.id, _tmp49.status = "in_progress", _tmp49)
11080
11385
  ]), _tmp48)
11081
11386
  ])
11082
11387
  ];
@@ -11191,7 +11496,7 @@ var responsesRunAdapter = function(param) {
11191
11496
  4,
11192
11497
  onEvent2.apply(void 0, [
11193
11498
  (_tmp56.data = serializeItemAsMessage.apply(void 0, [
11194
- (_tmp57.openaiAssistant = _state.sent(), _tmp57.createdAt = (0, import_dayjs28.default)().unix(), _tmp57.runId = responseCreatedResponse.id, _tmp57)
11499
+ (_tmp57.openaiAssistant = _state.sent(), _tmp57.createdAt = (0, import_dayjs29.default)().unix(), _tmp57.runId = responseCreatedResponse.id, _tmp57)
11195
11500
  ]), _tmp56)
11196
11501
  ])
11197
11502
  ];
@@ -11313,7 +11618,7 @@ var responsesRunAdapter = function(param) {
11313
11618
  4,
11314
11619
  onEvent2.apply(void 0, [
11315
11620
  (_tmp64.data = serializeItemAsMessage.apply(void 0, [
11316
- (_tmp65.openaiAssistant = _state.sent(), _tmp65.createdAt = (0, import_dayjs28.default)().unix(), _tmp65.runId = responseCreatedResponse.id, _tmp65)
11621
+ (_tmp65.openaiAssistant = _state.sent(), _tmp65.createdAt = (0, import_dayjs29.default)().unix(), _tmp65.runId = responseCreatedResponse.id, _tmp65)
11317
11622
  ]), _tmp64)
11318
11623
  ])
11319
11624
  ];
@@ -11399,7 +11704,7 @@ var responsesRunAdapter = function(param) {
11399
11704
  4,
11400
11705
  onEvent2.apply(void 0, [
11401
11706
  (_tmp70.data = serializeItemAsMessage.apply(void 0, [
11402
- (_tmp71.openaiAssistant = _state.sent(), _tmp71.createdAt = (0, import_dayjs28.default)().unix(), _tmp71.runId = responseCreatedResponse.id, _tmp71)
11707
+ (_tmp71.openaiAssistant = _state.sent(), _tmp71.createdAt = (0, import_dayjs29.default)().unix(), _tmp71.runId = responseCreatedResponse.id, _tmp71)
11403
11708
  ]), _tmp70)
11404
11709
  ])
11405
11710
  ];
@@ -11485,7 +11790,7 @@ var responsesRunAdapter = function(param) {
11485
11790
  4,
11486
11791
  onEvent2.apply(void 0, [
11487
11792
  (_tmp76.data = serializeItemAsMessage.apply(void 0, [
11488
- (_tmp77.openaiAssistant = _state.sent(), _tmp77.createdAt = (0, import_dayjs28.default)().unix(), _tmp77.runId = responseCreatedResponse.id, _tmp77)
11793
+ (_tmp77.openaiAssistant = _state.sent(), _tmp77.createdAt = (0, import_dayjs29.default)().unix(), _tmp77.runId = responseCreatedResponse.id, _tmp77)
11489
11794
  ]), _tmp76)
11490
11795
  ])
11491
11796
  ];
@@ -11571,7 +11876,7 @@ var responsesRunAdapter = function(param) {
11571
11876
  4,
11572
11877
  onEvent2.apply(void 0, [
11573
11878
  (_tmp82.data = serializeItemAsMessage.apply(void 0, [
11574
- (_tmp83.openaiAssistant = _state.sent(), _tmp83.createdAt = (0, import_dayjs28.default)().unix(), _tmp83.runId = responseCreatedResponse.id, _tmp83)
11879
+ (_tmp83.openaiAssistant = _state.sent(), _tmp83.createdAt = (0, import_dayjs29.default)().unix(), _tmp83.runId = responseCreatedResponse.id, _tmp83)
11575
11880
  ]), _tmp82)
11576
11881
  ])
11577
11882
  ];
@@ -11657,7 +11962,7 @@ var responsesRunAdapter = function(param) {
11657
11962
  4,
11658
11963
  onEvent2.apply(void 0, [
11659
11964
  (_tmp88.data = serializeItemAsMessage.apply(void 0, [
11660
- (_tmp89.openaiAssistant = _state.sent(), _tmp89.createdAt = (0, import_dayjs28.default)().unix(), _tmp89.runId = responseCreatedResponse.id, _tmp89)
11965
+ (_tmp89.openaiAssistant = _state.sent(), _tmp89.createdAt = (0, import_dayjs29.default)().unix(), _tmp89.runId = responseCreatedResponse.id, _tmp89)
11661
11966
  ]), _tmp88)
11662
11967
  ])
11663
11968
  ];
@@ -11743,7 +12048,7 @@ var responsesRunAdapter = function(param) {
11743
12048
  4,
11744
12049
  onEvent2.apply(void 0, [
11745
12050
  (_tmp94.data = serializeItemAsMessage.apply(void 0, [
11746
- (_tmp95.openaiAssistant = _state.sent(), _tmp95.createdAt = (0, import_dayjs28.default)().unix(), _tmp95.runId = responseCreatedResponse.id, _tmp95)
12051
+ (_tmp95.openaiAssistant = _state.sent(), _tmp95.createdAt = (0, import_dayjs29.default)().unix(), _tmp95.runId = responseCreatedResponse.id, _tmp95)
11747
12052
  ]), _tmp94)
11748
12053
  ])
11749
12054
  ];
@@ -11840,7 +12145,7 @@ var responsesRunAdapter = function(param) {
11840
12145
  _tmp97 = {
11841
12146
  id: event.item_id,
11842
12147
  object: "thread.message",
11843
- created_at: (0, import_dayjs28.default)().unix(),
12148
+ created_at: (0, import_dayjs29.default)().unix(),
11844
12149
  thread_id: threadId,
11845
12150
  completed_at: null,
11846
12151
  incomplete_at: null,
@@ -11878,7 +12183,7 @@ var responsesRunAdapter = function(param) {
11878
12183
  _tmp99 = {
11879
12184
  id: event.item_id,
11880
12185
  object: "thread.message",
11881
- created_at: (0, import_dayjs28.default)().unix(),
12186
+ created_at: (0, import_dayjs29.default)().unix(),
11882
12187
  thread_id: threadId,
11883
12188
  completed_at: null,
11884
12189
  incomplete_at: null,
@@ -12066,7 +12371,7 @@ var responsesRunAdapter = function(param) {
12066
12371
  return [
12067
12372
  4,
12068
12373
  onEvent2.apply(void 0, [
12069
- (_tmp101.data = (_tmp102.assistant_id = _state.sent().id, _tmp102.status = "failed", _tmp102.failed_at = (0, import_dayjs28.default)().unix(), _tmp102.last_error = {
12374
+ (_tmp101.data = (_tmp102.assistant_id = _state.sent().id, _tmp102.status = "failed", _tmp102.failed_at = (0, import_dayjs29.default)().unix(), _tmp102.last_error = {
12070
12375
  code: "server_error",
12071
12376
  message: String((e === null || e === void 0 ? void 0 : e.message) || e || "Unknown error")
12072
12377
  }, _tmp102), _tmp101)
@@ -12126,7 +12431,7 @@ var responsesRunAdapter = function(param) {
12126
12431
  };
12127
12432
  };
12128
12433
  // src/adapters/run/azureAgentsRunAdapter/index.ts
12129
- var import_dayjs29 = __toESM(require("dayjs"), 1);
12434
+ var import_dayjs30 = __toESM(require("dayjs"), 1);
12130
12435
  var import_radash25 = require("radash");
12131
12436
  function transformAnnotations(annotations) {
12132
12437
  return annotations.map(function(ann) {
@@ -12220,7 +12525,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12220
12525
  data: {
12221
12526
  id: data.id,
12222
12527
  object: "thread.run",
12223
- created_at: (0, import_dayjs29.default)(data.createdAt).unix(),
12528
+ created_at: (0, import_dayjs30.default)(data.createdAt).unix(),
12224
12529
  thread_id: data.threadId,
12225
12530
  assistant_id: assistantId,
12226
12531
  status: data.status,
@@ -12244,10 +12549,10 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12244
12549
  message: JSON.stringify(data.lastError)
12245
12550
  } : null,
12246
12551
  expires_at: null,
12247
- started_at: data.startedAt ? (0, import_dayjs29.default)(data.startedAt).unix() : null,
12248
- cancelled_at: data.cancelledAt ? (0, import_dayjs29.default)(data.cancelledAt).unix() : null,
12249
- failed_at: data.failedAt ? (0, import_dayjs29.default)(data.failedAt).unix() : null,
12250
- completed_at: data.completedAt ? (0, import_dayjs29.default)(data.completedAt).unix() : null,
12552
+ started_at: data.startedAt ? (0, import_dayjs30.default)(data.startedAt).unix() : null,
12553
+ cancelled_at: data.cancelledAt ? (0, import_dayjs30.default)(data.cancelledAt).unix() : null,
12554
+ failed_at: data.failedAt ? (0, import_dayjs30.default)(data.failedAt).unix() : null,
12555
+ completed_at: data.completedAt ? (0, import_dayjs30.default)(data.completedAt).unix() : null,
12251
12556
  incomplete_details: null,
12252
12557
  model: data.model || "",
12253
12558
  instructions: data.instructions || "",
@@ -12275,7 +12580,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12275
12580
  data: {
12276
12581
  id: data.id,
12277
12582
  object: "thread.message",
12278
- created_at: (0, import_dayjs29.default)(data.createdAt).unix(),
12583
+ created_at: (0, import_dayjs30.default)(data.createdAt).unix(),
12279
12584
  thread_id: data.threadId,
12280
12585
  role: data.role,
12281
12586
  content: ((_data_content = data.content) === null || _data_content === void 0 ? void 0 : _data_content.map(function(c) {
@@ -12286,7 +12591,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12286
12591
  attachments: data.attachments || [],
12287
12592
  metadata: data.metadata || {},
12288
12593
  status: data.status || "completed",
12289
- completed_at: data.completedAt ? (0, import_dayjs29.default)(data.completedAt).unix() : null,
12594
+ completed_at: data.completedAt ? (0, import_dayjs30.default)(data.completedAt).unix() : null,
12290
12595
  incomplete_at: null,
12291
12596
  incomplete_details: null
12292
12597
  }
@@ -12475,7 +12780,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12475
12780
  data: {
12476
12781
  id: data.id,
12477
12782
  object: "thread.run.step",
12478
- created_at: (0, import_dayjs29.default)(data.createdAt).unix(),
12783
+ created_at: (0, import_dayjs30.default)(data.createdAt).unix(),
12479
12784
  assistant_id: assistantId,
12480
12785
  thread_id: data.threadId,
12481
12786
  run_id: data.runId,
@@ -12484,9 +12789,9 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12484
12789
  step_details: stepDetails,
12485
12790
  last_error: data.lastError || null,
12486
12791
  expired_at: null,
12487
- cancelled_at: data.cancelledAt ? (0, import_dayjs29.default)(data.cancelledAt).unix() : null,
12488
- failed_at: data.failedAt ? (0, import_dayjs29.default)(data.failedAt).unix() : null,
12489
- completed_at: data.completedAt ? (0, import_dayjs29.default)(data.completedAt).unix() : null,
12792
+ cancelled_at: data.cancelledAt ? (0, import_dayjs30.default)(data.cancelledAt).unix() : null,
12793
+ failed_at: data.failedAt ? (0, import_dayjs30.default)(data.failedAt).unix() : null,
12794
+ completed_at: data.completedAt ? (0, import_dayjs30.default)(data.completedAt).unix() : null,
12490
12795
  metadata: data.metadata || {},
12491
12796
  usage: null
12492
12797
  }
@@ -12498,7 +12803,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12498
12803
  data: {
12499
12804
  id: data.id,
12500
12805
  object: "thread",
12501
- created_at: (0, import_dayjs29.default)(data.createdAt).unix(),
12806
+ created_at: (0, import_dayjs30.default)(data.createdAt).unix(),
12502
12807
  metadata: data.metadata || {},
12503
12808
  tool_resources: data.toolResources || null
12504
12809
  }
@@ -12639,7 +12944,7 @@ var azureAgentsRunAdapter = function(param) {
12639
12944
  data: {
12640
12945
  id: errorRunId,
12641
12946
  object: "thread.run",
12642
- created_at: (0, import_dayjs29.default)().unix(),
12947
+ created_at: (0, import_dayjs30.default)().unix(),
12643
12948
  thread_id: threadId,
12644
12949
  assistant_id: assistantId,
12645
12950
  status: "failed",
@@ -12649,9 +12954,9 @@ var azureAgentsRunAdapter = function(param) {
12649
12954
  message: String((e === null || e === void 0 ? void 0 : e.message) || e || "Unknown error")
12650
12955
  },
12651
12956
  expires_at: null,
12652
- started_at: (0, import_dayjs29.default)().unix(),
12957
+ started_at: (0, import_dayjs30.default)().unix(),
12653
12958
  cancelled_at: null,
12654
- failed_at: (0, import_dayjs29.default)().unix(),
12959
+ failed_at: (0, import_dayjs30.default)().unix(),
12655
12960
  completed_at: null,
12656
12961
  incomplete_details: null,
12657
12962
  model: "",