@roomle/embedding-lib 11.0.0-alpha.1 → 11.0.0-alpha.11
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/THIRD-PARTY-NOTICES.txt +2 -2
- package/ai.js +86 -17
- package/ai.min.js +83 -13
- package/{browser-D6M-d6y5.mjs → browser-Cys-y5Hy.mjs} +1 -2
- package/chat-model-B7BO8IhK.mjs +212 -0
- package/chat-model-XYf503pT.mjs +213 -0
- package/coerce-CuLRCRlo.mjs +6 -0
- package/coerce-Dup0o-HR.mjs +7 -0
- package/{comlink-m82YLjsS.mjs → comlink-7u13Z2ZH.mjs} +2 -3
- package/{comlink-BYqErFai.mjs → comlink-DKhvPU0o.mjs} +1 -1
- package/configurator.js +7 -7
- package/configurator.min.js +6 -5
- package/construction.js +279 -22
- package/construction.min.js +287 -27
- package/continuation-CswXtOus.mjs +10 -0
- package/continuation-NclHDSgS.mjs +9 -0
- package/{dist-DCzWWudD.mjs → dist-7-X7Xqsl.mjs} +851 -919
- package/{dist-CjIZv2gB.mjs → dist-BMxyw-Zs.mjs} +411 -405
- package/{dist-wPZpiGiu.mjs → dist-BU022PnG.mjs} +4 -9
- package/{dist-CGgFMwb1.mjs → dist-BY8OLJ2p.mjs} +1 -1
- package/{dist-6TznX-Ae.mjs → dist-BZSd56sr.mjs} +3850 -3942
- package/{dist-Ur4DqwwC.mjs → dist-Ba3J8AjB.mjs} +400 -390
- package/{dist-CnTUCpLZ.mjs → dist-CbQKC1xX.mjs} +1590 -1616
- package/{dist-BsVeWZ8R.mjs → dist-CiybWJvs.mjs} +44 -41
- package/{dist-BI_3AeI-.mjs → dist-CkZuNdCU.mjs} +6 -4
- package/{dist-Bt1FopV4.mjs → dist-D2ZAAHGn.mjs} +1058 -1042
- package/{dist-Cxe4osFc.mjs → dist-DjsS42rR.mjs} +916 -962
- package/{dist-Cmx_tCV5.mjs → dist-Jcq_kKKT.mjs} +403 -393
- package/{dist-D0XFfKEL.mjs → dist-S9sLSjZ4.mjs} +3112 -3104
- package/{dist-BV-32IEX.mjs → dist-XECXrV5Q.mjs} +1497 -1558
- package/{dist-CZbrRF4T.mjs → dist-a5_BIeaS.mjs} +45 -51
- package/{dist-Dr3LcjP6.mjs → dist-bQAJDeYc.mjs} +698 -748
- package/docs/md/web/embedding/CHANGELOG.md +104 -175
- package/{drag-ghost-C1WS2KmW.mjs → drag-ghost-QZelgA-_.mjs} +2 -3
- package/{drag-ghost-B24KVqgc.mjs → drag-ghost-VmgSWLva.mjs} +5 -7
- package/{drag-in-O5uwMddL.mjs → drag-in-Cd_67tzS.mjs} +4 -5
- package/{drag-in-CWHSbwvG.mjs → drag-in-DlDsgY4T.mjs} +3 -3
- package/embedding-plugins.js +1 -2
- package/embedding-plugins.min.js +1 -2
- package/{experimental-evaluation-DyONuPyk.mjs → experimental-evaluation-B4hKMgFH.mjs} +19 -38
- package/{experimental-evaluation-DPkDk-5A.mjs → experimental-evaluation-DmqghFSx.mjs} +1 -1
- package/{from-custom-view-BgmiWIEN.mjs → from-custom-view-6HMD_sPe.mjs} +5 -4
- package/{from-custom-view-CxmIIsHU.mjs → from-custom-view-BRFynafo.mjs} +16 -16
- package/{from-website-CvcnHmr2.mjs → from-website-Dl1VN4h7.mjs} +5 -6
- package/{from-website-B8qFEG_R.mjs → from-website-iZzauH4C.mjs} +3 -3
- package/hi.js +251 -214
- package/hi.min.js +330 -288
- package/mcp-tools-BLB7pCga.mjs +42 -0
- package/mcp-tools-BirFT2R0.mjs +41 -0
- package/package.json +1 -1
- package/packages/common/src/utils/ai-model-relay.d.ts +22 -2
- package/packages/embedding-lib/src/ai.d.ts +3 -1
- package/packages/embedding-lib/src/hi.d.ts +1 -1
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +14 -2
- package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +1 -1
- package/packages/web-sdk/packages/assistant.d.ts +2 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/mcp-tools.d.ts +3 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/runtime.d.ts +6 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +3 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +3 -0
- package/rolldown-runtime--db92txo.mjs +10 -0
- package/rolldown-runtime-CyjYJMBa.mjs +11 -0
- package/roomle-embedding-lib.js +26 -38
- package/roomle-embedding-lib.min.js +8 -12
- package/sbom.cdx.json +5 -5
- package/turn-limits-9LbUeSG2.mjs +9 -0
- package/turn-limits-Ciq383Bd.mjs +10 -0
- package/{utils-BwWn6Fw4.mjs → utils-CJnKZceY.mjs} +3 -4
- package/{utils-BoELtcEK.mjs → utils-DdNhTbJr.mjs} +6 -6
- package/chat-model-CFuHw4cp.mjs +0 -322
- package/chat-model-JqqVnnmY.mjs +0 -327
- package/coerce-CqJod_GZ.mjs +0 -8
- package/coerce-CsI42_k0.mjs +0 -6
- /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-
|
|
3
|
-
import { t as De } from "./coerce-
|
|
4
|
-
import { t as Oe } from "./experimental-evaluation-
|
|
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 !== "\\")
|
|
385
|
-
if (
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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: [
|
|
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" &&
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
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:
|
|
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
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
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))
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
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-
|
|
5613
|
+
type: "tool-input-end",
|
|
5592
5614
|
id: e.call_id,
|
|
5593
|
-
|
|
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
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
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:
|
|
5604
|
-
delta:
|
|
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:
|
|
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:
|
|
5614
|
-
toolName:
|
|
5615
|
-
input:
|
|
5687
|
+
toolCallId: f.item.call_id,
|
|
5688
|
+
toolName: t,
|
|
5689
|
+
input: JSON.stringify(f.item.input),
|
|
5616
5690
|
providerMetadata: { [o]: {
|
|
5617
|
-
itemId:
|
|
5618
|
-
...
|
|
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
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
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:
|
|
5644
|
-
delta: t
|
|
5724
|
+
id: f.item.call_id,
|
|
5725
|
+
delta: t
|
|
5645
5726
|
}), d.enqueue({
|
|
5646
5727
|
type: "tool-input-end",
|
|
5647
|
-
id:
|
|
5648
|
-
}), d.enqueue(
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
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("
|
|
5739
|
+
toolName: i.toCustomToolName("file_search"),
|
|
5710
5740
|
result: {
|
|
5711
|
-
|
|
5712
|
-
|
|
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
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
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
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
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-
|
|
5768
|
-
|
|
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:
|
|
5772
|
-
toolName:
|
|
5836
|
+
toolCallId: e.toolCallId,
|
|
5837
|
+
toolName: i.toCustomToolName("apply_patch"),
|
|
5773
5838
|
input: JSON.stringify({
|
|
5774
|
-
|
|
5775
|
-
|
|
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:
|
|
5797
|
-
toolName:
|
|
5798
|
-
input:
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
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
|
-
|
|
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:
|
|
5832
|
-
toolName: i.toCustomToolName("
|
|
5833
|
-
input: JSON.stringify({
|
|
5834
|
-
|
|
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
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
})
|
|
5896
|
-
|
|
5897
|
-
|
|
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
|
|
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
|
-
|
|
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)
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
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)
|
|
7635
|
-
|
|
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,
|