@ggui-ai/mcp-server 0.1.0-rc.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 (141) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +48 -0
  3. package/dist/admin-blueprints-transport.d.ts +114 -0
  4. package/dist/admin-blueprints-transport.d.ts.map +1 -0
  5. package/dist/admin-blueprints-transport.js +118 -0
  6. package/dist/admin-oauth-providers-transport.d.ts +40 -0
  7. package/dist/admin-oauth-providers-transport.d.ts.map +1 -0
  8. package/dist/admin-oauth-providers-transport.js +263 -0
  9. package/dist/auth.d.ts +39 -0
  10. package/dist/auth.d.ts.map +1 -0
  11. package/dist/auth.js +75 -0
  12. package/dist/build-mcp.d.ts +128 -0
  13. package/dist/build-mcp.d.ts.map +1 -0
  14. package/dist/build-mcp.js +113 -0
  15. package/dist/code-store-fs.d.ts +19 -0
  16. package/dist/code-store-fs.d.ts.map +1 -0
  17. package/dist/code-store-fs.js +98 -0
  18. package/dist/console-auth.d.ts +139 -0
  19. package/dist/console-auth.d.ts.map +1 -0
  20. package/dist/console-auth.js +102 -0
  21. package/dist/console-cache.d.ts +78 -0
  22. package/dist/console-cache.d.ts.map +1 -0
  23. package/dist/console-cache.js +105 -0
  24. package/dist/console-headers.d.ts +124 -0
  25. package/dist/console-headers.d.ts.map +1 -0
  26. package/dist/console-headers.js +49 -0
  27. package/dist/console-llm-trace.d.ts +66 -0
  28. package/dist/console-llm-trace.d.ts.map +1 -0
  29. package/dist/console-llm-trace.js +105 -0
  30. package/dist/console-payloads.d.ts +67 -0
  31. package/dist/console-payloads.d.ts.map +1 -0
  32. package/dist/console-payloads.js +105 -0
  33. package/dist/console-theme-routes.d.ts +111 -0
  34. package/dist/console-theme-routes.d.ts.map +1 -0
  35. package/dist/console-theme-routes.js +202 -0
  36. package/dist/console-timeline.d.ts +45 -0
  37. package/dist/console-timeline.d.ts.map +1 -0
  38. package/dist/console-timeline.js +169 -0
  39. package/dist/console-validator.d.ts +67 -0
  40. package/dist/console-validator.d.ts.map +1 -0
  41. package/dist/console-validator.js +105 -0
  42. package/dist/console-welcome.d.ts +7 -0
  43. package/dist/console-welcome.d.ts.map +1 -0
  44. package/dist/console-welcome.js +221 -0
  45. package/dist/csrf-middleware.d.ts +55 -0
  46. package/dist/csrf-middleware.d.ts.map +1 -0
  47. package/dist/csrf-middleware.js +138 -0
  48. package/dist/email-login.d.ts +174 -0
  49. package/dist/email-login.d.ts.map +1 -0
  50. package/dist/email-login.js +254 -0
  51. package/dist/email-resend.d.ts +29 -0
  52. package/dist/email-resend.d.ts.map +1 -0
  53. package/dist/email-resend.js +71 -0
  54. package/dist/email-sender-from-env.d.ts +34 -0
  55. package/dist/email-sender-from-env.d.ts.map +1 -0
  56. package/dist/email-sender-from-env.js +112 -0
  57. package/dist/email-smtp.d.ts +42 -0
  58. package/dist/email-smtp.d.ts.map +1 -0
  59. package/dist/email-smtp.js +81 -0
  60. package/dist/index.d.ts +102 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +122 -0
  63. package/dist/instructions-presets.d.ts +112 -0
  64. package/dist/instructions-presets.d.ts.map +1 -0
  65. package/dist/instructions-presets.js +195 -0
  66. package/dist/llm-backed-negotiator.d.ts +178 -0
  67. package/dist/llm-backed-negotiator.d.ts.map +1 -0
  68. package/dist/llm-backed-negotiator.js +579 -0
  69. package/dist/logger.d.ts +23 -0
  70. package/dist/logger.d.ts.map +1 -0
  71. package/dist/logger.js +41 -0
  72. package/dist/mcp-apps-inbound.d.ts +86 -0
  73. package/dist/mcp-apps-inbound.d.ts.map +1 -0
  74. package/dist/mcp-apps-inbound.js +278 -0
  75. package/dist/mcp-apps-outbound.d.ts +448 -0
  76. package/dist/mcp-apps-outbound.d.ts.map +1 -0
  77. package/dist/mcp-apps-outbound.js +1163 -0
  78. package/dist/mcp-mounts.d.ts +239 -0
  79. package/dist/mcp-mounts.d.ts.map +1 -0
  80. package/dist/mcp-mounts.js +222 -0
  81. package/dist/oauth-login-types.d.ts +160 -0
  82. package/dist/oauth-login-types.d.ts.map +1 -0
  83. package/dist/oauth-login-types.js +9 -0
  84. package/dist/oauth-login.d.ts +77 -0
  85. package/dist/oauth-login.d.ts.map +1 -0
  86. package/dist/oauth-login.js +455 -0
  87. package/dist/oauth-providers/github.d.ts +17 -0
  88. package/dist/oauth-providers/github.d.ts.map +1 -0
  89. package/dist/oauth-providers/github.js +89 -0
  90. package/dist/oauth-providers/google.d.ts +18 -0
  91. package/dist/oauth-providers/google.d.ts.map +1 -0
  92. package/dist/oauth-providers/google.js +59 -0
  93. package/dist/oauth-providers-store.d.ts +32 -0
  94. package/dist/oauth-providers-store.d.ts.map +1 -0
  95. package/dist/oauth-providers-store.js +291 -0
  96. package/dist/oauth.d.ts +347 -0
  97. package/dist/oauth.d.ts.map +1 -0
  98. package/dist/oauth.js +686 -0
  99. package/dist/pairing-transport.d.ts +99 -0
  100. package/dist/pairing-transport.d.ts.map +1 -0
  101. package/dist/pairing-transport.js +223 -0
  102. package/dist/rate-limit-middleware.d.ts +36 -0
  103. package/dist/rate-limit-middleware.d.ts.map +1 -0
  104. package/dist/rate-limit-middleware.js +57 -0
  105. package/dist/render-gate.d.ts +87 -0
  106. package/dist/render-gate.d.ts.map +1 -0
  107. package/dist/render-gate.js +77 -0
  108. package/dist/render-rate-limit.d.ts +59 -0
  109. package/dist/render-rate-limit.d.ts.map +1 -0
  110. package/dist/render-rate-limit.js +73 -0
  111. package/dist/render-signing.d.ts +98 -0
  112. package/dist/render-signing.d.ts.map +1 -0
  113. package/dist/render-signing.js +113 -0
  114. package/dist/request-context.d.ts +113 -0
  115. package/dist/request-context.d.ts.map +1 -0
  116. package/dist/request-context.js +154 -0
  117. package/dist/reserved-validators.d.ts +22 -0
  118. package/dist/reserved-validators.d.ts.map +1 -0
  119. package/dist/reserved-validators.js +101 -0
  120. package/dist/schema-compat.d.ts +167 -0
  121. package/dist/schema-compat.d.ts.map +1 -0
  122. package/dist/schema-compat.js +187 -0
  123. package/dist/security-headers-middleware.d.ts +38 -0
  124. package/dist/security-headers-middleware.d.ts.map +1 -0
  125. package/dist/security-headers-middleware.js +30 -0
  126. package/dist/server.d.ts +2060 -0
  127. package/dist/server.d.ts.map +1 -0
  128. package/dist/server.js +6338 -0
  129. package/dist/session-channel.d.ts +651 -0
  130. package/dist/session-channel.d.ts.map +1 -0
  131. package/dist/session-channel.js +1756 -0
  132. package/dist/storage.d.ts +89 -0
  133. package/dist/storage.d.ts.map +1 -0
  134. package/dist/storage.js +171 -0
  135. package/dist/thread-transport.d.ts +118 -0
  136. package/dist/thread-transport.d.ts.map +1 -0
  137. package/dist/thread-transport.js +478 -0
  138. package/dist/user-session-auth.d.ts +167 -0
  139. package/dist/user-session-auth.d.ts.map +1 -0
  140. package/dist/user-session-auth.js +148 -0
  141. package/package.json +76 -0
@@ -0,0 +1,448 @@
1
+ /**
2
+ * MCP Apps outbound wiring — the server-side half of the
3
+ * `ggui_push -> ui://ggui/session -> iframe -> live channel` delivery path.
4
+ *
5
+ * Responsibilities of this module (and nothing else):
6
+ *
7
+ * 1. Advertise the `io.modelcontextprotocol/ui` capability on every
8
+ * fresh `McpServer` instance so MCP Apps hosts know the server
9
+ * speaks the UI extension.
10
+ * 2. Register `ui://ggui/session` as a static resource servable via
11
+ * MCP `resources/read`. The resource body is the thin-shell HTML
12
+ * hosts sandbox-render when they see `_meta.ui.resourceUri` on a
13
+ * `ggui_push` result.
14
+ *
15
+ * Boundary discipline:
16
+ *
17
+ * - This module imports from `@ggui-ai/protocol/integrations/mcp-apps`
18
+ * (the subpath). It does NOT expose MCP-Apps-specific shapes back
19
+ * into `build-mcp.ts`, `server.ts`, or the blueprint handlers.
20
+ * - Capability advertisement and resource registration are the ONLY
21
+ * server-wide concerns here. Bootstrap-token mint + live-channel
22
+ * bootstrap-auth live in separate slices of the same overall
23
+ * outbound path.
24
+ *
25
+ * Why the shell body lives here:
26
+ *
27
+ * The thin shell is static content; it depends on nothing except the
28
+ * MIME constant and the HTML. Keeping it next to the registration
29
+ * means a future refactor of the shell edits one file. The
30
+ * `@ggui-ai/react` package does NOT ship the shell as a separate
31
+ * build target — per the design lock, the shell is served by the
32
+ * same `@ggui-ai/mcp-server` instance that mints the bootstrap.
33
+ */
34
+ import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
35
+ import type { SessionStore, VectorStore } from '@ggui-ai/mcp-server-core';
36
+ import { type GguiBootstrapMeta } from '@ggui-ai/protocol/integrations/mcp-apps';
37
+ export declare const GGUI_SESSION_SHELL_HTML = "<!doctype html>\n<html lang=\"en\" style=\"height:100%\"><head><meta charset=\"utf-8\"><title>ggui session</title></head>\n<body style=\"margin:0;height:100%;min-height:480px\"><div id=\"ggui-root\" data-ggui-shell=\"thin\" style=\"height:100%;min-height:480px\"></div>\n<script>\n(function(){'use strict';\n// MCP Apps shell. Speaks the canonical postMessage protocol from\n// @modelcontextprotocol/ext-apps:\n// 1. iframe -> host: ui/initialize\n// 2. iframe -> host: ui/notifications/initialized\n// 3. host -> iframe: ui/notifications/tool-result (per CallToolResult)\n// On tool-result, derive base URL + shortCode from structuredContent,\n// fetch JSON bootstrap (componentCode + ids + runtimeUrl), set\n// window.__GGUI_BOOTSTRAP__, fetch runtime as blob, inject as script.\n// Runtime auto-mounts inline. No nested iframe (claudemcpcontent.com\n// CSP frame-src forbids cross-origin frames). State machine matches\n// buildSelfContainedShell so the same runtime mounts both paths.\nvar rpcId=1,pending={};\nvar rootEl=document.getElementById('ggui-root');\nrootEl.style.cssText='display:flex;flex-direction:column;height:100%;min-height:300px;margin:0';\nvar mounted=false;\nfunction setOverlay(text){\n if(mounted)return;\n rootEl.innerHTML='<div style=\"font:14px system-ui,sans-serif;padding:24px;color:#666\">'+text+'</div>';\n}\nfunction postNotification(method,params){\n try{window.parent.postMessage({jsonrpc:'2.0',method:method,params:params||{}},'*');}catch(e){}\n}\nfunction postRpc(method,params){\n return new Promise(function(res,rej){\n var id=rpcId++;pending[id]={res:res,rej:rej};\n try{window.parent.postMessage({jsonrpc:'2.0',id:id,method:method,params:params||{}},'*');}\n catch(e){delete pending[id];rej(e);}\n });\n}\nfunction readToolResult(p){\n if(!p)return null;\n var sc=p.structuredContent;\n if(sc&&typeof sc.url==='string'&&typeof sc.shortCode==='string'){\n return {url:sc.url,shortCode:sc.shortCode};\n }\n if(Array.isArray(p.content)){\n for(var i=0;i<p.content.length;i++){\n var c=p.content[i];\n if(c&&c.type==='text'&&typeof c.text==='string'){\n try{var j=JSON.parse(c.text);\n if(j&&typeof j.url==='string'&&typeof j.shortCode==='string'){\n return {url:j.url,shortCode:j.shortCode};\n }\n }catch(e){}\n }\n }\n }\n return null;\n}\nfunction deriveBase(url){\n try{var u=new URL(url);return u.origin;}catch(e){return null;}\n}\nfunction postBootstrapFailed(reason,message){\n // Surface every shell-layer bootstrap-failure path as a typed\n // RendererBootFailedMessage envelope so hosts pinning the C9\n // error pane (McpAppIframe onError, IframeErrorPane) see the\n // failure instead of staring at the inert overlay until the test\n // times out. Reason codes match BootstrapFailureReason.\n try{window.parent.postMessage({type:'ggui:bootstrap-failed',reason:reason,message:message},'*');}catch(e){}\n}\nasync function mountFromBootstrap(bootstrap){\n if(mounted)return;\n // runtimeUrl is the only load-bearing field at the shell layer \u2014\n // it tells us which iframe-runtime bundle to fetch. componentCode\n // is OPTIONAL: present in self-contained-mode bootstraps (the\n // runtime renders the inlined code without WS), absent in\n // GguiBootstrapMeta-shaped bootstraps (the runtime opens the WS\n // subscription via wsUrl+token to receive the stack). Either is\n // valid; the runtime decides at boot time. Rejecting on missing\n // componentCode silently breaks every Path B GguiBootstrapMeta\n // delivery, which is the whole point of the inline-bootstrap path.\n if(!bootstrap||typeof bootstrap.runtimeUrl!=='string'){\n setOverlay('Bootstrap payload malformed.');\n postBootstrapFailed('BOOTSTRAP_MALFORMED','Bootstrap payload malformed.');\n return;\n }\n setOverlay('Loading UI\u2026');\n window.__GGUI_BOOTSTRAP__=bootstrap;\n // Load the runtime bundle via a direct cross-origin script tag\n // (governed by CSP script-src) instead of fetch + Blob (governed by\n // CSP connect-src). claude.ai's claudemcpcontent.com iframe CSP\n // forbids cross-origin connect-src so fetch throws TypeError\n // 'Failed to fetch', but allows cross-origin script-src when the\n // bundle responds with the right CORS headers (the iframe-runtime\n // mount sets them). The self-contained shell already uses this\n // pattern; legacy postMessage shell now matches it.\n try{\n var s=document.createElement('script');\n s.type='module';\n // crossorigin=anonymous opts into CORS-mode error reporting.\n // Without it, cross-origin script tags get a sanitized\n // \"script error\" with no details, masking the real cause\n // (CSP block, CORS reject, module-evaluation throw). With it,\n // the error event surfaces the actual message in the iframe\n // console -- the bundle ships ACAO=* so credentialed mode is\n // unnecessary.\n s.crossOrigin='anonymous';\n s.src=bootstrap.runtimeUrl;\n s.onload=function(){mounted=true;};\n s.onerror=function(e){\n var msg='Runtime bundle failed to load: '+(e&&e.message||'script error');\n setOverlay(msg);\n postBootstrapFailed('BUNDLE_FETCH_FAILED',msg);\n };\n rootEl.innerHTML='';\n document.body.appendChild(s);\n }catch(e){\n var msg='Runtime bundle failed to load: '+(e&&e.message||e);\n setOverlay(msg);\n postBootstrapFailed('BUNDLE_FETCH_FAILED',msg);\n }\n}\nasync function mount(toolResult){\n if(mounted)return;\n var base=deriveBase(toolResult.url);\n if(!base){setOverlay('Invalid URL in tool result.');return;}\n setOverlay('Loading UI\u2026');\n var bootstrap;\n try{\n var bRes=await fetch(base+'/api/bootstrap/'+encodeURIComponent(toolResult.shortCode),{\n cache:'no-store',\n headers:{accept:'application/json'},\n });\n if(!bRes.ok){setOverlay('Bootstrap fetch failed: HTTP '+bRes.status);return;}\n bootstrap=await bRes.json();\n }catch(e){setOverlay('Bootstrap fetch error: '+(e&&e.message||e));return;}\n return mountFromBootstrap(bootstrap);\n}\nfunction readBootstrapFromInitResult(result){\n if(!result||typeof result!=='object')return null;\n var toolOutput=result.toolOutput;\n if(!toolOutput||typeof toolOutput!=='object')return null;\n var meta=toolOutput._meta;\n if(!meta||typeof meta!=='object')return null;\n var ggui=meta.ggui;\n if(!ggui||typeof ggui!=='object')return null;\n var b=ggui.bootstrap;\n if(!b||typeof b!=='object')return null;\n // Same loosening as mountFromBootstrap: only runtimeUrl is required\n // here. GguiBootstrapMeta forwarded by first-party McpAppIframe\n // hosts omits componentCode by design (the runtime fetches the\n // stack via\n // wsUrl+token). Requiring componentCode at the shell layer turned\n // every Path B inline-bootstrap delivery into a silent reject.\n if(typeof b.runtimeUrl!=='string')return null;\n return b;\n}\nfunction hasGguiMetaPlaceholder(result){\n // Detect the protocol-violation case where the host signaled\n // \"I tried to deliver bootstrap\" (toolOutput._meta.ggui exists)\n // but the bootstrap field itself is absent or malformed. In that\n // shape, we fail-fast with BOOTSTRAP_META_MISSING rather than\n // sitting in the Path-A waiting state forever.\n if(!result||typeof result!=='object')return false;\n var toolOutput=result.toolOutput;\n if(!toolOutput||typeof toolOutput!=='object')return false;\n var meta=toolOutput._meta;\n if(!meta||typeof meta!=='object')return false;\n var ggui=meta.ggui;\n return !!ggui&&typeof ggui==='object';\n}\nfunction readBootstrapFromCallToolResult(params){\n // MCP Apps spec (specification/2026-01-26/apps.mdx:1145-1155):\n // ui/notifications/tool-result\n // params: CallToolResult // Standard MCP type\n // So params IS the CallToolResult and _meta lives at the top\n // level (NOT under params.toolOutput, which is where the\n // first-party McpAppIframe convention wraps it). Spec-compliant\n // hosts (Claude Desktop, claude.ai Connector, Claude Code) deliver\n // bootstrap material here.\n if(!params||typeof params!=='object')return null;\n var meta=params._meta;\n if(!meta||typeof meta!=='object')return null;\n var ggui=meta.ggui;\n if(!ggui||typeof ggui!=='object')return null;\n var b=ggui.bootstrap;\n if(!b||typeof b!=='object')return null;\n // Same loosening as readBootstrapFromInitResult / mountFromBootstrap:\n // only runtimeUrl is required at the shell layer. componentCode is\n // optional (absent for GguiBootstrapMeta-shaped bootstraps that\n // open WS via wsUrl+token).\n if(typeof b.runtimeUrl!=='string')return null;\n return b;\n}\nwindow.addEventListener('message',function(ev){\n var m=ev&&ev.data;\n if(!m||m.jsonrpc!=='2.0')return;\n if(m.id!=null&&pending[m.id]){\n var p=pending[m.id];delete pending[m.id];\n if(m.error)p.rej(m.error);else p.res(m.result);\n return;\n }\n if(m.method==='ui/notifications/tool-result'){\n // Spec-compliant hosts: m.params IS the CallToolResult; _meta is\n // at the top level. Try this FIRST so Claude Desktop / claude.ai\n // Connector / Claude Code land here.\n var specB=readBootstrapFromCallToolResult(m.params);\n if(specB){mountFromBootstrap(specB);return;}\n // First-party McpAppIframe convention: bootstrap nested under\n // params.toolOutput._meta. First-party hosts (Studio, Portal,\n // console) use this shape for both init-response and post-init\n // notification.\n var bb=readBootstrapFromInitResult(m.params);\n if(bb){mountFromBootstrap(bb);return;}\n // Path A (last-resort fallback): host posts structuredContent.\n // {url, shortCode}; shell fetches /api/bootstrap/<shortCode>\n // over HTTP. The OSS server doesn't mount that endpoint, so this\n // path is effectively dead unless a hosted operator wires it.\n var tr=readToolResult(m.params);\n if(tr)mount(tr);\n }\n});\nsetOverlay('Initializing\u2026');\nvar initTimer=setTimeout(function(){\n setOverlay('Host did not respond to ui/initialize within 3s.');\n},3000);\npostRpc('ui/initialize',{\n appCapabilities:{},\n appInfo:{name:'ggui-session',version:'1.0.0'},\n protocolVersion:'2026-01-26'\n}).then(function(result){\n clearTimeout(initTimer);\n postNotification('ui/notifications/initialized',{});\n // Path B: bootstrap inline in ui/initialize result. Hosts using\n // <McpAppIframe>'s first-party dispatch deliver bootstrap meta here\n // and never send a separate ui/notifications/tool-result.\n var b=readBootstrapFromInitResult(result);\n if(b){mountFromBootstrap(b);return;}\n // Protocol-violation surface: host signalled an attempt\n // (toolOutput._meta.ggui exists) but bootstrap is missing or\n // malformed. Fail fast so hosts pinning a typed error envelope\n // don't sit on the Path-A waiting overlay forever. Only fires\n // when the meta placeholder is present \u2014 a fully absent _meta.ggui\n // still falls through to Path A waiting.\n if(hasGguiMetaPlaceholder(result)){\n var msg='ui/initialize result missing _meta.ggui.bootstrap or runtimeUrl';\n setOverlay(msg);\n postBootstrapFailed('BOOTSTRAP_META_MISSING',msg);\n return;\n }\n // Path A: wait for the host to send ui/notifications/tool-result\n // with structuredContent.{url, shortCode}. MCP Apps hosts that don't\n // implement the reading-B inline-bootstrap convention land here.\n setOverlay('Waiting for tool result\u2026');\n}).catch(function(e){\n clearTimeout(initTimer);\n setOverlay('ui/initialize failed: '+(e&&e.message||JSON.stringify(e)));\n});\n})();\n</script></body></html>";
38
+ /**
39
+ * CSP `script-src` source expression that authorises the inline
40
+ * `<script>` block of {@link GGUI_SESSION_SHELL_HTML} when it executes
41
+ * inside an iframe whose CSP is inherited from a parent host.
42
+ *
43
+ * # Why this exists
44
+ *
45
+ * The console's `<McpAppIframe>` mounts the production shell via
46
+ * `srcdoc`. The `about:srcdoc` iframe inherits the parent console
47
+ * SPA's CSP, which intentionally forbids `'unsafe-inline'` for
48
+ * `script-src` (`packages/mcp-server/src/console-headers.ts` —
49
+ * "If a future slice needs inline bootstrapping, add a nonce —
50
+ * NEVER `'unsafe-inline'` for scripts."). Without an authorising
51
+ * source expression for this exact script body, the inline shell
52
+ * is blocked at parse time and the renderer is never fetched. The
53
+ * lifecycle protocol never advances past `mounting`; specs pinning
54
+ * `data-ggui-mcp-app-iframe-lifecycle="code-ready"` time out.
55
+ *
56
+ * Hash CSP is the right shape here: the shell body is **static**
57
+ * and known at build time, and a hash binds the policy to the
58
+ * exact bytes — narrower than `'unsafe-inline'`, narrower than a
59
+ * runtime-generated nonce. If the shell body changes, the hash
60
+ * changes; the drift test in `mcp-apps-outbound.test.ts` catches
61
+ * a stale value.
62
+ *
63
+ * # Where it gets used
64
+ *
65
+ * `console-headers.ts::DEVTOOL_CSP` appends this expression to its
66
+ * `script-src` directive. Hosted closed-runtime session-resource
67
+ * endpoints have their own CSP and serve the same shell — that path
68
+ * needs the same expression added; tracked separately.
69
+ *
70
+ * # What an MCP Apps host (Claude Desktop etc.) does
71
+ *
72
+ * Production hosts set their own CSP on the iframe document — that
73
+ * surface is opaque to ggui. This expression is for the FIRST-PARTY
74
+ * path where the host is `<McpAppIframe>` and the parent SPA owns
75
+ * the CSP it inherits.
76
+ */
77
+ export declare const GGUI_SESSION_SHELL_SCRIPT_HASH: string;
78
+ export declare function registerGguiSessionResource(server: McpServer, shellHtml?: string, publicBaseUrl?: string): void;
79
+ /**
80
+ * Advertise the `io.modelcontextprotocol/ui` extension capability on
81
+ * an `McpServer`'s underlying `Server`. Idempotent - calling twice on
82
+ * the same server leaves the capability advertised once.
83
+ *
84
+ * We use the `experimental` capability slot (present in every MCP SDK
85
+ * release) rather than `extensions` (post-1.x addition) for broadest
86
+ * client compat. The capability *name* is what matters to hosts; the
87
+ * container field is a pragmatic choice we can migrate if the spec
88
+ * settles on `extensions` later.
89
+ */
90
+ export declare function advertiseMcpAppsUiCapability(server: McpServer): void;
91
+ /**
92
+ * Inputs to {@link buildSelfContainedShell}.
93
+ *
94
+ * @public
95
+ */
96
+ export interface SelfContainedShellInputs {
97
+ /** Session id whose top-of-stack render is being inlined. */
98
+ readonly sessionId: string;
99
+ /** App / tenant id the session is scoped to. */
100
+ readonly appId: string;
101
+ /**
102
+ * Content-addressable URL the iframe fetches the compiled ES module
103
+ * from. Mutually exclusive with {@link systemKind} — exactly one MUST
104
+ * be set. The runtime resolves the URL with `import(codeUrl)` at boot;
105
+ * the response is `Cache-Control: immutable` so subsequent loads of
106
+ * the same compiled bundle hit the browser cache.
107
+ */
108
+ readonly codeUrl?: string;
109
+ /**
110
+ * Hex-encoded sha256 of the bytes served at {@link codeUrl}. Paired
111
+ * with codeUrl (present together, absent together) — surfaces the
112
+ * integrity signal alongside the URL so consumers can dedup across
113
+ * pushes without re-parsing.
114
+ */
115
+ readonly codeHash?: string;
116
+ /**
117
+ * System-card kind identifier, mapped at runtime against the
118
+ * built-in `SYSTEM_CARD_REGISTRY`. Mutually exclusive with
119
+ * {@link codeUrl}.
120
+ */
121
+ readonly systemKind?: string;
122
+ /**
123
+ * Absolute URL of the iframe-runtime bundle the shell loads via
124
+ * `<script type="module" src=...>`. MUST be absolute (or root-
125
+ * relative resolvable from the host's iframe origin) — `srcdoc`
126
+ * iframes have `about:srcdoc` as their URL so a bare relative path
127
+ * cannot resolve. Also inlined on the `__GGUI_BOOTSTRAP__` global so
128
+ * the iframe-runtime's bootstrap validator (which requires
129
+ * `runtimeUrl` across all modes) accepts the envelope.
130
+ */
131
+ readonly runtimeUrl: string;
132
+ /** Optional stack-item id forwarded to the renderer for parity
133
+ * with single-item-mode bootstrap selectors. */
134
+ readonly stackItemId?: string;
135
+ /**
136
+ * Canvas-mode flag. When `true`, the
137
+ * bootstrap is built as session-scoped (no stackItemId, no
138
+ * codeUrl/systemKind — live-mode trio MUST be supplied) and the
139
+ * iframe-runtime mounts {@link CanvasShell} instead of a single
140
+ * stack item. Mutually exclusive with {@link stackItemId}.
141
+ */
142
+ readonly canvasMode?: boolean;
143
+ /** Optional theme id forwarded to the renderer. */
144
+ readonly themeId?: string;
145
+ /**
146
+ * Optional color mode (`'light'` | `'dark'`) forwarded to the
147
+ * renderer. The runtime resolves the dark variant of {@link themeId}
148
+ * via `getTheme(id, 'dark')` when this is set; absent / unknown
149
+ * value falls back to `'light'`. Sourced from
150
+ * `LoadedTheme.mode` for preset/file forms; default-source themes
151
+ * omit this field entirely.
152
+ */
153
+ readonly themeMode?: 'light' | 'dark';
154
+ /**
155
+ * Optional pre-serialized props (must be a JSON string) forwarded
156
+ * to the renderer. Server inlines the string verbatim — the
157
+ * renderer parses + narrows to `Record<string, unknown>` at boot.
158
+ */
159
+ readonly propsJson?: string;
160
+ /**
161
+ * Names of same-server tools whose `_meta.ui.visibility` includes
162
+ * `"app"`, mirrored from {@link GguiBootstrapMeta.appCallableTools}.
163
+ * Forwarded to the iframe-runtime so its dispatch closure can choose
164
+ * Pattern α (direct `tools/call`) over Pattern β (3-message bridge)
165
+ * per wired action — even on the self-contained `/r/<shortCode>`
166
+ * path where there's no `ui/initialize` round-trip to deliver the
167
+ * field.
168
+ *
169
+ * Empty / absent → no fallout: the runtime's dispatch routes every
170
+ * action through Pattern β.
171
+ */
172
+ readonly appCallableTools?: GguiBootstrapMeta['appCallableTools'];
173
+ /**
174
+ * Per-action wired-tool mapping for the active stack item, mirrored
175
+ * from {@link GguiBootstrapMeta.actionNextSteps}.
176
+ */
177
+ readonly actionNextSteps?: GguiBootstrapMeta['actionNextSteps'];
178
+ /**
179
+ * Per-slot data for the active stack item's `contextSpec`, mirrored
180
+ * from {@link GguiBootstrapMeta.contextSlots}. The runtime
181
+ * synthesizes one `React.createContext(default)` per entry at boot.
182
+ * Without this field, contextSpec UIs render with un-seeded
183
+ * Providers.
184
+ */
185
+ readonly contextSlots?: GguiBootstrapMeta['contextSlots'];
186
+ /**
187
+ * Permissions-Policy directive list derived from the active stack
188
+ * item's `clientCapabilities.gadgets[*].permission`.
189
+ * When present (non-empty), inlined onto the bootstrap as
190
+ * `permissionsPolicy` so the iframe-runtime can surface the gate set
191
+ * to in-iframe consumers (debug overlay, permission-aware UI). The
192
+ * actual browser-enforced gate comes from the iframe's
193
+ * `Permissions-Policy` HTTP header (set on the public-render
194
+ * response by `/r/<shortCode>`) or the host's `allow=""` attribute
195
+ * (set from `_meta.ui.permissions` by McpAppIframe) — both derive
196
+ * from the same source. Empty / absent = no permissions requested.
197
+ */
198
+ readonly permissionsPolicy?: readonly string[];
199
+ /**
200
+ * Resolved gadget catalog the iframe runtime dynamically imports at
201
+ * boot. Each entry is `{hook,
202
+ * package?, bundleUrl?}`. The MCP-Apps `_meta.ggui.bootstrap`
203
+ * channel already forwards this via `push.ts`; this field is the
204
+ * symmetric forward for the self-contained shell so `/r/<shortCode>`
205
+ * and `resources/read` iframes don't render as STDLIB-only when
206
+ * the contract declares wrappers.
207
+ */
208
+ readonly gadgets?: GguiBootstrapMeta['gadgets'];
209
+ /**
210
+ * Precompiled, eval-free contract validators (one ESM validator-
211
+ * module source per `propsSpec` / `actionSpec` / `streamSpec` /
212
+ * `contextSpec`), mirrored from
213
+ * {@link GguiBootstrapMeta.compiledValidators}. The renderer iframe's
214
+ * strict CSP (no `'unsafe-eval'`) blocks runtime `ajv.compile()`, so
215
+ * the iframe loads these precompiled modules via `blob:` import
216
+ * instead. Symmetric forward for the self-contained shell so
217
+ * `/r/<shortCode>` and `resources/read` iframes validate wire
218
+ * traffic exactly as the MCP-Apps postMessage path does.
219
+ */
220
+ readonly compiledValidators?: GguiBootstrapMeta['compiledValidators'];
221
+ /**
222
+ * Server-filtered public env values that declared wrappers'
223
+ * `requires` cover (minimum-disclosure subset of `App.publicEnv`).
224
+ * Symmetric with the `_meta.ggui.bootstrap` channel — every
225
+ * transport that produces a `GguiBootstrapMeta` envelope MUST
226
+ * forward this field so wrappers' `getPublicEnv()` reads land.
227
+ */
228
+ readonly publicEnv?: GguiBootstrapMeta['publicEnv'];
229
+ /**
230
+ * Live-mode WebSocket URL the iframe-runtime opens to receive
231
+ * `props_update` / `stack_*` frames. When set alongside `token` +
232
+ * `expiresAt`, the parser admits the bootstrap as live-mode; when
233
+ * absent, the shell renders the static stack item but receives no
234
+ * push updates after mount (the bug `/r/<shortCode>` exhibited before
235
+ * we threaded the bootstrap minter through this route).
236
+ */
237
+ readonly wsUrl?: string;
238
+ /**
239
+ * Single-use bootstrap token authorising the WS subscribe. Paired
240
+ * with {@link wsUrl} — half-live envelopes (one without the other)
241
+ * are rejected as MALFORMED by `parseBootstrap`. Server-minted via
242
+ * the same `mintBootstrap` minter the JSON `/api/bootstrap/<shortCode>`
243
+ * route uses, so both transports share replay-cache state.
244
+ */
245
+ readonly token?: string;
246
+ /**
247
+ * ISO-8601 expiry of {@link token}. Past-due envelopes degrade to
248
+ * static-only mode at parse time; the static UI still mounts, but
249
+ * live updates silently no-op until a fresh push refreshes creds.
250
+ */
251
+ readonly expiresAt?: string;
252
+ }
253
+ /**
254
+ * Build the self-contained shell HTML for a given session.
255
+ *
256
+ * The returned HTML is a complete, standalone document: it inlines the
257
+ * compiled component (base64) + session ids in a `window.__GGUI_BOOTSTRAP__`
258
+ * global, then loads the iframe-runtime bundle via `<script type="module"
259
+ * src={runtimeUrl}>`. The runtime takes over synchronously on import,
260
+ * mounts the component, and the iframe paints WITHOUT any further server
261
+ * round-trip.
262
+ *
263
+ * Pure function — no DOM access, no I/O, no `crypto` randomness. Same
264
+ * inputs always produce identical bytes (modulo input ordering of the
265
+ * bootstrap object's optional fields), which makes the output cacheable
266
+ * and testable.
267
+ *
268
+ * Escapes that matter:
269
+ * - HTML-entity-escapes the bootstrap JSON for `<` `>` `&` so a
270
+ * malicious appId / sessionId can't break out of the script tag.
271
+ * - The componentCode is base64-encoded by the caller before the JSON
272
+ * stringification runs, so even a raw `</script>` sequence in the
273
+ * compiled source can't break the surrounding HTML.
274
+ *
275
+ * @public
276
+ */
277
+ export declare function buildSelfContainedShell(opts: SelfContainedShellInputs): string;
278
+ /**
279
+ * Minimal "loading" HTML served when a per-session resource is fetched
280
+ * for a session whose top stack item has no componentCode yet
281
+ * (placeholder, generation in flight). Renders a tiny status surface
282
+ * so hosts that pin lifecycle selectors don't see a blank document.
283
+ *
284
+ * Hosts SHOULD re-fetch when they observe additional `ggui_push`
285
+ * results on the same session — the per-call `_meta.ui.resourceUri`
286
+ * value stays stable across pushes for a session, so re-fetching the
287
+ * same URI returns fresher HTML on the second try.
288
+ *
289
+ * @public
290
+ */
291
+ export declare function buildSelfContainedLoadingShell(sessionId: string): string;
292
+ /**
293
+ * Options for {@link registerGguiSessionResourceTemplate}.
294
+ *
295
+ * @public
296
+ */
297
+ export interface GguiSessionResourceTemplateOptions {
298
+ /** SessionStore the template handler reads to find the topmost
299
+ * stack item's componentCode. */
300
+ readonly sessionStore: SessionStore;
301
+ /** Absolute URL of the iframe-runtime bundle inlined in the shell. */
302
+ readonly runtimeUrl: string;
303
+ /**
304
+ * Content-addressable code-blob store. When wired alongside
305
+ * {@link codeBaseUrl}, the resource template hashes the top stack
306
+ * item's componentCode, writes it to the store, and inlines the
307
+ * resulting `codeUrl` into the shell bootstrap. Without these deps
308
+ * the resource path emits the loading shell when the top item is a
309
+ * compiled component (the static-component channel cannot deliver
310
+ * without a URL).
311
+ */
312
+ readonly codeStore?: import('@ggui-ai/mcp-server-core').CodeStore;
313
+ /**
314
+ * Base URL the code-blob route resolves to. Paired with {@link codeStore}.
315
+ */
316
+ readonly codeBaseUrl?: string;
317
+ /**
318
+ * Theme preset id resolved from `ggui.json#theme`. Without this,
319
+ * MCP-Apps hosts (claude.ai, Claude Desktop) that fetch the resource
320
+ * via `resources/read` always render the runtime's baked default
321
+ * theme — `ggui.json#theme: 'indigo'` would only take effect on
322
+ * the direct-browser `/r/<shortCode>` path, not in claude.ai.
323
+ */
324
+ readonly themeId?: string;
325
+ /** Theme color mode resolved from `ggui.json#theme.mode`. */
326
+ readonly themeMode?: 'light' | 'dark';
327
+ /**
328
+ * Per-app metadata store the resource handler reads to resolve
329
+ * `App.publicEnv` for the bootstrap projection.
330
+ * Symmetric with `/r/<shortCode>`'s lookup; wraps the same store
331
+ * the push gate reads. Absent ⇒ publicEnv stays empty on the
332
+ * resource-served bootstrap (wrappers calling `getPublicEnv` throw
333
+ * at hook-mount with a clear "not provided" message).
334
+ */
335
+ readonly appMetadataStore?: import('@ggui-ai/mcp-server-core').AppMetadataStore;
336
+ /**
337
+ * Vector store backing the blueprint registry. When wired alongside
338
+ * `defaultAppIdFallback`, the resource handler runs a registry-only
339
+ * rehydrate fallback for the two-segment URI shape
340
+ * (`ui://ggui/session/{sessionId}/{blueprintKey}`): if the session is
341
+ * gone but the blueprint registry still holds the entry, return the
342
+ * static initial render (default props + default context) instead of
343
+ * the dead "Generating UI…" loading shell. Single-tenant OSS sees
344
+ * meaningful improvement; multi-tenant deployments leave both options
345
+ * undefined to keep the loading-shell behavior on session miss.
346
+ */
347
+ readonly vectorStore?: VectorStore;
348
+ /**
349
+ * App-id used for blueprint-registry scoping when the session has
350
+ * been evicted. The registry is per-`appId`, but a missing session
351
+ * has no way to derive its tenant — multi-tenant deployments leave
352
+ * this undefined to fail-safe back to the loading shell. Single-
353
+ * tenant OSS sets `'builder'` (the universal-MCP default identity)
354
+ * and rehydrate works across session expiry / process restart.
355
+ */
356
+ readonly defaultAppIdFallback?: string;
357
+ /**
358
+ * Bootstrap minter for canvas-mode
359
+ * sessions. Supplied by the deployment (cloud wires it to the
360
+ * AppSync-bound minter; OSS wires it to the in-process minter
361
+ * already used by /api/bootstrap/<shortCode>).
362
+ *
363
+ * When the resource handler observes `session.mcpAppsMode ===
364
+ * 'canvas'`, it calls this to obtain `wsUrl` + `token` + `expiresAt`
365
+ * and inlines them on the canvas shell's bootstrap. Without this
366
+ * dep wired, the handler falls back to the legacy single-item path
367
+ * (no canvas).
368
+ *
369
+ * Returning `null` / throwing here degrades to the legacy path
370
+ * silently — the caller has no way to deliver a working canvas
371
+ * without WS credentials, but pinning a stackItem render is
372
+ * strictly better than serving a dead-loading shell.
373
+ */
374
+ readonly mintBootstrap?: (sessionId: string, appId: string) => Promise<{
375
+ readonly wsUrl: string;
376
+ readonly token: string;
377
+ readonly expiresAt: string;
378
+ } | null>;
379
+ /**
380
+ * Operator-supplied public origin. When present, every
381
+ * `resources/read` response from this template carries
382
+ * `_meta.ui.csp.{connectDomains,resourceDomains}` so claude.ai's
383
+ * cross-origin iframe CSP allows the runtime bundle, codeUrl
384
+ * fetches, and the live-channel WebSocket. Symmetric with the
385
+ * declaration on the static `ui://ggui/session` resource. Absent ⇒
386
+ * `_meta.ui.csp` omitted and the host's default CSP applies
387
+ * (`connect-src 'none'` in claude.ai — runtime bundle fails to
388
+ * load with a generic "script error").
389
+ */
390
+ readonly publicBaseUrl?: string;
391
+ }
392
+ /**
393
+ * Register a `ui://ggui/session/{sessionId}` resource template. Each
394
+ * `resources/read` request is resolved by looking up the session in the
395
+ * store, picking the topmost component stack item, and returning the
396
+ * self-contained shell with that componentCode inlined.
397
+ *
398
+ * Per-call `_meta.ui.resourceUri` (stamped by `ggui_push.resultMeta`)
399
+ * pins the URI to a specific sessionId; hosts fetch THAT URI rather
400
+ * than the static `ui://ggui/session` one. Both registrations co-exist:
401
+ * legacy postMessage shell at the static URI, self-contained shell at
402
+ * the templated URI.
403
+ *
404
+ * Failure modes:
405
+ * - Session not found → loading shell (host re-fetches; absent
406
+ * session is a transient state immediately after `ggui_push`).
407
+ * - Session found, no componentCode yet → loading shell.
408
+ * - Session found, componentCode present → self-contained shell.
409
+ *
410
+ * Returns nothing; mutates the server in place.
411
+ *
412
+ * @public
413
+ */
414
+ export declare function registerGguiSessionResourceTemplate(server: McpServer, opts: GguiSessionResourceTemplateOptions): void;
415
+ /**
416
+ * Apply the full MCP Apps outbound wiring to a fresh `McpServer` - both
417
+ * the capability advertisement and the `ui://ggui/session` resource. The
418
+ * single entry-point `build-mcp.ts` calls so request-path wiring stays
419
+ * one line.
420
+ *
421
+ * When `selfContained` is supplied, ALSO registers the per-session
422
+ * `ui://ggui/session/{sessionId}` resource template that serves the
423
+ * self-contained shell (the path third-party MCP Apps hosts use). The
424
+ * legacy static URI registration is unconditional — first-party hosts
425
+ * (Studio, Portal, console) still rely on the postMessage path.
426
+ */
427
+ export declare function installMcpAppsOutbound(server: McpServer, opts?: {
428
+ readonly shellHtml?: string;
429
+ /**
430
+ * Per-session self-contained shell registration. When supplied,
431
+ * `ui://ggui/session/{sessionId}` becomes a readable resource
432
+ * template whose body inlines the compiled componentCode from the
433
+ * session's topmost stack item. Absent → only the legacy
434
+ * postMessage shell is registered.
435
+ */
436
+ readonly selfContained?: GguiSessionResourceTemplateOptions;
437
+ /**
438
+ * Public origin the server is reachable at — forwarded to
439
+ * `registerGguiSessionResource` so the static `ui://ggui/session`
440
+ * resource carries `_meta.ui.csp.{connectDomains,resourceDomains}`
441
+ * authorising the iframe to fetch the runtime bundle and open a
442
+ * WebSocket. Omit when running same-origin behind a first-party
443
+ * host (Studio/Portal/console) — the parent SPA owns the CSP
444
+ * there via `<McpAppIframe>`.
445
+ */
446
+ readonly publicBaseUrl?: string;
447
+ }): void;
448
+ //# sourceMappingUR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