@popmelt.com/core 0.32.2 → 0.33.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 (85) hide show
  1. package/README.md +23 -0
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  4. package/dist/ExploreAttachment-CLFSAWKM.mjs +260 -0
  5. package/dist/ParticipantRuntime-HW3MOZI5.mjs +139 -0
  6. package/dist/PopmeltTasteConnectedPane-FKIJM3C7.mjs +215 -0
  7. package/dist/PreviewRuntime-LFPK56NW.mjs +2 -0
  8. package/dist/SuppliedContext-RWN6UR3K.mjs +2 -0
  9. package/dist/{ThreadErrorCard-OMXKVZY4.mjs → ThreadErrorCard-7J62GD5W.mjs} +1 -1
  10. package/dist/ThreadPanel-RJIHV3P6.mjs +197 -0
  11. package/dist/bridge-entry.mjs +1 -1
  12. package/dist/browser-runtime-JJHSKIKD.mjs +2 -0
  13. package/dist/browser.mjs +1 -1
  14. package/dist/checkFixture-TJDFGPQI.mjs +2 -0
  15. package/dist/{chunk-C3VWS5R6.mjs → chunk-27ADDVGC.mjs} +1 -1
  16. package/dist/chunk-2IASPT6L.mjs +2 -0
  17. package/dist/chunk-2VCHBI7Y.mjs +11 -0
  18. package/dist/chunk-2ZJ4FBTG.mjs +2 -0
  19. package/dist/chunk-5K7SACPW.mjs +2 -0
  20. package/dist/chunk-6V2VCKPG.mjs +53 -0
  21. package/dist/{chunk-MTQ5IWIK.mjs → chunk-75PQGTKX.mjs} +1 -1
  22. package/dist/chunk-7IJGE5AK.mjs +31 -0
  23. package/dist/chunk-BVTLSUQT.mjs +2 -0
  24. package/dist/chunk-C5WXW6VL.mjs +1 -0
  25. package/dist/chunk-DMWB3IRD.mjs +1 -0
  26. package/dist/chunk-DNOKP3JS.mjs +2 -0
  27. package/dist/chunk-EAV2VV2V.mjs +2 -0
  28. package/dist/chunk-F5XSNRGT.mjs +2 -0
  29. package/dist/{chunk-QTGE5KAA.mjs → chunk-GASEZICN.mjs} +1 -1
  30. package/dist/chunk-GL4I4MI6.mjs +1 -3
  31. package/dist/chunk-H2UYAUX3.mjs +2 -0
  32. package/dist/chunk-HNCV37XO.mjs +2 -0
  33. package/dist/chunk-I63OQTCF.mjs +347 -0
  34. package/dist/chunk-IKCHOC3U.mjs +1 -2
  35. package/dist/chunk-J5SC3R5L.mjs +2 -0
  36. package/dist/{chunk-K63SG2J5.mjs → chunk-JMMP5JSP.mjs} +1 -1
  37. package/dist/chunk-NOHXTT24.mjs +1 -1
  38. package/dist/{chunk-2RRYBN2J.mjs → chunk-ODIGT4YJ.mjs} +2 -2
  39. package/dist/chunk-PHKDIU3X.mjs +30 -0
  40. package/dist/chunk-PQT5FYN5.mjs +2 -0
  41. package/dist/chunk-PSSHCTJ2.mjs +8 -0
  42. package/dist/chunk-QXVMGZFP.mjs +1 -1
  43. package/dist/chunk-V2I7PSJW.mjs +2 -0
  44. package/dist/chunk-W5NIRROD.mjs +7 -0
  45. package/dist/chunk-WHJEKDNP.mjs +2 -0
  46. package/dist/chunk-XKD2ABCO.mjs +7 -0
  47. package/dist/chunk-XMKYGH62.mjs +142 -0
  48. package/dist/{chunk-MZNY6VXR.mjs → chunk-ZHJZPC7U.mjs} +1 -1
  49. package/dist/cli.mjs +1 -69
  50. package/dist/codex-note-context-YHKPQ4WP.mjs +2 -0
  51. package/dist/codex-project-7VYHYTWO.mjs +2 -0
  52. package/dist/codex-session-registry-SPRWY2WW.mjs +1 -1
  53. package/dist/focus-inspection-VBS5656D.mjs +2 -0
  54. package/dist/index.mjs +1 -1
  55. package/dist/memory-legacy.mjs +1 -1
  56. package/dist/memory-store.mjs +1 -1
  57. package/dist/peer-client-MTWZG2FB.mjs +2 -0
  58. package/dist/plugin-astro.mjs +1 -31
  59. package/dist/plugin-nuxt.mjs +1 -30
  60. package/dist/plugin-vite.mjs +1 -1
  61. package/dist/server.d.mts +2 -0
  62. package/dist/server.mjs +1 -14
  63. package/dist/{workspace-snapshot-O34KMJ2V.mjs → workspace-snapshot-RTTXNNUX.mjs} +1 -1
  64. package/package.json +4 -2
  65. package/dist/ParticipantRuntime-M762IJI2.mjs +0 -139
  66. package/dist/PopmeltTasteConnectedPane-ZW47K7VZ.mjs +0 -221
  67. package/dist/PreviewRuntime-QDA4OF67.mjs +0 -2
  68. package/dist/SuppliedContext-NURVPZ4L.mjs +0 -2
  69. package/dist/browser-runtime-VHGXBZA5.mjs +0 -2
  70. package/dist/chunk-3GHVZGWO.mjs +0 -347
  71. package/dist/chunk-45JUZT7H.mjs +0 -2
  72. package/dist/chunk-5HNQZ6TH.mjs +0 -2
  73. package/dist/chunk-ABX3VAYF.mjs +0 -317
  74. package/dist/chunk-B2MFT2SV.mjs +0 -62
  75. package/dist/chunk-EXDOFFFJ.mjs +0 -2
  76. package/dist/chunk-F6AMPRUB.mjs +0 -2
  77. package/dist/chunk-KAKYUYLC.mjs +0 -310
  78. package/dist/chunk-RCVAPQ7X.mjs +0 -2
  79. package/dist/chunk-VAPWW76T.mjs +0 -1
  80. package/dist/chunk-WL62X74S.mjs +0 -342
  81. package/dist/chunk-YHSHUWWI.mjs +0 -1
  82. package/dist/codex-note-context-NGOK23TK.mjs +0 -2
  83. package/dist/codex-project-EMYHOQCC.mjs +0 -2
  84. package/dist/focus-inspection-G72JLJYG.mjs +0 -2
  85. package/dist/peer-client-6FUDDS46.mjs +0 -2
@@ -1,2 +0,0 @@
1
- "use client";
2
- function m(t){try{let e=t.defaultView?.frameElement;return e?.localName==="iframe"?e:null}catch{return null}}function w(t){if(t.localName!=="iframe"||t.closest("[data-devtools],[data-popmelt-peer-surface]"))return null;try{let e=t.contentDocument;return e?.documentElement?e:null}catch{return null}}function D(t){let e=t.getBoundingClientRect(),r=t.offsetWidth?e.width/t.offsetWidth:1,u=t.offsetHeight?e.height/t.offsetHeight:1;return{x:e.left+t.clientLeft*r,y:e.top+t.clientTop*u,sx:r,sy:u}}function v(t,e){let{left:r,top:u,width:o,height:n}=t,l=m(e);for(;l;){let a=D(l);r=a.x+r*a.sx,u=a.y+u*a.sy,o*=a.sx,n*=a.sy,l=m(l.ownerDocument)}return new DOMRect(r,u,o,n)}function V(t){return v(t.getBoundingClientRect(),t.ownerDocument)}function M(t,e,r){let u=[],o=m(r);for(;o;)u.unshift(o),o=m(o.ownerDocument);for(let n of u){let l=D(n);t=(t-l.x)/l.sx,e=(e-l.y)/l.sy}return{x:t,y:e}}function k(t){return t.ownerDocument.defaultView??window}function z(t){return!!(t&&t.namespaceURI==="http://www.w3.org/1999/xhtml")}function A(t,e=document){if(t===e)return!0;let r=m(t);return!!(r?.isConnected&&r.contentDocument===t&&A(r.ownerDocument,e))}function B(t,e){if(!A(e))return new DOMRect(0,0,0,0);let r=t.left,u=t.top,o=t.right,n=t.bottom;for(let l=m(e);l;l=m(l.ownerDocument)){let a=v({left:0,top:0,width:l.clientWidth,height:l.clientHeight},l.contentDocument);r=Math.max(r,a.left),u=Math.max(u,a.top),o=Math.min(o,a.right),n=Math.min(n,a.bottom)}return new DOMRect(r,u,Math.max(0,o-r),Math.max(0,n-u))}var g="@frame(";function I(t,e){return`${g}${encodeURIComponent(JSON.stringify({selector:t,url:e.URL}))}) `}function O(t){if(!t.startsWith(g))return null;let e=t.indexOf(") ");if(e<0)return null;try{let r=JSON.parse(decodeURIComponent(t.slice(g.length,e)));return typeof r.selector!="string"||typeof r.url!="string"?null:{...r,rest:t.slice(e+2)}}catch{return null}}var b=" >>> ";function N(t){return Array.from(t.querySelectorAll("*")).flatMap(e=>e.shadowRoot?[e.shadowRoot]:[])}function S(t=document){let e=[t];for(let r of e)e.push(...N(r));return e}function p(t,e=document){if(t.startsWith(g)){let o=O(t);if(!o)return null;let n=o.selector.startsWith(g)||o.selector.includes(b)?[p(o.selector,e)].filter(s=>!!s):S(e).flatMap(s=>Array.from(s.querySelectorAll(o.selector))),l=n.length===1?n[0]:null,a=l&&w(l);return!a||a.URL!==o.url?null:p(o.rest,a)}let r=t.split(b);if(r.length>1){let o=e,n=null;for(let l=0;l<r.length;l+=1){if(n=o.querySelector(r[l]),!n)return null;if(l<r.length-1){if(!n.shadowRoot)return null;o=n.shadowRoot}}return n}let u=[e];for(let o of u){let n=o.querySelector(t);if(n)return n;u.push(...N(o))}return null}function R(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode();return"host"in e?e.host:null}function _(t,e){return e.startsWith(g)||e.includes(b)?p(e)===t:t.matches(e)}function $(t,e){let r=t;for(;r;){if(r.matches(e))return r;r=R(r)}return null}function H(t,e){let r=e;for(;r;){if(r===t)return!0;r=R(r)}return!1}var W=new WeakMap;function E(t){let e=t.getAttribute("style");return t.style.setProperty("pointer-events","auto","important"),()=>{e===null?t.removeAttribute("style"):t.setAttribute("style",e)}}function J(t){let e=t.nodeType===9?t:t.ownerDocument,r="* { pointer-events: auto !important; }",u=[];try{let o=e.defaultView?.CSSStyleSheet;if(o?.prototype.replaceSync&&"adoptedStyleSheets"in t){let n=W.get(e);n||(n=new o,n.replaceSync(r),W.set(e,n));let l=[...t.adoptedStyleSheets];t.adoptedStyleSheets=[...l,n],u.push(()=>{t.adoptedStyleSheets=l})}else{let n=e.createElement("style");n.textContent=r,(t.nodeType===9?e.head??e.documentElement:t).appendChild(n),u.push(()=>n.remove())}for(let n of t.querySelectorAll('[style*="pointer-events"]'))n.style.getPropertyValue("pointer-events")!=="none"||n.style.getPropertyPriority("pointer-events")!=="important"||u.push(E(n))}catch(o){throw u.reverse().forEach(n=>n()),o}return()=>u.reverse().forEach(o=>o())}function G(t,e,r,u=n=>[n],o){let n=[];for(let l of t.querySelectorAll("iframe")){if(!w(l))continue;let a=l.getBoundingClientRect();e<a.left||e>a.right||r<a.top||r>a.bottom||l.ownerDocument.defaultView?.getComputedStyle(l).pointerEvents==="none"&&n.push(E(l))}try{let l=()=>{let c=typeof t.elementsFromPoint=="function"?t.elementsFromPoint(e,r):[],i=t.elementFromPoint?.(e,r)??null;return(i&&!c.includes(i)?[i,...c]:c).filter(f=>t.nodeType===9||f.getRootNode()===t)},a=l(),s=a;if(o){let c=J(t);try{s=l()}finally{c()}s=s.filter(i=>a.includes(i)||o(i))}return s.flatMap(u)}finally{n.forEach(l=>l())}}function q(t,e,r=document,u){let o=[],n=new Set,l=r.nodeType===9?r:r.ownerDocument,a=M(t,e,l);for(let s of S(r).reverse())for(let c of G(s,a.x,a.y,i=>{let f=w(i);return f?[...q(t,e,f,u),i]:[i]},u))n.has(c)||(n.add(c),o.push(c));return o}function K(){return b}var Q=["id","data-testid","data-test","data-cy","data-popmelt-media-id","aria-label","name","href"],j=t=>t.replace(/\s+/g," ").trim();function y(t){return t==="id"||t==="data-popmelt-media-id"||/^data-(?:testid|test|cy)(?:-[a-z0-9_-]+)?$/.test(t)}function F(t,e){return!!(e&&e.length<=200&&!(t==="id"&&/^(radix-|:|_r_)/.test(e)))}function P(t){let e={},r=new Set([...Q,...t.getAttributeNames().filter(y)]);for(let n of r){let l=t.getAttribute(n);l&&F(n,l)&&(e[n]=l)}let u=j(t.querySelector("h1,h2,h3,h4,h5,h6")?.textContent??""),o=j(Array.from(t.childNodes).filter(n=>n.nodeType===3).map(n=>n.textContent).join(" "));return{tag:t.tagName.toLowerCase(),...Object.keys(e).length?{attributes:e}:{},...u&&u.length<=200?{heading:u}:{},...o&&o.length<=200?{text:o}:{}}}function L(t,e,r=document){let u=S(r),o=i=>{try{return u.flatMap(f=>Array.from(f.querySelectorAll(i)))}catch{return[]}},n=!!(e&&(e.heading||e.text||Object.keys(e.attributes??{}).length)),l=i=>{if(!e||!n)return!0;let f=P(i);return f.tag===e.tag&&(!e.heading||f.heading===e.heading)&&(!e.text||f.text===e.text)&&Object.entries(e.attributes??{}).every(([h,d])=>i.getAttribute(h)===d)};for(let i of t){if(i.includes(" >>> ")||i.startsWith("@frame(")){try{let h=p(i,r),d=O(i),C=Object.entries(e?.attributes??{}).filter(([x])=>y(x)),T=d&&h&&(d.rest.startsWith("[data-pm=")||C.length>0&&h.tagName.toLowerCase()===e?.tag&&C.every(([x,U])=>h.getAttribute(x)===U));if(h&&(T||l(h)))return{status:"matched",element:h}}catch{}continue}let f=o(i);if(f.length===1&&(/^\[data-pm=/.test(i)||!n))return{status:"matched",element:f[0]}}if(!n||t.some(i=>i.includes(" >>> ")||i.startsWith("@frame("))||!/^[a-z][a-z0-9-]*$/.test(e.tag))return{status:"missing"};let a=o(e.tag);if(a.length>500)return{status:"ambiguous"};let s=Object.entries(e.attributes??{}).filter(([i])=>y(i));if(s.length){let i=a.filter(f=>s.every(([h,d])=>f.getAttribute(h)===d));return i.length===1?{status:"matched",element:i[0]}:{status:i.length?"ambiguous":"missing"}}let c=a.filter(l);return c.length===1?{status:"matched",element:c[0]}:{status:c.length?"ambiguous":"missing"}}function X(t,e,r=document){let u={};if(e)for(let[a,s]of Object.entries({...e.dataAttributes,...e.id?{id:e.id}:{}}))y(a)&&F(a,s)&&(u[a]=s);let o=e?.targetFingerprint?.tag??e?.tagName?.toLowerCase(),n=e&&o?{...e.targetFingerprint,tag:o,attributes:{...u,...e.targetFingerprint?.attributes}}:e?.targetFingerprint,l=L([t,e?.selector].filter(a=>!!a),n,r);return l.status==="matched"?l.element:null}export{m as a,w as b,v as c,V as d,M as e,k as f,z as g,A as h,B as i,I as j,S as k,p as l,R as m,_ as n,$ as o,H as p,q,K as r,y as s,P as t,L as u,X as v};
@@ -1 +0,0 @@
1
- import{a as p}from"./chunk-NOHXTT24.mjs";import{request as c}from"http";function u(){let e=process.env.POPMELT_BRIDGE_URL;if(!e)return null;try{let t=new URL(e);return{port:t.port?Number.parseInt(t.port,10):null,projectId:process.env.POPMELT_PROJECT_ID||null,leaseEligible:!1}}catch{return null}}async function h(e,t,i){let r=u();if(e?.bridge===!1||r)return r??{port:null,projectId:null,leaseEligible:!1};try{let{startPopmelt:o}=await import("./server.mjs"),n=t.config?.server?.host,l=n===!0?"0.0.0.0":n||"localhost",s=t.config?.server?.port??i,d=`http://${l==="0.0.0.0"?"localhost":l}:${s}`,a=await o({port:e?.port,experimentalEventTransport:e?.experimentalEventTransport,projectRoot:e?.projectRoot,devOrigin:d,force:!0,detached:!0,manageLease:!1});return console.log(`[popmelt] bridge ready at http://localhost:${a.port}`),{port:a.port,projectId:a.projectId,leaseEligible:!0}}catch(o){let n=o instanceof Error?o.message:String(o);return console.warn("[popmelt] bridge failed to start:",n),{port:null,projectId:null,leaseEligible:!1}}}async function v(e,t,i=fetch){if(!e.leaseEligible||e.port===null)return null;let r=await p({port:e.port,projectId:e.projectId},i);if(!r)return null;let o=()=>{n()},n=async()=>{process.removeListener("beforeExit",o),await r.release()};return process.once("beforeExit",o),t.httpServer?.once("close",()=>{n()}),{id:r.id,release:n}}function g(e,t,i){if(i.port===null)return null;let r=new URL(t,"http://popmelt.local");if(r.pathname!==`${e}/status`)return null;let o=new URL("/status",`http://localhost:${i.port}`);return r.searchParams.forEach((n,l)=>o.searchParams.append(l,n)),i.projectId&&o.searchParams.set("projectId",i.projectId),o}function b(e,t){return(i,r,o)=>{let n=g(e,i.url||"",t());if(!n)return o();let l=c(n,{method:i.method,headers:{...i.headers,host:n.host}},s=>{r.writeHead(s.statusCode||502,s.headers),s.pipe(r)});l.on("error",()=>{r.writeHead(502,{"Content-Type":"text/plain"}),r.end(`Popmelt bridge not running on port ${t().port}`)}),i.pipe(l)}}function P(e){let t=e.port===null?null:`http://localhost:${e.port}`;return`window.__POPMELT_BRIDGE_URL__=${JSON.stringify(t)};window.__POPMELT_PROJECT_ID__=${JSON.stringify(e.projectId)};`}export{h as a,v as b,b as c,P as d};