@rannah-labs/react-voice-orb 1.1.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/README.md +240 -0
- package/assets/orb-ss.png +0 -0
- package/assets/thing.png +0 -0
- package/dist/bun-server/src/types/index.d.ts +37 -0
- package/dist/bun-server/src/types/index.js +2 -0
- package/dist/src/app/Types/TranscriberStuff.d.ts +0 -0
- package/dist/src/app/Types/TranscriberStuff.js +1 -0
- package/dist/src/app/Types/apiModels.d.ts +31 -0
- package/dist/src/app/Types/apiModels.js +2 -0
- package/dist/src/app/Types/api_types.d.ts +34 -0
- package/dist/src/app/Types/api_types.js +2 -0
- package/dist/src/app/Types/better-trpc.d.ts +5 -0
- package/dist/src/app/Types/better-trpc.js +23 -0
- package/dist/src/app/Types/browser-only.d.ts +1 -0
- package/dist/src/app/Types/browser-only.js +12 -0
- package/dist/src/app/Types/builltInNodesTemplates.d.ts +1070 -0
- package/dist/src/app/Types/builltInNodesTemplates.js +1341 -0
- package/dist/src/app/Types/defaults.d.ts +7 -0
- package/dist/src/app/Types/defaults.js +210 -0
- package/dist/src/app/Types/demo_extension.d.ts +11 -0
- package/dist/src/app/Types/demo_extension.js +190 -0
- package/dist/src/app/Types/envObject.d.ts +97 -0
- package/dist/src/app/Types/envObject.js +5 -0
- package/dist/src/app/Types/firebase.d.ts +30413 -0
- package/dist/src/app/Types/firebase.js +6696 -0
- package/dist/src/app/Types/gen_openapi.d.ts +130 -0
- package/dist/src/app/Types/gen_openapi.js +2 -0
- package/dist/src/app/Types/global_types.d.ts +254 -0
- package/dist/src/app/Types/global_types.js +6 -0
- package/dist/src/app/Types/messages_types.d.ts +76 -0
- package/dist/src/app/Types/messages_types.js +1 -0
- package/dist/src/app/Types/vapi_types.d.ts +358 -0
- package/dist/src/app/Types/vapi_types.js +2 -0
- package/dist/src/app/Types/vf_types.d.ts +33 -0
- package/dist/src/app/Types/vf_types.js +2 -0
- package/dist/src/public_packages/react-voice-orb/src/animation-orb.d.ts +11 -0
- package/dist/src/public_packages/react-voice-orb/src/animation-orb.js +397 -0
- package/dist/src/public_packages/react-voice-orb/src/index.d.ts +5 -0
- package/dist/src/public_packages/react-voice-orb/src/index.js +16 -0
- package/dist/src/public_packages/react-voice-orb/src/providers/AIAudioProvider.d.ts +21 -0
- package/dist/src/public_packages/react-voice-orb/src/providers/AIAudioProvider.js +81 -0
- package/dist/src/public_packages/react-voice-orb/src/providers/ThemeProvider.d.ts +23 -0
- package/dist/src/public_packages/react-voice-orb/src/providers/ThemeProvider.js +202 -0
- package/dist/src/public_packages/react-voice-orb/src/scripts/same-script.d.ts +1 -0
- package/dist/src/public_packages/react-voice-orb/src/scripts/same-script.js +79 -0
- package/dist/src/public_packages/react-voice-orb/src/spinner.d.ts +3 -0
- package/dist/src/public_packages/react-voice-orb/src/spinner.js +17 -0
- package/dist/src/public_packages/react-voice-orb/tsconfig.tsbuildinfo +1 -0
- package/dist/vg-docker/src/+global_consts/client.d.ts +84 -0
- package/dist/vg-docker/src/+global_consts/client.js +105 -0
- package/package.json +46 -0
- package/scripts/post-tsc.ts +74 -0
- package/src/animation-orb.tsx +441 -0
- package/src/index.ts +5 -0
- package/src/providers/AIAudioProvider.tsx +100 -0
- package/src/providers/ThemeProvider.tsx +211 -0
- package/src/scripts/same-script.ts +73 -0
- package/src/spinner.tsx +19 -0
- package/tsconfig.json +34 -0
- package/webpack.config.js +141 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolField, VGAgentTool } from "./firebase";
|
|
3
|
+
export declare const systemVariablesKeys: z.ZodEnum<["phone_number", "timestamp", "channel"]>;
|
|
4
|
+
export declare const defaultSystemVariables: ToolField[];
|
|
5
|
+
export declare const defaultSystemToolsKeys: z.ZodEnum<["Forward-Call"]>;
|
|
6
|
+
export declare const defaultSystemTools: VGAgentTool[];
|
|
7
|
+
export declare const uiEnginePrompt: string;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiEnginePrompt = exports.defaultSystemTools = exports.defaultSystemToolsKeys = exports.defaultSystemVariables = exports.systemVariablesKeys = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.systemVariablesKeys = zod_1.z.enum([
|
|
6
|
+
"phone_number",
|
|
7
|
+
"timestamp",
|
|
8
|
+
"channel",
|
|
9
|
+
]);
|
|
10
|
+
//
|
|
11
|
+
exports.defaultSystemVariables = [
|
|
12
|
+
{
|
|
13
|
+
id: "phone_number",
|
|
14
|
+
type: "string",
|
|
15
|
+
required: true,
|
|
16
|
+
key: "phone_number",
|
|
17
|
+
in: "input",
|
|
18
|
+
isEnv: true,
|
|
19
|
+
description: "The phone number of the caller.",
|
|
20
|
+
isSystem: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "channel",
|
|
24
|
+
type: "string",
|
|
25
|
+
required: true,
|
|
26
|
+
key: "channel",
|
|
27
|
+
in: "input",
|
|
28
|
+
isEnv: true,
|
|
29
|
+
description: "The channel of the current conversation, web-chat, voice, whatsapp, etc..",
|
|
30
|
+
isSystem: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "timestamp",
|
|
34
|
+
type: "string",
|
|
35
|
+
required: true,
|
|
36
|
+
key: "timestamp",
|
|
37
|
+
in: "input",
|
|
38
|
+
isEnv: true,
|
|
39
|
+
description: "The timestamp of the current conversation in ISO 8601 format.",
|
|
40
|
+
isSystem: true,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
exports.defaultSystemToolsKeys = zod_1.z.enum(["Forward-Call"]);
|
|
44
|
+
exports.defaultSystemTools = [
|
|
45
|
+
{
|
|
46
|
+
id: "Forward-Call",
|
|
47
|
+
name: "Forward-Call",
|
|
48
|
+
description: "Forward a call to the given phone number and only works on phone channels (Twilio)",
|
|
49
|
+
variablesIds: ["phone_number"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "human_handoff",
|
|
53
|
+
name: "human_handoff",
|
|
54
|
+
description: "Hand off the call to a human agent",
|
|
55
|
+
variablesIds: [],
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
exports.uiEnginePrompt = `FINALLY YOU MUST OUTPUT A VALID JSON ARRAY OF MESSAGES ONLY AND YOU MUST FOLLOW THE INSTRUCITONS MENTIONED AHEAD!!!
|
|
59
|
+
|
|
60
|
+
--- START UI ENGINE PROMPT ---
|
|
61
|
+
## Instructions on How to Create Dynamic UI Elements Based on Context
|
|
62
|
+
|
|
63
|
+
### Guidelines:
|
|
64
|
+
1. **Output Requirements**:
|
|
65
|
+
- Output must be a JSON array of objects.
|
|
66
|
+
- The output **must** adhere strictly to the TypeScript schema provided.
|
|
67
|
+
- Start the JSON array with "[" and end with "]".
|
|
68
|
+
|
|
69
|
+
2. **General Rules**:
|
|
70
|
+
- **Do not** include Output only JSON eliding any pre-text, post-text or explanations. Extraneous output will cause error.
|
|
71
|
+
- **URLs used within the JSON output must exclusively derive from the KB search tool.** If a required URL is absent from the KB, mention its unavailability explicitly.
|
|
72
|
+
- **Preferred Structure**:
|
|
73
|
+
- Start with a text message to initiate the conversation.
|
|
74
|
+
- Follow with a card or collection of cards to showcase visuals or important points with potential call-to-action buttons. This visually anchors the conversation.
|
|
75
|
+
- Include an iframe or image message, especially if you have a video URL from the search tool, to enhance engagement.
|
|
76
|
+
- End with buttons or a choice message to guide the user's next steps based on the context retrieved from the KB search tool.
|
|
77
|
+
- When using links for images in cards/image messages, always ensure they start with "https://" and end with a valid image extension like ".png/.jpg/.jpeg/.webp/.gif/etc.."
|
|
78
|
+
|
|
79
|
+
THE FOLLOWING IS THE TYPESCRIPT SCHEMA:
|
|
80
|
+
--- START TYPESCRIPT SCHEMA ---
|
|
81
|
+
/**
|
|
82
|
+
* Interface for a text payload.
|
|
83
|
+
* Use when sending a simple text message.
|
|
84
|
+
* @interface
|
|
85
|
+
*/
|
|
86
|
+
interface TextPayload {
|
|
87
|
+
message?: string; // Message content, supports Markdown
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* General interface for a Button Object
|
|
92
|
+
* @interface
|
|
93
|
+
*/
|
|
94
|
+
interface ButtonModel {
|
|
95
|
+
name: string; // Label of the button
|
|
96
|
+
request: {
|
|
97
|
+
type: "open_url"; // Request type for sending text or opening a URL
|
|
98
|
+
payload: {
|
|
99
|
+
url: string; // URL to open when the button is clicked (ONLY USE URLs from the KB SEARCH TOOL NEVER MAKE UP URLs IF WHAT YOU NEED IS NOT IN THE KB SEARCH TOOL THEN DO NOT USE THIS.)
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
type: "text"; // Request type for sending text or opening a URL
|
|
103
|
+
payload: {
|
|
104
|
+
message: string; // Variable message to send when the button is clicked
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Interface for a choice payload.
|
|
111
|
+
* Use when you want to share a url or predict/recommend what the user may say next.
|
|
112
|
+
* @interface
|
|
113
|
+
*/
|
|
114
|
+
interface ChoicePayload {
|
|
115
|
+
buttons: ButtonModel[];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
${false
|
|
119
|
+
? ""
|
|
120
|
+
: `/**
|
|
121
|
+
* Interface for a visual message.
|
|
122
|
+
* Use when you have an image url to present (.png/.jpg/.jpeg/.webp/.gif/etc..)
|
|
123
|
+
* @interface
|
|
124
|
+
*/
|
|
125
|
+
interface VisualPayload {
|
|
126
|
+
image: string; // URL of the image
|
|
127
|
+
}`}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Interface for a card payload.
|
|
131
|
+
* Use when you want to present an image with a caption or with action buttons.
|
|
132
|
+
* @interface
|
|
133
|
+
*/
|
|
134
|
+
interface CardPayload {
|
|
135
|
+
imageUrl?: string; // (Optional) URL of the image MUST END WITH .png/.jpg/.jpeg/.webp/.gif/etc..
|
|
136
|
+
title: string; // (Required) Title of the card (supports markdown)
|
|
137
|
+
description?: {
|
|
138
|
+
text: string; // Description of the card (supports markdown)
|
|
139
|
+
};
|
|
140
|
+
buttons?: ButtonModel[]; // (Optional) Array of buttons for the card
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Interface for a carousel payload containing an array of cards.
|
|
145
|
+
* Use whenever you have multiple cards to present.
|
|
146
|
+
* @interface
|
|
147
|
+
*/
|
|
148
|
+
interface CarouselPayload {
|
|
149
|
+
cards: CardPayload[]; // Array of card messages
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
${false
|
|
153
|
+
? ""
|
|
154
|
+
: `/**
|
|
155
|
+
* Interface for an iframe payload containing a valid iframe html.
|
|
156
|
+
* Use whenever you have an iframe SPECIALLY YOUTUBE/VIMEO OR POPULAR VIDEO HOSTING PLATFORMS.
|
|
157
|
+
* HIGH PRIO TO USE THIS IF YOU CAN GET THE URL OF A VIDEO FROM THE SEARCH TOOL, YOU WILL FIND "YOUTUBE VIDEO" in the KB result as a hint.
|
|
158
|
+
* @interface
|
|
159
|
+
*/
|
|
160
|
+
interface iFramePayload {
|
|
161
|
+
layout: "vertical" | "horizontal"; // whether the iframe should be adjusted to be vertical or horizontal (vertical is for videos/youtube, horizontal is for anything else)
|
|
162
|
+
url: string; // URL of the iframe OR the iframe html (If its a video iframe like youtube only the URL is needed, if its a custom iframe then the whole iframe html is needed)
|
|
163
|
+
}`}
|
|
164
|
+
|
|
165
|
+
// all the messages types
|
|
166
|
+
// you can use any of these types according to the message you should send
|
|
167
|
+
type MessageType = "text" | "choice" ${false ? "" : `| "visual"`} | "cardV2" | "carousel" | ${false ? "" : `| "iFrame"`};
|
|
168
|
+
|
|
169
|
+
// message interface
|
|
170
|
+
interface Message {
|
|
171
|
+
type: MessageType; // Type of the message
|
|
172
|
+
payload: TextPayload | ChoicePayload ${false ? "" : `| ImagePayload `} | CardPayload | CarouselPayload ${false ? "" : `| iFramePayload`}; // Payload of the message
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Final response interface
|
|
177
|
+
* This should be your FINAL output: AN ARRAY OF Message OBJECTS
|
|
178
|
+
* @type
|
|
179
|
+
*/
|
|
180
|
+
type FinalResponse = Message[] // ARRAY OF MESSAGE OBJECTS AS A JSON STRING.
|
|
181
|
+
--- END TYPESCRIPT SCHEMA ---
|
|
182
|
+
|
|
183
|
+
### Example JSON Structures:
|
|
184
|
+
#### Example 1:
|
|
185
|
+
[{
|
|
186
|
+
"type": "text",
|
|
187
|
+
"payload": {
|
|
188
|
+
"message": "Hello there! How can I help you today?"
|
|
189
|
+
}
|
|
190
|
+
}]
|
|
191
|
+
|
|
192
|
+
#### Example 2:
|
|
193
|
+
[{
|
|
194
|
+
"type": "text",
|
|
195
|
+
"payload": {
|
|
196
|
+
"message": "Sure! Here's a showcase of our services in brief details:"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"type": "carousel",
|
|
201
|
+
"payload": {
|
|
202
|
+
"cards": [
|
|
203
|
+
{
|
|
204
|
+
"title": "Service 1",
|
|
205
|
+
"description": {
|
|
206
|
+
"text": "Service 1 is a great service that helps you with your needs."
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
--- END UI ENGINE PROMPT ---`;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VFSelectExtension = void 0;
|
|
4
|
+
const uiDefault = {
|
|
5
|
+
primaryButtonColor: '#2e7ff1',
|
|
6
|
+
primaryButtonColorHover: '#0c74e4',
|
|
7
|
+
primaryButtonTextLabel: 'Confirm',
|
|
8
|
+
primaryButtonTextColor: '#ffffff',
|
|
9
|
+
destructiveButtonColor: '#db1b42',
|
|
10
|
+
destructiveButtonColorHover: '#cd0038',
|
|
11
|
+
destructiveButtonTextLabel: 'Cancel',
|
|
12
|
+
destructiveButtonTextColor: '#ffffff',
|
|
13
|
+
defaultOptionText: 'Select option',
|
|
14
|
+
};
|
|
15
|
+
const validateData = (data) => {
|
|
16
|
+
if (!Array.isArray(data)) {
|
|
17
|
+
throw new Error('Invalid data: must be an array');
|
|
18
|
+
}
|
|
19
|
+
if (!data.length) {
|
|
20
|
+
throw new Error('Invalid data: must have values');
|
|
21
|
+
}
|
|
22
|
+
data.forEach((item) => {
|
|
23
|
+
if (typeof item !== 'string') {
|
|
24
|
+
if (!Object.hasOwn(item, 'text') || !Object.hasOwn(item, 'value')) {
|
|
25
|
+
throw new Error('Invalid data: items must be either strings or objects with text and value keys');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const process = (trace) => {
|
|
31
|
+
let { data = [], ui = {} } = trace.payload;
|
|
32
|
+
// throws error if data is invalid
|
|
33
|
+
validateData(data);
|
|
34
|
+
// merge ui options objects
|
|
35
|
+
ui = Object.assign({}, uiDefault, ui);
|
|
36
|
+
return { data, ui };
|
|
37
|
+
};
|
|
38
|
+
const createSelectElement = (data, ui) => {
|
|
39
|
+
let selectedOption = null;
|
|
40
|
+
const selectElement = document.createElement('select');
|
|
41
|
+
selectElement.id = 'selectInput';
|
|
42
|
+
selectElement.required = true;
|
|
43
|
+
// create default option
|
|
44
|
+
const optionDefault = document.createElement('option');
|
|
45
|
+
optionDefault.text = ui.defaultOptionText;
|
|
46
|
+
optionDefault.value = '';
|
|
47
|
+
selectElement.appendChild(optionDefault);
|
|
48
|
+
// create data options
|
|
49
|
+
data.forEach((item) => {
|
|
50
|
+
const optionElement = document.createElement('option');
|
|
51
|
+
if (typeof item === 'string' || item instanceof String) {
|
|
52
|
+
optionElement.text = item;
|
|
53
|
+
optionElement.value = item;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
optionElement.text = item.text;
|
|
57
|
+
optionElement.value = item.value;
|
|
58
|
+
if (item.selected) {
|
|
59
|
+
optionElement.selected = true;
|
|
60
|
+
selectedOption = item.value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
selectElement.appendChild(optionElement);
|
|
64
|
+
});
|
|
65
|
+
return { selectElement, selectedOption };
|
|
66
|
+
};
|
|
67
|
+
const createFormContainer = (ui) => {
|
|
68
|
+
const formContainer = document.createElement('div');
|
|
69
|
+
formContainer.innerHTML = `
|
|
70
|
+
<style>
|
|
71
|
+
#container {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
margin: 0;
|
|
76
|
+
padding: 0;
|
|
77
|
+
width: 225px;
|
|
78
|
+
max-width: none;
|
|
79
|
+
overflow: visible;
|
|
80
|
+
overflowX: hidden;
|
|
81
|
+
overflowY: hidden;
|
|
82
|
+
}
|
|
83
|
+
#selectInput {
|
|
84
|
+
padding: 5px;
|
|
85
|
+
border-radius: 8px;
|
|
86
|
+
border-color: #ddd;
|
|
87
|
+
font-size: 15px;
|
|
88
|
+
}
|
|
89
|
+
#buttonContainer {
|
|
90
|
+
display: flex;
|
|
91
|
+
gap: 10px;
|
|
92
|
+
margin-top: 10px;
|
|
93
|
+
transition: opacity 0.3s ease;
|
|
94
|
+
}
|
|
95
|
+
#submitButton, #cancelButton {
|
|
96
|
+
font-size: 15px;
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
border: none;
|
|
99
|
+
padding: 10px;
|
|
100
|
+
border-radius: 8px;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
103
|
+
#submitButton {
|
|
104
|
+
flex: 1;
|
|
105
|
+
color: ${ui.primaryButtonTextColor};
|
|
106
|
+
background: ${ui.primaryButtonColor};
|
|
107
|
+
}
|
|
108
|
+
#submitButton:hover:not(:disabled) {
|
|
109
|
+
background: ${ui.primaryButtonColorHover};
|
|
110
|
+
}
|
|
111
|
+
#cancelButton {
|
|
112
|
+
flex: 1;
|
|
113
|
+
color: ${ui.destructiveButtonTextColor};
|
|
114
|
+
background: ${ui.destructiveButtonColor};
|
|
115
|
+
}
|
|
116
|
+
#cancelButton:hover:not(:disabled) {
|
|
117
|
+
background: ${ui.destructiveButtonColorHover};
|
|
118
|
+
}
|
|
119
|
+
#submitButton:disabled, #cancelButton:disabled {
|
|
120
|
+
background: #ccc;
|
|
121
|
+
cursor: not-allowed;
|
|
122
|
+
color: #666;
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
125
|
+
<form id="form">
|
|
126
|
+
<div id="container"></div>
|
|
127
|
+
<div id="buttonContainer">
|
|
128
|
+
<button id="submitButton" type="submit">${ui.primaryButtonTextLabel}</button>
|
|
129
|
+
<button id="cancelButton" type="button">${ui.destructiveButtonTextLabel}</button>
|
|
130
|
+
</div>
|
|
131
|
+
</form>`;
|
|
132
|
+
return formContainer;
|
|
133
|
+
};
|
|
134
|
+
exports.VFSelectExtension = {
|
|
135
|
+
name: 'Select',
|
|
136
|
+
type: 'response',
|
|
137
|
+
match: ({ trace }) => trace.type === 'ext_select_input' ||
|
|
138
|
+
trace.payload.name === 'ext_select_input',
|
|
139
|
+
render: ({ trace, element }) => {
|
|
140
|
+
try {
|
|
141
|
+
const { data, ui } = process(trace);
|
|
142
|
+
// form container
|
|
143
|
+
const formContainer = createFormContainer(ui);
|
|
144
|
+
// select container
|
|
145
|
+
const selectContainer = formContainer.querySelector('#container');
|
|
146
|
+
// select element
|
|
147
|
+
let { selectElement, selectedOption } = createSelectElement(data, ui);
|
|
148
|
+
selectElement.addEventListener('change', (event) => {
|
|
149
|
+
selectedOption = event.target.value;
|
|
150
|
+
});
|
|
151
|
+
selectContainer.appendChild(selectElement);
|
|
152
|
+
// submit button
|
|
153
|
+
const submitButton = formContainer.querySelector('#submitButton');
|
|
154
|
+
// cancel button
|
|
155
|
+
const cancelButton = formContainer.querySelector('#cancelButton');
|
|
156
|
+
cancelButton.addEventListener('click', () => {
|
|
157
|
+
// push cancel event to voiceflow runtime
|
|
158
|
+
window.voiceflow.chat.interact({
|
|
159
|
+
type: 'cancel',
|
|
160
|
+
});
|
|
161
|
+
selectElement.disabled = true;
|
|
162
|
+
submitButton.disabled = true;
|
|
163
|
+
cancelButton.disabled = true;
|
|
164
|
+
});
|
|
165
|
+
// form
|
|
166
|
+
const form = formContainer.querySelector('#form');
|
|
167
|
+
form.addEventListener('submit', (event) => {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
// push complete event to voiceflow runtime
|
|
170
|
+
window.voiceflow.chat.interact({
|
|
171
|
+
type: 'complete',
|
|
172
|
+
payload: { value: selectedOption },
|
|
173
|
+
});
|
|
174
|
+
selectElement.disabled = true;
|
|
175
|
+
submitButton.disabled = true;
|
|
176
|
+
cancelButton.disabled = true;
|
|
177
|
+
});
|
|
178
|
+
// add form container to voiceflow element
|
|
179
|
+
element.appendChild(formContainer);
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
console.log('VFSelectExtension', error);
|
|
183
|
+
// push error event to voiceflow runtime
|
|
184
|
+
window.voiceflow.chat.interact({
|
|
185
|
+
type: 'error',
|
|
186
|
+
payload: { message: error.message ?? 'Unknown error' },
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export declare const envObject: {
|
|
2
|
+
NODE_ENV: string;
|
|
3
|
+
VERCEL: string;
|
|
4
|
+
VERCEL_ENV: string;
|
|
5
|
+
VERCEL_URL: string;
|
|
6
|
+
VERCEL_GIT_PROVIDER: string;
|
|
7
|
+
VERCEL_GIT_PREVIOUS_SHA: string;
|
|
8
|
+
VERCEL_GIT_REPO_SLUG: string;
|
|
9
|
+
VERCEL_GIT_REPO_OWNER: string;
|
|
10
|
+
VERCEL_GIT_REPO_ID: string;
|
|
11
|
+
VERCEL_GIT_COMMIT_REF: string;
|
|
12
|
+
VERCEL_GIT_COMMIT_SHA: string;
|
|
13
|
+
VERCEL_GIT_COMMIT_MESSAGE: string;
|
|
14
|
+
VERCEL_GIT_COMMIT_AUTHOR_LOGIN: string;
|
|
15
|
+
VERCEL_GIT_COMMIT_AUTHOR_NAME: string;
|
|
16
|
+
VERCEL_GIT_PULL_REQUEST_ID: string;
|
|
17
|
+
KV_URL: string;
|
|
18
|
+
KV_REST_API_URL: string;
|
|
19
|
+
KV_REST_API_TOKEN: string;
|
|
20
|
+
KV_REST_API_READ_ONLY_TOKEN: string;
|
|
21
|
+
EDGE_CONFIG: string;
|
|
22
|
+
BLOB_READ_WRITE_TOKEN: string;
|
|
23
|
+
RESEND_API_KEY: string;
|
|
24
|
+
DEEPGRAM_API_KEY: string;
|
|
25
|
+
QDRANT_API_KEY: string;
|
|
26
|
+
OPENAI_API_KEY: string;
|
|
27
|
+
GOOGLE_GENAI_API_KEY: string;
|
|
28
|
+
ANTHROPIC_API_KEY: string;
|
|
29
|
+
GROQ_API_KEY: string;
|
|
30
|
+
OAI_US_ENDPOINT: string;
|
|
31
|
+
OAI_US_API_KEY: string;
|
|
32
|
+
STRIPE_SECRET_KEY_TEST: string;
|
|
33
|
+
STRIPE_SECRET_KEY: string;
|
|
34
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_TEST: string;
|
|
35
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: string;
|
|
36
|
+
R2_ACCESS_KEY_ID: string;
|
|
37
|
+
R2_SECRET_ACCESS_KEY: string;
|
|
38
|
+
R2_BUCKET_NAME: string;
|
|
39
|
+
R2_ENDPOINT: string;
|
|
40
|
+
R2_PUBLIC_ENDPOINT: string;
|
|
41
|
+
SUPABASE_SUPER_KEY: string;
|
|
42
|
+
SUPABASE_URL: string;
|
|
43
|
+
META_CLIENT_ID: string;
|
|
44
|
+
META_CLIENT_SECRET: string;
|
|
45
|
+
VG_SERVER_KEY: string;
|
|
46
|
+
HUGGING_FACE_API_KEY: string;
|
|
47
|
+
INHOUSE_API_KEY: string;
|
|
48
|
+
USESCRAPER_API_KEY: string;
|
|
49
|
+
VG_APP_SECRET: string;
|
|
50
|
+
PROJECT_ID_VERCEL: string;
|
|
51
|
+
TEAM_ID_VERCEL: string;
|
|
52
|
+
AUTH_BEARER_TOKEN: string;
|
|
53
|
+
GOOGLE_API_KEY: string;
|
|
54
|
+
NEXT_PUBLIC_ROOT_DOMAIN: string;
|
|
55
|
+
ZOHO_REFRESH_TOKEN: string;
|
|
56
|
+
ZOHO_CLIENT_ID: string;
|
|
57
|
+
ZOHO_CLIENT_SECRET: string;
|
|
58
|
+
QDRANT_KEY: string;
|
|
59
|
+
VF_KB_KEY: string;
|
|
60
|
+
MAILSENDER_KEY: string;
|
|
61
|
+
GOOGLE_FONTS_API_KEY: string;
|
|
62
|
+
PAYPAL_CLIENT_KEY: string;
|
|
63
|
+
PAYPAL_SECRET_KEY: string;
|
|
64
|
+
PAYPAL_CLIENT_KEY_LIVE: string;
|
|
65
|
+
PAYPAL_SECRET_KEY_LIVE: string;
|
|
66
|
+
MISTRAL_API_KEY: string;
|
|
67
|
+
SENDGRID_API_KEY: string;
|
|
68
|
+
SYNTHFLOW_API_KEY: string;
|
|
69
|
+
LLAMA_INDEX_API_KEY: string;
|
|
70
|
+
GOOGLE_AI_API_KEY: string;
|
|
71
|
+
CALENDLY_PERSONAL_ACCESS_TOKEN: string;
|
|
72
|
+
CAL_API_KEY: string;
|
|
73
|
+
NEXT_PUBLIC_MY_PASSWORD: string;
|
|
74
|
+
POSTGRES_EU_PASSWORD: string;
|
|
75
|
+
POSTGRES_NA_PASSWORD: string;
|
|
76
|
+
PORT: string;
|
|
77
|
+
BUNNY_CDN_PASSWORD: string;
|
|
78
|
+
BUNNY_CDN_USERNAME: string;
|
|
79
|
+
PLAYHT_USER_ID: string;
|
|
80
|
+
PLAYHT_API_KEY: string;
|
|
81
|
+
CARTESIA_API_KEY: string;
|
|
82
|
+
GLADIA_API_KEY: string;
|
|
83
|
+
ELEVENLABS_API_KEY: string;
|
|
84
|
+
ASSEMBLY_API_KEY: string;
|
|
85
|
+
TWILIO_ACCOUNT_SID: string;
|
|
86
|
+
TWILIO_AUTH_TOKEN: string;
|
|
87
|
+
RIMEAI_API_KEY: string;
|
|
88
|
+
AZURE_API_KEY: string;
|
|
89
|
+
AZURE_REGION: string;
|
|
90
|
+
DIGITAL_OCEAN_PERSONAL_TOKEN: string;
|
|
91
|
+
SPEECHMATICS_API_KEY: string;
|
|
92
|
+
DEEPSEEK_API_KEY: string;
|
|
93
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE: string;
|
|
94
|
+
NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID_LIVE: string;
|
|
95
|
+
PARTNER_STACK_KEY: string;
|
|
96
|
+
SMARTPROXY_API_KEY: string;
|
|
97
|
+
};
|