sunpeak 0.7.11 → 0.8.4
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 +2 -1
- package/bin/commands/deploy.mjs +18 -8
- package/bin/commands/dev.mjs +60 -4
- package/bin/commands/login.mjs +73 -55
- package/bin/commands/logout.mjs +26 -12
- package/bin/commands/mcp.mjs +1 -1
- package/bin/commands/pull.mjs +60 -39
- package/bin/commands/push.mjs +73 -49
- package/bin/commands/upgrade.mjs +203 -0
- package/bin/sunpeak.js +68 -35
- package/dist/chatgpt/chatgpt-simulator.d.ts +2 -1
- package/dist/index.cjs +13 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/mcp/entry.cjs +41 -9
- package/dist/mcp/entry.cjs.map +1 -1
- package/dist/mcp/entry.js +42 -10
- package/dist/mcp/entry.js.map +1 -1
- package/dist/mcp/index.cjs +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/{server-CziiHU7V.cjs → server-B9YgCQdS.cjs} +3 -2
- package/dist/{server-CziiHU7V.cjs.map → server-B9YgCQdS.cjs.map} +1 -1
- package/dist/{server-D8kyzuiq.js → server-DVmTC-SF.js} +3 -2
- package/dist/{server-D8kyzuiq.js.map → server-DVmTC-SF.js.map} +1 -1
- package/dist/style.css +62 -0
- package/dist/types/simulation.d.ts +1 -1
- package/package.json +1 -1
- package/template/.sunpeak/dev.tsx +78 -15
- package/template/.sunpeak/vite-env.d.ts +1 -0
- package/template/README.md +35 -20
- package/template/dist/albums.js +1 -1
- package/template/dist/albums.json +3 -2
- package/template/dist/carousel.js +1 -1
- package/template/dist/carousel.json +3 -2
- package/template/dist/confirmation.js +49 -0
- package/template/dist/confirmation.json +16 -0
- package/template/dist/counter.js +1 -1
- package/template/dist/counter.json +7 -2
- package/template/dist/map.js +1 -1
- package/template/dist/map.json +6 -3
- package/template/node_modules/.vite/deps/_metadata.json +19 -19
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/template/src/components/map/map-view.test.tsx +1 -1
- package/template/src/components/map/map-view.tsx +1 -1
- package/template/src/components/map/map.tsx +1 -1
- package/template/src/components/map/place-card.test.tsx +1 -1
- package/template/src/components/map/place-card.tsx +1 -1
- package/template/src/components/map/place-carousel.test.tsx +1 -1
- package/template/src/components/map/place-carousel.tsx +1 -1
- package/template/src/components/map/place-inspector.test.tsx +1 -1
- package/template/src/components/map/place-inspector.tsx +1 -1
- package/template/src/components/map/place-list.test.tsx +1 -1
- package/template/src/components/map/place-list.tsx +1 -1
- package/template/src/components/map/types.ts +18 -0
- package/template/src/resources/albums-resource.json +1 -1
- package/template/src/resources/carousel-resource.json +1 -1
- package/template/src/resources/confirmation-resource.json +12 -0
- package/template/src/resources/confirmation-resource.tsx +479 -0
- package/template/src/resources/counter-resource.json +4 -1
- package/template/src/resources/index.ts +39 -4
- package/template/src/resources/map-resource.json +7 -2
- package/template/src/simulations/albums-show-simulation.json +131 -0
- package/template/src/simulations/carousel-show-simulation.json +68 -0
- package/template/src/simulations/confirmation-diff-simulation.json +80 -0
- package/template/src/simulations/confirmation-post-simulation.json +56 -0
- package/template/src/simulations/confirmation-purchase-simulation.json +88 -0
- package/template/src/simulations/counter-show-simulation.json +20 -0
- package/template/src/simulations/index.ts +17 -12
- package/template/src/simulations/map-show-simulation.json +123 -0
- package/template/src/vite-env.d.ts +1 -0
- package/template/tsconfig.json +1 -1
- package/template/src/simulations/albums-simulation.ts +0 -147
- package/template/src/simulations/carousel-simulation.ts +0 -84
- package/template/src/simulations/counter-simulation.ts +0 -34
- package/template/src/simulations/map-simulation.ts +0 -154
package/dist/mcp/entry.cjs
CHANGED
|
@@ -1,20 +1,52 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
const server = require("../server-
|
|
3
|
+
const server = require("../server-B9YgCQdS.cjs");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const projectRoot = process.cwd();
|
|
7
|
+
function findResourceKey(simulationKey, resourceKeys) {
|
|
8
|
+
const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);
|
|
9
|
+
for (const resourceKey of sorted) {
|
|
10
|
+
if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + "-")) {
|
|
11
|
+
return resourceKey;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
7
16
|
async function startServer() {
|
|
8
17
|
const pkgPath = path.join(projectRoot, "package.json");
|
|
9
18
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const resourcesDir = path.join(projectRoot, "src/resources");
|
|
20
|
+
const resourceFiles = fs.readdirSync(resourcesDir).filter((f) => f.endsWith("-resource.json"));
|
|
21
|
+
const resourcesMap = /* @__PURE__ */ new Map();
|
|
22
|
+
for (const filename of resourceFiles) {
|
|
23
|
+
const key = filename.replace(/-resource\.json$/, "");
|
|
24
|
+
const resourcePath = path.join(resourcesDir, filename);
|
|
25
|
+
const resource = JSON.parse(fs.readFileSync(resourcePath, "utf-8"));
|
|
26
|
+
resourcesMap.set(key, resource);
|
|
27
|
+
}
|
|
28
|
+
const resourceKeys = Array.from(resourcesMap.keys());
|
|
29
|
+
const simulationsDir = path.join(projectRoot, "src/simulations");
|
|
30
|
+
const simulationFiles = fs.readdirSync(simulationsDir).filter((f) => f.endsWith("-simulation.json"));
|
|
31
|
+
const simulations = [];
|
|
32
|
+
for (const filename of simulationFiles) {
|
|
33
|
+
const simulationKey = filename.replace(/-simulation\.json$/, "");
|
|
34
|
+
const simulationPath = path.join(simulationsDir, filename);
|
|
35
|
+
const simulation = JSON.parse(fs.readFileSync(simulationPath, "utf-8"));
|
|
36
|
+
const resourceKey = findResourceKey(simulationKey, resourceKeys);
|
|
37
|
+
if (!resourceKey) {
|
|
38
|
+
console.warn(
|
|
39
|
+
`No matching resource found for simulation "${simulationKey}". Expected a resource file like src/resources/${simulationKey.split("-")[0]}-resource.json`
|
|
40
|
+
);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const resource = resourcesMap.get(resourceKey);
|
|
44
|
+
simulations.push({
|
|
45
|
+
...simulation,
|
|
46
|
+
distPath: path.join(projectRoot, `dist/${resourceKey}.js`),
|
|
47
|
+
resource
|
|
48
|
+
});
|
|
49
|
+
}
|
|
18
50
|
server.runMCPServer({
|
|
19
51
|
name: pkg.name || "Sunpeak",
|
|
20
52
|
version: pkg.version || "0.1.0",
|
package/dist/mcp/entry.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.cjs","sources":["../../src/mcp/entry.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Internal MCP server entry point\n * This is run by nodemon or directly to start the MCP server\n *
|
|
1
|
+
{"version":3,"file":"entry.cjs","sources":["../../src/mcp/entry.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Internal MCP server entry point\n * This is run by nodemon or directly to start the MCP server\n *\n * Auto-discovers simulations and resources by file naming convention:\n * - simulations/{resource}-{tool}-simulation.json (e.g., albums-show-simulation.json)\n * - resources/{resource}-resource.json\n */\nimport { runMCPServer, type SimulationWithDist } from './index.js';\nimport path from 'path';\nimport { readFileSync, readdirSync } from 'fs';\nimport type { Resource } from '@modelcontextprotocol/sdk/types.js';\n\n// Determine project root (where this is being run from)\nconst projectRoot = process.cwd();\n\n/**\n * Find the best matching resource key for a simulation key.\n * Matches the longest resource name that is a prefix of the simulation key.\n * e.g., 'albums-show' matches 'albums' (not 'album' if both exist)\n */\nfunction findResourceKey(simulationKey: string, resourceKeys: string[]): string | undefined {\n // Sort by length descending to find longest match first\n const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);\n for (const resourceKey of sorted) {\n if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + '-')) {\n return resourceKey;\n }\n }\n return undefined;\n}\n\nasync function startServer() {\n // Read package.json for app metadata\n const pkgPath = path.join(projectRoot, 'package.json');\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n\n // Auto-discover resource files first (to build lookup map)\n const resourcesDir = path.join(projectRoot, 'src/resources');\n const resourceFiles = readdirSync(resourcesDir).filter((f) => f.endsWith('-resource.json'));\n\n const resourcesMap = new Map<string, Resource>();\n for (const filename of resourceFiles) {\n // Extract key from filename: 'counter-resource.json' -> 'counter'\n const key = filename.replace(/-resource\\.json$/, '');\n const resourcePath = path.join(resourcesDir, filename);\n const resource = JSON.parse(readFileSync(resourcePath, 'utf-8')) as Resource;\n resourcesMap.set(key, resource);\n }\n\n const resourceKeys = Array.from(resourcesMap.keys());\n\n // Auto-discover simulation files\n const simulationsDir = path.join(projectRoot, 'src/simulations');\n const simulationFiles = readdirSync(simulationsDir).filter((f) => f.endsWith('-simulation.json'));\n\n // Build simulations array from discovered files\n const simulations: SimulationWithDist[] = [];\n\n for (const filename of simulationFiles) {\n // Extract simulation key from filename: 'albums-show-simulation.json' -> 'albums-show'\n const simulationKey = filename.replace(/-simulation\\.json$/, '');\n\n // Load simulation data\n const simulationPath = path.join(simulationsDir, filename);\n const simulation = JSON.parse(readFileSync(simulationPath, 'utf-8'));\n\n // Find matching resource by best prefix match\n const resourceKey = findResourceKey(simulationKey, resourceKeys);\n if (!resourceKey) {\n console.warn(\n `No matching resource found for simulation \"${simulationKey}\". ` +\n `Expected a resource file like src/resources/${simulationKey.split('-')[0]}-resource.json`\n );\n continue;\n }\n\n const resource = resourcesMap.get(resourceKey)!;\n\n simulations.push({\n ...simulation,\n distPath: path.join(projectRoot, `dist/${resourceKey}.js`),\n resource,\n });\n }\n\n runMCPServer({\n name: pkg.name || 'Sunpeak',\n version: pkg.version || '0.1.0',\n simulations,\n port: 6766,\n });\n}\n\nstartServer().cat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AK,MAAMD,GAAAA,aAAa,gBAAgB,OAAO,CAAC;AAGnE,UAAM,cAAc,gBAAgB,eAAe,YAAY;AAC/D,QAAI,CAAC,aAAa;AAChB,cAAQ;AAAA,QACN,8CAA8C,aAAa,kDACV,cAAc,MAAM,GAAG,EAAE,CAAC,CAAC;AAAA,MAAA;AAE9E;AAAA,IACF;AAEA,UAAM,WAAW,aAAa,IAAI,WAAW;AAE7C,gBAAY,KAAK;AAAA,MACf,GAAG;AAAA,MACH,UAAU,KAAK,KAAK,aAAa,QAAQ,WAAW,KAAK;AAAA,MACzD;AAAA,IAAA,CACD;AAAA,EACH;AAEAE,sBAAa;AAAA,IACX,MAAM,IAAI,QAAQ;AAAA,IAClB,SAAS,IAAI,WAAW;AAAA,IACxB;AAAA,IACA,MAAM;AAAA,EAAA,CACP;AACH;AAEA,cAAc,MAAM,CAAC,UAAU;AAC7B,UAAQ,MAAM,+BAA+B,KAAK;AAClD,UAAQ,KAAK,CAAC;AAChB,CAAC;"}
|
package/dist/mcp/entry.js
CHANGED
|
@@ -1,19 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { r as runMCPServer } from "../server-
|
|
2
|
+
import { r as runMCPServer } from "../server-DVmTC-SF.js";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import { readFileSync } from "fs";
|
|
4
|
+
import { readFileSync, readdirSync } from "fs";
|
|
5
5
|
const projectRoot = process.cwd();
|
|
6
|
+
function findResourceKey(simulationKey, resourceKeys) {
|
|
7
|
+
const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);
|
|
8
|
+
for (const resourceKey of sorted) {
|
|
9
|
+
if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + "-")) {
|
|
10
|
+
return resourceKey;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
6
15
|
async function startServer() {
|
|
7
16
|
const pkgPath = path.join(projectRoot, "package.json");
|
|
8
17
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
const resourcesDir = path.join(projectRoot, "src/resources");
|
|
19
|
+
const resourceFiles = readdirSync(resourcesDir).filter((f) => f.endsWith("-resource.json"));
|
|
20
|
+
const resourcesMap = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const filename of resourceFiles) {
|
|
22
|
+
const key = filename.replace(/-resource\.json$/, "");
|
|
23
|
+
const resourcePath = path.join(resourcesDir, filename);
|
|
24
|
+
const resource = JSON.parse(readFileSync(resourcePath, "utf-8"));
|
|
25
|
+
resourcesMap.set(key, resource);
|
|
26
|
+
}
|
|
27
|
+
const resourceKeys = Array.from(resourcesMap.keys());
|
|
28
|
+
const simulationsDir = path.join(projectRoot, "src/simulations");
|
|
29
|
+
const simulationFiles = readdirSync(simulationsDir).filter((f) => f.endsWith("-simulation.json"));
|
|
30
|
+
const simulations = [];
|
|
31
|
+
for (const filename of simulationFiles) {
|
|
32
|
+
const simulationKey = filename.replace(/-simulation\.json$/, "");
|
|
33
|
+
const simulationPath = path.join(simulationsDir, filename);
|
|
34
|
+
const simulation = JSON.parse(readFileSync(simulationPath, "utf-8"));
|
|
35
|
+
const resourceKey = findResourceKey(simulationKey, resourceKeys);
|
|
36
|
+
if (!resourceKey) {
|
|
37
|
+
console.warn(
|
|
38
|
+
`No matching resource found for simulation "${simulationKey}". Expected a resource file like src/resources/${simulationKey.split("-")[0]}-resource.json`
|
|
39
|
+
);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const resource = resourcesMap.get(resourceKey);
|
|
43
|
+
simulations.push({
|
|
44
|
+
...simulation,
|
|
45
|
+
distPath: path.join(projectRoot, `dist/${resourceKey}.js`),
|
|
46
|
+
resource
|
|
47
|
+
});
|
|
48
|
+
}
|
|
17
49
|
runMCPServer({
|
|
18
50
|
name: pkg.name || "Sunpeak",
|
|
19
51
|
version: pkg.version || "0.1.0",
|
package/dist/mcp/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","sources":["../../src/mcp/entry.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Internal MCP server entry point\n * This is run by nodemon or directly to start the MCP server\n *
|
|
1
|
+
{"version":3,"file":"entry.js","sources":["../../src/mcp/entry.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Internal MCP server entry point\n * This is run by nodemon or directly to start the MCP server\n *\n * Auto-discovers simulations and resources by file naming convention:\n * - simulations/{resource}-{tool}-simulation.json (e.g., albums-show-simulation.json)\n * - resources/{resource}-resource.json\n */\nimport { runMCPServer, type SimulationWithDist } from './index.js';\nimport path from 'path';\nimport { readFileSync, readdirSync } from 'fs';\nimport type { Resource } from '@modelcontextprotocol/sdk/types.js';\n\n// Determine project root (where this is being run from)\nconst projectRoot = process.cwd();\n\n/**\n * Find the best matching resource key for a simulation key.\n * Matches the longest resource name that is a prefix of the simulation key.\n * e.g., 'albums-show' matches 'albums' (not 'album' if both exist)\n */\nfunction findResourceKey(simulationKey: string, resourceKeys: string[]): string | undefined {\n // Sort by length descending to find longest match first\n const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);\n for (const resourceKey of sorted) {\n if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + '-')) {\n return resourceKey;\n }\n }\n return undefined;\n}\n\nasync function startServer() {\n // Read package.json for app metadata\n const pkgPath = path.join(projectRoot, 'package.json');\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n\n // Auto-discover resource files first (to build lookup map)\n const resourcesDir = path.join(projectRoot, 'src/resources');\n const resourceFiles = readdirSync(resourcesDir).filter((f) => f.endsWith('-resource.json'));\n\n const resourcesMap = new Map<string, Resource>();\n for (const filename of resourceFiles) {\n // Extract key from filename: 'counter-resource.json' -> 'counter'\n const key = filename.replace(/-resource\\.json$/, '');\n const resourcePath = path.join(resourcesDir, filename);\n const resource = JSON.parse(readFileSync(resourcePath, 'utf-8')) as Resource;\n resourcesMap.set(key, resource);\n }\n\n const resourceKeys = Array.from(resourcesMap.keys());\n\n // Auto-discover simulation files\n const simulationsDir = path.join(projectRoot, 'src/simulations');\n const simulationFiles = readdirSync(simulationsDir).filter((f) => f.endsWith('-simulation.json'));\n\n // Build simulations array from discovered files\n const simulations: SimulationWithDist[] = [];\n\n for (const filename of simulationFiles) {\n // Extract simulation key from filename: 'albums-show-simulation.json' -> 'albums-show'\n const simulationKey = filename.replace(/-simulation\\.json$/, '');\n\n // Load simulation data\n const simulationPath = path.join(simulationsDir, filename);\n const simulation = JSON.parse(readFileSync(simulationPath, 'utf-8'));\n\n // Find matching resource by best prefix match\n const resourceKey = findResourceKey(simulationKey, resourceKeys);\n if (!resourceKey) {\n console.warn(\n `No matching resource found for simulation \"${simulationKey}\". ` +\n `Expected a resource file like src/resources/${simulationKey.split('-')[0]}-resource.json`\n );\n continue;\n }\n\n const resource = resourcesMap.get(resourceKey)!;\n\n simulations.push({\n ...simulation,\n distPath: path.join(projectRoot, `dist/${resourceKey}.js`),\n resource,\n });\n }\n\n runMCPServer({\n name: pkg.name || 'Sunpeak',\n version: pkg.version || '0.1.0',\n simulations,\n port: 6766,\n });\n}\n\nstartServer().catch((error) => {\n console.error('Failed to start MCP server:', error);\n process.exit(1);\n});\n"],"names":[],"mappings":";;;;AAeA,MAAM,cAAc,QAAQ,IAAA;AAO5B,SAAS,gBAAgB,eAAuB,cAA4C;AAE1F,QAAM,SAAS,CAAC,GAAG,YAAY,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM;AACnE,aAAW,eAAe,QAAQ;AAChC,QAAI,kBAAkB,eAAe,cAAc,WAAW,cAAc,GAAG,GAAG;AAChF,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,eAAe,cAAc;AAE3B,QAAM,UAAU,KAAK,KAAK,aAAa,cAAc;AACrD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AA,IACA,MAAM;AAAA,EAAA,CACP;AACH;AAEA,cAAc,MAAM,CAAC,UAAU;AAC7B,UAAQ,MAAM,+BAA+B,KAAK;AAClD,UAAQ,KAAK,CAAC;AAChB,CAAC;"}
|
package/dist/mcp/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const server = require("../server-
|
|
3
|
+
const server = require("../server-B9YgCQdS.cjs");
|
|
4
4
|
exports.runMCPServer = server.runMCPServer;
|
|
5
5
|
//# sourceMappingURL=index.cjs.map
|
package/dist/mcp/index.js
CHANGED
|
@@ -4837,7 +4837,7 @@ function readResourceHtml(distPath) {
|
|
|
4837
4837
|
const htmlPath = path.resolve(distPath);
|
|
4838
4838
|
if (!fs.existsSync(htmlPath)) {
|
|
4839
4839
|
throw new Error(
|
|
4840
|
-
`Widget file not found at ${htmlPath}. Run "
|
|
4840
|
+
`Widget file not found at ${htmlPath}. Run "sunpeak build" to generate the built app.`
|
|
4841
4841
|
);
|
|
4842
4842
|
}
|
|
4843
4843
|
const jsContents = fs.readFileSync(htmlPath, "utf8");
|
|
@@ -4971,6 +4971,7 @@ async function handleSseRequest(res, config2) {
|
|
|
4971
4971
|
sessions.set(sessionId, { server, transport });
|
|
4972
4972
|
console.log(`[MCP] Session started: ${sessionId.substring(0, 8)}... (${sessions.size} active)`);
|
|
4973
4973
|
transport.onclose = async () => {
|
|
4974
|
+
if (!sessions.has(sessionId)) return;
|
|
4974
4975
|
sessions.delete(sessionId);
|
|
4975
4976
|
console.log(`[MCP] Session closed: ${sessionId.substring(0, 8)}... (${sessions.size} active)`);
|
|
4976
4977
|
await server.close();
|
|
@@ -5063,4 +5064,4 @@ function runMCPServer(config2) {
|
|
|
5063
5064
|
process.on("SIGINT", shutdown);
|
|
5064
5065
|
}
|
|
5065
5066
|
exports.runMCPServer = runMCPServer;
|
|
5066
|
-
//# sourceMappingURL=server-
|
|
5067
|
+
//# sourceMappingURL=server-B9YgCQdS.cjs.map
|