sunpeak 0.5.22 → 0.5.24

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sunpeak",
3
- "version": "0.5.22",
3
+ "version": "0.5.24",
4
4
  "description": "The MCP App SDK. Quickstart, build, & test your ChatGPT App locally!",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -35,6 +35,8 @@
35
35
  "files": [
36
36
  "dist",
37
37
  "bin",
38
+ "src/dev",
39
+ "src/vite-env.d.ts",
38
40
  "template",
39
41
  "README.md"
40
42
  ],
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Internal development server entry point
3
+ * This file is imported by Vite and bootstraps the ChatGPT simulator
4
+ */
5
+ import { StrictMode } from 'react';
6
+ import { createRoot } from 'react-dom/client';
7
+ import { ChatGPTSimulator, type Simulation } from 'sunpeak';
8
+
9
+ // Dynamically import user's simulations and resources using Vite's resolution
10
+ // @ts-expect-error - These are resolved from the user's project via Vite aliases
11
+ import { SIMULATIONS } from '/src/simulations';
12
+ // @ts-expect-error - Resolved from user's project
13
+ import * as Resources from '/src/components/resources';
14
+ import '/src/styles/globals.css';
15
+
16
+ /**
17
+ * Extract the resource component name from a URI
18
+ * Example: 'ui://CounterResource' -> 'CounterResource'
19
+ */
20
+ function getResourceComponentFromURI(uri: string): React.ComponentType {
21
+ const match = uri.match(/^ui:\/\/(.+)$/);
22
+ if (!match) {
23
+ throw new Error(`Invalid resource URI format: ${uri}. Expected format: ui://ComponentName`);
24
+ }
25
+
26
+ const componentName = match[1];
27
+ const component = Resources[componentName as keyof typeof Resources];
28
+
29
+ if (!component) {
30
+ throw new Error(
31
+ `Resource component "${componentName}" not found. ` +
32
+ `Make sure it's exported from src/components/resources/index.ts`
33
+ );
34
+ }
35
+
36
+ return component as React.ComponentType;
37
+ }
38
+
39
+ // Package the resource component with the simulation
40
+ const simulations: Simulation[] = Object.values(
41
+ SIMULATIONS as Record<string, Omit<Simulation, 'resourceComponent'>>
42
+ ).map((simulation) => ({
43
+ ...simulation,
44
+ resourceComponent: getResourceComponentFromURI(simulation.resource.uri),
45
+ }));
46
+
47
+ // Read app config from package.json or use defaults
48
+ const appName = import.meta.env?.VITE_APP_NAME || 'Sunpeak App';
49
+ const appIcon = import.meta.env?.VITE_APP_ICON || '🌄';
50
+
51
+ createRoot(document.getElementById('root')!).render(
52
+ <StrictMode>
53
+ <ChatGPTSimulator simulations={simulations} appName={appName} appIcon={appIcon} />
54
+ </StrictMode>
55
+ );
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_NAME?: string;
5
+ readonly VITE_APP_ICON?: string;
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv;
10
+ }
@@ -7,103 +7,103 @@
7
7
  "react": {
8
8
  "src": "../../../../node_modules/.pnpm/react@19.2.0/node_modules/react/index.js",
9
9
  "file": "react.js",
10
- "fileHash": "5e97ebff",
10
+ "fileHash": "aff6a14b",
11
11
  "needsInterop": true
12
12
  },
13
13
  "react-dom": {
14
14
  "src": "../../../../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/index.js",
15
15
  "file": "react-dom.js",
16
- "fileHash": "880ee1b2",
16
+ "fileHash": "faa35ce2",
17
17
  "needsInterop": true
18
18
  },
19
19
  "react/jsx-dev-runtime": {
20
20
  "src": "../../../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-dev-runtime.js",
21
21
  "file": "react_jsx-dev-runtime.js",
22
- "fileHash": "bf090b04",
22
+ "fileHash": "a7c268ac",
23
23
  "needsInterop": true
24
24
  },
25
25
  "react/jsx-runtime": {
26
26
  "src": "../../../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js",
27
27
  "file": "react_jsx-runtime.js",
28
- "fileHash": "b2764a2b",
28
+ "fileHash": "35b5a946",
29
29
  "needsInterop": true
30
30
  },
31
31
  "@openai/apps-sdk-ui/components/Button": {
32
32
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Button/index.js",
33
33
  "file": "@openai_apps-sdk-ui_components_Button.js",
34
- "fileHash": "955b346f",
34
+ "fileHash": "fca5c1ff",
35
35
  "needsInterop": false
36
36
  },
37
37
  "@openai/apps-sdk-ui/components/Checkbox": {
38
38
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Checkbox/index.js",
39
39
  "file": "@openai_apps-sdk-ui_components_Checkbox.js",
40
- "fileHash": "beff11ef",
40
+ "fileHash": "9788fdc7",
41
41
  "needsInterop": false
42
42
  },
43
43
  "@openai/apps-sdk-ui/components/Icon": {
44
44
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Icon/index.js",
45
45
  "file": "@openai_apps-sdk-ui_components_Icon.js",
46
- "fileHash": "86bf8628",
46
+ "fileHash": "8dc696e6",
47
47
  "needsInterop": false
48
48
  },
49
49
  "@openai/apps-sdk-ui/components/Input": {
50
50
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/index.js",
51
51
  "file": "@openai_apps-sdk-ui_components_Input.js",
52
- "fileHash": "a897a12c",
52
+ "fileHash": "35c25a2d",
53
53
  "needsInterop": false
54
54
  },
55
55
  "@openai/apps-sdk-ui/components/SegmentedControl": {
56
56
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/SegmentedControl/index.js",
57
57
  "file": "@openai_apps-sdk-ui_components_SegmentedControl.js",
58
- "fileHash": "e94930b3",
58
+ "fileHash": "cc5d244a",
59
59
  "needsInterop": false
60
60
  },
61
61
  "@openai/apps-sdk-ui/components/Select": {
62
62
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Select/index.js",
63
63
  "file": "@openai_apps-sdk-ui_components_Select.js",
64
- "fileHash": "5be987d1",
64
+ "fileHash": "b14811fb",
65
65
  "needsInterop": false
66
66
  },
67
67
  "@openai/apps-sdk-ui/components/Textarea": {
68
68
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/index.js",
69
69
  "file": "@openai_apps-sdk-ui_components_Textarea.js",
70
- "fileHash": "30cb72ae",
70
+ "fileHash": "6c8019b0",
71
71
  "needsInterop": false
72
72
  },
73
73
  "@openai/apps-sdk-ui/theme": {
74
74
  "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/lib/theme.js",
75
75
  "file": "@openai_apps-sdk-ui_theme.js",
76
- "fileHash": "377e677b",
76
+ "fileHash": "9c216025",
77
77
  "needsInterop": false
78
78
  },
79
79
  "clsx": {
80
80
  "src": "../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs",
81
81
  "file": "clsx.js",
82
- "fileHash": "cf29f740",
82
+ "fileHash": "6ba48f39",
83
83
  "needsInterop": false
84
84
  },
85
85
  "embla-carousel-react": {
86
86
  "src": "../../../../node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.0/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js",
87
87
  "file": "embla-carousel-react.js",
88
- "fileHash": "f4b0bdf0",
88
+ "fileHash": "2eea840e",
89
89
  "needsInterop": false
90
90
  },
91
91
  "embla-carousel-wheel-gestures": {
92
92
  "src": "../../../../node_modules/.pnpm/embla-carousel-wheel-gestures@8.1.0_embla-carousel@8.6.0/node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js",
93
93
  "file": "embla-carousel-wheel-gestures.js",
94
- "fileHash": "3d1f0231",
94
+ "fileHash": "7a7a03df",
95
95
  "needsInterop": false
96
96
  },
97
97
  "react-dom/client": {
98
98
  "src": "../../../../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/client.js",
99
99
  "file": "react-dom_client.js",
100
- "fileHash": "c8abef68",
100
+ "fileHash": "7347d1d4",
101
101
  "needsInterop": true
102
102
  },
103
103
  "tailwind-merge": {
104
104
  "src": "../../../../node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs",
105
105
  "file": "tailwind-merge.js",
106
- "fileHash": "eb53d303",
106
+ "fileHash": "c3f099f9",
107
107
  "needsInterop": false
108
108
  }
109
109
  },
@@ -1 +1 @@
1
- {"version":"4.0.13","results":[[":src/components/resources/carousel-resource.test.tsx",{"duration":259.88389400000005,"failed":false}],[":src/components/album/albums.test.tsx",{"duration":341.28979900000013,"failed":false}],[":src/components/album/fullscreen-viewer.test.tsx",{"duration":283.4897199999996,"failed":false}],[":src/components/resources/counter-resource.test.tsx",{"duration":285.84662400000025,"failed":false}],[":src/components/carousel/carousel.test.tsx",{"duration":88.71494199999961,"failed":false}],[":src/components/resources/albums-resource.test.tsx",{"duration":269.99957399999994,"failed":false}],[":src/components/album/album-card.test.tsx",{"duration":342.6998169999997,"failed":false}],[":src/components/album/film-strip.test.tsx",{"duration":464.15772000000015,"failed":false}],[":src/components/card/card.test.tsx",{"duration":58.04843400000004,"failed":false}]]}
1
+ {"version":"4.0.13","results":[[":src/components/resources/carousel-resource.test.tsx",{"duration":248.93164500000012,"failed":false}],[":src/components/album/albums.test.tsx",{"duration":331.9551630000001,"failed":false}],[":src/components/album/fullscreen-viewer.test.tsx",{"duration":271.68165100000033,"failed":false}],[":src/components/carousel/carousel.test.tsx",{"duration":85.10066999999981,"failed":false}],[":src/components/resources/counter-resource.test.tsx",{"duration":309.50855,"failed":false}],[":src/components/resources/albums-resource.test.tsx",{"duration":266.88438199999996,"failed":false}],[":src/components/album/film-strip.test.tsx",{"duration":450.94865400000003,"failed":false}],[":src/components/album/album-card.test.tsx",{"duration":337.2684140000001,"failed":false}],[":src/components/card/card.test.tsx",{"duration":53.31707600000004,"failed":false}]]}