skybridge 0.0.0-dev.6696fa6 → 0.0.0-dev.66b7fef
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 +145 -0
- package/dist/cli/use-execute-steps.d.ts +2 -1
- package/dist/cli/use-execute-steps.js +6 -1
- 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 +69 -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 +4 -2
- 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/commands/start.js +12 -12
- package/dist/commands/start.js.map +1 -1
- package/dist/server/asset-base-url-transform-plugin.d.ts +11 -0
- package/dist/server/asset-base-url-transform-plugin.js +34 -0
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.d.ts +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.js +56 -0
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
- package/dist/server/express.d.ts +9 -0
- package/dist/server/express.js +72 -0
- package/dist/server/express.js.map +1 -0
- package/dist/server/express.test.d.ts +1 -0
- package/dist/server/express.test.js +74 -0
- package/dist/server/express.test.js.map +1 -0
- package/dist/server/server.d.ts +6 -0
- package/dist/server/server.js +62 -6
- package/dist/server/server.js.map +1 -1
- package/dist/server/templateHelper.d.ts +1 -0
- package/dist/server/templateHelper.js.map +1 -1
- package/dist/server/templates/development.hbs +2 -1
- package/dist/server/templates/production.hbs +1 -2
- package/dist/server/widgetsDevServer.js +11 -1
- package/dist/server/widgetsDevServer.js.map +1 -1
- package/dist/test/widget.test.js +20 -14
- package/dist/test/widget.test.js.map +1 -1
- package/dist/web/bridges/apps-sdk/adaptor.js +20 -4
- package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -1
- package/dist/web/bridges/apps-sdk/bridge.d.ts +1 -1
- package/dist/web/bridges/apps-sdk/types.d.ts +9 -6
- package/dist/web/bridges/apps-sdk/types.js.map +1 -1
- package/dist/web/bridges/mcp-app/adaptor.js +10 -5
- package/dist/web/bridges/mcp-app/adaptor.js.map +1 -1
- package/dist/web/bridges/mcp-app/bridge.js +5 -0
- package/dist/web/bridges/mcp-app/bridge.js.map +1 -1
- package/dist/web/create-store.test.js +3 -3
- package/dist/web/create-store.test.js.map +1 -1
- package/dist/web/data-llm.test.js +10 -8
- package/dist/web/data-llm.test.js.map +1 -1
- package/dist/web/hooks/use-files.test.js +5 -1
- package/dist/web/hooks/use-files.test.js.map +1 -1
- package/dist/web/hooks/use-widget-state.test.js +7 -6
- package/dist/web/hooks/use-widget-state.test.js.map +1 -1
- package/dist/web/plugin/plugin.js +16 -9
- package/dist/web/plugin/plugin.js.map +1 -1
- package/dist/web/proxy.js +0 -1
- package/dist/web/proxy.js.map +1 -1
- package/package.json +23 -18
- package/tsconfig.base.json +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img alt="Skybridge" src="https://raw.githubusercontent.com/alpic-ai/skybridge/main/docs/images/github-banner.png" width="100%">
|
|
4
|
+
|
|
5
|
+
<br />
|
|
6
|
+
|
|
7
|
+
# Skybridge
|
|
8
|
+
|
|
9
|
+
**Build ChatGPT & MCP Apps. The Modern TypeScript Way.**
|
|
10
|
+
|
|
11
|
+
The fullstack TypeScript framework for AI-embedded widgets.<br />
|
|
12
|
+
**Type-safe. React-powered. Platform-agnostic.**
|
|
13
|
+
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
[](https://www.npmjs.com/package/skybridge)
|
|
17
|
+
[](https://www.npmjs.com/package/skybridge)
|
|
18
|
+
[](https://github.com/alpic-ai/skybridge/blob/main/LICENSE)
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
[Documentation](https://docs.skybridge.tech) · [Quick Start](https://docs.skybridge.tech/quickstart/create-new-app) · [Showcase](https://docs.skybridge.tech/showcase)
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<br />
|
|
27
|
+
|
|
28
|
+
## ✨ Why Skybridge?
|
|
29
|
+
|
|
30
|
+
ChatGPT Apps and MCP Apps let you embed **rich, interactive UIs** directly in AI conversations. But the raw SDKs are low-level—no hooks, no type safety, no dev tools, and no HMR.
|
|
31
|
+
|
|
32
|
+
**Skybridge fixes that.**
|
|
33
|
+
|
|
34
|
+
| | |
|
|
35
|
+
|:--|:--|
|
|
36
|
+
| 👨💻 **Full Dev Environment** — HMR, debug traces, and local devtools. No more refresh loops. | ✅ **End-to-End Type Safety** — tRPC-style inference from server to widget. Autocomplete everywhere. |
|
|
37
|
+
| 🔄 **Widget-to-Model Sync** — Keep the model aware of UI state with `data-llm`. Dual surfaces, one source of truth. | ⚒️ **React Query-style Hooks** — `isPending`, `isError`, callbacks. State management you already know. |
|
|
38
|
+
| 🌐 **Platform Agnostic** — Write once, run anywhere. Works with ChatGPT (Apps SDK) and MCP-compatible clients. | 📦 **Showcase Examples** — Production-ready examples to learn from and build upon. |
|
|
39
|
+
|
|
40
|
+
<br />
|
|
41
|
+
|
|
42
|
+
## 🚀 Get Started
|
|
43
|
+
|
|
44
|
+
**Create a new app:**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm create skybridge@latest
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Or add to an existing project:**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm i skybridge
|
|
54
|
+
yarn add skybridge
|
|
55
|
+
pnpm add skybridge
|
|
56
|
+
bun add skybridge
|
|
57
|
+
deno add skybridge
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
<div align="center">
|
|
61
|
+
|
|
62
|
+
**👉 [Read the Docs](https://docs.skybridge.tech) 👈**
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<br />
|
|
67
|
+
|
|
68
|
+
## 📦 Architecture
|
|
69
|
+
|
|
70
|
+
Skybridge is a fullstack framework with unified server and client modules:
|
|
71
|
+
|
|
72
|
+
- **`skybridge/server`** — Define tools and widgets with full type inference. Extends the MCP SDK.
|
|
73
|
+
- **`skybridge/web`** — React hooks that consume your server types. Works with Apps SDK (ChatGPT) and MCP Apps.
|
|
74
|
+
- **Dev Environment** — Vite plugin with HMR, DevTools emulator, and optimized builds.
|
|
75
|
+
|
|
76
|
+
### Server
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { McpServer } from "skybridge/server";
|
|
80
|
+
|
|
81
|
+
server.registerWidget("flights", {}, {
|
|
82
|
+
inputSchema: { destination: z.string() },
|
|
83
|
+
}, async ({ destination }) => {
|
|
84
|
+
const flights = await searchFlights(destination);
|
|
85
|
+
return { structuredContent: { flights } };
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Widget
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import { useToolInfo } from "skybridge/web";
|
|
93
|
+
|
|
94
|
+
function FlightsWidget() {
|
|
95
|
+
const { output } = useToolInfo();
|
|
96
|
+
|
|
97
|
+
return output.structuredContent.flights.map(flight =>
|
|
98
|
+
<FlightCard key={flight.id} flight={flight} />
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
<br />
|
|
104
|
+
|
|
105
|
+
## 🎯 Features at a Glance
|
|
106
|
+
|
|
107
|
+
- **Live Reload** — Vite HMR. See changes instantly without reinstalling.
|
|
108
|
+
- **Typed Hooks** — Full autocomplete for tools, inputs, outputs.
|
|
109
|
+
- **Widget → Tool Calls** — Trigger server actions from UI.
|
|
110
|
+
- **Dual Surface Sync** — Keep model aware of what users see with `data-llm`.
|
|
111
|
+
- **React Query-style API** — `isPending`, `isError`, callbacks.
|
|
112
|
+
- **Platform Agnostic** — Works with ChatGPT (Apps SDK) and MCP Apps clients (Goose, VSCode, etc.).
|
|
113
|
+
- **MCP Compatible** — Extends the official SDK. Works with any MCP client.
|
|
114
|
+
|
|
115
|
+
<br />
|
|
116
|
+
|
|
117
|
+
## 📖 Showcase
|
|
118
|
+
|
|
119
|
+
Explore production-ready examples:
|
|
120
|
+
|
|
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) |
|
|
127
|
+
| **Manifest Starter** | Starter app with Manifest UI agentic components out-of-the-box | [Try Demo](https://manifest-ui.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/manifest-ui) |
|
|
128
|
+
|
|
129
|
+
See all examples in the [Showcase](https://docs.skybridge.tech/showcase) or browse the [examples/](examples/) directory.
|
|
130
|
+
|
|
131
|
+
<br />
|
|
132
|
+
|
|
133
|
+
<div align="center">
|
|
134
|
+
|
|
135
|
+
[](https://github.com/alpic-ai/skybridge/discussions)
|
|
136
|
+
[](https://github.com/alpic-ai/skybridge/issues)
|
|
137
|
+
[](https://discord.com/invite/gNAazGueab)
|
|
138
|
+
|
|
139
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions
|
|
140
|
+
|
|
141
|
+
<br />
|
|
142
|
+
|
|
143
|
+
**[MIT License](LICENSE)** · Made with ❤️ by **[Alpic](https://alpic.ai)**
|
|
144
|
+
|
|
145
|
+
</div>
|
|
@@ -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");
|
|
@@ -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,EAAE;IACtD,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,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
import { resolve } from "node:path";
|
|
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
|
+
const configFile = resolve(process.cwd(), "nodemon.json");
|
|
10
|
+
const config = existsSync(configFile)
|
|
11
|
+
? {
|
|
12
|
+
configFile,
|
|
13
|
+
}
|
|
14
|
+
: {
|
|
15
|
+
watch: ["server/src"],
|
|
16
|
+
ext: "ts,json",
|
|
17
|
+
exec: "tsx server/src/index.ts",
|
|
18
|
+
};
|
|
19
|
+
nodemon({ ...config, env, stdout: false });
|
|
20
|
+
const handleStdoutData = (chunk) => {
|
|
21
|
+
const message = chunk.toString().trim();
|
|
22
|
+
if (message) {
|
|
23
|
+
setMessages((prev) => [...prev, { text: message, type: "log" }]);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const handleStderrData = (chunk) => {
|
|
27
|
+
const message = chunk.toString().trim();
|
|
28
|
+
if (message) {
|
|
29
|
+
setMessages((prev) => [...prev, { text: message, type: "error" }]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const setupStdoutListener = () => {
|
|
33
|
+
if (nodemon.stdout) {
|
|
34
|
+
nodemon.stdout.off("data", handleStdoutData);
|
|
35
|
+
nodemon.stdout.on("data", handleStdoutData);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const setupStderrListener = () => {
|
|
39
|
+
if (nodemon.stderr) {
|
|
40
|
+
nodemon.stderr.off("data", handleStderrData);
|
|
41
|
+
nodemon.stderr.on("data", handleStderrData);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
nodemon.on("readable", () => {
|
|
45
|
+
setupStdoutListener();
|
|
46
|
+
setupStderrListener();
|
|
47
|
+
});
|
|
48
|
+
nodemon.on("restart", (files) => {
|
|
49
|
+
const restartMessage = `Server restarted due to file changes: ${files.join(", ")}`;
|
|
50
|
+
setMessages((prev) => [
|
|
51
|
+
...prev,
|
|
52
|
+
{ text: restartMessage, type: "restart" },
|
|
53
|
+
]);
|
|
54
|
+
setupStdoutListener();
|
|
55
|
+
setupStderrListener();
|
|
56
|
+
});
|
|
57
|
+
return () => {
|
|
58
|
+
if (nodemon.stdout) {
|
|
59
|
+
nodemon.stdout.off("data", handleStdoutData);
|
|
60
|
+
}
|
|
61
|
+
if (nodemon.stderr) {
|
|
62
|
+
nodemon.stderr.off("data", handleStderrData);
|
|
63
|
+
}
|
|
64
|
+
nodemon.emit("quit");
|
|
65
|
+
};
|
|
66
|
+
}, [env]);
|
|
67
|
+
return messages;
|
|
68
|
+
}
|
|
69
|
+
//# 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,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,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,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;QAE1D,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC;YACnC,CAAC,CAAC;gBACE,UAAU;aACX;YACH,CAAC,CAAC;gBACE,KAAK,EAAE,CAAC,YAAY,CAAC;gBACrB,GAAG,EAAE,SAAS;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AM,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;YAC1B,mBAAmB,EAAE,CAAC;YACtB,mBAAmB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,KAAe,EAAE,EAAE;YACxC,MAAM,cAAc,GAAG,yCAAyC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACnF,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACpB,GAAG,IAAI;gBACP,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE;aAC1C,CAAC,CAAC;YACH,mBAAmB,EAAE,CAAC;YACtB,mBAAmB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACnB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC/C,CAAC;YACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACnB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC/C,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;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;YACjC,KAAK,EAAE,IAAI;SACZ,CACF,CAAC;QAEF,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;QAEjC,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,aAAa,GAAmB,EAAE,CAAC;QAEvC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;YACrC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC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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,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cpSync, rmSync } from "node:fs";
|
|
2
3
|
import { Command } from "@oclif/core";
|
|
3
4
|
import { Box, render, Text } from "ink";
|
|
4
5
|
import { useEffect } from "react";
|
|
@@ -11,11 +12,12 @@ export const commandSteps = [
|
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
label: "Compiling server",
|
|
14
|
-
|
|
15
|
+
run: () => rmSync("dist", { recursive: true, force: true }),
|
|
16
|
+
command: "tsc -b",
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
label: "Copying static assets",
|
|
18
|
-
|
|
20
|
+
run: () => cpSync("web/dist", "dist/assets", { recursive: true }),
|
|
19
21
|
},
|
|
20
22
|
];
|
|
21
23
|
export default class Build extends Command {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":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CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAC9D,IAAI,CAAC,KAAK,IACN,IAJC,IAAI,CAAC,KAAK,CAKd,CACP,CAAC;oBACJ,CAAC,CAAC,EAED,MAAM,KAAK,SAAS,IAAI,CACvB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,2DAEjB,GACH,CACP,EAEA,MAAM,KAAK,OAAO,IAAI,KAAK,IAAI,CAC9B,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,aACvC,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,EAAC,IAAI,0CAEf,EACP,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/B,KAAC,IAAI,IAAY,KAAK,EAAC,KAAK,YACzB,IAAI,IADI,IAAI,CAER,CACR,CAAC,GACE,IACF,CACP,IACG,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,CAAC,KAAC,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,CAAC,CAAC;IACzC,MAAM,CAAU,KAAK,GAAG;QACtB,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC;YAClC,WAAW,EACT,mJAAmJ;SACtJ,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAExC,MAAM,GAAG,GAAG;YACV,GAAG,OAAO,CAAC,GAAG;YACd,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC;gBAC7B,CAAC,CAAC,EAAE,4BAA4B,EAAE,MAAM,EA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
2
1
|
import { existsSync } from "node:fs";
|
|
3
2
|
import { resolve } from "node:path";
|
|
4
3
|
import { Command } from "@oclif/core";
|
|
5
|
-
import { Box, render, Text } from "ink";
|
|
6
|
-
import { Header } from "../cli/header.js";
|
|
7
4
|
import { runCommand } from "../cli/run-command.js";
|
|
8
5
|
export default class Start extends Command {
|
|
9
6
|
static description = "Start production server";
|
|
@@ -11,23 +8,26 @@ export default class Start extends Command {
|
|
|
11
8
|
static flags = {};
|
|
12
9
|
async run() {
|
|
13
10
|
console.clear();
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const candidates = [
|
|
12
|
+
resolve(process.cwd(), "dist/server/src/index.js"),
|
|
13
|
+
resolve(process.cwd(), "dist/index.js"),
|
|
14
|
+
];
|
|
15
|
+
const indexPath = candidates.find(existsSync);
|
|
16
|
+
if (!indexPath) {
|
|
17
|
+
console.error("❌ Error: No build output found");
|
|
17
18
|
console.error("");
|
|
18
19
|
console.error("Please build your project first:");
|
|
19
20
|
console.error(" skybridge build");
|
|
20
21
|
console.error("");
|
|
21
22
|
process.exit(1);
|
|
23
|
+
return;
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
console.log(`\x1b[36m\x1b[1m⛰ Welcome to Skybridge\x1b[0m \x1b[36mv${this.config.version}\x1b[0m`);
|
|
26
|
+
console.log(`Server running at: \x1b[32m\x1b[1mhttp://localhost:3000/mcp\x1b[0m`);
|
|
27
|
+
await runCommand(`node ${indexPath}`, {
|
|
28
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
25
29
|
env: { ...process.env, NODE_ENV: "production" },
|
|
26
30
|
});
|
|
27
|
-
const App = () => {
|
|
28
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }), _jsxs(Box, { children: [_jsx(Text, { children: "Server running at: " }), _jsx(Text, { color: "green", bold: true, children: "http://localhost:3000/mcp" })] })] }));
|
|
29
|
-
};
|
|
30
|
-
render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole: false });
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,MAAM,CAAU,WAAW,GAAG,yBAAyB,CAAC;IACxD,MAAM,CAAU,QAAQ,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC/C,MAAM,CAAU,KAAK,GAAG,EAAE,CAAC;IAEpB,KAAK,CAAC,GAAG;QACd,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,MAAM,UAAU,GAAG;YACjB,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,0BAA0B,CAAC;YAClD,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC;SACxC,CAAC;QAEF,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE9C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAChD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CACT,0DAA0D,IAAI,CAAC,MAAM,CAAC,OAAO,SAAS,CACvF,CAAC;QACF,OAAO,CAAC,GAAG,CACT,oEAAoE,CACrE,CAAC;QAEF,MAAM,UAAU,CAAC,QAAQ,SAAS,EAAE,EAAE;YACpC,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;YACvC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE;SAChD,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Plugin } from "vite";
|
|
2
|
+
/**
|
|
3
|
+
* Transforms asset import paths to use the development server base URL.
|
|
4
|
+
*/
|
|
5
|
+
export declare function assetBaseUrlTransform(code: string, devServerOrigin: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Vite plugin that transforms asset import paths to use the development server base URL.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assetBaseUrlTransformPlugin(options: {
|
|
10
|
+
devServerOrigin: string;
|
|
11
|
+
}): Plugin;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforms asset import paths to use the development server base URL.
|
|
3
|
+
*/
|
|
4
|
+
export function assetBaseUrlTransform(code, devServerOrigin) {
|
|
5
|
+
const assetStringPattern = /(?<!https?:\/\/)(["'`])(\/[^"'`]+\.(svg|png|jpeg|jpg|gif|webp|mp3|mp4|woff|woff2|ttf|eot))\1/g;
|
|
6
|
+
code = code.replace(assetStringPattern, (_match, quote, assetPath) => {
|
|
7
|
+
return `${quote}${devServerOrigin}${assetPath}${quote}`;
|
|
8
|
+
});
|
|
9
|
+
return code;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Vite plugin that transforms asset import paths to use the development server base URL.
|
|
13
|
+
*/
|
|
14
|
+
export function assetBaseUrlTransformPlugin(options) {
|
|
15
|
+
const { devServerOrigin } = options;
|
|
16
|
+
return {
|
|
17
|
+
name: "asset-base-url-transform",
|
|
18
|
+
enforce: "pre",
|
|
19
|
+
transform(code) {
|
|
20
|
+
if (!code) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const transformedCode = assetBaseUrlTransform(code, devServerOrigin);
|
|
24
|
+
if (transformedCode === code) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
code: transformedCode,
|
|
29
|
+
map: null,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=asset-base-url-transform-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-base-url-transform-plugin.js","sourceRoot":"","sources":["../../src/server/asset-base-url-transform-plugin.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,eAAuB;IAEvB,MAAM,kBAAkB,GACtB,+FAA+F,CAAC;IAElG,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;QACnE,OAAO,GAAG,KAAK,GAAG,eAAe,GAAG,SAAS,GAAG,KAAK,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAE3C;IACC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAEpC,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,KAAK;QACd,SAAS,CAAC,IAAI;YACZ,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,eAAe,GAAG,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;YAErE,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;gBAC7B,OAAO,IAAI,CAAC;YACd,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,eAAe;gBACrB,GAAG,EAAE,IAAI;aACV,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { assetBaseUrlTransform } from "./asset-base-url-transform-plugin.js";
|
|
3
|
+
describe("assetBaseUrlTransform", () => {
|
|
4
|
+
const devServerOrigin = "http://localhost:3000";
|
|
5
|
+
it("should transform asset paths in single, double, and backtick quotes", () => {
|
|
6
|
+
const cases = [
|
|
7
|
+
{
|
|
8
|
+
desc: "single-quoted",
|
|
9
|
+
code: `const image = '/assets/logo.png';`,
|
|
10
|
+
expected: `const image = '${devServerOrigin}/assets/logo.png';`,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
desc: "double-quoted",
|
|
14
|
+
code: `const image = "/assets/logo.png";`,
|
|
15
|
+
expected: `const image = "${devServerOrigin}/assets/logo.png";`,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
desc: "backtick-quoted",
|
|
19
|
+
code: "const image = `/assets/logo.png`;",
|
|
20
|
+
expected: `const image = \`${devServerOrigin}/assets/logo.png\`;`,
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
for (const { code, expected } of cases) {
|
|
24
|
+
const result = assetBaseUrlTransform(code, devServerOrigin);
|
|
25
|
+
expect(result).toBe(expected);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
it("should transform multiple asset paths", () => {
|
|
29
|
+
const code = `
|
|
30
|
+
const logo = '/assets/logo.png';
|
|
31
|
+
const icon = '/assets/icon.svg';
|
|
32
|
+
const font = '/assets/font.woff2';
|
|
33
|
+
`;
|
|
34
|
+
const result = assetBaseUrlTransform(code, devServerOrigin);
|
|
35
|
+
expect(result).toContain(`${devServerOrigin}/assets/logo.png`);
|
|
36
|
+
expect(result).toContain(`${devServerOrigin}/assets/icon.svg`);
|
|
37
|
+
expect(result).toContain(`${devServerOrigin}/assets/font.woff2`);
|
|
38
|
+
});
|
|
39
|
+
it("should not transform already absolute URLs", () => {
|
|
40
|
+
const code = `
|
|
41
|
+
const local = '/assets/logo.png';
|
|
42
|
+
const http = 'http://example.com/image.png';
|
|
43
|
+
const https = 'https://example.com/image.png';
|
|
44
|
+
`;
|
|
45
|
+
const result = assetBaseUrlTransform(code, devServerOrigin);
|
|
46
|
+
expect(result).toContain(`${devServerOrigin}/assets/logo.png`);
|
|
47
|
+
expect(result).toContain("http://example.com/image.png");
|
|
48
|
+
expect(result).toContain("https://example.com/image.png");
|
|
49
|
+
});
|
|
50
|
+
it("should not transform code without asset paths", () => {
|
|
51
|
+
const code = `const text = "Hello World";`;
|
|
52
|
+
const result = assetBaseUrlTransform(code, devServerOrigin);
|
|
53
|
+
expect(result).toBe(code);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=asset-base-url-transform-plugin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-base-url-transform-plugin.test.js","sourceRoot":"","sources":["../../src/server/asset-base-url-transform-plugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,MAAM,eAAe,GAAG,uBAAuB,CAAC;IAEhD,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,KAAK,GAAG;YACZ;gBACE,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,mCAAmC;gBACzC,QAAQ,EAAE,kB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AAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,IAAI,GAAG,6BAA6B,CAAC;QAC3C,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAE5D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import type { McpServer } from "./server";
|
|
3
|
+
export declare function createServer({ server, customMiddleware, }: {
|
|
4
|
+
server: McpServer;
|
|
5
|
+
customMiddleware?: {
|
|
6
|
+
path?: string;
|
|
7
|
+
handlers: express.RequestHandler[];
|
|
8
|
+
}[];
|
|
9
|
+
}): Promise<express.Express>;
|