create-skybridge 2.0.0-beta.68a71cb → 2.0.0-beta.78ceed1
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/package.json +3 -3
- package/templates/blank/src/server.ts +4 -2
- package/templates/demo/evals/start.eval.ts +11 -0
- package/templates/demo/node_modules/.bin/vitest +21 -0
- package/templates/demo/package.json +11 -5
- package/templates/demo/src/server.ts +86 -84
- package/templates/demo/tsconfig.evals.json +11 -0
- package/templates/demo/vite.config.ts +2 -2
- package/templates/ecom/package.json +3 -3
- package/templates/ecom/src/server.ts +7 -5
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.78ceed1",
|
|
16
16
|
"vite": "^8.1.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@skybridge/devtools": "^
|
|
20
|
-
"@skybridge/vite-plugin": "^2.0.0-beta.
|
|
19
|
+
"@skybridge/devtools": "^2.0.0-beta.78ceed1",
|
|
20
|
+
"@skybridge/vite-plugin": "^2.0.0-beta.78ceed1",
|
|
21
21
|
"@types/node": "^24.13.3",
|
|
22
22
|
"alpic": "^1.155.0",
|
|
23
23
|
"tsx": "^4.23.1",
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Skybridge } from "skybridge/server";
|
|
1
|
+
import { Skybridge, type SkybridgeServer } 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 serverFactory = (server: SkybridgeServer) => server;
|
|
7
|
+
|
|
6
8
|
export const app = new Skybridge(
|
|
7
9
|
{
|
|
8
10
|
name: "skybridge-blank",
|
|
9
11
|
version: "0.0.1",
|
|
10
12
|
capabilities: {},
|
|
11
13
|
},
|
|
12
|
-
|
|
14
|
+
serverFactory,
|
|
13
15
|
);
|
|
14
16
|
|
|
15
17
|
export type AppType = typeof app;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
2
|
+
import { start } from "@skybridge/test";
|
|
3
|
+
import { expect, it } from "vitest";
|
|
4
|
+
import { app } from "../src/server.js";
|
|
5
|
+
|
|
6
|
+
it("reaches the onboarding tool from a natural prompt", async () => {
|
|
7
|
+
const chat = await start({ app, model: anthropic("claude-sonnet-4-5") });
|
|
8
|
+
await chat.send("Get me started with Skybridge, my name is Ada");
|
|
9
|
+
|
|
10
|
+
expect.chat(chat).toHaveCalledToolOnce("start");
|
|
11
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/node_modules/vitest/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/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/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/node_modules/vitest/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vitest@4.1.10_@opentelemetry+api@1.9.1_@types+node@24.13.3_@vitest+ui@4.1.10_jsdom@29.1_07746666baa47915e6a10611198811a1/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/../vitest/vitest.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -9,31 +9,37 @@
|
|
|
9
9
|
"dev:tunnel": "skybridge dev --tunnel",
|
|
10
10
|
"build": "skybridge build",
|
|
11
11
|
"start": "skybridge start",
|
|
12
|
-
"deploy": "alpic deploy"
|
|
12
|
+
"deploy": "alpic deploy",
|
|
13
|
+
"evals": "vitest run evals",
|
|
14
|
+
"evals:types": "tsc --noEmit -p tsconfig.evals.json"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
15
17
|
"@alpic-ai/ui": "^1.155.0",
|
|
16
18
|
"lucide-react": "^1.25.0",
|
|
17
19
|
"react": "^19.2.7",
|
|
18
20
|
"react-dom": "^19.2.7",
|
|
19
|
-
"skybridge": "^2.0.0-beta.
|
|
21
|
+
"skybridge": "^2.0.0-beta.78ceed1",
|
|
20
22
|
"sonner": "^2.0.7",
|
|
21
23
|
"tw-animate-css": "^1.4.0",
|
|
22
24
|
"vite": "^8.1.5",
|
|
23
25
|
"zod": "^4.4.3"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@skybridge/
|
|
28
|
+
"@ai-sdk/anthropic": "^2.0.90",
|
|
29
|
+
"@skybridge/devtools": "^2.0.0-beta.78ceed1",
|
|
30
|
+
"@skybridge/test": "beta",
|
|
31
|
+
"@skybridge/vite-plugin": "^2.0.0-beta.78ceed1",
|
|
28
32
|
"@tailwindcss/vite": "^4.3.3",
|
|
29
33
|
"@types/node": "^24.13.3",
|
|
30
34
|
"@types/react": "^19.2.17",
|
|
31
35
|
"@types/react-dom": "^19.2.3",
|
|
32
36
|
"@vitejs/plugin-react": "^6.0.3",
|
|
37
|
+
"ai": "^5.0.0",
|
|
33
38
|
"alpic": "^1.155.0",
|
|
34
39
|
"tailwindcss": "^4.3.3",
|
|
35
40
|
"tsx": "^4.23.1",
|
|
36
|
-
"typescript": "^6.0.3"
|
|
41
|
+
"typescript": "^6.0.3",
|
|
42
|
+
"vitest": "^4.1.10"
|
|
37
43
|
},
|
|
38
44
|
"engines": {
|
|
39
45
|
"node": ">=24.18.0"
|
|
@@ -1,95 +1,97 @@
|
|
|
1
|
-
import { Skybridge } from "skybridge/server";
|
|
1
|
+
import { Skybridge, type SkybridgeServer } from "skybridge/server";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
},
|
|
4
|
+
export const serverFactory = (server: SkybridgeServer) =>
|
|
5
|
+
server
|
|
6
|
+
.registerTool(
|
|
7
|
+
{
|
|
8
|
+
name: "start",
|
|
9
|
+
description: "Onboard Skybridge",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
name: z.string().optional().describe("The user name."),
|
|
43
12
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
13
|
+
annotations: {
|
|
14
|
+
title: "Start Skybridge onboarding",
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: false,
|
|
50
18
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
19
|
+
_meta: {
|
|
20
|
+
"openai/toolInvocation/invoking":
|
|
21
|
+
"Starting the Skybridge onboarding…",
|
|
22
|
+
"openai/toolInvocation/invoked": "Onboarding ready.",
|
|
23
|
+
},
|
|
24
|
+
view: {
|
|
25
|
+
component: "onboarding",
|
|
26
|
+
// Replace with the URL your widget will be served from in production.
|
|
27
|
+
domain: "https://skybridge.tech",
|
|
28
|
+
description: "Onboarding deck",
|
|
29
|
+
csp: {
|
|
30
|
+
resourceDomains: [
|
|
31
|
+
"https://fonts.googleapis.com",
|
|
32
|
+
"https://fonts.gstatic.com",
|
|
33
|
+
],
|
|
34
|
+
redirectDomains: ["https://docs.skybridge.tech"],
|
|
65
35
|
},
|
|
66
36
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
37
|
+
},
|
|
38
|
+
async ({ name }) => {
|
|
39
|
+
return {
|
|
40
|
+
structuredContent: { name },
|
|
41
|
+
content: [{ type: "text", text: `User name: ${name ?? "friend"}` }],
|
|
42
|
+
isError: false,
|
|
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,
|
|
55
|
+
},
|
|
56
|
+
_meta: {
|
|
57
|
+
"openai/toolInvocation/invoking": "Cracking open a fortune cookie…",
|
|
58
|
+
"openai/toolInvocation/invoked": "Fortune revealed.",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
async () => {
|
|
62
|
+
const predictions = [
|
|
63
|
+
"A pleasant surprise is waiting for you.",
|
|
64
|
+
"Your hard work will soon pay off.",
|
|
65
|
+
"An unexpected friendship will brighten your week.",
|
|
66
|
+
"The best is yet to come.",
|
|
67
|
+
"A small step today leads to a giant leap tomorrow.",
|
|
68
|
+
"Trust your instincts: they are sharper than you think.",
|
|
69
|
+
"Adventure awaits just around the corner.",
|
|
70
|
+
"A long-forgotten idea will return with great success.",
|
|
71
|
+
"Kindness given today will be returned threefold.",
|
|
72
|
+
"Something you lost will soon be found.",
|
|
73
|
+
];
|
|
74
|
+
const prediction =
|
|
75
|
+
predictions[Math.floor(Math.random() * predictions.length)];
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
// simulate backend work
|
|
78
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
return {
|
|
81
|
+
structuredContent: { prediction },
|
|
82
|
+
content: [{ type: "text", text: prediction }],
|
|
83
|
+
isError: false,
|
|
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,
|
|
93
95
|
);
|
|
94
96
|
|
|
95
97
|
export type AppType = typeof app;
|
|
@@ -5,7 +5,7 @@ import react from "@vitejs/plugin-react";
|
|
|
5
5
|
import { defineConfig } from "vite";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
|
-
plugins: [skybridge(), react(), tailwindcss()],
|
|
8
|
+
plugins: [skybridge({ evals: {} }), react(), tailwindcss()],
|
|
9
9
|
server: {
|
|
10
10
|
forwardConsole: {
|
|
11
11
|
unhandledErrors: true,
|
|
@@ -14,7 +14,7 @@ export default defineConfig({
|
|
|
14
14
|
},
|
|
15
15
|
resolve: {
|
|
16
16
|
alias: {
|
|
17
|
-
"@": path.resolve(
|
|
17
|
+
"@": path.resolve(import.meta.dirname, "./src"),
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
});
|
|
@@ -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.78ceed1",
|
|
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": "^
|
|
26
|
-
"@skybridge/vite-plugin": "^2.0.0-beta.
|
|
25
|
+
"@skybridge/devtools": "^2.0.0-beta.78ceed1",
|
|
26
|
+
"@skybridge/vite-plugin": "^2.0.0-beta.78ceed1",
|
|
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 } from "skybridge/server";
|
|
2
|
+
import { Skybridge, type SkybridgeServer } from "skybridge/server";
|
|
3
3
|
import { CAROUSEL_RANGE, MIN_SEARCH_ITERATIONS } from "./config.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCarouselDefinition,
|
|
@@ -15,6 +15,11 @@ if (existsSync(".env")) {
|
|
|
15
15
|
process.loadEnvFile();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export const serverFactory = (server: SkybridgeServer) =>
|
|
19
|
+
server
|
|
20
|
+
.registerTool(searchProductsDefinition, searchProductsHandler)
|
|
21
|
+
.registerTool(renderCarouselDefinition, renderCarouselHandler);
|
|
22
|
+
|
|
18
23
|
export const app = new Skybridge(
|
|
19
24
|
{
|
|
20
25
|
// @todo: name and version your app.
|
|
@@ -32,10 +37,7 @@ once the carousel renders.
|
|
|
32
37
|
RENDER: After curating, call render-carousel with the chosen product IDs (aim for ${CAROUSEL_RANGE}). \
|
|
33
38
|
Speak once it renders, then recommend products in carousel order.`,
|
|
34
39
|
},
|
|
35
|
-
|
|
36
|
-
server
|
|
37
|
-
.registerTool(searchProductsDefinition, searchProductsHandler)
|
|
38
|
-
.registerTool(renderCarouselDefinition, renderCarouselHandler),
|
|
40
|
+
serverFactory,
|
|
39
41
|
);
|
|
40
42
|
|
|
41
43
|
export type AppType = typeof app;
|