@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.
- package/THIRD-PARTY-NOTICES.txt +2 -2
- package/ai.js +8 -8
- package/ai.min.js +7 -6
- package/{browser-D6M-d6y5.mjs → browser-Cys-y5Hy.mjs} +1 -2
- package/chat-model-DooKwd8I.mjs +117 -0
- package/chat-model-KHuz1Ej9.mjs +118 -0
- package/coerce-CuLRCRlo.mjs +6 -0
- package/coerce-Dup0o-HR.mjs +7 -0
- package/{comlink-CG3f9q6z.mjs → comlink-7u13Z2ZH.mjs} +2 -3
- package/{comlink-hSUzCx9j.mjs → comlink-DKhvPU0o.mjs} +1 -1
- package/configurator.js +3 -4
- package/configurator.min.js +2 -2
- package/construction.js +387 -31
- package/construction.min.js +395 -36
- package/continuation-COcMrXyj.mjs +14 -0
- package/continuation-D2hsmYf1.mjs +13 -0
- package/{dist-Cm3aF4sf.mjs → dist-7-X7Xqsl.mjs} +851 -919
- package/{dist-BQaw78-_.mjs → dist-BMxyw-Zs.mjs} +411 -405
- package/{dist-0WZWTj8T.mjs → dist-BU022PnG.mjs} +4 -9
- package/{dist-DkR6G9Kj.mjs → dist-BY8OLJ2p.mjs} +1 -1
- package/{dist-6TznX-Ae.mjs → dist-BZSd56sr.mjs} +3850 -3942
- package/{dist-70R0b5Mq.mjs → dist-Ba3J8AjB.mjs} +400 -390
- package/{dist-CTS0DDwt.mjs → dist-CbQKC1xX.mjs} +1590 -1616
- package/{dist-BmOBP9h9.mjs → dist-CiybWJvs.mjs} +44 -41
- package/{dist-CPG4atmb.mjs → dist-CkZuNdCU.mjs} +6 -4
- package/{dist-Bt1FopV4.mjs → dist-D2ZAAHGn.mjs} +1058 -1042
- package/{dist-BWNv7qW9.mjs → dist-DjsS42rR.mjs} +916 -962
- package/{dist-9UI7dzwc.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-Bc2s-kJZ.mjs → dist-a5_BIeaS.mjs} +45 -51
- package/{dist-Crrp-Bno.mjs → dist-bQAJDeYc.mjs} +698 -748
- package/{drag-ghost-BpIDzSdK.mjs → drag-ghost-QZelgA-_.mjs} +2 -3
- package/{drag-ghost-Bhb0_67G.mjs → drag-ghost-VmgSWLva.mjs} +5 -7
- package/{drag-in-mE_ozj_Q.mjs → drag-in-Cd_67tzS.mjs} +4 -5
- package/{drag-in-CGBG4wEk.mjs → drag-in-DlDsgY4T.mjs} +3 -3
- package/embedding-plugins.js +1 -2
- package/embedding-plugins.min.js +1 -2
- package/{experimental-evaluation-FzKFGoye.mjs → experimental-evaluation-B4hKMgFH.mjs} +19 -38
- package/{experimental-evaluation-DczxmJme.mjs → experimental-evaluation-DmqghFSx.mjs} +1 -1
- package/{from-custom-view-B3fIWMox.mjs → from-custom-view-6HMD_sPe.mjs} +5 -4
- package/{from-custom-view-B3HCOhdT.mjs → from-custom-view-BRFynafo.mjs} +16 -16
- package/{from-website-DaTahmvJ.mjs → from-website-Dl1VN4h7.mjs} +5 -6
- package/{from-website-DUQ9USj1.mjs → from-website-iZzauH4C.mjs} +3 -3
- package/hi.js +228 -233
- package/hi.min.js +207 -204
- package/mcp-tools-C6O2gQZW.mjs +41 -0
- package/mcp-tools-m_3IX0vB.mjs +40 -0
- package/package.json +1 -1
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +0 -6
- package/packages/web-sdk/packages/assistant.d.ts +3 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-recovery.d.ts +5 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -3
- package/packages/web-sdk/packages/common-core/src/planning-assistant/runtime.d.ts +4 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +2 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/usage.d.ts +16 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +19 -1
- package/rolldown-runtime--db92txo.mjs +10 -0
- package/rolldown-runtime-CyjYJMBa.mjs +11 -0
- package/roomle-embedding-lib.js +25 -34
- package/roomle-embedding-lib.min.js +3 -3
- package/sbom.cdx.json +5 -5
- package/usage-CgXarvBY.mjs +16 -0
- package/usage-c8evaONq.mjs +17 -0
- package/{utils-BwWn6Fw4.mjs → utils-CJnKZceY.mjs} +3 -4
- package/{utils-BoELtcEK.mjs → utils-DdNhTbJr.mjs} +6 -6
- package/chat-model-C1ov616e.mjs +0 -377
- package/chat-model-CifTV-8H.mjs +0 -373
- package/coerce-CqJod_GZ.mjs +0 -8
- package/coerce-CsI42_k0.mjs +0 -6
- package/mcp-tools-CC8DTfZA.mjs +0 -2
- package/mcp-tools-CfJ_ue_2.mjs +0 -2
- /package/{browser-BjtSrqbu.mjs → browser-CzLpXYFF.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as e, A as t, Bt as n, D as r, E as i, Et as a, H as o, Ht as s, It as c, Jt as l, K as u, Kt as d, L as f, Lt as p, M as m, Mt as h, N as g, O as _, Ot as v, Pn as y, Qt as b, Rt as x, S, Sn as C, Tt as w, Vt as T, Wt as E, X as D, Yt as O, Zt as k, _ as A, _n as j, _t as M, an as N, b as P, bn as ee, bt as F, cn as te, dn as I, dt as L, en as ne, f as R, fn as z, ft as re, h as ie, ht as ae, i as oe, in as B, j as V, jn as H, jt as U, k as W, kn as se, ln as G, lt as ce, mt as K, nn as le, nt as ue, o as de, ot as q, p as fe, qt as pe, sn as J, st as me, tn as Y, v as he, w as ge, xn as _e, yt as ve, zt as ye } from "./dist-
|
|
3
|
-
import { t as be } from "./coerce-
|
|
2
|
+
import { $ as e, A as t, Bt as n, D as r, E as i, Et as a, H as o, Ht as s, It as c, Jt as l, K as u, Kt as d, L as f, Lt as p, M as m, Mt as h, N as g, O as _, Ot as v, Pn as y, Qt as b, Rt as x, S, Sn as C, Tt as w, Vt as T, Wt as E, X as D, Yt as O, Zt as k, _ as A, _n as j, _t as M, an as N, b as P, bn as ee, bt as F, cn as te, dn as I, dt as L, en as ne, f as R, fn as z, ft as re, h as ie, ht as ae, i as oe, in as B, j as V, jn as H, jt as U, k as W, kn as se, ln as G, lt as ce, mt as K, nn as le, nt as ue, o as de, ot as q, p as fe, qt as pe, sn as J, st as me, tn as Y, v as he, w as ge, xn as _e, yt as ve, zt as ye } from "./dist-D2ZAAHGn.mjs";
|
|
3
|
+
import { t as be } from "./coerce-CuLRCRlo.mjs";
|
|
4
4
|
var xe = N({ error: N({
|
|
5
5
|
message: G(),
|
|
6
6
|
type: G().nullish(),
|
|
@@ -380,14 +380,16 @@ function Re(e) {
|
|
|
380
380
|
for (let r = 0; r < e.length; r++) {
|
|
381
381
|
let i = e[r];
|
|
382
382
|
if (t) t = !1;
|
|
383
|
-
else if (i !== "\\")
|
|
384
|
-
if (
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
383
|
+
else if (i !== "\\") {
|
|
384
|
+
if (i !== "[") {
|
|
385
|
+
if (i !== "]") {
|
|
386
|
+
if (!n && i === "(" && e[r + 1] === "?") {
|
|
387
|
+
let t = e[r + 2];
|
|
388
|
+
if (t === "=" || t === "!" || t === "<" && (e[r + 3] === "=" || e[r + 3] === "!")) return !0;
|
|
389
|
+
}
|
|
390
|
+
} else n = !1;
|
|
391
|
+
} else n = !0;
|
|
392
|
+
} else t = !0;
|
|
391
393
|
}
|
|
392
394
|
return !1;
|
|
393
395
|
}(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)])));
|
|
@@ -1694,8 +1696,10 @@ var ut = {
|
|
|
1694
1696
|
temperature: r.temperature,
|
|
1695
1697
|
timestamp_granularities: r.timestampGranularities
|
|
1696
1698
|
};
|
|
1697
|
-
for (let [e, n] of Object.entries(t)) if (n != null)
|
|
1698
|
-
|
|
1699
|
+
for (let [e, n] of Object.entries(t)) if (n != null) {
|
|
1700
|
+
if (Array.isArray(n)) for (let t of n) i.append(`${e}[]`, String(t));
|
|
1701
|
+
else i.append(e, String(n));
|
|
1702
|
+
}
|
|
1699
1703
|
} else s && i.append("response_format", "diarized_json");
|
|
1700
1704
|
return c != null && i.append("chunking_strategy", typeof c == "string" ? c : JSON.stringify({
|
|
1701
1705
|
type: c.type,
|
|
@@ -2597,7 +2601,7 @@ var qt = ne(() => I([
|
|
|
2597
2601
|
code: G().nullish(),
|
|
2598
2602
|
message: G(),
|
|
2599
2603
|
param: G().nullish()
|
|
2600
|
-
}), on = new Set([
|
|
2604
|
+
}), on = /* @__PURE__ */ new Set([
|
|
2601
2605
|
"error",
|
|
2602
2606
|
"response.apply_patch_call_operation_diff.delta",
|
|
2603
2607
|
"response.apply_patch_call_operation_diff.done",
|
|
@@ -2619,7 +2623,7 @@ var qt = ne(() => I([
|
|
|
2619
2623
|
"response.reasoning_summary_part.added",
|
|
2620
2624
|
"response.reasoning_summary_part.done",
|
|
2621
2625
|
"response.reasoning_summary_text.delta"
|
|
2622
|
-
]), sn = new Set([
|
|
2626
|
+
]), sn = /* @__PURE__ */ new Set([
|
|
2623
2627
|
"apply_patch_call",
|
|
2624
2628
|
"code_interpreter_call",
|
|
2625
2629
|
"compaction",
|
|
@@ -4260,7 +4264,7 @@ var In = {
|
|
|
4260
4264
|
let i = r.get(e.toolCallId);
|
|
4261
4265
|
i == null ? r.set(e.toolCallId, {
|
|
4262
4266
|
metadata: e,
|
|
4263
|
-
results: new Map([[e.index, t]]),
|
|
4267
|
+
results: /* @__PURE__ */ new Map([[e.index, t]]),
|
|
4264
4268
|
invalid: !1
|
|
4265
4269
|
}) : Ht(i.metadata, e) && !i.results.has(e.index) ? i.results.set(e.index, t) : i.invalid = !0;
|
|
4266
4270
|
}
|
|
@@ -5783,413 +5787,416 @@ var In = {
|
|
|
5783
5787
|
toolName: t,
|
|
5784
5788
|
providerExecuted: !0
|
|
5785
5789
|
});
|
|
5786
|
-
} else if (f.item.type !== "tool_search_output" &&
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5790
|
+
} 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") {
|
|
5791
|
+
if (f.item.type === "apply_patch_call") {
|
|
5792
|
+
let { call_id: e, operation: t } = f.item;
|
|
5793
|
+
if (x[f.output_index] = {
|
|
5794
|
+
toolName: i.toCustomToolName("apply_patch"),
|
|
5795
|
+
toolCallId: e,
|
|
5796
|
+
applyPatch: {
|
|
5797
|
+
hasDiff: t.type === "delete_file",
|
|
5798
|
+
endEmitted: t.type === "delete_file"
|
|
5799
|
+
}
|
|
5800
|
+
}, d.enqueue({
|
|
5801
|
+
type: "tool-input-start",
|
|
5802
|
+
id: e,
|
|
5803
|
+
toolName: i.toCustomToolName("apply_patch")
|
|
5804
|
+
}), t.type === "delete_file") {
|
|
5805
|
+
let n = JSON.stringify({
|
|
5806
|
+
callId: e,
|
|
5807
|
+
operation: t
|
|
5808
|
+
});
|
|
5809
|
+
d.enqueue({
|
|
5810
|
+
type: "tool-input-delta",
|
|
5811
|
+
id: e,
|
|
5812
|
+
delta: n
|
|
5813
|
+
}), d.enqueue({
|
|
5814
|
+
type: "tool-input-end",
|
|
5815
|
+
id: e
|
|
5816
|
+
});
|
|
5817
|
+
} else d.enqueue({
|
|
5805
5818
|
type: "tool-input-delta",
|
|
5806
5819
|
id: e,
|
|
5807
|
-
delta:
|
|
5808
|
-
}), d.enqueue({
|
|
5809
|
-
type: "tool-input-end",
|
|
5810
|
-
id: e
|
|
5820
|
+
delta: `{"callId":"${$(e)}","operation":{"type":"${$(t.type)}","path":"${$(t.path)}","diff":"`
|
|
5811
5821
|
});
|
|
5812
|
-
} else
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
itemId: f.item.id,
|
|
5835
|
-
reasoningEncryptedContent: f.item.encrypted_content ?? null
|
|
5836
|
-
} }
|
|
5837
|
-
})));
|
|
5822
|
+
} else f.item.type === "shell_call" ? x[f.output_index] = {
|
|
5823
|
+
toolName: i.toCustomToolName("shell"),
|
|
5824
|
+
toolCallId: f.item.call_id
|
|
5825
|
+
} : f.item.type === "shell_call_output" || (f.item.type === "message" ? (D[f.output_index] = f.item.id, C.splice(0), w = f.item.phase ?? void 0, d.enqueue({
|
|
5826
|
+
type: "text-start",
|
|
5827
|
+
id: f.item.id,
|
|
5828
|
+
providerMetadata: { [s]: {
|
|
5829
|
+
itemId: f.item.id,
|
|
5830
|
+
...f.item.phase != null && { phase: f.item.phase }
|
|
5831
|
+
} }
|
|
5832
|
+
})) : zn(f) && f.item.type === "reasoning" && (D[f.output_index] = f.item.id, E[f.item.id] = {
|
|
5833
|
+
encryptedContent: f.item.encrypted_content,
|
|
5834
|
+
summaryParts: { 0: "active" }
|
|
5835
|
+
}, d.enqueue({
|
|
5836
|
+
type: "reasoning-start",
|
|
5837
|
+
id: `${f.item.id}:0`,
|
|
5838
|
+
providerMetadata: { [s]: {
|
|
5839
|
+
itemId: f.item.id,
|
|
5840
|
+
reasoningEncryptedContent: f.item.encrypted_content ?? null
|
|
5841
|
+
} }
|
|
5842
|
+
})));
|
|
5843
|
+
}
|
|
5838
5844
|
} else if (function(e) {
|
|
5839
5845
|
return e.type === "response.output_item.done";
|
|
5840
|
-
}(f))
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5846
|
+
}(f)) {
|
|
5847
|
+
if (f.item.type === "message") {
|
|
5848
|
+
let e = O({
|
|
5849
|
+
itemId: f.item.id,
|
|
5850
|
+
outputIndex: f.output_index
|
|
5851
|
+
}), t = f.item.phase ?? w;
|
|
5852
|
+
w = void 0, d.enqueue({
|
|
5853
|
+
type: "text-end",
|
|
5854
|
+
id: e,
|
|
5855
|
+
providerMetadata: { [s]: {
|
|
5856
|
+
itemId: e,
|
|
5857
|
+
...t != null && { phase: t },
|
|
5858
|
+
...C.length > 0 && { annotations: C }
|
|
5859
|
+
} }
|
|
5860
|
+
}), D[f.output_index] = void 0;
|
|
5861
|
+
} else {
|
|
5862
|
+
if (f.item.type === "function_call") {
|
|
5863
|
+
let e = f.item, t = x[f.output_index];
|
|
5864
|
+
x[f.output_index] = void 0, T = !0;
|
|
5865
|
+
let n = t?.suppressInputStreaming ?? Lt({
|
|
5866
|
+
toolName: e.name,
|
|
5867
|
+
tools: h
|
|
5868
|
+
}), r = () => {
|
|
5869
|
+
if (n) {
|
|
5870
|
+
d.enqueue({
|
|
5871
|
+
type: "tool-input-start",
|
|
5872
|
+
id: e.call_id,
|
|
5873
|
+
toolName: e.name
|
|
5874
|
+
});
|
|
5875
|
+
let n = t?.bufferedInputDeltas ?? [];
|
|
5876
|
+
if (n.length > 0) for (let t of n) d.enqueue({
|
|
5877
|
+
type: "tool-input-delta",
|
|
5878
|
+
id: e.call_id,
|
|
5879
|
+
delta: t
|
|
5880
|
+
});
|
|
5881
|
+
else e.arguments.length > 0 && d.enqueue({
|
|
5882
|
+
type: "tool-input-delta",
|
|
5883
|
+
id: e.call_id,
|
|
5884
|
+
delta: e.arguments
|
|
5885
|
+
});
|
|
5886
|
+
}
|
|
5863
5887
|
d.enqueue({
|
|
5864
|
-
type: "tool-input-
|
|
5865
|
-
id: e.call_id,
|
|
5866
|
-
toolName: e.name
|
|
5867
|
-
});
|
|
5868
|
-
let n = t?.bufferedInputDeltas ?? [];
|
|
5869
|
-
if (n.length > 0) for (let t of n) d.enqueue({
|
|
5870
|
-
type: "tool-input-delta",
|
|
5888
|
+
type: "tool-input-end",
|
|
5871
5889
|
id: e.call_id,
|
|
5872
|
-
|
|
5890
|
+
...e.namespace != null && { providerMetadata: { [s]: { namespace: e.namespace } } }
|
|
5891
|
+
}), d.enqueue({
|
|
5892
|
+
type: "tool-call",
|
|
5893
|
+
toolCallId: e.call_id,
|
|
5894
|
+
toolName: e.name,
|
|
5895
|
+
input: e.arguments,
|
|
5896
|
+
providerMetadata: { [s]: {
|
|
5897
|
+
itemId: e.id,
|
|
5898
|
+
...e.async == null ? t?.async == null ? {} : { async: t.async } : { async: e.async },
|
|
5899
|
+
...e.namespace != null && { namespace: e.namespace },
|
|
5900
|
+
...e.caller != null && { caller: e.caller.type === "program" ? {
|
|
5901
|
+
type: "program",
|
|
5902
|
+
callerId: e.caller.caller_id
|
|
5903
|
+
} : e.caller }
|
|
5904
|
+
} }
|
|
5873
5905
|
});
|
|
5874
|
-
|
|
5906
|
+
};
|
|
5907
|
+
return n ? Rt({
|
|
5908
|
+
toolCall: {
|
|
5909
|
+
toolCallId: e.call_id,
|
|
5910
|
+
toolName: e.name,
|
|
5911
|
+
input: e.arguments
|
|
5912
|
+
},
|
|
5913
|
+
tools: h,
|
|
5914
|
+
providerOptionsName: s,
|
|
5915
|
+
itemId: e.id
|
|
5916
|
+
}).then((e) => {
|
|
5917
|
+
if (e != null) for (let t of e) d.enqueue({
|
|
5918
|
+
type: "tool-input-start",
|
|
5919
|
+
id: t.toolCallId,
|
|
5920
|
+
toolName: t.toolName
|
|
5921
|
+
}), d.enqueue({
|
|
5875
5922
|
type: "tool-input-delta",
|
|
5876
|
-
id:
|
|
5877
|
-
delta:
|
|
5878
|
-
})
|
|
5879
|
-
|
|
5923
|
+
id: t.toolCallId,
|
|
5924
|
+
delta: t.input
|
|
5925
|
+
}), d.enqueue({
|
|
5926
|
+
type: "tool-input-end",
|
|
5927
|
+
id: t.toolCallId
|
|
5928
|
+
}), d.enqueue(t);
|
|
5929
|
+
else r();
|
|
5930
|
+
}) : void r();
|
|
5931
|
+
}
|
|
5932
|
+
if (f.item.type === "program") d.enqueue({
|
|
5933
|
+
type: "tool-call",
|
|
5934
|
+
toolCallId: f.item.call_id,
|
|
5935
|
+
toolName: i.toCustomToolName("programmatic_tool_calling"),
|
|
5936
|
+
input: JSON.stringify({
|
|
5937
|
+
code: f.item.code,
|
|
5938
|
+
fingerprint: f.item.fingerprint
|
|
5939
|
+
}),
|
|
5940
|
+
providerExecuted: !0,
|
|
5941
|
+
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
5942
|
+
});
|
|
5943
|
+
else if (f.item.type === "program_output") d.enqueue({
|
|
5944
|
+
type: "tool-result",
|
|
5945
|
+
toolCallId: f.item.call_id,
|
|
5946
|
+
toolName: i.toCustomToolName("programmatic_tool_calling"),
|
|
5947
|
+
result: {
|
|
5948
|
+
result: f.item.result,
|
|
5949
|
+
status: f.item.status
|
|
5950
|
+
},
|
|
5951
|
+
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
5952
|
+
});
|
|
5953
|
+
else if (f.item.type === "custom_tool_call") {
|
|
5954
|
+
let e = x[f.output_index];
|
|
5955
|
+
x[f.output_index] = void 0, T = !0;
|
|
5956
|
+
let t = i.toCustomToolName(f.item.name);
|
|
5880
5957
|
d.enqueue({
|
|
5881
5958
|
type: "tool-input-end",
|
|
5882
|
-
id:
|
|
5883
|
-
...e.namespace != null && { providerMetadata: { [s]: { namespace: e.namespace } } }
|
|
5959
|
+
id: f.item.call_id
|
|
5884
5960
|
}), d.enqueue({
|
|
5885
5961
|
type: "tool-call",
|
|
5886
|
-
toolCallId:
|
|
5887
|
-
toolName:
|
|
5888
|
-
input:
|
|
5962
|
+
toolCallId: f.item.call_id,
|
|
5963
|
+
toolName: t,
|
|
5964
|
+
input: JSON.stringify(f.item.input),
|
|
5889
5965
|
providerMetadata: { [s]: {
|
|
5890
|
-
itemId:
|
|
5891
|
-
...
|
|
5892
|
-
...e.namespace != null && { namespace: e.namespace },
|
|
5893
|
-
...e.caller != null && { caller: e.caller.type === "program" ? {
|
|
5894
|
-
type: "program",
|
|
5895
|
-
callerId: e.caller.caller_id
|
|
5896
|
-
} : e.caller }
|
|
5966
|
+
itemId: f.item.id,
|
|
5967
|
+
...f.item.async == null ? e?.async == null ? {} : { async: e.async } : { async: f.item.async }
|
|
5897
5968
|
} }
|
|
5898
5969
|
});
|
|
5899
|
-
}
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
}).then((e) => {
|
|
5910
|
-
if (e != null) for (let t of e) d.enqueue({
|
|
5911
|
-
type: "tool-input-start",
|
|
5912
|
-
id: t.toolCallId,
|
|
5913
|
-
toolName: t.toolName
|
|
5970
|
+
} else if (f.item.type === "web_search_call") x[f.output_index] = void 0, d.enqueue({
|
|
5971
|
+
type: "tool-result",
|
|
5972
|
+
toolCallId: f.item.id,
|
|
5973
|
+
toolName: i.toCustomToolName(r ?? "web_search"),
|
|
5974
|
+
result: Un(f.item.action)
|
|
5975
|
+
});
|
|
5976
|
+
else if (f.item.type === "computer_call") {
|
|
5977
|
+
if (x[f.output_index] = void 0, f.item.call_id == null) return d.enqueue({
|
|
5978
|
+
type: "tool-input-end",
|
|
5979
|
+
id: f.item.id
|
|
5914
5980
|
}), d.enqueue({
|
|
5981
|
+
type: "tool-call",
|
|
5982
|
+
toolCallId: f.item.id,
|
|
5983
|
+
toolName: i.toCustomToolName("computer_use"),
|
|
5984
|
+
input: "",
|
|
5985
|
+
providerExecuted: !0
|
|
5986
|
+
}), void d.enqueue({
|
|
5987
|
+
type: "tool-result",
|
|
5988
|
+
toolCallId: f.item.id,
|
|
5989
|
+
toolName: i.toCustomToolName("computer_use"),
|
|
5990
|
+
result: {
|
|
5991
|
+
type: "computer_use_tool_result",
|
|
5992
|
+
status: f.item.status
|
|
5993
|
+
}
|
|
5994
|
+
});
|
|
5995
|
+
T = !0;
|
|
5996
|
+
let e = i.toCustomToolName("computer"), t = JSON.stringify(Fn(f.item));
|
|
5997
|
+
d.enqueue({
|
|
5915
5998
|
type: "tool-input-delta",
|
|
5916
|
-
id:
|
|
5917
|
-
delta: t
|
|
5999
|
+
id: f.item.call_id,
|
|
6000
|
+
delta: t
|
|
5918
6001
|
}), d.enqueue({
|
|
5919
6002
|
type: "tool-input-end",
|
|
5920
|
-
id:
|
|
5921
|
-
}), d.enqueue(
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
input: JSON.stringify({
|
|
5930
|
-
code: f.item.code,
|
|
5931
|
-
fingerprint: f.item.fingerprint
|
|
5932
|
-
}),
|
|
5933
|
-
providerExecuted: !0,
|
|
5934
|
-
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
5935
|
-
});
|
|
5936
|
-
else if (f.item.type === "program_output") d.enqueue({
|
|
5937
|
-
type: "tool-result",
|
|
5938
|
-
toolCallId: f.item.call_id,
|
|
5939
|
-
toolName: i.toCustomToolName("programmatic_tool_calling"),
|
|
5940
|
-
result: {
|
|
5941
|
-
result: f.item.result,
|
|
5942
|
-
status: f.item.status
|
|
5943
|
-
},
|
|
5944
|
-
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
5945
|
-
});
|
|
5946
|
-
else if (f.item.type === "custom_tool_call") {
|
|
5947
|
-
let e = x[f.output_index];
|
|
5948
|
-
x[f.output_index] = void 0, T = !0;
|
|
5949
|
-
let t = i.toCustomToolName(f.item.name);
|
|
5950
|
-
d.enqueue({
|
|
5951
|
-
type: "tool-input-end",
|
|
5952
|
-
id: f.item.call_id
|
|
5953
|
-
}), d.enqueue({
|
|
5954
|
-
type: "tool-call",
|
|
5955
|
-
toolCallId: f.item.call_id,
|
|
5956
|
-
toolName: t,
|
|
5957
|
-
input: JSON.stringify(f.item.input),
|
|
5958
|
-
providerMetadata: { [s]: {
|
|
5959
|
-
itemId: f.item.id,
|
|
5960
|
-
...f.item.async == null ? e?.async == null ? {} : { async: e.async } : { async: f.item.async }
|
|
5961
|
-
} }
|
|
5962
|
-
});
|
|
5963
|
-
} else if (f.item.type === "web_search_call") x[f.output_index] = void 0, d.enqueue({
|
|
5964
|
-
type: "tool-result",
|
|
5965
|
-
toolCallId: f.item.id,
|
|
5966
|
-
toolName: i.toCustomToolName(r ?? "web_search"),
|
|
5967
|
-
result: Un(f.item.action)
|
|
5968
|
-
});
|
|
5969
|
-
else if (f.item.type === "computer_call") {
|
|
5970
|
-
if (x[f.output_index] = void 0, f.item.call_id == null) return d.enqueue({
|
|
5971
|
-
type: "tool-input-end",
|
|
5972
|
-
id: f.item.id
|
|
5973
|
-
}), d.enqueue({
|
|
5974
|
-
type: "tool-call",
|
|
5975
|
-
toolCallId: f.item.id,
|
|
5976
|
-
toolName: i.toCustomToolName("computer_use"),
|
|
5977
|
-
input: "",
|
|
5978
|
-
providerExecuted: !0
|
|
5979
|
-
}), void d.enqueue({
|
|
6003
|
+
id: f.item.call_id
|
|
6004
|
+
}), d.enqueue({
|
|
6005
|
+
type: "tool-call",
|
|
6006
|
+
toolCallId: f.item.call_id,
|
|
6007
|
+
toolName: e,
|
|
6008
|
+
input: t,
|
|
6009
|
+
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6010
|
+
});
|
|
6011
|
+
} else if (f.item.type === "file_search_call") x[f.output_index] = void 0, d.enqueue({
|
|
5980
6012
|
type: "tool-result",
|
|
5981
6013
|
toolCallId: f.item.id,
|
|
5982
|
-
toolName: i.toCustomToolName("
|
|
6014
|
+
toolName: i.toCustomToolName("file_search"),
|
|
5983
6015
|
result: {
|
|
5984
|
-
|
|
5985
|
-
|
|
6016
|
+
queries: f.item.queries,
|
|
6017
|
+
results: f.item.results?.map((e) => ({
|
|
6018
|
+
attributes: e.attributes,
|
|
6019
|
+
fileId: e.file_id,
|
|
6020
|
+
filename: e.filename,
|
|
6021
|
+
score: e.score,
|
|
6022
|
+
text: e.text
|
|
6023
|
+
})) ?? null
|
|
5986
6024
|
}
|
|
5987
6025
|
});
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
delta: t
|
|
5994
|
-
}), d.enqueue({
|
|
5995
|
-
type: "tool-input-end",
|
|
5996
|
-
id: f.item.call_id
|
|
5997
|
-
}), d.enqueue({
|
|
5998
|
-
type: "tool-call",
|
|
5999
|
-
toolCallId: f.item.call_id,
|
|
6000
|
-
toolName: e,
|
|
6001
|
-
input: t,
|
|
6002
|
-
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6026
|
+
else if (f.item.type === "code_interpreter_call") x[f.output_index] = void 0, d.enqueue({
|
|
6027
|
+
type: "tool-result",
|
|
6028
|
+
toolCallId: f.item.id,
|
|
6029
|
+
toolName: i.toCustomToolName("code_interpreter"),
|
|
6030
|
+
result: { outputs: f.item.outputs }
|
|
6003
6031
|
});
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6032
|
+
else if (f.item.type === "image_generation_call") d.enqueue({
|
|
6033
|
+
type: "tool-result",
|
|
6034
|
+
toolCallId: f.item.id,
|
|
6035
|
+
toolName: i.toCustomToolName("image_generation"),
|
|
6036
|
+
result: { result: f.item.result }
|
|
6037
|
+
});
|
|
6038
|
+
else if (f.item.type === "tool_search_call") {
|
|
6039
|
+
let e = x[f.output_index], t = f.item.execution === "server";
|
|
6040
|
+
if (e != null) {
|
|
6041
|
+
let n = t ? e.toolCallId : f.item.call_id ?? f.item.id;
|
|
6042
|
+
t ? M.push(n) : d.enqueue({
|
|
6043
|
+
type: "tool-input-start",
|
|
6044
|
+
id: n,
|
|
6045
|
+
toolName: e.toolName
|
|
6046
|
+
}), d.enqueue({
|
|
6047
|
+
type: "tool-input-end",
|
|
6048
|
+
id: n
|
|
6049
|
+
}), d.enqueue({
|
|
6050
|
+
type: "tool-call",
|
|
6051
|
+
toolCallId: n,
|
|
6052
|
+
toolName: e.toolName,
|
|
6053
|
+
input: JSON.stringify({
|
|
6054
|
+
arguments: f.item.arguments,
|
|
6055
|
+
call_id: t ? null : n
|
|
6056
|
+
}),
|
|
6057
|
+
...t ? { providerExecuted: !0 } : {},
|
|
6058
|
+
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6059
|
+
});
|
|
6060
|
+
}
|
|
6061
|
+
x[f.output_index] = void 0;
|
|
6062
|
+
} else if (f.item.type === "tool_search_output") {
|
|
6063
|
+
let e = f.item.call_id ?? M.shift() ?? f.item.id;
|
|
6064
|
+
d.enqueue({
|
|
6065
|
+
type: "tool-result",
|
|
6066
|
+
toolCallId: e,
|
|
6067
|
+
toolName: i.toCustomToolName("tool_search"),
|
|
6068
|
+
result: { tools: f.item.tools },
|
|
6069
|
+
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6070
|
+
});
|
|
6071
|
+
} else if (f.item.type === "mcp_call") {
|
|
6072
|
+
x[f.output_index] = void 0;
|
|
6073
|
+
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}`;
|
|
6074
|
+
d.enqueue({
|
|
6075
|
+
type: "tool-call",
|
|
6076
|
+
toolCallId: t,
|
|
6077
|
+
toolName: n,
|
|
6078
|
+
input: f.item.arguments,
|
|
6079
|
+
providerExecuted: !0,
|
|
6080
|
+
dynamic: !0
|
|
6039
6081
|
}), d.enqueue({
|
|
6040
|
-
type: "tool-
|
|
6041
|
-
|
|
6082
|
+
type: "tool-result",
|
|
6083
|
+
toolCallId: t,
|
|
6084
|
+
toolName: n,
|
|
6085
|
+
result: {
|
|
6086
|
+
type: "call",
|
|
6087
|
+
serverLabel: f.item.server_label,
|
|
6088
|
+
name: f.item.name,
|
|
6089
|
+
arguments: f.item.arguments,
|
|
6090
|
+
...f.item.output == null ? {} : { output: f.item.output },
|
|
6091
|
+
...f.item.error == null ? {} : { error: f.item.error }
|
|
6092
|
+
},
|
|
6093
|
+
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6094
|
+
});
|
|
6095
|
+
} else if (f.item.type === "mcp_list_tools") x[f.output_index] = void 0;
|
|
6096
|
+
else if (f.item.type === "apply_patch_call") {
|
|
6097
|
+
let e = x[f.output_index];
|
|
6098
|
+
e?.applyPatch && !e.applyPatch.endEmitted && f.item.operation.type !== "delete_file" && (e.applyPatch.hasDiff || d.enqueue({
|
|
6099
|
+
type: "tool-input-delta",
|
|
6100
|
+
id: e.toolCallId,
|
|
6101
|
+
delta: $(f.item.operation.diff)
|
|
6102
|
+
}), d.enqueue({
|
|
6103
|
+
type: "tool-input-delta",
|
|
6104
|
+
id: e.toolCallId,
|
|
6105
|
+
delta: "\"}}"
|
|
6042
6106
|
}), d.enqueue({
|
|
6107
|
+
type: "tool-input-end",
|
|
6108
|
+
id: e.toolCallId
|
|
6109
|
+
}), e.applyPatch.endEmitted = !0), e && f.item.status === "completed" && (T = !0, d.enqueue({
|
|
6043
6110
|
type: "tool-call",
|
|
6044
|
-
toolCallId:
|
|
6045
|
-
toolName:
|
|
6111
|
+
toolCallId: e.toolCallId,
|
|
6112
|
+
toolName: i.toCustomToolName("apply_patch"),
|
|
6046
6113
|
input: JSON.stringify({
|
|
6047
|
-
|
|
6048
|
-
|
|
6114
|
+
callId: f.item.call_id,
|
|
6115
|
+
operation: f.item.operation
|
|
6049
6116
|
}),
|
|
6050
|
-
...t ? { providerExecuted: !0 } : {},
|
|
6051
6117
|
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6118
|
+
})), x[f.output_index] = void 0;
|
|
6119
|
+
} else if (f.item.type === "mcp_approval_request") {
|
|
6120
|
+
x[f.output_index] = void 0;
|
|
6121
|
+
let e = p.config.generateId?.() ?? o(), t = f.item.approval_request_id ?? f.item.id;
|
|
6122
|
+
g.set(t, e);
|
|
6123
|
+
let n = `mcp.${f.item.name}`;
|
|
6124
|
+
d.enqueue({
|
|
6125
|
+
type: "tool-call",
|
|
6126
|
+
toolCallId: e,
|
|
6127
|
+
toolName: n,
|
|
6128
|
+
input: f.item.arguments,
|
|
6129
|
+
providerExecuted: !0,
|
|
6130
|
+
dynamic: !0
|
|
6131
|
+
}), d.enqueue({
|
|
6132
|
+
type: "tool-approval-request",
|
|
6133
|
+
approvalId: t,
|
|
6134
|
+
toolCallId: e
|
|
6052
6135
|
});
|
|
6053
|
-
}
|
|
6054
|
-
x[f.output_index] = void 0;
|
|
6055
|
-
} else if (f.item.type === "tool_search_output") {
|
|
6056
|
-
let e = f.item.call_id ?? M.shift() ?? f.item.id;
|
|
6057
|
-
d.enqueue({
|
|
6058
|
-
type: "tool-result",
|
|
6059
|
-
toolCallId: e,
|
|
6060
|
-
toolName: i.toCustomToolName("tool_search"),
|
|
6061
|
-
result: { tools: f.item.tools },
|
|
6062
|
-
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6063
|
-
});
|
|
6064
|
-
} else if (f.item.type === "mcp_call") {
|
|
6065
|
-
x[f.output_index] = void 0;
|
|
6066
|
-
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}`;
|
|
6067
|
-
d.enqueue({
|
|
6136
|
+
} else if (f.item.type === "local_shell_call") x[f.output_index] = void 0, d.enqueue({
|
|
6068
6137
|
type: "tool-call",
|
|
6069
|
-
toolCallId:
|
|
6070
|
-
toolName:
|
|
6071
|
-
input:
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
type: "call",
|
|
6080
|
-
serverLabel: f.item.server_label,
|
|
6081
|
-
name: f.item.name,
|
|
6082
|
-
arguments: f.item.arguments,
|
|
6083
|
-
...f.item.output == null ? {} : { output: f.item.output },
|
|
6084
|
-
...f.item.error == null ? {} : { error: f.item.error }
|
|
6085
|
-
},
|
|
6138
|
+
toolCallId: f.item.call_id,
|
|
6139
|
+
toolName: i.toCustomToolName("local_shell"),
|
|
6140
|
+
input: JSON.stringify({ action: {
|
|
6141
|
+
type: "exec",
|
|
6142
|
+
command: f.item.action.command,
|
|
6143
|
+
timeoutMs: f.item.action.timeout_ms,
|
|
6144
|
+
user: f.item.action.user,
|
|
6145
|
+
workingDirectory: f.item.action.working_directory,
|
|
6146
|
+
env: f.item.action.env
|
|
6147
|
+
} }),
|
|
6086
6148
|
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6087
6149
|
});
|
|
6088
|
-
|
|
6089
|
-
else if (f.item.type === "apply_patch_call") {
|
|
6090
|
-
let e = x[f.output_index];
|
|
6091
|
-
e?.applyPatch && !e.applyPatch.endEmitted && f.item.operation.type !== "delete_file" && (e.applyPatch.hasDiff || d.enqueue({
|
|
6092
|
-
type: "tool-input-delta",
|
|
6093
|
-
id: e.toolCallId,
|
|
6094
|
-
delta: $(f.item.operation.diff)
|
|
6095
|
-
}), d.enqueue({
|
|
6096
|
-
type: "tool-input-delta",
|
|
6097
|
-
id: e.toolCallId,
|
|
6098
|
-
delta: "\"}}"
|
|
6099
|
-
}), d.enqueue({
|
|
6100
|
-
type: "tool-input-end",
|
|
6101
|
-
id: e.toolCallId
|
|
6102
|
-
}), e.applyPatch.endEmitted = !0), e && f.item.status === "completed" && (T = !0, d.enqueue({
|
|
6150
|
+
else if (f.item.type === "shell_call") x[f.output_index] = void 0, d.enqueue({
|
|
6103
6151
|
type: "tool-call",
|
|
6104
|
-
toolCallId:
|
|
6105
|
-
toolName: i.toCustomToolName("
|
|
6106
|
-
input: JSON.stringify({
|
|
6107
|
-
|
|
6108
|
-
operation: f.item.operation
|
|
6109
|
-
}),
|
|
6152
|
+
toolCallId: f.item.call_id,
|
|
6153
|
+
toolName: i.toCustomToolName("shell"),
|
|
6154
|
+
input: JSON.stringify({ action: { commands: f.item.action.commands } }),
|
|
6155
|
+
...c && { providerExecuted: !0 },
|
|
6110
6156
|
providerMetadata: { [s]: { itemId: f.item.id } }
|
|
6111
|
-
})), x[f.output_index] = void 0;
|
|
6112
|
-
} else if (f.item.type === "mcp_approval_request") {
|
|
6113
|
-
x[f.output_index] = void 0;
|
|
6114
|
-
let e = p.config.generateId?.() ?? o(), t = f.item.approval_request_id ?? f.item.id;
|
|
6115
|
-
g.set(t, e);
|
|
6116
|
-
let n = `mcp.${f.item.name}`;
|
|
6117
|
-
d.enqueue({
|
|
6118
|
-
type: "tool-call",
|
|
6119
|
-
toolCallId: e,
|
|
6120
|
-
toolName: n,
|
|
6121
|
-
input: f.item.arguments,
|
|
6122
|
-
providerExecuted: !0,
|
|
6123
|
-
dynamic: !0
|
|
6124
|
-
}), d.enqueue({
|
|
6125
|
-
type: "tool-approval-request",
|
|
6126
|
-
approvalId: t,
|
|
6127
|
-
toolCallId: e
|
|
6128
6157
|
});
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
})
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
for (let t of n) d.enqueue({
|
|
6172
|
-
type: "reasoning-end",
|
|
6173
|
-
id: `${e}:${t}`,
|
|
6174
|
-
providerMetadata: { [s]: {
|
|
6175
|
-
itemId: e,
|
|
6176
|
-
reasoningEncryptedContent: f.item.encrypted_content ?? null
|
|
6177
|
-
} }
|
|
6178
|
-
});
|
|
6179
|
-
delete E[e];
|
|
6180
|
-
}
|
|
6181
|
-
D[f.output_index] = void 0;
|
|
6182
|
-
} else f.item.type === "compaction" && d.enqueue({
|
|
6183
|
-
type: "custom",
|
|
6184
|
-
kind: "openai.compaction",
|
|
6185
|
-
providerMetadata: { [s]: {
|
|
6186
|
-
type: "compaction",
|
|
6187
|
-
itemId: f.item.id,
|
|
6188
|
-
encryptedContent: f.item.encrypted_content
|
|
6189
|
-
} }
|
|
6190
|
-
});
|
|
6191
|
-
}
|
|
6192
|
-
else if (function(e) {
|
|
6158
|
+
else if (f.item.type === "shell_call_output") d.enqueue({
|
|
6159
|
+
type: "tool-result",
|
|
6160
|
+
toolCallId: f.item.call_id,
|
|
6161
|
+
toolName: i.toCustomToolName("shell"),
|
|
6162
|
+
result: { output: f.item.output.map((e) => ({
|
|
6163
|
+
stdout: e.stdout,
|
|
6164
|
+
stderr: e.stderr,
|
|
6165
|
+
outcome: e.outcome.type === "exit" ? {
|
|
6166
|
+
type: "exit",
|
|
6167
|
+
exitCode: e.outcome.exit_code
|
|
6168
|
+
} : { type: "timeout" }
|
|
6169
|
+
})) }
|
|
6170
|
+
});
|
|
6171
|
+
else if (f.item.type === "reasoning") {
|
|
6172
|
+
let e = O({
|
|
6173
|
+
itemId: f.item.id,
|
|
6174
|
+
outputIndex: f.output_index
|
|
6175
|
+
}), t = E[e];
|
|
6176
|
+
if (t != null) {
|
|
6177
|
+
let n = Object.entries(t.summaryParts).filter(([e, t]) => t === "active" || t === "can-conclude").map(([e]) => e);
|
|
6178
|
+
for (let t of n) d.enqueue({
|
|
6179
|
+
type: "reasoning-end",
|
|
6180
|
+
id: `${e}:${t}`,
|
|
6181
|
+
providerMetadata: { [s]: {
|
|
6182
|
+
itemId: e,
|
|
6183
|
+
reasoningEncryptedContent: f.item.encrypted_content ?? null
|
|
6184
|
+
} }
|
|
6185
|
+
});
|
|
6186
|
+
delete E[e];
|
|
6187
|
+
}
|
|
6188
|
+
D[f.output_index] = void 0;
|
|
6189
|
+
} else f.item.type === "compaction" && d.enqueue({
|
|
6190
|
+
type: "custom",
|
|
6191
|
+
kind: "openai.compaction",
|
|
6192
|
+
providerMetadata: { [s]: {
|
|
6193
|
+
type: "compaction",
|
|
6194
|
+
itemId: f.item.id,
|
|
6195
|
+
encryptedContent: f.item.encrypted_content
|
|
6196
|
+
} }
|
|
6197
|
+
});
|
|
6198
|
+
}
|
|
6199
|
+
} else if (function(e) {
|
|
6193
6200
|
return e.type === "response.function_call_arguments.delta";
|
|
6194
6201
|
}(f)) {
|
|
6195
6202
|
let e = x[f.output_index];
|
|
@@ -6466,7 +6473,7 @@ function Vn(e) {
|
|
|
6466
6473
|
return e.type === "response.in_progress";
|
|
6467
6474
|
}
|
|
6468
6475
|
function Hn(e) {
|
|
6469
|
-
return
|
|
6476
|
+
return e.type !== "response.created" && e.type !== "response.in_progress" && e.type !== "response.failed" && e.type !== "error" && e.type !== "unknown_chunk";
|
|
6470
6477
|
}
|
|
6471
6478
|
function Un(e) {
|
|
6472
6479
|
if (e == null) return {};
|
|
@@ -6522,7 +6529,7 @@ var Wn = N({
|
|
|
6522
6529
|
function qn(e) {
|
|
6523
6530
|
return e.includes("deepseek-v4") || e.startsWith("deepseek-flash") || e.startsWith("deepseek-pro");
|
|
6524
6531
|
}
|
|
6525
|
-
var Jn = new Set([
|
|
6532
|
+
var Jn = /* @__PURE__ */ new Set([
|
|
6526
6533
|
"image/gif",
|
|
6527
6534
|
"image/jpeg",
|
|
6528
6535
|
"image/jpg",
|
|
@@ -7408,14 +7415,17 @@ function pr(e = {}) {
|
|
|
7408
7415
|
argument: "apiKey/tokenProvider",
|
|
7409
7416
|
message: "Both apiKey and tokenProvider were provided. Please use only one authentication method."
|
|
7410
7417
|
});
|
|
7411
|
-
let n = (n = "openai") =>
|
|
7412
|
-
|
|
7418
|
+
let n = (n = "openai") => {
|
|
7419
|
+
let r = t ? {} : { [n === "speech" ? "Ocp-Apim-Subscription-Key" : "api-key"]: me({
|
|
7413
7420
|
apiKey: e.apiKey,
|
|
7414
7421
|
environmentVariableName: "AZURE_API_KEY",
|
|
7415
7422
|
description: n === "speech" ? "Azure Speech" : "Azure OpenAI"
|
|
7416
|
-
}) }
|
|
7417
|
-
|
|
7418
|
-
|
|
7423
|
+
}) };
|
|
7424
|
+
return x({
|
|
7425
|
+
...r,
|
|
7426
|
+
...e.headers
|
|
7427
|
+
}, "ai-sdk-azure/4.0.85");
|
|
7428
|
+
}, r = t ? async (n, r) => {
|
|
7419
7429
|
let i = K(r?.headers);
|
|
7420
7430
|
return i.authorization ??= `Bearer ${await t()}`, (e.fetch ?? globalThis.fetch)(n, {
|
|
7421
7431
|
...r,
|