@avallon-labs/mcp 52.2.0-staging.1199 → 52.3.0-staging.1202
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
|
@@ -2354,6 +2354,29 @@ var postChatMessage = async (chatId, postChatMessageBody, options) => {
|
|
|
2354
2354
|
const data = body ? JSON.parse(body) : {};
|
|
2355
2355
|
return { data, status: res.status, headers: res.headers };
|
|
2356
2356
|
};
|
|
2357
|
+
var getExchangeExternalIdentityTokenUrl = () => {
|
|
2358
|
+
return `/public/v1/identity/token`;
|
|
2359
|
+
};
|
|
2360
|
+
var exchangeExternalIdentityToken = async (exchangeExternalIdentityTokenBody, options) => {
|
|
2361
|
+
const getHeaders = (h) => {
|
|
2362
|
+
if (!h) return {};
|
|
2363
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
2364
|
+
if (Array.isArray(h)) return Object.fromEntries(h);
|
|
2365
|
+
return h;
|
|
2366
|
+
};
|
|
2367
|
+
const res = await fetch(
|
|
2368
|
+
getExchangeExternalIdentityTokenUrl(),
|
|
2369
|
+
{
|
|
2370
|
+
...options,
|
|
2371
|
+
method: "POST",
|
|
2372
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
2373
|
+
body: JSON.stringify(exchangeExternalIdentityTokenBody)
|
|
2374
|
+
}
|
|
2375
|
+
);
|
|
2376
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2377
|
+
const data = body ? JSON.parse(body) : {};
|
|
2378
|
+
return { data, status: res.status, headers: res.headers };
|
|
2379
|
+
};
|
|
2357
2380
|
var getListChatsUrl = (params) => {
|
|
2358
2381
|
const normalizedParams = new URLSearchParams();
|
|
2359
2382
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -6130,6 +6153,29 @@ var postChatMessageHandler = async (args, options) => {
|
|
|
6130
6153
|
structuredContent: res.data
|
|
6131
6154
|
};
|
|
6132
6155
|
};
|
|
6156
|
+
var exchangeExternalIdentityTokenHandler = async (args, options) => {
|
|
6157
|
+
const res = await exchangeExternalIdentityToken(args.bodyParams, options);
|
|
6158
|
+
if (res.status >= 400) {
|
|
6159
|
+
return {
|
|
6160
|
+
content: [
|
|
6161
|
+
{
|
|
6162
|
+
type: "text",
|
|
6163
|
+
text: JSON.stringify(res.data ?? null)
|
|
6164
|
+
}
|
|
6165
|
+
],
|
|
6166
|
+
isError: true
|
|
6167
|
+
};
|
|
6168
|
+
}
|
|
6169
|
+
return {
|
|
6170
|
+
content: [
|
|
6171
|
+
{
|
|
6172
|
+
type: "text",
|
|
6173
|
+
text: JSON.stringify(res.data ?? null)
|
|
6174
|
+
}
|
|
6175
|
+
],
|
|
6176
|
+
structuredContent: res.data
|
|
6177
|
+
};
|
|
6178
|
+
};
|
|
6133
6179
|
var listChatsHandler = async (args, options) => {
|
|
6134
6180
|
const res = await listChats(args.queryParams, options);
|
|
6135
6181
|
if (res.status >= 400) {
|
|
@@ -10682,6 +10728,19 @@ var PostChatMessageResponse = zod.object({
|
|
|
10682
10728
|
}),
|
|
10683
10729
|
"message": zod.string()
|
|
10684
10730
|
});
|
|
10731
|
+
var exchangeExternalIdentityTokenBodyProviderIdMax = 64;
|
|
10732
|
+
var exchangeExternalIdentityTokenBodyInterclientTokenMax = 8192;
|
|
10733
|
+
var ExchangeExternalIdentityTokenBody = zod.object({
|
|
10734
|
+
"provider_id": zod.string().min(1).max(exchangeExternalIdentityTokenBodyProviderIdMax),
|
|
10735
|
+
"interclient_token": zod.string().min(1).max(exchangeExternalIdentityTokenBodyInterclientTokenMax)
|
|
10736
|
+
});
|
|
10737
|
+
var ExchangeExternalIdentityTokenResponse = zod.object({
|
|
10738
|
+
"data": zod.object({
|
|
10739
|
+
"identity_token": zod.string(),
|
|
10740
|
+
"expires_in": zod.number()
|
|
10741
|
+
}),
|
|
10742
|
+
"message": zod.string()
|
|
10743
|
+
});
|
|
10685
10744
|
var listChatsQueryCountDefault = 50;
|
|
10686
10745
|
var listChatsQueryCountMax = 100;
|
|
10687
10746
|
var listChatsQueryOffsetDefault = 0;
|
|
@@ -14053,6 +14112,22 @@ var createMcpServer = (options) => {
|
|
|
14053
14112
|
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
14054
14113
|
})
|
|
14055
14114
|
);
|
|
14115
|
+
tools.exchangeExternalIdentityToken = server2.registerTool(
|
|
14116
|
+
"exchangeExternalIdentityToken",
|
|
14117
|
+
{
|
|
14118
|
+
title: "Exchange an external identity token",
|
|
14119
|
+
description: "Redeem a single-use interclient token from a partner identity provider for a short-lived Avallon identity token. A malformed request body returns 400. A rejected exchange returns 401; the interclient token may already be spent, so request a fresh one before retrying.",
|
|
14120
|
+
inputSchema: {
|
|
14121
|
+
bodyParams: ExchangeExternalIdentityTokenBody.optional()
|
|
14122
|
+
},
|
|
14123
|
+
outputSchema: ExchangeExternalIdentityTokenResponse,
|
|
14124
|
+
annotations: { destructiveHint: true }
|
|
14125
|
+
},
|
|
14126
|
+
(args, ctx) => exchangeExternalIdentityTokenHandler(args, {
|
|
14127
|
+
...options,
|
|
14128
|
+
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
14129
|
+
})
|
|
14130
|
+
);
|
|
14056
14131
|
tools.listChats = server2.registerTool(
|
|
14057
14132
|
"listChats",
|
|
14058
14133
|
{
|
|
@@ -15027,4 +15102,4 @@ var transport = new StdioServerTransport();
|
|
|
15027
15102
|
server.connect(transport).then(() => {
|
|
15028
15103
|
console.error("MCP server running on stdio");
|
|
15029
15104
|
}).catch(console.error);
|
|
15030
|
-
//# sourceMappingURL=server-
|
|
15105
|
+
//# sourceMappingURL=server-6DHTSJVV.js.map
|