@roomle/embedding-lib 0.0.0-dev-1bd05f2 → 0.0.0-dev-7e3cd4b

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 (60) hide show
  1. package/THIRD-PARTY-NOTICES.txt +554 -2
  2. package/coerce-CqJod_GZ.mjs +8 -0
  3. package/coerce-CsI42_k0.mjs +6 -0
  4. package/configurator.d.ts +2 -0
  5. package/configurator.js +29 -0
  6. package/configurator.min.js +27 -0
  7. package/dist-5jYYtT4q.mjs +8216 -0
  8. package/dist-B9yy8ym8.mjs +5512 -0
  9. package/dist-BV-32IEX.mjs +8128 -0
  10. package/dist-Bb2L1Zel.mjs +6045 -0
  11. package/dist-Bo3WzRdf.mjs +6223 -0
  12. package/dist-Bt1FopV4.mjs +7594 -0
  13. package/dist-C5fKJXpB.mjs +5598 -0
  14. package/dist-COgAdYY1.mjs +7554 -0
  15. package/dist-CXemOs84.mjs +849 -0
  16. package/dist-CqP0aX0A.mjs +866 -0
  17. package/dist-CqpDM10w.mjs +1179 -0
  18. package/dist-D0kh4WfT.mjs +7721 -0
  19. package/dist-D5HdKuwj.mjs +1221 -0
  20. package/dist-DJtonrDM.mjs +16906 -0
  21. package/dist-GTk8ppiK.mjs +8380 -0
  22. package/dist-XEy6Tk_Y.mjs +17341 -0
  23. package/{drag-ghost-DRJqglR4.mjs → drag-ghost-D7FnWbO4.mjs} +1 -1
  24. package/{drag-ghost-DvNl926o.mjs → drag-ghost-yXe7c8jA.mjs} +1 -1
  25. package/{drag-in-O6toxxkY.mjs → drag-in-BiEe2Lgv.mjs} +14 -20
  26. package/{drag-in-D_heMFxk.mjs → drag-in-t7T6Pqwc.mjs} +9 -15
  27. package/embedding-plugins.js +1 -1
  28. package/embedding-plugins.min.js +1 -1
  29. package/experimental-evaluation-BgWFolud.mjs +1074 -0
  30. package/experimental-evaluation-D56MbtjO.mjs +970 -0
  31. package/{from-custom-view-CnUFpf6f.mjs → from-custom-view-CTBapIc6.mjs} +30 -30
  32. package/{from-custom-view-DsDwSZTY.mjs → from-custom-view-xbjgsLll.mjs} +31 -31
  33. package/{from-website-bTi4qNXt.mjs → from-website-DUPMQPl6.mjs} +23 -23
  34. package/{from-website-Csj57D58.mjs → from-website-JwG7Ic_U.mjs} +23 -23
  35. package/hi.js +128 -295
  36. package/hi.min.js +118 -261
  37. package/mcp-tools-Cnhgobge.mjs +153 -0
  38. package/mcp-tools-D3Ei3Apu.mjs +151 -0
  39. package/package.json +12 -1
  40. package/packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.d.ts +4 -0
  41. package/packages/embedding-lib/src/configurator-agent/configurator-planning-assistant.d.ts +13 -0
  42. package/packages/embedding-lib/src/configurator.d.ts +3 -0
  43. package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +4 -61
  44. package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +2 -48
  45. package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +1 -0
  46. package/packages/embedding-lib/src/planning-assistant/mcp-tools.d.ts +2 -0
  47. package/packages/web-sdk/packages/assistant.d.ts +3 -0
  48. package/packages/web-sdk/packages/common-core/src/agent-tools/mcp-tool-types.d.ts +30 -0
  49. package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.d.ts +8 -0
  50. package/packages/web-sdk/packages/common-core/src/planning-assistant/mcp-tools.d.ts +52 -0
  51. package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +35 -0
  52. package/roomle-embedding-lib.js +42 -45
  53. package/roomle-embedding-lib.min.js +38 -41
  54. package/sbom.cdx.json +363 -5
  55. /package/{browser-BjtSrqbu.mjs → browser-D6As4Zxr.mjs} +0 -0
  56. /package/{browser-D6M-d6y5.mjs → browser-zrjtYpL8.mjs} +0 -0
  57. /package/{comlink-CR7SvKHo.mjs → comlink-Cmiqa2s0.mjs} +0 -0
  58. /package/{comlink-BwWPcVOp.mjs → comlink-Dc3LZUoi.mjs} +0 -0
  59. /package/{utils-BoELtcEK.mjs → utils-CAAGdgk8.mjs} +0 -0
  60. /package/{utils-BwWn6Fw4.mjs → utils-WeolMfC5.mjs} +0 -0
@@ -0,0 +1,153 @@
1
+
2
+ //#region packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.ts
3
+ var e = "The images of this result follow in the next message.", t = (t) => t.flatMap((t) => {
4
+ if (t.role !== "tool") return [t];
5
+ let n = [], r = t.content.map((t) => {
6
+ if (t.type !== "tool-result" || t.output.type !== "content") return t;
7
+ let r = t.output.value.filter((e) => e.type === "file");
8
+ return r.length ? (n.push(...r), {
9
+ ...t,
10
+ output: {
11
+ ...t.output,
12
+ value: [...t.output.value.filter((e) => e.type !== "file"), {
13
+ type: "text",
14
+ text: e
15
+ }]
16
+ }
17
+ }) : t;
18
+ });
19
+ return n.length ? [{
20
+ ...t,
21
+ content: r
22
+ }, {
23
+ role: "user",
24
+ content: n
25
+ }] : [t];
26
+ }), n = (e) => ({
27
+ specificationVersion: e.specificationVersion,
28
+ provider: e.provider,
29
+ modelId: e.modelId,
30
+ supportedUrls: e.supportedUrls,
31
+ doGenerate: (n) => e.doGenerate({
32
+ ...n,
33
+ prompt: t(n.prompt)
34
+ }),
35
+ doStream: (n) => e.doStream({
36
+ ...n,
37
+ prompt: t(n.prompt)
38
+ })
39
+ }), r = async ({ provider: e, model: t, apiKey: r, baseUrl: i, headers: a, chatCompletions: o, responses: s, reasoningEffort: c }, l) => {
40
+ let u = l ? { fetch: new Proxy(fetch, { apply: async (e, t, n) => (typeof n[1]?.body == "string" && await l(n[1].body), fetch(...n)) }) } : {};
41
+ switch (e) {
42
+ case "openai": {
43
+ let { createOpenAI: e } = await import("./dist-GTk8ppiK.mjs");
44
+ return { languageModel: e({
45
+ apiKey: r,
46
+ ...u
47
+ })(t) };
48
+ }
49
+ case "azure": {
50
+ let { createAzure: e } = await import("./dist-D0kh4WfT.mjs"), n = e({
51
+ apiKey: r,
52
+ baseURL: i,
53
+ ...u
54
+ });
55
+ return {
56
+ languageModel: o ? n.chat(t) : n(t),
57
+ providerOptions: c ? { azure: { reasoningEffort: c } } : void 0
58
+ };
59
+ }
60
+ case "openai-compatible": {
61
+ if (!i) throw Error("The provider \"openai-compatible\" needs a baseUrl");
62
+ if (s) {
63
+ let { createOpenAI: e } = await import("./dist-GTk8ppiK.mjs"), n = {
64
+ ...!r && !a?.Authorization ? { Authorization: void 0 } : {},
65
+ ...a
66
+ };
67
+ return {
68
+ languageModel: e({
69
+ baseURL: i,
70
+ apiKey: r ?? "none",
71
+ headers: n,
72
+ ...u
73
+ }).responses(t),
74
+ providerOptions: { openai: {
75
+ store: !1,
76
+ forceReasoning: !0
77
+ } }
78
+ };
79
+ }
80
+ let { createOpenAICompatible: e } = await import("./dist-D5HdKuwj.mjs");
81
+ return { languageModel: n(e({
82
+ name: "openai-compatible",
83
+ baseURL: i,
84
+ apiKey: r,
85
+ headers: a,
86
+ includeUsage: !0,
87
+ ...u
88
+ })(t)) };
89
+ }
90
+ case "mistral": {
91
+ let { createMistral: e } = await import("./dist-CqP0aX0A.mjs");
92
+ return { languageModel: n(e({
93
+ apiKey: r,
94
+ ...u
95
+ })(t)) };
96
+ }
97
+ case "anthropic": {
98
+ let { createAnthropic: e } = await import("./dist-C5fKJXpB.mjs");
99
+ return { languageModel: e({
100
+ apiKey: r,
101
+ headers: { "anthropic-dangerous-direct-browser-access": "true" },
102
+ ...u
103
+ })(t) };
104
+ }
105
+ case "google": {
106
+ let { createGoogleGenerativeAI: e } = await import("./dist-Bo3WzRdf.mjs");
107
+ return { languageModel: e({
108
+ apiKey: r,
109
+ ...u
110
+ })(t) };
111
+ }
112
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
113
+ }
114
+ }, i = ({ output: e }) => ({
115
+ type: "content",
116
+ value: e.content.map((e) => e.type === "text" ? {
117
+ type: "text",
118
+ text: e.text
119
+ } : {
120
+ type: "file",
121
+ mediaType: e.mimeType,
122
+ data: {
123
+ type: "data",
124
+ data: e.data
125
+ }
126
+ })
127
+ }), a = (e, t, n) => Object.fromEntries(e.map(({ name: e, description: r, inputSchema: a, annotations: o }) => {
128
+ let s = () => a;
129
+ return [e, {
130
+ type: "dynamic",
131
+ ...o && { annotations: o },
132
+ description: r,
133
+ inputSchema: { "~standard": {
134
+ version: 1,
135
+ vendor: n,
136
+ validate: (e) => ({ value: e }),
137
+ jsonSchema: {
138
+ input: s,
139
+ output: s
140
+ }
141
+ } },
142
+ execute: (n) => t(e, n).catch((e) => ({
143
+ content: [{
144
+ type: "text",
145
+ text: e instanceof Error ? e.message : String(e)
146
+ }],
147
+ isError: !0
148
+ })),
149
+ toModelOutput: i
150
+ }];
151
+ }));
152
+ //#endregion
153
+ export { r as n, a as t };
@@ -0,0 +1,151 @@
1
+
2
+ var e = (e) => e.flatMap((e) => {
3
+ if (e.role !== "tool") return [e];
4
+ let t = [], n = e.content.map((e) => {
5
+ if (e.type !== "tool-result" || e.output.type !== "content") return e;
6
+ let n = e.output.value.filter((e) => e.type === "file");
7
+ return n.length ? (t.push(...n), {
8
+ ...e,
9
+ output: {
10
+ ...e.output,
11
+ value: [...e.output.value.filter((e) => e.type !== "file"), {
12
+ type: "text",
13
+ text: "The images of this result follow in the next message."
14
+ }]
15
+ }
16
+ }) : e;
17
+ });
18
+ return t.length ? [{
19
+ ...e,
20
+ content: n
21
+ }, {
22
+ role: "user",
23
+ content: t
24
+ }] : [e];
25
+ }), t = (t) => ({
26
+ specificationVersion: t.specificationVersion,
27
+ provider: t.provider,
28
+ modelId: t.modelId,
29
+ supportedUrls: t.supportedUrls,
30
+ doGenerate: (n) => t.doGenerate({
31
+ ...n,
32
+ prompt: e(n.prompt)
33
+ }),
34
+ doStream: (n) => t.doStream({
35
+ ...n,
36
+ prompt: e(n.prompt)
37
+ })
38
+ }), n = async ({ provider: e, model: n, apiKey: r, baseUrl: i, headers: a, chatCompletions: o, responses: s, reasoningEffort: c }, l) => {
39
+ let u = l ? { fetch: new Proxy(fetch, { apply: async (e, t, n) => (typeof n[1]?.body == "string" && await l(n[1].body), fetch(...n)) }) } : {};
40
+ switch (e) {
41
+ case "openai": {
42
+ let { createOpenAI: e } = await import("./dist-5jYYtT4q.mjs");
43
+ return { languageModel: e({
44
+ apiKey: r,
45
+ ...u
46
+ })(n) };
47
+ }
48
+ case "azure": {
49
+ let { createAzure: e } = await import("./dist-COgAdYY1.mjs"), t = e({
50
+ apiKey: r,
51
+ baseURL: i,
52
+ ...u
53
+ });
54
+ return {
55
+ languageModel: o ? t.chat(n) : t(n),
56
+ providerOptions: c ? { azure: { reasoningEffort: c } } : void 0
57
+ };
58
+ }
59
+ case "openai-compatible": {
60
+ if (!i) throw Error("The provider \"openai-compatible\" needs a baseUrl");
61
+ if (s) {
62
+ let { createOpenAI: e } = await import("./dist-5jYYtT4q.mjs");
63
+ return {
64
+ languageModel: e({
65
+ baseURL: i,
66
+ apiKey: r ?? "none",
67
+ headers: {
68
+ ...r || a?.Authorization ? {} : { Authorization: void 0 },
69
+ ...a
70
+ },
71
+ ...u
72
+ }).responses(n),
73
+ providerOptions: { openai: {
74
+ store: !1,
75
+ forceReasoning: !0
76
+ } }
77
+ };
78
+ }
79
+ let { createOpenAICompatible: e } = await import("./dist-CqpDM10w.mjs");
80
+ return { languageModel: t(e({
81
+ name: "openai-compatible",
82
+ baseURL: i,
83
+ apiKey: r,
84
+ headers: a,
85
+ includeUsage: !0,
86
+ ...u
87
+ })(n)) };
88
+ }
89
+ case "mistral": {
90
+ let { createMistral: e } = await import("./dist-CXemOs84.mjs");
91
+ return { languageModel: t(e({
92
+ apiKey: r,
93
+ ...u
94
+ })(n)) };
95
+ }
96
+ case "anthropic": {
97
+ let { createAnthropic: e } = await import("./dist-B9yy8ym8.mjs");
98
+ return { languageModel: e({
99
+ apiKey: r,
100
+ headers: { "anthropic-dangerous-direct-browser-access": "true" },
101
+ ...u
102
+ })(n) };
103
+ }
104
+ case "google": {
105
+ let { createGoogleGenerativeAI: e } = await import("./dist-Bb2L1Zel.mjs");
106
+ return { languageModel: e({
107
+ apiKey: r,
108
+ ...u
109
+ })(n) };
110
+ }
111
+ default: throw Error(`Unknown provider "${e}" - supported: azure, openai, openai-compatible, mistral, anthropic, google`);
112
+ }
113
+ }, r = ({ output: e }) => ({
114
+ type: "content",
115
+ value: e.content.map((e) => e.type === "text" ? {
116
+ type: "text",
117
+ text: e.text
118
+ } : {
119
+ type: "file",
120
+ mediaType: e.mimeType,
121
+ data: {
122
+ type: "data",
123
+ data: e.data
124
+ }
125
+ })
126
+ }), i = (e, t, n) => Object.fromEntries(e.map(({ name: e, description: i, inputSchema: a, annotations: o }) => {
127
+ let s = () => a;
128
+ return [e, {
129
+ type: "dynamic",
130
+ ...o && { annotations: o },
131
+ description: i,
132
+ inputSchema: { "~standard": {
133
+ version: 1,
134
+ vendor: n,
135
+ validate: (e) => ({ value: e }),
136
+ jsonSchema: {
137
+ input: s,
138
+ output: s
139
+ }
140
+ } },
141
+ execute: (n) => t(e, n).catch((e) => ({
142
+ content: [{
143
+ type: "text",
144
+ text: e instanceof Error ? e.message : String(e)
145
+ }],
146
+ isError: !0
147
+ })),
148
+ toModelOutput: r
149
+ }];
150
+ }));
151
+ export { n, i as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "0.0.0-dev-1bd05f2",
3
+ "version": "0.0.0-dev-7e3cd4b",
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",
@@ -29,6 +29,13 @@
29
29
  },
30
30
  "./plugins/min": {
31
31
  "import": "./embedding-plugins.min.js"
32
+ },
33
+ "./configurator": {
34
+ "import": "./configurator.js",
35
+ "types": "./configurator.d.ts"
36
+ },
37
+ "./configurator/min": {
38
+ "import": "./configurator.min.js"
32
39
  }
33
40
  },
34
41
  "scripts": {
@@ -38,6 +45,10 @@
38
45
  "node": "18.18.0",
39
46
  "npm": "8.3.1"
40
47
  },
48
+ "dependencies": {
49
+ "@ai-sdk/provider": "4.0.19",
50
+ "@types/json-schema": "7.0.15"
51
+ },
41
52
  "repository": {
42
53
  "type": "git",
43
54
  "url": "git+https://github.com/roomle-build/npm-packages.git"
@@ -0,0 +1,4 @@
1
+ import { ConfiguratorAgentApi } from '../../../web-sdk/packages/assistant';
2
+ export type { ConfiguratorAgentApi } from '../../../web-sdk/packages/assistant';
3
+ /** The native configurator's agent tools forwarded through the embedding bridge. */
4
+ export declare const createConfiguratorMcpTools: (api: ConfiguratorAgentApi) => Promise<import('../../../web-sdk/packages/assistant').AgentMcpTools>;
@@ -0,0 +1,13 @@
1
+ import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
2
+ import { ConfiguratorAgentApi } from './configurator-mcp-tools';
3
+ import { PlanningAssistantOutput } from '../../../web-sdk/packages';
4
+ interface AssistantWindow {
5
+ startConfigurationAssistant(config: PlanningAssistantConfig, owner: string): Promise<void>;
6
+ stopConfigurationAssistant(owner: string): Promise<void>;
7
+ planningAssistantOutput(part: PlanningAssistantOutput): unknown;
8
+ }
9
+ export declare const startConfiguratorPlanningAssistant: (endpoints: {
10
+ configurator: ConfiguratorAgentApi;
11
+ window: AssistantWindow;
12
+ }, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<void>;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ export { createConfiguratorMcpTools, type ConfiguratorAgentApi, } from './configurator-agent/configurator-mcp-tools';
2
+ export { startConfiguratorPlanningAssistant } from './configurator-agent/configurator-planning-assistant';
3
+ export { loadChatModel, type PlanningAssistantConfig, } from './planning-assistant/chat-model';
@@ -1,68 +1,11 @@
1
1
  import { HiAgentToolDefinition, McpToolResult } from '../../../web-sdk/packages';
2
- /** What the model gets of a tool result, as `@ai-sdk/mcp` hands it to the AI SDK. */
3
- export interface HiMcpModelOutput {
4
- type: 'content';
5
- value: ({
6
- type: 'text';
7
- text: string;
8
- } | {
9
- type: 'file';
10
- mediaType: string;
11
- data: {
12
- type: 'data';
13
- data: string;
14
- };
15
- })[];
16
- }
17
- /** The input schema of a tool as a Standard Schema with its JSON Schema. */
18
- export interface HiMcpInputSchema {
19
- '~standard': {
20
- version: 1;
21
- vendor: string;
22
- validate: (value: unknown) => {
23
- value: unknown;
24
- };
25
- jsonSchema: {
26
- input: (options: {
27
- target: string;
28
- }) => Record<string, unknown>;
29
- output: (options: {
30
- target: string;
31
- }) => Record<string, unknown>;
32
- };
33
- };
34
- }
35
- /** A tool of the HI MCP tool set, in the shape of an AI SDK dynamic tool. */
36
- export interface HiMcpTool {
37
- type: 'dynamic';
38
- description: string;
39
- inputSchema: HiMcpInputSchema;
40
- execute: (input: unknown) => Promise<McpToolResult>;
41
- toModelOutput: (options: {
42
- output: McpToolResult;
43
- }) => HiMcpModelOutput;
44
- }
45
- /** The HI MCP tools by name, the tool set an AI SDK `streamText` takes. */
46
- export type HiMcpTools = Record<string, HiMcpTool>;
47
- /** The planner methods the HI MCP tools forward to: the HI agent tools of the planner. */
2
+ export { mcpToModelOutput } from '../planning-assistant/mcp-tools';
3
+ export type { AgentMcpTool as HiMcpTool, AgentMcpTools as HiMcpTools, AgentMcpModelOutput as HiMcpModelOutput, AgentMcpInputSchema as HiMcpInputSchema, } from '../planning-assistant/mcp-tools';
48
4
  export interface HiMcpPlannerApi {
49
5
  extended: {
50
6
  getExternalObjectAgentTools(): Promise<HiAgentToolDefinition[]>;
51
7
  callExternalObjectAgentTool(name: string, input: unknown): Promise<McpToolResult>;
52
8
  };
53
9
  }
54
- /** The tool result as `@ai-sdk/mcp` passes it to the model: text parts and images as file parts. */
55
- export declare const mcpToModelOutput: ({ output, }: {
56
- output: McpToolResult;
57
- }) => HiMcpModelOutput;
58
- /**
59
- * Creates the HI MCP tools for an AI agent that plans in the planner of this
60
- * page: the HI agent tools of the planner as an AI SDK tool set, without the
61
- * MCP protocol. The host passes the tool set as `tools` to its own
62
- * `streamText`. The tools run in the planner; every call is forwarded to
63
- * `callExternalObjectAgentTool`. The AI SDK gets the JSON Schema of each input
64
- * and lets every input through: the planner validates it and answers an
65
- * invalid input and a failed call as an MCP error result (`isError`), as a
66
- * forwarding error is answered here.
67
- */
68
- export declare const createHiMcpTools: ({ extended, }: HiMcpPlannerApi) => Promise<HiMcpTools>;
10
+ /** The planner's HI agent tools, forwarded through the embedding bridge. */
11
+ export declare const createHiMcpTools: ({ extended }: HiMcpPlannerApi) => Promise<import('../../../web-sdk/packages/assistant').AgentMcpTools>;
@@ -1,31 +1,7 @@
1
1
  import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
2
2
  import { HiMcpPlannerApi } from './hi-mcp-tools';
3
- /**
4
- * The model of the AI Planning Assistant as a JSON object: everything
5
- * `loadChatModel` and `startPlanningAssistant` need to reach it.
6
- */
7
- export interface PlanningAssistantConfig {
8
- /** `azure` for a deployment on an Azure AI Foundry resource, `openai-compatible` for an endpoint that speaks OpenAI Chat Completions or, with `responses`, stateless OpenAI Responses (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
- model: string;
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` (or `/responses`). */
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>;
18
- /** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
19
- chatCompletions?: boolean;
20
- /** `openai-compatible` only: call `<baseUrl>/responses` instead of `<baseUrl>/chat/completions`, stateless (`store: false`, the whole history in every request, the reasoning carried encrypted) — for a proxy whose reasoning model takes function tools through the Responses API only. */
21
- responses?: boolean;
22
- /** `azure` only: the reasoning effort of the deployment; its default when unset. */
23
- reasoningEffort?: string;
24
- /** Azure Responses only: mark the library prefix for caching on a deployment verified to support explicit breakpoints. */
25
- referenceCacheBreakpoint?: boolean;
26
- /** Whether the model reads images: the window offers the image drop only then. */
27
- readsImages: boolean;
28
- }
3
+ import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
4
+ export { loadChatModel, type PlanningAssistantConfig, } from '../planning-assistant/chat-model';
29
5
  /** The planner the planning assistant runs in: the HI MCP tools' planner API, the agent prompts and the window. */
30
6
  export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
31
7
  extended: {
@@ -46,28 +22,6 @@ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
46
22
  };
47
23
  };
48
24
  };
49
- /** The AI SDK language model of the config and the provider options `streamText` takes with it. */
50
- export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, headers, chatCompletions, responses, reasoningEffort, }: PlanningAssistantConfig, observeRequest?: (body: string) => Promise<void>) => Promise<{
51
- languageModel: any;
52
- providerOptions?: undefined;
53
- } | {
54
- languageModel: any;
55
- providerOptions: {
56
- azure: {
57
- reasoningEffort: string;
58
- };
59
- openai?: undefined;
60
- };
61
- } | {
62
- languageModel: any;
63
- providerOptions: {
64
- openai: {
65
- store: boolean;
66
- forceReasoning: boolean;
67
- };
68
- azure?: undefined;
69
- };
70
- }>;
71
25
  /**
72
26
  * Runs the planning agent of the AI Planning Assistant window
73
27
  * (featureFlags.planningAssistant) in this page: the window hands every
@@ -0,0 +1 @@
1
+ export { loadChatModel, type PlanningAssistantConfig, } from '../../../web-sdk/packages/assistant';
@@ -0,0 +1,2 @@
1
+ export { createAgentMcpTools, mcpToModelOutput, } from '../../../web-sdk/packages/assistant';
2
+ export type { AgentMcpTools, AgentMcpTool, AgentMcpInputSchema, AgentMcpModelOutput, } from '../../../web-sdk/packages/assistant';
@@ -0,0 +1,3 @@
1
+ export { loadChatModel } from './common-core/src/planning-assistant/chat-model';
2
+ export type { PlanningAssistantConfig, ConfiguratorAgentApi, } from './common-core/src/planning-assistant/types';
3
+ export * from './common-core/src/planning-assistant/mcp-tools';
@@ -0,0 +1,30 @@
1
+ /** The result of a tool as an MCP server answers `tools/call`. */
2
+ export interface McpToolResult {
3
+ content: Array<{
4
+ type: 'text';
5
+ text: string;
6
+ } | {
7
+ type: 'image';
8
+ data: string;
9
+ mimeType: string;
10
+ }>;
11
+ isError?: boolean;
12
+ }
13
+ /** A tool of the agent tools as an MCP server lists it in `tools/list`: its input schema is a JSON Schema. */
14
+ export interface AgentToolDefinition {
15
+ name: string;
16
+ description: string;
17
+ inputSchema: Record<string, unknown>;
18
+ annotations?: {
19
+ readOnlyHint?: boolean;
20
+ destructiveHint?: boolean;
21
+ idempotentHint?: boolean;
22
+ openWorldHint?: boolean;
23
+ };
24
+ }
25
+ /** A tool of the agent tools in the planner: its description, the JSON Schema of its input and the call. */
26
+ export interface AgentTool extends Omit<AgentToolDefinition, 'name'> {
27
+ execute: (input: unknown) => Promise<McpToolResult>;
28
+ }
29
+ /** The agent tools by name. */
30
+ export type AgentTools = Record<string, AgentTool>;
@@ -0,0 +1,8 @@
1
+ import { LanguageModelV4, SharedV4ProviderOptions } from '@ai-sdk/provider';
2
+ import { PlanningAssistantConfig } from './types';
3
+ export type { PlanningAssistantConfig } from './types';
4
+ /** The AI SDK language model of the config and the provider options `streamText` takes with it. */
5
+ export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, headers, chatCompletions, responses, reasoningEffort, }: PlanningAssistantConfig, observeRequest?: (body: string) => Promise<void>) => Promise<{
6
+ languageModel: LanguageModelV4;
7
+ providerOptions?: SharedV4ProviderOptions;
8
+ }>;
@@ -0,0 +1,52 @@
1
+ import { AgentToolDefinition, McpToolResult } from '../agent-tools/mcp-tool-types';
2
+ /** What the model gets of a tool result, as `@ai-sdk/mcp` hands it to the AI SDK. */
3
+ export interface AgentMcpModelOutput {
4
+ type: 'content';
5
+ value: Array<{
6
+ type: 'text';
7
+ text: string;
8
+ } | {
9
+ type: 'file';
10
+ mediaType: string;
11
+ data: {
12
+ type: 'data';
13
+ data: string;
14
+ };
15
+ }>;
16
+ }
17
+ /** The input schema of a tool as a Standard Schema with its JSON Schema. */
18
+ export interface AgentMcpInputSchema {
19
+ '~standard': {
20
+ version: 1;
21
+ vendor: string;
22
+ validate: (value: unknown) => {
23
+ value: unknown;
24
+ };
25
+ jsonSchema: {
26
+ input: (options: {
27
+ target: string;
28
+ }) => Record<string, unknown>;
29
+ output: (options: {
30
+ target: string;
31
+ }) => Record<string, unknown>;
32
+ };
33
+ };
34
+ }
35
+ /** A tool of the HI MCP tool set, in the shape of an AI SDK dynamic tool. */
36
+ export interface AgentMcpTool {
37
+ type: 'dynamic';
38
+ annotations?: AgentToolDefinition['annotations'];
39
+ description: string;
40
+ inputSchema: AgentMcpInputSchema;
41
+ execute: (input: unknown) => Promise<McpToolResult>;
42
+ toModelOutput: (options: {
43
+ output: McpToolResult;
44
+ }) => AgentMcpModelOutput;
45
+ }
46
+ /** The HI MCP tools by name, the tool set an AI SDK `streamText` takes. */
47
+ export type AgentMcpTools = Record<string, AgentMcpTool>;
48
+ /** The tool result as `@ai-sdk/mcp` passes it to the model: text parts and images as file parts. */
49
+ export declare const mcpToModelOutput: ({ output, }: {
50
+ output: McpToolResult;
51
+ }) => AgentMcpModelOutput;
52
+ export declare const createAgentMcpTools: (definitions: AgentToolDefinition[], call: (name: string, input: unknown) => Promise<McpToolResult>, vendor: string) => AgentMcpTools;
@@ -0,0 +1,35 @@
1
+ import { AgentToolDefinition, McpToolResult } from '../agent-tools/mcp-tool-types';
2
+ /**
3
+ * The model of the AI Planning Assistant as a JSON object: everything
4
+ * `loadChatModel` and `startPlanningAssistant` need to reach it.
5
+ */
6
+ export interface PlanningAssistantConfig {
7
+ /** `azure` for a deployment on an Azure AI Foundry resource, `openai-compatible` for an endpoint that speaks OpenAI Chat Completions or, with `responses`, stateless OpenAI Responses (e.g. a model proxy), else the provider of the model. */
8
+ provider: 'azure' | 'openai' | 'openai-compatible' | 'mistral' | 'anthropic' | 'google';
9
+ /** The model id at the provider; for `azure` the name of the deployment, for `openai-compatible` the model name the endpoint expects. */
10
+ model: string;
11
+ /** The API key of the provider, required by every provider but `openai-compatible`; for `azure` the key of the Foundry resource. */
12
+ apiKey?: string;
13
+ /** `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` (or `/responses`). */
14
+ baseUrl?: string;
15
+ /** `openai-compatible` only: headers sent with every model request, e.g. the authorization of a model proxy; without a key and without an Authorization header, no Authorization header is sent, so a same-origin page keeps the browser's authenticated session. */
16
+ headers?: Record<string, string>;
17
+ /** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
18
+ chatCompletions?: boolean;
19
+ /** `openai-compatible` only: call `<baseUrl>/responses` instead of `<baseUrl>/chat/completions`, stateless (`store: false`, the whole history in every request, the reasoning carried encrypted) — for a proxy whose reasoning model takes function tools through the Responses API only. */
20
+ responses?: boolean;
21
+ /** `azure` only: the reasoning effort of the deployment; its default when unset. */
22
+ reasoningEffort?: string;
23
+ /** Azure Responses only: mark the library prefix for caching on a deployment verified to support explicit breakpoints. */
24
+ referenceCacheBreakpoint?: boolean;
25
+ /** Whether the model reads images: the window offers the image drop only then. */
26
+ readsImages: boolean;
27
+ }
28
+ export interface ConfiguratorAgentApi {
29
+ getConfiguratorAgentTools(): Promise<AgentToolDefinition[]>;
30
+ callConfiguratorAgentTool(name: string, input: unknown): Promise<McpToolResult>;
31
+ getConfiguratorAgentPrompts(): Promise<{
32
+ systemPrompt: string;
33
+ imagePrompt: string;
34
+ }>;
35
+ }