create-skybridge 0.0.0-dev.ff50fdb → 0.0.1-cloudflare
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 +96 -28
- package/dist/index.test.js +11 -1
- package/package.json +13 -11
- package/template/AGENTS.md +1 -0
- package/template/README.md +38 -18
- package/template/_headers +2 -0
- package/template/package.json +16 -19
- package/template/server/src/index.ts +62 -37
- package/template/server/src/vite-manifest.d.ts +2 -0
- package/template/tsconfig.json +5 -19
- package/template/web/dist/.vite/manifest.json +24 -0
- package/template/web/dist/assets/magic-8-ball-DR3HjR06.js +94 -0
- package/template/web/dist/assets/modal-provider-4p4PW04T.js +18 -0
- package/template/web/dist/assets/style-CH_mzOKc.css +2 -0
- package/template/web/src/helpers.ts +1 -1
- package/template/web/src/index.css +129 -6
- package/template/web/src/widgets/magic-8-ball.tsx +9 -6
- package/template/web/vite.config.ts +2 -2
- package/template/wrangler.jsonc +12 -0
- package/LICENSE +0 -21
- package/template/node_modules/.bin/mcp-inspector +0 -21
- package/template/node_modules/.bin/nodemon +0 -21
- package/template/node_modules/.bin/sb +0 -21
- package/template/node_modules/.bin/shx +0 -21
- package/template/node_modules/.bin/skybridge +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/server/src/middleware.ts +0 -54
- package/template/server/src/server.ts +0 -61
- package/template/tsconfig.server.json +0 -11
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./magic-8-ball-DR3HjR06.js";var i=r(),a=e(n(),1),o=`
|
|
2
|
+
.sb-modal-backdrop {
|
|
3
|
+
position: fixed;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background: rgba(0, 0, 0, 0.5);
|
|
6
|
+
z-index: 9998;
|
|
7
|
+
}
|
|
8
|
+
.sb-modal-container {
|
|
9
|
+
border-radius: 12px;
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: 0;
|
|
12
|
+
margin: auto;
|
|
13
|
+
width: fit-content;
|
|
14
|
+
height: fit-content;
|
|
15
|
+
background: white;
|
|
16
|
+
z-index: 9999;
|
|
17
|
+
}
|
|
18
|
+
`;function s({children:e}){let n=t.getInstance(),{mode:r}=(0,a.useSyncExternalStore)(n.getHostContextStore(`view`).subscribe,n.getHostContextStore(`view`).getSnapshot),s=r===`modal`;return(0,a.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&n.closeModal()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s,n]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`style`,{children:o}),s&&(0,i.jsx)(`div`,{role:`dialog`,className:`sb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&n.closeModal()}}),(0,i.jsx)(`div`,{className:s?`sb-modal-container`:void 0,children:e})]})}export{s as ModalProvider};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@import "https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,600&display=swap";.container{box-sizing:border-box;justify-content:center;align-items:center;min-height:100%;max-height:100%;padding:1rem;display:flex;overflow:hidden}.ball{text-align:center;cursor:pointer;background:radial-gradient(circle at 30% 30%,#454565 0%,#1c1c30 40%,#0a0a10 100%);border:1px solid #1e1e3299;border-radius:50%;flex-direction:column;justify-content:center;align-items:center;width:12rem;height:12rem;font-family:monospace;transition:transform .3s;animation:3s ease-in-out infinite float,15s ease-in-out infinite colorShift;display:flex;position:relative;box-shadow:0 10px 30px #00000080,0 5px 15px #0000004d,inset 0 -20px 40px #0009}.ball:hover{animation:15s ease-in-out infinite colorShift;transform:scale(1.05)translateY(-8px);box-shadow:0 20px 50px #0009,0 10px 25px #0006,inset 0 -20px 40px #0009}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes colorShift{0%,to{background:radial-gradient(circle at 30% 30%,#454565 0%,#1c1c30 40%,#0a0a10 100%)}25%{background:radial-gradient(circle at 30% 30%,#3f4a65 0%,#181e30 40%,#090a10 100%)}50%{background:radial-gradient(circle at 30% 30%,#3a5065 0%,#152230 40%,#080a10 100%)}75%{background:radial-gradient(circle at 30% 30%,#3f4a65 0%,#181e30 40%,#090a10 100%)}}.ball:before{content:"";pointer-events:none;background:radial-gradient(#ffffff4d 0%,#0000 70%);border-radius:50%;width:30%;height:20%;position:absolute;top:8%;left:20%}.ball:after{content:"";pointer-events:none;background:radial-gradient(#ffffff1a 0%,#0000 70%);border-radius:50%;width:25%;height:10%;position:absolute;bottom:8%;right:25%}.question{color:#d3d3d3;word-wrap:break-word;overflow-wrap:break-word;text-align:center;max-width:90%;font-size:clamp(.5rem,2vw,.75rem);font-style:italic;line-height:1.3}.answer{color:#7dd3fc;text-shadow:0 0 10px #7dd3fc80;word-wrap:break-word;overflow-wrap:break-word;text-align:center;max-width:90%;margin-top:.5rem;font-family:Playfair Display,serif;font-size:1.25rem;font-style:italic;font-weight:600;line-height:1.3}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,600&display=swap");
|
|
2
|
+
|
|
1
3
|
.container {
|
|
2
4
|
display: flex;
|
|
3
5
|
justify-content: center;
|
|
4
6
|
align-items: center;
|
|
5
|
-
height: 100%;
|
|
7
|
+
min-height: 100%;
|
|
8
|
+
max-height: 100%;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
box-sizing: border-box;
|
|
6
12
|
}
|
|
7
13
|
|
|
8
14
|
.ball {
|
|
9
|
-
background
|
|
15
|
+
background: radial-gradient(
|
|
16
|
+
circle at 30% 30%,
|
|
17
|
+
#454565 0%,
|
|
18
|
+
#1c1c30 40%,
|
|
19
|
+
#0a0a10 100%
|
|
20
|
+
);
|
|
10
21
|
border-radius: 50%;
|
|
11
22
|
width: 12rem;
|
|
12
23
|
height: 12rem;
|
|
@@ -16,16 +27,128 @@
|
|
|
16
27
|
justify-content: center;
|
|
17
28
|
font-family: monospace;
|
|
18
29
|
text-align: center;
|
|
30
|
+
position: relative;
|
|
31
|
+
box-shadow:
|
|
32
|
+
0 10px 30px rgba(0, 0, 0, 0.5),
|
|
33
|
+
0 5px 15px rgba(0, 0, 0, 0.3),
|
|
34
|
+
inset 0 -20px 40px rgba(0, 0, 0, 0.6);
|
|
35
|
+
animation:
|
|
36
|
+
float 3s ease-in-out infinite,
|
|
37
|
+
colorShift 15s ease-in-out infinite;
|
|
38
|
+
transition: transform 0.3s ease;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
border: 1px solid rgba(30, 30, 50, 0.6);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ball:hover {
|
|
44
|
+
transform: scale(1.05) translateY(-8px);
|
|
45
|
+
animation: colorShift 15s ease-in-out infinite;
|
|
46
|
+
box-shadow:
|
|
47
|
+
0 20px 50px rgba(0, 0, 0, 0.6),
|
|
48
|
+
0 10px 25px rgba(0, 0, 0, 0.4),
|
|
49
|
+
inset 0 -20px 40px rgba(0, 0, 0, 0.6);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes float {
|
|
53
|
+
0%,
|
|
54
|
+
100% {
|
|
55
|
+
transform: translateY(0);
|
|
56
|
+
}
|
|
57
|
+
50% {
|
|
58
|
+
transform: translateY(-8px);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes colorShift {
|
|
63
|
+
0%,
|
|
64
|
+
100% {
|
|
65
|
+
background: radial-gradient(
|
|
66
|
+
circle at 30% 30%,
|
|
67
|
+
#454565 0%,
|
|
68
|
+
#1c1c30 40%,
|
|
69
|
+
#0a0a10 100%
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
25% {
|
|
73
|
+
background: radial-gradient(
|
|
74
|
+
circle at 30% 30%,
|
|
75
|
+
#3f4a65 0%,
|
|
76
|
+
#181e30 40%,
|
|
77
|
+
#090a10 100%
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
50% {
|
|
81
|
+
background: radial-gradient(
|
|
82
|
+
circle at 30% 30%,
|
|
83
|
+
#3a5065 0%,
|
|
84
|
+
#152230 40%,
|
|
85
|
+
#080a10 100%
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
75% {
|
|
89
|
+
background: radial-gradient(
|
|
90
|
+
circle at 30% 30%,
|
|
91
|
+
#3f4a65 0%,
|
|
92
|
+
#181e30 40%,
|
|
93
|
+
#090a10 100%
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ball::before {
|
|
99
|
+
content: "";
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: 8%;
|
|
102
|
+
left: 20%;
|
|
103
|
+
width: 30%;
|
|
104
|
+
height: 20%;
|
|
105
|
+
background: radial-gradient(
|
|
106
|
+
ellipse,
|
|
107
|
+
rgba(255, 255, 255, 0.3) 0%,
|
|
108
|
+
transparent 70%
|
|
109
|
+
);
|
|
110
|
+
border-radius: 50%;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ball::after {
|
|
115
|
+
content: "";
|
|
116
|
+
position: absolute;
|
|
117
|
+
bottom: 8%;
|
|
118
|
+
right: 25%;
|
|
119
|
+
width: 25%;
|
|
120
|
+
height: 10%;
|
|
121
|
+
background: radial-gradient(
|
|
122
|
+
ellipse,
|
|
123
|
+
rgba(255, 255, 255, 0.1) 0%,
|
|
124
|
+
transparent 70%
|
|
125
|
+
);
|
|
126
|
+
border-radius: 50%;
|
|
127
|
+
pointer-events: none;
|
|
19
128
|
}
|
|
20
129
|
|
|
21
130
|
.question {
|
|
22
|
-
font-size: 0.75rem;
|
|
131
|
+
font-size: clamp(0.5rem, 2vw, 0.75rem);
|
|
23
132
|
color: lightgrey;
|
|
133
|
+
max-width: 90%;
|
|
134
|
+
word-wrap: break-word;
|
|
135
|
+
overflow-wrap: break-word;
|
|
136
|
+
text-align: center;
|
|
137
|
+
line-height: 1.3;
|
|
138
|
+
font-style: italic;
|
|
24
139
|
}
|
|
25
140
|
|
|
26
141
|
.answer {
|
|
27
|
-
font-
|
|
28
|
-
font-
|
|
142
|
+
font-family: "Playfair Display", serif;
|
|
143
|
+
font-style: italic;
|
|
144
|
+
font-size: 1.25rem;
|
|
145
|
+
font-weight: 600;
|
|
29
146
|
margin-top: 0.5rem;
|
|
30
|
-
color:
|
|
147
|
+
color: #7dd3fc;
|
|
148
|
+
text-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
|
|
149
|
+
max-width: 90%;
|
|
150
|
+
word-wrap: break-word;
|
|
151
|
+
overflow-wrap: break-word;
|
|
152
|
+
text-align: center;
|
|
153
|
+
line-height: 1.3;
|
|
31
154
|
}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import "@/index.css";
|
|
2
2
|
|
|
3
3
|
import { mountWidget } from "skybridge/web";
|
|
4
|
-
import { useToolInfo } from "../helpers";
|
|
4
|
+
import { useToolInfo } from "../helpers.js";
|
|
5
5
|
|
|
6
6
|
function Magic8Ball() {
|
|
7
7
|
const { input, output } = useToolInfo<"magic-8-ball">();
|
|
8
|
-
if (!output) {
|
|
9
|
-
return <div>Shaking...</div>;
|
|
10
|
-
}
|
|
11
8
|
|
|
12
9
|
return (
|
|
13
10
|
<div className="container">
|
|
14
11
|
<div className="ball">
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
{output ? (
|
|
13
|
+
<>
|
|
14
|
+
<div className="question">{input.question}</div>
|
|
15
|
+
<div className="answer">{output.answer}</div>
|
|
16
|
+
</>
|
|
17
|
+
) : (
|
|
18
|
+
<div className="question">Shaking...</div>
|
|
19
|
+
)}
|
|
17
20
|
</div>
|
|
18
21
|
</div>
|
|
19
22
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import react from "@vitejs/plugin-react";
|
|
3
3
|
import { skybridge } from "skybridge/web";
|
|
4
|
-
import { defineConfig } from "vite";
|
|
4
|
+
import { defineConfig, type PluginOption } from "vite";
|
|
5
5
|
|
|
6
6
|
// https://vite.dev/config/
|
|
7
7
|
export default defineConfig({
|
|
8
|
-
plugins: [skybridge(), react()],
|
|
8
|
+
plugins: [skybridge() as PluginOption, react()],
|
|
9
9
|
root: __dirname,
|
|
10
10
|
resolve: {
|
|
11
11
|
alias: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-skybridge-template",
|
|
3
|
+
"compatibility_date": "2026-03-16",
|
|
4
|
+
"main": "dist/server/src/index.js",
|
|
5
|
+
"assets": {
|
|
6
|
+
"directory": "dist"
|
|
7
|
+
},
|
|
8
|
+
"compatibility_flags": ["nodejs_compat"],
|
|
9
|
+
"define": {
|
|
10
|
+
"process.env.NODE_ENV": "\"production\""
|
|
11
|
+
}
|
|
12
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Alpic
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,21 +0,0 @@
|
|
|
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/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/build/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/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/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/build/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/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/../@modelcontextprotocol/inspector/cli/build/cli.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@modelcontextprotocol/inspector/cli/build/cli.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
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/nodemon@3.1.11/node_modules/nodemon/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules/nodemon/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/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/nodemon@3.1.11/node_modules/nodemon/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules/nodemon/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/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/../nodemon/bin/nodemon.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../nodemon/bin/nodemon.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
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/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/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/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/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/../skybridge/bin/run.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../skybridge/bin/run.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
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/shx@0.4.0/node_modules/shx/lib/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules/shx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.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/shx@0.4.0/node_modules/shx/lib/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules/shx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.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/../shx/lib/cli.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../shx/lib/cli.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
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/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/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/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/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/../skybridge/bin/run.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../skybridge/bin/run.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
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@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.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@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.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
|
|
@@ -1,21 +0,0 @@
|
|
|
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@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.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@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.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
|
|
@@ -1,21 +0,0 @@
|
|
|
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.21.0/node_modules/tsx/dist/node_modules:/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"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/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"
|
|
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
|
|
@@ -1,21 +0,0 @@
|
|
|
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@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_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@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.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@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_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@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_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"
|
|
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
|
package/template/nodemon.json
DELETED
|
@@ -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;
|