create-skybridge 0.0.0-dev.98f4db2 → 0.0.0-dev.98fae76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -22
- package/package.json +1 -1
- package/templates/blank/README.md +16 -15
- package/templates/blank/package.json +1 -1
- package/templates/demo/README.md +16 -15
- package/templates/demo/package.json +1 -1
- package/templates/demo/src/server.ts +23 -1
- package/templates/demo/src/views/components/steps/tool-output.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import * as prompts from "@clack/prompts";
|
|
5
5
|
import spawn from "cross-spawn";
|
|
6
6
|
import mri from "mri";
|
|
7
|
+
const OUTPUT_TAIL_LINES = 10;
|
|
7
8
|
const DEFAULT_PROJECT_NAME = "skybridge-project";
|
|
8
9
|
const PACKAGE_MANAGERS = ["bun", "deno", "npm", "pnpm", "yarn"];
|
|
9
10
|
const TEMPLATES = ["demo", "blank"];
|
|
@@ -19,7 +20,7 @@ Arguments:
|
|
|
19
20
|
Options:
|
|
20
21
|
--blank scaffold a minimal project without demo tools and views
|
|
21
22
|
--overwrite remove existing files if target directory is not empty
|
|
22
|
-
--pm <choice> package manager to use (choices: ${PACKAGE_MANAGERS.join(", ")}. default
|
|
23
|
+
--pm <choice> package manager to use (choices: ${PACKAGE_MANAGERS.join(", ")}. default to npm when none is provided or infered)
|
|
23
24
|
--skip-skills skip installing coding agent skills
|
|
24
25
|
--start start dev server
|
|
25
26
|
--yes skip prompts and use default values for unprovided options
|
|
@@ -174,6 +175,43 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
174
175
|
catch (error) {
|
|
175
176
|
abort("Failed to update project name in package.json.", String(error));
|
|
176
177
|
}
|
|
178
|
+
// Async spawn wrapper so a spinner can keep animating during the subprocess
|
|
179
|
+
// (cross-spawn.sync would block the event loop). Captures stdout/stderr to
|
|
180
|
+
// `output` when stdio is "pipe", trimmed to the last OUTPUT_TAIL_LINES lines
|
|
181
|
+
// — install errors land at the tail, so we keep that and prefix with an
|
|
182
|
+
// ellipsis when content gets dropped.
|
|
183
|
+
function spawnAsync(command, args) {
|
|
184
|
+
return new Promise((resolve) => {
|
|
185
|
+
let raw = "";
|
|
186
|
+
const child = spawn(command, args, {
|
|
187
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
188
|
+
cwd: root,
|
|
189
|
+
});
|
|
190
|
+
child.stdout?.on("data", (chunk) => {
|
|
191
|
+
raw += chunk.toString();
|
|
192
|
+
});
|
|
193
|
+
child.stderr?.on("data", (chunk) => {
|
|
194
|
+
raw += chunk.toString();
|
|
195
|
+
});
|
|
196
|
+
const done = (status) => {
|
|
197
|
+
const tail = [];
|
|
198
|
+
for (const part of raw.split("\n").reverse()) {
|
|
199
|
+
const line = part.trim();
|
|
200
|
+
if (!line) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (tail.length >= OUTPUT_TAIL_LINES) {
|
|
204
|
+
tail.push(`… (truncated, showing last ${OUTPUT_TAIL_LINES} lines)`);
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
tail.push(line);
|
|
208
|
+
}
|
|
209
|
+
resolve({ status, output: tail.reverse().join("\n") });
|
|
210
|
+
};
|
|
211
|
+
child.on("close", done);
|
|
212
|
+
child.on("error", () => done(1));
|
|
213
|
+
});
|
|
214
|
+
}
|
|
177
215
|
// 6. Skills install (single Y/n prompt)
|
|
178
216
|
let installSkills;
|
|
179
217
|
if (argv["skip-skills"]) {
|
|
@@ -194,7 +232,7 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
194
232
|
}
|
|
195
233
|
if (installSkills) {
|
|
196
234
|
Spinner.start("Installing coding agent skills");
|
|
197
|
-
const status = await spawnAsync("npx", [
|
|
235
|
+
const { status, output } = await spawnAsync("npx", [
|
|
198
236
|
"--yes",
|
|
199
237
|
"skills",
|
|
200
238
|
"add",
|
|
@@ -204,14 +242,17 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
204
242
|
"--agent",
|
|
205
243
|
"universal",
|
|
206
244
|
"claude-code",
|
|
245
|
+
"--copy", // something the symlink fails for some reason
|
|
207
246
|
"--yes",
|
|
208
|
-
]
|
|
209
|
-
|
|
210
|
-
|
|
247
|
+
]);
|
|
248
|
+
// skills cli always returns 0 so we look for the success message
|
|
249
|
+
if (status === 0 && output.includes("Done!")) {
|
|
250
|
+
Spinner.stop(`Installed coding agent skills`);
|
|
211
251
|
}
|
|
212
252
|
else {
|
|
213
|
-
Spinner.error(
|
|
214
|
-
|
|
253
|
+
Spinner.error(`Failed to install coding agent skills:
|
|
254
|
+
\x1b[2m${output}\x1b[0m`);
|
|
255
|
+
prompts.log.error("Try manually: `npx skills add alpic-ai/skybridge`.");
|
|
215
256
|
}
|
|
216
257
|
}
|
|
217
258
|
// 7. Package manager — autodetect, prompt only if detection fails (interactive)
|
|
@@ -231,15 +272,13 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
231
272
|
}
|
|
232
273
|
// 8. Always install dependencies
|
|
233
274
|
Spinner.start(`Installing dependencies with ${pm}`);
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
cwd: root,
|
|
237
|
-
});
|
|
238
|
-
if (installStatus === 0) {
|
|
275
|
+
const { status, output } = await spawnAsync(pm, ["install"]);
|
|
276
|
+
if (status === 0) {
|
|
239
277
|
Spinner.stop(`Installed dependencies with ${pm}`);
|
|
240
278
|
}
|
|
241
279
|
else {
|
|
242
|
-
Spinner.error(
|
|
280
|
+
Spinner.error(`Dependency installation failed:
|
|
281
|
+
\x1b[2m${output}\x1b[0m`);
|
|
243
282
|
abort(`Try manually: cd ${targetDir} && ${pm} install`);
|
|
244
283
|
}
|
|
245
284
|
// 9. Start dev server?
|
|
@@ -286,15 +325,6 @@ function abort(...lines) {
|
|
|
286
325
|
prompts.outro("Aborted");
|
|
287
326
|
process.exit(1);
|
|
288
327
|
}
|
|
289
|
-
// Async spawn wrapper used when we want a spinner to keep animating during
|
|
290
|
-
// the subprocess (cross-spawn.sync would block the event loop).
|
|
291
|
-
function spawnAsync(command, args, options) {
|
|
292
|
-
return new Promise((resolve) => {
|
|
293
|
-
const child = spawn(command, args, options);
|
|
294
|
-
child.on("close", (code) => resolve(code));
|
|
295
|
-
child.on("error", () => resolve(1));
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
328
|
function parsePackageManager(value) {
|
|
299
329
|
switch (value) {
|
|
300
330
|
case "bun":
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
# Skybridge
|
|
1
|
+
# Skybridge Boilerplate
|
|
2
2
|
|
|
3
|
-
A minimal TypeScript
|
|
3
|
+
A minimal TypeScript boilerplate for building MCP and ChatGPT Apps with the [Skybridge](https://docs.skybridge.tech) framework.
|
|
4
4
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
9
|
- Node.js 24+
|
|
10
|
-
- HTTP tunnel such as [Alpic tunnel](https://docs.alpic.ai/cli/tunnel) if you want to test with remote MCP hosts like ChatGPT or Claude.ai.
|
|
11
10
|
|
|
12
11
|
### Local Development
|
|
13
12
|
|
|
@@ -16,11 +15,13 @@ A minimal TypeScript template for building MCP and ChatGPT Apps with the [Skybri
|
|
|
16
15
|
```bash
|
|
17
16
|
npm install
|
|
18
17
|
# or
|
|
19
|
-
yarn install
|
|
20
|
-
# or
|
|
21
18
|
pnpm install
|
|
22
19
|
# or
|
|
23
20
|
bun install
|
|
21
|
+
# or
|
|
22
|
+
deno install
|
|
23
|
+
# or
|
|
24
|
+
yarn install
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
#### 2. Start your local server
|
|
@@ -30,16 +31,18 @@ Run the development server from the root directory:
|
|
|
30
31
|
```bash
|
|
31
32
|
npm run dev
|
|
32
33
|
# or
|
|
33
|
-
yarn dev
|
|
34
|
-
# or
|
|
35
34
|
pnpm dev
|
|
36
35
|
# or
|
|
37
36
|
bun dev
|
|
37
|
+
# or
|
|
38
|
+
deno task dev
|
|
39
|
+
# or
|
|
40
|
+
yarn dev
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
This command starts:
|
|
41
44
|
- Your MCP server at `http://localhost:3000/mcp`.
|
|
42
|
-
- Skybridge DevTools UI at `http://localhost:3000
|
|
45
|
+
- Skybridge DevTools UI at `http://localhost:3000`.
|
|
43
46
|
|
|
44
47
|
#### 3. Project structure
|
|
45
48
|
|
|
@@ -65,23 +68,21 @@ Edit and save components in `src/views/` — changes will appear instantly insid
|
|
|
65
68
|
|
|
66
69
|
#### 3. Edit server code
|
|
67
70
|
|
|
68
|
-
Modify files in `src/` and refresh the
|
|
71
|
+
Modify files in `src/` and refresh the tool list with your MCP Client to see the changes.
|
|
69
72
|
|
|
70
73
|
### Testing your App
|
|
71
74
|
|
|
72
|
-
You can test your
|
|
75
|
+
You can test your app locally by using our DevTools UI on `http://localhost:3000` while running the `dev` command.
|
|
73
76
|
|
|
74
|
-
To
|
|
77
|
+
To connect your app with web clients like ChatGPT or Claude, expose your server on the internet by adding the `--tunnel` flag.
|
|
78
|
+
By enabling the tunnel, you'll also be able to access a playground to chat with your app and a real LLM. Learn more by reading the [test guide](https://docs.skybridge.tech/quickstart/test-your-app).
|
|
75
79
|
|
|
76
80
|
|
|
77
81
|
## Deploy to Production
|
|
78
82
|
|
|
79
83
|
Skybridge is infrastructure vendor agnostic, and your app can be deployed on any cloud platform supporting MCP.
|
|
80
84
|
|
|
81
|
-
The simplest way to deploy your
|
|
82
|
-
1. Create an account on [Alpic platform](https://app.alpic.ai/).
|
|
83
|
-
2. Connect your GitHub repository to automatically deploy at each commit.
|
|
84
|
-
3. Use your remote App URL to connect it to MCP Clients, or use the Alpic Playground to easily test your App.
|
|
85
|
+
The simplest way to deploy your app is by running the `deploy` command, which will push your MCP server to the [Alpic](https://alpic.ai/) cloud for free.
|
|
85
86
|
|
|
86
87
|
## Resources
|
|
87
88
|
- [Skybridge Documentation](https://docs.skybridge.tech/)
|
package/templates/demo/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
# Skybridge
|
|
1
|
+
# Skybridge Template
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A starter TypeScript template for building MCP and ChatGPT Apps with the [Skybridge](https://docs.skybridge.tech) framework.
|
|
4
4
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
9
|
- Node.js 24+
|
|
10
|
-
- HTTP tunnel such as [Alpic tunnel](https://docs.alpic.ai/cli/tunnel) if you want to test with remote MCP hosts like ChatGPT or Claude.ai.
|
|
11
10
|
|
|
12
11
|
### Local Development
|
|
13
12
|
|
|
@@ -16,11 +15,13 @@ A minimal TypeScript template for building MCP and ChatGPT Apps with the [Skybri
|
|
|
16
15
|
```bash
|
|
17
16
|
npm install
|
|
18
17
|
# or
|
|
19
|
-
yarn install
|
|
20
|
-
# or
|
|
21
18
|
pnpm install
|
|
22
19
|
# or
|
|
23
20
|
bun install
|
|
21
|
+
# or
|
|
22
|
+
deno install
|
|
23
|
+
# or
|
|
24
|
+
yarn install
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
#### 2. Start your local server
|
|
@@ -30,16 +31,18 @@ Run the development server from the root directory:
|
|
|
30
31
|
```bash
|
|
31
32
|
npm run dev
|
|
32
33
|
# or
|
|
33
|
-
yarn dev
|
|
34
|
-
# or
|
|
35
34
|
pnpm dev
|
|
36
35
|
# or
|
|
37
36
|
bun dev
|
|
37
|
+
# or
|
|
38
|
+
deno task dev
|
|
39
|
+
# or
|
|
40
|
+
yarn dev
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
This command starts:
|
|
41
44
|
- Your MCP server at `http://localhost:3000/mcp`.
|
|
42
|
-
- Skybridge DevTools UI at `http://localhost:3000
|
|
45
|
+
- Skybridge DevTools UI at `http://localhost:3000`.
|
|
43
46
|
|
|
44
47
|
#### 3. Project structure
|
|
45
48
|
|
|
@@ -68,23 +71,21 @@ Edit and save components in `src/views/` — changes will appear instantly insid
|
|
|
68
71
|
|
|
69
72
|
#### 3. Edit server code
|
|
70
73
|
|
|
71
|
-
Modify files in `src/` and refresh the
|
|
74
|
+
Modify files in `src/` and refresh the tool list with your MCP Client to see the changes.
|
|
72
75
|
|
|
73
76
|
### Testing your App
|
|
74
77
|
|
|
75
|
-
You can test your
|
|
78
|
+
You can test your app locally by using our DevTools UI on `http://localhost:3000` while running the `dev` command.
|
|
76
79
|
|
|
77
|
-
To
|
|
80
|
+
To connect your app with web clients like ChatGPT or Claude, expose your server on the internet by adding the `--tunnel` flag.
|
|
81
|
+
By enabling the tunnel, you'll also be able to access a playground to chat with your app and a real LLM. Learn more by reading the [test guide](https://docs.skybridge.tech/quickstart/test-your-app).
|
|
78
82
|
|
|
79
83
|
|
|
80
84
|
## Deploy to Production
|
|
81
85
|
|
|
82
86
|
Skybridge is infrastructure vendor agnostic, and your app can be deployed on any cloud platform supporting MCP.
|
|
83
87
|
|
|
84
|
-
The simplest way to deploy your
|
|
85
|
-
1. Create an account on [Alpic platform](https://app.alpic.ai/).
|
|
86
|
-
2. Connect your GitHub repository to automatically deploy at each commit.
|
|
87
|
-
3. Use your remote App URL to connect it to MCP Clients, or use the Alpic Playground to easily test your App.
|
|
88
|
+
The simplest way to deploy your app is by running the `deploy` command, which will push your MCP server to the [Alpic](https://alpic.ai/) cloud for free.
|
|
88
89
|
|
|
89
90
|
## Resources
|
|
90
91
|
- [Skybridge Documentation](https://docs.skybridge.tech/)
|
|
@@ -15,8 +15,20 @@ const server = new McpServer(
|
|
|
15
15
|
inputSchema: {
|
|
16
16
|
name: z.string().optional().describe("The user name."),
|
|
17
17
|
},
|
|
18
|
+
annotations: {
|
|
19
|
+
title: "Start Skybridge onboarding",
|
|
20
|
+
readOnlyHint: true,
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
openWorldHint: false,
|
|
23
|
+
},
|
|
24
|
+
_meta: {
|
|
25
|
+
"openai/toolInvocation/invoking": "Starting the Skybridge onboarding…",
|
|
26
|
+
"openai/toolInvocation/invoked": "Onboarding ready.",
|
|
27
|
+
},
|
|
18
28
|
view: {
|
|
19
29
|
component: "onboarding",
|
|
30
|
+
// Replace with the URL your widget will be served from in production.
|
|
31
|
+
domain: "https://skybridge.tech",
|
|
20
32
|
description: "Onboarding deck",
|
|
21
33
|
csp: {
|
|
22
34
|
resourceDomains: [
|
|
@@ -30,7 +42,7 @@ const server = new McpServer(
|
|
|
30
42
|
async ({ name }) => {
|
|
31
43
|
return {
|
|
32
44
|
structuredContent: { name },
|
|
33
|
-
content: [{ type: "text", text: `User name: ${name}` }],
|
|
45
|
+
content: [{ type: "text", text: `User name: ${name ?? "friend"}` }],
|
|
34
46
|
isError: false,
|
|
35
47
|
};
|
|
36
48
|
},
|
|
@@ -39,6 +51,16 @@ const server = new McpServer(
|
|
|
39
51
|
{
|
|
40
52
|
name: "get-fortune-cookie",
|
|
41
53
|
description: "Get fortune cookie",
|
|
54
|
+
annotations: {
|
|
55
|
+
title: "Get a fortune cookie",
|
|
56
|
+
readOnlyHint: true,
|
|
57
|
+
destructiveHint: false,
|
|
58
|
+
openWorldHint: false,
|
|
59
|
+
},
|
|
60
|
+
_meta: {
|
|
61
|
+
"openai/toolInvocation/invoking": "Cracking open a fortune cookie…",
|
|
62
|
+
"openai/toolInvocation/invoked": "Fortune revealed.",
|
|
63
|
+
},
|
|
42
64
|
},
|
|
43
65
|
async () => {
|
|
44
66
|
const predictions = [
|
|
@@ -23,8 +23,8 @@ export default function ToolOutput() {
|
|
|
23
23
|
) : (
|
|
24
24
|
<p>
|
|
25
25
|
The view reads the <strong>tool output</strong>, but no{" "}
|
|
26
|
-
<code>name</code> was passed this time. Try again with
|
|
27
|
-
to see
|
|
26
|
+
<code>name</code> was passed this time. Try again with your surname
|
|
27
|
+
to see how this view personalizes.
|
|
28
28
|
</p>
|
|
29
29
|
)}
|
|
30
30
|
</div>
|