@roomle/embedding-lib 0.0.0-dev-20f436f → 0.0.0-dev-d66646c

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.
Files changed (74) hide show
  1. package/THIRD-PARTY-NOTICES.txt +2 -2
  2. package/ai.js +8 -8
  3. package/ai.min.js +7 -6
  4. package/{browser-D6M-d6y5.mjs → browser-Cys-y5Hy.mjs} +1 -2
  5. package/chat-model-DooKwd8I.mjs +117 -0
  6. package/chat-model-KHuz1Ej9.mjs +118 -0
  7. package/coerce-CuLRCRlo.mjs +6 -0
  8. package/coerce-Dup0o-HR.mjs +7 -0
  9. package/{comlink-CG3f9q6z.mjs → comlink-7u13Z2ZH.mjs} +2 -3
  10. package/{comlink-hSUzCx9j.mjs → comlink-DKhvPU0o.mjs} +1 -1
  11. package/configurator.js +3 -4
  12. package/configurator.min.js +2 -2
  13. package/construction.js +387 -31
  14. package/construction.min.js +395 -36
  15. package/continuation-COcMrXyj.mjs +14 -0
  16. package/continuation-D2hsmYf1.mjs +13 -0
  17. package/{dist-Cm3aF4sf.mjs → dist-7-X7Xqsl.mjs} +851 -919
  18. package/{dist-BQaw78-_.mjs → dist-BMxyw-Zs.mjs} +411 -405
  19. package/{dist-0WZWTj8T.mjs → dist-BU022PnG.mjs} +4 -9
  20. package/{dist-DkR6G9Kj.mjs → dist-BY8OLJ2p.mjs} +1 -1
  21. package/{dist-6TznX-Ae.mjs → dist-BZSd56sr.mjs} +3850 -3942
  22. package/{dist-70R0b5Mq.mjs → dist-Ba3J8AjB.mjs} +400 -390
  23. package/{dist-CTS0DDwt.mjs → dist-CbQKC1xX.mjs} +1590 -1616
  24. package/{dist-BmOBP9h9.mjs → dist-CiybWJvs.mjs} +44 -41
  25. package/{dist-CPG4atmb.mjs → dist-CkZuNdCU.mjs} +6 -4
  26. package/{dist-Bt1FopV4.mjs → dist-D2ZAAHGn.mjs} +1058 -1042
  27. package/{dist-BWNv7qW9.mjs → dist-DjsS42rR.mjs} +916 -962
  28. package/{dist-9UI7dzwc.mjs → dist-Jcq_kKKT.mjs} +403 -393
  29. package/{dist-D0XFfKEL.mjs → dist-S9sLSjZ4.mjs} +3112 -3104
  30. package/{dist-BV-32IEX.mjs → dist-XECXrV5Q.mjs} +1497 -1558
  31. package/{dist-Bc2s-kJZ.mjs → dist-a5_BIeaS.mjs} +45 -51
  32. package/{dist-Crrp-Bno.mjs → dist-bQAJDeYc.mjs} +698 -748
  33. package/{drag-ghost-BpIDzSdK.mjs → drag-ghost-QZelgA-_.mjs} +2 -3
  34. package/{drag-ghost-Bhb0_67G.mjs → drag-ghost-VmgSWLva.mjs} +5 -7
  35. package/{drag-in-mE_ozj_Q.mjs → drag-in-Cd_67tzS.mjs} +4 -5
  36. package/{drag-in-CGBG4wEk.mjs → drag-in-DlDsgY4T.mjs} +3 -3
  37. package/embedding-plugins.js +1 -2
  38. package/embedding-plugins.min.js +1 -2
  39. package/{experimental-evaluation-FzKFGoye.mjs → experimental-evaluation-B4hKMgFH.mjs} +19 -38
  40. package/{experimental-evaluation-DczxmJme.mjs → experimental-evaluation-DmqghFSx.mjs} +1 -1
  41. package/{from-custom-view-B3fIWMox.mjs → from-custom-view-6HMD_sPe.mjs} +5 -4
  42. package/{from-custom-view-B3HCOhdT.mjs → from-custom-view-BRFynafo.mjs} +16 -16
  43. package/{from-website-DaTahmvJ.mjs → from-website-Dl1VN4h7.mjs} +5 -6
  44. package/{from-website-DUQ9USj1.mjs → from-website-iZzauH4C.mjs} +3 -3
  45. package/hi.js +228 -233
  46. package/hi.min.js +207 -204
  47. package/mcp-tools-C6O2gQZW.mjs +41 -0
  48. package/mcp-tools-m_3IX0vB.mjs +40 -0
  49. package/package.json +1 -1
  50. package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +3 -0
  51. package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +0 -6
  52. package/packages/web-sdk/packages/assistant.d.ts +3 -1
  53. package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-recovery.d.ts +5 -1
  54. package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -3
  55. package/packages/web-sdk/packages/common-core/src/planning-assistant/runtime.d.ts +4 -1
  56. package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +2 -0
  57. package/packages/web-sdk/packages/common-core/src/planning-assistant/usage.d.ts +16 -0
  58. package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +19 -1
  59. package/rolldown-runtime--db92txo.mjs +10 -0
  60. package/rolldown-runtime-CyjYJMBa.mjs +11 -0
  61. package/roomle-embedding-lib.js +25 -34
  62. package/roomle-embedding-lib.min.js +3 -3
  63. package/sbom.cdx.json +5 -5
  64. package/usage-CgXarvBY.mjs +16 -0
  65. package/usage-c8evaONq.mjs +17 -0
  66. package/{utils-BwWn6Fw4.mjs → utils-CJnKZceY.mjs} +3 -4
  67. package/{utils-BoELtcEK.mjs → utils-DdNhTbJr.mjs} +6 -6
  68. package/chat-model-C1ov616e.mjs +0 -377
  69. package/chat-model-CifTV-8H.mjs +0 -373
  70. package/coerce-CqJod_GZ.mjs +0 -8
  71. package/coerce-CsI42_k0.mjs +0 -6
  72. package/mcp-tools-CC8DTfZA.mjs +0 -2
  73. package/mcp-tools-CfJ_ue_2.mjs +0 -2
  74. /package/{browser-BjtSrqbu.mjs → browser-CzLpXYFF.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
 
2
- import { $ as e, A as t, Bt as n, D as r, E as i, Et as a, F as o, Ft as s, H as c, Ht as l, It as u, Jt as d, K as f, Kt as p, L as m, Lt as h, M as g, Mt as _, N as v, O as y, Ot as b, Pn as x, Pt as S, Qt as C, Rt as w, S as T, Sn as E, St as D, T as O, Tt as k, U as A, Vt as j, Wt as M, X as ee, Yt as N, Zt as P, _ as F, _n as te, _t as I, an as L, b as ne, bn as R, bt as z, cn as B, ct as re, dn as V, en as H, f as U, fn as W, ft as ie, g as ae, h as oe, ht as se, i as ce, in as G, j as K, jn as q, jt as J, k as le, kn as ue, kt as de, ln as Y, m as fe, nt as pe, o as me, ot as X, p as he, pt as ge, qt as _e, sn as Z, st as ve, tn as Q, un as ye, v as be, w as xe, x as Se, xn as Ce, xt as we, yt as Te, zt as Ee } from "./dist-Bt1FopV4.mjs";
3
- import { t as De } from "./coerce-CsI42_k0.mjs";
4
- import { t as Oe } from "./experimental-evaluation-DczxmJme.mjs";
2
+ import { $ as e, A as t, Bt as n, D as r, E as i, Et as a, F as o, Ft as s, H as c, Ht as l, It as u, Jt as d, K as f, Kt as p, L as m, Lt as h, M as g, Mt as _, N as v, O as y, Ot as b, Pn as x, Pt as S, Qt as C, Rt as w, S as T, Sn as E, St as D, T as O, Tt as k, U as A, Vt as j, Wt as M, X as ee, Yt as N, Zt as P, _ as F, _n as te, _t as I, an as L, b as ne, bn as R, bt as z, cn as B, ct as re, dn as V, en as H, f as U, fn as W, ft as ie, g as ae, h as oe, ht as se, i as ce, in as G, j as K, jn as q, jt as J, k as le, kn as ue, kt as de, ln as Y, m as fe, nt as pe, o as me, ot as X, p as he, pt as ge, qt as _e, sn as Z, st as ve, tn as Q, un as ye, v as be, w as xe, x as Se, xn as Ce, xt as we, yt as Te, zt as Ee } from "./dist-D2ZAAHGn.mjs";
3
+ import { t as De } from "./coerce-CuLRCRlo.mjs";
4
+ import { t as Oe } from "./experimental-evaluation-DmqghFSx.mjs";
5
5
  var ke = L({ error: L({
6
6
  message: Y(),
7
7
  type: Y().nullish(),
@@ -381,14 +381,16 @@ function qe(e) {
381
381
  for (let r = 0; r < e.length; r++) {
382
382
  let i = e[r];
383
383
  if (t) t = !1;
384
- else if (i !== "\\") if (i !== "[") if (i !== "]") {
385
- if (!n && i === "(" && e[r + 1] === "?") {
386
- let t = e[r + 2];
387
- if (t === "=" || t === "!" || t === "<" && (e[r + 3] === "=" || e[r + 3] === "!")) return !0;
388
- }
389
- } else n = !1;
390
- else n = !0;
391
- else t = !0;
384
+ else if (i !== "\\") {
385
+ if (i !== "[") {
386
+ if (i !== "]") {
387
+ if (!n && i === "(" && e[r + 1] === "?") {
388
+ let t = e[r + 2];
389
+ if (t === "=" || t === "!" || t === "<" && (e[r + 3] === "=" || e[r + 3] === "!")) return !0;
390
+ }
391
+ } else n = !1;
392
+ } else n = !0;
393
+ } else t = !0;
392
394
  }
393
395
  return !1;
394
396
  }(a.pattern) && (delete a.pattern, n = !0), a.properties != null && (a.properties = o(a.properties)), a.patternProperties != null && (a.patternProperties = o(a.patternProperties)), a.additionalProperties != null && (a.additionalProperties = s(a.additionalProperties)), a.additionalItems != null && (a.additionalItems = s(a.additionalItems)), a.items != null && (a.items = Array.isArray(a.items) ? a.items.map(s) : s(a.items)), a.contains != null && (a.contains = s(a.contains)), a.not != null && (a.not = s(a.not)), a.allOf != null && (a.allOf = a.allOf.map(s)), a.anyOf != null && (a.anyOf = a.anyOf.map(s)), a.oneOf != null && (a.oneOf = a.oneOf.map(s)), a.definitions != null && (a.definitions = o(a.definitions)), a.$defs != null && (a.$defs = o(a.$defs)), a.dependencies != null && (a.dependencies = Object.fromEntries(Object.entries(a.dependencies).map(([e, t]) => [e, Array.isArray(t) ? t : s(t)])));
@@ -2157,7 +2159,7 @@ var Ct = t({
2157
2159
  ...e,
2158
2160
  openai: {
2159
2161
  ...t,
2160
- allowedCallers: [...new Set([...t?.allowedCallers ?? [], "programmatic"])]
2162
+ allowedCallers: [.../* @__PURE__ */ new Set([...t?.allowedCallers ?? [], "programmatic"])]
2161
2163
  }
2162
2164
  };
2163
2165
  }
@@ -2322,7 +2324,7 @@ var mn = H(() => V([
2322
2324
  code: Y().nullish(),
2323
2325
  message: Y(),
2324
2326
  param: Y().nullish()
2325
- }), En = new Set([
2327
+ }), En = /* @__PURE__ */ new Set([
2326
2328
  "error",
2327
2329
  "response.apply_patch_call_operation_diff.delta",
2328
2330
  "response.apply_patch_call_operation_diff.done",
@@ -2344,7 +2346,7 @@ var mn = H(() => V([
2344
2346
  "response.reasoning_summary_part.added",
2345
2347
  "response.reasoning_summary_part.done",
2346
2348
  "response.reasoning_summary_text.delta"
2347
- ]), Dn = new Set([
2349
+ ]), Dn = /* @__PURE__ */ new Set([
2348
2350
  "apply_patch_call",
2349
2351
  "code_interpreter_call",
2350
2352
  "compaction",
@@ -3987,7 +3989,7 @@ var Qn = {
3987
3989
  let i = r.get(e.toolCallId);
3988
3990
  i == null ? r.set(e.toolCallId, {
3989
3991
  metadata: e,
3990
- results: new Map([[e.index, t]]),
3992
+ results: /* @__PURE__ */ new Map([[e.index, t]]),
3991
3993
  invalid: !1
3992
3994
  }) : zn(i.metadata, e) && !i.results.has(e.index) ? i.results.set(e.index, t) : i.invalid = !0;
3993
3995
  }
@@ -5510,413 +5512,416 @@ var Qn = {
5510
5512
  toolName: t,
5511
5513
  providerExecuted: !0
5512
5514
  });
5513
- } else if (f.item.type !== "tool_search_output" && !(f.item.type === "mcp_call" || f.item.type === "mcp_list_tools" || f.item.type === "mcp_approval_request")) if (f.item.type === "apply_patch_call") {
5514
- let { call_id: e, operation: t } = f.item;
5515
- if (x[f.output_index] = {
5516
- toolName: i.toCustomToolName("apply_patch"),
5517
- toolCallId: e,
5518
- applyPatch: {
5519
- hasDiff: t.type === "delete_file",
5520
- endEmitted: t.type === "delete_file"
5521
- }
5522
- }, d.enqueue({
5523
- type: "tool-input-start",
5524
- id: e,
5525
- toolName: i.toCustomToolName("apply_patch")
5526
- }), t.type === "delete_file") {
5527
- let n = JSON.stringify({
5528
- callId: e,
5529
- operation: t
5530
- });
5531
- d.enqueue({
5515
+ } else if (f.item.type !== "tool_search_output" && f.item.type !== "mcp_call" && f.item.type !== "mcp_list_tools" && f.item.type !== "mcp_approval_request") {
5516
+ if (f.item.type === "apply_patch_call") {
5517
+ let { call_id: e, operation: t } = f.item;
5518
+ if (x[f.output_index] = {
5519
+ toolName: i.toCustomToolName("apply_patch"),
5520
+ toolCallId: e,
5521
+ applyPatch: {
5522
+ hasDiff: t.type === "delete_file",
5523
+ endEmitted: t.type === "delete_file"
5524
+ }
5525
+ }, d.enqueue({
5526
+ type: "tool-input-start",
5527
+ id: e,
5528
+ toolName: i.toCustomToolName("apply_patch")
5529
+ }), t.type === "delete_file") {
5530
+ let n = JSON.stringify({
5531
+ callId: e,
5532
+ operation: t
5533
+ });
5534
+ d.enqueue({
5535
+ type: "tool-input-delta",
5536
+ id: e,
5537
+ delta: n
5538
+ }), d.enqueue({
5539
+ type: "tool-input-end",
5540
+ id: e
5541
+ });
5542
+ } else d.enqueue({
5532
5543
  type: "tool-input-delta",
5533
5544
  id: e,
5534
- delta: n
5535
- }), d.enqueue({
5536
- type: "tool-input-end",
5537
- id: e
5545
+ delta: `{"callId":"${or(e)}","operation":{"type":"${or(t.type)}","path":"${or(t.path)}","diff":"`
5538
5546
  });
5539
- } else d.enqueue({
5540
- type: "tool-input-delta",
5541
- id: e,
5542
- delta: `{"callId":"${or(e)}","operation":{"type":"${or(t.type)}","path":"${or(t.path)}","diff":"`
5543
- });
5544
- } else f.item.type === "shell_call" ? x[f.output_index] = {
5545
- toolName: i.toCustomToolName("shell"),
5546
- toolCallId: f.item.call_id
5547
- } : f.item.type === "shell_call_output" || (f.item.type === "message" ? (D[f.output_index] = f.item.id, S.splice(0), C = f.item.phase ?? void 0, d.enqueue({
5548
- type: "text-start",
5549
- id: f.item.id,
5550
- providerMetadata: { [o]: {
5551
- itemId: f.item.id,
5552
- ...f.item.phase != null && { phase: f.item.phase }
5553
- } }
5554
- })) : tr(f) && f.item.type === "reasoning" && (D[f.output_index] = f.item.id, E[f.item.id] = {
5555
- encryptedContent: f.item.encrypted_content,
5556
- summaryParts: { 0: "active" }
5557
- }, d.enqueue({
5558
- type: "reasoning-start",
5559
- id: `${f.item.id}:0`,
5560
- providerMetadata: { [o]: {
5561
- itemId: f.item.id,
5562
- reasoningEncryptedContent: f.item.encrypted_content ?? null
5563
- } }
5564
- })));
5547
+ } else f.item.type === "shell_call" ? x[f.output_index] = {
5548
+ toolName: i.toCustomToolName("shell"),
5549
+ toolCallId: f.item.call_id
5550
+ } : f.item.type === "shell_call_output" || (f.item.type === "message" ? (D[f.output_index] = f.item.id, S.splice(0), C = f.item.phase ?? void 0, d.enqueue({
5551
+ type: "text-start",
5552
+ id: f.item.id,
5553
+ providerMetadata: { [o]: {
5554
+ itemId: f.item.id,
5555
+ ...f.item.phase != null && { phase: f.item.phase }
5556
+ } }
5557
+ })) : tr(f) && f.item.type === "reasoning" && (D[f.output_index] = f.item.id, E[f.item.id] = {
5558
+ encryptedContent: f.item.encrypted_content,
5559
+ summaryParts: { 0: "active" }
5560
+ }, d.enqueue({
5561
+ type: "reasoning-start",
5562
+ id: `${f.item.id}:0`,
5563
+ providerMetadata: { [o]: {
5564
+ itemId: f.item.id,
5565
+ reasoningEncryptedContent: f.item.encrypted_content ?? null
5566
+ } }
5567
+ })));
5568
+ }
5565
5569
  } else if (function(e) {
5566
5570
  return e.type === "response.output_item.done";
5567
- }(f)) if (f.item.type === "message") {
5568
- let e = O({
5569
- itemId: f.item.id,
5570
- outputIndex: f.output_index
5571
- }), t = f.item.phase ?? C;
5572
- C = void 0, d.enqueue({
5573
- type: "text-end",
5574
- id: e,
5575
- providerMetadata: { [o]: {
5576
- itemId: e,
5577
- ...t != null && { phase: t },
5578
- ...S.length > 0 && { annotations: S }
5579
- } }
5580
- }), D[f.output_index] = void 0;
5581
- } else {
5582
- if (f.item.type === "function_call") {
5583
- let e = f.item, t = x[f.output_index];
5584
- x[f.output_index] = void 0, w = !0;
5585
- let n = t?.suppressInputStreaming ?? Pn({
5586
- toolName: e.name,
5587
- tools: h
5588
- }), r = () => {
5589
- if (n) {
5571
+ }(f)) {
5572
+ if (f.item.type === "message") {
5573
+ let e = O({
5574
+ itemId: f.item.id,
5575
+ outputIndex: f.output_index
5576
+ }), t = f.item.phase ?? C;
5577
+ C = void 0, d.enqueue({
5578
+ type: "text-end",
5579
+ id: e,
5580
+ providerMetadata: { [o]: {
5581
+ itemId: e,
5582
+ ...t != null && { phase: t },
5583
+ ...S.length > 0 && { annotations: S }
5584
+ } }
5585
+ }), D[f.output_index] = void 0;
5586
+ } else {
5587
+ if (f.item.type === "function_call") {
5588
+ let e = f.item, t = x[f.output_index];
5589
+ x[f.output_index] = void 0, w = !0;
5590
+ let n = t?.suppressInputStreaming ?? Pn({
5591
+ toolName: e.name,
5592
+ tools: h
5593
+ }), r = () => {
5594
+ if (n) {
5595
+ d.enqueue({
5596
+ type: "tool-input-start",
5597
+ id: e.call_id,
5598
+ toolName: e.name
5599
+ });
5600
+ let n = t?.bufferedInputDeltas ?? [];
5601
+ if (n.length > 0) for (let t of n) d.enqueue({
5602
+ type: "tool-input-delta",
5603
+ id: e.call_id,
5604
+ delta: t
5605
+ });
5606
+ else e.arguments.length > 0 && d.enqueue({
5607
+ type: "tool-input-delta",
5608
+ id: e.call_id,
5609
+ delta: e.arguments
5610
+ });
5611
+ }
5590
5612
  d.enqueue({
5591
- type: "tool-input-start",
5613
+ type: "tool-input-end",
5592
5614
  id: e.call_id,
5593
- toolName: e.name
5615
+ ...e.namespace != null && { providerMetadata: { [o]: { namespace: e.namespace } } }
5616
+ }), d.enqueue({
5617
+ type: "tool-call",
5618
+ toolCallId: e.call_id,
5619
+ toolName: e.name,
5620
+ input: e.arguments,
5621
+ providerMetadata: { [o]: {
5622
+ itemId: e.id,
5623
+ ...e.async == null ? t?.async == null ? {} : { async: t.async } : { async: e.async },
5624
+ ...e.namespace != null && { namespace: e.namespace },
5625
+ ...e.caller != null && { caller: e.caller.type === "program" ? {
5626
+ type: "program",
5627
+ callerId: e.caller.caller_id
5628
+ } : e.caller }
5629
+ } }
5594
5630
  });
5595
- let n = t?.bufferedInputDeltas ?? [];
5596
- if (n.length > 0) for (let t of n) d.enqueue({
5597
- type: "tool-input-delta",
5598
- id: e.call_id,
5599
- delta: t
5600
- });
5601
- else e.arguments.length > 0 && d.enqueue({
5631
+ };
5632
+ return n ? Fn({
5633
+ toolCall: {
5634
+ toolCallId: e.call_id,
5635
+ toolName: e.name,
5636
+ input: e.arguments
5637
+ },
5638
+ tools: h,
5639
+ providerOptionsName: o,
5640
+ itemId: e.id
5641
+ }).then((e) => {
5642
+ if (e != null) for (let t of e) d.enqueue({
5643
+ type: "tool-input-start",
5644
+ id: t.toolCallId,
5645
+ toolName: t.toolName
5646
+ }), d.enqueue({
5602
5647
  type: "tool-input-delta",
5603
- id: e.call_id,
5604
- delta: e.arguments
5605
- });
5606
- }
5648
+ id: t.toolCallId,
5649
+ delta: t.input
5650
+ }), d.enqueue({
5651
+ type: "tool-input-end",
5652
+ id: t.toolCallId
5653
+ }), d.enqueue(t);
5654
+ else r();
5655
+ }) : void r();
5656
+ }
5657
+ if (f.item.type === "program") d.enqueue({
5658
+ type: "tool-call",
5659
+ toolCallId: f.item.call_id,
5660
+ toolName: i.toCustomToolName("programmatic_tool_calling"),
5661
+ input: JSON.stringify({
5662
+ code: f.item.code,
5663
+ fingerprint: f.item.fingerprint
5664
+ }),
5665
+ providerExecuted: !0,
5666
+ providerMetadata: { [o]: { itemId: f.item.id } }
5667
+ });
5668
+ else if (f.item.type === "program_output") d.enqueue({
5669
+ type: "tool-result",
5670
+ toolCallId: f.item.call_id,
5671
+ toolName: i.toCustomToolName("programmatic_tool_calling"),
5672
+ result: {
5673
+ result: f.item.result,
5674
+ status: f.item.status
5675
+ },
5676
+ providerMetadata: { [o]: { itemId: f.item.id } }
5677
+ });
5678
+ else if (f.item.type === "custom_tool_call") {
5679
+ let e = x[f.output_index];
5680
+ x[f.output_index] = void 0, w = !0;
5681
+ let t = i.toCustomToolName(f.item.name);
5607
5682
  d.enqueue({
5608
5683
  type: "tool-input-end",
5609
- id: e.call_id,
5610
- ...e.namespace != null && { providerMetadata: { [o]: { namespace: e.namespace } } }
5684
+ id: f.item.call_id
5611
5685
  }), d.enqueue({
5612
5686
  type: "tool-call",
5613
- toolCallId: e.call_id,
5614
- toolName: e.name,
5615
- input: e.arguments,
5687
+ toolCallId: f.item.call_id,
5688
+ toolName: t,
5689
+ input: JSON.stringify(f.item.input),
5616
5690
  providerMetadata: { [o]: {
5617
- itemId: e.id,
5618
- ...e.async == null ? t?.async == null ? {} : { async: t.async } : { async: e.async },
5619
- ...e.namespace != null && { namespace: e.namespace },
5620
- ...e.caller != null && { caller: e.caller.type === "program" ? {
5621
- type: "program",
5622
- callerId: e.caller.caller_id
5623
- } : e.caller }
5691
+ itemId: f.item.id,
5692
+ ...f.item.async == null ? e?.async == null ? {} : { async: e.async } : { async: f.item.async }
5624
5693
  } }
5625
5694
  });
5626
- };
5627
- return n ? Fn({
5628
- toolCall: {
5629
- toolCallId: e.call_id,
5630
- toolName: e.name,
5631
- input: e.arguments
5632
- },
5633
- tools: h,
5634
- providerOptionsName: o,
5635
- itemId: e.id
5636
- }).then((e) => {
5637
- if (e != null) for (let t of e) d.enqueue({
5638
- type: "tool-input-start",
5639
- id: t.toolCallId,
5640
- toolName: t.toolName
5695
+ } else if (f.item.type === "web_search_call") x[f.output_index] = void 0, d.enqueue({
5696
+ type: "tool-result",
5697
+ toolCallId: f.item.id,
5698
+ toolName: i.toCustomToolName(r ?? "web_search"),
5699
+ result: ar(f.item.action)
5700
+ });
5701
+ else if (f.item.type === "computer_call") {
5702
+ if (x[f.output_index] = void 0, f.item.call_id == null) return d.enqueue({
5703
+ type: "tool-input-end",
5704
+ id: f.item.id
5641
5705
  }), d.enqueue({
5706
+ type: "tool-call",
5707
+ toolCallId: f.item.id,
5708
+ toolName: i.toCustomToolName("computer_use"),
5709
+ input: "",
5710
+ providerExecuted: !0
5711
+ }), void d.enqueue({
5712
+ type: "tool-result",
5713
+ toolCallId: f.item.id,
5714
+ toolName: i.toCustomToolName("computer_use"),
5715
+ result: {
5716
+ type: "computer_use_tool_result",
5717
+ status: f.item.status
5718
+ }
5719
+ });
5720
+ w = !0;
5721
+ let e = i.toCustomToolName("computer"), t = JSON.stringify(Zn(f.item));
5722
+ d.enqueue({
5642
5723
  type: "tool-input-delta",
5643
- id: t.toolCallId,
5644
- delta: t.input
5724
+ id: f.item.call_id,
5725
+ delta: t
5645
5726
  }), d.enqueue({
5646
5727
  type: "tool-input-end",
5647
- id: t.toolCallId
5648
- }), d.enqueue(t);
5649
- else r();
5650
- }) : void r();
5651
- }
5652
- if (f.item.type === "program") d.enqueue({
5653
- type: "tool-call",
5654
- toolCallId: f.item.call_id,
5655
- toolName: i.toCustomToolName("programmatic_tool_calling"),
5656
- input: JSON.stringify({
5657
- code: f.item.code,
5658
- fingerprint: f.item.fingerprint
5659
- }),
5660
- providerExecuted: !0,
5661
- providerMetadata: { [o]: { itemId: f.item.id } }
5662
- });
5663
- else if (f.item.type === "program_output") d.enqueue({
5664
- type: "tool-result",
5665
- toolCallId: f.item.call_id,
5666
- toolName: i.toCustomToolName("programmatic_tool_calling"),
5667
- result: {
5668
- result: f.item.result,
5669
- status: f.item.status
5670
- },
5671
- providerMetadata: { [o]: { itemId: f.item.id } }
5672
- });
5673
- else if (f.item.type === "custom_tool_call") {
5674
- let e = x[f.output_index];
5675
- x[f.output_index] = void 0, w = !0;
5676
- let t = i.toCustomToolName(f.item.name);
5677
- d.enqueue({
5678
- type: "tool-input-end",
5679
- id: f.item.call_id
5680
- }), d.enqueue({
5681
- type: "tool-call",
5682
- toolCallId: f.item.call_id,
5683
- toolName: t,
5684
- input: JSON.stringify(f.item.input),
5685
- providerMetadata: { [o]: {
5686
- itemId: f.item.id,
5687
- ...f.item.async == null ? e?.async == null ? {} : { async: e.async } : { async: f.item.async }
5688
- } }
5689
- });
5690
- } else if (f.item.type === "web_search_call") x[f.output_index] = void 0, d.enqueue({
5691
- type: "tool-result",
5692
- toolCallId: f.item.id,
5693
- toolName: i.toCustomToolName(r ?? "web_search"),
5694
- result: ar(f.item.action)
5695
- });
5696
- else if (f.item.type === "computer_call") {
5697
- if (x[f.output_index] = void 0, f.item.call_id == null) return d.enqueue({
5698
- type: "tool-input-end",
5699
- id: f.item.id
5700
- }), d.enqueue({
5701
- type: "tool-call",
5702
- toolCallId: f.item.id,
5703
- toolName: i.toCustomToolName("computer_use"),
5704
- input: "",
5705
- providerExecuted: !0
5706
- }), void d.enqueue({
5728
+ id: f.item.call_id
5729
+ }), d.enqueue({
5730
+ type: "tool-call",
5731
+ toolCallId: f.item.call_id,
5732
+ toolName: e,
5733
+ input: t,
5734
+ providerMetadata: { [o]: { itemId: f.item.id } }
5735
+ });
5736
+ } else if (f.item.type === "file_search_call") x[f.output_index] = void 0, d.enqueue({
5707
5737
  type: "tool-result",
5708
5738
  toolCallId: f.item.id,
5709
- toolName: i.toCustomToolName("computer_use"),
5739
+ toolName: i.toCustomToolName("file_search"),
5710
5740
  result: {
5711
- type: "computer_use_tool_result",
5712
- status: f.item.status
5741
+ queries: f.item.queries,
5742
+ results: f.item.results?.map((e) => ({
5743
+ attributes: e.attributes,
5744
+ fileId: e.file_id,
5745
+ filename: e.filename,
5746
+ score: e.score,
5747
+ text: e.text
5748
+ })) ?? null
5713
5749
  }
5714
5750
  });
5715
- w = !0;
5716
- let e = i.toCustomToolName("computer"), t = JSON.stringify(Zn(f.item));
5717
- d.enqueue({
5718
- type: "tool-input-delta",
5719
- id: f.item.call_id,
5720
- delta: t
5721
- }), d.enqueue({
5722
- type: "tool-input-end",
5723
- id: f.item.call_id
5724
- }), d.enqueue({
5725
- type: "tool-call",
5726
- toolCallId: f.item.call_id,
5727
- toolName: e,
5728
- input: t,
5729
- providerMetadata: { [o]: { itemId: f.item.id } }
5751
+ else if (f.item.type === "code_interpreter_call") x[f.output_index] = void 0, d.enqueue({
5752
+ type: "tool-result",
5753
+ toolCallId: f.item.id,
5754
+ toolName: i.toCustomToolName("code_interpreter"),
5755
+ result: { outputs: f.item.outputs }
5730
5756
  });
5731
- } else if (f.item.type === "file_search_call") x[f.output_index] = void 0, d.enqueue({
5732
- type: "tool-result",
5733
- toolCallId: f.item.id,
5734
- toolName: i.toCustomToolName("file_search"),
5735
- result: {
5736
- queries: f.item.queries,
5737
- results: f.item.results?.map((e) => ({
5738
- attributes: e.attributes,
5739
- fileId: e.file_id,
5740
- filename: e.filename,
5741
- score: e.score,
5742
- text: e.text
5743
- })) ?? null
5744
- }
5745
- });
5746
- else if (f.item.type === "code_interpreter_call") x[f.output_index] = void 0, d.enqueue({
5747
- type: "tool-result",
5748
- toolCallId: f.item.id,
5749
- toolName: i.toCustomToolName("code_interpreter"),
5750
- result: { outputs: f.item.outputs }
5751
- });
5752
- else if (f.item.type === "image_generation_call") d.enqueue({
5753
- type: "tool-result",
5754
- toolCallId: f.item.id,
5755
- toolName: i.toCustomToolName("image_generation"),
5756
- result: { result: f.item.result }
5757
- });
5758
- else if (f.item.type === "tool_search_call") {
5759
- let e = x[f.output_index], t = f.item.execution === "server";
5760
- if (e != null) {
5761
- let n = t ? e.toolCallId : f.item.call_id ?? f.item.id;
5762
- t ? j.push(n) : d.enqueue({
5763
- type: "tool-input-start",
5764
- id: n,
5765
- toolName: e.toolName
5757
+ else if (f.item.type === "image_generation_call") d.enqueue({
5758
+ type: "tool-result",
5759
+ toolCallId: f.item.id,
5760
+ toolName: i.toCustomToolName("image_generation"),
5761
+ result: { result: f.item.result }
5762
+ });
5763
+ else if (f.item.type === "tool_search_call") {
5764
+ let e = x[f.output_index], t = f.item.execution === "server";
5765
+ if (e != null) {
5766
+ let n = t ? e.toolCallId : f.item.call_id ?? f.item.id;
5767
+ t ? j.push(n) : d.enqueue({
5768
+ type: "tool-input-start",
5769
+ id: n,
5770
+ toolName: e.toolName
5771
+ }), d.enqueue({
5772
+ type: "tool-input-end",
5773
+ id: n
5774
+ }), d.enqueue({
5775
+ type: "tool-call",
5776
+ toolCallId: n,
5777
+ toolName: e.toolName,
5778
+ input: JSON.stringify({
5779
+ arguments: f.item.arguments,
5780
+ call_id: t ? null : n
5781
+ }),
5782
+ ...t ? { providerExecuted: !0 } : {},
5783
+ providerMetadata: { [o]: { itemId: f.item.id } }
5784
+ });
5785
+ }
5786
+ x[f.output_index] = void 0;
5787
+ } else if (f.item.type === "tool_search_output") {
5788
+ let e = f.item.call_id ?? j.shift() ?? f.item.id;
5789
+ d.enqueue({
5790
+ type: "tool-result",
5791
+ toolCallId: e,
5792
+ toolName: i.toCustomToolName("tool_search"),
5793
+ result: { tools: f.item.tools },
5794
+ providerMetadata: { [o]: { itemId: f.item.id } }
5795
+ });
5796
+ } else if (f.item.type === "mcp_call") {
5797
+ x[f.output_index] = void 0;
5798
+ let e = f.item.approval_request_id ?? void 0, t = e == null ? f.item.id : g.get(e) ?? m[e] ?? f.item.id, n = `mcp.${f.item.name}`;
5799
+ d.enqueue({
5800
+ type: "tool-call",
5801
+ toolCallId: t,
5802
+ toolName: n,
5803
+ input: f.item.arguments,
5804
+ providerExecuted: !0,
5805
+ dynamic: !0
5766
5806
  }), d.enqueue({
5767
- type: "tool-input-end",
5768
- id: n
5807
+ type: "tool-result",
5808
+ toolCallId: t,
5809
+ toolName: n,
5810
+ result: {
5811
+ type: "call",
5812
+ serverLabel: f.item.server_label,
5813
+ name: f.item.name,
5814
+ arguments: f.item.arguments,
5815
+ ...f.item.output == null ? {} : { output: f.item.output },
5816
+ ...f.item.error == null ? {} : { error: f.item.error }
5817
+ },
5818
+ providerMetadata: { [o]: { itemId: f.item.id } }
5819
+ });
5820
+ } else if (f.item.type === "mcp_list_tools") x[f.output_index] = void 0;
5821
+ else if (f.item.type === "apply_patch_call") {
5822
+ let e = x[f.output_index];
5823
+ e?.applyPatch && !e.applyPatch.endEmitted && f.item.operation.type !== "delete_file" && (e.applyPatch.hasDiff || d.enqueue({
5824
+ type: "tool-input-delta",
5825
+ id: e.toolCallId,
5826
+ delta: or(f.item.operation.diff)
5769
5827
  }), d.enqueue({
5828
+ type: "tool-input-delta",
5829
+ id: e.toolCallId,
5830
+ delta: "\"}}"
5831
+ }), d.enqueue({
5832
+ type: "tool-input-end",
5833
+ id: e.toolCallId
5834
+ }), e.applyPatch.endEmitted = !0), e && f.item.status === "completed" && (w = !0, d.enqueue({
5770
5835
  type: "tool-call",
5771
- toolCallId: n,
5772
- toolName: e.toolName,
5836
+ toolCallId: e.toolCallId,
5837
+ toolName: i.toCustomToolName("apply_patch"),
5773
5838
  input: JSON.stringify({
5774
- arguments: f.item.arguments,
5775
- call_id: t ? null : n
5839
+ callId: f.item.call_id,
5840
+ operation: f.item.operation
5776
5841
  }),
5777
- ...t ? { providerExecuted: !0 } : {},
5778
5842
  providerMetadata: { [o]: { itemId: f.item.id } }
5843
+ })), x[f.output_index] = void 0;
5844
+ } else if (f.item.type === "mcp_approval_request") {
5845
+ x[f.output_index] = void 0;
5846
+ let e = p.config.generateId?.() ?? c(), t = f.item.approval_request_id ?? f.item.id;
5847
+ g.set(t, e);
5848
+ let n = `mcp.${f.item.name}`;
5849
+ d.enqueue({
5850
+ type: "tool-call",
5851
+ toolCallId: e,
5852
+ toolName: n,
5853
+ input: f.item.arguments,
5854
+ providerExecuted: !0,
5855
+ dynamic: !0
5856
+ }), d.enqueue({
5857
+ type: "tool-approval-request",
5858
+ approvalId: t,
5859
+ toolCallId: e
5779
5860
  });
5780
- }
5781
- x[f.output_index] = void 0;
5782
- } else if (f.item.type === "tool_search_output") {
5783
- let e = f.item.call_id ?? j.shift() ?? f.item.id;
5784
- d.enqueue({
5785
- type: "tool-result",
5786
- toolCallId: e,
5787
- toolName: i.toCustomToolName("tool_search"),
5788
- result: { tools: f.item.tools },
5789
- providerMetadata: { [o]: { itemId: f.item.id } }
5790
- });
5791
- } else if (f.item.type === "mcp_call") {
5792
- x[f.output_index] = void 0;
5793
- let e = f.item.approval_request_id ?? void 0, t = e == null ? f.item.id : g.get(e) ?? m[e] ?? f.item.id, n = `mcp.${f.item.name}`;
5794
- d.enqueue({
5861
+ } else if (f.item.type === "local_shell_call") x[f.output_index] = void 0, d.enqueue({
5795
5862
  type: "tool-call",
5796
- toolCallId: t,
5797
- toolName: n,
5798
- input: f.item.arguments,
5799
- providerExecuted: !0,
5800
- dynamic: !0
5801
- }), d.enqueue({
5802
- type: "tool-result",
5803
- toolCallId: t,
5804
- toolName: n,
5805
- result: {
5806
- type: "call",
5807
- serverLabel: f.item.server_label,
5808
- name: f.item.name,
5809
- arguments: f.item.arguments,
5810
- ...f.item.output == null ? {} : { output: f.item.output },
5811
- ...f.item.error == null ? {} : { error: f.item.error }
5812
- },
5863
+ toolCallId: f.item.call_id,
5864
+ toolName: i.toCustomToolName("local_shell"),
5865
+ input: JSON.stringify({ action: {
5866
+ type: "exec",
5867
+ command: f.item.action.command,
5868
+ timeoutMs: f.item.action.timeout_ms,
5869
+ user: f.item.action.user,
5870
+ workingDirectory: f.item.action.working_directory,
5871
+ env: f.item.action.env
5872
+ } }),
5813
5873
  providerMetadata: { [o]: { itemId: f.item.id } }
5814
5874
  });
5815
- } else if (f.item.type === "mcp_list_tools") x[f.output_index] = void 0;
5816
- else if (f.item.type === "apply_patch_call") {
5817
- let e = x[f.output_index];
5818
- e?.applyPatch && !e.applyPatch.endEmitted && f.item.operation.type !== "delete_file" && (e.applyPatch.hasDiff || d.enqueue({
5819
- type: "tool-input-delta",
5820
- id: e.toolCallId,
5821
- delta: or(f.item.operation.diff)
5822
- }), d.enqueue({
5823
- type: "tool-input-delta",
5824
- id: e.toolCallId,
5825
- delta: "\"}}"
5826
- }), d.enqueue({
5827
- type: "tool-input-end",
5828
- id: e.toolCallId
5829
- }), e.applyPatch.endEmitted = !0), e && f.item.status === "completed" && (w = !0, d.enqueue({
5875
+ else if (f.item.type === "shell_call") x[f.output_index] = void 0, d.enqueue({
5830
5876
  type: "tool-call",
5831
- toolCallId: e.toolCallId,
5832
- toolName: i.toCustomToolName("apply_patch"),
5833
- input: JSON.stringify({
5834
- callId: f.item.call_id,
5835
- operation: f.item.operation
5836
- }),
5877
+ toolCallId: f.item.call_id,
5878
+ toolName: i.toCustomToolName("shell"),
5879
+ input: JSON.stringify({ action: { commands: f.item.action.commands } }),
5880
+ ...s && { providerExecuted: !0 },
5837
5881
  providerMetadata: { [o]: { itemId: f.item.id } }
5838
- })), x[f.output_index] = void 0;
5839
- } else if (f.item.type === "mcp_approval_request") {
5840
- x[f.output_index] = void 0;
5841
- let e = p.config.generateId?.() ?? c(), t = f.item.approval_request_id ?? f.item.id;
5842
- g.set(t, e);
5843
- let n = `mcp.${f.item.name}`;
5844
- d.enqueue({
5845
- type: "tool-call",
5846
- toolCallId: e,
5847
- toolName: n,
5848
- input: f.item.arguments,
5849
- providerExecuted: !0,
5850
- dynamic: !0
5851
- }), d.enqueue({
5852
- type: "tool-approval-request",
5853
- approvalId: t,
5854
- toolCallId: e
5855
5882
  });
5856
- } else if (f.item.type === "local_shell_call") x[f.output_index] = void 0, d.enqueue({
5857
- type: "tool-call",
5858
- toolCallId: f.item.call_id,
5859
- toolName: i.toCustomToolName("local_shell"),
5860
- input: JSON.stringify({ action: {
5861
- type: "exec",
5862
- command: f.item.action.command,
5863
- timeoutMs: f.item.action.timeout_ms,
5864
- user: f.item.action.user,
5865
- workingDirectory: f.item.action.working_directory,
5866
- env: f.item.action.env
5867
- } }),
5868
- providerMetadata: { [o]: { itemId: f.item.id } }
5869
- });
5870
- else if (f.item.type === "shell_call") x[f.output_index] = void 0, d.enqueue({
5871
- type: "tool-call",
5872
- toolCallId: f.item.call_id,
5873
- toolName: i.toCustomToolName("shell"),
5874
- input: JSON.stringify({ action: { commands: f.item.action.commands } }),
5875
- ...s && { providerExecuted: !0 },
5876
- providerMetadata: { [o]: { itemId: f.item.id } }
5877
- });
5878
- else if (f.item.type === "shell_call_output") d.enqueue({
5879
- type: "tool-result",
5880
- toolCallId: f.item.call_id,
5881
- toolName: i.toCustomToolName("shell"),
5882
- result: { output: f.item.output.map((e) => ({
5883
- stdout: e.stdout,
5884
- stderr: e.stderr,
5885
- outcome: e.outcome.type === "exit" ? {
5886
- type: "exit",
5887
- exitCode: e.outcome.exit_code
5888
- } : { type: "timeout" }
5889
- })) }
5890
- });
5891
- else if (f.item.type === "reasoning") {
5892
- let e = O({
5893
- itemId: f.item.id,
5894
- outputIndex: f.output_index
5895
- }), t = E[e];
5896
- if (t != null) {
5897
- let n = Object.entries(t.summaryParts).filter(([e, t]) => t === "active" || t === "can-conclude").map(([e]) => e);
5898
- for (let t of n) d.enqueue({
5899
- type: "reasoning-end",
5900
- id: `${e}:${t}`,
5901
- providerMetadata: { [o]: {
5902
- itemId: e,
5903
- reasoningEncryptedContent: f.item.encrypted_content ?? null
5904
- } }
5905
- });
5906
- delete E[e];
5907
- }
5908
- D[f.output_index] = void 0;
5909
- } else f.item.type === "compaction" && d.enqueue({
5910
- type: "custom",
5911
- kind: "openai.compaction",
5912
- providerMetadata: { [o]: {
5913
- type: "compaction",
5914
- itemId: f.item.id,
5915
- encryptedContent: f.item.encrypted_content
5916
- } }
5917
- });
5918
- }
5919
- else if (function(e) {
5883
+ else if (f.item.type === "shell_call_output") d.enqueue({
5884
+ type: "tool-result",
5885
+ toolCallId: f.item.call_id,
5886
+ toolName: i.toCustomToolName("shell"),
5887
+ result: { output: f.item.output.map((e) => ({
5888
+ stdout: e.stdout,
5889
+ stderr: e.stderr,
5890
+ outcome: e.outcome.type === "exit" ? {
5891
+ type: "exit",
5892
+ exitCode: e.outcome.exit_code
5893
+ } : { type: "timeout" }
5894
+ })) }
5895
+ });
5896
+ else if (f.item.type === "reasoning") {
5897
+ let e = O({
5898
+ itemId: f.item.id,
5899
+ outputIndex: f.output_index
5900
+ }), t = E[e];
5901
+ if (t != null) {
5902
+ let n = Object.entries(t.summaryParts).filter(([e, t]) => t === "active" || t === "can-conclude").map(([e]) => e);
5903
+ for (let t of n) d.enqueue({
5904
+ type: "reasoning-end",
5905
+ id: `${e}:${t}`,
5906
+ providerMetadata: { [o]: {
5907
+ itemId: e,
5908
+ reasoningEncryptedContent: f.item.encrypted_content ?? null
5909
+ } }
5910
+ });
5911
+ delete E[e];
5912
+ }
5913
+ D[f.output_index] = void 0;
5914
+ } else f.item.type === "compaction" && d.enqueue({
5915
+ type: "custom",
5916
+ kind: "openai.compaction",
5917
+ providerMetadata: { [o]: {
5918
+ type: "compaction",
5919
+ itemId: f.item.id,
5920
+ encryptedContent: f.item.encrypted_content
5921
+ } }
5922
+ });
5923
+ }
5924
+ } else if (function(e) {
5920
5925
  return e.type === "response.function_call_arguments.delta";
5921
5926
  }(f)) {
5922
5927
  let e = x[f.output_index];
@@ -6193,7 +6198,7 @@ function rr(e) {
6193
6198
  return e.type === "response.in_progress";
6194
6199
  }
6195
6200
  function ir(e) {
6196
- return !(e.type === "response.created" || e.type === "response.in_progress" || e.type === "response.failed" || e.type === "error" || e.type === "unknown_chunk");
6201
+ return e.type !== "response.created" && e.type !== "response.in_progress" && e.type !== "response.failed" && e.type !== "error" && e.type !== "unknown_chunk";
6197
6202
  }
6198
6203
  function ar(e) {
6199
6204
  if (e == null) return {};
@@ -6401,10 +6406,11 @@ var sr = "/v1/responses", cr = X(() => n(L({ inputFileExpiresAfter: G().int().mi
6401
6406
  data: t,
6402
6407
  message: `OpenAI batch "${e.batchId}" completed without batch output.`
6403
6408
  });
6404
- return fe(this.iterateBatchResults({
6409
+ let i = this.iterateBatchResults({
6405
6410
  fileIds: r,
6406
6411
  options: e
6407
- }));
6412
+ });
6413
+ return fe(i);
6408
6414
  }
6409
6415
  async retrieveBatch(e) {
6410
6416
  let { value: t } = await A({
@@ -6677,7 +6683,7 @@ var sr = "/v1/responses", cr = X(() => n(L({ inputFileExpiresAfter: G().int().mi
6677
6683
  modelId: ""
6678
6684
  });
6679
6685
  }
6680
- }, mr = new Set([
6686
+ }, mr = /* @__PURE__ */ new Set([
6681
6687
  "openai.code_interpreter",
6682
6688
  "openai.custom",
6683
6689
  "openai.file_search",
@@ -7107,10 +7113,12 @@ function Fr(e, t) {
7107
7113
  if (e.inputAudioFormat != null && (t.format = {
7108
7114
  type: e.inputAudioFormat.type,
7109
7115
  ...e.inputAudioFormat.rate == null ? {} : { rate: e.inputAudioFormat.rate }
7110
- }), e.turnDetection != null) if (e.turnDetection.type === "disabled") t.turn_detection = null;
7111
- else {
7112
- let n = { type: e.turnDetection.type === "server-vad" ? "server_vad" : "semantic_vad" };
7113
- e.turnDetection.threshold != null && (n.threshold = e.turnDetection.threshold), e.turnDetection.silenceDurationMs != null && (n.silence_duration_ms = e.turnDetection.silenceDurationMs), e.turnDetection.prefixPaddingMs != null && (n.prefix_padding_ms = e.turnDetection.prefixPaddingMs), t.turn_detection = n;
7116
+ }), e.turnDetection != null) {
7117
+ if (e.turnDetection.type === "disabled") t.turn_detection = null;
7118
+ else {
7119
+ let n = { type: e.turnDetection.type === "server-vad" ? "server_vad" : "semantic_vad" };
7120
+ e.turnDetection.threshold != null && (n.threshold = e.turnDetection.threshold), e.turnDetection.silenceDurationMs != null && (n.silence_duration_ms = e.turnDetection.silenceDurationMs), e.turnDetection.prefixPaddingMs != null && (n.prefix_padding_ms = e.turnDetection.prefixPaddingMs), t.turn_detection = n;
7121
+ }
7114
7122
  }
7115
7123
  e.inputAudioTranscription != null && (t.transcription = {
7116
7124
  model: e.inputAudioTranscription.model ?? "gpt-realtime-whisper",
@@ -7631,8 +7639,10 @@ var Ur = {
7631
7639
  temperature: r.temperature,
7632
7640
  timestamp_granularities: r.timestampGranularities
7633
7641
  };
7634
- for (let [e, n] of Object.entries(t)) if (n != null) if (Array.isArray(n)) for (let t of n) i.append(`${e}[]`, String(t));
7635
- else i.append(e, String(n));
7642
+ for (let [e, n] of Object.entries(t)) if (n != null) {
7643
+ if (Array.isArray(n)) for (let t of n) i.append(`${e}[]`, String(t));
7644
+ else i.append(e, String(n));
7645
+ }
7636
7646
  } else s && i.append("response_format", "diarized_json");
7637
7647
  return c != null && i.append("chunking_strategy", typeof c == "string" ? c : JSON.stringify({
7638
7648
  type: c.type,