@getdial/cli 0.40.0 → 0.41.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/dist/cli.js CHANGED
@@ -216,6 +216,8 @@ number
216
216
  return n;
217
217
  })
218
218
  .option("--clear-max-call-duration", "remove the per-number call duration cap")
219
+ .option("--channel <imessage|whatsapp|both>", 'which display profile(s) --name and --avatar are written to; "both" sets one identity on every channel the number has, in a single call. Cannot be combined with --first-name/--last-name/--whatsapp-name/--whatsapp-avatar')
220
+ .option("--name <text>", 'display name for --channel (required alongside it); WhatsApp stores it verbatim (1-25 chars), iMessage splits it on the first space ("Maya Chen" -> Maya / Chen)')
219
221
  .option("--first-name <text>", 'iMessage display first name shown beside this number\'s messages (iMessage numbers only); pass "" to clear')
220
222
  .option("--last-name <text>", 'iMessage display last name (iMessage numbers only); pass "" to clear')
221
223
  .option("--avatar <path-or-url>", "iMessage avatar photo (iMessage numbers only): a local image file (jpeg/png/gif/webp, max 5 MB) to upload, or a public image URL to fetch. Replaces the current photo; photos can't be removed")
@@ -238,6 +240,8 @@ number
238
240
  inboundLanguage: opts.inboundLanguage,
239
241
  nickname: opts.nickname,
240
242
  maxCallDurationSeconds,
243
+ channel: opts.channel,
244
+ name: opts.name,
241
245
  firstName: opts.firstName,
242
246
  lastName: opts.lastName,
243
247
  avatar: opts.avatar,
@@ -14,6 +14,8 @@ export async function runNumberSet(opts) {
14
14
  ...(opts.maxCallDurationSeconds !== undefined
15
15
  ? { maxCallDurationSeconds: opts.maxCallDurationSeconds }
16
16
  : {}),
17
+ ...(opts.channel !== undefined ? { channel: opts.channel } : {}),
18
+ ...(opts.name !== undefined ? { name: opts.name } : {}),
17
19
  ...(opts.firstName !== undefined ? { firstName: opts.firstName } : {}),
18
20
  ...(opts.lastName !== undefined ? { lastName: opts.lastName } : {}),
19
21
  ...(opts.avatar !== undefined ? { avatar: opts.avatar } : {}),
@@ -117,6 +117,10 @@ export async function setNumberProperties(opts) {
117
117
  body.nickname = opts.nickname;
118
118
  if (opts.maxCallDurationSeconds !== undefined)
119
119
  body.maxCallDurationSeconds = opts.maxCallDurationSeconds;
120
+ if (opts.channel !== undefined)
121
+ body.channel = opts.channel;
122
+ if (opts.name !== undefined)
123
+ body.name = opts.name;
120
124
  if (opts.firstName !== undefined)
121
125
  body.firstName = opts.firstName;
122
126
  if (opts.lastName !== undefined)
@@ -137,7 +141,7 @@ export async function setNumberProperties(opts) {
137
141
  if (opts.whatsappAvatar !== undefined && !whatsappAvatarFile)
138
142
  body.whatsappAvatarUrl = opts.whatsappAvatar;
139
143
  if (Object.keys(body).length === 0 && !avatarFile && !whatsappAvatarFile) {
140
- throw new DialError("bad_request", "Provide at least one property to update (inboundInstruction, inboundVoiceGender, inboundLanguage, nickname, maxCallDurationSeconds, calling, firstName, lastName, avatar, whatsappName, or whatsappAvatar).");
144
+ throw new DialError("bad_request", "Provide at least one property to update (inboundInstruction, inboundVoiceGender, inboundLanguage, nickname, maxCallDurationSeconds, calling, channel with name/avatar, firstName, lastName, avatar, whatsappName, or whatsappAvatar).");
141
145
  }
142
146
  const auth = maybeAuth();
143
147
  // The REST API keys numbers by id; the CLI/tool takes the E.164 number for ergonomics,
@@ -38,7 +38,7 @@ const inputSchema = {
38
38
  forceAudioFile: z
39
39
  .boolean()
40
40
  .optional()
41
- .describe("Send an audio attachment as a regular file attachment instead of an iMessage voice message. No effect on standard numbers or non-audio media."),
41
+ .describe("Send a lone audio attachment as a regular file instead of a voice message — an iMessage voice message on iMessage numbers, a WhatsApp voice note on WhatsApp numbers. No effect on standard numbers or non-audio media."),
42
42
  };
43
43
  export const sendMessageTool = {
44
44
  name: "send_message",
@@ -47,7 +47,8 @@ export const sendMessageTool = {
47
47
  description: "Send a message from one of your Dial numbers — to a phone number, or into a group conversation — " +
48
48
  "optionally with media attachments (MMS). On an iMessage number, a single audio attachment is " +
49
49
  "delivered as a voice message unless forceAudioFile is true. " +
50
- "Address it with exactly one of to or groupId. WhatsApp sends are text-only.",
50
+ "Address it with exactly one of to or groupId. A WhatsApp number sends text and a single " +
51
+ "attachment (a caption is allowed only with an image or video).",
51
52
  inputSchema,
52
53
  outputSchema: { message: messageSchema },
53
54
  annotations: { openWorldHint: true },
@@ -29,6 +29,15 @@ const inputSchema = {
29
29
  .nullable()
30
30
  .optional()
31
31
  .describe("Call duration cap for this number, in seconds, applied as a hard ceiling to both inbound and outbound calls (the smallest of the per-number, account, and per-call caps wins). On a free account (no top-up or subscription yet) a value above 300 is rejected with 400. Pass null to clear the cap; omit to leave it unchanged."),
32
+ channel: z
33
+ .enum(["imessage", "whatsapp", "both"])
34
+ .optional()
35
+ .describe('Which display profile(s) `name` and `avatarUrl` are written to: "imessage", "whatsapp", or "both". Use this when the number should present the same identity everywhere — one call instead of two, validated against every targeted channel before any of them is written, so the profiles cannot drift apart. Cannot be combined with firstName/lastName/whatsappName/whatsappAvatarUrl.'),
36
+ name: z
37
+ .string()
38
+ .min(1)
39
+ .optional()
40
+ .describe('The display name to set on the channel(s) `channel` names; requires `channel`. WhatsApp stores it verbatim (1-25 chars); iMessage has no single-name field, so it is split on the first space — "Ana Lee" becomes firstName "Ana", lastName "Lee".'),
32
41
  firstName: z
33
42
  .string()
34
43
  .max(30)
@@ -62,7 +71,7 @@ export const setNumberPropertiesTool = {
62
71
  name: "set_number_properties",
63
72
  config: {
64
73
  title: "Set Number Properties",
65
- description: "Update a phone number's properties: its inbound instruction (the system prompt for inbound calls), inbound voice gender, inbound language, nickname, whether calling is switched on at all (callingEnabled), and for iMessage numbers its display identity (firstName, lastName, avatarUrl), and for WhatsApp-ready numbers its WhatsApp identity (whatsappName, whatsappAvatarUrl). Provide at least one.",
74
+ description: 'Update a phone number\'s properties: its inbound instruction (the system prompt for inbound calls), inbound voice gender, inbound language, nickname, whether calling is switched on at all (callingEnabled), and its display identity. For the display identity prefer `channel` ("imessage", "whatsapp", or "both") with `name`/`avatarUrl` — one call that keeps every channel\'s profile identical. The per-channel fields remain for when the profiles differ: firstName/lastName/avatarUrl for iMessage, whatsappName/whatsappAvatarUrl for WhatsApp-ready numbers. Provide at least one property, and don\'t mix `channel` with the per-channel fields.',
66
75
  inputSchema,
67
76
  outputSchema: { number: phoneNumberSchema },
68
77
  annotations: { openWorldHint: true },
@@ -81,6 +90,8 @@ export const setNumberPropertiesTool = {
81
90
  ...(args.maxCallDurationSeconds !== undefined
82
91
  ? { maxCallDurationSeconds: args.maxCallDurationSeconds }
83
92
  : {}),
93
+ ...(args.channel !== undefined ? { channel: args.channel } : {}),
94
+ ...(args.name !== undefined ? { name: args.name } : {}),
84
95
  ...(args.firstName !== undefined ? { firstName: args.firstName } : {}),
85
96
  ...(args.whatsappName !== undefined ? { whatsappName: args.whatsappName } : {}),
86
97
  ...(args.callingEnabled !== undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getdial/cli",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "Dial CLI — install, sign up, and run the local listen service.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/skills.tar.gz CHANGED
Binary file