@getdial/cli 0.13.2 → 0.15.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 (52) hide show
  1. package/README.md +15 -1
  2. package/dist/cli.js +5 -0
  3. package/dist/commands/call/get.js +28 -36
  4. package/dist/commands/call/list.js +20 -37
  5. package/dist/commands/call/send.js +52 -65
  6. package/dist/commands/doctor.js +2 -68
  7. package/dist/commands/mcp.js +17 -0
  8. package/dist/commands/message/list.js +20 -37
  9. package/dist/commands/message/send.js +22 -35
  10. package/dist/commands/number/list.js +21 -29
  11. package/dist/commands/number/purchase.js +23 -32
  12. package/dist/commands/number/set.js +19 -40
  13. package/dist/commands/onboard.js +36 -67
  14. package/dist/commands/signup.js +23 -24
  15. package/dist/commands/wait-for.js +33 -67
  16. package/dist/lib/cli-error.js +24 -0
  17. package/dist/lib/ops/account.js +136 -0
  18. package/dist/lib/ops/auth.js +18 -0
  19. package/dist/lib/ops/calls.js +33 -0
  20. package/dist/lib/ops/errors.js +23 -0
  21. package/dist/lib/ops/events.js +63 -0
  22. package/dist/lib/ops/listen.js +51 -0
  23. package/dist/lib/ops/local-targets.js +35 -0
  24. package/dist/lib/ops/messages.js +26 -0
  25. package/dist/lib/ops/numbers.js +39 -0
  26. package/dist/mcp/register.js +27 -0
  27. package/dist/mcp/result.js +16 -0
  28. package/dist/mcp/schemas.js +50 -0
  29. package/dist/mcp/server.js +20 -0
  30. package/dist/mcp/tool.js +1 -0
  31. package/dist/mcp/tools/add-command-target.js +27 -0
  32. package/dist/mcp/tools/add-url-target.js +30 -0
  33. package/dist/mcp/tools/get-account-status.js +22 -0
  34. package/dist/mcp/tools/get-call.js +18 -0
  35. package/dist/mcp/tools/index.js +41 -0
  36. package/dist/mcp/tools/list-calls.js +26 -0
  37. package/dist/mcp/tools/list-local-targets.js +15 -0
  38. package/dist/mcp/tools/list-messages.js +26 -0
  39. package/dist/mcp/tools/list-numbers.js +18 -0
  40. package/dist/mcp/tools/listen-install.js +19 -0
  41. package/dist/mcp/tools/listen-status.js +21 -0
  42. package/dist/mcp/tools/listen-uninstall.js +14 -0
  43. package/dist/mcp/tools/onboard.js +44 -0
  44. package/dist/mcp/tools/place-call.js +35 -0
  45. package/dist/mcp/tools/purchase-number.js +26 -0
  46. package/dist/mcp/tools/remove-local-target.js +20 -0
  47. package/dist/mcp/tools/send-message.js +26 -0
  48. package/dist/mcp/tools/set-number-properties.js +24 -0
  49. package/dist/mcp/tools/sign-up.js +22 -0
  50. package/dist/mcp/tools/wait-for-event.js +32 -0
  51. package/package.json +2 -1
  52. package/skills.tar.gz +0 -0
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { onboard } from "../../lib/ops/account.js";
4
+ const inputSchema = {
5
+ code: z.string().min(1).describe("6-digit OTP from the sign-up email"),
6
+ verificationId: z.string().optional().describe("Explicit verification id (defaults to the local pending signup)"),
7
+ inboundInstruction: z.string().optional().describe("System prompt for inbound calls to a newly provisioned number (new accounts)"),
8
+ agents: z.array(z.string()).optional().describe("Agent names to install the Dial skill into (e.g. claude-code, cursor)"),
9
+ };
10
+ export const onboardTool = {
11
+ name: "onboard",
12
+ config: {
13
+ title: "Onboard",
14
+ description: "Verify the sign-up OTP and finish onboarding: saves the API key locally and optionally installs " +
15
+ "the Dial skill into named agents. Returns the account summary (the raw API key is never returned).",
16
+ inputSchema,
17
+ outputSchema: {
18
+ apiKeyFingerprint: z.string().describe("Last 4 chars of the saved API key"),
19
+ apiKeyPath: z.string().describe("Where the key was saved"),
20
+ accountId: z.string(),
21
+ phoneNumber: z.string().nullable(),
22
+ phoneNumberId: z.string().nullable(),
23
+ skills: z.array(z.object({}).passthrough()).describe("Per-agent skill install results"),
24
+ supervisor: z.object({}).passthrough().describe("Listen daemon availability on this machine"),
25
+ listenAvailable: z.boolean(),
26
+ },
27
+ annotations: { openWorldHint: true },
28
+ },
29
+ run: async (args) => {
30
+ const r = await onboard({
31
+ code: args.code,
32
+ verificationId: args.verificationId,
33
+ inboundInstruction: args.inboundInstruction,
34
+ agents: args.agents,
35
+ });
36
+ // Never surface the raw API key to the model; it's saved to disk for the CLI to read.
37
+ const { apiKey: _omit, ...safe } = r;
38
+ void _omit;
39
+ return jsonResult({
40
+ ...safe,
41
+ listenAvailable: r.supervisor.available,
42
+ });
43
+ },
44
+ };
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { placeCall } from "../../lib/ops/calls.js";
4
+ import { callSchema } from "../schemas.js";
5
+ const inputSchema = {
6
+ to: z.string().min(7).describe("Destination phone number, E.164 (e.g. +14155550123)"),
7
+ outboundInstruction: z.string().min(1).describe("System prompt for the AI voice agent on this call"),
8
+ language: z.string().default("en-US").describe("BCP-47 language tag for the call"),
9
+ fromNumberId: z.string().optional().describe("Number id to call from; defaults to your primary number"),
10
+ };
11
+ export const placeCallTool = {
12
+ name: "place_call",
13
+ config: {
14
+ title: "Place AI Voice Call",
15
+ description: "Place an outbound voice call handled by an AI agent. The call runs asynchronously — " +
16
+ "use wait_for_event to block until it ends, then get_call for the transcript.",
17
+ inputSchema,
18
+ outputSchema: { call: callSchema, hint: z.string().describe("Next-step guidance for tracking the call") },
19
+ annotations: { openWorldHint: true },
20
+ },
21
+ run: async (args) => {
22
+ const call = await placeCall({
23
+ to: args.to,
24
+ outboundInstruction: args.outboundInstruction,
25
+ language: args.language ?? "en-US",
26
+ fromNumberId: args.fromNumberId,
27
+ });
28
+ return jsonResult({
29
+ call,
30
+ hint: `The call is now in progress. To be notified when it ends, call wait_for_event with ` +
31
+ `eventType "call.ended" and field "callId=${call.id}". Then call get_call with callId ` +
32
+ `"${call.id}" for the final status, duration, and transcript.`,
33
+ });
34
+ },
35
+ };
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { purchaseNumber } from "../../lib/ops/numbers.js";
4
+ import { phoneNumberSchema } from "../schemas.js";
5
+ const inputSchema = {
6
+ inboundInstruction: z.string().min(1).describe("System prompt for inbound calls to this number"),
7
+ country: z.string().optional().describe("ISO-3166-1 alpha-2 country code (defaults to US server-side)"),
8
+ areaCode: z.string().optional().describe("Preferred area code (US/CA)"),
9
+ };
10
+ export const purchaseNumberTool = {
11
+ name: "purchase_number",
12
+ config: {
13
+ title: "Purchase Phone Number",
14
+ description: "Purchase an additional phone number. This spends money on the account.",
15
+ inputSchema,
16
+ outputSchema: { number: phoneNumberSchema },
17
+ annotations: { destructiveHint: true, openWorldHint: true },
18
+ },
19
+ run: async (args) => jsonResult({
20
+ number: await purchaseNumber({
21
+ inboundInstruction: args.inboundInstruction,
22
+ country: args.country,
23
+ areaCode: args.areaCode,
24
+ }),
25
+ }),
26
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { removeLocalTarget } from "../../lib/ops/local-targets.js";
4
+ const inputSchema = {
5
+ id: z.string().min(1).describe("Target id: the URL for url targets, the path for cmd targets"),
6
+ };
7
+ export const removeLocalTargetTool = {
8
+ name: "remove_local_target",
9
+ config: {
10
+ title: "Remove Fan-out Target",
11
+ description: "Unregister a local fan-out target by id. Returns removed:false if no such target.",
12
+ inputSchema,
13
+ outputSchema: {
14
+ removed: z.boolean().describe("False if no target matched the id"),
15
+ id: z.string(),
16
+ },
17
+ annotations: { destructiveHint: true },
18
+ },
19
+ run: async (args) => jsonResult(removeLocalTarget(args.id)),
20
+ };
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { sendMessage } from "../../lib/ops/messages.js";
4
+ import { messageSchema } from "../schemas.js";
5
+ const inputSchema = {
6
+ to: z.string().min(7).describe("Destination phone number, E.164 (e.g. +14155550123)"),
7
+ body: z.string().min(1).describe("Message body"),
8
+ fromNumberId: z.string().optional().describe("Number id to send from; defaults to your primary number"),
9
+ };
10
+ export const sendMessageTool = {
11
+ name: "send_message",
12
+ config: {
13
+ title: "Send SMS",
14
+ description: "Send an SMS from one of your Dial numbers.",
15
+ inputSchema,
16
+ outputSchema: { message: messageSchema },
17
+ annotations: { openWorldHint: true },
18
+ },
19
+ run: async (args) => jsonResult({
20
+ message: await sendMessage({
21
+ to: args.to,
22
+ body: args.body,
23
+ fromNumberId: args.fromNumberId,
24
+ }),
25
+ }),
26
+ };
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { setNumberProperties } from "../../lib/ops/numbers.js";
4
+ import { phoneNumberSchema } from "../schemas.js";
5
+ const inputSchema = {
6
+ number: z.string().min(7).describe("The E.164 phone number to update (e.g. +14155550123)"),
7
+ inboundInstruction: z.string().min(1).describe("New system prompt for inbound calls to this number"),
8
+ };
9
+ export const setNumberPropertiesTool = {
10
+ name: "set_number_properties",
11
+ config: {
12
+ title: "Set Number Properties",
13
+ description: "Update a phone number's inbound instruction (the system prompt for inbound calls).",
14
+ inputSchema,
15
+ outputSchema: { number: phoneNumberSchema },
16
+ annotations: { openWorldHint: true },
17
+ },
18
+ run: async (args) => jsonResult({
19
+ number: await setNumberProperties({
20
+ number: args.number,
21
+ inboundInstruction: args.inboundInstruction,
22
+ }),
23
+ }),
24
+ };
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { signup } from "../../lib/ops/account.js";
4
+ const inputSchema = {
5
+ email: z.string().email().describe("Email address to send the sign-up OTP to"),
6
+ force: z.boolean().optional().describe("Overwrite an existing fresh pending signup"),
7
+ };
8
+ export const signUpTool = {
9
+ name: "sign_up",
10
+ config: {
11
+ title: "Sign Up",
12
+ description: "Request an email OTP for a Dial account. The code is emailed; finish with the onboard tool. " +
13
+ "Stores the pending verification locally.",
14
+ inputSchema,
15
+ outputSchema: {
16
+ verificationId: z.string().describe("Pending verification id (also stored locally)"),
17
+ email: z.string(),
18
+ },
19
+ annotations: { openWorldHint: true },
20
+ },
21
+ run: async (args) => jsonResult(await signup({ email: args.email, force: args.force })),
22
+ };
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { waitForEvent } from "../../lib/ops/events.js";
4
+ import { eventSchema } from "../schemas.js";
5
+ const inputSchema = {
6
+ eventType: z.string().min(1).describe('Event type to wait for (e.g. "call.ended", "message.received")'),
7
+ field: z.array(z.string()).optional().describe('Exact-match filters, each "name=value" (e.g. "callId=abc")'),
8
+ regex: z.array(z.string()).optional().describe('Regex filters, each "name=pattern" (/re/flags or a bare regex)'),
9
+ timeoutSeconds: z.number().default(30).describe("How long to wait before giving up"),
10
+ };
11
+ export const waitForEventTool = {
12
+ name: "wait_for_event",
13
+ config: {
14
+ title: "Wait For Event",
15
+ description: "Block until a matching account event arrives. Reads the local listen log when the daemon " +
16
+ "is running, otherwise long-polls the REST API. Returns the event, or a timeout result.",
17
+ inputSchema,
18
+ outputSchema: {
19
+ source: z.string().nullable().describe('"log", "api", or null when nothing matched'),
20
+ timedOut: z.boolean(),
21
+ event: eventSchema.nullable(),
22
+ line: z.string().nullable().describe("Raw matched event line, when available"),
23
+ },
24
+ annotations: { readOnlyHint: true, openWorldHint: true },
25
+ },
26
+ run: async (args) => jsonResult(await waitForEvent({
27
+ eventType: args.eventType,
28
+ fields: args.field ?? [],
29
+ regexes: args.regex ?? [],
30
+ timeoutSeconds: args.timeoutSeconds ?? 30,
31
+ })),
32
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getdial/cli",
3
- "version": "0.13.2",
3
+ "version": "0.15.0",
4
4
  "description": "Dial CLI — install, sign up, and run the local listen service.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,6 +32,7 @@
32
32
  "prepack": "npm run build && npm run build:skill"
33
33
  },
34
34
  "dependencies": {
35
+ "@modelcontextprotocol/sdk": "^1.29.0",
35
36
  "commander": "^14.0.3",
36
37
  "pino": "^10.3.1",
37
38
  "pino-pretty": "^13.1.3",
package/skills.tar.gz CHANGED
Binary file