@avallon-labs/mcp 54.0.0 → 54.2.0-staging.1244

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-3HOW2HW2.js");
49
+ await import("./server-35HQQNHY.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -735,6 +735,29 @@ var refreshToken = async (refreshTokenBody, options) => {
735
735
  const data = body ? JSON.parse(body) : {};
736
736
  return { data, status: res.status, headers: res.headers };
737
737
  };
738
+ var getRefreshSessionUrl = () => {
739
+ return `/v1/auth/session/refresh`;
740
+ };
741
+ var refreshSession = async (refreshSessionBody, options) => {
742
+ const getHeaders = (h) => {
743
+ if (!h) return {};
744
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
745
+ if (Array.isArray(h)) return Object.fromEntries(h);
746
+ return h;
747
+ };
748
+ const res = await fetch(
749
+ getRefreshSessionUrl(),
750
+ {
751
+ ...options,
752
+ method: "POST",
753
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
754
+ body: JSON.stringify(refreshSessionBody)
755
+ }
756
+ );
757
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
758
+ const data = body ? JSON.parse(body) : {};
759
+ return { data, status: res.status, headers: res.headers };
760
+ };
738
761
  var getGetOAuthUrlUrl = (params) => {
739
762
  const normalizedParams = new URLSearchParams();
740
763
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -4450,6 +4473,29 @@ var refreshTokenHandler = async (args, options) => {
4450
4473
  structuredContent: res.data
4451
4474
  };
4452
4475
  };
4476
+ var refreshSessionHandler = async (args, options) => {
4477
+ const res = await refreshSession(args.bodyParams, options);
4478
+ if (res.status >= 400) {
4479
+ return {
4480
+ content: [
4481
+ {
4482
+ type: "text",
4483
+ text: JSON.stringify(res.data ?? null)
4484
+ }
4485
+ ],
4486
+ isError: true
4487
+ };
4488
+ }
4489
+ return {
4490
+ content: [
4491
+ {
4492
+ type: "text",
4493
+ text: JSON.stringify(res.data ?? null)
4494
+ }
4495
+ ],
4496
+ structuredContent: res.data
4497
+ };
4498
+ };
4453
4499
  var getOAuthUrlHandler = async (args, options) => {
4454
4500
  const res = await getOAuthUrl(args.queryParams, options);
4455
4501
  if (res.status >= 400) {
@@ -7935,6 +7981,10 @@ var updateVoiceAgentBodyInactivityTimeoutSecondsOneMin = 5;
7935
7981
  var updateVoiceAgentBodyInactivityTimeoutSecondsOneMax = 9007199254740991;
7936
7982
  var updateVoiceAgentBodyMaxCallDurationSecondsMin = 60;
7937
7983
  var updateVoiceAgentBodyMaxCallDurationSecondsMax = 3600;
7984
+ var updateVoiceAgentBodyTtsVoiceIdMax = 256;
7985
+ var updateVoiceAgentBodyTtsVoiceIdRegExp = new RegExp("^[^\\u0000-\\u001f\\u007f]+$");
7986
+ var updateVoiceAgentBodyFallbackTtsVoiceIdOneMax = 256;
7987
+ var updateVoiceAgentBodyFallbackTtsVoiceIdOneRegExp = new RegExp("^[^\\u0000-\\u001f\\u007f]+$");
7938
7988
  var UpdateVoiceAgentBody = zod.object({
7939
7989
  "name": zod.string().min(1).optional(),
7940
7990
  "call_processor_id": zod.union([zod.string().uuid(), zod.null()]).optional(),
@@ -7943,7 +7993,23 @@ var UpdateVoiceAgentBody = zod.object({
7943
7993
  "max_call_duration_seconds": zod.number().int().min(updateVoiceAgentBodyMaxCallDurationSecondsMin).max(updateVoiceAgentBodyMaxCallDurationSecondsMax).optional().describe("Maximum call length in seconds; the agent ends the call once it is reached. Between 60 and 3600. Omit to leave unchanged."),
7944
7994
  "voice_mail_detection": zod.boolean().optional().describe("Enable voicemail beep detection on outbound calls. Omit to leave unchanged."),
7945
7995
  "noise_cancellation": zod.enum(["NONE", "NC", "BVC", "BVC_TELEPHONY"]).optional().describe("Noise cancellation mode applied to the caller audio. Omit to leave unchanged."),
7946
- "tool_ids": zod.array(zod.string().uuid()).optional().describe("Replace the agent's attached tool set. Omit to leave unchanged; pass [] to detach all.")
7996
+ "tool_ids": zod.array(zod.string().uuid()).optional().describe("Replace the agent's attached tool set. Omit to leave unchanged; pass [] to detach all."),
7997
+ "llm_model": zod.enum(["GPT4.1", "AZURE-GPT4o", "AZURE-GPT4.1", "GPT-5", "GPT-5-low", "GPT-5-high", "GPT-5.1-chat-latest", "GPT-5.1-no-reasoning", "GEMINI-1.5-flash", "GEMINI-2.5-flash", "GEMINI-2.5-flash-lite", "GEMINI-3-flash", "CLAUDE-sonnet-4.6", "CLAUDE-haiku-4.5", "CLAUDE-haiku-5.5", "GPT-5.4-mini"]).optional(),
7998
+ "tts_provider": zod.enum(["elevenlabs", "cartesia", "google", "aws-polly"]).optional(),
7999
+ "tts_model": zod.enum(["eleven_flash_v2_5", "eleven_turbo_v2_5", "sonic-3", "sonic-3.5", "sonic-3.6", "chirp_3", "polly-neural"]).optional(),
8000
+ "tts_voice_id": zod.string().min(1).max(updateVoiceAgentBodyTtsVoiceIdMax).regex(updateVoiceAgentBodyTtsVoiceIdRegExp).optional(),
8001
+ "stt_model": zod.enum(["DEEPGRAM-NOVA-2-GENERAL", "DEEPGRAM-NOVA-3-GENERAL", "AWS-TRANSCRIBE", "ELEVENLABS-SCRIBE-V2-REALTIME", "CARTESIA-INK-2"]).optional(),
8002
+ "language": zod.enum(["en-US", "de-DE"]).optional(),
8003
+ "fallback_llm_model": zod.union([zod.enum(["GPT4.1", "AZURE-GPT4o", "AZURE-GPT4.1", "GPT-5", "GPT-5-low", "GPT-5-high", "GPT-5.1-chat-latest", "GPT-5.1-no-reasoning", "GEMINI-1.5-flash", "GEMINI-2.5-flash", "GEMINI-2.5-flash-lite", "GEMINI-3-flash", "CLAUDE-sonnet-4.6", "CLAUDE-haiku-4.5", "CLAUDE-haiku-5.5", "GPT-5.4-mini"]), zod.null()]).optional().describe("Fallback LLM model. null removes the fallback."),
8004
+ "fallback_tts_provider": zod.union([zod.enum(["elevenlabs", "cartesia", "google", "aws-polly"]), zod.null()]).optional().describe("Fallback TTS provider. null removes the fallback."),
8005
+ "fallback_tts_model": zod.union([zod.enum(["eleven_flash_v2_5", "eleven_turbo_v2_5", "sonic-3", "sonic-3.5", "sonic-3.6", "chirp_3", "polly-neural"]), zod.null()]).optional().describe("Fallback TTS model. null removes the fallback."),
8006
+ "fallback_tts_voice_id": zod.union([zod.string().min(1).max(updateVoiceAgentBodyFallbackTtsVoiceIdOneMax).regex(updateVoiceAgentBodyFallbackTtsVoiceIdOneRegExp), zod.null()]).optional().describe("Fallback TTS voice. null removes the fallback."),
8007
+ "fallback_stt_model": zod.union([zod.enum(["DEEPGRAM-NOVA-2-GENERAL", "DEEPGRAM-NOVA-3-GENERAL", "AWS-TRANSCRIBE", "ELEVENLABS-SCRIBE-V2-REALTIME", "CARTESIA-INK-2"]), zod.null()]).optional().describe("Fallback STT model. null removes the fallback."),
8008
+ "dial_pad": zod.boolean().optional().describe("Allow the caller to send dial pad (DTMF) input."),
8009
+ "end_call": zod.boolean().optional().describe("Allow the agent to hang up the call."),
8010
+ "transfer_phone_number": zod.union([zod.string(), zod.null()]).optional().describe("Phone number calls are transferred to. null removes it."),
8011
+ "prompt": zod.string().min(1).optional().describe("System prompt. Requires the `prompts:write` permission."),
8012
+ "greeting": zod.union([zod.string().min(1), zod.null()]).optional().describe("Greeting spoken at the start of the call. null removes it. Requires the `prompts:write` permission.")
7947
8013
  });
7948
8014
  var updateVoiceAgentResponseDataAgentInactivityTimeoutSecondsOneMin = -9007199254740991;
7949
8015
  var updateVoiceAgentResponseDataAgentInactivityTimeoutSecondsOneMax = 9007199254740991;
@@ -8621,6 +8687,19 @@ var RefreshTokenResponse = zod.object({
8621
8687
  }),
8622
8688
  "message": zod.string()
8623
8689
  });
8690
+ var RefreshSessionBody = zod.object({
8691
+ "refresh_token": zod.string(),
8692
+ "tenant_id": zod.string().uuid()
8693
+ });
8694
+ var RefreshSessionResponse = zod.object({
8695
+ "data": zod.object({
8696
+ "access_token": zod.string(),
8697
+ "refresh_token": zod.string(),
8698
+ "tenant_id": zod.string(),
8699
+ "expires_in": zod.number()
8700
+ }),
8701
+ "message": zod.string()
8702
+ });
8624
8703
  var GetOAuthUrlQueryParams = zod.object({
8625
8704
  "provider": zod.enum(["google", "sso"]),
8626
8705
  "redirect_uri": zod.string().url(),
@@ -12707,7 +12786,7 @@ var createMcpServer = (options) => {
12707
12786
  "updateVoiceAgent",
12708
12787
  {
12709
12788
  title: "Update voice agent",
12710
- description: "Update a voice agent's name, call processor, or call behaviour settings.\n\nTo change the processor assignment, `call_processor_id` and `call_processor_type` must be provided together. Set `call_processor_id` to `null` to detach (`call_processor_type` is still required).\n\nSet `voice_mail_detection` to `true` to have the agent listen for a voicemail beep tone. Detection only runs on `OUTBOUND` agents; enabling it on an `INBOUND` agent is stored but has no effect.\n\nSet `max_call_duration_seconds` to change how long a call may run before the agent ends it (default 1800).\n\nSet `noise_cancellation` to choose the noise cancellation mode applied to the caller audio.\n\nSet `tool_ids` to replace the agent's attached tool set. This is the supported way to manage tool attachments; the dedicated add and remove endpoints are deprecated.\n\nConfig changes create a new voice agent config version. The live and test releases keep pointing at their current versions until the new version is promoted.",
12789
+ description: "Update a voice agent. Only the fields you send change; omitted fields keep their current value.\n\nTo change the processor assignment, `call_processor_id` and `call_processor_type` must be provided together. Set `call_processor_id` to `null` to detach (`call_processor_type` is still required).\n\nModel fields (`llm_model`, `tts_provider`, `tts_model`, `tts_voice_id`, `stt_model`, `language` and their `fallback_*` counterparts) are validated against the agent's resulting configuration, so a single field such as `tts_voice_id` can be sent on its own as long as it fits the current provider and model.\n\nSet `voice_mail_detection` to `true` to have the agent listen for a voicemail beep tone. Detection only runs on `OUTBOUND` agents; enabling it on an `INBOUND` agent is stored but has no effect.\n\nSet `max_call_duration_seconds` to change how long a call may run before the agent ends it (default 1800).\n\nSet `noise_cancellation` to choose the noise cancellation mode applied to the caller audio.\n\nSet `tool_ids` to replace the agent's attached tool set. This is the supported way to manage tool attachments; the dedicated add and remove endpoints are deprecated.\n\nSetting `prompt` or `greeting` requires the `prompts:write` permission.\n\nAll changes in one request create a single new voice agent config version. The live and test releases keep pointing at their current versions until the new version is promoted.",
12711
12790
  inputSchema: {
12712
12791
  pathParams: UpdateVoiceAgentParams,
12713
12792
  bodyParams: UpdateVoiceAgentBody.optional()
@@ -12838,8 +12917,8 @@ var createMcpServer = (options) => {
12838
12917
  tools.updateVoiceAgentPrompt = server2.registerTool(
12839
12918
  "updateVoiceAgentPrompt",
12840
12919
  {
12841
- title: "Update voice agent prompt",
12842
- description: "Update the prompt for a voice agent. Internal use only.",
12920
+ title: "Update voice agent prompt (deprecated)",
12921
+ description: "Update the prompt for a voice agent. Internal use only.\n\n**Deprecated:** Use `PATCH /v1/voice-agents/{voiceAgentId}` instead.",
12843
12922
  inputSchema: {
12844
12923
  pathParams: UpdateVoiceAgentPromptParams,
12845
12924
  bodyParams: UpdateVoiceAgentPromptBody.optional()
@@ -12855,8 +12934,8 @@ var createMcpServer = (options) => {
12855
12934
  tools.updateVoiceAgentModels = server2.registerTool(
12856
12935
  "updateVoiceAgentModels",
12857
12936
  {
12858
- title: "Update voice agent models",
12859
- description: "Update the LLM, TTS, and STT model configuration for a voice agent.\n\nFor compatibility this endpoint is also available using the following (deprecated) paths:\n`PATCH /v1/agents/{id}/models`",
12937
+ title: "Update voice agent models (deprecated)",
12938
+ description: "Update the LLM, TTS, and STT model configuration for a voice agent.\n\n**Deprecated:** Use `PATCH /v1/voice-agents/{voiceAgentId}` instead.\n\nFor compatibility this endpoint is also available using the following (deprecated) paths:\n`PATCH /v1/agents/{id}/models`",
12860
12939
  inputSchema: {
12861
12940
  pathParams: UpdateVoiceAgentModelsParams,
12862
12941
  bodyParams: UpdateVoiceAgentModelsBody.optional()
@@ -12872,8 +12951,8 @@ var createMcpServer = (options) => {
12872
12951
  tools.updateCallControls = server2.registerTool(
12873
12952
  "updateCallControls",
12874
12953
  {
12875
- title: "Update voice agent call controls",
12876
- description: "Update call control settings for a voice agent.\n\nConfigure whether the voice agent supports dial pad input, can end calls, and set a transfer phone number.\n\nFor compatibility this endpoint is also available using the following (deprecated) paths:\n`PUT /v1/agents/{id}/call-controls`",
12954
+ title: "Update voice agent call controls (deprecated)",
12955
+ description: "Update call control settings for a voice agent.\n\nConfigure whether the voice agent supports dial pad input, can end calls, and set a transfer phone number.\n\n**Deprecated:** Use `PATCH /v1/voice-agents/{voiceAgentId}` instead.\n\nFor compatibility this endpoint is also available using the following (deprecated) paths:\n`PUT /v1/agents/{id}/call-controls`",
12877
12956
  inputSchema: {
12878
12957
  pathParams: UpdateCallControlsParams,
12879
12958
  bodyParams: UpdateCallControlsBody.optional()
@@ -13209,6 +13288,22 @@ var createMcpServer = (options) => {
13209
13288
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
13210
13289
  })
13211
13290
  );
13291
+ tools.refreshSession = server2.registerTool(
13292
+ "refreshSession",
13293
+ {
13294
+ title: "Refresh session",
13295
+ description: "Rotate the refresh token and return a new access token for `tenant_id`. Call it with a different `tenant_id` to switch tenants.\n\nRequires a valid user session (not an API key). The refresh token must belong to the same user, and the user must be a member of `tenant_id` (404 otherwise).",
13296
+ inputSchema: {
13297
+ bodyParams: RefreshSessionBody.optional()
13298
+ },
13299
+ outputSchema: RefreshSessionResponse,
13300
+ annotations: { destructiveHint: true }
13301
+ },
13302
+ (args, ctx) => refreshSessionHandler(args, {
13303
+ ...options,
13304
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
13305
+ })
13306
+ );
13212
13307
  tools.getOAuthUrl = server2.registerTool(
13213
13308
  "getOAuthUrl",
13214
13309
  {
@@ -15555,4 +15650,4 @@ var transport = new StdioServerTransport();
15555
15650
  server.connect(transport).then(() => {
15556
15651
  console.error("MCP server running on stdio");
15557
15652
  }).catch(console.error);
15558
- //# sourceMappingURL=server-3HOW2HW2.js.map
15653
+ //# sourceMappingURL=server-35HQQNHY.js.map