@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,39 @@
1
+ /**
2
+ * The few words the views say themselves (a sheet's close, a checklist's count, a file's open)
3
+ * and the language their numbers are written in. A host that has a dictionary of its own (the
4
+ * runner, with the translations of a wizard) hands it in with `configureViews`; without one the
5
+ * views speak English.
6
+ */
7
+ export type ViewTextKey = keyof typeof EN;
8
+ declare const EN: {
9
+ "common.close": string;
10
+ "run.less": string;
11
+ "run.more": string;
12
+ "run.share": string;
13
+ "share.copied": string;
14
+ "run.yes": string;
15
+ "run.no": string;
16
+ "surface.allDone": string;
17
+ "surface.close": string;
18
+ "surface.done": string;
19
+ "surface.file": string;
20
+ "surface.files": string;
21
+ "surface.foundIn": string;
22
+ "surface.openFile": string;
23
+ "surface.required": string;
24
+ "surface.sentBy": string;
25
+ };
26
+ type Vars = Record<string, string | number>;
27
+ /**
28
+ * Where the views take their words and their language from: `text` gets the keys above (the
29
+ * runner's own keys, so its translations apply), `lang` the code numbers are written for.
30
+ */
31
+ export declare function configureViews(host: {
32
+ text?: (key: ViewTextKey, vars?: Vars) => string;
33
+ lang?: () => string;
34
+ }): void;
35
+ /** A line of the views in the host's language. */
36
+ export declare function t(key: ViewTextKey, vars?: Vars): string;
37
+ /** The language the views write numbers in. */
38
+ export declare function viewLang(): string;
39
+ export {};
@@ -0,0 +1,42 @@
1
+ // SPDX-License-Identifier: MIT
2
+ const EN = {
3
+ "common.close": "Close",
4
+ "run.less": "Less",
5
+ "run.more": "More",
6
+ "run.share": "Share",
7
+ "share.copied": "Copied",
8
+ "run.yes": "Yes",
9
+ "run.no": "No",
10
+ "surface.allDone": "All done",
11
+ "surface.close": "Close",
12
+ "surface.done": "{done} of {total}",
13
+ "surface.file": "File",
14
+ "surface.files": "{n} files",
15
+ "surface.foundIn": "Found in",
16
+ "surface.openFile": "Open",
17
+ "surface.required": "This one is still empty.",
18
+ "surface.sentBy": "Sent by {name}",
19
+ };
20
+ const fill = (line, vars) => vars ? line.replace(/\{(\w+)\}/g, (whole, name) => String(vars[name] ?? whole)) : line;
21
+ let text = (key, vars) => fill(EN[key], vars);
22
+ let langOf = () => "en";
23
+ /**
24
+ * Where the views take their words and their language from: `text` gets the keys above (the
25
+ * runner's own keys, so its translations apply), `lang` the code numbers are written for.
26
+ */
27
+ export function configureViews(host) {
28
+ if (host.text) {
29
+ text = host.text;
30
+ }
31
+ if (host.lang) {
32
+ langOf = host.lang;
33
+ }
34
+ }
35
+ /** A line of the views in the host's language. */
36
+ export function t(key, vars) {
37
+ return text(key, vars);
38
+ }
39
+ /** The language the views write numbers in. */
40
+ export function viewLang() {
41
+ return langOf();
42
+ }
@@ -0,0 +1,112 @@
1
+ import { type ButtonHTMLAttributes, type InputHTMLAttributes, type ReactNode, type TextareaHTMLAttributes } from "react";
2
+ export declare function cn(...parts: (string | false | null | undefined)[]): string;
3
+ type Variant = "primary" | "secondary" | "ghost" | "quiet" | "danger";
4
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
5
+ variant?: Variant;
6
+ size?: "sm" | "md" | "lg";
7
+ busy?: boolean;
8
+ } & import("react").RefAttributes<HTMLButtonElement>>;
9
+ export declare function IconButton({ label, className, children, ...rest }: ButtonHTMLAttributes<HTMLButtonElement> & {
10
+ label: string;
11
+ }): import("react").JSX.Element;
12
+ export declare const Input: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
13
+ /** The native colour picker as a swatch; its chip sits concentric in the frame. */
14
+ export declare function Swatch(props: Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "className">): import("react").JSX.Element;
15
+ /** A textarea that grows with its content. */
16
+ export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & {
17
+ minRows?: number;
18
+ maxRows?: number;
19
+ } & import("react").RefAttributes<HTMLTextAreaElement>>;
20
+ export declare function Select({ value, onChange, options, className, placeholder, }: {
21
+ value: string;
22
+ onChange: (v: string) => void;
23
+ options: {
24
+ value: string;
25
+ label: string;
26
+ disabled?: boolean;
27
+ }[];
28
+ className?: string;
29
+ placeholder?: string;
30
+ }): import("react").JSX.Element;
31
+ /** Pills for a handful of options — calmer than a dropdown. */
32
+ export declare function Segmented({ value, onChange, options, multi, disabled, label, }: {
33
+ value: string | string[];
34
+ onChange: (v: any) => void;
35
+ options: string[];
36
+ multi?: boolean;
37
+ /** Options shown but not to be picked. */
38
+ disabled?: string[];
39
+ /** What an option shows; default: the option itself. */
40
+ label?: (option: string) => string;
41
+ }): import("react").JSX.Element;
42
+ /**
43
+ * A row of tabs as one button group, in the look of the theme switch: a thumb slides to the
44
+ * pick and takes its width. The tabs' panels are the caller's.
45
+ */
46
+ export declare function Tabs<T extends string>({ value, onChange, options, label, }: {
47
+ value: T;
48
+ onChange: (next: T) => void;
49
+ /** `disabled`: shown, not to be picked; the caller says why beside the tabs. */
50
+ options: {
51
+ id: T;
52
+ label: string;
53
+ disabled?: boolean;
54
+ }[];
55
+ /** The group's name for a screen reader. */
56
+ label?: string;
57
+ }): import("react").JSX.Element;
58
+ export declare function Switch({ checked, onChange, label, disabled, }: {
59
+ checked: boolean;
60
+ onChange: (v: boolean) => void;
61
+ label?: string;
62
+ disabled?: boolean;
63
+ }): import("react").JSX.Element;
64
+ export declare function Label({ children, hint, required, }: {
65
+ children: ReactNode;
66
+ hint?: ReactNode;
67
+ required?: boolean;
68
+ }): import("react").JSX.Element;
69
+ export declare function Spinner({ className }: {
70
+ className?: string;
71
+ }): import("react").JSX.Element;
72
+ export declare function Card({ className, children, ...rest }: {
73
+ className?: string;
74
+ children: ReactNode;
75
+ } & React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
76
+ /** `icon`: in place of the live dot. `title`: what the chip means, on hover. */
77
+ export declare function Chip({ children, tone, icon, title, }: {
78
+ children: ReactNode;
79
+ tone?: "neutral" | "live" | "warn" | "ember";
80
+ icon?: ReactNode;
81
+ title?: string;
82
+ }): import("react").JSX.Element;
83
+ /**
84
+ * A centred modal on the native <dialog>; on a phone it fills the screen, with no gutter. Its
85
+ * height does not jump while it is open: a dialog
86
+ * with tabs, folds or lists (`height="tall"`) stands at a height taken from the window and
87
+ * scrolls inside; any other keeps the tallest height it has had, so switching to a shorter tab
88
+ * or folding a section leaves it where it is.
89
+ */
90
+ export declare function Dialog({ open, onClose, title, children, wide, bare, height, }: {
91
+ open: boolean;
92
+ onClose: () => void;
93
+ title?: ReactNode;
94
+ children: ReactNode;
95
+ /** `"page"`: room for a document. `"full"`: nearly the whole window, for a file to look at. */
96
+ wide?: boolean | "page" | "full";
97
+ /**
98
+ * The children are the panel: the dialog itself draws no card, clips nothing (a close button
99
+ * may sit on the panel's edge) and fills the screen of a phone.
100
+ */
101
+ bare?: boolean;
102
+ /** `"tall"`: as tall as the window allows (up to 56 rem), whatever is in it. */
103
+ height?: "auto" | "tall";
104
+ }): import("react").JSX.Element;
105
+ export declare function Empty({ children }: {
106
+ children: ReactNode;
107
+ }): import("react").JSX.Element;
108
+ /** A sentence of the server with its web addresses as links, named by their host. */
109
+ export declare function LinkedText({ text }: {
110
+ text: string;
111
+ }): (string | import("react").JSX.Element)[];
112
+ export {};
@@ -0,0 +1,212 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // SPDX-License-Identifier: MIT
3
+ import { forwardRef, useEffect, useLayoutEffect, useRef, useState, } from "react";
4
+ import { t } from "./texts.js";
5
+ export function cn(...parts) {
6
+ return parts.filter(Boolean).join(" ");
7
+ }
8
+ const VARIANTS = {
9
+ primary: "bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]",
10
+ secondary: "bg-card text-ink border border-border hover:bg-paper-2",
11
+ ghost: "text-ink-2 hover:text-ink hover:bg-accent",
12
+ quiet: "bg-paper-2 text-ink hover:bg-paper-3",
13
+ danger: "text-rose hover:bg-rose-tint",
14
+ };
15
+ export const Button = forwardRef(function Button({ variant = "primary", size = "md", busy, className, children, disabled, ...rest }, ref) {
16
+ return (_jsxs("button", { ref: ref, type: "button", "data-variant": variant, disabled: disabled || busy, className: cn("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50", size === "sm" && "h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4", size === "md" && "h-10 px-4 text-sm coarse:h-11", size === "lg" && "h-12 px-6 text-[0.9375rem]", VARIANTS[variant], variant === "primary" && "wizard-button", className), ...rest, children: [busy ? _jsx(Spinner, { className: "size-4" }) : null, children] }));
17
+ });
18
+ export function IconButton({ label, className, children, ...rest }) {
19
+ return (_jsx("button", { type: "button", "aria-label": label, title: label, className: cn("inline-flex size-9 shrink-0 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink disabled:opacity-40 coarse:size-11", className), ...rest, children: children }));
20
+ }
21
+ const fieldBase = "wizard-field rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60";
22
+ /** A field fills its row unless the caller gives it a width. */
23
+ function fieldWidth(className) {
24
+ return /(^|\s)w-/.test(className ?? "") ? null : "w-full";
25
+ }
26
+ export const Input = forwardRef(function Input({ className, ...rest }, ref) {
27
+ return (_jsx("input", { ref: ref, className: cn(fieldBase, fieldWidth(className), "h-11", className), ...rest }));
28
+ });
29
+ /** The native colour picker as a swatch; its chip sits concentric in the frame. */
30
+ export function Swatch(props) {
31
+ return (_jsx("input", { type: "color", className: "swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1", ...props }));
32
+ }
33
+ /** A textarea that grows with its content. */
34
+ export const Textarea = forwardRef(function Textarea({ className, minRows = 3, maxRows = 14, onChange, ...rest }, outer) {
35
+ const inner = useRef(null);
36
+ const resize = () => {
37
+ const el = inner.current;
38
+ if (!el) {
39
+ return;
40
+ }
41
+ const lh = Number.parseFloat(getComputedStyle(el).lineHeight) || 22;
42
+ el.style.height = "auto";
43
+ const max = lh * maxRows + 20;
44
+ el.style.height = `${Math.min(Math.max(el.scrollHeight, lh * minRows + 20), max)}px`;
45
+ el.style.overflowY = el.scrollHeight > max ? "auto" : "hidden";
46
+ };
47
+ useLayoutEffect(resize);
48
+ return (_jsx("textarea", { ref: (el) => {
49
+ inner.current = el;
50
+ if (typeof outer === "function") {
51
+ outer(el);
52
+ }
53
+ else if (outer) {
54
+ outer.current = el;
55
+ }
56
+ }, className: cn(fieldBase, fieldWidth(className), "resize-none py-2.5 leading-[1.5]", className), onChange: (e) => {
57
+ resize();
58
+ onChange?.(e);
59
+ }, ...rest }));
60
+ });
61
+ export function Select({ value, onChange, options, className, placeholder, }) {
62
+ return (_jsxs("div", { className: cn("relative", className), children: [_jsxs("select", { value: value, onChange: (e) => onChange(e.target.value), className: cn(fieldBase, "h-11 w-full appearance-none pr-9"), children: [placeholder !== undefined ? _jsx("option", { value: "", children: placeholder }) : null, options.map((o) => (_jsx("option", { value: o.value, disabled: o.disabled, children: o.label }, o.value)))] }), _jsx("svg", { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 size-4 text-ink-3", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })] }));
63
+ }
64
+ /** Pills for a handful of options — calmer than a dropdown. */
65
+ export function Segmented({ value, onChange, options, multi, disabled, label, }) {
66
+ const selected = new Set(Array.isArray(value) ? value : value ? [value] : []);
67
+ return (_jsx("div", { className: "flex flex-wrap gap-2", children: options.map((o) => {
68
+ const on = selected.has(o);
69
+ return (_jsx("button", { type: "button", "aria-pressed": on, disabled: disabled?.includes(o), onClick: () => {
70
+ if (multi) {
71
+ const next = new Set(selected);
72
+ if (on) {
73
+ next.delete(o);
74
+ }
75
+ else {
76
+ next.add(o);
77
+ }
78
+ onChange(options.filter((x) => next.has(x)));
79
+ }
80
+ else {
81
+ onChange(o);
82
+ }
83
+ }, className: cn("h-10 rounded-full border px-4 text-sm transition disabled:pointer-events-none disabled:opacity-60 disabled:line-through coarse:h-11", on
84
+ ? "border-ember bg-ember-tint text-ink"
85
+ : "border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink"), children: label ? label(o) : o }, o));
86
+ }) }));
87
+ }
88
+ const SLIDE = "cubic-bezier(0.3, 0.7, 0.2, 1)";
89
+ /**
90
+ * A row of tabs as one button group, in the look of the theme switch: a thumb slides to the
91
+ * pick and takes its width. The tabs' panels are the caller's.
92
+ */
93
+ export function Tabs({ value, onChange, options, label, }) {
94
+ const buttons = useRef(new Map());
95
+ const [thumb, setThumb] = useState(null);
96
+ // Measured from the picked tab, again when its width changes (fonts, a resize).
97
+ useLayoutEffect(() => {
98
+ const el = buttons.current.get(value);
99
+ if (!el) {
100
+ return;
101
+ }
102
+ const measure = () => setThumb({ x: el.offsetLeft, w: el.offsetWidth });
103
+ measure();
104
+ const observer = new ResizeObserver(measure);
105
+ observer.observe(el);
106
+ return () => observer.disconnect();
107
+ }, [value]);
108
+ return (_jsxs("div", { role: "tablist", "aria-label": label, className: "relative inline-flex items-center rounded-full bg-paper-2 p-0.5 ring-1 ring-border-soft", children: [thumb ? (_jsx("span", { "aria-hidden": "true", className: "absolute top-0.5 bottom-0.5 left-0 rounded-full bg-card shadow-sm motion-reduce:transition-none", style: {
109
+ width: thumb.w,
110
+ transform: `translateX(${thumb.x}px)`,
111
+ transition: `transform 300ms ${SLIDE}, width 300ms ${SLIDE}`,
112
+ } })) : null, options.map((option) => {
113
+ const on = option.id === value;
114
+ return (_jsx("button", { ref: (el) => {
115
+ if (el) {
116
+ buttons.current.set(option.id, el);
117
+ }
118
+ else {
119
+ buttons.current.delete(option.id);
120
+ }
121
+ }, type: "button", role: "tab", "aria-selected": on, disabled: option.disabled && !on, onClick: () => onChange(option.id), className: cn("relative h-8 whitespace-nowrap rounded-full px-4 font-medium text-[0.875rem] transition-colors motion-reduce:transition-none coarse:h-9", on
122
+ ? "text-ink"
123
+ : option.disabled
124
+ ? "cursor-not-allowed text-ink-4"
125
+ : "text-ink-3 hover:text-ink-2"), children: option.label }, option.id));
126
+ })] }));
127
+ }
128
+ export function Switch({ checked, onChange, label, disabled, }) {
129
+ return (_jsx("button", { type: "button", role: "switch", "aria-checked": checked, "aria-label": label, disabled: disabled, onClick: () => onChange(!checked), className: cn(
130
+ // The track stays slim; the tap area around it is a full 44 px.
131
+ "relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:pointer-events-none disabled:opacity-60", checked ? "bg-primary" : "bg-paper-3"), children: _jsx("span", { className: cn("inline-block size-5 rounded-full bg-white shadow-sm transition-transform", checked ? "translate-x-[22px]" : "translate-x-[2px]") }) }));
132
+ }
133
+ export function Label({ children, hint, required, }) {
134
+ return (_jsxs("div", { className: "mb-2", children: [_jsxs("div", { className: "font-medium text-[0.875rem] text-ink", children: [children, required ? _jsx("span", { className: "ml-1 text-ember", children: "*" }) : null] }), hint ? _jsx("div", { className: "mt-0.5 text-[0.8125rem] text-ink-3", children: hint }) : null] }));
135
+ }
136
+ export function Spinner({ className }) {
137
+ return (_jsxs("svg", { className: cn("size-5 animate-spin", className), viewBox: "0 0 24 24", fill: "none", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "3" }), _jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })] }));
138
+ }
139
+ export function Card({ className, children, ...rest }) {
140
+ return (_jsx("div", { className: cn("wizard-card rounded-xl bg-card shadow-soft ring-1 ring-border-soft", className), ...rest, children: children }));
141
+ }
142
+ /** `icon`: in place of the live dot. `title`: what the chip means, on hover. */
143
+ export function Chip({ children, tone = "neutral", icon, title, }) {
144
+ return (_jsxs("span", { title: title, className: cn("inline-flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 font-medium text-[0.75rem]", tone === "neutral" && "bg-paper-2 text-ink-2", tone === "live" && "bg-moss-tint text-moss", tone === "warn" && "bg-amber-tint text-ink-2", tone === "ember" && "bg-ember-tint text-ember-strong"), children: [icon ?? (tone === "live" ? _jsx("span", { className: "size-1.5 rounded-full bg-moss" }) : null), children] }));
145
+ }
146
+ /**
147
+ * A centred modal on the native <dialog>; on a phone it fills the screen, with no gutter. Its
148
+ * height does not jump while it is open: a dialog
149
+ * with tabs, folds or lists (`height="tall"`) stands at a height taken from the window and
150
+ * scrolls inside; any other keeps the tallest height it has had, so switching to a shorter tab
151
+ * or folding a section leaves it where it is.
152
+ */
153
+ export function Dialog({ open, onClose, title, children, wide, bare, height = "auto", }) {
154
+ const ref = useRef(null);
155
+ useEffect(() => {
156
+ const el = ref.current;
157
+ if (!el) {
158
+ return;
159
+ }
160
+ if (open && !el.open) {
161
+ el.showModal();
162
+ // A modal dialog focuses its first control (the close button); a field marked
163
+ // `data-autofocus` is where typing starts instead.
164
+ el.querySelector("[data-autofocus]")?.focus();
165
+ }
166
+ else if (!open && el.open) {
167
+ el.close();
168
+ }
169
+ }, [open]);
170
+ // Open, the dialog never gets shorter than it has been — within what the window allows.
171
+ useEffect(() => {
172
+ const el = ref.current;
173
+ if (!el || !open || bare || height === "tall") {
174
+ return;
175
+ }
176
+ let tallest = 0;
177
+ const keep = () => {
178
+ tallest = Math.max(tallest, el.getBoundingClientRect().height);
179
+ el.style.minHeight = `${Math.min(tallest, window.innerHeight - 32)}px`;
180
+ };
181
+ const observer = new ResizeObserver(keep);
182
+ observer.observe(el);
183
+ window.addEventListener("resize", keep);
184
+ return () => {
185
+ observer.disconnect();
186
+ window.removeEventListener("resize", keep);
187
+ el.style.minHeight = "";
188
+ };
189
+ }, [open, bare, height]);
190
+ return (_jsx("dialog", { ref: ref, onClose: onClose, onClick: (e) => {
191
+ if (e.target === ref.current) {
192
+ onClose();
193
+ }
194
+ }, className: cn("m-auto p-0 text-ink backdrop:bg-[oklch(20%_0.01_60/0.28)] backdrop:backdrop-blur-[2px]",
195
+ // A phone: the whole screen, no gutter, clear of the notch and the home indicator.
196
+ "max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-full max-sm:max-w-none", bare
197
+ ? "w-[calc(100%-48px)] overflow-visible bg-transparent"
198
+ : "max-h-[calc(100dvh-32px)] w-[calc(100%-32px)] overflow-y-auto overscroll-contain rounded-2xl bg-card shadow-overlay max-sm:rounded-none max-sm:pt-[env(safe-area-inset-top)] max-sm:pb-[env(safe-area-inset-bottom)]", wide === "full"
199
+ ? "sm:max-w-7xl"
200
+ : wide === "page"
201
+ ? "sm:max-w-4xl"
202
+ : wide
203
+ ? "sm:max-w-2xl"
204
+ : "sm:max-w-md", !bare && height === "tall" && "sm:h-[min(calc(100dvh-32px),56rem)]"), children: open && bare ? (children) : open ? (_jsxs("div", { className: "p-5 sm:p-7", children: [title ? (_jsxs("div", { className: "mb-5 flex items-start justify-between gap-3", children: [_jsx("h2", { className: "min-w-0 font-display font-semibold text-xl", children: title }), _jsx(IconButton, { label: t("common.close"), onClick: onClose, className: "-mt-1.5 -mr-2", children: _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "size-4", "aria-hidden": "true", children: _jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })] })) : null, children] })) : null }));
205
+ }
206
+ export function Empty({ children }) {
207
+ return _jsx("div", { className: "py-16 text-center text-ink-3", children: children });
208
+ }
209
+ /** A sentence of the server with its web addresses as links, named by their host. */
210
+ export function LinkedText({ text }) {
211
+ return text.split(/(https?:\/\/[^\s)]+)/).map((part, i) => i % 2 ? (_jsx("a", { href: part, target: "_blank", rel: "noreferrer", className: "font-medium text-ink underline underline-offset-2", children: new URL(part).host }, part)) : (part));
212
+ }
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: FSL-1.1-MIT OR MIT
1
+ // SPDX-License-Identifier: MIT
2
2
  import { z } from "zod";
3
3
  /**
4
4
  * What a step's json output holds. `output.schema` writes it as a subset of JSON Schema
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: FSL-1.1-MIT OR MIT
1
+ // SPDX-License-Identifier: MIT
2
2
  import { z } from "zod";
3
3
  import { calcNames, calcScope, evalCalc, parsedCalc } from "./calc.js";
4
4
  import { shapeAt } from "./shape.js";
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@engenty/chatviews",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "exports": {
7
+ "./surface": "./dist/surface.js",
8
+ "./calc": "./dist/calc.js",
9
+ "./shape": "./dist/shape.js",
10
+ "./numbers": "./dist/numbers.js",
11
+ "./react/surface": "./dist/react/surface.js",
12
+ "./react/ui": "./dist/react/ui.js",
13
+ "./react/field-looks": "./dist/react/field-looks.js",
14
+ "./react/markdown": "./dist/react/markdown.js",
15
+ "./react/texts": "./dist/react/texts.js",
16
+ "./chat": "./dist/chat/index.js",
17
+ "./react/chat": "./dist/react/chat.js"
18
+ }
19
+ }
@@ -0,0 +1,76 @@
1
+ import type { ModelCard, SystemOneRequest, SystemOneResponse } from "./types.js";
2
+ export declare const TYPESAFE_API_KEY_ENV = "TYPESAFE_API_KEY";
3
+ export declare const DEFAULT_TYPESAFE_BASE_URL = "https://api.typesafe.ai";
4
+ export declare const DEFAULT_TYPESAFE_MODEL = "jev-latest";
5
+ /**
6
+ * Vercel AI Gateway speaks the TypeSafe API under this prefix (same request
7
+ * and response shapes, TypeSafe field names, `confidence` per answer). The
8
+ * gateway key authenticates; billing lands on the AI Gateway account.
9
+ */
10
+ export declare const AI_GATEWAY_API_KEY_ENV = "AI_GATEWAY_API_KEY";
11
+ export declare const VERCEL_TYPESAFE_BASE_URL = "https://ai-gateway.vercel.sh/typesafe";
12
+ export declare const VERCEL_JEV_MODEL = "typesafe-ai/jev";
13
+ /** A keyed GET that spends no tokens: 200 for a live key, 401 for a dead one. */
14
+ export declare const TYPESAFE_PROBE_PATH = "/v1/models";
15
+ export interface TypeSafeClientOptions {
16
+ apiKey: string;
17
+ baseUrl?: string;
18
+ fetchImpl?: typeof fetch;
19
+ /** Default model for `systemOne` when the request names none. */
20
+ model?: string;
21
+ /** Total attempts including the first. Default 3. */
22
+ retries?: number;
23
+ timeoutMs?: number;
24
+ }
25
+ export declare class TypeSafeError extends Error {
26
+ readonly status: number | null;
27
+ constructor(message: string, status: number | null);
28
+ }
29
+ /** The key as the caller's environment holds it (`process.env` on a server). */
30
+ export declare function readTypeSafeApiKey(env: Readonly<Record<string, string | undefined>>): string | null;
31
+ export type TypeSafeRoute = "typesafe" | "vercel-gateway";
32
+ export interface ResolvedTypeSafeClientOptions {
33
+ apiKey: string;
34
+ baseUrl: string;
35
+ model: string;
36
+ route: TypeSafeRoute;
37
+ }
38
+ /**
39
+ * Whether a bound classifier model is Jev: Vercel's `typesafe-ai/*` ids,
40
+ * TypeSafe's own `jev-*` ids, or a `typesafe:` ref. Anything else is an LLM
41
+ * that answers the same questions through structured output.
42
+ */
43
+ export declare function isJevModel(modelId: string): boolean;
44
+ /**
45
+ * The name one bound Jev model goes by on a route. The two APIs spell the
46
+ * same model differently: Vercel says `typesafe-ai/jev` for the current
47
+ * release where TypeSafe says `jev-latest`, and prefixes pinned releases.
48
+ */
49
+ export declare function jevModelForRoute(modelId: string, route: TypeSafeRoute): string;
50
+ /**
51
+ * Which door to Jev this environment opens for the bound model: TypeSafe's
52
+ * own API when a TypeSafe key is set, else the Vercel AI Gateway's
53
+ * TypeSafe-compatible route on the gateway key. The model is the classifier
54
+ * binding's, renamed for the route. Null when neither key is present.
55
+ */
56
+ export declare function resolveTypeSafeClientOptions(env: Readonly<Record<string, string | undefined>>, modelId: string): ResolvedTypeSafeClientOptions | null;
57
+ /**
58
+ * @deprecated Reach a decision model through `decisionBy` / `decisionOf`.
59
+ * Removed after one minor.
60
+ *
61
+ * Thin client over the two endpoints we use. No SDK: the API is one POST,
62
+ * and keeping the surface here lets the browser loop, the settings probe
63
+ * and tests share one retry policy.
64
+ */
65
+ export declare class TypeSafeClient {
66
+ private readonly apiKey;
67
+ private readonly baseUrl;
68
+ private readonly fetchImpl;
69
+ private readonly model;
70
+ private readonly retries;
71
+ private readonly timeoutMs;
72
+ constructor(options: TypeSafeClientOptions);
73
+ systemOne(request: SystemOneRequest): Promise<SystemOneResponse>;
74
+ listModels(): Promise<ModelCard[]>;
75
+ private send;
76
+ }