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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userMessage": "Show me popular places to visit in Austin Texas",
|
|
3
|
+
"tool": {
|
|
4
|
+
"name": "show-carousel",
|
|
5
|
+
"description": "Show popular places to visit",
|
|
6
|
+
"inputSchema": { "type": "object", "properties": {}, "additionalProperties": false },
|
|
7
|
+
"title": "Show Carousel",
|
|
8
|
+
"annotations": { "readOnlyHint": true },
|
|
9
|
+
"_meta": {
|
|
10
|
+
"openai/toolInvocation/invoking": "Loading carousel",
|
|
11
|
+
"openai/toolInvocation/invoked": "Carousel loaded",
|
|
12
|
+
"openai/widgetAccessible": true,
|
|
13
|
+
"openai/resultCanProduceWidget": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"callToolResult": {
|
|
17
|
+
"structuredContent": {
|
|
18
|
+
"places": [
|
|
19
|
+
{
|
|
20
|
+
"id": "1",
|
|
21
|
+
"name": "Lady Bird Lake",
|
|
22
|
+
"rating": 4.5,
|
|
23
|
+
"category": "Waterfront",
|
|
24
|
+
"location": "Austin",
|
|
25
|
+
"image": "https://images.unsplash.com/photo-1520950237264-dfe336995c34?w=400&h=400&fit=crop",
|
|
26
|
+
"description": "Scenic lake perfect for kayaking, paddleboarding, and trails."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "2",
|
|
30
|
+
"name": "Texas State Capitol",
|
|
31
|
+
"rating": 4.8,
|
|
32
|
+
"category": "Historic Site",
|
|
33
|
+
"location": "Austin",
|
|
34
|
+
"image": "https://images.unsplash.com/photo-1664231978322-4d0b45c7027b?w=400&h=400&fit=crop",
|
|
35
|
+
"description": "Stunning capitol building with free tours and beautiful grounds."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "3",
|
|
39
|
+
"name": "The Paramount Theatre",
|
|
40
|
+
"rating": 4.7,
|
|
41
|
+
"category": "Architecture",
|
|
42
|
+
"location": "Austin",
|
|
43
|
+
"image": "https://images.unsplash.com/photo-1583097090970-4d3b940ea1a0?w=400&h=400&fit=crop",
|
|
44
|
+
"description": "Century-old performance and movie theatre in the heart of downtown Austin."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "4",
|
|
48
|
+
"name": "Zilker Park",
|
|
49
|
+
"rating": 4.7,
|
|
50
|
+
"category": "Park",
|
|
51
|
+
"location": "Austin",
|
|
52
|
+
"image": "https://images.unsplash.com/photo-1563828568124-f800803ba13c?w=400&h=400&fit=crop",
|
|
53
|
+
"description": "Popular park with trails, sports fields, and Barton Springs Pool."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "5",
|
|
57
|
+
"name": "South Congress Avenue",
|
|
58
|
+
"rating": 4.6,
|
|
59
|
+
"category": "Landmark",
|
|
60
|
+
"location": "Austin",
|
|
61
|
+
"image": "https://images.unsplash.com/photo-1588993608283-7f0eda4438be?w=400&h=400&fit=crop",
|
|
62
|
+
"description": "Vibrant street with unique shops, restaurants, and live music."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"_meta": {}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -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 CarouselState extends Record<string, unknown> {
|
|
10
10
|
currentIndex?: number;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-discovers and re-exports all resource components.
|
|
3
3
|
*
|
|
4
|
-
* Discovers all
|
|
5
|
-
* with a PascalCase name (e.g.,
|
|
4
|
+
* Discovers all {resource}/{resource}-resource.tsx files and exports their component
|
|
5
|
+
* with a PascalCase name (e.g., albums/albums-resource.tsx -> AlbumsResource).
|
|
6
6
|
*
|
|
7
7
|
* Supports both export styles:
|
|
8
8
|
* - Default export: export default MyComponent
|
|
9
|
-
* - Named export: export const
|
|
9
|
+
* - Named export: export const AlbumsResource = ...
|
|
10
10
|
*/
|
|
11
11
|
import { createResourceExports } from 'sunpeak';
|
|
12
12
|
|
|
13
|
-
// Auto-discover all resource component files
|
|
14
|
-
const resourceModules = import.meta.glob('
|
|
13
|
+
// Auto-discover all resource component files in subdirectories
|
|
14
|
+
const resourceModules = import.meta.glob('./*/*-resource.tsx', { eager: true });
|
|
15
15
|
|
|
16
16
|
// Build exports object from discovered files using library helper
|
|
17
17
|
export default createResourceExports(resourceModules);
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import mapboxgl from 'mapbox-gl';
|
|
3
3
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
4
4
|
import { useMaxHeight } from 'sunpeak';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '../../../lib/index';
|
|
6
6
|
import type { Place } from './types';
|
|
7
7
|
|
|
8
8
|
// Public Mapbox token for demo purposes
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from 'sunpeak';
|
|
9
9
|
import { Button } from '@openai/apps-sdk-ui/components/Button';
|
|
10
10
|
import { ExpandLg } from '@openai/apps-sdk-ui/components/Icon';
|
|
11
|
-
import { cn } from '
|
|
11
|
+
import { cn } from '../../../lib/index';
|
|
12
12
|
import { PlaceList } from './place-list';
|
|
13
13
|
import { PlaceCarousel } from './place-carousel';
|
|
14
14
|
import { PlaceInspector } from './place-inspector';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Button } from '@openai/apps-sdk-ui/components/Button';
|
|
3
3
|
import { Avatar } from '@openai/apps-sdk-ui/components/Avatar';
|
|
4
4
|
import { X, Star } from '@openai/apps-sdk-ui/components/Icon';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '../../../lib/index';
|
|
6
6
|
import type { Place } from './types';
|
|
7
7
|
|
|
8
8
|
export type PlaceInspectorProps = {
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userMessage": "Find pizza near me",
|
|
3
|
+
"tool": {
|
|
4
|
+
"name": "show-map",
|
|
5
|
+
"description": "Show the map",
|
|
6
|
+
"inputSchema": { "type": "object", "properties": {}, "additionalProperties": false },
|
|
7
|
+
"title": "Show Map",
|
|
8
|
+
"annotations": { "readOnlyHint": true },
|
|
9
|
+
"_meta": {
|
|
10
|
+
"openai/toolInvocation/invoking": "Finding pizza places",
|
|
11
|
+
"openai/toolInvocation/invoked": "Found pizza places",
|
|
12
|
+
"openai/widgetAccessible": true,
|
|
13
|
+
"openai/resultCanProduceWidget": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"callToolResult": {
|
|
17
|
+
"structuredContent": {
|
|
18
|
+
"places": [
|
|
19
|
+
{
|
|
20
|
+
"id": "nova-slice-lab",
|
|
21
|
+
"name": "Nova Slice Lab",
|
|
22
|
+
"coords": [-122.4098, 37.8001],
|
|
23
|
+
"description": "Award-winning Neapolitan pies in North Beach.",
|
|
24
|
+
"city": "North Beach",
|
|
25
|
+
"rating": 4.8,
|
|
26
|
+
"price": "$$$",
|
|
27
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "midnight-marinara",
|
|
31
|
+
"name": "Midnight Marinara",
|
|
32
|
+
"coords": [-122.4093, 37.799],
|
|
33
|
+
"description": "Focaccia-style squares, late-night favorite.",
|
|
34
|
+
"city": "North Beach",
|
|
35
|
+
"rating": 4.6,
|
|
36
|
+
"price": "$",
|
|
37
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "cinder-oven-co",
|
|
41
|
+
"name": "Cinder Oven Co.",
|
|
42
|
+
"coords": [-122.4255, 37.7613],
|
|
43
|
+
"description": "Thin-crust classics on 18th Street.",
|
|
44
|
+
"city": "Mission",
|
|
45
|
+
"rating": 4.5,
|
|
46
|
+
"price": "$$",
|
|
47
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "neon-crust-works",
|
|
51
|
+
"name": "Neon Crust Works",
|
|
52
|
+
"coords": [-122.4388, 37.7775],
|
|
53
|
+
"description": "Deep-dish and cornmeal crust favorites.",
|
|
54
|
+
"city": "Alamo Square",
|
|
55
|
+
"rating": 4.5,
|
|
56
|
+
"price": "$$",
|
|
57
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "luna-pie-collective",
|
|
61
|
+
"name": "Luna Pie Collective",
|
|
62
|
+
"coords": [-122.4077, 37.799],
|
|
63
|
+
"description": "Wood-fired pies and burrata in North Beach.",
|
|
64
|
+
"city": "North Beach",
|
|
65
|
+
"rating": 4.6,
|
|
66
|
+
"price": "$$",
|
|
67
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-4.png"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "bricklight-deep-dish",
|
|
71
|
+
"name": "Bricklight Deep Dish",
|
|
72
|
+
"coords": [-122.4097, 37.7992],
|
|
73
|
+
"description": "Chicago-style pies from Tony Gemignani.",
|
|
74
|
+
"city": "North Beach",
|
|
75
|
+
"rating": 4.4,
|
|
76
|
+
"price": "$$$",
|
|
77
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-5.png"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "garden-ember-pies",
|
|
81
|
+
"name": "Garden Ember Pies",
|
|
82
|
+
"coords": [-122.438, 37.7722],
|
|
83
|
+
"description": "Neighborhood spot with seasonal toppings.",
|
|
84
|
+
"city": "Lower Haight",
|
|
85
|
+
"rating": 4.4,
|
|
86
|
+
"price": "$$",
|
|
87
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-1.png"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "atlas-fire-pizzeria",
|
|
91
|
+
"name": "Atlas Fire Pizzeria",
|
|
92
|
+
"coords": [-122.4123, 37.7899],
|
|
93
|
+
"description": "Sourdough, wood-fired pies near Nob Hill.",
|
|
94
|
+
"city": "Nob Hill",
|
|
95
|
+
"rating": 4.6,
|
|
96
|
+
"price": "$$$",
|
|
97
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-2.png"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "circuit-slice-garage",
|
|
101
|
+
"name": "Circuit Slice Garage",
|
|
102
|
+
"coords": [-122.4135, 37.7805],
|
|
103
|
+
"description": "Crispy-edged Detroit-style in SoMa.",
|
|
104
|
+
"city": "SoMa",
|
|
105
|
+
"rating": 4.5,
|
|
106
|
+
"price": "$$",
|
|
107
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-3.png"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "velvet-mozza-lounge",
|
|
111
|
+
"name": "Velvet Mozza Lounge",
|
|
112
|
+
"coords": [-122.4019, 37.7818],
|
|
113
|
+
"description": "Bianca pies and cocktails near Yerba Buena.",
|
|
114
|
+
"city": "Yerba Buena",
|
|
115
|
+
"rating": 4.3,
|
|
116
|
+
"price": "$$",
|
|
117
|
+
"thumbnail": "https://persistent.oaistatic.com/pizzaz/pizzaz-6.png"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"_meta": {}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userMessage": "I'd like to refactor the authentication module",
|
|
3
|
+
"tool": {
|
|
4
|
+
"name": "diff-review",
|
|
5
|
+
"description": "Show a review dialog for a proposed code diff",
|
|
6
|
+
"inputSchema": { "type": "object", "properties": {}, "additionalProperties": false },
|
|
7
|
+
"title": "Diff Review",
|
|
8
|
+
"annotations": { "readOnlyHint": false },
|
|
9
|
+
"_meta": {
|
|
10
|
+
"openai/toolInvocation/invoking": "Preparing changes",
|
|
11
|
+
"openai/toolInvocation/invoked": "Changes ready for review",
|
|
12
|
+
"openai/widgetAccessible": true,
|
|
13
|
+
"openai/resultCanProduceWidget": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"callToolResult": {
|
|
17
|
+
"structuredContent": {
|
|
18
|
+
"title": "Refactor Authentication Module",
|
|
19
|
+
"description": "The following changes will update the authentication system to use JWT tokens instead of session-based auth.",
|
|
20
|
+
"sections": [
|
|
21
|
+
{
|
|
22
|
+
"title": "File Changes",
|
|
23
|
+
"type": "changes",
|
|
24
|
+
"content": [
|
|
25
|
+
{
|
|
26
|
+
"id": "1",
|
|
27
|
+
"type": "create",
|
|
28
|
+
"path": "src/lib/jwt.ts",
|
|
29
|
+
"description": "Create JWT utility functions",
|
|
30
|
+
"details": "Token generation, verification, and refresh logic"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "2",
|
|
34
|
+
"type": "modify",
|
|
35
|
+
"path": "src/middleware/auth.ts",
|
|
36
|
+
"description": "Update auth middleware to use JWT",
|
|
37
|
+
"details": "Replace session checks with JWT verification"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "3",
|
|
41
|
+
"type": "modify",
|
|
42
|
+
"path": "src/routes/login.ts",
|
|
43
|
+
"description": "Update login endpoint to return JWT tokens"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "4",
|
|
47
|
+
"type": "delete",
|
|
48
|
+
"path": "src/lib/session.ts",
|
|
49
|
+
"description": "Remove deprecated session management",
|
|
50
|
+
"details": "No longer needed after JWT migration"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "5",
|
|
54
|
+
"type": "action",
|
|
55
|
+
"description": "Run database migration for token storage",
|
|
56
|
+
"details": "Creates refresh_tokens table"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"acceptLabel": "Apply Changes",
|
|
62
|
+
"rejectLabel": "Cancel",
|
|
63
|
+
"acceptedMessage": "Changes applied",
|
|
64
|
+
"rejectedMessage": "Changes cancelled",
|
|
65
|
+
"reviewTool": {
|
|
66
|
+
"name": "apply_changes",
|
|
67
|
+
"arguments": {
|
|
68
|
+
"changesetId": "cs_789",
|
|
69
|
+
"files": [
|
|
70
|
+
"src/lib/jwt.ts",
|
|
71
|
+
"src/middleware/auth.ts",
|
|
72
|
+
"src/routes/login.ts",
|
|
73
|
+
"src/lib/session.ts"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"_meta": {}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userMessage": "Post this to my social media",
|
|
3
|
+
"tool": {
|
|
4
|
+
"name": "review-post",
|
|
5
|
+
"description": "Review a social media post before publishing",
|
|
6
|
+
"inputSchema": { "type": "object", "properties": {}, "additionalProperties": false },
|
|
7
|
+
"title": "Review Post",
|
|
8
|
+
"annotations": { "readOnlyHint": false },
|
|
9
|
+
"_meta": {
|
|
10
|
+
"openai/toolInvocation/invoking": "Preparing post",
|
|
11
|
+
"openai/toolInvocation/invoked": "Post ready for review",
|
|
12
|
+
"openai/widgetAccessible": true,
|
|
13
|
+
"openai/resultCanProduceWidget": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"callToolResult": {
|
|
17
|
+
"structuredContent": {
|
|
18
|
+
"title": "Review Your Post",
|
|
19
|
+
"description": "This post will be published to your connected accounts.",
|
|
20
|
+
"sections": [
|
|
21
|
+
{
|
|
22
|
+
"title": "Content",
|
|
23
|
+
"type": "preview",
|
|
24
|
+
"content": "Just shipped a major update to our app! 🚀\n\nNew features include:\n• Dark mode support\n• Faster load times\n• Bug fixes and improvements\n\nThanks to everyone who provided feedback. You all are amazing! 💪\n\n#ProductUpdate #TechNews #Startup"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Post Details",
|
|
28
|
+
"type": "details",
|
|
29
|
+
"content": [
|
|
30
|
+
{ "label": "Platforms", "value": "X, LinkedIn" },
|
|
31
|
+
{ "label": "Schedule", "value": "Post immediately" },
|
|
32
|
+
{ "label": "Visibility", "value": "Public" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"alerts": [
|
|
37
|
+
{
|
|
38
|
+
"type": "warning",
|
|
39
|
+
"message": "This post contains hashtags that may limit reach on some platforms."
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"acceptLabel": "Publish",
|
|
43
|
+
"rejectLabel": "Cancel",
|
|
44
|
+
"acceptedMessage": "Post published!",
|
|
45
|
+
"rejectedMessage": "Post cancelled",
|
|
46
|
+
"reviewTool": {
|
|
47
|
+
"name": "publish_post",
|
|
48
|
+
"arguments": {
|
|
49
|
+
"postId": "draft_456",
|
|
50
|
+
"platforms": ["x", "linkedin"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"_meta": {}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userMessage": "I want to buy these items",
|
|
3
|
+
"tool": {
|
|
4
|
+
"name": "review-purchase",
|
|
5
|
+
"description": "Review a purchase before completing the transaction",
|
|
6
|
+
"inputSchema": { "type": "object", "properties": {}, "additionalProperties": false },
|
|
7
|
+
"title": "Review Purchase",
|
|
8
|
+
"annotations": { "readOnlyHint": false },
|
|
9
|
+
"_meta": {
|
|
10
|
+
"openai/toolInvocation/invoking": "Preparing order",
|
|
11
|
+
"openai/toolInvocation/invoked": "Order ready for review",
|
|
12
|
+
"openai/widgetAccessible": true,
|
|
13
|
+
"openai/resultCanProduceWidget": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"callToolResult": {
|
|
17
|
+
"structuredContent": {
|
|
18
|
+
"title": "Confirm Your Order",
|
|
19
|
+
"description": "Please review your order before completing the purchase.",
|
|
20
|
+
"alerts": [
|
|
21
|
+
{
|
|
22
|
+
"type": "info",
|
|
23
|
+
"message": "Free shipping on orders over $50!"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"sections": [
|
|
27
|
+
{
|
|
28
|
+
"title": "Items",
|
|
29
|
+
"type": "items",
|
|
30
|
+
"content": [
|
|
31
|
+
{
|
|
32
|
+
"id": "1",
|
|
33
|
+
"title": "Wireless Headphones",
|
|
34
|
+
"subtitle": "Black, Over-ear",
|
|
35
|
+
"image": "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=100&h=100&fit=crop",
|
|
36
|
+
"value": "$79.99"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "2",
|
|
40
|
+
"title": "USB-C Charging Cable",
|
|
41
|
+
"subtitle": "2m, Braided",
|
|
42
|
+
"image": "https://images.unsplash.com/photo-1588872657578-7efd1f1555ed?w=100&h=100&fit=crop",
|
|
43
|
+
"value": "$12.99",
|
|
44
|
+
"badge": "Sale"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "3",
|
|
48
|
+
"title": "Phone Case",
|
|
49
|
+
"subtitle": "Clear, iPhone 15 Pro",
|
|
50
|
+
"image": "https://images.unsplash.com/photo-1601784551446-20c9e07cdbdb?w=100&h=100&fit=crop",
|
|
51
|
+
"value": "$24.99"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"title": "Shipping",
|
|
57
|
+
"type": "details",
|
|
58
|
+
"content": [
|
|
59
|
+
{ "label": "Method", "value": "Standard (5-7 days)" },
|
|
60
|
+
{ "label": "Address", "value": "123 Main St, Austin, TX", "sublabel": "John Doe" }
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"type": "summary",
|
|
65
|
+
"content": [
|
|
66
|
+
{ "label": "Subtotal", "value": "$117.97" },
|
|
67
|
+
{ "label": "Shipping", "value": "FREE" },
|
|
68
|
+
{ "label": "Tax", "value": "$9.68" },
|
|
69
|
+
{ "label": "Total", "value": "$127.65", "emphasis": true }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"acceptLabel": "Place Order",
|
|
74
|
+
"rejectLabel": "Cancel",
|
|
75
|
+
"acceptedMessage": "Order placed!",
|
|
76
|
+
"rejectedMessage": "Order cancelled",
|
|
77
|
+
"reviewTool": {
|
|
78
|
+
"name": "complete_purchase",
|
|
79
|
+
"arguments": {
|
|
80
|
+
"orderId": "order_123",
|
|
81
|
+
"items": ["1", "2", "3"],
|
|
82
|
+
"total": 127.65
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"_meta": {}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function toPascalCase(str) {
|
|
3
|
-
return str.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
4
|
-
}
|
|
5
|
-
function extractResourceKey(path) {
|
|
6
|
-
const match = path.match(/([^/]+)-resource\.(tsx|json)$/);
|
|
7
|
-
return match == null ? void 0 : match[1];
|
|
8
|
-
}
|
|
9
|
-
function extractSimulationKey(path) {
|
|
10
|
-
const match = path.match(/([^/]+)-simulation\.json$/);
|
|
11
|
-
return match == null ? void 0 : match[1];
|
|
12
|
-
}
|
|
13
|
-
function findResourceKey(simulationKey, resourceKeys) {
|
|
14
|
-
const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);
|
|
15
|
-
for (const resourceKey of sorted) {
|
|
16
|
-
if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + "-")) {
|
|
17
|
-
return resourceKey;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return void 0;
|
|
21
|
-
}
|
|
22
|
-
function getComponentName(resourceKey) {
|
|
23
|
-
return `${toPascalCase(resourceKey)}Resource`;
|
|
24
|
-
}
|
|
25
|
-
function createResourceExports(modules) {
|
|
26
|
-
const resources = {};
|
|
27
|
-
for (const [path, module2] of Object.entries(modules)) {
|
|
28
|
-
const key = extractResourceKey(path);
|
|
29
|
-
if (!key) continue;
|
|
30
|
-
const exportName = getComponentName(key);
|
|
31
|
-
const mod = module2;
|
|
32
|
-
const component = mod.default ?? mod[exportName];
|
|
33
|
-
if (component && (typeof component === "function" || typeof component === "object")) {
|
|
34
|
-
resources[exportName] = component;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return resources;
|
|
38
|
-
}
|
|
39
|
-
function createSimulationIndex(modules) {
|
|
40
|
-
return Object.fromEntries(
|
|
41
|
-
Object.entries(modules).map(([path, module2]) => {
|
|
42
|
-
const key = extractSimulationKey(path);
|
|
43
|
-
if (!key) return null;
|
|
44
|
-
return [key, module2.default];
|
|
45
|
-
}).filter((entry) => entry !== null)
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
function buildResourceMap(modules) {
|
|
49
|
-
const map = /* @__PURE__ */ new Map();
|
|
50
|
-
for (const [path, module2] of Object.entries(modules)) {
|
|
51
|
-
const key = extractResourceKey(path);
|
|
52
|
-
if (key) {
|
|
53
|
-
map.set(key, module2.default);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return map;
|
|
57
|
-
}
|
|
58
|
-
function buildSimulations(options) {
|
|
59
|
-
const {
|
|
60
|
-
simulationModules,
|
|
61
|
-
resourcesMap,
|
|
62
|
-
resourceComponents,
|
|
63
|
-
createSimulation,
|
|
64
|
-
onMissingResource = (key, prefix) => console.warn(
|
|
65
|
-
`No matching resource found for simulation "${key}". Expected a resource file like src/resources/${prefix}-resource.json`
|
|
66
|
-
)
|
|
67
|
-
} = options;
|
|
68
|
-
const resourceKeys = Array.from(resourcesMap.keys());
|
|
69
|
-
const simulations = {};
|
|
70
|
-
for (const [path, module2] of Object.entries(simulationModules)) {
|
|
71
|
-
const simulationKey = extractSimulationKey(path);
|
|
72
|
-
if (!simulationKey) continue;
|
|
73
|
-
const simulationData = module2.default;
|
|
74
|
-
const resourceKey = findResourceKey(simulationKey, resourceKeys);
|
|
75
|
-
if (!resourceKey) {
|
|
76
|
-
onMissingResource(simulationKey, simulationKey.split("-")[0]);
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
const resource = resourcesMap.get(resourceKey);
|
|
80
|
-
const componentName = getComponentName(resourceKey);
|
|
81
|
-
const resourceComponent = resourceComponents[componentName];
|
|
82
|
-
if (!resourceComponent) {
|
|
83
|
-
console.warn(
|
|
84
|
-
`Resource component "${componentName}" not found for resource "${resourceKey}". Make sure src/resources/${resourceKey}-resource.tsx exists with a default export.`
|
|
85
|
-
);
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
simulations[simulationKey] = createSimulation(
|
|
89
|
-
simulationKey,
|
|
90
|
-
simulationData,
|
|
91
|
-
resource,
|
|
92
|
-
resourceComponent
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
return simulations;
|
|
96
|
-
}
|
|
97
|
-
function buildDevSimulations(options) {
|
|
98
|
-
const { simulationModules, resourceModules, resourceComponents } = options;
|
|
99
|
-
const resourcesMap = buildResourceMap(resourceModules);
|
|
100
|
-
return buildSimulations({
|
|
101
|
-
simulationModules,
|
|
102
|
-
resourcesMap,
|
|
103
|
-
resourceComponents,
|
|
104
|
-
createSimulation: (simulationKey, simulationData, resource, resourceComponent) => ({
|
|
105
|
-
...simulationData,
|
|
106
|
-
name: simulationKey,
|
|
107
|
-
resource: {
|
|
108
|
-
uri: `ui://${resource.name}`,
|
|
109
|
-
...resource
|
|
110
|
-
},
|
|
111
|
-
resourceComponent
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
exports.buildDevSimulations = buildDevSimulations;
|
|
116
|
-
exports.buildResourceMap = buildResourceMap;
|
|
117
|
-
exports.buildSimulations = buildSimulations;
|
|
118
|
-
exports.createResourceExports = createResourceExports;
|
|
119
|
-
exports.createSimulationIndex = createSimulationIndex;
|
|
120
|
-
exports.extractResourceKey = extractResourceKey;
|
|
121
|
-
exports.extractSimulationKey = extractSimulationKey;
|
|
122
|
-
exports.findResourceKey = findResourceKey;
|
|
123
|
-
exports.getComponentName = getComponentName;
|
|
124
|
-
exports.toPascalCase = toPascalCase;
|
|
125
|
-
//# sourceMappingURL=discovery-a4WId9PC.cjs.map
|