@roomle/embedding-lib 0.0.0-dev-9d077e2 → 0.0.0-dev-c1bdbb4

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 (31) hide show
  1. package/{drag-ghost-BOwjMbG3.mjs → drag-ghost-BxqPJdhq.mjs} +1 -1
  2. package/{drag-ghost-BQ8r6NVo.mjs → drag-ghost-CDFtC1pd.mjs} +1 -1
  3. package/{drag-in-BP_E53zb.mjs → drag-in-CV1E-DO6.mjs} +2 -2
  4. package/{drag-in-QhL3zGC0.mjs → drag-in-ClPpCYyi.mjs} +2 -2
  5. package/embedding-plugins.js +1 -1
  6. package/embedding-plugins.min.js +1 -1
  7. package/{from-custom-view-BM_zRJCf.mjs → from-custom-view-Q9A-J7qV.mjs} +2 -2
  8. package/{from-custom-view-D2Z1YmCx.mjs → from-custom-view-Sx6P6iDI.mjs} +2 -2
  9. package/{from-website-DlklVbxU.mjs → from-website-BmCO2xli.mjs} +2 -2
  10. package/{from-website-CPVeVVMI.mjs → from-website-DZJy_l42.mjs} +2 -2
  11. package/hi.js +194 -39
  12. package/hi.min.js +175 -38
  13. package/package.json +1 -8
  14. package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +61 -4
  15. package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +40 -4
  16. package/roomle-embedding-lib.js +1 -1
  17. package/roomle-embedding-lib.min.js +1 -1
  18. package/configurator.d.ts +0 -2
  19. package/configurator.js +0 -119
  20. package/configurator.min.js +0 -117
  21. package/packages/embedding-lib/src/configurator-agent/chat-recovery.d.ts +0 -9
  22. package/packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.d.ts +0 -11
  23. package/packages/embedding-lib/src/configurator-agent/configurator-planning-assistant.d.ts +0 -8
  24. package/packages/embedding-lib/src/configurator.d.ts +0 -3
  25. package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +0 -33
  26. package/packages/embedding-lib/src/planning-assistant/mcp-tools.d.ts +0 -52
  27. package/packages/embedding-lib/src/planning-assistant/planning-assistant.d.ts +0 -23
  28. package/planning-assistant-BW9fNGZO.mjs +0 -158
  29. package/planning-assistant-CyVA2uUX.mjs +0 -143
  30. /package/{comlink-BJnhpJa4.mjs → comlink-B2Kj_5Ge.mjs} +0 -0
  31. /package/{comlink-lSsogKgb.mjs → comlink-B5lV2OWp.mjs} +0 -0
@@ -1,11 +1,68 @@
1
1
  import { HiAgentToolDefinition, McpToolResult } from '../../../web-sdk/packages';
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';
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. */
4
48
  export interface HiMcpPlannerApi {
5
49
  extended: {
6
50
  getExternalObjectAgentTools(): Promise<HiAgentToolDefinition[]>;
7
51
  callExternalObjectAgentTool(name: string, input: unknown): Promise<McpToolResult>;
8
52
  };
9
53
  }
10
- /** The planner's HI agent tools, forwarded through the embedding bridge. */
11
- export declare const createHiMcpTools: ({ extended }: HiMcpPlannerApi) => Promise<import('./hi-mcp-tools').HiMcpTools>;
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>;
@@ -1,7 +1,25 @@
1
1
  import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
2
2
  import { HiMcpPlannerApi } from './hi-mcp-tools';
3
- import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
4
- export { loadChatModel, type PlanningAssistantConfig, } from '../planning-assistant/chat-model';
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, else the provider of the model. */
9
+ provider: 'azure' | 'mistral' | 'anthropic' | 'google';
10
+ /** The model id at the provider; for `azure` the name of the deployment. */
11
+ model: string;
12
+ /** The API key of the provider; for `azure` the key of the Foundry resource. */
13
+ apiKey: string;
14
+ /** `azure` only: the OpenAI v1 endpoint of the Foundry resource, e.g. `https://<resource>.services.ai.azure.com/openai/v1`. */
15
+ baseUrl?: string;
16
+ /** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
17
+ chatCompletions?: boolean;
18
+ /** `azure` only: the reasoning effort of the deployment; its default when unset. */
19
+ reasoningEffort?: string;
20
+ /** Whether the model reads images: the window offers the image drop only then. */
21
+ readsImages: boolean;
22
+ }
5
23
  /** The planner the planning assistant runs in: the HI MCP tools' planner API, the agent prompts and the window. */
6
24
  export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
7
25
  extended: {
@@ -15,5 +33,23 @@ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
15
33
  };
16
34
  };
17
35
  };
18
- /** Runs the HI planning assistant in the host page. */
19
- export declare const startPlanningAssistant: (api: PlanningAssistantPlannerApi, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<void>;
36
+ /** The AI SDK language model of the config and the provider options `streamText` takes with it. */
37
+ export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, chatCompletions, reasoningEffort, }: PlanningAssistantConfig) => Promise<{
38
+ languageModel: any;
39
+ providerOptions: {
40
+ azure: {
41
+ reasoningEffort: string;
42
+ };
43
+ };
44
+ } | {
45
+ languageModel: any;
46
+ providerOptions?: undefined;
47
+ }>;
48
+ /**
49
+ * Runs the planning agent of the AI Planning Assistant window
50
+ * (featureFlags.planningAssistant) in this page: the window hands every
51
+ * message to "onPlanningAssistantPrompt", the agent calls the HI MCP tools,
52
+ * the tools run in the planner of this page, and the agent's output goes to
53
+ * "planningAssistantOutput". Aborting the signal ends a running turn.
54
+ */
55
+ export declare const startPlanningAssistant: (roomDesignerApi: PlanningAssistantPlannerApi, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<void>;
@@ -203,7 +203,7 @@ var t = class {
203
203
  setupPlugins(e, t, n = "website") {
204
204
  for (let r of e) typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(new Promise((e, r) => {
205
205
  try {
206
- import("./drag-in-QhL3zGC0.mjs").then((e) => e.n).then(({ DragIn: i }) => {
206
+ import("./drag-in-ClPpCYyi.mjs").then((e) => e.n).then(({ DragIn: i }) => {
207
207
  let a = new i(this.ui, t, n, this.viewName);
208
208
  a.init().then(() => {
209
209
  this.plugins.dragIn = a, e();
@@ -184,7 +184,7 @@ var t = class {
184
184
  setupPlugins(e, t, n = "website") {
185
185
  for (let r of e) typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(new Promise((e, r) => {
186
186
  try {
187
- import("./drag-in-BP_E53zb.mjs").then((e) => e.n).then(({ DragIn: i }) => {
187
+ import("./drag-in-CV1E-DO6.mjs").then((e) => e.n).then(({ DragIn: i }) => {
188
188
  let a = new i(this.ui, t, n, this.viewName);
189
189
  a.init().then(() => {
190
190
  this.plugins.dragIn = a, e();
package/configurator.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './packages/embedding-lib/src/configurator'
2
- export {}
package/configurator.js DELETED
@@ -1,119 +0,0 @@
1
- import { n as e, r as t, t as n } from "./planning-assistant-BW9fNGZO.mjs";
2
- //#region packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.ts
3
- var r = async (e) => {
4
- if (typeof e.getConfiguratorAgentTools != "function" || typeof e.callConfiguratorAgentTool != "function") throw Error("Update the Rubens UI: configurator agent tools are unavailable.");
5
- return t(await e.getConfiguratorAgentTools(), (t, n) => e.callConfiguratorAgentTool(t, n), "configurator-mcp");
6
- }, i = {
7
- undo: "Undo",
8
- redo: "Redo",
9
- "change-component-parameter": "Component parameter change",
10
- "change-global-parameter": "Global parameter change",
11
- "dock-component": "Component dock",
12
- "drag-component": "Component drag",
13
- "delete-component": "Component deletion",
14
- "load-configuration": "Configuration load",
15
- "get-configurator-capabilities": "Capabilities read",
16
- "get-configuration": "Configuration read",
17
- "get-component-parameters": "Component parameters read",
18
- "get-global-parameters": "Global parameters read",
19
- "get-possible-children": "Possible children read",
20
- "get-docking-positions": "Docking positions read",
21
- "get-component-docking-positions": "Component docking positions read",
22
- "get-delete-impact": "Delete impact read"
23
- }, a = new Set([
24
- "get-configurator-capabilities",
25
- "get-configuration",
26
- "get-component-parameters",
27
- "get-global-parameters",
28
- "get-possible-children",
29
- "get-docking-positions",
30
- "get-component-docking-positions",
31
- "get-delete-impact"
32
- ]), o = (e) => {
33
- if (e instanceof Error) return e.message;
34
- try {
35
- return typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
36
- } catch {
37
- return Object.prototype.toString.call(e);
38
- }
39
- }, s = (e) => {
40
- if (e?.structuredContent !== void 0) return e.structuredContent;
41
- let t = e?.content?.filter((e) => e.type === "text").map((e) => e.text).join("\n");
42
- if (t === void 0) return e;
43
- try {
44
- return JSON.parse(t);
45
- } catch {
46
- return t;
47
- }
48
- }, c = (e) => {
49
- if (!e || typeof e != "object") return e == null ? [] : [o(e)];
50
- let t = [];
51
- for (let n of [
52
- "undone",
53
- "redone",
54
- "confirmed",
55
- "canUndo",
56
- "canRedo"
57
- ]) e[n] !== void 0 && t.push(`${n}: ${o(e[n])}`);
58
- return e.hint && t.push(o(e.hint)), t;
59
- }, l = (e) => {
60
- let t = [];
61
- return {
62
- tools: Object.fromEntries(Object.entries(e).map(([e, n]) => {
63
- if (!n.execute) return [e, n];
64
- let r = n.execute.bind(n);
65
- return [e, {
66
- ...n,
67
- execute: async (n) => {
68
- let i = {
69
- toolName: e,
70
- status: "pending"
71
- };
72
- t.push(i);
73
- try {
74
- let e = await r(n);
75
- return i.result = e, i.status = "returned", e;
76
- } catch (e) {
77
- throw i.error = e, i.status = "threw", e;
78
- }
79
- }
80
- }];
81
- })),
82
- summary: () => {
83
- let e = ["The assistant's reply was interrupted. Any text above is incomplete."];
84
- if (!t.length) return e.push("No tool ran, so the configuration was not changed."), e.join("\n\n");
85
- for (let n of t) {
86
- let t = i[n.toolName] ?? n.toolName;
87
- if (a.has(n.toolName)) {
88
- let r = n.status === "returned" && !n.result?.isError, i = r ? s(n.result) : void 0;
89
- e.push(r ? `- Completed ${t}: ${i?.complete === !1 ? "some requested information was unresolved" : "information was returned"}. The read did not change the configuration.` : `- Incomplete ${t}: ${n.status === "pending" ? "no result was received" : "the read failed"}. The read did not change the configuration.`);
90
- continue;
91
- }
92
- if (n.status === "returned" && !n.result?.isError) {
93
- let r = s(n.result);
94
- if (r?.confirmed === !1) {
95
- e.push(`- Unconfirmed ${t}: ${r?.hint ?? "the configurator did not report the change"}. Check the configuration before trying this operation again.`);
96
- continue;
97
- }
98
- let i = c(r);
99
- e.push(`- Completed ${t}: ${i.length ? i.join("; ") : "the tool returned successfully."}`);
100
- } else {
101
- let r = n.status === "threw" ? o(n.error) : n.status === "returned" ? o(s(n.result)) : "no result was received";
102
- e.push(`- Unconfirmed ${t}: ${r}. Check the configuration before trying this operation again.`);
103
- }
104
- }
105
- return e.push("These are the recorded tool outcomes; no operation was repeated automatically."), e.join("\n\n");
106
- }
107
- };
108
- }, u = (e, t, i) => n(e.window, t, i, async () => {
109
- let [t, n] = await Promise.all([e.configurator.getConfiguratorAgentPrompts(), r(e.configurator)]);
110
- return {
111
- prompts: t,
112
- tools: n
113
- };
114
- }, {
115
- timeoutMs: 5 * 6e4,
116
- recovery: l
117
- });
118
- //#endregion
119
- export { r as createConfiguratorMcpTools, e as loadChatModel, u as startConfiguratorPlanningAssistant };
@@ -1,117 +0,0 @@
1
- import { n as e, r as t, t as n } from "./planning-assistant-CyVA2uUX.mjs";
2
- var r = async (e) => {
3
- if (typeof e.getConfiguratorAgentTools != "function" || typeof e.callConfiguratorAgentTool != "function") throw Error("Update the Rubens UI: configurator agent tools are unavailable.");
4
- return t(await e.getConfiguratorAgentTools(), (t, n) => e.callConfiguratorAgentTool(t, n), "configurator-mcp");
5
- }, i = {
6
- undo: "Undo",
7
- redo: "Redo",
8
- "change-component-parameter": "Component parameter change",
9
- "change-global-parameter": "Global parameter change",
10
- "dock-component": "Component dock",
11
- "drag-component": "Component drag",
12
- "delete-component": "Component deletion",
13
- "load-configuration": "Configuration load",
14
- "get-configurator-capabilities": "Capabilities read",
15
- "get-configuration": "Configuration read",
16
- "get-component-parameters": "Component parameters read",
17
- "get-global-parameters": "Global parameters read",
18
- "get-possible-children": "Possible children read",
19
- "get-docking-positions": "Docking positions read",
20
- "get-component-docking-positions": "Component docking positions read",
21
- "get-delete-impact": "Delete impact read"
22
- }, a = new Set([
23
- "get-configurator-capabilities",
24
- "get-configuration",
25
- "get-component-parameters",
26
- "get-global-parameters",
27
- "get-possible-children",
28
- "get-docking-positions",
29
- "get-component-docking-positions",
30
- "get-delete-impact"
31
- ]), o = (e) => {
32
- if (e instanceof Error) return e.message;
33
- try {
34
- return typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
35
- } catch {
36
- return Object.prototype.toString.call(e);
37
- }
38
- }, s = (e) => {
39
- if (e?.structuredContent !== void 0) return e.structuredContent;
40
- let t = e?.content?.filter((e) => e.type === "text").map((e) => e.text).join("\n");
41
- if (t === void 0) return e;
42
- try {
43
- return JSON.parse(t);
44
- } catch {
45
- return t;
46
- }
47
- }, c = (e) => {
48
- if (!e || typeof e != "object") return e == null ? [] : [o(e)];
49
- let t = [];
50
- for (let n of [
51
- "undone",
52
- "redone",
53
- "confirmed",
54
- "canUndo",
55
- "canRedo"
56
- ]) e[n] !== void 0 && t.push(`${n}: ${o(e[n])}`);
57
- return e.hint && t.push(o(e.hint)), t;
58
- }, l = (e) => {
59
- let t = [];
60
- return {
61
- tools: Object.fromEntries(Object.entries(e).map(([e, n]) => {
62
- if (!n.execute) return [e, n];
63
- let r = n.execute.bind(n);
64
- return [e, {
65
- ...n,
66
- execute: async (n) => {
67
- let i = {
68
- toolName: e,
69
- status: "pending"
70
- };
71
- t.push(i);
72
- try {
73
- let e = await r(n);
74
- return i.result = e, i.status = "returned", e;
75
- } catch (e) {
76
- throw i.error = e, i.status = "threw", e;
77
- }
78
- }
79
- }];
80
- })),
81
- summary: () => {
82
- let e = ["The assistant's reply was interrupted. Any text above is incomplete."];
83
- if (!t.length) return e.push("No tool ran, so the configuration was not changed."), e.join("\n\n");
84
- for (let n of t) {
85
- let t = i[n.toolName] ?? n.toolName;
86
- if (a.has(n.toolName)) {
87
- let r = n.status === "returned" && !n.result?.isError, i = r ? s(n.result) : void 0;
88
- e.push(r ? `- Completed ${t}: ${!1 === i?.complete ? "some requested information was unresolved" : "information was returned"}. The read did not change the configuration.` : `- Incomplete ${t}: ${n.status === "pending" ? "no result was received" : "the read failed"}. The read did not change the configuration.`);
89
- continue;
90
- }
91
- if (n.status !== "returned" || n.result?.isError) {
92
- let r = n.status === "threw" ? o(n.error) : n.status === "returned" ? o(s(n.result)) : "no result was received";
93
- e.push(`- Unconfirmed ${t}: ${r}. Check the configuration before trying this operation again.`);
94
- } else {
95
- let r = s(n.result);
96
- if (!1 === r?.confirmed) {
97
- e.push(`- Unconfirmed ${t}: ${r?.hint ?? "the configurator did not report the change"}. Check the configuration before trying this operation again.`);
98
- continue;
99
- }
100
- let i = c(r);
101
- e.push(`- Completed ${t}: ${i.length ? i.join("; ") : "the tool returned successfully."}`);
102
- }
103
- }
104
- return e.push("These are the recorded tool outcomes; no operation was repeated automatically."), e.join("\n\n");
105
- }
106
- };
107
- }, u = (e, t, i) => n(e.window, t, i, async () => {
108
- let [t, n] = await Promise.all([e.configurator.getConfiguratorAgentPrompts(), r(e.configurator)]);
109
- return {
110
- prompts: t,
111
- tools: n
112
- };
113
- }, {
114
- timeoutMs: 3e5,
115
- recovery: l
116
- });
117
- export { r as createConfiguratorMcpTools, e as loadChatModel, u as startConfiguratorPlanningAssistant };
@@ -1,9 +0,0 @@
1
- import { AgentMcpTools } from '../planning-assistant/mcp-tools';
2
- /**
3
- * Records tool execution independently of whether the model finishes its
4
- * step, so an interrupted reply can say what the tools changed.
5
- */
6
- export declare const createChatRecovery: (tools: AgentMcpTools) => {
7
- tools: AgentMcpTools;
8
- summary: () => string;
9
- };
@@ -1,11 +0,0 @@
1
- import { AgentToolDefinition, McpToolResult } from '../../../web-sdk/packages';
2
- export interface ConfiguratorAgentApi {
3
- getConfiguratorAgentTools(): Promise<AgentToolDefinition[]>;
4
- callConfiguratorAgentTool(name: string, input: unknown): Promise<McpToolResult>;
5
- getConfiguratorAgentPrompts(): Promise<{
6
- systemPrompt: string;
7
- imagePrompt: string;
8
- }>;
9
- }
10
- /** The native configurator's agent tools forwarded through the embedding bridge. */
11
- export declare const createConfiguratorMcpTools: (api: ConfiguratorAgentApi) => Promise<import('../hi').HiMcpTools>;
@@ -1,8 +0,0 @@
1
- import { AssistantWindow } from '../planning-assistant/planning-assistant';
2
- import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
3
- import { ConfiguratorAgentApi } from './configurator-mcp-tools';
4
- /** Runs a native configurator assistant, with its window supplied separately for planner isolation. */
5
- export declare const startConfiguratorPlanningAssistant: (endpoints: {
6
- configurator: ConfiguratorAgentApi;
7
- window: AssistantWindow;
8
- }, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<void>;
@@ -1,3 +0,0 @@
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,33 +0,0 @@
1
- /**
2
- * The model of the AI Planning Assistant as a JSON object: everything
3
- * `loadChatModel` and `startPlanningAssistant` need to reach it.
4
- */
5
- export interface PlanningAssistantConfig {
6
- /** `azure` for a deployment on an Azure AI Foundry resource, else the provider of the model. */
7
- provider: 'azure' | 'mistral' | 'anthropic' | 'google';
8
- /** The model id at the provider; for `azure` the name of the deployment. */
9
- model: string;
10
- /** The API key of the provider; for `azure` the key of the Foundry resource. */
11
- apiKey: string;
12
- /** `azure` only: the OpenAI v1 endpoint of the Foundry resource, e.g. `https://<resource>.services.ai.azure.com/openai/v1`. */
13
- baseUrl?: string;
14
- /** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
15
- chatCompletions?: boolean;
16
- /** `azure` only: the reasoning effort of the deployment; its default when unset. */
17
- reasoningEffort?: string;
18
- /** Whether the model reads images: the window offers the image drop only then. */
19
- readsImages: boolean;
20
- }
21
- export declare const esm: (module: string) => string;
22
- /** The AI SDK language model of the config and the provider options `streamText` takes with it. */
23
- export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, chatCompletions, reasoningEffort, }: PlanningAssistantConfig) => Promise<{
24
- languageModel: any;
25
- providerOptions: {
26
- azure: {
27
- reasoningEffort: string;
28
- };
29
- };
30
- } | {
31
- languageModel: any;
32
- providerOptions?: undefined;
33
- }>;
@@ -1,52 +0,0 @@
1
- import { AgentToolDefinition, 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 AgentMcpModelOutput {
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 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;
@@ -1,23 +0,0 @@
1
- import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
2
- import { PlanningAssistantConfig } from './chat-model';
3
- import { AgentMcpTools } from './mcp-tools';
4
- export interface AssistantWindow {
5
- planningAssistantOutput(part: PlanningAssistantOutput): unknown;
6
- callbacks: {
7
- onPlanningAssistantPrompt?: (prompt: PlanningAssistantPrompt) => Promise<void>;
8
- };
9
- }
10
- /** Runs a browser agent with the tools and prompts supplied by its SDK domain. */
11
- export declare const startAssistant: (windowApi: AssistantWindow, config: PlanningAssistantConfig, signal: AbortSignal, setupDomain: () => Promise<{
12
- prompts: {
13
- systemPrompt: string;
14
- imagePrompt: string;
15
- };
16
- tools: AgentMcpTools;
17
- }>, turnPolicy?: {
18
- timeoutMs: number;
19
- recovery: (tools: AgentMcpTools) => {
20
- tools: AgentMcpTools;
21
- summary(): string;
22
- };
23
- }) => Promise<void>;