create-skybridge 0.0.0-dev.b9f65be → 0.0.0-dev.b9f85b3
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 +143 -39
- package/package.json +4 -4
- package/templates/blank/Dockerfile +3 -3
- package/templates/blank/README.md +2 -1
- package/templates/blank/node_modules/.bin/alpic +2 -2
- package/templates/blank/node_modules/.bin/tsc +2 -2
- package/templates/blank/node_modules/.bin/tsserver +2 -2
- package/templates/blank/node_modules/.bin/tsx +21 -0
- package/templates/blank/node_modules/.bin/vite +2 -2
- package/templates/blank/package.json +9 -8
- package/templates/blank/src/index.ts +3 -0
- package/templates/blank/src/server.ts +10 -14
- package/templates/blank/vite.config.ts +7 -1
- package/templates/demo/Dockerfile +3 -3
- package/templates/demo/README.md +2 -1
- package/templates/demo/evals/start.eval.ts +11 -0
- package/templates/demo/node_modules/.bin/alpic +2 -2
- package/templates/demo/node_modules/.bin/tsc +2 -2
- package/templates/demo/node_modules/.bin/tsserver +2 -2
- package/templates/demo/node_modules/.bin/tsx +2 -2
- package/templates/demo/node_modules/.bin/vite +2 -2
- package/templates/demo/node_modules/.bin/vitest +21 -0
- package/templates/demo/package.json +25 -19
- package/templates/demo/src/index.ts +3 -0
- package/templates/demo/src/server.ts +87 -89
- package/templates/demo/src/views/onboarding.tsx +3 -3
- package/templates/demo/tsconfig.evals.json +11 -0
- package/templates/demo/vite.config.ts +9 -3
- package/templates/ecom/.dockerignore +4 -0
- package/templates/ecom/.env.template +7 -0
- package/templates/ecom/.ladle/components.tsx +26 -0
- package/templates/ecom/.ladle/config.mjs +11 -0
- package/templates/ecom/.ladle/vite.config.ts +11 -0
- package/templates/ecom/AGENTS.md +2 -0
- package/templates/ecom/Dockerfile +53 -0
- package/templates/ecom/README.md +93 -0
- package/templates/ecom/_gitignore +9 -0
- package/templates/ecom/alpic.json +3 -0
- package/templates/ecom/node_modules/.bin/alpic +21 -0
- package/templates/ecom/node_modules/.bin/ladle +21 -0
- package/templates/ecom/node_modules/.bin/sb +21 -0
- package/templates/ecom/node_modules/.bin/skybridge +21 -0
- package/templates/ecom/node_modules/.bin/tsc +21 -0
- package/templates/ecom/node_modules/.bin/tsserver +21 -0
- package/templates/ecom/node_modules/.bin/tsx +21 -0
- package/templates/ecom/node_modules/.bin/vite +21 -0
- package/templates/ecom/package.json +42 -0
- package/templates/ecom/src/catalog/index.ts +19 -0
- package/templates/ecom/src/catalog/mock.ts +134 -0
- package/templates/ecom/src/catalog/shopify.ts +264 -0
- package/templates/ecom/src/components/chip.css.ts +63 -0
- package/templates/ecom/src/components/chip.stories.tsx +27 -0
- package/templates/ecom/src/components/chip.tsx +49 -0
- package/templates/ecom/src/components/empty-state.stories.tsx +3 -0
- package/templates/ecom/src/components/empty-state.tsx +12 -0
- package/templates/ecom/src/components/expandable-text.css.ts +49 -0
- package/templates/ecom/src/components/expandable-text.stories.tsx +20 -0
- package/templates/ecom/src/components/expandable-text.tsx +53 -0
- package/templates/ecom/src/components/image-gallery.css.ts +172 -0
- package/templates/ecom/src/components/image-gallery.stories.tsx +30 -0
- package/templates/ecom/src/components/image-gallery.tsx +163 -0
- package/templates/ecom/src/components/product-card.css.ts +159 -0
- package/templates/ecom/src/components/product-card.stories.tsx +58 -0
- package/templates/ecom/src/components/product-card.tsx +102 -0
- package/templates/ecom/src/components/product-carousel.css.ts +134 -0
- package/templates/ecom/src/components/product-carousel.stories.tsx +64 -0
- package/templates/ecom/src/components/product-carousel.tsx +202 -0
- package/templates/ecom/src/components/variant-picker.css.ts +27 -0
- package/templates/ecom/src/components/variant-picker.stories.tsx +67 -0
- package/templates/ecom/src/components/variant-picker.tsx +70 -0
- package/templates/ecom/src/components/view-frame.css.ts +22 -0
- package/templates/ecom/src/components/view-frame.tsx +27 -0
- package/templates/ecom/src/config.ts +12 -0
- package/templates/ecom/src/design/contract.css.ts +39 -0
- package/templates/ecom/src/design/fonts.css +15 -0
- package/templates/ecom/src/design/primitives.css.ts +101 -0
- package/templates/ecom/src/design/recipes/typography.css.ts +75 -0
- package/templates/ecom/src/design/sprinkles.css.ts +128 -0
- package/templates/ecom/src/design/themes/dark.css.ts +36 -0
- package/templates/ecom/src/design/themes/light.css.ts +36 -0
- package/templates/ecom/src/design/tokens.ts +8 -0
- package/templates/ecom/src/helpers.ts +4 -0
- package/templates/ecom/src/i18n.ts +35 -0
- package/templates/ecom/src/index.css +9 -0
- package/templates/ecom/src/index.ts +3 -0
- package/templates/ecom/src/lib/cx.ts +9 -0
- package/templates/ecom/src/lib/format.ts +9 -0
- package/templates/ecom/src/lib/variants.ts +150 -0
- package/templates/ecom/src/server.ts +43 -0
- package/templates/ecom/src/tools/render-carousel.ts +161 -0
- package/templates/ecom/src/tools/search-products.ts +196 -0
- package/templates/ecom/src/types.ts +87 -0
- package/templates/ecom/src/views/carousel/detail/detail.css.ts +115 -0
- package/templates/ecom/src/views/carousel/detail/detail.stories.tsx +133 -0
- package/templates/ecom/src/views/carousel/detail/index.tsx +254 -0
- package/templates/ecom/src/views/carousel/index.tsx +233 -0
- package/templates/ecom/tsconfig.json +11 -0
- package/templates/ecom/vite.config.ts +8 -0
- package/templates/blank/src/vite-manifest.d.ts +0 -4
- package/templates/demo/src/vite-manifest.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
5
|
import * as prompts from "@clack/prompts";
|
|
@@ -7,7 +8,9 @@ import mri from "mri";
|
|
|
7
8
|
const OUTPUT_TAIL_LINES = 10;
|
|
8
9
|
const DEFAULT_PROJECT_NAME = "skybridge-project";
|
|
9
10
|
const PACKAGE_MANAGERS = ["bun", "deno", "npm", "pnpm", "yarn"];
|
|
10
|
-
const TEMPLATES = ["demo", "blank"];
|
|
11
|
+
const TEMPLATES = ["demo", "blank", "ecom"];
|
|
12
|
+
const REPO = "alpic-ai/skybridge";
|
|
13
|
+
const REPO_REF = "main";
|
|
11
14
|
const pkg = JSON.parse(fs.readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf-8"));
|
|
12
15
|
const version = pkg.version;
|
|
13
16
|
const HELP_MESSAGE = `Usage: skybridge create [path] [options]
|
|
@@ -18,13 +21,15 @@ Arguments:
|
|
|
18
21
|
path Where the project will be created. Prompted when omitted.
|
|
19
22
|
|
|
20
23
|
Options:
|
|
21
|
-
--blank
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--
|
|
24
|
+
--blank scaffold a minimal project without demo tools and views
|
|
25
|
+
--ecom scaffold the ecommerce template (search products, render carousel)
|
|
26
|
+
--example <name> scaffold a copy of github.com/${REPO}/tree/${REPO_REF}/examples/<name>
|
|
27
|
+
--overwrite remove existing files if target directory is not empty
|
|
28
|
+
--pm <choice> package manager to use (choices: ${PACKAGE_MANAGERS.join(", ")}. default to npm when none is provided or infered)
|
|
29
|
+
--skip-skills skip installing coding agent skills
|
|
30
|
+
--start start dev server
|
|
31
|
+
--yes skip prompts and use default values for unprovided options
|
|
32
|
+
--help display this help message
|
|
28
33
|
|
|
29
34
|
Non-interactive usage:
|
|
30
35
|
Mandatory: path argument and --yes option
|
|
@@ -60,8 +65,16 @@ const Spinner = {
|
|
|
60
65
|
};
|
|
61
66
|
export async function init(args = process.argv.slice(2)) {
|
|
62
67
|
const argv = mri(args, {
|
|
63
|
-
boolean: [
|
|
64
|
-
|
|
68
|
+
boolean: [
|
|
69
|
+
"help",
|
|
70
|
+
"blank",
|
|
71
|
+
"ecom",
|
|
72
|
+
"overwrite",
|
|
73
|
+
"skip-skills",
|
|
74
|
+
"start",
|
|
75
|
+
"yes",
|
|
76
|
+
],
|
|
77
|
+
string: ["pm", "example"],
|
|
65
78
|
alias: { h: "help" },
|
|
66
79
|
});
|
|
67
80
|
if (argv.help) {
|
|
@@ -73,6 +86,13 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
73
86
|
if (yes && !targetDir) {
|
|
74
87
|
abort("The target directory is required in non-interactive mode.", "Example: skybridge create my-app --yes");
|
|
75
88
|
}
|
|
89
|
+
if (argv.example !== undefined && !/^[\w.-]+$/.test(argv.example)) {
|
|
90
|
+
abort("--example requires a name, e.g. --example auth-descope.");
|
|
91
|
+
}
|
|
92
|
+
if (argv.example && (argv.blank || argv.ecom)) {
|
|
93
|
+
abort("Cannot combine --example with --blank or --ecom.");
|
|
94
|
+
}
|
|
95
|
+
const example = argv.example;
|
|
76
96
|
let pm = parsePackageManager(argv.pm || "");
|
|
77
97
|
if (argv.pm && !pm) {
|
|
78
98
|
abort(`Invalid --pm value "${argv.pm}". Expected one of: ${PACKAGE_MANAGERS.join(", ")}.`);
|
|
@@ -95,6 +115,18 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
95
115
|
targetDir = sanitizeTargetDir(choice);
|
|
96
116
|
}
|
|
97
117
|
// 2. Existing-directory handling
|
|
118
|
+
let downloaded;
|
|
119
|
+
if (example) {
|
|
120
|
+
Spinner.start(`Downloading ${example} example`);
|
|
121
|
+
try {
|
|
122
|
+
downloaded = await downloadExample(example);
|
|
123
|
+
Spinner.stop(`Downloaded ${example} example`);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
Spinner.error(`Failed to download ${example} example`);
|
|
127
|
+
abort(error instanceof Error ? error.message : String(error));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
98
130
|
if (fs.existsSync(targetDir) && !isEmpty(targetDir)) {
|
|
99
131
|
if (argv.overwrite) {
|
|
100
132
|
emptyDir(targetDir);
|
|
@@ -121,50 +153,71 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
121
153
|
if (argv.blank) {
|
|
122
154
|
template = "blank";
|
|
123
155
|
}
|
|
124
|
-
|
|
125
|
-
template
|
|
156
|
+
if (argv.ecom) {
|
|
157
|
+
if (template) {
|
|
158
|
+
abort("Cannot specify both --blank and --ecom.");
|
|
159
|
+
}
|
|
160
|
+
template = "ecom";
|
|
126
161
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
162
|
+
if (!template && !example) {
|
|
163
|
+
if (yes) {
|
|
164
|
+
template = "demo";
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
const choice = await prompts.select({
|
|
168
|
+
message: "Choose a template:",
|
|
169
|
+
options: [
|
|
170
|
+
{
|
|
171
|
+
value: "demo",
|
|
172
|
+
label: "demo",
|
|
173
|
+
hint: "starter code with tools and UI",
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
value: "blank",
|
|
177
|
+
label: "blank",
|
|
178
|
+
hint: "minimal boilerplate without tools",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
value: "ecom",
|
|
182
|
+
label: "ecom",
|
|
183
|
+
hint: "ecommerce template with product search tool and carousel view",
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
initialValue: "demo",
|
|
187
|
+
});
|
|
188
|
+
if (prompts.isCancel(choice)) {
|
|
189
|
+
return cancel();
|
|
190
|
+
}
|
|
191
|
+
template = choice;
|
|
146
192
|
}
|
|
147
|
-
template = choice;
|
|
148
193
|
}
|
|
149
194
|
// 4. Copy template
|
|
150
195
|
const root = path.resolve(targetDir);
|
|
151
|
-
|
|
196
|
+
const templatesDir = fileURLToPath(new URL("../templates", import.meta.url));
|
|
197
|
+
const source = downloaded?.source ?? path.join(templatesDir, template ?? "demo");
|
|
198
|
+
Spinner.start(`Copying ${example ?? template} template`);
|
|
152
199
|
try {
|
|
153
|
-
|
|
154
|
-
fs.cpSync(templateDir, root, {
|
|
200
|
+
fs.cpSync(source, root, {
|
|
155
201
|
recursive: true,
|
|
156
202
|
filter: (src) => [".npmrc"].every((file) => !src.endsWith(file)),
|
|
157
203
|
});
|
|
204
|
+
const gitignore = path.join(root, ".gitignore");
|
|
158
205
|
const gitignoreSource = path.join(root, "_gitignore");
|
|
159
206
|
if (fs.existsSync(gitignoreSource)) {
|
|
160
|
-
fs.renameSync(gitignoreSource,
|
|
207
|
+
fs.renameSync(gitignoreSource, gitignore);
|
|
208
|
+
}
|
|
209
|
+
else if (!fs.existsSync(gitignore)) {
|
|
210
|
+
fs.copyFileSync(path.join(templatesDir, "demo", "_gitignore"), gitignore);
|
|
161
211
|
}
|
|
162
|
-
Spinner.stop(`Copied ${template} template`);
|
|
212
|
+
Spinner.stop(`Copied ${example ?? template} template`);
|
|
163
213
|
}
|
|
164
214
|
catch (error) {
|
|
165
215
|
Spinner.error("Failed to copy template");
|
|
166
216
|
abort(String(error));
|
|
167
217
|
}
|
|
218
|
+
finally {
|
|
219
|
+
downloaded?.cleanup();
|
|
220
|
+
}
|
|
168
221
|
// 5. Set package.json name to the project dir basename
|
|
169
222
|
try {
|
|
170
223
|
const pkgPath = path.join(root, "package.json");
|
|
@@ -270,7 +323,11 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
270
323
|
}
|
|
271
324
|
pm = choice;
|
|
272
325
|
}
|
|
273
|
-
// 8.
|
|
326
|
+
// 8. pnpm ≥10 fails installs unless esbuild's build script is allow-listed
|
|
327
|
+
if (pm === "pnpm") {
|
|
328
|
+
fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), 'packages:\n - "."\nonlyBuiltDependencies:\n - esbuild\nallowBuilds:\n esbuild: true\n');
|
|
329
|
+
}
|
|
330
|
+
// 9. Always install dependencies
|
|
274
331
|
Spinner.start(`Installing dependencies with ${pm}`);
|
|
275
332
|
const { status, output } = await spawnAsync(pm, ["install"]);
|
|
276
333
|
if (status === 0) {
|
|
@@ -281,7 +338,7 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
281
338
|
\x1b[2m${output}\x1b[0m`);
|
|
282
339
|
abort(`Try manually: cd ${targetDir} && ${pm} install`);
|
|
283
340
|
}
|
|
284
|
-
//
|
|
341
|
+
// 10. Start dev server?
|
|
285
342
|
let start = false;
|
|
286
343
|
if (argv.start) {
|
|
287
344
|
start = true;
|
|
@@ -314,6 +371,53 @@ ${scriptCommand(pm, "deploy")}`);
|
|
|
314
371
|
Chat: https://discord.alpic.ai
|
|
315
372
|
Docs: https://docs.skybridge.tech`);
|
|
316
373
|
}
|
|
374
|
+
async function downloadExample(name) {
|
|
375
|
+
const res = await fetch(`https://codeload.github.com/${REPO}/tar.gz/${REPO_REF}`);
|
|
376
|
+
if (!res.ok) {
|
|
377
|
+
throw new Error(`GitHub returned ${res.status} while fetching ${REPO}.`);
|
|
378
|
+
}
|
|
379
|
+
const archive = Buffer.from(await res.arrayBuffer());
|
|
380
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "skybridge-example-"));
|
|
381
|
+
const cleanup = () => fs.rmSync(tmp, { recursive: true, force: true });
|
|
382
|
+
try {
|
|
383
|
+
const tar = spawn("tar", ["-xz", "-C", tmp], {
|
|
384
|
+
stdio: ["pipe", "ignore", "pipe"],
|
|
385
|
+
});
|
|
386
|
+
let stderr = "";
|
|
387
|
+
tar.stderr?.on("data", (chunk) => {
|
|
388
|
+
stderr += chunk.toString();
|
|
389
|
+
});
|
|
390
|
+
const exit = new Promise((resolve, reject) => {
|
|
391
|
+
tar.on("error", (error) => reject(error.code === "ENOENT"
|
|
392
|
+
? new Error("`tar` is required to extract the example.")
|
|
393
|
+
: error));
|
|
394
|
+
tar.on("close", (status) => status === 0
|
|
395
|
+
? resolve()
|
|
396
|
+
: reject(new Error(`tar exited with ${status}: ${stderr.trim()}`)));
|
|
397
|
+
});
|
|
398
|
+
tar.stdin?.on("error", () => { });
|
|
399
|
+
tar.stdin?.end(archive);
|
|
400
|
+
await exit;
|
|
401
|
+
const [extracted] = fs.readdirSync(tmp);
|
|
402
|
+
if (!extracted) {
|
|
403
|
+
throw new Error("Downloaded archive is empty.");
|
|
404
|
+
}
|
|
405
|
+
const examplesDir = path.join(tmp, extracted, "examples");
|
|
406
|
+
const available = fs
|
|
407
|
+
.readdirSync(examplesDir, { withFileTypes: true })
|
|
408
|
+
.filter((entry) => entry.isDirectory() &&
|
|
409
|
+
fs.existsSync(path.join(examplesDir, entry.name, "package.json")))
|
|
410
|
+
.map((entry) => entry.name);
|
|
411
|
+
if (!available.includes(name)) {
|
|
412
|
+
throw new Error(`Unknown example "${name}". Available examples:\n ${available.join("\n ")}`);
|
|
413
|
+
}
|
|
414
|
+
return { source: path.join(examplesDir, name), cleanup };
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
cleanup();
|
|
418
|
+
throw error;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
317
421
|
function cancel() {
|
|
318
422
|
prompts.cancel("Operation cancelled");
|
|
319
423
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.b9f85b3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alpic",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"templates"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@clack/prompts": "^1.
|
|
20
|
+
"@clack/prompts": "^1.7.0",
|
|
21
21
|
"cross-spawn": "^7.0.6",
|
|
22
22
|
"mri": "^1.2.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/cross-spawn": "^6.0.6",
|
|
26
|
-
"typescript": "^6.0.
|
|
27
|
-
"vitest": "^4.1.
|
|
26
|
+
"typescript": "^6.0.3",
|
|
27
|
+
"vitest": "^4.1.10"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# (For bun or deno, adapt the install/build/prune commands below.)
|
|
7
7
|
|
|
8
8
|
# Build stage: install deps, compile the app, then prune dev deps.
|
|
9
|
-
FROM node:24-slim AS build
|
|
9
|
+
FROM node:24.18.0-slim AS build
|
|
10
10
|
WORKDIR /app
|
|
11
11
|
|
|
12
12
|
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
|
|
@@ -35,7 +35,7 @@ RUN if [ -f package-lock.json ]; then \
|
|
|
35
35
|
fi
|
|
36
36
|
|
|
37
37
|
# Runtime stage: copy built artifacts and prod deps, run as non-root.
|
|
38
|
-
FROM node:24-slim AS runtime
|
|
38
|
+
FROM node:24.18.0-slim AS runtime
|
|
39
39
|
WORKDIR /app
|
|
40
40
|
ENV NODE_ENV=production
|
|
41
41
|
|
|
@@ -50,4 +50,4 @@ EXPOSE 3000
|
|
|
50
50
|
# Run the built server directly rather than via `npm start` / `skybridge start`.
|
|
51
51
|
# Each wrapper adds a process layer that can swallow SIGTERM, which makes
|
|
52
52
|
# graceful shutdowns time out on platforms like Cloud Run, Fly, and k8s.
|
|
53
|
-
CMD ["node", "dist/
|
|
53
|
+
CMD ["node", "dist/__entry.js"]
|
|
@@ -48,7 +48,8 @@ This command starts:
|
|
|
48
48
|
|
|
49
49
|
```
|
|
50
50
|
├── src/
|
|
51
|
-
│ ├──
|
|
51
|
+
│ ├── index.ts # Entry point (starts the app)
|
|
52
|
+
│ ├── server.ts # App definition (tools, views)
|
|
52
53
|
│ └── helpers.ts # Shared utilities
|
|
53
54
|
├── vite.config.ts
|
|
54
55
|
├── alpic.json # Deployment config
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../alpic/bin/run.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -12,17 +12,18 @@
|
|
|
12
12
|
"deploy": "alpic deploy"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"vite": "^8.0.3"
|
|
15
|
+
"skybridge": "^0.0.0-dev.b9f85b3",
|
|
16
|
+
"vite": "^8.1.5"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
|
-
"@skybridge/devtools": "^
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"
|
|
19
|
+
"@skybridge/devtools": "^0.0.0-dev.b9f85b3",
|
|
20
|
+
"@skybridge/vite-plugin": "^0.0.0-dev.b9f85b3",
|
|
21
|
+
"@types/node": "^24.13.3",
|
|
22
|
+
"alpic": "^1.155.0",
|
|
23
|
+
"tsx": "^4.23.1",
|
|
24
|
+
"typescript": "^6.0.3"
|
|
24
25
|
},
|
|
25
26
|
"engines": {
|
|
26
|
-
"node": ">=24.
|
|
27
|
+
"node": ">=24.18.0"
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Skybridge, type SkybridgeServer } from "skybridge/server";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Register tools with `server.registerTool(...)`.
|
|
4
|
+
// Docs: https://docs.skybridge.tech/api-reference/register-tool
|
|
5
|
+
|
|
6
|
+
export const serverFactory = (server: SkybridgeServer) => server;
|
|
7
|
+
|
|
8
|
+
export const app = new Skybridge(
|
|
4
9
|
{
|
|
5
10
|
name: "skybridge-blank",
|
|
6
11
|
version: "0.0.1",
|
|
12
|
+
capabilities: {},
|
|
7
13
|
},
|
|
8
|
-
|
|
14
|
+
serverFactory,
|
|
9
15
|
);
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
// Docs: https://docs.skybridge.tech/api-reference/register-tool
|
|
13
|
-
|
|
14
|
-
if (process.env.NODE_ENV === "production") {
|
|
15
|
-
const { default: manifest } = await import("./vite-manifest.js");
|
|
16
|
-
server.setViteManifest(manifest);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default await server.run();
|
|
20
|
-
|
|
21
|
-
export type AppType = typeof server;
|
|
17
|
+
export type AppType = typeof app;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { skybridge } from "skybridge/vite";
|
|
1
|
+
import { skybridge } from "@skybridge/vite-plugin";
|
|
2
2
|
import { defineConfig } from "vite";
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
plugins: [skybridge()],
|
|
6
|
+
server: {
|
|
7
|
+
forwardConsole: {
|
|
8
|
+
unhandledErrors: true,
|
|
9
|
+
logLevels: ["error"],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
6
12
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# (For bun or deno, adapt the install/build/prune commands below.)
|
|
7
7
|
|
|
8
8
|
# Build stage: install deps, compile the app, then prune dev deps.
|
|
9
|
-
FROM node:24-slim AS build
|
|
9
|
+
FROM node:24.18.0-slim AS build
|
|
10
10
|
WORKDIR /app
|
|
11
11
|
|
|
12
12
|
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
|
|
@@ -35,7 +35,7 @@ RUN if [ -f package-lock.json ]; then \
|
|
|
35
35
|
fi
|
|
36
36
|
|
|
37
37
|
# Runtime stage: copy built artifacts and prod deps, run as non-root.
|
|
38
|
-
FROM node:24-slim AS runtime
|
|
38
|
+
FROM node:24.18.0-slim AS runtime
|
|
39
39
|
WORKDIR /app
|
|
40
40
|
ENV NODE_ENV=production
|
|
41
41
|
|
|
@@ -50,4 +50,4 @@ EXPOSE 3000
|
|
|
50
50
|
# Run the built server directly rather than via `npm start` / `skybridge start`.
|
|
51
51
|
# Each wrapper adds a process layer that can swallow SIGTERM, which makes
|
|
52
52
|
# graceful shutdowns time out on platforms like Cloud Run, Fly, and k8s.
|
|
53
|
-
CMD ["node", "dist/
|
|
53
|
+
CMD ["node", "dist/__entry.js"]
|
package/templates/demo/README.md
CHANGED
|
@@ -48,7 +48,8 @@ This command starts:
|
|
|
48
48
|
|
|
49
49
|
```
|
|
50
50
|
├── src/
|
|
51
|
-
│ ├──
|
|
51
|
+
│ ├── index.ts # Entry point (starts the app)
|
|
52
|
+
│ ├── server.ts # App definition (tools, views)
|
|
52
53
|
│ ├── views/ # React components (one per view)
|
|
53
54
|
│ ├── components/ # Shared UI components
|
|
54
55
|
│ ├── helpers.ts # Shared utilities
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
2
|
+
import { start } from "@skybridge/test";
|
|
3
|
+
import { expect, it } from "vitest";
|
|
4
|
+
import { app } from "../src/server.js";
|
|
5
|
+
|
|
6
|
+
it("reaches the onboarding tool from a natural prompt", async () => {
|
|
7
|
+
const chat = await start({ app, model: anthropic("claude-sonnet-4-5") });
|
|
8
|
+
await chat.send("Get me started with Skybridge, my name is Ada");
|
|
9
|
+
|
|
10
|
+
expect.chat(chat).toHaveCalledToolOnce("start");
|
|
11
|
+
});
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.157.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_8f13b9696a5fc8688953a3b2ccd28385/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../alpic/bin/run.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|