@roomle/embedding-lib 0.0.0-dev-035a65b → 0.0.0-dev-a4beb99
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.js +21 -3
- package/ai.min.js +21 -3
- package/hi.js +30 -2
- package/hi.min.js +30 -2
- package/package.json +1 -1
- package/packages/common/src/utils/ai-model-relay.d.ts +72 -0
- package/packages/embedding-lib/src/ai.d.ts +10 -2
- package/packages/embedding-lib/src/hi.d.ts +1 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-model-proxy.d.ts +26 -0
- package/packages/embedding-lib/src/image-edits.d.ts +21 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-recovery.d.ts +12 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/runtime.d.ts +17 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +36 -0
- package/sbom.cdx.json +5 -5
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Third-party software notices for @roomle/embedding-lib
|
|
2
|
-
Generated 2026-11-
|
|
1
|
+
Third-party software notices for @roomle/embedding-lib a4beb9922a2e4706b508e03482ab924e59466983
|
|
2
|
+
Generated 2026-11-10
|
|
3
3
|
|
|
4
4
|
This product includes the following third-party components.
|
|
5
5
|
|
package/ai.js
CHANGED
|
@@ -36,7 +36,22 @@ var e = "roomle_ai_model_connect", t = () => import("./comlink-m82YLjsS.mjs"), n
|
|
|
36
36
|
return window.addEventListener("message", s), () => {
|
|
37
37
|
window.removeEventListener("message", s), o.forEach((e) => e.close());
|
|
38
38
|
};
|
|
39
|
-
}, i =
|
|
39
|
+
}, i = (e = "1:1") => {
|
|
40
|
+
let [t, n] = e.split(":").map(Number);
|
|
41
|
+
return t === n ? "1024x1024" : t > n ? "1536x1024" : "1024x1536";
|
|
42
|
+
}, a = async (e) => (await fetch(e)).blob(), o = async (e, t, { baseUrl: n, model: r, headers: o }) => {
|
|
43
|
+
let { prompt: s, image: c, aspect: l } = JSON.parse(e.body), u = await a(c), d = new FormData();
|
|
44
|
+
d.append("model", r), d.append("prompt", s), d.append("size", i(l)), d.append("quality", "medium"), d.append("output_format", "png"), d.append("image", u, `scene.${u.type.split("/")[1]}`);
|
|
45
|
+
let f = await fetch(`${n}/images/edits`, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: o,
|
|
48
|
+
body: d,
|
|
49
|
+
signal: t
|
|
50
|
+
});
|
|
51
|
+
if (!f.ok) return f;
|
|
52
|
+
let { data: p } = await f.json(), m = p?.[0]?.b64_json, h = new FormData();
|
|
53
|
+
return m ? h.append("image", await a(`data:image/png;base64,${m}`)) : h.append("text", "The endpoint returned no image"), new Response(h);
|
|
54
|
+
}, s = async (e, { features: t, ...n }) => {
|
|
40
55
|
if (t?.length === 0) throw Error("serveAiModelRequests: features is empty; leave it out to serve every feature");
|
|
41
56
|
let i = e.startRelay("ai", (e, t) => r(e, t, n));
|
|
42
57
|
try {
|
|
@@ -55,6 +70,9 @@ var e = "roomle_ai_model_connect", t = () => import("./comlink-m82YLjsS.mjs"), n
|
|
|
55
70
|
i.isCurrent() && (i.stop(), await e.ui.setAiModelHost(null));
|
|
56
71
|
}
|
|
57
72
|
};
|
|
58
|
-
}
|
|
73
|
+
}, c = (e, t) => s(e, {
|
|
74
|
+
features: ["lifestyle-rendering"],
|
|
75
|
+
onAiModelRequest: (e, n) => o(e, n, t)
|
|
76
|
+
});
|
|
59
77
|
//#endregion
|
|
60
|
-
export {
|
|
78
|
+
export { o as requestImageEdits, s as serveAiModelRequests, c as serveImageEdits };
|
package/ai.min.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
/*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
|
|
2
|
-
var e = async (e,
|
|
2
|
+
var e = async (e) => (await fetch(e)).blob(), t = async (t, n, { baseUrl: r, model: i, headers: a }) => {
|
|
3
|
+
let { prompt: o, image: s, aspect: c } = JSON.parse(t.body), l = await e(s), u = new FormData();
|
|
4
|
+
u.append("model", i), u.append("prompt", o), u.append("size", ((e = "1:1") => {
|
|
5
|
+
let [t, n] = e.split(":").map(Number);
|
|
6
|
+
return t === n ? "1024x1024" : t > n ? "1536x1024" : "1024x1536";
|
|
7
|
+
})(c)), u.append("quality", "medium"), u.append("output_format", "png"), u.append("image", l, `scene.${l.type.split("/")[1]}`);
|
|
8
|
+
let d = await fetch(`${r}/images/edits`, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: a,
|
|
11
|
+
body: u,
|
|
12
|
+
signal: n
|
|
13
|
+
});
|
|
14
|
+
if (!d.ok) return d;
|
|
15
|
+
let { data: f } = await d.json(), p = f?.[0]?.b64_json, m = new FormData();
|
|
16
|
+
return p ? m.append("image", await e(`data:image/png;base64,${p}`)) : m.append("text", "The endpoint returned no image"), new Response(m);
|
|
17
|
+
}, n = async (e, { features: t, ...n }) => {
|
|
3
18
|
if (t?.length === 0) throw Error("serveAiModelRequests: features is empty; leave it out to serve every feature");
|
|
4
19
|
let r = e.startRelay("ai", (e, t) => ((e, t, n) => {
|
|
5
20
|
let r = [], i = async (i) => {
|
|
@@ -54,5 +69,8 @@ var e = async (e, { features: t, ...n }) => {
|
|
|
54
69
|
r.isCurrent() && (r.stop(), await e.ui.setAiModelHost(null));
|
|
55
70
|
}
|
|
56
71
|
};
|
|
57
|
-
}
|
|
58
|
-
|
|
72
|
+
}, r = (e, r) => n(e, {
|
|
73
|
+
features: ["lifestyle-rendering"],
|
|
74
|
+
onAiModelRequest: (e, n) => t(e, n, r)
|
|
75
|
+
});
|
|
76
|
+
export { t as requestImageEdits, n as serveAiModelRequests, r as serveImageEdits };
|
package/hi.js
CHANGED
|
@@ -330,10 +330,38 @@ var i = (e, t) => t === e.libraryId ? e : {
|
|
|
330
330
|
type: "availability",
|
|
331
331
|
available: !0
|
|
332
332
|
});
|
|
333
|
-
}, L = {
|
|
333
|
+
}, L = 5e3, R = async ({ serverUrl: e, authorization: t }) => {
|
|
334
|
+
let n = t ? { Authorization: t } : {}, r;
|
|
335
|
+
try {
|
|
336
|
+
let t = await fetch(`${e}/backends/list`, {
|
|
337
|
+
headers: n,
|
|
338
|
+
signal: AbortSignal.timeout(L)
|
|
339
|
+
});
|
|
340
|
+
r = t.ok ? await t.json() : [];
|
|
341
|
+
} catch (e) {
|
|
342
|
+
return console.warn("No HI model proxy: the backend list failed", e), {};
|
|
343
|
+
}
|
|
344
|
+
if (!Array.isArray(r) || r.length !== 1) return {};
|
|
345
|
+
let [{ enableAIPlanning: i, enableAIRendering: a }] = r, o = `${e}/api/ai/v1`;
|
|
346
|
+
return {
|
|
347
|
+
...i === !0 && { chat: {
|
|
348
|
+
provider: "openai-compatible",
|
|
349
|
+
baseUrl: o,
|
|
350
|
+
model: "planning",
|
|
351
|
+
headers: n,
|
|
352
|
+
responses: !0,
|
|
353
|
+
readsImages: !0
|
|
354
|
+
} },
|
|
355
|
+
...a === !0 && { rendering: {
|
|
356
|
+
baseUrl: o,
|
|
357
|
+
model: "rendering",
|
|
358
|
+
headers: n
|
|
359
|
+
} }
|
|
360
|
+
};
|
|
361
|
+
}, z = {
|
|
334
362
|
HIDE: "hide",
|
|
335
363
|
SHOW_ATTRIBUTES: "attributes",
|
|
336
364
|
SHOW_ARTICLES: "articles"
|
|
337
365
|
};
|
|
338
366
|
//#endregion
|
|
339
|
-
export {
|
|
367
|
+
export { z as HI_PANEL_ACTION, y as cleanupHi, p as createHiLibraryCallbacks, b as createHiMcpTools, u as libLoadArticleCatalog, f as libLoadCalcScript, d as libLoadMasterData, n as loadChatModel, h as omGetRequest, m as omPostRequest, s as registerLegacyUrlFormat, R as resolveHiModelProxy, v as setupHi, I as startPlanningAssistant, c as unregisterLegacyUrlFormat };
|
package/hi.min.js
CHANGED
|
@@ -294,9 +294,37 @@ var i = (e, t) => t === e.libraryId ? e : {
|
|
|
294
294
|
type: "availability",
|
|
295
295
|
available: !0
|
|
296
296
|
});
|
|
297
|
-
}, M = {
|
|
297
|
+
}, M = async ({ serverUrl: e, authorization: t }) => {
|
|
298
|
+
let n = t ? { Authorization: t } : {}, r;
|
|
299
|
+
try {
|
|
300
|
+
let t = await fetch(`${e}/backends/list`, {
|
|
301
|
+
headers: n,
|
|
302
|
+
signal: AbortSignal.timeout(5e3)
|
|
303
|
+
});
|
|
304
|
+
r = t.ok ? await t.json() : [];
|
|
305
|
+
} catch {
|
|
306
|
+
return {};
|
|
307
|
+
}
|
|
308
|
+
if (!Array.isArray(r) || r.length !== 1) return {};
|
|
309
|
+
let [{ enableAIPlanning: i, enableAIRendering: a }] = r, o = `${e}/api/ai/v1`;
|
|
310
|
+
return {
|
|
311
|
+
...!0 === i && { chat: {
|
|
312
|
+
provider: "openai-compatible",
|
|
313
|
+
baseUrl: o,
|
|
314
|
+
model: "planning",
|
|
315
|
+
headers: n,
|
|
316
|
+
responses: !0,
|
|
317
|
+
readsImages: !0
|
|
318
|
+
} },
|
|
319
|
+
...!0 === a && { rendering: {
|
|
320
|
+
baseUrl: o,
|
|
321
|
+
model: "rendering",
|
|
322
|
+
headers: n
|
|
323
|
+
} }
|
|
324
|
+
};
|
|
325
|
+
}, N = {
|
|
298
326
|
HIDE: "hide",
|
|
299
327
|
SHOW_ATTRIBUTES: "attributes",
|
|
300
328
|
SHOW_ARTICLES: "articles"
|
|
301
329
|
};
|
|
302
|
-
export {
|
|
330
|
+
export { N as HI_PANEL_ACTION, v as cleanupHi, p as createHiLibraryCallbacks, y as createHiMcpTools, u as libLoadArticleCatalog, f as libLoadCalcScript, d as libLoadMasterData, n as loadChatModel, h as omGetRequest, m as omPostRequest, s as registerLegacyUrlFormat, M as resolveHiModelProxy, _ as setupHi, j as startPlanningAssistant, c as unregisterLegacyUrlFormat };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-a4beb99",
|
|
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",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iframe hands its AI model requests to the host page ("bring your own
|
|
3
|
+
* endpoint"), over Comlink on a port it sends, like connect_hi
|
|
4
|
+
*/
|
|
5
|
+
export type AiFeature = 'lifestyle-rendering';
|
|
6
|
+
/**
|
|
7
|
+
* The feature names what the request is for, so no route, method or headers
|
|
8
|
+
* of a built-in endpoint reach the host. A feature with several operations
|
|
9
|
+
* (e.g. edit, upscale) would add an `operation` field then; today each
|
|
10
|
+
* feature has one.
|
|
11
|
+
*/
|
|
12
|
+
export interface AiModelRequest {
|
|
13
|
+
feature: AiFeature;
|
|
14
|
+
/** The feature's input as JSON, e.g. a RenderingInput; never a key */
|
|
15
|
+
body: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A rendering request, the same on every route: JSON for a host page's own
|
|
19
|
+
* endpoint, the b2c-api's multipart form for the built-in one. The named
|
|
20
|
+
* fields are the contract; options added later come as further fields, which
|
|
21
|
+
* a host may ignore.
|
|
22
|
+
*/
|
|
23
|
+
export interface RenderingInput {
|
|
24
|
+
prompt: string;
|
|
25
|
+
/** The upload as a data URL */
|
|
26
|
+
image: string;
|
|
27
|
+
/** Output size tier, e.g. 2K */
|
|
28
|
+
size?: string;
|
|
29
|
+
/** Supported ratio closest to the image, e.g. 3:2 */
|
|
30
|
+
aspect?: string;
|
|
31
|
+
/** Image model of the backend; unset: its default */
|
|
32
|
+
model?: string;
|
|
33
|
+
[option: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
export type AiModelAuthReason = 'start' | 'expired';
|
|
36
|
+
export interface AiModelHandlers {
|
|
37
|
+
onAiModelRequest(request: AiModelRequest, signal: AbortSignal): Promise<Response>;
|
|
38
|
+
/**
|
|
39
|
+
* The host's login: 'start' when the chat shows signed out, 'expired'
|
|
40
|
+
* after a 401; true unlocks the AI features. Without it there is no login
|
|
41
|
+
* gate.
|
|
42
|
+
*/
|
|
43
|
+
onRequestAiModelAuth?(reason: AiModelAuthReason, feature: AiFeature): Promise<boolean>;
|
|
44
|
+
}
|
|
45
|
+
/** The host page ended the request itself, e.g. aborted its own fetch */
|
|
46
|
+
export declare class AiModelRequestCancelledError extends Error {
|
|
47
|
+
constructor();
|
|
48
|
+
}
|
|
49
|
+
interface AiModelAnswer {
|
|
50
|
+
status: number;
|
|
51
|
+
statusText: string;
|
|
52
|
+
headers: [string, string][];
|
|
53
|
+
body: ArrayBuffer;
|
|
54
|
+
}
|
|
55
|
+
export interface AiModelHost {
|
|
56
|
+
request(request: AiModelRequest, signal: AbortSignal): Promise<AiModelAnswer>;
|
|
57
|
+
auth(reason: AiModelAuthReason, feature: AiFeature): Promise<boolean>;
|
|
58
|
+
}
|
|
59
|
+
export interface AiModelConnection extends AiModelHost {
|
|
60
|
+
/** Ends the connection; the host's side ends with its relay */
|
|
61
|
+
close(): void;
|
|
62
|
+
}
|
|
63
|
+
export declare const connectAiModelHost: (host: Window) => AiModelConnection;
|
|
64
|
+
/** Rejects at once on `signal`'s abort, whether the host stops or not */
|
|
65
|
+
export declare const relayAiModelRequest: (host: AiModelHost, request: AiModelRequest, signal?: AbortSignal) => Promise<Response>;
|
|
66
|
+
/**
|
|
67
|
+
* False once `signal` aborts, whatever the host answers later, and when the
|
|
68
|
+
* relay fails
|
|
69
|
+
*/
|
|
70
|
+
export declare const relayAiModelAuth: (host: AiModelHost, reason: AiModelAuthReason, feature: AiFeature, signal?: AbortSignal) => Promise<boolean>;
|
|
71
|
+
export declare const serveAiModelRelay: (source: Window, origin: string, handlers: AiModelHandlers) => (() => void);
|
|
72
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as RoomleEmbeddingApi } from './roomle-embedding-lib';
|
|
2
2
|
import { AiFeature, AiModelHandlers } from '../../common/src/utils/ai-model-relay';
|
|
3
|
-
|
|
4
|
-
export type { RenderingInput } from '
|
|
3
|
+
import { ImageEditsEndpoint } from './image-edits';
|
|
4
|
+
export type { AiFeature, AiModelAuthReason, AiModelHandlers, AiModelRequest, RenderingInput, } from '../../common/src/utils/ai-model-relay';
|
|
5
|
+
export { type ImageEditsEndpoint, requestImageEdits } from './image-edits';
|
|
5
6
|
export interface AiModelHostOptions extends AiModelHandlers {
|
|
6
7
|
/**
|
|
7
8
|
* The features the host answers; the others keep the built-in endpoints.
|
|
@@ -26,3 +27,10 @@ export interface AiModelHostControl {
|
|
|
26
27
|
* cannot take the host, e.g. an older UI without the AI relay.
|
|
27
28
|
*/
|
|
28
29
|
export declare const serveAiModelRequests: (instance: Pick<RoomleEmbeddingApi<unknown, unknown>, "startRelay" | "ui">, { features, ...handlers }: AiModelHostOptions) => Promise<AiModelHostControl>;
|
|
30
|
+
/**
|
|
31
|
+
* The host page answers the renderings of the AI image chat at an
|
|
32
|
+
* images/edits endpoint (see requestImageEdits); the other AI features keep
|
|
33
|
+
* the built-in endpoints. A host page with its own login calls
|
|
34
|
+
* serveAiModelRequests with requestImageEdits and onRequestAiModelAuth.
|
|
35
|
+
*/
|
|
36
|
+
export declare const serveImageEdits: (instance: Pick<RoomleEmbeddingApi<unknown, unknown>, "startRelay" | "ui">, endpoint: ImageEditsEndpoint) => Promise<AiModelHostControl>;
|
|
@@ -16,5 +16,6 @@ export { omPostRequest, omGetRequest, } from './homag-intelligence/hi-order-mana
|
|
|
16
16
|
export { setupHi, cleanupHi } from './homag-intelligence/hi-setup';
|
|
17
17
|
export { createHiMcpTools, type HiMcpTool, type HiMcpTools, type HiMcpPlannerApi, } from './homag-intelligence/hi-mcp-tools';
|
|
18
18
|
export { loadChatModel, startPlanningAssistant, type PlanningAssistantConfig, type PlanningAssistantPlannerApi, } from './homag-intelligence/hi-planning-assistant';
|
|
19
|
+
export { resolveHiModelProxy, type HiModelProxy, type HiModelProxyOptions, } from './homag-intelligence/hi-model-proxy';
|
|
19
20
|
export { type ExternalObjectSnapshotSaveResult, type HiContextAction, } from '../../web-sdk/packages';
|
|
20
21
|
export { HI_PANEL_ACTION, type HiPanelActionType, type HiOrderHeader, type HiOrder, type HiOrderData, type HiPriceData, type HiCallbacks, } from '../../common/src/hi/hi-types';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ImageEditsEndpoint } from '../image-edits';
|
|
2
|
+
import { PlanningAssistantConfig } from '../planning-assistant/chat-model';
|
|
3
|
+
/**
|
|
4
|
+
* What the model proxy of the HI server serves the HI user. The model, its
|
|
5
|
+
* endpoint and its key stay in the backend; the page sends only its
|
|
6
|
+
* authorization.
|
|
7
|
+
*/
|
|
8
|
+
export interface HiModelProxy {
|
|
9
|
+
/** The AI Planning Assistant, when the backend's `enableAIPlanning` is true */
|
|
10
|
+
chat?: PlanningAssistantConfig;
|
|
11
|
+
/** The lifestyle renderings of the AI image chat, when the backend's `enableAIRendering` is true */
|
|
12
|
+
rendering?: ImageEditsEndpoint;
|
|
13
|
+
}
|
|
14
|
+
export interface HiModelProxyOptions {
|
|
15
|
+
/** The HI server, e.g. `https://dfscfgtest01-app.azurewebsites.net`; `''` for the page's own origin */
|
|
16
|
+
serverUrl: string;
|
|
17
|
+
/** The Basic authorization of the HI user; without it, the browser's session of a same-origin page */
|
|
18
|
+
authorization?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reads the backend list of the HI user and returns what the model proxy of
|
|
22
|
+
* the HI server serves. The proxy serves only a user of exactly one backend:
|
|
23
|
+
* the chat when that backend's `enableAIPlanning` is true, the renderings
|
|
24
|
+
* when its `enableAIRendering` is true. A failed backend list serves neither.
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveHiModelProxy: ({ serverUrl, authorization, }: HiModelProxyOptions) => Promise<HiModelProxy>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AiModelRequest } from '../../common/src/utils/ai-model-relay';
|
|
2
|
+
/**
|
|
3
|
+
* An endpoint that speaks OpenAI images/edits, e.g. the model proxy of the HI
|
|
4
|
+
* server or an Azure AI Foundry resource
|
|
5
|
+
*/
|
|
6
|
+
export interface ImageEditsEndpoint {
|
|
7
|
+
/** The OpenAI v1 base URL; the request goes to `<baseUrl>/images/edits` */
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
/** The model name the endpoint expects, e.g. `rendering` on the HI model proxy */
|
|
10
|
+
model: string;
|
|
11
|
+
/** Sent with every request, e.g. `Authorization` or `api-key` */
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Answers a rendering request of the AI image chat at an images/edits
|
|
16
|
+
* endpoint: sends the prompt and the capture with the endpoint's model and
|
|
17
|
+
* headers, and answers the chat with a form holding the image, or a text when
|
|
18
|
+
* the endpoint returns none. An error answer goes back unchanged: the chat
|
|
19
|
+
* reads its status, its `Retry-After` and OpenAI's `error.message` itself.
|
|
20
|
+
*/
|
|
21
|
+
export declare const requestImageEdits: (request: AiModelRequest, signal: AbortSignal, { baseUrl, model, headers }: ImageEditsEndpoint) => Promise<Response>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AgentMcpTools } from './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, domain?: {
|
|
7
|
+
subject: string;
|
|
8
|
+
readTools: ReadonlySet<string>;
|
|
9
|
+
}) => {
|
|
10
|
+
tools: AgentMcpTools;
|
|
11
|
+
summary: () => string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../planning-assistant';
|
|
2
|
+
import { PlanningAssistantConfig } from './chat-model';
|
|
3
|
+
import { AgentMcpTools } from './mcp-tools';
|
|
4
|
+
/** Runs a browser agent with the tools and prompts supplied by its SDK domain. */
|
|
5
|
+
export declare const createAssistant: (config: PlanningAssistantConfig, signal: AbortSignal, output: (part: PlanningAssistantOutput) => unknown, setupDomain: () => Promise<{
|
|
6
|
+
prompts: {
|
|
7
|
+
systemPrompt: string;
|
|
8
|
+
imagePrompt: string;
|
|
9
|
+
};
|
|
10
|
+
tools: AgentMcpTools;
|
|
11
|
+
}>, turnPolicy?: {
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
recovery: (tools: AgentMcpTools) => {
|
|
14
|
+
tools: AgentMcpTools;
|
|
15
|
+
summary(): string;
|
|
16
|
+
};
|
|
17
|
+
}) => Promise<(prompt: PlanningAssistantPrompt) => Promise<void>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** The message the user sends in the AI Planning Assistant window. */
|
|
2
|
+
export interface PlanningAssistantPrompt {
|
|
3
|
+
/** What the user typed, trimmed; empty when the user sends only an image. */
|
|
4
|
+
text: string;
|
|
5
|
+
/** The images of the message as JPEG data URLs: the long side at most 1568 px, EXIF rotation applied, transparent parts white. */
|
|
6
|
+
images: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One part of the output of the host's planning agent for the AI Planning Assistant window:
|
|
10
|
+
* - "text": a piece of the answer of the running turn, markdown, appended to the answer
|
|
11
|
+
* - "activity": what the agent does now, e.g. the tool it runs, shown in the status line
|
|
12
|
+
* - "error": the turn failed; the text replaces the answer of the turn and ends the turn
|
|
13
|
+
* - "done": the turn is complete; the input is free again
|
|
14
|
+
* - "availability": the input on or off, with the reason shown in the status line; off until the host enables it
|
|
15
|
+
* - "images": the image drop on or off; off until the host enables it
|
|
16
|
+
*/
|
|
17
|
+
export type PlanningAssistantOutput = {
|
|
18
|
+
type: 'text';
|
|
19
|
+
text: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'activity';
|
|
22
|
+
text: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'error';
|
|
25
|
+
text: string;
|
|
26
|
+
statusCode?: number;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'done';
|
|
29
|
+
} | {
|
|
30
|
+
type: 'availability';
|
|
31
|
+
available: boolean;
|
|
32
|
+
text?: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'images';
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
};
|
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:60e139e3-8e8f-5f10-bcb0-b35b5ba83ae0",
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-10T06:25:07.000Z",
|
|
9
9
|
"component": {
|
|
10
10
|
"type": "library",
|
|
11
11
|
"name": "@roomle/embedding-lib",
|
|
12
|
-
"version": "
|
|
13
|
-
"bom-ref": "@roomle/embedding-lib@
|
|
12
|
+
"version": "a4beb9922a2e4706b508e03482ab924e59466983",
|
|
13
|
+
"bom-ref": "@roomle/embedding-lib@a4beb9922a2e4706b508e03482ab924e59466983"
|
|
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@a4beb9922a2e4706b508e03482ab924e59466983"
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"ref": "pkg:npm/%40ai-sdk/anthropic@4.0.68"
|