@kajidog/connpass-mcp-server 0.3.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/README.md +72 -149
- package/dist/index.d.ts +0 -2
- package/dist/index.js +4749 -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 +2140 -0
- package/dist/stdio.js.map +1 -0
- package/package.json +18 -18
- package/dist/apps-sdk.d.ts +0 -8
- package/dist/apps-sdk.d.ts.map +0 -1
- package/dist/apps-sdk.js +0 -93
- 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 -74
- package/dist/tools/events.d.ts.map +0 -1
- package/dist/tools/events.js +0 -413
- 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 -222
- 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 -54
- 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 -41
- package/dist/widgets/connpass-events.d.ts.map +0 -1
- package/dist/widgets/connpass-events.js +0 -68
- package/dist/widgets/connpass-events.js.map +0 -1
- package/dist/widgets/connpass-schedule.d.ts +0 -41
- package/dist/widgets/connpass-schedule.d.ts.map +0 -1
- package/dist/widgets/connpass-schedule.js +0 -68
- package/dist/widgets/connpass-schedule.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 -39
- package/dist/widgets/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/transports/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAEpB,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAGrF,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACtC,CAAC;AAOF,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,EAAE,MAAM,SAAS,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAYF,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB;;;;;GAsLlE"}
|
package/dist/transports/sse.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startSseServer = startSseServer;
|
|
4
|
-
const node_http_1 = require("node:http");
|
|
5
|
-
const node_url_1 = require("node:url");
|
|
6
|
-
const sse_js_1 = require("@modelcontextprotocol/sdk/server/sse.js");
|
|
7
|
-
const defaultLogger = {
|
|
8
|
-
info: (...args) => console.error(...args),
|
|
9
|
-
error: (...args) => console.error(...args),
|
|
10
|
-
};
|
|
11
|
-
function setCorsHeaders(res) {
|
|
12
|
-
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
13
|
-
res.setHeader("Access-Control-Allow-Headers", "content-type");
|
|
14
|
-
}
|
|
15
|
-
async function startSseServer(options) {
|
|
16
|
-
const { createMcpServer, port, ssePath = "/mcp", messagePath = "/mcp/messages", logger, enableCors = true, } = options;
|
|
17
|
-
const log = {
|
|
18
|
-
...defaultLogger,
|
|
19
|
-
...(logger ?? {}),
|
|
20
|
-
};
|
|
21
|
-
const sessions = new Map();
|
|
22
|
-
const handleSseRequest = async (res) => {
|
|
23
|
-
if (enableCors) {
|
|
24
|
-
setCorsHeaders(res);
|
|
25
|
-
}
|
|
26
|
-
const server = createMcpServer();
|
|
27
|
-
const transport = new sse_js_1.SSEServerTransport(messagePath, res);
|
|
28
|
-
const sessionId = transport.sessionId;
|
|
29
|
-
sessions.set(sessionId, { server, transport });
|
|
30
|
-
transport.onclose = async () => {
|
|
31
|
-
sessions.delete(sessionId);
|
|
32
|
-
try {
|
|
33
|
-
// Prevent recursive close loops triggered by server.close() calling transport.close()
|
|
34
|
-
transport.onclose = undefined;
|
|
35
|
-
await server.close();
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
log.error("Failed to close MCP server:", error);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
transport.onerror = (error) => {
|
|
42
|
-
log.error("SSE transport error:", error);
|
|
43
|
-
};
|
|
44
|
-
try {
|
|
45
|
-
await server.connect(transport);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
sessions.delete(sessionId);
|
|
49
|
-
log.error("Failed to establish SSE connection:", error);
|
|
50
|
-
if (!res.headersSent) {
|
|
51
|
-
res.writeHead(500).end("Failed to establish SSE connection");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const handleMessagePost = async (req, res, url) => {
|
|
56
|
-
if (enableCors) {
|
|
57
|
-
setCorsHeaders(res);
|
|
58
|
-
}
|
|
59
|
-
const sessionId = url.searchParams.get("sessionId");
|
|
60
|
-
if (!sessionId) {
|
|
61
|
-
res.writeHead(400).end("Missing sessionId parameter");
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const session = sessions.get(sessionId);
|
|
65
|
-
if (!session) {
|
|
66
|
-
res.writeHead(404).end("Unknown session");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
try {
|
|
70
|
-
await session.transport.handlePostMessage(req, res);
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
log.error("Failed to process message:", error);
|
|
74
|
-
if (!res.headersSent) {
|
|
75
|
-
res.writeHead(500).end("Failed to process message");
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const httpServer = (0, node_http_1.createServer)(async (req, res) => {
|
|
80
|
-
if (!req.url) {
|
|
81
|
-
res.writeHead(400).end("Invalid request");
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const origin = req.headers.host
|
|
85
|
-
? `http://${req.headers.host}`
|
|
86
|
-
: "http://localhost";
|
|
87
|
-
const url = new node_url_1.URL(req.url, origin);
|
|
88
|
-
const normalizedPath = normalizePath(url.pathname);
|
|
89
|
-
if (req.method === "GET" && normalizedPath === "/healthz") {
|
|
90
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
91
|
-
res.end(JSON.stringify({
|
|
92
|
-
status: "ok",
|
|
93
|
-
transport: "sse",
|
|
94
|
-
}));
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (req.method === "OPTIONS" &&
|
|
98
|
-
(normalizedPath === ssePath || normalizedPath === messagePath)) {
|
|
99
|
-
if (enableCors) {
|
|
100
|
-
setCorsHeaders(res);
|
|
101
|
-
}
|
|
102
|
-
res.writeHead(204, {
|
|
103
|
-
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
|
|
104
|
-
});
|
|
105
|
-
res.end();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (req.method === "GET" && normalizedPath === ssePath) {
|
|
109
|
-
await handleSseRequest(res);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (req.method === "POST" && normalizedPath === messagePath) {
|
|
113
|
-
await handleMessagePost(req, res, url);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
res.writeHead(404).end("Not found");
|
|
117
|
-
});
|
|
118
|
-
httpServer.on("clientError", (error, socket) => {
|
|
119
|
-
log.error("HTTP client error:", error);
|
|
120
|
-
socket.end("HTTP/1.1 400 Bad Request\r\n\r\n");
|
|
121
|
-
});
|
|
122
|
-
await new Promise((resolve) => {
|
|
123
|
-
httpServer.listen(port, () => {
|
|
124
|
-
log.info(`Connpass MCP Server listening on http://localhost:${port} (SSE transport)`);
|
|
125
|
-
log.info(` SSE stream: GET http://localhost:${port}${ssePath}`);
|
|
126
|
-
log.info(` Message endpoint: POST http://localhost:${port}${messagePath}?sessionId=...`);
|
|
127
|
-
resolve();
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
return {
|
|
131
|
-
httpServer,
|
|
132
|
-
close: async () => {
|
|
133
|
-
await Promise.all(Array.from(sessions.values(), async ({ server, transport }) => {
|
|
134
|
-
sessions.delete(transport.sessionId);
|
|
135
|
-
await transport.close();
|
|
136
|
-
await server.close();
|
|
137
|
-
})).catch((error) => {
|
|
138
|
-
log.error("Failed to shut down sessions:", error);
|
|
139
|
-
});
|
|
140
|
-
await new Promise((resolve, reject) => {
|
|
141
|
-
httpServer.close((error) => {
|
|
142
|
-
if (error) {
|
|
143
|
-
reject(error);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
resolve();
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
ssePath,
|
|
152
|
-
messagePath,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
function normalizePath(pathname) {
|
|
156
|
-
if (pathname === "/") {
|
|
157
|
-
return pathname;
|
|
158
|
-
}
|
|
159
|
-
return pathname.replace(/\/+$/, "") || "/";
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=sse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/transports/sse.ts"],"names":[],"mappings":";;AAuCA,wCAsLC;AA7ND,yCAImB;AACnB,uCAA+B;AAG/B,oEAA6E;AAqB7E,MAAM,aAAa,GAAqB;IACtC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACzC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;CAC3C,CAAC;AAEF,SAAS,cAAc,CAAC,GAAmB;IACzC,GAAG,CAAC,SAAS,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IAClD,GAAG,CAAC,SAAS,CAAC,8BAA8B,EAAE,cAAc,CAAC,CAAC;AAChE,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,OAA8B;IACjE,MAAM,EACJ,eAAe,EACf,IAAI,EACJ,OAAO,GAAG,MAAM,EAChB,WAAW,GAAG,eAAe,EAC7B,MAAM,EACN,UAAU,GAAG,IAAI,GAClB,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAqB;QAC5B,GAAG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CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBAChB,GAAG,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;YAEH,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1C,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBACzB,IAAI,KAAK,EAAE,CAAC;wBACV,MAAM,CAAC,KAAK,CAAC,CAAC;oBAChB,CAAC;yBAAM,CAAC;wBACN,OAAO,EAAE,CAAC;oBACZ,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO;QACP,WAAW;KACH,CAAC;AACb,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,IAAI,QAAQ,KAAK,GAAG,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;AAC7C,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ResourceContents } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
export declare const CONNPASS_EVENTS_WIDGET_URI = "ui://connpass/widgets/events-carousel.html";
|
|
3
|
-
export declare const connpassEventsWidget: {
|
|
4
|
-
uri: string;
|
|
5
|
-
resource: {
|
|
6
|
-
uri: string;
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
mimeType: string;
|
|
10
|
-
_meta: {
|
|
11
|
-
readonly "openai/outputTemplate": "ui://connpass/widgets/events-carousel.html";
|
|
12
|
-
readonly "openai/widgetAccessible": true;
|
|
13
|
-
readonly "openai/resultCanProduceWidget": true;
|
|
14
|
-
readonly "openai/widgetDomain": "connpass";
|
|
15
|
-
readonly "openai/widgetCSP": {
|
|
16
|
-
readonly connect_domains: readonly ["https://connpass.com"];
|
|
17
|
-
readonly resource_domains: readonly ["https://connpass.com", "https://media.connpass.com"];
|
|
18
|
-
readonly redirect_domains: readonly ["https://connpass.com"];
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
resourceTemplate: {
|
|
23
|
-
uriTemplate: string;
|
|
24
|
-
name: string;
|
|
25
|
-
description: string;
|
|
26
|
-
mimeType: string;
|
|
27
|
-
_meta: {
|
|
28
|
-
readonly "openai/outputTemplate": "ui://connpass/widgets/events-carousel.html";
|
|
29
|
-
readonly "openai/widgetAccessible": true;
|
|
30
|
-
readonly "openai/resultCanProduceWidget": true;
|
|
31
|
-
readonly "openai/widgetDomain": "connpass";
|
|
32
|
-
readonly "openai/widgetCSP": {
|
|
33
|
-
readonly connect_domains: readonly ["https://connpass.com"];
|
|
34
|
-
readonly resource_domains: readonly ["https://connpass.com", "https://media.connpass.com"];
|
|
35
|
-
readonly redirect_domains: readonly ["https://connpass.com"];
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
content(): ResourceContents[number];
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=connpass-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connpass-events.d.ts","sourceRoot":"","sources":["../../src/widgets/connpass-events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,oCAAoC,CAAC;AAE5C,eAAO,MAAM,0BAA0B,+CACO,CAAC;AAyC/C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAkBpB,gBAAgB,CAAC,MAAM,CAAC;CAWpC,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.connpassEventsWidget = exports.CONNPASS_EVENTS_WIDGET_URI = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
exports.CONNPASS_EVENTS_WIDGET_URI = "ui://connpass/widgets/events-carousel.html";
|
|
7
|
-
function buildWidgetMeta() {
|
|
8
|
-
return {
|
|
9
|
-
"openai/outputTemplate": exports.CONNPASS_EVENTS_WIDGET_URI,
|
|
10
|
-
"openai/widgetAccessible": true,
|
|
11
|
-
"openai/resultCanProduceWidget": true,
|
|
12
|
-
"openai/widgetDomain": "connpass",
|
|
13
|
-
"openai/widgetCSP": {
|
|
14
|
-
connect_domains: ["https://connpass.com"],
|
|
15
|
-
resource_domains: ["https://connpass.com", "https://media.connpass.com"],
|
|
16
|
-
redirect_domains: ["https://connpass.com"],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function loadHtmlDocument() {
|
|
21
|
-
const candidates = [
|
|
22
|
-
// React widget built by @connpass-mcp/widgets package
|
|
23
|
-
(0, node_path_1.resolve)(__dirname, "../../../widgets/dist/connpass-events.html"),
|
|
24
|
-
// Fallback: copied to dist during build
|
|
25
|
-
(0, node_path_1.resolve)(__dirname, "connpass-events.html"),
|
|
26
|
-
// Fallback: development source
|
|
27
|
-
(0, node_path_1.resolve)(__dirname, "../../src/widgets/connpass-events.html"),
|
|
28
|
-
];
|
|
29
|
-
for (const candidate of candidates) {
|
|
30
|
-
try {
|
|
31
|
-
return (0, node_fs_1.readFileSync)(candidate, "utf8");
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
// ignore and try next path
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
throw new Error("Connpass widget HTML could not be located. Run 'pnpm build' in packages/widgets first.");
|
|
38
|
-
}
|
|
39
|
-
const HTML_DOCUMENT = loadHtmlDocument();
|
|
40
|
-
exports.connpassEventsWidget = {
|
|
41
|
-
uri: exports.CONNPASS_EVENTS_WIDGET_URI,
|
|
42
|
-
resource: {
|
|
43
|
-
uri: exports.CONNPASS_EVENTS_WIDGET_URI,
|
|
44
|
-
name: "Connpass events carousel",
|
|
45
|
-
description: "Inline carousel widget with fullscreen detail view for Connpass events",
|
|
46
|
-
mimeType: "text/html+sky",
|
|
47
|
-
_meta: buildWidgetMeta(),
|
|
48
|
-
},
|
|
49
|
-
resourceTemplate: {
|
|
50
|
-
uriTemplate: exports.CONNPASS_EVENTS_WIDGET_URI,
|
|
51
|
-
name: "Connpass events carousel",
|
|
52
|
-
description: "Inline carousel widget with fullscreen detail view for Connpass events",
|
|
53
|
-
mimeType: "text/html+sky",
|
|
54
|
-
_meta: buildWidgetMeta(),
|
|
55
|
-
},
|
|
56
|
-
content() {
|
|
57
|
-
return {
|
|
58
|
-
uri: exports.CONNPASS_EVENTS_WIDGET_URI,
|
|
59
|
-
mimeType: "text/html+sky",
|
|
60
|
-
text: HTML_DOCUMENT,
|
|
61
|
-
_meta: {
|
|
62
|
-
...buildWidgetMeta(),
|
|
63
|
-
"openai/widgetCategory": "carousel",
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=connpass-events.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connpass-events.js","sourceRoot":"","sources":["../../src/widgets/connpass-events.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,yCAAoC;AAQvB,QAAA,0BAA0B,GACrC,4CAA4C,CAAC;AAE/C,SAAS,eAAe;IACtB,OAAO;QACL,uBAAuB,EAAE,kCAA0B;QACnD,yBAAyB,EAAE,IAAI;QAC/B,+BAA+B,EAAE,IAAI;QACrC,qBAAqB,EAAE,UAAU;QACjC,kBAAkB,EAAE;YAClB,eAAe,EAAE,CAAC,sBAAsB,CAAC;YACzC,gBAAgB,EAAE,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;YACxE,gBAAgB,EAAE,CAAC,sBAAsB,CAAC;SAC3C;KACO,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG;QACjB,sDAAsD;QACtD,IAAA,mBAAO,EAAC,SAAS,EAAE,4CAA4C,CAAC;QAChE,wCAAwC;QACxC,IAAA,mBAAO,EAAC,SAAS,EAAE,sBAAsB,CAAC;QAC1C,+BAA+B;QAC/B,IAAA,mBAAO,EAAC,SAAS,EAAE,wCAAwC,CAAC;KAC7D,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,IAAA,sBAAY,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,2BAA2B;QAC7B,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;AACJ,CAAC;AAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAE5B,QAAA,oBAAoB,GAAG;IAClC,GAAG,EAAE,kCAA0B;IAC/B,QAAQ,EAAE;QACR,GAAG,EAAE,kCAA0B;QAC/B,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,wEAAwE;QAC1E,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,eAAe,EAAE;KACN;IACpB,gBAAgB,EAAE;QAChB,WAAW,EAAE,kCAA0B;QACvC,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,wEAAwE;QAC1E,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,eAAe,EAAE;KACE;IAC5B,OAAO;QACL,OAAO;YACL,GAAG,EAAE,kCAA0B;YAC/B,QAAQ,EAAE,eAAe;YACzB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE;gBACL,GAAG,eAAe,EAAE;gBACpB,uBAAuB,EAAE,UAAU;aACpC;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ResourceContents } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
export declare const CONNPASS_SCHEDULE_WIDGET_URI = "ui://connpass/widgets/schedule.html";
|
|
3
|
-
export declare const connpassScheduleWidget: {
|
|
4
|
-
uri: string;
|
|
5
|
-
resource: {
|
|
6
|
-
uri: string;
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
mimeType: string;
|
|
10
|
-
_meta: {
|
|
11
|
-
readonly "openai/outputTemplate": "ui://connpass/widgets/schedule.html";
|
|
12
|
-
readonly "openai/widgetAccessible": true;
|
|
13
|
-
readonly "openai/resultCanProduceWidget": true;
|
|
14
|
-
readonly "openai/widgetDomain": "connpass";
|
|
15
|
-
readonly "openai/widgetCSP": {
|
|
16
|
-
readonly connect_domains: readonly ["https://connpass.com"];
|
|
17
|
-
readonly resource_domains: readonly ["https://connpass.com", "https://media.connpass.com"];
|
|
18
|
-
readonly redirect_domains: readonly ["https://connpass.com"];
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
resourceTemplate: {
|
|
23
|
-
uriTemplate: string;
|
|
24
|
-
name: string;
|
|
25
|
-
description: string;
|
|
26
|
-
mimeType: string;
|
|
27
|
-
_meta: {
|
|
28
|
-
readonly "openai/outputTemplate": "ui://connpass/widgets/schedule.html";
|
|
29
|
-
readonly "openai/widgetAccessible": true;
|
|
30
|
-
readonly "openai/resultCanProduceWidget": true;
|
|
31
|
-
readonly "openai/widgetDomain": "connpass";
|
|
32
|
-
readonly "openai/widgetCSP": {
|
|
33
|
-
readonly connect_domains: readonly ["https://connpass.com"];
|
|
34
|
-
readonly resource_domains: readonly ["https://connpass.com", "https://media.connpass.com"];
|
|
35
|
-
readonly redirect_domains: readonly ["https://connpass.com"];
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
content(): ResourceContents[number];
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=connpass-schedule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connpass-schedule.d.ts","sourceRoot":"","sources":["../../src/widgets/connpass-schedule.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,oCAAoC,CAAC;AAE5C,eAAO,MAAM,4BAA4B,wCACF,CAAC;AAyCxC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgBtB,gBAAgB,CAAC,MAAM,CAAC;CAWpC,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.connpassScheduleWidget = exports.CONNPASS_SCHEDULE_WIDGET_URI = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
exports.CONNPASS_SCHEDULE_WIDGET_URI = "ui://connpass/widgets/schedule.html";
|
|
7
|
-
function buildWidgetMeta() {
|
|
8
|
-
return {
|
|
9
|
-
"openai/outputTemplate": exports.CONNPASS_SCHEDULE_WIDGET_URI,
|
|
10
|
-
"openai/widgetAccessible": true,
|
|
11
|
-
"openai/resultCanProduceWidget": true,
|
|
12
|
-
"openai/widgetDomain": "connpass",
|
|
13
|
-
"openai/widgetCSP": {
|
|
14
|
-
connect_domains: ["https://connpass.com"],
|
|
15
|
-
resource_domains: ["https://connpass.com", "https://media.connpass.com"],
|
|
16
|
-
redirect_domains: ["https://connpass.com"],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function loadHtmlDocument() {
|
|
21
|
-
const candidates = [
|
|
22
|
-
// React widget built by @connpass-mcp/widgets package
|
|
23
|
-
(0, node_path_1.resolve)(__dirname, "../../../widgets/dist/connpass-schedule.html"),
|
|
24
|
-
// Fallback: copied to dist during build
|
|
25
|
-
(0, node_path_1.resolve)(__dirname, "connpass-schedule.html"),
|
|
26
|
-
// Fallback: development source
|
|
27
|
-
(0, node_path_1.resolve)(__dirname, "../../src/widgets/connpass-schedule.html"),
|
|
28
|
-
];
|
|
29
|
-
for (const candidate of candidates) {
|
|
30
|
-
try {
|
|
31
|
-
return (0, node_fs_1.readFileSync)(candidate, "utf8");
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
// ignore and try next path
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
throw new Error("Connpass schedule widget HTML could not be located. Run 'pnpm build' in packages/widgets first.");
|
|
38
|
-
}
|
|
39
|
-
const HTML_DOCUMENT = loadHtmlDocument();
|
|
40
|
-
exports.connpassScheduleWidget = {
|
|
41
|
-
uri: exports.CONNPASS_SCHEDULE_WIDGET_URI,
|
|
42
|
-
resource: {
|
|
43
|
-
uri: exports.CONNPASS_SCHEDULE_WIDGET_URI,
|
|
44
|
-
name: "Connpass schedule viewer",
|
|
45
|
-
description: "Schedule view widget for user's upcoming Connpass events",
|
|
46
|
-
mimeType: "text/html+sky",
|
|
47
|
-
_meta: buildWidgetMeta(),
|
|
48
|
-
},
|
|
49
|
-
resourceTemplate: {
|
|
50
|
-
uriTemplate: exports.CONNPASS_SCHEDULE_WIDGET_URI,
|
|
51
|
-
name: "Connpass schedule viewer",
|
|
52
|
-
description: "Schedule view widget for user's upcoming Connpass events",
|
|
53
|
-
mimeType: "text/html+sky",
|
|
54
|
-
_meta: buildWidgetMeta(),
|
|
55
|
-
},
|
|
56
|
-
content() {
|
|
57
|
-
return {
|
|
58
|
-
uri: exports.CONNPASS_SCHEDULE_WIDGET_URI,
|
|
59
|
-
mimeType: "text/html+sky",
|
|
60
|
-
text: HTML_DOCUMENT,
|
|
61
|
-
_meta: {
|
|
62
|
-
...buildWidgetMeta(),
|
|
63
|
-
"openai/widgetCategory": "list",
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=connpass-schedule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connpass-schedule.js","sourceRoot":"","sources":["../../src/widgets/connpass-schedule.ts"],"names":[],"mapp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BAA0B;QAChC,WAAW,EAAE,0DAA0D;QACvE,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,eAAe,EAAE;KACE;IAC5B,OAAO;QACL,OAAO;YACL,GAAG,EAAE,oCAA4B;YACjC,QAAQ,EAAE,eAAe;YACzB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE;gBACL,GAAG,eAAe,EAAE;gBACpB,uBAAuB,EAAE,MAAM;aAChC;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/dist/widgets/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Resource, ResourceContents, ResourceTemplate } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
export declare function listResources(): Resource[];
|
|
3
|
-
export declare function listResourceTemplates(): ResourceTemplate[];
|
|
4
|
-
export declare function getResourceContent(uri: string): ResourceContents[number] | undefined;
|
|
5
|
-
export declare function getWidgetTemplateForTool(toolName: string): string | undefined;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AA8B5C,wBAAgB,aAAa,IAAI,QAAQ,EAAE,CAE1C;AAED,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAE1D;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,GACV,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,CAGtC;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7E"}
|
package/dist/widgets/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listResources = listResources;
|
|
4
|
-
exports.listResourceTemplates = listResourceTemplates;
|
|
5
|
-
exports.getResourceContent = getResourceContent;
|
|
6
|
-
exports.getWidgetTemplateForTool = getWidgetTemplateForTool;
|
|
7
|
-
const connpass_events_js_1 = require("./connpass-events.js");
|
|
8
|
-
const connpass_schedule_js_1 = require("./connpass-schedule.js");
|
|
9
|
-
const widgets = [connpass_events_js_1.connpassEventsWidget, connpass_schedule_js_1.connpassScheduleWidget];
|
|
10
|
-
const resources = widgets.map((widget) => widget.resource);
|
|
11
|
-
const resourceTemplates = widgets.map((widget) => widget.resourceTemplate);
|
|
12
|
-
const widgetContentMap = new Map([
|
|
13
|
-
[
|
|
14
|
-
connpass_events_js_1.connpassEventsWidget.uri,
|
|
15
|
-
connpass_events_js_1.connpassEventsWidget.content.bind(connpass_events_js_1.connpassEventsWidget),
|
|
16
|
-
],
|
|
17
|
-
[
|
|
18
|
-
connpass_schedule_js_1.connpassScheduleWidget.uri,
|
|
19
|
-
connpass_schedule_js_1.connpassScheduleWidget.content.bind(connpass_schedule_js_1.connpassScheduleWidget),
|
|
20
|
-
],
|
|
21
|
-
]);
|
|
22
|
-
const TOOL_WIDGET_MAP = new Map([
|
|
23
|
-
["search_events", connpass_events_js_1.CONNPASS_EVENTS_WIDGET_URI],
|
|
24
|
-
["search_schedule", connpass_schedule_js_1.CONNPASS_SCHEDULE_WIDGET_URI],
|
|
25
|
-
]);
|
|
26
|
-
function listResources() {
|
|
27
|
-
return resources;
|
|
28
|
-
}
|
|
29
|
-
function listResourceTemplates() {
|
|
30
|
-
return resourceTemplates;
|
|
31
|
-
}
|
|
32
|
-
function getResourceContent(uri) {
|
|
33
|
-
const factory = widgetContentMap.get(uri);
|
|
34
|
-
return factory?.();
|
|
35
|
-
}
|
|
36
|
-
function getWidgetTemplateForTool(toolName) {
|
|
37
|
-
return TOOL_WIDGET_MAP.get(toolName);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
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