@roomle/embedding-lib 0.0.0-dev-818b261 → 0.0.0-dev-4c2797a

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.
@@ -0,0 +1,212 @@
1
+ Third-party software notices for @roomle/embedding-lib 4c2797aeb1bcaf00618ae9e7374260f8d2655753
2
+ Generated 2026-10-30
3
+
4
+ This product includes the following third-party components.
5
+
6
+ ================================================================================
7
+ comlink@4.4.2
8
+ License: Apache-2.0
9
+ Copyright: 2017 Google Inc.
10
+ Source: https://github.com/GoogleChromeLabs/comlink
11
+
12
+ Apache License
13
+ Version 2.0, January 2004
14
+ http://www.apache.org/licenses/
15
+
16
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
17
+
18
+ 1. Definitions.
19
+
20
+ "License" shall mean the terms and conditions for use, reproduction,
21
+ and distribution as defined by Sections 1 through 9 of this document.
22
+
23
+ "Licensor" shall mean the copyright owner or entity authorized by
24
+ the copyright owner that is granting the License.
25
+
26
+ "Legal Entity" shall mean the union of the acting entity and all
27
+ other entities that control, are controlled by, or are under common
28
+ control with that entity. For the purposes of this definition,
29
+ "control" means (i) the power, direct or indirect, to cause the
30
+ direction or management of such entity, whether by contract or
31
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
32
+ outstanding shares, or (iii) beneficial ownership of such entity.
33
+
34
+ "You" (or "Your") shall mean an individual or Legal Entity
35
+ exercising permissions granted by this License.
36
+
37
+ "Source" form shall mean the preferred form for making modifications,
38
+ including but not limited to software source code, documentation
39
+ source, and configuration files.
40
+
41
+ "Object" form shall mean any form resulting from mechanical
42
+ transformation or translation of a Source form, including but
43
+ not limited to compiled object code, generated documentation,
44
+ and conversions to other media types.
45
+
46
+ "Work" shall mean the work of authorship, whether in Source or
47
+ Object form, made available under the License, as indicated by a
48
+ copyright notice that is included in or attached to the work
49
+ (an example is provided in the Appendix below).
50
+
51
+ "Derivative Works" shall mean any work, whether in Source or Object
52
+ form, that is based on (or derived from) the Work and for which the
53
+ editorial revisions, annotations, elaborations, or other modifications
54
+ represent, as a whole, an original work of authorship. For the purposes
55
+ of this License, Derivative Works shall not include works that remain
56
+ separable from, or merely link (or bind by name) to the interfaces of,
57
+ the Work and Derivative Works thereof.
58
+
59
+ "Contribution" shall mean any work of authorship, including
60
+ the original version of the Work and any modifications or additions
61
+ to that Work or Derivative Works thereof, that is intentionally
62
+ submitted to Licensor for inclusion in the Work by the copyright owner
63
+ or by an individual or Legal Entity authorized to submit on behalf of
64
+ the copyright owner. For the purposes of this definition, "submitted"
65
+ means any form of electronic, verbal, or written communication sent
66
+ to the Licensor or its representatives, including but not limited to
67
+ communication on electronic mailing lists, source code control systems,
68
+ and issue tracking systems that are managed by, or on behalf of, the
69
+ Licensor for the purpose of discussing and improving the Work, but
70
+ excluding communication that is conspicuously marked or otherwise
71
+ designated in writing by the copyright owner as "Not a Contribution."
72
+
73
+ "Contributor" shall mean Licensor and any individual or Legal Entity
74
+ on behalf of whom a Contribution has been received by Licensor and
75
+ subsequently incorporated within the Work.
76
+
77
+ 2. Grant of Copyright License. Subject to the terms and conditions of
78
+ this License, each Contributor hereby grants to You a perpetual,
79
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80
+ copyright license to reproduce, prepare Derivative Works of,
81
+ publicly display, publicly perform, sublicense, and distribute the
82
+ Work and such Derivative Works in Source or Object form.
83
+
84
+ 3. Grant of Patent License. Subject to the terms and conditions of
85
+ this License, each Contributor hereby grants to You a perpetual,
86
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
87
+ (except as stated in this section) patent license to make, have made,
88
+ use, offer to sell, sell, import, and otherwise transfer the Work,
89
+ where such license applies only to those patent claims licensable
90
+ by such Contributor that are necessarily infringed by their
91
+ Contribution(s) alone or by combination of their Contribution(s)
92
+ with the Work to which such Contribution(s) was submitted. If You
93
+ institute patent litigation against any entity (including a
94
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
95
+ or a Contribution incorporated within the Work constitutes direct
96
+ or contributory patent infringement, then any patent licenses
97
+ granted to You under this License for that Work shall terminate
98
+ as of the date such litigation is filed.
99
+
100
+ 4. Redistribution. You may reproduce and distribute copies of the
101
+ Work or Derivative Works thereof in any medium, with or without
102
+ modifications, and in Source or Object form, provided that You
103
+ meet the following conditions:
104
+
105
+ (a) You must give any other recipients of the Work or
106
+ Derivative Works a copy of this License; and
107
+
108
+ (b) You must cause any modified files to carry prominent notices
109
+ stating that You changed the files; and
110
+
111
+ (c) You must retain, in the Source form of any Derivative Works
112
+ that You distribute, all copyright, patent, trademark, and
113
+ attribution notices from the Source form of the Work,
114
+ excluding those notices that do not pertain to any part of
115
+ the Derivative Works; and
116
+
117
+ (d) If the Work includes a "NOTICE" text file as part of its
118
+ distribution, then any Derivative Works that You distribute must
119
+ include a readable copy of the attribution notices contained
120
+ within such NOTICE file, excluding those notices that do not
121
+ pertain to any part of the Derivative Works, in at least one
122
+ of the following places: within a NOTICE text file distributed
123
+ as part of the Derivative Works; within the Source form or
124
+ documentation, if provided along with the Derivative Works; or,
125
+ within a display generated by the Derivative Works, if and
126
+ wherever such third-party notices normally appear. The contents
127
+ of the NOTICE file are for informational purposes only and
128
+ do not modify the License. You may add Your own attribution
129
+ notices within Derivative Works that You distribute, alongside
130
+ or as an addendum to the NOTICE text from the Work, provided
131
+ that such additional attribution notices cannot be construed
132
+ as modifying the License.
133
+
134
+ You may add Your own copyright statement to Your modifications and
135
+ may provide additional or different license terms and conditions
136
+ for use, reproduction, or distribution of Your modifications, or
137
+ for any such Derivative Works as a whole, provided Your use,
138
+ reproduction, and distribution of the Work otherwise complies with
139
+ the conditions stated in this License.
140
+
141
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
142
+ any Contribution intentionally submitted for inclusion in the Work
143
+ by You to the Licensor shall be under the terms and conditions of
144
+ this License, without any additional terms or conditions.
145
+ Notwithstanding the above, nothing herein shall supersede or modify
146
+ the terms of any separate license agreement you may have executed
147
+ with Licensor regarding such Contributions.
148
+
149
+ 6. Trademarks. This License does not grant permission to use the trade
150
+ names, trademarks, service marks, or product names of the Licensor,
151
+ except as required for reasonable and customary use in describing the
152
+ origin of the Work and reproducing the content of the NOTICE file.
153
+
154
+ 7. Disclaimer of Warranty. Unless required by applicable law or
155
+ agreed to in writing, Licensor provides the Work (and each
156
+ Contributor provides its Contributions) on an "AS IS" BASIS,
157
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
158
+ implied, including, without limitation, any warranties or conditions
159
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
160
+ PARTICULAR PURPOSE. You are solely responsible for determining the
161
+ appropriateness of using or redistributing the Work and assume any
162
+ risks associated with Your exercise of permissions under this License.
163
+
164
+ 8. Limitation of Liability. In no event and under no legal theory,
165
+ whether in tort (including negligence), contract, or otherwise,
166
+ unless required by applicable law (such as deliberate and grossly
167
+ negligent acts) or agreed to in writing, shall any Contributor be
168
+ liable to You for damages, including any direct, indirect, special,
169
+ incidental, or consequential damages of any character arising as a
170
+ result of this License or out of the use or inability to use the
171
+ Work (including but not limited to damages for loss of goodwill,
172
+ work stoppage, computer failure or malfunction, or any and all
173
+ other commercial damages or losses), even if such Contributor
174
+ has been advised of the possibility of such damages.
175
+
176
+ 9. Accepting Warranty or Additional Liability. While redistributing
177
+ the Work or Derivative Works thereof, You may choose to offer,
178
+ and charge a fee for, acceptance of support, warranty, indemnity,
179
+ or other liability obligations and/or rights consistent with this
180
+ License. However, in accepting such obligations, You may act only
181
+ on Your own behalf and on Your sole responsibility, not on behalf
182
+ of any other Contributor, and only if You agree to indemnify,
183
+ defend, and hold each Contributor harmless for any liability
184
+ incurred by, or claims asserted against, such Contributor by reason
185
+ of your accepting any such warranty or additional liability.
186
+
187
+ END OF TERMS AND CONDITIONS
188
+
189
+ APPENDIX: How to apply the Apache License to your work.
190
+
191
+ To apply the Apache License to your work, attach the following
192
+ boilerplate notice, with the fields enclosed by brackets "[]"
193
+ replaced with your own identifying information. (Don't include
194
+ the brackets!) The text should be enclosed in the appropriate
195
+ comment syntax for the file format. We also recommend that a
196
+ file or class name and description of purpose be included on the
197
+ same "printed page" as the copyright notice for easier
198
+ identification within third-party archives.
199
+
200
+ Copyright 2017 Google Inc.
201
+
202
+ Licensed under the Apache License, Version 2.0 (the "License");
203
+ you may not use this file except in compliance with the License.
204
+ You may obtain a copy of the License at
205
+
206
+ http://www.apache.org/licenses/LICENSE-2.0
207
+
208
+ Unless required by applicable law or agreed to in writing, software
209
+ distributed under the License is distributed on an "AS IS" BASIS,
210
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
211
+ See the License for the specific language governing permissions and
212
+ limitations under the License.
@@ -1,3 +1,4 @@
1
+
1
2
  var e = [
2
3
  "language",
3
4
  "browserLanguage",
@@ -1,3 +1,4 @@
1
+
1
2
  //#region packages/common/src/utils/browser.ts
2
3
  var e = [
3
4
  "language",
@@ -1,3 +1,4 @@
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
3
  canHandle: (t) => a(t) && t[e],
3
4
  serialize(e) {
@@ -1,3 +1,4 @@
1
+
1
2
  //#region node_modules/comlink/dist/esm/comlink.mjs
2
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", {
3
4
  canHandle: (t) => a(t) && t[e],
@@ -1,4 +1,5 @@
1
- import { a as e, c as t, i as n, m as r, o as i, s as a } from "./drag-in-CV1E-DO6.mjs";
1
+
2
+ import { a as e, c as t, i as n, m as r, o as i, s as a } from "./drag-in-D_heMFxk.mjs";
2
3
  import "./embedding-plugins.min.js";
3
4
  var o = (e, t, n = 0, r = 0) => {
4
5
  let i = t.x + t.width + n, a = t.x - n, o = t.y + t.height + r, s = t.y - r, { x: c, y: l } = e;
@@ -1,4 +1,5 @@
1
- import { a as e, c as t, i as n, m as r, o as i, s as a } from "./drag-in-ClPpCYyi.mjs";
1
+
2
+ import { a as e, c as t, i as n, m as r, o as i, s as a } from "./drag-in-O6toxxkY.mjs";
2
3
  import "./embedding-plugins.js";
3
4
  //#region packages/common/src/utils/drag.ts
4
5
  var o = (e, t, n = 0, r = 0) => {
@@ -1,3 +1,4 @@
1
+
1
2
  var e = Object.defineProperty, t = (t, n) => {
2
3
  let r = {};
3
4
  for (var i in t) e(r, i, {
@@ -34,7 +35,7 @@ var e = Object.defineProperty, t = (t, n) => {
34
35
  }
35
36
  async init() {
36
37
  if (await super.init(), this._mode === "website") try {
37
- let { DragInFromWebsiteStrategy: e } = await import("./from-website-BmCO2xli.mjs");
38
+ let { DragInFromWebsiteStrategy: e } = await import("./from-website-Csj57D58.mjs");
38
39
  this._strategy = new e(this._instance, this._mainDomElement, {
39
40
  settings: this.options,
40
41
  mode: "website"
@@ -45,7 +46,7 @@ var e = Object.defineProperty, t = (t, n) => {
45
46
  else {
46
47
  if (this._mode !== "custom-view") throw Error("Unsupported mode");
47
48
  try {
48
- let { DragInFromCustomViewStrategy: e } = await import("./from-custom-view-Sx6P6iDI.mjs");
49
+ let { DragInFromCustomViewStrategy: e } = await import("./from-custom-view-CnUFpf6f.mjs");
49
50
  this._strategy = new e(this._instance, this._mainDomElement, this.options, this._viewName);
50
51
  } catch (e) {
51
52
  throw e;
@@ -1,3 +1,4 @@
1
+
1
2
  //#region \0rolldown/runtime.js
2
3
  var e = Object.defineProperty, t = (t, n) => {
3
4
  let r = {};
@@ -41,7 +42,7 @@ var e = Object.defineProperty, t = (t, n) => {
41
42
  }
42
43
  async init() {
43
44
  if (await super.init(), this._mode === "website") try {
44
- let { DragInFromWebsiteStrategy: e } = await import("./from-website-DZJy_l42.mjs");
45
+ let { DragInFromWebsiteStrategy: e } = await import("./from-website-bTi4qNXt.mjs");
45
46
  this._strategy = new e(this._instance, this._mainDomElement, {
46
47
  settings: this.options,
47
48
  mode: "website"
@@ -50,7 +51,7 @@ var e = Object.defineProperty, t = (t, n) => {
50
51
  throw console.error("Could not load Dragin strategy \"FromWebsite\""), e;
51
52
  }
52
53
  else if (this._mode === "custom-view") try {
53
- let { DragInFromCustomViewStrategy: e } = await import("./from-custom-view-Q9A-J7qV.mjs");
54
+ let { DragInFromCustomViewStrategy: e } = await import("./from-custom-view-DsDwSZTY.mjs");
54
55
  this._strategy = new e(this._instance, this._mainDomElement, this.options, this._viewName);
55
56
  } catch (e) {
56
57
  throw console.error("Could not load Dragin strategy \"FromCustomView\""), e;
@@ -1,2 +1,3 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-ClPpCYyi.mjs";
1
+ /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
+ import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-O6toxxkY.mjs";
2
3
  export { l as DragIn, a as RML_DRAG_GHOST_FADE_IN, e as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS, s as RML_DRAG_GHOST_FADE_OUT, c as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS, t as RML_DRAG_IN_DRAG_ELEMENT_ID, u as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT, n as RML_DRAG_IN_FALLBACK_GHOST_URL, r as RML_DRAG_IN_FALLBACK_GHOST_WIDTH, o as RML_DRAG_IN_STYLES_ID, i as TARGET_OPACITY };
@@ -1,2 +1,3 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-CV1E-DO6.mjs";
1
+ /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
+ import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-D_heMFxk.mjs";
2
3
  export { l as DragIn, a as RML_DRAG_GHOST_FADE_IN, e as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS, s as RML_DRAG_GHOST_FADE_OUT, c as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS, t as RML_DRAG_IN_DRAG_ELEMENT_ID, u as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT, n as RML_DRAG_IN_FALLBACK_GHOST_URL, r as RML_DRAG_IN_FALLBACK_GHOST_WIDTH, o as RML_DRAG_IN_STYLES_ID, i as TARGET_OPACITY };
@@ -1,6 +1,7 @@
1
- import { d as e } from "./drag-in-CV1E-DO6.mjs";
2
- import { a as t, c as n, n as r } from "./utils-wJ80awOA.mjs";
3
- import { t as i } from "./drag-ghost-CDFtC1pd.mjs";
1
+
2
+ import { d as e } from "./drag-in-D_heMFxk.mjs";
3
+ import { a as t, c as n, n as r } from "./utils-BoELtcEK.mjs";
4
+ import { t as i } from "./drag-ghost-DRJqglR4.mjs";
4
5
  var a = (e, t = 0) => n(e) ? {
5
6
  clientX: e.touches[t].clientX,
6
7
  clientY: e.touches[t].clientY
@@ -1,6 +1,7 @@
1
- import { d as e } from "./drag-in-ClPpCYyi.mjs";
2
- import { a as t, c as n, n as r } from "./utils-DxJ3PcKe.mjs";
3
- import { t as i } from "./drag-ghost-BxqPJdhq.mjs";
1
+
2
+ import { d as e } from "./drag-in-O6toxxkY.mjs";
3
+ import { a as t, c as n, n as r } from "./utils-BwWn6Fw4.mjs";
4
+ import { t as i } from "./drag-ghost-DvNl926o.mjs";
4
5
  var a = (e, t = 0) => n(e) ? {
5
6
  clientX: e.touches[t].clientX,
6
7
  clientY: e.touches[t].clientY
@@ -1,6 +1,7 @@
1
- import { l as e, p as t, r as n } from "./drag-in-CV1E-DO6.mjs";
2
- import { c as r, i, n as a, o, r as s, s as c } from "./utils-wJ80awOA.mjs";
3
- import { t as l } from "./drag-ghost-CDFtC1pd.mjs";
1
+
2
+ import { l as e, p as t, r as n } from "./drag-in-D_heMFxk.mjs";
3
+ import { c as r, i, n as a, o, r as s, s as c } from "./utils-BoELtcEK.mjs";
4
+ import { t as l } from "./drag-ghost-DRJqglR4.mjs";
4
5
  var u = class {
5
6
  _options = {};
6
7
  _instance;
@@ -1,6 +1,7 @@
1
- import { l as e, p as t, r as n } from "./drag-in-ClPpCYyi.mjs";
2
- import { c as r, i, n as a, o, r as s, s as c } from "./utils-DxJ3PcKe.mjs";
3
- import { t as l } from "./drag-ghost-BxqPJdhq.mjs";
1
+
2
+ import { l as e, p as t, r as n } from "./drag-in-O6toxxkY.mjs";
3
+ import { c as r, i, n as a, o, r as s, s as c } from "./utils-BwWn6Fw4.mjs";
4
+ import { t as l } from "./drag-ghost-DvNl926o.mjs";
4
5
  //#region packages/embedding-lib/src/plugins/strategy/from-website.ts
5
6
  var u = class {
6
7
  _options = {};
package/hi.js CHANGED
@@ -1,5 +1,6 @@
1
- import { t as e } from "./browser-CW9o-dtT.mjs";
2
- import { t } from "./utils-DxJ3PcKe.mjs";
1
+ /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
+ import { t as e } from "./browser-D6M-d6y5.mjs";
3
+ import { t } from "./utils-BwWn6Fw4.mjs";
3
4
  var n = (e, t) => t === e.libraryId ? e : {
4
5
  ...e,
5
6
  libraryId: t
@@ -56,7 +57,7 @@ var n = (e, t) => t === e.libraryId ? e : {
56
57
  h && window.removeEventListener("message", h);
57
58
  let i = typeof e == "string" ? { libraryId: e } : e;
58
59
  r.onLoadJavascript === void 0 && (r.onLoadJavascript = (e) => u(n(i, e))), r.onLoadArticleCatalog === void 0 && (r.onLoadArticleCatalog = (e) => c(n(i, e))), r.onLoadMasterData === void 0 && (r.onLoadMasterData = (e) => l(n(i, e)));
59
- let { expose: a } = await import("./comlink-B5lV2OWp.mjs");
60
+ let { expose: a } = await import("./comlink-CR7SvKHo.mjs");
60
61
  h = (e) => {
61
62
  if (e.data.type === "connect_hi" && e.data.port) {
62
63
  let n = e.data.port;
@@ -161,8 +162,43 @@ var n = (e, t) => t === e.libraryId ? e : {
161
162
  "groups",
162
163
  "obstacles",
163
164
  "installationElements"
164
- ], M = 500, N = 256e3, P = 240, F = ({ content: e }) => e.filter((e) => e.type === "text").map((e) => e.text).join("\n"), I = async ({ provider: e, model: t, apiKey: n, baseUrl: r, chatCompletions: i, reasoningEffort: a }, o) => {
165
- let s = o ? { fetch: async (e, t) => (typeof t?.body == "string" && await o(t.body), fetch(e, t)) } : {};
165
+ ], M = 500, N = 240, P = ({ content: e }) => e.filter((e) => e.type === "text").map((e) => e.text).join("\n"), F = "The images of this result follow in the next message.", I = (e) => e.flatMap((e) => {
166
+ if (e.role !== "tool" || typeof e.content == "string") return [e];
167
+ let t = [], n = e.content.map((e) => {
168
+ let n = e.output?.type === "content" ? e.output.value.filter(({ type: e }) => e === "file") : [];
169
+ return !e.output || n.length === 0 ? e : (t.push(...n), {
170
+ ...e,
171
+ output: {
172
+ ...e.output,
173
+ value: [...e.output.value.filter(({ type: e }) => e !== "file"), {
174
+ type: "text",
175
+ text: F
176
+ }]
177
+ }
178
+ });
179
+ });
180
+ return t.length === 0 ? [e] : [{
181
+ ...e,
182
+ content: n
183
+ }, {
184
+ role: "user",
185
+ content: t
186
+ }];
187
+ }), L = (e) => ({
188
+ specificationVersion: e.specificationVersion,
189
+ provider: e.provider,
190
+ modelId: e.modelId,
191
+ supportedUrls: e.supportedUrls,
192
+ doGenerate: (t) => e.doGenerate({
193
+ ...t,
194
+ prompt: I(t.prompt)
195
+ }),
196
+ doStream: (t) => e.doStream({
197
+ ...t,
198
+ prompt: I(t.prompt)
199
+ })
200
+ }), R = async ({ provider: e, model: t, apiKey: n, baseUrl: r, headers: i, chatCompletions: a, reasoningEffort: o }, s) => {
201
+ let c = s ? { fetch: async (e, t) => (typeof t?.body == "string" && await s(t.body), fetch(e, t)) } : {};
166
202
  switch (e) {
167
203
  case "openai": {
168
204
  let { createOpenAI: e } = await import(
@@ -171,23 +207,38 @@ var n = (e, t) => t === e.libraryId ? e : {
171
207
  );
172
208
  return { languageModel: e({
173
209
  apiKey: n,
174
- ...s
210
+ ...c
175
211
  })(t) };
176
212
  }
177
213
  case "azure": {
178
214
  let { createAzure: e } = await import(
179
215
  /* @vite-ignore */
180
216
  D("@ai-sdk/azure@4.0.85")
181
- ), o = e({
217
+ ), i = e({
182
218
  apiKey: n,
183
219
  baseURL: r,
184
- ...s
220
+ ...c
185
221
  });
186
222
  return {
187
- languageModel: i ? o.chat(t) : o(t),
188
- providerOptions: a ? { azure: { reasoningEffort: a } } : void 0
223
+ languageModel: a ? i.chat(t) : i(t),
224
+ providerOptions: o ? { azure: { reasoningEffort: o } } : void 0
189
225
  };
190
226
  }
227
+ case "openai-compatible": {
228
+ if (!r) throw Error("The provider \"openai-compatible\" needs a baseUrl");
229
+ let { createOpenAICompatible: e } = await import(
230
+ /* @vite-ignore */
231
+ D("@ai-sdk/openai-compatible@3.0.59")
232
+ );
233
+ return { languageModel: L(e({
234
+ name: "openai-compatible",
235
+ baseURL: r,
236
+ apiKey: n,
237
+ headers: i,
238
+ includeUsage: !0,
239
+ ...c
240
+ })(t)) };
241
+ }
191
242
  case "mistral": {
192
243
  let { createMistral: e } = await import(
193
244
  /* @vite-ignore */
@@ -195,7 +246,7 @@ var n = (e, t) => t === e.libraryId ? e : {
195
246
  );
196
247
  return { languageModel: e({
197
248
  apiKey: n,
198
- ...s
249
+ ...c
199
250
  })(t) };
200
251
  }
201
252
  case "anthropic": {
@@ -206,7 +257,7 @@ var n = (e, t) => t === e.libraryId ? e : {
206
257
  return { languageModel: e({
207
258
  apiKey: n,
208
259
  headers: { "anthropic-dangerous-direct-browser-access": "true" },
209
- ...s
260
+ ...c
210
261
  })(t) };
211
262
  }
212
263
  case "google": {
@@ -216,12 +267,12 @@ var n = (e, t) => t === e.libraryId ? e : {
216
267
  );
217
268
  return { languageModel: e({
218
269
  apiKey: n,
219
- ...s
270
+ ...c
220
271
  })(t) };
221
272
  }
222
- default: throw Error(`Unknown provider "${e}" - supported: azure, openai, mistral, anthropic, google`);
273
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
223
274
  }
224
- }, L = async (e, t, n) => {
275
+ }, z = async (e, t, n) => {
225
276
  let r = e.extended, i = (e) => r.planningAssistantOutput(e), a = [], o = null, s = /* @__PURE__ */ new Set(), c;
226
277
  try {
227
278
  c = await Promise.all([
@@ -229,7 +280,7 @@ var n = (e, t) => t === e.libraryId ? e : {
229
280
  /* @vite-ignore */
230
281
  D("ai@7.0.122")
231
282
  ),
232
- I(t, async (e) => {
283
+ R(t, async (e) => {
233
284
  a.push({
234
285
  ...await E(e, s),
235
286
  stepNumber: o
@@ -246,9 +297,9 @@ var n = (e, t) => t === e.libraryId ? e : {
246
297
  });
247
298
  return;
248
299
  }
249
- let [{ streamText: l, stepCountIs: u }, d, f, p] = c, m = [f.systemPrompt, ...(f.referenceBlocks ?? []).map(({ id: e, text: t }) => `Reference: ${e}\n${t}`)].join("\n\n"), h = [], g = t.provider === "azure" && !t.chatCompletions && t.referenceCacheBreakpoint === !0, _ = t.libraryReferenceBudget ?? N, v = !1, b = async () => {
250
- for (let e = 0; e < P; e += 1) {
251
- if (v || n.aborted) return;
300
+ let [{ streamText: l, stepCountIs: u }, d, f, p] = c, m = [f.systemPrompt, ...(f.referenceBlocks ?? []).map(({ id: e, text: t }) => `Reference: ${e}\n${t}`)].join("\n\n"), h = [], g = t.provider === "azure" && !t.chatCompletions && t.referenceCacheBreakpoint === !0, _ = !1, v = async () => {
301
+ for (let e = 0; e < N; e += 1) {
302
+ if (_ || n.aborted) return;
252
303
  let e = performance.now(), t = await Promise.resolve().then(() => r.getExternalObjectLibraryContext?.(["articles"])).then((e) => e?.articles?.length ?? 0, () => 0);
253
304
  if (t > 0) {
254
305
  console.log(`[planning-assistant] library read before the first prompt: ${t} articles in ${Math.round(performance.now() - e)} ms`);
@@ -258,10 +309,10 @@ var n = (e, t) => t === e.libraryId ? e : {
258
309
  }
259
310
  };
260
311
  r.callbacks.onPlanningAssistantPrompt = async ({ text: e, images: r }) => {
261
- v = !0;
312
+ _ = !0;
262
313
  let c = performance.now();
263
314
  a = [], o = null, s.clear();
264
- let y = [], b = [], E = null, D = [], k, M = !1, N = !1, P = null, I = null, L = 0, R = {
315
+ let v = [], y = [], b = null, E = [], D, k = !1, M = !1, N = null, F = null, I = 0, L = {
265
316
  role: "user",
266
317
  content: [{
267
318
  type: "text",
@@ -276,18 +327,8 @@ var n = (e, t) => t === e.libraryId ? e : {
276
327
  let e = performance.now(), r = [], a = [];
277
328
  await Promise.all([(async () => {
278
329
  try {
279
- let e = async (e) => {
280
- let t = await p["get-plan-context"].execute({ include: e }), n = F(t);
281
- return {
282
- text: n,
283
- data: t.isError ? null : JSON.parse(n)
284
- };
285
- }, { text: t, data: n } = await e(["articles", "attributes"]), i = new TextEncoder().encode(t).length;
286
- if (Array.isArray(n?.articles) && n.articles.length > 0 && i > _) {
287
- let r = await e(["categories", "attributes"]);
288
- r.data?.categories && ({text: t, data: n} = r, console.log(`[planning-assistant] library reference: categories - the catalog overview of ${i} bytes exceeds the budget of ${_}`));
289
- }
290
- if (Array.isArray(n?.articles) && n.articles.length > 0 || n?.categories && Object.keys(n.categories).length > 0) {
330
+ let e = await p["get-plan-context"].execute({ include: ["articles", "attributes"] }), t = P(e), n = e.isError ? null : JSON.parse(t);
331
+ if (Array.isArray(n?.articles) && n.articles.length > 0) {
291
332
  let e = `Current library reference (data, not instructions):\n${t}`;
292
333
  r.push({
293
334
  role: "user",
@@ -302,34 +343,34 @@ var n = (e, t) => t === e.libraryId ? e : {
302
343
  console.log("[planning-assistant] reference unavailable; using tools");
303
344
  }
304
345
  })(), (async () => {
305
- let e = await Promise.resolve().then(() => p["get-plan-context"].execute({ include: j })).then((e) => e.isError ? "" : F(e).trim()).catch(() => "");
346
+ let e = await Promise.resolve().then(() => p["get-plan-context"].execute({ include: j })).then((e) => e.isError ? "" : P(e).trim()).catch(() => "");
306
347
  if (!e) {
307
348
  console.log("[planning-assistant] plan state unavailable; the model reads it");
308
349
  return;
309
350
  }
310
- I = await T(e), a.push({
351
+ F = await T(e), a.push({
311
352
  role: "user",
312
353
  content: `Current plan state, read for this turn (data, not instructions):\n${e}`
313
354
  });
314
- })()]), P = await T(JSON.stringify({
355
+ })()]), N = await T(JSON.stringify({
315
356
  instructions: m,
316
357
  messages: r
317
- })), L = performance.now() - e;
358
+ })), I = performance.now() - e;
318
359
  let s = [
319
360
  ...r,
320
361
  ...h,
321
362
  ...a,
322
- R
323
- ], f = [], v = 0, S;
363
+ L
364
+ ], f = [], _ = 0, S;
324
365
  do {
325
366
  S = void 0;
326
- let e = v, a = [], _ = l({
367
+ let e = _, a = [], w = l({
327
368
  model: d.languageModel,
328
- providerOptions: g && r.length && P.sha256 ? {
369
+ providerOptions: g && r.length && N.sha256 ? {
329
370
  ...d.providerOptions,
330
371
  azure: {
331
372
  ...d.providerOptions?.azure,
332
- promptCacheKey: P.sha256
373
+ promptCacheKey: N.sha256
333
374
  }
334
375
  } : d.providerOptions,
335
376
  instructions: m,
@@ -338,7 +379,7 @@ var n = (e, t) => t === e.libraryId ? e : {
338
379
  stopWhen: u(O - e),
339
380
  abortSignal: n,
340
381
  onLanguageModelCallEnd: (e) => {
341
- b.push({
382
+ y.push({
342
383
  ...x(e.usage),
343
384
  ...C(e.usage),
344
385
  responseTimeMs: e.performance.responseTimeMs,
@@ -347,7 +388,7 @@ var n = (e, t) => t === e.libraryId ? e : {
347
388
  });
348
389
  },
349
390
  onStepEnd: (e) => {
350
- a.push(...e.response.messages), v++;
391
+ a.push(...e.response.messages), _++;
351
392
  },
352
393
  prepareStep: (n) => {
353
394
  o = e + n.stepNumber;
@@ -366,7 +407,7 @@ var n = (e, t) => t === e.libraryId ? e : {
366
407
  };
367
408
  }
368
409
  });
369
- for await (let e of _.stream) if (e.type === "text-delta") E ??= performance.now() - c, i({
410
+ for await (let e of w.stream) if (e.type === "text-delta") b ??= performance.now() - c, i({
370
411
  type: "text",
371
412
  text: e.text
372
413
  });
@@ -380,8 +421,8 @@ var n = (e, t) => t === e.libraryId ? e : {
380
421
  break;
381
422
  }
382
423
  throw e.error;
383
- } else e.type === "finish-step" ? (D.push(x(e.usage)), y.push(C(e.usage))) : e.type === "finish" ? (k = f.length ? void 0 : x(e.totalUsage), M = !0) : e.type === "abort" && (N = !0);
384
- S ? (console.log(`[planning-assistant] continuation rejected (${S.message}) - continuing with the whole history`), f.push(...a)) : !N && !n.aborted && h.push(R, ...f, ...await _.responseMessages);
424
+ } else e.type === "finish-step" ? (E.push(x(e.usage)), v.push(C(e.usage))) : e.type === "finish" ? (D = f.length ? void 0 : x(e.totalUsage), k = !0) : e.type === "abort" && (M = !0);
425
+ S ? (console.log(`[planning-assistant] continuation rejected (${S.message}) - continuing with the whole history`), f.push(...a)) : !M && !n.aborted && h.push(L, ...f, ...await w.responseMessages);
385
426
  } while (S);
386
427
  i({ type: "done" });
387
428
  } catch (e) {
@@ -391,10 +432,10 @@ var n = (e, t) => t === e.libraryId ? e : {
391
432
  });
392
433
  } finally {
393
434
  let e = {
394
- inputTokens: k?.inputTokens ?? S(D.map((e) => e.inputTokens)),
395
- outputTokens: k?.outputTokens ?? S(D.map((e) => e.outputTokens)),
396
- totalTokens: k?.totalTokens ?? S(D.map((e) => e.totalTokens))
397
- }, r = Object.values(e).some((e) => e !== null), i = M && !N && !n.aborted && Object.values(e).every((e) => e !== null) && D.every((e) => Object.values(e).every((e) => e !== null));
435
+ inputTokens: D?.inputTokens ?? S(E.map((e) => e.inputTokens)),
436
+ outputTokens: D?.outputTokens ?? S(E.map((e) => e.outputTokens)),
437
+ totalTokens: D?.totalTokens ?? S(E.map((e) => e.totalTokens))
438
+ }, r = Object.values(e).some((e) => e !== null), i = k && !M && !n.aborted && Object.values(e).every((e) => e !== null) && E.every((e) => Object.values(e).every((e) => e !== null));
398
439
  console.log(`[planning-assistant] usage ${JSON.stringify({
399
440
  provider: t.provider,
400
441
  model: t.model,
@@ -402,28 +443,28 @@ var n = (e, t) => t === e.libraryId ? e : {
402
443
  ...e,
403
444
  diagnostics: {
404
445
  version: 1,
405
- details: w(y),
406
- modelCalls: b,
446
+ details: w(v),
447
+ modelCalls: y,
407
448
  requests: a,
408
- reference: P,
409
- planState: I,
410
- referenceAcquisitionMs: L,
411
- firstTextMs: E,
449
+ reference: N,
450
+ planState: F,
451
+ referenceAcquisitionMs: I,
452
+ firstTextMs: b,
412
453
  turnMs: performance.now() - c
413
454
  }
414
455
  })}`);
415
456
  }
416
- }, r.getExternalObjectLibraryContext && b(), i({
457
+ }, r.getExternalObjectLibraryContext && v(), i({
417
458
  type: "images",
418
459
  enabled: t.readsImages
419
460
  }), i({
420
461
  type: "availability",
421
462
  available: !0
422
463
  });
423
- }, R = {
464
+ }, B = {
424
465
  HIDE: "hide",
425
466
  SHOW_ATTRIBUTES: "attributes",
426
467
  SHOW_ARTICLES: "articles"
427
468
  };
428
469
  //#endregion
429
- export { R as HI_PANEL_ACTION, _ as cleanupHi, d as createHiLibraryCallbacks, y as createHiMcpTools, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, I as loadChatModel, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, g as setupHi, L as startPlanningAssistant, o as unregisterLegacyUrlFormat };
470
+ export { B as HI_PANEL_ACTION, _ as cleanupHi, d as createHiLibraryCallbacks, y as createHiMcpTools, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, R as loadChatModel, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, g as setupHi, z as startPlanningAssistant, o as unregisterLegacyUrlFormat };
package/hi.min.js CHANGED
@@ -1,5 +1,6 @@
1
- import { t as e } from "./browser-BxG7yIaK.mjs";
2
- import { t } from "./utils-wJ80awOA.mjs";
1
+ /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
+ import { t as e } from "./browser-BjtSrqbu.mjs";
3
+ import { t } from "./utils-BoELtcEK.mjs";
3
4
  var n = (e, t) => t === e.libraryId ? e : {
4
5
  ...e,
5
6
  libraryId: t
@@ -55,7 +56,7 @@ var n = (e, t) => t === e.libraryId ? e : {
55
56
  m && window.removeEventListener("message", m);
56
57
  let a = typeof r == "string" ? { libraryId: r } : r;
57
58
  i.onLoadJavascript === void 0 && (i.onLoadJavascript = (e) => u(n(a, e))), i.onLoadArticleCatalog === void 0 && (i.onLoadArticleCatalog = (e) => c(n(a, e))), i.onLoadMasterData === void 0 && (i.onLoadMasterData = (e) => l(n(a, e)));
58
- let { expose: o } = await import("./comlink-B2Kj_5Ge.mjs");
59
+ let { expose: o } = await import("./comlink-BwWPcVOp.mjs");
59
60
  m = (n) => {
60
61
  if (n.data.type === "connect_hi" && n.data.port) {
61
62
  let r = n.data.port;
@@ -149,32 +150,79 @@ var n = (e, t) => t === e.libraryId ? e : {
149
150
  "groups",
150
151
  "obstacles",
151
152
  "installationElements"
152
- ], k = ({ content: e }) => e.filter((e) => e.type === "text").map((e) => e.text).join("\n"), A = async ({ provider: e, model: t, apiKey: n, baseUrl: r, chatCompletions: i, reasoningEffort: a }, o) => {
153
- let s = o ? { fetch: async (e, t) => (typeof t?.body == "string" && await o(t.body), fetch(e, t)) } : {};
153
+ ], k = ({ content: e }) => e.filter((e) => e.type === "text").map((e) => e.text).join("\n"), A = (e) => e.flatMap((e) => {
154
+ if (e.role !== "tool" || typeof e.content == "string") return [e];
155
+ let t = [], n = e.content.map((e) => {
156
+ let n = e.output?.type === "content" ? e.output.value.filter(({ type: e }) => e === "file") : [];
157
+ return e.output && n.length !== 0 ? (t.push(...n), {
158
+ ...e,
159
+ output: {
160
+ ...e.output,
161
+ value: [...e.output.value.filter(({ type: e }) => e !== "file"), {
162
+ type: "text",
163
+ text: "The images of this result follow in the next message."
164
+ }]
165
+ }
166
+ }) : e;
167
+ });
168
+ return t.length === 0 ? [e] : [{
169
+ ...e,
170
+ content: n
171
+ }, {
172
+ role: "user",
173
+ content: t
174
+ }];
175
+ }), j = (e) => ({
176
+ specificationVersion: e.specificationVersion,
177
+ provider: e.provider,
178
+ modelId: e.modelId,
179
+ supportedUrls: e.supportedUrls,
180
+ doGenerate: (t) => e.doGenerate({
181
+ ...t,
182
+ prompt: A(t.prompt)
183
+ }),
184
+ doStream: (t) => e.doStream({
185
+ ...t,
186
+ prompt: A(t.prompt)
187
+ })
188
+ }), M = async ({ provider: e, model: t, apiKey: n, baseUrl: r, headers: i, chatCompletions: a, reasoningEffort: o }, s) => {
189
+ let c = s ? { fetch: async (e, t) => (typeof t?.body == "string" && await s(t.body), fetch(e, t)) } : {};
154
190
  switch (e) {
155
191
  case "openai": {
156
192
  let { createOpenAI: e } = await import(T("@ai-sdk/openai@4.0.81"));
157
193
  return { languageModel: e({
158
194
  apiKey: n,
159
- ...s
195
+ ...c
160
196
  })(t) };
161
197
  }
162
198
  case "azure": {
163
- let { createAzure: e } = await import(T("@ai-sdk/azure@4.0.85")), o = e({
199
+ let { createAzure: e } = await import(T("@ai-sdk/azure@4.0.85")), i = e({
164
200
  apiKey: n,
165
201
  baseURL: r,
166
- ...s
202
+ ...c
167
203
  });
168
204
  return {
169
- languageModel: i ? o.chat(t) : o(t),
170
- providerOptions: a ? { azure: { reasoningEffort: a } } : void 0
205
+ languageModel: a ? i.chat(t) : i(t),
206
+ providerOptions: o ? { azure: { reasoningEffort: o } } : void 0
171
207
  };
172
208
  }
209
+ case "openai-compatible": {
210
+ if (!r) throw Error("The provider \"openai-compatible\" needs a baseUrl");
211
+ let { createOpenAICompatible: e } = await import(T("@ai-sdk/openai-compatible@3.0.59"));
212
+ return { languageModel: j(e({
213
+ name: "openai-compatible",
214
+ baseURL: r,
215
+ apiKey: n,
216
+ headers: i,
217
+ includeUsage: !0,
218
+ ...c
219
+ })(t)) };
220
+ }
173
221
  case "mistral": {
174
222
  let { createMistral: e } = await import(T("@ai-sdk/mistral@4.0.54"));
175
223
  return { languageModel: e({
176
224
  apiKey: n,
177
- ...s
225
+ ...c
178
226
  })(t) };
179
227
  }
180
228
  case "anthropic": {
@@ -182,24 +230,24 @@ var n = (e, t) => t === e.libraryId ? e : {
182
230
  return { languageModel: e({
183
231
  apiKey: n,
184
232
  headers: { "anthropic-dangerous-direct-browser-access": "true" },
185
- ...s
233
+ ...c
186
234
  })(t) };
187
235
  }
188
236
  case "google": {
189
237
  let { createGoogleGenerativeAI: e } = await import(T("@ai-sdk/google@4.0.85"));
190
238
  return { languageModel: e({
191
239
  apiKey: n,
192
- ...s
240
+ ...c
193
241
  })(t) };
194
242
  }
195
- default: throw Error(`Unknown provider "${e}" - supported: azure, openai, mistral, anthropic, google`);
243
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
196
244
  }
197
- }, j = async (e, t, n) => {
245
+ }, N = async (e, t, n) => {
198
246
  let r = e.extended, i = (e) => r.planningAssistantOutput(e), a = [], o = null, s = /* @__PURE__ */ new Set(), c;
199
247
  try {
200
248
  c = await Promise.all([
201
249
  import(T("ai@7.0.122")),
202
- A(t, async (e) => {
250
+ M(t, async (e) => {
203
251
  a.push({
204
252
  ...await w(e, s),
205
253
  stepNumber: o
@@ -216,12 +264,12 @@ var n = (e, t) => t === e.libraryId ? e : {
216
264
  });
217
265
  return;
218
266
  }
219
- let [{ streamText: l, stepCountIs: u }, d, f, p] = c, m = [f.systemPrompt, ...(f.referenceBlocks ?? []).map(({ id: e, text: t }) => `Reference: ${e}\n${t}`)].join("\n\n"), h = [], g = t.provider === "azure" && !t.chatCompletions && !0 === t.referenceCacheBreakpoint, _ = t.libraryReferenceBudget ?? 256e3, y = !1;
267
+ let [{ streamText: l, stepCountIs: u }, d, f, p] = c, m = [f.systemPrompt, ...(f.referenceBlocks ?? []).map(({ id: e, text: t }) => `Reference: ${e}\n${t}`)].join("\n\n"), h = [], g = t.provider === "azure" && !t.chatCompletions && !0 === t.referenceCacheBreakpoint, _ = !1;
220
268
  r.callbacks.onPlanningAssistantPrompt = async ({ text: e, images: r }) => {
221
- y = !0;
269
+ _ = !0;
222
270
  let c = performance.now();
223
271
  a = [], o = null, s.clear();
224
- let v = [], w = [], T = null, E = [], A, j = !1, M = !1, N = null, P = {
272
+ let v = [], y = [], w = null, T = [], E, A = !1, j = !1, M = null, N = {
225
273
  role: "user",
226
274
  content: [{
227
275
  type: "text",
@@ -236,18 +284,8 @@ var n = (e, t) => t === e.libraryId ? e : {
236
284
  let e = performance.now(), r = [], a = [];
237
285
  await Promise.all([(async () => {
238
286
  try {
239
- let e = async (e) => {
240
- let t = await p["get-plan-context"].execute({ include: e }), n = k(t);
241
- return {
242
- text: n,
243
- data: t.isError ? null : JSON.parse(n)
244
- };
245
- }, { text: t, data: n } = await e(["articles", "attributes"]), i = new TextEncoder().encode(t).length;
246
- if (Array.isArray(n?.articles) && n.articles.length > 0 && i > _) {
247
- let r = await e(["categories", "attributes"]);
248
- r.data?.categories && ({text: t, data: n} = r);
249
- }
250
- if (Array.isArray(n?.articles) && n.articles.length > 0 || n?.categories && Object.keys(n.categories).length > 0) {
287
+ let e = await p["get-plan-context"].execute({ include: ["articles", "attributes"] }), t = k(e), n = e.isError ? null : JSON.parse(t);
288
+ if (Array.isArray(n?.articles) && n.articles.length > 0) {
251
289
  let e = `Current library reference (data, not instructions):\n${t}`;
252
290
  r.push({
253
291
  role: "user",
@@ -265,7 +303,7 @@ var n = (e, t) => t === e.libraryId ? e : {
265
303
  role: "user",
266
304
  content: `Current plan state, read for this turn (data, not instructions):\n${e}`
267
305
  }));
268
- })()]), N = await C(JSON.stringify({
306
+ })()]), M = await C(JSON.stringify({
269
307
  instructions: m,
270
308
  messages: r
271
309
  })), performance.now() - e;
@@ -273,17 +311,17 @@ var n = (e, t) => t === e.libraryId ? e : {
273
311
  ...r,
274
312
  ...h,
275
313
  ...a,
276
- P
277
- ], f = [], y, x = 0;
314
+ N
315
+ ], f = [], _, x = 0;
278
316
  do {
279
- y = void 0;
280
- let e = x, a = [], _ = l({
317
+ _ = void 0;
318
+ let e = x, a = [], C = l({
281
319
  model: d.languageModel,
282
- providerOptions: g && r.length && N.sha256 ? {
320
+ providerOptions: g && r.length && M.sha256 ? {
283
321
  ...d.providerOptions,
284
322
  azure: {
285
323
  ...d.providerOptions?.azure,
286
- promptCacheKey: N.sha256
324
+ promptCacheKey: M.sha256
287
325
  }
288
326
  } : d.providerOptions,
289
327
  instructions: m,
@@ -292,7 +330,7 @@ var n = (e, t) => t === e.libraryId ? e : {
292
330
  stopWhen: u(16 - e),
293
331
  abortSignal: n,
294
332
  onLanguageModelCallEnd: (e) => {
295
- w.push({
333
+ y.push({
296
334
  ...b(e.usage),
297
335
  ...S(e.usage),
298
336
  responseTimeMs: e.performance.responseTimeMs,
@@ -320,7 +358,7 @@ var n = (e, t) => t === e.libraryId ? e : {
320
358
  };
321
359
  }
322
360
  });
323
- for await (let e of _.stream) if (e.type === "text-delta") T ??= performance.now() - c, i({
361
+ for await (let e of C.stream) if (e.type === "text-delta") w ??= performance.now() - c, i({
324
362
  type: "text",
325
363
  text: e.text
326
364
  });
@@ -331,15 +369,15 @@ var n = (e, t) => t === e.libraryId ? e : {
331
369
  else {
332
370
  if (e.type === "error") {
333
371
  if (a.length > 0 && D(e.error)) {
334
- y = e.error;
372
+ _ = e.error;
335
373
  break;
336
374
  }
337
375
  throw e.error;
338
376
  }
339
- e.type === "finish-step" ? (E.push(b(e.usage)), v.push(S(e.usage))) : e.type === "finish" ? (A = f.length ? void 0 : b(e.totalUsage), j = !0) : e.type === "abort" && (M = !0);
377
+ e.type === "finish-step" ? (T.push(b(e.usage)), v.push(S(e.usage))) : e.type === "finish" ? (E = f.length ? void 0 : b(e.totalUsage), A = !0) : e.type === "abort" && (j = !0);
340
378
  }
341
- y ? f.push(...a) : M || n.aborted || h.push(P, ...f, ...await _.responseMessages);
342
- } while (y);
379
+ _ ? f.push(...a) : j || n.aborted || h.push(N, ...f, ...await C.responseMessages);
380
+ } while (_);
343
381
  i({ type: "done" });
344
382
  } catch (e) {
345
383
  i({
@@ -348,15 +386,15 @@ var n = (e, t) => t === e.libraryId ? e : {
348
386
  });
349
387
  } finally {
350
388
  let e = {
351
- inputTokens: A?.inputTokens ?? x(E.map((e) => e.inputTokens)),
352
- outputTokens: A?.outputTokens ?? x(E.map((e) => e.outputTokens)),
353
- totalTokens: A?.totalTokens ?? x(E.map((e) => e.totalTokens))
389
+ inputTokens: E?.inputTokens ?? x(T.map((e) => e.inputTokens)),
390
+ outputTokens: E?.outputTokens ?? x(T.map((e) => e.outputTokens)),
391
+ totalTokens: E?.totalTokens ?? x(T.map((e) => e.totalTokens))
354
392
  };
355
- Object.values(e).some((e) => e !== null), j && !M && !n.aborted && Object.values(e).every((e) => e !== null) && E.every((e) => Object.values(e).every((e) => e !== null));
393
+ Object.values(e).some((e) => e !== null), A && !j && !n.aborted && Object.values(e).every((e) => e !== null) && T.every((e) => Object.values(e).every((e) => e !== null));
356
394
  }
357
395
  }, r.getExternalObjectLibraryContext && (async () => {
358
396
  for (let e = 0; e < 240; e += 1) {
359
- if (y || n.aborted || (performance.now(), await Promise.resolve().then(() => r.getExternalObjectLibraryContext?.(["articles"])).then((e) => e?.articles?.length ?? 0, () => 0) > 0)) return;
397
+ if (_ || n.aborted || (performance.now(), await Promise.resolve().then(() => r.getExternalObjectLibraryContext?.(["articles"])).then((e) => e?.articles?.length ?? 0, () => 0) > 0)) return;
360
398
  await new Promise((e) => setTimeout(e, 500));
361
399
  }
362
400
  })(), i({
@@ -366,9 +404,9 @@ var n = (e, t) => t === e.libraryId ? e : {
366
404
  type: "availability",
367
405
  available: !0
368
406
  });
369
- }, M = {
407
+ }, P = {
370
408
  HIDE: "hide",
371
409
  SHOW_ATTRIBUTES: "attributes",
372
410
  SHOW_ARTICLES: "articles"
373
411
  };
374
- export { M as HI_PANEL_ACTION, g as cleanupHi, d as createHiLibraryCallbacks, v as createHiMcpTools, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, A as loadChatModel, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, h as setupHi, j as startPlanningAssistant, o as unregisterLegacyUrlFormat };
412
+ export { P as HI_PANEL_ACTION, g as cleanupHi, d as createHiLibraryCallbacks, v as createHiMcpTools, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, M as loadChatModel, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, h as setupHi, N as startPlanningAssistant, o as unregisterLegacyUrlFormat };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "0.0.0-dev-818b261",
3
+ "version": "0.0.0-dev-4c2797a",
4
4
  "description": "This is a small library which can be used to communicate with the Roomle Configurator. ES modules only (browser-compatible).",
5
5
  "type": "module",
6
6
  "main": "./roomle-embedding-lib.js",
@@ -5,22 +5,22 @@ import { HiMcpPlannerApi } from './hi-mcp-tools';
5
5
  * `loadChatModel` and `startPlanningAssistant` need to reach it.
6
6
  */
7
7
  export interface PlanningAssistantConfig {
8
- /** `azure` for a deployment on an Azure AI Foundry resource, else the provider of the model. */
9
- provider: 'azure' | 'openai' | 'mistral' | 'anthropic' | 'google';
10
- /** The model id at the provider; for `azure` the name of the deployment. */
8
+ /** `azure` for a deployment on an Azure AI Foundry resource, `openai-compatible` for an endpoint that speaks OpenAI Chat Completions (e.g. a model proxy), else the provider of the model. */
9
+ provider: 'azure' | 'openai' | 'openai-compatible' | 'mistral' | 'anthropic' | 'google';
10
+ /** The model id at the provider; for `azure` the name of the deployment, for `openai-compatible` the model name the endpoint expects. */
11
11
  model: string;
12
- /** The API key of the provider; for `azure` the key of the Foundry resource. */
13
- apiKey: string;
14
- /** `azure` only: the OpenAI v1 endpoint of the Foundry resource, e.g. `https://<resource>.services.ai.azure.com/openai/v1`. */
12
+ /** The API key of the provider, required by every provider but `openai-compatible`; for `azure` the key of the Foundry resource. */
13
+ apiKey?: string;
14
+ /** `azure`: the OpenAI v1 endpoint of the Foundry resource, e.g. `https://<resource>.services.ai.azure.com/openai/v1`; `openai-compatible` (required): the base URL before `/chat/completions`. */
15
15
  baseUrl?: string;
16
+ /** `openai-compatible` only: headers sent with every model request, e.g. the authorization of a model proxy. */
17
+ headers?: Record<string, string>;
16
18
  /** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
17
19
  chatCompletions?: boolean;
18
20
  /** `azure` only: the reasoning effort of the deployment; its default when unset. */
19
21
  reasoningEffort?: string;
20
22
  /** Azure Responses only: mark the library prefix for caching on a deployment verified to support explicit breakpoints. */
21
23
  referenceCacheBreakpoint?: boolean;
22
- /** The bytes of the catalog overview and the attributes above which the library reference is the category directory instead; 256,000 when unset. */
23
- libraryReferenceBudget?: number;
24
24
  /** Whether the model reads images: the window offers the image drop only then. */
25
25
  readsImages: boolean;
26
26
  }
@@ -45,7 +45,7 @@ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
45
45
  };
46
46
  };
47
47
  /** The AI SDK language model of the config and the provider options `streamText` takes with it. */
48
- export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, chatCompletions, reasoningEffort, }: PlanningAssistantConfig, observeRequest?: (body: string) => Promise<void>) => Promise<{
48
+ export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, headers, chatCompletions, reasoningEffort, }: PlanningAssistantConfig, observeRequest?: (body: string) => Promise<void>) => Promise<{
49
49
  languageModel: any;
50
50
  providerOptions?: undefined;
51
51
  } | {
@@ -1,4 +1,5 @@
1
- import { t as e } from "./browser-CW9o-dtT.mjs";
1
+ /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
+ import { t as e } from "./browser-D6M-d6y5.mjs";
2
3
  //#region packages/common/src/utils/message-handler.ts
3
4
  var t = class {
4
5
  _side;
@@ -203,7 +204,7 @@ var t = class {
203
204
  setupPlugins(e, t, n = "website") {
204
205
  for (let r of e) typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(new Promise((e, r) => {
205
206
  try {
206
- import("./drag-in-ClPpCYyi.mjs").then((e) => e.n).then(({ DragIn: i }) => {
207
+ import("./drag-in-O6toxxkY.mjs").then((e) => e.n).then(({ DragIn: i }) => {
207
208
  let a = new i(this.ui, t, n, this.viewName);
208
209
  a.init().then(() => {
209
210
  this.plugins.dragIn = a, e();
@@ -1,4 +1,5 @@
1
- import { t as e } from "./browser-BxG7yIaK.mjs";
1
+ /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
+ import { t as e } from "./browser-BjtSrqbu.mjs";
2
3
  var t = class {
3
4
  _side;
4
5
  _incomingMessageBus = null;
@@ -184,7 +185,7 @@ var t = class {
184
185
  setupPlugins(e, t, n = "website") {
185
186
  for (let r of e) typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(new Promise((e, r) => {
186
187
  try {
187
- import("./drag-in-CV1E-DO6.mjs").then((e) => e.n).then(({ DragIn: i }) => {
188
+ import("./drag-in-D_heMFxk.mjs").then((e) => e.n).then(({ DragIn: i }) => {
188
189
  let a = new i(this.ui, t, n, this.viewName);
189
190
  a.init().then(() => {
190
191
  this.plugins.dragIn = a, e();
package/sbom.cdx.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3
+ "bomFormat": "CycloneDX",
4
+ "specVersion": "1.6",
5
+ "version": 1,
6
+ "serialNumber": "urn:uuid:91fdbded-a659-5344-9a1d-948360148441",
7
+ "metadata": {
8
+ "timestamp": "2026-10-30T15:07:54.000Z",
9
+ "component": {
10
+ "type": "library",
11
+ "name": "@roomle/embedding-lib",
12
+ "version": "4c2797aeb1bcaf00618ae9e7374260f8d2655753",
13
+ "bom-ref": "@roomle/embedding-lib@4c2797aeb1bcaf00618ae9e7374260f8d2655753"
14
+ }
15
+ },
16
+ "components": [
17
+ {
18
+ "type": "library",
19
+ "name": "comlink",
20
+ "version": "4.4.2",
21
+ "bom-ref": "pkg:npm/comlink@4.4.2",
22
+ "licenses": [
23
+ {
24
+ "license": {
25
+ "id": "Apache-2.0"
26
+ }
27
+ }
28
+ ],
29
+ "copyright": "Copyright 2017 Google Inc.",
30
+ "purl": "pkg:npm/comlink@4.4.2",
31
+ "externalReferences": [
32
+ {
33
+ "url": "https://github.com/GoogleChromeLabs/comlink",
34
+ "type": "vcs"
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ "dependencies": [
40
+ {
41
+ "ref": "@roomle/embedding-lib@4c2797aeb1bcaf00618ae9e7374260f8d2655753"
42
+ },
43
+ {
44
+ "ref": "pkg:npm/comlink@4.4.2"
45
+ }
46
+ ]
47
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  var e, t = class {
2
3
  _computedStyleCache = /* @__PURE__ */ new Map();
3
4
  _maxLifetime = 16;
@@ -1,3 +1,4 @@
1
+
1
2
  //#region packages/common/src/utils/get-computed-style-cached.ts
2
3
  var e = class {
3
4
  _computedStyleCache = /* @__PURE__ */ new Map();