sunpeak 0.15.4 → 0.16.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.
Files changed (105) hide show
  1. package/README.md +53 -49
  2. package/bin/commands/build.mjs +119 -6
  3. package/bin/commands/dev.mjs +168 -27
  4. package/bin/commands/new.mjs +13 -3
  5. package/bin/commands/start.mjs +215 -0
  6. package/bin/lib/extract-resource.mjs +1 -1
  7. package/bin/lib/extract-tool.mjs +78 -0
  8. package/bin/lib/patterns.mjs +2 -26
  9. package/bin/sunpeak.js +11 -1
  10. package/dist/chatgpt/index.cjs +3 -6
  11. package/dist/chatgpt/index.cjs.map +1 -1
  12. package/dist/chatgpt/index.d.ts +1 -1
  13. package/dist/chatgpt/index.js +6 -9
  14. package/dist/claude/index.cjs +1 -1
  15. package/dist/claude/index.js +1 -1
  16. package/dist/discovery-CH80W5l9.js +217 -0
  17. package/dist/discovery-CH80W5l9.js.map +1 -0
  18. package/dist/discovery-DmB8_4QL.cjs +216 -0
  19. package/dist/discovery-DmB8_4QL.cjs.map +1 -0
  20. package/dist/{index-Cngntkp2.cjs → index-Bll1bszc.cjs} +3 -6
  21. package/dist/{index-Cngntkp2.cjs.map → index-Bll1bszc.cjs.map} +1 -1
  22. package/dist/{index-Ce_5ZIdJ.js → index-CACtnwu2.js} +3 -6
  23. package/dist/{index-Ce_5ZIdJ.js.map → index-CACtnwu2.js.map} +1 -1
  24. package/dist/{index-CutQgPzR.js → index-CLcr8IyR.js} +3 -6
  25. package/dist/index-CLcr8IyR.js.map +1 -0
  26. package/dist/{index-B0dxRJvS.cjs → index-CaQmwZJc.cjs} +3 -6
  27. package/dist/index-CaQmwZJc.cjs.map +1 -0
  28. package/dist/index.cjs +49 -6
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.js +3405 -3362
  32. package/dist/index.js.map +1 -1
  33. package/dist/lib/discovery-cli.cjs +58 -5
  34. package/dist/lib/discovery-cli.cjs.map +1 -1
  35. package/dist/lib/discovery-cli.d.ts +3 -2
  36. package/dist/lib/discovery-cli.js +61 -8
  37. package/dist/lib/discovery-cli.js.map +1 -1
  38. package/dist/lib/discovery.d.ts +42 -43
  39. package/dist/lib/extract-tool.d.ts +12 -0
  40. package/dist/mcp/favicon.d.ts +1 -1
  41. package/dist/mcp/index.cjs +1582 -5
  42. package/dist/mcp/index.cjs.map +1 -1
  43. package/dist/mcp/index.d.ts +3 -1
  44. package/dist/mcp/index.js +1583 -6
  45. package/dist/mcp/index.js.map +1 -1
  46. package/dist/mcp/production-server.d.ts +156 -0
  47. package/dist/mcp/types.d.ts +24 -1
  48. package/dist/platform/chatgpt/index.cjs +1 -1
  49. package/dist/platform/chatgpt/index.js +1 -1
  50. package/dist/{protocol-DFbsCx7E.js → protocol-BD5jDQEx.js} +8 -1
  51. package/dist/{protocol-DFbsCx7E.js.map → protocol-BD5jDQEx.js.map} +1 -1
  52. package/dist/{protocol-CL4_Npj5.cjs → protocol-BOjXuK6l.cjs} +8 -1
  53. package/dist/{protocol-CL4_Npj5.cjs.map → protocol-BOjXuK6l.cjs.map} +1 -1
  54. package/dist/simulator/index.cjs +2 -5
  55. package/dist/simulator/index.cjs.map +1 -1
  56. package/dist/simulator/index.d.ts +1 -1
  57. package/dist/simulator/index.js +5 -8
  58. package/dist/simulator/simulator-url.d.ts +9 -9
  59. package/dist/{simulator-CxrtnguM.js → simulator-B7rw83zP.js} +9 -3
  60. package/dist/{simulator-CxrtnguM.js.map → simulator-B7rw83zP.js.map} +1 -1
  61. package/dist/{simulator-DcfQBRXE.cjs → simulator-DjZNa1MI.cjs} +9 -3
  62. package/dist/{simulator-DcfQBRXE.cjs.map → simulator-DjZNa1MI.cjs.map} +1 -1
  63. package/dist/simulator-url-CuLqtnSS.js.map +1 -1
  64. package/dist/simulator-url-rgg_KYOg.cjs.map +1 -1
  65. package/dist/types/resource-config.d.ts +7 -5
  66. package/dist/{use-app-BnoSPiUT.cjs → use-app-BpAJqzdE.cjs} +50 -21
  67. package/dist/{use-app-BnoSPiUT.cjs.map → use-app-BpAJqzdE.cjs.map} +1 -1
  68. package/dist/{use-app-D_TeaMFG.js → use-app-WOUdh1PR.js} +52 -23
  69. package/dist/{use-app-D_TeaMFG.js.map → use-app-WOUdh1PR.js.map} +1 -1
  70. package/package.json +1 -1
  71. package/template/.sunpeak/dev.tsx +8 -4
  72. package/template/.sunpeak/resource-loader.tsx +2 -1
  73. package/template/README.md +27 -22
  74. package/template/package.json +3 -1
  75. package/template/src/resources/albums/{albums-resource.test.tsx → albums.test.tsx} +1 -1
  76. package/template/src/resources/albums/{albums-resource.tsx → albums.tsx} +0 -1
  77. package/template/src/resources/carousel/{carousel-resource.test.tsx → carousel.test.tsx} +1 -1
  78. package/template/src/resources/carousel/{carousel-resource.tsx → carousel.tsx} +0 -1
  79. package/template/src/resources/index.ts +4 -4
  80. package/template/src/resources/map/{map-resource.test.tsx → map.test.tsx} +1 -1
  81. package/template/src/resources/map/{map-resource.tsx → map.tsx} +0 -1
  82. package/template/src/resources/review/{review-resource.test.tsx → review.test.tsx} +1 -1
  83. package/template/src/resources/review/{review-resource.tsx → review.tsx} +1 -2
  84. package/template/src/server.ts +17 -0
  85. package/template/src/tools/review-diff.ts +24 -0
  86. package/template/src/tools/review-post.ts +26 -0
  87. package/template/src/tools/review-purchase.ts +31 -0
  88. package/template/src/tools/show-albums.ts +22 -0
  89. package/template/src/tools/show-carousel.ts +25 -0
  90. package/template/src/tools/show-map.ts +29 -0
  91. package/template/tests/e2e/albums.spec.ts +6 -6
  92. package/template/tests/e2e/carousel.spec.ts +6 -6
  93. package/template/tests/e2e/map.spec.ts +11 -11
  94. package/template/tests/simulations/{review/review-diff-simulation.json → review-diff.json} +1 -31
  95. package/template/tests/simulations/{review/review-post-simulation.json → review-post.json} +1 -37
  96. package/template/tests/simulations/{review/review-purchase-simulation.json → review-purchase.json} +1 -38
  97. package/template/tests/simulations/{albums/albums-show-simulation.json → show-albums.json} +1 -24
  98. package/template/tests/simulations/{carousel/carousel-show-simulation.json → show-carousel.json} +1 -24
  99. package/template/tests/simulations/{map/map-show-simulation.json → show-map.json} +1 -35
  100. package/dist/discovery-CRR3SlyI.cjs +0 -156
  101. package/dist/discovery-CRR3SlyI.cjs.map +0 -1
  102. package/dist/discovery-DzV3HLXs.js +0 -157
  103. package/dist/discovery-DzV3HLXs.js.map +0 -1
  104. package/dist/index-B0dxRJvS.cjs.map +0 -1
  105. package/dist/index-CutQgPzR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"simulator-url-CuLqtnSS.js","sources":["../src/simulator/simulator-url.ts"],"sourcesContent":["import type { Theme, DisplayMode, DeviceType } from '../types/runtime';\n\n/**\n * Strongly-typed URL parameters for the Simulator.\n *\n * Use with `createSimulatorUrl()` to generate type-safe URL paths for e2e tests.\n *\n * @example\n * ```ts\n * import { createSimulatorUrl } from 'sunpeak/chatgpt';\n *\n * // In e2e tests:\n * await page.goto(createSimulatorUrl({\n * simulation: 'albums-show',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * host: 'claude',\n * }));\n * ```\n */\nexport interface SimulatorUrlParams {\n /**\n * The simulation name to load (e.g., 'albums-show', 'review-diff').\n * Corresponds to the simulation JSON filename without the '-simulation.json' suffix.\n */\n simulation?: string;\n\n /**\n * The host shell to use (e.g., 'chatgpt', 'claude').\n * Switches conversation chrome, theming, and reported host info/capabilities.\n * @default 'chatgpt'\n */\n host?: string;\n\n /**\n * The color theme for the simulator.\n * @default 'dark'\n */\n theme?: Theme;\n\n /**\n * The display mode for the widget.\n * - 'inline': Embedded in the conversation\n * - 'pip': Picture-in-picture mode with max height\n * - 'fullscreen': Full screen overlay\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * The locale for the simulator (e.g., 'en-US', 'ja-JP').\n * @default 'en-US'\n */\n locale?: string;\n\n /**\n * Maximum height in pixels for PiP mode.\n * Only applicable when displayMode is 'pip'.\n */\n maxHeight?: number;\n\n /**\n * The device type to simulate.\n * Affects default hover/touch capabilities.\n */\n deviceType?: DeviceType;\n\n /**\n * Whether the device supports hover interactions.\n * @default true for desktop, false for mobile/tablet\n */\n hover?: boolean;\n\n /**\n * Whether the device supports touch interactions.\n * @default false for desktop, true for mobile/tablet\n */\n touch?: boolean;\n\n /**\n * Safe area inset from the top of the screen (in pixels).\n * Used for devices with notches or status bars.\n */\n safeAreaTop?: number;\n\n /**\n * Safe area inset from the bottom of the screen (in pixels).\n * Used for devices with home indicators.\n */\n safeAreaBottom?: number;\n\n /**\n * Safe area inset from the left of the screen (in pixels).\n */\n safeAreaLeft?: number;\n\n /**\n * Safe area inset from the right of the screen (in pixels).\n */\n safeAreaRight?: number;\n}\n\n/**\n * Creates a URL path with query parameters for the ChatGPT Simulator.\n *\n * @param params - The simulator parameters to encode\n * @param basePath - The base path for the URL (default: '/')\n * @returns A URL path string with encoded query parameters\n *\n * @example\n * ```ts\n * // Basic usage\n * createSimulatorUrl({ simulation: 'albums-show', theme: 'light' })\n * // Returns: '/?simulation=albums-show&theme=light'\n *\n * // With display mode\n * createSimulatorUrl({\n * simulation: 'review-diff',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * })\n * // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'\n *\n * // With device simulation\n * createSimulatorUrl({\n * simulation: 'map-show',\n * deviceType: 'mobile',\n * touch: true,\n * hover: false,\n * })\n * // Returns: '/?simulation=map-show&deviceType=mobile&touch=true&hover=false'\n *\n * // With safe area insets (for notch simulation)\n * createSimulatorUrl({\n * simulation: 'carousel-show',\n * safeAreaTop: 44,\n * safeAreaBottom: 34,\n * })\n * // Returns: '/?simulation=carousel-show&safeAreaTop=44&safeAreaBottom=34'\n * ```\n */\nexport function createSimulatorUrl(params: SimulatorUrlParams, basePath = '/'): string {\n const searchParams = new URLSearchParams();\n\n // Add each defined parameter\n if (params.simulation !== undefined) {\n searchParams.set('simulation', params.simulation);\n }\n if (params.host !== undefined) {\n searchParams.set('host', params.host);\n }\n if (params.theme !== undefined) {\n searchParams.set('theme', params.theme);\n }\n if (params.displayMode !== undefined) {\n searchParams.set('displayMode', params.displayMode);\n }\n if (params.locale !== undefined) {\n searchParams.set('locale', params.locale);\n }\n if (params.maxHeight !== undefined) {\n searchParams.set('maxHeight', String(params.maxHeight));\n }\n if (params.deviceType !== undefined) {\n searchParams.set('deviceType', params.deviceType);\n }\n if (params.hover !== undefined) {\n searchParams.set('hover', String(params.hover));\n }\n if (params.touch !== undefined) {\n searchParams.set('touch', String(params.touch));\n }\n if (params.safeAreaTop !== undefined) {\n searchParams.set('safeAreaTop', String(params.safeAreaTop));\n }\n if (params.safeAreaBottom !== undefined) {\n searchParams.set('safeAreaBottom', String(params.safeAreaBottom));\n }\n if (params.safeAreaLeft !== undefined) {\n searchParams.set('safeAreaLeft', String(params.safeAreaLeft));\n }\n if (params.safeAreaRight !== undefined) {\n searchParams.set('safeAreaRight', String(params.safeAreaRight));\n }\n const queryString = searchParams.toString();\n return queryString ? `${basePath}?${queryString}` : basePath;\n}\n"],"names":[],"mappings":"AA6IO,SAAS,mBAAmB,QAA4B,WAAW,KAAa;AACrF,QAAM,eAAe,IAAI,gBAAA;AAGzB,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,SAAS,QAAW;AAC7B,iBAAa,IAAI,QAAQ,OAAO,IAAI;AAAA,EACtC;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,KAAK;AAAA,EACxC;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,WAAW;AAAA,EACpD;AACA,MAAI,OAAO,WAAW,QAAW;AAC/B,iBAAa,IAAI,UAAU,OAAO,MAAM;AAAA,EAC1C;AACA,MAAI,OAAO,cAAc,QAAW;AAClC,iBAAa,IAAI,aAAa,OAAO,OAAO,SAAS,CAAC;AAAA,EACxD;AACA,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,OAAO,WAAW,CAAC;AAAA,EAC5D;AACA,MAAI,OAAO,mBAAmB,QAAW;AACvC,iBAAa,IAAI,kBAAkB,OAAO,OAAO,cAAc,CAAC;AAAA,EAClE;AACA,MAAI,OAAO,iBAAiB,QAAW;AACrC,iBAAa,IAAI,gBAAgB,OAAO,OAAO,YAAY,CAAC;AAAA,EAC9D;AACA,MAAI,OAAO,kBAAkB,QAAW;AACtC,iBAAa,IAAI,iBAAiB,OAAO,OAAO,aAAa,CAAC;AAAA,EAChE;AACA,QAAM,cAAc,aAAa,SAAA;AACjC,SAAO,cAAc,GAAG,QAAQ,IAAI,WAAW,KAAK;AACtD;"}
1
+ {"version":3,"file":"simulator-url-CuLqtnSS.js","sources":["../src/simulator/simulator-url.ts"],"sourcesContent":["import type { Theme, DisplayMode, DeviceType } from '../types/runtime';\n\n/**\n * Strongly-typed URL parameters for the Simulator.\n *\n * Use with `createSimulatorUrl()` to generate type-safe URL paths for e2e tests.\n *\n * @example\n * ```ts\n * import { createSimulatorUrl } from 'sunpeak/chatgpt';\n *\n * // In e2e tests:\n * await page.goto(createSimulatorUrl({\n * simulation: 'show-albums',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * host: 'claude',\n * }));\n * ```\n */\nexport interface SimulatorUrlParams {\n /**\n * The simulation name to load (e.g., 'show-albums', 'review-diff').\n * Corresponds to the simulation JSON filename without the `.json` extension.\n */\n simulation?: string;\n\n /**\n * The host shell to use (e.g., 'chatgpt', 'claude').\n * Switches conversation chrome, theming, and reported host info/capabilities.\n * @default 'chatgpt'\n */\n host?: string;\n\n /**\n * The color theme for the simulator.\n * @default 'dark'\n */\n theme?: Theme;\n\n /**\n * The display mode for the widget.\n * - 'inline': Embedded in the conversation\n * - 'pip': Picture-in-picture mode with max height\n * - 'fullscreen': Full screen overlay\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * The locale for the simulator (e.g., 'en-US', 'ja-JP').\n * @default 'en-US'\n */\n locale?: string;\n\n /**\n * Maximum height in pixels for PiP mode.\n * Only applicable when displayMode is 'pip'.\n */\n maxHeight?: number;\n\n /**\n * The device type to simulate.\n * Affects default hover/touch capabilities.\n */\n deviceType?: DeviceType;\n\n /**\n * Whether the device supports hover interactions.\n * @default true for desktop, false for mobile/tablet\n */\n hover?: boolean;\n\n /**\n * Whether the device supports touch interactions.\n * @default false for desktop, true for mobile/tablet\n */\n touch?: boolean;\n\n /**\n * Safe area inset from the top of the screen (in pixels).\n * Used for devices with notches or status bars.\n */\n safeAreaTop?: number;\n\n /**\n * Safe area inset from the bottom of the screen (in pixels).\n * Used for devices with home indicators.\n */\n safeAreaBottom?: number;\n\n /**\n * Safe area inset from the left of the screen (in pixels).\n */\n safeAreaLeft?: number;\n\n /**\n * Safe area inset from the right of the screen (in pixels).\n */\n safeAreaRight?: number;\n}\n\n/**\n * Creates a URL path with query parameters for the ChatGPT Simulator.\n *\n * @param params - The simulator parameters to encode\n * @param basePath - The base path for the URL (default: '/')\n * @returns A URL path string with encoded query parameters\n *\n * @example\n * ```ts\n * // Basic usage\n * createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })\n * // Returns: '/?simulation=show-albums&theme=light'\n *\n * // With display mode\n * createSimulatorUrl({\n * simulation: 'review-diff',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * })\n * // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'\n *\n * // With device simulation\n * createSimulatorUrl({\n * simulation: 'show-map',\n * deviceType: 'mobile',\n * touch: true,\n * hover: false,\n * })\n * // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'\n *\n * // With safe area insets (for notch simulation)\n * createSimulatorUrl({\n * simulation: 'show-carousel',\n * safeAreaTop: 44,\n * safeAreaBottom: 34,\n * })\n * // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'\n * ```\n */\nexport function createSimulatorUrl(params: SimulatorUrlParams, basePath = '/'): string {\n const searchParams = new URLSearchParams();\n\n // Add each defined parameter\n if (params.simulation !== undefined) {\n searchParams.set('simulation', params.simulation);\n }\n if (params.host !== undefined) {\n searchParams.set('host', params.host);\n }\n if (params.theme !== undefined) {\n searchParams.set('theme', params.theme);\n }\n if (params.displayMode !== undefined) {\n searchParams.set('displayMode', params.displayMode);\n }\n if (params.locale !== undefined) {\n searchParams.set('locale', params.locale);\n }\n if (params.maxHeight !== undefined) {\n searchParams.set('maxHeight', String(params.maxHeight));\n }\n if (params.deviceType !== undefined) {\n searchParams.set('deviceType', params.deviceType);\n }\n if (params.hover !== undefined) {\n searchParams.set('hover', String(params.hover));\n }\n if (params.touch !== undefined) {\n searchParams.set('touch', String(params.touch));\n }\n if (params.safeAreaTop !== undefined) {\n searchParams.set('safeAreaTop', String(params.safeAreaTop));\n }\n if (params.safeAreaBottom !== undefined) {\n searchParams.set('safeAreaBottom', String(params.safeAreaBottom));\n }\n if (params.safeAreaLeft !== undefined) {\n searchParams.set('safeAreaLeft', String(params.safeAreaLeft));\n }\n if (params.safeAreaRight !== undefined) {\n searchParams.set('safeAreaRight', String(params.safeAreaRight));\n }\n const queryString = searchParams.toString();\n return queryString ? `${basePath}?${queryString}` : basePath;\n}\n"],"names":[],"mappings":"AA6IO,SAAS,mBAAmB,QAA4B,WAAW,KAAa;AACrF,QAAM,eAAe,IAAI,gBAAA;AAGzB,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,SAAS,QAAW;AAC7B,iBAAa,IAAI,QAAQ,OAAO,IAAI;AAAA,EACtC;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,KAAK;AAAA,EACxC;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,WAAW;AAAA,EACpD;AACA,MAAI,OAAO,WAAW,QAAW;AAC/B,iBAAa,IAAI,UAAU,OAAO,MAAM;AAAA,EAC1C;AACA,MAAI,OAAO,cAAc,QAAW;AAClC,iBAAa,IAAI,aAAa,OAAO,OAAO,SAAS,CAAC;AAAA,EACxD;AACA,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,OAAO,WAAW,CAAC;AAAA,EAC5D;AACA,MAAI,OAAO,mBAAmB,QAAW;AACvC,iBAAa,IAAI,kBAAkB,OAAO,OAAO,cAAc,CAAC;AAAA,EAClE;AACA,MAAI,OAAO,iBAAiB,QAAW;AACrC,iBAAa,IAAI,gBAAgB,OAAO,OAAO,YAAY,CAAC;AAAA,EAC9D;AACA,MAAI,OAAO,kBAAkB,QAAW;AACtC,iBAAa,IAAI,iBAAiB,OAAO,OAAO,aAAa,CAAC;AAAA,EAChE;AACA,QAAM,cAAc,aAAa,SAAA;AACjC,SAAO,cAAc,GAAG,QAAQ,IAAI,WAAW,KAAK;AACtD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"simulator-url-rgg_KYOg.cjs","sources":["../src/simulator/simulator-url.ts"],"sourcesContent":["import type { Theme, DisplayMode, DeviceType } from '../types/runtime';\n\n/**\n * Strongly-typed URL parameters for the Simulator.\n *\n * Use with `createSimulatorUrl()` to generate type-safe URL paths for e2e tests.\n *\n * @example\n * ```ts\n * import { createSimulatorUrl } from 'sunpeak/chatgpt';\n *\n * // In e2e tests:\n * await page.goto(createSimulatorUrl({\n * simulation: 'albums-show',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * host: 'claude',\n * }));\n * ```\n */\nexport interface SimulatorUrlParams {\n /**\n * The simulation name to load (e.g., 'albums-show', 'review-diff').\n * Corresponds to the simulation JSON filename without the '-simulation.json' suffix.\n */\n simulation?: string;\n\n /**\n * The host shell to use (e.g., 'chatgpt', 'claude').\n * Switches conversation chrome, theming, and reported host info/capabilities.\n * @default 'chatgpt'\n */\n host?: string;\n\n /**\n * The color theme for the simulator.\n * @default 'dark'\n */\n theme?: Theme;\n\n /**\n * The display mode for the widget.\n * - 'inline': Embedded in the conversation\n * - 'pip': Picture-in-picture mode with max height\n * - 'fullscreen': Full screen overlay\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * The locale for the simulator (e.g., 'en-US', 'ja-JP').\n * @default 'en-US'\n */\n locale?: string;\n\n /**\n * Maximum height in pixels for PiP mode.\n * Only applicable when displayMode is 'pip'.\n */\n maxHeight?: number;\n\n /**\n * The device type to simulate.\n * Affects default hover/touch capabilities.\n */\n deviceType?: DeviceType;\n\n /**\n * Whether the device supports hover interactions.\n * @default true for desktop, false for mobile/tablet\n */\n hover?: boolean;\n\n /**\n * Whether the device supports touch interactions.\n * @default false for desktop, true for mobile/tablet\n */\n touch?: boolean;\n\n /**\n * Safe area inset from the top of the screen (in pixels).\n * Used for devices with notches or status bars.\n */\n safeAreaTop?: number;\n\n /**\n * Safe area inset from the bottom of the screen (in pixels).\n * Used for devices with home indicators.\n */\n safeAreaBottom?: number;\n\n /**\n * Safe area inset from the left of the screen (in pixels).\n */\n safeAreaLeft?: number;\n\n /**\n * Safe area inset from the right of the screen (in pixels).\n */\n safeAreaRight?: number;\n}\n\n/**\n * Creates a URL path with query parameters for the ChatGPT Simulator.\n *\n * @param params - The simulator parameters to encode\n * @param basePath - The base path for the URL (default: '/')\n * @returns A URL path string with encoded query parameters\n *\n * @example\n * ```ts\n * // Basic usage\n * createSimulatorUrl({ simulation: 'albums-show', theme: 'light' })\n * // Returns: '/?simulation=albums-show&theme=light'\n *\n * // With display mode\n * createSimulatorUrl({\n * simulation: 'review-diff',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * })\n * // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'\n *\n * // With device simulation\n * createSimulatorUrl({\n * simulation: 'map-show',\n * deviceType: 'mobile',\n * touch: true,\n * hover: false,\n * })\n * // Returns: '/?simulation=map-show&deviceType=mobile&touch=true&hover=false'\n *\n * // With safe area insets (for notch simulation)\n * createSimulatorUrl({\n * simulation: 'carousel-show',\n * safeAreaTop: 44,\n * safeAreaBottom: 34,\n * })\n * // Returns: '/?simulation=carousel-show&safeAreaTop=44&safeAreaBottom=34'\n * ```\n */\nexport function createSimulatorUrl(params: SimulatorUrlParams, basePath = '/'): string {\n const searchParams = new URLSearchParams();\n\n // Add each defined parameter\n if (params.simulation !== undefined) {\n searchParams.set('simulation', params.simulation);\n }\n if (params.host !== undefined) {\n searchParams.set('host', params.host);\n }\n if (params.theme !== undefined) {\n searchParams.set('theme', params.theme);\n }\n if (params.displayMode !== undefined) {\n searchParams.set('displayMode', params.displayMode);\n }\n if (params.locale !== undefined) {\n searchParams.set('locale', params.locale);\n }\n if (params.maxHeight !== undefined) {\n searchParams.set('maxHeight', String(params.maxHeight));\n }\n if (params.deviceType !== undefined) {\n searchParams.set('deviceType', params.deviceType);\n }\n if (params.hover !== undefined) {\n searchParams.set('hover', String(params.hover));\n }\n if (params.touch !== undefined) {\n searchParams.set('touch', String(params.touch));\n }\n if (params.safeAreaTop !== undefined) {\n searchParams.set('safeAreaTop', String(params.safeAreaTop));\n }\n if (params.safeAreaBottom !== undefined) {\n searchParams.set('safeAreaBottom', String(params.safeAreaBottom));\n }\n if (params.safeAreaLeft !== undefined) {\n searchParams.set('safeAreaLeft', String(params.safeAreaLeft));\n }\n if (params.safeAreaRight !== undefined) {\n searchParams.set('safeAreaRight', String(params.safeAreaRight));\n }\n const queryString = searchParams.toString();\n return queryString ? `${basePath}?${queryString}` : basePath;\n}\n"],"names":[],"mappings":";AA6IO,SAAS,mBAAmB,QAA4B,WAAW,KAAa;AACrF,QAAM,eAAe,IAAI,gBAAA;AAGzB,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,SAAS,QAAW;AAC7B,iBAAa,IAAI,QAAQ,OAAO,IAAI;AAAA,EACtC;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,KAAK;AAAA,EACxC;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,WAAW;AAAA,EACpD;AACA,MAAI,OAAO,WAAW,QAAW;AAC/B,iBAAa,IAAI,UAAU,OAAO,MAAM;AAAA,EAC1C;AACA,MAAI,OAAO,cAAc,QAAW;AAClC,iBAAa,IAAI,aAAa,OAAO,OAAO,SAAS,CAAC;AAAA,EACxD;AACA,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,OAAO,WAAW,CAAC;AAAA,EAC5D;AACA,MAAI,OAAO,mBAAmB,QAAW;AACvC,iBAAa,IAAI,kBAAkB,OAAO,OAAO,cAAc,CAAC;AAAA,EAClE;AACA,MAAI,OAAO,iBAAiB,QAAW;AACrC,iBAAa,IAAI,gBAAgB,OAAO,OAAO,YAAY,CAAC;AAAA,EAC9D;AACA,MAAI,OAAO,kBAAkB,QAAW;AACtC,iBAAa,IAAI,iBAAiB,OAAO,OAAO,aAAa,CAAC;AAAA,EAChE;AACA,QAAM,cAAc,aAAa,SAAA;AACjC,SAAO,cAAc,GAAG,QAAQ,IAAI,WAAW,KAAK;AACtD;;"}
1
+ {"version":3,"file":"simulator-url-rgg_KYOg.cjs","sources":["../src/simulator/simulator-url.ts"],"sourcesContent":["import type { Theme, DisplayMode, DeviceType } from '../types/runtime';\n\n/**\n * Strongly-typed URL parameters for the Simulator.\n *\n * Use with `createSimulatorUrl()` to generate type-safe URL paths for e2e tests.\n *\n * @example\n * ```ts\n * import { createSimulatorUrl } from 'sunpeak/chatgpt';\n *\n * // In e2e tests:\n * await page.goto(createSimulatorUrl({\n * simulation: 'show-albums',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * host: 'claude',\n * }));\n * ```\n */\nexport interface SimulatorUrlParams {\n /**\n * The simulation name to load (e.g., 'show-albums', 'review-diff').\n * Corresponds to the simulation JSON filename without the `.json` extension.\n */\n simulation?: string;\n\n /**\n * The host shell to use (e.g., 'chatgpt', 'claude').\n * Switches conversation chrome, theming, and reported host info/capabilities.\n * @default 'chatgpt'\n */\n host?: string;\n\n /**\n * The color theme for the simulator.\n * @default 'dark'\n */\n theme?: Theme;\n\n /**\n * The display mode for the widget.\n * - 'inline': Embedded in the conversation\n * - 'pip': Picture-in-picture mode with max height\n * - 'fullscreen': Full screen overlay\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * The locale for the simulator (e.g., 'en-US', 'ja-JP').\n * @default 'en-US'\n */\n locale?: string;\n\n /**\n * Maximum height in pixels for PiP mode.\n * Only applicable when displayMode is 'pip'.\n */\n maxHeight?: number;\n\n /**\n * The device type to simulate.\n * Affects default hover/touch capabilities.\n */\n deviceType?: DeviceType;\n\n /**\n * Whether the device supports hover interactions.\n * @default true for desktop, false for mobile/tablet\n */\n hover?: boolean;\n\n /**\n * Whether the device supports touch interactions.\n * @default false for desktop, true for mobile/tablet\n */\n touch?: boolean;\n\n /**\n * Safe area inset from the top of the screen (in pixels).\n * Used for devices with notches or status bars.\n */\n safeAreaTop?: number;\n\n /**\n * Safe area inset from the bottom of the screen (in pixels).\n * Used for devices with home indicators.\n */\n safeAreaBottom?: number;\n\n /**\n * Safe area inset from the left of the screen (in pixels).\n */\n safeAreaLeft?: number;\n\n /**\n * Safe area inset from the right of the screen (in pixels).\n */\n safeAreaRight?: number;\n}\n\n/**\n * Creates a URL path with query parameters for the ChatGPT Simulator.\n *\n * @param params - The simulator parameters to encode\n * @param basePath - The base path for the URL (default: '/')\n * @returns A URL path string with encoded query parameters\n *\n * @example\n * ```ts\n * // Basic usage\n * createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })\n * // Returns: '/?simulation=show-albums&theme=light'\n *\n * // With display mode\n * createSimulatorUrl({\n * simulation: 'review-diff',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * })\n * // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'\n *\n * // With device simulation\n * createSimulatorUrl({\n * simulation: 'show-map',\n * deviceType: 'mobile',\n * touch: true,\n * hover: false,\n * })\n * // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'\n *\n * // With safe area insets (for notch simulation)\n * createSimulatorUrl({\n * simulation: 'show-carousel',\n * safeAreaTop: 44,\n * safeAreaBottom: 34,\n * })\n * // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'\n * ```\n */\nexport function createSimulatorUrl(params: SimulatorUrlParams, basePath = '/'): string {\n const searchParams = new URLSearchParams();\n\n // Add each defined parameter\n if (params.simulation !== undefined) {\n searchParams.set('simulation', params.simulation);\n }\n if (params.host !== undefined) {\n searchParams.set('host', params.host);\n }\n if (params.theme !== undefined) {\n searchParams.set('theme', params.theme);\n }\n if (params.displayMode !== undefined) {\n searchParams.set('displayMode', params.displayMode);\n }\n if (params.locale !== undefined) {\n searchParams.set('locale', params.locale);\n }\n if (params.maxHeight !== undefined) {\n searchParams.set('maxHeight', String(params.maxHeight));\n }\n if (params.deviceType !== undefined) {\n searchParams.set('deviceType', params.deviceType);\n }\n if (params.hover !== undefined) {\n searchParams.set('hover', String(params.hover));\n }\n if (params.touch !== undefined) {\n searchParams.set('touch', String(params.touch));\n }\n if (params.safeAreaTop !== undefined) {\n searchParams.set('safeAreaTop', String(params.safeAreaTop));\n }\n if (params.safeAreaBottom !== undefined) {\n searchParams.set('safeAreaBottom', String(params.safeAreaBottom));\n }\n if (params.safeAreaLeft !== undefined) {\n searchParams.set('safeAreaLeft', String(params.safeAreaLeft));\n }\n if (params.safeAreaRight !== undefined) {\n searchParams.set('safeAreaRight', String(params.safeAreaRight));\n }\n const queryString = searchParams.toString();\n return queryString ? `${basePath}?${queryString}` : basePath;\n}\n"],"names":[],"mappings":";AA6IO,SAAS,mBAAmB,QAA4B,WAAW,KAAa;AACrF,QAAM,eAAe,IAAI,gBAAA;AAGzB,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,SAAS,QAAW;AAC7B,iBAAa,IAAI,QAAQ,OAAO,IAAI;AAAA,EACtC;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,KAAK;AAAA,EACxC;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,WAAW;AAAA,EACpD;AACA,MAAI,OAAO,WAAW,QAAW;AAC/B,iBAAa,IAAI,UAAU,OAAO,MAAM;AAAA,EAC1C;AACA,MAAI,OAAO,cAAc,QAAW;AAClC,iBAAa,IAAI,aAAa,OAAO,OAAO,SAAS,CAAC;AAAA,EACxD;AACA,MAAI,OAAO,eAAe,QAAW;AACnC,iBAAa,IAAI,cAAc,OAAO,UAAU;AAAA,EAClD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,UAAU,QAAW;AAC9B,iBAAa,IAAI,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,EAChD;AACA,MAAI,OAAO,gBAAgB,QAAW;AACpC,iBAAa,IAAI,eAAe,OAAO,OAAO,WAAW,CAAC;AAAA,EAC5D;AACA,MAAI,OAAO,mBAAmB,QAAW;AACvC,iBAAa,IAAI,kBAAkB,OAAO,OAAO,cAAc,CAAC;AAAA,EAClE;AACA,MAAI,OAAO,iBAAiB,QAAW;AACrC,iBAAa,IAAI,gBAAgB,OAAO,OAAO,YAAY,CAAC;AAAA,EAC9D;AACA,MAAI,OAAO,kBAAkB,QAAW;AACtC,iBAAa,IAAI,iBAAiB,OAAO,OAAO,aAAa,CAAC;AAAA,EAChE;AACA,QAAM,cAAc,aAAa,SAAA;AACjC,SAAO,cAAc,GAAG,QAAQ,IAAI,WAAW,KAAK;AACtD;;"}
@@ -3,12 +3,14 @@ import { McpUiResourceMeta } from '@modelcontextprotocol/ext-apps';
3
3
  /**
4
4
  * Configuration for an MCP App resource, exported from resource .tsx files.
5
5
  *
6
- * Composes the official MCP SDK `Resource` type (without `uri`, which is
7
- * generated at build time) with ext-apps `McpUiResourceMeta` for typed
8
- * CSP and permissions configuration.
6
+ * Composes the official MCP SDK `Resource` type (without `uri` and `name`,
7
+ * which are derived from the directory name at discovery time).
8
+ *
9
+ * `name` is optional — when omitted, it's derived from the directory name
10
+ * (e.g., `src/resources/albums/albums.tsx` → `'albums'`).
9
11
  */
10
- export type ResourceConfig = Omit<Resource, 'uri'> & {
11
- name: string;
12
+ export type ResourceConfig = Omit<Resource, 'uri' | 'name'> & {
13
+ name?: string;
12
14
  title?: string;
13
15
  _meta?: {
14
16
  ui?: McpUiResourceMeta;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const protocol = require("./protocol-CL4_Npj5.cjs");
4
+ const protocol = require("./protocol-BOjXuK6l.cjs");
5
5
  var Kc = Object.defineProperty;
6
6
  var s = (r, i) => {
7
7
  for (var o in i) Kc(r, o, { get: i[o], enumerable: true, configurable: true, set: (t) => i[o] = () => t });
@@ -38,7 +38,7 @@ class Yn {
38
38
  sessionId;
39
39
  setProtocolVersion;
40
40
  }
41
- var wv = "2026-01-26";
41
+ var wv = "2026-01-26", Yc = "ui/open-link", Qc = "ui/message", Fc = "ui/notifications/size-changed", Bc = "ui/notifications/tool-input", Hc = "ui/notifications/tool-input-partial", Mc = "ui/notifications/tool-result", Rc = "ui/notifications/tool-cancelled", xc = "ui/notifications/host-context-changed", Zc = "ui/resource-teardown", dc = "ui/initialize", Cc = "ui/notifications/initialized", fc = "ui/request-display-mode";
42
42
  var g = {};
43
43
  s(g, { xor: () => yl, xid: () => Nl, void: () => xl, uuidv7: () => cl, uuidv6: () => ll, uuidv4: () => el, uuid: () => gl, util: () => D, url: () => Il, uppercase: () => Kr, unknown: () => Nr, union: () => ev, undefined: () => Ml, ulid: () => wl, uint64: () => Bl, uint32: () => ml, tuple: () => Qg, trim: () => Fr, treeifyError: () => Xv, transform: () => cv, toUpperCase: () => Hr, toLowerCase: () => Br, toJSONSchema: () => Qi, templateLiteral: () => ec, symbol: () => Hl, superRefine: () => ee, success: () => uc, stringbool: () => Dc, stringFormat: () => Xl, string: () => Mi, strictObject: () => fl, startsWith: () => Yr, slugify: () => Mr, size: () => kr, setErrorMap: () => J6, set: () => nc, safeParseAsync: () => lg, safeParse: () => eg, safeEncodeAsync: () => Dg, safeEncode: () => Ug, safeDecodeAsync: () => wg, safeDecode: () => kg, registry: () => $i, regexes: () => x, regex: () => Vr, refine: () => ge, record: () => mg, readonly: () => ie, property: () => Ai, promise: () => lc, prettifyError: () => Vv, preprocess: () => Nc, prefault: () => hg, positive: () => Gi, pipe: () => En, partialRecord: () => pl, parseAsync: () => gg, parse: () => $g, overwrite: () => d, optional: () => Jn, object: () => Cl, number: () => Og, nullish: () => tc, nullable: () => Ln, null: () => Jg, normalize: () => Tr, nonpositive: () => Xi, nonoptional: () => yg, nonnegative: () => Vi, never: () => gv, negative: () => Wi, nativeEnum: () => ic, nanoid: () => Ul, nan: () => $c, multipleOf: () => $r, minSize: () => a, minLength: () => nr, mime: () => mr, meta: () => Uc, maxSize: () => gr, maxLength: () => Dr, map: () => rc, mac: () => zl, lte: () => M, lt: () => h, lowercase: () => Ar, looseRecord: () => sl, looseObject: () => hl, locales: () => On, literal: () => vc, length: () => wr, lazy: () => te, ksuid: () => Ol, keyof: () => dl, jwt: () => Wl, json: () => wc, iso: () => Zr, ipv6: () => Pl, ipv4: () => Sl, intersection: () => qg, int64: () => Fl, int32: () => Ql, int: () => Ri, instanceof: () => kc, includes: () => qr, httpUrl: () => bl, hostname: () => Vl, hex: () => Al, hash: () => Kl, guid: () => $l, gte: () => Y, gt: () => y, globalRegistry: () => A, getErrorMap: () => L6, function: () => cc, fromJSONSchema: () => Sc, formatError: () => en, float64: () => Yl, float32: () => ql, flattenError: () => gn, file: () => oc, exactOptional: () => xg, enum: () => lv, endsWith: () => Qr, encodeAsync: () => bg, encode: () => cg, emoji: () => _l, email: () => ul, e164: () => Gl, discriminatedUnion: () => al, describe: () => _c, decodeAsync: () => _g, decode: () => Ig, date: () => Zl, custom: () => bc, cuid2: () => Dl, cuid: () => kl, core: () => ir, config: () => V, coerce: () => ce, codec: () => gc, clone: () => q, cidrv6: () => Jl, cidrv4: () => jl, check: () => Ic, catch: () => sg, boolean: () => Sg, bigint: () => Tl, base64url: () => El, base64: () => Ll, array: () => Xn, any: () => Rl, _function: () => cc, _default: () => Cg, _ZodString: () => xi, ZodXor: () => Vg, ZodXID: () => ai, ZodVoid: () => Wg, ZodUnknown: () => Eg, ZodUnion: () => An, ZodUndefined: () => Pg, ZodUUID: () => p, ZodURL: () => Gn, ZodULID: () => yi, ZodType: () => P, ZodTuple: () => Yg, ZodTransform: () => Mg, ZodTemplateLiteral: () => ve, ZodSymbol: () => zg, ZodSuccess: () => ag, ZodStringFormat: () => G, ZodString: () => Cr, ZodSet: () => Fg, ZodRecord: () => Kn, ZodRealError: () => B, ZodReadonly: () => ne, ZodPromise: () => ue, ZodPrefault: () => fg, ZodPipe: () => _v, ZodOptional: () => Iv, ZodObject: () => Vn, ZodNumberFormat: () => Or, ZodNumber: () => hr, ZodNullable: () => Zg, ZodNull: () => jg, ZodNonOptional: () => bv, ZodNever: () => Gg, ZodNanoID: () => Ci, ZodNaN: () => re, ZodMap: () => Tg, ZodMAC: () => Ng, ZodLiteral: () => Bg, ZodLazy: () => oe, ZodKSUID: () => pi, ZodJWT: () => uv, ZodIssueCode: () => j6, ZodIntersection: () => Kg, ZodISOTime: () => Bi, ZodISODuration: () => Hi, ZodISODateTime: () => Ti, ZodISODate: () => Fi, ZodIPv6: () => rv, ZodIPv4: () => si, ZodGUID: () => jn, ZodFunction: () => $e, ZodFirstPartyTypeKind: () => le, ZodFile: () => Hg, ZodExactOptional: () => Rg, ZodError: () => z6, ZodEnum: () => dr, ZodEmoji: () => di, ZodEmail: () => Zi, ZodE164: () => tv, ZodDiscriminatedUnion: () => Ag, ZodDefault: () => dg, ZodDate: () => Wn, ZodCustomStringFormat: () => fr, ZodCustom: () => qn, ZodCodec: () => Uv, ZodCatch: () => pg, ZodCUID2: () => hi, ZodCUID: () => fi, ZodCIDRv6: () => iv, ZodCIDRv4: () => nv, ZodBoolean: () => yr, ZodBigIntFormat: () => $v, ZodBigInt: () => ar, ZodBase64URL: () => ov, ZodBase64: () => vv, ZodArray: () => Xg, ZodAny: () => Lg, TimePrecision: () => Qu, NEVER: () => Nv, $output: () => Xu, $input: () => Vu, $brand: () => Ov });
44
44
  var ir = {};
@@ -6151,30 +6151,16 @@ Individual style keys are optional - hosts may provide any subset of these value
6151
6151
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
6152
6152
 
6153
6153
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
6154
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);
6155
- g.object({ method: g.literal("ui/open-link"), params: g.object({ url: g.string().describe("URL to open in the host's browser") }) });
6156
- var be = g.object({ isError: g.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), _e = g.object({ isError: g.boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough();
6154
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), B6 = g.object({ method: g.literal("ui/open-link"), params: g.object({ url: g.string().describe("URL to open in the host's browser") }) }), be = g.object({ isError: g.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), _e = g.object({ isError: g.boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough();
6157
6155
  g.object({ method: g.literal("ui/notifications/sandbox-proxy-ready"), params: g.object({}) });
6158
- var kv = g.object({ connectDomains: g.array(g.string()).optional().describe("Origins for network requests (fetch/XHR/WebSocket)."), resourceDomains: g.array(g.string()).optional().describe("Origins for static resources (scripts, images, styles, fonts)."), frameDomains: g.array(g.string()).optional().describe("Origins for nested iframes (frame-src directive)."), baseUriDomains: g.array(g.string()).optional().describe("Allowed base URIs for the document (base-uri directive).") }), Dv = g.object({ camera: g.object({}).optional().describe("Request camera access (Permission Policy `camera` feature)."), microphone: g.object({}).optional().describe("Request microphone access (Permission Policy `microphone` feature)."), geolocation: g.object({}).optional().describe("Request geolocation access (Permission Policy `geolocation` feature)."), clipboardWrite: g.object({}).optional().describe("Request clipboard write access (Permission Policy `clipboard-write` feature).") });
6159
- g.object({ method: g.literal("ui/notifications/size-changed"), params: g.object({ width: g.number().optional().describe("New width in pixels."), height: g.number().optional().describe("New height in pixels.") }) });
6160
- var Ue = g.object({ method: g.literal("ui/notifications/tool-input"), params: g.object({ arguments: g.record(g.string(), g.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.") }) }), ke = g.object({ method: g.literal("ui/notifications/tool-input-partial"), params: g.object({ arguments: g.record(g.string(), g.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") }) }), De = g.object({ method: g.literal("ui/notifications/tool-cancelled"), params: g.object({ reason: g.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").') }) }), Jc = g.object({ fonts: g.string().optional() }), Lc = g.object({ variables: F6.optional().describe("CSS variables for theming the app."), css: Jc.optional().describe("CSS blocks that apps can inject.") }), we = g.object({ method: g.literal("ui/resource-teardown"), params: g.object({}) });
6161
- g.record(g.string(), g.unknown());
6162
- var Ie = g.object({ text: g.object({}).optional().describe("Host supports text content blocks."), image: g.object({}).optional().describe("Host supports image content blocks."), audio: g.object({}).optional().describe("Host supports audio content blocks."), resource: g.object({}).optional().describe("Host supports resource content blocks."), resourceLink: g.object({}).optional().describe("Host supports resource link content blocks."), structuredContent: g.object({}).optional().describe("Host supports structured content.") }), Ec = g.object({ experimental: g.object({}).optional().describe("Experimental features (structure TBD)."), openLinks: g.object({}).optional().describe("Host supports opening external URLs."), serverTools: g.object({ listChanged: g.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: g.object({ listChanged: g.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: g.object({}).optional().describe("Host accepts log messages."), sandbox: g.object({ permissions: Dv.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."), csp: kv.optional().describe("CSP domains approved by the host.") }).optional().describe("Sandbox configuration applied by the host."), updateModelContext: Ie.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: Ie.optional().describe("Host supports receiving content messages (ui/message) from the view.") }), Gc = g.object({ experimental: g.object({}).optional().describe("Experimental features (structure TBD)."), tools: g.object({ listChanged: g.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: g.array(pr).optional().describe("Display modes the app supports.") });
6163
- g.object({ method: g.literal("ui/notifications/initialized"), params: g.object({}).optional() });
6164
- g.object({ csp: kv.optional().describe("Content Security Policy configuration."), permissions: Dv.optional().describe("Sandbox permissions requested by the UI."), domain: g.string().optional().describe("Dedicated origin for view sandbox."), prefersBorder: g.boolean().optional().describe("Visual boundary preference - true if UI prefers a visible border.") });
6165
- g.object({ method: g.literal("ui/request-display-mode"), params: g.object({ mode: pr.describe("The display mode being requested.") }) });
6166
- var Ne = g.object({ mode: pr.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), Wc = g.union([g.literal("model"), g.literal("app")]).describe("Tool visibility scope - who can access the tool.");
6167
- g.object({ resourceUri: g.string().optional(), visibility: g.array(Wc).optional().describe(`Who can access this tool. Default: ["model", "app"]
6156
+ var kv = g.object({ connectDomains: g.array(g.string()).optional().describe("Origins for network requests (fetch/XHR/WebSocket)."), resourceDomains: g.array(g.string()).optional().describe("Origins for static resources (scripts, images, styles, fonts)."), frameDomains: g.array(g.string()).optional().describe("Origins for nested iframes (frame-src directive)."), baseUriDomains: g.array(g.string()).optional().describe("Allowed base URIs for the document (base-uri directive).") }), Dv = g.object({ camera: g.object({}).optional().describe("Request camera access (Permission Policy `camera` feature)."), microphone: g.object({}).optional().describe("Request microphone access (Permission Policy `microphone` feature)."), geolocation: g.object({}).optional().describe("Request geolocation access (Permission Policy `geolocation` feature)."), clipboardWrite: g.object({}).optional().describe("Request clipboard write access (Permission Policy `clipboard-write` feature).") }), M6 = g.object({ method: g.literal("ui/notifications/size-changed"), params: g.object({ width: g.number().optional().describe("New width in pixels."), height: g.number().optional().describe("New height in pixels.") }) }), Ue = g.object({ method: g.literal("ui/notifications/tool-input"), params: g.object({ arguments: g.record(g.string(), g.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.") }) }), ke = g.object({ method: g.literal("ui/notifications/tool-input-partial"), params: g.object({ arguments: g.record(g.string(), g.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") }) }), De = g.object({ method: g.literal("ui/notifications/tool-cancelled"), params: g.object({ reason: g.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").') }) }), Jc = g.object({ fonts: g.string().optional() }), Lc = g.object({ variables: F6.optional().describe("CSS variables for theming the app."), css: Jc.optional().describe("CSS blocks that apps can inject.") }), we = g.object({ method: g.literal("ui/resource-teardown"), params: g.object({}) }), R6 = g.record(g.string(), g.unknown()), Ie = g.object({ text: g.object({}).optional().describe("Host supports text content blocks."), image: g.object({}).optional().describe("Host supports image content blocks."), audio: g.object({}).optional().describe("Host supports audio content blocks."), resource: g.object({}).optional().describe("Host supports resource content blocks."), resourceLink: g.object({}).optional().describe("Host supports resource link content blocks."), structuredContent: g.object({}).optional().describe("Host supports structured content.") }), Ec = g.object({ experimental: g.object({}).optional().describe("Experimental features (structure TBD)."), openLinks: g.object({}).optional().describe("Host supports opening external URLs."), serverTools: g.object({ listChanged: g.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: g.object({ listChanged: g.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: g.object({}).optional().describe("Host accepts log messages."), sandbox: g.object({ permissions: Dv.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."), csp: kv.optional().describe("CSP domains approved by the host.") }).optional().describe("Sandbox configuration applied by the host."), updateModelContext: Ie.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: Ie.optional().describe("Host supports receiving content messages (ui/message) from the view.") }), Gc = g.object({ experimental: g.object({}).optional().describe("Experimental features (structure TBD)."), tools: g.object({ listChanged: g.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: g.array(pr).optional().describe("Display modes the app supports.") }), x6 = g.object({ method: g.literal("ui/notifications/initialized"), params: g.object({}).optional() }), Z6 = g.object({ csp: kv.optional().describe("Content Security Policy configuration."), permissions: Dv.optional().describe("Sandbox permissions requested by the UI."), domain: g.string().optional().describe("Dedicated origin for view sandbox."), prefersBorder: g.boolean().optional().describe("Visual boundary preference - true if UI prefers a visible border.") }), d6 = g.object({ method: g.literal("ui/request-display-mode"), params: g.object({ mode: pr.describe("The display mode being requested.") }) }), Ne = g.object({ mode: pr.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), Wc = g.union([g.literal("model"), g.literal("app")]).describe("Tool visibility scope - who can access the tool."), C6 = g.object({ resourceUri: g.string().optional(), visibility: g.array(Wc).optional().describe(`Who can access this tool. Default: ["model", "app"]
6168
6157
  - "model": Tool visible to and callable by the agent
6169
6158
  - "app": Tool callable by the app from this server only`) });
6170
6159
  g.object({ mimeTypes: g.array(g.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.') });
6171
- g.object({ method: g.literal("ui/message"), params: g.object({ role: g.literal("user").describe('Message role, currently only "user" is supported.'), content: g.array(protocol.ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
6160
+ var f6 = g.object({ method: g.literal("ui/message"), params: g.object({ role: g.literal("user").describe('Message role, currently only "user" is supported.'), content: g.array(protocol.ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
6172
6161
  g.object({ method: g.literal("ui/notifications/sandbox-resource-ready"), params: g.object({ html: g.string().describe("HTML content to load into the inner iframe."), sandbox: g.string().optional().describe("Optional override for the inner iframe's sandbox attribute."), csp: kv.optional().describe("CSP configuration from resource metadata."), permissions: Dv.optional().describe("Sandbox permissions from resource metadata.") }) });
6173
6162
  var Oe = g.object({ method: g.literal("ui/notifications/tool-result"), params: protocol.CallToolResultSchema.describe("Standard MCP tool execution result.") }), Se = g.object({ toolInfo: g.object({ id: protocol.RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: protocol.ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: jc.optional().describe("Current color theme preference."), styles: Lc.optional().describe("Style configuration for theming the app."), displayMode: pr.optional().describe("How the UI is currently displayed."), availableDisplayModes: g.array(pr).optional().describe("Display modes the host supports."), containerDimensions: g.union([g.object({ height: g.number().describe("Fixed container height in pixels.") }), g.object({ maxHeight: g.union([g.number(), g.undefined()]).optional().describe("Maximum container height in pixels.") })]).and(g.union([g.object({ width: g.number().describe("Fixed container width in pixels.") }), g.object({ maxWidth: g.union([g.number(), g.undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
6174
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`), locale: g.string().optional().describe("User's language and region preference in BCP 47 format."), timeZone: g.string().optional().describe("User's timezone in IANA format."), userAgent: g.string().optional().describe("Host application identifier."), platform: g.union([g.literal("web"), g.literal("desktop"), g.literal("mobile")]).optional().describe("Platform type for responsive design decisions."), deviceCapabilities: g.object({ touch: g.boolean().optional().describe("Whether the device supports touch input."), hover: g.boolean().optional().describe("Whether the device supports hover interactions.") }).optional().describe("Device input capabilities."), safeAreaInsets: g.object({ top: g.number().describe("Top safe area inset in pixels."), right: g.number().describe("Right safe area inset in pixels."), bottom: g.number().describe("Bottom safe area inset in pixels."), left: g.number().describe("Left safe area inset in pixels.") }).optional().describe("Mobile safe area boundaries in pixels.") }).passthrough(), ze = g.object({ method: g.literal("ui/notifications/host-context-changed"), params: Se.describe("Partial context update containing only changed fields.") });
6175
- g.object({ method: g.literal("ui/update-model-context"), params: g.object({ content: g.array(protocol.ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: g.record(g.string(), g.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) });
6176
- g.object({ method: g.literal("ui/initialize"), params: g.object({ appInfo: protocol.ImplementationSchema.describe("App identification (name and version)."), appCapabilities: Gc.describe("Features and capabilities this app provides."), protocolVersion: g.string().describe("Protocol version this app supports.") }) });
6177
- var Pe = g.object({ protocolVersion: g.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: protocol.ImplementationSchema.describe("Host application identification and version."), hostCapabilities: Ec.describe("Features and capabilities provided by the host."), hostContext: Se.describe("Rich context about the host environment.") }).passthrough();
6163
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`), locale: g.string().optional().describe("User's language and region preference in BCP 47 format."), timeZone: g.string().optional().describe("User's timezone in IANA format."), userAgent: g.string().optional().describe("Host application identifier."), platform: g.union([g.literal("web"), g.literal("desktop"), g.literal("mobile")]).optional().describe("Platform type for responsive design decisions."), deviceCapabilities: g.object({ touch: g.boolean().optional().describe("Whether the device supports touch input."), hover: g.boolean().optional().describe("Whether the device supports hover interactions.") }).optional().describe("Device input capabilities."), safeAreaInsets: g.object({ top: g.number().describe("Top safe area inset in pixels."), right: g.number().describe("Right safe area inset in pixels."), bottom: g.number().describe("Bottom safe area inset in pixels."), left: g.number().describe("Left safe area inset in pixels.") }).optional().describe("Mobile safe area boundaries in pixels.") }).passthrough(), ze = g.object({ method: g.literal("ui/notifications/host-context-changed"), params: Se.describe("Partial context update containing only changed fields.") }), y6 = g.object({ method: g.literal("ui/update-model-context"), params: g.object({ content: g.array(protocol.ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: g.record(g.string(), g.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) }), a6 = g.object({ method: g.literal("ui/initialize"), params: g.object({ appInfo: protocol.ImplementationSchema.describe("App identification (name and version)."), appCapabilities: Gc.describe("Features and capabilities this app provides."), protocolVersion: g.string().describe("Protocol version this app supports.") }) }), Pe = g.object({ protocolVersion: g.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: protocol.ImplementationSchema.describe("Host application identification and version."), hostCapabilities: Ec.describe("Features and capabilities provided by the host."), hostContext: Se.describe("Rich context about the host environment.") }).passthrough();
6178
6164
  function p6() {
6179
6165
  let r = document.documentElement.getAttribute("data-theme");
6180
6166
  if (r === "dark" || r === "light") return r;
@@ -6371,14 +6357,57 @@ function useApp() {
6371
6357
  return React.useContext(AppContext).app;
6372
6358
  }
6373
6359
  exports.AppProvider = AppProvider;
6360
+ exports.B6 = B6;
6361
+ exports.Bc = Bc;
6374
6362
  exports.Bk = Bk;
6363
+ exports.C6 = C6;
6364
+ exports.Cc = Cc;
6365
+ exports.De = De;
6366
+ exports.Dv = Dv;
6367
+ exports.Ec = Ec;
6368
+ exports.Fc = Fc;
6375
6369
  exports.Fk = Fk;
6370
+ exports.Gc = Gc;
6371
+ exports.Hc = Hc;
6372
+ exports.Ie = Ie;
6373
+ exports.Jc = Jc;
6374
+ exports.Lc = Lc;
6375
+ exports.M6 = M6;
6376
+ exports.Mc = Mc;
6377
+ exports.Ne = Ne;
6378
+ exports.Oe = Oe;
6379
+ exports.Pe = Pe;
6380
+ exports.Qc = Qc;
6381
+ exports.R6 = R6;
6382
+ exports.Rc = Rc;
6383
+ exports.Se = Se;
6384
+ exports.Ue = Ue;
6385
+ exports.Wc = Wc;
6386
+ exports.Yc = Yc;
6376
6387
  exports.Yn = Yn;
6388
+ exports.Z6 = Z6;
6389
+ exports.Zc = Zc;
6390
+ exports._e = _e;
6391
+ exports.a6 = a6;
6392
+ exports.be = be;
6393
+ exports.d6 = d6;
6394
+ exports.dc = dc;
6395
+ exports.f6 = f6;
6396
+ exports.fc = fc;
6377
6397
  exports.gb = gb;
6398
+ exports.jc = jc;
6399
+ exports.ke = ke;
6400
+ exports.kv = kv;
6378
6401
  exports.nb = nb;
6379
6402
  exports.p6 = p6;
6403
+ exports.pr = pr;
6380
6404
  exports.rb = rb;
6381
6405
  exports.s6 = s6;
6382
6406
  exports.useApp = useApp;
6407
+ exports.we = we;
6383
6408
  exports.wv = wv;
6384
- //# sourceMappingURL=use-app-BnoSPiUT.cjs.map
6409
+ exports.x6 = x6;
6410
+ exports.xc = xc;
6411
+ exports.y6 = y6;
6412
+ exports.ze = ze;
6413
+ //# sourceMappingURL=use-app-BpAJqzdE.cjs.map