@builder.io/ai-utils 0.3.11 → 0.3.13
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/README.md +3 -0
- package/package.json +1 -1
- package/src/codegen.ts +668 -0
- package/src/completion.ts +174 -0
- package/src/events.ts +485 -0
- package/src/mapping.ts +98 -0
- package/src/messages.ts +340 -0
- package/src/settings.ts +59 -0
- package/src/codegen.d.ts +0 -447
- package/src/codegen.js +0 -1
- package/src/completion.d.ts +0 -154
- package/src/completion.js +0 -1
- package/src/events.d.ts +0 -369
- package/src/events.js +0 -1
- package/src/index.js +0 -6
- package/src/mapping.d.ts +0 -86
- package/src/mapping.js +0 -1
- package/src/messages.d.ts +0 -196
- package/src/messages.js +0 -16
- package/src/settings.d.ts +0 -20
- package/src/settings.js +0 -30
- /package/src/{index.d.ts → index.ts} +0 -0
package/src/settings.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const urlParamSettings = [
|
|
2
|
-
"assistantType",
|
|
3
|
-
"theme",
|
|
4
|
-
"viewId",
|
|
5
|
-
];
|
|
6
|
-
export function getAssistantUrl(opts = {}) {
|
|
7
|
-
var _a;
|
|
8
|
-
const url = new URL((_a = opts.baseUrl) !== null && _a !== void 0 ? _a : (opts.local ? "http://localhost:7242" : "https://assistant.builder.io"));
|
|
9
|
-
urlParamSettings.forEach((key) => {
|
|
10
|
-
const value = opts[key];
|
|
11
|
-
if (typeof value === "string" || typeof value === "boolean") {
|
|
12
|
-
url.searchParams.set(key, String(value));
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return url.href;
|
|
16
|
-
}
|
|
17
|
-
export function parseAssistantUrlSettings(url) {
|
|
18
|
-
const parsed = new URL(url);
|
|
19
|
-
const settings = {};
|
|
20
|
-
urlParamSettings.forEach((key) => {
|
|
21
|
-
const value = parsed.searchParams.get(key);
|
|
22
|
-
if (value === "true" || value === "false") {
|
|
23
|
-
settings[key] = value === "true";
|
|
24
|
-
}
|
|
25
|
-
else if (value) {
|
|
26
|
-
settings[key] = value;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return settings;
|
|
30
|
-
}
|
|
File without changes
|