@getdial/cli 0.16.0 → 0.18.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 +1 -1
- package/dist/lib/event-filter.js +5 -2
- package/dist/lib/ops/calls.js +6 -1
- package/dist/mcp/tools/place-call.js +2 -2
- package/package.json +1 -1
- package/skills.tar.gz +0 -0
package/dist/cli.js
CHANGED
|
@@ -143,7 +143,7 @@ const call = program
|
|
|
143
143
|
.description("Place an outbound voice call. POST /api/v1/calls.")
|
|
144
144
|
.option("--to <e164>", "destination phone number, E.164 (e.g. +14155551234)")
|
|
145
145
|
.option("--outbound-instruction <text>", "system prompt for the agent that will speak")
|
|
146
|
-
.option("--language <bcp47>", "BCP-47 language tag for the call
|
|
146
|
+
.option("--language <bcp47>", "BCP-47 language tag for the call (default: auto-detect from the destination number's country, alongside en-US)")
|
|
147
147
|
.option("--from-number-id <id>", "phoneNumberId to call from (defaults to onboard's number)")
|
|
148
148
|
.option("--json", "machine-readable output")
|
|
149
149
|
.action(async (opts) => {
|
package/dist/lib/event-filter.js
CHANGED
|
@@ -21,12 +21,15 @@ export function matches(obj, spec) {
|
|
|
21
21
|
const record = obj;
|
|
22
22
|
if (record.type !== spec.eventType)
|
|
23
23
|
return false;
|
|
24
|
+
// Field/regex filters address the event's `data` payload by name, e.g.
|
|
25
|
+
// `-f channel=sms` matches event.data.channel.
|
|
26
|
+
const data = (record.data ?? {});
|
|
24
27
|
for (const f of spec.fields) {
|
|
25
|
-
if (String(
|
|
28
|
+
if (String(data[f.name] ?? "") !== f.value)
|
|
26
29
|
return false;
|
|
27
30
|
}
|
|
28
31
|
for (const r of spec.regexes) {
|
|
29
|
-
if (!r.regex.test(String(
|
|
32
|
+
if (!r.regex.test(String(data[r.name] ?? "")))
|
|
30
33
|
return false;
|
|
31
34
|
}
|
|
32
35
|
return true;
|
package/dist/lib/ops/calls.js
CHANGED
|
@@ -4,7 +4,12 @@ import { DialError } from "./errors.js";
|
|
|
4
4
|
export async function placeCall(opts) {
|
|
5
5
|
const auth = requireAuth();
|
|
6
6
|
const fromNumberId = requireFromNumberId(auth, opts.fromNumberId);
|
|
7
|
-
const res = await apiPost("/api/v1/calls", {
|
|
7
|
+
const res = await apiPost("/api/v1/calls", {
|
|
8
|
+
to: opts.to,
|
|
9
|
+
fromNumberId,
|
|
10
|
+
outboundInstruction: opts.outboundInstruction,
|
|
11
|
+
...(opts.language && { language: opts.language }),
|
|
12
|
+
}, auth.apiKey);
|
|
8
13
|
if (!res.ok)
|
|
9
14
|
throw new DialError("call_failed", res.error, res.status);
|
|
10
15
|
return res.data.call;
|
|
@@ -5,7 +5,7 @@ import { callSchema } from "../schemas.js";
|
|
|
5
5
|
const inputSchema = {
|
|
6
6
|
to: z.string().min(7).describe("Destination phone number, E.164 (e.g. +14155550123)"),
|
|
7
7
|
outboundInstruction: z.string().min(1).describe("System prompt for the AI voice agent on this call"),
|
|
8
|
-
language: z.string().
|
|
8
|
+
language: z.string().optional().describe("BCP-47 language tag for the call. Omit to auto-detect from the destination number's country (alongside en-US)."),
|
|
9
9
|
fromNumberId: z.string().optional().describe("Number id to call from; defaults to your primary number"),
|
|
10
10
|
};
|
|
11
11
|
export const placeCallTool = {
|
|
@@ -22,7 +22,7 @@ export const placeCallTool = {
|
|
|
22
22
|
const call = await placeCall({
|
|
23
23
|
to: args.to,
|
|
24
24
|
outboundInstruction: args.outboundInstruction,
|
|
25
|
-
language: args.language
|
|
25
|
+
language: args.language,
|
|
26
26
|
fromNumberId: args.fromNumberId,
|
|
27
27
|
});
|
|
28
28
|
return jsonResult({
|
package/package.json
CHANGED
package/skills.tar.gz
CHANGED
|
Binary file
|