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
|
@@ -2491,6 +2491,69 @@ function useSimulatorState({ simulations, defaultHost = "chatgpt" }) {
|
|
|
2491
2491
|
};
|
|
2492
2492
|
}
|
|
2493
2493
|
//#endregion
|
|
2494
|
+
//#region src/simulator/use-mcp-connection.ts
|
|
2495
|
+
/**
|
|
2496
|
+
* Hook for managing MCP server connection status via the dev server proxy.
|
|
2497
|
+
*
|
|
2498
|
+
* On mount (when `serverUrl` is provided), verifies the connection is alive
|
|
2499
|
+
* by fetching `/__sunpeak/list-tools`. Tracks connection status for display
|
|
2500
|
+
* in the sidebar (colored dot indicator).
|
|
2501
|
+
*
|
|
2502
|
+
* Tool calling is handled separately via the `onCallTool` prop — this
|
|
2503
|
+
* hook only manages the connection lifecycle and status display.
|
|
2504
|
+
*/
|
|
2505
|
+
function useMcpConnection(serverUrl) {
|
|
2506
|
+
const [status, setStatus] = useState(serverUrl ? "connecting" : "disconnected");
|
|
2507
|
+
const [error, setError] = useState();
|
|
2508
|
+
const reconnect = useCallback(async (url) => {
|
|
2509
|
+
setStatus("connecting");
|
|
2510
|
+
setError(void 0);
|
|
2511
|
+
try {
|
|
2512
|
+
const res = await fetch("/__sunpeak/connect", {
|
|
2513
|
+
method: "POST",
|
|
2514
|
+
headers: { "Content-Type": "application/json" },
|
|
2515
|
+
body: JSON.stringify({ url })
|
|
2516
|
+
});
|
|
2517
|
+
if (!res.ok) {
|
|
2518
|
+
const text = await res.text();
|
|
2519
|
+
throw new Error(text || `Connection failed (${res.status})`);
|
|
2520
|
+
}
|
|
2521
|
+
setStatus("connected");
|
|
2522
|
+
} catch (err) {
|
|
2523
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
2524
|
+
setStatus("error");
|
|
2525
|
+
}
|
|
2526
|
+
}, []);
|
|
2527
|
+
useEffect(() => {
|
|
2528
|
+
if (!serverUrl) {
|
|
2529
|
+
setStatus("disconnected");
|
|
2530
|
+
return;
|
|
2531
|
+
}
|
|
2532
|
+
let cancelled = false;
|
|
2533
|
+
(async () => {
|
|
2534
|
+
setStatus("connecting");
|
|
2535
|
+
try {
|
|
2536
|
+
const res = await fetch("/__sunpeak/list-tools");
|
|
2537
|
+
if (cancelled) return;
|
|
2538
|
+
if (!res.ok) throw new Error(`Health check failed (${res.status})`);
|
|
2539
|
+
setStatus("connected");
|
|
2540
|
+
} catch (err) {
|
|
2541
|
+
if (cancelled) return;
|
|
2542
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
2543
|
+
setStatus("error");
|
|
2544
|
+
}
|
|
2545
|
+
})();
|
|
2546
|
+
return () => {
|
|
2547
|
+
cancelled = true;
|
|
2548
|
+
};
|
|
2549
|
+
}, [serverUrl]);
|
|
2550
|
+
return {
|
|
2551
|
+
status,
|
|
2552
|
+
error,
|
|
2553
|
+
reconnect
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
//#endregion
|
|
2494
2557
|
//#region src/simulator/theme-provider.tsx
|
|
2495
2558
|
var ThemeProviderContext = React.createContext(void 0);
|
|
2496
2559
|
/** Default theme applier: sets data-theme attribute on document.documentElement */
|
|
@@ -2696,9 +2759,10 @@ function HelpIcon({ tooltip, docsPath }) {
|
|
|
2696
2759
|
})]
|
|
2697
2760
|
});
|
|
2698
2761
|
}
|
|
2699
|
-
function SidebarControl({ label, children, tooltip, docsPath }) {
|
|
2762
|
+
function SidebarControl({ label, children, tooltip, docsPath, "data-testid": testId }) {
|
|
2700
2763
|
return /* @__PURE__ */ jsxs("div", {
|
|
2701
2764
|
className: "space-y-1",
|
|
2765
|
+
"data-testid": testId,
|
|
2702
2766
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2703
2767
|
className: "text-[10px] font-medium leading-tight inline-flex items-center gap-1",
|
|
2704
2768
|
style: { color: "var(--color-text-secondary)" },
|
|
@@ -2709,10 +2773,11 @@ function SidebarControl({ label, children, tooltip, docsPath }) {
|
|
|
2709
2773
|
}), children]
|
|
2710
2774
|
});
|
|
2711
2775
|
}
|
|
2712
|
-
function SidebarCollapsibleControl({ label, children, defaultCollapsed = true, tooltip, docsPath }) {
|
|
2776
|
+
function SidebarCollapsibleControl({ label, children, defaultCollapsed = true, tooltip, docsPath, "data-testid": testId }) {
|
|
2713
2777
|
const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed);
|
|
2714
2778
|
return /* @__PURE__ */ jsxs("div", {
|
|
2715
2779
|
className: "space-y-1",
|
|
2780
|
+
"data-testid": testId,
|
|
2716
2781
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
2717
2782
|
onClick: () => setIsCollapsed(!isCollapsed),
|
|
2718
2783
|
className: "w-full flex items-center justify-between text-[10px] font-medium leading-tight transition-colors py-1 cursor-pointer",
|
|
@@ -2815,7 +2880,7 @@ function SidebarCheckbox({ checked, onChange, label, tooltip, docsPath }) {
|
|
|
2815
2880
|
})]
|
|
2816
2881
|
});
|
|
2817
2882
|
}
|
|
2818
|
-
function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRows = 8, error }) {
|
|
2883
|
+
function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRows = 8, error, "data-testid": testId }) {
|
|
2819
2884
|
const contentRows = value?.split("\n").length ?? 1;
|
|
2820
2885
|
return /* @__PURE__ */ jsxs("div", {
|
|
2821
2886
|
className: "space-y-0.5",
|
|
@@ -2826,6 +2891,7 @@ function SidebarTextarea({ value, onChange, onFocus, onBlur, placeholder, maxRow
|
|
|
2826
2891
|
onBlur,
|
|
2827
2892
|
placeholder,
|
|
2828
2893
|
rows: Math.min(contentRows, maxRows),
|
|
2894
|
+
"data-testid": testId,
|
|
2829
2895
|
className: "w-full text-[10px] font-mono rounded-md px-2 py-1.5 outline-none resize-y",
|
|
2830
2896
|
style: {
|
|
2831
2897
|
...formElementStyle,
|
|
@@ -2882,20 +2948,26 @@ function resolveServerToolResult(mock, args) {
|
|
|
2882
2948
|
}
|
|
2883
2949
|
//#endregion
|
|
2884
2950
|
//#region src/simulator/simulator.tsx
|
|
2885
|
-
function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, defaultHost = "chatgpt", onCallTool, defaultProdTools = false, defaultProdResources = false, hideSimulatorModes = false, sandboxUrl }) {
|
|
2951
|
+
function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, defaultHost = "chatgpt", onCallTool, onCallToolDirect, defaultProdTools = false, defaultProdResources = false, hideSimulatorModes = false, sandboxUrl, mcpServerUrl }) {
|
|
2952
|
+
const isInspectMode = mcpServerUrl != null;
|
|
2886
2953
|
const state = useSimulatorState({
|
|
2887
2954
|
simulations,
|
|
2888
2955
|
defaultHost
|
|
2889
2956
|
});
|
|
2890
|
-
const
|
|
2957
|
+
const connection = useMcpConnection(mcpServerUrl);
|
|
2958
|
+
const [prodTools, setProdTools] = React.useState(isInspectMode ? true : state.urlProdTools ?? defaultProdTools);
|
|
2891
2959
|
const [prodResources, setProdResources] = React.useState(state.urlProdResources ?? defaultProdResources);
|
|
2892
2960
|
const [isRunning, setIsRunning] = React.useState(false);
|
|
2893
2961
|
const [hasRun, setHasRun] = React.useState(false);
|
|
2894
2962
|
const [showCheck, setShowCheck] = React.useState(false);
|
|
2895
2963
|
const checkTimerRef = React.useRef(void 0);
|
|
2896
2964
|
React.useEffect(() => {
|
|
2897
|
-
if (prodTools)
|
|
2898
|
-
|
|
2965
|
+
if (prodTools) {
|
|
2966
|
+
setHasRun(false);
|
|
2967
|
+
state.setToolResult(void 0);
|
|
2968
|
+
state.setToolResultJson("");
|
|
2969
|
+
state.setToolResultError("");
|
|
2970
|
+
} else {
|
|
2899
2971
|
const simResult = state.selectedSim?.toolResult ?? void 0;
|
|
2900
2972
|
state.setToolResult(simResult);
|
|
2901
2973
|
}
|
|
@@ -2918,11 +2990,12 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
2918
2990
|
simulations
|
|
2919
2991
|
]);
|
|
2920
2992
|
const handleRun = React.useCallback(async () => {
|
|
2921
|
-
|
|
2993
|
+
const caller = onCallToolDirect ?? onCallTool;
|
|
2994
|
+
if (!caller || !state.selectedSim) return;
|
|
2922
2995
|
const toolName = state.selectedSim.tool.name;
|
|
2923
2996
|
setIsRunning(true);
|
|
2924
2997
|
try {
|
|
2925
|
-
const result = await
|
|
2998
|
+
const result = (isInspectMode ? state.selectedSim.toolResult : void 0) ?? await caller({
|
|
2926
2999
|
name: toolName,
|
|
2927
3000
|
arguments: state.toolInput
|
|
2928
3001
|
});
|
|
@@ -2952,7 +3025,12 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
2952
3025
|
} finally {
|
|
2953
3026
|
setIsRunning(false);
|
|
2954
3027
|
}
|
|
2955
|
-
}, [
|
|
3028
|
+
}, [
|
|
3029
|
+
onCallTool,
|
|
3030
|
+
onCallToolDirect,
|
|
3031
|
+
state,
|
|
3032
|
+
isInspectMode
|
|
3033
|
+
]);
|
|
2956
3034
|
const activeShell = getHostShell(state.activeHost);
|
|
2957
3035
|
const registeredHosts = getRegisteredHosts();
|
|
2958
3036
|
const ShellConversation = activeShell?.Conversation;
|
|
@@ -2985,18 +3063,21 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
2985
3063
|
} else prevPageStyleKeysRef.current = [];
|
|
2986
3064
|
}, [activeShell]);
|
|
2987
3065
|
const handleCallTool = React.useCallback((params) => {
|
|
2988
|
-
if (
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
3066
|
+
if (!prodTools) {
|
|
3067
|
+
const mock = state.selectedSim?.serverTools?.[params.name];
|
|
3068
|
+
if (mock) {
|
|
3069
|
+
const result = resolveServerToolResult(mock, params.arguments);
|
|
3070
|
+
if (result) return result;
|
|
3071
|
+
}
|
|
2993
3072
|
}
|
|
3073
|
+
if (onCallTool) return onCallTool(params);
|
|
2994
3074
|
return { content: [{
|
|
2995
3075
|
type: "text",
|
|
2996
3076
|
text: `[Simulator] Tool "${params.name}" called — no serverTools mock found in simulation "${state.selectedSimulationName}".`
|
|
2997
3077
|
}] };
|
|
2998
3078
|
}, [
|
|
2999
3079
|
onCallTool,
|
|
3080
|
+
prodTools,
|
|
3000
3081
|
state.selectedSim,
|
|
3001
3082
|
state.selectedSimulationName
|
|
3002
3083
|
]);
|
|
@@ -3124,14 +3205,33 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3124
3205
|
controls: /* @__PURE__ */ jsxs("div", {
|
|
3125
3206
|
className: "space-y-1",
|
|
3126
3207
|
children: [
|
|
3127
|
-
|
|
3208
|
+
isInspectMode && /* @__PURE__ */ jsx(SidebarControl, {
|
|
3209
|
+
label: /* @__PURE__ */ jsxs("span", {
|
|
3210
|
+
className: "flex items-center gap-1.5",
|
|
3211
|
+
children: ["MCP Server", /* @__PURE__ */ jsx("span", {
|
|
3212
|
+
className: "inline-block w-2 h-2 rounded-full",
|
|
3213
|
+
"data-testid": "inspect-connection-status",
|
|
3214
|
+
style: { backgroundColor: connection.status === "connected" ? "#22c55e" : connection.status === "connecting" ? "#eab308" : connection.status === "error" ? "#ef4444" : "#6b7280" },
|
|
3215
|
+
title: connection.error ?? connection.status
|
|
3216
|
+
})]
|
|
3217
|
+
}),
|
|
3218
|
+
tooltip: "MCP server URL (set via --server flag)",
|
|
3219
|
+
"data-testid": "inspect-server-url",
|
|
3220
|
+
children: /* @__PURE__ */ jsx(SidebarInput, {
|
|
3221
|
+
value: mcpServerUrl ?? "",
|
|
3222
|
+
onChange: () => {},
|
|
3223
|
+
disabled: true,
|
|
3224
|
+
placeholder: "http://localhost:8000/mcp"
|
|
3225
|
+
})
|
|
3226
|
+
}),
|
|
3227
|
+
!isInspectMode && !hideSimulatorModes && onCallTool && /* @__PURE__ */ jsx(SidebarCheckbox, {
|
|
3128
3228
|
checked: prodTools,
|
|
3129
3229
|
onChange: setProdTools,
|
|
3130
3230
|
label: "Prod Tools",
|
|
3131
3231
|
tooltip: "Use real tool handlers instead of simulations",
|
|
3132
3232
|
docsPath: "api-reference/cli/dev#prod-tools-and-prod-resources-flags"
|
|
3133
3233
|
}),
|
|
3134
|
-
!hideSimulatorModes && /* @__PURE__ */ jsx(SidebarCheckbox, {
|
|
3234
|
+
!isInspectMode && !hideSimulatorModes && /* @__PURE__ */ jsx(SidebarCheckbox, {
|
|
3135
3235
|
checked: prodResources,
|
|
3136
3236
|
onChange: setProdResources,
|
|
3137
3237
|
label: "Prod Resources",
|
|
@@ -3501,13 +3601,15 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3501
3601
|
maxRows: 8
|
|
3502
3602
|
})
|
|
3503
3603
|
}, `tool-input-${prodTools}`),
|
|
3504
|
-
|
|
3604
|
+
/* @__PURE__ */ jsx(SidebarCollapsibleControl, {
|
|
3505
3605
|
label: "Tool Result (JSON)",
|
|
3506
|
-
defaultCollapsed:
|
|
3606
|
+
defaultCollapsed: prodTools,
|
|
3507
3607
|
tooltip: "Structured content returned by the tool",
|
|
3508
3608
|
docsPath: "api-reference/hooks/use-tool-data",
|
|
3609
|
+
"data-testid": "tool-result-section",
|
|
3509
3610
|
children: /* @__PURE__ */ jsx(SidebarTextarea, {
|
|
3510
3611
|
value: state.toolResultJson,
|
|
3612
|
+
"data-testid": "tool-result-textarea",
|
|
3511
3613
|
onChange: (json) => state.validateJSON(json, state.setToolResultJson, state.setToolResultError),
|
|
3512
3614
|
onFocus: () => state.setEditingField("toolResult"),
|
|
3513
3615
|
onBlur: () => state.commitJSON(state.toolResultJson, state.setToolResultError, (parsed) => {
|
|
@@ -3524,7 +3626,7 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3524
3626
|
error: state.toolResultError,
|
|
3525
3627
|
maxRows: 8
|
|
3526
3628
|
})
|
|
3527
|
-
})
|
|
3629
|
+
}, `tool-result-${prodTools}`)
|
|
3528
3630
|
]
|
|
3529
3631
|
}),
|
|
3530
3632
|
children: ShellConversation ? /* @__PURE__ */ jsx(ShellConversation, {
|
|
@@ -3569,6 +3671,6 @@ function Simulator({ children, simulations = {}, appName = "Sunpeak", appIcon, d
|
|
|
3569
3671
|
});
|
|
3570
3672
|
}
|
|
3571
3673
|
//#endregion
|
|
3572
|
-
export {
|
|
3674
|
+
export { DEFAULT_STYLE_VARIABLES as S, McpAppHost as _, SidebarControl as a, getRegisteredHosts as b, SidebarTextarea as c, ThemeProvider as d, useThemeContext as f, extractResourceCSP as g, IframeResource as h, SidebarCollapsibleControl as i, SidebarToggle as l, useSimulatorState as m, resolveServerToolResult as n, SidebarInput as o, useMcpConnection as p, SidebarCheckbox as r, SidebarSelect as s, Simulator as t, SimpleSidebar as u, SCREEN_WIDTHS as v, registerHostShell as x, getHostShell as y };
|
|
3573
3675
|
|
|
3574
|
-
//# sourceMappingURL=simulator-
|
|
3676
|
+
//# sourceMappingURL=simulator-Dl8B-Ljb.js.map
|