sunpeak 0.16.17 → 0.16.21
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 -2
- package/bin/commands/build.mjs +1 -1
- package/bin/commands/dev.mjs +137 -19
- package/bin/commands/new.mjs +21 -2
- package/bin/commands/start.mjs +1 -1
- package/dist/chatgpt/chatgpt-conversation.d.ts +3 -1
- package/dist/chatgpt/globals.css +37 -8
- package/dist/chatgpt/index.cjs +3 -5
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +0 -1
- package/dist/chatgpt/index.js +3 -5
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/claude/claude-conversation.d.ts +3 -1
- package/dist/claude/index.cjs +2 -2
- package/dist/claude/index.d.ts +1 -1
- package/dist/claude/index.js +2 -2
- package/dist/{discovery-DvIQWTez.js → discovery-BVqD-JsT.js} +4 -2
- package/dist/{discovery-DvIQWTez.js.map → discovery-BVqD-JsT.js.map} +1 -1
- package/dist/{discovery-SviNiBkF.cjs → discovery-D1gpaVz4.cjs} +4 -2
- package/dist/{discovery-SviNiBkF.cjs.map → discovery-D1gpaVz4.cjs.map} +1 -1
- package/dist/hooks/index.d.ts +10 -1
- package/dist/hooks/safe-area.d.ts +6 -2
- package/dist/hooks/use-device-capabilities.d.ts +3 -0
- package/dist/hooks/use-platform.d.ts +3 -0
- package/dist/hooks/use-styles.d.ts +2 -0
- package/dist/hooks/use-time-zone.d.ts +1 -0
- package/dist/hooks/use-tool-info.d.ts +3 -0
- package/dist/hooks/use-user-agent.d.ts +1 -0
- package/dist/hooks/use-viewport.d.ts +3 -0
- package/dist/{platform → host}/chatgpt/index.cjs +1 -1
- package/dist/host/chatgpt/index.cjs.map +1 -0
- package/dist/{platform → host}/chatgpt/index.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/index.js +1 -1
- package/dist/host/chatgpt/index.js.map +1 -0
- package/dist/{platform → host}/chatgpt/use-create-file.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/use-file-download.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/use-open-modal.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/use-request-checkout.d.ts +2 -2
- package/dist/{platform → host}/index.cjs +5 -3
- package/dist/host/index.cjs.map +1 -0
- package/dist/{platform → host}/index.d.ts +15 -11
- package/dist/{platform → host}/index.js +5 -3
- package/dist/host/index.js.map +1 -0
- package/dist/{index-CsYoMHyn.js → index-B4aC3vjH.js} +4 -4
- package/dist/index-B4aC3vjH.js.map +1 -0
- package/dist/{index-DHcaJ5PU.cjs → index-CKabCJyV.cjs} +4 -4
- package/dist/index-CKabCJyV.cjs.map +1 -0
- package/dist/index-CX6Z4bED.js +29 -0
- package/dist/index-CX6Z4bED.js.map +1 -0
- package/dist/index-bKBBCBK6.cjs +28 -0
- package/dist/index-bKBBCBK6.cjs.map +1 -0
- package/dist/index.cjs +233 -6297
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +228 -6292
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +1 -1
- package/dist/lib/discovery-cli.js +1 -1
- package/dist/mcp/index.cjs +680 -6766
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +682 -6768
- package/dist/mcp/index.js.map +1 -1
- package/dist/{protocol-CfvM5B6z.cjs → protocol-DkDHRwOW.cjs} +50 -5
- package/dist/{protocol-CfvM5B6z.cjs.map → protocol-DkDHRwOW.cjs.map} +1 -1
- package/dist/{protocol-CF-P_kw5.js → protocol-uge7qFev.js} +102 -57
- package/dist/{protocol-CF-P_kw5.js.map → protocol-uge7qFev.js.map} +1 -1
- package/dist/simulator/hosts.d.ts +2 -0
- package/dist/simulator/index.cjs +3 -3
- package/dist/simulator/index.js +3 -3
- package/dist/simulator/simple-sidebar.d.ts +18 -4
- package/dist/simulator/simulator-url.d.ts +8 -0
- package/dist/simulator/simulator.d.ts +13 -1
- package/dist/simulator/use-simulator-state.d.ts +10 -6
- package/dist/simulator-D8t-r7HH.js +3222 -0
- package/dist/simulator-D8t-r7HH.js.map +1 -0
- package/dist/simulator-FFNttkqL.cjs +3237 -0
- package/dist/simulator-FFNttkqL.cjs.map +1 -0
- package/dist/{simulator-url-rgg_KYOg.cjs → simulator-url-DcSYRl-P.cjs} +7 -1
- package/dist/simulator-url-DcSYRl-P.cjs.map +1 -0
- package/dist/{simulator-url-CuLqtnSS.js → simulator-url-j_XV3EoP.js} +7 -1
- package/dist/simulator-url-j_XV3EoP.js.map +1 -0
- package/dist/style.css +37 -8
- package/dist/use-app-C9gpzIQO.js +349 -0
- package/dist/use-app-C9gpzIQO.js.map +1 -0
- package/dist/use-app-D09O2swh.cjs +348 -0
- package/dist/use-app-D09O2swh.cjs.map +1 -0
- package/package.json +26 -14
- package/template/.sunpeak/dev.tsx +28 -2
- package/template/node_modules/.bin/vite +2 -2
- package/template/node_modules/.bin/vitest +2 -2
- package/template/package.json +5 -5
- package/template/playwright.config.ts +6 -3
- package/template/src/resources/albums/albums.test.tsx +1 -0
- package/template/src/resources/albums/albums.tsx +5 -2
- package/template/src/resources/albums/components/albums.test.tsx +22 -18
- package/template/src/resources/albums/components/albums.tsx +63 -7
- package/template/src/resources/albums/components/fullscreen-viewer.test.tsx +3 -25
- package/template/src/resources/albums/components/fullscreen-viewer.tsx +2 -3
- package/template/src/resources/carousel/carousel.test.tsx +12 -16
- package/template/src/resources/carousel/carousel.tsx +47 -5
- package/template/src/resources/map/components/map.tsx +65 -9
- package/template/src/resources/map/map.test.tsx +0 -1
- package/template/src/resources/review/review.test.tsx +25 -27
- package/template/src/resources/review/review.tsx +85 -63
- package/template/src/tools/review-diff.test.ts +73 -0
- package/template/src/tools/review-diff.ts +29 -2
- package/template/src/tools/review-post.test.ts +100 -0
- package/template/src/tools/review-post.ts +30 -2
- package/template/src/tools/review-purchase.test.ts +111 -0
- package/template/src/tools/review-purchase.ts +35 -2
- package/template/src/tools/review.test.ts +40 -0
- package/template/src/tools/review.ts +4 -1
- package/template/src/tools/show-albums.test.ts +42 -0
- package/template/src/tools/show-albums.ts +22 -2
- package/template/src/tools/show-carousel.test.ts +45 -0
- package/template/src/tools/show-carousel.ts +19 -2
- package/template/src/tools/show-map.test.ts +74 -0
- package/template/src/tools/show-map.ts +21 -2
- package/template/tests/e2e/albums.spec.ts +75 -0
- package/template/tests/e2e/carousel.spec.ts +65 -0
- package/template/tests/e2e/global-setup.ts +25 -0
- package/template/tests/e2e/map.spec.ts +60 -0
- package/template/tests/e2e/review.spec.ts +72 -11
- package/dist/chatgpt/chatgpt-simulator.d.ts +0 -10
- package/dist/index-BFD3bAHd.cjs +0 -547
- package/dist/index-BFD3bAHd.cjs.map +0 -1
- package/dist/index-CsYoMHyn.js.map +0 -1
- package/dist/index-DHcaJ5PU.cjs.map +0 -1
- package/dist/index-wUvmyoCx.js +0 -532
- package/dist/index-wUvmyoCx.js.map +0 -1
- package/dist/platform/chatgpt/index.cjs.map +0 -1
- package/dist/platform/chatgpt/index.js.map +0 -1
- package/dist/platform/index.cjs.map +0 -1
- package/dist/platform/index.js.map +0 -1
- package/dist/simulator-BEFsuj9Z.cjs +0 -8872
- package/dist/simulator-BEFsuj9Z.cjs.map +0 -1
- package/dist/simulator-Da9iAupa.js +0 -8857
- package/dist/simulator-Da9iAupa.js.map +0 -1
- package/dist/simulator-url-CuLqtnSS.js.map +0 -1
- package/dist/simulator-url-rgg_KYOg.cjs.map +0 -1
- package/dist/use-app-CaTJmpgj.cjs +0 -6449
- package/dist/use-app-CaTJmpgj.cjs.map +0 -1
- package/dist/use-app-DTTzqi-0.js +0 -6450
- package/dist/use-app-DTTzqi-0.js.map +0 -1
- /package/dist/{platform → host}/chatgpt/openai-types.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/host/index.ts"],"sourcesContent":["/**\n * Host detection utilities for MCP Apps.\n *\n * Use these functions to detect which host is running your app\n * and conditionally use host-specific features.\n *\n * @example\n * ```tsx\n * import { isChatGPT } from 'sunpeak/host';\n *\n * function MyResource() {\n * // Only use ChatGPT-specific features when running on ChatGPT\n * if (isChatGPT()) {\n * // Use updateModelContext, etc.\n * }\n * }\n * ```\n */\n\n/**\n * Supported hosts.\n */\nexport type Host = 'chatgpt' | 'claude' | 'unknown';\n\n/**\n * Detect the current host.\n *\n * Detection is based on:\n * 1. Host runtime objects (window.openai for ChatGPT — works in both\n * real hosts and the simulator when the ChatGPT host shell is active)\n * 2. User agent patterns as fallback\n * 3. Hostname matching as final fallback\n *\n * @returns The detected host\n */\nexport function detectHost(): Host {\n // Check if we're in a browser environment\n if (typeof window === 'undefined') {\n return 'unknown';\n }\n\n // ChatGPT injects window.openai; the simulator does the same when\n // the ChatGPT host shell is selected. This is the most reliable signal.\n if ('openai' in window) {\n return 'chatgpt';\n }\n\n // Check user agent patterns for host detection\n const ua = navigator.userAgent.toLowerCase();\n\n // ChatGPT iOS/Android apps and web\n if (ua.includes('chatgpt') || window.location.hostname.includes('chatgpt.com')) {\n return 'chatgpt';\n }\n\n // Claude apps and web\n if (ua.includes('claude') || window.location.hostname.includes('claude.ai')) {\n return 'claude';\n }\n\n return 'unknown';\n}\n\n/**\n * Check if the app is running in a ChatGPT host.\n *\n * @returns true if running in ChatGPT\n *\n * @example\n * ```tsx\n * import { isChatGPT } from 'sunpeak/host';\n *\n * function MyResource() {\n * if (isChatGPT()) {\n * // Use ChatGPT-specific features\n * }\n * }\n * ```\n */\nexport function isChatGPT(): boolean {\n return detectHost() === 'chatgpt';\n}\n\n/**\n * Check if the app is running in a Claude host.\n *\n * @returns true if running in Claude\n */\nexport function isClaude(): boolean {\n return detectHost() === 'claude';\n}\n\n/** @deprecated Use `Host` instead. */\nexport type Platform = Host;\n\n/** @deprecated Use `detectHost` instead. */\nexport const detectPlatform = detectHost;\n"],"names":[],"mappings":"AAmCO,SAAS,aAAmB;AAEjC,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO;AAAA,EACT;AAIA,MAAI,YAAY,QAAQ;AACtB,WAAO;AAAA,EACT;AAGA,QAAM,KAAK,UAAU,UAAU,YAAA;AAG/B,MAAI,GAAG,SAAS,SAAS,KAAK,OAAO,SAAS,SAAS,SAAS,aAAa,GAAG;AAC9E,WAAO;AAAA,EACT;AAGA,MAAI,GAAG,SAAS,QAAQ,KAAK,OAAO,SAAS,SAAS,SAAS,WAAW,GAAG;AAC3E,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAkBO,SAAS,YAAqB;AACnC,SAAO,iBAAiB;AAC1B;AAOO,SAAS,WAAoB;AAClC,SAAO,iBAAiB;AAC1B;AAMO,MAAM,iBAAiB;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as IframeResource, M as McpAppHost, a as SCREEN_WIDTHS, b as SidebarCheckbox, c as SidebarCollapsibleControl, d as SidebarControl, e as SidebarInput, f as SidebarSelect, g as SidebarTextarea, h as SidebarToggle, i as SimpleSidebar, S as Simulator, T as ThemeProvider, j as extractResourceCSP, k as getHostShell, l as getRegisteredHosts, r as registerHostShell, m as resolveServerToolResult, u as useSimulatorState, n as useThemeContext } from "./simulator-
|
|
2
|
-
import { c as createSimulatorUrl } from "./simulator-url-
|
|
3
|
-
import { b as buildDevSimulations, a as buildResourceMap, c as buildSimulations, d as createResourceExports, e as extractResourceKey, f as extractSimulationKey, g as findResourceDirs, h as findResourceKey, i as getComponentName, t as toPascalCase } from "./discovery-
|
|
1
|
+
import { I as IframeResource, M as McpAppHost, a as SCREEN_WIDTHS, b as SidebarCheckbox, c as SidebarCollapsibleControl, d as SidebarControl, e as SidebarInput, f as SidebarSelect, g as SidebarTextarea, h as SidebarToggle, i as SimpleSidebar, S as Simulator, T as ThemeProvider, j as extractResourceCSP, k as getHostShell, l as getRegisteredHosts, r as registerHostShell, m as resolveServerToolResult, u as useSimulatorState, n as useThemeContext } from "./simulator-D8t-r7HH.js";
|
|
2
|
+
import { c as createSimulatorUrl } from "./simulator-url-j_XV3EoP.js";
|
|
3
|
+
import { b as buildDevSimulations, a as buildResourceMap, c as buildSimulations, d as createResourceExports, e as extractResourceKey, f as extractSimulationKey, g as findResourceDirs, h as findResourceKey, i as getComponentName, t as toPascalCase } from "./discovery-BVqD-JsT.js";
|
|
4
4
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
5
|
__proto__: null,
|
|
6
6
|
IframeResource,
|
|
@@ -38,4 +38,4 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
38
38
|
export {
|
|
39
39
|
index as i
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=index-
|
|
41
|
+
//# sourceMappingURL=index-B4aC3vjH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B4aC3vjH.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const simulator = require("./simulator-
|
|
3
|
-
const simulatorUrl = require("./simulator-url-
|
|
4
|
-
const discovery = require("./discovery-
|
|
2
|
+
const simulator = require("./simulator-FFNttkqL.cjs");
|
|
3
|
+
const simulatorUrl = require("./simulator-url-DcSYRl-P.cjs");
|
|
4
|
+
const discovery = require("./discovery-D1gpaVz4.cjs");
|
|
5
5
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
6
|
__proto__: null,
|
|
7
7
|
IframeResource: simulator.IframeResource,
|
|
@@ -37,4 +37,4 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
37
37
|
useThemeContext: simulator.useThemeContext
|
|
38
38
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
39
39
|
exports.index = index;
|
|
40
|
-
//# sourceMappingURL=index-
|
|
40
|
+
//# sourceMappingURL=index-CKabCJyV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CKabCJyV.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { I as IframeResource, M as McpAppHost, a as SCREEN_WIDTHS, S as Simulator, T as ThemeProvider, j as extractResourceCSP, m as resolveServerToolResult, n as useThemeContext } from "./simulator-D8t-r7HH.js";
|
|
2
|
+
import { c as createSimulatorUrl } from "./simulator-url-j_XV3EoP.js";
|
|
3
|
+
import { b as buildDevSimulations, a as buildResourceMap, c as buildSimulations, d as createResourceExports, e as extractResourceKey, f as extractSimulationKey, g as findResourceDirs, h as findResourceKey, i as getComponentName, t as toPascalCase } from "./discovery-BVqD-JsT.js";
|
|
4
|
+
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
|
+
__proto__: null,
|
|
6
|
+
IframeResource,
|
|
7
|
+
McpAppHost,
|
|
8
|
+
SCREEN_WIDTHS,
|
|
9
|
+
Simulator,
|
|
10
|
+
ThemeProvider,
|
|
11
|
+
buildDevSimulations,
|
|
12
|
+
buildResourceMap,
|
|
13
|
+
buildSimulations,
|
|
14
|
+
createResourceExports,
|
|
15
|
+
createSimulatorUrl,
|
|
16
|
+
extractResourceCSP,
|
|
17
|
+
extractResourceKey,
|
|
18
|
+
extractSimulationKey,
|
|
19
|
+
findResourceDirs,
|
|
20
|
+
findResourceKey,
|
|
21
|
+
getComponentName,
|
|
22
|
+
resolveServerToolResult,
|
|
23
|
+
toPascalCase,
|
|
24
|
+
useThemeContext
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
26
|
+
export {
|
|
27
|
+
index as i
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index-CX6Z4bED.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CX6Z4bED.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const simulator = require("./simulator-FFNttkqL.cjs");
|
|
3
|
+
const simulatorUrl = require("./simulator-url-DcSYRl-P.cjs");
|
|
4
|
+
const discovery = require("./discovery-D1gpaVz4.cjs");
|
|
5
|
+
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null,
|
|
7
|
+
IframeResource: simulator.IframeResource,
|
|
8
|
+
McpAppHost: simulator.McpAppHost,
|
|
9
|
+
SCREEN_WIDTHS: simulator.SCREEN_WIDTHS,
|
|
10
|
+
Simulator: simulator.Simulator,
|
|
11
|
+
ThemeProvider: simulator.ThemeProvider,
|
|
12
|
+
buildDevSimulations: discovery.buildDevSimulations,
|
|
13
|
+
buildResourceMap: discovery.buildResourceMap,
|
|
14
|
+
buildSimulations: discovery.buildSimulations,
|
|
15
|
+
createResourceExports: discovery.createResourceExports,
|
|
16
|
+
createSimulatorUrl: simulatorUrl.createSimulatorUrl,
|
|
17
|
+
extractResourceCSP: simulator.extractResourceCSP,
|
|
18
|
+
extractResourceKey: discovery.extractResourceKey,
|
|
19
|
+
extractSimulationKey: discovery.extractSimulationKey,
|
|
20
|
+
findResourceDirs: discovery.findResourceDirs,
|
|
21
|
+
findResourceKey: discovery.findResourceKey,
|
|
22
|
+
getComponentName: discovery.getComponentName,
|
|
23
|
+
resolveServerToolResult: simulator.resolveServerToolResult,
|
|
24
|
+
toPascalCase: discovery.toPascalCase,
|
|
25
|
+
useThemeContext: simulator.useThemeContext
|
|
26
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
27
|
+
exports.index = index;
|
|
28
|
+
//# sourceMappingURL=index-bKBBCBK6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-bKBBCBK6.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|