sunpeak 0.5.8 → 0.5.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.
Files changed (43) hide show
  1. package/README.md +13 -11
  2. package/bin/sunpeak.js +3 -3
  3. package/dist/chatgpt/mock-openai.d.ts +7 -0
  4. package/dist/chatgpt/simple-sidebar.d.ts +38 -0
  5. package/dist/chatgpt/theme-provider.d.ts +2 -2
  6. package/dist/index.cjs +7733 -199
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +7734 -201
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp/index.cjs +80 -106
  11. package/dist/mcp/index.cjs.map +1 -1
  12. package/dist/mcp/index.js +80 -106
  13. package/dist/mcp/index.js.map +1 -1
  14. package/dist/style.css +2890 -315
  15. package/package.json +6 -5
  16. package/template/README.md +1 -0
  17. package/template/dev/main.tsx +6 -10
  18. package/template/package.json +5 -4
  19. package/template/scripts/build-all.mjs +19 -10
  20. package/template/scripts/validate.mjs +8 -2
  21. package/template/src/components/album/album-card.test.tsx +62 -0
  22. package/template/src/components/album/album-card.tsx +14 -16
  23. package/template/src/components/album/albums.test.tsx +88 -0
  24. package/template/src/components/album/albums.tsx +50 -64
  25. package/template/src/components/album/film-strip.test.tsx +64 -0
  26. package/template/src/components/album/film-strip.tsx +16 -16
  27. package/template/src/components/album/fullscreen-viewer.test.tsx +77 -0
  28. package/template/src/components/album/fullscreen-viewer.tsx +45 -50
  29. package/template/src/components/card/card.test.tsx +1 -4
  30. package/template/src/components/card/card.tsx +38 -46
  31. package/template/src/components/carousel/carousel.tsx +57 -67
  32. package/template/src/components/resources/{AlbumsResource.tsx → albums-resource.tsx} +5 -5
  33. package/template/src/components/resources/{CarouselResource.tsx → carousel-resource.tsx} +18 -18
  34. package/template/src/components/resources/{CounterResource.tsx → counter-resource.tsx} +11 -31
  35. package/template/src/components/resources/index.ts +3 -3
  36. package/template/src/simulations/albums-simulation.ts +71 -71
  37. package/template/src/simulations/carousel-simulation.ts +34 -34
  38. package/template/src/simulations/counter-simulation.ts +2 -2
  39. package/template/vite.config.build.ts +2 -2
  40. package/template/vite.config.ts +1 -1
  41. package/template/vitest.config.ts +1 -1
  42. package/dist/runtime/index.d.ts +0 -7
  43. /package/dist/{runtime → providers}/provider-detection.d.ts +0 -0
@@ -1,3 +1,3 @@
1
- export { CounterResource } from './CounterResource';
2
- export { AlbumsResource } from './AlbumsResource';
3
- export { CarouselResource } from './CarouselResource';
1
+ export { CounterResource } from './counter-resource';
2
+ export { AlbumsResource } from './albums-resource';
3
+ export { CarouselResource } from './carousel-resource';
@@ -6,114 +6,114 @@
6
6
  const albumsData = {
7
7
  albums: [
8
8
  {
9
- id: "summer-escape",
10
- title: "Summer Slice",
11
- cover: "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png",
9
+ id: 'summer-escape',
10
+ title: 'Summer Slice',
11
+ cover: 'https://persistent.oaistatic.com/pizzaz/pizzaz-1.png',
12
12
  photos: [
13
13
  {
14
- id: "s1",
15
- title: "Waves",
16
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
14
+ id: 's1',
15
+ title: 'Waves',
16
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-2.png',
17
17
  },
18
18
  {
19
- id: "s2",
20
- title: "Palm trees",
21
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png"
19
+ id: 's2',
20
+ title: 'Palm trees',
21
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-3.png',
22
22
  },
23
23
  {
24
- id: "s3",
25
- title: "Sunset",
26
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
27
- }
28
- ]
24
+ id: 's3',
25
+ title: 'Sunset',
26
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-6.png',
27
+ },
28
+ ],
29
29
  },
30
30
  {
31
- id: "city-lights",
32
- title: "Pepperoni Nights",
33
- cover: "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png",
31
+ id: 'city-lights',
32
+ title: 'Pepperoni Nights',
33
+ cover: 'https://persistent.oaistatic.com/pizzaz/pizzaz-4.png',
34
34
  photos: [
35
35
  {
36
- id: "c1",
37
- title: "Downtown",
38
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
36
+ id: 'c1',
37
+ title: 'Downtown',
38
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-5.png',
39
39
  },
40
40
  {
41
- id: "c2",
42
- title: "Neon",
43
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png"
41
+ id: 'c2',
42
+ title: 'Neon',
43
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-1.png',
44
44
  },
45
45
  {
46
- id: "c3",
47
- title: "Streets",
48
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
49
- }
50
- ]
46
+ id: 'c3',
47
+ title: 'Streets',
48
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-2.png',
49
+ },
50
+ ],
51
51
  },
52
52
  {
53
- id: "into-the-woods",
54
- title: "Truffle Forest",
55
- cover: "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png",
53
+ id: 'into-the-woods',
54
+ title: 'Truffle Forest',
55
+ cover: 'https://persistent.oaistatic.com/pizzaz/pizzaz-3.png',
56
56
  photos: [
57
57
  {
58
- id: "n1",
59
- title: "Forest path",
60
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
58
+ id: 'n1',
59
+ title: 'Forest path',
60
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-6.png',
61
61
  },
62
62
  {
63
- id: "n2",
64
- title: "Misty",
65
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png"
63
+ id: 'n2',
64
+ title: 'Misty',
65
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-4.png',
66
66
  },
67
67
  {
68
- id: "n3",
69
- title: "Waterfall",
70
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
71
- }
72
- ]
68
+ id: 'n3',
69
+ title: 'Waterfall',
70
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-5.png',
71
+ },
72
+ ],
73
73
  },
74
74
  {
75
- id: "pizza-tour",
76
- title: "Pizza tour",
77
- cover: "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png",
75
+ id: 'pizza-tour',
76
+ title: 'Pizza tour',
77
+ cover: 'https://persistent.oaistatic.com/pizzaz/pizzaz-1.png',
78
78
  photos: [
79
79
  {
80
- id: "tonys-pizza-napoletana",
80
+ id: 'tonys-pizza-napoletana',
81
81
  title: "Tony's Pizza Napoletana",
82
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
82
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-2.png',
83
83
  },
84
84
  {
85
- id: "golden-boy-pizza",
86
- title: "Golden Boy Pizza",
87
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png"
85
+ id: 'golden-boy-pizza',
86
+ title: 'Golden Boy Pizza',
87
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-3.png',
88
88
  },
89
89
  {
90
- id: "pizzeria-delfina-mission",
91
- title: "Pizzeria Delfina (Mission)",
92
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
90
+ id: 'pizzeria-delfina-mission',
91
+ title: 'Pizzeria Delfina (Mission)',
92
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-6.png',
93
93
  },
94
94
  {
95
- id: "ragazza",
96
- title: "Ragazza",
97
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png"
95
+ id: 'ragazza',
96
+ title: 'Ragazza',
97
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-4.png',
98
98
  },
99
99
  {
100
- id: "del-popolo",
101
- title: "Del Popolo",
102
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
100
+ id: 'del-popolo',
101
+ title: 'Del Popolo',
102
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-5.png',
103
103
  },
104
104
  {
105
- id: "square-pie-guys",
106
- title: "Square Pie Guys",
107
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png"
105
+ id: 'square-pie-guys',
106
+ title: 'Square Pie Guys',
107
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-1.png',
108
108
  },
109
109
  {
110
- id: "zero-zero",
111
- title: "Zero Zero",
112
- url: "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
113
- }
114
- ]
115
- }
116
- ]
110
+ id: 'zero-zero',
111
+ title: 'Zero Zero',
112
+ url: 'https://persistent.oaistatic.com/pizzaz/pizzaz-2.png',
113
+ },
114
+ ],
115
+ },
116
+ ],
117
117
  };
118
118
 
119
119
  export const albumsSimulation = {
@@ -127,7 +127,7 @@ export const albumsSimulation = {
127
127
  title: 'Show Albums',
128
128
  annotations: { readOnlyHint: true },
129
129
  _meta: {
130
- 'openai/outputTemplate': 'ui://AlbumsResource.tsx',
130
+ 'openai/outputTemplate': 'ui://AlbumsResource',
131
131
  'openai/toolInvocation/invoking': 'Loading albums',
132
132
  'openai/toolInvocation/invoked': 'Album loaded',
133
133
  'openai/widgetAccessible': true,
@@ -139,7 +139,7 @@ export const albumsSimulation = {
139
139
  // resource.name is used as the simulation identifier
140
140
  // resource.title is used as the simulation display label
141
141
  resource: {
142
- uri: 'ui://AlbumsResource.tsx',
142
+ uri: 'ui://AlbumsResource',
143
143
  name: 'albums',
144
144
  title: 'Albums',
145
145
  description: 'Show photo albums widget markup',
@@ -6,51 +6,51 @@
6
6
  const placesData = {
7
7
  places: [
8
8
  {
9
- id: "1",
10
- name: "Lady Bird Lake",
9
+ id: '1',
10
+ name: 'Lady Bird Lake',
11
11
  rating: 4.5,
12
- category: "Waterfront",
13
- location: "Austin",
14
- image: "https://images.unsplash.com/photo-1520950237264-dfe336995c34?w=400&h=400&fit=crop",
15
- description: "Scenic lake perfect for kayaking, paddleboarding, and trails."
12
+ category: 'Waterfront',
13
+ location: 'Austin',
14
+ image: 'https://images.unsplash.com/photo-1520950237264-dfe336995c34?w=400&h=400&fit=crop',
15
+ description: 'Scenic lake perfect for kayaking, paddleboarding, and trails.',
16
16
  },
17
17
  {
18
- id: "2",
19
- name: "Texas State Capitol",
18
+ id: '2',
19
+ name: 'Texas State Capitol',
20
20
  rating: 4.8,
21
- category: "Historic Site",
22
- location: "Austin",
23
- image: "https://images.unsplash.com/photo-1664231978322-4d0b45c7027b?w=400&h=400&fit=crop",
24
- description: "Stunning capitol building with free tours and beautiful grounds."
21
+ category: 'Historic Site',
22
+ location: 'Austin',
23
+ image: 'https://images.unsplash.com/photo-1664231978322-4d0b45c7027b?w=400&h=400&fit=crop',
24
+ description: 'Stunning capitol building with free tours and beautiful grounds.',
25
25
  },
26
26
  {
27
- id: "3",
28
- name: "The Paramount Theatre",
27
+ id: '3',
28
+ name: 'The Paramount Theatre',
29
29
  rating: 4.7,
30
- category: "Architecture",
31
- location: "Austin",
32
- image: "https://images.unsplash.com/photo-1583097090970-4d3b940ea1a0?w=400&h=400&fit=crop",
33
- description: "Century-old performance and movie theatre in the heart of downtown Austin."
30
+ category: 'Architecture',
31
+ location: 'Austin',
32
+ image: 'https://images.unsplash.com/photo-1583097090970-4d3b940ea1a0?w=400&h=400&fit=crop',
33
+ description: 'Century-old performance and movie theatre in the heart of downtown Austin.',
34
34
  },
35
35
  {
36
- id: "4",
37
- name: "Zilker Park",
36
+ id: '4',
37
+ name: 'Zilker Park',
38
38
  rating: 4.7,
39
- category: "Park",
40
- location: "Austin",
41
- image: "https://images.unsplash.com/photo-1563828568124-f800803ba13c?w=400&h=400&fit=crop",
42
- description: "Popular park with trails, sports fields, and Barton Springs Pool."
39
+ category: 'Park',
40
+ location: 'Austin',
41
+ image: 'https://images.unsplash.com/photo-1563828568124-f800803ba13c?w=400&h=400&fit=crop',
42
+ description: 'Popular park with trails, sports fields, and Barton Springs Pool.',
43
43
  },
44
44
  {
45
- id: "5",
46
- name: "South Congress Avenue",
45
+ id: '5',
46
+ name: 'South Congress Avenue',
47
47
  rating: 4.6,
48
- category: "Landmark",
49
- location: "Austin",
50
- image: "https://images.unsplash.com/photo-1588993608283-7f0eda4438be?w=400&h=400&fit=crop",
51
- description: "Vibrant street with unique shops, restaurants, and live music."
52
- }
53
- ]
48
+ category: 'Landmark',
49
+ location: 'Austin',
50
+ image: 'https://images.unsplash.com/photo-1588993608283-7f0eda4438be?w=400&h=400&fit=crop',
51
+ description: 'Vibrant street with unique shops, restaurants, and live music.',
52
+ },
53
+ ],
54
54
  };
55
55
 
56
56
  export const carouselSimulation = {
@@ -64,7 +64,7 @@ export const carouselSimulation = {
64
64
  title: 'Show Carousel',
65
65
  annotations: { readOnlyHint: true },
66
66
  _meta: {
67
- 'openai/outputTemplate': 'ui://CarouselResource.tsx',
67
+ 'openai/outputTemplate': 'ui://CarouselResource',
68
68
  'openai/toolInvocation/invoking': 'Loading carousel',
69
69
  'openai/toolInvocation/invoked': 'Carousel loaded',
70
70
  'openai/widgetAccessible': true,
@@ -76,7 +76,7 @@ export const carouselSimulation = {
76
76
  // resource.name is used as the simulation identifier
77
77
  // resource.title is used as the simulation display label
78
78
  resource: {
79
- uri: 'ui://CarouselResource.tsx',
79
+ uri: 'ui://CarouselResource',
80
80
  name: 'carousel',
81
81
  title: 'Carousel',
82
82
  description: 'Show popular places to visit widget markup',
@@ -13,7 +13,7 @@ export const counterSimulation = {
13
13
  title: 'Show Counter',
14
14
  annotations: { readOnlyHint: true },
15
15
  _meta: {
16
- 'openai/outputTemplate': 'ui://CounterResource.tsx',
16
+ 'openai/outputTemplate': 'ui://CounterResource',
17
17
  'openai/toolInvocation/invoking': 'Counting beans',
18
18
  'openai/toolInvocation/invoked': 'Beans counted',
19
19
  'openai/widgetAccessible': true,
@@ -25,7 +25,7 @@ export const counterSimulation = {
25
25
  // resource.name is used as the simulation identifier
26
26
  // resource.title is used as the simulation display label
27
27
  resource: {
28
- uri: 'ui://CounterResource.tsx',
28
+ uri: 'ui://CounterResource',
29
29
  name: 'counter',
30
30
  title: 'Counter',
31
31
  description: 'Show a simple counter tool widget markup',
@@ -22,7 +22,7 @@ function inlineCssPlugin() {
22
22
 
23
23
  // Find all .js files in the dist directory and inject CSS
24
24
  const files = readdirSync(distDir);
25
- files.forEach(file => {
25
+ files.forEach((file) => {
26
26
  if (file.endsWith('.js')) {
27
27
  const jsFile = path.join(distDir, file);
28
28
  const js = readFileSync(jsFile, 'utf-8');
@@ -46,7 +46,7 @@ export default defineConfig({
46
46
  alias: {
47
47
  // In workspace dev mode, use local sunpeak source
48
48
  ...(isTemplate && {
49
- 'sunpeak': parentSrc,
49
+ sunpeak: parentSrc,
50
50
  '~': parentSrc,
51
51
  }),
52
52
  },
@@ -13,7 +13,7 @@ export default defineConfig({
13
13
  alias: {
14
14
  // In workspace dev mode, use local sunpeak source
15
15
  ...(isTemplate && {
16
- 'sunpeak': parentSrc,
16
+ sunpeak: parentSrc,
17
17
  '~': parentSrc,
18
18
  }),
19
19
  },
@@ -15,7 +15,7 @@ export default defineConfig({
15
15
  alias: {
16
16
  // In workspace dev mode, use local sunpeak source
17
17
  ...(isTemplate && {
18
- 'sunpeak': parentSrc,
18
+ sunpeak: parentSrc,
19
19
  '~': parentSrc,
20
20
  }),
21
21
  },
@@ -1,7 +0,0 @@
1
- /**
2
- * Runtime utilities for widget environments.
3
- *
4
- * This module contains runtime-specific logic like provider detection
5
- * that needs to know about concrete provider implementations.
6
- */
7
- export { detectProvider, isProviderAvailable, resetProviderCache, } from './provider-detection';