@kajidog/connpass-mcp-server 0.2.0 → 0.4.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/README.md +72 -149
- package/dist/index.d.ts +0 -2
- package/dist/index.js +4729 -162
- package/dist/index.js.map +1 -1
- package/dist/mcp-app.html +139 -0
- package/dist/stdio.d.ts +1 -0
- package/dist/stdio.js +2120 -0
- package/dist/stdio.js.map +1 -0
- package/package.json +21 -20
- package/dist/apps-sdk.d.ts +0 -8
- package/dist/apps-sdk.d.ts.map +0 -1
- package/dist/apps-sdk.js +0 -79
- package/dist/apps-sdk.js.map +0 -1
- package/dist/config.d.ts +0 -7
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -82
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/tools/events.d.ts +0 -82
- package/dist/tools/events.d.ts.map +0 -1
- package/dist/tools/events.js +0 -385
- package/dist/tools/events.js.map +0 -1
- package/dist/tools/formatting.d.ts +0 -74
- package/dist/tools/formatting.d.ts.map +0 -1
- package/dist/tools/formatting.js +0 -211
- package/dist/tools/formatting.js.map +0 -1
- package/dist/tools/groups.d.ts +0 -48
- package/dist/tools/groups.d.ts.map +0 -1
- package/dist/tools/groups.js +0 -106
- package/dist/tools/groups.js.map +0 -1
- package/dist/tools/index.d.ts +0 -58
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -21
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/shared.d.ts +0 -24
- package/dist/tools/shared.d.ts.map +0 -1
- package/dist/tools/shared.js +0 -113
- package/dist/tools/shared.js.map +0 -1
- package/dist/tools/users.d.ts +0 -51
- package/dist/tools/users.d.ts.map +0 -1
- package/dist/tools/users.js +0 -239
- package/dist/tools/users.js.map +0 -1
- package/dist/transports/http.d.ts +0 -17
- package/dist/transports/http.d.ts.map +0 -1
- package/dist/transports/http.js +0 -185
- package/dist/transports/http.js.map +0 -1
- package/dist/transports/sse.d.ts +0 -21
- package/dist/transports/sse.d.ts.map +0 -1
- package/dist/transports/sse.js +0 -161
- package/dist/transports/sse.js.map +0 -1
- package/dist/widgets/connpass-events.d.ts +0 -29
- package/dist/widgets/connpass-events.d.ts.map +0 -1
- package/dist/widgets/connpass-events.html +0 -2269
- package/dist/widgets/connpass-events.js +0 -58
- package/dist/widgets/connpass-events.js.map +0 -1
- package/dist/widgets/index.d.ts +0 -6
- package/dist/widgets/index.d.ts.map +0 -1
- package/dist/widgets/index.js +0 -34
- package/dist/widgets/index.js.map +0 -1
package/dist/tools/formatting.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.truncateText = truncateText;
|
|
4
|
-
exports.stripHtml = stripHtml;
|
|
5
|
-
exports.sanitizeRichText = sanitizeRichText;
|
|
6
|
-
exports.formatPresentation = formatPresentation;
|
|
7
|
-
exports.formatPresentationsResponse = formatPresentationsResponse;
|
|
8
|
-
exports.formatEvent = formatEvent;
|
|
9
|
-
exports.formatEventsResponse = formatEventsResponse;
|
|
10
|
-
exports.formatEventList = formatEventList;
|
|
11
|
-
const HTML_ENTITY_MAP = {
|
|
12
|
-
" ": " ",
|
|
13
|
-
"&": "&",
|
|
14
|
-
"<": "<",
|
|
15
|
-
">": ">",
|
|
16
|
-
""": '"',
|
|
17
|
-
""": '"',
|
|
18
|
-
"'": "'",
|
|
19
|
-
"'": "'",
|
|
20
|
-
"`": "`",
|
|
21
|
-
};
|
|
22
|
-
function truncateText(text, limit) {
|
|
23
|
-
if (!text) {
|
|
24
|
-
return "";
|
|
25
|
-
}
|
|
26
|
-
if (text.length <= limit) {
|
|
27
|
-
return text;
|
|
28
|
-
}
|
|
29
|
-
if (limit <= 3) {
|
|
30
|
-
return text.slice(0, limit);
|
|
31
|
-
}
|
|
32
|
-
return `${text.slice(0, limit - 3).trimEnd()}...`;
|
|
33
|
-
}
|
|
34
|
-
function decodeHtmlEntities(input) {
|
|
35
|
-
return input
|
|
36
|
-
.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (entity) => {
|
|
37
|
-
const mapped = HTML_ENTITY_MAP[entity];
|
|
38
|
-
if (mapped) {
|
|
39
|
-
return mapped;
|
|
40
|
-
}
|
|
41
|
-
const numericMatch = entity.match(/^&#(x?[0-9a-fA-F]+);$/);
|
|
42
|
-
if (!numericMatch) {
|
|
43
|
-
return entity;
|
|
44
|
-
}
|
|
45
|
-
const value = numericMatch[1];
|
|
46
|
-
const codePoint = value.startsWith("x") || value.startsWith("X")
|
|
47
|
-
? Number.parseInt(value.slice(1), 16)
|
|
48
|
-
: Number.parseInt(value, 10);
|
|
49
|
-
if (!Number.isFinite(codePoint)) {
|
|
50
|
-
return entity;
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
return String.fromCodePoint(codePoint);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return entity;
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
.replace(/\u00a0/gi, " ");
|
|
60
|
-
}
|
|
61
|
-
function stripHtml(input) {
|
|
62
|
-
if (!input) {
|
|
63
|
-
return "";
|
|
64
|
-
}
|
|
65
|
-
const withoutScripts = input.replace(/<script[\s\S]*?<\/script>/gi, "");
|
|
66
|
-
const withoutStyles = withoutScripts.replace(/<style[\s\S]*?<\/style>/gi, "");
|
|
67
|
-
const withLineBreaks = withoutStyles
|
|
68
|
-
.replace(/<br\s*\/?\s*>/gi, "\n")
|
|
69
|
-
.replace(/<\/(p|div|section|article|header|footer|li)>/gi, "\n")
|
|
70
|
-
.replace(/<li[^>]*>/gi, "- ")
|
|
71
|
-
.replace(/<\/(h[1-6]|tr)>/gi, "\n");
|
|
72
|
-
const withoutTags = withLineBreaks.replace(/<[^>]+>/g, "");
|
|
73
|
-
return decodeHtmlEntities(withoutTags);
|
|
74
|
-
}
|
|
75
|
-
function sanitizeRichText(input) {
|
|
76
|
-
if (!input) {
|
|
77
|
-
return "";
|
|
78
|
-
}
|
|
79
|
-
const stripped = stripHtml(input);
|
|
80
|
-
const normalizedWhitespace = stripped
|
|
81
|
-
.replace(/\r/g, "\n")
|
|
82
|
-
.split(/\n+/)
|
|
83
|
-
.map((line) => line.trim())
|
|
84
|
-
.filter(Boolean)
|
|
85
|
-
.join("\n");
|
|
86
|
-
return normalizedWhitespace.replace(/[\t ]+/g, " ").trim();
|
|
87
|
-
}
|
|
88
|
-
function formatPresentation(presentation, descriptionLimit) {
|
|
89
|
-
const summary = sanitizeRichText(presentation.description);
|
|
90
|
-
const formatted = {
|
|
91
|
-
id: presentation.id,
|
|
92
|
-
title: presentation.title.trim(),
|
|
93
|
-
speaker: presentation.speakerName,
|
|
94
|
-
order: presentation.order,
|
|
95
|
-
updatedAt: presentation.updatedAt,
|
|
96
|
-
};
|
|
97
|
-
const processedSummary = typeof descriptionLimit === "number" && descriptionLimit > 0
|
|
98
|
-
? truncateText(summary, descriptionLimit)
|
|
99
|
-
: summary;
|
|
100
|
-
if (processedSummary) {
|
|
101
|
-
formatted.summary = processedSummary;
|
|
102
|
-
}
|
|
103
|
-
const links = {
|
|
104
|
-
url: presentation.url,
|
|
105
|
-
slideshare: presentation.slideshareUrl,
|
|
106
|
-
youtube: presentation.youtubeUrl,
|
|
107
|
-
twitter: presentation.twitterUrl,
|
|
108
|
-
};
|
|
109
|
-
if (links.url || links.slideshare || links.youtube || links.twitter) {
|
|
110
|
-
formatted.links = links;
|
|
111
|
-
}
|
|
112
|
-
return formatted;
|
|
113
|
-
}
|
|
114
|
-
function formatPresentationsResponse(response, options) {
|
|
115
|
-
const descriptionLimit = options?.presentationDescriptionLimit;
|
|
116
|
-
return {
|
|
117
|
-
returned: response.presentationsReturned,
|
|
118
|
-
presentations: response.presentations.map((presentation) => formatPresentation(presentation, descriptionLimit)),
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function formatEvent(event, options) {
|
|
122
|
-
const descriptionLimit = options?.descriptionLimit;
|
|
123
|
-
const catchPhraseLimit = options?.catchPhraseLimit;
|
|
124
|
-
const presentationDescriptionLimit = options?.presentationDescriptionLimit;
|
|
125
|
-
const catchPhrase = sanitizeRichText(event.catchPhrase);
|
|
126
|
-
const description = sanitizeRichText(event.description);
|
|
127
|
-
const participants = {
|
|
128
|
-
accepted: event.participantCount,
|
|
129
|
-
waiting: event.waitingCount,
|
|
130
|
-
};
|
|
131
|
-
if (typeof event.limit === "number") {
|
|
132
|
-
participants.limit = event.limit;
|
|
133
|
-
}
|
|
134
|
-
const formatted = {
|
|
135
|
-
id: event.id,
|
|
136
|
-
title: event.title.trim(),
|
|
137
|
-
url: event.url,
|
|
138
|
-
schedule: {
|
|
139
|
-
start: event.startedAt,
|
|
140
|
-
end: event.endedAt,
|
|
141
|
-
},
|
|
142
|
-
owner: {
|
|
143
|
-
nickname: event.ownerNickname,
|
|
144
|
-
displayName: event.ownerDisplayName,
|
|
145
|
-
},
|
|
146
|
-
participants,
|
|
147
|
-
updatedAt: event.updatedAt,
|
|
148
|
-
};
|
|
149
|
-
if (event.hashTag) {
|
|
150
|
-
formatted.hashTag = event.hashTag;
|
|
151
|
-
}
|
|
152
|
-
if (event.imageUrl) {
|
|
153
|
-
formatted.imageUrl = event.imageUrl;
|
|
154
|
-
}
|
|
155
|
-
const processedCatchPhrase = typeof catchPhraseLimit === "number" && catchPhraseLimit > 0
|
|
156
|
-
? truncateText(catchPhrase, catchPhraseLimit)
|
|
157
|
-
: catchPhrase;
|
|
158
|
-
if (processedCatchPhrase) {
|
|
159
|
-
formatted.catchPhrase = processedCatchPhrase;
|
|
160
|
-
}
|
|
161
|
-
const processedDescription = typeof descriptionLimit === "number" && descriptionLimit > 0
|
|
162
|
-
? truncateText(description, descriptionLimit)
|
|
163
|
-
: description;
|
|
164
|
-
if (processedDescription) {
|
|
165
|
-
formatted.summary = processedDescription;
|
|
166
|
-
}
|
|
167
|
-
if (event.place || event.address) {
|
|
168
|
-
const location = {};
|
|
169
|
-
if (event.place) {
|
|
170
|
-
location.place = event.place;
|
|
171
|
-
}
|
|
172
|
-
if (event.address) {
|
|
173
|
-
location.address = event.address;
|
|
174
|
-
}
|
|
175
|
-
if (Object.keys(location).length > 0) {
|
|
176
|
-
formatted.location = location;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
if (event.groupId || event.groupTitle || event.groupUrl) {
|
|
180
|
-
const group = {};
|
|
181
|
-
if (typeof event.groupId === "number") {
|
|
182
|
-
group.id = event.groupId;
|
|
183
|
-
}
|
|
184
|
-
if (event.groupTitle) {
|
|
185
|
-
group.title = event.groupTitle;
|
|
186
|
-
}
|
|
187
|
-
if (event.groupUrl) {
|
|
188
|
-
group.url = event.groupUrl;
|
|
189
|
-
}
|
|
190
|
-
if (Object.keys(group).length > 0) {
|
|
191
|
-
formatted.group = group;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
const eventWithPresentations = event;
|
|
195
|
-
if (eventWithPresentations.presentations?.length) {
|
|
196
|
-
formatted.presentations = eventWithPresentations.presentations.map((presentation) => formatPresentation(presentation, presentationDescriptionLimit));
|
|
197
|
-
}
|
|
198
|
-
return formatted;
|
|
199
|
-
}
|
|
200
|
-
function formatEventsResponse(response, options) {
|
|
201
|
-
return {
|
|
202
|
-
returned: response.eventsReturned,
|
|
203
|
-
available: response.eventsAvailable,
|
|
204
|
-
start: response.eventsStart,
|
|
205
|
-
events: response.events.map((event) => formatEvent(event, options)),
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function formatEventList(events, options) {
|
|
209
|
-
return events.map((event) => formatEvent(event, options));
|
|
210
|
-
}
|
|
211
|
-
//# sourceMappingURL=formatting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src/tools/formatting.ts"],"names":[],"mappings":";;AAsFA,oCAcC;AAkCD,8BAgBC;AAED,4CAcC;AAED,gDAmCC;AAED,kEAYC;AA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c;QACjC,SAAS,EAAE,QAAQ,CAAC,eAAe;QACnC,KAAK,EAAE,QAAQ,CAAC,WAAW;QAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;KACpE,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe,CAC7B,MAEI,EACJ,OAA4B;IAE5B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
package/dist/tools/groups.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ConnpassClient } from "@kajidog/connpass-api-client";
|
|
2
|
-
declare const groupHandlers: {
|
|
3
|
-
search_groups(args: unknown, connpassClient: ConnpassClient): Promise<import("@kajidog/connpass-api-client").GroupsResponse>;
|
|
4
|
-
};
|
|
5
|
-
export type GroupToolName = keyof typeof groupHandlers;
|
|
6
|
-
export declare const groupTools: {
|
|
7
|
-
[x: string]: unknown;
|
|
8
|
-
name: string;
|
|
9
|
-
inputSchema: {
|
|
10
|
-
[x: string]: unknown;
|
|
11
|
-
type: "object";
|
|
12
|
-
properties?: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
} | undefined;
|
|
15
|
-
required?: string[] | undefined;
|
|
16
|
-
};
|
|
17
|
-
title?: string | undefined;
|
|
18
|
-
description?: string | undefined;
|
|
19
|
-
_meta?: {
|
|
20
|
-
[x: string]: unknown;
|
|
21
|
-
} | undefined;
|
|
22
|
-
icons?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
src: string;
|
|
25
|
-
mimeType?: string | undefined;
|
|
26
|
-
sizes?: string[] | undefined;
|
|
27
|
-
}[] | undefined;
|
|
28
|
-
outputSchema?: {
|
|
29
|
-
[x: string]: unknown;
|
|
30
|
-
type: "object";
|
|
31
|
-
properties?: {
|
|
32
|
-
[x: string]: unknown;
|
|
33
|
-
} | undefined;
|
|
34
|
-
required?: string[] | undefined;
|
|
35
|
-
} | undefined;
|
|
36
|
-
annotations?: {
|
|
37
|
-
[x: string]: unknown;
|
|
38
|
-
title?: string | undefined;
|
|
39
|
-
readOnlyHint?: boolean | undefined;
|
|
40
|
-
destructiveHint?: boolean | undefined;
|
|
41
|
-
idempotentHint?: boolean | undefined;
|
|
42
|
-
openWorldHint?: boolean | undefined;
|
|
43
|
-
} | undefined;
|
|
44
|
-
}[];
|
|
45
|
-
export declare function isGroupTool(name: string): name is GroupToolName;
|
|
46
|
-
export declare function handleGroupTool(name: GroupToolName, args: unknown, connpassClient: ConnpassClient): Promise<import("@kajidog/connpass-api-client").GroupsResponse>;
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=groups.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../src/tools/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AA0G9D,QAAA,MAAM,aAAa;wBACS,OAAO,kBAAkB,cAAc;CAKlE,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,aAAa,CAAC;AAEvD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAqB,CAAC;AAE7C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAE/D;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,cAAc,kEAG/B"}
|
package/dist/tools/groups.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.groupTools = void 0;
|
|
4
|
-
exports.isGroupTool = isGroupTool;
|
|
5
|
-
exports.handleGroupTool = handleGroupTool;
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
const shared_js_1 = require("./shared.js");
|
|
8
|
-
const GroupSearchInputSchema = zod_1.z.object({
|
|
9
|
-
query: zod_1.z
|
|
10
|
-
.string()
|
|
11
|
-
.min(1)
|
|
12
|
-
.describe("Search for groups whose title or description matches all keywords")
|
|
13
|
-
.optional(),
|
|
14
|
-
groupIds: zod_1.z
|
|
15
|
-
.array(zod_1.z.number())
|
|
16
|
-
.describe("Limit results to these group IDs")
|
|
17
|
-
.optional(),
|
|
18
|
-
country: zod_1.z.string().min(1).describe("ISO country code, e.g. 'JP'").optional(),
|
|
19
|
-
prefecture: zod_1.z
|
|
20
|
-
.string()
|
|
21
|
-
.min(1)
|
|
22
|
-
.describe("Prefecture name to filter by")
|
|
23
|
-
.optional(),
|
|
24
|
-
page: zod_1.z.number().int().min(1).describe("1-based page number").optional(),
|
|
25
|
-
pageSize: zod_1.z
|
|
26
|
-
.number()
|
|
27
|
-
.int()
|
|
28
|
-
.min(1)
|
|
29
|
-
.max(100)
|
|
30
|
-
.describe("How many groups per page (default 20)")
|
|
31
|
-
.optional(),
|
|
32
|
-
sort: zod_1.z
|
|
33
|
-
.enum(shared_js_1.GROUP_SORT_KEYS)
|
|
34
|
-
.describe("Ranking by activity, members, or recency")
|
|
35
|
-
.optional(),
|
|
36
|
-
});
|
|
37
|
-
function buildGroupSearchParams(input, options) {
|
|
38
|
-
const pagination = (0, shared_js_1.applyPagination)(input.page, input.pageSize, options);
|
|
39
|
-
return {
|
|
40
|
-
keyword: input.query,
|
|
41
|
-
groupId: input.groupIds,
|
|
42
|
-
countryCode: input.country,
|
|
43
|
-
prefecture: input.prefecture,
|
|
44
|
-
order: input.sort ? shared_js_1.GROUP_SORT_MAP[input.sort] : undefined,
|
|
45
|
-
...pagination,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const groupToolsInternal = [
|
|
49
|
-
{
|
|
50
|
-
name: "search_groups",
|
|
51
|
-
description: "Find Connpass groups with simple filters",
|
|
52
|
-
inputSchema: {
|
|
53
|
-
type: "object",
|
|
54
|
-
properties: {
|
|
55
|
-
query: {
|
|
56
|
-
type: "string",
|
|
57
|
-
description: "Keywords that must match the group title or description",
|
|
58
|
-
},
|
|
59
|
-
groupIds: {
|
|
60
|
-
type: "array",
|
|
61
|
-
items: { type: "number" },
|
|
62
|
-
description: "Only show these specific group IDs",
|
|
63
|
-
},
|
|
64
|
-
country: {
|
|
65
|
-
type: "string",
|
|
66
|
-
description: "ISO country code, e.g. 'JP'",
|
|
67
|
-
},
|
|
68
|
-
prefecture: {
|
|
69
|
-
type: "string",
|
|
70
|
-
description: "Prefecture name to filter by",
|
|
71
|
-
},
|
|
72
|
-
page: {
|
|
73
|
-
type: "integer",
|
|
74
|
-
minimum: 1,
|
|
75
|
-
description: "1-based page number (default 1)",
|
|
76
|
-
},
|
|
77
|
-
pageSize: {
|
|
78
|
-
type: "integer",
|
|
79
|
-
minimum: 1,
|
|
80
|
-
maximum: 100,
|
|
81
|
-
description: "Groups per page (default 20)",
|
|
82
|
-
},
|
|
83
|
-
sort: {
|
|
84
|
-
type: "string",
|
|
85
|
-
enum: [...shared_js_1.GROUP_SORT_KEYS],
|
|
86
|
-
description: "Rank by activity, member count, or recency",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
const groupHandlers = {
|
|
93
|
-
async search_groups(args, connpassClient) {
|
|
94
|
-
const params = GroupSearchInputSchema.parse(args ?? {});
|
|
95
|
-
const searchParams = buildGroupSearchParams(params);
|
|
96
|
-
return connpassClient.searchGroups(searchParams);
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
exports.groupTools = groupToolsInternal;
|
|
100
|
-
function isGroupTool(name) {
|
|
101
|
-
return name in groupHandlers;
|
|
102
|
-
}
|
|
103
|
-
async function handleGroupTool(name, args, connpassClient) {
|
|
104
|
-
return groupHandlers[name](args, connpassClient);
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=groups.js.map
|
package/dist/tools/groups.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../src/tools/groups.ts"],"names":[],"mappings":";;;AAsHA,kCAEC;AAED,0CAMC;AA9HD,6BAAwB;AAExB,2CAKqB;AAErB,MAAM,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,mEAAmE,CACpE;SACA,QAAQ,EAAE;IACb,QAAQ,EAAE,OAAC;SACR,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CAAC,kCAAkC,CAAC;SAC5C,QAAQ,EAAE;IACb,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE;IAC7E,UAAU,EAAE,OAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,8BAA8B,CAAC;SACxC,QAAQ,EAAE;IACb,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE;IACxE,QAAQ,EAAE,OAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CAAC,uCAAuC,CAAC;SACjD,QAAQ,EAAE;IACb,IAAI,EAAE,OAAC;SACJ,IAAI,CAAC,2BAAe,CAAC;SACrB,QAAQ,CAAC,0CAA0C,CAAC;SACpD,QAAQ,EAAE;CACd,CAA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;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,GAAG,2BAAe,CAAC;oBAC1B,WAAW,EAAE,4CAA4C;iBAC1D;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,KAAK,CAAC,aAAa,CAAC,IAAa,EAAE,cAA8B;QAC/D,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACxD,MAAM,YAAY,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACpD,OAAO,cAAc,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;CACF,CAAC;AAIW,QAAA,UAAU,GAAG,kBAAkB,CAAC;AAE7C,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI,IAAI,aAAa,CAAC;AAC/B,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,IAAmB,EACnB,IAAa,EACb,cAA8B;IAE9B,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ConnpassClient } from "@kajidog/connpass-api-client";
|
|
2
|
-
export declare const tools: {
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
name: string;
|
|
5
|
-
inputSchema: {
|
|
6
|
-
[x: string]: unknown;
|
|
7
|
-
type: "object";
|
|
8
|
-
properties?: {
|
|
9
|
-
[x: string]: unknown;
|
|
10
|
-
} | undefined;
|
|
11
|
-
required?: string[] | undefined;
|
|
12
|
-
};
|
|
13
|
-
title?: string | undefined;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
_meta?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
icons?: {
|
|
19
|
-
[x: string]: unknown;
|
|
20
|
-
src: string;
|
|
21
|
-
mimeType?: string | undefined;
|
|
22
|
-
sizes?: string[] | undefined;
|
|
23
|
-
}[] | undefined;
|
|
24
|
-
outputSchema?: {
|
|
25
|
-
[x: string]: unknown;
|
|
26
|
-
type: "object";
|
|
27
|
-
properties?: {
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
} | undefined;
|
|
30
|
-
required?: string[] | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
annotations?: {
|
|
33
|
-
[x: string]: unknown;
|
|
34
|
-
title?: string | undefined;
|
|
35
|
-
readOnlyHint?: boolean | undefined;
|
|
36
|
-
destructiveHint?: boolean | undefined;
|
|
37
|
-
idempotentHint?: boolean | undefined;
|
|
38
|
-
openWorldHint?: boolean | undefined;
|
|
39
|
-
} | undefined;
|
|
40
|
-
}[];
|
|
41
|
-
export declare function handleToolCall(name: string, args: unknown, connpassClient: ConnpassClient): Promise<import("./formatting.js").FormattedEventsResponse | import("./formatting.js").FormattedPresentationsResponse | import("@kajidog/connpass-api-client").EventsResponse | import("@kajidog/connpass-api-client").UsersResponse | {
|
|
42
|
-
userId: number;
|
|
43
|
-
today: {
|
|
44
|
-
date: string;
|
|
45
|
-
events: import("./formatting.js").FormattedEvent[];
|
|
46
|
-
};
|
|
47
|
-
upcoming: {
|
|
48
|
-
rangeEnd: string;
|
|
49
|
-
events: import("./formatting.js").FormattedEvent[];
|
|
50
|
-
};
|
|
51
|
-
metadata: {
|
|
52
|
-
inspected: number;
|
|
53
|
-
limit: number;
|
|
54
|
-
daysAhead: number;
|
|
55
|
-
includePresentations: boolean;
|
|
56
|
-
};
|
|
57
|
-
} | import("@kajidog/connpass-api-client").GroupsResponse>;
|
|
58
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AAElE,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,cAAc;;;;;;;;;;;;;;;;2DAe/B"}
|
package/dist/tools/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tools = void 0;
|
|
4
|
-
exports.handleToolCall = handleToolCall;
|
|
5
|
-
const events_js_1 = require("./events.js");
|
|
6
|
-
const groups_js_1 = require("./groups.js");
|
|
7
|
-
const users_js_1 = require("./users.js");
|
|
8
|
-
exports.tools = [...events_js_1.eventTools, ...groups_js_1.groupTools, ...users_js_1.userTools];
|
|
9
|
-
async function handleToolCall(name, args, connpassClient) {
|
|
10
|
-
if ((0, events_js_1.isEventTool)(name)) {
|
|
11
|
-
return (0, events_js_1.handleEventTool)(name, args, connpassClient);
|
|
12
|
-
}
|
|
13
|
-
if ((0, groups_js_1.isGroupTool)(name)) {
|
|
14
|
-
return (0, groups_js_1.handleGroupTool)(name, args, connpassClient);
|
|
15
|
-
}
|
|
16
|
-
if ((0, users_js_1.isUserTool)(name)) {
|
|
17
|
-
return (0, users_js_1.handleUserTool)(name, args, connpassClient);
|
|
18
|
-
}
|
|
19
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AAQA,wCAkBC;AAxBD,2CAAuE;AACvE,2CAAuE;AACvE,yCAAmE;AAEtD,QAAA,KAAK,GAAG,CAAC,GAAG,sBAAU,EAAE,GAAG,sBAAU,EAAE,GAAG,oBAAS,CAAC,CAAC;AAE3D,KAAK,UAAU,cAAc,CAClC,IAAY,EACZ,IAAa,EACb,cAA8B;IAE9B,IAAI,IAAA,uBAAW,EAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,IAAA,2BAAe,EAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,IAAA,uBAAW,EAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,IAAA,2BAAe,EAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,IAAA,qBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;QACrB,OAAO,IAAA,yBAAc,EAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/tools/shared.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
2
|
-
export declare const EVENT_SORT_KEYS: readonly ["start-date-asc", "start-date-desc", "newly-added"];
|
|
3
|
-
export type EventSortKey = (typeof EVENT_SORT_KEYS)[number];
|
|
4
|
-
export declare const EVENT_SORT_MAP: Record<EventSortKey, 1 | 2 | 3>;
|
|
5
|
-
export declare const GROUP_SORT_KEYS: readonly ["most-events", "most-members", "newly-added"];
|
|
6
|
-
export type GroupSortKey = (typeof GROUP_SORT_KEYS)[number];
|
|
7
|
-
export declare const GROUP_SORT_MAP: Record<GroupSortKey, 1 | 2 | 3>;
|
|
8
|
-
export declare const USER_SORT_KEYS: readonly ["most-events", "most-followers", "newly-added"];
|
|
9
|
-
export type UserSortKey = (typeof USER_SORT_KEYS)[number];
|
|
10
|
-
export declare const USER_SORT_MAP: Record<UserSortKey, 1 | 2 | 3>;
|
|
11
|
-
export declare function parseDateInput(input: string, options?: {
|
|
12
|
-
style?: "compact" | "hyphenated";
|
|
13
|
-
}): string;
|
|
14
|
-
export declare function toYmdArray(value?: string | string[]): string[] | undefined;
|
|
15
|
-
export declare function parseHyphenatedDate(input: string): string;
|
|
16
|
-
export declare function normalizeStringArray(value?: string | string[]): string[] | undefined;
|
|
17
|
-
export type PaginationParams = {
|
|
18
|
-
start?: number;
|
|
19
|
-
count?: number;
|
|
20
|
-
};
|
|
21
|
-
export declare function applyPagination(page: number | undefined, pageSize: number | undefined, options?: {
|
|
22
|
-
includePagination?: boolean;
|
|
23
|
-
}): PaginationParams;
|
|
24
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,eAAe,+DAIlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAI1D,CAAC;AAEF,eAAO,MAAM,eAAe,yDAIlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAI1D,CAAC;AAEF,eAAO,MAAM,cAAc,2DAIjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAIxD,CAAC;AAgBF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,SAAS,GAAG,YAAY,CAAA;CAAE,GAC7C,MAAM,CAsBR;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAM1E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAezD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GACxB,MAAM,EAAE,GAAG,SAAS,CAKtB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAE,GACxC,gBAAgB,CAiBlB"}
|
package/dist/tools/shared.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.USER_SORT_MAP = exports.USER_SORT_KEYS = exports.GROUP_SORT_MAP = exports.GROUP_SORT_KEYS = exports.EVENT_SORT_MAP = exports.EVENT_SORT_KEYS = exports.DEFAULT_PAGE_SIZE = void 0;
|
|
4
|
-
exports.parseDateInput = parseDateInput;
|
|
5
|
-
exports.toYmdArray = toYmdArray;
|
|
6
|
-
exports.parseHyphenatedDate = parseHyphenatedDate;
|
|
7
|
-
exports.normalizeStringArray = normalizeStringArray;
|
|
8
|
-
exports.applyPagination = applyPagination;
|
|
9
|
-
exports.DEFAULT_PAGE_SIZE = 20;
|
|
10
|
-
exports.EVENT_SORT_KEYS = [
|
|
11
|
-
"start-date-asc",
|
|
12
|
-
"start-date-desc",
|
|
13
|
-
"newly-added",
|
|
14
|
-
];
|
|
15
|
-
exports.EVENT_SORT_MAP = {
|
|
16
|
-
"start-date-asc": 1,
|
|
17
|
-
"start-date-desc": 2,
|
|
18
|
-
"newly-added": 3,
|
|
19
|
-
};
|
|
20
|
-
exports.GROUP_SORT_KEYS = [
|
|
21
|
-
"most-events",
|
|
22
|
-
"most-members",
|
|
23
|
-
"newly-added",
|
|
24
|
-
];
|
|
25
|
-
exports.GROUP_SORT_MAP = {
|
|
26
|
-
"most-events": 1,
|
|
27
|
-
"most-members": 2,
|
|
28
|
-
"newly-added": 3,
|
|
29
|
-
};
|
|
30
|
-
exports.USER_SORT_KEYS = [
|
|
31
|
-
"most-events",
|
|
32
|
-
"most-followers",
|
|
33
|
-
"newly-added",
|
|
34
|
-
];
|
|
35
|
-
exports.USER_SORT_MAP = {
|
|
36
|
-
"most-events": 1,
|
|
37
|
-
"most-followers": 2,
|
|
38
|
-
"newly-added": 3,
|
|
39
|
-
};
|
|
40
|
-
function formatAsCompactYmd(date) {
|
|
41
|
-
const year = date.getFullYear();
|
|
42
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
43
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
44
|
-
return `${year}${month}${day}`;
|
|
45
|
-
}
|
|
46
|
-
function formatAsHyphenatedYmd(date) {
|
|
47
|
-
const year = date.getFullYear();
|
|
48
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
49
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
50
|
-
return `${year}-${month}-${day}`;
|
|
51
|
-
}
|
|
52
|
-
function parseDateInput(input, options) {
|
|
53
|
-
const normalized = input.trim();
|
|
54
|
-
// Remove separators (-, /, .) for parsing
|
|
55
|
-
const hyphenFree = normalized.replace(/[-/.]/g, "");
|
|
56
|
-
// Check for YYYYMMDD format (8 digits)
|
|
57
|
-
if (/^\d{8}$/.test(hyphenFree)) {
|
|
58
|
-
const year = Number(hyphenFree.slice(0, 4));
|
|
59
|
-
const month = Number(hyphenFree.slice(4, 6)) - 1;
|
|
60
|
-
const day = Number(hyphenFree.slice(6, 8));
|
|
61
|
-
const candidate = new Date(Date.UTC(year, month, day));
|
|
62
|
-
if (!Number.isNaN(candidate.getTime())) {
|
|
63
|
-
return options?.style === "hyphenated"
|
|
64
|
-
? formatAsHyphenatedYmd(candidate)
|
|
65
|
-
: formatAsCompactYmd(candidate);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
throw new Error(`Invalid date format: ${input}. Expected YYYY-MM-DD or YYYYMMDD format.`);
|
|
69
|
-
}
|
|
70
|
-
function toYmdArray(value) {
|
|
71
|
-
if (!value) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
const inputs = Array.isArray(value) ? value : [value];
|
|
75
|
-
return inputs.map((item) => parseDateInput(item));
|
|
76
|
-
}
|
|
77
|
-
function parseHyphenatedDate(input) {
|
|
78
|
-
const parsed = parseDateInput(input, { style: "hyphenated" });
|
|
79
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(parsed)) {
|
|
80
|
-
return parsed;
|
|
81
|
-
}
|
|
82
|
-
const digitsOnly = parsed.replace(/[^0-9]/g, "");
|
|
83
|
-
if (digitsOnly.length === 8) {
|
|
84
|
-
const year = digitsOnly.slice(0, 4);
|
|
85
|
-
const month = digitsOnly.slice(4, 6);
|
|
86
|
-
const day = digitsOnly.slice(6, 8);
|
|
87
|
-
return `${year}-${month}-${day}`;
|
|
88
|
-
}
|
|
89
|
-
throw new Error(`Could not convert date input to YYYY-MM-DD: ${input}`);
|
|
90
|
-
}
|
|
91
|
-
function normalizeStringArray(value) {
|
|
92
|
-
if (!value) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
return Array.isArray(value) ? value : [value];
|
|
96
|
-
}
|
|
97
|
-
function applyPagination(page, pageSize, options) {
|
|
98
|
-
const includePagination = options?.includePagination ?? true;
|
|
99
|
-
if (!includePagination) {
|
|
100
|
-
return {};
|
|
101
|
-
}
|
|
102
|
-
const effectivePageSize = pageSize ?? exports.DEFAULT_PAGE_SIZE;
|
|
103
|
-
const pagination = {};
|
|
104
|
-
if (page) {
|
|
105
|
-
pagination.start = 1 + (page - 1) * effectivePageSize;
|
|
106
|
-
pagination.count = effectivePageSize;
|
|
107
|
-
}
|
|
108
|
-
else if (pageSize) {
|
|
109
|
-
pagination.count = effectivePageSize;
|
|
110
|
-
}
|
|
111
|
-
return pagination;
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=shared.js.map
|
package/dist/tools/shared.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":";;;AAoDA,wCAyBC;AAED,gCAMC;AAED,kDAeC;AAED,oDAOC;AAID,0CAqBC;AAxIY,QAAA,iBAAiB,GAAG,EAAE,CAAC;AAEvB,QAAA,eAAe,GAAG;IAC7B,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;CACL,CAAC;AAEE,QAAA,cAAc,GAAoC;IAC7D,gBAAgB,EAAE,CAAC;IACnB,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,aAAa;IACb,cAAc;IACd,aAAa;CACL,CAAC;AAEE,QAAA,cAAc,GAAoC;IAC7D,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEW,QAAA,cAAc,GAAG;IAC5B,aAAa;IACb,gBAAgB;IAChB,aAAa;CACL,CAAC;AAEE,QAAA,aAAa,GAAmC;IAC3D,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,SAAS,kBAAkB,CAAC,IAAU;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,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