@roomle/embedding-lib 0.0.0-dev-a95b24e → 0.0.0-dev-9d077e2
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/configurator.d.ts +2 -0
- package/configurator.js +119 -0
- package/configurator.min.js +117 -0
- package/{drag-ghost-BxqPJdhq.mjs → drag-ghost-BOwjMbG3.mjs} +1 -1
- package/{drag-ghost-CDFtC1pd.mjs → drag-ghost-BQ8r6NVo.mjs} +1 -1
- package/{drag-in-CV1E-DO6.mjs → drag-in-BP_E53zb.mjs} +2 -2
- package/{drag-in-ClPpCYyi.mjs → drag-in-QhL3zGC0.mjs} +2 -2
- package/embedding-plugins.js +1 -1
- package/embedding-plugins.min.js +1 -1
- package/{from-custom-view-Q9A-J7qV.mjs → from-custom-view-BM_zRJCf.mjs} +2 -2
- package/{from-custom-view-Sx6P6iDI.mjs → from-custom-view-D2Z1YmCx.mjs} +2 -2
- package/{from-website-DZJy_l42.mjs → from-website-CPVeVVMI.mjs} +2 -2
- package/{from-website-BmCO2xli.mjs → from-website-DlklVbxU.mjs} +2 -2
- package/hi.js +39 -177
- package/hi.min.js +38 -161
- package/package.json +8 -1
- package/packages/embedding-lib/src/configurator-agent/chat-recovery.d.ts +9 -0
- package/packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.d.ts +11 -0
- package/packages/embedding-lib/src/configurator-agent/configurator-planning-assistant.d.ts +8 -0
- package/packages/embedding-lib/src/configurator.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +4 -61
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +4 -40
- package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +33 -0
- package/packages/embedding-lib/src/planning-assistant/mcp-tools.d.ts +52 -0
- package/packages/embedding-lib/src/planning-assistant/planning-assistant.d.ts +23 -0
- package/planning-assistant-BW9fNGZO.mjs +158 -0
- package/planning-assistant-CyVA2uUX.mjs +143 -0
- package/roomle-embedding-lib.js +3 -1
- package/roomle-embedding-lib.min.js +3 -1
- /package/{comlink-B2Kj_5Ge.mjs → comlink-BJnhpJa4.mjs} +0 -0
- /package/{comlink-B5lV2OWp.mjs → comlink-lSsogKgb.mjs} +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
//#region packages/embedding-lib/src/planning-assistant/mcp-tools.ts
|
|
2
|
+
var e = ({ output: e }) => ({
|
|
3
|
+
type: "content",
|
|
4
|
+
value: e.content.map((e) => e.type === "text" ? {
|
|
5
|
+
type: "text",
|
|
6
|
+
text: e.text
|
|
7
|
+
} : {
|
|
8
|
+
type: "file",
|
|
9
|
+
mediaType: e.mimeType,
|
|
10
|
+
data: {
|
|
11
|
+
type: "data",
|
|
12
|
+
data: e.data
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
}), t = (t, n, r) => Object.fromEntries(t.map(({ name: t, description: i, inputSchema: a, annotations: o }) => {
|
|
16
|
+
let s = () => a;
|
|
17
|
+
return [t, {
|
|
18
|
+
type: "dynamic",
|
|
19
|
+
...o && { annotations: o },
|
|
20
|
+
description: i,
|
|
21
|
+
inputSchema: { "~standard": {
|
|
22
|
+
version: 1,
|
|
23
|
+
vendor: r,
|
|
24
|
+
validate: (e) => ({ value: e }),
|
|
25
|
+
jsonSchema: {
|
|
26
|
+
input: s,
|
|
27
|
+
output: s
|
|
28
|
+
}
|
|
29
|
+
} },
|
|
30
|
+
execute: (e) => n(t, e).catch((e) => ({
|
|
31
|
+
content: [{
|
|
32
|
+
type: "text",
|
|
33
|
+
text: e instanceof Error ? e.message : String(e)
|
|
34
|
+
}],
|
|
35
|
+
isError: !0
|
|
36
|
+
})),
|
|
37
|
+
toModelOutput: e
|
|
38
|
+
}];
|
|
39
|
+
})), n = (e) => `https://esm.sh/${e}?deps=zod@4.6.5`, r = async ({ provider: e, model: t, apiKey: r, baseUrl: i, chatCompletions: a, reasoningEffort: o }) => {
|
|
40
|
+
switch (e) {
|
|
41
|
+
case "azure": {
|
|
42
|
+
let { createAzure: e } = await import(
|
|
43
|
+
/* @vite-ignore */
|
|
44
|
+
n("@ai-sdk/azure@4.0.85")
|
|
45
|
+
), s = e({
|
|
46
|
+
apiKey: r,
|
|
47
|
+
baseURL: i
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
languageModel: a ? s.chat(t) : s(t),
|
|
51
|
+
providerOptions: o ? { azure: { reasoningEffort: o } } : void 0
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
case "mistral": {
|
|
55
|
+
let { createMistral: e } = await import(
|
|
56
|
+
/* @vite-ignore */
|
|
57
|
+
n("@ai-sdk/mistral@4.0.54")
|
|
58
|
+
);
|
|
59
|
+
return { languageModel: e({ apiKey: r })(t) };
|
|
60
|
+
}
|
|
61
|
+
case "anthropic": {
|
|
62
|
+
let { createAnthropic: e } = await import(
|
|
63
|
+
/* @vite-ignore */
|
|
64
|
+
n("@ai-sdk/anthropic@4.0.68")
|
|
65
|
+
);
|
|
66
|
+
return { languageModel: e({
|
|
67
|
+
apiKey: r,
|
|
68
|
+
headers: { "anthropic-dangerous-direct-browser-access": "true" }
|
|
69
|
+
})(t) };
|
|
70
|
+
}
|
|
71
|
+
case "google": {
|
|
72
|
+
let { createGoogleGenerativeAI: e } = await import(
|
|
73
|
+
/* @vite-ignore */
|
|
74
|
+
n("@ai-sdk/google@4.0.85")
|
|
75
|
+
);
|
|
76
|
+
return { languageModel: e({ apiKey: r })(t) };
|
|
77
|
+
}
|
|
78
|
+
default: throw Error(`Unknown provider "${e}" - supported: azure, mistral, anthropic, google`);
|
|
79
|
+
}
|
|
80
|
+
}, i = async (e, t, i, a, o) => {
|
|
81
|
+
let s = (t) => e.planningAssistantOutput(t), c;
|
|
82
|
+
try {
|
|
83
|
+
c = await Promise.all([
|
|
84
|
+
import(
|
|
85
|
+
/* @vite-ignore */
|
|
86
|
+
n("ai@7.0.122")
|
|
87
|
+
),
|
|
88
|
+
r(t),
|
|
89
|
+
a()
|
|
90
|
+
]);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
s({
|
|
93
|
+
type: "availability",
|
|
94
|
+
available: !1,
|
|
95
|
+
text: String(e)
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
let [{ streamText: l, stepCountIs: u }, d, { prompts: f, tools: p }] = c, m = [];
|
|
100
|
+
e.callbacks.onPlanningAssistantPrompt = async ({ text: e, images: t }) => {
|
|
101
|
+
let n = {
|
|
102
|
+
role: "user",
|
|
103
|
+
content: [{
|
|
104
|
+
type: "text",
|
|
105
|
+
text: e || f.imagePrompt
|
|
106
|
+
}, ...t.map((e) => ({
|
|
107
|
+
type: "file",
|
|
108
|
+
data: e,
|
|
109
|
+
mediaType: "image/jpeg"
|
|
110
|
+
}))]
|
|
111
|
+
}, r = o?.recovery(p), a = new AbortController(), c = () => a.abort(i.reason);
|
|
112
|
+
i.addEventListener("abort", c, { once: !0 }), i.aborted && c();
|
|
113
|
+
let h = o ? setTimeout(() => a.abort(/* @__PURE__ */ Error("The configurator assistant turn exceeded five minutes.")), o.timeoutMs) : void 0;
|
|
114
|
+
try {
|
|
115
|
+
let e = l({
|
|
116
|
+
model: d.languageModel,
|
|
117
|
+
providerOptions: d.providerOptions,
|
|
118
|
+
instructions: f.systemPrompt,
|
|
119
|
+
messages: [...m, n],
|
|
120
|
+
tools: r?.tools ?? p,
|
|
121
|
+
stopWhen: u(16),
|
|
122
|
+
abortSignal: o ? a.signal : i,
|
|
123
|
+
prepareStep: ({ stepNumber: e }) => e === 15 ? { toolChoice: "none" } : void 0
|
|
124
|
+
});
|
|
125
|
+
for await (let t of e.stream) if (t.type === "text-delta") s({
|
|
126
|
+
type: "text",
|
|
127
|
+
text: t.text
|
|
128
|
+
});
|
|
129
|
+
else if (t.type === "tool-call") s({
|
|
130
|
+
type: "activity",
|
|
131
|
+
text: t.toolName
|
|
132
|
+
});
|
|
133
|
+
else if (t.type === "error") throw t.error;
|
|
134
|
+
else if (t.type === "abort" && o) throw a.signal.reason ?? /* @__PURE__ */ Error("Turn aborted");
|
|
135
|
+
if (o && a.signal.aborted) throw a.signal.reason;
|
|
136
|
+
m.push(n, ...await e.responseMessages), s({ type: "done" });
|
|
137
|
+
} catch (e) {
|
|
138
|
+
let t = r?.summary();
|
|
139
|
+
t && m.push(n, {
|
|
140
|
+
role: "assistant",
|
|
141
|
+
content: t
|
|
142
|
+
}), s({
|
|
143
|
+
type: "error",
|
|
144
|
+
text: `The planning assistant failed: ${e instanceof Error ? e.message : String(e)}${t ? `\n\n${t}` : ""}`
|
|
145
|
+
});
|
|
146
|
+
} finally {
|
|
147
|
+
clearTimeout(h), i.removeEventListener("abort", c);
|
|
148
|
+
}
|
|
149
|
+
}, s({
|
|
150
|
+
type: "images",
|
|
151
|
+
enabled: t.readsImages
|
|
152
|
+
}), s({
|
|
153
|
+
type: "availability",
|
|
154
|
+
available: !0
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
export { r as n, t as r, i as t };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
var e = ({ output: e }) => ({
|
|
2
|
+
type: "content",
|
|
3
|
+
value: e.content.map((e) => e.type === "text" ? {
|
|
4
|
+
type: "text",
|
|
5
|
+
text: e.text
|
|
6
|
+
} : {
|
|
7
|
+
type: "file",
|
|
8
|
+
mediaType: e.mimeType,
|
|
9
|
+
data: {
|
|
10
|
+
type: "data",
|
|
11
|
+
data: e.data
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
}), t = (t, n, r) => Object.fromEntries(t.map(({ name: t, description: i, inputSchema: a, annotations: o }) => {
|
|
15
|
+
let s = () => a;
|
|
16
|
+
return [t, {
|
|
17
|
+
type: "dynamic",
|
|
18
|
+
...o && { annotations: o },
|
|
19
|
+
description: i,
|
|
20
|
+
inputSchema: { "~standard": {
|
|
21
|
+
version: 1,
|
|
22
|
+
vendor: r,
|
|
23
|
+
validate: (e) => ({ value: e }),
|
|
24
|
+
jsonSchema: {
|
|
25
|
+
input: s,
|
|
26
|
+
output: s
|
|
27
|
+
}
|
|
28
|
+
} },
|
|
29
|
+
execute: (e) => n(t, e).catch((e) => ({
|
|
30
|
+
content: [{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: e instanceof Error ? e.message : String(e)
|
|
33
|
+
}],
|
|
34
|
+
isError: !0
|
|
35
|
+
})),
|
|
36
|
+
toModelOutput: e
|
|
37
|
+
}];
|
|
38
|
+
})), n = (e) => `https://esm.sh/${e}?deps=zod@4.6.5`, r = async ({ provider: e, model: t, apiKey: r, baseUrl: i, chatCompletions: a, reasoningEffort: o }) => {
|
|
39
|
+
switch (e) {
|
|
40
|
+
case "azure": {
|
|
41
|
+
let { createAzure: e } = await import(n("@ai-sdk/azure@4.0.85")), s = e({
|
|
42
|
+
apiKey: r,
|
|
43
|
+
baseURL: i
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
languageModel: a ? s.chat(t) : s(t),
|
|
47
|
+
providerOptions: o ? { azure: { reasoningEffort: o } } : void 0
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
case "mistral": {
|
|
51
|
+
let { createMistral: e } = await import(n("@ai-sdk/mistral@4.0.54"));
|
|
52
|
+
return { languageModel: e({ apiKey: r })(t) };
|
|
53
|
+
}
|
|
54
|
+
case "anthropic": {
|
|
55
|
+
let { createAnthropic: e } = await import(n("@ai-sdk/anthropic@4.0.68"));
|
|
56
|
+
return { languageModel: e({
|
|
57
|
+
apiKey: r,
|
|
58
|
+
headers: { "anthropic-dangerous-direct-browser-access": "true" }
|
|
59
|
+
})(t) };
|
|
60
|
+
}
|
|
61
|
+
case "google": {
|
|
62
|
+
let { createGoogleGenerativeAI: e } = await import(n("@ai-sdk/google@4.0.85"));
|
|
63
|
+
return { languageModel: e({ apiKey: r })(t) };
|
|
64
|
+
}
|
|
65
|
+
default: throw Error(`Unknown provider "${e}" - supported: azure, mistral, anthropic, google`);
|
|
66
|
+
}
|
|
67
|
+
}, i = async (e, t, i, a, o) => {
|
|
68
|
+
let s = (t) => e.planningAssistantOutput(t), c;
|
|
69
|
+
try {
|
|
70
|
+
c = await Promise.all([
|
|
71
|
+
import(n("ai@7.0.122")),
|
|
72
|
+
r(t),
|
|
73
|
+
a()
|
|
74
|
+
]);
|
|
75
|
+
} catch (e) {
|
|
76
|
+
s({
|
|
77
|
+
type: "availability",
|
|
78
|
+
available: !1,
|
|
79
|
+
text: String(e)
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
let [{ streamText: l, stepCountIs: u }, d, { prompts: f, tools: p }] = c, m = [];
|
|
84
|
+
e.callbacks.onPlanningAssistantPrompt = async ({ text: e, images: t }) => {
|
|
85
|
+
let n = {
|
|
86
|
+
role: "user",
|
|
87
|
+
content: [{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: e || f.imagePrompt
|
|
90
|
+
}, ...t.map((e) => ({
|
|
91
|
+
type: "file",
|
|
92
|
+
data: e,
|
|
93
|
+
mediaType: "image/jpeg"
|
|
94
|
+
}))]
|
|
95
|
+
}, r = o?.recovery(p), a = new AbortController(), c = () => a.abort(i.reason);
|
|
96
|
+
i.addEventListener("abort", c, { once: !0 }), i.aborted && c();
|
|
97
|
+
let h = o ? setTimeout(() => a.abort(/* @__PURE__ */ Error("The configurator assistant turn exceeded five minutes.")), o.timeoutMs) : void 0;
|
|
98
|
+
try {
|
|
99
|
+
let e = l({
|
|
100
|
+
model: d.languageModel,
|
|
101
|
+
providerOptions: d.providerOptions,
|
|
102
|
+
instructions: f.systemPrompt,
|
|
103
|
+
messages: [...m, n],
|
|
104
|
+
tools: r?.tools ?? p,
|
|
105
|
+
stopWhen: u(16),
|
|
106
|
+
abortSignal: o ? a.signal : i,
|
|
107
|
+
prepareStep: ({ stepNumber: e }) => e === 15 ? { toolChoice: "none" } : void 0
|
|
108
|
+
});
|
|
109
|
+
for await (let t of e.stream) if (t.type === "text-delta") s({
|
|
110
|
+
type: "text",
|
|
111
|
+
text: t.text
|
|
112
|
+
});
|
|
113
|
+
else if (t.type === "tool-call") s({
|
|
114
|
+
type: "activity",
|
|
115
|
+
text: t.toolName
|
|
116
|
+
});
|
|
117
|
+
else {
|
|
118
|
+
if (t.type === "error") throw t.error;
|
|
119
|
+
if (t.type === "abort" && o) throw a.signal.reason ?? /* @__PURE__ */ Error("Turn aborted");
|
|
120
|
+
}
|
|
121
|
+
if (o && a.signal.aborted) throw a.signal.reason;
|
|
122
|
+
m.push(n, ...await e.responseMessages), s({ type: "done" });
|
|
123
|
+
} catch (e) {
|
|
124
|
+
let t = r?.summary();
|
|
125
|
+
t && m.push(n, {
|
|
126
|
+
role: "assistant",
|
|
127
|
+
content: t
|
|
128
|
+
}), s({
|
|
129
|
+
type: "error",
|
|
130
|
+
text: `The planning assistant failed: ${e instanceof Error ? e.message : String(e)}${t ? `\n\n${t}` : ""}`
|
|
131
|
+
});
|
|
132
|
+
} finally {
|
|
133
|
+
clearTimeout(h), i.removeEventListener("abort", c);
|
|
134
|
+
}
|
|
135
|
+
}, s({
|
|
136
|
+
type: "images",
|
|
137
|
+
enabled: t.readsImages
|
|
138
|
+
}), s({
|
|
139
|
+
type: "availability",
|
|
140
|
+
available: !0
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
export { r as n, t as r, i as t };
|
package/roomle-embedding-lib.js
CHANGED
|
@@ -101,6 +101,8 @@ var t = class {
|
|
|
101
101
|
theme: "scandinavian",
|
|
102
102
|
density: "balanced",
|
|
103
103
|
light: "soft",
|
|
104
|
+
birdsEyeView: "adjust",
|
|
105
|
+
debug: !1,
|
|
104
106
|
stage: "alpha"
|
|
105
107
|
}, d = {
|
|
106
108
|
mobileLandscape: !0,
|
|
@@ -201,7 +203,7 @@ var t = class {
|
|
|
201
203
|
setupPlugins(e, t, n = "website") {
|
|
202
204
|
for (let r of e) typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(new Promise((e, r) => {
|
|
203
205
|
try {
|
|
204
|
-
import("./drag-in-
|
|
206
|
+
import("./drag-in-QhL3zGC0.mjs").then((e) => e.n).then(({ DragIn: i }) => {
|
|
205
207
|
let a = new i(this.ui, t, n, this.viewName);
|
|
206
208
|
a.init().then(() => {
|
|
207
209
|
this.plugins.dragIn = a, e();
|
|
@@ -107,6 +107,8 @@ var t = class {
|
|
|
107
107
|
theme: "scandinavian",
|
|
108
108
|
density: "balanced",
|
|
109
109
|
light: "soft",
|
|
110
|
+
birdsEyeView: "adjust",
|
|
111
|
+
debug: !1,
|
|
110
112
|
stage: "alpha"
|
|
111
113
|
},
|
|
112
114
|
configuratorZoom: !1,
|
|
@@ -182,7 +184,7 @@ var t = class {
|
|
|
182
184
|
setupPlugins(e, t, n = "website") {
|
|
183
185
|
for (let r of e) typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(new Promise((e, r) => {
|
|
184
186
|
try {
|
|
185
|
-
import("./drag-in-
|
|
187
|
+
import("./drag-in-BP_E53zb.mjs").then((e) => e.n).then(({ DragIn: i }) => {
|
|
186
188
|
let a = new i(this.ui, t, n, this.viewName);
|
|
187
189
|
a.init().then(() => {
|
|
188
190
|
this.plugins.dragIn = a, e();
|
|
File without changes
|
|
File without changes
|