supercompat 3.6.0 → 3.6.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.
package/dist/index.cjs CHANGED
@@ -7131,6 +7131,64 @@ var serializeItemAsComputerCallRunStep = function(param) {
7131
7131
  }
7132
7132
  });
7133
7133
  };
7134
+ // src/lib/items/serializeItemAsReasoningRunStep.ts
7135
+ var import_dayjs20 = __toESM(require("dayjs"), 1);
7136
+ var serializeStatus7 = function(param) {
7137
+ var item = param.item, completedAt = param.completedAt;
7138
+ if (!item.status) {
7139
+ if (completedAt) {
7140
+ return "completed";
7141
+ } else {
7142
+ return "in_progress";
7143
+ }
7144
+ }
7145
+ if (item.status === "incomplete") {
7146
+ return "in_progress";
7147
+ }
7148
+ return item.status;
7149
+ };
7150
+ var serializeItemAsReasoningRunStep = function(param) {
7151
+ var item = param.item, openaiAssistant = param.openaiAssistant, threadId = param.threadId, runId = param.runId, _param_completedAt = param.completedAt, completedAt = _param_completedAt === void 0 ? (0, import_dayjs20.default)().unix() : _param_completedAt;
7152
+ var toolCall = {
7153
+ id: "ftc".concat(item.id),
7154
+ type: "function",
7155
+ function: {
7156
+ name: "reasoning",
7157
+ arguments: "{}",
7158
+ output: JSON.stringify({
7159
+ summary: item.summary,
7160
+ content: item.content,
7161
+ encrypted_content: item.encrypted_content
7162
+ })
7163
+ }
7164
+ };
7165
+ return {
7166
+ id: "fc".concat(item.id),
7167
+ object: "thread.run.step",
7168
+ created_at: (0, import_dayjs20.default)().unix(),
7169
+ assistant_id: openaiAssistant.id,
7170
+ thread_id: threadId,
7171
+ run_id: runId,
7172
+ status: serializeStatus7({
7173
+ item: item,
7174
+ completedAt: completedAt
7175
+ }),
7176
+ last_error: null,
7177
+ expired_at: null,
7178
+ cancelled_at: null,
7179
+ failed_at: null,
7180
+ completed_at: completedAt,
7181
+ metadata: {},
7182
+ usage: null,
7183
+ type: "tool_calls",
7184
+ step_details: {
7185
+ type: "tool_calls",
7186
+ tool_calls: [
7187
+ toolCall
7188
+ ]
7189
+ }
7190
+ };
7191
+ };
7134
7192
  // src/adapters/storage/responsesStorageAdapter/threads/runs/steps/get.ts
7135
7193
  var get17 = function(param) {
7136
7194
  var client = param.client, runAdapter = param.runAdapter;
@@ -7214,6 +7272,16 @@ var get17 = function(param) {
7214
7272
  }),
7215
7273
  step
7216
7274
  ];
7275
+ } else if (item.type === "reasoning") {
7276
+ return [
7277
+ serializeItemAsReasoningRunStep({
7278
+ item: item,
7279
+ openaiAssistant: openaiAssistant,
7280
+ threadId: threadId,
7281
+ runId: response.id
7282
+ }),
7283
+ step
7284
+ ];
7217
7285
  } else if (item.type === "image_generation_call") {
7218
7286
  return [
7219
7287
  serializeItemAsImageGenerationRunStep({
@@ -7630,7 +7698,7 @@ var responsesStorageAdapter = function() {
7630
7698
  };
7631
7699
  };
7632
7700
  // src/adapters/run/responsesRunAdapter/index.ts
7633
- var import_dayjs20 = __toESM(require("dayjs"), 1);
7701
+ var import_dayjs21 = __toESM(require("dayjs"), 1);
7634
7702
  var import_radash22 = require("radash");
7635
7703
  var serializeToolCalls2 = function(param) {
7636
7704
  var toolCalls = param.toolCalls;
@@ -7716,7 +7784,7 @@ var responsesRunAdapter = function(param) {
7716
7784
  }();
7717
7785
  var handleRun = /*#__PURE__*/ function() {
7718
7786
  var _ref = _async_to_generator(function(param) {
7719
- var client, threadId, response, onEvent2, responseCreatedResponse, toolCalls, mcpCalls, codeInterpreterCalls, itemIds, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, event, _, _tmp, _tmp1, _tmp2, _tmp3, toolCalls2, _tmp4, _tmp5, _tmp6, _tmp7, _tmp8, _tmp9, _tmp10, _tmp11, _tmp12, _tmp13, _tmp14, _tmp15, _tmp16, _tmp17, _tmp18, _tmp19, _tmp20, _tmp21, _tmp22, _tmp23, _tmp24, _tmp25, _tmp26, _tmp27, _tmp28, _tmp29, _tmp30, _tmp31, _tmp32, _tmp33, _tmp34, _tmp35, _tmp36, _tmp37, _tmp38, _tmp39, _tmp40, _tmp41, _tmp42, _tmp43, _tmp44, _tmp45, _tmp46, _tmp47, _tmp48, _tmp49, _tmp50, _tmp51, _tmp52, _tmp53, _tmp54, _tmp55, _tmp56, _tmp57, _tmp58, _tmp59, _tmp60, _tmp61, _tmp62, _tmp63, _tmp64, _tmp65, _tmp66, _tmp67, _tmp68, _tmp69, _tmp70, _tmp71, _tmp72, _tmp73, _tmp74, _tmp75, _tmp76, _tmp77, _tmp78, _tmp79, _tmp80, _tmp81, _tmp82, _tmp83, _tmp84, _tmp85, _tmp86, _tmp87, _tmp88, toolCall, mcpCall, _tmp89, _tmp90, _tmp91, _tmp92, err, e, _tmp93, _tmp94;
7787
+ var client, threadId, response, onEvent2, responseCreatedResponse, toolCalls, mcpCalls, codeInterpreterCalls, itemIds, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, event, _, _tmp, _tmp1, _tmp2, _tmp3, toolCalls2, _tmp4, _tmp5, _tmp6, _tmp7, _tmp8, _tmp9, _tmp10, _tmp11, _tmp12, _tmp13, _tmp14, _tmp15, _tmp16, _tmp17, _tmp18, _tmp19, _tmp20, _tmp21, _tmp22, _tmp23, _tmp24, _tmp25, _tmp26, _tmp27, _tmp28, _tmp29, _tmp30, _tmp31, _tmp32, _tmp33, _tmp34, _tmp35, _tmp36, _tmp37, _tmp38, _tmp39, _tmp40, _tmp41, _tmp42, _tmp43, _tmp44, _tmp45, _tmp46, _tmp47, _tmp48, _tmp49, _tmp50, _tmp51, _tmp52, _tmp53, _tmp54, _tmp55, _tmp56, _tmp57, _tmp58, _tmp59, _tmp60, _tmp61, _tmp62, _tmp63, _tmp64, _tmp65, _tmp66, _tmp67, _tmp68, _tmp69, _tmp70, _tmp71, _tmp72, _tmp73, _tmp74, _tmp75, _tmp76, _tmp77, _tmp78, _tmp79, _tmp80, _tmp81, _tmp82, _tmp83, _tmp84, _tmp85, _tmp86, _tmp87, _tmp88, _tmp89, _tmp90, _tmp91, _tmp92, _tmp93, _tmp94, _tmp95, _tmp96, _tmp97, _tmp98, _tmp99, _tmp100, toolCall, mcpCall, _tmp101, _tmp102, _tmp103, _tmp104, err, e, _tmp105, _tmp106;
7720
7788
  return _ts_generator(this, function(_state) {
7721
7789
  switch(_state.label){
7722
7790
  case 0:
@@ -7730,18 +7798,18 @@ var responsesRunAdapter = function(param) {
7730
7798
  case 1:
7731
7799
  _state.trys.push([
7732
7800
  1,
7733
- 138,
7734
- 141,
7735
- 142
7801
+ 152,
7802
+ 155,
7803
+ 156
7736
7804
  ]);
7737
7805
  _iteratorAbruptCompletion = false, _didIteratorError = false;
7738
7806
  _state.label = 2;
7739
7807
  case 2:
7740
7808
  _state.trys.push([
7741
7809
  2,
7742
- 131,
7743
- 132,
7744
- 137
7810
+ 145,
7811
+ 146,
7812
+ 151
7745
7813
  ]);
7746
7814
  _iterator = _async_iterator(response);
7747
7815
  _state.label = 3;
@@ -7753,7 +7821,7 @@ var responsesRunAdapter = function(param) {
7753
7821
  case 4:
7754
7822
  if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
7755
7823
  3,
7756
- 130
7824
+ 144
7757
7825
  ];
7758
7826
  _value = _step.value;
7759
7827
  event = _value;
@@ -7792,37 +7860,37 @@ var responsesRunAdapter = function(param) {
7792
7860
  case "response.output_item.done":
7793
7861
  return [
7794
7862
  3,
7795
- 74
7863
+ 81
7796
7864
  ];
7797
7865
  case "response.function_call_arguments.delta":
7798
7866
  return [
7799
7867
  3,
7800
- 118
7868
+ 132
7801
7869
  ];
7802
7870
  case "response.mcp_call_arguments.delta":
7803
7871
  return [
7804
7872
  3,
7805
- 120
7873
+ 134
7806
7874
  ];
7807
7875
  case "response.image_generation_call.in_progress":
7808
7876
  return [
7809
7877
  3,
7810
- 122
7878
+ 136
7811
7879
  ];
7812
7880
  case "response.image_generation_call.generating":
7813
7881
  return [
7814
7882
  3,
7815
- 122
7883
+ 136
7816
7884
  ];
7817
7885
  case "response.image_generation_call.partial_image":
7818
7886
  return [
7819
7887
  3,
7820
- 125
7888
+ 139
7821
7889
  ];
7822
7890
  }
7823
7891
  return [
7824
7892
  3,
7825
- 128
7893
+ 142
7826
7894
  ];
7827
7895
  case 5:
7828
7896
  responseCreatedResponse = event.response;
@@ -7853,7 +7921,7 @@ var responsesRunAdapter = function(param) {
7853
7921
  _state.sent();
7854
7922
  return [
7855
7923
  3,
7856
- 129
7924
+ 143
7857
7925
  ];
7858
7926
  case 8:
7859
7927
  _tmp2 = {
@@ -7883,7 +7951,7 @@ var responsesRunAdapter = function(param) {
7883
7951
  _state.sent();
7884
7952
  return [
7885
7953
  3,
7886
- 129
7954
+ 143
7887
7955
  ];
7888
7956
  case 11:
7889
7957
  itemIds = event.response.output.filter(function(o) {
@@ -7973,7 +8041,7 @@ var responsesRunAdapter = function(param) {
7973
8041
  case 17:
7974
8042
  return [
7975
8043
  3,
7976
- 129
8044
+ 143
7977
8045
  ];
7978
8046
  case 18:
7979
8047
  _tmp9 = {
@@ -8003,7 +8071,7 @@ var responsesRunAdapter = function(param) {
8003
8071
  _state.sent();
8004
8072
  return [
8005
8073
  3,
8006
- 129
8074
+ 143
8007
8075
  ];
8008
8076
  case 21:
8009
8077
  return [
@@ -8030,7 +8098,7 @@ var responsesRunAdapter = function(param) {
8030
8098
  _state.sent();
8031
8099
  return [
8032
8100
  3,
8033
- 129
8101
+ 143
8034
8102
  ];
8035
8103
  case 23:
8036
8104
  if (!(event.item.type === "message")) return [
@@ -8057,7 +8125,7 @@ var responsesRunAdapter = function(param) {
8057
8125
  4,
8058
8126
  onEvent2.apply(void 0, [
8059
8127
  (_tmp11.data = serializeItemAsMessage.apply(void 0, [
8060
- (_tmp12.openaiAssistant = _state.sent(), _tmp12.createdAt = (0, import_dayjs20.default)().unix(), _tmp12.runId = responseCreatedResponse.id, _tmp12.status = "in_progress", _tmp12)
8128
+ (_tmp12.openaiAssistant = _state.sent(), _tmp12.createdAt = (0, import_dayjs21.default)().unix(), _tmp12.runId = responseCreatedResponse.id, _tmp12.status = "in_progress", _tmp12)
8061
8129
  ]), _tmp11)
8062
8130
  ])
8063
8131
  ];
@@ -8091,7 +8159,7 @@ var responsesRunAdapter = function(param) {
8091
8159
  _state.sent();
8092
8160
  return [
8093
8161
  3,
8094
- 73
8162
+ 80
8095
8163
  ];
8096
8164
  case 28:
8097
8165
  if (!(event.item.type === "function_call")) return [
@@ -8127,7 +8195,7 @@ var responsesRunAdapter = function(param) {
8127
8195
  _state.sent();
8128
8196
  return [
8129
8197
  3,
8130
- 73
8198
+ 80
8131
8199
  ];
8132
8200
  case 31:
8133
8201
  if (!(event.item.type === "computer_call")) return [
@@ -8154,7 +8222,7 @@ var responsesRunAdapter = function(param) {
8154
8222
  4,
8155
8223
  onEvent2.apply(void 0, [
8156
8224
  (_tmp17.data = serializeItemAsMessage.apply(void 0, [
8157
- (_tmp18.openaiAssistant = _state.sent(), _tmp18.createdAt = (0, import_dayjs20.default)().unix(), _tmp18.runId = responseCreatedResponse.id, _tmp18.status = "in_progress", _tmp18)
8225
+ (_tmp18.openaiAssistant = _state.sent(), _tmp18.createdAt = (0, import_dayjs21.default)().unix(), _tmp18.runId = responseCreatedResponse.id, _tmp18.status = "in_progress", _tmp18)
8158
8226
  ]), _tmp17)
8159
8227
  ])
8160
8228
  ];
@@ -8214,7 +8282,7 @@ var responsesRunAdapter = function(param) {
8214
8282
  _state.sent();
8215
8283
  return [
8216
8284
  3,
8217
- 73
8285
+ 80
8218
8286
  ];
8219
8287
  case 38:
8220
8288
  if (!(event.item.type === "image_generation_call")) return [
@@ -8241,7 +8309,7 @@ var responsesRunAdapter = function(param) {
8241
8309
  4,
8242
8310
  onEvent2.apply(void 0, [
8243
8311
  (_tmp23.data = serializeItemAsMessage.apply(void 0, [
8244
- (_tmp24.openaiAssistant = _state.sent(), _tmp24.createdAt = (0, import_dayjs20.default)().unix(), _tmp24.runId = responseCreatedResponse.id, _tmp24.status = "in_progress", _tmp24)
8312
+ (_tmp24.openaiAssistant = _state.sent(), _tmp24.createdAt = (0, import_dayjs21.default)().unix(), _tmp24.runId = responseCreatedResponse.id, _tmp24.status = "in_progress", _tmp24)
8245
8313
  ]), _tmp23)
8246
8314
  ])
8247
8315
  ];
@@ -8300,10 +8368,10 @@ var responsesRunAdapter = function(param) {
8300
8368
  _state.sent();
8301
8369
  return [
8302
8370
  3,
8303
- 73
8371
+ 80
8304
8372
  ];
8305
8373
  case 45:
8306
- if (!(event.item.type === "web_search_call")) return [
8374
+ if (!(event.item.type === "reasoning")) return [
8307
8375
  3,
8308
8376
  52
8309
8377
  ];
@@ -8327,7 +8395,7 @@ var responsesRunAdapter = function(param) {
8327
8395
  4,
8328
8396
  onEvent2.apply(void 0, [
8329
8397
  (_tmp29.data = serializeItemAsMessage.apply(void 0, [
8330
- (_tmp30.openaiAssistant = _state.sent(), _tmp30.createdAt = (0, import_dayjs20.default)().unix(), _tmp30.runId = responseCreatedResponse.id, _tmp30.status = "in_progress", _tmp30)
8398
+ (_tmp30.openaiAssistant = _state.sent(), _tmp30.createdAt = (0, import_dayjs21.default)().unix(), _tmp30.runId = responseCreatedResponse.id, _tmp30.status = "in_progress", _tmp30)
8331
8399
  ]), _tmp29)
8332
8400
  ])
8333
8401
  ];
@@ -8377,7 +8445,7 @@ var responsesRunAdapter = function(param) {
8377
8445
  return [
8378
8446
  4,
8379
8447
  onEvent2.apply(void 0, [
8380
- (_tmp33.data = serializeItemAsWebSearchRunStep.apply(void 0, [
8448
+ (_tmp33.data = serializeItemAsReasoningRunStep.apply(void 0, [
8381
8449
  (_tmp34.openaiAssistant = _state.sent(), _tmp34.threadId = threadId, _tmp34.runId = responseCreatedResponse.id, _tmp34.completedAt = null, _tmp34)
8382
8450
  ]), _tmp33)
8383
8451
  ])
@@ -8386,10 +8454,10 @@ var responsesRunAdapter = function(param) {
8386
8454
  _state.sent();
8387
8455
  return [
8388
8456
  3,
8389
- 73
8457
+ 80
8390
8458
  ];
8391
8459
  case 52:
8392
- if (!(event.item.type === "mcp_list_tools")) return [
8460
+ if (!(event.item.type === "web_search_call")) return [
8393
8461
  3,
8394
8462
  59
8395
8463
  ];
@@ -8413,7 +8481,7 @@ var responsesRunAdapter = function(param) {
8413
8481
  4,
8414
8482
  onEvent2.apply(void 0, [
8415
8483
  (_tmp35.data = serializeItemAsMessage.apply(void 0, [
8416
- (_tmp36.openaiAssistant = _state.sent(), _tmp36.createdAt = (0, import_dayjs20.default)().unix(), _tmp36.runId = responseCreatedResponse.id, _tmp36.status = "in_progress", _tmp36)
8484
+ (_tmp36.openaiAssistant = _state.sent(), _tmp36.createdAt = (0, import_dayjs21.default)().unix(), _tmp36.runId = responseCreatedResponse.id, _tmp36.status = "in_progress", _tmp36)
8417
8485
  ]), _tmp35)
8418
8486
  ])
8419
8487
  ];
@@ -8463,7 +8531,7 @@ var responsesRunAdapter = function(param) {
8463
8531
  return [
8464
8532
  4,
8465
8533
  onEvent2.apply(void 0, [
8466
- (_tmp39.data = serializeItemAsMcpListToolsRunStep.apply(void 0, [
8534
+ (_tmp39.data = serializeItemAsWebSearchRunStep.apply(void 0, [
8467
8535
  (_tmp40.openaiAssistant = _state.sent(), _tmp40.threadId = threadId, _tmp40.runId = responseCreatedResponse.id, _tmp40.completedAt = null, _tmp40)
8468
8536
  ]), _tmp39)
8469
8537
  ])
@@ -8472,14 +8540,13 @@ var responsesRunAdapter = function(param) {
8472
8540
  _state.sent();
8473
8541
  return [
8474
8542
  3,
8475
- 73
8543
+ 80
8476
8544
  ];
8477
8545
  case 59:
8478
- if (!(event.item.type === "mcp_call")) return [
8546
+ if (!(event.item.type === "mcp_list_tools")) return [
8479
8547
  3,
8480
8548
  66
8481
8549
  ];
8482
- mcpCalls[event.item.id] = event.item;
8483
8550
  _tmp41 = {
8484
8551
  event: "thread.message.created"
8485
8552
  };
@@ -8500,7 +8567,7 @@ var responsesRunAdapter = function(param) {
8500
8567
  4,
8501
8568
  onEvent2.apply(void 0, [
8502
8569
  (_tmp41.data = serializeItemAsMessage.apply(void 0, [
8503
- (_tmp42.openaiAssistant = _state.sent(), _tmp42.createdAt = (0, import_dayjs20.default)().unix(), _tmp42.runId = responseCreatedResponse.id, _tmp42.status = "in_progress", _tmp42)
8570
+ (_tmp42.openaiAssistant = _state.sent(), _tmp42.createdAt = (0, import_dayjs21.default)().unix(), _tmp42.runId = responseCreatedResponse.id, _tmp42.status = "in_progress", _tmp42)
8504
8571
  ]), _tmp41)
8505
8572
  ])
8506
8573
  ];
@@ -8550,7 +8617,7 @@ var responsesRunAdapter = function(param) {
8550
8617
  return [
8551
8618
  4,
8552
8619
  onEvent2.apply(void 0, [
8553
- (_tmp45.data = serializeItemAsMcpCallRunStep.apply(void 0, [
8620
+ (_tmp45.data = serializeItemAsMcpListToolsRunStep.apply(void 0, [
8554
8621
  (_tmp46.openaiAssistant = _state.sent(), _tmp46.threadId = threadId, _tmp46.runId = responseCreatedResponse.id, _tmp46.completedAt = null, _tmp46)
8555
8622
  ]), _tmp45)
8556
8623
  ])
@@ -8559,14 +8626,14 @@ var responsesRunAdapter = function(param) {
8559
8626
  _state.sent();
8560
8627
  return [
8561
8628
  3,
8562
- 73
8629
+ 80
8563
8630
  ];
8564
8631
  case 66:
8565
- if (!(event.item.type === "code_interpreter_call")) return [
8632
+ if (!(event.item.type === "mcp_call")) return [
8566
8633
  3,
8567
8634
  73
8568
8635
  ];
8569
- codeInterpreterCalls[event.item.id] = event.item;
8636
+ mcpCalls[event.item.id] = event.item;
8570
8637
  _tmp47 = {
8571
8638
  event: "thread.message.created"
8572
8639
  };
@@ -8587,7 +8654,7 @@ var responsesRunAdapter = function(param) {
8587
8654
  4,
8588
8655
  onEvent2.apply(void 0, [
8589
8656
  (_tmp47.data = serializeItemAsMessage.apply(void 0, [
8590
- (_tmp48.openaiAssistant = _state.sent(), _tmp48.createdAt = (0, import_dayjs20.default)().unix(), _tmp48.runId = responseCreatedResponse.id, _tmp48.status = "in_progress", _tmp48)
8657
+ (_tmp48.openaiAssistant = _state.sent(), _tmp48.createdAt = (0, import_dayjs21.default)().unix(), _tmp48.runId = responseCreatedResponse.id, _tmp48.status = "in_progress", _tmp48)
8591
8658
  ]), _tmp47)
8592
8659
  ])
8593
8660
  ];
@@ -8637,27 +8704,25 @@ var responsesRunAdapter = function(param) {
8637
8704
  return [
8638
8705
  4,
8639
8706
  onEvent2.apply(void 0, [
8640
- (_tmp51.data = serializeItemAsCodeInterpreterCallRunStep.apply(void 0, [
8707
+ (_tmp51.data = serializeItemAsMcpCallRunStep.apply(void 0, [
8641
8708
  (_tmp52.openaiAssistant = _state.sent(), _tmp52.threadId = threadId, _tmp52.runId = responseCreatedResponse.id, _tmp52.completedAt = null, _tmp52)
8642
8709
  ]), _tmp51)
8643
8710
  ])
8644
8711
  ];
8645
8712
  case 72:
8646
8713
  _state.sent();
8647
- _state.label = 73;
8648
- case 73:
8649
- if (event.item.id) itemIds.push(event.item.id);
8650
8714
  return [
8651
8715
  3,
8652
- 129
8716
+ 80
8653
8717
  ];
8654
- case 74:
8655
- if (!(event.item.type === "message")) return [
8718
+ case 73:
8719
+ if (!(event.item.type === "code_interpreter_call")) return [
8656
8720
  3,
8657
- 79
8721
+ 80
8658
8722
  ];
8723
+ codeInterpreterCalls[event.item.id] = event.item;
8659
8724
  _tmp53 = {
8660
- event: "thread.run.step.completed"
8725
+ event: "thread.message.created"
8661
8726
  };
8662
8727
  _tmp54 = {
8663
8728
  item: event.item,
@@ -8671,19 +8736,19 @@ var responsesRunAdapter = function(param) {
8671
8736
  }
8672
8737
  })
8673
8738
  ];
8674
- case 75:
8739
+ case 74:
8675
8740
  return [
8676
8741
  4,
8677
8742
  onEvent2.apply(void 0, [
8678
- (_tmp53.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
8679
- (_tmp54.openaiAssistant = _state.sent(), _tmp54.runId = responseCreatedResponse.id, _tmp54)
8743
+ (_tmp53.data = serializeItemAsMessage.apply(void 0, [
8744
+ (_tmp54.openaiAssistant = _state.sent(), _tmp54.createdAt = (0, import_dayjs21.default)().unix(), _tmp54.runId = responseCreatedResponse.id, _tmp54.status = "in_progress", _tmp54)
8680
8745
  ]), _tmp53)
8681
8746
  ])
8682
8747
  ];
8683
- case 76:
8748
+ case 75:
8684
8749
  _state.sent();
8685
8750
  _tmp55 = {
8686
- event: "thread.message.completed"
8751
+ event: "thread.run.step.created"
8687
8752
  };
8688
8753
  _tmp56 = {
8689
8754
  item: event.item,
@@ -8697,33 +8762,22 @@ var responsesRunAdapter = function(param) {
8697
8762
  }
8698
8763
  })
8699
8764
  ];
8700
- case 77:
8765
+ case 76:
8701
8766
  return [
8702
8767
  4,
8703
8768
  onEvent2.apply(void 0, [
8704
- (_tmp55.data = serializeItemAsMessage.apply(void 0, [
8705
- (_tmp56.openaiAssistant = _state.sent(), _tmp56.createdAt = (0, import_dayjs20.default)().unix(), _tmp56.runId = responseCreatedResponse.id, _tmp56)
8769
+ (_tmp55.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
8770
+ (_tmp56.openaiAssistant = _state.sent(), _tmp56.runId = responseCreatedResponse.id, _tmp56.status = "in_progress", _tmp56.completedAt = null, _tmp56)
8706
8771
  ]), _tmp55)
8707
8772
  ])
8708
8773
  ];
8709
- case 78:
8774
+ case 77:
8710
8775
  _state.sent();
8711
- return [
8712
- 3,
8713
- 117
8714
- ];
8715
- case 79:
8716
- if (!(event.item.type === "function_call")) return [
8717
- 3,
8718
- 82
8719
- ];
8720
- toolCalls[event.item.id] = event.item;
8721
8776
  _tmp57 = {
8722
- event: "thread.run.step.in_progress"
8777
+ event: "thread.run.step.created"
8723
8778
  };
8724
8779
  _tmp58 = {
8725
- item: event.item,
8726
- threadId: threadId
8780
+ item: event.item
8727
8781
  };
8728
8782
  return [
8729
8783
  4,
@@ -8733,31 +8787,35 @@ var responsesRunAdapter = function(param) {
8733
8787
  }
8734
8788
  })
8735
8789
  ];
8736
- case 80:
8790
+ case 78:
8737
8791
  return [
8738
8792
  4,
8739
8793
  onEvent2.apply(void 0, [
8740
- (_tmp57.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
8741
- (_tmp58.openaiAssistant = _state.sent(), _tmp58.runId = responseCreatedResponse.id, _tmp58)
8794
+ (_tmp57.data = serializeItemAsCodeInterpreterCallRunStep.apply(void 0, [
8795
+ (_tmp58.openaiAssistant = _state.sent(), _tmp58.threadId = threadId, _tmp58.runId = responseCreatedResponse.id, _tmp58.completedAt = null, _tmp58)
8742
8796
  ]), _tmp57)
8743
8797
  ])
8744
8798
  ];
8745
- case 81:
8799
+ case 79:
8746
8800
  _state.sent();
8801
+ _state.label = 80;
8802
+ case 80:
8803
+ if (event.item.id) itemIds.push(event.item.id);
8747
8804
  return [
8748
8805
  3,
8749
- 117
8806
+ 143
8750
8807
  ];
8751
- case 82:
8752
- if (!(event.item.type === "image_generation_call")) return [
8808
+ case 81:
8809
+ if (!(event.item.type === "message")) return [
8753
8810
  3,
8754
- 89
8811
+ 86
8755
8812
  ];
8756
8813
  _tmp59 = {
8757
8814
  event: "thread.run.step.completed"
8758
8815
  };
8759
8816
  _tmp60 = {
8760
- item: event.item
8817
+ item: event.item,
8818
+ threadId: threadId
8761
8819
  };
8762
8820
  return [
8763
8821
  4,
@@ -8767,19 +8825,19 @@ var responsesRunAdapter = function(param) {
8767
8825
  }
8768
8826
  })
8769
8827
  ];
8770
- case 83:
8828
+ case 82:
8771
8829
  return [
8772
8830
  4,
8773
8831
  onEvent2.apply(void 0, [
8774
- (_tmp59.data = serializeItemAsImageGenerationRunStep.apply(void 0, [
8775
- (_tmp60.openaiAssistant = _state.sent(), _tmp60.threadId = threadId, _tmp60.runId = responseCreatedResponse.id, _tmp60)
8832
+ (_tmp59.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
8833
+ (_tmp60.openaiAssistant = _state.sent(), _tmp60.runId = responseCreatedResponse.id, _tmp60)
8776
8834
  ]), _tmp59)
8777
8835
  ])
8778
8836
  ];
8779
- case 84:
8837
+ case 83:
8780
8838
  _state.sent();
8781
8839
  _tmp61 = {
8782
- event: "thread.run.step.completed"
8840
+ event: "thread.message.completed"
8783
8841
  };
8784
8842
  _tmp62 = {
8785
8843
  item: event.item,
@@ -8793,19 +8851,29 @@ var responsesRunAdapter = function(param) {
8793
8851
  }
8794
8852
  })
8795
8853
  ];
8796
- case 85:
8854
+ case 84:
8797
8855
  return [
8798
8856
  4,
8799
8857
  onEvent2.apply(void 0, [
8800
- (_tmp61.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
8801
- (_tmp62.openaiAssistant = _state.sent(), _tmp62.runId = responseCreatedResponse.id, _tmp62)
8858
+ (_tmp61.data = serializeItemAsMessage.apply(void 0, [
8859
+ (_tmp62.openaiAssistant = _state.sent(), _tmp62.createdAt = (0, import_dayjs21.default)().unix(), _tmp62.runId = responseCreatedResponse.id, _tmp62)
8802
8860
  ]), _tmp61)
8803
8861
  ])
8804
8862
  ];
8805
- case 86:
8863
+ case 85:
8806
8864
  _state.sent();
8865
+ return [
8866
+ 3,
8867
+ 131
8868
+ ];
8869
+ case 86:
8870
+ if (!(event.item.type === "function_call")) return [
8871
+ 3,
8872
+ 89
8873
+ ];
8874
+ toolCalls[event.item.id] = event.item;
8807
8875
  _tmp63 = {
8808
- event: "thread.message.completed"
8876
+ event: "thread.run.step.in_progress"
8809
8877
  };
8810
8878
  _tmp64 = {
8811
8879
  item: event.item,
@@ -8823,8 +8891,8 @@ var responsesRunAdapter = function(param) {
8823
8891
  return [
8824
8892
  4,
8825
8893
  onEvent2.apply(void 0, [
8826
- (_tmp63.data = serializeItemAsMessage.apply(void 0, [
8827
- (_tmp64.openaiAssistant = _state.sent(), _tmp64.createdAt = (0, import_dayjs20.default)().unix(), _tmp64.runId = responseCreatedResponse.id, _tmp64)
8894
+ (_tmp63.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
8895
+ (_tmp64.openaiAssistant = _state.sent(), _tmp64.runId = responseCreatedResponse.id, _tmp64)
8828
8896
  ]), _tmp63)
8829
8897
  ])
8830
8898
  ];
@@ -8832,10 +8900,10 @@ var responsesRunAdapter = function(param) {
8832
8900
  _state.sent();
8833
8901
  return [
8834
8902
  3,
8835
- 117
8903
+ 131
8836
8904
  ];
8837
8905
  case 89:
8838
- if (!(event.item.type === "web_search_call")) return [
8906
+ if (!(event.item.type === "image_generation_call")) return [
8839
8907
  3,
8840
8908
  96
8841
8909
  ];
@@ -8857,7 +8925,7 @@ var responsesRunAdapter = function(param) {
8857
8925
  return [
8858
8926
  4,
8859
8927
  onEvent2.apply(void 0, [
8860
- (_tmp65.data = serializeItemAsWebSearchRunStep.apply(void 0, [
8928
+ (_tmp65.data = serializeItemAsImageGenerationRunStep.apply(void 0, [
8861
8929
  (_tmp66.openaiAssistant = _state.sent(), _tmp66.threadId = threadId, _tmp66.runId = responseCreatedResponse.id, _tmp66)
8862
8930
  ]), _tmp65)
8863
8931
  ])
@@ -8910,7 +8978,7 @@ var responsesRunAdapter = function(param) {
8910
8978
  4,
8911
8979
  onEvent2.apply(void 0, [
8912
8980
  (_tmp69.data = serializeItemAsMessage.apply(void 0, [
8913
- (_tmp70.openaiAssistant = _state.sent(), _tmp70.createdAt = (0, import_dayjs20.default)().unix(), _tmp70.runId = responseCreatedResponse.id, _tmp70)
8981
+ (_tmp70.openaiAssistant = _state.sent(), _tmp70.createdAt = (0, import_dayjs21.default)().unix(), _tmp70.runId = responseCreatedResponse.id, _tmp70)
8914
8982
  ]), _tmp69)
8915
8983
  ])
8916
8984
  ];
@@ -8918,10 +8986,10 @@ var responsesRunAdapter = function(param) {
8918
8986
  _state.sent();
8919
8987
  return [
8920
8988
  3,
8921
- 117
8989
+ 131
8922
8990
  ];
8923
8991
  case 96:
8924
- if (!(event.item.type === "mcp_list_tools")) return [
8992
+ if (!(event.item.type === "reasoning")) return [
8925
8993
  3,
8926
8994
  103
8927
8995
  ];
@@ -8943,7 +9011,7 @@ var responsesRunAdapter = function(param) {
8943
9011
  return [
8944
9012
  4,
8945
9013
  onEvent2.apply(void 0, [
8946
- (_tmp71.data = serializeItemAsMcpListToolsRunStep.apply(void 0, [
9014
+ (_tmp71.data = serializeItemAsReasoningRunStep.apply(void 0, [
8947
9015
  (_tmp72.openaiAssistant = _state.sent(), _tmp72.threadId = threadId, _tmp72.runId = responseCreatedResponse.id, _tmp72)
8948
9016
  ]), _tmp71)
8949
9017
  ])
@@ -8996,7 +9064,7 @@ var responsesRunAdapter = function(param) {
8996
9064
  4,
8997
9065
  onEvent2.apply(void 0, [
8998
9066
  (_tmp75.data = serializeItemAsMessage.apply(void 0, [
8999
- (_tmp76.openaiAssistant = _state.sent(), _tmp76.createdAt = (0, import_dayjs20.default)().unix(), _tmp76.runId = responseCreatedResponse.id, _tmp76)
9067
+ (_tmp76.openaiAssistant = _state.sent(), _tmp76.createdAt = (0, import_dayjs21.default)().unix(), _tmp76.runId = responseCreatedResponse.id, _tmp76)
9000
9068
  ]), _tmp75)
9001
9069
  ])
9002
9070
  ];
@@ -9004,10 +9072,10 @@ var responsesRunAdapter = function(param) {
9004
9072
  _state.sent();
9005
9073
  return [
9006
9074
  3,
9007
- 117
9075
+ 131
9008
9076
  ];
9009
9077
  case 103:
9010
- if (!(event.item.type === "mcp_call")) return [
9078
+ if (!(event.item.type === "web_search_call")) return [
9011
9079
  3,
9012
9080
  110
9013
9081
  ];
@@ -9029,7 +9097,7 @@ var responsesRunAdapter = function(param) {
9029
9097
  return [
9030
9098
  4,
9031
9099
  onEvent2.apply(void 0, [
9032
- (_tmp77.data = serializeItemAsMcpCallRunStep.apply(void 0, [
9100
+ (_tmp77.data = serializeItemAsWebSearchRunStep.apply(void 0, [
9033
9101
  (_tmp78.openaiAssistant = _state.sent(), _tmp78.threadId = threadId, _tmp78.runId = responseCreatedResponse.id, _tmp78)
9034
9102
  ]), _tmp77)
9035
9103
  ])
@@ -9082,7 +9150,7 @@ var responsesRunAdapter = function(param) {
9082
9150
  4,
9083
9151
  onEvent2.apply(void 0, [
9084
9152
  (_tmp81.data = serializeItemAsMessage.apply(void 0, [
9085
- (_tmp82.openaiAssistant = _state.sent(), _tmp82.createdAt = (0, import_dayjs20.default)().unix(), _tmp82.runId = responseCreatedResponse.id, _tmp82)
9153
+ (_tmp82.openaiAssistant = _state.sent(), _tmp82.createdAt = (0, import_dayjs21.default)().unix(), _tmp82.runId = responseCreatedResponse.id, _tmp82)
9086
9154
  ]), _tmp81)
9087
9155
  ])
9088
9156
  ];
@@ -9090,10 +9158,10 @@ var responsesRunAdapter = function(param) {
9090
9158
  _state.sent();
9091
9159
  return [
9092
9160
  3,
9093
- 117
9161
+ 131
9094
9162
  ];
9095
9163
  case 110:
9096
- if (!(event.item.type === "code_interpreter_call")) return [
9164
+ if (!(event.item.type === "mcp_list_tools")) return [
9097
9165
  3,
9098
9166
  117
9099
9167
  ];
@@ -9115,7 +9183,7 @@ var responsesRunAdapter = function(param) {
9115
9183
  return [
9116
9184
  4,
9117
9185
  onEvent2.apply(void 0, [
9118
- (_tmp83.data = serializeItemAsCodeInterpreterCallRunStep.apply(void 0, [
9186
+ (_tmp83.data = serializeItemAsMcpListToolsRunStep.apply(void 0, [
9119
9187
  (_tmp84.openaiAssistant = _state.sent(), _tmp84.threadId = threadId, _tmp84.runId = responseCreatedResponse.id, _tmp84)
9120
9188
  ]), _tmp83)
9121
9189
  ])
@@ -9168,23 +9236,195 @@ var responsesRunAdapter = function(param) {
9168
9236
  4,
9169
9237
  onEvent2.apply(void 0, [
9170
9238
  (_tmp87.data = serializeItemAsMessage.apply(void 0, [
9171
- (_tmp88.openaiAssistant = _state.sent(), _tmp88.createdAt = (0, import_dayjs20.default)().unix(), _tmp88.runId = responseCreatedResponse.id, _tmp88)
9239
+ (_tmp88.openaiAssistant = _state.sent(), _tmp88.createdAt = (0, import_dayjs21.default)().unix(), _tmp88.runId = responseCreatedResponse.id, _tmp88)
9172
9240
  ]), _tmp87)
9173
9241
  ])
9174
9242
  ];
9175
9243
  case 116:
9176
9244
  _state.sent();
9177
- _state.label = 117;
9178
- case 117:
9179
9245
  return [
9180
9246
  3,
9181
- 129
9247
+ 131
9248
+ ];
9249
+ case 117:
9250
+ if (!(event.item.type === "mcp_call")) return [
9251
+ 3,
9252
+ 124
9253
+ ];
9254
+ _tmp89 = {
9255
+ event: "thread.run.step.completed"
9256
+ };
9257
+ _tmp90 = {
9258
+ item: event.item
9259
+ };
9260
+ return [
9261
+ 4,
9262
+ getOpenaiAssistant({
9263
+ select: {
9264
+ id: true
9265
+ }
9266
+ })
9182
9267
  ];
9183
9268
  case 118:
9269
+ return [
9270
+ 4,
9271
+ onEvent2.apply(void 0, [
9272
+ (_tmp89.data = serializeItemAsMcpCallRunStep.apply(void 0, [
9273
+ (_tmp90.openaiAssistant = _state.sent(), _tmp90.threadId = threadId, _tmp90.runId = responseCreatedResponse.id, _tmp90)
9274
+ ]), _tmp89)
9275
+ ])
9276
+ ];
9277
+ case 119:
9278
+ _state.sent();
9279
+ _tmp91 = {
9280
+ event: "thread.run.step.completed"
9281
+ };
9282
+ _tmp92 = {
9283
+ item: event.item,
9284
+ threadId: threadId
9285
+ };
9286
+ return [
9287
+ 4,
9288
+ getOpenaiAssistant({
9289
+ select: {
9290
+ id: true
9291
+ }
9292
+ })
9293
+ ];
9294
+ case 120:
9295
+ return [
9296
+ 4,
9297
+ onEvent2.apply(void 0, [
9298
+ (_tmp91.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
9299
+ (_tmp92.openaiAssistant = _state.sent(), _tmp92.runId = responseCreatedResponse.id, _tmp92)
9300
+ ]), _tmp91)
9301
+ ])
9302
+ ];
9303
+ case 121:
9304
+ _state.sent();
9305
+ _tmp93 = {
9306
+ event: "thread.message.completed"
9307
+ };
9308
+ _tmp94 = {
9309
+ item: event.item,
9310
+ threadId: threadId
9311
+ };
9312
+ return [
9313
+ 4,
9314
+ getOpenaiAssistant({
9315
+ select: {
9316
+ id: true
9317
+ }
9318
+ })
9319
+ ];
9320
+ case 122:
9321
+ return [
9322
+ 4,
9323
+ onEvent2.apply(void 0, [
9324
+ (_tmp93.data = serializeItemAsMessage.apply(void 0, [
9325
+ (_tmp94.openaiAssistant = _state.sent(), _tmp94.createdAt = (0, import_dayjs21.default)().unix(), _tmp94.runId = responseCreatedResponse.id, _tmp94)
9326
+ ]), _tmp93)
9327
+ ])
9328
+ ];
9329
+ case 123:
9330
+ _state.sent();
9331
+ return [
9332
+ 3,
9333
+ 131
9334
+ ];
9335
+ case 124:
9336
+ if (!(event.item.type === "code_interpreter_call")) return [
9337
+ 3,
9338
+ 131
9339
+ ];
9340
+ _tmp95 = {
9341
+ event: "thread.run.step.completed"
9342
+ };
9343
+ _tmp96 = {
9344
+ item: event.item
9345
+ };
9346
+ return [
9347
+ 4,
9348
+ getOpenaiAssistant({
9349
+ select: {
9350
+ id: true
9351
+ }
9352
+ })
9353
+ ];
9354
+ case 125:
9355
+ return [
9356
+ 4,
9357
+ onEvent2.apply(void 0, [
9358
+ (_tmp95.data = serializeItemAsCodeInterpreterCallRunStep.apply(void 0, [
9359
+ (_tmp96.openaiAssistant = _state.sent(), _tmp96.threadId = threadId, _tmp96.runId = responseCreatedResponse.id, _tmp96)
9360
+ ]), _tmp95)
9361
+ ])
9362
+ ];
9363
+ case 126:
9364
+ _state.sent();
9365
+ _tmp97 = {
9366
+ event: "thread.run.step.completed"
9367
+ };
9368
+ _tmp98 = {
9369
+ item: event.item,
9370
+ threadId: threadId
9371
+ };
9372
+ return [
9373
+ 4,
9374
+ getOpenaiAssistant({
9375
+ select: {
9376
+ id: true
9377
+ }
9378
+ })
9379
+ ];
9380
+ case 127:
9381
+ return [
9382
+ 4,
9383
+ onEvent2.apply(void 0, [
9384
+ (_tmp97.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
9385
+ (_tmp98.openaiAssistant = _state.sent(), _tmp98.runId = responseCreatedResponse.id, _tmp98)
9386
+ ]), _tmp97)
9387
+ ])
9388
+ ];
9389
+ case 128:
9390
+ _state.sent();
9391
+ _tmp99 = {
9392
+ event: "thread.message.completed"
9393
+ };
9394
+ _tmp100 = {
9395
+ item: event.item,
9396
+ threadId: threadId
9397
+ };
9398
+ return [
9399
+ 4,
9400
+ getOpenaiAssistant({
9401
+ select: {
9402
+ id: true
9403
+ }
9404
+ })
9405
+ ];
9406
+ case 129:
9407
+ return [
9408
+ 4,
9409
+ onEvent2.apply(void 0, [
9410
+ (_tmp99.data = serializeItemAsMessage.apply(void 0, [
9411
+ (_tmp100.openaiAssistant = _state.sent(), _tmp100.createdAt = (0, import_dayjs21.default)().unix(), _tmp100.runId = responseCreatedResponse.id, _tmp100)
9412
+ ]), _tmp99)
9413
+ ])
9414
+ ];
9415
+ case 130:
9416
+ _state.sent();
9417
+ _state.label = 131;
9418
+ case 131:
9419
+ return [
9420
+ 3,
9421
+ 143
9422
+ ];
9423
+ case 132:
9184
9424
  toolCall = toolCalls[event.item_id];
9185
9425
  if (!toolCall) return [
9186
9426
  3,
9187
- 129
9427
+ 143
9188
9428
  ];
9189
9429
  return [
9190
9430
  4,
@@ -9213,17 +9453,17 @@ var responsesRunAdapter = function(param) {
9213
9453
  }
9214
9454
  })
9215
9455
  ];
9216
- case 119:
9456
+ case 133:
9217
9457
  _state.sent();
9218
9458
  return [
9219
9459
  3,
9220
- 129
9460
+ 143
9221
9461
  ];
9222
- case 120:
9462
+ case 134:
9223
9463
  mcpCall = mcpCalls[event.item_id];
9224
9464
  if (!mcpCall) return [
9225
9465
  3,
9226
- 129
9466
+ 143
9227
9467
  ];
9228
9468
  return [
9229
9469
  4,
@@ -9252,20 +9492,20 @@ var responsesRunAdapter = function(param) {
9252
9492
  }
9253
9493
  })
9254
9494
  ];
9255
- case 121:
9495
+ case 135:
9256
9496
  _state.sent();
9257
9497
  return [
9258
9498
  3,
9259
- 129
9499
+ 143
9260
9500
  ];
9261
- case 122:
9262
- _tmp89 = {
9501
+ case 136:
9502
+ _tmp101 = {
9263
9503
  event: "thread.message.in_progress"
9264
9504
  };
9265
- _tmp90 = {
9505
+ _tmp102 = {
9266
9506
  id: event.item_id,
9267
9507
  object: "thread.message",
9268
- created_at: (0, import_dayjs20.default)().unix(),
9508
+ created_at: (0, import_dayjs21.default)().unix(),
9269
9509
  thread_id: threadId,
9270
9510
  completed_at: null,
9271
9511
  incomplete_at: null,
@@ -9281,29 +9521,29 @@ var responsesRunAdapter = function(param) {
9281
9521
  }
9282
9522
  })
9283
9523
  ];
9284
- case 123:
9524
+ case 137:
9285
9525
  return [
9286
9526
  4,
9287
9527
  onEvent2.apply(void 0, [
9288
- (_tmp89.data = (_tmp90.assistant_id = _state.sent().id, _tmp90.run_id = responseCreatedResponse.id, _tmp90.attachments = [], _tmp90.status = "in_progress", _tmp90.metadata = {
9528
+ (_tmp101.data = (_tmp102.assistant_id = _state.sent().id, _tmp102.run_id = responseCreatedResponse.id, _tmp102.attachments = [], _tmp102.status = "in_progress", _tmp102.metadata = {
9289
9529
  event: JSON.stringify(event)
9290
- }, _tmp90), _tmp89)
9530
+ }, _tmp102), _tmp101)
9291
9531
  ])
9292
9532
  ];
9293
- case 124:
9533
+ case 138:
9294
9534
  _state.sent();
9295
9535
  return [
9296
9536
  3,
9297
- 129
9537
+ 143
9298
9538
  ];
9299
- case 125:
9300
- _tmp91 = {
9539
+ case 139:
9540
+ _tmp103 = {
9301
9541
  event: "thread.message.in_progress"
9302
9542
  };
9303
- _tmp92 = {
9543
+ _tmp104 = {
9304
9544
  id: event.item_id,
9305
9545
  object: "thread.message",
9306
- created_at: (0, import_dayjs20.default)().unix(),
9546
+ created_at: (0, import_dayjs21.default)().unix(),
9307
9547
  thread_id: threadId,
9308
9548
  completed_at: null,
9309
9549
  incomplete_at: null,
@@ -9328,92 +9568,92 @@ var responsesRunAdapter = function(param) {
9328
9568
  }
9329
9569
  })
9330
9570
  ];
9331
- case 126:
9571
+ case 140:
9332
9572
  return [
9333
9573
  4,
9334
9574
  onEvent2.apply(void 0, [
9335
- (_tmp91.data = (_tmp92.assistant_id = _state.sent().id, _tmp92.run_id = responseCreatedResponse.id, _tmp92.attachments = [], _tmp92.status = "in_progress", _tmp92.metadata = {
9575
+ (_tmp103.data = (_tmp104.assistant_id = _state.sent().id, _tmp104.run_id = responseCreatedResponse.id, _tmp104.attachments = [], _tmp104.status = "in_progress", _tmp104.metadata = {
9336
9576
  event: JSON.stringify(_object_spread_props(_object_spread({}, event), {
9337
9577
  partial_image_b64: "truncated"
9338
9578
  }))
9339
- }, _tmp92), _tmp91)
9579
+ }, _tmp104), _tmp103)
9340
9580
  ])
9341
9581
  ];
9342
- case 127:
9582
+ case 141:
9343
9583
  _state.sent();
9344
9584
  return [
9345
9585
  3,
9346
- 129
9586
+ 143
9347
9587
  ];
9348
- case 128:
9588
+ case 142:
9349
9589
  return [
9350
9590
  3,
9351
- 129
9591
+ 143
9352
9592
  ];
9353
- case 129:
9593
+ case 143:
9354
9594
  _iteratorAbruptCompletion = false;
9355
9595
  return [
9356
9596
  3,
9357
9597
  3
9358
9598
  ];
9359
- case 130:
9599
+ case 144:
9360
9600
  return [
9361
9601
  3,
9362
- 137
9602
+ 151
9363
9603
  ];
9364
- case 131:
9604
+ case 145:
9365
9605
  err = _state.sent();
9366
9606
  _didIteratorError = true;
9367
9607
  _iteratorError = err;
9368
9608
  return [
9369
9609
  3,
9370
- 137
9610
+ 151
9371
9611
  ];
9372
- case 132:
9612
+ case 146:
9373
9613
  _state.trys.push([
9374
- 132,
9614
+ 146,
9375
9615
  ,
9376
- 135,
9377
- 136
9616
+ 149,
9617
+ 150
9378
9618
  ]);
9379
9619
  if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
9380
9620
  3,
9381
- 134
9621
+ 148
9382
9622
  ];
9383
9623
  return [
9384
9624
  4,
9385
9625
  _iterator.return()
9386
9626
  ];
9387
- case 133:
9627
+ case 147:
9388
9628
  _state.sent();
9389
- _state.label = 134;
9390
- case 134:
9629
+ _state.label = 148;
9630
+ case 148:
9391
9631
  return [
9392
9632
  3,
9393
- 136
9633
+ 150
9394
9634
  ];
9395
- case 135:
9635
+ case 149:
9396
9636
  if (_didIteratorError) {
9397
9637
  throw _iteratorError;
9398
9638
  }
9399
9639
  return [
9400
9640
  7
9401
9641
  ];
9402
- case 136:
9642
+ case 150:
9403
9643
  return [
9404
9644
  7
9405
9645
  ];
9406
- case 137:
9646
+ case 151:
9407
9647
  return [
9408
9648
  3,
9409
- 142
9649
+ 156
9410
9650
  ];
9411
- case 138:
9651
+ case 152:
9412
9652
  e = _state.sent();
9413
- _tmp93 = {
9653
+ _tmp105 = {
9414
9654
  event: "thread.run.failed"
9415
9655
  };
9416
- _tmp94 = {
9656
+ _tmp106 = {
9417
9657
  id: (responseCreatedResponse === null || responseCreatedResponse === void 0 ? void 0 : responseCreatedResponse.id) || "run_".concat((0, import_radash22.uid)(18)),
9418
9658
  object: "thread.run",
9419
9659
  thread_id: threadId
@@ -9426,23 +9666,23 @@ var responsesRunAdapter = function(param) {
9426
9666
  }
9427
9667
  })
9428
9668
  ];
9429
- case 139:
9669
+ case 153:
9430
9670
  return [
9431
9671
  4,
9432
9672
  onEvent2.apply(void 0, [
9433
- (_tmp93.data = (_tmp94.assistant_id = _state.sent().id, _tmp94.status = "failed", _tmp94.failed_at = (0, import_dayjs20.default)().unix(), _tmp94.last_error = {
9673
+ (_tmp105.data = (_tmp106.assistant_id = _state.sent().id, _tmp106.status = "failed", _tmp106.failed_at = (0, import_dayjs21.default)().unix(), _tmp106.last_error = {
9434
9674
  code: "server_error",
9435
9675
  message: String((e === null || e === void 0 ? void 0 : e.message) || e || "Unknown error")
9436
- }, _tmp94), _tmp93)
9676
+ }, _tmp106), _tmp105)
9437
9677
  ])
9438
9678
  ];
9439
- case 140:
9679
+ case 154:
9440
9680
  _state.sent();
9441
9681
  return [
9442
9682
  3,
9443
- 142
9683
+ 156
9444
9684
  ];
9445
- case 141:
9685
+ case 155:
9446
9686
  waitUntil(new Promise(/*#__PURE__*/ function() {
9447
9687
  var _ref = _async_to_generator(function(resolve) {
9448
9688
  return _ts_generator(this, function(_state) {
@@ -9479,7 +9719,7 @@ var responsesRunAdapter = function(param) {
9479
9719
  return [
9480
9720
  7
9481
9721
  ];
9482
- case 142:
9722
+ case 156:
9483
9723
  return [
9484
9724
  2
9485
9725
  ];