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