sunpeak 0.8.1 → 0.8.5
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 +2 -1
- package/bin/commands/dev.mjs +60 -4
- package/bin/commands/mcp.mjs +1 -1
- package/bin/sunpeak.js +11 -13
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/style.css +62 -0
- package/package.json +1 -1
- package/template/README.md +29 -14
- package/template/dist/albums.js +1 -1
- package/template/dist/albums.json +3 -2
- package/template/dist/carousel.js +1 -1
- package/template/dist/carousel.json +3 -2
- package/template/dist/confirmation.js +49 -0
- package/template/dist/confirmation.json +16 -0
- package/template/dist/counter.js +1 -1
- package/template/dist/counter.json +7 -2
- package/template/dist/map.js +1 -1
- package/template/dist/map.json +6 -3
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js +3 -3
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js +1 -1
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +16 -16
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js +3 -3
- package/template/node_modules/.vite/deps/_metadata.json +32 -32
- package/template/node_modules/.vite/deps/{chunk-SPYXUHEY.js → chunk-N6DVYEXK.js} +8 -8
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/template/src/resources/albums-resource.json +1 -1
- package/template/src/resources/carousel-resource.json +1 -1
- package/template/src/resources/confirmation-resource.json +12 -0
- package/template/src/resources/confirmation-resource.tsx +479 -0
- package/template/src/resources/counter-resource.json +4 -1
- package/template/src/resources/map-resource.json +7 -2
- package/template/src/simulations/confirmation-diff-simulation.json +80 -0
- package/template/src/simulations/confirmation-post-simulation.json +56 -0
- package/template/src/simulations/confirmation-purchase-simulation.json +88 -0
- /package/template/node_modules/.vite/deps/{chunk-SPYXUHEY.js.map → chunk-N6DVYEXK.js.map} +0 -0
package/dist/style.css
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
--tw-gradient-to-position: 100%;
|
|
28
28
|
--tw-leading: initial;
|
|
29
29
|
--tw-font-weight: initial;
|
|
30
|
+
--tw-tracking: initial;
|
|
30
31
|
--tw-shadow: 0 0 #0000;
|
|
31
32
|
--tw-shadow-color: initial;
|
|
32
33
|
--tw-shadow-alpha: 100%;
|
|
@@ -118,6 +119,10 @@
|
|
|
118
119
|
--text-xs--line-height: var(--font-text-xs-line-height);
|
|
119
120
|
--text-xs--font-weight: var(--font-text-xs-weight);
|
|
120
121
|
--text-xs--letter-spacing: var(--font-text-xs-tracking);
|
|
122
|
+
--text-xl: var(--font-heading-md-size);
|
|
123
|
+
--text-xl--line-height: var(--font-heading-md-line-height);
|
|
124
|
+
--text-xl--font-weight: var(--font-text-lg-weight);
|
|
125
|
+
--text-xl--letter-spacing: var(--font-heading-md-tracking);
|
|
121
126
|
--text-2xl: var(--font-heading-lg-size);
|
|
122
127
|
--text-2xl--line-height: var(--font-heading-lg-line-height);
|
|
123
128
|
--text-2xl--font-weight: var(--font-text-lg-weight);
|
|
@@ -3318,6 +3323,10 @@
|
|
|
3318
3323
|
margin-inline-end: calc(var(--spacing) * 2);
|
|
3319
3324
|
}
|
|
3320
3325
|
|
|
3326
|
+
.mt-0\.5 {
|
|
3327
|
+
margin-top: calc(var(--spacing) * .5);
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3321
3330
|
.mt-1 {
|
|
3322
3331
|
margin-top: calc(var(--spacing) * 1);
|
|
3323
3332
|
}
|
|
@@ -3381,6 +3390,10 @@
|
|
|
3381
3390
|
display: inline;
|
|
3382
3391
|
}
|
|
3383
3392
|
|
|
3393
|
+
.table {
|
|
3394
|
+
display: table;
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3384
3397
|
.aspect-\[4\/3\] {
|
|
3385
3398
|
aspect-ratio: 4 / 3;
|
|
3386
3399
|
}
|
|
@@ -3414,6 +3427,10 @@
|
|
|
3414
3427
|
height: calc(var(--spacing) * 5);
|
|
3415
3428
|
}
|
|
3416
3429
|
|
|
3430
|
+
.h-6 {
|
|
3431
|
+
height: calc(var(--spacing) * 6);
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3417
3434
|
.h-7 {
|
|
3418
3435
|
height: calc(var(--spacing) * 7);
|
|
3419
3436
|
}
|
|
@@ -3490,6 +3507,10 @@
|
|
|
3490
3507
|
width: calc(var(--spacing) * 5);
|
|
3491
3508
|
}
|
|
3492
3509
|
|
|
3510
|
+
.w-6 {
|
|
3511
|
+
width: calc(var(--spacing) * 6);
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3493
3514
|
.w-7 {
|
|
3494
3515
|
width: calc(var(--spacing) * 7);
|
|
3495
3516
|
}
|
|
@@ -3664,6 +3685,10 @@
|
|
|
3664
3685
|
gap: calc(var(--spacing) * 3);
|
|
3665
3686
|
}
|
|
3666
3687
|
|
|
3688
|
+
.gap-4 {
|
|
3689
|
+
gap: calc(var(--spacing) * 4);
|
|
3690
|
+
}
|
|
3691
|
+
|
|
3667
3692
|
:where(.space-y-0\.5 > :not(:last-child)) {
|
|
3668
3693
|
--tw-space-y-reverse: 0;
|
|
3669
3694
|
margin-block-start: calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));
|
|
@@ -3959,6 +3984,10 @@
|
|
|
3959
3984
|
padding: calc(var(--spacing) * 2);
|
|
3960
3985
|
}
|
|
3961
3986
|
|
|
3987
|
+
.p-3 {
|
|
3988
|
+
padding: calc(var(--spacing) * 3);
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3962
3991
|
.p-4 {
|
|
3963
3992
|
padding: calc(var(--spacing) * 4);
|
|
3964
3993
|
}
|
|
@@ -4015,6 +4044,10 @@
|
|
|
4015
4044
|
padding-block: calc(var(--spacing) * 4);
|
|
4016
4045
|
}
|
|
4017
4046
|
|
|
4047
|
+
.py-8 {
|
|
4048
|
+
padding-block: calc(var(--spacing) * 8);
|
|
4049
|
+
}
|
|
4050
|
+
|
|
4018
4051
|
.pt-0 {
|
|
4019
4052
|
padding-top: calc(var(--spacing) * 0);
|
|
4020
4053
|
}
|
|
@@ -4023,6 +4056,10 @@
|
|
|
4023
4056
|
padding-top: calc(var(--spacing) * 2);
|
|
4024
4057
|
}
|
|
4025
4058
|
|
|
4059
|
+
.pt-4 {
|
|
4060
|
+
padding-top: calc(var(--spacing) * 4);
|
|
4061
|
+
}
|
|
4062
|
+
|
|
4026
4063
|
.pr-12 {
|
|
4027
4064
|
padding-right: calc(var(--spacing) * 12);
|
|
4028
4065
|
}
|
|
@@ -4101,6 +4138,13 @@
|
|
|
4101
4138
|
font-weight: var(--tw-font-weight, var(--text-sm--font-weight));
|
|
4102
4139
|
}
|
|
4103
4140
|
|
|
4141
|
+
.text-xl {
|
|
4142
|
+
font-size: var(--text-xl);
|
|
4143
|
+
line-height: var(--tw-leading, var(--text-xl--line-height));
|
|
4144
|
+
letter-spacing: var(--tw-tracking, var(--text-xl--letter-spacing));
|
|
4145
|
+
font-weight: var(--tw-font-weight, var(--text-xl--font-weight));
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4104
4148
|
.text-xs {
|
|
4105
4149
|
font-size: var(--text-xs);
|
|
4106
4150
|
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
@@ -4150,6 +4194,11 @@
|
|
|
4150
4194
|
font-weight: var(--font-weight-semibold);
|
|
4151
4195
|
}
|
|
4152
4196
|
|
|
4197
|
+
.tracking-wide {
|
|
4198
|
+
--tw-tracking: var(--tracking-wide);
|
|
4199
|
+
letter-spacing: var(--tracking-wide);
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4153
4202
|
.break-words {
|
|
4154
4203
|
overflow-wrap: break-word;
|
|
4155
4204
|
}
|
|
@@ -4170,6 +4219,10 @@
|
|
|
4170
4219
|
white-space: pre-wrap;
|
|
4171
4220
|
}
|
|
4172
4221
|
|
|
4222
|
+
.text-\[\#000000\] {
|
|
4223
|
+
color: #000;
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4173
4226
|
.text-\[var\(--color-error\)\] {
|
|
4174
4227
|
color: var(--color-error);
|
|
4175
4228
|
}
|
|
@@ -4186,6 +4239,10 @@
|
|
|
4186
4239
|
color: var(--color-white);
|
|
4187
4240
|
}
|
|
4188
4241
|
|
|
4242
|
+
.uppercase {
|
|
4243
|
+
text-transform: uppercase;
|
|
4244
|
+
}
|
|
4245
|
+
|
|
4189
4246
|
.antialiased {
|
|
4190
4247
|
-webkit-font-smoothing: antialiased;
|
|
4191
4248
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -4754,6 +4811,11 @@
|
|
|
4754
4811
|
inherits: false
|
|
4755
4812
|
}
|
|
4756
4813
|
|
|
4814
|
+
@property --tw-tracking {
|
|
4815
|
+
syntax: "*";
|
|
4816
|
+
inherits: false
|
|
4817
|
+
}
|
|
4818
|
+
|
|
4757
4819
|
@property --tw-shadow {
|
|
4758
4820
|
syntax: "*";
|
|
4759
4821
|
inherits: false;
|
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A ChatGPT App UI built with [sunpeak](https://github.com/Sunpeak-AI/sunpeak).
|
|
4
4
|
|
|
5
|
-
For an initial overview of your new app and
|
|
5
|
+
For an initial overview of your new app and a detailed API reference, refer to the [documentation](https://docs.sunpeak.ai/template/project-structure).
|
|
6
6
|
|
|
7
7
|
## Quickstart
|
|
8
8
|
|
|
@@ -19,26 +19,27 @@ That's it! Edit the resource files in [./src/resources/](./src/resources/) to bu
|
|
|
19
19
|
sunpeak dev # Start development server
|
|
20
20
|
sunpeak build # Build all resources for production
|
|
21
21
|
sunpeak mcp # Start MCP server with auto-reload
|
|
22
|
-
pnpm test
|
|
22
|
+
pnpm test # Run tests with Vitest
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
The template includes a minimal test setup with Vitest. You can add additional tooling (linting, formatting, type-checking) as needed for your project.
|
|
26
26
|
|
|
27
27
|
### Customization
|
|
28
28
|
|
|
29
|
+
**Do not customize (required by `sunpeak` commands):**
|
|
30
|
+
|
|
31
|
+
- `src/resources/` - Resource files must be here
|
|
32
|
+
- `src/simulations/` - Simulation files must be here
|
|
33
|
+
- Resource file naming: `*-resource.tsx` (e.g., `counter-resource.tsx`)
|
|
34
|
+
- Simulation file naming: `*-simulation.tsx` (e.g., `counter-simulation.tsx`)
|
|
35
|
+
- `src/index-resource.tsx` - Build template (must have `// RESOURCE_IMPORT` and `// RESOURCE_MOUNT` comments)
|
|
36
|
+
|
|
29
37
|
**You can customize:**
|
|
30
38
|
|
|
31
39
|
- Package.json scripts - Add your own tooling (lint, format, typecheck, etc.)
|
|
32
40
|
- Component structure within `src/components/`
|
|
33
41
|
- Package manager (pnpm, npm, or yarn auto-detected)
|
|
34
|
-
|
|
35
|
-
**Do not customize (required by `sunpeak build`):**
|
|
36
|
-
|
|
37
|
-
- `src/resources/` - Resource files must be here
|
|
38
|
-
- `src/index-resource.tsx` - Build template (must have `// RESOURCE_IMPORT` and `// RESOURCE_MOUNT` comments)
|
|
39
|
-
- Resource file naming: `*-resource.tsx` (e.g., `counter-resource.tsx`)
|
|
40
|
-
|
|
41
|
-
If you need to customize these paths, create a custom build script instead of using `sunpeak build`.
|
|
42
|
+
- Pretty much everything else!
|
|
42
43
|
|
|
43
44
|
## Testing
|
|
44
45
|
|
|
@@ -70,7 +71,7 @@ ngrok http 6766
|
|
|
70
71
|
|
|
71
72
|
You can then connect to the tunnel forwarding URL at the `/mcp` path from ChatGPT **in developer mode** to see your UI in action: `User > Settings > Apps & Connectors > Create`
|
|
72
73
|
|
|
73
|
-
Once your app is connected, send the name of a tool, like
|
|
74
|
+
Once your app is connected, send the name of the app and a tool, like `/sunpeak show counter`, to ChatGPT.
|
|
74
75
|
|
|
75
76
|
When you make changes to the UI, refresh your app in ChatGPT after the MCP server has finished rebuilding your app: `User > Settings > Apps & Connectors > My App > Refresh`
|
|
76
77
|
|
|
@@ -84,12 +85,26 @@ sunpeak build
|
|
|
84
85
|
|
|
85
86
|
This creates optimized builds in `dist/`:
|
|
86
87
|
|
|
87
|
-
- `dist/counter.js`
|
|
88
88
|
- `dist/albums.js`
|
|
89
|
-
- `dist/
|
|
89
|
+
- `dist/albums.json`
|
|
90
|
+
- `dist/counter.js`
|
|
91
|
+
- `dist/counter.json`
|
|
90
92
|
- _(One .js file per resource in src/resources/)_
|
|
93
|
+
- _(One .json file per resource in src/resources/)_
|
|
94
|
+
|
|
95
|
+
Each `.js` file is a self-contained bundle with CSS inlined. Host these files and reference them as resources in your production MCP server.
|
|
96
|
+
|
|
97
|
+
Each `.json` file is a copy of each of your resource MCP metadata files `src/resource/*-resource.json`. The copy is identical, but with a unique `uri` field added that will cache-bust earlier resource versions pre-loaded in ChatGPT.
|
|
98
|
+
|
|
99
|
+
## Add a new UI (Resource)
|
|
100
|
+
|
|
101
|
+
To add a new UI (MCP Resource), simply create the following files:
|
|
102
|
+
|
|
103
|
+
- `src/resource/NAME-resource.tsx`
|
|
104
|
+
- `src/resource/NAME-resource.json`
|
|
105
|
+
- `src/simulations/NAME-TOOLNAME-simulation.json`
|
|
91
106
|
|
|
92
|
-
|
|
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`.
|
|
93
108
|
|
|
94
109
|
## Resources
|
|
95
110
|
|