@roomle/embedding-lib 11.0.0-alpha.5 → 11.0.0-alpha.7

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 (68) hide show
  1. package/THIRD-PARTY-NOTICES.txt +2 -2
  2. package/ai.js +6 -6
  3. package/ai.min.js +5 -4
  4. package/{browser-D6M-d6y5.mjs → browser-Cys-y5Hy.mjs} +1 -2
  5. package/chat-model-B7BO8IhK.mjs +212 -0
  6. package/chat-model-XYf503pT.mjs +213 -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 +143 -24
  14. package/construction.min.js +141 -23
  15. package/continuation-CswXtOus.mjs +10 -0
  16. package/continuation-NclHDSgS.mjs +9 -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/docs/md/web/embedding/CHANGELOG.md +41 -47
  34. package/{drag-ghost-BpIDzSdK.mjs → drag-ghost-QZelgA-_.mjs} +2 -3
  35. package/{drag-ghost-Bhb0_67G.mjs → drag-ghost-VmgSWLva.mjs} +5 -7
  36. package/{drag-in-mE_ozj_Q.mjs → drag-in-Cd_67tzS.mjs} +4 -5
  37. package/{drag-in-CGBG4wEk.mjs → drag-in-DlDsgY4T.mjs} +3 -3
  38. package/embedding-plugins.js +1 -2
  39. package/embedding-plugins.min.js +1 -2
  40. package/{experimental-evaluation-FzKFGoye.mjs → experimental-evaluation-B4hKMgFH.mjs} +19 -38
  41. package/{experimental-evaluation-DczxmJme.mjs → experimental-evaluation-DmqghFSx.mjs} +1 -1
  42. package/{from-custom-view-B3fIWMox.mjs → from-custom-view-6HMD_sPe.mjs} +5 -4
  43. package/{from-custom-view-B3HCOhdT.mjs → from-custom-view-BRFynafo.mjs} +16 -16
  44. package/{from-website-DaTahmvJ.mjs → from-website-Dl1VN4h7.mjs} +5 -6
  45. package/{from-website-DUQ9USj1.mjs → from-website-iZzauH4C.mjs} +3 -3
  46. package/hi.js +188 -197
  47. package/hi.min.js +193 -194
  48. package/mcp-tools-BLB7pCga.mjs +42 -0
  49. package/mcp-tools-BirFT2R0.mjs +41 -0
  50. package/package.json +1 -1
  51. package/packages/web-sdk/packages/assistant.d.ts +1 -0
  52. package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +3 -0
  53. package/rolldown-runtime--db92txo.mjs +10 -0
  54. package/rolldown-runtime-CyjYJMBa.mjs +11 -0
  55. package/roomle-embedding-lib.js +25 -34
  56. package/roomle-embedding-lib.min.js +3 -3
  57. package/sbom.cdx.json +5 -5
  58. package/turn-limits-9LbUeSG2.mjs +9 -0
  59. package/turn-limits-Ciq383Bd.mjs +10 -0
  60. package/{utils-BwWn6Fw4.mjs → utils-CJnKZceY.mjs} +3 -4
  61. package/{utils-BoELtcEK.mjs → utils-DdNhTbJr.mjs} +6 -6
  62. package/chat-model-CZfZsgX9.mjs +0 -377
  63. package/chat-model-vgLJamoj.mjs +0 -373
  64. package/coerce-CqJod_GZ.mjs +0 -8
  65. package/coerce-CsI42_k0.mjs +0 -6
  66. package/mcp-tools-8qPMNqTK.mjs +0 -2
  67. package/mcp-tools-D_GxXscW.mjs +0 -2
  68. /package/{browser-BjtSrqbu.mjs → browser-CzLpXYFF.mjs} +0 -0
package/construction.js CHANGED
@@ -1,50 +1,170 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { a as e, n as t, o as n, t as r } from "./chat-model-CZfZsgX9.mjs";
3
- import "./mcp-tools-8qPMNqTK.mjs";
4
- //#region packages/embedding-lib/src/construction-agent/construction-mcp-tools.ts
5
- var i = async (t) => {
2
+ import { t as e } from "./mcp-tools-BLB7pCga.mjs";
3
+ import { n as t, t as n } from "./chat-model-XYf503pT.mjs";
4
+ import { a as r, i, n as a, r as o, t as s } from "./turn-limits-Ciq383Bd.mjs";
5
+ import { n as c, r as l, t as u } from "./continuation-CswXtOus.mjs";
6
+ import { _n as d } from "./dist-XECXrV5Q.mjs";
7
+ // packages/web-sdk/packages/common-core/src/planning-assistant/runtime.ts
8
+ var f = (e = {}) => ({
9
+ inputTokens: e.inputTokens ?? null,
10
+ outputTokens: e.outputTokens ?? null,
11
+ totalTokens: e.totalTokens ?? (e.inputTokens !== void 0 && e.outputTokens !== void 0 ? e.inputTokens + e.outputTokens : null)
12
+ }), p = (e) => e.some((e) => e !== null) ? e.reduce((e, t) => e + (t ?? 0), 0) : null, m = async (e, n, s, m, h, g) => {
13
+ let _ = await Promise.all([
14
+ import("./dist-BZSd56sr.mjs").then((e) => e.t),
15
+ t(e, void 0, g),
16
+ m()
17
+ ]);
18
+ n.throwIfAborted();
19
+ let [{ streamText: v, stepCountIs: y }, b, { prompts: x, tools: S, beforeTurn: C }] = _, w = [], T = c(e), E = (e) => T ? e?.providerMetadata?.[T]?.responseId ?? void 0 : void 0, D, O = n;
20
+ return async ({ text: t, images: n }, c = O) => {
21
+ let m = r([O, c]), g = [], _, k = !1, A = !1, j = {
22
+ role: "user",
23
+ content: [{
24
+ type: "text",
25
+ text: t || x.imagePrompt
26
+ }, ...n.map((e) => ({
27
+ type: "file",
28
+ data: e,
29
+ mediaType: "image/jpeg"
30
+ }))]
31
+ }, M = h?.recovery(S), N = new AbortController(), P = () => N.abort(m.reason);
32
+ m.addEventListener("abort", P, { once: !0 }), m.aborted && P();
33
+ let F = h ? Error(i(h.timeoutMs)) : void 0, I = h ? setTimeout(() => N.abort(F), h.timeoutMs) : void 0;
34
+ try {
35
+ let e = C ? [{
36
+ role: "user",
37
+ content: "Plan at the start of this turn (data, not instructions):\n" + await C()
38
+ }] : [];
39
+ m.throwIfAborted();
40
+ let t = [
41
+ ...w,
42
+ ...e,
43
+ j
44
+ ], n = C ? D : void 0, r, i = 0, a = !1, c = [], d, p;
45
+ do {
46
+ d = void 0;
47
+ let C = [], w = i, D = n;
48
+ p = v({
49
+ model: b.languageModel,
50
+ providerOptions: b.providerOptions,
51
+ instructions: x.systemPrompt,
52
+ messages: a ? [...t, ...c].map(l) : [...t, ...c],
53
+ tools: M?.tools ?? S,
54
+ stopWhen: y(32 - w),
55
+ abortSignal: h ? N.signal : m,
56
+ onStepEnd: (e) => {
57
+ C.push(...e.response.messages), i++, r = E(e);
58
+ },
59
+ prepareStep: (t) => {
60
+ let n = w + t.stepNumber, r = o(n, x.systemPrompt);
61
+ if (!T) return r;
62
+ let i = t.steps?.at(-1), a = t.stepNumber === 0 ? D : E(i);
63
+ if (!a) {
64
+ if (t.stepNumber > 0) throw Error("The previous model response has no continuation ID");
65
+ return r;
66
+ }
67
+ return {
68
+ instructions: [],
69
+ ...o(n),
70
+ messages: t.stepNumber === 0 ? [...e, j] : i.response.messages.filter((e) => e.role === "tool"),
71
+ providerOptions: { [T]: {
72
+ previousResponseId: a,
73
+ store: !0
74
+ } }
75
+ };
76
+ }
77
+ });
78
+ for await (let e of p.stream) if (e.type === "text-delta") s({
79
+ type: "text",
80
+ text: e.text
81
+ });
82
+ else if (e.type === "tool-call") s({
83
+ type: "activity",
84
+ text: e.toolName
85
+ });
86
+ else if (e.type === "error") {
87
+ if ((D || C.length) && u(e.error)) {
88
+ d = e.error;
89
+ break;
90
+ }
91
+ throw e.error;
92
+ } else if (e.type === "finish-step") g.push(f(e.usage));
93
+ else if (e.type === "finish") _ = c.length ? void 0 : f(e.totalUsage), k = !0;
94
+ else if (e.type === "abort" && (A = !0, h)) throw N.signal.reason ?? /* @__PURE__ */ Error("Turn aborted");
95
+ d && (c.push(...C), n = void 0, a = !0);
96
+ } while (d);
97
+ if (N.signal.aborted) throw N.signal.reason;
98
+ return w.push(j, ...c, ...await p.responseMessages), D = r, s({ type: "done" }), !0;
99
+ } catch (e) {
100
+ D = void 0;
101
+ let t = M?.summary();
102
+ return h && t && N.signal.reason === F ? (w.push(j, a(t, h.timeoutMs, s)), !0) : (t && w.push(j, {
103
+ role: "assistant",
104
+ content: t
105
+ }), s({
106
+ type: "error",
107
+ ...d.isInstance(e) && { statusCode: e.statusCode },
108
+ text: `The planning assistant failed: ${e instanceof Error ? e.message : String(e)}${t ? `\n\n${t}` : ""}`
109
+ }), !1);
110
+ } finally {
111
+ clearTimeout(I), m.removeEventListener("abort", P);
112
+ let t = {
113
+ inputTokens: _?.inputTokens ?? p(g.map((e) => e.inputTokens)),
114
+ outputTokens: _?.outputTokens ?? p(g.map((e) => e.outputTokens)),
115
+ totalTokens: _?.totalTokens ?? p(g.map((e) => e.totalTokens))
116
+ }, n = Object.values(t).some((e) => e !== null), r = k && !A && !N.signal.aborted && Object.values(t).every((e) => e !== null) && g.every((e) => Object.values(e).every((e) => e !== null));
117
+ console.log(`[planning-assistant] usage ${JSON.stringify({
118
+ provider: e.provider,
119
+ model: e.model,
120
+ status: n ? r ? "complete" : "partial" : "unavailable",
121
+ ...t
122
+ })}`);
123
+ }
124
+ };
125
+ }, h = async (t) => {
6
126
  if (typeof t.getConstructionAgentTools != "function" || typeof t.callConstructionAgentTool != "function") throw Error("Update the Rubens UI: fence agent tools are unavailable.");
7
127
  return e(await t.getConstructionAgentTools(), (e, n) => t.callConstructionAgentTool(e, n), "fence-mcp");
8
- }, a = async (e, n, r, i, a) => {
9
- let o = (t) => {
10
- r.aborted || e.planningAssistantOutput(t);
128
+ }, g = async (e, t, n, r, i) => {
129
+ let a = (t) => {
130
+ n.aborted || e.planningAssistantOutput(t);
11
131
  };
12
132
  try {
13
- let s = await t(n, r, o, i, a), c = async (e) => {
14
- await s(e);
133
+ let o = await m(t, n, a, r, i), s = async (e) => {
134
+ await o(e);
15
135
  };
16
- r.throwIfAborted();
17
- let l = e.callbacks.onPlanningAssistantPrompt;
18
- e.callbacks.onPlanningAssistantPrompt = c, r.addEventListener("abort", () => {
19
- e.callbacks.onPlanningAssistantPrompt === c && (e.callbacks.onPlanningAssistantPrompt = l, e.planningAssistantOutput({
136
+ n.throwIfAborted();
137
+ let c = e.callbacks.onPlanningAssistantPrompt;
138
+ e.callbacks.onPlanningAssistantPrompt = s, n.addEventListener("abort", () => {
139
+ e.callbacks.onPlanningAssistantPrompt === s && (e.callbacks.onPlanningAssistantPrompt = c, e.planningAssistantOutput({
20
140
  type: "availability",
21
141
  available: !1
22
142
  }));
23
- }, { once: !0 }), o({
143
+ }, { once: !0 }), a({
24
144
  type: "images",
25
- enabled: n.readsImages
26
- }), o({
145
+ enabled: t.readsImages
146
+ }), a({
27
147
  type: "availability",
28
148
  available: !0
29
149
  });
30
150
  } catch (e) {
31
- o({
151
+ a({
32
152
  type: "availability",
33
153
  available: !1,
34
154
  text: String(e)
35
155
  });
36
156
  }
37
- }, o = (e, t, n) => a(e.window, t, n, async () => {
38
- let [t, n] = await Promise.all([e.planner.getConstructionAgentPrompts(), i(e.planner)]);
157
+ }, _ = (e, t, r) => g(e.window, t, r, async () => {
158
+ let [t, n] = await Promise.all([e.planner.getConstructionAgentPrompts(), h(e.planner)]);
39
159
  return {
40
160
  prompts: t,
41
161
  tools: n
42
162
  };
43
163
  }, {
44
- timeoutMs: 5 * 6e4,
45
- recovery: (e) => r(e, {
164
+ timeoutMs: s,
165
+ recovery: (e) => n(e, {
46
166
  subject: "plan",
47
- readTools: new Set([
167
+ readTools: /* @__PURE__ */ new Set([
48
168
  "get-construction-capabilities",
49
169
  "get-terrain-context",
50
170
  "get-construction-context",
@@ -57,5 +177,4 @@ var i = async (t) => {
57
177
  ])
58
178
  })
59
179
  });
60
- //#endregion
61
- export { i as createConstructionMcpTools, n as loadChatModel, o as startFencePlanningAssistant };
180
+ export { h as createConstructionMcpTools, t as loadChatModel, _ as startFencePlanningAssistant };
@@ -1,49 +1,167 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { a as e, n as t, o as n, t as r } from "./chat-model-vgLJamoj.mjs";
3
- import "./mcp-tools-D_GxXscW.mjs";
4
- var i = async (t) => {
2
+ import { t as e } from "./mcp-tools-BirFT2R0.mjs";
3
+ import { n as t, t as n } from "./chat-model-B7BO8IhK.mjs";
4
+ import { a as r, i, n as a, r as o, t as s } from "./turn-limits-9LbUeSG2.mjs";
5
+ import { n as c, r as l, t as u } from "./continuation-NclHDSgS.mjs";
6
+ import { _n as d } from "./dist-D2ZAAHGn.mjs";
7
+ var f = (e = {}) => ({
8
+ inputTokens: e.inputTokens ?? null,
9
+ outputTokens: e.outputTokens ?? null,
10
+ totalTokens: e.totalTokens ?? (e.inputTokens !== void 0 && e.outputTokens !== void 0 ? e.inputTokens + e.outputTokens : null)
11
+ }), p = (e) => e.some((e) => e !== null) ? e.reduce((e, t) => e + (t ?? 0), 0) : null, m = async (t) => {
5
12
  if (typeof t.getConstructionAgentTools != "function" || typeof t.callConstructionAgentTool != "function") throw Error("Update the Rubens UI: fence agent tools are unavailable.");
6
13
  return e(await t.getConstructionAgentTools(), (e, n) => t.callConstructionAgentTool(e, n), "fence-mcp");
7
- }, a = (e, n, a) => (async (n, r, a, o, s) => {
8
- let c = (e) => {
9
- a.aborted || n.planningAssistantOutput(e);
14
+ }, h = (e, h, g) => (async (n, s, h, g, _) => {
15
+ let v = (e) => {
16
+ h.aborted || n.planningAssistantOutput(e);
10
17
  };
11
18
  try {
12
- let o = await t(r, a, c, async () => {
13
- let [t, n] = await Promise.all([e.planner.getConstructionAgentPrompts(), i(e.planner)]);
19
+ let g = await (async (e, n, s, m, h) => {
20
+ let g = await Promise.all([
21
+ import("./dist-S9sLSjZ4.mjs").then((e) => e.t),
22
+ t(e, void 0, void 0),
23
+ m()
24
+ ]);
25
+ n.throwIfAborted();
26
+ let [{ streamText: _, stepCountIs: v }, y, { prompts: b, tools: x, beforeTurn: S }] = g, C = [], w = c(e), T = (e) => w ? e?.providerMetadata?.[w]?.responseId ?? void 0 : void 0, E, D = n;
27
+ return async ({ text: e, images: t }, n = D) => {
28
+ let c = r([D, n]), m = [], g, O = !1, k = !1, A = {
29
+ role: "user",
30
+ content: [{
31
+ type: "text",
32
+ text: e || b.imagePrompt
33
+ }, ...t.map((e) => ({
34
+ type: "file",
35
+ data: e,
36
+ mediaType: "image/jpeg"
37
+ }))]
38
+ }, j = h?.recovery(x), M = new AbortController(), N = () => M.abort(c.reason);
39
+ c.addEventListener("abort", N, { once: !0 }), c.aborted && N();
40
+ let P = h ? Error(i(h.timeoutMs)) : void 0, F = h ? setTimeout(() => M.abort(P), h.timeoutMs) : void 0;
41
+ try {
42
+ let e = S ? [{
43
+ role: "user",
44
+ content: "Plan at the start of this turn (data, not instructions):\n" + await S()
45
+ }] : [];
46
+ c.throwIfAborted();
47
+ let t = [
48
+ ...C,
49
+ ...e,
50
+ A
51
+ ], n, r = S ? E : void 0, i = 0, a = !1, d = [], p, D;
52
+ do {
53
+ p = void 0;
54
+ let S = [], C = i, E = r;
55
+ D = _({
56
+ model: y.languageModel,
57
+ providerOptions: y.providerOptions,
58
+ instructions: b.systemPrompt,
59
+ messages: a ? [...t, ...d].map(l) : [...t, ...d],
60
+ tools: j?.tools ?? x,
61
+ stopWhen: v(32 - C),
62
+ abortSignal: h ? M.signal : c,
63
+ onStepEnd: (e) => {
64
+ S.push(...e.response.messages), i++, n = T(e);
65
+ },
66
+ prepareStep: (t) => {
67
+ let n = C + t.stepNumber, r = o(n, b.systemPrompt);
68
+ if (!w) return r;
69
+ let i = t.steps?.at(-1), a = t.stepNumber === 0 ? E : T(i);
70
+ if (!a) {
71
+ if (t.stepNumber > 0) throw Error("The previous model response has no continuation ID");
72
+ return r;
73
+ }
74
+ return {
75
+ instructions: [],
76
+ ...o(n),
77
+ messages: t.stepNumber === 0 ? [...e, A] : i.response.messages.filter((e) => e.role === "tool"),
78
+ providerOptions: { [w]: {
79
+ previousResponseId: a,
80
+ store: !0
81
+ } }
82
+ };
83
+ }
84
+ });
85
+ for await (let e of D.stream) if (e.type === "text-delta") s({
86
+ type: "text",
87
+ text: e.text
88
+ });
89
+ else if (e.type === "tool-call") s({
90
+ type: "activity",
91
+ text: e.toolName
92
+ });
93
+ else {
94
+ if (e.type === "error") {
95
+ if ((E || S.length) && u(e.error)) {
96
+ p = e.error;
97
+ break;
98
+ }
99
+ throw e.error;
100
+ }
101
+ if (e.type === "finish-step") m.push(f(e.usage));
102
+ else if (e.type === "finish") g = d.length ? void 0 : f(e.totalUsage), O = !0;
103
+ else if (e.type === "abort" && (k = !0, h)) throw M.signal.reason ?? /* @__PURE__ */ Error("Turn aborted");
104
+ }
105
+ p && (d.push(...S), r = void 0, a = !0);
106
+ } while (p);
107
+ if (M.signal.aborted) throw M.signal.reason;
108
+ return C.push(A, ...d, ...await D.responseMessages), E = n, s({ type: "done" }), !0;
109
+ } catch (e) {
110
+ E = void 0;
111
+ let t = j?.summary();
112
+ return h && t && M.signal.reason === P ? (C.push(A, a(t, h.timeoutMs, s)), !0) : (t && C.push(A, {
113
+ role: "assistant",
114
+ content: t
115
+ }), s({
116
+ type: "error",
117
+ ...d.isInstance(e) && { statusCode: e.statusCode },
118
+ text: `The planning assistant failed: ${e instanceof Error ? e.message : String(e)}${t ? `\n\n${t}` : ""}`
119
+ }), !1);
120
+ } finally {
121
+ clearTimeout(F), c.removeEventListener("abort", N);
122
+ let e = {
123
+ inputTokens: g?.inputTokens ?? p(m.map((e) => e.inputTokens)),
124
+ outputTokens: g?.outputTokens ?? p(m.map((e) => e.outputTokens)),
125
+ totalTokens: g?.totalTokens ?? p(m.map((e) => e.totalTokens))
126
+ };
127
+ Object.values(e).some((e) => e !== null), O && !k && !M.signal.aborted && Object.values(e).every((e) => e !== null) && m.every((e) => Object.values(e).every((e) => e !== null));
128
+ }
129
+ };
130
+ })(s, h, v, async () => {
131
+ let [t, n] = await Promise.all([e.planner.getConstructionAgentPrompts(), m(e.planner)]);
14
132
  return {
15
133
  prompts: t,
16
134
  tools: n
17
135
  };
18
- }, s), l = async (e) => {
19
- await o(e);
136
+ }, _), y = async (e) => {
137
+ await g(e);
20
138
  };
21
- a.throwIfAborted();
22
- let u = n.callbacks.onPlanningAssistantPrompt;
23
- n.callbacks.onPlanningAssistantPrompt = l, a.addEventListener("abort", () => {
24
- n.callbacks.onPlanningAssistantPrompt === l && (n.callbacks.onPlanningAssistantPrompt = u, n.planningAssistantOutput({
139
+ h.throwIfAborted();
140
+ let b = n.callbacks.onPlanningAssistantPrompt;
141
+ n.callbacks.onPlanningAssistantPrompt = y, h.addEventListener("abort", () => {
142
+ n.callbacks.onPlanningAssistantPrompt === y && (n.callbacks.onPlanningAssistantPrompt = b, n.planningAssistantOutput({
25
143
  type: "availability",
26
144
  available: !1
27
145
  }));
28
- }, { once: !0 }), c({
146
+ }, { once: !0 }), v({
29
147
  type: "images",
30
- enabled: r.readsImages
31
- }), c({
148
+ enabled: s.readsImages
149
+ }), v({
32
150
  type: "availability",
33
151
  available: !0
34
152
  });
35
153
  } catch (e) {
36
- c({
154
+ v({
37
155
  type: "availability",
38
156
  available: !1,
39
157
  text: String(e)
40
158
  });
41
159
  }
42
- })(e.window, n, a, 0, {
43
- timeoutMs: 3e5,
44
- recovery: (e) => r(e, {
160
+ })(e.window, h, g, 0, {
161
+ timeoutMs: s,
162
+ recovery: (e) => n(e, {
45
163
  subject: "plan",
46
- readTools: new Set([
164
+ readTools: /* @__PURE__ */ new Set([
47
165
  "get-construction-capabilities",
48
166
  "get-terrain-context",
49
167
  "get-construction-context",
@@ -56,4 +174,4 @@ var i = async (t) => {
56
174
  ])
57
175
  })
58
176
  });
59
- export { i as createConstructionMcpTools, n as loadChatModel, a as startFencePlanningAssistant };
177
+ export { m as createConstructionMcpTools, t as loadChatModel, h as startFencePlanningAssistant };
@@ -0,0 +1,10 @@
1
+
2
+ // packages/web-sdk/packages/common-core/src/planning-assistant/continuation.ts
3
+ var e = (e) => e.provider === "host" ? e.responsesProvider ?? null : e.provider === "openai" || e.provider === "openai-compatible" && e.responses && e.storedResponses ? "openai" : e.provider === "azure" && !e.chatCompletions ? "azure" : null, t = /^(Previous response with id '[^']*' not found|No tool output found for function call )/, n = (e) => e instanceof Error && t.test(e.message), r = (e) => e.role !== "assistant" || typeof e.content == "string" ? e : {
4
+ ...e,
5
+ content: e.content.map((e) => (e.type === "text" || e.type === "reasoning") && e.providerOptions ? {
6
+ ...e,
7
+ providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
8
+ } : e)
9
+ };
10
+ export { e as n, r, n as t };
@@ -0,0 +1,9 @@
1
+
2
+ var e = (e) => e.provider === "host" ? e.responsesProvider ?? null : e.provider === "openai" || e.provider === "openai-compatible" && e.responses && e.storedResponses ? "openai" : e.provider !== "azure" || e.chatCompletions ? null : "azure", t = /^(Previous response with id '[^']*' not found|No tool output found for function call )/, n = (e) => e instanceof Error && t.test(e.message), r = (e) => e.role !== "assistant" || typeof e.content == "string" ? e : {
3
+ ...e,
4
+ content: e.content.map((e) => e.type !== "text" && e.type !== "reasoning" || !e.providerOptions ? e : {
5
+ ...e,
6
+ providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
7
+ })
8
+ };
9
+ export { e as n, r, n as t };