@helpai/elements 0.25.0 → 0.26.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 +2 -2
- package/configurator.mjs +13 -14
- package/elements-web-component.esm.js +19 -19
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +19 -19
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +19 -19
- package/elements.esm.js.map +4 -4
- package/elements.js +19 -19
- package/elements.js.map +4 -4
- package/index.d.ts +37 -83
- package/index.mjs +132 -125
- package/package.json +1 -1
- package/schema.d.ts +50 -50
- package/schema.json +19 -22
- package/schema.mjs +15 -16
- package/web-component.d.ts +1 -1
- package/web-component.mjs +132 -125
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,
|
|
1
|
+
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, H as HandshakeResponse, L as Link, P as PAGE_AREA_SUGGESTIONS, f as PageContext, S as ServerConfig, b as SiteConfig, U as UserContext, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial, g as assetSchema, h as blocksConfigSchema, i as connectionConfigPartialSchema, j as connectionConfigSchema, k as cssColorSchema, l as cssLengthSchema, m as endpointsSchema, n as handshakeResponseSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, u as userContextSchema, t as uuid7Schema, w as widgetConfigPartialSchema, v as widgetConfigSchema, x as widgetSettingsPartialSchema, y as widgetSettingsSchema } from './deployment-2pMWV4oW.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,43 +323,43 @@ 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
|
textSize: "textSize";
|
|
334
333
|
history: "history";
|
|
334
|
+
clear: "clear";
|
|
335
335
|
sound: "sound";
|
|
336
336
|
}>;
|
|
337
337
|
type ActionName = z.infer<typeof actionNameSchema>;
|
|
338
338
|
declare const headerActionsSchema: z.ZodArray<z.ZodEnum<{
|
|
339
|
-
close: "close";
|
|
340
339
|
expand: "expand";
|
|
341
340
|
fullscreen: "fullscreen";
|
|
342
341
|
popOut: "popOut";
|
|
343
|
-
|
|
344
|
-
theme: "theme";
|
|
342
|
+
close: "close";
|
|
345
343
|
language: "language";
|
|
344
|
+
theme: "theme";
|
|
346
345
|
textSize: "textSize";
|
|
347
346
|
history: "history";
|
|
347
|
+
clear: "clear";
|
|
348
348
|
sound: "sound";
|
|
349
349
|
}>>;
|
|
350
350
|
type HeaderActions = z.infer<typeof headerActionsSchema>;
|
|
351
351
|
/** Section wrapper — `actions` list wrapped under `header` in the dashboard form. */
|
|
352
352
|
declare const headerSchema: z.ZodObject<{
|
|
353
353
|
actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
354
|
-
close: "close";
|
|
355
354
|
expand: "expand";
|
|
356
355
|
fullscreen: "fullscreen";
|
|
357
356
|
popOut: "popOut";
|
|
358
|
-
|
|
359
|
-
theme: "theme";
|
|
357
|
+
close: "close";
|
|
360
358
|
language: "language";
|
|
359
|
+
theme: "theme";
|
|
361
360
|
textSize: "textSize";
|
|
362
361
|
history: "history";
|
|
362
|
+
clear: "clear";
|
|
363
363
|
sound: "sound";
|
|
364
364
|
}>>>;
|
|
365
365
|
}, z.core.$loose>;
|
|
@@ -375,33 +375,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
|
|
|
375
375
|
*/
|
|
376
376
|
|
|
377
377
|
declare const feedbackEventSchema: z.ZodEnum<{
|
|
378
|
-
voiceStart: "voiceStart";
|
|
379
|
-
voiceStop: "voiceStop";
|
|
380
378
|
error: "error";
|
|
381
379
|
messageReceived: "messageReceived";
|
|
382
380
|
messageSent: "messageSent";
|
|
381
|
+
voiceStart: "voiceStart";
|
|
382
|
+
voiceStop: "voiceStop";
|
|
383
383
|
}>;
|
|
384
384
|
type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
|
|
385
385
|
declare const soundOptionsSchema: z.ZodObject<{
|
|
386
386
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
387
387
|
volume: z.ZodDefault<z.ZodNumber>;
|
|
388
388
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
389
|
-
voiceStart: "voiceStart";
|
|
390
|
-
voiceStop: "voiceStop";
|
|
391
389
|
error: "error";
|
|
392
390
|
messageReceived: "messageReceived";
|
|
393
391
|
messageSent: "messageSent";
|
|
392
|
+
voiceStart: "voiceStart";
|
|
393
|
+
voiceStop: "voiceStop";
|
|
394
394
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
395
395
|
}, z.core.$loose>;
|
|
396
396
|
type SoundOptions = z.infer<typeof soundOptionsSchema>;
|
|
397
397
|
declare const hapticsOptionsSchema: z.ZodObject<{
|
|
398
398
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
399
399
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
400
|
-
voiceStart: "voiceStart";
|
|
401
|
-
voiceStop: "voiceStop";
|
|
402
400
|
error: "error";
|
|
403
401
|
messageReceived: "messageReceived";
|
|
404
402
|
messageSent: "messageSent";
|
|
403
|
+
voiceStart: "voiceStart";
|
|
404
|
+
voiceStop: "voiceStop";
|
|
405
405
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
|
|
406
406
|
}, z.core.$loose>;
|
|
407
407
|
type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
|
|
@@ -410,21 +410,21 @@ declare const feedbackSchema: z.ZodObject<{
|
|
|
410
410
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
411
411
|
volume: z.ZodDefault<z.ZodNumber>;
|
|
412
412
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
413
|
-
voiceStart: "voiceStart";
|
|
414
|
-
voiceStop: "voiceStop";
|
|
415
413
|
error: "error";
|
|
416
414
|
messageReceived: "messageReceived";
|
|
417
415
|
messageSent: "messageSent";
|
|
416
|
+
voiceStart: "voiceStart";
|
|
417
|
+
voiceStop: "voiceStop";
|
|
418
418
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
419
419
|
}, z.core.$loose>>;
|
|
420
420
|
haptics: z.ZodOptional<z.ZodObject<{
|
|
421
421
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
422
422
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
423
|
-
voiceStart: "voiceStart";
|
|
424
|
-
voiceStop: "voiceStop";
|
|
425
423
|
error: "error";
|
|
426
424
|
messageReceived: "messageReceived";
|
|
427
425
|
messageSent: "messageSent";
|
|
426
|
+
voiceStart: "voiceStart";
|
|
427
|
+
voiceStop: "voiceStop";
|
|
428
428
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
|
|
429
429
|
}, z.core.$loose>>;
|
|
430
430
|
}, z.core.$loose>;
|
|
@@ -544,16 +544,16 @@ type FooterOptions = z.infer<typeof footerSchema>;
|
|
|
544
544
|
|
|
545
545
|
declare const fieldTypeSchema: z.ZodEnum<{
|
|
546
546
|
number: "number";
|
|
547
|
-
select: "select";
|
|
548
|
-
textarea: "textarea";
|
|
549
|
-
time: "time";
|
|
550
547
|
text: "text";
|
|
551
|
-
checkbox: "checkbox";
|
|
552
|
-
radio: "radio";
|
|
553
548
|
url: "url";
|
|
554
549
|
email: "email";
|
|
555
550
|
tel: "tel";
|
|
556
551
|
date: "date";
|
|
552
|
+
time: "time";
|
|
553
|
+
textarea: "textarea";
|
|
554
|
+
select: "select";
|
|
555
|
+
radio: "radio";
|
|
556
|
+
checkbox: "checkbox";
|
|
557
557
|
multiselect: "multiselect";
|
|
558
558
|
}>;
|
|
559
559
|
type FieldType = z.infer<typeof fieldTypeSchema>;
|
|
@@ -578,16 +578,16 @@ declare const formFieldSchema: z.ZodObject<{
|
|
|
578
578
|
label: z.ZodString;
|
|
579
579
|
type: z.ZodEnum<{
|
|
580
580
|
number: "number";
|
|
581
|
-
select: "select";
|
|
582
|
-
textarea: "textarea";
|
|
583
|
-
time: "time";
|
|
584
581
|
text: "text";
|
|
585
|
-
checkbox: "checkbox";
|
|
586
|
-
radio: "radio";
|
|
587
582
|
url: "url";
|
|
588
583
|
email: "email";
|
|
589
584
|
tel: "tel";
|
|
590
585
|
date: "date";
|
|
586
|
+
time: "time";
|
|
587
|
+
textarea: "textarea";
|
|
588
|
+
select: "select";
|
|
589
|
+
radio: "radio";
|
|
590
|
+
checkbox: "checkbox";
|
|
591
591
|
multiselect: "multiselect";
|
|
592
592
|
}>;
|
|
593
593
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -638,16 +638,16 @@ declare const formDefSchema: z.ZodObject<{
|
|
|
638
638
|
label: z.ZodString;
|
|
639
639
|
type: z.ZodEnum<{
|
|
640
640
|
number: "number";
|
|
641
|
-
select: "select";
|
|
642
|
-
textarea: "textarea";
|
|
643
|
-
time: "time";
|
|
644
641
|
text: "text";
|
|
645
|
-
checkbox: "checkbox";
|
|
646
|
-
radio: "radio";
|
|
647
642
|
url: "url";
|
|
648
643
|
email: "email";
|
|
649
644
|
tel: "tel";
|
|
650
645
|
date: "date";
|
|
646
|
+
time: "time";
|
|
647
|
+
textarea: "textarea";
|
|
648
|
+
select: "select";
|
|
649
|
+
radio: "radio";
|
|
650
|
+
checkbox: "checkbox";
|
|
651
651
|
multiselect: "multiselect";
|
|
652
652
|
}>;
|
|
653
653
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -698,16 +698,16 @@ declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
|
698
698
|
label: z.ZodString;
|
|
699
699
|
type: z.ZodEnum<{
|
|
700
700
|
number: "number";
|
|
701
|
-
select: "select";
|
|
702
|
-
textarea: "textarea";
|
|
703
|
-
time: "time";
|
|
704
701
|
text: "text";
|
|
705
|
-
checkbox: "checkbox";
|
|
706
|
-
radio: "radio";
|
|
707
702
|
url: "url";
|
|
708
703
|
email: "email";
|
|
709
704
|
tel: "tel";
|
|
710
705
|
date: "date";
|
|
706
|
+
time: "time";
|
|
707
|
+
textarea: "textarea";
|
|
708
|
+
select: "select";
|
|
709
|
+
radio: "radio";
|
|
710
|
+
checkbox: "checkbox";
|
|
711
711
|
multiselect: "multiselect";
|
|
712
712
|
}>;
|
|
713
713
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -775,24 +775,24 @@ type I18nOptions = z.infer<typeof i18nSchema>;
|
|
|
775
775
|
* One tab → no tab bar (just that content). Zero → an empty state. Only
|
|
776
776
|
* meaningful in `floating` / `drawer` / `modal` modes.
|
|
777
777
|
*
|
|
778
|
-
* The list arrives via the
|
|
778
|
+
* The list arrives via the handshake (`config.modules`); each non-chat
|
|
779
779
|
* tab lazy-fetches its content from `GET /content` scoped by its
|
|
780
780
|
* `category`. See `docs/api/messenger-modules.md` + `docs/api/content.md`.
|
|
781
781
|
*/
|
|
782
782
|
|
|
783
783
|
declare const moduleLayoutSchema: z.ZodEnum<{
|
|
784
|
-
home: "home";
|
|
785
784
|
chat: "chat";
|
|
786
785
|
help: "help";
|
|
786
|
+
home: "home";
|
|
787
787
|
news: "news";
|
|
788
788
|
}>;
|
|
789
789
|
type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
|
|
790
790
|
declare const moduleSchema: z.ZodObject<{
|
|
791
791
|
label: z.ZodString;
|
|
792
792
|
layout: z.ZodEnum<{
|
|
793
|
-
home: "home";
|
|
794
793
|
chat: "chat";
|
|
795
794
|
help: "help";
|
|
795
|
+
home: "home";
|
|
796
796
|
news: "news";
|
|
797
797
|
}>;
|
|
798
798
|
contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -818,9 +818,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
|
|
|
818
818
|
declare const modulesSchema: z.ZodArray<z.ZodObject<{
|
|
819
819
|
label: z.ZodString;
|
|
820
820
|
layout: z.ZodEnum<{
|
|
821
|
-
home: "home";
|
|
822
821
|
chat: "chat";
|
|
823
822
|
help: "help";
|
|
823
|
+
home: "home";
|
|
824
824
|
news: "news";
|
|
825
825
|
}>;
|
|
826
826
|
contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/schema.json
CHANGED
|
@@ -32,8 +32,14 @@
|
|
|
32
32
|
"minLength": 1,
|
|
33
33
|
"maxLength": 2048
|
|
34
34
|
},
|
|
35
|
+
"agentBaseUrl": {
|
|
36
|
+
"description": "Full agent-API base — set it to reach a STANDALONE `module-help-ai-agent-api` directly (local module on its own port, e.g. `http://localhost:3087`; routes attach as-is: `/ai-agent/handshake`). Precedence: this option > derived from the main origin (`${baseUrl}/api/agent`). Not server-pushable.",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"minLength": 1,
|
|
39
|
+
"maxLength": 2048
|
|
40
|
+
},
|
|
35
41
|
"dataBaseUrl": {
|
|
36
|
-
"description": "Full data-API base (e.g. `https://help.ai/api/data`) — the service serving content, form definitions (`GET /forms`), and form submissions at root-level paths. Precedence: this option > server-pushed `config.dataBaseUrl` > derived from the main origin (`${baseUrl}/api/data`).",
|
|
42
|
+
"description": "Full data-API base (e.g. `https://help.ai/api/data`, or a standalone local module like `http://localhost:3106`) — the service serving content, form definitions (`GET /forms`), and form submissions at root-level paths. Precedence: this option > server-pushed `config.dataBaseUrl` > derived from the main origin (`${baseUrl}/api/data`).",
|
|
37
43
|
"type": "string",
|
|
38
44
|
"minLength": 1,
|
|
39
45
|
"maxLength": 2048
|
|
@@ -160,13 +166,13 @@
|
|
|
160
166
|
"type": "object",
|
|
161
167
|
"properties": {
|
|
162
168
|
"upload": {
|
|
163
|
-
"default": "/ai
|
|
169
|
+
"default": "/ai-agent/upload-file",
|
|
164
170
|
"type": "string",
|
|
165
171
|
"minLength": 1,
|
|
166
172
|
"maxLength": 2048
|
|
167
173
|
},
|
|
168
174
|
"transcribe": {
|
|
169
|
-
"default": "/ai
|
|
175
|
+
"default": "/ai-agent/transcribe-audio",
|
|
170
176
|
"type": "string",
|
|
171
177
|
"minLength": 1,
|
|
172
178
|
"maxLength": 2048
|
|
@@ -188,8 +194,8 @@
|
|
|
188
194
|
"description": "HTTP endpoint overrides. `upload` / `transcribe` paths are appended to the agent base (`${baseUrl}/api/agent`), `submitForm` to the data base (`dataBaseUrl`); absolute URLs are accepted too.",
|
|
189
195
|
"examples": [
|
|
190
196
|
{
|
|
191
|
-
"upload": "/ai
|
|
192
|
-
"transcribe": "/ai
|
|
197
|
+
"upload": "/ai-agent/upload-file",
|
|
198
|
+
"transcribe": "/ai-agent/transcribe-audio"
|
|
193
199
|
},
|
|
194
200
|
{
|
|
195
201
|
"upload": "https://help.ai/uploads/presign"
|
|
@@ -475,7 +481,7 @@
|
|
|
475
481
|
"type": "boolean"
|
|
476
482
|
},
|
|
477
483
|
"popOutUrl": {
|
|
478
|
-
"description": "URL the `popOut` action opens in a new tab (carries `?conversation=<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 `/
|
|
484
|
+
"description": "URL the `popOut` action opens in a new tab (carries `?conversation=<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 `/handshake.widget.behavior.popOutUrl`.",
|
|
479
485
|
"type": "string",
|
|
480
486
|
"minLength": 1,
|
|
481
487
|
"maxLength": 2048
|
|
@@ -1877,7 +1883,7 @@
|
|
|
1877
1883
|
"maximum": 1
|
|
1878
1884
|
},
|
|
1879
1885
|
"token": {
|
|
1880
|
-
"description": "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/
|
|
1886
|
+
"description": "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/handshake` response — never set by hand (see `docs/api/tracking-collector.md`).",
|
|
1881
1887
|
"type": "string",
|
|
1882
1888
|
"maxLength": 512
|
|
1883
1889
|
}
|
|
@@ -1895,10 +1901,10 @@
|
|
|
1895
1901
|
]
|
|
1896
1902
|
},
|
|
1897
1903
|
"site": {
|
|
1898
|
-
"description": "Site config — applies in `mode: \"page\"`. Comes from the
|
|
1904
|
+
"description": "Site config — applies in `mode: \"page\"`. Comes from the handshake response, not user-edited."
|
|
1899
1905
|
},
|
|
1900
1906
|
"blocks": {
|
|
1901
|
-
"description": "Blocks (nav + link cards) — applies in `mode: \"page\"`. Comes from the
|
|
1907
|
+
"description": "Blocks (nav + link cards) — applies in `mode: \"page\"`. Comes from the handshake response."
|
|
1902
1908
|
}
|
|
1903
1909
|
},
|
|
1904
1910
|
"required": [
|
|
@@ -1929,7 +1935,7 @@
|
|
|
1929
1935
|
}
|
|
1930
1936
|
]
|
|
1931
1937
|
},
|
|
1932
|
-
"
|
|
1938
|
+
"HandshakeResponse": {
|
|
1933
1939
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1934
1940
|
"type": "object",
|
|
1935
1941
|
"properties": {
|
|
@@ -2242,7 +2248,7 @@
|
|
|
2242
2248
|
"type": "boolean"
|
|
2243
2249
|
},
|
|
2244
2250
|
"popOutUrl": {
|
|
2245
|
-
"description": "URL the `popOut` action opens in a new tab (carries `?conversation=<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 `/
|
|
2251
|
+
"description": "URL the `popOut` action opens in a new tab (carries `?conversation=<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 `/handshake.widget.behavior.popOutUrl`.",
|
|
2246
2252
|
"type": "string",
|
|
2247
2253
|
"minLength": 1,
|
|
2248
2254
|
"maxLength": 2048
|
|
@@ -3282,7 +3288,7 @@
|
|
|
3282
3288
|
"maximum": 1
|
|
3283
3289
|
},
|
|
3284
3290
|
"token": {
|
|
3285
|
-
"description": "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/
|
|
3291
|
+
"description": "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/handshake` response — never set by hand (see `docs/api/tracking-collector.md`).",
|
|
3286
3292
|
"type": "string",
|
|
3287
3293
|
"maxLength": 512
|
|
3288
3294
|
}
|
|
@@ -3520,13 +3526,6 @@
|
|
|
3520
3526
|
"conversationId": {
|
|
3521
3527
|
"type": "string"
|
|
3522
3528
|
},
|
|
3523
|
-
"canContinue": {
|
|
3524
|
-
"type": "boolean"
|
|
3525
|
-
},
|
|
3526
|
-
"messages": {
|
|
3527
|
-
"type": "array",
|
|
3528
|
-
"items": {}
|
|
3529
|
-
},
|
|
3530
3529
|
"userPrefs": {
|
|
3531
3530
|
"type": "object",
|
|
3532
3531
|
"propertyNames": {
|
|
@@ -3561,9 +3560,7 @@
|
|
|
3561
3560
|
"deployment",
|
|
3562
3561
|
"agent",
|
|
3563
3562
|
"visitorId",
|
|
3564
|
-
"conversationId"
|
|
3565
|
-
"canContinue",
|
|
3566
|
-
"messages"
|
|
3563
|
+
"conversationId"
|
|
3567
3564
|
],
|
|
3568
3565
|
"additionalProperties": {}
|
|
3569
3566
|
}
|
package/schema.mjs
CHANGED
|
@@ -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 `?conversation=<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 `/
|
|
132
|
+
"URL the `popOut` action opens in a new tab (carries `?conversation=<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 `/handshake.widget.behavior.popOutUrl`."
|
|
133
133
|
)
|
|
134
134
|
}).loose().describe("Lifecycle + streaming behaviour. Doesn't affect visual presentation.").meta({
|
|
135
135
|
examples: [
|
|
@@ -575,7 +575,7 @@ var trackingSchema = z15.object({
|
|
|
575
575
|
),
|
|
576
576
|
sampleRate: z15.number().min(0).max(1).optional().describe("Per-visitor sampling 0..1 (decided once per page load, keeping funnels intact). Default `1`."),
|
|
577
577
|
token: z15.string().max(512).optional().describe(
|
|
578
|
-
"Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/
|
|
578
|
+
"Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/handshake` response \u2014 never set by hand (see `docs/api/tracking-collector.md`)."
|
|
579
579
|
)
|
|
580
580
|
}).loose().describe(
|
|
581
581
|
"Anonymous usage tracking for the widget owner \u2014 GA-style pixel events (open, send, form submit, \u2026) with page / device / locale dimensions. Never includes message content; visitors are identified only by the widget's anonymous visitorId."
|
|
@@ -585,8 +585,8 @@ var trackingSchema = z15.object({
|
|
|
585
585
|
|
|
586
586
|
// src/schema/widget.ts
|
|
587
587
|
var endpointsSchema = z16.object({
|
|
588
|
-
upload: z16.string().min(1).max(2048).default("/ai
|
|
589
|
-
transcribe: z16.string().min(1).max(2048).default("/ai
|
|
588
|
+
upload: z16.string().min(1).max(2048).default("/ai-agent/upload-file"),
|
|
589
|
+
transcribe: z16.string().min(1).max(2048).default("/ai-agent/transcribe-audio"),
|
|
590
590
|
submitForm: z16.string().min(1).max(2048).default("/submit-form").describe(
|
|
591
591
|
"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."
|
|
592
592
|
)
|
|
@@ -594,7 +594,7 @@ var endpointsSchema = z16.object({
|
|
|
594
594
|
"HTTP endpoint overrides. `upload` / `transcribe` paths are appended to the agent base (`${baseUrl}/api/agent`), `submitForm` to the data base (`dataBaseUrl`); absolute URLs are accepted too."
|
|
595
595
|
).meta({
|
|
596
596
|
examples: [
|
|
597
|
-
{ upload: "/ai
|
|
597
|
+
{ upload: "/ai-agent/upload-file", transcribe: "/ai-agent/transcribe-audio" },
|
|
598
598
|
{ upload: "https://help.ai/uploads/presign" },
|
|
599
599
|
{ submitForm: "https://crm.acme.com/leads" }
|
|
600
600
|
]
|
|
@@ -643,8 +643,11 @@ var connectionConfigSchema = z16.object({
|
|
|
643
643
|
baseUrl: z16.string().min(1).max(2048).optional().describe(
|
|
644
644
|
"MAIN site origin (e.g. `https://help.ai`) \u2014 the API modules derive from it: agent API at `${baseUrl}/api/agent`, data API at `${baseUrl}/api/data`. Set this to point at your staging / self-hosted / custom backend. Default: the brand's `defaultBaseUrl` baked at build time."
|
|
645
645
|
),
|
|
646
|
+
agentBaseUrl: z16.string().min(1).max(2048).optional().describe(
|
|
647
|
+
"Full agent-API base \u2014 set it to reach a STANDALONE `module-help-ai-agent-api` directly (local module on its own port, e.g. `http://localhost:3087`; routes attach as-is: `/ai-agent/handshake`). Precedence: this option > derived from the main origin (`${baseUrl}/api/agent`). Not server-pushable."
|
|
648
|
+
),
|
|
646
649
|
dataBaseUrl: z16.string().min(1).max(2048).optional().describe(
|
|
647
|
-
"Full data-API base (e.g. `https://help.ai/api/data`) \u2014 the service serving content, form definitions (`GET /forms`), and form submissions at root-level paths. Precedence: this option > server-pushed `config.dataBaseUrl` > derived from the main origin (`${baseUrl}/api/data`)."
|
|
650
|
+
"Full data-API base (e.g. `https://help.ai/api/data`, or a standalone local module like `http://localhost:3106`) \u2014 the service serving content, form definitions (`GET /forms`), and form submissions at root-level paths. Precedence: this option > server-pushed `config.dataBaseUrl` > derived from the main origin (`${baseUrl}/api/data`)."
|
|
648
651
|
),
|
|
649
652
|
userContext: userContextSchema.optional(),
|
|
650
653
|
pageContext: pageContextSchema.optional(),
|
|
@@ -684,7 +687,7 @@ var widgetSettingsSchema = z16.object({
|
|
|
684
687
|
modules: modulesSchema.optional(),
|
|
685
688
|
tracking: trackingSchema.optional()
|
|
686
689
|
}).loose().describe(
|
|
687
|
-
"Portal-configurable widget settings \u2014 fourteen sections, one per dashboard tab. The backend pushes this same shape on `/ai
|
|
690
|
+
"Portal-configurable widget settings \u2014 fourteen sections, one per dashboard tab. The backend pushes this same shape on `/ai-agent/handshake` under `config`."
|
|
688
691
|
).meta({
|
|
689
692
|
examples: [
|
|
690
693
|
{ presentation: { mode: "floating", position: "bottom-right" }, theme: "auto" },
|
|
@@ -702,10 +705,8 @@ var widgetSettingsSchema = z16.object({
|
|
|
702
705
|
});
|
|
703
706
|
var widgetConfigSchema = connectionConfigSchema.extend({
|
|
704
707
|
...widgetSettingsSchema.shape,
|
|
705
|
-
site: z16.unknown().optional().describe(
|
|
706
|
-
|
|
707
|
-
),
|
|
708
|
-
blocks: z16.unknown().optional().describe('Blocks (nav + link cards) \u2014 applies in `mode: "page"`. Comes from the start-conversation response.')
|
|
708
|
+
site: z16.unknown().optional().describe('Site config \u2014 applies in `mode: "page"`. Comes from the handshake response, not user-edited.'),
|
|
709
|
+
blocks: z16.unknown().optional().describe('Blocks (nav + link cards) \u2014 applies in `mode: "page"`. Comes from the handshake response.')
|
|
709
710
|
}).describe(
|
|
710
711
|
"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."
|
|
711
712
|
).meta({
|
|
@@ -754,7 +755,7 @@ var handshakeWelcomeSuggestionSchema = z17.object({
|
|
|
754
755
|
text: z17.string().optional()
|
|
755
756
|
}).loose();
|
|
756
757
|
var rebindReasonSchema = z17.enum(["conflict", "expired", "invalid"]);
|
|
757
|
-
var
|
|
758
|
+
var handshakeResponseSchema = z17.object({
|
|
758
759
|
deployment: z17.object({
|
|
759
760
|
id: z17.string(),
|
|
760
761
|
name: z17.string(),
|
|
@@ -788,8 +789,6 @@ var startConversationResponseSchema = z17.object({
|
|
|
788
789
|
}).loose().optional(),
|
|
789
790
|
visitorId: z17.string(),
|
|
790
791
|
conversationId: z17.string(),
|
|
791
|
-
canContinue: z17.boolean(),
|
|
792
|
-
messages: z17.array(z17.unknown()),
|
|
793
792
|
/**
|
|
794
793
|
* Per-visitor preferences (locale picker, theme picker, sound
|
|
795
794
|
* mute, dragged panel size). Distinct from `config` — this is
|
|
@@ -845,7 +844,7 @@ function emitJsonSchema() {
|
|
|
845
844
|
description: "Canonical config schemas for the embeddable AI agent elements widget.",
|
|
846
845
|
definitions: {
|
|
847
846
|
WidgetConfig: z19.toJSONSchema(widgetConfigSchema),
|
|
848
|
-
|
|
847
|
+
HandshakeResponse: z19.toJSONSchema(handshakeResponseSchema)
|
|
849
848
|
}
|
|
850
849
|
};
|
|
851
850
|
}
|
|
@@ -878,6 +877,7 @@ export {
|
|
|
878
877
|
formFieldSchema,
|
|
879
878
|
formTriggerSchema,
|
|
880
879
|
formsSchema,
|
|
880
|
+
handshakeResponseSchema,
|
|
881
881
|
hapticsOptionsSchema,
|
|
882
882
|
headerActionsSchema,
|
|
883
883
|
headerSchema,
|
|
@@ -907,7 +907,6 @@ export {
|
|
|
907
907
|
siteConfigSchema,
|
|
908
908
|
sizeOptionsSchema,
|
|
909
909
|
soundOptionsSchema,
|
|
910
|
-
startConversationResponseSchema,
|
|
911
910
|
stringsOverrideSchema,
|
|
912
911
|
themeFieldSchema,
|
|
913
912
|
themeOverridesSchema,
|
package/web-component.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Mode resolution: the tag itself doesn't pin a default mode. When no
|
|
10
10
|
* `mode=…` attribute is set, the resolver default (`"floating"`) seeds
|
|
11
|
-
* the very first frame — which the App's
|
|
11
|
+
* the very first frame — which the App's handshake gate keeps blank
|
|
12
12
|
* — then the server's pushed `widget.presentation.mode` wins via
|
|
13
13
|
* `mergeServerConfig` (subscribed in `boot()` below). Drop a bare
|
|
14
14
|
* `<web-ai-chat public-key="…" ai-agent-deployment-id="…">` on the
|