@getdial/cli 0.13.1 → 0.14.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 +13 -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/lib/supervisor/systemd.js +7 -23
  27. package/dist/mcp/register.js +27 -0
  28. package/dist/mcp/result.js +6 -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 +22 -0
  32. package/dist/mcp/tools/add-url-target.js +26 -0
  33. package/dist/mcp/tools/get-account-status.js +13 -0
  34. package/dist/mcp/tools/get-call.js +16 -0
  35. package/dist/mcp/tools/index.js +41 -0
  36. package/dist/mcp/tools/list-calls.js +22 -0
  37. package/dist/mcp/tools/list-local-targets.js +12 -0
  38. package/dist/mcp/tools/list-messages.js +22 -0
  39. package/dist/mcp/tools/list-numbers.js +12 -0
  40. package/dist/mcp/tools/listen-install.js +13 -0
  41. package/dist/mcp/tools/listen-status.js +12 -0
  42. package/dist/mcp/tools/listen-uninstall.js +12 -0
  43. package/dist/mcp/tools/onboard.js +34 -0
  44. package/dist/mcp/tools/place-call.js +33 -0
  45. package/dist/mcp/tools/purchase-number.js +22 -0
  46. package/dist/mcp/tools/remove-local-target.js +16 -0
  47. package/dist/mcp/tools/send-message.js +22 -0
  48. package/dist/mcp/tools/set-number-properties.js +20 -0
  49. package/dist/mcp/tools/sign-up.js +18 -0
  50. package/dist/mcp/tools/wait-for-event.js +25 -0
  51. package/package.json +2 -1
  52. package/skills.tar.gz +0 -0
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { purchaseNumber } from "../../lib/ops/numbers.js";
4
+ const inputSchema = {
5
+ inboundInstruction: z.string().min(1).describe("System prompt for inbound calls to this number"),
6
+ country: z.string().optional().describe("ISO-3166-1 alpha-2 country code (defaults to US server-side)"),
7
+ areaCode: z.string().optional().describe("Preferred area code (US/CA)"),
8
+ };
9
+ export const purchaseNumberTool = {
10
+ name: "purchase_number",
11
+ config: {
12
+ title: "Purchase Phone Number",
13
+ description: "Purchase an additional phone number. This spends money on the account.",
14
+ inputSchema,
15
+ annotations: { destructiveHint: true, openWorldHint: true },
16
+ },
17
+ run: async (args) => jsonResult(await purchaseNumber({
18
+ inboundInstruction: args.inboundInstruction,
19
+ country: args.country,
20
+ areaCode: args.areaCode,
21
+ })),
22
+ };
@@ -0,0 +1,16 @@
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
+ annotations: { destructiveHint: true },
14
+ },
15
+ run: async (args) => jsonResult(removeLocalTarget(args.id)),
16
+ };
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { sendMessage } from "../../lib/ops/messages.js";
4
+ const inputSchema = {
5
+ to: z.string().min(7).describe("Destination phone number, E.164 (e.g. +14155550123)"),
6
+ body: z.string().min(1).describe("Message body"),
7
+ fromNumberId: z.string().optional().describe("Number id to send from; defaults to your primary number"),
8
+ };
9
+ export const sendMessageTool = {
10
+ name: "send_message",
11
+ config: {
12
+ title: "Send SMS",
13
+ description: "Send an SMS from one of your Dial numbers.",
14
+ inputSchema,
15
+ annotations: { openWorldHint: true },
16
+ },
17
+ run: async (args) => jsonResult(await sendMessage({
18
+ to: args.to,
19
+ body: args.body,
20
+ fromNumberId: args.fromNumberId,
21
+ })),
22
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { setNumberProperties } from "../../lib/ops/numbers.js";
4
+ const inputSchema = {
5
+ number: z.string().min(7).describe("The E.164 phone number to update (e.g. +14155550123)"),
6
+ inboundInstruction: z.string().min(1).describe("New system prompt for inbound calls to this number"),
7
+ };
8
+ export const setNumberPropertiesTool = {
9
+ name: "set_number_properties",
10
+ config: {
11
+ title: "Set Number Properties",
12
+ description: "Update a phone number's inbound instruction (the system prompt for inbound calls).",
13
+ inputSchema,
14
+ annotations: { openWorldHint: true },
15
+ },
16
+ run: async (args) => jsonResult(await setNumberProperties({
17
+ number: args.number,
18
+ inboundInstruction: args.inboundInstruction,
19
+ })),
20
+ };
@@ -0,0 +1,18 @@
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
+ annotations: { openWorldHint: true },
16
+ },
17
+ run: async (args) => jsonResult(await signup({ email: args.email, force: args.force })),
18
+ };
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import { jsonResult } from "../result.js";
3
+ import { waitForEvent } from "../../lib/ops/events.js";
4
+ const inputSchema = {
5
+ eventType: z.string().min(1).describe('Event type to wait for (e.g. "call.ended", "message.received")'),
6
+ field: z.array(z.string()).optional().describe('Exact-match filters, each "name=value" (e.g. "callId=abc")'),
7
+ regex: z.array(z.string()).optional().describe('Regex filters, each "name=pattern" (/re/flags or a bare regex)'),
8
+ timeoutSeconds: z.number().default(30).describe("How long to wait before giving up"),
9
+ };
10
+ export const waitForEventTool = {
11
+ name: "wait_for_event",
12
+ config: {
13
+ title: "Wait For Event",
14
+ description: "Block until a matching account event arrives. Reads the local listen log when the daemon " +
15
+ "is running, otherwise long-polls the REST API. Returns the event, or a timeout result.",
16
+ inputSchema,
17
+ annotations: { readOnlyHint: true, openWorldHint: true },
18
+ },
19
+ run: async (args) => jsonResult(await waitForEvent({
20
+ eventType: args.eventType,
21
+ fields: args.field ?? [],
22
+ regexes: args.regex ?? [],
23
+ timeoutSeconds: args.timeoutSeconds ?? 30,
24
+ })),
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getdial/cli",
3
- "version": "0.13.1",
3
+ "version": "0.14.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