create-skybridge 0.0.0-dev.356dbec → 0.0.0-dev.35a7b38
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 +353 -157
- package/package.json +9 -7
- package/templates/blank/.dockerignore +4 -0
- package/templates/blank/AGENTS.md +1 -0
- package/templates/blank/Dockerfile +53 -0
- package/templates/blank/README.md +92 -0
- package/templates/blank/_gitignore +7 -0
- package/templates/blank/alpic.json +3 -0
- package/templates/blank/node_modules/.bin/alpic +21 -0
- package/templates/blank/node_modules/.bin/sb +21 -0
- package/templates/blank/node_modules/.bin/skybridge +21 -0
- package/templates/blank/node_modules/.bin/tsc +21 -0
- package/templates/blank/node_modules/.bin/tsserver +21 -0
- package/templates/blank/node_modules/.bin/tsx +21 -0
- package/templates/blank/node_modules/.bin/vite +21 -0
- package/templates/blank/package.json +29 -0
- package/templates/blank/src/helpers.ts +4 -0
- package/templates/blank/src/server.ts +16 -0
- package/templates/blank/tsconfig.json +5 -0
- package/templates/blank/vite.config.ts +6 -0
- package/templates/demo/.dockerignore +4 -0
- package/templates/demo/AGENTS.md +1 -0
- package/templates/demo/Dockerfile +53 -0
- package/templates/demo/README.md +95 -0
- package/templates/demo/_gitignore +7 -0
- package/templates/demo/alpic.json +3 -0
- package/templates/demo/node_modules/.bin/alpic +21 -0
- package/templates/demo/node_modules/.bin/sb +21 -0
- package/templates/demo/node_modules/.bin/skybridge +21 -0
- package/templates/demo/node_modules/.bin/tsc +21 -0
- package/templates/demo/node_modules/.bin/tsserver +21 -0
- package/templates/demo/node_modules/.bin/tsx +21 -0
- package/templates/demo/node_modules/.bin/vite +21 -0
- package/templates/demo/package.json +41 -0
- package/templates/demo/src/helpers.ts +4 -0
- package/templates/demo/src/index.css +59 -0
- package/templates/demo/src/server.ts +94 -0
- package/templates/demo/src/views/components/doc-link.tsx +22 -0
- package/templates/demo/src/views/components/doc.tsx +21 -0
- package/templates/demo/src/views/components/nav.tsx +31 -0
- package/templates/demo/src/views/components/progress.tsx +35 -0
- package/templates/demo/src/views/components/steps/outro.tsx +68 -0
- package/templates/demo/src/views/components/steps/state.tsx +47 -0
- package/templates/demo/src/views/components/steps/tool-call.tsx +53 -0
- package/templates/demo/src/views/components/steps/tool-output.tsx +40 -0
- package/templates/demo/src/views/images/mascot/beret.png +0 -0
- package/templates/demo/src/views/images/mascot/chapka.png +0 -0
- package/templates/demo/src/views/images/mascot/cowboy-hat.png +0 -0
- package/templates/demo/src/views/images/mascot/fez.png +0 -0
- package/templates/demo/src/views/images/mascot/jester-hat.png +0 -0
- package/templates/demo/src/views/images/mascot/mitre.png +0 -0
- package/templates/demo/src/views/images/mascot/non-la.png +0 -0
- package/templates/demo/src/views/images/mascot/original.png +0 -0
- package/templates/demo/src/views/images/mascot/propeller-beanie.png +0 -0
- package/templates/demo/src/views/images/mascot/ski-mask.png +0 -0
- package/templates/demo/src/views/images/mascot/sombrero.png +0 -0
- package/templates/demo/src/views/images/mascot/top-hat.png +0 -0
- package/templates/demo/src/views/images/mascot/viking-helmet.png +0 -0
- package/templates/demo/src/views/onboarding.tsx +63 -0
- package/templates/demo/src/views/use-mascot.ts +60 -0
- package/templates/demo/tsconfig.json +11 -0
- package/{template/web → templates/demo}/vite.config.ts +3 -4
- package/templates/ecom/.dockerignore +4 -0
- package/templates/ecom/.env.template +2 -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 +92 -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 +41 -0
- package/templates/ecom/src/components/chip.css.ts +56 -0
- package/templates/ecom/src/components/chip.stories.tsx +26 -0
- package/templates/ecom/src/components/chip.tsx +41 -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 +162 -0
- package/templates/ecom/src/components/product-card.css.ts +155 -0
- package/templates/ecom/src/components/product-card.stories.tsx +58 -0
- package/templates/ecom/src/components/product-card.tsx +101 -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 +64 -0
- package/templates/ecom/src/components/variant-picker.tsx +82 -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 +34 -0
- package/templates/ecom/src/index.css +9 -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 +79 -0
- package/templates/ecom/src/server.ts +43 -0
- package/templates/ecom/src/tools/render-carousel.ts +242 -0
- package/templates/ecom/src/tools/search-products.ts +182 -0
- package/templates/ecom/src/types.ts +13 -0
- package/templates/ecom/src/views/carousel/detail/detail.css.ts +100 -0
- package/templates/ecom/src/views/carousel/detail/detail.stories.tsx +114 -0
- package/templates/ecom/src/views/carousel/detail/index.tsx +215 -0
- package/templates/ecom/src/views/carousel/index.tsx +234 -0
- package/templates/ecom/tsconfig.json +11 -0
- package/templates/ecom/vite.config.ts +8 -0
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -23
- package/template/README.md +0 -77
- package/template/_gitignore +0 -4
- package/template/alpic.json +0 -4
- package/template/node_modules/.bin/mcp-inspector +0 -21
- package/template/node_modules/.bin/nodemon +0 -21
- package/template/node_modules/.bin/shx +0 -21
- package/template/node_modules/.bin/tsc +0 -21
- package/template/node_modules/.bin/tsserver +0 -21
- package/template/node_modules/.bin/tsx +0 -21
- package/template/node_modules/.bin/vite +0 -21
- package/template/nodemon.json +0 -5
- package/template/package.json +0 -42
- package/template/server/src/index.ts +0 -39
- package/template/server/src/middleware.ts +0 -54
- package/template/server/src/server.ts +0 -61
- package/template/tsconfig.json +0 -23
- package/template/tsconfig.server.json +0 -11
- package/template/web/src/helpers.ts +0 -4
- package/template/web/src/index.css +0 -31
- package/template/web/src/widgets/magic-8-ball.tsx +0 -24
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useViewState } from "skybridge/web";
|
|
3
|
+
import beret from "./images/mascot/beret.png";
|
|
4
|
+
import chapka from "./images/mascot/chapka.png";
|
|
5
|
+
import cowboyHat from "./images/mascot/cowboy-hat.png";
|
|
6
|
+
import fez from "./images/mascot/fez.png";
|
|
7
|
+
import jesterHat from "./images/mascot/jester-hat.png";
|
|
8
|
+
import mitre from "./images/mascot/mitre.png";
|
|
9
|
+
import nonLa from "./images/mascot/non-la.png";
|
|
10
|
+
import original from "./images/mascot/original.png";
|
|
11
|
+
import propellerBeanie from "./images/mascot/propeller-beanie.png";
|
|
12
|
+
import skiMask from "./images/mascot/ski-mask.png";
|
|
13
|
+
import sombrero from "./images/mascot/sombrero.png";
|
|
14
|
+
import topHat from "./images/mascot/top-hat.png";
|
|
15
|
+
import vikingHelmet from "./images/mascot/viking-helmet.png";
|
|
16
|
+
|
|
17
|
+
const Hats = {
|
|
18
|
+
beret,
|
|
19
|
+
chapka,
|
|
20
|
+
"cowboy hat": cowboyHat,
|
|
21
|
+
fez,
|
|
22
|
+
"jester hat": jesterHat,
|
|
23
|
+
mitre,
|
|
24
|
+
"nón lá": nonLa,
|
|
25
|
+
"propeller beanie": propellerBeanie,
|
|
26
|
+
"ski mask": skiMask,
|
|
27
|
+
sombrero,
|
|
28
|
+
"top hat": topHat,
|
|
29
|
+
"viking helmet": vikingHelmet,
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
type HatLabel = keyof typeof Hats;
|
|
33
|
+
|
|
34
|
+
const LABELS = Object.keys(Hats) as HatLabel[];
|
|
35
|
+
|
|
36
|
+
export function useMascot() {
|
|
37
|
+
// useViewState: persist UI state on the host and surface it to the model.
|
|
38
|
+
const [state, setState] = useViewState<{ hat?: HatLabel }>({});
|
|
39
|
+
const { hat } = state;
|
|
40
|
+
const img = hat ? Hats[hat] : original;
|
|
41
|
+
|
|
42
|
+
// Preload all hats once so swaps are instant.
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
for (const src of Object.values(Hats)) {
|
|
45
|
+
new Image().src = src;
|
|
46
|
+
}
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
img,
|
|
51
|
+
hat,
|
|
52
|
+
changeHat: () => {
|
|
53
|
+
setState((prev) => {
|
|
54
|
+
const currentIndex = prev.hat ? LABELS.indexOf(prev.hat) : -1;
|
|
55
|
+
const next = LABELS[(currentIndex + 1) % LABELS.length];
|
|
56
|
+
return { ...prev, hat: next };
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
2
3
|
import react from "@vitejs/plugin-react";
|
|
3
|
-
import { skybridge } from "skybridge/
|
|
4
|
+
import { skybridge } from "skybridge/vite";
|
|
4
5
|
import { defineConfig } from "vite";
|
|
5
6
|
|
|
6
|
-
// https://vite.dev/config/
|
|
7
7
|
export default defineConfig({
|
|
8
|
-
plugins: [skybridge(), react()],
|
|
9
|
-
root: __dirname,
|
|
8
|
+
plugins: [skybridge(), react(), tailwindcss()],
|
|
10
9
|
resolve: {
|
|
11
10
|
alias: {
|
|
12
11
|
"@": path.resolve(__dirname, "./src"),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GlobalProvider } from "@ladle/react";
|
|
2
|
+
import "../src/index.css";
|
|
3
|
+
import { viewFrame } from "../src/components/view-frame.css";
|
|
4
|
+
import { darkTheme, lightTheme } from "../src/design/tokens";
|
|
5
|
+
import { cx } from "../src/lib/cx";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Ladle's built-in theme toggle (sun/moon in the toolbar) drives
|
|
9
|
+
* globalState.theme. We reuse it to flip the widget's own palette, so the
|
|
10
|
+
* preview theme and the widget theme always match. The Provider applies the
|
|
11
|
+
* real ViewFrame surface (viewFrame + theme class), and index.css loads the
|
|
12
|
+
* brand @font-face rules, so stories preview against the actual frame.
|
|
13
|
+
*/
|
|
14
|
+
export const Provider: GlobalProvider = ({ children, globalState }) => {
|
|
15
|
+
const themeClass = globalState.theme === "dark" ? darkTheme : lightTheme;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className={cx(viewFrame, themeClass)}
|
|
20
|
+
data-theme={globalState.theme}
|
|
21
|
+
style={{ minHeight: "100vh", padding: 32 }}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Ladle-only vite config. Intentionally omits the Skybridge plugin (which
|
|
6
|
+
* transforms MCP view boilerplate and crashes Ladle's bundler) and the
|
|
7
|
+
* @vitejs/plugin-react call (Ladle provides its own).
|
|
8
|
+
*/
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
plugins: [vanillaExtractPlugin()],
|
|
11
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
|
|
3
|
+
# Dockerfile for a Skybridge MCP server.
|
|
4
|
+
#
|
|
5
|
+
# Detects npm, yarn, or pnpm from the lockfile in your project.
|
|
6
|
+
# (For bun or deno, adapt the install/build/prune commands below.)
|
|
7
|
+
|
|
8
|
+
# Build stage: install deps, compile the app, then prune dev deps.
|
|
9
|
+
FROM node:24.18.0-slim AS build
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
|
|
12
|
+
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
|
|
13
|
+
RUN --mount=type=cache,target=/root/.npm \
|
|
14
|
+
--mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
15
|
+
--mount=type=cache,target=/root/.local/share/pnpm/store \
|
|
16
|
+
if [ -f package-lock.json ]; then \
|
|
17
|
+
npm ci; \
|
|
18
|
+
elif [ -f yarn.lock ]; then \
|
|
19
|
+
corepack enable yarn && yarn install --frozen-lockfile; \
|
|
20
|
+
elif [ -f pnpm-lock.yaml ]; then \
|
|
21
|
+
corepack enable pnpm && pnpm install --frozen-lockfile; \
|
|
22
|
+
else \
|
|
23
|
+
echo "No lockfile found." && exit 1; \
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
ENV NODE_ENV=production
|
|
27
|
+
|
|
28
|
+
COPY . .
|
|
29
|
+
RUN if [ -f package-lock.json ]; then \
|
|
30
|
+
npm run build && npm prune --omit=dev; \
|
|
31
|
+
elif [ -f yarn.lock ]; then \
|
|
32
|
+
corepack enable yarn && yarn build && yarn install --frozen-lockfile --production=true; \
|
|
33
|
+
elif [ -f pnpm-lock.yaml ]; then \
|
|
34
|
+
corepack enable pnpm && pnpm build && pnpm prune --prod; \
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Runtime stage: copy built artifacts and prod deps, run as non-root.
|
|
38
|
+
FROM node:24.18.0-slim AS runtime
|
|
39
|
+
WORKDIR /app
|
|
40
|
+
ENV NODE_ENV=production
|
|
41
|
+
|
|
42
|
+
USER node
|
|
43
|
+
|
|
44
|
+
COPY --from=build --chown=node:node /app/node_modules ./node_modules
|
|
45
|
+
COPY --from=build --chown=node:node /app/dist ./dist
|
|
46
|
+
COPY --from=build --chown=node:node /app/package.json ./package.json
|
|
47
|
+
|
|
48
|
+
EXPOSE 3000
|
|
49
|
+
|
|
50
|
+
# Run the built server directly rather than via `npm start` / `skybridge start`.
|
|
51
|
+
# Each wrapper adds a process layer that can swallow SIGTERM, which makes
|
|
52
|
+
# graceful shutdowns time out on platforms like Cloud Run, Fly, and k8s.
|
|
53
|
+
CMD ["node", "dist/__entry.js"]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Skybridge Boilerplate
|
|
2
|
+
|
|
3
|
+
A minimal TypeScript boilerplate for building MCP and ChatGPT Apps with the [Skybridge](https://docs.skybridge.tech) framework.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js 24+
|
|
10
|
+
|
|
11
|
+
### Local Development
|
|
12
|
+
|
|
13
|
+
#### 1. Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install
|
|
17
|
+
# or
|
|
18
|
+
pnpm install
|
|
19
|
+
# or
|
|
20
|
+
bun install
|
|
21
|
+
# or
|
|
22
|
+
deno install
|
|
23
|
+
# or
|
|
24
|
+
yarn install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### 2. Start your local server
|
|
28
|
+
|
|
29
|
+
Run the development server from the root directory:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run dev
|
|
33
|
+
# or
|
|
34
|
+
pnpm dev
|
|
35
|
+
# or
|
|
36
|
+
bun dev
|
|
37
|
+
# or
|
|
38
|
+
deno task dev
|
|
39
|
+
# or
|
|
40
|
+
yarn dev
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This command starts:
|
|
44
|
+
- Your MCP server at `http://localhost:3000/mcp`.
|
|
45
|
+
- Skybridge DevTools UI at `http://localhost:3000`.
|
|
46
|
+
|
|
47
|
+
#### 3. Project structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
├── src/
|
|
51
|
+
│ ├── server.ts # Server entry point
|
|
52
|
+
│ └── helpers.ts # Shared utilities
|
|
53
|
+
├── vite.config.ts
|
|
54
|
+
├── alpic.json # Deployment config
|
|
55
|
+
└── package.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Create your first view
|
|
59
|
+
|
|
60
|
+
#### 1. Add a new view
|
|
61
|
+
|
|
62
|
+
- Register a tool in `src/server.ts` with a unique name (e.g., `my-view`) using [`registerTool`](https://docs.skybridge.tech/api-reference/register-tool) and a `view` config.
|
|
63
|
+
- Create a matching React component at `src/views/my-view.tsx`. **The file name must match the view name exactly**.
|
|
64
|
+
|
|
65
|
+
#### 2. Edit views with Hot Module Replacement (HMR)
|
|
66
|
+
|
|
67
|
+
Edit and save components in `src/views/` — changes will appear instantly inside your App.
|
|
68
|
+
|
|
69
|
+
#### 3. Edit server code
|
|
70
|
+
|
|
71
|
+
Modify files in `src/` and refresh the tool list with your MCP Client to see the changes.
|
|
72
|
+
|
|
73
|
+
### Testing your App
|
|
74
|
+
|
|
75
|
+
You can test your app locally by using our DevTools UI on `http://localhost:3000` while running the `dev` command.
|
|
76
|
+
|
|
77
|
+
To connect your app with web clients like ChatGPT or Claude, expose your server on the internet by adding the `--tunnel` flag.
|
|
78
|
+
By enabling the tunnel, you'll also be able to access a playground to chat with your app and a real LLM. Learn more by reading the [test guide](https://docs.skybridge.tech/quickstart/test-your-app).
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Deploy to Production
|
|
82
|
+
|
|
83
|
+
Skybridge is infrastructure vendor agnostic, and your app can be deployed on any cloud platform supporting MCP.
|
|
84
|
+
|
|
85
|
+
The simplest way to deploy your app is by running the `deploy` command, which will push your MCP server to the [Alpic](https://alpic.ai/) cloud for free.
|
|
86
|
+
|
|
87
|
+
## Resources
|
|
88
|
+
- [Skybridge Documentation](https://docs.skybridge.tech/)
|
|
89
|
+
- [Apps SDK Documentation](https://developers.openai.com/apps-sdk)
|
|
90
|
+
- [MCP Apps Documentation](https://github.com/modelcontextprotocol/ext-apps/tree/main)
|
|
91
|
+
- [Model Context Protocol Documentation](https://modelcontextprotocol.io/)
|
|
92
|
+
- [Alpic Documentation](https://docs.alpic.ai/)
|
|
@@ -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/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/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/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/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/../alpic/bin/run.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../alpic/bin/run.js" "$@"
|
|
21
|
+
fi
|
|
@@ -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/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_87a889c60e4b1fe9d02c5a43786e65ce/node_modules/@ladle/react/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_87a889c60e4b1fe9d02c5a43786e65ce/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/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_87a889c60e4b1fe9d02c5a43786e65ce/node_modules/@ladle/react/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_87a889c60e4b1fe9d02c5a43786e65ce/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/../@ladle/react/lib/cli/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../@ladle/react/lib/cli/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -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/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/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/../skybridge/bin/run.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../skybridge/bin/run.js" "$@"
|
|
21
|
+
fi
|
|
@@ -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/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/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/../skybridge/bin/run.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../skybridge/bin/run.js" "$@"
|
|
21
|
+
fi
|
|
@@ -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/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
|
+
else
|
|
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
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -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/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
|
+
else
|
|
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
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -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.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.0/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.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.0/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
|
|
@@ -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/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/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/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/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/../vite/bin/vite.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vite/bin/vite.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skybridge-ecom",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Skybridge MCP ecommerce template",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "skybridge dev",
|
|
9
|
+
"dev:tunnel": "skybridge dev --tunnel",
|
|
10
|
+
"build": "skybridge build",
|
|
11
|
+
"start": "skybridge start",
|
|
12
|
+
"deploy": "alpic deploy",
|
|
13
|
+
"ladle": "ladle serve",
|
|
14
|
+
"ladle:build": "ladle build"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"react": "^19.2.4",
|
|
18
|
+
"react-dom": "^19.2.4",
|
|
19
|
+
"skybridge": "^0.0.0-dev.35a7b38",
|
|
20
|
+
"vite": "^8.1.3",
|
|
21
|
+
"zod": "^4.4.3"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@ladle/react": "^5.1.1",
|
|
25
|
+
"@skybridge/devtools": "^1.2.4",
|
|
26
|
+
"@types/node": "^24.13.2",
|
|
27
|
+
"@types/react": "^19.2.14",
|
|
28
|
+
"@types/react-dom": "^19.2.3",
|
|
29
|
+
"@vanilla-extract/css": "^1.20.1",
|
|
30
|
+
"@vanilla-extract/recipes": "^0.5.7",
|
|
31
|
+
"@vanilla-extract/sprinkles": "^1.6.5",
|
|
32
|
+
"@vanilla-extract/vite-plugin": "^5.2.2",
|
|
33
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
34
|
+
"alpic": "^1.147.1",
|
|
35
|
+
"tsx": "^4.23.0",
|
|
36
|
+
"typescript": "^6.0.3"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=24.18.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
+
import { colors, primitives } from "../design/tokens";
|
|
4
|
+
|
|
5
|
+
// A selectable pill used for option values (sizes, colors…). `selected` and
|
|
6
|
+
// `disabled` are driven by the variant picker from the sparse variant list.
|
|
7
|
+
// @todo: tune the chip to your brand (radius, borders, selected treatment).
|
|
8
|
+
export const chip = recipe({
|
|
9
|
+
base: {
|
|
10
|
+
display: "inline-flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
gap: primitives.space["4xs"],
|
|
13
|
+
minHeight: "44px", // touch target
|
|
14
|
+
padding: `${primitives.space["4xs"]} ${primitives.space["3xs"]}`,
|
|
15
|
+
borderRadius: primitives.radius.m,
|
|
16
|
+
border: `${primitives.stroke.thin} solid ${colors.border.subtle}`,
|
|
17
|
+
backgroundColor: colors.surface.extraLight,
|
|
18
|
+
color: colors.content.intense,
|
|
19
|
+
fontFamily: primitives.font.family.primary,
|
|
20
|
+
fontSize: primitives.font.size.s,
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
transition: "border-color 150ms ease",
|
|
23
|
+
"@media": {
|
|
24
|
+
"(prefers-reduced-motion: reduce)": { transition: "none" },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
variants: {
|
|
28
|
+
selected: {
|
|
29
|
+
true: {
|
|
30
|
+
borderColor: colors.common.accent,
|
|
31
|
+
borderWidth: primitives.stroke.medium,
|
|
32
|
+
},
|
|
33
|
+
false: {},
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
// Unreachable value given the other choices: greyed and struck, but kept
|
|
37
|
+
// visible so the client sees the axis exists (never silently hidden).
|
|
38
|
+
true: {
|
|
39
|
+
cursor: "not-allowed",
|
|
40
|
+
opacity: 0.4,
|
|
41
|
+
textDecoration: "line-through",
|
|
42
|
+
},
|
|
43
|
+
false: {},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: { selected: false, disabled: false },
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Small color/material swatch shown before the label on image chips.
|
|
50
|
+
export const swatch = style({
|
|
51
|
+
width: "20px",
|
|
52
|
+
height: "20px",
|
|
53
|
+
borderRadius: primitives.radius.full,
|
|
54
|
+
objectFit: "cover",
|
|
55
|
+
display: "block",
|
|
56
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Chip } from "./chip";
|
|
2
|
+
|
|
3
|
+
const SWATCH =
|
|
4
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect width='20' height='20' fill='%233b6cf0'/%3E%3C/svg%3E";
|
|
5
|
+
|
|
6
|
+
const row = {
|
|
7
|
+
display: "flex",
|
|
8
|
+
gap: 8,
|
|
9
|
+
flexWrap: "wrap" as const,
|
|
10
|
+
maxWidth: 320,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const States = () => (
|
|
14
|
+
<div style={row}>
|
|
15
|
+
<Chip label="M" />
|
|
16
|
+
<Chip label="L" selected />
|
|
17
|
+
<Chip label="XL" disabled />
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const WithSwatch = () => (
|
|
22
|
+
<div style={row}>
|
|
23
|
+
<Chip label="Blue" media={SWATCH} selected />
|
|
24
|
+
<Chip label="Black" media={SWATCH} />
|
|
25
|
+
</div>
|
|
26
|
+
);
|