skybridge 0.0.0-dev.d20c84c → 0.0.0-dev.d20f258
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 +6 -5
- package/dist/cli/server-entry.d.ts +1 -0
- package/dist/cli/server-entry.js +47 -0
- package/dist/cli/server-entry.js.map +1 -0
- package/dist/cli/use-execute-steps.d.ts +3 -2
- package/dist/cli/use-execute-steps.js +13 -3
- package/dist/cli/use-execute-steps.js.map +1 -1
- package/dist/cli/use-nodemon.d.ts +6 -0
- package/dist/cli/use-nodemon.js +71 -0
- package/dist/cli/use-nodemon.js.map +1 -0
- package/dist/cli/use-typescript-check.d.ts +8 -0
- package/dist/cli/use-typescript-check.js +59 -0
- package/dist/cli/use-typescript-check.js.map +1 -0
- package/dist/commands/build.js +32 -3
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/dev.js +7 -8
- package/dist/commands/dev.js.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/mcpMiddleware.d.ts +6 -0
- package/dist/server/mcpMiddleware.js +51 -0
- package/dist/server/mcpMiddleware.js.map +1 -0
- package/dist/server/widgetsDevServer.js +2 -1
- package/dist/server/widgetsDevServer.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -118,11 +118,12 @@ function FlightsWidget() {
|
|
|
118
118
|
|
|
119
119
|
Explore production-ready examples:
|
|
120
120
|
|
|
121
|
-
| Example
|
|
122
|
-
|
|
123
|
-
| **Capitals Explorer**
|
|
124
|
-
| **Ecommerce Carousel** | Product carousel with cart, localization, and modals
|
|
125
|
-
| **Everything**
|
|
121
|
+
| Example | Description | Demo | Code |
|
|
122
|
+
|------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------------|
|
|
123
|
+
| **Capitals Explorer** | Interactive world map with geolocation and Wikipedia integration | [Try Demo](https://capitals.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/capitals) |
|
|
124
|
+
| **Ecommerce Carousel** | Product carousel with cart, localization, and modals | [Try Demo](https://ecommerce.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/ecom-carousel) |
|
|
125
|
+
| **Everything** | Comprehensive playground showcasing all hooks and features | [Try Demo](https://everything.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/everything) |
|
|
126
|
+
| **Productivity** | Data visualization dashboard demonstrating Skybridge capabilities for MCP Apps | [Try Demo](https://productivity.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/productivity) |
|
|
126
127
|
|
|
127
128
|
See all examples in the [Showcase](https://docs.skybridge.tech/showcase) or browse the [examples/](examples/) directory.
|
|
128
129
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
import express, {} from "express";
|
|
4
|
+
import { createMcpMiddleware, McpServer } from "skybridge/server";
|
|
5
|
+
// Dynamically import the user's server.ts
|
|
6
|
+
const serverPath = path.resolve(process.cwd(), "server/src/server.ts");
|
|
7
|
+
const serverModule = await import(serverPath).catch(() => {
|
|
8
|
+
console.error("Error: A server.ts file must be present in the server/src directory");
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
11
|
+
const server = serverModule.default;
|
|
12
|
+
if (!server) {
|
|
13
|
+
console.error("Error: server.ts must export a default MCP server instance");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
if (!(server instanceof McpServer)) {
|
|
17
|
+
console.error("Error: server.ts must export an instance of McpServer from 'skybridge/server'");
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
const app = express();
|
|
21
|
+
app.use(express.json());
|
|
22
|
+
// Add MCP middleware
|
|
23
|
+
app.use(createMcpMiddleware(server));
|
|
24
|
+
const env = process.env.NODE_ENV || "development";
|
|
25
|
+
if (env !== "production") {
|
|
26
|
+
const { widgetsDevServer } = await import("skybridge/server");
|
|
27
|
+
const { devtoolsStaticServer } = await import("@skybridge/devtools");
|
|
28
|
+
app.use(await devtoolsStaticServer());
|
|
29
|
+
app.use(await widgetsDevServer());
|
|
30
|
+
}
|
|
31
|
+
if (env === "production") {
|
|
32
|
+
const distDir = path.join(process.cwd(), "dist");
|
|
33
|
+
app.use("/assets", cors());
|
|
34
|
+
app.use("/assets", express.static(path.join(distDir, "assets")));
|
|
35
|
+
}
|
|
36
|
+
const port = 3000;
|
|
37
|
+
app.listen(port, (error) => {
|
|
38
|
+
if (error) {
|
|
39
|
+
console.error("Failed to start server:", error);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
process.on("SIGINT", async () => {
|
|
44
|
+
console.log("Server shutdown complete");
|
|
45
|
+
process.exit(0);
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=server-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-entry.js","sourceRoot":"","sources":["../../src/cli/server-entry.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,EAAE,EAAgB,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlE,0CAA0C;AAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,sBAAsB,CAAC,CAAC;AACvE,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IACvD,OAAO,CAAC,KAAK,CACX,qEAAqE,CACtE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACl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AAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;IACzB,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export interface CommandStep {
|
|
2
2
|
label: string;
|
|
3
|
-
command
|
|
3
|
+
command?: string;
|
|
4
|
+
run?: () => void | Promise<void>;
|
|
4
5
|
}
|
|
5
|
-
export declare const useExecuteSteps: (steps: CommandStep[]) => {
|
|
6
|
+
export declare const useExecuteSteps: (steps: CommandStep[], cleanup?: () => void) => {
|
|
6
7
|
currentStep: number;
|
|
7
8
|
status: "error" | "success" | "running";
|
|
8
9
|
error: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useState } from "react";
|
|
2
2
|
import { runCommand } from "./run-command.js";
|
|
3
|
-
export const useExecuteSteps = (steps) => {
|
|
3
|
+
export const useExecuteSteps = (steps, cleanup) => {
|
|
4
4
|
const [currentStep, setCurrentStep] = useState(0);
|
|
5
5
|
const [status, setStatus] = useState("running");
|
|
6
6
|
const [error, setError] = useState(null);
|
|
@@ -10,7 +10,12 @@ export const useExecuteSteps = (steps) => {
|
|
|
10
10
|
const step = steps[i];
|
|
11
11
|
if (step) {
|
|
12
12
|
setCurrentStep(i);
|
|
13
|
-
|
|
13
|
+
if (step.run) {
|
|
14
|
+
await step.run();
|
|
15
|
+
}
|
|
16
|
+
if (step.command) {
|
|
17
|
+
await runCommand(step.command);
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
setStatus("success");
|
|
@@ -25,7 +30,12 @@ export const useExecuteSteps = (steps) => {
|
|
|
25
30
|
process.exit(1);
|
|
26
31
|
});
|
|
27
32
|
}
|
|
28
|
-
|
|
33
|
+
finally {
|
|
34
|
+
if (cleanup) {
|
|
35
|
+
cleanup();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}, [steps, cleanup]);
|
|
29
39
|
return { currentStep, status, error, execute };
|
|
30
40
|
};
|
|
31
41
|
//# sourceMappingURL=use-execute-steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-execute-steps.js","sourceRoot":"","sources":["../../src/cli/use-execute-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-execute-steps.js","sourceRoot":"","sources":["../../src/cli/use-execute-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAoB,EAAE,OAAoB,EAAE,EAAE;IAC5E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAClC,SAAS,CACV,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QA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AAC;AACjD,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import nodemonOriginal from "nodemon";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
const nodemon = nodemonOriginal;
|
|
6
|
+
export function useNodemon(env) {
|
|
7
|
+
const [messages, setMessages] = useState([]);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
// Get the path to the server entry point (always use compiled .js file)
|
|
10
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
11
|
+
const cliDir = resolve(currentFile, "..");
|
|
12
|
+
const entryPath = resolve(cliDir, "server-entry.js");
|
|
13
|
+
// Start nodemon with the entry point that dynamically imports server.ts
|
|
14
|
+
nodemon({
|
|
15
|
+
env,
|
|
16
|
+
watch: ["server/src"],
|
|
17
|
+
ext: "ts,json",
|
|
18
|
+
exec: `tsx ${entryPath}`,
|
|
19
|
+
stdout: false,
|
|
20
|
+
stderr: false,
|
|
21
|
+
});
|
|
22
|
+
const handleStdoutData = (chunk) => {
|
|
23
|
+
const message = chunk.toString().trim();
|
|
24
|
+
if (message) {
|
|
25
|
+
setMessages((prev) => [...prev, { text: message, type: "log" }]);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const handleStderrData = (chunk) => {
|
|
29
|
+
const message = chunk.toString().trim();
|
|
30
|
+
if (message) {
|
|
31
|
+
setMessages((prev) => [...prev, { text: message, type: "error" }]);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const setupStdoutListener = () => {
|
|
35
|
+
if (nodemon.stdout) {
|
|
36
|
+
nodemon.stdout.off("data", handleStdoutData);
|
|
37
|
+
nodemon.stdout.on("data", handleStdoutData);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const setupStderrListener = () => {
|
|
41
|
+
if (nodemon.stderr) {
|
|
42
|
+
nodemon.stderr.off("data", handleStderrData);
|
|
43
|
+
nodemon.stderr.on("data", handleStderrData);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
nodemon.on("readable", () => {
|
|
47
|
+
setupStdoutListener();
|
|
48
|
+
setupStderrListener();
|
|
49
|
+
});
|
|
50
|
+
nodemon.on("restart", (files) => {
|
|
51
|
+
const restartMessage = `Server restarted due to file changes: ${files.join(", ")}`;
|
|
52
|
+
setMessages((prev) => [
|
|
53
|
+
...prev,
|
|
54
|
+
{ text: restartMessage, type: "restart" },
|
|
55
|
+
]);
|
|
56
|
+
setupStdoutListener();
|
|
57
|
+
setupStderrListener();
|
|
58
|
+
});
|
|
59
|
+
return () => {
|
|
60
|
+
if (nodemon.stdout) {
|
|
61
|
+
nodemon.stdout.off("data", handleStdoutData);
|
|
62
|
+
}
|
|
63
|
+
if (nodemon.stderr) {
|
|
64
|
+
nodemon.stderr.off("data", handleStderrData);
|
|
65
|
+
}
|
|
66
|
+
nodemon.emit("quit");
|
|
67
|
+
};
|
|
68
|
+
}, [env]);
|
|
69
|
+
return messages;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=use-nodemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nodemon.js","sourceRoot":"","sources":["../../src/cli/use-nodemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,eAAe,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,OAAO,GAAG,eAAkC,CAAC;AAOnD,MAAM,UAAU,UAAU,CAAC,GAAsB;IAC/C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,wEAAwE;QACxE,MAAM,WAAW,GAAG,aAAa,CAAC,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C;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { isAbsolute, relative } from "node:path";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
export function useTypeScriptCheck() {
|
|
5
|
+
const tsProcessRef = useRef(null);
|
|
6
|
+
const [tsErrors, setTsErrors] = useState([]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const tsProcess = spawn("npx", ["tsc", "--noEmit", "--watch", "--pretty", "false"], {
|
|
9
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
10
|
+
shell: true,
|
|
11
|
+
});
|
|
12
|
+
tsProcessRef.current = tsProcess;
|
|
13
|
+
let outputBuffer = "";
|
|
14
|
+
let currentErrors = [];
|
|
15
|
+
const processOutput = (data) => {
|
|
16
|
+
outputBuffer += data.toString();
|
|
17
|
+
const lines = outputBuffer.split("\n");
|
|
18
|
+
outputBuffer = lines.pop() || ""; // Keep incomplete line in buffer
|
|
19
|
+
for (const line of lines) {
|
|
20
|
+
const trimmed = line.trim();
|
|
21
|
+
// Parse TypeScript error format: file.ts(10,5): error TS2322: message
|
|
22
|
+
// Match pattern: filename(line,col): error code: message
|
|
23
|
+
const errorMatch = trimmed.match(/^(.+?)\((\d+),(\d+)\):\s+error\s+(TS\d+)?\s*:?\s*(.+)$/);
|
|
24
|
+
if (errorMatch) {
|
|
25
|
+
const [, file, lineStr, colStr, , message] = errorMatch;
|
|
26
|
+
if (file && lineStr && colStr && message) {
|
|
27
|
+
let cleanFile = file.trim();
|
|
28
|
+
if (isAbsolute(cleanFile)) {
|
|
29
|
+
cleanFile = relative(process.cwd(), cleanFile);
|
|
30
|
+
}
|
|
31
|
+
currentErrors.push({
|
|
32
|
+
file: cleanFile,
|
|
33
|
+
line: Number.parseInt(lineStr, 10),
|
|
34
|
+
col: Number.parseInt(colStr, 10),
|
|
35
|
+
message: message.trim(),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (trimmed.includes("Found") && trimmed.includes("error")) {
|
|
40
|
+
setTsErrors(trimmed.match(/Found 0 error/) ? [] : [...currentErrors]);
|
|
41
|
+
currentErrors = [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
if (tsProcess.stdout) {
|
|
46
|
+
tsProcess.stdout.on("data", processOutput);
|
|
47
|
+
}
|
|
48
|
+
if (tsProcess.stderr) {
|
|
49
|
+
tsProcess.stderr.on("data", processOutput);
|
|
50
|
+
}
|
|
51
|
+
return () => {
|
|
52
|
+
if (tsProcessRef.current) {
|
|
53
|
+
tsProcessRef.current.kill();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}, []);
|
|
57
|
+
return tsErrors;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=use-typescript-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-typescript-check.js","sourceRoot":"","sources":["../../src/cli/use-typescript-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASpD,MAAM,UAAU,kBAAkB;IAChC,MAAM,YAAY,GAAG,MAAM,CAAkC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,KAAK,CACrB,KAAK,EACL,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EACnD;YACE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;YACj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AAE;yBACxB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;gBAED,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC3D,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;oBACtE,aAAa,GAAG,EAAE,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;gBACzB,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,30 +1,59 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cpSync, existsSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import { Command } from "@oclif/core";
|
|
3
6
|
import { Box, render, Text } from "ink";
|
|
4
7
|
import { useEffect } from "react";
|
|
5
8
|
import { Header } from "../cli/header.js";
|
|
6
9
|
import { useExecuteSteps } from "../cli/use-execute-steps.js";
|
|
7
10
|
export const commandSteps = [
|
|
11
|
+
{
|
|
12
|
+
label: "Preparing build environment",
|
|
13
|
+
run: () => {
|
|
14
|
+
const projectRoot = process.cwd();
|
|
15
|
+
const serverSrcDir = resolve(projectRoot, "server/src");
|
|
16
|
+
const serverTsPath = join(serverSrcDir, "server.ts");
|
|
17
|
+
if (!existsSync(serverTsPath)) {
|
|
18
|
+
throw new Error(`server.ts not found at ${serverTsPath}. Please ensure your server.ts file exists in server/src/`);
|
|
19
|
+
}
|
|
20
|
+
const indexTsPath = join(serverSrcDir, "index.ts");
|
|
21
|
+
if (existsSync(indexTsPath)) {
|
|
22
|
+
throw new Error(`There should be no index.ts file in server/src. Please remove it before building.`);
|
|
23
|
+
}
|
|
24
|
+
const serverEntryPath = resolve(fileURLToPath(import.meta.url), "../../cli/server-entry.js");
|
|
25
|
+
const buildEntryContent = readFileSync(serverEntryPath, "utf-8");
|
|
26
|
+
writeFileSync(join(serverSrcDir, "index.ts"), buildEntryContent, "utf-8");
|
|
27
|
+
},
|
|
28
|
+
},
|
|
8
29
|
{
|
|
9
30
|
label: "Building widgets",
|
|
10
31
|
command: "vite build -c web/vite.config.ts",
|
|
11
32
|
},
|
|
12
33
|
{
|
|
13
34
|
label: "Compiling server",
|
|
14
|
-
|
|
35
|
+
run: () => rmSync("dist", { recursive: true, force: true }),
|
|
36
|
+
command: "tsc -p tsconfig.server.json",
|
|
15
37
|
},
|
|
16
38
|
{
|
|
17
39
|
label: "Copying static assets",
|
|
18
|
-
|
|
40
|
+
run: () => cpSync("web/dist", "dist/assets", { recursive: true }),
|
|
19
41
|
},
|
|
20
42
|
];
|
|
43
|
+
const cleanup = () => {
|
|
44
|
+
const projectRoot = process.cwd();
|
|
45
|
+
const serverIndex = resolve(projectRoot, "server/src/index.ts");
|
|
46
|
+
if (existsSync(serverIndex)) {
|
|
47
|
+
rmSync(serverIndex);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
21
50
|
export default class Build extends Command {
|
|
22
51
|
static description = "Build the widgets and MCP server";
|
|
23
52
|
static examples = ["skybridge build"];
|
|
24
53
|
static flags = {};
|
|
25
54
|
async run() {
|
|
26
55
|
const App = () => {
|
|
27
|
-
const { currentStep, status, error, execute } = useExecuteSteps(commandSteps);
|
|
56
|
+
const { currentStep, status, error, execute } = useExecuteSteps(commandSteps, cleanup);
|
|
28
57
|
useEffect(() => {
|
|
29
58
|
execute();
|
|
30
59
|
}, [execute]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC;QACE,KAAK,EAAE,kBAAkB;QACzB,OAAO,EAAE,kCAAkC;KAC5C;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,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,GAAG,KAAG,EAAE;YACd,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Command, Flags } from "@oclif/core";
|
|
3
3
|
import { Box, render, Text } from "ink";
|
|
4
4
|
import { Header } from "../cli/header.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useNodemon } from "../cli/use-nodemon.js";
|
|
6
|
+
import { useTypeScriptCheck } from "../cli/use-typescript-check.js";
|
|
6
7
|
export default class Dev extends Command {
|
|
7
8
|
static description = "Start development server";
|
|
8
9
|
static examples = ["skybridge"];
|
|
@@ -19,14 +20,12 @@ export default class Dev extends Command {
|
|
|
19
20
|
? { SKYBRIDGE_USE_FORWARDED_HOST: "true" }
|
|
20
21
|
: {}),
|
|
21
22
|
};
|
|
22
|
-
runCommand("nodemon --quiet", {
|
|
23
|
-
stdio: ["ignore", "ignore", "inherit"],
|
|
24
|
-
env,
|
|
25
|
-
});
|
|
26
23
|
const App = () => {
|
|
27
|
-
|
|
24
|
+
const tsErrors = useTypeScriptCheck();
|
|
25
|
+
const messages = useNodemon(env);
|
|
26
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }), _jsxs(Box, { children: [_jsxs(Text, { color: "green", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Open DevTools to test your app locally:", " "] }), _jsx(Text, { color: "green", children: "http://localhost:3000/" })] }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { children: ["MCP server running at:", " "] }), _jsx(Text, { color: "white", bold: true, children: "http://localhost:3000/mcp" })] }), _jsx(Text, { color: "white", underline: true, children: "To test on ChatGPT:" }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "grey", children: "Make your local server accessible with " }), _jsx(Text, { color: "white", bold: true, children: "ngrok http 3000" })] }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "grey", children: "Connect to ChatGPT with URL " }), _jsx(Text, { color: "white", bold: true, children: "https://xxxxxx.ngrok-free.app/mcp" })] }) }), _jsx(Box, { children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { children: "Documentation: " }), _jsx(Text, { color: "white", bold: true, children: "https://docs.skybridge.tech/" })] }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { children: "If you like Skybridge, please " }), _jsxs(Text, { color: "white", bold: true, children: ["give it a star", " "] }), _jsx(Text, { children: "on GitHub: " }), _jsx(Text, { color: "white", underline: true, children: "https://github.com/alpic-ai/skybridge" }), _jsx(Text, { color: "grey", children: " \uD83D\uDE4F" })] }) }), tsErrors.length > 0 && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "red", bold: true, children: "\u26A0\uFE0F TypeScript errors found:" }), tsErrors.map((error) => (_jsxs(Box, { marginLeft: 2, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "white", children: error.file }), _jsxs(Text, { color: "grey", children: ["(", error.line, ",", error.col, "):", " "] })] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "red", children: error.message }) })] }, `${error.file}:${error.line}:${error.col}`)))] })), messages.length > 0 && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "white", bold: true, children: "Logs:" }), messages.map((message, index) => (_jsx(Box, { marginLeft: 2, children: message.type === "restart" ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "green", children: ["\u2713", " "] }), _jsx(Text, { color: "white", children: message.text })] })) : message.type === "error" ? (_jsx(Text, { color: "red", children: message.text })) : (_jsx(Text, { children: message.text })) }, `${message.type}-${index}-${message.text.slice(0, 20)}`)))] }))] }));
|
|
28
27
|
};
|
|
29
|
-
render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole:
|
|
28
|
+
render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole: true });
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
//# sourceMappingURL=dev.js.map
|
package/dist/commands/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,MAAM,CAAU,WAAW,GAAG,0BAA0B,CAAC;IACzD,MAAM,CAAU,QAAQ,GAAG,CAAC,WAAW,CAA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AAC,IAAI,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAaxD,CACP,CAAC,IACE,CACP,IACG,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { AnyToolRegistry, InferTools, ToolInput, ToolNames, ToolOutput, ToolResponseMetadata, } from "./inferUtilityTypes.js";
|
|
2
|
+
export { createMcpMiddleware } from "./mcpMiddleware.js";
|
|
2
3
|
export type { McpServerTypes, ToolDef, WidgetHostType } from "./server.js";
|
|
3
4
|
export { McpServer } from "./server.js";
|
|
4
5
|
export { widgetsDevServer } from "./widgetsDevServer.js";
|
package/dist/server/index.js
CHANGED
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates Express middleware for handling MCP requests
|
|
4
|
+
*/
|
|
5
|
+
export function createMcpMiddleware(server) {
|
|
6
|
+
return async (req, res, next) => {
|
|
7
|
+
// Only handle requests to the /mcp path
|
|
8
|
+
if (req.path !== "/mcp") {
|
|
9
|
+
return next();
|
|
10
|
+
}
|
|
11
|
+
if (req.method === "POST") {
|
|
12
|
+
try {
|
|
13
|
+
const transport = new StreamableHTTPServerTransport({
|
|
14
|
+
sessionIdGenerator: undefined,
|
|
15
|
+
});
|
|
16
|
+
res.on("close", () => {
|
|
17
|
+
transport.close();
|
|
18
|
+
});
|
|
19
|
+
await server.connect(transport);
|
|
20
|
+
await transport.handleRequest(req, res, req.body);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error("Error handling MCP request:", error);
|
|
24
|
+
if (!res.headersSent) {
|
|
25
|
+
res.status(500).json({
|
|
26
|
+
jsonrpc: "2.0",
|
|
27
|
+
error: {
|
|
28
|
+
code: -32603,
|
|
29
|
+
message: "Internal server error",
|
|
30
|
+
},
|
|
31
|
+
id: null,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (req.method === "GET" || req.method === "DELETE") {
|
|
37
|
+
res.writeHead(405).end(JSON.stringify({
|
|
38
|
+
jsonrpc: "2.0",
|
|
39
|
+
error: {
|
|
40
|
+
code: -32000,
|
|
41
|
+
message: "Method not allowed.",
|
|
42
|
+
},
|
|
43
|
+
id: null,
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
next();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=mcpMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpMiddleware.js","sourceRoot":"","sources":["../../src/server/mcpMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAInG;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC9B,wCAAwC;QACxC,IAAI,GAAG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H,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,EAAE,CAAC;QACT,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -27,7 +27,7 @@ export const widgetsDevServer = async () => {
|
|
|
27
27
|
webAppRoot = path.join(workspaceRoot, "web");
|
|
28
28
|
}
|
|
29
29
|
const configResult = await loadConfigFromFile({ command: "serve", mode: "development" }, path.join(webAppRoot, "vite.config.ts"), webAppRoot);
|
|
30
|
-
const { build, preview, ...devConfig } = configResult?.config || {};
|
|
30
|
+
const { build, preview, plugins: userPlugins = [], ...devConfig } = configResult?.config || {};
|
|
31
31
|
const vite = await createServer({
|
|
32
32
|
...devConfig,
|
|
33
33
|
configFile: false, // Keep this to prevent vite from trying to resolve path in the target config file
|
|
@@ -41,6 +41,7 @@ export const widgetsDevServer = async () => {
|
|
|
41
41
|
include: ["react", "react-dom/client"],
|
|
42
42
|
},
|
|
43
43
|
plugins: [
|
|
44
|
+
...userPlugins,
|
|
44
45
|
assetBaseUrlTransformPlugin({ devServerOrigin: "http://localhost:3000" }),
|
|
45
46
|
],
|
|
46
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetsDevServer.js","sourceRoot":"","sources":["../../src/server/widgetsDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,EAAE,EAAe,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,IAAqB,EAAE;IAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,GAChE,MAAM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AC;AAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.d20f258",
|
|
4
4
|
"description": "Skybridge is a framework for building ChatGPT and MCP Apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@modelcontextprotocol/sdk": ">=1.0.0",
|
|
34
|
+
"@skybridge/devtools": ">=0.23.4 <1.0.0",
|
|
35
|
+
"nodemon": ">=3.0.0",
|
|
34
36
|
"react": ">=18.0.0",
|
|
35
37
|
"react-dom": ">=18.0.0"
|
|
36
38
|
},
|