@avallon-labs/mcp 57.0.0-staging.1288 → 57.1.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/index.js CHANGED
@@ -46,5 +46,5 @@ function setupFetch() {
46
46
 
47
47
  // src/index.ts
48
48
  setupFetch();
49
- await import("./server-4SR55G26.js");
49
+ await import("./server-3JZUJX4G.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -2914,6 +2914,59 @@ var deleteSecret = async (secretId, options) => {
2914
2914
  const data = body ? JSON.parse(body) : {};
2915
2915
  return { data, status: res.status, headers: res.headers };
2916
2916
  };
2917
+ var getCreateEvaluatorUrl = () => {
2918
+ return `/v1/evaluators`;
2919
+ };
2920
+ var createEvaluator = async (createEvaluatorBody, options) => {
2921
+ const getHeaders = (h) => {
2922
+ if (!h) return {};
2923
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
2924
+ if (Array.isArray(h)) return Object.fromEntries(h);
2925
+ return h;
2926
+ };
2927
+ const res = await fetch(
2928
+ getCreateEvaluatorUrl(),
2929
+ {
2930
+ ...options,
2931
+ method: "POST",
2932
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2933
+ body: JSON.stringify(createEvaluatorBody)
2934
+ }
2935
+ );
2936
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2937
+ const data = body ? JSON.parse(body) : {};
2938
+ return { data, status: res.status, headers: res.headers };
2939
+ };
2940
+ var getListEvaluatorsUrl = () => {
2941
+ return `/v1/evaluators`;
2942
+ };
2943
+ var listEvaluators = async (options) => {
2944
+ const res = await fetch(
2945
+ getListEvaluatorsUrl(),
2946
+ {
2947
+ ...options,
2948
+ method: "GET"
2949
+ }
2950
+ );
2951
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2952
+ const data = body ? JSON.parse(body) : {};
2953
+ return { data, status: res.status, headers: res.headers };
2954
+ };
2955
+ var getGetEvaluatorUrl = (evaluatorSlug) => {
2956
+ return `/v1/evaluators/${evaluatorSlug}`;
2957
+ };
2958
+ var getEvaluator = async (evaluatorSlug, options) => {
2959
+ const res = await fetch(
2960
+ getGetEvaluatorUrl(evaluatorSlug),
2961
+ {
2962
+ ...options,
2963
+ method: "GET"
2964
+ }
2965
+ );
2966
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2967
+ const data = body ? JSON.parse(body) : {};
2968
+ return { data, status: res.status, headers: res.headers };
2969
+ };
2917
2970
  var getCreateScheduleUrl = () => {
2918
2971
  return `/v1/schedules`;
2919
2972
  };
@@ -7137,6 +7190,75 @@ var deleteSecretHandler = async (args, options) => {
7137
7190
  structuredContent: res.data
7138
7191
  };
7139
7192
  };
7193
+ var createEvaluatorHandler = async (args, options) => {
7194
+ const res = await createEvaluator(args.bodyParams, options);
7195
+ if (res.status >= 400) {
7196
+ return {
7197
+ content: [
7198
+ {
7199
+ type: "text",
7200
+ text: JSON.stringify(res.data ?? null)
7201
+ }
7202
+ ],
7203
+ isError: true
7204
+ };
7205
+ }
7206
+ return {
7207
+ content: [
7208
+ {
7209
+ type: "text",
7210
+ text: JSON.stringify(res.data ?? null)
7211
+ }
7212
+ ],
7213
+ structuredContent: res.data
7214
+ };
7215
+ };
7216
+ var listEvaluatorsHandler = async (options) => {
7217
+ const res = await listEvaluators(options);
7218
+ if (res.status >= 400) {
7219
+ return {
7220
+ content: [
7221
+ {
7222
+ type: "text",
7223
+ text: JSON.stringify(res.data ?? null)
7224
+ }
7225
+ ],
7226
+ isError: true
7227
+ };
7228
+ }
7229
+ return {
7230
+ content: [
7231
+ {
7232
+ type: "text",
7233
+ text: JSON.stringify(res.data ?? null)
7234
+ }
7235
+ ],
7236
+ structuredContent: res.data
7237
+ };
7238
+ };
7239
+ var getEvaluatorHandler = async (args, options) => {
7240
+ const res = await getEvaluator(args.pathParams.evaluatorSlug, options);
7241
+ if (res.status >= 400) {
7242
+ return {
7243
+ content: [
7244
+ {
7245
+ type: "text",
7246
+ text: JSON.stringify(res.data ?? null)
7247
+ }
7248
+ ],
7249
+ isError: true
7250
+ };
7251
+ }
7252
+ return {
7253
+ content: [
7254
+ {
7255
+ type: "text",
7256
+ text: JSON.stringify(res.data ?? null)
7257
+ }
7258
+ ],
7259
+ structuredContent: res.data
7260
+ };
7261
+ };
7140
7262
  var createScheduleHandler = async (args, options) => {
7141
7263
  const res = await createSchedule(args.bodyParams, options);
7142
7264
  if (res.status >= 400) {
@@ -8418,6 +8540,8 @@ var updateVoiceAgentBodyTtsVoiceIdMax = 256;
8418
8540
  var updateVoiceAgentBodyTtsVoiceIdRegExp = new RegExp("^[^\\u0000-\\u001f\\u007f]+$");
8419
8541
  var updateVoiceAgentBodyFallbackTtsVoiceIdOneMax = 256;
8420
8542
  var updateVoiceAgentBodyFallbackTtsVoiceIdOneRegExp = new RegExp("^[^\\u0000-\\u001f\\u007f]+$");
8543
+ var updateVoiceAgentBodyEvaluatorSlugOneMax = 100;
8544
+ var updateVoiceAgentBodyEvaluatorSlugOneRegExp = new RegExp("^[a-z0-9]+(?:[-_][a-z0-9]+)*$");
8421
8545
  var UpdateVoiceAgentBody = zod.object({
8422
8546
  "name": zod.string().min(1).optional(),
8423
8547
  "call_processor_id": zod.union([zod.string().uuid(), zod.null()]).optional(),
@@ -8441,6 +8565,7 @@ var UpdateVoiceAgentBody = zod.object({
8441
8565
  "dial_pad": zod.boolean().optional().describe("Allow the caller to send dial pad (DTMF) input."),
8442
8566
  "end_call": zod.boolean().optional().describe("Allow the agent to hang up the call."),
8443
8567
  "transfer_phone_number": zod.union([zod.string(), zod.null()]).optional().describe("Phone number calls are transferred to. null removes it."),
8568
+ "evaluator_slug": zod.union([zod.string().max(updateVoiceAgentBodyEvaluatorSlugOneMax).regex(updateVoiceAgentBodyEvaluatorSlugOneRegExp), zod.null()]).optional().describe("Evaluator that scores this agent's calls, created with `POST /v1/evaluators`. null detaches it. Omit to leave unchanged."),
8444
8569
  "prompt": zod.string().min(1).optional().describe("System prompt. Requires the `prompts:write` permission."),
8445
8570
  "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.")
8446
8571
  });
@@ -12046,6 +12171,67 @@ var DeleteSecretResponse = zod.object({
12046
12171
  "data": zod.object({}),
12047
12172
  "message": zod.string()
12048
12173
  });
12174
+ var createEvaluatorBodySlugMax = 100;
12175
+ var createEvaluatorBodySlugRegExp = new RegExp("^[a-z0-9]+(?:[-_][a-z0-9]+)*$");
12176
+ var createEvaluatorBodyMetricsItemSlugMax = 100;
12177
+ var createEvaluatorBodyMetricsItemSlugRegExp = new RegExp("^[a-z0-9]+(?:[-_][a-z0-9]+)*$");
12178
+ var createEvaluatorBodyMetricsItemNameMax = 200;
12179
+ var createEvaluatorBodyMetricsItemQuestionMax = 1e4;
12180
+ var createEvaluatorBodyMetricsMax = 50;
12181
+ var CreateEvaluatorBody = zod.object({
12182
+ "slug": zod.string().max(createEvaluatorBodySlugMax).regex(createEvaluatorBodySlugRegExp).describe("Unique evaluator slug within the tenant, e.g. `support-quality-v1`"),
12183
+ "metrics": zod.array(zod.object({
12184
+ "slug": zod.string().max(createEvaluatorBodyMetricsItemSlugMax).regex(createEvaluatorBodyMetricsItemSlugRegExp).describe("Stable metric identifier"),
12185
+ "name": zod.string().min(1).max(createEvaluatorBodyMetricsItemNameMax),
12186
+ "question": zod.string().min(1).max(createEvaluatorBodyMetricsItemQuestionMax).describe("The exact criterion and scoring rubric the judge receives. Score 0 to 1; 0.5 or higher passes.")
12187
+ })).min(1).max(createEvaluatorBodyMetricsMax)
12188
+ });
12189
+ var CreateEvaluatorResponse = zod.object({
12190
+ "data": zod.object({
12191
+ "slug": zod.string().describe("Evaluator slug"),
12192
+ "metrics": zod.array(zod.object({
12193
+ "id": zod.string(),
12194
+ "slug": zod.string(),
12195
+ "name": zod.string(),
12196
+ "question": zod.string().describe("Criterion and scoring rubric passed to the judge"),
12197
+ "created_at": zod.string().datetime({ "offset": true })
12198
+ }))
12199
+ }),
12200
+ "message": zod.string()
12201
+ });
12202
+ var ListEvaluatorsResponse = zod.object({
12203
+ "data": zod.object({
12204
+ "evaluators": zod.array(zod.object({
12205
+ "slug": zod.string().describe("Evaluator slug"),
12206
+ "metrics": zod.array(zod.object({
12207
+ "id": zod.string(),
12208
+ "slug": zod.string(),
12209
+ "name": zod.string(),
12210
+ "question": zod.string().describe("Criterion and scoring rubric passed to the judge"),
12211
+ "created_at": zod.string().datetime({ "offset": true })
12212
+ }))
12213
+ }))
12214
+ }),
12215
+ "message": zod.string()
12216
+ });
12217
+ var getEvaluatorPathEvaluatorSlugMax = 100;
12218
+ var getEvaluatorPathEvaluatorSlugRegExp = new RegExp("^[a-z0-9]+(?:[-_][a-z0-9]+)*$");
12219
+ var GetEvaluatorParams = zod.object({
12220
+ "evaluatorSlug": zod.string().max(getEvaluatorPathEvaluatorSlugMax).regex(getEvaluatorPathEvaluatorSlugRegExp)
12221
+ });
12222
+ var GetEvaluatorResponse = zod.object({
12223
+ "data": zod.object({
12224
+ "slug": zod.string().describe("Evaluator slug"),
12225
+ "metrics": zod.array(zod.object({
12226
+ "id": zod.string(),
12227
+ "slug": zod.string(),
12228
+ "name": zod.string(),
12229
+ "question": zod.string().describe("Criterion and scoring rubric passed to the judge"),
12230
+ "created_at": zod.string().datetime({ "offset": true })
12231
+ }))
12232
+ }),
12233
+ "message": zod.string()
12234
+ });
12049
12235
  var createScheduleBodyRuleTwoPatternsItemMinuteMin = 0;
12050
12236
  var createScheduleBodyRuleTwoPatternsItemMinuteMax = 59;
12051
12237
  var createScheduleBodyRuleTwoPatternsItemHoursOneItemMin = 0;
@@ -13805,7 +13991,7 @@ var createMcpServer = (options) => {
13805
13991
  "updateVoiceAgent",
13806
13992
  {
13807
13993
  title: "Update voice agent",
13808
- 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.",
13994
+ 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\nSet `evaluator_slug` to score the agent's calls with that evaluator. Calls only use it once the new version is promoted, because a call is evaluated with the version it ran on.\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.",
13809
13995
  inputSchema: {
13810
13996
  pathParams: UpdateVoiceAgentParams,
13811
13997
  bodyParams: UpdateVoiceAgentBody.optional()
@@ -16040,6 +16226,51 @@ var createMcpServer = (options) => {
16040
16226
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16041
16227
  })
16042
16228
  );
16229
+ tools.createEvaluator = server2.registerTool(
16230
+ "createEvaluator",
16231
+ {
16232
+ title: "Create an evaluator",
16233
+ description: "Create an evaluator: a named set of metrics that an LLM judge scores every call of the voice agents it is attached to.\n\nEvaluators can't be changed after creation, so past call scores keep their meaning. To change the criteria, create a new evaluator (e.g. `support-quality-v2`) and attach that instead. A slug that already exists returns 409.\n\nAttach it to a voice agent with `PATCH /v1/voice-agents/{voiceAgentId}` (`evaluator_slug`), then promote that version. Requires the `voice-agents:write` permission.",
16234
+ inputSchema: {
16235
+ bodyParams: CreateEvaluatorBody.optional()
16236
+ },
16237
+ outputSchema: CreateEvaluatorResponse,
16238
+ annotations: { destructiveHint: true }
16239
+ },
16240
+ (args, ctx) => createEvaluatorHandler(args, {
16241
+ ...options,
16242
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16243
+ })
16244
+ );
16245
+ tools.listEvaluators = server2.registerTool(
16246
+ "listEvaluators",
16247
+ {
16248
+ title: "List evaluators",
16249
+ description: "List all evaluators of the tenant with their metrics.",
16250
+ outputSchema: ListEvaluatorsResponse,
16251
+ annotations: { readOnlyHint: true }
16252
+ },
16253
+ (ctx) => listEvaluatorsHandler({
16254
+ ...options,
16255
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16256
+ })
16257
+ );
16258
+ tools.getEvaluator = server2.registerTool(
16259
+ "getEvaluator",
16260
+ {
16261
+ title: "Get an evaluator",
16262
+ description: "Retrieve an evaluator and the metrics its judge scores.",
16263
+ inputSchema: {
16264
+ pathParams: GetEvaluatorParams
16265
+ },
16266
+ outputSchema: GetEvaluatorResponse,
16267
+ annotations: { readOnlyHint: true }
16268
+ },
16269
+ (args, ctx) => getEvaluatorHandler(args, {
16270
+ ...options,
16271
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16272
+ })
16273
+ );
16043
16274
  tools.createSchedule = server2.registerTool(
16044
16275
  "createSchedule",
16045
16276
  {
@@ -16834,4 +17065,4 @@ var transport = new StdioServerTransport();
16834
17065
  server.connect(transport).then(() => {
16835
17066
  console.error("MCP server running on stdio");
16836
17067
  }).catch(console.error);
16837
- //# sourceMappingURL=server-4SR55G26.js.map
17068
+ //# sourceMappingURL=server-3JZUJX4G.js.map