create-skybridge 0.0.0-next.da0352b → 0.0.0-next.da3047d
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 -26
- package/package.json +1 -1
- package/templates/blank/README.md +2 -1
- package/templates/blank/node_modules/.bin/alpic +2 -2
- package/templates/blank/node_modules/.bin/tsx +2 -2
- package/templates/blank/node_modules/.bin/vite +2 -2
- package/templates/blank/package.json +7 -7
- package/templates/blank/src/index.ts +3 -0
- package/templates/blank/src/server.ts +7 -11
- package/templates/blank/vite.config.ts +7 -1
- package/templates/demo/README.md +3 -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/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 +19 -13
- package/templates/demo/src/index.ts +3 -0
- package/templates/demo/src/server.ts +86 -88
- 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 +39 -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/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import mri from "mri";
|
|
|
7
7
|
const OUTPUT_TAIL_LINES = 10;
|
|
8
8
|
const DEFAULT_PROJECT_NAME = "skybridge-project";
|
|
9
9
|
const PACKAGE_MANAGERS = ["bun", "deno", "npm", "pnpm", "yarn"];
|
|
10
|
-
const TEMPLATES = ["demo", "blank"];
|
|
10
|
+
const TEMPLATES = ["demo", "blank", "ecom"];
|
|
11
11
|
const pkg = JSON.parse(fs.readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf-8"));
|
|
12
12
|
const version = pkg.version;
|
|
13
13
|
const HELP_MESSAGE = `Usage: skybridge create [path] [options]
|
|
@@ -19,6 +19,7 @@ Arguments:
|
|
|
19
19
|
|
|
20
20
|
Options:
|
|
21
21
|
--blank scaffold a minimal project without demo tools and views
|
|
22
|
+
--ecom scaffold the ecommerce template (search products, render carousel)
|
|
22
23
|
--overwrite remove existing files if target directory is not empty
|
|
23
24
|
--pm <choice> package manager to use (choices: ${PACKAGE_MANAGERS.join(", ")}. default to npm when none is provided or infered)
|
|
24
25
|
--skip-skills skip installing coding agent skills
|
|
@@ -60,7 +61,15 @@ const Spinner = {
|
|
|
60
61
|
};
|
|
61
62
|
export async function init(args = process.argv.slice(2)) {
|
|
62
63
|
const argv = mri(args, {
|
|
63
|
-
boolean: [
|
|
64
|
+
boolean: [
|
|
65
|
+
"help",
|
|
66
|
+
"blank",
|
|
67
|
+
"ecom",
|
|
68
|
+
"overwrite",
|
|
69
|
+
"skip-skills",
|
|
70
|
+
"start",
|
|
71
|
+
"yes",
|
|
72
|
+
],
|
|
64
73
|
string: ["pm"],
|
|
65
74
|
alias: { h: "help" },
|
|
66
75
|
});
|
|
@@ -121,30 +130,43 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
121
130
|
if (argv.blank) {
|
|
122
131
|
template = "blank";
|
|
123
132
|
}
|
|
124
|
-
|
|
125
|
-
template
|
|
133
|
+
if (argv.ecom) {
|
|
134
|
+
if (template) {
|
|
135
|
+
abort("Cannot specify both --blank and --ecom.");
|
|
136
|
+
}
|
|
137
|
+
template = "ecom";
|
|
126
138
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
if (!template) {
|
|
140
|
+
if (yes) {
|
|
141
|
+
template = "demo";
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
const choice = await prompts.select({
|
|
145
|
+
message: "Choose a template:",
|
|
146
|
+
options: [
|
|
147
|
+
{
|
|
148
|
+
value: "demo",
|
|
149
|
+
label: "demo",
|
|
150
|
+
hint: "starter code with tools and UI",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: "blank",
|
|
154
|
+
label: "blank",
|
|
155
|
+
hint: "minimal boilerplate without tools",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
value: "ecom",
|
|
159
|
+
label: "ecom",
|
|
160
|
+
hint: "ecommerce template with product search tool and carousel view",
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
initialValue: "demo",
|
|
164
|
+
});
|
|
165
|
+
if (prompts.isCancel(choice)) {
|
|
166
|
+
return cancel();
|
|
167
|
+
}
|
|
168
|
+
template = choice;
|
|
146
169
|
}
|
|
147
|
-
template = choice;
|
|
148
170
|
}
|
|
149
171
|
// 4. Copy template
|
|
150
172
|
const root = path.resolve(targetDir);
|
|
@@ -270,7 +292,11 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
270
292
|
}
|
|
271
293
|
pm = choice;
|
|
272
294
|
}
|
|
273
|
-
// 8.
|
|
295
|
+
// 8. pnpm ≥10 fails installs unless esbuild's build script is allow-listed
|
|
296
|
+
if (pm === "pnpm") {
|
|
297
|
+
fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), 'packages:\n - "."\nonlyBuiltDependencies:\n - esbuild\nallowBuilds:\n esbuild: true\n');
|
|
298
|
+
}
|
|
299
|
+
// 9. Always install dependencies
|
|
274
300
|
Spinner.start(`Installing dependencies with ${pm}`);
|
|
275
301
|
const { status, output } = await spawnAsync(pm, ["install"]);
|
|
276
302
|
if (status === 0) {
|
|
@@ -281,7 +307,7 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
281
307
|
\x1b[2m${output}\x1b[0m`);
|
|
282
308
|
abort(`Try manually: cd ${targetDir} && ${pm} install`);
|
|
283
309
|
}
|
|
284
|
-
//
|
|
310
|
+
// 10. Start dev server?
|
|
285
311
|
let start = false;
|
|
286
312
|
if (argv.start) {
|
|
287
313
|
start = true;
|
package/package.json
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
|
│ └── 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/tsx@4.23.
|
|
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.23.
|
|
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.1.
|
|
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.1.
|
|
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,15 +12,15 @@
|
|
|
12
12
|
"deploy": "alpic deploy"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"vite": "^8.1.3"
|
|
15
|
+
"skybridge": "^0.0.0-next.da3047d",
|
|
16
|
+
"vite": "^8.1.5"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
|
-
"@skybridge/devtools": "^
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"
|
|
19
|
+
"@skybridge/devtools": "^0.0.0-next.da3047d",
|
|
20
|
+
"@skybridge/vite-plugin": "^0.0.0-next.da3047d",
|
|
21
|
+
"@types/node": "^24.13.3",
|
|
22
|
+
"alpic": "^1.155.0",
|
|
23
|
+
"tsx": "^4.23.1",
|
|
24
24
|
"typescript": "^6.0.3"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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
|
|
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
|
});
|
package/templates/demo/README.md
CHANGED
|
@@ -48,11 +48,13 @@ 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
|
|
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.
|
|
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/tsx@4.23.
|
|
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.23.
|
|
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.1.
|
|
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.1.
|
|
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" "$@"
|
|
@@ -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/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/node_modules/vitest/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/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/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/node_modules/vitest/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/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/../vitest/vitest.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -9,31 +9,37 @@
|
|
|
9
9
|
"dev:tunnel": "skybridge dev --tunnel",
|
|
10
10
|
"build": "skybridge build",
|
|
11
11
|
"start": "skybridge start",
|
|
12
|
-
"deploy": "alpic deploy"
|
|
12
|
+
"deploy": "alpic deploy",
|
|
13
|
+
"evals": "vitest run evals",
|
|
14
|
+
"evals:types": "tsc --noEmit -p tsconfig.evals.json"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"@alpic-ai/ui": "^1.
|
|
16
|
-
"
|
|
17
|
-
"lucide-react": "^1.23.0",
|
|
17
|
+
"@alpic-ai/ui": "^1.155.0",
|
|
18
|
+
"lucide-react": "^1.25.0",
|
|
18
19
|
"react": "^19.2.7",
|
|
19
20
|
"react-dom": "^19.2.7",
|
|
20
|
-
"skybridge": "^0.0.0-next.
|
|
21
|
+
"skybridge": "^0.0.0-next.da3047d",
|
|
21
22
|
"sonner": "^2.0.7",
|
|
22
23
|
"tw-animate-css": "^1.4.0",
|
|
23
|
-
"vite": "^8.1.
|
|
24
|
+
"vite": "^8.1.5",
|
|
24
25
|
"zod": "^4.4.3"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
28
|
+
"@ai-sdk/anthropic": "^2.0.90",
|
|
29
|
+
"@skybridge/devtools": "^0.0.0-next.da3047d",
|
|
30
|
+
"@skybridge/test": "beta",
|
|
31
|
+
"@skybridge/vite-plugin": "^0.0.0-next.da3047d",
|
|
32
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
33
|
+
"@types/node": "^24.13.3",
|
|
30
34
|
"@types/react": "^19.2.17",
|
|
31
35
|
"@types/react-dom": "^19.2.3",
|
|
32
36
|
"@vitejs/plugin-react": "^6.0.3",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
+
"ai": "^5.0.0",
|
|
38
|
+
"alpic": "^1.155.0",
|
|
39
|
+
"tailwindcss": "^4.3.3",
|
|
40
|
+
"tsx": "^4.23.1",
|
|
41
|
+
"typescript": "^6.0.3",
|
|
42
|
+
"vitest": "^4.1.10"
|
|
37
43
|
},
|
|
38
44
|
"engines": {
|
|
39
45
|
"node": ">=24.18.0"
|
|
@@ -1,94 +1,92 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Skybridge } from "skybridge/server";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
4
|
+
export const app = new Skybridge({
|
|
5
|
+
name: "alpic-openai-app",
|
|
6
|
+
version: "0.0.1",
|
|
7
|
+
handler: (server) =>
|
|
8
|
+
server
|
|
9
|
+
.registerTool(
|
|
10
|
+
{
|
|
11
|
+
name: "start",
|
|
12
|
+
description: "Onboard Skybridge",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
name: z.string().optional().describe("The user name."),
|
|
15
|
+
},
|
|
16
|
+
annotations: {
|
|
17
|
+
title: "Start Skybridge onboarding",
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
destructiveHint: false,
|
|
20
|
+
openWorldHint: false,
|
|
21
|
+
},
|
|
22
|
+
_meta: {
|
|
23
|
+
"openai/toolInvocation/invoking":
|
|
24
|
+
"Starting the Skybridge onboarding…",
|
|
25
|
+
"openai/toolInvocation/invoked": "Onboarding ready.",
|
|
26
|
+
},
|
|
27
|
+
view: {
|
|
28
|
+
component: "onboarding",
|
|
29
|
+
// Replace with the URL your widget will be served from in production.
|
|
30
|
+
domain: "https://skybridge.tech",
|
|
31
|
+
description: "Onboarding deck",
|
|
32
|
+
csp: {
|
|
33
|
+
resourceDomains: [
|
|
34
|
+
"https://fonts.googleapis.com",
|
|
35
|
+
"https://fonts.gstatic.com",
|
|
36
|
+
],
|
|
37
|
+
redirectDomains: ["https://docs.skybridge.tech"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
39
40
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const prediction =
|
|
79
|
-
predictions[Math.floor(Math.random() * predictions.length)];
|
|
80
|
-
|
|
81
|
-
// simulate backend work
|
|
82
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
41
|
+
async ({ name }) => {
|
|
42
|
+
return {
|
|
43
|
+
structuredContent: { name },
|
|
44
|
+
content: [{ type: "text", text: `User name: ${name ?? "friend"}` }],
|
|
45
|
+
isError: false,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
.registerTool(
|
|
50
|
+
{
|
|
51
|
+
name: "get-fortune-cookie",
|
|
52
|
+
description: "Get fortune cookie",
|
|
53
|
+
annotations: {
|
|
54
|
+
title: "Get a fortune cookie",
|
|
55
|
+
readOnlyHint: true,
|
|
56
|
+
destructiveHint: false,
|
|
57
|
+
openWorldHint: false,
|
|
58
|
+
},
|
|
59
|
+
_meta: {
|
|
60
|
+
"openai/toolInvocation/invoking": "Cracking open a fortune cookie…",
|
|
61
|
+
"openai/toolInvocation/invoked": "Fortune revealed.",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
async () => {
|
|
65
|
+
const predictions = [
|
|
66
|
+
"A pleasant surprise is waiting for you.",
|
|
67
|
+
"Your hard work will soon pay off.",
|
|
68
|
+
"An unexpected friendship will brighten your week.",
|
|
69
|
+
"The best is yet to come.",
|
|
70
|
+
"A small step today leads to a giant leap tomorrow.",
|
|
71
|
+
"Trust your instincts: they are sharper than you think.",
|
|
72
|
+
"Adventure awaits just around the corner.",
|
|
73
|
+
"A long-forgotten idea will return with great success.",
|
|
74
|
+
"Kindness given today will be returned threefold.",
|
|
75
|
+
"Something you lost will soon be found.",
|
|
76
|
+
];
|
|
77
|
+
const prediction =
|
|
78
|
+
predictions[Math.floor(Math.random() * predictions.length)];
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
content: [{ type: "text", text: prediction }],
|
|
87
|
-
isError: false,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
);
|
|
80
|
+
// simulate backend work
|
|
81
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
91
82
|
|
|
92
|
-
|
|
83
|
+
return {
|
|
84
|
+
structuredContent: { prediction },
|
|
85
|
+
content: [{ type: "text", text: prediction }],
|
|
86
|
+
isError: false,
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
),
|
|
90
|
+
});
|
|
93
91
|
|
|
94
|
-
export type AppType = typeof
|
|
92
|
+
export type AppType = typeof app;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@/index.css";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useUser } from "skybridge/web";
|
|
5
5
|
import Nav from "./components/nav.js";
|
|
6
6
|
import Progress from "./components/progress.js";
|
|
7
7
|
import Outro from "./components/steps/outro.js";
|
|
@@ -18,8 +18,8 @@ const STEPS = [
|
|
|
18
18
|
] as const;
|
|
19
19
|
|
|
20
20
|
export default function Onboarding() {
|
|
21
|
-
//
|
|
22
|
-
const { theme } =
|
|
21
|
+
// useUser: read user environment info (theme, locale, user agent).
|
|
22
|
+
const { theme } = useUser();
|
|
23
23
|
|
|
24
24
|
const [step, setStep] = useState(0);
|
|
25
25
|
const { img } = useMascot();
|