@avallon-labs/mcp 68.0.0-staging.1416 → 68.2.0-staging.1418

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
@@ -56,5 +56,5 @@ function describeErrors(body) {
56
56
 
57
57
  // src/index.ts
58
58
  setupFetch();
59
- await import("./server-IUMTYF25.js");
59
+ await import("./server-2WLFXTEC.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -2595,6 +2595,21 @@ var listChatMessages = async (chatId, params, options) => {
2595
2595
  const data = body ? JSON.parse(body) : {};
2596
2596
  return { data, status: res.status, headers: res.headers };
2597
2597
  };
2598
+ var getGetChatEvaluationUrl = (chatId) => {
2599
+ return `/v1/chats/${chatId}/evaluation`;
2600
+ };
2601
+ var getChatEvaluation = async (chatId, options) => {
2602
+ const res = await fetch(
2603
+ getGetChatEvaluationUrl(chatId),
2604
+ {
2605
+ ...options,
2606
+ method: "GET"
2607
+ }
2608
+ );
2609
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2610
+ const data = body ? JSON.parse(body) : {};
2611
+ return { data, status: res.status, headers: res.headers };
2612
+ };
2598
2613
  var getGetPublicFormSubmissionUrl = (id, params) => {
2599
2614
  const normalizedParams = new URLSearchParams();
2600
2615
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -7175,6 +7190,29 @@ var listChatMessagesHandler = async (args, options) => {
7175
7190
  structuredContent: res.data
7176
7191
  };
7177
7192
  };
7193
+ var getChatEvaluationHandler = async (args, options) => {
7194
+ const res = await getChatEvaluation(args.pathParams.chatId, 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
+ };
7178
7216
  var getPublicFormSubmissionHandler = async (args, options) => {
7179
7217
  const res = await getPublicFormSubmission(args.pathParams.id, args.queryParams, options);
7180
7218
  if (res.status >= 400) {
@@ -12761,6 +12799,7 @@ var ListChatAgentsResponse = zod.object({
12761
12799
  "data": zod.array(zod.object({
12762
12800
  "id": zod.string(),
12763
12801
  "name": zod.string(),
12802
+ "evaluator_slug": zod.union([zod.string(), zod.null()]),
12764
12803
  "created_at": zod.string().datetime({ "offset": true }),
12765
12804
  "updated_at": zod.string().datetime({ "offset": true })
12766
12805
  })),
@@ -12776,6 +12815,7 @@ var GetChatAgentResponse = zod.object({
12776
12815
  "data": zod.object({
12777
12816
  "id": zod.string(),
12778
12817
  "name": zod.string(),
12818
+ "evaluator_slug": zod.union([zod.string(), zod.null()]),
12779
12819
  "created_at": zod.string().datetime({ "offset": true }),
12780
12820
  "updated_at": zod.string().datetime({ "offset": true }),
12781
12821
  "tool_ids": zod.array(zod.string())
@@ -12785,13 +12825,17 @@ var GetChatAgentResponse = zod.object({
12785
12825
  var UpdateChatAgentParams = zod.object({
12786
12826
  "chatAgentId": zod.string().uuid()
12787
12827
  });
12828
+ var updateChatAgentBodyEvaluatorSlugOneMax = 100;
12829
+ var updateChatAgentBodyEvaluatorSlugOneRegExp = new RegExp("^[a-z0-9]+(?:[-_][a-z0-9]+)*$");
12788
12830
  var UpdateChatAgentBody = zod.object({
12789
- "tools": zod.array(zod.string().uuid()).optional().describe("Replace the agent's attached code tool set. Omit to leave unchanged; pass [] to clear.")
12831
+ "tools": zod.array(zod.string().uuid()).optional().describe("Replace the agent's attached code tool set. Omit to leave unchanged; pass [] to clear."),
12832
+ "evaluator_slug": zod.union([zod.string().max(updateChatAgentBodyEvaluatorSlugOneMax).regex(updateChatAgentBodyEvaluatorSlugOneRegExp), zod.null()]).optional().describe("Evaluator that scores this agent's chats, created with `POST /v1/evaluators`. null detaches it. Omit to leave unchanged.")
12790
12833
  });
12791
12834
  var UpdateChatAgentResponse = zod.object({
12792
12835
  "data": zod.object({
12793
12836
  "id": zod.string(),
12794
12837
  "name": zod.string(),
12838
+ "evaluator_slug": zod.union([zod.string(), zod.null()]),
12795
12839
  "created_at": zod.string().datetime({ "offset": true }),
12796
12840
  "updated_at": zod.string().datetime({ "offset": true })
12797
12841
  }),
@@ -12926,7 +12970,12 @@ var ListChatsResponse = zod.object({
12926
12970
  "chat_agent_id": zod.string().uuid(),
12927
12971
  "status": zod.enum(["active", "ended"]),
12928
12972
  "created_at": zod.string().datetime({ "offset": true }),
12929
- "message_count": zod.number().int().min(listChatsResponseDataItemMessageCountMin).max(listChatsResponseDataItemMessageCountMax)
12973
+ "message_count": zod.number().int().min(listChatsResponseDataItemMessageCountMin).max(listChatsResponseDataItemMessageCountMax),
12974
+ "evaluation": zod.union([zod.object({
12975
+ "status": zod.string(),
12976
+ "score": zod.union([zod.number(), zod.null()]),
12977
+ "passed": zod.union([zod.boolean(), zod.null()])
12978
+ }), zod.null()])
12930
12979
  })),
12931
12980
  "message": zod.string(),
12932
12981
  "meta": zod.object({
@@ -12962,6 +13011,26 @@ var ListChatMessagesResponse = zod.object({
12962
13011
  "total": zod.number()
12963
13012
  })
12964
13013
  });
13014
+ var GetChatEvaluationParams = zod.object({
13015
+ "chatId": zod.string().uuid()
13016
+ });
13017
+ var GetChatEvaluationResponse = zod.object({
13018
+ "data": zod.object({
13019
+ "id": zod.string(),
13020
+ "evaluation_status": zod.union([zod.string().describe("Evaluation status"), zod.null()]),
13021
+ "score": zod.union([zod.number(), zod.null()]),
13022
+ "passed": zod.union([zod.boolean(), zod.null()]),
13023
+ "metrics": zod.array(zod.object({
13024
+ "slug": zod.string(),
13025
+ "name": zod.string(),
13026
+ "question": zod.string(),
13027
+ "pass": zod.union([zod.boolean(), zod.null()]),
13028
+ "score": zod.union([zod.number(), zod.null()]),
13029
+ "explanation": zod.union([zod.string(), zod.null()])
13030
+ }))
13031
+ }),
13032
+ "message": zod.string()
13033
+ });
12965
13034
  var GetPublicFormSubmissionParams = zod.object({
12966
13035
  "id": zod.string().uuid()
12967
13036
  });
@@ -17036,7 +17105,7 @@ var createMcpServer = (options) => {
17036
17105
  "updateChatAgent",
17037
17106
  {
17038
17107
  title: "Update chat agent",
17039
- description: "Patch a chat agent's settings. Today only the attached code tool set can be edited; future fields will be added under the same endpoint. The response returns the chat agent's metadata only and does not include the resulting tool list; the agent's `updated_at` is not bumped when only the tool set changes.",
17108
+ description: "Patch a chat agent's attached code tool set and evaluator. The response does not include the resulting tool list; the agent's `updated_at` is not bumped when only the tool set changes.\n\nSet `evaluator_slug` to score the agent's chats with that evaluator when they end. It applies to every chat that ends afterwards.",
17040
17109
  inputSchema: {
17041
17110
  pathParams: UpdateChatAgentParams,
17042
17111
  bodyParams: UpdateChatAgentBody.optional()
@@ -17196,7 +17265,7 @@ var createMcpServer = (options) => {
17196
17265
  "listChats",
17197
17266
  {
17198
17267
  title: "List chats",
17199
- description: "List the tenant's chats with pagination, sorting, and optional filtering by case. Returns chat metadata and message counts; messages are not included.",
17268
+ description: "List the tenant's chats with pagination, sorting, and optional filtering by case. Returns chat metadata, message counts and evaluation outcome; messages are not included.",
17200
17269
  inputSchema: {
17201
17270
  queryParams: ListChatsQueryParams
17202
17271
  },
@@ -17225,6 +17294,22 @@ var createMcpServer = (options) => {
17225
17294
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
17226
17295
  })
17227
17296
  );
17297
+ tools.getChatEvaluation = server2.registerTool(
17298
+ "getChatEvaluation",
17299
+ {
17300
+ title: "Get chat evaluation",
17301
+ description: "Retrieve the evaluation results for a chat, including overall score, pass status, and per-metric breakdowns.",
17302
+ inputSchema: {
17303
+ pathParams: GetChatEvaluationParams
17304
+ },
17305
+ outputSchema: GetChatEvaluationResponse,
17306
+ annotations: { readOnlyHint: true }
17307
+ },
17308
+ (args, ctx) => getChatEvaluationHandler(args, {
17309
+ ...options,
17310
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
17311
+ })
17312
+ );
17228
17313
  tools.getPublicFormSubmission = server2.registerTool(
17229
17314
  "getPublicFormSubmission",
17230
17315
  {
@@ -17720,7 +17805,7 @@ var createMcpServer = (options) => {
17720
17805
  "createEvaluator",
17721
17806
  {
17722
17807
  title: "Create an evaluator",
17723
- 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 `evaluators:write` permission.",
17808
+ description: "Create an evaluator: a named set of metrics that an LLM judge scores every call or chat of the agents it is attached to.\n\nEvaluators can't be changed after creation, so past 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, or to a chat agent with `PATCH /v1/chat-agents/{chatAgentId}` (`evaluator_slug`). Requires the `evaluators:write` permission.",
17724
17809
  inputSchema: {
17725
17810
  bodyParams: CreateEvaluatorBody.optional()
17726
17811
  },
@@ -18637,4 +18722,4 @@ var transport = new StdioServerTransport();
18637
18722
  server.connect(transport).then(() => {
18638
18723
  console.error("MCP server running on stdio");
18639
18724
  }).catch(console.error);
18640
- //# sourceMappingURL=server-IUMTYF25.js.map
18725
+ //# sourceMappingURL=server-2WLFXTEC.js.map