@capybara-hq/kernel 0.1.0-rc.105 → 0.1.0-rc.107

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 (359) hide show
  1. package/dist/admin/admin.schemas.d.ts +3 -0
  2. package/dist/agents/agents.schemas.d.ts +9 -9
  3. package/dist/{schedules/schedules.controller.d.ts → automations/automations.controller.d.ts} +37 -32
  4. package/dist/{schedules/schedules.controller.js → automations/automations.controller.js} +68 -57
  5. package/dist/automations/automations.module.d.ts +16 -0
  6. package/dist/{schedules/schedules.module.js → automations/automations.module.js} +18 -15
  7. package/dist/{schedules/schedules.schemas.d.ts → automations/automations.schemas.d.ts} +151 -50
  8. package/dist/automations/automations.schemas.js +253 -0
  9. package/dist/{schedules/scheduled-tasks.service.d.ts → automations/automations.service.d.ts} +99 -52
  10. package/dist/{schedules/scheduled-tasks.service.js → automations/automations.service.js} +303 -134
  11. package/dist/{schedules → automations}/calendar.d.ts +8 -8
  12. package/dist/{schedules → automations}/calendar.js +2 -2
  13. package/dist/automations/effective-settings.d.ts +28 -0
  14. package/dist/automations/effective-settings.js +25 -0
  15. package/dist/automations/errors.d.ts +19 -0
  16. package/dist/automations/errors.js +19 -0
  17. package/dist/automations/events/coalesce.d.ts +28 -0
  18. package/dist/automations/events/coalesce.js +131 -0
  19. package/dist/automations/events/deadline.d.ts +10 -0
  20. package/dist/automations/events/deadline.js +24 -0
  21. package/dist/automations/events/dispatcher.d.ts +74 -0
  22. package/dist/automations/events/dispatcher.js +353 -0
  23. package/dist/automations/events/events.module.d.ts +7 -0
  24. package/dist/automations/events/events.module.js +26 -0
  25. package/dist/automations/events/guards.d.ts +32 -0
  26. package/dist/automations/events/guards.js +87 -0
  27. package/dist/automations/events/sweep.job.d.ts +49 -0
  28. package/dist/automations/events/sweep.job.js +202 -0
  29. package/dist/automations/events/token.d.ts +5 -0
  30. package/dist/automations/events/token.js +5 -0
  31. package/dist/automations/events/trigger-events.service.d.ts +47 -0
  32. package/dist/automations/events/trigger-events.service.js +254 -0
  33. package/dist/{schedules → automations}/fire.d.ts +57 -17
  34. package/dist/{schedules → automations}/fire.js +311 -79
  35. package/dist/{schedules → automations}/grant-rules.d.ts +1 -1
  36. package/dist/{schedules → automations}/grant-rules.js +5 -5
  37. package/dist/automations/job-ids.d.ts +113 -0
  38. package/dist/automations/job-ids.js +117 -0
  39. package/dist/{schedules → automations}/pause.d.ts +3 -3
  40. package/dist/{schedules → automations}/pause.js +3 -3
  41. package/dist/{schedules → automations}/run-tracker.d.ts +21 -10
  42. package/dist/{schedules → automations}/run-tracker.js +68 -56
  43. package/dist/{schedules → automations}/scan.job.d.ts +12 -8
  44. package/dist/{schedules → automations}/scan.job.js +39 -23
  45. package/dist/{schedules → automations}/schedule-math.d.ts +19 -12
  46. package/dist/{schedules → automations}/schedule-math.js +17 -7
  47. package/dist/{schedules → automations}/store.d.ts +57 -27
  48. package/dist/{schedules → automations}/store.js +102 -52
  49. package/dist/automations/store.module.d.ts +6 -0
  50. package/dist/{schedules → automations}/store.module.js +9 -9
  51. package/dist/automations/types.d.ts +178 -0
  52. package/dist/{schedules → automations}/unattended.d.ts +22 -11
  53. package/dist/{schedules → automations}/unattended.js +53 -30
  54. package/dist/catalog/marketplaces.service.d.ts +1 -1
  55. package/dist/channels/channels.module.js +7 -6
  56. package/dist/channels/file-delivery.d.ts +26 -11
  57. package/dist/channels/file-delivery.js +32 -11
  58. package/dist/channels/outbound.d.ts +8 -8
  59. package/dist/channels/outbound.js +32 -30
  60. package/dist/channels/threads.d.ts +1 -1
  61. package/dist/channels/threads.js +1 -1
  62. package/dist/config/schema.d.ts +8 -1
  63. package/dist/config/schema.js +56 -6
  64. package/dist/conversations/approval-profile.d.ts +2 -2
  65. package/dist/conversations/approval-profile.js +3 -3
  66. package/dist/conversations/artifacts.d.ts +20 -17
  67. package/dist/conversations/artifacts.js +30 -37
  68. package/dist/conversations/attachments.controller.d.ts +6 -19
  69. package/dist/conversations/attachments.controller.js +8 -59
  70. package/dist/conversations/attachments.service.d.ts +30 -74
  71. package/dist/conversations/attachments.service.js +51 -193
  72. package/dist/conversations/conversations.controller.d.ts +7 -1
  73. package/dist/conversations/conversations.controller.js +26 -10
  74. package/dist/conversations/conversations.module.js +4 -0
  75. package/dist/conversations/conversations.service.d.ts +112 -35
  76. package/dist/conversations/conversations.service.js +160 -43
  77. package/dist/conversations/event-log.d.ts +1 -0
  78. package/dist/conversations/events.d.ts +95 -27
  79. package/dist/conversations/events.js +108 -10
  80. package/dist/conversations/files.d.ts +66 -64
  81. package/dist/conversations/files.js +127 -147
  82. package/dist/conversations/message-context.d.ts +2 -2
  83. package/dist/conversations/message-context.js +1 -1
  84. package/dist/conversations/permission-profile-store.d.ts +2 -1
  85. package/dist/conversations/permission-profiles.controller.d.ts +3 -0
  86. package/dist/conversations/permission-profiles.service.js +1 -1
  87. package/dist/conversations/prompt-suggestion-request.d.ts +1 -1
  88. package/dist/conversations/prompt-suggestion-request.js +4 -2
  89. package/dist/conversations/prompt-suggestions.d.ts +3 -3
  90. package/dist/conversations/prompt-suggestions.js +11 -10
  91. package/dist/conversations/queue.d.ts +7 -4
  92. package/dist/conversations/queue.js +6 -2
  93. package/dist/conversations/queue.service.d.ts +5 -5
  94. package/dist/conversations/queue.service.js +27 -16
  95. package/dist/ctx/create-ctx.d.ts +23 -2
  96. package/dist/ctx/create-ctx.js +78 -3
  97. package/dist/db/kernel-schema.d.ts +184 -27
  98. package/dist/devices/device-project-files.service.d.ts +88 -0
  99. package/dist/devices/device-project-files.service.js +249 -0
  100. package/dist/devices/device-projects.service.d.ts +40 -0
  101. package/dist/devices/device-projects.service.js +16 -13
  102. package/dist/devices/devices.controller.d.ts +9 -3
  103. package/dist/devices/devices.controller.js +27 -5
  104. package/dist/devices/devices.module.js +9 -1
  105. package/dist/devices/devices.schemas.js +6 -1
  106. package/dist/devices/dto.d.ts +15 -0
  107. package/dist/devices/dto.js +11 -0
  108. package/dist/devices/project-paths.d.ts +29 -0
  109. package/dist/devices/project-paths.js +66 -0
  110. package/dist/devices/project-rules.d.ts +5 -1
  111. package/dist/devices/project-rules.js +5 -1
  112. package/dist/errors.d.ts +53 -13
  113. package/dist/errors.js +53 -13
  114. package/dist/evals/canonical-json.d.ts +7 -0
  115. package/dist/evals/canonical-json.js +21 -0
  116. package/dist/evals/reconstruct.d.ts +10 -1
  117. package/dist/evals/reconstruct.js +20 -1
  118. package/dist/evals/recorded-tools.d.ts +0 -2
  119. package/dist/evals/recorded-tools.js +1 -16
  120. package/dist/evals/snapshot.d.ts +26 -3
  121. package/dist/evals/snapshot.js +110 -57
  122. package/dist/evals/worker.d.ts +4 -3
  123. package/dist/evals/worker.js +8 -4
  124. package/dist/extensions/host.d.ts +9 -2
  125. package/dist/extensions/host.js +12 -0
  126. package/dist/extensions/instance.d.ts +3 -1
  127. package/dist/extensions/instance.js +4 -0
  128. package/dist/extensions/ledger.d.ts +1 -1
  129. package/dist/extensions/permission-set.d.ts +17 -1
  130. package/dist/extensions/permission-set.js +13 -1
  131. package/dist/extensions/permission-view.d.ts +1 -1
  132. package/dist/extensions/permission-view.js +4 -1
  133. package/dist/files/blob-objects.d.ts +124 -0
  134. package/dist/files/blob-objects.js +341 -0
  135. package/dist/files/blob-sweep.job.d.ts +122 -0
  136. package/dist/files/blob-sweep.job.js +389 -0
  137. package/dist/files/blobs.service.d.ts +135 -0
  138. package/dist/files/blobs.service.js +300 -0
  139. package/dist/files/conversation-media.d.ts +41 -0
  140. package/dist/files/conversation-media.js +124 -0
  141. package/dist/files/deliveries.d.ts +64 -0
  142. package/dist/files/deliveries.js +156 -0
  143. package/dist/files/deliveries.module.d.ts +6 -0
  144. package/dist/files/deliveries.module.js +24 -0
  145. package/dist/files/draft-cleanup.job.d.ts +26 -0
  146. package/dist/files/draft-cleanup.job.js +93 -0
  147. package/dist/files/files.module.d.ts +1 -1
  148. package/dist/files/files.module.js +3 -2
  149. package/dist/files/hash-job.d.ts +127 -0
  150. package/dist/files/hash-job.js +447 -0
  151. package/dist/files/library-backfill.d.ts +63 -0
  152. package/dist/files/library-backfill.js +143 -0
  153. package/dist/files/library-files.service.d.ts +255 -0
  154. package/dist/files/library-files.service.js +883 -0
  155. package/dist/files/library-jobs.module.d.ts +8 -0
  156. package/dist/files/library-jobs.module.js +27 -0
  157. package/dist/files/library-query.d.ts +127 -0
  158. package/dist/files/library-query.js +322 -0
  159. package/dist/files/library-read.module.d.ts +9 -0
  160. package/dist/files/library-read.module.js +30 -0
  161. package/dist/files/library.controller.d.ts +77 -0
  162. package/dist/files/library.controller.js +235 -0
  163. package/dist/files/library.module.d.ts +9 -0
  164. package/dist/files/library.module.js +29 -0
  165. package/dist/files/library.schemas.d.ts +46 -0
  166. package/dist/files/library.schemas.js +49 -0
  167. package/dist/files/previewers.controller.d.ts +20 -0
  168. package/dist/files/previewers.controller.js +47 -0
  169. package/dist/files/previewers.d.ts +25 -11
  170. package/dist/files/previewers.js +43 -27
  171. package/dist/files/referenced-files.d.ts +150 -0
  172. package/dist/files/referenced-files.js +234 -0
  173. package/dist/git/gateway.js +2 -2
  174. package/dist/html/html-document.controller.d.ts +8 -1
  175. package/dist/html/html-document.controller.js +19 -1
  176. package/dist/html/html-document.service.d.ts +19 -4
  177. package/dist/html/html-document.service.js +43 -22
  178. package/dist/html/html-token.d.ts +10 -1
  179. package/dist/html/html-token.js +14 -0
  180. package/dist/html/html.module.js +8 -1
  181. package/dist/http/api.module.js +10 -5
  182. package/dist/http/request-signal.d.ts +8 -0
  183. package/dist/http/request-signal.js +14 -0
  184. package/dist/identity/settings.d.ts +26 -0
  185. package/dist/identity/settings.js +33 -2
  186. package/dist/inbox/inbox.module.js +2 -2
  187. package/dist/inbox/inbox.service.d.ts +8 -8
  188. package/dist/inbox/inbox.service.js +7 -7
  189. package/dist/infra/config/kernel-config.service.js +10 -5
  190. package/dist/infra/outbox/registry.d.ts +111 -2
  191. package/dist/infra/outbox/registry.js +104 -9
  192. package/dist/infra/throttler/named-throttlers.d.ts +2 -0
  193. package/dist/infra/throttler/named-throttlers.js +14 -0
  194. package/dist/kernel.module.js +3 -0
  195. package/dist/lifecycle/kernel-lifecycle.js +6 -0
  196. package/dist/models/purposes.js +1 -1
  197. package/dist/orgs/offboarding.js +1 -1
  198. package/dist/orgs/roles.d.ts +1 -1
  199. package/dist/orgs/roles.js +3 -3
  200. package/dist/orgs/settings.controller.d.ts +1 -1
  201. package/dist/orgs/settings.service.d.ts +75 -13
  202. package/dist/orgs/settings.service.js +104 -26
  203. package/dist/platform/exclusions.js +45 -8
  204. package/dist/platform/file-ref.d.ts +18 -3
  205. package/dist/platform/file-ref.js +22 -11
  206. package/dist/platform/operation.js +6 -2
  207. package/dist/platform/ops/admin.ops.js +5 -2
  208. package/dist/platform/ops/{schedules.ops.d.ts → automations.ops.d.ts} +4 -4
  209. package/dist/platform/ops/automations.ops.js +560 -0
  210. package/dist/platform/ops/devices.ops.d.ts +3 -1
  211. package/dist/platform/ops/devices.ops.js +77 -3
  212. package/dist/platform/ops/files.ops.d.ts +18 -0
  213. package/dist/platform/ops/files.ops.js +267 -0
  214. package/dist/platform/ops/inbox.ops.js +4 -4
  215. package/dist/platform/ops/org-settings.ops.js +6 -2
  216. package/dist/platform/ops/orgs.ops.js +2 -1
  217. package/dist/platform/ops/platform.ops.js +4 -4
  218. package/dist/platform/ops/shares.ops.js +2 -2
  219. package/dist/platform/platform-ops.module.d.ts +3 -2
  220. package/dist/platform/platform-ops.module.js +10 -5
  221. package/dist/platform/route-schemas.js +6 -3
  222. package/dist/push/jobs.d.ts +3 -3
  223. package/dist/push/jobs.js +2 -2
  224. package/dist/push/preferences.service.js +1 -1
  225. package/dist/push/push-owed.d.ts +3 -3
  226. package/dist/push/push-owed.js +6 -6
  227. package/dist/push/push.schemas.d.ts +4 -4
  228. package/dist/push/push.schemas.js +3 -3
  229. package/dist/push/recipients.d.ts +4 -4
  230. package/dist/push/recipients.js +23 -23
  231. package/dist/push/texts.d.ts +3 -3
  232. package/dist/push/texts.js +2 -2
  233. package/dist/push/triggers.d.ts +1 -1
  234. package/dist/roles/worker.module.js +18 -4
  235. package/dist/runtime/compaction-settings.service.d.ts +13 -1
  236. package/dist/runtime/compaction-settings.service.js +16 -1
  237. package/dist/runtime/compaction.service.d.ts +3 -1
  238. package/dist/runtime/compaction.service.js +3 -1
  239. package/dist/runtime/context/build.d.ts +24 -1
  240. package/dist/runtime/context/build.js +33 -11
  241. package/dist/runtime/context/cache-expiry.d.ts +31 -0
  242. package/dist/runtime/context/cache-expiry.js +60 -0
  243. package/dist/runtime/context/cache-ttl.d.ts +18 -0
  244. package/dist/runtime/context/cache-ttl.js +30 -0
  245. package/dist/runtime/context/compaction.d.ts +9 -2
  246. package/dist/runtime/context/compaction.js +64 -21
  247. package/dist/runtime/context/in-context-compaction.d.ts +156 -0
  248. package/dist/runtime/context/in-context-compaction.js +310 -0
  249. package/dist/runtime/context/run-context.d.ts +38 -0
  250. package/dist/runtime/context/run-context.js +54 -0
  251. package/dist/runtime/hook-calls.d.ts +2 -1
  252. package/dist/runtime/hook-calls.js +5 -2
  253. package/dist/runtime/maintenance.d.ts +16 -4
  254. package/dist/runtime/maintenance.js +79 -18
  255. package/dist/runtime/model-call.d.ts +34 -5
  256. package/dist/runtime/model-call.js +207 -22
  257. package/dist/runtime/providers.js +11 -1
  258. package/dist/runtime/run-finish.d.ts +4 -4
  259. package/dist/runtime/run-finish.js +3 -3
  260. package/dist/runtime/run-queue.js +12 -7
  261. package/dist/runtime/run-steps.d.ts +4 -2
  262. package/dist/runtime/run-steps.js +10 -5
  263. package/dist/runtime/run-worker.js +7 -1
  264. package/dist/runtime/runtime.module.js +6 -3
  265. package/dist/runtime/subagents/dispatch.js +11 -3
  266. package/dist/sandbox/browse-roots.d.ts +8 -0
  267. package/dist/sandbox/browse-roots.js +22 -0
  268. package/dist/sandbox/network-grants.d.ts +4 -4
  269. package/dist/sandbox/network-grants.js +7 -7
  270. package/dist/sandbox/operation-authority.d.ts +10 -3
  271. package/dist/sandbox/operation-authority.js +20 -10
  272. package/dist/sandbox/operation-intents.d.ts +3 -1
  273. package/dist/sandbox/operation-intents.js +11 -4
  274. package/dist/sandbox/permission-call-grants.js +2 -2
  275. package/dist/sandbox/permission-facts.js +1 -1
  276. package/dist/sandbox/review/classifier.d.ts +2 -2
  277. package/dist/sandbox/review/classifier.js +22 -11
  278. package/dist/sandbox/review/permission-candidate.d.ts +1 -1
  279. package/dist/sandbox/review/permission-candidate.js +1 -1
  280. package/dist/sandbox/sandbox.service.d.ts +15 -5
  281. package/dist/sandbox/sandbox.service.js +14 -8
  282. package/dist/shares/liveness.d.ts +26 -12
  283. package/dist/shares/liveness.js +79 -20
  284. package/dist/shares/revoke.d.ts +16 -11
  285. package/dist/shares/revoke.js +18 -14
  286. package/dist/shares/share-objects.d.ts +16 -21
  287. package/dist/shares/share-objects.js +25 -55
  288. package/dist/shares/share-open.service.d.ts +8 -4
  289. package/dist/shares/share-open.service.js +14 -11
  290. package/dist/shares/shares.controller.d.ts +16 -5
  291. package/dist/shares/shares.controller.js +39 -5
  292. package/dist/shares/shares.module.d.ts +4 -4
  293. package/dist/shares/shares.module.js +7 -6
  294. package/dist/shares/shares.schemas.d.ts +4 -0
  295. package/dist/shares/shares.schemas.js +2 -0
  296. package/dist/shares/shares.service.d.ts +93 -54
  297. package/dist/shares/shares.service.js +292 -131
  298. package/dist/shares/sweep.job.d.ts +18 -39
  299. package/dist/shares/sweep.job.js +47 -206
  300. package/dist/storage/purge.d.ts +1 -1
  301. package/dist/storage/purge.js +2 -2
  302. package/dist/tools/approvals.service.d.ts +6 -6
  303. package/dist/tools/approvals.service.js +19 -19
  304. package/dist/tools/builtin-names.d.ts +12 -12
  305. package/dist/tools/builtin-names.js +29 -29
  306. package/dist/tools/builtins/artifacts.d.ts +21 -13
  307. package/dist/tools/builtins/artifacts.js +81 -51
  308. package/dist/tools/builtins/{schedules.d.ts → automations.d.ts} +35 -33
  309. package/dist/tools/builtins/{schedules.js → automations.js} +236 -105
  310. package/dist/tools/builtins/builtin-tools.d.ts +15 -9
  311. package/dist/tools/builtins/builtin-tools.js +33 -22
  312. package/dist/tools/builtins/conversation-files.d.ts +23 -13
  313. package/dist/tools/builtins/conversation-files.js +62 -83
  314. package/dist/tools/builtins/image/generate.d.ts +7 -1
  315. package/dist/tools/builtins/image/generate.js +1 -1
  316. package/dist/tools/builtins/platform.js +1 -0
  317. package/dist/tools/builtins/sandbox/common.d.ts +6 -2
  318. package/dist/tools/builtins/sandbox/deliver.js +6 -7
  319. package/dist/tools/builtins/sandbox/fetch-attachment.d.ts +6 -5
  320. package/dist/tools/builtins/sandbox/fetch-attachment.js +19 -12
  321. package/dist/tools/call-scope.d.ts +1 -1
  322. package/dist/tools/git-asks.js +1 -1
  323. package/dist/tools/git-push-policy.d.ts +3 -3
  324. package/dist/tools/git-push-policy.js +6 -6
  325. package/dist/tools/network-asks.d.ts +3 -3
  326. package/dist/tools/network-asks.js +3 -3
  327. package/dist/tools/pipeline.d.ts +4 -4
  328. package/dist/tools/pipeline.js +2 -2
  329. package/dist/tools/policy.d.ts +3 -3
  330. package/dist/tools/policy.js +3 -3
  331. package/dist/tools/tools.module.js +15 -9
  332. package/dist/ui/call-extension.d.ts +6 -4
  333. package/dist/ui/call-extension.js +5 -4
  334. package/dist/ui/embed-token.js +6 -3
  335. package/dist/ui/registry.d.ts +21 -5
  336. package/dist/ui/registry.js +24 -6
  337. package/dist/ui/ui.schemas.d.ts +22 -0
  338. package/dist/ui/ui.schemas.js +22 -4
  339. package/dist/ui/views.controller.d.ts +13 -3
  340. package/dist/ui/views.controller.js +33 -2
  341. package/dist/ui/views.d.ts +29 -1
  342. package/dist/ui/views.js +131 -7
  343. package/package.json +3 -3
  344. package/src/migrations/0188_automations_rename.sql +309 -0
  345. package/src/migrations/0189_event_automations.sql +136 -0
  346. package/src/migrations/0190_file_library.sql +285 -0
  347. package/src/migrations/0191_file_library_copy.sql +4 -0
  348. package/dist/platform/ops/schedules.ops.js +0 -509
  349. package/dist/schedules/effective-settings.d.ts +0 -22
  350. package/dist/schedules/effective-settings.js +0 -18
  351. package/dist/schedules/errors.d.ts +0 -8
  352. package/dist/schedules/errors.js +0 -8
  353. package/dist/schedules/job-ids.d.ts +0 -81
  354. package/dist/schedules/job-ids.js +0 -95
  355. package/dist/schedules/schedules.module.d.ts +0 -16
  356. package/dist/schedules/schedules.schemas.js +0 -213
  357. package/dist/schedules/store.module.d.ts +0 -6
  358. package/dist/schedules/types.d.ts +0 -110
  359. /package/dist/{schedules → automations}/types.js +0 -0
@@ -89,6 +89,9 @@ export declare const DeploymentSettingsBody: z.ZodObject<{
89
89
  reserveTokens: z.ZodOptional<z.ZodNumber>;
90
90
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
91
91
  }, z.core.$strict>>;
92
+ promptCache: z.ZodOptional<z.ZodObject<{
93
+ longTtl: z.ZodOptional<z.ZodBoolean>;
94
+ }, z.core.$strict>>;
92
95
  externalSharing: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
93
96
  allow: "allow";
94
97
  deny: "deny";
@@ -3,6 +3,9 @@ import type { RouteSchemas } from "../platform/route-schemas.js";
3
3
  export declare const AgentMemberIds: z.ZodArray<z.ZodString>;
4
4
  /** Pending connectors come only from a template (ruling P4-6): a create request's are dropped. */
5
5
  export declare const AgentCreateDefinition: z.ZodObject<{
6
+ tools: z.ZodOptional<z.ZodUndefined>;
7
+ subagentTools: z.ZodOptional<z.ZodUndefined>;
8
+ instructions: z.ZodOptional<z.ZodString>;
6
9
  name: z.ZodString;
7
10
  description: z.ZodOptional<z.ZodString>;
8
11
  avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodURL>>;
@@ -97,12 +100,12 @@ export declare const AgentCreateDefinition: z.ZodObject<{
97
100
  pr: z.ZodOptional<z.ZodString>;
98
101
  sessionUrl: z.ZodOptional<z.ZodBoolean>;
99
102
  }, z.core.$strict>>;
100
- tools: z.ZodOptional<z.ZodUndefined>;
101
- subagentTools: z.ZodOptional<z.ZodUndefined>;
102
- instructions: z.ZodOptional<z.ZodString>;
103
103
  }, z.core.$strip>;
104
104
  export declare const AgentCreateBody: z.ZodObject<{
105
105
  definition: z.ZodObject<{
106
+ tools: z.ZodOptional<z.ZodUndefined>;
107
+ subagentTools: z.ZodOptional<z.ZodUndefined>;
108
+ instructions: z.ZodOptional<z.ZodString>;
106
109
  name: z.ZodString;
107
110
  description: z.ZodOptional<z.ZodString>;
108
111
  avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodURL>>;
@@ -197,9 +200,6 @@ export declare const AgentCreateBody: z.ZodObject<{
197
200
  pr: z.ZodOptional<z.ZodString>;
198
201
  sessionUrl: z.ZodOptional<z.ZodBoolean>;
199
202
  }, z.core.$strict>>;
200
- tools: z.ZodOptional<z.ZodUndefined>;
201
- subagentTools: z.ZodOptional<z.ZodUndefined>;
202
- instructions: z.ZodOptional<z.ZodString>;
203
203
  }, z.core.$strip>;
204
204
  visibility: z.ZodEnum<{
205
205
  members: "members";
@@ -235,6 +235,9 @@ export declare const AgentCreateBody: z.ZodObject<{
235
235
  }, z.core.$strict>;
236
236
  export declare const AgentUpdateBody: z.ZodObject<{
237
237
  definition: z.ZodOptional<z.ZodObject<{
238
+ tools: z.ZodOptional<z.ZodUndefined>;
239
+ subagentTools: z.ZodOptional<z.ZodUndefined>;
240
+ instructions: z.ZodOptional<z.ZodString>;
238
241
  name: z.ZodString;
239
242
  description: z.ZodOptional<z.ZodString>;
240
243
  avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodURL>>;
@@ -351,9 +354,6 @@ export declare const AgentUpdateBody: z.ZodObject<{
351
354
  pr: z.ZodOptional<z.ZodString>;
352
355
  sessionUrl: z.ZodOptional<z.ZodBoolean>;
353
356
  }, z.core.$strict>>;
354
- tools: z.ZodOptional<z.ZodUndefined>;
355
- subagentTools: z.ZodOptional<z.ZodUndefined>;
356
- instructions: z.ZodOptional<z.ZodString>;
357
357
  }, z.core.$strip>>;
358
358
  visibility: z.ZodOptional<z.ZodEnum<{
359
359
  members: "members";
@@ -1,72 +1,77 @@
1
1
  import type { z } from "zod";
2
2
  import { type Principal } from "../identity/principal.js";
3
3
  import { type OrgContext } from "../orgs/org.guard.js";
4
+ import { type AutomationCalendarQuery, type AutomationChatTargetsQuery, type AutomationCreateBody, type AutomationEventSourcesQuery, type AutomationGrantableQuery, type AutomationGrantParams, type AutomationGrantsBody, type AutomationListQuery, type AutomationParams, type AutomationRunBody, type AutomationRunsQuery, type AutomationUpdateBody } from "./automations.schemas.js";
5
+ import { type AutomationGrantView, type AutomationListItem, AutomationsService, type ChatTarget, type EventSourceView, type GrantableTool } from "./automations.service.js";
4
6
  import type { CalendarAnswer } from "./calendar.js";
5
- import { type ChatTarget, type GrantableTool, type ScheduledTaskGrantView, type ScheduledTaskListItem, ScheduledTasksService } from "./scheduled-tasks.service.js";
6
- import { type ScheduleCalendarQuery, type ScheduleChatTargetsQuery, type ScheduleCreateBody, type ScheduleGrantableQuery, type ScheduleGrantParams, type ScheduleGrantsBody, type ScheduleListQuery, type ScheduleParams, type ScheduleRunBody, type ScheduleRunsQuery, type ScheduleUpdateBody } from "./schedules.schemas.js";
7
- import type { ScheduledTask, ScheduledTaskGrant, TaskRun } from "./types.js";
7
+ import type { Automation, AutomationGrant, TaskRun } from "./types.js";
8
8
  /**
9
- * Scheduled tasks (`/api/v1/orgs/:orgId/schedules`, spec 2026-11-11-scheduled-tasks §10); human
9
+ * Automations (`/api/v1/orgs/:orgId/automations`, spec 2026-11-11-scheduled-tasks §10); human
10
10
  * users only (a service token gets 403).
11
11
  * - `GET /` → `{ items }`: the caller's own tasks, each with its `lastRun`; `?all=true` every task
12
- * of the org (org admins, `schedules.manage`, enforced by the service: 403 `forbidden`
12
+ * of the org (org admins, `automations.manage`, enforced by the service: 403 `forbidden`
13
13
  * otherwise); `?conversationId=` only those posting into that conversation;
14
14
  * - `GET /calendar?from&to&timeZone[&all][&taskId]` → the calendar (runs, planned occurrences,
15
15
  * collapsed task-days; calendar spec §5.1), `org.read` like the list, `all` as the list's;
16
16
  * - `GET /chat-targets` → `{ items }`: the chats the caller can point a `chat` task at;
17
17
  * - `GET /grantable-tools?agentId=` → `{ items }`: the agent's tools, each grantable or why not;
18
+ * - `GET /event-sources` → `{ items }`: the trigger sources that serve the org (not switched off),
19
+ * each `{ source, name, events }` with the event types and facts an event trigger can use;
18
20
  * - `POST /` → 201 `{ task }` (`timeZone` is the browser zone, a fallback only);
19
21
  * `GET /:id`, `PATCH /:id`, `POST /:id/pause`, `POST /:id/resume` → `{ task }`;
20
22
  * - `DELETE /:id` → 204; `POST /:id/run { trial? }` → 202 `{ run }`;
21
23
  * - `GET /:id/runs?limit` → `{ items }`; `GET /:id/grants` → `{ items }` (each with `stale`);
22
24
  * `POST /:id/grants { grants }` → `{ items }`; `DELETE /:id/grants/:toolKey` → 204.
23
25
  *
24
- * Roles: create, edit, resume, run and the grants need `schedules.use` (member and up; a guest
26
+ * Roles: create, edit, resume, run and the grants need `automations.use` (member and up; a guest
25
27
  * gets 403). Pause and delete are `org.read` (any member, a guest included) so a creator demoted
26
28
  * to guest can still stop and remove their own tasks; the service decides by the live role and
27
29
  * ownership (the creator, or an org admin), and a task the caller may not see is 404
28
- * `schedule.not_found`.
30
+ * `automation.not_found`.
29
31
  */
30
- export declare class SchedulesController {
32
+ export declare class AutomationsController {
31
33
  private readonly tasks;
32
- constructor(tasks: ScheduledTasksService);
33
- list(principal: Principal, org: OrgContext, q: z.infer<typeof ScheduleListQuery>): Promise<{
34
- items: ScheduledTaskListItem[];
34
+ constructor(tasks: AutomationsService);
35
+ list(principal: Principal, org: OrgContext, q: z.infer<typeof AutomationListQuery>): Promise<{
36
+ items: AutomationListItem[];
35
37
  }>;
36
- calendar(principal: Principal, org: OrgContext, q: z.infer<typeof ScheduleCalendarQuery>): Promise<CalendarAnswer>;
37
- chatTargets(principal: Principal, org: OrgContext, _q: z.infer<typeof ScheduleChatTargetsQuery>): Promise<{
38
+ calendar(principal: Principal, org: OrgContext, q: z.infer<typeof AutomationCalendarQuery>): Promise<CalendarAnswer>;
39
+ chatTargets(principal: Principal, org: OrgContext, _q: z.infer<typeof AutomationChatTargetsQuery>): Promise<{
38
40
  items: ChatTarget[];
39
41
  }>;
40
- grantableTools(principal: Principal, org: OrgContext, q: z.infer<typeof ScheduleGrantableQuery>): Promise<{
42
+ grantableTools(principal: Principal, org: OrgContext, q: z.infer<typeof AutomationGrantableQuery>): Promise<{
41
43
  items: GrantableTool[];
42
44
  }>;
43
- create(principal: Principal, org: OrgContext, body: z.infer<typeof ScheduleCreateBody>): Promise<{
44
- task: ScheduledTask;
45
+ eventSources(org: OrgContext, _q: z.infer<typeof AutomationEventSourcesQuery>): Promise<{
46
+ items: EventSourceView[];
45
47
  }>;
46
- get(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>): Promise<{
47
- task: ScheduledTask;
48
+ create(principal: Principal, org: OrgContext, body: z.infer<typeof AutomationCreateBody>): Promise<{
49
+ task: Automation;
48
50
  }>;
49
- update(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>, body: z.infer<typeof ScheduleUpdateBody>): Promise<{
50
- task: ScheduledTask;
51
+ get(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>): Promise<{
52
+ task: Automation;
51
53
  }>;
52
- remove(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>): Promise<void>;
53
- pause(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>): Promise<{
54
- task: ScheduledTask;
54
+ update(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>, body: z.infer<typeof AutomationUpdateBody>): Promise<{
55
+ task: Automation;
55
56
  }>;
56
- resume(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>): Promise<{
57
- task: ScheduledTask;
57
+ remove(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>): Promise<void>;
58
+ pause(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>): Promise<{
59
+ task: Automation;
58
60
  }>;
59
- run(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>, body: z.infer<typeof ScheduleRunBody>): Promise<{
61
+ resume(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>): Promise<{
62
+ task: Automation;
63
+ }>;
64
+ run(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>, body: z.infer<typeof AutomationRunBody>): Promise<{
60
65
  run: TaskRun;
61
66
  }>;
62
- runs(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>, q: z.infer<typeof ScheduleRunsQuery>): Promise<{
67
+ runs(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>, q: z.infer<typeof AutomationRunsQuery>): Promise<{
63
68
  items: TaskRun[];
64
69
  }>;
65
- grants(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>): Promise<{
66
- items: ScheduledTaskGrantView[];
70
+ grants(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>): Promise<{
71
+ items: AutomationGrantView[];
67
72
  }>;
68
- addGrants(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleParams>, body: z.infer<typeof ScheduleGrantsBody>): Promise<{
69
- items: ScheduledTaskGrant[];
73
+ addGrants(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationParams>, body: z.infer<typeof AutomationGrantsBody>): Promise<{
74
+ items: AutomationGrant[];
70
75
  }>;
71
- removeGrant(principal: Principal, org: OrgContext, params: z.infer<typeof ScheduleGrantParams>): Promise<void>;
76
+ removeGrant(principal: Principal, org: OrgContext, params: z.infer<typeof AutomationGrantParams>): Promise<void>;
72
77
  }
@@ -11,31 +11,33 @@ import { Controller, Delete, Get, HttpCode, Inject, Patch, Post } from "@nestjs/
11
11
  import { CurrentPrincipal, requireUser } from "../identity/principal.js";
12
12
  import { ZBody, ZParam, ZQuery } from "../infra/validation/zod-params.js";
13
13
  import { CurrentOrg, OrgAction } from "../orgs/org.guard.js";
14
- import { ScheduledTasksService, } from "./scheduled-tasks.service.js";
15
- import { calendarInputOf, createInputOf, grantsOf, ScheduleCalendarQueryDto, ScheduleChatTargetsQueryDto, ScheduleCreateBodyDto, ScheduleGrantableQueryDto, ScheduleGrantParamsDto, ScheduleGrantsBodyDto, ScheduleListQueryDto, ScheduleParamsDto, ScheduleRunBodyDto, ScheduleRunsQueryDto, ScheduleUpdateBodyDto, updateInputOf, } from "./schedules.schemas.js";
14
+ import { AutomationCalendarQueryDto, AutomationChatTargetsQueryDto, AutomationCreateBodyDto, AutomationEventSourcesQueryDto, AutomationGrantableQueryDto, AutomationGrantParamsDto, AutomationGrantsBodyDto, AutomationListQueryDto, AutomationParamsDto, AutomationRunBodyDto, AutomationRunsQueryDto, AutomationUpdateBodyDto, calendarInputOf, createInputOf, grantsOf, updateInputOf, } from "./automations.schemas.js";
15
+ import { AutomationsService, } from "./automations.service.js";
16
16
  /**
17
- * Scheduled tasks (`/api/v1/orgs/:orgId/schedules`, spec 2026-11-11-scheduled-tasks §10); human
17
+ * Automations (`/api/v1/orgs/:orgId/automations`, spec 2026-11-11-scheduled-tasks §10); human
18
18
  * users only (a service token gets 403).
19
19
  * - `GET /` → `{ items }`: the caller's own tasks, each with its `lastRun`; `?all=true` every task
20
- * of the org (org admins, `schedules.manage`, enforced by the service: 403 `forbidden`
20
+ * of the org (org admins, `automations.manage`, enforced by the service: 403 `forbidden`
21
21
  * otherwise); `?conversationId=` only those posting into that conversation;
22
22
  * - `GET /calendar?from&to&timeZone[&all][&taskId]` → the calendar (runs, planned occurrences,
23
23
  * collapsed task-days; calendar spec §5.1), `org.read` like the list, `all` as the list's;
24
24
  * - `GET /chat-targets` → `{ items }`: the chats the caller can point a `chat` task at;
25
25
  * - `GET /grantable-tools?agentId=` → `{ items }`: the agent's tools, each grantable or why not;
26
+ * - `GET /event-sources` → `{ items }`: the trigger sources that serve the org (not switched off),
27
+ * each `{ source, name, events }` with the event types and facts an event trigger can use;
26
28
  * - `POST /` → 201 `{ task }` (`timeZone` is the browser zone, a fallback only);
27
29
  * `GET /:id`, `PATCH /:id`, `POST /:id/pause`, `POST /:id/resume` → `{ task }`;
28
30
  * - `DELETE /:id` → 204; `POST /:id/run { trial? }` → 202 `{ run }`;
29
31
  * - `GET /:id/runs?limit` → `{ items }`; `GET /:id/grants` → `{ items }` (each with `stale`);
30
32
  * `POST /:id/grants { grants }` → `{ items }`; `DELETE /:id/grants/:toolKey` → 204.
31
33
  *
32
- * Roles: create, edit, resume, run and the grants need `schedules.use` (member and up; a guest
34
+ * Roles: create, edit, resume, run and the grants need `automations.use` (member and up; a guest
33
35
  * gets 403). Pause and delete are `org.read` (any member, a guest included) so a creator demoted
34
36
  * to guest can still stop and remove their own tasks; the service decides by the live role and
35
37
  * ownership (the creator, or an org admin), and a task the caller may not see is 404
36
- * `schedule.not_found`.
38
+ * `automation.not_found`.
37
39
  */
38
- let SchedulesController = class SchedulesController {
40
+ let AutomationsController = class AutomationsController {
39
41
  tasks;
40
42
  constructor(tasks) {
41
43
  this.tasks = tasks;
@@ -63,6 +65,9 @@ let SchedulesController = class SchedulesController {
63
65
  const p = requireUser(principal);
64
66
  return { items: await this.tasks.grantableTools(org.orgId, p.account.id, q.agentId) };
65
67
  }
68
+ async eventSources(org, _q) {
69
+ return { items: await this.tasks.eventSources(org.orgId) };
70
+ }
66
71
  async create(principal, org, body) {
67
72
  const p = requireUser(principal);
68
73
  const { input, browserTimeZone } = createInputOf(body);
@@ -139,118 +144,124 @@ __decorate([
139
144
  OrgAction("org.read"),
140
145
  __param(0, CurrentPrincipal()),
141
146
  __param(1, CurrentOrg()),
142
- __param(2, ZQuery(ScheduleListQueryDto))
143
- ], SchedulesController.prototype, "list", null);
147
+ __param(2, ZQuery(AutomationListQueryDto))
148
+ ], AutomationsController.prototype, "list", null);
144
149
  __decorate([
145
150
  Get("calendar"),
146
151
  OrgAction("org.read"),
147
152
  __param(0, CurrentPrincipal()),
148
153
  __param(1, CurrentOrg()),
149
- __param(2, ZQuery(ScheduleCalendarQueryDto))
150
- ], SchedulesController.prototype, "calendar", null);
154
+ __param(2, ZQuery(AutomationCalendarQueryDto))
155
+ ], AutomationsController.prototype, "calendar", null);
151
156
  __decorate([
152
157
  Get("chat-targets"),
153
- OrgAction("schedules.use"),
158
+ OrgAction("automations.use"),
154
159
  __param(0, CurrentPrincipal()),
155
160
  __param(1, CurrentOrg()),
156
- __param(2, ZQuery(ScheduleChatTargetsQueryDto))
157
- ], SchedulesController.prototype, "chatTargets", null);
161
+ __param(2, ZQuery(AutomationChatTargetsQueryDto))
162
+ ], AutomationsController.prototype, "chatTargets", null);
158
163
  __decorate([
159
164
  Get("grantable-tools"),
160
- OrgAction("schedules.use"),
165
+ OrgAction("automations.use"),
161
166
  __param(0, CurrentPrincipal()),
162
167
  __param(1, CurrentOrg()),
163
- __param(2, ZQuery(ScheduleGrantableQueryDto))
164
- ], SchedulesController.prototype, "grantableTools", null);
168
+ __param(2, ZQuery(AutomationGrantableQueryDto))
169
+ ], AutomationsController.prototype, "grantableTools", null);
170
+ __decorate([
171
+ Get("event-sources"),
172
+ OrgAction("automations.use"),
173
+ __param(0, CurrentOrg()),
174
+ __param(1, ZQuery(AutomationEventSourcesQueryDto))
175
+ ], AutomationsController.prototype, "eventSources", null);
165
176
  __decorate([
166
177
  Post(),
167
- OrgAction("schedules.use"),
178
+ OrgAction("automations.use"),
168
179
  __param(0, CurrentPrincipal()),
169
180
  __param(1, CurrentOrg()),
170
- __param(2, ZBody(ScheduleCreateBodyDto))
171
- ], SchedulesController.prototype, "create", null);
181
+ __param(2, ZBody(AutomationCreateBodyDto))
182
+ ], AutomationsController.prototype, "create", null);
172
183
  __decorate([
173
184
  Get(":id"),
174
- OrgAction("schedules.use"),
185
+ OrgAction("automations.use"),
175
186
  __param(0, CurrentPrincipal()),
176
187
  __param(1, CurrentOrg()),
177
- __param(2, ZParam(ScheduleParamsDto))
178
- ], SchedulesController.prototype, "get", null);
188
+ __param(2, ZParam(AutomationParamsDto))
189
+ ], AutomationsController.prototype, "get", null);
179
190
  __decorate([
180
191
  Patch(":id"),
181
- OrgAction("schedules.use"),
192
+ OrgAction("automations.use"),
182
193
  __param(0, CurrentPrincipal()),
183
194
  __param(1, CurrentOrg()),
184
- __param(2, ZParam(ScheduleParamsDto)),
185
- __param(3, ZBody(ScheduleUpdateBodyDto))
186
- ], SchedulesController.prototype, "update", null);
195
+ __param(2, ZParam(AutomationParamsDto)),
196
+ __param(3, ZBody(AutomationUpdateBodyDto))
197
+ ], AutomationsController.prototype, "update", null);
187
198
  __decorate([
188
199
  Delete(":id"),
189
200
  HttpCode(204),
190
201
  OrgAction("org.read"),
191
202
  __param(0, CurrentPrincipal()),
192
203
  __param(1, CurrentOrg()),
193
- __param(2, ZParam(ScheduleParamsDto))
194
- ], SchedulesController.prototype, "remove", null);
204
+ __param(2, ZParam(AutomationParamsDto))
205
+ ], AutomationsController.prototype, "remove", null);
195
206
  __decorate([
196
207
  Post(":id/pause"),
197
208
  HttpCode(200),
198
209
  OrgAction("org.read"),
199
210
  __param(0, CurrentPrincipal()),
200
211
  __param(1, CurrentOrg()),
201
- __param(2, ZParam(ScheduleParamsDto))
202
- ], SchedulesController.prototype, "pause", null);
212
+ __param(2, ZParam(AutomationParamsDto))
213
+ ], AutomationsController.prototype, "pause", null);
203
214
  __decorate([
204
215
  Post(":id/resume"),
205
216
  HttpCode(200),
206
- OrgAction("schedules.use"),
217
+ OrgAction("automations.use"),
207
218
  __param(0, CurrentPrincipal()),
208
219
  __param(1, CurrentOrg()),
209
- __param(2, ZParam(ScheduleParamsDto))
210
- ], SchedulesController.prototype, "resume", null);
220
+ __param(2, ZParam(AutomationParamsDto))
221
+ ], AutomationsController.prototype, "resume", null);
211
222
  __decorate([
212
223
  Post(":id/run"),
213
224
  HttpCode(202),
214
- OrgAction("schedules.use"),
225
+ OrgAction("automations.use"),
215
226
  __param(0, CurrentPrincipal()),
216
227
  __param(1, CurrentOrg()),
217
- __param(2, ZParam(ScheduleParamsDto)),
218
- __param(3, ZBody(ScheduleRunBodyDto))
219
- ], SchedulesController.prototype, "run", null);
228
+ __param(2, ZParam(AutomationParamsDto)),
229
+ __param(3, ZBody(AutomationRunBodyDto))
230
+ ], AutomationsController.prototype, "run", null);
220
231
  __decorate([
221
232
  Get(":id/runs"),
222
- OrgAction("schedules.use"),
233
+ OrgAction("automations.use"),
223
234
  __param(0, CurrentPrincipal()),
224
235
  __param(1, CurrentOrg()),
225
- __param(2, ZParam(ScheduleParamsDto)),
226
- __param(3, ZQuery(ScheduleRunsQueryDto))
227
- ], SchedulesController.prototype, "runs", null);
236
+ __param(2, ZParam(AutomationParamsDto)),
237
+ __param(3, ZQuery(AutomationRunsQueryDto))
238
+ ], AutomationsController.prototype, "runs", null);
228
239
  __decorate([
229
240
  Get(":id/grants"),
230
- OrgAction("schedules.use"),
241
+ OrgAction("automations.use"),
231
242
  __param(0, CurrentPrincipal()),
232
243
  __param(1, CurrentOrg()),
233
- __param(2, ZParam(ScheduleParamsDto))
234
- ], SchedulesController.prototype, "grants", null);
244
+ __param(2, ZParam(AutomationParamsDto))
245
+ ], AutomationsController.prototype, "grants", null);
235
246
  __decorate([
236
247
  Post(":id/grants"),
237
248
  HttpCode(200),
238
- OrgAction("schedules.use"),
249
+ OrgAction("automations.use"),
239
250
  __param(0, CurrentPrincipal()),
240
251
  __param(1, CurrentOrg()),
241
- __param(2, ZParam(ScheduleParamsDto)),
242
- __param(3, ZBody(ScheduleGrantsBodyDto))
243
- ], SchedulesController.prototype, "addGrants", null);
252
+ __param(2, ZParam(AutomationParamsDto)),
253
+ __param(3, ZBody(AutomationGrantsBodyDto))
254
+ ], AutomationsController.prototype, "addGrants", null);
244
255
  __decorate([
245
256
  Delete(":id/grants/:toolKey"),
246
257
  HttpCode(204),
247
- OrgAction("schedules.use"),
258
+ OrgAction("automations.use"),
248
259
  __param(0, CurrentPrincipal()),
249
260
  __param(1, CurrentOrg()),
250
- __param(2, ZParam(ScheduleGrantParamsDto))
251
- ], SchedulesController.prototype, "removeGrant", null);
252
- SchedulesController = __decorate([
253
- Controller("api/v1/orgs/:orgId/schedules"),
254
- __param(0, Inject(ScheduledTasksService))
255
- ], SchedulesController);
256
- export { SchedulesController };
261
+ __param(2, ZParam(AutomationGrantParamsDto))
262
+ ], AutomationsController.prototype, "removeGrant", null);
263
+ AutomationsController = __decorate([
264
+ Controller("api/v1/orgs/:orgId/automations"),
265
+ __param(0, Inject(AutomationsService))
266
+ ], AutomationsController);
267
+ export { AutomationsController };
@@ -0,0 +1,16 @@
1
+ import { type OnModuleInit } from "@nestjs/common";
2
+ import { AutomationToolsPort } from "../tools/builtins/automations.js";
3
+ import { AutomationsService } from "./automations.service.js";
4
+ /**
5
+ * Automations for people (spec 2026-11-11): the service the HTTP API, the Platform operations
6
+ * and the automation tools share. ToolsModule: grants resolve the agent's tools (`ToolRegistry`);
7
+ * ExtensionRegistryModule: a group chat target needs its channel's `features.threads`. At start
8
+ * it binds the service into the automation tools' port (`AutomationToolsPort`): the tools cannot
9
+ * inject it, since this module imports theirs.
10
+ */
11
+ export declare class AutomationsModule implements OnModuleInit {
12
+ private readonly port;
13
+ private readonly service;
14
+ constructor(port: AutomationToolsPort, service: AutomationsService);
15
+ onModuleInit(): void;
16
+ }
@@ -11,23 +11,24 @@ import { Inject, Module } from "@nestjs/common";
11
11
  import { AgentLookupModule } from "../agents/agent-lookup.js";
12
12
  import { ConversationAccessModule } from "../conversations/access.js";
13
13
  import { DialInModule } from "../dial-in/dial-in.module.js";
14
+ import { ExtensionsModule } from "../extensions/extensions.module.js";
14
15
  import { ExtensionRegistryModule } from "../extensions/registry.js";
15
16
  import { OrgLockModule } from "../orgs/org-lock.js";
16
17
  import { ProvidersModule } from "../runtime/providers.js";
17
18
  import { NetworkGrantsModule } from "../sandbox/network-grants.module.js";
18
19
  import { SandboxModule } from "../sandbox/sandbox.module.js";
19
- import { ScheduleToolsPort } from "../tools/builtins/schedules.js";
20
+ import { AutomationToolsPort } from "../tools/builtins/automations.js";
20
21
  import { ToolsModule } from "../tools/tools.module.js";
21
- import { ScheduledTasksService } from "./scheduled-tasks.service.js";
22
- import { ScheduledTaskStoreModule } from "./store.module.js";
22
+ import { AutomationsService } from "./automations.service.js";
23
+ import { AutomationStoreModule } from "./store.module.js";
23
24
  /**
24
- * Scheduled tasks for people (spec 2026-11-11): the service the HTTP API, the Platform operations
25
- * and the schedule tools share. ToolsModule: grants resolve the agent's tools (`ToolRegistry`);
25
+ * Automations for people (spec 2026-11-11): the service the HTTP API, the Platform operations
26
+ * and the automation tools share. ToolsModule: grants resolve the agent's tools (`ToolRegistry`);
26
27
  * ExtensionRegistryModule: a group chat target needs its channel's `features.threads`. At start
27
- * it binds the service into the schedule tools' port (`ScheduleToolsPort`): the tools cannot
28
+ * it binds the service into the automation tools' port (`AutomationToolsPort`): the tools cannot
28
29
  * inject it, since this module imports theirs.
29
30
  */
30
- let SchedulesModule = class SchedulesModule {
31
+ let AutomationsModule = class AutomationsModule {
31
32
  port;
32
33
  service;
33
34
  constructor(port, service) {
@@ -38,14 +39,16 @@ let SchedulesModule = class SchedulesModule {
38
39
  this.port.bind(this.service);
39
40
  }
40
41
  };
41
- SchedulesModule = __decorate([
42
+ AutomationsModule = __decorate([
42
43
  Module({
43
44
  imports: [
44
- ScheduledTaskStoreModule,
45
+ AutomationStoreModule,
45
46
  OrgLockModule,
46
47
  AgentLookupModule,
47
48
  ConversationAccessModule,
48
49
  ExtensionRegistryModule,
50
+ // event automations: the trigger sources of an org and their display names
51
+ ExtensionsModule,
49
52
  ToolsModule,
50
53
  // a new-conversation task's model must resolve for the org
51
54
  ProvidersModule,
@@ -54,10 +57,10 @@ SchedulesModule = __decorate([
54
57
  NetworkGrantsModule,
55
58
  DialInModule,
56
59
  ],
57
- providers: [ScheduledTasksService],
58
- exports: [ScheduledTasksService, ScheduledTaskStoreModule],
60
+ providers: [AutomationsService],
61
+ exports: [AutomationsService, AutomationStoreModule],
59
62
  }),
60
- __param(0, Inject(ScheduleToolsPort)),
61
- __param(1, Inject(ScheduledTasksService))
62
- ], SchedulesModule);
63
- export { SchedulesModule };
63
+ __param(0, Inject(AutomationToolsPort)),
64
+ __param(1, Inject(AutomationsService))
65
+ ], AutomationsModule);
66
+ export { AutomationsModule };