@engenty/wizards-runtime 0.13.0 → 0.14.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 (313) hide show
  1. package/apps/runtime/dist/agents/architect.js +8 -7
  2. package/apps/runtime/dist/agents/goose-connections.js +82 -0
  3. package/apps/runtime/dist/agents/space-agent.js +9 -2
  4. package/apps/runtime/dist/agents/studio-assistant.js +101 -67
  5. package/apps/runtime/dist/agents/website.js +1 -1
  6. package/apps/runtime/dist/app.js +17 -1
  7. package/apps/runtime/dist/assistant/knows.js +6 -5
  8. package/apps/runtime/dist/authoring/guide.js +25 -5
  9. package/apps/runtime/dist/broker/account.js +166 -0
  10. package/apps/runtime/dist/broker/call.js +417 -0
  11. package/apps/runtime/dist/broker/caller.js +10 -0
  12. package/apps/runtime/dist/broker/grant.js +152 -0
  13. package/apps/runtime/dist/broker/host.js +51 -0
  14. package/apps/runtime/dist/broker/index.js +8 -0
  15. package/apps/runtime/dist/broker/kept.js +31 -0
  16. package/apps/runtime/dist/broker/log.js +240 -0
  17. package/apps/runtime/dist/broker/registry.js +9 -0
  18. package/apps/runtime/dist/broker/rwx.js +367 -0
  19. package/apps/runtime/dist/broker/send.js +189 -0
  20. package/apps/runtime/dist/connectors/builtin.js +1 -1
  21. package/apps/runtime/dist/connectors/external.js +38 -37
  22. package/apps/runtime/dist/connectors/index.js +30 -91
  23. package/apps/runtime/dist/connectors/mail.js +0 -8
  24. package/apps/runtime/dist/connectors/person-sign-ins.js +73 -0
  25. package/apps/runtime/dist/connectors/plugin-connections.js +65 -92
  26. package/apps/runtime/dist/connectors/smtp.js +1 -1
  27. package/apps/runtime/dist/connectors/space-connections.js +436 -0
  28. package/apps/runtime/dist/db/adopt.js +3 -3
  29. package/apps/runtime/dist/db/client.js +9 -0
  30. package/apps/runtime/dist/db/live-triggers.js +65 -23
  31. package/apps/runtime/dist/db/migrations/tenant/0027_work_chats.sql +52 -0
  32. package/apps/runtime/dist/db/migrations/tenant/0028_chat_approvals.sql +17 -0
  33. package/apps/runtime/dist/db/migrations/tenant/0029_work_chats_live.sql +49 -0
  34. package/apps/runtime/dist/db/migrations/tenant/0031_space.sql +624 -0
  35. package/apps/runtime/dist/db/migrations/tenant/0032_rwx_rule.sql +18 -0
  36. package/apps/runtime/dist/db/migrations/tenant/0033_broker_log.sql +23 -0
  37. package/apps/runtime/dist/db/migrations/tenant/0034_space_connection.sql +35 -0
  38. package/apps/runtime/dist/db/migrations/tenant/0035_run_grant.sql +1 -0
  39. package/apps/runtime/dist/db/migrations/tenant/0036_approval_held_for.sql +1 -0
  40. package/apps/runtime/dist/db/migrations/tenant/0037_ways_out.sql +5 -0
  41. package/apps/runtime/dist/db/migrations/tenant/0038_heard.sql +11 -0
  42. package/apps/runtime/dist/db/migrations/tenant/0039_members_studio.sql +1 -0
  43. package/apps/runtime/dist/db/migrations/tenant/meta/0027_snapshot.json +383 -155
  44. package/apps/runtime/dist/db/migrations/tenant/meta/0028_snapshot.json +4468 -0
  45. package/apps/runtime/dist/db/migrations/tenant/meta/0029_snapshot.json +4475 -0
  46. package/apps/runtime/dist/db/migrations/tenant/meta/0030_snapshot.json +4629 -0
  47. package/apps/runtime/dist/db/migrations/tenant/meta/0031_snapshot.json +4629 -0
  48. package/apps/runtime/dist/db/migrations/tenant/meta/0032_snapshot.json +4757 -0
  49. package/apps/runtime/dist/db/migrations/tenant/meta/0033_snapshot.json +5039 -0
  50. package/apps/runtime/dist/db/migrations/tenant/meta/0034_snapshot.json +5022 -0
  51. package/apps/runtime/dist/db/migrations/tenant/meta/0035_snapshot.json +5029 -0
  52. package/apps/runtime/dist/db/migrations/tenant/meta/0036_snapshot.json +5037 -0
  53. package/apps/runtime/dist/db/migrations/tenant/meta/0037_snapshot.json +5076 -0
  54. package/apps/runtime/dist/db/migrations/tenant/meta/0038_snapshot.json +5145 -0
  55. package/apps/runtime/dist/db/migrations/tenant/meta/0039_snapshot.json +5153 -0
  56. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +86 -2
  57. package/apps/runtime/dist/db/schema.js +295 -72
  58. package/apps/runtime/dist/docs/dev/architecture.md +215 -0
  59. package/apps/runtime/dist/docs/dev/broker.md +298 -0
  60. package/apps/runtime/dist/docs/dev/index.md +5 -1
  61. package/apps/runtime/dist/docs/dev/integration/index.md +2 -0
  62. package/apps/runtime/dist/docs/dev/meta.json +3 -0
  63. package/apps/runtime/dist/docs/dev/plugins/connections.md +8 -5
  64. package/apps/runtime/dist/docs/dev/plugins/events.md +1 -1
  65. package/apps/runtime/dist/docs/dev/plugins/examples.md +1 -0
  66. package/apps/runtime/dist/docs/dev/plugins/index.md +2 -2
  67. package/apps/runtime/dist/docs/dev/plugins/reference.md +3 -2
  68. package/apps/runtime/dist/docs/dev/plugins/space.md +16 -6
  69. package/apps/runtime/dist/docs/dev/plugins/studio.md +2 -2
  70. package/apps/runtime/dist/docs/dev/plugins/tools.md +0 -1
  71. package/apps/runtime/dist/docs/dev/skills.md +16 -9
  72. package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +40 -5
  73. package/apps/runtime/dist/docs/dev/wizard-format/lists-and-connections.md +17 -2
  74. package/apps/runtime/dist/docs/dev/wizard-format/templates.md +2 -0
  75. package/apps/runtime/dist/docs/dev/wizard-format/views-and-widgets.md +22 -2
  76. package/apps/runtime/dist/docs/user-guide/capabilities.md +132 -0
  77. package/apps/runtime/dist/docs/user-guide/cloud-sync.md +2 -0
  78. package/apps/runtime/dist/docs/user-guide/command-line.md +1 -0
  79. package/apps/runtime/dist/docs/user-guide/connectors.md +63 -7
  80. package/apps/runtime/dist/docs/user-guide/index.md +10 -1
  81. package/apps/runtime/dist/docs/user-guide/meta.json +6 -1
  82. package/apps/runtime/dist/docs/user-guide/protocol.md +80 -0
  83. package/apps/runtime/dist/docs/user-guide/skills.md +8 -4
  84. package/apps/runtime/dist/docs/user-guide/space.md +5 -4
  85. package/apps/runtime/dist/docs/user-guide/together.md +16 -2
  86. package/apps/runtime/dist/docs/user-guide/troubleshooting.md +2 -2
  87. package/apps/runtime/dist/docs/user-guide/work-mode.md +128 -0
  88. package/apps/runtime/dist/engenty/connections-external/build-connector.js +2 -5
  89. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +72 -0
  90. package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +1 -1
  91. package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +3 -2
  92. package/apps/runtime/dist/engenty/connections-sdk/types.js +2 -0
  93. package/apps/runtime/dist/engenty/connections-slack/connector.js +2 -1
  94. package/apps/runtime/dist/engine/resources.js +43 -12
  95. package/apps/runtime/dist/engine/runner.js +75 -23
  96. package/apps/runtime/dist/engine/steps.js +30 -12
  97. package/apps/runtime/dist/engine/template.js +18 -1
  98. package/apps/runtime/dist/env.js +9 -4
  99. package/apps/runtime/dist/index.js +18 -2
  100. package/apps/runtime/dist/live/feed.js +2 -2
  101. package/apps/runtime/dist/live/origin.js +2 -2
  102. package/apps/runtime/dist/live/views.js +51 -26
  103. package/apps/runtime/dist/manage.js +7 -0
  104. package/apps/runtime/dist/mcp/flow-app.js +1 -1
  105. package/apps/runtime/dist/mcp/tools.js +75 -34
  106. package/apps/runtime/dist/models.js +1 -1
  107. package/apps/runtime/dist/motion-graphics/project.js +8 -8
  108. package/apps/runtime/dist/motion-graphics/tools.js +1 -1
  109. package/apps/runtime/dist/plugins/events.js +2 -2
  110. package/apps/runtime/dist/plugins/jobs.js +4 -1
  111. package/apps/runtime/dist/plugins/loader.js +2 -2
  112. package/apps/runtime/dist/prompts/architect.md +3 -3
  113. package/apps/runtime/dist/prompts/authoring.md +46 -12
  114. package/apps/runtime/dist/prompts/goose.md +7 -7
  115. package/apps/runtime/dist/prompts/mcp.md +6 -6
  116. package/apps/runtime/dist/prompts/services.md +4 -4
  117. package/apps/runtime/dist/prompts/step.md +2 -2
  118. package/apps/runtime/dist/prompts/tools.md +39 -10
  119. package/apps/runtime/dist/routes/api.js +31 -20
  120. package/apps/runtime/dist/routes/broker.js +316 -0
  121. package/apps/runtime/dist/routes/connections.js +71 -0
  122. package/apps/runtime/dist/routes/delivery.js +25 -0
  123. package/apps/runtime/dist/routes/discover.js +17 -0
  124. package/apps/runtime/dist/routes/live.js +11 -1
  125. package/apps/runtime/dist/routes/person.js +4 -1
  126. package/apps/runtime/dist/routes/plugins.js +3 -1
  127. package/apps/runtime/dist/routes/rules.js +26 -0
  128. package/apps/runtime/dist/routes/runs.js +54 -33
  129. package/apps/runtime/dist/routes/skills.js +6 -6
  130. package/apps/runtime/dist/routes/studio.js +153 -144
  131. package/apps/runtime/dist/routes/work.js +199 -0
  132. package/apps/runtime/dist/sandbox/index.js +27 -0
  133. package/apps/runtime/dist/services/access.js +38 -17
  134. package/apps/runtime/dist/services/api.js +38 -13
  135. package/apps/runtime/dist/services/architect.js +3 -3
  136. package/apps/runtime/dist/services/assistant-chats.js +9 -1
  137. package/apps/runtime/dist/services/brand.js +12 -12
  138. package/apps/runtime/dist/services/broker-bell.js +69 -0
  139. package/apps/runtime/dist/services/broker-notify.js +127 -0
  140. package/apps/runtime/dist/services/client-steps.js +79 -0
  141. package/apps/runtime/dist/services/cloud.js +42 -42
  142. package/apps/runtime/dist/services/command-risk.js +51 -0
  143. package/apps/runtime/dist/services/discover.js +85 -0
  144. package/apps/runtime/dist/services/knowledge-model.js +13 -13
  145. package/apps/runtime/dist/services/knowledge.js +117 -80
  146. package/apps/runtime/dist/services/manage-reports.js +74 -7
  147. package/apps/runtime/dist/services/members-studio.js +165 -0
  148. package/apps/runtime/dist/services/onboarding.js +22 -22
  149. package/apps/runtime/dist/services/package-file.js +1 -1
  150. package/apps/runtime/dist/services/package.js +22 -22
  151. package/apps/runtime/dist/services/pages.js +7 -7
  152. package/apps/runtime/dist/services/runs.js +4 -3
  153. package/apps/runtime/dist/services/seen.js +55 -0
  154. package/apps/runtime/dist/services/shares.js +23 -13
  155. package/apps/runtime/dist/services/site.js +23 -23
  156. package/apps/runtime/dist/services/skills-registry.js +15 -15
  157. package/apps/runtime/dist/services/skills.js +44 -44
  158. package/apps/runtime/dist/services/space-categories.js +35 -35
  159. package/apps/runtime/dist/services/space-data.js +130 -111
  160. package/apps/runtime/dist/services/{project-files.js → space-files.js} +84 -75
  161. package/apps/runtime/dist/services/{project-index.js → space-index.js} +116 -73
  162. package/apps/runtime/dist/services/space-origin.js +19 -11
  163. package/apps/runtime/dist/services/spaces.js +478 -612
  164. package/apps/runtime/dist/services/synced-spaces.js +668 -0
  165. package/apps/runtime/dist/services/themes.js +15 -15
  166. package/apps/runtime/dist/services/widgets.js +6 -6
  167. package/apps/runtime/dist/services/wizards.js +112 -38
  168. package/apps/runtime/dist/services/work-ai.js +257 -0
  169. package/apps/runtime/dist/services/work-approvals.js +104 -0
  170. package/apps/runtime/dist/services/work-chats.js +908 -0
  171. package/apps/runtime/dist/services/work-connections.js +90 -0
  172. package/apps/runtime/dist/services/work-files.js +85 -0
  173. package/apps/runtime/dist/services/work-mastra.js +73 -0
  174. package/apps/runtime/dist/services/work-sandbox.js +42 -0
  175. package/apps/runtime/dist/sharing/files.js +14 -4
  176. package/apps/runtime/dist/sharing/index.js +40 -39
  177. package/apps/runtime/dist/sharing/jobs.js +67 -17
  178. package/apps/runtime/dist/sharing/targets/connector.js +10 -6
  179. package/apps/runtime/dist/sharing/targets/email.js +10 -8
  180. package/apps/runtime/dist/sharing/targets/slack.js +10 -8
  181. package/apps/runtime/dist/sharing/targets/storage.js +6 -4
  182. package/apps/runtime/dist/store/index.js +14 -3
  183. package/apps/runtime/dist/store/shared-lists.js +4 -2
  184. package/apps/runtime/dist/sync/apply.js +2 -2
  185. package/apps/runtime/dist/sync/client.js +113 -113
  186. package/apps/runtime/dist/sync/hub.js +41 -41
  187. package/apps/runtime/dist/sync/log.js +12 -12
  188. package/apps/runtime/dist/sync/records.js +118 -120
  189. package/apps/runtime/dist/texts.js +38 -2
  190. package/apps/runtime/dist/tools/connections.js +112 -0
  191. package/apps/runtime/dist/tools/connector.js +157 -67
  192. package/apps/runtime/dist/tools/index.js +28 -13
  193. package/apps/runtime/dist/tools/mail.js +40 -11
  194. package/apps/runtime/dist/tools/pages.js +11 -5
  195. package/apps/runtime/dist/tools/plugin.js +43 -7
  196. package/apps/runtime/dist/tools/skills.js +1 -1
  197. package/apps/runtime/dist/tools/{project.js → space.js} +30 -25
  198. package/apps/runtime/dist/tools/store.js +3 -2
  199. package/apps/runtime/dist/widgets/step.js +10 -10
  200. package/apps/web/dist/assets/AboutDialog-DgfeipUc.js +1 -0
  201. package/apps/web/dist/assets/CapabilitiesPage-BoYJvgIu.js +2 -0
  202. package/apps/web/dist/assets/{ChangelogDialog-SwyId00t.js → ChangelogDialog-Duab4zTO.js} +1 -1
  203. package/apps/web/dist/assets/{CodeEditor-BwZsk5Al.js → CodeEditor-nxoOt8ge.js} +1 -1
  204. package/apps/web/dist/assets/EditorPage-ZrgGpYMC.js +3 -0
  205. package/apps/web/dist/assets/{FlowPreview-DtSpjVTl.js → FlowPreview-aMfwcPul.js} +1 -1
  206. package/apps/web/dist/assets/LangSwitch-DpD0inR4.js +1 -0
  207. package/apps/web/dist/assets/Marketplace-CpzD9pNQ.js +2 -0
  208. package/apps/web/dist/assets/NewWizardChannels-IB18afWN.js +1 -0
  209. package/apps/web/dist/assets/NewWizardPage-rYbcmPGG.js +7 -0
  210. package/apps/web/dist/assets/OnboardingPage-ztHT01ah.js +1 -0
  211. package/apps/web/dist/assets/PreviewPane-DviWTLfi.js +9 -0
  212. package/apps/web/dist/assets/PublicRunner-C2geZhhM.js +1 -0
  213. package/apps/web/dist/assets/ReadOnly-kSb_Kbdm.js +1 -0
  214. package/apps/web/dist/assets/SettingsPage-DM2h8N0J.js +2 -0
  215. package/apps/web/dist/assets/SetupPage-Wfyz6xH4.js +1 -0
  216. package/apps/web/dist/assets/SharePage-CyWQorWB.js +1 -0
  217. package/apps/web/dist/assets/SkillEditor-CqQMg2MC.js +1 -0
  218. package/apps/web/dist/assets/Skills-CnhpgoOA.js +9 -0
  219. package/apps/web/dist/assets/SpacePage-q4Bk3N7k.js +2 -0
  220. package/apps/web/dist/assets/UpdateCheck-C2CE6CC3.js +2 -0
  221. package/apps/web/dist/assets/changelog-B6hN1Cp7.js +1 -0
  222. package/apps/web/dist/assets/circle-alert-C8Ma-bPY.js +1 -0
  223. package/apps/web/dist/assets/circle-check-Bu9Z3mlJ.js +1 -0
  224. package/apps/web/dist/assets/code-editor-CfTGqOpp.js +2 -0
  225. package/apps/web/dist/assets/{code-xml-TwKzzMtA.js → code-xml-B4kLFZSj.js} +1 -1
  226. package/apps/web/dist/assets/connection-sign-in-CIiv0t2p.js +1 -0
  227. package/apps/web/dist/assets/esm-Xwn4GtqG.js +7 -0
  228. package/apps/web/dist/assets/{eye-Brd-xPUJ.js → eye-BpoKpIdt.js} +1 -1
  229. package/apps/web/dist/assets/host-BrP-ENHg.css +1 -0
  230. package/apps/web/dist/assets/host-DJ7-p0Sc.js +118 -0
  231. package/apps/web/dist/assets/i18n-BJ7Ld6O6.js +55 -0
  232. package/apps/web/dist/assets/index-D18DvnxX.css +1 -0
  233. package/apps/web/dist/assets/index-D2akynS-.js +10 -0
  234. package/apps/web/dist/assets/logo-BpnjXTRy.js +1 -0
  235. package/apps/web/dist/assets/oss-credits-IdX5bc71.js +1 -0
  236. package/apps/web/dist/assets/{phone-DhkHteoJ.js → phone-Ctvf-Am-.js} +1 -1
  237. package/apps/web/dist/assets/read-aloud-Da_RSm2S.js +1 -0
  238. package/apps/web/dist/assets/{runners-G-XYaDgR.js → runners-CyIvJIHr.js} +1 -1
  239. package/apps/web/dist/assets/scroll-text-ChrjRu9Y.js +1 -0
  240. package/apps/web/dist/assets/session-SXPtTWRK.js +2 -0
  241. package/apps/web/dist/assets/theme-CbTcTFWy.js +11 -0
  242. package/apps/web/dist/assets/ui-Uqnx1UpK.js +82 -0
  243. package/apps/web/dist/assets/{upload-BYZTwJTD.js → upload-BchUnQGV.js} +1 -1
  244. package/apps/web/dist/assets/{useMutation-D0QP_k2-.js → useMutation-DEkZhp5c.js} +1 -1
  245. package/apps/web/dist/assets/{volume-2-CVHoxdGM.js → volume-2-CU_oy81Z.js} +1 -1
  246. package/apps/web/dist/assets/with-selector-CoMyWBAX.js +1 -0
  247. package/apps/web/dist/index.html +17 -10
  248. package/apps/web/dist/mcp/flow.html +119 -64
  249. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +20 -10
  250. package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +6 -1
  251. package/node_modules/@engenty/wizards-shared/dist/assistant.js +6 -1
  252. package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +236 -2
  253. package/node_modules/@engenty/wizards-shared/dist/connectors.js +52 -2
  254. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +150 -8
  255. package/node_modules/@engenty/wizards-shared/dist/definition.js +46 -11
  256. package/node_modules/@engenty/wizards-shared/dist/discover.d.ts +21 -0
  257. package/node_modules/@engenty/wizards-shared/dist/discover.js +1 -0
  258. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +26 -2
  259. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +26 -2
  260. package/node_modules/@engenty/wizards-shared/dist/fit.js +1 -1
  261. package/node_modules/@engenty/wizards-shared/dist/json-schema.d.ts +1 -1
  262. package/node_modules/@engenty/wizards-shared/dist/json-schema.js +1 -1
  263. package/node_modules/@engenty/wizards-shared/dist/live.d.ts +2 -2
  264. package/node_modules/@engenty/wizards-shared/dist/live.js +1 -1
  265. package/node_modules/@engenty/wizards-shared/dist/marketplace.js +3 -1
  266. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +54 -6
  267. package/node_modules/@engenty/wizards-shared/dist/run.js +85 -0
  268. package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +15 -1
  269. package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +14 -0
  270. package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +42 -0
  271. package/node_modules/@engenty/wizards-shared/dist/rwx.js +29 -0
  272. package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +1 -1
  273. package/node_modules/@engenty/wizards-shared/dist/space-data.d.ts +2 -2
  274. package/node_modules/@engenty/wizards-shared/dist/{projects.d.ts → spaces.d.ts} +39 -15
  275. package/node_modules/@engenty/wizards-shared/dist/{projects.js → spaces.js} +16 -9
  276. package/node_modules/@engenty/wizards-shared/dist/store.d.ts +7 -2
  277. package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +35 -4
  278. package/node_modules/@engenty/wizards-shared/dist/surface.js +121 -3
  279. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +1 -1
  280. package/node_modules/@engenty/wizards-shared/dist/theme-look.js +1 -1
  281. package/node_modules/@engenty/wizards-shared/dist/wizard-package.d.ts +2 -2
  282. package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +3 -3
  283. package/package.json +4 -1
  284. package/plugin/.claude-plugin/plugin.json +1 -1
  285. package/plugin/plugin.json +1 -1
  286. package/plugin/skills/build-wizard/SKILL.md +1 -1
  287. package/apps/runtime/dist/services/projects.js +0 -473
  288. package/apps/web/dist/assets/AboutDialog-B-JxkELB.js +0 -1
  289. package/apps/web/dist/assets/EditorPage-DQ_2FOzI.js +0 -3
  290. package/apps/web/dist/assets/Marketplace-DoH4YO3D.js +0 -2
  291. package/apps/web/dist/assets/NewWizardChannels-Tgoexgj4.js +0 -1
  292. package/apps/web/dist/assets/NewWizardPage-B24AF482.js +0 -7
  293. package/apps/web/dist/assets/OnboardingPage-BEvq4slJ.js +0 -1
  294. package/apps/web/dist/assets/PreviewPane-B_v7Y8R7.js +0 -10
  295. package/apps/web/dist/assets/ProjectPage-ClRuhFJo.js +0 -10
  296. package/apps/web/dist/assets/PublicRunner-MicrpVsv.js +0 -1
  297. package/apps/web/dist/assets/ReadOnly-BXjv-MSv.js +0 -1
  298. package/apps/web/dist/assets/SettingsPage-DY8O1r43.js +0 -2
  299. package/apps/web/dist/assets/SetupPage-BOVkVpMu.js +0 -1
  300. package/apps/web/dist/assets/SharePage-DXGzJSnR.js +0 -1
  301. package/apps/web/dist/assets/SkillEditor-BzzTDeaU.js +0 -1
  302. package/apps/web/dist/assets/changelog-BLdS-0Bj.js +0 -1
  303. package/apps/web/dist/assets/esm-BdxDT9Km.js +0 -7
  304. package/apps/web/dist/assets/i18n-8-Sw11tB.js +0 -55
  305. package/apps/web/dist/assets/index-OsdQFHmh.js +0 -49
  306. package/apps/web/dist/assets/index-QPipX5Fi.css +0 -1
  307. package/apps/web/dist/assets/lock-C0uxcOlq.js +0 -1
  308. package/apps/web/dist/assets/logo-CGNoptDg.js +0 -1
  309. package/apps/web/dist/assets/oss-credits-DpRWUPjD.js +0 -1
  310. package/apps/web/dist/assets/session-BWI-KENJ.js +0 -2
  311. package/apps/web/dist/assets/theme-D7krsx0_.js +0 -11
  312. package/apps/web/dist/assets/ui-DSXG3f49.js +0 -83
  313. /package/apps/runtime/dist/db/migrations/tenant/{0027_space_skill.sql → 0030_space_skill.sql} +0 -0
@@ -1,20 +1,20 @@
1
- import { runTheme } from "@engenty/wizards-shared/projects";
1
+ import { runTheme } from "@engenty/wizards-shared/spaces";
2
2
  import { freeThemeId, MAX_SPACE_THEMES, themeContentKey, themeIdProblem, themeSchema, } from "@engenty/wizards-shared/theme";
3
3
  import { eq } from "drizzle-orm";
4
4
  import { db, schema } from "../db/client.js";
5
5
  import { spaceChanged } from "../plugins/events.js";
6
6
  import { requireBuild, requireWritable } from "./access.js";
7
7
  import { ServiceError } from "./errors.js";
8
- import { ownedProject } from "./projects.js";
8
+ import { ownedSpace } from "./spaces.js";
9
9
  /**
10
10
  * The space's themes, which of its wizards name each, the brand's fonts for headings and text
11
11
  * (what `brand` means in a theme of this space) and the brand's named colours.
12
12
  */
13
- export async function listThemes(userId, projectId) {
14
- const p = await ownedProject(userId, projectId);
13
+ export async function listThemes(userId, spaceId) {
14
+ const p = await ownedSpace(userId, spaceId);
15
15
  const wizards = await db.query.wizard.findMany({
16
16
  columns: { id: true, title: true, draft: true },
17
- where: eq(schema.wizard.projectId, p.id),
17
+ where: eq(schema.wizard.spaceId, p.id),
18
18
  });
19
19
  const { display, body, faces } = runTheme(p.brand);
20
20
  return {
@@ -47,19 +47,19 @@ function checkedTheme(raw, origin) {
47
47
  }
48
48
  return parsed.data;
49
49
  }
50
- async function writeThemes(projectId, themes) {
50
+ async function writeThemes(spaceId, themes) {
51
51
  if (themes.length > MAX_SPACE_THEMES) {
52
52
  throw new ServiceError("invalid", `A space keeps at most ${MAX_SPACE_THEMES} themes.`);
53
53
  }
54
54
  await db
55
- .update(schema.project)
55
+ .update(schema.space)
56
56
  .set({ themes, updatedAt: new Date() })
57
- .where(eq(schema.project.id, projectId));
58
- spaceChanged("space.updated", projectId);
57
+ .where(eq(schema.space.id, spaceId));
58
+ spaceChanged("space.updated", spaceId);
59
59
  }
60
60
  /** Adds the theme to the space, or replaces the one with its id. */
61
- export async function saveTheme(userId, projectId, raw) {
62
- const p = await ownedProject(userId, projectId);
61
+ export async function saveTheme(userId, spaceId, raw) {
62
+ const p = await ownedSpace(userId, spaceId);
63
63
  await requireWritable(p);
64
64
  await requireBuild();
65
65
  const theme = checkedTheme(raw, "studio");
@@ -68,8 +68,8 @@ export async function saveTheme(userId, projectId, raw) {
68
68
  return theme;
69
69
  }
70
70
  /** Removes the theme. Wizards that name it show the next theme of their chain, or the brand. */
71
- export async function deleteTheme(userId, projectId, themeId) {
72
- const p = await ownedProject(userId, projectId);
71
+ export async function deleteTheme(userId, spaceId, themeId) {
72
+ const p = await ownedSpace(userId, spaceId);
73
73
  await requireWritable(p);
74
74
  await requireBuild();
75
75
  await writeThemes(p.id, p.themes.filter((t) => t.id !== themeId));
@@ -79,11 +79,11 @@ export async function deleteTheme(userId, projectId, themeId) {
79
79
  * the same content is the space's own; one with a known id and other content comes in under a
80
80
  * free id. Answers how ids were renamed, for the wizard's `themes`.
81
81
  */
82
- export async function importThemes(projectId, incoming) {
82
+ export async function importThemes(spaceId, incoming) {
83
83
  if (!incoming.length) {
84
84
  return {};
85
85
  }
86
- const p = await db.query.project.findFirst({ where: eq(schema.project.id, projectId) });
86
+ const p = await db.query.space.findFirst({ where: eq(schema.space.id, spaceId) });
87
87
  if (!p) {
88
88
  return {};
89
89
  }
@@ -3,7 +3,7 @@ import { probeWidget } from "../widgets/render.js";
3
3
  import { widgetPreviewHtml } from "../widgets/step.js";
4
4
  import { notFound, ServiceError } from "./errors.js";
5
5
  import { draftFiles } from "./files.js";
6
- import { ownedProject } from "./projects.js";
6
+ import { ownedSpace } from "./spaces.js";
7
7
  import { ownedWizard } from "./wizards.js";
8
8
  async function draftWidget(userId, wizardId, stepId) {
9
9
  const w = await ownedWizard(userId, wizardId);
@@ -18,17 +18,17 @@ async function draftWidget(userId, wizardId, stepId) {
18
18
  if (!files.some((f) => f.path === step.entry)) {
19
19
  throw new ServiceError("invalid", `The widget file ${step.entry} is not in the workspace yet.`);
20
20
  }
21
- return { step, files, project: await ownedProject(userId, w.projectId) };
21
+ return { step, files, space: await ownedSpace(userId, w.spaceId) };
22
22
  }
23
23
  /** The draft widget with its sample data, as one HTML file — the studio shows it before any run. */
24
24
  export async function draftWidgetPreview(userId, wizardId, stepId, data) {
25
- const { step, files, project } = await draftWidget(userId, wizardId, stepId);
26
- return widgetPreviewHtml(step, files, project, data);
25
+ const { step, files, space } = await draftWidget(userId, wizardId, stepId);
26
+ return widgetPreviewHtml(step, files, space, data);
27
27
  }
28
28
  /** Loads the draft widget in Chromium: what broke, whether it animates, and how it looks. */
29
29
  export async function checkDraftWidget(userId, wizardId, stepId, data) {
30
- const { step, files, project } = await draftWidget(userId, wizardId, stepId);
31
- const html = await widgetPreviewHtml(step, files, project, data);
30
+ const { step, files, space } = await draftWidget(userId, wizardId, stepId);
31
+ const html = await widgetPreviewHtml(step, files, space, data);
32
32
  const probe = await probeWidget(html, widgetSize(step));
33
33
  return { ...probe, size: widgetSize(step), bytes: Buffer.byteLength(html) };
34
34
  }
@@ -4,7 +4,8 @@ import { note } from "@engenty/wizards-shared/run";
4
4
  import { and, desc, eq, sql } from "drizzle-orm";
5
5
  import { nanoid } from "nanoid";
6
6
  import { applyOps, OpError } from "../authoring/ops.js";
7
- import { listConnectors } from "../connectors/external.js";
7
+ import { listConnectors, resolveConnector } from "../connectors/external.js";
8
+ import { listSpaceConnections } from "../connectors/space-connections.js";
8
9
  import { db, schema } from "../db/client.js";
9
10
  import { env } from "../env.js";
10
11
  import { saidOf } from "../model-errors.js";
@@ -12,16 +13,17 @@ import { pluginToolsOf } from "../plugins/registry.js";
12
13
  import { dropLinks, putLink } from "../tenants/control.js";
13
14
  import { currentTenant } from "../tenants/tenant.js";
14
15
  import { serverText } from "../texts.js";
15
- import { requireAdmin, requireBuild, requireWritable, requireWritableProject } from "./access.js";
16
+ import { requireAdmin, requireBuild, requireWritable, requireWritableSpace } from "./access.js";
16
17
  import { changedSteps, emitDraftChanged } from "./draft-events.js";
17
18
  import { notFound, ServiceError } from "./errors.js";
18
19
  import { copyFiles, draftFiles, sameFiles, seedFiles } from "./files.js";
19
20
  import { forgetWizardLinks } from "./links.js";
20
21
  import { pushWizards } from "./manage-reports.js";
21
22
  import { asLang, countInstall, marketplaceWizard } from "./marketplace.js";
23
+ import { requireMaker } from "./members-studio.js";
22
24
  import { pushPages } from "./pages.js";
23
- import { defaultProject, ownedProject } from "./projects.js";
24
25
  import { checkRunnerSettings } from "./runners.js";
26
+ import { defaultSpace, ownedSpace } from "./spaces.js";
25
27
  import { saveTheme } from "./themes.js";
26
28
  /** The wizard a new one starts as, in the language of whoever makes it. */
27
29
  function blankWizard(lang) {
@@ -61,16 +63,16 @@ export async function ownedWizard(_userId, wizardId) {
61
63
  }
62
64
  return w;
63
65
  }
64
- /** The wizard, for a change: refused where its project is a local install's or nothing is built here. */
66
+ /** The wizard, for a change: refused where its space is a local install's or nothing is built here. */
65
67
  export async function writableWizard(userId, wizardId) {
66
68
  const w = await ownedWizard(userId, wizardId);
67
- await requireWritableProject(w.projectId);
69
+ await requireWritableSpace(w.spaceId);
68
70
  return w;
69
71
  }
70
72
  export function wizardSummary(w) {
71
73
  return {
72
74
  id: w.id,
73
- projectId: w.projectId,
75
+ spaceId: w.spaceId,
74
76
  title: w.title,
75
77
  description: w.draft.description,
76
78
  avatar: w.draft.avatar,
@@ -81,6 +83,8 @@ export function wizardSummary(w) {
81
83
  shareToken: w.shareToken,
82
84
  shareEnabled: w.shareEnabled,
83
85
  dailyRunLimit: w.dailyRunLimit,
86
+ /** How many emails guests' runs send per day, from any address. */
87
+ dailyMailLimit: w.dailyMailLimit,
84
88
  /** How it is offered; null: the link opens the page, the chat is on beside it. */
85
89
  runners: w.runners,
86
90
  /** Its page offers it in the viewer's language, translated on request. */
@@ -89,9 +93,9 @@ export function wizardSummary(w) {
89
93
  updatedAt: w.updatedAt.toISOString(),
90
94
  };
91
95
  }
92
- export async function listWizards(_userId, projectId) {
96
+ export async function listWizards(_userId, spaceId) {
93
97
  const rows = await db.query.wizard.findMany({
94
- where: and(eq(schema.wizard.tenantId, currentTenant()), projectId ? eq(schema.wizard.projectId, projectId) : undefined),
98
+ where: and(eq(schema.wizard.tenantId, currentTenant()), spaceId ? eq(schema.wizard.spaceId, spaceId) : undefined),
95
99
  orderBy: [desc(schema.wizard.updatedAt)],
96
100
  });
97
101
  return rows.map(wizardSummary);
@@ -113,19 +117,19 @@ export async function publishedVersion(w) {
113
117
  });
114
118
  return v ?? null;
115
119
  }
116
- /** Connections must name connectors the project has imported, and actions those connectors have. */
117
- async function connectorIssues(projectId, draft) {
120
+ /** Connections must name connectors the space has imported, and actions those connectors have. */
121
+ async function connectorIssues(spaceId, draft) {
118
122
  const wanted = (draft.connections ?? []).filter((c) => c.connector);
119
123
  if (!wanted.length) {
120
124
  return [];
121
125
  }
122
126
  const issues = [];
123
- const connectors = await listConnectors(projectId);
127
+ const connectors = await listConnectors(spaceId);
124
128
  for (const connection of wanted) {
125
129
  const connector = connectors.find((c) => c.id === connection.connector);
126
130
  if (!connector) {
127
131
  issues.push({
128
- message: `Connection "${connection.id}" uses connector "${connection.connector}", which this project has not imported.`,
132
+ message: `Connection "${connection.id}" uses connector "${connection.connector}", which this space has not imported.`,
129
133
  });
130
134
  continue;
131
135
  }
@@ -159,18 +163,89 @@ async function pluginIssues(draft) {
159
163
  }
160
164
  return issues;
161
165
  }
162
- /** Everything wrong with a draft: its structure, its workspace files, its project's connectors and plugins. */
163
- async function checkDraft(projectId, draft, files) {
166
+ /**
167
+ * A draft's connections of the space (A4 of docs/plans/capabilities.md): the connection must exist;
168
+ * on one that signs in as the space an AI step only reads, so a write action it lists is refused;
169
+ * a fixed `call` step names an action the connector has and the connection is for.
170
+ */
171
+ async function spaceConnectionIssues(spaceId, draft) {
172
+ const connections = draft.connections ?? [];
173
+ const fixed = draft.steps.filter((s) => s.type === "agent" && s.call && "connection" in s.call);
174
+ if (!connections.some((c) => c.spaceConnection) && !fixed.length) {
175
+ return [];
176
+ }
177
+ const issues = [];
178
+ const rows = await listSpaceConnections(spaceId);
179
+ const connectors = new Map();
180
+ const connectorOf = async (id) => {
181
+ if (!connectors.has(id)) {
182
+ connectors.set(id, (await resolveConnector(spaceId, id))?.connector ?? null);
183
+ }
184
+ return connectors.get(id) ?? null;
185
+ };
186
+ for (const connection of connections) {
187
+ const row = connection.spaceConnection
188
+ ? rows.find((r) => r.id === connection.spaceConnection)
189
+ : null;
190
+ if (connection.spaceConnection && !row) {
191
+ issues.push({
192
+ message: `Connection "${connection.id}" names the space's connection "${connection.spaceConnection}", which this space does not have.`,
193
+ });
194
+ continue;
195
+ }
196
+ const connector = await connectorOf(row?.connectorId ?? connection.connector ?? "");
197
+ if (!connector) {
198
+ continue;
199
+ }
200
+ const name = connection.title ?? connector.name;
201
+ if (row?.signIn === "space") {
202
+ const writes = (connection.actions ?? []).filter((id) => {
203
+ const action = connector.actions.find((a) => a.id === id);
204
+ return action && action.group !== "read";
205
+ });
206
+ for (const step of draft.steps) {
207
+ if (step.type !== "agent" || step.call || !step.connections?.includes(connection.id)) {
208
+ continue;
209
+ }
210
+ for (const id of writes) {
211
+ issues.push({
212
+ stepId: step.id,
213
+ message: `Step "${step.id}": "${id}" writes in ${name}, which signs in as the space. An AI step only reads there; put the write in a step with "call".`,
214
+ });
215
+ }
216
+ }
217
+ }
218
+ for (const step of fixed.filter((s) => s.call.connection === connection.id)) {
219
+ const action = connector.actions.find((a) => a.id === step.call.action);
220
+ if (!action) {
221
+ issues.push({
222
+ stepId: step.id,
223
+ message: `Step "${step.id}": ${name} has no action "${step.call.action}".`,
224
+ });
225
+ }
226
+ else if (row?.actions.length && !row.actions.includes(action.id)) {
227
+ issues.push({
228
+ stepId: step.id,
229
+ message: `Step "${step.id}": the connection ${name} is not for "${action.id}".`,
230
+ });
231
+ }
232
+ }
233
+ }
234
+ return issues;
235
+ }
236
+ /** Everything wrong with a draft: its structure, its workspace files, its space's connectors and plugins. */
237
+ export async function checkDraft(spaceId, draft, files) {
164
238
  return [
165
239
  ...validateWizard(draft, files),
166
- ...(await connectorIssues(projectId, draft)),
240
+ ...(await connectorIssues(spaceId, draft)),
241
+ ...(await spaceConnectionIssues(spaceId, draft)),
167
242
  ...(await pluginIssues(draft)),
168
243
  ];
169
244
  }
170
- /** Validator issues of the draft, checked against its workspace and the project's connectors. */
245
+ /** Validator issues of the draft, checked against its workspace and the space's connectors. */
171
246
  export async function draftIssues(w) {
172
247
  const files = await draftFiles(w.id);
173
- return checkDraft(w.projectId, w.draft, files.map((f) => f.path));
248
+ return checkDraft(w.spaceId, w.draft, files.map((f) => f.path));
174
249
  }
175
250
  /** The draft with its validator issues and whether it differs from the published version. */
176
251
  export async function wizardState(w) {
@@ -180,7 +255,7 @@ export async function wizardState(w) {
180
255
  ...wizardSummary(w),
181
256
  draft: w.draft,
182
257
  files,
183
- issues: await checkDraft(w.projectId, w.draft, files.map((f) => f.path)),
258
+ issues: await checkDraft(w.spaceId, w.draft, files.map((f) => f.path)),
184
259
  dirty: !published ||
185
260
  JSON.stringify(published.definition) !== JSON.stringify(w.draft) ||
186
261
  !sameFiles(published.files, files),
@@ -242,13 +317,12 @@ export function parseDraft(raw, files) {
242
317
  return { draft: parsed.data, issues: validateWizard(parsed.data, files) };
243
318
  }
244
319
  export async function createWizard(userId, input, writer = { source: "studio" }) {
245
- // Asked first: a tenant that builds nothing here has no project of its own to name.
320
+ // Asked first: a tenant that builds nothing here has no space of its own to name.
246
321
  await requireBuild();
247
- await requireAdmin();
248
- const project = input.projectId
249
- ? await ownedProject(userId, input.projectId)
250
- : await defaultProject(userId);
251
- await requireWritable(project);
322
+ const named = () => (input.spaceId ? ownedSpace(userId, input.spaceId) : defaultSpace(userId));
323
+ await requireMaker(async () => (await named()).id);
324
+ const space = await named();
325
+ await requireWritable(space);
252
326
  const starter = input.starterId
253
327
  ? await marketplaceWizard(input.starterId, asLang(input.lang))
254
328
  : undefined;
@@ -270,7 +344,7 @@ export async function createWizard(userId, input, writer = { source: "studio" })
270
344
  const shareToken = newShareToken();
271
345
  await db.insert(schema.wizard).values({
272
346
  id,
273
- projectId: project.id,
347
+ spaceId: space.id,
274
348
  tenantId: currentTenant(),
275
349
  title: draft.title,
276
350
  draft,
@@ -308,7 +382,7 @@ export async function writeDraft(userId, wizardId, input, writer = { source: "st
308
382
  const files = await draftFiles(w.id);
309
383
  const paths = files.map((f) => f.path);
310
384
  const { draft } = parseDraft(input.definition, paths);
311
- const issues = await checkDraft(w.projectId, draft, paths);
385
+ const issues = await checkDraft(w.spaceId, draft, paths);
312
386
  const [row] = await db
313
387
  .update(schema.wizard)
314
388
  .set({
@@ -349,7 +423,7 @@ export async function editWizard(userId, wizardId, input, writer) {
349
423
  // A theme belongs to the space: it is saved there first, and the ops put it into the chain.
350
424
  for (const op of input.ops) {
351
425
  if (op.op === "set_theme") {
352
- await saveTheme(userId, w.projectId, op.theme);
426
+ await saveTheme(userId, w.spaceId, op.theme);
353
427
  }
354
428
  }
355
429
  let definition;
@@ -366,8 +440,8 @@ export async function editWizard(userId, wizardId, input, writer) {
366
440
  }
367
441
  export async function updateWizardSettings(userId, wizardId, patch) {
368
442
  const w = await writableWizard(userId, wizardId);
369
- if (patch.projectId) {
370
- await requireWritable(await ownedProject(userId, patch.projectId));
443
+ if (patch.spaceId) {
444
+ await requireWritable(await ownedSpace(userId, patch.spaceId));
371
445
  }
372
446
  const runners = patch.runners ? await checkRunnerSettings(patch.runners) : undefined;
373
447
  await db
@@ -396,14 +470,14 @@ export async function rotateShareLink(userId, wizardId) {
396
470
  return { shareToken: token, shareUrl: shareUrl(token) };
397
471
  }
398
472
  export async function duplicateWizard(userId, wizardId) {
399
- await requireAdmin();
473
+ await requireMaker(async () => (await writableWizard(userId, wizardId)).spaceId);
400
474
  const w = await writableWizard(userId, wizardId);
401
475
  const id = nanoid(12);
402
476
  const draft = { ...w.draft, title: `${w.draft.title} (Kopie)` };
403
477
  const shareToken = newShareToken();
404
478
  await db.insert(schema.wizard).values({
405
479
  id,
406
- projectId: w.projectId,
480
+ spaceId: w.spaceId,
407
481
  tenantId: currentTenant(),
408
482
  title: draft.title,
409
483
  draft,
@@ -423,13 +497,13 @@ export async function deleteWizard(userId, wizardId) {
423
497
  await db
424
498
  .delete(schema.wizard)
425
499
  .where(and(eq(schema.wizard.id, wizardId), eq(schema.wizard.tenantId, currentTenant())));
426
- await unlistWizard(w.projectId, wizardId);
500
+ await unlistWizard(w.spaceId, wizardId);
427
501
  pushWizards();
428
502
  }
429
503
  /** A wizard that is gone leaves its space's public page, which is sent again without it. */
430
- async function unlistWizard(projectId, wizardId) {
431
- const p = await db.query.project.findFirst({
432
- where: eq(schema.project.id, projectId),
504
+ async function unlistWizard(spaceId, wizardId) {
505
+ const p = await db.query.space.findFirst({
506
+ where: eq(schema.space.id, spaceId),
433
507
  columns: { page: true },
434
508
  });
435
509
  if (!p?.page?.wizards.includes(wizardId)) {
@@ -437,18 +511,18 @@ async function unlistWizard(projectId, wizardId) {
437
511
  }
438
512
  const { [wizardId]: _gone, ...examples } = p.page.examples;
439
513
  await db
440
- .update(schema.project)
514
+ .update(schema.space)
441
515
  .set({
442
516
  page: { ...p.page, wizards: p.page.wizards.filter((id) => id !== wizardId), examples },
443
517
  updatedAt: new Date(),
444
518
  })
445
- .where(eq(schema.project.id, projectId));
519
+ .where(eq(schema.space.id, spaceId));
446
520
  pushPages();
447
521
  }
448
522
  /** A wizard with validator issues is never published — same rule for studio and MCP. */
449
523
  export async function requireClean(w) {
450
524
  const files = await draftFiles(w.id);
451
- const issues = await checkDraft(w.projectId, w.draft, files.map((f) => f.path));
525
+ const issues = await checkDraft(w.spaceId, w.draft, files.map((f) => f.path));
452
526
  if (issues.length) {
453
527
  throw new ServiceError("has_issues", note("wizardStillErrors"), { issues });
454
528
  }