@noodleseed/assistant 1.26.1 → 1.28.0
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 +25 -2
- package/dist/{app-view-element-CiFVNIke.d.cts → app-view-element-BjRkwNN1.d.cts} +1 -1
- package/dist/{app-view-element-C_ATXseu.d.ts → app-view-element-mXHvcAXc.d.ts} +1 -1
- package/dist/app-view.d.cts +3 -3
- package/dist/app-view.d.ts +3 -3
- package/dist/{appearance-C24W6BRj.d.cts → appearance-BpVu3lpk.d.cts} +1 -0
- package/dist/{appearance-C24W6BRj.d.ts → appearance-BpVu3lpk.d.ts} +1 -0
- package/dist/{chunk-OZVDL77T.js → chunk-QH7PL3GU.js} +52 -192
- package/dist/chunk-QH7PL3GU.js.map +1 -0
- package/dist/{chunk-FNXAVRL5.js → chunk-WJV4MJUR.js} +178 -4
- package/dist/chunk-WJV4MJUR.js.map +1 -0
- package/dist/{client-BheCOERq.d.ts → client-CPFw8tfo.d.ts} +1 -1
- package/dist/{client-BiMRVxjs.d.cts → client-_xivfs4q.d.cts} +1 -1
- package/dist/client.cjs +176 -3
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +1 -1
- package/dist/embed.global.js +42 -50
- package/dist/index.cjs +225 -190
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/react/client.cjs +176 -3
- package/dist/react/client.cjs.map +1 -1
- package/dist/react/client.d.cts +2 -2
- package/dist/react/client.d.ts +2 -2
- package/dist/react/client.js +1 -1
- package/dist/react.cjs +225 -190
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +2 -2
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-FNXAVRL5.js.map +0 -1
- package/dist/chunk-OZVDL77T.js.map +0 -1
package/README.md
CHANGED
|
@@ -96,7 +96,11 @@ export default server(
|
|
|
96
96
|
edgeOffset: 20,
|
|
97
97
|
},
|
|
98
98
|
theme: "invert",
|
|
99
|
-
behavior: {
|
|
99
|
+
behavior: {
|
|
100
|
+
showTimestamps: true,
|
|
101
|
+
showPoweredBy: false,
|
|
102
|
+
showConfirmationDetails: false,
|
|
103
|
+
},
|
|
100
104
|
labels: {
|
|
101
105
|
welcomeHeading: "How can Acme help?",
|
|
102
106
|
welcomeMessage: "Fast answers from the tools your team already uses.",
|
|
@@ -160,6 +164,14 @@ The generic prompt chips ship as defaults, while an authored list—including `[
|
|
|
160
164
|
“Available on ChatGPT” promotion. Partial configuration objects merge with the remaining defaults;
|
|
161
165
|
`presentation.panel.surface: "glass"` remains available when a translucent panel is intentional.
|
|
162
166
|
|
|
167
|
+
`behavior.showConfirmationDetails` defaults to `true`. Set it to `false` to remove the built-in
|
|
168
|
+
confirmation card's Additional details disclosure and connector mechanics while keeping its title,
|
|
169
|
+
description, schema-projected business fields, Confirm, and Don't proceed controls. The option changes only
|
|
170
|
+
the managed Web Component's presentation: `confirm: true` still suspends execution, the connector still runs
|
|
171
|
+
only after acceptance, and decline/cancel still stop. Public `embedId` and authenticated `sessionEndpoint`
|
|
172
|
+
React mounts both honor the deployed value without a client prop. Headless/BYO renderers keep the unchanged
|
|
173
|
+
`data-confirmation` part and choose their own presentation.
|
|
174
|
+
|
|
163
175
|
### Configure and deploy
|
|
164
176
|
|
|
165
177
|
Configure the model through Noodle managed config, validate, and deploy the assistant-enabled server before
|
|
@@ -221,6 +233,17 @@ same assistant to anonymous visitors — a marketing site, docs, or landing page
|
|
|
221
233
|
capability allowlist, per-surface daily budgets, and a kill switch. `noodle deploy` provisions a stable
|
|
222
234
|
embed id and prints a one-line snippet; the embed id is deliberately not a credential:
|
|
223
235
|
|
|
236
|
+
```ts
|
|
237
|
+
assistant: embeddedAssistant({
|
|
238
|
+
model,
|
|
239
|
+
access: publicWebsite({
|
|
240
|
+
origins: ["https://www.example.com"],
|
|
241
|
+
capabilities: [answerProductQuestion],
|
|
242
|
+
}),
|
|
243
|
+
behavior: { showConfirmationDetails: false },
|
|
244
|
+
}),
|
|
245
|
+
```
|
|
246
|
+
|
|
224
247
|
```html
|
|
225
248
|
<script src="https://cloud.noodleseed.dev/v1/assistant/embed.js"
|
|
226
249
|
data-embed-id="pub_7f2q4k9x" async></script>
|
|
@@ -688,7 +711,7 @@ context.
|
|
|
688
711
|
|
|
689
712
|
Server branding controls customer name, themed logo/mark/avatar assets, semantic light/dark colors, density,
|
|
690
713
|
radius, typography, and automatic theme. `embeddedAssistant(...)` controls theme selection,
|
|
691
|
-
floating/inline/drawer layout, position and dimensions, mobile and launcher/header/avatar/timestamp/attribution behavior, visible labels, suggested
|
|
714
|
+
floating/inline/drawer layout, position and dimensions, mobile and launcher/header/avatar/timestamp/attribution/confirmation-detail behavior, visible labels, suggested
|
|
692
715
|
prompts, privacy/terms links, locale, and text direction.
|
|
693
716
|
Named slots cover launcher/header/composer/footer extensions. Public methods include `open`, `close`,
|
|
694
717
|
`toggle`, `focusComposer`, `sendMessage`, `stop`, `reconnect`, `updateContext`, `updateModelContext`, `respond`, `confirmTool`, and `resetSession`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AssistantClient, a as AssistantViewAvailableDetail, e as AssistantErrorDetail } from './client-
|
|
1
|
+
import { A as AssistantClient, a as AssistantViewAvailableDetail, e as AssistantErrorDetail } from './client-_xivfs4q.cjs';
|
|
2
2
|
|
|
3
3
|
declare const APP_VIEW_TAG_NAME = "noodle-app-view";
|
|
4
4
|
interface AssistantAppViewErrorDetail {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AssistantClient, a as AssistantViewAvailableDetail, e as AssistantErrorDetail } from './client-
|
|
1
|
+
import { A as AssistantClient, a as AssistantViewAvailableDetail, e as AssistantErrorDetail } from './client-CPFw8tfo.js';
|
|
2
2
|
|
|
3
3
|
declare const APP_VIEW_TAG_NAME = "noodle-app-view";
|
|
4
4
|
interface AssistantAppViewErrorDetail {
|
package/dist/app-view.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as APP_VIEW_TAG_NAME, a as AssistantAppViewErrorDetail, N as NoodleAppViewElement } from './app-view-element-
|
|
2
|
-
export { A as AssistantClient, a as AssistantViewAvailableDetail } from './client-
|
|
3
|
-
import './appearance-
|
|
1
|
+
export { A as APP_VIEW_TAG_NAME, a as AssistantAppViewErrorDetail, N as NoodleAppViewElement } from './app-view-element-BjRkwNN1.cjs';
|
|
2
|
+
export { A as AssistantClient, a as AssistantViewAvailableDetail } from './client-_xivfs4q.cjs';
|
|
3
|
+
import './appearance-BpVu3lpk.cjs';
|
|
4
4
|
import 'ai';
|
|
5
5
|
|
|
6
6
|
/** Register the framework-neutral MCP App host. Safe to call more than once or during SSR. */
|
package/dist/app-view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as APP_VIEW_TAG_NAME, a as AssistantAppViewErrorDetail, N as NoodleAppViewElement } from './app-view-element-
|
|
2
|
-
export { A as AssistantClient, a as AssistantViewAvailableDetail } from './client-
|
|
3
|
-
import './appearance-
|
|
1
|
+
export { A as APP_VIEW_TAG_NAME, a as AssistantAppViewErrorDetail, N as NoodleAppViewElement } from './app-view-element-mXHvcAXc.js';
|
|
2
|
+
export { A as AssistantClient, a as AssistantViewAvailableDetail } from './client-CPFw8tfo.js';
|
|
3
|
+
import './appearance-BpVu3lpk.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
|
|
6
6
|
/** Register the framework-neutral MCP App host. Safe to call more than once or during SSR. */
|
|
@@ -98,6 +98,7 @@ interface AssistantUiConfiguration {
|
|
|
98
98
|
readonly showAvatars?: boolean;
|
|
99
99
|
readonly showTimestamps?: boolean;
|
|
100
100
|
readonly showPoweredBy?: boolean;
|
|
101
|
+
readonly showConfirmationDetails?: boolean;
|
|
101
102
|
};
|
|
102
103
|
readonly labels?: Partial<AssistantLabels>;
|
|
103
104
|
readonly presentation?: AssistantPresentationConfiguration;
|
|
@@ -98,6 +98,7 @@ interface AssistantUiConfiguration {
|
|
|
98
98
|
readonly showAvatars?: boolean;
|
|
99
99
|
readonly showTimestamps?: boolean;
|
|
100
100
|
readonly showPoweredBy?: boolean;
|
|
101
|
+
readonly showConfirmationDetails?: boolean;
|
|
101
102
|
};
|
|
102
103
|
readonly labels?: Partial<AssistantLabels>;
|
|
103
104
|
readonly presentation?: AssistantPresentationConfiguration;
|
|
@@ -8,12 +8,10 @@ import {
|
|
|
8
8
|
copyAssistantModelContext,
|
|
9
9
|
copyAssistantPageContext,
|
|
10
10
|
createAssistantClient,
|
|
11
|
+
parseAssistantConfiguration,
|
|
11
12
|
publicConfigurationUrl,
|
|
12
13
|
sessionSourceKey
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
external_exports
|
|
16
|
-
} from "./chunk-3YYTUJPJ.js";
|
|
14
|
+
} from "./chunk-WJV4MJUR.js";
|
|
17
15
|
|
|
18
16
|
// src/appearance.ts
|
|
19
17
|
var common = {
|
|
@@ -101,7 +99,8 @@ var DEFAULT_APPEARANCE = {
|
|
|
101
99
|
showHeader: true,
|
|
102
100
|
showAvatars: true,
|
|
103
101
|
showTimestamps: false,
|
|
104
|
-
showPoweredBy: true
|
|
102
|
+
showPoweredBy: true,
|
|
103
|
+
showConfirmationDetails: true
|
|
105
104
|
},
|
|
106
105
|
labels: {
|
|
107
106
|
welcomeHeading: "",
|
|
@@ -744,7 +743,7 @@ function createInteractionCard(options) {
|
|
|
744
743
|
if (Object.keys(businessArguments).length > 0) {
|
|
745
744
|
card.append(createArgumentList(businessArguments, options.reviewSchema, options.labels));
|
|
746
745
|
}
|
|
747
|
-
if (action !== void 0) {
|
|
746
|
+
if (action !== void 0 && options.showDetails !== false) {
|
|
748
747
|
const technical = document.createElement("details");
|
|
749
748
|
technical.className = "proposal-details";
|
|
750
749
|
const summary = document.createElement("summary");
|
|
@@ -826,7 +825,7 @@ function createArgumentList(arguments_, schema, labels) {
|
|
|
826
825
|
return list;
|
|
827
826
|
}
|
|
828
827
|
function appendValue(parent, value, schema, labels) {
|
|
829
|
-
if (value === "[REDACTED]") {
|
|
828
|
+
if (schema?.writeOnly === true || schema?.["x-sensitive"] === true || value === "[REDACTED]") {
|
|
830
829
|
const hidden = document.createElement("span");
|
|
831
830
|
hidden.className = "proposal-redacted";
|
|
832
831
|
hidden.textContent = labels.redacted;
|
|
@@ -3747,6 +3746,7 @@ var AssistantElementEventController = class {
|
|
|
3747
3746
|
...description ? { description } : {},
|
|
3748
3747
|
...arguments_ ? { arguments: arguments_ } : {},
|
|
3749
3748
|
...reviewSchema ? { reviewSchema } : {},
|
|
3749
|
+
showDetails: this.#host.showConfirmationDetails(),
|
|
3750
3750
|
labels: {
|
|
3751
3751
|
heading: labels.confirmationHeading,
|
|
3752
3752
|
accept: labels.confirm,
|
|
@@ -4016,12 +4016,14 @@ var AssistantElementHostEnvironmentController = class {
|
|
|
4016
4016
|
};
|
|
4017
4017
|
|
|
4018
4018
|
// src/element-launcher-controller.ts
|
|
4019
|
+
var COLLAPSED_LAUNCHER_WIDTH_PROPERTY = "--_ns-assistant-launcher-collapsed-width";
|
|
4019
4020
|
var AssistantElementLauncherController = class {
|
|
4020
4021
|
#host;
|
|
4021
4022
|
#appearance;
|
|
4022
4023
|
#openPanel;
|
|
4023
4024
|
#sendMessage;
|
|
4024
4025
|
#root;
|
|
4026
|
+
#measurementFrame;
|
|
4025
4027
|
constructor(options) {
|
|
4026
4028
|
this.#host = options.host;
|
|
4027
4029
|
this.#appearance = options.appearance;
|
|
@@ -4052,6 +4054,8 @@ var AssistantElementLauncherController = class {
|
|
|
4052
4054
|
}
|
|
4053
4055
|
disconnect() {
|
|
4054
4056
|
document.removeEventListener("pointerdown", this.#handleDocumentPointerDown);
|
|
4057
|
+
this.#cancelWidthMeasurement();
|
|
4058
|
+
this.#host.style.removeProperty(COLLAPSED_LAUNCHER_WIDTH_PROPERTY);
|
|
4055
4059
|
this.#root = void 0;
|
|
4056
4060
|
}
|
|
4057
4061
|
sync() {
|
|
@@ -4073,7 +4077,13 @@ var AssistantElementLauncherController = class {
|
|
|
4073
4077
|
);
|
|
4074
4078
|
queryRequired(root, ".launcher").hidden = !appearance.behavior.showLauncher;
|
|
4075
4079
|
queryRequired(root, ".powered-by-row").hidden = !appearance.behavior.showPoweredBy;
|
|
4076
|
-
if (style === "bubble" || this.#host.hasAttribute("open"))
|
|
4080
|
+
if (style === "bubble" || this.#host.hasAttribute("open")) {
|
|
4081
|
+
this.#cancelWidthMeasurement();
|
|
4082
|
+
this.#host.style.removeProperty(COLLAPSED_LAUNCHER_WIDTH_PROPERTY);
|
|
4083
|
+
this.collapse(true);
|
|
4084
|
+
return;
|
|
4085
|
+
}
|
|
4086
|
+
if (!this.#host.hasAttribute("launcher-expanded")) this.#scheduleWidthMeasurement();
|
|
4077
4087
|
}
|
|
4078
4088
|
collapse(force = false) {
|
|
4079
4089
|
const root = this.#root;
|
|
@@ -4094,6 +4104,9 @@ var AssistantElementLauncherController = class {
|
|
|
4094
4104
|
#expand() {
|
|
4095
4105
|
const root = this.#root;
|
|
4096
4106
|
if (!root || this.#appearance().presentation.launcher.style === "bubble") return;
|
|
4107
|
+
this.#cancelWidthMeasurement();
|
|
4108
|
+
this.#measureCollapsedWidth();
|
|
4109
|
+
void queryRequired(root, ".launcher").offsetWidth;
|
|
4097
4110
|
this.#host.setAttribute("launcher-expanded", "");
|
|
4098
4111
|
const form = queryRequired(root, ".launcher-form");
|
|
4099
4112
|
const trigger = queryRequired(root, ".launcher-trigger");
|
|
@@ -4105,6 +4118,31 @@ var AssistantElementLauncherController = class {
|
|
|
4105
4118
|
if (this.#host.hasAttribute("launcher-expanded")) input.focus();
|
|
4106
4119
|
});
|
|
4107
4120
|
}
|
|
4121
|
+
#scheduleWidthMeasurement() {
|
|
4122
|
+
this.#cancelWidthMeasurement();
|
|
4123
|
+
this.#host.style.removeProperty(COLLAPSED_LAUNCHER_WIDTH_PROPERTY);
|
|
4124
|
+
this.#measurementFrame = requestAnimationFrame(() => {
|
|
4125
|
+
this.#measurementFrame = void 0;
|
|
4126
|
+
this.#measureCollapsedWidth();
|
|
4127
|
+
});
|
|
4128
|
+
}
|
|
4129
|
+
#cancelWidthMeasurement() {
|
|
4130
|
+
if (this.#measurementFrame === void 0) return;
|
|
4131
|
+
cancelAnimationFrame(this.#measurementFrame);
|
|
4132
|
+
this.#measurementFrame = void 0;
|
|
4133
|
+
}
|
|
4134
|
+
#measureCollapsedWidth() {
|
|
4135
|
+
const root = this.#root;
|
|
4136
|
+
if (!root || this.#host.hasAttribute("launcher-expanded") || this.#appearance().presentation.launcher.style === "bubble") {
|
|
4137
|
+
return;
|
|
4138
|
+
}
|
|
4139
|
+
const launcher = queryRequired(root, ".launcher");
|
|
4140
|
+
this.#host.style.removeProperty(COLLAPSED_LAUNCHER_WIDTH_PROPERTY);
|
|
4141
|
+
const collapsedWidth = launcher.offsetWidth;
|
|
4142
|
+
if (collapsedWidth > 0) {
|
|
4143
|
+
this.#host.style.setProperty(COLLAPSED_LAUNCHER_WIDTH_PROPERTY, `${collapsedWidth}px`);
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4108
4146
|
#handleTrigger = () => {
|
|
4109
4147
|
if (this.#appearance().presentation.launcher.style === "bubble") {
|
|
4110
4148
|
this.#openPanel();
|
|
@@ -4144,7 +4182,7 @@ var AssistantElementLauncherController = class {
|
|
|
4144
4182
|
};
|
|
4145
4183
|
#handleDocumentPointerDown = (event) => {
|
|
4146
4184
|
if (event.composedPath().includes(this.#host)) return;
|
|
4147
|
-
this.collapse();
|
|
4185
|
+
this.collapse(true);
|
|
4148
4186
|
};
|
|
4149
4187
|
};
|
|
4150
4188
|
|
|
@@ -4217,177 +4255,6 @@ var AssistantElementPresentationGate = class {
|
|
|
4217
4255
|
}
|
|
4218
4256
|
};
|
|
4219
4257
|
|
|
4220
|
-
// src/assistant-configuration-schema.ts
|
|
4221
|
-
var hexColorSchema = external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/);
|
|
4222
|
-
var resolvedBorderColorSchema = external_exports.union([
|
|
4223
|
-
hexColorSchema,
|
|
4224
|
-
external_exports.string().max(64).refine(isBoundedRgbaColor, "must be a six-digit hex or bounded rgba color")
|
|
4225
|
-
]);
|
|
4226
|
-
var browserAssetUrlSchema = external_exports.string().trim().url().refine(isSecureBrowserAssetUrl, "must use https (http is allowed only for loopback testing)");
|
|
4227
|
-
var httpsUrlSchema = external_exports.string().trim().url().refine(isHttpsUrl, "must use https");
|
|
4228
|
-
var brandAssetSchema = external_exports.object({
|
|
4229
|
-
uri: browserAssetUrlSchema,
|
|
4230
|
-
darkUri: browserAssetUrlSchema.optional(),
|
|
4231
|
-
alt: external_exports.string().trim().min(1).max(240)
|
|
4232
|
-
}).strict();
|
|
4233
|
-
var brandThemeSchema = external_exports.object({
|
|
4234
|
-
surface: hexColorSchema.optional(),
|
|
4235
|
-
surfaceRaised: hexColorSchema.optional(),
|
|
4236
|
-
surfaceMuted: hexColorSchema.optional(),
|
|
4237
|
-
text: hexColorSchema.optional(),
|
|
4238
|
-
textMuted: hexColorSchema.optional(),
|
|
4239
|
-
accent: hexColorSchema.optional(),
|
|
4240
|
-
accentText: hexColorSchema.optional(),
|
|
4241
|
-
link: hexColorSchema.optional(),
|
|
4242
|
-
border: resolvedBorderColorSchema.optional(),
|
|
4243
|
-
borderStrong: resolvedBorderColorSchema.optional(),
|
|
4244
|
-
focus: hexColorSchema.optional(),
|
|
4245
|
-
success: hexColorSchema.optional(),
|
|
4246
|
-
warning: hexColorSchema.optional(),
|
|
4247
|
-
danger: hexColorSchema.optional(),
|
|
4248
|
-
code: hexColorSchema.optional()
|
|
4249
|
-
}).strict();
|
|
4250
|
-
var brandingSchema = external_exports.object({
|
|
4251
|
-
name: external_exports.string().trim().min(1).max(160).optional(),
|
|
4252
|
-
accent: hexColorSchema.optional(),
|
|
4253
|
-
surface: hexColorSchema.optional(),
|
|
4254
|
-
surfaceDark: hexColorSchema.optional(),
|
|
4255
|
-
logo: brandAssetSchema.optional(),
|
|
4256
|
-
mark: brandAssetSchema.optional(),
|
|
4257
|
-
avatar: brandAssetSchema.optional(),
|
|
4258
|
-
theme: external_exports.object({ light: brandThemeSchema.optional(), dark: brandThemeSchema.optional() }).strict().optional(),
|
|
4259
|
-
radius: external_exports.enum(["none", "sm", "md", "lg"]).optional(),
|
|
4260
|
-
density: external_exports.enum(["compact", "comfortable"]).optional(),
|
|
4261
|
-
typography: external_exports.enum(["system", "serif", "mono"]).optional(),
|
|
4262
|
-
colorScheme: external_exports.enum(["auto", "light", "dark"]).optional()
|
|
4263
|
-
}).strict();
|
|
4264
|
-
var labelsSchema = external_exports.object({
|
|
4265
|
-
welcomeHeading: external_exports.string().trim().min(1).max(160).optional(),
|
|
4266
|
-
welcomeMessage: external_exports.string().max(1e3).optional(),
|
|
4267
|
-
launcherPlaceholder: external_exports.string().trim().min(1).max(160).optional(),
|
|
4268
|
-
composerPlaceholder: external_exports.string().trim().min(1).max(160).optional(),
|
|
4269
|
-
thinking: external_exports.string().trim().min(1).max(80).optional(),
|
|
4270
|
-
send: external_exports.string().trim().min(1).max(80).optional(),
|
|
4271
|
-
stop: external_exports.string().trim().min(1).max(80).optional(),
|
|
4272
|
-
close: external_exports.string().trim().min(1).max(80).optional(),
|
|
4273
|
-
open: external_exports.string().trim().min(1).max(80).optional(),
|
|
4274
|
-
confirm: external_exports.string().trim().min(1).max(80).optional(),
|
|
4275
|
-
decline: external_exports.string().trim().min(1).max(80).optional(),
|
|
4276
|
-
cancel: external_exports.string().trim().min(1).max(80).optional(),
|
|
4277
|
-
confirmationHeading: external_exports.string().trim().min(1).max(120).optional(),
|
|
4278
|
-
additionalDetails: external_exports.string().trim().min(1).max(120).optional(),
|
|
4279
|
-
redacted: external_exports.string().trim().min(1).max(120).optional(),
|
|
4280
|
-
completed: external_exports.string().trim().min(1).max(80).optional(),
|
|
4281
|
-
stopped: external_exports.string().trim().min(1).max(80).optional(),
|
|
4282
|
-
copy: external_exports.string().trim().min(1).max(80).optional(),
|
|
4283
|
-
newMessages: external_exports.string().trim().min(1).max(80).optional(),
|
|
4284
|
-
reconnect: external_exports.string().trim().min(1).max(80).optional(),
|
|
4285
|
-
newConversation: external_exports.string().trim().min(1).max(80).optional(),
|
|
4286
|
-
retry: external_exports.string().trim().min(1).max(80).optional(),
|
|
4287
|
-
unavailable: external_exports.string().trim().min(1).max(240).optional(),
|
|
4288
|
-
sessionExpired: external_exports.string().trim().min(1).max(240).optional(),
|
|
4289
|
-
sessionIdle: external_exports.string().trim().min(1).max(120).optional(),
|
|
4290
|
-
sessionLoading: external_exports.string().trim().min(1).max(120).optional(),
|
|
4291
|
-
sessionReady: external_exports.string().trim().min(1).max(120).optional(),
|
|
4292
|
-
sessionError: external_exports.string().trim().min(1).max(120).optional(),
|
|
4293
|
-
signInHeading: external_exports.string().trim().min(1).max(120).optional(),
|
|
4294
|
-
signInBody: external_exports.string().max(240).optional(),
|
|
4295
|
-
signInAction: external_exports.string().trim().min(1).max(80).optional(),
|
|
4296
|
-
signUpAction: external_exports.string().trim().min(1).max(80).optional()
|
|
4297
|
-
}).strict();
|
|
4298
|
-
var presentationSchema = external_exports.object({
|
|
4299
|
-
panel: external_exports.object({
|
|
4300
|
-
surface: external_exports.enum(["solid", "glass"]).optional(),
|
|
4301
|
-
elevation: external_exports.enum(["soft", "dramatic"]).optional(),
|
|
4302
|
-
border: external_exports.enum(["subtle", "strong"]).optional(),
|
|
4303
|
-
radius: external_exports.number().int().min(0).max(64).optional()
|
|
4304
|
-
}).strict().optional(),
|
|
4305
|
-
launcher: external_exports.object({
|
|
4306
|
-
style: external_exports.enum(["pill", "bubble"]).optional(),
|
|
4307
|
-
icon: external_exports.enum(["brand-mark", "chat", "none"]).optional(),
|
|
4308
|
-
size: external_exports.enum(["md", "lg"]).optional(),
|
|
4309
|
-
status: external_exports.enum(["none", "session"]).optional(),
|
|
4310
|
-
effect: external_exports.enum(["none", "pulse"]).optional()
|
|
4311
|
-
}).strict().optional(),
|
|
4312
|
-
header: external_exports.object({
|
|
4313
|
-
mark: external_exports.enum(["none", "brand-mark", "status"]).optional(),
|
|
4314
|
-
badge: external_exports.object({
|
|
4315
|
-
text: external_exports.string().trim().min(1).max(80),
|
|
4316
|
-
tone: external_exports.enum(["neutral", "success", "warning", "danger"]).optional(),
|
|
4317
|
-
indicator: external_exports.boolean().optional()
|
|
4318
|
-
}).strict().optional()
|
|
4319
|
-
}).strict().optional(),
|
|
4320
|
-
composer: external_exports.object({
|
|
4321
|
-
leadingIcon: external_exports.enum(["none", "brand-mark"]).optional(),
|
|
4322
|
-
sendIcon: external_exports.enum(["arrow-up", "paper-plane"]).optional(),
|
|
4323
|
-
shape: external_exports.enum(["rounded", "pill"]).optional()
|
|
4324
|
-
}).strict().optional(),
|
|
4325
|
-
messages: external_exports.object({
|
|
4326
|
-
userStyle: external_exports.enum(["bubble", "accent"]).optional(),
|
|
4327
|
-
assistantStyle: external_exports.enum(["plain", "bubble"]).optional()
|
|
4328
|
-
}).strict().optional()
|
|
4329
|
-
}).strict();
|
|
4330
|
-
var assistantUiSchema = external_exports.object({
|
|
4331
|
-
theme: external_exports.enum(["auto", "light", "dark", "invert"]).optional(),
|
|
4332
|
-
layout: external_exports.object({
|
|
4333
|
-
mode: external_exports.enum(["floating", "inline", "drawer"]).optional(),
|
|
4334
|
-
position: external_exports.enum(["bottom-left", "bottom-center", "bottom-right"]).optional(),
|
|
4335
|
-
panelWidth: external_exports.number().int().min(280).max(1200).optional(),
|
|
4336
|
-
panelMinHeight: external_exports.number().int().min(240).max(1600).optional(),
|
|
4337
|
-
panelMaxHeight: external_exports.number().int().min(320).max(2400).optional(),
|
|
4338
|
-
edgeOffset: external_exports.number().int().min(0).max(96).optional(),
|
|
4339
|
-
zIndex: external_exports.number().int().min(0).max(2147483647).optional(),
|
|
4340
|
-
density: external_exports.enum(["compact", "comfortable"]).optional(),
|
|
4341
|
-
mobileFullscreen: external_exports.boolean().optional()
|
|
4342
|
-
}).strict().optional(),
|
|
4343
|
-
behavior: external_exports.object({
|
|
4344
|
-
startOpen: external_exports.boolean().optional(),
|
|
4345
|
-
closeOnEscape: external_exports.boolean().optional(),
|
|
4346
|
-
closeOnOutsideClick: external_exports.boolean().optional(),
|
|
4347
|
-
showLauncher: external_exports.boolean().optional(),
|
|
4348
|
-
showHeader: external_exports.boolean().optional(),
|
|
4349
|
-
showAvatars: external_exports.boolean().optional(),
|
|
4350
|
-
showTimestamps: external_exports.boolean().optional(),
|
|
4351
|
-
showPoweredBy: external_exports.boolean().optional()
|
|
4352
|
-
}).strict().optional(),
|
|
4353
|
-
labels: labelsSchema.optional(),
|
|
4354
|
-
presentation: presentationSchema.optional(),
|
|
4355
|
-
suggestedPrompts: external_exports.array(external_exports.string().trim().min(1).max(240)).max(8).optional(),
|
|
4356
|
-
privacyUrl: httpsUrlSchema.optional(),
|
|
4357
|
-
termsUrl: httpsUrlSchema.optional(),
|
|
4358
|
-
locale: external_exports.string().trim().min(2).max(35).optional(),
|
|
4359
|
-
direction: external_exports.enum(["ltr", "rtl", "auto"]).optional()
|
|
4360
|
-
}).strict();
|
|
4361
|
-
var assistantConfigurationSchema = external_exports.object({ branding: brandingSchema.optional(), assistant: assistantUiSchema.optional() }).strict();
|
|
4362
|
-
function parseAssistantConfiguration(value) {
|
|
4363
|
-
const parsed = assistantConfigurationSchema.safeParse(value);
|
|
4364
|
-
return parsed.success ? parsed.data : void 0;
|
|
4365
|
-
}
|
|
4366
|
-
function isHttpsUrl(value) {
|
|
4367
|
-
try {
|
|
4368
|
-
return new URL(value).protocol === "https:";
|
|
4369
|
-
} catch {
|
|
4370
|
-
return false;
|
|
4371
|
-
}
|
|
4372
|
-
}
|
|
4373
|
-
function isSecureBrowserAssetUrl(value) {
|
|
4374
|
-
try {
|
|
4375
|
-
const url = new URL(value);
|
|
4376
|
-
if (url.protocol === "https:") return true;
|
|
4377
|
-
if (url.protocol !== "http:") return false;
|
|
4378
|
-
return url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "[::1]";
|
|
4379
|
-
} catch {
|
|
4380
|
-
return false;
|
|
4381
|
-
}
|
|
4382
|
-
}
|
|
4383
|
-
function isBoundedRgbaColor(value) {
|
|
4384
|
-
const match = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0(?:\.\d{1,6})?|1(?:\.0{1,6})?)\s*\)$/.exec(
|
|
4385
|
-
value
|
|
4386
|
-
);
|
|
4387
|
-
if (match === null) return false;
|
|
4388
|
-
return match.slice(1, 4).every((channel) => Number(channel) <= 255);
|
|
4389
|
-
}
|
|
4390
|
-
|
|
4391
4258
|
// src/element-public-configuration-controller.ts
|
|
4392
4259
|
var AssistantElementPublicConfigurationController = class {
|
|
4393
4260
|
#source;
|
|
@@ -4567,12 +4434,12 @@ var ASSISTANT_ELEMENT_STYLES = `<style>
|
|
|
4567
4434
|
:host([data-mode="floating"][open]) { width: min(var(--ns-assistant-panel-width, var(--ns-assistant-default-panel-width)), 100vw); }
|
|
4568
4435
|
button { font: inherit; }
|
|
4569
4436
|
button, textarea, input, select { -webkit-tap-highlight-color: transparent; }
|
|
4570
|
-
.launcher { display: flex; align-items: center; justify-content: center; gap: 12px; width: max-content; min-height: 44px; padding: 10px 14px; color: var(--ns-assistant-launcher-text, var(--ns-assistant-text, var(--ns-assistant-default-text))); background: var(--ns-assistant-launcher, color-mix(in srgb, var(--ns-assistant-panel, var(--ns-assistant-default-panel)) 50%, transparent)); border: 1px solid var(--ns-assistant-launcher-border, var(--ns-assistant-halo-launcher-border)); border-radius: 999px; box-shadow: var(--ns-assistant-halo-launcher-shadow), -6px 0 18px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 20%, transparent), 6px 0 18px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 20%, transparent), 0 0 40px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 10%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: width .5s cubic-bezier(.25,1,.5,1), height .5s cubic-bezier(.25,1,.5,1), padding .5s cubic-bezier(.25,1,.5,1), gap .35s cubic-bezier(.25,1,.5,1), transform .6s cubic-bezier(.25,1,.5,1), background-color .3s ease, box-shadow .3s ease; }
|
|
4437
|
+
.launcher { display: flex; align-items: center; justify-content: center; gap: 12px; width: var(--_ns-assistant-launcher-collapsed-width, max-content); min-height: 44px; padding: 10px 14px; color: var(--ns-assistant-launcher-text, var(--ns-assistant-text, var(--ns-assistant-default-text))); background: var(--ns-assistant-launcher, color-mix(in srgb, var(--ns-assistant-panel, var(--ns-assistant-default-panel)) 50%, transparent)); border: 1px solid var(--ns-assistant-launcher-border, var(--ns-assistant-halo-launcher-border)); border-radius: 999px; box-shadow: var(--ns-assistant-halo-launcher-shadow), -6px 0 18px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 20%, transparent), 6px 0 18px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 20%, transparent), 0 0 40px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 10%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: width .5s cubic-bezier(.25,1,.5,1), height .5s cubic-bezier(.25,1,.5,1), padding .5s cubic-bezier(.25,1,.5,1), gap .35s cubic-bezier(.25,1,.5,1), transform .6s cubic-bezier(.25,1,.5,1), background-color .3s ease, box-shadow .3s ease; will-change: width; }
|
|
4571
4438
|
:host([data-presentation-ready]) .launcher { padding: 10px 12px; }
|
|
4572
4439
|
.launcher[hidden] { display: none; }
|
|
4573
4440
|
.launcher:hover { transform: scale(1.02); box-shadow: var(--ns-assistant-halo-launcher-shadow-hover), -6px 0 18px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 20%, transparent), 6px 0 18px color-mix(in srgb, var(--ns-assistant-accent, var(--ns-assistant-default-accent)) 20%, transparent); }
|
|
4574
4441
|
.launcher-trigger, .launcher-form { min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; font: inherit; }
|
|
4575
|
-
.launcher-trigger { display: flex; align-items: center; gap: 12px; min-height: 28px; color: var(--ns-assistant-
|
|
4442
|
+
.launcher-trigger { display: flex; align-items: center; gap: 12px; min-height: 28px; color: var(--ns-assistant-launcher-text, var(--ns-assistant-text, var(--ns-assistant-default-text))); cursor: text; }
|
|
4576
4443
|
.launcher-label { padding-left: 6px; white-space: nowrap; font-size: 15px; line-height: 20px; }
|
|
4577
4444
|
.launcher-arrow, .launcher-send { position: relative; display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 0; border-radius: 50%; color: var(--ns-assistant-text, var(--ns-assistant-default-text)); background: var(--ns-assistant-launcher-action, var(--ns-assistant-halo-launcher-action)); cursor: pointer; }
|
|
4578
4445
|
.launcher-arrow:hover, .launcher-send:hover { background: var(--ns-assistant-launcher-action-hover, var(--ns-assistant-halo-launcher-action-hover)); }
|
|
@@ -5111,19 +4978,11 @@ var presentationStyles = `<style>
|
|
|
5111
4978
|
width: 28px;
|
|
5112
4979
|
height: 28px;
|
|
5113
4980
|
border-radius: 50%;
|
|
5114
|
-
|
|
5115
|
-
opacity: .6;
|
|
5116
|
-
transition: width .5s cubic-bezier(.25,1,.5,1), height .5s cubic-bezier(.25,1,.5,1), filter .5s cubic-bezier(.25,1,.5,1), opacity .5s cubic-bezier(.25,1,.5,1);
|
|
5117
|
-
}
|
|
5118
|
-
.launcher:hover .launcher-glyph:is(img), :host([launcher-expanded]) .launcher-glyph:is(img) {
|
|
5119
|
-
filter: none;
|
|
5120
|
-
opacity: 1;
|
|
4981
|
+
transition: width .5s cubic-bezier(.25,1,.5,1), height .5s cubic-bezier(.25,1,.5,1);
|
|
5121
4982
|
}
|
|
5122
4983
|
:host([data-launcher-style="bubble"]) .launcher-glyph:is(img) {
|
|
5123
4984
|
width: 32px;
|
|
5124
4985
|
height: 32px;
|
|
5125
|
-
filter: none;
|
|
5126
|
-
opacity: 1;
|
|
5127
4986
|
}
|
|
5128
4987
|
.launcher-status {
|
|
5129
4988
|
position: absolute;
|
|
@@ -5319,6 +5178,7 @@ var NoodleAssistantElement = class extends HTMLElementBase {
|
|
|
5319
5178
|
},
|
|
5320
5179
|
applyConfiguration: (configuration) => this.#applyConfiguration(configuration),
|
|
5321
5180
|
labels: () => this.#appearance.labels,
|
|
5181
|
+
showConfirmationDetails: () => this.#appearance.behavior.showConfirmationDetails,
|
|
5322
5182
|
respond: (id, response) => this.respond(id, response),
|
|
5323
5183
|
dispatchError: (detail) => this.#dispatchError(detail),
|
|
5324
5184
|
revealLatest: () => this.#revealLatest(),
|
|
@@ -5910,4 +5770,4 @@ export {
|
|
|
5910
5770
|
dompurify/dist/purify.es.mjs:
|
|
5911
5771
|
(*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE *)
|
|
5912
5772
|
*/
|
|
5913
|
-
//# sourceMappingURL=chunk-
|
|
5773
|
+
//# sourceMappingURL=chunk-QH7PL3GU.js.map
|