sunpeak 0.14.3 → 0.15.1
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 +32 -28
- package/bin/commands/build.mjs +2 -1
- package/bin/commands/dev.mjs +72 -2
- package/dist/chatgpt/{conversation.d.ts → chatgpt-conversation.d.ts} +1 -1
- package/dist/chatgpt/chatgpt-host.d.ts +1 -0
- package/dist/chatgpt/globals.css +618 -6156
- package/dist/chatgpt/index.cjs +11 -8
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +10 -32
- package/dist/chatgpt/index.js +15 -12
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/claude/claude-conversation.d.ts +23 -0
- package/dist/claude/claude-host.d.ts +1 -0
- package/dist/claude/index.cjs +6 -0
- package/dist/claude/index.cjs.map +1 -0
- package/dist/claude/index.d.ts +1 -0
- package/dist/claude/index.js +6 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude-host-C7KPfOM8.cjs +284 -0
- package/dist/claude-host-C7KPfOM8.cjs.map +1 -0
- package/dist/claude-host-CaD7ptbt.js +283 -0
- package/dist/claude-host-CaD7ptbt.js.map +1 -0
- package/dist/{discovery-COZUnY6a.js → discovery-DzV3HLXs.js} +5 -5
- package/dist/{discovery-COZUnY6a.js.map → discovery-DzV3HLXs.js.map} +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/use-app-tools.d.ts +44 -0
- package/dist/hooks/use-update-model-context.d.ts +29 -0
- package/dist/index-BKrboRah.js +44 -0
- package/dist/index-BKrboRah.js.map +1 -0
- package/dist/index-BSKuY-oH.cjs +527 -0
- package/dist/index-BSKuY-oH.cjs.map +1 -0
- package/dist/index-CiqvXo8n.js +512 -0
- package/dist/index-CiqvXo8n.js.map +1 -0
- package/dist/index-Dr-L0Nb3.cjs +43 -0
- package/dist/index-Dr-L0Nb3.cjs.map +1 -0
- package/dist/index.cjs +1705 -1647
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2732 -2675
- package/dist/index.js.map +1 -1
- package/dist/lib/default-style-variables.d.ts +2 -0
- package/dist/lib/discovery-cli.js +1 -1
- package/dist/mcp/index.cjs +86 -27
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +3 -1
- package/dist/mcp/index.js +85 -26
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.d.ts +4 -3
- package/dist/mcp/types.d.ts +11 -0
- package/dist/platform/chatgpt/index.cjs +1 -1
- package/dist/platform/chatgpt/index.js +1 -1
- package/dist/platform/index.cjs +3 -0
- package/dist/platform/index.cjs.map +1 -1
- package/dist/platform/index.d.ts +3 -1
- package/dist/platform/index.js +3 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/{protocol-BQCnIrc9.js → protocol-DFbsCx7E.js} +29 -29
- package/dist/{protocol-BQCnIrc9.js.map → protocol-DFbsCx7E.js.map} +1 -1
- package/dist/simulator/host-styles.d.ts +5 -0
- package/dist/simulator/hosts.d.ts +73 -0
- package/dist/{chatgpt → simulator}/iframe-resource.d.ts +27 -3
- package/dist/simulator/index.cjs +40 -0
- package/dist/simulator/index.cjs.map +1 -0
- package/dist/simulator/index.d.ts +18 -0
- package/dist/simulator/index.js +40 -0
- package/dist/simulator/index.js.map +1 -0
- package/dist/{chatgpt → simulator}/mcp-app-host.d.ts +8 -1
- package/dist/simulator/mock-openai-runtime.d.ts +20 -0
- package/dist/{chatgpt → simulator}/simulator-url.d.ts +8 -1
- package/dist/simulator/simulator.d.ts +12 -0
- package/dist/{chatgpt → simulator}/theme-provider.d.ts +3 -1
- package/dist/simulator/use-simulator-state.d.ts +91 -0
- package/dist/simulator-BqZmzFVR.cjs +8214 -0
- package/dist/simulator-BqZmzFVR.cjs.map +1 -0
- package/dist/simulator-CMgCGNuD.js +8199 -0
- package/dist/simulator-CMgCGNuD.js.map +1 -0
- package/dist/simulator-url-BQ-7SMht.js +335 -0
- package/dist/simulator-url-BQ-7SMht.js.map +1 -0
- package/dist/simulator-url-uNqOCaPJ.cjs +334 -0
- package/dist/simulator-url-uNqOCaPJ.cjs.map +1 -0
- package/dist/style.css +558 -6143
- package/dist/types/runtime.d.ts +1 -1
- package/dist/{use-app-D7kRAPSG.cjs → use-app-BnoSPiUT.cjs} +2 -1
- package/dist/{use-app-D7kRAPSG.cjs.map → use-app-BnoSPiUT.cjs.map} +1 -1
- package/dist/{use-app-Dvr4LKs2.js → use-app-D_TeaMFG.js} +4 -3
- package/dist/{use-app-Dvr4LKs2.js.map → use-app-D_TeaMFG.js.map} +1 -1
- package/package.json +18 -3
- package/template/.sunpeak/dev.tsx +4 -4
- package/template/.sunpeak/resource-loader.html +1 -1
- package/template/node_modules/.bin/nodemon +2 -2
- package/template/node_modules/.bin/playwright +2 -2
- package/template/node_modules/.bin/sunpeak +2 -2
- package/template/node_modules/.bin/tsc +2 -2
- package/template/node_modules/.bin/tsserver +2 -2
- package/template/node_modules/.bin/tsx +2 -2
- package/template/node_modules/.bin/vite +2 -2
- package/template/src/components/avatar.tsx +4 -1
- package/template/src/components/button.tsx +17 -20
- package/template/src/resources/albums/albums-resource.tsx +2 -3
- package/template/src/resources/albums/components/album-card.tsx +4 -2
- package/template/src/resources/albums/components/film-strip.test.tsx +2 -2
- package/template/src/resources/albums/components/film-strip.tsx +2 -2
- package/template/src/resources/albums/components/fullscreen-viewer.tsx +7 -5
- package/template/src/resources/carousel/carousel-resource.tsx +2 -3
- package/template/src/resources/carousel/components/card.test.tsx +3 -2
- package/template/src/resources/carousel/components/card.tsx +8 -4
- package/template/src/resources/map/components/map-view.tsx +1 -1
- package/template/src/resources/map/components/map.tsx +1 -1
- package/template/src/resources/map/components/place-card.tsx +8 -4
- package/template/src/resources/map/components/place-carousel.tsx +1 -1
- package/template/src/resources/map/components/place-inspector.tsx +15 -7
- package/template/src/resources/map/components/place-list.tsx +7 -4
- package/template/src/resources/map/map-resource.tsx +0 -2
- package/template/src/resources/review/review-resource.tsx +61 -27
- package/template/tests/e2e/albums.spec.ts +118 -102
- package/template/tests/e2e/carousel.spec.ts +103 -100
- package/template/tests/e2e/map.spec.ts +220 -181
- package/template/tests/e2e/review.spec.ts +224 -198
- package/dist/_commonjsHelpers-Bc2YnDe1.cjs +0 -8
- package/dist/_commonjsHelpers-Bc2YnDe1.cjs.map +0 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
- package/dist/index-CJ3jfcjj.js +0 -15131
- package/dist/index-CJ3jfcjj.js.map +0 -1
- package/dist/index-Cdeg96So.cjs +0 -15147
- package/dist/index-Cdeg96So.cjs.map +0 -1
- /package/dist/{chatgpt → simulator}/simple-sidebar.d.ts +0 -0
- /package/dist/{chatgpt/chatgpt-simulator-types.d.ts → simulator/simulator-types.d.ts} +0 -0
|
@@ -1,128 +1,131 @@
|
|
|
1
1
|
import { test, expect } from '@playwright/test';
|
|
2
2
|
import { createSimulatorUrl } from 'sunpeak/chatgpt';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
const hosts = ['chatgpt', 'claude'] as const;
|
|
5
|
+
|
|
6
|
+
for (const host of hosts) {
|
|
7
|
+
test.describe(`Carousel Resource [${host}]`, () => {
|
|
8
|
+
test.describe('Light Mode', () => {
|
|
9
|
+
test('should render carousel cards with correct styles', async ({ page }) => {
|
|
10
|
+
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'light', host }));
|
|
11
|
+
|
|
12
|
+
const iframe = page.frameLocator('iframe');
|
|
13
|
+
const card = iframe.locator('.rounded-2xl').first();
|
|
14
|
+
await expect(card).toBeVisible();
|
|
15
|
+
|
|
16
|
+
const styles = await card.evaluate((el) => {
|
|
17
|
+
const computed = window.getComputedStyle(el);
|
|
18
|
+
return {
|
|
19
|
+
borderRadius: computed.borderRadius,
|
|
20
|
+
cursor: computed.cursor,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(styles.borderRadius).toBe('16px'); // rounded-2xl
|
|
25
|
+
expect(styles.cursor).toBe('pointer');
|
|
19
26
|
});
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
28
|
+
test('should have card with border styling', async ({ page }) => {
|
|
29
|
+
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'light', host }));
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
const iframe = page.frameLocator('iframe');
|
|
32
|
+
const card = iframe.locator('.rounded-2xl.border').first();
|
|
33
|
+
await expect(card).toBeVisible();
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
const styles = await card.evaluate((el) => {
|
|
36
|
+
const computed = window.getComputedStyle(el);
|
|
37
|
+
return {
|
|
38
|
+
borderWidth: computed.borderWidth,
|
|
39
|
+
borderStyle: computed.borderStyle,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
31
42
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
borderWidth: computed.borderWidth,
|
|
36
|
-
borderStyle: computed.borderStyle,
|
|
37
|
-
};
|
|
43
|
+
expect(styles.borderWidth).toBe('1px');
|
|
44
|
+
expect(styles.borderStyle).toBe('solid');
|
|
38
45
|
});
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
47
|
+
test('should have interactive buttons', async ({ page }) => {
|
|
48
|
+
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'light', host }));
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
const iframe = page.frameLocator('iframe');
|
|
51
|
+
const visitButton = iframe.locator('button:has-text("Visit")').first();
|
|
52
|
+
await expect(visitButton).toBeAttached();
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
const styles = await visitButton.evaluate((el) => {
|
|
55
|
+
const computed = window.getComputedStyle(el);
|
|
56
|
+
return {
|
|
57
|
+
cursor: computed.cursor,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
const computed = window.getComputedStyle(el);
|
|
53
|
-
return {
|
|
54
|
-
cursor: computed.cursor,
|
|
55
|
-
};
|
|
61
|
+
expect(styles.cursor).toBe('pointer');
|
|
56
62
|
});
|
|
57
|
-
|
|
58
|
-
expect(styles.cursor).toBe('pointer');
|
|
59
63
|
});
|
|
60
|
-
});
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
test.describe('Dark Mode', () => {
|
|
66
|
+
test('should render carousel cards with correct styles', async ({ page }) => {
|
|
67
|
+
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'dark', host }));
|
|
68
|
+
|
|
69
|
+
const iframe = page.frameLocator('iframe');
|
|
70
|
+
const card = iframe.locator('.rounded-2xl').first();
|
|
71
|
+
await expect(card).toBeVisible();
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
const styles = await card.evaluate((el) => {
|
|
74
|
+
const computed = window.getComputedStyle(el);
|
|
75
|
+
return {
|
|
76
|
+
borderRadius: computed.borderRadius,
|
|
77
|
+
cursor: computed.cursor,
|
|
78
|
+
};
|
|
79
|
+
});
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
borderRadius: computed.borderRadius,
|
|
74
|
-
cursor: computed.cursor,
|
|
75
|
-
};
|
|
81
|
+
expect(styles.borderRadius).toBe('16px'); // rounded-2xl
|
|
82
|
+
expect(styles.cursor).toBe('pointer');
|
|
76
83
|
});
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
85
|
+
test('should have appropriate styling for dark mode', async ({ page }) => {
|
|
86
|
+
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'dark', host }));
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
const iframe = page.frameLocator('iframe');
|
|
89
|
+
// Select card by its border + rounded combo
|
|
90
|
+
const card = iframe.locator('.rounded-2xl.border').first();
|
|
91
|
+
await expect(card).toBeVisible();
|
|
84
92
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
const styles = await card.evaluate((el) => {
|
|
94
|
+
const computed = window.getComputedStyle(el);
|
|
95
|
+
return {
|
|
96
|
+
borderWidth: computed.borderWidth,
|
|
97
|
+
borderStyle: computed.borderStyle,
|
|
98
|
+
};
|
|
99
|
+
});
|
|
88
100
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
backgroundColor: computed.backgroundColor,
|
|
93
|
-
};
|
|
101
|
+
expect(styles.borderWidth).toBe('1px');
|
|
102
|
+
expect(styles.borderStyle).toBe('solid');
|
|
94
103
|
});
|
|
95
104
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
test('should load without console errors', async ({ page }) => {
|
|
106
|
+
const errors: string[] = [];
|
|
107
|
+
page.on('console', (msg) => {
|
|
108
|
+
if (msg.type() === 'error') {
|
|
109
|
+
errors.push(msg.text());
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'dark', host }));
|
|
114
|
+
|
|
115
|
+
// Wait for iframe content to render
|
|
116
|
+
const iframe = page.frameLocator('iframe');
|
|
117
|
+
await expect(iframe.locator('.rounded-2xl').first()).toBeVisible();
|
|
118
|
+
|
|
119
|
+
// Filter out expected iframe/MCP handshake errors
|
|
120
|
+
const unexpectedErrors = errors.filter(
|
|
121
|
+
(e) =>
|
|
122
|
+
!e.includes('[IframeResource]') &&
|
|
123
|
+
!e.includes('mcp') &&
|
|
124
|
+
!e.includes('PostMessage') &&
|
|
125
|
+
!e.includes('connect')
|
|
126
|
+
);
|
|
127
|
+
expect(unexpectedErrors).toHaveLength(0);
|
|
107
128
|
});
|
|
108
|
-
|
|
109
|
-
await page.goto(createSimulatorUrl({ simulation: 'carousel-show', theme: 'dark' }));
|
|
110
|
-
|
|
111
|
-
// Wait for iframe content to render
|
|
112
|
-
const iframe = page.frameLocator('iframe');
|
|
113
|
-
await expect(iframe.locator('.rounded-2xl').first()).toBeVisible();
|
|
114
|
-
|
|
115
|
-
// Filter out expected iframe/MCP handshake errors
|
|
116
|
-
const unexpectedErrors = errors.filter(
|
|
117
|
-
(e) =>
|
|
118
|
-
!e.includes('[IframeResource]') &&
|
|
119
|
-
!e.includes('mcp') &&
|
|
120
|
-
!e.includes('PostMessage') &&
|
|
121
|
-
!e.includes('connect')
|
|
122
|
-
);
|
|
123
|
-
expect(unexpectedErrors).toHaveLength(0);
|
|
124
129
|
});
|
|
125
130
|
});
|
|
126
|
-
|
|
127
|
-
// Note: No fullscreen test for carousel as per requirements
|
|
128
|
-
});
|
|
131
|
+
}
|