@avallon-labs/mcp 54.5.0 → 54.6.0-staging.1253

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/index.js CHANGED
@@ -46,5 +46,5 @@ function setupFetch() {
46
46
 
47
47
  // src/index.ts
48
48
  setupFetch();
49
- await import("./server-TINVVYSY.js");
49
+ await import("./server-TTYQRCOU.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -932,6 +932,21 @@ var cancelCall = async (id, options) => {
932
932
  const data = body ? JSON.parse(body) : {};
933
933
  return { data, status: res.status, headers: res.headers };
934
934
  };
935
+ var getListenCallUrl = (id) => {
936
+ return `/v1/calls/${id}/listen`;
937
+ };
938
+ var listenCall = async (id, options) => {
939
+ const res = await fetch(
940
+ getListenCallUrl(id),
941
+ {
942
+ ...options,
943
+ method: "POST"
944
+ }
945
+ );
946
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
947
+ const data = body ? JSON.parse(body) : {};
948
+ return { data, status: res.status, headers: res.headers };
949
+ };
935
950
  var getGetCallEvaluationUrl = (id) => {
936
951
  return `/v1/calls/${id}/evaluation`;
937
952
  };
@@ -4680,6 +4695,29 @@ var cancelCallHandler = async (args, options) => {
4680
4695
  structuredContent: res.data
4681
4696
  };
4682
4697
  };
4698
+ var listenCallHandler = async (args, options) => {
4699
+ const res = await listenCall(args.pathParams.id, options);
4700
+ if (res.status >= 400) {
4701
+ return {
4702
+ content: [
4703
+ {
4704
+ type: "text",
4705
+ text: JSON.stringify(res.data ?? null)
4706
+ }
4707
+ ],
4708
+ isError: true
4709
+ };
4710
+ }
4711
+ return {
4712
+ content: [
4713
+ {
4714
+ type: "text",
4715
+ text: JSON.stringify(res.data ?? null)
4716
+ }
4717
+ ],
4718
+ structuredContent: res.data
4719
+ };
4720
+ };
4683
4721
  var getCallEvaluationHandler = async (args, options) => {
4684
4722
  const res = await getCallEvaluation(args.pathParams.id, options);
4685
4723
  if (res.status >= 400) {
@@ -8785,6 +8823,7 @@ var ListCallsResponse = zod.object({
8785
8823
  "scheduled_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8786
8824
  "schedule_window_minutes": zod.union([zod.number(), zod.null()]),
8787
8825
  "started_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8826
+ "connected_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]).describe("When the caller was connected. Set while an `in_progress` call can be listened to."),
8788
8827
  "ended_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8789
8828
  "duration_seconds": zod.union([zod.number(), zod.null()]),
8790
8829
  "completion_status": zod.union([zod.string().describe("Call completion status"), zod.null()]),
@@ -8827,6 +8866,7 @@ var CreateCallResponse = zod.object({
8827
8866
  "scheduled_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8828
8867
  "schedule_window_minutes": zod.union([zod.number(), zod.null()]),
8829
8868
  "started_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8869
+ "connected_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]).describe("When the caller was connected. Set while an `in_progress` call can be listened to."),
8830
8870
  "ended_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8831
8871
  "duration_seconds": zod.union([zod.number(), zod.null()]),
8832
8872
  "completion_status": zod.union([zod.string().describe("Call completion status"), zod.null()]),
@@ -8864,6 +8904,7 @@ var GetCallResponse = zod.object({
8864
8904
  "schedule_window_minutes": zod.union([zod.number(), zod.null()]),
8865
8905
  "payload": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Variables the call was scheduled with; null for calls that were not scheduled."),
8866
8906
  "started_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8907
+ "connected_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]).describe("When the caller was connected. Set while an `in_progress` call can be listened to."),
8867
8908
  "ended_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8868
8909
  "duration_seconds": zod.union([zod.number(), zod.null()]),
8869
8910
  "completion_status": zod.union([zod.string().describe("Call completion status"), zod.null()]),
@@ -8912,6 +8953,7 @@ var CancelCallResponse = zod.object({
8912
8953
  "scheduled_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8913
8954
  "schedule_window_minutes": zod.union([zod.number(), zod.null()]),
8914
8955
  "started_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8956
+ "connected_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]).describe("When the caller was connected. Set while an `in_progress` call can be listened to."),
8915
8957
  "ended_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
8916
8958
  "duration_seconds": zod.union([zod.number(), zod.null()]),
8917
8959
  "completion_status": zod.union([zod.string().describe("Call completion status"), zod.null()]),
@@ -8928,6 +8970,16 @@ var CancelCallResponse = zod.object({
8928
8970
  }),
8929
8971
  "message": zod.string()
8930
8972
  });
8973
+ var ListenCallParams = zod.object({
8974
+ "id": zod.string().uuid()
8975
+ });
8976
+ var ListenCallResponse = zod.object({
8977
+ "data": zod.object({
8978
+ "url": zod.string(),
8979
+ "token": zod.string()
8980
+ }),
8981
+ "message": zod.string()
8982
+ });
8931
8983
  var GetCallEvaluationParams = zod.object({
8932
8984
  "id": zod.string().uuid()
8933
8985
  });
@@ -11341,7 +11393,7 @@ var GetProfileResponse = zod.object({
11341
11393
  "last_name": zod.union([zod.string(), zod.null()]),
11342
11394
  "email": zod.string(),
11343
11395
  "role": zod.enum(["admin", "avallon_admin", "member"]),
11344
- "permissions": zod.array(zod.enum(["voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "information-requests:write", "information-requests:resolve", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "schedules:read", "schedules:write", "tenants:write"])),
11396
+ "permissions": zod.array(zod.enum(["voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "information-requests:write", "information-requests:resolve", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "schedules:read", "schedules:write", "tenants:write"])),
11345
11397
  "tenants": zod.object({
11346
11398
  "active": zod.object({
11347
11399
  "id": zod.string(),
@@ -13438,6 +13490,22 @@ var createMcpServer = (options) => {
13438
13490
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
13439
13491
  })
13440
13492
  );
13493
+ tools.listenCall = server2.registerTool(
13494
+ "listenCall",
13495
+ {
13496
+ title: "Listen to a call",
13497
+ description: "Issue a short-lived token that joins a connected call as a hidden, listen-only participant. Only calls that are `in_progress` with a `connected_at` can be listened to.",
13498
+ inputSchema: {
13499
+ pathParams: ListenCallParams
13500
+ },
13501
+ outputSchema: ListenCallResponse,
13502
+ annotations: { destructiveHint: true }
13503
+ },
13504
+ (args, ctx) => listenCallHandler(args, {
13505
+ ...options,
13506
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
13507
+ })
13508
+ );
13441
13509
  tools.getCallEvaluation = server2.registerTool(
13442
13510
  "getCallEvaluation",
13443
13511
  {
@@ -15655,4 +15723,4 @@ var transport = new StdioServerTransport();
15655
15723
  server.connect(transport).then(() => {
15656
15724
  console.error("MCP server running on stdio");
15657
15725
  }).catch(console.error);
15658
- //# sourceMappingURL=server-TINVVYSY.js.map
15726
+ //# sourceMappingURL=server-TTYQRCOU.js.map