sunpeak 0.9.10 → 0.10.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/bin/commands/build.mjs +56 -30
- package/bin/commands/deploy.mjs +17 -17
- package/bin/commands/push.mjs +115 -64
- package/bin/lib/patterns.mjs +40 -0
- package/bin/sunpeak.js +50 -106
- package/dist/chatgpt/index.cjs +1 -1
- package/dist/chatgpt/index.js +1 -1
- package/dist/index.cjs +150 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +167 -29
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery.d.ts +76 -13
- package/dist/mcp/entry.cjs +24 -27
- package/dist/mcp/entry.cjs.map +1 -1
- package/dist/mcp/entry.js +25 -28
- package/dist/mcp/entry.js.map +1 -1
- package/dist/{simulator-url-wBi-pko3.js → simulator-url-BZBcq5tc.js} +9 -16
- package/dist/{simulator-url-wBi-pko3.js.map → simulator-url-BZBcq5tc.js.map} +1 -1
- package/dist/{simulator-url-oevkxbU4.cjs → simulator-url-D4tFBjeu.cjs} +10 -17
- package/dist/{simulator-url-oevkxbU4.cjs.map → simulator-url-D4tFBjeu.cjs.map} +1 -1
- package/package.json +1 -1
- package/template/.sunpeak/dev.tsx +5 -5
- package/template/README.md +54 -50
- package/template/dist/{albums.json → albums/albums.json} +1 -1
- package/template/dist/{carousel.json → carousel/carousel.json} +1 -1
- package/template/dist/{map.json → map/map.json} +1 -1
- package/template/dist/{review.json → review/review.json} +1 -1
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js +4 -4
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +6 -6
- package/template/node_modules/.vite/deps/_metadata.json +25 -25
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/template/src/resources/{albums-resource.test.tsx → albums/albums-resource.test.tsx} +1 -1
- package/template/src/resources/{albums-resource.tsx → albums/albums-resource.tsx} +1 -1
- package/template/src/resources/albums/albums-show-simulation.json +131 -0
- package/template/src/{components/album → resources/albums/components}/album-card.tsx +1 -1
- package/template/src/{components/album → resources/albums/components}/album-carousel.tsx +1 -1
- package/template/src/{components/album → resources/albums/components}/film-strip.tsx +1 -1
- package/template/src/{components/album → resources/albums/components}/fullscreen-viewer.tsx +1 -1
- package/template/src/resources/{carousel-resource.test.tsx → carousel/carousel-resource.test.tsx} +1 -1
- package/template/src/resources/{carousel-resource.tsx → carousel/carousel-resource.tsx} +1 -1
- package/template/src/resources/carousel/carousel-show-simulation.json +68 -0
- package/template/src/{components/carousel → resources/carousel/components}/card.tsx +1 -1
- package/template/src/{components/carousel → resources/carousel/components}/carousel.tsx +1 -1
- package/template/src/resources/index.ts +5 -5
- package/template/src/{components/map → resources/map/components}/map-view.tsx +1 -1
- package/template/src/{components/map → resources/map/components}/map.tsx +1 -1
- package/template/src/{components/map → resources/map/components}/place-card.tsx +1 -1
- package/template/src/{components/map → resources/map/components}/place-carousel.tsx +1 -1
- package/template/src/{components/map → resources/map/components}/place-inspector.tsx +1 -1
- package/template/src/{components/map → resources/map/components}/place-list.tsx +1 -1
- package/template/src/resources/{map-resource.test.tsx → map/map-resource.test.tsx} +1 -1
- package/template/src/resources/{map-resource.tsx → map/map-resource.tsx} +1 -1
- package/template/src/resources/map/map-show-simulation.json +123 -0
- package/template/src/resources/review/review-diff-simulation.json +80 -0
- package/template/src/resources/review/review-post-simulation.json +56 -0
- package/template/src/resources/review/review-purchase-simulation.json +88 -0
- package/dist/discovery-a4WId9PC.cjs +0 -125
- package/dist/discovery-a4WId9PC.cjs.map +0 -1
- package/dist/discovery-ft3cd2dW.js +0 -126
- package/dist/discovery-ft3cd2dW.js.map +0 -1
- package/template/src/components/index.ts +0 -3
- package/template/src/simulations/index.ts +0 -16
- /package/template/{src/simulations → dist/albums}/albums-show-simulation.json +0 -0
- /package/template/dist/{albums.js → albums/albums.js} +0 -0
- /package/template/{src/simulations → dist/carousel}/carousel-show-simulation.json +0 -0
- /package/template/dist/{carousel.js → carousel/carousel.js} +0 -0
- /package/template/{src/simulations → dist/map}/map-show-simulation.json +0 -0
- /package/template/dist/{map.js → map/map.js} +0 -0
- /package/template/{src/simulations → dist/review}/review-diff-simulation.json +0 -0
- /package/template/{src/simulations → dist/review}/review-post-simulation.json +0 -0
- /package/template/{src/simulations → dist/review}/review-purchase-simulation.json +0 -0
- /package/template/dist/{review.js → review/review.js} +0 -0
- /package/template/src/resources/{albums-resource.json → albums/albums-resource.json} +0 -0
- /package/template/src/{components/album → resources/albums/components}/album-card.test.tsx +0 -0
- /package/template/src/{components/album → resources/albums/components}/album-carousel.test.tsx +0 -0
- /package/template/src/{components/album → resources/albums/components}/albums.test.tsx +0 -0
- /package/template/src/{components/album → resources/albums/components}/albums.tsx +0 -0
- /package/template/src/{components/album → resources/albums/components}/film-strip.test.tsx +0 -0
- /package/template/src/{components/album → resources/albums/components}/fullscreen-viewer.test.tsx +0 -0
- /package/template/src/{components/album → resources/albums/components}/index.ts +0 -0
- /package/template/src/resources/{carousel-resource.json → carousel/carousel-resource.json} +0 -0
- /package/template/src/{components/carousel → resources/carousel/components}/card.test.tsx +0 -0
- /package/template/src/{components/carousel → resources/carousel/components}/carousel.test.tsx +0 -0
- /package/template/src/{components/carousel → resources/carousel/components}/index.ts +0 -0
- /package/template/src/{components/map → resources/map/components}/index.ts +0 -0
- /package/template/src/{components/map → resources/map/components}/map-view.test.tsx +0 -0
- /package/template/src/{components/map → resources/map/components}/place-card.test.tsx +0 -0
- /package/template/src/{components/map → resources/map/components}/place-carousel.test.tsx +0 -0
- /package/template/src/{components/map → resources/map/components}/place-inspector.test.tsx +0 -0
- /package/template/src/{components/map → resources/map/components}/place-list.test.tsx +0 -0
- /package/template/src/{components/map → resources/map/components}/types.ts +0 -0
- /package/template/src/resources/{map-resource.json → map/map-resource.json} +0 -0
- /package/template/src/resources/{review-resource.json → review/review-resource.json} +0 -0
- /package/template/src/resources/{review-resource.test.tsx → review/review-resource.test.tsx} +0 -0
- /package/template/src/resources/{review-resource.tsx → review/review-resource.tsx} +0 -0
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This file bootstraps the ChatGPT simulator for development
|
|
5
5
|
*
|
|
6
6
|
* Auto-discovers simulations and resources by file naming convention:
|
|
7
|
-
* -
|
|
8
|
-
* - resources/{resource}-resource.json
|
|
9
|
-
* - resources/{Resource}Resource component (PascalCase)
|
|
7
|
+
* - resources/{resource}/{resource}-{tool}-simulation.json (e.g., resources/albums/albums-show-simulation.json)
|
|
8
|
+
* - resources/{resource}/{resource}-resource.json
|
|
9
|
+
* - resources/{resource}/{Resource}Resource component (PascalCase)
|
|
10
10
|
*/
|
|
11
11
|
import { StrictMode } from 'react';
|
|
12
12
|
import { createRoot } from 'react-dom/client';
|
|
@@ -16,8 +16,8 @@ import '../src/styles/globals.css';
|
|
|
16
16
|
|
|
17
17
|
// Build simulations from discovered files
|
|
18
18
|
const simulations = buildDevSimulations({
|
|
19
|
-
simulationModules: import.meta.glob('../src/
|
|
20
|
-
resourceModules: import.meta.glob('../src/resources
|
|
19
|
+
simulationModules: import.meta.glob('../src/resources/*/*-simulation.json', { eager: true }),
|
|
20
|
+
resourceModules: import.meta.glob('../src/resources/*/*-resource.json', { eager: true }),
|
|
21
21
|
resourceComponents: resourceComponents as Record<string, React.ComponentType>,
|
|
22
22
|
});
|
|
23
23
|
|
package/template/README.md
CHANGED
|
@@ -16,48 +16,34 @@ That's it! Edit the resource files in [./src/resources/](./src/resources/) to bu
|
|
|
16
16
|
## Commands
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
# Core commands:
|
|
20
|
+
pnpm test # Run tests with Vitest.
|
|
21
|
+
pnpm test:e2e # Run end-to-end tests with Playwright.
|
|
22
|
+
sunpeak dev # Start development server.
|
|
23
|
+
sunpeak build # Build all resources for production.
|
|
24
|
+
sunpeak mcp # Start MCP server for ChatGPT testing with mock data.
|
|
25
|
+
|
|
26
|
+
# sunpeak repository (think ECR for ChatGPT Apps):
|
|
27
|
+
sunpeak login # Authenticate with the sunpeak repository.
|
|
28
|
+
sunpeak push # Push built resources to the sunpeak repository.
|
|
29
|
+
sunpeak pull # Pull built resources from the sunpeak repository (for your prod MCP server).
|
|
23
30
|
```
|
|
24
31
|
|
|
25
32
|
The template includes a minimal test setup with Vitest. You can add additional tooling (linting, formatting, type-checking) as needed for your project.
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
## Project Structure
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
- `src/resources/` - Directory containing all your MCP Resources (ChatGPT App UIs).
|
|
37
|
+
- Each resource is a subdirectory containing all files for that resource.
|
|
38
|
+
- Example: `src/resources/albums/` contains:
|
|
39
|
+
- `albums-resource.tsx` - The React component.
|
|
40
|
+
- `albums-resource.json` - Resource metadata (name, title, description, etc.).
|
|
41
|
+
- `albums-resource.test.tsx` - Unit tests for the resource.
|
|
42
|
+
- `albums-show-simulation.json` - Simulation data for testing.
|
|
43
|
+
- `components/` - UI components used by the resource.
|
|
44
|
+
- `tests/e2e/` - Directory containing end-to-end Playwright tests for each resource. Uses the ChatGPTSimulator to test your resources render properly with any state (tool calls, saved state, dark mode, pip display mode, etc.).
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
- `src/simulations/` - Simulation files must be here
|
|
33
|
-
- Resource file naming: `*-resource.tsx` (e.g., `review-resource.tsx`)
|
|
34
|
-
- Simulation file naming: `*-simulation.json` (e.g., `review-purchase-simulation.json`)
|
|
35
|
-
- `src/index-resource.tsx` - Build template (must have `// RESOURCE_IMPORT` and `// RESOURCE_MOUNT` comments)
|
|
36
|
-
|
|
37
|
-
**You can customize:**
|
|
38
|
-
|
|
39
|
-
- Package.json scripts - Add your own tooling (lint, format, typecheck, etc.)
|
|
40
|
-
- Component structure within `src/components/`
|
|
41
|
-
- Package manager (pnpm, npm, or yarn auto-detected)
|
|
42
|
-
- Pretty much everything else!
|
|
43
|
-
|
|
44
|
-
## Testing
|
|
45
|
-
|
|
46
|
-
### Testing Locally
|
|
47
|
-
|
|
48
|
-
Run the test suite:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
pnpm test
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
For manual QA of the UI:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
sunpeak dev
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Testing in ChatGPT
|
|
46
|
+
## Testing in ChatGPT
|
|
61
47
|
|
|
62
48
|
Test your app directly in ChatGPT using the built-in MCP server:
|
|
63
49
|
|
|
@@ -83,28 +69,46 @@ Build your app for production:
|
|
|
83
69
|
sunpeak build
|
|
84
70
|
```
|
|
85
71
|
|
|
86
|
-
This creates optimized builds in `dist
|
|
72
|
+
This creates optimized builds in `dist/`, organized by resource:
|
|
87
73
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
74
|
+
```bash
|
|
75
|
+
dist/
|
|
76
|
+
├── albums/
|
|
77
|
+
│ ├── albums.js # Built resource component.
|
|
78
|
+
│ ├── albums.json # Resource metadata.
|
|
79
|
+
│ └── albums-show-simulation.json # Resource mock data for testing.
|
|
80
|
+
├── review/
|
|
81
|
+
│ ├── review.js
|
|
82
|
+
│ ├── review.json
|
|
83
|
+
│ ├── review-diff-simulation.json
|
|
84
|
+
│ ├── review-post-simulation.json
|
|
85
|
+
│ └── review-purchase-simulation.json
|
|
86
|
+
└── ...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Each resource folder contains:
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
- **`.js` file**: Self-contained bundle with CSS inlined
|
|
92
|
+
- **`.json` file**: Resource metadata with unique `uri` for cache-busting
|
|
93
|
+
- **`*-simulation.json` files**: All affiliated simulation files for the resource. These are not needed for the production runtime, but are used in the sunpeak repository for testing.
|
|
96
94
|
|
|
97
|
-
|
|
95
|
+
Host these files and reference them as resources in your production MCP server.
|
|
96
|
+
Use the sunpeak resource repository for built-in resource hosting.
|
|
98
97
|
|
|
99
98
|
## Add a new UI (Resource)
|
|
100
99
|
|
|
101
|
-
To add a new UI (MCP Resource),
|
|
100
|
+
To add a new UI (MCP Resource), create a new directory under `src/resources/` with the following files:
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
```
|
|
103
|
+
src/resources/NAME/
|
|
104
|
+
├── NAME-resource.tsx # React component (required)
|
|
105
|
+
├── NAME-resource.json # Resource metadata (required)
|
|
106
|
+
├── NAME-resource.test.tsx # Unit tests (optional)
|
|
107
|
+
├── NAME-TOOLNAME-simulation.json # Simulation data (optional)
|
|
108
|
+
└── components/ # UI components (optional)
|
|
109
|
+
```
|
|
106
110
|
|
|
107
|
-
Only the resource files are required to generate a production build and ship a UI. Create the simulation file if you want to preview your resource in `sunpeak dev` or `sunpeak mcp`.
|
|
111
|
+
Only the resource files (`.tsx` and `.json`) are required to generate a production build and ship a UI. Create the simulation file if you want to preview your resource in `sunpeak dev` or `sunpeak mcp`.
|
|
108
112
|
|
|
109
113
|
## Resources
|
|
110
114
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dist_exports4 as dist_exports
|
|
3
|
-
} from "./chunk-TSEQUROC.js";
|
|
4
|
-
import "./chunk-XZTIOEPG.js";
|
|
5
1
|
import {
|
|
6
2
|
useResizeObserver
|
|
7
3
|
} from "./chunk-JAGHY6H6.js";
|
|
@@ -10,6 +6,10 @@ import {
|
|
|
10
6
|
waitForAnimationFrame
|
|
11
7
|
} from "./chunk-DYQDWJMS.js";
|
|
12
8
|
import "./chunk-EGRHWZRV.js";
|
|
9
|
+
import {
|
|
10
|
+
dist_exports4 as dist_exports
|
|
11
|
+
} from "./chunk-TSEQUROC.js";
|
|
12
|
+
import "./chunk-XZTIOEPG.js";
|
|
13
13
|
import {
|
|
14
14
|
clsx_default
|
|
15
15
|
} from "./chunk-CNYJBM5F.js";
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Input
|
|
3
3
|
} from "./chunk-2DZGWGIP.js";
|
|
4
|
-
import {
|
|
5
|
-
dist_exports,
|
|
6
|
-
dist_exports3 as dist_exports2,
|
|
7
|
-
dist_exports5 as dist_exports3
|
|
8
|
-
} from "./chunk-TSEQUROC.js";
|
|
9
|
-
import "./chunk-XZTIOEPG.js";
|
|
10
4
|
import {
|
|
11
5
|
Button,
|
|
12
6
|
LoadingIndicator,
|
|
@@ -25,6 +19,12 @@ import {
|
|
|
25
19
|
waitForAnimationFrame
|
|
26
20
|
} from "./chunk-DYQDWJMS.js";
|
|
27
21
|
import "./chunk-EGRHWZRV.js";
|
|
22
|
+
import {
|
|
23
|
+
dist_exports,
|
|
24
|
+
dist_exports3 as dist_exports2,
|
|
25
|
+
dist_exports5 as dist_exports3
|
|
26
|
+
} from "./chunk-TSEQUROC.js";
|
|
27
|
+
import "./chunk-XZTIOEPG.js";
|
|
28
28
|
import {
|
|
29
29
|
clsx_default
|
|
30
30
|
} from "./chunk-CNYJBM5F.js";
|
|
@@ -7,115 +7,115 @@
|
|
|
7
7
|
"react": {
|
|
8
8
|
"src": "../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js",
|
|
9
9
|
"file": "react.js",
|
|
10
|
-
"fileHash": "
|
|
10
|
+
"fileHash": "978df452",
|
|
11
11
|
"needsInterop": true
|
|
12
12
|
},
|
|
13
13
|
"react-dom": {
|
|
14
14
|
"src": "../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js",
|
|
15
15
|
"file": "react-dom.js",
|
|
16
|
-
"fileHash": "
|
|
16
|
+
"fileHash": "739c8c96",
|
|
17
17
|
"needsInterop": true
|
|
18
18
|
},
|
|
19
19
|
"react/jsx-dev-runtime": {
|
|
20
20
|
"src": "../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-dev-runtime.js",
|
|
21
21
|
"file": "react_jsx-dev-runtime.js",
|
|
22
|
-
"fileHash": "
|
|
22
|
+
"fileHash": "c6a55f8c",
|
|
23
23
|
"needsInterop": true
|
|
24
24
|
},
|
|
25
25
|
"react/jsx-runtime": {
|
|
26
26
|
"src": "../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js",
|
|
27
27
|
"file": "react_jsx-runtime.js",
|
|
28
|
-
"fileHash": "
|
|
28
|
+
"fileHash": "2e3249cd",
|
|
29
29
|
"needsInterop": true
|
|
30
30
|
},
|
|
31
31
|
"@openai/apps-sdk-ui/components/Avatar": {
|
|
32
32
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Avatar/index.js",
|
|
33
33
|
"file": "@openai_apps-sdk-ui_components_Avatar.js",
|
|
34
|
-
"fileHash": "
|
|
34
|
+
"fileHash": "84d35df3",
|
|
35
35
|
"needsInterop": false
|
|
36
36
|
},
|
|
37
37
|
"@openai/apps-sdk-ui/components/Button": {
|
|
38
38
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Button/index.js",
|
|
39
39
|
"file": "@openai_apps-sdk-ui_components_Button.js",
|
|
40
|
-
"fileHash": "
|
|
40
|
+
"fileHash": "c08d365b",
|
|
41
41
|
"needsInterop": false
|
|
42
42
|
},
|
|
43
43
|
"@openai/apps-sdk-ui/components/Checkbox": {
|
|
44
44
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Checkbox/index.js",
|
|
45
45
|
"file": "@openai_apps-sdk-ui_components_Checkbox.js",
|
|
46
|
-
"fileHash": "
|
|
46
|
+
"fileHash": "b0e3c856",
|
|
47
47
|
"needsInterop": false
|
|
48
48
|
},
|
|
49
49
|
"@openai/apps-sdk-ui/components/Icon": {
|
|
50
50
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Icon/index.js",
|
|
51
51
|
"file": "@openai_apps-sdk-ui_components_Icon.js",
|
|
52
|
-
"fileHash": "
|
|
52
|
+
"fileHash": "25eae116",
|
|
53
53
|
"needsInterop": false
|
|
54
54
|
},
|
|
55
55
|
"@openai/apps-sdk-ui/components/Input": {
|
|
56
56
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/index.js",
|
|
57
57
|
"file": "@openai_apps-sdk-ui_components_Input.js",
|
|
58
|
-
"fileHash": "
|
|
58
|
+
"fileHash": "e06a7192",
|
|
59
59
|
"needsInterop": false
|
|
60
60
|
},
|
|
61
61
|
"@openai/apps-sdk-ui/components/SegmentedControl": {
|
|
62
62
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/SegmentedControl/index.js",
|
|
63
63
|
"file": "@openai_apps-sdk-ui_components_SegmentedControl.js",
|
|
64
|
-
"fileHash": "
|
|
64
|
+
"fileHash": "fad6e91f",
|
|
65
65
|
"needsInterop": false
|
|
66
66
|
},
|
|
67
67
|
"@openai/apps-sdk-ui/components/Select": {
|
|
68
68
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Select/index.js",
|
|
69
69
|
"file": "@openai_apps-sdk-ui_components_Select.js",
|
|
70
|
-
"fileHash": "
|
|
70
|
+
"fileHash": "fb9567a2",
|
|
71
71
|
"needsInterop": false
|
|
72
72
|
},
|
|
73
73
|
"@openai/apps-sdk-ui/components/Textarea": {
|
|
74
74
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/index.js",
|
|
75
75
|
"file": "@openai_apps-sdk-ui_components_Textarea.js",
|
|
76
|
-
"fileHash": "
|
|
76
|
+
"fileHash": "7281a5a0",
|
|
77
77
|
"needsInterop": false
|
|
78
78
|
},
|
|
79
79
|
"@openai/apps-sdk-ui/theme": {
|
|
80
80
|
"src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/lib/theme.js",
|
|
81
81
|
"file": "@openai_apps-sdk-ui_theme.js",
|
|
82
|
-
"fileHash": "
|
|
82
|
+
"fileHash": "8eb63021",
|
|
83
83
|
"needsInterop": false
|
|
84
84
|
},
|
|
85
85
|
"clsx": {
|
|
86
86
|
"src": "../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs",
|
|
87
87
|
"file": "clsx.js",
|
|
88
|
-
"fileHash": "
|
|
88
|
+
"fileHash": "c3e9c6e8",
|
|
89
89
|
"needsInterop": false
|
|
90
90
|
},
|
|
91
91
|
"embla-carousel-react": {
|
|
92
92
|
"src": "../../../../node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.3/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js",
|
|
93
93
|
"file": "embla-carousel-react.js",
|
|
94
|
-
"fileHash": "
|
|
94
|
+
"fileHash": "2e92d16c",
|
|
95
95
|
"needsInterop": false
|
|
96
96
|
},
|
|
97
97
|
"embla-carousel-wheel-gestures": {
|
|
98
98
|
"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",
|
|
99
99
|
"file": "embla-carousel-wheel-gestures.js",
|
|
100
|
-
"fileHash": "
|
|
100
|
+
"fileHash": "ca493790",
|
|
101
101
|
"needsInterop": false
|
|
102
102
|
},
|
|
103
103
|
"mapbox-gl": {
|
|
104
104
|
"src": "../../../../node_modules/.pnpm/mapbox-gl@3.17.0/node_modules/mapbox-gl/dist/mapbox-gl.js",
|
|
105
105
|
"file": "mapbox-gl.js",
|
|
106
|
-
"fileHash": "
|
|
106
|
+
"fileHash": "5ba95985",
|
|
107
107
|
"needsInterop": true
|
|
108
108
|
},
|
|
109
109
|
"react-dom/client": {
|
|
110
110
|
"src": "../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js",
|
|
111
111
|
"file": "react-dom_client.js",
|
|
112
|
-
"fileHash": "
|
|
112
|
+
"fileHash": "4c39d1d2",
|
|
113
113
|
"needsInterop": true
|
|
114
114
|
},
|
|
115
115
|
"tailwind-merge": {
|
|
116
116
|
"src": "../../../../node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs",
|
|
117
117
|
"file": "tailwind-merge.js",
|
|
118
|
-
"fileHash": "
|
|
118
|
+
"fileHash": "88ea5519",
|
|
119
119
|
"needsInterop": false
|
|
120
120
|
}
|
|
121
121
|
},
|
|
@@ -123,12 +123,6 @@
|
|
|
123
123
|
"chunk-2DZGWGIP": {
|
|
124
124
|
"file": "chunk-2DZGWGIP.js"
|
|
125
125
|
},
|
|
126
|
-
"chunk-TSEQUROC": {
|
|
127
|
-
"file": "chunk-TSEQUROC.js"
|
|
128
|
-
},
|
|
129
|
-
"chunk-XZTIOEPG": {
|
|
130
|
-
"file": "chunk-XZTIOEPG.js"
|
|
131
|
-
},
|
|
132
126
|
"chunk-N6DVYEXK": {
|
|
133
127
|
"file": "chunk-N6DVYEXK.js"
|
|
134
128
|
},
|
|
@@ -144,6 +138,12 @@
|
|
|
144
138
|
"chunk-EGRHWZRV": {
|
|
145
139
|
"file": "chunk-EGRHWZRV.js"
|
|
146
140
|
},
|
|
141
|
+
"chunk-TSEQUROC": {
|
|
142
|
+
"file": "chunk-TSEQUROC.js"
|
|
143
|
+
},
|
|
144
|
+
"chunk-XZTIOEPG": {
|
|
145
|
+
"file": "chunk-XZTIOEPG.js"
|
|
146
|
+
},
|
|
147
147
|
"chunk-CNYJBM5F": {
|
|
148
148
|
"file": "chunk-CNYJBM5F.js"
|
|
149
149
|
},
|
package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"4.0.16","results":[[":src/components/
|
|
1
|
+
{"version":"4.0.16","results":[[":src/resources/albums/components/albums.test.tsx",{"duration":312.6829419999999,"failed":false}],[":src/resources/carousel/carousel-resource.test.tsx",{"duration":266.349324,"failed":false}],[":src/resources/review/review-resource.test.tsx",{"duration":575.062723,"failed":false}],[":src/resources/map/components/place-inspector.test.tsx",{"duration":408.8364120000001,"failed":false}],[":src/resources/map/components/map-view.test.tsx",{"duration":76.36474199999998,"failed":false}],[":src/resources/albums/components/fullscreen-viewer.test.tsx",{"duration":271.794167,"failed":false}],[":src/resources/map/components/place-list.test.tsx",{"duration":147.25542700000005,"failed":false}],[":src/resources/map/components/place-card.test.tsx",{"duration":334.0843209999998,"failed":false}],[":src/resources/map/components/place-carousel.test.tsx",{"duration":402.49088800000004,"failed":false}],[":src/resources/albums/components/album-carousel.test.tsx",{"duration":83.27303100000017,"failed":false}],[":src/resources/carousel/components/carousel.test.tsx",{"duration":99.52693,"failed":false}],[":src/resources/map/map-resource.test.tsx",{"duration":291.25948700000004,"failed":false}],[":src/resources/albums/albums-resource.test.tsx",{"duration":222.6419860000001,"failed":false}],[":src/resources/albums/components/film-strip.test.tsx",{"duration":473.575382,"failed":false}],[":src/resources/albums/components/album-card.test.tsx",{"duration":399.02311299999997,"failed":false}],[":src/resources/carousel/components/card.test.tsx",{"duration":69.64156500000013,"failed":false}]]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userMessage": "Pizza time",
|
|
3
|
+
"tool": {
|
|
4
|
+
"name": "show-albums",
|
|
5
|
+
"description": "Show photo albums",
|
|
6
|
+
"inputSchema": { "type": "object", "properties": {}, "additionalProperties": false },
|
|
7
|
+
"title": "Show Albums",
|
|
8
|
+
"annotations": { "readOnlyHint": true },
|
|
9
|
+
"_meta": {
|
|
10
|
+
"openai/toolInvocation/invoking": "Loading albums",
|
|
11
|
+
"openai/toolInvocation/invoked": "Album loaded",
|
|
12
|
+
"openai/widgetAccessible": true,
|
|
13
|
+
"openai/resultCanProduceWidget": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"callToolResult": {
|
|
17
|
+
"structuredContent": {
|
|
18
|
+
"albums": [
|
|
19
|
+
{
|
|
20
|
+
"id": "summer-escape",
|
|
21
|
+
"title": "Summer Slice",
|
|
22
|
+
"cover": "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png",
|
|
23
|
+
"photos": [
|
|
24
|
+
{
|
|
25
|
+
"id": "s1",
|
|
26
|
+
"title": "Waves",
|
|
27
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "s2",
|
|
31
|
+
"title": "Palm trees",
|
|
32
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "s3",
|
|
36
|
+
"title": "Sunset",
|
|
37
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "city-lights",
|
|
43
|
+
"title": "Pepperoni Nights",
|
|
44
|
+
"cover": "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png",
|
|
45
|
+
"photos": [
|
|
46
|
+
{
|
|
47
|
+
"id": "c1",
|
|
48
|
+
"title": "Downtown",
|
|
49
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "c2",
|
|
53
|
+
"title": "Neon",
|
|
54
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "c3",
|
|
58
|
+
"title": "Streets",
|
|
59
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "into-the-woods",
|
|
65
|
+
"title": "Truffle Forest",
|
|
66
|
+
"cover": "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png",
|
|
67
|
+
"photos": [
|
|
68
|
+
{
|
|
69
|
+
"id": "n1",
|
|
70
|
+
"title": "Forest path",
|
|
71
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "n2",
|
|
75
|
+
"title": "Misty",
|
|
76
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "n3",
|
|
80
|
+
"title": "Waterfall",
|
|
81
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "pizza-tour",
|
|
87
|
+
"title": "Pizza tour",
|
|
88
|
+
"cover": "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png",
|
|
89
|
+
"photos": [
|
|
90
|
+
{
|
|
91
|
+
"id": "tonys-pizza-napoletana",
|
|
92
|
+
"title": "Tony's Pizza Napoletana",
|
|
93
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "golden-boy-pizza",
|
|
97
|
+
"title": "Golden Boy Pizza",
|
|
98
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "pizzeria-delfina-mission",
|
|
102
|
+
"title": "Pizzeria Delfina (Mission)",
|
|
103
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "ragazza",
|
|
107
|
+
"title": "Ragazza",
|
|
108
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "del-popolo",
|
|
112
|
+
"title": "Del Popolo",
|
|
113
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": "square-pie-guys",
|
|
117
|
+
"title": "Square Pie Guys",
|
|
118
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "zero-zero",
|
|
122
|
+
"title": "Zero Zero",
|
|
123
|
+
"url": "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"_meta": {}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -4,7 +4,7 @@ import { WheelGesturesPlugin } from 'embla-carousel-wheel-gestures';
|
|
|
4
4
|
import { ArrowLeft, ArrowRight } from '@openai/apps-sdk-ui/components/Icon';
|
|
5
5
|
import { useWidgetState, useDisplayMode } from 'sunpeak';
|
|
6
6
|
import { Button } from '@openai/apps-sdk-ui/components/Button';
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from '../../../lib/index';
|
|
8
8
|
|
|
9
9
|
export interface AlbumCarouselState extends Record<string, unknown> {
|
|
10
10
|
currentIndex?: number;
|
package/template/src/resources/{carousel-resource.test.tsx → carousel/carousel-resource.test.tsx}
RENAMED
|
@@ -32,7 +32,7 @@ vi.mock('sunpeak', () => ({
|
|
|
32
32
|
}));
|
|
33
33
|
|
|
34
34
|
// Mock child components
|
|
35
|
-
vi.mock('
|
|
35
|
+
vi.mock('./components', () => ({
|
|
36
36
|
Carousel: ({ children }: { children: React.ReactNode }) => (
|
|
37
37
|
<div data-testid="carousel">{children}</div>
|
|
38
38
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useWidgetProps, useSafeArea, useMaxHeight, useUserAgent } from 'sunpeak';
|
|
3
|
-
import { Carousel, Card } from '
|
|
3
|
+
import { Carousel, Card } from './components';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Production-ready Carousel Resource
|