wizards 0.7.4 → 0.7.6

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 (516) hide show
  1. package/bin/wizards.mjs +95 -26
  2. package/{apps/web/dist/install.sh → install.sh} +23 -5
  3. package/package.json +2 -58
  4. package/apps/runtime/dist/agents/architect.js +0 -444
  5. package/apps/runtime/dist/agents/studio-assistant.js +0 -883
  6. package/apps/runtime/dist/agents/subscription.js +0 -207
  7. package/apps/runtime/dist/agents/thought.js +0 -21
  8. package/apps/runtime/dist/agents/website.js +0 -480
  9. package/apps/runtime/dist/app.js +0 -359
  10. package/apps/runtime/dist/apple/wizards-apple +0 -0
  11. package/apps/runtime/dist/assistant/browser.js +0 -26
  12. package/apps/runtime/dist/assistant/docs.js +0 -158
  13. package/apps/runtime/dist/assistant/knows.js +0 -353
  14. package/apps/runtime/dist/assistant/primer.js +0 -26
  15. package/apps/runtime/dist/assistant/runs.js +0 -24
  16. package/apps/runtime/dist/auth/account.js +0 -175
  17. package/apps/runtime/dist/auth/device.js +0 -112
  18. package/apps/runtime/dist/auth/index.js +0 -358
  19. package/apps/runtime/dist/auth/keys.js +0 -55
  20. package/apps/runtime/dist/auth/local-ticket.js +0 -26
  21. package/apps/runtime/dist/authoring/example.js +0 -74
  22. package/apps/runtime/dist/authoring/guide.js +0 -433
  23. package/apps/runtime/dist/authoring/ops.js +0 -117
  24. package/apps/runtime/dist/browser/fast/action-space.js +0 -160
  25. package/apps/runtime/dist/browser/fast/classifier.js +0 -91
  26. package/apps/runtime/dist/browser/fast/decide.js +0 -171
  27. package/apps/runtime/dist/browser/fast/driver.js +0 -141
  28. package/apps/runtime/dist/browser/fast/instructions.js +0 -33
  29. package/apps/runtime/dist/browser/fast/run.js +0 -249
  30. package/apps/runtime/dist/browser/fast/span-picker.js +0 -153
  31. package/apps/runtime/dist/browser/fast/text-helper.js +0 -178
  32. package/apps/runtime/dist/browser/snapshot.js +0 -335
  33. package/apps/runtime/dist/cli/account.js +0 -385
  34. package/apps/runtime/dist/cli/autostart.js +0 -182
  35. package/apps/runtime/dist/cli/autoupdate.js +0 -221
  36. package/apps/runtime/dist/cli/clients.js +0 -44
  37. package/apps/runtime/dist/cli/connect.js +0 -540
  38. package/apps/runtime/dist/cli/environment.js +0 -93
  39. package/apps/runtime/dist/cli/exec.js +0 -45
  40. package/apps/runtime/dist/cli/features.js +0 -50
  41. package/apps/runtime/dist/cli/home.js +0 -88
  42. package/apps/runtime/dist/cli/install-env.js +0 -33
  43. package/apps/runtime/dist/cli/machine.js +0 -107
  44. package/apps/runtime/dist/cli/main.js +0 -222
  45. package/apps/runtime/dist/cli/mcp.js +0 -136
  46. package/apps/runtime/dist/cli/menu.js +0 -202
  47. package/apps/runtime/dist/cli/processes.js +0 -72
  48. package/apps/runtime/dist/cli/report.js +0 -66
  49. package/apps/runtime/dist/cli/setup.js +0 -335
  50. package/apps/runtime/dist/cli/start.js +0 -276
  51. package/apps/runtime/dist/cli/status.js +0 -203
  52. package/apps/runtime/dist/cli/ui.js +0 -59
  53. package/apps/runtime/dist/cli/uninstall-main.js +0 -20
  54. package/apps/runtime/dist/cli/uninstall.js +0 -231
  55. package/apps/runtime/dist/cli/update.js +0 -86
  56. package/apps/runtime/dist/cli/validate.js +0 -75
  57. package/apps/runtime/dist/cli/versions.js +0 -106
  58. package/apps/runtime/dist/connectors/builtin.js +0 -86
  59. package/apps/runtime/dist/connectors/external.js +0 -409
  60. package/apps/runtime/dist/connectors/gmail.js +0 -107
  61. package/apps/runtime/dist/connectors/imap.js +0 -261
  62. package/apps/runtime/dist/connectors/index.js +0 -325
  63. package/apps/runtime/dist/connectors/mail.js +0 -72
  64. package/apps/runtime/dist/connectors/outlook.js +0 -90
  65. package/apps/runtime/dist/connectors/plugin-connections.js +0 -343
  66. package/apps/runtime/dist/connectors/via-account.js +0 -65
  67. package/apps/runtime/dist/credits/credits.js +0 -100
  68. package/apps/runtime/dist/credits/estimate.js +0 -152
  69. package/apps/runtime/dist/db/adopt.js +0 -149
  70. package/apps/runtime/dist/db/client.js +0 -173
  71. package/apps/runtime/dist/db/control-schema.js +0 -133
  72. package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +0 -47
  73. package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +0 -41
  74. package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +0 -1
  75. package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +0 -3
  76. package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +0 -6
  77. package/apps/runtime/dist/db/migrations/control/0005_chilly_oracle.sql +0 -1
  78. package/apps/runtime/dist/db/migrations/control/0006_sleepy_mojo.sql +0 -1
  79. package/apps/runtime/dist/db/migrations/control/0007_common_the_hand.sql +0 -15
  80. package/apps/runtime/dist/db/migrations/control/0008_runner.sql +0 -8
  81. package/apps/runtime/dist/db/migrations/control/0009_plugin_claim.sql +0 -9
  82. package/apps/runtime/dist/db/migrations/control/0010_tan_snowbird.sql +0 -6
  83. package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +0 -311
  84. package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +0 -599
  85. package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +0 -607
  86. package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +0 -311
  87. package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +0 -350
  88. package/apps/runtime/dist/db/migrations/control/meta/0005_snapshot.json +0 -358
  89. package/apps/runtime/dist/db/migrations/control/meta/0006_snapshot.json +0 -365
  90. package/apps/runtime/dist/db/migrations/control/meta/0007_snapshot.json +0 -460
  91. package/apps/runtime/dist/db/migrations/control/meta/0008_snapshot.json +0 -505
  92. package/apps/runtime/dist/db/migrations/control/meta/0009_snapshot.json +0 -561
  93. package/apps/runtime/dist/db/migrations/control/meta/0010_snapshot.json +0 -600
  94. package/apps/runtime/dist/db/migrations/control/meta/_journal.json +0 -83
  95. package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +0 -188
  96. package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +0 -1
  97. package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +0 -1
  98. package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +0 -52
  99. package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +0 -6
  100. package/apps/runtime/dist/db/migrations/tenant/0005_reflective_forgotten_one.sql +0 -2
  101. package/apps/runtime/dist/db/migrations/tenant/0006_hard_war_machine.sql +0 -30
  102. package/apps/runtime/dist/db/migrations/tenant/0007_space_data.sql +0 -43
  103. package/apps/runtime/dist/db/migrations/tenant/0008_run_event_note.sql +0 -1
  104. package/apps/runtime/dist/db/migrations/tenant/0009_knowledge.sql +0 -104
  105. package/apps/runtime/dist/db/migrations/tenant/0010_plugin_connection.sql +0 -15
  106. package/apps/runtime/dist/db/migrations/tenant/0011_runners.sql +0 -2
  107. package/apps/runtime/dist/db/migrations/tenant/0012_assistant_chat.sql +0 -40
  108. package/apps/runtime/dist/db/migrations/tenant/0013_run_origin.sql +0 -1
  109. package/apps/runtime/dist/db/migrations/tenant/0014_run_answer.sql +0 -2
  110. package/apps/runtime/dist/db/migrations/tenant/0015_device_calls.sql +0 -13
  111. package/apps/runtime/dist/db/migrations/tenant/0016_even_trish_tilby.sql +0 -12
  112. package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +0 -1323
  113. package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +0 -1330
  114. package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +0 -1337
  115. package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +0 -1605
  116. package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +0 -1645
  117. package/apps/runtime/dist/db/migrations/tenant/meta/0005_snapshot.json +0 -1659
  118. package/apps/runtime/dist/db/migrations/tenant/meta/0006_snapshot.json +0 -1696
  119. package/apps/runtime/dist/db/migrations/tenant/meta/0007_snapshot.json +0 -2012
  120. package/apps/runtime/dist/db/migrations/tenant/meta/0008_snapshot.json +0 -2019
  121. package/apps/runtime/dist/db/migrations/tenant/meta/0009_snapshot.json +0 -2837
  122. package/apps/runtime/dist/db/migrations/tenant/meta/0010_snapshot.json +0 -2942
  123. package/apps/runtime/dist/db/migrations/tenant/meta/0011_snapshot.json +0 -2956
  124. package/apps/runtime/dist/db/migrations/tenant/meta/0012_snapshot.json +0 -3132
  125. package/apps/runtime/dist/db/migrations/tenant/meta/0013_snapshot.json +0 -3139
  126. package/apps/runtime/dist/db/migrations/tenant/meta/0014_snapshot.json +0 -3154
  127. package/apps/runtime/dist/db/migrations/tenant/meta/0015_snapshot.json +0 -3243
  128. package/apps/runtime/dist/db/migrations/tenant/meta/0016_snapshot.json +0 -3326
  129. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +0 -125
  130. package/apps/runtime/dist/db/schema.js +0 -602
  131. package/apps/runtime/dist/debug.js +0 -196
  132. package/apps/runtime/dist/docs/dev/index.md +0 -41
  133. package/apps/runtime/dist/docs/dev/meta.json +0 -7
  134. package/apps/runtime/dist/docs/dev/plugins/connections.md +0 -74
  135. package/apps/runtime/dist/docs/dev/plugins/events.md +0 -89
  136. package/apps/runtime/dist/docs/dev/plugins/examples.md +0 -101
  137. package/apps/runtime/dist/docs/dev/plugins/index.md +0 -78
  138. package/apps/runtime/dist/docs/dev/plugins/layout.md +0 -90
  139. package/apps/runtime/dist/docs/dev/plugins/meta.json +0 -28
  140. package/apps/runtime/dist/docs/dev/plugins/quick-start.md +0 -94
  141. package/apps/runtime/dist/docs/dev/plugins/reference.md +0 -348
  142. package/apps/runtime/dist/docs/dev/plugins/reloading.md +0 -76
  143. package/apps/runtime/dist/docs/dev/plugins/routes.md +0 -185
  144. package/apps/runtime/dist/docs/dev/plugins/runners.md +0 -230
  145. package/apps/runtime/dist/docs/dev/plugins/server.md +0 -281
  146. package/apps/runtime/dist/docs/dev/plugins/shipping.md +0 -79
  147. package/apps/runtime/dist/docs/dev/plugins/space.md +0 -297
  148. package/apps/runtime/dist/docs/dev/plugins/starters.md +0 -70
  149. package/apps/runtime/dist/docs/dev/plugins/studio.md +0 -363
  150. package/apps/runtime/dist/docs/dev/plugins/styling.md +0 -129
  151. package/apps/runtime/dist/docs/dev/plugins/tables.md +0 -104
  152. package/apps/runtime/dist/docs/dev/plugins/tools.md +0 -139
  153. package/apps/runtime/dist/docs/dev/wizard-format.md +0 -121
  154. package/apps/runtime/dist/docs/meta.json +0 -3
  155. package/apps/runtime/dist/docs/user/ai-apps.md +0 -112
  156. package/apps/runtime/dist/docs/user/assistant.md +0 -77
  157. package/apps/runtime/dist/docs/user/build-a-wizard.md +0 -116
  158. package/apps/runtime/dist/docs/user/command-line.md +0 -83
  159. package/apps/runtime/dist/docs/user/connectors.md +0 -90
  160. package/apps/runtime/dist/docs/user/create-account.md +0 -52
  161. package/apps/runtime/dist/docs/user/data.md +0 -66
  162. package/apps/runtime/dist/docs/user/first-start.md +0 -60
  163. package/apps/runtime/dist/docs/user/index.md +0 -49
  164. package/apps/runtime/dist/docs/user/install.md +0 -121
  165. package/apps/runtime/dist/docs/user/local-only.md +0 -42
  166. package/apps/runtime/dist/docs/user/meta.json +0 -32
  167. package/apps/runtime/dist/docs/user/models.md +0 -156
  168. package/apps/runtime/dist/docs/user/plugins.md +0 -71
  169. package/apps/runtime/dist/docs/user/run.md +0 -98
  170. package/apps/runtime/dist/docs/user/server.md +0 -52
  171. package/apps/runtime/dist/docs/user/space.md +0 -126
  172. package/apps/runtime/dist/docs/user/steps.md +0 -220
  173. package/apps/runtime/dist/docs/user/test-and-share.md +0 -224
  174. package/apps/runtime/dist/docs/user/troubleshooting.md +0 -67
  175. package/apps/runtime/dist/docs/user/wordpress.md +0 -121
  176. package/apps/runtime/dist/documents/parse.js +0 -246
  177. package/apps/runtime/dist/engenty/connections-external/build-connector.js +0 -193
  178. package/apps/runtime/dist/engenty/connections-external/errors.js +0 -11
  179. package/apps/runtime/dist/engenty/connections-external/import-service.js +0 -270
  180. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +0 -34
  181. package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +0 -185
  182. package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +0 -63
  183. package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +0 -130
  184. package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +0 -143
  185. package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +0 -143
  186. package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +0 -119
  187. package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +0 -88
  188. package/apps/runtime/dist/engenty/connections-external/registry-client.js +0 -336
  189. package/apps/runtime/dist/engenty/connections-external/registry-source.js +0 -82
  190. package/apps/runtime/dist/engenty/connections-external/types.js +0 -7
  191. package/apps/runtime/dist/engenty/connections-github/connector.js +0 -209
  192. package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +0 -381
  193. package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +0 -94
  194. package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +0 -290
  195. package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +0 -567
  196. package/apps/runtime/dist/engenty/connections-google/definitions.js +0 -11
  197. package/apps/runtime/dist/engenty/connections-google/shared.js +0 -73
  198. package/apps/runtime/dist/engenty/connections-hubspot/connector.js +0 -140
  199. package/apps/runtime/dist/engenty/connections-microsoft/action.js +0 -17
  200. package/apps/runtime/dist/engenty/connections-microsoft/graph.js +0 -114
  201. package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +0 -286
  202. package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +0 -492
  203. package/apps/runtime/dist/engenty/connections-s3/s3.js +0 -328
  204. package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +0 -86
  205. package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +0 -150
  206. package/apps/runtime/dist/engenty/connections-sdk/registry.js +0 -89
  207. package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +0 -84
  208. package/apps/runtime/dist/engenty/connections-sdk/types.js +0 -30
  209. package/apps/runtime/dist/engenty/connections-slack/connector.js +0 -360
  210. package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +0 -178
  211. package/apps/runtime/dist/engenty/csv-import/import-sources.js +0 -87
  212. package/apps/runtime/dist/engenty/csv-import/parse-csv.js +0 -129
  213. package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +0 -20
  214. package/apps/runtime/dist/engenty/csv-import/types.js +0 -1
  215. package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +0 -159
  216. package/apps/runtime/dist/engenty/doc-converter/interface.js +0 -9
  217. package/apps/runtime/dist/engenty/doc-converter/page-break.js +0 -92
  218. package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +0 -72
  219. package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +0 -30
  220. package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +0 -4
  221. package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +0 -73
  222. package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +0 -63
  223. package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +0 -40
  224. package/apps/runtime/dist/engenty/search-index/chunks.js +0 -164
  225. package/apps/runtime/dist/engenty/search-index/contracts.js +0 -9
  226. package/apps/runtime/dist/engenty/shims/connections-sdk.js +0 -39
  227. package/apps/runtime/dist/engenty/shims/plugin-sdk.js +0 -1
  228. package/apps/runtime/dist/engenty/shims/web-ingest.js +0 -19
  229. package/apps/runtime/dist/engenty/web-ingest/ssrf.js +0 -277
  230. package/apps/runtime/dist/engine/asks.js +0 -82
  231. package/apps/runtime/dist/engine/decide.js +0 -82
  232. package/apps/runtime/dist/engine/device.js +0 -194
  233. package/apps/runtime/dist/engine/events.js +0 -128
  234. package/apps/runtime/dist/engine/input.js +0 -208
  235. package/apps/runtime/dist/engine/owner.js +0 -32
  236. package/apps/runtime/dist/engine/prepare.js +0 -90
  237. package/apps/runtime/dist/engine/push.js +0 -58
  238. package/apps/runtime/dist/engine/requirements.js +0 -355
  239. package/apps/runtime/dist/engine/resources.js +0 -198
  240. package/apps/runtime/dist/engine/runner.js +0 -970
  241. package/apps/runtime/dist/engine/steps.js +0 -1000
  242. package/apps/runtime/dist/engine/surface.js +0 -91
  243. package/apps/runtime/dist/engine/template.js +0 -240
  244. package/apps/runtime/dist/engine/types.js +0 -4
  245. package/apps/runtime/dist/env.js +0 -295
  246. package/apps/runtime/dist/features.js +0 -123
  247. package/apps/runtime/dist/files/blobs.js +0 -22
  248. package/apps/runtime/dist/files/objects.js +0 -86
  249. package/apps/runtime/dist/files/storage.js +0 -120
  250. package/apps/runtime/dist/files/web-images.js +0 -101
  251. package/apps/runtime/dist/film/project.js +0 -257
  252. package/apps/runtime/dist/film/skills.js +0 -91
  253. package/apps/runtime/dist/film/sounds.js +0 -122
  254. package/apps/runtime/dist/film/step.js +0 -289
  255. package/apps/runtime/dist/film/tools.js +0 -99
  256. package/apps/runtime/dist/geocode.js +0 -58
  257. package/apps/runtime/dist/harness/antigravity.js +0 -129
  258. package/apps/runtime/dist/harness/apple.js +0 -270
  259. package/apps/runtime/dist/harness/claude.js +0 -147
  260. package/apps/runtime/dist/harness/codex.js +0 -229
  261. package/apps/runtime/dist/harness/cursor.js +0 -93
  262. package/apps/runtime/dist/harness/env.js +0 -124
  263. package/apps/runtime/dist/harness/index.js +0 -95
  264. package/apps/runtime/dist/harness/model.js +0 -279
  265. package/apps/runtime/dist/harness/prompt.js +0 -121
  266. package/apps/runtime/dist/harness/terminal.js +0 -194
  267. package/apps/runtime/dist/harness/types.js +0 -7
  268. package/apps/runtime/dist/index.js +0 -113
  269. package/apps/runtime/dist/limits.js +0 -81
  270. package/apps/runtime/dist/link-preview.js +0 -60
  271. package/apps/runtime/dist/log.js +0 -106
  272. package/apps/runtime/dist/manage.js +0 -249
  273. package/apps/runtime/dist/mcp/auth.js +0 -161
  274. package/apps/runtime/dist/mcp/bridge.js +0 -59
  275. package/apps/runtime/dist/mcp/flow-app.js +0 -97
  276. package/apps/runtime/dist/mcp/handler.js +0 -54
  277. package/apps/runtime/dist/mcp/scopes.js +0 -14
  278. package/apps/runtime/dist/mcp/seen.js +0 -65
  279. package/apps/runtime/dist/mcp/tools.js +0 -572
  280. package/apps/runtime/dist/media/conversation.js +0 -167
  281. package/apps/runtime/dist/media/ffmpeg.js +0 -121
  282. package/apps/runtime/dist/media/generate.js +0 -120
  283. package/apps/runtime/dist/media/marking.js +0 -121
  284. package/apps/runtime/dist/media/transcribe.js +0 -198
  285. package/apps/runtime/dist/model-errors.js +0 -42
  286. package/apps/runtime/dist/models.js +0 -1164
  287. package/apps/runtime/dist/plugin.js +0 -61
  288. package/apps/runtime/dist/plugins/channels.js +0 -78
  289. package/apps/runtime/dist/plugins/claims.js +0 -56
  290. package/apps/runtime/dist/plugins/discovery.js +0 -155
  291. package/apps/runtime/dist/plugins/events.js +0 -63
  292. package/apps/runtime/dist/plugins/jobs.js +0 -64
  293. package/apps/runtime/dist/plugins/loader.js +0 -508
  294. package/apps/runtime/dist/plugins/migrations.js +0 -69
  295. package/apps/runtime/dist/plugins/pro-keys.js +0 -34
  296. package/apps/runtime/dist/plugins/pro-state.js +0 -83
  297. package/apps/runtime/dist/plugins/pro.js +0 -310
  298. package/apps/runtime/dist/plugins/public.js +0 -44
  299. package/apps/runtime/dist/plugins/registry.js +0 -122
  300. package/apps/runtime/dist/plugins/runs.js +0 -210
  301. package/apps/runtime/dist/render/browser-path.js +0 -54
  302. package/apps/runtime/dist/render/chromium.js +0 -98
  303. package/apps/runtime/dist/render/convert.js +0 -158
  304. package/apps/runtime/dist/render/downloads.js +0 -299
  305. package/apps/runtime/dist/render/guard.js +0 -25
  306. package/apps/runtime/dist/render/shaped.js +0 -137
  307. package/apps/runtime/dist/routes/api.js +0 -440
  308. package/apps/runtime/dist/routes/debug.js +0 -42
  309. package/apps/runtime/dist/routes/delivery.js +0 -90
  310. package/apps/runtime/dist/routes/internal.js +0 -81
  311. package/apps/runtime/dist/routes/lang.js +0 -25
  312. package/apps/runtime/dist/routes/marketplace.js +0 -43
  313. package/apps/runtime/dist/routes/plugin-public.js +0 -113
  314. package/apps/runtime/dist/routes/plugins.js +0 -212
  315. package/apps/runtime/dist/routes/runs.js +0 -1422
  316. package/apps/runtime/dist/routes/studio.js +0 -1629
  317. package/apps/runtime/dist/routes/wizard-stream.js +0 -30
  318. package/apps/runtime/dist/running.js +0 -39
  319. package/apps/runtime/dist/sandbox/docker.js +0 -75
  320. package/apps/runtime/dist/sandbox/index.js +0 -23
  321. package/apps/runtime/dist/sandbox/types.js +0 -1
  322. package/apps/runtime/dist/secrets/crypto.js +0 -28
  323. package/apps/runtime/dist/secrets/signing.js +0 -52
  324. package/apps/runtime/dist/secrets/vault.js +0 -59
  325. package/apps/runtime/dist/services/access.js +0 -88
  326. package/apps/runtime/dist/services/api.js +0 -248
  327. package/apps/runtime/dist/services/architect.js +0 -95
  328. package/apps/runtime/dist/services/assistant-chats.js +0 -311
  329. package/apps/runtime/dist/services/brand.js +0 -85
  330. package/apps/runtime/dist/services/cloud.js +0 -456
  331. package/apps/runtime/dist/services/draft-events.js +0 -27
  332. package/apps/runtime/dist/services/engenty-shapes.js +0 -71
  333. package/apps/runtime/dist/services/errors.js +0 -29
  334. package/apps/runtime/dist/services/files.js +0 -178
  335. package/apps/runtime/dist/services/knowledge-model.js +0 -559
  336. package/apps/runtime/dist/services/knowledge.js +0 -721
  337. package/apps/runtime/dist/services/links.js +0 -16
  338. package/apps/runtime/dist/services/marketplace.js +0 -492
  339. package/apps/runtime/dist/services/onboarding.js +0 -152
  340. package/apps/runtime/dist/services/package-file.js +0 -82
  341. package/apps/runtime/dist/services/package.js +0 -170
  342. package/apps/runtime/dist/services/profile.js +0 -51
  343. package/apps/runtime/dist/services/project-files.js +0 -439
  344. package/apps/runtime/dist/services/project-index.js +0 -707
  345. package/apps/runtime/dist/services/projects.js +0 -387
  346. package/apps/runtime/dist/services/relevance.js +0 -58
  347. package/apps/runtime/dist/services/runners.js +0 -178
  348. package/apps/runtime/dist/services/runs.js +0 -524
  349. package/apps/runtime/dist/services/shares.js +0 -130
  350. package/apps/runtime/dist/services/site.js +0 -270
  351. package/apps/runtime/dist/services/space-categories.js +0 -861
  352. package/apps/runtime/dist/services/space-data.js +0 -792
  353. package/apps/runtime/dist/services/space-origin.js +0 -207
  354. package/apps/runtime/dist/services/spaces.js +0 -656
  355. package/apps/runtime/dist/services/translations.js +0 -306
  356. package/apps/runtime/dist/services/widgets.js +0 -34
  357. package/apps/runtime/dist/services/wizard-icon.js +0 -157
  358. package/apps/runtime/dist/services/wizards.js +0 -420
  359. package/apps/runtime/dist/settings.js +0 -16
  360. package/apps/runtime/dist/store/errors.js +0 -4
  361. package/apps/runtime/dist/store/index.js +0 -299
  362. package/apps/runtime/dist/store/shared-lists.js +0 -123
  363. package/apps/runtime/dist/tenants/control.js +0 -238
  364. package/apps/runtime/dist/tenants/tenant.js +0 -26
  365. package/apps/runtime/dist/texts.js +0 -207
  366. package/apps/runtime/dist/tools/browser.js +0 -703
  367. package/apps/runtime/dist/tools/connector.js +0 -204
  368. package/apps/runtime/dist/tools/index.js +0 -291
  369. package/apps/runtime/dist/tools/mail.js +0 -104
  370. package/apps/runtime/dist/tools/net-guard.js +0 -170
  371. package/apps/runtime/dist/tools/pages.js +0 -81
  372. package/apps/runtime/dist/tools/plugin.js +0 -180
  373. package/apps/runtime/dist/tools/project.js +0 -154
  374. package/apps/runtime/dist/tools/shared.js +0 -69
  375. package/apps/runtime/dist/tools/store.js +0 -238
  376. package/apps/runtime/dist/update.js +0 -113
  377. package/apps/runtime/dist/widgets/bundle.js +0 -99
  378. package/apps/runtime/dist/widgets/render.js +0 -329
  379. package/apps/runtime/dist/widgets/runtime.js +0 -108
  380. package/apps/runtime/dist/widgets/script.js +0 -30
  381. package/apps/runtime/dist/widgets/step.js +0 -223
  382. package/apps/web/dist/ai-labels/ai-black.svg +0 -20
  383. package/apps/web/dist/ai-labels/ai-generated-black.svg +0 -31
  384. package/apps/web/dist/ai-labels/ai-generated-white.svg +0 -32
  385. package/apps/web/dist/ai-labels/ai-modified-black.svg +0 -30
  386. package/apps/web/dist/ai-labels/ai-modified-white.svg +0 -31
  387. package/apps/web/dist/ai-labels/ai-white.svg +0 -21
  388. package/apps/web/dist/assets/AboutDialog-BI6487_s.js +0 -1
  389. package/apps/web/dist/assets/ChangelogDialog-B63QWuUV.js +0 -1
  390. package/apps/web/dist/assets/ChatView-BjQVHGjn.js +0 -10
  391. package/apps/web/dist/assets/EditorPage-DrprS19h.js +0 -3
  392. package/apps/web/dist/assets/FlowPreview-CusP7ci9.js +0 -1
  393. package/apps/web/dist/assets/Harness-BrP-ENHg.css +0 -1
  394. package/apps/web/dist/assets/Harness-CCMqhtuk.js +0 -16
  395. package/apps/web/dist/assets/NewWizardChannels-DpcWsST7.js +0 -1
  396. package/apps/web/dist/assets/NewWizardPage-BXePNBa9.js +0 -7
  397. package/apps/web/dist/assets/OnboardingPage-BtZ6sHJi.js +0 -1
  398. package/apps/web/dist/assets/ProjectPage-DHOL8FXt.js +0 -1
  399. package/apps/web/dist/assets/PublicRunner-BLRVe7G0.js +0 -1
  400. package/apps/web/dist/assets/ReadOnly-BV8o_HtK.js +0 -1
  401. package/apps/web/dist/assets/RunDrawer-D-T8pYfB.js +0 -4
  402. package/apps/web/dist/assets/RunnerView-BinlRsGF.js +0 -1
  403. package/apps/web/dist/assets/SettingsPage-B6M-jFJw.js +0 -1
  404. package/apps/web/dist/assets/SetupPage-DI6c--4V.js +0 -1
  405. package/apps/web/dist/assets/SharePage-C4cESaes.js +0 -1
  406. package/apps/web/dist/assets/changelog-Dj_yd2vG.js +0 -1
  407. package/apps/web/dist/assets/engenty-eXZ-EAwd.js +0 -1
  408. package/apps/web/dist/assets/esm-DXeMu8Lb.js +0 -7
  409. package/apps/web/dist/assets/fluffy-engenty-ClRou7yu.js +0 -456
  410. package/apps/web/dist/assets/index-AfUa8xKD.css +0 -1
  411. package/apps/web/dist/assets/index-yiE9Lun0.js +0 -14
  412. package/apps/web/dist/assets/jsx-runtime-BNakU3Ej.js +0 -1
  413. package/apps/web/dist/assets/lock-R_CfU0Xo.js +0 -1
  414. package/apps/web/dist/assets/oss-credits-cZ9NUaLZ.js +0 -1
  415. package/apps/web/dist/assets/pdfmake-Cx9scTbD.js +0 -228
  416. package/apps/web/dist/assets/phone-CgrIS4_-.js +0 -1
  417. package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +0 -1
  418. package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +0 -98
  419. package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +0 -1
  420. package/apps/web/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
  421. package/apps/web/dist/assets/settings-menu-2IMOOlLl.js +0 -1
  422. package/apps/web/dist/assets/ui-dzGvc3xk.js +0 -137
  423. package/apps/web/dist/assets/upload-BSuTilFF.js +0 -1
  424. package/apps/web/dist/assets/vfs_fonts-DllDSYt1.js +0 -1
  425. package/apps/web/dist/embed.js +0 -266
  426. package/apps/web/dist/favicon.svg +0 -1
  427. package/apps/web/dist/icons/apple-touch-icon.png +0 -0
  428. package/apps/web/dist/icons/icon-192.png +0 -0
  429. package/apps/web/dist/icons/icon-512.png +0 -0
  430. package/apps/web/dist/icons/icon-maskable-512.png +0 -0
  431. package/apps/web/dist/index.html +0 -48
  432. package/apps/web/dist/manifest.webmanifest +0 -21
  433. package/apps/web/dist/mcp/flow.html +0 -980
  434. package/apps/web/dist/sw.js +0 -15
  435. package/modules/README.md +0 -15
  436. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +0 -1150
  437. package/node_modules/@engenty/wizards/dist/plugin/index.js +0 -4
  438. package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +0 -322
  439. package/node_modules/@engenty/wizards/dist/plugin/studio.js +0 -4
  440. package/node_modules/@engenty/wizards/dist/plugin/thread.d.ts +0 -174
  441. package/node_modules/@engenty/wizards/dist/plugin/thread.js +0 -821
  442. package/node_modules/@engenty/wizards/package.json +0 -11
  443. package/node_modules/@engenty-wizards/shared/dist/assistant.d.ts +0 -174
  444. package/node_modules/@engenty-wizards/shared/dist/assistant.js +0 -65
  445. package/node_modules/@engenty-wizards/shared/dist/changes.d.ts +0 -22
  446. package/node_modules/@engenty-wizards/shared/dist/changes.js +0 -61
  447. package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +0 -77
  448. package/node_modules/@engenty-wizards/shared/dist/connectors.js +0 -2
  449. package/node_modules/@engenty-wizards/shared/dist/decision.d.ts +0 -76
  450. package/node_modules/@engenty-wizards/shared/dist/decision.js +0 -147
  451. package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +0 -2922
  452. package/node_modules/@engenty-wizards/shared/dist/definition.js +0 -1920
  453. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +0 -5
  454. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +0 -132
  455. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +0 -11
  456. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +0 -209
  457. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +0 -532
  458. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +0 -217
  459. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +0 -3
  460. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +0 -3
  461. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +0 -14
  462. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +0 -166
  463. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +0 -33
  464. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +0 -99
  465. package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +0 -78
  466. package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +0 -70
  467. package/node_modules/@engenty-wizards/shared/dist/features.d.ts +0 -41
  468. package/node_modules/@engenty-wizards/shared/dist/features.js +0 -89
  469. package/node_modules/@engenty-wizards/shared/dist/fit.d.ts +0 -71
  470. package/node_modules/@engenty-wizards/shared/dist/fit.js +0 -382
  471. package/node_modules/@engenty-wizards/shared/dist/json-schema.d.ts +0 -14
  472. package/node_modules/@engenty-wizards/shared/dist/json-schema.js +0 -66
  473. package/node_modules/@engenty-wizards/shared/dist/knowledge.d.ts +0 -199
  474. package/node_modules/@engenty-wizards/shared/dist/knowledge.js +0 -68
  475. package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +0 -35
  476. package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +0 -107
  477. package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +0 -20
  478. package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +0 -136
  479. package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +0 -227
  480. package/node_modules/@engenty-wizards/shared/dist/marketplace.js +0 -354
  481. package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +0 -7
  482. package/node_modules/@engenty-wizards/shared/dist/merge.js +0 -40
  483. package/node_modules/@engenty-wizards/shared/dist/numbers.d.ts +0 -24
  484. package/node_modules/@engenty-wizards/shared/dist/numbers.js +0 -54
  485. package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +0 -224
  486. package/node_modules/@engenty-wizards/shared/dist/projects.js +0 -319
  487. package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +0 -101
  488. package/node_modules/@engenty-wizards/shared/dist/providers.js +0 -390
  489. package/node_modules/@engenty-wizards/shared/dist/run.d.ts +0 -680
  490. package/node_modules/@engenty-wizards/shared/dist/run.js +0 -620
  491. package/node_modules/@engenty-wizards/shared/dist/runner-texts.d.ts +0 -546
  492. package/node_modules/@engenty-wizards/shared/dist/runner-texts.js +0 -523
  493. package/node_modules/@engenty-wizards/shared/dist/runners.d.ts +0 -93
  494. package/node_modules/@engenty-wizards/shared/dist/runners.js +0 -146
  495. package/node_modules/@engenty-wizards/shared/dist/shape.d.ts +0 -102
  496. package/node_modules/@engenty-wizards/shared/dist/shape.js +0 -318
  497. package/node_modules/@engenty-wizards/shared/dist/space-data.d.ts +0 -89
  498. package/node_modules/@engenty-wizards/shared/dist/space-data.js +0 -47
  499. package/node_modules/@engenty-wizards/shared/dist/store.d.ts +0 -117
  500. package/node_modules/@engenty-wizards/shared/dist/store.js +0 -81
  501. package/node_modules/@engenty-wizards/shared/dist/surface.d.ts +0 -115
  502. package/node_modules/@engenty-wizards/shared/dist/surface.js +0 -442
  503. package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +0 -45
  504. package/node_modules/@engenty-wizards/shared/dist/texts.js +0 -54
  505. package/node_modules/@engenty-wizards/shared/dist/translation.d.ts +0 -23
  506. package/node_modules/@engenty-wizards/shared/dist/translation.js +0 -154
  507. package/node_modules/@engenty-wizards/shared/dist/wizard-package.d.ts +0 -48
  508. package/node_modules/@engenty-wizards/shared/dist/wizard-package.js +0 -49
  509. package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +0 -16
  510. package/node_modules/@engenty-wizards/shared/dist/workspace.js +0 -51
  511. package/node_modules/@engenty-wizards/shared/package.json +0 -10
  512. package/plugin/.claude-plugin/plugin.json +0 -9
  513. package/plugin/.mcp.json +0 -8
  514. package/plugin/commands/wizard.md +0 -8
  515. package/plugin/skills/build-wizard/SKILL.md +0 -27
  516. package/plugin/skills/use-wizard/SKILL.md +0 -18
@@ -1,1150 +0,0 @@
1
- import type { LibSQLDatabase } from "drizzle-orm/libsql";
2
- import type { z } from "zod";
3
- /**
4
- * What the runtime hands a plugin's server half. A plugin is a file or a folder the runtime finds
5
- * at start (docs/content/dev/plugins); its default export is a factory that registers what it adds. The
6
- * runtime remembers every registration under the plugin's id and takes it back when the plugin
7
- * unloads or reloads.
8
- */
9
- /** `engenty.plugin.json`, the file an engenty module has too. A plugin of one file has none. */
10
- export interface PluginManifest {
11
- /** Lower case, digits and `-`: part of the plugin's addresses and of its tools' ids. */
12
- id: string;
13
- name: string;
14
- version: string;
15
- description?: string;
16
- kind?: string;
17
- provides?: string[];
18
- requires?: string[];
19
- /** The server half, from the plugin's folder. Default `src/plugin.ts`. */
20
- server?: string;
21
- /** The studio half, built. Default `dist/client.js`. */
22
- studio?: string;
23
- /** The studio half's styles, built. Default `dist/client.css`. */
24
- styles?: string;
25
- /**
26
- * The plugin's feature switches, by short name; each is known as `<id>.<name>` everywhere
27
- * (`wizards features`, the `.features` file, the Manage-App's admin). `true`/`false` is the
28
- * default alone; a `plan` switch is one a plan includes.
29
- */
30
- features?: Record<string, boolean | {
31
- kind?: "release" | "plan";
32
- default?: boolean;
33
- label?: string;
34
- hint?: string;
35
- }>;
36
- }
37
- export type PluginRole = "owner" | "admin" | "member";
38
- /** The signed-in person a request acts as. */
39
- export interface PluginPrincipal {
40
- id: string;
41
- tenantId: string;
42
- role: PluginRole;
43
- name: string;
44
- email: string;
45
- }
46
- export interface PluginRequest {
47
- /** The web request as it came in. */
48
- request: Request;
49
- /** The address below the plugin's own: `/` for `/api/studio/plugins/<id>/`. */
50
- path: string;
51
- /** What `:name` parts of the route's path matched. */
52
- params: Record<string, string>;
53
- query: URLSearchParams;
54
- user: PluginPrincipal;
55
- /** The body as JSON; an empty body is `{}`. */
56
- json<T = unknown>(): Promise<T>;
57
- }
58
- export type PluginHttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
59
- /** A route below `/api/studio/plugins/<id>`: signed in, inside the person's tenant. */
60
- export interface PluginRoute {
61
- method: PluginHttpMethod;
62
- /** `/`, `/items`, `/items/:id`. */
63
- path: string;
64
- /** `admin`: owners and admins only. Default: every member. */
65
- role?: "member" | "admin";
66
- /**
67
- * Answers with a `Response`, or with a value that goes out as JSON. An error thrown with a
68
- * `status` and a `code` goes out as `{ error, code }` with that status.
69
- */
70
- handler(request: PluginRequest): unknown | Promise<unknown>;
71
- }
72
- /** A space: what all its wizards share. The runtime's own tables call it a project. */
73
- export interface PluginSpace {
74
- id: string;
75
- /** What the studio's switcher calls it. */
76
- name: string;
77
- }
78
- /** What a tool knows about the step that calls it. */
79
- export interface PluginStepContext {
80
- runId: string;
81
- stepId: string;
82
- tenantId: string;
83
- /** The space of the step's wizard. */
84
- space: PluginSpace;
85
- /** The same as `space`, by its older name. */
86
- project: {
87
- id: string;
88
- name: string;
89
- };
90
- wizard: {
91
- id: string;
92
- title: string;
93
- };
94
- /** "test": a test run from the studio. Keep what it makes apart from what real runs make. */
95
- mode: "test" | "live";
96
- /** Aborted when the run is cancelled. */
97
- signal: AbortSignal;
98
- /** Tells the person what the step is doing right now. */
99
- emit(message: string): Promise<void>;
100
- }
101
- /** A tool for agent steps. A step allowlists it as `<plugin id>.<name>`. */
102
- export interface PluginTool<S extends z.ZodType = z.ZodType> {
103
- /** Lower case, digits and `_`. */
104
- name: string;
105
- /** What the editor calls it; default: the name. */
106
- title?: string;
107
- /** For the model: what the tool does and when to use it. */
108
- description: string;
109
- inputSchema: S;
110
- execute(input: z.infer<S>, ctx: PluginStepContext): unknown | Promise<unknown>;
111
- }
112
- /** A run that reached its end. It fires again when a finished run is redone and ends again. */
113
- export interface PluginRunEvent {
114
- run: {
115
- id: string;
116
- wizardId: string;
117
- mode: "test" | "live";
118
- status: "done" | "failed" | "cancelled";
119
- };
120
- wizard: {
121
- id: string;
122
- title: string;
123
- projectId: string;
124
- };
125
- /** What the person answered, by field id. */
126
- values: Record<string, unknown>;
127
- }
128
- /** A space was made, changed (title, about, colours, facts, systems) or deleted. */
129
- export interface PluginSpaceEvent {
130
- space: {
131
- id: string;
132
- };
133
- }
134
- /** A file of a space: read and ready (a document is in the index then), or removed. */
135
- export interface PluginSpaceFileEvent {
136
- space: {
137
- id: string;
138
- };
139
- file: {
140
- id: string;
141
- name: string;
142
- kind: "logo" | "asset" | "document" | "pattern";
143
- mime: string;
144
- };
145
- }
146
- export interface PluginEvents {
147
- "run.done": PluginRunEvent;
148
- "run.failed": PluginRunEvent;
149
- "run.cancelled": PluginRunEvent;
150
- "space.created": PluginSpaceEvent;
151
- "space.updated": PluginSpaceEvent;
152
- "space.deleted": PluginSpaceEvent;
153
- "space.file.ready": PluginSpaceFileEvent;
154
- "space.file.removed": PluginSpaceFileEvent;
155
- }
156
- /** The tenant's database. A plugin reads and writes its own tables with it. */
157
- export type PluginDb = LibSQLDatabase<Record<string, never>>;
158
- /** What a plugin asks a model. */
159
- export interface PluginGenerateRequest<T = undefined> {
160
- prompt: string;
161
- system?: string;
162
- /** The answer as an object of this shape instead of text. */
163
- schema?: z.ZodType<T>;
164
- /** The tenant's model class. Default `standard`; `classifier` is the fast, cheap one. */
165
- model?: "classifier" | "standard" | "high" | "highest";
166
- maxOutputTokens?: number;
167
- /** Default: two minutes. */
168
- signal?: AbortSignal;
169
- /**
170
- * Pictures (PNG, JPEG, WebP, GIF) and PDFs the model looks at with the prompt: a screenshot to
171
- * build after, a brand guide. Text files go into the prompt as text.
172
- */
173
- files?: {
174
- data: Uint8Array;
175
- mediaType: string;
176
- name?: string;
177
- }[];
178
- }
179
- export interface PluginGenerateResult<T = undefined> {
180
- text: string;
181
- /** Set when the request had a `schema`. */
182
- object: T;
183
- }
184
- /** What a plugin adds to the AI steps of a space's wizards: every agent step, unless `steps` says. */
185
- export interface PluginSpaceContext {
186
- /**
187
- * A block of the step's instructions, after what the space says about itself and its
188
- * documents: what the plugin holds for the space, and which of its tools read it. Empty or
189
- * null: the step gets neither the block nor the tools.
190
- */
191
- block(space: PluginSpace): string | null | Promise<string | null>;
192
- /** Tools the step gets with the block, named `<plugin>_<name>` for the model. */
193
- tools?: PluginTool[];
194
- /**
195
- * The steps that get it: `agent` (default), `html` — the steps that write a document or a
196
- * dashboard as HTML, which get the block without the tools.
197
- */
198
- steps?: ("agent" | "html")[];
199
- }
200
- /** A space's brand as the studio's Info & brand has it: what a plugin draws or writes in its look. */
201
- export interface PluginBrand {
202
- /** The title end users see. */
203
- name: string;
204
- /** The colours in order: the first is the accent. */
205
- colors: {
206
- name: string;
207
- value: string;
208
- }[];
209
- /** The fonts, each with what it is for ("Headings") and the weights the brand uses. */
210
- fonts: {
211
- family: string;
212
- role: string;
213
- weights: number[];
214
- }[];
215
- }
216
- /** A text a plugin puts into a space's search index, beside the space's documents. */
217
- export interface PluginIndexEntry {
218
- /** The space's id. */
219
- space: string;
220
- /** The plugin's own name for it: putting the same key again replaces what it had. */
221
- key: string;
222
- /** What a hit is called: a page's title, a question. */
223
- title: string;
224
- /** Markdown, cut into passages like a document's text. */
225
- text: string;
226
- /** Where the studio shows it, an address of the studio: `/space#faq`. */
227
- link?: string;
228
- }
229
- export interface PluginIndex {
230
- /** Puts the entry in; `project_search` finds it from then on. */
231
- put(entry: PluginIndexEntry): Promise<void>;
232
- /** Takes one key out, or without a key every entry of the plugin in the space. */
233
- remove(space: string, key?: string): Promise<void>;
234
- }
235
- /** A category of a space: a typed property set on pages, tables, rows and files of Knowledge. */
236
- export interface PluginCategory {
237
- name: string;
238
- type: "choice" | "date" | "number" | "text" | "boolean";
239
- /** A number's unit: `h`, `€`, `kg`. */
240
- unit?: string;
241
- /** A choice: several values per item. */
242
- multiple?: boolean;
243
- /** A choice whose values are ranked, in the order of `values`. */
244
- ordered?: boolean;
245
- /** Where its values come from, in a few words: "Kopfzeile", "Filter der Website". */
246
- hint?: string;
247
- /** A choice's values, known beforehand: a site's filter. Others are added as items bring them. */
248
- values?: string[];
249
- /** A column of a table the plugin wrote (by the table's key) whose cells are its values. */
250
- column?: {
251
- table: string;
252
- column: string;
253
- };
254
- }
255
- /**
256
- * Categories of an item, by their names: a choice's value (or a list of them), a day as
257
- * `YYYY-MM-DD`, a number, a short text, true or false. Null takes one off.
258
- */
259
- export type PluginCategoryValues = Record<string, string | number | boolean | (string | number)[] | null>;
260
- /** The original an item was read from, kept as the evidence beside it. */
261
- export interface PluginOriginal {
262
- name: string;
263
- mime: string;
264
- data: Uint8Array;
265
- }
266
- /** `written`: the plugin's version stands. `kept`: a person changed it, the plugin no longer writes it. */
267
- export type PluginItemState = "written" | "kept";
268
- export interface PluginPageInput {
269
- space: string;
270
- /** The plugin's own name for the page: the same key again rewrites it, never doubles it. */
271
- key: string;
272
- /** What the person knows its source as: "Tagesberichte". */
273
- label?: string;
274
- title: string;
275
- markdown: string;
276
- /** The key of a page the plugin wrote before, to stand under it as a sub-page. */
277
- parent?: string;
278
- position?: number;
279
- original?: PluginOriginal;
280
- categories?: PluginCategoryValues;
281
- /** A model fills the space's categories the page did not get from `categories`. */
282
- fill?: boolean;
283
- /** Why a person should look at it ("hardly readable"); shown in Knowledge. */
284
- review?: string | null;
285
- }
286
- export interface PluginTableInput {
287
- space: string;
288
- key: string;
289
- label?: string;
290
- title: string;
291
- /** Typed columns, as a table of the space has them (`text`, `number`, `date`, `select` …). */
292
- columns: unknown[];
293
- /** Cells by column id. They replace the rows the key had. */
294
- rows: Record<string, unknown>[];
295
- /** `faq`: a question and its answer per row. */
296
- format?: "faq";
297
- original?: PluginOriginal;
298
- categories?: PluginCategoryValues;
299
- review?: string | null;
300
- }
301
- export interface PluginFileInput {
302
- space: string;
303
- key: string;
304
- label?: string;
305
- name: string;
306
- mime: string;
307
- data: Uint8Array;
308
- /** What it is, in a sentence: a file that is no page is found by its name and this. */
309
- description?: string;
310
- /** What a step reads of it, when there is text. */
311
- text?: string;
312
- categories?: PluginCategoryValues;
313
- }
314
- export interface PluginDocumentInput {
315
- space: string;
316
- key: string;
317
- label?: string;
318
- name: string;
319
- mime: string;
320
- data: Uint8Array;
321
- /** Set on what it becomes: its first page, its first table, or the file. */
322
- categories?: PluginCategoryValues;
323
- /** A model fills the space's categories it did not get from `categories`. */
324
- fill?: boolean;
325
- }
326
- /** What a document became: pages and tables (the first is the one it is found as), or a file. */
327
- export interface PluginDocumentResult {
328
- /** The file, kept as the original. */
329
- id: string;
330
- path: string;
331
- state: PluginItemState;
332
- items: {
333
- kind: "page" | "table";
334
- id: string;
335
- path: string;
336
- title: string;
337
- }[];
338
- /** Why a person should look at it: hardly readable, or not readable at all. */
339
- review: string | null;
340
- }
341
- /** A page of a space, as a plugin reads it. */
342
- export interface PluginSpacePage {
343
- id: string;
344
- title: string;
345
- /** How a step names it: `pages/…`. */
346
- path: string;
347
- parentId: string | null;
348
- markdown: string;
349
- /** The plugin that wrote it, or null for one made in the studio or uploaded. */
350
- origin: string | null;
351
- originKey: string | null;
352
- updatedAt: string;
353
- }
354
- /** A file of a space, as a plugin reads it. */
355
- export interface PluginSpaceFile {
356
- id: string;
357
- name: string;
358
- mime: string;
359
- size: number;
360
- kind: "logo" | "asset" | "document" | "pattern";
361
- updatedAt: string;
362
- }
363
- /** What a plugin wrote into a space. */
364
- export interface PluginSpaceItem {
365
- key: string;
366
- kind: "page" | "table" | "file";
367
- id: string;
368
- title: string;
369
- /** How a step names it: `pages/…`, `tables/…`, `files/…`. */
370
- path: string;
371
- state: PluginItemState;
372
- review: string | null;
373
- updatedAt: string;
374
- }
375
- /**
376
- * Knowledge of a space, written by a plugin: pages, tables and files under keys of its own, with
377
- * their categories. Every write is indexed: `project_search` finds it a moment later.
378
- */
379
- export interface PluginSpaceData {
380
- /**
381
- * Adds categories to the space, or values to ones it has. `proposed`: shown to the person to
382
- * confirm, never filled before; a later call without it takes them.
383
- */
384
- putCategories(input: {
385
- space: string;
386
- categories: PluginCategory[];
387
- proposed?: boolean;
388
- }): Promise<void>;
389
- putPage(input: PluginPageInput): Promise<{
390
- id: string;
391
- path: string;
392
- state: PluginItemState;
393
- }>;
394
- putTable(input: PluginTableInput): Promise<{
395
- id: string;
396
- path: string;
397
- state: PluginItemState;
398
- }>;
399
- putFile(input: PluginFileInput): Promise<{
400
- id: string;
401
- path: string;
402
- }>;
403
- /**
404
- * A document read as an upload is: a page (sub-pages when it is long and has headings of its
405
- * own), a table per sheet of a workbook, or a file when nothing reads it. The document stays as
406
- * the original. The same key again reads it again, unless a person changed what it became.
407
- */
408
- putDocument(input: PluginDocumentInput): Promise<PluginDocumentResult>;
409
- /** Everything the plugin wrote into the space. */
410
- list(space: string): Promise<PluginSpaceItem[]>;
411
- /**
412
- * The space's own pages (not a wizard's), whoever wrote them, with their Markdown: for a
413
- * plugin that reads what the space knows. `parent`: only the pages under that page.
414
- */
415
- readPages(space: string, opts?: {
416
- parent?: string;
417
- }): Promise<PluginSpacePage[]>;
418
- /** The space's files of a kind (`document` when left out), newest first. */
419
- files(space: string, kind?: "logo" | "asset" | "document" | "pattern"): Promise<PluginSpaceFile[]>;
420
- /** One file of the space with its bytes: a price list someone dropped into Knowledge. */
421
- readFile(space: string, fileId: string): Promise<PluginSpaceFile & {
422
- data: Uint8Array;
423
- }>;
424
- /** Takes out one key, or every item of the plugin in the space; what a person changed stays. */
425
- remove(space: string, key?: string): Promise<number>;
426
- /**
427
- * Writes the summary of values: of one, or of every value of a choice (or of every choice)
428
- * that has three items or more. Returns how many were written. Costs a model call each.
429
- */
430
- summarize(space: string, category?: string, value?: string): Promise<number>;
431
- }
432
- /** What a tool of the space assistant knows about the turn that calls it. */
433
- export interface PluginAssistantContext {
434
- tenantId: string;
435
- space: PluginSpace;
436
- /** The person talking to the assistant. */
437
- userId: string;
438
- /** Aborted when the person leaves or stops the turn. */
439
- signal: AbortSignal;
440
- /** Tells the person what the assistant is doing right now: "Liest die Sitemap …". */
441
- emit(message: string): void;
442
- /** Say so when the tool changed what the space page shows: the page draws it again. */
443
- changed(): void;
444
- }
445
- /** A tool of the space assistant: the chat on the space page that fills the space in. */
446
- export interface PluginAssistantTool<S extends z.ZodType = z.ZodType> {
447
- /** Lower case, digits and `_`. The model sees it as `<plugin>_<name>`. */
448
- name: string;
449
- /** For the model: what the tool does and when to use it. */
450
- description: string;
451
- inputSchema: S;
452
- /**
453
- * The result also goes to the chat, where the card the studio half registered for this tool
454
- * (`registerAssistantCard`) draws it. It is sent as it is: keep such a result small.
455
- */
456
- card?: boolean;
457
- execute(input: z.infer<S>, ctx: PluginAssistantContext): unknown | Promise<unknown>;
458
- }
459
- /** A page of the web, as `web.read` gives it. */
460
- export interface PluginWebPage {
461
- /** Where it ended up, after redirects. */
462
- url: string;
463
- status: number;
464
- /** As the server sent them, for asking later whether the page changed. */
465
- etag: string | null;
466
- lastModified: string | null;
467
- title: string;
468
- description: string;
469
- /** The page's text as Markdown. */
470
- text: string;
471
- /** Every link of the page, absolute, each once. */
472
- links: {
473
- url: string;
474
- text: string;
475
- }[];
476
- /**
477
- * The page's structured data: its `application/ld+json` blocks, parsed, a `@graph` spread
478
- * out. A shop's product page says title, price, availability and image here exactly.
479
- */
480
- jsonld: unknown[];
481
- }
482
- export interface PluginWeb {
483
- /**
484
- * `fetch`, behind the guard of the runtime's own requests: addresses of this machine and of
485
- * the local network are refused, after a redirect too.
486
- */
487
- fetch(url: string, init?: RequestInit): Promise<Response>;
488
- /**
489
- * A page read the way the space assistant reads one: guarded as `fetch`, and drawn in a
490
- * browser when it has hardly any text without its scripts.
491
- */
492
- read(url: string, options?: {
493
- signal?: AbortSignal;
494
- }): Promise<PluginWebPage>;
495
- }
496
- export interface PluginDocuments {
497
- /**
498
- * A file as Markdown: PDF and Word by their text, scans and photos by a vision model (paid
499
- * like every model call), spreadsheets as tables. Kept by content: the same bytes are read once.
500
- */
501
- parse(file: {
502
- data: Uint8Array;
503
- name: string;
504
- mime: string;
505
- }, options?: {
506
- signal?: AbortSignal;
507
- }): Promise<{
508
- markdown: string;
509
- pages: number | null;
510
- }>;
511
- }
512
- /** One turn of a job `every` runs. */
513
- export interface PluginTick {
514
- tenantId: string;
515
- /** When it ran for this tenant before; null the first time. */
516
- lastRun: Date | null;
517
- /** Aborted when the plugin unloads. */
518
- signal: AbortSignal;
519
- }
520
- /** What a public route's handler gets. Nobody is signed in. */
521
- export interface PluginPublicRequest {
522
- request: Request;
523
- /** The address below the plugin's public one. */
524
- path: string;
525
- params: Record<string, string>;
526
- query: URLSearchParams;
527
- /** The tenant whose address was called; the handler runs inside it. */
528
- tenantId: string;
529
- json<T = unknown>(): Promise<T>;
530
- }
531
- /**
532
- * A route anyone may call, below the address `publicUrl` gives: a CMS that says a page
533
- * changed, a service's webhook. Check a secret of your own in it, a token or a signature.
534
- */
535
- export interface PluginPublicRoute {
536
- method: PluginHttpMethod;
537
- path: string;
538
- handler(request: PluginPublicRequest): unknown | Promise<unknown>;
539
- }
540
- /** What a shared route's handler gets: nobody is signed in, and no tenant yet. */
541
- export interface PluginSharedRequest {
542
- request: Request;
543
- /** The address below the plugin's shared one. */
544
- path: string;
545
- params: Record<string, string>;
546
- query: URLSearchParams;
547
- /**
548
- * Runs `work` inside the tenant whose public address has this ref (`server.publicRef()`),
549
- * when the tenant is active and has the plugin. Throws with the status `404` and the code
550
- * `not_found` otherwise.
551
- */
552
- inTenant<T>(ref: string, work: () => T | Promise<T>): Promise<T>;
553
- }
554
- /**
555
- * A route for every tenant at once, at the address `sharedUrl` gives: for a service that posts
556
- * to one webhook for all of them (one account of the runtime's, one app). The call names its
557
- * tenant only by what it carries – the ref of the tenant's address, handed to the service
558
- * before (`publicRef`) – so check the service's signature first, then `inTenant`.
559
- */
560
- export interface PluginSharedRoute {
561
- method: PluginHttpMethod;
562
- path: string;
563
- handler(request: PluginSharedRequest): unknown | Promise<unknown>;
564
- }
565
- /** A kind of use of a number of the Manage-App's. */
566
- export type PluginChannelKind = "sms" | "call" | "whatsapp";
567
- /**
568
- * The numbers a Manage-App gives the tenant (docs/manage-contract.md): its own number for
569
- * texts and calls, asked for and assigned there, and the numbers every tenant shares.
570
- */
571
- export interface PluginChannels {
572
- number: {
573
- /** With the country code: `+43…`. */
574
- number: string;
575
- /** ISO 3166, upper case: `AT`. */
576
- country: string;
577
- kinds: PluginChannelKind[];
578
- /** The provider's id of the number (Twilio's `PN…`); null when none was entered. */
579
- providerRef: string | null;
580
- } | null;
581
- /** The tenant's open request for its number; null for none. */
582
- request: {
583
- id: string;
584
- country: string;
585
- wish: string | null;
586
- createdAt: string;
587
- } | null;
588
- shared: {
589
- number: string;
590
- country: string;
591
- kinds: PluginChannelKind[];
592
- }[];
593
- /** The tenant's plan has a number of its own; false on a plan without one (Free). */
594
- allowed: boolean;
595
- }
596
- /** An account a plugin connected for a space: a calendar, a mailbox. */
597
- export interface PluginConnection {
598
- id: string;
599
- /** The space it was connected for. */
600
- space: string;
601
- /** The built-in connector behind it: `google-calendar`, `microsoft-outlook`. */
602
- connector: string;
603
- /** The account, as the provider names it: an e-mail address. */
604
- label: string;
605
- /** The actions it was connected for; the provider granted what they need. */
606
- actions: string[];
607
- createdAt: string;
608
- }
609
- /**
610
- * Accounts a plugin connects on its own, for a space rather than for a wizard's run: the
611
- * runtime's built-in connectors (Google, Microsoft, …), signed in with OAuth. The runtime keeps
612
- * the tokens sealed, refreshes them, and on a local install connects Google through the linked
613
- * account's Manage-App, as it does for wizards.
614
- */
615
- /** A connector a plugin may connect: signed in with OAuth, or with keys the person types. */
616
- export interface PluginConnectorOffer {
617
- id: string;
618
- name: string;
619
- auth: "oauth2" | "api_key";
620
- /** `api_key`: what to ask the person for, in this order. */
621
- fields?: {
622
- key: string;
623
- label: string;
624
- placeholder?: string;
625
- /** Default: true. */
626
- required?: boolean;
627
- /** A password field: never shown again. */
628
- secret?: boolean;
629
- }[];
630
- }
631
- export interface PluginConnections {
632
- /** Of these connector ids, the ones a person can connect on this runtime now, with their names. */
633
- available(connectors: string[]): Promise<PluginConnectorOffer[]>;
634
- /**
635
- * The provider's sign-in page of an `oauth2` connector. Open it in a window: when the person
636
- * is done, the window posts `{ type: "wizards:connected", ok }` to the studio and closes.
637
- * `actions` are the connector's actions the plugin will call; only the rights they need are
638
- * asked for. `lang` is the language the person reads; the page they come back to speaks it,
639
- * else their browser's.
640
- */
641
- start(input: {
642
- space: string;
643
- connector: string;
644
- actions: string[];
645
- lang?: "de" | "en";
646
- }): Promise<{
647
- url: string;
648
- }>;
649
- /**
650
- * Connects an `api_key` connector with the keys the person typed (`fields` of the offer, by
651
- * key). The connector tries them once first; keys it refuses throw an error with the status
652
- * `400` and the code `credentials`, whose message says what was wrong. The same account
653
- * connected again for the space replaces the first connection's keys and actions.
654
- */
655
- connect(input: {
656
- space: string;
657
- connector: string;
658
- actions: string[];
659
- credentials: Record<string, string>;
660
- }): Promise<PluginConnection>;
661
- /** What is connected for the space, the newest first. */
662
- list(space: string): Promise<PluginConnection[]>;
663
- /** One connection by its id, or null. */
664
- get(connectionId: string): Promise<PluginConnection | null>;
665
- /**
666
- * Runs one of the connector's actions with the connection's account. Throws when the action
667
- * is not one the connection was made for, or when the provider refuses (the account was
668
- * disconnected there: connect again).
669
- */
670
- call<T = unknown>(connectionId: string, action: string, input: Record<string, unknown>): Promise<T>;
671
- /** Forgets the connection and its tokens. */
672
- remove(connectionId: string): Promise<void>;
673
- }
674
- /**
675
- * A wizard a plugin brings as a template: offered beside the marketplace's starters when a
676
- * wizard is made, and to the assistant and AI apps as an example to copy.
677
- */
678
- export interface PluginStarter {
679
- /** Lower case, digits and `-`; the starter is known as `<plugin id>.<id>`. */
680
- id: string;
681
- title: string;
682
- /** What it makes, in one or two sentences. */
683
- description: string;
684
- /** The language its texts are in. Default: English. */
685
- language?: "de" | "en";
686
- /** A complete wizard definition. Checked when it is registered. */
687
- definition: unknown;
688
- /** Workspace files it needs (widgets, sample data), by path. */
689
- files?: Record<string, string | Uint8Array>;
690
- }
691
- /**
692
- * What the space assistant is told when the admin talks to it from the plugin's own page (the
693
- * studio half's `studio.Assistant`): what the page holds now, so it can change it with the
694
- * plugin's assistant tools.
695
- */
696
- export interface PluginAssistantPage {
697
- /** Text for the assistant: the state of the page, in a few lines. Cut at 8,000 characters. */
698
- block(space: PluginSpace): string | null | Promise<string | null>;
699
- }
700
- /** What a runner can take in and show; the runtime works out per wizard how far it gets. */
701
- export interface PluginRunnerCapabilities {
702
- /** The field kinds the runner asks itself (`text`, `select`, `image`, …); the rest hand off. */
703
- input: string[];
704
- output: {
705
- /** What it shows as it is: `text`, `data`, `image`, `video`, `voice`, `document`, `dashboard`, `widget`, `film`, `surface`. */
706
- shows: string[];
707
- /** What it shows as a picture with a link to the real thing. Anything else is a link. */
708
- pictures: string[];
709
- };
710
- /** A sign-in is typed on a page the model never sees: only a browser can take it. */
711
- asks: ("confirm" | "login")[];
712
- review: ("accept" | "regenerate" | "edit")[];
713
- /** Stays through a step that takes minutes, with a note now and then. */
714
- waits: boolean;
715
- /** How a link to the run page reaches the person for what the runner cannot do itself. */
716
- handoff: ("screen" | "thread" | "sms" | "push")[];
717
- }
718
- /** What a page runner's handler gets: the wizard behind the address, nobody signed in. */
719
- export interface PluginRunnerRequest {
720
- request: Request;
721
- tenantId: string;
722
- wizard: {
723
- id: string;
724
- token: string;
725
- title: string;
726
- };
727
- /** The rest of the address below `/w/<token>/<runner>`. */
728
- path: string;
729
- query: URLSearchParams;
730
- }
731
- /**
732
- * Where a person reaches a wizard through a channel runner, as the share dialog shows it: the
733
- * number with the keyword that picks the wizard there, and the link that opens the channel with
734
- * the keyword written.
735
- */
736
- export interface PluginRunnerAddress {
737
- /** The number people write to or call, with the country code: `+43660…`. */
738
- number?: string | null;
739
- /** The word that picks this wizard on that number. */
740
- keyword?: string | null;
741
- /** Opens the channel with the keyword written (`sms:…`, `https://wa.me/…`): copied, and as a QR code. */
742
- link?: string | null;
743
- }
744
- /** A runner's problem, with what the share dialog's row says about it. */
745
- export interface PluginRunnerProblem {
746
- /** In the owner's words, as a text problem. */
747
- text: string;
748
- /**
749
- * `setup` (the default): something to set up, the row offers "Einrichten". `waiting`: set up
750
- * and waiting for someone else (a number asked for), nothing to do. `plan`: the tenant's plan
751
- * does not have it, the row offers the plans.
752
- */
753
- kind?: "setup" | "waiting" | "plan";
754
- /** What the row says instead of "Noch nicht eingerichtet": "Nummer angefragt", "Ab Pro". */
755
- note?: {
756
- de: string;
757
- en: string;
758
- };
759
- /** `plan`: the plan that has it, for the row's button ("Pro ansehen"). */
760
- plan?: string;
761
- }
762
- /**
763
- * A runner: a door a wizard runs through, beside the built-in page and chat. A `page` runner is
764
- * served at `/w/<token>/<id>` for every wizard that switched it on; a `channel` runner has an
765
- * address of its own (a number, a bot) and drives runs from its webhooks.
766
- */
767
- export interface PluginRunner {
768
- /** Lower case, digits and "-", at most 24 characters; the sub-path of the wizard's address. */
769
- id: string;
770
- label: {
771
- de: string;
772
- en: string;
773
- };
774
- kind: "page" | "channel";
775
- capabilities: PluginRunnerCapabilities;
776
- /** A page runner: what its address answers with. */
777
- page?(request: PluginRunnerRequest): Response | Promise<Response>;
778
- /**
779
- * Why the runner cannot be used in the current tenant right now, in the owner's words ("Not
780
- * connected: Settings → WhatsApp"), or null when it can. Asked inside the tenant whenever the
781
- * studio lists the runners; a runner with a problem cannot be switched on. A text is something
782
- * to set up: the share dialog's row says so and offers "Einrichten". An object says what kind of
783
- * problem it is.
784
- */
785
- problem?(): string | PluginRunnerProblem | null | Promise<string | PluginRunnerProblem | null>;
786
- /**
787
- * A channel runner: where a person reaches the wizard, for the share dialog; null while the
788
- * runner is not set up. Asked inside the tenant for each wizard that has the runner on.
789
- */
790
- address?(wizard: {
791
- id: string;
792
- title: string;
793
- token: string;
794
- }): PluginRunnerAddress | null | Promise<PluginRunnerAddress | null>;
795
- }
796
- /**
797
- * How a run answers a review: accept it, with edits where the review allows (a text, or the
798
- * data of a json step), or ask for one of the shown steps again.
799
- */
800
- export type PluginReviewAction = {
801
- type: "accept";
802
- edits?: Record<string, string | Record<string, unknown>>;
803
- } | {
804
- type: "regenerate";
805
- target: string;
806
- note: string;
807
- items?: number[];
808
- };
809
- /** A field of the page a run waits for, as the report lists it. */
810
- export interface PluginRunField {
811
- id: string;
812
- label: string;
813
- kind: string;
814
- required: boolean;
815
- options?: string[];
816
- placeholder?: string;
817
- help?: string;
818
- default?: unknown;
819
- value?: unknown;
820
- columns?: unknown;
821
- /** An image or file field that takes several: the value is then a list of asset ids. */
822
- multiple?: boolean;
823
- /** Answerable as a value; false for what only the person's device gives (a file, a signature). */
824
- inChat: boolean;
825
- /** A condition on earlier answers; the field is asked only while it holds. */
826
- when?: unknown;
827
- /** Whether `when` holds on what is known now. */
828
- shown?: boolean;
829
- }
830
- /** What a run waits for: a page, a review, or a question of a running step. */
831
- export type PluginRunWaiting = {
832
- page: string;
833
- title: string;
834
- known: Record<string, unknown>;
835
- fields: PluginRunField[];
836
- hint: string;
837
- } | {
838
- review: string;
839
- title: string;
840
- show: string[];
841
- editable: boolean;
842
- hint: string;
843
- } | {
844
- ask: string;
845
- kind: "confirm";
846
- reason: string;
847
- service: string;
848
- action: string;
849
- input: string;
850
- hint: string;
851
- } | {
852
- ask: string;
853
- kind: "login";
854
- reason: string;
855
- site: string;
856
- hint: string;
857
- };
858
- /** What a run did so far, as the MCP tools report it: outputs with signed links, cost, errors. */
859
- export interface PluginRunReport {
860
- runId: string;
861
- wizardId: string;
862
- mode: "test" | "live";
863
- /** The wizard's language: what to say to the person in. */
864
- lang: "de" | "en";
865
- status: "waiting_input" | "running" | "done" | "failed" | "cancelled";
866
- step: {
867
- id: string;
868
- type: string;
869
- title: string;
870
- } | null;
871
- passed: string[];
872
- waitingFor?: PluginRunWaiting;
873
- error: string | null;
874
- credits: number;
875
- events: {
876
- step: string | null;
877
- type: string;
878
- message: string;
879
- }[];
880
- outputs: {
881
- stepId: string;
882
- title: string;
883
- text?: string;
884
- json?: string;
885
- assets: {
886
- name: string;
887
- mime: string;
888
- url: string;
889
- }[];
890
- /** Signed download links by format, valid one hour. */
891
- downloads: Record<string, string>;
892
- /** A signed link to the output as a PNG, for a door that shows a picture with a link; null where it is one already, or has no picture. */
893
- picture: string | null;
894
- }[];
895
- /** The run page, for what the door cannot do itself. */
896
- browserUrl: string | null;
897
- }
898
- /** Something changed on a run: a new event, or its status (`event` null). */
899
- export interface PluginRunSignal {
900
- runId: string;
901
- event: {
902
- id: number;
903
- at: string;
904
- stepId: string | null;
905
- type: "step_started" | "step_done" | "tool" | "info" | "error";
906
- message: string;
907
- /** The same as the run page shows it, in both languages; null for free text. */
908
- note: {
909
- code: string;
910
- text: {
911
- de: string;
912
- en: string;
913
- };
914
- } | null;
915
- } | null;
916
- }
917
- /**
918
- * Runs a plugin's door drives: the functions behind the MCP tools, on the public path. The
919
- * plugin keeps who the person is; the runtime keeps only a hash of it as the run's visitor, so
920
- * what the wizard remembers is theirs on the run page too.
921
- */
922
- export interface PluginRuns {
923
- /** Starts a live run of a published wizard, by its share token or id, for a person of the door. */
924
- start(input: ({
925
- token: string;
926
- } | {
927
- wizardId: string;
928
- }) & {
929
- person: {
930
- channel: string;
931
- id: string;
932
- };
933
- /** Answers for the first page; what did not fit comes back as `refused`. */
934
- answers?: Record<string, unknown>;
935
- /** Kept on the run; default: the plugin's id. */
936
- runner?: string;
937
- }): Promise<{
938
- runId: string;
939
- /** Opens the run's own routes (`/api/runs/<id>?rt=…`); `handoffUrl` carries it. */
940
- ticket: string;
941
- refused: {
942
- field: string;
943
- message: string;
944
- }[] | null;
945
- }>;
946
- /**
947
- * The run as it stands, after waiting up to `waitSeconds` (at most 45) while it works. A door
948
- * that asks a page one field at a time passes what it has as `draft`: the fields' `shown` is
949
- * then worked out on those answers, so a field whose condition depends on another of the same
950
- * page comes and goes as it would on the screen.
951
- */
952
- report(runId: string, options?: {
953
- waitSeconds?: number;
954
- draft?: Record<string, unknown>;
955
- }): Promise<PluginRunReport>;
956
- /** The published wizards of the tenant that switched the given runner on: what the door offers. */
957
- wizards(runner: string): Promise<{
958
- wizardId: string;
959
- token: string;
960
- title: string;
961
- lang: "de" | "en";
962
- }[]>;
963
- answerPage(runId: string, stepId: string, values: Record<string, unknown>): Promise<void>;
964
- review(runId: string, stepId: string, action: PluginReviewAction): Promise<void>;
965
- /** A running step asks before it changes something in a connected account: allow it once, or skip. */
966
- answerAsk(runId: string, askId: string, answer: "allow" | "skip"): Promise<void>;
967
- control(runId: string, action: "back" | "retry" | "cancel"): Promise<void>;
968
- /** Hears every change of the run until the function returned is called. */
969
- subscribe(runId: string, listener: (signal: PluginRunSignal) => void): () => void;
970
- /** The run page with the run's ticket: the link to send the person for what the door cannot do. */
971
- handoffUrl(runId: string): Promise<string>;
972
- /** A file of the person (a photo sent in the thread): the asset id goes into a field with `answerPage`. */
973
- upload(runId: string, file: {
974
- data: Uint8Array | ArrayBuffer;
975
- mime: string;
976
- name: string;
977
- }): Promise<{
978
- assetId: string;
979
- }>;
980
- /** What is said in a recording of the person (a voice message), written down and charged to the run. */
981
- transcribe(runId: string, file: {
982
- data: Uint8Array | ArrayBuffer;
983
- mime: string;
984
- }): Promise<{
985
- text: string;
986
- }>;
987
- }
988
- /** Keys a plugin keeps: sealed with the runtime's own key, as it seals a connection's tokens. */
989
- export interface PluginSecrets {
990
- /** Anything that is JSON, as a sealed string to keep in a table. */
991
- seal(value: unknown): string;
992
- /** What was sealed, or null when it was sealed on another install. */
993
- unseal<T = unknown>(sealed: string): T | null;
994
- }
995
- export interface PluginServerApi {
996
- registerHttpRoute(route: PluginRoute): void;
997
- /** A runner the owner can switch on per wizard. */
998
- registerRunner(runner: PluginRunner): void;
999
- /** Runs the plugin's door drives. */
1000
- runs: PluginRuns;
1001
- /**
1002
- * The tenant's realtime speech model, for a live conversation a plugin drives itself (a call):
1003
- * the key and the model the chat's live voice runs on. Throws with the status `503` and the
1004
- * code `no_model` while none is set up.
1005
- */
1006
- speech: {
1007
- conversation(): Promise<{
1008
- provider: "openai";
1009
- apiKey: string;
1010
- model: string;
1011
- }>;
1012
- };
1013
- registerTool<S extends z.ZodType>(tool: PluginTool<S>): void;
1014
- /** A block and tools for every agent step of a space's wizards, or a block for its HTML steps. */
1015
- registerSpaceContext(context: PluginSpaceContext): void;
1016
- /** A tool of the space assistant. */
1017
- registerAssistantTool<S extends z.ZodType>(tool: PluginAssistantTool<S>): void;
1018
- /** What the space assistant is told when the admin talks to it from the plugin's own page. */
1019
- registerAssistantContext(context: PluginAssistantPage): void;
1020
- registerPublicRoute(route: PluginPublicRoute): void;
1021
- /** The full address of a public route for the current tenant: what to hand to whoever calls it. */
1022
- publicUrl(path: string): Promise<string>;
1023
- /** The part of `publicUrl` that names the current tenant: what a shared route's call carries. */
1024
- publicRef(): Promise<string>;
1025
- /** A route for every tenant at once (one webhook of a service for all of them). */
1026
- registerSharedRoute(route: PluginSharedRoute): void;
1027
- /**
1028
- * Keys the plugin holds across the runtime's tenants, each for one tenant at a time: a keyword
1029
- * on a number every tenant shares, who writes to it, a number a tenant connected. A shared
1030
- * route finds its tenant with `holder` and enters it with `inTenant`. Keys are the plugin's
1031
- * own, 1 to 200 characters.
1032
- */
1033
- claims: {
1034
- /** Takes `key` for the current tenant; false when another tenant holds it. */
1035
- take(key: string): Promise<boolean>;
1036
- /** Gives `key` to the current tenant, whoever held it. */
1037
- put(key: string): Promise<void>;
1038
- /** Gives up the current tenant's `key`; nothing when another tenant holds it. */
1039
- drop(key: string): Promise<void>;
1040
- /** The ref of the tenant that holds `key` (for `inTenant`), or null. Asked outside a tenant too. */
1041
- holder(key: string): Promise<string | null>;
1042
- /** Whether the current tenant holds `key`. */
1043
- mine(key: string): Promise<boolean>;
1044
- };
1045
- /** The full address of a shared route, the same for every tenant. */
1046
- sharedUrl(path: string): string;
1047
- /**
1048
- * The numbers the Manage-App gives the current tenant. `get` is null on a runtime without a
1049
- * Manage-App; there `request` and `withdraw` throw, and `book` books nothing.
1050
- */
1051
- channels: {
1052
- /** Kept for a minute. */
1053
- get(): Promise<PluginChannels | null>;
1054
- /**
1055
- * A person of the tenant asks for its number. Throws with the status `403` and the code
1056
- * `plan` on a plan without one, `409` and `has_number` when the tenant has it; asking again
1057
- * answers the open request.
1058
- */
1059
- request(input: {
1060
- userId: string;
1061
- /** ISO 3166: `AT`. */
1062
- country: string;
1063
- wish?: string | null;
1064
- lang: "de" | "en";
1065
- }): Promise<NonNullable<PluginChannels["request"]>>;
1066
- /** Takes the open request back; false when there was none. */
1067
- withdraw(): Promise<boolean>;
1068
- /**
1069
- * Books what the tenant's number carried, at the Manage-App's prices: `sms` by segment
1070
- * (sent or received), `call` by started minute, `whatsapp` by message sent. The same `key`
1071
- * twice books once.
1072
- */
1073
- book(input: {
1074
- kind: "sms" | "call" | "whatsapp";
1075
- quantity: number;
1076
- key: string;
1077
- runId?: string | null;
1078
- }): Promise<{
1079
- credits: number;
1080
- }>;
1081
- };
1082
- /**
1083
- * Runs `handler` for every tenant that has the plugin, at most once per `everyMs` (a minute
1084
- * at least), inside that tenant. When it ran is kept: a restart does not start the count again,
1085
- * and a runtime that was off runs it once when it starts, not once per turn it missed. One turn
1086
- * per tenant at a time; a turn that throws counts as run.
1087
- */
1088
- every(name: string, everyMs: number, handler: (tick: PluginTick) => void | Promise<void>): void;
1089
- /** The space's search index, which `project_search` asks. */
1090
- index: PluginIndex;
1091
- /** Knowledge of a space: pages, tables and files the plugin writes, with their categories. */
1092
- spaceData: PluginSpaceData;
1093
- spaces: {
1094
- /** The space's brand, of the current tenant; null for a space it does not have. */
1095
- brand(space: string): Promise<PluginBrand | null>;
1096
- };
1097
- web: PluginWeb;
1098
- documents: PluginDocuments;
1099
- /**
1100
- * A folder of `.sql` files with the plugin's own tables. Every tenant database gets each file
1101
- * once, in the order of the file names. Nothing is taken back when the plugin unloads.
1102
- */
1103
- registerMigrations(folder: string): void;
1104
- /** The listener runs inside the tenant the event belongs to. */
1105
- on<E extends keyof PluginEvents>(event: E, listener: (payload: PluginEvents[E]) => void | Promise<void>): void;
1106
- /** The database of the tenant the current request, step or event belongs to. */
1107
- getTenantDb(): PluginDb;
1108
- /**
1109
- * Asks a model of the current tenant, on the models its studio is set up with; the call is
1110
- * paid like any other of the tenant's. When no model is set up it throws an error with the
1111
- * status 503 and the code `no_model`, which a route passes on as it is.
1112
- */
1113
- generate<T = undefined>(request: PluginGenerateRequest<T>): Promise<PluginGenerateResult<T>>;
1114
- /** Accounts the plugin connects for a space, through the runtime's built-in connectors. */
1115
- connections: PluginConnections;
1116
- /** Keys of the plugin's own (a shop's API tokens), sealed before they go into a table. */
1117
- secrets: PluginSecrets;
1118
- /** A wizard the plugin brings as a template. */
1119
- registerStarter(starter: PluginStarter): void;
1120
- /** Something to undo when the plugin unloads or reloads: a timer, a socket. */
1121
- onUnload(dispose: () => void | Promise<void>): void;
1122
- }
1123
- export interface WizardsPluginApi {
1124
- plugin: PluginManifest;
1125
- server: PluginServerApi;
1126
- /** Settings of this install: its `.env`. Name them after the plugin (`NOTIFY_URL`). */
1127
- config: {
1128
- get(key: string): string | undefined;
1129
- };
1130
- /**
1131
- * Feature switches of the tenant at hand: the runtime's own (`teamPlans`) and the plugin's,
1132
- * named with its id (`contacts.leadScoring`), as the Manage-App, the install's `.features`
1133
- * file or `FEATURES` set them. Off unless something turned a switch on.
1134
- */
1135
- features: {
1136
- /** `has("leadScoring")` asks for the plugin's own switch; a full name (`teamPlans`) for any. */
1137
- has(name: string): Promise<boolean>;
1138
- all(): Promise<Record<string, boolean>>;
1139
- };
1140
- log: {
1141
- info(...args: unknown[]): void;
1142
- warn(...args: unknown[]): void;
1143
- error(...args: unknown[]): void;
1144
- };
1145
- /** A file of the plugin as an absolute path. */
1146
- resolvePath(relative: string): string;
1147
- }
1148
- export type WizardsPluginFactory = (wizards: WizardsPluginApi) => void | Promise<void>;
1149
- /** Types the factory; it does nothing else. */
1150
- export declare function definePlugin(factory: WizardsPluginFactory): WizardsPluginFactory;