@roomle/embedding-lib 11.0.0-alpha.12 → 11.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.txt +2 -2
- package/ai-model-host-CaiYrZkh.mjs +152 -0
- package/ai-model-host-HAJONHCj.mjs +156 -0
- package/ai.js +1 -128
- package/ai.min.js +1 -127
- package/chat-model-DooKwd8I.mjs +117 -0
- package/chat-model-KHuz1Ej9.mjs +118 -0
- package/configurator.js +2 -2
- package/configurator.min.js +2 -2
- package/construction.js +17718 -162
- package/construction.min.js +17397 -177
- package/docs/md/web/embedding/CHANGELOG.md +93 -4
- package/hi.js +91 -393
- package/hi.min.js +88 -351
- package/{mcp-tools-BLB7pCga.mjs → mcp-tools-C6O2gQZW.mjs} +0 -1
- package/{mcp-tools-BirFT2R0.mjs → mcp-tools-m_3IX0vB.mjs} +0 -1
- package/package.json +1 -1
- package/packages/common/src/utils/ai-model-relay.d.ts +1 -1
- package/packages/embedding-lib/src/ai-model-host.d.ts +36 -0
- package/packages/embedding-lib/src/ai.d.ts +11 -27
- package/packages/embedding-lib/src/hi.d.ts +1 -0
- package/packages/embedding-lib/src/homag-intelligence/decisions.d.ts +7 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-model-proxy.d.ts +4 -1
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +9 -19
- package/packages/web-sdk/packages/assistant.d.ts +2 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-recovery.d.ts +5 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -3
- package/packages/web-sdk/packages/common-core/src/planning-assistant/usage.d.ts +31 -0
- package/roomle-embedding-lib.js +37 -37
- package/roomle-embedding-lib.min.js +30 -30
- package/sbom.cdx.json +5 -5
- package/usage-C3HE9yXi.mjs +33 -0
- package/usage-CYqDPQOx.mjs +34 -0
- package/chat-model-B7BO8IhK.mjs +0 -212
- package/chat-model-XYf503pT.mjs +0 -213
- package/continuation-CswXtOus.mjs +0 -10
- package/continuation-NclHDSgS.mjs +0 -9
- package/dist-BZSd56sr.mjs +0 -17422
- package/dist-S9sLSjZ4.mjs +0 -17087
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +0 -54
- package/turn-limits-9LbUeSG2.mjs +0 -9
- package/turn-limits-Ciq383Bd.mjs +0 -10
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
|
|
2
|
-
import { HiMcpPlannerApi } from './hi-mcp-tools';
|
|
3
2
|
import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
|
|
3
|
+
import { default as RoomleEmbeddingApi } from '../roomle-embedding-lib';
|
|
4
|
+
import { HiMcpPlannerApi } from './hi-mcp-tools';
|
|
4
5
|
export { loadChatModel, type PlanningAssistantConfig, } from '../planning-assistant/chat-model';
|
|
5
6
|
/** The planner the planning assistant runs in: the HI MCP tools' planner API, the agent prompts and the window. */
|
|
6
7
|
export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
|
|
7
8
|
extended: {
|
|
9
|
+
startExternalObjectPlanningAssistant?(config: PlanningAssistantConfig, owner: string): Promise<void>;
|
|
10
|
+
suspendPlanningAssistant?(): Promise<void>;
|
|
11
|
+
resumePlanningAssistant?(): Promise<void>;
|
|
8
12
|
stopPlanningAssistant?(owner: string): Promise<void>;
|
|
9
13
|
setPlanningAssistantModel?(model: {
|
|
10
14
|
model: string;
|
|
@@ -44,27 +48,13 @@ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
|
|
|
44
48
|
onPlanningAssistantPrompt?: (prompt: PlanningAssistantPrompt) => unknown;
|
|
45
49
|
};
|
|
46
50
|
};
|
|
47
|
-
}
|
|
48
|
-
/** Confident photo observations supplied with the image-planning skill on creation turns. */
|
|
49
|
-
export interface PhotoFacts {
|
|
50
|
-
present: string[];
|
|
51
|
-
absent: string[];
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Appends high-confidence visual photo observations to the image-planning skill
|
|
55
|
-
* text so the planning model sees them inside the synthetic get-skill result.
|
|
56
|
-
*/
|
|
57
|
-
export declare const withPhotoFacts: (skillText: string, facts?: PhotoFacts) => string;
|
|
58
|
-
/**
|
|
59
|
-
* Runs the planning agent of the AI Planning Assistant window
|
|
60
|
-
* (featureFlags.planningAssistant) in this page: the window hands every
|
|
61
|
-
* message to "onPlanningAssistantPrompt", the agent calls the HI MCP tools,
|
|
62
|
-
* the tools run in the planner of this page, and the agent's output goes to
|
|
63
|
-
* "planningAssistantOutput". Aborting the signal ends a running turn.
|
|
64
|
-
*/
|
|
51
|
+
} & Partial<Pick<RoomleEmbeddingApi<unknown, unknown>, 'startRelay' | 'ui'>>;
|
|
65
52
|
export interface PlanningAssistantControl {
|
|
66
53
|
suspend(): Promise<void>;
|
|
67
54
|
resume(): Promise<void>;
|
|
68
55
|
dispose(): Promise<void>;
|
|
69
56
|
}
|
|
57
|
+
/** The host's model as the planner takes it, without key, base URL or headers. */
|
|
58
|
+
export declare const plannerConfigOf: (config: PlanningAssistantConfig) => PlanningAssistantConfig;
|
|
59
|
+
/** Starts the HI Planning Assistant of the planner on the model of this page; aborting the signal stops it. */
|
|
70
60
|
export declare const startPlanningAssistant: (roomDesignerApi: PlanningAssistantPlannerApi, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<PlanningAssistantControl | undefined>;
|
|
@@ -4,4 +4,5 @@ export { createAgentMcpTools, mcpToModelOutput, type AgentMcpModelOutput, type A
|
|
|
4
4
|
export { createAssistant } from './common-core/src/planning-assistant/runtime';
|
|
5
5
|
export { MAX_TURN_STEPS, TURN_TIMEOUT_MS, lastTurnStep, } from './common-core/src/planning-assistant/turn-limits';
|
|
6
6
|
export { createChatRecovery } from './common-core/src/planning-assistant/chat-recovery';
|
|
7
|
-
export { responsesProviderOf } from './common-core/src/planning-assistant/continuation';
|
|
7
|
+
export { responsesProviderOf, isRejectedContinuation, withoutStoredItems, } from './common-core/src/planning-assistant/continuation';
|
|
8
|
+
export { tokenCount, tokenCounts, sumCounts, describeRequestBody, } from './common-core/src/planning-assistant/usage';
|
|
@@ -3,9 +3,13 @@ import { AgentMcpTools } from './mcp-tools';
|
|
|
3
3
|
* Records tool execution independently of whether the model finishes its
|
|
4
4
|
* step, so an interrupted reply can say what the tools changed.
|
|
5
5
|
*/
|
|
6
|
-
export declare const createChatRecovery: (tools: AgentMcpTools, domain
|
|
6
|
+
export declare const createChatRecovery: (tools: AgentMcpTools, domain: {
|
|
7
|
+
/** What the tools change, as the summary names it: "configuration", "plan". */
|
|
7
8
|
subject: string;
|
|
9
|
+
/** The tools that never change the subject: a failed or pending call of one changed nothing. */
|
|
8
10
|
readTools: ReadonlySet<string>;
|
|
11
|
+
/** The names the summary gives the tools; a tool without one goes by its tool name. */
|
|
12
|
+
labels?: Record<string, string>;
|
|
9
13
|
}) => {
|
|
10
14
|
tools: AgentMcpTools;
|
|
11
15
|
summary: () => string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ModelMessage } from 'ai';
|
|
2
1
|
import { PlanningAssistantConfig } from './types';
|
|
3
2
|
export declare const responsesProviderOf: (config: PlanningAssistantConfig) => "openai" | "azure" | null;
|
|
4
|
-
export declare const isRejectedContinuation: (error: unknown) =>
|
|
5
|
-
export declare const withoutStoredItems:
|
|
3
|
+
export declare const isRejectedContinuation: (error: unknown) => error is Error;
|
|
4
|
+
export declare const withoutStoredItems: <Message extends {
|
|
5
|
+
role: string;
|
|
6
|
+
content: unknown;
|
|
7
|
+
}>(message: Message) => Message;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** A token count as a provider reports it; null for a missing value and for anything that is no count. */
|
|
2
|
+
export declare const tokenCount: (value: unknown) => number | null;
|
|
3
|
+
/** The token counts of one model call: the reported total, else the sum of a known input and output. */
|
|
4
|
+
export declare const tokenCounts: (usage?: {
|
|
5
|
+
inputTokens?: number;
|
|
6
|
+
outputTokens?: number;
|
|
7
|
+
totalTokens?: number;
|
|
8
|
+
}) => {
|
|
9
|
+
inputTokens: number;
|
|
10
|
+
outputTokens: number;
|
|
11
|
+
totalTokens: number;
|
|
12
|
+
};
|
|
13
|
+
/** The sum of the known counts; null when no count is known. */
|
|
14
|
+
export declare const sumCounts: (counts: Array<number | null>) => number;
|
|
15
|
+
/** The size of a text in UTF-8 bytes, as a request carries it. */
|
|
16
|
+
export declare const bytesOf: (value: string) => number;
|
|
17
|
+
/** The UTF-8 size of a text and its SHA-256; null where the browser has no digest. */
|
|
18
|
+
export declare const describePayload: (text: string) => Promise<{
|
|
19
|
+
bytes: number;
|
|
20
|
+
sha256: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** The size and digest of a request body, its tool definitions and each input item of a Responses request. */
|
|
23
|
+
export declare const describeRequestBody: (text: string) => Promise<{
|
|
24
|
+
bytes: number;
|
|
25
|
+
sha256: string;
|
|
26
|
+
} | {
|
|
27
|
+
toolsBytes: number;
|
|
28
|
+
input: any[];
|
|
29
|
+
bytes: number;
|
|
30
|
+
sha256: string;
|
|
31
|
+
}>;
|
package/roomle-embedding-lib.js
CHANGED
|
@@ -149,7 +149,7 @@ var t = class {
|
|
|
149
149
|
let t = l(d);
|
|
150
150
|
t.locale ||= e(null, !0), t.id === "(idle)" && delete t.id;
|
|
151
151
|
let n = i();
|
|
152
|
-
return n && a(n) && (t.configuratorId = "demoConfigurator"), t.
|
|
152
|
+
return n && a(n) && (t.configuratorId = "demoConfigurator"), t.defaultApiUrl = "https://rubens.alpha.roomle.com/api/v2", t.emails = !1, t;
|
|
153
153
|
}, g = "<CONF_ID>", _ = "#CONFIGURATIONID#", v = (e) => {
|
|
154
154
|
let t = e.featureFlags;
|
|
155
155
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
@@ -232,7 +232,7 @@ var t = class {
|
|
|
232
232
|
resolve: e,
|
|
233
233
|
reject: t
|
|
234
234
|
};
|
|
235
|
-
}, w =
|
|
235
|
+
}, w = {
|
|
236
236
|
SDK: "extended",
|
|
237
237
|
CONFIGURATOR_SDK: "configurator",
|
|
238
238
|
CALLBACKS: "callbacks",
|
|
@@ -240,22 +240,22 @@ var t = class {
|
|
|
240
240
|
ANALYTICS: "analytics",
|
|
241
241
|
GLOBAL: "global",
|
|
242
242
|
RAPI: "rapi"
|
|
243
|
-
},
|
|
243
|
+
}, T = ".", E = w.SDK + "." + w.CALLBACKS, D = {
|
|
244
244
|
REQUEST_BOOT: "requestBoot",
|
|
245
245
|
SETUP: "setup",
|
|
246
246
|
WEBSITE_READY: "websiteReady"
|
|
247
|
-
},
|
|
247
|
+
}, O = {
|
|
248
248
|
GET_METHODS: "getMethods",
|
|
249
249
|
RETURN_METHODS: "returnMethods",
|
|
250
250
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
251
251
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
252
|
-
},
|
|
252
|
+
}, k = ["constructor", "callbacks"], A = (e) => e[0] !== "_" && !k.includes(e), j = (e, t, n = !1) => {
|
|
253
253
|
if (!e) return [];
|
|
254
|
-
let r = Object.getOwnPropertyNames(e), i = n ?
|
|
255
|
-
return r.filter(
|
|
256
|
-
},
|
|
254
|
+
let r = Object.getOwnPropertyNames(e), i = n ? w.CALLBACKS + "." : "";
|
|
255
|
+
return r.filter(A).map((e) => t + "." + i + e);
|
|
256
|
+
}, M = async (e, t) => {
|
|
257
257
|
if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
|
|
258
|
-
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i =
|
|
258
|
+
let n = typeof t.customApiUrl == "string" ? t.customApiUrl : t.defaultApiUrl || "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = n + "/configurators/" + e, a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
|
|
259
259
|
method: "GET",
|
|
260
260
|
headers: new Headers({
|
|
261
261
|
apiKey: "roomle_portal_v2",
|
|
@@ -270,7 +270,7 @@ var t = class {
|
|
|
270
270
|
cache: "default"
|
|
271
271
|
}), { configurator: s } = await (await fetch(o)).json();
|
|
272
272
|
return s;
|
|
273
|
-
},
|
|
273
|
+
}, N = "data-rml-interaction-container", P = (e, t, n) => {
|
|
274
274
|
let r = null;
|
|
275
275
|
Object.defineProperty(e, t, {
|
|
276
276
|
get() {
|
|
@@ -280,16 +280,16 @@ var t = class {
|
|
|
280
280
|
e?.mute ? r = e.value : (console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"), console.warn("{ mute: true, value: () => void }"), r = e);
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
|
-
},
|
|
284
|
-
e && setTimeout(() => e.style.setProperty(
|
|
285
|
-
},
|
|
283
|
+
}, F = () => window.innerHeight * .01 + "px", I = (e) => {
|
|
284
|
+
e && setTimeout(() => e.style.setProperty(R, F()), 0);
|
|
285
|
+
}, L = "rml-styles", R = "--rml-full-height", z = {
|
|
286
286
|
CONTAINER: "rml-container",
|
|
287
287
|
FILL: "rml-fill",
|
|
288
288
|
POSITION: "rml-pos",
|
|
289
289
|
TRANSITION: "rml-transition",
|
|
290
290
|
ANDROID_HEIGHT: "rml-android-height",
|
|
291
291
|
OVERFLOW_HIDDEN: "rml-overflow-hidden"
|
|
292
|
-
},
|
|
292
|
+
}, B = /* @__PURE__ */ new Map(), V = class extends S {
|
|
293
293
|
static createPlanner(e, t, n, r = []) {
|
|
294
294
|
return this._create(e, t, n, r);
|
|
295
295
|
}
|
|
@@ -298,10 +298,10 @@ var t = class {
|
|
|
298
298
|
r.viewName = e;
|
|
299
299
|
let { resolve: i, promise: a } = C(), { resolve: o, promise: s } = C(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
|
|
300
300
|
switch (e) {
|
|
301
|
-
case
|
|
301
|
+
case O.REGISTER_CUSTOM_VIEW_DONE:
|
|
302
302
|
i();
|
|
303
303
|
break;
|
|
304
|
-
case
|
|
304
|
+
case O.RETURN_METHODS:
|
|
305
305
|
r.handleSetup(t[0]), o();
|
|
306
306
|
break;
|
|
307
307
|
default: if (r.isSetupDone) return r.executeMessage({
|
|
@@ -312,7 +312,7 @@ var t = class {
|
|
|
312
312
|
});
|
|
313
313
|
r.setMessageHandler(c);
|
|
314
314
|
let l = [e];
|
|
315
|
-
return c.sendMessage(
|
|
315
|
+
return c.sendMessage(O.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(O.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
|
|
316
316
|
}
|
|
317
317
|
static createConfigurator(e, t, n, r = []) {
|
|
318
318
|
return this._create(e, t, n, r);
|
|
@@ -328,7 +328,7 @@ var t = class {
|
|
|
328
328
|
try {
|
|
329
329
|
let a = f(n), s = h();
|
|
330
330
|
y(s);
|
|
331
|
-
let c = await
|
|
331
|
+
let c = await M(e, o(s, a));
|
|
332
332
|
n = b(c, a);
|
|
333
333
|
let l = new this(c, t, n, r, i);
|
|
334
334
|
return await Promise.allSettled(l.pluginsLoaded), l;
|
|
@@ -345,25 +345,25 @@ var t = class {
|
|
|
345
345
|
_relays = /* @__PURE__ */ new Map();
|
|
346
346
|
constructor(e, n, r, i, a) {
|
|
347
347
|
if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
|
|
348
|
-
if (
|
|
349
|
-
if (!document.getElementById(
|
|
348
|
+
if (B.has(n)) throw Error("There is already an instance on this DOM element");
|
|
349
|
+
if (!document.getElementById(L)) {
|
|
350
350
|
let e = r.zIndex || 9999999, t = document.createElement("style");
|
|
351
|
-
t.type = "text/css", t.id =
|
|
352
|
-
let n = "transition:all ease-in-out 450ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e += t + n, "") + n, a =
|
|
351
|
+
t.type = "text/css", t.id = L;
|
|
352
|
+
let n = "transition:all ease-in-out 450ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e += t + n, "") + n, a = F();
|
|
353
353
|
t.innerHTML = `
|
|
354
|
-
.${
|
|
355
|
-
.${
|
|
356
|
-
.${
|
|
357
|
-
.${
|
|
358
|
-
.${
|
|
359
|
-
.${
|
|
354
|
+
.${z.CONTAINER}{${R}:${a};}
|
|
355
|
+
.${z.POSITION}{position:fixed;top:0;left:0;z-index:${e};opacity:0}
|
|
356
|
+
.${z.TRANSITION}{${i}}
|
|
357
|
+
.${z.FILL}{width:100%;height:100%;opacity:1}
|
|
358
|
+
.${z.ANDROID_HEIGHT}{height:calc(var(${R},1vh)*100)}
|
|
359
|
+
.${z.OVERFLOW_HIDDEN}{overflow:hidden}
|
|
360
360
|
`, document.head.appendChild(t);
|
|
361
361
|
}
|
|
362
362
|
this._executeMessage = this._executeMessage.bind(this);
|
|
363
363
|
let o = new t("website", window, null, this._executeMessage);
|
|
364
364
|
this.setMessageHandler(o), this._onResize = this._onResize.bind(this), x() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
|
|
365
365
|
let s = this._createIframe();
|
|
366
|
-
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe),
|
|
366
|
+
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe), B.set(n, !0);
|
|
367
367
|
}
|
|
368
368
|
startRelay(e, t) {
|
|
369
369
|
this._relays.get(e)?.();
|
|
@@ -378,30 +378,30 @@ var t = class {
|
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
teardown() {
|
|
381
|
-
this._relays.forEach((e) => e()), this._relays.clear(), this._container &&
|
|
381
|
+
this._relays.forEach((e) => e()), this._relays.clear(), this._container && B.delete(this._container);
|
|
382
382
|
let e = this._container.querySelector("iframe");
|
|
383
383
|
e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
|
|
384
384
|
}
|
|
385
385
|
_createIframe() {
|
|
386
386
|
let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
387
|
-
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(
|
|
387
|
+
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(z.CONTAINER), e.classList.add(z.FILL), e;
|
|
388
388
|
}
|
|
389
389
|
_onResize() {
|
|
390
|
-
|
|
390
|
+
I(this._iframe);
|
|
391
391
|
}
|
|
392
392
|
_onUseFullPage() {
|
|
393
|
-
this._iframe.classList.add(
|
|
393
|
+
this._iframe.classList.add(z.POSITION), document.documentElement.classList.add(z.OVERFLOW_HIDDEN), window.document.body.classList.add(z.OVERFLOW_HIDDEN), x() && (I(this._iframe), this._iframe.classList.add(z.ANDROID_HEIGHT));
|
|
394
394
|
}
|
|
395
395
|
_onBackToWebsite() {
|
|
396
|
-
this._iframe.classList.remove(
|
|
396
|
+
this._iframe.classList.remove(z.POSITION), this._iframe.classList.remove(z.ANDROID_HEIGHT), document.documentElement.classList.remove(z.OVERFLOW_HIDDEN), window.document.body.classList.remove(z.OVERFLOW_HIDDEN);
|
|
397
397
|
}
|
|
398
398
|
_executeMessage({ message: e, args: t }, n) {
|
|
399
|
-
if (n.source && n.source === this._iframe?.contentWindow) return e ===
|
|
400
|
-
this._messageHandler ? this._messageHandler.sendMessage(
|
|
399
|
+
if (n.source && n.source === this._iframe?.contentWindow) return e === D.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(n.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : e === D.SETUP ? (this.handleSetup(t[0]), P(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), P(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
|
|
400
|
+
this._messageHandler ? this._messageHandler.sendMessage(D.WEBSITE_READY) : console.error("MessageHandler not set");
|
|
401
401
|
}, 0), Promise.resolve({ result: null })) : this.executeMessage({
|
|
402
402
|
message: e,
|
|
403
403
|
args: t
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
export {
|
|
407
|
+
export { D as HANDSHAKE_MESSAGES, N as INTERACTION_CONTAINER_SELECTOR, w as NAMESPACE, T as NAMESPACE_SEPARATOR, E as SDK_CALLBACK, O as WELL_KNOWN_MESSAGES, V as default, M as getConfiguratorSettings, j as getMethodNames, A as isExposable };
|
|
@@ -144,7 +144,7 @@ var t = class {
|
|
|
144
144
|
return r && ((e) => {
|
|
145
145
|
let t = /* @__PURE__ */ new RegExp(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/);
|
|
146
146
|
return !!(n.includes(e) || t.test(e) || e.endsWith("roomle.com") || e.endsWith("gitlab.io") || e.endsWith("gitlab.com"));
|
|
147
|
-
})(r) && (t.configuratorId = "demoConfigurator"), t.
|
|
147
|
+
})(r) && (t.configuratorId = "demoConfigurator"), t.defaultApiUrl = "https://rubens.alpha.roomle.com/api/v2", t.emails = !1, t;
|
|
148
148
|
}, d = (e) => {
|
|
149
149
|
e.featureFlags ||= {}, typeof e.featureFlags.realPartList != "boolean" && (e.featureFlags.realPartList = !0), typeof e.featureFlags.globalCallbacks != "boolean" && (e.featureFlags.globalCallbacks = !0), typeof e.featureFlags.mocAr != "boolean" && (e.featureFlags.mocAr = !1);
|
|
150
150
|
}, f = () => /(android)/i.test(navigator.userAgent), p = class {
|
|
@@ -216,7 +216,7 @@ var t = class {
|
|
|
216
216
|
resolve: e,
|
|
217
217
|
reject: t
|
|
218
218
|
};
|
|
219
|
-
}, h =
|
|
219
|
+
}, h = {
|
|
220
220
|
SDK: "extended",
|
|
221
221
|
CONFIGURATOR_SDK: "configurator",
|
|
222
222
|
CALLBACKS: "callbacks",
|
|
@@ -224,22 +224,22 @@ var t = class {
|
|
|
224
224
|
ANALYTICS: "analytics",
|
|
225
225
|
GLOBAL: "global",
|
|
226
226
|
RAPI: "rapi"
|
|
227
|
-
},
|
|
227
|
+
}, g = ".", _ = h.SDK + "." + h.CALLBACKS, v = {
|
|
228
228
|
REQUEST_BOOT: "requestBoot",
|
|
229
229
|
SETUP: "setup",
|
|
230
230
|
WEBSITE_READY: "websiteReady"
|
|
231
|
-
},
|
|
231
|
+
}, y = {
|
|
232
232
|
GET_METHODS: "getMethods",
|
|
233
233
|
RETURN_METHODS: "returnMethods",
|
|
234
234
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
235
235
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
236
|
-
},
|
|
236
|
+
}, b = ["constructor", "callbacks"], x = (e) => e[0] !== "_" && !b.includes(e), S = (e, t, n = !1) => {
|
|
237
237
|
if (!e) return [];
|
|
238
|
-
let r = Object.getOwnPropertyNames(e), i = n ?
|
|
239
|
-
return r.filter(
|
|
240
|
-
},
|
|
238
|
+
let r = Object.getOwnPropertyNames(e), i = n ? h.CALLBACKS + "." : "";
|
|
239
|
+
return r.filter(x).map((e) => t + "." + i + e);
|
|
240
|
+
}, C = async (e, t) => {
|
|
241
241
|
if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
|
|
242
|
-
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = n
|
|
242
|
+
let n = typeof t.customApiUrl == "string" ? t.customApiUrl : t.defaultApiUrl || "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = n + "/configurators/" + e, a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
|
|
243
243
|
method: "GET",
|
|
244
244
|
headers: new Headers({
|
|
245
245
|
apiKey: "roomle_portal_v2",
|
|
@@ -254,7 +254,7 @@ var t = class {
|
|
|
254
254
|
cache: "default"
|
|
255
255
|
}), { configurator: s } = await (await fetch(o)).json();
|
|
256
256
|
return s;
|
|
257
|
-
},
|
|
257
|
+
}, w = "data-rml-interaction-container", T = (e, t, n) => {
|
|
258
258
|
let r = null;
|
|
259
259
|
Object.defineProperty(e, t, {
|
|
260
260
|
get: () => r || n,
|
|
@@ -262,9 +262,9 @@ var t = class {
|
|
|
262
262
|
r = e?.mute ? e.value : e;
|
|
263
263
|
}
|
|
264
264
|
});
|
|
265
|
-
},
|
|
266
|
-
e && setTimeout(() => e.style.setProperty(
|
|
267
|
-
},
|
|
265
|
+
}, E = () => .01 * window.innerHeight + "px", D = (e) => {
|
|
266
|
+
e && setTimeout(() => e.style.setProperty(k, E()), 0);
|
|
267
|
+
}, O = "rml-styles", k = "--rml-full-height", A = "rml-container", j = "rml-fill", M = "rml-pos", N = "rml-android-height", P = "rml-overflow-hidden", F = /* @__PURE__ */ new Map(), I = class extends p {
|
|
268
268
|
static createPlanner(e, t, n, r = []) {
|
|
269
269
|
return this._create(e, t, n, r);
|
|
270
270
|
}
|
|
@@ -273,10 +273,10 @@ var t = class {
|
|
|
273
273
|
r.viewName = e;
|
|
274
274
|
let { resolve: i, promise: a } = m(), { resolve: o, promise: s } = m(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
|
|
275
275
|
switch (e) {
|
|
276
|
-
case
|
|
276
|
+
case y.REGISTER_CUSTOM_VIEW_DONE:
|
|
277
277
|
i();
|
|
278
278
|
break;
|
|
279
|
-
case
|
|
279
|
+
case y.RETURN_METHODS:
|
|
280
280
|
r.handleSetup(t[0]), o();
|
|
281
281
|
break;
|
|
282
282
|
default: if (r.isSetupDone) return r.executeMessage({
|
|
@@ -287,7 +287,7 @@ var t = class {
|
|
|
287
287
|
});
|
|
288
288
|
r.setMessageHandler(c);
|
|
289
289
|
let l = [e];
|
|
290
|
-
return c.sendMessage(
|
|
290
|
+
return c.sendMessage(y.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(y.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
|
|
291
291
|
}
|
|
292
292
|
static createConfigurator(e, t, n, r = []) {
|
|
293
293
|
return this._create(e, t, n, r);
|
|
@@ -303,7 +303,7 @@ var t = class {
|
|
|
303
303
|
try {
|
|
304
304
|
let s = ((e) => (l(e), e?.customApiUrl && (e.customApiUrl = decodeURIComponent(e.customApiUrl)), e.shareUrl && (e.deeplink = e.shareUrl.replace("<CONF_ID>", "#CONFIGURATIONID#")), e))(n), c = u();
|
|
305
305
|
d(c);
|
|
306
|
-
let f = await
|
|
306
|
+
let f = await C(e, r(c, s));
|
|
307
307
|
n = ((e, t) => {
|
|
308
308
|
let n = o(t), i = u();
|
|
309
309
|
d(i);
|
|
@@ -330,18 +330,18 @@ var t = class {
|
|
|
330
330
|
_relays = /* @__PURE__ */ new Map();
|
|
331
331
|
constructor(e, n, r, i, a) {
|
|
332
332
|
if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
|
|
333
|
-
if (
|
|
334
|
-
if (!document.getElementById(
|
|
333
|
+
if (F.has(n)) throw Error("There is already an instance on this DOM element");
|
|
334
|
+
if (!document.getElementById(O)) {
|
|
335
335
|
let e = r.zIndex || 9999999, t = document.createElement("style");
|
|
336
|
-
t.type = "text/css", t.id =
|
|
336
|
+
t.type = "text/css", t.id = O;
|
|
337
337
|
let n = "transition:all ease-in-out 450ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e + (t + n), "") + n;
|
|
338
|
-
t.innerHTML = `\n .${
|
|
338
|
+
t.innerHTML = `\n .${A}{${k}:${E()};}\n .${M}{position:fixed;top:0;left:0;z-index:${e};opacity:0}\n .rml-transition{${i}}\n .${j}{width:100%;height:100%;opacity:1}\n .${N}{height:calc(var(${k},1vh)*100)}\n .${P}{overflow:hidden}\n `, document.head.appendChild(t);
|
|
339
339
|
}
|
|
340
340
|
this._executeMessage = this._executeMessage.bind(this);
|
|
341
341
|
let o = new t("website", window, null, this._executeMessage);
|
|
342
342
|
this.setMessageHandler(o), this._onResize = this._onResize.bind(this), f() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
|
|
343
343
|
let s = this._createIframe();
|
|
344
|
-
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe),
|
|
344
|
+
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe), F.set(n, !0);
|
|
345
345
|
}
|
|
346
346
|
startRelay(e, t) {
|
|
347
347
|
this._relays.get(e)?.();
|
|
@@ -356,30 +356,30 @@ var t = class {
|
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
teardown() {
|
|
359
|
-
this._relays.forEach((e) => e()), this._relays.clear(), this._container &&
|
|
359
|
+
this._relays.forEach((e) => e()), this._relays.clear(), this._container && F.delete(this._container);
|
|
360
360
|
let e = this._container.querySelector("iframe");
|
|
361
361
|
e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
|
|
362
362
|
}
|
|
363
363
|
_createIframe() {
|
|
364
364
|
let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
365
|
-
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(
|
|
365
|
+
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(A), e.classList.add(j), e;
|
|
366
366
|
}
|
|
367
367
|
_onResize() {
|
|
368
|
-
|
|
368
|
+
D(this._iframe);
|
|
369
369
|
}
|
|
370
370
|
_onUseFullPage() {
|
|
371
|
-
this._iframe.classList.add(
|
|
371
|
+
this._iframe.classList.add(M), document.documentElement.classList.add(P), window.document.body.classList.add(P), f() && (D(this._iframe), this._iframe.classList.add(N));
|
|
372
372
|
}
|
|
373
373
|
_onBackToWebsite() {
|
|
374
|
-
this._iframe.classList.remove(
|
|
374
|
+
this._iframe.classList.remove(M), this._iframe.classList.remove(N), document.documentElement.classList.remove(P), window.document.body.classList.remove(P);
|
|
375
375
|
}
|
|
376
376
|
_executeMessage({ message: e, args: t }, n) {
|
|
377
|
-
if (n.source && n.source === this._iframe?.contentWindow) return e ===
|
|
378
|
-
this._messageHandler && this._messageHandler.sendMessage(
|
|
377
|
+
if (n.source && n.source === this._iframe?.contentWindow) return e === v.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(n.source), Promise.resolve({ result: this._initData })) : Promise.resolve({ error: "MessageHandler not set" }) : e === v.SETUP ? (this.handleSetup(t[0]), T(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), T(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
|
|
378
|
+
this._messageHandler && this._messageHandler.sendMessage(v.WEBSITE_READY);
|
|
379
379
|
}, 0), Promise.resolve({ result: null })) : this.executeMessage({
|
|
380
380
|
message: e,
|
|
381
381
|
args: t
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
};
|
|
385
|
-
export {
|
|
385
|
+
export { v as HANDSHAKE_MESSAGES, w as INTERACTION_CONTAINER_SELECTOR, h as NAMESPACE, g as NAMESPACE_SEPARATOR, _ as SDK_CALLBACK, y as WELL_KNOWN_MESSAGES, I as default, C as getConfiguratorSettings, S as getMethodNames, x as isExposable };
|
package/sbom.cdx.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.6",
|
|
5
5
|
"version": 1,
|
|
6
|
-
"serialNumber": "urn:uuid:
|
|
6
|
+
"serialNumber": "urn:uuid:ea842f2e-6075-58ac-b2ab-933bd16320a5",
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-25T09:20:42.000Z",
|
|
9
9
|
"component": {
|
|
10
10
|
"type": "library",
|
|
11
11
|
"name": "@roomle/embedding-lib",
|
|
12
|
-
"version": "
|
|
13
|
-
"bom-ref": "@roomle/embedding-lib@
|
|
12
|
+
"version": "93f20163218d63379df63e3c01e075d80ebb597a",
|
|
13
|
+
"bom-ref": "@roomle/embedding-lib@93f20163218d63379df63e3c01e075d80ebb597a"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"components": [
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
],
|
|
352
352
|
"dependencies": [
|
|
353
353
|
{
|
|
354
|
-
"ref": "@roomle/embedding-lib@
|
|
354
|
+
"ref": "@roomle/embedding-lib@93f20163218d63379df63e3c01e075d80ebb597a"
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"ref": "pkg:npm/%40ai-sdk/anthropic@4.0.68"
|
|
@@ -0,0 +1,33 @@
|
|
|
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) => {
|
|
3
|
+
if (e.role !== "assistant" || !Array.isArray(e.content)) return e;
|
|
4
|
+
let t = e.content;
|
|
5
|
+
return {
|
|
6
|
+
...e,
|
|
7
|
+
content: t.map((e) => e.type !== "text" && e.type !== "reasoning" || !e.providerOptions ? e : {
|
|
8
|
+
...e,
|
|
9
|
+
providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
}, i = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : null, a = (e = {}) => {
|
|
13
|
+
let t = i(e.inputTokens), n = i(e.outputTokens);
|
|
14
|
+
return {
|
|
15
|
+
inputTokens: t,
|
|
16
|
+
outputTokens: n,
|
|
17
|
+
totalTokens: i(e.totalTokens) ?? (t !== null && n !== null ? t + n : null)
|
|
18
|
+
};
|
|
19
|
+
}, o = (e) => e.some((e) => e !== null) ? e.reduce((e, t) => e + (t ?? 0), 0) : null, s = (e) => new TextEncoder().encode(e).length, c = async (e) => {
|
|
20
|
+
let t = new TextEncoder().encode(e), n = await globalThis.crypto?.subtle?.digest("SHA-256", t);
|
|
21
|
+
return {
|
|
22
|
+
bytes: t.byteLength,
|
|
23
|
+
sha256: n ? Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("") : null
|
|
24
|
+
};
|
|
25
|
+
}, l = async (e) => {
|
|
26
|
+
let t = await c(e), n = JSON.parse(e);
|
|
27
|
+
return Array.isArray(n.input) ? {
|
|
28
|
+
...t,
|
|
29
|
+
toolsBytes: n.tools ? s(JSON.stringify(n.tools)) : 0,
|
|
30
|
+
input: await Promise.all(n.input.map((e) => c(JSON.stringify(e))))
|
|
31
|
+
} : t;
|
|
32
|
+
};
|
|
33
|
+
export { n as a, a as i, l as n, e as o, o as r, r as s, s as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
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) => {
|
|
4
|
+
if (e.role !== "assistant" || !Array.isArray(e.content)) return e;
|
|
5
|
+
let t = e.content;
|
|
6
|
+
return {
|
|
7
|
+
...e,
|
|
8
|
+
content: t.map((e) => (e.type === "text" || e.type === "reasoning") && e.providerOptions ? {
|
|
9
|
+
...e,
|
|
10
|
+
providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
|
|
11
|
+
} : e)
|
|
12
|
+
};
|
|
13
|
+
}, i = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : null, a = (e = {}) => {
|
|
14
|
+
let t = i(e.inputTokens), n = i(e.outputTokens);
|
|
15
|
+
return {
|
|
16
|
+
inputTokens: t,
|
|
17
|
+
outputTokens: n,
|
|
18
|
+
totalTokens: i(e.totalTokens) ?? (t !== null && n !== null ? t + n : null)
|
|
19
|
+
};
|
|
20
|
+
}, o = (e) => e.some((e) => e !== null) ? e.reduce((e, t) => e + (t ?? 0), 0) : null, s = (e) => new TextEncoder().encode(e).length, c = async (e) => {
|
|
21
|
+
let t = new TextEncoder().encode(e), n = await globalThis.crypto?.subtle?.digest("SHA-256", t);
|
|
22
|
+
return {
|
|
23
|
+
bytes: t.byteLength,
|
|
24
|
+
sha256: n ? Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("") : null
|
|
25
|
+
};
|
|
26
|
+
}, l = async (e) => {
|
|
27
|
+
let t = await c(e), n = JSON.parse(e);
|
|
28
|
+
return Array.isArray(n.input) ? {
|
|
29
|
+
...t,
|
|
30
|
+
toolsBytes: n.tools ? s(JSON.stringify(n.tools)) : 0,
|
|
31
|
+
input: await Promise.all(n.input.map((e) => c(JSON.stringify(e))))
|
|
32
|
+
} : t;
|
|
33
|
+
};
|
|
34
|
+
export { n as a, a as i, l as n, e as o, o as r, r as s, s as t };
|