supercompat 3.15.4 → 3.15.6

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
@@ -5031,7 +5031,7 @@ var get12 = function(param) {
5031
5031
  var prisma = param.prisma;
5032
5032
  return function(urlString) {
5033
5033
  return _async_to_generator(function() {
5034
- var _ref, _runs4_at, url, _url_pathname_match, threadId, _assign4, limit, order, after, pageSize, runsPlusOne, runs4;
5034
+ var _ref, _runs5_at, url, _url_pathname_match, threadId, _assign4, limit, order, after, pageSize, runsPlusOne, runs5;
5035
5035
  return _ts_generator(this, function(_state) {
5036
5036
  switch(_state.label){
5037
5037
  case 0:
@@ -5061,17 +5061,17 @@ var get12 = function(param) {
5061
5061
  ];
5062
5062
  case 1:
5063
5063
  runsPlusOne = _state.sent();
5064
- runs4 = runsPlusOne.slice(0, pageSize);
5064
+ runs5 = runsPlusOne.slice(0, pageSize);
5065
5065
  return [
5066
5066
  2,
5067
5067
  new Response(JSON.stringify({
5068
- data: runs4.map(function(run4) {
5068
+ data: runs5.map(function(run4) {
5069
5069
  return serializeRun({
5070
5070
  run: mapPrismaRun(run4)
5071
5071
  });
5072
5072
  }),
5073
5073
  has_more: runsPlusOne.length > pageSize,
5074
- last_id: (_ref = (_runs4_at = runs4.at(-1)) === null || _runs4_at === void 0 ? void 0 : _runs4_at.id) !== null && _ref !== void 0 ? _ref : null
5074
+ last_id: (_ref = (_runs5_at = runs5.at(-1)) === null || _runs5_at === void 0 ? void 0 : _runs5_at.id) !== null && _ref !== void 0 ? _ref : null
5075
5075
  }), {
5076
5076
  status: 200,
5077
5077
  headers: {
@@ -7306,7 +7306,7 @@ function saveResponseItemsToConversationMetadata(_0) {
7306
7306
  });
7307
7307
  }).apply(this, arguments);
7308
7308
  }
7309
- // src/adapters/storage/responsesStorageAdapter/threads/runs/post.ts
7309
+ // src/adapters/storage/responsesStorageAdapter/threads/runs/shared.ts
7310
7310
  var serializeTools2 = function(param) {
7311
7311
  var tools = param.tools;
7312
7312
  if (!(tools === null || tools === void 0 ? void 0 : tools.length)) return {};
@@ -7325,6 +7325,15 @@ var truncation = function(param) {
7325
7325
  }
7326
7326
  return "auto";
7327
7327
  };
7328
+ var textConfig = function(param) {
7329
+ var response_format = param.response_format;
7330
+ if (response_format && (typeof response_format === "undefined" ? "undefined" : _type_of(response_format)) === "object") {
7331
+ return {
7332
+ format: response_format
7333
+ };
7334
+ }
7335
+ return void 0;
7336
+ };
7328
7337
  var defaultAssistant = {
7329
7338
  model: "",
7330
7339
  instructions: "",
@@ -7336,12 +7345,13 @@ var defaultAssistant = {
7336
7345
  type: "text"
7337
7346
  }
7338
7347
  };
7348
+ // src/adapters/storage/responsesStorageAdapter/threads/runs/post.ts
7339
7349
  var post17 = function(param) {
7340
7350
  var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
7341
7351
  return function(urlString, options) {
7342
7352
  return _async_to_generator(function() {
7343
- var url, _url_pathname_match, threadId, body, assistant_id, stream, _assign8, model, instructions, // additional_instructions,
7344
- tools, metadata, response_format, truncation_strategy, _tmp, response, readableStream, _response_output, itemIds, data;
7353
+ var url, _url_pathname_match, threadId, body, assistant_id, stream, openaiAssistant, _assign8, model, instructions, // additional_instructions,
7354
+ tools, metadata, response_format, truncation_strategy, shouldSendInstructions, responseBody, normalizedText, response, readableStream, _nonStreamResponse_output, nonStreamResponse, itemIds, data;
7345
7355
  return _ts_generator(this, function(_state) {
7346
7356
  switch(_state.label){
7347
7357
  case 0:
@@ -7352,40 +7362,39 @@ var post17 = function(param) {
7352
7362
  }
7353
7363
  body = JSON.parse(options.body);
7354
7364
  assistant_id = body.assistant_id, stream = body.stream;
7355
- _tmp = [
7356
- {},
7357
- defaultAssistant
7358
- ];
7359
7365
  return [
7360
7366
  4,
7361
7367
  runAdapter.getOpenaiAssistant()
7362
7368
  ];
7363
7369
  case 1:
7364
- _assign8 = assign8.apply(void 0, [
7365
- _object_spread.apply(void 0, _tmp.concat([
7366
- _state.sent()
7367
- ])),
7368
- body
7369
- ]), model = _assign8.model, instructions = _assign8.instructions, tools = _assign8.tools, metadata = _assign8.metadata, response_format = _assign8.response_format, truncation_strategy = _assign8.truncation_strategy;
7370
- return [
7371
- 4,
7372
- client.responses.create(_object_spread_props(_object_spread({
7373
- conversation: threadId,
7374
- instructions: instructions,
7375
- model: model,
7376
- metadata: metadata,
7377
- stream: stream
7378
- }, serializeTools2({
7379
- tools: tools
7380
- })), {
7381
- truncation: truncation({
7382
- truncation_strategy: truncation_strategy
7383
- }),
7384
- text: {
7385
- format: response_format
7386
- },
7387
- input: createResponseItems
7388
- }))
7370
+ openaiAssistant = _state.sent();
7371
+ _assign8 = assign8(_object_spread({}, defaultAssistant, openaiAssistant), body), model = _assign8.model, instructions = _assign8.instructions, tools = _assign8.tools, metadata = _assign8.metadata, response_format = _assign8.response_format, truncation_strategy = _assign8.truncation_strategy;
7372
+ shouldSendInstructions = typeof instructions === "string" && instructions.trim().length > 0;
7373
+ responseBody = {
7374
+ conversation: threadId,
7375
+ stream: stream,
7376
+ input: createResponseItems
7377
+ };
7378
+ responseBody.model = model;
7379
+ responseBody.metadata = metadata;
7380
+ Object.assign(responseBody, serializeTools2({
7381
+ tools: tools
7382
+ }));
7383
+ responseBody.truncation = truncation({
7384
+ truncation_strategy: truncation_strategy
7385
+ });
7386
+ normalizedText = textConfig({
7387
+ response_format: response_format
7388
+ });
7389
+ if (normalizedText) {
7390
+ responseBody.text = normalizedText;
7391
+ }
7392
+ if (shouldSendInstructions && typeof instructions === "string") {
7393
+ responseBody.instructions = instructions;
7394
+ }
7395
+ return [
7396
+ 4,
7397
+ client.responses.create(responseBody)
7389
7398
  ];
7390
7399
  case 2:
7391
7400
  response = _state.sent();
@@ -7467,7 +7476,8 @@ var post17 = function(param) {
7467
7476
  })
7468
7477
  ];
7469
7478
  case 3:
7470
- itemIds = ((_response_output = response.output) !== null && _response_output !== void 0 ? _response_output : []).filter(function(o) {
7479
+ nonStreamResponse = response;
7480
+ itemIds = ((_nonStreamResponse_output = nonStreamResponse.output) !== null && _nonStreamResponse_output !== void 0 ? _nonStreamResponse_output : []).filter(function(o) {
7471
7481
  return o.id;
7472
7482
  }).map(function(o) {
7473
7483
  return o.id;
@@ -7481,7 +7491,7 @@ var post17 = function(param) {
7481
7491
  saveResponseItemsToConversationMetadata({
7482
7492
  client: client,
7483
7493
  threadId: threadId,
7484
- responseId: response.id,
7494
+ responseId: nonStreamResponse.id,
7485
7495
  itemIds: itemIds
7486
7496
  })
7487
7497
  ];
@@ -7490,7 +7500,7 @@ var post17 = function(param) {
7490
7500
  _state.label = 5;
7491
7501
  case 5:
7492
7502
  data = serializeResponseAsRun({
7493
- response: response,
7503
+ response: nonStreamResponse,
7494
7504
  assistantId: assistant_id
7495
7505
  });
7496
7506
  return [
@@ -8270,18 +8280,7 @@ var steps2 = function(param) {
8270
8280
  })
8271
8281
  };
8272
8282
  };
8273
- // src/adapters/storage/responsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
8274
- var serializeTools3 = function(param) {
8275
- var tools = param.tools;
8276
- if (!(tools === null || tools === void 0 ? void 0 : tools.length)) return {};
8277
- return {
8278
- tools: tools.map(function(tool) {
8279
- return _object_spread({
8280
- type: tool.type
8281
- }, tool[tool.type] || {});
8282
- })
8283
- };
8284
- };
8283
+ // src/adapters/storage/responsesStorageAdapter/threads/runs/submitToolOutputs/shared.ts
8285
8284
  var computerCallOutput = function(param) {
8286
8285
  var toolOutput = param.toolOutput;
8287
8286
  if (typeof toolOutput.output !== "string") return {
@@ -8337,6 +8336,17 @@ var getToolCallOutputItems = function(param) {
8337
8336
  computerCallOutputItems: computerCallOutputItems
8338
8337
  };
8339
8338
  };
8339
+ var serializeTools3 = function(param) {
8340
+ var tools = param.tools;
8341
+ if (!(tools === null || tools === void 0 ? void 0 : tools.length)) return {};
8342
+ return {
8343
+ tools: tools.map(function(tool) {
8344
+ return _object_spread({
8345
+ type: tool.type
8346
+ }, tool[tool.type] || {});
8347
+ })
8348
+ };
8349
+ };
8340
8350
  var truncation2 = function(param) {
8341
8351
  var openaiAssistant = param.openaiAssistant;
8342
8352
  var _openaiAssistant_truncation_strategy;
@@ -8345,11 +8355,12 @@ var truncation2 = function(param) {
8345
8355
  }
8346
8356
  return "auto";
8347
8357
  };
8358
+ // src/adapters/storage/responsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
8348
8359
  var post18 = function(param) {
8349
8360
  var client = param.client, runAdapter = param.runAdapter;
8350
8361
  return function(urlString, options) {
8351
8362
  return _async_to_generator(function() {
8352
- var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, toolCallOutputItems, input, previousResponse, openaiAssistant, response, readableStream;
8363
+ var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, toolCallOutputItems, input, previousResponse, openaiAssistant, shouldSendInstructions, responseBody, response, readableStream;
8353
8364
  return _ts_generator(this, function(_state) {
8354
8365
  switch(_state.label){
8355
8366
  case 0:
@@ -8373,22 +8384,25 @@ var post18 = function(param) {
8373
8384
  ];
8374
8385
  case 2:
8375
8386
  openaiAssistant = _state.sent();
8387
+ shouldSendInstructions = typeof openaiAssistant.instructions === "string" && openaiAssistant.instructions.trim().length > 0;
8388
+ responseBody = {
8389
+ conversation: threadId,
8390
+ stream: stream,
8391
+ input: input
8392
+ };
8393
+ responseBody.model = openaiAssistant.model;
8394
+ Object.assign(responseBody, serializeTools3({
8395
+ tools: openaiAssistant.tools
8396
+ }));
8397
+ responseBody.truncation = truncation2({
8398
+ openaiAssistant: openaiAssistant
8399
+ });
8400
+ if (shouldSendInstructions && typeof openaiAssistant.instructions === "string") {
8401
+ responseBody.instructions = openaiAssistant.instructions;
8402
+ }
8376
8403
  return [
8377
8404
  4,
8378
- client.responses.create(_object_spread_props(_object_spread({
8379
- conversation: threadId,
8380
- input: input,
8381
- instructions: openaiAssistant.instructions,
8382
- model: openaiAssistant.model,
8383
- // metadata,
8384
- stream: stream
8385
- }, serializeTools3({
8386
- tools: openaiAssistant.tools
8387
- })), {
8388
- truncation: truncation2({
8389
- openaiAssistant: openaiAssistant
8390
- })
8391
- }))
8405
+ client.responses.create(responseBody)
8392
8406
  ];
8393
8407
  case 3:
8394
8408
  response = _state.sent();
@@ -8602,6 +8616,404 @@ var responsesStorageAdapter = function() {
8602
8616
  };
8603
8617
  };
8604
8618
  };
8619
+ // src/lib/responses/responseRegexp.ts
8620
+ var responseRegexp = "^/(?:v1|/?openai)/responses/([^/]+)$";
8621
+ // src/adapters/storage/azureResponsesStorageAdapter/threads/runs/post.ts
8622
+ import { uid as uid8 } from "radash";
8623
+ import dayjs21 from "dayjs";
8624
+ import { assign as assign9 } from "radash";
8625
+ var post20 = function(param) {
8626
+ var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
8627
+ return function(urlString, options) {
8628
+ return _async_to_generator(function() {
8629
+ var url, _url_pathname_match, threadId, body, assistant_id, stream, assistantId, openaiAssistant, _assign9, model, instructions, // additional_instructions,
8630
+ tools, metadata, response_format, truncation_strategy, azureAgentId, shouldSendInstructions, responseBody, normalizedText, response, readableStream, _nonStreamResponse_output, nonStreamResponse, itemIds, data;
8631
+ return _ts_generator(this, function(_state) {
8632
+ switch(_state.label){
8633
+ case 0:
8634
+ url = new URL(urlString);
8635
+ _url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(runsRegexp)), 2), threadId = _url_pathname_match[1];
8636
+ if (typeof options.body !== "string") {
8637
+ throw new Error("Request body is required");
8638
+ }
8639
+ body = JSON.parse(options.body);
8640
+ assistant_id = body.assistant_id, stream = body.stream;
8641
+ assistantId = typeof assistant_id === "string" ? assistant_id.trim() : "";
8642
+ return [
8643
+ 4,
8644
+ runAdapter.getOpenaiAssistant()
8645
+ ];
8646
+ case 1:
8647
+ openaiAssistant = _state.sent();
8648
+ _assign9 = assign9(_object_spread({}, defaultAssistant, openaiAssistant), body), model = _assign9.model, instructions = _assign9.instructions, tools = _assign9.tools, metadata = _assign9.metadata, response_format = _assign9.response_format, truncation_strategy = _assign9.truncation_strategy;
8649
+ azureAgentId = openaiAssistant && (typeof openaiAssistant === "undefined" ? "undefined" : _type_of(openaiAssistant)) === "object" && typeof openaiAssistant.id === "string" && typeof openaiAssistant.name === "string" && openaiAssistant.id.trim().length > 0 && openaiAssistant.id === openaiAssistant.name && openaiAssistant.id === assistantId ? openaiAssistant.id : void 0;
8650
+ shouldSendInstructions = !azureAgentId && typeof instructions === "string" && instructions.trim().length > 0;
8651
+ responseBody = {
8652
+ conversation: threadId,
8653
+ stream: stream,
8654
+ input: createResponseItems
8655
+ };
8656
+ if (azureAgentId) {
8657
+ responseBody.agent = {
8658
+ name: azureAgentId,
8659
+ type: "agent_reference"
8660
+ };
8661
+ }
8662
+ if (!azureAgentId) {
8663
+ responseBody.model = model;
8664
+ responseBody.metadata = metadata;
8665
+ Object.assign(responseBody, serializeTools2({
8666
+ tools: tools
8667
+ }));
8668
+ responseBody.truncation = truncation({
8669
+ truncation_strategy: truncation_strategy
8670
+ });
8671
+ normalizedText = textConfig({
8672
+ response_format: response_format
8673
+ });
8674
+ if (normalizedText) {
8675
+ responseBody.text = normalizedText;
8676
+ }
8677
+ } else if (metadata && Object.keys(metadata).length > 0) {
8678
+ responseBody.metadata = metadata;
8679
+ }
8680
+ if (shouldSendInstructions && typeof instructions === "string") {
8681
+ responseBody.instructions = instructions;
8682
+ }
8683
+ return [
8684
+ 4,
8685
+ client.responses.create(responseBody)
8686
+ ];
8687
+ case 2:
8688
+ response = _state.sent();
8689
+ readableStream = new ReadableStream({
8690
+ start: function start(controller) {
8691
+ return _async_to_generator(function() {
8692
+ var error, _ref, _ref1, _error_cause, event;
8693
+ return _ts_generator(this, function(_state) {
8694
+ switch(_state.label){
8695
+ case 0:
8696
+ _state.trys.push([
8697
+ 0,
8698
+ 2,
8699
+ ,
8700
+ 3
8701
+ ]);
8702
+ return [
8703
+ 4,
8704
+ runAdapter.handleRun({
8705
+ threadId: threadId,
8706
+ response: response,
8707
+ onEvent: function(event) {
8708
+ return _async_to_generator(function() {
8709
+ return _ts_generator(this, function(_state) {
8710
+ return [
8711
+ 2,
8712
+ controller.enqueue("data: ".concat(JSON.stringify(event), "\n\n"))
8713
+ ];
8714
+ });
8715
+ })();
8716
+ }
8717
+ })
8718
+ ];
8719
+ case 1:
8720
+ _state.sent();
8721
+ return [
8722
+ 3,
8723
+ 3
8724
+ ];
8725
+ case 2:
8726
+ error = _state.sent();
8727
+ console.error(error);
8728
+ event = {
8729
+ event: "thread.run.failed",
8730
+ data: {
8731
+ id: uid8(24),
8732
+ failed_at: dayjs21().unix(),
8733
+ last_error: {
8734
+ code: "server_error",
8735
+ message: "".concat((_ref = error === null || error === void 0 ? void 0 : error.message) !== null && _ref !== void 0 ? _ref : "", " ").concat((_ref1 = error === null || error === void 0 ? void 0 : (_error_cause = error.cause) === null || _error_cause === void 0 ? void 0 : _error_cause.message) !== null && _ref1 !== void 0 ? _ref1 : "")
8736
+ }
8737
+ }
8738
+ };
8739
+ controller.enqueue("data: ".concat(JSON.stringify(event), "\n\n"));
8740
+ return [
8741
+ 3,
8742
+ 3
8743
+ ];
8744
+ case 3:
8745
+ controller.close();
8746
+ return [
8747
+ 2
8748
+ ];
8749
+ }
8750
+ });
8751
+ })();
8752
+ }
8753
+ });
8754
+ if (!stream) return [
8755
+ 3,
8756
+ 3
8757
+ ];
8758
+ return [
8759
+ 2,
8760
+ new Response(readableStream, {
8761
+ headers: {
8762
+ "Content-Type": "text/event-stream"
8763
+ }
8764
+ })
8765
+ ];
8766
+ case 3:
8767
+ nonStreamResponse = response;
8768
+ itemIds = ((_nonStreamResponse_output = nonStreamResponse.output) !== null && _nonStreamResponse_output !== void 0 ? _nonStreamResponse_output : []).filter(function(o) {
8769
+ return o.id;
8770
+ }).map(function(o) {
8771
+ return o.id;
8772
+ });
8773
+ if (!(itemIds.length > 0)) return [
8774
+ 3,
8775
+ 5
8776
+ ];
8777
+ return [
8778
+ 4,
8779
+ saveResponseItemsToConversationMetadata({
8780
+ client: client,
8781
+ threadId: threadId,
8782
+ responseId: nonStreamResponse.id,
8783
+ itemIds: itemIds
8784
+ })
8785
+ ];
8786
+ case 4:
8787
+ _state.sent();
8788
+ _state.label = 5;
8789
+ case 5:
8790
+ data = serializeResponseAsRun({
8791
+ response: nonStreamResponse,
8792
+ assistantId: assistant_id
8793
+ });
8794
+ return [
8795
+ 2,
8796
+ new Response(JSON.stringify(data), {
8797
+ status: 200,
8798
+ headers: {
8799
+ "Content-Type": "application/json"
8800
+ }
8801
+ })
8802
+ ];
8803
+ case 6:
8804
+ return [
8805
+ 2
8806
+ ];
8807
+ }
8808
+ });
8809
+ })();
8810
+ };
8811
+ };
8812
+ // src/adapters/storage/azureResponsesStorageAdapter/threads/runs/index.ts
8813
+ var runs3 = function(param) {
8814
+ var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
8815
+ return {
8816
+ get: get16(),
8817
+ post: post20({
8818
+ client: client,
8819
+ createResponseItems: createResponseItems,
8820
+ runAdapter: runAdapter
8821
+ })
8822
+ };
8823
+ };
8824
+ // src/adapters/storage/azureResponsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
8825
+ var post21 = function(param) {
8826
+ var client = param.client, runAdapter = param.runAdapter;
8827
+ return function(urlString, options) {
8828
+ return _async_to_generator(function() {
8829
+ var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, toolCallOutputItems, input, previousResponse, openaiAssistant, azureAgentId, shouldSendInstructions, responseBody, response, readableStream;
8830
+ return _ts_generator(this, function(_state) {
8831
+ switch(_state.label){
8832
+ case 0:
8833
+ url = new URL(urlString);
8834
+ _url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(submitToolOutputsRegexp)), 3), threadId = _url_pathname_match[1], runId = _url_pathname_match[2];
8835
+ body = JSON.parse(options.body);
8836
+ tool_outputs = body.tool_outputs, stream = body.stream;
8837
+ toolCallOutputItems = getToolCallOutputItems({
8838
+ tool_outputs: tool_outputs
8839
+ });
8840
+ input = _to_consumable_array(toolCallOutputItems.functionCallOutputItems).concat(_to_consumable_array(toolCallOutputItems.computerCallOutputItems));
8841
+ return [
8842
+ 4,
8843
+ client.responses.retrieve(runId)
8844
+ ];
8845
+ case 1:
8846
+ previousResponse = _state.sent();
8847
+ return [
8848
+ 4,
8849
+ runAdapter.getOpenaiAssistant()
8850
+ ];
8851
+ case 2:
8852
+ openaiAssistant = _state.sent();
8853
+ azureAgentId = openaiAssistant && (typeof openaiAssistant === "undefined" ? "undefined" : _type_of(openaiAssistant)) === "object" && typeof openaiAssistant.id === "string" && typeof openaiAssistant.name === "string" && openaiAssistant.id.trim().length > 0 && openaiAssistant.id === openaiAssistant.name ? openaiAssistant.id : void 0;
8854
+ shouldSendInstructions = !azureAgentId && typeof openaiAssistant.instructions === "string" && openaiAssistant.instructions.trim().length > 0;
8855
+ responseBody = {
8856
+ conversation: threadId,
8857
+ stream: stream,
8858
+ input: input
8859
+ };
8860
+ if (azureAgentId) {
8861
+ responseBody.agent = {
8862
+ name: azureAgentId,
8863
+ type: "agent_reference"
8864
+ };
8865
+ }
8866
+ if (!azureAgentId) {
8867
+ responseBody.model = openaiAssistant.model;
8868
+ Object.assign(responseBody, serializeTools3({
8869
+ tools: openaiAssistant.tools
8870
+ }));
8871
+ responseBody.truncation = truncation2({
8872
+ openaiAssistant: openaiAssistant
8873
+ });
8874
+ }
8875
+ if (shouldSendInstructions && typeof openaiAssistant.instructions === "string") {
8876
+ responseBody.instructions = openaiAssistant.instructions;
8877
+ }
8878
+ return [
8879
+ 4,
8880
+ client.responses.create(responseBody)
8881
+ ];
8882
+ case 3:
8883
+ response = _state.sent();
8884
+ readableStream = new ReadableStream({
8885
+ start: function start(controller) {
8886
+ return _async_to_generator(function() {
8887
+ return _ts_generator(this, function(_state) {
8888
+ switch(_state.label){
8889
+ case 0:
8890
+ toolCallOutputItems.functionCallOutputItems.forEach(function(item) {
8891
+ var toolCallItem = previousResponse.output.find(function(i) {
8892
+ return i.type === "function_call" && i.call_id === item.call_id;
8893
+ });
8894
+ if (!toolCallItem) {
8895
+ return;
8896
+ }
8897
+ controller.enqueue("data: ".concat(JSON.stringify({
8898
+ event: "thread.run.step.completed",
8899
+ data: serializeItemAsFunctionCallRunStep({
8900
+ item: toolCallItem,
8901
+ items: toolCallOutputItems.functionCallOutputItems,
8902
+ threadId: threadId,
8903
+ openaiAssistant: openaiAssistant,
8904
+ runId: runId
8905
+ })
8906
+ }), "\n\n"));
8907
+ });
8908
+ toolCallOutputItems.computerCallOutputItems.forEach(function(item) {
8909
+ var toolCallItem = previousResponse.output.find(function(i) {
8910
+ return i.type === "computer_call" && i.call_id === item.call_id;
8911
+ });
8912
+ if (!toolCallItem) {
8913
+ return;
8914
+ }
8915
+ controller.enqueue("data: ".concat(JSON.stringify({
8916
+ event: "thread.run.step.completed",
8917
+ data: serializeItemAsComputerCallRunStep({
8918
+ item: toolCallItem,
8919
+ items: toolCallOutputItems.computerCallOutputItems,
8920
+ threadId: threadId,
8921
+ openaiAssistant: openaiAssistant,
8922
+ runId: runId
8923
+ })
8924
+ }), "\n\n"));
8925
+ });
8926
+ return [
8927
+ 4,
8928
+ runAdapter.handleRun({
8929
+ threadId: threadId,
8930
+ response: response,
8931
+ onEvent: function(event) {
8932
+ return _async_to_generator(function() {
8933
+ return _ts_generator(this, function(_state) {
8934
+ return [
8935
+ 2,
8936
+ controller.enqueue("data: ".concat(JSON.stringify(event), "\n\n"))
8937
+ ];
8938
+ });
8939
+ })();
8940
+ }
8941
+ })
8942
+ ];
8943
+ case 1:
8944
+ _state.sent();
8945
+ controller.close();
8946
+ return [
8947
+ 2
8948
+ ];
8949
+ }
8950
+ });
8951
+ })();
8952
+ }
8953
+ });
8954
+ return [
8955
+ 2,
8956
+ new Response(readableStream, {
8957
+ headers: {
8958
+ "Content-Type": "text/event-stream"
8959
+ }
8960
+ })
8961
+ ];
8962
+ }
8963
+ });
8964
+ })();
8965
+ };
8966
+ };
8967
+ // src/adapters/storage/azureResponsesStorageAdapter/threads/runs/submitToolOutputs/index.ts
8968
+ var submitToolOutputs3 = function(param) {
8969
+ var client = param.client, runAdapter = param.runAdapter;
8970
+ return {
8971
+ post: post21({
8972
+ client: client,
8973
+ runAdapter: runAdapter
8974
+ })
8975
+ };
8976
+ };
8977
+ // src/adapters/storage/azureResponsesStorageAdapter/responses/get.ts
8978
+ var get20 = function(param) {
8979
+ var client = param.client;
8980
+ return function(urlString) {
8981
+ return _async_to_generator(function() {
8982
+ var url, _url_pathname_match, responseId2, response;
8983
+ return _ts_generator(this, function(_state) {
8984
+ switch(_state.label){
8985
+ case 0:
8986
+ url = new URL(urlString);
8987
+ _url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(responseRegexp)), 2), responseId2 = _url_pathname_match[1];
8988
+ return [
8989
+ 4,
8990
+ client.responses.retrieve(responseId2)
8991
+ ];
8992
+ case 1:
8993
+ response = _state.sent();
8994
+ return [
8995
+ 2,
8996
+ new Response(JSON.stringify(response), {
8997
+ status: 200,
8998
+ headers: {
8999
+ "Content-Type": "application/json"
9000
+ }
9001
+ })
9002
+ ];
9003
+ }
9004
+ });
9005
+ })();
9006
+ };
9007
+ };
9008
+ // src/adapters/storage/azureResponsesStorageAdapter/responses/index.ts
9009
+ var responses = function(param) {
9010
+ var client = param.client;
9011
+ return {
9012
+ get: get20({
9013
+ client: client
9014
+ })
9015
+ };
9016
+ };
8605
9017
  // src/adapters/storage/azureResponsesStorageAdapter/index.ts
8606
9018
  var azureResponsesStorageAdapter = function() {
8607
9019
  var createResponseItems = [];
@@ -8616,7 +9028,7 @@ var azureResponsesStorageAdapter = function() {
8616
9028
  };
8617
9029
  var getAzureClient = function() {
8618
9030
  return _async_to_generator(function() {
8619
- var aiProjectClient, _azureClient_apiKey, azureClient;
9031
+ var _aiProjectClient__options, aiProjectClient, apiVersion, _azureClient_apiKey, azureClient, _azureClient_apiKey1, azureClient1;
8620
9032
  return _ts_generator(this, function(_state) {
8621
9033
  switch(_state.label){
8622
9034
  case 0:
@@ -8630,14 +9042,17 @@ var azureResponsesStorageAdapter = function() {
8630
9042
  }
8631
9043
  aiProjectClient = getAIProjectClient();
8632
9044
  console.log("[azureResponsesStorageAdapter] aiProjectClient obtained");
8633
- if (!(aiProjectClient && (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" && "getOpenAIClient" in aiProjectClient && typeof aiProjectClient.getOpenAIClient === "function")) return [
9045
+ apiVersion = (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" ? (_aiProjectClient__options = aiProjectClient._options) === null || _aiProjectClient__options === void 0 ? void 0 : _aiProjectClient__options.apiVersion : void 0;
9046
+ if (!(aiProjectClient && (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" && "getAzureOpenAIClient" in aiProjectClient && typeof aiProjectClient.getAzureOpenAIClient === "function")) return [
8634
9047
  3,
8635
9048
  2
8636
9049
  ];
8637
- console.log("[azureResponsesStorageAdapter] Calling getOpenAIClient()");
9050
+ console.log("[azureResponsesStorageAdapter] Calling getAzureOpenAIClient()");
8638
9051
  return [
8639
9052
  4,
8640
- aiProjectClient.getOpenAIClient()
9053
+ aiProjectClient.getAzureOpenAIClient(apiVersion ? {
9054
+ apiVersion: apiVersion
9055
+ } : void 0)
8641
9056
  ];
8642
9057
  case 1:
8643
9058
  azureClient = _state.sent();
@@ -8650,6 +9065,28 @@ var azureResponsesStorageAdapter = function() {
8650
9065
  azureClient
8651
9066
  ];
8652
9067
  case 2:
9068
+ if (!(aiProjectClient && (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" && "getOpenAIClient" in aiProjectClient && typeof aiProjectClient.getOpenAIClient === "function")) return [
9069
+ 3,
9070
+ 4
9071
+ ];
9072
+ console.log("[azureResponsesStorageAdapter] Calling getOpenAIClient()");
9073
+ return [
9074
+ 4,
9075
+ aiProjectClient.getOpenAIClient(apiVersion ? {
9076
+ apiVersion: apiVersion
9077
+ } : void 0)
9078
+ ];
9079
+ case 3:
9080
+ azureClient1 = _state.sent();
9081
+ console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
9082
+ console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient1.baseURL);
9083
+ console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey1 = azureClient1.apiKey) === null || _azureClient_apiKey1 === void 0 ? void 0 : _azureClient_apiKey1.substring(0, 20)) + "...");
9084
+ cachedClient = azureClient1;
9085
+ return [
9086
+ 2,
9087
+ azureClient1
9088
+ ];
9089
+ case 4:
8653
9090
  console.log("[azureResponsesStorageAdapter] Not an AIProjectClient, treating as OpenAI client");
8654
9091
  cachedClient = aiProjectClient;
8655
9092
  return [
@@ -8661,6 +9098,7 @@ var azureResponsesStorageAdapter = function() {
8661
9098
  })();
8662
9099
  };
8663
9100
  var wrappedRunAdapter = _object_spread_props(_object_spread({}, runAdapter), {
9101
+ getOpenaiAssistant: runAdapter.getOpenaiAssistant,
8664
9102
  handleRun: function(args) {
8665
9103
  return _async_to_generator(function() {
8666
9104
  var azureClient;
@@ -8777,7 +9215,7 @@ var azureResponsesStorageAdapter = function() {
8777
9215
  }, _define_property(_obj, messagesRegexp, createWrappedHandlers(messages3, [
8778
9216
  "get",
8779
9217
  "post"
8780
- ])), _define_property(_obj, runsRegexp, createWrappedHandlers(runs2, [
9218
+ ])), _define_property(_obj, runsRegexp, createWrappedHandlers(runs3, [
8781
9219
  "get",
8782
9220
  "post"
8783
9221
  ])), // Added GET for runs.list()
@@ -8785,15 +9223,17 @@ var azureResponsesStorageAdapter = function() {
8785
9223
  "get"
8786
9224
  ])), _define_property(_obj, stepsRegexp, createWrappedHandlers(steps2, [
8787
9225
  "get"
8788
- ])), _define_property(_obj, submitToolOutputsRegexp, createWrappedHandlers(submitToolOutputs2, [
9226
+ ])), _define_property(_obj, submitToolOutputsRegexp, createWrappedHandlers(submitToolOutputs3, [
8789
9227
  "post"
9228
+ ])), _define_property(_obj, responseRegexp, createWrappedHandlers(responses, [
9229
+ "get"
8790
9230
  ])), _obj)
8791
9231
  };
8792
9232
  };
8793
9233
  };
8794
9234
  // src/adapters/storage/azureAgentsStorageAdapter/threads/post.ts
8795
- import dayjs21 from "dayjs";
8796
- var post20 = function(param) {
9235
+ import dayjs22 from "dayjs";
9236
+ var post22 = function(param) {
8797
9237
  var azureAiProject = param.azureAiProject;
8798
9238
  return function(_urlString, options) {
8799
9239
  return _async_to_generator(function() {
@@ -8817,7 +9257,7 @@ var post20 = function(param) {
8817
9257
  openaiThread = {
8818
9258
  id: thread.id,
8819
9259
  object: "thread",
8820
- created_at: dayjs21(thread.createdAt).unix(),
9260
+ created_at: dayjs22(thread.createdAt).unix(),
8821
9261
  metadata: thread.metadata || {},
8822
9262
  tool_resources: null
8823
9263
  };
@@ -8839,14 +9279,14 @@ var post20 = function(param) {
8839
9279
  var threads3 = function(param) {
8840
9280
  var azureAiProject = param.azureAiProject;
8841
9281
  return {
8842
- post: post20({
9282
+ post: post22({
8843
9283
  azureAiProject: azureAiProject
8844
9284
  })
8845
9285
  };
8846
9286
  };
8847
9287
  // src/adapters/storage/azureAgentsStorageAdapter/threads/messages/post.ts
8848
- import dayjs22 from "dayjs";
8849
- var post21 = function(param) {
9288
+ import dayjs23 from "dayjs";
9289
+ var post23 = function(param) {
8850
9290
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
8851
9291
  return function(urlString, options) {
8852
9292
  return _async_to_generator(function() {
@@ -8883,7 +9323,7 @@ var post21 = function(param) {
8883
9323
  openaiMessage = {
8884
9324
  id: message.id,
8885
9325
  object: "thread.message",
8886
- created_at: dayjs22(message.createdAt).unix(),
9326
+ created_at: dayjs23(message.createdAt).unix(),
8887
9327
  thread_id: message.threadId,
8888
9328
  role: message.role,
8889
9329
  content: message.content.map(function(c) {
@@ -8940,7 +9380,7 @@ var post21 = function(param) {
8940
9380
  attachments: [],
8941
9381
  metadata: message.metadata || {},
8942
9382
  status: "completed",
8943
- completed_at: dayjs22(message.createdAt).unix(),
9383
+ completed_at: dayjs23(message.createdAt).unix(),
8944
9384
  incomplete_at: null,
8945
9385
  incomplete_details: null
8946
9386
  };
@@ -8959,8 +9399,8 @@ var post21 = function(param) {
8959
9399
  };
8960
9400
  };
8961
9401
  // src/adapters/storage/azureAgentsStorageAdapter/threads/messages/get.ts
8962
- import dayjs23 from "dayjs";
8963
- var get20 = function(param) {
9402
+ import dayjs24 from "dayjs";
9403
+ var get21 = function(param) {
8964
9404
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
8965
9405
  return function(urlString) {
8966
9406
  return _async_to_generator(function() {
@@ -9008,7 +9448,7 @@ var get20 = function(param) {
9008
9448
  messagesList.push({
9009
9449
  id: message.id,
9010
9450
  object: "thread.message",
9011
- created_at: dayjs23(message.createdAt).unix(),
9451
+ created_at: dayjs24(message.createdAt).unix(),
9012
9452
  thread_id: message.threadId,
9013
9453
  role: message.role,
9014
9454
  content: message.content.map(function(c) {
@@ -9065,7 +9505,7 @@ var get20 = function(param) {
9065
9505
  attachments: [],
9066
9506
  metadata: message.metadata || {},
9067
9507
  status: "completed",
9068
- completed_at: dayjs23(message.createdAt).unix(),
9508
+ completed_at: dayjs24(message.createdAt).unix(),
9069
9509
  incomplete_at: null,
9070
9510
  incomplete_details: null
9071
9511
  });
@@ -9148,18 +9588,18 @@ var get20 = function(param) {
9148
9588
  var messages4 = function(param) {
9149
9589
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
9150
9590
  return {
9151
- post: post21({
9591
+ post: post23({
9152
9592
  azureAiProject: azureAiProject,
9153
9593
  runAdapter: runAdapter
9154
9594
  }),
9155
- get: get20({
9595
+ get: get21({
9156
9596
  azureAiProject: azureAiProject,
9157
9597
  runAdapter: runAdapter
9158
9598
  })
9159
9599
  };
9160
9600
  };
9161
9601
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/get.ts
9162
- var get21 = function() {
9602
+ var get22 = function() {
9163
9603
  return function() {
9164
9604
  return _async_to_generator(function() {
9165
9605
  var response;
@@ -9184,9 +9624,9 @@ var get21 = function() {
9184
9624
  };
9185
9625
  };
9186
9626
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/post.ts
9187
- import { uid as uid8 } from "radash";
9188
- import dayjs24 from "dayjs";
9189
- var post22 = function(param) {
9627
+ import { uid as uid9 } from "radash";
9628
+ import dayjs25 from "dayjs";
9629
+ var post24 = function(param) {
9190
9630
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
9191
9631
  return function(urlString, options) {
9192
9632
  return _async_to_generator(function() {
@@ -9253,8 +9693,8 @@ var post22 = function(param) {
9253
9693
  event = {
9254
9694
  event: "thread.run.failed",
9255
9695
  data: {
9256
- id: uid8(24),
9257
- failed_at: dayjs24().unix(),
9696
+ id: uid9(24),
9697
+ failed_at: dayjs25().unix(),
9258
9698
  last_error: {
9259
9699
  code: "server_error",
9260
9700
  message: "".concat((_ref = error === null || error === void 0 ? void 0 : error.message) !== null && _ref !== void 0 ? _ref : "", " ").concat((_ref1 = error === null || error === void 0 ? void 0 : (_error_cause = error.cause) === null || _error_cause === void 0 ? void 0 : _error_cause.message) !== null && _ref1 !== void 0 ? _ref1 : "")
@@ -9404,14 +9844,14 @@ var post22 = function(param) {
9404
9844
  runData = {
9405
9845
  id: azureRun.id,
9406
9846
  object: "thread.run",
9407
- created_at: dayjs24(azureRun.createdAt).unix(),
9847
+ created_at: dayjs25(azureRun.createdAt).unix(),
9408
9848
  thread_id: azureRun.threadId,
9409
9849
  assistant_id: azureAgentId,
9410
9850
  status: azureRun.status,
9411
9851
  required_action: null,
9412
9852
  last_error: null,
9413
9853
  expires_at: null,
9414
- started_at: azureRun.status === "in_progress" ? dayjs24(azureRun.createdAt).unix() : null,
9854
+ started_at: azureRun.status === "in_progress" ? dayjs25(azureRun.createdAt).unix() : null,
9415
9855
  cancelled_at: null,
9416
9856
  failed_at: null,
9417
9857
  completed_at: null,
@@ -9452,19 +9892,19 @@ var post22 = function(param) {
9452
9892
  };
9453
9893
  };
9454
9894
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/index.ts
9455
- var runs3 = function(param) {
9895
+ var runs4 = function(param) {
9456
9896
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
9457
9897
  return {
9458
- get: get21(),
9459
- post: post22({
9898
+ get: get22(),
9899
+ post: post24({
9460
9900
  azureAiProject: azureAiProject,
9461
9901
  runAdapter: runAdapter
9462
9902
  })
9463
9903
  };
9464
9904
  };
9465
9905
  // src/adapters/storage/azureAgentsStorageAdapter/threads/run/get.ts
9466
- import dayjs25 from "dayjs";
9467
- var get22 = function(param) {
9906
+ import dayjs26 from "dayjs";
9907
+ var get23 = function(param) {
9468
9908
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
9469
9909
  return function(urlString) {
9470
9910
  return _async_to_generator(function() {
@@ -9484,7 +9924,7 @@ var get22 = function(param) {
9484
9924
  openaiRun = {
9485
9925
  id: azureRun.id,
9486
9926
  object: "thread.run",
9487
- created_at: dayjs25(azureRun.createdAt).unix(),
9927
+ created_at: dayjs26(azureRun.createdAt).unix(),
9488
9928
  thread_id: azureRun.threadId,
9489
9929
  assistant_id: assistantId,
9490
9930
  status: azureRun.status,
@@ -9508,10 +9948,10 @@ var get22 = function(param) {
9508
9948
  message: JSON.stringify(azureRun.lastError)
9509
9949
  } : null,
9510
9950
  expires_at: null,
9511
- started_at: dayjs25(azureRun.createdAt).unix(),
9951
+ started_at: dayjs26(azureRun.createdAt).unix(),
9512
9952
  cancelled_at: null,
9513
- failed_at: azureRun.status === "failed" ? dayjs25().unix() : null,
9514
- completed_at: azureRun.status === "completed" ? dayjs25().unix() : null,
9953
+ failed_at: azureRun.status === "failed" ? dayjs26().unix() : null,
9954
+ completed_at: azureRun.status === "completed" ? dayjs26().unix() : null,
9515
9955
  incomplete_details: null,
9516
9956
  model: "",
9517
9957
  instructions: "",
@@ -9548,15 +9988,15 @@ var get22 = function(param) {
9548
9988
  var run3 = function(param) {
9549
9989
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
9550
9990
  return {
9551
- get: get22({
9991
+ get: get23({
9552
9992
  azureAiProject: azureAiProject,
9553
9993
  runAdapter: runAdapter
9554
9994
  })
9555
9995
  };
9556
9996
  };
9557
9997
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/steps/get.ts
9558
- import dayjs26 from "dayjs";
9559
- var get23 = function(param) {
9998
+ import dayjs27 from "dayjs";
9999
+ var get24 = function(param) {
9560
10000
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
9561
10001
  return function(urlString) {
9562
10002
  return _async_to_generator(function() {
@@ -9616,7 +10056,7 @@ var get23 = function(param) {
9616
10056
  stepsList.push({
9617
10057
  id: step.id,
9618
10058
  object: "thread.run.step",
9619
- created_at: dayjs26(step.createdAt).unix(),
10059
+ created_at: dayjs27(step.createdAt).unix(),
9620
10060
  assistant_id: assistantId,
9621
10061
  thread_id: threadId,
9622
10062
  run_id: runId,
@@ -9684,7 +10124,7 @@ var get23 = function(param) {
9684
10124
  expired_at: null,
9685
10125
  cancelled_at: null,
9686
10126
  failed_at: null,
9687
- completed_at: step.completedAt ? dayjs26(step.completedAt).unix() : null,
10127
+ completed_at: step.completedAt ? dayjs27(step.completedAt).unix() : null,
9688
10128
  metadata: step.metadata || {},
9689
10129
  usage: null
9690
10130
  });
@@ -9767,7 +10207,7 @@ var get23 = function(param) {
9767
10207
  var steps3 = function(param) {
9768
10208
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
9769
10209
  return {
9770
- get: get23({
10210
+ get: get24({
9771
10211
  azureAiProject: azureAiProject,
9772
10212
  runAdapter: runAdapter,
9773
10213
  prisma: prisma
@@ -9775,7 +10215,7 @@ var steps3 = function(param) {
9775
10215
  };
9776
10216
  };
9777
10217
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
9778
- import dayjs27 from "dayjs";
10218
+ import dayjs28 from "dayjs";
9779
10219
  function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9780
10220
  var event = azureEvent.event, data = azureEvent.data;
9781
10221
  var eventType = event;
@@ -9787,7 +10227,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9787
10227
  data: {
9788
10228
  id: data.id,
9789
10229
  object: "thread.run",
9790
- created_at: dayjs27(data.createdAt).unix(),
10230
+ created_at: dayjs28(data.createdAt).unix(),
9791
10231
  thread_id: data.threadId,
9792
10232
  assistant_id: assistantId,
9793
10233
  status: data.status,
@@ -9811,10 +10251,10 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9811
10251
  message: JSON.stringify(data.lastError)
9812
10252
  } : null,
9813
10253
  expires_at: null,
9814
- started_at: data.startedAt ? dayjs27(data.startedAt).unix() : null,
9815
- cancelled_at: data.cancelledAt ? dayjs27(data.cancelledAt).unix() : null,
9816
- failed_at: data.failedAt ? dayjs27(data.failedAt).unix() : null,
9817
- completed_at: data.completedAt ? dayjs27(data.completedAt).unix() : null,
10254
+ started_at: data.startedAt ? dayjs28(data.startedAt).unix() : null,
10255
+ cancelled_at: data.cancelledAt ? dayjs28(data.cancelledAt).unix() : null,
10256
+ failed_at: data.failedAt ? dayjs28(data.failedAt).unix() : null,
10257
+ completed_at: data.completedAt ? dayjs28(data.completedAt).unix() : null,
9818
10258
  incomplete_details: null,
9819
10259
  model: data.model || "",
9820
10260
  instructions: data.instructions || "",
@@ -9842,7 +10282,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9842
10282
  data: {
9843
10283
  id: data.id,
9844
10284
  object: "thread.message",
9845
- created_at: dayjs27(data.createdAt).unix(),
10285
+ created_at: dayjs28(data.createdAt).unix(),
9846
10286
  thread_id: data.threadId,
9847
10287
  role: data.role,
9848
10288
  content: ((_data_content = data.content) === null || _data_content === void 0 ? void 0 : _data_content.map(function(c) {
@@ -9863,7 +10303,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9863
10303
  attachments: data.attachments || [],
9864
10304
  metadata: data.metadata || {},
9865
10305
  status: data.status || "completed",
9866
- completed_at: data.completedAt ? dayjs27(data.completedAt).unix() : null,
10306
+ completed_at: data.completedAt ? dayjs28(data.completedAt).unix() : null,
9867
10307
  incomplete_at: null,
9868
10308
  incomplete_details: null
9869
10309
  }
@@ -10064,7 +10504,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
10064
10504
  data: {
10065
10505
  id: data.id,
10066
10506
  object: "thread.run.step",
10067
- created_at: dayjs27(data.createdAt).unix(),
10507
+ created_at: dayjs28(data.createdAt).unix(),
10068
10508
  assistant_id: assistantId,
10069
10509
  thread_id: data.threadId,
10070
10510
  run_id: data.runId,
@@ -10073,9 +10513,9 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
10073
10513
  step_details: stepDetails,
10074
10514
  last_error: data.lastError || null,
10075
10515
  expired_at: null,
10076
- cancelled_at: data.cancelledAt ? dayjs27(data.cancelledAt).unix() : null,
10077
- failed_at: data.failedAt ? dayjs27(data.failedAt).unix() : null,
10078
- completed_at: data.completedAt ? dayjs27(data.completedAt).unix() : null,
10516
+ cancelled_at: data.cancelledAt ? dayjs28(data.cancelledAt).unix() : null,
10517
+ failed_at: data.failedAt ? dayjs28(data.failedAt).unix() : null,
10518
+ completed_at: data.completedAt ? dayjs28(data.completedAt).unix() : null,
10079
10519
  metadata: data.metadata || {},
10080
10520
  usage: null
10081
10521
  }
@@ -10087,7 +10527,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
10087
10527
  data: {
10088
10528
  id: data.id,
10089
10529
  object: "thread",
10090
- created_at: dayjs27(data.createdAt).unix(),
10530
+ created_at: dayjs28(data.createdAt).unix(),
10091
10531
  metadata: data.metadata || {},
10092
10532
  tool_resources: data.toolResources || null
10093
10533
  }
@@ -10095,7 +10535,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
10095
10535
  }
10096
10536
  return null;
10097
10537
  }
10098
- var post23 = function(param) {
10538
+ var post25 = function(param) {
10099
10539
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
10100
10540
  return function(urlString, options) {
10101
10541
  return _async_to_generator(function() {
@@ -10272,7 +10712,7 @@ var post23 = function(param) {
10272
10712
  data: {
10273
10713
  id: runId,
10274
10714
  object: "thread.run",
10275
- created_at: dayjs27().unix(),
10715
+ created_at: dayjs28().unix(),
10276
10716
  thread_id: threadId,
10277
10717
  assistant_id: assistantId,
10278
10718
  status: "failed",
@@ -10282,9 +10722,9 @@ var post23 = function(param) {
10282
10722
  message: "".concat((_ref = error === null || error === void 0 ? void 0 : error.message) !== null && _ref !== void 0 ? _ref : "", " ").concat((_ref1 = error === null || error === void 0 ? void 0 : (_error_cause = error.cause) === null || _error_cause === void 0 ? void 0 : _error_cause.message) !== null && _ref1 !== void 0 ? _ref1 : "")
10283
10723
  },
10284
10724
  expires_at: null,
10285
- started_at: dayjs27().unix(),
10725
+ started_at: dayjs28().unix(),
10286
10726
  cancelled_at: null,
10287
- failed_at: dayjs27().unix(),
10727
+ failed_at: dayjs28().unix(),
10288
10728
  completed_at: null,
10289
10729
  incomplete_details: null,
10290
10730
  model: "",
@@ -10405,10 +10845,10 @@ var post23 = function(param) {
10405
10845
  };
10406
10846
  };
10407
10847
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/submitToolOutputs/index.ts
10408
- var submitToolOutputs3 = function(param) {
10848
+ var submitToolOutputs4 = function(param) {
10409
10849
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
10410
10850
  return {
10411
- post: post23({
10851
+ post: post25({
10412
10852
  azureAiProject: azureAiProject,
10413
10853
  runAdapter: runAdapter,
10414
10854
  prisma: prisma
@@ -10416,7 +10856,7 @@ var submitToolOutputs3 = function(param) {
10416
10856
  };
10417
10857
  };
10418
10858
  // src/adapters/storage/azureAgentsStorageAdapter/assistants/post.ts
10419
- var post24 = function(param) {
10859
+ var post26 = function(param) {
10420
10860
  var runAdapter = param.runAdapter;
10421
10861
  return function(_urlString, options) {
10422
10862
  return _async_to_generator(function() {
@@ -10458,7 +10898,7 @@ var post24 = function(param) {
10458
10898
  var assistants3 = function(param) {
10459
10899
  var runAdapter = param.runAdapter;
10460
10900
  return {
10461
- post: post24({
10901
+ post: post26({
10462
10902
  runAdapter: runAdapter
10463
10903
  })
10464
10904
  };
@@ -10468,24 +10908,24 @@ var fileRegexp = "^/(?:v1|/?openai)/files/([^/]+)$";
10468
10908
  // src/lib/files/fileContentRegexp.ts
10469
10909
  var fileContentRegexp = "^/(?:v1|/?openai)/files/([^/]+)/content$";
10470
10910
  // src/lib/files/transformAzureFile.ts
10471
- import dayjs28 from "dayjs";
10911
+ import dayjs29 from "dayjs";
10472
10912
  var toUnixSeconds = function(value) {
10473
10913
  if (!value) return void 0;
10474
10914
  if (_instanceof(value, Date)) {
10475
- return dayjs28(value).unix();
10915
+ return dayjs29(value).unix();
10476
10916
  }
10477
10917
  if (typeof value === "number") {
10478
10918
  if (value > 9999999999) {
10479
- return dayjs28(value).unix();
10919
+ return dayjs29(value).unix();
10480
10920
  }
10481
10921
  return Math.floor(value);
10482
10922
  }
10483
- var parsed = dayjs28(value);
10923
+ var parsed = dayjs29(value);
10484
10924
  return parsed.isValid() ? parsed.unix() : void 0;
10485
10925
  };
10486
10926
  var transformAzureFile = function(file2) {
10487
10927
  var _toUnixSeconds, _file2_bytes;
10488
- var createdAtUnix = (_toUnixSeconds = toUnixSeconds(file2.createdAt)) !== null && _toUnixSeconds !== void 0 ? _toUnixSeconds : dayjs28().unix();
10928
+ var createdAtUnix = (_toUnixSeconds = toUnixSeconds(file2.createdAt)) !== null && _toUnixSeconds !== void 0 ? _toUnixSeconds : dayjs29().unix();
10489
10929
  var expiresAtUnix = toUnixSeconds(file2.expiresAt);
10490
10930
  var openaiFile = {
10491
10931
  id: file2.id,
@@ -10773,7 +11213,7 @@ var azureAgentsStorageAdapter = function(param) {
10773
11213
  }, _define_property(_obj, messagesRegexp, messages4({
10774
11214
  azureAiProject: azureAiProject,
10775
11215
  runAdapter: runAdapter
10776
- })), _define_property(_obj, runsRegexp, runs3({
11216
+ })), _define_property(_obj, runsRegexp, runs4({
10777
11217
  azureAiProject: azureAiProject,
10778
11218
  runAdapter: runAdapter
10779
11219
  })), _define_property(_obj, runRegexp, run3({
@@ -10783,7 +11223,7 @@ var azureAgentsStorageAdapter = function(param) {
10783
11223
  azureAiProject: azureAiProject,
10784
11224
  runAdapter: runAdapter,
10785
11225
  prisma: prisma
10786
- })), _define_property(_obj, submitToolOutputsRegexp, submitToolOutputs3({
11226
+ })), _define_property(_obj, submitToolOutputsRegexp, submitToolOutputs4({
10787
11227
  azureAiProject: azureAiProject,
10788
11228
  runAdapter: runAdapter,
10789
11229
  prisma: prisma
@@ -10796,8 +11236,8 @@ var azureAgentsStorageAdapter = function(param) {
10796
11236
  };
10797
11237
  };
10798
11238
  // src/adapters/run/responsesRunAdapter/index.ts
10799
- import dayjs29 from "dayjs";
10800
- import { uid as uid9 } from "radash";
11239
+ import dayjs30 from "dayjs";
11240
+ import { uid as uid10 } from "radash";
10801
11241
  var serializeToolCalls2 = function(param) {
10802
11242
  var toolCalls = param.toolCalls;
10803
11243
  return toolCalls.map(function(toolCall) {
@@ -11144,7 +11584,7 @@ var responsesRunAdapter = function(param) {
11144
11584
  4,
11145
11585
  onEvent2.apply(void 0, [
11146
11586
  (_tmp6.data = serializeItemAsMessage.apply(void 0, [
11147
- (_tmp7.openaiAssistant = _state.sent(), _tmp7.createdAt = dayjs29().unix(), _tmp7.runId = responseCreatedResponse.id, _tmp7.status = "in_progress", _tmp7)
11587
+ (_tmp7.openaiAssistant = _state.sent(), _tmp7.createdAt = dayjs30().unix(), _tmp7.runId = responseCreatedResponse.id, _tmp7.status = "in_progress", _tmp7)
11148
11588
  ]), _tmp6)
11149
11589
  ])
11150
11590
  ];
@@ -11241,7 +11681,7 @@ var responsesRunAdapter = function(param) {
11241
11681
  4,
11242
11682
  onEvent2.apply(void 0, [
11243
11683
  (_tmp12.data = serializeItemAsMessage.apply(void 0, [
11244
- (_tmp13.openaiAssistant = _state.sent(), _tmp13.createdAt = dayjs29().unix(), _tmp13.runId = responseCreatedResponse.id, _tmp13.status = "in_progress", _tmp13)
11684
+ (_tmp13.openaiAssistant = _state.sent(), _tmp13.createdAt = dayjs30().unix(), _tmp13.runId = responseCreatedResponse.id, _tmp13.status = "in_progress", _tmp13)
11245
11685
  ]), _tmp12)
11246
11686
  ])
11247
11687
  ];
@@ -11328,7 +11768,7 @@ var responsesRunAdapter = function(param) {
11328
11768
  4,
11329
11769
  onEvent2.apply(void 0, [
11330
11770
  (_tmp18.data = serializeItemAsMessage.apply(void 0, [
11331
- (_tmp19.openaiAssistant = _state.sent(), _tmp19.createdAt = dayjs29().unix(), _tmp19.runId = responseCreatedResponse.id, _tmp19.status = "in_progress", _tmp19)
11771
+ (_tmp19.openaiAssistant = _state.sent(), _tmp19.createdAt = dayjs30().unix(), _tmp19.runId = responseCreatedResponse.id, _tmp19.status = "in_progress", _tmp19)
11332
11772
  ]), _tmp18)
11333
11773
  ])
11334
11774
  ];
@@ -11414,7 +11854,7 @@ var responsesRunAdapter = function(param) {
11414
11854
  4,
11415
11855
  onEvent2.apply(void 0, [
11416
11856
  (_tmp24.data = serializeItemAsMessage.apply(void 0, [
11417
- (_tmp25.openaiAssistant = _state.sent(), _tmp25.createdAt = dayjs29().unix(), _tmp25.runId = responseCreatedResponse.id, _tmp25.status = "in_progress", _tmp25)
11857
+ (_tmp25.openaiAssistant = _state.sent(), _tmp25.createdAt = dayjs30().unix(), _tmp25.runId = responseCreatedResponse.id, _tmp25.status = "in_progress", _tmp25)
11418
11858
  ]), _tmp24)
11419
11859
  ])
11420
11860
  ];
@@ -11500,7 +11940,7 @@ var responsesRunAdapter = function(param) {
11500
11940
  4,
11501
11941
  onEvent2.apply(void 0, [
11502
11942
  (_tmp30.data = serializeItemAsMessage.apply(void 0, [
11503
- (_tmp31.openaiAssistant = _state.sent(), _tmp31.createdAt = dayjs29().unix(), _tmp31.runId = responseCreatedResponse.id, _tmp31.status = "in_progress", _tmp31)
11943
+ (_tmp31.openaiAssistant = _state.sent(), _tmp31.createdAt = dayjs30().unix(), _tmp31.runId = responseCreatedResponse.id, _tmp31.status = "in_progress", _tmp31)
11504
11944
  ]), _tmp30)
11505
11945
  ])
11506
11946
  ];
@@ -11586,7 +12026,7 @@ var responsesRunAdapter = function(param) {
11586
12026
  4,
11587
12027
  onEvent2.apply(void 0, [
11588
12028
  (_tmp36.data = serializeItemAsMessage.apply(void 0, [
11589
- (_tmp37.openaiAssistant = _state.sent(), _tmp37.createdAt = dayjs29().unix(), _tmp37.runId = responseCreatedResponse.id, _tmp37.status = "in_progress", _tmp37)
12029
+ (_tmp37.openaiAssistant = _state.sent(), _tmp37.createdAt = dayjs30().unix(), _tmp37.runId = responseCreatedResponse.id, _tmp37.status = "in_progress", _tmp37)
11590
12030
  ]), _tmp36)
11591
12031
  ])
11592
12032
  ];
@@ -11673,7 +12113,7 @@ var responsesRunAdapter = function(param) {
11673
12113
  4,
11674
12114
  onEvent2.apply(void 0, [
11675
12115
  (_tmp42.data = serializeItemAsMessage.apply(void 0, [
11676
- (_tmp43.openaiAssistant = _state.sent(), _tmp43.createdAt = dayjs29().unix(), _tmp43.runId = responseCreatedResponse.id, _tmp43.status = "in_progress", _tmp43)
12116
+ (_tmp43.openaiAssistant = _state.sent(), _tmp43.createdAt = dayjs30().unix(), _tmp43.runId = responseCreatedResponse.id, _tmp43.status = "in_progress", _tmp43)
11677
12117
  ]), _tmp42)
11678
12118
  ])
11679
12119
  ];
@@ -11760,7 +12200,7 @@ var responsesRunAdapter = function(param) {
11760
12200
  4,
11761
12201
  onEvent2.apply(void 0, [
11762
12202
  (_tmp48.data = serializeItemAsMessage.apply(void 0, [
11763
- (_tmp49.openaiAssistant = _state.sent(), _tmp49.createdAt = dayjs29().unix(), _tmp49.runId = responseCreatedResponse.id, _tmp49.status = "in_progress", _tmp49)
12203
+ (_tmp49.openaiAssistant = _state.sent(), _tmp49.createdAt = dayjs30().unix(), _tmp49.runId = responseCreatedResponse.id, _tmp49.status = "in_progress", _tmp49)
11764
12204
  ]), _tmp48)
11765
12205
  ])
11766
12206
  ];
@@ -11875,7 +12315,7 @@ var responsesRunAdapter = function(param) {
11875
12315
  4,
11876
12316
  onEvent2.apply(void 0, [
11877
12317
  (_tmp56.data = serializeItemAsMessage.apply(void 0, [
11878
- (_tmp57.openaiAssistant = _state.sent(), _tmp57.createdAt = dayjs29().unix(), _tmp57.runId = responseCreatedResponse.id, _tmp57)
12318
+ (_tmp57.openaiAssistant = _state.sent(), _tmp57.createdAt = dayjs30().unix(), _tmp57.runId = responseCreatedResponse.id, _tmp57)
11879
12319
  ]), _tmp56)
11880
12320
  ])
11881
12321
  ];
@@ -11997,7 +12437,7 @@ var responsesRunAdapter = function(param) {
11997
12437
  4,
11998
12438
  onEvent2.apply(void 0, [
11999
12439
  (_tmp64.data = serializeItemAsMessage.apply(void 0, [
12000
- (_tmp65.openaiAssistant = _state.sent(), _tmp65.createdAt = dayjs29().unix(), _tmp65.runId = responseCreatedResponse.id, _tmp65)
12440
+ (_tmp65.openaiAssistant = _state.sent(), _tmp65.createdAt = dayjs30().unix(), _tmp65.runId = responseCreatedResponse.id, _tmp65)
12001
12441
  ]), _tmp64)
12002
12442
  ])
12003
12443
  ];
@@ -12083,7 +12523,7 @@ var responsesRunAdapter = function(param) {
12083
12523
  4,
12084
12524
  onEvent2.apply(void 0, [
12085
12525
  (_tmp70.data = serializeItemAsMessage.apply(void 0, [
12086
- (_tmp71.openaiAssistant = _state.sent(), _tmp71.createdAt = dayjs29().unix(), _tmp71.runId = responseCreatedResponse.id, _tmp71)
12526
+ (_tmp71.openaiAssistant = _state.sent(), _tmp71.createdAt = dayjs30().unix(), _tmp71.runId = responseCreatedResponse.id, _tmp71)
12087
12527
  ]), _tmp70)
12088
12528
  ])
12089
12529
  ];
@@ -12169,7 +12609,7 @@ var responsesRunAdapter = function(param) {
12169
12609
  4,
12170
12610
  onEvent2.apply(void 0, [
12171
12611
  (_tmp76.data = serializeItemAsMessage.apply(void 0, [
12172
- (_tmp77.openaiAssistant = _state.sent(), _tmp77.createdAt = dayjs29().unix(), _tmp77.runId = responseCreatedResponse.id, _tmp77)
12612
+ (_tmp77.openaiAssistant = _state.sent(), _tmp77.createdAt = dayjs30().unix(), _tmp77.runId = responseCreatedResponse.id, _tmp77)
12173
12613
  ]), _tmp76)
12174
12614
  ])
12175
12615
  ];
@@ -12255,7 +12695,7 @@ var responsesRunAdapter = function(param) {
12255
12695
  4,
12256
12696
  onEvent2.apply(void 0, [
12257
12697
  (_tmp82.data = serializeItemAsMessage.apply(void 0, [
12258
- (_tmp83.openaiAssistant = _state.sent(), _tmp83.createdAt = dayjs29().unix(), _tmp83.runId = responseCreatedResponse.id, _tmp83)
12698
+ (_tmp83.openaiAssistant = _state.sent(), _tmp83.createdAt = dayjs30().unix(), _tmp83.runId = responseCreatedResponse.id, _tmp83)
12259
12699
  ]), _tmp82)
12260
12700
  ])
12261
12701
  ];
@@ -12341,7 +12781,7 @@ var responsesRunAdapter = function(param) {
12341
12781
  4,
12342
12782
  onEvent2.apply(void 0, [
12343
12783
  (_tmp88.data = serializeItemAsMessage.apply(void 0, [
12344
- (_tmp89.openaiAssistant = _state.sent(), _tmp89.createdAt = dayjs29().unix(), _tmp89.runId = responseCreatedResponse.id, _tmp89)
12784
+ (_tmp89.openaiAssistant = _state.sent(), _tmp89.createdAt = dayjs30().unix(), _tmp89.runId = responseCreatedResponse.id, _tmp89)
12345
12785
  ]), _tmp88)
12346
12786
  ])
12347
12787
  ];
@@ -12427,7 +12867,7 @@ var responsesRunAdapter = function(param) {
12427
12867
  4,
12428
12868
  onEvent2.apply(void 0, [
12429
12869
  (_tmp94.data = serializeItemAsMessage.apply(void 0, [
12430
- (_tmp95.openaiAssistant = _state.sent(), _tmp95.createdAt = dayjs29().unix(), _tmp95.runId = responseCreatedResponse.id, _tmp95)
12870
+ (_tmp95.openaiAssistant = _state.sent(), _tmp95.createdAt = dayjs30().unix(), _tmp95.runId = responseCreatedResponse.id, _tmp95)
12431
12871
  ]), _tmp94)
12432
12872
  ])
12433
12873
  ];
@@ -12524,7 +12964,7 @@ var responsesRunAdapter = function(param) {
12524
12964
  _tmp97 = {
12525
12965
  id: event.item_id,
12526
12966
  object: "thread.message",
12527
- created_at: dayjs29().unix(),
12967
+ created_at: dayjs30().unix(),
12528
12968
  thread_id: threadId,
12529
12969
  completed_at: null,
12530
12970
  incomplete_at: null,
@@ -12562,7 +13002,7 @@ var responsesRunAdapter = function(param) {
12562
13002
  _tmp99 = {
12563
13003
  id: event.item_id,
12564
13004
  object: "thread.message",
12565
- created_at: dayjs29().unix(),
13005
+ created_at: dayjs30().unix(),
12566
13006
  thread_id: threadId,
12567
13007
  completed_at: null,
12568
13008
  incomplete_at: null,
@@ -12734,7 +13174,7 @@ var responsesRunAdapter = function(param) {
12734
13174
  event: "thread.run.failed"
12735
13175
  };
12736
13176
  _tmp102 = {
12737
- id: (responseCreatedResponse === null || responseCreatedResponse === void 0 ? void 0 : responseCreatedResponse.id) || "run_".concat(uid9(18)),
13177
+ id: (responseCreatedResponse === null || responseCreatedResponse === void 0 ? void 0 : responseCreatedResponse.id) || "run_".concat(uid10(18)),
12738
13178
  object: "thread.run",
12739
13179
  thread_id: threadId
12740
13180
  };
@@ -12750,7 +13190,7 @@ var responsesRunAdapter = function(param) {
12750
13190
  return [
12751
13191
  4,
12752
13192
  onEvent2.apply(void 0, [
12753
- (_tmp101.data = (_tmp102.assistant_id = _state.sent().id, _tmp102.status = "failed", _tmp102.failed_at = dayjs29().unix(), _tmp102.last_error = {
13193
+ (_tmp101.data = (_tmp102.assistant_id = _state.sent().id, _tmp102.status = "failed", _tmp102.failed_at = dayjs30().unix(), _tmp102.last_error = {
12754
13194
  code: "server_error",
12755
13195
  message: String((e === null || e === void 0 ? void 0 : e.message) || e || "Unknown error")
12756
13196
  }, _tmp102), _tmp101)
@@ -12810,8 +13250,8 @@ var responsesRunAdapter = function(param) {
12810
13250
  };
12811
13251
  };
12812
13252
  // src/adapters/run/azureAgentsRunAdapter/index.ts
12813
- import dayjs30 from "dayjs";
12814
- import { uid as uid10 } from "radash";
13253
+ import dayjs31 from "dayjs";
13254
+ import { uid as uid11 } from "radash";
12815
13255
  function transformAnnotations(annotations) {
12816
13256
  return annotations.map(function(ann) {
12817
13257
  if (ann.type === "file_citation") {
@@ -12904,7 +13344,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12904
13344
  data: {
12905
13345
  id: data.id,
12906
13346
  object: "thread.run",
12907
- created_at: dayjs30(data.createdAt).unix(),
13347
+ created_at: dayjs31(data.createdAt).unix(),
12908
13348
  thread_id: data.threadId,
12909
13349
  assistant_id: assistantId,
12910
13350
  status: data.status,
@@ -12928,10 +13368,10 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12928
13368
  message: JSON.stringify(data.lastError)
12929
13369
  } : null,
12930
13370
  expires_at: null,
12931
- started_at: data.startedAt ? dayjs30(data.startedAt).unix() : null,
12932
- cancelled_at: data.cancelledAt ? dayjs30(data.cancelledAt).unix() : null,
12933
- failed_at: data.failedAt ? dayjs30(data.failedAt).unix() : null,
12934
- completed_at: data.completedAt ? dayjs30(data.completedAt).unix() : null,
13371
+ started_at: data.startedAt ? dayjs31(data.startedAt).unix() : null,
13372
+ cancelled_at: data.cancelledAt ? dayjs31(data.cancelledAt).unix() : null,
13373
+ failed_at: data.failedAt ? dayjs31(data.failedAt).unix() : null,
13374
+ completed_at: data.completedAt ? dayjs31(data.completedAt).unix() : null,
12935
13375
  incomplete_details: null,
12936
13376
  model: data.model || "",
12937
13377
  instructions: data.instructions || "",
@@ -12959,7 +13399,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12959
13399
  data: {
12960
13400
  id: data.id,
12961
13401
  object: "thread.message",
12962
- created_at: dayjs30(data.createdAt).unix(),
13402
+ created_at: dayjs31(data.createdAt).unix(),
12963
13403
  thread_id: data.threadId,
12964
13404
  role: data.role,
12965
13405
  content: ((_data_content = data.content) === null || _data_content === void 0 ? void 0 : _data_content.map(function(c) {
@@ -12970,7 +13410,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
12970
13410
  attachments: data.attachments || [],
12971
13411
  metadata: data.metadata || {},
12972
13412
  status: data.status || "completed",
12973
- completed_at: data.completedAt ? dayjs30(data.completedAt).unix() : null,
13413
+ completed_at: data.completedAt ? dayjs31(data.completedAt).unix() : null,
12974
13414
  incomplete_at: null,
12975
13415
  incomplete_details: null
12976
13416
  }
@@ -13159,7 +13599,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
13159
13599
  data: {
13160
13600
  id: data.id,
13161
13601
  object: "thread.run.step",
13162
- created_at: dayjs30(data.createdAt).unix(),
13602
+ created_at: dayjs31(data.createdAt).unix(),
13163
13603
  assistant_id: assistantId,
13164
13604
  thread_id: data.threadId,
13165
13605
  run_id: data.runId,
@@ -13168,9 +13608,9 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
13168
13608
  step_details: stepDetails,
13169
13609
  last_error: data.lastError || null,
13170
13610
  expired_at: null,
13171
- cancelled_at: data.cancelledAt ? dayjs30(data.cancelledAt).unix() : null,
13172
- failed_at: data.failedAt ? dayjs30(data.failedAt).unix() : null,
13173
- completed_at: data.completedAt ? dayjs30(data.completedAt).unix() : null,
13611
+ cancelled_at: data.cancelledAt ? dayjs31(data.cancelledAt).unix() : null,
13612
+ failed_at: data.failedAt ? dayjs31(data.failedAt).unix() : null,
13613
+ completed_at: data.completedAt ? dayjs31(data.completedAt).unix() : null,
13174
13614
  metadata: data.metadata || {},
13175
13615
  usage: null
13176
13616
  }
@@ -13182,7 +13622,7 @@ function convertAzureEventToOpenAI2(azureEvent, assistantId) {
13182
13622
  data: {
13183
13623
  id: data.id,
13184
13624
  object: "thread",
13185
- created_at: dayjs30(data.createdAt).unix(),
13625
+ created_at: dayjs31(data.createdAt).unix(),
13186
13626
  metadata: data.metadata || {},
13187
13627
  tool_resources: data.toolResources || null
13188
13628
  }
@@ -13315,7 +13755,7 @@ var azureAgentsRunAdapter = function(param) {
13315
13755
  ];
13316
13756
  case 15:
13317
13757
  e = _state.sent();
13318
- errorRunId = "run_".concat(uid10(18));
13758
+ errorRunId = "run_".concat(uid11(18));
13319
13759
  return [
13320
13760
  4,
13321
13761
  onEvent2({
@@ -13323,7 +13763,7 @@ var azureAgentsRunAdapter = function(param) {
13323
13763
  data: {
13324
13764
  id: errorRunId,
13325
13765
  object: "thread.run",
13326
- created_at: dayjs30().unix(),
13766
+ created_at: dayjs31().unix(),
13327
13767
  thread_id: threadId,
13328
13768
  assistant_id: assistantId,
13329
13769
  status: "failed",
@@ -13333,9 +13773,9 @@ var azureAgentsRunAdapter = function(param) {
13333
13773
  message: String((e === null || e === void 0 ? void 0 : e.message) || e || "Unknown error")
13334
13774
  },
13335
13775
  expires_at: null,
13336
- started_at: dayjs30().unix(),
13776
+ started_at: dayjs31().unix(),
13337
13777
  cancelled_at: null,
13338
- failed_at: dayjs30().unix(),
13778
+ failed_at: dayjs31().unix(),
13339
13779
  completed_at: null,
13340
13780
  incomplete_details: null,
13341
13781
  model: "",