@nlxai/touchpoint-ui 1.1.8-alpha.2 → 1.1.8-alpha.3
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/lib/components/FullscreenVoice.d.ts +1 -2
- package/lib/index.d.ts +2 -73
- package/lib/index.js +15579 -15583
- package/lib/index.umd.js +100 -100
- package/lib/interface.d.ts +70 -0
- package/package.json +6 -7
package/lib/interface.d.ts
CHANGED
|
@@ -406,3 +406,73 @@ export interface BidirectionalCustomCommand {
|
|
|
406
406
|
*/
|
|
407
407
|
handler: (value: any) => void;
|
|
408
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Instance of a Touchpoint UI component
|
|
411
|
+
*/
|
|
412
|
+
export interface TouchpointInstance {
|
|
413
|
+
/**
|
|
414
|
+
* Controls whether the Touchpoint UI is expanded or collapsed
|
|
415
|
+
*/
|
|
416
|
+
expanded: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* The conversation handler instance for interacting with the application
|
|
419
|
+
*/
|
|
420
|
+
conversationHandler: ConversationHandler;
|
|
421
|
+
/**
|
|
422
|
+
* Method to remove the Touchpoint UI from the DOM
|
|
423
|
+
*/
|
|
424
|
+
teardown: () => void;
|
|
425
|
+
/**
|
|
426
|
+
* Sets currently available custom bidirectional commands.
|
|
427
|
+
* This allows you to define custom commands that can be used in the voice bot.
|
|
428
|
+
* The commands will be available in the voice bot and can be used to trigger actions.
|
|
429
|
+
*
|
|
430
|
+
* Example:
|
|
431
|
+
* ```javascript
|
|
432
|
+
* client.setCustomBidirectionalCommands([
|
|
433
|
+
* {
|
|
434
|
+
* action: "Meal",
|
|
435
|
+
* description: "add a meal to your flight",
|
|
436
|
+
* schema: {
|
|
437
|
+
* enum: ["standard", "vegetarian", "vegan", "gluten-free"],
|
|
438
|
+
* },
|
|
439
|
+
* handler: (value) => {
|
|
440
|
+
* console.log("Meal option:", value);
|
|
441
|
+
* },
|
|
442
|
+
* },
|
|
443
|
+
* ]);
|
|
444
|
+
* ```
|
|
445
|
+
*
|
|
446
|
+
* This will allow the voice bot to use the command `Meal` with the value `standard`, `vegetarian`, `vegan`, or `gluten-free`.
|
|
447
|
+
*
|
|
448
|
+
* When using more complex arguments, a library such as [Zod](https://zod.dev) can be useful:
|
|
449
|
+
*
|
|
450
|
+
* ```javascript
|
|
451
|
+
* import * as z from "zod/v4";
|
|
452
|
+
*
|
|
453
|
+
* const schema = z.object({
|
|
454
|
+
* "name": z.string().describe("The customer's name, such as John Doe"),
|
|
455
|
+
* "email": z.string().email().describe("The customer's email address"),
|
|
456
|
+
* });
|
|
457
|
+
*
|
|
458
|
+
* client.setCustomBidirectionalCommands([
|
|
459
|
+
* {
|
|
460
|
+
* action: "Meal",
|
|
461
|
+
* description: "add a meal to your flight",
|
|
462
|
+
* schema: z.toJSONSchema(schema, {io: "input"}),
|
|
463
|
+
* handler: (value) => {
|
|
464
|
+
* const result = z.safeParse(schema, value);
|
|
465
|
+
* if (result.success) {
|
|
466
|
+
* // result.data is now type safe and TypeScript can reason about it
|
|
467
|
+
* console.log("Meal option:", result.data);
|
|
468
|
+
* } else {
|
|
469
|
+
* console.error("Failed to parse Meal option:", result.error);
|
|
470
|
+
* }
|
|
471
|
+
* },
|
|
472
|
+
* },
|
|
473
|
+
* ]);
|
|
474
|
+
* ```
|
|
475
|
+
* @param commands - A list containing the custom commands to set.
|
|
476
|
+
*/
|
|
477
|
+
setCustomBidirectionalCommands: (commands: BidirectionalCustomCommand[]) => void;
|
|
478
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlxai/touchpoint-ui",
|
|
3
|
-
"version": "1.1.8-alpha.
|
|
3
|
+
"version": "1.1.8-alpha.3",
|
|
4
4
|
"description": "Web UI for Touchpoint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"@react-input/mask": "^2.0.4",
|
|
30
30
|
"@types/json-schema": "^7.0.15",
|
|
31
31
|
"clsx": "^2.1.1",
|
|
32
|
-
"hast": "^0.0.2",
|
|
33
32
|
"htm": "^3.1.1",
|
|
34
33
|
"livekit-client": "^2.9.9",
|
|
35
34
|
"marked": "^15.0.4",
|
|
@@ -37,8 +36,7 @@
|
|
|
37
36
|
"react": "^18.3.1",
|
|
38
37
|
"react-dom": "^18.3.1",
|
|
39
38
|
"react-indiana-drag-scroll": "^2.2.0",
|
|
40
|
-
"react-textarea-autosize": "^8.5.6"
|
|
41
|
-
"unist": "^0.0.1"
|
|
39
|
+
"react-textarea-autosize": "^8.5.6"
|
|
42
40
|
},
|
|
43
41
|
"devDependencies": {
|
|
44
42
|
"@rollup/plugin-replace": "^6.0.2",
|
|
@@ -55,11 +53,12 @@
|
|
|
55
53
|
"postcss": "^8.4.38",
|
|
56
54
|
"tailwindcss": "^3.4.3",
|
|
57
55
|
"typescript": "^5.4.5",
|
|
58
|
-
"vite": "^
|
|
59
|
-
"vite-plugin-dts": "^4.5.0"
|
|
56
|
+
"vite": "^6.0",
|
|
57
|
+
"vite-plugin-dts": "^4.5.0",
|
|
58
|
+
"zod": "^4.1.5"
|
|
60
59
|
},
|
|
61
60
|
"publishConfig": {
|
|
62
61
|
"access": "public"
|
|
63
62
|
},
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "7dcad47764e9b7bc859f13d757e4412cd7537614"
|
|
65
64
|
}
|