@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
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The broker's first part (docs/plans/broker.md, "First: RWX"): the words of a space's rules.
3
+ * A rule says who (a subject) may read, write or execute what (a resource); each flag is allow,
4
+ * deny or unset. Unset means deny, and a deny wins over every allow from any other rule. The
5
+ * runtime decides in apps/runtime/src/broker/rwx.ts; the studio will draw the rows as sentences.
6
+ */
7
+ /** Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. */
8
+ export declare const RWX_SUBJECT_KINDS: readonly ["guest", "person", "role", "goose", "wizard", "plugin"];
9
+ export type RwxSubjectKind = (typeof RWX_SUBJECT_KINDS)[number];
10
+ /** What a rule is about. The id is the resource's, or `*` for every resource of the kind. */
11
+ export declare const RWX_RESOURCE_KINDS: readonly ["document", "table", "page", "connection", "mail", "host", "sandbox"];
12
+ export type RwxResourceKind = (typeof RWX_RESOURCE_KINDS)[number];
13
+ export declare const RWX_PERMS: readonly ["r", "w", "x"];
14
+ export type RwxPerm = (typeof RWX_PERMS)[number];
15
+ export declare const RWX_FLAGS: readonly ["allow", "deny"];
16
+ export type RwxFlag = (typeof RWX_FLAGS)[number];
17
+ export declare const RWX_ROLES: readonly ["member", "admin", "owner"];
18
+ /** Every resource of a kind. */
19
+ export declare const RWX_ALL = "*";
20
+ export declare const RWX_LIMITS: {
21
+ /** Rules one space may hold. */
22
+ rules: number;
23
+ /** Characters of a subject's or resource's id. */
24
+ id: number;
25
+ };
26
+ /** A rule as an admin writes it. */
27
+ export interface RwxRuleInput {
28
+ subjectKind: RwxSubjectKind;
29
+ subjectId: string | null;
30
+ resourceKind: RwxResourceKind;
31
+ resourceId: string;
32
+ r: RwxFlag | null;
33
+ w: RwxFlag | null;
34
+ x: RwxFlag | null;
35
+ }
36
+ /** A rule as the studio lists it. */
37
+ export interface RwxRule extends RwxRuleInput {
38
+ id: string;
39
+ /** A user's id, or `seed` for the rows every space starts with. */
40
+ createdBy: string;
41
+ createdAt: string;
42
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The broker's first part (docs/plans/broker.md, "First: RWX"): the words of a space's rules.
3
+ * A rule says who (a subject) may read, write or execute what (a resource); each flag is allow,
4
+ * deny or unset. Unset means deny, and a deny wins over every allow from any other rule. The
5
+ * runtime decides in apps/runtime/src/broker/rwx.ts; the studio will draw the rows as sentences.
6
+ */
7
+ /** Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. */
8
+ export const RWX_SUBJECT_KINDS = ["guest", "person", "role", "goose", "wizard", "plugin"];
9
+ /** What a rule is about. The id is the resource's, or `*` for every resource of the kind. */
10
+ export const RWX_RESOURCE_KINDS = [
11
+ "document",
12
+ "table",
13
+ "page",
14
+ "connection",
15
+ "mail",
16
+ "host",
17
+ "sandbox",
18
+ ];
19
+ export const RWX_PERMS = ["r", "w", "x"];
20
+ export const RWX_FLAGS = ["allow", "deny"];
21
+ export const RWX_ROLES = ["member", "admin", "owner"];
22
+ /** Every resource of a kind. */
23
+ export const RWX_ALL = "*";
24
+ export const RWX_LIMITS = {
25
+ /** Rules one space may hold. */
26
+ rules: 500,
27
+ /** Characters of a subject's or resource's id. */
28
+ id: 200,
29
+ };
@@ -83,7 +83,7 @@ export interface SkillsList {
83
83
  }
84
84
  /** A skill opened: its instructions, the rest of its front matter and its files. */
85
85
  export interface SkillDetail extends SkillSummary {
86
- projectId: string;
86
+ spaceId: string;
87
87
  body: string;
88
88
  /** Front matter beside `name` and `description`, kept as it came (`license`, `metadata` …). */
89
89
  meta: Record<string, unknown>;
@@ -36,7 +36,7 @@ export interface SpaceTableRow {
36
36
  }
37
37
  export interface SpaceTable {
38
38
  id: string;
39
- projectId: string;
39
+ spaceId: string;
40
40
  wizardId: string | null;
41
41
  list: string | null;
42
42
  title: string;
@@ -63,7 +63,7 @@ export interface SpaceTable {
63
63
  }
64
64
  export interface SpacePage {
65
65
  id: string;
66
- projectId: string;
66
+ spaceId: string;
67
67
  wizardId: string | null;
68
68
  title: string;
69
69
  markdown: string;
@@ -1,7 +1,15 @@
1
1
  import type { RunFontFace, RunTheme } from "./run.js";
2
2
  export declare const FACT_TYPES: readonly ["text", "longtext", "number", "date", "url", "email", "phone", "boolean"];
3
3
  export type FactType = (typeof FACT_TYPES)[number];
4
- export interface ProjectFact {
4
+ /** How a space's admins hear of the broker's critical lines: the bell in Work, a mail once an hour. */
5
+ export declare const NOTIFY_MAIL: readonly ["hourly", "off"];
6
+ export type NotifyMail = (typeof NOTIFY_MAIL)[number];
7
+ export interface SpaceNotify {
8
+ bell: boolean;
9
+ mail: NotifyMail;
10
+ }
11
+ export declare const DEFAULT_SPACE_NOTIFY: SpaceNotify;
12
+ export interface SpaceFact {
5
13
  /** How templates name it: `{{facts.<key>}}`. Made from the label, stable afterwards. */
6
14
  key: string;
7
15
  label: string;
@@ -11,17 +19,17 @@ export interface ProjectFact {
11
19
  }
12
20
  /** The type a value looks like. A value that looks like nothing in particular is text. */
13
21
  export declare function detectFactType(value: string): FactType;
14
- export declare function factType(fact: Pick<ProjectFact, "value" | "type">): FactType;
22
+ export declare function factType(fact: Pick<SpaceFact, "value" | "type">): FactType;
15
23
  /** A fact's key from its label: lower case, a-z 0-9 and _, unique among `taken`. */
16
24
  export declare function factKey(label: string, taken?: string[]): string;
17
- /** Facts most projects have, by key; offered as empty rows to fill in (labels: `fact.<key>`). */
25
+ /** Facts most spaces have, by key; offered as empty rows to fill in (labels: `fact.<key>`). */
18
26
  export declare const BASIC_FACTS: readonly ["adresse", "plz", "ort", "uid", "telefon", "e_mail", "website", "iban"];
19
27
  export type BasicFact = (typeof BASIC_FACTS)[number];
20
28
  export declare const PAGE_LANGS: readonly ["de", "en"];
21
29
  export type PageLang = (typeof PAGE_LANGS)[number];
22
30
  /** How a German page addresses its readers. */
23
31
  export type PageForm = "du" | "sie";
24
- export interface ProjectPage {
32
+ export interface SpacePage {
25
33
  on: boolean;
26
34
  /** Its address under the organization's: `<organization>.wizards.page/<slug>`. */
27
35
  slug: string;
@@ -100,7 +108,7 @@ export interface BrandPattern {
100
108
  description?: string;
101
109
  /** The patterns section it is in. */
102
110
  section: string;
103
- /** The project file (kind `pattern`) with the picture. */
111
+ /** The space file (kind `pattern`) with the picture. */
104
112
  file: string;
105
113
  /** Repeated as a tile; else it fills the area. */
106
114
  tile?: boolean;
@@ -122,6 +130,18 @@ export declare function orderColors(colors: BrandColor[], sections: ColorSection
122
130
  * Optional. Logos in no section are the standard ones: they come first, without a title, and
123
131
  * the first of them is the main logo.
124
132
  */
133
+ /** A block of how the brand speaks: its tone, audience, positioning, values or one of its own. */
134
+ export interface VoiceBlock {
135
+ id: string;
136
+ title: string;
137
+ text: string;
138
+ }
139
+ /** A place the brand is found on the web: its website, a social profile. */
140
+ export interface BrandLink {
141
+ id: string;
142
+ label: string;
143
+ url: string;
144
+ }
125
145
  export interface LogoSection {
126
146
  id: string;
127
147
  title: string;
@@ -167,7 +187,7 @@ export interface BrandFont {
167
187
  */
168
188
  uses?: FontUse[];
169
189
  /**
170
- * Where a run page loads it from: a `.woff2` of the space (a project file), served from our
190
+ * Where a run page loads it from: a `.woff2` of the space (a space file), served from our
171
191
  * address, or the address of the font on the space's own website (the file or its stylesheet).
172
192
  * None: the family name alone, as a computer that has it installed shows it.
173
193
  */
@@ -226,20 +246,20 @@ export interface AssetSection {
226
246
  /** The sections as stored: each file in its first section only, ids not known to `files` left out. */
227
247
  export declare function cleanLogoSections(sections: LogoSection[], files?: string[]): LogoSection[];
228
248
  export declare function cleanAssetSections(sections: AssetSection[], files?: string[]): AssetSection[];
229
- export declare const PROJECT_FILE_KINDS: readonly ["logo", "asset", "document", "pattern"];
230
- export type ProjectFileKind = (typeof PROJECT_FILE_KINDS)[number];
249
+ export declare const SPACE_FILE_KINDS: readonly ["logo", "asset", "document", "pattern"];
250
+ export type SpaceFileKind = (typeof SPACE_FILE_KINDS)[number];
231
251
  /** `pending`: being read, described and indexed. */
232
- export type ProjectFileStatus = "pending" | "ready" | "failed";
233
- export interface ProjectFileView {
252
+ export type SpaceFileStatus = "pending" | "ready" | "failed";
253
+ export interface SpaceFileView {
234
254
  id: string;
235
- kind: ProjectFileKind;
255
+ kind: SpaceFileKind;
236
256
  name: string;
237
257
  mime: string;
238
258
  size: number;
239
259
  description: string;
240
260
  /** A web address the file was fetched from, when it was not uploaded. */
241
261
  source: string | null;
242
- status: ProjectFileStatus;
262
+ status: SpaceFileStatus;
243
263
  error: string | null;
244
264
  /** Documents: what the index holds of it. `embeddings` includes the keywords. */
245
265
  indexed: "embeddings" | "keywords" | null;
@@ -247,7 +267,7 @@ export interface ProjectFileView {
247
267
  chars: number | null;
248
268
  createdAt: string;
249
269
  }
250
- export declare const PROJECT_LIMITS: {
270
+ export declare const SPACE_LIMITS: {
251
271
  readonly facts: 100;
252
272
  readonly colors: 32;
253
273
  readonly fonts: 6;
@@ -256,6 +276,10 @@ export declare const PROJECT_LIMITS: {
256
276
  readonly logoSections: 8;
257
277
  /** Rows of logo rules. */
258
278
  readonly logoRules: 16;
279
+ /** Blocks of the brand's voice, and the words of one. */
280
+ readonly voiceBlocks: 12;
281
+ readonly voiceText: 2000;
282
+ readonly links: 20;
259
283
  readonly files: {
260
284
  readonly logo: 24;
261
285
  readonly asset: 100;
@@ -271,5 +295,5 @@ export declare const PROJECT_LIMITS: {
271
295
  readonly pattern: 10000000;
272
296
  };
273
297
  };
274
- /** The largest file of a kind and type a project takes. */
275
- export declare function projectFileLimit(kind: ProjectFileKind, mime: string): number;
298
+ /** The largest file of a kind and type a space takes. */
299
+ export declare function spaceFileLimit(kind: SpaceFileKind, mime: string): number;
@@ -1,6 +1,6 @@
1
1
  // --- facts ---------------------------------------------------------------------
2
- // What a project knows about itself as label and value: an address, a VAT id, anything. Every
3
- // step of the project's wizards can read them.
2
+ // What a space knows about itself as label and value: an address, a VAT id, anything. Every
3
+ // step of the space's wizards can read them.
4
4
  export const FACT_TYPES = [
5
5
  "text",
6
6
  "longtext",
@@ -11,6 +11,9 @@ export const FACT_TYPES = [
11
11
  "phone",
12
12
  "boolean",
13
13
  ];
14
+ /** How a space's admins hear of the broker's critical lines: the bell in Work, a mail once an hour. */
15
+ export const NOTIFY_MAIL = ["hourly", "off"];
16
+ export const DEFAULT_SPACE_NOTIFY = { bell: true, mail: "hourly" };
14
17
  const DATE_RE = /^(\d{4}-\d{2}-\d{2}|\d{1,2}\.\s?\d{1,2}\.\s?\d{4})$/;
15
18
  const NUMBER_RE = /^[+-]?\d{1,3}([.,\s']?\d{3})*([.,]\d+)?$/;
16
19
  const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
@@ -68,7 +71,7 @@ export function factKey(label, taken = []) {
68
71
  }
69
72
  return key;
70
73
  }
71
- /** Facts most projects have, by key; offered as empty rows to fill in (labels: `fact.<key>`). */
74
+ /** Facts most spaces have, by key; offered as empty rows to fill in (labels: `fact.<key>`). */
72
75
  export const BASIC_FACTS = [
73
76
  "adresse",
74
77
  "plz",
@@ -335,8 +338,8 @@ export function cleanAssetSections(sections, files) {
335
338
  return sections.map((s, i) => ({ ...s, assets: lists[i] }));
336
339
  }
337
340
  // --- files -----------------------------------------------------------------------
338
- export const PROJECT_FILE_KINDS = ["logo", "asset", "document", "pattern"];
339
- export const PROJECT_LIMITS = {
341
+ export const SPACE_FILE_KINDS = ["logo", "asset", "document", "pattern"];
342
+ export const SPACE_LIMITS = {
340
343
  facts: 100,
341
344
  colors: 32,
342
345
  fonts: 6,
@@ -345,6 +348,10 @@ export const PROJECT_LIMITS = {
345
348
  logoSections: 8,
346
349
  /** Rows of logo rules. */
347
350
  logoRules: 16,
351
+ /** Blocks of the brand's voice, and the words of one. */
352
+ voiceBlocks: 12,
353
+ voiceText: 2000,
354
+ links: 20,
348
355
  files: { logo: 24, asset: 100, document: 2000, pattern: 24 },
349
356
  gradients: 24,
350
357
  bytes: {
@@ -355,10 +362,10 @@ export const PROJECT_LIMITS = {
355
362
  pattern: 10_000_000,
356
363
  },
357
364
  };
358
- /** The largest file of a kind and type a project takes. */
359
- export function projectFileLimit(kind, mime) {
365
+ /** The largest file of a kind and type a space takes. */
366
+ export function spaceFileLimit(kind, mime) {
360
367
  if (kind === "asset" && mime.startsWith("video/")) {
361
- return PROJECT_LIMITS.bytes.video;
368
+ return SPACE_LIMITS.bytes.video;
362
369
  }
363
- return PROJECT_LIMITS.bytes[kind];
370
+ return SPACE_LIMITS.bytes[kind];
364
371
  }
@@ -45,12 +45,17 @@ export declare const STORE_LIMITS: {
45
45
  /** Kinds of accounts a wizard can ask the person to connect. */
46
46
  export declare const CONNECTION_KINDS: readonly ["mail"];
47
47
  export type ConnectionKind = (typeof CONNECTION_KINDS)[number];
48
- /** An account the person connects: a built-in kind, or one of the project's imported connectors. */
48
+ /** An account the person connects (a built-in kind, or one of the space's imported connectors), or a connection of the space. */
49
49
  export interface ConnectionDef {
50
50
  id: string;
51
51
  kind?: ConnectionKind;
52
- /** Id of an imported connector of the project. */
52
+ /** Id of an imported connector of the space. */
53
53
  connector?: string;
54
+ /**
55
+ * A connection of the space (set up by its admins), by id. The wizard holds no sign-in of its
56
+ * own then: the connection's audience and rules decide, and `policy` has no say.
57
+ */
58
+ spaceConnection?: string;
54
59
  /** Imported connectors: the actions steps may call. Default: every action that only reads. */
55
60
  actions?: string[];
56
61
  /**
@@ -13,15 +13,26 @@ import { type ObjectShape } from "./shape.js";
13
13
  * path without a leading slash reads the row ("name"), one with a slash the whole data. A path
14
14
  * may turn what it reads into words: `map` looks the value up (`{ "true": "im Kühlschrank" }`),
15
15
  * `format` sets it into a text ("{} Min").
16
+ *
17
+ * A chat's view (Work, `show_view`) may also ask: a `Form` of `Field`s, a `Ref` to a thing of the
18
+ * space, a Button that asks the AI. A wizard asks on its pages, so its views take none of them.
16
19
  */
17
- export declare const SURFACE_COMPONENTS: readonly ["Column", "Text", "List", "Row", "DetailGrid", "Badge", "Grid", "Metric", "Table", "Image", "BarChart", "LineChart", "DonutChart", "Actions", "Button", "Tabs", "Card", "Fold", "Group", "Chips", "Checklist", "Steps", "Link", "Callout"];
20
+ export declare const SURFACE_COMPONENTS: readonly ["Column", "Text", "List", "Row", "DetailGrid", "Badge", "Grid", "Metric", "Table", "Image", "BarChart", "LineChart", "DonutChart", "Actions", "Button", "Tabs", "Card", "Fold", "Group", "Chips", "Checklist", "Steps", "Link", "Callout", "Markdown", "Sources", "File", "Video", "Audio", "Gallery", "Ref", "Form", "Field"];
18
21
  export type SurfaceComponentName = (typeof SURFACE_COMPONENTS)[number];
19
- export declare const SURFACE_ACTIONS: readonly ["regenerate", "open"];
22
+ /**
23
+ * The kinds of a Field, the runner's own field kinds (definition.ts FIELD_KINDS) that need
24
+ * nothing of a run: no kept list, connection, line items or free slots.
25
+ */
26
+ export declare const FORM_FIELD_KINDS: readonly ["text", "textarea", "number", "select", "multiselect", "date", "email", "url", "toggle", "color", "image", "file", "location", "audio", "signature"];
27
+ export type FormFieldKind = (typeof FORM_FIELD_KINDS)[number];
28
+ /** `ask` (a chat's view only): the person asks the AI the button's `prompt`, or its label. */
29
+ export declare const SURFACE_ACTIONS: readonly ["regenerate", "open", "ask"];
20
30
  /** One component: its id, its kind, its children (ids, or a template repeated over an array). */
21
31
  export declare const surfaceComponentSchema: z.ZodObject<{
22
32
  id: z.ZodString;
23
33
  component: z.ZodEnum<{
24
34
  Actions: "Actions";
35
+ Audio: "Audio";
25
36
  Badge: "Badge";
26
37
  BarChart: "BarChart";
27
38
  Button: "Button";
@@ -32,19 +43,27 @@ export declare const surfaceComponentSchema: z.ZodObject<{
32
43
  Column: "Column";
33
44
  DetailGrid: "DetailGrid";
34
45
  DonutChart: "DonutChart";
46
+ Field: "Field";
47
+ File: "File";
35
48
  Fold: "Fold";
49
+ Form: "Form";
50
+ Gallery: "Gallery";
36
51
  Grid: "Grid";
37
52
  Group: "Group";
38
53
  Image: "Image";
39
54
  LineChart: "LineChart";
40
55
  Link: "Link";
41
56
  List: "List";
57
+ Markdown: "Markdown";
42
58
  Metric: "Metric";
59
+ Ref: "Ref";
43
60
  Row: "Row";
61
+ Sources: "Sources";
44
62
  Steps: "Steps";
45
63
  Table: "Table";
46
64
  Tabs: "Tabs";
47
65
  Text: "Text";
66
+ Video: "Video";
48
67
  }>;
49
68
  children: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
50
69
  path: z.ZodString;
@@ -56,6 +75,7 @@ export declare const surfaceComponentsSchema: z.ZodArray<z.ZodObject<{
56
75
  id: z.ZodString;
57
76
  component: z.ZodEnum<{
58
77
  Actions: "Actions";
78
+ Audio: "Audio";
59
79
  Badge: "Badge";
60
80
  BarChart: "BarChart";
61
81
  Button: "Button";
@@ -66,19 +86,27 @@ export declare const surfaceComponentsSchema: z.ZodArray<z.ZodObject<{
66
86
  Column: "Column";
67
87
  DetailGrid: "DetailGrid";
68
88
  DonutChart: "DonutChart";
89
+ Field: "Field";
90
+ File: "File";
69
91
  Fold: "Fold";
92
+ Form: "Form";
93
+ Gallery: "Gallery";
70
94
  Grid: "Grid";
71
95
  Group: "Group";
72
96
  Image: "Image";
73
97
  LineChart: "LineChart";
74
98
  Link: "Link";
75
99
  List: "List";
100
+ Markdown: "Markdown";
76
101
  Metric: "Metric";
102
+ Ref: "Ref";
77
103
  Row: "Row";
104
+ Sources: "Sources";
78
105
  Steps: "Steps";
79
106
  Table: "Table";
80
107
  Tabs: "Tabs";
81
108
  Text: "Text";
109
+ Video: "Video";
82
110
  }>;
83
111
  children: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
84
112
  path: z.ZodString;
@@ -96,9 +124,12 @@ export interface SurfaceIssue {
96
124
  /**
97
125
  * What can be wrong with a surface: an unknown or missing component, no root, a child that is
98
126
  * not there, an id twice, a loop, a prop missing, and — given the data keys a run will provide,
99
- * or the step's schema — a path into data nothing provides.
127
+ * or the step's schema — a path into data nothing provides. `chat`: a chat's view, which may ask
128
+ * (one Form, its Fields, Refs, `ask`).
100
129
  */
101
- export declare function validateSurface(raw: unknown, data?: string[] | ObjectShape): SurfaceIssue[];
130
+ export declare function validateSurface(raw: unknown, data?: string[] | ObjectShape, options?: {
131
+ chat?: boolean;
132
+ }): SurfaceIssue[];
102
133
  /** A JSON pointer into data: "/suppliers/0/name". */
103
134
  export declare function pointer(data: unknown, path: string): unknown;
104
135
  /**
@@ -14,6 +14,9 @@ import { shapeAt } from "./shape.js";
14
14
  * path without a leading slash reads the row ("name"), one with a slash the whole data. A path
15
15
  * may turn what it reads into words: `map` looks the value up (`{ "true": "im Kühlschrank" }`),
16
16
  * `format` sets it into a text ("{} Min").
17
+ *
18
+ * A chat's view (Work, `show_view`) may also ask: a `Form` of `Field`s, a `Ref` to a thing of the
19
+ * space, a Button that asks the AI. A wizard asks on its pages, so its views take none of them.
17
20
  */
18
21
  export const SURFACE_COMPONENTS = [
19
22
  "Column",
@@ -40,6 +43,15 @@ export const SURFACE_COMPONENTS = [
40
43
  "Steps",
41
44
  "Link",
42
45
  "Callout",
46
+ "Markdown",
47
+ "Sources",
48
+ "File",
49
+ "Video",
50
+ "Audio",
51
+ "Gallery",
52
+ "Ref",
53
+ "Form",
54
+ "Field",
43
55
  ];
44
56
  /** Components that hold others by id. */
45
57
  const CONTAINERS = new Set([
@@ -50,7 +62,31 @@ const CONTAINERS = new Set([
50
62
  "Card",
51
63
  "Fold",
52
64
  "Group",
65
+ "Form",
53
66
  ]);
67
+ /** Only a chat's view has these: a wizard asks on its pages, and its run has no space to open. */
68
+ const CHAT_ONLY = new Set(["Form", "Field", "Ref"]);
69
+ /**
70
+ * The kinds of a Field, the runner's own field kinds (definition.ts FIELD_KINDS) that need
71
+ * nothing of a run: no kept list, connection, line items or free slots.
72
+ */
73
+ export const FORM_FIELD_KINDS = [
74
+ "text",
75
+ "textarea",
76
+ "number",
77
+ "select",
78
+ "multiselect",
79
+ "date",
80
+ "email",
81
+ "url",
82
+ "toggle",
83
+ "color",
84
+ "image",
85
+ "file",
86
+ "location",
87
+ "audio",
88
+ "signature",
89
+ ];
54
90
  /** The props each component needs. */
55
91
  const REQUIRED = {
56
92
  Text: ["text"],
@@ -73,8 +109,18 @@ const REQUIRED = {
73
109
  Steps: ["items"],
74
110
  Link: ["title", "items", "value", "view"],
75
111
  Callout: ["text"],
112
+ Markdown: ["text"],
113
+ Sources: ["items"],
114
+ File: ["file"],
115
+ Video: ["src"],
116
+ Audio: ["src"],
117
+ Gallery: ["items"],
118
+ Ref: ["title", "open"],
119
+ Form: ["children", "submit"],
120
+ Field: ["name", "kind", "label"],
76
121
  };
77
- export const SURFACE_ACTIONS = ["regenerate", "open"];
122
+ /** `ask` (a chat's view only): the person asks the AI the button's `prompt`, or its label. */
123
+ export const SURFACE_ACTIONS = ["regenerate", "open", "ask"];
78
124
  const id = z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,40}$/, "ids are letters, digits, _ and -");
79
125
  /** One component: its id, its kind, its children (ids, or a template repeated over an array). */
80
126
  export const surfaceComponentSchema = z.looseObject({
@@ -135,6 +181,10 @@ const ENTRY_KEYS = [
135
181
  "groupKey",
136
182
  "textKey",
137
183
  "minutesKey",
184
+ "srcKey",
185
+ "captionKey",
186
+ "titleKey",
187
+ "urlKey",
138
188
  ];
139
189
  /** A path as parts: "/days/0/label" from the data, "meals.slot" from the entry. */
140
190
  const partsOf = (path) => (path.startsWith("/") ? path.slice(1) : path)
@@ -288,9 +338,10 @@ function shapeIssues(byId, root) {
288
338
  /**
289
339
  * What can be wrong with a surface: an unknown or missing component, no root, a child that is
290
340
  * not there, an id twice, a loop, a prop missing, and — given the data keys a run will provide,
291
- * or the step's schema — a path into data nothing provides.
341
+ * or the step's schema — a path into data nothing provides. `chat`: a chat's view, which may ask
342
+ * (one Form, its Fields, Refs, `ask`).
292
343
  */
293
- export function validateSurface(raw, data) {
344
+ export function validateSurface(raw, data, options = {}) {
294
345
  const dataKeys = Array.isArray(data) ? data : undefined;
295
346
  const parsed = surfaceComponentsSchema.safeParse(raw);
296
347
  if (!parsed.success) {
@@ -308,6 +359,7 @@ export function validateSurface(raw, data) {
308
359
  if (!byId.has("root")) {
309
360
  issues.push({ message: 'A surface has a component with id "root".' });
310
361
  }
362
+ issues.push(...askIssues(components, byId, Boolean(options.chat)));
311
363
  for (const c of components) {
312
364
  for (const prop of REQUIRED[c.component] ?? []) {
313
365
  if (c[prop] === undefined) {
@@ -370,6 +422,72 @@ export function validateSurface(raw, data) {
370
422
  }
371
423
  return data && !Array.isArray(data) ? [...issues, ...shapeIssues(byId, data)] : issues;
372
424
  }
425
+ /** What a view may ask, and how: a chat's only, one Form, its Fields in it and named once. */
426
+ function askIssues(components, byId, chat) {
427
+ const issues = [];
428
+ if (!chat) {
429
+ for (const c of components) {
430
+ if (CHAT_ONLY.has(c.component)) {
431
+ issues.push({
432
+ message: `${c.component} "${c.id}" is for a chat's view; a wizard asks on its pages.`,
433
+ });
434
+ }
435
+ if (c.action === "ask") {
436
+ issues.push({ message: `"${c.id}": "ask" is for a chat's view.` });
437
+ }
438
+ }
439
+ return issues;
440
+ }
441
+ const forms = components.filter((c) => c.component === "Form");
442
+ if (forms.length > 1) {
443
+ issues.push({ message: "A view holds at most one Form." });
444
+ }
445
+ const inForm = new Set();
446
+ for (const form of forms) {
447
+ const kids = Array.isArray(form.children) ? form.children : [];
448
+ if (!Array.isArray(form.children)) {
449
+ issues.push({ message: `Form "${form.id}" names its Fields: children [ids].` });
450
+ }
451
+ const names = new Set();
452
+ for (const kid of kids) {
453
+ const field = byId.get(kid);
454
+ if (field && field.component !== "Field") {
455
+ issues.push({ message: `Form "${form.id}" holds Fields only, not ${field.component}.` });
456
+ }
457
+ inForm.add(kid);
458
+ const name = field?.name;
459
+ if (typeof name === "string") {
460
+ if (names.has(name)) {
461
+ issues.push({ message: `Form "${form.id}" names the field "${name}" twice.` });
462
+ }
463
+ names.add(name);
464
+ }
465
+ }
466
+ }
467
+ for (const c of components) {
468
+ if (c.component !== "Field") {
469
+ continue;
470
+ }
471
+ const f = c;
472
+ if (!inForm.has(c.id)) {
473
+ issues.push({ message: `Field "${c.id}" sits in a Form.` });
474
+ }
475
+ if (typeof f.kind === "string" && !FORM_FIELD_KINDS.includes(f.kind)) {
476
+ issues.push({
477
+ message: `Field "${c.id}": kind is one of ${FORM_FIELD_KINDS.join(", ")}.`,
478
+ });
479
+ }
480
+ const options = f.options;
481
+ if ((f.kind === "select" || f.kind === "multiselect") &&
482
+ !(Array.isArray(options) && options.length && options.every((o) => typeof o === "string"))) {
483
+ issues.push({ message: `Field "${c.id}" (${f.kind}) needs "options": [texts].` });
484
+ }
485
+ if (typeof f.name === "string" && !/^[a-zA-Z][a-zA-Z0-9_]{0,40}$/.test(f.name)) {
486
+ issues.push({ message: `Field "${c.id}": name is letters, digits and _.` });
487
+ }
488
+ }
489
+ return issues;
490
+ }
373
491
  /** A JSON pointer into data: "/suppliers/0/name". */
374
492
  export function pointer(data, path) {
375
493
  let at = data;
@@ -106,7 +106,7 @@ export interface SyncOverview {
106
106
  schema: string;
107
107
  role: string;
108
108
  limits: {
109
- projects: number | null;
109
+ spaces: number | null;
110
110
  };
111
111
  spaces: {
112
112
  id: string;
@@ -1,4 +1,4 @@
1
- import { luminance } from "./projects.js";
1
+ import { luminance } from "./spaces.js";
2
2
  import { BUILT_IN_THEMES, SHIPPED_FONTS, themeColors, themeOffered, } from "./theme.js";
3
3
  // --- the look of a run ---------------------------------------------------------------------
4
4
  // Which theme a wizard's pages show and how they look with it: the theme over the space's
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * A wizard as a file, `<title>.wizard`: a zip with `wizard.json` — the definition and what it
4
- * needs from its project, with the space's themes it names — and the workspace under `files/`. What belongs to people (runs, lists, connected
5
- * accounts) and to the project (brand, credentials) stays where it is.
4
+ * needs from its space, with the space's themes it names — and the workspace under `files/`. What belongs to people (runs, lists, connected
5
+ * accounts) and to the space (brand, credentials) stays where it is.
6
6
  */
7
7
  export declare const PACKAGE_FORMAT = "engenty-wizard";
8
8
  export declare const PACKAGE_MANIFEST = "wizard.json";
@@ -4,8 +4,8 @@ import { DEFINITION_VERSION } from "./definition.js";
4
4
  import { MAX_WIZARD_THEMES, themeSchema } from "./theme.js";
5
5
  /**
6
6
  * A wizard as a file, `<title>.wizard`: a zip with `wizard.json` — the definition and what it
7
- * needs from its project, with the space's themes it names — and the workspace under `files/`. What belongs to people (runs, lists, connected
8
- * accounts) and to the project (brand, credentials) stays where it is.
7
+ * needs from its space, with the space's themes it names — and the workspace under `files/`. What belongs to people (runs, lists, connected
8
+ * accounts) and to the space (brand, credentials) stays where it is.
9
9
  */
10
10
  export const PACKAGE_FORMAT = "engenty-wizard";
11
11
  export const PACKAGE_MANIFEST = "wizard.json";
@@ -45,6 +45,6 @@ export const manifestSchema = z.object({
45
45
  .default([]),
46
46
  /** The space's themes the wizard names: a wizard file ships its looks with it. */
47
47
  themes: z.array(themeSchema).max(MAX_WIZARD_THEMES).default([]),
48
- /** The project's pages under `files/knowledge/`, when they were asked for: how many, and whether the cap cut some. */
48
+ /** The space's pages under `files/knowledge/`, when they were asked for: how many, and whether the cap cut some. */
49
49
  knowledge: z.object({ pages: z.number().int(), truncated: z.boolean() }).optional(),
50
50
  });