@kajidog/connpass-mcp-server 0.4.0 → 0.4.1
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 +28 -8
- package/dist/index.js.map +1 -1
- package/dist/stdio.js +28 -8
- package/dist/stdio.js.map +1 -1
- package/package.json +1 -1
package/dist/stdio.js
CHANGED
|
@@ -808,10 +808,17 @@ function compactDateLabel(isoString) {
|
|
|
808
808
|
function summarizeEventLine(event) {
|
|
809
809
|
const date = compactDateLabel(event.schedule.start);
|
|
810
810
|
const place = event.location?.place || event.location?.address;
|
|
811
|
+
const { accepted, waiting, limit } = event.participants;
|
|
812
|
+
const capacityParts = [`${accepted}\u4EBA\u53C2\u52A0`];
|
|
813
|
+
if (waiting > 0) capacityParts.push(`\u5F85\u3061${waiting}`);
|
|
814
|
+
if (typeof limit === "number") capacityParts.push(`\u5B9A\u54E1${limit}`);
|
|
815
|
+
const capacity = capacityParts.join("/");
|
|
811
816
|
const fragments = [
|
|
817
|
+
`[id:${event.id}]`,
|
|
812
818
|
date,
|
|
813
819
|
event.title,
|
|
814
|
-
place ? `@ ${place}` : void 0
|
|
820
|
+
place ? `@ ${place}` : void 0,
|
|
821
|
+
`(${capacity})`
|
|
815
822
|
].filter(Boolean);
|
|
816
823
|
return `- ${fragments.join(" ")}`;
|
|
817
824
|
}
|
|
@@ -973,14 +980,22 @@ function formatEventsResponse(response, options) {
|
|
|
973
980
|
events: response.events.map((event) => formatEvent(event, options))
|
|
974
981
|
};
|
|
975
982
|
}
|
|
976
|
-
function
|
|
983
|
+
function summarizeEventBlock(event) {
|
|
984
|
+
const headline = summarizeEventLine(event);
|
|
985
|
+
const extras = [];
|
|
986
|
+
if (event.catchPhrase) extras.push(` ${event.catchPhrase}`);
|
|
987
|
+
if (event.group?.title) extras.push(` group: ${event.group.title}`);
|
|
988
|
+
if (extras.length === 0) return headline;
|
|
989
|
+
return [headline, ...extras].join("\n");
|
|
990
|
+
}
|
|
991
|
+
function summarizeEventsResponse(response, label = "events", options) {
|
|
977
992
|
const lines = [
|
|
978
|
-
`${label}: ${response.returned} returned / ${response.available} available
|
|
979
|
-
...response.events.slice(0, 5).map(summarizeEventLine)
|
|
993
|
+
`${label}: ${response.returned} returned / ${response.available} available`
|
|
980
994
|
];
|
|
981
|
-
if (
|
|
982
|
-
lines.push(
|
|
995
|
+
if (options?.searchSessionId) {
|
|
996
|
+
lines.push(`searchSessionId: ${options.searchSessionId}`);
|
|
983
997
|
}
|
|
998
|
+
lines.push(...response.events.map(summarizeEventBlock));
|
|
984
999
|
return lines.join("\n");
|
|
985
1000
|
}
|
|
986
1001
|
function summarizeGroupsResponse(response) {
|
|
@@ -1236,7 +1251,9 @@ function registerEventTools(deps) {
|
|
|
1236
1251
|
content: [
|
|
1237
1252
|
{
|
|
1238
1253
|
type: "text",
|
|
1239
|
-
text: summarizeEventsResponse(formatted
|
|
1254
|
+
text: summarizeEventsResponse(formatted, "events", {
|
|
1255
|
+
searchSessionId
|
|
1256
|
+
})
|
|
1240
1257
|
}
|
|
1241
1258
|
],
|
|
1242
1259
|
structuredContent: {
|
|
@@ -1287,7 +1304,10 @@ function registerEventTools(deps) {
|
|
|
1287
1304
|
}
|
|
1288
1305
|
return {
|
|
1289
1306
|
content: [
|
|
1290
|
-
{
|
|
1307
|
+
{
|
|
1308
|
+
type: "text",
|
|
1309
|
+
text: `Displayed ${formatted.events.length} of ${formatted.available} events in the browser UI.`
|
|
1310
|
+
}
|
|
1291
1311
|
],
|
|
1292
1312
|
structuredContent: {
|
|
1293
1313
|
kind: "events",
|