@nimblebrain/synapse 0.19.0 → 0.21.0

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 (100) hide show
  1. package/README.md +20 -25
  2. package/dist/check-QMTOCTRS.js +474 -0
  3. package/dist/check-QMTOCTRS.js.map +1 -0
  4. package/dist/check-VK4SOAUU.cjs +480 -0
  5. package/dist/check-VK4SOAUU.cjs.map +1 -0
  6. package/dist/{chunk-RU64F5RS.cjs → chunk-BNF352SA.cjs} +57 -146
  7. package/dist/chunk-BNF352SA.cjs.map +1 -0
  8. package/dist/{chunk-DRLVEHCD.js → chunk-DJS2FKBN.js} +21 -79
  9. package/dist/chunk-DJS2FKBN.js.map +1 -0
  10. package/dist/chunk-H3INUKA3.js +32 -0
  11. package/dist/chunk-H3INUKA3.js.map +1 -0
  12. package/dist/chunk-HQLSVUOR.cjs +667 -0
  13. package/dist/chunk-HQLSVUOR.cjs.map +1 -0
  14. package/dist/{chunk-NP7ROSH2.cjs → chunk-ISV6HFQE.cjs} +14 -7
  15. package/dist/chunk-ISV6HFQE.cjs.map +1 -0
  16. package/dist/chunk-TR2YNWZ5.js +658 -0
  17. package/dist/chunk-TR2YNWZ5.js.map +1 -0
  18. package/dist/{chunk-OYLZ5OCK.js → chunk-UKP4W6DI.js} +57 -146
  19. package/dist/chunk-UKP4W6DI.js.map +1 -0
  20. package/dist/{chunk-SZWHFTXV.cjs → chunk-YSL7KJNU.cjs} +21 -81
  21. package/dist/chunk-YSL7KJNU.cjs.map +1 -0
  22. package/dist/codegen/cli.cjs +41 -4
  23. package/dist/codegen/cli.cjs.map +1 -1
  24. package/dist/codegen/cli.js +41 -4
  25. package/dist/codegen/cli.js.map +1 -1
  26. package/dist/codegen/index.cjs +0 -1
  27. package/dist/codegen/index.d.cts +1 -1
  28. package/dist/codegen/index.d.ts +1 -1
  29. package/dist/codegen/index.js +0 -1
  30. package/dist/connect.iife.global.js +34 -34
  31. package/dist/{detect-DZMJsyvZ.d.cts → detect-DVGaL2bH.d.cts} +39 -33
  32. package/dist/{detect-DBwc8a21.d.ts → detect-DVGaL2bH.d.ts} +39 -33
  33. package/dist/host/index.cjs +17 -18
  34. package/dist/host/index.d.cts +11 -27
  35. package/dist/host/index.d.ts +11 -27
  36. package/dist/host/index.js +2 -3
  37. package/dist/index.cjs +30 -19
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +72 -26
  40. package/dist/index.d.ts +72 -26
  41. package/dist/index.js +8 -9
  42. package/dist/index.js.map +1 -1
  43. package/dist/react/index.cjs +9 -10
  44. package/dist/react/index.cjs.map +1 -1
  45. package/dist/react/index.d.cts +36 -8
  46. package/dist/react/index.d.ts +36 -8
  47. package/dist/react/index.js +3 -4
  48. package/dist/react/index.js.map +1 -1
  49. package/dist/schema-reader-776246MJ.js +3 -0
  50. package/dist/{schema-reader-GM4A4L44.js.map → schema-reader-776246MJ.js.map} +1 -1
  51. package/dist/{schema-reader-MWBRQ2TQ.cjs → schema-reader-B6LTGBMJ.cjs} +2 -3
  52. package/dist/{schema-reader-MWBRQ2TQ.cjs.map → schema-reader-B6LTGBMJ.cjs.map} +1 -1
  53. package/dist/{server-LR6T6C44.cjs → server-BR5MNFOB.cjs} +13 -14
  54. package/dist/server-BR5MNFOB.cjs.map +1 -0
  55. package/dist/{server-UHPEE55X.js → server-OOEEWAEG.js} +13 -14
  56. package/dist/server-OOEEWAEG.js.map +1 -0
  57. package/dist/synapse-runtime.iife.global.js +34 -34
  58. package/dist/synapse-ui.iife.global.js +4 -4
  59. package/dist/type-generator-MZ4X4DE5.js +3 -0
  60. package/dist/{type-generator-ZYSVFK3X.js.map → type-generator-MZ4X4DE5.js.map} +1 -1
  61. package/dist/{type-generator-YTPFWLVG.cjs → type-generator-UA3L4OIA.cjs} +2 -3
  62. package/dist/{type-generator-YTPFWLVG.cjs.map → type-generator-UA3L4OIA.cjs.map} +1 -1
  63. package/dist/{types-CG08aO82.d.cts → types-BxPfGHKO.d.cts} +35 -43
  64. package/dist/{types-CG08aO82.d.ts → types-BxPfGHKO.d.ts} +35 -43
  65. package/dist/ui/base.cjs +0 -1
  66. package/dist/ui/base.cjs.map +1 -1
  67. package/dist/ui/base.js +0 -1
  68. package/dist/ui/base.js.map +1 -1
  69. package/dist/ui/index.cjs +0 -1
  70. package/dist/ui/index.cjs.map +1 -1
  71. package/dist/ui/index.js +0 -1
  72. package/dist/ui/index.js.map +1 -1
  73. package/dist/vite/index.cjs +10 -10
  74. package/dist/vite/index.cjs.map +1 -1
  75. package/dist/vite/index.js +6 -6
  76. package/dist/vite/index.js.map +1 -1
  77. package/dist/{writer-HDRCQSX2.cjs → writer-NDK4U6C5.cjs} +3 -3
  78. package/dist/{writer-HDRCQSX2.cjs.map → writer-NDK4U6C5.cjs.map} +1 -1
  79. package/dist/{writer-QNDPMEYD.js → writer-ZNBXYUYC.js} +3 -3
  80. package/dist/{writer-QNDPMEYD.js.map → writer-ZNBXYUYC.js.map} +1 -1
  81. package/package.json +6 -3
  82. package/dist/chunk-54W6IAHM.js +0 -24
  83. package/dist/chunk-54W6IAHM.js.map +0 -1
  84. package/dist/chunk-DRLVEHCD.js.map +0 -1
  85. package/dist/chunk-NP7ROSH2.cjs.map +0 -1
  86. package/dist/chunk-OYLZ5OCK.js.map +0 -1
  87. package/dist/chunk-P5DBJFSQ.js +0 -8459
  88. package/dist/chunk-P5DBJFSQ.js.map +0 -1
  89. package/dist/chunk-PZ5AY32C.js +0 -9
  90. package/dist/chunk-PZ5AY32C.js.map +0 -1
  91. package/dist/chunk-Q7SFCCGT.cjs +0 -11
  92. package/dist/chunk-Q7SFCCGT.cjs.map +0 -1
  93. package/dist/chunk-QXDCA7QW.cjs +0 -8466
  94. package/dist/chunk-QXDCA7QW.cjs.map +0 -1
  95. package/dist/chunk-RU64F5RS.cjs.map +0 -1
  96. package/dist/chunk-SZWHFTXV.cjs.map +0 -1
  97. package/dist/schema-reader-GM4A4L44.js +0 -4
  98. package/dist/server-LR6T6C44.cjs.map +0 -1
  99. package/dist/server-UHPEE55X.js.map +0 -1
  100. package/dist/type-generator-ZYSVFK3X.js +0 -4
@@ -1,6 +1,6 @@
1
- (function(){'use strict';var be=new Set(["auto","block","swap","fallback","optional"]),ke={"--color-background-primary":"#ffffff","--color-background-secondary":"#fafafa","--color-background-tertiary":"#f3f4f6","--color-text-primary":"#111827","--color-text-secondary":"#6b7280","--color-text-tertiary":"#9ca3af","--color-text-accent":"#2563eb","--nb-color-accent-foreground":"#ffffff","--color-border-primary":"#e5e7eb","--color-border-secondary":"#d1d5db","--color-ring-primary":"#2563eb","--nb-color-danger":"#dc2626","--nb-color-danger-foreground":"#ffffff","--nb-color-success":"#059669","--nb-color-warning":"#f59e0b","--nb-color-processing":"#7c3aed","--nb-color-processing-light":"#f3eeff","--nb-color-info-light":"#eef4ff"},Pe={"--color-background-primary":"#18181b","--color-background-secondary":"#27272a","--color-background-tertiary":"#2f2f34","--color-text-primary":"#fafafa","--color-text-secondary":"#a1a1aa","--color-text-tertiary":"#71717a","--color-text-accent":"#818cf8","--nb-color-accent-foreground":"#ffffff","--color-border-primary":"#3f3f46","--color-border-secondary":"#52525b","--color-ring-primary":"#818cf8","--nb-color-danger":"#f87171","--nb-color-danger-foreground":"#18181b","--nb-color-success":"#34d399","--nb-color-warning":"#fbbf24","--nb-color-processing":"#a78bfa","--nb-color-processing-light":"#2a2440","--nb-color-info-light":"#1e2a44"},Ee={light:ke,dark:Pe},Ie="synapse-defaults",G="synapse-theme-defaults",W=new Set;function ve(){return typeof document<"u"&&typeof document.getElementById=="function"&&typeof document.createElement=="function"&&typeof document.head?.prepend=="function"}function Ae(e){if(!ve())return;let o=Object.entries(Ee[e]).map(([a,p])=>` ${a}: ${p};`).join(`
2
- `),n=`@layer ${Ie} {
1
+ (function(){'use strict';function v(e,n){if(!e)return null;let a=e.getElementById(n)?.textContent;if(!a)return null;try{return JSON.parse(a)??null}catch{return null}}var ce={"--color-background-primary":"#ffffff","--color-background-secondary":"#fafafa","--color-background-tertiary":"#f3f4f6","--color-text-primary":"#111827","--color-text-secondary":"#6b7280","--color-text-tertiary":"#9ca3af","--color-text-accent":"#2563eb","--nb-color-accent-foreground":"#ffffff","--color-border-primary":"#e5e7eb","--color-border-secondary":"#d1d5db","--color-ring-primary":"#2563eb","--nb-color-danger":"#dc2626","--nb-color-danger-foreground":"#ffffff","--nb-color-success":"#059669","--nb-color-warning":"#f59e0b","--nb-color-processing":"#7c3aed","--nb-color-processing-light":"#f3eeff","--nb-color-info-light":"#eef4ff"},de={"--color-background-primary":"#18181b","--color-background-secondary":"#27272a","--color-background-tertiary":"#2f2f34","--color-text-primary":"#fafafa","--color-text-secondary":"#a1a1aa","--color-text-tertiary":"#71717a","--color-text-accent":"#818cf8","--nb-color-accent-foreground":"#ffffff","--color-border-primary":"#3f3f46","--color-border-secondary":"#52525b","--color-ring-primary":"#818cf8","--nb-color-danger":"#f87171","--nb-color-danger-foreground":"#18181b","--nb-color-success":"#34d399","--nb-color-warning":"#fbbf24","--nb-color-processing":"#a78bfa","--nb-color-processing-light":"#2a2440","--nb-color-info-light":"#1e2a44"},le={light:ce,dark:de},ue="synapse-defaults",D="synapse-theme-defaults",U=new Set;function pe(){return typeof document<"u"&&typeof document.getElementById=="function"&&typeof document.createElement=="function"&&typeof document.head?.prepend=="function"}function fe(e){if(!pe())return;let n=Object.entries(le[e]).map(([s,l])=>` ${s}: ${l};`).join(`
2
+ `),o=`@layer ${ue} {
3
3
  :root {
4
- ${o}
4
+ ${n}
5
5
  }
6
- }`,s=document.getElementById(G);if(s){s.textContent!==n&&(s.textContent=n);return}let i=document.createElement("style");i.id=G,i.textContent=n,document.head.prepend(i);}function Ce(e,o){if(typeof document>"u")return;Ae(e);let n={};if(o&&typeof o=="object")for(let[i,a]of Object.entries(o))typeof i=="string"&&typeof a=="string"&&(n[i]=a);let s=document.documentElement.style;if(typeof s.removeProperty=="function")for(let i of W)i in n||s.removeProperty(i);for(let[i,a]of Object.entries(n))s.setProperty(i,a);W=new Set(Object.keys(n));}var F=new Set,Y="";function w(e){return Array.isArray(e)?JSON.stringify(e.map(o=>[o.family,o.src,o.weight,o.style,o.display])):""}function M(e){if(!Array.isArray(e))return;let o=e.filter(Oe);if(!(e.length>0&&o.length===0))return o}function we(e){let o=M(e);if(o===void 0||typeof document>"u"||!document.fonts||typeof FontFace>"u")return;let n=w(o);if(n!==Y){Y=n;for(let s of F)try{document.fonts.delete(s);}catch{}F.clear();for(let s of o)try{let i=new FontFace(s.family,s.src,{weight:s.weight,style:s.style,display:s.display&&be.has(s.display)?s.display:"swap"});document.fonts.add(i),F.add(i);}catch{}}}function Oe(e){if(!e||typeof e!="object")return false;let o=e;return typeof o.family=="string"&&typeof o.src=="string"}function Z(e,o,n){Ce(e,o),we(n);}function R(e){typeof document<"u"&&document.documentElement.setAttribute("data-theme",e.mode),Z(e.mode,e.tokens,e.fontFaces);}function O(e){try{if(e?.matchMedia?.("(prefers-color-scheme: dark)").matches)return "dark"}catch{}return "light"}function h(e,o){return e==="light"||e==="dark"?e:o}var T=class extends Error{constructor(o,n){super(`"${o}" is not supported by the "${n}" host`),this.name="HostUnsupportedError";}},_="synapse-ui-data",$="ui-lifecycle-iframe-ready",V="ui-lifecycle-iframe-render-data",q="ui-size-change",B="link",Q="prompt",L="openai:set_globals",X="2026-01-26",J="ui/initialize",ee="ui/notifications/initialized",te="ui/notifications/tool-result",ne="ui/notifications/host-context-changed",oe="ui/notifications/size-changed",re="ui/open-link",se="ui/message",ie="ui/resource-teardown",ae="tools/call";function ce(e,o){let n=()=>e.openai,s=n()?.toolOutput??null,i={mode:h(n()?.theme,"light"),tokens:{}},a=new Set,p=new Set,f=false,m=c=>{if(f)return;let l=c.detail?.globals;if(l){if("toolOutput"in l&&l.toolOutput!=null){s=l.toolOutput;for(let u of a)u(s);}if("theme"in l&&l.theme!=null){let u=h(l.theme,i.mode);if(u!==i.mode){i={mode:u,tokens:{}};for(let b of p)b(i);}}}};return {host:"chatgpt",getData:()=>s,onData(c){return a.add(c),()=>a.delete(c)},getTheme:()=>i,onTheme(c){return p.add(c),()=>p.delete(c)},async callTool(c,l){let u=n()?.callTool;if(!u)throw new T("callTool","chatgpt");return await u(c,l??{})},sendPrompt(c){let l=n();(l?.sendFollowUpMessage??l?.sendFollowupMessage)?.({prompt:c});},openLink(c){let l=n()?.openExternal;l?l({href:c}):e.open(c,"_blank","noopener,noreferrer");},resize(){},capabilities(){let c=n();return {pull:typeof c?.callTool=="function",sendPrompt:typeof c?.sendFollowUpMessage=="function"||typeof c?.sendFollowupMessage=="function",openLink:true}},start(){e.addEventListener(L,m,{passive:true}),s=n()?.toolOutput??s;},destroy(){f||(f=true,e.removeEventListener(L,m),a.clear(),p.clear());}}}function x(e,o){if(!e)return null;let s=e.getElementById(o)?.textContent;if(!s)return null;try{return JSON.parse(s)??null}catch{return null}}function U(e){if(e==null||typeof e!="object")return null;let o=e,n=o.renderData,s=n!=null&&typeof n=="object"?n:o;return s.toolOutput!=null?s.toolOutput:s.structuredContent!=null?s.structuredContent:s}function le(e,o){let n=o.dataElementId??_,s=null,i={mode:O(e),tokens:{}},a=new Set,p=false,f=null,m=c=>{if(p)return;let l=h(c.matches?"dark":"light",i.mode);if(l!==i.mode){i={mode:l,tokens:{}};for(let u of a)u(i);}};return {host:"generic",getData:()=>s,onData(){return ()=>{}},getTheme:()=>i,onTheme(c){return a.add(c),()=>a.delete(c)},async callTool(c){throw new T("callTool","generic")},sendPrompt(){},openLink(c){e.open(c,"_blank","noopener,noreferrer");},resize(){},capabilities(){return {pull:false,sendPrompt:false,openLink:true}},start(){s=x(e.document,n);try{f=e.matchMedia?.("(prefers-color-scheme: dark)")??null,f?.addEventListener?.("change",m);}catch{f=null;}},destroy(){p||(p=true,f?.removeEventListener?.("change",m),f=null,a.clear());}}}var _e="synapse/fontFaces";function xe(e){return M(e?.[_e])}function de(e,o){return xe(o)??e}var De=3e4;function pe(e,o){let n=o.dataElementId??_,s=o.autoResize!==false,i=null,a={mode:O(e),tokens:{}},p=new Set,f=new Set,m=false,c=false,l=1,u=new Map,b=-1,v=null,k=null,H=()=>e.parent??e;function P(t){H().postMessage(t,"*");}function D(t){c||P(t);}function N(t,r){P({jsonrpc:"2.0",method:t,params:r??{}});}function A(t,r){let d=l++;return new Promise((g,y)=>{let I=setTimeout(()=>{u.delete(d),y(new Error(`"${t}" timed out`));},De);u.set(d,{resolve:g,reject:y,timer:I}),P({jsonrpc:"2.0",id:d,method:t,params:r??{}});})}function j(t){if(t!=null){i=t;for(let r of p)r(t);}}function S(t){if(!t||typeof t!="object")return;let{mode:r,tokens:d,fontFaces:g}=a,y=false;if(t.theme!=null){let C=h(t.theme,r);C!==r&&(r=C,y=true);}let I=t.styles;I?.variables&&typeof I.variables=="object"&&(d={...d,...I.variables},y=true);let K=de(g,t);if(w(K)!==w(g)&&(g=K,y=true),y){a={mode:r,tokens:d,...g?{fontFaces:g}:{}};for(let C of f)C(a);}}function E(t){if(m)return;let r=typeof t=="number"?t:Math.ceil(e.document.body.scrollHeight);r!==b&&(b=r,c&&N(oe,{height:r}),D({type:q,payload:{height:r}}));}function me(t){let r=Number(t.id),d=u.get(r);if(d)if(u.delete(r),clearTimeout(d.timer),t.error!=null){let g=t.error;d.reject(new Error(g.message??"request failed"));}else d.resolve(t.result);}function ge(t,r){if(t===te){let d=r.structuredContent;j(d??U(r));}else t===ne&&S(r);}function ye(t){t.method===ie&&P({jsonrpc:"2.0",id:t.id,result:{}});}function he(t){if(t.type===V||t.type==="renderData"){let{theme:r,...d}=t.payload??{};r!=null&&S({theme:r}),Object.keys(d).length>0&&j(U(d));}}let z=t=>{if(m||t.source&&t.source!==H())return;let r=t.data;if(!(!r||typeof r!="object")){if(r.jsonrpc!=="2.0"){he(r);return}r.id!=null&&("result"in r||"error"in r)?me(r):typeof r.method=="string"&&(r.id!=null?ye(r):ge(r.method,r.params??{}));}};function Te(){k=()=>E(),e.addEventListener("resize",k),typeof e.ResizeObserver<"u"&&(v=new e.ResizeObserver(()=>E()),v.observe(e.document.body));}return {host:"claude",getData:()=>i,onData(t){return p.add(t),()=>p.delete(t)},getTheme:()=>a,onTheme(t){return f.add(t),()=>f.delete(t)},async callTool(t,r){return await A(ae,{name:t,arguments:r??{}})},sendPrompt(t){A(se,{role:"user",content:[{type:"text",text:t}]}).catch(()=>{}),D({type:Q,payload:{prompt:t}});},openLink(t){A(re,{url:t}).catch(()=>{}),D({type:B,payload:{url:t}});},resize(t){E(t);},capabilities(){return {pull:true,sendPrompt:true,openLink:true}},start(){e.addEventListener("message",z),i=x(e.document,n),s&&Te(),P({type:$}),A(J,{appInfo:{name:o.name??"synapse-ui",version:o.version??"0.0.0"},appCapabilities:{availableDisplayModes:["inline"]},protocolVersion:X}).then(t=>{m||(c=true,S(t?.hostContext),N(ee,{}),b=-1,E());}).catch(()=>{}),E();},destroy(){if(!m){m=true,e.removeEventListener("message",z),k&&e.removeEventListener("resize",k),k=null,v?.disconnect(),v=null;for(let t of u.values())clearTimeout(t.timer),t.reject(new Error("adapter destroyed"));u.clear(),p.clear(),f.clear();}}}}function Se(e){if(e.openai!=null)return "chatgpt";try{if(e.parent!=null&&e.parent!==e)return "claude"}catch{return "claude"}return "generic"}function Fe(e,o,n){switch(e){case "chatgpt":return ce(o);case "claude":case "nimblebrain":return pe(o,n);default:return le(o,n)}}function ue(e,o){let n=o.host??Se(e);return Fe(n,e,o)}function fe(e={}){let o=e.window??globalThis,n=ue(o,e);R(n.getTheme());let s=n.onTheme(R);n.start();let i=false;return {data:()=>n.getData(),onData:a=>n.onData(a),theme:()=>n.getTheme(),onTheme:a=>n.onTheme(a),callTool:(a,p)=>n.callTool(a,p),sendPrompt:a=>n.sendPrompt(a),openLink:a=>n.openLink(a),resize:a=>n.resize(a),capabilities:()=>n.capabilities(),host:()=>n.host,destroy(){i||(i=true,s(),n.destroy());}}}globalThis.SynapseUI={connect:fe};})();
6
+ }`,a=document.getElementById(D);if(a){a.textContent!==o&&(a.textContent=o);return}let i=document.createElement("style");i.id=D,i.textContent=o,document.head.prepend(i);}function me(e,n){if(typeof document>"u")return;fe(e);let o={};if(n&&typeof n=="object")for(let[i,s]of Object.entries(n))typeof i=="string"&&typeof s=="string"&&(o[i]=s);let a=document.documentElement.style;if(typeof a.removeProperty=="function")for(let i of U)i in o||a.removeProperty(i);for(let[i,s]of Object.entries(o))a.setProperty(i,s);U=new Set(Object.keys(o));}function N(e,n){me(e,n);}function O(e){typeof document<"u"&&document.documentElement.setAttribute("data-theme",e.mode),N(e.mode,e.tokens);}var z="__mcp-host-fonts";function j(e){if(typeof document>"u"||document.getElementById(z))return;let n=document.createElement("style");n.id=z,n.textContent=e,document.head.appendChild(n);}function I(e){try{if(e?.matchMedia?.("(prefers-color-scheme: dark)").matches)return "dark"}catch{}return "light"}function C(e,n){return e==="light"||e==="dark"?e:n}var A=class extends Error{constructor(n,o){super(`"${n}" is not supported by the "${o}" host`),this.name="HostUnsupportedError";}},x=class extends Error{result;constructor(n,o){super(ge(o)??`tool "${n}" returned an error`),this.name="ToolCallError",this.result=o;}};function ge(e){let n=e?.content;if(Array.isArray(n))for(let o of n){let a=o;if(a?.type==="text"&&typeof a.text=="string"&&a.text!=="")return a.text}}function K(e){return e!=null&&typeof e=="object"&&e.isError===true}var w="synapse-ui-data",W="2026-01-26",F="ui/initialize",$="ui/notifications/initialized",G="ui/notifications/tool-result",Y="ui/notifications/host-context-changed",Z="ui/notifications/size-changed",q="ui/open-link",B="ui/message",Q="ui/resource-teardown",V="tools/call";function X(e,n){let o=n.dataElementId??w,a=null,i={mode:I(e),tokens:{}},s=new Set,l=false,d=null,p=u=>{if(l)return;let T=C(u.matches?"dark":"light",i.mode);if(T!==i.mode){i={mode:T,tokens:{}};for(let f of s)f(i);}};return {host:"generic",getData:()=>a,onData(){return ()=>{}},getTheme:()=>i,onTheme(u){return s.add(u),()=>s.delete(u)},async callTool(u){throw new A("callTool","generic")},sendPrompt(){},openLink(u){e.open(u,"_blank","noopener,noreferrer");},resize(){},capabilities(){return {pull:false,sendPrompt:false,openLink:true}},start(){a=v(e.document,o);try{d=e.matchMedia?.("(prefers-color-scheme: dark)")??null,d?.addEventListener?.("change",p);}catch{d=null;}},destroy(){l||(l=true,d?.removeEventListener?.("change",p),d=null,s.clear());}}}function J(e){let n=e?.styles?.css?.fonts;return typeof n=="string"&&n!==""?n:void 0}var ye=3e4;function ee(e,n){let o=n.dataElementId??w,a=n.autoResize!==false,i=null,s={mode:I(e),tokens:{}},l=new Set,d=new Set,p=false,u=false,T=1,f=new Map,S=-1,b=null,y=null,M=()=>e.parent??e;function _(t){M().postMessage(t,"*");}function R(t,r){_({jsonrpc:"2.0",method:t,params:r??{}});}function k(t,r){let c=T++;return new Promise((m,g)=>{let h=setTimeout(()=>{f.delete(c),g(new Error(`"${t}" timed out`));},ye);f.set(c,{resolve:m,reject:g,timer:h}),_({jsonrpc:"2.0",id:c,method:t,params:r??{}});})}function oe(t){if(t!=null){i=t;for(let r of l)r(t);}}function L(t){if(!t||typeof t!="object")return;let r=J(t);r!==void 0&&j(r);let{mode:c,tokens:m}=s,g=false;if(t.theme!=null){let P=C(t.theme,c);P!==c&&(c=P,g=true);}let h=t.styles;if(h?.variables&&typeof h.variables=="object"&&(m={...m,...h.variables},g=true),g){s={mode:c,tokens:m};for(let P of d)P(s);}}function E(t){if(p||!u)return;let r=typeof t=="number"?t:Math.ceil(e.document.body.scrollHeight);r!==S&&(S=r,R(Z,{height:r}));}function re(t){let r=Number(t.id),c=f.get(r);if(c)if(f.delete(r),clearTimeout(c.timer),t.error!=null){let m=t.error;c.reject(new Error(m.message??"request failed"));}else c.resolve(t.result);}function se(t,r){if(t===G){let c=r.structuredContent;oe(c??r);}else t===Y&&L(r);}function ie(t){t.method===Q&&_({jsonrpc:"2.0",id:t.id,result:{}});}let H=t=>{if(p||t.source&&t.source!==M())return;let r=t.data;!r||typeof r!="object"||r.jsonrpc!=="2.0"||(r.id!=null&&("result"in r||"error"in r)?re(r):typeof r.method=="string"&&(r.id!=null?ie(r):se(r.method,r.params??{})));};function ae(){y=()=>E(),e.addEventListener("resize",y),typeof e.ResizeObserver<"u"&&(b=new e.ResizeObserver(()=>E()),b.observe(e.document.body));}return {host:"mcp-apps",getData:()=>i,onData(t){return l.add(t),()=>l.delete(t)},getTheme:()=>s,onTheme(t){return d.add(t),()=>d.delete(t)},async callTool(t,r){return await k(V,{name:t,arguments:r??{}})},sendPrompt(t){k(B,{role:"user",content:[{type:"text",text:t}]}).catch(()=>{});},openLink(t){k(q,{url:t}).catch(()=>{});},resize(t){E(t);},capabilities(){return {pull:true,sendPrompt:true,openLink:true}},start(){e.addEventListener("message",H),i=v(e.document,o),a&&ae(),k(F,{appInfo:{name:n.name??"synapse-ui",version:n.version??"0.0.0"},appCapabilities:{availableDisplayModes:["inline"]},protocolVersion:W}).then(t=>{p||(L(t?.hostContext),R($,{}),u=true,E());}).catch(()=>{});},destroy(){if(!p){p=true,e.removeEventListener("message",H),y&&e.removeEventListener("resize",y),y=null,b?.disconnect(),b=null;for(let t of f.values())clearTimeout(t.timer),t.reject(new Error("adapter destroyed"));f.clear(),l.clear(),d.clear();}}}}function he(e){try{if(e.parent!=null&&e.parent!==e)return "mcp-apps"}catch{return "mcp-apps"}return "generic"}function Te(e,n,o){if(e==="mcp-apps")return ee(n,o);if(e==="generic")return X(n,o);throw new TypeError(`unknown host "${String(e)}": expected "mcp-apps" or "generic"`)}function te(e,n){let o=n.host??he(e);return Te(o,e,n)}function ne(e={}){let n=e.window??globalThis,o=te(n,e);O(o.getTheme());let a=o.onTheme(O);o.start();let i=false;return {data:()=>o.getData(),onData:s=>o.onData(s),theme:()=>o.getTheme(),onTheme:s=>o.onTheme(s),async callTool(s,l){let d=await o.callTool(s,l);if(K(d))throw new x(s,d);return d},sendPrompt:s=>o.sendPrompt(s),openLink:s=>o.openLink(s),resize:s=>o.resize(s),capabilities:()=>o.capabilities(),host:()=>o.host,destroy(){i||(i=true,a(),o.destroy());}}}globalThis.SynapseUI={connect:ne};})();
@@ -0,0 +1,3 @@
1
+ export { generateTypes } from './chunk-JKHGWDZI.js';
2
+ //# sourceMappingURL=type-generator-MZ4X4DE5.js.map
3
+ //# sourceMappingURL=type-generator-MZ4X4DE5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"type-generator-ZYSVFK3X.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"type-generator-MZ4X4DE5.js"}
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkHLT5UBJF_cjs = require('./chunk-HLT5UBJF.cjs');
4
- require('./chunk-Q7SFCCGT.cjs');
5
4
 
6
5
 
7
6
 
@@ -9,5 +8,5 @@ Object.defineProperty(exports, "generateTypes", {
9
8
  enumerable: true,
10
9
  get: function () { return chunkHLT5UBJF_cjs.generateTypes; }
11
10
  });
12
- //# sourceMappingURL=type-generator-YTPFWLVG.cjs.map
13
- //# sourceMappingURL=type-generator-YTPFWLVG.cjs.map
11
+ //# sourceMappingURL=type-generator-UA3L4OIA.cjs.map
12
+ //# sourceMappingURL=type-generator-UA3L4OIA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"type-generator-YTPFWLVG.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"type-generator-UA3L4OIA.cjs"}
@@ -1,4 +1,4 @@
1
- import { McpUiHostContext } from '@modelcontextprotocol/ext-apps';
1
+ import { McpUiHostContext, McpUiHostCapabilities } from '@modelcontextprotocol/ext-apps';
2
2
  import { ReadResourceRequest, ReadResourceResult, Task } from '@modelcontextprotocol/sdk/types.js';
3
3
 
4
4
  /**
@@ -94,45 +94,9 @@ interface TaskHandle<TOutput = unknown> {
94
94
  onStatus(cb: (task: Task) => void): () => void;
95
95
  }
96
96
 
97
- /**
98
- * One `@font-face` a host asks the app to load.
99
- *
100
- * The token contract can name a font (`--font-sans: 'Hanken Grotesk', system-ui`)
101
- * but cannot *load* one — a CSS custom property carries a family name, never the
102
- * `@font-face` rule behind it. An app iframe is its own document and inherits no
103
- * `@font-face` from the host page, so a host that only sends tokens is naming a
104
- * family the app has no way to render. This descriptor is the missing half.
105
- *
106
- * The SDK ships **no font data** — it applies what the host sends. A host that
107
- * sends none leaves the web-safe fallbacks in `ui/tokens.ts` in force.
108
- */
109
- interface FontFaceDescriptor {
110
- /** Family name, matching the one used in the host's `--font-*` token value. */
111
- family: string;
112
- /**
113
- * CSS `src` descriptor. Local and absolute URLs work identically —
114
- * `url('/fonts/x.woff2') format('woff2')` or `url('https://cdn.example/x.woff2')`.
115
- * Whatever origin this names must satisfy the app iframe's `font-src` CSP.
116
- */
117
- src: string;
118
- /** `font-weight` descriptor — a single weight (`400`) or a variable range (`400 700`). */
119
- weight?: string;
120
- /** `font-style` descriptor (`normal`, `italic`, …). */
121
- style?: string;
122
- /** `font-display` descriptor. Defaults to `swap` so text paints in the fallback first. */
123
- display?: FontDisplayValue;
124
- }
125
- /** The CSS `font-display` values. Closed set — anything else is ignored. */
126
- type FontDisplayValue = "auto" | "block" | "swap" | "fallback" | "optional";
127
97
  interface Theme {
128
98
  mode: "light" | "dark";
129
99
  tokens: Record<string, string>;
130
- /**
131
- * Font faces the host wants loaded into the app document. Optional — a host
132
- * that omits them leaves the web-safe fallbacks in force. Arrives over the
133
- * wire as the `synapse/fontFaces` host-context extension.
134
- */
135
- fontFaces?: FontFaceDescriptor[];
136
100
  }
137
101
  interface ToolCallResult<T = unknown> {
138
102
  data: T;
@@ -215,8 +179,8 @@ interface ConnectOptions {
215
179
  * the clipboard keys the browser must handle itself); an array forwards
216
180
  * exactly the listed combos. Absent means no forwarding.
217
181
  *
218
- * Only a NimbleBrain host consumes `synapse/keydown`, so forwarding stays
219
- * off everywhere else — a `preventDefault` on a host that does nothing with
182
+ * Forwarding is on only where the host declares `ai.nimblebrain/keydown`, and
183
+ * stays off everywhere else — a `preventDefault` on a host that does nothing with
220
184
  * the key would swallow it for no one's benefit.
221
185
  */
222
186
  forwardKeys?: boolean | KeyForwardConfig[];
@@ -264,7 +228,20 @@ interface App {
264
228
  * host-specific fields as optional; another host will not send them.
265
229
  */
266
230
  readonly hostContext: McpUiHostContext;
267
- /** True when the host identified itself as NimbleBrain in the handshake. */
231
+ /**
232
+ * What the host declared it supports, from the `ui/initialize` result. Every
233
+ * method here and every helper beside it checks this before it sends, and
234
+ * degrades in a documented way when the capability is absent. Read it to
235
+ * decide what to offer at all, rather than to find out from a no-op or an
236
+ * exception. NimbleBrain extensions are declared under `experimental`; see
237
+ * `hostSupports`.
238
+ */
239
+ readonly hostCapabilities: McpUiHostCapabilities;
240
+ /**
241
+ * True when the host identified itself as NimbleBrain in the handshake.
242
+ * Identity, not capability: nothing is gated on it except the NimbleBrain
243
+ * chat context on `sendMessage` (`_meta["ai.nimblebrain/context"]`), which other hosts ignore.
244
+ */
268
245
  readonly isNimbleBrainHost: boolean;
269
246
  /** True after `destroy()` has been called. */
270
247
  readonly destroyed: boolean;
@@ -286,7 +263,12 @@ interface App {
286
263
  on(event: "host-context-changed", handler: (ctx: McpUiHostContext) => void): () => void;
287
264
  on(event: "teardown", handler: () => void): () => void;
288
265
  on(event: string, handler: (params: any) => void): () => void;
266
+ /** Report the frame's size (`ui/notifications/size-changed`). Every host accepts it. */
289
267
  resize(width?: number, height?: number): void;
268
+ /**
269
+ * Open a URL through the host (`ui/open-link`). Without `openLinks`, or when
270
+ * the host refuses, opens it with `window.open` instead.
271
+ */
290
272
  openLink(url: string): void;
291
273
  /**
292
274
  * Push the app's visible state to the agent (ext-apps
@@ -294,7 +276,8 @@ interface App {
294
276
  * `state` rides along as `structuredContent` for tools that need the ids.
295
277
  *
296
278
  * Sends immediately. Callers that push on every keystroke or selection
297
- * change want `useModelContext`, which debounces.
279
+ * change want `useModelContext`, which debounces. A no-op when the host did
280
+ * not declare `updateModelContext`.
298
281
  */
299
282
  updateModelContext(state: Record<string, unknown>, summary?: string): void;
300
283
  /**
@@ -304,15 +287,24 @@ interface App {
304
287
  * to the server that mounted the app, so there is no target to name and no
305
288
  * option to pass — cross-source work belongs to the agent, which can call
306
289
  * two servers and hand one's result to the other.
290
+ *
291
+ * Rejects with `HostCapabilityError`, without sending, when the host did not
292
+ * declare `serverTools`.
307
293
  */
308
294
  callTool<TOutput = unknown>(name: string, args?: Record<string, unknown>): Promise<ToolCallResult<TOutput>>;
309
295
  /**
310
296
  * Read an MCP resource from the originating server via the host bridge
311
297
  * (ext-apps `resources/read`). Named to mirror the ext-apps spec's
312
298
  * `App.readServerResource`.
299
+ *
300
+ * Rejects with `HostCapabilityError`, without sending, when the host did not
301
+ * declare `serverResources`.
313
302
  */
314
303
  readServerResource(params: ReadResourceRequest["params"]): Promise<ReadResourceResult>;
315
- /** Send a user message into the agent conversation (ext-apps `ui/message`). */
304
+ /**
305
+ * Send a user message into the agent conversation (ext-apps `ui/message`).
306
+ * A no-op when the host did not declare `message`.
307
+ */
316
308
  sendMessage(text: string, context?: {
317
309
  action?: string;
318
310
  entity?: string;
@@ -320,4 +312,4 @@ interface App {
320
312
  destroy(): void;
321
313
  }
322
314
 
323
- export type { App as A, ConnectOptions as C, Dimensions as D, FileResult as F, KeyForwardConfig as K, ModelContext as M, RequestFileOptions as R, TaskHandle as T, CallToolAsTaskOptions as a, ToolCallResult as b, Theme as c, ToolResultData as d, ToolDefinition as e, FontFaceDescriptor as f, AppEventName as g, FontDisplayValue as h, TasksCapability as i };
315
+ export type { App as A, ConnectOptions as C, Dimensions as D, FileResult as F, KeyForwardConfig as K, ModelContext as M, RequestFileOptions as R, TaskHandle as T, CallToolAsTaskOptions as a, ToolCallResult as b, Theme as c, ToolResultData as d, ToolDefinition as e, AppEventName as f, TasksCapability as g };
@@ -1,4 +1,4 @@
1
- import { McpUiHostContext } from '@modelcontextprotocol/ext-apps';
1
+ import { McpUiHostContext, McpUiHostCapabilities } from '@modelcontextprotocol/ext-apps';
2
2
  import { ReadResourceRequest, ReadResourceResult, Task } from '@modelcontextprotocol/sdk/types.js';
3
3
 
4
4
  /**
@@ -94,45 +94,9 @@ interface TaskHandle<TOutput = unknown> {
94
94
  onStatus(cb: (task: Task) => void): () => void;
95
95
  }
96
96
 
97
- /**
98
- * One `@font-face` a host asks the app to load.
99
- *
100
- * The token contract can name a font (`--font-sans: 'Hanken Grotesk', system-ui`)
101
- * but cannot *load* one — a CSS custom property carries a family name, never the
102
- * `@font-face` rule behind it. An app iframe is its own document and inherits no
103
- * `@font-face` from the host page, so a host that only sends tokens is naming a
104
- * family the app has no way to render. This descriptor is the missing half.
105
- *
106
- * The SDK ships **no font data** — it applies what the host sends. A host that
107
- * sends none leaves the web-safe fallbacks in `ui/tokens.ts` in force.
108
- */
109
- interface FontFaceDescriptor {
110
- /** Family name, matching the one used in the host's `--font-*` token value. */
111
- family: string;
112
- /**
113
- * CSS `src` descriptor. Local and absolute URLs work identically —
114
- * `url('/fonts/x.woff2') format('woff2')` or `url('https://cdn.example/x.woff2')`.
115
- * Whatever origin this names must satisfy the app iframe's `font-src` CSP.
116
- */
117
- src: string;
118
- /** `font-weight` descriptor — a single weight (`400`) or a variable range (`400 700`). */
119
- weight?: string;
120
- /** `font-style` descriptor (`normal`, `italic`, …). */
121
- style?: string;
122
- /** `font-display` descriptor. Defaults to `swap` so text paints in the fallback first. */
123
- display?: FontDisplayValue;
124
- }
125
- /** The CSS `font-display` values. Closed set — anything else is ignored. */
126
- type FontDisplayValue = "auto" | "block" | "swap" | "fallback" | "optional";
127
97
  interface Theme {
128
98
  mode: "light" | "dark";
129
99
  tokens: Record<string, string>;
130
- /**
131
- * Font faces the host wants loaded into the app document. Optional — a host
132
- * that omits them leaves the web-safe fallbacks in force. Arrives over the
133
- * wire as the `synapse/fontFaces` host-context extension.
134
- */
135
- fontFaces?: FontFaceDescriptor[];
136
100
  }
137
101
  interface ToolCallResult<T = unknown> {
138
102
  data: T;
@@ -215,8 +179,8 @@ interface ConnectOptions {
215
179
  * the clipboard keys the browser must handle itself); an array forwards
216
180
  * exactly the listed combos. Absent means no forwarding.
217
181
  *
218
- * Only a NimbleBrain host consumes `synapse/keydown`, so forwarding stays
219
- * off everywhere else — a `preventDefault` on a host that does nothing with
182
+ * Forwarding is on only where the host declares `ai.nimblebrain/keydown`, and
183
+ * stays off everywhere else — a `preventDefault` on a host that does nothing with
220
184
  * the key would swallow it for no one's benefit.
221
185
  */
222
186
  forwardKeys?: boolean | KeyForwardConfig[];
@@ -264,7 +228,20 @@ interface App {
264
228
  * host-specific fields as optional; another host will not send them.
265
229
  */
266
230
  readonly hostContext: McpUiHostContext;
267
- /** True when the host identified itself as NimbleBrain in the handshake. */
231
+ /**
232
+ * What the host declared it supports, from the `ui/initialize` result. Every
233
+ * method here and every helper beside it checks this before it sends, and
234
+ * degrades in a documented way when the capability is absent. Read it to
235
+ * decide what to offer at all, rather than to find out from a no-op or an
236
+ * exception. NimbleBrain extensions are declared under `experimental`; see
237
+ * `hostSupports`.
238
+ */
239
+ readonly hostCapabilities: McpUiHostCapabilities;
240
+ /**
241
+ * True when the host identified itself as NimbleBrain in the handshake.
242
+ * Identity, not capability: nothing is gated on it except the NimbleBrain
243
+ * chat context on `sendMessage` (`_meta["ai.nimblebrain/context"]`), which other hosts ignore.
244
+ */
268
245
  readonly isNimbleBrainHost: boolean;
269
246
  /** True after `destroy()` has been called. */
270
247
  readonly destroyed: boolean;
@@ -286,7 +263,12 @@ interface App {
286
263
  on(event: "host-context-changed", handler: (ctx: McpUiHostContext) => void): () => void;
287
264
  on(event: "teardown", handler: () => void): () => void;
288
265
  on(event: string, handler: (params: any) => void): () => void;
266
+ /** Report the frame's size (`ui/notifications/size-changed`). Every host accepts it. */
289
267
  resize(width?: number, height?: number): void;
268
+ /**
269
+ * Open a URL through the host (`ui/open-link`). Without `openLinks`, or when
270
+ * the host refuses, opens it with `window.open` instead.
271
+ */
290
272
  openLink(url: string): void;
291
273
  /**
292
274
  * Push the app's visible state to the agent (ext-apps
@@ -294,7 +276,8 @@ interface App {
294
276
  * `state` rides along as `structuredContent` for tools that need the ids.
295
277
  *
296
278
  * Sends immediately. Callers that push on every keystroke or selection
297
- * change want `useModelContext`, which debounces.
279
+ * change want `useModelContext`, which debounces. A no-op when the host did
280
+ * not declare `updateModelContext`.
298
281
  */
299
282
  updateModelContext(state: Record<string, unknown>, summary?: string): void;
300
283
  /**
@@ -304,15 +287,24 @@ interface App {
304
287
  * to the server that mounted the app, so there is no target to name and no
305
288
  * option to pass — cross-source work belongs to the agent, which can call
306
289
  * two servers and hand one's result to the other.
290
+ *
291
+ * Rejects with `HostCapabilityError`, without sending, when the host did not
292
+ * declare `serverTools`.
307
293
  */
308
294
  callTool<TOutput = unknown>(name: string, args?: Record<string, unknown>): Promise<ToolCallResult<TOutput>>;
309
295
  /**
310
296
  * Read an MCP resource from the originating server via the host bridge
311
297
  * (ext-apps `resources/read`). Named to mirror the ext-apps spec's
312
298
  * `App.readServerResource`.
299
+ *
300
+ * Rejects with `HostCapabilityError`, without sending, when the host did not
301
+ * declare `serverResources`.
313
302
  */
314
303
  readServerResource(params: ReadResourceRequest["params"]): Promise<ReadResourceResult>;
315
- /** Send a user message into the agent conversation (ext-apps `ui/message`). */
304
+ /**
305
+ * Send a user message into the agent conversation (ext-apps `ui/message`).
306
+ * A no-op when the host did not declare `message`.
307
+ */
316
308
  sendMessage(text: string, context?: {
317
309
  action?: string;
318
310
  entity?: string;
@@ -320,4 +312,4 @@ interface App {
320
312
  destroy(): void;
321
313
  }
322
314
 
323
- export type { App as A, ConnectOptions as C, Dimensions as D, FileResult as F, KeyForwardConfig as K, ModelContext as M, RequestFileOptions as R, TaskHandle as T, CallToolAsTaskOptions as a, ToolCallResult as b, Theme as c, ToolResultData as d, ToolDefinition as e, FontFaceDescriptor as f, AppEventName as g, FontDisplayValue as h, TasksCapability as i };
315
+ export type { App as A, ConnectOptions as C, Dimensions as D, FileResult as F, KeyForwardConfig as K, ModelContext as M, RequestFileOptions as R, TaskHandle as T, CallToolAsTaskOptions as a, ToolCallResult as b, Theme as c, ToolResultData as d, ToolDefinition as e, AppEventName as f, TasksCapability as g };
package/dist/ui/base.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkRX6XCLFF_cjs = require('../chunk-RX6XCLFF.cjs');
4
- require('../chunk-Q7SFCCGT.cjs');
5
4
 
6
5
  // src/ui/base.ts
7
6
  chunkRX6XCLFF_cjs.injectBaseReset();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/base.ts"],"names":["injectBaseReset"],"mappings":";;;;;;AAqBAA,iCAAA,EAAgB","file":"base.cjs","sourcesContent":["/**\n * Establishes the root-height chain a full-pane Synapse app needs. Import for\n * the side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/base\";\n * ```\n *\n * This injects `html, body, #root { height: 100% }` (so a `height: 100%` app\n * shell resolves against the iframe's allocated pane) and `body { margin: 0 }`\n * (so the pane has no UA-margin gap). See `./internal/base-reset.ts` for why a\n * percentage chain — not a viewport unit — is the correct mechanism.\n *\n * `AppFrame` already calls `injectBaseReset()` on render, so apps built on it\n * get the chain automatically. Import this module explicitly to establish the\n * chain *before* React mounts — avoiding a first-paint layout jump — or for an\n * app that renders a full-pane root without `AppFrame`.\n */\n\nimport { injectBaseReset } from \"./internal/base-reset.js\";\n\ninjectBaseReset();\n\nexport { injectBaseReset };\n"]}
1
+ {"version":3,"sources":["../../src/ui/base.ts"],"names":["injectBaseReset"],"mappings":";;;;;AAqBAA,iCAAA,EAAgB","file":"base.cjs","sourcesContent":["/**\n * Establishes the root-height chain a full-pane Synapse app needs. Import for\n * the side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/base\";\n * ```\n *\n * This injects `html, body, #root { height: 100% }` (so a `height: 100%` app\n * shell resolves against the iframe's allocated pane) and `body { margin: 0 }`\n * (so the pane has no UA-margin gap). See `./internal/base-reset.ts` for why a\n * percentage chain — not a viewport unit — is the correct mechanism.\n *\n * `AppFrame` already calls `injectBaseReset()` on render, so apps built on it\n * get the chain automatically. Import this module explicitly to establish the\n * chain *before* React mounts — avoiding a first-paint layout jump — or for an\n * app that renders a full-pane root without `AppFrame`.\n */\n\nimport { injectBaseReset } from \"./internal/base-reset.js\";\n\ninjectBaseReset();\n\nexport { injectBaseReset };\n"]}
package/dist/ui/base.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { injectBaseReset } from '../chunk-3HQGHPNC.js';
2
2
  export { injectBaseReset } from '../chunk-3HQGHPNC.js';
3
- import '../chunk-PZ5AY32C.js';
4
3
 
5
4
  // src/ui/base.ts
6
5
  injectBaseReset();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/base.ts"],"names":[],"mappings":";;;;;AAqBA,eAAA,EAAgB","file":"base.js","sourcesContent":["/**\n * Establishes the root-height chain a full-pane Synapse app needs. Import for\n * the side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/base\";\n * ```\n *\n * This injects `html, body, #root { height: 100% }` (so a `height: 100%` app\n * shell resolves against the iframe's allocated pane) and `body { margin: 0 }`\n * (so the pane has no UA-margin gap). See `./internal/base-reset.ts` for why a\n * percentage chain — not a viewport unit — is the correct mechanism.\n *\n * `AppFrame` already calls `injectBaseReset()` on render, so apps built on it\n * get the chain automatically. Import this module explicitly to establish the\n * chain *before* React mounts — avoiding a first-paint layout jump — or for an\n * app that renders a full-pane root without `AppFrame`.\n */\n\nimport { injectBaseReset } from \"./internal/base-reset.js\";\n\ninjectBaseReset();\n\nexport { injectBaseReset };\n"]}
1
+ {"version":3,"sources":["../../src/ui/base.ts"],"names":[],"mappings":";;;;AAqBA,eAAA,EAAgB","file":"base.js","sourcesContent":["/**\n * Establishes the root-height chain a full-pane Synapse app needs. Import for\n * the side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/base\";\n * ```\n *\n * This injects `html, body, #root { height: 100% }` (so a `height: 100%` app\n * shell resolves against the iframe's allocated pane) and `body { margin: 0 }`\n * (so the pane has no UA-margin gap). See `./internal/base-reset.ts` for why a\n * percentage chain — not a viewport unit — is the correct mechanism.\n *\n * `AppFrame` already calls `injectBaseReset()` on render, so apps built on it\n * get the chain automatically. Import this module explicitly to establish the\n * chain *before* React mounts — avoiding a first-paint layout jump — or for an\n * app that renders a full-pane root without `AppFrame`.\n */\n\nimport { injectBaseReset } from \"./internal/base-reset.js\";\n\ninjectBaseReset();\n\nexport { injectBaseReset };\n"]}
package/dist/ui/index.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkRX6XCLFF_cjs = require('../chunk-RX6XCLFF.cjs');
4
- require('../chunk-Q7SFCCGT.cjs');
5
4
  var react = require('react');
6
5
  var jsxRuntime = require('react/jsx-runtime');
7
6