sessiongraph-app-win32-x64 1.0.12 → 1.0.13
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/package.json +2 -2
- package/payload/SessionGraph.exe +0 -0
- package/payload/resources/server.mjs +90 -30
- package/payload/resources/web/assets/{external-links-D0O8IeG0.js → external-links-BcKDmn29.js} +1 -1
- package/payload/resources/web/assets/{index-CIhs02tq.js → index-CDA8pT1Q.js} +32 -31
- package/payload/resources/web/assets/{index-BS2Voifb.js → index-CJb-F0VY.js} +1 -1
- package/payload/resources/web/assets/{index-Vq4WYmzW.js → index-DYhIhreE.js} +1 -1
- package/payload/resources/web/assets/{index-GTrhxXlP.js → index-HzUuskn3.js} +1 -1
- package/payload/resources/web/assets/{publishing-ofssf6d6.js → publishing-CpVLG7_B.js} +1 -1
- package/payload/resources/web/assets/{scene-KCDTPCOD.js → scene-BkoCsbA8.js} +1 -1
- package/payload/resources/web/assets/{share-DKeJCFAo.js → share-CS1dKayZ.js} +3 -3
- package/payload/resources/web/index.html +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as a,n as i,C as R}from"./index-
|
|
1
|
+
import{R as a,n as i,C as R}from"./index-CDA8pT1Q.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{n as a,R as i,C as o}from"./index-
|
|
1
|
+
import{n as a,R as i,C as o}from"./index-CDA8pT1Q.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,s){const d=new o;e&&(d.onmessage=e);const r=await a("plugin:updater|download",{onEvent:d,rid:this.rid,...s,headers:t(s?.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,s){const d=new o;e&&(d.onmessage=e),await a("plugin:updater|download_and_install",{onEvent:d,rid:this.rid,...s,headers:t(s?.headers)})}async close(){await this.downloadedBytes?.close(),await super.close()}}async function w(n){const e=await a("plugin:updater|check",{...n,headers:t(n?.headers)});return e?new l(e):null}function t(n){return n?Array.from(new Headers(n).entries()):void 0}export{l as Update,w as check};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as i}from"./index-
|
|
1
|
+
import{n as i}from"./index-CDA8pT1Q.js";function r(e){if(e!==void 0){if(typeof e=="string")return e;if("ok"in e&&"cancel"in e)return{OkCancelCustom:[e.ok,e.cancel]};if("yes"in e&&"no"in e&&"cancel"in e)return{YesNoCancelCustom:[e.yes,e.no,e.cancel]};if("ok"in e)return{OkCustom:e.ok}}}async function f(e={}){return typeof e=="object"&&Object.freeze(e),await i("plugin:dialog|open",{options:e})}async function k(e={}){return typeof e=="object"&&Object.freeze(e),await i("plugin:dialog|save",{options:e})}async function l(e,a){return await i("plugin:dialog|message",{message:e,title:a?.title,kind:a?.kind,buttons:r(a?.buttons)})}async function s(e,a){const n=typeof a=="string"?{title:a}:a;return n&&!n.buttons&&n.okLabel&&(n.buttons={ok:n.okLabel}),l(e,n)}async function u(e,a){const n=typeof a=="string"?{title:a}:a,c=n?.okLabel||n?.cancelLabel,t=n?.okLabel??"Yes";return await l(e,{title:n?.title,kind:n?.kind,buttons:c?{ok:t,cancel:n.cancelLabel??"No"}:"YesNo"})===t}async function d(e,a){const n=typeof a=="string"?{title:a}:a,c=n?.okLabel||n?.cancelLabel,t=n?.okLabel??"Ok";return await l(e,{title:n?.title,kind:n?.kind,buttons:c?{ok:t,cancel:n.cancelLabel??"Cancel"}:"OkCancel"})===t}export{u as ask,d as confirm,s as message,f as open,k as save};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as pe,j as me,m as ge,D as be,a as ae,k as q,l as ie,t as he,P as fe,g as ye,c as we,i as V}from"./index-
|
|
1
|
+
import{h as pe,j as me,m as ge,D as be,a as ae,k as q,l as ie,t as he,P as fe,g as ye,c as we,i as V}from"./index-CDA8pT1Q.js";import{TimelineScene as ve}from"./scene-BkoCsbA8.js";import{s as ke,e as Se,o as Ce}from"./external-links-BcKDmn29.js";import"./three-D_1Qt16u.js";const xe=["svg",pe,[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}],["path",{d:"M9 18c-4.51 2-5-2-7-2"}]]],Ae={tokens:"Token counts",timestamps:"Session timestamps",messageCounts:"Message counts",messageTimestamps:"Message timestamps",model:"Model used",harness:"Harness used"},Z={tokens:!0,timestamps:!0,messageCounts:!0,messageTimestamps:!0,model:!0,harness:!0};function oe(t){const r={...Z};if(ce(t))for(const n of Object.keys(r))typeof t[n]=="boolean"&&(r[n]=t[n]);return(!r.timestamps||!r.messageCounts)&&(r.messageTimestamps=!1),r}const re=1e4,Ee=2e6,Pe=1e5,Me="Always excluded: project and session names, messages, code, paths, source IDs, and costs. Anonymous groups and recorded branch links are included. Your GitHub username identifies this profile. Your published graph will appear in Explore graphs. Selected timestamps and usage will be public.",Te=/^(?:gpt-[3-6](?:\.[0-9])?(?:-(?:turbo|mini|nano|pro|codex|astra|instant|thinking|chat|latest|preview|[0-9]{4,8}))*|o[1-4](?:-(?:mini|pro|preview|[0-9]{4,8}))*|claude-(?:(?:sonnet|opus|haiku)-[3-5](?:[.-][0-9])?|[3-5](?:-[0-9])?-(?:sonnet|opus|haiku))(?:-(?:latest|thinking|[0-9]{8}))*|gemini-[1-4](?:\.[0-9])?-(?:pro|flash)(?:-(?:lite|preview|exp|latest|[0-9]{2,4}))*|deepseek-(?:chat|reasoner|v[3-4](?:\.[0-9])?|r1)|grok-[2-5](?:\.[0-9])?(?:-(?:fast|code|reasoning|non-reasoning|[0-9]))*|kimi-k[1-3](?:\.[0-9])?(?:-thinking)?|minimax-m[1-3](?:\.[0-9])?)$/i,Le=t=>{const r=t.split("/").at(-1)||"";return r.length<=100&&Te.test(r)?r.toLowerCase():null},ce=t=>!!t&&typeof t=="object"&&!Array.isArray(t),B=(t,r)=>ce(t)&&Object.keys(t).length===r.length&&r.every(n=>Object.hasOwn(t,n)),Y=(t,r=Number.MAX_SAFE_INTEGER)=>Number.isSafeInteger(t)&&t>=0&&t<=r,W=t=>Y(t,Date.UTC(2100,0,1)),z=t=>t===null||Y(t);function de(t){const r=()=>{throw new Error("Invalid anonymous graph. Reopen the publishing preview and try again.")};if(!B(t,["version","settings","sessions"])||t.version!==1||!Array.isArray(t.sessions)||!B(t.settings,Object.keys(Z))||Object.values(t.settings).some(f=>typeof f!="boolean"))return r();const n=t.settings;if(n.messageTimestamps&&(!n.timestamps||!n.messageCounts))return r();if(t.sessions.length<1||t.sessions.length>re)throw new Error(`Choose between 1 and ${re.toLocaleString("en")} sessions to publish.`);const e=["id","group","parent","fork",...n.timestamps?["timestamps"]:[],...n.tokens?["tokens"]:[],...n.messageCounts?["messages"]:[],...n.messageTimestamps?["messageTimes"]:[],...n.model?["model"]:[],...n.harness?["harness"]:[]];let m=0;for(let f=0;f<t.sessions.length;f++){const i=t.sessions[f];if(!B(i,e)||i.id!==f||!Y(i.group,t.sessions.length-1))return r();for(const p of["parent","fork"])if(i[p]!==null&&(!Y(i[p],t.sessions.length-1)||i[p]===f))return r();if(n.timestamps&&(!B(i.timestamps,["created","lastMessageAt"])||!W(i.timestamps.created)||i.timestamps.lastMessageAt!==null&&!W(i.timestamps.lastMessageAt))||n.tokens&&!z(i.tokens)||n.messageCounts&&(!B(i.messages,["count","untimed","partial"])||!z(i.messages.count)||!z(i.messages.untimed)||typeof i.messages.partial!="boolean")||n.messageTimestamps&&(!B(i.messageTimes,["values","limited"])||!Array.isArray(i.messageTimes.values)||i.messageTimes.values.length>2e3||typeof i.messageTimes.limited!="boolean"||i.messageTimes.values.some(p=>!W(p))||(m+=i.messageTimes.values.length,m>Pe))||n.model&&i.model!==null&&(typeof i.model!="string"||Le(i.model)!==i.model)||n.harness&&i.harness!==null&&(typeof i.harness!="string"||!me(i.harness)))return r()}const o=t.sessions,l=new Uint8Array(o.length);for(let f=0;f<o.length;f++){if(l[f])continue;const i=[[f,!1]];for(;i.length;){const[p,M]=i.pop();if(M){l[p]=2;continue}if(l[p]===1)return r();if(l[p]!==2){l[p]=1,i.push([p,!0]);for(const S of[o[p].parent,o[p].fork])S!==null&&i.push([S,!1])}}}if(new TextEncoder().encode(JSON.stringify(t)).length>Ee)throw new Error("This graph is too large. Choose a smaller date range.");return t}function le(t,r){const n=de(t),e=n.sessions.filter(l=>!r||r.has(l.id)).map(l=>({id:String(l.id),projectID:String(l.group),title:`Session ${l.id+1}`,directory:"",created:l.timestamps?.created??l.id*36e5,updated:l.timestamps?.created??l.id*36e5,tokens:l.tokens??null,cost:null,archived:!1,model:l.model??"",provider:"",agent:"",source:l.harness??void 0,activity:{firstMessageAt:null,lastMessageAt:l.timestamps?.lastMessageAt??null,userMessages:0,untimedUserMessages:0},...l.parent===null?{}:{parentID:String(l.parent)},...l.fork===null?{}:{forkID:String(l.fork)}})),m=[...new Set(n.sessions.map(l=>l.group))].map(l=>({id:String(l),name:`Group ${l+1}`,directory:"",worktrees:[]})),o=ge(e.map(l=>({...l,source:void 0})),m);for(const l of o.nodes)l.session.source=n.sessions[Number(l.session.id)].harness??void 0;return o}function $e(t){const r=t.settings.tokens?t.sessions.filter(e=>typeof e.tokens=="number"):[],n=r.reduce((e,m)=>e+m.tokens,0);return{sessionCount:t.sessions.length,tokenCount:r.length&&Number.isSafeInteger(n)?n:null,tokensPartial:r.length>0&&r.length<t.sessions.length}}function ue(t){const r=$e(t),n=[`${r.sessionCount.toLocaleString()} sessions`];if(t.settings.tokens&&n.push(r.tokenCount===null?"Tokens unavailable":`${r.tokenCount.toLocaleString()} recorded tokens${r.tokensPartial?" (partial coverage)":""}`),t.settings.messageCounts){const e=t.sessions.filter(m=>m.messages?.count!=null);n.push(e.length?`${e.reduce((m,o)=>m+o.messages.count,0).toLocaleString()} recorded messages${e.length<t.sessions.length||t.sessions.some(m=>m.messages?.partial)?" (partial history)":""}`:"Message counts unavailable")}return n.join(" · ")}const Q=t=>t==null?"Unknown":t.toLocaleString(),R=t=>t===null?"Unknown":new Date(t).toLocaleString();function Ie(t,r,n={}){const e=de(r);let m=le(e);t.classList.add("public-viewer"),t.classList.toggle("public-viewer-full",!!n.fullscreen),t.innerHTML=`
|
|
2
2
|
<div class="public-canvas" aria-label="Interactive public session graph"></div>
|
|
3
3
|
<div class="public-toolbar"><button type="button" data-sessions aria-expanded="true">☷ Sessions</button><span class="public-badge">Public snapshot</span></div>
|
|
4
4
|
<nav class="public-view-controls" aria-label="Graph controls"><div class="public-view-switch"><button type="button" data-view="3d" aria-pressed="true">3D</button><button type="button" data-view="2d" aria-pressed="false">2D</button></div><button type="button" data-fit title="Fit view (F)">Fit view</button><button type="button" data-motion aria-pressed="true">Motion</button><button type="button" data-timeline aria-expanded="true">Timeline</button></nav>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as oe,C as L,S as ce,a as M,G,P as ae,I as ne,b as k,D as F,c as I,A as T,d as Y,e as N,B as D,F as S,f as re,g as H,W as ke,h as Pe,O as Se,i as Ae,H as Ce,E as Re,R as Fe,U as Ee,V as O,j as Ie,k as Te,l as ze,m as Be,n as Ue,o as V,p as Ge,q as g,r as De,s as ee,t as Oe,u as Le,v as j,w as te,x as ie,y as He,L as Ne,z as de,J as ue,K as Xe,N as _e}from"./three-D_1Qt16u.js";import{h as ge,o as R,c as Ve,D as $e,l as je,q as C,r as $,u as We,v as qe,w as Ye,x as se,y as fe}from"./index-
|
|
1
|
+
import{M as oe,C as L,S as ce,a as M,G,P as ae,I as ne,b as k,D as F,c as I,A as T,d as Y,e as N,B as D,F as S,f as re,g as H,W as ke,h as Pe,O as Se,i as Ae,H as Ce,E as Re,R as Fe,U as Ee,V as O,j as Ie,k as Te,l as ze,m as Be,n as Ue,o as V,p as Ge,q as g,r as De,s as ee,t as Oe,u as Le,v as j,w as te,x as ie,y as He,L as Ne,z as de,J as ue,K as Xe,N as _e}from"./three-D_1Qt16u.js";import{h as ge,o as R,c as Ve,D as $e,l as je,q as C,r as $,u as We,v as qe,w as Ye,x as se,y as fe}from"./index-CDA8pT1Q.js";const Ke=["svg",ge,[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]]];const Qe=["svg",ge,[["circle",{cx:"12",cy:"8",r:"5"}],["path",{d:"M20 21a8 8 0 0 0-16 0"}]]],ye=`
|
|
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{TimelineScene as V}from"./scene-
|
|
3
|
-
https://github.com/arvindell/sessiongraph`,be=`https://x.com/intent/tweet?text=${encodeURIComponent(I)}`,z=e=>e instanceof Error&&e.name==="AbortError";async function ve(e,l,t){const{label:s,description:i,mime:p,filename:r}=$[t];try{if(U()){const[{save:a},{writeFile:o}]=await Promise.all([G(()=>import("./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-HzUuskn3.js","assets/index-CDA8pT1Q.js","assets/index-cVgPCrFV.css","assets/index-CJb-F0VY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{TimelineScene as V}from"./scene-BkoCsbA8.js";import{i as U,_ as G,c as X,S as J,p as Y,a as Z,t as K,s as Q,b as H,d as ee,e as te,f as ae,g as oe}from"./index-CDA8pT1Q.js";import{s as re,o as se}from"./external-links-BcKDmn29.js";import"./three-D_1Qt16u.js";const ne="#b0e9d6",ie="#dbe7e3",L=128,le=10,ce="M102 24 86 40H36a14 14 0 0 0 0 28h40a14 14 0 0 1 0 28H22",de=[[102,24],[36,40],[22,96]],ue=10;let O;function he(e,l,t,s,i=ne){O??=new Path2D(ce),e.save(),e.translate(l,t),e.scale(s/L,s/L),e.strokeStyle=e.fillStyle=i,e.lineWidth=le,e.lineCap=e.lineJoin="round",e.stroke(O);for(const[p,r]of de)e.beginPath(),e.arc(p,r,ue,0,Math.PI*2),e.fill();e.restore()}const pe="Cosmic Wobbly Disco Sneaky Bouncy Galactic Crispy Dizzy Fuzzy Noodle Groovy Sleepy Spicy Jolly Loopy Squishy Turbo Giggly Velvet Soggy Zippy Fluffy Moonwalking Wiggly Fizzy Snazzy Goofy Jazzy Tiny Chunky Dapper Wacky".split(" "),ye="Wombat Pickle Pancake Badger Potato Narwhal Noodle Goblin Otter Turnip Hamster Comet Dumpling Goose Biscuit Llama Muffin Squid Raccoon Toaster Waffle Penguin Yeti Pudding Walrus Taco Jellybean Platypus Sloth Cactus Donut Mongoose".split(" ");function fe(e,l=()=>crypto.getRandomValues(new Uint32Array(1))[0]/2**32){const t=pe.flatMap(s=>ye.map(i=>`${s} ${i}`));for(let s=t.length-1;s>0;s--){const i=Math.floor(l()*(s+1));[t[s],t[i]]=[t[i],t[s]]}return Array.from({length:e},(s,i)=>{const p=Math.floor(i/t.length);return`Project ${"Mega".repeat(p)}${t[i%t.length]}`})}function me(e){const l=fe(e.lanes.length),t=new Map(e.nodes.map((r,a)=>[r.session.id,`session-${a}`])),s=new Map(e.lanes.flatMap((r,a)=>r.nodes.map(o=>[o.session.id,`project-${a}`]))),i=e.nodes.map(r=>{const a=r.session,o={id:t.get(a.id),title:"Session",projectID:s.get(a.id),directory:"",created:a.created,updated:a.created,activity:a.activity&&{firstMessageAt:a.activity.firstMessageAt,lastMessageAt:a.activity.lastMessageAt,userMessages:a.activity.userMessages,untimedUserMessages:a.activity.untimedUserMessages},archived:!1,model:"",provider:"",agent:"",cost:null,source:a.source==="continue"?"continue":a.source==="opencode"||!a.source?"opencode":"unknown",tokens:a.tokens};return a.parentID&&t.has(a.parentID)&&(o.parentID=t.get(a.parentID)),a.forkID&&t.has(a.forkID)&&(o.forkID=t.get(a.forkID)),{session:o,position:[...r.position],startPosition:[...r.startPosition],color:r.color,radius:r.radius}}),p=new Map(i.map(r=>[r.session.id,r]));return{start:e.start,end:e.end,timeFrame:e.timeFrame&&{...e.timeFrame},nodes:i,edges:e.edges.map(r=>({from:t.get(r.from),to:t.get(r.to),kind:r.kind})),lanes:e.lanes.map((r,a)=>({key:`project-${a}`,label:l[a],color:r.color,kind:"directory",y:r.y,z:r.z,nodes:r.nodes.map(o=>p.get(t.get(o.session.id)))}))}}const $={mp4:{label:"MP4",description:"MP4 video",mime:"video/mp4",filename:"sessiongraph-playback.mp4"}},I=`My coding sessions, visualized with SessionGraph.
|
|
3
|
+
https://github.com/arvindell/sessiongraph`,be=`https://x.com/intent/tweet?text=${encodeURIComponent(I)}`,z=e=>e instanceof Error&&e.name==="AbortError";async function ve(e,l,t){const{label:s,description:i,mime:p,filename:r}=$[t];try{if(U()){const[{save:a},{writeFile:o}]=await Promise.all([G(()=>import("./index-HzUuskn3.js"),__vite__mapDeps([0,1,2])),G(()=>import("./index-CJb-F0VY.js"),__vite__mapDeps([3,1,2]))]),c=await a({title:`Save SessionGraph ${s}`,defaultPath:r,filters:[{name:i,extensions:[t]}]});if(!c)return"cancelled";await o(c,new Uint8Array(await e.arrayBuffer()))}else{const a=window.showSaveFilePicker;if(a){const c=await(await a.call(window,{suggestedName:r,types:[{description:i,accept:{[p]:[`.${t}`]}}]})).createWritable();try{await c.write(e),await c.close()}catch(d){throw await c.abort().catch(()=>{}),d}}else{const o=document.createElement("a");return o.href=l,o.download=r,document.body.append(o),o.click(),o.remove(),"downloaded"}}return"saved"}catch(a){if(z(a))return"cancelled";throw a}}const S=960,T=600,we=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e);function ge(e,l,t,s,i,p){const o=T-122,c=Math.max(1,...s);e.save(),he(e,24,14,28),e.fillStyle=ie,e.font='600 14px "Geist Variable", sans-serif',e.textAlign="left",e.textBaseline="middle",e.fillText("SessionGraph",58,28),e.restore();for(let h=0;h<s.length;h++){const f=Math.max(2,s[h]/c*22);e.fillStyle=h/s.length<=t?"#91bfae":"#253d39",e.fillRect(260+h/s.length*440,o-f,440/s.length-2,f)}e.fillStyle="#d6f4e8",e.fillRect(260+440*t,o-27,1,31);const d=l.start+(l.end-l.start)*t,k=i.at(d,t===1).tokens;e.textAlign="center",e.fillStyle="#a0baae",e.font='12px "IBM Plex Mono", monospace',e.fillText(oe(d,l.end-l.start),S/2,o+23),e.fillStyle="#e7f5ee",e.font='36px "Geist Variable", sans-serif',e.fillText(p(d,t===1).toLocaleString("en"),S/2-105,o+66),e.fillText(i.recorded?we(k):"—",S/2+105,o+66),e.font='12px "Geist Variable", sans-serif',e.fillStyle="#92b0a3",e.fillText("Sessions",S/2-105,o+87),e.fillText("Burnt tokens",S/2+105,o+87),e.textAlign="left"}async function Se(e,l,t,s){t.throwIfAborted();const{label:i,mime:p}=$.mp4,r=Y(e.nodes.map(y=>y.session)),a=Z(e.nodes.map(y=>y.session)),o=K(e.nodes.map(y=>Q(y.session)),e.start,e.end),c=document.createElement("div");c.className="share-render-host",c.setAttribute("aria-hidden","true"),c.style.cssText=`position:fixed;left:-12000px;top:0;width:${S}px;height:${T}px;pointer-events:none;visibility:hidden`,document.body.append(c);const d=document.createElement("canvas");d.width=S,d.height=T;const k=d.getContext("2d",{willReadFrequently:!0});let h,f;try{if(!k)throw new Error("Canvas export is unavailable.");h=new V(c,{onSelect(){},onHover(){},onPlaybackInterrupt(){},onEvent(){},onEventHover(){}},{manual:!0}),h.applyPreferences({...l,quality:"balanced",motion:"on",labels:!0,focusDimming:!1,trails:l.trails==="selected"?"all":l.trails}),h.setGraph(e,!0),h.prepareCapture(),await document.fonts.ready,t.throwIfAborted(),f=new Worker(new URL("/assets/mp4-worker-Dc_1QUwS.js",import.meta.url),{type:"module"});const y=(m,C=[])=>new Promise((A,b)=>{t.throwIfAborted();const v=()=>{clearTimeout(D),t.removeEventListener("abort",w),f.onmessage=null,f.onerror=null},w=()=>{v(),b(t.reason)},D=setTimeout(()=>{v(),b(new Error(`${i} encoding timed out. Please try again.`))},6e4);t.addEventListener("abort",w,{once:!0}),f.onmessage=M=>{v(),M.data.error?b(new Error(M.data.error)):A(M.data)},f.onerror=()=>{v(),b(new Error(`Could not start the ${i} encoder.`))},f.postMessage(m,C)});await y({init:!0,width:S,height:T});for(let m=0;m<H;m++){t.throwIfAborted();const C=ee(m);h.captureFrame(C,1/te,k,ae(m)),ge(k,e,C,o,r,a);const A=k.getImageData(0,0,S,T).data.buffer;await y({rgba:A,width:S,height:T},[A]),s((m+1)/H)}const _=await y({finish:!0});return new Blob([_.bytes],{type:p})}finally{f?.terminate(),h?.dispose(),c.remove()}}function De(e,l){const t=document.createElement("dialog");t.className="share-dialog",t.setAttribute("aria-labelledby","share-title"),t.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>
|
|
@@ -12,7 +12,7 @@
|
|
|
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-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-CDA8pT1Q.js"></script>
|
|
16
16
|
<link rel="stylesheet" crossorigin href="/assets/index-cVgPCrFV.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|