sessiongraph 1.0.20 → 1.0.21
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/dist/assets/{index-CxnS4waR.css → index-BROemBuT.css} +1 -1
- package/dist/assets/{index-BwNazXTF.js → index-ClDHxy66.js} +1 -1
- package/dist/assets/index-DK0pBf-7.js +192 -0
- package/dist/assets/{index-nDYf67iK.js → index-DWWZZL6C.js} +1 -1
- package/dist/assets/{index-CUSJvhgf.js → index-tIWYckIn.js} +1 -1
- package/dist/assets/{public-viewer-BMIcmydl.js → public-viewer-B1aKDYpa.js} +1 -1
- package/dist/assets/{scene-oSl4S0W6.js → scene-BCuZ73oU.js} +1 -1
- package/dist/assets/{share-D7wrWEkV.js → share-mJrTMarx.js} +3 -3
- package/dist/index.html +2 -2
- package/dist-server/cli.mjs +27 -16
- package/dist-server/server.mjs +2556 -76
- package/docs/guide.md +4 -0
- package/package.json +7 -7
- package/dist/assets/index-TSi2Km_w.js +0 -186
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as a,j as i,C as R}from"./index-
|
|
1
|
+
import{R as a,j as i,C as R}from"./index-DK0pBf-7.js";var w;(function(n){n[n.Audio=1]="Audio",n[n.Cache=2]="Cache",n[n.Config=3]="Config",n[n.Data=4]="Data",n[n.LocalData=5]="LocalData",n[n.Document=6]="Document",n[n.Download=7]="Download",n[n.Picture=8]="Picture",n[n.Public=9]="Public",n[n.Video=10]="Video",n[n.Resource=11]="Resource",n[n.Temp=12]="Temp",n[n.AppConfig=13]="AppConfig",n[n.AppData=14]="AppData",n[n.AppLocalData=15]="AppLocalData",n[n.AppCache=16]="AppCache",n[n.AppLog=17]="AppLog",n[n.Desktop=18]="Desktop",n[n.Executable=19]="Executable",n[n.Font=20]="Font",n[n.Home=21]="Home",n[n.Runtime=22]="Runtime",n[n.Template=23]="Template"})(w||(w={}));var d;(function(n){n[n.Start=0]="Start",n[n.Current=1]="Current",n[n.End=2]="End"})(d||(d={}));function u(n){return{isFile:n.isFile,isDirectory:n.isDirectory,isSymlink:n.isSymlink,size:n.size,mtime:n.mtime!==null?new Date(n.mtime):null,atime:n.atime!==null?new Date(n.atime):null,birthtime:n.birthtime!==null?new Date(n.birthtime):null,readonly:n.readonly,fileAttributes:n.fileAttributes,dev:n.dev,ino:n.ino,mode:n.mode,nlink:n.nlink,uid:n.uid,gid:n.gid,rdev:n.rdev,blksize:n.blksize,blocks:n.blocks}}function U(n){const e=new Uint8ClampedArray(n),t=e.byteLength;let o=0;for(let r=0;r<t;r++){const s=e[r];o*=256,o+=s}return o}class g extends a{async read(e){if(e.byteLength===0)return 0;const t=await i("plugin:fs|read",{rid:this.rid,len:e.byteLength}),o=U(t.slice(-8)),r=t instanceof ArrayBuffer?new Uint8Array(t):t;return e.set(r.slice(0,r.length-8)),o===0?null:o}async seek(e,t){return await i("plugin:fs|seek",{rid:this.rid,offset:e,whence:t})}async stat(){const e=await i("plugin:fs|fstat",{rid:this.rid});return u(e)}async truncate(e){await i("plugin:fs|ftruncate",{rid:this.rid,len:e})}async write(e){return await i("plugin:fs|write",{rid:this.rid,data:e})}}async function b(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|create",{path:n instanceof URL?n.toString():n,options:e});return new g(t)}async function p(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|open",{path:n instanceof URL?n.toString():n,options:e});return new g(t)}async function S(n,e,t){if(n instanceof URL&&n.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|copy_file",{fromPath:n instanceof URL?n.toString():n,toPath:e instanceof URL?e.toString():e,options:t})}async function A(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|mkdir",{path:n instanceof URL?n.toString():n,options:e})}async function T(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|read_dir",{path:n instanceof URL?n.toString():n,options:e})}async function E(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|read_file",{path:n instanceof URL?n.toString():n,options:e});return t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}async function _(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|read_text_file",{path:n instanceof URL?n.toString():n,options:e}),o=t instanceof ArrayBuffer?t:Uint8Array.from(t);return new TextDecoder(e?.encoding??"utf-8").decode(o)}async function x(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=n instanceof URL?n.toString():n;return await Promise.resolve({path:t,rid:null,async next(){const o=new TextDecoder(e?.encoding??"utf-8");if(this.rid===null){const l=o.encoding;this.rid=await i("plugin:fs|read_text_file_lines",{path:t,options:e!=null?{...e,encoding:l}:void 0})}let r;try{r=await i("plugin:fs|read_text_file_lines_next",{rid:this.rid})}catch(l){throw this.rid=null,l}const s=r instanceof ArrayBuffer?new Uint8Array(r):Uint8Array.from(r),f=s[s.byteLength-1]===1;return f?(this.rid=null,{value:null,done:f}):{value:o.decode(s.slice(0,s.byteLength-1)),done:f}},async return(){if(this.rid!==null){const o=this.rid;this.rid=null,await new a(o).close()}return{value:null,done:!0}},[Symbol.asyncIterator](){return this}})}async function v(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|remove",{path:n instanceof URL?n.toString():n,options:e})}async function M(n,e,t){if(n instanceof URL&&n.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|rename",{oldPath:n instanceof URL?n.toString():n,newPath:e instanceof URL?e.toString():e,options:t})}async function C(n,e){const t=await i("plugin:fs|stat",{path:n instanceof URL?n.toString():n,options:e});return u(t)}async function k(n,e){const t=await i("plugin:fs|lstat",{path:n instanceof URL?n.toString():n,options:e});return u(t)}async function F(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|truncate",{path:n instanceof URL?n.toString():n,len:e,options:t})}async function z(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");if(e instanceof ReadableStream){const o=await p(n,{read:!1,create:!0,write:!0,...t,truncate:!t?.append}),r=e.getReader();try{for(;;){const{done:s,value:f}=await r.read();if(s)break;await o.write(f)}}finally{r.releaseLock(),await o.close()}}else await i("plugin:fs|write_file",e,{headers:{path:encodeURIComponent(n instanceof URL?n.toString():n),options:JSON.stringify(t)}})}async function I(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const o=new TextEncoder;await i("plugin:fs|write_text_file",o.encode(e),{headers:{path:encodeURIComponent(n instanceof URL?n.toString():n),options:JSON.stringify(t)}})}async function H(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|exists",{path:n instanceof URL?n.toString():n,options:e})}class y extends a{}async function L(n,e,t){const o=Array.isArray(n)?n:[n];for(const c of o)if(c instanceof URL&&c.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=new R;r.onmessage=e;const s=await i("plugin:fs|watch",{paths:o.map(c=>c instanceof URL?c.toString():c),options:t,onEvent:r}),f=new y(s);return()=>{f.close()}}async function J(n,e,t){return await L(n,e,{delayMs:2e3,...t})}async function N(n,e,t){return await L(n,e,{...t,delayMs:void 0})}async function O(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|size",{path:n instanceof URL?n.toString():n,options:e})}async function V(n){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|start_accessing_security_scoped_resource",{path:n instanceof URL?n.toString():n})}async function h(n){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|stop_accessing_security_scoped_resource",{path:n instanceof URL?n.toString():n})}export{w as BaseDirectory,g as FileHandle,d as SeekMode,S as copyFile,b as create,H as exists,k as lstat,A as mkdir,p as open,T as readDir,E as readFile,_ as readTextFile,x as readTextFileLines,v as remove,M as rename,O as size,V as startAccessingSecurityScopedResource,C as stat,h as stopAccessingSecurityScopedResource,F as truncate,J as watch,N as watchImmediate,z as writeFile,I as writeTextFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,R as i,C as o}from"./index-
|
|
1
|
+
import{j as a,R as i,C as o}from"./index-DK0pBf-7.js";class l extends i{constructor(e){super(e.rid),this.available=!0,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,n){const d=new o;e&&(d.onmessage=e);const r=await a("plugin:updater|download",{onEvent:d,rid:this.rid,...n,headers:t(n?.headers)});await this.downloadedBytes?.close().catch(()=>{}),this.downloadedBytes=new i(r)}async install(e){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await a("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid,...e}),this.downloadedBytes=void 0}async downloadAndInstall(e,n){const d=new o;e&&(d.onmessage=e),await a("plugin:updater|download_and_install",{onEvent:d,rid:this.rid,...n,headers:t(n?.headers)})}async close(){await this.downloadedBytes?.close(),await super.close()}}async function w(s){const e=await a("plugin:updater|check",{...s,headers:t(s?.headers)});return e?new l(e):null}function t(s){return s?Array.from(new Headers(s).entries()):void 0}export{l as Update,w as check};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as ge,k as te,l as k,m as Ee,n as L,q as Le,r as Me,u as De,D as Te,I as Ie,c as he,b as ye,V as Pe,w as ve,x as ke,y as Ne,h as Be,z as Fe,A as je,B as He,E as qe,F as Se,G as Oe,t as Re,d as Ge,P as Ke,H as we,J as _e}from"./index-
|
|
1
|
+
import{v as ge,k as te,l as k,m as Ee,n as L,q as Le,r as Me,u as De,D as Te,I as Ie,c as he,b as ye,V as Pe,w as ve,x as ke,y as Ne,h as Be,z as Fe,A as je,B as He,E as qe,F as Se,G as Oe,t as Re,d as Ge,P as Ke,H as we,J as _e}from"./index-DK0pBf-7.js";import{TimelineScene as Ue}from"./scene-BCuZ73oU.js";import"./three-DDiuFd7k.js";function We(s){const h=s.settings.tokens?s.sessions.filter(l=>typeof l.tokens=="number"):[],m=h.reduce((l,i)=>l+i.tokens,0);return{sessionCount:s.sessions.length,tokenCount:h.length&&Number.isSafeInteger(m)?m:null,tokensPartial:h.length>0&&h.length<s.sessions.length}}function Xe(s){const h=We(s),m=[`${h.sessionCount.toLocaleString()} sessions`];if(s.settings.tokens&&m.push(h.tokenCount===null?"Tokens unknown":`${h.tokenCount.toLocaleString()} tokens`),s.settings.messageCounts){const l=s.sessions.filter(i=>i.messages?.count!=null);m.push(l.length?`${l.reduce((i,x)=>i+x.messages.count,0).toLocaleString()} messages`:"Messages unknown")}return m.join(" · ")}const A=s=>s==null?"unknown":s.toLocaleString(),z=s=>s===null?"unknown":new Date(s).toLocaleString(),se=(s,h=!1)=>new Date(s).toLocaleDateString("en",{month:"short",day:"numeric",...h?{year:"numeric"}:{}}),Ye=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1});let Ve=0;function Ze(s,h,m={}){let l=ge(h),i=te(l),x=new Map(i.lanes.flatMap(e=>e.nodes.map(t=>[Number(t.session.projectID),e.label])));s.classList.add("public-viewer"),s.dataset.graphAudio="";const ne=`public-graph-help-${++Ve}`;s.classList.toggle("public-viewer-full",!!m.fullscreen),s.innerHTML=`
|
|
2
2
|
<div class="public-canvas" aria-label="Interactive public session graph"></div>
|
|
3
3
|
<nav class="public-view-controls" aria-label="Graph controls">
|
|
4
4
|
${k("center-focus","Fit view",{"data-fit":!0},"Fit view (F)")}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as De,W as Ae,H as Ce,T as Ee,M as ve,C as V,S as xe,a as k,G as X,P as he,I as ge,b as F,D,c as L,A as H,d as Z,e as j,B as E,F as I,f as re,g as U,V as v,h as O,i as ne,j as Fe,k as Ge,l as Ue,O as Oe,E as ze,U as Xe,m as Le,n as He,o as _e,p as Ve,q as Ne,r as se,s as $e,t as We,u as ue,v as je,w as qe,x as ae,y as de,z as Ye,L as Ze,J as we,K as Me,N as Ke}from"./three-DDiuFd7k.js";import{K as te,L as P,D as Re,M as le,N as B,a as Qe,O as Je,Q as oe,T as et,U as tt,W as it}from"./index-
|
|
1
|
+
import{R as De,W as Ae,H as Ce,T as Ee,M as ve,C as V,S as xe,a as k,G as X,P as he,I as ge,b as F,D,c as L,A as H,d as Z,e as j,B as E,F as I,f as re,g as U,V as v,h as O,i as ne,j as Fe,k as Ge,l as Ue,O as Oe,E as ze,U as Xe,m as Le,n as He,o as _e,p as Ve,q as Ne,r as se,s as $e,t as We,u as ue,v as je,w as qe,x as ae,y as de,z as Ye,L as Ze,J as we,K as Me,N as Ke}from"./three-DDiuFd7k.js";import{K as te,L as P,D as Re,M as le,N as B,a as Qe,O as Je,Q as oe,T as et,U as tt,W as it}from"./index-DK0pBf-7.js";class st extends De{target=new Ae(1,1,{type:Ce});copy=new Ee(this.target.texture);setSamples(e){this.target.samples!==e&&(this.target.samples=e,this.target.dispose())}setSize(e,t){this.target.setSize(e,t)}render(e,t,s,o,i){if(!this.target.samples){super.render(e,t,s,o,i);return}super.render(e,t,this.target,o,i),this.copy.render(e,t,s,o,i)}dispose(){this.copy.dispose(),this.target.dispose()}}const ot=new Intl.DateTimeFormat("en",{month:"short"}),rt=new Intl.DateTimeFormat("en",{month:"short",year:"numeric"});function nt(u){if(u.calendarTime===!1||!(u.end>u.start))return[];const e=new Date(u.start),t=new Date(u.end);if(!Number.isFinite(+e)||!Number.isFinite(+t))return[];const s=h=>h.getFullYear()*12+h.getMonth(),o=s(e),i=s(t),r=Math.ceil((i-o+1)/24),a=[1,2,3,6,12].find(h=>h>=r)??Math.ceil(r/12)*12,n=o===i||e.getFullYear()!==t.getFullYear()?rt:ot,l=[];for(let h=Math.ceil(o/a)*a;h<=i;h+=a){const c=new Date(0);c.setFullYear(Math.floor(h/12),h%12,1),c.setHours(0,0,0,0),+c>=u.start&&+c<=u.end&&l.push({x:te(+c,u),label:n.format(c)})}return!l.length&&o===i&&l.push({x:te(u.start,u),label:n.format(e)}),l}const Te=`
|
|
2
2
|
attribute float nodeIndex;
|
|
3
3
|
uniform float uSelected;
|
|
4
4
|
uniform float uHovered;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{p as z,i as j,_ as H,s as K,a as V,o as J,b as Q,c as Y,t as Z,d as ee,S as L,e as te,f as ae,g as se,h as oe}from"./index-
|
|
3
|
-
https://sessiongraph.ai`,ye=`https://x.com/intent/tweet?text=${encodeURIComponent(T)}`,G=e=>e instanceof Error&&e.name==="AbortError";async function me(e,l,a){const{label:n,description:i,mime:y,filename:h}=$[a];try{if(j()){const[{save:d},{writeFile:s}]=await Promise.all([H(()=>import("./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-ClDHxy66.js","assets/index-DK0pBf-7.js","assets/index-BROemBuT.css","assets/index-DWWZZL6C.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as z,i as j,_ as H,s as K,a as V,o as J,b as Q,c as Y,t as Z,d as ee,S as L,e as te,f as ae,g as se,h as oe}from"./index-DK0pBf-7.js";import{TimelineScene as re}from"./scene-BCuZ73oU.js";import"./three-DDiuFd7k.js";const ne="#b0e9d6",ie="#dbe7e3",O=128,le=10,de="M102 24 86 40H36a14 14 0 0 0 0 28h40a14 14 0 0 1 0 28H22",ce=[[102,24],[36,40],[22,96]],ue=10;let U;function he(e,l,a,n,i=ne){U??=new Path2D(de),e.save(),e.translate(l,a),e.scale(n/O,n/O),e.strokeStyle=e.fillStyle=i,e.lineWidth=le,e.lineCap=e.lineJoin="round",e.stroke(U);for(const[y,h]of ce)e.beginPath(),e.arc(y,h,ue,0,Math.PI*2),e.fill();e.restore()}function pe(e){const l=z(e.lanes.length),a=new Map(e.lanes.flatMap(s=>s.nodes.map(t=>[t.session.id,s.key]))),n=new Map;for(const s of e.nodes.map(t=>t.session).sort((t,r)=>t.created-r.created||t.id.localeCompare(r.id))){const t=a.get(s.id);t!==void 0&&!n.has(t)&&n.set(t,n.size)}const i=new Map(e.nodes.map((s,t)=>[s.session.id,`session-${t}`])),y=new Map(e.lanes.flatMap((s,t)=>s.nodes.map(r=>[r.session.id,`project-${t}`]))),h=e.nodes.map(s=>{const t=s.session,r={id:i.get(t.id),title:"Session",projectID:y.get(t.id),directory:"",created:t.created,updated:t.created,activity:t.activity&&{firstMessageAt:t.activity.firstMessageAt,lastMessageAt:t.activity.lastMessageAt,userMessages:t.activity.userMessages,untimedUserMessages:t.activity.untimedUserMessages},archived:!1,model:"",provider:"",agent:"",cost:null,source:t.source==="continue"?"continue":t.source==="opencode"||!t.source?"opencode":"unknown",tokens:t.tokens};return t.parentID&&i.has(t.parentID)&&(r.parentID=i.get(t.parentID)),t.forkID&&i.has(t.forkID)&&(r.forkID=i.get(t.forkID)),{session:r,position:[...s.position],startPosition:[...s.startPosition],color:s.color,radius:s.radius}}),d=new Map(h.map(s=>[s.session.id,s]));return{start:e.start,end:e.end,timeFrame:e.timeFrame&&{...e.timeFrame},nodes:h,edges:e.edges.map(s=>({from:i.get(s.from),to:i.get(s.to),kind:s.kind})),lanes:e.lanes.map((s,t)=>({key:`project-${t}`,label:l[n.get(s.key)],color:s.color,kind:"directory",y:s.y,z:s.z,nodes:s.nodes.map(r=>d.get(i.get(r.session.id)))}))}}const $={mp4:{label:"MP4",description:"MP4 video",mime:"video/mp4",filename:"sessiongraph-playback.mp4"}},T=`My coding sessions, visualized with SessionGraph.
|
|
3
|
+
https://sessiongraph.ai`,ye=`https://x.com/intent/tweet?text=${encodeURIComponent(T)}`,G=e=>e instanceof Error&&e.name==="AbortError";async function me(e,l,a){const{label:n,description:i,mime:y,filename:h}=$[a];try{if(j()){const[{save:d},{writeFile:s}]=await Promise.all([H(()=>import("./index-ClDHxy66.js"),__vite__mapDeps([0,1,2])),H(()=>import("./index-DWWZZL6C.js"),__vite__mapDeps([3,1,2]))]),t=await d({title:`Save SessionGraph ${n}`,defaultPath:h,filters:[{name:i,extensions:[a]}]});if(!t)return"cancelled";await s(t,new Uint8Array(await e.arrayBuffer()))}else{const d=window.showSaveFilePicker;if(d){const t=await(await d.call(window,{suggestedName:h,types:[{description:i,accept:{[y]:[`.${a}`]}}]})).createWritable();try{await t.write(e),await t.close()}catch(r){throw await t.abort().catch(()=>{}),r}}else{const s=document.createElement("a");return s.href=l,s.download=h,document.body.append(s),s.click(),s.remove(),"downloaded"}}return"saved"}catch(d){if(G(d))return"cancelled";throw d}}const g=960,P=600,q='"Katagami Sans", sans-serif',fe=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e);function ve(e,l,a,n,i,y){const s=P-122,t=Math.max(1,...n);e.save(),he(e,24,14,28),e.fillStyle=ie,e.font=`600 14px ${q}`,e.textAlign="left",e.textBaseline="middle",e.fillText("SessionGraph",58,28),e.restore();for(let u=0;u<n.length;u++){const m=Math.max(2,n[u]/t*22);e.fillStyle=u/n.length<=a?"#91bfae":"#253d39",e.fillRect(260+u/n.length*440,s-m,440/n.length-2,m)}e.fillStyle="#d6f4e8",e.fillRect(260+440*a,s-27,1,31);const r=l.start+(l.end-l.start)*a,k=i.at(r,a===1).tokens;e.textAlign="center",e.fillStyle="#a0baae",e.font='12px "IBM Plex Mono", monospace',e.fillText(oe(r,l.end-l.start),g/2,s+23),e.fillStyle="#e7f5ee",e.font=`36px ${q}`,e.fillText(y(r,a===1).toLocaleString("en"),g/2-105,s+66),e.fillText(i.recorded?fe(k):"—",g/2+105,s+66),e.font=`12px ${q}`,e.fillStyle="#92b0a3",e.fillText("Sessions",g/2-105,s+87),e.fillText("Burnt tokens",g/2+105,s+87),e.textAlign="left"}async function be(e,l,a,n){a.throwIfAborted();const{label:i,mime:y}=$.mp4,h=Q(e.nodes.map(p=>p.session)),d=Y(e.nodes.map(p=>p.session)),s=Z(e.nodes.map(p=>ee(p.session)),e.start,e.end),t=document.createElement("div");t.className="share-render-host",t.setAttribute("aria-hidden","true"),t.style.cssText=`position:fixed;left:-12000px;top:0;width:${g}px;height:${P}px;pointer-events:none;visibility:hidden`,document.body.append(t);const r=document.createElement("canvas");r.width=g,r.height=P;const k=r.getContext("2d",{willReadFrequently:!0});let u,m;try{if(!k)throw new Error("Canvas export is unavailable.");u=new re(t,{onSelect(){},onHover(){},onPlaybackInterrupt(){},onEvent(){},onEventHover(){}},{manual:!0}),u.applyPreferences({...l,quality:"balanced",motion:"on",labels:!0,focusDimming:!1,trails:l.trails==="selected"?"all":l.trails}),u.setGraph(e,!0),u.prepareCapture(),await document.fonts.ready,a.throwIfAborted(),m=new Worker(new URL("/assets/mp4-worker-Dc_1QUwS.js",import.meta.url),{type:"module"});const p=(v,A=[])=>new Promise((b,w)=>{a.throwIfAborted();const f=()=>{clearTimeout(M),a.removeEventListener("abort",C),m.onmessage=null,m.onerror=null},C=()=>{f(),w(a.reason)},M=setTimeout(()=>{f(),w(new Error(`${i} encoding timed out. Please try again.`))},6e4);a.addEventListener("abort",C,{once:!0}),m.onmessage=E=>{f(),E.data.error?w(new Error(E.data.error)):b(E.data)},m.onerror=()=>{f(),w(new Error(`Could not start the ${i} encoder.`))},m.postMessage(v,A)});await p({init:!0,width:g,height:P});for(let v=0;v<L;v++){a.throwIfAborted();const A=te(v);u.captureFrame(A,1/ae,k,se(v)),ve(k,e,A,s,h,d);const b=k.getImageData(0,0,g,P).data.buffer;await p({rgba:b,width:g,height:P},[b]),n((v+1)/L)}const I=await p({finish:!0});return new Blob([I.bytes],{type:y})}finally{m?.terminate(),u?.dispose(),t.remove()}}function ke(e,l){const a=document.createElement("dialog");a.className="share-dialog",a.setAttribute("aria-labelledby","share-title"),a.innerHTML=`<p>Create a private MP4 video. Project and session names are hidden, and nothing is uploaded.</p>
|
|
4
4
|
<div class="share-preview"><video aria-label="SessionGraph playback with hidden project and session names" muted loop playsinline controls hidden></video><div class="share-progress"><progress max="100" value="0" aria-label="Creating video"></progress><span role="status">Creating video… 0%</span></div></div>
|
|
5
5
|
<p class="share-notice" role="status" hidden></p>
|
|
6
6
|
<div class="share-actions"><button class="text-button share-close">Cancel</button><button class="secondary-button share-retry" hidden>Try again</button><a class="secondary-button share-x" target="_blank" rel="noopener noreferrer" hidden>Share in X</a><button class="secondary-button share-system" aria-label="Open share tray" aria-controls="playback-share-tray" aria-expanded="false" hidden>Share…</button><button class="primary-button share-save" hidden>Save MP4</button></div>
|
package/dist/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<link rel="icon" sizes="any" href="/favicon.ico" />
|
|
13
13
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
14
14
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-DK0pBf-7.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BROemBuT.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="app"></div>
|
package/dist-server/cli.mjs
CHANGED
|
@@ -52935,7 +52935,7 @@ var init_codex = __esm({
|
|
|
52935
52935
|
// server/adapters/t3-code.ts
|
|
52936
52936
|
import { lstat as lstat7 } from "node:fs/promises";
|
|
52937
52937
|
import { homedir as homedir7 } from "node:os";
|
|
52938
|
-
import { isAbsolute as
|
|
52938
|
+
import { isAbsolute as isAbsolute5, join as join13 } from "node:path";
|
|
52939
52939
|
function parsedObject(value) {
|
|
52940
52940
|
if (typeof value !== "string") return;
|
|
52941
52941
|
try {
|
|
@@ -53154,7 +53154,7 @@ function v2Message(row, directory3) {
|
|
|
53154
53154
|
message2.events = [eventFor(message2, id3, kind2, file2, "", { ...fields3, callID: string6(native.nativeId) || void 0 })];
|
|
53155
53155
|
return message2;
|
|
53156
53156
|
}
|
|
53157
|
-
if (file2 && completed) message2.files.push({ path:
|
|
53157
|
+
if (file2 && completed) message2.files.push({ path: isAbsolute5(file2) ? file2 : join13(directory3, file2), source: "file change", steps: 1 });
|
|
53158
53158
|
message2.events = [eventFor(message2, id3, "file_change", file2 || name, "", fields3)];
|
|
53159
53159
|
return message2;
|
|
53160
53160
|
}
|
|
@@ -53530,7 +53530,7 @@ var init_cursor_store = __esm({
|
|
|
53530
53530
|
});
|
|
53531
53531
|
|
|
53532
53532
|
// server/adapters/cursor-composer.ts
|
|
53533
|
-
import { isAbsolute as
|
|
53533
|
+
import { isAbsolute as isAbsolute6 } from "node:path";
|
|
53534
53534
|
import { fileURLToPath } from "node:url";
|
|
53535
53535
|
function decode3(value) {
|
|
53536
53536
|
return object4(JSON.parse(typeof value === "string" ? value : value instanceof Uint8Array ? Buffer.from(value).toString("utf8") : "{}"));
|
|
@@ -53538,7 +53538,7 @@ function decode3(value) {
|
|
|
53538
53538
|
function directory2(raw) {
|
|
53539
53539
|
const value = text3(raw.workspaceIdentifier?.uri?.path) || text3(raw.workspaceIdentifier?.uri) || text3(raw.cwd);
|
|
53540
53540
|
try {
|
|
53541
|
-
return value.startsWith("file:") ? fileURLToPath(value) :
|
|
53541
|
+
return value.startsWith("file:") ? fileURLToPath(value) : isAbsolute6(value) ? value : "";
|
|
53542
53542
|
} catch {
|
|
53543
53543
|
return "";
|
|
53544
53544
|
}
|
|
@@ -53656,7 +53656,7 @@ var init_cursor_composer = __esm({
|
|
|
53656
53656
|
import { createHash as createHash5 } from "node:crypto";
|
|
53657
53657
|
import { lstat as lstat8, opendir as opendir2, readFile as readFile2 } from "node:fs/promises";
|
|
53658
53658
|
import { homedir as homedir8 } from "node:os";
|
|
53659
|
-
import { isAbsolute as
|
|
53659
|
+
import { isAbsolute as isAbsolute7, join as join15 } from "node:path";
|
|
53660
53660
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
53661
53661
|
async function fileStats(path) {
|
|
53662
53662
|
try {
|
|
@@ -53926,7 +53926,7 @@ var init_cursor = __esm({
|
|
|
53926
53926
|
init_jsonl();
|
|
53927
53927
|
LIMIT = 2e4;
|
|
53928
53928
|
validID = (id3) => /^[a-z\d][\w-]{0,159}$/i.test(id3);
|
|
53929
|
-
cwd = (value) => typeof value === "string" &&
|
|
53929
|
+
cwd = (value) => typeof value === "string" && isAbsolute7(value) && !/[\x00-\x1f\x7f]/.test(value) ? value : "";
|
|
53930
53930
|
slug = (path) => path.replace(/\\/g, "/").replace(/^([A-Z]):/i, (_, drive) => drive.toLowerCase()).replace(/^\/+|\/+$/g, "").replace(/[/:]+/g, "-");
|
|
53931
53931
|
hashCwd = (path) => createHash5("md5").update(path).digest("hex");
|
|
53932
53932
|
userData = () => process.platform === "darwin" ? join15(homedir8(), "Library/Application Support/Cursor") : process.platform === "win32" ? join15(process.env.APPDATA || join15(homedir8(), "AppData/Roaming"), "Cursor") : join15(process.env.XDG_CONFIG_HOME || join15(homedir8(), ".config"), "Cursor");
|
|
@@ -54759,7 +54759,7 @@ var init_harness_files = __esm({
|
|
|
54759
54759
|
|
|
54760
54760
|
// server/adapters/harness-databases.ts
|
|
54761
54761
|
import { lstat as lstat9, readFile as readFile3 } from "node:fs/promises";
|
|
54762
|
-
import { isAbsolute as
|
|
54762
|
+
import { isAbsolute as isAbsolute8, join as join23 } from "node:path";
|
|
54763
54763
|
function hermesContent(value) {
|
|
54764
54764
|
if (typeof value !== "string" || !value.startsWith("\0json:")) return value;
|
|
54765
54765
|
try {
|
|
@@ -54879,7 +54879,7 @@ var init_harness_databases = __esm({
|
|
|
54879
54879
|
goose = {
|
|
54880
54880
|
id: "goose",
|
|
54881
54881
|
name: "Goose",
|
|
54882
|
-
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT &&
|
|
54882
|
+
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT && isAbsolute8(process.env.GOOSE_PATH_ROOT) ? [join23(process.env.GOOSE_PATH_ROOT, "data/sessions/sessions.db")] : [dataPath("goose/sessions/sessions.db"), dataPath("Block/goose/sessions/sessions.db"), appPath("goose/sessions/sessions.db"), appPath("Block/goose/sessions/sessions.db"), appPath("Block/goose/data/sessions/sessions.db")], (p) => p.endsWith("sessions.db")),
|
|
54883
54883
|
table: "sessions",
|
|
54884
54884
|
key: "id",
|
|
54885
54885
|
fields: [
|
|
@@ -55002,8 +55002,8 @@ var init_harness_databases = __esm({
|
|
|
55002
55002
|
const raw = JSON.parse(await readFile3(registry2, "utf8"));
|
|
55003
55003
|
const paths2 = [];
|
|
55004
55004
|
for (const p of Array.isArray(raw.projects) ? raw.projects.slice(0, 2e4) : []) {
|
|
55005
|
-
if (!
|
|
55006
|
-
const path = join23(
|
|
55005
|
+
if (!isAbsolute8(text3(p.path)) || !text3(p.data_dir)) continue;
|
|
55006
|
+
const path = join23(isAbsolute8(p.data_dir) ? p.data_dir : join23(p.path, p.data_dir), "crush.db");
|
|
55007
55007
|
paths2.push(path);
|
|
55008
55008
|
crushDirectories.set(path, p.path);
|
|
55009
55009
|
}
|
|
@@ -66993,7 +66993,7 @@ var SessionGraphStore = class {
|
|
|
66993
66993
|
};
|
|
66994
66994
|
|
|
66995
66995
|
// server/library-service.ts
|
|
66996
|
-
import { basename as basename3 } from "node:path";
|
|
66996
|
+
import { basename as basename3, isAbsolute as isAbsolute3 } from "node:path";
|
|
66997
66997
|
|
|
66998
66998
|
// server/git-checkouts.ts
|
|
66999
66999
|
import { execFile } from "node:child_process";
|
|
@@ -67085,8 +67085,8 @@ var Importer = class {
|
|
|
67085
67085
|
status = { running: false, discovered: 0, imported: 0, unchanged: 0, failed: 0, errors: [], warnings: [] };
|
|
67086
67086
|
job;
|
|
67087
67087
|
adapters;
|
|
67088
|
-
async sources() {
|
|
67089
|
-
return Promise.all(this.adapters.map(async (adapter) => ({ id: adapter.id, name: adapter.name, description: adapter.description, capabilities: adapter.capabilities, available: await adapter.detect().catch(() => false), selected: this.store.selected().includes(adapter.id), ...this.store.sourceInfo(adapter.id) })));
|
|
67088
|
+
async sources(ids) {
|
|
67089
|
+
return Promise.all(this.adapters.filter((adapter) => !ids || ids.includes(adapter.id)).map(async (adapter) => ({ id: adapter.id, name: adapter.name, description: adapter.description, capabilities: adapter.capabilities, available: await adapter.detect().catch(() => false), selected: this.store.selected().includes(adapter.id), ...this.store.sourceInfo(adapter.id) })));
|
|
67090
67090
|
}
|
|
67091
67091
|
start(ids, automatic = false) {
|
|
67092
67092
|
return this.begin(ids, automatic, true);
|
|
@@ -69224,7 +69224,7 @@ var utc = (ms) => ms > 0 && ms <= 864e13 ? new Date(ms).toISOString() : null;
|
|
|
69224
69224
|
var LibraryService = class {
|
|
69225
69225
|
constructor(store, adapters2) {
|
|
69226
69226
|
this.store = store;
|
|
69227
|
-
this.importer = new Importer(store, adapters2);
|
|
69227
|
+
this.importer = adapters2 instanceof Importer ? adapters2 : new Importer(store, adapters2);
|
|
69228
69228
|
}
|
|
69229
69229
|
store;
|
|
69230
69230
|
searchCache;
|
|
@@ -69257,14 +69257,25 @@ var LibraryService = class {
|
|
|
69257
69257
|
key(kind, sessions, filters4) {
|
|
69258
69258
|
return fingerprint([this.store.setting("libraryID"), kind, filters4, sessions]);
|
|
69259
69259
|
}
|
|
69260
|
-
async discoverSources() {
|
|
69260
|
+
async discoverSources(ids) {
|
|
69261
69261
|
const paths2 = this.store.setting("sourcePaths") || {};
|
|
69262
69262
|
return {
|
|
69263
|
-
sources: (await this.importer.sources()).map((source) => ({ ...source, path: paths2[source.id] || null, pathSupported: true, pathHint: sourcePathHint(source.id) })),
|
|
69263
|
+
sources: (await this.importer.sources(ids)).map((source) => ({ ...source, path: paths2[source.id] || null, pathSupported: true, pathHint: sourcePathHint(source.id) })),
|
|
69264
69264
|
configured: this.store.setting("selected") !== void 0,
|
|
69265
69265
|
autoImport: this.store.autoImportEnabled()
|
|
69266
69266
|
};
|
|
69267
69267
|
}
|
|
69268
|
+
/** Editing a location neither selects a source nor imports its conversations. */
|
|
69269
|
+
setSourcePath(id3, path) {
|
|
69270
|
+
this.validateSources([id3]);
|
|
69271
|
+
if (path !== null && (typeof path !== "string" || !path.trim() || path.includes("\0") || !isAbsolute3(path) && path !== "~" && !path.startsWith("~/"))) invalid("Enter an absolute history path, or choose Automatic.");
|
|
69272
|
+
return this.configure(() => {
|
|
69273
|
+
const paths2 = this.store.setting("sourcePaths") || {};
|
|
69274
|
+
if (path === null) delete paths2[id3];
|
|
69275
|
+
else paths2[id3] = localPath(path);
|
|
69276
|
+
this.store.setting("sourcePaths", paths2);
|
|
69277
|
+
});
|
|
69278
|
+
}
|
|
69268
69279
|
configure(change) {
|
|
69269
69280
|
if (this.importer.status.running || !this.store.acquireImport()) throw new LibraryError("IMPORT_BUSY", "Another import is running. Try again when it finishes.");
|
|
69270
69281
|
try {
|