@helpai/elements 0.14.1 → 0.14.2
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 -3
- package/configurator.mjs +13 -11
- package/elements-web-component.esm.js +12 -12
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +12 -12
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +12 -12
- package/elements.esm.js.map +4 -4
- package/elements.js +12 -12
- package/elements.js.map +4 -4
- package/index.d.ts +38 -35
- package/index.mjs +220 -194
- package/package.json +1 -1
- package/schema.d.ts +53 -53
- package/schema.json +13 -13
- package/schema.mjs +15 -13
- package/style.css +1 -1
- package/web-component.d.ts +1 -1
- package/web-component.mjs +218 -192
package/package.json
CHANGED
package/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as
|
|
1
|
+
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startConversationResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-CWyouRob.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -56,9 +56,9 @@ declare const presentationSchema: z.ZodObject<{
|
|
|
56
56
|
inset: z.ZodOptional<z.ZodString>;
|
|
57
57
|
initialSize: z.ZodDefault<z.ZodEnum<{
|
|
58
58
|
fullscreen: "fullscreen";
|
|
59
|
+
normal: "normal";
|
|
59
60
|
expanded: "expanded";
|
|
60
61
|
auto: "auto";
|
|
61
|
-
normal: "normal";
|
|
62
62
|
}>>;
|
|
63
63
|
autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
|
|
64
64
|
}, z.core.$loose>>;
|
|
@@ -148,9 +148,9 @@ declare const launcherSizeSchema: z.ZodEnum<{
|
|
|
148
148
|
}>;
|
|
149
149
|
type LauncherSize = z.infer<typeof launcherSizeSchema>;
|
|
150
150
|
declare const calloutShapeSchema: z.ZodEnum<{
|
|
151
|
-
callout: "callout";
|
|
152
151
|
pill: "pill";
|
|
153
152
|
bubble: "bubble";
|
|
153
|
+
callout: "callout";
|
|
154
154
|
}>;
|
|
155
155
|
type CalloutShape = z.infer<typeof calloutShapeSchema>;
|
|
156
156
|
declare const calloutPositionSchema: z.ZodEnum<{
|
|
@@ -162,9 +162,9 @@ type CalloutPosition = z.infer<typeof calloutPositionSchema>;
|
|
|
162
162
|
declare const launcherCalloutSchema: z.ZodObject<{
|
|
163
163
|
text: z.ZodDefault<z.ZodString>;
|
|
164
164
|
shape: z.ZodDefault<z.ZodEnum<{
|
|
165
|
-
callout: "callout";
|
|
166
165
|
pill: "pill";
|
|
167
166
|
bubble: "bubble";
|
|
167
|
+
callout: "callout";
|
|
168
168
|
}>>;
|
|
169
169
|
position: z.ZodDefault<z.ZodEnum<{
|
|
170
170
|
auto: "auto";
|
|
@@ -195,9 +195,9 @@ declare const launcherOptionsSchema: z.ZodObject<{
|
|
|
195
195
|
callout: z.ZodOptional<z.ZodObject<{
|
|
196
196
|
text: z.ZodDefault<z.ZodString>;
|
|
197
197
|
shape: z.ZodDefault<z.ZodEnum<{
|
|
198
|
-
callout: "callout";
|
|
199
198
|
pill: "pill";
|
|
200
199
|
bubble: "bubble";
|
|
200
|
+
callout: "callout";
|
|
201
201
|
}>>;
|
|
202
202
|
position: z.ZodDefault<z.ZodEnum<{
|
|
203
203
|
auto: "auto";
|
|
@@ -240,9 +240,9 @@ type LauncherOptions = z.infer<typeof launcherOptionsSchema>;
|
|
|
240
240
|
|
|
241
241
|
declare const initialSizeSchema: z.ZodEnum<{
|
|
242
242
|
fullscreen: "fullscreen";
|
|
243
|
+
normal: "normal";
|
|
243
244
|
expanded: "expanded";
|
|
244
245
|
auto: "auto";
|
|
245
|
-
normal: "normal";
|
|
246
246
|
}>;
|
|
247
247
|
declare const resizeOptionsSchema: z.ZodObject<{
|
|
248
248
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -269,9 +269,9 @@ declare const sizeOptionsSchema: z.ZodObject<{
|
|
|
269
269
|
inset: z.ZodOptional<z.ZodString>;
|
|
270
270
|
initialSize: z.ZodDefault<z.ZodEnum<{
|
|
271
271
|
fullscreen: "fullscreen";
|
|
272
|
+
normal: "normal";
|
|
272
273
|
expanded: "expanded";
|
|
273
274
|
auto: "auto";
|
|
274
|
-
normal: "normal";
|
|
275
275
|
}>>;
|
|
276
276
|
autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
|
|
277
277
|
}, z.core.$loose>;
|
|
@@ -323,40 +323,40 @@ type FeatureFlags = z.infer<typeof featureFlagsSchema>;
|
|
|
323
323
|
*/
|
|
324
324
|
|
|
325
325
|
declare const actionNameSchema: z.ZodEnum<{
|
|
326
|
-
close: "close";
|
|
327
326
|
expand: "expand";
|
|
328
327
|
fullscreen: "fullscreen";
|
|
329
328
|
popOut: "popOut";
|
|
330
|
-
|
|
331
|
-
theme: "theme";
|
|
329
|
+
close: "close";
|
|
332
330
|
language: "language";
|
|
331
|
+
theme: "theme";
|
|
333
332
|
history: "history";
|
|
333
|
+
clear: "clear";
|
|
334
334
|
sound: "sound";
|
|
335
335
|
}>;
|
|
336
336
|
type ActionName = z.infer<typeof actionNameSchema>;
|
|
337
337
|
declare const headerActionsSchema: z.ZodArray<z.ZodEnum<{
|
|
338
|
-
close: "close";
|
|
339
338
|
expand: "expand";
|
|
340
339
|
fullscreen: "fullscreen";
|
|
341
340
|
popOut: "popOut";
|
|
342
|
-
|
|
343
|
-
theme: "theme";
|
|
341
|
+
close: "close";
|
|
344
342
|
language: "language";
|
|
343
|
+
theme: "theme";
|
|
345
344
|
history: "history";
|
|
345
|
+
clear: "clear";
|
|
346
346
|
sound: "sound";
|
|
347
347
|
}>>;
|
|
348
348
|
type HeaderActions = z.infer<typeof headerActionsSchema>;
|
|
349
349
|
/** Section wrapper — `actions` list wrapped under `header` in the dashboard form. */
|
|
350
350
|
declare const headerSchema: z.ZodObject<{
|
|
351
351
|
actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
352
|
-
close: "close";
|
|
353
352
|
expand: "expand";
|
|
354
353
|
fullscreen: "fullscreen";
|
|
355
354
|
popOut: "popOut";
|
|
356
|
-
|
|
357
|
-
theme: "theme";
|
|
355
|
+
close: "close";
|
|
358
356
|
language: "language";
|
|
357
|
+
theme: "theme";
|
|
359
358
|
history: "history";
|
|
359
|
+
clear: "clear";
|
|
360
360
|
sound: "sound";
|
|
361
361
|
}>>>;
|
|
362
362
|
}, z.core.$loose>;
|
|
@@ -372,33 +372,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
|
|
|
372
372
|
*/
|
|
373
373
|
|
|
374
374
|
declare const feedbackEventSchema: z.ZodEnum<{
|
|
375
|
-
voiceStart: "voiceStart";
|
|
376
|
-
voiceStop: "voiceStop";
|
|
377
375
|
error: "error";
|
|
378
376
|
messageReceived: "messageReceived";
|
|
379
377
|
messageSent: "messageSent";
|
|
378
|
+
voiceStart: "voiceStart";
|
|
379
|
+
voiceStop: "voiceStop";
|
|
380
380
|
}>;
|
|
381
381
|
type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
|
|
382
382
|
declare const soundOptionsSchema: z.ZodObject<{
|
|
383
383
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
384
384
|
volume: z.ZodDefault<z.ZodNumber>;
|
|
385
385
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
386
|
-
voiceStart: "voiceStart";
|
|
387
|
-
voiceStop: "voiceStop";
|
|
388
386
|
error: "error";
|
|
389
387
|
messageReceived: "messageReceived";
|
|
390
388
|
messageSent: "messageSent";
|
|
389
|
+
voiceStart: "voiceStart";
|
|
390
|
+
voiceStop: "voiceStop";
|
|
391
391
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
392
392
|
}, z.core.$loose>;
|
|
393
393
|
type SoundOptions = z.infer<typeof soundOptionsSchema>;
|
|
394
394
|
declare const hapticsOptionsSchema: z.ZodObject<{
|
|
395
395
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
396
396
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
397
|
-
voiceStart: "voiceStart";
|
|
398
|
-
voiceStop: "voiceStop";
|
|
399
397
|
error: "error";
|
|
400
398
|
messageReceived: "messageReceived";
|
|
401
399
|
messageSent: "messageSent";
|
|
400
|
+
voiceStart: "voiceStart";
|
|
401
|
+
voiceStop: "voiceStop";
|
|
402
402
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
|
|
403
403
|
}, z.core.$loose>;
|
|
404
404
|
type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
|
|
@@ -407,21 +407,21 @@ declare const feedbackSchema: z.ZodObject<{
|
|
|
407
407
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
408
408
|
volume: z.ZodDefault<z.ZodNumber>;
|
|
409
409
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
410
|
-
voiceStart: "voiceStart";
|
|
411
|
-
voiceStop: "voiceStop";
|
|
412
410
|
error: "error";
|
|
413
411
|
messageReceived: "messageReceived";
|
|
414
412
|
messageSent: "messageSent";
|
|
413
|
+
voiceStart: "voiceStart";
|
|
414
|
+
voiceStop: "voiceStop";
|
|
415
415
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
416
416
|
}, z.core.$loose>>;
|
|
417
417
|
haptics: z.ZodOptional<z.ZodObject<{
|
|
418
418
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
419
419
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
420
|
-
voiceStart: "voiceStart";
|
|
421
|
-
voiceStop: "voiceStop";
|
|
422
420
|
error: "error";
|
|
423
421
|
messageReceived: "messageReceived";
|
|
424
422
|
messageSent: "messageSent";
|
|
423
|
+
voiceStart: "voiceStart";
|
|
424
|
+
voiceStop: "voiceStop";
|
|
425
425
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
|
|
426
426
|
}, z.core.$loose>>;
|
|
427
427
|
}, z.core.$loose>;
|
|
@@ -504,7 +504,7 @@ type ComposerOptions = z.infer<typeof composerOptionsSchema>;
|
|
|
504
504
|
/**
|
|
505
505
|
* Welcome section — how the agent's greeting messages render when
|
|
506
506
|
* the chat opens. Content (the actual message text + suggestions)
|
|
507
|
-
* comes from the server's start-
|
|
507
|
+
* comes from the server's start-conversation response; this schema only
|
|
508
508
|
* governs the visual presentation (animation style + speed).
|
|
509
509
|
*/
|
|
510
510
|
|
|
@@ -562,16 +562,16 @@ type FooterOptions = z.infer<typeof footerSchema>;
|
|
|
562
562
|
|
|
563
563
|
declare const fieldTypeSchema: z.ZodEnum<{
|
|
564
564
|
number: "number";
|
|
565
|
-
select: "select";
|
|
566
|
-
textarea: "textarea";
|
|
567
|
-
time: "time";
|
|
568
565
|
text: "text";
|
|
569
|
-
checkbox: "checkbox";
|
|
570
|
-
radio: "radio";
|
|
571
566
|
url: "url";
|
|
572
567
|
email: "email";
|
|
573
568
|
tel: "tel";
|
|
574
569
|
date: "date";
|
|
570
|
+
time: "time";
|
|
571
|
+
textarea: "textarea";
|
|
572
|
+
select: "select";
|
|
573
|
+
radio: "radio";
|
|
574
|
+
checkbox: "checkbox";
|
|
575
575
|
multiselect: "multiselect";
|
|
576
576
|
}>;
|
|
577
577
|
type FieldType = z.infer<typeof fieldTypeSchema>;
|
|
@@ -596,16 +596,16 @@ declare const formFieldSchema: z.ZodObject<{
|
|
|
596
596
|
label: z.ZodString;
|
|
597
597
|
type: z.ZodEnum<{
|
|
598
598
|
number: "number";
|
|
599
|
-
select: "select";
|
|
600
|
-
textarea: "textarea";
|
|
601
|
-
time: "time";
|
|
602
599
|
text: "text";
|
|
603
|
-
checkbox: "checkbox";
|
|
604
|
-
radio: "radio";
|
|
605
600
|
url: "url";
|
|
606
601
|
email: "email";
|
|
607
602
|
tel: "tel";
|
|
608
603
|
date: "date";
|
|
604
|
+
time: "time";
|
|
605
|
+
textarea: "textarea";
|
|
606
|
+
select: "select";
|
|
607
|
+
radio: "radio";
|
|
608
|
+
checkbox: "checkbox";
|
|
609
609
|
multiselect: "multiselect";
|
|
610
610
|
}>;
|
|
611
611
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -656,16 +656,16 @@ declare const formDefSchema: z.ZodObject<{
|
|
|
656
656
|
label: z.ZodString;
|
|
657
657
|
type: z.ZodEnum<{
|
|
658
658
|
number: "number";
|
|
659
|
-
select: "select";
|
|
660
|
-
textarea: "textarea";
|
|
661
|
-
time: "time";
|
|
662
659
|
text: "text";
|
|
663
|
-
checkbox: "checkbox";
|
|
664
|
-
radio: "radio";
|
|
665
660
|
url: "url";
|
|
666
661
|
email: "email";
|
|
667
662
|
tel: "tel";
|
|
668
663
|
date: "date";
|
|
664
|
+
time: "time";
|
|
665
|
+
textarea: "textarea";
|
|
666
|
+
select: "select";
|
|
667
|
+
radio: "radio";
|
|
668
|
+
checkbox: "checkbox";
|
|
669
669
|
multiselect: "multiselect";
|
|
670
670
|
}>;
|
|
671
671
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -694,7 +694,7 @@ declare const formDefSchema: z.ZodObject<{
|
|
|
694
694
|
skippable: z.ZodDefault<z.ZodBoolean>;
|
|
695
695
|
frequency: z.ZodDefault<z.ZodEnum<{
|
|
696
696
|
once: "once";
|
|
697
|
-
|
|
697
|
+
conversation: "conversation";
|
|
698
698
|
always: "always";
|
|
699
699
|
}>>;
|
|
700
700
|
mirrorToContext: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -714,16 +714,16 @@ declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
|
714
714
|
label: z.ZodString;
|
|
715
715
|
type: z.ZodEnum<{
|
|
716
716
|
number: "number";
|
|
717
|
-
select: "select";
|
|
718
|
-
textarea: "textarea";
|
|
719
|
-
time: "time";
|
|
720
717
|
text: "text";
|
|
721
|
-
checkbox: "checkbox";
|
|
722
|
-
radio: "radio";
|
|
723
718
|
url: "url";
|
|
724
719
|
email: "email";
|
|
725
720
|
tel: "tel";
|
|
726
721
|
date: "date";
|
|
722
|
+
time: "time";
|
|
723
|
+
textarea: "textarea";
|
|
724
|
+
select: "select";
|
|
725
|
+
radio: "radio";
|
|
726
|
+
checkbox: "checkbox";
|
|
727
727
|
multiselect: "multiselect";
|
|
728
728
|
}>;
|
|
729
729
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -752,7 +752,7 @@ declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
|
752
752
|
skippable: z.ZodDefault<z.ZodBoolean>;
|
|
753
753
|
frequency: z.ZodDefault<z.ZodEnum<{
|
|
754
754
|
once: "once";
|
|
755
|
-
|
|
755
|
+
conversation: "conversation";
|
|
756
756
|
always: "always";
|
|
757
757
|
}>>;
|
|
758
758
|
mirrorToContext: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -789,24 +789,24 @@ type I18nOptions = z.infer<typeof i18nSchema>;
|
|
|
789
789
|
* One tab → no tab bar (just that content). Zero → an empty state. Only
|
|
790
790
|
* meaningful in `floating` / `drawer` / `modal` modes.
|
|
791
791
|
*
|
|
792
|
-
* The list arrives via the start-
|
|
792
|
+
* The list arrives via the start-conversation (`config.modules`); each non-chat
|
|
793
793
|
* tab lazy-fetches its content from `GET /ai/agent/content` scoped by its
|
|
794
794
|
* `category`. See `docs/api/messenger-modules.md` + `docs/api/content.md`.
|
|
795
795
|
*/
|
|
796
796
|
|
|
797
797
|
declare const moduleLayoutSchema: z.ZodEnum<{
|
|
798
|
-
home: "home";
|
|
799
798
|
chat: "chat";
|
|
800
799
|
help: "help";
|
|
800
|
+
home: "home";
|
|
801
801
|
news: "news";
|
|
802
802
|
}>;
|
|
803
803
|
type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
|
|
804
804
|
declare const moduleSchema: z.ZodObject<{
|
|
805
805
|
label: z.ZodString;
|
|
806
806
|
layout: z.ZodEnum<{
|
|
807
|
-
home: "home";
|
|
808
807
|
chat: "chat";
|
|
809
808
|
help: "help";
|
|
809
|
+
home: "home";
|
|
810
810
|
news: "news";
|
|
811
811
|
}>;
|
|
812
812
|
contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -832,9 +832,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
|
|
|
832
832
|
declare const modulesSchema: z.ZodArray<z.ZodObject<{
|
|
833
833
|
label: z.ZodString;
|
|
834
834
|
layout: z.ZodEnum<{
|
|
835
|
-
home: "home";
|
|
836
835
|
chat: "chat";
|
|
837
836
|
help: "help";
|
|
837
|
+
home: "home";
|
|
838
838
|
news: "news";
|
|
839
839
|
}>;
|
|
840
840
|
contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/schema.json
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
},
|
|
168
168
|
"submitForm": {
|
|
169
169
|
"default": "/ai/agent/submit-form",
|
|
170
|
-
"description": "Form submission endpoint. The widget POSTs each completed form's values here (fire-and-forget), keyed by the same visitorId +
|
|
170
|
+
"description": "Form submission endpoint. The widget POSTs each completed form's values here (fire-and-forget), keyed by the same visitorId + conversationId as the conversation; the payload carries `formId` + `trigger` so the backend can route. Optional — a 404 is ignored.",
|
|
171
171
|
"type": "string",
|
|
172
172
|
"minLength": 1,
|
|
173
173
|
"maxLength": 2048
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
"type": "boolean"
|
|
470
470
|
},
|
|
471
471
|
"popOutUrl": {
|
|
472
|
-
"description": "URL the `popOut` action opens in a new tab (carries `?chat=<id>&widgetId=<id>` query params). Falls back to the brand's build-time default. Set this to point at your own dedicated chat page (e.g. `https://app.acme.com/chat`). Server-pushable on `/start-
|
|
472
|
+
"description": "URL the `popOut` action opens in a new tab (carries `?chat=<id>&widgetId=<id>` query params). Falls back to the brand's build-time default. Set this to point at your own dedicated chat page (e.g. `https://app.acme.com/chat`). Server-pushable on `/start-conversation.widget.behavior.popOutUrl`.",
|
|
473
473
|
"type": "string",
|
|
474
474
|
"minLength": 1,
|
|
475
475
|
"maxLength": 2048
|
|
@@ -1591,11 +1591,11 @@
|
|
|
1591
1591
|
},
|
|
1592
1592
|
"frequency": {
|
|
1593
1593
|
"default": "once",
|
|
1594
|
-
"description": "`once` (
|
|
1594
|
+
"description": "`once` (per device, persisted), `conversation` (re-eligible each new conversation), or `always`.",
|
|
1595
1595
|
"type": "string",
|
|
1596
1596
|
"enum": [
|
|
1597
1597
|
"once",
|
|
1598
|
-
"
|
|
1598
|
+
"conversation",
|
|
1599
1599
|
"always"
|
|
1600
1600
|
]
|
|
1601
1601
|
},
|
|
@@ -1875,10 +1875,10 @@
|
|
|
1875
1875
|
]
|
|
1876
1876
|
},
|
|
1877
1877
|
"site": {
|
|
1878
|
-
"description": "Site config — applies in `mode: \"page\"`. Comes from the start-
|
|
1878
|
+
"description": "Site config — applies in `mode: \"page\"`. Comes from the start-conversation response, not user-edited."
|
|
1879
1879
|
},
|
|
1880
1880
|
"blocks": {
|
|
1881
|
-
"description": "Blocks (nav + link cards) — applies in `mode: \"page\"`. Comes from the start-
|
|
1881
|
+
"description": "Blocks (nav + link cards) — applies in `mode: \"page\"`. Comes from the start-conversation response."
|
|
1882
1882
|
}
|
|
1883
1883
|
},
|
|
1884
1884
|
"required": [
|
|
@@ -1909,7 +1909,7 @@
|
|
|
1909
1909
|
}
|
|
1910
1910
|
]
|
|
1911
1911
|
},
|
|
1912
|
-
"
|
|
1912
|
+
"StartConversationResponse": {
|
|
1913
1913
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1914
1914
|
"type": "object",
|
|
1915
1915
|
"properties": {
|
|
@@ -2222,7 +2222,7 @@
|
|
|
2222
2222
|
"type": "boolean"
|
|
2223
2223
|
},
|
|
2224
2224
|
"popOutUrl": {
|
|
2225
|
-
"description": "URL the `popOut` action opens in a new tab (carries `?chat=<id>&widgetId=<id>` query params). Falls back to the brand's build-time default. Set this to point at your own dedicated chat page (e.g. `https://app.acme.com/chat`). Server-pushable on `/start-
|
|
2225
|
+
"description": "URL the `popOut` action opens in a new tab (carries `?chat=<id>&widgetId=<id>` query params). Falls back to the brand's build-time default. Set this to point at your own dedicated chat page (e.g. `https://app.acme.com/chat`). Server-pushable on `/start-conversation.widget.behavior.popOutUrl`.",
|
|
2226
2226
|
"type": "string",
|
|
2227
2227
|
"minLength": 1,
|
|
2228
2228
|
"maxLength": 2048
|
|
@@ -3344,11 +3344,11 @@
|
|
|
3344
3344
|
},
|
|
3345
3345
|
"frequency": {
|
|
3346
3346
|
"default": "once",
|
|
3347
|
-
"description": "`once` (
|
|
3347
|
+
"description": "`once` (per device, persisted), `conversation` (re-eligible each new conversation), or `always`.",
|
|
3348
3348
|
"type": "string",
|
|
3349
3349
|
"enum": [
|
|
3350
3350
|
"once",
|
|
3351
|
-
"
|
|
3351
|
+
"conversation",
|
|
3352
3352
|
"always"
|
|
3353
3353
|
]
|
|
3354
3354
|
},
|
|
@@ -3840,7 +3840,7 @@
|
|
|
3840
3840
|
"visitorId": {
|
|
3841
3841
|
"type": "string"
|
|
3842
3842
|
},
|
|
3843
|
-
"
|
|
3843
|
+
"conversationId": {
|
|
3844
3844
|
"type": "string"
|
|
3845
3845
|
},
|
|
3846
3846
|
"canContinue": {
|
|
@@ -3868,7 +3868,7 @@
|
|
|
3868
3868
|
"invalid"
|
|
3869
3869
|
]
|
|
3870
3870
|
},
|
|
3871
|
-
"
|
|
3871
|
+
"conversationId": {
|
|
3872
3872
|
"type": "string",
|
|
3873
3873
|
"enum": [
|
|
3874
3874
|
"conflict",
|
|
@@ -3884,7 +3884,7 @@
|
|
|
3884
3884
|
"deployment",
|
|
3885
3885
|
"agent",
|
|
3886
3886
|
"visitorId",
|
|
3887
|
-
"
|
|
3887
|
+
"conversationId",
|
|
3888
3888
|
"canContinue",
|
|
3889
3889
|
"messages"
|
|
3890
3890
|
],
|
package/schema.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var linkSchema = z.object({
|
|
|
14
14
|
var cssLengthSchema = z.string().min(1).max(120).describe("Any CSS length \u2014 `640px`, `80vh`, `calc(100vh - 64px)`, etc. Validated only for size, not syntax.");
|
|
15
15
|
var cssColorSchema = z.string().min(1).max(120).describe("Any CSS colour \u2014 hex, `rgb()`, `hsl()`, `oklch()`, a named colour, or a `var(--token)`.");
|
|
16
16
|
var localeSchema = z.string().min(1).max(35).describe("BCP-47 locale tag (e.g. `en`, `fr-CA`, `zh-Hant-HK`).");
|
|
17
|
-
var uuid7Schema = z.uuidv7().describe("UUID v7 (RFC 9562) \u2014 the single id format for visitor /
|
|
17
|
+
var uuid7Schema = z.uuidv7().describe("UUID v7 (RFC 9562) \u2014 the single id format for visitor / conversation / message / file / content ids.");
|
|
18
18
|
|
|
19
19
|
// src/schema/widget.ts
|
|
20
20
|
import { z as z16 } from "zod";
|
|
@@ -129,7 +129,7 @@ var behaviorSchema = z4.object({
|
|
|
129
129
|
"Show tool/function calls the model makes (e.g. search) as inline chips in the transcript. `false` (default) hides them."
|
|
130
130
|
),
|
|
131
131
|
popOutUrl: z4.string().min(1).max(2048).optional().describe(
|
|
132
|
-
"URL the `popOut` action opens in a new tab (carries `?chat=<id>&widgetId=<id>` query params). Falls back to the brand's build-time default. Set this to point at your own dedicated chat page (e.g. `https://app.acme.com/chat`). Server-pushable on `/start-
|
|
132
|
+
"URL the `popOut` action opens in a new tab (carries `?chat=<id>&widgetId=<id>` query params). Falls back to the brand's build-time default. Set this to point at your own dedicated chat page (e.g. `https://app.acme.com/chat`). Server-pushable on `/start-conversation.widget.behavior.popOutUrl`."
|
|
133
133
|
)
|
|
134
134
|
}).loose().describe("Lifecycle + streaming behaviour. Doesn't affect visual presentation.").meta({
|
|
135
135
|
examples: [
|
|
@@ -437,7 +437,7 @@ var formDefSchema = z13.object({
|
|
|
437
437
|
description: z13.string().max(500).optional(),
|
|
438
438
|
submitLabel: z13.string().max(60).optional(),
|
|
439
439
|
skippable: z13.boolean().default(false).describe("Show a Skip control so the visitor can dismiss the form."),
|
|
440
|
-
frequency: z13.enum(["once", "
|
|
440
|
+
frequency: z13.enum(["once", "conversation", "always"]).default("once").describe("`once` (per device, persisted), `conversation` (re-eligible each new conversation), or `always`."),
|
|
441
441
|
mirrorToContext: z13.boolean().default(true).describe(
|
|
442
442
|
"Mirror the answers into `userContext` so they ride every request. Set `false` for PII (DOB, policy #, symptoms) \u2014 those then go only to the submit endpoint."
|
|
443
443
|
)
|
|
@@ -576,7 +576,7 @@ var endpointsSchema = z16.object({
|
|
|
576
576
|
upload: z16.string().min(1).max(2048).default("/ai/agent/upload-file"),
|
|
577
577
|
transcribe: z16.string().min(1).max(2048).default("/ai/agent/transcribe-audio"),
|
|
578
578
|
submitForm: z16.string().min(1).max(2048).default("/ai/agent/submit-form").describe(
|
|
579
|
-
"Form submission endpoint. The widget POSTs each completed form's values here (fire-and-forget), keyed by the same visitorId +
|
|
579
|
+
"Form submission endpoint. The widget POSTs each completed form's values here (fire-and-forget), keyed by the same visitorId + conversationId as the conversation; the payload carries `formId` + `trigger` so the backend can route. Optional \u2014 a 404 is ignored."
|
|
580
580
|
)
|
|
581
581
|
}).loose().describe("HTTP endpoint overrides. Paths are appended to baseUrl; absolute URLs are accepted too.").meta({
|
|
582
582
|
examples: [
|
|
@@ -667,7 +667,7 @@ var widgetSettingsSchema = z16.object({
|
|
|
667
667
|
forms: formsSchema.optional(),
|
|
668
668
|
modules: modulesSchema.optional()
|
|
669
669
|
}).loose().describe(
|
|
670
|
-
"Portal-configurable widget settings \u2014 thirteen sections, one per dashboard tab. The backend pushes this same shape on `/ai/agent/start-
|
|
670
|
+
"Portal-configurable widget settings \u2014 thirteen sections, one per dashboard tab. The backend pushes this same shape on `/ai/agent/start-conversation` under `config`."
|
|
671
671
|
).meta({
|
|
672
672
|
examples: [
|
|
673
673
|
{ presentation: { mode: "floating", position: "bottom-right" }, theme: "auto" },
|
|
@@ -685,8 +685,10 @@ var widgetSettingsSchema = z16.object({
|
|
|
685
685
|
});
|
|
686
686
|
var widgetConfigSchema = connectionConfigSchema.extend({
|
|
687
687
|
...widgetSettingsSchema.shape,
|
|
688
|
-
site: z16.unknown().optional().describe(
|
|
689
|
-
|
|
688
|
+
site: z16.unknown().optional().describe(
|
|
689
|
+
'Site config \u2014 applies in `mode: "page"`. Comes from the start-conversation response, not user-edited.'
|
|
690
|
+
),
|
|
691
|
+
blocks: z16.unknown().optional().describe('Blocks (nav + link cards) \u2014 applies in `mode: "page"`. Comes from the start-conversation response.')
|
|
690
692
|
}).describe(
|
|
691
693
|
"Full client widget config \u2014 connection (where + auth) + widget settings (look + behaviour) + page-mode extras. This is what the runtime parses on `mount()` / `init()`. Mode-specific constraints (e.g. `position` only meaningful in `floating`) are NOT enforced here \u2014 the runtime silently ignores irrelevant fields rather than rejecting them so the same object can flow across mode changes."
|
|
692
694
|
).meta({
|
|
@@ -733,7 +735,7 @@ var handshakeWelcomeSuggestionSchema = z17.object({
|
|
|
733
735
|
text: z17.string().optional()
|
|
734
736
|
}).loose();
|
|
735
737
|
var rebindReasonSchema = z17.enum(["conflict", "expired", "invalid"]);
|
|
736
|
-
var
|
|
738
|
+
var startConversationResponseSchema = z17.object({
|
|
737
739
|
deployment: z17.object({
|
|
738
740
|
id: z17.string(),
|
|
739
741
|
name: z17.string(),
|
|
@@ -766,7 +768,7 @@ var startSessionResponseSchema = z17.object({
|
|
|
766
768
|
suggestions: z17.array(handshakeWelcomeSuggestionSchema).optional()
|
|
767
769
|
}).loose().optional(),
|
|
768
770
|
visitorId: z17.string(),
|
|
769
|
-
|
|
771
|
+
conversationId: z17.string(),
|
|
770
772
|
canContinue: z17.boolean(),
|
|
771
773
|
messages: z17.array(z17.unknown()),
|
|
772
774
|
/**
|
|
@@ -777,11 +779,11 @@ var startSessionResponseSchema = z17.object({
|
|
|
777
779
|
*/
|
|
778
780
|
userPrefs: z17.record(z17.string(), z17.unknown()).optional(),
|
|
779
781
|
// Present only when the server rotated the request `visitorId` /
|
|
780
|
-
// `
|
|
782
|
+
// `conversationId`. Purely advisory — client must adopt the response ids
|
|
781
783
|
// verbatim regardless of whether this block is present.
|
|
782
784
|
rebind: z17.object({
|
|
783
785
|
visitorId: rebindReasonSchema.optional(),
|
|
784
|
-
|
|
786
|
+
conversationId: rebindReasonSchema.optional()
|
|
785
787
|
}).loose().optional()
|
|
786
788
|
}).loose();
|
|
787
789
|
|
|
@@ -824,7 +826,7 @@ function emitJsonSchema() {
|
|
|
824
826
|
description: "Canonical config schemas for the embeddable AI agent elements widget.",
|
|
825
827
|
definitions: {
|
|
826
828
|
WidgetConfig: z19.toJSONSchema(widgetConfigSchema),
|
|
827
|
-
|
|
829
|
+
StartConversationResponse: z19.toJSONSchema(startConversationResponseSchema)
|
|
828
830
|
}
|
|
829
831
|
};
|
|
830
832
|
}
|
|
@@ -886,7 +888,7 @@ export {
|
|
|
886
888
|
siteConfigSchema,
|
|
887
889
|
sizeOptionsSchema,
|
|
888
890
|
soundOptionsSchema,
|
|
889
|
-
|
|
891
|
+
startConversationResponseSchema,
|
|
890
892
|
stringsOverrideSchema,
|
|
891
893
|
themeFieldSchema,
|
|
892
894
|
themeOverridesSchema,
|