@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
@@ -1,5 +1,5 @@
1
- Third-party software notices for @roomle/embedding-lib ab4491258f3be5babba54974fd11f17988606368
2
- Generated 2026-11-18
1
+ Third-party software notices for @roomle/embedding-lib a21975bfbaa1a1e6d8fc49bb656ec9e600bd5e4c
2
+ Generated 2026-11-19
3
3
 
4
4
  This product includes the following third-party components.
5
5
 
package/ai.js CHANGED
@@ -1,7 +1,8 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { o as e, r as t } from "./chat-model-CZfZsgX9.mjs";
3
- //#region packages/common/src/utils/ai-model-relay.ts
4
- var n = "roomle_ai_model_connect", r = () => import("./comlink-CG3f9q6z.mjs"), i = (e, { transfer: t, proxy: n }) => ({
2
+ import { n as e } from "./chat-model-XYf503pT.mjs";
3
+ import { n as t } from "./continuation-CswXtOus.mjs";
4
+ // packages/common/src/utils/ai-model-relay.ts
5
+ var n = "roomle_ai_model_connect", r = () => import("./comlink-7u13Z2ZH.mjs"), i = (e, { transfer: t, proxy: n }) => ({
5
6
  generate: async (t, n) => {
6
7
  let r = new AbortController();
7
8
  n.onmessage = () => r.abort();
@@ -81,7 +82,7 @@ var n = "roomle_ai_model_connect", r = () => import("./comlink-CG3f9q6z.mjs"), i
81
82
  }, o = async (n, { features: r, model: i, ...o }) => {
82
83
  if (r?.length === 0) throw Error("serveAiModelRequests: features is empty; leave it out to serve every feature");
83
84
  if (i) {
84
- let t = await e(i), n = (e) => Object.fromEntries([...new Set([...Object.keys(t.providerOptions ?? {}), ...Object.keys(e.providerOptions ?? {})])].map((n) => [n, {
85
+ let t = await e(i), n = (e) => Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(t.providerOptions ?? {}), ...Object.keys(e.providerOptions ?? {})])].map((n) => [n, {
85
86
  ...e.providerOptions?.[n],
86
87
  ...t.providerOptions?.[n]
87
88
  }]));
@@ -96,7 +97,7 @@ var n = "roomle_ai_model_connect", r = () => import("./comlink-CG3f9q6z.mjs"), i
96
97
  providerOptions: n(e),
97
98
  abortSignal: r
98
99
  })).stream
99
- }, r = [...new Set([
100
+ }, r = [.../* @__PURE__ */ new Set([
100
101
  ...r ?? [],
101
102
  "configuration-assistant",
102
103
  ...o.onAiModelRequest ? ["lifestyle-rendering"] : []
@@ -125,5 +126,4 @@ var n = "roomle_ai_model_connect", r = () => import("./comlink-CG3f9q6z.mjs"), i
125
126
  }
126
127
  };
127
128
  };
128
- //#endregion
129
129
  export { o as serveAiModelRequests };
package/ai.min.js CHANGED
@@ -1,9 +1,10 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { o as e, r as t } from "./chat-model-vgLJamoj.mjs";
2
+ import { n as e } from "./chat-model-B7BO8IhK.mjs";
3
+ import { n as t } from "./continuation-NclHDSgS.mjs";
3
4
  var n = async (n, { features: r, model: i, ...a }) => {
4
5
  if (r?.length === 0) throw Error("serveAiModelRequests: features is empty; leave it out to serve every feature");
5
6
  if (i) {
6
- let t = await e(i), n = (e) => Object.fromEntries([...new Set([...Object.keys(t.providerOptions ?? {}), ...Object.keys(e.providerOptions ?? {})])].map((n) => [n, {
7
+ let t = await e(i), n = (e) => Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(t.providerOptions ?? {}), ...Object.keys(e.providerOptions ?? {})])].map((n) => [n, {
7
8
  ...e.providerOptions?.[n],
8
9
  ...t.providerOptions?.[n]
9
10
  }]));
@@ -18,7 +19,7 @@ var n = async (n, { features: r, model: i, ...a }) => {
18
19
  providerOptions: n(e),
19
20
  abortSignal: r
20
21
  })).stream
21
- }, r = [...new Set([
22
+ }, r = [.../* @__PURE__ */ new Set([
22
23
  ...r ?? [],
23
24
  "configuration-assistant",
24
25
  ...a.onAiModelRequest ? ["lifestyle-rendering"] : []
@@ -29,7 +30,7 @@ var n = async (n, { features: r, model: i, ...a }) => {
29
30
  let [a] = i.ports;
30
31
  if (i.source !== e || i.origin !== t || i.data?.type !== "roomle_ai_model_connect" || !a) return;
31
32
  r.push(a);
32
- let o = await import("./comlink-hSUzCx9j.mjs");
33
+ let o = await import("./comlink-DKhvPU0o.mjs");
33
34
  o.expose(((e, { transfer: t, proxy: n }) => ({
34
35
  generate: async (t, n) => {
35
36
  let r = new AbortController();
@@ -1,5 +1,5 @@
1
1
 
2
- //#region packages/common/src/utils/browser.ts
2
+ // packages/common/src/utils/browser.ts
3
3
  var e = [
4
4
  "language",
5
5
  "browserLanguage",
@@ -15,5 +15,4 @@ var e = [
15
15
  }
16
16
  return "en";
17
17
  };
18
- //#endregion
19
18
  export { n as t };
@@ -0,0 +1,212 @@
1
+
2
+ var e = (e) => e.flatMap((e) => {
3
+ if (e.role !== "tool") return [e];
4
+ let t = [], n = e.content.map((e) => {
5
+ if (e.type !== "tool-result" || e.output.type !== "content") return e;
6
+ let n = e.output.value.filter((e) => e.type === "file");
7
+ return n.length ? (t.push(...n), {
8
+ ...e,
9
+ output: {
10
+ ...e.output,
11
+ value: [...e.output.value.filter((e) => e.type !== "file"), {
12
+ type: "text",
13
+ text: "The images of this result follow in the next message."
14
+ }]
15
+ }
16
+ }) : e;
17
+ });
18
+ return t.length ? [{
19
+ ...e,
20
+ content: n
21
+ }, {
22
+ role: "user",
23
+ content: t
24
+ }] : [e];
25
+ }), t = (t) => ({
26
+ specificationVersion: t.specificationVersion,
27
+ provider: t.provider,
28
+ modelId: t.modelId,
29
+ supportedUrls: t.supportedUrls,
30
+ doGenerate: (n) => t.doGenerate({
31
+ ...n,
32
+ prompt: e(n.prompt)
33
+ }),
34
+ doStream: (n) => t.doStream({
35
+ ...n,
36
+ prompt: e(n.prompt)
37
+ })
38
+ }), n = async ({ provider: e, model: n, apiKey: r, baseUrl: i, headers: a, chatCompletions: o, responses: s, storedResponses: c, reasoningEffort: l }, u, d) => {
39
+ let f = u ? { fetch: new Proxy(fetch, { apply: async (e, t, n) => (typeof n[1]?.body == "string" && await u(n[1].body), fetch(...n)) }) } : {};
40
+ switch (e) {
41
+ case "host":
42
+ if (!d) throw Error("The host assistant model is unavailable.");
43
+ return { languageModel: d };
44
+ case "openai": {
45
+ let { createOpenAI: e } = await import("./dist-Jcq_kKKT.mjs");
46
+ return { languageModel: e({
47
+ apiKey: r,
48
+ ...f
49
+ })(n) };
50
+ }
51
+ case "azure": {
52
+ let { createAzure: e } = await import("./dist-Ba3J8AjB.mjs"), t = e({
53
+ apiKey: r,
54
+ baseURL: i,
55
+ ...f
56
+ });
57
+ return {
58
+ languageModel: o ? t.chat(n) : t(n),
59
+ providerOptions: l ? { azure: { reasoningEffort: l } } : void 0
60
+ };
61
+ }
62
+ case "openai-compatible": {
63
+ if (!i) throw Error("The provider \"openai-compatible\" needs a baseUrl");
64
+ if (s) {
65
+ let { createOpenAI: e } = await import("./dist-Jcq_kKKT.mjs");
66
+ return {
67
+ languageModel: e({
68
+ baseURL: i,
69
+ apiKey: r ?? "none",
70
+ headers: {
71
+ ...r || a?.Authorization ? {} : { Authorization: void 0 },
72
+ ...a
73
+ },
74
+ ...f
75
+ }).responses(n),
76
+ providerOptions: { openai: c ? { store: !0 } : {
77
+ store: !1,
78
+ forceReasoning: !0
79
+ } }
80
+ };
81
+ }
82
+ let { createOpenAICompatible: e } = await import("./dist-BY8OLJ2p.mjs");
83
+ return { languageModel: t(e({
84
+ name: "openai-compatible",
85
+ baseURL: i,
86
+ apiKey: r,
87
+ headers: a,
88
+ includeUsage: !0,
89
+ ...f
90
+ })(n)) };
91
+ }
92
+ case "mistral": {
93
+ let { createMistral: e } = await import("./dist-CkZuNdCU.mjs");
94
+ return { languageModel: t(e({
95
+ apiKey: r,
96
+ ...f
97
+ })(n)) };
98
+ }
99
+ case "anthropic": {
100
+ let { createAnthropic: e } = await import("./dist-CiybWJvs.mjs");
101
+ return { languageModel: e({
102
+ apiKey: r,
103
+ headers: { "anthropic-dangerous-direct-browser-access": "true" },
104
+ ...f
105
+ })(n) };
106
+ }
107
+ case "google": {
108
+ let { createGoogleGenerativeAI: e } = await import("./dist-BMxyw-Zs.mjs");
109
+ return { languageModel: e({
110
+ apiKey: r,
111
+ ...f
112
+ })(n) };
113
+ }
114
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
115
+ }
116
+ }, r = {
117
+ undo: "Undo",
118
+ redo: "Redo",
119
+ "change-component-parameter": "Component parameter change",
120
+ "change-global-parameter": "Global parameter change",
121
+ "dock-component": "Component dock",
122
+ "drag-component": "Component drag",
123
+ "delete-component": "Component deletion",
124
+ "load-configuration": "Configuration load",
125
+ "get-configurator-capabilities": "Capabilities read",
126
+ "get-configuration": "Configuration read",
127
+ "get-component-parameters": "Component parameters read",
128
+ "get-global-parameters": "Global parameters read",
129
+ "get-possible-children": "Possible children read",
130
+ "get-docking-positions": "Docking positions read",
131
+ "get-component-docking-positions": "Component docking positions read",
132
+ "get-delete-impact": "Delete impact read"
133
+ }, i = new Set(Object.keys(r).filter((e) => e.startsWith("get-"))), a = (e) => {
134
+ if (e instanceof Error) return e.message;
135
+ try {
136
+ return typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
137
+ } catch {
138
+ return Object.prototype.toString.call(e);
139
+ }
140
+ }, o = (e) => {
141
+ if (e?.structuredContent !== void 0) return e.structuredContent;
142
+ let t = e?.content?.filter((e) => e.type === "text").map((e) => e.text).join("\n");
143
+ if (t === void 0) return e;
144
+ try {
145
+ return JSON.parse(t);
146
+ } catch {
147
+ return t;
148
+ }
149
+ }, s = (e) => {
150
+ if (!e || typeof e != "object") return e == null ? [] : [a(e)];
151
+ let t = [];
152
+ for (let n of [
153
+ "applied",
154
+ "undone",
155
+ "redone",
156
+ "confirmed",
157
+ "canUndo",
158
+ "canRedo"
159
+ ]) e[n] !== void 0 && t.push(`${n}: ${a(e[n])}`);
160
+ return e.hint && t.push(a(e.hint)), t;
161
+ }, c = (e, t = {
162
+ subject: "configuration",
163
+ readTools: i
164
+ }) => {
165
+ let n = [];
166
+ return {
167
+ tools: Object.fromEntries(Object.entries(e).map(([e, t]) => {
168
+ if (!t.execute) return [e, t];
169
+ let r = t.execute.bind(t);
170
+ return [e, {
171
+ ...t,
172
+ execute: async (t, i) => {
173
+ let a = {
174
+ toolName: e,
175
+ status: "pending"
176
+ };
177
+ n.push(a);
178
+ try {
179
+ let e = await r(t, i);
180
+ return a.result = e, a.status = "returned", e;
181
+ } catch (e) {
182
+ throw a.error = e, a.status = "threw", e;
183
+ }
184
+ }
185
+ }];
186
+ })),
187
+ summary: () => {
188
+ let e = ["The assistant's reply was interrupted. Any text above is incomplete."];
189
+ if (!n.length) return e.push(`No tool ran, so the ${t.subject} was not changed.`), e.join("\n\n");
190
+ for (let i of n) {
191
+ let n = r[i.toolName] ?? i.toolName;
192
+ if (t.readTools.has(i.toolName)) {
193
+ let r = i.status === "returned" && !i.result?.isError, a = r ? o(i.result) : void 0;
194
+ e.push(r ? `- Completed ${n}: ${!1 === a?.complete ? "some requested information was unresolved" : "information was returned"}. The read did not change the ${t.subject}.` : `- Incomplete ${n}: ${i.status === "pending" ? "no result was received" : "the read failed"}. The read did not change the ${t.subject}.`);
195
+ } else if (i.status !== "returned" || i.result?.isError) {
196
+ let r = i.status === "threw" ? a(i.error) : i.status === "returned" ? a(o(i.result)) : "no result was received";
197
+ e.push(`- Unconfirmed ${n}: ${r}. Check the ${t.subject} before trying this operation again.`);
198
+ } else {
199
+ let r = o(i.result);
200
+ if (!1 === r?.confirmed) {
201
+ e.push(`- Unconfirmed ${n}: ${r?.hint ?? r?.unresolved?.join(" ") ?? `the SDK did not confirm the ${t.subject} change`}. Check the ${t.subject} before trying this operation again.`);
202
+ continue;
203
+ }
204
+ let a = s(r);
205
+ e.push(`- Completed ${n}: ${a.length ? a.join("; ") : "the tool returned successfully."}`);
206
+ }
207
+ }
208
+ return e.push("These are the recorded tool outcomes; no operation was repeated automatically."), e.join("\n\n");
209
+ }
210
+ };
211
+ };
212
+ export { n, c as t };
@@ -0,0 +1,213 @@
1
+
2
+ // packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.ts
3
+ var e = (e) => e.flatMap((e) => {
4
+ if (e.role !== "tool") return [e];
5
+ let t = [], n = e.content.map((e) => {
6
+ if (e.type !== "tool-result" || e.output.type !== "content") return e;
7
+ let n = e.output.value.filter((e) => e.type === "file");
8
+ return n.length ? (t.push(...n), {
9
+ ...e,
10
+ output: {
11
+ ...e.output,
12
+ value: [...e.output.value.filter((e) => e.type !== "file"), {
13
+ type: "text",
14
+ text: "The images of this result follow in the next message."
15
+ }]
16
+ }
17
+ }) : e;
18
+ });
19
+ return t.length ? [{
20
+ ...e,
21
+ content: n
22
+ }, {
23
+ role: "user",
24
+ content: t
25
+ }] : [e];
26
+ }), t = (t) => ({
27
+ specificationVersion: t.specificationVersion,
28
+ provider: t.provider,
29
+ modelId: t.modelId,
30
+ supportedUrls: t.supportedUrls,
31
+ doGenerate: (n) => t.doGenerate({
32
+ ...n,
33
+ prompt: e(n.prompt)
34
+ }),
35
+ doStream: (n) => t.doStream({
36
+ ...n,
37
+ prompt: e(n.prompt)
38
+ })
39
+ }), n = async ({ provider: e, model: n, apiKey: r, baseUrl: i, headers: a, chatCompletions: o, responses: s, storedResponses: c, reasoningEffort: l }, u, d) => {
40
+ let f = u ? { fetch: new Proxy(fetch, { apply: async (e, t, n) => (typeof n[1]?.body == "string" && await u(n[1].body), fetch(...n)) }) } : {};
41
+ switch (e) {
42
+ case "host":
43
+ if (!d) throw Error("The host assistant model is unavailable.");
44
+ return { languageModel: d };
45
+ case "openai": {
46
+ let { createOpenAI: e } = await import("./dist-DjsS42rR.mjs");
47
+ return { languageModel: e({
48
+ apiKey: r,
49
+ ...f
50
+ })(n) };
51
+ }
52
+ case "azure": {
53
+ let { createAzure: e } = await import("./dist-bQAJDeYc.mjs"), t = e({
54
+ apiKey: r,
55
+ baseURL: i,
56
+ ...f
57
+ });
58
+ return {
59
+ languageModel: o ? t.chat(n) : t(n),
60
+ providerOptions: l ? { azure: { reasoningEffort: l } } : void 0
61
+ };
62
+ }
63
+ case "openai-compatible": {
64
+ if (!i) throw Error("The provider \"openai-compatible\" needs a baseUrl");
65
+ if (s) {
66
+ let { createOpenAI: e } = await import("./dist-DjsS42rR.mjs"), t = {
67
+ ...!r && !a?.Authorization ? { Authorization: void 0 } : {},
68
+ ...a
69
+ };
70
+ return {
71
+ languageModel: e({
72
+ baseURL: i,
73
+ apiKey: r ?? "none",
74
+ headers: t,
75
+ ...f
76
+ }).responses(n),
77
+ providerOptions: { openai: c ? { store: !0 } : {
78
+ store: !1,
79
+ forceReasoning: !0
80
+ } }
81
+ };
82
+ }
83
+ let { createOpenAICompatible: e } = await import("./dist-BU022PnG.mjs");
84
+ return { languageModel: t(e({
85
+ name: "openai-compatible",
86
+ baseURL: i,
87
+ apiKey: r,
88
+ headers: a,
89
+ includeUsage: !0,
90
+ ...f
91
+ })(n)) };
92
+ }
93
+ case "mistral": {
94
+ let { createMistral: e } = await import("./dist-a5_BIeaS.mjs");
95
+ return { languageModel: t(e({
96
+ apiKey: r,
97
+ ...f
98
+ })(n)) };
99
+ }
100
+ case "anthropic": {
101
+ let { createAnthropic: e } = await import("./dist-CbQKC1xX.mjs");
102
+ return { languageModel: e({
103
+ apiKey: r,
104
+ headers: { "anthropic-dangerous-direct-browser-access": "true" },
105
+ ...f
106
+ })(n) };
107
+ }
108
+ case "google": {
109
+ let { createGoogleGenerativeAI: e } = await import("./dist-7-X7Xqsl.mjs");
110
+ return { languageModel: e({
111
+ apiKey: r,
112
+ ...f
113
+ })(n) };
114
+ }
115
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
116
+ }
117
+ }, r = {
118
+ undo: "Undo",
119
+ redo: "Redo",
120
+ "change-component-parameter": "Component parameter change",
121
+ "change-global-parameter": "Global parameter change",
122
+ "dock-component": "Component dock",
123
+ "drag-component": "Component drag",
124
+ "delete-component": "Component deletion",
125
+ "load-configuration": "Configuration load",
126
+ "get-configurator-capabilities": "Capabilities read",
127
+ "get-configuration": "Configuration read",
128
+ "get-component-parameters": "Component parameters read",
129
+ "get-global-parameters": "Global parameters read",
130
+ "get-possible-children": "Possible children read",
131
+ "get-docking-positions": "Docking positions read",
132
+ "get-component-docking-positions": "Component docking positions read",
133
+ "get-delete-impact": "Delete impact read"
134
+ }, i = new Set(Object.keys(r).filter((e) => e.startsWith("get-"))), a = (e) => {
135
+ if (e instanceof Error) return e.message;
136
+ try {
137
+ return typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
138
+ } catch {
139
+ return Object.prototype.toString.call(e);
140
+ }
141
+ }, o = (e) => {
142
+ if (e?.structuredContent !== void 0) return e.structuredContent;
143
+ let t = e?.content?.filter((e) => e.type === "text").map((e) => e.text).join("\n");
144
+ if (t === void 0) return e;
145
+ try {
146
+ return JSON.parse(t);
147
+ } catch {
148
+ return t;
149
+ }
150
+ }, s = (e) => {
151
+ if (!e || typeof e != "object") return e == null ? [] : [a(e)];
152
+ let t = [];
153
+ for (let n of [
154
+ "applied",
155
+ "undone",
156
+ "redone",
157
+ "confirmed",
158
+ "canUndo",
159
+ "canRedo"
160
+ ]) e[n] !== void 0 && t.push(`${n}: ${a(e[n])}`);
161
+ return e.hint && t.push(a(e.hint)), t;
162
+ }, c = (e, t = {
163
+ subject: "configuration",
164
+ readTools: i
165
+ }) => {
166
+ let n = [];
167
+ return {
168
+ tools: Object.fromEntries(Object.entries(e).map(([e, t]) => {
169
+ if (!t.execute) return [e, t];
170
+ let r = t.execute.bind(t);
171
+ return [e, {
172
+ ...t,
173
+ execute: async (t, i) => {
174
+ let a = {
175
+ toolName: e,
176
+ status: "pending"
177
+ };
178
+ n.push(a);
179
+ try {
180
+ let e = await r(t, i);
181
+ return a.result = e, a.status = "returned", e;
182
+ } catch (e) {
183
+ throw a.error = e, a.status = "threw", e;
184
+ }
185
+ }
186
+ }];
187
+ })),
188
+ summary: () => {
189
+ let e = ["The assistant's reply was interrupted. Any text above is incomplete."];
190
+ if (!n.length) return e.push(`No tool ran, so the ${t.subject} was not changed.`), e.join("\n\n");
191
+ for (let i of n) {
192
+ let n = r[i.toolName] ?? i.toolName;
193
+ if (t.readTools.has(i.toolName)) {
194
+ let r = i.status === "returned" && !i.result?.isError, a = r ? o(i.result) : void 0;
195
+ e.push(r ? `- Completed ${n}: ${a?.complete === !1 ? "some requested information was unresolved" : "information was returned"}. The read did not change the ${t.subject}.` : `- Incomplete ${n}: ${i.status === "pending" ? "no result was received" : "the read failed"}. The read did not change the ${t.subject}.`);
196
+ } else if (i.status === "returned" && !i.result?.isError) {
197
+ let r = o(i.result);
198
+ if (r?.confirmed === !1) {
199
+ e.push(`- Unconfirmed ${n}: ${r?.hint ?? r?.unresolved?.join(" ") ?? `the SDK did not confirm the ${t.subject} change`}. Check the ${t.subject} before trying this operation again.`);
200
+ continue;
201
+ }
202
+ let a = s(r);
203
+ e.push(`- Completed ${n}: ${a.length ? a.join("; ") : "the tool returned successfully."}`);
204
+ } else {
205
+ let r = i.status === "threw" ? a(i.error) : i.status === "returned" ? a(o(i.result)) : "no result was received";
206
+ e.push(`- Unconfirmed ${n}: ${r}. Check the ${t.subject} before trying this operation again.`);
207
+ }
208
+ }
209
+ return e.push("These are the recorded tool outcomes; no operation was repeated automatically."), e.join("\n\n");
210
+ }
211
+ };
212
+ };
213
+ export { n, c as t };
@@ -0,0 +1,6 @@
1
+
2
+ import { Ut as e, hn as t } from "./dist-D2ZAAHGn.mjs";
3
+ function n(n) {
4
+ return t(e, n);
5
+ }
6
+ export { n as t };
@@ -0,0 +1,7 @@
1
+
2
+ import { Ut as e, hn as t } from "./dist-XECXrV5Q.mjs";
3
+ // node_modules/zod/v4/classic/coerce.js
4
+ function n(n) {
5
+ return t(e, n);
6
+ }
7
+ export { n as t };
@@ -1,6 +1,6 @@
1
1
 
2
- //#region node_modules/comlink/dist/esm/comlink.mjs
3
- var e = Symbol("Comlink.proxy"), t = Symbol("Comlink.endpoint"), n = Symbol("Comlink.releaseProxy"), r = Symbol("Comlink.finalizer"), i = Symbol("Comlink.thrown"), a = (e) => typeof e == "object" && !!e || typeof e == "function", o = new Map([["proxy", {
2
+ // node_modules/comlink/dist/esm/comlink.mjs
3
+ var e = Symbol("Comlink.proxy"), t = Symbol("Comlink.endpoint"), n = Symbol("Comlink.releaseProxy"), r = Symbol("Comlink.finalizer"), i = Symbol("Comlink.thrown"), a = (e) => typeof e == "object" && !!e || typeof e == "function", o = /* @__PURE__ */ new Map([["proxy", {
4
4
  canHandle: (t) => a(t) && t[e],
5
5
  serialize(e) {
6
6
  let { port1: t, port2: n } = new MessageChannel();
@@ -230,5 +230,4 @@ function O() {
230
230
  ,
231
231
  ].fill(0).map(() => Math.floor(Math.random() * (2 ** 53 - 1)).toString(16)).join("-");
232
232
  }
233
- //#endregion
234
233
  export { t as createEndpoint, c as expose, r as finalizer, C as proxy, e as proxyMarker, n as releaseProxy, S as transfer, o as transferHandlers, w as windowEndpoint, d as wrap };
@@ -1,5 +1,5 @@
1
1
 
2
- var e = Symbol("Comlink.proxy"), t = Symbol("Comlink.endpoint"), n = Symbol("Comlink.releaseProxy"), r = Symbol("Comlink.finalizer"), i = Symbol("Comlink.thrown"), a = (e) => typeof e == "object" && !!e || typeof e == "function", o = new Map([["proxy", {
2
+ var e = Symbol("Comlink.proxy"), t = Symbol("Comlink.endpoint"), n = Symbol("Comlink.releaseProxy"), r = Symbol("Comlink.finalizer"), i = Symbol("Comlink.thrown"), a = (e) => typeof e == "object" && !!e || typeof e == "function", o = /* @__PURE__ */ new Map([["proxy", {
3
3
  canHandle: (t) => a(t) && t[e],
4
4
  serialize(e) {
5
5
  let { port1: t, port2: n } = new MessageChannel();
package/configurator.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { a as e, o as t } from "./chat-model-CZfZsgX9.mjs";
3
- import "./mcp-tools-8qPMNqTK.mjs";
4
- //#region packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.ts
2
+ import { t as e } from "./mcp-tools-BLB7pCga.mjs";
3
+ import { n as t } from "./chat-model-XYf503pT.mjs";
4
+ // packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.ts
5
5
  var n = async (t) => {
6
6
  if (typeof t.getConfiguratorAgentTools != "function" || typeof t.callConfiguratorAgentTool != "function") throw Error("Update the Rubens UI: configurator agent tools are unavailable.");
7
7
  return e(await t.getConfiguratorAgentTools(), (e, n) => t.callConfiguratorAgentTool(e, n), "configurator-mcp");
@@ -26,5 +26,4 @@ var n = async (t) => {
26
26
  throw n.removeEventListener("abort", a), e;
27
27
  }
28
28
  };
29
- //#endregion
30
29
  export { n as createConfiguratorMcpTools, t as loadChatModel, r as startConfiguratorPlanningAssistant };
@@ -1,6 +1,6 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { a as e, o as t } from "./chat-model-vgLJamoj.mjs";
3
- import "./mcp-tools-D_GxXscW.mjs";
2
+ import { t as e } from "./mcp-tools-BirFT2R0.mjs";
3
+ import { n as t } from "./chat-model-B7BO8IhK.mjs";
4
4
  var n = async (t) => {
5
5
  if (typeof t.getConfiguratorAgentTools != "function" || typeof t.callConfiguratorAgentTool != "function") throw Error("Update the Rubens UI: configurator agent tools are unavailable.");
6
6
  return e(await t.getConfiguratorAgentTools(), (e, n) => t.callConfiguratorAgentTool(e, n), "configurator-mcp");