sunpeak 0.19.2 → 0.19.4

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 (65) hide show
  1. package/dist/chatgpt/index.cjs +1 -1
  2. package/dist/chatgpt/index.js +1 -1
  3. package/dist/claude/index.cjs +1 -1
  4. package/dist/claude/index.js +1 -1
  5. package/dist/host/chatgpt/index.cjs +1 -1
  6. package/dist/host/chatgpt/index.js +1 -1
  7. package/dist/index.cjs +134 -124
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +3 -1
  10. package/dist/index.js +71 -62
  11. package/dist/index.js.map +1 -1
  12. package/dist/inspector/index.cjs +1 -1
  13. package/dist/inspector/index.js +1 -1
  14. package/dist/{inspector-Cdo5BK2D.js → inspector-Bp9jrHIu.js} +218 -80
  15. package/dist/inspector-Bp9jrHIu.js.map +1 -0
  16. package/dist/{inspector-8nPV2A-z.cjs → inspector-Cvq3yjNL.cjs} +219 -81
  17. package/dist/inspector-Cvq3yjNL.cjs.map +1 -0
  18. package/dist/mcp/index.cjs +235 -138
  19. package/dist/mcp/index.cjs.map +1 -1
  20. package/dist/mcp/index.d.ts +1 -1
  21. package/dist/mcp/index.js +228 -132
  22. package/dist/mcp/index.js.map +1 -1
  23. package/dist/mcp/production-server.d.ts +31 -0
  24. package/dist/{protocol-C7kTcBr_.cjs → protocol-C8pFDmcy.cjs} +8194 -8187
  25. package/dist/protocol-C8pFDmcy.cjs.map +1 -0
  26. package/dist/{protocol-BfAACnv0.js → protocol-CRqiPTLT.js} +8186 -8185
  27. package/dist/protocol-CRqiPTLT.js.map +1 -0
  28. package/dist/{use-app-CfP9VypY.js → use-app-Ck5kR1Sf.js} +193 -93
  29. package/dist/use-app-Ck5kR1Sf.js.map +1 -0
  30. package/dist/{use-app-CzcYw1Kz.cjs → use-app-DHYiev3D.cjs} +253 -147
  31. package/dist/use-app-DHYiev3D.cjs.map +1 -0
  32. package/package.json +2 -2
  33. package/template/dist/albums/albums.html +15 -15
  34. package/template/dist/albums/albums.json +1 -1
  35. package/template/dist/carousel/carousel.html +19 -19
  36. package/template/dist/carousel/carousel.json +1 -1
  37. package/template/dist/map/map.html +14 -14
  38. package/template/dist/map/map.json +1 -1
  39. package/template/dist/review/review.html +11 -11
  40. package/template/dist/review/review.json +1 -1
  41. package/template/node_modules/.vite/deps/_metadata.json +3 -3
  42. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +192 -91
  43. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  44. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +231 -92
  45. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  46. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +208 -105
  47. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  48. package/template/node_modules/.vite-mcp/deps/_metadata.json +24 -24
  49. package/template/node_modules/.vite-mcp/deps/{protocol-B_qKkui_.js → protocol-BqGB4zBx.js} +45 -45
  50. package/template/node_modules/.vite-mcp/deps/protocol-BqGB4zBx.js.map +1 -0
  51. package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-chatgpt-darwin.png +0 -0
  52. package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-claude-darwin.png +0 -0
  53. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-chatgpt-darwin.png +0 -0
  54. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-darwin.png +0 -0
  55. package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-chatgpt-darwin.png +0 -0
  56. package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-claude-darwin.png +0 -0
  57. package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-chatgpt-darwin.png +0 -0
  58. package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-claude-darwin.png +0 -0
  59. package/dist/inspector-8nPV2A-z.cjs.map +0 -1
  60. package/dist/inspector-Cdo5BK2D.js.map +0 -1
  61. package/dist/protocol-BfAACnv0.js.map +0 -1
  62. package/dist/protocol-C7kTcBr_.cjs.map +0 -1
  63. package/dist/use-app-CfP9VypY.js.map +0 -1
  64. package/dist/use-app-CzcYw1Kz.cjs.map +0 -1
  65. package/template/node_modules/.vite-mcp/deps/protocol-B_qKkui_.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-9hOWP6kD.cjs");
2
- const require_protocol = require("./protocol-C7kTcBr_.cjs");
2
+ const require_protocol = require("./protocol-C8pFDmcy.cjs");
3
3
  let react = require("react");
4
4
  react = require_chunk.__toESM(react);
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -809,12 +809,68 @@ registerHostShell({
809
809
  }`
810
810
  });
811
811
  //#endregion
812
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.3.2_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_38e5f6c50a4ca9cf3f1dffc73a60c951/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
813
- var G = "2026-01-26", m = require_protocol.union([require_protocol.literal("light"), require_protocol.literal("dark")]).describe("Color theme preference for the host environment."), W = require_protocol.union([
812
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.5.0_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_f4871531d9cf52c692eb6edc1ee416ef/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
813
+ var j = class extends require_protocol.Protocol {
814
+ _registeredMethods = /* @__PURE__ */ new Set();
815
+ _eventSlots = /* @__PURE__ */ new Map();
816
+ onEventDispatch(X, Y) {}
817
+ _ensureEventSlot(X) {
818
+ let Y = this._eventSlots.get(X);
819
+ if (!Y) {
820
+ let Z = this.eventSchemas[X];
821
+ if (!Z) throw Error(`Unknown event: ${String(X)}`);
822
+ Y = { listeners: [] }, this._eventSlots.set(X, Y);
823
+ let $ = Z.shape.method.value;
824
+ this._registeredMethods.add($);
825
+ let J = Y;
826
+ super.setNotificationHandler(Z, (K) => {
827
+ let N = K.params;
828
+ this.onEventDispatch(X, N), J.onHandler?.(N);
829
+ for (let W of [...J.listeners]) W(N);
830
+ });
831
+ }
832
+ return Y;
833
+ }
834
+ setEventHandler(X, Y) {
835
+ let Z = this._ensureEventSlot(X);
836
+ if (Z.onHandler && Y) console.warn(`[MCP Apps] on${String(X)} handler replaced. Use addEventListener("${String(X)}", …) to add multiple listeners without replacing.`);
837
+ Z.onHandler = Y;
838
+ }
839
+ getEventHandler(X) {
840
+ return this._eventSlots.get(X)?.onHandler;
841
+ }
842
+ addEventListener(X, Y) {
843
+ this._ensureEventSlot(X).listeners.push(Y);
844
+ }
845
+ removeEventListener(X, Y) {
846
+ let Z = this._eventSlots.get(X);
847
+ if (!Z) return;
848
+ let $ = Z.listeners.indexOf(Y);
849
+ if ($ !== -1) Z.listeners.splice($, 1);
850
+ }
851
+ setRequestHandler = (X, Y) => {
852
+ this._assertMethodNotRegistered(X, "setRequestHandler"), super.setRequestHandler(X, Y);
853
+ };
854
+ setNotificationHandler = (X, Y) => {
855
+ this._assertMethodNotRegistered(X, "setNotificationHandler"), super.setNotificationHandler(X, Y);
856
+ };
857
+ warnIfRequestHandlerReplaced(X, Y, Z) {
858
+ if (Y && Z) console.warn(`[MCP Apps] ${X} handler replaced. Previous handler will no longer be called.`);
859
+ }
860
+ replaceRequestHandler = (X, Y) => {
861
+ let Z = X.shape.method.value;
862
+ this._registeredMethods.add(Z), super.setRequestHandler(X, Y);
863
+ };
864
+ _assertMethodNotRegistered(X, Y) {
865
+ let Z = X.shape.method.value;
866
+ if (this._registeredMethods.has(Z)) throw Error(`Handler for "${Z}" already registered (via ${Y}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);
867
+ this._registeredMethods.add(Z);
868
+ }
869
+ }, G = "2026-01-26", p = require_protocol.union([require_protocol.literal("light"), require_protocol.literal("dark")]).describe("Color theme preference for the host environment."), D = require_protocol.union([
814
870
  require_protocol.literal("inline"),
815
871
  require_protocol.literal("fullscreen"),
816
872
  require_protocol.literal("pip")
817
- ]).describe("Display mode for UI presentation."), _Q = require_protocol.union([
873
+ ]).describe("Display mode for UI presentation."), IQ = require_protocol.union([
818
874
  require_protocol.literal("--color-background-primary"),
819
875
  require_protocol.literal("--color-background-secondary"),
820
876
  require_protocol.literal("--color-background-tertiary"),
@@ -891,7 +947,7 @@ var G = "2026-01-26", m = require_protocol.union([require_protocol.literal("ligh
891
947
  require_protocol.literal("--shadow-sm"),
892
948
  require_protocol.literal("--shadow-md"),
893
949
  require_protocol.literal("--shadow-lg")
894
- ]).describe("CSS variable keys available to MCP apps for theming."), OQ = require_protocol.record(_Q.describe(`Style variables for theming MCP apps.
950
+ ]).describe("CSS variable keys available to MCP apps for theming."), AQ = require_protocol.record(IQ.describe(`Style variables for theming MCP apps.
895
951
 
896
952
  Individual style keys are optional - hosts may provide any subset of these values.
897
953
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -909,17 +965,17 @@ Individual style keys are optional - hosts may provide any subset of these value
909
965
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
910
966
 
911
967
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
912
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), V = require_protocol.object({
968
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), A = require_protocol.object({
913
969
  method: require_protocol.literal("ui/open-link"),
914
970
  params: require_protocol.object({ url: require_protocol.string().describe("URL to open in the host's browser") })
915
971
  });
916
972
  require_protocol.object({ isError: require_protocol.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough();
917
973
  require_protocol.object({ isError: require_protocol.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough();
918
974
  require_protocol.object({ isError: require_protocol.boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough();
919
- var L = require_protocol.object({
975
+ var T = require_protocol.object({
920
976
  method: require_protocol.literal("ui/notifications/sandbox-proxy-ready"),
921
977
  params: require_protocol.object({})
922
- }), N = require_protocol.object({
978
+ }), B = require_protocol.object({
923
979
  connectDomains: require_protocol.array(require_protocol.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
924
980
 
925
981
  - Maps to CSP \`connect-src\` directive
@@ -927,12 +983,12 @@ var L = require_protocol.object({
927
983
  resourceDomains: require_protocol.array(require_protocol.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),
928
984
  frameDomains: require_protocol.array(require_protocol.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),
929
985
  baseUriDomains: require_protocol.array(require_protocol.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")
930
- }), j = require_protocol.object({
986
+ }), E = require_protocol.object({
931
987
  camera: require_protocol.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),
932
988
  microphone: require_protocol.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),
933
989
  geolocation: require_protocol.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),
934
990
  clipboardWrite: require_protocol.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")
935
- }), P = require_protocol.object({
991
+ }), w = require_protocol.object({
936
992
  method: require_protocol.literal("ui/notifications/size-changed"),
937
993
  params: require_protocol.object({
938
994
  width: require_protocol.number().optional().describe("New width in pixels."),
@@ -951,25 +1007,25 @@ require_protocol.object({
951
1007
  method: require_protocol.literal("ui/notifications/tool-cancelled"),
952
1008
  params: require_protocol.object({ reason: require_protocol.string().optional().describe("Optional reason for the cancellation (e.g., \"user action\", \"timeout\").") })
953
1009
  });
954
- var p = require_protocol.object({ fonts: require_protocol.string().optional() }), c = require_protocol.object({
955
- variables: OQ.optional().describe("CSS variables for theming the app."),
956
- css: p.optional().describe("CSS blocks that apps can inject.")
1010
+ var n = require_protocol.object({ fonts: require_protocol.string().optional() }), c = require_protocol.object({
1011
+ variables: AQ.optional().describe("CSS variables for theming the app."),
1012
+ css: n.optional().describe("CSS blocks that apps can inject.")
957
1013
  });
958
1014
  require_protocol.object({
959
1015
  method: require_protocol.literal("ui/resource-teardown"),
960
1016
  params: require_protocol.object({})
961
1017
  });
962
- var H = require_protocol.record(require_protocol.string(), require_protocol.unknown()), O = require_protocol.object({
1018
+ var g = require_protocol.record(require_protocol.string(), require_protocol.unknown()), I = require_protocol.object({
963
1019
  text: require_protocol.object({}).optional().describe("Host supports text content blocks."),
964
1020
  image: require_protocol.object({}).optional().describe("Host supports image content blocks."),
965
1021
  audio: require_protocol.object({}).optional().describe("Host supports audio content blocks."),
966
1022
  resource: require_protocol.object({}).optional().describe("Host supports resource content blocks."),
967
1023
  resourceLink: require_protocol.object({}).optional().describe("Host supports resource link content blocks."),
968
1024
  structuredContent: require_protocol.object({}).optional().describe("Host supports structured content.")
969
- }), M = require_protocol.object({
1025
+ }), C = require_protocol.object({
970
1026
  method: require_protocol.literal("ui/notifications/request-teardown"),
971
1027
  params: require_protocol.object({}).optional()
972
- }), n = require_protocol.object({
1028
+ }), r = require_protocol.object({
973
1029
  experimental: require_protocol.object({}).optional().describe("Experimental features (structure TBD)."),
974
1030
  openLinks: require_protocol.object({}).optional().describe("Host supports opening external URLs."),
975
1031
  downloadFile: require_protocol.object({}).optional().describe("Host supports file downloads via ui/download-file."),
@@ -977,22 +1033,22 @@ var H = require_protocol.record(require_protocol.string(), require_protocol.unkn
977
1033
  serverResources: require_protocol.object({ listChanged: require_protocol.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."),
978
1034
  logging: require_protocol.object({}).optional().describe("Host accepts log messages."),
979
1035
  sandbox: require_protocol.object({
980
- permissions: j.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),
981
- csp: N.optional().describe("CSP domains approved by the host.")
1036
+ permissions: E.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),
1037
+ csp: B.optional().describe("CSP domains approved by the host.")
982
1038
  }).optional().describe("Sandbox configuration applied by the host."),
983
- updateModelContext: O.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
984
- message: O.optional().describe("Host supports receiving content messages (ui/message) from the view.")
985
- }), i = require_protocol.object({
1039
+ updateModelContext: I.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
1040
+ message: I.optional().describe("Host supports receiving content messages (ui/message) from the view.")
1041
+ }), l = require_protocol.object({
986
1042
  experimental: require_protocol.object({}).optional().describe("Experimental features (structure TBD)."),
987
1043
  tools: require_protocol.object({ listChanged: require_protocol.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."),
988
- availableDisplayModes: require_protocol.array(W).optional().describe("Display modes the app supports.")
989
- }), v = require_protocol.object({
1044
+ availableDisplayModes: require_protocol.array(D).optional().describe("Display modes the app supports.")
1045
+ }), S = require_protocol.object({
990
1046
  method: require_protocol.literal("ui/notifications/initialized"),
991
1047
  params: require_protocol.object({}).optional()
992
1048
  });
993
1049
  require_protocol.object({
994
- csp: N.optional().describe("Content Security Policy configuration for UI resources."),
995
- permissions: j.optional().describe("Sandbox permissions requested by the UI resource."),
1050
+ csp: B.optional().describe("Content Security Policy configuration for UI resources."),
1051
+ permissions: E.optional().describe("Sandbox permissions requested by the UI resource."),
996
1052
  domain: require_protocol.string().optional().describe(`Dedicated origin for view sandbox.
997
1053
 
998
1054
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
@@ -1010,23 +1066,23 @@ Boolean requesting whether a visible border and background is provided by the ho
1010
1066
  - \`false\`: request no visible border + background
1011
1067
  - omitted: host decides border`)
1012
1068
  });
1013
- var E = require_protocol.object({
1069
+ var _ = require_protocol.object({
1014
1070
  method: require_protocol.literal("ui/request-display-mode"),
1015
- params: require_protocol.object({ mode: W.describe("The display mode being requested.") })
1071
+ params: require_protocol.object({ mode: D.describe("The display mode being requested.") })
1016
1072
  });
1017
- require_protocol.object({ mode: W.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
1018
- var l = require_protocol.union([require_protocol.literal("model"), require_protocol.literal("app")]).describe("Tool visibility scope - who can access the tool.");
1073
+ require_protocol.object({ mode: D.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
1074
+ var o = require_protocol.union([require_protocol.literal("model"), require_protocol.literal("app")]).describe("Tool visibility scope - who can access the tool.");
1019
1075
  require_protocol.object({
1020
1076
  resourceUri: require_protocol.string().optional(),
1021
- visibility: require_protocol.array(l).optional().describe(`Who can access this tool. Default: ["model", "app"]
1077
+ visibility: require_protocol.array(o).optional().describe(`Who can access this tool. Default: ["model", "app"]
1022
1078
  - "model": Tool visible to and callable by the agent
1023
1079
  - "app": Tool callable by the app from this server only`)
1024
1080
  });
1025
1081
  require_protocol.object({ mimeTypes: require_protocol.array(require_protocol.string()).optional().describe("Array of supported MIME types for UI resources.\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.") });
1026
- var C = require_protocol.object({
1082
+ var f = require_protocol.object({
1027
1083
  method: require_protocol.literal("ui/download-file"),
1028
1084
  params: require_protocol.object({ contents: require_protocol.array(require_protocol.union([require_protocol.EmbeddedResourceSchema, require_protocol.ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") })
1029
- }), S = require_protocol.object({
1085
+ }), y = require_protocol.object({
1030
1086
  method: require_protocol.literal("ui/message"),
1031
1087
  params: require_protocol.object({
1032
1088
  role: require_protocol.literal("user").describe("Message role, currently only \"user\" is supported."),
@@ -1038,23 +1094,23 @@ require_protocol.object({
1038
1094
  params: require_protocol.object({
1039
1095
  html: require_protocol.string().describe("HTML content to load into the inner iframe."),
1040
1096
  sandbox: require_protocol.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),
1041
- csp: N.optional().describe("CSP configuration from resource metadata."),
1042
- permissions: j.optional().describe("Sandbox permissions from resource metadata.")
1097
+ csp: B.optional().describe("CSP configuration from resource metadata."),
1098
+ permissions: E.optional().describe("Sandbox permissions from resource metadata.")
1043
1099
  })
1044
1100
  });
1045
1101
  require_protocol.object({
1046
1102
  method: require_protocol.literal("ui/notifications/tool-result"),
1047
1103
  params: require_protocol.CallToolResultSchema.describe("Standard MCP tool execution result.")
1048
1104
  });
1049
- var y = require_protocol.object({
1105
+ var x = require_protocol.object({
1050
1106
  toolInfo: require_protocol.object({
1051
1107
  id: require_protocol.RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."),
1052
1108
  tool: require_protocol.ToolSchema.describe("Tool definition including name, inputSchema, etc.")
1053
1109
  }).optional().describe("Metadata of the tool call that instantiated this App."),
1054
- theme: m.optional().describe("Current color theme preference."),
1110
+ theme: p.optional().describe("Current color theme preference."),
1055
1111
  styles: c.optional().describe("Style configuration for theming the app."),
1056
- displayMode: W.optional().describe("How the UI is currently displayed."),
1057
- availableDisplayModes: require_protocol.array(W).optional().describe("Display modes the host supports."),
1112
+ displayMode: D.optional().describe("How the UI is currently displayed."),
1113
+ availableDisplayModes: require_protocol.array(D).optional().describe("Display modes the host supports."),
1058
1114
  containerDimensions: require_protocol.union([require_protocol.object({ height: require_protocol.number().describe("Fixed container height in pixels.") }), require_protocol.object({ maxHeight: require_protocol.union([require_protocol.number(), require_protocol._undefined()]).optional().describe("Maximum container height in pixels.") })]).and(require_protocol.union([require_protocol.object({ width: require_protocol.number().describe("Fixed container width in pixels.") }), require_protocol.object({ maxWidth: require_protocol.union([require_protocol.number(), require_protocol._undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
1059
1115
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),
1060
1116
  locale: require_protocol.string().optional().describe("User's language and region preference in BCP 47 format."),
@@ -1078,29 +1134,29 @@ container holding the app. Specify either width or maxWidth, and either height o
1078
1134
  }).passthrough();
1079
1135
  require_protocol.object({
1080
1136
  method: require_protocol.literal("ui/notifications/host-context-changed"),
1081
- params: y.describe("Partial context update containing only changed fields.")
1137
+ params: x.describe("Partial context update containing only changed fields.")
1082
1138
  });
1083
- var f = require_protocol.object({
1139
+ var d = require_protocol.object({
1084
1140
  method: require_protocol.literal("ui/update-model-context"),
1085
1141
  params: require_protocol.object({
1086
1142
  content: require_protocol.array(require_protocol.ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."),
1087
1143
  structuredContent: require_protocol.record(require_protocol.string(), require_protocol.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")
1088
1144
  })
1089
- }), d = require_protocol.object({
1145
+ }), b = require_protocol.object({
1090
1146
  method: require_protocol.literal("ui/initialize"),
1091
1147
  params: require_protocol.object({
1092
1148
  appInfo: require_protocol.ImplementationSchema.describe("App identification (name and version)."),
1093
- appCapabilities: i.describe("Features and capabilities this app provides."),
1149
+ appCapabilities: l.describe("Features and capabilities this app provides."),
1094
1150
  protocolVersion: require_protocol.string().describe("Protocol version this app supports.")
1095
1151
  })
1096
1152
  });
1097
1153
  require_protocol.object({
1098
1154
  protocolVersion: require_protocol.string().describe("Negotiated protocol version string (e.g., \"2025-11-21\")."),
1099
1155
  hostInfo: require_protocol.ImplementationSchema.describe("Host application identification and version."),
1100
- hostCapabilities: n.describe("Features and capabilities provided by the host."),
1101
- hostContext: y.describe("Rich context about the host environment.")
1156
+ hostCapabilities: r.describe("Features and capabilities provided by the host."),
1157
+ hostContext: x.describe("Rich context about the host environment.")
1102
1158
  }).passthrough();
1103
- var D = class {
1159
+ var z = class {
1104
1160
  eventTarget;
1105
1161
  eventSource;
1106
1162
  messageListener;
@@ -1135,21 +1191,28 @@ var D = class {
1135
1191
  setProtocolVersion;
1136
1192
  };
1137
1193
  var lQ = [G];
1138
- var rQ = class extends require_protocol.Protocol {
1194
+ var oQ = class extends j {
1139
1195
  _client;
1140
1196
  _hostInfo;
1141
1197
  _capabilities;
1142
1198
  _appCapabilities;
1143
1199
  _hostContext = {};
1144
1200
  _appInfo;
1201
+ eventSchemas = {
1202
+ sizechange: w,
1203
+ sandboxready: T,
1204
+ initialized: S,
1205
+ requestteardown: C,
1206
+ loggingmessage: require_protocol.LoggingMessageNotificationSchema
1207
+ };
1145
1208
  constructor(X, Y, Z, $) {
1146
1209
  super($);
1147
1210
  this._client = X;
1148
1211
  this._hostInfo = Y;
1149
1212
  this._capabilities = Z;
1150
- this._hostContext = $?.hostContext || {}, this.setRequestHandler(d, (J) => this._oninitialize(J)), this.setRequestHandler(require_protocol.PingRequestSchema, (J, K) => {
1213
+ this._hostContext = $?.hostContext || {}, this.setRequestHandler(b, (J) => this._oninitialize(J)), this.setRequestHandler(require_protocol.PingRequestSchema, (J, K) => {
1151
1214
  return this.onping?.(J.params, K), {};
1152
- }), this.setRequestHandler(E, (J) => {
1215
+ }), this.replaceRequestHandler(_, (J) => {
1153
1216
  return { mode: this._hostContext.displayMode ?? "inline" };
1154
1217
  });
1155
1218
  }
@@ -1160,51 +1223,94 @@ var rQ = class extends require_protocol.Protocol {
1160
1223
  return this._appInfo;
1161
1224
  }
1162
1225
  onping;
1226
+ get onsizechange() {
1227
+ return this.getEventHandler("sizechange");
1228
+ }
1163
1229
  set onsizechange(X) {
1164
- this.setNotificationHandler(P, (Y) => X(Y.params));
1230
+ this.setEventHandler("sizechange", X);
1231
+ }
1232
+ get onsandboxready() {
1233
+ return this.getEventHandler("sandboxready");
1165
1234
  }
1166
1235
  set onsandboxready(X) {
1167
- this.setNotificationHandler(L, (Y) => X(Y.params));
1236
+ this.setEventHandler("sandboxready", X);
1237
+ }
1238
+ get oninitialized() {
1239
+ return this.getEventHandler("initialized");
1168
1240
  }
1169
1241
  set oninitialized(X) {
1170
- this.setNotificationHandler(v, (Y) => X(Y.params));
1242
+ this.setEventHandler("initialized", X);
1243
+ }
1244
+ _onmessage;
1245
+ get onmessage() {
1246
+ return this._onmessage;
1171
1247
  }
1172
1248
  set onmessage(X) {
1173
- this.setRequestHandler(S, async (Y, Z) => {
1174
- return X(Y.params, Z);
1249
+ this.warnIfRequestHandlerReplaced("onmessage", this._onmessage, X), this._onmessage = X, this.replaceRequestHandler(y, async (Y, Z) => {
1250
+ if (!this._onmessage) throw Error("No onmessage handler set");
1251
+ return this._onmessage(Y.params, Z);
1175
1252
  });
1176
1253
  }
1254
+ _onopenlink;
1255
+ get onopenlink() {
1256
+ return this._onopenlink;
1257
+ }
1177
1258
  set onopenlink(X) {
1178
- this.setRequestHandler(V, async (Y, Z) => {
1179
- return X(Y.params, Z);
1259
+ this.warnIfRequestHandlerReplaced("onopenlink", this._onopenlink, X), this._onopenlink = X, this.replaceRequestHandler(A, async (Y, Z) => {
1260
+ if (!this._onopenlink) throw Error("No onopenlink handler set");
1261
+ return this._onopenlink(Y.params, Z);
1180
1262
  });
1181
1263
  }
1264
+ _ondownloadfile;
1265
+ get ondownloadfile() {
1266
+ return this._ondownloadfile;
1267
+ }
1182
1268
  set ondownloadfile(X) {
1183
- this.setRequestHandler(C, async (Y, Z) => {
1184
- return X(Y.params, Z);
1269
+ this.warnIfRequestHandlerReplaced("ondownloadfile", this._ondownloadfile, X), this._ondownloadfile = X, this.replaceRequestHandler(f, async (Y, Z) => {
1270
+ if (!this._ondownloadfile) throw Error("No ondownloadfile handler set");
1271
+ return this._ondownloadfile(Y.params, Z);
1185
1272
  });
1186
1273
  }
1274
+ get onrequestteardown() {
1275
+ return this.getEventHandler("requestteardown");
1276
+ }
1187
1277
  set onrequestteardown(X) {
1188
- this.setNotificationHandler(M, (Y) => X(Y.params));
1278
+ this.setEventHandler("requestteardown", X);
1279
+ }
1280
+ _onrequestdisplaymode;
1281
+ get onrequestdisplaymode() {
1282
+ return this._onrequestdisplaymode;
1189
1283
  }
1190
1284
  set onrequestdisplaymode(X) {
1191
- this.setRequestHandler(E, async (Y, Z) => {
1192
- return X(Y.params, Z);
1285
+ this.warnIfRequestHandlerReplaced("onrequestdisplaymode", this._onrequestdisplaymode, X), this._onrequestdisplaymode = X, this.replaceRequestHandler(_, async (Y, Z) => {
1286
+ if (!this._onrequestdisplaymode) throw Error("No onrequestdisplaymode handler set");
1287
+ return this._onrequestdisplaymode(Y.params, Z);
1193
1288
  });
1194
1289
  }
1290
+ get onloggingmessage() {
1291
+ return this.getEventHandler("loggingmessage");
1292
+ }
1195
1293
  set onloggingmessage(X) {
1196
- this.setNotificationHandler(require_protocol.LoggingMessageNotificationSchema, async (Y) => {
1197
- X(Y.params);
1198
- });
1294
+ this.setEventHandler("loggingmessage", X);
1295
+ }
1296
+ _onupdatemodelcontext;
1297
+ get onupdatemodelcontext() {
1298
+ return this._onupdatemodelcontext;
1199
1299
  }
1200
1300
  set onupdatemodelcontext(X) {
1201
- this.setRequestHandler(f, async (Y, Z) => {
1202
- return X(Y.params, Z);
1301
+ this.warnIfRequestHandlerReplaced("onupdatemodelcontext", this._onupdatemodelcontext, X), this._onupdatemodelcontext = X, this.replaceRequestHandler(d, async (Y, Z) => {
1302
+ if (!this._onupdatemodelcontext) throw Error("No onupdatemodelcontext handler set");
1303
+ return this._onupdatemodelcontext(Y.params, Z);
1203
1304
  });
1204
1305
  }
1306
+ _oncalltool;
1307
+ get oncalltool() {
1308
+ return this._oncalltool;
1309
+ }
1205
1310
  set oncalltool(X) {
1206
- this.setRequestHandler(require_protocol.CallToolRequestSchema, async (Y, Z) => {
1207
- return X(Y.params, Z);
1311
+ this.warnIfRequestHandlerReplaced("oncalltool", this._oncalltool, X), this._oncalltool = X, this.replaceRequestHandler(require_protocol.CallToolRequestSchema, async (Y, Z) => {
1312
+ if (!this._oncalltool) throw Error("No oncalltool handler set");
1313
+ return this._oncalltool(Y.params, Z);
1208
1314
  });
1209
1315
  }
1210
1316
  sendToolListChanged(X = {}) {
@@ -1213,19 +1319,34 @@ var rQ = class extends require_protocol.Protocol {
1213
1319
  params: X
1214
1320
  });
1215
1321
  }
1322
+ _onlistresources;
1323
+ get onlistresources() {
1324
+ return this._onlistresources;
1325
+ }
1216
1326
  set onlistresources(X) {
1217
- this.setRequestHandler(require_protocol.ListResourcesRequestSchema, async (Y, Z) => {
1218
- return X(Y.params, Z);
1327
+ this.warnIfRequestHandlerReplaced("onlistresources", this._onlistresources, X), this._onlistresources = X, this.replaceRequestHandler(require_protocol.ListResourcesRequestSchema, async (Y, Z) => {
1328
+ if (!this._onlistresources) throw Error("No onlistresources handler set");
1329
+ return this._onlistresources(Y.params, Z);
1219
1330
  });
1220
1331
  }
1332
+ _onlistresourcetemplates;
1333
+ get onlistresourcetemplates() {
1334
+ return this._onlistresourcetemplates;
1335
+ }
1221
1336
  set onlistresourcetemplates(X) {
1222
- this.setRequestHandler(require_protocol.ListResourceTemplatesRequestSchema, async (Y, Z) => {
1223
- return X(Y.params, Z);
1337
+ this.warnIfRequestHandlerReplaced("onlistresourcetemplates", this._onlistresourcetemplates, X), this._onlistresourcetemplates = X, this.replaceRequestHandler(require_protocol.ListResourceTemplatesRequestSchema, async (Y, Z) => {
1338
+ if (!this._onlistresourcetemplates) throw Error("No onlistresourcetemplates handler set");
1339
+ return this._onlistresourcetemplates(Y.params, Z);
1224
1340
  });
1225
1341
  }
1342
+ _onreadresource;
1343
+ get onreadresource() {
1344
+ return this._onreadresource;
1345
+ }
1226
1346
  set onreadresource(X) {
1227
- this.setRequestHandler(require_protocol.ReadResourceRequestSchema, async (Y, Z) => {
1228
- return X(Y.params, Z);
1347
+ this.warnIfRequestHandlerReplaced("onreadresource", this._onreadresource, X), this._onreadresource = X, this.replaceRequestHandler(require_protocol.ReadResourceRequestSchema, async (Y, Z) => {
1348
+ if (!this._onreadresource) throw Error("No onreadresource handler set");
1349
+ return this._onreadresource(Y.params, Z);
1229
1350
  });
1230
1351
  }
1231
1352
  sendResourceListChanged(X = {}) {
@@ -1234,9 +1355,14 @@ var rQ = class extends require_protocol.Protocol {
1234
1355
  params: X
1235
1356
  });
1236
1357
  }
1358
+ _onlistprompts;
1359
+ get onlistprompts() {
1360
+ return this._onlistprompts;
1361
+ }
1237
1362
  set onlistprompts(X) {
1238
- this.setRequestHandler(require_protocol.ListPromptsRequestSchema, async (Y, Z) => {
1239
- return X(Y.params, Z);
1363
+ this.warnIfRequestHandlerReplaced("onlistprompts", this._onlistprompts, X), this._onlistprompts = X, this.replaceRequestHandler(require_protocol.ListPromptsRequestSchema, async (Y, Z) => {
1364
+ if (!this._onlistprompts) throw Error("No onlistprompts handler set");
1365
+ return this._onlistprompts(Y.params, Z);
1240
1366
  });
1241
1367
  }
1242
1368
  sendPromptListChanged(X = {}) {
@@ -1270,7 +1396,7 @@ var rQ = class extends require_protocol.Protocol {
1270
1396
  let Y = {}, Z = !1;
1271
1397
  for (let $ of Object.keys(X)) {
1272
1398
  let J = this._hostContext[$], K = X[$];
1273
- if (oQ(J, K)) continue;
1399
+ if (tQ(J, K)) continue;
1274
1400
  Y[$] = K, Z = !0;
1275
1401
  }
1276
1402
  if (Z) this._hostContext = X, this.sendHostContextChange(Y);
@@ -1315,9 +1441,21 @@ var rQ = class extends require_protocol.Protocol {
1315
1441
  return this.request({
1316
1442
  method: "ui/resource-teardown",
1317
1443
  params: X
1318
- }, H, Y);
1444
+ }, g, Y);
1319
1445
  }
1320
1446
  sendResourceTeardown = this.teardownResource;
1447
+ callTool(X, Y) {
1448
+ return this.request({
1449
+ method: "tools/call",
1450
+ params: X
1451
+ }, require_protocol.CallToolResultSchema, Y);
1452
+ }
1453
+ listTools(X, Y) {
1454
+ return this.request({
1455
+ method: "tools/list",
1456
+ params: X
1457
+ }, require_protocol.ListToolsResultSchema, Y);
1458
+ }
1321
1459
  async connect(X) {
1322
1460
  if (this.transport) throw Error("AppBridge is already connected. Call close() before connecting again.");
1323
1461
  if (this._client) {
@@ -1361,7 +1499,7 @@ var rQ = class extends require_protocol.Protocol {
1361
1499
  return super.connect(X);
1362
1500
  }
1363
1501
  };
1364
- function oQ(X, Y) {
1502
+ function tQ(X, Y) {
1365
1503
  return JSON.stringify(X) === JSON.stringify(Y);
1366
1504
  }
1367
1505
  //#endregion
@@ -1399,7 +1537,7 @@ var McpAppHost = class {
1399
1537
  constructor(options = {}) {
1400
1538
  this.options = options;
1401
1539
  this._prevDisplayMode = options.hostContext?.displayMode;
1402
- this.bridge = new rQ(null, options.hostInfo ?? DEFAULT_HOST_INFO, options.hostCapabilities ?? DEFAULT_HOST_CAPABILITIES, { hostContext: options.hostContext });
1540
+ this.bridge = new oQ(null, options.hostInfo ?? DEFAULT_HOST_INFO, options.hostCapabilities ?? DEFAULT_HOST_CAPABILITIES, { hostContext: options.hostContext });
1403
1541
  this.bridge.oninitialized = () => {
1404
1542
  this._initialized = true;
1405
1543
  if (this._pendingToolInput) {
@@ -1499,7 +1637,7 @@ var McpAppHost = class {
1499
1637
  console.log(`%c[MCP ↑]%c app → host: %c${label}`, "color:#6ee7b7", "color:inherit", "color:#93c5fd", data);
1500
1638
  };
1501
1639
  window.addEventListener("message", this._messageListener);
1502
- const transport = new D(contentWindow, contentWindow);
1640
+ const transport = new z(contentWindow, contentWindow);
1503
1641
  await this.bridge.connect(transport);
1504
1642
  }
1505
1643
  /**
@@ -4410,4 +4548,4 @@ Object.defineProperty(exports, "useThemeContext", {
4410
4548
  }
4411
4549
  });
4412
4550
 
4413
- //# sourceMappingURL=inspector-8nPV2A-z.cjs.map
4551
+ //# sourceMappingURL=inspector-Cvq3yjNL.cjs.map