sunpeak 0.2.6 → 0.3.3
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 +32 -17
- package/dist/chatgpt/chatgpt-simulator-types.d.ts +8 -0
- package/dist/chatgpt/chatgpt-simulator.d.ts +11 -0
- package/dist/chatgpt/conversation.d.ts +11 -0
- package/dist/chatgpt/index.d.ts +3 -0
- package/dist/chatgpt/mcp-provider.d.ts +25 -0
- package/dist/chatgpt/mock-openai.d.ts +61 -0
- package/dist/chatgpt/openai-provider.d.ts +19 -0
- package/dist/chatgpt/openai-types.d.ts +81 -0
- package/dist/chatgpt/simple-sidebar.d.ts +22 -0
- package/dist/chatgpt/theme-provider.d.ts +13 -0
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/use-display-mode.d.ts +2 -0
- package/dist/hooks/use-locale.d.ts +1 -0
- package/dist/hooks/use-max-height.d.ts +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-safe-area.d.ts +2 -0
- package/dist/hooks/use-theme.d.ts +2 -0
- package/dist/hooks/use-tool-input.d.ts +2 -0
- package/dist/hooks/use-tool-response-metadata.d.ts +2 -0
- package/dist/hooks/use-user-agent.d.ts +2 -0
- package/dist/hooks/use-view.d.ts +2 -0
- package/dist/hooks/use-widget-api.d.ts +8 -0
- package/dist/hooks/use-widget-global.d.ts +9 -0
- package/dist/hooks/use-widget-props.d.ts +1 -0
- package/dist/hooks/use-widget-state.d.ts +4 -0
- package/dist/index.cjs +3310 -666
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -366
- package/dist/index.js +3325 -640
- package/dist/index.js.map +1 -1
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/media-queries.d.ts +3 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/mcp/index.cjs +799 -64
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +1 -12
- package/dist/mcp/index.js +786 -44
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/types.d.ts +74 -0
- package/dist/providers/index.d.ts +40 -0
- package/dist/providers/types.d.ts +71 -0
- package/dist/style.css +5279 -0
- package/dist/test/setup.d.ts +0 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +15 -20
- package/template/README.md +3 -6
- package/template/dev/main.tsx +0 -1
- package/template/mcp/server.ts +1 -1
- package/template/package.json +4 -14
- package/template/src/App.tsx +7 -8
- package/template/src/components/index.ts +2 -2
- package/template/src/components/openai-card.test.tsx +73 -0
- package/template/src/components/openai-card.tsx +126 -0
- package/template/src/components/openai-carousel.test.tsx +84 -0
- package/template/src/components/openai-carousel.tsx +178 -0
- package/template/src/styles/globals.css +5 -216
- package/template/vite.config.build.ts +61 -0
- package/template/vite.config.ts +0 -2
- package/dist/index.d.cts +0 -366
- package/dist/mcp/index.d.cts +0 -12
- package/dist/styles/chatgpt/index.css +0 -146
- package/dist/styles/globals.css +0 -219
- package/template/components.json +0 -21
- package/template/dev/styles.css +0 -6
- package/template/postcss.config.js +0 -5
- package/template/src/components/shadcn/button.tsx +0 -60
- package/template/src/components/shadcn/card.tsx +0 -76
- package/template/src/components/shadcn/carousel.tsx +0 -260
- package/template/src/components/shadcn/index.ts +0 -5
- package/template/src/components/shadcn/label.tsx +0 -24
- package/template/src/components/shadcn/select.tsx +0 -157
- package/template/src/components/sunpeak-card.test.tsx +0 -76
- package/template/src/components/sunpeak-card.tsx +0 -171
- package/template/src/components/sunpeak-carousel.test.tsx +0 -42
- package/template/src/components/sunpeak-carousel.tsx +0 -160
- package/template/src/styles/chatgpt.css +0 -146
- package/template/tsup.config.ts +0 -50
package/dist/index.d.cts
DELETED
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { SetStateAction } from 'react';
|
|
4
|
-
import { ClassValue } from 'clsx';
|
|
5
|
-
|
|
6
|
-
type Theme$1 = "light" | "dark";
|
|
7
|
-
type ThemeProviderProps = {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
defaultTheme?: Theme$1;
|
|
10
|
-
theme?: Theme$1;
|
|
11
|
-
};
|
|
12
|
-
type ThemeProviderState = {
|
|
13
|
-
theme: Theme$1;
|
|
14
|
-
};
|
|
15
|
-
declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
16
|
-
declare const useThemeContext: () => ThemeProviderState;
|
|
17
|
-
|
|
18
|
-
type UnknownObject = Record<string, unknown>;
|
|
19
|
-
type Theme = 'light' | 'dark';
|
|
20
|
-
type SafeAreaInsets = {
|
|
21
|
-
top: number;
|
|
22
|
-
bottom: number;
|
|
23
|
-
left: number;
|
|
24
|
-
right: number;
|
|
25
|
-
};
|
|
26
|
-
type SafeArea = {
|
|
27
|
-
insets: SafeAreaInsets;
|
|
28
|
-
};
|
|
29
|
-
type DeviceType = 'mobile' | 'tablet' | 'desktop' | 'unknown';
|
|
30
|
-
type UserAgent = {
|
|
31
|
-
device: {
|
|
32
|
-
type: DeviceType;
|
|
33
|
-
};
|
|
34
|
-
capabilities: {
|
|
35
|
-
hover: boolean;
|
|
36
|
-
touch: boolean;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
type DisplayMode = 'pip' | 'inline' | 'fullscreen';
|
|
40
|
-
type RequestDisplayMode = (args: {
|
|
41
|
-
mode: DisplayMode;
|
|
42
|
-
}) => Promise<{
|
|
43
|
-
mode: DisplayMode;
|
|
44
|
-
}>;
|
|
45
|
-
type ViewMode = 'modal' | 'default';
|
|
46
|
-
type View = {
|
|
47
|
-
mode: ViewMode;
|
|
48
|
-
params?: UnknownObject;
|
|
49
|
-
};
|
|
50
|
-
type CallToolResponse = {
|
|
51
|
-
result: string;
|
|
52
|
-
};
|
|
53
|
-
type CallTool = (name: string, args: Record<string, unknown>) => Promise<CallToolResponse>;
|
|
54
|
-
type OpenAiGlobals<ToolInput = UnknownObject, ToolOutput = UnknownObject, ToolResponseMetadata = UnknownObject, WidgetState = UnknownObject> = {
|
|
55
|
-
theme: Theme;
|
|
56
|
-
userAgent: UserAgent;
|
|
57
|
-
locale: string;
|
|
58
|
-
maxHeight: number;
|
|
59
|
-
displayMode: DisplayMode;
|
|
60
|
-
safeArea: SafeArea;
|
|
61
|
-
view: View | null;
|
|
62
|
-
toolInput: ToolInput;
|
|
63
|
-
toolOutput: ToolOutput | null;
|
|
64
|
-
toolResponseMetadata: ToolResponseMetadata | null;
|
|
65
|
-
widgetState: WidgetState | null;
|
|
66
|
-
setWidgetState: (state: WidgetState) => Promise<void>;
|
|
67
|
-
};
|
|
68
|
-
type RequestModal = (args: {
|
|
69
|
-
mode: ViewMode;
|
|
70
|
-
params?: UnknownObject;
|
|
71
|
-
}) => Promise<void>;
|
|
72
|
-
type NotifyIntrinsicHeight = (height: number) => void;
|
|
73
|
-
type OpenAiAPI = {
|
|
74
|
-
callTool: CallTool;
|
|
75
|
-
sendFollowUpMessage: (args: {
|
|
76
|
-
prompt: string;
|
|
77
|
-
}) => Promise<void>;
|
|
78
|
-
openExternal(payload: {
|
|
79
|
-
href: string;
|
|
80
|
-
}): void;
|
|
81
|
-
requestDisplayMode: RequestDisplayMode;
|
|
82
|
-
requestModal: RequestModal;
|
|
83
|
-
notifyIntrinsicHeight: NotifyIntrinsicHeight;
|
|
84
|
-
};
|
|
85
|
-
declare const SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
|
|
86
|
-
declare class SetGlobalsEvent extends CustomEvent<{
|
|
87
|
-
globals: Partial<OpenAiGlobals>;
|
|
88
|
-
}> {
|
|
89
|
-
readonly type = "openai:set_globals";
|
|
90
|
-
}
|
|
91
|
-
declare global {
|
|
92
|
-
interface Window {
|
|
93
|
-
openai: OpenAiAPI & OpenAiGlobals;
|
|
94
|
-
}
|
|
95
|
-
interface WindowEventMap {
|
|
96
|
-
[SET_GLOBALS_EVENT_TYPE]: SetGlobalsEvent;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Provider-agnostic types for widget runtime environments.
|
|
102
|
-
* These types abstract away the specific host (OpenAI/ChatGPT, etc.)
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Global state available from the widget runtime environment.
|
|
107
|
-
* This is a provider-agnostic alias for OpenAiGlobals.
|
|
108
|
-
*/
|
|
109
|
-
type WidgetGlobals<ToolInput = UnknownObject, ToolOutput = UnknownObject, ToolResponseMetadata = UnknownObject, WidgetState = UnknownObject> = {
|
|
110
|
-
theme: Theme;
|
|
111
|
-
userAgent: UserAgent;
|
|
112
|
-
locale: string;
|
|
113
|
-
maxHeight: number;
|
|
114
|
-
displayMode: DisplayMode;
|
|
115
|
-
safeArea: SafeArea;
|
|
116
|
-
view: View | null;
|
|
117
|
-
toolInput: ToolInput;
|
|
118
|
-
toolOutput: ToolOutput | null;
|
|
119
|
-
toolResponseMetadata: ToolResponseMetadata | null;
|
|
120
|
-
widgetState: WidgetState | null;
|
|
121
|
-
setWidgetState: (state: WidgetState) => Promise<void>;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* API methods available from the widget runtime environment.
|
|
125
|
-
* This is a provider-agnostic alias for OpenAiAPI.
|
|
126
|
-
*/
|
|
127
|
-
type WidgetAPI = {
|
|
128
|
-
callTool?: (name: string, args: Record<string, unknown>) => Promise<CallToolResponse>;
|
|
129
|
-
sendFollowUpMessage?: (args: {
|
|
130
|
-
prompt: string;
|
|
131
|
-
}) => Promise<void>;
|
|
132
|
-
openExternal?: (payload: {
|
|
133
|
-
href: string;
|
|
134
|
-
}) => void;
|
|
135
|
-
requestDisplayMode?: (args: {
|
|
136
|
-
mode: DisplayMode;
|
|
137
|
-
}) => Promise<{
|
|
138
|
-
mode: DisplayMode;
|
|
139
|
-
}>;
|
|
140
|
-
requestModal?: (args: {
|
|
141
|
-
mode: ViewMode;
|
|
142
|
-
params?: UnknownObject;
|
|
143
|
-
}) => Promise<void>;
|
|
144
|
-
notifyIntrinsicHeight?: (height: number) => void;
|
|
145
|
-
setWidgetState?: (state: UnknownObject) => Promise<void>;
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Provider interface that abstracts the widget runtime environment.
|
|
149
|
-
* Each host (OpenAI, etc.) implements this interface.
|
|
150
|
-
*/
|
|
151
|
-
interface WidgetProvider {
|
|
152
|
-
/**
|
|
153
|
-
* Unique identifier for the provider.
|
|
154
|
-
*/
|
|
155
|
-
readonly id: string;
|
|
156
|
-
/**
|
|
157
|
-
* Get the current value of a global property.
|
|
158
|
-
*/
|
|
159
|
-
getGlobal<K extends keyof WidgetGlobals>(key: K): WidgetGlobals[K] | null;
|
|
160
|
-
/**
|
|
161
|
-
* Subscribe to changes for a specific global property.
|
|
162
|
-
* Returns an unsubscribe function.
|
|
163
|
-
*/
|
|
164
|
-
subscribe(key: keyof WidgetGlobals, onChange: () => void): () => void;
|
|
165
|
-
/**
|
|
166
|
-
* Get the API methods, or null if not available.
|
|
167
|
-
*/
|
|
168
|
-
getAPI(): WidgetAPI | null;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* OpenAI/ChatGPT provider implementation.
|
|
173
|
-
* Bridges the OpenAI-specific window.openai API to the provider-agnostic interface.
|
|
174
|
-
*/
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Check if the OpenAI provider is available.
|
|
178
|
-
*/
|
|
179
|
-
declare function isOpenAiAvailable(): boolean;
|
|
180
|
-
/**
|
|
181
|
-
* OpenAI provider implementation.
|
|
182
|
-
*/
|
|
183
|
-
declare class OpenAiProvider implements WidgetProvider {
|
|
184
|
-
readonly id = "openai";
|
|
185
|
-
getGlobal<K extends keyof WidgetGlobals>(key: K): WidgetGlobals[K] | null;
|
|
186
|
-
subscribe(key: keyof WidgetGlobals, onChange: () => void): () => void;
|
|
187
|
-
getAPI(): WidgetAPI | null;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Get the OpenAI provider instance (singleton).
|
|
191
|
-
*/
|
|
192
|
-
declare function getOpenAiProvider(): OpenAiProvider;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Provider detection and routing.
|
|
196
|
-
*
|
|
197
|
-
* This module automatically detects which widget runtime environment is available
|
|
198
|
-
* and provides the appropriate provider. The detection happens once on first access,
|
|
199
|
-
* and subsequent calls return the cached provider directly.
|
|
200
|
-
*/
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Detect and return the appropriate provider for the current environment.
|
|
204
|
-
* This function caches the result, so detection only happens once.
|
|
205
|
-
*
|
|
206
|
-
* @returns The detected provider, or null if no provider is available.
|
|
207
|
-
*/
|
|
208
|
-
declare function getProvider(): WidgetProvider | null;
|
|
209
|
-
/**
|
|
210
|
-
* Check if any provider is available.
|
|
211
|
-
*/
|
|
212
|
-
declare function isProviderAvailable(): boolean;
|
|
213
|
-
/**
|
|
214
|
-
* Get a global value from the detected provider.
|
|
215
|
-
*
|
|
216
|
-
* @param key - The global property key to retrieve.
|
|
217
|
-
* @returns The value, or null if not available.
|
|
218
|
-
*/
|
|
219
|
-
declare function getGlobal<K extends keyof WidgetGlobals>(key: K): WidgetGlobals[K] | null;
|
|
220
|
-
/**
|
|
221
|
-
* Subscribe to changes for a global property.
|
|
222
|
-
*
|
|
223
|
-
* @param key - The global property key to subscribe to.
|
|
224
|
-
* @param onChange - Callback to invoke when the value changes.
|
|
225
|
-
* @returns An unsubscribe function.
|
|
226
|
-
*/
|
|
227
|
-
declare function subscribeToGlobal(key: keyof WidgetGlobals, onChange: () => void): () => void;
|
|
228
|
-
/**
|
|
229
|
-
* Get the API from the detected provider.
|
|
230
|
-
*
|
|
231
|
-
* @returns The API object, or null if not available.
|
|
232
|
-
*/
|
|
233
|
-
declare function getAPI(): WidgetAPI | null;
|
|
234
|
-
/**
|
|
235
|
-
* Reset the provider detection cache.
|
|
236
|
-
* Useful for testing or when the environment changes.
|
|
237
|
-
*/
|
|
238
|
-
declare function resetProviderCache(): void;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Hook to read and subscribe to a global property from the widget runtime.
|
|
242
|
-
* Automatically detects and uses the appropriate provider (OpenAI, etc.).
|
|
243
|
-
*
|
|
244
|
-
* @param key - The global property key to read.
|
|
245
|
-
* @returns The current value, or null if not available.
|
|
246
|
-
*/
|
|
247
|
-
declare function useWidgetGlobal<K extends keyof WidgetGlobals>(key: K): WidgetGlobals[K] | null;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Hook to get the widget runtime API.
|
|
251
|
-
* Automatically detects and uses the appropriate provider (OpenAI, etc.).
|
|
252
|
-
*
|
|
253
|
-
* @returns The API object, or null if not available.
|
|
254
|
-
*/
|
|
255
|
-
declare function useWidgetAPI(): WidgetAPI | null;
|
|
256
|
-
|
|
257
|
-
type ScreenWidth = 'mobile-s' | 'mobile-l' | 'tablet' | 'full';
|
|
258
|
-
type SimulatorConfig = {
|
|
259
|
-
theme: Theme;
|
|
260
|
-
displayMode: DisplayMode;
|
|
261
|
-
screenWidth: ScreenWidth;
|
|
262
|
-
};
|
|
263
|
-
declare const SCREEN_WIDTHS: Record<ScreenWidth, number>;
|
|
264
|
-
|
|
265
|
-
declare const useDisplayMode: () => DisplayMode | null;
|
|
266
|
-
|
|
267
|
-
declare const useLocale: () => string | null;
|
|
268
|
-
|
|
269
|
-
declare const useMaxHeight: () => number | null;
|
|
270
|
-
|
|
271
|
-
declare function useIsMobile(): boolean;
|
|
272
|
-
|
|
273
|
-
declare const useSafeArea: () => SafeArea | null;
|
|
274
|
-
|
|
275
|
-
declare const useTheme: () => Theme | null;
|
|
276
|
-
|
|
277
|
-
declare function useToolInput<T extends UnknownObject = UnknownObject>(): T | null;
|
|
278
|
-
|
|
279
|
-
declare function useToolResponseMetadata<T extends UnknownObject = UnknownObject>(): T | null;
|
|
280
|
-
|
|
281
|
-
declare const useUserAgent: () => UserAgent | null;
|
|
282
|
-
|
|
283
|
-
declare function useView(): View | null;
|
|
284
|
-
|
|
285
|
-
declare function useWidgetProps<T extends Record<string, unknown>>(defaultState?: T | (() => T)): T;
|
|
286
|
-
|
|
287
|
-
declare function useWidgetState<T extends UnknownObject>(defaultState: T | (() => T)): readonly [T, (state: SetStateAction<T>) => void];
|
|
288
|
-
declare function useWidgetState<T extends UnknownObject>(defaultState?: T | (() => T | null) | null): readonly [T | null, (state: SetStateAction<T | null>) => void];
|
|
289
|
-
|
|
290
|
-
interface ChatGPTSimulatorProps {
|
|
291
|
-
children: React.ReactNode;
|
|
292
|
-
appName?: string;
|
|
293
|
-
appIcon?: string;
|
|
294
|
-
userMessage?: string;
|
|
295
|
-
toolOutput?: Record<string, unknown> | null;
|
|
296
|
-
widgetState?: Record<string, unknown> | null;
|
|
297
|
-
}
|
|
298
|
-
declare function ChatGPTSimulator({ children, appName, appIcon, userMessage, toolOutput, widgetState, }: ChatGPTSimulatorProps): react_jsx_runtime.JSX.Element;
|
|
299
|
-
|
|
300
|
-
declare class MockOpenAI implements OpenAiAPI, OpenAiGlobals {
|
|
301
|
-
theme: Theme;
|
|
302
|
-
userAgent: {
|
|
303
|
-
device: {
|
|
304
|
-
type: "desktop";
|
|
305
|
-
};
|
|
306
|
-
capabilities: {
|
|
307
|
-
hover: boolean;
|
|
308
|
-
touch: boolean;
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
locale: string;
|
|
312
|
-
maxHeight: number;
|
|
313
|
-
displayMode: DisplayMode;
|
|
314
|
-
safeArea: {
|
|
315
|
-
insets: {
|
|
316
|
-
top: number;
|
|
317
|
-
bottom: number;
|
|
318
|
-
left: number;
|
|
319
|
-
right: number;
|
|
320
|
-
};
|
|
321
|
-
};
|
|
322
|
-
view: View | null;
|
|
323
|
-
toolInput: Record<string, unknown>;
|
|
324
|
-
toolOutput: Record<string, unknown> | null;
|
|
325
|
-
toolResponseMetadata: Record<string, unknown> | null;
|
|
326
|
-
widgetState: Record<string, unknown> | null;
|
|
327
|
-
callTool(name: string, args: Record<string, unknown>): Promise<{
|
|
328
|
-
result: string;
|
|
329
|
-
}>;
|
|
330
|
-
sendFollowUpMessage(args: {
|
|
331
|
-
prompt: string;
|
|
332
|
-
}): Promise<void>;
|
|
333
|
-
openExternal(payload: {
|
|
334
|
-
href: string;
|
|
335
|
-
}): void;
|
|
336
|
-
requestDisplayMode(args: {
|
|
337
|
-
mode: DisplayMode;
|
|
338
|
-
}): Promise<{
|
|
339
|
-
mode: DisplayMode;
|
|
340
|
-
}>;
|
|
341
|
-
requestModal(args: {
|
|
342
|
-
mode: ViewMode;
|
|
343
|
-
params?: UnknownObject;
|
|
344
|
-
}): Promise<void>;
|
|
345
|
-
notifyIntrinsicHeight(height: number): void;
|
|
346
|
-
setWidgetState(state: Record<string, unknown>): Promise<void>;
|
|
347
|
-
setTheme(theme: Theme): void;
|
|
348
|
-
setDisplayMode(displayMode: DisplayMode): void;
|
|
349
|
-
setToolOutput(toolOutput: Record<string, unknown> | null): void;
|
|
350
|
-
setWidgetStateExternal(widgetState: Record<string, unknown> | null): void;
|
|
351
|
-
emitUpdate(globals: Partial<OpenAiGlobals>): void;
|
|
352
|
-
}
|
|
353
|
-
declare function initMockOpenAI(initialData?: {
|
|
354
|
-
theme?: Theme;
|
|
355
|
-
displayMode?: DisplayMode;
|
|
356
|
-
toolOutput?: Record<string, unknown> | null;
|
|
357
|
-
widgetState?: Record<string, unknown> | null;
|
|
358
|
-
}): MockOpenAI;
|
|
359
|
-
|
|
360
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
361
|
-
|
|
362
|
-
declare const prefersReducedMotion: () => boolean;
|
|
363
|
-
declare const isPrimarilyTouchDevice: () => boolean;
|
|
364
|
-
declare const isHoverAvailable: () => boolean;
|
|
365
|
-
|
|
366
|
-
export { type CallTool, type CallToolResponse, ChatGPTSimulator, type DeviceType, type DisplayMode, type NotifyIntrinsicHeight, type OpenAiAPI, type OpenAiGlobals, type RequestDisplayMode, type RequestModal, SCREEN_WIDTHS, SET_GLOBALS_EVENT_TYPE, type SafeArea, type SafeAreaInsets, type ScreenWidth, SetGlobalsEvent, type SimulatorConfig, type Theme, ThemeProvider, type UnknownObject, type UserAgent, type View, type ViewMode, type WidgetAPI, type WidgetGlobals, type WidgetProvider, cn, getAPI, getGlobal, getOpenAiProvider, getProvider, initMockOpenAI, isHoverAvailable, isOpenAiAvailable, isPrimarilyTouchDevice, isProviderAvailable, prefersReducedMotion, resetProviderCache, subscribeToGlobal, useDisplayMode, useIsMobile, useLocale, useMaxHeight, useSafeArea, useTheme, useThemeContext, useToolInput, useToolResponseMetadata, useUserAgent, useView, useWidgetAPI, useWidgetGlobal, useWidgetProps, useWidgetState };
|
package/dist/mcp/index.d.cts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface MCPServerConfig {
|
|
2
|
-
name?: string;
|
|
3
|
-
version?: string;
|
|
4
|
-
port?: number;
|
|
5
|
-
distPath: string;
|
|
6
|
-
toolName?: string;
|
|
7
|
-
toolDescription?: string;
|
|
8
|
-
dummyData?: Record<string, unknown>;
|
|
9
|
-
}
|
|
10
|
-
declare function runMCPServer(config: MCPServerConfig): void;
|
|
11
|
-
|
|
12
|
-
export { type MCPServerConfig, runMCPServer };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI ChatGPT Apps SDK Design System
|
|
3
|
-
*
|
|
4
|
-
* Implements Sunpeak base variables according to OpenAI ChatGPT Apps SDK design guidelines.
|
|
5
|
-
* https://developers.openai.com/apps-sdk/concepts/design-guidelines
|
|
6
|
-
*
|
|
7
|
-
* Design Principles:
|
|
8
|
-
* - "Always inherit the system font stack"
|
|
9
|
-
* - "Use system colors for text, icons, and spatial elements"
|
|
10
|
-
* - "Use system grid spacing"
|
|
11
|
-
* - "Respect system specified corner rounds"
|
|
12
|
-
*
|
|
13
|
-
* ⚠️ These values should NOT be overridden unless you want to break
|
|
14
|
-
* compliance with OpenAI ChatGPT Apps SDK design guidelines.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
:root {
|
|
18
|
-
/* ===================================
|
|
19
|
-
* TYPOGRAPHY - System Fonts
|
|
20
|
-
* ===================================
|
|
21
|
-
* "Always inherit the system font stack"
|
|
22
|
-
* Platform-native: SF Pro (iOS/macOS), Roboto (Android), Segoe UI (Windows)
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
--sp-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
26
|
-
|
|
27
|
-
/* Font sizes - System-defined scale */
|
|
28
|
-
--sp-font-size-xs: 0.75rem; /* 12px - metadata */
|
|
29
|
-
--sp-font-size-sm: 0.875rem; /* 14px - descriptions */
|
|
30
|
-
--sp-font-size-base: 1rem; /* 16px - headers */
|
|
31
|
-
--sp-font-size-lg: 1.125rem; /* 18px */
|
|
32
|
-
--sp-font-size-xl: 1.25rem; /* 20px */
|
|
33
|
-
|
|
34
|
-
/* Font weights - System-defined */
|
|
35
|
-
--sp-font-weight-normal: 400;
|
|
36
|
-
--sp-font-weight-medium: 500;
|
|
37
|
-
--sp-font-weight-semibold: 600;
|
|
38
|
-
--sp-font-weight-bold: 700;
|
|
39
|
-
|
|
40
|
-
/* Line heights - System-defined */
|
|
41
|
-
--sp-line-height-tight: 1.25;
|
|
42
|
-
--sp-line-height-normal: 1.5;
|
|
43
|
-
--sp-line-height-relaxed: 1.75;
|
|
44
|
-
|
|
45
|
-
/* ===================================
|
|
46
|
-
* SYSTEM COLORS
|
|
47
|
-
* ===================================
|
|
48
|
-
* "Use system colors for text, icons, and spatial elements"
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/* Light Mode - OpenAI ChatGPT System Colors */
|
|
52
|
-
--sp-light-color-bg-primary: #ffffff;
|
|
53
|
-
--sp-light-color-bg-secondary: #e8e8e8;
|
|
54
|
-
--sp-light-color-bg-tertiary: #f3f3f3;
|
|
55
|
-
--sp-light-color-text-primary: #0d0d0d;
|
|
56
|
-
--sp-light-color-text-secondary: #5d5d5d;
|
|
57
|
-
--sp-light-color-text-tertiary: #8f8f8f;
|
|
58
|
-
--sp-light-color-text-inverted: #8f8f8f;
|
|
59
|
-
--sp-light-color-border: rgba(0, 0, 0, 0.05);
|
|
60
|
-
--sp-light-success: #008635;
|
|
61
|
-
--sp-light-warning: #e25507;
|
|
62
|
-
--sp-light-error: #e02e2a;
|
|
63
|
-
--sp-light-info: #0285ff;
|
|
64
|
-
--sp-light-sidebar: #f9f9f9;
|
|
65
|
-
/* Customizable light styles */
|
|
66
|
-
--sp-light-accent: #f46c21;
|
|
67
|
-
--sp-light-accent-hover: rgba(244, 108, 33, 0.9);
|
|
68
|
-
--sp-light-accent-active: #d45e1c;
|
|
69
|
-
--sp-light-accent-foreground: #ffffff;
|
|
70
|
-
|
|
71
|
-
/* Dark Mode - OpenAI ChatGPT System Colors */
|
|
72
|
-
--sp-dark-color-bg-primary: #212121;
|
|
73
|
-
--sp-dark-color-bg-secondary: #303030;
|
|
74
|
-
--sp-dark-color-bg-tertiary: #414141;
|
|
75
|
-
--sp-dark-color-text-primary: #ffffff;
|
|
76
|
-
--sp-dark-color-text-secondary: #cdcdcd;
|
|
77
|
-
--sp-dark-color-text-tertiary: #afafaf;
|
|
78
|
-
--sp-dark-color-text-inverted: #afafaf;
|
|
79
|
-
--sp-dark-color-border: #ffffff0d;
|
|
80
|
-
--sp-dark-success: #40c977;
|
|
81
|
-
--sp-dark-warning: #ff9e6c;
|
|
82
|
-
--sp-dark-error: #ff8583;
|
|
83
|
-
--sp-dark-info: #0285ff;
|
|
84
|
-
--sp-dark-sidebar: #181818;
|
|
85
|
-
/* Customizable dark styles */
|
|
86
|
-
--sp-dark-accent: #f46c21;
|
|
87
|
-
--sp-dark-accent-hover: rgba(244, 108, 33, 0.9);
|
|
88
|
-
--sp-dark-accent-active: #d45e1c;
|
|
89
|
-
--sp-dark-accent-foreground: #ffffff;
|
|
90
|
-
|
|
91
|
-
/* ===================================
|
|
92
|
-
* SPACING - System Grid
|
|
93
|
-
* ===================================
|
|
94
|
-
* "Use system grid spacing"
|
|
95
|
-
* 4px base grid system
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
--sp-spacing-1: 0.25rem; /* 4px */
|
|
99
|
-
--sp-spacing-2: 0.5rem; /* 8px */
|
|
100
|
-
--sp-spacing-3: 0.75rem; /* 12px */
|
|
101
|
-
--sp-spacing-4: 1rem; /* 16px */
|
|
102
|
-
--sp-spacing-5: 1.25rem; /* 20px */
|
|
103
|
-
--sp-spacing-6: 1.5rem; /* 24px */
|
|
104
|
-
--sp-spacing-8: 2rem; /* 32px */
|
|
105
|
-
|
|
106
|
-
/* ===================================
|
|
107
|
-
* BORDER RADIUS
|
|
108
|
-
* ===================================
|
|
109
|
-
* "Respect system specified corner rounds"
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
--sp-radius-sm: 0.375rem; /* 6px */
|
|
113
|
-
--sp-radius-md: 0.5rem; /* 8px */
|
|
114
|
-
--sp-radius-lg: 0.75rem; /* 12px */
|
|
115
|
-
--sp-radius-xl: 1rem; /* 16px */
|
|
116
|
-
--sp-radius-2xl: 1.5rem; /* 24px */
|
|
117
|
-
--sp-radius-full: 9999px;
|
|
118
|
-
|
|
119
|
-
/* ===================================
|
|
120
|
-
* SHADOWS - System Elevation
|
|
121
|
-
* ===================================
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
--sp-shadow-sm: 0px 1px 2px rgba(0, 0, 0, 0.05);
|
|
125
|
-
--sp-shadow-md: 0px 2px 6px rgba(0, 0, 0, 0.06);
|
|
126
|
-
--sp-shadow-lg: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
127
|
-
--sp-shadow-xl: 0px 8px 24px rgba(0, 0, 0, 0.12);
|
|
128
|
-
|
|
129
|
-
/* ===================================
|
|
130
|
-
* COMPONENT DIMENSIONS
|
|
131
|
-
* ===================================
|
|
132
|
-
* Standard component sizing from OpenAI ChatGPT examples
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
/* Card width - 220px (OpenAI ChatGPT standard) */
|
|
136
|
-
--sp-card-width: 220px;
|
|
137
|
-
|
|
138
|
-
/* Card gap - 16px (OpenAI ChatGPT standard) */
|
|
139
|
-
--sp-card-gap: 1rem;
|
|
140
|
-
|
|
141
|
-
/* Button padding */
|
|
142
|
-
--sp-button-padding-x: 1rem; /* 16px */
|
|
143
|
-
--sp-button-padding-y: 0.375rem; /* 6px */
|
|
144
|
-
--sp-button-padding-x-sm: 0.75rem; /* 12px */
|
|
145
|
-
--sp-button-padding-y-sm: 0.25rem; /* 4px */
|
|
146
|
-
}
|