@roomle/embedding-lib 9.0.0-alpha.1 → 9.0.0-alpha.11
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 +764 -0
- package/{browser-BxG7yIaK.mjs → browser-D6As4Zxr.mjs} +1 -0
- package/{browser-CW9o-dtT.mjs → browser-zrjtYpL8.mjs} +1 -0
- package/coerce-CqJod_GZ.mjs +8 -0
- package/coerce-CsI42_k0.mjs +6 -0
- package/{comlink-B5lV2OWp.mjs → comlink-Cmiqa2s0.mjs} +1 -0
- package/{comlink-B2Kj_5Ge.mjs → comlink-Dc3LZUoi.mjs} +1 -0
- package/configurator.d.ts +2 -0
- package/configurator.js +29 -0
- package/configurator.min.js +27 -0
- package/dist-5jYYtT4q.mjs +8216 -0
- package/dist-B9yy8ym8.mjs +5512 -0
- package/dist-BV-32IEX.mjs +8128 -0
- package/dist-Bb2L1Zel.mjs +6045 -0
- package/dist-Bo3WzRdf.mjs +6223 -0
- package/dist-Bt1FopV4.mjs +7594 -0
- package/dist-C5fKJXpB.mjs +5598 -0
- package/dist-COgAdYY1.mjs +7554 -0
- package/dist-CXemOs84.mjs +849 -0
- package/dist-CqP0aX0A.mjs +866 -0
- package/dist-CqpDM10w.mjs +1179 -0
- package/dist-D0kh4WfT.mjs +7721 -0
- package/dist-D5HdKuwj.mjs +1221 -0
- package/dist-DJtonrDM.mjs +16906 -0
- package/dist-GTk8ppiK.mjs +8380 -0
- package/dist-XEy6Tk_Y.mjs +17341 -0
- package/docs/md/web/embedding/CHANGELOG.md +284 -98
- package/{drag-ghost-BQ8r6NVo.mjs → drag-ghost-D7FnWbO4.mjs} +2 -1
- package/{drag-ghost-BOwjMbG3.mjs → drag-ghost-yXe7c8jA.mjs} +2 -1
- package/{drag-in-QhL3zGC0.mjs → drag-in-BiEe2Lgv.mjs} +15 -20
- package/{drag-in-BP_E53zb.mjs → drag-in-t7T6Pqwc.mjs} +10 -15
- package/embedding-plugins.js +2 -1
- package/embedding-plugins.min.js +2 -1
- package/experimental-evaluation-BgWFolud.mjs +1074 -0
- package/experimental-evaluation-D56MbtjO.mjs +970 -0
- package/{from-custom-view-D2Z1YmCx.mjs → from-custom-view-CTBapIc6.mjs} +31 -30
- package/{from-custom-view-BM_zRJCf.mjs → from-custom-view-xbjgsLll.mjs} +32 -31
- package/{from-website-CPVeVVMI.mjs → from-website-DUPMQPl6.mjs} +24 -23
- package/{from-website-DlklVbxU.mjs → from-website-JwG7Ic_U.mjs} +24 -23
- package/hi.js +250 -111
- package/hi.min.js +212 -95
- package/mcp-tools-CJ7j_FI2.mjs +151 -0
- package/mcp-tools-D__M74CZ.mjs +153 -0
- package/package.json +12 -1
- package/packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.d.ts +4 -0
- package/packages/embedding-lib/src/configurator-agent/configurator-planning-assistant.d.ts +13 -0
- package/packages/embedding-lib/src/configurator.d.ts +3 -0
- package/packages/embedding-lib/src/hi.d.ts +1 -3
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +11 -11
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +11 -34
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +54 -0
- package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +1 -0
- package/packages/embedding-lib/src/planning-assistant/mcp-tools.d.ts +2 -0
- package/packages/web-sdk/packages/assistant.d.ts +3 -0
- package/packages/web-sdk/packages/common-core/src/agent-tools/mcp-tool-types.d.ts +30 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.d.ts +8 -0
- package/packages/{embedding-lib/src/homag-intelligence/hi-mcp/mcp-tool-types.d.ts → web-sdk/packages/common-core/src/planning-assistant/mcp-tools.d.ts} +15 -20
- package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +35 -0
- package/roomle-embedding-lib.js +67 -57
- package/roomle-embedding-lib.min.js +13 -3
- package/sbom.cdx.json +405 -0
- package/{utils-wJ80awOA.mjs → utils-CAAGdgk8.mjs} +1 -0
- package/{utils-DxJ3PcKe.mjs → utils-WeolMfC5.mjs} +1 -0
- package/hi-mcp-server-BiZlFkBm.mjs +0 -4866
- package/hi-mcp-server-DTQnrykg.mjs +0 -5278
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/agent-facing.d.ts +0 -35
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/hi-mcp-server.d.ts +0 -3
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/mcp-tool.d.ts +0 -13
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/plan-history.d.ts +0 -33
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/planner-api.d.ts +0 -32
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/skills.d.ts +0 -23
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/tool-executors.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.11",
|
|
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
|
"devDependencies": {},
|
|
42
53
|
"repository": {
|
|
43
54
|
"type": "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';
|
|
@@ -14,9 +14,7 @@ export { createHiLibraryCallbacks } from './homag-intelligence/hi-callbacks';
|
|
|
14
14
|
export { libLoadArticleCatalog, libLoadMasterData, libLoadCalcScript, registerLegacyUrlFormat, unregisterLegacyUrlFormat, } from './homag-intelligence/hi-requests';
|
|
15
15
|
export { omPostRequest, omGetRequest, } from './homag-intelligence/hi-order-manager';
|
|
16
16
|
export { setupHi, cleanupHi } from './homag-intelligence/hi-setup';
|
|
17
|
-
export { createHiMcpTools } from './homag-intelligence/hi-mcp-tools';
|
|
18
|
-
export type { HiMcpTool, HiMcpTools, } from './homag-intelligence/hi-mcp/mcp-tool-types';
|
|
19
|
-
export type { HiMcpPlannerApi } from './homag-intelligence/hi-mcp/planner-api';
|
|
17
|
+
export { createHiMcpTools, type HiMcpTool, type HiMcpTools, type HiMcpPlannerApi, } from './homag-intelligence/hi-mcp-tools';
|
|
20
18
|
export { loadChatModel, startPlanningAssistant, type PlanningAssistantConfig, type PlanningAssistantPlannerApi, } from './homag-intelligence/hi-planning-assistant';
|
|
21
19
|
export { type ExternalObjectSnapshotSaveResult, type HiContextAction, } from '../../web-sdk/packages';
|
|
22
20
|
export { HI_PANEL_ACTION, type HiPanelActionType, type HiOrderHeader, type HiOrder, type HiOrderData, type HiPriceData, type HiCallbacks, } from '../../common/src/hi/hi-types';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export declare const createHiMcpTools: (
|
|
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';
|
|
4
|
+
export interface HiMcpPlannerApi {
|
|
5
|
+
extended: {
|
|
6
|
+
getExternalObjectAgentTools(): Promise<HiAgentToolDefinition[]>;
|
|
7
|
+
callExternalObjectAgentTool(name: string, input: unknown): Promise<McpToolResult>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
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,55 +1,32 @@
|
|
|
1
1
|
import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
|
|
2
|
-
import { HiMcpPlannerApi } from './hi-mcp
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
}
|
|
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';
|
|
23
5
|
/** The planner the planning assistant runs in: the HI MCP tools' planner API, the agent prompts and the window. */
|
|
24
6
|
export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
|
|
25
7
|
extended: {
|
|
26
8
|
getExternalObjectAgentPrompts(): Promise<{
|
|
27
9
|
systemPrompt: string;
|
|
28
10
|
imagePrompt: string;
|
|
11
|
+
referenceBlocks?: {
|
|
12
|
+
id: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
29
15
|
}>;
|
|
30
16
|
planningAssistantOutput(part: PlanningAssistantOutput): unknown;
|
|
17
|
+
getExternalObjectLibraryContext?(include: string[]): Promise<{
|
|
18
|
+
articles?: unknown[];
|
|
19
|
+
}>;
|
|
31
20
|
callbacks: {
|
|
32
21
|
onPlanningAssistantPrompt?: (prompt: PlanningAssistantPrompt) => Promise<void>;
|
|
33
22
|
};
|
|
34
23
|
};
|
|
35
24
|
};
|
|
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
25
|
/**
|
|
49
26
|
* Runs the planning agent of the AI Planning Assistant window
|
|
50
27
|
* (featureFlags.planningAssistant) in this page: the window hands every
|
|
51
28
|
* message to "onPlanningAssistantPrompt", the agent calls the HI MCP tools,
|
|
52
|
-
* the tools
|
|
29
|
+
* the tools run in the planner of this page, and the agent's output goes to
|
|
53
30
|
* "planningAssistantOutput". Aborting the signal ends a running turn.
|
|
54
31
|
*/
|
|
55
32
|
export declare const startPlanningAssistant: (roomDesignerApi: PlanningAssistantPlannerApi, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
type Usage = {
|
|
2
|
+
inputTokens?: number;
|
|
3
|
+
outputTokens?: number;
|
|
4
|
+
totalTokens?: number;
|
|
5
|
+
inputTokenDetails?: {
|
|
6
|
+
noCacheTokens?: number;
|
|
7
|
+
cacheReadTokens?: number;
|
|
8
|
+
cacheWriteTokens?: number;
|
|
9
|
+
};
|
|
10
|
+
outputTokenDetails?: {
|
|
11
|
+
reasoningTokens?: number;
|
|
12
|
+
};
|
|
13
|
+
raw?: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export declare const tokenCounts: (usage?: Usage) => {
|
|
16
|
+
inputTokens: number;
|
|
17
|
+
outputTokens: number;
|
|
18
|
+
totalTokens: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const sumCounts: (counts: (number | null)[]) => number;
|
|
21
|
+
export declare const usageDetails: (usage?: Usage) => {
|
|
22
|
+
cacheReadTokens: number;
|
|
23
|
+
cacheWriteTokens: number;
|
|
24
|
+
noCacheTokens: number;
|
|
25
|
+
reasoningTokens: number;
|
|
26
|
+
rawUsageAvailable: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const summarizeDetails: (steps: ReturnType<typeof usageDetails>[]) => {
|
|
29
|
+
[k: string]: {
|
|
30
|
+
tokens: number;
|
|
31
|
+
status: string;
|
|
32
|
+
reportedSteps: number;
|
|
33
|
+
observedSteps: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const describePayload: (text: string) => Promise<{
|
|
37
|
+
bytes: number;
|
|
38
|
+
sha256: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const describeModelRequest: (text: string, seenInput: Set<string>) => Promise<{
|
|
41
|
+
bytes: number;
|
|
42
|
+
sha256: string;
|
|
43
|
+
} | {
|
|
44
|
+
sections: {
|
|
45
|
+
inputBytes: number;
|
|
46
|
+
newInputBytes: number;
|
|
47
|
+
repeatedInputBytes: number;
|
|
48
|
+
toolsBytes: number;
|
|
49
|
+
otherBytes: number;
|
|
50
|
+
};
|
|
51
|
+
bytes: number;
|
|
52
|
+
sha256: string;
|
|
53
|
+
}>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadChatModel, type PlanningAssistantConfig, } from '../../../web-sdk/packages/assistant';
|
|
@@ -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
|
+
}>;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export interface McpToolResult {
|
|
3
|
-
content: ({
|
|
4
|
-
type: 'text';
|
|
5
|
-
text: string;
|
|
6
|
-
} | {
|
|
7
|
-
type: 'image';
|
|
8
|
-
data: string;
|
|
9
|
-
mimeType: string;
|
|
10
|
-
})[];
|
|
11
|
-
isError?: boolean;
|
|
12
|
-
}
|
|
1
|
+
import { AgentToolDefinition, McpToolResult } from '../agent-tools/mcp-tool-types';
|
|
13
2
|
/** What the model gets of a tool result, as `@ai-sdk/mcp` hands it to the AI SDK. */
|
|
14
|
-
export interface
|
|
3
|
+
export interface AgentMcpModelOutput {
|
|
15
4
|
type: 'content';
|
|
16
|
-
value:
|
|
5
|
+
value: Array<{
|
|
17
6
|
type: 'text';
|
|
18
7
|
text: string;
|
|
19
8
|
} | {
|
|
@@ -23,10 +12,10 @@ export interface HiMcpModelOutput {
|
|
|
23
12
|
type: 'data';
|
|
24
13
|
data: string;
|
|
25
14
|
};
|
|
26
|
-
}
|
|
15
|
+
}>;
|
|
27
16
|
}
|
|
28
17
|
/** The input schema of a tool as a Standard Schema with its JSON Schema. */
|
|
29
|
-
export interface
|
|
18
|
+
export interface AgentMcpInputSchema {
|
|
30
19
|
'~standard': {
|
|
31
20
|
version: 1;
|
|
32
21
|
vendor: string;
|
|
@@ -44,14 +33,20 @@ export interface HiMcpInputSchema {
|
|
|
44
33
|
};
|
|
45
34
|
}
|
|
46
35
|
/** A tool of the HI MCP tool set, in the shape of an AI SDK dynamic tool. */
|
|
47
|
-
export interface
|
|
36
|
+
export interface AgentMcpTool {
|
|
48
37
|
type: 'dynamic';
|
|
38
|
+
annotations?: AgentToolDefinition['annotations'];
|
|
49
39
|
description: string;
|
|
50
|
-
inputSchema:
|
|
40
|
+
inputSchema: AgentMcpInputSchema;
|
|
51
41
|
execute: (input: unknown) => Promise<McpToolResult>;
|
|
52
42
|
toModelOutput: (options: {
|
|
53
43
|
output: McpToolResult;
|
|
54
|
-
}) =>
|
|
44
|
+
}) => AgentMcpModelOutput;
|
|
55
45
|
}
|
|
56
46
|
/** The HI MCP tools by name, the tool set an AI SDK `streamText` takes. */
|
|
57
|
-
export type
|
|
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
|
+
}
|