sunpeak 0.18.2 → 0.18.7
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/dev.mjs +6 -2
- package/bin/commands/inspect.mjs +405 -5
- package/bin/commands/new.mjs +5 -0
- package/bin/lib/dev-overlay.mjs +50 -0
- package/bin/lib/live/live-config.d.mts +3 -0
- package/bin/lib/live/live-config.mjs +3 -1
- package/bin/lib/sandbox-server.mjs +11 -1
- package/dist/chatgpt/index.cjs +2 -2
- package/dist/chatgpt/index.js +2 -2
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-request-teardown.d.ts +21 -0
- package/dist/host/chatgpt/index.cjs +1 -1
- package/dist/host/chatgpt/index.js +1 -1
- package/dist/index.cjs +110 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +68 -31
- package/dist/index.js.map +1 -1
- package/dist/inspector/hosts.d.ts +12 -0
- package/dist/inspector/index.cjs +2 -2
- package/dist/inspector/index.js +2 -2
- package/dist/inspector/inspector-url.d.ts +13 -0
- package/dist/inspector/mcp-app-host.d.ts +3 -0
- package/dist/inspector/simple-sidebar.d.ts +1 -1
- package/dist/inspector/use-inspector-state.d.ts +2 -0
- package/dist/inspector/use-mcp-connection.d.ts +9 -1
- package/dist/{inspector-CByJjmPD.cjs → inspector-CKc58UuI.cjs} +557 -136
- package/dist/inspector-CKc58UuI.cjs.map +1 -0
- package/dist/{inspector-ClhpqKLi.js → inspector-DZrN0kej.js} +556 -135
- package/dist/inspector-DZrN0kej.js.map +1 -0
- package/dist/{inspector-url-7qhtJwY6.cjs → inspector-url-C3LTKgXt.cjs} +3 -1
- package/dist/inspector-url-C3LTKgXt.cjs.map +1 -0
- package/dist/{inspector-url-DuEFmxLP.js → inspector-url-CyQcuBI9.js} +3 -1
- package/dist/inspector-url-CyQcuBI9.js.map +1 -0
- package/dist/mcp/index.cjs +119 -40
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +116 -37
- package/dist/mcp/index.js.map +1 -1
- package/dist/style.css +12 -0
- package/dist/{use-app-X7JbGskk.js → use-app-BNbz1uzj.js} +51 -42
- package/dist/use-app-BNbz1uzj.js.map +1 -0
- package/dist/{use-app-D2h-aiyr.cjs → use-app-Dqh20JPP.cjs} +93 -72
- package/dist/use-app-Dqh20JPP.cjs.map +1 -0
- package/package.json +2 -2
- package/template/dist/albums/albums.html +3 -3
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.html +3 -3
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.html +3 -3
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.html +3 -3
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.vite/deps/_metadata.json +3 -3
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +51 -42
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +56 -50
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +52 -43
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
- package/template/tests/e2e/albums.spec.ts +20 -16
- package/template/tests/e2e/carousel.spec.ts +1 -1
- package/template/tests/e2e/dev-overlay.spec.ts +118 -0
- package/template/tests/e2e/helpers.ts +13 -0
- package/template/tests/e2e/map.spec.ts +1 -1
- package/template/tests/e2e/review.spec.ts +1 -1
- package/template/tests/live/albums.spec.ts +10 -0
- package/template/tests/live/playwright.config.ts +1 -1
- package/dist/inspector-CByJjmPD.cjs.map +0 -1
- package/dist/inspector-ClhpqKLi.js.map +0 -1
- package/dist/inspector-url-7qhtJwY6.cjs.map +0 -1
- package/dist/inspector-url-DuEFmxLP.js.map +0 -1
- package/dist/use-app-D2h-aiyr.cjs.map +0 -1
- package/dist/use-app-X7JbGskk.js.map +0 -1
|
@@ -74,6 +74,18 @@ export interface HostShell {
|
|
|
74
74
|
* Values should use CSS light-dark() for automatic theme adaptation.
|
|
75
75
|
*/
|
|
76
76
|
pageStyles?: Record<string, string>;
|
|
77
|
+
/**
|
|
78
|
+
* Display modes this host supports.
|
|
79
|
+
* The sidebar display mode picker only shows modes in this list.
|
|
80
|
+
* Defaults to ['inline', 'pip', 'fullscreen'] if not specified.
|
|
81
|
+
*/
|
|
82
|
+
availableDisplayModes?: McpUiDisplayMode[];
|
|
83
|
+
/**
|
|
84
|
+
* CSS containing @font-face rules for the host's custom fonts.
|
|
85
|
+
* Injected into the inspector page when this host is active so the
|
|
86
|
+
* conversation chrome can use the same font as the real host.
|
|
87
|
+
*/
|
|
88
|
+
fontCss?: string;
|
|
77
89
|
}
|
|
78
90
|
/** Register a host shell. Idempotent — re-registering with the same id replaces. */
|
|
79
91
|
export declare function registerHostShell(shell: HostShell): void;
|
package/dist/inspector/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../chunk-9hOWP6kD.cjs");
|
|
3
3
|
require("../protocol-jbxhzcnS.cjs");
|
|
4
|
-
const require_inspector = require("../inspector-
|
|
5
|
-
const require_inspector_url = require("../inspector-url-
|
|
4
|
+
const require_inspector = require("../inspector-CKc58UuI.cjs");
|
|
5
|
+
const require_inspector_url = require("../inspector-url-C3LTKgXt.cjs");
|
|
6
6
|
const require_discovery = require("../discovery-Clu4uHp1.cjs");
|
|
7
7
|
//#region src/inspector/index.ts
|
|
8
8
|
var inspector_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
package/dist/inspector/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as __exportAll } from "../chunk-D6g4UhsZ.js";
|
|
2
2
|
import "../protocol-DJmRaBzO.js";
|
|
3
|
-
import { _ as McpAppHost, a as SidebarControl, b as getRegisteredHosts, c as SidebarTextarea, d as ThemeProvider, f as useThemeContext, g as extractResourceCSP, h as IframeResource, i as SidebarCollapsibleControl, l as SidebarToggle, m as useInspectorState, n as resolveServerToolResult, o as SidebarInput, p as useMcpConnection, r as SidebarCheckbox, s as SidebarSelect, t as Inspector, u as SimpleSidebar, v as SCREEN_WIDTHS, x as registerHostShell, y as getHostShell } from "../inspector-
|
|
4
|
-
import { t as createInspectorUrl } from "../inspector-url-
|
|
3
|
+
import { _ as McpAppHost, a as SidebarControl, b as getRegisteredHosts, c as SidebarTextarea, d as ThemeProvider, f as useThemeContext, g as extractResourceCSP, h as IframeResource, i as SidebarCollapsibleControl, l as SidebarToggle, m as useInspectorState, n as resolveServerToolResult, o as SidebarInput, p as useMcpConnection, r as SidebarCheckbox, s as SidebarSelect, t as Inspector, u as SimpleSidebar, v as SCREEN_WIDTHS, x as registerHostShell, y as getHostShell } from "../inspector-DZrN0kej.js";
|
|
4
|
+
import { t as createInspectorUrl } from "../inspector-url-CyQcuBI9.js";
|
|
5
5
|
import { c as toPascalCase, i as findResourceKey, n as extractSimulationKey, r as findResourceDirs, s as getComponentName, t as extractResourceKey } from "../discovery-Cgoegt62.js";
|
|
6
6
|
//#region src/inspector/index.ts
|
|
7
7
|
var inspector_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -109,6 +109,19 @@ export interface InspectorUrlParams {
|
|
|
109
109
|
* Enable Prod Resources mode (production dist/ bundles instead of HMR).
|
|
110
110
|
*/
|
|
111
111
|
prodResources?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Show the inspector sidebar. Useful for headless testing or embedding
|
|
114
|
+
* the inspector as a pure resource viewer.
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
sidebar?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Show the dev overlay (resource timestamp + tool timing) inside resources.
|
|
120
|
+
* Set to false to hide it during e2e tests so it doesn't interfere with
|
|
121
|
+
* element assertions.
|
|
122
|
+
* @default true
|
|
123
|
+
*/
|
|
124
|
+
devOverlay?: boolean;
|
|
112
125
|
}
|
|
113
126
|
/**
|
|
114
127
|
* Creates a URL path with query parameters for the Inspector.
|
|
@@ -20,6 +20,8 @@ export interface McpAppHostOptions {
|
|
|
20
20
|
onLog?: (params: LoggingMessageNotification['params']) => void;
|
|
21
21
|
onCallTool?: (params: CallToolRequest['params']) => CallToolResult | Promise<CallToolResult>;
|
|
22
22
|
onDownloadFile?: (contents: unknown[]) => void;
|
|
23
|
+
/** Called when the app requests teardown (app-initiated close). */
|
|
24
|
+
onRequestTeardown?: () => void;
|
|
23
25
|
/** Called after the iframe confirms rendering in a new display mode (paint fence resolved). */
|
|
24
26
|
onDisplayModeReady?: (mode: string) => void;
|
|
25
27
|
/**
|
|
@@ -43,6 +45,7 @@ export declare class McpAppHost {
|
|
|
43
45
|
private _prevDisplayMode;
|
|
44
46
|
private _pendingToolInput;
|
|
45
47
|
private _pendingToolResult;
|
|
48
|
+
private _messageListener;
|
|
46
49
|
constructor(options?: McpAppHostOptions);
|
|
47
50
|
/**
|
|
48
51
|
* Connect to an iframe's contentWindow.
|
|
@@ -43,7 +43,7 @@ interface SidebarInputProps {
|
|
|
43
43
|
/** When provided, onChange is only called on blur instead of on every keystroke. */
|
|
44
44
|
applyOnBlur?: boolean;
|
|
45
45
|
placeholder?: string;
|
|
46
|
-
type?: 'text' | 'number';
|
|
46
|
+
type?: 'text' | 'number' | 'password';
|
|
47
47
|
disabled?: boolean;
|
|
48
48
|
}
|
|
49
49
|
export declare function SidebarInput({ value, onChange, applyOnBlur, placeholder, type, disabled, }: SidebarInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -88,6 +88,8 @@ export interface InspectorState {
|
|
|
88
88
|
prefersBorder: boolean;
|
|
89
89
|
urlTool: string | undefined;
|
|
90
90
|
urlProdResources: boolean | undefined;
|
|
91
|
+
urlSidebar: boolean | undefined;
|
|
92
|
+
urlDevOverlay: boolean | undefined;
|
|
91
93
|
}
|
|
92
94
|
export declare function useInspectorState({ simulations, defaultHost, }: UseInspectorStateOptions): InspectorState;
|
|
93
95
|
export {};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export type AuthType = 'none' | 'bearer' | 'oauth';
|
|
2
|
+
export interface AuthConfig {
|
|
3
|
+
type: AuthType;
|
|
4
|
+
/** Bearer token (when type === 'bearer') */
|
|
5
|
+
bearerToken?: string;
|
|
6
|
+
}
|
|
1
7
|
export interface McpConnectionState {
|
|
2
8
|
/** Current connection status */
|
|
3
9
|
status: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
@@ -8,7 +14,9 @@ export interface McpConnectionState {
|
|
|
8
14
|
/** True after at least one user-initiated reconnect has been attempted (URL change). */
|
|
9
15
|
hasReconnected: boolean;
|
|
10
16
|
/** Connect to a new MCP server URL. Returns discovered simulations on success. */
|
|
11
|
-
reconnect: (url: string) => Promise<void>;
|
|
17
|
+
reconnect: (url: string, auth?: AuthConfig) => Promise<void>;
|
|
18
|
+
/** Update connection state after OAuth completes (bypasses /__sunpeak/connect). */
|
|
19
|
+
setConnected: (simulations?: Record<string, unknown>) => void;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
22
|
* Hook for managing MCP server connection status via the dev server proxy.
|