@engenty/wizards-runtime 0.12.2 → 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 (328) 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 +126 -71
  5. package/apps/runtime/dist/agents/website.js +1 -1
  6. package/apps/runtime/dist/app.js +28 -3
  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/credits/estimate.js +3 -3
  29. package/apps/runtime/dist/db/adopt.js +3 -3
  30. package/apps/runtime/dist/db/client.js +9 -0
  31. package/apps/runtime/dist/db/live-triggers.js +65 -23
  32. package/apps/runtime/dist/db/migrations/tenant/0027_work_chats.sql +52 -0
  33. package/apps/runtime/dist/db/migrations/tenant/0028_chat_approvals.sql +17 -0
  34. package/apps/runtime/dist/db/migrations/tenant/0029_work_chats_live.sql +49 -0
  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 +59 -6
  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/models.md +105 -30
  84. package/apps/runtime/dist/docs/user-guide/protocol.md +80 -0
  85. package/apps/runtime/dist/docs/user-guide/skills.md +8 -4
  86. package/apps/runtime/dist/docs/user-guide/space.md +5 -4
  87. package/apps/runtime/dist/docs/user-guide/together.md +29 -2
  88. package/apps/runtime/dist/docs/user-guide/troubleshooting.md +2 -2
  89. package/apps/runtime/dist/docs/user-guide/work-mode.md +128 -0
  90. package/apps/runtime/dist/engenty/connections-external/build-connector.js +2 -5
  91. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +72 -0
  92. package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +1 -1
  93. package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +3 -2
  94. package/apps/runtime/dist/engenty/connections-sdk/types.js +2 -0
  95. package/apps/runtime/dist/engenty/connections-slack/connector.js +2 -1
  96. package/apps/runtime/dist/engine/decide.js +1 -1
  97. package/apps/runtime/dist/engine/requirements.js +139 -11
  98. package/apps/runtime/dist/engine/resources.js +43 -12
  99. package/apps/runtime/dist/engine/runner.js +121 -27
  100. package/apps/runtime/dist/engine/steps.js +42 -16
  101. package/apps/runtime/dist/engine/template.js +35 -1
  102. package/apps/runtime/dist/env.js +9 -4
  103. package/apps/runtime/dist/index.js +18 -2
  104. package/apps/runtime/dist/link-preview.js +9 -0
  105. package/apps/runtime/dist/live/feed.js +2 -2
  106. package/apps/runtime/dist/live/origin.js +2 -2
  107. package/apps/runtime/dist/live/views.js +51 -26
  108. package/apps/runtime/dist/manage.js +32 -0
  109. package/apps/runtime/dist/mcp/flow-app.js +1 -1
  110. package/apps/runtime/dist/mcp/handler.js +55 -1
  111. package/apps/runtime/dist/mcp/seen.js +47 -0
  112. package/apps/runtime/dist/mcp/tools.js +75 -34
  113. package/apps/runtime/dist/models.js +203 -12
  114. package/apps/runtime/dist/motion-graphics/project.js +8 -8
  115. package/apps/runtime/dist/motion-graphics/step.js +2 -2
  116. package/apps/runtime/dist/motion-graphics/tools.js +1 -1
  117. package/apps/runtime/dist/plugins/events.js +2 -2
  118. package/apps/runtime/dist/plugins/jobs.js +4 -1
  119. package/apps/runtime/dist/plugins/loader.js +2 -2
  120. package/apps/runtime/dist/prompts/architect.md +3 -3
  121. package/apps/runtime/dist/prompts/authoring.md +46 -12
  122. package/apps/runtime/dist/prompts/goose.md +14 -13
  123. package/apps/runtime/dist/prompts/mcp.md +6 -6
  124. package/apps/runtime/dist/prompts/safety.md +18 -0
  125. package/apps/runtime/dist/prompts/services.md +4 -4
  126. package/apps/runtime/dist/prompts/step.md +3 -3
  127. package/apps/runtime/dist/prompts/tools.md +39 -10
  128. package/apps/runtime/dist/routes/api.js +31 -20
  129. package/apps/runtime/dist/routes/broker.js +316 -0
  130. package/apps/runtime/dist/routes/connections.js +71 -0
  131. package/apps/runtime/dist/routes/delivery.js +25 -0
  132. package/apps/runtime/dist/routes/discover.js +17 -0
  133. package/apps/runtime/dist/routes/live.js +11 -1
  134. package/apps/runtime/dist/routes/marketplace.js +3 -3
  135. package/apps/runtime/dist/routes/person.js +4 -1
  136. package/apps/runtime/dist/routes/plugins.js +3 -1
  137. package/apps/runtime/dist/routes/rules.js +26 -0
  138. package/apps/runtime/dist/routes/runs.js +59 -33
  139. package/apps/runtime/dist/routes/skills.js +6 -6
  140. package/apps/runtime/dist/routes/studio.js +256 -148
  141. package/apps/runtime/dist/routes/work.js +199 -0
  142. package/apps/runtime/dist/safety.js +60 -18
  143. package/apps/runtime/dist/sandbox/index.js +27 -0
  144. package/apps/runtime/dist/services/access.js +38 -17
  145. package/apps/runtime/dist/services/api.js +38 -13
  146. package/apps/runtime/dist/services/architect.js +3 -3
  147. package/apps/runtime/dist/services/assistant-chats.js +9 -1
  148. package/apps/runtime/dist/services/brand.js +12 -12
  149. package/apps/runtime/dist/services/broker-bell.js +69 -0
  150. package/apps/runtime/dist/services/broker-notify.js +127 -0
  151. package/apps/runtime/dist/services/client-steps.js +79 -0
  152. package/apps/runtime/dist/services/cloud.js +42 -42
  153. package/apps/runtime/dist/services/command-risk.js +51 -0
  154. package/apps/runtime/dist/services/discover.js +85 -0
  155. package/apps/runtime/dist/services/knowledge-model.js +13 -13
  156. package/apps/runtime/dist/services/knowledge.js +117 -80
  157. package/apps/runtime/dist/services/manage-reports.js +77 -7
  158. package/apps/runtime/dist/services/marketplace.js +7 -31
  159. package/apps/runtime/dist/services/members-studio.js +165 -0
  160. package/apps/runtime/dist/services/onboarding.js +22 -22
  161. package/apps/runtime/dist/services/package-file.js +1 -1
  162. package/apps/runtime/dist/services/package.js +22 -22
  163. package/apps/runtime/dist/services/pages.js +13 -9
  164. package/apps/runtime/dist/services/runs.js +4 -3
  165. package/apps/runtime/dist/services/seen.js +55 -0
  166. package/apps/runtime/dist/services/shares.js +28 -13
  167. package/apps/runtime/dist/services/site.js +23 -23
  168. package/apps/runtime/dist/services/skills-registry.js +15 -15
  169. package/apps/runtime/dist/services/skills.js +44 -44
  170. package/apps/runtime/dist/services/space-categories.js +35 -35
  171. package/apps/runtime/dist/services/space-data.js +130 -111
  172. package/apps/runtime/dist/services/{project-files.js → space-files.js} +84 -75
  173. package/apps/runtime/dist/services/{project-index.js → space-index.js} +116 -73
  174. package/apps/runtime/dist/services/space-origin.js +19 -11
  175. package/apps/runtime/dist/services/spaces.js +478 -598
  176. package/apps/runtime/dist/services/synced-spaces.js +668 -0
  177. package/apps/runtime/dist/services/themes.js +15 -15
  178. package/apps/runtime/dist/services/widgets.js +6 -6
  179. package/apps/runtime/dist/services/wizards.js +112 -38
  180. package/apps/runtime/dist/services/work-ai.js +257 -0
  181. package/apps/runtime/dist/services/work-approvals.js +104 -0
  182. package/apps/runtime/dist/services/work-chats.js +908 -0
  183. package/apps/runtime/dist/services/work-connections.js +90 -0
  184. package/apps/runtime/dist/services/work-files.js +85 -0
  185. package/apps/runtime/dist/services/work-mastra.js +73 -0
  186. package/apps/runtime/dist/services/work-sandbox.js +42 -0
  187. package/apps/runtime/dist/sharing/files.js +14 -4
  188. package/apps/runtime/dist/sharing/index.js +40 -39
  189. package/apps/runtime/dist/sharing/jobs.js +67 -17
  190. package/apps/runtime/dist/sharing/targets/connector.js +10 -6
  191. package/apps/runtime/dist/sharing/targets/email.js +10 -8
  192. package/apps/runtime/dist/sharing/targets/slack.js +10 -8
  193. package/apps/runtime/dist/sharing/targets/storage.js +6 -4
  194. package/apps/runtime/dist/store/index.js +14 -3
  195. package/apps/runtime/dist/store/shared-lists.js +4 -2
  196. package/apps/runtime/dist/sync/apply.js +2 -2
  197. package/apps/runtime/dist/sync/client.js +113 -113
  198. package/apps/runtime/dist/sync/hub.js +41 -41
  199. package/apps/runtime/dist/sync/log.js +12 -12
  200. package/apps/runtime/dist/sync/records.js +118 -120
  201. package/apps/runtime/dist/texts.js +44 -2
  202. package/apps/runtime/dist/tools/connections.js +112 -0
  203. package/apps/runtime/dist/tools/connector.js +157 -67
  204. package/apps/runtime/dist/tools/index.js +31 -15
  205. package/apps/runtime/dist/tools/mail.js +40 -11
  206. package/apps/runtime/dist/tools/pages.js +11 -5
  207. package/apps/runtime/dist/tools/plugin.js +43 -7
  208. package/apps/runtime/dist/tools/skills.js +1 -1
  209. package/apps/runtime/dist/tools/{project.js → space.js} +30 -25
  210. package/apps/runtime/dist/tools/store.js +3 -2
  211. package/apps/runtime/dist/widgets/step.js +10 -10
  212. package/apps/web/dist/assets/AboutDialog-DgfeipUc.js +1 -0
  213. package/apps/web/dist/assets/CapabilitiesPage-BoYJvgIu.js +2 -0
  214. package/apps/web/dist/assets/{ChangelogDialog-CKLgFL6r.js → ChangelogDialog-Duab4zTO.js} +1 -1
  215. package/apps/web/dist/assets/{CodeEditor-B3nto_26.js → CodeEditor-nxoOt8ge.js} +1 -1
  216. package/apps/web/dist/assets/EditorPage-ZrgGpYMC.js +3 -0
  217. package/apps/web/dist/assets/{FlowPreview-zJCtixSi.js → FlowPreview-aMfwcPul.js} +1 -1
  218. package/apps/web/dist/assets/LangSwitch-DpD0inR4.js +1 -0
  219. package/apps/web/dist/assets/Marketplace-CpzD9pNQ.js +2 -0
  220. package/apps/web/dist/assets/NewWizardChannels-IB18afWN.js +1 -0
  221. package/apps/web/dist/assets/NewWizardPage-rYbcmPGG.js +7 -0
  222. package/apps/web/dist/assets/OnboardingPage-ztHT01ah.js +1 -0
  223. package/apps/web/dist/assets/PreviewPane-DviWTLfi.js +9 -0
  224. package/apps/web/dist/assets/PublicRunner-C2geZhhM.js +1 -0
  225. package/apps/web/dist/assets/ReadOnly-kSb_Kbdm.js +1 -0
  226. package/apps/web/dist/assets/SettingsPage-DM2h8N0J.js +2 -0
  227. package/apps/web/dist/assets/SetupPage-Wfyz6xH4.js +1 -0
  228. package/apps/web/dist/assets/SharePage-CyWQorWB.js +1 -0
  229. package/apps/web/dist/assets/SkillEditor-CqQMg2MC.js +1 -0
  230. package/apps/web/dist/assets/Skills-CnhpgoOA.js +9 -0
  231. package/apps/web/dist/assets/SpacePage-q4Bk3N7k.js +2 -0
  232. package/apps/web/dist/assets/UpdateCheck-C2CE6CC3.js +2 -0
  233. package/apps/web/dist/assets/changelog-B6hN1Cp7.js +1 -0
  234. package/apps/web/dist/assets/circle-alert-C8Ma-bPY.js +1 -0
  235. package/apps/web/dist/assets/circle-check-Bu9Z3mlJ.js +1 -0
  236. package/apps/web/dist/assets/code-editor-CfTGqOpp.js +2 -0
  237. package/apps/web/dist/assets/{code-xml-Hx7YxCg0.js → code-xml-B4kLFZSj.js} +1 -1
  238. package/apps/web/dist/assets/connection-sign-in-CIiv0t2p.js +1 -0
  239. package/apps/web/dist/assets/esm-Xwn4GtqG.js +7 -0
  240. package/apps/web/dist/assets/{eye-BkMFLnYu.js → eye-BpoKpIdt.js} +1 -1
  241. package/apps/web/dist/assets/host-BrP-ENHg.css +1 -0
  242. package/apps/web/dist/assets/host-DJ7-p0Sc.js +118 -0
  243. package/apps/web/dist/assets/i18n-BJ7Ld6O6.js +55 -0
  244. package/apps/web/dist/assets/index-D18DvnxX.css +1 -0
  245. package/apps/web/dist/assets/index-D2akynS-.js +10 -0
  246. package/apps/web/dist/assets/logo-BpnjXTRy.js +1 -0
  247. package/apps/web/dist/assets/oss-credits-IdX5bc71.js +1 -0
  248. package/apps/web/dist/assets/{phone-DMfwuh9V.js → phone-Ctvf-Am-.js} +1 -1
  249. package/apps/web/dist/assets/read-aloud-Da_RSm2S.js +1 -0
  250. package/apps/web/dist/assets/{runners-D5qz6b_s.js → runners-CyIvJIHr.js} +1 -1
  251. package/apps/web/dist/assets/scroll-text-ChrjRu9Y.js +1 -0
  252. package/apps/web/dist/assets/session-SXPtTWRK.js +2 -0
  253. package/apps/web/dist/assets/theme-CbTcTFWy.js +11 -0
  254. package/apps/web/dist/assets/ui-Uqnx1UpK.js +82 -0
  255. package/apps/web/dist/assets/{upload-DQJwLSGj.js → upload-BchUnQGV.js} +1 -1
  256. package/apps/web/dist/assets/{useMutation-C20c2EH3.js → useMutation-DEkZhp5c.js} +1 -1
  257. package/apps/web/dist/assets/{volume-2-CC5qamYT.js → volume-2-CU_oy81Z.js} +1 -1
  258. package/apps/web/dist/assets/with-selector-CoMyWBAX.js +1 -0
  259. package/apps/web/dist/index.html +17 -10
  260. package/apps/web/dist/mcp/flow.html +119 -64
  261. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +20 -10
  262. package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +7 -1
  263. package/node_modules/@engenty/wizards-shared/dist/assistant.js +11 -1
  264. package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +236 -2
  265. package/node_modules/@engenty/wizards-shared/dist/connectors.js +52 -2
  266. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +257 -8
  267. package/node_modules/@engenty/wizards-shared/dist/definition.js +113 -15
  268. package/node_modules/@engenty/wizards-shared/dist/discover.d.ts +21 -0
  269. package/node_modules/@engenty/wizards-shared/dist/discover.js +1 -0
  270. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +38 -2
  271. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +38 -2
  272. package/node_modules/@engenty/wizards-shared/dist/fit.js +1 -1
  273. package/node_modules/@engenty/wizards-shared/dist/json-schema.d.ts +1 -1
  274. package/node_modules/@engenty/wizards-shared/dist/json-schema.js +1 -1
  275. package/node_modules/@engenty/wizards-shared/dist/live.d.ts +2 -2
  276. package/node_modules/@engenty/wizards-shared/dist/live.js +1 -1
  277. package/node_modules/@engenty/wizards-shared/dist/marketplace.d.ts +0 -5
  278. package/node_modules/@engenty/wizards-shared/dist/marketplace.js +3 -1
  279. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +115 -6
  280. package/node_modules/@engenty/wizards-shared/dist/run.js +135 -0
  281. package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +15 -1
  282. package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +14 -0
  283. package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +42 -0
  284. package/node_modules/@engenty/wizards-shared/dist/rwx.js +29 -0
  285. package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +1 -1
  286. package/node_modules/@engenty/wizards-shared/dist/space-data.d.ts +2 -2
  287. package/node_modules/@engenty/wizards-shared/dist/{projects.d.ts → spaces.d.ts} +39 -15
  288. package/node_modules/@engenty/wizards-shared/dist/{projects.js → spaces.js} +16 -9
  289. package/node_modules/@engenty/wizards-shared/dist/store.d.ts +7 -2
  290. package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +35 -4
  291. package/node_modules/@engenty/wizards-shared/dist/surface.js +121 -3
  292. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +1 -1
  293. package/node_modules/@engenty/wizards-shared/dist/theme-look.js +1 -1
  294. package/node_modules/@engenty/wizards-shared/dist/tiers.d.ts +195 -0
  295. package/node_modules/@engenty/wizards-shared/dist/tiers.js +98 -0
  296. package/node_modules/@engenty/wizards-shared/dist/wizard-package.d.ts +2 -2
  297. package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +3 -3
  298. package/package.json +4 -1
  299. package/plugin/.claude-plugin/plugin.json +1 -1
  300. package/plugin/plugin.json +1 -1
  301. package/plugin/skills/build-wizard/SKILL.md +1 -1
  302. package/apps/runtime/dist/services/projects.js +0 -473
  303. package/apps/web/dist/assets/AboutDialog-CLgnoYTI.js +0 -1
  304. package/apps/web/dist/assets/EditorPage-D9JDdAAI.js +0 -3
  305. package/apps/web/dist/assets/Marketplace-D4e0Oac9.js +0 -2
  306. package/apps/web/dist/assets/NewWizardChannels-B4N7GIYh.js +0 -1
  307. package/apps/web/dist/assets/NewWizardPage-Dpt0Mzk8.js +0 -7
  308. package/apps/web/dist/assets/OnboardingPage-CDoYVjRC.js +0 -1
  309. package/apps/web/dist/assets/PreviewPane-DPB5nEd5.js +0 -10
  310. package/apps/web/dist/assets/ProjectPage-408YOoNa.js +0 -10
  311. package/apps/web/dist/assets/PublicRunner-BZ66xdRX.js +0 -1
  312. package/apps/web/dist/assets/ReadOnly-C9oGMkUB.js +0 -1
  313. package/apps/web/dist/assets/SettingsPage-Dq3AZwJS.js +0 -2
  314. package/apps/web/dist/assets/SetupPage-CP3lbyZc.js +0 -1
  315. package/apps/web/dist/assets/SharePage-DdMm1Y8K.js +0 -1
  316. package/apps/web/dist/assets/SkillEditor-b5NMFB90.js +0 -1
  317. package/apps/web/dist/assets/changelog-82-DHogQ.js +0 -1
  318. package/apps/web/dist/assets/esm-BdxDT9Km.js +0 -7
  319. package/apps/web/dist/assets/i18n-CKKh3Pn0.js +0 -55
  320. package/apps/web/dist/assets/index-Cy2NHzAx.js +0 -49
  321. package/apps/web/dist/assets/index-wR_-1hfN.css +0 -1
  322. package/apps/web/dist/assets/lock-CGXM95Mi.js +0 -1
  323. package/apps/web/dist/assets/logo-CGNoptDg.js +0 -1
  324. package/apps/web/dist/assets/oss-credits-DpRWUPjD.js +0 -1
  325. package/apps/web/dist/assets/session-DRy0k0nh.js +0 -2
  326. package/apps/web/dist/assets/theme-DNPm6r4e.js +0 -11
  327. package/apps/web/dist/assets/ui-CwFQAfE-.js +0 -83
  328. /package/apps/runtime/dist/db/migrations/tenant/{0027_space_skill.sql → 0030_space_skill.sql} +0 -0
@@ -2,16 +2,16 @@
2
2
  * The triggers that fill `live_change` (docs/plans/live-changes.md, 1). One entry per table
3
3
  * names the item a write changes; `pnpm --filter @engenty/wizards-runtime exec tsx
4
4
  * scripts/live-triggers.ts` prints the SQL that migration 0023 carries, or with a table's name
5
- * that table's alone (0026). Unlike the two-way sync's triggers (0022) they have no guard, since
5
+ * that table's alone (0026); 0031 carries all of them, under the space's names. Unlike the two-way sync's triggers (0022) they have no guard, since
6
6
  * a pulled write is a change on this side's screen too, and they count wizard-owned pages and
7
7
  * tables, which the studio shows as shared lists.
8
8
  */
9
- const ofWizard = "(SELECT project_id FROM wizard WHERE id = $.wizard_id)";
9
+ const ofWizard = "(SELECT space_id FROM wizard WHERE id = $.wizard_id)";
10
10
  export const LIVE_TABLES = [
11
- { table: "project", project: "$.id", kind: "'space'", item: "$.id", parent: "NULL", owns: true },
11
+ { table: "space", space: "$.id", kind: "'space'", item: "$.id", parent: "NULL", owns: true },
12
12
  {
13
13
  table: "wizard",
14
- project: "$.project_id",
14
+ space: "$.space_id",
15
15
  kind: "'wizard'",
16
16
  item: "$.id",
17
17
  parent: "NULL",
@@ -19,7 +19,7 @@ export const LIVE_TABLES = [
19
19
  },
20
20
  {
21
21
  table: "wizard_file",
22
- project: ofWizard,
22
+ space: ofWizard,
23
23
  kind: "'wizard'",
24
24
  item: "$.wizard_id",
25
25
  parent: "NULL",
@@ -27,7 +27,7 @@ export const LIVE_TABLES = [
27
27
  },
28
28
  {
29
29
  table: "wizard_translation",
30
- project: ofWizard,
30
+ space: ofWizard,
31
31
  kind: "'translation'",
32
32
  item: "$.wizard_id || ':' || $.lang",
33
33
  parent: "$.wizard_id",
@@ -35,7 +35,7 @@ export const LIVE_TABLES = [
35
35
  },
36
36
  {
37
37
  table: "wizard_message",
38
- project: ofWizard,
38
+ space: ofWizard,
39
39
  kind: "'message'",
40
40
  item: "$.id",
41
41
  parent: "$.wizard_id",
@@ -43,7 +43,7 @@ export const LIVE_TABLES = [
43
43
  },
44
44
  {
45
45
  table: "space_page",
46
- project: "$.project_id",
46
+ space: "$.space_id",
47
47
  kind: "'page'",
48
48
  item: "$.id",
49
49
  parent: "$.wizard_id",
@@ -51,7 +51,7 @@ export const LIVE_TABLES = [
51
51
  },
52
52
  {
53
53
  table: "space_table",
54
- project: "$.project_id",
54
+ space: "$.space_id",
55
55
  kind: "'table'",
56
56
  item: "$.id",
57
57
  parent: "$.wizard_id",
@@ -59,7 +59,7 @@ export const LIVE_TABLES = [
59
59
  },
60
60
  {
61
61
  table: "space_table_row",
62
- project: "(SELECT project_id FROM space_table WHERE id = $.table_id)",
62
+ space: "(SELECT space_id FROM space_table WHERE id = $.table_id)",
63
63
  kind: "'row'",
64
64
  item: "$.id",
65
65
  parent: "$.table_id",
@@ -67,7 +67,7 @@ export const LIVE_TABLES = [
67
67
  },
68
68
  {
69
69
  table: "space_category",
70
- project: "$.project_id",
70
+ space: "$.space_id",
71
71
  kind: "'category'",
72
72
  item: "$.id",
73
73
  parent: "NULL",
@@ -75,7 +75,7 @@ export const LIVE_TABLES = [
75
75
  },
76
76
  {
77
77
  table: "space_category_value",
78
- project: "(SELECT project_id FROM space_category WHERE id = $.category_id)",
78
+ space: "(SELECT space_id FROM space_category WHERE id = $.category_id)",
79
79
  kind: "'category'",
80
80
  item: "$.category_id",
81
81
  parent: "NULL",
@@ -83,32 +83,32 @@ export const LIVE_TABLES = [
83
83
  },
84
84
  {
85
85
  table: "space_item_category",
86
- project: "$.project_id",
86
+ space: "$.space_id",
87
87
  kind: "CASE WHEN $.page_id IS NOT NULL THEN 'page' WHEN $.row_id IS NOT NULL THEN 'row' WHEN $.table_id IS NOT NULL THEN 'table' ELSE 'file' END",
88
88
  item: "COALESCE($.page_id, $.row_id, $.table_id, $.file_id)",
89
89
  parent: "CASE WHEN $.row_id IS NOT NULL THEN (SELECT table_id FROM space_table_row WHERE id = $.row_id) END",
90
90
  owns: false,
91
91
  },
92
92
  {
93
- table: "project_file",
94
- project: "$.project_id",
93
+ table: "space_file",
94
+ space: "$.space_id",
95
95
  kind: "'file'",
96
96
  item: "$.id",
97
97
  parent: "NULL",
98
98
  owns: true,
99
99
  },
100
100
  {
101
- table: "project_connector",
102
- project: "$.project_id",
101
+ table: "space_connector",
102
+ space: "$.space_id",
103
103
  kind: "'connector'",
104
- item: "$.project_id || ':' || $.id",
104
+ item: "$.space_id || ':' || $.id",
105
105
  parent: "NULL",
106
106
  owns: true,
107
107
  },
108
- // Migration 0027.
108
+ // Migration 0030.
109
109
  {
110
110
  table: "space_skill",
111
- project: "$.project_id",
111
+ space: "$.space_id",
112
112
  kind: "'skill'",
113
113
  item: "$.id",
114
114
  parent: "NULL",
@@ -126,13 +126,55 @@ const OPS = [
126
126
  */
127
127
  export const PRESENCE_TABLE = {
128
128
  table: "live_presence",
129
- project: "NULL",
129
+ space: "NULL",
130
130
  kind: "'presence'",
131
131
  item: "$.kind || ':' || $.item",
132
132
  parent: "$.kind",
133
133
  owns: false,
134
134
  updateWhen: "old.state IS NOT new.state OR old.place IS NOT new.place OR old.name IS NOT new.name",
135
135
  };
136
+ /**
137
+ * Work's chats (behind `workMode`, migration 0029): any change of a chat, its members, its held
138
+ * calls or a section of the sidebar is a change of kind `chat` (the item: the chat, or the
139
+ * section). The feed carries no view of it: the stream checks each against the person (a private
140
+ * chat goes to its members only), and the studio reads the chat and the sidebar again. Messages
141
+ * are Mastra's; a new one updates its chat's row (its last message), so it is heard through that.
142
+ */
143
+ const ofChat = "(SELECT space_id FROM chat WHERE id = $.chat_id)";
144
+ export const CHAT_TABLES = [
145
+ {
146
+ table: "chat",
147
+ space: "$.space_id",
148
+ kind: "'chat'",
149
+ item: "$.id",
150
+ parent: "NULL",
151
+ owns: true,
152
+ },
153
+ {
154
+ table: "chat_member",
155
+ space: ofChat,
156
+ kind: "'chat'",
157
+ item: "$.chat_id",
158
+ parent: "NULL",
159
+ owns: false,
160
+ },
161
+ {
162
+ table: "chat_approval",
163
+ space: ofChat,
164
+ kind: "'chat'",
165
+ item: "$.chat_id",
166
+ parent: "NULL",
167
+ owns: false,
168
+ },
169
+ {
170
+ table: "chat_section",
171
+ space: "$.space_id",
172
+ kind: "'chat'",
173
+ item: "$.id",
174
+ parent: "'section'",
175
+ owns: true,
176
+ },
177
+ ];
136
178
  /** The trigger SQL of `tables`, in drizzle's statement-breakpoint form. */
137
179
  export function liveTriggerSql(tables = LIVE_TABLES) {
138
180
  const out = [];
@@ -144,8 +186,8 @@ export function liveTriggerSql(tables = LIVE_TABLES) {
144
186
  const name = t.table.startsWith("live_") ? t.table : `live_${t.table}`;
145
187
  out.push([
146
188
  `CREATE TRIGGER \`${name}_${op.suffix}\` AFTER ${op.event} ON \`${t.table}\`${when} BEGIN`,
147
- "\tINSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)",
148
- `\tSELECT ${at(t.project)}, ${at(t.kind)}, ${kind}, i, ${at(t.parent)}, unixepoch() * 1000 FROM (SELECT ${at(t.item)} AS i) WHERE i IS NOT NULL;`,
189
+ "\tINSERT INTO `live_change` (`space_id`, `kind`, `op`, `item`, `parent`, `at`)",
190
+ `\tSELECT ${at(t.space)}, ${at(t.kind)}, ${kind}, i, ${at(t.parent)}, unixepoch() * 1000 FROM (SELECT ${at(t.item)} AS i) WHERE i IS NOT NULL;`,
149
191
  "END;",
150
192
  ].join("\n"));
151
193
  }
@@ -0,0 +1,52 @@
1
+ CREATE TABLE `chat` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `tenant_id` text NOT NULL,
4
+ `project_id` text NOT NULL,
5
+ `title` text NOT NULL,
6
+ `section_id` text,
7
+ `parent_id` text,
8
+ `private` integer DEFAULT false NOT NULL,
9
+ `created_by` text NOT NULL,
10
+ `created_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
11
+ `updated_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
12
+ `last_author_id` text,
13
+ `last_author_name` text,
14
+ `last_text` text,
15
+ FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON UPDATE no action ON DELETE cascade,
16
+ FOREIGN KEY (`section_id`) REFERENCES `chat_section`(`id`) ON UPDATE no action ON DELETE set null,
17
+ FOREIGN KEY (`parent_id`) REFERENCES `chat`(`id`) ON UPDATE no action ON DELETE cascade
18
+ );
19
+ --> statement-breakpoint
20
+ CREATE INDEX `chat_project` ON `chat` (`project_id`,`updated_at`);--> statement-breakpoint
21
+ CREATE INDEX `chat_parent` ON `chat` (`parent_id`);--> statement-breakpoint
22
+ CREATE TABLE `chat_member` (
23
+ `chat_id` text NOT NULL,
24
+ `kind` text NOT NULL,
25
+ `member_id` text NOT NULL,
26
+ `joined_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
27
+ PRIMARY KEY(`chat_id`, `kind`, `member_id`),
28
+ FOREIGN KEY (`chat_id`) REFERENCES `chat`(`id`) ON UPDATE no action ON DELETE cascade
29
+ );
30
+ --> statement-breakpoint
31
+ CREATE INDEX `chat_member_member` ON `chat_member` (`kind`,`member_id`);--> statement-breakpoint
32
+ CREATE TABLE `chat_section` (
33
+ `id` text PRIMARY KEY NOT NULL,
34
+ `tenant_id` text NOT NULL,
35
+ `project_id` text NOT NULL,
36
+ `name` text NOT NULL,
37
+ `position` integer DEFAULT 0 NOT NULL,
38
+ `created_by` text NOT NULL,
39
+ `created_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
40
+ FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON UPDATE no action ON DELETE cascade
41
+ );
42
+ --> statement-breakpoint
43
+ CREATE INDEX `chat_section_project` ON `chat_section` (`project_id`,`position`);--> statement-breakpoint
44
+ CREATE TABLE `chat_state` (
45
+ `chat_id` text NOT NULL,
46
+ `user_id` text NOT NULL,
47
+ `pinned_at` integer,
48
+ `archived_at` integer,
49
+ `read_at` integer,
50
+ PRIMARY KEY(`chat_id`, `user_id`),
51
+ FOREIGN KEY (`chat_id`) REFERENCES `chat`(`id`) ON UPDATE no action ON DELETE cascade
52
+ );
@@ -0,0 +1,17 @@
1
+ CREATE TABLE `chat_approval` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `tenant_id` text NOT NULL,
4
+ `chat_id` text NOT NULL,
5
+ `tool_name` text NOT NULL,
6
+ `input` text,
7
+ `asked_by` text NOT NULL,
8
+ `state` text DEFAULT 'pending' NOT NULL,
9
+ `output` text,
10
+ `decided_by` text,
11
+ `decided_at` integer,
12
+ `created_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
13
+ FOREIGN KEY (`chat_id`) REFERENCES `chat`(`id`) ON UPDATE no action ON DELETE cascade
14
+ );
15
+ --> statement-breakpoint
16
+ CREATE INDEX `chat_approval_chat` ON `chat_approval` (`chat_id`,`created_at`);--> statement-breakpoint
17
+ CREATE INDEX `chat_approval_state` ON `chat_approval` (`tenant_id`,`state`);
@@ -0,0 +1,49 @@
1
+ ALTER TABLE `chat` ADD `answering_since` integer;--> statement-breakpoint
2
+ CREATE TRIGGER `live_chat_ai` AFTER INSERT ON `chat` BEGIN
3
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
4
+ SELECT new.project_id, 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT new.id AS i) WHERE i IS NOT NULL;
5
+ END;--> statement-breakpoint
6
+ CREATE TRIGGER `live_chat_au` AFTER UPDATE ON `chat` BEGIN
7
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
8
+ SELECT new.project_id, 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT new.id AS i) WHERE i IS NOT NULL;
9
+ END;--> statement-breakpoint
10
+ CREATE TRIGGER `live_chat_ad` AFTER DELETE ON `chat` BEGIN
11
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
12
+ SELECT old.project_id, 'chat', 'del', i, NULL, unixepoch() * 1000 FROM (SELECT old.id AS i) WHERE i IS NOT NULL;
13
+ END;--> statement-breakpoint
14
+ CREATE TRIGGER `live_chat_member_ai` AFTER INSERT ON `chat_member` BEGIN
15
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
16
+ SELECT (SELECT project_id FROM chat WHERE id = new.chat_id), 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT new.chat_id AS i) WHERE i IS NOT NULL;
17
+ END;--> statement-breakpoint
18
+ CREATE TRIGGER `live_chat_member_au` AFTER UPDATE ON `chat_member` BEGIN
19
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
20
+ SELECT (SELECT project_id FROM chat WHERE id = new.chat_id), 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT new.chat_id AS i) WHERE i IS NOT NULL;
21
+ END;--> statement-breakpoint
22
+ CREATE TRIGGER `live_chat_member_ad` AFTER DELETE ON `chat_member` BEGIN
23
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
24
+ SELECT (SELECT project_id FROM chat WHERE id = old.chat_id), 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT old.chat_id AS i) WHERE i IS NOT NULL;
25
+ END;--> statement-breakpoint
26
+ CREATE TRIGGER `live_chat_approval_ai` AFTER INSERT ON `chat_approval` BEGIN
27
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
28
+ SELECT (SELECT project_id FROM chat WHERE id = new.chat_id), 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT new.chat_id AS i) WHERE i IS NOT NULL;
29
+ END;--> statement-breakpoint
30
+ CREATE TRIGGER `live_chat_approval_au` AFTER UPDATE ON `chat_approval` BEGIN
31
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
32
+ SELECT (SELECT project_id FROM chat WHERE id = new.chat_id), 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT new.chat_id AS i) WHERE i IS NOT NULL;
33
+ END;--> statement-breakpoint
34
+ CREATE TRIGGER `live_chat_approval_ad` AFTER DELETE ON `chat_approval` BEGIN
35
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
36
+ SELECT (SELECT project_id FROM chat WHERE id = old.chat_id), 'chat', 'put', i, NULL, unixepoch() * 1000 FROM (SELECT old.chat_id AS i) WHERE i IS NOT NULL;
37
+ END;--> statement-breakpoint
38
+ CREATE TRIGGER `live_chat_section_ai` AFTER INSERT ON `chat_section` BEGIN
39
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
40
+ SELECT new.project_id, 'chat', 'put', i, 'section', unixepoch() * 1000 FROM (SELECT new.id AS i) WHERE i IS NOT NULL;
41
+ END;--> statement-breakpoint
42
+ CREATE TRIGGER `live_chat_section_au` AFTER UPDATE ON `chat_section` BEGIN
43
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
44
+ SELECT new.project_id, 'chat', 'put', i, 'section', unixepoch() * 1000 FROM (SELECT new.id AS i) WHERE i IS NOT NULL;
45
+ END;--> statement-breakpoint
46
+ CREATE TRIGGER `live_chat_section_ad` AFTER DELETE ON `chat_section` BEGIN
47
+ INSERT INTO `live_change` (`project_id`, `kind`, `op`, `item`, `parent`, `at`)
48
+ SELECT old.project_id, 'chat', 'del', i, 'section', unixepoch() * 1000 FROM (SELECT old.id AS i) WHERE i IS NOT NULL;
49
+ END;