sunpeak 0.4.4 → 0.5.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.
Files changed (54) hide show
  1. package/dist/chatgpt/chatgpt-simulator-types.d.ts +1 -1
  2. package/dist/chatgpt/chatgpt-simulator.d.ts +4 -15
  3. package/dist/chatgpt/index.d.ts +1 -1
  4. package/dist/chatgpt/mock-openai.d.ts +4 -16
  5. package/dist/index.cjs +69 -40
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.js +69 -40
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp/index.cjs +76 -112
  10. package/dist/mcp/index.cjs.map +1 -1
  11. package/dist/mcp/index.d.ts +2 -1
  12. package/dist/mcp/index.js +76 -112
  13. package/dist/mcp/index.js.map +1 -1
  14. package/dist/mcp/server.d.ts +2 -4
  15. package/dist/mcp/types.d.ts +16 -62
  16. package/dist/providers/index.d.ts +1 -3
  17. package/dist/providers/openai/index.d.ts +7 -0
  18. package/dist/{chatgpt/openai-provider.d.ts → providers/openai/provider.d.ts} +1 -1
  19. package/dist/{chatgpt/openai-types.d.ts → providers/openai/types.d.ts} +3 -32
  20. package/dist/providers/types.d.ts +4 -5
  21. package/dist/runtime/index.d.ts +7 -0
  22. package/dist/runtime/provider-detection.d.ts +17 -0
  23. package/dist/types/index.d.ts +2 -1
  24. package/dist/types/runtime.d.ts +34 -0
  25. package/dist/types/simulation.d.ts +47 -0
  26. package/package.json +2 -2
  27. package/template/README.md +6 -7
  28. package/template/dev/main.tsx +38 -3
  29. package/template/mcp/server.ts +9 -6
  30. package/template/nodemon.json +7 -0
  31. package/template/package.json +4 -2
  32. package/template/scripts/build-all.mjs +108 -0
  33. package/template/scripts/validate.mjs +16 -7
  34. package/template/src/components/index.ts +1 -1
  35. package/template/src/components/resources/AlbumsResource.tsx +13 -0
  36. package/template/src/components/{apps/PlacesApp.tsx → resources/CarouselResource.tsx} +11 -10
  37. package/template/src/components/{apps/App.tsx → resources/CounterResource.tsx} +5 -14
  38. package/template/src/components/resources/index.ts +3 -0
  39. package/template/src/index-resource.tsx +11 -0
  40. package/template/src/simulations/albums-simulation.ts +35 -9
  41. package/template/src/simulations/carousel-simulation.ts +35 -9
  42. package/template/src/simulations/counter-simulation.ts +41 -0
  43. package/template/src/simulations/index.ts +10 -10
  44. package/template/vite.config.build.ts +21 -15
  45. package/dist/chatgpt/mcp-provider.d.ts +0 -25
  46. package/dist/style.css +0 -4420
  47. package/template/src/components/apps/AlbumsApp.tsx +0 -13
  48. package/template/src/components/apps/active-app.ts +0 -11
  49. package/template/src/components/apps/index.ts +0 -3
  50. package/template/src/index.chatgpt.tsx +0 -9
  51. package/template/src/index.ts +0 -2
  52. package/template/src/simulations/app-configs.ts +0 -30
  53. package/template/src/simulations/app-simulation.ts +0 -15
  54. package/template/src/simulations/simulations.ts +0 -74
@@ -1,13 +0,0 @@
1
- import * as React from "react"
2
- import { Albums } from "../album"
3
-
4
- /**
5
- * Production-ready Albums App
6
- *
7
- * This app displays photo albums in a carousel layout with fullscreen viewing capability.
8
- * Can be dropped into any production environment without changes.
9
- */
10
- export const AlbumsApp = React.forwardRef<HTMLDivElement>((_props, ref) => {
11
- return <Albums ref={ref} />
12
- })
13
- AlbumsApp.displayName = "AlbumsApp"
@@ -1,11 +0,0 @@
1
- /**
2
- * Active app selection - SINGLE SOURCE OF TRUTH
3
- *
4
- * 👇 CHANGE THIS LINE to switch which app is active for the:
5
- * - ChatGPT build (index.chatgpt.tsx)
6
- * - MCP server (server.ts)
7
- */
8
-
9
- export type AppName = 'app' | 'albums' | 'carousel';
10
-
11
- export const ACTIVE_APP: AppName = 'app';
@@ -1,3 +0,0 @@
1
- export { App } from './App';
2
- export { AlbumsApp } from './AlbumsApp';
3
- export { PlacesApp, type Place, type PlacesData } from './PlacesApp';
@@ -1,9 +0,0 @@
1
- import { createRoot } from 'react-dom/client';
2
- import { ActiveComponent as ActiveApp } from './simulations/simulations';
3
-
4
- // Mount the active app
5
- // To switch apps, edit ACTIVE_APP in components/apps/active-app.ts
6
- const root = document.getElementById('root');
7
- if (root) {
8
- createRoot(root).render(<ActiveApp />);
9
- }
@@ -1,2 +0,0 @@
1
- export * from './components';
2
- export * from './lib';
@@ -1,30 +0,0 @@
1
- /**
2
- * Server-safe app configurations
3
- *
4
- * This file contains only metadata and can be safely imported in Node.js contexts
5
- * (like MCP servers) without causing issues with CSS imports or React components.
6
- *
7
- * To switch apps, change ACTIVE_APP in components/apps/active-app.ts
8
- */
9
-
10
- import { ACTIVE_APP } from '../components/apps/active-app';
11
- import { appSimulationConfig } from './app-simulation';
12
- import { albumsSimulationConfig } from './albums-simulation';
13
- import { carouselSimulationConfig } from './carousel-simulation';
14
-
15
- /**
16
- * Server-safe config map - contains only metadata, no React components
17
- */
18
- export const CONFIG_MAP = {
19
- app: appSimulationConfig,
20
- albums: albumsSimulationConfig,
21
- carousel: carouselSimulationConfig,
22
- } as const;
23
-
24
- export type AppName = keyof typeof CONFIG_MAP;
25
-
26
- // Re-export for convenience
27
- export { ACTIVE_APP };
28
-
29
- // Active config for server use
30
- export const activeConfig = CONFIG_MAP[ACTIVE_APP];
@@ -1,15 +0,0 @@
1
- /**
2
- * Server-safe configuration for the app simulation.
3
- * This file contains only metadata and doesn't import React components or CSS.
4
- */
5
- export const appSimulationConfig = {
6
- appName: 'sunpeak',
7
- value: 'app',
8
- label: 'My App',
9
- appIcon: '🏗️',
10
- userMessage: 'What do you have for me today?',
11
- toolOutput: null,
12
- widgetState: null,
13
- toolName: 'show-app',
14
- toolDescription: 'Show the Sunpeak app',
15
- } as const;
@@ -1,74 +0,0 @@
1
- /**
2
- * Simulations - combines apps with their simulation configs
3
- *
4
- * This file creates simulations by pairing production-ready apps with their
5
- * server-safe configs. Each simulation is used for development and testing.
6
- *
7
- * IMPORTANT: This file imports React components and CSS. Do not import this
8
- * in Node.js/MCP server contexts. Use app-configs.ts instead.
9
- *
10
- * To switch apps, change ACTIVE_APP in components/apps/active-app.ts
11
- */
12
-
13
- import type { Simulation } from "sunpeak"
14
- import type { ComponentType } from "react"
15
- import { App } from "../components/apps/App"
16
- import { AlbumsApp } from "../components/apps/AlbumsApp"
17
- import { PlacesApp } from "../components/apps/PlacesApp"
18
- import { CONFIG_MAP, ACTIVE_APP } from "./app-configs"
19
-
20
- export const appSimulation: Simulation = {
21
- ...CONFIG_MAP.app,
22
- component: App,
23
- }
24
-
25
- export const albumsSimulation: Simulation = {
26
- ...CONFIG_MAP.albums,
27
- component: AlbumsApp,
28
- }
29
-
30
- export const carouselSimulation: Simulation = {
31
- ...CONFIG_MAP.carousel,
32
- component: PlacesApp,
33
- }
34
-
35
- export const simulations = [
36
- appSimulation,
37
- carouselSimulation,
38
- albumsSimulation,
39
- ]
40
-
41
- /**
42
- * Static map from simulation name to simulation config and component
43
- */
44
- export const APP_MAP = {
45
- app: {
46
- config: CONFIG_MAP.app,
47
- component: App,
48
- simulation: appSimulation,
49
- },
50
- albums: {
51
- config: CONFIG_MAP.albums,
52
- component: AlbumsApp,
53
- simulation: albumsSimulation,
54
- },
55
- carousel: {
56
- config: CONFIG_MAP.carousel,
57
- component: PlacesApp,
58
- simulation: carouselSimulation,
59
- },
60
- } as const satisfies Record<string, {
61
- config: typeof CONFIG_MAP[keyof typeof CONFIG_MAP];
62
- component: ComponentType;
63
- simulation: Simulation;
64
- }>;
65
-
66
- export type AppName = keyof typeof APP_MAP;
67
-
68
- // Re-export for convenience
69
- export { ACTIVE_APP, CONFIG_MAP };
70
-
71
- // Derived exports for convenience
72
- export const activeSimulation = APP_MAP[ACTIVE_APP].simulation;
73
- export const activeConfig = APP_MAP[ACTIVE_APP].config;
74
- export const ActiveComponent = APP_MAP[ACTIVE_APP].component;