@helpai/elements 0.25.0 → 0.27.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/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.25.0"
83
+ "version": "0.27.0"
84
84
  }
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 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-B0uvvJYK.js';
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-CcW_mx_i.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
- clear: "clear";
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
- clear: "clear";
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
- clear: "clear";
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 start-conversation (`config.modules`); each non-chat
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: `/pai/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,19 +166,19 @@
160
166
  "type": "object",
161
167
  "properties": {
162
168
  "upload": {
163
- "default": "/ai/agent/upload-file",
169
+ "default": "/pai/upload-file",
164
170
  "type": "string",
165
171
  "minLength": 1,
166
172
  "maxLength": 2048
167
173
  },
168
174
  "transcribe": {
169
- "default": "/ai/agent/transcribe-audio",
175
+ "default": "/pai/transcribe-audio",
170
176
  "type": "string",
171
177
  "minLength": 1,
172
178
  "maxLength": 2048
173
179
  },
174
180
  "submitForm": {
175
- "default": "/submit-form",
181
+ "default": "/pai/submit-form",
176
182
  "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.",
177
183
  "type": "string",
178
184
  "minLength": 1,
@@ -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/agent/upload-file",
192
- "transcribe": "/ai/agent/transcribe-audio"
197
+ "upload": "/pai/upload-file",
198
+ "transcribe": "/pai/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 `/start-conversation.widget.behavior.popOutUrl`.",
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
@@ -1861,11 +1867,11 @@
1861
1867
  "type": "object",
1862
1868
  "properties": {
1863
1869
  "enabled": {
1864
- "description": "Master switch. Default `false` — no hits are sent until the deployment turns tracking on.",
1870
+ "description": "Master switch. Default `true` — the widget always fires; the data module gates ingestion per deployment server-side. Set `false` to silence the client entirely.",
1865
1871
  "type": "boolean"
1866
1872
  },
1867
1873
  "endpoint": {
1868
- "description": "Pixel collector URL. Default: `${dataBaseUrl}/elements/px.gif` (e.g. `https://help.ai/api/data/elements/px.gif`). Must be a full URL.",
1874
+ "description": "Pixel collector URL. Default: `${dataBaseUrl}/pai/elements-px.gif` (e.g. `https://help.ai/api/data/pai/elements-px.gif`). Must be a full URL.",
1869
1875
  "type": "string",
1870
1876
  "maxLength": 2048,
1871
1877
  "format": "uri"
@@ -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 `/start-conversation` response — never set by hand (see `docs/api/tracking-collector.md`).",
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 start-conversation response, not user-edited."
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 start-conversation response."
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
- "StartConversationResponse": {
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 `/start-conversation.widget.behavior.popOutUrl`.",
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
@@ -3266,11 +3272,11 @@
3266
3272
  "type": "object",
3267
3273
  "properties": {
3268
3274
  "enabled": {
3269
- "description": "Master switch. Default `false` — no hits are sent until the deployment turns tracking on.",
3275
+ "description": "Master switch. Default `true` — the widget always fires; the data module gates ingestion per deployment server-side. Set `false` to silence the client entirely.",
3270
3276
  "type": "boolean"
3271
3277
  },
3272
3278
  "endpoint": {
3273
- "description": "Pixel collector URL. Default: `${dataBaseUrl}/elements/px.gif` (e.g. `https://help.ai/api/data/elements/px.gif`). Must be a full URL.",
3279
+ "description": "Pixel collector URL. Default: `${dataBaseUrl}/pai/elements-px.gif` (e.g. `https://help.ai/api/data/pai/elements-px.gif`). Must be a full URL.",
3274
3280
  "type": "string",
3275
3281
  "maxLength": 2048,
3276
3282
  "format": "uri"
@@ -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 `/start-conversation` response — never set by hand (see `docs/api/tracking-collector.md`).",
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 `/start-conversation.widget.behavior.popOutUrl`."
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: [
@@ -569,13 +569,15 @@ var modulesSchema = z14.array(moduleSchema).max(4).describe(
569
569
  // src/schema/widget/tracking.ts
570
570
  import { z as z15 } from "zod";
571
571
  var trackingSchema = z15.object({
572
- enabled: z15.boolean().optional().describe("Master switch. Default `false` \u2014 no hits are sent until the deployment turns tracking on."),
572
+ enabled: z15.boolean().optional().describe(
573
+ "Master switch. Default `true` \u2014 the widget always fires; the data module gates ingestion per deployment server-side. Set `false` to silence the client entirely."
574
+ ),
573
575
  endpoint: z15.url().max(2048).optional().describe(
574
- "Pixel collector URL. Default: `${dataBaseUrl}/elements/px.gif` (e.g. `https://help.ai/api/data/elements/px.gif`). Must be a full URL."
576
+ "Pixel collector URL. Default: `${dataBaseUrl}/pai/elements-px.gif` (e.g. `https://help.ai/api/data/pai/elements-px.gif`). Must be a full URL."
575
577
  ),
576
578
  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
579
  token: z15.string().max(512).optional().describe(
578
- "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/start-conversation` response \u2014 never set by hand (see `docs/api/tracking-collector.md`)."
580
+ "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
581
  )
580
582
  }).loose().describe(
581
583
  "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,16 +587,16 @@ var trackingSchema = z15.object({
585
587
 
586
588
  // src/schema/widget.ts
587
589
  var endpointsSchema = z16.object({
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
- submitForm: z16.string().min(1).max(2048).default("/submit-form").describe(
590
+ upload: z16.string().min(1).max(2048).default("/pai/upload-file"),
591
+ transcribe: z16.string().min(1).max(2048).default("/pai/transcribe-audio"),
592
+ submitForm: z16.string().min(1).max(2048).default("/pai/submit-form").describe(
591
593
  "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
594
  )
593
595
  }).loose().describe(
594
596
  "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
597
  ).meta({
596
598
  examples: [
597
- { upload: "/ai/agent/upload-file", transcribe: "/ai/agent/transcribe-audio" },
599
+ { upload: "/pai/upload-file", transcribe: "/pai/transcribe-audio" },
598
600
  { upload: "https://help.ai/uploads/presign" },
599
601
  { submitForm: "https://crm.acme.com/leads" }
600
602
  ]
@@ -643,8 +645,11 @@ var connectionConfigSchema = z16.object({
643
645
  baseUrl: z16.string().min(1).max(2048).optional().describe(
644
646
  "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
647
  ),
648
+ agentBaseUrl: z16.string().min(1).max(2048).optional().describe(
649
+ "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: `/pai/handshake`). Precedence: this option > derived from the main origin (`${baseUrl}/api/agent`). Not server-pushable."
650
+ ),
646
651
  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`)."
652
+ "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
653
  ),
649
654
  userContext: userContextSchema.optional(),
650
655
  pageContext: pageContextSchema.optional(),
@@ -684,7 +689,7 @@ var widgetSettingsSchema = z16.object({
684
689
  modules: modulesSchema.optional(),
685
690
  tracking: trackingSchema.optional()
686
691
  }).loose().describe(
687
- "Portal-configurable widget settings \u2014 fourteen sections, one per dashboard tab. The backend pushes this same shape on `/ai/agent/start-conversation` under `config`."
692
+ "Portal-configurable widget settings \u2014 fourteen sections, one per dashboard tab. The backend pushes this same shape on `/pai/handshake` under `config`."
688
693
  ).meta({
689
694
  examples: [
690
695
  { presentation: { mode: "floating", position: "bottom-right" }, theme: "auto" },
@@ -702,10 +707,8 @@ var widgetSettingsSchema = z16.object({
702
707
  });
703
708
  var widgetConfigSchema = connectionConfigSchema.extend({
704
709
  ...widgetSettingsSchema.shape,
705
- site: z16.unknown().optional().describe(
706
- 'Site config \u2014 applies in `mode: "page"`. Comes from the start-conversation response, not user-edited.'
707
- ),
708
- blocks: z16.unknown().optional().describe('Blocks (nav + link cards) \u2014 applies in `mode: "page"`. Comes from the start-conversation response.')
710
+ site: z16.unknown().optional().describe('Site config \u2014 applies in `mode: "page"`. Comes from the handshake response, not user-edited.'),
711
+ blocks: z16.unknown().optional().describe('Blocks (nav + link cards) \u2014 applies in `mode: "page"`. Comes from the handshake response.')
709
712
  }).describe(
710
713
  "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
714
  ).meta({
@@ -754,7 +757,7 @@ var handshakeWelcomeSuggestionSchema = z17.object({
754
757
  text: z17.string().optional()
755
758
  }).loose();
756
759
  var rebindReasonSchema = z17.enum(["conflict", "expired", "invalid"]);
757
- var startConversationResponseSchema = z17.object({
760
+ var handshakeResponseSchema = z17.object({
758
761
  deployment: z17.object({
759
762
  id: z17.string(),
760
763
  name: z17.string(),
@@ -788,8 +791,6 @@ var startConversationResponseSchema = z17.object({
788
791
  }).loose().optional(),
789
792
  visitorId: z17.string(),
790
793
  conversationId: z17.string(),
791
- canContinue: z17.boolean(),
792
- messages: z17.array(z17.unknown()),
793
794
  /**
794
795
  * Per-visitor preferences (locale picker, theme picker, sound
795
796
  * mute, dragged panel size). Distinct from `config` — this is
@@ -845,7 +846,7 @@ function emitJsonSchema() {
845
846
  description: "Canonical config schemas for the embeddable AI agent elements widget.",
846
847
  definitions: {
847
848
  WidgetConfig: z19.toJSONSchema(widgetConfigSchema),
848
- StartConversationResponse: z19.toJSONSchema(startConversationResponseSchema)
849
+ HandshakeResponse: z19.toJSONSchema(handshakeResponseSchema)
849
850
  }
850
851
  };
851
852
  }
@@ -878,6 +879,7 @@ export {
878
879
  formFieldSchema,
879
880
  formTriggerSchema,
880
881
  formsSchema,
882
+ handshakeResponseSchema,
881
883
  hapticsOptionsSchema,
882
884
  headerActionsSchema,
883
885
  headerSchema,
@@ -907,7 +909,6 @@ export {
907
909
  siteConfigSchema,
908
910
  sizeOptionsSchema,
909
911
  soundOptionsSchema,
910
- startConversationResponseSchema,
911
912
  stringsOverrideSchema,
912
913
  themeFieldSchema,
913
914
  themeOverridesSchema,
@@ -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 start-conversation gate keeps blank
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