@vibeflow-tools/cli 0.2.0 → 0.4.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 +10 -6
- package/dist/cli/index.js +46 -37
- package/dist/client/kanban-browser.js +8 -8
- package/dist/client/overlay-browser.js +1 -1
- package/dist/index.js +46 -37
- package/package.json +1 -4
|
@@ -1561,7 +1561,7 @@ Error generating stack: `+n.message+`
|
|
|
1561
1561
|
outline: 2px solid #f59e0b !important;
|
|
1562
1562
|
outline-offset: 2px !important;
|
|
1563
1563
|
background-color: rgba(245, 158, 11, 0.08) !important;
|
|
1564
|
-
}`;function ks(){let e=document.createElement("div");e.id="vibeflow-studio-root",e.style.pointerEvents="none",document.body.appendChild(e);let t=e.attachShadow({mode:"open"}),a=document.createElement("style");a.textContent=jr,t.appendChild(a);let r=document.createElement("style");return r.textContent=Xr,document.head.appendChild(r),{host:e,root:t}}function Ts(){try{let e=JSON.parse(localStorage.getItem(Ss)??"{}");g.indicatorsVisible=e.indicatorsVisible===!0,g.sidebarShowDone=e.sidebarShowDone!==!1,g.showAllPages=e.showAllPages===!0,g.theme="dark",Op(g.theme)}catch{}}function Op(e){g.theme=e,g.host&&g.host.setAttribute("data-theme",e)}function Ps(e){document.addEventListener("mouseover",t=>Es(t,e),!0),document.addEventListener("mouseout",Ms,!0)}function Rs(e){if(document.removeEventListener("mouseover",t=>Es(t,e),!0),document.removeEventListener("mouseout",Ms,!0),g.hoverTarget){try{g.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}g.hoverTarget=null}}function Es(e,t){let a=e.target;if(!(!a||a===document.documentElement||a===document.body)&&e.composedPath().indexOf(t)===-1&&g.hoverTarget!==a){if(g.hoverTarget)try{g.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}g.hoverTarget=a;try{a.classList.add("vibeflow-hover-highlight")}catch{}}}function Ms(e){let t=e.target;if(t===g.hoverTarget){try{t.classList.remove("vibeflow-hover-highlight")}catch{}g.hoverTarget=null}}function Ds(e){if(zt(),!!e){g.annotateHighlightTarget=e;try{e.classList.add("vibeflow-annotate-highlight")}catch{}}}function zt(){if(g.annotateHighlightTarget){try{g.annotateHighlightTarget.classList.remove("vibeflow-annotate-highlight")}catch{}g.annotateHighlightTarget=null}}function L(e,t,...a){let r=document.createElement(e);if(t)for(let o of Object.keys(t))o==="className"?r.className=t[o]:o==="placeholder"?r.placeholder=t[o]:o==="type"?r.type=t[o]:o==="value"?r.value=t[o]:r.setAttribute(o,t[o]);for(let o of a)o!=null&&r.appendChild(typeof o=="string"?document.createTextNode(o):o);return r}function Yr(){if(PROTO_CONFIG.wsUrl){g.reconnectTimer&&(clearTimeout(g.reconnectTimer),g.reconnectTimer=null);try{g.ws=new WebSocket(PROTO_CONFIG.wsUrl)}catch{As();return}g.ws.onopen=()=>{g.reconnectAttempt=0,g.pingInterval&&clearInterval(g.pingInterval),g.pingInterval=setInterval(()=>{var e;((e=g.ws)==null?void 0:e.readyState)===WebSocket.OPEN&&g.ws.send(JSON.stringify({type:"ping"}))},Is)},g.ws.onmessage=e=>{var a,r,o,n;let t;try{t=JSON.parse(e.data)}catch{return}t.type!=="pong"&&(t.type==="reload"&&location.reload(),t.type==="tasks-updated"&&((r=(a=g).onTasksUpdatedMessage)==null||r.call(a)),(t.type==="task-changed"||t.type==="task-deleted")&&((n=(o=g).onTasksUpdatedMessage)==null||n.call(o)))},g.ws.onclose=()=>{g.pingInterval&&(clearInterval(g.pingInterval),g.pingInterval=null),As()},g.ws.onerror=()=>{var e;(e=g.ws)==null||e.close()}}}function As(){let e=Math.min(Cs*Math.pow(2,g.reconnectAttempt),ws);g.reconnectAttempt++,g.reconnectTimer=setTimeout(Yr,e)}function Fs(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(!g.ws||g.ws.readyState!==WebSocket.OPEN)&&(g.reconnectAttempt=0,Yr())})}function pt(){let e=PROTO_CONFIG.boardId?`${PROTO_CONFIG.apiUrl}?boardId=${encodeURIComponent(PROTO_CONFIG.boardId)}`:PROTO_CONFIG.apiUrl;fetch(e).then(
|
|
1564
|
+
}`;function ks(){let e=document.createElement("div");e.id="vibeflow-studio-root",e.style.pointerEvents="none",document.body.appendChild(e);let t=e.attachShadow({mode:"open"}),a=document.createElement("style");a.textContent=jr,t.appendChild(a);let r=document.createElement("style");return r.textContent=Xr,document.head.appendChild(r),{host:e,root:t}}function Ts(){try{let e=JSON.parse(localStorage.getItem(Ss)??"{}");g.indicatorsVisible=e.indicatorsVisible===!0,g.sidebarShowDone=e.sidebarShowDone!==!1,g.showAllPages=e.showAllPages===!0,g.theme="dark",Op(g.theme)}catch{}}function Op(e){g.theme=e,g.host&&g.host.setAttribute("data-theme",e)}function Ps(e){document.addEventListener("mouseover",t=>Es(t,e),!0),document.addEventListener("mouseout",Ms,!0)}function Rs(e){if(document.removeEventListener("mouseover",t=>Es(t,e),!0),document.removeEventListener("mouseout",Ms,!0),g.hoverTarget){try{g.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}g.hoverTarget=null}}function Es(e,t){let a=e.target;if(!(!a||a===document.documentElement||a===document.body)&&e.composedPath().indexOf(t)===-1&&g.hoverTarget!==a){if(g.hoverTarget)try{g.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}g.hoverTarget=a;try{a.classList.add("vibeflow-hover-highlight")}catch{}}}function Ms(e){let t=e.target;if(t===g.hoverTarget){try{t.classList.remove("vibeflow-hover-highlight")}catch{}g.hoverTarget=null}}function Ds(e){if(zt(),!!e){g.annotateHighlightTarget=e;try{e.classList.add("vibeflow-annotate-highlight")}catch{}}}function zt(){if(g.annotateHighlightTarget){try{g.annotateHighlightTarget.classList.remove("vibeflow-annotate-highlight")}catch{}g.annotateHighlightTarget=null}}function L(e,t,...a){let r=document.createElement(e);if(t)for(let o of Object.keys(t))o==="className"?r.className=t[o]:o==="placeholder"?r.placeholder=t[o]:o==="type"?r.type=t[o]:o==="value"?r.value=t[o]:r.setAttribute(o,t[o]);for(let o of a)o!=null&&r.appendChild(typeof o=="string"?document.createTextNode(o):o);return r}function Yr(){if(PROTO_CONFIG.wsUrl){g.reconnectTimer&&(clearTimeout(g.reconnectTimer),g.reconnectTimer=null);try{g.ws=new WebSocket(PROTO_CONFIG.wsUrl)}catch{As();return}g.ws.onopen=()=>{g.reconnectAttempt=0,g.pingInterval&&clearInterval(g.pingInterval),g.pingInterval=setInterval(()=>{var e;((e=g.ws)==null?void 0:e.readyState)===WebSocket.OPEN&&g.ws.send(JSON.stringify({type:"ping"}))},Is)},g.ws.onmessage=e=>{var a,r,o,n;let t;try{t=JSON.parse(e.data)}catch{return}t.type!=="pong"&&(t.type==="reload"&&location.reload(),t.type==="tasks-updated"&&((r=(a=g).onTasksUpdatedMessage)==null||r.call(a)),(t.type==="task-changed"||t.type==="task-deleted")&&((n=(o=g).onTasksUpdatedMessage)==null||n.call(o)))},g.ws.onclose=()=>{g.pingInterval&&(clearInterval(g.pingInterval),g.pingInterval=null),As()},g.ws.onerror=()=>{var e;(e=g.ws)==null||e.close()}}}function As(){let e=Math.min(Cs*Math.pow(2,g.reconnectAttempt),ws);g.reconnectAttempt++,g.reconnectTimer=setTimeout(Yr,e)}function Fs(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(!g.ws||g.ws.readyState!==WebSocket.OPEN)&&(g.reconnectAttempt=0,Yr())})}function pt(){let e=PROTO_CONFIG.boardId?`${PROTO_CONFIG.apiUrl}?boardId=${encodeURIComponent(PROTO_CONFIG.boardId)}`:PROTO_CONFIG.apiUrl,t={};PROTO_CONFIG.overlayApiKey&&(t["X-Overlay-Api-Key"]=PROTO_CONFIG.overlayApiKey),fetch(e,Object.keys(t).length>0?{headers:t}:void 0).then(a=>a.json()).then(a=>{var r,o;g.tasks=a.tasks??[],(o=(r=g).onTasksFetched)==null||o.call(r,g.tasks)}).catch(()=>{})}function Qr(e,t,a,r,o,n,l,i){fetch(PROTO_CONFIG.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,description:r,selector:e,cssSelector:t||null,url:location.pathname,status:o||void 0,file:(n==null?void 0:n.file)??null,line:(n==null?void 0:n.line)??null,col:(n==null?void 0:n.col)??null,component:(n==null?void 0:n.component)??null,type:l||null,annotatedElementText:i||null,...PROTO_CONFIG.boardId?{boardId:PROTO_CONFIG.boardId}:{}})}).then(s=>s.json()).then(s=>{s.success&&pt()}).catch(s=>console.error("[Vibeflow Studio]",s))}var Os=PROTO_CONFIG.pagesUrl;function Bs(){Os&&fetch(Os).then(e=>e.json()).then(e=>{g.pages=e.pages??[],Bp()}).catch(()=>{})}function Bp(){if(g.pageSwitcher&&(g.pageSwitcher.remove(),g.pageSwitcher=null),!g.root||g.pages.length<2)return;let e=location.pathname,t=L("div",{className:"vibeflow-page-switcher"});t.appendChild(L("span",{className:"page-switcher-label"},"Pages:"));for(let a of g.pages){let o=L("a",{className:"page-tab"+(a===e||e==="/"&&a==="/index.html"?" active":""),href:a},a.replace(/^\//,"").replace(/\.html$/,""));t.appendChild(o)}g.root.appendChild(t),g.pageSwitcher=t}var _s=["data-testid","data-test","data-cy","data-test-id","data-task-id","data-id"];function za(e){let t=[],a=e,r=0;for(;a&&a!==document.body&&r<6;){let o=zp(a);if(o){t.unshift(`#${o}`);break}let n=null,l=null;for(let c of _s){let p=a.getAttribute(c);if(p){n=c,l=p;break}}if(n&&l){t.unshift(`[${n}="${l}"]`);break}let i=a.tagName.toLowerCase(),s=Array.from(a.classList).filter(c=>!/^[0-9a-f]{5,}/.test(c)&&!c.startsWith("vibeflow-")).slice(0,2);s.length>0&&(i+=`.${s.join(".")}`);let u=a.parentElement;if(u){let c=Array.from(u.children);c.filter(h=>h.tagName===a.tagName).length>1&&(i+=`:nth-child(${c.indexOf(a)+1})`)}t.unshift(i),a=a.parentElement,r++}return t.join(" > ")}function Np(e){let t=_s,a=e;for(;a&&a!==document.body;){for(let o of t){let n=a.getAttribute(o);if(n)return{attr:o,value:n}}let r=a.getAttribute("id");if(r&&Us(r))return{attr:"id",value:r};a=a.parentElement}return null}function Us(e){return!/^[0-9a-f-]{8,}$/i.test(e)&&!/^\d+$/.test(e)}function zp(e){let t=e.getAttribute("id");return t&&Us(t)?t:null}function Hp(e){let t=/^(react-stack|jsxDEV|renderWith|Object\.|_callee)/i;for(let a of e.split(`
|
|
1565
1565
|
`)){let r=a.match(/^\s*at\s+([A-Z][A-Za-z0-9._$]*)\s+\(/);if(r&&!t.test(r[1]))return r[1]}return null}function _p(e){let t=/^(react-stack|jsxDEV|renderWith|Object\.|_callee)/i;for(let a of e.split(`
|
|
1566
1566
|
`)){let r=a.match(/^\s*at\s+([A-Za-z_$][A-Za-z0-9._$]*)\s+\(/);if(r&&!t.test(r[1]))return r[1]}return null}function Up(e){var i,s,u,c,p,h,v,x,y,T,f,d,m,b,C,I,k,P,F;let t=Object.keys(e).find(D=>D.startsWith("__reactFiber")||D.startsWith("__reactInternalInstance"));if(!t)return null;let a=e[t],r={},o,n,l=0;for(;a&&l<20;){if(a._debugSource&&!r.file&&(r.file=a._debugSource.fileName,r.line=a._debugSource.lineNumber,r.col=a._debugSource.columnNumber),!r.component){let D=((s=(i=a._debugOwner)==null?void 0:i.type)==null?void 0:s.displayName)??((c=(u=a._debugOwner)==null?void 0:u.type)==null?void 0:c.name);D&&!o&&(o=D);let V=((x=(v=(h=(p=a._debugOwner)==null?void 0:p.return)==null?void 0:h._debugOwner)==null?void 0:v.type)==null?void 0:x.displayName)??((d=(f=(T=(y=a._debugOwner)==null?void 0:y.return)==null?void 0:T._debugOwner)==null?void 0:f.type)==null?void 0:d.name)??((C=(b=(m=a._debugOwner)==null?void 0:m._debugOwner)==null?void 0:b.type)==null?void 0:C.displayName)??((P=(k=(I=a._debugOwner)==null?void 0:I._debugOwner)==null?void 0:k.type)==null?void 0:P.name);V&&V!==D&&!n&&(n=V)}if(!r.component){let D=(F=a._debugStack)==null?void 0:F.stack;if(D){let V=Hp(D);V&&!o&&(o=V);let ne=_p(D);ne&&(r.functionName=ne)}}if((r.file||r.component)&&l>0)break;a=a.return,l++}return o&&(r.component=n?`${n} > ${o}`:o),r.file!=null||r.component!=null?r:null}function qp(e){var a,r,o;let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return{file:((a=n.type)==null?void 0:a.__file)??void 0,component:((r=n.type)==null?void 0:r.name)??((o=n.type)==null?void 0:o.__name)??void 0};t=t.parentElement}return null}function Wp(e){var a,r;let t=e;for(;t;){let o=t.__vue__;if(o)return{file:((a=o.$options)==null?void 0:a.__file)??void 0,component:((r=o.$options)==null?void 0:r.name)??void 0};t=t.parentElement}return null}function $p(e){var r;let t=window.ng;if(!t)return null;let a=e;for(;a;){try{let o=t.getComponent(a);if(o)return{component:((r=o.constructor)==null?void 0:r.name)??void 0}}catch{}a=a.parentElement}return null}function Vp(e){var l,i,s,u;let t=e,a=((l=t.__P)==null?void 0:l.__k)??[],r=new Set(["Object","VNode","VNode2"]);for(let c of a){if(!c||typeof c!="object")continue;let p=c,h=(i=p==null?void 0:p.type)==null?void 0:i.name,v=(s=p==null?void 0:p.constructor)==null?void 0:s.name,x=v&&!r.has(v)?v:void 0,y=h??x??void 0;if(y)return{component:y}}let o=t.__preactattr__;if(!o)return null;let n=(u=o==null?void 0:o.type)==null?void 0:u.name;return n?{component:n}:null}function Kp(e){return Up(e)??qp(e)??Wp(e)??$p(e)??Vp(e)}function Bn(e){let t=za(e),a={selector:t,display:t},r=Kp(e);r&&(r.file!=null&&(a.file=r.file),r.line!=null&&(a.line=r.line),r.col!=null&&(a.col=r.col),r.component!=null&&(a.component=r.component),r.functionName!=null&&(a.functionName=r.functionName));let o=e.getAttribute("data-vibeflow-id");if(o)return a.selector=`[data-vibeflow-id="${o}"]`,a.display=o,a;let n=Np(e);if(n&&(a.test_id=n.value),a.file){let l=a.file.replace(/\\/g,"/").split("/").pop()??a.file;a.selector=a.line!=null?`${a.file}:${a.line}`:a.file,a.display=a.line!=null?`${l}:${a.line}`:l}else a.component?(a.selector=a.component,a.display=a.component):a.functionName?(a.selector=a.functionName,a.display=a.functionName):n&&(a.selector=n.attr==="id"?`#${n.value}`:`[${n.attr}="${n.value}"]`,a.display=`${n.attr}:${n.value}`);return a}var Ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qs={};for(let e=0;e<Ns.length;e++)qs[Ns.charCodeAt(e)]=e;function Gp(e,t){let a=0,r=0,o=0;do o=qs[e.charCodeAt(t++)]??0,a|=(o&31)<<r,r+=5;while(o&32);return[a&1?-(a>>1):a>>1,t]}function jp(e){let t=[],a=0;for(;a<e.length;){let[r,o]=Gp(e,a);t.push(r),a=o}return t}function Xp(e,t,a){if(!e.mappings||!e.sources)return null;let r=e.mappings.split(";"),o=0,n=0,l=0,i=null;for(let s=0;s<r.length;s++){let u=0;for(let c of r[s].split(",")){if(!c)continue;let p=jp(c);if(!(p.length<1)&&(u+=p[0],p.length>=4&&(o+=p[1],n+=p[2],l+=p[3],s===t&&u<=a&&(i={source:e.sources[o]??"",line:n+1,col:l+1}),s===t&&u>a)))break}if(s>t)break}return i}function Ws(e,t,a){if(e.sections){let r=null;for(let l of e.sections)(l.offset.line<t||l.offset.line===t&&l.offset.column<=a)&&(r=l);if(!r)return null;let o=t-r.offset.line,n=o===0?a-r.offset.column:a;return Ws(r.map,o,n)}return Xp(e,t,a)}var zs=new Map;function Yp(e){let t=zs.get(e);return t||(t=fetch(`${e}.map`).then(a=>a.ok?a.json():null).catch(()=>null),zs.set(e,t)),t}var Zr=/node_modules|_next\/dist|react-stack-top-frame|jsxDEV|react_stack_bottom_frame|fakeJSXCallSite|initializeElement/;function Qp(e){for(let t of e.split(`
|
|
1567
1567
|
`)){let a=t.match(/at [^(]+ \((https?:\/\/[^)]+):(\d+):(\d+)\)/);if(!a)continue;let[,r,o,n]=a;if(!Zr.test(r))return{chunkUrl:r,line:parseInt(o,10),col:parseInt(n,10)}}return null}function Zp(e){var r;let t=Object.keys(e).find(o=>o.startsWith("__reactFiber")||o.startsWith("__reactInternalInstance"));if(!t)return null;let a=e[t];return((r=a==null?void 0:a._debugStack)==null?void 0:r.stack)??null}function On(e){return e.replace(/\?.*$/,"").replace(/^https?:\/\/[^/]+\/@fs/,"").replace(/^https?:\/\/[^/]+/,"").replace(/^file:\/\/\/app\//,"").replace(/^file:\/\/\//,"").replace(/\[project\]\//g,"").replace(/%28/g,"(").replace(/%29/g,")").replace(/%20/g," ")}var Jp=/\.m?[tj]sx?(\?[^)]*)?$/,em=/chunk[-_.][0-9a-f]{6,}|\.chunk\.[0-9a-f]|webpack|_next\/(?:static\/chunks|dist)|rollup/i;function Hs(e){return!(!e||!Jp.test(e)||em.test(e)||Zr.test(e))}function tm(e){if(typeof Error.captureStackTrace!="function")return null;let t=Error.prepareStackTrace,a=null;try{Error.prepareStackTrace=(r,o)=>(a=o,o.map(n=>` at ${n.getFunctionName()??"<anonymous>"} (${n.getFileName()}:${n.getLineNumber()}:${n.getColumnNumber()})`).join(`
|