create-skybridge 0.0.0-dev.ecfdeac → 0.0.0-dev.ed005a8

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.
Files changed (98) hide show
  1. package/dist/index.js +151 -39
  2. package/package.json +4 -4
  3. package/templates/blank/Dockerfile +2 -2
  4. package/templates/blank/README.md +2 -1
  5. package/templates/blank/node_modules/.bin/alpic +2 -2
  6. package/templates/blank/node_modules/.bin/tsc +2 -2
  7. package/templates/blank/node_modules/.bin/tsserver +2 -2
  8. package/templates/blank/node_modules/.bin/tsx +2 -2
  9. package/templates/blank/node_modules/.bin/vite +2 -2
  10. package/templates/blank/package.json +10 -9
  11. package/templates/blank/src/index.ts +3 -0
  12. package/templates/blank/src/server.ts +7 -11
  13. package/templates/blank/vite.config.ts +7 -1
  14. package/templates/demo/Dockerfile +2 -2
  15. package/templates/demo/README.md +3 -1
  16. package/templates/demo/evals/start.eval.ts +11 -0
  17. package/templates/demo/node_modules/.bin/alpic +2 -2
  18. package/templates/demo/node_modules/.bin/tsc +2 -2
  19. package/templates/demo/node_modules/.bin/tsserver +2 -2
  20. package/templates/demo/node_modules/.bin/tsx +2 -2
  21. package/templates/demo/node_modules/.bin/vite +2 -2
  22. package/templates/demo/node_modules/.bin/vitest +21 -0
  23. package/templates/demo/package.json +25 -19
  24. package/templates/demo/src/index.ts +3 -0
  25. package/templates/demo/src/server.ts +86 -88
  26. package/templates/demo/src/views/onboarding.tsx +3 -3
  27. package/templates/demo/tsconfig.evals.json +11 -0
  28. package/templates/demo/vite.config.ts +9 -3
  29. package/templates/ecom/.dockerignore +4 -0
  30. package/templates/ecom/.env.template +7 -0
  31. package/templates/ecom/.ladle/components.tsx +26 -0
  32. package/templates/ecom/.ladle/config.mjs +11 -0
  33. package/templates/ecom/.ladle/vite.config.ts +11 -0
  34. package/templates/ecom/AGENTS.md +2 -0
  35. package/templates/ecom/Dockerfile +53 -0
  36. package/templates/ecom/README.md +93 -0
  37. package/templates/ecom/_gitignore +9 -0
  38. package/templates/ecom/alpic.json +3 -0
  39. package/templates/ecom/node_modules/.bin/alpic +21 -0
  40. package/templates/ecom/node_modules/.bin/ladle +21 -0
  41. package/templates/ecom/node_modules/.bin/sb +21 -0
  42. package/templates/ecom/node_modules/.bin/skybridge +21 -0
  43. package/templates/ecom/node_modules/.bin/tsc +21 -0
  44. package/templates/ecom/node_modules/.bin/tsserver +21 -0
  45. package/templates/ecom/node_modules/.bin/tsx +21 -0
  46. package/templates/ecom/node_modules/.bin/vite +21 -0
  47. package/templates/ecom/package.json +42 -0
  48. package/templates/ecom/src/catalog/index.ts +19 -0
  49. package/templates/ecom/src/catalog/mock.ts +134 -0
  50. package/templates/ecom/src/catalog/shopify.ts +264 -0
  51. package/templates/ecom/src/components/chip.css.ts +63 -0
  52. package/templates/ecom/src/components/chip.stories.tsx +27 -0
  53. package/templates/ecom/src/components/chip.tsx +49 -0
  54. package/templates/ecom/src/components/empty-state.stories.tsx +3 -0
  55. package/templates/ecom/src/components/empty-state.tsx +12 -0
  56. package/templates/ecom/src/components/expandable-text.css.ts +49 -0
  57. package/templates/ecom/src/components/expandable-text.stories.tsx +20 -0
  58. package/templates/ecom/src/components/expandable-text.tsx +53 -0
  59. package/templates/ecom/src/components/image-gallery.css.ts +172 -0
  60. package/templates/ecom/src/components/image-gallery.stories.tsx +30 -0
  61. package/templates/ecom/src/components/image-gallery.tsx +163 -0
  62. package/templates/ecom/src/components/product-card.css.ts +159 -0
  63. package/templates/ecom/src/components/product-card.stories.tsx +58 -0
  64. package/templates/ecom/src/components/product-card.tsx +102 -0
  65. package/templates/ecom/src/components/product-carousel.css.ts +134 -0
  66. package/templates/ecom/src/components/product-carousel.stories.tsx +64 -0
  67. package/templates/ecom/src/components/product-carousel.tsx +202 -0
  68. package/templates/ecom/src/components/variant-picker.css.ts +27 -0
  69. package/templates/ecom/src/components/variant-picker.stories.tsx +67 -0
  70. package/templates/ecom/src/components/variant-picker.tsx +70 -0
  71. package/templates/ecom/src/components/view-frame.css.ts +22 -0
  72. package/templates/ecom/src/components/view-frame.tsx +27 -0
  73. package/templates/ecom/src/config.ts +12 -0
  74. package/templates/ecom/src/design/contract.css.ts +39 -0
  75. package/templates/ecom/src/design/fonts.css +15 -0
  76. package/templates/ecom/src/design/primitives.css.ts +101 -0
  77. package/templates/ecom/src/design/recipes/typography.css.ts +75 -0
  78. package/templates/ecom/src/design/sprinkles.css.ts +128 -0
  79. package/templates/ecom/src/design/themes/dark.css.ts +36 -0
  80. package/templates/ecom/src/design/themes/light.css.ts +36 -0
  81. package/templates/ecom/src/design/tokens.ts +8 -0
  82. package/templates/ecom/src/helpers.ts +4 -0
  83. package/templates/ecom/src/i18n.ts +35 -0
  84. package/templates/ecom/src/index.css +9 -0
  85. package/templates/ecom/src/index.ts +3 -0
  86. package/templates/ecom/src/lib/cx.ts +9 -0
  87. package/templates/ecom/src/lib/format.ts +9 -0
  88. package/templates/ecom/src/lib/variants.ts +150 -0
  89. package/templates/ecom/src/server.ts +39 -0
  90. package/templates/ecom/src/tools/render-carousel.ts +161 -0
  91. package/templates/ecom/src/tools/search-products.ts +196 -0
  92. package/templates/ecom/src/types.ts +87 -0
  93. package/templates/ecom/src/views/carousel/detail/detail.css.ts +115 -0
  94. package/templates/ecom/src/views/carousel/detail/detail.stories.tsx +133 -0
  95. package/templates/ecom/src/views/carousel/detail/index.tsx +254 -0
  96. package/templates/ecom/src/views/carousel/index.tsx +233 -0
  97. package/templates/ecom/tsconfig.json +11 -0
  98. package/templates/ecom/vite.config.ts +8 -0
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,8 @@ 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";
11
13
  const pkg = JSON.parse(fs.readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf-8"));
12
14
  const version = pkg.version;
13
15
  const HELP_MESSAGE = `Usage: skybridge create [path] [options]
@@ -18,13 +20,15 @@ Arguments:
18
20
  path Where the project will be created. Prompted when omitted.
19
21
 
20
22
  Options:
21
- --blank scaffold a minimal project without demo tools and views
22
- --overwrite remove existing files if target directory is not empty
23
- --pm <choice> package manager to use (choices: ${PACKAGE_MANAGERS.join(", ")}. default to npm when none is provided or infered)
24
- --skip-skills skip installing coding agent skills
25
- --start start dev server
26
- --yes skip prompts and use default values for unprovided options
27
- --help display this help message
23
+ --blank scaffold a minimal project without demo tools and views
24
+ --ecom scaffold the ecommerce template (search products, render carousel)
25
+ --example <name> scaffold a copy of examples/<name> from the latest Skybridge release
26
+ --overwrite remove existing files if target directory is not empty
27
+ --pm <choice> package manager to use (choices: ${PACKAGE_MANAGERS.join(", ")}. default to npm when none is provided or infered)
28
+ --skip-skills skip installing coding agent skills
29
+ --start start dev server
30
+ --yes skip prompts and use default values for unprovided options
31
+ --help display this help message
28
32
 
29
33
  Non-interactive usage:
30
34
  Mandatory: path argument and --yes option
@@ -60,8 +64,16 @@ const Spinner = {
60
64
  };
61
65
  export async function init(args = process.argv.slice(2)) {
62
66
  const argv = mri(args, {
63
- boolean: ["help", "blank", "overwrite", "skip-skills", "start", "yes"],
64
- string: ["pm"],
67
+ boolean: [
68
+ "help",
69
+ "blank",
70
+ "ecom",
71
+ "overwrite",
72
+ "skip-skills",
73
+ "start",
74
+ "yes",
75
+ ],
76
+ string: ["pm", "example"],
65
77
  alias: { h: "help" },
66
78
  });
67
79
  if (argv.help) {
@@ -73,6 +85,13 @@ export async function init(args = process.argv.slice(2)) {
73
85
  if (yes && !targetDir) {
74
86
  abort("The target directory is required in non-interactive mode.", "Example: skybridge create my-app --yes");
75
87
  }
88
+ if (argv.example !== undefined && !/^[\w.-]+$/.test(argv.example)) {
89
+ abort("--example requires a name, e.g. --example auth-descope.");
90
+ }
91
+ if (argv.example && (argv.blank || argv.ecom)) {
92
+ abort("Cannot combine --example with --blank or --ecom.");
93
+ }
94
+ const example = argv.example;
76
95
  let pm = parsePackageManager(argv.pm || "");
77
96
  if (argv.pm && !pm) {
78
97
  abort(`Invalid --pm value "${argv.pm}". Expected one of: ${PACKAGE_MANAGERS.join(", ")}.`);
@@ -95,6 +114,18 @@ export async function init(args = process.argv.slice(2)) {
95
114
  targetDir = sanitizeTargetDir(choice);
96
115
  }
97
116
  // 2. Existing-directory handling
117
+ let downloaded;
118
+ if (example) {
119
+ Spinner.start(`Downloading ${example} example`);
120
+ try {
121
+ downloaded = await downloadExample(example);
122
+ Spinner.stop(`Downloaded ${example} example`);
123
+ }
124
+ catch (error) {
125
+ Spinner.error(`Failed to download ${example} example`);
126
+ abort(error instanceof Error ? error.message : String(error));
127
+ }
128
+ }
98
129
  if (fs.existsSync(targetDir) && !isEmpty(targetDir)) {
99
130
  if (argv.overwrite) {
100
131
  emptyDir(targetDir);
@@ -121,50 +152,71 @@ export async function init(args = process.argv.slice(2)) {
121
152
  if (argv.blank) {
122
153
  template = "blank";
123
154
  }
124
- else if (yes) {
125
- template = "demo";
155
+ if (argv.ecom) {
156
+ if (template) {
157
+ abort("Cannot specify both --blank and --ecom.");
158
+ }
159
+ template = "ecom";
126
160
  }
127
- else {
128
- const choice = await prompts.select({
129
- message: "Choose a template:",
130
- options: [
131
- {
132
- value: "demo",
133
- label: "demo",
134
- hint: "starter code with tools and UI",
135
- },
136
- {
137
- value: "blank",
138
- label: "blank",
139
- hint: "minimal boilerplate without tools",
140
- },
141
- ],
142
- initialValue: "demo",
143
- });
144
- if (prompts.isCancel(choice)) {
145
- return cancel();
161
+ if (!template && !example) {
162
+ if (yes) {
163
+ template = "demo";
164
+ }
165
+ else {
166
+ const choice = await prompts.select({
167
+ message: "Choose a template:",
168
+ options: [
169
+ {
170
+ value: "demo",
171
+ label: "demo",
172
+ hint: "starter code with tools and UI",
173
+ },
174
+ {
175
+ value: "blank",
176
+ label: "blank",
177
+ hint: "minimal boilerplate without tools",
178
+ },
179
+ {
180
+ value: "ecom",
181
+ label: "ecom",
182
+ hint: "ecommerce template with product search tool and carousel view",
183
+ },
184
+ ],
185
+ initialValue: "demo",
186
+ });
187
+ if (prompts.isCancel(choice)) {
188
+ return cancel();
189
+ }
190
+ template = choice;
146
191
  }
147
- template = choice;
148
192
  }
149
193
  // 4. Copy template
150
194
  const root = path.resolve(targetDir);
151
- Spinner.start(`Copying ${template} template`);
195
+ const templatesDir = fileURLToPath(new URL("../templates", import.meta.url));
196
+ const source = downloaded?.source ?? path.join(templatesDir, template ?? "demo");
197
+ Spinner.start(`Copying ${example ?? template} template`);
152
198
  try {
153
- const templateDir = fileURLToPath(new URL(`../templates/${template}`, import.meta.url));
154
- fs.cpSync(templateDir, root, {
199
+ fs.cpSync(source, root, {
155
200
  recursive: true,
156
201
  filter: (src) => [".npmrc"].every((file) => !src.endsWith(file)),
157
202
  });
203
+ const gitignore = path.join(root, ".gitignore");
158
204
  const gitignoreSource = path.join(root, "_gitignore");
159
205
  if (fs.existsSync(gitignoreSource)) {
160
- fs.renameSync(gitignoreSource, path.join(root, ".gitignore"));
206
+ fs.renameSync(gitignoreSource, gitignore);
161
207
  }
162
- Spinner.stop(`Copied ${template} template`);
208
+ else if (!fs.existsSync(gitignore)) {
209
+ fs.copyFileSync(path.join(templatesDir, "demo", "_gitignore"), gitignore);
210
+ }
211
+ Spinner.stop(`Copied ${example ?? template} template`);
163
212
  }
164
213
  catch (error) {
165
214
  Spinner.error("Failed to copy template");
166
215
  abort(String(error));
167
216
  }
217
+ finally {
218
+ downloaded?.cleanup();
219
+ }
168
220
  // 5. Set package.json name to the project dir basename
169
221
  try {
170
222
  const pkgPath = path.join(root, "package.json");
@@ -270,7 +322,11 @@ export async function init(args = process.argv.slice(2)) {
270
322
  }
271
323
  pm = choice;
272
324
  }
273
- // 8. Always install dependencies
325
+ // 8. pnpm ≥10 fails installs unless esbuild's build script is allow-listed
326
+ if (pm === "pnpm") {
327
+ fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), 'packages:\n - "."\nonlyBuiltDependencies:\n - esbuild\nallowBuilds:\n esbuild: true\n');
328
+ }
329
+ // 9. Always install dependencies
274
330
  Spinner.start(`Installing dependencies with ${pm}`);
275
331
  const { status, output } = await spawnAsync(pm, ["install"]);
276
332
  if (status === 0) {
@@ -281,7 +337,7 @@ export async function init(args = process.argv.slice(2)) {
281
337
  \x1b[2m${output}\x1b[0m`);
282
338
  abort(`Try manually: cd ${targetDir} && ${pm} install`);
283
339
  }
284
- // 9. Start dev server?
340
+ // 10. Start dev server?
285
341
  let start = false;
286
342
  if (argv.start) {
287
343
  start = true;
@@ -314,6 +370,62 @@ ${scriptCommand(pm, "deploy")}`);
314
370
  Chat: https://discord.alpic.ai
315
371
  Docs: https://docs.skybridge.tech`);
316
372
  }
373
+ async function fetchJson(url) {
374
+ const res = await fetch(url, {
375
+ headers: { accept: "application/vnd.github+json" },
376
+ });
377
+ if (!res.ok) {
378
+ throw new Error(`GitHub returned ${res.status} for ${url}.`);
379
+ }
380
+ return res.json();
381
+ }
382
+ async function downloadExample(name) {
383
+ const api = `https://api.github.com/repos/${REPO}`;
384
+ const { tag_name: tag } = await fetchJson(`${api}/releases/latest`);
385
+ const entries = await fetchJson(`${api}/contents/examples?ref=${tag}`);
386
+ const available = entries
387
+ .filter((entry) => entry.type === "dir")
388
+ .map((entry) => entry.name);
389
+ if (!available.includes(name)) {
390
+ throw new Error(`Unknown example "${name}". Available examples:\n ${available.join("\n ")}`);
391
+ }
392
+ const res = await fetch(`https://codeload.github.com/${REPO}/tar.gz/${tag}`);
393
+ if (!res.ok) {
394
+ throw new Error(`GitHub returned ${res.status} while fetching ${REPO}.`);
395
+ }
396
+ const archive = Buffer.from(await res.arrayBuffer());
397
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "skybridge-example-"));
398
+ const cleanup = () => fs.rmSync(tmp, { recursive: true, force: true });
399
+ try {
400
+ const tar = spawn("tar", ["-xz", "-C", tmp], {
401
+ stdio: ["pipe", "ignore", "pipe"],
402
+ });
403
+ let stderr = "";
404
+ tar.stderr?.on("data", (chunk) => {
405
+ stderr += chunk.toString();
406
+ });
407
+ const exit = new Promise((resolve, reject) => {
408
+ tar.on("error", (error) => reject(error.code === "ENOENT"
409
+ ? new Error("`tar` is required to extract the example.")
410
+ : error));
411
+ tar.on("close", (status) => status === 0
412
+ ? resolve()
413
+ : reject(new Error(`tar exited with ${status}: ${stderr.trim()}`)));
414
+ });
415
+ tar.stdin?.on("error", () => { });
416
+ tar.stdin?.end(archive);
417
+ await exit;
418
+ const [extracted] = fs.readdirSync(tmp);
419
+ if (!extracted) {
420
+ throw new Error("Downloaded archive is empty.");
421
+ }
422
+ return { source: path.join(tmp, extracted, "examples", name), cleanup };
423
+ }
424
+ catch (error) {
425
+ cleanup();
426
+ throw error;
427
+ }
428
+ }
317
429
  function cancel() {
318
430
  prompts.cancel("Operation cancelled");
319
431
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skybridge",
3
- "version": "0.0.0-dev.ecfdeac",
3
+ "version": "0.0.0-dev.ed005a8",
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.1.0",
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.2",
27
- "vitest": "^4.1.4"
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
 
@@ -48,7 +48,8 @@ This command starts:
48
48
 
49
49
  ```
50
50
  ├── src/
51
- │ ├── server.ts # Server entry point
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.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.21.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.21.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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,18 +12,19 @@
12
12
  "deploy": "alpic deploy"
13
13
  },
14
14
  "dependencies": {
15
- "@modelcontextprotocol/sdk": "^1.29.0",
16
- "skybridge": "^0.0.0-dev.ecfdeac",
17
- "vite": "^8.0.3"
15
+ "skybridge": "^0.0.0-dev.ed005a8",
16
+ "vite": "^8.1.5",
17
+ "zod": "^4.4.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@skybridge/devtools": "^1.1.0",
21
- "@types/node": "^24.12.0",
22
- "alpic": "^1.136.3",
23
- "tsx": "^4.21.0",
24
- "typescript": "^6.0.2"
20
+ "@skybridge/devtools": "^0.0.0-dev.ed005a8",
21
+ "@skybridge/vite-plugin": "^0.0.0-dev.ed005a8",
22
+ "@types/node": "^24.13.3",
23
+ "alpic": "^1.155.0",
24
+ "tsx": "^4.23.1",
25
+ "typescript": "^6.0.3"
25
26
  },
26
27
  "engines": {
27
- "node": ">=24.14.1"
28
+ "node": ">=24.18.0"
28
29
  }
29
30
  }
@@ -0,0 +1,3 @@
1
+ import { app } from "./server.js";
2
+
3
+ export default await app.run();
@@ -1,16 +1,12 @@
1
- import { McpServer } from "skybridge/server";
2
-
3
- const server = new McpServer(
4
- {
5
- name: "skybridge-blank",
6
- version: "0.0.1",
7
- },
8
- { capabilities: {} },
9
- );
1
+ import { Skybridge } from "skybridge/server";
10
2
 
11
3
  // Register tools with `server.registerTool(...)`.
12
4
  // Docs: https://docs.skybridge.tech/api-reference/register-tool
13
5
 
14
- export default await server.run();
6
+ export const app = new Skybridge({
7
+ name: "skybridge-blank",
8
+ version: "0.0.1",
9
+ handler: (server) => server,
10
+ });
15
11
 
16
- export type AppType = typeof server;
12
+ 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
 
@@ -48,11 +48,13 @@ This command starts:
48
48
 
49
49
  ```
50
50
  ├── src/
51
- │ ├── server.ts # Server entry point
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
55
56
  │ └── index.css # Global styles
57
+ ├── evals/ # Model-driven scenarios (pnpm evals, needs ANTHROPIC_API_KEY)
56
58
  ├── vite.config.ts
57
59
  ├── alpic.json # Deployment config
58
60
  └── package.json
@@ -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.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.136.3_@opentelemetry+api@1.9.1_arktype@2.1.27_rxjs@7.8.2_typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.2/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.21.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.21.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
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.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.0.3_@types+node@24.12.0_esbuild@0.27.2_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
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" "$@"