sunpeak 0.18.2 → 0.18.6

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 (57) hide show
  1. package/bin/commands/inspect.mjs +392 -4
  2. package/bin/lib/sandbox-server.mjs +11 -1
  3. package/dist/chatgpt/index.cjs +1 -1
  4. package/dist/chatgpt/index.js +1 -1
  5. package/dist/claude/index.cjs +1 -1
  6. package/dist/claude/index.js +1 -1
  7. package/dist/hooks/index.d.ts +1 -0
  8. package/dist/hooks/use-request-teardown.d.ts +21 -0
  9. package/dist/host/chatgpt/index.cjs +1 -1
  10. package/dist/host/chatgpt/index.js +1 -1
  11. package/dist/index.cjs +110 -70
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +68 -31
  15. package/dist/index.js.map +1 -1
  16. package/dist/inspector/hosts.d.ts +12 -0
  17. package/dist/inspector/index.cjs +1 -1
  18. package/dist/inspector/index.js +1 -1
  19. package/dist/inspector/mcp-app-host.d.ts +3 -0
  20. package/dist/inspector/simple-sidebar.d.ts +1 -1
  21. package/dist/inspector/use-mcp-connection.d.ts +9 -1
  22. package/dist/{inspector-ClhpqKLi.js → inspector-CjSoXm6N.js} +497 -117
  23. package/dist/inspector-CjSoXm6N.js.map +1 -0
  24. package/dist/{inspector-CByJjmPD.cjs → inspector-DRD_Q66E.cjs} +498 -118
  25. package/dist/inspector-DRD_Q66E.cjs.map +1 -0
  26. package/dist/mcp/index.cjs +38 -33
  27. package/dist/mcp/index.cjs.map +1 -1
  28. package/dist/mcp/index.js +35 -30
  29. package/dist/mcp/index.js.map +1 -1
  30. package/dist/style.css +8 -0
  31. package/dist/{use-app-X7JbGskk.js → use-app-BNbz1uzj.js} +51 -42
  32. package/dist/use-app-BNbz1uzj.js.map +1 -0
  33. package/dist/{use-app-D2h-aiyr.cjs → use-app-Dqh20JPP.cjs} +93 -72
  34. package/dist/use-app-Dqh20JPP.cjs.map +1 -0
  35. package/package.json +2 -2
  36. package/template/dist/albums/albums.html +3 -3
  37. package/template/dist/albums/albums.json +1 -1
  38. package/template/dist/carousel/carousel.html +3 -3
  39. package/template/dist/carousel/carousel.json +1 -1
  40. package/template/dist/map/map.html +3 -3
  41. package/template/dist/map/map.json +1 -1
  42. package/template/dist/review/review.html +3 -3
  43. package/template/dist/review/review.json +1 -1
  44. package/template/node_modules/.vite/deps/_metadata.json +3 -3
  45. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +51 -42
  46. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  47. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +56 -50
  48. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  49. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +52 -43
  50. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  51. package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
  52. package/template/tests/e2e/albums.spec.ts +19 -15
  53. package/template/tests/live/albums.spec.ts +10 -0
  54. package/dist/inspector-CByJjmPD.cjs.map +0 -1
  55. package/dist/inspector-ClhpqKLi.js.map +0 -1
  56. package/dist/use-app-D2h-aiyr.cjs.map +0 -1
  57. package/dist/use-app-X7JbGskk.js.map +0 -1
package/dist/mcp/index.js CHANGED
@@ -8676,8 +8676,8 @@ var StreamableHTTPServerTransport = class {
8676
8676
  }
8677
8677
  };
8678
8678
  //#endregion
8679
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.2.2_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_e9bf7657371391a829fe8b4e289b253c/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js
8680
- var b = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), L = union([
8679
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.3.1_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_cd1fb28fd87e0bddd0a29eba0721855d/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js
8680
+ var g = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), G = union([
8681
8681
  literal("inline"),
8682
8682
  literal("fullscreen"),
8683
8683
  literal("pip")
@@ -8821,9 +8821,9 @@ object({
8821
8821
  method: literal("ui/notifications/tool-cancelled"),
8822
8822
  params: object({ reason: string().optional().describe("Optional reason for the cancellation (e.g., \"user action\", \"timeout\").") })
8823
8823
  });
8824
- var g = object({ fonts: string().optional() }), C = object({
8824
+ var S = object({ fonts: string().optional() }), y = object({
8825
8825
  variables: o.optional().describe("CSS variables for theming the app."),
8826
- css: g.optional().describe("CSS blocks that apps can inject.")
8826
+ css: S.optional().describe("CSS blocks that apps can inject.")
8827
8827
  });
8828
8828
  object({
8829
8829
  method: literal("ui/resource-teardown"),
@@ -8837,7 +8837,12 @@ var q = object({
8837
8837
  resource: object({}).optional().describe("Host supports resource content blocks."),
8838
8838
  resourceLink: object({}).optional().describe("Host supports resource link content blocks."),
8839
8839
  structuredContent: object({}).optional().describe("Host supports structured content.")
8840
- }), y = object({
8840
+ });
8841
+ object({
8842
+ method: literal("ui/notifications/request-teardown"),
8843
+ params: object({}).optional()
8844
+ });
8845
+ var C = object({
8841
8846
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
8842
8847
  openLinks: object({}).optional().describe("Host supports opening external URLs."),
8843
8848
  downloadFile: object({}).optional().describe("Host supports file downloads via ui/download-file."),
@@ -8850,10 +8855,10 @@ var q = object({
8850
8855
  }).optional().describe("Sandbox configuration applied by the host."),
8851
8856
  updateModelContext: q.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
8852
8857
  message: q.optional().describe("Host supports receiving content messages (ui/message) from the view.")
8853
- }), u = object({
8858
+ }), f = object({
8854
8859
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
8855
8860
  tools: object({ listChanged: boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."),
8856
- availableDisplayModes: array(L).optional().describe("Display modes the app supports.")
8861
+ availableDisplayModes: array(G).optional().describe("Display modes the app supports.")
8857
8862
  });
8858
8863
  object({
8859
8864
  method: literal("ui/notifications/initialized"),
@@ -8881,13 +8886,13 @@ Boolean requesting whether a visible border and background is provided by the ho
8881
8886
  });
8882
8887
  object({
8883
8888
  method: literal("ui/request-display-mode"),
8884
- params: object({ mode: L.describe("The display mode being requested.") })
8889
+ params: object({ mode: G.describe("The display mode being requested.") })
8885
8890
  });
8886
- object({ mode: L.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
8887
- var f = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool.");
8891
+ object({ mode: G.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
8892
+ var u = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool.");
8888
8893
  object({
8889
8894
  resourceUri: string().optional(),
8890
- visibility: array(f).optional().describe(`Who can access this tool. Default: ["model", "app"]
8895
+ visibility: array(u).optional().describe(`Who can access this tool. Default: ["model", "app"]
8891
8896
  - "model": Tool visible to and callable by the agent
8892
8897
  - "app": Tool callable by the app from this server only`)
8893
8898
  });
@@ -8921,10 +8926,10 @@ var k = object({
8921
8926
  id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."),
8922
8927
  tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.")
8923
8928
  }).optional().describe("Metadata of the tool call that instantiated this App."),
8924
- theme: b.optional().describe("Current color theme preference."),
8925
- styles: C.optional().describe("Style configuration for theming the app."),
8926
- displayMode: L.optional().describe("How the UI is currently displayed."),
8927
- availableDisplayModes: array(L).optional().describe("Display modes the host supports."),
8929
+ theme: g.optional().describe("Current color theme preference."),
8930
+ styles: y.optional().describe("Style configuration for theming the app."),
8931
+ displayMode: G.optional().describe("How the UI is currently displayed."),
8932
+ availableDisplayModes: array(G).optional().describe("Display modes the host supports."),
8928
8933
  containerDimensions: union([object({ height: number().describe("Fixed container height in pixels.") }), object({ maxHeight: union([number(), _undefined()]).optional().describe("Maximum container height in pixels.") })]).and(union([object({ width: number().describe("Fixed container width in pixels.") }), object({ maxWidth: union([number(), _undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
8929
8934
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),
8930
8935
  locale: string().optional().describe("User's language and region preference in BCP 47 format."),
@@ -8961,28 +8966,28 @@ object({
8961
8966
  method: literal("ui/initialize"),
8962
8967
  params: object({
8963
8968
  appInfo: ImplementationSchema.describe("App identification (name and version)."),
8964
- appCapabilities: u.describe("Features and capabilities this app provides."),
8969
+ appCapabilities: f.describe("Features and capabilities this app provides."),
8965
8970
  protocolVersion: string().describe("Protocol version this app supports.")
8966
8971
  })
8967
8972
  });
8968
8973
  object({
8969
8974
  protocolVersion: string().describe("Negotiated protocol version string (e.g., \"2025-11-21\")."),
8970
8975
  hostInfo: ImplementationSchema.describe("Host application identification and version."),
8971
- hostCapabilities: y.describe("Features and capabilities provided by the host."),
8976
+ hostCapabilities: C.describe("Features and capabilities provided by the host."),
8972
8977
  hostContext: k.describe("Rich context about the host environment.")
8973
8978
  }).passthrough();
8974
8979
  var v = "ui/resourceUri", d = "text/html;profile=mcp-app";
8975
- function uZ(Z, $, J, X) {
8976
- let D = J._meta, V = D.ui, G = D[v], W = D;
8977
- if (V?.resourceUri && !G) W = {
8980
+ function hZ(Z, $, J, X) {
8981
+ let D = J._meta, V = D.ui, L = D[v], W = D;
8982
+ if (V?.resourceUri && !L) W = {
8978
8983
  ...D,
8979
8984
  [v]: V.resourceUri
8980
8985
  };
8981
- else if (G && !V?.resourceUri) W = {
8986
+ else if (L && !V?.resourceUri) W = {
8982
8987
  ...D,
8983
8988
  ui: {
8984
8989
  ...V,
8985
- resourceUri: G
8990
+ resourceUri: L
8986
8991
  }
8987
8992
  };
8988
8993
  return Z.registerTool($, {
@@ -8990,16 +8995,16 @@ function uZ(Z, $, J, X) {
8990
8995
  _meta: W
8991
8996
  }, X);
8992
8997
  }
8993
- function fZ(Z, $, J, X, D) {
8998
+ function mZ(Z, $, J, X, D) {
8994
8999
  return Z.registerResource($, J, {
8995
9000
  mimeType: d,
8996
9001
  ...X
8997
9002
  }, D);
8998
9003
  }
8999
- var OQ = "io.modelcontextprotocol/ui";
9000
- function dZ(Z) {
9004
+ var IQ = "io.modelcontextprotocol/ui";
9005
+ function cZ(Z) {
9001
9006
  if (!Z) return;
9002
- return Z.extensions?.[OQ];
9007
+ return Z.extensions?.[IQ];
9003
9008
  }
9004
9009
  //#endregion
9005
9010
  //#region src/mcp/resolve-domain.ts
@@ -9286,7 +9291,7 @@ function createAppServer(config, simulations, viteMode) {
9286
9291
  ...toolMeta.ui?.visibility ? { visibility: toolMeta.ui.visibility } : {}
9287
9292
  }
9288
9293
  };
9289
- const toolHandle = uZ(mcpServer, tool.name, {
9294
+ const toolHandle = hZ(mcpServer, tool.name, {
9290
9295
  description: tool.description,
9291
9296
  inputSchema: z.object({}).passthrough(),
9292
9297
  ...simulation.outputSchema ? { outputSchema: simulation.outputSchema } : {},
@@ -9714,7 +9719,7 @@ function createProductionMcpServer(config) {
9714
9719
  if (res) {
9715
9720
  if (!registeredResources.has(res.uri)) {
9716
9721
  registeredResources.add(res.uri);
9717
- const handle = fZ(mcpServer, res.name, res.uri, {
9722
+ const handle = mZ(mcpServer, res.name, res.uri, {
9718
9723
  description: res.description,
9719
9724
  _meta: res._meta
9720
9725
  }, async () => {
@@ -9743,7 +9748,7 @@ function createProductionMcpServer(config) {
9743
9748
  }
9744
9749
  }
9745
9750
  };
9746
- uZ(mcpServer, tool.name, toolConfig, makeCallback());
9751
+ hZ(mcpServer, tool.name, toolConfig, makeCallback());
9747
9752
  } else {
9748
9753
  const cb = makeCallback();
9749
9754
  const toolConfig = {
@@ -10158,6 +10163,6 @@ function startProductionHttpServer(config, portOrOptions) {
10158
10163
  process.on("SIGINT", () => void shutdown());
10159
10164
  }
10160
10165
  //#endregion
10161
- export { OQ as EXTENSION_ID, FAVICON_BASE64, FAVICON_BUFFER, FAVICON_DATA_URI, d as RESOURCE_MIME_TYPE, v as RESOURCE_URI_META_KEY, computeChatGPTDomain, computeClaudeDomain, createHandler, createMcpHandler, createProductionMcpServer, dZ as getUiCapability, injectDefaultDomain, injectResolvedDomain, fZ as registerAppResource, uZ as registerAppTool, resolveDomain, runMCPServer, setJsonLogging, startProductionHttpServer };
10166
+ export { IQ as EXTENSION_ID, FAVICON_BASE64, FAVICON_BUFFER, FAVICON_DATA_URI, d as RESOURCE_MIME_TYPE, v as RESOURCE_URI_META_KEY, computeChatGPTDomain, computeClaudeDomain, createHandler, createMcpHandler, createProductionMcpServer, cZ as getUiCapability, injectDefaultDomain, injectResolvedDomain, mZ as registerAppResource, hZ as registerAppTool, resolveDomain, runMCPServer, setJsonLogging, startProductionHttpServer };
10162
10167
 
10163
10168
  //# sourceMappingURL=index.js.map