dsh-thoughtdag 0.4.20 → 0.5.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.
Files changed (26) hide show
  1. package/dist-app/assets/{canonical-mCpjqoou.js → canonical-BlzQbV3x.js} +2 -2
  2. package/dist-app/assets/canvas-record-CHx9KBrZ.js +1 -0
  3. package/dist-app/assets/{claude-code-session-DJkcGfvB.js → claude-code-session-BfwTY3ne.js} +4 -4
  4. package/dist-app/assets/{codex-session-Crw7-bHo.js → codex-session-BNnk6Ozy.js} +4 -4
  5. package/dist-app/assets/{dsh-session-DbEtbF5u.js → dsh-session-BXjdZH-4.js} +4 -4
  6. package/dist-app/assets/{experiment-loop-CkNvS6b1.js → experiment-loop-CBfcRt8t.js} +1 -1
  7. package/dist-app/assets/{http-bridge-CJvoQLgy.js → http-bridge-CK02uyVL.js} +1 -1
  8. package/dist-app/assets/index-93ujsGjx.css +1 -0
  9. package/dist-app/assets/index-F8ykUu-e.js +883 -0
  10. package/dist-app/assets/{index-CT3R4H-W.js → index-U1FDd3d6.js} +1 -1
  11. package/dist-app/assets/{index-ZITmlOUw.js → index-Vln2-D4p.js} +3 -3
  12. package/dist-app/assets/{index-B6lBI8ja.js → index-no3SFEm4.js} +1 -1
  13. package/dist-app/assets/{pi-session-CBjuXvCc.js → pi-session-DfX1QntM.js} +8 -8
  14. package/dist-app/assets/{sensitive-scan-CjmPZxkv.js → sensitive-scan-NeBfDua2.js} +1 -1
  15. package/dist-app/assets/{session-handoff-DGfX02CE.js → session-handoff-Bi6J6owx.js} +2 -2
  16. package/dist-app/assets/{shared-z6Es4wHy.js → shared-B_zE0vyL.js} +4 -4
  17. package/dist-app/assets/{turndown-plugin-gfm.cjs-KFp3duAG.js → turndown-plugin-gfm.cjs-t7mTv0d4.js} +3 -3
  18. package/dist-app/assets/{update-check-D5kNTq-_.js → update-check-CmPLQTC0.js} +1 -1
  19. package/dist-app/index.html +2 -2
  20. package/lib/index.js +50 -1
  21. package/lib/why.mjs +567 -16
  22. package/package.json +1 -1
  23. package/dist-app/assets/canvas-record-di62TikJ.js +0 -1
  24. package/dist-app/assets/index-B-DuMDps.css +0 -1
  25. package/dist-app/assets/index-BMFFskkL.js +0 -789
  26. package/dist-app/assets/live-mirror-D-eP76Rm.js +0 -2
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BMFFskkL.js","assets/index-B-DuMDps.css","assets/experiment-loop-CkNvS6b1.js","assets/index-ZITmlOUw.js","assets/canonical-mCpjqoou.js"])))=>i.map(i=>d[i]);
2
- import{_ as l,i as b,t as p,a as h,f as A}from"./index-BMFFskkL.js";function K(d,S){return d.find(y=>(y.rel.split("/").pop()??y.rel).includes(S))}let j=!1,O=null;function H(){O?.()}function z(){const d=window.desktopSessions;if(!d||j)return;j=!0,d.watchStart();let S=!1,y=null;const g=async s=>{if(S){y=s;return}S=!0;try{window.dispatchEvent(new CustomEvent("td:sessions-changed"));const{useProjects:a,subscribedSessionIds:i}=await l(async()=>{const{useProjects:w,subscribedSessionIds:E}=await import("./index-BMFFskkL.js").then(D=>D.H);return{useProjects:w,subscribedSessionIds:E}},__vite__mapDeps([0,1])),{activeId:c,projects:o}=a.getState(),f=o.find(w=>w.id===c),t=await d.head(s.rootKey,s.rel,262144).catch(()=>"");if(!t)return;const e=b(t);if(!e)return;const m=!!f&&i(f).includes(e);let r=null;if(!m){if(o.some(v=>i(v).includes(e)))return;const{useStore:E}=await l(async()=>{const{useStore:v}=await import("./index-BMFFskkL.js").then(R=>R.G);return{useStore:v}},__vite__mapDeps([0,1]));if(!E.getState().nodes.some(v=>v.data.importSource?.sessionId===e)){const{parseAnchor:v}=await l(async()=>{const{parseAnchor:k}=await import("./experiment-loop-CkNvS6b1.js");return{parseAnchor:k}},__vite__mapDeps([2,0,1])),R=v(t);if(!R||!o.some(k=>k.id===R.project))return;if(r=R.project,r!==c){p("info",h("atlas.mountPending"),9e3);return}}}const{streamRunnerConversation:n}=await l(async()=>{const{streamRunnerConversation:w}=await import("./index-ZITmlOUw.js");return{streamRunnerConversation:w}},__vite__mapDeps([3,0,1])),{importOrAppendConversation:u,shellSessionReader:_}=await l(async()=>{const{importOrAppendConversation:w,shellSessionReader:E}=await import("./canonical-mCpjqoou.js");return{importOrAppendConversation:w,shellSessionReader:E}},__vite__mapDeps([4,0,1])),V=await n(_(s.rootKey,s.rel)).catch(()=>null),P=await u(V,{focusOnRefresh:!1});P?.kind==="appended"?p("success",A(h("atlas.liveAppended"),{n:P.turns}),8e3):P?.kind==="mounted"&&p("success",A(h(P.mode==="continue"?"atlas.mountedChapter":"atlas.mountedBranch"),{n:P.turns}),9e3)}finally{if(S=!1,y){const a=y;y=null,g(a)}}};d.onSessionsChanged(s=>{g(s)});const C=async s=>{if(!s)return;const{useStore:a}=await l(async()=>{const{useStore:o}=await import("./index-BMFFskkL.js").then(f=>f.G);return{useStore:o}},__vite__mapDeps([0,1])),{useUiStore:i}=await l(async()=>{const{useUiStore:o}=await import("./index-BMFFskkL.js").then(f=>f.D);return{useUiStore:o}},__vite__mapDeps([0,1])),c=a.getState().nodes.find(o=>o.data.importSource?.itemIds?.includes(s));c&&i.getState().setArrivalFocusNodeId(c.id)},T=async(s,a)=>{const{useProjects:i,switchProject:c}=await l(async()=>{const{useProjects:e,switchProject:m}=await import("./index-BMFFskkL.js").then(r=>r.H);return{useProjects:e,switchProject:m}},__vite__mapDeps([0,1])),o=i.getState().projects,f=o.filter(e=>e.name===s),t=o.find(e=>e.id===s)??(f.length===1?f[0]:void 0);if(!t){p("error",h("handoff.deeplinkMiss"));return}if(await c(t.id),a){const{useStore:e}=await l(async()=>{const{useStore:r}=await import("./index-BMFFskkL.js").then(n=>n.G);return{useStore:r}},__vite__mapDeps([0,1])),{useUiStore:m}=await l(async()=>{const{useUiStore:r}=await import("./index-BMFFskkL.js").then(n=>n.D);return{useUiStore:r}},__vite__mapDeps([0,1]));e.getState().nodes.some(r=>r.id===a)&&m.getState().setArrivalFocusNodeId(a)}},I=async s=>{let a="",i="";try{const n=new URL(s),u=n.searchParams.get("canvas");if(u){await T(u,n.searchParams.get("node")??"");return}a=n.searchParams.get("session")??"",i=n.searchParams.get("turn")??""}catch{return}if(!/^[A-Za-z0-9_-]{8,}$/.test(a))return;/^[A-Za-z0-9_-]*$/.test(i)||(i="");const c=await d.roots().catch(()=>[]);let o=null;for(const n of c){const u=await d.list(n.key).catch(()=>[]),_=K(u,a);if(_){o={rootKey:n.key,rel:_.rel};break}}if(!o){const n=[];for(const u of c)for(const _ of await d.list(u.key).catch(()=>[]))n.push({rootKey:u.key,rel:_.rel,mtime:_.mtime});n.sort((u,_)=>_.mtime-u.mtime);for(const u of n.slice(0,40)){const _=await d.head(u.rootKey,u.rel,262144).catch(()=>"");if(_&&b(_)===a){o=u;break}}}if(!o){p("error",h("handoff.deeplinkMiss"));return}const{streamRunnerConversation:f}=await l(async()=>{const{streamRunnerConversation:n}=await import("./index-ZITmlOUw.js");return{streamRunnerConversation:n}},__vite__mapDeps([3,0,1])),{importOrAppendConversation:t,shellSessionReader:e}=await l(async()=>{const{importOrAppendConversation:n,shellSessionReader:u}=await import("./canonical-mCpjqoou.js");return{importOrAppendConversation:n,shellSessionReader:u}},__vite__mapDeps([4,0,1])),m=await f(e(o.rootKey,o.rel)).catch(()=>null),r=await t(m);r?r.kind==="appended"?p("success",A(h("atlas.liveAppended"),{n:r.turns}),8e3):r.kind==="mounted"?p("success",A(h(r.mode==="continue"?"atlas.mountedChapter":"atlas.mountedBranch"),{n:r.turns}),9e3):r.kind==="imported"&&p("success",A(h("toast.importedChats"),{n:1,m:r.nodeCount}),8e3):p("error",h("handoff.notASession")),r&&i&&await C(i)};d.onDeepLink?.(s=>{I(s)}),(async()=>{const{bootProjects:s}=await l(async()=>{const{bootProjects:i}=await import("./index-BMFFskkL.js").then(c=>c.H);return{bootProjects:i}},__vite__mapDeps([0,1]));await s();const a=await d.pendingDeepLink?.().catch(()=>null);a&&I(a)})();const L="thoughtdag.atlas.sweepmark";O=async()=>{const{bootProjects:s}=await l(async()=>{const{bootProjects:t}=await import("./index-BMFFskkL.js").then(e=>e.H);return{bootProjects:t}},__vite__mapDeps([0,1]));await s();const a=await d.roots().catch(()=>[]),i=[];for(const t of a){const e=await d.list(t.key).catch(()=>[]);for(const m of e)i.push({rootKey:t.key,rel:m.rel,mtime:m.mtime,size:m.size})}let c={};try{c=JSON.parse(localStorage.getItem(L)??"{}")}catch{}const o=Object.keys(c).length===0;i.sort((t,e)=>e.mtime-t.mtime);const f=i.filter((t,e)=>{const m=`${t.mtime}|${t.size}`;return c[`${t.rootKey}|${t.rel}`]===m?!1:o?e<30:!0});for(const t of f)await g({rootKey:t.rootKey,rel:t.rel});for(const t of i)c[`${t.rootKey}|${t.rel}`]=`${t.mtime}|${t.size}`;localStorage.setItem(L,JSON.stringify(c))},O()}export{K as pickSessionFile,z as startLiveMirror,H as sweepRecentSessions};