sunpeak 0.5.22 → 0.5.23

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.23",
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 '../index';
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
+ }
@@ -2,13 +2,13 @@ import {
2
2
  Button,
3
3
  ButtonLink,
4
4
  CopyButton
5
- } from "./chunk-EVJ3DVH5.js";
5
+ } from "./chunk-LR7NKCX5.js";
6
6
  import "./chunk-YOJ6QPGS.js";
7
- import "./chunk-BAG6OO6S.js";
8
- import "./chunk-XB525PXG.js";
9
7
  import "./chunk-QPJAV452.js";
8
+ import "./chunk-BAG6OO6S.js";
10
9
  import "./chunk-EGRHWZRV.js";
11
10
  import "./chunk-CNYJBM5F.js";
11
+ import "./chunk-XB525PXG.js";
12
12
  import "./chunk-PTVT3RFX.js";
13
13
  import "./chunk-4TLBUCVB.js";
14
14
  import "./chunk-ILHRZGIS.js";
@@ -5,11 +5,11 @@ import {
5
5
  handlePressableMouseEnter,
6
6
  waitForAnimationFrame
7
7
  } from "./chunk-BAG6OO6S.js";
8
+ import "./chunk-EGRHWZRV.js";
8
9
  import {
9
10
  dist_exports4 as dist_exports
10
11
  } from "./chunk-SGWD4VEU.js";
11
12
  import "./chunk-KFGKZMLK.js";
12
- import "./chunk-EGRHWZRV.js";
13
13
  import {
14
14
  clsx_default
15
15
  } from "./chunk-CNYJBM5F.js";
@@ -1,23 +1,33 @@
1
+ import {
2
+ Input
3
+ } from "./chunk-CQ3GYAYB.js";
1
4
  import {
2
5
  Button,
3
6
  LoadingIndicator,
4
7
  TransitionGroup
5
- } from "./chunk-EVJ3DVH5.js";
8
+ } from "./chunk-LR7NKCX5.js";
6
9
  import {
7
10
  useTimeout
8
11
  } from "./chunk-YOJ6QPGS.js";
12
+ import {
13
+ o
14
+ } from "./chunk-QPJAV452.js";
9
15
  import {
10
16
  handlePressableMouseEnter,
11
17
  preventDefaultHandler,
12
18
  toCssVariables,
13
19
  waitForAnimationFrame
14
20
  } from "./chunk-BAG6OO6S.js";
21
+ import "./chunk-EGRHWZRV.js";
15
22
  import {
16
23
  dist_exports,
17
24
  dist_exports3 as dist_exports2,
18
25
  dist_exports5 as dist_exports3
19
26
  } from "./chunk-SGWD4VEU.js";
20
27
  import "./chunk-KFGKZMLK.js";
28
+ import {
29
+ clsx_default
30
+ } from "./chunk-CNYJBM5F.js";
21
31
  import {
22
32
  Check_default,
23
33
  ChevronDownVector_default,
@@ -26,16 +36,6 @@ import {
26
36
  Search_default,
27
37
  X_default
28
38
  } from "./chunk-XB525PXG.js";
29
- import {
30
- Input
31
- } from "./chunk-CQ3GYAYB.js";
32
- import {
33
- o
34
- } from "./chunk-QPJAV452.js";
35
- import "./chunk-EGRHWZRV.js";
36
- import {
37
- clsx_default
38
- } from "./chunk-CNYJBM5F.js";
39
39
  import {
40
40
  require_jsx_runtime
41
41
  } from "./chunk-PTVT3RFX.js";
@@ -1,9 +1,9 @@
1
- import {
2
- toCssVariables
3
- } from "./chunk-BAG6OO6S.js";
4
1
  import {
5
2
  o
6
3
  } from "./chunk-QPJAV452.js";
4
+ import {
5
+ toCssVariables
6
+ } from "./chunk-BAG6OO6S.js";
7
7
  import "./chunk-EGRHWZRV.js";
8
8
  import {
9
9
  clsx_default
@@ -7,137 +7,137 @@
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": "e5b4d143",
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": "699b2897",
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": "2ce5fe19",
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": "cead11d1",
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": "8c39987e",
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": "3a478b53",
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": "168189da",
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": "17b4296e",
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": "c061f271",
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": "a1366c37",
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": "573609cd",
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": "d710ed90",
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": "3a77c971",
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": "4bbffb1f",
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": "f04d0981",
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": "8e9cc044",
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": "7de19c33",
107
107
  "needsInterop": false
108
108
  }
109
109
  },
110
110
  "chunks": {
111
- "chunk-EVJ3DVH5": {
112
- "file": "chunk-EVJ3DVH5.js"
111
+ "chunk-CQ3GYAYB": {
112
+ "file": "chunk-CQ3GYAYB.js"
113
+ },
114
+ "chunk-LR7NKCX5": {
115
+ "file": "chunk-LR7NKCX5.js"
113
116
  },
114
117
  "chunk-YOJ6QPGS": {
115
118
  "file": "chunk-YOJ6QPGS.js"
116
119
  },
120
+ "chunk-QPJAV452": {
121
+ "file": "chunk-QPJAV452.js"
122
+ },
117
123
  "chunk-BAG6OO6S": {
118
124
  "file": "chunk-BAG6OO6S.js"
119
125
  },
126
+ "chunk-EGRHWZRV": {
127
+ "file": "chunk-EGRHWZRV.js"
128
+ },
120
129
  "chunk-SGWD4VEU": {
121
130
  "file": "chunk-SGWD4VEU.js"
122
131
  },
123
132
  "chunk-KFGKZMLK": {
124
133
  "file": "chunk-KFGKZMLK.js"
125
134
  },
126
- "chunk-XB525PXG": {
127
- "file": "chunk-XB525PXG.js"
128
- },
129
- "chunk-CQ3GYAYB": {
130
- "file": "chunk-CQ3GYAYB.js"
131
- },
132
- "chunk-QPJAV452": {
133
- "file": "chunk-QPJAV452.js"
134
- },
135
- "chunk-EGRHWZRV": {
136
- "file": "chunk-EGRHWZRV.js"
137
- },
138
135
  "chunk-CNYJBM5F": {
139
136
  "file": "chunk-CNYJBM5F.js"
140
137
  },
138
+ "chunk-XB525PXG": {
139
+ "file": "chunk-XB525PXG.js"
140
+ },
141
141
  "chunk-PTVT3RFX": {
142
142
  "file": "chunk-PTVT3RFX.js"
143
143
  },
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  useTimeout
3
3
  } from "./chunk-YOJ6QPGS.js";
4
+ import {
5
+ o
6
+ } from "./chunk-QPJAV452.js";
4
7
  import {
5
8
  handlePressableMouseEnter,
6
9
  isDev,
@@ -12,16 +15,13 @@ import {
12
15
  toTransformProperty,
13
16
  waitForAnimationFrame
14
17
  } from "./chunk-BAG6OO6S.js";
18
+ import {
19
+ clsx_default
20
+ } from "./chunk-CNYJBM5F.js";
15
21
  import {
16
22
  Check_default,
17
23
  Copy_default
18
24
  } from "./chunk-XB525PXG.js";
19
- import {
20
- o
21
- } from "./chunk-QPJAV452.js";
22
- import {
23
- clsx_default
24
- } from "./chunk-CNYJBM5F.js";
25
25
  import {
26
26
  require_jsx_runtime
27
27
  } from "./chunk-PTVT3RFX.js";
@@ -625,4 +625,4 @@ export {
625
625
  ButtonLink,
626
626
  CopyButton
627
627
  };
628
- //# sourceMappingURL=chunk-EVJ3DVH5.js.map
628
+ //# sourceMappingURL=chunk-LR7NKCX5.js.map
@@ -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":268.6208109999998,"failed":false}],[":src/components/album/albums.test.tsx",{"duration":349.67035999999985,"failed":false}],[":src/components/album/fullscreen-viewer.test.tsx",{"duration":288.14203799999996,"failed":false}],[":src/components/resources/counter-resource.test.tsx",{"duration":330.01838399999997,"failed":false}],[":src/components/carousel/carousel.test.tsx",{"duration":60.49365499999976,"failed":false}],[":src/components/resources/albums-resource.test.tsx",{"duration":284.34399200000007,"failed":false}],[":src/components/album/album-card.test.tsx",{"duration":338.0192069999998,"failed":false}],[":src/components/album/film-strip.test.tsx",{"duration":441.93048599999975,"failed":false}],[":src/components/card/card.test.tsx",{"duration":54.51466899999991,"failed":false}]]}