@guava-ai/guava-sdk 0.33.0 → 0.35.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/bin/example-runner.ts +4 -0
- package/dist/bin/example-runner.js +4 -0
- package/dist/bin/example-runner.js.map +1 -1
- package/dist/examples/slow-speech.d.ts +3 -0
- package/dist/examples/slow-speech.js +94 -0
- package/dist/examples/slow-speech.js.map +1 -0
- package/dist/src/action-item.d.ts +4 -4
- package/dist/src/action-item.js +1 -0
- package/dist/src/action-item.js.map +1 -1
- package/dist/src/agent.d.ts +9 -2
- package/dist/src/agent.js +29 -9
- package/dist/src/agent.js.map +1 -1
- package/dist/src/call.d.ts +2 -1
- package/dist/src/call.js +1 -0
- package/dist/src/call.js.map +1 -1
- package/dist/src/commands.d.ts +39 -3
- package/dist/src/commands.js +13 -1
- package/dist/src/commands.js.map +1 -1
- package/dist/src/events.d.ts +84 -3
- package/dist/src/events.js +12 -1
- package/dist/src/events.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/examples/README.md +1 -0
- package/examples/slow-speech.ts +65 -0
- package/package.json +1 -1
- package/src/action-item.ts +1 -0
- package/src/agent.ts +38 -9
- package/src/call.ts +3 -0
- package/src/commands.ts +16 -0
- package/src/events.ts +13 -0
- package/src/index.ts +2 -0
- package/src/version.ts +1 -1
package/dist/src/commands.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const SetTaskCommand: z.ZodObject<{
|
|
|
28
28
|
key: z.ZodString;
|
|
29
29
|
description: z.ZodDefault<z.ZodString>;
|
|
30
30
|
question: z.ZodDefault<z.ZodString>;
|
|
31
|
-
field_type: z.ZodUnion<z.ZodLiteral<"text" | "date" | "integer" | "digit_sequence" | "multiple_choice" | "calendar_slot" | "cvv" | "credit_card_number">[]>;
|
|
31
|
+
field_type: z.ZodUnion<z.ZodLiteral<"text" | "date" | "datetime" | "integer" | "digit_sequence" | "multiple_choice" | "calendar_slot" | "cvv" | "credit_card_number">[]>;
|
|
32
32
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
33
33
|
choices: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
34
34
|
is_search_field: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -56,12 +56,31 @@ export declare const AnswerQuestionCommand: z.ZodObject<{
|
|
|
56
56
|
answer: z.ZodString;
|
|
57
57
|
}, z.core.$strict>;
|
|
58
58
|
export type AnswerQuestionCommand = z.input<typeof AnswerQuestionCommand>;
|
|
59
|
+
export declare const SpeedPreset: z.ZodEnum<{
|
|
60
|
+
"x-slow": "x-slow";
|
|
61
|
+
slow: "slow";
|
|
62
|
+
medium: "medium";
|
|
63
|
+
fast: "fast";
|
|
64
|
+
"x-fast": "x-fast";
|
|
65
|
+
}>;
|
|
66
|
+
export type SpeedPreset = z.infer<typeof SpeedPreset>;
|
|
67
|
+
/**
|
|
68
|
+
* @description throw on an unrecognized speech speed preset, with the valid presets listed
|
|
69
|
+
*/
|
|
70
|
+
export declare function validateSpeedPreset(speed: unknown): void;
|
|
59
71
|
export declare const SetPersona: z.ZodObject<{
|
|
60
72
|
command_type: z.ZodLiteral<"set-persona">;
|
|
61
73
|
agent_name: z.ZodOptional<z.ZodString>;
|
|
62
74
|
organization_name: z.ZodOptional<z.ZodString>;
|
|
63
75
|
agent_purpose: z.ZodOptional<z.ZodString>;
|
|
64
76
|
voice: z.ZodOptional<z.ZodString>;
|
|
77
|
+
tts_speed: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
"x-slow": "x-slow";
|
|
79
|
+
slow: "slow";
|
|
80
|
+
medium: "medium";
|
|
81
|
+
fast: "fast";
|
|
82
|
+
"x-fast": "x-fast";
|
|
83
|
+
}>>;
|
|
65
84
|
tts_replacements: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
66
85
|
}, z.core.$strict>;
|
|
67
86
|
export type SetPersona = z.input<typeof SetPersona>;
|
|
@@ -110,6 +129,7 @@ export declare const RegisteredHooksCommand: z.ZodObject<{
|
|
|
110
129
|
has_on_action_requested: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
111
130
|
has_on_escalate: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
112
131
|
accept_dtmf_for_numbers: z.ZodDefault<z.ZodBoolean>;
|
|
132
|
+
has_on_agent_dtmf: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
113
133
|
}, z.core.$strict>;
|
|
114
134
|
export type RegisteredHooksCommand = z.input<typeof RegisteredHooksCommand>;
|
|
115
135
|
export declare const ActionCandidate: z.ZodObject<{
|
|
@@ -192,7 +212,7 @@ export declare const AnyCommand: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
192
212
|
key: z.ZodString;
|
|
193
213
|
description: z.ZodDefault<z.ZodString>;
|
|
194
214
|
question: z.ZodDefault<z.ZodString>;
|
|
195
|
-
field_type: z.ZodUnion<z.ZodLiteral<"text" | "date" | "integer" | "digit_sequence" | "multiple_choice" | "calendar_slot" | "cvv" | "credit_card_number">[]>;
|
|
215
|
+
field_type: z.ZodUnion<z.ZodLiteral<"text" | "date" | "datetime" | "integer" | "digit_sequence" | "multiple_choice" | "calendar_slot" | "cvv" | "credit_card_number">[]>;
|
|
196
216
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
197
217
|
choices: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
198
218
|
is_search_field: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -220,6 +240,13 @@ export declare const AnyCommand: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
220
240
|
organization_name: z.ZodOptional<z.ZodString>;
|
|
221
241
|
agent_purpose: z.ZodOptional<z.ZodString>;
|
|
222
242
|
voice: z.ZodOptional<z.ZodString>;
|
|
243
|
+
tts_speed: z.ZodOptional<z.ZodEnum<{
|
|
244
|
+
"x-slow": "x-slow";
|
|
245
|
+
slow: "slow";
|
|
246
|
+
medium: "medium";
|
|
247
|
+
fast: "fast";
|
|
248
|
+
"x-fast": "x-fast";
|
|
249
|
+
}>>;
|
|
223
250
|
tts_replacements: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
224
251
|
}, z.core.$strict>, z.ZodObject<{
|
|
225
252
|
command_type: z.ZodLiteral<"set-language-mode">;
|
|
@@ -252,6 +279,7 @@ export declare const AnyCommand: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
252
279
|
has_on_action_requested: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
253
280
|
has_on_escalate: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
254
281
|
accept_dtmf_for_numbers: z.ZodDefault<z.ZodBoolean>;
|
|
282
|
+
has_on_agent_dtmf: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
255
283
|
}, z.core.$strict>, z.ZodObject<{
|
|
256
284
|
command_type: z.ZodLiteral<"choice-query-result">;
|
|
257
285
|
field_key: z.ZodString;
|
|
@@ -319,7 +347,7 @@ export declare const InboundTunnelCommand: z.ZodObject<{
|
|
|
319
347
|
key: z.ZodString;
|
|
320
348
|
description: z.ZodDefault<z.ZodString>;
|
|
321
349
|
question: z.ZodDefault<z.ZodString>;
|
|
322
|
-
field_type: z.ZodUnion<z.ZodLiteral<"text" | "date" | "integer" | "digit_sequence" | "multiple_choice" | "calendar_slot" | "cvv" | "credit_card_number">[]>;
|
|
350
|
+
field_type: z.ZodUnion<z.ZodLiteral<"text" | "date" | "datetime" | "integer" | "digit_sequence" | "multiple_choice" | "calendar_slot" | "cvv" | "credit_card_number">[]>;
|
|
323
351
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
324
352
|
choices: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
325
353
|
is_search_field: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -347,6 +375,13 @@ export declare const InboundTunnelCommand: z.ZodObject<{
|
|
|
347
375
|
organization_name: z.ZodOptional<z.ZodString>;
|
|
348
376
|
agent_purpose: z.ZodOptional<z.ZodString>;
|
|
349
377
|
voice: z.ZodOptional<z.ZodString>;
|
|
378
|
+
tts_speed: z.ZodOptional<z.ZodEnum<{
|
|
379
|
+
"x-slow": "x-slow";
|
|
380
|
+
slow: "slow";
|
|
381
|
+
medium: "medium";
|
|
382
|
+
fast: "fast";
|
|
383
|
+
"x-fast": "x-fast";
|
|
384
|
+
}>>;
|
|
350
385
|
tts_replacements: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
351
386
|
}, z.core.$strict>, z.ZodObject<{
|
|
352
387
|
command_type: z.ZodLiteral<"set-language-mode">;
|
|
@@ -379,6 +414,7 @@ export declare const InboundTunnelCommand: z.ZodObject<{
|
|
|
379
414
|
has_on_action_requested: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
380
415
|
has_on_escalate: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
381
416
|
accept_dtmf_for_numbers: z.ZodDefault<z.ZodBoolean>;
|
|
417
|
+
has_on_agent_dtmf: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
382
418
|
}, z.core.$strict>, z.ZodObject<{
|
|
383
419
|
command_type: z.ZodLiteral<"choice-query-result">;
|
|
384
420
|
field_key: z.ZodString;
|
package/dist/src/commands.js
CHANGED
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InboundTunnelCommand = exports.AnyCommand = exports.ExpertErrorCommand = exports.SendAgentDTMFCommand = exports.SetAgentDTMFCommand = exports.RetryTaskCommand = exports.ChoiceResultCommand = exports.ActionSuggestionCommand = exports.ActionCandidate = exports.RegisteredHooksCommand = exports.TransferCommand = exports.SendInstructionCommand = exports.SetLanguageModeCommand = exports.Language = exports.SetPersona = exports.AnswerQuestionCommand = exports.ReadScriptCommand = exports.SetTaskCommand = exports.AcceptInboundCallCommand = exports.RejectInboundCallCommand = exports.ListenInboundCommand = exports.StartOutboundCallCommand = void 0;
|
|
36
|
+
exports.InboundTunnelCommand = exports.AnyCommand = exports.ExpertErrorCommand = exports.SendAgentDTMFCommand = exports.SetAgentDTMFCommand = exports.RetryTaskCommand = exports.ChoiceResultCommand = exports.ActionSuggestionCommand = exports.ActionCandidate = exports.RegisteredHooksCommand = exports.TransferCommand = exports.SendInstructionCommand = exports.SetLanguageModeCommand = exports.Language = exports.SetPersona = exports.SpeedPreset = exports.AnswerQuestionCommand = exports.ReadScriptCommand = exports.SetTaskCommand = exports.AcceptInboundCallCommand = exports.RejectInboundCallCommand = exports.ListenInboundCommand = exports.StartOutboundCallCommand = void 0;
|
|
37
|
+
exports.validateSpeedPreset = validateSpeedPreset;
|
|
37
38
|
const z = __importStar(require("zod"));
|
|
38
39
|
const action_item_ts_1 = require("./action-item.js");
|
|
39
40
|
const events_ts_1 = require("./events.js");
|
|
@@ -73,12 +74,22 @@ exports.AnswerQuestionCommand = z.strictObject({
|
|
|
73
74
|
question_id: z.string(),
|
|
74
75
|
answer: z.string(),
|
|
75
76
|
});
|
|
77
|
+
exports.SpeedPreset = z.enum(["x-slow", "slow", "medium", "fast", "x-fast"]);
|
|
78
|
+
/**
|
|
79
|
+
* @description throw on an unrecognized speech speed preset, with the valid presets listed
|
|
80
|
+
*/
|
|
81
|
+
function validateSpeedPreset(speed) {
|
|
82
|
+
if (speed !== undefined && !exports.SpeedPreset.safeParse(speed).success) {
|
|
83
|
+
throw new Error(`speechSpeed must be one of ${JSON.stringify(exports.SpeedPreset.options)} (got ${JSON.stringify(speed)}).`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
76
86
|
exports.SetPersona = z.strictObject({
|
|
77
87
|
command_type: z.literal("set-persona"),
|
|
78
88
|
agent_name: z.string().optional(),
|
|
79
89
|
organization_name: z.string().optional(),
|
|
80
90
|
agent_purpose: z.string().optional(),
|
|
81
91
|
voice: z.string().optional(),
|
|
92
|
+
tts_speed: exports.SpeedPreset.optional(),
|
|
82
93
|
tts_replacements: z.record(z.string().min(1), z.string()).optional(),
|
|
83
94
|
});
|
|
84
95
|
exports.Language = z.enum(["english", "spanish", "french", "german", "italian"]);
|
|
@@ -104,6 +115,7 @@ exports.RegisteredHooksCommand = z.strictObject({
|
|
|
104
115
|
has_on_action_requested: z.boolean().optional().default(false),
|
|
105
116
|
has_on_escalate: z.boolean().optional().default(false),
|
|
106
117
|
accept_dtmf_for_numbers: z.boolean().default(true),
|
|
118
|
+
has_on_agent_dtmf: z.boolean().optional().default(false),
|
|
107
119
|
});
|
|
108
120
|
exports.ActionCandidate = z.strictObject({
|
|
109
121
|
key: z.string(),
|
package/dist/src/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,kDAMC;AAvED,uCAAyB;AACzB,qDAA8C;AAC9C,2CAA0C;AAE7B,QAAA,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAEzC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE;CACpB,CAAC,CAAC;AAGU,QAAA,oBAAoB,GAAG,CAAC;KAClC,YAAY,CAAC;IACZ,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAEzC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CA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M,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAW,CAAC,CAAC;CACrC,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGU,QAAA,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC;IAChC,gCAAwB;IACxB,4BAAoB;IACpB,gCAAwB;IACxB,gCAAwB;IACxB,sBAAc;IACd,yBAAiB;IACjB,6BAAqB;IACrB,kBAAU;IACV,8BAAsB;IACtB,8BAAsB;IACtB,uBAAe;IACf,8BAAsB;IACtB,2BAAmB;IACnB,+BAAuB;IACvB,wBAAgB;IAChB,2BAAmB;IACnB,4BAAoB;IACpB,0BAAkB;CACnB,CAAC,CAAC;AAGU,QAAA,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,kBAAU;CACpB,CAAC,CAAC"}
|
package/dist/src/events.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare const BotSessionEnded: z.ZodObject<{
|
|
|
82
82
|
voicemail: "voicemail";
|
|
83
83
|
}>;
|
|
84
84
|
dnc: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
+
pickup: z.ZodDefault<z.ZodBoolean>;
|
|
85
86
|
}, z.core.$strip>;
|
|
86
87
|
export type BotSessionEnded = z.infer<typeof BotSessionEnded>;
|
|
87
88
|
/** Why a bot session ended. */
|
|
@@ -129,11 +130,41 @@ export declare const DTMFPressedEvent: z.ZodObject<{
|
|
|
129
130
|
recent_digits: z.ZodDefault<z.ZodString>;
|
|
130
131
|
}, z.core.$strip>;
|
|
131
132
|
export type DTMFPressedEvent = z.infer<typeof DTMFPressedEvent>;
|
|
133
|
+
/**
|
|
134
|
+
* The agent pressed DTMF digits, either on its own after `call.setAgentDtmf(true)`
|
|
135
|
+
* or because the developer called `call.sendDtmf(...)`; `requested_by` says which.
|
|
136
|
+
*/
|
|
137
|
+
export declare const AgentDTMFSentEvent: z.ZodObject<{
|
|
138
|
+
event_type: z.ZodLiteral<"agent-dtmf">;
|
|
139
|
+
digits: z.ZodArray<z.ZodEnum<{
|
|
140
|
+
0: "0";
|
|
141
|
+
1: "1";
|
|
142
|
+
2: "2";
|
|
143
|
+
3: "3";
|
|
144
|
+
4: "4";
|
|
145
|
+
5: "5";
|
|
146
|
+
6: "6";
|
|
147
|
+
7: "7";
|
|
148
|
+
8: "8";
|
|
149
|
+
9: "9";
|
|
150
|
+
"*": "*";
|
|
151
|
+
"#": "#";
|
|
152
|
+
A: "A";
|
|
153
|
+
B: "B";
|
|
154
|
+
C: "C";
|
|
155
|
+
D: "D";
|
|
156
|
+
}>>;
|
|
157
|
+
requested_by: z.ZodDefault<z.ZodEnum<{
|
|
158
|
+
agent: "agent";
|
|
159
|
+
developer: "developer";
|
|
160
|
+
}>>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
export type AgentDTMFSentEvent = z.infer<typeof AgentDTMFSentEvent>;
|
|
132
163
|
export declare const EscalateEvent: z.ZodObject<{
|
|
133
164
|
event_type: z.ZodLiteral<"escalate">;
|
|
134
165
|
requested_by: z.ZodDefault<z.ZodEnum<{
|
|
135
|
-
human: "human";
|
|
136
166
|
agent: "agent";
|
|
167
|
+
human: "human";
|
|
137
168
|
}>>;
|
|
138
169
|
}, z.core.$strip>;
|
|
139
170
|
export type EscalateEvent = z.infer<typeof EscalateEvent>;
|
|
@@ -189,6 +220,7 @@ export declare const GuavaEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
189
220
|
voicemail: "voicemail";
|
|
190
221
|
}>;
|
|
191
222
|
dnc: z.ZodDefault<z.ZodBoolean>;
|
|
223
|
+
pickup: z.ZodDefault<z.ZodBoolean>;
|
|
192
224
|
}, z.core.$strip>, z.ZodObject<{
|
|
193
225
|
event_type: z.ZodLiteral<"choice-query">;
|
|
194
226
|
field_key: z.ZodString;
|
|
@@ -204,8 +236,8 @@ export declare const GuavaEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
204
236
|
}, z.core.$strip>, z.ZodObject<{
|
|
205
237
|
event_type: z.ZodLiteral<"escalate">;
|
|
206
238
|
requested_by: z.ZodDefault<z.ZodEnum<{
|
|
207
|
-
human: "human";
|
|
208
239
|
agent: "agent";
|
|
240
|
+
human: "human";
|
|
209
241
|
}>>;
|
|
210
242
|
}, z.core.$strip>, z.ZodObject<{
|
|
211
243
|
event_type: z.ZodLiteral<"dtmf">;
|
|
@@ -228,6 +260,30 @@ export declare const GuavaEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
228
260
|
D: "D";
|
|
229
261
|
}>;
|
|
230
262
|
recent_digits: z.ZodDefault<z.ZodString>;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
event_type: z.ZodLiteral<"agent-dtmf">;
|
|
265
|
+
digits: z.ZodArray<z.ZodEnum<{
|
|
266
|
+
0: "0";
|
|
267
|
+
1: "1";
|
|
268
|
+
2: "2";
|
|
269
|
+
3: "3";
|
|
270
|
+
4: "4";
|
|
271
|
+
5: "5";
|
|
272
|
+
6: "6";
|
|
273
|
+
7: "7";
|
|
274
|
+
8: "8";
|
|
275
|
+
9: "9";
|
|
276
|
+
"*": "*";
|
|
277
|
+
"#": "#";
|
|
278
|
+
A: "A";
|
|
279
|
+
B: "B";
|
|
280
|
+
C: "C";
|
|
281
|
+
D: "D";
|
|
282
|
+
}>>;
|
|
283
|
+
requested_by: z.ZodDefault<z.ZodEnum<{
|
|
284
|
+
agent: "agent";
|
|
285
|
+
developer: "developer";
|
|
286
|
+
}>>;
|
|
231
287
|
}, z.core.$strip>], "event_type">;
|
|
232
288
|
export type GuavaEvent = z.infer<typeof GuavaEvent>;
|
|
233
289
|
export declare function decodeEventDict(data: Record<string, unknown>): GuavaEvent | null;
|
|
@@ -286,6 +342,7 @@ export declare const InboundTunnelEvent: z.ZodObject<{
|
|
|
286
342
|
voicemail: "voicemail";
|
|
287
343
|
}>;
|
|
288
344
|
dnc: z.ZodDefault<z.ZodBoolean>;
|
|
345
|
+
pickup: z.ZodDefault<z.ZodBoolean>;
|
|
289
346
|
}, z.core.$strip>, z.ZodObject<{
|
|
290
347
|
event_type: z.ZodLiteral<"choice-query">;
|
|
291
348
|
field_key: z.ZodString;
|
|
@@ -301,8 +358,8 @@ export declare const InboundTunnelEvent: z.ZodObject<{
|
|
|
301
358
|
}, z.core.$strip>, z.ZodObject<{
|
|
302
359
|
event_type: z.ZodLiteral<"escalate">;
|
|
303
360
|
requested_by: z.ZodDefault<z.ZodEnum<{
|
|
304
|
-
human: "human";
|
|
305
361
|
agent: "agent";
|
|
362
|
+
human: "human";
|
|
306
363
|
}>>;
|
|
307
364
|
}, z.core.$strip>, z.ZodObject<{
|
|
308
365
|
event_type: z.ZodLiteral<"dtmf">;
|
|
@@ -325,6 +382,30 @@ export declare const InboundTunnelEvent: z.ZodObject<{
|
|
|
325
382
|
D: "D";
|
|
326
383
|
}>;
|
|
327
384
|
recent_digits: z.ZodDefault<z.ZodString>;
|
|
385
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
386
|
+
event_type: z.ZodLiteral<"agent-dtmf">;
|
|
387
|
+
digits: z.ZodArray<z.ZodEnum<{
|
|
388
|
+
0: "0";
|
|
389
|
+
1: "1";
|
|
390
|
+
2: "2";
|
|
391
|
+
3: "3";
|
|
392
|
+
4: "4";
|
|
393
|
+
5: "5";
|
|
394
|
+
6: "6";
|
|
395
|
+
7: "7";
|
|
396
|
+
8: "8";
|
|
397
|
+
9: "9";
|
|
398
|
+
"*": "*";
|
|
399
|
+
"#": "#";
|
|
400
|
+
A: "A";
|
|
401
|
+
B: "B";
|
|
402
|
+
C: "C";
|
|
403
|
+
D: "D";
|
|
404
|
+
}>>;
|
|
405
|
+
requested_by: z.ZodDefault<z.ZodEnum<{
|
|
406
|
+
agent: "agent";
|
|
407
|
+
developer: "developer";
|
|
408
|
+
}>>;
|
|
328
409
|
}, z.core.$strip>], "event_type">;
|
|
329
410
|
}, z.core.$strip>;
|
|
330
411
|
export type InboundTunnelEvent = z.infer<typeof InboundTunnelEvent>;
|
package/dist/src/events.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InboundTunnelEvent = exports.GuavaEvent = exports.EscalateEvent = exports.DTMFPressedEvent = exports.DTMF_DIGITS = exports.ExecuteActionEvent = exports.ActionRequestEvent = exports.ChoiceQueryEvent = exports.BotSessionEnded = exports.OutboundCallFailed = exports.OutboundCallConnected = exports.TaskCompletedEvent = exports.ActionItemCompletedEvent = exports.IntentEvent = exports.AgentQuestionEvent = exports.WarningEvent = exports.ErrorEvent = exports.AgentSpeechEvent = exports.CallerSpeechEvent = exports.InboundCallEvent = exports.SessionStartedEvent = void 0;
|
|
36
|
+
exports.InboundTunnelEvent = exports.GuavaEvent = exports.EscalateEvent = exports.AgentDTMFSentEvent = exports.DTMFPressedEvent = exports.DTMF_DIGITS = exports.ExecuteActionEvent = exports.ActionRequestEvent = exports.ChoiceQueryEvent = exports.BotSessionEnded = exports.OutboundCallFailed = exports.OutboundCallConnected = exports.TaskCompletedEvent = exports.ActionItemCompletedEvent = exports.IntentEvent = exports.AgentQuestionEvent = exports.WarningEvent = exports.ErrorEvent = exports.AgentSpeechEvent = exports.CallerSpeechEvent = exports.InboundCallEvent = exports.SessionStartedEvent = void 0;
|
|
37
37
|
exports.decodeEventDict = decodeEventDict;
|
|
38
38
|
exports.decodeEvent = decodeEvent;
|
|
39
39
|
const z = __importStar(require("zod"));
|
|
@@ -108,6 +108,7 @@ exports.BotSessionEnded = z.object({
|
|
|
108
108
|
"voicemail",
|
|
109
109
|
]),
|
|
110
110
|
dnc: z.boolean().default(false),
|
|
111
|
+
pickup: z.boolean().default(true),
|
|
111
112
|
});
|
|
112
113
|
exports.ChoiceQueryEvent = z.object({
|
|
113
114
|
event_type: z.literal("choice-query"),
|
|
@@ -147,6 +148,15 @@ exports.DTMFPressedEvent = z.object({
|
|
|
147
148
|
digit: z.enum(exports.DTMF_DIGITS),
|
|
148
149
|
recent_digits: z.string().default(""),
|
|
149
150
|
});
|
|
151
|
+
/**
|
|
152
|
+
* The agent pressed DTMF digits, either on its own after `call.setAgentDtmf(true)`
|
|
153
|
+
* or because the developer called `call.sendDtmf(...)`; `requested_by` says which.
|
|
154
|
+
*/
|
|
155
|
+
exports.AgentDTMFSentEvent = z.object({
|
|
156
|
+
event_type: z.literal("agent-dtmf"),
|
|
157
|
+
digits: z.array(z.enum(exports.DTMF_DIGITS)),
|
|
158
|
+
requested_by: z.enum(["agent", "developer"]).default("agent"),
|
|
159
|
+
});
|
|
150
160
|
exports.EscalateEvent = z.object({
|
|
151
161
|
event_type: z.literal("escalate"),
|
|
152
162
|
requested_by: z.enum(["human", "agent"]).default("human"),
|
|
@@ -170,6 +180,7 @@ exports.GuavaEvent = z.discriminatedUnion("event_type", [
|
|
|
170
180
|
exports.ExecuteActionEvent,
|
|
171
181
|
exports.EscalateEvent,
|
|
172
182
|
exports.DTMFPressedEvent,
|
|
183
|
+
exports.AgentDTMFSentEvent,
|
|
173
184
|
]);
|
|
174
185
|
const _KNOWN_EVENT_TYPES = new Set(exports.GuavaEvent.options.map((schema) => schema.shape.event_type.value));
|
|
175
186
|
function decodeEventDict(data) {
|
package/dist/src/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";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AC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAEY,QAAA,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,kBAAU;CAClB,CAAC,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { Logger, getConsoleLogger, getDefaultLogger } from "./logging.ts";
|
|
|
8
8
|
export { Agent, CallInfo } from "./agent.ts";
|
|
9
9
|
export { Call, DEFAULT_REACH_PERSON_OUTCOMES } from "./call.ts";
|
|
10
10
|
export type { ReachPersonOutcome } from "./call.ts";
|
|
11
|
-
export type {
|
|
11
|
+
export type { SpeedPreset, Language } from "./commands.ts";
|
|
12
|
+
export type { BotSessionEnded, TerminationReason, DTMFPressedEvent, AgentDTMFSentEvent, DTMFDigit, OutboundCallFailed, } from "./events.ts";
|
|
12
13
|
export { TestSession } from "./testing/session.ts";
|
|
13
14
|
export { MockCall } from "./testing/mocks.ts";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA6D;AAApD,mGAAA,MAAM,OAAA;AACf,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AAEf,+CAA0C;AAAjC,wGAAA,QAAQ,OAAA;AAQjB,mDAA8C;AAArC,qGAAA,GAAG,OAAA;AAAE,uGAAA,KAAK,OAAA;AACnB,2CAA0E;AAAzD,8GAAA,gBAAgB,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACnD,uCAA6C;AAApC,iGAAA,KAAK,OAAA;AACd,qCAAgE;AAAvD,+FAAA,IAAI,OAAA;AAAE,wHAAA,6BAA6B,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA6D;AAApD,mGAAA,MAAM,OAAA;AACf,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AAEf,+CAA0C;AAAjC,wGAAA,QAAQ,OAAA;AAQjB,mDAA8C;AAArC,qGAAA,GAAG,OAAA;AAAE,uGAAA,KAAK,OAAA;AACnB,2CAA0E;AAAzD,8GAAA,gBAAgB,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACnD,uCAA6C;AAApC,iGAAA,KAAK,OAAA;AACd,qCAAgE;AAAvD,+FAAA,IAAI,OAAA;AAAE,wHAAA,6BAA6B,OAAA;AAW5C,mDAAmD;AAA1C,yGAAA,WAAW,OAAA;AACpB,+CAA8C;AAArC,oGAAA,QAAQ,OAAA"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.35.0";
|
package/dist/src/version.js
CHANGED
package/examples/README.md
CHANGED
|
@@ -7,3 +7,4 @@
|
|
|
7
7
|
- [property-insurance.ts](./property-insurance.ts) - Inbound call agent for a property insurance company that uses `DocumentQA` to answer policy questions from a knowledge base.
|
|
8
8
|
- [restaurant-waitlist.ts](./restaurant-waitlist.ts) - Inbound call agent for a restaurant that collects caller name, party size, and phone number to add callers to a waitlist using a structured task.
|
|
9
9
|
- [scheduling-outbound.ts](./scheduling-outbound.ts) - Outbound call agent for a dental office that uses `reachPerson` to confirm contact availability, then schedules appointments using a searchable calendar-slot field backed by `DatetimeFilter`.
|
|
10
|
+
- [slow-speech.ts](./slow-speech.ts) - Minimal inbound agent that sets `speechSpeed` so the agent speaks at a slower pace, with a simple `onQuestion` handler.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This example runs an agent at a slower speech speed.
|
|
3
|
+
*
|
|
4
|
+
* `speechSpeed` sets how quickly the agent speaks via a named preset: "x-slow",
|
|
5
|
+
* "slow", "medium" (normal), "fast", or "x-fast". Here the agent runs at the
|
|
6
|
+
* "slow" preset so speech is easier to follow.
|
|
7
|
+
*
|
|
8
|
+
* Usage: guava-example slow-speech local
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import * as guava from "@guava-ai/guava-sdk";
|
|
12
|
+
import { getAgentNumber } from "@guava-ai/guava-sdk/example-utils";
|
|
13
|
+
|
|
14
|
+
export const agent = new guava.Agent({
|
|
15
|
+
name: "Nova",
|
|
16
|
+
organization: "Clearfield Home & Living",
|
|
17
|
+
purpose: "Answer caller questions clearly and at a relaxed pace.",
|
|
18
|
+
speechSpeed: "slow",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
agent.onQuestion(async (_call: guava.Call, _question: string) => {
|
|
22
|
+
return "Thanks for asking! Let me look into that for you.";
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export async function run(prog: string, args: string[]) {
|
|
26
|
+
const program = new Command().name(prog).showHelpAfterError();
|
|
27
|
+
|
|
28
|
+
// Every Agent can be attached to one of many different channels.
|
|
29
|
+
program
|
|
30
|
+
.command("phone [number]")
|
|
31
|
+
.description("Listen for phone calls.")
|
|
32
|
+
.action(async (number?: string) => {
|
|
33
|
+
await agent.listenPhone(number ?? (await getAgentNumber()));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
program
|
|
37
|
+
.command("webrtc [code]")
|
|
38
|
+
.description("Listen on a WebRTC code.")
|
|
39
|
+
.action(async (code?: string) => {
|
|
40
|
+
await agent.listenWebrtc(code);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
program
|
|
44
|
+
.command("sip <code>")
|
|
45
|
+
.description("Listen on a SIP code 'guavasip-...'.")
|
|
46
|
+
.action(async (code: string) => {
|
|
47
|
+
await agent.listenSip(code);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
program
|
|
51
|
+
.command("local")
|
|
52
|
+
.description("Start a local call.")
|
|
53
|
+
.action(async () => {
|
|
54
|
+
await agent.callLocal();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
program
|
|
58
|
+
.command("chat")
|
|
59
|
+
.description("Start an interactive terminal chat.")
|
|
60
|
+
.action(async () => {
|
|
61
|
+
await agent.chat();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
await program.parseAsync(args, { from: "user" });
|
|
65
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@guava-ai/guava-sdk",
|
|
3
3
|
"description": "The official TypeScript SDK for building Guava voice agents.",
|
|
4
4
|
"homepage": "https://docs.goguava.ai/typescript-sdk/",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.35.0",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"types": "dist/src/index.d.ts",
|