sunpeak 0.16.29 → 0.17.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/bin/commands/dev.mjs +169 -342
- package/bin/commands/inspect.mjs +763 -0
- package/bin/commands/new.mjs +2 -2
- package/bin/lib/inspect/inspect-config.d.mts +20 -0
- package/bin/lib/inspect/inspect-config.mjs +76 -0
- package/bin/lib/live/global-setup.mjs +6 -1
- package/bin/sunpeak.js +11 -1
- package/dist/chatgpt/globals.css +8 -0
- package/dist/chatgpt/index.cjs +3 -11
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +2 -2
- package/dist/chatgpt/index.js +4 -8
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/discovery-Cgoegt62.js +114 -0
- package/dist/discovery-Cgoegt62.js.map +1 -0
- package/dist/discovery-Clu4uHp1.cjs +161 -0
- package/dist/discovery-Clu4uHp1.cjs.map +1 -0
- package/dist/index.cjs +1 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- 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/lib/discovery.d.ts +7 -67
- package/dist/lib/index.d.ts +0 -1
- package/dist/mcp/index.cjs +34 -23
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +34 -23
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +5 -0
- package/dist/simulator/index.cjs +5 -11
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.ts +4 -2
- package/dist/simulator/index.js +5 -8
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/simple-sidebar.d.ts +7 -4
- package/dist/simulator/simulator-url.d.ts +8 -0
- package/dist/simulator/simulator.d.ts +15 -2
- package/dist/simulator/use-mcp-connection.d.ts +19 -0
- package/dist/{simulator-DIVvI69i.cjs → simulator-CH9hs0N6.cjs} +129 -21
- package/dist/simulator-CH9hs0N6.cjs.map +1 -0
- package/dist/{simulator-C7mkK7Sz.js → simulator-Dl8B-Ljb.js} +124 -22
- package/dist/simulator-Dl8B-Ljb.js.map +1 -0
- package/dist/{simulator-url-BDGD4vZD.cjs → simulator-url-CozKF1jf.cjs} +3 -1
- package/dist/simulator-url-CozKF1jf.cjs.map +1 -0
- package/dist/{simulator-url-Bkxj43yT.js → simulator-url-KoS_ToP6.js} +3 -1
- package/dist/simulator-url-KoS_ToP6.js.map +1 -0
- package/dist/style.css +8 -0
- package/package.json +11 -3
- package/template/dist/albums/albums.html +105 -0
- package/template/dist/albums/albums.json +16 -0
- package/template/dist/carousel/carousel.html +105 -0
- package/template/dist/carousel/carousel.json +16 -0
- package/template/dist/map/map.html +3060 -0
- package/template/dist/map/map.json +22 -0
- package/template/dist/review/review.html +105 -0
- package/template/dist/review/review.json +16 -0
- package/template/dist/server.js +15 -0
- package/template/dist/tools/review-diff.js +50 -0
- package/template/dist/tools/review-post.js +50 -0
- package/template/dist/tools/review-purchase.js +61 -0
- package/template/dist/tools/review.js +31 -0
- package/template/dist/tools/show-albums.js +56 -0
- package/template/dist/tools/show-carousel.js +41 -0
- package/template/dist/tools/show-map.js +47 -0
- package/template/node_modules/.vite/deps/_metadata.json +8 -0
- package/template/node_modules/.vite/deps/package.json +3 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +500 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +563 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +575 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@testing-library_react.js +11363 -0
- package/template/node_modules/.vite-mcp/deps/@testing-library_react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/_metadata.json +130 -0
- package/template/node_modules/.vite-mcp/deps/chunk-BoAXSpZd.js +33 -0
- package/template/node_modules/.vite-mcp/deps/client-CU1wWud4.js +14385 -0
- package/template/node_modules/.vite-mcp/deps/client-CU1wWud4.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/clsx.js +18 -0
- package/template/node_modules/.vite-mcp/deps/clsx.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/dist-uWX8WbjY.js +505 -0
- package/template/node_modules/.vite-mcp/deps/dist-uWX8WbjY.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-react.js +1461 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-wheel-gestures.js +536 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-wheel-gestures.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/magic-string.es-Cklsmr-5.js +1013 -0
- package/template/node_modules/.vite-mcp/deps/magic-string.es-Cklsmr-5.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +46311 -0
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/package.json +3 -0
- package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js +2090 -0
- package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react-dom.js +186 -0
- package/template/node_modules/.vite-mcp/deps/react-dom.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react-dom_client.js +2 -0
- package/template/node_modules/.vite-mcp/deps/react.js +769 -0
- package/template/node_modules/.vite-mcp/deps/react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-dev-runtime.js +205 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-dev-runtime.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-runtime.js +209 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-runtime.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/schemas-NsgmY9QV.js +12157 -0
- package/template/node_modules/.vite-mcp/deps/schemas-NsgmY9QV.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/tailwind-merge.js +2025 -0
- package/template/node_modules/.vite-mcp/deps/tailwind-merge.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js +14021 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/zod.js +624 -0
- package/template/node_modules/.vite-mcp/deps/zod.js.map +1 -0
- package/template/src/tools/review-diff.test.ts +5 -1
- package/template/src/tools/review-diff.ts +1 -1
- package/template/src/tools/review-post.test.ts +5 -1
- package/template/src/tools/review-post.ts +1 -1
- package/template/src/tools/review-purchase.test.ts +5 -1
- package/template/src/tools/review-purchase.ts +1 -1
- package/template/src/tools/review.test.ts +5 -1
- package/template/src/tools/review.ts +1 -1
- package/template/src/tools/show-albums.test.ts +5 -1
- package/template/src/tools/show-albums.ts +1 -1
- package/template/src/tools/show-carousel.test.ts +5 -1
- package/template/src/tools/show-carousel.ts +1 -1
- package/template/src/tools/show-map.test.ts +5 -1
- package/template/src/tools/show-map.ts +1 -1
- package/dist/discovery-BxKCIgG5.cjs +0 -332
- package/dist/discovery-BxKCIgG5.cjs.map +0 -1
- package/dist/discovery-Du4LHrih.js +0 -261
- package/dist/discovery-Du4LHrih.js.map +0 -1
- package/dist/simulator-C7mkK7Sz.js.map +0 -1
- package/dist/simulator-DIVvI69i.cjs.map +0 -1
- package/dist/simulator-url-BDGD4vZD.cjs.map +0 -1
- package/dist/simulator-url-Bkxj43yT.js.map +0 -1
- package/template/.sunpeak/dev.tsx +0 -79
- package/template/.sunpeak/resource-loader.html +0 -20
- package/template/.sunpeak/resource-loader.tsx +0 -57
- package/template/index.html +0 -14
- package/template/src/resources/index.ts +0 -17
package/dist/mcp/types.d.ts
CHANGED
|
@@ -75,6 +75,11 @@ export interface SimulationWithDist {
|
|
|
75
75
|
* Handle returned by `runMCPServer` for controlling the running server.
|
|
76
76
|
*/
|
|
77
77
|
export interface MCPServerHandle {
|
|
78
|
+
/**
|
|
79
|
+
* Promise that resolves when the HTTP server is listening.
|
|
80
|
+
* Useful for callers that need to connect to the server immediately after starting it.
|
|
81
|
+
*/
|
|
82
|
+
ready: Promise<void>;
|
|
78
83
|
/**
|
|
79
84
|
* Notify non-local sessions that resources have changed.
|
|
80
85
|
* Sends `notifications/resources/list_changed` so hosts re-fetch fresh content.
|
package/dist/simulator/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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_simulator = require("../simulator-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const require_simulator = require("../simulator-CH9hs0N6.cjs");
|
|
5
|
+
const require_simulator_url = require("../simulator-url-CozKF1jf.cjs");
|
|
6
|
+
const require_discovery = require("../discovery-Clu4uHp1.cjs");
|
|
7
7
|
//#region src/simulator/index.ts
|
|
8
8
|
var simulator_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
9
9
|
IframeResource: () => require_simulator.IframeResource,
|
|
@@ -19,10 +19,6 @@ var simulator_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
|
19
19
|
SimpleSidebar: () => require_simulator.SimpleSidebar,
|
|
20
20
|
Simulator: () => require_simulator.Simulator,
|
|
21
21
|
ThemeProvider: () => require_simulator.ThemeProvider,
|
|
22
|
-
buildDevSimulations: () => require_discovery.buildDevSimulations,
|
|
23
|
-
buildResourceMap: () => require_discovery.buildResourceMap,
|
|
24
|
-
buildSimulations: () => require_discovery.buildSimulations,
|
|
25
|
-
createResourceExports: () => require_discovery.createResourceExports,
|
|
26
22
|
createSimulatorUrl: () => require_simulator_url.createSimulatorUrl,
|
|
27
23
|
extractResourceCSP: () => require_simulator.extractResourceCSP,
|
|
28
24
|
extractResourceKey: () => require_discovery.extractResourceKey,
|
|
@@ -35,6 +31,7 @@ var simulator_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
|
35
31
|
registerHostShell: () => require_simulator.registerHostShell,
|
|
36
32
|
resolveServerToolResult: () => require_simulator.resolveServerToolResult,
|
|
37
33
|
toPascalCase: () => require_discovery.toPascalCase,
|
|
34
|
+
useMcpConnection: () => require_simulator.useMcpConnection,
|
|
38
35
|
useSimulatorState: () => require_simulator.useSimulatorState,
|
|
39
36
|
useThemeContext: () => require_simulator.useThemeContext
|
|
40
37
|
});
|
|
@@ -52,10 +49,6 @@ exports.SidebarToggle = require_simulator.SidebarToggle;
|
|
|
52
49
|
exports.SimpleSidebar = require_simulator.SimpleSidebar;
|
|
53
50
|
exports.Simulator = require_simulator.Simulator;
|
|
54
51
|
exports.ThemeProvider = require_simulator.ThemeProvider;
|
|
55
|
-
exports.buildDevSimulations = require_discovery.buildDevSimulations;
|
|
56
|
-
exports.buildResourceMap = require_discovery.buildResourceMap;
|
|
57
|
-
exports.buildSimulations = require_discovery.buildSimulations;
|
|
58
|
-
exports.createResourceExports = require_discovery.createResourceExports;
|
|
59
52
|
exports.createSimulatorUrl = require_simulator_url.createSimulatorUrl;
|
|
60
53
|
exports.extractResourceCSP = require_simulator.extractResourceCSP;
|
|
61
54
|
exports.extractResourceKey = require_discovery.extractResourceKey;
|
|
@@ -74,6 +67,7 @@ Object.defineProperty(exports, "simulator_exports", {
|
|
|
74
67
|
}
|
|
75
68
|
});
|
|
76
69
|
exports.toPascalCase = require_discovery.toPascalCase;
|
|
70
|
+
exports.useMcpConnection = require_simulator.useMcpConnection;
|
|
77
71
|
exports.useSimulatorState = require_simulator.useSimulatorState;
|
|
78
72
|
exports.useThemeContext = require_simulator.useThemeContext;
|
|
79
73
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/simulator/index.ts"],"sourcesContent":["/**\n * Generic multi-host simulator for Sunpeak MCP Apps.\n *\n * The Simulator component provides a dev environment for testing MCP Apps\n * against multiple host platforms (ChatGPT, Claude, etc.).\n *\n * @example\n * ```tsx\n * import { simulator } from 'sunpeak';\n * const { Simulator
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/simulator/index.ts"],"sourcesContent":["/**\n * Generic multi-host simulator for Sunpeak MCP Apps.\n *\n * The Simulator component provides a dev environment for testing MCP Apps\n * against multiple host platforms (ChatGPT, Claude, etc.).\n *\n * @example\n * ```tsx\n * import { simulator } from 'sunpeak';\n * const { Simulator } = simulator;\n *\n * <Simulator simulations={simulations} appName=\"My App\" />\n * ```\n *\n * @module sunpeak/simulator\n */\n\n// Register built-in host shells\nimport '../chatgpt/chatgpt-host';\nimport '../claude/claude-host';\n\n// Core simulator component\nexport { Simulator } from './simulator';\nexport type { SimulatorProps } from './simulator';\n\n// State hook (for custom simulator builds)\nexport { useSimulatorState } from './use-simulator-state';\nexport type { UseSimulatorStateOptions, SimulatorState } from './use-simulator-state';\n\n// Host shell system\nexport { registerHostShell, getHostShell, getRegisteredHosts } from './hosts';\nexport type { HostConversationProps, HostShell, HostId } from './hosts';\n\n// Infrastructure\nexport { McpAppHost } from './mcp-app-host';\nexport type { McpAppHostOptions } from './mcp-app-host';\nexport { IframeResource, extractResourceCSP } from './iframe-resource';\nexport type { ResourceCSP } from './iframe-resource';\nexport { ThemeProvider, useThemeContext } from './theme-provider';\n\n// MCP connection (inspect mode)\nexport { useMcpConnection } from './use-mcp-connection';\nexport type { McpConnectionState } from './use-mcp-connection';\n\n// Simulation types & resolution\nexport type { Simulation, ServerToolMock } from '../types/simulation';\nexport { resolveServerToolResult } from '../types/simulation';\n\n// Types & URL helpers\nexport type { ScreenWidth, SimulatorConfig } from './simulator-types';\nexport { SCREEN_WIDTHS } from './simulator-types';\nexport { createSimulatorUrl } from './simulator-url';\nexport type { SimulatorUrlParams } from './simulator-url';\n\n// Sidebar components (for building custom simulators)\nexport {\n SimpleSidebar,\n SidebarControl,\n SidebarCollapsibleControl,\n SidebarSelect,\n SidebarInput,\n SidebarCheckbox,\n SidebarTextarea,\n SidebarToggle,\n} from './simple-sidebar';\n\n// Discovery utilities\nexport {\n toPascalCase,\n extractResourceKey,\n extractSimulationKey,\n findResourceKey,\n getComponentName,\n findResourceDirs,\n} from '../lib/discovery';\nexport type { ResourceDirInfo, FsOps } from '../lib/discovery';\n"],"mappings":""}
|
|
@@ -9,6 +9,8 @@ export type { McpAppHostOptions } from './mcp-app-host';
|
|
|
9
9
|
export { IframeResource, extractResourceCSP } from './iframe-resource';
|
|
10
10
|
export type { ResourceCSP } from './iframe-resource';
|
|
11
11
|
export { ThemeProvider, useThemeContext } from './theme-provider';
|
|
12
|
+
export { useMcpConnection } from './use-mcp-connection';
|
|
13
|
+
export type { McpConnectionState } from './use-mcp-connection';
|
|
12
14
|
export type { Simulation, ServerToolMock } from '../types/simulation';
|
|
13
15
|
export { resolveServerToolResult } from '../types/simulation';
|
|
14
16
|
export type { ScreenWidth, SimulatorConfig } from './simulator-types';
|
|
@@ -16,5 +18,5 @@ export { SCREEN_WIDTHS } from './simulator-types';
|
|
|
16
18
|
export { createSimulatorUrl } from './simulator-url';
|
|
17
19
|
export type { SimulatorUrlParams } from './simulator-url';
|
|
18
20
|
export { SimpleSidebar, SidebarControl, SidebarCollapsibleControl, SidebarSelect, SidebarInput, SidebarCheckbox, SidebarTextarea, SidebarToggle, } from './simple-sidebar';
|
|
19
|
-
export {
|
|
20
|
-
export type {
|
|
21
|
+
export { toPascalCase, extractResourceKey, extractSimulationKey, findResourceKey, getComponentName, findResourceDirs, } from '../lib/discovery';
|
|
22
|
+
export type { ResourceDirInfo, FsOps } from '../lib/discovery';
|
package/dist/simulator/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as __exportAll } from "../chunk-D6g4UhsZ.js";
|
|
2
2
|
import "../protocol-DJmRaBzO.js";
|
|
3
|
-
import { _ as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
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 useSimulatorState, n as resolveServerToolResult, o as SidebarInput, p as useMcpConnection, r as SidebarCheckbox, s as SidebarSelect, t as Simulator, u as SimpleSidebar, v as SCREEN_WIDTHS, x as registerHostShell, y as getHostShell } from "../simulator-Dl8B-Ljb.js";
|
|
4
|
+
import { t as createSimulatorUrl } from "../simulator-url-KoS_ToP6.js";
|
|
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/simulator/index.ts
|
|
7
7
|
var simulator_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
IframeResource: () => IframeResource,
|
|
@@ -18,10 +18,6 @@ var simulator_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
18
|
SimpleSidebar: () => SimpleSidebar,
|
|
19
19
|
Simulator: () => Simulator,
|
|
20
20
|
ThemeProvider: () => ThemeProvider,
|
|
21
|
-
buildDevSimulations: () => buildDevSimulations,
|
|
22
|
-
buildResourceMap: () => buildResourceMap,
|
|
23
|
-
buildSimulations: () => buildSimulations,
|
|
24
|
-
createResourceExports: () => createResourceExports,
|
|
25
21
|
createSimulatorUrl: () => createSimulatorUrl,
|
|
26
22
|
extractResourceCSP: () => extractResourceCSP,
|
|
27
23
|
extractResourceKey: () => extractResourceKey,
|
|
@@ -34,10 +30,11 @@ var simulator_exports = /* @__PURE__ */ __exportAll({
|
|
|
34
30
|
registerHostShell: () => registerHostShell,
|
|
35
31
|
resolveServerToolResult: () => resolveServerToolResult,
|
|
36
32
|
toPascalCase: () => toPascalCase,
|
|
33
|
+
useMcpConnection: () => useMcpConnection,
|
|
37
34
|
useSimulatorState: () => useSimulatorState,
|
|
38
35
|
useThemeContext: () => useThemeContext
|
|
39
36
|
});
|
|
40
37
|
//#endregion
|
|
41
|
-
export { IframeResource, McpAppHost, SCREEN_WIDTHS, SidebarCheckbox, SidebarCollapsibleControl, SidebarControl, SidebarInput, SidebarSelect, SidebarTextarea, SidebarToggle, SimpleSidebar, Simulator, ThemeProvider,
|
|
38
|
+
export { IframeResource, McpAppHost, SCREEN_WIDTHS, SidebarCheckbox, SidebarCollapsibleControl, SidebarControl, SidebarInput, SidebarSelect, SidebarTextarea, SidebarToggle, SimpleSidebar, Simulator, ThemeProvider, createSimulatorUrl, extractResourceCSP, extractResourceKey, extractSimulationKey, findResourceDirs, findResourceKey, getComponentName, getHostShell, getRegisteredHosts, registerHostShell, resolveServerToolResult, simulator_exports as t, toPascalCase, useMcpConnection, useSimulatorState, useThemeContext };
|
|
42
39
|
|
|
43
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/simulator/index.ts"],"sourcesContent":["/**\n * Generic multi-host simulator for Sunpeak MCP Apps.\n *\n * The Simulator component provides a dev environment for testing MCP Apps\n * against multiple host platforms (ChatGPT, Claude, etc.).\n *\n * @example\n * ```tsx\n * import { simulator } from 'sunpeak';\n * const { Simulator
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/simulator/index.ts"],"sourcesContent":["/**\n * Generic multi-host simulator for Sunpeak MCP Apps.\n *\n * The Simulator component provides a dev environment for testing MCP Apps\n * against multiple host platforms (ChatGPT, Claude, etc.).\n *\n * @example\n * ```tsx\n * import { simulator } from 'sunpeak';\n * const { Simulator } = simulator;\n *\n * <Simulator simulations={simulations} appName=\"My App\" />\n * ```\n *\n * @module sunpeak/simulator\n */\n\n// Register built-in host shells\nimport '../chatgpt/chatgpt-host';\nimport '../claude/claude-host';\n\n// Core simulator component\nexport { Simulator } from './simulator';\nexport type { SimulatorProps } from './simulator';\n\n// State hook (for custom simulator builds)\nexport { useSimulatorState } from './use-simulator-state';\nexport type { UseSimulatorStateOptions, SimulatorState } from './use-simulator-state';\n\n// Host shell system\nexport { registerHostShell, getHostShell, getRegisteredHosts } from './hosts';\nexport type { HostConversationProps, HostShell, HostId } from './hosts';\n\n// Infrastructure\nexport { McpAppHost } from './mcp-app-host';\nexport type { McpAppHostOptions } from './mcp-app-host';\nexport { IframeResource, extractResourceCSP } from './iframe-resource';\nexport type { ResourceCSP } from './iframe-resource';\nexport { ThemeProvider, useThemeContext } from './theme-provider';\n\n// MCP connection (inspect mode)\nexport { useMcpConnection } from './use-mcp-connection';\nexport type { McpConnectionState } from './use-mcp-connection';\n\n// Simulation types & resolution\nexport type { Simulation, ServerToolMock } from '../types/simulation';\nexport { resolveServerToolResult } from '../types/simulation';\n\n// Types & URL helpers\nexport type { ScreenWidth, SimulatorConfig } from './simulator-types';\nexport { SCREEN_WIDTHS } from './simulator-types';\nexport { createSimulatorUrl } from './simulator-url';\nexport type { SimulatorUrlParams } from './simulator-url';\n\n// Sidebar components (for building custom simulators)\nexport {\n SimpleSidebar,\n SidebarControl,\n SidebarCollapsibleControl,\n SidebarSelect,\n SidebarInput,\n SidebarCheckbox,\n SidebarTextarea,\n SidebarToggle,\n} from './simple-sidebar';\n\n// Discovery utilities\nexport {\n toPascalCase,\n extractResourceKey,\n extractSimulationKey,\n findResourceKey,\n getComponentName,\n findResourceDirs,\n} from '../lib/discovery';\nexport type { ResourceDirInfo, FsOps } from '../lib/discovery';\n"],"mappings":""}
|
|
@@ -7,14 +7,15 @@ interface SimpleSidebarProps {
|
|
|
7
7
|
}
|
|
8
8
|
export declare function SimpleSidebar({ children, controls, headerRight }: SimpleSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
interface SidebarControlProps {
|
|
10
|
-
label:
|
|
10
|
+
label: React.ReactNode;
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
/** Short tooltip shown on hover of the help icon */
|
|
13
13
|
tooltip?: string;
|
|
14
14
|
/** Docs path appended to https://sunpeak.ai/docs/ */
|
|
15
15
|
docsPath?: string;
|
|
16
|
+
'data-testid'?: string;
|
|
16
17
|
}
|
|
17
|
-
export declare function SidebarControl({ label, children, tooltip, docsPath }: SidebarControlProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function SidebarControl({ label, children, tooltip, docsPath, 'data-testid': testId, }: SidebarControlProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
interface SidebarCollapsibleControlProps {
|
|
19
20
|
label: string;
|
|
20
21
|
children: React.ReactNode;
|
|
@@ -23,8 +24,9 @@ interface SidebarCollapsibleControlProps {
|
|
|
23
24
|
tooltip?: string;
|
|
24
25
|
/** Docs path appended to https://sunpeak.ai/docs/ */
|
|
25
26
|
docsPath?: string;
|
|
27
|
+
'data-testid'?: string;
|
|
26
28
|
}
|
|
27
|
-
export declare function SidebarCollapsibleControl({ label, children, defaultCollapsed, tooltip, docsPath, }: SidebarCollapsibleControlProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function SidebarCollapsibleControl({ label, children, defaultCollapsed, tooltip, docsPath, 'data-testid': testId, }: SidebarCollapsibleControlProps): import("react/jsx-runtime").JSX.Element;
|
|
28
30
|
interface SidebarSelectProps {
|
|
29
31
|
value: string;
|
|
30
32
|
onChange: (value: string) => void;
|
|
@@ -63,8 +65,9 @@ interface SidebarTextareaProps {
|
|
|
63
65
|
placeholder?: string;
|
|
64
66
|
maxRows?: number;
|
|
65
67
|
error?: string;
|
|
68
|
+
'data-testid'?: string;
|
|
66
69
|
}
|
|
67
|
-
export declare function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRows, error, }: SidebarTextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRows, error, 'data-testid': testId, }: SidebarTextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
68
71
|
interface SidebarToggleProps {
|
|
69
72
|
value: string;
|
|
70
73
|
onChange: (value: string) => void;
|
|
@@ -93,6 +93,14 @@ export interface SimulatorUrlParams {
|
|
|
93
93
|
* Enable Prod Resources mode (production dist/ bundles instead of HMR).
|
|
94
94
|
*/
|
|
95
95
|
prodResources?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* MCP server URL for inspect mode. Encoded into the URL for informational purposes.
|
|
98
|
+
*/
|
|
99
|
+
serverUrl?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Pre-select a tool by name (alternative to the `simulation` param).
|
|
102
|
+
*/
|
|
103
|
+
tool?: string;
|
|
96
104
|
}
|
|
97
105
|
/**
|
|
98
106
|
* Creates a URL path with query parameters for the ChatGPT Simulator.
|
|
@@ -9,11 +9,16 @@ export interface SimulatorProps {
|
|
|
9
9
|
appIcon?: string;
|
|
10
10
|
/** Which host shell to use initially. Defaults to 'chatgpt'. */
|
|
11
11
|
defaultHost?: HostId;
|
|
12
|
-
/** Override callServerTool resolution. When provided, bypasses simulation serverTools mocks
|
|
12
|
+
/** Override callServerTool resolution. When provided, bypasses simulation serverTools mocks. Routes through MCP which returns simulation fixture data for UI tools. */
|
|
13
13
|
onCallTool?: (params: {
|
|
14
14
|
name: string;
|
|
15
15
|
arguments?: Record<string, unknown>;
|
|
16
16
|
}) => Promise<CallToolResult> | CallToolResult;
|
|
17
|
+
/** Direct tool handler call, bypassing MCP server mock data. Used by the Prod Tools Run button to call real handlers. Falls back to onCallTool if not provided. */
|
|
18
|
+
onCallToolDirect?: (params: {
|
|
19
|
+
name: string;
|
|
20
|
+
arguments?: Record<string, unknown>;
|
|
21
|
+
}) => Promise<CallToolResult> | CallToolResult;
|
|
17
22
|
/** Initial prod-tools mode state. Defaults to false. */
|
|
18
23
|
defaultProdTools?: boolean;
|
|
19
24
|
/** Initial prod-resources mode state. When true, resources load from dist/ instead of HMR. Defaults to false. */
|
|
@@ -26,5 +31,13 @@ export interface SimulatorProps {
|
|
|
26
31
|
* giving real cross-origin isolation that matches production hosts.
|
|
27
32
|
*/
|
|
28
33
|
sandboxUrl?: string;
|
|
34
|
+
/**
|
|
35
|
+
* MCP server URL. When provided, the simulator enters "inspect" mode:
|
|
36
|
+
* shows a server URL input in the sidebar (replacing prod-tools/prod-resources
|
|
37
|
+
* checkboxes), routes tool calls to the real server, and always shows the
|
|
38
|
+
* Run button. Simulations still work — those with toolResult use mock data,
|
|
39
|
+
* those without call the real server.
|
|
40
|
+
*/
|
|
41
|
+
mcpServerUrl?: string;
|
|
29
42
|
}
|
|
30
|
-
export declare function Simulator({ children, simulations, appName, appIcon, defaultHost, onCallTool, defaultProdTools, defaultProdResources, hideSimulatorModes, sandboxUrl, }: SimulatorProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function Simulator({ children, simulations, appName, appIcon, defaultHost, onCallTool, onCallToolDirect, defaultProdTools, defaultProdResources, hideSimulatorModes, sandboxUrl, mcpServerUrl, }: SimulatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface McpConnectionState {
|
|
2
|
+
/** Current connection status */
|
|
3
|
+
status: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
4
|
+
/** Error message if status is 'error' */
|
|
5
|
+
error?: string;
|
|
6
|
+
/** Verify the server connection is alive. */
|
|
7
|
+
reconnect: (url: string) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook for managing MCP server connection status via the dev server proxy.
|
|
11
|
+
*
|
|
12
|
+
* On mount (when `serverUrl` is provided), verifies the connection is alive
|
|
13
|
+
* by fetching `/__sunpeak/list-tools`. Tracks connection status for display
|
|
14
|
+
* in the sidebar (colored dot indicator).
|
|
15
|
+
*
|
|
16
|
+
* Tool calling is handled separately via the `onCallTool` prop — this
|
|
17
|
+
* hook only manages the connection lifecycle and status display.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useMcpConnection(serverUrl: string | undefined): McpConnectionState;
|
|
@@ -2492,6 +2492,69 @@ function useSimulatorState({ simulations, defaultHost = "chatgpt" }) {
|
|
|
2492
2492
|
};
|
|
2493
2493
|
}
|
|
2494
2494
|
//#endregion
|
|
2495
|
+
//#region src/simulator/use-mcp-connection.ts
|
|
2496
|
+
/**
|
|
2497
|
+
* Hook for managing MCP server connection status via the dev server proxy.
|
|
2498
|
+
*
|
|
2499
|
+
* On mount (when `serverUrl` is provided), verifies the connection is alive
|
|
2500
|
+
* by fetching `/__sunpeak/list-tools`. Tracks connection status for display
|
|
2501
|
+
* in the sidebar (colored dot indicator).
|
|
2502
|
+
*
|
|
2503
|
+
* Tool calling is handled separately via the `onCallTool` prop — this
|
|
2504
|
+
* hook only manages the connection lifecycle and status display.
|
|
2505
|
+
*/
|
|
2506
|
+
function useMcpConnection(serverUrl) {
|
|
2507
|
+
const [status, setStatus] = (0, react.useState)(serverUrl ? "connecting" : "disconnected");
|
|
2508
|
+
const [error, setError] = (0, react.useState)();
|
|
2509
|
+
const reconnect = (0, react.useCallback)(async (url) => {
|
|
2510
|
+
setStatus("connecting");
|
|
2511
|
+
setError(void 0);
|
|
2512
|
+
try {
|
|
2513
|
+
const res = await fetch("/__sunpeak/connect", {
|
|
2514
|
+
method: "POST",
|
|
2515
|
+
headers: { "Content-Type": "application/json" },
|
|
2516
|
+
body: JSON.stringify({ url })
|
|
2517
|
+
});
|
|
2518
|
+
if (!res.ok) {
|
|
2519
|
+
const text = await res.text();
|
|
2520
|
+
throw new Error(text || `Connection failed (${res.status})`);
|
|
2521
|
+
}
|
|
2522
|
+
setStatus("connected");
|
|
2523
|
+
} catch (err) {
|
|
2524
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
2525
|
+
setStatus("error");
|
|
2526
|
+
}
|
|
2527
|
+
}, []);
|
|
2528
|
+
(0, react.useEffect)(() => {
|
|
2529
|
+
if (!serverUrl) {
|
|
2530
|
+
setStatus("disconnected");
|
|
2531
|
+
return;
|
|
2532
|
+
}
|
|
2533
|
+
let cancelled = false;
|
|
2534
|
+
(async () => {
|
|
2535
|
+
setStatus("connecting");
|
|
2536
|
+
try {
|
|
2537
|
+
const res = await fetch("/__sunpeak/list-tools");
|
|
2538
|
+
if (cancelled) return;
|
|
2539
|
+
if (!res.ok) throw new Error(`Health check failed (${res.status})`);
|
|
2540
|
+
setStatus("connected");
|
|
2541
|
+
} catch (err) {
|
|
2542
|
+
if (cancelled) return;
|
|
2543
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
2544
|
+
setStatus("error");
|
|
2545
|
+
}
|
|
2546
|
+
})();
|
|
2547
|
+
return () => {
|
|
2548
|
+
cancelled = true;
|
|
2549
|
+
};
|
|
2550
|
+
}, [serverUrl]);
|
|
2551
|
+
return {
|
|
2552
|
+
status,
|
|
2553
|
+
error,
|
|
2554
|
+
reconnect
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
//#endregion
|
|
2495
2558
|
//#region src/simulator/theme-provider.tsx
|
|
2496
2559
|
var ThemeProviderContext = react.createContext(void 0);
|
|
2497
2560
|
/** Default theme applier: sets data-theme attribute on document.documentElement */
|
|
@@ -2697,9 +2760,10 @@ function HelpIcon({ tooltip, docsPath }) {
|
|
|
2697
2760
|
})]
|
|
2698
2761
|
});
|
|
2699
2762
|
}
|
|
2700
|
-
function SidebarControl({ label, children, tooltip, docsPath }) {
|
|
2763
|
+
function SidebarControl({ label, children, tooltip, docsPath, "data-testid": testId }) {
|
|
2701
2764
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2702
2765
|
className: "space-y-1",
|
|
2766
|
+
"data-testid": testId,
|
|
2703
2767
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2704
2768
|
className: "text-[10px] font-medium leading-tight inline-flex items-center gap-1",
|
|
2705
2769
|
style: { color: "var(--color-text-secondary)" },
|
|
@@ -2710,10 +2774,11 @@ function SidebarControl({ label, children, tooltip, docsPath }) {
|
|
|
2710
2774
|
}), children]
|
|
2711
2775
|
});
|
|
2712
2776
|
}
|
|
2713
|
-
function SidebarCollapsibleControl({ label, children, defaultCollapsed = true, tooltip, docsPath }) {
|
|
2777
|
+
function SidebarCollapsibleControl({ label, children, defaultCollapsed = true, tooltip, docsPath, "data-testid": testId }) {
|
|
2714
2778
|
const [isCollapsed, setIsCollapsed] = react.useState(defaultCollapsed);
|
|
2715
2779
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2716
2780
|
className: "space-y-1",
|
|
2781
|
+
"data-testid": testId,
|
|
2717
2782
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2718
2783
|
onClick: () => setIsCollapsed(!isCollapsed),
|
|
2719
2784
|
className: "w-full flex items-center justify-between text-[10px] font-medium leading-tight transition-colors py-1 cursor-pointer",
|
|
@@ -2816,7 +2881,7 @@ function SidebarCheckbox({ checked, onChange, label, tooltip, docsPath }) {
|
|
|
2816
2881
|
})]
|
|
2817
2882
|
});
|
|
2818
2883
|
}
|
|
2819
|
-
function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRows = 8, error }) {
|
|
2884
|
+
function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRows = 8, error, "data-testid": testId }) {
|
|
2820
2885
|
const contentRows = value?.split("\n").length ?? 1;
|
|
2821
2886
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2822
2887
|
className: "space-y-0.5",
|
|
@@ -2827,6 +2892,7 @@ function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRow
|
|
|
2827
2892
|
onBlur,
|
|
2828
2893
|
placeholder,
|
|
2829
2894
|
rows: Math.min(contentRows, maxRows),
|
|
2895
|
+
"data-testid": testId,
|
|
2830
2896
|
className: "w-full text-[10px] font-mono rounded-md px-2 py-1.5 outline-none resize-y",
|
|
2831
2897
|
style: {
|
|
2832
2898
|
...formElementStyle,
|
|
@@ -2883,20 +2949,26 @@ function resolveServerToolResult(mock, args) {
|
|
|
2883
2949
|
}
|
|
2884
2950
|
//#endregion
|
|
2885
2951
|
//#region src/simulator/simulator.tsx
|
|
2886
|
-
function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, defaultHost = "chatgpt", onCallTool, defaultProdTools = false, defaultProdResources = false, hideSimulatorModes = false, sandboxUrl }) {
|
|
2952
|
+
function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, defaultHost = "chatgpt", onCallTool, onCallToolDirect, defaultProdTools = false, defaultProdResources = false, hideSimulatorModes = false, sandboxUrl, mcpServerUrl }) {
|
|
2953
|
+
const isInspectMode = mcpServerUrl != null;
|
|
2887
2954
|
const state = useSimulatorState({
|
|
2888
2955
|
simulations,
|
|
2889
2956
|
defaultHost
|
|
2890
2957
|
});
|
|
2891
|
-
const
|
|
2958
|
+
const connection = useMcpConnection(mcpServerUrl);
|
|
2959
|
+
const [prodTools, setProdTools] = react.useState(isInspectMode ? true : state.urlProdTools ?? defaultProdTools);
|
|
2892
2960
|
const [prodResources, setProdResources] = react.useState(state.urlProdResources ?? defaultProdResources);
|
|
2893
2961
|
const [isRunning, setIsRunning] = react.useState(false);
|
|
2894
2962
|
const [hasRun, setHasRun] = react.useState(false);
|
|
2895
2963
|
const [showCheck, setShowCheck] = react.useState(false);
|
|
2896
2964
|
const checkTimerRef = react.useRef(void 0);
|
|
2897
2965
|
react.useEffect(() => {
|
|
2898
|
-
if (prodTools)
|
|
2899
|
-
|
|
2966
|
+
if (prodTools) {
|
|
2967
|
+
setHasRun(false);
|
|
2968
|
+
state.setToolResult(void 0);
|
|
2969
|
+
state.setToolResultJson("");
|
|
2970
|
+
state.setToolResultError("");
|
|
2971
|
+
} else {
|
|
2900
2972
|
const simResult = state.selectedSim?.toolResult ?? void 0;
|
|
2901
2973
|
state.setToolResult(simResult);
|
|
2902
2974
|
}
|
|
@@ -2919,11 +2991,12 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
2919
2991
|
simulations
|
|
2920
2992
|
]);
|
|
2921
2993
|
const handleRun = react.useCallback(async () => {
|
|
2922
|
-
|
|
2994
|
+
const caller = onCallToolDirect ?? onCallTool;
|
|
2995
|
+
if (!caller || !state.selectedSim) return;
|
|
2923
2996
|
const toolName = state.selectedSim.tool.name;
|
|
2924
2997
|
setIsRunning(true);
|
|
2925
2998
|
try {
|
|
2926
|
-
const result = await
|
|
2999
|
+
const result = (isInspectMode ? state.selectedSim.toolResult : void 0) ?? await caller({
|
|
2927
3000
|
name: toolName,
|
|
2928
3001
|
arguments: state.toolInput
|
|
2929
3002
|
});
|
|
@@ -2953,7 +3026,12 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
2953
3026
|
} finally {
|
|
2954
3027
|
setIsRunning(false);
|
|
2955
3028
|
}
|
|
2956
|
-
}, [
|
|
3029
|
+
}, [
|
|
3030
|
+
onCallTool,
|
|
3031
|
+
onCallToolDirect,
|
|
3032
|
+
state,
|
|
3033
|
+
isInspectMode
|
|
3034
|
+
]);
|
|
2957
3035
|
const activeShell = getHostShell(state.activeHost);
|
|
2958
3036
|
const registeredHosts = getRegisteredHosts();
|
|
2959
3037
|
const ShellConversation = activeShell?.Conversation;
|
|
@@ -2986,18 +3064,21 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
2986
3064
|
} else prevPageStyleKeysRef.current = [];
|
|
2987
3065
|
}, [activeShell]);
|
|
2988
3066
|
const handleCallTool = react.useCallback((params) => {
|
|
2989
|
-
if (
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
3067
|
+
if (!prodTools) {
|
|
3068
|
+
const mock = state.selectedSim?.serverTools?.[params.name];
|
|
3069
|
+
if (mock) {
|
|
3070
|
+
const result = resolveServerToolResult(mock, params.arguments);
|
|
3071
|
+
if (result) return result;
|
|
3072
|
+
}
|
|
2994
3073
|
}
|
|
3074
|
+
if (onCallTool) return onCallTool(params);
|
|
2995
3075
|
return { content: [{
|
|
2996
3076
|
type: "text",
|
|
2997
3077
|
text: `[Simulator] Tool "${params.name}" called — no serverTools mock found in simulation "${state.selectedSimulationName}".`
|
|
2998
3078
|
}] };
|
|
2999
3079
|
}, [
|
|
3000
3080
|
onCallTool,
|
|
3081
|
+
prodTools,
|
|
3001
3082
|
state.selectedSim,
|
|
3002
3083
|
state.selectedSimulationName
|
|
3003
3084
|
]);
|
|
@@ -3125,14 +3206,33 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3125
3206
|
controls: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3126
3207
|
className: "space-y-1",
|
|
3127
3208
|
children: [
|
|
3128
|
-
|
|
3209
|
+
isInspectMode && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
|
|
3210
|
+
label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3211
|
+
className: "flex items-center gap-1.5",
|
|
3212
|
+
children: ["MCP Server", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3213
|
+
className: "inline-block w-2 h-2 rounded-full",
|
|
3214
|
+
"data-testid": "inspect-connection-status",
|
|
3215
|
+
style: { backgroundColor: connection.status === "connected" ? "#22c55e" : connection.status === "connecting" ? "#eab308" : connection.status === "error" ? "#ef4444" : "#6b7280" },
|
|
3216
|
+
title: connection.error ?? connection.status
|
|
3217
|
+
})]
|
|
3218
|
+
}),
|
|
3219
|
+
tooltip: "MCP server URL (set via --server flag)",
|
|
3220
|
+
"data-testid": "inspect-server-url",
|
|
3221
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarInput, {
|
|
3222
|
+
value: mcpServerUrl ?? "",
|
|
3223
|
+
onChange: () => {},
|
|
3224
|
+
disabled: true,
|
|
3225
|
+
placeholder: "http://localhost:8000/mcp"
|
|
3226
|
+
})
|
|
3227
|
+
}),
|
|
3228
|
+
!isInspectMode && !hideSimulatorModes && onCallTool && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarCheckbox, {
|
|
3129
3229
|
checked: prodTools,
|
|
3130
3230
|
onChange: setProdTools,
|
|
3131
3231
|
label: "Prod Tools",
|
|
3132
3232
|
tooltip: "Use real tool handlers instead of simulations",
|
|
3133
3233
|
docsPath: "api-reference/cli/dev#prod-tools-and-prod-resources-flags"
|
|
3134
3234
|
}),
|
|
3135
|
-
!hideSimulatorModes && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarCheckbox, {
|
|
3235
|
+
!isInspectMode && !hideSimulatorModes && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarCheckbox, {
|
|
3136
3236
|
checked: prodResources,
|
|
3137
3237
|
onChange: setProdResources,
|
|
3138
3238
|
label: "Prod Resources",
|
|
@@ -3502,13 +3602,15 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3502
3602
|
maxRows: 8
|
|
3503
3603
|
})
|
|
3504
3604
|
}, `tool-input-${prodTools}`),
|
|
3505
|
-
|
|
3605
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarCollapsibleControl, {
|
|
3506
3606
|
label: "Tool Result (JSON)",
|
|
3507
|
-
defaultCollapsed:
|
|
3607
|
+
defaultCollapsed: prodTools,
|
|
3508
3608
|
tooltip: "Structured content returned by the tool",
|
|
3509
3609
|
docsPath: "api-reference/hooks/use-tool-data",
|
|
3610
|
+
"data-testid": "tool-result-section",
|
|
3510
3611
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarTextarea, {
|
|
3511
3612
|
value: state.toolResultJson,
|
|
3613
|
+
"data-testid": "tool-result-textarea",
|
|
3512
3614
|
onChange: (json) => state.validateJSON(json, state.setToolResultJson, state.setToolResultError),
|
|
3513
3615
|
onFocus: () => state.setEditingField("toolResult"),
|
|
3514
3616
|
onBlur: () => state.commitJSON(state.toolResultJson, state.setToolResultError, (parsed) => {
|
|
@@ -3525,7 +3627,7 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3525
3627
|
error: state.toolResultError,
|
|
3526
3628
|
maxRows: 8
|
|
3527
3629
|
})
|
|
3528
|
-
})
|
|
3630
|
+
}, `tool-result-${prodTools}`)
|
|
3529
3631
|
]
|
|
3530
3632
|
}),
|
|
3531
3633
|
children: ShellConversation ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShellConversation, {
|
|
@@ -3684,6 +3786,12 @@ Object.defineProperty(exports, "resolveServerToolResult", {
|
|
|
3684
3786
|
return resolveServerToolResult;
|
|
3685
3787
|
}
|
|
3686
3788
|
});
|
|
3789
|
+
Object.defineProperty(exports, "useMcpConnection", {
|
|
3790
|
+
enumerable: true,
|
|
3791
|
+
get: function() {
|
|
3792
|
+
return useMcpConnection;
|
|
3793
|
+
}
|
|
3794
|
+
});
|
|
3687
3795
|
Object.defineProperty(exports, "useSimulatorState", {
|
|
3688
3796
|
enumerable: true,
|
|
3689
3797
|
get: function() {
|
|
@@ -3697,4 +3805,4 @@ Object.defineProperty(exports, "useThemeContext", {
|
|
|
3697
3805
|
}
|
|
3698
3806
|
});
|
|
3699
3807
|
|
|
3700
|
-
//# sourceMappingURL=simulator-
|
|
3808
|
+
//# sourceMappingURL=simulator-CH9hs0N6.cjs.map
|