@helpai/elements 6.7.0 → 6.9.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/llms.txt CHANGED
@@ -1,11 +1,11 @@
1
1
  # Help AI Elements
2
2
 
3
- > Help AI's AI chat widget for any website: an AI agent that answers visitors from the customer's own help content, can hand the chat to a person, and shows Help articles and News. Install it with one script tag, the `<web-ai-chat>` element, the npm API or the React kit. These docs match @helpai/elements@6.7.0.
3
+ > Help AI's AI chat widget for any website: an AI agent that answers visitors from the customer's own help content, can hand the chat to a person, and shows Help articles and News. Install it with one script tag, the `<web-ai-chat>` element, the npm API or the React kit. These docs match @helpai/elements@6.9.0.
4
4
 
5
5
  What a coding agent needs to install it right the first time:
6
6
 
7
7
  - Two values come from the deployment's Install page in the Help AI dashboard: the public key (`agent_pk_…`) and the AI agent deployment id (a UUID). Both belong in browser code. The deployment's secret key never does.
8
- - Plain HTML, WordPress or any CMS: `<script src="https://cdn.help.ai/sdk/js/elements/6.7.0/elements.js" data-public-key="agent_pk_…" data-ai-agent-deployment-id="…" defer></script>`.
8
+ - Plain HTML, WordPress or any CMS: `<script src="https://cdn.help.ai/sdk/js/elements/6.9.0/elements.js" data-public-key="agent_pk_…" data-ai-agent-deployment-id="…" defer></script>`.
9
9
  - React, Next.js, Remix: install `@helpai/elements` and render `<HelpAI publicKey="…" aiAgentDeploymentId="…" />` from `@helpai/elements/react` once, in the root layout. `useHelpAI()` in any component returns `{ state, ask, open, close, reset }`. It is server-render safe; import everything from `@helpai/elements/react`.
10
10
  - Vue, Svelte, Angular and other bundlers: `import '@helpai/elements/web-component'`, then `<web-ai-chat public-key="…" ai-agent-deployment-id="…"></web-ai-chat>`. JSX typings: `@helpai/elements/jsx/react`, `/jsx/vue`, `/jsx/svelte`.
11
11
  - Site buttons need no JavaScript: `data-helpai-ask="Which plan fits a team of 10?"` puts the question in the chat, `data-helpai-open="help"` opens a tab (`home`, `chats`, `help`, `news`). In code, `ask(text)` fills the composer and sends only with `{ send: true }`.
@@ -18,23 +18,23 @@ What a coding agent needs to install it right the first time:
18
18
 
19
19
  ## Docs
20
20
 
21
- - [Quickstart](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/quickstart.md): credentials, the install paths and a first check, in five minutes
22
- - [Installation](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/installation.md): every install path in depth: script tag, async loader, npm, web component, CDN URLs and version pinning
23
- - [Frameworks](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/frameworks.md): the React kit (`<HelpAI />`, `useHelpAI()`), Next.js, Remix, Vue, Nuxt, Svelte, Astro, Angular, WordPress, Shopify, Webflow
24
- - [Configuration](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/configuration.md): every option by group, with examples
25
- - [Option reference](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/options.md): the table of every option, generated from the schemas; authoritative
26
- - [API reference](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/api-reference.md): exports, instance methods (`ask`, `open`, `state`, `ready`, `reset`, …), the global API, no-script triggers, deep links, JSX typings
27
- - [Events and hooks](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/events-and-hooks.md): every event and its payload, `on()` and `hook()`
28
- - [Page tools](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/page-tools.md): WebMCP-shaped tools the AI agent calls on your page (`registerTool`, `tools`, `useHelpAITool`, `<form toolname>`), run once in the browser
29
- - [Theming](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/theming.md): colors, shapes, fonts, launcher styles, `theme: "host"` and `::part()` styling
30
- - [Recipes](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/recipes.md): copy-paste solutions for common integrations
31
- - [Analytics](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/analytics.md): sending widget activity to Google Analytics, Segment, PostHog and other trackers
32
- - [Security and privacy](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/security-privacy.md): isolation, CSP, what the widget stores and sends
33
- - [Browser support](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/browser-support.md): supported browsers and fallbacks
34
- - [Troubleshooting](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/troubleshooting.md): an install that does not show, connect or answer
35
- - [FAQ](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/faq.md): short answers to common questions
36
- - [Overview](https://cdn.help.ai/sdk/js/elements/6.7.0/docs/README.md): the whole SDK on one page
21
+ - [Quickstart](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/quickstart.md): credentials, the install paths and a first check, in five minutes
22
+ - [Installation](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/installation.md): every install path in depth: script tag, async loader, npm, web component, CDN URLs and version pinning
23
+ - [Frameworks](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/frameworks.md): the React kit (`<HelpAI />`, `useHelpAI()`), Next.js, Remix, Vue, Nuxt, Svelte, Astro, Angular, WordPress, Shopify, Webflow
24
+ - [Configuration](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/configuration.md): every option by group, with examples
25
+ - [Option reference](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/options.md): the table of every option, generated from the schemas; authoritative
26
+ - [API reference](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/api-reference.md): exports, instance methods (`ask`, `open`, `state`, `ready`, `reset`, …), the global API, no-script triggers, deep links, JSX typings
27
+ - [Events and hooks](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/events-and-hooks.md): every event and its payload, `on()` and `hook()`
28
+ - [Page tools](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/page-tools.md): WebMCP-shaped tools the AI agent calls on your page (`registerTool`, `tools`, `useHelpAITool`, `<form toolname>`), run once in the browser
29
+ - [Theming](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/theming.md): colors, shapes, fonts, launcher styles, `theme: "host"` and `::part()` styling
30
+ - [Recipes](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/recipes.md): copy-paste solutions for common integrations
31
+ - [Analytics](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/analytics.md): sending widget activity to Google Analytics, Segment, PostHog and other trackers
32
+ - [Security and privacy](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/security-privacy.md): isolation, CSP, what the widget stores and sends
33
+ - [Browser support](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/browser-support.md): supported browsers and fallbacks
34
+ - [Troubleshooting](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/troubleshooting.md): an install that does not show, connect or answer
35
+ - [FAQ](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/faq.md): short answers to common questions
36
+ - [Overview](https://cdn.help.ai/sdk/js/elements/6.9.0/docs/README.md): the whole SDK on one page
37
37
 
38
38
  ## Optional
39
39
 
40
- - [Every doc in one file](https://cdn.help.ai/sdk/js/elements/6.7.0/llms-full.txt): the docs above, concatenated
40
+ - [Every doc in one file](https://cdn.help.ai/sdk/js/elements/6.9.0/llms-full.txt): the docs above, concatenated
package/package.json CHANGED
@@ -129,5 +129,5 @@
129
129
  ],
130
130
  "type": "module",
131
131
  "types": "./index.d.ts",
132
- "version": "6.7.0"
132
+ "version": "6.9.0"
133
133
  }
package/react.d.ts CHANGED
@@ -522,14 +522,20 @@ interface PresentationOptions {
522
522
  type PageToolCallStatus = 'completed' | 'failed' | 'interrupted';
523
523
  /** A 👍/👎 reaction on a rateable (assistant/operator) message; `null` clears a prior choice. */
524
524
  type FeedbackValue = 'up' | 'down' | null;
525
- /** The five switches, the same keys on a Deployment (`config.behavior.stepDisplay`) and in a member's Preferences. */
525
+ /**
526
+ * What an opened step shows: `none`, nothing (the step line alone, for a business that never shows a visitor's data
527
+ * back); `values`, its values as quiet label and value lines without ids; `table`, tables of what it ran on (ids
528
+ * included) and what came back; `json`, its raw input and result; `table-and-json`, the tables with the JSON folded
529
+ * under Raw data. A step waiting on a decision shows its values whatever this says.
530
+ */
531
+ declare const STEP_DETAILS: readonly ['none', 'values', 'table', 'json', 'table-and-json'];
532
+ type StepDetails = (typeof STEP_DETAILS)[number];
533
+ /** The settings, the same keys on a Deployment (`config.behavior.stepDisplay`) and in a member's Preferences. */
526
534
  interface StepDisplay {
527
535
  /** Every step appears as one folded line under the reply; off, only the steps that involve the reader do. */
528
536
  showSteps: boolean;
529
- /** Each step opens to what it ran on and what came back, as labelled tables with ids. */
530
- showStepDetails: boolean;
531
- /** Each step also opens to its raw input and result as JSON, under Raw data. */
532
- showRawData: boolean;
537
+ /** What an opened step shows (`STEP_DETAILS`). */
538
+ stepDetails: StepDetails;
533
539
  /** The system that ran a step follows its name: "Ship an order · BC Co. back office". */
534
540
  showStepSystem: boolean;
535
541
  /** Each approval says who decided it, and steps the rules decided show as steps. */
@@ -1155,8 +1161,13 @@ declare const widgetSettingsSchema: z.ZodObject<{
1155
1161
  showReasoning: z.ZodDefault<z.ZodBoolean>;
1156
1162
  stepDisplay: z.ZodOptional<z.ZodObject<{
1157
1163
  showSteps: z.ZodOptional<z.ZodBoolean>;
1158
- showStepDetails: z.ZodOptional<z.ZodBoolean>;
1159
- showRawData: z.ZodOptional<z.ZodBoolean>;
1164
+ stepDetails: z.ZodOptional<z.ZodEnum<{
1165
+ json: "json";
1166
+ none: "none";
1167
+ table: "table";
1168
+ "table-and-json": "table-and-json";
1169
+ values: "values";
1170
+ }>>;
1160
1171
  showStepSystem: z.ZodOptional<z.ZodBoolean>;
1161
1172
  showDecidedBy: z.ZodOptional<z.ZodBoolean>;
1162
1173
  foldApprovals: z.ZodOptional<z.ZodBoolean>;
@@ -1441,8 +1452,13 @@ declare const widgetConfigSchema: z.ZodObject<{
1441
1452
  showReasoning: z.ZodDefault<z.ZodBoolean>;
1442
1453
  stepDisplay: z.ZodOptional<z.ZodObject<{
1443
1454
  showSteps: z.ZodOptional<z.ZodBoolean>;
1444
- showStepDetails: z.ZodOptional<z.ZodBoolean>;
1445
- showRawData: z.ZodOptional<z.ZodBoolean>;
1455
+ stepDetails: z.ZodOptional<z.ZodEnum<{
1456
+ json: "json";
1457
+ none: "none";
1458
+ table: "table";
1459
+ "table-and-json": "table-and-json";
1460
+ values: "values";
1461
+ }>>;
1446
1462
  showStepSystem: z.ZodOptional<z.ZodBoolean>;
1447
1463
  showDecidedBy: z.ZodOptional<z.ZodBoolean>;
1448
1464
  foldApprovals: z.ZodOptional<z.ZodBoolean>;
@@ -1728,8 +1744,13 @@ declare const widgetConfigPartialSchema: z.ZodObject<{
1728
1744
  showReasoning: z.ZodDefault<z.ZodBoolean>;
1729
1745
  stepDisplay: z.ZodOptional<z.ZodObject<{
1730
1746
  showSteps: z.ZodOptional<z.ZodBoolean>;
1731
- showStepDetails: z.ZodOptional<z.ZodBoolean>;
1732
- showRawData: z.ZodOptional<z.ZodBoolean>;
1747
+ stepDetails: z.ZodOptional<z.ZodEnum<{
1748
+ json: "json";
1749
+ none: "none";
1750
+ table: "table";
1751
+ "table-and-json": "table-and-json";
1752
+ values: "values";
1753
+ }>>;
1733
1754
  showStepSystem: z.ZodOptional<z.ZodBoolean>;
1734
1755
  showDecidedBy: z.ZodOptional<z.ZodBoolean>;
1735
1756
  foldApprovals: z.ZodOptional<z.ZodBoolean>;
@@ -1977,8 +1998,13 @@ declare const widgetSettingsPartialSchema: z.ZodObject<{
1977
1998
  showReasoning: z.ZodDefault<z.ZodBoolean>;
1978
1999
  stepDisplay: z.ZodOptional<z.ZodObject<{
1979
2000
  showSteps: z.ZodOptional<z.ZodBoolean>;
1980
- showStepDetails: z.ZodOptional<z.ZodBoolean>;
1981
- showRawData: z.ZodOptional<z.ZodBoolean>;
2001
+ stepDetails: z.ZodOptional<z.ZodEnum<{
2002
+ json: "json";
2003
+ none: "none";
2004
+ table: "table";
2005
+ "table-and-json": "table-and-json";
2006
+ values: "values";
2007
+ }>>;
1982
2008
  showStepSystem: z.ZodOptional<z.ZodBoolean>;
1983
2009
  showDecidedBy: z.ZodOptional<z.ZodBoolean>;
1984
2010
  foldApprovals: z.ZodOptional<z.ZodBoolean>;
@@ -2281,8 +2307,13 @@ declare const serverConfigSchema: z.ZodObject<{
2281
2307
  showReasoning: z.ZodDefault<z.ZodBoolean>;
2282
2308
  stepDisplay: z.ZodOptional<z.ZodObject<{
2283
2309
  showSteps: z.ZodOptional<z.ZodBoolean>;
2284
- showStepDetails: z.ZodOptional<z.ZodBoolean>;
2285
- showRawData: z.ZodOptional<z.ZodBoolean>;
2310
+ stepDetails: z.ZodOptional<z.ZodEnum<{
2311
+ json: "json";
2312
+ none: "none";
2313
+ table: "table";
2314
+ "table-and-json": "table-and-json";
2315
+ values: "values";
2316
+ }>>;
2286
2317
  showStepSystem: z.ZodOptional<z.ZodBoolean>;
2287
2318
  showDecidedBy: z.ZodOptional<z.ZodBoolean>;
2288
2319
  foldApprovals: z.ZodOptional<z.ZodBoolean>;
@@ -2607,8 +2638,13 @@ declare const handshakeResponseSchema: z.ZodObject<{
2607
2638
  showReasoning: z.ZodDefault<z.ZodBoolean>;
2608
2639
  stepDisplay: z.ZodOptional<z.ZodObject<{
2609
2640
  showSteps: z.ZodOptional<z.ZodBoolean>;
2610
- showStepDetails: z.ZodOptional<z.ZodBoolean>;
2611
- showRawData: z.ZodOptional<z.ZodBoolean>;
2641
+ stepDetails: z.ZodOptional<z.ZodEnum<{
2642
+ json: "json";
2643
+ none: "none";
2644
+ table: "table";
2645
+ "table-and-json": "table-and-json";
2646
+ values: "values";
2647
+ }>>;
2612
2648
  showStepSystem: z.ZodOptional<z.ZodBoolean>;
2613
2649
  showDecidedBy: z.ZodOptional<z.ZodBoolean>;
2614
2650
  foldApprovals: z.ZodOptional<z.ZodBoolean>;