sunpeak 0.19.2 → 0.19.10
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/README.md +6 -4
- package/bin/commands/dev.mjs +1 -1
- package/bin/commands/inspect.mjs +1 -1
- package/bin/commands/new.mjs +9 -5
- package/bin/commands/start.mjs +3 -1
- package/bin/commands/test-init.mjs +478 -76
- package/bin/commands/test.mjs +357 -4
- package/bin/lib/eval/eval-reporter.mjs +105 -0
- package/bin/lib/eval/eval-runner.mjs +310 -0
- package/bin/lib/eval/eval-types.d.mts +168 -0
- package/bin/lib/eval/eval-vitest-plugin.mjs +158 -0
- package/bin/lib/eval/model-registry.mjs +73 -0
- package/bin/lib/sandbox-server.mjs +5 -2
- package/bin/sunpeak.js +1 -0
- package/dist/chatgpt/index.cjs +1 -1
- package/dist/chatgpt/index.js +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/host/chatgpt/index.cjs +1 -1
- package/dist/host/chatgpt/index.js +1 -1
- package/dist/index.cjs +134 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +71 -62
- package/dist/index.js.map +1 -1
- package/dist/inspector/index.cjs +1 -1
- package/dist/inspector/index.js +1 -1
- package/dist/{inspector-Cdo5BK2D.js → inspector-D5DckQuU.js} +236 -98
- package/dist/inspector-D5DckQuU.js.map +1 -0
- package/dist/{inspector-8nPV2A-z.cjs → inspector-jY9O18z9.cjs} +237 -99
- package/dist/inspector-jY9O18z9.cjs.map +1 -0
- package/dist/mcp/index.cjs +237 -140
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +230 -134
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/production-server.d.ts +31 -0
- package/dist/{protocol-C7kTcBr_.cjs → protocol-C8pFDmcy.cjs} +8194 -8187
- package/dist/protocol-C8pFDmcy.cjs.map +1 -0
- package/dist/{protocol-BfAACnv0.js → protocol-CRqiPTLT.js} +8186 -8185
- package/dist/protocol-CRqiPTLT.js.map +1 -0
- package/dist/{use-app-CfP9VypY.js → use-app-Bfargfa3.js} +194 -94
- package/dist/use-app-Bfargfa3.js.map +1 -0
- package/dist/{use-app-CzcYw1Kz.cjs → use-app-CbsBEmwv.cjs} +254 -148
- package/dist/use-app-CbsBEmwv.cjs.map +1 -0
- package/package.json +27 -3
- package/template/README.md +17 -7
- package/template/_gitignore +2 -0
- package/template/dist/albums/albums.html +15 -15
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.html +19 -19
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.html +14 -14
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.html +11 -11
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.bin/vitest +2 -2
- package/template/node_modules/.vite/deps/_metadata.json +3 -3
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +192 -91
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +231 -92
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +208 -105
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/_metadata.json +25 -25
- package/template/node_modules/.vite-mcp/deps/{protocol-B_qKkui_.js → protocol-BqGB4zBx.js} +45 -45
- package/template/node_modules/.vite-mcp/deps/protocol-BqGB4zBx.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js +7 -7
- package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-claude-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-claude-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-claude-darwin.png +0 -0
- package/template/tests/evals/.env.example +5 -0
- package/template/tests/evals/albums.eval.ts +28 -0
- package/template/tests/evals/carousel.eval.ts +26 -0
- package/template/tests/evals/eval.config.ts +26 -0
- package/template/tests/evals/map.eval.ts +23 -0
- package/template/tests/evals/review.eval.ts +48 -0
- package/dist/inspector-8nPV2A-z.cjs.map +0 -1
- package/dist/inspector-Cdo5BK2D.js.map +0 -1
- package/dist/protocol-BfAACnv0.js.map +0 -1
- package/dist/protocol-C7kTcBr_.cjs.map +0 -1
- package/dist/use-app-CfP9VypY.js.map +0 -1
- package/dist/use-app-CzcYw1Kz.cjs.map +0 -1
- package/template/node_modules/.vite-mcp/deps/protocol-B_qKkui_.js.map +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import { defineEval } from 'sunpeak/eval';
|
|
3
|
+
|
|
4
|
+
export default defineEval({
|
|
5
|
+
cases: [
|
|
6
|
+
{
|
|
7
|
+
name: 'asks for photo albums',
|
|
8
|
+
prompt: 'Show me my photo albums',
|
|
9
|
+
expect: { tool: 'show-albums' },
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'asks for food photos',
|
|
13
|
+
prompt: 'Show me photos from my Austin pizza tour',
|
|
14
|
+
expect: {
|
|
15
|
+
tool: 'show-albums',
|
|
16
|
+
args: { search: expect.stringMatching(/pizza|austin/i) },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'asks for a specific category',
|
|
21
|
+
prompt: 'Show me my travel photos',
|
|
22
|
+
expect: {
|
|
23
|
+
tool: 'show-albums',
|
|
24
|
+
args: { category: expect.stringMatching(/travel/i) },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import { defineEval } from 'sunpeak/eval';
|
|
3
|
+
|
|
4
|
+
export default defineEval({
|
|
5
|
+
cases: [
|
|
6
|
+
{
|
|
7
|
+
name: 'asks for popular places',
|
|
8
|
+
prompt: 'Show me popular places to visit in Tokyo',
|
|
9
|
+
expect: {
|
|
10
|
+
tool: 'show-carousel',
|
|
11
|
+
args: { city: expect.stringMatching(/tokyo/i) },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'asks for restaurants',
|
|
16
|
+
prompt: 'What are some good restaurants in Paris?',
|
|
17
|
+
expect: {
|
|
18
|
+
tool: 'show-carousel',
|
|
19
|
+
args: {
|
|
20
|
+
city: expect.stringMatching(/paris/i),
|
|
21
|
+
categories: expect.arrayContaining([expect.stringMatching(/restaurant|food|dining/i)]),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineEvalConfig } from 'sunpeak/eval';
|
|
2
|
+
|
|
3
|
+
// API keys are loaded automatically from tests/evals/.env (gitignored).
|
|
4
|
+
// See .env.example for the format.
|
|
5
|
+
|
|
6
|
+
export default defineEvalConfig({
|
|
7
|
+
// Server is auto-detected for sunpeak projects.
|
|
8
|
+
// For non-sunpeak projects, uncomment:
|
|
9
|
+
// server: 'http://localhost:8000/mcp',
|
|
10
|
+
|
|
11
|
+
models: [
|
|
12
|
+
// Uncomment models and install their provider packages:
|
|
13
|
+
// 'gpt-4o', // OPENAI_API_KEY
|
|
14
|
+
// 'gpt-4o-mini', // OPENAI_API_KEY
|
|
15
|
+
// 'o4-mini', // OPENAI_API_KEY
|
|
16
|
+
// 'claude-sonnet-4-20250514', // ANTHROPIC_API_KEY
|
|
17
|
+
// 'gemini-2.0-flash', // GOOGLE_GENERATIVE_AI_API_KEY
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
defaults: {
|
|
21
|
+
runs: 10, // Number of times to run each case per model
|
|
22
|
+
maxSteps: 1, // Max tool call steps per run
|
|
23
|
+
temperature: 0, // 0 for most deterministic results
|
|
24
|
+
timeout: 30_000, // Timeout per run in ms
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import { defineEval } from 'sunpeak/eval';
|
|
3
|
+
|
|
4
|
+
export default defineEval({
|
|
5
|
+
cases: [
|
|
6
|
+
{
|
|
7
|
+
name: 'asks for a map',
|
|
8
|
+
prompt: 'Show me a map of coffee shops near downtown Austin',
|
|
9
|
+
expect: {
|
|
10
|
+
tool: 'show-map',
|
|
11
|
+
args: { query: expect.stringMatching(/coffee/i) },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'asks for nearby places',
|
|
16
|
+
prompt: 'Find me some parks nearby',
|
|
17
|
+
expect: {
|
|
18
|
+
tool: 'show-map',
|
|
19
|
+
args: { query: expect.stringMatching(/park/i) },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import { defineEval } from 'sunpeak/eval';
|
|
3
|
+
|
|
4
|
+
export default defineEval({
|
|
5
|
+
cases: [
|
|
6
|
+
{
|
|
7
|
+
name: 'asks to review a code diff',
|
|
8
|
+
prompt: 'Review my code changes to the auth module',
|
|
9
|
+
expect: { tool: 'review-diff' },
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'asks to draft a social post',
|
|
13
|
+
prompt: 'Write a launch announcement for X and LinkedIn',
|
|
14
|
+
expect: {
|
|
15
|
+
tool: 'review-post',
|
|
16
|
+
args: { platforms: expect.arrayContaining([expect.stringMatching(/x|twitter/i)]) },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'asks to review a purchase',
|
|
21
|
+
prompt: 'Review my order for the Pro plan upgrade',
|
|
22
|
+
expect: { tool: 'review-purchase' },
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
// --- Other assertion patterns ---
|
|
26
|
+
//
|
|
27
|
+
// Multi-step (ordered tool call sequence):
|
|
28
|
+
// {
|
|
29
|
+
// name: 'multi-step flow',
|
|
30
|
+
// prompt: 'Draft a post and then review it',
|
|
31
|
+
// maxSteps: 3,
|
|
32
|
+
// expect: [
|
|
33
|
+
// { tool: 'review-post' },
|
|
34
|
+
// { tool: 'publish-post' },
|
|
35
|
+
// ],
|
|
36
|
+
// },
|
|
37
|
+
//
|
|
38
|
+
// Custom assertion (full access to result):
|
|
39
|
+
// {
|
|
40
|
+
// name: 'custom check',
|
|
41
|
+
// prompt: 'Show me my recent reviews',
|
|
42
|
+
// assert: (result) => {
|
|
43
|
+
// expect(result.toolCalls).toHaveLength(1);
|
|
44
|
+
// expect(result.toolCalls[0].name).toBe('review-diff');
|
|
45
|
+
// },
|
|
46
|
+
// },
|
|
47
|
+
],
|
|
48
|
+
});
|