@engenty/wizards-runtime 0.20.6 → 0.21.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 (336) hide show
  1. package/README.md +3 -3
  2. package/apps/runtime/dist/agents/studio-assistant.js +7 -3
  3. package/apps/runtime/dist/agents/subscription.js +4 -17
  4. package/apps/runtime/dist/app.js +4 -1
  5. package/apps/runtime/dist/cli/clients.js +6 -24
  6. package/apps/runtime/dist/cli/connect.js +2 -1
  7. package/apps/runtime/dist/cli/environment.js +3 -0
  8. package/apps/runtime/dist/cli/machine.js +1 -70
  9. package/apps/runtime/dist/cli/main.js +2 -1
  10. package/apps/runtime/dist/cli/ollama.js +1 -179
  11. package/apps/runtime/dist/cli/setup.js +8 -6
  12. package/apps/runtime/dist/docs/dev/licensing.md +15 -9
  13. package/apps/runtime/dist/docs/user-guide/command-line.md +3 -0
  14. package/apps/runtime/dist/elements/outside.js +2 -1
  15. package/apps/runtime/dist/engine/code-step.js +1 -1
  16. package/apps/runtime/dist/engine/decide.js +2 -2
  17. package/apps/runtime/dist/engine/input.js +1 -1
  18. package/apps/runtime/dist/engine/runner.js +1 -1
  19. package/apps/runtime/dist/engine/steps.js +27 -8
  20. package/apps/runtime/dist/engine/surface.js +1 -1
  21. package/apps/runtime/dist/engine/template.js +1 -1
  22. package/apps/runtime/dist/env.js +1 -0
  23. package/apps/runtime/dist/harness/clients.js +10 -1
  24. package/apps/runtime/dist/harness/index.js +15 -69
  25. package/apps/runtime/dist/harness/types.js +3 -2
  26. package/apps/runtime/dist/local-call.js +6 -0
  27. package/apps/runtime/dist/local-models.js +53 -157
  28. package/apps/runtime/dist/mcp/bridge.js +12 -55
  29. package/apps/runtime/dist/mcp/elements.js +39 -4
  30. package/apps/runtime/dist/mcp/handler.js +12 -0
  31. package/apps/runtime/dist/mcp/run-pages.js +238 -0
  32. package/apps/runtime/dist/mcp/run-tasks.js +157 -0
  33. package/apps/runtime/dist/mcp/runs.js +129 -0
  34. package/apps/runtime/dist/mcp/tools.js +4 -95
  35. package/apps/runtime/dist/models.js +74 -27
  36. package/apps/runtime/dist/prompts/mcp.md +4 -1
  37. package/apps/runtime/dist/render/downloads.js +1 -1
  38. package/apps/runtime/dist/render/shaped.js +1 -1
  39. package/apps/runtime/dist/routes/model-setup.js +77 -0
  40. package/apps/runtime/dist/routes/studio.js +8 -251
  41. package/apps/runtime/dist/services/space-categories.js +1 -1
  42. package/apps/runtime/dist/services/work-ai.js +10 -4
  43. package/apps/runtime/dist/texts.js +4 -6
  44. package/apps/runtime/dist/tools/connections.js +3 -0
  45. package/apps/runtime/dist/tools/harness.js +124 -0
  46. package/apps/web/dist/assets/AboutDialog-BSdAA4Wi.js +1 -0
  47. package/apps/web/dist/assets/{BlockEditor-CgjXTWly.js → BlockEditor-0noqMcAl.js} +1 -1
  48. package/apps/web/dist/assets/Bundle-Ctrq7lHH.js +1 -0
  49. package/apps/web/dist/assets/CapabilitiesPage-CZlVhBmU.js +2 -0
  50. package/apps/web/dist/assets/ChangelogDialog-BLCYV4jT.js +1 -0
  51. package/apps/web/dist/assets/{CodeEditor-2LyHbSre.js → CodeEditor-CpRn9BZq.js} +1 -1
  52. package/apps/web/dist/assets/ConnectorsSection-B4rRDlFo.js +1 -0
  53. package/apps/web/dist/assets/EditorPage-CXN-_zzG.js +3 -0
  54. package/apps/web/dist/assets/FlowPreview-DjQvcWxs.js +1 -0
  55. package/apps/web/dist/assets/LangSwitch-BuzsLp16.js +1 -0
  56. package/apps/web/dist/assets/LocalModels-BDfP2v5-.js +1 -0
  57. package/apps/web/dist/assets/Marketplace-4baBNzEc.js +2 -0
  58. package/apps/web/dist/assets/NewWizardChannels-B_xHm-bI.js +1 -0
  59. package/apps/web/dist/assets/NewWizardPage-BmZAY4zi.js +7 -0
  60. package/apps/web/dist/assets/OnboardingPage-fZq3WiTk.js +1 -0
  61. package/apps/web/dist/assets/ProtocolSection-v9wIxisg.js +1 -0
  62. package/apps/web/dist/assets/PublicRunner-BCh0VzAT.js +1 -0
  63. package/apps/web/dist/assets/{ReadOnly-CO3ndR23.js → ReadOnly-13stkvNz.js} +1 -1
  64. package/apps/web/dist/assets/Results-4gmguYzH.js +1 -0
  65. package/apps/web/dist/assets/RunDrawer-CeEldWRn.js +1 -0
  66. package/apps/web/dist/assets/SettingsPage-BsKRRlfP.js +2 -0
  67. package/apps/web/dist/assets/SetupPage-FgA5Kl8z.js +1 -0
  68. package/apps/web/dist/assets/SharePage-BlBW4oxl.js +1 -0
  69. package/apps/web/dist/assets/SkillEditor-9QSskfmY.js +1 -0
  70. package/apps/web/dist/assets/Skills-DdUAyNhR.js +9 -0
  71. package/apps/web/dist/assets/SpacePage-CHkNPuqt.js +2 -0
  72. package/apps/web/dist/assets/StudioHome-BwPD-inc.js +1 -0
  73. package/apps/web/dist/assets/TableEditor-Du1DhbEC.js +7 -0
  74. package/apps/web/dist/assets/UpdateCheck-DPr9NXq_.js +2 -0
  75. package/apps/web/dist/assets/brand-DY3lzrOd.js +2 -0
  76. package/apps/web/dist/assets/changelog-BSdb22c3.js +1 -0
  77. package/apps/web/dist/assets/code-editor-Bep_LzQ5.js +2 -0
  78. package/apps/web/dist/assets/host-DiZQ_uws.js +1 -0
  79. package/apps/web/dist/assets/host-Dw-sMUSd.js +54 -0
  80. package/apps/web/dist/assets/i18n-DVrYWJaj.js +55 -0
  81. package/apps/web/dist/assets/index-C2gxK14s.css +1 -0
  82. package/apps/web/dist/assets/index-lQ4JYHYQ.js +102 -0
  83. package/apps/web/dist/assets/oss-credits-BHy69wkx.js +1 -0
  84. package/apps/web/dist/assets/{read-aloud-CRFt5q6k.js → read-aloud-CBycd8TA.js} +1 -1
  85. package/apps/web/dist/assets/{session-RDdtfee2.js → session-BYLtgklo.js} +1 -1
  86. package/apps/web/dist/assets/terminal-DmGdMags.js +16 -0
  87. package/apps/web/dist/assets/texts-ClKS2xhh.js +1 -0
  88. package/apps/web/dist/assets/theme-DFDOMsVo.js +14 -0
  89. package/apps/web/dist/assets/ui-CW2I3ecu.js +1 -0
  90. package/apps/web/dist/assets/ui-DfVpZYIW.js +16 -0
  91. package/apps/web/dist/assets/{useMutation-BSffqL6W.js → useMutation-BnkuLlQC.js} +1 -1
  92. package/apps/web/dist/assets/viewers-C6FfRwG1.js +2 -0
  93. package/apps/web/dist/index.html +18 -16
  94. package/apps/web/dist/mcp/flow.html +129 -129
  95. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.js +1 -1
  96. package/node_modules/@engenty/chatviews/dist/chat/a2ui.d.ts +48 -0
  97. package/node_modules/@engenty/chatviews/dist/chat/a2ui.js +514 -0
  98. package/node_modules/@engenty/chatviews/dist/chat/check.d.ts +18 -0
  99. package/node_modules/@engenty/chatviews/dist/chat/check.js +97 -0
  100. package/node_modules/@engenty/chatviews/dist/chat/index.d.ts +3 -0
  101. package/node_modules/@engenty/chatviews/dist/chat/index.js +4 -0
  102. package/node_modules/@engenty/chatviews/dist/chat/library.d.ts +39 -0
  103. package/node_modules/@engenty/chatviews/dist/chat/library.js +314 -0
  104. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.js +1 -1
  105. package/node_modules/@engenty/chatviews/dist/react/chat.d.ts +33 -0
  106. package/node_modules/@engenty/chatviews/dist/react/chat.js +150 -0
  107. package/node_modules/@engenty/chatviews/dist/react/field-looks.d.ts +39 -0
  108. package/node_modules/@engenty/chatviews/dist/react/field-looks.js +47 -0
  109. package/node_modules/@engenty/chatviews/dist/react/markdown.d.ts +5 -0
  110. package/node_modules/@engenty/chatviews/dist/react/markdown.js +11 -0
  111. package/node_modules/@engenty/chatviews/dist/react/no-devtools.d.ts +0 -0
  112. package/node_modules/@engenty/chatviews/dist/react/no-devtools.js +8 -0
  113. package/node_modules/@engenty/chatviews/dist/react/surface.d.ts +39 -0
  114. package/node_modules/@engenty/chatviews/dist/react/surface.js +552 -0
  115. package/node_modules/@engenty/chatviews/dist/react/texts.d.ts +39 -0
  116. package/node_modules/@engenty/chatviews/dist/react/texts.js +42 -0
  117. package/node_modules/@engenty/chatviews/dist/react/ui.d.ts +112 -0
  118. package/node_modules/@engenty/chatviews/dist/react/ui.js +212 -0
  119. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.js +1 -1
  120. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.js +1 -1
  121. package/node_modules/@engenty/chatviews/package.json +19 -0
  122. package/node_modules/@engenty/decision-model/dist/client.d.ts +76 -0
  123. package/node_modules/@engenty/decision-model/dist/client.js +188 -0
  124. package/node_modules/@engenty/decision-model/dist/index.d.ts +6 -0
  125. package/node_modules/@engenty/decision-model/dist/index.js +5 -0
  126. package/node_modules/@engenty/decision-model/dist/local.d.ts +11 -0
  127. package/node_modules/@engenty/decision-model/dist/local.js +116 -0
  128. package/node_modules/@engenty/decision-model/dist/resolve.d.ts +26 -0
  129. package/node_modules/@engenty/decision-model/dist/resolve.js +53 -0
  130. package/node_modules/@engenty/decision-model/dist/types.d.ts +80 -0
  131. package/node_modules/@engenty/decision-model/dist/types.js +6 -0
  132. package/node_modules/@engenty/decision-model/dist/validate.d.ts +9 -0
  133. package/node_modules/@engenty/decision-model/dist/validate.js +50 -0
  134. package/node_modules/@engenty/decision-model/dist/ways.d.ts +42 -0
  135. package/node_modules/@engenty/decision-model/dist/ways.js +72 -0
  136. package/node_modules/@engenty/decision-model/package.json +9 -0
  137. package/node_modules/@engenty/local-models/dist/bridge/index.d.ts +54 -0
  138. package/node_modules/@engenty/local-models/dist/bridge/index.js +117 -0
  139. package/node_modules/@engenty/local-models/dist/clients/antigravity.d.ts +37 -0
  140. package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js +68 -17
  141. package/node_modules/@engenty/local-models/dist/clients/claude.js +1 -0
  142. package/node_modules/@engenty/local-models/dist/clients/client.d.ts +3 -1
  143. package/node_modules/@engenty/local-models/dist/clients/client.js +1 -1
  144. package/node_modules/@engenty/local-models/dist/clients/codex.js +1 -0
  145. package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +2 -0
  146. package/node_modules/@engenty/local-models/dist/clients/cursor.js +13 -1
  147. package/node_modules/@engenty/local-models/dist/clients/index.d.ts +2 -1
  148. package/node_modules/@engenty/local-models/dist/clients/index.js +4 -2
  149. package/node_modules/@engenty/local-models/dist/clients/model.d.ts +4 -1
  150. package/node_modules/@engenty/local-models/dist/index.d.ts +2 -1
  151. package/node_modules/@engenty/local-models/dist/index.js +2 -1
  152. package/node_modules/@engenty/local-models/dist/lmstudio/api.d.ts +49 -0
  153. package/node_modules/@engenty/local-models/dist/lmstudio/api.js +101 -0
  154. package/node_modules/@engenty/local-models/dist/lmstudio/index.d.ts +3 -0
  155. package/node_modules/@engenty/local-models/dist/lmstudio/index.js +3 -0
  156. package/node_modules/@engenty/local-models/dist/lmstudio/load.d.ts +12 -0
  157. package/node_modules/@engenty/local-models/dist/lmstudio/load.js +100 -0
  158. package/node_modules/@engenty/local-models/dist/lmstudio/server.d.ts +3 -0
  159. package/node_modules/@engenty/local-models/dist/lmstudio/server.js +29 -0
  160. package/node_modules/@engenty/local-models/dist/mlx/helper.d.ts +54 -0
  161. package/node_modules/@engenty/local-models/dist/mlx/helper.js +149 -0
  162. package/node_modules/@engenty/local-models/dist/mlx/index.d.ts +3 -0
  163. package/node_modules/@engenty/local-models/dist/mlx/index.js +3 -0
  164. package/node_modules/@engenty/local-models/dist/mlx/server.d.ts +19 -0
  165. package/node_modules/@engenty/local-models/dist/mlx/server.js +82 -0
  166. package/node_modules/@engenty/local-models/dist/mlx/store.d.ts +16 -0
  167. package/node_modules/@engenty/local-models/dist/mlx/store.js +153 -0
  168. package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +4 -37
  169. package/node_modules/@engenty/local-models/dist/ollama/api.js +1 -18
  170. package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +2 -1
  171. package/node_modules/@engenty/local-models/dist/ollama/index.js +2 -1
  172. package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +2 -0
  173. package/node_modules/@engenty/local-models/dist/ollama/model.js +1 -1
  174. package/node_modules/@engenty/local-models/dist/ollama/server.d.ts +3 -0
  175. package/node_modules/@engenty/local-models/dist/ollama/server.js +45 -0
  176. package/node_modules/@engenty/local-models/dist/probe.d.ts +11 -8
  177. package/node_modules/@engenty/local-models/dist/probe.js +16 -32
  178. package/node_modules/@engenty/local-models/dist/servers/index.d.ts +6 -0
  179. package/node_modules/@engenty/local-models/dist/servers/index.js +12 -0
  180. package/node_modules/@engenty/local-models/dist/servers/server.d.ts +84 -0
  181. package/node_modules/@engenty/local-models/dist/servers/server.js +38 -0
  182. package/node_modules/@engenty/local-models/package.json +5 -1
  183. package/node_modules/@engenty/model-setup/dist/catalog.d.ts +36 -0
  184. package/node_modules/@engenty/model-setup/dist/catalog.js +81 -0
  185. package/node_modules/@engenty/model-setup/dist/index.d.ts +3 -0
  186. package/node_modules/@engenty/model-setup/dist/index.js +3 -0
  187. package/node_modules/@engenty/model-setup/dist/offered.d.ts +7 -0
  188. package/node_modules/@engenty/model-setup/dist/offered.js +64 -0
  189. package/node_modules/@engenty/model-setup/dist/react/client.d.ts +46 -0
  190. package/node_modules/@engenty/model-setup/dist/react/client.js +147 -0
  191. package/node_modules/@engenty/model-setup/dist/react/columns.d.ts +78 -0
  192. package/node_modules/@engenty/model-setup/dist/react/columns.js +99 -0
  193. package/node_modules/@engenty/model-setup/dist/react/host.d.ts +31 -0
  194. package/node_modules/@engenty/model-setup/dist/react/host.js +48 -0
  195. package/node_modules/@engenty/model-setup/dist/react/index.d.ts +7 -0
  196. package/node_modules/@engenty/model-setup/dist/react/index.js +7 -0
  197. package/node_modules/@engenty/model-setup/dist/react/keys.d.ts +48 -0
  198. package/node_modules/@engenty/model-setup/dist/react/keys.js +74 -0
  199. package/node_modules/@engenty/model-setup/dist/react/local-models.d.ts +23 -0
  200. package/node_modules/@engenty/model-setup/dist/react/local-models.js +134 -0
  201. package/node_modules/@engenty/model-setup/dist/react/servers.d.ts +4 -0
  202. package/node_modules/@engenty/model-setup/dist/react/servers.js +13 -0
  203. package/node_modules/@engenty/model-setup/dist/react/terminal.d.ts +13 -0
  204. package/node_modules/@engenty/model-setup/dist/react/terminal.js +79 -0
  205. package/node_modules/@engenty/model-setup/dist/react/tone.d.ts +13 -0
  206. package/node_modules/@engenty/model-setup/dist/react/tone.js +66 -0
  207. package/node_modules/@engenty/model-setup/dist/server/apps.d.ts +12 -0
  208. package/node_modules/@engenty/model-setup/dist/server/apps.js +22 -0
  209. package/node_modules/@engenty/model-setup/dist/server/clients.d.ts +55 -0
  210. package/node_modules/@engenty/model-setup/dist/server/clients.js +96 -0
  211. package/node_modules/@engenty/model-setup/dist/server/index.d.ts +8 -0
  212. package/node_modules/@engenty/model-setup/dist/server/index.js +8 -0
  213. package/node_modules/@engenty/model-setup/dist/server/install.d.ts +24 -0
  214. package/node_modules/@engenty/model-setup/dist/server/install.js +68 -0
  215. package/node_modules/@engenty/model-setup/dist/server/lmstudio.d.ts +9 -0
  216. package/node_modules/@engenty/model-setup/dist/server/lmstudio.js +52 -0
  217. package/node_modules/@engenty/model-setup/dist/server/local-models.d.ts +47 -0
  218. package/node_modules/@engenty/model-setup/dist/server/local-models.js +164 -0
  219. package/node_modules/@engenty/model-setup/dist/server/models.d.ts +12 -0
  220. package/node_modules/@engenty/model-setup/dist/server/models.js +16 -0
  221. package/node_modules/@engenty/model-setup/dist/server/ollama.d.ts +22 -0
  222. package/node_modules/@engenty/model-setup/dist/server/ollama.js +146 -0
  223. package/node_modules/@engenty/model-setup/dist/server/routes.d.ts +51 -0
  224. package/node_modules/@engenty/model-setup/dist/server/routes.js +211 -0
  225. package/node_modules/@engenty/model-setup/dist/server/server-apps.d.ts +14 -0
  226. package/node_modules/@engenty/model-setup/dist/server/server-apps.js +24 -0
  227. package/node_modules/@engenty/model-setup/dist/server/terminal.d.ts +43 -0
  228. package/node_modules/@engenty/model-setup/dist/server/terminal.js +222 -0
  229. package/node_modules/@engenty/model-setup/dist/texts.d.ts +222 -0
  230. package/node_modules/@engenty/model-setup/dist/texts.js +222 -0
  231. package/node_modules/@engenty/model-setup/dist/types.d.ts +111 -0
  232. package/node_modules/@engenty/model-setup/dist/types.js +2 -0
  233. package/node_modules/@engenty/model-setup/package.json +12 -0
  234. package/node_modules/@engenty/search-index/dist/catalog-lexical.d.ts +14 -0
  235. package/node_modules/@engenty/search-index/dist/catalog-lexical.js +165 -0
  236. package/node_modules/@engenty/search-index/dist/catalog-rank.d.ts +33 -0
  237. package/node_modules/@engenty/search-index/dist/catalog-rank.js +99 -0
  238. package/node_modules/@engenty/search-index/dist/catalog-search.d.ts +40 -0
  239. package/node_modules/@engenty/search-index/dist/catalog-search.js +161 -0
  240. package/node_modules/@engenty/search-index/dist/chunks.d.ts +17 -0
  241. package/node_modules/@engenty/search-index/dist/chunks.js +164 -0
  242. package/node_modules/@engenty/search-index/dist/contracts.d.ts +135 -0
  243. package/node_modules/@engenty/search-index/dist/contracts.js +9 -0
  244. package/node_modules/@engenty/search-index/dist/embedder.d.ts +31 -0
  245. package/node_modules/@engenty/search-index/dist/embedder.js +82 -0
  246. package/node_modules/@engenty/search-index/dist/embedders/gemini.d.ts +11 -0
  247. package/node_modules/@engenty/search-index/dist/embedders/gemini.js +54 -0
  248. package/node_modules/@engenty/search-index/dist/embedders/index.d.ts +5 -0
  249. package/node_modules/@engenty/search-index/dist/embedders/index.js +5 -0
  250. package/node_modules/@engenty/search-index/dist/embedders/ollama.d.ts +12 -0
  251. package/node_modules/@engenty/search-index/dist/embedders/ollama.js +43 -0
  252. package/node_modules/@engenty/search-index/dist/embedders/openai.d.ts +11 -0
  253. package/node_modules/@engenty/search-index/dist/embedders/openai.js +36 -0
  254. package/node_modules/@engenty/search-index/dist/embedders/shared.d.ts +5 -0
  255. package/node_modules/@engenty/search-index/dist/embedders/shared.js +26 -0
  256. package/node_modules/@engenty/search-index/dist/embedders/ways.d.ts +16 -0
  257. package/node_modules/@engenty/search-index/dist/embedders/ways.js +90 -0
  258. package/node_modules/@engenty/search-index/dist/index.d.ts +10 -0
  259. package/node_modules/@engenty/search-index/dist/index.js +10 -0
  260. package/node_modules/@engenty/search-index/dist/payload.d.ts +13 -0
  261. package/node_modules/@engenty/search-index/dist/payload.js +51 -0
  262. package/node_modules/@engenty/search-index/dist/registry.d.ts +25 -0
  263. package/node_modules/@engenty/search-index/dist/registry.js +56 -0
  264. package/node_modules/@engenty/search-index/dist/scoring.d.ts +10 -0
  265. package/node_modules/@engenty/search-index/dist/scoring.js +45 -0
  266. package/node_modules/@engenty/search-index/dist/strategy.d.ts +6 -0
  267. package/node_modules/@engenty/search-index/dist/strategy.js +25 -0
  268. package/node_modules/@engenty/search-index/package.json +10 -0
  269. package/node_modules/@engenty/tool-harness/dist/harness.d.ts +70 -0
  270. package/node_modules/@engenty/tool-harness/dist/harness.js +170 -0
  271. package/node_modules/@engenty/tool-harness/dist/index.d.ts +5 -0
  272. package/node_modules/@engenty/tool-harness/dist/index.js +5 -0
  273. package/node_modules/@engenty/tool-harness/dist/judge.d.ts +8 -0
  274. package/node_modules/@engenty/tool-harness/dist/judge.js +39 -0
  275. package/node_modules/@engenty/tool-harness/dist/levels.d.ts +18 -0
  276. package/node_modules/@engenty/tool-harness/dist/levels.js +47 -0
  277. package/node_modules/@engenty/tool-harness/dist/model.d.ts +6 -0
  278. package/node_modules/@engenty/tool-harness/dist/model.js +60 -0
  279. package/node_modules/@engenty/tool-harness/dist/schema.d.ts +26 -0
  280. package/node_modules/@engenty/tool-harness/dist/schema.js +57 -0
  281. package/node_modules/@engenty/tool-harness/package.json +9 -0
  282. package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -1
  283. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10 -10
  284. package/node_modules/@engenty/wizards-shared/dist/definition.js +4 -4
  285. package/node_modules/@engenty/wizards-shared/dist/run-schema.js +1 -1
  286. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -1
  287. package/node_modules/@engenty/wizards-shared/dist/run.js +4 -0
  288. package/node_modules/@engenty/wizards-shared/dist/store.js +2 -1
  289. package/node_modules/@engenty/wizards-shared/dist/wizard-agents.d.ts +1 -1
  290. package/node_modules/@engenty/wizards-shared/dist/wizard-agents.js +1 -1
  291. package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +2 -2
  292. package/package.json +11 -1
  293. package/plugin/.claude-plugin/plugin.json +1 -1
  294. package/plugin/plugin.json +1 -1
  295. package/apps/runtime/dist/harness/terminal.js +0 -201
  296. package/apps/web/dist/assets/AboutDialog-BRUwrfQH.js +0 -1
  297. package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
  298. package/apps/web/dist/assets/CapabilitiesPage-C30knXsS.js +0 -2
  299. package/apps/web/dist/assets/ChangelogDialog-BkZQOAdl.js +0 -1
  300. package/apps/web/dist/assets/ConnectorsSection-CmXQD7zu.js +0 -1
  301. package/apps/web/dist/assets/EditorPage-LEbyNWmG.js +0 -3
  302. package/apps/web/dist/assets/FlowPreview-BXf4EKjU.js +0 -1
  303. package/apps/web/dist/assets/LangSwitch-BLB7dDce.js +0 -1
  304. package/apps/web/dist/assets/Marketplace-B3NoH5Va.js +0 -2
  305. package/apps/web/dist/assets/NewWizardChannels-CSn-9zHr.js +0 -1
  306. package/apps/web/dist/assets/NewWizardPage-B4wPfClS.js +0 -7
  307. package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
  308. package/apps/web/dist/assets/ProtocolSection-s4mEL_pu.js +0 -1
  309. package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
  310. package/apps/web/dist/assets/Results-CC1-mElv.js +0 -1
  311. package/apps/web/dist/assets/RunDrawer-DkmSXhad.js +0 -1
  312. package/apps/web/dist/assets/SettingsPage-DKs_fkNL.js +0 -2
  313. package/apps/web/dist/assets/SetupPage-RvmKCzF2.js +0 -1
  314. package/apps/web/dist/assets/SharePage-Drntg_oj.js +0 -1
  315. package/apps/web/dist/assets/SkillEditor-Ca_bzmjD.js +0 -1
  316. package/apps/web/dist/assets/Skills-BcgxuD15.js +0 -9
  317. package/apps/web/dist/assets/SpacePage-aZqYFttF.js +0 -2
  318. package/apps/web/dist/assets/StudioHome-Doua9Lyl.js +0 -1
  319. package/apps/web/dist/assets/TableEditor-Dbq3HZZS.js +0 -7
  320. package/apps/web/dist/assets/UpdateCheck-B7etUbUf.js +0 -2
  321. package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
  322. package/apps/web/dist/assets/changelog-BW79cVbx.js +0 -1
  323. package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
  324. package/apps/web/dist/assets/host-BXSxBoOH.js +0 -69
  325. package/apps/web/dist/assets/i18n-WXeVnv7i.js +0 -55
  326. package/apps/web/dist/assets/index-D1iL3986.css +0 -1
  327. package/apps/web/dist/assets/index-kDKA6ddy.js +0 -102
  328. package/apps/web/dist/assets/oss-credits-B3PXhamW.js +0 -1
  329. package/apps/web/dist/assets/theme-23bNrOQh.js +0 -14
  330. package/apps/web/dist/assets/ui-DkEhb2Rt.js +0 -16
  331. package/apps/web/dist/assets/viewers-CmGDpBjn.js +0 -2
  332. /package/apps/web/dist/assets/{host-BrP-ENHg.css → terminal-BrP-ENHg.css} +0 -0
  333. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.d.ts +0 -0
  334. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.d.ts +0 -0
  335. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.d.ts +0 -0
  336. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.d.ts +0 -0
@@ -0,0 +1,96 @@
1
+ import { mkdirSync } from "node:fs";
2
+ import { detectClient, freshAuth, loginEnv, loginShellEnv, } from "@engenty/local-models/clients";
3
+ import { clientEntry, installCommand, POWERSHELL } from "../catalog.js";
4
+ import { vendorApp } from "./apps.js";
5
+ /** The AI clients on this computer: how each stands, how it is installed and signed in. */
6
+ export class ClientSetup {
7
+ options;
8
+ /** The status last made of each client's detection, kept while the detection holds. */
9
+ statuses = new Map();
10
+ constructor(options) {
11
+ this.options = options;
12
+ }
13
+ client(id) {
14
+ return this.options.clients.find((client) => client.id === id) ?? null;
15
+ }
16
+ /** One client, as it is now; asked again after a minute, as it may get installed or signed in meanwhile. */
17
+ async detect(id, force = false) {
18
+ const client = this.client(id);
19
+ if (!client) {
20
+ return null;
21
+ }
22
+ const status = await detectClient(client, force);
23
+ const kept = this.statuses.get(client.id);
24
+ if (kept?.of === status) {
25
+ return kept.value;
26
+ }
27
+ const entry = clientEntry(client.id);
28
+ const value = {
29
+ id: client.id,
30
+ name: client.name,
31
+ label: entry?.label ?? client.name,
32
+ install: entry ? installCommand(entry, this.options.folder(), process.platform) : "",
33
+ app: entry ? vendorApp(entry) : null,
34
+ version: status.version,
35
+ auth: status.auth,
36
+ interactiveLogin: client.login.interactive,
37
+ images: Boolean(client.image),
38
+ };
39
+ this.statuses.set(client.id, { of: status, value });
40
+ return value;
41
+ }
42
+ /** Every client of the host, installed or not. */
43
+ detectAll(force = false) {
44
+ return Promise.all(this.options.clients.map((client) => this.detect(client.id, force)));
45
+ }
46
+ /**
47
+ * What the terminal runs to install a client: the command of the catalog, shown first. A
48
+ * client from npm goes into the host's own prefix.
49
+ */
50
+ async install(id) {
51
+ const entry = this.client(id) ? clientEntry(id) : null;
52
+ if (!entry) {
53
+ return null;
54
+ }
55
+ const folder = this.options.folder();
56
+ mkdirSync(folder, { recursive: true });
57
+ const command = installCommand(entry, folder, process.platform);
58
+ if (process.platform === "win32") {
59
+ const [bin = "", ...args] = POWERSHELL;
60
+ return {
61
+ bin,
62
+ args: [...args, `Write-Host "$ ${command.replaceAll('"', '`"')}\`n"; ${command}`],
63
+ env: this.options.env(undefined),
64
+ };
65
+ }
66
+ const shell = await loginShellEnv();
67
+ return {
68
+ bin: "bash",
69
+ args: [
70
+ "-c",
71
+ 'printf "\\033[2m$ %s\\033[0m\\n\\n" "$1"; set -o pipefail; eval "$1"',
72
+ "install",
73
+ command,
74
+ ],
75
+ env: {
76
+ ...this.options.env(shell.PATH),
77
+ TERM: "xterm-256color",
78
+ COLORTERM: "truecolor",
79
+ },
80
+ };
81
+ }
82
+ /** What the terminal runs to sign a client in. */
83
+ async login(id) {
84
+ const client = this.client(id);
85
+ return (client && {
86
+ bin: client.bin,
87
+ args: client.login.args,
88
+ env: { ...(await loginEnv(client)), ...client.login.env },
89
+ });
90
+ }
91
+ /** Whether the client is signed in, asked of the client itself. */
92
+ async signedIn(id) {
93
+ const client = this.client(id);
94
+ return client ? (await freshAuth(client)) !== "none" : false;
95
+ }
96
+ }
@@ -0,0 +1,8 @@
1
+ export { macAppPresent, suggestedClient, vendorApp } from "./apps.js";
2
+ export { ClientSetup, type ClientSetupOptions, type SetupClient, type TerminalCommand, } from "./clients.js";
3
+ export { freeGb, type Outcome } from "./install.js";
4
+ export { LocalModels, type LocalModelsOptions } from "./local-models.js";
5
+ export { Tested, type TestedStore } from "./models.js";
6
+ export { appAsksForPassword, findOllama, installOllama, startOllama, } from "./ollama.js";
7
+ export { type SetupHost, type SetupModels, type SourceOutcome, setupRoutes } from "./routes.js";
8
+ export { TerminalError, type TerminalOptions, Terminals } from "./terminal.js";
@@ -0,0 +1,8 @@
1
+ export { macAppPresent, suggestedClient, vendorApp } from "./apps.js";
2
+ export { ClientSetup, } from "./clients.js";
3
+ export { freeGb } from "./install.js";
4
+ export { LocalModels } from "./local-models.js";
5
+ export { Tested } from "./models.js";
6
+ export { appAsksForPassword, findOllama, installOllama, startOllama, } from "./ollama.js";
7
+ export { setupRoutes } from "./routes.js";
8
+ export { TerminalError, Terminals } from "./terminal.js";
@@ -0,0 +1,24 @@
1
+ /** What installing came to. */
2
+ export interface Outcome {
3
+ ok: boolean;
4
+ message: string;
5
+ }
6
+ export declare function executable(file: string): boolean;
7
+ /** The first file of that name on a PATH that may be run. */
8
+ export declare function findOnPath(name: string, path: string): string | null;
9
+ interface Ran {
10
+ code: number;
11
+ /** The end of what the command printed. */
12
+ tail: string;
13
+ }
14
+ /** Runs a command, what it prints into the log file; never rejects. */
15
+ export declare function logged(command: string, args: string[], { logs, onLine }: {
16
+ logs: string;
17
+ onLine?: (line: string) => void;
18
+ }): Promise<Ran>;
19
+ export declare const lastLine: (text: string) => string;
20
+ /** Asks every half second until it is true or the time is over. */
21
+ export declare function until(ready: () => Promise<boolean>, ms: number): Promise<boolean>;
22
+ /** Free space where the models are kept (the home folder), in GB. */
23
+ export declare function freeGb(dir?: string): Promise<number | null>;
24
+ export {};
@@ -0,0 +1,68 @@
1
+ import { spawn } from "node:child_process";
2
+ import { accessSync, appendFileSync, constants, mkdirSync } from "node:fs";
3
+ import { statfs } from "node:fs/promises";
4
+ import { homedir } from "node:os";
5
+ import { delimiter, join } from "node:path";
6
+ import { setTimeout as sleep } from "node:timers/promises";
7
+ export function executable(file) {
8
+ try {
9
+ accessSync(file, constants.X_OK);
10
+ return true;
11
+ }
12
+ catch {
13
+ return false;
14
+ }
15
+ }
16
+ /** The first file of that name on a PATH that may be run. */
17
+ export function findOnPath(name, path) {
18
+ const file = process.platform === "win32" ? `${name}.exe` : name;
19
+ return (path
20
+ .split(delimiter)
21
+ .filter(Boolean)
22
+ .map((dir) => join(dir, file))
23
+ .find(executable) ?? null);
24
+ }
25
+ /** Runs a command, what it prints into the log file; never rejects. */
26
+ export function logged(command, args, { logs, onLine }) {
27
+ mkdirSync(logs, { recursive: true });
28
+ const file = join(logs, "install.log");
29
+ appendFileSync(file, `\n$ ${command} ${args.join(" ")}\n`);
30
+ return new Promise((resolve) => {
31
+ let tail = "";
32
+ const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"] });
33
+ for (const stream of [child.stdout, child.stderr]) {
34
+ stream.on("data", (chunk) => {
35
+ const text = chunk.toString("utf8");
36
+ tail = (tail + text).slice(-4000);
37
+ appendFileSync(file, text);
38
+ for (const line of text.split("\n").filter((l) => l.trim())) {
39
+ onLine?.(line);
40
+ }
41
+ });
42
+ }
43
+ child.on("error", (err) => resolve({ code: 127, tail: err.message }));
44
+ child.on("close", (code) => resolve({ code: code ?? 1, tail: tail.trim() }));
45
+ });
46
+ }
47
+ export const lastLine = (text) => text.split("\n").pop() ?? "";
48
+ /** Asks every half second until it is true or the time is over. */
49
+ export async function until(ready, ms) {
50
+ const deadline = Date.now() + ms;
51
+ while (Date.now() < deadline) {
52
+ if (await ready()) {
53
+ return true;
54
+ }
55
+ await sleep(500);
56
+ }
57
+ return false;
58
+ }
59
+ /** Free space where the models are kept (the home folder), in GB. */
60
+ export async function freeGb(dir = homedir()) {
61
+ try {
62
+ const stats = await statfs(dir);
63
+ return Math.floor((stats.bavail * stats.bsize) / 2 ** 30);
64
+ }
65
+ catch {
66
+ return null;
67
+ }
68
+ }
@@ -0,0 +1,9 @@
1
+ /** LM Studio's `lms` command: there once the app ran for the first time, or with `llmster`. */
2
+ export declare function findLms(env?: NodeJS.ProcessEnv): string | null;
3
+ /** LM Studio on this computer: its command, or the app that brings it. */
4
+ export declare function findLmStudio(): string | null;
5
+ /**
6
+ * Starts LM Studio's server. The app was never opened: it opens, and once the person is through
7
+ * its first start, its command is there and starts the server.
8
+ */
9
+ export declare function startLmStudio(logs: string, answers: () => Promise<boolean>): Promise<boolean>;
@@ -0,0 +1,52 @@
1
+ import { existsSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { executable, findOnPath, logged, until } from "./install.js";
5
+ /** The LM Studio app on a Mac. */
6
+ const MAC_APPS = ["/Applications/LM Studio.app", join(homedir(), "Applications", "LM Studio.app")];
7
+ const WINDOWS_APPS = ["LM Studio", join("Programs", "LM Studio")];
8
+ /** LM Studio's `lms` command: there once the app ran for the first time, or with `llmster`. */
9
+ export function findLms(env = process.env) {
10
+ const own = join(homedir(), ".lmstudio", "bin", process.platform === "win32" ? "lms.exe" : "lms");
11
+ return executable(own) ? own : findOnPath("lms", env.PATH ?? "");
12
+ }
13
+ /** The app on this computer. */
14
+ function findApp() {
15
+ if (process.platform === "darwin") {
16
+ return MAC_APPS.find((app) => existsSync(app)) ?? null;
17
+ }
18
+ const local = process.env.LOCALAPPDATA;
19
+ if (process.platform === "win32" && local) {
20
+ return (WINDOWS_APPS.map((dir) => join(local, dir, "LM Studio.exe")).find((app) => existsSync(app)) ??
21
+ null);
22
+ }
23
+ return null;
24
+ }
25
+ /** LM Studio on this computer: its command, or the app that brings it. */
26
+ export function findLmStudio() {
27
+ return findLms() ?? findApp();
28
+ }
29
+ /** The app's first start has its own pages, which the person goes through. */
30
+ const FIRST_START = 300_000;
31
+ /**
32
+ * Starts LM Studio's server. The app was never opened: it opens, and once the person is through
33
+ * its first start, its command is there and starts the server.
34
+ */
35
+ export async function startLmStudio(logs, answers) {
36
+ if (!findLms()) {
37
+ const app = findApp();
38
+ if (process.platform !== "darwin" || !app) {
39
+ return false;
40
+ }
41
+ await logged("open", [app], { logs });
42
+ const ready = async () => findLms() !== null || (await answers());
43
+ if (!(await until(ready, FIRST_START))) {
44
+ return false;
45
+ }
46
+ }
47
+ const lms = findLms();
48
+ if (lms && !(await answers())) {
49
+ await logged(lms, ["server", "start"], { logs });
50
+ }
51
+ return until(answers, 60_000);
52
+ }
@@ -0,0 +1,47 @@
1
+ import { type LocalServer } from "@engenty/local-models/servers";
2
+ import { type LocalModelsState, type OfferedModel, type ServerStatus } from "../types.js";
3
+ export interface LocalModelsOptions {
4
+ server: LocalServer;
5
+ /** Where the server answers: a root or `…/v1`. */
6
+ url: () => Promise<string> | string;
7
+ /** The models to download; null: the list is not reachable. */
8
+ offered: () => Promise<readonly OfferedModel[] | null> | readonly OfferedModel[] | null;
9
+ /** The share of the memory a model may take and still leave room for the rest. */
10
+ share: number;
11
+ /** A folder for the logs of an install. */
12
+ logs: () => string;
13
+ /** A model came or went, or the server started. */
14
+ changed?: () => void;
15
+ /** A download begins; what it answers runs once the download ended well. */
16
+ pulling?: (model: string) => Promise<() => Promise<void> | void>;
17
+ /** This computer's memory in bytes. */
18
+ memory?: () => number;
19
+ }
20
+ /**
21
+ * The models of a server on this computer: what is there and what each can do, what to download,
22
+ * the downloads and removals a page starts, and the server itself installed and started. Nothing
23
+ * here loads a model.
24
+ */
25
+ export declare class LocalModels {
26
+ private readonly options;
27
+ private readonly downloads;
28
+ /** While the server is being installed or started, and how that ended. */
29
+ private starting;
30
+ constructor(options: LocalModelsOptions);
31
+ get id(): "lmstudio" | "mlx" | "ollama";
32
+ private get app();
33
+ /** Whether it is on this computer, and whether it runs. */
34
+ status(): Promise<ServerStatus>;
35
+ state(): Promise<LocalModelsState>;
36
+ /** The models the server holds, with the jobs each can do here. */
37
+ private held;
38
+ /**
39
+ * Downloads a model in the background. A download of the same model that runs already is left
40
+ * to finish.
41
+ */
42
+ pull(model: string): Promise<void>;
43
+ /** Removes a model, and a download of it that failed; the server's reason where it refuses. */
44
+ remove(model: string): Promise<void>;
45
+ /** Installs the server where it is missing and the host can, and starts it, in the background. */
46
+ start(): void;
47
+ }
@@ -0,0 +1,164 @@
1
+ import { totalmem } from "node:os";
2
+ import { fits } from "@engenty/local-models/servers";
3
+ import { MODEL_JOBS, } from "../types.js";
4
+ import { freeGb } from "./install.js";
5
+ import { SERVER_APPS } from "./server-apps.js";
6
+ /** The job a capability serves. */
7
+ const JOB_OF = {
8
+ completion: "text",
9
+ embedding: "search",
10
+ decision: "decision",
11
+ };
12
+ const gb = (bytes) => Math.round((bytes / 1e9) * 10) / 10;
13
+ /**
14
+ * The models of a server on this computer: what is there and what each can do, what to download,
15
+ * the downloads and removals a page starts, and the server itself installed and started. Nothing
16
+ * here loads a model.
17
+ */
18
+ export class LocalModels {
19
+ options;
20
+ downloads = new Map();
21
+ /** While the server is being installed or started, and how that ended. */
22
+ starting = null;
23
+ constructor(options) {
24
+ this.options = options;
25
+ }
26
+ get id() {
27
+ return this.options.server.id;
28
+ }
29
+ get app() {
30
+ return SERVER_APPS[this.id];
31
+ }
32
+ /** Whether it is on this computer, and whether it runs. */
33
+ async status() {
34
+ const { server, url } = this.options;
35
+ const { running } = await server.state(await url());
36
+ return {
37
+ id: server.id,
38
+ name: server.name,
39
+ installed: running || this.app.find() !== null,
40
+ running,
41
+ };
42
+ }
43
+ async state() {
44
+ const { options } = this;
45
+ const { server } = options;
46
+ const url = await options.url();
47
+ const { running, version, trouble } = await server.state(url);
48
+ const bytes = options.memory?.() ?? totalmem();
49
+ const memory = Math.round(bytes / 2 ** 30);
50
+ const installed = running ? await this.held(url, bytes) : [];
51
+ const names = new Set(installed.map((m) => m.name));
52
+ const list = await options.offered();
53
+ return {
54
+ server: {
55
+ id: server.id,
56
+ name: server.name,
57
+ installed: running || this.app.find() !== null,
58
+ running,
59
+ url,
60
+ version,
61
+ trouble,
62
+ canInstall: this.app.install !== undefined,
63
+ download: this.app.download,
64
+ removes: server.remove !== undefined,
65
+ start: this.starting,
66
+ },
67
+ memory,
68
+ free: await freeGb(),
69
+ installed,
70
+ offered: list?.map((m) => ({
71
+ ...m,
72
+ installed: names.has(m.name) || names.has(`${m.name}:latest`),
73
+ fits: fits(m.memory, memory, options.share),
74
+ })) ?? null,
75
+ downloads: [...this.downloads.values()],
76
+ };
77
+ }
78
+ /** The models the server holds, with the jobs each can do here. */
79
+ async held(url, memory) {
80
+ return (await this.options.server.models(url)).map((m) => ({
81
+ name: m.name,
82
+ size: gb(m.size),
83
+ jobs: MODEL_JOBS.filter((job) => m.capabilities.some((c) => JOB_OF[c] === job)),
84
+ capabilities: m.capabilities,
85
+ runner: m.runner,
86
+ quantization: m.quantization,
87
+ fits: fits(m.size, memory, this.options.share),
88
+ loaded: m.running,
89
+ }));
90
+ }
91
+ /**
92
+ * Downloads a model in the background. A download of the same model that runs already is left
93
+ * to finish.
94
+ */
95
+ async pull(model) {
96
+ const running = this.downloads.get(model);
97
+ if (running && !running.finished) {
98
+ return;
99
+ }
100
+ const state = { model, done: 0, total: 0, error: null, finished: false };
101
+ this.downloads.set(model, state);
102
+ const pulled = await this.options.pulling?.(model);
103
+ void this.options.server
104
+ .download(await this.options.url(), model, (done, total) => {
105
+ state.done = done;
106
+ state.total = total;
107
+ })
108
+ .then(async () => {
109
+ this.options.changed?.();
110
+ state.finished = true;
111
+ // A finished download is done; the list shows the model itself now.
112
+ this.downloads.delete(model);
113
+ await pulled?.();
114
+ })
115
+ .catch((err) => {
116
+ const unreachable = /fetch failed|ECONNREFUSED/i.test(`${err.message} ${err.cause ?? ""}`);
117
+ state.error = unreachable ? "unreachable" : err.message;
118
+ state.finished = true;
119
+ });
120
+ }
121
+ /** Removes a model, and a download of it that failed; the server's reason where it refuses. */
122
+ async remove(model) {
123
+ const { server, url } = this.options;
124
+ this.downloads.delete(model);
125
+ this.options.changed?.();
126
+ if (!server.remove) {
127
+ throw new Error(`${server.name} removes its models itself.`);
128
+ }
129
+ await server.remove(await url(), model);
130
+ }
131
+ /** Installs the server where it is missing and the host can, and starts it, in the background. */
132
+ start() {
133
+ if (this.starting?.running) {
134
+ return;
135
+ }
136
+ const state = { running: true, error: null };
137
+ this.starting = state;
138
+ const { server, url, logs, changed } = this.options;
139
+ const folder = logs();
140
+ void (async () => {
141
+ if (!this.app.find()) {
142
+ if (!this.app.install) {
143
+ throw new Error(`${server.name} isn’t on this computer.`);
144
+ }
145
+ const outcome = await this.app.install(folder, () => undefined);
146
+ if (!outcome.ok) {
147
+ throw new Error(outcome.message);
148
+ }
149
+ }
150
+ const address = await url();
151
+ const answers = async () => (await server.state(address)).running;
152
+ if (!(await this.app.start(folder, answers))) {
153
+ throw new Error(`${server.name} isn’t answering.`);
154
+ }
155
+ changed?.();
156
+ })()
157
+ .catch((err) => {
158
+ state.error = err.message;
159
+ })
160
+ .finally(() => {
161
+ state.running = false;
162
+ });
163
+ }
164
+ }
@@ -0,0 +1,12 @@
1
+ /** Where a host keeps which sources a test call has worked on. */
2
+ export interface TestedStore {
3
+ read(): Promise<readonly string[]>;
4
+ write(sources: string[]): Promise<void>;
5
+ }
6
+ /** The sources a test call has worked on: the setup is done for those, not for the others. */
7
+ export declare class Tested {
8
+ private readonly store;
9
+ constructor(store: TestedStore);
10
+ has(source: string): Promise<boolean>;
11
+ mark(source: string): Promise<void>;
12
+ }
@@ -0,0 +1,16 @@
1
+ /** The sources a test call has worked on: the setup is done for those, not for the others. */
2
+ export class Tested {
3
+ store;
4
+ constructor(store) {
5
+ this.store = store;
6
+ }
7
+ async has(source) {
8
+ return (await this.store.read()).includes(source);
9
+ }
10
+ async mark(source) {
11
+ const tested = await this.store.read();
12
+ if (!tested.includes(source)) {
13
+ await this.store.write([...tested, source]);
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,22 @@
1
+ import { type Outcome } from "./install.js";
2
+ /** The `ollama` command: on the PATH, or inside the app on a Mac that never linked it. */
3
+ export declare function findOllama(env?: NodeJS.ProcessEnv): string | null;
4
+ /**
5
+ * Installs Ollama. On a Mac its app goes into Applications (~/Applications where that is not
6
+ * writable) and asks for no password; on Linux Ollama's own script runs in this terminal and
7
+ * asks for one, as it installs a system service.
8
+ */
9
+ export declare function installOllama(logs: string, onLine: (line: string) => void): Promise<Outcome>;
10
+ /**
11
+ * Whether the Ollama app asks for the Mac's password when it starts: the first time, it wants to
12
+ * link its `ollama` command into /usr/local/bin, and its server waits for the answer (cancel
13
+ * works too). Not once that link points into the app.
14
+ */
15
+ export declare function appAsksForPassword(path: string | null): boolean;
16
+ /**
17
+ * Starts Ollama's server where it does not run: the app on a Mac (it then starts at login by
18
+ * itself), Homebrew's service, else `ollama serve` in the background. Its version once it
19
+ * answers; null where it does not in time — three minutes for the app, which may wait for a
20
+ * password, half a minute otherwise.
21
+ */
22
+ export declare function startOllama(path: string | null, logs: string): Promise<string | null>;