create-skybridge 0.0.0-dev.d5f8d0a → 0.0.0-dev.d60c856

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 (49) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +187 -55
  3. package/dist/index.test.d.ts +1 -0
  4. package/dist/index.test.js +35 -0
  5. package/index.js +6 -1
  6. package/package.json +10 -6
  7. package/template/.dockerignore +4 -0
  8. package/template/AGENTS.md +1 -0
  9. package/template/Dockerfile +53 -0
  10. package/template/README.md +94 -0
  11. package/template/_gitignore +6 -0
  12. package/template/alpic.json +3 -0
  13. package/template/node_modules/.bin/alpic +21 -0
  14. package/template/node_modules/.bin/sb +21 -0
  15. package/template/node_modules/.bin/skybridge +21 -0
  16. package/template/node_modules/.bin/tsc +21 -0
  17. package/template/node_modules/.bin/tsserver +21 -0
  18. package/template/node_modules/.bin/tsx +21 -0
  19. package/template/node_modules/.bin/vite +21 -0
  20. package/template/package.json +41 -0
  21. package/template/src/helpers.ts +4 -0
  22. package/template/src/index.css +59 -0
  23. package/template/src/server.ts +77 -0
  24. package/template/src/views/components/doc-link.tsx +22 -0
  25. package/template/src/views/components/doc.tsx +21 -0
  26. package/template/src/views/components/nav.tsx +31 -0
  27. package/template/src/views/components/progress.tsx +35 -0
  28. package/template/src/views/components/steps/outro.tsx +68 -0
  29. package/template/src/views/components/steps/state.tsx +47 -0
  30. package/template/src/views/components/steps/tool-call.tsx +53 -0
  31. package/template/src/views/components/steps/tool-output.tsx +40 -0
  32. package/template/src/views/images/mascot/beret.png +0 -0
  33. package/template/src/views/images/mascot/chapka.png +0 -0
  34. package/template/src/views/images/mascot/cowboy-hat.png +0 -0
  35. package/template/src/views/images/mascot/fez.png +0 -0
  36. package/template/src/views/images/mascot/jester-hat.png +0 -0
  37. package/template/src/views/images/mascot/mitre.png +0 -0
  38. package/template/src/views/images/mascot/non-la.png +0 -0
  39. package/template/src/views/images/mascot/original.png +0 -0
  40. package/template/src/views/images/mascot/propeller-beanie.png +0 -0
  41. package/template/src/views/images/mascot/ski-mask.png +0 -0
  42. package/template/src/views/images/mascot/sombrero.png +0 -0
  43. package/template/src/views/images/mascot/top-hat.png +0 -0
  44. package/template/src/views/images/mascot/viking-helmet.png +0 -0
  45. package/template/src/views/onboarding.tsx +63 -0
  46. package/template/src/views/use-mascot.ts +60 -0
  47. package/template/src/vite-manifest.d.ts +4 -0
  48. package/template/tsconfig.json +11 -0
  49. package/template/vite.config.ts +14 -0
@@ -0,0 +1,63 @@
1
+ import "@/index.css";
2
+
3
+ import { useState } from "react";
4
+ import { useLayout } from "skybridge/web";
5
+ import Nav from "./components/nav.js";
6
+ import Progress from "./components/progress.js";
7
+ import Outro from "./components/steps/outro.js";
8
+ import State from "./components/steps/state.js";
9
+ import ToolCall from "./components/steps/tool-call.js";
10
+ import ToolOutput from "./components/steps/tool-output.js";
11
+ import { useMascot } from "./use-mascot.js";
12
+
13
+ const STEPS = [
14
+ { label: "Reading tool output", Component: ToolOutput },
15
+ { label: "Sharing view state", Component: State },
16
+ { label: "Calling tools", Component: ToolCall },
17
+ { label: "Examples & docs", Component: Outro },
18
+ ] as const;
19
+
20
+ export default function Onboarding() {
21
+ // useLayout: read host layout info (theme, display mode, locale, ...).
22
+ const { theme } = useLayout();
23
+
24
+ const [step, setStep] = useState(0);
25
+ const { img } = useMascot();
26
+
27
+ return (
28
+ <div
29
+ className={`${theme === "dark" ? "dark" : ""} mx-auto w-full max-w-4xl border border-border overflow-hidden bg-background text-foreground`}
30
+ >
31
+ <div className="min-h-136 md:min-h-95 flex flex-col items-center gap-6 p-6 bg-linear-to-br from-purple-50 via-white to-cyan-50 dark:from-purple-950/30 dark:via-zinc-950 dark:to-cyan-900/30 bg-size-[200%_200%] animate-aurora md:flex-row md:items-stretch">
32
+ <div className="shrink-0 self-center animate-float">
33
+ <img
34
+ src={img}
35
+ alt="Skybridge mascot"
36
+ className="h-32 w-32 md:h-50 md:w-50 object-contain animate-twirl"
37
+ />
38
+ </div>
39
+ <div className="flex w-full flex-1 flex-col gap-6">
40
+ <Progress
41
+ steps={STEPS.map(({ label }) => label)}
42
+ current={step}
43
+ onSelect={setStep}
44
+ />
45
+ <div className="grid flex-1">
46
+ {STEPS.map(({ label, Component }, i) => (
47
+ <div
48
+ key={label}
49
+ className={`col-start-1 row-start-1 flex flex-col gap-6 ${
50
+ step === i ? "" : "invisible pointer-events-none"
51
+ }`}
52
+ aria-hidden={step !== i}
53
+ >
54
+ <Component />
55
+ </div>
56
+ ))}
57
+ </div>
58
+ <Nav current={step} total={STEPS.length} onChange={setStep} />
59
+ </div>
60
+ </div>
61
+ </div>
62
+ );
63
+ }
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ // Typed shim for the Vite manifest emitted by `skybridge build`. The actual
2
+ // `vite-manifest.js` is generated alongside this file and gitignored.
3
+ declare const manifest: Record<string, { file: string }>;
4
+ export default manifest;
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "skybridge/tsconfig",
3
+
4
+ "compilerOptions": {
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ }
8
+ },
9
+
10
+ "include": ["src", ".skybridge/**/*.d.ts"]
11
+ }
@@ -0,0 +1,14 @@
1
+ import path from "node:path";
2
+ import tailwindcss from "@tailwindcss/vite";
3
+ import react from "@vitejs/plugin-react";
4
+ import { skybridge } from "skybridge/vite";
5
+ import { defineConfig } from "vite";
6
+
7
+ export default defineConfig({
8
+ plugins: [skybridge(), react(), tailwindcss()],
9
+ resolve: {
10
+ alias: {
11
+ "@": path.resolve(__dirname, "./src"),
12
+ },
13
+ },
14
+ });