@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,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useRef, useState } from "react";
3
+ import { setupText } from "../texts.js";
4
+ const Host = createContext(null);
5
+ export function SetupProvider({ host, children }) {
6
+ return _jsx(Host.Provider, { value: host, children: children });
7
+ }
8
+ export function useSetupHost() {
9
+ const host = useContext(Host);
10
+ if (!host) {
11
+ throw new Error("The setup's parts need a SetupProvider.");
12
+ }
13
+ return host;
14
+ }
15
+ /** The setup's words in the host's language. */
16
+ export function useText() {
17
+ const { lang } = useSetupHost();
18
+ return useCallback((key, vars) => setupText(lang, key, vars), [lang]);
19
+ }
20
+ /** A call the person starts: whether it runs, what came of it. A newer call replaces an older one. */
21
+ export function useCall(call) {
22
+ const [state, setState] = useState({ busy: false });
23
+ const latest = useRef(call);
24
+ latest.current = call;
25
+ const round = useRef(0);
26
+ const run = useCallback(async (...args) => {
27
+ const mine = ++round.current;
28
+ setState({ busy: true });
29
+ try {
30
+ const data = await latest.current(...args);
31
+ if (mine === round.current) {
32
+ setState({ busy: false, data });
33
+ }
34
+ return data;
35
+ }
36
+ catch (err) {
37
+ if (mine === round.current) {
38
+ setState({ busy: false, error: err.message });
39
+ }
40
+ return undefined;
41
+ }
42
+ }, []);
43
+ const reset = useCallback(() => {
44
+ round.current++;
45
+ setState({ busy: false });
46
+ }, []);
47
+ return { ...state, run, reset };
48
+ }
@@ -0,0 +1,7 @@
1
+ export { ClientPanel, ModelTest, rankClients, type TestResult, useClientChoices, useClientStage, } from "./client.js";
2
+ export { Choice, type SetupChoice, SetupColumns, type SetupPanel, SetupReady, Stages, } from "./columns.js";
3
+ export { type SetupHostApi, SetupProvider, useCall, useSetupHost, useText } from "./host.js";
4
+ export { type KeyProvider, OwnKeys, ServerAddress, type SourceResult } from "./keys.js";
5
+ export { LocalModels, modelsMoving } from "./local-models.js";
6
+ export { useServerChoices } from "./servers.js";
7
+ export { SETUP_GROUND, SETUP_GROUND_INK, SETUP_ON_GROUND, SETUP_ON_PAPER, SETUP_ON_THEME, } from "./tone.js";
@@ -0,0 +1,7 @@
1
+ export { ClientPanel, ModelTest, rankClients, useClientChoices, useClientStage, } from "./client.js";
2
+ export { Choice, SetupColumns, SetupReady, Stages, } from "./columns.js";
3
+ export { SetupProvider, useCall, useSetupHost, useText } from "./host.js";
4
+ export { OwnKeys, ServerAddress } from "./keys.js";
5
+ export { LocalModels, modelsMoving } from "./local-models.js";
6
+ export { useServerChoices } from "./servers.js";
7
+ export { SETUP_GROUND, SETUP_GROUND_INK, SETUP_ON_GROUND, SETUP_ON_PAPER, SETUP_ON_THEME, } from "./tone.js";
@@ -0,0 +1,48 @@
1
+ import type { ServerId } from "@engenty/local-models/servers";
2
+ import { type ReactNode } from "react";
3
+ /** What the test of a key or of a server answered. */
4
+ export interface SourceResult {
5
+ ok: boolean;
6
+ message: string | null;
7
+ /** The model the app now writes with; null where none does. */
8
+ text: string | null;
9
+ }
10
+ /** A provider whose key the setup takes. */
11
+ export interface KeyProvider {
12
+ id: string;
13
+ name: string;
14
+ keyUrl: string;
15
+ keyPlaceholder: string;
16
+ /** A key is stored. */
17
+ stored: boolean;
18
+ }
19
+ interface Names {
20
+ /** A model's name as the person reads it. */
21
+ modelName?: (ref: string) => string;
22
+ /** Whether the model a test answered with runs on this row. */
23
+ mine: (ref: string) => boolean;
24
+ }
25
+ /**
26
+ * Own keys, each tested on its own: a key that works is stored and put to use, and the first one
27
+ * ends the setup.
28
+ */
29
+ export declare function OwnKeys({ providers, isOf, modelName, onRemove, hint, later, children, }: {
30
+ providers: readonly KeyProvider[];
31
+ /** Whether a model runs on a provider's key. */
32
+ isOf: (ref: string, provider: string) => boolean;
33
+ modelName?: (ref: string) => string;
34
+ onRemove: (provider: string) => Promise<unknown>;
35
+ hint?: string;
36
+ /** Below the rows: where to change it later. */
37
+ later?: string;
38
+ /** More rows. */
39
+ children?: ReactNode;
40
+ }): import("react").JSX.Element;
41
+ /** A server for open models at an address of the person's. */
42
+ export declare function ServerAddress({ id, name, url: saved, modelName, }: {
43
+ id: ServerId;
44
+ name: string;
45
+ url: string;
46
+ modelName?: Names["modelName"];
47
+ }): import("react").JSX.Element;
48
+ export {};
@@ -0,0 +1,74 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, cn, Input, Label } from "@engenty/chatviews/react/ui";
3
+ import { Check, ExternalLink } from "lucide-react";
4
+ import { useState } from "react";
5
+ import { useCall, useSetupHost, useText } from "./host.js";
6
+ /**
7
+ * Own keys, each tested on its own: a key that works is stored and put to use, and the first one
8
+ * ends the setup.
9
+ */
10
+ export function OwnKeys({ providers, isOf, modelName, onRemove, hint, later, children, }) {
11
+ const t = useText();
12
+ return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { children: [_jsx(Label, { children: t("local.keys") }), _jsx("p", { className: "text-[0.8125rem] text-ink-3", children: hint ?? t("local.keysHint") })] }), _jsxs("div", { className: "flex flex-col", children: [providers.map((provider) => (_jsx(KeyRow, { provider: provider, modelName: modelName, mine: (ref) => isOf(ref, provider.id), onRemove: () => onRemove(provider.id) }, provider.id))), children] }), later ? _jsx("p", { className: "text-[0.8125rem] text-ink-3", children: later }) : null] }));
13
+ }
14
+ function useSourceTest(path) {
15
+ const host = useSetupHost();
16
+ return useCall(async (body) => {
17
+ const result = await host.post(path, body);
18
+ // A working key ends the setup: the page learns it.
19
+ await host.changed();
20
+ return result;
21
+ });
22
+ }
23
+ function KeyRow({ provider, onRemove, ...names }) {
24
+ const host = useSetupHost();
25
+ const t = useText();
26
+ const [value, setValue] = useState("");
27
+ const test = useSourceTest(`/keys/${provider.id}`);
28
+ // A stored key is tested again with an empty field; a working new one leaves the field.
29
+ const run = async () => {
30
+ const result = await test.run(value.trim() ? { key: value.trim() } : {});
31
+ if (result?.ok) {
32
+ setValue("");
33
+ }
34
+ };
35
+ const remove = useCall(async () => {
36
+ await onRemove();
37
+ test.reset();
38
+ await host.changed();
39
+ });
40
+ return (_jsx(Row, { label: provider.name, sub: _jsxs("button", { type: "button", onClick: () => host.open(provider.keyUrl), className: "inline-flex items-center gap-1 text-left hover:text-ink-2 hover:underline", children: [t("local.keyGet"), " ", _jsx(ExternalLink, { className: "size-3" })] }), input: _jsx(Input, { type: "password", autoComplete: "off", "aria-label": provider.name, className: "min-w-0 flex-1 font-mono text-[0.8125rem]", placeholder: provider.stored ? t("local.keySet") : provider.keyPlaceholder, value: value, onChange: (e) => setValue(e.target.value), onKeyDown: (e) => {
41
+ if (e.key === "Enter" && value.trim()) {
42
+ void run();
43
+ }
44
+ } }), actions: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", busy: test.busy, disabled: !provider.stored && !value.trim(), onClick: () => void run(), children: t("local.test") }), provider.stored ? (_jsx(Button, { variant: "ghost", size: "sm", busy: remove.busy, onClick: () => void remove.run(), children: t("local.keyRemove") })) : null] }), said: useSaid(test, names) }));
45
+ }
46
+ /** A server for open models at an address of the person's. */
47
+ export function ServerAddress({ id, name, url: saved, modelName, }) {
48
+ const t = useText();
49
+ const [url, setUrl] = useState(saved);
50
+ const test = useSourceTest(`/servers/${id}/address`);
51
+ return (_jsx(Row, { label: t("local.address"), sub: t("local.serverWhere"), input: _jsx(Input, { "aria-label": name, className: "min-w-0 flex-1 font-mono text-[0.8125rem]", value: url, onChange: (e) => setUrl(e.target.value) }), actions: _jsx(Button, { variant: "secondary", busy: test.busy, disabled: !url.trim(), onClick: () => void test.run({ url: url.trim() }), children: t("local.test") }), said: useSaid(test, { modelName, mine: (ref) => ref.startsWith(`${id}:`) }) }));
52
+ }
53
+ /** The line under a row once its test answered. */
54
+ function useSaid(test, { mine, modelName }) {
55
+ const t = useText();
56
+ if (test.error) {
57
+ return { ok: false, text: test.error };
58
+ }
59
+ const r = test.data;
60
+ if (!r) {
61
+ return null;
62
+ }
63
+ if (!r.ok) {
64
+ return { ok: false, text: r.message ?? t("setup.keyBad") };
65
+ }
66
+ if (!r.text) {
67
+ return { ok: true, text: t("local.keyWorksPlain") };
68
+ }
69
+ const model = modelName?.(r.text) ?? r.text;
70
+ return { ok: true, text: t(mine(r.text) ? "local.keyWorks" : "local.keyWorksOther", { model }) };
71
+ }
72
+ function Row({ label, sub, input, actions, said, }) {
73
+ return (_jsxs("div", { className: "grid gap-x-3 gap-y-1.5 border-border-soft border-t py-3 sm:grid-cols-[10rem_minmax(0,1fr)]", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[0.875rem] text-ink-2", children: label }), _jsx("div", { className: "text-[0.75rem] text-ink-4", children: sub })] }), _jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [input, actions] }), said ? (_jsxs("p", { className: cn("flex items-start gap-1.5 text-[0.8125rem]", said.ok ? "text-moss" : "text-rose"), children: [said.ok ? _jsx(Check, { className: "mt-0.5 size-3.5 shrink-0", strokeWidth: 3 }) : null, said.text] })) : null] })] }));
74
+ }
@@ -0,0 +1,23 @@
1
+ import { type LocalModelsState, type ModelJob } from "../types.js";
2
+ /** Whether the state is still changing: a download runs, or the server starts. */
3
+ export declare function modelsMoving(state: LocalModelsState | undefined): boolean;
4
+ /**
5
+ * The models of a server on this computer. For one job: the ones there (to use or remove), the
6
+ * ones offered (to download and use), and any other name the server knows. Without a job, all of
7
+ * them with the jobs each serves, to download or remove. Where the server does not run, a way to
8
+ * start it — or to get it.
9
+ */
10
+ export declare function LocalModels({ state, onState, job, inUse, disabled, onChoose, onlyHeld, }: {
11
+ /** As `GET /servers/:id` answers it; asked again while `modelsMoving`. */
12
+ state: LocalModelsState | undefined;
13
+ /** What a change answered. */
14
+ onState: (next: LocalModelsState) => void;
15
+ /** Absent: every job, and nothing to choose. */
16
+ job?: ModelJob;
17
+ /** The models in use; they are not removed. */
18
+ inUse: string[];
19
+ disabled?: boolean;
20
+ onChoose?: (model: string) => void;
21
+ /** Only a model that is there is chosen; a download only downloads. */
22
+ onlyHeld?: boolean;
23
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,134 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, cn, Input } from "@engenty/chatviews/react/ui";
3
+ import { ExternalLink, Trash2 } from "lucide-react";
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { MODEL_JOBS } from "../types.js";
6
+ import { useCall, useSetupHost, useText } from "./host.js";
7
+ /** Ollama's own installer on Linux, which asks for a password in a terminal. */
8
+ const OLLAMA_ON_LINUX = "curl -fsSL https://ollama.com/install.sh | sh";
9
+ /** What the free field takes, by server. */
10
+ const EXAMPLE = {
11
+ ollama: "llama3.2:3b",
12
+ lmstudio: "openai/gpt-oss-20b",
13
+ mlx: "mlx-community/Qwen3-8B-4bit",
14
+ };
15
+ /** A job's name. */
16
+ const JOB_LABEL = {
17
+ text: "models.cap.text",
18
+ search: "models.cap.search",
19
+ decision: "models.cap.decision",
20
+ };
21
+ /** Whether the state is still changing: a download runs, or the server starts. */
22
+ export function modelsMoving(state) {
23
+ return Boolean(state && (state.downloads.some((d) => !d.finished) || state.server.start?.running));
24
+ }
25
+ /** What a model can do beyond its job, as chips. */
26
+ const CAP_CHIPS = ["vision", "audio", "tools"];
27
+ /** Numbers as the host's language writes them. */
28
+ function useNumbers() {
29
+ const { lang } = useSetupHost();
30
+ return {
31
+ mb: (bytes) => Math.round(bytes / 1e6).toLocaleString(lang),
32
+ gb: (n) => n.toLocaleString(lang, { maximumFractionDigits: 1 }),
33
+ };
34
+ }
35
+ /** Ollama names a model without a tag as `name:latest`. */
36
+ const sameModel = (a, b) => a === b || a === `${b}:latest` || `${a}:latest` === b;
37
+ function Chip({ children, tone }) {
38
+ return (_jsx("span", { className: cn("inline-flex min-h-5 items-center rounded-full px-2 py-[3px] text-[0.6875rem] leading-tight", tone === "done" ? "bg-moss-tint text-moss" : "bg-paper-2 text-ink-3"), children: children }));
39
+ }
40
+ function Group({ title, children }) {
41
+ return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[0.75rem] text-ink-3", children: title }), _jsx("div", { className: "flex flex-col divide-y divide-border-soft rounded-xl border border-border-soft", children: children })] }));
42
+ }
43
+ function Row({ children, actions }) {
44
+ return (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2 px-3 py-2.5", children: [_jsx("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: children }), _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })] }));
45
+ }
46
+ function DownloadState({ download, server }) {
47
+ const t = useText();
48
+ const { mb } = useNumbers();
49
+ if (download.error) {
50
+ return (_jsx("p", { className: "text-[0.8125rem] text-rose", children: download.error === "unreachable"
51
+ ? t("models.local.downloadUnreachable", { name: server })
52
+ : t("models.local.downloadFailed", { error: download.error }) }));
53
+ }
54
+ return (_jsx("span", { className: "text-[0.8125rem] text-ink-2 tabular-nums", children: download.total
55
+ ? t("models.local.progress", { done: mb(download.done), total: mb(download.total) })
56
+ : t("models.local.starting") }));
57
+ }
58
+ /**
59
+ * The models of a server on this computer. For one job: the ones there (to use or remove), the
60
+ * ones offered (to download and use), and any other name the server knows. Without a job, all of
61
+ * them with the jobs each serves, to download or remove. Where the server does not run, a way to
62
+ * start it — or to get it.
63
+ */
64
+ export function LocalModels({ state, onState, job, inUse, disabled, onChoose, onlyHeld = false, }) {
65
+ const host = useSetupHost();
66
+ const t = useText();
67
+ const { gb } = useNumbers();
68
+ const path = `/servers/${state?.server.id}`;
69
+ const [other, setOther] = useState("");
70
+ /** The model whose removal waits for a yes. */
71
+ const [asking, setAsking] = useState(null);
72
+ const pull = useCall(async (model) => onState(await host.post(`${path}/pull`, { model })));
73
+ const remove = useCall(async (model) => onState((await host.del(`${path}/models?model=${encodeURIComponent(model)}`))));
74
+ const start = useCall(async () => onState(await host.post(`${path}/start`, {})));
75
+ // A model that arrived or went changes what can answer.
76
+ const held = state?.installed.map((m) => m.name).join(" ");
77
+ const known = useRef(held);
78
+ const changed = useRef(host.changed);
79
+ changed.current = host.changed;
80
+ useEffect(() => {
81
+ if (known.current !== undefined && held !== undefined && known.current !== held) {
82
+ void changed.current();
83
+ }
84
+ known.current = held;
85
+ }, [held]);
86
+ if (!state) {
87
+ return null;
88
+ }
89
+ const { server } = state;
90
+ const { name } = server;
91
+ if (!server.running) {
92
+ const starting = Boolean(server.start?.running) || start.busy;
93
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("p", { className: "text-[0.8125rem] text-ink-2", children: t(server.installed ? "models.local.stopped" : "models.local.notHere", { name }) }), server.installed || server.canInstall ? (_jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [_jsx(Button, { busy: starting, disabled: disabled || starting, onClick: () => void start.run(), children: t(server.installed ? "models.local.start" : "models.local.install", { name }) }), starting ? (_jsx("span", { className: "text-[0.8125rem] text-ink-2", children: server.id === "mlx" ? null : t(`models.local.starts.${server.id}`) })) : null] })) : (_jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [_jsxs(Button, { onClick: () => host.open(server.download), children: [t("models.local.get", { name }), " ", _jsx(ExternalLink, { className: "size-3.5" })] }), server.id === "ollama" ? (_jsxs("span", { className: "text-[0.8125rem] text-ink-2", children: [t("harness.install"), " ", _jsx("code", { className: "font-mono text-[0.75rem]", children: OLLAMA_ON_LINUX })] })) : null] })), server.start?.error ? (_jsx("p", { className: "text-[0.8125rem] text-rose", children: t("models.local.startFailed", { name, error: server.start.error }) })) : null] }));
94
+ }
95
+ if (server.trouble) {
96
+ return (_jsx("p", { className: "text-[0.8125rem] text-rose", children: t(`models.local.trouble.${server.trouble}`, { name }) }));
97
+ }
98
+ const downloadOf = (model) => state.downloads.find((d) => sameModel(d.model, model));
99
+ const use = (model) => {
100
+ if (!state.installed.some((m) => sameModel(m.name, model))) {
101
+ void pull.run(model);
102
+ if (onlyHeld) {
103
+ return;
104
+ }
105
+ }
106
+ onChoose?.(model);
107
+ };
108
+ const choosesNew = Boolean(onChoose) && !onlyHeld;
109
+ const here = job ? state.installed.filter((m) => m.jobs.includes(job)) : state.installed;
110
+ const offered = state.offered?.filter((m) => (job ? m.job === job : true) && !m.installed) ?? null;
111
+ // Per job, the first one that fits this computer.
112
+ const suggested = new Set(MODEL_JOBS.map((j) => offered?.find((m) => m.job === j && m.fits)?.name));
113
+ // Downloads of names from the free field, which no list shows.
114
+ const others = state.downloads.filter((d) => !(here.some((m) => sameModel(m.name, d.model)) || offered?.some((m) => m.name === d.model)));
115
+ return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Group, { title: [t("models.local.here"), [name, server.version].filter(Boolean).join(" ")].join(" · "), children: here.length ? (here.map((m) => {
116
+ const used = inUse.some((name) => sameModel(m.name, name));
117
+ return (_jsxs(Row, { actions: _jsxs(_Fragment, { children: [used ? (_jsx(Chip, { tone: "done", children: t("models.local.inUse") })) : !onChoose ? null : (_jsx(Button, { variant: "secondary", size: "sm", disabled: disabled, onClick: () => onChoose(m.name), children: t("models.local.use") })), asking === m.name || !server.removes ? null : (_jsx("button", { type: "button", className: "grid size-8 place-items-center rounded-lg text-ink-3 hover:bg-paper-2 hover:text-rose disabled:opacity-50", title: t("models.local.remove", { name }), "aria-label": t("models.local.remove", { name }), disabled: disabled || used || remove.busy, onClick: () => setAsking(m.name), children: _jsx(Trash2, { className: "size-4" }) }))] }), children: [_jsx("span", { className: "break-all font-mono text-[0.8125rem]", children: m.name }), _jsxs("span", { className: "flex flex-wrap gap-1", children: [job ? null : m.jobs.map((j) => _jsx(Chip, { children: t(JOB_LABEL[j]) }, j)), _jsx(Chip, { children: t("models.local.size", { size: gb(m.size) }) }), m.runner === "mlx" ? _jsx(Chip, { children: "MLX" }) : null, CAP_CHIPS.filter((c) => m.capabilities.includes(c)).map((c) => (_jsx(Chip, { children: t(`models.local.cap.${c}`) }, c))), m.loaded ? _jsx(Chip, { tone: "done", children: t("models.local.loaded") }) : null, m.fits ? null : _jsx(Chip, { children: t("models.local.tooBig", { memory: gb(m.size) }) })] }), asking === m.name ? (_jsxs("span", { className: "flex flex-wrap items-center gap-2 text-[0.8125rem] text-ink-2", children: [t("models.local.removeConfirm", {
118
+ name: m.name,
119
+ server: name,
120
+ size: gb(m.size),
121
+ }), _jsx(Button, { variant: "danger", size: "sm", busy: remove.busy, onClick: async () => {
122
+ await remove.run(m.name);
123
+ setAsking(null);
124
+ }, children: t("models.local.removeYes") }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setAsking(null), children: t("setup.cancel") })] })) : null] }, m.name));
125
+ })) : (_jsx("p", { className: "px-3 py-2.5 text-[0.8125rem] text-ink-3", children: t("models.local.hereNone") })) }), remove.error ? (_jsx("p", { className: "text-[0.8125rem] text-rose", children: t("models.local.removeFailed", { name, error: remove.error }) })) : null, server.removes || !here.length ? null : (_jsx("p", { className: "text-[0.8125rem] text-ink-3", children: t("models.local.removeThere", { name }) })), offered === null ? (_jsx("p", { className: "text-[0.8125rem] text-ink-3", children: t("models.local.offeredNone") })) : offered.length ? (_jsx(Group, { title: t("models.local.offered"), children: offered.map((m) => {
126
+ const download = downloadOf(m.name);
127
+ const running = Boolean(download && !download.finished);
128
+ return (_jsxs(Row, { actions: running && download ? (_jsx(DownloadState, { download: download, server: name })) : (_jsx(Button, { variant: suggested.has(m.name) ? "primary" : "secondary", size: "sm", disabled: disabled, onClick: () => use(m.name), children: choosesNew ? t("models.local.download") : t("models.local.downloadOnly") })), children: [_jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "break-all font-mono text-[0.8125rem]", children: m.name }), suggested.has(m.name) ? (_jsx(Chip, { tone: "done", children: t("models.local.suggested") })) : null] }), _jsx("span", { className: "text-[0.8125rem] text-ink-2", children: m.note[host.lang] }), _jsxs("span", { className: "flex flex-wrap gap-1", children: [job ? null : _jsx(Chip, { children: t(JOB_LABEL[m.job]) }), _jsx(Chip, { children: t("models.local.size", { size: gb(m.size) }) }), m.fits ? null : (_jsx(Chip, { children: t("models.local.tooBig", { memory: gb(m.memory) }) }))] }), download?.error ? _jsx(DownloadState, { download: download, server: name }) : null] }, m.name));
129
+ }) })) : null, _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[0.75rem] text-ink-3", children: t("models.local.other", { name }) }), _jsxs("form", { className: "grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto]", onSubmit: (e) => {
130
+ e.preventDefault();
131
+ use(other.trim());
132
+ setOther("");
133
+ }, children: [_jsx(Input, { className: "font-mono text-[0.8125rem]", value: other, placeholder: t("models.local.example", { model: EXAMPLE[server.id] }), disabled: disabled, onChange: (e) => setOther(e.target.value) }), _jsx(Button, { type: "submit", variant: "secondary", disabled: disabled || !other.trim(), children: choosesNew ? t("models.local.use") : t("models.local.downloadOnly") })] }), others.map((d) => (_jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "font-mono text-[0.8125rem]", children: d.model }), _jsx(DownloadState, { download: d, server: name })] }, d.model)))] })] }));
134
+ }
@@ -0,0 +1,4 @@
1
+ import type { ServerStatus } from "../types.js";
2
+ import type { SetupChoice } from "./columns.js";
3
+ /** The servers for open models as rows of the list; one that is not on this computer is among the rest. */
4
+ export declare function useServerChoices(servers: readonly ServerStatus[]): SetupChoice[];
@@ -0,0 +1,13 @@
1
+ import { useText } from "./host.js";
2
+ /** The servers for open models as rows of the list; one that is not on this computer is among the rest. */
3
+ export function useServerChoices(servers) {
4
+ const t = useText();
5
+ return servers.map((server) => ({
6
+ id: server.id,
7
+ title: server.name,
8
+ description: t("server.desc"),
9
+ ...(server.installed
10
+ ? { note: t("server.here") }
11
+ : { note: t("harness.notInstalled"), more: true }),
12
+ }));
13
+ }
@@ -0,0 +1,13 @@
1
+ import "@xterm/xterm/css/xterm.css";
2
+ /**
3
+ * A terminal of the host, shown inline: what the command prints arrives as a stream, every key
4
+ * goes back to it. The host keeps the session; this is its screen and keyboard.
5
+ */
6
+ export default function Terminal({ id, onExit, onDone, className, }: {
7
+ id: string;
8
+ /** The command ended with this exit code. */
9
+ onExit?: (code: number) => void;
10
+ /** The command did what it was started for; it may still be running. */
11
+ onDone?: () => void;
12
+ className?: string;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,79 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FitAddon } from "@xterm/addon-fit";
3
+ import { WebLinksAddon } from "@xterm/addon-web-links";
4
+ import { Terminal as Xterm } from "@xterm/xterm";
5
+ import "@xterm/xterm/css/xterm.css";
6
+ import { cn } from "@engenty/chatviews/react/ui";
7
+ import { useEffect, useRef } from "react";
8
+ import { useSetupHost } from "./host.js";
9
+ /**
10
+ * A terminal of the host, shown inline: what the command prints arrives as a stream, every key
11
+ * goes back to it. The host keeps the session; this is its screen and keyboard.
12
+ */
13
+ export default function Terminal({ id, onExit, onDone, className, }) {
14
+ const el = useRef(null);
15
+ const api = useRef(useSetupHost());
16
+ const exit = useRef(onExit);
17
+ exit.current = onExit;
18
+ const done = useRef(onDone);
19
+ done.current = onDone;
20
+ useEffect(() => {
21
+ const at = el.current;
22
+ if (!at) {
23
+ return;
24
+ }
25
+ const host = api.current;
26
+ const term = new Xterm({
27
+ fontSize: 13,
28
+ lineHeight: 1.2,
29
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
30
+ cursorBlink: true,
31
+ scrollback: 3000,
32
+ theme: {
33
+ background: "#0f1424",
34
+ foreground: "#e6e9f2",
35
+ cursor: "#f0b35b",
36
+ selectionBackground: "#2f3a5f",
37
+ },
38
+ });
39
+ const fit = new FitAddon();
40
+ term.loadAddon(fit);
41
+ // A sign-in link the browser did not open by itself: a click opens it.
42
+ term.loadAddon(new WebLinksAddon((_event, uri) => host.open(uri)));
43
+ term.open(at);
44
+ const path = `/terminal/${id}`;
45
+ const quiet = () => undefined;
46
+ const sync = () => {
47
+ try {
48
+ fit.fit();
49
+ }
50
+ catch {
51
+ // not laid out yet
52
+ }
53
+ void host.post(`${path}/resize`, { cols: term.cols, rows: term.rows }).catch(quiet);
54
+ };
55
+ sync();
56
+ const observer = new ResizeObserver(sync);
57
+ observer.observe(at);
58
+ const input = term.onData((data) => void host.post(`${path}/input`, { data }).catch(quiet));
59
+ const stop = host.follow(id, (event) => {
60
+ if (event.type === "data") {
61
+ term.write(event.data);
62
+ }
63
+ else if (event.type === "done") {
64
+ done.current?.();
65
+ }
66
+ else {
67
+ exit.current?.(event.code);
68
+ }
69
+ });
70
+ term.focus();
71
+ return () => {
72
+ stop();
73
+ observer.disconnect();
74
+ input.dispose();
75
+ term.dispose();
76
+ };
77
+ }, [id]);
78
+ return (_jsx("div", { ref: el, className: cn("h-[28rem] max-h-[60dvh] w-full overflow-hidden rounded-lg bg-[#0f1424] p-2", className) }));
79
+ }
@@ -0,0 +1,13 @@
1
+ import type { CSSProperties } from "react";
2
+ /** The studio's vivid ground and the text on white, as on the landing page. */
3
+ export declare const SETUP_GROUND = "oklch(50% 0.2 262)";
4
+ export declare const SETUP_GROUND_INK = "oklch(32% 0.15 262)";
5
+ /**
6
+ * The setup's own colours, set on an element around it. On the vivid ground: white on it, and
7
+ * secondary text, checks and errors a step brighter than the dark theme's.
8
+ */
9
+ export declare const SETUP_ON_GROUND: CSSProperties;
10
+ /** On the theme's light paper: the ground's blue marks the pick. */
11
+ export declare const SETUP_ON_PAPER: CSSProperties;
12
+ /** On whatever ground the theme has: the pick stands in the theme's ink. */
13
+ export declare const SETUP_ON_THEME: CSSProperties;
@@ -0,0 +1,66 @@
1
+ /** The studio's vivid ground and the text on white, as on the landing page. */
2
+ export const SETUP_GROUND = "oklch(50% 0.2 262)";
3
+ export const SETUP_GROUND_INK = "oklch(32% 0.15 262)";
4
+ const CREAM = "oklch(90% 0.1 80)";
5
+ /**
6
+ * The setup's own colours, set on an element around it. On the vivid ground: white on it, and
7
+ * secondary text, checks and errors a step brighter than the dark theme's.
8
+ */
9
+ export const SETUP_ON_GROUND = {
10
+ "--on": "white",
11
+ "--tile": "rgb(255 255 255 / 0.1)",
12
+ "--tile-hover": "rgb(255 255 255 / 0.15)",
13
+ "--tile-ring": "rgb(255 255 255 / 0.15)",
14
+ "--panel": "rgb(255 255 255 / 0.07)",
15
+ "--panel-ring": "rgb(255 255 255 / 0.12)",
16
+ "--pick": "white",
17
+ "--pick-ink": SETUP_GROUND_INK,
18
+ "--pick-mark": SETUP_GROUND_INK,
19
+ "--badge": CREAM,
20
+ "--badge-ink": SETUP_GROUND_INK,
21
+ "--dot": CREAM,
22
+ "--step-done": "oklch(88% 0.17 150)",
23
+ "--step-now": "oklch(88% 0.14 80)",
24
+ "--ready-ink": "oklch(27% 0.09 150)",
25
+ "--ink-2": "oklch(96% 0.02 262)",
26
+ "--ink-3": "oklch(90% 0.035 262)",
27
+ "--ink-4": "oklch(82% 0.05 262)",
28
+ "--moss": "oklch(90% 0.14 150)",
29
+ "--rose": "oklch(89% 0.09 45)",
30
+ };
31
+ /** On the theme's light paper: the ground's blue marks the pick. */
32
+ export const SETUP_ON_PAPER = {
33
+ "--on": "var(--ink)",
34
+ "--tile": "var(--card)",
35
+ "--tile-hover": "var(--paper-2)",
36
+ "--tile-ring": "var(--border-soft)",
37
+ "--panel": "var(--card)",
38
+ "--panel-ring": "var(--border-soft)",
39
+ "--pick": SETUP_GROUND,
40
+ "--pick-ink": "white",
41
+ "--pick-mark": "white",
42
+ "--badge": CREAM,
43
+ "--badge-ink": SETUP_GROUND_INK,
44
+ "--dot": SETUP_GROUND,
45
+ "--step-done": "oklch(52% 0.15 150)",
46
+ "--step-now": "oklch(60% 0.15 65)",
47
+ "--ready-ink": "white",
48
+ };
49
+ /** On whatever ground the theme has: the pick stands in the theme's ink. */
50
+ export const SETUP_ON_THEME = {
51
+ "--on": "var(--ink)",
52
+ "--tile": "var(--card)",
53
+ "--tile-hover": "var(--paper-2)",
54
+ "--tile-ring": "transparent",
55
+ "--panel": "var(--card)",
56
+ "--panel-ring": "transparent",
57
+ "--pick": "var(--ink)",
58
+ "--pick-ink": "var(--background)",
59
+ "--pick-mark": "var(--background)",
60
+ "--badge": "var(--primary)",
61
+ "--badge-ink": "var(--primary-foreground)",
62
+ "--dot": "var(--primary)",
63
+ "--step-done": "var(--moss)",
64
+ "--step-now": "var(--primary)",
65
+ "--ready-ink": "var(--background)",
66
+ };
@@ -0,0 +1,12 @@
1
+ import type { ClientEntry } from "../catalog.js";
2
+ /** Whether `<name>.app` is in one of the Mac's Applications folders. */
3
+ export declare function macAppPresent(name: string, roots?: string[]): boolean;
4
+ /** The client's desktop app, when it is on this Mac: its name, e.g. "Claude". */
5
+ export declare function vendorApp(client: ClientEntry, roots?: string[]): string | null;
6
+ /**
7
+ * The client the setup suggests among those not installed: the one whose app is on this Mac,
8
+ * as its subscription is most likely already paid for, else the first.
9
+ */
10
+ export declare function suggestedClient<T extends {
11
+ client: ClientEntry;
12
+ }>(missing: T[]): T | null;
@@ -0,0 +1,22 @@
1
+ import { existsSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ const APP_ROOTS = ["/Applications", join(homedir(), "Applications")];
5
+ /** Whether `<name>.app` is in one of the Mac's Applications folders. */
6
+ export function macAppPresent(name, roots = APP_ROOTS) {
7
+ return roots.some((root) => existsSync(join(root, `${name}.app`)));
8
+ }
9
+ /** The client's desktop app, when it is on this Mac: its name, e.g. "Claude". */
10
+ export function vendorApp(client, roots = APP_ROOTS) {
11
+ if (process.platform !== "darwin" || !client.app) {
12
+ return null;
13
+ }
14
+ return macAppPresent(client.app, roots) ? client.app : null;
15
+ }
16
+ /**
17
+ * The client the setup suggests among those not installed: the one whose app is on this Mac,
18
+ * as its subscription is most likely already paid for, else the first.
19
+ */
20
+ export function suggestedClient(missing) {
21
+ return missing.find((state) => vendorApp(state.client)) ?? missing[0] ?? null;
22
+ }
@@ -0,0 +1,55 @@
1
+ import { type Detectable } from "@engenty/local-models/clients";
2
+ import { type ClientId } from "../catalog.js";
3
+ import type { ClientSetupStatus } from "../types.js";
4
+ /** A client as the host runs it. */
5
+ export interface SetupClient extends Detectable {
6
+ id: ClientId;
7
+ name: string;
8
+ bin: string;
9
+ /**
10
+ * What the terminal runs to sign the client in. `interactive`: the client's own app opens and
11
+ * the person ends it; the terminal closes by itself once the sign-in is there.
12
+ */
13
+ login: {
14
+ args: string[];
15
+ env?: Record<string, string>;
16
+ interactive: boolean;
17
+ };
18
+ /** Set where the host makes images with it. */
19
+ image?: unknown;
20
+ }
21
+ /** A command for a terminal. */
22
+ export interface TerminalCommand {
23
+ bin: string;
24
+ args: string[];
25
+ env: NodeJS.ProcessEnv;
26
+ }
27
+ export interface ClientSetupOptions {
28
+ /** The host's clients, in the order the setup offers them. */
29
+ clients: readonly SetupClient[];
30
+ /** Where the host keeps the clients it installs: npm's prefix. Asked at each use. */
31
+ folder: () => string;
32
+ /** The environment an install starts with; `shellPath` is the login shell's PATH, if it has one. */
33
+ env: (shellPath: string | undefined) => NodeJS.ProcessEnv;
34
+ }
35
+ /** The AI clients on this computer: how each stands, how it is installed and signed in. */
36
+ export declare class ClientSetup {
37
+ private readonly options;
38
+ /** The status last made of each client's detection, kept while the detection holds. */
39
+ private readonly statuses;
40
+ constructor(options: ClientSetupOptions);
41
+ client(id: string): SetupClient | null;
42
+ /** One client, as it is now; asked again after a minute, as it may get installed or signed in meanwhile. */
43
+ detect(id: string, force?: boolean): Promise<ClientSetupStatus<ClientId> | null>;
44
+ /** Every client of the host, installed or not. */
45
+ detectAll(force?: boolean): Promise<ClientSetupStatus<ClientId>[]>;
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
+ install(id: string): Promise<TerminalCommand | null>;
51
+ /** What the terminal runs to sign a client in. */
52
+ login(id: string): Promise<TerminalCommand | null>;
53
+ /** Whether the client is signed in, asked of the client itself. */
54
+ signedIn(id: string): Promise<boolean>;
55
+ }