@mosadd/mcp 3.0.0-alpha.47 → 3.0.0-alpha.49
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/bin/mcp.js +1 -1
- package/dist/{chunk-XTQMZ6K7.js → chunk-MGF7BV3M.js} +41 -23
- package/dist/index.js +1 -1
- package/package.json +73 -73
- package/src/__tests__/knowledge-ingest.test.ts +114 -114
- package/src/__tests__/presence.test.ts +190 -190
- package/src/__tests__/serverJsonVersion.test.ts +45 -45
- package/src/providers/supabase.ts +231 -231
- package/src/server.ts +162 -162
- package/src/tools/__tests__/ragDeleteFoldsSourceId.test.ts +67 -67
- package/src/tools/knowledge-graph.ts +186 -186
- package/src/tools/mail-agentbox.ts +155 -155
- package/src/tools/mcall.ts +216 -216
- package/src/tools/mdm-as-agent.ts +126 -126
- package/src/tools/mdm-voice.ts +220 -220
- package/src/tools/mdm.ts +495 -494
- package/src/tools/mirc-messages.ts +186 -185
- package/src/tools/murl.ts +314 -314
- package/src/tools/presence.ts +442 -414
- package/src/tools/ptt-ingest.ts +99 -99
- package/src/tools/threat.ts +123 -123
- package/src/tools/voice-format.ts +28 -0
- package/src/version.ts +8 -8
- package/LICENSE +0 -201
- package/dist/bin/login.d.ts +0 -13
- package/dist/bin/mcp.d.ts +0 -1
- package/dist/index.d.ts +0 -310
package/src/tools/mcall.ts
CHANGED
|
@@ -1,216 +1,216 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mCALL — Outbound PSTN calls.
|
|
3
|
-
*
|
|
4
|
-
* Place a real phone call (E.164) from an agent. Control plane is MCP; audio
|
|
5
|
-
* never flows through the tool call — it is bridged over LiveKit SIP (primary)
|
|
6
|
-
* or a Telnyx fallback to the carrier, with an optional voice vocoder.
|
|
7
|
-
*
|
|
8
|
-
* Wired to the m0ssad-3 `call-start-pstn` / `call-end-pstn` Edge Functions
|
|
9
|
-
* (deployed). A carrier must be wired server-side (LIVEKIT_SIP_TRUNK_ID, or
|
|
10
|
-
* TELNYX_API_KEY + TELNYX_CONNECTION_ID + TELNYX_FROM_NUMBER); until then the
|
|
11
|
-
* call session is created and metered but no audio leg is bridged.
|
|
12
|
-
*
|
|
13
|
-
* NOTE: mCALL is the telephone (PSTN). For 1:1 in-app voice use mDM; for
|
|
14
|
-
* walkie-talkie / floor-controlled voice use mTALK.
|
|
15
|
-
*
|
|
16
|
-
* Burner numbers: mCALL_acquire_number leases an ephemeral DID (~10 min) that
|
|
17
|
-
* becomes your outbound caller-ID and can receive inbound calls. Inbound rings
|
|
18
|
-
* are delivered out-of-band (Supabase Realtime broadcast on
|
|
19
|
-
* `mcall-inbound-<identity_id>`, or an integrator webhook) carrying a room_name;
|
|
20
|
-
* mCALL_answer mints the LiveKit token to join and bridge that call. Pair with
|
|
21
|
-
* the `vocoder` flag / a published vocoder track to mask the caller's voice.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import { z } from "zod";
|
|
25
|
-
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
26
|
-
import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
|
|
27
|
-
|
|
28
|
-
// ---- Schemas ----
|
|
29
|
-
|
|
30
|
-
const E164 = z
|
|
31
|
-
.string()
|
|
32
|
-
.regex(/^\+\d{7,15}$/)
|
|
33
|
-
.describe("Destination phone number in E.164 format, e.g. +14155550123.");
|
|
34
|
-
|
|
35
|
-
const mCALL_start_pstn_input = z.object({
|
|
36
|
-
to: E164,
|
|
37
|
-
vocoder: z
|
|
38
|
-
.boolean()
|
|
39
|
-
.optional()
|
|
40
|
-
.describe("Disguise the caller's voice with a vocoder (anonymous calling). Default false."),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const mCALL_end_pstn_input = z.object({
|
|
44
|
-
session_id: z.string().min(1).describe("Session id returned by mCALL_start_pstn."),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// ---- Burner (ephemeral number) schemas ----
|
|
48
|
-
|
|
49
|
-
const mCALL_acquire_number_input = z.object({}).describe(
|
|
50
|
-
"No parameters. Leases the next available number for ~10 minutes (idempotent: returns your live lease if you already hold one).",
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
const mCALL_my_numbers_input = z.object({}).describe("No parameters.");
|
|
54
|
-
|
|
55
|
-
const mCALL_extend_number_input = z.object({
|
|
56
|
-
number_id: z
|
|
57
|
-
.string()
|
|
58
|
-
.optional()
|
|
59
|
-
.describe("Pool id of the number to extend. Omit to extend your current lease."),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const mCALL_release_number_input = z.object({
|
|
63
|
-
number_id: z
|
|
64
|
-
.string()
|
|
65
|
-
.optional()
|
|
66
|
-
.describe("Pool id of the number to release. Omit to release all numbers you hold."),
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const mCALL_answer_input = z.object({
|
|
70
|
-
room_name: z
|
|
71
|
-
.string()
|
|
72
|
-
.min(1)
|
|
73
|
-
.describe("room_name from an inbound_call event (Realtime broadcast / integrator webhook)."),
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// ---- Handlers ----
|
|
77
|
-
|
|
78
|
-
async function mCALL_start_pstn(
|
|
79
|
-
input: z.infer<typeof mCALL_start_pstn_input>,
|
|
80
|
-
ctx: MosaddToolContext,
|
|
81
|
-
): Promise<{
|
|
82
|
-
session_id: string;
|
|
83
|
-
room_name: string;
|
|
84
|
-
destination_number: string;
|
|
85
|
-
vocoder_enabled: boolean;
|
|
86
|
-
minutes_remaining: number;
|
|
87
|
-
zone: string;
|
|
88
|
-
zone_label: string;
|
|
89
|
-
}> {
|
|
90
|
-
readSupabaseEnv();
|
|
91
|
-
ctx.log("debug", "mCALL_start_pstn invoking call-start-pstn", { to: input.to });
|
|
92
|
-
return await invokeFunction("call-start-pstn", {
|
|
93
|
-
destination_number: input.to,
|
|
94
|
-
vocoder_enabled: input.vocoder ?? false,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
async function mCALL_end_pstn(
|
|
99
|
-
input: z.infer<typeof mCALL_end_pstn_input>,
|
|
100
|
-
ctx: MosaddToolContext,
|
|
101
|
-
): Promise<{ duration_ms: number; cost_credits: number }> {
|
|
102
|
-
readSupabaseEnv();
|
|
103
|
-
ctx.log("debug", "mCALL_end_pstn invoking call-end-pstn", { session_id: input.session_id });
|
|
104
|
-
return await invokeFunction("call-end-pstn", { session_id: input.session_id });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// ---- Burner (ephemeral number) handlers ----
|
|
108
|
-
|
|
109
|
-
interface AcquiredNumber {
|
|
110
|
-
did: { id: string; phone_number: string; hold_until: string | null };
|
|
111
|
-
reused: boolean;
|
|
112
|
-
hold_until: string;
|
|
113
|
-
seconds_remaining: number;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async function mCALL_acquire_number(
|
|
117
|
-
_input: z.infer<typeof mCALL_acquire_number_input>,
|
|
118
|
-
ctx: MosaddToolContext,
|
|
119
|
-
): Promise<AcquiredNumber> {
|
|
120
|
-
readSupabaseEnv();
|
|
121
|
-
ctx.log("debug", "mCALL_acquire_number invoking call-did-pool acquire");
|
|
122
|
-
return await invokeFunction("call-did-pool", { action: "acquire" });
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
async function mCALL_my_numbers(
|
|
126
|
-
_input: z.infer<typeof mCALL_my_numbers_input>,
|
|
127
|
-
ctx: MosaddToolContext,
|
|
128
|
-
): Promise<{ numbers: Array<{ id: string; phone_number: string; seconds_remaining: number | null }> }> {
|
|
129
|
-
readSupabaseEnv();
|
|
130
|
-
ctx.log("debug", "mCALL_my_numbers invoking call-did-pool mine");
|
|
131
|
-
return await invokeFunction("call-did-pool", { action: "mine" });
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
async function mCALL_extend_number(
|
|
135
|
-
input: z.infer<typeof mCALL_extend_number_input>,
|
|
136
|
-
ctx: MosaddToolContext,
|
|
137
|
-
): Promise<{ did: unknown; hold_until: string; seconds_remaining: number }> {
|
|
138
|
-
readSupabaseEnv();
|
|
139
|
-
ctx.log("debug", "mCALL_extend_number invoking call-did-pool extend", { number_id: input.number_id });
|
|
140
|
-
return await invokeFunction("call-did-pool", { action: "extend", did_id: input.number_id });
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
async function mCALL_release_number(
|
|
144
|
-
input: z.infer<typeof mCALL_release_number_input>,
|
|
145
|
-
ctx: MosaddToolContext,
|
|
146
|
-
): Promise<{ released: number; dids: unknown[] }> {
|
|
147
|
-
readSupabaseEnv();
|
|
148
|
-
ctx.log("debug", "mCALL_release_number invoking call-did-pool release_mine", { number_id: input.number_id });
|
|
149
|
-
return await invokeFunction("call-did-pool", { action: "release_mine", did_id: input.number_id });
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
async function mCALL_answer(
|
|
153
|
-
input: z.infer<typeof mCALL_answer_input>,
|
|
154
|
-
ctx: MosaddToolContext,
|
|
155
|
-
): Promise<{ token: string; url: string; roomName: string; identity: string }> {
|
|
156
|
-
readSupabaseEnv();
|
|
157
|
-
ctx.log("debug", "mCALL_answer minting livekit token", { room_name: input.room_name });
|
|
158
|
-
return await invokeFunction("livekit-token", { roomName: input.room_name });
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// ---- Registration ----
|
|
162
|
-
|
|
163
|
-
export const mcallTools: MosaddTool[] = [
|
|
164
|
-
{
|
|
165
|
-
name: "mCALL_start_pstn",
|
|
166
|
-
requires: "network",
|
|
167
|
-
description:
|
|
168
|
-
"Place an outbound PSTN phone call to an E.164 number. Bridges audio over an encrypted SIP relay (LiveKit SIP / Telnyx); optional voice vocoder for anonymous calling. Returns session_id, room_name, zone + per-minute cost, and minutes_remaining. Requires PSTN minutes in the wallet.",
|
|
169
|
-
inputSchema: mCALL_start_pstn_input,
|
|
170
|
-
handler: mCALL_start_pstn as MosaddTool["handler"],
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: "mCALL_end_pstn",
|
|
174
|
-
requires: "network",
|
|
175
|
-
description: "End an active PSTN call by session_id. Returns call duration and credits spent.",
|
|
176
|
-
inputSchema: mCALL_end_pstn_input,
|
|
177
|
-
handler: mCALL_end_pstn as MosaddTool["handler"],
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
name: "mCALL_acquire_number",
|
|
181
|
-
requires: "network",
|
|
182
|
-
description:
|
|
183
|
-
"Lease an ephemeral 'burner' phone number for ~10 minutes. While held, it is presented as your caller-ID on mCALL_start_pstn and can receive inbound calls; it auto-recycles when the lease lapses (unless on a live call). Idempotent — returns your existing lease if you already hold one. Returns the number, hold_until and seconds_remaining.",
|
|
184
|
-
inputSchema: mCALL_acquire_number_input,
|
|
185
|
-
handler: mCALL_acquire_number as MosaddTool["handler"],
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
name: "mCALL_my_numbers",
|
|
189
|
-
requires: "network",
|
|
190
|
-
description: "List the ephemeral numbers currently leased to you, each with its seconds_remaining.",
|
|
191
|
-
inputSchema: mCALL_my_numbers_input,
|
|
192
|
-
handler: mCALL_my_numbers as MosaddTool["handler"],
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
name: "mCALL_extend_number",
|
|
196
|
-
requires: "network",
|
|
197
|
-
description: "Extend the lease on a held ephemeral number by another ~10 minutes (by number_id, or your current lease).",
|
|
198
|
-
inputSchema: mCALL_extend_number_input,
|
|
199
|
-
handler: mCALL_extend_number as MosaddTool["handler"],
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
name: "mCALL_release_number",
|
|
203
|
-
requires: "network",
|
|
204
|
-
description: "Release an ephemeral number back to the pool before its lease expires (by number_id, or all you hold).",
|
|
205
|
-
inputSchema: mCALL_release_number_input,
|
|
206
|
-
handler: mCALL_release_number as MosaddTool["handler"],
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: "mCALL_answer",
|
|
210
|
-
requires: "network",
|
|
211
|
-
description:
|
|
212
|
-
"Answer an inbound call to your burner number. Pass the room_name from the inbound_call event; returns a LiveKit token + url so your client joins the room and bridges audio (publish a vocoder track to mask your voice on answer).",
|
|
213
|
-
inputSchema: mCALL_answer_input,
|
|
214
|
-
handler: mCALL_answer as MosaddTool["handler"],
|
|
215
|
-
},
|
|
216
|
-
];
|
|
1
|
+
/**
|
|
2
|
+
* mCALL — Outbound PSTN calls.
|
|
3
|
+
*
|
|
4
|
+
* Place a real phone call (E.164) from an agent. Control plane is MCP; audio
|
|
5
|
+
* never flows through the tool call — it is bridged over LiveKit SIP (primary)
|
|
6
|
+
* or a Telnyx fallback to the carrier, with an optional voice vocoder.
|
|
7
|
+
*
|
|
8
|
+
* Wired to the m0ssad-3 `call-start-pstn` / `call-end-pstn` Edge Functions
|
|
9
|
+
* (deployed). A carrier must be wired server-side (LIVEKIT_SIP_TRUNK_ID, or
|
|
10
|
+
* TELNYX_API_KEY + TELNYX_CONNECTION_ID + TELNYX_FROM_NUMBER); until then the
|
|
11
|
+
* call session is created and metered but no audio leg is bridged.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: mCALL is the telephone (PSTN). For 1:1 in-app voice use mDM; for
|
|
14
|
+
* walkie-talkie / floor-controlled voice use mTALK.
|
|
15
|
+
*
|
|
16
|
+
* Burner numbers: mCALL_acquire_number leases an ephemeral DID (~10 min) that
|
|
17
|
+
* becomes your outbound caller-ID and can receive inbound calls. Inbound rings
|
|
18
|
+
* are delivered out-of-band (Supabase Realtime broadcast on
|
|
19
|
+
* `mcall-inbound-<identity_id>`, or an integrator webhook) carrying a room_name;
|
|
20
|
+
* mCALL_answer mints the LiveKit token to join and bridge that call. Pair with
|
|
21
|
+
* the `vocoder` flag / a published vocoder track to mask the caller's voice.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { z } from "zod";
|
|
25
|
+
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
26
|
+
import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
|
|
27
|
+
|
|
28
|
+
// ---- Schemas ----
|
|
29
|
+
|
|
30
|
+
const E164 = z
|
|
31
|
+
.string()
|
|
32
|
+
.regex(/^\+\d{7,15}$/)
|
|
33
|
+
.describe("Destination phone number in E.164 format, e.g. +14155550123.");
|
|
34
|
+
|
|
35
|
+
const mCALL_start_pstn_input = z.object({
|
|
36
|
+
to: E164,
|
|
37
|
+
vocoder: z
|
|
38
|
+
.boolean()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Disguise the caller's voice with a vocoder (anonymous calling). Default false."),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const mCALL_end_pstn_input = z.object({
|
|
44
|
+
session_id: z.string().min(1).describe("Session id returned by mCALL_start_pstn."),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ---- Burner (ephemeral number) schemas ----
|
|
48
|
+
|
|
49
|
+
const mCALL_acquire_number_input = z.object({}).describe(
|
|
50
|
+
"No parameters. Leases the next available number for ~10 minutes (idempotent: returns your live lease if you already hold one).",
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const mCALL_my_numbers_input = z.object({}).describe("No parameters.");
|
|
54
|
+
|
|
55
|
+
const mCALL_extend_number_input = z.object({
|
|
56
|
+
number_id: z
|
|
57
|
+
.string()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Pool id of the number to extend. Omit to extend your current lease."),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const mCALL_release_number_input = z.object({
|
|
63
|
+
number_id: z
|
|
64
|
+
.string()
|
|
65
|
+
.optional()
|
|
66
|
+
.describe("Pool id of the number to release. Omit to release all numbers you hold."),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const mCALL_answer_input = z.object({
|
|
70
|
+
room_name: z
|
|
71
|
+
.string()
|
|
72
|
+
.min(1)
|
|
73
|
+
.describe("room_name from an inbound_call event (Realtime broadcast / integrator webhook)."),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// ---- Handlers ----
|
|
77
|
+
|
|
78
|
+
async function mCALL_start_pstn(
|
|
79
|
+
input: z.infer<typeof mCALL_start_pstn_input>,
|
|
80
|
+
ctx: MosaddToolContext,
|
|
81
|
+
): Promise<{
|
|
82
|
+
session_id: string;
|
|
83
|
+
room_name: string;
|
|
84
|
+
destination_number: string;
|
|
85
|
+
vocoder_enabled: boolean;
|
|
86
|
+
minutes_remaining: number;
|
|
87
|
+
zone: string;
|
|
88
|
+
zone_label: string;
|
|
89
|
+
}> {
|
|
90
|
+
readSupabaseEnv();
|
|
91
|
+
ctx.log("debug", "mCALL_start_pstn invoking call-start-pstn", { to: input.to });
|
|
92
|
+
return await invokeFunction("call-start-pstn", {
|
|
93
|
+
destination_number: input.to,
|
|
94
|
+
vocoder_enabled: input.vocoder ?? false,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function mCALL_end_pstn(
|
|
99
|
+
input: z.infer<typeof mCALL_end_pstn_input>,
|
|
100
|
+
ctx: MosaddToolContext,
|
|
101
|
+
): Promise<{ duration_ms: number; cost_credits: number }> {
|
|
102
|
+
readSupabaseEnv();
|
|
103
|
+
ctx.log("debug", "mCALL_end_pstn invoking call-end-pstn", { session_id: input.session_id });
|
|
104
|
+
return await invokeFunction("call-end-pstn", { session_id: input.session_id });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ---- Burner (ephemeral number) handlers ----
|
|
108
|
+
|
|
109
|
+
interface AcquiredNumber {
|
|
110
|
+
did: { id: string; phone_number: string; hold_until: string | null };
|
|
111
|
+
reused: boolean;
|
|
112
|
+
hold_until: string;
|
|
113
|
+
seconds_remaining: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function mCALL_acquire_number(
|
|
117
|
+
_input: z.infer<typeof mCALL_acquire_number_input>,
|
|
118
|
+
ctx: MosaddToolContext,
|
|
119
|
+
): Promise<AcquiredNumber> {
|
|
120
|
+
readSupabaseEnv();
|
|
121
|
+
ctx.log("debug", "mCALL_acquire_number invoking call-did-pool acquire");
|
|
122
|
+
return await invokeFunction("call-did-pool", { action: "acquire" });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function mCALL_my_numbers(
|
|
126
|
+
_input: z.infer<typeof mCALL_my_numbers_input>,
|
|
127
|
+
ctx: MosaddToolContext,
|
|
128
|
+
): Promise<{ numbers: Array<{ id: string; phone_number: string; seconds_remaining: number | null }> }> {
|
|
129
|
+
readSupabaseEnv();
|
|
130
|
+
ctx.log("debug", "mCALL_my_numbers invoking call-did-pool mine");
|
|
131
|
+
return await invokeFunction("call-did-pool", { action: "mine" });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function mCALL_extend_number(
|
|
135
|
+
input: z.infer<typeof mCALL_extend_number_input>,
|
|
136
|
+
ctx: MosaddToolContext,
|
|
137
|
+
): Promise<{ did: unknown; hold_until: string; seconds_remaining: number }> {
|
|
138
|
+
readSupabaseEnv();
|
|
139
|
+
ctx.log("debug", "mCALL_extend_number invoking call-did-pool extend", { number_id: input.number_id });
|
|
140
|
+
return await invokeFunction("call-did-pool", { action: "extend", did_id: input.number_id });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function mCALL_release_number(
|
|
144
|
+
input: z.infer<typeof mCALL_release_number_input>,
|
|
145
|
+
ctx: MosaddToolContext,
|
|
146
|
+
): Promise<{ released: number; dids: unknown[] }> {
|
|
147
|
+
readSupabaseEnv();
|
|
148
|
+
ctx.log("debug", "mCALL_release_number invoking call-did-pool release_mine", { number_id: input.number_id });
|
|
149
|
+
return await invokeFunction("call-did-pool", { action: "release_mine", did_id: input.number_id });
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function mCALL_answer(
|
|
153
|
+
input: z.infer<typeof mCALL_answer_input>,
|
|
154
|
+
ctx: MosaddToolContext,
|
|
155
|
+
): Promise<{ token: string; url: string; roomName: string; identity: string }> {
|
|
156
|
+
readSupabaseEnv();
|
|
157
|
+
ctx.log("debug", "mCALL_answer minting livekit token", { room_name: input.room_name });
|
|
158
|
+
return await invokeFunction("livekit-token", { roomName: input.room_name });
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// ---- Registration ----
|
|
162
|
+
|
|
163
|
+
export const mcallTools: MosaddTool[] = [
|
|
164
|
+
{
|
|
165
|
+
name: "mCALL_start_pstn",
|
|
166
|
+
requires: "network",
|
|
167
|
+
description:
|
|
168
|
+
"Place an outbound PSTN phone call to an E.164 number. Bridges audio over an encrypted SIP relay (LiveKit SIP / Telnyx); optional voice vocoder for anonymous calling. Returns session_id, room_name, zone + per-minute cost, and minutes_remaining. Requires PSTN minutes in the wallet.",
|
|
169
|
+
inputSchema: mCALL_start_pstn_input,
|
|
170
|
+
handler: mCALL_start_pstn as MosaddTool["handler"],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "mCALL_end_pstn",
|
|
174
|
+
requires: "network",
|
|
175
|
+
description: "End an active PSTN call by session_id. Returns call duration and credits spent.",
|
|
176
|
+
inputSchema: mCALL_end_pstn_input,
|
|
177
|
+
handler: mCALL_end_pstn as MosaddTool["handler"],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "mCALL_acquire_number",
|
|
181
|
+
requires: "network",
|
|
182
|
+
description:
|
|
183
|
+
"Lease an ephemeral 'burner' phone number for ~10 minutes. While held, it is presented as your caller-ID on mCALL_start_pstn and can receive inbound calls; it auto-recycles when the lease lapses (unless on a live call). Idempotent — returns your existing lease if you already hold one. Returns the number, hold_until and seconds_remaining.",
|
|
184
|
+
inputSchema: mCALL_acquire_number_input,
|
|
185
|
+
handler: mCALL_acquire_number as MosaddTool["handler"],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "mCALL_my_numbers",
|
|
189
|
+
requires: "network",
|
|
190
|
+
description: "List the ephemeral numbers currently leased to you, each with its seconds_remaining.",
|
|
191
|
+
inputSchema: mCALL_my_numbers_input,
|
|
192
|
+
handler: mCALL_my_numbers as MosaddTool["handler"],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "mCALL_extend_number",
|
|
196
|
+
requires: "network",
|
|
197
|
+
description: "Extend the lease on a held ephemeral number by another ~10 minutes (by number_id, or your current lease).",
|
|
198
|
+
inputSchema: mCALL_extend_number_input,
|
|
199
|
+
handler: mCALL_extend_number as MosaddTool["handler"],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "mCALL_release_number",
|
|
203
|
+
requires: "network",
|
|
204
|
+
description: "Release an ephemeral number back to the pool before its lease expires (by number_id, or all you hold).",
|
|
205
|
+
inputSchema: mCALL_release_number_input,
|
|
206
|
+
handler: mCALL_release_number as MosaddTool["handler"],
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "mCALL_answer",
|
|
210
|
+
requires: "network",
|
|
211
|
+
description:
|
|
212
|
+
"Answer an inbound call to your burner number. Pass the room_name from the inbound_call event; returns a LiveKit token + url so your client joins the room and bridges audio (publish a vocoder track to mask your voice on answer).",
|
|
213
|
+
inputSchema: mCALL_answer_input,
|
|
214
|
+
handler: mCALL_answer as MosaddTool["handler"],
|
|
215
|
+
},
|
|
216
|
+
];
|