create-skybridge 2.0.0-alpha.ff0caf0 → 2.0.0-beta.68a71cb
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/package.json +1 -1
- package/templates/blank/README.md +2 -1
- package/templates/blank/package.json +2 -1
- package/templates/blank/src/index.ts +3 -0
- package/templates/blank/src/server.ts +8 -9
- package/templates/blank/vite.config.ts +1 -1
- package/templates/demo/README.md +2 -1
- package/templates/demo/package.json +2 -1
- package/templates/demo/src/index.ts +3 -0
- package/templates/demo/src/server.ts +85 -84
- package/templates/demo/vite.config.ts +1 -1
- package/templates/ecom/README.md +2 -1
- package/templates/ecom/package.json +2 -1
- package/templates/ecom/src/index.ts +3 -0
- package/templates/ecom/src/server.ts +8 -10
- package/templates/ecom/vite.config.ts +1 -1
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
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
"deploy": "alpic deploy"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"skybridge": "^2.0.0-
|
|
15
|
+
"skybridge": "^2.0.0-beta.68a71cb",
|
|
16
16
|
"vite": "^8.1.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@skybridge/devtools": "^1.2.7",
|
|
20
|
+
"@skybridge/vite-plugin": "^2.0.0-beta.68a71cb",
|
|
20
21
|
"@types/node": "^24.13.3",
|
|
21
22
|
"alpic": "^1.155.0",
|
|
22
23
|
"tsx": "^4.23.1",
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Skybridge } from "skybridge/server";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Register tools with `server.registerTool(...)`.
|
|
4
|
+
// Docs: https://docs.skybridge.tech/api-reference/register-tool
|
|
5
|
+
|
|
6
|
+
export const app = new Skybridge(
|
|
4
7
|
{
|
|
5
8
|
name: "skybridge-blank",
|
|
6
9
|
version: "0.0.1",
|
|
10
|
+
capabilities: {},
|
|
7
11
|
},
|
|
8
|
-
|
|
12
|
+
(server) => server,
|
|
9
13
|
);
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
// Docs: https://docs.skybridge.tech/api-reference/register-tool
|
|
13
|
-
|
|
14
|
-
export default await server.run();
|
|
15
|
-
|
|
16
|
-
export type AppType = typeof server;
|
|
15
|
+
export type AppType = typeof app;
|
package/templates/demo/README.md
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
|
│ ├── views/ # React components (one per view)
|
|
53
54
|
│ ├── components/ # Shared UI components
|
|
54
55
|
│ ├── helpers.ts # Shared utilities
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lucide-react": "^1.25.0",
|
|
17
17
|
"react": "^19.2.7",
|
|
18
18
|
"react-dom": "^19.2.7",
|
|
19
|
-
"skybridge": "^2.0.0-
|
|
19
|
+
"skybridge": "^2.0.0-beta.68a71cb",
|
|
20
20
|
"sonner": "^2.0.7",
|
|
21
21
|
"tw-animate-css": "^1.4.0",
|
|
22
22
|
"vite": "^8.1.5",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@skybridge/devtools": "^1.2.7",
|
|
27
|
+
"@skybridge/vite-plugin": "^2.0.0-beta.68a71cb",
|
|
27
28
|
"@tailwindcss/vite": "^4.3.3",
|
|
28
29
|
"@types/node": "^24.13.3",
|
|
29
30
|
"@types/react": "^19.2.17",
|
|
@@ -1,94 +1,95 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Skybridge } from "skybridge/server";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
export const app = new Skybridge(
|
|
5
5
|
{
|
|
6
6
|
name: "alpic-openai-app",
|
|
7
7
|
version: "0.0.1",
|
|
8
|
+
capabilities: {},
|
|
8
9
|
},
|
|
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
|
-
|
|
10
|
+
(server) =>
|
|
11
|
+
server
|
|
12
|
+
.registerTool(
|
|
13
|
+
{
|
|
14
|
+
name: "start",
|
|
15
|
+
description: "Onboard Skybridge",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
name: z.string().optional().describe("The user name."),
|
|
18
|
+
},
|
|
19
|
+
annotations: {
|
|
20
|
+
title: "Start Skybridge onboarding",
|
|
21
|
+
readOnlyHint: true,
|
|
22
|
+
destructiveHint: false,
|
|
23
|
+
openWorldHint: false,
|
|
24
|
+
},
|
|
25
|
+
_meta: {
|
|
26
|
+
"openai/toolInvocation/invoking":
|
|
27
|
+
"Starting the Skybridge onboarding…",
|
|
28
|
+
"openai/toolInvocation/invoked": "Onboarding ready.",
|
|
29
|
+
},
|
|
30
|
+
view: {
|
|
31
|
+
component: "onboarding",
|
|
32
|
+
// Replace with the URL your widget will be served from in production.
|
|
33
|
+
domain: "https://skybridge.tech",
|
|
34
|
+
description: "Onboarding deck",
|
|
35
|
+
csp: {
|
|
36
|
+
resourceDomains: [
|
|
37
|
+
"https://fonts.googleapis.com",
|
|
38
|
+
"https://fonts.gstatic.com",
|
|
39
|
+
],
|
|
40
|
+
redirectDomains: ["https://docs.skybridge.tech"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
39
43
|
},
|
|
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));
|
|
44
|
+
async ({ name }) => {
|
|
45
|
+
return {
|
|
46
|
+
structuredContent: { name },
|
|
47
|
+
content: [{ type: "text", text: `User name: ${name ?? "friend"}` }],
|
|
48
|
+
isError: false,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
)
|
|
52
|
+
.registerTool(
|
|
53
|
+
{
|
|
54
|
+
name: "get-fortune-cookie",
|
|
55
|
+
description: "Get fortune cookie",
|
|
56
|
+
annotations: {
|
|
57
|
+
title: "Get a fortune cookie",
|
|
58
|
+
readOnlyHint: true,
|
|
59
|
+
destructiveHint: false,
|
|
60
|
+
openWorldHint: false,
|
|
61
|
+
},
|
|
62
|
+
_meta: {
|
|
63
|
+
"openai/toolInvocation/invoking": "Cracking open a fortune cookie…",
|
|
64
|
+
"openai/toolInvocation/invoked": "Fortune revealed.",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
async () => {
|
|
68
|
+
const predictions = [
|
|
69
|
+
"A pleasant surprise is waiting for you.",
|
|
70
|
+
"Your hard work will soon pay off.",
|
|
71
|
+
"An unexpected friendship will brighten your week.",
|
|
72
|
+
"The best is yet to come.",
|
|
73
|
+
"A small step today leads to a giant leap tomorrow.",
|
|
74
|
+
"Trust your instincts: they are sharper than you think.",
|
|
75
|
+
"Adventure awaits just around the corner.",
|
|
76
|
+
"A long-forgotten idea will return with great success.",
|
|
77
|
+
"Kindness given today will be returned threefold.",
|
|
78
|
+
"Something you lost will soon be found.",
|
|
79
|
+
];
|
|
80
|
+
const prediction =
|
|
81
|
+
predictions[Math.floor(Math.random() * predictions.length)];
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
content: [{ type: "text", text: prediction }],
|
|
87
|
-
isError: false,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
);
|
|
83
|
+
// simulate backend work
|
|
84
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
91
85
|
|
|
92
|
-
|
|
86
|
+
return {
|
|
87
|
+
structuredContent: { prediction },
|
|
88
|
+
content: [{ type: "text", text: prediction }],
|
|
89
|
+
isError: false,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
),
|
|
93
|
+
);
|
|
93
94
|
|
|
94
|
-
export type AppType = typeof
|
|
95
|
+
export type AppType = typeof app;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { skybridge } from "@skybridge/vite-plugin";
|
|
2
3
|
import tailwindcss from "@tailwindcss/vite";
|
|
3
4
|
import react from "@vitejs/plugin-react";
|
|
4
|
-
import { skybridge } from "skybridge/vite";
|
|
5
5
|
import { defineConfig } from "vite";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
package/templates/ecom/README.md
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
|
|
@@ -16,13 +16,14 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"react": "^19.2.4",
|
|
18
18
|
"react-dom": "^19.2.4",
|
|
19
|
-
"skybridge": "^2.0.0-
|
|
19
|
+
"skybridge": "^2.0.0-beta.68a71cb",
|
|
20
20
|
"vite": "^8.1.3",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@ladle/react": "^5.1.1",
|
|
25
25
|
"@skybridge/devtools": "^1.2.4",
|
|
26
|
+
"@skybridge/vite-plugin": "^2.0.0-beta.68a71cb",
|
|
26
27
|
"@types/node": "^24.13.2",
|
|
27
28
|
"@types/react": "^19.2.14",
|
|
28
29
|
"@types/react-dom": "^19.2.3",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import {
|
|
2
|
+
import { Skybridge } from "skybridge/server";
|
|
3
3
|
import { CAROUSEL_RANGE, MIN_SEARCH_ITERATIONS } from "./config.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCarouselDefinition,
|
|
@@ -15,13 +15,11 @@ if (existsSync(".env")) {
|
|
|
15
15
|
process.loadEnvFile();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
export const app = new Skybridge(
|
|
19
19
|
{
|
|
20
20
|
// @todo: name and version your app.
|
|
21
21
|
name: "skybridge-ecom",
|
|
22
22
|
version: "0.0.1",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
23
|
// @todo: adapt this server-wide prompt to your catalog.
|
|
26
24
|
instructions: `\
|
|
27
25
|
Two phases:
|
|
@@ -34,10 +32,10 @@ once the carousel renders.
|
|
|
34
32
|
RENDER: After curating, call render-carousel with the chosen product IDs (aim for ${CAROUSEL_RANGE}). \
|
|
35
33
|
Speak once it renders, then recommend products in carousel order.`,
|
|
36
34
|
},
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
(server) =>
|
|
36
|
+
server
|
|
37
|
+
.registerTool(searchProductsDefinition, searchProductsHandler)
|
|
38
|
+
.registerTool(renderCarouselDefinition, renderCarouselHandler),
|
|
39
|
+
);
|
|
42
40
|
|
|
43
|
-
export type AppType = typeof
|
|
41
|
+
export type AppType = typeof app;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { skybridge } from "@skybridge/vite-plugin";
|
|
1
2
|
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
3
|
import react from "@vitejs/plugin-react";
|
|
3
|
-
import { skybridge } from "skybridge/vite";
|
|
4
4
|
import { defineConfig, type PluginOption } from "vite";
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|