isorite 0.3.1 → 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 (62) hide show
  1. package/README.md +2 -2
  2. package/dist/core.js +4 -2
  3. package/dist/main.js +3939 -3970
  4. package/docs/setup-for-agents.md +2 -1
  5. package/docs/setup.md +5 -1
  6. package/docs/terminal.md +9 -1
  7. package/package.json +1 -1
  8. package/plugin/tui.tsx +3 -77
  9. package/web/_app/immutable/assets/{0.IOi79DXH.css → 0.DNvf5eFW.css} +1 -1
  10. package/web/_app/immutable/chunks/-7PsQOY4.js +3 -0
  11. package/web/_app/immutable/chunks/B9vLu37F.js +1 -0
  12. package/web/_app/immutable/chunks/BAVeNK5c.js +20 -0
  13. package/web/_app/immutable/chunks/C1xA2mdF.js +1 -0
  14. package/web/_app/immutable/chunks/CQqNkDRK.js +1 -0
  15. package/web/_app/immutable/chunks/Cs9sQ8Oa.js +1 -0
  16. package/web/_app/immutable/chunks/{BHPhFydX.js → D4Jg9Smi.js} +1 -1
  17. package/web/_app/immutable/chunks/{8IM6BNk6.js → DG2llOXe.js} +21 -21
  18. package/web/_app/immutable/chunks/DqVFJWdL.js +1 -0
  19. package/web/_app/immutable/chunks/HCrXwzvD.js +1 -0
  20. package/web/_app/immutable/chunks/MjV3DsQW.js +1 -0
  21. package/web/_app/immutable/chunks/uID4v_1K.js +1 -0
  22. package/web/_app/immutable/entry/app.CR9ubCCo.js +2 -0
  23. package/web/_app/immutable/entry/start.D4DOZCP6.js +1 -0
  24. package/web/_app/immutable/nodes/0.BYXv43VP.js +26 -0
  25. package/web/_app/immutable/nodes/1.DGP71l35.js +1 -0
  26. package/web/_app/immutable/nodes/2.CxspTYRG.js +1 -0
  27. package/web/_app/immutable/nodes/3.ZTzs6oEI.js +1 -0
  28. package/web/_app/immutable/nodes/4.CeIGu2c2.js +2 -0
  29. package/web/_app/immutable/nodes/5.k1DmYkGm.js +5 -0
  30. package/web/_app/immutable/nodes/6.Q0yGno8p.js +1 -0
  31. package/web/_app/immutable/nodes/7.BJRu312o.js +1 -0
  32. package/web/_app/version.json +1 -1
  33. package/web/index.html +17 -20
  34. package/dist/tutorial/barnes_hut.py +0 -46
  35. package/dist/tutorial/sim.py +0 -29
  36. package/plugin/tour.ts +0 -74
  37. package/web/_app/immutable/assets/8.CFA9_nYZ.css +0 -1
  38. package/web/_app/immutable/assets/Tutorial.DOfsM49T.css +0 -1
  39. package/web/_app/immutable/chunks/B_AYGp9o.js +0 -1
  40. package/web/_app/immutable/chunks/Bze-M_kr.js +0 -3
  41. package/web/_app/immutable/chunks/CFA70_0c.js +0 -20
  42. package/web/_app/immutable/chunks/CGgq5NWd.js +0 -1
  43. package/web/_app/immutable/chunks/CHlFgDNB.js +0 -1
  44. package/web/_app/immutable/chunks/CMp5T_-1.js +0 -1
  45. package/web/_app/immutable/chunks/CRzLMJPS.js +0 -1
  46. package/web/_app/immutable/chunks/D89YN-Dr.js +0 -1
  47. package/web/_app/immutable/chunks/DF3lgcLW.js +0 -1
  48. package/web/_app/immutable/chunks/DGVcYHaJ.js +0 -43
  49. package/web/_app/immutable/chunks/DHMLhlug.js +0 -1
  50. package/web/_app/immutable/chunks/DmgpLvxp.js +0 -1
  51. package/web/_app/immutable/chunks/DrsVvzvg.js +0 -1
  52. package/web/_app/immutable/entry/app.hlk6OrE8.js +0 -2
  53. package/web/_app/immutable/entry/start.BE1F0HZV.js +0 -1
  54. package/web/_app/immutable/nodes/0.DMGdYhkH.js +0 -15
  55. package/web/_app/immutable/nodes/1.Dn_0fgt7.js +0 -1
  56. package/web/_app/immutable/nodes/2.Y1Dd5PBI.js +0 -1
  57. package/web/_app/immutable/nodes/3.BlxuRbLf.js +0 -1
  58. package/web/_app/immutable/nodes/4.Bt_H0MbN.js +0 -2
  59. package/web/_app/immutable/nodes/5.BJ-EVWbz.js +0 -5
  60. package/web/_app/immutable/nodes/6.DDIiJnwi.js +0 -1
  61. package/web/_app/immutable/nodes/7.DmPPLDvb.js +0 -1
  62. package/web/_app/immutable/nodes/8.CwMTBog4.js +0 -486
@@ -0,0 +1 @@
1
+ import{J as e,P as t,X as n,Y as r}from"./-7PsQOY4.js";import{o as i,t as a}from"./HCrXwzvD.js";import{r as o}from"./MjV3DsQW.js";var s=(e,t)=>{try{return localStorage.getItem(e)??t}catch{return t}},c=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},l=(e,t)=>{try{return{...t,...JSON.parse(s(e,`{}`))}}catch{return t}},u=[`note`,`atlas`,`iso`],d=[`cols`,`stack`,`one`],f={note:[`provenance`,`timeline`],atlas:[`questions`,`problems`,`web`,`code`,`context`],iso:[`notes`,`files`,`run`]},p={provenance:!1,timeline:!1,questions:!0,problems:!0,web:!1,code:!1,context:!1,notes:!1,files:!1,run:!1},m={note:1.25,atlas:1,iso:1.05},h={min:.4,max:3},g=new class{#e=n(e(d.includes(s(`isorite.layout`,``))?s(`isorite.layout`,``):`cols`));get layout(){return t(this.#e)}set layout(e){r(this.#e,e,!0)}#t=n(e(l(`isorite.show`,{note:!0,atlas:!0,iso:!0})));get show(){return t(this.#t)}set show(e){r(this.#t,e,!0)}#n=n(e(l(`isorite.widths`,m)));get widths(){return t(this.#n)}set widths(e){r(this.#n,e,!0)}#r=n(e(l(`isorite.switches`,p)));get on(){return t(this.#r)}set on(e){r(this.#r,e,!0)}#i=n(s(`isorite.understanding`,``)===`1`);get understanding(){return t(this.#i)}set understanding(e){r(this.#i,e,!0)}#a=n(`note`);get focus(){return t(this.#a)}set focus(e){r(this.#a,e,!0)}#o=n(!1);get narrow(){return t(this.#o)}set narrow(e){r(this.#o,e,!0)}#s=n(0);get unseen(){return t(this.#s)}set unseen(e){r(this.#s,e,!0)}#c=n(!1);get tree(){return t(this.#c)}set tree(e){r(this.#c,e,!0)}#l=n(``);get fresh(){return t(this.#l)}set fresh(e){r(this.#l,e,!0)}#u=n(null);get settings(){return t(this.#u)}set settings(e){r(this.#u,e,!0)}#d=n(e(s(`isorite.last`,``)));get last(){return t(this.#d)}set last(e){r(this.#d,e,!0)}get standing(){if(this.narrow)return[...u];let e=u.filter(e=>this.show[e]);return this.layout===`one`?[e.includes(this.focus)?this.focus:e[0]??`note`]:e}setLayout(e){this.layout=e,c(`isorite.layout`,e)}nextLayout(){this.setLayout(d[(d.indexOf(this.layout)+1)%d.length])}toggle(e){this.show[e]&&u.filter(e=>this.show[e]).length===1||(this.show[e]=!this.show[e],c(`isorite.show`,JSON.stringify(this.show)),!this.show[e]&&this.focus===e&&(this.focus=u.find(e=>this.show[e])))}setWidth(e,t){this.widths[e]=Math.min(h.max,Math.max(h.min,t)),c(`isorite.widths`,JSON.stringify(this.widths))}to(e){!this.narrow&&!this.show[e]&&this.toggle(e),this.focus=e,e===`iso`&&(this.unseen=0),this.scroll?.(e)}scroll=null;step(e){let t=this.narrow?[...u]:u.filter(e=>this.show[e]),n=t.indexOf(this.focus);this.to(t[(n+e+t.length)%t.length])}flip(e,t=!this.on[e]){this.on[e]=t,c(`isorite.switches`,JSON.stringify(this.on)),(e===`notes`||e===`files`||e===`run`)&&this.onMode?.()}showUnderstanding(e=!this.understanding){this.understanding=e,c(`isorite.understanding`,e?`1`:``),this.onMode?.()}busy(e){let t=typeof document>`u`?null:document.activeElement;return!!t&&!!t.closest(`[data-pane="${e}"]`)&&(t.matches(`input, textarea, [contenteditable=true]`)||!!t.closest(`.cm-editor`))}#f=n(!1);get terminal(){return t(this.#f)}set terminal(e){r(this.#f,e,!0)}setTerminal(e){this.terminal=e}get mode(){return this.terminal&&(this.on.files||this.on.run)?`build`:this.on.notes?`write`:`ask`}onMode=null;setLast(e){e&&!e.startsWith(`@`)&&(this.last=e,c(`isorite.last`,e))}async open(e,t=this.narrow){await a(o(e)),t&&this.to(`note`)}async home(){await a(i(`/notes`))}};export{g as i,u as n,f as r,d as t};
@@ -0,0 +1 @@
1
+ import{E as e,K as t,M as n,N as r,O as i,P as a,Q as o,S as s,W as c,X as l,Y as u,c as d,i as f,j as p,l as m,nt as h,p as g,q as _,rt as v,st as y,u as b,w as x,y as S,z as C}from"./-7PsQOY4.js";import"./xihTtKlq.js";import{t as w}from"./MjV3DsQW.js";var T=i(`<li role="option"><button type="button" tabindex="-1" class="svelte-35e6rs"><span class="dir svelte-35e6rs"> </span><span class="detail svelte-35e6rs"> </span></button></li>`),E=i(`<ul class="suggest svelte-35e6rs" role="listbox" aria-label="folders"></ul>`),D=i(`<span class="field-wrap svelte-35e6rs"><input autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list"/> <!></span>`);function O(i,p){v(p,!0);let O=f(p,`value`,15,``),k=f(p,`placeholder`,3,``),A=f(p,`id`,3,`folder`),j=f(p,`quiet`,3,!1),M=l(!1),N=l(0),P=o(()=>O().trim().replace(/^\/+|\/+$/g,``).toLowerCase()),F=e=>w.listing.notes.filter(t=>t.dir===e).length,I=o(()=>{let e=w.listing.dirs.filter(e=>e.toLowerCase().includes(a(P))),t=e=>e.split(`/`).at(-1).toLowerCase().startsWith(a(P))?0:e.toLowerCase().startsWith(a(P))?1:2,n=e.sort((e,n)=>t(e)-t(n)||e.localeCompare(n)).map(e=>({dir:e,made:!1}));return a(P)&&!w.listing.dirs.some(e=>e.toLowerCase()===a(P))&&n.push({dir:O().trim().replace(/^\/+|\/+$/g,``),made:!0}),n.slice(0,8)});function L(e){O(e),u(M,!1),p.onpick?.(e)}function R(e){if(a(M)&&a(I).length){if(e.key===`ArrowDown`){u(N,(a(N)+1)%a(I).length),e.preventDefault();return}if(e.key===`ArrowUp`){u(N,(a(N)-1+a(I).length)%a(I).length),e.preventDefault();return}if((e.key===`Enter`||e.key===`Tab`)&&a(I)[a(N)]&&(e.key===`Enter`||a(P))){e.key===`Enter`&&e.preventDefault(),L(a(I)[a(N)].dir);return}if(e.key===`Escape`){u(M,!1),e.stopPropagation();return}}p.onkeydown?.(e)}var z=D(),B=c(z);m(B);let V;var H=_(B,2),U=i=>{var o=E();S(o,23,()=>a(I),e=>e.dir+e.made,(i,o,s)=>{var l=T();let d;var f=c(l),p=c(f),m=t(p,!0),h=_(p),v=t(h,!0);y(f),y(l),C(e=>{b(l,`id`,`${A()??``}-opt-${a(s)??``}`),b(l,`aria-selected`,a(s)===a(N)),d=g(l,1,`svelte-35e6rs`,null,d,{at:a(s)===a(N)}),x(m,a(o).dir),x(v,e)},[()=>a(o).made?`new folder`:`${F(a(o).dir)} ${F(a(o).dir)===1?`note`:`notes`}`]),n(`mousedown`,f,e=>e.preventDefault()),n(`click`,f,()=>L(a(o).dir)),r(`mouseenter`,f,()=>u(N,a(s),!0)),e(i,l)}),y(o),C(()=>b(o,`id`,`${A()??``}-list`)),e(i,o)};s(H,e=>{a(M)&&a(I).length&&e(U)}),y(z),C(()=>{b(B,`id`,A()),V=g(B,1,`mono svelte-35e6rs`,null,V,{field:!j(),quiet:j()}),b(B,`placeholder`,k()),b(B,`aria-label`,p.label),b(B,`aria-expanded`,a(M)&&a(I).length>0),b(B,`aria-controls`,`${A()??``}-list`),b(B,`aria-activedescendant`,a(M)&&a(I)[a(N)]?`${A()}-opt-${a(N)}`:void 0)}),r(`focus`,B,()=>{u(M,!0),u(N,0)}),n(`input`,B,()=>{u(M,!0),u(N,0)}),r(`blur`,B,()=>setTimeout(()=>u(M,!1),120)),n(`keydown`,B,R),d(B,O),e(i,z),h()}p([`input`,`keydown`,`mousedown`,`click`]);export{O as t};
@@ -0,0 +1 @@
1
+ import{$ as e,B as t,E as n,K as r,M as i,N as a,O as o,P as s,Q as c,S as l,W as u,X as d,Y as f,c as p,j as m,l as h,nt as g,q as _,rt as v,st as y,u as b,ut as x,w as S,y as C,z as w}from"./-7PsQOY4.js";import{t as T}from"./HCrXwzvD.js";import"./xihTtKlq.js";import{i as E,r as D,t as O}from"./MjV3DsQW.js";import{t as k}from"./CQqNkDRK.js";var A=o(`<p class="problem svelte-btgyzc" role="alert"> </p>`),j=o(`<form class="frame new svelte-btgyzc"><span class="frame-title">a new note</span> <label class="svelte-btgyzc"><span class="label">title</span> <input class="field" placeholder="Entropy" autocomplete="off"/></label> <label for="new-folder" class="svelte-btgyzc"><span class="label">folder</span></label> <!> <p class="faint path svelte-btgyzc"> </p> <!> <div class="row svelte-btgyzc"><button class="btn primary" type="submit">make it</button><button class="btn quiet" type="button">cancel</button></div></form>`),M=o(`<p class="soft empty svelte-btgyzc">This base has no notes yet. Make the first one.</p>`),N=o(`<span class="soft desc svelte-btgyzc"> </span>`),ee=o(`<li class="svelte-btgyzc"><a class="svelte-btgyzc"><span class="serif title svelte-btgyzc"> </span><!></a></li>`),te=o(`<section><h2 class="svelte-btgyzc"><span class="label"> </span><button class="btn quiet add svelte-btgyzc" type="button">+</button></h2> <ul class="svelte-btgyzc"></ul></section>`),ne=o(`<li class="svelte-btgyzc"><a class="svelte-btgyzc"><span class="serif title svelte-btgyzc"> </span><span class="soft desc svelte-btgyzc"> </span></a></li>`),re=o(`<section><h2 class="svelte-btgyzc"><span class="label">in the text</span></h2> <ul class="svelte-btgyzc"></ul></section>`),ie=o(`<p class="soft empty svelte-btgyzc">No note matches.</p>`),ae=o(`<div class="notes svelte-btgyzc"><div class="top svelte-btgyzc"><label class="hidden-label" for="filter">Find a note</label> <input id="filter" class="field grow" type="search" placeholder="find a note" autocomplete="off"/> <button class="btn primary" type="button" data-tour="new-note">new note</button></div> <!> <!> <!> <!> <!></div>`);function P(o,m){v(m,!0);let P=d(``),F=d([]),I=d(!1),L=d(``),R=d(``),z=d(``),B=c(()=>s(P).trim().toLowerCase().split(/\s+/).filter(Boolean)),V=e=>s(B).every(t=>`${e.title}\n${e.id}\n${e.description}`.toLowerCase().includes(t)),H=c(()=>s(B).length?O.listing.notes.filter(V):O.listing.notes),U=c(()=>{let e=new Map;if(!s(B).length)for(let t of O.listing.dirs)e.set(t,[]);for(let t of s(H))e.set(t.dir,[...e.get(t.dir)??[],t]);return[...e].sort(([e],[t])=>e<t?-1:+(e>t))}),W=c(()=>s(B).length?s(F).filter(e=>!s(H).some(t=>t.id===e.id)):[]);t(()=>{let e=s(P).trim();if(e.length<2){f(F,[]);return}let t=setTimeout(()=>{O.api.search(e).then(t=>{s(P).trim()===e&&f(F,t)},()=>void 0)},200);return()=>clearTimeout(t)});let G=c(()=>[s(R).trim().replace(/^\/+|\/+$/g,``),E(s(L))].filter(Boolean).join(`/`));function K(e=``){f(I,!0),f(R,e,!0),f(L,``),f(z,``)}async function oe(e){if(e.preventDefault(),!E(s(L)))f(z,`Give the note a title.`);else try{await O.api.createNote(s(G),`---\ntype: Concept\ntitle: ${JSON.stringify(s(L).trim())}\n---\n\n`),await O.refresh(),await T(D(s(G)))}catch(e){f(z,e.message,!0)}}var q=ae(),J=u(q),Y=_(u(J),2);h(Y),e(Y,!0);var se=_(Y,2);y(J);var X=_(J,2),ce=t=>{var o=j(),c=_(u(o),2),d=_(u(c),2);h(d),e(d,!0),y(c);var m=_(c,4);k(m,{id:`new-folder`,label:`folder`,placeholder:`none: the top of the base`,get value(){return s(R)},set value(e){f(R,e,!0)}});var g=_(m,2),v=r(g,!0),b=_(g,2),x=e=>{var t=A(),i=r(t,!0);w(()=>S(i,s(z))),n(e,t)};l(b,e=>{s(z)&&e(x)});var C=_(b,2),T=_(u(C));y(C),y(o),w(()=>S(v,s(G)?`${s(G)}.md`:` `)),a(`submit`,o,oe),p(d,()=>s(L),e=>f(L,e)),i(`click`,T,()=>f(I,!1)),n(t,o)};l(X,e=>{s(I)&&e(ce)});var Z=_(X,2),le=e=>{var t=M();n(e,t)};l(Z,e=>{!O.listing.notes.length&&!s(I)&&e(le)});var Q=_(Z,2);C(Q,17,()=>s(U),([e,t])=>e,(e,t)=>{var a=c(()=>x(s(t),2));let o=()=>s(a)[0],d=()=>s(a)[1];var f=te(),p=u(f),m=u(p),h=r(m,!0),g=_(m);y(p);var v=_(p,2);C(v,21,d,e=>e.id,(e,t)=>{var i=ee(),a=u(i),o=u(a),c=r(o,!0),d=_(o),f=e=>{var i=N(),a=r(i,!0);w(()=>S(a,s(t).description)),n(e,i)};l(d,e=>{s(t).description&&e(f)}),y(a),y(i),w(e=>{b(a,`href`,e),S(c,s(t).title)},[()=>D(s(t).id)]),n(e,i)}),y(v),y(f),w(()=>{S(h,o()||`the top of the base`),b(g,`aria-label`,`New note in ${o()||`the top of the base`}`)}),i(`click`,g,()=>K(o())),n(e,f)});var $=_(Q,2),ue=e=>{var t=re(),i=_(u(t),2);C(i,21,()=>s(W),e=>e.id,(e,t)=>{var i=ne(),a=u(i),o=u(a),c=r(o,!0),l=_(o),d=r(l,!0);y(a),y(i),w(e=>{b(a,`href`,e),S(c,s(t).title),S(d,s(t).snippet)},[()=>D(s(t).id)]),n(e,i)}),y(i),y(t),n(e,t)};l($,e=>{s(W).length&&e(ue)});var de=_($,2),fe=e=>{var t=ie();n(e,t)};l(de,e=>{s(B).length&&!s(H).length&&!s(W).length&&e(fe)}),y(q),p(Y,()=>s(P),e=>f(P,e)),i(`click`,se,()=>K()),n(o,q),g()}m([`click`]);export{P as t};
@@ -1 +1 @@
1
- import"./Bze-M_kr.js";import{i as e}from"./CMp5T_-1.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
1
+ import"./-7PsQOY4.js";import{i as e}from"./HCrXwzvD.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};