isorite 0.1.0 → 0.2.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 (77) hide show
  1. package/dist/core.js +125 -2
  2. package/dist/embed-worker.js +9 -2
  3. package/dist/main.js +2377 -394
  4. package/package.json +2 -1
  5. package/plugin/server.ts +9 -8
  6. package/plugin/tour.ts +5 -8
  7. package/web/_app/immutable/assets/0.s5xqevrq.css +1 -0
  8. package/web/_app/immutable/assets/4.PVZR2_N5.css +1 -0
  9. package/web/_app/immutable/assets/5.DCxNIgyW.css +1 -0
  10. package/web/_app/immutable/assets/9.CFA9_nYZ.css +1 -0
  11. package/web/_app/immutable/assets/FolderField._A4_sc1Z.css +1 -0
  12. package/web/_app/immutable/assets/NoteEditor.ChlpmyHO.css +1 -0
  13. package/web/_app/immutable/assets/NoteList.F579Zvj_.css +1 -0
  14. package/web/_app/immutable/assets/{Timeline.UMF1LjSO.css → Timeline.KTc3LKuK.css} +1 -1
  15. package/web/_app/immutable/assets/Tutorial.DOfsM49T.css +1 -0
  16. package/web/_app/immutable/chunks/B0NIb88Q.js +1 -0
  17. package/web/_app/immutable/chunks/B7ZjnqOt.js +20 -0
  18. package/web/_app/immutable/chunks/{B-si2ell.js → BEVz4Dgg.js} +1 -1
  19. package/web/_app/immutable/chunks/BEk5idXo.js +1 -0
  20. package/web/_app/immutable/chunks/B_nIecMW.js +667 -0
  21. package/web/_app/immutable/chunks/C8UdwlAg.js +3 -0
  22. package/web/_app/immutable/chunks/CRzLMJPS.js +1 -0
  23. package/web/_app/immutable/chunks/CcQ3P3p1.js +13 -0
  24. package/web/_app/immutable/chunks/CcRs965g.js +1 -0
  25. package/web/_app/immutable/chunks/Cw2GjAJR.js +1 -0
  26. package/web/_app/immutable/chunks/DjBHskLm.js +1 -0
  27. package/web/_app/immutable/chunks/Dm229u8R.js +1 -0
  28. package/web/_app/immutable/chunks/UM_L7-f7.js +1 -0
  29. package/web/_app/immutable/chunks/b-AOhhy1.js +1 -0
  30. package/web/_app/immutable/chunks/k55859zq.js +1 -0
  31. package/web/_app/immutable/entry/app.B3QXxjjH.js +2 -0
  32. package/web/_app/immutable/entry/start.BauJm-6k.js +1 -0
  33. package/web/_app/immutable/nodes/0.DP4c84Wn.js +14 -0
  34. package/web/_app/immutable/nodes/1.BcwcVDJZ.js +1 -0
  35. package/web/_app/immutable/nodes/2.DgGnQZ7P.js +1 -0
  36. package/web/_app/immutable/nodes/3.BudzO7We.js +1 -0
  37. package/web/_app/immutable/nodes/4.DmswyrSt.js +2 -0
  38. package/web/_app/immutable/nodes/5.DjXsfjL5.js +5 -0
  39. package/web/_app/immutable/nodes/6.uBh-sdQx.js +1 -0
  40. package/web/_app/immutable/nodes/7.BYBNXM1A.js +1 -0
  41. package/web/_app/immutable/nodes/8.Tbz9Rh77.js +1 -0
  42. package/web/_app/immutable/nodes/9.NF5w8YC2.js +486 -0
  43. package/web/_app/immutable/workers/worker-rKDNrEKQ.js +1 -0
  44. package/web/_app/version.json +1 -1
  45. package/web/icon-180.png +0 -0
  46. package/web/icon-192.png +0 -0
  47. package/web/icon-512.png +0 -0
  48. package/web/icon-maskable-512.png +0 -0
  49. package/web/index.html +35 -12
  50. package/web/manifest.webmanifest +14 -0
  51. package/web/_app/immutable/assets/0.CbWSsYpm.css +0 -1
  52. package/web/_app/immutable/assets/3.Bgs8n1LK.css +0 -1
  53. package/web/_app/immutable/assets/4.CCFEPTFN.css +0 -1
  54. package/web/_app/immutable/assets/5.BCvLF9Xz.css +0 -1
  55. package/web/_app/immutable/assets/6.kPo5mcJx.css +0 -1
  56. package/web/_app/immutable/assets/NoteEditor.Bp-YDqYj.css +0 -1
  57. package/web/_app/immutable/chunks/BD1Dpm2e.js +0 -3
  58. package/web/_app/immutable/chunks/C0fpmehI.js +0 -1
  59. package/web/_app/immutable/chunks/CWYACT2V.js +0 -1
  60. package/web/_app/immutable/chunks/CdQZ-ArP.js +0 -1
  61. package/web/_app/immutable/chunks/DN3dk6rD.js +0 -147
  62. package/web/_app/immutable/chunks/DtAOoM-T.js +0 -1
  63. package/web/_app/immutable/chunks/DykrN7z5.js +0 -535
  64. package/web/_app/immutable/chunks/cmGruEKS.js +0 -1
  65. package/web/_app/immutable/chunks/gRYnlonl.js +0 -1
  66. package/web/_app/immutable/entry/app.DgJiXIYs.js +0 -2
  67. package/web/_app/immutable/entry/start.l9vV7NaJ.js +0 -1
  68. package/web/_app/immutable/nodes/0.DWPeBju2.js +0 -1
  69. package/web/_app/immutable/nodes/1.CJVDS8FT.js +0 -1
  70. package/web/_app/immutable/nodes/2.o8ItfT-a.js +0 -1
  71. package/web/_app/immutable/nodes/3.uhHyOPGK.js +0 -13
  72. package/web/_app/immutable/nodes/4.BYKkAZTp.js +0 -2
  73. package/web/_app/immutable/nodes/5.BzEQO7Xv.js +0 -4
  74. package/web/_app/immutable/nodes/6.GxiAUa6J.js +0 -1
  75. package/web/_app/immutable/nodes/7.d2Ere8Jb.js +0 -1
  76. package/web/_app/immutable/nodes/8.CvPHZL8j.js +0 -1
  77. package/web/_app/immutable/workers/worker-d9GxGKde.js +0 -1
@@ -1 +1 @@
1
- import"./BD1Dpm2e.js";import{i as e}from"./CWYACT2V.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"./C8UdwlAg.js";import{i as e}from"./Cw2GjAJR.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};
@@ -0,0 +1 @@
1
+ import{$ as e,L as t,Q as n}from"./C8UdwlAg.js";import{t as r}from"./DjBHskLm.js";import{i,r as a}from"./B_nIecMW.js";import{i as o}from"./UM_L7-f7.js";var s=new class{#e=e(``);get id(){return t(this.#e)}set id(e){n(this.#e,e,!0)}#t=e([]);get turns(){return t(this.#t)}set turns(e){n(this.#t,e)}#n=e(``);get streaming(){return t(this.#n)}set streaming(e){n(this.#n,e,!0)}#r=e(``);get problem(){return t(this.#r)}set problem(e){n(this.#r,e,!0)}#i=e(null);get report(){return t(this.#i)}set report(e){n(this.#i,e)}#a=e(`chat`);get view(){return t(this.#a)}set view(e){n(this.#a,e,!0)}#o=e([]);get off(){return t(this.#o)}set off(e){n(this.#o,e)}toggleTurn(e){this.off=this.off.includes(e)?this.off.filter(t=>t!==e):[...this.off,e],this.measure()}sizeOf(e){let t=this.report?.given?.find(t=>t.kind===e.kind&&t.id===e.id&&(e.kind!==`passage`||t.text===e.text));return t?t.tokens:null}started=!1;timer;get running(){let e=this.turns.at(-1);return e?.state===`running`?e:null}start(){!this.started&&r.api&&(this.started=!0,r.api.conversation().then(e=>{e&&!this.id&&this.show(e)},()=>void 0),r.on(e=>this.follow(e)),this.measure())}show(e){this.id=e.id,this.turns=e.turns}fresh(){this.running||(this.id=``,this.turns=[],this.streaming=``,this.off=[],this.measure())}async send(e){if(this.problem=``,!e.trim()||this.running)return!1;try{let t=i.sent.map(e=>e.kind===`passage`?{kind:e.kind,id:e.id,text:e.text}:{kind:e.kind,id:e.id}),{conversation:n}=await r.api.converse({...this.id?{conversation:this.id}:{},mode:o.mode,asked:e.trim(),given:t,tier:a.tier,...this.off.length?{off:this.off}:{}});return this.id=n,!0}catch(e){return this.problem=e.message,!1}}async stop(){let e=this.running;e&&await r.api.stop(e.id)}async undo(e){this.problem=``;try{await r.api.undoTurn(this.id,e)}catch(e){this.problem=e.message}}async answer(e,t){let n=this.running;n&&await r.api.answer(n.id,e,t)}follow(e){if(e.type===`agent-start`){o.want(`atlas`,`iso`,o.busy(`atlas`));return}if(e.type===`iso-start`&&e.place.form===`turn`){if(this.id&&e.place.conversation!==this.id)return;this.id=e.place.conversation,this.streaming=``,o.want(`atlas`,`iso`,o.busy(`atlas`)),this.turns=[...this.turns.filter(t=>t.id!==e.request),{id:e.request,conversation:e.place.conversation,at:new Date().toISOString(),mode:e.place.mode,asked:e.asked,given:e.place.given,tier:e.tier,items:[],state:`running`}];return}if(!(`request`in e)){(e.type===`note-changed`||e.type===`journal`)&&this.measure();return}let t=this.turns.findIndex(t=>t.id===e.request);if(t<0)return;let n=this.turns[t],i=e=>{this.turns=this.turns.map((n,r)=>r===t?e:n)};e.type===`iso-text`?this.streaming=e.again?e.delta:this.streaming+e.delta:e.type===`iso-item`?(e.item.kind===`text`&&(this.streaming=``),e.item.kind===`change`&&(e.item.note===r.open||e.item.to===r.open)&&o.want(`note`,`iso`,o.busy(`note`)),(e.item.kind===`change`&&e.item.note===`@understanding/${r.open}`||e.item.kind===`understood`&&e.item.note===r.open)&&o.want(`note`,`understand`,o.busy(`note`)),i({...n,items:[...n.items,e.item]})):e.type===`iso-answer`?i({...n,items:n.items.map(t=>t.kind===`permission`&&t.id===e.permission?{...t,answer:e.decision}:t)}):e.type===`iso-done`?(i({...n,state:`done`,cost:e.cost}),this.streaming=``,this.measure()):e.type===`iso-stopped`?(i({...n,state:`stopped`,...this.streaming?{items:[...n.items,{kind:`text`,text:this.streaming}]}:{}}),this.streaming=``):e.type===`iso-failed`&&(i({...n,state:`failed`,message:e.message}),this.streaming=``)}measure(){clearTimeout(this.timer),this.timer=setTimeout(()=>{if(!r.api)return;let e=i.sent.map(e=>e.kind===`passage`?{kind:e.kind,id:e.id,text:e.text}:{kind:e.kind,id:e.id});r.api.turnContext({...this.id?{conversation:this.id}:{},mode:o.mode,given:e,tier:a.tier,...this.off.length?{off:this.off}:{}}).then(e=>this.report=e,()=>void 0)},250)}};export{s as t};