@roomle/embedding-lib 0.0.0-dev-86c52f1 → 0.0.0-dev-f0a595f
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-CS8tMlto.mjs → ai-model-host-BE_xdV6e.mjs} +40 -31
- package/{ai-model-host-D_b_GVlC.mjs → ai-model-host-DHfBsFC2.mjs} +37 -28
- package/ai.js +1 -1
- package/ai.min.js +1 -1
- package/hi.js +45 -9
- package/hi.min.js +46 -10
- 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 +3 -2
- 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/sbom.cdx.json +5 -5
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Third-party software notices for @roomle/embedding-lib
|
|
2
|
-
Generated 2026-11-
|
|
1
|
+
Third-party software notices for @roomle/embedding-lib f0a595fb3082ce97654bc9f722e3cd2e57b5de04
|
|
2
|
+
Generated 2026-11-22
|
|
3
3
|
|
|
4
4
|
This product includes the following third-party components.
|
|
5
5
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { n as e, o as t } from "./usage-C3HE9yXi.mjs";
|
|
3
3
|
import { t as n } from "./chat-model-DooKwd8I.mjs";
|
|
4
|
-
var r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = (e, t) => {
|
|
5
|
-
let n = (
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
i && (
|
|
9
|
-
let t = await n(e,
|
|
4
|
+
var r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = (e, t) => {
|
|
5
|
+
let n = (o.get(e) ?? Promise.resolve()).then(t, t);
|
|
6
|
+
return o.set(e, n.catch(() => {})), n;
|
|
7
|
+
}, c = (t) => e(t).then((e) => {}, () => {}), l = async (e, { features: r, model: i, ...o }) => {
|
|
8
|
+
i && (o.assistantModel = await (async (e) => {
|
|
9
|
+
let t = await n(e, c), r = (e) => Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(t.providerOptions ?? {}), ...Object.keys(e.providerOptions ?? {})])].map((n) => [n, {
|
|
10
10
|
...e.providerOptions?.[n],
|
|
11
11
|
...t.providerOptions?.[n]
|
|
12
12
|
}]));
|
|
@@ -25,9 +25,9 @@ var r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /*
|
|
|
25
25
|
})(i), r = [.../* @__PURE__ */ new Set([
|
|
26
26
|
...r ?? [],
|
|
27
27
|
"configuration-assistant",
|
|
28
|
-
|
|
28
|
+
...!r && o.onAiModelRequest ? ["lifestyle-rendering"] : []
|
|
29
29
|
])]);
|
|
30
|
-
let
|
|
30
|
+
let s = e.startRelay("ai", (e, t) => ((e, t, n) => {
|
|
31
31
|
let r = [], i = async (i) => {
|
|
32
32
|
let [a] = i.ports;
|
|
33
33
|
if (i.source !== e || i.origin !== t || i.data?.type !== "roomle_ai_model_connect" || !a) return;
|
|
@@ -104,10 +104,10 @@ var r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /*
|
|
|
104
104
|
return window.addEventListener("message", i), () => {
|
|
105
105
|
window.removeEventListener("message", i), r.forEach((e) => e.close());
|
|
106
106
|
};
|
|
107
|
-
})(e, t,
|
|
107
|
+
})(e, t, o));
|
|
108
108
|
try {
|
|
109
109
|
await e.ui.setAiModelHost({
|
|
110
|
-
auth: !!
|
|
110
|
+
auth: !!o.onRequestAiModelAuth,
|
|
111
111
|
...i && { assistantModel: {
|
|
112
112
|
model: i.model,
|
|
113
113
|
readsImages: i.readsImages,
|
|
@@ -116,29 +116,38 @@ var r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /*
|
|
|
116
116
|
...r && { features: r }
|
|
117
117
|
});
|
|
118
118
|
} catch (e) {
|
|
119
|
-
throw
|
|
119
|
+
throw s.stop(), e;
|
|
120
|
+
}
|
|
121
|
+
a.set(e, s);
|
|
122
|
+
}, u = async (e, t) => {
|
|
123
|
+
if (t.features?.length === 0) throw Error("serveAiModelRequests: features is empty; leave it out to serve every feature");
|
|
124
|
+
let n = { ...t };
|
|
125
|
+
i.set(e, n);
|
|
126
|
+
let o = () => i.get(e) === n && !0 === a.get(e)?.isCurrent();
|
|
127
|
+
try {
|
|
128
|
+
await s(e, () => l(e, {
|
|
129
|
+
...n,
|
|
130
|
+
model: n.model ?? r.get(e)
|
|
131
|
+
}));
|
|
132
|
+
} catch (t) {
|
|
133
|
+
throw i.get(e) === n && i.delete(e), t;
|
|
120
134
|
}
|
|
121
135
|
return {
|
|
122
136
|
signOut: async () => {
|
|
123
|
-
o
|
|
137
|
+
o() && await e.ui.signOutAiModel();
|
|
124
138
|
},
|
|
125
|
-
stop: async () => {
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
stop: () => s(e, async () => {
|
|
140
|
+
if (!o()) return;
|
|
141
|
+
i.delete(e);
|
|
142
|
+
let t = r.get(e);
|
|
143
|
+
t ? await l(e, { model: t }) : (a.get(e)?.stop(), await e.ui.setAiModelHost(null));
|
|
144
|
+
})
|
|
128
145
|
};
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
return
|
|
132
|
-
...
|
|
133
|
-
model: t
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
let n = i.get(e);
|
|
138
|
-
n?.model || await c(e, {
|
|
139
|
-
...n,
|
|
140
|
-
model: t
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
export { l as n, u as t };
|
|
146
|
+
}, d = async (e, t) => (r.set(e, t), s(e, async () => {
|
|
147
|
+
let n = i.get(e);
|
|
148
|
+
return n?.model ? n.model : (await l(e, {
|
|
149
|
+
...n,
|
|
150
|
+
model: t
|
|
151
|
+
}), t);
|
|
152
|
+
}));
|
|
153
|
+
export { u as n, d as t };
|
|
@@ -79,11 +79,11 @@ var r = "roomle_ai_model_connect", i = () => import("./comlink-7u13Z2ZH.mjs"), a
|
|
|
79
79
|
return window.addEventListener("message", s), () => {
|
|
80
80
|
window.removeEventListener("message", s), o.forEach((e) => e.close());
|
|
81
81
|
};
|
|
82
|
-
}, s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = (e, t) => {
|
|
83
|
-
let n = (
|
|
84
|
-
return
|
|
85
|
-
},
|
|
86
|
-
let t = await n(e,
|
|
82
|
+
}, s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = (e, t) => {
|
|
83
|
+
let n = (u.get(e) ?? Promise.resolve()).then(t, t);
|
|
84
|
+
return u.set(e, n.catch(() => void 0)), n;
|
|
85
|
+
}, f = (t) => e(t).then((e) => console.log(`[planning-assistant] request ${JSON.stringify(e)}`), () => void 0), p = async (e) => {
|
|
86
|
+
let t = await n(e, f), r = (e) => Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(t.providerOptions ?? {}), ...Object.keys(e.providerOptions ?? {})])].map((n) => [n, {
|
|
87
87
|
...e.providerOptions?.[n],
|
|
88
88
|
...t.providerOptions?.[n]
|
|
89
89
|
}]));
|
|
@@ -99,11 +99,11 @@ var r = "roomle_ai_model_connect", i = () => import("./comlink-7u13Z2ZH.mjs"), a
|
|
|
99
99
|
abortSignal: n
|
|
100
100
|
})).stream
|
|
101
101
|
};
|
|
102
|
-
},
|
|
103
|
-
r && (i.assistantModel = await
|
|
102
|
+
}, m = async (e, { features: n, model: r, ...i }) => {
|
|
103
|
+
r && (i.assistantModel = await p(r), n = [.../* @__PURE__ */ new Set([
|
|
104
104
|
...n ?? [],
|
|
105
105
|
"configuration-assistant",
|
|
106
|
-
|
|
106
|
+
...!n && i.onAiModelRequest ? ["lifestyle-rendering"] : []
|
|
107
107
|
])]);
|
|
108
108
|
let a = e.startRelay("ai", (e, t) => o(e, t, i));
|
|
109
109
|
try {
|
|
@@ -119,27 +119,36 @@ var r = "roomle_ai_model_connect", i = () => import("./comlink-7u13Z2ZH.mjs"), a
|
|
|
119
119
|
} catch (e) {
|
|
120
120
|
throw a.stop(), e;
|
|
121
121
|
}
|
|
122
|
+
l.set(e, a);
|
|
123
|
+
}, h = async (e, t) => {
|
|
124
|
+
if (t.features?.length === 0) throw Error("serveAiModelRequests: features is empty; leave it out to serve every feature");
|
|
125
|
+
let n = { ...t };
|
|
126
|
+
c.set(e, n);
|
|
127
|
+
let r = () => c.get(e) === n && l.get(e)?.isCurrent() === !0;
|
|
128
|
+
try {
|
|
129
|
+
await d(e, () => m(e, {
|
|
130
|
+
...n,
|
|
131
|
+
model: n.model ?? s.get(e)
|
|
132
|
+
}));
|
|
133
|
+
} catch (t) {
|
|
134
|
+
throw c.get(e) === n && c.delete(e), t;
|
|
135
|
+
}
|
|
122
136
|
return {
|
|
123
137
|
signOut: async () => {
|
|
124
|
-
|
|
138
|
+
r() && await e.ui.signOutAiModel();
|
|
125
139
|
},
|
|
126
|
-
stop: async () => {
|
|
127
|
-
|
|
128
|
-
|
|
140
|
+
stop: () => d(e, async () => {
|
|
141
|
+
if (!r()) return;
|
|
142
|
+
c.delete(e);
|
|
143
|
+
let t = s.get(e);
|
|
144
|
+
t ? await m(e, { model: t }) : (l.get(e)?.stop(), await e.ui.setAiModelHost(null));
|
|
145
|
+
})
|
|
129
146
|
};
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
return
|
|
133
|
-
...
|
|
134
|
-
model: t
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
let n = c.get(e);
|
|
139
|
-
n?.model || await p(e, {
|
|
140
|
-
...n,
|
|
141
|
-
model: t
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
export { m as n, h as t };
|
|
147
|
+
}, g = async (e, t) => (s.set(e, t), d(e, async () => {
|
|
148
|
+
let n = c.get(e);
|
|
149
|
+
return n?.model ? n.model : (await m(e, {
|
|
150
|
+
...n,
|
|
151
|
+
model: t
|
|
152
|
+
}), t);
|
|
153
|
+
}));
|
|
154
|
+
export { h as n, g as t };
|
package/ai.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
|
|
2
|
-
export { n as serveAiModelRequests } from "./ai-model-host-
|
|
2
|
+
export { n as serveAiModelRequests } from "./ai-model-host-DHfBsFC2.mjs";
|
package/ai.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
|
|
2
|
-
export { n as serveAiModelRequests } from "./ai-model-host-
|
|
2
|
+
export { n as serveAiModelRequests } from "./ai-model-host-BE_xdV6e.mjs";
|
package/hi.js
CHANGED
|
@@ -3,7 +3,7 @@ import { t as e } from "./utils-CJnKZceY.mjs";
|
|
|
3
3
|
import { t } from "./browser-Cys-y5Hy.mjs";
|
|
4
4
|
import { t as n } from "./chat-model-KHuz1Ej9.mjs";
|
|
5
5
|
import { t as r } from "./mcp-tools-C6O2gQZW.mjs";
|
|
6
|
-
import { t as i } from "./ai-model-host-
|
|
6
|
+
import { t as i } from "./ai-model-host-DHfBsFC2.mjs";
|
|
7
7
|
import { o as a } from "./usage-CYqDPQOx.mjs";
|
|
8
8
|
var o = (e, t) => t === e.libraryId ? e : {
|
|
9
9
|
...e,
|
|
@@ -96,8 +96,11 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
96
96
|
if (n.aborted) return;
|
|
97
97
|
let o = crypto.randomUUID();
|
|
98
98
|
try {
|
|
99
|
-
let { startRelay: n, ui: a } = e;
|
|
100
|
-
|
|
99
|
+
let { startRelay: n, ui: a } = e, s = n && a ? await i(e, t) : t;
|
|
100
|
+
await r.startExternalObjectPlanningAssistant(w({
|
|
101
|
+
...s,
|
|
102
|
+
decisionApiKey: t.decisionApiKey
|
|
103
|
+
}), o);
|
|
101
104
|
} catch (e) {
|
|
102
105
|
await a(String(e));
|
|
103
106
|
return;
|
|
@@ -110,10 +113,10 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
110
113
|
if (n.addEventListener("abort", c, { once: !0 }), n.aborted) await l();
|
|
111
114
|
else return {
|
|
112
115
|
suspend: async () => {
|
|
113
|
-
await r.suspendPlanningAssistant?.();
|
|
116
|
+
s || await r.suspendPlanningAssistant?.();
|
|
114
117
|
},
|
|
115
118
|
resume: async () => {
|
|
116
|
-
await r.resumePlanningAssistant?.();
|
|
119
|
+
s || await r.resumePlanningAssistant?.();
|
|
117
120
|
},
|
|
118
121
|
dispose: l
|
|
119
122
|
};
|
|
@@ -129,20 +132,25 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
129
132
|
return console.warn("No HI model proxy: the backend list failed", e), {};
|
|
130
133
|
}
|
|
131
134
|
if (!Array.isArray(r) || r.length !== 1) return {};
|
|
132
|
-
let [{ enableAIPlanning: i, enableAIRendering: a }] = r,
|
|
135
|
+
let [{ enableAIPlanning: i, enableAIRendering: a, enableAIDecisions: o }] = r, s = `${e}/api/ai/v1`;
|
|
133
136
|
return {
|
|
134
137
|
...i === !0 && { chat: {
|
|
135
138
|
provider: "openai-compatible",
|
|
136
|
-
baseUrl:
|
|
139
|
+
baseUrl: s,
|
|
137
140
|
model: "planning",
|
|
138
141
|
headers: n,
|
|
139
142
|
responses: !0,
|
|
140
143
|
readsImages: !0
|
|
141
144
|
} },
|
|
142
145
|
...a === !0 && { rendering: {
|
|
143
|
-
baseUrl:
|
|
146
|
+
baseUrl: s,
|
|
144
147
|
model: "rendering",
|
|
145
148
|
headers: n
|
|
149
|
+
} },
|
|
150
|
+
...o === !0 && { decisions: {
|
|
151
|
+
baseUrl: s,
|
|
152
|
+
model: "decision",
|
|
153
|
+
headers: n
|
|
146
154
|
} }
|
|
147
155
|
};
|
|
148
156
|
}, O = (e = "1:1") => {
|
|
@@ -161,8 +169,36 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
161
169
|
let { data: d } = await u.json(), f = d?.[0]?.b64_json, p = new FormData();
|
|
162
170
|
return f ? p.append("image", await k(`data:image/png;base64,${f}`)) : p.append("text", "The endpoint returned no image"), new Response(p);
|
|
163
171
|
}, j = {
|
|
172
|
+
png: "image/png",
|
|
173
|
+
jpg: "image/jpeg"
|
|
174
|
+
}, M = (e, t, { baseUrl: n, model: r, headers: i }) => {
|
|
175
|
+
let { state: a, questions: o, assets: s = {} } = JSON.parse(e.body);
|
|
176
|
+
return fetch(`${n}/decisions`, {
|
|
177
|
+
method: "POST",
|
|
178
|
+
headers: {
|
|
179
|
+
...i,
|
|
180
|
+
"Content-Type": "application/json"
|
|
181
|
+
},
|
|
182
|
+
body: JSON.stringify({
|
|
183
|
+
model: r,
|
|
184
|
+
input: [{
|
|
185
|
+
type: "text",
|
|
186
|
+
text: JSON.stringify(a)
|
|
187
|
+
}, ...Object.entries(s).flatMap(([e, t]) => [{
|
|
188
|
+
type: "text",
|
|
189
|
+
text: e
|
|
190
|
+
}, {
|
|
191
|
+
type: "image",
|
|
192
|
+
data: t.data_base64,
|
|
193
|
+
mime_type: j[t.format]
|
|
194
|
+
}])],
|
|
195
|
+
questions: o
|
|
196
|
+
}),
|
|
197
|
+
signal: t
|
|
198
|
+
});
|
|
199
|
+
}, N = {
|
|
164
200
|
HIDE: "hide",
|
|
165
201
|
SHOW_ATTRIBUTES: "attributes",
|
|
166
202
|
SHOW_ARTICLES: "articles"
|
|
167
203
|
};
|
|
168
|
-
export {
|
|
204
|
+
export { N as HI_PANEL_ACTION, S as cleanupHi, h as createHiLibraryCallbacks, C as createHiMcpTools, f as libLoadArticleCatalog, m as libLoadCalcScript, p as libLoadMasterData, n as loadChatModel, v as omGetRequest, _ as omPostRequest, l as registerLegacyUrlFormat, M as requestDecisions, A as requestImageEdits, D as resolveHiModelProxy, x as setupHi, T as startPlanningAssistant, u as unregisterLegacyUrlFormat };
|
package/hi.min.js
CHANGED
|
@@ -3,7 +3,7 @@ import { t as e } from "./utils-DdNhTbJr.mjs";
|
|
|
3
3
|
import { t } from "./browser-CzLpXYFF.mjs";
|
|
4
4
|
import { t as n } from "./chat-model-DooKwd8I.mjs";
|
|
5
5
|
import { t as r } from "./mcp-tools-m_3IX0vB.mjs";
|
|
6
|
-
import { t as i } from "./ai-model-host-
|
|
6
|
+
import { t as i } from "./ai-model-host-BE_xdV6e.mjs";
|
|
7
7
|
import { o as a } from "./usage-C3HE9yXi.mjs";
|
|
8
8
|
var o = (e, t) => t === e.libraryId ? e : {
|
|
9
9
|
...e,
|
|
@@ -83,8 +83,8 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
83
83
|
if (n.aborted) return;
|
|
84
84
|
let s = crypto.randomUUID();
|
|
85
85
|
try {
|
|
86
|
-
let { startRelay: n, ui: o } = e;
|
|
87
|
-
|
|
86
|
+
let { startRelay: n, ui: o } = e, c = n && o ? await i(e, t) : t;
|
|
87
|
+
await r.startExternalObjectPlanningAssistant(((e) => {
|
|
88
88
|
let t = a(e);
|
|
89
89
|
return {
|
|
90
90
|
provider: "host",
|
|
@@ -95,7 +95,10 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
95
95
|
...e.provider === "azure" && !e.chatCompletions && !0 === e.referenceCacheBreakpoint && { referenceCacheBreakpoint: !0 },
|
|
96
96
|
...e.decisionApiKey && { decisionApiKey: e.decisionApiKey }
|
|
97
97
|
};
|
|
98
|
-
})(
|
|
98
|
+
})({
|
|
99
|
+
...c,
|
|
100
|
+
decisionApiKey: t.decisionApiKey
|
|
101
|
+
}), s);
|
|
99
102
|
} catch (e) {
|
|
100
103
|
await o(String(e));
|
|
101
104
|
return;
|
|
@@ -107,10 +110,10 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
107
110
|
})();
|
|
108
111
|
if (n.addEventListener("abort", l, { once: !0 }), !n.aborted) return {
|
|
109
112
|
suspend: async () => {
|
|
110
|
-
await r.suspendPlanningAssistant?.();
|
|
113
|
+
c || await r.suspendPlanningAssistant?.();
|
|
111
114
|
},
|
|
112
115
|
resume: async () => {
|
|
113
|
-
await r.resumePlanningAssistant?.();
|
|
116
|
+
c || await r.resumePlanningAssistant?.();
|
|
114
117
|
},
|
|
115
118
|
dispose: u
|
|
116
119
|
};
|
|
@@ -127,20 +130,25 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
127
130
|
return {};
|
|
128
131
|
}
|
|
129
132
|
if (!Array.isArray(r) || r.length !== 1) return {};
|
|
130
|
-
let [{ enableAIPlanning: i, enableAIRendering: a }] = r,
|
|
133
|
+
let [{ enableAIPlanning: i, enableAIRendering: a, enableAIDecisions: o }] = r, s = `${e}/api/ai/v1`;
|
|
131
134
|
return {
|
|
132
135
|
...!0 === i && { chat: {
|
|
133
136
|
provider: "openai-compatible",
|
|
134
|
-
baseUrl:
|
|
137
|
+
baseUrl: s,
|
|
135
138
|
model: "planning",
|
|
136
139
|
headers: n,
|
|
137
140
|
responses: !0,
|
|
138
141
|
readsImages: !0
|
|
139
142
|
} },
|
|
140
143
|
...!0 === a && { rendering: {
|
|
141
|
-
baseUrl:
|
|
144
|
+
baseUrl: s,
|
|
142
145
|
model: "rendering",
|
|
143
146
|
headers: n
|
|
147
|
+
} },
|
|
148
|
+
...!0 === o && { decisions: {
|
|
149
|
+
baseUrl: s,
|
|
150
|
+
model: "decision",
|
|
151
|
+
headers: n
|
|
144
152
|
} }
|
|
145
153
|
};
|
|
146
154
|
}, T = async (e) => (await fetch(e)).blob(), E = async (e, t, { baseUrl: n, model: r, headers: i }) => {
|
|
@@ -159,8 +167,36 @@ var o = (e, t) => t === e.libraryId ? e : {
|
|
|
159
167
|
let { data: d } = await u.json(), f = d?.[0]?.b64_json, p = new FormData();
|
|
160
168
|
return f ? p.append("image", await T(`data:image/png;base64,${f}`)) : p.append("text", "The endpoint returned no image"), new Response(p);
|
|
161
169
|
}, D = {
|
|
170
|
+
png: "image/png",
|
|
171
|
+
jpg: "image/jpeg"
|
|
172
|
+
}, O = (e, t, { baseUrl: n, model: r, headers: i }) => {
|
|
173
|
+
let { state: a, questions: o, assets: s = {} } = JSON.parse(e.body);
|
|
174
|
+
return fetch(`${n}/decisions`, {
|
|
175
|
+
method: "POST",
|
|
176
|
+
headers: {
|
|
177
|
+
...i,
|
|
178
|
+
"Content-Type": "application/json"
|
|
179
|
+
},
|
|
180
|
+
body: JSON.stringify({
|
|
181
|
+
model: r,
|
|
182
|
+
input: [{
|
|
183
|
+
type: "text",
|
|
184
|
+
text: JSON.stringify(a)
|
|
185
|
+
}, ...Object.entries(s).flatMap(([e, t]) => [{
|
|
186
|
+
type: "text",
|
|
187
|
+
text: e
|
|
188
|
+
}, {
|
|
189
|
+
type: "image",
|
|
190
|
+
data: t.data_base64,
|
|
191
|
+
mime_type: D[t.format]
|
|
192
|
+
}])],
|
|
193
|
+
questions: o
|
|
194
|
+
}),
|
|
195
|
+
signal: t
|
|
196
|
+
});
|
|
197
|
+
}, k = {
|
|
162
198
|
HIDE: "hide",
|
|
163
199
|
SHOW_ATTRIBUTES: "attributes",
|
|
164
200
|
SHOW_ARTICLES: "articles"
|
|
165
201
|
};
|
|
166
|
-
export {
|
|
202
|
+
export { k as HI_PANEL_ACTION, x as cleanupHi, h as createHiLibraryCallbacks, S as createHiMcpTools, f as libLoadArticleCatalog, m as libLoadCalcScript, p as libLoadMasterData, n as loadChatModel, v as omGetRequest, _ as omPostRequest, l as registerLegacyUrlFormat, O as requestDecisions, E as requestImageEdits, w as resolveHiModelProxy, b as setupHi, C as startPlanningAssistant, u as unregisterLegacyUrlFormat };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-f0a595f",
|
|
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",
|
|
@@ -17,7 +17,7 @@ export interface AssistantModelHandlers {
|
|
|
17
17
|
* The iframe hands its AI model requests to the host page ("bring your own
|
|
18
18
|
* endpoint"), over Comlink on a port it sends, like connect_hi
|
|
19
19
|
*/
|
|
20
|
-
export type AiFeature = 'lifestyle-rendering' | 'configuration-assistant';
|
|
20
|
+
export type AiFeature = 'lifestyle-rendering' | 'configuration-assistant' | 'planning-decisions';
|
|
21
21
|
/**
|
|
22
22
|
* The feature names what the request is for, so no route, method or headers
|
|
23
23
|
* of a built-in endpoint reach the host. A feature with several operations
|
|
@@ -5,7 +5,8 @@ export interface AiModelHostOptions extends AiModelHandlers {
|
|
|
5
5
|
model?: PlanningAssistantConfig;
|
|
6
6
|
/**
|
|
7
7
|
* The features the host answers; the others keep the built-in endpoints.
|
|
8
|
-
* Left out: every feature
|
|
8
|
+
* Left out: every feature but `planning-decisions`, also ones added later.
|
|
9
|
+
* Never empty.
|
|
9
10
|
*/
|
|
10
11
|
features?: AiFeature[];
|
|
11
12
|
}
|
|
@@ -30,5 +31,5 @@ export declare const hostAssistantModel: (model: PlanningAssistantConfig) => Pro
|
|
|
30
31
|
*/
|
|
31
32
|
export declare const serveAiModelRequests: (instance: AiModelInstance, options: AiModelHostOptions) => Promise<AiModelHostControl>;
|
|
32
33
|
/** Serves the model of the HI Planning Assistant beside the host's registration. */
|
|
33
|
-
export declare const keepAssistantModel: (instance: AiModelInstance, model: PlanningAssistantConfig) => Promise<
|
|
34
|
+
export declare const keepAssistantModel: (instance: AiModelInstance, model: PlanningAssistantConfig) => Promise<PlanningAssistantConfig>;
|
|
34
35
|
export {};
|
|
@@ -18,5 +18,6 @@ export { createHiMcpTools, type HiMcpTool, type HiMcpTools, type HiMcpPlannerApi
|
|
|
18
18
|
export { loadChatModel, startPlanningAssistant, type PlanningAssistantConfig, type PlanningAssistantPlannerApi, type PlanningAssistantControl, } from './homag-intelligence/hi-planning-assistant';
|
|
19
19
|
export { resolveHiModelProxy, type HiModelProxy, type HiModelProxyOptions, } from './homag-intelligence/hi-model-proxy';
|
|
20
20
|
export { requestImageEdits, type ImageEditsEndpoint, } from './homag-intelligence/image-edits';
|
|
21
|
+
export { requestDecisions, type DecisionsEndpoint, } from './homag-intelligence/decisions';
|
|
21
22
|
export { type ExternalObjectSnapshotSaveResult, type HiContextAction, } from '../../web-sdk/packages';
|
|
22
23
|
export { HI_PANEL_ACTION, type HiPanelActionType, type HiOrderHeader, type HiOrder, type HiOrderData, type HiPriceData, type HiCallbacks, } from '../../common/src/hi/hi-types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AiModelRequest } from '../../../common/src/utils/ai-model-relay';
|
|
2
|
+
export interface DecisionsEndpoint {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
model: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export declare const requestDecisions: (request: AiModelRequest, signal: AbortSignal, { baseUrl, model, headers }: DecisionsEndpoint) => Promise<Response>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DecisionsEndpoint } from './decisions';
|
|
1
2
|
import { ImageEditsEndpoint } from './image-edits';
|
|
2
3
|
import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
|
|
3
4
|
/**
|
|
@@ -10,6 +11,7 @@ export interface HiModelProxy {
|
|
|
10
11
|
chat?: PlanningAssistantConfig;
|
|
11
12
|
/** The lifestyle renderings of the AI image chat, when the backend's `enableAIRendering` is true */
|
|
12
13
|
rendering?: ImageEditsEndpoint;
|
|
14
|
+
decisions?: DecisionsEndpoint;
|
|
13
15
|
}
|
|
14
16
|
export interface HiModelProxyOptions {
|
|
15
17
|
/** The HI server, e.g. `https://dfscfgtest01-app.azurewebsites.net`; `''` for the page's own origin */
|
|
@@ -21,6 +23,7 @@ export interface HiModelProxyOptions {
|
|
|
21
23
|
* Reads the backend list of the HI user and returns what the model proxy of
|
|
22
24
|
* the HI server serves. The proxy serves only a user of exactly one backend:
|
|
23
25
|
* the chat when that backend's `enableAIPlanning` is true, the renderings
|
|
24
|
-
* when its `enableAIRendering` is true
|
|
26
|
+
* when its `enableAIRendering` is true, the decisions when its
|
|
27
|
+
* `enableAIDecisions` is true. A failed backend list serves none.
|
|
25
28
|
*/
|
|
26
29
|
export declare const resolveHiModelProxy: ({ serverUrl, authorization, }: HiModelProxyOptions) => Promise<HiModelProxy>;
|
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:7288c771-e968-58b9-b6a3-f3d88ef4f398",
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-22T19:26:31.000Z",
|
|
9
9
|
"component": {
|
|
10
10
|
"type": "library",
|
|
11
11
|
"name": "@roomle/embedding-lib",
|
|
12
|
-
"version": "
|
|
13
|
-
"bom-ref": "@roomle/embedding-lib@
|
|
12
|
+
"version": "f0a595fb3082ce97654bc9f722e3cd2e57b5de04",
|
|
13
|
+
"bom-ref": "@roomle/embedding-lib@f0a595fb3082ce97654bc9f722e3cd2e57b5de04"
|
|
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@f0a595fb3082ce97654bc9f722e3cd2e57b5de04"
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"ref": "pkg:npm/%40ai-sdk/anthropic@4.0.68"
|