@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,146 @@
1
+ import { spawn } from "node:child_process";
2
+ import { accessSync, constants, existsSync, mkdirSync, mkdtempSync, openSync, realpathSync, rmSync, } from "node:fs";
3
+ import { homedir, tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { ollamaAddress, ollamaState } from "@engenty/local-models/ollama";
6
+ import { executable, findOnPath, lastLine, logged, until } from "./install.js";
7
+ /** The Ollama app on a Mac: its server and its command are inside it. */
8
+ const MAC_APPS = ["/Applications/Ollama.app", join(homedir(), "Applications", "Ollama.app")];
9
+ const MAC_DOWNLOAD = "https://ollama.com/download/Ollama-darwin.zip";
10
+ /** Ollama's own installer on Linux: it puts the server in a systemd service, with sudo. */
11
+ const LINUX_SCRIPT = "https://ollama.com/install.sh";
12
+ /**
13
+ * What that installer needs and a fresh Debian lacks: zstd, to unpack Ollama. Installed first
14
+ * with the system's package manager, under the same password.
15
+ */
16
+ const LINUX_ZSTD = [
17
+ "if ! command -v zstd >/dev/null 2>&1; then",
18
+ " if command -v apt-get >/dev/null 2>&1; then sudo apt-get update -qq && sudo apt-get install -y -qq zstd",
19
+ " elif command -v dnf >/dev/null 2>&1; then sudo dnf install -y -q zstd",
20
+ " elif command -v pacman >/dev/null 2>&1; then sudo pacman -S --noconfirm --needed zstd",
21
+ " elif command -v zypper >/dev/null 2>&1; then sudo zypper --non-interactive install zstd",
22
+ " fi",
23
+ "fi",
24
+ ].join("\n");
25
+ /** The `ollama` command: on the PATH, or inside the app on a Mac that never linked it. */
26
+ export function findOllama(env = process.env) {
27
+ const onPath = findOnPath("ollama", env.PATH ?? "");
28
+ if (onPath || process.platform !== "darwin") {
29
+ return onPath;
30
+ }
31
+ return (MAC_APPS.map((app) => join(app, "Contents", "Resources", "ollama")).find(executable) ?? null);
32
+ }
33
+ /** The app an `ollama` command belongs to on a Mac; null for one from Homebrew or elsewhere. */
34
+ function macApp(path) {
35
+ if (process.platform !== "darwin") {
36
+ return null;
37
+ }
38
+ if (!path) {
39
+ return MAC_APPS.find((app) => existsSync(app)) ?? null;
40
+ }
41
+ try {
42
+ const real = realpathSync(path);
43
+ const at = real.indexOf(".app/");
44
+ return at > 0 ? real.slice(0, at + 4) : null;
45
+ }
46
+ catch {
47
+ return null;
48
+ }
49
+ }
50
+ /**
51
+ * Installs Ollama. On a Mac its app goes into Applications (~/Applications where that is not
52
+ * writable) and asks for no password; on Linux Ollama's own script runs in this terminal and
53
+ * asks for one, as it installs a system service.
54
+ */
55
+ export async function installOllama(logs, onLine) {
56
+ if (process.platform === "darwin") {
57
+ let target = "/Applications";
58
+ try {
59
+ accessSync(target, constants.W_OK);
60
+ }
61
+ catch {
62
+ target = join(homedir(), "Applications");
63
+ mkdirSync(target, { recursive: true });
64
+ }
65
+ const tmp = mkdtempSync(join(tmpdir(), "ollama-"));
66
+ try {
67
+ const zip = join(tmp, "Ollama.zip");
68
+ const download = await logged("curl", ["-fsSL", MAC_DOWNLOAD, "-o", zip], { logs, onLine });
69
+ if (download.code !== 0) {
70
+ return { ok: false, message: `The download failed. ${lastLine(download.tail)}` };
71
+ }
72
+ const unpack = await logged("ditto", ["-x", "-k", zip, target], { logs, onLine });
73
+ if (unpack.code !== 0) {
74
+ return { ok: false, message: `It could not be unpacked. ${lastLine(unpack.tail)}` };
75
+ }
76
+ return { ok: true, message: join(target, "Ollama.app") };
77
+ }
78
+ finally {
79
+ rmSync(tmp, { recursive: true, force: true });
80
+ }
81
+ }
82
+ if (process.platform === "linux") {
83
+ const code = await new Promise((resolve) => {
84
+ const child = spawn("sh", ["-c", `${LINUX_ZSTD}\ncurl -fsSL ${LINUX_SCRIPT} | sh`], {
85
+ stdio: "inherit",
86
+ });
87
+ child.on("error", () => resolve(127));
88
+ child.on("close", (status) => resolve(status ?? 1));
89
+ });
90
+ return code === 0
91
+ ? { ok: true, message: findOllama() ?? "ollama" }
92
+ : { ok: false, message: `Ollama’s installer stopped (exit ${code}).` };
93
+ }
94
+ return { ok: false, message: "Ollama is installed by this setup on macOS and Linux only." };
95
+ }
96
+ /**
97
+ * Whether the Ollama app asks for the Mac's password when it starts: the first time, it wants to
98
+ * link its `ollama` command into /usr/local/bin, and its server waits for the answer (cancel
99
+ * works too). Not once that link points into the app.
100
+ */
101
+ export function appAsksForPassword(path) {
102
+ const app = macApp(path);
103
+ if (!app) {
104
+ return false;
105
+ }
106
+ try {
107
+ return realpathSync("/usr/local/bin/ollama") !== join(app, "Contents", "Resources", "ollama");
108
+ }
109
+ catch {
110
+ return true;
111
+ }
112
+ }
113
+ /**
114
+ * Starts Ollama's server where it does not run: the app on a Mac (it then starts at login by
115
+ * itself), Homebrew's service, else `ollama serve` in the background. Its version once it
116
+ * answers; null where it does not in time — three minutes for the app, which may wait for a
117
+ * password, half a minute otherwise.
118
+ */
119
+ export async function startOllama(path, logs) {
120
+ const app = macApp(path);
121
+ const brew = findOnPath("brew", process.env.PATH ?? "");
122
+ let real = path ?? "";
123
+ try {
124
+ real = path ? realpathSync(path) : "";
125
+ }
126
+ catch {
127
+ // a dangling link: started as it is
128
+ }
129
+ if (app) {
130
+ await logged("open", ["-g", app], { logs });
131
+ }
132
+ else if (brew && real.includes("/Cellar/ollama/")) {
133
+ await logged(brew, ["services", "start", "ollama"], { logs });
134
+ }
135
+ else if (path) {
136
+ mkdirSync(logs, { recursive: true });
137
+ const out = openSync(join(logs, "ollama.log"), "a");
138
+ spawn(path, ["serve"], { detached: true, stdio: ["ignore", out, out] }).unref();
139
+ }
140
+ else {
141
+ return null;
142
+ }
143
+ const answers = async () => (await ollamaState(ollamaAddress())).version !== null;
144
+ await until(answers, app ? 180_000 : 30_000);
145
+ return (await ollamaState(ollamaAddress())).version;
146
+ }
@@ -0,0 +1,51 @@
1
+ import type { ServerId } from "@engenty/local-models/servers";
2
+ import { type Context, Hono } from "hono";
3
+ import type { ClientSetup } from "./clients.js";
4
+ import type { LocalModels } from "./local-models.js";
5
+ import type { Tested } from "./models.js";
6
+ import type { Terminals } from "./terminal.js";
7
+ /** What setting up a key or a local server came to. */
8
+ export interface SourceOutcome {
9
+ ok: boolean;
10
+ /** Why not, as the person reads it. */
11
+ message: string | null;
12
+ /** The model the app now writes with on it; null: none, so it does not end the setup. */
13
+ text: string | null;
14
+ }
15
+ /** The host's models, as the setup's routes need them. */
16
+ export interface SetupModels {
17
+ /** The source the person picked. */
18
+ source(): string;
19
+ /** The pick and what belongs to it, as the host's page reads them. */
20
+ settings(c: Context): unknown;
21
+ /** Keeps what the page sends; refuses what it does not know. */
22
+ save(c: Context, body: unknown): Promise<void>;
23
+ /** The kinds of model a test call may name; the first is the default. */
24
+ classes: readonly [string, ...string[]];
25
+ /** One short call on the picked source, as the app would make it. */
26
+ test(cls: string): Promise<{
27
+ ref: string;
28
+ text: string;
29
+ }>;
30
+ /** The providers whose keys the setup takes. */
31
+ providers: readonly [string, ...string[]];
32
+ /** Tests a key (without one: the stored one) and keeps it when it works. */
33
+ key(c: Context, provider: string, key: string | undefined): Promise<SourceOutcome>;
34
+ /** Tests a server at that address and uses it when it works. */
35
+ server(c: Context, id: ServerId, url: string): Promise<SourceOutcome>;
36
+ }
37
+ export interface SetupHost {
38
+ clients: ClientSetup;
39
+ terminals: Terminals;
40
+ /** The folder a terminal starts in; made when missing. */
41
+ workDir: () => string;
42
+ models: SetupModels;
43
+ tested: Tested;
44
+ /** The servers for open models on this computer, in the order the setup offers them. */
45
+ servers: readonly LocalModels[];
46
+ }
47
+ /**
48
+ * The routes of the setup. Nothing here asks who is there: a host mounts them behind its own
49
+ * sign-in, and only where it runs on the person's own computer.
50
+ */
51
+ export declare function setupRoutes(host: SetupHost): Hono;
@@ -0,0 +1,211 @@
1
+ import { mkdirSync } from "node:fs";
2
+ import { Hono } from "hono";
3
+ import { streamSSE } from "hono/streaming";
4
+ import { z } from "zod";
5
+ /** The source own keys and a local server stand for. */
6
+ const OWN = "own";
7
+ const size = z.object({
8
+ cols: z.number().int().min(10).max(500).optional(),
9
+ rows: z.number().int().min(4).max(200).optional(),
10
+ });
11
+ /** A model as a server names it: `name`, `name:tag`, `publisher/name@variant`, `hf.co/…`. */
12
+ const modelName = z
13
+ .string()
14
+ .trim()
15
+ .min(1)
16
+ .max(120)
17
+ .regex(/^[\w.:/@-]+$/);
18
+ /** The request's JSON; an empty object when it has none. */
19
+ const bodyOf = (c) => c.req.json().catch(() => ({}));
20
+ /**
21
+ * The routes of the setup. Nothing here asks who is there: a host mounts them behind its own
22
+ * sign-in, and only where it runs on the person's own computer.
23
+ */
24
+ export function setupRoutes(host) {
25
+ const { clients, terminals, models, tested } = host;
26
+ const serverOf = (c) => host.servers.find((server) => server.id === c.req.param("id"));
27
+ const workDir = () => {
28
+ const dir = host.workDir();
29
+ mkdirSync(dir, { recursive: true });
30
+ return dir;
31
+ };
32
+ return (new Hono()
33
+ .get("/models", (c) => c.json(models.settings(c)))
34
+ .put("/models", async (c) => {
35
+ await models.save(c, await c.req.json());
36
+ return c.json(models.settings(c));
37
+ })
38
+ // One short call, as the app would make it: shows that the way to the model is open.
39
+ .post("/models/test", async (c) => {
40
+ const { cls } = z
41
+ .object({ cls: z.enum(models.classes).default(models.classes[0]) })
42
+ .parse(await bodyOf(c));
43
+ const started = Date.now();
44
+ // The source this call runs on: the person may pick another one while it is under way.
45
+ const source = models.source();
46
+ try {
47
+ const { ref, text } = await models.test(cls);
48
+ // A working call is what ends the setup, for the source it ran on.
49
+ await tested.mark(source);
50
+ return c.json({
51
+ ok: true,
52
+ ref,
53
+ reply: text.trim().slice(0, 200),
54
+ ms: Date.now() - started,
55
+ });
56
+ }
57
+ catch (err) {
58
+ const message = err?.message ?? String(err);
59
+ return c.json({ ok: false, error: message.slice(0, 500), ms: Date.now() - started });
60
+ }
61
+ })
62
+ // The test of one key, or of a server at an address: a working one is put to use and ends the setup.
63
+ .post("/keys/:provider", async (c) => {
64
+ const provider = z.enum(models.providers).parse(c.req.param("provider"));
65
+ const { key } = z.object({ key: z.string().max(400).optional() }).parse(await bodyOf(c));
66
+ const outcome = await models.key(c, provider, key);
67
+ if (outcome.ok && outcome.text) {
68
+ await tested.mark(OWN);
69
+ }
70
+ return c.json(outcome);
71
+ })
72
+ .post("/servers/:id/address", async (c) => {
73
+ const server = serverOf(c);
74
+ if (!server) {
75
+ return c.notFound();
76
+ }
77
+ const { url } = z.object({ url: z.string().url().max(200) }).parse(await c.req.json());
78
+ const outcome = await models.server(c, server.id, url);
79
+ if (outcome.ok) {
80
+ await tested.mark(OWN);
81
+ }
82
+ return c.json(outcome);
83
+ })
84
+ // --- the models of a server on this computer: listed, pulled, removed; none is loaded ---
85
+ .get("/servers/:id", async (c) => {
86
+ const server = serverOf(c);
87
+ return server ? c.json(await server.state()) : c.notFound();
88
+ })
89
+ .post("/servers/:id/pull", async (c) => {
90
+ const server = serverOf(c);
91
+ if (!server) {
92
+ return c.notFound();
93
+ }
94
+ const { model } = z.object({ model: modelName }).parse(await c.req.json());
95
+ await server.pull(model);
96
+ return c.json(await server.state());
97
+ })
98
+ .delete("/servers/:id/models", async (c) => {
99
+ const server = serverOf(c);
100
+ if (!server) {
101
+ return c.notFound();
102
+ }
103
+ try {
104
+ await server.remove(modelName.parse(c.req.query("model")));
105
+ }
106
+ catch (err) {
107
+ if (err instanceof z.ZodError) {
108
+ throw err;
109
+ }
110
+ const { message } = err;
111
+ return c.json({ error: message, message }, 400);
112
+ }
113
+ return c.json(await server.state());
114
+ })
115
+ // The server installed, where the host can, and started.
116
+ .post("/servers/:id/start", async (c) => {
117
+ const server = serverOf(c);
118
+ if (!server) {
119
+ return c.notFound();
120
+ }
121
+ server.start();
122
+ return c.json(await server.state());
123
+ })
124
+ // --- the AI clients on this computer: looked at afresh, installed and signed in --------
125
+ .get("/clients", async (c) => {
126
+ const [found, servers] = await Promise.all([
127
+ clients.detectAll(),
128
+ Promise.all(host.servers.map((server) => server.status())),
129
+ ]);
130
+ return c.json({ clients: found, servers });
131
+ })
132
+ .post("/harness/:id/detect", async (c) => {
133
+ const id = c.req.param("id");
134
+ return clients.client(id)
135
+ ? c.json({ harness: await clients.detect(id, true) })
136
+ : c.notFound();
137
+ })
138
+ .post("/harness/:id/install", async (c) => {
139
+ const command = await clients.install(c.req.param("id"));
140
+ if (!command) {
141
+ return c.notFound();
142
+ }
143
+ const { cols, rows } = size.parse(await bodyOf(c));
144
+ // The page asks again once the command is over: then the client is there, or its output says why not.
145
+ const terminal = await terminals.open({ ...command, cwd: workDir(), cols, rows });
146
+ return c.json({ terminal });
147
+ })
148
+ .post("/harness/:id/login", async (c) => {
149
+ const id = c.req.param("id");
150
+ const command = await clients.login(id);
151
+ if (!command) {
152
+ return c.notFound();
153
+ }
154
+ const { cols, rows } = size.parse(await bodyOf(c));
155
+ const terminal = await terminals.open({
156
+ ...command,
157
+ cwd: workDir(),
158
+ cols,
159
+ rows,
160
+ // Signed in: the client says so on its own, and the app learns it right away.
161
+ until: () => clients.signedIn(id),
162
+ onDone: () => void clients.detect(id, true),
163
+ });
164
+ return c.json({ terminal });
165
+ })
166
+ .get("/terminal/:id/stream", (c) => {
167
+ const id = c.req.param("id");
168
+ return streamSSE(c, async (stream) => {
169
+ let ended = false;
170
+ // One write after the other, and all of them out before the stream ends: the last one is
171
+ // the exit, and a page that comes after the end gets everything at once.
172
+ let written = Promise.resolve();
173
+ const done = new Promise((resolve) => {
174
+ const unsubscribe = terminals.subscribe(id, (event) => {
175
+ written = written.then(() => stream.writeSSE({ event: event.type, data: JSON.stringify(event) }));
176
+ if (event.type === "exit") {
177
+ ended = true;
178
+ resolve();
179
+ }
180
+ });
181
+ stream.onAbort(() => {
182
+ unsubscribe();
183
+ resolve();
184
+ });
185
+ });
186
+ // The page keeps the stream open while the terminal lives; a heartbeat keeps proxies from closing it.
187
+ const beat = setInterval(() => {
188
+ if (!ended) {
189
+ void stream.writeSSE({ event: "ping", data: "" });
190
+ }
191
+ }, 15_000);
192
+ await done;
193
+ clearInterval(beat);
194
+ await written;
195
+ });
196
+ })
197
+ .post("/terminal/:id/input", async (c) => {
198
+ const { data } = z.object({ data: z.string().max(10_000) }).parse(await c.req.json());
199
+ terminals.write(c.req.param("id"), data);
200
+ return c.json({ ok: true });
201
+ })
202
+ .post("/terminal/:id/resize", async (c) => {
203
+ const { cols, rows } = size.required().parse(await c.req.json());
204
+ terminals.resize(c.req.param("id"), cols, rows);
205
+ return c.json({ ok: true });
206
+ })
207
+ .delete("/terminal/:id", (c) => {
208
+ terminals.close(c.req.param("id"));
209
+ return c.json({ ok: true });
210
+ }));
211
+ }
@@ -0,0 +1,14 @@
1
+ import type { ServerId } from "@engenty/local-models/servers";
2
+ import type { Outcome } from "./install.js";
3
+ /** A server as a program on this computer. */
4
+ export interface ServerApp {
5
+ /** Its command or app; null: it is not here. */
6
+ find(): string | null;
7
+ /** Where the person gets it. */
8
+ download: string;
9
+ /** Absent: the person installs it. */
10
+ install?(logs: string, onLine: (line: string) => void): Promise<Outcome>;
11
+ /** Starts it and waits until it answers. */
12
+ start(logs: string, answers: () => Promise<boolean>): Promise<boolean>;
13
+ }
14
+ export declare const SERVER_APPS: Record<ServerId, ServerApp>;
@@ -0,0 +1,24 @@
1
+ import { mlxBin, mlxSupported } from "@engenty/local-models/mlx";
2
+ import { findLmStudio, startLmStudio } from "./lmstudio.js";
3
+ import { findOllama, installOllama, startOllama } from "./ollama.js";
4
+ export const SERVER_APPS = {
5
+ ollama: {
6
+ find: () => findOllama(),
7
+ download: "https://ollama.com/download",
8
+ // On Linux its installer asks for a password in a terminal.
9
+ ...(process.platform === "darwin" ? { install: installOllama } : {}),
10
+ start: async (logs) => (await startOllama(findOllama(), logs)) !== null,
11
+ },
12
+ // Its terms leave the install to the person.
13
+ lmstudio: {
14
+ find: findLmStudio,
15
+ download: "https://lmstudio.ai/download",
16
+ start: startLmStudio,
17
+ },
18
+ // It comes with the host and starts with its first call.
19
+ mlx: {
20
+ find: () => (mlxSupported() ? mlxBin() : null),
21
+ download: "https://mlx-framework.org",
22
+ start: async () => mlxSupported(),
23
+ },
24
+ };
@@ -0,0 +1,43 @@
1
+ import type { TerminalEvent } from "../types.js";
2
+ /**
3
+ * Why a terminal does not serve: `unavailable`: this computer has none; `not_started`: the
4
+ * command could not be started, `detail` says why; `gone`: no terminal of that id.
5
+ */
6
+ export declare class TerminalError extends Error {
7
+ readonly code: "unavailable" | "not_started" | "gone";
8
+ readonly detail: string;
9
+ constructor(code: "unavailable" | "not_started" | "gone", detail?: string);
10
+ }
11
+ type Listener = (event: TerminalEvent) => void;
12
+ export interface TerminalOptions {
13
+ bin: string;
14
+ args: string[];
15
+ cwd: string;
16
+ env: NodeJS.ProcessEnv;
17
+ cols?: number;
18
+ rows?: number;
19
+ /** Asked every few seconds: once true, the session is done and the command is ended. */
20
+ until?: () => Promise<boolean>;
21
+ onDone?: () => void;
22
+ }
23
+ /**
24
+ * Terminals a page shows inline: a real pseudo-terminal running one command (a client's install
25
+ * or sign-in) whose screen the browser renders and whose keyboard it is. A session lives while
26
+ * someone looks at it; what the command printed is kept so a reopened page shows it again.
27
+ */
28
+ export declare class Terminals {
29
+ private readonly sessions;
30
+ /** Starts a command in a new terminal; the id names it to the page. */
31
+ open(opts: TerminalOptions): Promise<string>;
32
+ /** Follows a terminal: what it printed so far, then everything new, then its end. */
33
+ subscribe(id: string, listener: Listener): () => void;
34
+ write(id: string, data: string): void;
35
+ resize(id: string, cols: number, rows: number): void;
36
+ close(id: string): void;
37
+ private session;
38
+ /** Asks `until` every few seconds and ends the command once it is true. */
39
+ private watch;
40
+ private forget;
41
+ private rearm;
42
+ }
43
+ export {};