@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
@@ -344,6 +344,13 @@ export function putWizards(tenantId, data) {
344
344
  export function postRunReport(tenantId, data) {
345
345
  return call("POST", `/v1/runs/${encodeURIComponent(tenantId)}`, data);
346
346
  }
347
+ /**
348
+ * The broker's critical lines (docs/plans/broker.md, "Notifications"): a guest's at once, the
349
+ * rest once a day. The admin app's Diagnose page and Abuse checks read them.
350
+ */
351
+ export function postBrokerReport(tenantId, data) {
352
+ return call("POST", `/v1/broker/${encodeURIComponent(tenantId)}`, data);
353
+ }
347
354
  /** What a person said at the end of a run. */
348
355
  export function postFeedback(tenantId, data) {
349
356
  return call("POST", `/v1/feedback/${encodeURIComponent(tenantId)}`, data);
@@ -84,7 +84,7 @@ export async function flowView(userId, wizardId, options = {}) {
84
84
  const definition = options.definition ?? published?.definition ?? w.draft;
85
85
  // The app's own look unless it asks for one the wizard offers.
86
86
  const theme = options.theme && themeOffered(options.theme, definition.themes) ? options.theme : "host";
87
- const { theme: look } = await brandView(w.projectId, definition.themes, theme);
87
+ const { theme: look } = await brandView(w.spaceId, definition.themes, theme);
88
88
  return {
89
89
  wizard: {
90
90
  id: w.id,
@@ -3,6 +3,7 @@ import { z } from "zod";
3
3
  import { authoringGuide } from "../authoring/guide.js";
4
4
  import { wizardOpSchema } from "../authoring/ops.js";
5
5
  import { importFromRegistry, listConnectors, searchRegistry } from "../connectors/external.js";
6
+ import { guideSpaceConnections } from "../connectors/space-connections.js";
6
7
  import { RunConflict } from "../engine/runner.js";
7
8
  import { pluginToolsOf } from "../plugins/registry.js";
8
9
  import { prompt } from "../prompts.js";
@@ -10,11 +11,12 @@ import { publishAndSync, pushSharing } from "../services/cloud.js";
10
11
  import { ServiceError } from "../services/errors.js";
11
12
  import { deleteFile, listFiles, readFileText, writeFile } from "../services/files.js";
12
13
  import { marketplaceWizard, searchMarketplace } from "../services/marketplace.js";
14
+ import { requireStudio } from "../services/members-studio.js";
13
15
  import { markAgent, presentIn } from "../services/presence.js";
14
- import { defaultProject, listProjects, ownedProject } from "../services/projects.js";
15
16
  import { answerRunAsk, answerRunPage, controlRun, reviewRun, runReport, startRun, startTestRun, testRunReport, } from "../services/runs.js";
17
+ import { defaultSpace, listSpaces, ownedSpace } from "../services/spaces.js";
16
18
  import { checkDraftWidget } from "../services/widgets.js";
17
- import { createWizard, editWizard, listWizards, ownedWizard, parseDraft, shareUrl, studioUrl, updateWizardSettings, wizardState, writeDraft, } from "../services/wizards.js";
19
+ import { checkDraft, createWizard, editWizard, listWizards, ownedWizard, parseDraft, shareUrl, studioUrl, updateWizardSettings, wizardState, writeDraft, } from "../services/wizards.js";
18
20
  import { FLOW_VIEW_KEY, flowAppMeta, flowView } from "./flow-app.js";
19
21
  const definition = z
20
22
  .record(z.string(), z.unknown())
@@ -57,6 +59,16 @@ function failure(err) {
57
59
  function spaceFrom(p) {
58
60
  return p.origin === "local" ? "your computer" : "here";
59
61
  }
62
+ /** A Studio tool's item: the wizard or the test run it names. */
63
+ async function requireStudioOf(args) {
64
+ const { wizardId, runId } = (args ?? {});
65
+ if (typeof wizardId === "string") {
66
+ await requireStudio("wizards", wizardId);
67
+ }
68
+ else if (typeof runId === "string") {
69
+ await requireStudio("runs", runId);
70
+ }
71
+ }
60
72
  function annotationsOf(config) {
61
73
  const readOnly = config.readOnly ?? false;
62
74
  return {
@@ -114,6 +126,12 @@ export function registerTools(server, who) {
114
126
  return result;
115
127
  }
116
128
  };
129
+ /** The space a Studio tool works in: the one named, or the person's first; refused where closed. */
130
+ const studioSpace = async (spaceId) => {
131
+ const space = spaceId ? await ownedSpace(who.userId, spaceId) : await defaultSpace(who.userId);
132
+ await requireStudio("spaces", space.id);
133
+ return space;
134
+ };
117
135
  const tool = (name, scope, config, run) => {
118
136
  if (!who.scopes.includes(scope)) {
119
137
  return;
@@ -127,6 +145,9 @@ export function registerTools(server, who) {
127
145
  // The SDK has parsed `args` with `input` before this runs.
128
146
  (async (args) => {
129
147
  try {
148
+ if (config.studio) {
149
+ await requireStudioOf(args);
150
+ }
130
151
  return ok(await withPresence(args, config.readOnly ?? false, await run(args)));
131
152
  }
132
153
  catch (err) {
@@ -147,6 +168,9 @@ export function registerTools(server, who) {
147
168
  _meta: flowAppMeta,
148
169
  }, (async (args) => {
149
170
  try {
171
+ if (config.studio) {
172
+ await requireStudioOf(args);
173
+ }
150
174
  const { result: plain, view } = await run(args);
151
175
  const result = (await withPresence(args, config.readOnly ?? false, plain));
152
176
  return {
@@ -165,14 +189,12 @@ export function registerTools(server, who) {
165
189
  title: "Authoring guide",
166
190
  description: prompt("mcp", "tool.get_authoring_guide"),
167
191
  input: z.object({
168
- projectId: z.string().optional().describe("Defaults to the person's first project."),
192
+ spaceId: z.string().optional().describe("Defaults to the person's first space."),
169
193
  }),
170
194
  readOnly: true,
171
- }, async ({ projectId }) => {
172
- const project = projectId
173
- ? await ownedProject(who.userId, projectId)
174
- : await defaultProject(who.userId);
175
- return authoringGuide(await listConnectors(project.id), await pluginToolsOf(who.tenantId));
195
+ }, async ({ spaceId }) => {
196
+ const space = await studioSpace(spaceId);
197
+ return authoringGuide(await listConnectors(space.id), await pluginToolsOf(who.tenantId), await guideSpaceConnections(space.id));
176
198
  });
177
199
  // --- connectors ------------------------------------------------------------
178
200
  tool("find_connectors", "wizards:read", {
@@ -184,27 +206,25 @@ export function registerTools(server, who) {
184
206
  tool("list_connectors", "wizards:read", {
185
207
  title: "List connectors",
186
208
  description: prompt("mcp", "tool.list_connectors"),
187
- input: z.object({ projectId: z.string().optional() }),
209
+ input: z.object({ spaceId: z.string().optional() }),
188
210
  readOnly: true,
189
- }, async ({ projectId }) => {
190
- const project = projectId
191
- ? await ownedProject(who.userId, projectId)
192
- : await defaultProject(who.userId);
193
- return { projectId: project.id, connectors: await listConnectors(project.id) };
211
+ }, async ({ spaceId }) => {
212
+ const space = spaceId
213
+ ? await ownedSpace(who.userId, spaceId)
214
+ : await defaultSpace(who.userId);
215
+ return { spaceId: space.id, connectors: await listConnectors(space.id) };
194
216
  });
195
217
  tool("import_connector", "wizards:write", {
196
218
  title: "Import connector",
197
219
  description: prompt("mcp", "tool.import_connector"),
198
220
  input: z.object({
199
- projectId: z.string().optional(),
221
+ spaceId: z.string().optional(),
200
222
  domain: z.string().describe("A domain from find_connectors, e.g. notion.com"),
201
223
  kind: z.enum(["mcp", "openapi"]).optional(),
202
224
  }),
203
- }, async ({ projectId, domain, kind }) => {
204
- const project = projectId
205
- ? await ownedProject(who.userId, projectId)
206
- : await defaultProject(who.userId);
207
- return importFromRegistry(who.userId, project.id, { domain, kind });
225
+ }, async ({ spaceId, domain, kind }) => {
226
+ const space = await studioSpace(spaceId);
227
+ return importFromRegistry(who.userId, space.id, { domain, kind });
208
228
  });
209
229
  tool("list_starters", "wizards:read", {
210
230
  title: "List starters",
@@ -236,12 +256,12 @@ export function registerTools(server, who) {
236
256
  }
237
257
  return starter.definition;
238
258
  });
239
- tool("list_projects", "wizards:read", {
240
- title: "List projects",
241
- description: prompt("mcp", "tool.list_projects"),
259
+ tool("list_spaces", "wizards:read", {
260
+ title: "List spaces",
261
+ description: prompt("mcp", "tool.list_spaces"),
242
262
  input: z.object({}),
243
263
  readOnly: true,
244
- }, async () => (await listProjects(who.userId)).map((p) => ({
264
+ }, async () => (await listSpaces(who.userId)).map((p) => ({
245
265
  id: p.id,
246
266
  name: p.name,
247
267
  from: spaceFrom(p),
@@ -250,15 +270,15 @@ export function registerTools(server, who) {
250
270
  tool("list_wizards", "wizards:read", {
251
271
  title: "List wizards",
252
272
  description: prompt("mcp", "tool.list_wizards"),
253
- input: z.object({ projectId: z.string().optional() }),
273
+ input: z.object({ spaceId: z.string().optional() }),
254
274
  readOnly: true,
255
- }, async ({ projectId }) => {
256
- const spaces = new Map((await listProjects(who.userId)).map((p) => [p.id, p]));
257
- return (await listWizards(who.userId, projectId)).map((w) => {
258
- const space = spaces.get(w.projectId);
275
+ }, async ({ spaceId }) => {
276
+ const spaces = new Map((await listSpaces(who.userId)).map((p) => [p.id, p]));
277
+ return (await listWizards(who.userId, spaceId)).map((w) => {
278
+ const space = spaces.get(w.spaceId);
259
279
  return {
260
280
  id: w.id,
261
- projectId: w.projectId,
281
+ spaceId: w.spaceId,
262
282
  space: space?.name ?? null,
263
283
  spaceFrom: space ? spaceFrom(space) : null,
264
284
  title: w.title,
@@ -274,11 +294,12 @@ export function registerTools(server, who) {
274
294
  description: prompt("mcp", "tool.get_wizard"),
275
295
  input: z.object({ wizardId: z.string() }),
276
296
  readOnly: true,
297
+ studio: true,
277
298
  }, async ({ wizardId }) => {
278
299
  const s = await wizardState(await ownedWizard(who.userId, wizardId));
279
300
  return {
280
301
  wizardId: s.id,
281
- projectId: s.projectId,
302
+ spaceId: s.spaceId,
282
303
  revision: s.revision,
283
304
  draft: s.draft,
284
305
  issues: s.issues,
@@ -293,11 +314,16 @@ export function registerTools(server, who) {
293
314
  tool("validate_wizard", "wizards:read", {
294
315
  title: "Validate wizard",
295
316
  description: prompt("mcp", "tool.validate_wizard"),
296
- input: z.object({ definition }),
317
+ input: z.object({
318
+ definition,
319
+ spaceId: z.string().optional().describe("Defaults to the person's first space."),
320
+ }),
297
321
  readOnly: true,
298
322
  }, async (args) => {
299
323
  try {
300
- const { issues } = parseDraft(authored(args.definition));
324
+ const space = await studioSpace(args.spaceId);
325
+ const { draft } = parseDraft(authored(args.definition));
326
+ const issues = await checkDraft(space.id, draft);
301
327
  return { ok: issues.length === 0, issues };
302
328
  }
303
329
  catch (err) {
@@ -312,7 +338,7 @@ export function registerTools(server, who) {
312
338
  title: "Create wizard",
313
339
  description: prompt("mcp", "tool.create_wizard"),
314
340
  input: z.object({
315
- projectId: z.string().optional().describe("Defaults to the person's first project."),
341
+ spaceId: z.string().optional().describe("Defaults to the person's first space."),
316
342
  definition: definition.optional(),
317
343
  starterId: z.string().optional().describe("Copy this starter instead of sending JSON."),
318
344
  note,
@@ -336,6 +362,7 @@ export function registerTools(server, who) {
336
362
  note,
337
363
  }),
338
364
  destructive: true,
365
+ studio: true,
339
366
  }, async ({ wizardId, ...input }) => {
340
367
  const { revision, issues } = await editWizard(who.userId, wizardId, input, writer);
341
368
  return { revision, issues };
@@ -345,6 +372,7 @@ export function registerTools(server, who) {
345
372
  description: prompt("mcp", "tool.replace_wizard"),
346
373
  input: z.object({ wizardId: z.string(), baseRevision, definition, note }),
347
374
  destructive: true,
375
+ studio: true,
348
376
  }, async ({ wizardId, ...input }) => {
349
377
  const { revision, issues } = await writeDraft(who.userId, wizardId, { ...input, definition: authored(input.definition) }, writer);
350
378
  return { revision, issues };
@@ -356,6 +384,7 @@ export function registerTools(server, who) {
356
384
  input: z.object({ wizardId: z.string() }),
357
385
  destructive: true,
358
386
  openWorld: true,
387
+ studio: true,
359
388
  }, async ({ wizardId }) => publishAndSync(who.userId, wizardId));
360
389
  tool("set_sharing", "wizards:publish", {
361
390
  title: "Set sharing",
@@ -367,6 +396,7 @@ export function registerTools(server, who) {
367
396
  }),
368
397
  destructive: true,
369
398
  openWorld: true,
399
+ studio: true,
370
400
  }, async ({ wizardId, enabled, dailyRunLimit }) => {
371
401
  const w = await updateWizardSettings(who.userId, wizardId, {
372
402
  shareEnabled: enabled,
@@ -392,6 +422,7 @@ export function registerTools(server, who) {
392
422
  acceptReviews: z.boolean().default(true),
393
423
  }),
394
424
  openWorld: true,
425
+ studio: true,
395
426
  }, async ({ wizardId, answers, acceptReviews }) => {
396
427
  const { runId } = await startTestRun(who.userId, wizardId, { answers, acceptReviews });
397
428
  const report = await runReport(who.userId, runId, 2, "test");
@@ -414,6 +445,7 @@ export function registerTools(server, who) {
414
445
  .describe("Wait up to this long while the run is still working."),
415
446
  }),
416
447
  readOnly: true,
448
+ studio: true,
417
449
  }, async ({ runId, waitSeconds }) => testRunReport(who.userId, runId, waitSeconds));
418
450
  // --- using wizards: the flow, and runs of the published version -------------
419
451
  appTool("show_wizard", "wizards:read", {
@@ -426,6 +458,10 @@ export function registerTools(server, who) {
426
458
  readOnly: true,
427
459
  }, async ({ wizardId, version }) => {
428
460
  const view = await flowView(who.userId, wizardId, { shows: version });
461
+ // The draft is the Studio's; the published wizard is everyone's to run.
462
+ if (view.wizard.shows === "draft") {
463
+ await requireStudio("wizards", wizardId);
464
+ }
429
465
  return {
430
466
  result: {
431
467
  wizardId,
@@ -543,12 +579,14 @@ export function registerTools(server, who) {
543
579
  description: prompt("mcp", "tool.list_files"),
544
580
  input: z.object({ wizardId: z.string() }),
545
581
  readOnly: true,
582
+ studio: true,
546
583
  }, async ({ wizardId }) => (await listFiles(who.userId, wizardId)).map(({ path, mime, size }) => ({ path, mime, size })));
547
584
  tool("read_file", "wizards:read", {
548
585
  title: "Read workspace file",
549
586
  description: prompt("mcp", "tool.read_file"),
550
587
  input: z.object({ wizardId: z.string(), path: z.string() }),
551
588
  readOnly: true,
589
+ studio: true,
552
590
  }, async ({ wizardId, path }) => readFileText(who.userId, wizardId, path));
553
591
  tool("write_file", "wizards:write", {
554
592
  title: "Write workspace file",
@@ -561,6 +599,7 @@ export function registerTools(server, who) {
561
599
  mime: z.string().optional(),
562
600
  }),
563
601
  destructive: true,
602
+ studio: true,
564
603
  }, async ({ wizardId, path, content, base64, mime }) => {
565
604
  if ((content === undefined) === (base64 === undefined)) {
566
605
  throw new ServiceError("invalid", "Pass either content or base64.");
@@ -572,6 +611,7 @@ export function registerTools(server, who) {
572
611
  description: prompt("mcp", "tool.delete_file"),
573
612
  input: z.object({ wizardId: z.string(), path: z.string() }),
574
613
  destructive: true,
614
+ studio: true,
575
615
  }, async ({ wizardId, path }) => {
576
616
  await deleteFile(who.userId, wizardId, path);
577
617
  return { ok: true };
@@ -592,6 +632,7 @@ export function registerTools(server, who) {
592
632
  annotations: annotationsOf({ readOnly: true }),
593
633
  }, (async ({ wizardId, stepId, data }) => {
594
634
  try {
635
+ await requireStudio("wizards", wizardId);
595
636
  const r = await checkDraftWidget(who.userId, wizardId, stepId, data);
596
637
  return {
597
638
  content: [
@@ -967,7 +967,7 @@ async function embeddingAccess(cfg) {
967
967
  return null;
968
968
  }
969
969
  /**
970
- * The model that turns passages and questions into vectors for a project's document index: the
970
+ * The model that turns passages and questions into vectors for a space's document index: the
971
971
  * credits on a Manage-App's runtime; alone, what the settings choose — by default an AI Gateway
972
972
  * key, an OpenAI key, EmbeddingGemma in Ollama on this computer, then the linked account's
973
973
  * credits. Null where none is set up — an installed AI client has no such model — and the
@@ -3,7 +3,7 @@ import { existsSync } from "node:fs";
3
3
  import { cp, mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises";
4
4
  import { dirname, join, normalize } from "node:path";
5
5
  import { dataRef, MOTION_SIZES } from "@engenty/wizards-shared/definition";
6
- import { gradientCss, ruleLines, textStyleLine } from "@engenty/wizards-shared/projects";
6
+ import { gradientCss, ruleLines, textStyleLine } from "@engenty/wizards-shared/spaces";
7
7
  import { unzipSync } from "fflate";
8
8
  import { logoSectionLine, renderTemplate, resolveRef } from "../engine/template.js";
9
9
  import { env } from "../env.js";
@@ -11,7 +11,7 @@ import { getBlob } from "../files/blobs.js";
11
11
  import { extFor, loadAsset } from "../files/storage.js";
12
12
  import { prompt } from "../prompts.js";
13
13
  import { contentPolicy } from "../safety.js";
14
- import { projectFileContent } from "../services/project-files.js";
14
+ import { spaceFileContent } from "../services/space-files.js";
15
15
  import { placeSkills } from "./skills.js";
16
16
  import { soundCatalog } from "./sounds.js";
17
17
  import { runHyperframes } from "./tools.js";
@@ -79,10 +79,10 @@ async function writeBrand(root, ctx) {
79
79
  const fileName = (dir, f) => `${dir}/${safeName(f.name.replace(/\.[^.]+$/, ""))}.${extFor(f.mime) === "bin" ? (f.name.split(".").pop() ?? "bin") : extFor(f.mime)}`;
80
80
  const patterns = [];
81
81
  for (const p of b.patterns ?? []) {
82
- const f = ctx.projectFiles.find((x) => x.id === p.file);
82
+ const f = ctx.spaceFiles.find((x) => x.id === p.file);
83
83
  try {
84
84
  if (f) {
85
- const { data } = await projectFileContent(f.projectId, f.id);
85
+ const { data } = await spaceFileContent(f.spaceId, f.id);
86
86
  const name = fileName("patterns", f);
87
87
  files.push({ name, data });
88
88
  hash.update(name).update(data);
@@ -99,9 +99,9 @@ async function writeBrand(root, ctx) {
99
99
  }
100
100
  }
101
101
  const logos = [];
102
- for (const f of ctx.projectFiles.filter((p) => p.kind === "logo")) {
102
+ for (const f of ctx.spaceFiles.filter((p) => p.kind === "logo")) {
103
103
  try {
104
- const { data } = await projectFileContent(f.projectId, f.id);
104
+ const { data } = await spaceFileContent(f.spaceId, f.id);
105
105
  const name = fileName("logos", f);
106
106
  files.push({ name, data });
107
107
  hash.update(name).update(data);
@@ -187,12 +187,12 @@ const BASE = join(".engenty", "base");
187
187
  */
188
188
  function brandBaseDir(ctx, kitHash, brandStamp) {
189
189
  const key = createHash("sha256").update(`${kitHash}:${brandStamp}`).digest("hex").slice(0, 24);
190
- return join(env.dataDir, "brand-bases", ctx.project.id, key);
190
+ return join(env.dataDir, "brand-bases", ctx.space.id, key);
191
191
  }
192
192
  /** What in video/brand/ is the brand base: everything but the brand itself. */
193
193
  const isBrandItself = (name) => name === "brand.json" || name === "logos" || name === "patterns";
194
194
  /**
195
- * Brings the brand into a project that started from a base: brand.json and the logos as they are
195
+ * Brings the brand into a space that started from a base: brand.json and the logos as they are
196
196
  * now, and the brand base kept for them when there is one. A base that no longer fits the brand
197
197
  * is removed — the video makes it again, as BRAND.md says.
198
198
  */
@@ -61,7 +61,7 @@ function cliEnv() {
61
61
  out.HYPERFRAMES_SKIP_SKILLS = "1";
62
62
  return out;
63
63
  }
64
- /** Runs `hyperframes <args>` in a project folder and returns what it printed (the tail). */
64
+ /** Runs `hyperframes <args>` in a space folder and returns what it printed (the tail). */
65
65
  export async function runHyperframes(args, opts) {
66
66
  const cli = await hyperframesEntry();
67
67
  return spawnText(process.execPath, [cli, ...args], {
@@ -42,7 +42,7 @@ export function runEnded(runId, status) {
42
42
  }
43
43
  return {
44
44
  run: { id: run.id, wizardId: run.wizardId, mode: run.mode, status },
45
- wizard: { id: wizard.id, title: run.definition.title, projectId: wizard.projectId },
45
+ wizard: { id: wizard.id, title: run.definition.title, spaceId: wizard.spaceId },
46
46
  values: run.state.values,
47
47
  };
48
48
  });
@@ -57,7 +57,7 @@ export function spaceChanged(event, spaceId) {
57
57
  /** A file of a space was read and is ready, or was removed. Not waited for either. */
58
58
  export function spaceFileChanged(event, file) {
59
59
  void emitPluginEvent(event, {
60
- space: { id: file.projectId },
60
+ space: { id: file.spaceId },
61
61
  file: { id: file.id, name: file.name, kind: file.kind, mime: file.mime },
62
62
  });
63
63
  }
@@ -1,4 +1,5 @@
1
1
  import { and, eq } from "drizzle-orm";
2
+ import { readingAs, SYSTEM } from "../broker/rwx.js";
2
3
  import { control, controlDb, withTenant } from "../db/client.js";
3
4
  import { env } from "../env.js";
4
5
  import { twoWayActive } from "../sync/state.js";
@@ -49,7 +50,9 @@ export async function runDueJobs(now = new Date()) {
49
50
  target: [control.pluginJob.tenantId, control.pluginJob.plugin, control.pluginJob.name],
50
51
  set: { lastRunAt: now },
51
52
  });
52
- started.push(withTenant(tenant.id, () => job.handler({ tenantId: tenant.id, lastRun: last, signal: plugin.stopped.signal }))
53
+ started.push(withTenant(tenant.id, () =>
54
+ // A job runs on the clock, for no person, guest or run: the runtime itself reads.
55
+ readingAs([SYSTEM], async () => job.handler({ tenantId: tenant.id, lastRun: last, signal: plugin.stopped.signal })))
53
56
  .catch((err) => console.error(`[plugin ${id}] job ${name}:`, err))
54
57
  .finally(() => running.delete(key)));
55
58
  }
@@ -17,7 +17,7 @@ import { currentFeatures } from "../features.js";
17
17
  import { managed } from "../manage.js";
18
18
  import { conversationAccess, ModelUnavailableError, textModel } from "../models.js";
19
19
  import { seal, unseal } from "../secrets/crypto.js";
20
- import { putIndexEntry, removeIndexEntries } from "../services/project-index.js";
20
+ import { putIndexEntry, removeIndexEntries } from "../services/space-index.js";
21
21
  import { originData } from "../services/space-origin.js";
22
22
  import { readSetting, writeSetting } from "../settings.js";
23
23
  import { safeFetch } from "../tools/net-guard.js";
@@ -228,7 +228,7 @@ function apiFor(record) {
228
228
  spaceData: originData(source.id),
229
229
  spaces: {
230
230
  async brand(space) {
231
- const p = await db.query.project.findFirst({ where: eq(schema.project.id, space) });
231
+ const p = await db.query.space.findFirst({ where: eq(schema.space.id, space) });
232
232
  return p
233
233
  ? {
234
234
  name: p.brand.name ?? "",
@@ -32,7 +32,7 @@ HOW YOU WORK
32
32
  - Call independent tools in the same step (they run together).
33
33
  - Never retype data you downloaded. Reshape it with run_script (output to a file), or let the widget read the raw files with wizard.json() and transform them when it starts.
34
34
  - Work in few, purposeful steps: every tool call costs the admin time and credits.
35
- - Services the wizard should work in for the person: find_connectors, import_connector (it returns the actions), then a connection for it in the wizard. list_connectors shows what the project has.
35
+ - Services the wizard should work in for the person: find_connectors, import_connector (it returns the actions), then a connection for it in the wizard. list_connectors shows what the space has.
36
36
  - Research what you need to prepare (web_search, web_fetch) — e.g. which lakes, their outlines, a chart library.
37
37
 
38
38
  <!-- section: subscription.system -->
@@ -41,7 +41,7 @@ You work on exactly one wizard: id "${wizard_id}". Read it with get_wizard befor
41
41
  Call get_authoring_guide once before your first change. Fix every issue a write reports before you answer.
42
42
 
43
43
  <!-- section: system -->
44
- <!-- The system prompt. schema, principles, widgets and surfaces are authoring.md's sections, project_tools its line.* sections (projectLines() in authoring/guide.ts); example is the example wizard as JSON. -->
44
+ <!-- The system prompt. schema, principles, widgets and surfaces are authoring.md's sections, space_tools its line.* sections (spaceLines() in authoring/guide.ts); example is the example wizard as JSON. -->
45
45
  ${persona}
46
46
 
47
47
  ${schema}
@@ -53,7 +53,7 @@ ${widgets}
53
53
  Surface catalog (for surface steps and output.surface):
54
54
  ${surfaces}
55
55
 
56
- ${project_tools}
56
+ ${space_tools}
57
57
 
58
58
  Example of a complete wizard:
59
59
  ```json
@@ -2,7 +2,7 @@
2
2
  The authoring guide: how a wizard is written down and what makes a good one. Read by
3
3
  authoring/guide.ts. authoringGuide() (section guide) is what MCP clients get from
4
4
  get_authoring_guide and what Goose knows; the architect (agents/architect.ts) builds its own
5
- system prompt from schema, principles, widgets, surfaces and the line.* sections (projectLines()).
5
+ system prompt from schema, principles, widgets, surfaces and the line.* sections (spaceLines()).
6
6
  engine/steps.ts reads surfaces too.
7
7
  -->
8
8
 
@@ -37,6 +37,7 @@ ${sandbox}
37
37
  - Collecting from everyone who runs the wizard (requests, leads, sign-ups, feedback): a list with "shared": true, saved with list_write. It is the admin's, under Space → Data; never show one person's rows to another. Longer text for every run (a running summary, a log): the "pages" tool.
38
38
  - The person's mail: one connection of kind "mail", a page field of kind "connection" early in the wizard, and the agent step lists it in "connections". Do not ask for the provider or the address in other fields — the connect field does that.
39
39
  - Working in a service for the person (read their Notion, create an issue, look up a customer): import the service as a connector, declare a connection with "connector", put a page field of kind "connection" before the step, and list the connection in the step's "connections". Prefer a connector over the browser whenever the service has one.
40
+ - Working in the space's own account (its CRM, its calendar, its mailbox — set up by the admins, listed below as connections of the space): declare a connection with "spaceConnection", no connect field. AI steps READ there; every WRITE (create, update, send, delete) is a fixed step: "call" with the connection, the action and fixed input fields from the run's values — the AI never writes as the space, and the person running is never asked for it. Example: an agent step reads the request and extracts the fields; then { "type": "agent", "call": { "connection": "crm", "action": "create_contact", "input": { "email": "{{email}}", "note": "{{steps.read.summary}}" } }, "output": { "format": "json" } }.
40
41
  - Logins on websites: never ask for passwords in page fields. An agent step with the browser tool asks the person at the moment it meets the login (browser_request_credentials); write that into its instructions, and that it must go on without the site when the person skips.
41
42
  - Most people open a wizard on their phone. Keep pages short, and let the phone do the typing: photos with an "image" field (multiple) instead of descriptions, the place with a "location" field instead of an address form, what happened as an "audio" field instead of a long textarea (keep an optional textarea beside it), a sign-off as a "signature" field, a serial or ticket number as a "text" field with scan. Typical: damage report, handover protocol, site inspection, delivery note.
42
43
  - How it runs: the first message may name the channels ("Läuft als: …" / "Runs as: …"); they are set already, never ask about them. A call, an SMS or WhatsApp asks by voice or text only: where one of them is named, keep each answer to text, a choice, a number or a date, and leave photos, files, signatures and maps to pages that only the browser shows (a call hands over a link by SMS).
@@ -58,7 +59,7 @@ ${sandbox}
58
59
  <!-- Technical: engineering owns everything below. -->
59
60
 
60
61
  <!-- section: guide -->
61
- <!-- authoringGuide(): the whole guide. schema, principles, widgets and surfaces are the sections below; project_tools is projectLines(): the line.* sections below, joined by blank lines; example is the example wizard as JSON. -->
62
+ <!-- authoringGuide(): the whole guide. schema, principles, widgets and surfaces are the sections below; space_tools is spaceLines(): the line.* sections below, joined by blank lines; example is the example wizard as JSON. -->
62
63
  engenty wizards: a wizard is a page-by-page flow an end user walks through on a shared link. Pages ask questions; AI steps research, write, draw images, render video, build documents and dashboards, or write into other systems. You author the wizard as JSON; the person who asked you is the ADMIN, the people who later open the link are END USERS.
63
64
 
64
65
  ${schema}
@@ -70,7 +71,7 @@ ${widgets}
70
71
  Surface catalog (for surface steps and output.surface):
71
72
  ${surfaces}
72
73
 
73
- ${project_tools}
74
+ ${space_tools}
74
75
 
75
76
  Models: a step names the KIND of model it needs, never a model. Pick the cheapest class that does the job:
76
77
  - "classifier": routing, yes/no, picking from options, pulling a few values out of text.
@@ -131,9 +132,14 @@ type List = {
131
132
  type Connection =
132
133
  | { id, kind: "mail", title?, description? }
133
134
  // the person picks how to connect (Gmail, Outlook, or any mailbox over IMAP); steps only ever READ it
135
+ | { id, spaceConnection: spaceConnectionId, actions?: actionId[], title?, description? }
136
+ // a connection of the SPACE (listed below), set up by its admins, who chose how it signs in, who may use it and
137
+ // what each kind of action may do; the wizard holds no account and "policy" has no say. Where it signs in as
138
+ // the space, an agent step that lists it gets its READ actions only: a write is a fixed step with "call"
139
+ // (connection + action + fixed input), never the model's. Where each person signs in, it works like "connector".
134
140
  | { id, connector: connectorId, actions?: actionId[], policy?: { [actionId]: "allow"|"ask" }, title?, description? }
135
141
  // connector = a service the wizard works in for the person: a built-in one (Gmail, Google Drive, Calendar and
136
- // Contacts, Outlook, OneDrive, Slack, GitHub, HubSpot, S3) or one imported into the project from the
142
+ // Contacts, Outlook, OneDrive, Slack, GitHub, HubSpot, S3) or one imported into the space from the
137
143
  // integrations registry. The person connects their own account (OAuth or API key) on a page.
138
144
  // kind "mail" reads any mailbox the same way and keeps attachments as files; use the gmail / outlook
139
145
  // connectors only for what it cannot do (drafts, sending, labels, calendar).
@@ -237,10 +243,14 @@ type AgentStep = {
237
243
  type: "agent"
238
244
  instructions: string // the task, with {{templates}} ("" with call)
239
245
  call?: { tool: "<plugin>.<tool>", input: { … } }
240
- // NO MODEL: one plugin tool called once with this input; its answer IS the json output
241
- // (fields name the keys later steps read). Use it where a model would only fetch and copy
242
- // data (free appointment times) — it answers in a second instead of half a minute.
243
- // String inputs are templates; a filled-in whole number or true/false is passed as one.
246
+ | { connection: connectionId, action: actionId, input: { … } }
247
+ // NO MODEL: one plugin tool, or one action of a connection, called once with this input; its
248
+ // answer IS the json output (fields name the keys later steps read). Use it where a model
249
+ // would only fetch and copy data (free appointment times) — it answers in a second instead
250
+ // of half a minute — and for EVERY write through a connection that signs in as the space.
251
+ // String inputs are templates ("{{email}}", "{{steps.read.summary}}"); a filled-in whole
252
+ // number or true/false is passed as one, an empty one is left out. On the person's own
253
+ // connection a write still asks them first.
244
254
  tools: ("web_search"|"web_fetch"|"browser"|"sandbox"|"image"|"http"|"pages"|"code")[]
245
255
  connections?: string[] // ids of wizard connections this step may read (mail → mail_search, mail_read, mail_save)
246
256
  output: { format: "text"|"markdown"|"json", fields?: { id, kind: "text"|"number"|"list"|"table"|"yesno"|"choice"|"score", description, columns?: string[], options?: string[] }[], schema?: Schema, surface?: SurfaceComponent[] | true }
@@ -259,8 +269,8 @@ type AgentStep = {
259
269
  // Every agent step also has, without listing them: list_read / list_write (the wizard's lists), files_list,
260
270
  // read_document (PDF, scans and photos, Word, Excel, CSV, saved mails) and scan_documents (invoice / receipt fields, many at once)
261
271
  // — on an installed client only where there is something to read: tools or connections, uploads, lists or kept files;
262
- // and where the space has Knowledge: project_search (a question, "where" on its typed categories, hits checked for relevance),
263
- // project_list (by categories), page_read / table_read / project_document (an item whole, by its path).
272
+ // and where the space has Knowledge: space_search (a question, "where" on its typed categories, hits checked for relevance),
273
+ // space_list (by categories), page_read / table_read / space_document (an item whole, by its path).
264
274
  // "pages" brings: page_read / page_write — Markdown pages of the space the wizard keeps for every run (notes, a log
265
275
  // that grows with append), shown to the admin under Space → Data; page_read also reads Knowledge by path.
266
276
  // "code" brings: execute_typescript — the model writes one program that calls the step's other tools (not the browser) as
@@ -411,7 +421,7 @@ type ResultStep = { type: "result", message?: string, deliverables: { from: step
411
421
 
412
422
  Templates (in instructions/prompt): {{fieldId}} · {{steps.stepId}} (whole output) · {{steps.stepId.key}} (json key)
413
423
  · {{itemsField}} (line items as a table WITH computed net/VAT/total) · {{itemsField.net|vat|gross}} · {{today}}
414
- · the project (its settings): {{brand.name}} {{brand.about}} {{brand.colors}} · {{facts.key}} (one fact: address, VAT ID, …) · {{facts}} (all facts)
424
+ · the space (its settings): {{brand.name}} {{brand.brandName}} {{brand.tagline}} {{brand.voice}} {{brand.links}} {{brand.about}} {{brand.colors}} · {{facts.key}} (one fact: address, VAT ID, …) · {{facts}} (all facts)
415
425
  — every AI step already knows them, name one only where the text must carry it; agent steps also search the space's Knowledge
416
426
  and are told its categories: say in a step's instructions which category to filter by when the task names one
417
427
  · {{lists.listId}} (the stored list as a table, as it is when the step starts) · {{fileField}} (the names of the uploads, for read_document)
@@ -481,13 +491,32 @@ Components and props (a prop may be a literal or {"path": "/key/..."} into the d
481
491
  - Steps { items, textKey?, minutesKey? } — ordered work, numbered, with times
482
492
  - Link { title, subtitle?, eyebrow?, meta?, look?: "row"|"card", items: {"path": "/recipes"}, key?: "id", value: {"path": "recipe_id"}, view: id } — opens the entry of items whose key is value in a sheet, drawn by view; title, subtitle and meta read that entry, eyebrow the row the Link sits in
483
493
  - Callout { text, title?, tone?: "tip"|"note"|"warning" }
494
+ - Markdown { text } — formatted text: bold, lists, links; Text for one plain line
495
+ - Sources { items: [{ title, url? }] or {"path": ...}, titleKey?, urlKey? } — where it was found, as small chips
496
+ - File { file: an asset id or {"path": ...}, name, mime?, preview?: false } — a file with its name and Open; a PDF or picture shows itself unless preview is false
497
+ - Video { src, poster? } / Audio { src, title? } — a clip or a recording, an asset id or {"path": ...}
498
+ - Gallery { items: [asset ids] or {"path": ...}, srcKey?, captionKey? } — pictures side by side; srcKey / captionKey: the keys of entries that are objects
484
499
  A path may put its value into words: {"path": "in_fridge", "map": {"true": "da", "false": "einkaufen"}}, {"path": "minutes", "format": "{} Min"}.
485
500
  Design it like an app, not a report: lead with a headline, the key figure or the chips; one Card per thing, never a Table of things; ordered work is Steps, things to get are a Checklist, sets are grouped by their key. A Table only for figures people compare across columns.
486
501
  Keep it small: what the person needs to see first, then the details. Never invent numbers: bind them by path.
487
502
 
503
+ <!-- section: surfaces.chat -->
504
+ <!-- What a view in a Work chat adds to the surfaces section above: show_view in services/work-ai.ts reads both. -->
505
+ In a chat, show_view draws the view in the chat for everyone in it. The data is what you found: put the rows and figures into "data" and bind them by path; never type numbers into the components.
506
+ In a chat a view may also:
507
+ - ask the AI: Button { label, action: "ask", prompt? } — the person who taps it says the prompt (else the label) in the chat, and you answer it
508
+ - open a file: Button { label, action: "open", target: a file id }
509
+ - point to a thing of the space: Ref { title, open, subtitle?, meta? } — open is what search_space gave as "open" ("p:…", "t:…", "f:…"), or "chat:<id>", "wizard:<id>"
510
+ - ask for answers: one Form { title?, submit, children: [Field ids] } with Field { name, kind, label, required?, options?, value?, placeholder?, help?, multiple? }
511
+ kind: text, textarea, number, select, multiselect (both need options: [texts]), date, email, url, toggle, color, image (a picture or the camera), file, location (where the person is), audio (a recording), signature
512
+ value prefills what you already know from the chat; the person still checks it. The answers come back as that person's message; once someone sent them, the form shows them.
513
+ A file id is the space's file: what search_space gave after "f:", or a file in a message. Media and files come from the space only, never from an address on the web.
514
+ Never ask for passwords, card numbers or other secrets in a Form.
515
+ Use a view when rows, figures, a comparison or a few questions answer better than text: write one short sentence around it, not the same content again. For a short answer, write text.
516
+
488
517
  <!-- section: line.connectors -->
489
518
  <!-- connectors: one "- id — name, tools prefix_*: actions" line per connector -->
490
- Connectors a wizard of this project can use (built in, or imported from the integrations registry; find more with find_connectors + import_connector):
519
+ Connectors a wizard of this space can use (built in, or imported from the integrations registry; find more with find_connectors + import_connector):
491
520
  ${connectors}
492
521
 
493
522
  <!-- section: line.connectors.not_set_up -->
@@ -497,6 +526,11 @@ NOT SET UP on this server: tell the admin before you build on it
497
526
  <!-- section: line.connectors.no_actions -->
498
527
  actions appear once an account is connected
499
528
 
529
+ <!-- section: line.space_connections -->
530
+ <!-- Only where the space has connections; connections: one "- id — name (connector), signs in as …, actions: …" line each. -->
531
+ Connections of this space, set up by its admins (a wizard uses one with { "spaceConnection": id }; where it signs in as the space, agent steps read and a step with "call" writes):
532
+ ${connections}
533
+
500
534
  <!-- section: line.plugin_tools -->
501
535
  <!-- Only when the app's plugins add tools; tools: one "- id — description" line per tool. -->
502
536
  Tools of this app's plugins. An agent step lists one in "tools" by its full id, next to the built-in ones; a wizard that uses one runs only where that plugin is installed: