@helpai/elements 0.12.3 → 0.13.1

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.12.3"
83
+ "version": "0.13.1"
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 StartSessionResponse, 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 startSessionResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-BUakRA3-.js';
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 StartSessionResponse, 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 startSessionResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-Big98MYV.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";
60
59
  expanded: "expanded";
61
60
  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";
151
152
  pill: "pill";
152
153
  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";
165
166
  pill: "pill";
166
167
  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";
198
199
  pill: "pill";
199
200
  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";
244
243
  expanded: "expanded";
245
244
  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";
273
272
  expanded: "expanded";
274
273
  auto: "auto";
274
+ normal: "normal";
275
275
  }>>;
276
276
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
277
277
  }, z.core.$loose>;
@@ -306,6 +306,7 @@ declare const featureFlagsSchema: z.ZodObject<{
306
306
  code: z.ZodString;
307
307
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
308
308
  }, z.core.$loose>]>>>;
309
+ humanInLoop: z.ZodDefault<z.ZodBoolean>;
309
310
  }, z.core.$loose>;
310
311
  type FeatureFlags = z.infer<typeof featureFlagsSchema>;
311
312
 
@@ -322,40 +323,40 @@ type FeatureFlags = z.infer<typeof featureFlagsSchema>;
322
323
  */
323
324
 
324
325
  declare const actionNameSchema: z.ZodEnum<{
326
+ close: "close";
325
327
  expand: "expand";
326
328
  fullscreen: "fullscreen";
327
329
  popOut: "popOut";
328
- close: "close";
329
- language: "language";
330
+ clear: "clear";
330
331
  theme: "theme";
332
+ language: "language";
331
333
  history: "history";
332
- clear: "clear";
333
334
  sound: "sound";
334
335
  }>;
335
336
  type ActionName = z.infer<typeof actionNameSchema>;
336
337
  declare const headerActionsSchema: z.ZodArray<z.ZodEnum<{
338
+ close: "close";
337
339
  expand: "expand";
338
340
  fullscreen: "fullscreen";
339
341
  popOut: "popOut";
340
- close: "close";
341
- language: "language";
342
+ clear: "clear";
342
343
  theme: "theme";
344
+ language: "language";
343
345
  history: "history";
344
- clear: "clear";
345
346
  sound: "sound";
346
347
  }>>;
347
348
  type HeaderActions = z.infer<typeof headerActionsSchema>;
348
349
  /** Section wrapper — `actions` list wrapped under `header` in the dashboard form. */
349
350
  declare const headerSchema: z.ZodObject<{
350
351
  actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
352
+ close: "close";
351
353
  expand: "expand";
352
354
  fullscreen: "fullscreen";
353
355
  popOut: "popOut";
354
- close: "close";
355
- language: "language";
356
+ clear: "clear";
356
357
  theme: "theme";
358
+ language: "language";
357
359
  history: "history";
358
- clear: "clear";
359
360
  sound: "sound";
360
361
  }>>>;
361
362
  }, z.core.$loose>;
@@ -371,33 +372,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
371
372
  */
372
373
 
373
374
  declare const feedbackEventSchema: z.ZodEnum<{
375
+ voiceStart: "voiceStart";
376
+ voiceStop: "voiceStop";
374
377
  error: "error";
375
378
  messageReceived: "messageReceived";
376
379
  messageSent: "messageSent";
377
- voiceStart: "voiceStart";
378
- voiceStop: "voiceStop";
379
380
  }>;
380
381
  type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
381
382
  declare const soundOptionsSchema: z.ZodObject<{
382
383
  enabled: z.ZodDefault<z.ZodBoolean>;
383
384
  volume: z.ZodDefault<z.ZodNumber>;
384
385
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
386
+ voiceStart: "voiceStart";
387
+ voiceStop: "voiceStop";
385
388
  error: "error";
386
389
  messageReceived: "messageReceived";
387
390
  messageSent: "messageSent";
388
- voiceStart: "voiceStart";
389
- voiceStop: "voiceStop";
390
391
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
391
392
  }, z.core.$loose>;
392
393
  type SoundOptions = z.infer<typeof soundOptionsSchema>;
393
394
  declare const hapticsOptionsSchema: z.ZodObject<{
394
395
  enabled: z.ZodDefault<z.ZodBoolean>;
395
396
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
397
+ voiceStart: "voiceStart";
398
+ voiceStop: "voiceStop";
396
399
  error: "error";
397
400
  messageReceived: "messageReceived";
398
401
  messageSent: "messageSent";
399
- voiceStart: "voiceStart";
400
- voiceStop: "voiceStop";
401
402
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
402
403
  }, z.core.$loose>;
403
404
  type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
@@ -406,21 +407,21 @@ declare const feedbackSchema: z.ZodObject<{
406
407
  enabled: z.ZodDefault<z.ZodBoolean>;
407
408
  volume: z.ZodDefault<z.ZodNumber>;
408
409
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
410
+ voiceStart: "voiceStart";
411
+ voiceStop: "voiceStop";
409
412
  error: "error";
410
413
  messageReceived: "messageReceived";
411
414
  messageSent: "messageSent";
412
- voiceStart: "voiceStart";
413
- voiceStop: "voiceStop";
414
415
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
415
416
  }, z.core.$loose>>;
416
417
  haptics: z.ZodOptional<z.ZodObject<{
417
418
  enabled: z.ZodDefault<z.ZodBoolean>;
418
419
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
420
+ voiceStart: "voiceStart";
421
+ voiceStop: "voiceStop";
419
422
  error: "error";
420
423
  messageReceived: "messageReceived";
421
424
  messageSent: "messageSent";
422
- voiceStart: "voiceStart";
423
- voiceStop: "voiceStop";
424
425
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
425
426
  }, z.core.$loose>>;
426
427
  }, z.core.$loose>;
@@ -566,6 +567,130 @@ declare const i18nSchema: z.ZodObject<{
566
567
  }, z.core.$loose>;
567
568
  type I18nOptions = z.infer<typeof i18nSchema>;
568
569
 
570
+ /**
571
+ * Intake section — the pre-chat **lead/sales capture form**, modeled as a
572
+ * deterministic array of typed fields with validation. When enabled it renders
573
+ * as a **blocking gate**: the visitor completes (or skips, if `skippable`) the
574
+ * form before the composer unlocks.
575
+ *
576
+ * The same {@link formFieldSchema} shape is reused at runtime by the AI-driven
577
+ * **ask-input tool** (`src/ui/tool-ask-input.tsx`), so a sales/support/lead
578
+ * agent can both capture a lead up-front and ask for more structured info
579
+ * mid-conversation through one form engine.
580
+ *
581
+ * Off by default — existing deployments are unchanged. See
582
+ * `docs/api/hitl-and-forms.md` for the wire contract + agent presets.
583
+ */
584
+
585
+ declare const fieldTypeSchema: z.ZodEnum<{
586
+ number: "number";
587
+ select: "select";
588
+ textarea: "textarea";
589
+ text: "text";
590
+ checkbox: "checkbox";
591
+ radio: "radio";
592
+ url: "url";
593
+ email: "email";
594
+ tel: "tel";
595
+ multiselect: "multiselect";
596
+ }>;
597
+ type FieldType = z.infer<typeof fieldTypeSchema>;
598
+ declare const fieldOptionSchema: z.ZodObject<{
599
+ value: z.ZodString;
600
+ label: z.ZodOptional<z.ZodString>;
601
+ description: z.ZodOptional<z.ZodString>;
602
+ }, z.core.$loose>;
603
+ type FieldOption = z.infer<typeof fieldOptionSchema>;
604
+ declare const fieldValidationSchema: z.ZodObject<{
605
+ pattern: z.ZodOptional<z.ZodString>;
606
+ minLength: z.ZodOptional<z.ZodNumber>;
607
+ maxLength: z.ZodOptional<z.ZodNumber>;
608
+ min: z.ZodOptional<z.ZodNumber>;
609
+ max: z.ZodOptional<z.ZodNumber>;
610
+ minSelections: z.ZodOptional<z.ZodNumber>;
611
+ maxSelections: z.ZodOptional<z.ZodNumber>;
612
+ }, z.core.$loose>;
613
+ type FieldValidation = z.infer<typeof fieldValidationSchema>;
614
+ declare const formFieldSchema: z.ZodObject<{
615
+ name: z.ZodString;
616
+ label: z.ZodString;
617
+ type: z.ZodEnum<{
618
+ number: "number";
619
+ select: "select";
620
+ textarea: "textarea";
621
+ text: "text";
622
+ checkbox: "checkbox";
623
+ radio: "radio";
624
+ url: "url";
625
+ email: "email";
626
+ tel: "tel";
627
+ multiselect: "multiselect";
628
+ }>;
629
+ placeholder: z.ZodOptional<z.ZodString>;
630
+ required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
631
+ defaultValue: z.ZodOptional<z.ZodString>;
632
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
633
+ value: z.ZodString;
634
+ label: z.ZodOptional<z.ZodString>;
635
+ description: z.ZodOptional<z.ZodString>;
636
+ }, z.core.$loose>>>;
637
+ validation: z.ZodOptional<z.ZodObject<{
638
+ pattern: z.ZodOptional<z.ZodString>;
639
+ minLength: z.ZodOptional<z.ZodNumber>;
640
+ maxLength: z.ZodOptional<z.ZodNumber>;
641
+ min: z.ZodOptional<z.ZodNumber>;
642
+ max: z.ZodOptional<z.ZodNumber>;
643
+ minSelections: z.ZodOptional<z.ZodNumber>;
644
+ maxSelections: z.ZodOptional<z.ZodNumber>;
645
+ }, z.core.$loose>>;
646
+ allowOther: z.ZodOptional<z.ZodBoolean>;
647
+ validationHint: z.ZodOptional<z.ZodString>;
648
+ }, z.core.$loose>;
649
+ type FormField = z.infer<typeof formFieldSchema>;
650
+ declare const intakeSchema: z.ZodObject<{
651
+ enabled: z.ZodDefault<z.ZodBoolean>;
652
+ title: z.ZodOptional<z.ZodString>;
653
+ description: z.ZodOptional<z.ZodString>;
654
+ fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
655
+ name: z.ZodString;
656
+ label: z.ZodString;
657
+ type: z.ZodEnum<{
658
+ number: "number";
659
+ select: "select";
660
+ textarea: "textarea";
661
+ text: "text";
662
+ checkbox: "checkbox";
663
+ radio: "radio";
664
+ url: "url";
665
+ email: "email";
666
+ tel: "tel";
667
+ multiselect: "multiselect";
668
+ }>;
669
+ placeholder: z.ZodOptional<z.ZodString>;
670
+ required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
671
+ defaultValue: z.ZodOptional<z.ZodString>;
672
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
673
+ value: z.ZodString;
674
+ label: z.ZodOptional<z.ZodString>;
675
+ description: z.ZodOptional<z.ZodString>;
676
+ }, z.core.$loose>>>;
677
+ validation: z.ZodOptional<z.ZodObject<{
678
+ pattern: z.ZodOptional<z.ZodString>;
679
+ minLength: z.ZodOptional<z.ZodNumber>;
680
+ maxLength: z.ZodOptional<z.ZodNumber>;
681
+ min: z.ZodOptional<z.ZodNumber>;
682
+ max: z.ZodOptional<z.ZodNumber>;
683
+ minSelections: z.ZodOptional<z.ZodNumber>;
684
+ maxSelections: z.ZodOptional<z.ZodNumber>;
685
+ }, z.core.$loose>>;
686
+ allowOther: z.ZodOptional<z.ZodBoolean>;
687
+ validationHint: z.ZodOptional<z.ZodString>;
688
+ }, z.core.$loose>>>;
689
+ submitLabel: z.ZodOptional<z.ZodString>;
690
+ skippable: z.ZodDefault<z.ZodBoolean>;
691
+ }, z.core.$loose>;
692
+ type Intake = z.infer<typeof intakeSchema>;
693
+
569
694
  /**
570
695
  * Modules section — the Intercom-style "messenger" surface, modeled as a
571
696
  * **data-driven, ordered list of tabs**. Each tab picks a UI `layout`, an
@@ -582,18 +707,18 @@ type I18nOptions = z.infer<typeof i18nSchema>;
582
707
  */
583
708
 
584
709
  declare const moduleLayoutSchema: z.ZodEnum<{
710
+ home: "home";
585
711
  chat: "chat";
586
712
  help: "help";
587
- home: "home";
588
713
  news: "news";
589
714
  }>;
590
715
  type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
591
716
  declare const moduleSchema: z.ZodObject<{
592
717
  label: z.ZodString;
593
718
  layout: z.ZodEnum<{
719
+ home: "home";
594
720
  chat: "chat";
595
721
  help: "help";
596
- home: "home";
597
722
  news: "news";
598
723
  }>;
599
724
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -619,9 +744,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
619
744
  declare const modulesSchema: z.ZodArray<z.ZodObject<{
620
745
  label: z.ZodString;
621
746
  layout: z.ZodEnum<{
747
+ home: "home";
622
748
  chat: "chat";
623
749
  help: "help";
624
- home: "home";
625
750
  news: "news";
626
751
  }>;
627
752
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -686,4 +811,4 @@ declare const ALL_MODES: readonly Mode[];
686
811
  */
687
812
  declare function emitJsonSchema(): unknown;
688
813
 
689
- export { ALL_MODES, type ActionName, type AttachmentLimits, type Behavior, type CalloutPosition, type CalloutShape, type ComposerOptions, type FeatureFlags, type FeedbackEvent, type FeedbackOptions, type FooterOptions, type HapticsOptions, type HeaderActions, type HeaderOptions, type I18nOptions, type LauncherCallout, type LauncherOptions, type LauncherSize, type LauncherVariant, type Mode, type ModuleLayout, type ModuleOptions, type ModulesOptions, type Position, type PoweredBy, type Presentation, type ResizeOptions, type ResponseMode, type SendButtonOptions, type SizeOptions, type SoundOptions, type StringsOverride, type ThemeOverrides, type ThemePreference, type VoiceMode, type WelcomeAnimation, type WelcomeOptions, actionNameSchema, attachmentLimitsSchema, behaviorSchema, calloutPositionSchema, calloutShapeSchema, composerOptionsSchema, emitJsonSchema, featureFlagsSchema, feedbackEventSchema, feedbackSchema, footerSchema, hapticsOptionsSchema, headerActionsSchema, headerSchema, i18nSchema, initialSizeSchema, launcherCalloutSchema, launcherOptionsSchema, launcherSizeSchema, launcherVariantSchema, modeSchema, moduleLayoutSchema, moduleSchema, modulesSchema, positionSchema, poweredBySchema, presentationSchema, resizeOptionsSchema, responseModeSchema, sendButtonIconSchema, sendButtonOptionsSchema, sendButtonShapeSchema, sendButtonVariantSchema, sizeOptionsSchema, soundOptionsSchema, stringsOverrideSchema, themeFieldSchema, themeOverridesSchema, themePreferenceSchema, toolRefSchema, voiceModeSchema, welcomeAnimationSchema, welcomeOptionsSchema, widgetSettingsSchemaForMode };
814
+ export { ALL_MODES, type ActionName, type AttachmentLimits, type Behavior, type CalloutPosition, type CalloutShape, type ComposerOptions, type FeatureFlags, type FeedbackEvent, type FeedbackOptions, type FieldOption, type FieldType, type FieldValidation, type FooterOptions, type FormField, type HapticsOptions, type HeaderActions, type HeaderOptions, type I18nOptions, type Intake, type LauncherCallout, type LauncherOptions, type LauncherSize, type LauncherVariant, type Mode, type ModuleLayout, type ModuleOptions, type ModulesOptions, type Position, type PoweredBy, type Presentation, type ResizeOptions, type ResponseMode, type SendButtonOptions, type SizeOptions, type SoundOptions, type StringsOverride, type ThemeOverrides, type ThemePreference, type VoiceMode, type WelcomeAnimation, type WelcomeOptions, actionNameSchema, attachmentLimitsSchema, behaviorSchema, calloutPositionSchema, calloutShapeSchema, composerOptionsSchema, emitJsonSchema, featureFlagsSchema, feedbackEventSchema, feedbackSchema, fieldOptionSchema, fieldTypeSchema, fieldValidationSchema, footerSchema, formFieldSchema, hapticsOptionsSchema, headerActionsSchema, headerSchema, i18nSchema, initialSizeSchema, intakeSchema, launcherCalloutSchema, launcherOptionsSchema, launcherSizeSchema, launcherVariantSchema, modeSchema, moduleLayoutSchema, moduleSchema, modulesSchema, positionSchema, poweredBySchema, presentationSchema, resizeOptionsSchema, responseModeSchema, sendButtonIconSchema, sendButtonOptionsSchema, sendButtonShapeSchema, sendButtonVariantSchema, sizeOptionsSchema, soundOptionsSchema, stringsOverrideSchema, themeFieldSchema, themeOverridesSchema, themePreferenceSchema, toolRefSchema, voiceModeSchema, welcomeAnimationSchema, welcomeOptionsSchema, widgetSettingsSchemaForMode };