sessiongraph-app-win32-x64 1.0.13 → 1.0.14
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 +636 -323
- package/payload/resources/web/assets/external-links-BmBkCsrt.js +1 -0
- package/payload/resources/web/assets/index-B1kyvo41.js +175 -0
- package/payload/resources/web/assets/index-BLM-0yG6.js +1 -0
- package/payload/resources/web/assets/{index-CJb-F0VY.js → index-D4P4hbvc.js} +1 -1
- package/payload/resources/web/assets/index-Du0_nVjH.css +1 -0
- package/payload/resources/web/assets/{index-HzUuskn3.js → index-Kotmn42s.js} +1 -1
- package/payload/resources/web/assets/publishing-CEvQPkO1.css +1 -0
- package/payload/resources/web/assets/publishing-D9CqkbeB.js +23 -0
- package/payload/resources/web/assets/scene-CTHyYtma.js +139 -0
- package/payload/resources/web/assets/share-Cw1E-ED9.js +7 -0
- package/payload/resources/web/index.html +2 -2
- package/payload/resources/web/sources/NOTICE.txt +4 -4
- package/payload/resources/web/assets/external-links-BcKDmn29.js +0 -1
- package/payload/resources/web/assets/index-CDA8pT1Q.js +0 -170
- package/payload/resources/web/assets/index-DYhIhreE.js +0 -1
- package/payload/resources/web/assets/index-cVgPCrFV.css +0 -1
- package/payload/resources/web/assets/publishing-CpVLG7_B.js +0 -25
- package/payload/resources/web/assets/publishing-VJhUmdPH.css +0 -1
- package/payload/resources/web/assets/scene-BkoCsbA8.js +0 -139
- package/payload/resources/web/assets/share-CS1dKayZ.js +0 -7
- package/payload/resources/web/sources/hindsight.svg +0 -1
- package/payload/resources/web/sources/lmstudio.svg +0 -1
- package/payload/resources/web/sources/reasonix.svg +0 -1
- package/payload/resources/web/sources/trae.svg +0 -1
- package/payload/resources/web/sources/warp.svg +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Kotmn42s.js","assets/index-B1kyvo41.js","assets/index-Du0_nVjH.css","assets/index-D4P4hbvc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{TimelineScene as W}from"./scene-CTHyYtma.js";import{l as z,i as G,_ as H,c as K,S as J,p as Q,a as Y,t as Z,s as ee,b as L,d as te,e as ae,f as se,g as re}from"./index-B1kyvo41.js";import{p as oe,s as ne,o as ie}from"./external-links-BmBkCsrt.js";import"./three-D_1Qt16u.js";const le="#b0e9d6",de="#dbe7e3",O=128,ce=10,ue="M102 24 86 40H36a14 14 0 0 0 0 28h40a14 14 0 0 1 0 28H22",he=[[102,24],[36,40],[22,96]],pe=10;let U;function ye(e,d,a,o,l=le){U??=new Path2D(ue),e.save(),e.translate(d,a),e.scale(o/O,o/O),e.strokeStyle=e.fillStyle=l,e.lineWidth=ce,e.lineCap=e.lineJoin="round",e.stroke(U);for(const[h,y]of he)e.beginPath(),e.arc(h,y,pe,0,Math.PI*2),e.fill();e.restore()}function fe(e){const d=oe(e.lanes.length),a=new Map;for(const s of e.nodes.map(t=>t.session).sort((t,n)=>t.created-n.created||t.id.localeCompare(n.id))){const t=z(s);a.has(t)||a.set(t,a.size)}const o=new Map(e.nodes.map((s,t)=>[s.session.id,`session-${t}`])),l=new Map(e.lanes.flatMap((s,t)=>s.nodes.map(n=>[n.session.id,`project-${t}`]))),h=e.nodes.map(s=>{const t=s.session,n={id:o.get(t.id),title:"Session",projectID:l.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&&o.has(t.parentID)&&(n.parentID=o.get(t.parentID)),t.forkID&&o.has(t.forkID)&&(n.forkID=o.get(t.forkID)),{session:n,position:[...s.position],startPosition:[...s.startPosition],color:s.color,radius:s.radius}}),y=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:o.get(s.from),to:o.get(s.to),kind:s.kind})),lanes:e.lanes.map((s,t)=>({key:`project-${t}`,label:d[a.get(s.key)],color:s.color,kind:"directory",y:s.y,z:s.z,nodes:s.nodes.map(n=>y.get(o.get(n.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://github.com/arvindell/sessiongraph`,me=`https://x.com/intent/tweet?text=${encodeURIComponent(T)}`,j=e=>e instanceof Error&&e.name==="AbortError";async function be(e,d,a){const{label:o,description:l,mime:h,filename:y}=$[a];try{if(G()){const[{save:s},{writeFile:t}]=await Promise.all([H(()=>import("./index-Kotmn42s.js"),__vite__mapDeps([0,1,2])),H(()=>import("./index-D4P4hbvc.js"),__vite__mapDeps([3,1,2]))]),n=await s({title:`Save SessionGraph ${o}`,defaultPath:y,filters:[{name:l,extensions:[a]}]});if(!n)return"cancelled";await t(n,new Uint8Array(await e.arrayBuffer()))}else{const s=window.showSaveFilePicker;if(s){const n=await(await s.call(window,{suggestedName:y,types:[{description:l,accept:{[h]:[`.${a}`]}}]})).createWritable();try{await n.write(e),await n.close()}catch(i){throw await n.abort().catch(()=>{}),i}}else{const t=document.createElement("a");return t.href=d,t.download=y,document.body.append(t),t.click(),t.remove(),"downloaded"}}return"saved"}catch(s){if(j(s))return"cancelled";throw s}}const g=960,I=600,ve=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e);function we(e,d,a,o,l,h){const t=I-122,n=Math.max(1,...o);e.save(),ye(e,24,14,28),e.fillStyle=de,e.font='600 14px "Geist Variable", sans-serif',e.textAlign="left",e.textBaseline="middle",e.fillText("SessionGraph",58,28),e.restore();for(let u=0;u<o.length;u++){const f=Math.max(2,o[u]/n*22);e.fillStyle=u/o.length<=a?"#91bfae":"#253d39",e.fillRect(260+u/o.length*440,t-f,440/o.length-2,f)}e.fillStyle="#d6f4e8",e.fillRect(260+440*a,t-27,1,31);const i=d.start+(d.end-d.start)*a,A=l.at(i,a===1).tokens;e.textAlign="center",e.fillStyle="#a0baae",e.font='12px "IBM Plex Mono", monospace',e.fillText(re(i,d.end-d.start),g/2,t+23),e.fillStyle="#e7f5ee",e.font='36px "Geist Variable", sans-serif',e.fillText(h(i,a===1).toLocaleString("en"),g/2-105,t+66),e.fillText(l.recorded?ve(A):"—",g/2+105,t+66),e.font='12px "Geist Variable", sans-serif',e.fillStyle="#92b0a3",e.fillText("Sessions",g/2-105,t+87),e.fillText("Burnt tokens",g/2+105,t+87),e.textAlign="left"}async function Se(e,d,a,o){a.throwIfAborted();const{label:l,mime:h}=$.mp4,y=Q(e.nodes.map(p=>p.session)),s=Y(e.nodes.map(p=>p.session)),t=Z(e.nodes.map(p=>ee(p.session)),e.start,e.end),n=document.createElement("div");n.className="share-render-host",n.setAttribute("aria-hidden","true"),n.style.cssText=`position:fixed;left:-12000px;top:0;width:${g}px;height:${I}px;pointer-events:none;visibility:hidden`,document.body.append(n);const i=document.createElement("canvas");i.width=g,i.height=I;const A=i.getContext("2d",{willReadFrequently:!0});let u,f;try{if(!A)throw new Error("Canvas export is unavailable.");u=new W(n,{onSelect(){},onHover(){},onPlaybackInterrupt(){},onEvent(){},onEventHover(){}},{manual:!0}),u.applyPreferences({...d,quality:"balanced",motion:"on",labels:!0,focusDimming:!1,trails:d.trails==="selected"?"all":d.trails}),u.setGraph(e,!0),u.prepareCapture(),await document.fonts.ready,a.throwIfAborted(),f=new Worker(new URL("/assets/mp4-worker-Dc_1QUwS.js",import.meta.url),{type:"module"});const p=(m,C=[])=>new Promise((k,b)=>{a.throwIfAborted();const v=()=>{clearTimeout(M),a.removeEventListener("abort",w),f.onmessage=null,f.onerror=null},w=()=>{v(),b(a.reason)},M=setTimeout(()=>{v(),b(new Error(`${l} encoding timed out. Please try again.`))},6e4);a.addEventListener("abort",w,{once:!0}),f.onmessage=E=>{v(),E.data.error?b(new Error(E.data.error)):k(E.data)},f.onerror=()=>{v(),b(new Error(`Could not start the ${l} encoder.`))},f.postMessage(m,C)});await p({init:!0,width:g,height:I});for(let m=0;m<L;m++){a.throwIfAborted();const C=te(m);u.captureFrame(C,1/ae,A,se(m)),we(A,e,C,t,y,s);const k=A.getImageData(0,0,g,I).data.buffer;await p({rgba:k,width:g,height:I},[k]),o((m+1)/L)}const P=await p({finish:!0});return new Blob([P.bytes],{type:h})}finally{f?.terminate(),u?.dispose(),n.remove()}}function Ee(e,d){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
|
+
<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
|
+
<p class="share-notice" role="status" hidden></p>
|
|
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>
|
|
7
|
+
<section id="playback-share-tray" class="share-tray" aria-label="Share options" hidden><p>Save the video to attach it in any app.</p><textarea class="share-caption" aria-label="Share caption" readonly rows="3"></textarea><div><button class="secondary-button share-copy">Copy caption</button><a class="secondary-button share-x" target="_blank" rel="noopener noreferrer">Share in X</a><button class="secondary-button share-tray-save">Save MP4</button></div></section>`,a.prepend(ne(a,"video",()=>d())),document.body.append(a);const o=a.querySelector("video"),l=a.querySelector("progress"),h=a.querySelector('[role="status"]'),y=a.querySelector(".share-progress"),s=a.querySelector(".share-close"),t=a.querySelector(".share-save"),n=a.querySelector(".share-retry"),i=a.querySelector(".share-system"),A=a.querySelector(".share-actions .share-x"),u=a.querySelector(".share-tray"),f=a.querySelector(".share-notice"),p=a.querySelector(".share-tray-save"),P=a.querySelector(".share-copy"),m=a.querySelector(".share-caption");m.value=T;const C=K(J);C.setAttribute("aria-hidden","true"),C.setAttribute("stroke-width","1.5"),i.prepend(C);let k,b,v,w,M,E,q=Promise.resolve();const S=r=>{f.textContent=r,f.hidden=!r},R=r=>{u.hidden=!r,i.setAttribute("aria-expanded",String(r)),r&&P.focus()},x=()=>{k?.abort(),k=void 0,o.pause(),o.removeAttribute("src"),o.load(),w&&URL.revokeObjectURL(w),w=void 0,b=void 0,v=void 0,R(!1),S(""),a.setAttribute("aria-busy","false")};for(const r of a.querySelectorAll(".share-x"))r.href=me,r.title="Open an X draft, then attach your saved animation",r.onclick=c=>{S("Attach your saved MP4 in X to include the video."),G()&&(c.preventDefault(),ie(r.href).catch(()=>S("Could not open your browser. Copy the caption and attach your saved video manually.")))};s.onclick=()=>a.close(),a.addEventListener("cancel",r=>{u.hidden||(r.preventDefault(),R(!1),i.focus())}),a.addEventListener("close",()=>{a.open||(x(),M=void 0,E=void 0,e())});function N(){x();const r=new AbortController;k=r;const{label:c,mime:D,filename:X}=$.mp4;t.textContent=p.textContent=`Save ${c}`,o.hidden=!0,y.hidden=!1,t.hidden=!0,i.hidden=!0,A.hidden=!0,n.hidden=!0,s.textContent="Cancel",l.hidden=!1,l.value=0,l.setAttribute("aria-label",`Creating ${c}`),h.textContent=`Creating ${c}… 0%`,a.setAttribute("aria-busy","true"),q=q.then(async()=>{if(!r.signal.aborted)try{const _=await Se(M,E,r.signal,V=>{if(r.signal.aborted)return;const F=Math.round(V*100);l.value=F,h.textContent=`Creating ${c}… ${F}%`});if(r.signal.aborted)return;b=_,v=new File([_],X,{type:D}),w=URL.createObjectURL(_),o.src=w,o.hidden=!1,o.play().catch(()=>{}),y.hidden=!0,t.hidden=!1,i.hidden=!1,A.hidden=!1,s.textContent="Done"}catch(_){if(r.signal.aborted)return;l.hidden=!0,h.textContent=_ instanceof Error?_.message:`Could not create the ${c}.`,n.hidden=!1,s.textContent="Close"}finally{k===r&&a.setAttribute("aria-busy","false")}})}n.onclick=N;const B=async()=>{if(!b||!w||t.disabled)return;const r=b,{label:c}=$.mp4;t.disabled=!0,p.disabled=!0,S(`Choose where to save your ${c}…`);try{const D=await be(r,w,"mp4");b===r&&S(D==="saved"?`${c} saved.`:D==="downloaded"?`${c} download started. Check your downloads.`:`Save cancelled. Your ${c} is still ready.`)}catch{b===r&&S(`Could not save the ${c}. Try choosing another location.`)}finally{t.disabled=!1,p.disabled=!1}};return t.onclick=B,p.onclick=B,i.onclick=async()=>{if(!v||i.disabled)return;const r=v,c={files:[r],title:"SessionGraph",text:T};if(!navigator.share||!navigator.canShare?.({files:[r]})){R(u.hidden);return}i.disabled=!0,S("");try{await navigator.share(c)}catch(D){v===r&&!j(D)&&(R(!0),S("Could not open system sharing. Save the animation or choose an option below."))}finally{i.disabled=!1}},P.onclick=async()=>{try{await navigator.clipboard.writeText(T),S("Caption copied. Attach your saved animation with it.")}catch{m.focus(),m.select(),S("Copy the selected caption, then attach your saved animation.")}},{open(r,c){a.open||(M=fe(r),E={...c},a.showModal(),e(),N())},dispose(){x(),M=void 0,E=void 0,a.close(),a.remove()}}}export{Ee as createPlaybackShare};
|
|
@@ -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-B1kyvo41.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Du0_nVjH.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="app"></div>
|
|
@@ -25,17 +25,17 @@ https://github.com/lobehub/lobe-icons/tree/ea434b96e75813517b377825e01c0df61dee8
|
|
|
25
25
|
Files: amp.svg, kimi.svg, grok.svg, cherrystudio.svg, commandcode.svg,
|
|
26
26
|
codebuddy.svg (also used for WorkBuddy), deepseek.svg, mistral.svg, muse.svg,
|
|
27
27
|
minimax.svg, goose.svg, devin.svg, unsloth.svg, kiro.svg, antigravity.svg,
|
|
28
|
-
|
|
28
|
+
openclaw.svg, hermesagent.svg, junie.svg.
|
|
29
29
|
The source assets were adapted for monochrome CSS masks and renamed where needed.
|
|
30
30
|
See LICENSE-MIT.txt.
|
|
31
31
|
|
|
32
|
-
Zed Industries
|
|
32
|
+
Zed Industries and Xiaomi paths from Simple Icons (CC0-1.0):
|
|
33
33
|
https://github.com/simple-icons/simple-icons/tree/b45ca1f11d9d013a7c462944d90a049bc613ad4f/icons
|
|
34
|
-
Files: zedindustries.svg,
|
|
34
|
+
Files: zedindustries.svg, xiaomi.svg. The Xiaomi mark identifies
|
|
35
35
|
the MiMo sources at small sizes. Adapted for monochrome CSS masks.
|
|
36
36
|
|
|
37
37
|
Source-specific initial marks for Aside, Augment, Codebuff, Crush, Freebuff,
|
|
38
|
-
Fx, Gajae-Code,
|
|
38
|
+
Fx, Gajae-Code, Jcode, Kimchi, Mux, Prime Agent, Proma,
|
|
39
39
|
Senpi, and ZCode use glyph outlines from Geist Bold, Copyright 2024 The Geist
|
|
40
40
|
Project Authors, SIL Open Font License 1.1. These are identification initials,
|
|
41
41
|
not the products' official marks. See LICENSE-OFL-1.1.txt.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as u}from"./index-CDA8pT1Q.js";function p(t,e,c){t.open&&(t.addEventListener("close",()=>c(e),{once:!0}),t.close())}function b(t,e,c){const l=document.createDocumentFragment(),i=document.createElement("header");i.className="sharing-header";const s=document.createElement("h2");s.id=`sharing-${e}-title`,s.textContent="Share SessionGraph",t.setAttribute("aria-labelledby",s.id);const n=document.createElement("button");n.type="button",n.className="text-button",n.textContent="Close",n.setAttribute("aria-label","Close sharing"),n.onclick=()=>t.close(),i.append(s,n);const r=document.createElement("div");r.className="sharing-modes",r.setAttribute("role","group"),r.setAttribute("aria-label","Share method");for(const a of["publish","video"]){const o=document.createElement("button");o.type="button",o.dataset.shareMode=a,o.textContent=a==="publish"?"Publish":"Video",o.setAttribute("aria-pressed",String(a===e)),o.onclick=()=>{a!==e&&p(t,a,c)},r.append(o)}return l.append(i,r),l}async function d(t,e){await u("plugin:opener|open_url",{url:t,with:e})}function h(t){const e=new URL(t);if(!["https:","http:"].includes(e.protocol)||e.username||e.password)throw new Error("Choose a valid web link.");return e.href}async function f(t,e=d){await e(h(t))}export{h as e,f as o,b as s};
|