@engenty/wizards-runtime 0.14.2 → 0.16.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 (263) hide show
  1. package/apps/runtime/dist/agents/studio-assistant.js +180 -4
  2. package/apps/runtime/dist/agents/website.js +10 -5
  3. package/apps/runtime/dist/app.js +27 -2
  4. package/apps/runtime/dist/auth/index.js +5 -0
  5. package/apps/runtime/dist/broker/account.js +5 -0
  6. package/apps/runtime/dist/broker/call.js +2 -0
  7. package/apps/runtime/dist/broker/host.js +1 -0
  8. package/apps/runtime/dist/broker/index.js +5 -0
  9. package/apps/runtime/dist/broker/rwx.js +293 -11
  10. package/apps/runtime/dist/cli/main.js +7 -0
  11. package/apps/runtime/dist/cli/move-files.js +68 -0
  12. package/apps/runtime/dist/cli/move-folder-sources.js +120 -0
  13. package/apps/runtime/dist/connectors/plugin-connections.js +74 -4
  14. package/apps/runtime/dist/db/migrations/tenant/0040_rwx_elements.sql +21 -0
  15. package/apps/runtime/dist/db/migrations/tenant/0041_broker_log_client.sql +1 -0
  16. package/apps/runtime/dist/db/migrations/tenant/0042_client_spaces.sql +16 -0
  17. package/apps/runtime/dist/db/migrations/tenant/0043_space_member_invite.sql +19 -0
  18. package/apps/runtime/dist/db/migrations/tenant/0044_client_portal.sql +8 -0
  19. package/apps/runtime/dist/db/migrations/tenant/0045_client_portal_no_slug.sql +2 -0
  20. package/apps/runtime/dist/db/migrations/tenant/0046_space_file_hash.sql +2 -0
  21. package/apps/runtime/dist/db/migrations/tenant/0047_knowledge_folders.sql +3 -0
  22. package/apps/runtime/dist/db/migrations/tenant/0048_space_chunk_kind.sql +1 -0
  23. package/apps/runtime/dist/db/migrations/tenant/0049_knowledge_sources.sql +57 -0
  24. package/apps/runtime/dist/db/migrations/tenant/0050_dateien.sql +71 -0
  25. package/apps/runtime/dist/db/migrations/tenant/0051_dateien_drafts.sql +23 -0
  26. package/apps/runtime/dist/db/migrations/tenant/0052_dateien_plugin_kinds.sql +5 -0
  27. package/apps/runtime/dist/db/migrations/tenant/0053_dateien_file_title.sql +3 -0
  28. package/apps/runtime/dist/db/migrations/tenant/0054_dateien_ocr.sql +14 -0
  29. package/apps/runtime/dist/db/migrations/tenant/0055_dateien_doc_reread.sql +3 -0
  30. package/apps/runtime/dist/db/migrations/tenant/meta/0040_snapshot.json +5153 -0
  31. package/apps/runtime/dist/db/migrations/tenant/meta/0041_snapshot.json +5160 -0
  32. package/apps/runtime/dist/db/migrations/tenant/meta/0042_snapshot.json +5286 -0
  33. package/apps/runtime/dist/db/migrations/tenant/meta/0043_snapshot.json +5293 -0
  34. package/apps/runtime/dist/db/migrations/tenant/meta/0044_snapshot.json +5344 -0
  35. package/apps/runtime/dist/db/migrations/tenant/meta/0045_snapshot.json +5329 -0
  36. package/apps/runtime/dist/db/migrations/tenant/meta/0046_snapshot.json +5343 -0
  37. package/apps/runtime/dist/db/migrations/tenant/meta/0047_snapshot.json +5391 -0
  38. package/apps/runtime/dist/db/migrations/tenant/meta/0048_snapshot.json +5398 -0
  39. package/apps/runtime/dist/db/migrations/tenant/meta/0049_snapshot.json +5793 -0
  40. package/apps/runtime/dist/db/migrations/tenant/meta/0050_snapshot.json +6288 -0
  41. package/apps/runtime/dist/db/migrations/tenant/meta/0051_snapshot.json +6461 -0
  42. package/apps/runtime/dist/db/migrations/tenant/meta/0052_snapshot.json +6497 -0
  43. package/apps/runtime/dist/db/migrations/tenant/meta/0053_snapshot.json +6504 -0
  44. package/apps/runtime/dist/db/migrations/tenant/meta/0054_snapshot.json +6504 -0
  45. package/apps/runtime/dist/db/migrations/tenant/meta/0055_snapshot.json +6504 -0
  46. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +112 -0
  47. package/apps/runtime/dist/db/schema.js +296 -5
  48. package/apps/runtime/dist/docs/dev/api.md +49 -2
  49. package/apps/runtime/dist/docs/dev/architecture.md +13 -2
  50. package/apps/runtime/dist/docs/dev/plugins/connections.md +30 -2
  51. package/apps/runtime/dist/docs/dev/plugins/index.md +1 -1
  52. package/apps/runtime/dist/docs/dev/plugins/reference.md +7 -4
  53. package/apps/runtime/dist/docs/dev/plugins/server.md +11 -5
  54. package/apps/runtime/dist/docs/dev/plugins/space.md +130 -4
  55. package/apps/runtime/dist/docs/dev/plugins/studio.md +13 -3
  56. package/apps/runtime/dist/docs/user-guide/command-line.md +2 -0
  57. package/apps/runtime/dist/docs/user-guide/plugins.md +1 -1
  58. package/apps/runtime/dist/docs/user-guide/space.md +6 -6
  59. package/apps/runtime/dist/docs/user-guide/steps.md +1 -1
  60. package/apps/runtime/dist/documents/ocr.js +72 -0
  61. package/apps/runtime/dist/documents/parse.js +81 -12
  62. package/apps/runtime/dist/elements/caller.js +47 -0
  63. package/apps/runtime/dist/elements/catalogue.js +14 -0
  64. package/apps/runtime/dist/elements/connections.js +60 -0
  65. package/apps/runtime/dist/elements/gate.js +81 -0
  66. package/apps/runtime/dist/elements/knowledge.js +308 -0
  67. package/apps/runtime/dist/elements/outside.js +103 -0
  68. package/apps/runtime/dist/elements/specs.js +102 -0
  69. package/apps/runtime/dist/elements/wizards.js +72 -0
  70. package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +3 -0
  71. package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +3 -0
  72. package/apps/runtime/dist/engenty/connections-s3/s3.js +6 -0
  73. package/apps/runtime/dist/engine/runner.js +19 -2
  74. package/apps/runtime/dist/engine/steps.js +1 -1
  75. package/apps/runtime/dist/env.js +11 -2
  76. package/apps/runtime/dist/files/blobs.js +57 -1
  77. package/apps/runtime/dist/files/objects.js +1 -0
  78. package/apps/runtime/dist/files/pictures.js +41 -0
  79. package/apps/runtime/dist/files/storage.js +14 -26
  80. package/apps/runtime/dist/files/thumbs.js +77 -0
  81. package/apps/runtime/dist/files/upload-check.js +2 -2
  82. package/apps/runtime/dist/index.js +22 -0
  83. package/apps/runtime/dist/live/views.js +2 -1
  84. package/apps/runtime/dist/manage.js +4 -1
  85. package/apps/runtime/dist/mcp/elements.js +88 -0
  86. package/apps/runtime/dist/mcp/handler.js +2 -0
  87. package/apps/runtime/dist/mcp/scopes.js +5 -0
  88. package/apps/runtime/dist/mcp/tools.js +5 -0
  89. package/apps/runtime/dist/models.js +82 -13
  90. package/apps/runtime/dist/mounts/cache.js +71 -0
  91. package/apps/runtime/dist/mounts/drafts.js +367 -0
  92. package/apps/runtime/dist/mounts/folder.js +148 -0
  93. package/apps/runtime/dist/mounts/mounts.js +1315 -0
  94. package/apps/runtime/dist/mounts/source.js +179 -0
  95. package/apps/runtime/dist/mounts/units.js +97 -0
  96. package/apps/runtime/dist/move-files.js +4 -0
  97. package/apps/runtime/dist/plugins/loader.js +73 -1
  98. package/apps/runtime/dist/plugins/registry.js +2 -0
  99. package/apps/runtime/dist/prompts/authoring.md +2 -2
  100. package/apps/runtime/dist/prompts/goose.md +13 -1
  101. package/apps/runtime/dist/prompts/tools.md +8 -2
  102. package/apps/runtime/dist/render/convert.js +188 -1
  103. package/apps/runtime/dist/routes/api.js +7 -2
  104. package/apps/runtime/dist/routes/client-contract.js +164 -0
  105. package/apps/runtime/dist/routes/client-spaces.js +58 -0
  106. package/apps/runtime/dist/routes/dateien.js +173 -0
  107. package/apps/runtime/dist/routes/elements.js +76 -0
  108. package/apps/runtime/dist/routes/plugins.js +2 -1
  109. package/apps/runtime/dist/routes/runs.js +24 -10
  110. package/apps/runtime/dist/routes/studio.js +168 -8
  111. package/apps/runtime/dist/secrets/signing.js +16 -0
  112. package/apps/runtime/dist/services/client-portal.js +439 -0
  113. package/apps/runtime/dist/services/client-spaces.js +228 -0
  114. package/apps/runtime/dist/services/cloud.js +2 -0
  115. package/apps/runtime/dist/services/knowledge-model.js +24 -8
  116. package/apps/runtime/dist/services/knowledge.js +72 -42
  117. package/apps/runtime/dist/services/links.js +17 -0
  118. package/apps/runtime/dist/services/members-studio.js +5 -1
  119. package/apps/runtime/dist/services/page-pictures.js +162 -0
  120. package/apps/runtime/dist/services/runs.js +22 -6
  121. package/apps/runtime/dist/services/space-categories.js +41 -5
  122. package/apps/runtime/dist/services/space-data.js +165 -8
  123. package/apps/runtime/dist/services/space-files.js +102 -19
  124. package/apps/runtime/dist/services/space-index.js +384 -41
  125. package/apps/runtime/dist/services/space-origin.js +25 -1
  126. package/apps/runtime/dist/services/space-sources.js +937 -0
  127. package/apps/runtime/dist/services/spaces.js +60 -12
  128. package/apps/runtime/dist/services/synced-spaces.js +10 -1
  129. package/apps/runtime/dist/services/work-ai.js +53 -24
  130. package/apps/runtime/dist/services/work-chats.js +3 -2
  131. package/apps/runtime/dist/services/work-connections.js +2 -2
  132. package/apps/runtime/dist/sharing/index.js +2 -0
  133. package/apps/runtime/dist/store/index.js +29 -8
  134. package/apps/runtime/dist/store/shared-lists.js +30 -17
  135. package/apps/runtime/dist/sync/records.js +22 -27
  136. package/apps/runtime/dist/texts.js +4 -0
  137. package/apps/runtime/dist/tools/index.js +5 -4
  138. package/apps/runtime/dist/tools/pages.js +1 -1
  139. package/apps/runtime/dist/tools/skills.js +80 -54
  140. package/apps/runtime/dist/tools/space.js +8 -152
  141. package/apps/runtime/dist/widgets/step.js +2 -1
  142. package/apps/web/dist/assets/AboutDialog-0q4P80yv.js +1 -0
  143. package/apps/web/dist/assets/BlockEditor-CUYFH_CU.js +173 -0
  144. package/apps/web/dist/assets/BlockEditor-CtW6lw0y.css +1 -0
  145. package/apps/web/dist/assets/CapabilitiesPage-BlZP8DYb.js +2 -0
  146. package/apps/web/dist/assets/{ChangelogDialog-D_dQOMIq.js → ChangelogDialog-CDN7kMs1.js} +1 -1
  147. package/apps/web/dist/assets/{CodeEditor-nxoOt8ge.js → CodeEditor-D-Y16fdk.js} +1 -1
  148. package/apps/web/dist/assets/EditorPage-CrMVsgUt.js +3 -0
  149. package/apps/web/dist/assets/{FlowPreview-aMfwcPul.js → FlowPreview-DXnk7m9P.js} +1 -1
  150. package/apps/web/dist/assets/{LangSwitch-DpD0inR4.js → LangSwitch-Dkd0FBIH.js} +1 -1
  151. package/apps/web/dist/assets/Marketplace-Cty40VwG.js +2 -0
  152. package/apps/web/dist/assets/NewWizardChannels-Czool7s1.js +1 -0
  153. package/apps/web/dist/assets/NewWizardPage-CfVe_4a2.js +7 -0
  154. package/apps/web/dist/assets/OnboardingPage-D3SEpTmt.js +1 -0
  155. package/apps/web/dist/assets/PreviewPane-CQDKQO6z.js +7 -0
  156. package/apps/web/dist/assets/PublicRunner-BDZNnlQw.js +1 -0
  157. package/apps/web/dist/assets/ReadOnly-B7MUySpC.js +1 -0
  158. package/apps/web/dist/assets/SettingsPage-Bgurv3l2.js +2 -0
  159. package/apps/web/dist/assets/SetupPage-C3km8vqv.js +1 -0
  160. package/apps/web/dist/assets/{SharePage-N80EhoD7.js → SharePage-UwEJBIzq.js} +1 -1
  161. package/apps/web/dist/assets/SkillEditor-BaEiqqXl.js +1 -0
  162. package/apps/web/dist/assets/Skills-Bv6XbKxc.js +9 -0
  163. package/apps/web/dist/assets/SpacePage-D9PXLSU_.js +2 -0
  164. package/apps/web/dist/assets/UpdateCheck-C7I43zFZ.js +2 -0
  165. package/apps/web/dist/assets/changelog-DwgWiSZb.js +1 -0
  166. package/apps/web/dist/assets/circle-check-DDLzlcXP.js +1 -0
  167. package/apps/web/dist/assets/code-DsnwzN1x.js +1 -0
  168. package/apps/web/dist/assets/code-editor-Ca5EAxmd.js +2 -0
  169. package/apps/web/dist/assets/code-xml-S4IFi5Jc.js +1 -0
  170. package/apps/web/dist/assets/connection-sign-in-hI3HXhq4.js +1 -0
  171. package/apps/web/dist/assets/{dist-H1UN89OA.js → dist-B3Ray2U5.js} +1 -1
  172. package/apps/web/dist/assets/dist-CQpLJoQZ.js +10 -0
  173. package/apps/web/dist/assets/{dist-GlRRx9Xl.js → dist-D1uGQ_tB.js} +1 -1
  174. package/apps/web/dist/assets/{dist-BdDd1FxP.js → dist-DFI-tsfx.js} +1 -1
  175. package/apps/web/dist/assets/eye-TJSuiHHO.js +1 -0
  176. package/apps/web/dist/assets/floating-ui.dom-pwdNGv4b.js +1 -0
  177. package/apps/web/dist/assets/host-D5hNHbhF.js +125 -0
  178. package/apps/web/dist/assets/i18n-BBzMbGoo.js +55 -0
  179. package/apps/web/dist/assets/index-CyBrvupM.js +10 -0
  180. package/apps/web/dist/assets/index-w-3J3ZJ9.css +1 -0
  181. package/apps/web/dist/assets/{json-CEsfHdlZ.js → json-Ce3iHrtf.js} +1 -1
  182. package/apps/web/dist/assets/link-CPL8pB1P.js +1 -0
  183. package/apps/web/dist/assets/list-checks-DaxmUPqK.js +1 -0
  184. package/apps/web/dist/assets/{markdown-5-I9_izp.js → markdown-hqKQy2pp.js} +1 -1
  185. package/apps/web/dist/assets/marked.esm-DQ7XA7AC.js +67 -0
  186. package/apps/web/dist/assets/oss-credits-BrwV0a4F.js +1 -0
  187. package/apps/web/dist/assets/pdf-Dg-raaUo.js +54 -0
  188. package/apps/web/dist/assets/pdf.worker.min-68CMzziE.js +1 -0
  189. package/apps/web/dist/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
  190. package/apps/web/dist/assets/phone-B4uKDBFq.js +1 -0
  191. package/apps/web/dist/assets/read-aloud-Bfp9_bUY.js +1 -0
  192. package/apps/web/dist/assets/{runners-CyIvJIHr.js → runners-CUpBpSji.js} +1 -1
  193. package/apps/web/dist/assets/scroll-text-BEnPzQEi.js +1 -0
  194. package/apps/web/dist/assets/session-CMQo8P-G.js +2 -0
  195. package/apps/web/dist/assets/table-5B9G3oA6.js +1 -0
  196. package/apps/web/dist/assets/theme-CdX0marK.js +11 -0
  197. package/apps/web/dist/assets/ui-BCfu5sia.js +16 -0
  198. package/apps/web/dist/assets/upload-CAlHC232.js +1 -0
  199. package/apps/web/dist/assets/{useMutation-DEkZhp5c.js → useMutation-1fV4Nnxq.js} +1 -1
  200. package/apps/web/dist/assets/viewers-ChriFcRy.js +2 -0
  201. package/apps/web/dist/assets/volume-2-BqlBtCIJ.js +1 -0
  202. package/apps/web/dist/assets/w3c-keyname-BOAvb0qz.js +1 -0
  203. package/apps/web/dist/assets/xlsx-CuSbHU4R.js +141 -0
  204. package/apps/web/dist/index.html +19 -14
  205. package/apps/web/dist/mcp/flow.html +2 -2
  206. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +223 -4
  207. package/node_modules/@engenty/wizards/dist/plugin/mount.d.ts +123 -0
  208. package/node_modules/@engenty/wizards/dist/plugin/mount.js +7 -0
  209. package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +110 -1
  210. package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +1 -1
  211. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +24 -0
  212. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +24 -0
  213. package/node_modules/@engenty/wizards-shared/dist/knowledge.d.ts +33 -4
  214. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +6 -0
  215. package/node_modules/@engenty/wizards-shared/dist/run.js +12 -0
  216. package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +21 -4
  217. package/node_modules/@engenty/wizards-shared/dist/rwx.js +30 -3
  218. package/node_modules/@engenty/wizards-shared/dist/spaces.d.ts +11 -1
  219. package/node_modules/@engenty/wizards-shared/dist/spaces.js +9 -2
  220. package/node_modules/@engenty/wizards-shared/dist/text-merge.d.ts +6 -0
  221. package/node_modules/@engenty/wizards-shared/dist/text-merge.js +25 -0
  222. package/package.json +3 -1
  223. package/plugin/.claude-plugin/plugin.json +1 -1
  224. package/plugin/README.md +3 -0
  225. package/plugin/plugin.json +1 -1
  226. package/plugin/skills/work-in-space/SKILL.md +16 -0
  227. package/apps/web/dist/assets/AboutDialog-Cag3RJuT.js +0 -1
  228. package/apps/web/dist/assets/CapabilitiesPage-BQYiN0gT.js +0 -2
  229. package/apps/web/dist/assets/EditorPage-C4_8LsQN.js +0 -3
  230. package/apps/web/dist/assets/Marketplace-CpzD9pNQ.js +0 -2
  231. package/apps/web/dist/assets/NewWizardChannels-CcE3UMVb.js +0 -1
  232. package/apps/web/dist/assets/NewWizardPage-BzN7zrQx.js +0 -7
  233. package/apps/web/dist/assets/OnboardingPage-ztHT01ah.js +0 -1
  234. package/apps/web/dist/assets/PreviewPane-BabMbBZI.js +0 -9
  235. package/apps/web/dist/assets/PublicRunner-D-JmtqCi.js +0 -1
  236. package/apps/web/dist/assets/ReadOnly-GAORKKqV.js +0 -1
  237. package/apps/web/dist/assets/SettingsPage-BKAiYmXl.js +0 -2
  238. package/apps/web/dist/assets/SetupPage-C1EZZHIp.js +0 -1
  239. package/apps/web/dist/assets/SkillEditor-CqQMg2MC.js +0 -1
  240. package/apps/web/dist/assets/Skills-CnhpgoOA.js +0 -9
  241. package/apps/web/dist/assets/SpacePage-CRR8JvV1.js +0 -2
  242. package/apps/web/dist/assets/UpdateCheck-CfXZBQNv.js +0 -2
  243. package/apps/web/dist/assets/changelog-6MqC8Vy8.js +0 -1
  244. package/apps/web/dist/assets/circle-alert-C8Ma-bPY.js +0 -1
  245. package/apps/web/dist/assets/circle-check-Bu9Z3mlJ.js +0 -1
  246. package/apps/web/dist/assets/code-editor-CfTGqOpp.js +0 -2
  247. package/apps/web/dist/assets/code-xml-B4kLFZSj.js +0 -1
  248. package/apps/web/dist/assets/connection-sign-in-B2D0O8W-.js +0 -1
  249. package/apps/web/dist/assets/dist-EBVTpvRr.js +0 -10
  250. package/apps/web/dist/assets/eye-BpoKpIdt.js +0 -1
  251. package/apps/web/dist/assets/host-BlKXX7YK.js +0 -118
  252. package/apps/web/dist/assets/i18n-BJ7Ld6O6.js +0 -55
  253. package/apps/web/dist/assets/index-66tE1oti.js +0 -10
  254. package/apps/web/dist/assets/index-D18DvnxX.css +0 -1
  255. package/apps/web/dist/assets/oss-credits-IdX5bc71.js +0 -1
  256. package/apps/web/dist/assets/phone-Ctvf-Am-.js +0 -1
  257. package/apps/web/dist/assets/read-aloud-Da_RSm2S.js +0 -1
  258. package/apps/web/dist/assets/scroll-text-ChrjRu9Y.js +0 -1
  259. package/apps/web/dist/assets/session-SXPtTWRK.js +0 -2
  260. package/apps/web/dist/assets/theme-Br1S0j5h.js +0 -11
  261. package/apps/web/dist/assets/ui-Uqnx1UpK.js +0 -82
  262. package/apps/web/dist/assets/upload-BchUnQGV.js +0 -1
  263. package/apps/web/dist/assets/volume-2-CU_oy81Z.js +0 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Accounts
3
3
  description: Accounts a plugin connects for a space, such as a calendar or a mailbox, through the runtime's built-in connectors.
4
- version: 0.13.0
4
+ version: 0.15.0
5
5
  ---
6
6
 
7
7
  A wizard’s connections belong to the person who runs it. A plugin that works for the whole
@@ -30,10 +30,12 @@ const { events } = await server.connections.call<{ events: unknown[] }>(account.
30
30
  | `server.connections.` | Does |
31
31
  |---|---|
32
32
  | `available(ids)` | Returns the connectors of these ids that a person can connect here now: `{ id, name, auth }`, and for `auth: "api_key"` the `fields` to ask for (`key`, `label`, `placeholder`, `required`, `secret`). An OAuth connector is offered once its client is set up (`GOOGLE_OAUTH_CLIENT_ID` …) or when it registers a client itself. On a local install Google is also offered through the linked engenty account. A connector that takes keys (HubSpot, S3) is always offered |
33
- | `start({ space, connector, actions, lang? })` | Returns the provider’s sign-in page of an OAuth connector. The provider asks only for the rights that `actions` need. `lang` (`"en"` or `"de"`) is the language of the page the person comes back to; without it, the page follows their browser |
33
+ | `start({ space, connector, actions, scopes?, lang? })` | Returns the provider’s sign-in page of an OAuth connector. The provider asks only for the rights that `actions` need, and for `scopes`, rights at the provider for `request` (Drive’s `https://www.googleapis.com/auth/drive` to write, Microsoft’s `Files.Read.All` for SharePoint). `lang` (`"en"` or `"de"`) is the language of the page the person comes back to; without it, the page follows their browser |
34
34
  | `connect({ space, connector, actions, credentials })` | Connects a connector that takes keys. `credentials` holds the keys by field key. The runtime tries them once at the provider and then keeps them sealed. Keys the provider refuses throw an error with the status `400` and the code `credentials`, whose message says what was wrong. Returns the connection |
35
35
  | `list(space)`, `get(id)` | Return what is connected: `{ id, space, connector, label, actions, createdAt }`, the newest first. `label` is the account as the provider names it, often an email address |
36
36
  | `call(id, action, input)` | Runs one of the connector’s actions with the account, through the runtime’s broker. When the token has run out, the runtime fetches a fresh one first. The call carries the run or chat it is made in, and the connection’s rules decide: who may use it, and per kind of action whether it runs, waits for the space’s admins or never runs. From a guest’s run (a wizard at its link, nobody signed in) only actions that read go through; a write or delete throws, and the refusal is logged. A plugin’s own job (a sync, a timer) runs every action the connection was made for |
37
+ | `request(id, { url, method?, headers?, body?, kind?, signal? })` | Sends a request of the plugin’s own to the connector’s service as the account, for what no action does (a drive’s changes, a file’s bytes). See [Requests of the plugin’s own](#requests-of-the-plugins-own) |
38
+ | `scopes(id)` | The rights the provider granted the connection, as it answered the sign-in |
37
39
  | `remove(id)` | Forgets the connection and its tokens |
38
40
 
39
41
  ## Signing in
@@ -67,6 +69,32 @@ window.addEventListener("message", (event) => {
67
69
  words of its answer. If the person removed the connection at the provider, the next call
68
70
  fails this way.
69
71
 
72
+ ## Requests of the plugin’s own
73
+
74
+ A connector’s actions are made for wizards: a search, a file’s text cut at 50 KB. Where a plugin
75
+ needs the service itself, such as a mount of [Dateien](./space.md#a-kind-of-mount) reading a drive’s
76
+ changes and a file’s bytes, `request` sends its own request as the account:
77
+
78
+ ```ts
79
+ const res = await server.connections.request(account.id, {
80
+ url: `https://www.googleapis.com/drive/v3/files/${id}?alt=media`,
81
+ });
82
+ const bytes = new Uint8Array(await res.arrayBuffer());
83
+ ```
84
+
85
+ - Only connectors that take requests do: Google Drive (`https://www.googleapis.com`), OneDrive
86
+ and SharePoint (`https://graph.microsoft.com`), S3 (the endpoint its keys name). A request to
87
+ another address throws.
88
+ - The runtime signs it: a bearer token for a sign-in, renewed where it ran out; a bucket’s keys
89
+ sign it as S3 does (Signature V4).
90
+ - It goes through the broker as `request`, with `kind` (`read` by default, `write`,
91
+ `destructive`) for the connection’s rules and its log. A plugin’s own job runs it.
92
+ - The answer comes back as it is, whatever its status. A `401` is heard as a sign-in that ran
93
+ out.
94
+ - In the cloud it reaches the public internet only. On a local install it reaches the local
95
+ network too, where a person’s own bucket is (a NAS, a MinIO); `connect` checks keys there as
96
+ well. A wizard’s connections stay on the public internet everywhere.
97
+
70
98
  ## Where it is kept
71
99
 
72
100
  A connection a plugin makes is a connection of the space (the table `space_connection` of the
@@ -28,7 +28,7 @@ loads them from their files and loads a plugin again when its files change.
28
28
  | A page of the studio | Behind an icon in the app bar, or at its address | [The studio half](./studio.md) |
29
29
  | A section of the settings | In the settings’ list | [The studio half](./studio.md) |
30
30
  | A section of the space page | In one of its parts, below the part’s own sections | [The studio half](./studio.md#the-space) |
31
- | A part of the space page | In the space’s menu, beside Info, Brand, Knowledge, Data and Results | [The studio half](./studio.md#a-part-of-the-plugins-own) |
31
+ | A part of the space page | In the space’s menu, beside Info, Brand, Knowledge, Memory and Results | [The studio half](./studio.md#a-part-of-the-plugins-own) |
32
32
 
33
33
  ## Two halves
34
34
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Reference
3
3
  description: Every call, type, address and setting of the plugin framework on one page.
4
- version: 0.5.0
4
+ version: 0.15.0
5
5
  ---
6
6
 
7
7
  ## Server half
@@ -37,7 +37,9 @@ The default export is a `WizardsPluginFactory`: `(wizards: WizardsPluginApi) =>
37
37
  | `spaces.brand(space)` | [The space](./space.md#the-spaces-brand). `{ name, colors, fonts }` of the space, or `null` |
38
38
  | `registerAssistantTool(tool: PluginAssistantTool)` | [The space](./space.md#tools-of-the-space-assistant) |
39
39
  | `index.put({ space, key, title, text, link? })`, `index.remove(space, key?)` | [The space](./space.md#the-search-index) |
40
- | `spaceData.putCategories`, `.putPage`, `.putTable`, `.putFile`, `.putDocument`, `.list`, `.readPages`, `.files`, `.readFile`, `.remove`, `.summarize` | [The space](./space.md#knowledge-a-plugin-writes). Knowledge of a space: pages, tables and files under keys of the plugin’s own, with their categories; and the space’s own pages and files to read |
40
+ | `spaceData.putCategories`, `.putPage`, `.putTable`, `.putFile`, `.putDocument`, `.list`, `.readPages`, `.files`, `.readFile`, `.remove`, `.summarize` | [The space](./space.md#knowledge-a-plugin-writes). Knowledge of a space: pages, tables and files under keys of the plugin’s own, with their categories, a page’s pictures copied into the space; and the space’s own pages and files to read |
41
+ | `registerKnowledgeSource`, `knowledgeSources.list`, `.byToken`, `.run`, `.addEntries` | [The space](./space.md#a-source-of-knowledge). A kind of source of Knowledge (a website, a sitemap) and its reader; each source fills a folder of its own and is read again on its schedule |
42
+ | `registerMountKind`, `mounts.list`, `.changed` | [The space](./space.md#a-kind-of-mount). A kind of mount of Dateien (a bucket, a drive’s folder) and its reader; its mounts are indexed where they live |
41
43
  | `registerHttpRoute(route: PluginRoute)` | [Routes](./routes.md) |
42
44
  | `registerPublicRoute(route: PluginPublicRoute)` | [Routes](./routes.md#public-routes) |
43
45
  | `publicUrl(path): Promise<string>` | The full address of a public route for the current tenant |
@@ -53,7 +55,7 @@ The default export is a `WizardsPluginFactory`: `(wizards: WizardsPluginApi) =>
53
55
  | `documents.parse({ data, name, mime }, { signal? })` | [Documents](./server.md#documents). `{ markdown, pages }` |
54
56
  | `getTenantDb(): PluginDb` | The current tenant’s database, a Drizzle libSQL database |
55
57
  | `generate(request): Promise<{ text, object }>` | Asks a model of the current tenant: `prompt`, `system?`, `schema?`, `model?`, `maxOutputTokens?`, `signal?`, `files?` (pictures and PDFs: `{ data, mediaType, name? }[]`). See [The server half](./server.md#asking-a-model) |
56
- | `connections.available(ids)`, `.start({ space, connector, actions, lang? })`, `.connect({ space, connector, actions, credentials })`, `.list(space)`, `.get(id)`, `.call(id, action, input)`, `.remove(id)` | [Accounts](./connections.md). `lang`: the language of the page the person comes back to |
58
+ | `connections.available(ids)`, `.start({ space, connector, actions, scopes?, lang? })`, `.connect({ space, connector, actions, credentials })`, `.list(space)`, `.get(id)`, `.call(id, action, input)`, `.request(id, { url, method?, headers?, body?, kind? })`, `.scopes(id)`, `.remove(id)` | [Accounts](./connections.md). `lang`: the language of the page the person comes back to; `request`: the plugin’s own request to the service as the account |
57
59
  | `secrets.seal(value): string`, `secrets.unseal(sealed)` | [Keys of the plugin’s own](./server.md#keys-of-the-plugins-own). `unseal` gives null for a value sealed on another install |
58
60
  | `registerAssistantContext({ block })` | [The space](./space.md#the-assistant-on-the-plugins-own-page). `block(space): string \| null` |
59
61
  | `registerStarter(starter: PluginStarter)` | [Starters](./starters.md). Known as `<plugin id>.<starter id>` |
@@ -255,7 +257,8 @@ The default export is a `StudioPlugin`: `(studio: StudioPluginContext) => void`.
255
257
  | `studio.registerShareSection({ runner, component })` | [Runners](./runners.md#the-runners-part-of-the-share-dialog). The runner’s own settings for a wizard (a keyword), under the share dialog’s gear once it is switched on and set up. `component` gets `{ wizard: { id, title } }` |
256
258
  | `studio.registerShareSetup({ runner, title, component, notice? })` | [Runners](./runners.md#setting-up-inside-the-dialog). What “Set up” in the runner’s row opens inside the share dialog. `component` gets `{ wizard, Actions, done(banner?) }`, `notice` `{ wizard, open }` |
257
259
  | `studio.registerAssistantCard({ tool, component })` | Draws a tool’s result in the space assistant’s chat. `component` gets `{ data, send }` |
258
- | `studio.registerSpaceSection({ id, group?, label, hint?, component })` | A section of a part of the space page at `/studio/space/<group>#<id>`; `group`: `info`, `knowledge` (default), `data` or `results` |
260
+ | `studio.registerSpaceSection({ id, group?, label, hint?, component, status?, icon?, grouped?, add? })` | A section of a part of the space page at `/studio/space/<group>#<id>`; `group`: `info`, `knowledge` (default), `data` or `results`. `status`: a line on Knowledge’s overview above its items, while the section is busy. `icon`: its row in the menu. `grouped: false`: the row without the plugin’s name above it. `add`: `{ label, hint?, icon? }`, an entry of Knowledge’s „Hinzufügen“ that opens the section |
261
+ | `studio.registerMountKind({ kind, label, icon, place, form, hint?, allowWrite? })` | [The space](./space.md#a-kind-of-mount). A kind of mount in Dateien’s „Einbinden“. `form` gets `{ space, onChange }` and calls `onChange({ source, name } \| null)`; `allowWrite({ space, source })` resolves `true` once the account may write |
259
262
  | `studio.registerSpacePart({ id, label, icon, after?, component })` | [A part of the plugin’s own](./studio.md#a-part-of-the-plugins-own) at `/studio/space/<id>`, after `info`, `knowledge` or `data` (default) in the menu |
260
263
  | `studio.useSpaceMenu(entries)` | A hook in a plugin’s part: its menu, `{ id, label, icon? }[]`, each jumping to the element with that id |
261
264
  | `studio.useCrumbs(items)` | A hook: the trail in the top bar for the page shown, `{ label, to? }[]`, instead of a heading of the page’s own |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: The server half
3
3
  description: The function a plugin exports, what it is handed, and the rules it runs under.
4
- version: 0.9.6
4
+ version: 0.15.0
5
5
  ---
6
6
 
7
7
  The server half is a file whose default export is a function. The runtime calls it once when the
@@ -216,7 +216,7 @@ server.every("refresh", 60 * 60_000, async ({ tenantId, lastRun, signal }) => {
216
216
 
217
217
  ```ts
218
218
  const page = await server.web.read("https://example.com/preise");
219
- // { url, status, etag, lastModified, title, description, text, links, jsonld }
219
+ // { url, status, etag, lastModified, title, description, text, content, images, links, jsonld }
220
220
 
221
221
  const res = await server.web.fetch(`${origin}/sitemap.xml`, {
222
222
  headers: { "if-none-match": source.etag ?? "" },
@@ -225,9 +225,15 @@ const res = await server.web.fetch(`${origin}/sitemap.xml`, {
225
225
 
226
226
  - Both refuse addresses of the computer the runtime runs on and of its local network, after a
227
227
  redirect too, as the runtime’s own requests do.
228
- - `read` gives the page’s text as Markdown and its links, absolute and each once (up to
229
- 2,000). A page with hardly any text without its scripts is drawn in a browser first. `etag`
230
- and `lastModified` are what the server sent, for asking later whether the page changed. `jsonld`
228
+ - `read` gives the page’s whole text as Markdown (`text`), its content without the site’s
229
+ frame (`content`: the main part, without navigation, header and footer, asides, forms, hidden
230
+ menus, skip links and cookie notices) and its links, absolute and each once (up to 2,000). A page with hardly any text without its scripts is drawn in a browser first.
231
+ - `images` are the pictures `content` shows, each once, as `{ url, alt }`: absolute, the
232
+ largest `srcset` entry up to 2,000 px (or what a lazy loader keeps in `data-src`), without
233
+ icons, sprites, drawings (SVG) and pictures drawn under 200 px. `text` and `content` show
234
+ them at the same addresses; `spaceData.putPage` takes them as `images` and the space keeps
235
+ [copies](./space.md#pictures-of-a-page).
236
+ - `etag` and `lastModified` are what the server sent, for asking later whether the page changed. `jsonld`
231
237
  is the page’s structured data (its `application/ld+json` blocks, parsed): a shop’s product
232
238
  page says title, price, availability and image there exactly, without a model.
233
239
  - `fetch` is `fetch` behind the guard: for a sitemap, `robots.txt`, a question with
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: The space
3
- description: Knowledge a plugin writes, a block and tools for every AI step of a space, texts in its search index, tools and cards of its assistant.
4
- version: 0.5.0
3
+ description: Knowledge a plugin writes, kinds of mounts of Dateien, a block and tools for every AI step of a space, texts in its search index, tools and cards of its assistant.
4
+ version: 0.15.0
5
5
  ---
6
6
 
7
7
  A space holds what all its wizards share: a name, its brand (logos, colours, fonts), facts, and
@@ -45,12 +45,12 @@ const doc = await server.spaceData.putDocument({ space, key, label, name, mime,
45
45
  | `server.spaceData.` | Does |
46
46
  |---|---|
47
47
  | `putCategories({ space, categories, proposed? })` | Adds categories, or values to known ones. Types: `choice` (with `values`, `multiple`, `ordered`), `date`, `number` (with `unit`), `text`, `boolean`. `column: { table, column }` takes a category’s values from a column of a table the plugin wrote |
48
- | `putPage(input)` | A page: `title`, `markdown`, `parent` (the key of a page to stand under), `original` (the file it was read from), `categories`, `fill`, `review` (why a person should look) |
48
+ | `putPage(input)` | A page: `title`, `markdown`, `parent` (the key of a page to stand under), `original` (the file it was read from), `categories`, `fill`, `review` (why a person should look), `images` (the pictures it shows, [copied into the space](#pictures-of-a-page)) |
49
49
  | `putTable(input)` | A table: typed `columns`, `rows` (cells by column id, they replace the rows the key had), `format: "faq"` |
50
50
  | `putFile(input)` | A file that is not a page. It is found by its name, `description` and categories; `text` is what a step reads of it |
51
51
  | `putDocument(input)` | A file, read the way an upload is. Returns what it became: `items` (pages, tables), and `review` when it was hard to read or could not be read |
52
52
  | `readPages(space, { parent? })` | The space’s own pages, whoever wrote them, with their Markdown: `{ id, title, path, parentId, markdown, origin, originKey, updatedAt }` |
53
- | `files(space, kind?)`, `readFile(space, id)` | The space’s files of a kind (`document`, `logo`, `asset`, `pattern`; `document` when none is named), newest first, and one file with its bytes, such as a price list someone dropped into Knowledge |
53
+ | `files(space, kind?)`, `readFile(space, id)` | The space’s files of a kind (`document`, `logo`, `asset`, `pattern`, `picture`; `document` when none is named), newest first, and one file with its bytes, such as a price list someone dropped into Knowledge |
54
54
  | `list(space)` | Everything the plugin wrote, by key, with its path and `state` |
55
55
  | `remove(space, key?)` | Takes out one key, or everything the plugin wrote in the space. Returns how many items it removed |
56
56
  | `summarize(space, category?, value?)` | Writes the “Overview” of one value, or of every value with three items or more. Each costs a model call. Returns how many it wrote |
@@ -60,6 +60,132 @@ const doc = await server.spaceData.putDocument({ space, key, label, name, mime,
60
60
  and changes nothing, and `remove` leaves it.
61
61
  - What a step reads of an item is its path: `pages/…`, `tables/…`, `files/…`.
62
62
 
63
+ ### Pictures of a page
64
+
65
+ A page read from the web shows pictures from the web. A wizard can’t find them by what they show
66
+ or put them into what it makes (a generated page loads nothing from the network), and they break
67
+ when the site changes. With `images` the space keeps a copy of each:
68
+
69
+ ```ts
70
+ const page = await server.web.read(address);
71
+ await server.spaceData.putPage({
72
+ space,
73
+ key: address,
74
+ title: page.title,
75
+ markdown: page.content,
76
+ images: page.images, // [{ url, alt }]
77
+ });
78
+ ```
79
+
80
+ - Each picture is fetched once: at most 30 per page and 8 MB each; icons, SVG drawings and
81
+ pictures under 10 KB or 200 px stay as they were. The same picture on many pages (the same
82
+ address, or the same bytes) is one copy.
83
+ - The Markdown points at the copy: `![alt](https://…)` becomes `![alt](asset://ID)`. A picture
84
+ of `images` the Markdown doesn’t show is added at its end. The copy is a file of the kind
85
+ `picture` whose `source` is the address it came from.
86
+ - The search finds a copy by what it shows (where the embedding model sees pictures; elsewhere by
87
+ its `alt` and a sentence a model writes about it) and opens its page. It is no item of the
88
+ plugin’s own: `list` leaves it out.
89
+ - A copy no page of the space shows any more goes with the plugin’s next `putPage` or `remove`
90
+ of the page that showed it.
91
+ - While the switch `knowledgeMedia` is off, `images` is left aside and the Markdown stays as it
92
+ came.
93
+
94
+ ## A source of Knowledge
95
+
96
+ A source fills a folder of Knowledge from outside the space and keeps it current: a website, a
97
+ sitemap, a list of addresses. The core keeps each source’s row, its entries, its runs and its
98
+ folder; a plugin brings a kind of source and its reader with `server.registerKnowledgeSource`.
99
+ Behind the studio’s `knowledgeTree` switch, its kinds show under „Quellen“ in Knowledge’s
100
+ „Hinzufügen“ dialog and in the assistant’s proposals.
101
+
102
+ ```ts
103
+ server.registerKnowledgeSource({
104
+ kind: "sitemap",
105
+ // What a person names, as this kind; null when it is not one.
106
+ match: (address) => (/\.xml(\?|$)/i.test(address) ? address : null),
107
+ rules: [{ pattern: "impressum", reason: "Impressum" }],
108
+ everyHours: 24,
109
+ fill: true,
110
+ reader: {
111
+ async list(source, { signal }) {
112
+ const urls = await readSitemap(source.address, signal);
113
+ // `path`: where it stands below the source's folder. `fingerprint`: the same again is not read.
114
+ return urls.map((u) => ({
115
+ address: u.loc,
116
+ fingerprint: u.lastmod,
117
+ path: new URL(u.loc).pathname.split("/").filter(Boolean),
118
+ }));
119
+ },
120
+ async read(source, entry, { signal }) {
121
+ const page = await server.web.read(entry.address, { signal });
122
+ return { kind: "page", title: page.title, markdown: page.content, images: page.images };
123
+ },
124
+ },
125
+ });
126
+ ```
127
+
128
+ - **`list`** says what the source holds now, at most 1000 entries. New addresses come in under the
129
+ source’s `rules`; a person’s „leave out“ stays. What is no longer listed goes out of Knowledge.
130
+ - **`read`** gives one entry as a `page` (with `images`, its [pictures](#pictures-of-a-page)), as a `document` (read as an upload is: pages, a table
131
+ per sheet, or a file), as `unchanged`, or as `failed` with a note. `entry.fingerprint` is what it
132
+ was last read with, for asking whether it changed.
133
+ - **`propose`** (optional) runs once, before anything is written: a name, Kategorien and entries
134
+ to leave out, usually from a model that read a sample.
135
+ - **`manual: true`**: entries are added by hand (`knowledgeSources.addEntries`), never listed.
136
+
137
+ Every source writes into a folder of its own, a page named as the source, and an entry’s `path`
138
+ becomes its sub-folders; an entry whose path is a folder of others is that folder’s text. What a
139
+ source wrote has the origin `source:<id>` and is read-only in the studio until a person takes it
140
+ over („Selbst bearbeiten“, which asks first). Renaming or moving a source’s folder keeps it the
141
+ source’s, and a new title becomes the source’s name; writing text into the folder takes it over.
142
+ Removing a source removes what it wrote, but what a person took over. Taken sources are read
143
+ again every `everyHours`, in every tenant that has the plugin.
144
+
145
+ `server.knowledgeSources` reaches the sources of the plugin’s kinds: `list(space?)`,
146
+ `byToken(token)` (the source a signal address names), `run(id)` and `addEntries(id, addresses)`.
147
+
148
+ ## A kind of mount
149
+
150
+ Dateien holds file trees another party owns: a folder on this computer, a bucket, a drive’s
151
+ folder. They are mounted in a space, listed and indexed where they live (no text is kept), found
152
+ by the space’s search and opened on demand. The core brings the computer’s folder; a plugin brings
153
+ other kinds with `server.registerMountKind`, and its studio half the form that connects the
154
+ account and picks the folder (`studio.registerMountKind`, [Studio](./studio.md)). Behind the
155
+ `dateien` switch. A folder of this computer is mounted on a local install only; a plugin’s kinds
156
+ in the cloud too.
157
+
158
+ ```ts
159
+ server.registerMountKind({
160
+ kind: "s3",
161
+ // What the studio's form gave: checked, and what the mount keeps.
162
+ async prepare({ space, source }) {
163
+ const bucket = await reachBucket(source);
164
+ return { source: { connection: source.connection, prefix: bucket.prefix }, name: bucket.name, where: `s3://${bucket.name}/${bucket.prefix}` };
165
+ },
166
+ open: (mount) => new BucketReader(mount.source),
167
+ everyHours: 24,
168
+ });
169
+ ```
170
+
171
+ - **`prepare`** throws, with the reason as its message, where the source can’t be reached; the
172
+ studio shows it. A secret in `source` is sealed first (`server.secrets`).
173
+ - **`open`** gives the mount’s `PluginMountReader`: `list`, `changes`, `read`, `stat`, `write`,
174
+ optional `watch`, `close`. `read` and `stat` get `{ id }`, the source’s id of the file, where an
175
+ entry had one.
176
+ - **Changes.** The runtime asks `changes(cursor)` every `everyHours` (default 1) where the reader
177
+ can’t `watch`, from the cursor it kept in the database, so a restart goes on where it stopped.
178
+ `relist: true` lists the whole tree; once a week it is listed whole anyway.
179
+ `server.mounts.changed(id)` asks now (a signal address, a webhook).
180
+ - **Moves.** An entry with an `id` keeps its row (and its Kategorien) wherever it moves; a file
181
+ gone where the source tells only its id goes with `goneIds`.
182
+ - **Gone or refused.** What the reader throws while listing marks the mount as away, with the
183
+ message; what was found stays found, nothing opens.
184
+ - **`canWrite(mount)`** (optional): false where the account may not write there; the studio
185
+ connects it again with the rights to write before writing is turned on.
186
+
187
+ `server.mounts` reaches the mounts of the plugin’s kinds: `list(space?)` and `changed(id)`.
188
+
63
189
  ## A block for every AI step
64
190
 
65
191
  ```ts
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: The studio half
3
3
  description: Pages, icons in the app bar, sections of the settings and of the space page – written in React, built once, drawn inside the studio.
4
- version: 0.8.0
4
+ version: 0.15.0
5
5
  ---
6
6
 
7
7
  The studio half is `ui/plugin.tsx`. Its default export is a function; the studio calls it after
@@ -87,11 +87,13 @@ export default defineStudioPlugin((studio) => {
87
87
  | `studio.registerPage({ path, component, wide? })` | A page of the studio at `/studio<path>`, inside the studio’s frame. `path` takes `:name` parts. `wide`: the page lays out its own columns and takes the screen’s width |
88
88
  | `studio.registerNav({ to, label, icon })` | An icon in the app bar that opens a page |
89
89
  | `studio.registerSettingsSection({ id, label, icon, component, menu? })` | A section of the settings, one level down in Settings › Plugins, at `/studio/settings/plugins?show=<id>` (`/studio/settings/<id>` leads there). `menu`: the user menu links to it directly |
90
- | `studio.registerSpaceSection({ id, group?, label, hint?, component })` | A section of a part of the space page at `/studio/space/<group>#<id>`, below the part’s own. See [The space](#the-space) |
90
+ | `studio.registerSpaceSection({ id, group?, label, hint?, component, status?, icon?, grouped?, add? })` | A section of a part of the space page at `/studio/space/<group>#<id>`, below the part’s own. See [The space](#the-space) |
91
91
  | `studio.registerSpacePart({ id, label, icon, after?, component })` | A part of the space page of the plugin’s own, at `/studio/space/<id>`. See [A part of the plugin’s own](#a-part-of-the-plugins-own) |
92
92
  | `studio.registerShareSection({ runner, component })` | A runner’s own settings for a wizard (a keyword), under the share dialog’s gear once the runner is on and set up. See [Runners](./runners.md#the-runners-part-of-the-share-dialog) |
93
93
  | `studio.registerShareSetup({ runner, title, component, notice? })` | What “Set up” in the runner’s row opens: a view inside the share dialog, with its buttons at the dialog’s foot, and a banner of the runner’s news. See [Runners](./runners.md#setting-up-inside-the-dialog) |
94
94
  | `studio.registerAssistantCard({ tool, component })` | A card in the assistant’s chat for what a tool of the server half returned. See [The space](./space.md#a-card-in-the-chat) |
95
+ | `studio.registerKnowledgeSource({ kind, label, icon, hint?, form?, placeholder?, settings? })` | A kind of source under „Quellen“ in Knowledge’s „Hinzufügen“ dialog (behind `knowledgeTree`): picked there, it asks with `form`, or with one field for the address, and proposes; its sources’ folders carry `icon`; `settings` is its own part of a source’s ⋯ › Quelle. The server half registers the same `kind` with its reader. See [The space](./space.md#a-source-of-knowledge) |
96
+ | `studio.registerMountKind({ kind, label, icon, place, form, hint?, allowWrite? })` | A kind of mount on the left of Dateien’s „Ordner einbinden“ dialog (behind `dateien`): picked there, `form` connects the account and picks the folder, and calls `onChange({ source, name })` when it is ready; the dialog then asks who sees it and mounts it („Einbinden“). Its mounts carry `icon` and `place` („Google Drive“) in the menu. `allowWrite({ space, source })` connects the account again with the rights to write, when writing is turned on. The server half registers the same `kind` with its reader. See [The space](./space.md#a-kind-of-mount) |
95
97
 
96
98
  - The studio’s own addresses are taken: `/new`, `/edit`, `/settings`, `/space`, `/setup`,
97
99
  `/sign-in`.
@@ -130,7 +132,7 @@ space page, behind the layers icon (Resources) in the app bar, shows them in fiv
130
132
  | Info | `info` | Basics, Facts |
131
133
  | Brand | `brand` | Logos, Colours, Typography, Brand assets |
132
134
  | Knowledge | `knowledge` | Documents, pages, tables and files with their categories: what every AI step looks things up in |
133
- | Data | `data` | What the wizards keep |
135
+ | Memory | `data` | What the wizards keep |
134
136
  | Results | `results` | The runs that reached their result |
135
137
 
136
138
  A plugin adds a section to one of them, below the part’s own:
@@ -164,6 +166,14 @@ studio.registerSpaceSection({
164
166
  `/studio/space/knowledge?show=s:<id>`, where `#<id>` leads too. Ids are unique on the whole
165
167
  page; the space’s own are taken: `base`, `facts`, `logos`, `colors`, `typography`, `assets`,
166
168
  `documents`.
169
+ - `status` is a component of a Knowledge section that says what it is busy with, above the items
170
+ of Knowledge’s overview: a source being read, with how far it got. It draws nothing (`null`)
171
+ while there is nothing to say; the person sees it without opening the section.
172
+ - `icon` is the section’s row in the part’s menu; a puzzle piece without one. `grouped: false`
173
+ puts the row among the part’s own, without the plugin’s name above it.
174
+ - `add` is an entry under „Quellen“ in Knowledge’s „Hinzufügen“ dialog that opens the section:
175
+ `{ label, hint?, icon? }`, what the plugin brings in („Website oder Sitemap“). The dialog waits
176
+ behind the `knowledgeTree` switch.
167
177
  - `studio.useSpace()` is a hook: `{ id, name, readOnly, brand }`, or `null` while there is none.
168
178
  A component that calls it draws again when the person picks another space, or changes its
169
179
  brand. `readOnly`: the space is edited in engenty wizards on a computer and only shown here,
@@ -28,6 +28,8 @@ version: 0.9.3
28
28
  | `wizards disconnect [app …]` | Takes them out again |
29
29
  | `wizards mcp` | Runs the MCP server over stdio. AI apps start it; you don’t |
30
30
  | `wizards uninstall` | Takes engenty wizards off this computer. It shows what it will remove first and asks about your data on its own; your data is kept unless you choose to delete it. `--dry-run` only shows the plan, `--yes` asks nothing and keeps your data, `--yes --delete-data` deletes it too. See [Remove](./install.md#remove) |
31
+ | `wizards move-files` | Once, after the update to 0.16: moves the files of your spaces (logos, assets, documents) to where they are kept now, by their content, so the same file is stored once. Until then they don’t open. Running it again moves only what is left |
32
+ | `wizards move-folder-sources` | Once, with Dateien and the new Wissen switched on: each folder the Sources plugin read into Wissen becomes a mounted folder in Dateien, and Wissen takes it from there. What you changed by hand stays yours. Running it again converts only what is left |
31
33
  | `wizards validate <path …>` | Checks wizards without the studio: `.wizard` files, unpacked wizard files, or a wizard’s JSON. `--json` prints the problems as JSON |
32
34
 
33
35
  | Option | What it does |
@@ -13,7 +13,7 @@ A plugin adds to engenty wizards without changing it:
13
13
  | A page | Behind an icon in the studio’s app bar |
14
14
  | A settings section | In the settings |
15
15
  | A section of the space page | In one of the space page’s parts |
16
- | A part of the space page | In the space’s menu, beside Info, Brand, Knowledge, Data and Results |
16
+ | A part of the space page | In the space’s menu, beside Info, Brand, Knowledge, Memory and Results |
17
17
  | A template | First among the templates of a new wizard |
18
18
  | A channel a wizard runs through | Under “How should it run?” on a new wizard, and under “How others reach it” in the share dialog, where “Set up” opens the plugin’s own setup |
19
19
  | Something that happens when a run ends, or again and again | Nowhere: it works in the background, for example posts a message |
@@ -19,7 +19,7 @@ picture at the top right.
19
19
 
20
20
  On Resources, the menu on the left starts with the Overview: each of the four parts with what it
21
21
  is for and how far it is filled, Goose on top. Then the parts themselves. Where a part lists
22
- things of its own (Knowledge’s categories, Data’s tables), it opens its menu under the other parts,
22
+ things of its own (Knowledge’s categories, Memory’s tables), it opens its menu under the other parts,
23
23
  with a search (⌘F). On a phone, the parts, a part’s menu and the page take turns.
24
24
 
25
25
  Results have no menu: the list above them picks one wizard or all of them.
@@ -29,7 +29,7 @@ Results have no menu: the list above them picks one wizard or all of them.
29
29
  | Info | Basics, Facts | Who you are |
30
30
  | Brand | Logos, Colours, Brand assets | How you look |
31
31
  | Knowledge | All, then each category, then the sections plugins add | What every AI step looks things up in |
32
- | Data | All data, then each wizard | Tables and pages the wizards keep |
32
+ | Memory | All data, then each wizard | Tables and pages the wizards keep |
33
33
 
34
34
  ## Info
35
35
 
@@ -87,9 +87,9 @@ A plugin can fill Knowledge from outside, from a website or a folder, for exampl
87
87
  shows where it came from (“From …”). Once you change it by hand, it stays yours, and the plugin
88
88
  no longer updates it.
89
89
 
90
- ## Data
90
+ ## Memory
91
91
 
92
- Data holds the tables and pages your wizards keep, each under the wizard’s name. The space’s own
92
+ Memory holds the tables and pages your wizards keep, each under the wizard’s name. The space’s own
93
93
  tables and pages are in Knowledge. A wizard fills its own: a shared list becomes one of its tables,
94
94
  and a step with the “Pages” tool writes its pages. The columns of a shared list come from the
95
95
  wizard. The buttons “Table” and “Page” add one to a wizard.
@@ -107,7 +107,7 @@ wizard. The buttons “Table” and “Page” add one to a wizard.
107
107
 
108
108
  ### On your computer and in the cloud
109
109
 
110
- Data stays where it was written. A wizard’s tables and pages are filled where it runs: on your
110
+ Memory stays where it was written. A wizard’s tables and pages are filled where it runs: on your
111
111
  computer by its runs there, in the cloud by the runs over its link. The pages and tables of
112
112
  Knowledge, with their categories, go to the cloud with every wizard you publish there. The cloud
113
113
  shows them without changing them. Files stay on your computer.
@@ -125,7 +125,7 @@ with its files.
125
125
  engenty wizards on your computer has one space, called “My computer” at first (“Mein Computer” in
126
126
  German). On engenty.ai the organization’s plan says how many spaces it may have. The space’s tile in the
127
127
  app bar opens a menu: it switches between spaces, “Rename space” renames this one, and “Add space”
128
- adds one while the plan has room. Each space has its own wizards, Info, Brand, Knowledge, Data,
128
+ adds one while the plan has room. Each space has its own wizards, Info, Brand, Knowledge, Memory,
129
129
  connectors and results. The account, the models and the plugins are the same for every space.
130
130
 
131
131
  When you publish wizards from your computer with an account signed in, their space shows up in
@@ -218,7 +218,7 @@ row of a list the wizard keeps, at most 20 rows. Its results come together in on
218
218
  - **Lists** hold rows between runs, separately for each person who runs the wizard: the
219
219
  receipts already booked, the customers already written to.
220
220
  - **Shared lists** hold one set of rows for every run: requests, sign-ups, a log. The person
221
- running the wizard never sees them; you find them under Space → Data, below the wizard, and
221
+ running the wizard never sees them; you find them under Space → Memory, below the wizard, and
222
222
  in the editor under “Memory”.
223
223
  - **Connected accounts and sign-ins** are kept for the person’s next run.
224
224
 
@@ -0,0 +1,72 @@
1
+ import { join } from "node:path";
2
+ import { markdownFromPagedParseResult } from "../engenty/doc-converter/page-break.js";
3
+ import { env } from "../env.js";
4
+ /**
5
+ * Reads scans and photos on this computer, as an engenty doc-converter provider: LlamaIndex's
6
+ * LiteParse, with PDFium and Tesseract built in (docs/plans/document-reading.md). Tesseract's
7
+ * models are downloaded the first time a scan is read, into DATA_DIR/tessdata.
8
+ */
9
+ /** Tesseract's languages, by their model names. */
10
+ const LANGUAGES = "deu+eng";
11
+ /** Pages of one document read by OCR at most: a long scanned book costs minutes. */
12
+ export const MAX_OCR_PAGES = 100;
13
+ export const TESSDATA_DIR = join(env.dataDir, "tessdata");
14
+ let loaded = null;
15
+ /** A parser for one read: which pages it reads is part of its config. */
16
+ async function liteparse(targetPages) {
17
+ loaded ??= import("@llamaindex/liteparse").catch((err) => {
18
+ // A platform LiteParse has no build for: no OCR.
19
+ console.error("[ocr] LiteParse is not available:", err);
20
+ throw err;
21
+ });
22
+ const { LiteParse } = await loaded;
23
+ return new LiteParse({
24
+ outputFormat: "markdown",
25
+ imageMode: "off",
26
+ ocrLanguage: LANGUAGES,
27
+ tessdataPath: TESSDATA_DIR,
28
+ maxPages: MAX_OCR_PAGES,
29
+ quiet: true,
30
+ ...(targetPages ? { targetPages } : {}),
31
+ });
32
+ }
33
+ export class OcrProvider {
34
+ id = "liteparse";
35
+ name = "LiteParse OCR";
36
+ supportedTypes = [
37
+ "application/pdf",
38
+ "image/png",
39
+ "image/jpeg",
40
+ "image/webp",
41
+ "image/gif",
42
+ "image/tiff",
43
+ "image/bmp",
44
+ ];
45
+ canConvert(mimeType) {
46
+ return this.supportedTypes.includes(mimeType);
47
+ }
48
+ async convert(data, filename, mimeType, _options) {
49
+ const pages = await this.pages(data);
50
+ // A picture is one page: no page markers.
51
+ const markdown = mimeType === "application/pdf"
52
+ ? markdownFromPagedParseResult({
53
+ pages: [...pages].map(([number, text]) => ({ number, markdown: text })),
54
+ total: pages.size,
55
+ })
56
+ : [...pages.values()].join("\n\n");
57
+ return {
58
+ markdown,
59
+ metadata: {
60
+ page_count: pages.size,
61
+ word_count: markdown.split(/\s+/).filter(Boolean).length,
62
+ },
63
+ source: { filename, mime_type: mimeType, size_bytes: data.byteLength },
64
+ };
65
+ }
66
+ /** The text of each page by its number: of `only` where given, else of the first pages. */
67
+ async pages(data, only) {
68
+ const lp = await liteparse(only?.slice(0, MAX_OCR_PAGES).join(","));
69
+ const result = await lp.parse(data);
70
+ return new Map(result.pages.map((page) => [page.pageNum, (page.markdown ?? page.text).trim()]));
71
+ }
72
+ }