@avallon-labs/mcp 66.3.0 → 66.5.0-staging.1401
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
|
@@ -2535,6 +2535,21 @@ var postChatMessage = async (chatId, postChatMessageBody, options) => {
|
|
|
2535
2535
|
const data = body ? JSON.parse(body) : {};
|
|
2536
2536
|
return { data, status: res.status, headers: res.headers };
|
|
2537
2537
|
};
|
|
2538
|
+
var getEndChatUrl = () => {
|
|
2539
|
+
return `/public/v1/chat/end`;
|
|
2540
|
+
};
|
|
2541
|
+
var endChat = async (options) => {
|
|
2542
|
+
const res = await fetch(
|
|
2543
|
+
getEndChatUrl(),
|
|
2544
|
+
{
|
|
2545
|
+
...options,
|
|
2546
|
+
method: "POST"
|
|
2547
|
+
}
|
|
2548
|
+
);
|
|
2549
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2550
|
+
const data = body ? JSON.parse(body) : void 0;
|
|
2551
|
+
return { data, status: res.status, headers: res.headers };
|
|
2552
|
+
};
|
|
2538
2553
|
var getExchangeExternalIdentityTokenUrl = () => {
|
|
2539
2554
|
return `/public/v1/identity/token`;
|
|
2540
2555
|
};
|
|
@@ -3653,7 +3668,7 @@ var promoteCaseTypeVersion = async (caseTypeSlug, version, promoteCaseTypeVersio
|
|
|
3653
3668
|
var getCreateCaseTypeFieldUrl = (caseTypeSlug) => {
|
|
3654
3669
|
return `/v1/case-types/${caseTypeSlug}/fields`;
|
|
3655
3670
|
};
|
|
3656
|
-
var createCaseTypeField = async (caseTypeSlug,
|
|
3671
|
+
var createCaseTypeField = async (caseTypeSlug, createCaseTypeFieldBody, options) => {
|
|
3657
3672
|
const getHeaders = (h) => {
|
|
3658
3673
|
if (!h) return {};
|
|
3659
3674
|
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
@@ -3666,7 +3681,7 @@ var createCaseTypeField = async (caseTypeSlug, newCaseTypeField, options) => {
|
|
|
3666
3681
|
...options,
|
|
3667
3682
|
method: "POST",
|
|
3668
3683
|
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
3669
|
-
body: JSON.stringify(
|
|
3684
|
+
body: JSON.stringify(createCaseTypeFieldBody)
|
|
3670
3685
|
}
|
|
3671
3686
|
);
|
|
3672
3687
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
@@ -7113,6 +7128,29 @@ var postChatMessageHandler = async (args, options) => {
|
|
|
7113
7128
|
structuredContent: res.data
|
|
7114
7129
|
};
|
|
7115
7130
|
};
|
|
7131
|
+
var endChatHandler = async (options) => {
|
|
7132
|
+
const res = await endChat(options);
|
|
7133
|
+
if (res.status >= 400) {
|
|
7134
|
+
return {
|
|
7135
|
+
content: [
|
|
7136
|
+
{
|
|
7137
|
+
type: "text",
|
|
7138
|
+
text: JSON.stringify(res.data ?? null)
|
|
7139
|
+
}
|
|
7140
|
+
],
|
|
7141
|
+
isError: true
|
|
7142
|
+
};
|
|
7143
|
+
}
|
|
7144
|
+
return {
|
|
7145
|
+
content: [
|
|
7146
|
+
{
|
|
7147
|
+
type: "text",
|
|
7148
|
+
text: JSON.stringify(res.data ?? null)
|
|
7149
|
+
}
|
|
7150
|
+
],
|
|
7151
|
+
structuredContent: res.data
|
|
7152
|
+
};
|
|
7153
|
+
};
|
|
7116
7154
|
var exchangeExternalIdentityTokenHandler = async (args, options) => {
|
|
7117
7155
|
const res = await exchangeExternalIdentityToken(args.bodyParams, options);
|
|
7118
7156
|
if (res.status >= 400) {
|
|
@@ -12841,6 +12879,7 @@ var GetChatResponse = zod.object({
|
|
|
12841
12879
|
"data": zod.object({
|
|
12842
12880
|
"id": zod.string().uuid(),
|
|
12843
12881
|
"chat_agent_id": zod.string().uuid(),
|
|
12882
|
+
"status": zod.enum(["active", "ended"]),
|
|
12844
12883
|
"created_at": zod.string().datetime({ "offset": true }),
|
|
12845
12884
|
"messages": zod.array(zod.object({
|
|
12846
12885
|
"id": zod.string().uuid(),
|
|
@@ -12883,6 +12922,7 @@ var PostChatMessageResponse = zod.object({
|
|
|
12883
12922
|
}),
|
|
12884
12923
|
"message": zod.string()
|
|
12885
12924
|
});
|
|
12925
|
+
var EndChatResponse = zod.void();
|
|
12886
12926
|
var exchangeExternalIdentityTokenBodyProviderIdMax = 64;
|
|
12887
12927
|
var exchangeExternalIdentityTokenBodyInterclientTokenMax = 8192;
|
|
12888
12928
|
var ExchangeExternalIdentityTokenBody = zod.object({
|
|
@@ -12916,6 +12956,7 @@ var ListChatsResponse = zod.object({
|
|
|
12916
12956
|
"data": zod.array(zod.object({
|
|
12917
12957
|
"id": zod.string().uuid(),
|
|
12918
12958
|
"chat_agent_id": zod.string().uuid(),
|
|
12959
|
+
"status": zod.enum(["active", "ended"]),
|
|
12919
12960
|
"created_at": zod.string().datetime({ "offset": true }),
|
|
12920
12961
|
"message_count": zod.number().int().min(listChatsResponseDataItemMessageCountMin).max(listChatsResponseDataItemMessageCountMax)
|
|
12921
12962
|
})),
|
|
@@ -14089,14 +14130,15 @@ var CreateCaseTypeBody = zod.object({
|
|
|
14089
14130
|
"slug": zod.string().describe("Permanent identifier callers use for the type, e.g. `wc`. Lowercase letters, digits, - and _, starting with a letter."),
|
|
14090
14131
|
"name": zod.string().min(1),
|
|
14091
14132
|
"fields": zod.array(zod.object({
|
|
14092
|
-
"key": zod.string().regex(createCaseTypeBodyFieldsItemKeyRegExp).describe("Permanent, and never reused within the case type."),
|
|
14093
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]).describe("Permanent."),
|
|
14133
|
+
"key": zod.string().regex(createCaseTypeBodyFieldsItemKeyRegExp).describe("Permanent, and never reused within the same object, or the case type for top-level fields."),
|
|
14134
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]).describe("Permanent."),
|
|
14094
14135
|
"list": zod.boolean().default(createCaseTypeBodyFieldsItemListDefault).describe("Permanent."),
|
|
14095
14136
|
"label": zod.union([zod.string().min(1), zod.null()]).default(createCaseTypeBodyFieldsItemLabelDefault),
|
|
14096
14137
|
"description": zod.string(),
|
|
14097
14138
|
"nullable": zod.boolean().default(createCaseTypeBodyFieldsItemNullableDefault),
|
|
14098
14139
|
"enum": zod.union([zod.array(zod.string()).min(1), zod.null()]).default(createCaseTypeBodyFieldsItemEnumDefault),
|
|
14099
|
-
"sensitive": zod.boolean().default(createCaseTypeBodyFieldsItemSensitiveDefault)
|
|
14140
|
+
"sensitive": zod.boolean().default(createCaseTypeBodyFieldsItemSensitiveDefault),
|
|
14141
|
+
"fields": zod.unknown().optional()
|
|
14100
14142
|
})).default(createCaseTypeBodyFieldsDefault)
|
|
14101
14143
|
});
|
|
14102
14144
|
var CreateCaseTypeResponse = zod.object({
|
|
@@ -14116,12 +14158,13 @@ var CreateCaseTypeResponse = zod.object({
|
|
|
14116
14158
|
"key": zod.string(),
|
|
14117
14159
|
"label": zod.union([zod.string(), zod.null()]),
|
|
14118
14160
|
"description": zod.string(),
|
|
14119
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]),
|
|
14161
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]),
|
|
14120
14162
|
"list": zod.boolean(),
|
|
14121
14163
|
"nullable": zod.boolean(),
|
|
14122
14164
|
"enum": zod.union([zod.array(zod.string()), zod.null()]),
|
|
14123
14165
|
"sensitive": zod.boolean(),
|
|
14124
|
-
"created_at": zod.string().datetime({ "offset": true })
|
|
14166
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
14167
|
+
"fields": zod.array(zod.unknown())
|
|
14125
14168
|
}))
|
|
14126
14169
|
}),
|
|
14127
14170
|
"message": zod.string()
|
|
@@ -14175,12 +14218,13 @@ var GetCaseTypeResponse = zod.object({
|
|
|
14175
14218
|
"key": zod.string(),
|
|
14176
14219
|
"label": zod.union([zod.string(), zod.null()]),
|
|
14177
14220
|
"description": zod.string(),
|
|
14178
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]),
|
|
14221
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]),
|
|
14179
14222
|
"list": zod.boolean(),
|
|
14180
14223
|
"nullable": zod.boolean(),
|
|
14181
14224
|
"enum": zod.union([zod.array(zod.string()), zod.null()]),
|
|
14182
14225
|
"sensitive": zod.boolean(),
|
|
14183
|
-
"created_at": zod.string().datetime({ "offset": true })
|
|
14226
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
14227
|
+
"fields": zod.array(zod.unknown())
|
|
14184
14228
|
}))
|
|
14185
14229
|
}),
|
|
14186
14230
|
"message": zod.string()
|
|
@@ -14208,12 +14252,13 @@ var UpdateCaseTypeResponse = zod.object({
|
|
|
14208
14252
|
"key": zod.string(),
|
|
14209
14253
|
"label": zod.union([zod.string(), zod.null()]),
|
|
14210
14254
|
"description": zod.string(),
|
|
14211
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]),
|
|
14255
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]),
|
|
14212
14256
|
"list": zod.boolean(),
|
|
14213
14257
|
"nullable": zod.boolean(),
|
|
14214
14258
|
"enum": zod.union([zod.array(zod.string()), zod.null()]),
|
|
14215
14259
|
"sensitive": zod.boolean(),
|
|
14216
|
-
"created_at": zod.string().datetime({ "offset": true })
|
|
14260
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
14261
|
+
"fields": zod.array(zod.unknown())
|
|
14217
14262
|
}))
|
|
14218
14263
|
}),
|
|
14219
14264
|
"message": zod.string()
|
|
@@ -14265,12 +14310,13 @@ var GetCaseTypeVersionResponse = zod.object({
|
|
|
14265
14310
|
"key": zod.string(),
|
|
14266
14311
|
"label": zod.union([zod.string(), zod.null()]),
|
|
14267
14312
|
"description": zod.string(),
|
|
14268
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]),
|
|
14313
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]),
|
|
14269
14314
|
"list": zod.boolean(),
|
|
14270
14315
|
"nullable": zod.boolean(),
|
|
14271
14316
|
"enum": zod.union([zod.array(zod.string()), zod.null()]),
|
|
14272
14317
|
"sensitive": zod.boolean(),
|
|
14273
|
-
"created_at": zod.string().datetime({ "offset": true })
|
|
14318
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
14319
|
+
"fields": zod.array(zod.unknown())
|
|
14274
14320
|
}))
|
|
14275
14321
|
}),
|
|
14276
14322
|
"message": zod.string()
|
|
@@ -14298,15 +14344,35 @@ var createCaseTypeFieldBodyLabelDefault = null;
|
|
|
14298
14344
|
var createCaseTypeFieldBodyNullableDefault = false;
|
|
14299
14345
|
var createCaseTypeFieldBodyEnumDefault = null;
|
|
14300
14346
|
var createCaseTypeFieldBodySensitiveDefault = false;
|
|
14347
|
+
var createCaseTypeFieldBodyFieldsItemKeyRegExp = new RegExp("^[a-z][a-z0-9_]*$");
|
|
14348
|
+
var createCaseTypeFieldBodyFieldsItemListDefault = false;
|
|
14349
|
+
var createCaseTypeFieldBodyFieldsItemLabelDefault = null;
|
|
14350
|
+
var createCaseTypeFieldBodyFieldsItemNullableDefault = false;
|
|
14351
|
+
var createCaseTypeFieldBodyFieldsItemEnumDefault = null;
|
|
14352
|
+
var createCaseTypeFieldBodyFieldsItemSensitiveDefault = false;
|
|
14353
|
+
var createCaseTypeFieldBodyFieldsDefault = [];
|
|
14354
|
+
var createCaseTypeFieldBodyParentIdDefault = null;
|
|
14301
14355
|
var CreateCaseTypeFieldBody = zod.object({
|
|
14302
|
-
"key": zod.string().regex(createCaseTypeFieldBodyKeyRegExp).describe("Permanent, and never reused within the case type."),
|
|
14303
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]).describe("Permanent."),
|
|
14356
|
+
"key": zod.string().regex(createCaseTypeFieldBodyKeyRegExp).describe("Permanent, and never reused within the same object, or the case type for top-level fields."),
|
|
14357
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]).describe("Permanent."),
|
|
14304
14358
|
"list": zod.boolean().default(createCaseTypeFieldBodyListDefault).describe("Permanent."),
|
|
14305
14359
|
"label": zod.union([zod.string().min(1), zod.null()]).default(createCaseTypeFieldBodyLabelDefault),
|
|
14306
14360
|
"description": zod.string(),
|
|
14307
14361
|
"nullable": zod.boolean().default(createCaseTypeFieldBodyNullableDefault),
|
|
14308
14362
|
"enum": zod.union([zod.array(zod.string()).min(1), zod.null()]).default(createCaseTypeFieldBodyEnumDefault),
|
|
14309
|
-
"sensitive": zod.boolean().default(createCaseTypeFieldBodySensitiveDefault)
|
|
14363
|
+
"sensitive": zod.boolean().default(createCaseTypeFieldBodySensitiveDefault),
|
|
14364
|
+
"fields": zod.array(zod.object({
|
|
14365
|
+
"key": zod.string().regex(createCaseTypeFieldBodyFieldsItemKeyRegExp).describe("Permanent, and never reused within the same object, or the case type for top-level fields."),
|
|
14366
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]).describe("Permanent."),
|
|
14367
|
+
"list": zod.boolean().default(createCaseTypeFieldBodyFieldsItemListDefault).describe("Permanent."),
|
|
14368
|
+
"label": zod.union([zod.string().min(1), zod.null()]).default(createCaseTypeFieldBodyFieldsItemLabelDefault),
|
|
14369
|
+
"description": zod.string(),
|
|
14370
|
+
"nullable": zod.boolean().default(createCaseTypeFieldBodyFieldsItemNullableDefault),
|
|
14371
|
+
"enum": zod.union([zod.array(zod.string()).min(1), zod.null()]).default(createCaseTypeFieldBodyFieldsItemEnumDefault),
|
|
14372
|
+
"sensitive": zod.boolean().default(createCaseTypeFieldBodyFieldsItemSensitiveDefault),
|
|
14373
|
+
"fields": zod.unknown().optional()
|
|
14374
|
+
})).default(createCaseTypeFieldBodyFieldsDefault),
|
|
14375
|
+
"parent_id": zod.union([zod.string().uuid(), zod.null()]).default(createCaseTypeFieldBodyParentIdDefault).describe("Object field to add the field to.")
|
|
14310
14376
|
});
|
|
14311
14377
|
var CreateCaseTypeFieldResponse = zod.object({
|
|
14312
14378
|
"data": zod.object({
|
|
@@ -14314,12 +14380,13 @@ var CreateCaseTypeFieldResponse = zod.object({
|
|
|
14314
14380
|
"key": zod.string(),
|
|
14315
14381
|
"label": zod.union([zod.string(), zod.null()]),
|
|
14316
14382
|
"description": zod.string(),
|
|
14317
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]),
|
|
14383
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]),
|
|
14318
14384
|
"list": zod.boolean(),
|
|
14319
14385
|
"nullable": zod.boolean(),
|
|
14320
14386
|
"enum": zod.union([zod.array(zod.string()), zod.null()]),
|
|
14321
14387
|
"sensitive": zod.boolean(),
|
|
14322
|
-
"created_at": zod.string().datetime({ "offset": true })
|
|
14388
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
14389
|
+
"fields": zod.array(zod.unknown())
|
|
14323
14390
|
}),
|
|
14324
14391
|
"message": zod.string()
|
|
14325
14392
|
});
|
|
@@ -14340,12 +14407,13 @@ var UpdateCaseTypeFieldResponse = zod.object({
|
|
|
14340
14407
|
"key": zod.string(),
|
|
14341
14408
|
"label": zod.union([zod.string(), zod.null()]),
|
|
14342
14409
|
"description": zod.string(),
|
|
14343
|
-
"type": zod.enum(["string", "number", "boolean", "date", "date_time"]),
|
|
14410
|
+
"type": zod.enum(["string", "number", "boolean", "date", "date_time", "object"]),
|
|
14344
14411
|
"list": zod.boolean(),
|
|
14345
14412
|
"nullable": zod.boolean(),
|
|
14346
14413
|
"enum": zod.union([zod.array(zod.string()), zod.null()]),
|
|
14347
14414
|
"sensitive": zod.boolean(),
|
|
14348
|
-
"created_at": zod.string().datetime({ "offset": true })
|
|
14415
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
14416
|
+
"fields": zod.array(zod.unknown())
|
|
14349
14417
|
}),
|
|
14350
14418
|
"message": zod.string()
|
|
14351
14419
|
});
|
|
@@ -17143,6 +17211,19 @@ var createMcpServer = (options) => {
|
|
|
17143
17211
|
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
17144
17212
|
})
|
|
17145
17213
|
);
|
|
17214
|
+
tools.endChat = server2.registerTool(
|
|
17215
|
+
"endChat",
|
|
17216
|
+
{
|
|
17217
|
+
title: "End a chat",
|
|
17218
|
+
description: "End a chat. Further messages are rejected with `409`. Ending an ended chat also returns `204`.",
|
|
17219
|
+
outputSchema: EndChatResponse,
|
|
17220
|
+
annotations: { destructiveHint: true }
|
|
17221
|
+
},
|
|
17222
|
+
(ctx) => endChatHandler({
|
|
17223
|
+
...options,
|
|
17224
|
+
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
17225
|
+
})
|
|
17226
|
+
);
|
|
17146
17227
|
tools.exchangeExternalIdentityToken = server2.registerTool(
|
|
17147
17228
|
"exchangeExternalIdentityToken",
|
|
17148
17229
|
{
|
|
@@ -18074,7 +18155,7 @@ var createMcpServer = (options) => {
|
|
|
18074
18155
|
"updateCaseTypeField",
|
|
18075
18156
|
{
|
|
18076
18157
|
title: "Update case type field",
|
|
18077
|
-
description: "Change a field's label, description, nullability, enum or sensitivity. Creates a new version when something changes; promote it to use the change. A field's key, type
|
|
18158
|
+
description: "Change a field's label, description, nullability, enum or sensitivity. Creates a new version when something changes; promote it to use the change. A field's key, type, list-ness and parent are permanent.",
|
|
18078
18159
|
inputSchema: {
|
|
18079
18160
|
pathParams: UpdateCaseTypeFieldParams,
|
|
18080
18161
|
bodyParams: UpdateCaseTypeFieldBody.optional()
|
|
@@ -18091,7 +18172,7 @@ var createMcpServer = (options) => {
|
|
|
18091
18172
|
"deleteCaseTypeField",
|
|
18092
18173
|
{
|
|
18093
18174
|
title: "Delete case type field",
|
|
18094
|
-
description: "Remove a field from a case type. Creates a new version; once it is promoted, the field can't be written. Cases keep their values, and the key can't be reused.",
|
|
18175
|
+
description: "Remove a field from a case type. Creates a new version; once it is promoted, the field can't be written. Deleting an object deletes its fields with it. Cases keep their values, and the key can't be reused.",
|
|
18095
18176
|
inputSchema: {
|
|
18096
18177
|
pathParams: DeleteCaseTypeFieldParams
|
|
18097
18178
|
},
|
|
@@ -18604,4 +18685,4 @@ var transport = new StdioServerTransport();
|
|
|
18604
18685
|
server.connect(transport).then(() => {
|
|
18605
18686
|
console.error("MCP server running on stdio");
|
|
18606
18687
|
}).catch(console.error);
|
|
18607
|
-
//# sourceMappingURL=server-
|
|
18688
|
+
//# sourceMappingURL=server-AKWIQJHV.js.map
|