wixzel-voice-mcp 0.4.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/CHANGELOG.md +57 -0
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/client.d.ts +69 -0
- package/dist/client.js +137 -0
- package/dist/client.js.map +1 -0
- package/dist/guide.d.ts +11 -0
- package/dist/guide.js +86 -0
- package/dist/guide.js.map +1 -0
- package/dist/http.d.ts +80 -0
- package/dist/http.js +281 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +7 -0
- package/dist/prompts.js +83 -0
- package/dist/prompts.js.map +1 -0
- package/dist/schemas.d.ts +105 -0
- package/dist/schemas.js +122 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +16 -0
- package/dist/server.js +58 -0
- package/dist/server.js.map +1 -0
- package/dist/site.d.ts +12 -0
- package/dist/site.js +17 -0
- package/dist/site.js.map +1 -0
- package/dist/tooling.d.ts +59 -0
- package/dist/tooling.js +129 -0
- package/dist/tooling.js.map +1 -0
- package/dist/tools/agents.d.ts +97 -0
- package/dist/tools/agents.js +105 -0
- package/dist/tools/agents.js.map +1 -0
- package/dist/tools/api-keys.d.ts +37 -0
- package/dist/tools/api-keys.js +61 -0
- package/dist/tools/api-keys.js.map +1 -0
- package/dist/tools/appointments.d.ts +30 -0
- package/dist/tools/appointments.js +77 -0
- package/dist/tools/appointments.js.map +1 -0
- package/dist/tools/billing.d.ts +29 -0
- package/dist/tools/billing.js +72 -0
- package/dist/tools/billing.js.map +1 -0
- package/dist/tools/calls.d.ts +37 -0
- package/dist/tools/calls.js +98 -0
- package/dist/tools/calls.js.map +1 -0
- package/dist/tools/campaigns.d.ts +13 -0
- package/dist/tools/campaigns.js +76 -0
- package/dist/tools/campaigns.js.map +1 -0
- package/dist/tools/engines.d.ts +4 -0
- package/dist/tools/engines.js +43 -0
- package/dist/tools/engines.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +37 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/knowledge-bases.d.ts +27 -0
- package/dist/tools/knowledge-bases.js +69 -0
- package/dist/tools/knowledge-bases.js.map +1 -0
- package/dist/tools/leads.d.ts +28 -0
- package/dist/tools/leads.js +88 -0
- package/dist/tools/leads.js.map +1 -0
- package/dist/tools/phone-numbers.d.ts +19 -0
- package/dist/tools/phone-numbers.js +72 -0
- package/dist/tools/phone-numbers.js.map +1 -0
- package/dist/tools/realtime.d.ts +8 -0
- package/dist/tools/realtime.js +28 -0
- package/dist/tools/realtime.js.map +1 -0
- package/dist/tools/sip-trunks.d.ts +45 -0
- package/dist/tools/sip-trunks.js +118 -0
- package/dist/tools/sip-trunks.js.map +1 -0
- package/dist/tools/webhooks.d.ts +52 -0
- package/dist/tools/webhooks.js +90 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.js +8 -0
- package/dist/version.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/tools/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAElF,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IACxF,aAAa,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,6GAA6G,CAA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ptional<z.ZodNumber>;
|
|
4
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
5
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}> | import("../tooling.js").ToolDef<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
9
|
+
"agents:read": "agents:read";
|
|
10
|
+
"agents:write": "agents:write";
|
|
11
|
+
"calls:read": "calls:read";
|
|
12
|
+
"calls:write": "calls:write";
|
|
13
|
+
"leads:read": "leads:read";
|
|
14
|
+
"leads:write": "leads:write";
|
|
15
|
+
"campaigns:read": "campaigns:read";
|
|
16
|
+
"campaigns:write": "campaigns:write";
|
|
17
|
+
"knowledge_bases:read": "knowledge_bases:read";
|
|
18
|
+
"knowledge_bases:write": "knowledge_bases:write";
|
|
19
|
+
"phone_numbers:read": "phone_numbers:read";
|
|
20
|
+
"phone_numbers:write": "phone_numbers:write";
|
|
21
|
+
"sip_trunks:read": "sip_trunks:read";
|
|
22
|
+
"sip_trunks:write": "sip_trunks:write";
|
|
23
|
+
"appointments:read": "appointments:read";
|
|
24
|
+
"appointments:write": "appointments:write";
|
|
25
|
+
"webhooks:read": "webhooks:read";
|
|
26
|
+
"webhooks:write": "webhooks:write";
|
|
27
|
+
"api_keys:read": "api_keys:read";
|
|
28
|
+
"api_keys:write": "api_keys:write";
|
|
29
|
+
"usage:read": "usage:read";
|
|
30
|
+
"billing:read": "billing:read";
|
|
31
|
+
"billing:write": "billing:write";
|
|
32
|
+
}>>;
|
|
33
|
+
spend_limit_micros: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}> | import("../tooling.js").ToolDef<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
}>)[];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { annotate, compact, defineTool } from '../tooling.js';
|
|
3
|
+
import { id, isoDate, pagination, scope } from '../schemas.js';
|
|
4
|
+
export const apiKeyTools = [
|
|
5
|
+
defineTool({
|
|
6
|
+
name: 'list_api_keys',
|
|
7
|
+
endpoint: 'GET /v1/api-keys',
|
|
8
|
+
title: 'List API keys',
|
|
9
|
+
description: 'List the account\'s API keys with their scopes, spend limits and last use. Secrets are never returned, only a prefix and last four characters.',
|
|
10
|
+
input: { ...pagination },
|
|
11
|
+
annotations: annotate.read,
|
|
12
|
+
scope: 'api_keys:read',
|
|
13
|
+
handler: (client, args) => client.get('/v1/api-keys', args),
|
|
14
|
+
}),
|
|
15
|
+
defineTool({
|
|
16
|
+
name: 'create_api_key',
|
|
17
|
+
endpoint: 'POST /v1/api-keys',
|
|
18
|
+
title: 'Create an API key',
|
|
19
|
+
description: 'Mint a new scoped key. The secret is returned ONCE in the result and cannot be retrieved again: hand it to the user immediately and do not log it elsewhere. ' +
|
|
20
|
+
'A key cannot grant scopes the calling key does not hold (scope_escalation). Grant only what the integration needs; billing:write authorises spending money.',
|
|
21
|
+
input: {
|
|
22
|
+
name: z.string().min(1).describe('For the user\'s reference, e.g. "production backend".'),
|
|
23
|
+
scopes: z.array(scope).min(1).describe('No wildcard; agents:write does not imply agents:read.'),
|
|
24
|
+
spend_limit_micros: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.positive()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Guardrail in micro-USD, enforced within about a minute. Not a hard cap.'),
|
|
30
|
+
expires_at: isoDate.optional(),
|
|
31
|
+
},
|
|
32
|
+
annotations: annotate.write,
|
|
33
|
+
scope: 'api_keys:write',
|
|
34
|
+
handler: (client, args) => client.post('/v1/api-keys', compact(args)),
|
|
35
|
+
}),
|
|
36
|
+
defineTool({
|
|
37
|
+
name: 'rotate_api_key',
|
|
38
|
+
endpoint: 'POST /v1/api-keys/{id}/rotate',
|
|
39
|
+
title: 'Rotate an API key',
|
|
40
|
+
description: 'Issue a replacement secret. The old key keeps working for 24 hours so a deploy can roll over without a gap. ' +
|
|
41
|
+
'The new secret is returned once; hand it to the user immediately.',
|
|
42
|
+
input: { id },
|
|
43
|
+
annotations: annotate.write,
|
|
44
|
+
scope: 'api_keys:write',
|
|
45
|
+
handler: (client, { id }) => client.post(`/v1/api-keys/${encodeURIComponent(id)}/rotate`),
|
|
46
|
+
}),
|
|
47
|
+
defineTool({
|
|
48
|
+
name: 'revoke_api_key',
|
|
49
|
+
endpoint: 'DELETE /v1/api-keys/{id}',
|
|
50
|
+
title: 'Revoke an API key',
|
|
51
|
+
description: 'Revoke immediately, with no grace period. Anything still using it starts failing at once, including this MCP server if it is the key in use. Not reversible.',
|
|
52
|
+
input: { id },
|
|
53
|
+
annotations: annotate.destructive,
|
|
54
|
+
scope: 'api_keys:write',
|
|
55
|
+
handler: async (client, { id }) => {
|
|
56
|
+
await client.delete(`/v1/api-keys/${encodeURIComponent(id)}`);
|
|
57
|
+
return { revoked: true, id };
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=api-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../src/tools/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,UAAU,CAAC;QACP,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,gJAAgJ;QAC7J,KAAK,EAAE,EAAE,GAAG,UAAU,EAAE;QACxB,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,KAAK,EAAE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gBAAgB,kBAAkB,CAAC,EAAE,CAAC,SAAS,CAAC;KAC5F,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,0BAA0B;QACpC,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACP,8JAA8J;QAClK,KAAK,EAAE,EAAE,EAAE,EAAE;QACb,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE,gBAAgB;QACvB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YAC9B,MAAM,MAAM,CAAC,MAAM,CAAC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const appointmentTools: (import("../tooling.js").ToolDef<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
5
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}> | import("../tooling.js").ToolDef<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
}> | import("../tooling.js").ToolDef<{
|
|
9
|
+
phone_number: z.ZodString;
|
|
10
|
+
date_time: z.ZodString;
|
|
11
|
+
agent_id: z.ZodString;
|
|
12
|
+
lead_id: z.ZodString;
|
|
13
|
+
client_name: z.ZodOptional<z.ZodString>;
|
|
14
|
+
duration_minutes: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}> | import("../tooling.js").ToolDef<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
phone_number: z.ZodOptional<z.ZodString>;
|
|
19
|
+
date_time: z.ZodOptional<z.ZodString>;
|
|
20
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
21
|
+
lead_id: z.ZodOptional<z.ZodString>;
|
|
22
|
+
client_name: z.ZodOptional<z.ZodString>;
|
|
23
|
+
duration_minutes: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
25
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
scheduled: "scheduled";
|
|
27
|
+
completed: "completed";
|
|
28
|
+
canceled: "canceled";
|
|
29
|
+
}>>;
|
|
30
|
+
}>)[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { annotate, compact, defineTool } from '../tooling.js';
|
|
3
|
+
import { e164, id, isoDate, pagination } from '../schemas.js';
|
|
4
|
+
export const appointmentTools = [
|
|
5
|
+
defineTool({
|
|
6
|
+
name: 'list_appointments',
|
|
7
|
+
endpoint: 'GET /v1/appointments',
|
|
8
|
+
title: 'List appointments',
|
|
9
|
+
description: 'List appointments booked by agents or created directly, with status scheduled, completed or canceled.',
|
|
10
|
+
input: { ...pagination },
|
|
11
|
+
annotations: annotate.read,
|
|
12
|
+
scope: 'appointments:read',
|
|
13
|
+
handler: (client, args) => client.get('/v1/appointments', args),
|
|
14
|
+
}),
|
|
15
|
+
defineTool({
|
|
16
|
+
name: 'get_appointment',
|
|
17
|
+
endpoint: 'GET /v1/appointments/{id}',
|
|
18
|
+
title: 'Retrieve an appointment',
|
|
19
|
+
description: 'Fetch one appointment by id.',
|
|
20
|
+
input: { id },
|
|
21
|
+
annotations: annotate.read,
|
|
22
|
+
scope: 'appointments:read',
|
|
23
|
+
handler: (client, { id }) => client.get(`/v1/appointments/${encodeURIComponent(id)}`),
|
|
24
|
+
}),
|
|
25
|
+
defineTool({
|
|
26
|
+
name: 'create_appointment',
|
|
27
|
+
endpoint: 'POST /v1/appointments',
|
|
28
|
+
title: 'Create an appointment',
|
|
29
|
+
description: 'Book an appointment against a lead and agent.',
|
|
30
|
+
input: {
|
|
31
|
+
phone_number: e164,
|
|
32
|
+
date_time: isoDate.describe('Start time, ISO 8601 UTC.'),
|
|
33
|
+
agent_id: z.string(),
|
|
34
|
+
lead_id: z.string(),
|
|
35
|
+
client_name: z.string().optional(),
|
|
36
|
+
duration_minutes: z.number().int().min(1).optional(),
|
|
37
|
+
notes: z.string().optional(),
|
|
38
|
+
},
|
|
39
|
+
annotations: annotate.write,
|
|
40
|
+
scope: 'appointments:write',
|
|
41
|
+
handler: (client, args) => client.post('/v1/appointments', compact(args)),
|
|
42
|
+
}),
|
|
43
|
+
defineTool({
|
|
44
|
+
name: 'update_appointment',
|
|
45
|
+
endpoint: 'PATCH /v1/appointments/{id}',
|
|
46
|
+
title: 'Update an appointment',
|
|
47
|
+
description: 'Reschedule or annotate an appointment. Only the fields you send are changed.',
|
|
48
|
+
input: {
|
|
49
|
+
id,
|
|
50
|
+
phone_number: e164.optional(),
|
|
51
|
+
date_time: isoDate.optional(),
|
|
52
|
+
agent_id: z.string().optional(),
|
|
53
|
+
lead_id: z.string().optional(),
|
|
54
|
+
client_name: z.string().optional(),
|
|
55
|
+
duration_minutes: z.number().int().min(1).optional(),
|
|
56
|
+
notes: z.string().optional(),
|
|
57
|
+
status: z.enum(['scheduled', 'completed', 'canceled']).optional(),
|
|
58
|
+
},
|
|
59
|
+
annotations: annotate.write,
|
|
60
|
+
scope: 'appointments:write',
|
|
61
|
+
handler: (client, { id, ...rest }) => client.patch(`/v1/appointments/${encodeURIComponent(id)}`, compact(rest)),
|
|
62
|
+
}),
|
|
63
|
+
defineTool({
|
|
64
|
+
name: 'delete_appointment',
|
|
65
|
+
endpoint: 'DELETE /v1/appointments/{id}',
|
|
66
|
+
title: 'Delete an appointment',
|
|
67
|
+
description: 'Permanently delete an appointment. To cancel but keep the record, update its status to canceled instead. Not reversible.',
|
|
68
|
+
input: { id },
|
|
69
|
+
annotations: annotate.destructive,
|
|
70
|
+
scope: 'appointments:write',
|
|
71
|
+
handler: async (client, { id }) => {
|
|
72
|
+
await client.delete(`/v1/appointments/${encodeURIComponent(id)}`);
|
|
73
|
+
return { deleted: true, id };
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
];
|
|
77
|
+
//# sourceMappingURL=appointments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appointments.js","sourceRoot":"","sources":["../../src/tools/appointments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,UAAU,CAAC;QACP,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,sBAAsB;QAChC,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,uGAAuG;QACpH,KAAK,EAAE,EAAE,GAAG,UAAU,EAAE;QACxB,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,KAAK,EAAE,mBAAmB;QAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,IAAI,CAAC;KAClE,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,2BAA2B;QACrC,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,8BAA8B;QAC3C,KAAK,EAAE,EAAE,EAAE,EAAE;QACb,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,KAAK,EAAE,mBAAmB;QAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,kBAAkB,CAAC,EAAE,CAAC,EA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CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;YACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC5B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;SACpE;QACD,WAAW,EAAE,QAAQ,CAAC,KAAK;QAC3B,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CACjC,MAAM,CAAC,KAAK,CAAC,oBAAoB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;KAChF,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,8BAA8B;QACxC,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,0HAA0H;QACvI,KAAK,EAAE,EAAE,EAAE,EAAE;QACb,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YAC9B,MAAM,MAAM,CAAC,MAAM,CAAC,oBAAoB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const billingTools: (import("../tooling.js").ToolDef<{}> | import("../tooling.js").ToolDef<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
5
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}> | import("../tooling.js").ToolDef<{
|
|
7
|
+
amount_usd: z.ZodNumber;
|
|
8
|
+
return_url: z.ZodOptional<z.ZodString>;
|
|
9
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}> | import("../tooling.js").ToolDef<{
|
|
11
|
+
start: z.ZodOptional<z.ZodString>;
|
|
12
|
+
end: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}> | import("../tooling.js").ToolDef<{
|
|
14
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
component: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
stt: "stt";
|
|
17
|
+
llm: "llm";
|
|
18
|
+
tts: "tts";
|
|
19
|
+
realtime: "realtime";
|
|
20
|
+
telephony: "telephony";
|
|
21
|
+
platform_fee: "platform_fee";
|
|
22
|
+
platform_api: "platform_api";
|
|
23
|
+
}>>;
|
|
24
|
+
start: z.ZodOptional<z.ZodString>;
|
|
25
|
+
end: z.ZodOptional<z.ZodString>;
|
|
26
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
28
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}>)[];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { annotate, compact, defineTool } from '../tooling.js';
|
|
3
|
+
import { idempotencyKey, isoDate, pagination } from '../schemas.js';
|
|
4
|
+
const component = z.enum(['stt', 'llm', 'tts', 'realtime', 'telephony', 'platform_fee', 'platform_api']);
|
|
5
|
+
export const billingTools = [
|
|
6
|
+
defineTool({
|
|
7
|
+
name: 'get_balance',
|
|
8
|
+
endpoint: 'GET /v1/billing/balance',
|
|
9
|
+
title: 'Retrieve the balance',
|
|
10
|
+
description: 'The account\'s prepaid credit: balance_micros, held_micros (reserved by live calls) and available_micros. Micro-USD: 1,000,000 = $1.00. ' +
|
|
11
|
+
'Check this before placing calls or starting campaigns.',
|
|
12
|
+
input: {},
|
|
13
|
+
annotations: annotate.read,
|
|
14
|
+
scope: 'billing:read',
|
|
15
|
+
handler: (client) => client.get('/v1/billing/balance'),
|
|
16
|
+
}),
|
|
17
|
+
defineTool({
|
|
18
|
+
name: 'list_ledger_entries',
|
|
19
|
+
endpoint: 'GET /v1/billing/ledger',
|
|
20
|
+
title: 'List ledger entries',
|
|
21
|
+
description: 'Every movement on the account (topup, usage, refund, adjustment, promo, overage, chargeback), with balance_after_micros. Balances reconcile exactly.',
|
|
22
|
+
input: { ...pagination },
|
|
23
|
+
annotations: annotate.read,
|
|
24
|
+
scope: 'billing:read',
|
|
25
|
+
handler: (client, args) => client.get('/v1/billing/ledger', args),
|
|
26
|
+
}),
|
|
27
|
+
defineTool({
|
|
28
|
+
name: 'create_topup',
|
|
29
|
+
endpoint: 'POST /v1/billing/topups',
|
|
30
|
+
title: 'Add credit',
|
|
31
|
+
description: 'Start a top-up. Returns a checkout_url that a HUMAN must open to pay; credit lands once payment settles, not when this returns. ' +
|
|
32
|
+
'Never open the URL or attempt payment yourself. Confirm the amount with the user first.',
|
|
33
|
+
input: {
|
|
34
|
+
amount_usd: z.number().positive().describe('Amount to add, in US dollars.'),
|
|
35
|
+
return_url: z.string().url().optional().describe('Where to send the customer after checkout.'),
|
|
36
|
+
idempotency_key: idempotencyKey,
|
|
37
|
+
},
|
|
38
|
+
annotations: annotate.spend,
|
|
39
|
+
scope: 'billing:write',
|
|
40
|
+
handler: (client, { idempotency_key, ...body }) => client.post('/v1/billing/topups', compact(body), { idempotencyKey: idempotency_key, idempotent: true }),
|
|
41
|
+
}),
|
|
42
|
+
defineTool({
|
|
43
|
+
name: 'get_usage_summary',
|
|
44
|
+
endpoint: 'GET /v1/usage/summary',
|
|
45
|
+
title: 'Summarise usage',
|
|
46
|
+
description: 'Total spend over a period, broken down by component, provider and model. total_micros is micro-USD; total_display is human-readable.',
|
|
47
|
+
input: {
|
|
48
|
+
start: isoDate.optional().describe('Period start. Defaults to the start of the current month.'),
|
|
49
|
+
end: isoDate.optional().describe('Period end. Defaults to now.'),
|
|
50
|
+
},
|
|
51
|
+
annotations: annotate.read,
|
|
52
|
+
scope: 'usage:read',
|
|
53
|
+
handler: (client, args) => client.get('/v1/usage/summary', args),
|
|
54
|
+
}),
|
|
55
|
+
defineTool({
|
|
56
|
+
name: 'list_usage_events',
|
|
57
|
+
endpoint: 'GET /v1/usage/events',
|
|
58
|
+
title: 'List usage events',
|
|
59
|
+
description: 'Every billable line, itemised. Filter by session_id (from a call record) to see exactly what one call cost and why: the sum of a call\'s events equals what was debited.',
|
|
60
|
+
input: {
|
|
61
|
+
...pagination,
|
|
62
|
+
session_id: z.string().optional().describe('The call\'s session_id (not its id).'),
|
|
63
|
+
component: component.optional(),
|
|
64
|
+
start: isoDate.optional(),
|
|
65
|
+
end: isoDate.optional(),
|
|
66
|
+
},
|
|
67
|
+
annotations: annotate.read,
|
|
68
|
+
scope: 'usage:read',
|
|
69
|
+
handler: (client, args) => client.get('/v1/usage/events', args),
|
|
70
|
+
}),
|
|
71
|
+
];
|
|
72
|
+
//# sourceMappingURL=billing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/tools/billing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;AAEzG,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,UA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
import { z } from 'zod/v4';
|
|
2
|
+
export declare const callTools: (import("../tooling.js").ToolDef<{
|
|
3
|
+
to: z.ZodString;
|
|
4
|
+
agent_id: z.ZodString;
|
|
5
|
+
from_number_id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
lead_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
lead_name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}> | import("../tooling.js").ToolDef<{
|
|
11
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
completed: "completed";
|
|
13
|
+
canceled: "canceled";
|
|
14
|
+
queued: "queued";
|
|
15
|
+
ringing: "ringing";
|
|
16
|
+
"in-progress": "in-progress";
|
|
17
|
+
failed: "failed";
|
|
18
|
+
busy: "busy";
|
|
19
|
+
"no-answer": "no-answer";
|
|
20
|
+
}>>;
|
|
21
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
inbound: "inbound";
|
|
23
|
+
outbound: "outbound";
|
|
24
|
+
}>>;
|
|
25
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
26
|
+
campaign_id: z.ZodOptional<z.ZodString>;
|
|
27
|
+
engine: z.ZodOptional<z.ZodString>;
|
|
28
|
+
phone_number: z.ZodOptional<z.ZodString>;
|
|
29
|
+
started_after: z.ZodOptional<z.ZodString>;
|
|
30
|
+
started_before: z.ZodOptional<z.ZodString>;
|
|
31
|
+
failed_only: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
34
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}> | import("../tooling.js").ToolDef<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
}>)[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { annotate, compact, defineTool } from '../tooling.js';
|
|
3
|
+
import { arbitraryFields, e164, id, idempotencyKey, isoDate, pagination } from '../schemas.js';
|
|
4
|
+
const callStatus = z.enum(['queued', 'ringing', 'in-progress', 'completed', 'failed', 'busy', 'no-answer', 'canceled']);
|
|
5
|
+
export const callTools = [
|
|
6
|
+
defineTool({
|
|
7
|
+
name: 'place_call',
|
|
8
|
+
endpoint: 'POST /v1/calls',
|
|
9
|
+
title: 'Place an outbound call',
|
|
10
|
+
description: 'Dial a real phone number over the account\'s SIP trunk and connect the agent. THIS SPENDS MONEY AND MAKES A PHONE RING: confirm with the user before calling it. ' +
|
|
11
|
+
'Credit is reserved up front; an underfunded account is refused with insufficient_credits and nothing is dialled. ' +
|
|
12
|
+
'Returns the call record immediately with status queued or ringing; poll get_call for progress, transcript and cost. ' +
|
|
13
|
+
'Needs an agent (create_agent), a SIP trunk (create_sip_trunk) and a phone number on it (create_phone_number), either as from_number_id or as the agent\'s outbound_phone_number_id.',
|
|
14
|
+
input: {
|
|
15
|
+
to: e164.describe('Destination in E.164 form, e.g. "+14155551234".'),
|
|
16
|
+
agent_id: z.string().describe('The agent that will hold the conversation.'),
|
|
17
|
+
from_number_id: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Phone number id to call from. Defaults to the agent\'s outbound_phone_number_id.'),
|
|
21
|
+
lead_id: z.string().optional().describe('Existing lead to attribute the call to. One is created if omitted.'),
|
|
22
|
+
lead_name: z.string().optional().describe('Name for the auto-created lead; available as {{name}} in the opening message.'),
|
|
23
|
+
metadata: arbitraryFields.describe('Echoed back on the call and in webhooks. Not shown to the model.'),
|
|
24
|
+
idempotency_key: idempotencyKey,
|
|
25
|
+
},
|
|
26
|
+
annotations: annotate.spend,
|
|
27
|
+
scope: 'calls:write',
|
|
28
|
+
handler: (client, { idempotency_key, ...body }) => client.post('/v1/calls', compact(body), { idempotencyKey: idempotency_key, idempotent: true }),
|
|
29
|
+
}),
|
|
30
|
+
defineTool({
|
|
31
|
+
name: 'list_calls',
|
|
32
|
+
endpoint: 'GET /v1/calls',
|
|
33
|
+
title: 'List calls',
|
|
34
|
+
description: 'List calls in summary form (no transcript). Filter by status, direction, agent, campaign, engine, phone number or time window. ' +
|
|
35
|
+
'Use get_call for the full record of one call.',
|
|
36
|
+
input: {
|
|
37
|
+
...pagination,
|
|
38
|
+
status: callStatus.optional(),
|
|
39
|
+
direction: z.enum(['inbound', 'outbound']).optional(),
|
|
40
|
+
agent_id: z.string().optional(),
|
|
41
|
+
campaign_id: z.string().optional(),
|
|
42
|
+
engine: z.string().optional().describe('Engine id as returned by list_engines.'),
|
|
43
|
+
phone_number: z.string().optional().describe('Match either party\'s number.'),
|
|
44
|
+
started_after: isoDate.optional(),
|
|
45
|
+
started_before: isoDate.optional(),
|
|
46
|
+
failed_only: z.boolean().optional().describe('Only calls that did not connect.'),
|
|
47
|
+
},
|
|
48
|
+
annotations: annotate.read,
|
|
49
|
+
scope: 'calls:read',
|
|
50
|
+
handler: (client, args) => client.get('/v1/calls', args),
|
|
51
|
+
}),
|
|
52
|
+
defineTool({
|
|
53
|
+
name: 'get_call',
|
|
54
|
+
endpoint: 'GET /v1/calls/{id}',
|
|
55
|
+
title: 'Retrieve a call',
|
|
56
|
+
description: 'The full call record: status, duration, cost_micros, recording_url, summary, transcript, transfers, and any provider errors. ' +
|
|
57
|
+
'If the call did not connect, failure_code (a Q.850 cause: 17 busy, 19 no answer, 21 rejected by carrier, 34 congestion, 102 timeout) and failure_reason say what to do about it.',
|
|
58
|
+
input: { id: id.describe('The call id (not the session_id).') },
|
|
59
|
+
annotations: annotate.read,
|
|
60
|
+
scope: 'calls:read',
|
|
61
|
+
handler: (client, { id }) => client.get(`/v1/calls/${encodeURIComponent(id)}`),
|
|
62
|
+
}),
|
|
63
|
+
defineTool({
|
|
64
|
+
name: 'get_call_transcript',
|
|
65
|
+
endpoint: 'GET /v1/calls/{id}/transcript',
|
|
66
|
+
title: 'Retrieve a call transcript',
|
|
67
|
+
description: 'Just the transcript of a call, as a list of {role, content, timestamp} turns.',
|
|
68
|
+
input: { id },
|
|
69
|
+
annotations: annotate.read,
|
|
70
|
+
scope: 'calls:read',
|
|
71
|
+
handler: (client, { id }) => client.get(`/v1/calls/${encodeURIComponent(id)}/transcript`),
|
|
72
|
+
}),
|
|
73
|
+
defineTool({
|
|
74
|
+
name: 'hangup_call',
|
|
75
|
+
endpoint: 'POST /v1/calls/{id}/hangup',
|
|
76
|
+
title: 'End a call in progress',
|
|
77
|
+
description: 'Hang up a live call. Billing stops when the call ends. Returns the updated call record.',
|
|
78
|
+
input: { id },
|
|
79
|
+
annotations: annotate.writeIdempotent,
|
|
80
|
+
scope: 'calls:write',
|
|
81
|
+
handler: (client, { id }) => client.post(`/v1/calls/${encodeURIComponent(id)}/hangup`),
|
|
82
|
+
}),
|
|
83
|
+
defineTool({
|
|
84
|
+
name: 'delete_call',
|
|
85
|
+
endpoint: 'DELETE /v1/calls/{id}',
|
|
86
|
+
title: 'Delete a call record',
|
|
87
|
+
description: 'Remove a call log with its transcript and recording, as a caller\'s erasure request needs. The usage rows that billed it are kept (they carry no content). ' +
|
|
88
|
+
'A call still in progress cannot be deleted; hang it up first. Not reversible.',
|
|
89
|
+
input: { id },
|
|
90
|
+
annotations: annotate.destructive,
|
|
91
|
+
scope: 'calls:write',
|
|
92
|
+
handler: async (client, { id }) => {
|
|
93
|
+
await client.delete(`/v1/calls/${encodeURIComponent(id)}`);
|
|
94
|
+
return { deleted: true, id };
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
];
|
|
98
|
+
//# sourceMappingURL=calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.js","sourceRoot":"","sources":["../../src/tools/calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EA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AAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YAC9B,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC3D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const campaignTools: (import("../tooling.js").ToolDef<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
5
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}> | import("../tooling.js").ToolDef<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
}> | import("../tooling.js").ToolDef<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
agent_id: z.ZodString;
|
|
11
|
+
lead_ids: z.ZodArray<z.ZodString>;
|
|
12
|
+
scheduled_at: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}>)[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { annotate, compact, defineTool } from '../tooling.js';
|
|
3
|
+
import { id, isoDate, pagination } from '../schemas.js';
|
|
4
|
+
export const campaignTools = [
|
|
5
|
+
defineTool({
|
|
6
|
+
name: 'list_campaigns',
|
|
7
|
+
endpoint: 'GET /v1/campaigns',
|
|
8
|
+
title: 'List campaigns',
|
|
9
|
+
description: 'List outbound calling campaigns with their status (idle, scheduled, running, completed, stopped, paused) and lead_count.',
|
|
10
|
+
input: { ...pagination },
|
|
11
|
+
annotations: annotate.read,
|
|
12
|
+
scope: 'campaigns:read',
|
|
13
|
+
handler: (client, args) => client.get('/v1/campaigns', args),
|
|
14
|
+
}),
|
|
15
|
+
defineTool({
|
|
16
|
+
name: 'get_campaign',
|
|
17
|
+
endpoint: 'GET /v1/campaigns/{id}',
|
|
18
|
+
title: 'Retrieve a campaign',
|
|
19
|
+
description: 'Fetch one campaign by id.',
|
|
20
|
+
input: { id },
|
|
21
|
+
annotations: annotate.read,
|
|
22
|
+
scope: 'campaigns:read',
|
|
23
|
+
handler: (client, { id }) => client.get(`/v1/campaigns/${encodeURIComponent(id)}`),
|
|
24
|
+
}),
|
|
25
|
+
defineTool({
|
|
26
|
+
name: 'create_campaign',
|
|
27
|
+
endpoint: 'POST /v1/campaigns',
|
|
28
|
+
title: 'Create a campaign',
|
|
29
|
+
description: 'Create a campaign that will call every listed lead with an agent. Creating does NOT dial anyone: call start_campaign when the user is ready to spend. ' +
|
|
30
|
+
'Without scheduled_at the campaign is ready to start immediately.',
|
|
31
|
+
input: {
|
|
32
|
+
name: z.string().min(1),
|
|
33
|
+
agent_id: z.string(),
|
|
34
|
+
lead_ids: z.array(z.string()).min(1).describe('Lead ids from list_leads or import_leads.'),
|
|
35
|
+
scheduled_at: isoDate.optional().describe('When to begin. Omit to start on demand.'),
|
|
36
|
+
},
|
|
37
|
+
annotations: annotate.write,
|
|
38
|
+
scope: 'campaigns:write',
|
|
39
|
+
handler: (client, args) => client.post('/v1/campaigns', compact(args)),
|
|
40
|
+
}),
|
|
41
|
+
defineTool({
|
|
42
|
+
name: 'start_campaign',
|
|
43
|
+
endpoint: 'POST /v1/campaigns/{id}/start',
|
|
44
|
+
title: 'Start a campaign',
|
|
45
|
+
description: 'Begin calling every lead on the campaign. THIS SPENDS MONEY AND MAKES REAL PHONES RING, one call per lead: confirm with the user before calling it. ' +
|
|
46
|
+
'Refused with insufficient_credits when the balance cannot cover the run.',
|
|
47
|
+
input: { id },
|
|
48
|
+
annotations: annotate.spend,
|
|
49
|
+
scope: 'campaigns:write',
|
|
50
|
+
handler: (client, { id }) => client.post(`/v1/campaigns/${encodeURIComponent(id)}/start`),
|
|
51
|
+
}),
|
|
52
|
+
defineTool({
|
|
53
|
+
name: 'pause_campaign',
|
|
54
|
+
endpoint: 'POST /v1/campaigns/{id}/pause',
|
|
55
|
+
title: 'Pause a campaign',
|
|
56
|
+
description: 'Stop placing new calls and hang up any the campaign still has in flight.',
|
|
57
|
+
input: { id },
|
|
58
|
+
annotations: annotate.writeIdempotent,
|
|
59
|
+
scope: 'campaigns:write',
|
|
60
|
+
handler: (client, { id }) => client.post(`/v1/campaigns/${encodeURIComponent(id)}/pause`),
|
|
61
|
+
}),
|
|
62
|
+
defineTool({
|
|
63
|
+
name: 'delete_campaign',
|
|
64
|
+
endpoint: 'DELETE /v1/campaigns/{id}',
|
|
65
|
+
title: 'Delete a campaign',
|
|
66
|
+
description: 'Permanently delete a campaign. Pause it first if it is running. Not reversible.',
|
|
67
|
+
input: { id },
|
|
68
|
+
annotations: annotate.destructive,
|
|
69
|
+
scope: 'campaigns:write',
|
|
70
|
+
handler: async (client, { id }) => {
|
|
71
|
+
await client.delete(`/v1/campaigns/${encodeURIComponent(id)}`);
|
|
72
|
+
return { deleted: true, id };
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
];
|
|
76
|
+
//# sourceMappingURL=campaigns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,UAAU,CAAC;QACP,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,mBAAmB;QAC7B,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,0HA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AAC;YAC/D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { annotate, defineTool } from '../tooling.js';
|
|
3
|
+
const engineName = {
|
|
4
|
+
engine: z.string().describe('An engine id from list_engines, e.g. "classic", "sarvam", "gemini_live", "deepgram_agent".'),
|
|
5
|
+
};
|
|
6
|
+
export const engineTools = [
|
|
7
|
+
defineTool({
|
|
8
|
+
name: 'list_engines',
|
|
9
|
+
endpoint: 'GET /v1/engines',
|
|
10
|
+
title: 'List available engines and models',
|
|
11
|
+
description: 'What the platform can serve right now, with per-unit prices in micro-USD. Each engine is composed (needs stt + llm + tts models) or realtime (one model). ' +
|
|
12
|
+
'Call this before create_agent rather than guessing model ids: an engine whose provider is degraded disappears from this list before calls start failing. ' +
|
|
13
|
+
'No scope needed beyond a valid key.',
|
|
14
|
+
input: {},
|
|
15
|
+
annotations: annotate.read,
|
|
16
|
+
handler: (client) => client.get('/v1/engines'),
|
|
17
|
+
}),
|
|
18
|
+
defineTool({
|
|
19
|
+
name: 'list_engine_languages',
|
|
20
|
+
endpoint: 'GET /v1/engines/{engine}/languages',
|
|
21
|
+
title: "List an engine's languages",
|
|
22
|
+
description: 'Which languages an engine can hold a conversation in. Call this before create_agent when the user names a language: ' +
|
|
23
|
+
'a composed engine only lists a language when both its speech-to-text and its text-to-speech serve it, so this is the ' +
|
|
24
|
+
'list that is true end to end rather than a guess from the model names. Use a code from here as the agent\'s language ' +
|
|
25
|
+
'or as voice.stt.language / voice.realtime.language. No scope needed beyond a valid key.',
|
|
26
|
+
input: engineName,
|
|
27
|
+
annotations: annotate.read,
|
|
28
|
+
handler: (client, args) => client.get(`/v1/engines/${encodeURIComponent(args.engine)}/languages`),
|
|
29
|
+
}),
|
|
30
|
+
defineTool({
|
|
31
|
+
name: 'list_engine_voices',
|
|
32
|
+
endpoint: 'GET /v1/engines/{engine}/voices',
|
|
33
|
+
title: "List an engine's speaker voices",
|
|
34
|
+
description: 'The voices an engine can speak as — the voice the caller actually hears. Use an id from here as voice.tts.voice ' +
|
|
35
|
+
'(composed engines) or voice.realtime.voice (realtime engines). Never invent a voice id; an unknown one is rejected. ' +
|
|
36
|
+
'A response with stale: true means the provider could not be reached and this is the last known list. ' +
|
|
37
|
+
'No scope needed beyond a valid key.',
|
|
38
|
+
input: engineName,
|
|
39
|
+
annotations: annotate.read,
|
|
40
|
+
handler: (client, args) => client.get(`/v1/engines/${encodeURIComponent(args.engine)}/voices`),
|
|
41
|
+
}),
|
|
42
|
+
];
|
|
43
|
+
//# sourceMappingURL=engines.js.map
|