@popmelt.com/core 0.33.1 → 0.34.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.
- package/README.md +24 -1
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/ExploreAttachment-BG7ZOQSA.mjs +1 -0
- package/dist/PagePreviewLayer-CBDGPMJQ.mjs +1 -0
- package/dist/ParticipantRuntime-FSZX2PUQ.mjs +1 -0
- package/dist/PhoneHostGate-OM7FLOJ2.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-KJSBPJQR.mjs +1 -0
- package/dist/{PreviewRuntime-LFPK56NW.mjs → PreviewRuntime-EYKB7MG5.mjs} +1 -1
- package/dist/SuppliedContext-7THB2WZY.mjs +1 -0
- package/dist/ThreadErrorCard-J2VTA5JW.mjs +1 -0
- package/dist/ThreadPanel-PNVMIIYJ.mjs +1 -0
- package/dist/bridge-entry.mjs +1 -1
- package/dist/bridgeSSEStream-K3UIMBTC.mjs +1 -0
- package/dist/{bridgeWebSocketStream-H3DCP4T3.mjs → bridgeWebSocketStream-2SUZUBE3.mjs} +1 -1
- package/dist/browser-runtime-FFT5NH66.mjs +1 -0
- package/dist/browser.mjs +1 -1
- package/dist/{canvas-chat-note-NHYL3T6J.mjs → canvas-chat-note-MGAEUYJO.mjs} +1 -1
- package/dist/{checkFixture-MWBOYIM2.mjs → checkFixture-AMLLLJNS.mjs} +1 -1
- package/dist/chunk-2ETPREWQ.mjs +1 -0
- package/dist/chunk-3GXLNBXU.mjs +1 -0
- package/dist/chunk-3WSTAV5B.mjs +1 -0
- package/dist/chunk-53SKVMWR.mjs +1 -0
- package/dist/chunk-57FM7XQV.mjs +1 -0
- package/dist/chunk-5D2ADU7H.mjs +1 -0
- package/dist/chunk-67OWRNU3.mjs +30 -0
- package/dist/chunk-67QNAAUC.mjs +1 -0
- package/dist/chunk-BACXPVHP.mjs +1 -0
- package/dist/chunk-BFVLMSG5.mjs +1 -0
- package/dist/chunk-BJ25TGJN.mjs +1 -0
- package/dist/chunk-DOCRI237.mjs +1 -0
- package/dist/{chunk-HVD5ZG6W.mjs → chunk-E5WNW4WE.mjs} +1 -1
- package/dist/chunk-FMI4VQDZ.mjs +1 -0
- package/dist/chunk-G2ZHJXHZ.mjs +1 -0
- package/dist/chunk-G6RYESYI.mjs +1 -0
- package/dist/{chunk-75PQGTKX.mjs → chunk-G7JR5Z3P.mjs} +1 -1
- package/dist/chunk-GRPDZGPP.mjs +1 -0
- package/dist/{chunk-GASEZICN.mjs → chunk-GSEMSZDB.mjs} +1 -1
- package/dist/chunk-H2RLTCUJ.mjs +1 -0
- package/dist/{chunk-EAV2VV2V.mjs → chunk-HAE5LUJX.mjs} +1 -1
- package/dist/{chunk-IKCHOC3U.mjs → chunk-HV7HRQ2S.mjs} +0 -1
- package/dist/{chunk-2ZJ4FBTG.mjs → chunk-JRP5XFYN.mjs} +1 -1
- package/dist/chunk-LD3532UC.mjs +1 -0
- package/dist/chunk-MJ2PFKF3.mjs +1 -0
- package/dist/chunk-MP6ZV2DN.mjs +1 -0
- package/dist/chunk-N66ZZG3L.mjs +1 -0
- package/dist/chunk-NSCO633B.mjs +1 -0
- package/dist/chunk-P4KM3K5M.mjs +1 -0
- package/dist/chunk-PH2MLB3T.mjs +1 -0
- package/dist/chunk-Q6C7ZA3H.mjs +1 -0
- package/dist/chunk-Q6N77LIS.mjs +1 -0
- package/dist/chunk-Q74FBX2I.mjs +1 -0
- package/dist/chunk-QQB5G3VB.mjs +1 -0
- package/dist/chunk-R3FPXDQS.mjs +1 -0
- package/dist/chunk-RK6UROPO.mjs +1 -0
- package/dist/chunk-RR4SHK7O.mjs +1 -0
- package/dist/chunk-RSUMSUAW.mjs +1 -0
- package/dist/{chunk-GL4I4MI6.mjs → chunk-RUJC32MA.mjs} +1 -1
- package/dist/{chunk-2IASPT6L.mjs → chunk-RUTWU5W2.mjs} +1 -1
- package/dist/chunk-TRHC7WBO.mjs +1 -0
- package/dist/chunk-XSMCZUDR.mjs +1 -0
- package/dist/{chunk-DNOKP3JS.mjs → chunk-XT6PHPPG.mjs} +1 -1
- package/dist/chunk-Y6WD56SO.mjs +1 -0
- package/dist/chunk-YC5CUNRU.mjs +1 -0
- package/dist/chunk-YFDD7HGT.mjs +1 -0
- package/dist/{chunk-JMMP5JSP.mjs → chunk-YTUQYKLM.mjs} +1 -1
- package/dist/chunk-YXPRWW6B.mjs +1 -0
- package/dist/chunk-ZVDKW7TO.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-NUKGR2WT.mjs +1 -0
- package/dist/codex-project-KE7ZZ6YX.mjs +1 -0
- package/dist/{codex-session-registry-SPRWY2WW.mjs → codex-session-registry-ONODFWFD.mjs} +1 -2
- package/dist/focus-inspection-BPPRCMNN.mjs +1 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.mjs +1 -1
- package/dist/memory-store.mjs +1 -1
- package/dist/peer-client-UQDASAO7.mjs +1 -0
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-next.mjs +1 -1
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/steerStyles-VKQD57KC.mjs +1 -0
- package/package.json +1 -1
- package/dist/ExploreAttachment-VKCCEIM7.mjs +0 -1
- package/dist/ParticipantRuntime-YS5SIZUQ.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-FKIJM3C7.mjs +0 -1
- package/dist/SuppliedContext-RWN6UR3K.mjs +0 -1
- package/dist/ThreadErrorCard-7J62GD5W.mjs +0 -1
- package/dist/ThreadPanel-KVNM67WO.mjs +0 -1
- package/dist/bridgeSSEStream-NEYI73TC.mjs +0 -1
- package/dist/browser-runtime-AP35S5MK.mjs +0 -1
- package/dist/chunk-27ADDVGC.mjs +0 -1
- package/dist/chunk-2VCHBI7Y.mjs +0 -1
- package/dist/chunk-6V2VCKPG.mjs +0 -1
- package/dist/chunk-6VXFTT5U.mjs +0 -1
- package/dist/chunk-BVTLSUQT.mjs +0 -1
- package/dist/chunk-CPOYMGYY.mjs +0 -1
- package/dist/chunk-H7XMDLGU.mjs +0 -30
- package/dist/chunk-N2QUNHV6.mjs +0 -1
- package/dist/chunk-N6JTX4PD.mjs +0 -2
- package/dist/chunk-ODIGT4YJ.mjs +0 -1
- package/dist/chunk-PSSHCTJ2.mjs +0 -1
- package/dist/chunk-QOJCTLQW.mjs +0 -1
- package/dist/chunk-RESPUCV7.mjs +0 -1
- package/dist/chunk-SHAIHRV2.mjs +0 -1
- package/dist/chunk-VPPVURBR.mjs +0 -2
- package/dist/chunk-W5NIRROD.mjs +0 -1
- package/dist/chunk-XKD2ABCO.mjs +0 -1
- package/dist/chunk-YLKEDOII.mjs +0 -31
- package/dist/chunk-ZHJZPC7U.mjs +0 -1
- package/dist/codex-note-context-4JYQ437H.mjs +0 -2
- package/dist/codex-project-FA4EK6VR.mjs +0 -2
- package/dist/focus-inspection-VBS5656D.mjs +0 -1
- package/dist/peer-client-KJCPXT76.mjs +0 -2
package/dist/chunk-VPPVURBR.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as t,E as e,j as a,p as r,q as i}from"./chunk-YLKEDOII.mjs";import{readFile as o,realpath as n,mkdir as s,writeFile as c}from"fs/promises";import{createHash as p}from"crypto";import{join as d,resolve as l}from"path";function u(t,e){let a=p("sha256").update(e).digest("hex");return d(t,".popmelt","participant-agents",a+".json")}async function f(t,a){if(a.storeId!==t.storeId)return{ok:!1,body:{status:"writable_store_required"}};if("string"!=typeof a.threadId||!a.threadId||"string"!=typeof a.text||!a.text.trim()||a.text.length>8e3)return{ok:!1,body:{status:"invalid_note"}};let r;try{r=await h(t,t.sessionId,!0)}catch(t){if("ENOENT"!==t.code)throw t;return{ok:!1,body:{status:"participant_invitation_required"}}}if(!r)return{ok:!1,body:{status:"enrolled_bridge_required"}};let i=await e(r.endpoint,"/participants/thread-note",{...r.request,method:"POST",signal:AbortSignal.timeout(3e4),body:JSON.stringify({storeId:t.storeId,threadId:a.threadId,reply:a.text,sessionId:t.sessionId,requestId:a.requestId})});return{ok:i.response.ok,body:i.body}}async function h(t,r,s=!1){let c=await o(d(t.projectRoot,".popmelt","participant-bridge.json"),"utf8").then(JSON.parse).catch(e=>{if("ENOENT"!==e.code||!t.bridgePort)throw e;return{projectId:t.projectId,port:t.bridgePort}});if(c.projectId!==t.projectId||!Number.isInteger(c.port)||c.port<1||c.port>65535)return null;let p={redirect:"error",signal:AbortSignal.timeout(3e3)},l=await e(c,"/status",p);if(!l.response.ok||l.body?.projectId!==t.projectId)return null;let f,h=u(t.projectRoot,r);try{f=JSON.parse(await o(h,"utf8"))}catch(l){if("ENOENT"!==l.code||!s)throw l;let u=await n(t.projectRoot),m=a(r);if(i(u)!==t.projectId||!m)return null;let g=JSON.parse(await o(d(u,".popmelt","participant-host.json"),"utf8"));if(!(await e(c,"/participants/agent-join",{...p,method:"POST",headers:{"X-Popmelt-Participant-Id":g.participantId,"X-Popmelt-Participant-Token":g.token},body:JSON.stringify({sessionId:r,name:m,headless:!0})})).response.ok)return null;f=JSON.parse(await o(h,"utf8"))}return{endpoint:c,request:{...p,headers:{"X-Popmelt-Participant-Id":f.participantId,"X-Popmelt-Participant-Token":f.token}}}}async function m(t,a,r){let i=[t,...t.mountedStores].find(t=>t.storeId===a.storeId);if(!i||r&&i!==t)return{ok:!1,body:{status:"store_unavailable"}};if(r&&("string"!=typeof a.threadId||!a.threadId))return{ok:!1,body:{status:"thread_required"}};let o=await h(i,t.sessionId,r).catch(t=>{if("ENOENT"===t.code)return null;throw t});if(!o)return{ok:!1,body:{status:"enrolled_bridge_required",message:"Join this project as a Popmelt peer and check that its bridge is running."}};let{endpoint:n,request:s}=o,c=await e(n,r?t.sessionId.startsWith("claude:")?"/participants/link-claude-chat":"/participants/link-codex-chat":"/participants/check-claude-notes",{...s,method:"POST",body:JSON.stringify({sessionId:t.sessionId,...r?{threadId:a.threadId}:{}})});return{ok:c.response.ok,body:c.body}}async function g(a,l,f={}){if(t())return{status:"already_managed_by_bridge"};if((await e(a,"/status",{redirect:"error",signal:AbortSignal.timeout(3e3)})).body?.participantSessions)return async function(t,a,l){if(!l.projectRoot)throw new Error("Participant connections require the active project root");let f=await n(l.projectRoot);if(i(f)!==t.projectId)throw new Error("Participant project does not match");let h,m,g=d(f,".popmelt"),w=p("sha256").update(a).digest("hex"),I=async(a,r,i)=>{let o=await e(t,"/participants/"+a,{method:"POST",redirect:"error",headers:{"X-Popmelt-Participant-Id":r.participantId,"X-Popmelt-Participant-Token":r.token},body:JSON.stringify(i),signal:AbortSignal.timeout(9e4)}),n=o.body;if(!o.response.ok||n.error)throw new Error(n.error??"Participant connection unavailable");return n};try{h=JSON.parse(await o(u(f,a),"utf8"))}catch(t){if("ENOENT"!==t.code)throw t;if(!l.name)return{status:"participant_invitation_required"};let e=JSON.parse(await o(d(g,"participant-host.json"),"utf8")),r=await I("agent-join",e,{sessionId:a,name:l.name});h=r.credential,m=r.participant}if(!l.action){let t=await I("agent-connect",h,{});return{status:"participant_connected",participantId:h.participantId,participant:t.participant??m}}let y=await I("agent-act",h,{action:r(l.action)}),b=y.evidence;if(b?.frame?.image){let t=b.frame.image;if(!/^data:image\/jpeg;base64,[A-Za-z0-9+/=]+$/.test(t)||t.length>7e5)throw new Error("Invalid participant preview");let e=d(g,"artifacts","participant-previews");await s(e,{recursive:!0,mode:448});let a=d(e,w+".jpg");return await c(a,Buffer.from(t.slice(t.indexOf(",")+1),"base64"),{mode:384}),{status:"participant_connected",participant:y.participant,evidence:{...b,frame:{imagePath:a,targets:b.frame.targets}}}}return{status:"participant_connected",participant:y.participant,evidence:y.evidence}}(a,l,f);let h=async(t,r)=>{let i=await e(a,`/peers/${t}`,{method:"POST",body:JSON.stringify(r),signal:AbortSignal.timeout(5e4)}),o=i.body;if(!i.response.ok||o?.error)throw new Error(o?.error??"Peer connection unavailable");return o},m=await h("join",{sessionId:l,name:f.name}),g=f.action?await h("act",{token:m.token,clientId:f.clientId,action:r(f.action)}):m,w=g.peer;return{...g.status?{status:g.status}:{},...w?{peer:{...w,state:w.state?{annotations:w.state.annotations,styleModifications:w.state.styleModifications,textModifications:w.state.textModifications,undoDepth:w.state.undoStack.length,redoDepth:w.state.redoStack.length}:null}}:{},...g.evidence?{evidence:g.evidence}:{},clients:m.clients}}async function w(t){let a=e=>{let a=t.indexOf(e);return a>=0?t[a+1]:void 0},r=a("--session");if(!r)throw new Error("Usage: popmelt peer --session <stable-agent-session> [--project-root <active-project>] [--name <your-name>] [--client <canvas-id>] [--action <JSON>]");let s=await n(l(a("--project-root")??process.cwd())),c=JSON.parse(await o(d(s,".popmelt","bridge.lock"),"utf8")),p=i(s),u=await e({port:c.port,projectId:p},"/status",{signal:AbortSignal.timeout(3e3)});if(!u.response.ok||u.body.projectRoot!==s&&(!u.body.participantSessions||u.body.projectId!==p))throw new Error("No matching running project bridge");let f=a("--action");console.log(JSON.stringify(await g({port:c.port,projectId:p},r,{name:a("--name"),projectRoot:s,clientId:a("--client"),action:f?JSON.parse(f):void 0}),null,2))}export{u as a,f as b,h as c,m as d,g as e,w as f};
|
package/dist/chunk-W5NIRROD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";function e(e,t,n){let a=e.flatMap(({requestedAt:e,resolvedAt:a})=>Number.isFinite(e)&&Number.isFinite(a)?[[Math.max(t,e),Math.min(n,a)]]:[]).sort((e,t)=>e[0]-t[0]),o=t,i=0;for(let[e,t]of a)i+=Math.max(0,t-Math.max(o,e)),o=Math.max(o,t);return i}function t(e){let t=new Map,n=new Set;for(let a of e)if("approval"===a.type){let e=a.data.approval;t.set(e.id,e)}else("done"===a.type||"error"===a.type)&&n.add(String(a.data.jobId));return new Set([...t.values()].filter(e=>"pending"===e.status&&!n.has(e.jobId)).map(e=>e.jobId))}function n(e,t){if(!e?.frames?.length)return[];let n=new Map;for(let t of e.steps){let e=t.visuals?.afterFrameId;e&&!n.has(e)&&n.set(e,t.action?.label?`After ${t.action.label}`:"Resulting state")}return e.frames.flatMap((e,a)=>{let o=t[e.imageIndex];return o?[{id:e.id,imageIndex:e.imageIndex,label:0===a?"Initial state":n.get(e.id)??"State",url:o}]:[]})}function a(e){let t=e.instruction?.trim();return t?e.attachments?.some(e=>e.name?.trim()===t)?null:t:null}function o(e,t){let n=e?.tagName?.toLowerCase(),a=e?.id?`#${e.id}`:"",o=e?.className?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"",i=n?`${n}${a}${o}`:t;return e?.reactComponent?`<${e.reactComponent}> ${i}`:i}function i(e){let t=e.elements?.[0]?.reactComponent||e.elements?.[0]?.tagName||e.linkedSelector,n=e.type&&"annotation"!==e.type?`${e.type} annotation`:"Annotation";return t?`${n} on ${t}`:n}function r(e){let t=e.annotations.map(e=>{let t=e.interactionEpisode?.steps.length??0;return{kind:"annotation",annotationId:e.id,pathname:e.pathname,text:a(e)??i(e),...t>0?{interactionEpisodeStepCount:t}:{}}}),n=new Map,r=e=>{let a=`${e.pathname??""}:${e.durableSelector??e.selector}`,i=n.get(a);if(i)return i.changes.push(e.text),void(void 0!==e.annotationNumber&&(void 0===i.annotationNumber||e.annotationNumber<i.annotationNumber)&&(i.annotationNumber=e.annotationNumber));let r={kind:"changes",elementKey:a,elementLabel:o(e.element,e.selector),...void 0!==e.annotationNumber?{annotationNumber:e.annotationNumber}:{},pathname:e.pathname,changes:[e.text]};n.set(a,r),t.push(r)};for(let t of e.styleModifications??[])for(let e of t.changes)r({...t,text:`${e.property}: ${e.original||"unset"} → ${e.modified||"unset"}${e.token?` (${e.token})`:""}`});for(let t of e.textModifications??[])r({...t,text:`Text: ${t.original||"empty"} → ${t.modified||"empty"}`});for(let t of e.domModifications??[])r({...t,text:"copy"===t.operation?"Copied element":"Moved element"});return e.spacingTokenChanges?.length&&t.push({kind:"changes",elementKey:"spacing-tokens",elementLabel:"Spacing tokens",changes:e.spacingTokenChanges.map(e=>`${e.tokenName}: ${e.originalPx}px → ${e.newPx}px`)}),t}function l(e){let t=e.annotations.flatMap(e=>{let t=a(e);return t?[{instruction:t,pathname:e.pathname}]:[]});if(0===t.length)return;if(new Set(t.map(e=>e.pathname).filter(Boolean)).size<=1)return t.map(e=>e.instruction).join("\n\n");let n=new Map;for(let e of t){let t=e.pathname||"(unknown)",a=n.get(t)??[];a.push(e.instruction),n.set(t,a)}return[...n.entries()].map(([e,t])=>`\`${e}\`\n${t.map(e=>`- ${e}`).join("\n")}`).join("\n")}function s(e,t=96){let n=e.replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,Math.max(0,t-3))}...`:n}function m(e,t,n){return n?.activePreview?n.annotationNumber:e??t}function u(e,t){return e?.trim()?e.trim():function(e){let t=e?.requestItems?.flatMap(e=>"annotation"===e.kind&&e.text.trim()?[e.text.trim()]:[]);if(t?.length)return t.join("; ");let n=e?.requestItems?.flatMap(e=>"changes"===e.kind?[`${e.elementLabel} [${e.changes.join(", ")}]`]:[]);return n?.length?n.join("; "):e?.requestText?.trim()||void 0}(t.find(e=>"human"===e.role))}export{e as a,t as b,n as c,r as d,l as e,s as f,m as g,u as h};
|
package/dist/chunk-XKD2ABCO.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";var t="popmelt.explore-option.v1";function e(t,e,r){return[t?"Component: "+t:"Target: "+e,"Route: "+r].join("\n")}function r(t,r){if(!r||"object"!=typeof r||Array.isArray(r))return t;let n=r.target;if(!n||"object"!=typeof n||Array.isArray(n)||"string"!=typeof n.pathname)return t;let[o,...i]=t.split("\n"),a=" · "+n.pathname;if(!o?.endsWith(a))return t;let l=o.slice(0,-a.length),p="string"==typeof n.component?n.component:void 0;return!l||p&&l!==p?t:[e(p,l,n.pathname),...i].join("\n")}function n(r,n,o,i){let a=r.options[n],{pathname:l,selector:p,element:c}=r.target,s=c?.reactSource,f=c?.reactComponent,u=o.filter(t=>t.batchId===r.id&&t.option===n).map(({part:t,property:e,from:r,to:n})=>({part:t,property:e,from:r,to:n})),d={pathname:l,selector:p,...c?.selector&&{sourceSelector:c.selector},...f&&{component:f},...s&&{source:s}},h="root"in a&&i?.path.reduce((t,e)=>t.children[e],a.root);return{source:"Popmelt",title:h&&(i?.path.length||i?.field)?a.title+" · "+(h.name??h.label??h.kind)+(i.field?" label":""):i?.fixturePart?a.title+" · "+(i.fixturePartLabel||i.fixturePart.replace(/^@/,"")):a.title,content:[e(f,c?.subjectLabel||p,l),...u.map(({part:t,property:e,to:r})=>[t,e+" → "+r].filter(Boolean).join(" · "))].join("\n"),...s&&{sourceURI:s.fileName},kind:t,selection:{batchId:r.id,index:n,target:d,option:a,steerEdits:u,...i&&(i.path.length||i.field||i.fixturePart)?{focus:{path:i.path,...i.fixturePart&&{part:i.fixturePart},...i.fixturePartLabel&&{label:i.fixturePartLabel},...i.field&&{field:i.field}}}:{}}}}function o(t,e,r){return{key:JSON.stringify([t.id,e.option,e.path,e.field,e.fixturePart]),tag:e,note:n(t,e.option,r,e)}}function i(t,e,r){let o=n(t,e,r);return{text:`Apply “${o.title}” in code.`,meta:{exploreOption:o}}}function a(t){if(!t?.startsWith("Apply “"))return;let e=t.indexOf("\nUpdate the annotated component with this reviewed option and its Steer changes. Preserve existing behavior and unrelated styling.\n```json\n");return e>0&&t.slice(0,e).endsWith("” in code.")?t.slice(0,e):void 0}export{t as a,r as b,o as c,i as d,a as e};
|