@roomle/embedding-lib 11.0.0-alpha.12 → 11.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/THIRD-PARTY-NOTICES.txt +2 -2
  2. package/ai-model-host-CaiYrZkh.mjs +152 -0
  3. package/ai-model-host-HAJONHCj.mjs +156 -0
  4. package/ai.js +1 -128
  5. package/ai.min.js +1 -127
  6. package/chat-model-DooKwd8I.mjs +117 -0
  7. package/chat-model-KHuz1Ej9.mjs +118 -0
  8. package/configurator.js +2 -2
  9. package/configurator.min.js +2 -2
  10. package/construction.js +17718 -162
  11. package/construction.min.js +17397 -177
  12. package/docs/md/web/embedding/CHANGELOG.md +4 -4
  13. package/hi.js +91 -393
  14. package/hi.min.js +88 -351
  15. package/{mcp-tools-BLB7pCga.mjs → mcp-tools-C6O2gQZW.mjs} +0 -1
  16. package/{mcp-tools-BirFT2R0.mjs → mcp-tools-m_3IX0vB.mjs} +0 -1
  17. package/package.json +1 -1
  18. package/packages/common/src/utils/ai-model-relay.d.ts +1 -1
  19. package/packages/embedding-lib/src/ai-model-host.d.ts +36 -0
  20. package/packages/embedding-lib/src/ai.d.ts +11 -27
  21. package/packages/embedding-lib/src/hi.d.ts +1 -0
  22. package/packages/embedding-lib/src/homag-intelligence/decisions.d.ts +7 -0
  23. package/packages/embedding-lib/src/homag-intelligence/hi-model-proxy.d.ts +4 -1
  24. package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +9 -19
  25. package/packages/web-sdk/packages/assistant.d.ts +2 -1
  26. package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-recovery.d.ts +5 -1
  27. package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -3
  28. package/packages/web-sdk/packages/common-core/src/planning-assistant/usage.d.ts +31 -0
  29. package/roomle-embedding-lib.js +37 -37
  30. package/roomle-embedding-lib.min.js +30 -30
  31. package/sbom.cdx.json +5 -5
  32. package/usage-C3HE9yXi.mjs +33 -0
  33. package/usage-CYqDPQOx.mjs +34 -0
  34. package/chat-model-B7BO8IhK.mjs +0 -212
  35. package/chat-model-XYf503pT.mjs +0 -213
  36. package/continuation-CswXtOus.mjs +0 -10
  37. package/continuation-NclHDSgS.mjs +0 -9
  38. package/dist-BZSd56sr.mjs +0 -17422
  39. package/dist-S9sLSjZ4.mjs +0 -17087
  40. package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +0 -54
  41. package/turn-limits-9LbUeSG2.mjs +0 -9
  42. package/turn-limits-Ciq383Bd.mjs +0 -10
@@ -0,0 +1,118 @@
1
+
2
+ // packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.ts
3
+ var e = (e) => e.flatMap((e) => {
4
+ if (e.role !== "tool") return [e];
5
+ let t = [], n = e.content.map((e) => {
6
+ if (e.type !== "tool-result" || e.output.type !== "content") return e;
7
+ let n = e.output.value.filter((e) => e.type === "file");
8
+ return n.length ? (t.push(...n), {
9
+ ...e,
10
+ output: {
11
+ ...e.output,
12
+ value: [...e.output.value.filter((e) => e.type !== "file"), {
13
+ type: "text",
14
+ text: "The images of this result follow in the next message."
15
+ }]
16
+ }
17
+ }) : e;
18
+ });
19
+ return t.length ? [{
20
+ ...e,
21
+ content: n
22
+ }, {
23
+ role: "user",
24
+ content: t
25
+ }] : [e];
26
+ }), t = (t) => ({
27
+ specificationVersion: t.specificationVersion,
28
+ provider: t.provider,
29
+ modelId: t.modelId,
30
+ supportedUrls: t.supportedUrls,
31
+ doGenerate: (n) => t.doGenerate({
32
+ ...n,
33
+ prompt: e(n.prompt)
34
+ }),
35
+ doStream: (n) => t.doStream({
36
+ ...n,
37
+ prompt: e(n.prompt)
38
+ })
39
+ }), n = async ({ provider: e, model: n, apiKey: r, baseUrl: i, headers: a, chatCompletions: o, responses: s, storedResponses: c, reasoningEffort: l }, u, d) => {
40
+ let f = u ? { fetch: new Proxy(fetch, { apply: async (e, t, n) => (typeof n[1]?.body == "string" && await u(n[1].body), fetch(...n)) }) } : {};
41
+ switch (e) {
42
+ case "host":
43
+ if (!d) throw Error("The host assistant model is unavailable.");
44
+ return { languageModel: d };
45
+ case "openai": {
46
+ let { createOpenAI: e } = await import("./dist-DjsS42rR.mjs");
47
+ return { languageModel: e({
48
+ apiKey: r,
49
+ ...f
50
+ })(n) };
51
+ }
52
+ case "azure": {
53
+ let { createAzure: e } = await import("./dist-bQAJDeYc.mjs"), t = e({
54
+ apiKey: r,
55
+ baseURL: i,
56
+ ...f
57
+ });
58
+ return {
59
+ languageModel: o ? t.chat(n) : t(n),
60
+ providerOptions: l ? { azure: { reasoningEffort: l } } : void 0
61
+ };
62
+ }
63
+ case "openai-compatible": {
64
+ if (!i) throw Error("The provider \"openai-compatible\" needs a baseUrl");
65
+ if (s) {
66
+ let { createOpenAI: e } = await import("./dist-DjsS42rR.mjs"), t = {
67
+ ...!r && !a?.Authorization ? { Authorization: void 0 } : {},
68
+ ...a
69
+ };
70
+ return {
71
+ languageModel: e({
72
+ baseURL: i,
73
+ apiKey: r ?? "none",
74
+ headers: t,
75
+ ...f
76
+ }).responses(n),
77
+ providerOptions: { openai: c ? { store: !0 } : {
78
+ store: !1,
79
+ forceReasoning: !0
80
+ } }
81
+ };
82
+ }
83
+ let { createOpenAICompatible: e } = await import("./dist-BU022PnG.mjs");
84
+ return { languageModel: t(e({
85
+ name: "openai-compatible",
86
+ baseURL: i,
87
+ apiKey: r,
88
+ headers: a,
89
+ includeUsage: !0,
90
+ ...f
91
+ })(n)) };
92
+ }
93
+ case "mistral": {
94
+ let { createMistral: e } = await import("./dist-a5_BIeaS.mjs");
95
+ return { languageModel: t(e({
96
+ apiKey: r,
97
+ ...f
98
+ })(n)) };
99
+ }
100
+ case "anthropic": {
101
+ let { createAnthropic: e } = await import("./dist-CbQKC1xX.mjs");
102
+ return { languageModel: e({
103
+ apiKey: r,
104
+ headers: { "anthropic-dangerous-direct-browser-access": "true" },
105
+ ...f
106
+ })(n) };
107
+ }
108
+ case "google": {
109
+ let { createGoogleGenerativeAI: e } = await import("./dist-7-X7Xqsl.mjs");
110
+ return { languageModel: e({
111
+ apiKey: r,
112
+ ...f
113
+ })(n) };
114
+ }
115
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
116
+ }
117
+ };
118
+ export { n as t };
package/configurator.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { t as e } from "./mcp-tools-BLB7pCga.mjs";
3
- import { n as t } from "./chat-model-XYf503pT.mjs";
2
+ import { t as e } from "./mcp-tools-C6O2gQZW.mjs";
3
+ import { t } from "./chat-model-KHuz1Ej9.mjs";
4
4
  // packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.ts
5
5
  var n = async (t) => {
6
6
  if (typeof t.getConfiguratorAgentTools != "function" || typeof t.callConfiguratorAgentTool != "function") throw Error("Update the Rubens UI: configurator agent tools are unavailable.");
@@ -1,6 +1,6 @@
1
1
  /*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
2
- import { t as e } from "./mcp-tools-BirFT2R0.mjs";
3
- import { n as t } from "./chat-model-B7BO8IhK.mjs";
2
+ import { t as e } from "./mcp-tools-m_3IX0vB.mjs";
3
+ import { t } from "./chat-model-DooKwd8I.mjs";
4
4
  var n = async (t) => {
5
5
  if (typeof t.getConfiguratorAgentTools != "function" || typeof t.callConfiguratorAgentTool != "function") throw Error("Update the Rubens UI: configurator agent tools are unavailable.");
6
6
  return e(await t.getConfiguratorAgentTools(), (e, n) => t.callConfiguratorAgentTool(e, n), "configurator-mcp");