sunpeak 0.15.4 → 0.16.2
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 +53 -49
- package/bin/commands/build.mjs +119 -6
- package/bin/commands/dev.mjs +168 -27
- package/bin/commands/new.mjs +13 -3
- package/bin/commands/start.mjs +215 -0
- package/bin/lib/extract-resource.mjs +1 -1
- package/bin/lib/extract-tool.mjs +78 -0
- package/bin/lib/patterns.mjs +2 -26
- package/bin/sunpeak.js +11 -1
- package/dist/chatgpt/index.cjs +3 -6
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +1 -1
- package/dist/chatgpt/index.js +6 -9
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/discovery-CH80W5l9.js +217 -0
- package/dist/discovery-CH80W5l9.js.map +1 -0
- package/dist/discovery-DmB8_4QL.cjs +216 -0
- package/dist/discovery-DmB8_4QL.cjs.map +1 -0
- package/dist/{index-Cngntkp2.cjs → index-Bll1bszc.cjs} +3 -6
- package/dist/{index-Cngntkp2.cjs.map → index-Bll1bszc.cjs.map} +1 -1
- package/dist/{index-Ce_5ZIdJ.js → index-CACtnwu2.js} +3 -6
- package/dist/{index-Ce_5ZIdJ.js.map → index-CACtnwu2.js.map} +1 -1
- package/dist/{index-CutQgPzR.js → index-CLcr8IyR.js} +3 -6
- package/dist/index-CLcr8IyR.js.map +1 -0
- package/dist/{index-B0dxRJvS.cjs → index-CaQmwZJc.cjs} +3 -6
- package/dist/index-CaQmwZJc.cjs.map +1 -0
- package/dist/index.cjs +49 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3405 -3362
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +58 -5
- package/dist/lib/discovery-cli.cjs.map +1 -1
- package/dist/lib/discovery-cli.d.ts +3 -2
- package/dist/lib/discovery-cli.js +61 -8
- package/dist/lib/discovery-cli.js.map +1 -1
- package/dist/lib/discovery.d.ts +42 -43
- package/dist/lib/extract-tool.d.ts +12 -0
- package/dist/mcp/favicon.d.ts +1 -1
- package/dist/mcp/index.cjs +1582 -5
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +3 -1
- package/dist/mcp/index.js +1583 -6
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/production-server.d.ts +156 -0
- package/dist/mcp/types.d.ts +24 -1
- package/dist/platform/chatgpt/index.cjs +1 -1
- package/dist/platform/chatgpt/index.js +1 -1
- package/dist/{protocol-DFbsCx7E.js → protocol-BD5jDQEx.js} +8 -1
- package/dist/{protocol-DFbsCx7E.js.map → protocol-BD5jDQEx.js.map} +1 -1
- package/dist/{protocol-CL4_Npj5.cjs → protocol-BOjXuK6l.cjs} +8 -1
- package/dist/{protocol-CL4_Npj5.cjs.map → protocol-BOjXuK6l.cjs.map} +1 -1
- package/dist/simulator/index.cjs +2 -5
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.ts +1 -1
- package/dist/simulator/index.js +5 -8
- package/dist/simulator/simulator-url.d.ts +9 -9
- package/dist/{simulator-CxrtnguM.js → simulator-B7rw83zP.js} +9 -3
- package/dist/{simulator-CxrtnguM.js.map → simulator-B7rw83zP.js.map} +1 -1
- package/dist/{simulator-DcfQBRXE.cjs → simulator-DjZNa1MI.cjs} +9 -3
- package/dist/{simulator-DcfQBRXE.cjs.map → simulator-DjZNa1MI.cjs.map} +1 -1
- package/dist/simulator-url-CuLqtnSS.js.map +1 -1
- package/dist/simulator-url-rgg_KYOg.cjs.map +1 -1
- package/dist/types/resource-config.d.ts +7 -5
- package/dist/{use-app-BnoSPiUT.cjs → use-app-BpAJqzdE.cjs} +50 -21
- package/dist/{use-app-BnoSPiUT.cjs.map → use-app-BpAJqzdE.cjs.map} +1 -1
- package/dist/{use-app-D_TeaMFG.js → use-app-WOUdh1PR.js} +52 -23
- package/dist/{use-app-D_TeaMFG.js.map → use-app-WOUdh1PR.js.map} +1 -1
- package/package.json +1 -1
- package/template/.sunpeak/dev.tsx +8 -4
- package/template/.sunpeak/resource-loader.tsx +2 -1
- package/template/README.md +27 -22
- package/template/package.json +3 -1
- package/template/src/resources/albums/{albums-resource.test.tsx → albums.test.tsx} +1 -1
- package/template/src/resources/albums/{albums-resource.tsx → albums.tsx} +0 -1
- package/template/src/resources/carousel/{carousel-resource.test.tsx → carousel.test.tsx} +1 -1
- package/template/src/resources/carousel/{carousel-resource.tsx → carousel.tsx} +0 -1
- package/template/src/resources/index.ts +4 -4
- package/template/src/resources/map/{map-resource.test.tsx → map.test.tsx} +1 -1
- package/template/src/resources/map/{map-resource.tsx → map.tsx} +0 -1
- package/template/src/resources/review/{review-resource.test.tsx → review.test.tsx} +1 -1
- package/template/src/resources/review/{review-resource.tsx → review.tsx} +1 -2
- package/template/src/server.ts +17 -0
- package/template/src/tools/review-diff.ts +24 -0
- package/template/src/tools/review-post.ts +26 -0
- package/template/src/tools/review-purchase.ts +31 -0
- package/template/src/tools/show-albums.ts +22 -0
- package/template/src/tools/show-carousel.ts +25 -0
- package/template/src/tools/show-map.ts +29 -0
- package/template/tests/e2e/albums.spec.ts +6 -6
- package/template/tests/e2e/carousel.spec.ts +6 -6
- package/template/tests/e2e/map.spec.ts +11 -11
- package/template/tests/simulations/{review/review-diff-simulation.json → review-diff.json} +1 -31
- package/template/tests/simulations/{review/review-post-simulation.json → review-post.json} +1 -37
- package/template/tests/simulations/{review/review-purchase-simulation.json → review-purchase.json} +1 -38
- package/template/tests/simulations/{albums/albums-show-simulation.json → show-albums.json} +1 -24
- package/template/tests/simulations/{carousel/carousel-show-simulation.json → show-carousel.json} +1 -24
- package/template/tests/simulations/{map/map-show-simulation.json → show-map.json} +1 -35
- package/dist/discovery-CRR3SlyI.cjs +0 -156
- package/dist/discovery-CRR3SlyI.cjs.map +0 -1
- package/dist/discovery-DzV3HLXs.js +0 -157
- package/dist/discovery-DzV3HLXs.js.map +0 -1
- package/dist/index-B0dxRJvS.cjs.map +0 -1
- package/dist/index-CutQgPzR.js.map +0 -1
package/dist/simulator/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const simulator = require("../simulator-
|
|
3
|
+
const simulator = require("../simulator-DjZNa1MI.cjs");
|
|
4
4
|
const simulatorUrl = require("../simulator-url-rgg_KYOg.cjs");
|
|
5
|
-
const discovery = require("../discovery-
|
|
5
|
+
const discovery = require("../discovery-DmB8_4QL.cjs");
|
|
6
6
|
exports.IframeResource = simulator.IframeResource;
|
|
7
7
|
exports.McpAppHost = simulator.McpAppHost;
|
|
8
8
|
exports.SCREEN_WIDTHS = simulator.SCREEN_WIDTHS;
|
|
@@ -29,11 +29,8 @@ exports.buildSimulations = discovery.buildSimulations;
|
|
|
29
29
|
exports.createResourceExports = discovery.createResourceExports;
|
|
30
30
|
exports.extractResourceKey = discovery.extractResourceKey;
|
|
31
31
|
exports.extractSimulationKey = discovery.extractSimulationKey;
|
|
32
|
-
exports.extractSimulationName = discovery.extractSimulationName;
|
|
33
32
|
exports.findResourceDirs = discovery.findResourceDirs;
|
|
34
33
|
exports.findResourceKey = discovery.findResourceKey;
|
|
35
|
-
exports.findSimulationFiles = discovery.findSimulationFiles;
|
|
36
34
|
exports.getComponentName = discovery.getComponentName;
|
|
37
|
-
exports.isSimulationFile = discovery.isSimulationFile;
|
|
38
35
|
exports.toPascalCase = discovery.toPascalCase;
|
|
39
36
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,5 +14,5 @@ export { SCREEN_WIDTHS } from './simulator-types';
|
|
|
14
14
|
export { createSimulatorUrl } from './simulator-url';
|
|
15
15
|
export type { SimulatorUrlParams } from './simulator-url';
|
|
16
16
|
export { SimpleSidebar, SidebarControl, SidebarCollapsibleControl, SidebarSelect, SidebarInput, SidebarCheckbox, SidebarTextarea, SidebarToggle, } from './simple-sidebar';
|
|
17
|
-
export { buildDevSimulations, buildSimulations, buildResourceMap, createResourceExports, toPascalCase, extractResourceKey, extractSimulationKey, findResourceKey, getComponentName, findResourceDirs,
|
|
17
|
+
export { buildDevSimulations, buildSimulations, buildResourceMap, createResourceExports, toPascalCase, extractResourceKey, extractSimulationKey, findResourceKey, getComponentName, findResourceDirs, } from '../lib/discovery';
|
|
18
18
|
export type { BuildSimulationsOptions, BuildDevSimulationsOptions, ResourceMetadata, ResourceDirInfo, FsOps, } from '../lib/discovery';
|
package/dist/simulator/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I, M, a, b, c, d, e, f, g, h, i, S, T, j, k, l, r, u, m } from "../simulator-
|
|
1
|
+
import { I, M, a, b, c, d, e, f, g, h, i, S, T, j, k, l, r, u, m } from "../simulator-B7rw83zP.js";
|
|
2
2
|
import { c as c2 } from "../simulator-url-CuLqtnSS.js";
|
|
3
|
-
import { b as b2, a as a2, c as c3, d as d2, e as e2, f as f2, g as g2, h as h2, i as i2,
|
|
3
|
+
import { b as b2, a as a2, c as c3, d as d2, e as e2, f as f2, g as g2, h as h2, i as i2, t } from "../discovery-CH80W5l9.js";
|
|
4
4
|
export {
|
|
5
5
|
I as IframeResource,
|
|
6
6
|
M as McpAppHost,
|
|
@@ -23,14 +23,11 @@ export {
|
|
|
23
23
|
j as extractResourceCSP,
|
|
24
24
|
e2 as extractResourceKey,
|
|
25
25
|
f2 as extractSimulationKey,
|
|
26
|
-
g2 as
|
|
27
|
-
h2 as
|
|
28
|
-
i2 as
|
|
29
|
-
j2 as findSimulationFiles,
|
|
30
|
-
k2 as getComponentName,
|
|
26
|
+
g2 as findResourceDirs,
|
|
27
|
+
h2 as findResourceKey,
|
|
28
|
+
i2 as getComponentName,
|
|
31
29
|
k as getHostShell,
|
|
32
30
|
l as getRegisteredHosts,
|
|
33
|
-
l2 as isSimulationFile,
|
|
34
31
|
r as registerHostShell,
|
|
35
32
|
t as toPascalCase,
|
|
36
33
|
u as useSimulatorState,
|
|
@@ -10,7 +10,7 @@ import { Theme, DisplayMode, DeviceType } from '../types/runtime';
|
|
|
10
10
|
*
|
|
11
11
|
* // In e2e tests:
|
|
12
12
|
* await page.goto(createSimulatorUrl({
|
|
13
|
-
* simulation: 'albums
|
|
13
|
+
* simulation: 'show-albums',
|
|
14
14
|
* theme: 'dark',
|
|
15
15
|
* displayMode: 'fullscreen',
|
|
16
16
|
* host: 'claude',
|
|
@@ -19,8 +19,8 @@ import { Theme, DisplayMode, DeviceType } from '../types/runtime';
|
|
|
19
19
|
*/
|
|
20
20
|
export interface SimulatorUrlParams {
|
|
21
21
|
/**
|
|
22
|
-
* The simulation name to load (e.g., 'albums
|
|
23
|
-
* Corresponds to the simulation JSON filename without the
|
|
22
|
+
* The simulation name to load (e.g., 'show-albums', 'review-diff').
|
|
23
|
+
* Corresponds to the simulation JSON filename without the `.json` extension.
|
|
24
24
|
*/
|
|
25
25
|
simulation?: string;
|
|
26
26
|
/**
|
|
@@ -96,8 +96,8 @@ export interface SimulatorUrlParams {
|
|
|
96
96
|
* @example
|
|
97
97
|
* ```ts
|
|
98
98
|
* // Basic usage
|
|
99
|
-
* createSimulatorUrl({ simulation: 'albums
|
|
100
|
-
* // Returns: '/?simulation=albums
|
|
99
|
+
* createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })
|
|
100
|
+
* // Returns: '/?simulation=show-albums&theme=light'
|
|
101
101
|
*
|
|
102
102
|
* // With display mode
|
|
103
103
|
* createSimulatorUrl({
|
|
@@ -109,20 +109,20 @@ export interface SimulatorUrlParams {
|
|
|
109
109
|
*
|
|
110
110
|
* // With device simulation
|
|
111
111
|
* createSimulatorUrl({
|
|
112
|
-
* simulation: 'map
|
|
112
|
+
* simulation: 'show-map',
|
|
113
113
|
* deviceType: 'mobile',
|
|
114
114
|
* touch: true,
|
|
115
115
|
* hover: false,
|
|
116
116
|
* })
|
|
117
|
-
* // Returns: '/?simulation=map
|
|
117
|
+
* // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'
|
|
118
118
|
*
|
|
119
119
|
* // With safe area insets (for notch simulation)
|
|
120
120
|
* createSimulatorUrl({
|
|
121
|
-
* simulation: 'carousel
|
|
121
|
+
* simulation: 'show-carousel',
|
|
122
122
|
* safeAreaTop: 44,
|
|
123
123
|
* safeAreaBottom: 34,
|
|
124
124
|
* })
|
|
125
|
-
* // Returns: '/?simulation=carousel
|
|
125
|
+
* // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'
|
|
126
126
|
* ```
|
|
127
127
|
*/
|
|
128
128
|
export declare function createSimulatorUrl(params: SimulatorUrlParams, basePath?: string): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { useRef, useMemo, useCallback, useEffect, useState } from "react";
|
|
4
|
-
import { P as Protocol, b as PingRequestSchema, d as LoggingMessageNotificationSchema, c as CallToolRequestSchema, e as ListResourcesRequestSchema, f as ListResourceTemplatesRequestSchema, g as ReadResourceRequestSchema, h as ListPromptsRequestSchema, a as CallToolResultSchema, i as ToolListChangedNotificationSchema, j as ListResourcesResultSchema, k as ListResourceTemplatesResultSchema, l as ReadResourceResultSchema, m as ResourceListChangedNotificationSchema, n as ListPromptsResultSchema, o as PromptListChangedNotificationSchema, J as JSONRPCMessageSchema, I as ImplementationSchema, C as ContentBlockSchema, T as ToolSchema, R as RequestIdSchema } from "./protocol-
|
|
4
|
+
import { P as Protocol, b as PingRequestSchema, d as LoggingMessageNotificationSchema, c as CallToolRequestSchema, e as ListResourcesRequestSchema, f as ListResourceTemplatesRequestSchema, g as ReadResourceRequestSchema, h as ListPromptsRequestSchema, a as CallToolResultSchema, i as ToolListChangedNotificationSchema, j as ListResourcesResultSchema, k as ListResourceTemplatesResultSchema, l as ReadResourceResultSchema, m as ResourceListChangedNotificationSchema, n as ListPromptsResultSchema, o as PromptListChangedNotificationSchema, J as JSONRPCMessageSchema, I as ImplementationSchema, C as ContentBlockSchema, T as ToolSchema, R as RequestIdSchema } from "./protocol-BD5jDQEx.js";
|
|
5
5
|
const DEFAULT_STYLE_VARIABLES = {
|
|
6
6
|
// Background colors
|
|
7
7
|
"--color-background-primary": "light-dark(#ffffff, #1a1a1a)",
|
|
@@ -7754,7 +7754,13 @@ function useSimulatorState({
|
|
|
7754
7754
|
simulations,
|
|
7755
7755
|
defaultHost = "chatgpt"
|
|
7756
7756
|
}) {
|
|
7757
|
-
const simulationNames = Object.keys(simulations)
|
|
7757
|
+
const simulationNames = Object.keys(simulations).sort((a2, b) => {
|
|
7758
|
+
const simA = simulations[a2];
|
|
7759
|
+
const simB = simulations[b];
|
|
7760
|
+
const labelA = `${simA.resource.title || simA.resource.name}: ${simA.tool.title || simA.tool.name}`;
|
|
7761
|
+
const labelB = `${simB.resource.title || simB.resource.name}: ${simB.tool.title || simB.tool.name}`;
|
|
7762
|
+
return labelA.localeCompare(labelB);
|
|
7763
|
+
});
|
|
7758
7764
|
const urlParams = useMemo(() => parseUrlParams(), []);
|
|
7759
7765
|
const [screenWidth, setScreenWidth] = useState("full");
|
|
7760
7766
|
const isMobileWidth = (width) => width === "mobile-s" || width === "mobile-l";
|
|
@@ -8761,4 +8767,4 @@ export {
|
|
|
8761
8767
|
registerHostShell as r,
|
|
8762
8768
|
useSimulatorState as u
|
|
8763
8769
|
};
|
|
8764
|
-
//# sourceMappingURL=simulator-
|
|
8770
|
+
//# sourceMappingURL=simulator-B7rw83zP.js.map
|