sunpeak 0.15.4 → 0.16.1

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 (98) hide show
  1. package/README.md +51 -48
  2. package/bin/commands/build.mjs +13 -4
  3. package/bin/commands/dev.mjs +64 -19
  4. package/bin/commands/new.mjs +13 -3
  5. package/bin/lib/extract-resource.mjs +1 -1
  6. package/bin/lib/extract-tool.mjs +78 -0
  7. package/bin/lib/patterns.mjs +2 -26
  8. package/dist/chatgpt/index.cjs +3 -6
  9. package/dist/chatgpt/index.cjs.map +1 -1
  10. package/dist/chatgpt/index.d.ts +1 -1
  11. package/dist/chatgpt/index.js +6 -9
  12. package/dist/claude/index.cjs +1 -1
  13. package/dist/claude/index.js +1 -1
  14. package/dist/discovery-CH80W5l9.js +217 -0
  15. package/dist/discovery-CH80W5l9.js.map +1 -0
  16. package/dist/discovery-DmB8_4QL.cjs +216 -0
  17. package/dist/discovery-DmB8_4QL.cjs.map +1 -0
  18. package/dist/{index-CutQgPzR.js → index-BjnAsaqp.js} +3 -6
  19. package/dist/index-BjnAsaqp.js.map +1 -0
  20. package/dist/{index-Cngntkp2.cjs → index-BvQ_ZuOO.cjs} +3 -6
  21. package/dist/{index-Cngntkp2.cjs.map → index-BvQ_ZuOO.cjs.map} +1 -1
  22. package/dist/{index-B0dxRJvS.cjs → index-C9CVbGFt.cjs} +3 -6
  23. package/dist/index-C9CVbGFt.cjs.map +1 -0
  24. package/dist/{index-Ce_5ZIdJ.js → index-CTGEqlgk.js} +3 -6
  25. package/dist/{index-Ce_5ZIdJ.js.map → index-CTGEqlgk.js.map} +1 -1
  26. package/dist/index.cjs +48 -5
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +3 -0
  29. package/dist/index.js +3404 -3361
  30. package/dist/index.js.map +1 -1
  31. package/dist/lib/discovery-cli.cjs +58 -5
  32. package/dist/lib/discovery-cli.cjs.map +1 -1
  33. package/dist/lib/discovery-cli.d.ts +3 -2
  34. package/dist/lib/discovery-cli.js +61 -8
  35. package/dist/lib/discovery-cli.js.map +1 -1
  36. package/dist/lib/discovery.d.ts +42 -43
  37. package/dist/lib/extract-tool.d.ts +12 -0
  38. package/dist/mcp/favicon.d.ts +1 -1
  39. package/dist/mcp/index.cjs +3 -2
  40. package/dist/mcp/index.cjs.map +1 -1
  41. package/dist/mcp/index.d.ts +1 -1
  42. package/dist/mcp/index.js +3 -2
  43. package/dist/mcp/index.js.map +1 -1
  44. package/dist/mcp/types.d.ts +24 -1
  45. package/dist/platform/chatgpt/index.cjs +1 -1
  46. package/dist/platform/chatgpt/index.js +1 -1
  47. package/dist/simulator/index.cjs +2 -5
  48. package/dist/simulator/index.cjs.map +1 -1
  49. package/dist/simulator/index.d.ts +1 -1
  50. package/dist/simulator/index.js +5 -8
  51. package/dist/simulator/simulator-url.d.ts +9 -9
  52. package/dist/{simulator-DcfQBRXE.cjs → simulator-B56j5P8W.cjs} +8 -2
  53. package/dist/{simulator-DcfQBRXE.cjs.map → simulator-B56j5P8W.cjs.map} +1 -1
  54. package/dist/{simulator-CxrtnguM.js → simulator-C0H_k092.js} +8 -2
  55. package/dist/{simulator-CxrtnguM.js.map → simulator-C0H_k092.js.map} +1 -1
  56. package/dist/simulator-url-CuLqtnSS.js.map +1 -1
  57. package/dist/simulator-url-rgg_KYOg.cjs.map +1 -1
  58. package/dist/types/resource-config.d.ts +7 -5
  59. package/dist/{use-app-D_TeaMFG.js → use-app-BThbgFFT.js} +51 -22
  60. package/dist/{use-app-D_TeaMFG.js.map → use-app-BThbgFFT.js.map} +1 -1
  61. package/dist/{use-app-BnoSPiUT.cjs → use-app-BuufpXTQ.cjs} +49 -20
  62. package/dist/{use-app-BnoSPiUT.cjs.map → use-app-BuufpXTQ.cjs.map} +1 -1
  63. package/package.json +1 -1
  64. package/template/.sunpeak/dev.tsx +8 -4
  65. package/template/.sunpeak/resource-loader.tsx +2 -1
  66. package/template/README.md +14 -10
  67. package/template/package.json +2 -1
  68. package/template/src/resources/albums/{albums-resource.test.tsx → albums.test.tsx} +1 -1
  69. package/template/src/resources/albums/{albums-resource.tsx → albums.tsx} +0 -1
  70. package/template/src/resources/carousel/{carousel-resource.test.tsx → carousel.test.tsx} +1 -1
  71. package/template/src/resources/carousel/{carousel-resource.tsx → carousel.tsx} +0 -1
  72. package/template/src/resources/index.ts +4 -4
  73. package/template/src/resources/map/{map-resource.test.tsx → map.test.tsx} +1 -1
  74. package/template/src/resources/map/{map-resource.tsx → map.tsx} +0 -1
  75. package/template/src/resources/review/{review-resource.test.tsx → review.test.tsx} +1 -1
  76. package/template/src/resources/review/{review-resource.tsx → review.tsx} +1 -2
  77. package/template/src/server.ts +15 -0
  78. package/template/src/tools/review-diff.ts +24 -0
  79. package/template/src/tools/review-post.ts +26 -0
  80. package/template/src/tools/review-purchase.ts +31 -0
  81. package/template/src/tools/show-albums.ts +22 -0
  82. package/template/src/tools/show-carousel.ts +25 -0
  83. package/template/src/tools/show-map.ts +29 -0
  84. package/template/tests/e2e/albums.spec.ts +6 -6
  85. package/template/tests/e2e/carousel.spec.ts +6 -6
  86. package/template/tests/e2e/map.spec.ts +11 -11
  87. package/template/tests/simulations/{review/review-diff-simulation.json → review-diff.json} +1 -31
  88. package/template/tests/simulations/{review/review-post-simulation.json → review-post.json} +1 -37
  89. package/template/tests/simulations/{review/review-purchase-simulation.json → review-purchase.json} +1 -38
  90. package/template/tests/simulations/{albums/albums-show-simulation.json → show-albums.json} +1 -24
  91. package/template/tests/simulations/{carousel/carousel-show-simulation.json → show-carousel.json} +1 -24
  92. package/template/tests/simulations/{map/map-show-simulation.json → show-map.json} +1 -35
  93. package/dist/discovery-CRR3SlyI.cjs +0 -156
  94. package/dist/discovery-CRR3SlyI.cjs.map +0 -1
  95. package/dist/discovery-DzV3HLXs.js +0 -157
  96. package/dist/discovery-DzV3HLXs.js.map +0 -1
  97. package/dist/index-B0dxRJvS.cjs.map +0 -1
  98. 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;
@@ -37,7 +37,7 @@ class Yn {
37
37
  sessionId;
38
38
  setProtocolVersion;
39
39
  }
40
- var wv = "2026-01-26";
40
+ 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";
41
41
  var g = {};
42
42
  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 });
43
43
  var ir = {};
@@ -6150,30 +6150,16 @@ Individual style keys are optional - hosts may provide any subset of these value
6150
6150
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
6151
6151
 
6152
6152
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
6153
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);
6154
- g.object({ method: g.literal("ui/open-link"), params: g.object({ url: g.string().describe("URL to open in the host's browser") }) });
6155
- 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();
6153
+ 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();
6156
6154
  g.object({ method: g.literal("ui/notifications/sandbox-proxy-ready"), params: g.object({}) });
6157
- 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).") });
6158
- 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.") }) });
6159
- 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({}) });
6160
- g.record(g.string(), g.unknown());
6161
- 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.") });
6162
- g.object({ method: g.literal("ui/notifications/initialized"), params: g.object({}).optional() });
6163
- 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.") });
6164
- g.object({ method: g.literal("ui/request-display-mode"), params: g.object({ mode: pr.describe("The display mode being requested.") }) });
6165
- 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.");
6166
- g.object({ resourceUri: g.string().optional(), visibility: g.array(Wc).optional().describe(`Who can access this tool. Default: ["model", "app"]
6155
+ 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"]
6167
6156
  - "model": Tool visible to and callable by the agent
6168
6157
  - "app": Tool callable by the app from this server only`) });
6169
6158
  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.') });
6170
- 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(ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
6159
+ 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(ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
6171
6160
  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.") }) });
6172
6161
  var Oe = g.object({ method: g.literal("ui/notifications/tool-result"), params: CallToolResultSchema.describe("Standard MCP tool execution result.") }), Se = g.object({ toolInfo: g.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: 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
6173
- 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.") });
6174
- g.object({ method: g.literal("ui/update-model-context"), params: g.object({ content: g.array(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.") }) });
6175
- g.object({ method: g.literal("ui/initialize"), params: g.object({ appInfo: 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.") }) });
6176
- var Pe = g.object({ protocolVersion: g.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: 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();
6162
+ 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(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: 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: 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();
6177
6163
  function p6() {
6178
6164
  let r = document.documentElement.getAttribute("data-theme");
6179
6165
  if (r === "dark" || r === "light") return r;
@@ -6370,16 +6356,59 @@ function useApp() {
6370
6356
  return useContext(AppContext).app;
6371
6357
  }
6372
6358
  export {
6373
- AppProvider as A,
6359
+ AppProvider as $,
6360
+ R6 as A,
6374
6361
  Bk as B,
6362
+ Cc as C,
6363
+ De as D,
6364
+ Ec as E,
6375
6365
  Fk as F,
6366
+ Gc as G,
6367
+ Hc as H,
6368
+ kv as I,
6369
+ Jc as J,
6370
+ Dv as K,
6371
+ Lc as L,
6372
+ Mc as M,
6373
+ Ne as N,
6374
+ Oe as O,
6375
+ Pe as P,
6376
+ Qc as Q,
6377
+ Rc as R,
6378
+ Se as S,
6379
+ Z6 as T,
6380
+ Ue as U,
6381
+ C6 as V,
6382
+ Wc as W,
6383
+ Ie as X,
6376
6384
  Yn as Y,
6385
+ Zc as Z,
6386
+ _e as _,
6387
+ Yc as a,
6388
+ Fc as b,
6389
+ Bc as c,
6390
+ dc as d,
6391
+ pr as e,
6392
+ fc as f,
6377
6393
  gb as g,
6394
+ a6 as h,
6395
+ x6 as i,
6396
+ jc as j,
6397
+ ke as k,
6398
+ M6 as l,
6399
+ B6 as m,
6378
6400
  nb as n,
6401
+ be as o,
6379
6402
  p6 as p,
6403
+ f6 as q,
6380
6404
  rb as r,
6381
6405
  s6 as s,
6406
+ d6 as t,
6382
6407
  useApp as u,
6383
- wv as w
6408
+ we as v,
6409
+ wv as w,
6410
+ xc as x,
6411
+ y6 as y,
6412
+ ze as z
6384
6413
  };
6385
- //# sourceMappingURL=use-app-D_TeaMFG.js.map
6414
+ //# sourceMappingURL=use-app-BThbgFFT.js.map