create-skybridge 0.0.0-dev.e129627 → 0.0.0-dev.e131f3d

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 (56) hide show
  1. package/dist/index.js +56 -10
  2. package/dist/index.test.js +4 -2
  3. package/package.json +7 -7
  4. package/template/.dockerignore +4 -0
  5. package/template/AGENTS.md +1 -0
  6. package/template/Dockerfile +53 -0
  7. package/template/README.md +38 -21
  8. package/template/_gitignore +2 -1
  9. package/template/node_modules/.bin/alpic +21 -0
  10. package/template/node_modules/.bin/sb +2 -2
  11. package/template/node_modules/.bin/skybridge +2 -2
  12. package/template/node_modules/.bin/tsc +2 -2
  13. package/template/node_modules/.bin/tsserver +2 -2
  14. package/template/node_modules/.bin/tsx +2 -2
  15. package/template/node_modules/.bin/vite +2 -2
  16. package/template/package.json +21 -18
  17. package/template/src/helpers.ts +4 -0
  18. package/template/src/index.css +59 -0
  19. package/template/src/server.ts +77 -0
  20. package/template/src/views/components/doc-link.tsx +22 -0
  21. package/template/src/views/components/doc.tsx +21 -0
  22. package/template/src/views/components/nav.tsx +31 -0
  23. package/template/src/views/components/progress.tsx +35 -0
  24. package/template/src/views/components/steps/outro.tsx +68 -0
  25. package/template/src/views/components/steps/state.tsx +47 -0
  26. package/template/src/views/components/steps/tool-call.tsx +53 -0
  27. package/template/src/views/components/steps/tool-output.tsx +40 -0
  28. package/template/src/views/images/mascot/beret.png +0 -0
  29. package/template/src/views/images/mascot/chapka.png +0 -0
  30. package/template/src/views/images/mascot/cowboy-hat.png +0 -0
  31. package/template/src/views/images/mascot/fez.png +0 -0
  32. package/template/src/views/images/mascot/jester-hat.png +0 -0
  33. package/template/src/views/images/mascot/mitre.png +0 -0
  34. package/template/src/views/images/mascot/non-la.png +0 -0
  35. package/template/src/views/images/mascot/original.png +0 -0
  36. package/template/src/views/images/mascot/propeller-beanie.png +0 -0
  37. package/template/src/views/images/mascot/ski-mask.png +0 -0
  38. package/template/src/views/images/mascot/sombrero.png +0 -0
  39. package/template/src/views/images/mascot/top-hat.png +0 -0
  40. package/template/src/views/images/mascot/viking-helmet.png +0 -0
  41. package/template/src/views/onboarding.tsx +63 -0
  42. package/template/src/views/use-mascot.ts +60 -0
  43. package/template/src/vite-manifest.d.ts +4 -0
  44. package/template/tsconfig.json +7 -19
  45. package/template/vite.config.ts +14 -0
  46. package/template/node_modules/.bin/mcp-inspector +0 -21
  47. package/template/node_modules/.bin/nodemon +0 -21
  48. package/template/nodemon.json +0 -5
  49. package/template/server/src/index.ts +0 -42
  50. package/template/server/src/middleware.ts +0 -54
  51. package/template/server/src/server.ts +0 -61
  52. package/template/tsconfig.server.json +0 -11
  53. package/template/web/src/helpers.ts +0 -4
  54. package/template/web/src/index.css +0 -151
  55. package/template/web/src/widgets/magic-8-ball.tsx +0 -24
  56. package/template/web/vite.config.ts +0 -15
@@ -1,54 +0,0 @@
1
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
2
- import type { NextFunction, Request, Response } from "express";
3
-
4
- import type { McpServer } from "skybridge/server";
5
-
6
- export const mcp =
7
- (server: McpServer) =>
8
- async (req: Request, res: Response, next: NextFunction) => {
9
- // Only handle requests to the /mcp path
10
- if (req.path !== "/mcp") {
11
- return next();
12
- }
13
-
14
- if (req.method === "POST") {
15
- try {
16
- const transport = new StreamableHTTPServerTransport({
17
- sessionIdGenerator: undefined,
18
- });
19
-
20
- res.on("close", () => {
21
- transport.close();
22
- });
23
-
24
- await server.connect(transport);
25
-
26
- await transport.handleRequest(req, res, req.body);
27
- } catch (error) {
28
- console.error("Error handling MCP request:", error);
29
- if (!res.headersSent) {
30
- res.status(500).json({
31
- jsonrpc: "2.0",
32
- error: {
33
- code: -32603,
34
- message: "Internal server error",
35
- },
36
- id: null,
37
- });
38
- }
39
- }
40
- } else if (req.method === "GET" || req.method === "DELETE") {
41
- res.writeHead(405).end(
42
- JSON.stringify({
43
- jsonrpc: "2.0",
44
- error: {
45
- code: -32000,
46
- message: "Method not allowed.",
47
- },
48
- id: null,
49
- }),
50
- );
51
- } else {
52
- next();
53
- }
54
- };
@@ -1,61 +0,0 @@
1
- import { McpServer } from "skybridge/server";
2
- import { z } from "zod";
3
-
4
- const Answers = [
5
- "As I see it, yes",
6
- "Don't count on it",
7
- "It is certain",
8
- "It is decidedly so",
9
- "Most likely",
10
- "My reply is no",
11
- "My sources say no",
12
- "Outlook good",
13
- "Outlook not so good",
14
- "Signs point to yes",
15
- "Very doubtful",
16
- "Without a doubt",
17
- "Yes definitely",
18
- "Yes",
19
- "You may rely on it",
20
- ];
21
-
22
- const server = new McpServer(
23
- {
24
- name: "alpic-openai-app",
25
- version: "0.0.1",
26
- },
27
- { capabilities: {} },
28
- ).registerWidget(
29
- "magic-8-ball",
30
- {
31
- description: "Magic 8 Ball",
32
- },
33
- {
34
- description: "For fortune-telling or seeking advice.",
35
- inputSchema: {
36
- question: z.string().describe("The user question."),
37
- },
38
- },
39
- async ({ question }) => {
40
- try {
41
- // deterministic answer
42
- const hash = question
43
- .split("")
44
- .reduce((acc, char) => acc + char.charCodeAt(0), 0);
45
- const answer = Answers[hash % Answers.length];
46
- return {
47
- structuredContent: { answer },
48
- content: [],
49
- isError: false,
50
- };
51
- } catch (error) {
52
- return {
53
- content: [{ type: "text", text: `Error: ${error}` }],
54
- isError: true,
55
- };
56
- }
57
- },
58
- );
59
-
60
- export default server;
61
- export type AppType = typeof server;
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "noEmit": false,
5
- "outDir": "dist",
6
- "sourceMap": true,
7
- "declaration": true
8
- },
9
- "include": ["server/src"],
10
- "exclude": ["dist", "node_modules"]
11
- }
@@ -1,4 +0,0 @@
1
- import { generateHelpers } from "skybridge/web";
2
- import type { AppType } from "../../server/src/server";
3
-
4
- export const { useToolInfo } = generateHelpers<AppType>();
@@ -1,151 +0,0 @@
1
- @import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,600&display=swap");
2
-
3
- .container {
4
- display: flex;
5
- justify-content: center;
6
- align-items: center;
7
- height: 100%;
8
- padding: 1rem;
9
- }
10
-
11
- .ball {
12
- background: radial-gradient(
13
- circle at 30% 30%,
14
- #454565 0%,
15
- #1c1c30 40%,
16
- #0a0a10 100%
17
- );
18
- border-radius: 50%;
19
- width: 12rem;
20
- height: 12rem;
21
- display: flex;
22
- flex-direction: column;
23
- align-items: center;
24
- justify-content: center;
25
- font-family: monospace;
26
- text-align: center;
27
- position: relative;
28
- box-shadow:
29
- 0 10px 30px rgba(0, 0, 0, 0.5),
30
- 0 5px 15px rgba(0, 0, 0, 0.3),
31
- inset 0 -20px 40px rgba(0, 0, 0, 0.6);
32
- animation:
33
- float 3s ease-in-out infinite,
34
- colorShift 15s ease-in-out infinite;
35
- transition: transform 0.3s ease;
36
- cursor: pointer;
37
- border: 1px solid rgba(30, 30, 50, 0.6);
38
- }
39
-
40
- .ball:hover {
41
- transform: scale(1.05) translateY(-8px);
42
- animation: colorShift 15s ease-in-out infinite;
43
- box-shadow:
44
- 0 20px 50px rgba(0, 0, 0, 0.6),
45
- 0 10px 25px rgba(0, 0, 0, 0.4),
46
- inset 0 -20px 40px rgba(0, 0, 0, 0.6);
47
- }
48
-
49
- @keyframes float {
50
- 0%,
51
- 100% {
52
- transform: translateY(0);
53
- }
54
- 50% {
55
- transform: translateY(-8px);
56
- }
57
- }
58
-
59
- @keyframes colorShift {
60
- 0%,
61
- 100% {
62
- background: radial-gradient(
63
- circle at 30% 30%,
64
- #454565 0%,
65
- #1c1c30 40%,
66
- #0a0a10 100%
67
- );
68
- }
69
- 25% {
70
- background: radial-gradient(
71
- circle at 30% 30%,
72
- #3f4a65 0%,
73
- #181e30 40%,
74
- #090a10 100%
75
- );
76
- }
77
- 50% {
78
- background: radial-gradient(
79
- circle at 30% 30%,
80
- #3a5065 0%,
81
- #152230 40%,
82
- #080a10 100%
83
- );
84
- }
85
- 75% {
86
- background: radial-gradient(
87
- circle at 30% 30%,
88
- #3f4a65 0%,
89
- #181e30 40%,
90
- #090a10 100%
91
- );
92
- }
93
- }
94
-
95
- .ball::before {
96
- content: "";
97
- position: absolute;
98
- top: 8%;
99
- left: 20%;
100
- width: 30%;
101
- height: 20%;
102
- background: radial-gradient(
103
- ellipse,
104
- rgba(255, 255, 255, 0.3) 0%,
105
- transparent 70%
106
- );
107
- border-radius: 50%;
108
- pointer-events: none;
109
- }
110
-
111
- .ball::after {
112
- content: "";
113
- position: absolute;
114
- bottom: 8%;
115
- right: 25%;
116
- width: 25%;
117
- height: 10%;
118
- background: radial-gradient(
119
- ellipse,
120
- rgba(255, 255, 255, 0.1) 0%,
121
- transparent 70%
122
- );
123
- border-radius: 50%;
124
- pointer-events: none;
125
- }
126
-
127
- .question {
128
- font-size: clamp(0.5rem, 2vw, 0.75rem);
129
- color: lightgrey;
130
- max-width: 90%;
131
- word-wrap: break-word;
132
- overflow-wrap: break-word;
133
- text-align: center;
134
- line-height: 1.3;
135
- font-style: italic;
136
- }
137
-
138
- .answer {
139
- font-family: "Playfair Display", serif;
140
- font-style: italic;
141
- font-size: 1.25rem;
142
- font-weight: 600;
143
- margin-top: 0.5rem;
144
- color: #7dd3fc;
145
- text-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
146
- max-width: 90%;
147
- word-wrap: break-word;
148
- overflow-wrap: break-word;
149
- text-align: center;
150
- line-height: 1.3;
151
- }
@@ -1,24 +0,0 @@
1
- import "@/index.css";
2
-
3
- import { mountWidget } from "skybridge/web";
4
- import { useToolInfo } from "../helpers";
5
-
6
- function Magic8Ball() {
7
- const { input, output } = useToolInfo<"magic-8-ball">();
8
- if (!output) {
9
- return <div>Shaking...</div>;
10
- }
11
-
12
- return (
13
- <div className="container">
14
- <div className="ball">
15
- <div className="question">{input.question}</div>
16
- <div className="answer">{output.answer}</div>
17
- </div>
18
- </div>
19
- );
20
- }
21
-
22
- export default Magic8Ball;
23
-
24
- mountWidget(<Magic8Ball />);
@@ -1,15 +0,0 @@
1
- import path from "node:path";
2
- import react from "@vitejs/plugin-react";
3
- import { skybridge } from "skybridge/web";
4
- import { defineConfig, type PluginOption } from "vite";
5
-
6
- // https://vite.dev/config/
7
- export default defineConfig({
8
- plugins: [skybridge() as PluginOption, react()],
9
- root: __dirname,
10
- resolve: {
11
- alias: {
12
- "@": path.resolve(__dirname, "./src"),
13
- },
14
- },
15
- });