sunpeak 0.16.27 → 0.16.28
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/build.mjs +0 -1
- package/dist/chatgpt/globals.css +10 -9
- package/dist/chatgpt/index.cjs +55 -24
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.js +31 -25
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/chunk-9hOWP6kD.cjs +64 -0
- package/dist/chunk-D6g4UhsZ.js +35 -0
- package/dist/claude/index.cjs +4 -4
- package/dist/claude/index.js +3 -5
- package/dist/discovery-BxKCIgG5.cjs +332 -0
- package/dist/discovery-BxKCIgG5.cjs.map +1 -0
- package/dist/discovery-Du4LHrih.js +261 -0
- package/dist/discovery-Du4LHrih.js.map +1 -0
- package/dist/host/chatgpt/index.cjs +171 -65
- package/dist/host/chatgpt/index.cjs.map +1 -1
- package/dist/host/chatgpt/index.js +170 -70
- package/dist/host/chatgpt/index.js.map +1 -1
- package/dist/host/index.cjs +47 -19
- package/dist/host/index.cjs.map +1 -1
- package/dist/host/index.js +47 -24
- package/dist/host/index.js.map +1 -1
- package/dist/index.cjs +3103 -3725
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3026 -3746
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +117 -131
- package/dist/lib/discovery-cli.cjs.map +1 -1
- package/dist/lib/discovery-cli.js +107 -111
- package/dist/lib/discovery-cli.js.map +1 -1
- package/dist/mcp/index.cjs +9818 -10283
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +9799 -10282
- package/dist/mcp/index.js.map +1 -1
- package/dist/protocol-DJmRaBzO.js +11080 -0
- package/dist/{protocol-DkDHRwOW.cjs.map → protocol-DJmRaBzO.js.map} +1 -1
- package/dist/protocol-jbxhzcnS.cjs +11493 -0
- package/dist/protocol-jbxhzcnS.cjs.map +1 -0
- package/dist/simulator/index.cjs +79 -36
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.js +43 -37
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator-BYIH-xqQ.cjs +3701 -0
- package/dist/{simulator-Gc6n_fT4.cjs.map → simulator-BYIH-xqQ.cjs.map} +1 -1
- package/dist/simulator-CmgNnWBO.js +3575 -0
- package/dist/simulator-CmgNnWBO.js.map +1 -0
- package/dist/simulator-url-BDGD4vZD.cjs +69 -0
- package/dist/simulator-url-BDGD4vZD.cjs.map +1 -0
- package/dist/simulator-url-Bkxj43yT.js +64 -0
- package/dist/simulator-url-Bkxj43yT.js.map +1 -0
- package/dist/style.css +10 -9
- package/dist/use-app-D2h-aiyr.cjs +940 -0
- package/dist/use-app-D2h-aiyr.cjs.map +1 -0
- package/dist/use-app-X7JbGskk.js +598 -0
- package/dist/use-app-X7JbGskk.js.map +1 -0
- package/package.json +8 -8
- package/template/node_modules/.bin/vite +2 -2
- package/template/node_modules/.bin/vitest +2 -2
- package/template/package.json +5 -5
- package/dist/claude/index.cjs.map +0 -1
- package/dist/claude/index.js.map +0 -1
- package/dist/discovery-BVqD-JsT.js +0 -224
- package/dist/discovery-BVqD-JsT.js.map +0 -1
- package/dist/discovery-D1gpaVz4.cjs +0 -223
- package/dist/discovery-D1gpaVz4.cjs.map +0 -1
- package/dist/index-BEWVLFfB.cjs +0 -28
- package/dist/index-BEWVLFfB.cjs.map +0 -1
- package/dist/index-C6XYFOmh.js +0 -29
- package/dist/index-C6XYFOmh.js.map +0 -1
- package/dist/index-D0FsXP3Y.cjs +0 -40
- package/dist/index-D0FsXP3Y.cjs.map +0 -1
- package/dist/index-Rg7SWjvl.js +0 -41
- package/dist/index-Rg7SWjvl.js.map +0 -1
- package/dist/protocol-DkDHRwOW.cjs +0 -12221
- package/dist/protocol-uge7qFev.js +0 -12223
- package/dist/protocol-uge7qFev.js.map +0 -1
- package/dist/simulator-B-CrMHVs.js +0 -3534
- package/dist/simulator-B-CrMHVs.js.map +0 -1
- package/dist/simulator-Gc6n_fT4.cjs +0 -3549
- package/dist/simulator-url-DcSYRl-P.cjs +0 -53
- package/dist/simulator-url-DcSYRl-P.cjs.map +0 -1
- package/dist/simulator-url-j_XV3EoP.js +0 -54
- package/dist/simulator-url-j_XV3EoP.js.map +0 -1
- package/dist/use-app-C9gpzIQO.js +0 -349
- package/dist/use-app-C9gpzIQO.js.map +0 -1
- package/dist/use-app-D09O2swh.cjs +0 -348
- package/dist/use-app-D09O2swh.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-X7JbGskk.js","names":["QQ","Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","YQ","$Q","M","XQ","ZQ","DQ","v","qQ","kQ","UQ","vQ","RQ","bQ","MQ","HQ"],"sources":["../../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.2.2_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_e9bf7657371391a829fe8b4e289b253c/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js","../src/hooks/app-context.tsx","../src/hooks/use-app.ts"],"sourcesContent":["import{Protocol as qQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as UQ,CallToolResultSchema as RQ,EmptyResultSchema as HQ,ListResourcesResultSchema as MQ,ListToolsRequestSchema as vQ,PingRequestSchema as kQ,ReadResourceResultSchema as bQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as QQ}from\"@modelcontextprotocol/sdk/types.js\";var L=\"2026-01-26\",d=\"ui/open-link\",h=\"ui/download-file\",m=\"ui/message\",i=\"ui/notifications/sandbox-proxy-ready\",c=\"ui/notifications/sandbox-resource-ready\",p=\"ui/notifications/size-changed\",r=\"ui/notifications/tool-input\",W=\"ui/notifications/tool-input-partial\",l=\"ui/notifications/tool-result\",n=\"ui/notifications/tool-cancelled\",a=\"ui/notifications/host-context-changed\",o=\"ui/resource-teardown\",s=\"ui/initialize\",e=\"ui/notifications/initialized\",t=\"ui/request-display-mode\";class K{eventTarget;eventSource;messageListener;constructor(X=window.parent,Y){this.eventTarget=X;this.eventSource=Y;this.messageListener=(Z)=>{if(Y&&Z.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",Z);return}let $=QQ.safeParse(Z.data);if($.success)console.debug(\"Parsed message\",$.data),this.onmessage?.($.data);else if(Z.data?.jsonrpc!==\"2.0\")console.debug(\"Ignoring non-JSON-RPC message\",$.error.message,Z);else console.error(\"Failed to parse message\",$.error.message,Z),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+$.error.message))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(X,Y){if(X.method!==W)console.debug(\"Sending message\",X);this.eventTarget.postMessage(X,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}import{z as Q}from\"zod/v4\";import{ContentBlockSchema as M,CallToolResultSchema as XQ,EmbeddedResourceSchema as YQ,ImplementationSchema as v,RequestIdSchema as ZQ,ResourceLinkSchema as $Q,ToolSchema as DQ}from\"@modelcontextprotocol/sdk/types.js\";var k=Q.union([Q.literal(\"light\"),Q.literal(\"dark\")]).describe(\"Color theme preference for the host environment.\"),J=Q.union([Q.literal(\"inline\"),Q.literal(\"fullscreen\"),Q.literal(\"pip\")]).describe(\"Display mode for UI presentation.\"),JQ=Q.union([Q.literal(\"--color-background-primary\"),Q.literal(\"--color-background-secondary\"),Q.literal(\"--color-background-tertiary\"),Q.literal(\"--color-background-inverse\"),Q.literal(\"--color-background-ghost\"),Q.literal(\"--color-background-info\"),Q.literal(\"--color-background-danger\"),Q.literal(\"--color-background-success\"),Q.literal(\"--color-background-warning\"),Q.literal(\"--color-background-disabled\"),Q.literal(\"--color-text-primary\"),Q.literal(\"--color-text-secondary\"),Q.literal(\"--color-text-tertiary\"),Q.literal(\"--color-text-inverse\"),Q.literal(\"--color-text-ghost\"),Q.literal(\"--color-text-info\"),Q.literal(\"--color-text-danger\"),Q.literal(\"--color-text-success\"),Q.literal(\"--color-text-warning\"),Q.literal(\"--color-text-disabled\"),Q.literal(\"--color-border-primary\"),Q.literal(\"--color-border-secondary\"),Q.literal(\"--color-border-tertiary\"),Q.literal(\"--color-border-inverse\"),Q.literal(\"--color-border-ghost\"),Q.literal(\"--color-border-info\"),Q.literal(\"--color-border-danger\"),Q.literal(\"--color-border-success\"),Q.literal(\"--color-border-warning\"),Q.literal(\"--color-border-disabled\"),Q.literal(\"--color-ring-primary\"),Q.literal(\"--color-ring-secondary\"),Q.literal(\"--color-ring-inverse\"),Q.literal(\"--color-ring-info\"),Q.literal(\"--color-ring-danger\"),Q.literal(\"--color-ring-success\"),Q.literal(\"--color-ring-warning\"),Q.literal(\"--font-sans\"),Q.literal(\"--font-mono\"),Q.literal(\"--font-weight-normal\"),Q.literal(\"--font-weight-medium\"),Q.literal(\"--font-weight-semibold\"),Q.literal(\"--font-weight-bold\"),Q.literal(\"--font-text-xs-size\"),Q.literal(\"--font-text-sm-size\"),Q.literal(\"--font-text-md-size\"),Q.literal(\"--font-text-lg-size\"),Q.literal(\"--font-heading-xs-size\"),Q.literal(\"--font-heading-sm-size\"),Q.literal(\"--font-heading-md-size\"),Q.literal(\"--font-heading-lg-size\"),Q.literal(\"--font-heading-xl-size\"),Q.literal(\"--font-heading-2xl-size\"),Q.literal(\"--font-heading-3xl-size\"),Q.literal(\"--font-text-xs-line-height\"),Q.literal(\"--font-text-sm-line-height\"),Q.literal(\"--font-text-md-line-height\"),Q.literal(\"--font-text-lg-line-height\"),Q.literal(\"--font-heading-xs-line-height\"),Q.literal(\"--font-heading-sm-line-height\"),Q.literal(\"--font-heading-md-line-height\"),Q.literal(\"--font-heading-lg-line-height\"),Q.literal(\"--font-heading-xl-line-height\"),Q.literal(\"--font-heading-2xl-line-height\"),Q.literal(\"--font-heading-3xl-line-height\"),Q.literal(\"--border-radius-xs\"),Q.literal(\"--border-radius-sm\"),Q.literal(\"--border-radius-md\"),Q.literal(\"--border-radius-lg\"),Q.literal(\"--border-radius-xl\"),Q.literal(\"--border-radius-full\"),Q.literal(\"--border-width-regular\"),Q.literal(\"--shadow-hairline\"),Q.literal(\"--shadow-sm\"),Q.literal(\"--shadow-md\"),Q.literal(\"--shadow-lg\")]).describe(\"CSS variable keys available to MCP apps for theming.\"),KQ=Q.record(JQ.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Q.union([Q.string(),Q.undefined()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),GQ=Q.object({method:Q.literal(\"ui/open-link\"),params:Q.object({url:Q.string().describe(\"URL to open in the host's browser\")})}),B=Q.object({isError:Q.boolean().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),_=Q.object({isError:Q.boolean().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),O=Q.object({isError:Q.boolean().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),VQ=Q.object({method:Q.literal(\"ui/notifications/sandbox-proxy-ready\"),params:Q.object({})}),G=Q.object({connectDomains:Q.array(Q.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:Q.array(Q.string()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:Q.array(Q.string()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:Q.array(Q.string()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),V=Q.object({camera:Q.object({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:Q.object({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:Q.object({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:Q.object({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")}),NQ=Q.object({method:Q.literal(\"ui/notifications/size-changed\"),params:Q.object({width:Q.number().optional().describe(\"New width in pixels.\"),height:Q.number().optional().describe(\"New height in pixels.\")})}),I=Q.object({method:Q.literal(\"ui/notifications/tool-input\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),w=Q.object({method:Q.literal(\"ui/notifications/tool-input-partial\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),A=Q.object({method:Q.literal(\"ui/notifications/tool-cancelled\"),params:Q.object({reason:Q.string().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),b=Q.object({fonts:Q.string().optional()}),C=Q.object({variables:KQ.optional().describe(\"CSS variables for theming the app.\"),css:b.optional().describe(\"CSS blocks that apps can inject.\")}),F=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),jQ=Q.record(Q.string(),Q.unknown()),z=Q.object({text:Q.object({}).optional().describe(\"Host supports text content blocks.\"),image:Q.object({}).optional().describe(\"Host supports image content blocks.\"),audio:Q.object({}).optional().describe(\"Host supports audio content blocks.\"),resource:Q.object({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:Q.object({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:Q.object({}).optional().describe(\"Host supports structured content.\")}),x=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),openLinks:Q.object({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:Q.object({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:Q.object({}).optional().describe(\"Host accepts log messages.\"),sandbox:Q.object({permissions:V.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:G.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:z.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:z.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\")}),S=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),tools:Q.object({listChanged:Q.boolean().optional().describe(\"App supports tools/list_changed notifications.\")}).optional().describe(\"App exposes MCP-style tools that the host can call.\"),availableDisplayModes:Q.array(J).optional().describe(\"Display modes the app supports.\")}),EQ=Q.object({method:Q.literal(\"ui/notifications/initialized\"),params:Q.object({}).optional()}),LQ=Q.object({csp:G.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:V.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:Q.string().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Q.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),WQ=Q.object({method:Q.literal(\"ui/request-display-mode\"),params:Q.object({mode:J.describe(\"The display mode being requested.\")})}),P=Q.object({mode:J.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),g=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),zQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(g).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`)}),mQ=Q.object({mimeTypes:Q.array(Q.string()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),BQ=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([YQ,$Q])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),_Q=Q.object({method:Q.literal(\"ui/message\"),params:Q.object({role:Q.literal(\"user\").describe('Message role, currently only \"user\" is supported.'),content:Q.array(M).describe(\"Message content blocks (text, image, etc.).\")})}),OQ=Q.object({method:Q.literal(\"ui/notifications/sandbox-resource-ready\"),params:Q.object({html:Q.string().describe(\"HTML content to load into the inner iframe.\"),sandbox:Q.string().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:G.optional().describe(\"CSP configuration from resource metadata.\"),permissions:V.optional().describe(\"Sandbox permissions from resource metadata.\")})}),T=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:XQ.describe(\"Standard MCP tool execution result.\")}),q=Q.object({toolInfo:Q.object({id:ZQ.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:DQ.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:k.optional().describe(\"Current color theme preference.\"),styles:C.optional().describe(\"Style configuration for theming the app.\"),displayMode:J.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:Q.array(J).optional().describe(\"Display modes the host supports.\"),containerDimensions:Q.union([Q.object({height:Q.number().describe(\"Fixed container height in pixels.\")}),Q.object({maxHeight:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container height in pixels.\")})]).and(Q.union([Q.object({width:Q.number().describe(\"Fixed container width in pixels.\")}),Q.object({maxWidth:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:Q.string().optional().describe(\"User's timezone in IANA format.\"),userAgent:Q.string().optional().describe(\"Host application identifier.\"),platform:Q.union([Q.literal(\"web\"),Q.literal(\"desktop\"),Q.literal(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe(\"Whether the device supports touch input.\"),hover:Q.boolean().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:Q.object({top:Q.number().describe(\"Top safe area inset in pixels.\"),right:Q.number().describe(\"Right safe area inset in pixels.\"),bottom:Q.number().describe(\"Bottom safe area inset in pixels.\"),left:Q.number().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),U=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:q.describe(\"Partial context update containing only changed fields.\")}),IQ=Q.object({method:Q.literal(\"ui/update-model-context\"),params:Q.object({content:Q.array(M).optional().describe(\"Context content blocks (text, image, etc.).\"),structuredContent:Q.record(Q.string(),Q.unknown().describe(\"Structured content for machine-readable context data.\")).optional().describe(\"Structured content for machine-readable context data.\")})}),wQ=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:v.describe(\"App identification (name and version).\"),appCapabilities:S.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),R=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:v.describe(\"Host application identification and version.\"),hostCapabilities:x.describe(\"Features and capabilities provided by the host.\"),hostContext:q.describe(\"Rich context about the host environment.\")}).passthrough();function AQ(){let X=document.documentElement.getAttribute(\"data-theme\");if(X===\"dark\"||X===\"light\")return X;return document.documentElement.classList.contains(\"dark\")?\"dark\":\"light\"}function FQ(X){let Y=document.documentElement;Y.setAttribute(\"data-theme\",X),Y.style.colorScheme=X}function PQ(X,Y=document.documentElement){for(let[Z,$]of Object.entries(X))if($!==void 0)Y.style.setProperty(Z,$)}function TQ(X){if(document.getElementById(\"__mcp-host-fonts\"))return;let Z=document.createElement(\"style\");Z.id=\"__mcp-host-fonts\",Z.textContent=X,document.head.appendChild(Z)}var UX=\"ui/resourceUri\",RX=\"text/html;profile=mcp-app\";class CQ extends qQ{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor(X,Y={},Z={autoResize:!0}){super(Z);this._appInfo=X;this._capabilities=Y;this.options=Z;this.setRequestHandler(kQ,($)=>{return console.log(\"Received ping:\",$.params),{}}),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(X){this.setNotificationHandler(I,(Y)=>X(Y.params))}set ontoolinputpartial(X){this.setNotificationHandler(w,(Y)=>X(Y.params))}set ontoolresult(X){this.setNotificationHandler(T,(Y)=>X(Y.params))}set ontoolcancelled(X){this.setNotificationHandler(A,(Y)=>X(Y.params))}set onhostcontextchanged(X){this.setNotificationHandler(U,(Y)=>{this._hostContext={...this._hostContext,...Y.params},X(Y.params)})}set onteardown(X){this.setRequestHandler(F,(Y,Z)=>X(Y.params,Z))}set oncalltool(X){this.setRequestHandler(UQ,(Y,Z)=>X(Y.params,Z))}set onlisttools(X){this.setRequestHandler(vQ,(Y,Z)=>X(Y.params,Z))}assertCapabilityForMethod(X){}assertRequestHandlerCapability(X){switch(X){case\"tools/call\":case\"tools/list\":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${X})`);return;case\"ping\":case\"ui/resource-teardown\":return;default:throw Error(`No handler for method ${X} registered`)}}assertNotificationCapability(X){}assertTaskCapability(X){throw Error(\"Tasks are not supported in MCP Apps\")}assertTaskHandlerCapability(X){throw Error(\"Task handlers are not supported in MCP Apps\")}async callServerTool(X,Y){if(typeof X===\"string\")throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${X}\"). Did you mean: callServerTool({ name: \"${X}\", arguments: { ... } })?`);return await this.request({method:\"tools/call\",params:X},RQ,Y)}async readServerResource(X,Y){return await this.request({method:\"resources/read\",params:X},bQ,Y)}async listServerResources(X,Y){return await this.request({method:\"resources/list\",params:X},MQ,Y)}sendMessage(X,Y){return this.request({method:\"ui/message\",params:X},O,Y)}sendLog(X){return this.notification({method:\"notifications/message\",params:X})}updateModelContext(X,Y){return this.request({method:\"ui/update-model-context\",params:X},HQ,Y)}openLink(X,Y){return this.request({method:\"ui/open-link\",params:X},B,Y)}sendOpenLink=this.openLink;downloadFile(X,Y){return this.request({method:\"ui/download-file\",params:X},_,Y)}requestDisplayMode(X,Y){return this.request({method:\"ui/request-display-mode\",params:X},P,Y)}sendSizeChanged(X){return this.notification({method:\"ui/notifications/size-changed\",params:X})}setupSizeChangedNotifications(){let X=!1,Y=0,Z=0,$=()=>{if(X)return;X=!0,requestAnimationFrame(()=>{X=!1;let D=document.documentElement,y=D.style.width,u=D.style.height;D.style.width=\"fit-content\",D.style.height=\"max-content\";let H=D.getBoundingClientRect();D.style.width=y,D.style.height=u;let f=window.innerWidth-D.clientWidth,j=Math.ceil(H.width+f),E=Math.ceil(H.height);if(j!==Y||E!==Z)Y=j,Z=E,this.sendSizeChanged({width:j,height:E})})};$();let N=new ResizeObserver($);return N.observe(document.documentElement),N.observe(document.body),()=>N.disconnect()}async connect(X=new K(window.parent,window.parent),Y){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");await super.connect(X);try{let Z=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:L}},R,Y);if(Z===void 0)throw Error(`Server sent invalid initialize result: ${Z}`);if(this._hostCapabilities=Z.hostCapabilities,this._hostInfo=Z.hostInfo,this._hostContext=Z.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this.options?.autoResize)this.setupSizeChangedNotifications()}catch(Z){throw this.close(),Z}}}export{AQ as getDocumentTheme,PQ as applyHostStyleVariables,TQ as applyHostFonts,FQ as applyDocumentTheme,l as TOOL_RESULT_METHOD,W as TOOL_INPUT_PARTIAL_METHOD,r as TOOL_INPUT_METHOD,n as TOOL_CANCELLED_METHOD,p as SIZE_CHANGED_METHOD,c as SANDBOX_RESOURCE_READY_METHOD,i as SANDBOX_PROXY_READY_METHOD,UX as RESOURCE_URI_META_KEY,o as RESOURCE_TEARDOWN_METHOD,RX as RESOURCE_MIME_TYPE,t as REQUEST_DISPLAY_MODE_METHOD,K as PostMessageTransport,d as OPEN_LINK_METHOD,IQ as McpUiUpdateModelContextRequestSchema,g as McpUiToolVisibilitySchema,T as McpUiToolResultNotificationSchema,zQ as McpUiToolMetaSchema,w as McpUiToolInputPartialNotificationSchema,I as McpUiToolInputNotificationSchema,A as McpUiToolCancelledNotificationSchema,k as McpUiThemeSchema,z as McpUiSupportedContentBlockModalitiesSchema,NQ as McpUiSizeChangedNotificationSchema,OQ as McpUiSandboxResourceReadyNotificationSchema,VQ as McpUiSandboxProxyReadyNotificationSchema,jQ as McpUiResourceTeardownResultSchema,F as McpUiResourceTeardownRequestSchema,V as McpUiResourcePermissionsSchema,LQ as McpUiResourceMetaSchema,G as McpUiResourceCspSchema,P as McpUiRequestDisplayModeResultSchema,WQ as McpUiRequestDisplayModeRequestSchema,B as McpUiOpenLinkResultSchema,GQ as McpUiOpenLinkRequestSchema,O as McpUiMessageResultSchema,_Q as McpUiMessageRequestSchema,EQ as McpUiInitializedNotificationSchema,R as McpUiInitializeResultSchema,wQ as McpUiInitializeRequestSchema,C as McpUiHostStylesSchema,b as McpUiHostCssSchema,q as McpUiHostContextSchema,U as McpUiHostContextChangedNotificationSchema,x as McpUiHostCapabilitiesSchema,_ as McpUiDownloadFileResultSchema,BQ as McpUiDownloadFileRequestSchema,J as McpUiDisplayModeSchema,S as McpUiAppCapabilitiesSchema,m as MESSAGE_METHOD,L as LATEST_PROTOCOL_VERSION,s as INITIALIZE_METHOD,e as INITIALIZED_METHOD,a as HOST_CONTEXT_CHANGED_METHOD,h as DOWNLOAD_FILE_METHOD,CQ as App};\n","/**\n * React Context for sharing the MCP App instance across the component tree.\n *\n * AppProvider handles connecting to the MCP Apps host and provides the App\n * instance via context. All sunpeak hooks read from this context internally,\n * so consumers never need to pass `app` as a parameter.\n *\n * The provider preserves the App instance across React Fast Refresh (HMR)\n * by storing it at module scope, matching the previous useApp() behavior.\n */\nimport { createContext, useState, useEffect, type ReactNode } from 'react';\nimport { App, PostMessageTransport } from '@modelcontextprotocol/ext-apps';\n\nexport interface AppProviderProps {\n appInfo: { name: string; version: string };\n capabilities?: Record<string, unknown>;\n onAppCreated?: (app: App) => void;\n children: ReactNode;\n}\n\nexport interface AppState {\n app: App | null;\n isConnected: boolean;\n error: Error | null;\n}\n\nconst defaultState: AppState = { app: null, isConnected: false, error: null };\n\nexport const AppContext = createContext<AppState>(defaultState);\n\n// Module-level App persistence.\n// During React Fast Refresh the component file is hot-swapped but this module\n// is NOT re-evaluated, so these variables survive across HMR cycles.\n// On a full page reload they reset to null, triggering a fresh connection.\nlet _app: App | null = null;\nlet _connecting: Promise<App> | null = null;\n\nexport function AppProvider({ appInfo, capabilities, onAppCreated, children }: AppProviderProps) {\n const [state, setState] = useState<AppState>(() =>\n _app ? { app: _app, isConnected: true, error: null } : defaultState\n );\n\n useEffect(() => {\n let cancelled = false;\n\n // Already connected (HMR re-run or StrictMode double-mount) — reuse.\n if (_app) {\n setState({ app: _app, isConnected: true, error: null });\n return () => {\n cancelled = true;\n };\n }\n\n // Connection already in flight (StrictMode double-mount) — wait for it.\n if (!_connecting) {\n _connecting = (async () => {\n const transport = new PostMessageTransport(window.parent, window.parent);\n const newApp = new App(appInfo, capabilities ?? {});\n onAppCreated?.(newApp);\n await newApp.connect(transport);\n _app = newApp;\n return newApp;\n })();\n }\n\n _connecting.then(\n (connectedApp) => {\n if (!cancelled) {\n setState({ app: connectedApp, isConnected: true, error: null });\n }\n },\n (err) => {\n _connecting = null;\n if (!cancelled) {\n setState({\n app: null,\n isConnected: false,\n error: err instanceof Error ? err : new Error('Failed to connect'),\n });\n }\n }\n );\n\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- connect once, persist across HMR\n }, []);\n\n return <AppContext.Provider value={state}>{children}</AppContext.Provider>;\n}\n","import { useContext } from 'react';\nimport { AppContext } from './app-context';\nimport type { App } from '@modelcontextprotocol/ext-apps';\n\n/**\n * Access the MCP App instance from context.\n *\n * Returns the connected App instance, or `null` while the connection\n * is being established. Must be used inside an `<AppProvider>`.\n *\n * Most hooks read from context internally, so you only need `useApp()`\n * for direct SDK method calls like `app.requestDisplayMode()`.\n *\n * @example\n * ```tsx\n * import { useApp } from 'sunpeak';\n *\n * function MyComponent() {\n * const app = useApp();\n * const handleFullscreen = () => app?.requestDisplayMode({ mode: 'fullscreen' });\n * return <button onClick={handleFullscreen}>Fullscreen</button>;\n * }\n * ```\n */\nexport function useApp(): App | null {\n return useContext(AppContext).app;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAAuY,IAAI,IAAE,cAAa,IAAE,gBAAe,IAAE,oBAAmB,IAAE,cAAkG,IAAE,iCAAgC,IAAE,+BAA8B,IAAE,uCAAsC,IAAE,gCAA+B,IAAE,mCAAkC,IAAE,yCAAwC,IAAE,wBAAuB,IAAE,iBAAgB,IAAE,gCAA+B,IAAE;AAA0B,IAAM,IAAN,MAAO;CAAC;CAAY;CAAY;CAAgB,YAAY,IAAE,OAAO,QAAO,GAAE;AAAC,OAAK,cAAY;AAAE,OAAK,cAAY;AAAE,OAAK,mBAAiB,MAAI;AAAC,OAAG,KAAG,EAAE,WAAS,KAAK,aAAY;AAAC,YAAQ,MAAM,wCAAuC,EAAE;AAAC;;GAAO,IAAI,IAAEA,qBAAG,UAAU,EAAE,KAAK;AAAC,OAAG,EAAE,QAAQ,SAAQ,MAAM,kBAAiB,EAAE,KAAK,EAAC,KAAK,YAAY,EAAE,KAAK;YAAS,EAAE,MAAM,YAAU,MAAM,SAAQ,MAAM,iCAAgC,EAAE,MAAM,SAAQ,EAAE;OAAM,SAAQ,MAAM,2BAA0B,EAAE,MAAM,SAAQ,EAAE,EAAC,KAAK,UAAU,MAAM,wCAAsC,EAAE,MAAM,QAAQ,CAAC;;;CAAE,MAAM,QAAO;AAAC,SAAO,iBAAiB,WAAU,KAAK,gBAAgB;;CAAC,MAAM,KAAK,GAAE,GAAE;AAAC,MAAG,EAAE,WAAA,sCAAW,SAAQ,MAAM,mBAAkB,EAAE;AAAC,OAAK,YAAY,YAAY,GAAE,IAAI;;CAAC,MAAM,QAAO;AAAC,SAAO,oB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aAAa;IAAM,OAAO;IAAM,CAAC;MAGlE,QAAQ;AACP,iBAAc;AACd,OAAI,CAAC,UACH,UAAS;IACP,KAAK;IACL,aAAa;IACb,OAAO,eAAe,QAAQ,sBAAM,IAAI,MAAM,oBAAoB;IACnE,CAAC;IAGP;AAED,eAAa;AACX,eAAY;;IAGb,EAAE,CAAC;AAEN,QAAO,oBAAC,WAAW,UAAZ;EAAqB,OAAO;EAAQ;EAA+B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;ACjE5E,SAAgB,SAAqB;AACnC,QAAO,WAAW,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunpeak",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.28",
|
|
4
4
|
"description": "Local-first MCP Apps framework. Quickstart, build, test, and ship your Claude Connector or ChatGPT App!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -138,29 +138,29 @@
|
|
|
138
138
|
"zod": "^4.3.6"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
|
-
"@tailwindcss/vite": "^4.2.
|
|
141
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
142
142
|
"@testing-library/jest-dom": "^6.9.1",
|
|
143
143
|
"@testing-library/react": "^16.3.2",
|
|
144
144
|
"@testing-library/user-event": "^14.6.1",
|
|
145
145
|
"@types/node": "^25.5.0",
|
|
146
146
|
"@types/react": "^19.2.14",
|
|
147
147
|
"@types/react-dom": "^19.2.3",
|
|
148
|
-
"@typescript-eslint/eslint-plugin": "^8.57.
|
|
149
|
-
"@typescript-eslint/parser": "^8.57.
|
|
150
|
-
"@vitejs/plugin-react": "^
|
|
148
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
149
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
150
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
151
151
|
"eslint": "^9.39.4",
|
|
152
152
|
"eslint-config-prettier": "^10.1.8",
|
|
153
153
|
"eslint-plugin-react": "^7.37.5",
|
|
154
154
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
155
|
-
"jsdom": "^29.0.
|
|
155
|
+
"jsdom": "^29.0.1",
|
|
156
156
|
"prettier": "^3.8.1",
|
|
157
157
|
"react": "^19.2.4",
|
|
158
158
|
"react-dom": "^19.2.4",
|
|
159
|
-
"tailwindcss": "^4.2.
|
|
159
|
+
"tailwindcss": "^4.2.2",
|
|
160
160
|
"ts-node": "^10.9.2",
|
|
161
161
|
"tsx": "^4.21.0",
|
|
162
162
|
"typescript": "^5.9.3",
|
|
163
|
-
"vite": "^
|
|
163
|
+
"vite": "^8.0.1",
|
|
164
164
|
"vite-plugin-dts": "^4.5.4",
|
|
165
165
|
"vitest": "^4.1.0"
|
|
166
166
|
},
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@
|
|
13
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0/node_modules/vite/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@
|
|
15
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0/node_modules/vite/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.1_vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_/node_modules/vitest/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.1_vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.1_vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_/node_modules/vitest/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.1_vite@8.0.1_@types+node@25.5.0_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
package/template/package.json
CHANGED
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@playwright/test": "^1.58.2",
|
|
25
|
-
"@tailwindcss/vite": "^4.2.
|
|
25
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
26
26
|
"@testing-library/jest-dom": "^6.9.1",
|
|
27
27
|
"@testing-library/react": "^16.3.2",
|
|
28
28
|
"@testing-library/user-event": "^14.6.1",
|
|
29
29
|
"@types/node": "^25.5.0",
|
|
30
30
|
"@types/react": "^19.2.14",
|
|
31
31
|
"@types/react-dom": "^19.2.3",
|
|
32
|
-
"@vitejs/plugin-react": "^
|
|
33
|
-
"jsdom": "^29.0.
|
|
32
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
33
|
+
"jsdom": "^29.0.1",
|
|
34
34
|
"react": "^19.2.4",
|
|
35
35
|
"react-dom": "^19.2.4",
|
|
36
|
-
"tailwindcss": "^4.2.
|
|
36
|
+
"tailwindcss": "^4.2.2",
|
|
37
37
|
"typescript": "^5.9.3",
|
|
38
|
-
"vite": "^
|
|
38
|
+
"vite": "^8.0.1",
|
|
39
39
|
"vitest": "^4.1.0"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/claude/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
function toPascalCase(str) {
|
|
2
|
-
return str.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
3
|
-
}
|
|
4
|
-
function extractResourceKey(path) {
|
|
5
|
-
const match = path.match(/([^/]+)\.tsx$/);
|
|
6
|
-
return match ? match[1] : void 0;
|
|
7
|
-
}
|
|
8
|
-
function extractSimulationKey(path) {
|
|
9
|
-
const match = path.match(/([^/]+)\.json$/);
|
|
10
|
-
return match ? match[1] : void 0;
|
|
11
|
-
}
|
|
12
|
-
function findResourceKey(simulationKey, resourceKeys) {
|
|
13
|
-
const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);
|
|
14
|
-
for (const resourceKey of sorted) {
|
|
15
|
-
if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + "-")) {
|
|
16
|
-
return resourceKey;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return void 0;
|
|
20
|
-
}
|
|
21
|
-
function getComponentName(resourceKey) {
|
|
22
|
-
return `${toPascalCase(resourceKey)}Resource`;
|
|
23
|
-
}
|
|
24
|
-
function createResourceExports(modules) {
|
|
25
|
-
const resources = {};
|
|
26
|
-
for (const [path, module] of Object.entries(modules)) {
|
|
27
|
-
const key = extractResourceKey(path);
|
|
28
|
-
if (!key) continue;
|
|
29
|
-
const exportName = getComponentName(key);
|
|
30
|
-
const mod = module;
|
|
31
|
-
const component = mod.default ?? mod[exportName];
|
|
32
|
-
if (component && (typeof component === "function" || typeof component === "object")) {
|
|
33
|
-
resources[exportName] = component;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return resources;
|
|
37
|
-
}
|
|
38
|
-
function buildResourceMap(modules) {
|
|
39
|
-
const map = /* @__PURE__ */ new Map();
|
|
40
|
-
for (const [path, module] of Object.entries(modules)) {
|
|
41
|
-
const key = extractResourceKey(path);
|
|
42
|
-
if (key) {
|
|
43
|
-
map.set(key, module.resource);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return map;
|
|
47
|
-
}
|
|
48
|
-
function buildSimulations(options) {
|
|
49
|
-
const {
|
|
50
|
-
simulationModules,
|
|
51
|
-
resourcesMap,
|
|
52
|
-
resourceComponents,
|
|
53
|
-
createSimulation,
|
|
54
|
-
onMissingResource = (key, prefix) => console.warn(
|
|
55
|
-
`No matching resource found for simulation "${key}". Expected a resource file like src/resources/${prefix}/${prefix}.tsx`
|
|
56
|
-
)
|
|
57
|
-
} = options;
|
|
58
|
-
const resourceKeys = Array.from(resourcesMap.keys());
|
|
59
|
-
const simulations = {};
|
|
60
|
-
for (const [path, module] of Object.entries(simulationModules)) {
|
|
61
|
-
const simulationKey = extractSimulationKey(path);
|
|
62
|
-
if (!simulationKey) continue;
|
|
63
|
-
const simulationData = module.default;
|
|
64
|
-
const resourceKey = findResourceKey(simulationKey, resourceKeys);
|
|
65
|
-
if (!resourceKey) {
|
|
66
|
-
onMissingResource(simulationKey, simulationKey.split("-")[0]);
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
const resource = resourcesMap.get(resourceKey);
|
|
70
|
-
const componentName = getComponentName(resourceKey);
|
|
71
|
-
const resourceComponent = resourceComponents[componentName];
|
|
72
|
-
if (!resourceComponent) {
|
|
73
|
-
console.warn(
|
|
74
|
-
`Resource component "${componentName}" not found for resource "${resourceKey}". Make sure src/resources/${resourceKey}/${resourceKey}.tsx exists with a default export.`
|
|
75
|
-
);
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
simulations[simulationKey] = createSimulation(
|
|
79
|
-
simulationKey,
|
|
80
|
-
simulationData,
|
|
81
|
-
resource,
|
|
82
|
-
resourceComponent
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
return simulations;
|
|
86
|
-
}
|
|
87
|
-
function buildDevSimulations(options) {
|
|
88
|
-
const { simulationModules, resourceComponents, toolModules, resourceModules } = options;
|
|
89
|
-
const resourceMetaByName = /* @__PURE__ */ new Map();
|
|
90
|
-
const resourceKeyByName = /* @__PURE__ */ new Map();
|
|
91
|
-
for (const [path, module] of Object.entries(resourceModules)) {
|
|
92
|
-
const key = extractResourceKey(path);
|
|
93
|
-
if (!key) continue;
|
|
94
|
-
const mod = module;
|
|
95
|
-
if (mod.resource) {
|
|
96
|
-
const name = mod.resource.name ?? key;
|
|
97
|
-
resourceMetaByName.set(name, { ...mod.resource, name });
|
|
98
|
-
resourceKeyByName.set(name, key);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const toolsMap = /* @__PURE__ */ new Map();
|
|
102
|
-
if (toolModules) {
|
|
103
|
-
for (const [path, module] of Object.entries(toolModules)) {
|
|
104
|
-
const nameMatch = path.match(/([^/]+)\.ts$/);
|
|
105
|
-
if (!nameMatch) continue;
|
|
106
|
-
const mod = module;
|
|
107
|
-
if (mod.tool) {
|
|
108
|
-
const resourceName = mod.tool.resource;
|
|
109
|
-
toolsMap.set(nameMatch[1], { tool: mod.tool, resourceName });
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const simulations = {};
|
|
114
|
-
for (const [path, module] of Object.entries(simulationModules)) {
|
|
115
|
-
const simKey = extractSimulationKey(path);
|
|
116
|
-
if (!simKey) continue;
|
|
117
|
-
const simulationData = module.default;
|
|
118
|
-
const toolName = typeof simulationData.tool === "string" ? simulationData.tool : simKey;
|
|
119
|
-
const toolInfo = toolsMap.get(toolName);
|
|
120
|
-
if (!toolInfo) {
|
|
121
|
-
console.warn(
|
|
122
|
-
`Tool "${toolName}" not found for simulation "${simKey}". Make sure src/tools/${toolName}.ts exists.`
|
|
123
|
-
);
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
const resourceMeta = toolInfo.resourceName ? resourceMetaByName.get(toolInfo.resourceName) : void 0;
|
|
127
|
-
const resourceKey = toolInfo.resourceName ? resourceKeyByName.get(toolInfo.resourceName) : void 0;
|
|
128
|
-
if (toolInfo.resourceName && (!resourceMeta || !resourceKey)) {
|
|
129
|
-
console.warn(
|
|
130
|
-
`Resource "${toolInfo.resourceName}" not found for tool "${toolName}". Make sure a resource with name "${toolInfo.resourceName}" exists in src/resources/.`
|
|
131
|
-
);
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
let resourceBlock = {};
|
|
135
|
-
if (resourceKey && resourceMeta) {
|
|
136
|
-
const componentName = getComponentName(resourceKey);
|
|
137
|
-
const resourceComponent = resourceComponents[componentName];
|
|
138
|
-
if (!resourceComponent) {
|
|
139
|
-
console.warn(`Resource component "${componentName}" not found for tool "${toolName}".`);
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
resourceBlock = {
|
|
143
|
-
resource: {
|
|
144
|
-
uri: `ui://${resourceKey}`,
|
|
145
|
-
name: resourceKey,
|
|
146
|
-
...resourceMeta.title != null ? { title: resourceMeta.title } : {},
|
|
147
|
-
...resourceMeta.description != null ? { description: resourceMeta.description } : {},
|
|
148
|
-
...resourceMeta.mimeType != null ? { mimeType: resourceMeta.mimeType } : {},
|
|
149
|
-
...resourceMeta._meta != null ? { _meta: resourceMeta._meta } : {}
|
|
150
|
-
},
|
|
151
|
-
resourceUrl: `/.sunpeak/resource-loader.html?component=${componentName}`
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
simulations[simKey] = {
|
|
155
|
-
name: simKey,
|
|
156
|
-
userMessage: simulationData.userMessage,
|
|
157
|
-
tool: {
|
|
158
|
-
name: toolName,
|
|
159
|
-
description: toolInfo.tool.description ?? "",
|
|
160
|
-
inputSchema: { type: "object" },
|
|
161
|
-
...toolInfo.tool.title != null ? { title: toolInfo.tool.title } : {},
|
|
162
|
-
...toolInfo.tool.annotations != null ? { annotations: toolInfo.tool.annotations } : {},
|
|
163
|
-
...toolInfo.tool._meta != null ? { _meta: toolInfo.tool._meta } : {}
|
|
164
|
-
},
|
|
165
|
-
...resourceBlock,
|
|
166
|
-
toolInput: simulationData.toolInput,
|
|
167
|
-
toolResult: simulationData.toolResult,
|
|
168
|
-
serverTools: simulationData.serverTools
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
return simulations;
|
|
172
|
-
}
|
|
173
|
-
function findResourceDirs(baseDir, filePattern, fs) {
|
|
174
|
-
if (!fs.existsSync(baseDir)) {
|
|
175
|
-
return [];
|
|
176
|
-
}
|
|
177
|
-
const entries = fs.readdirSync(baseDir, { withFileTypes: true });
|
|
178
|
-
return entries.filter((entry) => entry.isDirectory()).map((entry) => {
|
|
179
|
-
const key = entry.name;
|
|
180
|
-
const dir = `${baseDir}/${key}`;
|
|
181
|
-
const resourcePath = `${dir}/${filePattern(key)}`;
|
|
182
|
-
if (!fs.existsSync(resourcePath)) {
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
return { key, dir, resourcePath };
|
|
186
|
-
}).filter((info) => info !== null);
|
|
187
|
-
}
|
|
188
|
-
function findToolFiles(toolsDir, fs) {
|
|
189
|
-
if (!fs.existsSync(toolsDir)) {
|
|
190
|
-
return [];
|
|
191
|
-
}
|
|
192
|
-
const entries = fs.readdirSync(toolsDir, { withFileTypes: true });
|
|
193
|
-
return entries.filter(
|
|
194
|
-
(entry) => !entry.isDirectory() && entry.name.endsWith(".ts") && !entry.name.endsWith(".test.ts")
|
|
195
|
-
).map((entry) => ({
|
|
196
|
-
name: entry.name.replace(/\.ts$/, ""),
|
|
197
|
-
path: `${toolsDir}/${entry.name}`
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
|
-
function findSimulationFilesFlat(simulationsDir, fs) {
|
|
201
|
-
if (!fs.existsSync(simulationsDir)) {
|
|
202
|
-
return [];
|
|
203
|
-
}
|
|
204
|
-
const entries = fs.readdirSync(simulationsDir, { withFileTypes: true });
|
|
205
|
-
return entries.filter((entry) => !entry.isDirectory() && entry.name.endsWith(".json")).map((entry) => ({
|
|
206
|
-
name: entry.name.replace(/\.json$/, ""),
|
|
207
|
-
path: `${simulationsDir}/${entry.name}`
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
|
-
export {
|
|
211
|
-
buildResourceMap as a,
|
|
212
|
-
buildDevSimulations as b,
|
|
213
|
-
buildSimulations as c,
|
|
214
|
-
createResourceExports as d,
|
|
215
|
-
extractResourceKey as e,
|
|
216
|
-
extractSimulationKey as f,
|
|
217
|
-
findResourceDirs as g,
|
|
218
|
-
findResourceKey as h,
|
|
219
|
-
getComponentName as i,
|
|
220
|
-
findSimulationFilesFlat as j,
|
|
221
|
-
findToolFiles as k,
|
|
222
|
-
toPascalCase as t
|
|
223
|
-
};
|
|
224
|
-
//# sourceMappingURL=discovery-BVqD-JsT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-BVqD-JsT.js","sources":["../src/lib/discovery.ts"],"sourcesContent":["/**\n * Discovery utilities for auto-discovering resources and simulations\n *\n * These helpers process the results of import.meta.glob() calls to extract\n * keys, build component maps, and connect simulations to resources.\n *\n * The glob calls themselves must remain in the template (Vite compile-time),\n * but all the processing logic lives here for easy updates across templates.\n *\n * Node.js utilities (findResourceDirs, findToolFiles, etc.) can be used\n * by CLI commands for build-time and runtime discovery.\n */\n\nimport type { Simulation } from '../types/simulation.js';\n\n/**\n * Convert a kebab-case string to PascalCase\n * @example toPascalCase('review') // 'Review'\n * @example toPascalCase('album-art') // 'AlbumArt'\n */\nexport function toPascalCase(str: string): string {\n return str\n .split('-')\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n}\n\n/**\n * Extract the resource key from a resource file path.\n * Matches {name}.tsx (e.g., './albums/albums.tsx' → 'albums')\n */\nexport function extractResourceKey(path: string): string | undefined {\n const match = path.match(/([^/]+)\\.tsx$/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Extract the simulation key from a simulation file path.\n * Matches any *.json file (e.g., './show-albums.json' → 'show-albums')\n */\nexport function extractSimulationKey(path: string): string | undefined {\n const match = path.match(/([^/]+)\\.json$/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Find the best matching resource key for a simulation key.\n * Matches the longest resource name that is a prefix of the simulation key.\n * @example findResourceKey('review-diff', ['review', 'carousel']) // 'review'\n * @example findResourceKey('albums', ['albums', 'review']) // 'albums'\n */\nexport function findResourceKey(simulationKey: string, resourceKeys: string[]): string | undefined {\n // Sort by length descending to find longest match first\n const sorted = [...resourceKeys].sort((a, b) => b.length - a.length);\n for (const resourceKey of sorted) {\n if (simulationKey === resourceKey || simulationKey.startsWith(resourceKey + '-')) {\n return resourceKey;\n }\n }\n return undefined;\n}\n\n/**\n * Get the expected component export name for a resource\n * @example getComponentName('review') // 'ReviewResource'\n * @example getComponentName('album-art') // 'AlbumArtResource'\n */\nexport function getComponentName(resourceKey: string): string {\n return `${toPascalCase(resourceKey)}Resource`;\n}\n\n// --- Glob processing helpers ---\n\ntype GlobModules = Record<string, unknown>;\n\n/**\n * Process resource component modules from import.meta.glob() result.\n * Extracts components and exports them with PascalCase names.\n *\n * @example\n * const modules = import.meta.glob('./*\\/*.tsx', { eager: true });\n * export default createResourceExports(modules);\n */\nexport function createResourceExports(modules: GlobModules): Record<string, React.ComponentType> {\n const resources: Record<string, React.ComponentType> = {};\n\n for (const [path, module] of Object.entries(modules)) {\n const key = extractResourceKey(path);\n if (!key) continue;\n\n const exportName = getComponentName(key);\n const mod = module as Record<string, unknown>;\n\n // Try default export first, then named export matching the expected name\n const component = mod.default ?? mod[exportName];\n\n // Accept functions (regular components) or objects (forwardRef/memo components)\n if (component && (typeof component === 'function' || typeof component === 'object')) {\n resources[exportName] = component as React.ComponentType;\n }\n }\n\n return resources;\n}\n\n/**\n * Build a resource metadata map from import.meta.glob() result.\n * Used for connecting simulations to their resource definitions.\n *\n * @example\n * const modules = import.meta.glob('../src/resources/*\\/*.tsx', { eager: true });\n * const resourcesMap = buildResourceMap(modules);\n */\nexport function buildResourceMap<T>(modules: GlobModules): Map<string, T> {\n const map = new Map<string, T>();\n\n for (const [path, module] of Object.entries(modules)) {\n const key = extractResourceKey(path);\n if (key) {\n map.set(key, (module as { resource: T }).resource);\n }\n }\n\n return map;\n}\n\n/**\n * Options for building simulations from discovered modules\n */\nexport interface BuildSimulationsOptions<TResource, TSimulation> {\n /** Glob result of simulation JSON files */\n simulationModules: GlobModules;\n /** Map of resource key -> resource metadata */\n resourcesMap: Map<string, TResource>;\n /** Map of component name -> React component */\n resourceComponents: Record<string, React.ComponentType>;\n /** Create the final simulation object */\n createSimulation: (\n simulationKey: string,\n simulationData: unknown,\n resource: TResource,\n resourceComponent: React.ComponentType\n ) => TSimulation;\n /** Optional warning handler for missing resources */\n onMissingResource?: (simulationKey: string, expectedPrefix: string) => void;\n}\n\n/**\n * Build simulations by connecting simulation data with resources and components.\n * This is the main orchestration function for dev server bootstrap.\n */\nexport function buildSimulations<TResource, TSimulation>(\n options: BuildSimulationsOptions<TResource, TSimulation>\n): Record<string, TSimulation> {\n const {\n simulationModules,\n resourcesMap,\n resourceComponents,\n createSimulation,\n onMissingResource = (key, prefix) =>\n console.warn(\n `No matching resource found for simulation \"${key}\". ` +\n `Expected a resource file like src/resources/${prefix}/${prefix}.tsx`\n ),\n } = options;\n\n const resourceKeys = Array.from(resourcesMap.keys());\n const simulations: Record<string, TSimulation> = {};\n\n for (const [path, module] of Object.entries(simulationModules)) {\n const simulationKey = extractSimulationKey(path);\n if (!simulationKey) continue;\n\n const simulationData = (module as { default: unknown }).default;\n\n // Find matching resource\n const resourceKey = findResourceKey(simulationKey, resourceKeys);\n if (!resourceKey) {\n onMissingResource(simulationKey, simulationKey.split('-')[0]);\n continue;\n }\n\n const resource = resourcesMap.get(resourceKey)!;\n\n // Get component\n const componentName = getComponentName(resourceKey);\n const resourceComponent = resourceComponents[componentName];\n\n if (!resourceComponent) {\n console.warn(\n `Resource component \"${componentName}\" not found for resource \"${resourceKey}\". ` +\n `Make sure src/resources/${resourceKey}/${resourceKey}.tsx exists with a default export.`\n );\n continue;\n }\n\n simulations[simulationKey] = createSimulation(\n simulationKey,\n simulationData,\n resource,\n resourceComponent\n );\n }\n\n return simulations;\n}\n\n// --- Dev server helpers ---\n\n/**\n * Resource metadata from resource .tsx files\n */\nexport interface ResourceMetadata {\n name: string;\n [key: string]: unknown;\n}\n\n/**\n * Options for building dev simulations\n */\nexport interface BuildDevSimulationsOptions {\n /** Glob result of simulation JSON files */\n simulationModules: GlobModules;\n /** Resource components map from src/resources/index.ts */\n resourceComponents: Record<string, React.ComponentType>;\n /** Glob result of tool files: import.meta.glob('src/tools/*.ts', { eager: true }) */\n toolModules: GlobModules;\n /** Glob result of resource .tsx files from src/resources/ */\n resourceModules: GlobModules;\n}\n\n/**\n * Tool metadata extracted from a tool module's `tool` export\n */\ninterface ToolModuleInfo {\n tool: Record<string, unknown>;\n /** Resource name string from tool.resource (undefined for tools without UI) */\n resourceName?: string;\n}\n\n/**\n * Build simulations for the dev server from glob results.\n * Simulation JSON has `\"tool\": \"tool-name\"` string referencing a tool file.\n * Tool files have `resource: 'name'` linking to a resource discovered from resourceModules.\n */\nexport function buildDevSimulations(\n options: BuildDevSimulationsOptions\n): Record<string, Simulation> {\n const { simulationModules, resourceComponents, toolModules, resourceModules } = options;\n\n // Build resource metadata map from resource modules (keyed by resource name)\n const resourceMetaByName = new Map<string, ResourceMetadata>();\n const resourceKeyByName = new Map<string, string>();\n for (const [path, module] of Object.entries(resourceModules)) {\n const key = extractResourceKey(path);\n if (!key) continue;\n const mod = module as { resource?: ResourceMetadata };\n if (mod.resource) {\n // Use explicit name if provided, otherwise derive from directory key\n const name = mod.resource.name ?? key;\n resourceMetaByName.set(name, { ...mod.resource, name });\n resourceKeyByName.set(name, key);\n }\n }\n\n // Build tool map from tool modules\n const toolsMap = new Map<string, ToolModuleInfo>();\n if (toolModules) {\n for (const [path, module] of Object.entries(toolModules)) {\n const nameMatch = path.match(/([^/]+)\\.ts$/);\n if (!nameMatch) continue;\n const mod = module as { tool?: Record<string, unknown> };\n if (mod.tool) {\n const resourceName = mod.tool.resource as string | undefined;\n toolsMap.set(nameMatch[1], { tool: mod.tool, resourceName });\n }\n }\n }\n\n const simulations: Record<string, Simulation> = {};\n\n for (const [path, module] of Object.entries(simulationModules)) {\n const simKey = extractSimulationKey(path);\n if (!simKey) continue;\n\n const simulationData = (module as { default: Record<string, unknown> }).default;\n\n const toolName =\n typeof simulationData.tool === 'string' ? (simulationData.tool as string) : simKey;\n const toolInfo = toolsMap.get(toolName);\n if (!toolInfo) {\n console.warn(\n `Tool \"${toolName}\" not found for simulation \"${simKey}\". ` +\n `Make sure src/tools/${toolName}.ts exists.`\n );\n continue;\n }\n\n // Look up resource metadata by name (if tool has a UI)\n const resourceMeta = toolInfo.resourceName\n ? resourceMetaByName.get(toolInfo.resourceName)\n : undefined;\n const resourceKey = toolInfo.resourceName\n ? resourceKeyByName.get(toolInfo.resourceName)\n : undefined;\n\n if (toolInfo.resourceName && (!resourceMeta || !resourceKey)) {\n console.warn(\n `Resource \"${toolInfo.resourceName}\" not found for tool \"${toolName}\". ` +\n `Make sure a resource with name \"${toolInfo.resourceName}\" exists in src/resources/.`\n );\n continue;\n }\n\n // Build resource block only for UI tools\n let resourceBlock: Pick<Simulation, 'resource' | 'resourceUrl'> = {};\n if (resourceKey && resourceMeta) {\n const componentName = getComponentName(resourceKey);\n const resourceComponent = resourceComponents[componentName];\n\n if (!resourceComponent) {\n console.warn(`Resource component \"${componentName}\" not found for tool \"${toolName}\".`);\n continue;\n }\n\n resourceBlock = {\n resource: {\n uri: `ui://${resourceKey}`,\n name: resourceKey,\n ...(resourceMeta.title != null ? { title: resourceMeta.title as string } : {}),\n ...(resourceMeta.description != null\n ? { description: resourceMeta.description as string }\n : {}),\n ...(resourceMeta.mimeType != null ? { mimeType: resourceMeta.mimeType as string } : {}),\n ...(resourceMeta._meta != null\n ? { _meta: resourceMeta._meta as Record<string, unknown> }\n : {}),\n },\n resourceUrl: `/.sunpeak/resource-loader.html?component=${componentName}`,\n };\n }\n\n simulations[simKey] = {\n name: simKey,\n userMessage: simulationData.userMessage as string | undefined,\n tool: {\n name: toolName,\n description: (toolInfo.tool.description as string) ?? '',\n inputSchema: { type: 'object' as const },\n ...(toolInfo.tool.title != null ? { title: toolInfo.tool.title as string } : {}),\n ...(toolInfo.tool.annotations != null\n ? { annotations: toolInfo.tool.annotations as Record<string, unknown> }\n : {}),\n ...(toolInfo.tool._meta != null\n ? { _meta: toolInfo.tool._meta as Record<string, unknown> }\n : {}),\n },\n ...resourceBlock,\n toolInput: simulationData.toolInput as Record<string, unknown> | undefined,\n toolResult: simulationData.toolResult as Simulation['toolResult'],\n serverTools: simulationData.serverTools as Simulation['serverTools'],\n };\n }\n\n return simulations;\n}\n\n// --- Node.js utilities for CLI commands ---\n// These utilities use standard Node.js APIs and can be imported by build/push/mcp commands.\n\n/**\n * Information about a discovered resource directory\n */\nexport interface ResourceDirInfo {\n /** Resource key (directory name), e.g., 'albums', 'carousel' */\n key: string;\n /** Full path to the resource directory */\n dir: string;\n /** Full path to the main resource file (tsx or json depending on context) */\n resourcePath: string;\n}\n\n/**\n * File system operations interface for dependency injection in tests\n */\nexport interface FsOps {\n readdirSync: (\n path: string,\n options: { withFileTypes: true }\n ) => Array<{ name: string; isDirectory: () => boolean }>;\n existsSync: (path: string) => boolean;\n}\n\n/**\n * Find all resource directories in a base directory.\n * Each valid resource directory contains a file matching the expected pattern.\n *\n * @param baseDir - Base directory to scan (e.g., 'src/resources' or 'dist')\n * @param filePattern - Function to generate expected filename from resource key\n * @param fs - File system operations (for testing)\n *\n * @example\n * // Find source resources (tsx files)\n * const resources = findResourceDirs('src/resources', key => `${key}.tsx`);\n *\n * @example\n * // Find built resources (js files)\n * const resources = findResourceDirs('dist', key => `${key}.js`);\n */\nexport function findResourceDirs(\n baseDir: string,\n filePattern: (key: string) => string,\n fs: FsOps\n): ResourceDirInfo[] {\n if (!fs.existsSync(baseDir)) {\n return [];\n }\n\n const entries = fs.readdirSync(baseDir, { withFileTypes: true });\n\n return entries\n .filter((entry) => entry.isDirectory())\n .map((entry) => {\n const key = entry.name;\n const dir = `${baseDir}/${key}`;\n const resourcePath = `${dir}/${filePattern(key)}`;\n\n if (!fs.existsSync(resourcePath)) {\n return null;\n }\n\n return { key, dir, resourcePath };\n })\n .filter((info): info is ResourceDirInfo => info !== null);\n}\n\n// --- Tool files + flat simulations discovery ---\n\n/**\n * Information about a discovered tool file\n */\nexport interface ToolFileInfo {\n /** Tool name derived from filename (e.g., 'show-albums') */\n name: string;\n /** Full path to the tool file */\n path: string;\n}\n\n/**\n * Find all tool files in a tools directory.\n * Matches *.ts files directly in the directory (not recursive).\n *\n * @example\n * findToolFiles('src/tools', fs)\n * // [{ name: 'show-albums', path: 'src/tools/show-albums.ts' }]\n */\nexport function findToolFiles(\n toolsDir: string,\n fs: Pick<FsOps, 'readdirSync' | 'existsSync'>\n): ToolFileInfo[] {\n if (!fs.existsSync(toolsDir)) {\n return [];\n }\n\n const entries = fs.readdirSync(toolsDir, { withFileTypes: true });\n\n return entries\n .filter(\n (entry) =>\n !entry.isDirectory() && entry.name.endsWith('.ts') && !entry.name.endsWith('.test.ts')\n )\n .map((entry) => ({\n name: entry.name.replace(/\\.ts$/, ''),\n path: `${toolsDir}/${entry.name}`,\n }));\n}\n\n/**\n * Information about a discovered simulation file (flat convention)\n */\nexport interface SimulationFileInfo {\n /** Filename without extension (e.g., 'show-albums') */\n name: string;\n /** Full path to the simulation file */\n path: string;\n}\n\n/**\n * Find all simulation JSON files in a flat simulations directory.\n * Matches any *.json file directly in the directory.\n *\n * @example\n * findSimulationFilesFlat('tests/simulations', fs)\n * // [{ name: 'show-albums', path: 'tests/simulations/show-albums.json' }]\n */\nexport function findSimulationFilesFlat(\n simulationsDir: string,\n fs: Pick<FsOps, 'readdirSync' | 'existsSync'>\n): SimulationFileInfo[] {\n if (!fs.existsSync(simulationsDir)) {\n return [];\n }\n\n const entries = fs.readdirSync(simulationsDir, { withFileTypes: true });\n\n return entries\n .filter((entry) => !entry.isDirectory() && entry.name.endsWith('.json'))\n .map((entry) => ({\n name: entry.name.replace(/\\.json$/, ''),\n path: `${simulationsDir}/${entry.name}`,\n }));\n}\n"],"names":[],"mappings":"AAoBO,SAAS,aAAa,KAAqB;AAChD,SAAO,IACJ,MAAM,GAAG,EACT,IAA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