@engenty/wizards-runtime 0.13.0 → 0.14.1

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 +26 -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/{0027_space_skill.sql → 0030_space_skill.sql} +8 -8
  35. package/apps/runtime/dist/db/migrations/tenant/0031_space.sql +624 -0
  36. package/apps/runtime/dist/db/migrations/tenant/0032_rwx_rule.sql +18 -0
  37. package/apps/runtime/dist/db/migrations/tenant/0033_broker_log.sql +23 -0
  38. package/apps/runtime/dist/db/migrations/tenant/0034_space_connection.sql +35 -0
  39. package/apps/runtime/dist/db/migrations/tenant/0035_run_grant.sql +1 -0
  40. package/apps/runtime/dist/db/migrations/tenant/0036_approval_held_for.sql +1 -0
  41. package/apps/runtime/dist/db/migrations/tenant/0037_ways_out.sql +5 -0
  42. package/apps/runtime/dist/db/migrations/tenant/0038_heard.sql +11 -0
  43. package/apps/runtime/dist/db/migrations/tenant/0039_members_studio.sql +1 -0
  44. package/apps/runtime/dist/db/migrations/tenant/meta/0027_snapshot.json +383 -155
  45. package/apps/runtime/dist/db/migrations/tenant/meta/0028_snapshot.json +4468 -0
  46. package/apps/runtime/dist/db/migrations/tenant/meta/0029_snapshot.json +4475 -0
  47. package/apps/runtime/dist/db/migrations/tenant/meta/0030_snapshot.json +4629 -0
  48. package/apps/runtime/dist/db/migrations/tenant/meta/0031_snapshot.json +4629 -0
  49. package/apps/runtime/dist/db/migrations/tenant/meta/0032_snapshot.json +4757 -0
  50. package/apps/runtime/dist/db/migrations/tenant/meta/0033_snapshot.json +5039 -0
  51. package/apps/runtime/dist/db/migrations/tenant/meta/0034_snapshot.json +5022 -0
  52. package/apps/runtime/dist/db/migrations/tenant/meta/0035_snapshot.json +5029 -0
  53. package/apps/runtime/dist/db/migrations/tenant/meta/0036_snapshot.json +5037 -0
  54. package/apps/runtime/dist/db/migrations/tenant/meta/0037_snapshot.json +5076 -0
  55. package/apps/runtime/dist/db/migrations/tenant/meta/0038_snapshot.json +5145 -0
  56. package/apps/runtime/dist/db/migrations/tenant/meta/0039_snapshot.json +5153 -0
  57. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +86 -2
  58. package/apps/runtime/dist/db/schema.js +295 -72
  59. package/apps/runtime/dist/docs/dev/architecture.md +215 -0
  60. package/apps/runtime/dist/docs/dev/broker.md +298 -0
  61. package/apps/runtime/dist/docs/dev/index.md +5 -1
  62. package/apps/runtime/dist/docs/dev/integration/index.md +2 -0
  63. package/apps/runtime/dist/docs/dev/meta.json +3 -0
  64. package/apps/runtime/dist/docs/dev/plugins/connections.md +8 -5
  65. package/apps/runtime/dist/docs/dev/plugins/events.md +1 -1
  66. package/apps/runtime/dist/docs/dev/plugins/examples.md +1 -0
  67. package/apps/runtime/dist/docs/dev/plugins/index.md +2 -2
  68. package/apps/runtime/dist/docs/dev/plugins/reference.md +3 -2
  69. package/apps/runtime/dist/docs/dev/plugins/space.md +16 -6
  70. package/apps/runtime/dist/docs/dev/plugins/studio.md +2 -2
  71. package/apps/runtime/dist/docs/dev/plugins/tools.md +0 -1
  72. package/apps/runtime/dist/docs/dev/skills.md +16 -9
  73. package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +40 -5
  74. package/apps/runtime/dist/docs/dev/wizard-format/lists-and-connections.md +17 -2
  75. package/apps/runtime/dist/docs/dev/wizard-format/templates.md +2 -0
  76. package/apps/runtime/dist/docs/dev/wizard-format/views-and-widgets.md +22 -2
  77. package/apps/runtime/dist/docs/user-guide/capabilities.md +132 -0
  78. package/apps/runtime/dist/docs/user-guide/cloud-sync.md +2 -0
  79. package/apps/runtime/dist/docs/user-guide/command-line.md +1 -0
  80. package/apps/runtime/dist/docs/user-guide/connectors.md +63 -7
  81. package/apps/runtime/dist/docs/user-guide/index.md +10 -1
  82. package/apps/runtime/dist/docs/user-guide/meta.json +6 -1
  83. package/apps/runtime/dist/docs/user-guide/protocol.md +80 -0
  84. package/apps/runtime/dist/docs/user-guide/skills.md +8 -4
  85. package/apps/runtime/dist/docs/user-guide/space.md +5 -4
  86. package/apps/runtime/dist/docs/user-guide/together.md +16 -2
  87. package/apps/runtime/dist/docs/user-guide/troubleshooting.md +2 -2
  88. package/apps/runtime/dist/docs/user-guide/work-mode.md +128 -0
  89. package/apps/runtime/dist/engenty/connections-external/build-connector.js +2 -5
  90. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +72 -0
  91. package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +1 -1
  92. package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +3 -2
  93. package/apps/runtime/dist/engenty/connections-sdk/types.js +2 -0
  94. package/apps/runtime/dist/engenty/connections-slack/connector.js +2 -1
  95. package/apps/runtime/dist/engine/resources.js +43 -12
  96. package/apps/runtime/dist/engine/runner.js +75 -23
  97. package/apps/runtime/dist/engine/steps.js +30 -12
  98. package/apps/runtime/dist/engine/template.js +18 -1
  99. package/apps/runtime/dist/env.js +9 -4
  100. package/apps/runtime/dist/index.js +18 -2
  101. package/apps/runtime/dist/live/feed.js +2 -2
  102. package/apps/runtime/dist/live/origin.js +2 -2
  103. package/apps/runtime/dist/live/views.js +51 -26
  104. package/apps/runtime/dist/manage.js +7 -0
  105. package/apps/runtime/dist/mcp/flow-app.js +1 -1
  106. package/apps/runtime/dist/mcp/tools.js +75 -34
  107. package/apps/runtime/dist/models.js +1 -1
  108. package/apps/runtime/dist/motion-graphics/project.js +8 -8
  109. package/apps/runtime/dist/motion-graphics/tools.js +1 -1
  110. package/apps/runtime/dist/plugins/events.js +2 -2
  111. package/apps/runtime/dist/plugins/jobs.js +4 -1
  112. package/apps/runtime/dist/plugins/loader.js +2 -2
  113. package/apps/runtime/dist/prompts/architect.md +3 -3
  114. package/apps/runtime/dist/prompts/authoring.md +46 -12
  115. package/apps/runtime/dist/prompts/goose.md +7 -7
  116. package/apps/runtime/dist/prompts/mcp.md +6 -6
  117. package/apps/runtime/dist/prompts/services.md +4 -4
  118. package/apps/runtime/dist/prompts/step.md +2 -2
  119. package/apps/runtime/dist/prompts/tools.md +39 -10
  120. package/apps/runtime/dist/routes/api.js +31 -20
  121. package/apps/runtime/dist/routes/broker.js +316 -0
  122. package/apps/runtime/dist/routes/connections.js +71 -0
  123. package/apps/runtime/dist/routes/delivery.js +25 -0
  124. package/apps/runtime/dist/routes/discover.js +17 -0
  125. package/apps/runtime/dist/routes/live.js +11 -1
  126. package/apps/runtime/dist/routes/person.js +4 -1
  127. package/apps/runtime/dist/routes/plugins.js +3 -1
  128. package/apps/runtime/dist/routes/rules.js +26 -0
  129. package/apps/runtime/dist/routes/runs.js +54 -33
  130. package/apps/runtime/dist/routes/skills.js +6 -6
  131. package/apps/runtime/dist/routes/studio.js +153 -144
  132. package/apps/runtime/dist/routes/work.js +199 -0
  133. package/apps/runtime/dist/sandbox/index.js +27 -0
  134. package/apps/runtime/dist/services/access.js +38 -17
  135. package/apps/runtime/dist/services/api.js +38 -13
  136. package/apps/runtime/dist/services/architect.js +3 -3
  137. package/apps/runtime/dist/services/assistant-chats.js +9 -1
  138. package/apps/runtime/dist/services/brand.js +12 -12
  139. package/apps/runtime/dist/services/broker-bell.js +69 -0
  140. package/apps/runtime/dist/services/broker-notify.js +127 -0
  141. package/apps/runtime/dist/services/client-steps.js +79 -0
  142. package/apps/runtime/dist/services/cloud.js +42 -42
  143. package/apps/runtime/dist/services/command-risk.js +51 -0
  144. package/apps/runtime/dist/services/discover.js +85 -0
  145. package/apps/runtime/dist/services/knowledge-model.js +13 -13
  146. package/apps/runtime/dist/services/knowledge.js +117 -80
  147. package/apps/runtime/dist/services/manage-reports.js +74 -7
  148. package/apps/runtime/dist/services/members-studio.js +165 -0
  149. package/apps/runtime/dist/services/onboarding.js +22 -22
  150. package/apps/runtime/dist/services/package-file.js +1 -1
  151. package/apps/runtime/dist/services/package.js +22 -22
  152. package/apps/runtime/dist/services/pages.js +7 -7
  153. package/apps/runtime/dist/services/runs.js +4 -3
  154. package/apps/runtime/dist/services/seen.js +55 -0
  155. package/apps/runtime/dist/services/shares.js +23 -13
  156. package/apps/runtime/dist/services/site.js +23 -23
  157. package/apps/runtime/dist/services/skills-registry.js +15 -15
  158. package/apps/runtime/dist/services/skills.js +44 -44
  159. package/apps/runtime/dist/services/space-categories.js +35 -35
  160. package/apps/runtime/dist/services/space-data.js +130 -111
  161. package/apps/runtime/dist/services/{project-files.js → space-files.js} +84 -75
  162. package/apps/runtime/dist/services/{project-index.js → space-index.js} +116 -73
  163. package/apps/runtime/dist/services/space-origin.js +19 -11
  164. package/apps/runtime/dist/services/spaces.js +478 -612
  165. package/apps/runtime/dist/services/synced-spaces.js +668 -0
  166. package/apps/runtime/dist/services/themes.js +15 -15
  167. package/apps/runtime/dist/services/widgets.js +6 -6
  168. package/apps/runtime/dist/services/wizards.js +112 -38
  169. package/apps/runtime/dist/services/work-ai.js +257 -0
  170. package/apps/runtime/dist/services/work-approvals.js +104 -0
  171. package/apps/runtime/dist/services/work-chats.js +908 -0
  172. package/apps/runtime/dist/services/work-connections.js +90 -0
  173. package/apps/runtime/dist/services/work-files.js +85 -0
  174. package/apps/runtime/dist/services/work-mastra.js +73 -0
  175. package/apps/runtime/dist/services/work-sandbox.js +42 -0
  176. package/apps/runtime/dist/sharing/files.js +14 -4
  177. package/apps/runtime/dist/sharing/index.js +40 -39
  178. package/apps/runtime/dist/sharing/jobs.js +67 -17
  179. package/apps/runtime/dist/sharing/targets/connector.js +10 -6
  180. package/apps/runtime/dist/sharing/targets/email.js +10 -8
  181. package/apps/runtime/dist/sharing/targets/slack.js +10 -8
  182. package/apps/runtime/dist/sharing/targets/storage.js +6 -4
  183. package/apps/runtime/dist/store/index.js +14 -3
  184. package/apps/runtime/dist/store/shared-lists.js +4 -2
  185. package/apps/runtime/dist/sync/apply.js +2 -2
  186. package/apps/runtime/dist/sync/client.js +113 -113
  187. package/apps/runtime/dist/sync/hub.js +41 -41
  188. package/apps/runtime/dist/sync/log.js +12 -12
  189. package/apps/runtime/dist/sync/records.js +118 -120
  190. package/apps/runtime/dist/texts.js +38 -2
  191. package/apps/runtime/dist/tools/connections.js +112 -0
  192. package/apps/runtime/dist/tools/connector.js +157 -67
  193. package/apps/runtime/dist/tools/index.js +28 -13
  194. package/apps/runtime/dist/tools/mail.js +40 -11
  195. package/apps/runtime/dist/tools/pages.js +11 -5
  196. package/apps/runtime/dist/tools/plugin.js +43 -7
  197. package/apps/runtime/dist/tools/skills.js +1 -1
  198. package/apps/runtime/dist/tools/{project.js → space.js} +30 -25
  199. package/apps/runtime/dist/tools/store.js +3 -2
  200. package/apps/runtime/dist/widgets/step.js +10 -10
  201. package/apps/web/dist/assets/AboutDialog-SpDcn8VZ.js +1 -0
  202. package/apps/web/dist/assets/CapabilitiesPage-Bgnm_3dk.js +2 -0
  203. package/apps/web/dist/assets/{ChangelogDialog-SwyId00t.js → ChangelogDialog-DAnjV6cZ.js} +1 -1
  204. package/apps/web/dist/assets/{CodeEditor-BwZsk5Al.js → CodeEditor-nxoOt8ge.js} +1 -1
  205. package/apps/web/dist/assets/EditorPage-B98C-9Nv.js +3 -0
  206. package/apps/web/dist/assets/{FlowPreview-DtSpjVTl.js → FlowPreview-aMfwcPul.js} +1 -1
  207. package/apps/web/dist/assets/LangSwitch-DpD0inR4.js +1 -0
  208. package/apps/web/dist/assets/Marketplace-CpzD9pNQ.js +2 -0
  209. package/apps/web/dist/assets/NewWizardChannels-D8IYLg_S.js +1 -0
  210. package/apps/web/dist/assets/NewWizardPage-DlBt0Mfq.js +7 -0
  211. package/apps/web/dist/assets/OnboardingPage-ztHT01ah.js +1 -0
  212. package/apps/web/dist/assets/PreviewPane-DC1kAi3x.js +9 -0
  213. package/apps/web/dist/assets/PublicRunner-D6lKP0j8.js +1 -0
  214. package/apps/web/dist/assets/ReadOnly-DFsuKPCw.js +1 -0
  215. package/apps/web/dist/assets/SettingsPage-DkHeCO2c.js +2 -0
  216. package/apps/web/dist/assets/SetupPage-DZ8xRkfS.js +1 -0
  217. package/apps/web/dist/assets/SharePage-494ZPsjQ.js +1 -0
  218. package/apps/web/dist/assets/SkillEditor-CqQMg2MC.js +1 -0
  219. package/apps/web/dist/assets/Skills-CnhpgoOA.js +9 -0
  220. package/apps/web/dist/assets/SpacePage-CWlU_BZP.js +2 -0
  221. package/apps/web/dist/assets/UpdateCheck-BKNkNJyG.js +2 -0
  222. package/apps/web/dist/assets/changelog-BhMZS-rs.js +1 -0
  223. package/apps/web/dist/assets/circle-alert-C8Ma-bPY.js +1 -0
  224. package/apps/web/dist/assets/circle-check-Bu9Z3mlJ.js +1 -0
  225. package/apps/web/dist/assets/code-editor-CfTGqOpp.js +2 -0
  226. package/apps/web/dist/assets/{code-xml-TwKzzMtA.js → code-xml-B4kLFZSj.js} +1 -1
  227. package/apps/web/dist/assets/connection-sign-in-Cngd_QDO.js +1 -0
  228. package/apps/web/dist/assets/esm-Xwn4GtqG.js +7 -0
  229. package/apps/web/dist/assets/{eye-Brd-xPUJ.js → eye-BpoKpIdt.js} +1 -1
  230. package/apps/web/dist/assets/host-BrP-ENHg.css +1 -0
  231. package/apps/web/dist/assets/host-C0WQlRKB.js +118 -0
  232. package/apps/web/dist/assets/i18n-BJ7Ld6O6.js +55 -0
  233. package/apps/web/dist/assets/index-ClVtdDUZ.js +10 -0
  234. package/apps/web/dist/assets/index-D18DvnxX.css +1 -0
  235. package/apps/web/dist/assets/logo-BpnjXTRy.js +1 -0
  236. package/apps/web/dist/assets/oss-credits-IdX5bc71.js +1 -0
  237. package/apps/web/dist/assets/{phone-DhkHteoJ.js → phone-Ctvf-Am-.js} +1 -1
  238. package/apps/web/dist/assets/read-aloud-Da_RSm2S.js +1 -0
  239. package/apps/web/dist/assets/{runners-G-XYaDgR.js → runners-CyIvJIHr.js} +1 -1
  240. package/apps/web/dist/assets/scroll-text-ChrjRu9Y.js +1 -0
  241. package/apps/web/dist/assets/session-SXPtTWRK.js +2 -0
  242. package/apps/web/dist/assets/theme-BCau3f6O.js +11 -0
  243. package/apps/web/dist/assets/ui-Uqnx1UpK.js +82 -0
  244. package/apps/web/dist/assets/{upload-BYZTwJTD.js → upload-BchUnQGV.js} +1 -1
  245. package/apps/web/dist/assets/{useMutation-D0QP_k2-.js → useMutation-DEkZhp5c.js} +1 -1
  246. package/apps/web/dist/assets/{volume-2-CVHoxdGM.js → volume-2-CU_oy81Z.js} +1 -1
  247. package/apps/web/dist/assets/with-selector-CoMyWBAX.js +1 -0
  248. package/apps/web/dist/index.html +17 -10
  249. package/apps/web/dist/mcp/flow.html +119 -64
  250. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +20 -10
  251. package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +6 -1
  252. package/node_modules/@engenty/wizards-shared/dist/assistant.js +6 -1
  253. package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +236 -2
  254. package/node_modules/@engenty/wizards-shared/dist/connectors.js +52 -2
  255. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +150 -8
  256. package/node_modules/@engenty/wizards-shared/dist/definition.js +46 -11
  257. package/node_modules/@engenty/wizards-shared/dist/discover.d.ts +21 -0
  258. package/node_modules/@engenty/wizards-shared/dist/discover.js +1 -0
  259. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +26 -2
  260. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +26 -2
  261. package/node_modules/@engenty/wizards-shared/dist/fit.js +1 -1
  262. package/node_modules/@engenty/wizards-shared/dist/json-schema.d.ts +1 -1
  263. package/node_modules/@engenty/wizards-shared/dist/json-schema.js +1 -1
  264. package/node_modules/@engenty/wizards-shared/dist/live.d.ts +2 -2
  265. package/node_modules/@engenty/wizards-shared/dist/live.js +1 -1
  266. package/node_modules/@engenty/wizards-shared/dist/marketplace.js +3 -1
  267. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +54 -6
  268. package/node_modules/@engenty/wizards-shared/dist/run.js +85 -0
  269. package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +15 -1
  270. package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +14 -0
  271. package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +42 -0
  272. package/node_modules/@engenty/wizards-shared/dist/rwx.js +29 -0
  273. package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +1 -1
  274. package/node_modules/@engenty/wizards-shared/dist/space-data.d.ts +2 -2
  275. package/node_modules/@engenty/wizards-shared/dist/{projects.d.ts → spaces.d.ts} +39 -15
  276. package/node_modules/@engenty/wizards-shared/dist/{projects.js → spaces.js} +16 -9
  277. package/node_modules/@engenty/wizards-shared/dist/store.d.ts +7 -2
  278. package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +35 -4
  279. package/node_modules/@engenty/wizards-shared/dist/surface.js +121 -3
  280. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +1 -1
  281. package/node_modules/@engenty/wizards-shared/dist/theme-look.js +1 -1
  282. package/node_modules/@engenty/wizards-shared/dist/wizard-package.d.ts +2 -2
  283. package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +3 -3
  284. package/package.json +4 -1
  285. package/plugin/.claude-plugin/plugin.json +1 -1
  286. package/plugin/plugin.json +1 -1
  287. package/plugin/skills/build-wizard/SKILL.md +1 -1
  288. package/apps/runtime/dist/services/projects.js +0 -473
  289. package/apps/web/dist/assets/AboutDialog-B-JxkELB.js +0 -1
  290. package/apps/web/dist/assets/EditorPage-DQ_2FOzI.js +0 -3
  291. package/apps/web/dist/assets/Marketplace-DoH4YO3D.js +0 -2
  292. package/apps/web/dist/assets/NewWizardChannels-Tgoexgj4.js +0 -1
  293. package/apps/web/dist/assets/NewWizardPage-B24AF482.js +0 -7
  294. package/apps/web/dist/assets/OnboardingPage-BEvq4slJ.js +0 -1
  295. package/apps/web/dist/assets/PreviewPane-B_v7Y8R7.js +0 -10
  296. package/apps/web/dist/assets/ProjectPage-ClRuhFJo.js +0 -10
  297. package/apps/web/dist/assets/PublicRunner-MicrpVsv.js +0 -1
  298. package/apps/web/dist/assets/ReadOnly-BXjv-MSv.js +0 -1
  299. package/apps/web/dist/assets/SettingsPage-DY8O1r43.js +0 -2
  300. package/apps/web/dist/assets/SetupPage-BOVkVpMu.js +0 -1
  301. package/apps/web/dist/assets/SharePage-DXGzJSnR.js +0 -1
  302. package/apps/web/dist/assets/SkillEditor-BzzTDeaU.js +0 -1
  303. package/apps/web/dist/assets/changelog-BLdS-0Bj.js +0 -1
  304. package/apps/web/dist/assets/esm-BdxDT9Km.js +0 -7
  305. package/apps/web/dist/assets/i18n-8-Sw11tB.js +0 -55
  306. package/apps/web/dist/assets/index-OsdQFHmh.js +0 -49
  307. package/apps/web/dist/assets/index-QPipX5Fi.css +0 -1
  308. package/apps/web/dist/assets/lock-C0uxcOlq.js +0 -1
  309. package/apps/web/dist/assets/logo-CGNoptDg.js +0 -1
  310. package/apps/web/dist/assets/oss-credits-DpRWUPjD.js +0 -1
  311. package/apps/web/dist/assets/session-BWI-KENJ.js +0 -2
  312. package/apps/web/dist/assets/theme-D7krsx0_.js +0 -11
  313. package/apps/web/dist/assets/ui-DSXG3f49.js +0 -83
@@ -5,7 +5,7 @@ import { getBlob, hasBlob, putBlobOf } from "../files/blobs.js";
5
5
  import { managed, tenantInfo } from "../manage.js";
6
6
  import { currentRole, isAdminRole, MEMBERS_EDIT_ONLY, mayBuild } from "../services/access.js";
7
7
  import { ServiceError } from "../services/errors.js";
8
- import { projectLimit } from "../services/projects.js";
8
+ import { spaceLimit } from "../services/spaces.js";
9
9
  import { publishWizard, rotateShareLink, shareUrl } from "../services/wizards.js";
10
10
  import { codeOf } from "../tenants/control.js";
11
11
  import { currentTenant } from "../tenants/tenant.js";
@@ -28,19 +28,19 @@ function requireSchema(theirs) {
28
28
  }
29
29
  /** The organization as an install meets it: its schema, its number of spaces, its spaces. */
30
30
  export async function syncOverview() {
31
- const spaces = await db.query.project.findMany({
32
- where: eq(schema.project.tenantId, currentTenant()),
31
+ const spaces = await db.query.space.findMany({
32
+ where: eq(schema.space.tenantId, currentTenant()),
33
33
  columns: { id: true, name: true, origin: true },
34
- orderBy: [schema.project.createdAt],
34
+ orderBy: [schema.space.createdAt],
35
35
  });
36
36
  const info = managed ? await tenantInfo(currentTenant()).catch(() => null) : null;
37
- const limit = await projectLimit();
37
+ const limit = await spaceLimit();
38
38
  return {
39
39
  tenantId: currentTenant(),
40
40
  schema: tenantSchemaVersion,
41
41
  role: currentRole(),
42
42
  limits: {
43
- projects: info?.limits.projects === null || !Number.isFinite(limit) ? null : limit,
43
+ spaces: info?.limits.projects === null || !Number.isFinite(limit) ? null : limit,
44
44
  },
45
45
  spaces: await Promise.all(spaces.map(async (s) => ({ id: s.id, name: s.name, seq: await spaceSeq(s.id) }))),
46
46
  };
@@ -49,9 +49,9 @@ export async function syncOverview() {
49
49
  * What changed in a space after `since`. From 0 it is every item of the space, a page at a
50
50
  * time (`cursor`); `next` then is the number the log stood at when the listing began.
51
51
  */
52
- export async function pullChanges(projectId, since, cursor) {
52
+ export async function pullChanges(spaceId, since, cursor) {
53
53
  if (since > 0) {
54
- const logged = await changedSince(projectId, since, PAGE);
54
+ const logged = await changedSince(spaceId, since, PAGE);
55
55
  const changes = [];
56
56
  for (const x of logged) {
57
57
  const def = KINDS[x.kind];
@@ -72,17 +72,17 @@ export async function pullChanges(projectId, since, cursor) {
72
72
  }
73
73
  const [offsetText, topText] = (cursor ?? "").split(".");
74
74
  const offset = Number.parseInt(offsetText ?? "", 10) || 0;
75
- const top = cursor ? Number.parseInt(topText ?? "", 10) || 0 : await spaceSeq(projectId);
76
- const project = await db.query.project.findFirst({
77
- where: eq(schema.project.id, projectId),
75
+ const top = cursor ? Number.parseInt(topText ?? "", 10) || 0 : await spaceSeq(spaceId);
76
+ const space = await db.query.space.findFirst({
77
+ where: eq(schema.space.id, spaceId),
78
78
  columns: { tenantId: true },
79
79
  });
80
- if (!project || project.tenantId !== currentTenant()) {
80
+ if (!space || space.tenantId !== currentTenant()) {
81
81
  throw new ServiceError("not_found", note("syncSpaceNotInCloud"));
82
82
  }
83
83
  const all = [];
84
84
  for (const kind of KIND_ORDER) {
85
- for (const item of await KINDS[kind].list(projectId)) {
85
+ for (const item of await KINDS[kind].list(spaceId)) {
86
86
  all.push({ kind, item });
87
87
  }
88
88
  }
@@ -119,9 +119,9 @@ function mayChange(x, exists) {
119
119
  async function requireRoomForSpace() {
120
120
  const [{ n }] = await db
121
121
  .select({ n: count() })
122
- .from(schema.project)
123
- .where(eq(schema.project.tenantId, currentTenant()));
124
- const limit = await projectLimit();
122
+ .from(schema.space)
123
+ .where(eq(schema.space.tenantId, currentTenant()));
124
+ const limit = await spaceLimit();
125
125
  if (n >= limit) {
126
126
  throw new ServiceError("refused", limit === 1 ? note("onlyOneSpaceAllowed") : note("mostSpaces", { count: limit }), { reason: "space_limit", limit });
127
127
  }
@@ -138,20 +138,20 @@ const refused = (x, reason, message) => ({
138
138
  * not changed after the one the install changed (`base`); else the answer is the cloud's
139
139
  * version, to merge with. What is taken is written in one transaction, and gets its number.
140
140
  */
141
- export async function pushChanges(projectId, input) {
141
+ export async function pushChanges(spaceId, input) {
142
142
  requireSchema(input.schema);
143
143
  if (!(await mayBuild())) {
144
144
  throw new ServiceError("read_only", note("wizardsRunOncePublished"), { reason: "read_only" });
145
145
  }
146
- const project = await db.query.project.findFirst({
147
- where: eq(schema.project.id, projectId),
146
+ const space = await db.query.space.findFirst({
147
+ where: eq(schema.space.id, spaceId),
148
148
  columns: { tenantId: true },
149
149
  });
150
- if (project && project.tenantId !== currentTenant()) {
150
+ if (space && space.tenantId !== currentTenant()) {
151
151
  throw new ServiceError("refused", note("spaceIdAlreadyExists"), { reason: "id_taken" });
152
152
  }
153
- const makesSpace = input.items.some((x) => x.kind === "space" && x.item === projectId && x.record !== null);
154
- if (!project && !makesSpace) {
153
+ const makesSpace = input.items.some((x) => x.kind === "space" && x.item === spaceId && x.record !== null);
154
+ if (!space && !makesSpace) {
155
155
  throw new ServiceError("not_found", note("syncSpaceNotInCloud"), { reason: "not_found" });
156
156
  }
157
157
  const seqs = await lastSeqs(input.items);
@@ -165,11 +165,11 @@ export async function pushChanges(projectId, input) {
165
165
  results.push(refused(x, "not_synced", "This item does not sync."));
166
166
  continue;
167
167
  }
168
- if (current && current.projectId !== projectId) {
168
+ if (current && current.spaceId !== spaceId) {
169
169
  results.push(refused(x, "id_taken", "In the cloud this belongs to another space."));
170
170
  continue;
171
171
  }
172
- if (x.record && x.kind !== "space" && x.record.projectId !== projectId) {
172
+ if (x.record && x.kind !== "space" && x.record.spaceId !== spaceId) {
173
173
  results.push(refused(x, "invalid", "The item names another space."));
174
174
  continue;
175
175
  }
@@ -213,7 +213,7 @@ export async function pushChanges(projectId, input) {
213
213
  continue;
214
214
  }
215
215
  }
216
- taking.push({ x, apply: { kind: x.kind, item: x.item, projectId, record: x.record } });
216
+ taking.push({ x, apply: { kind: x.kind, item: x.item, spaceId, record: x.record } });
217
217
  }
218
218
  const taken = await applyEach(taking.map((t) => t.apply));
219
219
  const after = await lastSeqs(taking.map((t) => t.x));
@@ -228,8 +228,8 @@ export async function pushChanges(projectId, input) {
228
228
  seq: after.get(seqKey(x.kind, x.item)) ?? 0,
229
229
  });
230
230
  }
231
- await compactLog(projectId);
232
- return { results, seq: await spaceSeq(projectId) };
231
+ await compactLog(spaceId);
232
+ return { results, seq: await spaceSeq(spaceId) };
233
233
  }
234
234
  /**
235
235
  * Writes the batch in one transaction; when it fails, item by item, so one bad item does not
@@ -266,18 +266,18 @@ export async function missingBlobs(hashes) {
266
266
  export const takeBlob = putBlobOf;
267
267
  export const blobBytes = getBlob;
268
268
  // --- publishing and links ------------------------------------------------------------------
269
- async function wizardInSpace(projectId, wizardId) {
269
+ async function wizardInSpace(spaceId, wizardId) {
270
270
  const w = await db.query.wizard.findFirst({
271
271
  where: eq(schema.wizard.id, wizardId),
272
- columns: { projectId: true, tenantId: true },
272
+ columns: { spaceId: true, tenantId: true },
273
273
  });
274
- if (!w || w.projectId !== projectId || w.tenantId !== currentTenant()) {
274
+ if (!w || w.spaceId !== spaceId || w.tenantId !== currentTenant()) {
275
275
  throw new ServiceError("not_found", note("syncSpaceNotInCloud"));
276
276
  }
277
277
  }
278
278
  /** Publishes the cloud's draft of a wizard, which the install pushed before it asked. */
279
- export async function publishSynced(userId, projectId, wizardId) {
280
- await wizardInSpace(projectId, wizardId);
279
+ export async function publishSynced(userId, spaceId, wizardId) {
280
+ await wizardInSpace(spaceId, wizardId);
281
281
  const published = await publishWizard(userId, wizardId);
282
282
  const w = await db.query.wizard.findFirst({ where: eq(schema.wizard.id, wizardId) });
283
283
  if (!w) {
@@ -294,8 +294,8 @@ export async function publishSynced(userId, projectId, wizardId) {
294
294
  };
295
295
  }
296
296
  /** A new link for the cloud's copy of a wizard; the old one stops answering. */
297
- export async function rotateSynced(userId, projectId, wizardId) {
298
- await wizardInSpace(projectId, wizardId);
297
+ export async function rotateSynced(userId, spaceId, wizardId) {
298
+ await wizardInSpace(spaceId, wizardId);
299
299
  const { shareToken } = await rotateShareLink(userId, wizardId);
300
300
  return { shareUrl: shareUrl(shareToken), code: await codeOf(shareToken) };
301
301
  }
@@ -303,22 +303,22 @@ export async function rotateSynced(userId, projectId, wizardId) {
303
303
  * A space a local install synced one way (`origin = "local"`) becomes a space of the cloud's
304
304
  * own, which the studio here edits: from now on it syncs both ways.
305
305
  */
306
- export async function adoptSpace(projectId) {
306
+ export async function adoptSpace(spaceId) {
307
307
  if (managed && !isAdminRole(currentRole())) {
308
308
  throw new ServiceError("forbidden", MEMBERS_EDIT_ONLY);
309
309
  }
310
- const project = await db.query.project.findFirst({
311
- where: eq(schema.project.id, projectId),
310
+ const space = await db.query.space.findFirst({
311
+ where: eq(schema.space.id, spaceId),
312
312
  columns: { tenantId: true, origin: true },
313
313
  });
314
- if (!project || project.tenantId !== currentTenant()) {
314
+ if (!space || space.tenantId !== currentTenant()) {
315
315
  return { adopted: false };
316
316
  }
317
- if (project.origin === "local") {
317
+ if (space.origin === "local") {
318
318
  await db
319
- .update(schema.project)
319
+ .update(schema.space)
320
320
  .set({ origin: null, syncedAt: new Date() })
321
- .where(eq(schema.project.id, projectId));
321
+ .where(eq(schema.space.id, spaceId));
322
322
  }
323
323
  return { adopted: true };
324
324
  }
@@ -22,45 +22,45 @@ export async function lastSeqs(items) {
22
22
  }
23
23
  export const seqKey = (kind, item) => `${kind}|${item}`;
24
24
  /** The last number of the space's log; 0 when nothing of it changed yet. */
25
- export async function spaceSeq(projectId) {
25
+ export async function spaceSeq(spaceId) {
26
26
  const [row] = await db
27
27
  .select({ seq: max(schema.syncChange.seq) })
28
28
  .from(schema.syncChange)
29
- .where(eq(schema.syncChange.projectId, projectId));
29
+ .where(eq(schema.syncChange.spaceId, spaceId));
30
30
  return row?.seq ?? 0;
31
31
  }
32
32
  /** The items of a space that changed after `since`, by their last change, oldest first. */
33
- export async function changedSince(projectId, since, limit) {
33
+ export async function changedSince(spaceId, since, limit) {
34
34
  const seq = max(schema.syncChange.seq);
35
35
  const rows = await db
36
36
  .select({ kind: schema.syncChange.kind, item: schema.syncChange.item, seq })
37
37
  .from(schema.syncChange)
38
- .where(and(eq(schema.syncChange.projectId, projectId), gt(schema.syncChange.seq, since)))
38
+ .where(and(eq(schema.syncChange.spaceId, spaceId), gt(schema.syncChange.seq, since)))
39
39
  .groupBy(schema.syncChange.kind, schema.syncChange.item)
40
40
  .orderBy(seq)
41
41
  .limit(limit);
42
42
  return rows.map((r) => ({
43
43
  kind: r.kind,
44
44
  item: r.item,
45
- projectId,
45
+ spaceId,
46
46
  seq: r.seq ?? 0,
47
47
  }));
48
48
  }
49
49
  /** Keeps only each item's last change: what a pull or a push needs. */
50
- export async function compactLog(projectId) {
51
- await db.run(projectId
52
- ? sql `DELETE FROM sync_change WHERE project_id = ${projectId} AND seq NOT IN (SELECT MAX(seq) FROM sync_change WHERE project_id = ${projectId} GROUP BY kind, item)`
50
+ export async function compactLog(spaceId) {
51
+ await db.run(spaceId
52
+ ? sql `DELETE FROM sync_change WHERE space_id = ${spaceId} AND seq NOT IN (SELECT MAX(seq) FROM sync_change WHERE space_id = ${spaceId} GROUP BY kind, item)`
53
53
  : sql `DELETE FROM sync_change WHERE seq NOT IN (SELECT MAX(seq) FROM sync_change GROUP BY kind, item)`);
54
54
  }
55
55
  /** Drops what was pushed: changes of the space up to `seq`. */
56
- export async function dropPushed(projectId, seq) {
56
+ export async function dropPushed(spaceId, seq) {
57
57
  await db
58
58
  .delete(schema.syncChange)
59
- .where(and(eq(schema.syncChange.projectId, projectId), sql `${schema.syncChange.seq} <= ${seq}`));
59
+ .where(and(eq(schema.syncChange.spaceId, spaceId), sql `${schema.syncChange.seq} <= ${seq}`));
60
60
  }
61
61
  /** Notes an item as changed here, though no write did: a version kept by the person's choice. */
62
- export async function notePending(projectId, kind, item) {
63
- await db.insert(schema.syncChange).values({ projectId, kind, item });
62
+ export async function notePending(spaceId, kind, item) {
63
+ await db.insert(schema.syncChange).values({ spaceId, kind, item });
64
64
  }
65
65
  /** Runs `fn` with the triggers quiet: what it writes is not noted as a change of this side. */
66
66
  export async function quietly(fn) {