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.
Files changed (76) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE +21 -0
  3. package/README.md +127 -0
  4. package/dist/client.d.ts +69 -0
  5. package/dist/client.js +137 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/guide.d.ts +11 -0
  8. package/dist/guide.js +86 -0
  9. package/dist/guide.js.map +1 -0
  10. package/dist/http.d.ts +80 -0
  11. package/dist/http.js +281 -0
  12. package/dist/http.js.map +1 -0
  13. package/dist/index.d.ts +17 -0
  14. package/dist/index.js +88 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/prompts.d.ts +7 -0
  17. package/dist/prompts.js +83 -0
  18. package/dist/prompts.js.map +1 -0
  19. package/dist/schemas.d.ts +105 -0
  20. package/dist/schemas.js +122 -0
  21. package/dist/schemas.js.map +1 -0
  22. package/dist/server.d.ts +16 -0
  23. package/dist/server.js +58 -0
  24. package/dist/server.js.map +1 -0
  25. package/dist/site.d.ts +12 -0
  26. package/dist/site.js +17 -0
  27. package/dist/site.js.map +1 -0
  28. package/dist/tooling.d.ts +59 -0
  29. package/dist/tooling.js +129 -0
  30. package/dist/tooling.js.map +1 -0
  31. package/dist/tools/agents.d.ts +97 -0
  32. package/dist/tools/agents.js +105 -0
  33. package/dist/tools/agents.js.map +1 -0
  34. package/dist/tools/api-keys.d.ts +37 -0
  35. package/dist/tools/api-keys.js +61 -0
  36. package/dist/tools/api-keys.js.map +1 -0
  37. package/dist/tools/appointments.d.ts +30 -0
  38. package/dist/tools/appointments.js +77 -0
  39. package/dist/tools/appointments.js.map +1 -0
  40. package/dist/tools/billing.d.ts +29 -0
  41. package/dist/tools/billing.js +72 -0
  42. package/dist/tools/billing.js.map +1 -0
  43. package/dist/tools/calls.d.ts +37 -0
  44. package/dist/tools/calls.js +98 -0
  45. package/dist/tools/calls.js.map +1 -0
  46. package/dist/tools/campaigns.d.ts +13 -0
  47. package/dist/tools/campaigns.js +76 -0
  48. package/dist/tools/campaigns.js.map +1 -0
  49. package/dist/tools/engines.d.ts +4 -0
  50. package/dist/tools/engines.js +43 -0
  51. package/dist/tools/engines.js.map +1 -0
  52. package/dist/tools/index.d.ts +5 -0
  53. package/dist/tools/index.js +37 -0
  54. package/dist/tools/index.js.map +1 -0
  55. package/dist/tools/knowledge-bases.d.ts +27 -0
  56. package/dist/tools/knowledge-bases.js +69 -0
  57. package/dist/tools/knowledge-bases.js.map +1 -0
  58. package/dist/tools/leads.d.ts +28 -0
  59. package/dist/tools/leads.js +88 -0
  60. package/dist/tools/leads.js.map +1 -0
  61. package/dist/tools/phone-numbers.d.ts +19 -0
  62. package/dist/tools/phone-numbers.js +72 -0
  63. package/dist/tools/phone-numbers.js.map +1 -0
  64. package/dist/tools/realtime.d.ts +8 -0
  65. package/dist/tools/realtime.js +28 -0
  66. package/dist/tools/realtime.js.map +1 -0
  67. package/dist/tools/sip-trunks.d.ts +45 -0
  68. package/dist/tools/sip-trunks.js +118 -0
  69. package/dist/tools/sip-trunks.js.map +1 -0
  70. package/dist/tools/webhooks.d.ts +52 -0
  71. package/dist/tools/webhooks.js +90 -0
  72. package/dist/tools/webhooks.js.map +1 -0
  73. package/dist/version.d.ts +7 -0
  74. package/dist/version.js +8 -0
  75. package/dist/version.js.map +1 -0
  76. package/package.json +65 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engines.js","sourceRoot":"","sources":["../../src/tools/engines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,UAAU,GAAG;IACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4FAA4F,CAAC;CAC5H,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,UAAU,CAAC;QACP,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,iBAAiB;QAC3B,KAAK,EAAE,mCAAmC;QAC1C,WAAW,EACP,4JAA4J;YAC5J,2JAA2J;YAC3J,qCAAqC;QACzC,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;KACjD,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,uBAAuB;QAC7B,QAAQ,EAAE,oCAAoC;QAC9C,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACP,sHAAsH;YACtH,uHAAuH;YACvH,uHAAuH;YACvH,yFAAyF;QAC7F,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;KACpG,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,iCAAiC;QAC3C,KAAK,EAAE,iCAAiC;QACxC,WAAW,EACP,kHAAkH;YAClH,sHAAsH;YACtH,uGAAuG;YACvG,qCAAqC;QACzC,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;KACjG,CAAC;CACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ToolDef } from '../tooling.js';
2
+ /** Every tool the server exposes, in the order a client lists them. */
3
+ export declare const allTools: ToolDef<any>[];
4
+ /** The tools this server registers, for the edition it runs as. */
5
+ export declare function toolsFor(env?: NodeJS.ProcessEnv): ToolDef<any>[];
@@ -0,0 +1,37 @@
1
+ import { isSelfHosted } from '../site.js';
2
+ import { agentTools } from './agents.js';
3
+ import { apiKeyTools } from './api-keys.js';
4
+ import { appointmentTools } from './appointments.js';
5
+ import { billingTools } from './billing.js';
6
+ import { callTools } from './calls.js';
7
+ import { realtimeTools } from './realtime.js';
8
+ import { campaignTools } from './campaigns.js';
9
+ import { engineTools } from './engines.js';
10
+ import { knowledgeBaseTools } from './knowledge-bases.js';
11
+ import { leadTools } from './leads.js';
12
+ import { phoneNumberTools } from './phone-numbers.js';
13
+ import { sipTrunkTools } from './sip-trunks.js';
14
+ import { webhookTools } from './webhooks.js';
15
+ /** Every tool the server exposes, in the order a client lists them. */
16
+ export const allTools = [
17
+ ...engineTools,
18
+ ...agentTools,
19
+ ...callTools,
20
+ ...realtimeTools,
21
+ ...sipTrunkTools,
22
+ ...phoneNumberTools,
23
+ ...leadTools,
24
+ ...campaignTools,
25
+ ...knowledgeBaseTools,
26
+ ...appointmentTools,
27
+ ...webhookTools,
28
+ ...billingTools,
29
+ ...apiKeyTools,
30
+ ];
31
+ /** Tools with nothing to do on a self-hosted install, where no one buys credit. */
32
+ const HOSTED_ONLY = new Set(['create_topup']);
33
+ /** The tools this server registers, for the edition it runs as. */
34
+ export function toolsFor(env = process.env) {
35
+ return isSelfHosted(env) ? allTools.filter((tool) => !HOSTED_ONLY.has(tool.name)) : allTools;
36
+ }
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,Y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.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
+ description: z.ZodOptional<z.ZodString>;
11
+ basic_info: z.ZodOptional<z.ZodString>;
12
+ faqs: z.ZodOptional<z.ZodArray<z.ZodObject<{
13
+ question: z.ZodString;
14
+ answer: z.ZodString;
15
+ }, z.core.$strip>>>;
16
+ other_info: z.ZodOptional<z.ZodString>;
17
+ }> | import("../tooling.js").ToolDef<{
18
+ name: z.ZodOptional<z.ZodString>;
19
+ description: z.ZodOptional<z.ZodString>;
20
+ basic_info: z.ZodOptional<z.ZodString>;
21
+ faqs: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ question: z.ZodString;
23
+ answer: z.ZodString;
24
+ }, z.core.$strip>>>;
25
+ other_info: z.ZodOptional<z.ZodString>;
26
+ id: z.ZodString;
27
+ }>)[];
@@ -0,0 +1,69 @@
1
+ import { z } from 'zod/v4';
2
+ import { annotate, compact, defineTool } from '../tooling.js';
3
+ import { id, pagination } from '../schemas.js';
4
+ const kbFields = {
5
+ name: z.string().min(1),
6
+ description: z.string().optional().describe('What this knowledge base covers, for your own reference.'),
7
+ basic_info: z.string().optional().describe('Free text the agent should know: hours, address, pricing, policies.'),
8
+ faqs: z
9
+ .array(z.object({ question: z.string(), answer: z.string() }))
10
+ .optional()
11
+ .describe('Question/answer pairs the agent can answer verbatim.'),
12
+ other_info: z.string().optional().describe('Anything else, free text.'),
13
+ };
14
+ export const knowledgeBaseTools = [
15
+ defineTool({
16
+ name: 'list_knowledge_bases',
17
+ endpoint: 'GET /v1/knowledge-bases',
18
+ title: 'List knowledge bases',
19
+ description: 'List knowledge bases. Attach one to an agent with knowledge_base_id on create_agent or update_agent.',
20
+ input: { ...pagination },
21
+ annotations: annotate.read,
22
+ scope: 'knowledge_bases:read',
23
+ handler: (client, args) => client.get('/v1/knowledge-bases', args),
24
+ }),
25
+ defineTool({
26
+ name: 'get_knowledge_base',
27
+ endpoint: 'GET /v1/knowledge-bases/{id}',
28
+ title: 'Retrieve a knowledge base',
29
+ description: 'Fetch one knowledge base with its full content.',
30
+ input: { id },
31
+ annotations: annotate.read,
32
+ scope: 'knowledge_bases:read',
33
+ handler: (client, { id }) => client.get(`/v1/knowledge-bases/${encodeURIComponent(id)}`),
34
+ }),
35
+ defineTool({
36
+ name: 'create_knowledge_base',
37
+ endpoint: 'POST /v1/knowledge-bases',
38
+ title: 'Create a knowledge base',
39
+ description: 'Create a knowledge base of facts and FAQs an agent can draw on during calls.',
40
+ input: kbFields,
41
+ annotations: annotate.write,
42
+ scope: 'knowledge_bases:write',
43
+ handler: (client, args) => client.post('/v1/knowledge-bases', compact(args)),
44
+ }),
45
+ defineTool({
46
+ name: 'update_knowledge_base',
47
+ endpoint: 'PATCH /v1/knowledge-bases/{id}',
48
+ title: 'Update a knowledge base',
49
+ description: 'Change a knowledge base. Only the fields you send are changed. Sending faqs replaces the whole list.',
50
+ input: { id, ...kbFields, name: kbFields.name.optional() },
51
+ annotations: annotate.write,
52
+ scope: 'knowledge_bases:write',
53
+ handler: (client, { id, ...rest }) => client.patch(`/v1/knowledge-bases/${encodeURIComponent(id)}`, compact(rest)),
54
+ }),
55
+ defineTool({
56
+ name: 'delete_knowledge_base',
57
+ endpoint: 'DELETE /v1/knowledge-bases/{id}',
58
+ title: 'Delete a knowledge base',
59
+ description: 'Permanently delete a knowledge base. Agents referencing it lose that context. Not reversible.',
60
+ input: { id },
61
+ annotations: annotate.destructive,
62
+ scope: 'knowledge_bases:write',
63
+ handler: async (client, { id }) => {
64
+ await client.delete(`/v1/knowledge-bases/${encodeURIComponent(id)}`);
65
+ return { deleted: true, id };
66
+ },
67
+ }),
68
+ ];
69
+ //# sourceMappingURL=knowledge-bases.js.map
@@ -0,0 +1 @@
1
+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AAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;KACnF,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,uBAAuB;QAC7B,QAAQ,EAAE,iCAAiC;QAC3C,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,+FAA+F;QAC5G,KAAK,EAAE,EAAE,EAAE,EAAE;QACb,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE,uBAAuB;QAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YAC9B,MAAM,MAAM,CAAC,MAAM,CAAC,uBAAuB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;CACL,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const leadTools: (import("../tooling.js").ToolDef<{
3
+ tag: z.ZodOptional<z.ZodString>;
4
+ search: z.ZodOptional<z.ZodString>;
5
+ limit: z.ZodOptional<z.ZodNumber>;
6
+ starting_after: z.ZodOptional<z.ZodString>;
7
+ ending_before: z.ZodOptional<z.ZodString>;
8
+ }> | import("../tooling.js").ToolDef<{
9
+ id: z.ZodString;
10
+ }> | import("../tooling.js").ToolDef<{
11
+ name: z.ZodString;
12
+ phone_number: z.ZodString;
13
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ }> | import("../tooling.js").ToolDef<{
16
+ id: z.ZodString;
17
+ name: z.ZodOptional<z.ZodString>;
18
+ phone_number: z.ZodOptional<z.ZodString>;
19
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ }> | import("../tooling.js").ToolDef<{
22
+ leads: z.ZodArray<z.ZodObject<{
23
+ name: z.ZodString;
24
+ phone_number: z.ZodString;
25
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
+ }, z.core.$strip>>;
28
+ }>)[];
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod/v4';
2
+ import { annotate, compact, defineTool } from '../tooling.js';
3
+ import { arbitraryFields, e164, id, pagination } from '../schemas.js';
4
+ const leadFields = {
5
+ name: z.string().min(1),
6
+ phone_number: e164,
7
+ fields: arbitraryFields.describe('Arbitrary key/value data, usable as {{merge}} fields in prompts and opening messages.'),
8
+ tags: z.array(z.string()).optional(),
9
+ };
10
+ export const leadTools = [
11
+ defineTool({
12
+ name: 'list_leads',
13
+ endpoint: 'GET /v1/leads',
14
+ title: 'List leads',
15
+ description: 'List leads (contacts). Filter by tag or free-text search. Cursor-paginated.',
16
+ input: {
17
+ ...pagination,
18
+ tag: z.string().optional(),
19
+ search: z.string().optional().describe('Matches name or phone number.'),
20
+ },
21
+ annotations: annotate.read,
22
+ scope: 'leads:read',
23
+ handler: (client, args) => client.get('/v1/leads', args),
24
+ }),
25
+ defineTool({
26
+ name: 'get_lead',
27
+ endpoint: 'GET /v1/leads/{id}',
28
+ title: 'Retrieve a lead',
29
+ description: 'Fetch one lead by id.',
30
+ input: { id },
31
+ annotations: annotate.read,
32
+ scope: 'leads:read',
33
+ handler: (client, { id }) => client.get(`/v1/leads/${encodeURIComponent(id)}`),
34
+ }),
35
+ defineTool({
36
+ name: 'create_lead',
37
+ endpoint: 'POST /v1/leads',
38
+ title: 'Create a lead',
39
+ description: 'Create one lead. For many at once use import_leads.',
40
+ input: leadFields,
41
+ annotations: annotate.write,
42
+ scope: 'leads:write',
43
+ handler: (client, args) => client.post('/v1/leads', compact(args)),
44
+ }),
45
+ defineTool({
46
+ name: 'update_lead',
47
+ endpoint: 'PATCH /v1/leads/{id}',
48
+ title: 'Update a lead',
49
+ description: 'Change a lead. Only the fields you send are changed.',
50
+ input: {
51
+ id,
52
+ name: leadFields.name.optional(),
53
+ phone_number: leadFields.phone_number.optional(),
54
+ fields: leadFields.fields,
55
+ tags: leadFields.tags,
56
+ },
57
+ annotations: annotate.write,
58
+ scope: 'leads:write',
59
+ handler: (client, { id, ...rest }) => client.patch(`/v1/leads/${encodeURIComponent(id)}`, compact(rest)),
60
+ }),
61
+ defineTool({
62
+ name: 'delete_lead',
63
+ endpoint: 'DELETE /v1/leads/{id}',
64
+ title: 'Delete a lead',
65
+ description: 'Permanently delete a lead. Not reversible.',
66
+ input: { id },
67
+ annotations: annotate.destructive,
68
+ scope: 'leads:write',
69
+ handler: async (client, { id }) => {
70
+ await client.delete(`/v1/leads/${encodeURIComponent(id)}`);
71
+ return { deleted: true, id };
72
+ },
73
+ }),
74
+ defineTool({
75
+ name: 'import_leads',
76
+ endpoint: 'POST /v1/leads/bulk',
77
+ title: 'Import many leads',
78
+ description: 'Create up to 1,000 leads in one request. Rows are validated individually: malformed rows come back in errors with their index, and the rest are still created. ' +
79
+ 'Check failed_count in the result.',
80
+ input: {
81
+ leads: z.array(z.object(leadFields)).min(1).max(1000),
82
+ },
83
+ annotations: annotate.write,
84
+ scope: 'leads:write',
85
+ handler: (client, { leads }) => client.post('/v1/leads/bulk', { leads: leads.map((l) => compact(l)) }),
86
+ }),
87
+ ];
88
+ //# sourceMappingURL=leads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leads.js","sourceRoot":"","sources":["../../src/tools/leads.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,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,UAAU,GAAG;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EA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AO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,qBAAqB;QAC/B,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACP,iKAAiK;YACjK,mCAAmC;QACvC,KAAK,EAAE;YACH,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;SACxD;QACD,WAAW,EAAE,QAAQ,CAAC,KAAK;QAC3B,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACzG,CAAC;CACL,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const phoneNumberTools: (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
+ sip_trunk_id: z.ZodString;
11
+ name: z.ZodOptional<z.ZodString>;
12
+ inbound_agent_id: z.ZodOptional<z.ZodString>;
13
+ }> | import("../tooling.js").ToolDef<{
14
+ id: z.ZodString;
15
+ phone_number: z.ZodOptional<z.ZodString>;
16
+ sip_trunk_id: z.ZodOptional<z.ZodString>;
17
+ name: z.ZodOptional<z.ZodString>;
18
+ inbound_agent_id: z.ZodOptional<z.ZodString>;
19
+ }>)[];
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod/v4';
2
+ import { annotate, compact, defineTool } from '../tooling.js';
3
+ import { e164, id, pagination } from '../schemas.js';
4
+ export const phoneNumberTools = [
5
+ defineTool({
6
+ name: 'list_phone_numbers',
7
+ endpoint: 'GET /v1/phone-numbers',
8
+ title: 'List phone numbers',
9
+ description: 'List the phone numbers registered on this account, with the SIP trunk each rides on and the agent (if any) answering inbound calls.',
10
+ input: { ...pagination },
11
+ annotations: annotate.read,
12
+ scope: 'phone_numbers:read',
13
+ handler: (client, args) => client.get('/v1/phone-numbers', args),
14
+ }),
15
+ defineTool({
16
+ name: 'get_phone_number',
17
+ endpoint: 'GET /v1/phone-numbers/{id}',
18
+ title: 'Retrieve a phone number',
19
+ description: 'Fetch one phone number record by id.',
20
+ input: { id },
21
+ annotations: annotate.read,
22
+ scope: 'phone_numbers:read',
23
+ handler: (client, { id }) => client.get(`/v1/phone-numbers/${encodeURIComponent(id)}`),
24
+ }),
25
+ defineTool({
26
+ name: 'create_phone_number',
27
+ endpoint: 'POST /v1/phone-numbers',
28
+ title: 'Register a phone number',
29
+ description: 'Register a number you already own with your carrier, on one of your SIP trunks. Wixzel does not sell numbers. ' +
30
+ 'Set inbound_agent_id to have an agent answer calls to it; without it inbound calls are rejected. ' +
31
+ 'For inbound to ring at all, the carrier must also be pointed at the trunk\'s origination_uri (see get_sip_trunk).',
32
+ input: {
33
+ phone_number: e164,
34
+ sip_trunk_id: z.string().describe('The trunk this number is routed through. See list_sip_trunks.'),
35
+ name: z.string().optional().describe('A label, e.g. "Main line".'),
36
+ inbound_agent_id: z.string().optional().describe('Agent that answers inbound calls to this number.'),
37
+ },
38
+ annotations: annotate.write,
39
+ scope: 'phone_numbers:write',
40
+ handler: (client, args) => client.post('/v1/phone-numbers', compact(args)),
41
+ }),
42
+ defineTool({
43
+ name: 'update_phone_number',
44
+ endpoint: 'PATCH /v1/phone-numbers/{id}',
45
+ title: 'Update a phone number',
46
+ description: 'Change a phone number\'s label, trunk or inbound agent. Only the fields you send are changed.',
47
+ input: {
48
+ id,
49
+ phone_number: e164.optional(),
50
+ sip_trunk_id: z.string().optional(),
51
+ name: z.string().optional(),
52
+ inbound_agent_id: z.string().optional(),
53
+ },
54
+ annotations: annotate.write,
55
+ scope: 'phone_numbers:write',
56
+ handler: (client, { id, ...rest }) => client.patch(`/v1/phone-numbers/${encodeURIComponent(id)}`, compact(rest)),
57
+ }),
58
+ defineTool({
59
+ name: 'delete_phone_number',
60
+ endpoint: 'DELETE /v1/phone-numbers/{id}',
61
+ title: 'Delete a phone number',
62
+ description: 'Remove a phone number from the account. Agents using it as their outbound number can no longer place calls. Not reversible.',
63
+ input: { id },
64
+ annotations: annotate.destructive,
65
+ scope: 'phone_numbers:write',
66
+ handler: async (client, { id }) => {
67
+ await client.delete(`/v1/phone-numbers/${encodeURIComponent(id)}`);
68
+ return { deleted: true, id };
69
+ },
70
+ }),
71
+ ];
72
+ //# sourceMappingURL=phone-numbers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../../src/tools/phone-numbers.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,UAAU,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,UAAU,CAAC;QACP,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,uBAAuB;QACjC,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,qIAAqI;QAClJ,KAAK,EAAE,EAAE,GAAG,UAAU,EAAE;QACxB,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,EAA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B,WAAW,EAAE,+FAA+F;QAC5G,KAAK,EAAE;YACH,EAAE;YACF,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE;YAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC1C;QACD,WAAW,EAAE,QAAQ,CAAC,KAAK;QAC3B,KAAK,EAAE,qBAAqB;QAC5B,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CACjC,MAAM,CAAC,KAAK,CAAC,qBAAqB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;KACjF,CAAC;IACF,UAAU,CAAC;QACP,IAAI,EAAE,qBAAqB;QAC3B,QAAQ,EAAE,+BAA+B;QACzC,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,6HAA6H;QAC1I,KAAK,EAAE,EAAE,EAAE,EAAE;QACb,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE,qBAAqB;QAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YAC9B,MAAM,MAAM,CAAC,MAAM,CAAC,qBAAqB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjC,CAAC;KACJ,CAAC;CACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const realtimeTools: import("../tooling.js").ToolDef<{
3
+ agent_id: z.ZodString;
4
+ lead_id: z.ZodOptional<z.ZodString>;
5
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6
+ max_duration_seconds: z.ZodOptional<z.ZodNumber>;
7
+ allowed_origins: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ }>[];
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod/v4';
2
+ import { annotate, compact, defineTool } from '../tooling.js';
3
+ import { arbitraryFields } from '../schemas.js';
4
+ export const realtimeTools = [
5
+ defineTool({
6
+ name: 'create_realtime_session',
7
+ endpoint: 'POST /v1/realtime/sessions',
8
+ title: 'Create a realtime (browser/app) session',
9
+ description: 'Mint a one-minute, single-use client secret that lets a web page or app talk to an agent over wss://…/v1/realtime, with no SIP trunk or phone number. ' +
10
+ 'Nothing is charged when minting; once a client connects, the session bills at the same per-minute price as a phone call on that engine, counts toward the concurrent-call limit and appears in list_calls with channel "web". ' +
11
+ 'Use it to hand the user a working secret for testing their integration, or to explain the flow. The secret belongs in the client; the API key never does. ' +
12
+ 'Human transfer is not available on web sessions.',
13
+ input: {
14
+ agent_id: z.string().describe('The agent the user will talk to.'),
15
+ lead_id: z.string().optional().describe('Existing lead to attribute the session to. Merge fields resolve from it.'),
16
+ metadata: arbitraryFields.describe('Echoed on the resulting call and its callCompleted webhook. Not shown to the model.'),
17
+ max_duration_seconds: z.number().int().min(10).max(3600).optional().describe('Hard cap on the conversation. Default 600.'),
18
+ allowed_origins: z.array(z.string()).max(10).optional()
19
+ .describe('Browser origins allowed to open the socket, e.g. "https://app.example.com". Recommended for web use.'),
20
+ },
21
+ // Not `spend`: minting charges nothing and reaches no one. The money
22
+ // moves when a client connects, which this tool does not do.
23
+ annotations: annotate.write,
24
+ scope: 'calls:write',
25
+ handler: (client, args) => client.post('/v1/realtime/sessions', compact(args)),
26
+ }),
27
+ ];
28
+ //# sourceMappingURL=realtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.js","sourceRoot":"","sources":["../../src/tools/realtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EA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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
+ host: z.ZodString;
11
+ port: z.ZodOptional<z.ZodNumber>;
12
+ transport: z.ZodOptional<z.ZodEnum<{
13
+ udp: "udp";
14
+ tcp: "tcp";
15
+ tls: "tls";
16
+ }>>;
17
+ username: z.ZodOptional<z.ZodString>;
18
+ password: z.ZodOptional<z.ZodString>;
19
+ auth_realm: z.ZodOptional<z.ZodString>;
20
+ default_caller_id: z.ZodOptional<z.ZodString>;
21
+ dial_prefix: z.ZodOptional<z.ZodString>;
22
+ send_plus: z.ZodOptional<z.ZodBoolean>;
23
+ provider_name: z.ZodOptional<z.ZodString>;
24
+ }> | import("../tooling.js").ToolDef<{
25
+ name: z.ZodOptional<z.ZodString>;
26
+ host: z.ZodOptional<z.ZodString>;
27
+ port: z.ZodOptional<z.ZodNumber>;
28
+ transport: z.ZodOptional<z.ZodEnum<{
29
+ udp: "udp";
30
+ tcp: "tcp";
31
+ tls: "tls";
32
+ }>>;
33
+ username: z.ZodOptional<z.ZodString>;
34
+ password: z.ZodOptional<z.ZodString>;
35
+ auth_realm: z.ZodOptional<z.ZodString>;
36
+ default_caller_id: z.ZodOptional<z.ZodString>;
37
+ dial_prefix: z.ZodOptional<z.ZodString>;
38
+ send_plus: z.ZodOptional<z.ZodBoolean>;
39
+ provider_name: z.ZodOptional<z.ZodString>;
40
+ id: z.ZodString;
41
+ }> | import("../tooling.js").ToolDef<{
42
+ id: z.ZodString;
43
+ since_id: z.ZodOptional<z.ZodNumber>;
44
+ limit: z.ZodOptional<z.ZodNumber>;
45
+ }>)[];
@@ -0,0 +1,118 @@
1
+ import { z } from 'zod/v4';
2
+ import { annotate, compact, defineTool } from '../tooling.js';
3
+ import { id, pagination } from '../schemas.js';
4
+ const trunkFields = {
5
+ name: z.string().min(1).describe('A label, e.g. "Twilio" or "My carrier".'),
6
+ host: z.string().min(1).describe('The carrier\'s SIP host, e.g. "sip.carrier.example".'),
7
+ port: z.number().int().min(1).max(65535).optional().describe('Default 5060 (5061 for tls).'),
8
+ transport: z.enum(['udp', 'tcp', 'tls']).optional(),
9
+ username: z.string().optional(),
10
+ password: z
11
+ .string()
12
+ .optional()
13
+ .describe('Stored encrypted and never returned by the API again. Ask the user for it; do not invent one.'),
14
+ auth_realm: z.string().optional(),
15
+ default_caller_id: z.string().optional().describe('Caller id to present when no phone number is chosen.'),
16
+ dial_prefix: z.string().optional().describe('Digits prepended to every dialled number, if the carrier needs them.'),
17
+ send_plus: z
18
+ .boolean()
19
+ .optional()
20
+ .describe('Keep the leading "+" when dialling, so the request URI reads sip:+15551234567@host. Twilio, Telnyx and Vobiz want true; many wholesale carriers answer 408 unless it is false.'),
21
+ provider_name: z.string().optional().describe('Free text, e.g. "twilio", "telnyx", "plivo", "vonage", "bandwidth", "exotel", "vobiz".'),
22
+ };
23
+ export const sipTrunkTools = [
24
+ defineTool({
25
+ name: 'list_sip_trunks',
26
+ endpoint: 'GET /v1/sip-trunks',
27
+ title: 'List SIP trunks',
28
+ description: 'List the account\'s SIP trunks. Each carries platform_ip (allowlist it with the carrier for outbound) and origination_uri (point the carrier at it for inbound).',
29
+ input: { ...pagination },
30
+ annotations: annotate.read,
31
+ scope: 'sip_trunks:read',
32
+ handler: (client, args) => client.get('/v1/sip-trunks', args),
33
+ }),
34
+ defineTool({
35
+ name: 'get_sip_trunk',
36
+ endpoint: 'GET /v1/sip-trunks/{id}',
37
+ title: 'Retrieve a SIP trunk',
38
+ description: 'Fetch one SIP trunk by id. The password is never returned.',
39
+ input: { id },
40
+ annotations: annotate.read,
41
+ scope: 'sip_trunks:read',
42
+ handler: (client, { id }) => client.get(`/v1/sip-trunks/${encodeURIComponent(id)}`),
43
+ }),
44
+ defineTool({
45
+ name: 'create_sip_trunk',
46
+ endpoint: 'POST /v1/sip-trunks',
47
+ title: 'Create a SIP trunk',
48
+ description: 'Connect the user\'s own carrier (Twilio, Telnyx, Plivo, Vonage, Bandwidth, Exotel, Vobiz, any SIP provider). Wixzel does not resell telephony. ' +
49
+ 'After creating, tell the user to allowlist the returned platform_ip with their carrier (for outbound) and to set the carrier\'s origination URI to origination_uri (for inbound). ' +
50
+ 'Then run check_sip_trunk_status.',
51
+ input: trunkFields,
52
+ annotations: annotate.write,
53
+ scope: 'sip_trunks:write',
54
+ handler: (client, args) => client.post('/v1/sip-trunks', compact(args)),
55
+ }),
56
+ defineTool({
57
+ name: 'update_sip_trunk',
58
+ endpoint: 'PATCH /v1/sip-trunks/{id}',
59
+ title: 'Update a SIP trunk',
60
+ description: 'Change a SIP trunk. Only the fields you send are changed.',
61
+ input: { id, ...trunkFields, name: trunkFields.name.optional(), host: trunkFields.host.optional() },
62
+ annotations: annotate.write,
63
+ scope: 'sip_trunks:write',
64
+ handler: (client, { id, ...rest }) => client.patch(`/v1/sip-trunks/${encodeURIComponent(id)}`, compact(rest)),
65
+ }),
66
+ defineTool({
67
+ name: 'delete_sip_trunk',
68
+ endpoint: 'DELETE /v1/sip-trunks/{id}',
69
+ title: 'Delete a SIP trunk',
70
+ description: 'Remove a SIP trunk. Phone numbers on it can no longer make or take calls. Not reversible.',
71
+ input: { id },
72
+ annotations: annotate.destructive,
73
+ scope: 'sip_trunks:write',
74
+ handler: async (client, { id }) => {
75
+ await client.delete(`/v1/sip-trunks/${encodeURIComponent(id)}`);
76
+ return { deleted: true, id };
77
+ },
78
+ }),
79
+ defineTool({
80
+ name: 'check_sip_trunk_status',
81
+ endpoint: 'GET /v1/sip-trunks/{id}/status',
82
+ title: 'Check a SIP trunk',
83
+ description: 'Diagnose a trunk: Asterisk\'s own qualify result and a live network probe, side by side. Where they disagree is the diagnosis. ' +
84
+ 'A carrier that ignores unauthenticated OPTIONS shows probe.reachable false while Asterisk reports it healthy; that is normal. ' +
85
+ 'Read-only and free. Use this first when calls fail with carrier rejections.',
86
+ input: { id },
87
+ annotations: annotate.read,
88
+ scope: 'sip_trunks:read',
89
+ handler: (client, { id }) => client.get(`/v1/sip-trunks/${encodeURIComponent(id)}/status`),
90
+ }),
91
+ defineTool({
92
+ name: 'test_sip_trunk',
93
+ endpoint: 'POST /v1/sip-trunks/{id}/test',
94
+ title: 'Test a SIP trunk',
95
+ description: 'Send a TCP connect or unauthenticated SIP OPTIONS to the carrier from the platform and record the outcome on the trunk. ' +
96
+ 'Puts traffic on a third party. A negative result is not proof the trunk is broken: many carriers drop unauthenticated probes. Prefer check_sip_trunk_status.',
97
+ input: { id },
98
+ annotations: annotate.probe,
99
+ scope: 'sip_trunks:write',
100
+ handler: (client, { id }) => client.post(`/v1/sip-trunks/${encodeURIComponent(id)}/test`),
101
+ }),
102
+ defineTool({
103
+ name: 'get_sip_trunk_logs',
104
+ endpoint: 'GET /v1/sip-trunks/{id}/logs',
105
+ title: 'Recent SIP events',
106
+ description: 'The SIP engine\'s recent events for this account: registration, call setup, and carrier rejections with their cause. ' +
107
+ 'A live in-memory ring buffer, not an audit trail. Poll with since_id set to the last_id of the previous response to get only new entries.',
108
+ input: {
109
+ id,
110
+ since_id: z.number().int().optional().describe('Return only entries newer than this id.'),
111
+ limit: z.number().int().min(1).max(500).optional(),
112
+ },
113
+ annotations: annotate.read,
114
+ scope: 'sip_trunks:read',
115
+ handler: (client, { id, ...query }) => client.get(`/v1/sip-trunks/${encodeURIComponent(id)}/logs`, query),
116
+ }),
117
+ ];
118
+ //# sourceMappingURL=sip-trunks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sip-trunks.js","sourceRoot":"","sources":["../../src/tools/sip-trunks.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,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