@engenty/wizards-runtime 0.20.5 → 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 (363) 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 +20 -25
  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 +7 -254
  11. package/apps/runtime/dist/cli/setup.js +12 -9
  12. package/apps/runtime/dist/decision-model.js +1 -4
  13. package/apps/runtime/dist/docs/dev/licensing.md +20 -9
  14. package/apps/runtime/dist/docs/user-guide/command-line.md +5 -2
  15. package/apps/runtime/dist/elements/outside.js +2 -1
  16. package/apps/runtime/dist/engine/code-step.js +1 -1
  17. package/apps/runtime/dist/engine/decide.js +2 -2
  18. package/apps/runtime/dist/engine/device.js +3 -2
  19. package/apps/runtime/dist/engine/input.js +1 -1
  20. package/apps/runtime/dist/engine/runner.js +1 -1
  21. package/apps/runtime/dist/engine/steps.js +27 -8
  22. package/apps/runtime/dist/engine/surface.js +1 -1
  23. package/apps/runtime/dist/engine/template.js +1 -1
  24. package/apps/runtime/dist/env.js +1 -0
  25. package/apps/runtime/dist/harness/apple.js +4 -3
  26. package/apps/runtime/dist/harness/clients.js +117 -0
  27. package/apps/runtime/dist/harness/index.js +32 -87
  28. package/apps/runtime/dist/harness/model.js +32 -270
  29. package/apps/runtime/dist/harness/prompt.js +6 -120
  30. package/apps/runtime/dist/harness/types.js +5 -3
  31. package/apps/runtime/dist/local-call.js +6 -0
  32. package/apps/runtime/dist/local-models.js +53 -177
  33. package/apps/runtime/dist/mcp/bridge.js +12 -55
  34. package/apps/runtime/dist/mcp/elements.js +39 -4
  35. package/apps/runtime/dist/mcp/handler.js +12 -0
  36. package/apps/runtime/dist/mcp/run-pages.js +238 -0
  37. package/apps/runtime/dist/mcp/run-tasks.js +157 -0
  38. package/apps/runtime/dist/mcp/runs.js +129 -0
  39. package/apps/runtime/dist/mcp/tools.js +4 -95
  40. package/apps/runtime/dist/models.js +82 -32
  41. package/apps/runtime/dist/motion-graphics/step.js +2 -2
  42. package/apps/runtime/dist/prompts/mcp.md +4 -1
  43. package/apps/runtime/dist/render/downloads.js +1 -1
  44. package/apps/runtime/dist/render/shaped.js +1 -1
  45. package/apps/runtime/dist/routes/model-setup.js +77 -0
  46. package/apps/runtime/dist/routes/studio.js +8 -251
  47. package/apps/runtime/dist/services/space-categories.js +1 -1
  48. package/apps/runtime/dist/services/work-ai.js +11 -5
  49. package/apps/runtime/dist/texts.js +4 -6
  50. package/apps/runtime/dist/tools/connections.js +3 -0
  51. package/apps/runtime/dist/tools/harness.js +124 -0
  52. package/apps/web/dist/assets/AboutDialog-BSdAA4Wi.js +1 -0
  53. package/apps/web/dist/assets/{BlockEditor-CgjXTWly.js → BlockEditor-0noqMcAl.js} +1 -1
  54. package/apps/web/dist/assets/Bundle-Ctrq7lHH.js +1 -0
  55. package/apps/web/dist/assets/CapabilitiesPage-CZlVhBmU.js +2 -0
  56. package/apps/web/dist/assets/ChangelogDialog-BLCYV4jT.js +1 -0
  57. package/apps/web/dist/assets/{CodeEditor-2LyHbSre.js → CodeEditor-CpRn9BZq.js} +1 -1
  58. package/apps/web/dist/assets/ConnectorsSection-B4rRDlFo.js +1 -0
  59. package/apps/web/dist/assets/EditorPage-CXN-_zzG.js +3 -0
  60. package/apps/web/dist/assets/FlowPreview-DjQvcWxs.js +1 -0
  61. package/apps/web/dist/assets/LangSwitch-BuzsLp16.js +1 -0
  62. package/apps/web/dist/assets/LocalModels-BDfP2v5-.js +1 -0
  63. package/apps/web/dist/assets/Marketplace-4baBNzEc.js +2 -0
  64. package/apps/web/dist/assets/NewWizardChannels-B_xHm-bI.js +1 -0
  65. package/apps/web/dist/assets/NewWizardPage-BmZAY4zi.js +7 -0
  66. package/apps/web/dist/assets/OnboardingPage-fZq3WiTk.js +1 -0
  67. package/apps/web/dist/assets/ProtocolSection-v9wIxisg.js +1 -0
  68. package/apps/web/dist/assets/PublicRunner-BCh0VzAT.js +1 -0
  69. package/apps/web/dist/assets/{ReadOnly-CbvEK0rz.js → ReadOnly-13stkvNz.js} +1 -1
  70. package/apps/web/dist/assets/Results-4gmguYzH.js +1 -0
  71. package/apps/web/dist/assets/RunDrawer-CeEldWRn.js +1 -0
  72. package/apps/web/dist/assets/SettingsPage-BsKRRlfP.js +2 -0
  73. package/apps/web/dist/assets/SetupPage-FgA5Kl8z.js +1 -0
  74. package/apps/web/dist/assets/SharePage-BlBW4oxl.js +1 -0
  75. package/apps/web/dist/assets/SkillEditor-9QSskfmY.js +1 -0
  76. package/apps/web/dist/assets/Skills-DdUAyNhR.js +9 -0
  77. package/apps/web/dist/assets/SpacePage-CHkNPuqt.js +2 -0
  78. package/apps/web/dist/assets/StudioHome-BwPD-inc.js +1 -0
  79. package/apps/web/dist/assets/TableEditor-Du1DhbEC.js +7 -0
  80. package/apps/web/dist/assets/UpdateCheck-DPr9NXq_.js +2 -0
  81. package/apps/web/dist/assets/brand-DY3lzrOd.js +2 -0
  82. package/apps/web/dist/assets/changelog-BSdb22c3.js +1 -0
  83. package/apps/web/dist/assets/code-editor-Bep_LzQ5.js +2 -0
  84. package/apps/web/dist/assets/host-DiZQ_uws.js +1 -0
  85. package/apps/web/dist/assets/host-Dw-sMUSd.js +54 -0
  86. package/apps/web/dist/assets/i18n-DVrYWJaj.js +55 -0
  87. package/apps/web/dist/assets/index-C2gxK14s.css +1 -0
  88. package/apps/web/dist/assets/index-lQ4JYHYQ.js +102 -0
  89. package/apps/web/dist/assets/oss-credits-BHy69wkx.js +1 -0
  90. package/apps/web/dist/assets/{read-aloud-CRFt5q6k.js → read-aloud-CBycd8TA.js} +1 -1
  91. package/apps/web/dist/assets/{session-RDdtfee2.js → session-BYLtgklo.js} +1 -1
  92. package/apps/web/dist/assets/terminal-DmGdMags.js +16 -0
  93. package/apps/web/dist/assets/texts-ClKS2xhh.js +1 -0
  94. package/apps/web/dist/assets/theme-DFDOMsVo.js +14 -0
  95. package/apps/web/dist/assets/ui-CW2I3ecu.js +1 -0
  96. package/apps/web/dist/assets/ui-DfVpZYIW.js +16 -0
  97. package/apps/web/dist/assets/{useMutation-BSffqL6W.js → useMutation-BnkuLlQC.js} +1 -1
  98. package/apps/web/dist/assets/viewers-C6FfRwG1.js +2 -0
  99. package/apps/web/dist/index.html +18 -16
  100. package/apps/web/dist/mcp/flow.html +129 -129
  101. package/bin/bot-tunnel.mjs +375 -0
  102. package/bin/bot.mjs +494 -69
  103. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.js +1 -1
  104. package/node_modules/@engenty/chatviews/dist/chat/a2ui.d.ts +48 -0
  105. package/node_modules/@engenty/chatviews/dist/chat/a2ui.js +514 -0
  106. package/node_modules/@engenty/chatviews/dist/chat/check.d.ts +18 -0
  107. package/node_modules/@engenty/chatviews/dist/chat/check.js +97 -0
  108. package/node_modules/@engenty/chatviews/dist/chat/index.d.ts +3 -0
  109. package/node_modules/@engenty/chatviews/dist/chat/index.js +4 -0
  110. package/node_modules/@engenty/chatviews/dist/chat/library.d.ts +39 -0
  111. package/node_modules/@engenty/chatviews/dist/chat/library.js +314 -0
  112. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.js +1 -1
  113. package/node_modules/@engenty/chatviews/dist/react/chat.d.ts +33 -0
  114. package/node_modules/@engenty/chatviews/dist/react/chat.js +150 -0
  115. package/node_modules/@engenty/chatviews/dist/react/field-looks.d.ts +39 -0
  116. package/node_modules/@engenty/chatviews/dist/react/field-looks.js +47 -0
  117. package/node_modules/@engenty/chatviews/dist/react/markdown.d.ts +5 -0
  118. package/node_modules/@engenty/chatviews/dist/react/markdown.js +11 -0
  119. package/node_modules/@engenty/chatviews/dist/react/no-devtools.d.ts +0 -0
  120. package/node_modules/@engenty/chatviews/dist/react/no-devtools.js +8 -0
  121. package/node_modules/@engenty/chatviews/dist/react/surface.d.ts +39 -0
  122. package/node_modules/@engenty/chatviews/dist/react/surface.js +552 -0
  123. package/node_modules/@engenty/chatviews/dist/react/texts.d.ts +39 -0
  124. package/node_modules/@engenty/chatviews/dist/react/texts.js +42 -0
  125. package/node_modules/@engenty/chatviews/dist/react/ui.d.ts +112 -0
  126. package/node_modules/@engenty/chatviews/dist/react/ui.js +212 -0
  127. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.js +1 -1
  128. package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.js +1 -1
  129. package/node_modules/@engenty/chatviews/package.json +19 -0
  130. package/node_modules/@engenty/decision-model/dist/client.d.ts +76 -0
  131. package/node_modules/@engenty/decision-model/dist/client.js +188 -0
  132. package/node_modules/@engenty/decision-model/dist/index.d.ts +6 -0
  133. package/node_modules/@engenty/decision-model/dist/index.js +5 -0
  134. package/node_modules/@engenty/decision-model/dist/local.d.ts +11 -0
  135. package/node_modules/@engenty/decision-model/dist/local.js +116 -0
  136. package/node_modules/@engenty/decision-model/dist/resolve.d.ts +26 -0
  137. package/node_modules/@engenty/decision-model/dist/resolve.js +53 -0
  138. package/node_modules/@engenty/decision-model/dist/types.d.ts +80 -0
  139. package/node_modules/@engenty/decision-model/dist/types.js +6 -0
  140. package/node_modules/@engenty/decision-model/dist/validate.d.ts +9 -0
  141. package/node_modules/@engenty/decision-model/dist/validate.js +50 -0
  142. package/node_modules/@engenty/decision-model/dist/ways.d.ts +42 -0
  143. package/node_modules/@engenty/decision-model/dist/ways.js +72 -0
  144. package/node_modules/@engenty/decision-model/package.json +9 -0
  145. package/node_modules/@engenty/local-models/dist/bridge/index.d.ts +54 -0
  146. package/node_modules/@engenty/local-models/dist/bridge/index.js +117 -0
  147. package/node_modules/@engenty/local-models/dist/clients/antigravity.d.ts +37 -0
  148. package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js +72 -17
  149. package/node_modules/@engenty/local-models/dist/clients/chat.d.ts +89 -0
  150. package/node_modules/@engenty/local-models/dist/clients/chat.js +22 -0
  151. package/node_modules/@engenty/local-models/dist/clients/claude.d.ts +32 -0
  152. package/node_modules/@engenty/local-models/dist/clients/claude.js +239 -0
  153. package/node_modules/@engenty/local-models/dist/clients/client.d.ts +31 -0
  154. package/node_modules/@engenty/local-models/dist/clients/client.js +2 -0
  155. package/node_modules/@engenty/local-models/dist/clients/codex.d.ts +35 -0
  156. package/node_modules/@engenty/local-models/dist/clients/codex.js +254 -0
  157. package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +35 -0
  158. package/node_modules/@engenty/local-models/dist/clients/cursor.js +192 -0
  159. package/node_modules/@engenty/local-models/dist/clients/detect.d.ts +18 -0
  160. package/node_modules/@engenty/local-models/dist/clients/detect.js +34 -0
  161. package/node_modules/@engenty/local-models/dist/clients/env.d.ts +66 -0
  162. package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/env.js +62 -31
  163. package/node_modules/@engenty/local-models/dist/clients/failure.d.ts +26 -0
  164. package/node_modules/@engenty/local-models/dist/clients/failure.js +35 -0
  165. package/node_modules/@engenty/local-models/dist/clients/index.d.ts +15 -0
  166. package/node_modules/@engenty/local-models/dist/clients/index.js +18 -0
  167. package/node_modules/@engenty/local-models/dist/clients/model.d.ts +129 -0
  168. package/node_modules/@engenty/local-models/dist/clients/model.js +225 -0
  169. package/node_modules/@engenty/local-models/dist/clients/prompt.d.ts +36 -0
  170. package/node_modules/@engenty/local-models/dist/clients/prompt.js +123 -0
  171. package/node_modules/@engenty/local-models/dist/clients/run.d.ts +15 -0
  172. package/node_modules/@engenty/local-models/dist/clients/run.js +41 -0
  173. package/node_modules/@engenty/local-models/dist/index.d.ts +4 -0
  174. package/node_modules/@engenty/local-models/dist/index.js +4 -0
  175. package/node_modules/@engenty/local-models/dist/lmstudio/api.d.ts +49 -0
  176. package/node_modules/@engenty/local-models/dist/lmstudio/api.js +101 -0
  177. package/node_modules/@engenty/local-models/dist/lmstudio/index.d.ts +3 -0
  178. package/node_modules/@engenty/local-models/dist/lmstudio/index.js +3 -0
  179. package/node_modules/@engenty/local-models/dist/lmstudio/load.d.ts +12 -0
  180. package/node_modules/@engenty/local-models/dist/lmstudio/load.js +100 -0
  181. package/node_modules/@engenty/local-models/dist/lmstudio/server.d.ts +3 -0
  182. package/node_modules/@engenty/local-models/dist/lmstudio/server.js +29 -0
  183. package/node_modules/@engenty/local-models/dist/mlx/helper.d.ts +54 -0
  184. package/node_modules/@engenty/local-models/dist/mlx/helper.js +149 -0
  185. package/node_modules/@engenty/local-models/dist/mlx/index.d.ts +3 -0
  186. package/node_modules/@engenty/local-models/dist/mlx/index.js +3 -0
  187. package/node_modules/@engenty/local-models/dist/mlx/server.d.ts +19 -0
  188. package/node_modules/@engenty/local-models/dist/mlx/server.js +82 -0
  189. package/node_modules/@engenty/local-models/dist/mlx/store.d.ts +16 -0
  190. package/node_modules/@engenty/local-models/dist/mlx/store.js +153 -0
  191. package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +37 -0
  192. package/node_modules/@engenty/local-models/dist/ollama/api.js +147 -0
  193. package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +3 -0
  194. package/node_modules/@engenty/local-models/dist/ollama/index.js +3 -0
  195. package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +54 -0
  196. package/node_modules/@engenty/local-models/dist/ollama/model.js +302 -0
  197. package/node_modules/@engenty/local-models/dist/ollama/server.d.ts +3 -0
  198. package/node_modules/@engenty/local-models/dist/ollama/server.js +45 -0
  199. package/node_modules/@engenty/local-models/dist/probe.d.ts +57 -0
  200. package/node_modules/@engenty/local-models/dist/probe.js +174 -0
  201. package/node_modules/@engenty/local-models/dist/servers/index.d.ts +6 -0
  202. package/node_modules/@engenty/local-models/dist/servers/index.js +12 -0
  203. package/node_modules/@engenty/local-models/dist/servers/server.d.ts +84 -0
  204. package/node_modules/@engenty/local-models/dist/servers/server.js +38 -0
  205. package/node_modules/@engenty/local-models/package.json +16 -0
  206. package/node_modules/@engenty/model-setup/dist/catalog.d.ts +36 -0
  207. package/node_modules/@engenty/model-setup/dist/catalog.js +81 -0
  208. package/node_modules/@engenty/model-setup/dist/index.d.ts +3 -0
  209. package/node_modules/@engenty/model-setup/dist/index.js +3 -0
  210. package/node_modules/@engenty/model-setup/dist/offered.d.ts +7 -0
  211. package/node_modules/@engenty/model-setup/dist/offered.js +64 -0
  212. package/node_modules/@engenty/model-setup/dist/react/client.d.ts +46 -0
  213. package/node_modules/@engenty/model-setup/dist/react/client.js +147 -0
  214. package/node_modules/@engenty/model-setup/dist/react/columns.d.ts +78 -0
  215. package/node_modules/@engenty/model-setup/dist/react/columns.js +99 -0
  216. package/node_modules/@engenty/model-setup/dist/react/host.d.ts +31 -0
  217. package/node_modules/@engenty/model-setup/dist/react/host.js +48 -0
  218. package/node_modules/@engenty/model-setup/dist/react/index.d.ts +7 -0
  219. package/node_modules/@engenty/model-setup/dist/react/index.js +7 -0
  220. package/node_modules/@engenty/model-setup/dist/react/keys.d.ts +48 -0
  221. package/node_modules/@engenty/model-setup/dist/react/keys.js +74 -0
  222. package/node_modules/@engenty/model-setup/dist/react/local-models.d.ts +23 -0
  223. package/node_modules/@engenty/model-setup/dist/react/local-models.js +134 -0
  224. package/node_modules/@engenty/model-setup/dist/react/servers.d.ts +4 -0
  225. package/node_modules/@engenty/model-setup/dist/react/servers.js +13 -0
  226. package/node_modules/@engenty/model-setup/dist/react/terminal.d.ts +13 -0
  227. package/node_modules/@engenty/model-setup/dist/react/terminal.js +79 -0
  228. package/node_modules/@engenty/model-setup/dist/react/tone.d.ts +13 -0
  229. package/node_modules/@engenty/model-setup/dist/react/tone.js +66 -0
  230. package/node_modules/@engenty/model-setup/dist/server/apps.d.ts +12 -0
  231. package/node_modules/@engenty/model-setup/dist/server/apps.js +22 -0
  232. package/node_modules/@engenty/model-setup/dist/server/clients.d.ts +55 -0
  233. package/node_modules/@engenty/model-setup/dist/server/clients.js +96 -0
  234. package/node_modules/@engenty/model-setup/dist/server/index.d.ts +8 -0
  235. package/node_modules/@engenty/model-setup/dist/server/index.js +8 -0
  236. package/node_modules/@engenty/model-setup/dist/server/install.d.ts +24 -0
  237. package/node_modules/@engenty/model-setup/dist/server/install.js +68 -0
  238. package/node_modules/@engenty/model-setup/dist/server/lmstudio.d.ts +9 -0
  239. package/node_modules/@engenty/model-setup/dist/server/lmstudio.js +52 -0
  240. package/node_modules/@engenty/model-setup/dist/server/local-models.d.ts +47 -0
  241. package/node_modules/@engenty/model-setup/dist/server/local-models.js +164 -0
  242. package/node_modules/@engenty/model-setup/dist/server/models.d.ts +12 -0
  243. package/node_modules/@engenty/model-setup/dist/server/models.js +16 -0
  244. package/node_modules/@engenty/model-setup/dist/server/ollama.d.ts +22 -0
  245. package/node_modules/@engenty/model-setup/dist/server/ollama.js +146 -0
  246. package/node_modules/@engenty/model-setup/dist/server/routes.d.ts +51 -0
  247. package/node_modules/@engenty/model-setup/dist/server/routes.js +211 -0
  248. package/node_modules/@engenty/model-setup/dist/server/server-apps.d.ts +14 -0
  249. package/node_modules/@engenty/model-setup/dist/server/server-apps.js +24 -0
  250. package/node_modules/@engenty/model-setup/dist/server/terminal.d.ts +43 -0
  251. package/node_modules/@engenty/model-setup/dist/server/terminal.js +222 -0
  252. package/node_modules/@engenty/model-setup/dist/texts.d.ts +222 -0
  253. package/node_modules/@engenty/model-setup/dist/texts.js +222 -0
  254. package/node_modules/@engenty/model-setup/dist/types.d.ts +111 -0
  255. package/node_modules/@engenty/model-setup/dist/types.js +2 -0
  256. package/node_modules/@engenty/model-setup/package.json +12 -0
  257. package/node_modules/@engenty/search-index/dist/catalog-lexical.d.ts +14 -0
  258. package/node_modules/@engenty/search-index/dist/catalog-lexical.js +165 -0
  259. package/node_modules/@engenty/search-index/dist/catalog-rank.d.ts +33 -0
  260. package/node_modules/@engenty/search-index/dist/catalog-rank.js +99 -0
  261. package/node_modules/@engenty/search-index/dist/catalog-search.d.ts +40 -0
  262. package/node_modules/@engenty/search-index/dist/catalog-search.js +161 -0
  263. package/node_modules/@engenty/search-index/dist/chunks.d.ts +17 -0
  264. package/node_modules/@engenty/search-index/dist/chunks.js +164 -0
  265. package/node_modules/@engenty/search-index/dist/contracts.d.ts +135 -0
  266. package/node_modules/@engenty/search-index/dist/contracts.js +9 -0
  267. package/node_modules/@engenty/search-index/dist/embedder.d.ts +31 -0
  268. package/node_modules/@engenty/search-index/dist/embedder.js +82 -0
  269. package/node_modules/@engenty/search-index/dist/embedders/gemini.d.ts +11 -0
  270. package/node_modules/@engenty/search-index/dist/embedders/gemini.js +54 -0
  271. package/node_modules/@engenty/search-index/dist/embedders/index.d.ts +5 -0
  272. package/node_modules/@engenty/search-index/dist/embedders/index.js +5 -0
  273. package/node_modules/@engenty/search-index/dist/embedders/ollama.d.ts +12 -0
  274. package/node_modules/@engenty/search-index/dist/embedders/ollama.js +43 -0
  275. package/node_modules/@engenty/search-index/dist/embedders/openai.d.ts +11 -0
  276. package/node_modules/@engenty/search-index/dist/embedders/openai.js +36 -0
  277. package/node_modules/@engenty/search-index/dist/embedders/shared.d.ts +5 -0
  278. package/node_modules/@engenty/search-index/dist/embedders/shared.js +26 -0
  279. package/node_modules/@engenty/search-index/dist/embedders/ways.d.ts +16 -0
  280. package/node_modules/@engenty/search-index/dist/embedders/ways.js +90 -0
  281. package/node_modules/@engenty/search-index/dist/index.d.ts +10 -0
  282. package/node_modules/@engenty/search-index/dist/index.js +10 -0
  283. package/node_modules/@engenty/search-index/dist/payload.d.ts +13 -0
  284. package/node_modules/@engenty/search-index/dist/payload.js +51 -0
  285. package/node_modules/@engenty/search-index/dist/registry.d.ts +25 -0
  286. package/node_modules/@engenty/search-index/dist/registry.js +56 -0
  287. package/node_modules/@engenty/search-index/dist/scoring.d.ts +10 -0
  288. package/node_modules/@engenty/search-index/dist/scoring.js +45 -0
  289. package/node_modules/@engenty/search-index/dist/strategy.d.ts +6 -0
  290. package/node_modules/@engenty/search-index/dist/strategy.js +25 -0
  291. package/node_modules/@engenty/search-index/package.json +10 -0
  292. package/node_modules/@engenty/tool-harness/dist/harness.d.ts +70 -0
  293. package/node_modules/@engenty/tool-harness/dist/harness.js +170 -0
  294. package/node_modules/@engenty/tool-harness/dist/index.d.ts +5 -0
  295. package/node_modules/@engenty/tool-harness/dist/index.js +5 -0
  296. package/node_modules/@engenty/tool-harness/dist/judge.d.ts +8 -0
  297. package/node_modules/@engenty/tool-harness/dist/judge.js +39 -0
  298. package/node_modules/@engenty/tool-harness/dist/levels.d.ts +18 -0
  299. package/node_modules/@engenty/tool-harness/dist/levels.js +47 -0
  300. package/node_modules/@engenty/tool-harness/dist/model.d.ts +6 -0
  301. package/node_modules/@engenty/tool-harness/dist/model.js +60 -0
  302. package/node_modules/@engenty/tool-harness/dist/schema.d.ts +26 -0
  303. package/node_modules/@engenty/tool-harness/dist/schema.js +57 -0
  304. package/node_modules/@engenty/tool-harness/package.json +9 -0
  305. package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -1
  306. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10 -10
  307. package/node_modules/@engenty/wizards-shared/dist/definition.js +4 -4
  308. package/node_modules/@engenty/wizards-shared/dist/run-schema.js +1 -1
  309. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -1
  310. package/node_modules/@engenty/wizards-shared/dist/run.js +4 -0
  311. package/node_modules/@engenty/wizards-shared/dist/store.js +2 -1
  312. package/node_modules/@engenty/wizards-shared/dist/wizard-agents.d.ts +1 -1
  313. package/node_modules/@engenty/wizards-shared/dist/wizard-agents.js +1 -1
  314. package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +2 -2
  315. package/package.json +13 -1
  316. package/plugin/.claude-plugin/plugin.json +1 -1
  317. package/plugin/plugin.json +1 -1
  318. package/apps/runtime/dist/agents/chat-clients.js +0 -344
  319. package/apps/runtime/dist/harness/claude.js +0 -141
  320. package/apps/runtime/dist/harness/codex.js +0 -222
  321. package/apps/runtime/dist/harness/cursor.js +0 -89
  322. package/apps/runtime/dist/harness/terminal.js +0 -201
  323. package/apps/web/dist/assets/AboutDialog-DM_2-iLP.js +0 -1
  324. package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
  325. package/apps/web/dist/assets/CapabilitiesPage-DxRUERr-.js +0 -2
  326. package/apps/web/dist/assets/ChangelogDialog-Cyn3LAch.js +0 -1
  327. package/apps/web/dist/assets/ConnectorsSection-BYOrwccO.js +0 -1
  328. package/apps/web/dist/assets/EditorPage-BFUQzJpN.js +0 -3
  329. package/apps/web/dist/assets/FlowPreview-BXf4EKjU.js +0 -1
  330. package/apps/web/dist/assets/LangSwitch-BLB7dDce.js +0 -1
  331. package/apps/web/dist/assets/Marketplace-B3NoH5Va.js +0 -2
  332. package/apps/web/dist/assets/NewWizardChannels-DhmYe2C8.js +0 -1
  333. package/apps/web/dist/assets/NewWizardPage-MGKJVDp2.js +0 -7
  334. package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
  335. package/apps/web/dist/assets/ProtocolSection-B1MshkAx.js +0 -1
  336. package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
  337. package/apps/web/dist/assets/Results-DI4EHtkh.js +0 -1
  338. package/apps/web/dist/assets/RunDrawer-xXcbQ9wP.js +0 -1
  339. package/apps/web/dist/assets/SettingsPage-BcqqYDqw.js +0 -2
  340. package/apps/web/dist/assets/SetupPage-DG3fJ6fk.js +0 -1
  341. package/apps/web/dist/assets/SharePage-Drntg_oj.js +0 -1
  342. package/apps/web/dist/assets/SkillEditor-Ca_bzmjD.js +0 -1
  343. package/apps/web/dist/assets/Skills-BcgxuD15.js +0 -9
  344. package/apps/web/dist/assets/SpacePage-CzQAEQj8.js +0 -2
  345. package/apps/web/dist/assets/StudioHome-DWTDTslp.js +0 -1
  346. package/apps/web/dist/assets/TableEditor-DirMDIGk.js +0 -7
  347. package/apps/web/dist/assets/UpdateCheck-C6GlE6Am.js +0 -2
  348. package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
  349. package/apps/web/dist/assets/changelog-CMovB3yB.js +0 -1
  350. package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
  351. package/apps/web/dist/assets/host-DNvnJXoi.js +0 -69
  352. package/apps/web/dist/assets/i18n-WXeVnv7i.js +0 -55
  353. package/apps/web/dist/assets/index-D1iL3986.css +0 -1
  354. package/apps/web/dist/assets/index-DOq0CvXM.js +0 -102
  355. package/apps/web/dist/assets/oss-credits-C4SGbRkz.js +0 -1
  356. package/apps/web/dist/assets/theme-23bNrOQh.js +0 -14
  357. package/apps/web/dist/assets/ui-DkEhb2Rt.js +0 -16
  358. package/apps/web/dist/assets/viewers-CmGDpBjn.js +0 -2
  359. /package/apps/web/dist/assets/{host-BrP-ENHg.css → terminal-BrP-ENHg.css} +0 -0
  360. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.d.ts +0 -0
  361. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.d.ts +0 -0
  362. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.d.ts +0 -0
  363. /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.d.ts +0 -0
@@ -2,16 +2,19 @@ import { appendFileSync, existsSync, readFileSync } from "node:fs";
2
2
  import { homedir, totalmem } from "node:os";
3
3
  import { delimiter, join } from "node:path";
4
4
  import * as p from "@clack/prompts";
5
+ import { ollamaAddress, pullModel } from "@engenty/local-models/ollama";
6
+ import { CLIENTS, installCommand } from "@engenty/model-setup";
7
+ import { appAsksForPassword, freeGb, installOllama, startOllama, suggestedClient, vendorApp, } from "@engenty/model-setup/server";
5
8
  import { LOCAL_DECISION_MODEL } from "../decision-model.js";
6
9
  import { installAll, ON_DEMAND } from "../on-demand.js";
7
10
  import { accountStep } from "./account.js";
8
11
  import { autostartForStatus, setAutostart } from "./autostart.js";
9
- import { installClient, installCommand } from "./clients.js";
12
+ import { installClient } from "./clients.js";
10
13
  import { appStates, connectApps } from "./connect.js";
11
14
  import { runLogged } from "./exec.js";
12
15
  import { command, installedByScript, isCheckout, layout, packageVersion, readInstallNote, writeInstallNote, } from "./home.js";
13
- import { CLIENTS, detectClients, findChrome, findFfmpeg, findOnPath, suggestedClient, vendorApp, } from "./machine.js";
14
- import { appAsksForPassword, DECISION_MODEL_GB, decisionModelProblem, freeGb, installOllama, ollamaState, pullModel, servesDecisions, startOllama, } from "./ollama.js";
16
+ import { detectClients, findChrome, findFfmpeg, findOnPath } from "./machine.js";
17
+ import { DECISION_MODEL_GB, decisionModelProblem, localOllama, servesDecisions } from "./ollama.js";
15
18
  import { runningRuntime, settings } from "./start.js";
16
19
  import { badge, busy, cmd, cyan, dim, tilde } from "./ui.js";
17
20
  /** The studio as an app of its own: Chrome (or Edge) installs it from the page. */
@@ -25,7 +28,7 @@ function cancelled(value) {
25
28
  }
26
29
  async function install(client, paths) {
27
30
  const task = p.taskLog({ title: `Installing ${client.name}`, limit: 6 });
28
- task.message(dim(installCommand(client, paths)));
31
+ task.message(dim(installCommand(client, paths.clients, process.platform)));
29
32
  const { code, tail } = await installClient(client, paths, (line) => task.message(line));
30
33
  const installed = (await detectClients(paths)).find((state) => state.client.id === client.id);
31
34
  if (code === 0 && installed?.path) {
@@ -186,7 +189,7 @@ const gb = (bytes) => (bytes / 2 ** 30).toFixed(1);
186
189
  * download of about 11 GB.
187
190
  */
188
191
  async function decisionModelStep(paths, interactive) {
189
- const state = await ollamaState();
192
+ const state = await localOllama();
190
193
  if (state.version && !servesDecisions(state.version)) {
191
194
  p.log.warn(`Ollama ${state.version} is too old for a decision model (it needs 0.35 or newer).\n${dim(`Update Ollama, then run ${cmd("setup")} again.`)}`);
192
195
  return;
@@ -236,7 +239,7 @@ async function decisionModelStep(paths, interactive) {
236
239
  if (!task) {
237
240
  p.log.info("Ollama’s own installer runs now and asks for your password.");
238
241
  }
239
- const outcome = await installOllama(paths, (line) => task?.message(line));
242
+ const outcome = await installOllama(paths.logs, (line) => task?.message(line));
240
243
  if (!outcome.ok) {
241
244
  const text = `Ollama didn’t install. ${outcome.message}`;
242
245
  task ? task.error(text) : p.log.error(text);
@@ -245,7 +248,7 @@ async function decisionModelStep(paths, interactive) {
245
248
  const installed = `Ollama installed ${dim(tilde(outcome.message))}`;
246
249
  task ? task.success(installed) : p.log.success(installed);
247
250
  // Linux's installer starts it as a service already.
248
- ({ path: ollama, version } = await ollamaState());
251
+ ({ path: ollama, version } = await localOllama());
249
252
  }
250
253
  if (!version) {
251
254
  if (appAsksForPassword(ollama)) {
@@ -253,7 +256,7 @@ async function decisionModelStep(paths, interactive) {
253
256
  }
254
257
  const spinner = p.spinner();
255
258
  spinner.start("Waiting for Ollama");
256
- version = await startOllama(ollama, paths);
259
+ version = await startOllama(ollama, paths.logs);
257
260
  if (!version) {
258
261
  spinner.error(`Ollama isn’t answering. Start it, then run ${cmd("setup")} again.`);
259
262
  return;
@@ -267,7 +270,7 @@ async function decisionModelStep(paths, interactive) {
267
270
  const spinner = p.spinner();
268
271
  spinner.start(`Downloading ${model}`);
269
272
  try {
270
- await pullModel(model, (done, total) => spinner.message(`Downloading ${model} ${gb(done)} of ${gb(total)} GB`));
273
+ await pullModel(ollamaAddress(), model, (done, total) => spinner.message(`Downloading ${model} ${gb(done)} of ${gb(total)} GB`));
271
274
  spinner.stop(`Decision model: ${model} ${dim(`in Ollama ${version}`)}`);
272
275
  }
273
276
  catch (error) {
@@ -1,3 +1,4 @@
1
+ import { ollamaRoot } from "@engenty/local-models/ollama";
1
2
  /**
2
3
  * A decision model on the person's own machine: Cloudflare's Clef-flash (open weights, Apache
3
4
  * 2.0), which Ollama 0.35 and newer serves at /v1/systemone with the same questions and answers
@@ -6,10 +7,6 @@
6
7
  */
7
8
  /** The model the setup pulls. Clef, its larger sibling, is taken as well where it is there. */
8
9
  export const LOCAL_DECISION_MODEL = "clef-flash";
9
- /** Ollama's own address from the one the runtime uses for its OpenAI-style API (…/v1). */
10
- export function ollamaRoot(url) {
11
- return url.trim().replace(/\/+$/, "").replace(/\/v1$/, "");
12
- }
13
10
  /** The decision model among the models Ollama lists: Clef-flash, else Clef. */
14
11
  export function decisionModelIn(names) {
15
12
  const named = (base) => names.find((n) => n === base || n.startsWith(`${base}:`));
@@ -14,18 +14,18 @@ Use it, change it and share it in any app, open or closed. Keep the licence text
14
14
 
15
15
  | Part | Where | Licence |
16
16
  |---|---|---|
17
- | The wizard format | eighteen files in `packages/shared/src` | MIT or FSL-1.1-MIT, your choice ([LICENSE-MIT](https://github.com/engenty/wizards/blob/main/packages/shared/LICENSE-MIT)) |
17
+ | The wizard format | fifteen files in `packages/shared/src` | MIT or FSL-1.1-MIT, your choice ([LICENSE-MIT](https://github.com/engenty/wizards/blob/main/packages/shared/LICENSE-MIT)) |
18
18
  | The runner | `@engenty/wizards-runner` in `packages/runner` | MIT ([LICENSE](https://github.com/engenty/wizards/blob/main/packages/runner/LICENSE)) |
19
19
  | The plugin for the AI apps | `plugin/`, without the engenty figures in it | MIT ([LICENSE](https://github.com/engenty/wizards/blob/main/plugin/LICENSE)) |
20
- | The libraries | `@engenty/decision-model`, `@engenty/search-index`, `@engenty/search-libsql`, `@engenty/goose`, `@engenty/vault`, `@engenty/plugins` and `@engenty/browser` in `packages/` | MIT (the `LICENSE` in each folder) |
20
+ | The libraries | `@engenty/chatviews`, `@engenty/decision-model`, `@engenty/search-index`, `@engenty/search-libsql`, `@engenty/tool-harness`, `@engenty/goose`, `@engenty/vault`, `@engenty/plugins`, `@engenty/browser`, `@engenty/local-models` and `@engenty/model-setup` in `packages/` | MIT (the `LICENSE` in each folder) |
21
21
 
22
22
  ### The wizard format
23
23
 
24
- These eighteen files define a wizard, read it and pack it as a `.wizard` file:
24
+ These fifteen files define a wizard, read it and pack it as a `.wizard` file:
25
25
 
26
- - `definition.ts`, `fit.ts`, `numbers.ts`, `run.ts`, `runner-texts.ts`, `shape.ts`
26
+ - `definition.ts`, `fit.ts`, `run.ts`, `runner-texts.ts`
27
27
  - `run-schema.ts`: what a wizard takes and gives, as JSON Schema
28
- - `sharing.ts`, `store.ts`, `surface.ts`, `texts.ts`, `translation.ts`
28
+ - `sharing.ts`, `store.ts`, `texts.ts`, `translation.ts`
29
29
  - `theme.ts`: a theme’s values, which a `.wizard` file carries
30
30
  - `wizard-data.ts`: the SQL of a wizard’s own data, read and checked
31
31
  - `wizard-package.ts`: the `.wizard` file and its `wizard.json`
@@ -33,8 +33,8 @@ These eighteen files define a wizard, read it and pack it as a `.wizard` file:
33
33
 
34
34
  Each says `SPDX-License-Identifier: FSL-1.1-MIT OR MIT` in its first line, and you choose which
35
35
  of the two licences you take them under. Take MIT, and you can use the format in any tool: an
36
- editor, a converter, your own runtime. The files import only each other and zod, so they work
37
- without the rest of engenty wizards.
36
+ editor, a converter, your own runtime. The files import only each other, zod and `@engenty/chatviews` (MIT: the views, the calc
37
+ language and the shapes of data), so they work without the rest of engenty wizards.
38
38
 
39
39
  ### The runner
40
40
 
@@ -44,12 +44,15 @@ MIT, the format files it bundles included. Your own app can draw runs with it
44
44
 
45
45
  ### The libraries
46
46
 
47
- Seven libraries go to npm with each release, at its version:
47
+ Eleven libraries go to npm with each release, at its version:
48
48
 
49
49
  - `@engenty/decision-model`: one request to a decision model, by whichever way is set up (the
50
50
  Vercel AI Gateway, TypeSafe’s API or Ollama)
51
- - `@engenty/search-index`: what every search index meets, chunks, scoring and embedders
51
+ - `@engenty/search-index`: what every search index meets, chunks, scoring, embedders and the ways
52
+ to one, and a search over a catalogue in memory by words and meaning
52
53
  - `@engenty/search-libsql`: a search index on libSQL, full text and vectors
54
+ - `@engenty/tool-harness`: one harness around an agent’s tools: the few it always has, a search
55
+ for the rest, one call that runs what was found, and what a model of which level may use
53
56
  - `@engenty/goose`: Goose, the copilot: a chat with tools and adapters for the Anthropic and
54
57
  OpenAI SDKs and the Vercel AI SDK
55
58
  - `@engenty/vault`: secrets sealed with AES-256-GCM and bound to where they belong, key rings
@@ -62,6 +65,14 @@ Seven libraries go to npm with each release, at its version:
62
65
  - `@engenty/browser`: a browser for agents on Mastra’s agent-browser provider: its tools for any
63
66
  tool system, none that runs the model’s JavaScript, and a private fill that types a password
64
67
  or a code only into a field on the expected website
68
+ - `@engenty/local-models`: the models on a person’s own computer: Ollama (its models, what each
69
+ can do, which fits the memory, downloads, and a model on its own chat API with the context
70
+ length set), the AI clients signed in on their subscription (Claude Code, Codex, Cursor
71
+ Agent: found, signed in, run headless as a model or as a chat with one MCP server), and a
72
+ short real call that says whether each answers
73
+ - `@engenty/model-setup`: the setup in which a person picks what an app thinks with, shared by
74
+ engenty wizards and wizards.bot: the AI clients it offers, how each is found, installed and
75
+ signed in through a terminal in the page, and the routes the page asks
65
76
 
66
77
  They depend only on each other and on packages under MIT or a licence as permissive.
67
78
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Command line
3
3
  description: The wizards command – start, setup, status, update – and the settings file on your computer.
4
- version: 0.20.4
4
+ version: 0.20.5
5
5
  ---
6
6
 
7
7
  ## Commands
@@ -28,7 +28,7 @@ version: 0.20.4
28
28
  | `wizards disconnect [app …]` | Takes them out again |
29
29
  | `wizards mcp` | Runs the MCP server over stdio. AI apps start it; you don’t |
30
30
  | `wizards uninstall` | Takes engenty wizards off this computer. It shows what it will remove first and asks about your data on its own; your data is kept unless you choose to delete it. `--dry-run` only shows the plan, `--yes` asks nothing and keeps your data, `--yes --delete-data` deletes it too. See [Remove](./install.md#remove) |
31
- | `wizards bot` | Installs [wizards.bot](https://github.com/engenty/wizards-bot), your own agent in a home of your own, on this computer. It doesn’t need engenty wizards: `npx wizards bot install` works on its own. `install` puts the home into `~/.engenty/wizards/bot`, starts it with your computer on port 4748 (or the next free one; 4747 stays free for the wizards.bot Mac app) and opens its setup. `install <folder>`, for example `install .` or `install ./test01`, puts a home of its own into that folder, beside the others: its program, its data, its port and its service. Every other command takes the folder after it too; without one, it means the home in `~/.engenty/wizards`. `setup` opens the setup again and shows a code for your phone. `setup --link <address> <code>` links this computer to your home on wizards.bot, so it uses this computer’s models while this computer is on. `status` shows the home and a line for each home in a folder. `stop` stops a home until you log in again or `start` it. `tunnel` puts a home on the internet with Tailscale Funnel, at an `https://` address, once a device is paired with it; `tunnel --off` takes it off again. `update` and `uninstall` do what they say. Your home’s data stays unless you add `--purge`, which asks first. On Windows it isn’t available yet |
31
+ | `wizards bot` | Installs [wizards.bot](https://github.com/engenty/wizards-bot), your own agent in a home of your own, on this computer. It doesn’t need engenty wizards: `npx wizards bot install` works on its own. `install` puts the home into `~/.engenty/wizards/bot`, starts it with your computer on port 4748 (or the next free one; 4747 stays free for the wizards.bot Mac app) and opens its setup. `install <folder>`, for example `install .` or `install ./test01`, puts a home of its own into that folder, beside the others: its program, its data, its port and its service. Every other command takes the folder after it too; without one, it means the home in `~/.engenty/wizards`. `setup` opens the setup again and shows a code for your phone. `setup --link <address> <code>` links this computer to your home on wizards.bot, so it uses this computer’s models while this computer is on. `status` shows the home and a line for each home in a folder. `stop` stops a home until you log in again or `start` it. `tunnel` puts a home on the internet at `https://<name>.wizards.host`, once a device is paired with it. It needs no account: the name, like `k7qf2mxd3a.wizards.host`, comes from a key the tunnel keeps in the home’s `tunnel/claim.pem`, and the same key gets the same name back after `tunnel --off`. `tunnel --account` gives the home your team’s address instead, after you sign in to your wizards account (`--name test01` with it gives a second home `test01.<team>.wizards.host`). The connection goes out from your computer through our relay, and its encryption ends on your computer, so the relay can’t read it. `tunnel --tailscale` uses Tailscale Funnel instead, and `tunnel --off` takes either off again. `update` and `uninstall` do what they say. Your home’s data stays unless you add `--purge`, which asks first. On Windows it isn’t available yet |
32
32
  | `wizards move-files` | Once, after the update to 0.16: moves the files of your spaces (logos, assets, documents) to where they are kept now, by their content, so the same file is stored once. Until then they don’t open. Running it again moves only what is left |
33
33
  | `wizards move-folder-sources` | Once, with Dateien and the new Wissen switched on: each folder the Sources plugin read into Wissen becomes a mounted folder in Dateien, and Wissen takes it from there. What you changed by hand stays yours. Running it again converts only what is left |
34
34
  | `wizards validate <path …>` | Checks wizards without the studio: `.wizard` files, unpacked wizard files, or a wizard’s JSON. `--json` prints the problems as JSON |
@@ -77,6 +77,9 @@ the studio doesn’t: one `NAME=value` per line. Restart engenty wizards after a
77
77
  | `SANDBOX_DATA_URL` | The HTTPS address where the sandbox reaches engenty wizards for a wizard’s own database | `PUBLIC_URL` when it is HTTPS |
78
78
  | `SANDBOX_GUESTS` | The sandbox for runs by people without an account – a wizard’s link, WhatsApp, SMS: `off` or `agentos`, never Docker. With `off`, such a run works without code and says so in its log; with `agentos`, only when agentOS is installed. Your own runs keep the server’s sandbox | `off` |
79
79
  | `OLLAMA_URL` | Where Ollama answers | `http://127.0.0.1:11434/v1` |
80
+ | `LMSTUDIO_URL` | Where LM Studio answers | `http://127.0.0.1:1234/v1` |
81
+ | `LM_API_TOKEN` | LM Studio’s API token, where its server asks for one | none |
82
+ | `MLX_MODELS` | The folder of MLX’s models (Mac with Apple silicon) | `~/.engenty/models/mlx` |
80
83
  | `PLUGINS_DIR` | Folders with plugins, comma-separated. If you set it, it replaces the default | `~/.engenty/wizards/plugins` |
81
84
  | `PLUGINS_WATCH` | With `0`, plugins no longer load again when their files change | `1` |
82
85
  | `GEOCODER_URL` | Finds the place of a location (street, town). If it is not set, a location is only coordinates, and no position leaves your computer | not set |
@@ -91,7 +91,8 @@ export async function callOutside(who, spaceId, name, input, signal) {
91
91
  }
92
92
  try {
93
93
  const result = await tool.execute(data);
94
- if (result && typeof result === "object" && "error" in result) {
94
+ // A run's report carries `error: null` while nothing failed.
95
+ if (result && typeof result === "object" && "error" in result && result.error != null) {
95
96
  const { error, ...data } = result;
96
97
  return { ok: false, error, data };
97
98
  }
@@ -1,6 +1,6 @@
1
+ import { fitData, recordsOf, shapeZod, } from "@engenty/chatviews/shape";
1
2
  import { dataRef, stepShape } from "@engenty/wizards-shared/definition";
2
3
  import { note } from "@engenty/wizards-shared/run";
3
- import { fitData, recordsOf, shapeZod, } from "@engenty/wizards-shared/shape";
4
4
  import { snapshotFile } from "../services/files.js";
5
5
  import { runStepData } from "./data-step.js";
6
6
  import { moduleBody, quickJs, WIZARD_CODE_MEMORY_MB } from "./quickjs.js";
@@ -74,8 +74,8 @@ export async function decide(input) {
74
74
  if (!Object.keys(open).length) {
75
75
  return { answers, source: "systemone" };
76
76
  }
77
- if (signal?.aborted) {
78
- throw new DecisionError("No answer in time.");
77
+ if (signal?.aborted || input.modelOnly) {
78
+ throw new DecisionError(signal?.aborted ? "No answer in time." : "The decision model left it open.");
79
79
  }
80
80
  const filled = await askLanguageModel(input, open, signal);
81
81
  return {
@@ -1,7 +1,8 @@
1
+ import { parseJsonAnswer, renderPrompt } from "@engenty/local-models/clients";
1
2
  import { and, asc, eq, isNull } from "drizzle-orm";
2
3
  import { nanoid } from "nanoid";
3
4
  import { db, schema } from "../db/client.js";
4
- import { parseJsonAnswer, renderPrompt } from "../harness/prompt.js";
5
+ import { CLIENT_WORDS } from "../harness/prompt.js";
5
6
  /** An offer not renewed for this long is forgotten: the person left the run. */
6
7
  const OFFER_TTL_MS = 30 * 60_000;
7
8
  /** How long the phone has to answer before the runtime thinks on its own. */
@@ -117,7 +118,7 @@ export class DeviceModel {
117
118
  if (format !== "text" && format !== "json") {
118
119
  return null;
119
120
  }
120
- const { system, prompt, warnings } = renderPrompt(options.prompt);
121
+ const { system, prompt, warnings } = renderPrompt(options.prompt, undefined, CLIENT_WORDS);
121
122
  if (warnings.length || system.length + prompt.length > this.maxChars) {
122
123
  return null;
123
124
  }
@@ -1,5 +1,5 @@
1
+ import { readNumber } from "@engenty/chatviews/numbers";
1
2
  import { isDecidedField, isLang, isLocationValue, MAX_FILES, offeredSlot, shownFields, } from "@engenty/wizards-shared/definition";
2
- import { readNumber } from "@engenty/wizards-shared/numbers";
3
3
  import { note, saidText } from "@engenty/wizards-shared/run";
4
4
  /** The field errors in a language, for whoever reads them. */
5
5
  export function fieldErrorsIn(errors, lang) {
@@ -1,11 +1,11 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
2
  import { createHash } from "node:crypto";
3
+ import { fitData } from "@engenty/chatviews/shape";
3
4
  import { marginOf, } from "@engenty/wizards-shared/decision";
4
5
  import { allFields, branchValues, cardsFromData, conditionMatches, dataRef, followRules, formatsFor, formNeeds, isDataStep, isDecidedField, LIST_FORMATS, listRef, MAX_SHOWN_FIELDS, optionsFromData, outputOf, RUN_DONE_SIGNAL, sectionOf, sectionsOf, signalMissing, textLang, waitDurationMs, whenCalc, whenNames, whenValue, wizardLang, } from "@engenty/wizards-shared/definition";
5
6
  import { agentsMismatch, requiresOf, withRequires } from "@engenty/wizards-shared/requires";
6
7
  import { CAN_GO_BACK, isNoteTime, note, RUN_ENDED, saidText, } from "@engenty/wizards-shared/run";
7
8
  import { CONVERSATION_RUNNERS, DEFAULT_RUNNER_SETTINGS } from "@engenty/wizards-shared/runners";
8
- import { fitData } from "@engenty/wizards-shared/shape";
9
9
  import { FlowRefused, transition, } from "@engenty/wizards-shared/transition";
10
10
  import { machineTranslated, translateDefinition } from "@engenty/wizards-shared/translation";
11
11
  import { wizardAgentsUsed } from "@engenty/wizards-shared/wizard-code";
@@ -1,14 +1,15 @@
1
+ import { fitData, labelOf, recordsOf, shapeJsonSchema, shapeLines, shapeZod, titleKey, } from "@engenty/chatviews/shape";
2
+ import { validateSurface } from "@engenty/chatviews/surface";
1
3
  import { pOf } from "@engenty/wizards-shared/decision";
2
4
  import { allFields, classIdOf, dataRef, decisionAsAgent, langNameEn, localeOf, stepShape, templateRefs, textClassOf, wizardLang, } from "@engenty/wizards-shared/definition";
3
5
  import { note as runNote } from "@engenty/wizards-shared/run";
4
- import { fitData, labelOf, recordsOf, shapeJsonSchema, shapeLines, shapeZod, titleKey, } from "@engenty/wizards-shared/shape";
5
6
  import { mainLogo, ruleLines, runTheme } from "@engenty/wizards-shared/spaces";
6
- import { validateSurface, } from "@engenty/wizards-shared/surface";
7
7
  import { Agent } from "@mastra/core/agent";
8
8
  import { generateText, jsonSchema, Output, parsePartialJson } from "ai";
9
9
  import { subjectsOf } from "../broker/rwx.js";
10
10
  import { extFor, loadAsset, loadAssetText } from "../files/storage.js";
11
11
  import { snapshotHtmlImages } from "../files/web-images.js";
12
+ import { withLocalCall } from "../local-call.js";
12
13
  import { generateImageMedia, generateSpeechMedia, generateVideoMedia, } from "../media/generate.js";
13
14
  import { markMedia } from "../media/marking.js";
14
15
  import { agentModel, attachTools, costOf, isHarnessVendor, keepsOwnLoop, takesTools, textModel, totalUsage, } from "../models.js";
@@ -222,6 +223,23 @@ function foundLines(step, ctx) {
222
223
  },
223
224
  };
224
225
  }
226
+ /** From how many tokens on a run says that a local model reads them: below, it takes a moment. */
227
+ const LONG_READ = 1_500;
228
+ /** Says in the run's log once what a local model does before it answers: it can take a minute. */
229
+ function waitingLines(ctx) {
230
+ const told = new Set();
231
+ return (waiting) => {
232
+ const code = waiting?.state === "loading"
233
+ ? "loadsModel"
234
+ : waiting?.state === "reading" && (waiting.total ?? 0) >= LONG_READ
235
+ ? "modelReads"
236
+ : null;
237
+ if (code && !told.has(code)) {
238
+ told.add(code);
239
+ void ctx.emit("info", { code }).catch(() => undefined);
240
+ }
241
+ };
242
+ }
225
243
  /** Runs a json step's agent as a stream, with `foundLines`. Returns what `generate` would: the text, the steps and the usage. */
226
244
  async function streamWithProgress(agent, message, options, step, ctx) {
227
245
  const found = foundLines(step, ctx);
@@ -631,8 +649,9 @@ export async function runAgentStep(step, ctx, decision = false, agentPart) {
631
649
  ]
632
650
  : request;
633
651
  let result;
652
+ const local = { onWaiting: waitingLines(ctx) };
634
653
  if (turn) {
635
- const end = await durableTurn(turn, ctx, {
654
+ const end = await withLocalCall(local, () => durableTurn(turn, ctx, {
636
655
  instructions: system,
637
656
  model: agentModel(resolved),
638
657
  tools,
@@ -642,7 +661,7 @@ export async function runAgentStep(step, ctx, decision = false, agentPart) {
642
661
  // Each model step is booked as it ends: a crash neither repeats nor loses the ones before it.
643
662
  onStepUsage: (usage) => ctx.chargeUsd(costOf(resolved, usage)),
644
663
  onText: step.output.format === "json" ? foundLines(step, ctx).text : undefined,
645
- });
664
+ }));
646
665
  assets.splice(0, assets.length, ...end.assets);
647
666
  result = { text: end.text, steps: [{ text: end.closing }] };
648
667
  }
@@ -655,10 +674,10 @@ export async function runAgentStep(step, ctx, decision = false, agentPart) {
655
674
  tools,
656
675
  });
657
676
  // A json step streams, so the person sees its entries as they are written (`found`).
658
- result =
659
- step.output.format === "json"
660
- ? await streamWithProgress(agent, message, { maxSteps, abortSignal: ctx.signal }, step, ctx)
661
- : await agent.generate(message, { maxSteps, abortSignal: ctx.signal });
677
+ const options = { maxSteps, abortSignal: ctx.signal };
678
+ result = await withLocalCall(local, () => step.output.format === "json"
679
+ ? streamWithProgress(agent, message, options, step, ctx)
680
+ : agent.generate(message, options));
662
681
  await ctx.chargeUsd(costOf(resolved, await totalUsage(result)));
663
682
  }
664
683
  // `result.text` strings together what the model said between tool calls ("I open the page …").
@@ -1,6 +1,6 @@
1
+ import { validateSurface } from "@engenty/chatviews/surface";
1
2
  import { assembleSurface, dataRef, listRef, } from "@engenty/wizards-shared/definition";
2
3
  import { note } from "@engenty/wizards-shared/run";
3
- import { validateSurface } from "@engenty/wizards-shared/surface";
4
4
  import { decide } from "./decide.js";
5
5
  import { answersAsText, resolveRef } from "./template.js";
6
6
  import { StepError } from "./types.js";
@@ -1,5 +1,5 @@
1
+ import { formatMoney } from "@engenty/chatviews/numbers";
1
2
  import { allFields, isAudioValue, isLocationValue, itemsTotals, localeOf, locationText, wizardLang, } from "@engenty/wizards-shared/definition";
2
- import { formatMoney } from "@engenty/wizards-shared/numbers";
3
3
  import { fontLicenseWords, gradientCss, textStyleLine, } from "@engenty/wizards-shared/spaces";
4
4
  import { listAsMarkdown } from "@engenty/wizards-shared/store";
5
5
  import { prompt } from "../prompts.js";
@@ -216,6 +216,7 @@ export const env = {
216
216
  */
217
217
  browserFastLoop: str("BROWSER_FAST_LOOP") !== "off",
218
218
  ollamaUrl: str("OLLAMA_URL", "http://127.0.0.1:11434/v1"),
219
+ lmstudioUrl: str("LMSTUDIO_URL", "http://127.0.0.1:1234/v1"),
219
220
  /** What each model class runs on when this runtime resolves classes itself (own keys, Ollama). */
220
221
  models: {
221
222
  classifier: str("MODEL_CLASSIFIER", "deepseek/deepseek-v4.1-flash"),
@@ -2,13 +2,14 @@ import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
2
2
  import { release } from "node:os";
3
3
  import { dirname, join, resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
+ import { ClientModel, lastJson, runClient, } from "@engenty/local-models/clients";
5
6
  import { langOf, SPEECH_LOCALES } from "@engenty/wizards-shared/definition";
6
7
  import { nanoid } from "nanoid";
7
8
  import { env } from "../env.js";
8
9
  import { ffmpeg, hasFfmpeg } from "../media/ffmpeg.js";
9
10
  import { ModelUnavailableError, NotedError } from "../model-errors.js";
10
11
  import { prompt } from "../prompts.js";
11
- import { HarnessModel, lastJson, runClient, } from "./model.js";
12
+ import { modelOptions } from "./model.js";
12
13
  /**
13
14
  * Apple Intelligence on this Mac as a model: the on-device foundation model of macOS 26, run
14
15
  * through `wizards-apple` (apps/runtime/apple/main.swift) — one process per call, as every
@@ -130,7 +131,7 @@ export function appleFailure(error) {
130
131
  function appleFailed(detail) {
131
132
  return new NotedError({ code: "appleFailed", params: { detail: detail.slice(0, 480) } });
132
133
  }
133
- class AppleModel extends HarnessModel {
134
+ class AppleModel extends ClientModel {
134
135
  provider = "apple";
135
136
  /** The model keeps to the schema itself (guided generation). */
136
137
  nativeSchema = true;
@@ -163,7 +164,7 @@ class AppleModel extends HarnessModel {
163
164
  }
164
165
  /** `apple:default` or `apple:tagging` as a language model. */
165
166
  export function appleModel(alias) {
166
- return new AppleModel(APPLE, alias || "default");
167
+ return new AppleModel(APPLE, alias || "default", modelOptions(APPLE));
167
168
  }
168
169
  /** The Mac's own language: what a voice note is most likely in, unless the call names one. */
169
170
  function systemLocale() {
@@ -0,0 +1,117 @@
1
+ import { existsSync, readdirSync, readFileSync, rmSync, statSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { CLIENTS, ClientImageModel, CODEX_BIN, clientFailure, codexAnswer, codexExecArgs, resolveEnv, runClient, } from "@engenty/local-models/clients";
5
+ import { note } from "@engenty/wizards-shared/run";
6
+ import { prompt } from "../prompts.js";
7
+ import { modelOptions } from "./model.js";
8
+ /**
9
+ * Claude Code, Codex, Antigravity and Cursor Agent as the runtime runs them: the clients of
10
+ * @engenty/local-models/clients with the model each text class runs on, what the person reads
11
+ * when the account cannot pay, and Codex's images.
12
+ */
13
+ /** A client of the package as a harness of the runtime. */
14
+ function harnessOf(client, extra) {
15
+ const h = {
16
+ id: client.id,
17
+ name: client.name,
18
+ bin: client.bin,
19
+ passThrough: client.passThrough,
20
+ keyVars: client.keyVars,
21
+ auth: (env) => client.auth(env),
22
+ version: (env) => client.version(env),
23
+ login: client.login,
24
+ model: (alias, effort) => client.model(alias, { ...modelOptions(h), effort }),
25
+ ...extra,
26
+ };
27
+ return h;
28
+ }
29
+ export const claude = harnessOf(CLIENTS.claude, {
30
+ classes: { classifier: "haiku", low: "sonnet", standard: "opus", high: "opus" },
31
+ exhausted: note("anthropicAccountClaudeCode"),
32
+ });
33
+ /**
34
+ * Models a ChatGPT sign-in runs (checked 2026-10-04): Luna for small calls, Sol as the
35
+ * workhorse, Astra for the hardest work. A binding `codex/<model>` names another;
36
+ * `codex/default` = the model the client picks itself.
37
+ */
38
+ const CODEX_CLASSES = {
39
+ classifier: "gpt-6-luna",
40
+ low: "gpt-6.1-sol",
41
+ standard: "gpt-6.1-sol",
42
+ high: "gpt-6-astra",
43
+ };
44
+ /**
45
+ * Images: `codex exec` with the built-in image tool, the reference photos attached with `-i`.
46
+ * Codex keeps what it made under CODEX_HOME/generated_images/<thread>; the file is read from
47
+ * there and that folder removed. `codex/image` runs the tool on the low class's model.
48
+ */
49
+ class CodexImageModel extends ClientImageModel {
50
+ provider = "codex";
51
+ async invoke(call) {
52
+ const request = [
53
+ call.prompt,
54
+ call.files.length ? prompt("services", "harness.codex_image.edit") : "",
55
+ call.aspectRatio ? `Aspect ratio: ${call.aspectRatio}.` : "",
56
+ prompt("services", "harness.codex_image.once"),
57
+ ]
58
+ .filter(Boolean)
59
+ .join("\n\n");
60
+ const args = [
61
+ ...codexExecArgs(call.dir, false),
62
+ "-m",
63
+ this.modelId === "image" ? CODEX_CLASSES.low : this.modelId,
64
+ ];
65
+ for (const file of call.files) {
66
+ args.push("-i", file);
67
+ }
68
+ const { env } = await resolveEnv(CLIENTS.codex);
69
+ const { stdout, stderr, code } = await runClient(CODEX_BIN, args, {
70
+ cwd: call.dir,
71
+ env,
72
+ signal: call.signal,
73
+ stdin: request,
74
+ });
75
+ const { answer, failure } = codexAnswer(stdout);
76
+ if (failure || !answer?.sessionId) {
77
+ throw clientFailure(this.client, failure ?? stderr.trim() ?? `exit ${code}`);
78
+ }
79
+ const folder = join(env.CODEX_HOME?.trim() || join(homedir(), ".codex"), "generated_images", answer.sessionId);
80
+ try {
81
+ const made = existsSync(folder)
82
+ ? readdirSync(folder)
83
+ .filter((f) => /\.(png|jpe?g|webp)$/i.test(f))
84
+ .map((f) => join(folder, f))
85
+ .sort((a, b) => statSync(b).mtimeMs - statSync(a).mtimeMs)
86
+ : [];
87
+ if (!made[0]) {
88
+ throw new Error(`Codex made no image: ${answer.text.slice(0, 300)}`);
89
+ }
90
+ return new Uint8Array(readFileSync(made[0]));
91
+ }
92
+ finally {
93
+ rmSync(folder, { recursive: true, force: true });
94
+ }
95
+ }
96
+ }
97
+ export const codex = harnessOf(CLIENTS.codex, {
98
+ classes: CODEX_CLASSES,
99
+ exhausted: note("chatgptAccountCodexSigned"),
100
+ image: {
101
+ alias: "image",
102
+ model: (alias) => new CodexImageModel(codex, alias || "image", modelOptions(codex)),
103
+ },
104
+ });
105
+ /** The models carry their effort in the name (`withEffort`). */
106
+ export const antigravity = harnessOf(CLIENTS.antigravity, {
107
+ classes: {
108
+ classifier: "gemini-3.8-flash-low",
109
+ low: "gemini-3.8-flash-medium",
110
+ standard: "gemini-3.8-flash-high",
111
+ high: "gemini-3.8-flash-high",
112
+ },
113
+ });
114
+ /** "auto" = the model the client picks itself; a binding `cursor/<model>` names one. */
115
+ export const cursor = harnessOf(CLIENTS.cursor, {
116
+ classes: { classifier: "auto", low: "auto", standard: "auto", high: "auto" },
117
+ });