@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
@@ -7,7 +7,7 @@ description: Build or change an engenty wizard — a page-by-page AI flow that p
7
7
 
8
8
  You work with the `engenty-wizards` MCP tools. The person you talk to is the ADMIN; the people who later open the wizard's link are END USERS.
9
9
 
10
- 1. **Read the guide first.** Call `get_authoring_guide` once per conversation. It holds the JSON schema, the design rules and the project's connected systems. Follow it.
10
+ 1. **Read the guide first.** Call `get_authoring_guide` once per conversation. It holds the JSON schema, the design rules and the space's connected systems. Follow it.
11
11
  2. **Start from an example.** `list_starters`, then `get_starter` for the closest one. For an existing wizard, use `list_wizards` and `get_wizard`.
12
12
  3. **Write it.**
13
13
  - Use `create_wizard` with the full definition and a short `note` in the admin's language. The admin sees that note in the studio.
@@ -1,473 +0,0 @@
1
- import { COLOR_SECTION_KINDS, cleanAssetSections, cleanLogoSections, FACT_TYPES, FONT_USES, FONT_WEIGHTS, GRADIENT_TYPES, orderColors, PAGE_LANGS, PAGE_LIMITS, PAGE_SLUG, PROJECT_LIMITS, RULE_MARKS, } from "@engenty/wizards-shared/projects";
2
- import { note } from "@engenty/wizards-shared/run";
3
- import { and, count, eq, isNull, ne } from "drizzle-orm";
4
- import { nanoid } from "nanoid";
5
- import { z } from "zod";
6
- import { db, schema } from "../db/client.js";
7
- import { env } from "../env.js";
8
- import { managed, tenantInfo } from "../manage.js";
9
- import { spaceChanged } from "../plugins/events.js";
10
- import { cloudSpaceLimit, twoWayActive } from "../sync/state.js";
11
- import { putLink } from "../tenants/control.js";
12
- import { currentTenant } from "../tenants/tenant.js";
13
- import { serverText } from "../texts.js";
14
- import { mayBuild, requireAdmin, requireBuild, requireWritable } from "./access.js";
15
- import { notFound, ServiceError } from "./errors.js";
16
- import { forgetWizardLinks } from "./links.js";
17
- import { pushPages } from "./pages.js";
18
- import { removeProjectFiles } from "./project-files.js";
19
- const sectionId = z.string().regex(/^[A-Za-z0-9_-]{1,40}$/);
20
- export const brandColorSchema = z.object({
21
- name: z.string().max(120),
22
- value: z.string().regex(/^#[0-9a-fA-F]{6}$/),
23
- section: sectionId.optional(),
24
- });
25
- export const colorSectionSchema = z.object({
26
- id: sectionId,
27
- title: z.string().max(80),
28
- kind: z.enum(COLOR_SECTION_KINDS).optional(),
29
- });
30
- const hexColor = z.string().regex(/^#[0-9a-fA-F]{6}$/);
31
- export const gradientSchema = z.object({
32
- id: sectionId,
33
- name: z.string().max(80),
34
- description: z.string().max(400).optional(),
35
- section: sectionId,
36
- type: z.enum(GRADIENT_TYPES),
37
- angle: z.number().min(-360).max(720),
38
- stops: z
39
- .array(z.object({ color: hexColor, at: z.number().min(0).max(100) }))
40
- .min(2)
41
- .max(12),
42
- });
43
- export const patternSchema = z.object({
44
- id: sectionId,
45
- name: z.string().max(80),
46
- description: z.string().max(400).optional(),
47
- section: sectionId,
48
- file: z.string().max(40),
49
- tile: z.boolean().optional(),
50
- });
51
- const rulesSchema = z
52
- .array(z.object({ text: z.string().max(200), mark: z.enum(RULE_MARKS).optional() }))
53
- .max(PROJECT_LIMITS.logoRules);
54
- export const brandFontSchema = z.object({
55
- id: sectionId,
56
- family: z.string().max(80),
57
- role: z.string().max(200),
58
- weights: z.array(z.number().int().min(100).max(900)).max(FONT_WEIGHTS.length + 3),
59
- license: z.string().max(200).optional(),
60
- uses: z.array(z.enum(FONT_USES)).max(FONT_USES.length).optional(),
61
- source: z
62
- .union([
63
- z.object({ file: z.string().max(40) }),
64
- z.object({
65
- url: z
66
- .string()
67
- .max(600)
68
- .url()
69
- .refine((u) => u.startsWith("https://"), "an https:// address"),
70
- }),
71
- ])
72
- .optional(),
73
- });
74
- export const textStyleSchema = z.object({
75
- id: sectionId,
76
- name: z.string().max(60),
77
- font: sectionId.optional(),
78
- size: z.number().min(6).max(400),
79
- weight: z.number().int().min(100).max(900),
80
- lineHeight: z.number().min(50).max(300),
81
- tracking: z.number().min(-20).max(50),
82
- uppercase: z.boolean().optional(),
83
- });
84
- export const assetSectionSchema = z.object({
85
- id: sectionId,
86
- title: z.string().max(80),
87
- assets: z.array(z.string().max(40)).max(PROJECT_LIMITS.files.asset),
88
- });
89
- export const logoSectionSchema = z.object({
90
- id: sectionId,
91
- title: z.string().max(80),
92
- description: z.string().max(400),
93
- logos: z.array(z.string().max(40)).max(PROJECT_LIMITS.files.logo),
94
- });
95
- export const projectFactSchema = z.object({
96
- key: z.string().regex(/^[a-z0-9_]{1,40}$/),
97
- label: z.string().min(1).max(80),
98
- value: z.string().max(4000),
99
- type: z.enum(FACT_TYPES).optional(),
100
- });
101
- const trimmed = (max) => z
102
- .string()
103
- .trim()
104
- .max(max)
105
- .transform((v) => v || undefined)
106
- .optional();
107
- /** The space's public page as the studio sends it, whole. */
108
- export const projectPageSchema = z.object({
109
- on: z.boolean(),
110
- slug: z.string().trim().toLowerCase().max(PAGE_LIMITS.slug),
111
- title: z.string().trim().min(1).max(PAGE_LIMITS.title),
112
- headline: trimmed(PAGE_LIMITS.headline),
113
- intro: trimmed(PAGE_LIMITS.intro),
114
- lang: z.enum(PAGE_LANGS),
115
- form: z.enum(["du", "sie"]).optional(),
116
- wizards: z.array(z.string().max(40)).max(60),
117
- examples: z.record(z.string().max(40), z.string().regex(/^[A-Za-z0-9_-]{1,40}$/)),
118
- slugs: z.record(z.string().max(40), z.string().regex(PAGE_SLUG)).optional(),
119
- });
120
- export const projectPatchSchema = z.object({
121
- name: z.string().min(1).max(80).optional(),
122
- page: projectPageSchema.optional(),
123
- brand: z
124
- .object({
125
- name: z.string().max(120).optional(),
126
- about: z.string().max(8000).optional(),
127
- colors: z.array(brandColorSchema).max(PROJECT_LIMITS.colors).optional(),
128
- colorSections: z.array(colorSectionSchema).max(PROJECT_LIMITS.logoSections).optional(),
129
- gradients: z.array(gradientSchema).max(PROJECT_LIMITS.gradients).optional(),
130
- patterns: z.array(patternSchema).max(PROJECT_LIMITS.files.pattern).optional(),
131
- colorRules: rulesSchema.optional(),
132
- assetSections: z.array(assetSectionSchema).max(PROJECT_LIMITS.logoSections).optional(),
133
- fonts: z.array(brandFontSchema).max(PROJECT_LIMITS.fonts).optional(),
134
- textStyles: z.array(textStyleSchema).max(PROJECT_LIMITS.textStyles).optional(),
135
- typeRules: rulesSchema.optional(),
136
- logoSections: z.array(logoSectionSchema).max(PROJECT_LIMITS.logoSections).optional(),
137
- logoRules: rulesSchema.optional(),
138
- })
139
- .optional(),
140
- facts: z.array(projectFactSchema).max(PROJECT_LIMITS.facts).optional(),
141
- });
142
- /**
143
- * How many projects the tenant works with: the number the Manage-App gives for it, else this
144
- * runtime's (`LIMIT_PROJECTS`, one unless set). The studio shows a project switcher only above
145
- * one. Projects beyond the number stay in the database and are not listed.
146
- */
147
- export async function projectLimit() {
148
- if (managed) {
149
- const info = await tenantInfo(currentTenant()).catch(() => null);
150
- // Null: the plan sets no limit.
151
- if (info && info.limits.projects === null) {
152
- return Number.POSITIVE_INFINITY;
153
- }
154
- if (info?.limits.projects) {
155
- return info.limits.projects;
156
- }
157
- }
158
- // A local install that syncs both ways has the organization's spaces: its number counts.
159
- if (twoWayActive()) {
160
- const limit = cloudSpaceLimit();
161
- if (limit === null) {
162
- return Number.POSITIVE_INFINITY;
163
- }
164
- if (limit !== undefined) {
165
- return Math.max(1, limit);
166
- }
167
- }
168
- return Math.max(1, env.limits.projects);
169
- }
170
- /** The number for the studio: null where there is no limit (JSON has no infinity). */
171
- export async function projectLimitOrNull() {
172
- const limit = await projectLimit();
173
- return Number.isFinite(limit) ? limit : null;
174
- }
175
- export async function ownedProject(_userId, projectId) {
176
- const p = await db.query.project.findFirst({
177
- where: and(eq(schema.project.id, projectId), eq(schema.project.tenantId, currentTenant())),
178
- });
179
- if (!p) {
180
- throw notFound();
181
- }
182
- return p;
183
- }
184
- /** The tenant's projects that were made here, not synced from a local install. */
185
- const madeHere = () => and(eq(schema.project.tenantId, currentTenant()), isNull(schema.project.origin));
186
- /** The tenant's projects a local install synced. */
187
- const synced = () => and(eq(schema.project.tenantId, currentTenant()), eq(schema.project.origin, "local"));
188
- /** What the first space is called, in the language of whoever first opens the studio. */
189
- const FIRST_SPACE = { cloud: "firstSpaceCloud", local: "firstSpaceLocal" };
190
- /**
191
- * A tenant that builds here always has a project of its own: the first one is made when its
192
- * studio is first opened, named in that request's language.
193
- */
194
- async function ensureProject(lang = "en") {
195
- const any = await db.query.project.findFirst({ where: madeHere() });
196
- if (!any) {
197
- const id = nanoid(12);
198
- await db.insert(schema.project).values({
199
- id,
200
- tenantId: currentTenant(),
201
- name: serverText(lang, FIRST_SPACE[env.manage.url ? "cloud" : "local"]),
202
- });
203
- spaceChanged("space.created", id);
204
- }
205
- }
206
- /**
207
- * The project a caller means when it names none: the oldest one made here, where a wizard
208
- * lands; for a tenant that builds nothing here, the one its local install synced.
209
- */
210
- export async function defaultProject(_userId) {
211
- const build = await mayBuild();
212
- if (build) {
213
- await ensureProject();
214
- }
215
- const p = await db.query.project.findFirst({
216
- where: build ? madeHere() : synced(),
217
- orderBy: [schema.project.createdAt],
218
- });
219
- if (!p) {
220
- throw notFound();
221
- }
222
- return p;
223
- }
224
- /**
225
- * The projects the studio shows. A tenant that builds here: its own and the synced ones, up to
226
- * its number. One that does not: only what its local install synced — possibly nothing yet.
227
- */
228
- export async function listProjects(_userId, lang) {
229
- const build = await mayBuild();
230
- if (build) {
231
- await ensureProject(lang);
232
- }
233
- // The oldest come first: with a limit of one, that is the project everything lands in.
234
- const limit = await projectLimit();
235
- const projects = await db.query.project.findMany({
236
- where: build ? eq(schema.project.tenantId, currentTenant()) : synced(),
237
- orderBy: [schema.project.createdAt],
238
- ...(Number.isFinite(limit) ? { limit } : {}),
239
- });
240
- const counts = await db
241
- .select({ projectId: schema.wizard.projectId, n: count() })
242
- .from(schema.wizard)
243
- .where(eq(schema.wizard.tenantId, currentTenant()))
244
- .groupBy(schema.wizard.projectId);
245
- return projects.map((p) => ({
246
- ...p,
247
- wizardCount: counts.find((x) => x.projectId === p.id)?.n ?? 0,
248
- }));
249
- }
250
- export async function createProject(_userId, name) {
251
- await requireBuild();
252
- await requireAdmin();
253
- const [{ n }] = await db
254
- .select({ n: count() })
255
- .from(schema.project)
256
- .where(eq(schema.project.tenantId, currentTenant()));
257
- const limit = await projectLimit();
258
- if (n >= limit) {
259
- throw new ServiceError("refused", limit === 1 ? note("onlyOneSpaceAllowed") : note("mostSpaces", { count: limit }));
260
- }
261
- const id = nanoid(12);
262
- await db.insert(schema.project).values({ id, tenantId: currentTenant(), name, brand: {} });
263
- spaceChanged("space.created", id);
264
- return { id };
265
- }
266
- export async function updateProject(userId, projectId, patch) {
267
- const p = await ownedProject(userId, projectId);
268
- await requireWritable(p);
269
- await requireAdmin();
270
- if (patch.facts && new Set(patch.facts.map((f) => f.key)).size !== patch.facts.length) {
271
- throw new ServiceError("invalid", note("twoEntriesSameKey"));
272
- }
273
- if (patch.brand?.fonts) {
274
- await linkFontFiles(p.id, patch.brand.fonts);
275
- }
276
- const page = patch.page ? await checkedPage(p, patch.page) : undefined;
277
- await db
278
- .update(schema.project)
279
- .set({
280
- ...(patch.name ? { name: patch.name } : {}),
281
- ...(patch.brand ? { brand: brandAfter(p.brand, patch.brand) } : {}),
282
- ...(patch.facts ? { facts: patch.facts } : {}),
283
- ...(page ? { page } : {}),
284
- updatedAt: new Date(),
285
- })
286
- .where(eq(schema.project.id, p.id));
287
- spaceChanged("space.updated", p.id);
288
- // The page itself, and what it is drawn from: the brand, the facts as the imprint.
289
- if (page || patch.brand || patch.facts) {
290
- pushPages();
291
- }
292
- }
293
- /**
294
- * The page as it is kept: its address made of the allowed characters and taken by no other space
295
- * of the tenant, only this tenant's wizards of this space on it, and the page on in one space at
296
- * most (`409 page_taken`, naming that space). The form is German's alone.
297
- */
298
- async function checkedPage(p, page) {
299
- if (!PAGE_SLUG.test(page.slug)) {
300
- throw new ServiceError("invalid", note("pageSlugInvalid"));
301
- }
302
- const others = await db.query.project.findMany({
303
- where: and(eq(schema.project.tenantId, currentTenant()), ne(schema.project.id, p.id)),
304
- columns: { id: true, name: true, page: true },
305
- });
306
- if (others.some((o) => o.page?.slug === page.slug)) {
307
- throw new ServiceError("invalid", note("pageSlugTaken"));
308
- }
309
- const holder = page.on ? others.find((o) => o.page?.on) : undefined;
310
- if (holder) {
311
- throw new ServiceError("page_taken", note("pageTaken", { space: holder.name }), {
312
- project: { id: holder.id, name: holder.name },
313
- });
314
- }
315
- const own = new Set((await db.query.wizard.findMany({
316
- where: eq(schema.wizard.projectId, p.id),
317
- columns: { id: true },
318
- })).map((w) => w.id));
319
- const wizards = [...new Set(page.wizards)].filter((id) => own.has(id));
320
- const examples = Object.fromEntries(Object.entries(page.examples).filter(([id]) => own.has(id)));
321
- // The wizards' addresses are kept as made (pages.ts); a wizard that is gone frees its address.
322
- const slugs = Object.fromEntries(Object.entries({ ...p.page?.slugs, ...page.slugs }).filter(([id]) => own.has(id)));
323
- return {
324
- on: page.on,
325
- slug: page.slug,
326
- title: page.title,
327
- ...(page.headline ? { headline: page.headline } : {}),
328
- ...(page.intro ? { intro: page.intro } : {}),
329
- lang: page.lang,
330
- ...(page.lang === "de" && page.form ? { form: page.form } : {}),
331
- wizards,
332
- examples,
333
- ...(Object.keys(slugs).length ? { slugs } : {}),
334
- };
335
- }
336
- /**
337
- * A brand font's own file is a font of the space; run pages ask for it by its id, before the
338
- * tenant is known, so the control database learns it.
339
- */
340
- async function linkFontFiles(projectId, fonts) {
341
- for (const f of fonts) {
342
- if (!(f.source && "file" in f.source)) {
343
- continue;
344
- }
345
- const file = await db.query.projectFile.findFirst({
346
- where: and(eq(schema.projectFile.id, f.source.file), eq(schema.projectFile.projectId, projectId)),
347
- });
348
- if (!file?.mime.startsWith("font/")) {
349
- throw new ServiceError("invalid", note("fontSourceNoFont", { family: f.family }));
350
- }
351
- await putLink(file.id, "font", file.id);
352
- }
353
- }
354
- /**
355
- * The brand with the patch on it. Sections and rules are optional: a section without title and
356
- * logos and rules without words are not kept.
357
- */
358
- function brandAfter(brand, patch) {
359
- const { logoSections, logoRules, colors, colorSections, colorRules, gradients, patterns, assetSections, fonts, textStyles, typeRules, ...rest } = {
360
- ...brand,
361
- ...patch,
362
- };
363
- // A rule is its words and its sign; a bullet is the sign of none.
364
- const rows = (list) => (list ?? [])
365
- .map(({ text, mark }) => ({
366
- text: text.trim(),
367
- ...(mark && mark !== "bullet" ? { mark } : {}),
368
- }))
369
- .filter((r) => r.text);
370
- const used = new Set([...(colors ?? []), ...(gradients ?? []), ...(patterns ?? [])].map((c) => c.section));
371
- const colorGroups = (colorSections ?? [])
372
- .map((s) => ({
373
- ...s,
374
- title: s.title.trim(),
375
- ...(s.kind && s.kind !== "colors" ? { kind: s.kind } : { kind: undefined }),
376
- }))
377
- .filter((s) => s.title || used.has(s.id));
378
- // A gradient or a pattern lives in a section of its kind; colours only in colour sections.
379
- const kindOf = (id) => colorGroups.find((s) => s.id === id)?.kind ?? "colors";
380
- const inKind = (id, kind) => colorGroups.some((s) => s.id === id && s.kind === kind);
381
- const told = ({ description, ...x }) => ({
382
- ...x,
383
- name: x.name.trim(),
384
- ...(description?.trim() ? { description: description.trim() } : {}),
385
- });
386
- const fills = (gradients ?? []).filter((g) => inKind(g.section, "gradients")).map(told);
387
- const tiles = (patterns ?? []).filter((p) => inKind(p.section, "patterns")).map(told);
388
- const swatches = colors?.map((c) => c.section && kindOf(c.section) !== "colors" ? { name: c.name, value: c.value } : c);
389
- const sections = cleanLogoSections((logoSections ?? []).map((s) => ({
390
- ...s,
391
- title: s.title.trim(),
392
- description: s.description.trim(),
393
- }))).filter((s) => s.title || s.logos.length);
394
- const assetGroups = cleanAssetSections((assetSections ?? []).map((s) => ({ ...s, title: s.title.trim() }))).filter((s) => s.title || s.assets.length);
395
- const typefaces = (fonts ?? [])
396
- .map(({ license, uses, ...f }) => ({
397
- ...f,
398
- family: f.family.trim(),
399
- role: f.role.trim(),
400
- ...(license?.trim() ? { license: license.trim() } : {}),
401
- ...(uses?.length ? { uses: FONT_USES.filter((u) => uses.includes(u)) } : {}),
402
- }))
403
- .filter((f) => f.family);
404
- const styles = (textStyles ?? [])
405
- .map((s) => ({
406
- ...s,
407
- name: s.name.trim(),
408
- font: typefaces.some((f) => f.id === s.font) ? s.font : undefined,
409
- }))
410
- .filter((s) => s.name);
411
- const typeRows = rows(typeRules);
412
- const rules = rows(logoRules);
413
- const colourRules = rows(colorRules);
414
- return {
415
- ...rest,
416
- ...(swatches ? { colors: orderColors(swatches, colorGroups) } : {}),
417
- ...(colorGroups.length
418
- ? { colorSections: colorGroups.map(({ kind, ...s }) => (kind ? { ...s, kind } : s)) }
419
- : {}),
420
- ...(fills.length ? { gradients: fills } : {}),
421
- ...(tiles.length ? { patterns: tiles } : {}),
422
- ...(colourRules.length ? { colorRules: colourRules } : {}),
423
- ...(assetGroups.length ? { assetSections: assetGroups } : {}),
424
- ...(typefaces.length ? { fonts: typefaces } : {}),
425
- ...(styles.length ? { textStyles: styles } : {}),
426
- ...(typeRows.length ? { typeRules: typeRows } : {}),
427
- ...(sections.length ? { logoSections: sections } : {}),
428
- ...(rules.length ? { logoRules: rules } : {}),
429
- };
430
- }
431
- export function projectProfile(p) {
432
- return {
433
- name: p.brand.name ?? "",
434
- about: p.brand.about ?? "",
435
- colors: p.brand.colors ?? [],
436
- colorSections: p.brand.colorSections ?? [],
437
- gradients: p.brand.gradients ?? [],
438
- patterns: p.brand.patterns ?? [],
439
- colorRules: p.brand.colorRules ?? [],
440
- logoSections: p.brand.logoSections ?? [],
441
- assetSections: p.brand.assetSections ?? [],
442
- fonts: p.brand.fonts ?? [],
443
- textStyles: p.brand.textStyles ?? [],
444
- typeRules: p.brand.typeRules ?? [],
445
- logoRules: p.brand.logoRules ?? [],
446
- facts: p.facts.filter((f) => f.value.trim()),
447
- };
448
- }
449
- export async function deleteProject(userId, projectId) {
450
- await requireWritable(await ownedProject(userId, projectId));
451
- await requireAdmin();
452
- const all = await db.query.project.findMany({ where: madeHere() });
453
- if (all.length <= 1) {
454
- throw new ServiceError("refused", note("notDeleteLastSpace"));
455
- }
456
- await removeProject(projectId);
457
- }
458
- /** Takes a project away with its wizards' links and its files. */
459
- export async function removeProject(projectId) {
460
- const wizards = await db
461
- .select({ id: schema.wizard.id })
462
- .from(schema.wizard)
463
- .where(eq(schema.wizard.projectId, projectId));
464
- for (const w of wizards) {
465
- await forgetWizardLinks(w.id);
466
- }
467
- await removeProjectFiles(projectId);
468
- await db
469
- .delete(schema.project)
470
- .where(and(eq(schema.project.id, projectId), eq(schema.project.tenantId, currentTenant())));
471
- spaceChanged("space.deleted", projectId);
472
- pushPages();
473
- }
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bn as r,Jt as i,Nn as a,Xt as o,Yt as s,in as c,on as l,qt as u,sn as d,tn as f}from"./ui-CwFQAfE-.js";import{t as p}from"./preload-helper-DpV6A1kQ.js";import{t as m}from"./logo-CGNoptDg.js";import{s as h}from"./i18n-CKKh3Pn0.js";import{Mt as g,Nt as _,V as v,et as y,it as b}from"./index-Cy2NHzAx.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-CKLgFL6r.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:r,description:i}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(a,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:h(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[r,a]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return p(()=>import(`./oss-credits-DpRWUPjD.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||a(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>k(s,e.name,e.license,h(e.description))):e,l=e=>s?e.filter(e=>k(s,e.name,e.license,e.version)):e,u=c(E),d=c(D),m=t?[{id:`shared`,label:h(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],g=u.length===0&&d.length===0&&m.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:h(`about.creditsHint`)}),(0,O.jsx)(o,{type:`search`,value:r,placeholder:h(`about.search`),onChange:e=>a(e.target.value)}),u.length>0?(0,O.jsx)(j,{title:h(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:u})}):null,d.length>0?(0,O.jsx)(j,{title:h(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:d})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(f,{})}):m.length>0?(0,O.jsx)(j,{title:h(`about.creditsDeps`),hint:s?void 0:h(`about.creditsDepsHint`),children:m.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(i,{children:h(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>h(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?h(`about.change`):h(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let i=e?.mode===`local`,{data:a,latest:o}=g(i&&t),[s,u]=(0,T.useState)(null),[d,p]=(0,T.useState)(n);(0,T.useEffect)(()=>p(n),[n]);let E=b(F.indexOf(d)),D=a?.newer&&o?o:_;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return u(null),S(D===`0.12.2`?void 0:D).then(t=>{e||u(t)}),()=>{e=!0}},[t,D]);let k=s?.find(e=>e.version===`v${D}`)??s?.[0]??null,A=s?.filter(e=>e!==k)??[],j=i?a?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(m,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[h(`about.version`,{v:_}),j?` · ${h(`about.kind.${j}`)}`:``]})]}),i?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(v,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(c,{value:d,onChange:p,options:F.map(e=>({id:e,label:I(e)})),label:h(`about.title`)})}),(0,O.jsxs)(`div`,{className:l(`mt-5`,y(E)),children:[d===`new`?s===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(f,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:h(`about.changelogEmpty`)}):null,d===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(r,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,d===`credits`?(0,O.jsx)(P,{active:!0}):null]},d)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(u,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(s,{label:h(`common.close`),onClick:t,children:(0,O.jsx)(d,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};