@roomle/embedding-lib 0.0.0-dev-d66646c → 0.0.0-dev-f0a595f
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 +2 -2
- package/ai-model-host-BE_xdV6e.mjs +153 -0
- package/ai-model-host-DHfBsFC2.mjs +154 -0
- package/ai.js +1 -128
- package/ai.min.js +1 -127
- package/construction.js +17615 -143
- package/construction.min.js +17291 -155
- package/hi.js +117 -424
- package/hi.min.js +112 -380
- package/package.json +1 -1
- package/packages/common/src/utils/ai-model-relay.d.ts +1 -1
- package/packages/embedding-lib/src/ai-model-host.d.ts +35 -0
- package/packages/embedding-lib/src/ai.d.ts +11 -27
- package/packages/embedding-lib/src/hi.d.ts +1 -0
- package/packages/embedding-lib/src/homag-intelligence/decisions.d.ts +7 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-model-proxy.d.ts +4 -1
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +9 -20
- package/packages/web-sdk/packages/assistant.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/usage.d.ts +15 -0
- package/sbom.cdx.json +5 -5
- package/usage-C3HE9yXi.mjs +33 -0
- package/usage-CYqDPQOx.mjs +34 -0
- package/continuation-COcMrXyj.mjs +0 -14
- package/continuation-D2hsmYf1.mjs +0 -13
- package/dist-BZSd56sr.mjs +0 -17422
- package/dist-S9sLSjZ4.mjs +0 -17087
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +0 -48
- package/usage-CgXarvBY.mjs +0 -16
- package/usage-c8evaONq.mjs +0 -17
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AiModelRequest } from '../../../common/src/utils/ai-model-relay';
|
|
2
|
+
export interface DecisionsEndpoint {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
model: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export declare const requestDecisions: (request: AiModelRequest, signal: AbortSignal, { baseUrl, model, headers }: DecisionsEndpoint) => Promise<Response>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DecisionsEndpoint } from './decisions';
|
|
1
2
|
import { ImageEditsEndpoint } from './image-edits';
|
|
2
3
|
import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
|
|
3
4
|
/**
|
|
@@ -10,6 +11,7 @@ export interface HiModelProxy {
|
|
|
10
11
|
chat?: PlanningAssistantConfig;
|
|
11
12
|
/** The lifestyle renderings of the AI image chat, when the backend's `enableAIRendering` is true */
|
|
12
13
|
rendering?: ImageEditsEndpoint;
|
|
14
|
+
decisions?: DecisionsEndpoint;
|
|
13
15
|
}
|
|
14
16
|
export interface HiModelProxyOptions {
|
|
15
17
|
/** The HI server, e.g. `https://dfscfgtest01-app.azurewebsites.net`; `''` for the page's own origin */
|
|
@@ -21,6 +23,7 @@ export interface HiModelProxyOptions {
|
|
|
21
23
|
* Reads the backend list of the HI user and returns what the model proxy of
|
|
22
24
|
* the HI server serves. The proxy serves only a user of exactly one backend:
|
|
23
25
|
* the chat when that backend's `enableAIPlanning` is true, the renderings
|
|
24
|
-
* when its `enableAIRendering` is true
|
|
26
|
+
* when its `enableAIRendering` is true, the decisions when its
|
|
27
|
+
* `enableAIDecisions` is true. A failed backend list serves none.
|
|
25
28
|
*/
|
|
26
29
|
export declare const resolveHiModelProxy: ({ serverUrl, authorization, }: HiModelProxyOptions) => Promise<HiModelProxy>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
|
|
2
|
-
import { HiMcpPlannerApi } from './hi-mcp-tools';
|
|
3
2
|
import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
|
|
3
|
+
import { default as RoomleEmbeddingApi } from '../roomle-embedding-lib';
|
|
4
|
+
import { HiMcpPlannerApi } from './hi-mcp-tools';
|
|
4
5
|
export { loadChatModel, type PlanningAssistantConfig, } from '../planning-assistant/chat-model';
|
|
5
6
|
/** The planner the planning assistant runs in: the HI MCP tools' planner API, the agent prompts and the window. */
|
|
6
7
|
export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
|
|
7
8
|
extended: {
|
|
9
|
+
startExternalObjectPlanningAssistant?(config: PlanningAssistantConfig, owner: string): Promise<void>;
|
|
10
|
+
suspendPlanningAssistant?(): Promise<void>;
|
|
11
|
+
resumePlanningAssistant?(): Promise<void>;
|
|
8
12
|
stopPlanningAssistant?(owner: string): Promise<void>;
|
|
9
13
|
setPlanningAssistantModel?(model: {
|
|
10
14
|
model: string;
|
|
@@ -28,7 +32,6 @@ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
|
|
|
28
32
|
getExternalObjectAgentDecisions?(prompt: {
|
|
29
33
|
text: string;
|
|
30
34
|
images: string[];
|
|
31
|
-
documents?: number;
|
|
32
35
|
earlier: string[];
|
|
33
36
|
apiKey?: string;
|
|
34
37
|
held?: string[];
|
|
@@ -47,27 +50,13 @@ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
|
|
|
47
50
|
onPlanningAssistantPrompt?: (prompt: PlanningAssistantPrompt) => unknown;
|
|
48
51
|
};
|
|
49
52
|
};
|
|
50
|
-
}
|
|
51
|
-
/** Confident photo observations supplied with the image-planning skill on creation turns. */
|
|
52
|
-
export interface PhotoFacts {
|
|
53
|
-
present: string[];
|
|
54
|
-
absent: string[];
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Appends high-confidence visual photo observations to the image-planning skill
|
|
58
|
-
* text so the planning model sees them inside the synthetic get-skill result.
|
|
59
|
-
*/
|
|
60
|
-
export declare const withPhotoFacts: (skillText: string, facts?: PhotoFacts) => string;
|
|
61
|
-
/**
|
|
62
|
-
* Runs the planning agent of the AI Planning Assistant window
|
|
63
|
-
* (featureFlags.planningAssistant) in this page: the window hands every
|
|
64
|
-
* message to "onPlanningAssistantPrompt", the agent calls the HI MCP tools,
|
|
65
|
-
* the tools run in the planner of this page, and the agent's output goes to
|
|
66
|
-
* "planningAssistantOutput". Aborting the signal ends a running turn.
|
|
67
|
-
*/
|
|
53
|
+
} & Partial<Pick<RoomleEmbeddingApi<unknown, unknown>, 'startRelay' | 'ui'>>;
|
|
68
54
|
export interface PlanningAssistantControl {
|
|
69
55
|
suspend(): Promise<void>;
|
|
70
56
|
resume(): Promise<void>;
|
|
71
57
|
dispose(): Promise<void>;
|
|
72
58
|
}
|
|
59
|
+
/** The host's model as the planner takes it, without key, base URL or headers. */
|
|
60
|
+
export declare const plannerConfigOf: (config: PlanningAssistantConfig) => PlanningAssistantConfig;
|
|
61
|
+
/** Starts the HI Planning Assistant of the planner on the model of this page; aborting the signal stops it. */
|
|
73
62
|
export declare const startPlanningAssistant: (roomDesignerApi: PlanningAssistantPlannerApi, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<PlanningAssistantControl | undefined>;
|
|
@@ -5,4 +5,4 @@ export { createAssistant } from './common-core/src/planning-assistant/runtime';
|
|
|
5
5
|
export { MAX_TURN_STEPS, TURN_TIMEOUT_MS, lastTurnStep, } from './common-core/src/planning-assistant/turn-limits';
|
|
6
6
|
export { createChatRecovery } from './common-core/src/planning-assistant/chat-recovery';
|
|
7
7
|
export { responsesProviderOf, isRejectedContinuation, withoutStoredItems, } from './common-core/src/planning-assistant/continuation';
|
|
8
|
-
export { tokenCount, tokenCounts, sumCounts, } from './common-core/src/planning-assistant/usage';
|
|
8
|
+
export { tokenCount, tokenCounts, sumCounts, describeRequestBody, } from './common-core/src/planning-assistant/usage';
|
|
@@ -14,3 +14,18 @@ export declare const tokenCounts: (usage?: {
|
|
|
14
14
|
export declare const sumCounts: (counts: Array<number | null>) => number;
|
|
15
15
|
/** The size of a text in UTF-8 bytes, as a request carries it. */
|
|
16
16
|
export declare const bytesOf: (value: string) => number;
|
|
17
|
+
/** The UTF-8 size of a text and its SHA-256; null where the browser has no digest. */
|
|
18
|
+
export declare const describePayload: (text: string) => Promise<{
|
|
19
|
+
bytes: number;
|
|
20
|
+
sha256: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** The size and digest of a request body, its tool definitions and each input item of a Responses request. */
|
|
23
|
+
export declare const describeRequestBody: (text: string) => Promise<{
|
|
24
|
+
bytes: number;
|
|
25
|
+
sha256: string;
|
|
26
|
+
} | {
|
|
27
|
+
toolsBytes: number;
|
|
28
|
+
input: any[];
|
|
29
|
+
bytes: number;
|
|
30
|
+
sha256: string;
|
|
31
|
+
}>;
|
package/sbom.cdx.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.6",
|
|
5
5
|
"version": 1,
|
|
6
|
-
"serialNumber": "urn:uuid:
|
|
6
|
+
"serialNumber": "urn:uuid:7288c771-e968-58b9-b6a3-f3d88ef4f398",
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-22T19:26:31.000Z",
|
|
9
9
|
"component": {
|
|
10
10
|
"type": "library",
|
|
11
11
|
"name": "@roomle/embedding-lib",
|
|
12
|
-
"version": "
|
|
13
|
-
"bom-ref": "@roomle/embedding-lib@
|
|
12
|
+
"version": "f0a595fb3082ce97654bc9f722e3cd2e57b5de04",
|
|
13
|
+
"bom-ref": "@roomle/embedding-lib@f0a595fb3082ce97654bc9f722e3cd2e57b5de04"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"components": [
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
],
|
|
352
352
|
"dependencies": [
|
|
353
353
|
{
|
|
354
|
-
"ref": "@roomle/embedding-lib@
|
|
354
|
+
"ref": "@roomle/embedding-lib@f0a595fb3082ce97654bc9f722e3cd2e57b5de04"
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"ref": "pkg:npm/%40ai-sdk/anthropic@4.0.68"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
var e = (e) => e.provider === "host" ? e.responsesProvider ?? null : e.provider === "openai" || e.provider === "openai-compatible" && e.responses && e.storedResponses ? "openai" : e.provider !== "azure" || e.chatCompletions ? null : "azure", t = /^(Previous response with id '[^']*' not found|No tool output found for function call )/, n = (e) => e instanceof Error && t.test(e.message), r = (e) => {
|
|
3
|
+
if (e.role !== "assistant" || !Array.isArray(e.content)) return e;
|
|
4
|
+
let t = e.content;
|
|
5
|
+
return {
|
|
6
|
+
...e,
|
|
7
|
+
content: t.map((e) => e.type !== "text" && e.type !== "reasoning" || !e.providerOptions ? e : {
|
|
8
|
+
...e,
|
|
9
|
+
providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
}, i = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : null, a = (e = {}) => {
|
|
13
|
+
let t = i(e.inputTokens), n = i(e.outputTokens);
|
|
14
|
+
return {
|
|
15
|
+
inputTokens: t,
|
|
16
|
+
outputTokens: n,
|
|
17
|
+
totalTokens: i(e.totalTokens) ?? (t !== null && n !== null ? t + n : null)
|
|
18
|
+
};
|
|
19
|
+
}, o = (e) => e.some((e) => e !== null) ? e.reduce((e, t) => e + (t ?? 0), 0) : null, s = (e) => new TextEncoder().encode(e).length, c = async (e) => {
|
|
20
|
+
let t = new TextEncoder().encode(e), n = await globalThis.crypto?.subtle?.digest("SHA-256", t);
|
|
21
|
+
return {
|
|
22
|
+
bytes: t.byteLength,
|
|
23
|
+
sha256: n ? Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("") : null
|
|
24
|
+
};
|
|
25
|
+
}, l = async (e) => {
|
|
26
|
+
let t = await c(e), n = JSON.parse(e);
|
|
27
|
+
return Array.isArray(n.input) ? {
|
|
28
|
+
...t,
|
|
29
|
+
toolsBytes: n.tools ? s(JSON.stringify(n.tools)) : 0,
|
|
30
|
+
input: await Promise.all(n.input.map((e) => c(JSON.stringify(e))))
|
|
31
|
+
} : t;
|
|
32
|
+
};
|
|
33
|
+
export { n as a, a as i, l as n, e as o, o as r, r as s, s as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
// packages/web-sdk/packages/common-core/src/planning-assistant/continuation.ts
|
|
3
|
+
var e = (e) => e.provider === "host" ? e.responsesProvider ?? null : e.provider === "openai" || e.provider === "openai-compatible" && e.responses && e.storedResponses ? "openai" : e.provider === "azure" && !e.chatCompletions ? "azure" : null, t = /^(Previous response with id '[^']*' not found|No tool output found for function call )/, n = (e) => e instanceof Error && t.test(e.message), r = (e) => {
|
|
4
|
+
if (e.role !== "assistant" || !Array.isArray(e.content)) return e;
|
|
5
|
+
let t = e.content;
|
|
6
|
+
return {
|
|
7
|
+
...e,
|
|
8
|
+
content: t.map((e) => (e.type === "text" || e.type === "reasoning") && e.providerOptions ? {
|
|
9
|
+
...e,
|
|
10
|
+
providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
|
|
11
|
+
} : e)
|
|
12
|
+
};
|
|
13
|
+
}, i = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : null, a = (e = {}) => {
|
|
14
|
+
let t = i(e.inputTokens), n = i(e.outputTokens);
|
|
15
|
+
return {
|
|
16
|
+
inputTokens: t,
|
|
17
|
+
outputTokens: n,
|
|
18
|
+
totalTokens: i(e.totalTokens) ?? (t !== null && n !== null ? t + n : null)
|
|
19
|
+
};
|
|
20
|
+
}, o = (e) => e.some((e) => e !== null) ? e.reduce((e, t) => e + (t ?? 0), 0) : null, s = (e) => new TextEncoder().encode(e).length, c = async (e) => {
|
|
21
|
+
let t = new TextEncoder().encode(e), n = await globalThis.crypto?.subtle?.digest("SHA-256", t);
|
|
22
|
+
return {
|
|
23
|
+
bytes: t.byteLength,
|
|
24
|
+
sha256: n ? Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("") : null
|
|
25
|
+
};
|
|
26
|
+
}, l = async (e) => {
|
|
27
|
+
let t = await c(e), n = JSON.parse(e);
|
|
28
|
+
return Array.isArray(n.input) ? {
|
|
29
|
+
...t,
|
|
30
|
+
toolsBytes: n.tools ? s(JSON.stringify(n.tools)) : 0,
|
|
31
|
+
input: await Promise.all(n.input.map((e) => c(JSON.stringify(e))))
|
|
32
|
+
} : t;
|
|
33
|
+
};
|
|
34
|
+
export { n as a, a as i, l as n, e as o, o as r, r as s, s as t };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// packages/web-sdk/packages/common-core/src/planning-assistant/continuation.ts
|
|
3
|
-
var e = (e) => e.provider === "host" ? e.responsesProvider ?? null : e.provider === "openai" || e.provider === "openai-compatible" && e.responses && e.storedResponses ? "openai" : e.provider === "azure" && !e.chatCompletions ? "azure" : null, t = /^(Previous response with id '[^']*' not found|No tool output found for function call )/, n = (e) => e instanceof Error && t.test(e.message), r = (e) => {
|
|
4
|
-
if (e.role !== "assistant" || !Array.isArray(e.content)) return e;
|
|
5
|
-
let t = e.content;
|
|
6
|
-
return {
|
|
7
|
-
...e,
|
|
8
|
-
content: t.map((e) => (e.type === "text" || e.type === "reasoning") && e.providerOptions ? {
|
|
9
|
-
...e,
|
|
10
|
-
providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
|
|
11
|
-
} : e)
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export { e as n, r, n as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var e = (e) => e.provider === "host" ? e.responsesProvider ?? null : e.provider === "openai" || e.provider === "openai-compatible" && e.responses && e.storedResponses ? "openai" : e.provider !== "azure" || e.chatCompletions ? null : "azure", t = /^(Previous response with id '[^']*' not found|No tool output found for function call )/, n = (e) => e instanceof Error && t.test(e.message), r = (e) => {
|
|
3
|
-
if (e.role !== "assistant" || !Array.isArray(e.content)) return e;
|
|
4
|
-
let t = e.content;
|
|
5
|
-
return {
|
|
6
|
-
...e,
|
|
7
|
-
content: t.map((e) => e.type !== "text" && e.type !== "reasoning" || !e.providerOptions ? e : {
|
|
8
|
-
...e,
|
|
9
|
-
providerOptions: Object.fromEntries(Object.entries(e.providerOptions).map(([e, t]) => [e, Object.fromEntries(Object.entries(t).filter(([e]) => e !== "itemId"))]))
|
|
10
|
-
})
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export { e as n, r, n as t };
|